Index: /issm/trunk/Makefile.am
===================================================================
--- /issm/trunk/Makefile.am	(revision 26743)
+++ /issm/trunk/Makefile.am	(revision 26744)
@@ -1,3 +1,3 @@
-EXTRA_DIST = reconf scripts test m4 examples cron etc doc packages contributors.txt 
+EXTRA_DIST = reconf scripts test m4 examples cron etc doc packages contributors.txt
 SUBDIRS = src
 bin_SCRIPTS= README.rtf
Index: /issm/trunk/configure.ac
===================================================================
--- /issm/trunk/configure.ac	(revision 26743)
+++ /issm/trunk/configure.ac	(revision 26744)
@@ -2,7 +2,7 @@
 
 #AUTOCONF
-AC_INIT([Ice Sheet System Model (ISSM)],[4.18],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
-AC_CONFIG_AUX_DIR([./aux-config])         #Put config files in aux-config
-AC_CONFIG_MACRO_DIR([m4])                 #m4 macros are located in m4
+AC_INIT([Ice Sheet System Model (ISSM)],[4.19],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
+AC_CONFIG_AUX_DIR([./aux-config])	# Put config files in aux-config
+AC_CONFIG_MACRO_DIR([m4])			# m4 macros are located in m4
 m4_include([m4/issm_options.m4])
 
@@ -25,10 +25,10 @@
 #Initialize automake and declare foreign so that we don't need a ChangeLog, INSTALL, etc
 AM_INIT_AUTOMAKE([foreign])
-AC_CONFIG_HEADERS([./config.h])   #Config file must be config.h
-AM_SILENT_RULES([yes])           #Do not show compilation command by default
+AC_CONFIG_HEADERS([./config.h])		# Config file must be config.h
+AM_SILENT_RULES([yes])				# Reduce compilation and linking output (comment this line out or set value to "no" for verbose output)
 AM_PROG_AR
 
 #Libtool
-LT_INIT
+LT_INIT([win32-dll])
 
 #Run issm_options.m4
@@ -37,15 +37,13 @@
 #List all Makefiles
 AC_CONFIG_FILES([
-					  Makefile
-					  src/Makefile
-					  src/c/Makefile 
-					  src/wrappers/Makefile
-					  src/wrappers/python/Makefile
-					  src/wrappers/matlab/Makefile
-					  src/wrappers/javascript/Makefile
-					  src/mobile/Makefile
-					  src/mobile/native/Makefile
-					  src/m/Makefile
-					  ])
+	Makefile
+	src/Makefile
+	src/c/Makefile
+	src/wrappers/Makefile
+	src/wrappers/python/Makefile
+	src/wrappers/matlab/Makefile
+	src/wrappers/javascript/Makefile
+	src/m/Makefile
+])
 
 #End of configure.ac
Index: /issm/trunk/etc/environment.csh
===================================================================
--- /issm/trunk/etc/environment.csh	(revision 26743)
+++ /issm/trunk/etc/environment.csh	(revision 26744)
@@ -1,115 +1,245 @@
-#ISSM_DIR should have been defined already in your shell settings file (.bashrc, .cshrc, etc ...)
-
-#Load ISSM scripts
-setenv PATH {$PATH}:{$ISSM_DIR}/scripts
-
-#MPI
-set MPI_DIR="$ISSM_DIR/externalpackages/mpich/install"
-if (-d $MPI_DIR) then
-	setenv MPI_DIR {$MPI_DIR}
-	setenv PATH {$MPI_DIR}/bin:{$PATH}
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$MPI_DIR/lib
-	setenv MANPATH {$MANPATH}:$MPI_DIR/man
-endif
-
-#PETSC
-set PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install"
-if (-d $PETSC_DIR) then
-	setenv PETSC_DIR {$PETSC_DIR}
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$PETSC_DIR/lib
-endif
-
-set SCOTCH_DIR="$ISSM_DIR/externalpackages/scotch/install"
-if (-d $SCOTCH_DIR) then
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$SCOTCH_DIR/lib
-endif
-
-#SLEPC
-set SLEPC_DIR="$ISSM_DIR/externalpackages/slepc/install"
-if (-d $SLEPC_DIR) then
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$SLEPC_DIR/lib
-endif
-
-#PETSC
-set TAO_DIR="$ISSM_DIR/externalpackages/tao/install"
-if (-d $TAO_DIR) then
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$TAO_DIR/lib
-endif
-
-#Dakota
-set DAKOTA_DIR="$ISSM_DIR/externalpackages/dakota/install"
-if (-d $DAKOTA_DIR) then
-	setenv PATH {$DAKOTA_DIR}/bin:{$PATH}
-	setenv MANPATH {$MANPATH}:{$MPI_DIR}/man:{$DAKOTA_DIR}/docs/man:{$DAKOTA_DIR}/docs/man-ref
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$DAKOTA_DIR/lib
-endif
-
-#Boost
-set BOOST_DIR="$ISSM_DIR/externalpackages/boost/install"
-set BOOSTROOT="$ISSM_DIR/externalpackages/boost/install"
-if (-d $BOOST_DIR) then
-   setenv PATH {$BOOST_DIR}/bin:{$PATH}
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$BOOST_DIR/lib
-endif
-
-#Doxygen
-set DOXYGEN_DIR="$ISSM_DIR/externalpackages/doxygen/install"
-if (-d $DOXYGEN_DIR) then
-	setenv MANPATH {$MANPATH}:{$DOXYGEN_DIR}/man
-	setenv PATH {$PATH}:{$DOXYGEN_DIR}/bin
-endif
-
-#AUTOTOOLS
-set AUTOTOOLS_DIR="$ISSM_DIR/externalpackages/autotools/install"
-if (-d $AUTOTOOLS_DIR) then
-	setenv PATH {$AUTOTOOLS_DIR}/bin:{$PATH}
-endif
-
-#SSH
-set SSH_DIR="$ISSM_DIR/externalpackages/ssh"
-if (-d $SSH_DIR) then
-	setenv PATH {$PATH}:{$SSH_DIR}
-endif
-
-#VALGRIND
-set VALGRIND_DIR="$ISSM_DIR/externalpackages/valgrind/install/bin"
-if (-d $VALGRIND_DIR) then
-	setenv PATH {$PATH}:{$VALGRIND_DIR}
-endif
-
-#MERCURIAL
-set MERCURIAL_DIR="$ISSM_DIR/externalpackages/mercurial/install"
-if (-d $MERCURIAL_DIR) then
-	setenv PYTHONPATH {$MERCURIAL_DIR}/mercurial/pure/
-	setenv PATH {$PATH}:{$MERCURIAL_DIR}
-endif
-
-#GSL
-set GSL_DIR="$ISSM_DIR/externalpackages/gsl/install"
-if (-d $GSL_DIR) then
-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GSL_DIR}/lib
-endif
-
-#CMAKE
-set CMAKE_DIR="$ISSM_DIR/externalpackages/cmake/install"
-if (-d $CMAKE_DIR) then
-	setenv PATH {$CMAKE_DIR}/bin:{$PATH}
-endif
-
-#YAMS
-set YAMS_DIR="$ISSM_DIR/externalpackages/yams/install"
-if (-d $YAMS_DIR) then
-	setenv PATH {$PATH}:{$YAMS_DIR}/bin
-endif
-
-#SHELL2JUNIT
-set SHELL2JUNIT_DIR="$ISSM_DIR/externalpackages/shell2junit"
-if (-d $SHELL2JUNIT_DIR) then
-	setenv PATH {$SHELL2JUNIT_DIR}/install:{$PATH}
-endif
-
-#GMT
-set GMT_DIR="$ISSM_DIR/externalpackages/gmt"
-if (-d $GMT_DIR) then
-	setenv PATH {$GMT_DIR}/install/bin/:{$PATH}
-endif
+# Modifies path-related envrionment variables based on which external packages
+# have been installed.
+#
+# ISSM_DIR and ISSM_ARCH should have been defined already in your shell
+# settings file (i.e. .bashrc, .cshrc).
+#
+# TODO:
+# - Condition all path modifications on existence of external package 'install'
+#	directory
+#
+
+# Silence `<command>: no match`
+set nonomatch=1
+
+setenv PATH "{$PATH}:{$ISSM_DIR}/aux-config"
+setenv PATH "{$PATH}:{$ISSM_DIR}/scripts"
+
+set ISSM_EXT_DIR="{$ISSM_DIR}/externalpackages" # Redefine this constant if externalpackages are installed to a different directory
+
+#########################
+# Command-line utilities
+#########################
+set SSH_ROOT="{$ISSM_EXT_DIR}/ssh"
+if ( -d {$SSH_ROOT} ) then
+	setenv PATH "{$PATH}:{$SSH_ROOT}"
+endif
+
+#############################
+# Build systems
+#############################
+set AUTOTOOLS_ROOT="{$ISSM_EXT_DIR}/autotools/install"
+setenv PATH "{$AUTOTOOLS_ROOT}/bin:{$PATH}"
+
+set CMAKE_ROOT="{$ISSM_EXT_DIR}/cmake/install"
+setenv PATH "{$CMAKE_ROOT}/bin:{$PATH}"
+
+#############################
+# Libraries / binaries
+#############################
+set MPI_ROOT="{$ISSM_EXT_DIR}/mpich/install"
+if ( -d {$MPI_ROOT} ) then
+	setenv MPI_DIR {$MPI_ROOT}
+	setenv MPI_HOME {$MPI_ROOT} # Used in installation of Dakota
+	setenv MPI_INC_DIR {$MPI_ROOT}/include
+	setenv PATH "{$MPI_ROOT}/bin:{$PATH}"
+	setenv CPATH "{$MPI_ROOT}/include:{$CPATH}"
+	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$MPI_ROOT}/lib"
+endif
+
+# NOTE: Check *must* come before PETSc as we prefer packages installed via 
+# 		PETSc
+#
+set ZLIB_ROOT="{$ISSM_EXT_DIR}/zlib/install"
+if ( -d {$ZLIB_ROOT} ) then
+	setenv ZLIB_ROOT {$ZLIB_ROOT} # Used in installation of NetCDF, GDAL, GMT
+	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$LD_LIBRARY_PATH}/lib"
+endif
+
+set PETSC_ROOT="{$ISSM_EXT_DIR}/petsc/install"
+if ( -d {$PETSC_ROOT} ) then
+	setenv PETSC_ROOT {$PETSC_ROOT}
+	setenv LD_LIBRARY_PATH {$PETSC_ROOT}/lib:{$LD_LIBRARY_PATH}
+
+	# In case we have installed certain external packages via PETSc
+	#
+
+	# BLAS
+	if ( `find {$PETSC_ROOT}/lib -name libblas.*` != "" || `find {$PETSC_ROOT}/lib -name libfblas.*` != "" ) then
+		setenv BLAS_ROOT "{$PETSC_ROOT}" # Used in installation of Dakota, GMT
+	endif
+
+	# HDF5
+	if ( `find {$PETSC_ROOT}/lib -name libhdf5.*` != "" ) then
+		setenv HDF5_ROOT "{$PETSC_ROOT}" # Used in installation of NetCDF, GDAL
+		setenv CPATH {$CPATH}:{$PETSC_ROOT}/include
+		setenv LIBRARY_PATH {$LIBRARY_PATH}:{$PETSC_ROOT}/lib
+		setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$PETSC_ROOT}/lib
+		setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$PETSC_ROOT}/lib
+	endif
+
+	# LAPACK
+	if ( `find {$PETSC_ROOT}/lib -name liblapack.*` != "" || `find {$PETSC_ROOT}/lib -name libflapack.*` != "" ) then
+		setenv LAPACK_ROOT "{$PETSC_ROOT}" # Used in installation of Dakota, GMT
+	endif
+
+	# METIS
+	if ( `find {$PETSC_ROOT}/lib -name libmetis.*` != "" ) then
+		setenv METIS_ROOT "{$PETSC_ROOT}" # Used in installation of Gmsh
+	endif
+
+	# MPICH
+	if ( -f "{$PETSC_ROOT}/bin/mpiexec" ) then
+		set MPI_ROOT={$PETSC_ROOT}
+		setenv MPI_DIR {$MPI_ROOT}
+		setenv MPI_HOME {$MPI_ROOT} # Used in installation of Dakota
+		setenv MPI_INC_DIR {$MPI_ROOT}/include
+		setenv PATH {$MPI_ROOT}/bin:{$PATH}
+		setenv CPATH {$MPI_ROOT}/include:{$CPATH}
+		setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$MPI_ROOT}/lib
+	endif
+
+	# ZLIB
+	if ( `find {$PETSC_ROOT}/lib -name libz.*` != "" ) then
+		setenv ZLIB_ROOT "{$PETSC_ROOT}" # Used in installation of NetCDF, GDAL
+		setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$PETSC_ROOT}/lib
+	endif
+endif
+
+set SCOTCH_ROOT="{$ISSM_EXT_DIR}/scotch/install"
+if ( -d {$SCOTCH_ROOT} ) then
+	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$SCOTCH_ROOT}/lib
+endif
+
+set SLEPC_ROOT="{$ISSM_EXT_DIR}/slepc/install"
+if ( -d {$SLEPC_ROOT} ) then
+	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$SLEPC_ROOT}/lib
+endif
+
+set TAO_ROOT="{$ISSM_EXT_DIR}/tao/install"
+if ( -d {$TAO_ROOT} ) then
+	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$TAO_ROOT}/lib
+endif
+
+set DAKOTA_ROOT="{$ISSM_EXT_DIR}/dakota/install"
+if ( -d {$DAKOTA_ROOT} ) then
+	setenv PATH {$PATH}:{$DAKOTA_ROOT}/bin
+	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$DAKOTA_ROOT}/lib
+	setenv DYLD_LIBRARY_PATH {$DAKOTA_ROOT}/lib:{$DYLD_LIBRARY_PATH}
+endif
+
+set MERCURIAL_ROOT="{$ISSM_EXT_DIR}/mercurial/install"
+if ( -d {$MERCURIAL_ROOT} ) then
+	setenv PYTHONPATH {$PYTHONPATH}:{$MERCURIAL_ROOT}/mercurial/pure
+	setenv PATH {$PATH}:{$MERCURIAL_ROOT}
+endif
+
+set BOOST_ROOT="{$ISSM_EXT_DIR}/boost/install"
+if ( -d {$BOOST_ROOT} ) then
+	setenv BOOST_ROOT {$BOOST_ROOT} # Used in installation of Dakota
+	setenv BOOST_DIR {$BOOST_ROOT}
+	setenv BOOSTROOT {$BOOST_ROOT}
+	setenv LIBRARY_PATH {$BOOST_ROOT}/lib:{$LIBRARY_PATH}
+	setenv LD_LIBRARY_PATH {$BOOST_ROOT}/lib:{$LD_LIBRARY_PATH}
+	setenv DYLD_LIBRARY_PATH {$BOOST_ROOT}/lib:{$DYLD_LIBRARY_PATH}
+	setenv PATH {$BOOST_ROOT}/bin:{$PATH}
+endif
+
+set GSL_ROOT="{$ISSM_EXT_DIR}/gsl/install"
+if ( -d {$GSL_ROOT} ) then
+	setenv GSL_HOME "{$GSL_ROOT}" # Used in installation of Dakota
+	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GSL_ROOT}/lib
+endif
+
+set NETCDF_ROOT="{$ISSM_EXT_DIR}/netcdf/install"
+if ( -d {$NETCDF_ROOT} ) then
+	setenv NETCDF_ROOT "{$NETCDF_ROOT}" # Used in installation of GDAL, GMT
+	setenv PATH {$PATH}:{$NETCDF_ROOT}/bin
+	setenv CPATH {$CPATH}:{$NETCDF_ROOT}/include
+	setenv LIBRARY_PATH {$LIBRARY_PATH}:{$NETCDF_ROOT}/lib
+	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$NETCDF_ROOT}/lib
+	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$NETCDF_ROOT}/lib
+endif
+
+set CURL_ROOT="{$ISSM_EXT_DIR}/curl/install"
+if ( -d {$CURL_ROOT} ) then
+	setenv CURL_ROOT "{$CURL_ROOT}" # Used in installation of NetCDF, GDAL, GMT
+	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$CURL_ROOT}/lib
+	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$CURL_ROOT}/lib
+	setenv PATH {$PATH}:{$CURL_ROOT}/bin
+endif
+
+set HDF5_ROOT="{$ISSM_EXT_DIR}/hdf5/install"
+if ( -d {$HDF5_ROOT} ) then
+	setenv HDF5_ROOT "{$HDF5_ROOT}" # Used in installation of NetCDF, GDAL
+	setenv CPATH {$CPATH}:{$HDF5_ROOT}/include
+	setenv LIBRARY_PATH {$LIBRARY_PATH}:{$HDF5_ROOT}/lib
+	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$HDF5_ROOT}/lib
+	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$HDF5_ROOT}/lib
+endif
+
+set SQLITE_ROOT="{$ISSM_EXT_DIR}/sqlite/install"
+if ( -d {$SQLITE_ROOT} ) then
+	setenv PATH {$PATH}:{$SQLITE_ROOT}/bin
+	setenv LIBRARY_PATH {$LIBRARY_PATH}:{$SQLITE_ROOT}/lib
+	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$SQLITE_ROOT}/lib
+endif
+
+set PROJ_ROOT="{$ISSM_EXT_DIR}/proj/install"
+if ( -d {$PROJ_ROOT} ) then
+	setenv PROJ_ROOT "${PROJ_ROOT}" # Used in installation of GDAL
+	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$PROJ_ROOT}/lib
+	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$PROJ_ROOT}/lib
+endif
+
+set GDAL_ROOT="{$ISSM_EXT_DIR}/gdal/install"
+if ( -d {$GDAL_ROOT} ) then
+	setenv GDAL_ROOT "{$GDAL_ROOT}" # Used in installation of GMT
+	setenv PATH {$GDAL_ROOT}/bin:{$PATH}
+	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GDAL_ROOT}/lib
+endif
+
+set GSHHG_ROOT="{$ISSM_EXT_DIR}/gshhg/install"
+if ( -d {$GSHHG_ROOT} ) then
+	setenv GSHHG_ROOT "{$GSHHG_ROOT}" # Used in installation of GMT
+endif
+
+set GMT_ROOT="{$ISSM_EXT_DIR}/gmt/install"
+if ( -d {$GMT_ROOT} ) then
+	setenv PATH {$GMT_ROOT}/bin:{$PATH}
+	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GMT_ROOT}/lib
+	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$GMT_ROOT}/lib
+endif
+
+set GMSH_ROOT="{$ISSM_EXT_DIR}/gmsh/install"
+if ( -d {$GMSH_ROOT} ) then
+	setenv PATH {$GMSH_ROOT}/bin:{$PATH}
+	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GMSH_ROOT}/lib
+	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$GMSH_ROOT}/lib
+endif
+
+set TRIANGLE_ROOT="{$ISSM_EXT_DIR}/triangle/install"
+if ( -d {$TRIANGLE_ROOT} ) then
+	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$TRIANGLE_ROOT}/lib
+	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$TRIANGLE_ROOT}/lib
+endif
+
+set YAMS_ROOT="{$ISSM_EXT_DIR}/yams/install"
+if ( -d {$YAMS_ROOT} ) then
+	setenv PATH {$PATH}:{$YAMS_ROOT}
+endif
+
+set VALGRIND_ROOT="{$ISSM_EXT_DIR}/valgrind/install"
+if ( -d {$VALGRIND_ROOT} ) then
+	setenv PATH {$VALGRIND_ROOT}/bin:{$PATH}
+endif
+
+set DOXYGEN_ROOT="{$ISSM_EXT_DIR}/doxygen/install"
+if ( -d {$DOXYGEN_ROOT} ) then
+	setenv PATH {$DOXYGEN_ROOT}/bin:{$PATH}
+endif
+
+set SHELL2JUNIT_ROOT="{$ISSM_EXT_DIR}/shell2junit/install"
+if ( -d {$SHELL2JUNIT_ROOT} ) then
+	setenv PATH {$PATH}:{$SHELL2JUNIT_ROOT}/install
+endif
Index: /issm/trunk/etc/environment.sh
===================================================================
--- /issm/trunk/etc/environment.sh	(revision 26743)
+++ /issm/trunk/etc/environment.sh	(revision 26744)
@@ -1,3 +1,3 @@
-# Modifies path-related envrionment variables based on which external packages
+# Modifies path-related environment variables based on which external packages
 # have been installed.
 #
@@ -10,9 +10,14 @@
 #
 
+if [[ -n "$ZSH_VERSION" ]]; then
+	# Silence `zsh: no matches found: <file>`
+	setopt +o nomatch 1> /dev/null 2>&1
+fi
+
 ## Functions
 #
 c_include_path_append(){ #{{{
 	if [ -d "${1}" ]; then
-		if [ -z $C_INCLUDE_PATH ]; then
+		if [ -z "${C_INCLUDE_PATH}" ]; then
 			export C_INCLUDE_PATH="${1}"
 		elif [[ ":${C_INCLUDE_PATH}:" != *":${1}:"* ]]; then
@@ -23,5 +28,5 @@
 c_include_path_prepend(){ #{{{
 	if [ -d "${1}" ]; then
-		if [ -z $C_INCLUDE_PATH ]; then
+		if [ -z "${C_INCLUDE_PATH}" ]; then
 			export C_INCLUDE_PATH="${1}"
 		elif [[ ":${C_INCLUDE_PATH}:" != *":${1}:"* ]]; then
@@ -33,5 +38,5 @@
 cpath_append(){ #{{{
 	if [ -d "${1}" ]; then
-		if [ -z $CPATH ]; then
+		if [ -z "${CPATH}" ]; then
 			export CPATH="${1}"
 		elif [[ ":${CPATH}:" != *":${1}:"* ]]; then
@@ -42,5 +47,5 @@
 cpath_prepend(){ #{{{
 	if [ -d "${1}" ]; then
-		if [ -z $CPATH ]; then
+		if [ -z "${CPATH}" ]; then
 			export CPATH="${1}"
 		elif [[ ":${CPATH}:" != *":${1}:"* ]]; then
@@ -52,5 +57,5 @@
 cplus_include_path_append(){ #{{{
 	if [ -d "${1}" ]; then
-		if [ -z $CPLUS_INCLUDE_PATH ]; then
+		if [ -z "${CPLUS_INCLUDE_PATH}" ]; then
 			export CPLUS_INCLUDE_PATH="${1}"
 		elif [[ ":${CPLUS_INCLUDE_PATH}:" != *":${1}:"* ]]; then
@@ -61,5 +66,5 @@
 cplus_include_path_prepend(){ #{{{
 	if [ -d "${1}" ]; then
-		if [ -z $CPLUS_INCLUDE_PATH ]; then
+		if [ -z "${CPLUS_INCLUDE_PATH}" ]; then
 			export CPLUS_INCLUDE_PATH="${1}"
 		elif [[ ":${CPLUS_INCLUDE_PATH}:" != *":${1}:"* ]]; then
@@ -71,10 +76,10 @@
 dyld_library_path_append(){ #{{{
 	if [ -d "${1}" ]; then
-		if [ -z $DYLD_LIBRARY_PATH ]; then
+		if [ -z "${DYLD_LIBRARY_PATH}" ]; then
 			export DYLD_LIBRARY_PATH="${1}"
 		elif [[ ":${DYLD_LIBRARY_PATH}:" != *":${1}:"* ]]; then
 			export DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${1}"
 		fi
-		if [ -z $LD_RUN_PATH ]; then
+		if [ -z "${LD_RUN_PATH}" ]; then
 			export LD_RUN_PATH=$1
 		elif [[ ":${LD_RUN_PATH}:" != *":${1}:"* ]]; then
@@ -85,10 +90,10 @@
 dyld_library_path_prepend(){ #{{{
 	if [ -d "${1}" ]; then
-		if [ -z $DYLD_LIBRARY_PATH ]; then
+		if [ -z "${DYLD_LIBRARY_PATH}" ]; then
 			export DYLD_LIBRARY_PATH="${1}"
 		elif [[ ":${DYLD_LIBRARY_PATH}:" != *":${1}:"* ]]; then
 			export DYLD_LIBRARY_PATH="${1}:${DYLD_LIBRARY_PATH}"
 		fi
-		if [ -z $LD_RUN_PATH ]; then
+		if [ -z "${LD_RUN_PATH}" ]; then
 			export LD_RUN_PATH="${1}"
 		elif [[ ":${LD_RUN_PATH}:" != *":${1}:"* ]]; then
@@ -100,10 +105,10 @@
 ld_library_path_append(){ #{{{
 	if [ -d "${1}" ]; then
-		if [ -z $LD_LIBRARY_PATH ]; then
+		if [ -z "${LD_LIBRARY_PATH}" ]; then
 			export LD_LIBRARY_PATH="${1}"
 		elif [[ ":${LD_LIBRARY_PATH}:" != *":${1}:"* ]]; then
 			export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${1}"
 		fi
-		if [ -z $LD_RUN_PATH ]; then
+		if [ -z "${LD_RUN_PATH}" ]; then
 			export LD_RUN_PATH="${1}"
 		elif [[ ":${LD_RUN_PATH}:" != *":$1:"* ]]; then
@@ -114,10 +119,10 @@
 ld_library_path_prepend(){ #{{{
 	if [ -d "${1}" ]; then
-		if [ -z $LD_LIBRARY_PATH ]; then
+		if [ -z "${LD_LIBRARY_PATH}" ]; then
 			export LD_LIBRARY_PATH="${1}"
 		elif [[ ":${LD_LIBRARY_PATH}:" != *":${1}:"* ]]; then
 			export LD_LIBRARY_PATH="${1}:${LD_LIBRARY_PATH}"
 		fi
-		if [ -z $LD_RUN_PATH ]; then
+		if [ -z "${LD_RUN_PATH}" ]; then
 			export LD_RUN_PATH="${1}"
 		elif [[ ":${LD_RUN_PATH}:" != *":${1}:"* ]]; then
@@ -129,5 +134,5 @@
 library_path_append(){ #{{{
 	if [ -d "${1}" ]; then
-		if [ -z $LIBRARY_PATH ]; then
+		if [ -z "${LIBRARY_PATH}" ]; then
 			export LIBRARY_PATH="${1}"
 		elif [[ ":${LIBRARY_PATH}:" != *":$1:"* ]]; then
@@ -138,5 +143,5 @@
 library_path_prepend(){ #{{{
 	if [ -d "${1}" ]; then
-		if [ -z $LIBRARY_PATH ]; then
+		if [ -z "${LIBRARY_PATH}" ]; then
 			export LIBRARY_PATH="${1}"
 		elif [[ ":${LIBRARY_PATH}:" != *":$1:"* ]]; then
@@ -165,309 +170,492 @@
 } #}}}
 
-# Windows compilers:
-if [[ "$ISSM_ARCH" == "cygwin-intel" ]]; then
-	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
-fi
-
-# Load ISSM scripts
+path_append "${ISSM_DIR}/aux-config"
 path_append "${ISSM_DIR}/scripts"
 
-SVN_DIR="${ISSM_DIR}/externalpackages/svn/install"
-if [ -d "${SVN_DIR}" ]; then
-	path_prepend   "${SVN_DIR}/bin"
-	ld_library_path_append "${SVN_DIR}/lib"
-fi
-
-GIT_DIR="${ISSM_DIR}/externalpackages/git/install"
-if [ -d "${GIT_DIR}" ]; then
-	path_prepend "${GIT_DIR}/bin"
-fi
-
-MPI_DIR="${ISSM_DIR}/externalpackages/mpich/install"
-if [ -d "${MPI_DIR}" ]; then
-	export MPI_DIR
-	export MPI_HOME=${MPI_DIR} # Needed by Dakota
-	export MPI_INC_DIR="$MPI_DIR/include"
-	path_prepend "${MPI_DIR}/bin"
-	cpath_prepend "${MPI_DIR}/include"
-	ld_library_path_append "${MPI_DIR}/lib"
-fi
-
-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/install"
-if [ -d "$PETSC_DIR" ]; then
-	export PETSC_DIR
-	ld_library_path_prepend "${PETSC_DIR}/lib"
-
-	# In case we have installed MPICH via PETSc
-	if [ -f "${PETSC_DIR}/bin/mpiexec" ]; then
-		MPI_DIR=${PETSC_DIR}
-		export MPI_DIR
-		export MPI_HOME=${MPI_DIR} # Needed by Dakota
-		export MPI_INC_DIR="${MPI_DIR}/include"
-		path_prepend "${MPI_DIR}/bin"
-		cpath_prepend "${MPI_DIR}/include"
-	fi
-fi
-
-LAPACK_DIR="${ISSM_DIR}/externalpackages/lapack/install"
-ld_library_path_append "${LAPACK_DIR}/lib"
-
-SCOTCH_DIR="${ISSM_DIR}/externalpackages/scotch/install"
-ld_library_path_append "$SCOTCH_DIR/lib"
-
-SLEPC_DIR="${ISSM_DIR}/externalpackages/slepc/install"
-ld_library_path_append "$SLEPC_DIR/lib"
-
-TAO_DIR="${ISSM_DIR}/externalpackages/tao/install"
-ld_library_path_append "$TAO_DIR/lib"
-
-DAKOTA_DIR="${ISSM_DIR}/externalpackages/dakota/install"
-if [ -d "${DAKOTA_DIR}" ]; then
-	path_append "${DAKOTA_DIR}/bin"
-	ld_library_path_append "${DAKOTA_DIR}/lib"
-	dyld_library_path_prepend "${DAKOTA_DIR}/lib"
-fi
-
-DOXYGEN_DIR="${ISSM_DIR}/externalpackages/doxygen/install"
-path_prepend "$DOXYGEN_DIR/bin"
-
-AUTOTOOLS_DIR="${ISSM_DIR}/externalpackages/autotools/install"
-path_prepend "$AUTOTOOLS_DIR/bin"
-
-SDK_DIR="C:/MicrosoftVisualStudio 9.0/Microsoft Visual C++ 2008 Express Edition with SP1 - ENU"
-path_append "$SDK_DIR"
-
-SSH_DIR="${ISSM_DIR}/externalpackages/ssh"
-path_append "$SSH_DIR"
-
-VALGRIND_DIR="${ISSM_DIR}/externalpackages/valgrind/install"
-path_prepend "$VALGRIND_DIR/bin"
-
-NCO_DIR="${ISSM_DIR}/externalpackages/nco/install/bin"
-path_prepend "$NCO_DIR/bin"
-
-CPPCHECK_DIR="${ISSM_DIR}/externalpackages/cppcheck/install"
-path_append "$CPPCHECK_DIR/bin"
-
-MERCURIAL_DIR="${ISSM_DIR}/externalpackages/mercurial/install"
-if [ -d "$MERCURIAL_DIR" ]; then
-	export PYTHONPATH="$PYTHONPATH:$MERCURIAL_DIR/mercurial/pure/"
-	path_append "$MERCURIAL_DIR"
-fi
-
-BOOST_DIR="${ISSM_DIR}/externalpackages/boost/install"
-BOOSTROOT="${ISSM_DIR}/externalpackages/boost/install"
-if [ -d "${BOOST_DIR}" ]; then
-	export BOOSTROOT
-	export BOOST_DIR
-	library_path_prepend "${BOOST_DIR}/lib"
-	ld_library_path_prepend "${BOOST_DIR}/lib"
-	dyld_library_path_prepend "${BOOST_DIR}/lib"
-	path_prepend "${BOOST_DIR}/bin"
-fi
-
-XERCESROOT="${ISSM_DIR}/externalpackages/xerces/install"
-if [ -d "$XERCESROOT" ]; then
-	export XERCESROOT
-	export XERCESCROOT="${ISSM_DIR}/externalpackages/xerces/src"
-fi
-
-
-XAIFBOOSTERROOT="${ISSM_DIR}/externalpackages/xaifbooster"
-XAIF_DIR="${XAIFBOOSTERROOT}/xaifBooster"
-if [ -d "$XAIF_DIR" ]; then
-	export XAIFBOOSTERROOT
-	export XAIF_DIR
-	export XAIFBOOSTER_HOME=$XAIF_DIR
-	export PLATFORM="x86-Linux"
-fi
-
-ANGELROOT="${ISSM_DIR}/externalpackages/angel/angel"
-if [ -d "$ANGELROOT" ]; then
-	export ANGELROOT
-fi
-
-OPENANALYSISROOT="${ISSM_DIR}/externalpackages/openanalysis/install"
-if [ -d "$OPENANALYSISROOT" ]; then
-	export OPENANALYSISROOT
-	ld_library_path_append "$OPENANALYSISROOT/lib"
-fi
-
-JVM_DIR="/usr/local/gcc/4.3.2/lib64/gcj-4.3.2-9/"
-ld_library_path_append "$JVM_DIR"
-
-BBFTP_DIR="${ISSM_DIR}/externalpackages/bbftp/install"
-path_append "$BBFTP_DIR/bin"
-
-ADIC_DIR="${ISSM_DIR}/externalpackages/adic/install"
-path_append "$ADIC_DIR/bin"
-ld_library_path_append "$ADIC_DIR/lib"
-
-COLPACK_DIR="${ISSM_DIR}/externalpackages/colpack/install"
-ld_library_path_append "$COLPACK_DIR/lib"
-
-ECLIPSE_DIR="${ISSM_DIR}/externalpackages/eclipse/install"
-path_append "$ECLIPSE_DIR"
-
-APPSCAN_DIR="${ISSM_DIR}/externalpackages/appscan/install"
-path_append "$APPSCAN_DIR/bin"
-
-RATS_DIR="${ISSM_DIR}/externalpackages/rats/install"
-path_append "$RATS_DIR/bin"
-
-DYSON_DIR="${ISSM_DIR}/externalpackages/dyson/"
-path_append "$DYSON_DIR"
-
-CMAKE_DIR="${ISSM_DIR}/externalpackages/cmake/install"
-path_prepend "$CMAKE_DIR/bin"
-
-SHAPELIB_DIR="${ISSM_DIR}/externalpackages/shapelib/install"
-path_append "$SHAPELIB_DIR/exec"
-
-CCCL_DIR="${ISSM_DIR}/externalpackages/cccl/install"
-path_append "$CCCL_DIR/bin"
-
-PACKAGEMAKER_DIR="${ISSM_DIR}/externalpackages/packagemaker/install"
-path_append "$PACKAGEMAKER_DIR"
-
-#android-dev-dir
-export ANDROID_DIR="${ISSM_DIR}/externalpackages/android"
+# Default path to external packages. Redefine this constant if they are 
+# installed to a different directory. Alternatively, export it on the command 
+# line or in a profile initialization file (that is why we check here if it is 
+# set already).
+#
+if [ -z "${ISSM_EXT_DIR+x}" ]; then
+	export ISSM_EXT_DIR="${ISSM_DIR}/externalpackages"
+fi
+
+#######################
+# OS-specific handling
+#######################
+
+MINGW=0
+if [[ $(uname -s) == MINGW* ]]; then
+	MINGW=1
+	MSMPI_ROOT="${ISSM_EXT_DIR}/msmpi/install"
+	if [ -d "${MSMPI_ROOT}" ]; then
+		export MSMPI_ROOT # Used in installation of ParMETIS, ScaLAPACK
+		cpath_prepend "${MSMPI_ROOT}/include"
+		library_path_prepend "${MSMPI_ROOT}/lib"
+	fi
+
+	MPIEXEC_DIR=$(cygpath -u $(cygpath -ms "/c/Program Files/Microsoft MPI/Bin"))
+	if [ -d "${MPIEXEC_DIR}" ]; then
+		export MPIEXEC_DIR
+		path_append "${MPIEXEC_DIR}"
+	fi
+
+	path_prepend "${ISSM_DIR}/bin" # Allows dynamic loader to find DLLs
+fi
+
+# Windows compilers
+if [[ "${ISSM_ARCH}" == "cygwin-intel" ]]; then
+	source ${ISSM_DIR}/externalpackages/windows/windows_environment.sh
+fi
+
+#########################
+# Command-line utilities
+#########################
+SSH_ROOT="${ISSM_EXT_DIR}/ssh"
+if [ -d "${SSH_ROOT}" ]; then
+	path_append "${SSH_ROOT}"
+fi
+
+SVN_ROOT="${ISSM_EXT_DIR}/svn/install"
+if [ -d "${SVN_ROOT}" ]; then
+	path_prepend "${SVN_ROOT}/bin"
+	ld_library_path_append "${SVN_ROOT}/lib"
+fi
+
+GIT_ROOT="${ISSM_EXT_DIR}/git/install"
+if [ -d "${GIT_ROOT}" ]; then
+	path_prepend "${GIT_ROOT}/bin"
+fi
+
+#############################
+# Compilers / runtime / SDKs
+#############################
+export ANDROID_DIR="${ISSM_EXT_DIR}/android"
 
 export ANDROID_NDK_DIR="$ANDROID_DIR/android-ndk/install"
 path_append "$ANDROID_NDK_DIR/arm-linux-android-install/bin"
 
-export ANDROID_SDK_DIR="$ANDROID_DIR/android-sdk/install"
-path_append "$ANDROID_SDK_DIR/"
-
-GSL_DIR="${ISSM_DIR}/externalpackages/gsl/install"
-ld_library_path_append "$GSL_DIR/lib"
-
-GMAKE_DIR="${ISSM_DIR}/externalpackages/gmake/install"
-path_prepend "$GMAKE_DIR/bin"
-
-MODELE_DIR="${ISSM_DIR}/externalpackages/modelE/install"
-path_append "$MODELE_DIR/src/exec"
-
-NCVIEW_DIR="${ISSM_DIR}/externalpackages/ncview/install"
-path_append "$NCVIEW_DIR"
-
-TCLX_DIR="${ISSM_DIR}/externalpackages/tclx/install/lib/tclx8.4"
-ld_library_path_append "$TCLX_DIR"
-
-ASPELL_DIR="${ISSM_DIR}/externalpackages/aspell/install"
-path_append "$ASPELL_DIR/bin"
-
-NETCDF_DIR="${ISSM_DIR}/externalpackages/netcdf/install"
-if [ -d "${NETCDF_DIR}" ]; then
-	path_append "${NETCDF_DIR}/bin"
-	cpath_append "${NETCDF_DIR}/include"
-	library_path_append "${NETCDF_DIR}/lib"
-	dyld_library_path_append "${NETCDF_DIR}/lib"
-	ld_library_path_append "${NETCDF_DIR}/lib"
-fi
-
-NETCDF_CXX_DIR="${ISSM_DIR}/externalpackages/netcdf-cxx/install"
-if [ -d "${NETCDF_CXX_DIR}" ]; then
-	ld_library_path_append "${NETCDF_CXX_DIR}/lib"
-fi
-
-NETCDF_PYTHON_DIR="${ISSM_DIR}/externalpackages/netcdf-python/install"
-if [ -d "${NETCDF_PYTHON_DIR}" ]; then
-	if [ -d "${NETCDF_PYTHON_DIR}/lib/python2.7/site-packages" ]; then
-		ld_library_path_append "${NETCDF_PYTHON_DIR}/lib/python2.7/site-packages"
-	fi
-fi
-
-HDF5_DIR="${ISSM_DIR}/externalpackages/hdf5/install"
-if [ -d "${HDF5_DIR}" ]; then
-	cpath_append "${HDF5_DIR}/include"
-	library_path_append "${HDF5_DIR}/lib"
-	dyld_library_path_append "${HDF5_DIR}/lib"
-	ld_library_path_append "${HDF5_DIR}/lib"
-fi
-
-SQLITE_DIR="${ISSM_DIR}/externalpackages/sqlite/install"
-if [ -d "${SQLITE_DIR}" ]; then
-	path_append "${SQLITE_DIR}/bin"
-	library_path_append "${SQLITE_DIR}/lib"
-	ld_library_path_append "${SQLITE_DIR}/lib"
-fi
-
-PROJ_DIR="${ISSM_DIR}/externalpackages/proj/install"
-if [ -d "${PROJ_DIR}" ]; then
-	dyld_library_path_prepend "${PROJ_DIR}/lib"
-	ld_library_path_prepend "${PROJ_DIR}/lib"
-fi
-
-GDAL_DIR="${ISSM_DIR}/externalpackages/gdal/install"
-if [ -d "${GDAL_DIR}" ]; then
-	path_prepend "${GDAL_DIR}/bin"
-	ld_library_path_append "${GDAL_DIR}/lib"
-fi
-
-ESMF_DIR="${ISSM_DIR}/externalpackages/esmf/install"
-if [ -d "${ESMF_DIR}" ]; then
-	path_prepend "${ESMF_DIR}/bin"
-	ld_library_path_append "${ESMF_DIR}/lib/libO/Linux.gfortran.64.mpich.default/"
-fi
-
-GMT_DIR="${ISSM_DIR}/externalpackages/gmt/install"
-if [ -d "${GMT_DIR}" ]; then
-	export GMT_DIR
-	path_prepend "${GMT_DIR}/bin"
-fi
-
-GMSH_DIR="${ISSM_DIR}/externalpackages/gmsh/install"
-if [ -d "${GMSH_DIR}" ]; then
-	path_append "${ISSM_DIR}/externalpackages/gmsh/install"
-fi
-
-CVS_DIR="${ISSM_DIR}/externalpackages/cvs/install"
-path_prepend "$CVS_DIR/bin"
-
-APR_DIR="${ISSM_DIR}/externalpackages/apr/install"
-path_append "$APR_DIR/bin"
-ld_library_path_append "$APR_DIR/lib"
-
-APR_UTIL_DIR="${ISSM_DIR}/externalpackages/apr-util/install"
-path_prepend "$APR_UTIL_DIR/bin"
-ld_library_path_append "$APR_UTIL_DIR/lib"
-
-YAMS_DIR="${ISSM_DIR}/externalpackages/yams/install"
-path_append "$YAMS_DIR"
-
-SWIG_DIR="${ISSM_DIR}/externalpackages/swig/install"
-path_append "$SWIG_DIR"
-
-#AUX-CONFIG
-path_append "${ISSM_DIR}/aux-config"
-
-#INISHELL
-path_append "${ISSM_DIR}/externalpackages/inishell/install"
-
-#SHELL2JUNIT
-path_append "${ISSM_DIR}/externalpackages/shell2junit/install"
-
-#EXPAT
-ld_library_path_prepend "${ISSM_DIR}/externalpackages/expat/install"
-dyld_library_path_prepend "${ISSM_DIR}/externalpackages/expat/install"
-
-#CURL
-CURL_DIR="${ISSM_DIR}/externalpackages/curl/install"
-if [ -d "${CURL_DIR}" ]; then
-	ld_library_path_prepend "${CURL_DIR}/lib"
-	dyld_library_path_prepend "${CURL_DIR}/lib"
-	path_prepend "${CURL_DIR}/bin"
-fi
-
-#NEOPZ
-NEOPZ_DIR="${ISSM_DIR}/externalpackages/neopz/install"
-if [ -d "$NEOPZ_DIR" ]; then
-	export REFPATTERNDIR="$NEOPZ_DIR/include/refpatterns"
-fi
-
-TRIANGLE_DIR="${ISSM_DIR}/externalpackages/triangle/install"
-if [ -d "${TRIANGLE_DIR}" ]; then
-	ld_library_path_append "${TRIANGLE_DIR}/lib"
-	dyld_library_path_append "${TRIANGLE_DIR}/lib"
-fi
+export ANDROID_SDK_ROOT="$ANDROID_DIR/android-sdk/install"
+path_append "$ANDROID_SDK_ROOT/"
+
+EMSCRIPTEN_ROOT="${ISSM_EXT_DIR}/emscripten/install"
+if [ -d ${EMSCRIPTEN_ROOT} ]; then
+	export EMSCRIPTEN_ROOT # Used in JavaScript build in installation of GSL, Triangle
+fi
+
+JVM_ROOT="/usr/local/gcc/4.3.2/lib64/gcj-4.3.2-9/"
+ld_library_path_append "${JVM_ROOT}"
+
+#############################
+# IDEs
+#############################
+ECLIPSE_ROOT="${ISSM_EXT_DIR}/eclipse/install"
+path_append "${ECLIPSE_ROOT}"
+
+#############################
+# Build systems
+#############################
+AUTOTOOLS_ROOT="${ISSM_EXT_DIR}/autotools/install"
+path_prepend "${AUTOTOOLS_ROOT}/bin"
+
+CMAKE_ROOT="${ISSM_EXT_DIR}/cmake/install"
+path_prepend "${CMAKE_ROOT}/bin"
+
+GMAKE_ROOT="${ISSM_EXT_DIR}/gmake/install"
+path_prepend "${GMAKE_ROOT}/bin"
+
+#############################
+# Packagers
+#############################
+PACKAGEMAKER_ROOT="${ISSM_EXT_DIR}/packagemaker/install"
+path_append "${PACKAGEMAKER_ROOT}"
+
+#############################
+# Libraries / binaries
+#############################
+MPI_ROOT="${ISSM_EXT_DIR}/mpich/install"
+if [ -d "${MPI_ROOT}" ]; then
+	export MPI_DIR=${MPI_ROOT}
+	export MPI_HOME=${MPI_ROOT} # Used in installation of Dakota
+	export MPI_INC_DIR="${MPI_ROOT}/include"
+	path_prepend "${MPI_ROOT}/bin"
+	cpath_prepend "${MPI_ROOT}/include"
+	ld_library_path_append "${MPI_ROOT}/lib"
+fi
+
+# NOTE: The following checks *must* come before PETSc as we prefer packages 
+#		installed via PETSc
+#
+BLAS_ROOT="${ISSM_EXT_DIR}/blas/install"
+if [ -d "${BLAS_ROOT}" ]; then
+	export BLAS_ROOT # Used in installation of LAPACK, ScaLAPACK, PETSc
+	library_path_append "${BLAS_ROOT}/lib"
+	ld_library_path_append "${BLAS_ROOT}/lib"
+
+	if [[ ${MINGW} -eq 1 ]]; then
+		path_append "${BLAS_ROOT}/lib" # Allows dynamic loaded to find DLLs
+	fi
+fi
+
+LAPACK_ROOT="${ISSM_EXT_DIR}/lapack/install"
+if [ -d "${LAPACK_ROOT}" ]; then
+	export LAPACK_ROOT # Used in installation of ScaLAPACK, MUMPS, PETSc
+	library_path_append "${LAPACK_ROOT}/lib"
+	ld_library_path_append "${LAPACK_ROOT}/lib"
+
+	if [[ ${MINGW} -eq 1 ]]; then
+		path_append "${LAPACK_ROOT}/lib" # Allows dynamic loaded to find DLLs
+	fi
+fi
+
+METIS_ROOT="${ISSM_EXT_DIR}/metis/install"
+if [ -d "${METIS_ROOT}" ]; then
+	export METIS_ROOT # Used in installation of ParMETIS, Gmsh, PETSc
+	library_path_prepend "${METIS_ROOT}/lib"
+	ld_library_path_prepend "${METIS_ROOT}/lib"
+
+	if [[ ${MINGW} -eq 1 ]]; then
+		path_append "${METIS_ROOT}/lib" # Allows dynamic loaded to find DLLs
+	fi
+fi
+
+MUMPS_ROOT="${ISSM_EXT_DIR}/mumps/install"
+if [ -d "${MUMPS_ROOT}" ]; then
+	export MUMPS_ROOT # Used in installation of PETSc
+	library_path_append "${MUMPS_ROOT}/lib"
+
+	if [[ ${MINGW} -eq 1 ]]; then
+		path_append "${MUMPS_ROOT}/lib" # Allows dynamic loaded to find DLLs
+	fi
+fi
+
+PARMETIS_ROOT="${ISSM_EXT_DIR}/parmetis/install"
+if [ -d "${PARMETIS_ROOT}" ]; then
+	export PARMETIS_ROOT # Used in installation of MUMPS, PETSc
+	library_path_prepend "${PARMETIS_ROOT}/lib"
+	ld_library_path_prepend "${PARMETIS_ROOT}/lib"
+
+	if [[ ${MINGW} -eq 1 ]]; then
+		path_append "${PARMETIS_ROOT}/lib" # Allows dynamic loaded to find DLLs
+	fi
+fi
+
+SCALAPACK_ROOT="${ISSM_EXT_DIR}/scalapack/install"
+if [ -d "${SCALAPACK_ROOT}" ]; then
+	export SCALAPACK_ROOT # Used in installation of MUMPS, PETSc
+	library_path_append "${SCALAPACK_ROOT}/lib"
+
+	if [[ ${MINGW} -eq 1 ]]; then
+		path_append "${SCALAPACK_ROOT}/lib" # Allows dynamic loaded to find DLLs
+	fi
+fi
+
+ZLIB_ROOT="${ISSM_EXT_DIR}/zlib/install"
+if [ -d "${ZLIB_ROOT}" ]; then
+	export ZLIB_ROOT # Used in installation of NetCDF, GDAL, GMT
+	ld_library_path_append "${ZLIB_ROOT}/lib"
+fi
+
+PETSC_ROOT="${ISSM_EXT_DIR}/petsc/install"
+if [ -d "${PETSC_ROOT}" ]; then
+	export PETSC_ROOT # Used in installation of Gmsh
+	library_path_prepend "${PETSC_ROOT}/lib"
+	ld_library_path_prepend "${PETSC_ROOT}/lib"
+
+	if [[ ${MINGW} -eq 1 ]]; then
+		path_append "${PETSC_ROOT}/lib" # Allows dynamic loaded to find DLLs
+	fi
+
+	# In case we have installed certain external packages via PETSc
+	#
+
+	# BLAS
+	if ls ${PETSC_ROOT}/lib/libblas.* 1> /dev/null 2>&1 || ls ${PETSC_ROOT}/lib/libfblas.* 1> /dev/null 2>&1; then
+		export BLAS_ROOT="${PETSC_ROOT}" # Used in installation of Dakota, GMT
+	fi
+
+	# HDF5
+	if ls ${PETSC_ROOT}/lib/libhdf5.* 1> /dev/null 2>&1; then
+		export HDF5_ROOT="${PETSC_ROOT}" # Used in installation of NetCDF, GDAL
+		cpath_append "${PETSC_ROOT}/include"
+		library_path_append "${PETSC_ROOT}/lib"
+		dyld_library_path_append "${PETSC_ROOT}/lib"
+		ld_library_path_append "${PETSC_ROOT}/lib"
+	fi
+
+	# LAPACK
+	if ls ${PETSC_ROOT}/lib/liblapack.* 1> /dev/null 2>&1 || ls ${PETSC_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
+		export LAPACK_ROOT="${PETSC_ROOT}" # Used in installation of Dakota, GMT
+	fi
+
+	# METIS
+	if ls ${PETSC_ROOT}/lib/libmetis.* 1> /dev/null 2>&1; then
+		export METIS_ROOT="${PETSC_ROOT}" # Used in installation of Gmsh
+	fi
+
+	# MPICH
+	if [ -f "${PETSC_ROOT}/bin/mpiexec" ]; then
+		MPI_ROOT=${PETSC_ROOT}
+		export MPI_DIR=${MPI_ROOT}
+		export MPI_HOME=${MPI_ROOT} # Used in installation of Dakota
+		export MPI_INC_DIR="${MPI_ROOT}/include"
+		path_prepend "${MPI_ROOT}/bin"
+		cpath_prepend "${MPI_ROOT}/include"
+		ld_library_path_append "${MPI_ROOT}/lib"
+	fi
+
+	# ZLIB
+	if ls ${PETSC_ROOT}/lib/libz.* 1> /dev/null 2>&1; then
+		export ZLIB_ROOT="${PETSC_ROOT}" # Used in installation of NetCDF, GDAL
+		ld_library_path_append "${PETSC_ROOT}/lib"
+	fi
+fi
+
+SCOTCH_ROOT="${ISSM_EXT_DIR}/scotch/install"
+ld_library_path_append "${SCOTCH_ROOT}/lib"
+
+SLEPC_ROOT="${ISSM_EXT_DIR}/slepc/install"
+ld_library_path_append "${SLEPC_ROOT}/lib"
+
+TAO_ROOT="${ISSM_EXT_DIR}/tao/install"
+ld_library_path_append "${TAO_ROOT}/lib"
+
+DAKOTA_ROOT="${ISSM_EXT_DIR}/dakota/install"
+if [ -d "${DAKOTA_ROOT}" ]; then
+	path_append "${DAKOTA_ROOT}/bin"
+	ld_library_path_append "${DAKOTA_ROOT}/lib"
+	dyld_library_path_prepend "${DAKOTA_ROOT}/lib"
+fi
+
+NCO_ROOT="${ISSM_EXT_DIR}/nco/install/bin"
+path_prepend "${NCO_ROOT}/bin"
+
+CPPCHECK_ROOT="${ISSM_EXT_DIR}/cppcheck/install"
+path_append "${CPPCHECK_ROOT}/bin"
+
+MERCURIAL_ROOT="${ISSM_EXT_DIR}/mercurial/install"
+if [ -d "${MERCURIAL_ROOT}" ]; then
+	export PYTHONPATH="${PYTHONPATH}:${MERCURIAL_ROOT}/mercurial/pure/"
+	path_append "${MERCURIAL_ROOT}"
+fi
+
+BOOST_ROOT="${ISSM_EXT_DIR}/boost/install"
+if [ -d "${BOOST_ROOT}" ]; then
+	export BOOST_ROOT # Used in installation of Dakota
+	export BOOST_DIR=${BOOST_ROOT}
+	export BOOSTROOT=${BOOST_ROOT}
+	library_path_append "${BOOST_ROOT}/lib"
+	ld_library_path_append "${BOOST_ROOT}/lib"
+	dyld_library_path_append "${BOOST_ROOT}/lib"
+	path_append "${BOOST_ROOT}/bin"
+fi
+
+GSL_ROOT="${ISSM_EXT_DIR}/gsl/install"
+if [ -d "${GSL_ROOT}" ]; then
+	export GSL_HOME="${GSL_ROOT}" # Used in installation of Dakota
+	ld_library_path_append "${GSL_ROOT}/lib"
+fi
+
+NETCDF_ROOT="${ISSM_EXT_DIR}/netcdf/install"
+if [ -d "${NETCDF_ROOT}" ]; then
+	export NETCDF_ROOT # Used in installation of GDAL, GMT
+	path_append "${NETCDF_ROOT}/bin"
+	cpath_append "${NETCDF_ROOT}/include"
+	library_path_append "${NETCDF_ROOT}/lib"
+	dyld_library_path_append "${NETCDF_ROOT}/lib"
+	ld_library_path_append "${NETCDF_ROOT}/lib"
+fi
+
+NETCDF_CXX_ROOT="${ISSM_EXT_DIR}/netcdf-cxx/install"
+if [ -d "${NETCDF_CXX_ROOT}" ]; then
+	ld_library_path_append "${NETCDF_CXX_ROOT}/lib"
+fi
+
+NETCDF_PYTHON_ROOT="${ISSM_EXT_DIR}/netcdf-python/install"
+if [ -d "${NETCDF_PYTHON_ROOT}" ]; then
+	if [ -d "${NETCDF_PYTHON_ROOT}/lib/python2.7/site-packages" ]; then
+		ld_library_path_append "${NETCDF_PYTHON_ROOT}/lib/python2.7/site-packages"
+	fi
+fi
+
+CURL_ROOT="${ISSM_EXT_DIR}/curl/install"
+if [ -d "${CURL_ROOT}" ]; then
+	export CURL_ROOT # Used in installation of NetCDF, GDAL, GMT
+	ld_library_path_append "${CURL_ROOT}/lib"
+	dyld_library_path_append "${CURL_ROOT}/lib"
+	path_append "${CURL_ROOT}/bin"
+fi
+
+HDF5_ROOT="${ISSM_EXT_DIR}/hdf5/install"
+if [ -d "${HDF5_ROOT}" ]; then
+	export HDF5_ROOT # Used in installation of NetCDF, GDAL
+	cpath_append "${HDF5_ROOT}/include"
+	library_path_append "${HDF5_ROOT}/lib"
+	dyld_library_path_append "${HDF5_ROOT}/lib"
+	ld_library_path_append "${HDF5_ROOT}/lib"
+fi
+
+SQLITE_ROOT="${ISSM_EXT_DIR}/sqlite/install"
+if [ -d "${SQLITE_ROOT}" ]; then
+	path_append "${SQLITE_ROOT}/bin"
+	library_path_append "${SQLITE_ROOT}/lib"
+	ld_library_path_append "${SQLITE_ROOT}/lib"
+fi
+
+LIBTIFF_ROOT="${ISSM_EXT_SHARED_DIR}/libtiff/install"
+if [ -d "${LIBTIFF_ROOT}" ]; then
+	dyld_library_path_append "${LIBTIFF_ROOT}/install/libtiff"
+	ld_library_path_append "${LIBTIFF_ROOT}/install/libtiff"
+fi
+
+PROJ_ROOT="${ISSM_EXT_DIR}/proj/install"
+if [ -d "${PROJ_ROOT}" ]; then
+	export PROJ_ROOT # Used in installation of GDAL
+	path_append "${PROJ_ROOT}/bin"
+	dyld_library_path_append "${PROJ_ROOT}/lib"
+	ld_library_path_append "${PROJ_ROOT}/lib"
+fi
+
+GDAL_ROOT="${ISSM_EXT_DIR}/gdal/install"
+if [ -d "${GDAL_ROOT}" ]; then
+	export GDAL_ROOT # Used in installation of GMT
+	path_prepend "${GDAL_ROOT}/bin"
+	ld_library_path_append "${GDAL_ROOT}/lib"
+fi
+
+GSHHG_ROOT="${ISSM_EXT_DIR}/gshhg/install"
+if [ -d "${GSHHG_ROOT}" ]; then
+	export GSHHG_ROOT # Used in installation of GMT
+fi
+
+GMT_ROOT="${ISSM_EXT_DIR}/gmt/install"
+if [ -d "${GMT_ROOT}" ]; then
+	path_prepend "${GMT_ROOT}/bin"
+	ld_library_path_append "${GMT_ROOT}/lib"
+	dyld_library_path_append "${GMT_ROOT}/lib"
+fi
+
+GMSH_ROOT="${ISSM_EXT_DIR}/gmsh/install"
+if [ -d "${GMSH_ROOT}" ]; then
+	path_prepend "${GMSH_ROOT}/bin"
+	ld_library_path_append "${GMSH_ROOT}/lib"
+	dyld_library_path_append "${GMSH_ROOT}/lib"
+fi
+
+TRIANGLE_ROOT="${ISSM_EXT_DIR}/triangle/install"
+if [ -d "${TRIANGLE_ROOT}" ]; then
+	ld_library_path_append "${TRIANGLE_ROOT}/lib"
+	dyld_library_path_append "${TRIANGLE_ROOT}/lib"
+
+	if [[ ${MINGW} -eq 1 ]]; then
+		path_append "${TRIANGLE_ROOT}/lib" # Allows dynamic loaded to find DLLs
+	fi
+fi
+
+ANGELROOT="${ISSM_EXT_DIR}/angel/angel"
+if [ -d "${ANGELROOT}" ]; then
+	export ANGELROOT
+fi
+
+OPENANALYSISROOT="${ISSM_EXT_DIR}/openanalysis/install"
+if [ -d "${OPENANALYSISROOT}" ]; then
+	export OPENANALYSISROOT
+	ld_library_path_append "${OPENANALYSISROOT}/lib"
+fi
+
+BBFTP_ROOT="${ISSM_EXT_DIR}/bbftp/install"
+path_append "${BBFTP_ROOT}/bin"
+
+ADIC_ROOT="${ISSM_EXT_DIR}/adic/install"
+path_append "${ADIC_ROOT}/bin"
+ld_library_path_append "${ADIC_ROOT}/lib"
+
+COLPACK_ROOT="${ISSM_EXT_DIR}/colpack/install"
+ld_library_path_append "${COLPACK_ROOT}/lib"
+
+APPSCAN_ROOT="${ISSM_EXT_DIR}/appscan/install"
+path_append "${APPSCAN_ROOT}/bin"
+
+RATS_ROOT="${ISSM_EXT_DIR}/rats/install"
+path_append "${RATS_ROOT}/bin"
+
+DYSON_ROOT="${ISSM_EXT_DIR}/dyson/"
+path_append "${DYSON_ROOT}"
+
+SHAPELIB_ROOT="${ISSM_EXT_DIR}/shapelib/install"
+path_append "${SHAPELIB_ROOT}/exec"
+
+CCCL_ROOT="${ISSM_EXT_DIR}/cccl/install"
+path_append "${CCCL_ROOT}/bin"
+
+MODELE_ROOT="${ISSM_EXT_DIR}/modelE/install"
+path_append "${MODELE_ROOT}/src/exec"
+
+NCVIEW_ROOT="${ISSM_EXT_DIR}/ncview/install"
+path_append "${NCVIEW_ROOT}"
+
+TCLX_ROOT="${ISSM_EXT_DIR}/tclx/install/lib/tclx8.4"
+ld_library_path_append "${TCLX_ROOT}"
+
+ASPELL_ROOT="${ISSM_EXT_DIR}/aspell/install"
+path_append "${ASPELL_ROOT}/bin"
+
+ESMF_ROOT="${ISSM_EXT_DIR}/esmf/install"
+if [ -d "${ESMF_ROOT}" ]; then
+	path_prepend "${ESMF_ROOT}/bin"
+	ld_library_path_append "${ESMF_ROOT}/lib/libO/Linux.gfortran.64.mpich.default/"
+fi
+
+CVS_ROOT="${ISSM_EXT_DIR}/cvs/install"
+path_prepend "${CVS_ROOT}/bin"
+
+APR_ROOT="${ISSM_EXT_DIR}/apr/install"
+path_append "${APR_ROOT}/bin"
+ld_library_path_append "${APR_ROOT}/lib"
+
+APR_UTIL_ROOT="${ISSM_EXT_DIR}/apr-util/install"
+path_prepend "${APR_UTIL_ROOT}/bin"
+ld_library_path_append "${APR_UTIL_ROOT}/lib"
+
+YAMS_ROOT="${ISSM_EXT_DIR}/yams/install"
+path_append "${YAMS_ROOT}"
+
+SWIG_ROOT="${ISSM_EXT_DIR}/swig/install"
+path_append "${SWIG_ROOT}"
+
+INISHELL_ROOT="${ISSM_EXT_DIR}/inishell/install"
+path_append "${INISHELL_ROOT}"
+
+EXPAT_ROOT="${ISSM_EXT_DIR}/expat/install"
+ld_library_path_prepend "${EXPAT_ROOT}"
+dyld_library_path_prepend "${EXPAT_ROOT}"
+
+NEOPZ_ROOT="${ISSM_EXT_DIR}/neopz/install"
+if [ -d "${NEOPZ_ROOT}" ]; then
+	export REFPATTERNDIR="${NEOPZ_ROOT}/include/refpatterns"
+fi
+
+XERCESROOT="${ISSM_EXT_DIR}/xerces/install"
+if [ -d "${XERCESROOT}" ]; then
+	export XERCESROOT
+	export XERCESCROOT="${ISSM_EXT_DIR}/xerces/src"
+fi
+
+XAIFBOOSTERROOT="${ISSM_EXT_DIR}/xaifbooster"
+XAIF_ROOT="${XAIFBOOSTERROOT}/xaifBooster"
+if [ -d "${XAIF_ROOT}" ]; then
+	export XAIFBOOSTERROOT
+	export XAIF_DIR="${XAIF_ROOT}"
+	export XAIFBOOSTER_HOME="${XAIF_ROOT}"
+	export PLATFORM="x86-Linux"
+fi
+
+VALGRIND_ROOT="${ISSM_EXT_DIR}/valgrind/install"
+path_prepend "${VALGRIND_ROOT}/bin"
+
+DOXYGEN_ROOT="${ISSM_EXT_DIR}/doxygen/install"
+path_prepend "${DOXYGEN_ROOT}/bin"
+
+SHELL2JUNIT_ROOT="${ISSM_EXT_DIR}/shell2junit/install"
+path_append "${SHELL2JUNIT_ROOT}"
Index: /issm/trunk/examples/AMR/mismip.py
===================================================================
--- /issm/trunk/examples/AMR/mismip.py	(revision 26744)
+++ /issm/trunk/examples/AMR/mismip.py	(revision 26744)
@@ -0,0 +1,54 @@
+import numpy as np
+from SetIceShelfBC import SetIceShelfBC
+
+# creating thickness
+md.geometry.bed = -100 - np.abs(md.mesh.x) / 1000
+md.geometry.base = -90 * np.ones((md.mesh.numberofvertices))
+md.geometry.surface = 10 * np.ones((md.mesh.numberofvertices))
+md.geometry.thickness = md.geometry.surface - md.geometry.base
+md.mask.ocean_levelset = -1 * np.ones((md.mesh.numberofvertices))
+
+# creating basal drag
+md.friction.coefficient = np.sqrt(10**7) * np.ones((md.mesh.numberofvertices))  #q = 1.
+md.friction.p = 3 * np.ones((md.mesh.numberofelements))
+md.friction.q = np.zeros((md.mesh.numberofelements))
+
+# creating flow law paramter
+md.materials.rheology_B = 1 / ((1e-25)**(1 / 3)) * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements))
+md.materials.rheology_law = 'None'
+
+# creating boundary conditions
+md = SetIceShelfBC(md, './front.exp')
+md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
+md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
+md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
+pos = np.nonzero(np.logical_or((np.abs(md.mesh.y - 50000) < 0.1), np.abs(md.mesh.y) < 0.1))
+md.stressbalance.spcvy[pos] = 0
+pos2 = np.nonzero(np.abs(md.mesh.x) < 0.1)
+md.stressbalance.spcvx[pos2] = 0
+md.stressbalance.spcvz[pos] = np.nan
+md.stressbalance.spcvz[pos2] = np.nan
+
+# creating forcing conditions
+md.smb.mass_balance = 0.5 * np.ones((md.mesh.numberofvertices))
+md.basalforcings.geothermalflux = 0.5 * np.ones((md.mesh.numberofvertices))
+md.thermal.spctemperature = np.nan * np.ones((md.mesh.numberofvertices))
+md.groundingline.migration = 'SubelementMigration'
+
+# setting parameters
+md.materials.rho_ice = 900
+md.materials.rho_water = 1000
+md.constants.g = 9.8
+md.constants.yts = 3600 * 24 * 365
+md.transient.isthermal = 0
+md.transient.isgroundingline = 1
+md.stressbalance.isnewton = 0
+
+# setting inital condition
+md.initialization.vx = np.ones((md.mesh.numberofvertices))
+md.initialization.vy = np.ones((md.mesh.numberofvertices))
+md.initialization.vz = np.ones((md.mesh.numberofvertices))
+md.initialization.vel = np.sqrt(2) * np.ones((md.mesh.numberofvertices))
+md.initialization.pressure = md.constants.g * md.materials.rho_ice * md.geometry.thickness
+md.initialization.temperature = 273 * np.ones((md.mesh.numberofvertices))
Index: /issm/trunk/examples/AMR/runme.m
===================================================================
--- /issm/trunk/examples/AMR/runme.m	(revision 26743)
+++ /issm/trunk/examples/AMR/runme.m	(revision 26744)
@@ -1,13 +1,14 @@
 % Mismip3D experiment with AMR using BAMG
-steps=[1:3]; 
+steps=[1:3];
 
 if any(steps==1)
 	disp('   Step 1: Coarse mesh');
-	
+
 	%Generate an unstructured coarse mesh on the MISMIP domain with typical element edge length equal to 10,000 m
 	md=bamg(model,'domain','./domain.exp','hmax',10000,'splitcorners',1);
 
 	save AMRCoarseMesh md
-end 
+end
+
 if any(steps==2)
 	disp('   Step 2: Parameterization');
@@ -16,5 +17,5 @@
 
 	md=setmask(md,'','');
-	
+
 	% Run parameterization script to set up geometry, inital velocity, material properties, etc.
 	md=parameterize(md,'./mismip.par');
@@ -23,5 +24,5 @@
 	% Here, we are refining around the grounding line
 	% We impose the element resolution at grounding equal to 1000 m (1 km)
-	% The criterion used is the element distance to the grounding line.
+	% The criterion used is the element distance to the grounding line
 	% The distance used here is 10000 m (10 km), used in both side around the grouding line (upstream and downstream)
 	md.amr.groundingline_resolution=1000;
@@ -35,7 +36,8 @@
 	save AMRParam md
 end
-if any(steps==3);
-   disp('   Step 3: Solve!');
-	 
+
+if any(steps==3)
+	disp('   Step 3: Solve!');
+
 	md=loadmodel('AMRParam');
 
@@ -43,10 +45,11 @@
 	md.timestepping.time_step=1;
 	md.timestepping.final_time=500; % here, as example, only 500 yr.
-	md.settings.output_frequency=10;% here, save results every 10 yr 
+	md.settings.output_frequency=10;% here, save results every 10 yr
 	md.stressbalance.maxiter=30;
 	md.stressbalance.abstol=NaN;
 	md.stressbalance.restol=1;
+	md.settings.solver_residue_threshold=1e-2; % relaxing (the first stress balance solver iteration presents values higher than the original threshold. This probably happens because the initial velocity is set to one).
 	md.verbose=verbose('convergence',false,'solution',true);
-	
+
 	% Specify that you want to run the model on your current (local host) computer
 	% Change the number of processors according to your machine (here np=2)
@@ -64,3 +67,3 @@
 
 	save AMRTransient md
-end% }}}
+end
Index: /issm/trunk/examples/AMR/runme.py
===================================================================
--- /issm/trunk/examples/AMR/runme.py	(revision 26744)
+++ /issm/trunk/examples/AMR/runme.py	(revision 26744)
@@ -0,0 +1,78 @@
+# Mismip3D experiment with AMR using BAMG
+from bamg import bamg
+from model import *
+from export_netCDF import export_netCDF
+from setmask import setmask
+from loadmodel import loadmodel
+from parameterize import parameterize
+from generic import generic
+from exportVTK import exportVTK
+from setflowequation import setflowequation
+from solve import solve
+from plotmodel import plotmodel
+
+
+steps = [4]
+
+if 1 in steps:
+    print('   Step 1: Coarse mesh')
+
+    #Generate an unstructured coarse mesh on the MISMIP domain with typical element edge length equal to 10, 000 m
+    md = bamg(model(), 'domain', './domain.exp', 'hmax', 10000, 'splitcorners', 1)
+
+    export_netCDF(md, 'AMRCoarseMesh.nc')
+
+if 2 in steps:
+    print('   Step 2: Parameterization')
+
+    md = loadmodel('AMRCoarseMesh.nc')
+
+    md = setmask(md, '', '')
+
+    # Run parameterization script to set up geometry, inital velocity, material properties, etc.
+    md = parameterize(md, './mismip.py')
+
+    # Set the AMR properties and the refinement criteria
+    # Here, we are refining around the grounding line
+    # We impose the element resolution at grounding equal to 1000 m (1 km)
+    # The criterion used is the element distance to the grounding line
+    # The distance used here is 10000 m (10 km), used in both side around the grouding line (upstream and downstream)
+    md.amr.groundingline_resolution = 1000
+    md.amr.groundingline_distance = 10000
+    md.amr.hmin = 1000  # the same resolution used around the grounding line
+    md.amr.hmax = 10000  # the same coase resolution used to generate the coarse mesh
+    md.amr.gradation = 1.7  # this controls the ratio between two consecutive edges
+    md.amr.fieldname = 'None'  # no field used here
+    md.amr.keepmetric = 0  # no field, no metric
+
+    export_netCDF(md, 'AMRParam.nc')
+
+if 3 in steps:
+    print('   Step 3: Solve!')
+
+    md = loadmodel('AMRParam.nc')
+
+    # Run transient with adaptive mesh refinement
+    md.timestepping.time_step = 1
+    md.timestepping.final_time = 500   # here, as example, only 500 yr.
+    md.settings.output_frequency = 10  # here, save results every 10 yr
+    md.stressbalance.maxiter = 30
+    md.stressbalance.abstol = np.nan
+    md.stressbalance.restol = 1
+    md.settings.solver_residue_threshold = 1e-2  # relaxing (the first stress balance solver iteration presents values higher than the original threshold. This probably happens because the initial velocity is set to one).
+    md.verbose = verbose('convergence', False, 'solution', True)
+
+    # Specify that you want to run the model on your current (local host) computer
+    # Change the number of processors according to your machine (here np = 2)
+    md.cluster = generic('np', 2)
+
+    # Set the AMR frequency, i.e., can be 1 or larger depending on how often the mesh needs to be updated
+    md.transient.amr_frequency = 1  # here, we are refining the mesh in every time step
+
+    # Set the flow equation (SSA) and run
+    md = setflowequation(md, 'SSA', 'all')
+    md = solve(md, 'Transient')
+
+    # Print the solutions and the mesh in VTK format (needs ParaView:    https: / / www.paraview.org)
+    exportVTK('./VTKpy', md)
+    export_netCDF(md, 'AMRTransient.nc')
Index: /issm/trunk/examples/AMR/runme_with_neopz.m
===================================================================
--- /issm/trunk/examples/AMR/runme_with_neopz.m	(revision 26744)
+++ /issm/trunk/examples/AMR/runme_with_neopz.m	(revision 26744)
@@ -0,0 +1,66 @@
+% Mismip3D experiment with AMR using NeoPZ (requires NeoPZ installation first, see external packages)
+steps=[1:3];
+
+if any(steps==1)
+	disp('   Step 1: Coarse mesh');
+
+	%Generate an unstructured coarse mesh on the MISMIP domain with typical element edge length equal to 10,000 m
+	md=bamg(model,'domain','./domain.exp','hmax',10000,'splitcorners',1);
+
+	save AMRCoarseMesh md
+end
+
+if any(steps==2)
+	disp('   Step 2: Parameterization');
+
+	md=loadmodel('AMRCoarseMesh');
+
+	md=setmask(md,'','');
+
+	% Run parameterization script to set up geometry, inital velocity, material properties, etc.
+	md=parameterize(md,'./mismip.par');
+
+	% Set the AMR properties and the refinement criteria
+	% Here, we are refining around the grounding line
+	% We impose the element resolution at grounding equal to ~1250 m, which corresponds to 3 levels of refinement
+	% The criterion used is the element distance to the grounding line
+	% The distance used here is 10000 m (10 km), used in both side around the grouding line (upstream and downstream)
+	md.amr=amrneopz;
+	md.amr.level_max=3; % refine 3 times so we have about 1250 m around the grounding line
+	md.amr.gradation=2; % maximum ratio between two adjacent edges
+	md.amr.groundingline_distance=10000;
+
+	save AMRParam md
+end
+
+if any(steps==3)
+	disp('   Step 3: Solve!');
+
+	md=loadmodel('AMRParam');
+
+	% Run transient with adaptive mesh refinement
+	md.timestepping.time_step=1;
+	md.timestepping.final_time=500; % here, as example, only 500 yr.
+	md.settings.output_frequency=10;% here, save results every 10 yr
+	md.stressbalance.maxiter=30;
+	md.stressbalance.abstol=NaN;
+	md.stressbalance.restol=1;
+	md.settings.solver_residue_threshold=1e-2; % relaxing (the first stress balance solver iteration presents values higher than the original threshold. This probably happens because the initial velocity is set to one).
+	md.verbose=verbose('convergence',false,'solution',true);
+
+	% Specify that you want to run the model on your current (local host) computer
+	% Change the number of processors according to your machine (here np=2)
+	md.cluster=generic('np',2);
+
+	% Set the AMR frequency, i.e., can be 1 or larger depending on how often the mesh needs to be updated
+	md.transient.amr_frequency=1; % here, we are refining the mesh in every time step
+
+	% Set the flow equation (SSA) and run
+	md=setflowequation(md,'SSA','all');
+	md=solve(md,'Transient');
+
+	% Print the solutions and the mesh in VTK format (needs ParaView:	https://www.paraview.org)
+	AMRexportVTK('./VTK',md);
+
+	save AMRTransient md
+end
Index: /issm/trunk/examples/EsaGRACE/runme.m
===================================================================
--- /issm/trunk/examples/EsaGRACE/runme.m	(revision 26743)
+++ /issm/trunk/examples/EsaGRACE/runme.m	(revision 26744)
@@ -1,58 +1,55 @@
-
 clear all;
 addpath('../Data','../Functions');
 
-steps=[1]; % [1:5] 
+steps=[1];
 
-if any(steps==1) 
+if any(steps==1)
 	disp('   Step 1: Global mesh creation');
 
-	resolution=300;			% [km] 
-	radius = 6.371012*10^3;	% [km] 
+	resolution=300;			% [km]
+	radius = 6.371012*10^3;	% [km]
 
-	md=model; 
-	md.mask=maskpsl(); 
+	md=model;
 	md.mesh=gmshplanet('radius',radius,'resolution',resolution);
 
-	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long); 
+	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
 
 	save ./Models/EsaGRACE_Mesh md;
-	
+
 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
+end
 
-end 
-
-if any(steps==2) 
+if any(steps==2)
 	disp('   Step 2: Define loads in meters of ice height equivalent');
 	md = loadmodel('./Models/EsaGRACE_Mesh');
 
 	year_month = 2007+15/365;
-	time_range = [year_month year_month]; 
-	
-	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2)); 
-	
-	md.esa.deltathickness = water_load*md.materials.rho_freshwater/md.materials.rho_ice; % ice height equivalent 
+	time_range = [year_month year_month];
 
-	save ./Models/EsaGRACE_Loads md; 
-	
+	onvertex = 0; % map data on vertex. If 0, it maps on the elemental centroid. 
+	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2),onvertex);
+
+	md.esa.deltathickness = water_load*md.materials.rho_freshwater/md.materials.rho_ice; % ice height equivalent
+
+	save ./Models/EsaGRACE_Loads md;
+
 	plotmodel (md,'data',md.esa.deltathickness,...
 		'view',[90 -90],'caxis',[-.1 .1],...
 		'title','Ice height equivalent [m]');
+end
 
-end 
-
-if any(steps==3) 
+if any(steps==3)
 	disp('   Step 3: Parameterization');
 	md = loadmodel('./Models/EsaGRACE_Loads');
 
-	nlove=10001;	
-	md.esa.love_h = love_numbers('h','CF'); md.esa.love_h(nlove+1:end)=[];
-	md.esa.love_l = love_numbers('l','CF'); md.esa.love_l(nlove+1:end)=[];
+	love_numbers = lovenumbers('maxdeg',10000,'referenceframe','CF');
+	md.esa.love_h = love_numbers.h;
+	md.esa.love_l = love_numbers.l;
 
-	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1); 
-	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1); 
+	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1);
+	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1);
 	pos=find(md.esa.deltathickness~=0);
-	md.mask.ice_levelset(md.mesh.elements(pos,:))=-1; 
-	md.mask.land_levelset = 1-md.mask.ocean_levelset; 
+	md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
+	%md.mask.land_levelset = 1-md.mask.ocean_levelset;
 
 	di=md.materials.rho_ice/md.materials.rho_water;
@@ -61,52 +58,50 @@
 	md.geometry.base=md.geometry.surface-md.geometry.thickness;
 	md.geometry.bed=md.geometry.base;
-	
+
 	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
 	md.materials.rheology_B=paterson(md.initialization.temperature);
 	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
-	
+
 	md.miscellaneous.name='EsaGRACE';
-	
-	save ./Models/EsaGRACE_Parameterization md; 
 
-end 
+	save ./Models/EsaGRACE_Parameterization md;
+end
 
-if any(steps==4) 
+if any(steps==4)
 	disp('   Step 4: Solve Esa solver');
 	md = loadmodel('./Models/EsaGRACE_Parameterization');
 
 	md.esa.requested_outputs = {'EsaUmotion','EsaNmotion','EsaEmotion'};
-	
-	md.cluster=generic('name',oshostname(),'np',3); 
+
+	md.cluster=generic('name',oshostname(),'np',3);
 	md.verbose=verbose('111111111');
 
 	md=solve(md,'Esa');
 
-	save ./Models/EsaGRACE_Solution md; 
+	save ./Models/EsaGRACE_Solution md;
+end
 
-end 
-
-if any(steps==5) 
+if any(steps==5)
 	disp('   Step 5: Plot solutions');
 	md = loadmodel('./Models/EsaGRACE_Solution');
 
-	sol1 = md.esa.deltathickness*100;					% [cm] 
-	sol2 = md.results.EsaSolution.EsaUmotion*1000;	% [mm] 
-	sol3 = md.results.EsaSolution.EsaNmotion*1000;	% [mm] 
-	sol4 = md.results.EsaSolution.EsaEmotion*1000;	% [mm] 
+	sol1 = md.esa.deltathickness*100;				% [cm]
+	sol2 = md.results.EsaSolution.EsaUmotion*1000;	% [mm]
+	sol3 = md.results.EsaSolution.EsaNmotion*1000;	% [mm]
+	sol4 = md.results.EsaSolution.EsaEmotion*1000;	% [mm]
 
 	sol_name={'Change in water equivalent height [cm]', 'Vertical displacement [mm]',...
-		'Horizontal (NS) displacement [mm]', 'Horizontal (EW) displacement [mm]'}; 
-	fig_name={'Fig_dH.pdf','Fig_vert.pdf','Fig_horzNS.pdf','Fig_horzEW.pdf'}; 
+		'Horizontal (NS) displacement [mm]', 'Horizontal (EW) displacement [mm]'};
+	fig_name={'Fig_dH.pdf','Fig_vert.pdf','Fig_horzNS.pdf','Fig_horzEW.pdf'};
 
-	res = 1.0; % [degree] 
+	res = 1.0; % [degree]
 
 	[lat_grid, lon_grid] = meshgrid(linspace(-90,90,180/res), linspace(-180,180,360/res));
-	sol_grid = zeros(size(lat_grid)); 
+	sol_grid = zeros(size(lat_grid));
 
-	for kk=1:4 
+	for kk=1:4
 		sol=eval(sprintf('sol%d',kk));
-	
-		if length(sol)==md.mesh.numberofelements 
+
+		if length(sol)==md.mesh.numberofelements
 			for jj=1:md.mesh.numberofelements
 				ii=(jj-1)*3;
@@ -114,37 +109,35 @@
 			end
 			for jj=1:md.mesh.numberofvertices
-				pos=ceil(find(pp==jj)/3); 
-				temp(jj)=mean(sol(pos)); 
+				pos=ceil(find(pp==jj)/3);
+				temp(jj)=mean(sol(pos));
 			end
-			sol=temp'; 
-		end 
+			sol=temp';
+		end
 
-		F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol); 
+		F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol);
 		F.Method = 'linear';
-		F.ExtrapolationMethod = 'linear'; 
+		F.ExtrapolationMethod = 'linear';
 
 		sol_grid = F(lat_grid, lon_grid);
-		sol_grid(isnan(sol_grid))=0; 
-		sol_grid(lat_grid>85 & sol_grid==0)=NaN; 
+		sol_grid(isnan(sol_grid))=0;
+		sol_grid(lat_grid>85 & sol_grid==0)=NaN;
 
 		set(0,'DefaultAxesFontSize',18,'DefaultAxesLineWidth',1,'DefaultTextFontSize',18,'DefaultLineMarkerSize',8)
-		figure1=figure('Position', [100, 100, 1000, 500]); 
-		gcf; load coast; cla; 
-		pcolor(lon_grid,lat_grid,sol_grid); shading flat; hold on; 
+		figure1=figure('Position', [100, 100, 1000, 500]);
+		gcf; load coast; cla;
+		pcolor(lon_grid,lat_grid,sol_grid); shading flat; hold on;
 		if (kk==1)
-			geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white'); 
-		end 
-		plot(long,lat,'k'); hold off; 
+			geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white');
+		end
+		plot(long,lat,'k'); hold off;
 		c1=colorbar;
 		colormap('haxby');
-		caxis([-min(abs(min(sol)),abs(max(sol))) min(abs(min(sol)),abs(max(sol)))]); 
-		xlim([-180 180]); 
-		ylim([-90 90]); 
-		grid on; 
-		title(sol_name(kk)); 
+		caxis([-min(abs(min(sol)),abs(max(sol))) min(abs(min(sol)),abs(max(sol)))]);
+		xlim([-180 180]);
+		ylim([-90 90]);
+		grid on;
+		title(sol_name(kk));
 		set(gcf,'color','w');
-		%export_fig(fig_name{kk}); 
+		%export_fig(fig_name{kk});
 	end
-
-end 
-
+end
Index: /issm/trunk/examples/EsaWahr/runme.m
===================================================================
--- /issm/trunk/examples/EsaWahr/runme.m	(revision 26743)
+++ /issm/trunk/examples/EsaWahr/runme.m	(revision 26744)
@@ -1,67 +1,63 @@
-
 clear all;
 addpath('../Functions');
 
-steps=[0]; % [0:6] 
+steps=[1];
 
-if any(steps==0) 
-	disp('   Step 0: Mesh creation');
+if any(steps==1)
+	disp('   Step 1: Mesh creation');
 
-	md=roundmesh(model,100000,10000);  % Domain radius and element size [m] 
+	md=roundmesh(model,100000,10000);  % Domain radius and element size [m]
 
 	save ./Models/EsaWahr_Mesh md;
-	
+
 	plotmodel(md,'data','mesh');
+end
 
-end 
+if any(steps==2)
+	disp('   Step 2: Anisotropic mesh creation');
 
-if any(steps==1) 
-	disp('   Step 1: Anisotropic mesh creation');
+	md=roundmesh(model,100000,1000);
 
-	md=roundmesh(model,100000,1000); 
+	disc_radius=20*1000;
+	rad_dist=sqrt(md.mesh.x.^2+md.mesh.y.^2);	
+	field = abs(rad_dist-disc_radius);
 
-	disc_radius=20*1000; 
-	rad_dist=sqrt(md.mesh.x.^2+md.mesh.y.^2);	
-	field = abs(rad_dist-disc_radius); 
-
-	md = bamg(md,'field',field,'err',50,'hmax',10000); 
+	md = bamg(md,'field',field,'err',50,'hmax',10000);
 
 	save ./Models/EsaWahr_Mesh md;
-	
+
 	plotmodel (md,'data','mesh');
+end
 
-end 
-
-if any(steps==2) 
-	disp('   Step 2: Define loads');
+if any(steps==3)
+	disp('   Step 3: Define loads');
 	md = loadmodel('./Models/EsaWahr_Mesh');
 
-	rho_w_i=md.materials.rho_freshwater/md.materials.rho_ice; 
+	rho_w_i=md.materials.rho_freshwater/md.materials.rho_ice;
 
 	index=md.mesh.elements;		
-	x_cent=mean(md.mesh.x(index),2); 
-	y_cent=mean(md.mesh.y(index),2); 
+	x_cent=mean(md.mesh.x(index),2);
+	y_cent=mean(md.mesh.y(index),2);
 
-	md.esa.deltathickness = zeros(md.mesh.numberofelements,1); 
-	disc_radius=20; % [km] 
+	md.esa.deltathickness = zeros(md.mesh.numberofelements,1);
+	disc_radius=20; % [km]
 	rad_dist=sqrt(x_cent.^2+y_cent.^2)/1000;	
 	md.esa.deltathickness(rad_dist<=disc_radius) = -1.0*rho_w_i;
 
-	save ./Models/EsaWahr_Loads md; 
-	
+	save ./Models/EsaWahr_Loads md;
+
 	plotmodel (md,'data',md.esa.deltathickness,'title','Ice height equivalent [m]');
+end
 
-end 
-
-if any(steps==3) 
-	disp('   Step 3: Parameterization');
+if any(steps==4)
+	disp('   Step 4: Parameterization');
 	md = loadmodel('./Models/EsaWahr_Loads');
 
-	nlove=10001;
-	md.esa.love_h = love_numbers('h','CF'); md.esa.love_h(nlove+1:end)=[];
-	md.esa.love_l = love_numbers('l','CF'); md.esa.love_l(nlove+1:end)=[];
+	love_numbers = lovenumbers('maxdeg',10000,'referenceframe','CF');
+	md.esa.love_h = love_numbers.h;
+	md.esa.love_l = love_numbers.l;
 
-	md.mask.ice_levelset = -ones(md.mesh.numberofvertices,1); 
-	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1); 
+	md.mask.ice_levelset = -ones(md.mesh.numberofvertices,1);
+	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1);
 
 	di=md.materials.rho_ice/md.materials.rho_water;
@@ -70,40 +66,38 @@
 	md.geometry.base=md.geometry.surface-md.geometry.thickness;
 	md.geometry.bed=md.geometry.base;
-	
+
 	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
 	md.materials.rheology_B=paterson(md.initialization.temperature);
 	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
-	
+
 	md.miscellaneous.name='EsaWahr';
-	
-	save ./Models/EsaWahr_Parameterization md; 
 
-end 
+	save ./Models/EsaWahr_Parameterization md;
+end
 
-if any(steps==4) 
-	disp('   Step 4: Solve Esa solver');
+if any(steps==5)
+	disp('   Step 5: Solve Esa solver');
 	md = loadmodel('./Models/EsaWahr_Parameterization');
 
 	md.esa.requested_outputs = {'EsaUmotion','EsaXmotion','EsaYmotion'};
-	
-	md.cluster=generic('name',oshostname(),'np',3); 
+
+	md.cluster=generic('name',oshostname(),'np',3);
 	md.verbose=verbose('111111111');
 
 	md=solve(md,'Esa');
 
-	save ./Models/EsaWahr_Solution md; 
+	save ./Models/EsaWahr_Solution md;
+end
 
-end 
-
-if any(steps==5) 
-	disp('   Step 5: Plot solutions');
+if any(steps==6)
+	disp('   Step 6: Plot solutions');
 	md = loadmodel('./Models/EsaWahr_Solution');
 
-	vert = md.results.EsaSolution.EsaUmotion*1000;		% [mm] 
-	horz_n = md.results.EsaSolution.EsaYmotion*1000;	% [mm] 
-	horz_e = md.results.EsaSolution.EsaXmotion*1000;	% [mm] 
-	horz = sqrt(horz_n.^2+horz_e.^2);						% [mm]  
+	vert = md.results.EsaSolution.EsaUmotion*1000;		% [mm]
+	horz_n = md.results.EsaSolution.EsaYmotion*1000;	% [mm]
+	horz_e = md.results.EsaSolution.EsaXmotion*1000;	% [mm]
+	horz = sqrt(horz_n.^2+horz_e.^2);						% [mm]
 
-	set(0,'DefaultAxesFontSize',24,'DefaultAxesLineWidth',1,'DefaultTextFontSize',24,'DefaultLineMarkerSize',6); 
+	set(0,'DefaultAxesFontSize',24,'DefaultAxesLineWidth',1,'DefaultTextFontSize',24,'DefaultLineMarkerSize',6);
 	figure('Position', [100, 100, 800, 600]);
 	plotmodel(md,'data',vert,...
@@ -125,49 +119,46 @@
 		'caxis#3-4',[-0.5 0.5],...
 		'axispos',[0.505 0.02 0.47 0.47],...
-		'colorbarpos',[0.53,0.065,0.18,0.02],'colorbartitle#4','East-west [mm]'); 
-	%export_fig('Fig5.pdf'); 
+		'colorbarpos',[0.53,0.065,0.18,0.02],'colorbartitle#4','East-west [mm]');
+	%export_fig('Fig5.pdf');
+end
 
-end 
-
-if any(steps==6) 
-	disp('   Step 6: Compare results against Wahr semi-analytic solutions');
+if any(steps==7)
+	disp('   Step 7: Compare results against Wahr semi-analytic solutions');
 	md = loadmodel('./Models/EsaWahr_Solution');
 
-	vert = md.results.EsaSolution.EsaUmotion*1000;		% [mm] 
-	horz_n = md.results.EsaSolution.EsaYmotion*1000;	% [mm] 
-	horz_e = md.results.EsaSolution.EsaXmotion*1000;	% [mm] 
-	horz = sqrt(horz_n.^2+horz_e.^2);						% [mm]  
-	
-	xi=[0:500:100000]; % grid points [m] 
-	yi=zeros(1,length(xi)); 
-	vert_track=griddata(md.mesh.x,md.mesh.y,vert,xi,yi,'linear'); 
-	horz_track=griddata(md.mesh.x,md.mesh.y,horz,xi,yi,'linear'); 
+	vert = md.results.EsaSolution.EsaUmotion*1000;		% [mm]
+	horz_n = md.results.EsaSolution.EsaYmotion*1000;	% [mm]
+	horz_e = md.results.EsaSolution.EsaXmotion*1000;	% [mm]
+	horz = sqrt(horz_n.^2+horz_e.^2);						% [mm]
 
-	% semi-analytic solution (Wahr et al., 2013, JGR, Figure 1) 
-	disc_radius = 20*1000; % [m] 
+	xi=[0:500:100000]; % grid points [m]
+	yi=zeros(1,length(xi));
+	vert_track=griddata(md.mesh.x,md.mesh.y,vert,xi,yi,'linear');
+	horz_track=griddata(md.mesh.x,md.mesh.y,horz,xi,yi,'linear');
+
+	% semi-analytic solution (Wahr et al., 2013, JGR, Figure 1)
+	disc_radius = 20*1000; % [m]
 	[vert_wahr, horz_wahr] = wahr(disc_radius,xi,md.esa.love_h,md.esa.love_l);
 
-	set(0,'DefaultAxesFontSize',16,'DefaultAxesLineWidth',1,'DefaultTextFontSize',16,'DefaultLineMarkerSize',6); 
+	set(0,'DefaultAxesFontSize',16,'DefaultAxesLineWidth',1,'DefaultTextFontSize',16,'DefaultLineMarkerSize',6);
 	figure1=figure('Position', [100, 100, 700, 400]);
-	ylabel_1={'0',' ','1','','2','','3',''}; 
+	ylabel_1={'0',' ','1','','2','','3',''};
 	axes1 = axes('Layer','top','Position',[0.1 0.15 0.8 0.8],...
 		'XTick',[0:10:100],'xlim',[0 100],...
-		'ylim',[0 3.5],'Ytick',[0:0.5:3.5],'yticklabel',ylabel_1); 
-		box(axes1,'on'); hold(axes1,'all'); grid on; 
-		xlabel(axes1,'Radial distance [km]'); 
+		'ylim',[0 3.5],'Ytick',[0:0.5:3.5],'yticklabel',ylabel_1);
+		box(axes1,'on'); hold(axes1,'all'); grid on;
+		xlabel(axes1,'Radial distance [km]');
 		ylabel(axes1,'Displacement [mm]');
-		plot([20 20],[0 3.5],'-k','linewidth',2,'parent',axes1); 
-		% analytic soln 
-		h3=plot(xi/1000,vert_wahr,'-r','linewidth',5,'parent',axes1); 
-		h4=plot(xi/1000,horz_wahr,'-m','linewidth',5,'parent',axes1); 
-		% ISSM soln 
-		h1=plot(xi/1000,vert_track*917/1000,'-b','linewidth',3,'parent',axes1); 
-		h2=plot(xi/1000,horz_track*917/1000,'-c','linewidth',3,'parent',axes1); 
+		plot([20 20],[0 3.5],'-k','linewidth',2,'parent',axes1);
+		% analytic soln
+		h3=plot(xi/1000,vert_wahr,'-r','linewidth',5,'parent',axes1);
+		h4=plot(xi/1000,horz_wahr,'-m','linewidth',5,'parent',axes1);
+		% ISSM soln
+		h1=plot(xi/1000,vert_track*917/1000,'-b','linewidth',3,'parent',axes1);
+		h2=plot(xi/1000,horz_track*917/1000,'-c','linewidth',3,'parent',axes1);
 		ag1 = gca;
 		leg1a = legend(ag1,[h3,h1,h4,h2],'Vertical (Wahr)','Vertical (ISSM)','Horizontal (Wahr)','Horizontal (ISSM)');
-		set(leg1a,'location','east','Orientation','Vertical','Box','Off','FontSize',16); 
+		set(leg1a,'location','east','Orientation','Vertical','Box','Off','FontSize',16);
 		set(gcf,'color','w');
-	%export_fig('Fig6.pdf'); 
-
-end 
-
+	%export_fig('Fig6.pdf');
+end
Index: /issm/trunk/examples/Functions/grace.m
===================================================================
--- /issm/trunk/examples/Functions/grace.m	(revision 26743)
+++ /issm/trunk/examples/Functions/grace.m	(revision 26744)
@@ -1,7 +1,10 @@
 % map grace loads in meters [m] of water equivalent height 
-function water_load = grace(index,lat,lon,tmin,tmax); 
+function water_load = grace(index,lat,lon,tmin,tmax,onvertex); 
 
 	%compute centroids using (lat,lon) data {{{
 	ne = length(index); % number of elements 
+	nv = length(lat); % number of vertices
+	% [lat,lon] \in [-90:90,-180,180]; 
+	lat_vertex_0=lat; long_vertex_0=lon; 
 	% lat -> [0,180]; long -> [0,360] to compute centroids 
 	lat=90-lat; 
@@ -43,9 +46,15 @@
 
 	% Monthly GRACE data 
-	filename=['GRCTellus.JPL.200204_201701.LND.RL05_1.DSTvSCS1411.nc']; 
-	time_0=ncread(filename,'time'); % days since 2002-01-01 00:00:00 UTC 
-	long_0=ncread(filename,'lon'); % longitudes: 0.27-359.75
-	lati_0=ncread(filename,'lat'); % latitudes: -89.75:89.75
-	rec=ncread(filename,'lwe_thickness');% rec_ensemble_mean [cm]
+	filename=['../Data/GRCTellus.JPL.200204_201701.LND.RL05_1.DSTvSCS1411.nc'];
+	try
+		time_0=ncread(filename,'time'); % days since 2002-01-01 00:00:00 UTC
+		long_0=ncread(filename,'lon'); % longitudes: 0.27-359.75
+		lati_0=ncread(filename,'lat'); % latitudes: -89.75:89.75
+		rec=ncread(filename,'lwe_thickness');% rec_ensemble_mean [cm]
+	catch e
+		disp('If dataset file exists at another location, modify the path in examples/Functions/grace.m')
+		rethrow(e)
+	end
+
 
 	time_yr = 2002+time_0/365; % [yr] 
@@ -110,8 +119,16 @@
 	load_grace_plus=load_grace_plus(pos1:pos2,:); 
 	num_yr=length(time_yr); 
-	water_load_0=zeros(ne,num_yr);
+	if onvertex
+		water_load_0=zeros(nv,num_yr);
+	else
+		water_load_0=zeros(ne,num_yr);
+	end
 
 	for jj=1:num_yr
-		water_load_0(:,jj) = griddata(lat_grace_plus,lon_grace_plus,load_grace_plus(jj,:),lat_element_0,lon_element);
+		if onvertex
+			water_load_0(:,jj) = griddata(lat_grace_plus,lon_grace_plus,load_grace_plus(jj,:),lat_vertex_0,lon);
+		else 
+			water_load_0(:,jj) = griddata(lat_grace_plus,lon_grace_plus,load_grace_plus(jj,:),lat_element_0,lon_element);
+		end
 		disp([num2str(jj),' of ',num2str(num_yr),' months done!']); 
 	end 
Index: sm/trunk/examples/Functions/wahr.m
===================================================================
--- /issm/trunk/examples/Functions/wahr.m	(revision 26743)
+++ 	(revision )
@@ -1,46 +1,0 @@
-% compute semi-analytic solutions for a disc load 
-function [vert, horz] = wahr(disc_rad,xi,love_h,love_l); 
-
-	disc_rad = disc_rad/1000; % km 
-	% compute P(x), dP(x)/dx, d2P(x)/dx2
-	%---------------------------------------------------------------------
-	% compute p_value 
-	theta=km2deg(xi/1000)';
-	ang = theta/180*pi; 
-	alpha=cos(ang);
-	m=length(alpha);
-	n=length(love_h)-1; 
-	p_value = p_polynomial_value(m,n,alpha);
-	p_prime = p_polynomial_prime(m,n,alpha);
-	%---------------------------------------------------------------------
-	nn=[0:n];
-	nn_plus_1=nn+1; 
-
-	% disc radius in degree 
-	disc_rad = km2deg(disc_rad)/180*pi; 
-	tau=zeros(size(love_h)); 
-	tau(1) = 0.5*(1-cos(disc_rad)); % tau_0 
-	p_value_disc = p_polynomial_value(1,n+1,cos(disc_rad));
-	p_prime_disc = p_polynomial_prime(1,n,cos(disc_rad));
-	for jj=2:n+1
-		nnn = jj-1; 
-		tau(jj) = 0.5 * (p_value_disc(jj-1) - p_value_disc(jj+1)); 
-	end
-
-	const=zeros(size(love_h)); 
-	for jj=1:n+1
-		const(jj) = 1/(2*(jj-1)+1); 
-	end
-
-	disc=sum(bsxfun(@times,p_value,tau'),2); 
-
-	g1 = -sum(bsxfun(@times,p_value,(tau.*love_h.*const)'),2); 
-	g5 = -sum(bsxfun(@times,-sin(ang),bsxfun(@times,p_prime,(tau.*love_l.*const)')),2); 
-
-	% coeff 
-	coeff = 1000*4*pi*(6.67408*10^-11)*(6.3781*10^6)/9.81; 
-
-	% vertical and horizontal solutions in mm 
-	vert = g1*coeff*1000; % mm 
-	horz = g5*coeff*1000; % mm 
-
Index: /issm/trunk/examples/Greenland/CheatSheet.py
===================================================================
--- /issm/trunk/examples/Greenland/CheatSheet.py	(revision 26744)
+++ /issm/trunk/examples/Greenland/CheatSheet.py	(revision 26744)
@@ -0,0 +1,89 @@
+if 7 in steps:
+    #  Step 7: Historical Relaxation run {{{
+    print('   Step 7: Historical Relaxation run')
+    md = loadmodel('./Models/Greenland.Control_drag.nc')
+
+    with open('./smbbox.npz', "rb") as smbFile:
+        SMB = np.load(smbFile)
+        x1 = np.squeeze(SMB['x1'])
+        y1 = np.squeeze(SMB['y1'])
+        smbmean = np.squeeze(SMB['smbmean'])
+
+    #convert mesh x, y into the Box projection
+    [md.mesh.lat, md.mesh.long] = xy2ll(md.mesh.x, md.mesh.y, + 1, 39, 71)
+    [xi, yi] = ll2xy(md.mesh.lat, md.mesh.long, + 1, 45, 70)
+
+    #Interpolate and set surface mass balance
+    x1 = x1.flatten()
+    y1 = y1.flatten()
+    smbmean = smbmean.flatten()
+    index = BamgTriangulate(x1, y1)
+    smb_mo = InterpFromMeshToMesh2d(index, x1, y1, smbmean, xi, yi)
+    smb = smb_mo * 12 / 1000 * md.materials.rho_freshwater / md.materials.rho_ice
+    md.smb.mass_balance = np.append(smb, 1)
+
+    #Set transient options, run for 20 years, saving every timestep
+    md.timestepping.time_step = 0.2
+    md.timestepping.final_time = 200
+    md.settings.output_frequency = 5
+
+    #Additional options
+    md.inversion.iscontrol = 0
+    md.transient.requested_outputs = ['IceVolume', 'TotalSmb', 'SmbMassBalance']
+    md.verbose = verbose('solution', True, 'module', True)
+
+    #Go solve
+    md.cluster = generic('name', gethostname(), 'np', 2)
+    md = solve(md, 'Transient')
+
+    export_netCDF(md, './Models/Greenland.HistoricTransient_200yr.nc')
+    # }}}
+
+if 8 in steps:
+    # Step 8: Plotting exercise {{{
+    print('   Step 8: Plotting exercise')
+    md = loadmodel('./Models/Greenland.HistoricTransient_200yr.nc')
+
+    #Create Line Plots of relaxation run. Create a figure.
+    fig = plt.figure(tight_layout=True)
+
+    #Save surface mass balance, by looping through 200 years (1000 steps)
+    #Note, the first output will always contain output from time step 1
+
+    Timer = np.arange(0.2, 200.2)
+    surfmb = []
+    for i in range(0, 200):
+        surfmb.append(md.results.TransientSolution[i].SmbMassBalance)
+
+    #Plot surface mass balance time series in first subplot
+    ax = fig.add_subplot(311)
+    ax.plot(Timer, np.nanmean(surfmb, axis=1))
+
+    #Title this plot Mean surface mass balance
+    ax.set_title('Mean Surface mass balance')
+
+    #Save velocity by looping through 200 years
+    vel = []
+    for i in range(0, 200):
+        vel.append(md.results.TransientSolution[i].Vel)
+
+    #Plot velocity time series in second subplot
+    ay = fig.add_subplot(312)
+    ay.plot(Timer, np.nanmean(vel, axis=1))
+
+    #Title this plot Mean Velocity
+    ay.set_title('Mean Velocity')
+
+    #Save Ice Volume by looping through 200 years
+    volume = []
+    for i in range(0, 200):
+        volume.append(md.results.TransientSolution[i].IceVolume)
+
+    #Plot volume time series in third subplot
+    az = fig.add_subplot(313)
+    az.plot(Timer, volume)
+
+    #Title this plot Mean Velocity and add an x label of years
+    az.set_title('Ice Volume')
+    az.set_xlabel('years')
+    # }}}
Index: /issm/trunk/examples/Greenland/Greenland.py
===================================================================
--- /issm/trunk/examples/Greenland/Greenland.py	(revision 26744)
+++ /issm/trunk/examples/Greenland/Greenland.py	(revision 26744)
@@ -0,0 +1,83 @@
+import numpy as np
+from paterson import paterson
+from netCDF4 import Dataset
+from InterpFromGridToMesh import InterpFromGridToMesh
+
+#Name and Coordinate system
+md.miscellaneous.name = 'SeaRISEgreenland'
+md.mesh.epsg = 3413
+
+print('   Loading SeaRISE data from NetCDF')
+ncdata = Dataset('../Data/Greenland_5km_dev1.2.nc', mode='r')
+x1 = np.squeeze(ncdata.variables['x1'][:].data)
+y1 = np.squeeze(ncdata.variables['y1'][:].data)
+usrf = np.squeeze(ncdata.variables['usrf'][:].data)
+topg = np.squeeze(ncdata.variables['topg'][:].data)
+velx = np.squeeze(ncdata.variables['surfvelx'][:].data)
+vely = np.squeeze(ncdata.variables['surfvely'][:].data)
+temp = np.squeeze(ncdata.variables['airtemp2m'][:].data)
+smb = np.squeeze(ncdata.variables['smb'][:].data)
+gflux = np.squeeze(ncdata.variables['bheatflx'][:].data)
+ncdata.close()
+
+print('   Interpolating surface and bedrock')
+md.geometry.base = InterpFromGridToMesh(x1, y1, topg, md.mesh.x, md.mesh.y, 0)
+md.geometry.surface = InterpFromGridToMesh(x1, y1, usrf, md.mesh.x, md.mesh.y, 0)
+
+print('   Constructing thickness')
+md.geometry.thickness = md.geometry.surface - md.geometry.base
+
+#Set min thickness to 1 meter
+pos0 = np.nonzero(md.geometry.thickness <= 0)
+md.geometry.thickness[pos0] = 1
+md.geometry.surface = md.geometry.thickness + md.geometry.base
+
+print('   Interpolating velocities ')
+md.inversion.vx_obs = InterpFromGridToMesh(x1, y1, velx, md.mesh.x, md.mesh.y, 0)
+md.inversion.vy_obs = InterpFromGridToMesh(x1, y1, vely, md.mesh.x, md.mesh.y, 0)
+md.inversion.vel_obs = np.sqrt(md.inversion.vx_obs**2 + md.inversion.vy_obs**2)
+md.initialization.vx = md.inversion.vx_obs
+md.initialization.vy = md.inversion.vy_obs
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.vel = md.inversion.vel_obs
+
+print('   Interpolating temperatures')
+md.initialization.temperature = InterpFromGridToMesh(x1, y1, temp, md.mesh.x, md.mesh.y, 0) + 273.15
+
+print('   Interpolating surface mass balance')
+md.smb.mass_balance = InterpFromGridToMesh(x1, y1, smb, md.mesh.x, md.mesh.y, 0)
+md.smb.mass_balance = md.smb.mass_balance * md.materials.rho_water / md.materials.rho_ice
+
+print('   Construct basal friction parameters')
+md.friction.coefficient = 30 * np.ones((md.mesh.numberofvertices))
+pos = np.nonzero(md.mask.ocean_levelset < 0)
+md.friction.coefficient[pos] = 0  #no friction applied on floating ice
+md.friction.p = np.ones((md.mesh.numberofelements))
+md.friction.q = np.ones((md.mesh.numberofelements))
+
+print('   Construct ice rheological properties')
+md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements))
+md.materials.rheology_B = paterson(md.initialization.temperature)
+md.friction.q = np.ones((md.mesh.numberofelements))
+md.friction.p = np.ones((md.mesh.numberofelements))
+
+print('   Set other boundary conditions')
+md.mask.ice_levelset[np.nonzero(md.mesh.vertexonboundary == 1)] = 0
+md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices))
+md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices))
+#impose observed temperature on surface
+md.thermal.spctemperature = md.initialization.temperature
+md.masstransport.spcthickness = np.nan * np.ones((md.mesh.numberofvertices))
+
+print('   Set geothermal heat flux')
+md.basalforcings.geothermalflux = InterpFromGridToMesh(x1, y1, gflux, md.mesh.x, md.mesh.y, 0)
+
+print('   Set Pressure')
+md.initialization.pressure = md.materials.rho_ice * md.constants.g * md.geometry.thickness
+
+print('   Single point constraints')
+#Initialize single point constraint arrays
+md.stressbalance.referential = np.nan * np.ones((md.mesh.numberofvertices, 6))
+md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
+md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
+md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
Index: /issm/trunk/examples/Greenland/runme.m
===================================================================
--- /issm/trunk/examples/Greenland/runme.m	(revision 26743)
+++ /issm/trunk/examples/Greenland/runme.m	(revision 26744)
@@ -5,5 +5,5 @@
 ncdata='../Data/Greenland_5km_dev1.2.nc';
 
-if any(steps==1)
+if any(steps==1) 
 	disp('   Step 1: Mesh creation');
 
@@ -22,5 +22,5 @@
 	%Mesh Greenland
 	md=bamg(md,'hmax',400000,'hmin',5000,'gradation',1.7,'field',vel,'err',8);
-	
+
 	%convert x,y coordinates (Polar stereo) to lat/lon
 	[md.mesh.lat,md.mesh.long]=xy2ll(md.mesh.x,md.mesh.y,+1,39,71);
@@ -29,7 +29,7 @@
 
 	plotmodel (md,'data','mesh');
-end
-
-if any(steps==2)
+end 
+
+if any(steps==2) 
 	disp('   Step 2: Parameterization');
 	md = loadmodel('./Models/Greenland.Mesh_generation');
@@ -39,8 +39,8 @@
 	md = setflowequation(md,'SSA','all');
 
-	save ./Models/Greenland.Parameterization md; 
-end
-
-if any(steps==3)
+	save ./Models/Greenland.Parameterization md;
+end 
+
+if any(steps==3) 
 	disp('   Step 3: Control method friction');
 	md = loadmodel('./Models/Greenland.Parameterization');
@@ -66,5 +66,5 @@
 
 	%Additional parameters
-	md.stressbalance.restol=0.01; md.stressbalance.reltol=0.1; 
+	md.stressbalance.restol=0.01; md.stressbalance.reltol=0.1;
 	md.stressbalance.abstol=NaN;
 
@@ -78,8 +78,8 @@
 	md.friction.coefficient=md.results.StressbalanceSolution.FrictionCoefficient;
 
-	save ./Models/Greenland.Control_drag md; 
-end
-
-if any(steps==4)
+	save ./Models/Greenland.Control_drag md;
+end 
+
+if any(steps==4) 
 	disp('   Step 4: Transient run');
 	md = loadmodel('./Models/Greenland.Control_drag');
@@ -101,6 +101,5 @@
 	%Additional options
 	md.inversion.iscontrol=0;
-	md.transient.requested_outputs={'IceVolume','TotalSmb', ...
-		                             'SmbMassBalance'};
+	md.transient.requested_outputs={'IceVolume','TotalSmb','SmbMassBalance'};
 	md.verbose=verbose('solution',true,'module',true,'convergence',true);
 
@@ -109,9 +108,9 @@
 	md=solve(md,'Transient');
 
-	save ./Models/Greenland.Transient md; 
-end
-
-if any(steps==5)
-	disp('   Step 5: Plotting'); 
+	save ./Models/Greenland.Transient md;
+end 
+
+if any(steps==5) 
+	disp('   Step 5: Plotting');
 	md = loadmodel('./Models/Greenland.Transient');
 
@@ -143,7 +142,7 @@
 	subplot(3,1,3); plot([0.2:0.2:20],volume); title('Ice Volume');
 	xlabel('years')
-end
-
-if any(steps==6)
+end 
+
+if any(steps==6) 
 	disp('   Step 6: Extract Box SMB');
 	md = loadmodel('./Models/Greenland.Transient');
@@ -172,8 +171,7 @@
 
 	clear smbbox
-
-end
-
-if any(steps==7)
+end 
+
+if any(steps==7) 
 	disp('   Step 7: Historical Relaxation run');
 	md = loadmodel('./Models/Greenland.Control_drag');
@@ -198,6 +196,5 @@
 	%Additional options
 	md.inversion.iscontrol=0;
-	md.transient.requested_outputs={'IceVolume','TotalSmb', ...
-		'SmbMassBalance'};
+	md.transient.requested_outputs={'IceVolume','TotalSmb','SmbMassBalance'};
 	md.verbose=verbose('solution',true,'module',true);
 
@@ -207,45 +204,35 @@
 
 	save ./Models/Greenland.HistoricTransient md;
-end
-
-if any(steps==8)
+end % step 7 end
+
+if any(steps==8) 
 	disp('   Step 8: Plotting exercise');
 
 	%Load historic transient model
 
-
-	%Create Line Plots of relaxation run.  Create a figure.
-
+	%Create Line Plots of relaxation run. Create a figure.
 
 	%Save surface mass balance, by looping through 200 years (1000 steps)
-	% Note, the first output will always contain output from time step 1
-
+	%Note, the first output will always contain output from time step 1
 
 	%Plot surface mass balance time series in first subplot
 
-	
 	%Title this plot Mean surface mass balance
 
-
 	%Save velocity by looping through 200 years
 
-
 	%Plot velocity time series in second subplot
 
-	
 	%Title this plot Mean Velocity
 
-
-	%Save Ice Volume by looping through 200 years 
-
+	%Save Ice Volume by looping through 200 years
 
 	%Plot volume time series in third subplot
 
-	
 	%Title this plot Mean Velocity and add an x label of years
 
-end
-
-if any(steps==9)
+end % step 8 end
+
+if any(steps==9) 
 	disp('   Step 9: Box Transient run');
 	md = loadmodel('./Models/Greenland.HistoricTransient_200yr');
@@ -292,6 +279,5 @@
 	%Additional options
 	md.inversion.iscontrol=0;
-	md.transient.requested_outputs={'IceVolume','TotalSmb', ...
-		'SmbMassBalance'};
+	md.transient.requested_outputs={'IceVolume','TotalSmb','SmbMassBalance'};
 	md.verbose=verbose('solution',true,'module',true);
 
@@ -301,7 +287,7 @@
 
 	save ./Models/Greenland.BoxTransient md;
-end
-
-if any(steps==10)
+end 
+
+if any(steps==10) 
 	disp('   Step 10: Plot Box Transient');
 	md = loadmodel('./Models/Greenland.BoxTransient');
@@ -327,3 +313,3 @@
 	subplot(3,1,3); plot(t,volume); title('Ice Volume');
 	xlabel('years')
-end
+end 
Index: /issm/trunk/examples/Greenland/runme.py
===================================================================
--- /issm/trunk/examples/Greenland/runme.py	(revision 26744)
+++ /issm/trunk/examples/Greenland/runme.py	(revision 26744)
@@ -0,0 +1,369 @@
+import numpy as np
+from triangle import triangle
+from model import *
+from netCDF4 import Dataset
+from InterpFromGridToMesh import InterpFromGridToMesh
+from bamg import bamg
+from xy2ll import xy2ll
+from plotmodel import plotmodel
+from export_netCDF import export_netCDF
+from loadmodel import loadmodel
+from setmask import setmask
+from parameterize import parameterize
+from setflowequation import setflowequation
+from socket import gethostname
+from solve import solve
+from ll2xy import ll2xy
+from BamgTriangulate import BamgTriangulate
+from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
+from scipy.interpolate import griddata
+
+steps = [1]
+
+if 1 in steps:
+    # Step 1: Mesh creation {{{
+    print('   Step 1: Mesh creation')
+
+    #Generate initial uniform mesh (resolution = 20000 m)
+    md = triangle(model(), './DomainOutline.exp', 20000)
+
+    ncdata = Dataset('../Data/Greenland_5km_dev1.2.nc', mode='r')
+
+    # Get velocities (Note: You can use ncprint('file') to see an ncdump)
+    x1 = np.squeeze(ncdata.variables['x1'][:].data)
+    y1 = np.squeeze(ncdata.variables['y1'][:].data)
+    velx = np.squeeze(ncdata.variables['surfvelx'][:].data)
+    vely = np.squeeze(ncdata.variables['surfvely'][:].data)
+    ncdata.close()
+
+    vx = InterpFromGridToMesh(x1, y1, velx, md.mesh.x, md.mesh.y, 0)
+    vy = InterpFromGridToMesh(x1, y1, vely, md.mesh.x, md.mesh.y, 0)
+    vel = np.sqrt(vx**2 + vy**2)
+
+    #Mesh Greenland
+    md = bamg(md, 'hmax', 400000, 'hmin', 5000, 'gradation', 1.7, 'field', vel, 'err', 8)
+
+    #convert x, y coordinates (Polar stereo) to lat / lon
+    [md.mesh.lat, md.mesh.long] = xy2ll(md.mesh.x, md.mesh.y, + 1, 39, 71)
+
+    export_netCDF(md, './Models/Greenland.Mesh_generation.nc')
+    plotmodel(md, 'data', 'mesh')
+    # }}}
+
+if 2 in steps:
+    #  Step 2: Parameterization{{{
+    print('   Step 2: Parameterization')
+    md = loadmodel('./Models/Greenland.Mesh_generation.nc')
+
+    md = setmask(md, '', '')
+    md = parameterize(md, './Greenland.py')
+    md = setflowequation(md, 'SSA', 'all')
+
+    export_netCDF(md, "./Models/Greenland.Parameterization.nc")
+    # }}}
+
+if 3 in steps:
+    #   Step 3: Control method friction {{{
+    print('   Step 3: Control method friction')
+    md = loadmodel('./Models/Greenland.Parameterization.nc')
+    #Control general
+    md.inversion.iscontrol = 1
+    md.inversion.nsteps = 30
+    md.inversion.step_threshold = 0.99 * np.ones((md.inversion.nsteps))
+    md.inversion.maxiter_per_step = 5 * np.ones((md.inversion.nsteps))
+
+    #Cost functions
+    md.inversion.cost_functions = [101, 103, 501]
+    md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 3))
+    md.inversion.cost_functions_coefficients[:, 0] = 350
+    md.inversion.cost_functions_coefficients[:, 1] = 0.6
+    md.inversion.cost_functions_coefficients[:, 2] = 2e-6
+
+    #Controls
+    md.inversion.control_parameters = ['FrictionCoefficient']
+    md.inversion.gradient_scaling = 50 * np.ones((md.inversion.nsteps, 1))
+    md.inversion.min_parameters = 1 * np.ones((md.mesh.numberofvertices, 1))
+    md.inversion.max_parameters = 200 * np.ones((md.mesh.numberofvertices, 1))
+
+    #Additional parameters
+    md.stressbalance.restol = 0.01
+    md.stressbalance.reltol = 0.1
+    md.stressbalance.abstol = np.nan
+    md.stressbalance.loadingforce = np.zeros((md.mesh.numberofvertices, 3))
+
+    #Go solve
+    md.cluster = generic('name', gethostname(), 'np', 2)
+    md.toolkits = toolkits()
+    md.verbose = verbose('solution', True, 'control', True)
+    md = solve(md, 'Stressbalance')
+
+    #Update model friction fields accordingly
+    md.friction.coefficient = md.results.StressbalanceSolution.FrictionCoefficient
+
+    export_netCDF(md, "./Models/Greenland.Control_drag.nc")
+    # }}}
+
+if 4 in steps:
+    #   Step 4: Transient run {{{
+    print('   Step 4: Transient run')
+    md = loadmodel('./Models/Greenland.Control_drag.nc')
+
+    #Set surface mass balance
+    ncdata = Dataset('../Data/Greenland_5km_dev1.2.nc', mode='r')
+    x1 = np.squeeze(ncdata.variables['x1'][:].data)
+    y1 = np.squeeze(ncdata.variables['y1'][:].data)
+    smb = np.squeeze(ncdata.variables['smb'][:].data)
+    ncdata.close()
+
+    smb = InterpFromGridToMesh(x1, y1, smb, md.mesh.x, md.mesh.y, 0)
+    smb = smb * md.materials.rho_freshwater / md.materials.rho_ice
+    smb = np.vstack((smb, smb, smb - 1.0)).T
+    md.smb.mass_balance = np.vstack((smb, np.asarray([[1, 10, 20]])))
+    #Set transient options, run for 20 years, saving every timestep
+    md.timestepping.time_step = 0.2
+    md.timestepping.final_time = 20
+    md.settings.output_frequency = 1
+
+    #Additional options
+    md.inversion.iscontrol = 0
+    md.transient.requested_outputs = ['IceVolume', 'TotalSmb', 'SmbMassBalance']
+    md.verbose = verbose('solution', True, 'module', True, 'convergence', True)
+
+    #Go solve
+    md.cluster = generic('name', gethostname(), 'np', 2)
+    md = solve(md, 'Transient')
+
+    export_netCDF(md, './Models/Greenland.Transient.nc')
+    # }}}
+
+if 5 in steps:
+    #   Step 5: Plotting {{{
+    print('   Step 5: Plotting')
+    md = loadmodel('./Models/Greenland.Transient.nc')
+
+    #Planview plots
+    plotmodel(md, 'data', md.results.TransientSolution[-1].Vel, 'log#1', 1e-1,
+              'caxis#1', [1e-1, 1e4], 'title#1', 'Velocity (m / y)',
+              'data', md.results.TransientSolution[1].SmbMassBalance,
+              'title#2', 'Surface Mass Balance (m / y)',
+              'data', md.results.TransientSolution[-1].Thickness,
+              'title', 'Thickness (m)',
+              'data', md.results.TransientSolution[-1].Surface,
+              'title', 'Surface (m)')
+
+    #Line Plots
+    figure
+
+    #Plot surface mass balance, velocity and volume
+    surfmb = []
+    vel = []
+    volume = []
+    for i in range(0, 100):
+        surfmb.append(md.results.TransientSolution[i].SmbMassBalance)
+        vel.append(md.results.TransientSolution[i].Vel)
+        volume.append(md.results.TransientSolution[i].IceVolume)
+
+    layout, ax = plt.subplots(3, 1, sharex=True, sharey=False, figsize=(5, 5))
+    ax[0].plot(np.arange(0.2, 20.2, 0.2), np.nanmean(surfmb, axis=1))
+    ax[0].set_title('Mean Surface mass balance')
+    ax[1].plot(np.arange(0.2, 20.2, 0.2), np.nanmean(vel, axis=1))
+    ax[1].set_title('Mean Velocity')
+    ax[2].plot(np.arange(0.2, 20.2, 0.2), volume)
+    ax[2].set_title('Ice Volume')
+    ax[2].set_xlabel('years')
+    # }}}
+
+if 6 in steps:
+    #   Step 6: Extract Box SMB{{{
+    print('   Step 6: Extract Box SMB')
+    md = loadmodel('./Models/Greenland.Transient.nc')
+
+    #Set surface mass balance
+    ncbox = Dataset('../Data/Box_Greenland_SMB_monthly_1840-2012_5km_cal_ver20141007.nc', mode='r')
+    lat = np.squeeze(ncbox.variables['lat'][:].data)
+    lon = np.squeeze(ncbox.variables['lon'][:].data)
+    smbbox = np.squeeze(ncbox.variables['MassFlux'][:].data)
+    ncbox.close()
+    [x1, y1] = ll2xy(lat, lon, + 1, 45, 70)
+
+    years_of_simulation = np.arange(1840, 2012 + 1)
+    t = np.arange(years_of_simulation[0], years_of_simulation[-1] + 11 / 12, 1 / 12)
+    #Area of grid for 5km box
+    area_of_grid = 5000 * 5000
+    totalsmb = reshape(np.nansum(smbbox / 1000, axis=(-2, -1)), (len(t), 1)) * area_of_grid
+
+    #save surface mass balance mat dataset
+    smbmean = np.nanmean(smbbox, axis=(0, 1))
+    SMB = {}
+    SMB['smbmean'] = smbmean
+    SMB['totalsmb '] = totalsmb
+    SMB['smbbox'] = smbbox
+    SMB['x1'] = x1
+    SMB['y1'] = y1
+    SMB['t'] = t
+
+    np.savez('./smbbox.npz', **SMB)
+
+    #plot a time series of total SMB
+    fig = plt.figure(tight_layout=True)
+    ax = fig.add_subplot(111)
+    ax.plot(t, totalsmb / 1e9)
+    ax.set_title('Total Surface mass balance, Gt')
+    ax.set_xlabel('year')
+    ax.set_ylabel('Gt/yr')
+
+    del smbbox
+    # }}}
+
+if 7 in steps:
+    #  Step 7: Historical Relaxation run {{{
+    print('   Step 7: Historical Relaxation run')
+    md = loadmodel('./Models/Greenland.Control_drag.nc')
+
+    with open('./smbbox.npz', "rb") as smbFile:
+        SMB = np.load(smbFile)
+        x1 = np.squeeze(SMB['x1'])
+        y1 = np.squeeze(SMB['y1'])
+        smbmean = np.squeeze(SMB['smbmean'])
+
+    #convert mesh x, y into the Box projection
+    [md.mesh.lat, md.mesh.long] = xy2ll(md.mesh.x, md.mesh.y, + 1, 39, 71)
+    [xi, yi] = ll2xy(md.mesh.lat, md.mesh.long, + 1, 45, 70)
+
+    #Interpolate and set surface mass balance
+    x1 = x1.flatten()
+    y1 = y1.flatten()
+    smbmean = smbmean.flatten()
+    index = BamgTriangulate(x1, y1)
+    smb_mo = InterpFromMeshToMesh2d(index, x1, y1, smbmean, xi, yi)
+    smb = smb_mo * 12 / 1000 * md.materials.rho_freshwater / md.materials.rho_ice
+    md.smb.mass_balance = np.append(smb, 1)
+
+    #Set transient options, run for 20 years, saving every timestep
+    md.timestepping.time_step = 0.2
+    md.timestepping.final_time = 20
+    md.settings.output_frequency = 1
+
+    #Additional options
+    md.inversion.iscontrol = 0
+    md.transient.requested_outputs = ['IceVolume', 'TotalSmb', 'SmbMassBalance']
+    md.verbose = verbose('solution', True, 'module', True)
+
+    #Go solve
+    md.cluster = generic('name', gethostname(), 'np', 2)
+    md = solve(md, 'Transient')
+
+    export_netCDF(md, './Models/Greenland.HistoricTransient.nc')
+    # }}}
+
+if 8 in steps:
+    # Step 8: Plotting exercise {{{
+    print('   Step 8: Plotting exercise')
+    #Load historic transient model
+
+    #Create Line Plots of relaxation run. Create a figure.
+
+    #Save surface mass balance, by looping through 200 years (1000 steps)
+    #Note, the first output will always contain output from time step 1
+
+    #Plot surface mass balance time series in first subplot
+
+    #Title this plot Mean surface mass balance
+
+    #Save velocity by looping through 200 years
+
+    #Plot velocity time series in second subplot
+
+    #Title this plot Mean Velocity
+
+    #Save Ice Volume by looping through 200 years
+
+    #Plot volume time series in third subplot
+
+    #Title this plot Mean Velocity and add an x label of years
+    # }}}
+
+if 9 in steps:
+    # Step 9: Box Transient run{{{
+    print('   Step 9: Box Transient run')
+    md = loadmodel('./Models/Greenland.HistoricTransient.nc')
+
+    #load past transient results
+    md.geometry.base = md.results.TransientSolution[-1].Base
+    md.geometry.thickness = md.results.TransientSolution[-1].Thickness
+    md.geometry.surface = md.geometry.base + md.geometry.thickness
+    md.initialization.vx = md.results.TransientSolution[-1].Vx
+    md.initialization.vy = md.results.TransientSolution[-1].Vy
+    md.results = []
+
+    #convert mesh x, y into the Box projection
+    [md.mesh.lat, md.mesh.long] = xy2ll(md.mesh.x, md.mesh.y, + 1, 39, 71)
+    [xi, yi] = ll2xy(md.mesh.lat, md.mesh.long, + 1, 45, 70)
+
+    #Set surface mass balance
+    with open('./smbbox.npz', "rb") as smbFile:
+        SMB = np.load(smbFile)
+        x1 = np.squeeze(SMB['x1'])
+        y1 = np.squeeze(SMB['y1'])
+        smbbox = np.squeeze(SMB['smbbox'])
+
+    x1 = x1.flatten()
+    y1 = y1.flatten()
+    index = BamgTriangulate(x1, y1)
+    #Set years to run
+    years_of_simulation = np.arange(2003, 2012 + 1)
+
+    #initialize surface mass balance matrix
+    smb = np.nan * np.ones((md.mesh.numberofvertices, len(years_of_simulation) * 12))
+
+    #Interpolate and set surface mass balance
+    for year in years_of_simulation:
+        for month in range(0, 12):
+            smb_mo = griddata((np.double(x1), np.double(y1)), np.double(smbbox[year - 1840, month, :, :].flatten()), (xi, yi), method='nearest')
+            smb[:, (year - years_of_simulation[0]) * 12 + month] = smb_mo
+    smb = smb * 12 / 1000 * md.materials.rho_freshwater / md.materials.rho_ice
+    timer = np.arange(1 / 24, len(years_of_simulation), 1 / 12)
+    md.smb.mass_balance = np.vstack((smb, timer))
+
+    #Set transient options, monthly timestep, saving every month
+    md.timestepping.time_step = 1 / 12
+    md.timestepping.final_time = len(years_of_simulation)
+    md.settings.output_frequency = 1
+
+    #Additional options
+    md.inversion.iscontrol = 0
+    md.transient.requested_outputs = ['IceVolume', 'TotalSmb', 'SmbMassBalance']
+    md.verbose = verbose('solution', True, 'module', True)
+
+    #Go solve
+    md.cluster = generic('name', gethostname(), 'np', 2)
+    md = solve(md, 'Transient')
+
+    export_netCDF(md, './Models/Greenland.BoxTransient.nc')
+    # }}}
+
+if 10 in steps:
+    print('   Step 10: Plot Box Transient')
+    md = loadmodel('./Models/Greenland.BoxTransient.nc')
+
+    #Set years run
+    years_of_simulation = np.arange(2003, 2012 + 1)
+    t = np.arange(years_of_simulation[0], years_of_simulation[-1] + 11 / 12, 1 / 12)
+
+    #Line Plots
+    layout, ax = plt.subplots(3, 1, sharex=True, sharey=False, figsize=(5, 5))
+    #Plot surface mass balance
+    surfmb = []
+    vel = []
+    volume = []
+    for i in range(0, len(t)):
+        surfmb.append(md.results.TransientSolution[i].TotalSmb)
+        vel.append(md.results.TransientSolution[i].Vel)
+        volume.append(md.results.TransientSolution[i].IceVolume)
+    ax[0].plot(t, surfmb)
+    ax[0].set_title('Total Surface mass balance')
+    ax[1].plot(t, np.nanmax(vel, axis=1))
+    ax[1].set_title('Max Velocity')
+    ax[2].plot(t, volume)
+    ax[2].set_title('Ice Volume')
+    ax[2].set_xlabel('years')
Index: sm/trunk/examples/ISMIP/CheatyIsmipA.par
===================================================================
--- /issm/trunk/examples/ISMIP/CheatyIsmipA.par	(revision 26743)
+++ 	(revision )
@@ -1,52 +1,0 @@
-%Parameterization for ISMIP A experiment
-
-%Set the Simulation generic name #md.miscellaneous
-%->
-
-%Geometry
-disp('   Constructing Geometry');
-
-%Define the geometry of the simulation #md.geometry
-%surface is [-x*tan(0.5*pi/180)] #md.mesh
-%->
-md.geometry.surface=-md.mesh.x*tan(0.5*pi/180.);
-%base is [surface-1000+500*sin(x*2*pi/L).*sin(y*2*pi/L)]
-%L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)
-%->
-L=max(md.mesh.x)-min(md.mesh.x);
-md.geometry.base=md.geometry.surface-1000.0+500.0*sin(md.mesh.x*2.0*pi/L).*sin(md.mesh.y*2.0*pi/L);
-%thickness is the difference between surface and base #md.geometry
-%->
-md.geometry.thickness=md.geometry.surface-md.geometry.base;
-%plot the geometry to check it out
-%->
-plotmodel(md,'data',md.geometry.thickness);
-
-disp('   Defining friction parameters');
-
-%These parameters will not be used but need to be fixed #md.friction
-%one friciton coefficient per node (md.mesh.numberofvertices,1)
-%->
-md.friction.coefficient=200.0*ones(md.mesh.numberofvertices,1);
-%one friciton exponent (p,q) per element
-%->
-md.friction.p=ones(md.mesh.numberofelements,1);
-%->
-md.friction.q=ones(md.mesh.numberofelements,1);
-
-disp('   Construct ice rheological properties');
-
-%The rheology parameters sit in the material section #md.materials
-%B has one value per vertex
-%->
-md.materials.rheology_B=6.8067e7*ones(md.mesh.numberofvertices,1);
-%n has one value per element
-%->
-md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
-
-disp('   Set boundary conditions');
-
-%Set the default boundary conditions for an ice-sheet 
-% #help SetIceSheetBC
-%->
-md=SetIceSheetBC(md);
Index: sm/trunk/examples/ISMIP/CheatyIsmipF.par
===================================================================
--- /issm/trunk/examples/ISMIP/CheatyIsmipF.par	(revision 26743)
+++ 	(revision )
@@ -1,66 +1,0 @@
-%Parameterization for ISMIP F experiment
-
-%Set the Simulation generic name #md.miscellaneous
-%->
-
-%Geometry
-disp('   Constructing Geometry');
-
-%Define the geometry of the simulation #md.geometry
-%surface is [-x*tan(3.0*pi/180)] #md.mesh
-%->
-md.geometry.surface=md.mesh.x*tan(3.0*pi/180.0);
-%base is [surface-1000+100*exp(-((x-L/2).^2+(y-L/2).^2)/(10000.^2))]
-%L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)
-%->
-L=max(md.mesh.x)-min(md.mesh.x);
-%->
-md.geometry.base=md.geometry.surface-1000.0+100.0*exp(-((md.mesh.x-L/2.0).^2.0+(md.mesh.y-L/2.0).^2.0)/(10000.^2.0));
-%thickness is the difference between surface and base #md.geometry
-%->
-md.geometry.thickness=md.geometry.surface-md.geometry.base;
-%plot the geometry to check it out
-%->
-plotmodel(md,'data',md.geometry.thickness);
-
-disp('   Defining friction parameters');
-
-%These parameters will not be used but need to be fixed #md.friction
-%one friciton coefficient per node (md.mesh.numberofvertices,1)
-%conversion form year to seconds with #md.constants.yts
-%->
-md.friction.coefficient=sqrt(md.constants.yts/(1000*2.140373*10^-7))*ones(md.mesh.numberofvertices,1);
-%one friciton exponent (p,q) per element
-%->
-md.friction.p=ones(md.mesh.numberofelements,1);
-%->
-md.friction.q=zeros(md.mesh.numberofelements,1);
-
-disp('   Construct ice rheological properties');
-
-%The rheology parameters sit in the material section #md.materials
-%B has one value per vertex
-%->
-md.materials.rheology_B=(1/(2.140373*10^-7/md.constants.yts))*ones(md.mesh.numberofvertices,1);
-%n has one value per element
-%->
-md.materials.rheology_n=1*ones(md.mesh.numberofelements,1);
-
-disp('   Set boundary conditions');
-
-%Set the default boundary conditions for an ice-sheet 
-% #help SetIceSheetBC
-%->
-md=SetIceSheetBC(md);
-
-disp('   Initializing velocity and pressure');
-
-%initialize the velocity and pressurefields of #md.initialization
-%->
-md.initialization.vx=zeros(md.mesh.numberofvertices,1);
-%->
-md.initialization.vy=zeros(md.mesh.numberofvertices,1);
-%->
-md.initialization.vz=zeros(md.mesh.numberofvertices,1);
-%->
-md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
Index: sm/trunk/examples/ISMIP/CheatyRunme.m
===================================================================
--- /issm/trunk/examples/ISMIP/CheatyRunme.m	(revision 26743)
+++ 	(revision )
@@ -1,221 +1,0 @@
-%wich steps to perform steps are from 1 to 8 
-%step 7 is specific to ISMIPA
-%step 8 is specific to ISMIPF
-
-steps=[1];
-
-% parameter file to be used, choose between CheatyIsmipA.par or CheatyIsmipF.par
-ParamFile='CheatyIsmipF.par'
-
-%Run Steps
-
-%Mesh Generation #1
-if any(steps==1)
-
-	%initialize md as a new model #help model
-	%->
-	md=model();
-	% generate a squaremesh #help squaremesh
-	% Side is 80 km long with 20 points
-	%->
-	if(ParamFile=='CheatyIsmipA.par'),
-		md=squaremesh(md,80000,80000,20,20);
-	elseif(ParamFile=='CheatyIsmipF.par'),
-		md=squaremesh(md,100000,100000,30,30);
-  end
-	% plot the given mesh #plotdoc
-	%->
-	plotmodel(md,'data','mesh')
-	% save the given model
-	%->
-	save ./Models/ISMIP.Mesh_generation md;
-end
-
-%Masks #2
-if any(steps==2)
-
-	% load the preceding step #help loadmodel
-	% path is given by the organizer with the name of the given step
-	%->
-	md = loadmodel('./Models/ISMIP.Mesh_generation');
-	% set the mask #help setmask
-	% all MISMIP nodes are grounded
-	%->
-	md=setmask(md,'','');
-	% plot the given mask #md.mask to locate the field
-	%->
-	plotmodel(md,'data',md.mask.ocean_levelset);
-	% save the given model
-	%->
-	save ./Models/ISMIP.SetMask md;
-end
-
-%Parameterization #3
-if any(steps==3)
-
-	% load the preceding step #help loadmodel
-	% path is given by the organizer with the name of the given step
-	%->
-	md = loadmodel('./Models/ISMIP.SetMask');
-	% parametrize the model # help parameterize
-	% you will need to fil-up the parameter file defined by the
-	% ParamFile variable
-	%->
-	md=parameterize(md,ParamFile);
-	% save the given model
-	%->
-	save ./Models/ISMIP.Parameterization md;
-end
-
-%Extrusion #4
-if any(steps==4)
-	
-	% load the preceding step #help loadmodel
-	% path is given by the organizer with the name of the given step
-	%->
-	md = loadmodel('./Models/ISMIP.Parameterization');
-	% vertically extrude the preceding mesh #help extrude
-	% only 5 layers exponent 1
-	%->
-	md=extrude(md,9,1);
-	% plot the 3D geometry #plotdoc
-	%->
-	plotmodel(md,'data',md.geometry.base)
-	% save the given model
-	%->
-	save ./Models/ISMIP.Extrusion md;
-end
-
-%Set the flow computing method #5
-if any(steps==5)
-
-	% load the preceding step #help loadmodel
-	% path is given by the organizer with the name of the given step
-	%->
-	md = loadmodel('./Models/ISMIP.Extrusion');
-	% set the approximation for the flow computation #help setflowequation
-	% We will be using the Higher Order Model (HO)
-	%->
-	md=setflowequation(md,'HO','all');
-	% save the given model
-	%->
-	save ./Models/ISMIP.SetFlow md;
-end
-
-%Set Boundary Conditions #6
-if any(steps==6)
-
-	% load the preceding step #help loadmodel
-	% path is given by the organizer with the name of the given step
-	%->
-	md = loadmodel('./Models/ISMIP.SetFlow');
-	% dirichlet boundary condition are known as SPCs
-	% ice frozen to the base, no velocity	#md.stressbalance
-	% SPCs are initialized at NaN one value per vertex
-	%->
-	md.stressbalance.spcvx=NaN*ones(md.mesh.numberofvertices,1);
-	%->
-	md.stressbalance.spcvy=NaN*ones(md.mesh.numberofvertices,1);
-	%->
-	md.stressbalance.spcvz=NaN*ones(md.mesh.numberofvertices,1);
-	% extract the nodenumbers at the base #md.mesh.vertexonbase
-	%->
-	basalnodes=find(md.mesh.vertexonbase);
-	% set the sliding to zero on the bed
-	%->
-	md.stressbalance.spcvx(basalnodes)=0.0;
-	%->
-	md.stressbalance.spcvy(basalnodes)=0.0;
-	% periodic boundaries have to be fixed on the sides
-	% create tabs with the side of the domain
-	% for x
-	% create maxX #help find
-	%->
-	maxX=find(md.mesh.x==max(md.mesh.x));
-	% create minX
-	%->
-	minX=find(md.mesh.x==min(md.mesh.x));
-	% for y, max X and minX should be excluded
-	% create maxY
-	%->
-	maxY=find(md.mesh.y==max(md.mesh.y) & md.mesh.x~=max(md.mesh.x) & md.mesh.x~=min(md.mesh.x));
-	% create minY
-	%->
-	minY=find(md.mesh.y==min(md.mesh.y) & md.mesh.x~=max(md.mesh.x) & md.mesh.x~=min(md.mesh.x));
-	% set the node that should be paired together
-	% #md.stressbalance.vertex_pairing
-	%->
-	md.stressbalance.vertex_pairing=[minX,maxX;minY,maxY];
-	if (ParamFile=='CheatyIsmipF.par')
-		% if we are dealing with IsmipF the solution is in
-		% masstransport
-		md.masstransport.vertex_pairing=md.stressbalance.vertex_pairing;
-  end
-	% save the given model
-	%->
-	save ./Models/ISMIP.BoundaryCondition md;
-end
-
-%Solving #7
-if any(steps==7)
-	% load the preceding step #help loadmodel
-	% path is given by the organizer with the name of the given step
-	%->
-	md = loadmodel('./Models/ISMIP.BoundaryCondition');
-	% Set cluster #md.cluster
-	% generic parameters #help generic
-	% set only the name and number of process
-	%->
-	md.cluster=generic('name',oshostname(),'np',2);
-	% Set which control message you want to see #help verbose
-	%->
-	md.verbose=verbose('convergence',true);
-	% Solve #help solve
-	% we are solving a StressBalanc
-	%->
-	md=solve(md,'Stressbalance');
-	% save the given model
-	%->
-	save ./Models/ISMIP.StressBalance md;
-	% plot the surface velocities #plotdoc
-	%->
-	plotmodel(md,'data',md.results.StressbalanceSolution.Vel)
-end
-
-%Solving #8
-if any(steps==8)
-	% load the preceding step #help loadmodel
-	% path is given by the organizer with the name of the given step
-	%->
-	md = loadmodel('./Models/ISMIP.BoundaryCondition');
-	% Set cluster #md.cluster
-	% generic parameters #help generic
-	% set only the name and number of process
-	%->
-	md.cluster=generic('name',oshostname(),'np',2);
-	% Set which control message you want to see #help verbose
-	%->
-	md.verbose=verbose('convergence',true);
-	% set the transient model to ignore the thermal model
-	% #md.transient 
-	%->
-	md.transient.isthermal=0;
-	% define the timestepping scheme
-	% everything here should be provided in years #md.timestepping
-	% give the length of the time_step (4 years)
-	%->
-	md.timestepping.time_step=4;
-	% give final_time (20*4 years time_steps)
-	%->
-	md.timestepping.final_time=4*20;
-	% Solve #help solve
-	% we are solving a TransientSolution
-	%->
-	md=solve(md,'Transient');
-	% save the given model
-	%->
-	save ./Models/ISMIP.Transient md;
-	% plot the surface velocities #plotdoc
-	%->
-	plotmodel(md,'data',md.results.TransientSolution(20).Vel)
-end
Index: /issm/trunk/examples/ISMIP/IsmipA.py
===================================================================
--- /issm/trunk/examples/ISMIP/IsmipA.py	(revision 26744)
+++ /issm/trunk/examples/ISMIP/IsmipA.py	(revision 26744)
@@ -0,0 +1,55 @@
+import numpy as np
+from plotmodel import plotmodel
+from SetIceSheetBC import SetIceSheetBC
+#Parameterization for ISMIP A experiment
+
+#Set the Simulation generic name #md.miscellaneous
+#->
+
+#Geometry
+print('   Constructing Geometry')
+
+#Define the geometry of the simulation #md.geometry
+#surface is [-x*tan(0.5*pi/180)] #md.mesh
+#->
+
+#base is [surface-1000+500*sin(x*2*pi/L).*sin(y*2*pi/L)]
+#L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)
+#->
+
+#->
+
+#thickness is the difference between surface and base #md.geometry
+#->
+
+#plot the geometry to check it out
+#->
+
+
+print('   Defining friction parameters')
+
+#These parameters will not be used but need to be fixed #md.friction
+#one friciton coefficient per node (md.mesh.numberofvertices,1)
+#->
+
+#one friciton exponent (p,q) per element
+#->
+
+#->
+
+
+print('   Construct ice rheological properties')
+
+#The rheology parameters sit in the material section #md.materials
+#B has one value per vertex
+#->
+
+#n has one value per element
+#->
+
+
+print('   Set boundary conditions')
+
+#Set the default boundary conditions for an ice-sheet
+# help SetIceSheetBC
+#->
Index: /issm/trunk/examples/ISMIP/IsmipF.par
===================================================================
--- /issm/trunk/examples/ISMIP/IsmipF.par	(revision 26743)
+++ /issm/trunk/examples/ISMIP/IsmipF.par	(revision 26744)
@@ -11,5 +11,5 @@
 %->
 
-%base is [surface-1000+100*exp(-((x-L/2).^2+(y-L/2).^2)/(0.1*L^2))]
+%base is [surface-1000+100*exp(-((x-L/2).^2+(y-L/2).^2)/(10000.^2))]
 %L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)
 %->
@@ -28,8 +28,8 @@
 %These parameters will not be used but need to be fixed #md.friction
 %one friciton coefficient per node (md.mesh.numberofvertices,1)
-%conversion form year to seconds with #md.constants.yts
+%conversion from year to seconds with #md.constants.yts
 %->
 
-%one friciton exponent (p,q) per element
+%one friction exponent (p,q) per element
 %->
 
Index: /issm/trunk/examples/ISMIP/IsmipF.py
===================================================================
--- /issm/trunk/examples/ISMIP/IsmipF.py	(revision 26744)
+++ /issm/trunk/examples/ISMIP/IsmipF.py	(revision 26744)
@@ -0,0 +1,67 @@
+import numpy as np
+from plotmodel import plotmodel
+from SetIceSheetBC import SetIceSheetBC
+#Parameterization for ISMIP F experiment
+
+#Set the Simulation generic name #md.miscellaneous
+#->
+
+#Geometry
+print('   Constructing Geometry')
+
+#Define the geometry of the simulation #md.geometry
+#surface is [-x*tan(3.0*pi/180)] #md.mesh
+#->
+
+#base is [surface-1000+100*exp(-((x-L/2).^2+(y-L/2).^2)/(10000.^2))]
+#L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)
+#->
+
+#->
+
+#thickness is the difference between surface and base #md.geometry
+#->
+
+#plot the geometry to check it out
+#->
+
+
+print('   Defining friction parameters')
+
+#These parameters will not be used but need to be fixed #md.friction
+#one friciton coefficient per node (md.mesh.numberofvertices,1)
+#conversion from year to seconds with #md.constants.yts
+#->
+
+#one friction exponent (p,q) per element
+#->
+
+#->
+
+
+print('   Construct ice rheological properties')
+
+#The rheology parameters sit in the material section #md.materials
+#B has one value per vertex
+#->
+
+#n has one value per element
+#->
+
+
+print('   Set boundary conditions')
+
+#Set the default boundary conditions for an ice-sheet
+# #help SetIceSheetBC
+#->
+
+print('   Initializing velocity and pressure')
+
+#initialize the velocity and pressurefields of #md.initialization
+#->
+
+#->
+
+#->
+
+#->
Index: /issm/trunk/examples/ISMIP/runme.m
===================================================================
--- /issm/trunk/examples/ISMIP/runme.m	(revision 26743)
+++ /issm/trunk/examples/ISMIP/runme.m	(revision 26744)
@@ -1,3 +1,3 @@
-%wich steps to perform steps are from 1 to 8 
+%which steps to perform; steps are from 1 to 8
 %step 7 is specific to ISMIPA
 %step 8 is specific to ISMIPF
@@ -6,5 +6,5 @@
 
 % parameter file to be used, choose between IsmipA.par or IsmipF.par
-ParamFile='IsmipA.par'
+ParamFile='IsmipA.par';
 
 %Run Steps
@@ -26,5 +26,5 @@
 	%->
 
-end
+end 
 
 %Masks #2
@@ -45,5 +45,5 @@
 	%->
 
-end
+end 
 
 %Parameterization #3
@@ -62,8 +62,8 @@
 	%->
 
-end
+end 
 
 %Extrusion #4
-if any(steps==4)
+if any(steps==4) 
 	
 	% load the preceding step #help loadmodel
@@ -81,8 +81,8 @@
 	%->
 
-end
+end 
 
 %Set the flow computing method #5
-if any(steps==5)
+if any(steps==5) 
 
 	% load the preceding step #help loadmodel
@@ -97,8 +97,8 @@
 	%->
 
-end
+end 
 
 %Set Boundary Conditions #6
-if any(steps==6)
+if any(steps==6) 
 
 	% load the preceding step #help loadmodel
@@ -118,5 +118,5 @@
 	%->
 
-  % set the sliding to zero on the bed (Vx and Vy)
+	% set the sliding to zero on the bed (Vx and Vy)
 	%->
 
@@ -124,20 +124,23 @@
 
 	% periodic boundaries have to be fixed on the sides
-	% create tabs with the side of the domain
+	% Find the indices of the sides of the domain, for x and then for y
 	% for x
-	% create maxX #help find
-	%->
-
-	% create minX
-	%->
-
-	% for y, max X and minX should be excluded
-	% create maxY
-	%->
-
-	% create minY
-	%->
-
-	% set the node that should be paired together
+	% create maxX, list of indices where x is equal to max of x (use >> help find)
+	%->
+
+	% create minX, list of indices where x is equal to min of x
+	%->
+
+	% for y
+	% create maxY, list of indices where y is equal to max of y
+	% but not where x is equal to max or min of x
+	% (i.e, indices in maxX and minX should be excluded from maxY and minY)	
+	%->
+
+	% create minY, list of indices where y is equal to max of y
+	% but not where x is equal to max or min of x
+	%->
+
+	% set the node that should be paired together, minX with maxX and minY with maxY
 	% #md.stressbalance.vertex_pairing
 	%->
@@ -146,12 +149,12 @@
 		% if we are dealing with IsmipF the solution is in masstransport
 		md.masstransport.vertex_pairing=md.stressbalance.vertex_pairing;
-  end
-	% save the given model
-	%->
-
-end
+	end
+	% save the given model
+	%->
+
+end 
 
 %Solving #7
-if any(steps==7)
+if any(steps==7) 
 	% load the preceding step #help loadmodel
 	% path is given by the organizer with the name of the given step
@@ -175,8 +178,8 @@
 	% plot the surface velocities #plotdoc
 	%->
-end
+end 
 
 %Solving #8
-if any(steps==8)
+if any(steps==8) 
 	% load the preceding step #help loadmodel
 	% path is given by the organizer with the name of the given step
@@ -212,4 +215,3 @@
 	% plot the surface velocities #plotdoc
 	%->
-
-end
+end 
Index: /issm/trunk/examples/ISMIP/runme.py
===================================================================
--- /issm/trunk/examples/ISMIP/runme.py	(revision 26744)
+++ /issm/trunk/examples/ISMIP/runme.py	(revision 26744)
@@ -0,0 +1,217 @@
+import numpy as np
+from model import *
+from squaremesh import squaremesh
+from plotmodel import plotmodel
+from export_netCDF import export_netCDF
+from loadmodel import loadmodel
+from setmask import setmask
+from parameterize import parameterize
+from setflowequation import setflowequation
+from socket import gethostname
+from solve import solve
+#which steps to perform; steps are from 1 to 8
+#step 7 is specific to ISMIPA
+#step 8 is specific to ISMIPF
+
+steps = [1]
+
+# parameter file to be used, choose between IsmipA.py or IsmipF.py
+ParamFile = 'IsmipA.py'
+
+#Run Steps
+
+#Mesh Generation #1
+if 1 in steps:
+    print("Now generating the mesh")
+    #initialize md as a new model #help(model)
+    #->
+
+    # generate a squaremesh #help(squaremesh)
+    # Side is 80 km long with 20 points
+    #->
+
+    # plot the given mesh #plotdoc
+    #->
+
+    # save the given model
+    #->
+
+#Masks #2
+if 2 in steps:
+    print("Setting the masks")
+    # load the preceding step #help(loadmodel)
+    # path is given by the organizer with the name of the given step
+    #->
+
+    # set the mask #help(setmask)
+    # all MISMIP nodes are grounded
+    #->
+
+    # plot the given mask #md.mask to locate the field
+    #->
+
+    # save the given model
+    #->
+
+#Parameterization #3
+if 3 in steps:
+    print("Parameterizing")
+    # load the preceding step #help(loadmodel)
+    # path is given by the organizer with the name of the given step
+    #->
+
+    # parametrize the model # help(parameterize)
+    # you will need to fil-up the parameter file (given by the
+    # ParamFile variable)
+    #->
+
+    # save the given model
+    #->
+
+
+#Extrusion #4
+if 4 in steps:
+    print("Extruding")
+    # load the preceding step #help(loadmodel)
+    # path is given by the organizer with the name of the given step
+    #->
+
+    # vertically extrude the preceding mesh #help(extrude)
+    # only 5 layers exponent 1
+    #->
+
+    # plot the 3D geometry #plotdoc
+    #->
+
+    # save the given model
+    #->
+
+#Set the flow computing method #5
+if 5 in steps:
+    print("setting flow approximation")
+    # load the preceding step #help(loadmodel)
+    # path is given by the organizer with the name of the given step
+    #->
+
+    # set the approximation for the flow computation #help(setflowequation)
+    # We will be using the Higher Order Model (HO)
+    #->
+
+    # save the given model
+    #->
+
+#Set Boundary Conditions #6
+if 6 in steps:
+    print("setting boundary conditions")
+    # load the preceding step #help(loadmodel)
+    # path is given by the organizer with the name of the given step
+    #->
+
+    # dirichlet boundary condition are known as SPCs
+    # ice frozen to the base, no velocity   #md.stressbalance
+    # SPCs are initialized at NaN one value per vertex
+    #->
+
+    #->
+
+    #->
+
+    # extract the nodenumbers at the base #md.mesh.vertexonbase
+    #->
+
+    # set the sliding to zero on the bed (Vx and Vy)
+    #->
+
+    #->
+
+    # periodic boundaries have to be fixed on the sides
+    # Find the indices of the sides of the domain, for x and then for y
+    # for x
+    # create maxX, list of indices where x is equal to max of x
+    #->
+
+    # create minX, list of indices where x is equal to min of x
+    #->
+
+    # for y
+    # create maxY, list of indices where y is equal to max of y
+    # but not where x is equal to max or min of x
+    # (i.e, indices in maxX and minX should be excluded from maxY and minY)
+    #->
+
+    # create minY, list of indices where y is equal to max of y
+    # but not where x is equal to max or min of x
+    #->
+
+    # set the node that should be paired together, minX with maxX and minY with maxY
+    # #md.stressbalance.vertex_pairing
+    #->
+
+    if ParamFile=='IsmipF.py':
+        # if we are dealing with IsmipF the solution is in masstransport
+        md.masstransport.vertex_pairing = md.stressbalance.vertex_pairing
+
+    # save the given model
+    #->
+
+#Solving #7
+if 7 in steps:
+    print("running the solver for the A case")
+    # load the preceding step #help(loadmodel)
+    # path is given by the organizer with the name of the given step
+    #->
+
+    # Set cluster #md.cluster
+    # generic parameters #help(generic)
+    # set only the name and number of process
+    #->
+
+    # Set which control message you want to see #help(verbose)
+    #->
+
+    # Solve #help(solve)
+    # we are solving a StressBalanc
+    #->
+
+    # save the given model
+    #->
+
+    # plot the surface velocities #plotdoc
+    #->
+
+#Solving #8
+if 8 in steps:
+    print("running the solver for the F case")
+    # load the preceding step #help(loadmodel)
+    # path is given by the organizer with the name of the given step
+    #->
+
+    # Set cluster #md.cluster
+    # generic parameters #help(generic)
+    # set only the name and number of process
+    #->
+
+    # Set which control message you want to see #help(verbose)
+    #->
+
+    # set the transient model to ignore the thermal model
+    # #md.transient
+    #->
+
+    # define the timestepping scheme
+    # everything here should be provided in years #md.timestepping
+    # give the length of the time_step (4 years)
+    #->
+
+    # give final_time (20*4 years time_steps)
+    #->
+
+    # Solve #help(solve)
+    # we are solving a TransientSolution
+    #->
+
+    # save the given model
+    #->
+
+    # plot the surface velocities #plotdoc
+    #->
Index: /issm/trunk/examples/IceBridge/Greenland.par
===================================================================
--- /issm/trunk/examples/IceBridge/Greenland.par	(revision 26743)
+++ /issm/trunk/examples/IceBridge/Greenland.par	(revision 26744)
@@ -30,5 +30,5 @@
 %Reading IceBridge data for Jakobshavn
 disp('      reading IceBridge Jakobshavn bedrock');
-fid  = fopen('../Data/Jakobshavn_2008_2011_Composite_XYZGrid.txt');
+fid  = fopen('../Data/Jakobshavn_2008_2011_Composite/grids/Jakobshavn_2008_2011_Composite_XYZGrid.txt');
 titles = fgets(fid); 
 data = fscanf(fid,'%g,%g,%g,%g,%g',[5 266400])';
Index: /issm/trunk/examples/IceBridge/runme.m
===================================================================
--- /issm/trunk/examples/IceBridge/runme.m	(revision 26743)
+++ /issm/trunk/examples/IceBridge/runme.m	(revision 26744)
@@ -1,4 +1,3 @@
 clear all;
-close all;
 steps=[1];
 
@@ -6,5 +5,5 @@
 ncdata='../Data/Greenland_5km_dev1.2.nc';
 
-if any(steps==1)
+if any(steps==1) 
 	disp('   Step 1: Mesh creation');
 
@@ -24,5 +23,5 @@
 	md=bamg(md,'hmax',400000,'hmin',5000,'gradation',1.7,'field',vel,'err',8);
 	return;
-	
+
 	%Refine mesh in the region of Jakobshavn (resolution = 3000 m)
 	hmaxVertices=NaN*ones(md.mesh.numberofvertices,1);
@@ -37,18 +36,18 @@
 
 	save ./Models/Greenland.Mesh_generation md;
-end
+end 
 
-if any(steps==2)
+if any(steps==2) 
 	disp('   Step 2: Parameterization');
 	md = loadmodel('./Models/Greenland.Mesh_generation');
 
 	md = setmask(md,'','');
-	md = parameterize(md,'Greenland.par');
+	md = parameterize(md,'./Greenland.par');
 	md = setflowequation(md,'SSA','all');
 
 	save ./Models/Greenland.Parameterization2 md; 
-end
+end 
 
-if any(steps==3)
+if any(steps==3) 
 	disp('   Step 3: Control method friction');
 	md = loadmodel('./Models/Greenland.Parameterization2');
@@ -93,7 +92,7 @@
 
 	save ./Models/Greenland.Control_drag md; 
-end
+end 
 
-if any(steps==4)
+if any(steps==4) 
 	disp('   Step 4: Transient run');
 	md = loadmodel('./Models/Greenland.Control_drag');
@@ -122,7 +121,7 @@
 
 	save ./Models/Greenland.Transient md; 
-end
+end 
 
-if any(steps==5)
+if any(steps==5) 
 	disp('   Step 5: Plotting'); 
 	md = loadmodel('./Models/Greenland.Transient');
@@ -155,3 +154,3 @@
 	subplot(3,1,3); plot(time_plot,volume); title('Ice Volume');
 	xlabel('years')
-end
+end 
Index: /issm/trunk/examples/Inversion/Square.py
===================================================================
--- /issm/trunk/examples/Inversion/Square.py	(revision 26744)
+++ /issm/trunk/examples/Inversion/Square.py	(revision 26744)
@@ -0,0 +1,24 @@
+import numpy as np
+from SetIceShelfBC import SetIceShelfBC
+#Start defining model parameters here
+
+print('      creating thickness')
+hmin = 300
+hmax = 1000
+ymin = np.nanmin(md.mesh.y)
+ymax = np.nanmax(md.mesh.y)
+md.geometry.thickness = hmax + (hmin - hmax) * (md.mesh.y - ymin) / (ymax - ymin)
+md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+
+print('      creating drag')
+md.friction.coefficient = np.where(md.mask.ocean_levelset < 0., 0., 200)
+md.friction.p = np.ones((md.mesh.numberofelements))
+md.friction.q = np.ones((md.mesh.numberofelements))
+
+print('      creating flow law paramter')
+md.materials.rheology_B = np.where(md.mesh.x < md.mesh.y, 1.4 * 1e8, 1.8 * 1e8)
+md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements))
+
+print('      creating boundary conditions')
+md = SetIceShelfBC(md, 'Front.exp')
Index: /issm/trunk/examples/Inversion/runme.m
===================================================================
--- /issm/trunk/examples/Inversion/runme.m	(revision 26743)
+++ /issm/trunk/examples/Inversion/runme.m	(revision 26744)
@@ -1,4 +1,5 @@
-step=1;
-if any(step==1)
+steps=[1];
+
+if any(steps==1) 
 	%Generate observations
 	md = model;
@@ -9,9 +10,10 @@
 	md.cluster = generic('np',2);
 	md = solve(md,'Stressbalance');
-	plotmodel(md,'axis#all','tight','data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'title','"True" B',...
+	plotmodel(md,'axis#all','tight','data',md.materials.rheology_B,'caxis',[1.3 1.9]*10^8,'title','"True" B',...
 		'data',md.results.StressbalanceSolution.Vel,'title','"observed velocities"')
 	save model1 md
-end
-if any(step==2)
+end 
+
+if any(steps==2) 
 	%Modify rheology, now constant
 	loadmodel('model1.mat');
@@ -20,14 +22,15 @@
 	%results of previous run are taken as observations
 	md.inversion=m1qn3inversion();
-	md.inversion.vx_obs  = md.results.StressbalanceSolution.Vx;
-	md.inversion.vy_obs  = md.results.StressbalanceSolution.Vy;
-	md.inversion.vel_obs = md.results.StressbalanceSolution.Vel;
+	md.inversion.vx_obs		= md.results.StressbalanceSolution.Vx;
+	md.inversion.vy_obs		= md.results.StressbalanceSolution.Vy;
+	md.inversion.vel_obs	= md.results.StressbalanceSolution.Vel;
 
 	md = solve(md,'Stressbalance');
-	plotmodel(md,'axis#all','tight','data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'title','B first guess',...
+	plotmodel(md,'axis#all','tight','data',md.materials.rheology_B,'caxis',[1.3 1.9]*10^8,'title','B first guess',...
 		'data',md.results.StressbalanceSolution.Vel,'title','modeled velocities')
 	save model2 md
-end
-if any(step==3)
+end 
+
+if any(steps==3) 
 	%invert for ice rigidity
 	loadmodel('model2.mat');
@@ -40,14 +43,15 @@
 	md.inversion.cost_functions = 101;
 	md.inversion.cost_functions_coefficients = ones(md.mesh.numberofvertices,1);
-	md.inversion.min_parameters    = cuffey(273)*ones(md.mesh.numberofvertices,1);
-	md.inversion.max_parameters    = cuffey(200)*ones(md.mesh.numberofvertices,1);
+	md.inversion.min_parameters = cuffey(273)*ones(md.mesh.numberofvertices,1);
+	md.inversion.max_parameters = cuffey(200)*ones(md.mesh.numberofvertices,1);
 
 	%Go solve!
 	md.verbose=verbose(0);
 	md=solve(md,'Stressbalance');
-	plotmodel(md,'axis#all','tight','data',md.results.StressbalanceSolution.MaterialsRheologyBbar,'caxis',[ 1.3 1.9]*10^8,'title','inferred B',...
+	plotmodel(md,'axis#all','tight','data',md.results.StressbalanceSolution.MaterialsRheologyBbar,'caxis',[1.3 1.9]*10^8,'title','inferred B',...
 		'data',md.results.StressbalanceSolution.Vel,'title','modeled velocities')
-end
-if any(step==4)
+end 
+
+if any(steps==4) 
 	%invert for ice rigidity
 	loadmodel('model2.mat');
@@ -59,8 +63,8 @@
 	md.inversion.maxsteps = maxsteps;
 	md.inversion.cost_functions = [101 502];
-	md.inversion.cost_functions_coefficients      = ones(md.mesh.numberofvertices,1);
-	md.inversion.cost_functions_coefficients(:,2) = 10^-16*ones(md.mesh.numberofvertices,1);
-	md.inversion.min_parameters    = cuffey(273)*ones(md.mesh.numberofvertices,1);
-	md.inversion.max_parameters    = cuffey(200)*ones(md.mesh.numberofvertices,1);
+	md.inversion.cost_functions_coefficients		= ones(md.mesh.numberofvertices,1);
+	md.inversion.cost_functions_coefficients(:,2)	= 10^-16*ones(md.mesh.numberofvertices,1);
+	md.inversion.min_parameters = cuffey(273)*ones(md.mesh.numberofvertices,1);
+	md.inversion.max_parameters = cuffey(200)*ones(md.mesh.numberofvertices,1);
 
 	%Go solve!
@@ -69,3 +73,3 @@
 	plotmodel(md,'axis#all','tight','data',md.results.StressbalanceSolution.MaterialsRheologyBbar,'caxis',[ 1.3 1.9]*10^8,'title','inferred B',...
 		'data',md.results.StressbalanceSolution.Vel,'title','modeled velocities')
-end
+end 
Index: /issm/trunk/examples/Inversion/runme.py
===================================================================
--- /issm/trunk/examples/Inversion/runme.py	(revision 26744)
+++ /issm/trunk/examples/Inversion/runme.py	(revision 26744)
@@ -0,0 +1,87 @@
+import numpy as np
+from model import *
+from setmask import setmask
+from parameterize import parameterize
+from setflowequation import setflowequation
+from generic import generic
+from solve import solve
+from plotmodel import plotmodel
+from export_netCDF import export_netCDF
+from m1qn3inversion import m1qn3inversion
+from verbose import verbose
+from loadmodel import loadmodel
+from cuffey import cuffey
+steps = [4]
+Clims = [1.3 * 1e8, 1.9 * 1e8]
+
+if 1 in steps:
+    #Generate observations
+    md = model()
+    md = triangle(md, 'DomainOutline.exp', 100000)
+    md = setmask(md, 'all', '')
+    md = parameterize(md, 'Square.py')
+    md = setflowequation(md, 'SSA', 'all')
+    md.cluster = generic('np', 2)
+    md = solve(md, 'Stressbalance')
+    plotmodel(md, 'axis#all', 'tight', 'data', md.materials.rheology_B, 'caxis', Clims, 'title', '"True" B',
+              'data', md.results.StressbalanceSolution.Vel, 'title', '"observed velocities"')
+    export_netCDF(md, 'model1.nc')
+
+if 2 in steps:
+    #Modify rheology, now constant
+    md = loadmodel('model1.nc')
+    md.materials.rheology_B[:] = 1.8 * 1e8
+
+    #results of previous run are taken as observations
+    md.inversion = m1qn3inversion()
+    md.inversion.vx_obs = md.results.StressbalanceSolution.Vx
+    md.inversion.vy_obs = md.results.StressbalanceSolution.Vy
+    md.inversion.vel_obs = md.results.StressbalanceSolution.Vel
+
+    md = solve(md, 'Stressbalance')
+    plotmodel(md, 'axis#all', 'tight', 'data', md.materials.rheology_B, 'caxis', Clims, 'title', 'B first guess',
+              'data', md.results.StressbalanceSolution.Vel, 'title', 'modeled velocities')
+    export_netCDF(md, 'model2.nc')
+
+
+if 3 in steps:
+    #invert for ice rigidity
+    md = loadmodel('model2.nc')
+
+    #Set up inversion parameters
+    maxsteps = 20
+    md.inversion.iscontrol = 1
+    md.inversion.control_parameters = ['MaterialsRheologyBbar']
+    md.inversion.maxsteps = maxsteps
+    md.inversion.cost_functions = [101]
+    md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 1))
+    md.inversion.min_parameters = cuffey(273) * np.ones((md.mesh.numberofvertices, 1))
+    md.inversion.max_parameters = cuffey(200) * np.ones((md.mesh.numberofvertices, 1))
+
+    #Go solve!
+    md.verbose = verbose(0)
+    md = solve(md, 'Stressbalance')
+    plotmodel(md, 'axis#all', 'tight', 'data', md.results.StressbalanceSolution.MaterialsRheologyBbar, 'caxis', Clims, 'title', 'inferred B',
+              'data', md.results.StressbalanceSolution.Vel, 'title', 'modeled velocities')
+
+
+if 4 in steps:
+    #invert for ice rigidity
+    md = loadmodel('model2.nc')
+
+    #Set up inversion parameters
+    maxsteps = 20
+    md.inversion.iscontrol = 1
+    md.inversion.control_parameters = ['MaterialsRheologyBbar']
+    md.inversion.maxsteps = maxsteps
+    md.inversion.cost_functions = [101, 502]
+    md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
+    md.inversion.cost_functions_coefficients[:, 1] = 1e-16
+    md.inversion.min_parameters = cuffey(273) * np.ones((md.mesh.numberofvertices, 1))
+    md.inversion.max_parameters = cuffey(200) * np.ones((md.mesh.numberofvertices, 1))
+
+    #Go solve!
+    md.verbose = verbose(0)
+    md = solve(md, 'Stressbalance')
+    plotmodel(md, 'axis#all', 'tight', 'data', md.results.StressbalanceSolution.MaterialsRheologyBbar, 'caxis', Clims, 'title', 'inferred B',
+              'data', md.results.StressbalanceSolution.Vel, 'title', 'modeled velocities')
Index: /issm/trunk/examples/Jakobshavn/runme.m
===================================================================
--- /issm/trunk/examples/Jakobshavn/runme.m	(revision 26743)
+++ /issm/trunk/examples/Jakobshavn/runme.m	(revision 26744)
@@ -1,38 +1,40 @@
 steps=[1];
 
-if any(steps==1)
-	disp('	Step 1: Mesh creation'); 
+if any(steps==1) 
+	disp('   Step 1: Mesh creation');
 	md=triangle(model,'Domain.exp',2000);
 
 	%Get observed velocity field on mesh nodes
 	ncdata='../Data/Greenland_5km_dev1.2.nc';
-	if ~exist(ncdata,'file'), 
+	if ~exist(ncdata,'file'),
 		error('File Greenland_5km_dev1.2.nc not downloaded in Data Directory');
 	end
-	x1   = ncread(ncdata,'x1');
-	y1   = ncread(ncdata,'y1');
-	velx = ncread(ncdata,'surfvelx');
-	vely = ncread(ncdata,'surfvely');
-	vx   = InterpFromGridToMesh(x1,y1,velx',md.mesh.x,md.mesh.y,0);
-	vy   = InterpFromGridToMesh(x1,y1,vely',md.mesh.x,md.mesh.y,0);
-	vel  = sqrt(vx.^2+vy.^2);
+	x1		= ncread(ncdata,'x1');
+	y1		= ncread(ncdata,'y1');
+	velx	= ncread(ncdata,'surfvelx');
+	vely	= ncread(ncdata,'surfvely');
+	vx		= InterpFromGridToMesh(x1,y1,velx',md.mesh.x,md.mesh.y,0);
+	vy		= InterpFromGridToMesh(x1,y1,vely',md.mesh.x,md.mesh.y,0);
+	vel		= sqrt(vx.^2+vy.^2);
 
 	%refine mesh using surface velocities as metric
 	md=bamg(md,'hmin',1200,'hmax',15000,'field',vel,'err',5);
 	[md.mesh.lat,md.mesh.long]  = xy2ll(md.mesh.x,md.mesh.y,+1,39,71);
-	
+
 	save JksMesh md
 end 
-if any(steps==2)
-	disp('	Step 2: Parameterization');
+
+if any(steps==2) 
+	disp('   Step 2: Parameterization');
 	md=loadmodel('JksMesh');
-	
+
 	md=setmask(md,'','');
-	md=parameterize(md,'Jks.par'); 
+	md=parameterize(md,'Jks.par');
 
 	save JksPar md
 end 
-if any(steps==3)
-	disp('	Step 3: Control method friction');
+
+if any(steps==3) 
+	disp('   Step 3: Control method friction');
 	md=loadmodel('JksPar');
 
@@ -66,9 +68,10 @@
 	md.cluster=generic('name',oshostname,'np',4);
 	md=solve(md,'Stressbalance');
-	
+
 	save JksControl md
 end 
-if any(steps==4)
-	disp('	Plotting')
+
+if any(steps==4) 
+	disp('   Plotting')
 	md=loadmodel('JksControl');
 
@@ -82,3 +85,3 @@
 		'title','Friction Coefficient',...
 		'colorbartitle#3','(m)');
-end
+end 
Index: /issm/trunk/examples/LcurveAnalysis/runme.m
===================================================================
--- /issm/trunk/examples/LcurveAnalysis/runme.m	(revision 26743)
+++ /issm/trunk/examples/LcurveAnalysis/runme.m	(revision 26744)
@@ -1,4 +1,5 @@
-step=[1];
-if any(step==1)
+steps=[1];
+
+if any(steps==1) 
 	% Generate observations
 	md = model;
@@ -12,6 +13,7 @@
 		'data',md.results.StressbalanceSolution.Vel,'title','"observed velocities"')
 	save model1 md
-end
-if any(step==2)
+end 
+
+if any(steps==2) 
 	% Modify rheology, now constant
 	loadmodel('model1.mat');
@@ -28,6 +30,7 @@
 		'data',md.results.StressbalanceSolution.Vel,'title','modeled velocities')
 	save model2 md
-end
-if any(step==3)
+end 
+
+if any(steps==3) 
 	% Perform L-curve analysis for ice rigidity inversion
 	loadmodel('model2.mat');
@@ -42,6 +45,6 @@
 	md.inversion.min_parameters = cuffey(273)*ones(md.mesh.numberofvertices,1);
 	md.inversion.max_parameters = cuffey(200)*ones(md.mesh.numberofvertices,1);
-   md.verbose = verbose('solution',false,'control',true);
-	
+	md.verbose = verbose('solution',false,'control',true);
+
 	% Starting L-curve analysis:
 	%
@@ -56,11 +59,11 @@
 	% respective value of Jo and R (R versus Jo).
 	%
-	min_alpha   = 1.e-20;
-	max_alpha   = 1.e-11;
-	nstep_alpha = 30;
-	log_step    = (log10(max_alpha)-log10(min_alpha))/nstep_alpha;
-	log_alphas  = [log10(min_alpha):log_step:log10(max_alpha)];
-	alphas      = 10.^log_alphas;
-	J           = zeros(length(alphas),length(md.inversion.cost_functions)+1);
+	min_alpha	= 1.e-20;
+	max_alpha	= 1.e-11;
+	nstep_alpha	= 30;
+	log_step	= (log10(max_alpha)-log10(min_alpha))/nstep_alpha;
+	log_alphas	= [log10(min_alpha):log_step:log10(max_alpha)];
+	alphas		= 10.^log_alphas;
+	J			= zeros(length(alphas),length(md.inversion.cost_functions)+1);
 	% Loop over the alphas
 	for i=1:length(alphas),
@@ -78,6 +81,6 @@
 		Jo = Jo + J(:,i); % sum of the cost functions (no regularization term). In this example, only 101
 	end
-	R  = J(:,end-1)./alphas(:); % only the regularization term
-	
+	R = J(:,end-1)./alphas(:); % only the regularization term
+
 	% Tip:
 	% A rescale in the axes may be useful to visualize the L-curve.
@@ -86,5 +89,5 @@
 	%
 	% Apply a linear transformation on the original axis (Jo, R): 
-   %
+	%
 	% |   1       alpha | | Jo  |   | Jo + alpha*R |   |    J    |
 	% |                 | |     | = |              | = |         |
@@ -100,9 +103,10 @@
 	hoffset=0.1*Jo;
 	text(Jo+hoffset,R+voffset,[repmat('\alpha = ',length(alphas),1) num2str(alphas(:),'%2.0e')],...
-            'FontSize',10,'HorizontalAlignment','left','VerticalAlignment','Middle')
+		'FontSize',10,'HorizontalAlignment','left','VerticalAlignment','Middle')
 	xlabel('$\mathrm{log}(\mathcal{J}_0$)','Interpreter','latex')
 	ylabel('$\mathrm{log}(\mathcal{R})$','Interpreter','latex')
-end
-if any(step==4)
+end 
+
+if any(steps==4) 
 	%invert for ice rigidity
 	loadmodel('model2.mat');
@@ -114,8 +118,8 @@
 	md.inversion.maxsteps = maxsteps;
 	md.inversion.cost_functions = [101 502];
-	md.inversion.cost_functions_coefficients      = ones(md.mesh.numberofvertices,1);
-	md.inversion.cost_functions_coefficients(:,2) = 4.e-17*ones(md.mesh.numberofvertices,1); % here you can use the best value found for alpha
-	md.inversion.min_parameters    = cuffey(273)*ones(md.mesh.numberofvertices,1);
-	md.inversion.max_parameters    = cuffey(200)*ones(md.mesh.numberofvertices,1);
+	md.inversion.cost_functions_coefficients		= ones(md.mesh.numberofvertices,1);
+	md.inversion.cost_functions_coefficients(:,2)	= 4.e-17*ones(md.mesh.numberofvertices,1); % here you can use the best value found for alpha
+	md.inversion.min_parameters = cuffey(273)*ones(md.mesh.numberofvertices,1);
+	md.inversion.max_parameters = cuffey(200)*ones(md.mesh.numberofvertices,1);
 
 	%Go solve!
@@ -124,3 +128,3 @@
 	plotmodel(md,'axis#all','tight','data',md.results.StressbalanceSolution.MaterialsRheologyBbar,'caxis',[ 1.3 1.9]*10^8,'title','inferred B',...
 		'data',md.results.StressbalanceSolution.Vel,'title','modeled velocities')
-end
+end 
Index: /issm/trunk/examples/Mesh/circles.py
===================================================================
--- /issm/trunk/examples/Mesh/circles.py	(revision 26744)
+++ /issm/trunk/examples/Mesh/circles.py	(revision 26744)
@@ -0,0 +1,11 @@
+import numpy as np
+
+
+def circles(x, y):
+
+    u = 4 * x - 2
+    v = 4 * y - 2
+
+    vel = np.tanh(30 * (u**2 + v**2 - 0.25)) + np.tanh(30 * ((u - 0.75)**2 + (v - 0.75)**2 - 0.25)) + np.tanh(30 * ((u - 0.75)**2 + (v + 0.75)**2 - 0.25)) + np.tanh(30 * ((u + 0.75)**2 + (v - 0.75)**2 - 0.25)) + np.tanh(30 * ((u + 0.75)**2 + (v + 0.75)**2 - 0.25))
+
+    return vel
Index: /issm/trunk/examples/Mesh/shock.py
===================================================================
--- /issm/trunk/examples/Mesh/shock.py	(revision 26744)
+++ /issm/trunk/examples/Mesh/shock.py	(revision 26744)
@@ -0,0 +1,7 @@
+import numpy as np
+
+
+def shock(x, y):
+
+    vel = np.exp(-(np.sqrt((x + 0.1)**2 + (y + 0.1)**2) - 0.75)**2 * 1e6) + ((x + 0.1)**2 + (y + 0.1)**2) / 2
+    return vel
Index: /issm/trunk/examples/Pig/runme.m
===================================================================
--- /issm/trunk/examples/Pig/runme.m	(revision 26743)
+++ /issm/trunk/examples/Pig/runme.m	(revision 26744)
@@ -1,12 +1,12 @@
 steps=[1];
 
-if any(steps==1)   %Mesh Generation #1
+if any(steps==1) %Mesh Generation #1 
 	%Mesh parameters
 	domain =['./DomainOutline.exp'];
-	hinit=10000;   % element size for the initial mesh
-	hmax=40000;    % maximum element size of the final mesh
-	hmin=5000;     % minimum element size of the final mesh
-	gradation=1.7; % maximum size ratio between two neighboring elements
-	err=8;         % maximum error between interpolated and control field
+	hinit=10000;	% element size for the initial mesh
+	hmax=40000;		% maximum element size of the final mesh
+	hmin=5000;		% minimum element size of the final mesh
+	gradation=1.7;	% maximum size ratio between two neighboring elements
+	err=8;			% maximum error between interpolated and control field
 
 	% Generate an initial uniform mesh (resolution = hinit m)
@@ -14,27 +14,27 @@
 
 	% Load Velocities
-	nsidc_vel='../Data/Antarctica_ice_velocity.nc'; 	
+	nsidc_vel='../Data/Antarctica_ice_velocity.nc';
 
 	% Get necessary data to build up the velocity grid
-	xmin    = ncreadatt(nsidc_vel,'/','xmin');
-	ymax    = ncreadatt(nsidc_vel,'/','ymax');
-	spacing = ncreadatt(nsidc_vel,'/','spacing');
-	nx      = double(ncreadatt(nsidc_vel,'/','nx'));
-	ny      = double(ncreadatt(nsidc_vel,'/','ny'));
-	vx      = double(ncread(nsidc_vel,'vx'));
-	vy      = double(ncread(nsidc_vel,'vy'));
+	xmin	= ncreadatt(nsidc_vel,'/','xmin');
+	ymax	= ncreadatt(nsidc_vel,'/','ymax');
+	spacing	= ncreadatt(nsidc_vel,'/','spacing');
+	nx		= double(ncreadatt(nsidc_vel,'/','nx'));
+	ny		= double(ncreadatt(nsidc_vel,'/','ny'));
+	vx		= double(ncread(nsidc_vel,'vx'));
+	vy		= double(ncread(nsidc_vel,'vy'));
 
 	% Read coordinates
-	xmin = strtrim(xmin);  
-	xmin = str2num(xmin(1:end-2)); 
-	ymax = strtrim(ymax);  
-	ymax = str2num(ymax(1:end-2));  
+	xmin = strtrim(xmin);
+	xmin = str2num(xmin(1:end-2));
+	ymax = strtrim(ymax);
+	ymax = str2num(ymax(1:end-2));
 	spacing = strtrim(spacing);
-	spacing = str2num(spacing(1:end-2));  
+	spacing = str2num(spacing(1:end-2));
 
 	% Build the coordinates
 	x=xmin+(0:1:nx)'*spacing;
 	y=(ymax-ny*spacing)+(0:1:ny)'*spacing;
-	
+
 	% Interpolate velocities onto coarse mesh
 	vx_obs=InterpFromGridToMesh(x,y,flipud(vx'),md.mesh.x,md.mesh.y,0);
@@ -45,5 +45,5 @@
 	% Adapt the mesh to minimize error in velocity interpolation
 	md=bamg(md,'hmax',hmax,'hmin',hmin,'gradation',gradation,'field',vel_obs,'err',err);
-	
+
 	%ploting
 	plotmodel(md,'data','mesh')
@@ -51,19 +51,18 @@
 	% Save model
 	save ./Models/PIG_Mesh_generation md;
-end
+end 
 
-if any(steps==2)  %Masks #2
+if any(steps==2) %Masks #2 
+	md = loadmodel('./Models/PIG_Mesh_generation');
 
-	md = loadmodel('./Models/PIG_Mesh_generation');	
-
-	% Load SeaRISe dataset for Antarctica  
+	% Load SeaRISe dataset for Antarctica
 	% http://websrv.cs.umt.edu/isis/index.php/Present_Day_Antarctica
 	searise='../Data/Antarctica_5km_withshelves_v0.75.nc';
-	
+
 	%read thickness mask from SeaRISE
 	x1=double(ncread(searise,'x1'));
 	y1=double(ncread(searise,'y1'));
 	thkmask=double(ncread(searise,'thkmask'));
-	
+
 	%interpolate onto our mesh vertices
 	groundedice=double(InterpFromGridToMesh(x1,y1,thkmask',md.mesh.x,md.mesh.y,0));
@@ -77,11 +76,10 @@
 	%ploting
 	plotmodel(md,'data',md.mask.ocean_levelset,'title','grounded/floating','data',md.mask.ice_levelset,'title','ice/no-ice')
-	
+
 	% Save model
 	save ./Models/PIG_SetMask md;
-end
+end 
 
-if any(steps==3)  %Parameterization #3
-
+if any(steps==3) %Parameterization #3 
 	md = loadmodel('./Models/PIG_SetMask');
 	md = parameterize(md,'./Pig.par');
@@ -89,11 +87,10 @@
 	% Use a MacAyeal flow model
 	md = setflowequation(md,'SSA','all');
-	
+
 	% Save model
 	save ./Models/PIG_Parameterization md;
-end
+end 
 
-if any(steps==4)  %Control Method #4
-
+if any(steps==4) %Control Method #4 
 	md = loadmodel('./Models/PIG_Parameterization');
 
@@ -135,8 +132,7 @@
 	% Save model
 	save ./Models/PIG_Control_drag md;
-end
+end 
 
-if any(steps==5) %Plot #5
-
+if any(steps==5) %Plot #5 
 	md = loadmodel('./Models/PIG_Control_drag');
 
@@ -149,8 +145,7 @@
 		'caxis#1-2',([1.5,4000]),...
 		'colorbartitle#3','(m)', 'log#1-2',10);
-end
+end 
 
-if any(steps==6)  %Higher-Order #6
-
+if any(steps==6) %Higher-Order #6 
 	% Load Model
 
@@ -165,8 +160,7 @@
 	% Save Model
 
-end
+end % step 6 end
 
-if any(steps==7)  %Plot #7
-
+if any(steps==7) %Plot #7 
 	mdHO = loadmodel('./Models/PIG_ModelHO');
 	mdSSA = loadmodel('./Models/PIG_Control_drag');
@@ -176,13 +170,13 @@
 
 	plotmodel(mdHO,'nlines',3,'ncols',2,'axis#all','equal',...
-						'data',mdHO.initialization.vel,'title','Observed velocity',...
-						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.initialization.vel(surf)),'title','(HO-observed) velocities',...
-						'data',mdSSA.results.StressbalanceSolution.Vel,'title','Modeled SSA Velocity',...
-						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdSSA.results.StressbalanceSolution.Vel),'title','(HO-SSA) velocities',...
-						'data',mdHO.results.StressbalanceSolution.Vel,'title','Modeled HO surface Velocities',...
-						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.results.StressbalanceSolution.Vel(basal)),'title','(HOsurf-HO base) velocities',...
-						'caxis#1',([1.5,4000]),'caxis#3',([1.5,4000]),'caxis#5',([1.5,4000]),...
-						'colorbar#all','on','view#all',2,...
-						'colorbartitle#all','(m/yr)',...
-						'layer#5',1, 'log#1', 10,'log#3', 10,'log#5', 10);
-end
+		'data',mdHO.initialization.vel,'title','Observed velocity',...
+		'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.initialization.vel(surf)),'title','(HO-observed) velocities',...
+		'data',mdSSA.results.StressbalanceSolution.Vel,'title','Modeled SSA Velocity',...
+		'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdSSA.results.StressbalanceSolution.Vel),'title','(HO-SSA) velocities',...
+		'data',mdHO.results.StressbalanceSolution.Vel,'title','Modeled HO surface Velocities',...
+		'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.results.StressbalanceSolution.Vel(basal)),'title','(HOsurf-HO base) velocities',...
+		'caxis#1',([1.5,4000]),'caxis#3',([1.5,4000]),'caxis#5',([1.5,4000]),...
+		'colorbar#all','on','view#all',2,...
+		'colorbartitle#all','(m/yr)',...
+		'layer#5',1, 'log#1', 10,'log#3', 10,'log#5', 10);
+end 
Index: /issm/trunk/examples/Pig2/runme.m
===================================================================
--- /issm/trunk/examples/Pig2/runme.m	(revision 26743)
+++ /issm/trunk/examples/Pig2/runme.m	(revision 26744)
@@ -1,13 +1,13 @@
-steps=1;
-
-if any(steps==1) %Mesh Generation #1
+steps=[1];
+
+if any(steps==1) %Mesh Generation #1 
 
 	%Mesh parameters
 	domain =['./DomainOutline.exp'];
-	hinit=5000;   % element size for the initial mesh
-	hmax=40000;    % maximum element size of the final mesh
-	hmin=4000;     % minimum element size of the final mesh
-	gradation=1.7; % maximum size ratio between two neighboring elements
-	err=8;         % maximum error between interpolated and control field
+	hinit=5000;		% element size for the initial mesh
+	hmax=40000;		% maximum element size of the final mesh
+	hmin=4000;		% minimum element size of the final mesh
+	gradation=1.7;	% maximum size ratio between two neighboring elements
+	err=8;			% maximum error between interpolated and control field
 
 	% Generate an initial uniform mesh (resolution = hinit m)
@@ -15,17 +15,17 @@
 
 	% Get necessary data to build up the velocity grid
-	nsidc_vel='../Data/Antarctica_ice_velocity.nc'; 	
-	xmin    = strsplit(ncreadatt(nsidc_vel,'/','xmin'));      xmin    = str2num(xmin{2});
-	ymax    = strsplit(ncreadatt(nsidc_vel,'/','ymax'));      ymax    = str2num(ymax{2});
-	spacing = strsplit(ncreadatt(nsidc_vel,'/','spacing'));   spacing = str2num(spacing{2});
-	nx      = double(ncreadatt(nsidc_vel,'/','nx'));
-	ny      = double(ncreadatt(nsidc_vel,'/','ny'));
-	vx      = double(ncread(nsidc_vel,'vx'));
-	vy      = double(ncread(nsidc_vel,'vy'));
+	nsidc_vel	='../Data/Antarctica_ice_velocity.nc';
+	xmin		= strsplit(ncreadatt(nsidc_vel,'/','xmin'));	xmin	= str2num(xmin{2});
+	ymax		= strsplit(ncreadatt(nsidc_vel,'/','ymax'));	ymax	= str2num(ymax{2});
+	spacing		= strsplit(ncreadatt(nsidc_vel,'/','spacing'));	spacing	= str2num(spacing{2});
+	nx			= double(ncreadatt(nsidc_vel,'/','nx'));
+	ny			= double(ncreadatt(nsidc_vel,'/','ny'));
+	vx			= double(ncread(nsidc_vel,'vx'));
+	vy			= double(ncread(nsidc_vel,'vy'));
 
 	% Build the coordinates
 	x=xmin+(0:1:nx)'*spacing;
 	y=(ymax-ny*spacing)+(0:1:ny)'*spacing;
-	
+
 	% Interpolate velocities onto coarse mesh
 	vx_obs=InterpFromGridToMesh(x,y,flipud(vx'),md.mesh.x,md.mesh.y,0);
@@ -40,18 +40,17 @@
 	plotmodel(md,'data','mesh')
 	save ./Models/PIG_Mesh_generation md;
-end
-
-if any(steps==2)  %Masks #2
-
-	md = loadmodel('./Models/PIG_Mesh_generation');	
+end 
+
+if any(steps==2) %Masks #2 
+	md = loadmodel('./Models/PIG_Mesh_generation');
 
 	% Load SeaRISe dataset for Antarctica  http://websrv.cs.umt.edu/isis/index.php/Present_Day_Antarctica
 	searise='../Data/Antarctica_5km_withshelves_v0.75.nc';
-	
+
 	%read thickness mask from SeaRISE
 	x1=double(ncread(searise,'x1'));
 	y1=double(ncread(searise,'y1'));
 	thkmask=double(ncread(searise,'thkmask'));
-	
+
 	%interpolate onto our mesh vertices
 	groundedice=double(InterpFromGridToMesh(x1,y1,thkmask',md.mesh.x,md.mesh.y,0));
@@ -64,19 +63,17 @@
 
 	plotmodel(md,'data',md.mask.ocean_levelset,'title','grounded/floating','data',md.mask.ice_levelset,'title','ice/no-ice')
-	
+
 	save ./Models/PIG_SetMask md;
-end
-
-if any(steps==3)  %Parameterization #3
-
+end 
+
+if any(steps==3) %Parameterization #3 
 	md = loadmodel('./Models/PIG_SetMask');
 	md = setflowequation(md,'SSA','all');
 	md = parameterize(md,'./Pig.par');
-	
+
 	save ./Models/PIG_Parameterization md;
-end
-
-if any(steps==4)  %Rheology B inversion
-
+end 
+
+if any(steps==4) %Rheology B inversion 
 	md = loadmodel('./Models/PIG_Parameterization');
 
@@ -120,8 +117,7 @@
 	% Save model
 	save ./Models/PIG_Control_B md;
-end
-
-if any(steps==5)  %drag inversion
-
+end 
+
+if any(steps==5) %drag inversion 
 	md = loadmodel('./Models/PIG_Control_B');
 
@@ -153,8 +149,9 @@
 		'caxis#1-2',([1.5,4000]),...
 		'colorbartitle#3','(m)', 'log#1-2',10);
+
 	save ./Models/PIG_Control_drag md;
-end
-
-if any(steps==6) %Transient Run #1
+end 
+
+if any(steps==6) %Transient Run #1 
 
 	md = loadmodel('./Models/PIG_Control_drag');	
@@ -183,5 +180,5 @@
 	% Save model
 	save ./Models/PIG_Transient md;
-end
+end 
 
 if any(steps==7) %High Melt #2
@@ -196,7 +193,7 @@
 
 	save ./Models/PIG_HighMelt md;
-end
-
-if any(steps==8) %Ice Front retreat
+end 
+
+if any(steps==8) %Ice Front retreat 
 	md = loadmodel('./Models/PIG_Transient');	
 
@@ -209,7 +206,7 @@
 
 	save ./Models/PIG_FrontRetreat md;
-end
-
-if any(steps==9) %High surface mass balance #3
+end 
+
+if any(steps==9) %High surface mass balance #3 
 	%Load model from PIG_Transient
 	%...
@@ -229,3 +226,3 @@
 	%Save model
 	save ./Models/PIG_SMB md;
-end
+end 
Index: /issm/trunk/examples/PigSensitivity/runme.m
===================================================================
--- /issm/trunk/examples/PigSensitivity/runme.m	(revision 26743)
+++ /issm/trunk/examples/PigSensitivity/runme.m	(revision 26744)
@@ -1,7 +1,7 @@
 steps=[1];
 
-if any(steps==1) %Transient Run #1
+if any(steps==1) %Transient Run #1 
 
-	md = loadmodel('../Pig/Models/PIG_Control_drag');	
+	md = loadmodel('../Pig/Models/PIG_Control_drag');
 
 	md.inversion.iscontrol=0;
@@ -11,9 +11,9 @@
 	md.transient.ismovingfront=0;
 	md.transient.isthermal=0;
-	
+
 	pos=find(md.mask.ocean_levelset<0);
 	md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
 	md.basalforcings.floatingice_melting_rate=25*ones(md.mesh.numberofvertices,1);
-	
+
 	md.timestepping.time_step=0.1;
 	md.timestepping.final_time=10;
@@ -22,14 +22,25 @@
 	md=solve(md,'Transient');
 
+	plotmodel(md, 'data', md.results.TransientSolution(1).Vel,...
+		'title#1', 'Velocity t=0 years (m/yr)',...
+		'data', md.results.TransientSolution(end).Vel,...
+		'title#2', 'Velocity t=10 years (m/yr)',...
+		'data', md.results.TransientSolution(1).MaskOceanLevelset,...
+		'title#3', 'Floating ice t=0 years',...
+		'data', md.results.TransientSolution(end).MaskOceanLevelset,...
+		'title#4', 'Floating ice t=10 years',...
+		'caxis#1',([0 4500]),'caxis#2',([0 4500]),...
+		'caxis#3',([-1,1]),'caxis#4',([-1,1]));
+
 	% Save model
 	save ./Models/PIG_Transient md;
-end
+end 
 
-if any(steps==2) %High Melt #2
-	md = loadmodel('./Models/PIG_Transient');	
+if any(steps==2) %High Melt #2 
+	md = loadmodel('./Models/PIG_Transient');
 
 	md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
 	md.basalforcings.floatingice_melting_rate=60*ones(md.mesh.numberofvertices,1);
-	
+
 	md.timestepping.time_step=0.1;
 	md.timestepping.final_time=10;
@@ -38,9 +49,20 @@
 	md=solve(md,'Transient');
 
+	plotmodel(md, 'data', md.results.TransientSolution(1).Vel,...
+		'title#1', 'Velocity t=0 years (m/yr)',...
+		'data', md.results.TransientSolution(end).Vel,...
+		'title#2', 'Velocity t=10 years (m/yr)',...
+		'data', md.results.TransientSolution(1).MaskOceanLevelset,...
+		'title#3', 'Floating ice t=0 years',...
+		'data', md.results.TransientSolution(end).MaskOceanLevelset,...
+		'title#4', 'Floating ice t=10 years',...
+		'caxis#1',([0 4500]),'caxis#2',([0 4500]),...
+		'caxis#3',([-1,1]),'caxis#4',([-1,1]));
+
 	save ./Models/PIG_HighMelt md;
-end
+end 
 
-if any(steps==3) %Ice Front retreat
-	md = loadmodel('./Models/PIG_Transient');	
+if any(steps==3) %Ice Front retreat 
+	md = loadmodel('./Models/PIG_Transient');
 
 	md2=extract(md,'~FrontRetreat.exp');
@@ -57,12 +79,24 @@
 	md2=solve(md2,'Transient');
 
+	plotmodel(md, 'data', md.results.TransientSolution(1).Vel,...
+		'title#1', 'Velocity t=0 years (m/yr)',...
+		'data', md.results.TransientSolution(end).Vel,...
+		'title#2', 'Velocity t=10 years (m/yr)',...
+		'data', md.results.TransientSolution(1).MaskOceanLevelset,...
+		'title#3', 'Floating ice t=0 years',...
+		'data', md.results.TransientSolution(end).MaskOceanLevelset,...
+		'title#4', 'Floating ice t=10 years',...
+		'caxis#1',([0 4500]),'caxis#2',([0 4500]),...
+		'caxis#3',([-1,1]),'caxis#4',([-1,1]));
+
 	save ./Models/PIG_FrontRetreat md2;
-end
+end 
 
-if any(steps==4) %High surface mass balance #3
+if any(steps==4) %High surface mass balance #3 
+
 	%Load model
 
 	%Change external forcing basal melting rate and surface mass balance)
-	
+
 	%Refine time steps and time span of the simulation
 
@@ -73,3 +107,3 @@
 	%Save model
 
-end
+end % step 4 end
Index: /issm/trunk/examples/SlrFarrell/runme.m
===================================================================
--- /issm/trunk/examples/SlrFarrell/runme.m	(revision 26743)
+++ /issm/trunk/examples/SlrFarrell/runme.m	(revision 26744)
@@ -1,6 +1,5 @@
-
 clear all;
 
-steps=[1]; % [1:5] 
+steps=[4];
 
 if any(steps==1) 
@@ -8,31 +7,29 @@
 
 	numrefine=1;
-	resolution=150*1e3;			% inital resolution [m] 
+	resolution=150*1e3;			% inital resolution [m]
 	radius = 6.371012*10^6;		% mean radius of Earth, m
-	mindistance_coast=150*1e3;	% coastal resolution [m] 
+	mindistance_coast=150*1e3;	% coastal resolution [m]
 	mindistance_land=300*1e3;	% resolution on the continents [m]
-	maxdistance=600*1e3;			% max element size (on mid-oceans) [m]
+	maxdistance=600*1e3;		% max element size (on mid-oceans) [m]
 
-	md=model; 
-	md.mask=maskpsl(); 
-	md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3); % attributes in [km] 
+	md=model;
+	md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3); % attributes in [km]
 
 	for i=1:numrefine,
-
-		md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long); 
+		ocean_mask_levelset=gmtmask(md.mesh.lat,md.mesh.long);
 
 		distance=zeros(md.mesh.numberofvertices,1);
 
-		pos=find(~md.mask.ocean_levelset);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos);  
-		pos=find(md.mask.ocean_levelset);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos);  
+		pos=find(~ocean_mask_levelset);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos);
+		pos=find(ocean_mask_levelset);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos);
 
 		for j=1:md.mesh.numberofvertices
-			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi; 
-			if md.mask.ocean_levelset(j),
-				phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi; 
+			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi;
+			if ocean_mask_levelset(j),
+				phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi;
 				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
 				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
 			else
-				phi2=coasto.lat/180*pi; lambda2=coasto.long/180*pi; 
+				phi2=coasto.lat/180*pi; lambda2=coasto.long/180*pi;
 				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
 				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
@@ -41,19 +38,20 @@
 		end
 		pos=find(distance<mindistance_coast); distance(pos)=mindistance_coast;
-		
-		pos2=find(md.mask.ocean_levelset~=1 & distance>mindistance_land); 
-		distance(pos2)=mindistance_land; 
 
-		dist=min(maxdistance,distance); 
+		pos2=find(ocean_mask_levelset~=1 & distance>mindistance_land);
+		distance(pos2)=mindistance_land;
+
+		dist=min(maxdistance,distance);
 		md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3,'refine',md.mesh,'refinemetric',dist);
-
 	end
 
-	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long); 
+	ocean_mask=gmtmask(md.mesh.lat,md.mesh.long);
+	pos = find(ocean_mask==0); 
+	md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1); 
+	md.mask.ocean_levelset(pos)=1; 
 
 	save ./Models/SlrFarrell_Mesh md;
-	
+
 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
-
 end 
 
@@ -62,13 +60,17 @@
 	md = loadmodel('./Models/SlrFarrell_Mesh');
 
-	md.slr.sealevel=md.mask.ocean_levelset; % 1 m SLR everywhere 
-	
-	md.slr.deltathickness=zeros(md.mesh.numberofelements,1);
-	md.slr.steric_rate=zeros(md.mesh.numberofvertices,1);
+	md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofvertices,1);
+	md.mask.ice_levelset=ones(md.mesh.numberofvertices,1); 
 
-	save ./Models/SlrFarrell_Loads md; 
-	
-	plotmodel (md,'data',md.slr.sealevel,'view',[90 90],'title#all','Initial sea-level [m]');
+	pos = find(md.mask.ocean_levelset==-1); 
+	md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
+	md.solidearth.initialsealevel(pos)=1; % 1 m SLR everywhere
+	md.dsl.global_average_thermosteric_sea_level_change=[0;0];
+	md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+	md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
 
+	save ./Models/SlrFarrell_Loads md;
+
+	plotmodel (md,'data',md.solidearth.initialsealevel,'view',[90 90],'title#all','Initial sea-level [m]');
 end 
 
@@ -77,30 +79,25 @@
 	md = loadmodel('./Models/SlrFarrell_Loads');
 
-	nlove=10001;	
-	md.slr.love_h = love_numbers('h','CM'); md.slr.love_h(nlove+1:end)=[];
-	md.slr.love_k = love_numbers('k','CM'); md.slr.love_k(nlove+1:end)=[];
-	md.slr.love_l = love_numbers('l','CM'); md.slr.love_l(nlove+1:end)=[];
+	md.solidearth.lovenumbers=lovenumbers('maxdeg',10000);
 
-	md.mask.land_levelset = 1-md.mask.ocean_levelset; 
-	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1); 
-	md.mask.ocean_levelset = -ones(md.mesh.numberofvertices,1); 
-	pos=find(md.mesh.lat <-80);
-	md.mask.ice_levelset(pos(1))=-1; % ice yes!  
-	md.mask.ocean_levelset(pos(1))=1; % ice grounded!  
+	%md.mask.ice_levelset = ones(md.mesh.numberofvertices,1);
+	%md.mask.ocean_levelset = -ones(md.mesh.numberofvertices,1);
+	%pos=find(md.mesh.lat <-80);
+	%md.mask.ice_levelset(pos(1))=-1; % ice yes!
+	%md.mask.ocean_levelset(pos(1))=1; % ice grounded!
 
-	di=md.materials.rho_ice/md.materials.rho_water;
-	md.geometry.thickness=ones(md.mesh.numberofvertices,1);
-	md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1);
-	md.geometry.base=md.geometry.surface-md.geometry.thickness;
-	md.geometry.bed=md.geometry.base;
-	
+	% arbitary to pass consistency check. 
+	md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+	md.geometry.surface=ones(md.mesh.numberofvertices,1);
+	md.geometry.base=md.geometry.bed; 
+	md.geometry.thickness=md.geometry.surface-md.geometry.base; 
+
 	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
 	md.materials.rheology_B=paterson(md.initialization.temperature);
 	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
-	
+
 	md.miscellaneous.name='SlrFarrell';
-	
-	save ./Models/SlrFarrell_Parameterization md; 
 
+	save ./Models/SlrFarrell_Parameterization md;
 end 
 
@@ -109,13 +106,12 @@
 	md = loadmodel('./Models/SlrFarrell_Parameterization');
 
-	md.cluster=generic('name',oshostname(),'np',3); 
+	md.cluster=generic('name',oshostname(),'np',3);
 	md.verbose=verbose('111111111');
 
-	md.slr.reltol = 0.1/100; % per cent change in solution 
+	md.solidearth.settings.reltol = 0.1/100; % percent change in solution
 
 	md=solve(md,'Slr');
 
-	save ./Models/SlrFarrell_Solution md; 
-
+	save ./Models/SlrFarrell_Solution md;
 end 
 
@@ -124,37 +120,35 @@
 	md = loadmodel('./Models/SlrFarrell_Solution');
 
-	sol = md.results.SealevelriseSolution.Sealevel*100; % per cent normalized by GMSL (which 1 m)  
+	sol = md.results.SealevelriseSolution.Sealevel*100; % per cent normalized by GMSL (which 1 m)
 
 	res = 1; % [degree]
 
 	[lat_grid, lon_grid] = meshgrid(linspace(-90,90,180/res), linspace(-180,180,360/res));
-	sol_grid = zeros(size(lat_grid)); 
+	sol_grid = zeros(size(lat_grid));
 
-	F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol); 
-	F.Method = 'linear'; 
-	F.ExtrapolationMethod = 'linear'; 
-	
+	F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol);
+	F.Method = 'linear';
+	F.ExtrapolationMethod = 'linear';
+
 	sol_grid = F(lat_grid, lon_grid);
-	sol_grid(isnan(sol_grid))=0; 
-	sol_grid(lat_grid>85 & sol_grid==0) =NaN; 
+	sol_grid(isnan(sol_grid))=0;
+	sol_grid(lat_grid>85 & sol_grid==0)=NaN;
 
 	set(0,'DefaultAxesFontSize',18,'DefaultAxesLineWidth',1,'DefaultTextFontSize',18,'DefaultLineMarkerSize',8)
-	figure1=figure('Position', [100, 100, 1000, 500]); 
-	gcf; load coast; cla; 
+	figure1=figure('Position', [100, 100, 1000, 500]);
+	gcf; load coast; cla;
 	pcolor(lon_grid,lat_grid,sol_grid); shading flat; hold on;
 	[C,h]=contour(lon_grid,lat_grid,sol_grid,[96 98 100 102 104 105],'-k','linewidth',2);
-	clabel(C,h,'FontSize',18,'Color','red','LabelSpacing',500); 
-	geoshow(lat,long,'DisplayType','polygon','FaceColor',[.82 .82 .82]); 
-	plot(long,lat,'k'); hold off; 
+	clabel(C,h,'FontSize',18,'Color','red','LabelSpacing',500);
+	geoshow(lat,long,'DisplayType','polygon','FaceColor',[.82 .82 .82]);
+	plot(long,lat,'k'); hold off;
 	c1=colorbar;
-	colormap(flipud(haxby)); 
-	caxis([96 105]); 
-	xlim([-170 170]); 
-	ylim([-85 85]); 
-	grid on; 
-	title('Relative sea-level [% of GMSL]'); 
+	colormap(flipud(haxby));
+	caxis([96 105]);
+	xlim([-170 170]);
+	ylim([-85 85]);
+	grid on;
+	title('Relative sea-level [% of GMSL]');
 	set(gcf,'color','w');
-	%export_fig('Fig5.pdf'); 
-
+	%export_fig('Fig5.pdf');
 end 
-
Index: /issm/trunk/examples/SlrGRACE/runme.m
===================================================================
--- /issm/trunk/examples/SlrGRACE/runme.m	(revision 26743)
+++ /issm/trunk/examples/SlrGRACE/runme.m	(revision 26744)
@@ -1,39 +1,35 @@
-
 clear all;
 addpath('../Data','../Functions');
 
-steps=[1]; % [1:7]
-
-if any(steps==1) 
+steps=[1:7];
+
+if any(steps==1) % {{{ 
 	disp('   Step 1: Global mesh creation');
 
-	numrefine=1;
-	resolution=150*1e3;			% inital resolution [m] 
+	numrefine=5;
+	resolution=150*1e3;			% inital resolution [m]
 	radius = 6.371012*10^6;		% mean radius of Earth, m
-	mindistance_coast=150*1e3;	% coastal resolution [m] 
+	mindistance_coast=150*1e3;	% coastal resolution [m]
 	mindistance_land=300*1e3;	% resolution on the continents [m]
-	maxdistance=600*1e3;			% max element size (on mid-oceans) [m]
-
-	md=model; 
-	md.mask=maskpsl(); 
-	md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3); % attributes in [km] 
+	maxdistance=600*1e3;		% max element size (on mid-oceans) [m]
+
+	md=model;
+	md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3); % attributes in [km]
 
 	for i=1:numrefine,
 
-		md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long); 
+		ocean_mask=gmtmask(md.mesh.lat,md.mesh.long);
 
 		distance=zeros(md.mesh.numberofvertices,1);
 
-		pos=find(~md.mask.ocean_levelset);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos);  
-		pos=find(md.mask.ocean_levelset);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos);  
-
+		pos=find(~ocean_mask);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos);		pos=find(ocean_mask);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos);
 		for j=1:md.mesh.numberofvertices
-			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi; 
-			if md.mask.ocean_levelset(j),
-				phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi; 
+			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi;
+			if ocean_mask(j),
+				phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi;
 				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
 				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
 			else
-				phi2=coasto.lat/180*pi; lambda2=coasto.long/180*pi; 
+				phi2=coasto.lat/180*pi; lambda2=coasto.long/180*pi;
 				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
 				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
@@ -42,109 +38,121 @@
 		end
 		pos=find(distance<mindistance_coast); distance(pos)=mindistance_coast;
-		
-		pos2=find(md.mask.ocean_levelset~=1 & distance>mindistance_land); 
-		distance(pos2)=mindistance_land; 
-
-		dist=min(maxdistance,distance); 
+
+		pos2=find(ocean_mask~=1 & distance>mindistance_land);
+		distance(pos2)=mindistance_land;
+
+		dist=min(maxdistance,distance);
 		md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3,'refine',md.mesh,'refinemetric',dist);
-
 	end
 
-	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long); 
-
+	ocean_mask=gmtmask(md.mesh.lat,md.mesh.long);
+	pos = find(ocean_mask==0);	md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1);	md.mask.ocean_levelset(pos)=1;
 	save ./Models/SlrGRACE_Mesh md;
-	
+
 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
-
-end 
-
-if any(steps==2) 
+end % }}} 
+if any(steps==2) % {{{ 
 	disp('   Step 2: Define loads in meters of ice height equivalent');
 	md = loadmodel('./Models/SlrGRACE_Mesh');
 
 	year_month = 2007+15/365;
-	time_range = [year_month year_month]; 
-	
-	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2)); 
-	
-	md.slr.deltathickness = water_load*md.materials.rho_freshwater/md.materials.rho_ice; 
-
-	save ./Models/SlrGRACE_Loads md; 
-	
-	plotmodel (md,'data',md.slr.deltathickness,'view',[90 -90],'caxis',[-.1 .1],'title','Ice height equivalent [m]');
-
-end 
-
-if any(steps==3) 
+	time_range = [year_month year_month];
+
+	onvertex = 1; % map data on vertex. If 0, it maps on the elemental centroid. 
+	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2),onvertex);
+	rho_water2ice = md.materials.rho_freshwater/md.materials.rho_ice; 
+	ice_load = water_load*rho_water2ice; % ice height equivalent. 
+
+	%Geometry for the bed, arbitrary thickness of 100:
+	md.geometry.bed=zeros(md.mesh.numberofvertices,1);
+	md.geometry.base=md.geometry.bed;
+	md.geometry.thickness = 100*ones(md.mesh.numberofvertices,1);
+	md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+
+	md.masstransport.spcthickness = [md.geometry.thickness + ice_load; 0];
+
+	md.smb.mass_balance=zeros(md.mesh.numberofvertices,1); 
+
+	save ./Models/SlrGRACE_Loads md;
+
+	plotmodel (md,'data',ice_load,...
+		'edgecolor','k','view',[45 45],'caxis',[-.1 .1],...
+		'title','Ice height equivalent [m]');
+end % }}} 
+if any(steps==3) % {{{ 
 	disp('   Step 3: Parameterization');
 	md = loadmodel('./Models/SlrGRACE_Loads');
-
-	nlove=10001;
-	md.slr.love_h = love_numbers('h','CM'); md.slr.love_h(nlove+1:end)=[];
-	md.slr.love_k = love_numbers('k','CM'); md.slr.love_k(nlove+1:end)=[];
-	md.slr.love_l = love_numbers('l','CM'); md.slr.love_l(nlove+1:end)=[];
-
-	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1); 
-	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1); 
-	pos=find(md.slr.deltathickness~=0);
-	md.mask.ice_levelset(md.mesh.elements(pos,:))=-1; 
-	md.mask.land_levelset = 1-md.mask.ocean_levelset; 
-
-	md.slr.sealevel=zeros(md.mesh.numberofvertices,1);
-	md.slr.steric_rate=zeros(md.mesh.numberofvertices,1);
-	md.slr.ocean_area_scaling = 1;
-
-	di=md.materials.rho_ice/md.materials.rho_water;
-	md.geometry.thickness=ones(md.mesh.numberofvertices,1);
-	md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1);
-	md.geometry.base=md.geometry.surface-md.geometry.thickness;
-	md.geometry.bed=md.geometry.base;
-	
-	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
-	md.materials.rheology_B=paterson(md.initialization.temperature);
-	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
-	
+	
+	md.mask.ice_levelset=-md.mask.ocean_levelset;
+	
+	md.solidearth.lovenumbers = lovenumbers('maxdeg',10000);
+	md.solidearth.settings.reltol=NaN;
+	md.solidearth.settings.abstol=1e-3;
+	md.solidearth.settings.sealevelloading=1;
+	md.solidearth.settings.isgrd=1;
+	md.solidearth.settings.grdmodel=1;
+	md.solidearth.settings.maxiter=10; 
+	
+	%time stepping:
+	md.timestepping.start_time=0;
+	md.timestepping.time_step=1;
+	md.timestepping.final_time=1;
+
+	%masstransport:
+	md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+	md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+	md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+	md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+	md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+	md.initialization.str=0;
+
 	md.miscellaneous.name='SlrGRACE';
-	
-	save ./Models/SlrGRACE_Parameterization md; 
-
-end 
-
-if any(steps==4) 
+
+	save ./Models/SlrGRACE_Parameterization md;
+end % }}} 
+if any(steps==4) % {{{ 
 	disp('   Step 4: Solve Slr solver');
 	md = loadmodel('./Models/SlrGRACE_Parameterization');
 
-	md.slr.rigid=1; 
-	md.slr.elastic=1; 
-	md.slr.rotation=1;
-
-	md.cluster=generic('name',oshostname(),'np',3); 
+	md.solidearth.settings.viscous=0;
+	md.solidearth.settings.selfattraction=1;
+	md.solidearth.settings.elastic=1;
+	md.solidearth.settings.rotation=1;
+
+	%Physics:
+	md.transient.issmb=0;
+	md.transient.isstressbalance=0;
+	md.transient.isthermal=0;
+	md.transient.ismasstransport=1;
+	md.transient.isslc=1;
+	
+	md.solidearth.requested_outputs={'Sealevel','Bed'}; 
+
+	md.cluster=generic('name',oshostname(),'np',3);
 	md.verbose=verbose('111111111');
 
-	md=solve(md,'Slr');
-
-	save ./Models/SlrGRACE_Solution md; 
-
-end 
-
-if any(steps==5) 
+	md=solve(md,'Transient');
+
+	save ./Models/SlrGRACE_Solution md;
+end % }}}
+if any(steps==5) % {{{ 
 	disp('   Step 5: Plot solutions');
 	md = loadmodel('./Models/SlrGRACE_Solution');
 
-	sol1 = md.slr.deltathickness*100;							% [cm] 
-	sol2 = md.results.SealevelriseSolution.Sealevel*1000; % [mm] 
-	
-	sol_name={'Change in water equivalent height [cm]', 'Relative sea-level [mm]'}; 
-	fig_name={'Fig_dH.pdf','Fig_slr.pdf'}; 
-
-	res = 1.0; 
+	sol1 = (md.masstransport.spcthickness(1:end-1)-md.geometry.thickness)*100; % [cm]
+	sol2 = (md.results.TransientSolution.Sealevel-md.results.TransientSolution.Bed)*1000;	% [mm]
+
+	sol_name={'Change in water equivalent height [cm]', 'Relative sea level [mm]'};
+	fig_name={'Fig_dH.pdf','Fig_slr.pdf'};
+
+	res = 1.0;
 
 	[lat_grid, lon_grid] = meshgrid(linspace(-90,90,180/res), linspace(-180,180,360/res));
-	sol_grid = zeros(size(lat_grid)); 
+	sol_grid = zeros(size(lat_grid));
 
 	for kk=1:2
 		sol=eval(sprintf('sol%d',kk));
-	
-		if length(sol)==md.mesh.numberofelements 
+
+		if length(sol)==md.mesh.numberofelements
 			for jj=1:md.mesh.numberofelements
 				ii=(jj-1)*3;
@@ -152,98 +160,104 @@
 			end
 			for jj=1:md.mesh.numberofvertices
-				pos=ceil(find(pp==jj)/3); 
-				temp(jj)=mean(sol(pos)); 
-			end
-			sol=temp'; 
-		end 
-
-		F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol); 
+				pos=ceil(find(pp==jj)/3);
+				temp(jj)=mean(sol(pos));
+			end
+			sol=temp';
+		end
+
+		F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol);
 		F.Method = 'linear';
-		F.ExtrapolationMethod = 'linear'; 
-		
+		F.ExtrapolationMethod = 'linear';
+
 		sol_grid = F(lat_grid, lon_grid);
-		sol_grid(isnan(sol_grid))=0; 
-		sol_grid(lat_grid>85 & sol_grid==0) = NaN; 
+		sol_grid(isnan(sol_grid))=0;
+		sol_grid(lat_grid>85 & sol_grid==0) = NaN;
 
 		set(0,'DefaultAxesFontSize',18,'DefaultAxesLineWidth',1,'DefaultTextFontSize',18,'DefaultLineMarkerSize',8)
-		figure1=figure('Position', [100, 100, 1000, 500]); 
-		gcf; load coast; cla; 
+		figure1=figure('Position', [100, 100, 1000, 500]);
+		gcf; load coastlines; cla;
 		pcolor(lon_grid,lat_grid,sol_grid); shading flat; hold on;
 		if (kk==1)
-			geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white'); 
+			geoshow(flipud(coastlat),flipud(coastlon),'DisplayType','polygon','FaceColor','white');
 		else
-			geoshow(lat,long,'DisplayType','polygon','FaceColor','white'); 
-		end 
-		plot(long,lat,'k'); hold off; 
+			geoshow(coastlat,coastlon,'DisplayType','polygon','FaceColor','none');
+		end
+		plot(coastlon, coastlat,'k'); hold off;
 		c1=colorbar;
-		colormap('haxby'); 
-		caxis([-floor(min(abs(min(sol)),abs(max(sol)))) floor(min(abs(min(sol)),abs(max(sol))))]); 
-		xlim([-180 180]); 
-		ylim([-90 90]); 
-		grid on; 
-		title(sol_name(kk)); 
+		colormap('haxby');
+		caxis([-floor(min(abs(min(sol)),abs(max(sol)))) floor(min(abs(min(sol)),abs(max(sol))))]);
+		xlim([-180 180]);
+		ylim([-90 90]);
+		grid on;
+		title(sol_name(kk));
 		set(gcf,'color','w');
-		%export_fig(fig_name{kk}); 
+		%export_fig(fig_name{kk});
 	end
-
-end 
-
-if any(steps==6) 
+end % }}} 
+if any(steps==6) % {{{
 	disp('   Step 6: Transient run');
 	md = loadmodel('./Models/SlrGRACE_Parameterization');
 
 	disp('Projecting  loads onto the mesh...');
-	time_range = 2007 + [15 350]/365; 
-	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2)); 
-
-	[ne,nt]=size(water_load); 
-   md.slr.deltathickness = zeros(ne+1,nt);
-	md.slr.deltathickness(1:ne,:) = water_load*md.materials.rho_freshwater/md.materials.rho_ice; 
-	md.slr.deltathickness(ne+1,:)=[1:nt]; % times 
-	
+	time_range = 2007 + [15 350]/365;
+	onvertex = 1; % map data on vertex. If 0, it maps on the elemental centroid. 
+	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2),onvertex);
+	rho_water2ice = md.materials.rho_freshwater/md.materials.rho_ice; 
+	ice_load = water_load*rho_water2ice; % ice height equivalent. 
+
+	% masstransport evalulates diff between the successive times, so we should cumsum. 
+	num_time = size(ice_load,2); 
+	md.masstransport.spcthickness = [repmat(md.geometry.thickness,1,size(ice_load,2)) + ice_load];
+	md.masstransport.spcthickness =[ md.masstransport.spcthickness; 0:num_time-1]; 
+
+	%Physics 
 	md.transient.issmb=0;
-	md.transient.ismasstransport=0; 
-	md.transient.isstressbalance=0; 
+	md.transient.isstressbalance=0;
 	md.transient.isthermal=0;
-	md.transient.isslr=1;
-	
-	md.timestepping.start_time=-1;
-   md.timestepping.final_time=nt; 
-	md.timestepping.time_step=1; 
-   md.timestepping.interp_forcings=0;
-	md.settings.output_frequency=1;
-
-	md.cluster=generic('name',oshostname(),'np',3); 
+	md.transient.ismasstransport=1;
+	md.transient.isslc=1;
+
+	md.solidearth.settings.viscous=0;
+	md.solidearth.settings.selfattraction=1;
+	md.solidearth.settings.elastic=1;
+	md.solidearth.settings.rotation=1;
+	
+	%time stepping:
+	md.timestepping.start_time=0;
+	md.timestepping.time_step=1;
+	md.timestepping.final_time=num_time; 
+
+	md.cluster=generic('name',oshostname(),'np',3);
 	md.verbose=verbose('111111111');
 
+	md.solidearth.requested_outputs = {'Sealevel','Bed'};
+
 	md=solve(md,'tr');
 
-	save ./Models/SlrGRACE_Transient md; 
-
-end 
-
-if any(steps==7) 
+	save ./Models/SlrGRACE_Transient md;
+end % }}} 
+if any(steps==7) % {{{ 
 	disp('   Step 7: Plot transient');
 	md = loadmodel('./Models/SlrGRACE_Transient');
 
-	time = md.slr.deltathickness(end,:); 
+	time = md.masstransport.spcthickness(end,:);
 
 	for tt=1:length(time)
-		gmsl(tt) = md.results.TransientSolution(tt).SealevelEustatic*1000;	% GMSL rate mm/yr
-		sol1(:,tt) = md.slr.deltathickness(1:end-1,tt)*100;						% ice equivalent height [cm/yr] 
-	   sol2(:,tt) = md.results.TransientSolution(tt+1).Sealevel*1000;			% mm/yr
+		gmsl(tt) = md.results.TransientSolution(tt).CumBslc*1000; % [mm]
+		sol1(:,tt) = (md.masstransport.spcthickness(1:end-1,tt)-md.geometry.thickness)*100; % [cm]
+		sol2(:,tt) = (md.results.TransientSolution(tt).Sealevel-md.results.TransientSolution(tt).Bed)*1000;	% [mm]
 	end
-	sol_name = {'Change in water equivalent height [cm]', 'Relative sea-level [mm]'}; 
-	movie_name = {'Movie_dH.avi','Movie_slr.avi'}; 
-
-	res = 1.0; 
+	sol_name = {'Change in water equivalent height [cm]', 'Relative sea level [mm]'};
+	movie_name = {'Movie_dH.mp4','Movie_slr.mp4'};
+	
+	res = 1.0;
 
 	[lat_grid, lon_grid] = meshgrid(linspace(-90,90,180/res), linspace(-180,180,360/res));
-	sol_grid = zeros(size(lat_grid)); 
+	sol_grid = zeros(size(lat_grid));
 
 	for kk=1:2
 		sol=eval(sprintf('sol%d',kk));
-	
-		if length(sol)==md.mesh.numberofelements 
+
+		if length(sol)==md.mesh.numberofelements
 			for jj=1:md.mesh.numberofelements
 				ii=(jj-1)*3;
@@ -251,55 +265,58 @@
 			end
 			for jj=1:md.mesh.numberofvertices
-				pos=ceil(find(pp==jj)/3); 
-				temp2(jj,:)=mean(sol(pos,:)); 
-			end
-			sol=temp2; 
-		end 
-
-		vidObj = VideoWriter(movie_name{kk}); 
-		vidObj.FrameRate=2; % frames per second 
+				pos=ceil(find(pp==jj)/3);
+				temp2(jj,:)=mean(sol(pos,:));
+			end
+			sol=temp2;
+		end
+
+		vidObj = VideoWriter(movie_name{kk});
+		vidObj.FrameRate=2; % frames per second
+		vifObj.FileFormat='mp4';
 		open(vidObj);
 
 		for jj=1:length(time)
-			F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol(:,jj)); 
+			fprintf('creating frame %d...', jj);
+			F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol(:,jj));
 			F.Method = 'linear';
-			F.ExtrapolationMethod = 'linear'; 
-			
+			F.ExtrapolationMethod = 'linear';
+
 			sol_grid = F(lat_grid, lon_grid);
-			sol_grid(isnan(sol_grid))=0; 
-			sol_grid(lat_grid>85 & sol_grid==0) = NaN; 
+			sol_grid(isnan(sol_grid))=0;
+			sol_grid(lat_grid>85 & sol_grid==0) = NaN;
 
 			set(0,'DefaultAxesFontSize',18,'DefaultAxesLineWidth',1,'DefaultTextFontSize',18,'DefaultLineMarkerSize',8)
-			figure1=figure('Position', [100, 100, 1000, 500]); 
-			gcf; load coast; cla; 
+			figure1=figure('Position', [100, 100, 1000, 500]);
+			gcf; load coastlines; cla;
 			pcolor(lon_grid,lat_grid,sol_grid); shading flat; hold on;
 			if (kk==1)
-				geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white'); 
+				geoshow(flipud(coastlat),flipud(coastlon),'DisplayType','polygon','FaceColor','white');
 			else
-				geoshow(lat,long,'DisplayType','polygon','FaceColor','white'); 
-			end 
-			plot(long,lat,'k'); hold off; 
+				geoshow(coastlat,coastlon,'DisplayType','polygon','FaceColor','none');
+			end
+			plot(coastlon,coastlat,'k'); hold off;
 			c1=colorbar;
-			colormap('haxby'); 
-			caxis([-floor(min(abs(min(min(sol))),abs(max(max(sol))))) floor(min(abs(min(min(sol))),abs(max(max(sol)))))]); 
-			xlim([-180 180]); 
-			ylim([-90 90]); 
-			grid on; 
-			title(sol_name(kk)); 
+			colormap('haxby');
+			%caxis([-floor(min(abs(min(min(sol))),abs(max(max(sol))))) floor(min(abs(min(min(sol))),abs(max(max(sol)))))]);
+			xlim([-180 180]);
+			ylim([-90 90]);
+			grid on;
+			title(sol_name(kk));
 			set(gcf,'color','w');
-			writeVideo(vidObj,getframe(gcf)); 
-			close 
-		end
+			writeVideo(vidObj,getframe(gcf));
+			close
+			fprintf('done\n');
+		end
+		disp('closing vidObj...');
 		close(vidObj);
 	end
-	!open *.avi; 
-	
-	% plot GMSL time series 
-	plot(time,gmsl,'-*','linewidth',3); grid on; 
-	xlabel('# month'); 
+	!open *.mp4;
+
+	% plot GMSL time series
+	plot(time,gmsl,'-*','linewidth',3); grid on;
+	xlabel('# month');
 	ylabel('GMSL [mm/yr]');
 	set(gcf,'color','w');
 	%export_fig('Fig7.pdf');
-
-end 
-
+end % }}} 
+
Index: /issm/trunk/examples/SquareIceShelf/Square.py
===================================================================
--- /issm/trunk/examples/SquareIceShelf/Square.py	(revision 26744)
+++ /issm/trunk/examples/SquareIceShelf/Square.py	(revision 26744)
@@ -0,0 +1,32 @@
+import numpy as np
+from paterson import paterson
+from SetIceShelfBC import SetIceShelfBC
+#Start defining model parameters here
+
+print('      creating thickness')
+hmin = 300
+hmax = 1000
+ymin = np.nanmin(md.mesh.y)
+ymax = np.nanmax(md.mesh.y)
+md.geometry.thickness = hmax + (hmin - hmax) * (md.mesh.y - ymin) / (ymax - ymin)
+md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+
+print('      creating drag')
+md.friction.coefficient = np.where(md.mask.ocean_levelset < 0., 0, 200)
+md.friction.p = np.ones((md.mesh.numberofelements))
+md.friction.q = np.ones((md.mesh.numberofelements))
+
+print('      initial velocity')
+md.initialization.vx = np.zeros((md.mesh.numberofvertices))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices))
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.vel = np.zeros((md.mesh.numberofvertices))
+
+print('      creating flow law parameter')
+md.materials.rheology_B = paterson((273 - 20) * np.ones((md.mesh.numberofvertices)))
+md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements))
+md.damage.D = np.zeros((md.mesh.numberofvertices))
+
+print('      creating boundary conditions')
+md = SetIceShelfBC(md, 'Front.exp')
Index: /issm/trunk/examples/SquareIceShelf/runme.py
===================================================================
--- /issm/trunk/examples/SquareIceShelf/runme.py	(revision 26744)
+++ /issm/trunk/examples/SquareIceShelf/runme.py	(revision 26744)
@@ -0,0 +1,16 @@
+from model import *
+from triangle import triangle
+from setmask import setmask
+from parameterize import parameterize
+from setflowequation import setflowequation
+from generic import generic
+from socket import gethostname
+from solve import solve
+
+md = model()
+md = triangle(md, 'DomainOutline.exp', 100000)
+md = setmask(md, 'all', '')
+md = parameterize(md, 'Square.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 2)
+md = solve(md, 'Stressbalance')
Index: /issm/trunk/examples/UncertaintyQuantification/runme.m
===================================================================
--- /issm/trunk/examples/UncertaintyQuantification/runme.m	(revision 26743)
+++ /issm/trunk/examples/UncertaintyQuantification/runme.m	(revision 26744)
@@ -1,8 +1,8 @@
-%PIG Uncertainty Quantification Application
-steps=[1]; 
-
-if any(steps==1) 
-	disp('   Step 1: plot flux gates'); 
-	
+%PIG Uncertainty Quantification Tutorial
+steps=[1];
+
+if any(steps==1)
+	disp('   Step 1: plot flux gates');
+
 	md = loadmodel('../Pig/Models/PIG_Control_drag');
 
@@ -28,14 +28,14 @@
 		'8','9','10','11','12','13'},...
 		'textposition',textpositions);
-
-end
-if any(steps==2) 
-	disp('   Step 2: compute cross overs from CRESIS'); 
-	
+end
+
+if any(steps==2)
+	disp('   Step 2: compute cross overs from CRESIS');
+
 	md = loadmodel('../Pig/Models/PIG_Control_drag');
 
 	%load cross overs: CRESIS McCord Antarctica, 2009 (courtesy of John Paden)
 	load('../Data/CrossOvers2009.mat');
-	
+
 	%interpolate cross over errors over our mesh vertices
 	DeltaHH=InterpFromMeshToMesh2d(index,x,y,dhh,md.mesh.x,md.mesh.y);
@@ -46,21 +46,21 @@
 	%filter out unrealistic error ranges
 	flags=ContourToNodes(md.mesh.x,md.mesh.y,'ErrorContour.exp',1);
-	pos=find(~flags); DeltaHH(pos)=0; 
+	pos=find(~flags); DeltaHH(pos)=0;
 
 	%avoid large unrealistic values
 	pos=find(DeltaHH>1); DeltaHH(pos)=1;
 	pos=find(DeltaHH<-1); DeltaHH(pos)=-1;
-	
+
 	%transform into absolute errors and setup a minimum error everywhere.
 	DeltaHH=abs(DeltaHH);
-	pos=find(DeltaHH==0); pos2=find(DeltaHH~=0); 
+	pos=find(DeltaHH==0); pos2=find(DeltaHH~=0);
 	DeltaHH(pos)=min(DeltaHH(pos2));
 
 	save Models/PIG.CrossOvers DeltaHH
-
-end
-if any(steps==3) 
-	disp('   Step 3: sampling analysis'); 
-	
+end
+
+if any(steps==3)
+	disp('   Step 3: sampling analysis');
+
 	%load model and cross over errors
 	md = loadmodel('../Pig/Models/PIG_Control_drag');
@@ -68,69 +68,61 @@
 
 	%partition the mesh
-	md.qmu.numberofpartitions=50;
-	md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,...
-	'weighting','on');
-	md.qmu.partition=md.qmu.partition-1; %switch partition to c-indexing
+	npart=50;
+	[partition,md]=partitioner(md,'package','chaco','npart',npart,'weighting','on');
+	partition=partition-1;
 
 	%make DeltaHH into our 3 sigma deviation
 	DeltaHH=DeltaHH/6; %2 (to transform DeltaHH into a radius) x 3 (for 3 sigma)
-	DeltaHH_on_partition=AreaAverageOntoPartition(md,DeltaHH);
-	DeltaHH_on_grids=DeltaHH_on_partition(md.qmu.partition+1); %just to check in case
-	
-	md.qmu.variables.thickness=normal_uncertain('scaled_Thickness',1,1);
-	md.qmu.variables.thickness.stddev=DeltaHH_on_partition;
+	DeltaHH_on_partition=AreaAverageOntoPartition(md,DeltaHH,partition);
+	DeltaHH_on_grids=DeltaHH_on_partition(partition+1); %just to check in case
+
+	md.qmu.variables.thickness=normal_uncertain('descriptor','scaled_Thickness',...
+		'mean',ones(npart,1),...
+		'stddev',DeltaHH_on_partition,...
+		'partition',partition);
 
 	%responses
-	md.qmu.responses.MassFlux1=response_function('indexed_MassFlux_1',[],...
-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux2=response_function('indexed_MassFlux_2',[],...
-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]); %grounding line
-	md.qmu.responses.MassFlux3=response_function('indexed_MassFlux_3',[],...
-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux4=response_function('indexed_MassFlux_4',[],...
-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux5=response_function('indexed_MassFlux_5',[],...
-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux6=response_function('indexed_MassFlux_6',[],...
-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux7=response_function('indexed_MassFlux_7',[],...
-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux8=response_function('indexed_MassFlux_8',[],...
-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux9=response_function('indexed_MassFlux_9',[],...
-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux10=response_function('indexed_MassFlux_10',[],...
-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux11=response_function('indexed_MassFlux_11',[],...
-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux12=response_function('indexed_MassFlux_12',[],...
-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux13=response_function('indexed_MassFlux_13',[],...
-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+	md.qmu.responses.MassFlux1=response_function('descriptor','indexed_MassFlux_1');
+	md.qmu.responses.MassFlux2=response_function('descriptor','indexed_MassFlux_2'); %grounding line
+	md.qmu.responses.MassFlux3=response_function('descriptor','indexed_MassFlux_3');
+	md.qmu.responses.MassFlux4=response_function('descriptor','indexed_MassFlux_4');
+	md.qmu.responses.MassFlux5=response_function('descriptor','indexed_MassFlux_5');
+	md.qmu.responses.MassFlux6=response_function('descriptor','indexed_MassFlux_6');
+	md.qmu.responses.MassFlux7=response_function('descriptor','indexed_MassFlux_7');
+	md.qmu.responses.MassFlux8=response_function('descriptor','indexed_MassFlux_8');
+	md.qmu.responses.MassFlux9=response_function('descriptor','indexed_MassFlux_9');
+	md.qmu.responses.MassFlux10=response_function('descriptor','indexed_MassFlux_10');
+	md.qmu.responses.MassFlux11=response_function('descriptor','indexed_MassFlux_11');
+	md.qmu.responses.MassFlux12=response_function('descriptor','indexed_MassFlux_12');
+	md.qmu.responses.MassFlux13=response_function('descriptor','indexed_MassFlux_13');
 
 	%mass flux profiles
-	md.qmu.mass_flux_profiles={'MassFlux1.exp',...
-	                           'MassFlux2.exp',...
-	                           'MassFlux3.exp',...
-	                           'MassFlux4.exp',...
-	                           'MassFlux5.exp',...
-	                           'MassFlux6.exp',...
-	                           'MassFlux7.exp',...
-	                           'MassFlux8.exp',...
-	                           'MassFlux9.exp',...
-	                           'MassFlux10.exp',...
-	                           'MassFlux11.exp',...
-	                           'MassFlux12.exp',...
-	                           'MassFlux13.exp'};
-	md.qmu.mass_flux_profile_directory='../MassFluxes/';
-
-	%%  sampling analysis
-	md.qmu.method     =dakota_method('nond_samp');
-	md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),...
-	'seed',1234,...
-	'samples',30,...
-	'sample_type','lhs'); %random or lhs
-
-	%%  a variety of parameters
+	md.qmu.mass_flux_profiles={...
+		'MassFlux1.exp',...
+		'MassFlux2.exp',...
+		'MassFlux3.exp',...
+		'MassFlux4.exp',...
+		'MassFlux5.exp',...
+		'MassFlux6.exp',...
+		'MassFlux7.exp',...
+		'MassFlux8.exp',...
+		'MassFlux9.exp',...
+		'MassFlux10.exp',...
+		'MassFlux11.exp',...
+		'MassFlux12.exp',...
+		'MassFlux13.exp'...
+	};
+	md.qmu.mass_flux_profile_directory='./MassFluxes/';
+
+	%sampling analysis
+	md.qmu.method		=dakota_method('nond_samp');
+	md.qmu.method(end)	=dmeth_params_set(...
+		md.qmu.method(end),...
+		'seed',1234,...
+		'samples',30,...
+		'sample_type','lhs'...
+	); %random or lhs
+
+	%a variety of parameters
 	md.qmu.params.direct=true;
 	md.qmu.params.analysis_driver='';
@@ -143,11 +135,11 @@
 	%Turn off verbosity
 	md.verbose=verbose(0);
-	
-	%Here, we choose to run with 4 processors, 3 for DAKOTA
+
+	%Here, we choose to run with 4 processors, 3 for Dakota
 	% while one serves as the master
 	md.cluster=generic('name',oshostname,'np',4);
 
 	%Dakota runs in parallel with a master/slave configuration.
-	% At least 2 cpu's are needed to run the UQ
+	% At least 2 CPUs are needed to run the UQ
 	md.qmu.params.evaluation_scheduling='master';
 	md.qmu.params.processors_per_evaluation=md.cluster.np-1;
@@ -157,56 +149,77 @@
 	md=solve(md,'Stressbalance','overwrite','y');
 
-	save ./Models/PIG.Sampling md; 
-end
-if any(steps==4) 
-	disp('   Step 4: sensitivity analysis'); 
-	
+	save ./Models/PIG.Sampling md;
+end
+
+if any(steps==4)
+	disp('   Step 4: plot partition');
+
+	%load model
+	md = loadmodel('./Models/PIG.Sampling');
+
+	plotmodel(md,'data','mesh','partition',partition,...
+	'linewidth',2, 'axis#all','image','unit','km','colorbar','off',...
+	'title','Partition Edges on ISSM mesh','grid','on');
+end
+
+if any(steps==5)
+	disp('   Step 5: sensitivity analysis');
+
 	%load model
 	md = loadmodel('../Pig/Models/PIG_Control_drag');
 
 	%partition the mesh
-	md.qmu.numberofpartitions=10;
-	md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
-	md.qmu.partition=md.qmu.partition-1; %switch partition to c-indexing
+	npart=10;
+	[partition,md]=partitioner(md,'package','chaco','weighting','on');
+	partition=partition-1; %switch partition to c-indexing
 
 	%all types of variables and responses: scaled_Thickness, indexed_MassFlux_i,MaxVel,nodal_DragCoefficient_i. scaled variables are expanded.
 
 	%variables
-	md.qmu.variables.DragCoefficient=normal_uncertain(...
-	'scaled_FrictionCoefficient',1,0.05);
-	md.qmu.variables.rheology_B=normal_uncertain(...
-	'scaled_MaterialsRheologyB',1,0.05);
-	md.qmu.variables.Thickness=normal_uncertain('scaled_Thickness',1,0.05);
+	md.qmu.variables.drag_coefficient=normal_uncertain('descriptor','scaled_FrictionCoefficient',...
+		'mean',ones(npart,1),...
+		'stddev',0.05*ones(npart,1),...
+		'partition',partition);
+	md.qmu.variables.rheology_B=normal_uncertain('descriptor','scaled_MaterialsRheologyB',...
+		'mean',ones(npart,1),...
+		'stddev',0.05*ones(npart,1),...
+		'partition',partition);
+	md.qmu.variables.thickness=normal_uncertain('descriptor','scaled_Thickness',...
+		'mean',ones(npart,1),...
+		'stddev',0.05*ones(npart,1),...
+		'partition',partition);
 
 	%responses
-	md.qmu.responses.MassFlux1=response_function('indexed_MassFlux_1',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux2=response_function('indexed_MassFlux_2',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux3=response_function('indexed_MassFlux_3',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux4=response_function('indexed_MassFlux_4',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux5=response_function('indexed_MassFlux_5',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux6=response_function('indexed_MassFlux_6',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux7=response_function('indexed_MassFlux_7',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux8=response_function('indexed_MassFlux_8',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux9=response_function('indexed_MassFlux_9',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux10=response_function('indexed_MassFlux_10',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux11=response_function('indexed_MassFlux_11',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux12=response_function('indexed_MassFlux_12',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-	md.qmu.responses.MassFlux13=response_function('indexed_MassFlux_13',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+	md.qmu.responses.MassFlux1=response_function('descriptor','indexed_MassFlux_1');
+	md.qmu.responses.MassFlux2=response_function('descriptor','indexed_MassFlux_2');
+	md.qmu.responses.MassFlux3=response_function('descriptor','indexed_MassFlux_3');
+	md.qmu.responses.MassFlux4=response_function('descriptor','indexed_MassFlux_4');
+	md.qmu.responses.MassFlux5=response_function('descriptor','indexed_MassFlux_5');
+	md.qmu.responses.MassFlux6=response_function('descriptor','indexed_MassFlux_6');
+	md.qmu.responses.MassFlux7=response_function('descriptor','indexed_MassFlux_7');
+	md.qmu.responses.MassFlux8=response_function('descriptor','indexed_MassFlux_8');
+	md.qmu.responses.MassFlux9=response_function('descriptor','indexed_MassFlux_9');
+	md.qmu.responses.MassFlux10=response_function('descriptor','indexed_MassFlux_10');
+	md.qmu.responses.MassFlux11=response_function('descriptor','indexed_MassFlux_11');
+	md.qmu.responses.MassFlux12=response_function('descriptor','indexed_MassFlux_12');
+	md.qmu.responses.MassFlux13=response_function('descriptor','indexed_MassFlux_13');
 
 	%mass flux profiles
-	md.qmu.mass_flux_profiles={'MassFlux1.exp',...
-	                           'MassFlux2.exp',...
-	                           'MassFlux3.exp',...
-	                           'MassFlux4.exp',...
-	                           'MassFlux5.exp',...
-	                           'MassFlux6.exp',...
-	                           'MassFlux7.exp',...
-	                           'MassFlux8.exp',...
-	                           'MassFlux9.exp',...
-	                           'MassFlux10.exp',...
-	                           'MassFlux11.exp',...
-	                           'MassFlux12.exp',...
-	                           'MassFlux13.exp'};
-	md.qmu.mass_flux_profile_directory='../MassFluxes/';
+	md.qmu.mass_flux_profiles={...
+		'MassFlux1.exp',...
+		'MassFlux2.exp',...
+		'MassFlux3.exp',...
+		'MassFlux4.exp',...
+		'MassFlux5.exp',...
+		'MassFlux6.exp',...
+		'MassFlux7.exp',...
+		'MassFlux8.exp',...
+		'MassFlux9.exp',...
+		'MassFlux10.exp',...
+		'MassFlux11.exp',...
+		'MassFlux12.exp',...
+		'MassFlux13.exp'...
+	};
+	md.qmu.mass_flux_profile_directory='./MassFluxes/';
 
 	%method: local reliability
@@ -224,10 +237,10 @@
 	md.stressbalance.restol=10^-5; %tighten for qmu analyses
 
-	%Here, we choose to run with 2 processors, 1 for DAKOTA
+	%Here, we choose to run with 2 processors, 1 for Dakota
 	% while one serves as the master
 	md.cluster=generic('name',oshostname,'np',2);
-	
+
 	%Dakota runs in parallel with a master/slave configuration.
-	% At least 2 cpu's are needed to run the UQ
+	% At least 2 CPUs are needed to run the UQ
 	md.qmu.params.evaluation_scheduling='master';
 	md.qmu.params.processors_per_evaluation=md.cluster.np-1;
@@ -238,40 +251,30 @@
 	md.verbose=verbose('qmu',true);
 	md=solve(md,'Stressbalance','overwrite','y');
-	
-	save ./Models/PIG.Sensitivity md; 
-end
-if any(steps==5) 
-	disp('   Step 5: plot partition');
-	
+
+	save ./Models/PIG.Sensitivity md;
+end
+
+if any(steps==6)
+	disp('   Step 6: plot histogram');
+
 	%load model
 	md = loadmodel('./Models/PIG.Sampling');
-	
-	plotmodel(md,'data','mesh','partitionedges','on',...
-	'linewidth',2, 'axis#all','image','unit','km','colorbar','off',...
-	'title','Partition Edges on ISSM mesh','grid','on');
-
-end 
-if any(steps==6) 
-	disp('   Step 6: plot histogram'); 
-	
-	%load model
-	md = loadmodel('./Models/PIG.Sampling');
 
 	%which profile are we looking at?
-	index=1; 	
+	index=1;
 
 	%retrieve results for the specific profile, mass flux in m^3 water equiv/s
-	result=md.results.dakota.dresp_dat(md.qmu.numberofpartitions+index);
+	result=md.results.dakota.dresp_dat(npart+index);
 	result.sample=result.sample/1e12*60*60*24*365;
-		
+
 	%plot histogram
 	plot_hist_norm(result,'cdfleg','off','cdfplt','off','nrmplt','off',...
 	'xlabelplt','M (Gt/yr)','ylabelplt','F','FontSize',8,'FaceColor',...
 	'none','EdgeColor','red');
-
-end
-if any(steps==7) 
-	disp('   Step 7: plot sensitivity'); 
-	
+end
+
+if any(steps==7)
+	disp('   Step 7: plot sensitivity');
+
 	%load model
 	md = loadmodel('./Models/PIG.Sensitivity');
@@ -280,10 +283,10 @@
 
 	%which profile are we looking at?
-	index=1; 	
+	index=1;
 
 	%To plot sensitivities
-	sa=md.results.dakota.dresp_out(index).sens(1:10); sa=sa(md.qmu.partition+1)/1e12*60*60*24*365;
-	sb=md.results.dakota.dresp_out(index).sens(11:20); sb=sb(md.qmu.partition+1)/1e12*60*60*24*365;
-	sh=md.results.dakota.dresp_out(index).sens(21:30); sh=sh(md.qmu.partition+1)/1e12*60*60*24*365;
+	sa=md.results.dakota.dresp_out(index).sens(1:10); sa=sa(partition+1)/1e12*60*60*24*365;
+	sb=md.results.dakota.dresp_out(index).sens(11:20); sb=sb(partition+1)/1e12*60*60*24*365;
+	sh=md.results.dakota.dresp_out(index).sens(21:30); sh=sh(partition+1)/1e12*60*60*24*365;
 
 	plotmodel(md,'data',sh,'data',sa,'data',sb,'expdisp#all',...
@@ -291,4 +294,5 @@
 		'expstyle#all','b-','linewidth#all',2,...
 		'nlines',3,'ncols',1, 'axis#all','image',...
+		'caxis#1',[0 150],'caxis#2',[-20 0],'caxis#3',[-25 0],...
 		'colorbar#all','on','colorbarfontsize#all',10,...
 		'colorbartitle#1','S_{H}', 'colorbartitle#2','S_{\alpha}',...
@@ -297,7 +301,7 @@
 
 	%To plot importance factors
-	ifa=importancefactors(md,'scaled_FrictionCoefficient',['indexed_MassFlux_' num2str(index)]);
-	ifb=importancefactors(md,'scaled_MaterialsRheologyB',['indexed_MassFlux_' num2str(index)]);
-	ifh=importancefactors(md,'scaled_Thickness',['indexed_MassFlux_' num2str(index)]);
+	ifa=importancefactors(md,'scaled_FrictionCoefficient',['indexed_MassFlux_' num2str(index)],partition);
+	ifb=importancefactors(md,'scaled_MaterialsRheologyB',['indexed_MassFlux_' num2str(index)],partition);
+	ifh=importancefactors(md,'scaled_Thickness',['indexed_MassFlux_' num2str(index)],partition);
 
 	plotmodel(md,'data',ifh,'data',ifa,'data',ifb,'expdisp#all',...
@@ -309,4 +313,3 @@
 		'colorbartitle#3','If_{B}','unit#all','km','figure',2,...
 		'title','Importance Factors: H, \alpha, B');
-
-end
+end
Index: /issm/trunk/examples/shakti/moulin.py
===================================================================
--- /issm/trunk/examples/shakti/moulin.py	(revision 26743)
+++ /issm/trunk/examples/shakti/moulin.py	(revision 26744)
@@ -18,5 +18,5 @@
 # Materials
 # Ice flow law parameter (note that the standard parameter A = B^(- 3))
-md.materials.rheology_B = 5e-25**(-1 / 3) * np.ones(md.mesh.numberofvertices)
+md.materials.rheology_B = 5e-25**(-1. / 3.) * np.ones(md.mesh.numberofvertices)
 md.initialization.temperature = 273. * np.ones(md.mesh.numberofvertices)
 md.materials.rheology_n = 3. * np.ones(md.mesh.numberofelements)
Index: /issm/trunk/examples/shakti/runme.m
===================================================================
--- /issm/trunk/examples/shakti/runme.m	(revision 26743)
+++ /issm/trunk/examples/shakti/runme.m	(revision 26744)
@@ -1,5 +1,5 @@
 steps=[1:3];
 
-if any(steps==1)
+if any(steps==1) 
 	disp('	Step 1: Mesh');
 
@@ -8,6 +8,7 @@
 
 	save MoulinMesh md
-end
-if any(steps==2)
+end 
+
+if any(steps==2) 
 	disp('	Step 2: Parameterization');
 	md=loadmodel('MoulinMesh');
@@ -21,5 +22,5 @@
 	% Change hydrology class to Sommers' SHaKTI model
 	md.hydrology=hydrologyshakti();
-	
+
 	% Define initial water head such that water pressure is 50% of ice overburden pressure
 	md.hydrology.head = 0.5*md.materials.rho_ice/md.materials.rho_freshwater*md.geometry.thickness + md.geometry.base;
@@ -48,6 +49,7 @@
 
 	save MoulinParam md;
-end
-if any(steps==3);
+end 
+
+if any(steps==3) 
 	disp('	Step 3: Solve!');
 	md=loadmodel('MoulinParam');
@@ -80,3 +82,3 @@
 
 	save MoulinTransient md
-end
+end 
Index: sm/trunk/externalpackages/autotools/install-debian-linux.sh
===================================================================
--- /issm/trunk/externalpackages/autotools/install-debian-linux.sh	(revision 26743)
+++ 	(revision )
@@ -1,94 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-AUTOCONF_VER="2.69"
-AUTOMAKE_VER="1.16.1"
-LIBTOOL_VER="2.4.2"
-M4_VER="1.4.18"
-
-## Environment
-#
-export PATH="${ISSM_DIR}/externalpackages/autotools/install/bin:$PATH"
-
-# Cleanup
-rm -rf install src
-mkdir install
-
-# Install m4
-echo " === INSTALLING M4 =="
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m4-${M4_VER}.tar.gz" "m4-${M4_VER}.tar.gz"
-tar -zxvf m4-${M4_VER}.tar.gz
-mv m4-${M4_VER} src
-cd src
-
-## Fixes required by glibc-2.28
-#
-# Source: http://www.linuxfromscratch.org/lfs/view/development/chapter06/m4.html
-#
-sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
-echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
-
-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
-
-# Install Autoconf
-echo " === INSTALLING AUTOCONF =="
-rm -rf src
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/autoconf-${AUTOCONF_VER}.tar.gz" "autoconf-${AUTOCONF_VER}.tar.gz"
-tar -zxvf autoconf-${AUTOCONF_VER}.tar.gz
-mv autoconf-${AUTOCONF_VER} src
-cd src
-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
-
-# Install Automake
-echo " === INSTALLING AUTOMAKE =="
-rm -rf src
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/automake-${AUTOMAKE_VER}.tar.gz" "automake-${AUTOMAKE_VER}.tar.gz"
-tar -zxvf automake-${AUTOMAKE_VER}.tar.gz
-mv automake-${AUTOMAKE_VER} src
-cd src
-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
-
-# Install libtool
-echo " === INSTALLING LIBTOOL =="
-rm -rf src
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/libtool-${LIBTOOL_VER}.tar.gz" "libtool-${LIBTOOL_VER}.tar.gz"
-tar -zxvf libtool-${LIBTOOL_VER}.tar.gz
-rm libtool-${LIBTOOL_VER}.tar.gz
-mv libtool-${LIBTOOL_VER} src
-cd src
-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: /issm/trunk/externalpackages/autotools/install-linux.sh
===================================================================
--- /issm/trunk/externalpackages/autotools/install-linux.sh	(revision 26744)
+++ /issm/trunk/externalpackages/autotools/install-linux.sh	(revision 26744)
@@ -0,0 +1,94 @@
+#!/bin/bash
+set -eu
+
+
+## Constants
+#
+AUTOCONF_VER="2.69"
+AUTOMAKE_VER="1.16.1"
+LIBTOOL_VER="2.4.2"
+M4_VER="1.4.19"
+
+PREFIX="${ISSM_DIR}/externalpackages/autotools/install" # Set to location where external package should be installed
+
+## Environment
+#
+export PATH="${PREFIX}/bin:${PATH}"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX}
+
+# Install m4
+echo " === INSTALLING M4 ==="
+${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m4-${M4_VER}.tar.gz" "m4-${M4_VER}.tar.gz"
+tar -zxvf m4-${M4_VER}.tar.gz
+mv m4-${M4_VER} src
+cd src
+
+## Fixes required by glibc-2.28
+#
+# Source: http://www.linuxfromscratch.org/lfs/view/development/chapter06/m4.html
+#
+sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
+echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
+
+./configure --prefix="${PREFIX}"
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+cd ..
+
+# Install Autoconf
+echo " === INSTALLING AUTOCONF ==="
+rm -rf src
+${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/autoconf-${AUTOCONF_VER}.tar.gz" "autoconf-${AUTOCONF_VER}.tar.gz"
+tar -zxvf autoconf-${AUTOCONF_VER}.tar.gz
+mv autoconf-${AUTOCONF_VER} src
+cd src
+./configure --prefix="${PREFIX}"
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+cd ..
+# Install Automake
+echo " === INSTALLING AUTOMAKE ==="
+rm -rf src
+${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/automake-${AUTOMAKE_VER}.tar.gz" "automake-${AUTOMAKE_VER}.tar.gz"
+tar -zxvf automake-${AUTOMAKE_VER}.tar.gz
+mv automake-${AUTOMAKE_VER} src
+cd src
+./configure --prefix="${PREFIX}"
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+cd ..
+
+# Install libtool
+echo " === INSTALLING LIBTOOL ==="
+rm -rf src
+${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/libtool-${LIBTOOL_VER}.tar.gz" "libtool-${LIBTOOL_VER}.tar.gz"
+tar -zxvf libtool-${LIBTOOL_VER}.tar.gz
+mv libtool-${LIBTOOL_VER} src
+cd src
+./configure --prefix="${PREFIX}"
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+cd ..
Index: /issm/trunk/externalpackages/autotools/install-mac.sh
===================================================================
--- /issm/trunk/externalpackages/autotools/install-mac.sh	(revision 26744)
+++ /issm/trunk/externalpackages/autotools/install-mac.sh	(revision 26744)
@@ -0,0 +1,88 @@
+#!/bin/bash
+set -eu
+
+
+## Constants
+#
+AUTOCONF_VER="2.69"
+AUTOMAKE_VER="1.16.1"
+LIBTOOL_VER="2.4.2"
+M4_VER="1.4.19"
+
+PREFIX="${ISSM_DIR}/externalpackages/autotools/install" # Set to location where external package should be installed
+
+## Environment
+#
+export PATH="${PREFIX}/bin:${PATH}"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX}
+
+# Install m4
+echo " === INSTALLING M4 ==="
+${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m4-${M4_VER}.tar.gz" "m4-${M4_VER}.tar.gz"
+tar -zxvf m4-${M4_VER}.tar.gz
+mv m4-${M4_VER} src
+cd src
+
+./configure --prefix="${PREFIX}"
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+cd ..
+
+# Install Autoconf
+echo " === INSTALLING AUTOCONF =="
+rm -rf src
+${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/autoconf-${AUTOCONF_VER}.tar.gz" "autoconf-${AUTOCONF_VER}.tar.gz"
+tar -zxvf autoconf-${AUTOCONF_VER}.tar.gz
+mv autoconf-${AUTOCONF_VER} src
+cd src
+./configure --prefix="${PREFIX}"
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+cd ..
+
+# Install Automake
+echo " === INSTALLING AUTOMAKE ==="
+rm -rf src
+${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/automake-${AUTOMAKE_VER}.tar.gz" "automake-${AUTOMAKE_VER}.tar.gz"
+tar -zxvf automake-${AUTOMAKE_VER}.tar.gz
+mv automake-${AUTOMAKE_VER} src
+cd src
+./configure --prefix="${PREFIX}"
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+cd ..
+
+# Install libtool
+echo " === INSTALLING LIBTOOL ==="
+rm -rf src
+${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/libtool-${LIBTOOL_VER}.tar.gz" "libtool-${LIBTOOL_VER}.tar.gz"
+tar -zxvf libtool-${LIBTOOL_VER}.tar.gz
+mv libtool-${LIBTOOL_VER} src
+cd src
+./configure --prefix="${PREFIX}"
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+cd ..
Index: /issm/trunk/externalpackages/autotools/install-win.sh
===================================================================
--- /issm/trunk/externalpackages/autotools/install-win.sh	(revision 26743)
+++ /issm/trunk/externalpackages/autotools/install-win.sh	(revision 26744)
@@ -2,76 +2,89 @@
 set -eu
 
+
+## Constants
+#
 AUTOCONF_VER="2.69"
 AUTOMAKE_MIN_VER="1.16"
-AUTOMAKE_BUILD_VER="${AUTOMAKE_MIN_VER}.1"
+AUTOMAKE_VER="${AUTOMAKE_MIN_VER}.1"
 LIBTOOL_VER="2.4.2"
-M4_VER="1.4.17"
+M4_VER="1.4.19"
 
-AUTOCONF="autoconf-${AUTOCONF_VER}"
-AUTOMAKE="automake-${AUTOMAKE_BUILD_VER}"
-LIBTOOL="libtool-${LIBTOOL_VER}"
-M4="m4-${M4_VER}"
+PREFIX="${ISSM_DIR}/externalpackages/autotools/install" # Set to location where external package should be installed
 
-AUTOCONF_TARBALL="${AUTOCONF}.tar.gz"
-AUTOMAKE_TARBALL="${AUTOMAKE}.tar.gz"
-LIBTOOL_TARBALL="${LIBTOOL}.tar.gz"
-M4_TARBALL="${M4}.tar.gz"
+## Environment
+#
+export PATH="${PREFIX}/bin:${PATH}"
 
-# Clean up existing assets
-rm -rf install src
-
-# Set up for installation
-mkdir install
-export PATH="$ISSM_DIR/externalpackages/autotools/install/bin:$PATH"
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX}
 
 # Install m4
-echo " === INSTALLING M4 =="
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${M4_TARBALL}" $M4_TARBALL
-tar -zxvf $M4_TARBALL
-rm -f $M4_TARBALL
-mv $M4 src
+echo " === INSTALLING M4 ==="
+${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m4-${M4_VER}.tar.gz" "m4-${M4_VER}.tar.gz"
+tar -zxvf m4-${M4_VER}.tar.gz
+mv m4-${M4_VER} src
 cd src
-./configure --prefix="$ISSM_DIR/externalpackages/autotools/install"
-make
-make install
+
+./configure --prefix="${PREFIX}"
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
 cd ..
 
-# Install autoconf
+# Install Autoconf
 echo " === INSTALLING AUTOCONF =="
 rm -rf src
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${AUTOCONF_TARBALL}" $AUTOCONF_TARBALL
-tar -zxvf $AUTOCONF_TARBALL
-rm -f $AUTOCONF_TARBALL
-mv $AUTOCONF src
+${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/autoconf-${AUTOCONF_VER}.tar.gz" "autoconf-${AUTOCONF_VER}.tar.gz"
+tar -zxvf autoconf-${AUTOCONF_VER}.tar.gz
+mv autoconf-${AUTOCONF_VER} src
 cd src
-./configure --prefix="$ISSM_DIR/externalpackages/autotools/install"
-make
-make install
+./configure --prefix="${PREFIX}"
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
 cd ..
 
-# Install automake
-echo " === INSTALLING AUTOMAKE =="
+# Install Automake
+echo " === INSTALLING AUTOMAKE ==="
 rm -rf src
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${AUTOMAKE_TARBALL}" $AUTOMAKE_TARBALL
-tar -zxvf $AUTOMAKE_TARBALL
-rm -f $AUTOMAKE_TARBALL
-mv $AUTOMAKE src
+${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/automake-${AUTOMAKE_VER}.tar.gz" "automake-${AUTOMAKE_VER}.tar.gz"
+tar -zxvf automake-${AUTOMAKE_VER}.tar.gz
+mv automake-${AUTOMAKE_VER} src
 cd src
-./configure --prefix="$ISSM_DIR/externalpackages/autotools/install"
-make
-make install
+./configure --prefix="${PREFIX}"
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
 cd ..
 
 # Install libtool
-echo " === INSTALLING LIBTOOL =="
+echo " === INSTALLING LIBTOOL ==="
 rm -rf src
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${LIBTOOL_TARBALL}" $LIBTOOL_TARBALL
-tar -zxvf $LIBTOOL_TARBALL
-rm -f $LIBTOOL_TARBALL
-mv $LIBTOOL src
+${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/libtool-${LIBTOOL_VER}.tar.gz" "libtool-${LIBTOOL_VER}.tar.gz"
+tar -zxvf libtool-${LIBTOOL_VER}.tar.gz
+mv libtool-${LIBTOOL_VER} src
 cd src
-./configure --prefix="$ISSM_DIR/externalpackages/autotools/install"
-make
-make install
+./configure --prefix="${PREFIX}"
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
 cd ..
 
Index: sm/trunk/externalpackages/autotools/install.sh
===================================================================
--- /issm/trunk/externalpackages/autotools/install.sh	(revision 26743)
+++ 	(revision )
@@ -1,67 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## Constants
-#
-AUTOCONF_VER="2.69"
-AUTOMAKE_VER="1.16.1"
-LIBTOOL_VER="2.4.2"
-M4_VER="1.4.18"
-
-## Environment
-#
-export PATH="${ISSM_DIR}/externalpackages/autotools/install/bin:$PATH"
-
-# Cleanup
-rm -rf install src
-mkdir install
-
-# Install m4
-echo " === INSTALLING M4 =="
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m4-${M4_VER}.tar.gz" "m4-${M4_VER}.tar.gz"
-tar -zxvf m4-${M4_VER}.tar.gz
-mv m4-${M4_VER} src
-cd src
-
-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
-make
-make install
-cd ..
-
-# Install Autoconf
-echo " === INSTALLING AUTOCONF =="
-rm -rf src
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/autoconf-${AUTOCONF_VER}.tar.gz" "autoconf-${AUTOCONF_VER}.tar.gz"
-tar -zxvf autoconf-${AUTOCONF_VER}.tar.gz
-mv autoconf-${AUTOCONF_VER} src
-cd src
-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
-make
-make install
-cd ..
-
-# Install Automake
-echo " === INSTALLING AUTOMAKE =="
-rm -rf src
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/automake-${AUTOMAKE_VER}.tar.gz" "automake-${AUTOMAKE_VER}.tar.gz"
-tar -zxvf automake-${AUTOMAKE_VER}.tar.gz
-mv automake-${AUTOMAKE_VER} src
-cd src
-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
-make
-make install
-cd ..
-
-# Install libtool
-echo " === INSTALLING LIBTOOL =="
-rm -rf src
-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/libtool-${LIBTOOL_VER}.tar.gz" "libtool-${LIBTOOL_VER}.tar.gz"
-tar -zxvf libtool-${LIBTOOL_VER}.tar.gz
-rm libtool-${LIBTOOL_VER}.tar.gz
-mv libtool-${LIBTOOL_VER} src
-cd src
-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
-make
-make install
-cd ..
Index: /issm/trunk/externalpackages/blas/configs/3.8/win/msys2/gcc/Makefile
===================================================================
--- /issm/trunk/externalpackages/blas/configs/3.8/win/msys2/gcc/Makefile	(revision 26744)
+++ /issm/trunk/externalpackages/blas/configs/3.8/win/msys2/gcc/Makefile	(revision 26744)
@@ -0,0 +1,172 @@
+include make.inc
+
+#######################################################################
+#  This is the makefile to create a library for the BLAS.
+#  The files are grouped as follows:
+#
+#       SBLAS1 -- Single precision real BLAS routines
+#       CBLAS1 -- Single precision complex BLAS routines
+#       DBLAS1 -- Double precision real BLAS routines
+#       ZBLAS1 -- Double precision complex BLAS routines
+#
+#       CB1AUX -- Real BLAS routines called by complex routines
+#       ZB1AUX -- D.P. real BLAS routines called by d.p. complex
+#                 routines
+#
+#      ALLBLAS -- Auxiliary routines for Level 2 and 3 BLAS
+#
+#       SBLAS2 -- Single precision real BLAS2 routines
+#       CBLAS2 -- Single precision complex BLAS2 routines
+#       DBLAS2 -- Double precision real BLAS2 routines
+#       ZBLAS2 -- Double precision complex BLAS2 routines
+#
+#       SBLAS3 -- Single precision real BLAS3 routines
+#       CBLAS3 -- Single precision complex BLAS3 routines
+#       DBLAS3 -- Double precision real BLAS3 routines
+#       ZBLAS3 -- Double precision complex BLAS3 routines
+#
+#  The library can be set up to include routines for any combination
+#  of the four precisions.  To create or add to the library, enter make
+#  followed by one or more of the precisions desired.  Some examples:
+#       make single
+#       make single complex
+#       make single double complex complex16
+#  Note that these commands are not safe for parallel builds.
+#
+#  Alternatively, the commands
+#       make all
+#  or
+#       make
+#  without any arguments creates a library of all four precisions.
+#  The name of the library is held in BLASLIB, which is set in the
+#  make.inc
+#
+#  To remove the object files after the library is created, enter
+#       make clean
+#  To force the source files to be recompiled, enter, for example,
+#       make single FRC=FRC
+#
+#---------------------------------------------------------------------
+#
+#  Edward Anderson, University of Tennessee
+#  March 26, 1990
+#  Susan Ostrouchov,  September 30, 1994
+#  Julie Langou, March 2007
+#
+#######################################################################
+
+all: $(BLASLIB)
+ 
+#---------------------------------------------------------
+#  Comment out the next 6 definitions if you already have
+#  the Level 1 BLAS.
+#---------------------------------------------------------
+SBLAS1 = isamax.o sasum.o saxpy.o scopy.o sdot.o snrm2.o \
+	srot.o srotg.o sscal.o sswap.o sdsdot.o srotmg.o srotm.o
+$(SBLAS1): $(FRC)
+
+CBLAS1 = scabs1.o scasum.o scnrm2.o icamax.o caxpy.o ccopy.o \
+	cdotc.o cdotu.o csscal.o crotg.o cscal.o cswap.o csrot.o
+$(CBLAS1): $(FRC)
+
+DBLAS1 = idamax.o dasum.o daxpy.o dcopy.o ddot.o dnrm2.o \
+	drot.o drotg.o dscal.o dsdot.o dswap.o drotmg.o drotm.o
+$(DBLAS1): $(FRC)
+
+ZBLAS1 = dcabs1.o dzasum.o dznrm2.o izamax.o zaxpy.o zcopy.o \
+	zdotc.o zdotu.o zdscal.o zrotg.o zscal.o zswap.o zdrot.o
+$(ZBLAS1): $(FRC)
+
+CB1AUX = isamax.o sasum.o saxpy.o scopy.o snrm2.o sscal.o
+$(CB1AUX): $(FRC)
+
+ZB1AUX = idamax.o dasum.o daxpy.o dcopy.o dnrm2.o dscal.o
+$(ZB1AUX): $(FRC)
+
+#---------------------------------------------------------------------
+#  The following line defines auxiliary routines needed by both the
+#  Level 2 and Level 3 BLAS.  Comment it out only if you already have
+#  both the Level 2 and 3 BLAS.
+#---------------------------------------------------------------------
+ALLBLAS  = lsame.o xerbla.o
+$(ALLBLAS) : $(FRC)
+
+#---------------------------------------------------------
+#  Comment out the next 4 definitions if you already have
+#  the Level 2 BLAS.
+#---------------------------------------------------------
+SBLAS2 = sgemv.o sgbmv.o ssymv.o ssbmv.o sspmv.o \
+	strmv.o stbmv.o stpmv.o strsv.o stbsv.o stpsv.o \
+	sger.o ssyr.o sspr.o ssyr2.o sspr2.o
+$(SBLAS2): $(FRC)
+
+CBLAS2 = cgemv.o cgbmv.o chemv.o chbmv.o chpmv.o \
+	ctrmv.o ctbmv.o ctpmv.o ctrsv.o ctbsv.o ctpsv.o \
+	cgerc.o cgeru.o cher.o chpr.o cher2.o chpr2.o
+$(CBLAS2): $(FRC)
+
+DBLAS2 = dgemv.o dgbmv.o dsymv.o dsbmv.o dspmv.o \
+	dtrmv.o dtbmv.o dtpmv.o dtrsv.o dtbsv.o dtpsv.o \
+	dger.o dsyr.o dspr.o dsyr2.o dspr2.o
+$(DBLAS2): $(FRC)
+
+ZBLAS2 = zgemv.o zgbmv.o zhemv.o zhbmv.o zhpmv.o \
+	ztrmv.o ztbmv.o ztpmv.o ztrsv.o ztbsv.o ztpsv.o \
+	zgerc.o zgeru.o zher.o zhpr.o zher2.o zhpr2.o
+$(ZBLAS2): $(FRC)
+
+#---------------------------------------------------------
+#  Comment out the next 4 definitions if you already have
+#  the Level 3 BLAS.
+#---------------------------------------------------------
+SBLAS3 = sgemm.o ssymm.o ssyrk.o ssyr2k.o strmm.o strsm.o 
+$(SBLAS3): $(FRC)
+
+CBLAS3 = cgemm.o csymm.o csyrk.o csyr2k.o ctrmm.o ctrsm.o \
+	chemm.o cherk.o cher2k.o
+$(CBLAS3): $(FRC)
+
+DBLAS3 = dgemm.o dsymm.o dsyrk.o dsyr2k.o dtrmm.o dtrsm.o
+$(DBLAS3): $(FRC)
+
+ZBLAS3 = zgemm.o zsymm.o zsyrk.o zsyr2k.o ztrmm.o ztrsm.o \
+	zhemm.o zherk.o zher2k.o
+$(ZBLAS3): $(FRC)
+
+ALLOBJ=$(SBLAS1) $(SBLAS2) $(SBLAS3) $(DBLAS1) $(DBLAS2) $(DBLAS3) \
+	$(CBLAS1) $(CBLAS2) $(CBLAS3) $(ZBLAS1) \
+	$(ZBLAS2) $(ZBLAS3) $(ALLBLAS)
+
+$(BLASLIB): $(ALLOBJ)
+	$(FORTRAN) -shared -o $@ \
+		$(ALLOBJ) \
+		-Wl,--out-implib=$(IMP_LIB_NAME)
+
+single: $(SBLAS1) $(ALLBLAS) $(SBLAS2) $(SBLAS3)
+	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(SBLAS1) $(ALLBLAS) \
+	$(SBLAS2) $(SBLAS3)
+	$(RANLIB) $(BLASLIB)
+
+double: $(DBLAS1) $(ALLBLAS) $(DBLAS2) $(DBLAS3)
+	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(DBLAS1) $(ALLBLAS) \
+	$(DBLAS2) $(DBLAS3)
+	$(RANLIB) $(BLASLIB)
+
+complex: $(CBLAS1) $(CB1AUX) $(ALLBLAS) $(CBLAS2) $(CBLAS3)
+	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(CBLAS1) $(CB1AUX) \
+	$(ALLBLAS) $(CBLAS2) $(CBLAS3)
+	$(RANLIB) $(BLASLIB)
+
+complex16: $(ZBLAS1) $(ZB1AUX) $(ALLBLAS) $(ZBLAS2) $(ZBLAS3)
+	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(ZBLAS1) $(ZB1AUX) \
+	$(ALLBLAS) $(ZBLAS2) $(ZBLAS3)
+	$(RANLIB) $(BLASLIB)
+
+FRC:
+	@FRC=$(FRC)
+
+clean:
+	rm -f *.o
+
+.f.o: 
+	$(FORTRAN) $(OPTS) -c $< -o $@
Index: /issm/trunk/externalpackages/blas/configs/3.8/win/msys2/gcc/make.inc
===================================================================
--- /issm/trunk/externalpackages/blas/configs/3.8/win/msys2/gcc/make.inc	(revision 26744)
+++ /issm/trunk/externalpackages/blas/configs/3.8/win/msys2/gcc/make.inc	(revision 26744)
@@ -0,0 +1,38 @@
+####################################################################
+#  BLAS make include file.                                         #
+#  March 2007                                                      #
+####################################################################
+#
+SHELL = /usr/bin/bash
+#
+#  The machine (platform) identifier to append to the library names
+#
+PLAT =
+#  
+#  Modify the FORTRAN and OPTS definitions to refer to the
+#  compiler and desired compiler options for your machine.  NOOPT
+#  refers to the compiler options desired when NO OPTIMIZATION is
+#  selected.  Define LOADER and LOADOPTS to refer to the loader and 
+#  desired load options for your machine.
+#
+FORTRAN  = gfortran
+OPTS     = -O2 -fPIC
+DRVOPTS  = $(OPTS)
+NOOPT    = -O0 -fPIC
+LOADER   = gfortran
+LOADOPTS =
+#
+#  The archiver and the flag(s) to use when building archive (library)
+#  If you system has no ranlib, set RANLIB = echo.
+#
+ARCH     = ar
+ARCHFLAGS= cr
+RANLIB   = ranlib
+
+MODULE			= blas
+IMP_LIB_NAME	= lib$(MODULE).dll.a
+LIB_NAME		= msys-$(MODULE).dll
+#
+#  The location and name of the Reference BLAS library.
+#
+BLASLIB = $(LIB_NAME)
Index: /issm/trunk/externalpackages/blas/configs/3.8/win/msys2/mingw64/Makefile
===================================================================
--- /issm/trunk/externalpackages/blas/configs/3.8/win/msys2/mingw64/Makefile	(revision 26744)
+++ /issm/trunk/externalpackages/blas/configs/3.8/win/msys2/mingw64/Makefile	(revision 26744)
@@ -0,0 +1,172 @@
+include make.inc
+
+#######################################################################
+#  This is the makefile to create a library for the BLAS.
+#  The files are grouped as follows:
+#
+#       SBLAS1 -- Single precision real BLAS routines
+#       CBLAS1 -- Single precision complex BLAS routines
+#       DBLAS1 -- Double precision real BLAS routines
+#       ZBLAS1 -- Double precision complex BLAS routines
+#
+#       CB1AUX -- Real BLAS routines called by complex routines
+#       ZB1AUX -- D.P. real BLAS routines called by d.p. complex
+#                 routines
+#
+#      ALLBLAS -- Auxiliary routines for Level 2 and 3 BLAS
+#
+#       SBLAS2 -- Single precision real BLAS2 routines
+#       CBLAS2 -- Single precision complex BLAS2 routines
+#       DBLAS2 -- Double precision real BLAS2 routines
+#       ZBLAS2 -- Double precision complex BLAS2 routines
+#
+#       SBLAS3 -- Single precision real BLAS3 routines
+#       CBLAS3 -- Single precision complex BLAS3 routines
+#       DBLAS3 -- Double precision real BLAS3 routines
+#       ZBLAS3 -- Double precision complex BLAS3 routines
+#
+#  The library can be set up to include routines for any combination
+#  of the four precisions.  To create or add to the library, enter make
+#  followed by one or more of the precisions desired.  Some examples:
+#       make single
+#       make single complex
+#       make single double complex complex16
+#  Note that these commands are not safe for parallel builds.
+#
+#  Alternatively, the commands
+#       make all
+#  or
+#       make
+#  without any arguments creates a library of all four precisions.
+#  The name of the library is held in BLASLIB, which is set in the
+#  make.inc
+#
+#  To remove the object files after the library is created, enter
+#       make clean
+#  To force the source files to be recompiled, enter, for example,
+#       make single FRC=FRC
+#
+#---------------------------------------------------------------------
+#
+#  Edward Anderson, University of Tennessee
+#  March 26, 1990
+#  Susan Ostrouchov,  September 30, 1994
+#  Julie Langou, March 2007
+#
+#######################################################################
+
+all: $(BLASLIB)
+ 
+#---------------------------------------------------------
+#  Comment out the next 6 definitions if you already have
+#  the Level 1 BLAS.
+#---------------------------------------------------------
+SBLAS1 = isamax.o sasum.o saxpy.o scopy.o sdot.o snrm2.o \
+	srot.o srotg.o sscal.o sswap.o sdsdot.o srotmg.o srotm.o
+$(SBLAS1): $(FRC)
+
+CBLAS1 = scabs1.o scasum.o scnrm2.o icamax.o caxpy.o ccopy.o \
+	cdotc.o cdotu.o csscal.o crotg.o cscal.o cswap.o csrot.o
+$(CBLAS1): $(FRC)
+
+DBLAS1 = idamax.o dasum.o daxpy.o dcopy.o ddot.o dnrm2.o \
+	drot.o drotg.o dscal.o dsdot.o dswap.o drotmg.o drotm.o
+$(DBLAS1): $(FRC)
+
+ZBLAS1 = dcabs1.o dzasum.o dznrm2.o izamax.o zaxpy.o zcopy.o \
+	zdotc.o zdotu.o zdscal.o zrotg.o zscal.o zswap.o zdrot.o
+$(ZBLAS1): $(FRC)
+
+CB1AUX = isamax.o sasum.o saxpy.o scopy.o snrm2.o sscal.o
+$(CB1AUX): $(FRC)
+
+ZB1AUX = idamax.o dasum.o daxpy.o dcopy.o dnrm2.o dscal.o
+$(ZB1AUX): $(FRC)
+
+#---------------------------------------------------------------------
+#  The following line defines auxiliary routines needed by both the
+#  Level 2 and Level 3 BLAS.  Comment it out only if you already have
+#  both the Level 2 and 3 BLAS.
+#---------------------------------------------------------------------
+ALLBLAS  = lsame.o xerbla.o
+$(ALLBLAS) : $(FRC)
+
+#---------------------------------------------------------
+#  Comment out the next 4 definitions if you already have
+#  the Level 2 BLAS.
+#---------------------------------------------------------
+SBLAS2 = sgemv.o sgbmv.o ssymv.o ssbmv.o sspmv.o \
+	strmv.o stbmv.o stpmv.o strsv.o stbsv.o stpsv.o \
+	sger.o ssyr.o sspr.o ssyr2.o sspr2.o
+$(SBLAS2): $(FRC)
+
+CBLAS2 = cgemv.o cgbmv.o chemv.o chbmv.o chpmv.o \
+	ctrmv.o ctbmv.o ctpmv.o ctrsv.o ctbsv.o ctpsv.o \
+	cgerc.o cgeru.o cher.o chpr.o cher2.o chpr2.o
+$(CBLAS2): $(FRC)
+
+DBLAS2 = dgemv.o dgbmv.o dsymv.o dsbmv.o dspmv.o \
+	dtrmv.o dtbmv.o dtpmv.o dtrsv.o dtbsv.o dtpsv.o \
+	dger.o dsyr.o dspr.o dsyr2.o dspr2.o
+$(DBLAS2): $(FRC)
+
+ZBLAS2 = zgemv.o zgbmv.o zhemv.o zhbmv.o zhpmv.o \
+	ztrmv.o ztbmv.o ztpmv.o ztrsv.o ztbsv.o ztpsv.o \
+	zgerc.o zgeru.o zher.o zhpr.o zher2.o zhpr2.o
+$(ZBLAS2): $(FRC)
+
+#---------------------------------------------------------
+#  Comment out the next 4 definitions if you already have
+#  the Level 3 BLAS.
+#---------------------------------------------------------
+SBLAS3 = sgemm.o ssymm.o ssyrk.o ssyr2k.o strmm.o strsm.o 
+$(SBLAS3): $(FRC)
+
+CBLAS3 = cgemm.o csymm.o csyrk.o csyr2k.o ctrmm.o ctrsm.o \
+	chemm.o cherk.o cher2k.o
+$(CBLAS3): $(FRC)
+
+DBLAS3 = dgemm.o dsymm.o dsyrk.o dsyr2k.o dtrmm.o dtrsm.o
+$(DBLAS3): $(FRC)
+
+ZBLAS3 = zgemm.o zsymm.o zsyrk.o zsyr2k.o ztrmm.o ztrsm.o \
+	zhemm.o zherk.o zher2k.o
+$(ZBLAS3): $(FRC)
+
+ALLOBJ=$(SBLAS1) $(SBLAS2) $(SBLAS3) $(DBLAS1) $(DBLAS2) $(DBLAS3) \
+	$(CBLAS1) $(CBLAS2) $(CBLAS3) $(ZBLAS1) \
+	$(ZBLAS2) $(ZBLAS3) $(ALLBLAS)
+
+$(BLASLIB): $(ALLOBJ)
+	$(FORTRAN) -shared -o $@ \
+		$(ALLOBJ) \
+		-Wl,--out-implib=$(IMP_LIB_NAME)
+
+single: $(SBLAS1) $(ALLBLAS) $(SBLAS2) $(SBLAS3)
+	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(SBLAS1) $(ALLBLAS) \
+	$(SBLAS2) $(SBLAS3)
+	$(RANLIB) $(BLASLIB)
+
+double: $(DBLAS1) $(ALLBLAS) $(DBLAS2) $(DBLAS3)
+	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(DBLAS1) $(ALLBLAS) \
+	$(DBLAS2) $(DBLAS3)
+	$(RANLIB) $(BLASLIB)
+
+complex: $(CBLAS1) $(CB1AUX) $(ALLBLAS) $(CBLAS2) $(CBLAS3)
+	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(CBLAS1) $(CB1AUX) \
+	$(ALLBLAS) $(CBLAS2) $(CBLAS3)
+	$(RANLIB) $(BLASLIB)
+
+complex16: $(ZBLAS1) $(ZB1AUX) $(ALLBLAS) $(ZBLAS2) $(ZBLAS3)
+	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(ZBLAS1) $(ZB1AUX) \
+	$(ALLBLAS) $(ZBLAS2) $(ZBLAS3)
+	$(RANLIB) $(BLASLIB)
+
+FRC:
+	@FRC=$(FRC)
+
+clean:
+	rm -f *.o
+
+.f.o: 
+	$(FORTRAN) $(OPTS) -c $< -o $@
Index: /issm/trunk/externalpackages/blas/configs/3.8/win/msys2/mingw64/make.inc
===================================================================
--- /issm/trunk/externalpackages/blas/configs/3.8/win/msys2/mingw64/make.inc	(revision 26744)
+++ /issm/trunk/externalpackages/blas/configs/3.8/win/msys2/mingw64/make.inc	(revision 26744)
@@ -0,0 +1,38 @@
+####################################################################
+#  BLAS make include file.                                         #
+#  March 2007                                                      #
+####################################################################
+#
+SHELL = /usr/bin/bash
+#
+#  The machine (platform) identifier to append to the library names
+#
+PLAT =
+#  
+#  Modify the FORTRAN and OPTS definitions to refer to the
+#  compiler and desired compiler options for your machine.  NOOPT
+#  refers to the compiler options desired when NO OPTIMIZATION is
+#  selected.  Define LOADER and LOADOPTS to refer to the loader and 
+#  desired load options for your machine.
+#
+FORTRAN  = gfortran
+OPTS     = -O2 -fPIC
+DRVOPTS  = $(OPTS)
+NOOPT    = -O0 -fPIC
+LOADER   = gfortran
+LOADOPTS =
+#
+#  The archiver and the flag(s) to use when building archive (library)
+#  If you system has no ranlib, set RANLIB = echo.
+#
+ARCH     = ar
+ARCHFLAGS= cr
+RANLIB   = ranlib
+
+MODULE			= blas
+IMP_LIB_NAME	= lib$(MODULE).dll.a
+LIB_NAME		= msys-$(MODULE).dll
+#
+#  The location and name of the Reference BLAS library.
+#
+BLASLIB = $(LIB_NAME)
Index: /issm/trunk/externalpackages/blas/install-3-win-msys2-gcc.sh
===================================================================
--- /issm/trunk/externalpackages/blas/install-3-win-msys2-gcc.sh	(revision 26744)
+++ /issm/trunk/externalpackages/blas/install-3-win-msys2-gcc.sh	(revision 26744)
@@ -0,0 +1,44 @@
+#!/bin/bash
+set -eu
+
+
+## Constants
+#
+VER=3.8.0
+
+PREFIX="${ISSM_DIR}/externalpackages/blas/install"
+
+MODULE="blas"
+IMP_LIB_NAME="lib${MODULE}.dll.a"
+LIB_NAME="msys-${MODULE}.dll"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/blas-${VER}.tgz" "blas-${VER}.tgz"
+
+# Unpack source
+tar -zxvf blas-${VER}.tgz
+
+# Move source into 'src' directory
+mv BLAS-${VER}/* src
+rm -rf BLAS-${VER}
+
+# Copy customized source and configuration files to 'src' directory
+cp configs/3.8/win/msys2/gcc/make.inc src
+cp configs/3.8/win/msys2/gcc/Makefile src
+
+# Compile
+cd src
+make
+
+# Install
+mkdir ${PREFIX}/lib
+cp ${IMP_LIB_NAME} ${PREFIX}/lib
+cp ${LIB_NAME} ${PREFIX}/lib
+
+# Create link to shared version of library so that libtool can find it
+cd ${PREFIX}/lib
+ln -s ./${LIB_NAME} ./libblas.dll
Index: /issm/trunk/externalpackages/blas/install-3-win-msys2-mingw.sh
===================================================================
--- /issm/trunk/externalpackages/blas/install-3-win-msys2-mingw.sh	(revision 26744)
+++ /issm/trunk/externalpackages/blas/install-3-win-msys2-mingw.sh	(revision 26744)
@@ -0,0 +1,44 @@
+#!/bin/bash
+set -eu
+
+
+## Constants
+#
+VER=3.8.0
+
+PREFIX="${ISSM_DIR}/externalpackages/blas/install"
+
+MODULE="blas"
+IMP_LIB_NAME="lib${MODULE}.dll.a"
+LIB_NAME="msys-${MODULE}.dll"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/blas-${VER}.tgz" "blas-${VER}.tgz"
+
+# Unpack source
+tar -zxvf blas-${VER}.tgz
+
+# Move source into 'src' directory
+mv BLAS-${VER}/* src
+rm -rf BLAS-${VER}
+
+# Copy customized source and configuration files to 'src' directory
+cp configs/3.8/win/msys2/mingw/make.inc src
+cp configs/3.8/win/msys2/mingw/Makefile src
+
+# Compile
+cd src
+make
+
+# Install
+mkdir ${PREFIX}/lib
+cp ${IMP_LIB_NAME} ${PREFIX}/lib
+cp ${LIB_NAME} ${PREFIX}/lib
+
+# Create link to shared version of library so that libtool can find it
+cd ${PREFIX}/lib
+ln -s ./${LIB_NAME} ./libblas.dll
Index: /issm/trunk/externalpackages/boost/configs/1.55/reverse_iterator.hpp.patch
===================================================================
--- /issm/trunk/externalpackages/boost/configs/1.55/reverse_iterator.hpp.patch	(revision 26744)
+++ /issm/trunk/externalpackages/boost/configs/1.55/reverse_iterator.hpp.patch	(revision 26744)
@@ -0,0 +1,4 @@
+64c64
+<       return reverse_iterator<BidirectionalIterator>(x);
+---
+>       return boost::reverse_iterator<BidirectionalIterator>(x);
Index: /issm/trunk/externalpackages/boost/install-1.7-linux-static.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.7-linux-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/boost/install-1.7-linux-static.sh	(revision 26744)
@@ -7,7 +7,5 @@
 VER="1_73_0"
 
-## Envrionment
-#
-export BOOST_ROOT="${ISSM_DIR}/externalpackages/boost"
+PREFIX="${ISSM_DIR}/externalpackages/boost/install" # Set to location where external package should be installed
 
 # Download source
@@ -18,9 +16,9 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source into 'src' directory
-mv boost_${VER}/* src/
+mv boost_${VER}/* src
 rm -rf boost_${VER}
 
@@ -28,5 +26,5 @@
 cd src
 ./bootstrap.sh \
-	--prefix="${BOOST_ROOT}/install" \
+	--prefix=${PREFIX} \
 	--with-python=python2.7
 
Index: /issm/trunk/externalpackages/boost/install-1.7-linux-valgrind.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.7-linux-valgrind.sh	(revision 26743)
+++ /issm/trunk/externalpackages/boost/install-1.7-linux-valgrind.sh	(revision 26744)
@@ -7,7 +7,5 @@
 VER="1_73_0"
 
-## Envrionment
-#
-export BOOST_ROOT="${ISSM_DIR}/externalpackages/boost"
+PREFIX="${ISSM_DIR}/externalpackages/boost/install" # Set to location where external package should be installed
 
 # Download source
@@ -18,9 +16,9 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source into 'src' directory
-mv boost_${VER}/* src/
+mv boost_${VER}/* src
 rm -rf boost_${VER}
 
@@ -31,5 +29,5 @@
 cd src
 ./bootstrap.sh \
-	--prefix="${BOOST_ROOT}/install" \
+	--prefix=${PREFIX} \
 	--with-python=python2.7
 
Index: /issm/trunk/externalpackages/boost/install-1.7-linux.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.7-linux.sh	(revision 26743)
+++ /issm/trunk/externalpackages/boost/install-1.7-linux.sh	(revision 26744)
@@ -7,7 +7,5 @@
 VER="1_73_0"
 
-## Envrionment
-#
-export BOOST_ROOT="${ISSM_DIR}/externalpackages/boost"
+PREFIX="${ISSM_DIR}/externalpackages/boost/install" # Set to location where external package should be installed
 
 # Download source
@@ -18,9 +16,9 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source into 'src' directory
-mv boost_${VER}/* src/
+mv boost_${VER}/* src
 rm -rf boost_${VER}
 
@@ -28,5 +26,5 @@
 cd src
 ./bootstrap.sh \
-	--prefix="${BOOST_ROOT}/install" \
+	--prefix=${PREFIX} \
 	--with-python=python2.7
 
Index: /issm/trunk/externalpackages/boost/install-1.7-mac-static.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.7-mac-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/boost/install-1.7-mac-static.sh	(revision 26744)
@@ -7,7 +7,9 @@
 VER="1_73_0"
 
+PREFIX="${ISSM_DIR}/externalpackages/boost/install" # Set to location where external package should be installed
+
 ## Environment
 #
-export BOOST_ROOT="${ISSM_DIR}/externalpackages/boost"
+export LDFLAGS="-Wl,-headerpad_max_install_names"
 
 # Download source
@@ -18,9 +20,9 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source into 'src' directory
-mv boost_${VER}/* src/
+mv boost_${VER}/* src
 rm -rf boost_${VER}
 
@@ -28,5 +30,5 @@
 cd src
 ./bootstrap.sh \
-	--prefix="${BOOST_ROOT}/install" \
+	--prefix=${PREFIX} \
 	--with-python=python2.7
 
@@ -41,3 +43,3 @@
 # TODO: Reconfigure so that dynamic libraries are not compiled at all
 #
-rm -f $(find ${BOOST_ROOT}/install/lib -name *.dylib)
+rm -f $(find ${PREFIX}/lib -name *.dylib)
Index: /issm/trunk/externalpackages/boost/install-1.7-mac.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.7-mac.sh	(revision 26743)
+++ /issm/trunk/externalpackages/boost/install-1.7-mac.sh	(revision 26744)
@@ -7,7 +7,8 @@
 VER="1_73_0"
 
+PREFIX="${ISSM_DIR}/externalpackages/boost/install" # Set to location where external package should be installed
+
 ## Environment
 #
-export BOOST_ROOT="${ISSM_DIR}/externalpackages/boost"
 export LDFLAGS="-Wl,-headerpad_max_install_names"
 
@@ -19,9 +20,9 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source into 'src' directory
-mv boost_${VER}/* src/
+mv boost_${VER}/* src
 rm -rf boost_${VER}
 
@@ -29,5 +30,5 @@
 cd src
 ./bootstrap.sh \
-	--prefix=${BOOST_ROOT}/install \
+	--prefix=${PREFIX} \
 	--with-python=python2.7
 
@@ -49,6 +50,6 @@
 #	patching it after the fact with install_name_tool is not necessary.
 #
-cd ${BOOST_ROOT}/install/lib
+cd ${PREFIX}/lib
 for name in *.dylib; do
-	install_name_tool -id ${BOOST_ROOT}/install/lib/${name} ${name} 2>/dev/null
+	install_name_tool -id ${PREFIX}/lib/${name} ${name} 2>/dev/null
 done
Index: /issm/trunk/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile
===================================================================
--- /issm/trunk/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile	(revision 26744)
+++ /issm/trunk/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile	(revision 26744)
@@ -0,0 +1,202 @@
+DEST_DIR = 	../exec
+DEST=		${DEST_DIR}/chaco
+CC = 		gcc
+IFLAG =		-Imain -I/mingw64/x86_64-w64-mingw32/include
+CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g -Wno-implicit-function-declaration -D_MSYS2_
+OFLAGS =	-O2
+#AR =             /usr/ccs/bin/ar rcv   # for solaris 2
+#AR =             /usr/bin/ar rcv
+AR =             ar cr
+#RANLIB =         /usr/ccs/bin/ranlib   # for solaris 2
+#RANLIB =         /usr/bin/ranlib
+RANLIB =         ranlib
+
+FILES.c=	main/user_params.c main/interface.c main/main.c \
+		submain/balance.c submain/divide.c submain/submain.c \
+		input/input_assign.c \
+		input/check_input.c input/input.c input/input_geom.c \
+		input/input_graph.c input/read_params.c input/reflect_input.c \
+		input/read_val.c \
+		graph/check_graph.c graph/free_graph.c \
+		graph/reformat.c graph/subgraph.c graph/graph_out.c \
+		inertial/eigenvec2.c inertial/eigenvec3.c inertial/inertial.c \
+		inertial/inertial1d.c inertial/inertial2d.c \
+		inertial/inertial3d.c inertial/make_subgeom.c \
+		klspiff/buckets.c klspiff/buckets_bi.c klspiff/buckets1.c \
+		klspiff/bilistops.c klspiff/coarsen_kl.c klspiff/count_weights.c \
+		klspiff/compress_ewgts.c klspiff/kl_init.c klspiff/kl_output.c \
+		klspiff/klspiff.c klspiff/make_bndy_list.c \
+		klspiff/make_kl_list.c klspiff/nway_kl.c \
+		klvspiff/bpm_improve.c klvspiff/bucketsv.c \
+		klvspiff/clear_dvals.c klvspiff/coarsen_klv.c \
+		klvspiff/countup_vtx_sep.c klvspiff/find_bndy.c klvspiff/flow.c \
+		klvspiff/klv_init.c klvspiff/klvspiff.c klvspiff/make_bpgraph.c \
+		klvspiff/make_sep_list.c klvspiff/matching.c klvspiff/nway_klv.c \
+		klvspiff/flatten.c \
+		coarsen/coarsen.c coarsen/interpolate.c coarsen/makefgraph.c \
+		coarsen/makeccoords.c \
+		coarsen/coarsen1.c coarsen/makev2cv.c \
+		coarsen/maxmatch.c coarsen/maxmatch1.c coarsen/maxmatch2.c \
+		coarsen/maxmatch3.c coarsen/maxmatch4.c coarsen/maxmatch5.c \
+		connect/add_edges.c connect/connected.c connect/find_edges.c \
+		eigen/bidir.c eigen/bisect.c eigen/checkeig.c \
+		eigen/checkeig_ext.c \
+		eigen/checkorth.c eigen/cksturmcnt.c eigen/mkeigvecs.c\
+		eigen/eigensolve.c eigen/get_extval.c eigen/get_ritzvals.c \
+		eigen/lanczos_FO.c eigen/lanczos_SO.c eigen/lanczos_SO_float.c \
+		eigen/lanczos_ext.c eigen/lanczos_ext_float.c eigen/lanc_seconds.c\
+		eigen/lanpause.c eigen/makeorthlnk.c eigen/mkscanlist.c \
+		eigen/orthog1.c eigen/orthogonalize.c eigen/orthogvec.c \
+		eigen/ql.c eigen/rqi.c eigen/rqi_ext.c eigen/scale_diag.c \
+		eigen/scanmax.c eigen/scanmin.c eigen/solistout.c \
+                eigen/sorthog.c eigen/splarax.c eigen/sturmcnt.c \
+		eigen/Tevec.c eigen/tri_solve.c eigen/warnings.c \
+		symmlq/aprod.c symmlq/msolve.c symmlq/pow_dd.c \
+		symmlq/symmlq.c symmlq/symmlqblas.c \
+		tinvit/tinvit.c tinvit/pythag.c tinvit/epslon.c \
+		optimize/determinant.c optimize/func2d.c \
+		optimize/func3d.c optimize/opt2d.c optimize/opt3d.c \
+		assign/assign.c assign/assign_out.c assign/mapper.c \
+		assign/median.c assign/merge_assign.c \
+		assign/rec_median.c assign/rotate.c assign/y2x.c \
+		bpmatch/checkbp.c bpmatch/inits2d.c bpmatch/inits3d.c \
+		bpmatch/genvals2d.c bpmatch/genvals3d.c bpmatch/map2d.c \
+		bpmatch/map3d.c bpmatch/movevtxs.c \
+		bpmatch/sorts2d.c bpmatch/sorts3d.c \
+		refine_map/compute_cube_edata.c refine_map/compute_cube_vdata.c \
+		refine_map/refine_cube.c refine_map/update_cube_edata.c \
+		refine_map/update_cube_vdata.c refine_map/find_edge_cube.c \
+		refine_map/init_cube_edata.c refine_map/compute_mesh_edata.c \
+		refine_map/compute_mesh_vdata.c refine_map/find_edge_mesh.c \
+		refine_map/init_mesh_edata.c refine_map/refine_mesh.c \
+		refine_map/update_mesh_edata.c refine_map/update_mesh_vdata.c \
+		refine_map/refine_map.c refine_map/make_comm_graph.c \
+		refine_part/refine_part.c refine_part/kl_refine.c \
+		refine_part/make_maps_ref.c refine_part/make_terms_ref.c \
+		internal/force_internal.c internal/improve_internal.c \
+		internal/check_internal.c \
+		misc/define_subcubes.c misc/define_submeshes.c \
+		misc/divide_procs.c misc/merge_goals.c misc/make_term_props.c \
+		misc/count.c misc/countup.c misc/countup_cube.c \
+		misc/countup_mesh.c misc/make_subgoal.c \
+		misc/find_maxdeg.c misc/make_maps.c misc/make_setlists.c \
+		misc/sequence.c misc/perturb.c misc/simple_part.c \
+		misc/time_kernels.c misc/timing.c \
+		util/affirm.c util/array_alloc_2D.c util/bit_reverse.c \
+		util/checkpnt.c util/cpvec.c util/dot.c \
+		util/doubleout.c util/input_int.c util/gray.c \
+		util/machine_params.c util/makevwsqrt.c util/mkvec.c util/norm.c \
+                util/normalize.c util/mergesort.c \
+                util/randomize.c util/smalloc.c util/bail.c \
+		util/scadd.c util/seconds.c util/setvec.c util/shell_sort.c \
+		util/strout.c util/tri_prod.c util/true_or_false.c \
+		util/update.c  util/vecout.c util/vecran.c \
+                util/vecscale.c 
+
+
+FILESMINUSBLAS.c=	main/user_params.c main/interface.c main/main.c \
+		submain/balance.c submain/divide.c submain/submain.c \
+		input/input_assign.c \
+		input/check_input.c input/input.c input/input_geom.c \
+		input/input_graph.c input/read_params.c input/reflect_input.c \
+		input/read_val.c \
+		graph/check_graph.c graph/free_graph.c \
+		graph/reformat.c graph/subgraph.c graph/graph_out.c \
+		inertial/eigenvec2.c inertial/eigenvec3.c inertial/inertial.c \
+		inertial/inertial1d.c inertial/inertial2d.c \
+		inertial/inertial3d.c inertial/make_subgeom.c \
+		klspiff/buckets.c klspiff/buckets_bi.c klspiff/buckets1.c \
+		klspiff/bilistops.c klspiff/coarsen_kl.c klspiff/count_weights.c \
+		klspiff/compress_ewgts.c klspiff/kl_init.c klspiff/kl_output.c \
+		klspiff/klspiff.c klspiff/make_bndy_list.c \
+		klspiff/make_kl_list.c klspiff/nway_kl.c \
+		klvspiff/bpm_improve.c klvspiff/bucketsv.c \
+		klvspiff/clear_dvals.c klvspiff/coarsen_klv.c \
+		klvspiff/countup_vtx_sep.c klvspiff/find_bndy.c klvspiff/flow.c \
+		klvspiff/klv_init.c klvspiff/klvspiff.c klvspiff/make_bpgraph.c \
+		klvspiff/make_sep_list.c klvspiff/matching.c klvspiff/nway_klv.c \
+		klvspiff/flatten.c \
+		coarsen/coarsen.c coarsen/interpolate.c coarsen/makefgraph.c \
+		coarsen/makeccoords.c \
+		coarsen/coarsen1.c coarsen/makev2cv.c \
+		coarsen/maxmatch.c coarsen/maxmatch1.c coarsen/maxmatch2.c \
+		coarsen/maxmatch3.c coarsen/maxmatch4.c coarsen/maxmatch5.c \
+		connect/add_edges.c connect/connected.c connect/find_edges.c \
+		eigen/bidir.c eigen/bisect.c eigen/checkeig.c \
+		eigen/checkeig_ext.c \
+		eigen/checkorth.c eigen/cksturmcnt.c eigen/mkeigvecs.c\
+		eigen/eigensolve.c eigen/get_extval.c eigen/get_ritzvals.c \
+		eigen/lanczos_FO.c eigen/lanczos_SO.c eigen/lanczos_SO_float.c \
+		eigen/lanczos_ext.c eigen/lanczos_ext_float.c eigen/lanc_seconds.c\
+		eigen/lanpause.c eigen/makeorthlnk.c eigen/mkscanlist.c \
+		eigen/orthog1.c eigen/orthogonalize.c eigen/orthogvec.c \
+		eigen/ql.c eigen/rqi.c eigen/rqi_ext.c eigen/scale_diag.c \
+		eigen/scanmax.c eigen/scanmin.c eigen/solistout.c \
+                eigen/sorthog.c eigen/splarax.c eigen/sturmcnt.c \
+		eigen/Tevec.c eigen/tri_solve.c eigen/warnings.c \
+		symmlq/aprod.c symmlq/msolve.c symmlq/pow_dd.c \
+		symmlq/symmlq.c  \
+		tinvit/tinvit.c tinvit/pythag.c tinvit/epslon.c \
+		optimize/determinant.c optimize/func2d.c \
+		optimize/func3d.c optimize/opt2d.c optimize/opt3d.c \
+		assign/assign.c assign/assign_out.c assign/mapper.c \
+		assign/median.c assign/merge_assign.c \
+		assign/rec_median.c assign/rotate.c assign/y2x.c \
+		bpmatch/checkbp.c bpmatch/inits2d.c bpmatch/inits3d.c \
+		bpmatch/genvals2d.c bpmatch/genvals3d.c bpmatch/map2d.c \
+		bpmatch/map3d.c bpmatch/movevtxs.c \
+		bpmatch/sorts2d.c bpmatch/sorts3d.c \
+		refine_map/compute_cube_edata.c refine_map/compute_cube_vdata.c \
+		refine_map/refine_cube.c refine_map/update_cube_edata.c \
+		refine_map/update_cube_vdata.c refine_map/find_edge_cube.c \
+		refine_map/init_cube_edata.c refine_map/compute_mesh_edata.c \
+		refine_map/compute_mesh_vdata.c refine_map/find_edge_mesh.c \
+		refine_map/init_mesh_edata.c refine_map/refine_mesh.c \
+		refine_map/update_mesh_edata.c refine_map/update_mesh_vdata.c \
+		refine_map/refine_map.c refine_map/make_comm_graph.c \
+		refine_part/refine_part.c refine_part/kl_refine.c \
+		refine_part/make_maps_ref.c refine_part/make_terms_ref.c \
+		internal/force_internal.c internal/improve_internal.c \
+		internal/check_internal.c \
+		misc/define_subcubes.c misc/define_submeshes.c \
+		misc/divide_procs.c misc/merge_goals.c misc/make_term_props.c \
+		misc/count.c misc/countup.c misc/countup_cube.c \
+		misc/countup_mesh.c misc/make_subgoal.c \
+		misc/find_maxdeg.c misc/make_maps.c misc/make_setlists.c \
+		misc/sequence.c misc/perturb.c misc/simple_part.c \
+		misc/time_kernels.c misc/timing.c \
+		util/affirm.c util/array_alloc_2D.c util/bit_reverse.c \
+		util/checkpnt.c util/cpvec.c util/dot.c \
+		util/doubleout.c util/input_int.c util/gray.c \
+		util/machine_params.c util/makevwsqrt.c util/mkvec.c util/norm.c \
+                util/normalize.c util/mergesort.c \
+                util/randomize.c util/smalloc.c util/bail.c \
+		util/scadd.c util/seconds.c util/setvec.c util/shell_sort.c \
+		util/strout.c util/tri_prod.c util/true_or_false.c \
+		util/update.c  util/vecout.c util/vecran.c \
+                util/vecscale.c 
+
+FILES.o=	$(FILES.c:.c=.o) 
+FILESMINUSBLAS.o=	$(FILESMINUSBLAS.c:.c=.o) 
+
+
+${DEST}:	${FILES.c} chaco.a Makefile
+		${CC} ${OFLAGS} chaco.a -lm -o ${DEST}
+
+chaco.a:	${FILES.o}
+		${AR} $@ ${FILES.o} ; ${RANLIB} $@
+
+chacominusblas.a:	${FILESMINUSBLAS.o}
+		${AR} $@ ${FILESMINUSBLAS.o} ; ${RANLIB} $@
+
+lint:
+		lint ${IFLAG} ${FILES.c} -lm
+
+alint:
+		alint ${IFLAG} ${FILES.c} -lm
+
+clean:
+		rm -f */*.o ${DEST_DIR}/core
+
+.c.o:
+		${CC} -c ${IFLAG} ${CFLAGS} -o $*.o $*.c
Index: /issm/trunk/externalpackages/chaco/configs/win/msys2/mingw64/src/code/main/interface.c
===================================================================
--- /issm/trunk/externalpackages/chaco/configs/win/msys2/mingw64/src/code/main/interface.c	(revision 26744)
+++ /issm/trunk/externalpackages/chaco/configs/win/msys2/mingw64/src/code/main/interface.c	(revision 26744)
@@ -0,0 +1,234 @@
+/* This software was developed by Bruce Hendrickson and Robert Leland   *
+ * at Sandia National Laboratories under US Department of Energy        *
+ * contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
+
+#include <stdio.h>
+#include "defs.h"
+#include "structs.h"
+
+int       Using_Main = FALSE;	/* Is main routine being called? */
+
+int       interface(nvtxs, start, adjacency, vwgts, ewgts, x, y, z,
+		              outassignname, outfilename,
+		              assignment,
+		              architecture, ndims_tot, mesh_dims, goal,
+		              global_method, local_method, rqi_flag, vmax, ndims,
+		              eigtol, seed)
+int       nvtxs;		/* number of vertices in full graph */
+int      *start;		/* start of edge list for each vertex */
+int      *adjacency;		/* edge list data */
+int      *vwgts;		/* weights for all vertices */
+float    *ewgts;		/* weights for all edges */
+float    *x, *y, *z;		/* coordinates for inertial method */
+char     *outassignname;	/* name of assignment output file */
+char     *outfilename;		/* output file name */
+short    *assignment;		/* set number of each vtx (length n) */
+int       architecture;		/* 0 => hypercube, d => d-dimensional mesh */
+int       ndims_tot;		/* total number of cube dimensions to divide */
+int       mesh_dims[3];		/* dimensions of mesh of processors */
+double   *goal;			/* desired set sizes for each set */
+int       global_method;	/* global partitioning algorithm */
+int       local_method;		/* local partitioning algorithm */
+int       rqi_flag;		/* should I use RQI/Symmlq eigensolver? */
+int       vmax;			/* how many vertices to coarsen down to? */
+int       ndims;		/* number of eigenvectors (2^d sets) */
+double    eigtol;		/* tolerance on eigenvectors */
+long      seed;			/* for random graph mutations */
+{
+    extern char *PARAMS_FILENAME;	/* name of file with parameter updates */
+    extern int MAKE_VWGTS;	/* make vertex weights equal to degrees? */
+    extern int MATCH_TYPE;      /* matching routine to use */
+    extern int FREE_GRAPH;	/* free graph data structure after reformat? */
+    extern int DEBUG_PARAMS;	/* debug flag for reading parameters */
+    extern int DEBUG_TRACE;	/* trace main execution path */
+    extern double start_time;	/* time routine is entered */
+    extern double reformat_time;/* time spent reformatting graph */
+    FILE     *params_file;	/* file for reading new parameters */
+    struct vtx_data **graph;	/* graph data structure */
+    double    vwgt_sum;		/* sum of vertex weights */
+    double    time;		/* timing variable */
+    float   **coords;		/* coordinates for vertices if used */
+    int      *vptr;		/* loops through vertex weights */
+    int       flag;		/* return code from balance */
+    int       nedges;		/* number of edges in graph */
+    int       using_vwgts;	/* are vertex weights being used? */
+    int       using_ewgts;	/* are edge weights being used? */
+    int       nsets_tot;	/* total number of sets being created */
+    int       igeom;		/* geometric dimension for inertial method */
+    int       default_goal;	/* using default goals? */
+    int       i;		/* loop counter */
+    double    seconds();
+    double   *smalloc_ret();
+    int       sfree(), submain(), reformat();
+    void      free_graph(), read_params(), strout();
+
+    if (DEBUG_TRACE > 0) {
+	printf("<Entering interface>\n");
+    }
+
+    flag = 0;
+    graph = NULL;
+    coords = NULL;
+
+    if (!Using_Main) {		/* If not using main, need to read parameters file. */
+	start_time = seconds();
+	params_file = fopen(PARAMS_FILENAME, "r");
+	if (params_file == NULL && DEBUG_PARAMS > 1) {
+	    printf("Parameter file `%s' not found; using default parameters.\n",
+		   PARAMS_FILENAME);
+	}
+	read_params(params_file);
+    }
+
+    if (goal == NULL) {	/* If not passed in, default goals have equal set sizes. */
+	default_goal = TRUE;
+	if (architecture == 0)
+	    nsets_tot = 1 << ndims_tot;
+	else if (architecture == 1) 
+	    nsets_tot = mesh_dims[0];
+	else if (architecture == 2) 
+	    nsets_tot = mesh_dims[0] * mesh_dims[1];
+	else if (architecture > 2) 
+	    nsets_tot = mesh_dims[0] * mesh_dims[1] * mesh_dims[2];
+
+	if (MAKE_VWGTS && start != NULL) {
+	    vwgt_sum = start[nvtxs] - start[0] + nvtxs;
+	}
+	else if (vwgts == NULL) {
+	    vwgt_sum = nvtxs;
+	}
+	else {
+	    vwgt_sum = 0;
+	    vptr = vwgts;
+	    for (i = nvtxs; i; i--)
+		vwgt_sum += *(vptr++);
+	}
+
+	vwgt_sum /= nsets_tot;
+	goal = (double *) smalloc_ret((unsigned) nsets_tot * sizeof(double));
+	if (goal == NULL) {
+	    strout("\nERROR: No room to make goals.\n");
+	    flag = 1;
+	    goto skip;
+	}
+	for (i = 0; i < nsets_tot; i++)
+	    goal[i] = vwgt_sum;
+    }
+    else {
+	default_goal = FALSE;
+    }
+
+    if (MAKE_VWGTS) {
+	/* Generate vertex weights equal to degree of node. */
+	if (vwgts != NULL) {
+	    strout("WARNING: Vertex weights being overwritten by vertex degrees.");
+	}
+	vwgts = (int *) smalloc_ret((unsigned) nvtxs * sizeof(int));
+	if (vwgts == NULL) {
+	    strout("\nERROR: No room to make vertex weights.\n");
+	    flag = 1;
+	    goto skip;
+	}
+	if (start != NULL) {
+	    for (i = 0; i < nvtxs; i++)
+	        vwgts[i] = 1 + start[i + 1] - start[i];
+	}
+	else {
+	    for (i = 0; i < nvtxs; i++)
+	        vwgts[i] = 1;
+	}
+    }
+
+    using_vwgts = (vwgts != NULL);
+    using_ewgts = (ewgts != NULL);
+
+    if (start != NULL || vwgts != NULL) {	/* Reformat into our data structure. */
+	time = seconds();
+	flag = reformat(start, adjacency, nvtxs, &nedges, vwgts, ewgts, &graph);
+
+	if (flag) {
+	    strout("\nERROR: No room to reformat graph.\n");
+	    goto skip;
+	}
+
+	reformat_time += seconds() - time;
+    }
+    else {
+	nedges = 0;
+    }
+
+    if (FREE_GRAPH) {		/* Free old graph data structures. */
+	sfree((char *) start);
+	sfree((char *) adjacency);
+	if (vwgts != NULL)
+	    sfree((char *) vwgts);
+	if (ewgts != NULL)
+	    sfree((char *) ewgts);
+	start = NULL;
+	adjacency = NULL;
+	vwgts = NULL;
+	ewgts = NULL;
+    }
+
+
+    if (global_method == 3 ||
+        (MATCH_TYPE == 5 && (global_method == 1 || 
+			     (global_method == 2 && rqi_flag)))) {
+	if (x == NULL) {
+	    igeom = 0;
+	}
+	else {			/* Set up coordinate data structure. */
+	    coords = (float **) smalloc_ret((unsigned) 3 * sizeof(float *));
+	    if (coords == NULL) {
+		strout("\nERROR: No room to make coordinate array.\n");
+		flag = 1;
+		goto skip;
+	    }
+	    /* Minus 1's are to allow remainder of program to index with 1. */
+	    coords[0] = x - 1;
+	    igeom = 1;
+	    if (y != NULL) {
+		coords[1] = y - 1;
+		igeom = 2;
+		if (z != NULL) {
+		    coords[2] = z - 1;
+		    igeom = 3;
+		}
+	    }
+	}
+    }
+    else {
+	igeom = 0;
+    }
+
+    /* Subtract from assignment to allow code to index from 1. */
+    assignment = assignment - 1;
+    flag = submain(graph, nvtxs, nedges, using_vwgts, using_ewgts, igeom, coords,
+		   outassignname, outfilename,
+		   assignment, goal,
+		   architecture, ndims_tot, mesh_dims,
+		   global_method, local_method, rqi_flag, vmax, ndims,
+		   eigtol, seed);
+
+skip:
+    if (coords != NULL)
+	sfree((char *) coords);
+
+    if (default_goal)
+	sfree((char *) goal);
+
+    if (graph != NULL)
+	free_graph(graph);
+
+    if (flag && FREE_GRAPH) {
+	sfree((char *) start);
+	sfree((char *) adjacency);
+	sfree((char *) vwgts);
+	sfree((char *) ewgts);
+    }
+
+    if (!Using_Main && params_file != NULL)
+	fclose(params_file);
+
+    return (flag);
+}
Index: /issm/trunk/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/bail.c
===================================================================
--- /issm/trunk/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/bail.c	(revision 26744)
+++ /issm/trunk/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/bail.c	(revision 26744)
@@ -0,0 +1,27 @@
+/* This software was developed by Bruce Hendrickson and Robert Leland   *
+ * at Sandia National Laboratories under US Department of Energy        *
+ * contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
+
+#include	<stdlib.h>
+#include	<stdio.h>
+#include	<string.h>
+#include	"defs.h"
+
+/* Wrapper for exit() - print message and exit with status code. Exit code
+   of 0 indicates normal termination. Exit code of 1 indicates early 
+   termination following detection of some problem. Call with bail(NULL,status) 
+   to suppress message. */ 
+void      bail(msg, status)
+char     *msg;
+int       status;
+{
+    extern FILE *Output_File;		/* Output file or NULL */
+
+    if (msg != NULL && (int) strlen(msg) > 0) {
+        printf("%s\n", msg);
+	if (Output_File != NULL) {
+            fprintf(Output_File, "%s\n", msg);
+	}
+    }
+    exit(status);
+}
Index: /issm/trunk/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/seconds.c
===================================================================
--- /issm/trunk/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/seconds.c	(revision 26744)
+++ /issm/trunk/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/seconds.c	(revision 26744)
@@ -0,0 +1,35 @@
+/* This software was developed by Bruce Hendrickson and Robert Leland   *
+ * at Sandia National Laboratories under US Department of Energy        *
+ * contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
+
+#if defined(_INTEL_WIN_) || defined(_MSYS2_)
+#include   <time.h>
+#else
+#include   <sys/time.h>
+#include   <sys/resource.h>
+#endif
+
+double    seconds()
+{
+    double    curtime;
+
+#ifdef RUSAGE_SELF
+
+/* This timer is faster and more robust (if it exists). */
+    struct rusage rusage;
+    int getrusage();
+ 
+    getrusage(RUSAGE_SELF, &rusage);
+    curtime = ((rusage.ru_utime.tv_sec + rusage.ru_stime.tv_sec) +
+	    1.0e-6 * (rusage.ru_utime.tv_usec + rusage.ru_stime.tv_usec));
+
+#else
+
+/* ANSI timer, but lower resolution & wraps around after ~36 minutes. */
+
+    curtime = clock()/((double) CLOCKS_PER_SEC);
+
+#endif
+
+    return (curtime);
+}
Index: /issm/trunk/externalpackages/chaco/install-mac-sierra.sh
===================================================================
--- /issm/trunk/externalpackages/chaco/install-mac-sierra.sh	(revision 26744)
+++ /issm/trunk/externalpackages/chaco/install-mac-sierra.sh	(revision 26744)
@@ -0,0 +1,55 @@
+#!/bin/bash
+set -eu
+
+# Some cleanup
+rm -rf Chaco-2.2
+rm -rf src 
+rm -rf install 
+mkdir src install 
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Chaco-2.2.tar.gz' 'Chaco-2.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf' 'chaco_guide.pdf'
+
+# Untar 
+tar -xvzf Chaco-2.2.tar.gz
+
+# Move chaco to src directory
+mv Chaco-2.2/* src
+rm -rf Chaco-2.2
+
+# Apply patches (all at once)
+# (written by diff -rc src ~/Libs/Chaco-2.2 > chaco.patch)
+patch -R -p0 < chaco.patch
+
+# Patch src/code/Makefile
+patch ./src/code/Makefile ./patches/Makefile.mac-sierra.patch
+
+
+# Build chaco
+cd src/code
+if [ $# -eq 0 ]; then
+	make
+else
+	make -j $1
+fi
+make chacominusblas.a
+
+# Clean up objects (but not library or executable)
+make clean
+cd ../..
+
+# Populate install directory
+cp -p src/exec/README install
+cp -p src/exec/User_Params install
+cp -p src/exec/*.coords install
+cp -p src/exec/*.graph install
+mkdir install/include
+cp -p src/code/main/defs.h install/include/defs.h
+cp -p src/code/main/params.h install/include/params.h
+cp -p chaco.h install/include/chaco.h
+mkdir install/lib
+mv src/code/chaco.a install/lib/libchaco.a
+mv src/code/chacominusblas.a install/lib/libchacominusblas.a
+mkdir install/exec
+mv src/exec/chaco install/exec
Index: sm/trunk/externalpackages/chaco/install-macosx64-sierra.sh
===================================================================
--- /issm/trunk/externalpackages/chaco/install-macosx64-sierra.sh	(revision 26743)
+++ 	(revision )
@@ -1,55 +1,0 @@
-#!/bin/bash
-set -eu
-
-# Some cleanup
-rm -rf Chaco-2.2
-rm -rf src 
-rm -rf install 
-mkdir src install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Chaco-2.2.tar.gz' 'Chaco-2.2.tar.gz'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf' 'chaco_guide.pdf'
-
-# Untar 
-tar -xvzf Chaco-2.2.tar.gz
-
-# Move chaco to src directory
-mv Chaco-2.2/* src
-rm -rf Chaco-2.2
-
-# Apply patches (all at once)
-# (written by diff -rc src ~/Libs/Chaco-2.2 > chaco.patch)
-patch -R -p0 < chaco.patch
-
-# Patch src/code/Makefile
-patch ./src/code/Makefile ./patches/Makefile.macosx64-sierra.patch
-
-
-# Build chaco
-cd src/code
-if [ $# -eq 0 ]; then
-	make
-else
-	make -j $1
-fi
-make chacominusblas.a
-
-# Clean up objects (but not library or executable)
-make clean
-cd ../..
-
-# Populate install directory
-cp -p src/exec/README install
-cp -p src/exec/User_Params install
-cp -p src/exec/*.coords install
-cp -p src/exec/*.graph install
-mkdir install/include
-cp -p src/code/main/defs.h install/include/defs.h
-cp -p src/code/main/params.h install/include/params.h
-cp -p chaco.h install/include/chaco.h
-mkdir install/lib
-mv src/code/chaco.a install/lib/libchaco.a
-mv src/code/chacominusblas.a install/lib/libchacominusblas.a
-mkdir install/exec
-mv src/exec/chaco install/exec
Index: sm/trunk/externalpackages/chaco/install-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/chaco/install-macosx64.sh	(revision 26743)
+++ 	(revision )
@@ -1,55 +1,0 @@
-#!/bin/bash
-set -eu
-
-# Some cleanup
-rm -rf Chaco-2.2
-rm -rf src 
-rm -rf install 
-mkdir src install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Chaco-2.2.tar.gz' 'Chaco-2.2.tar.gz'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf' 'chaco_guide.pdf'
-
-# Untar 
-tar -xvzf Chaco-2.2.tar.gz
-
-# Move chaco to src directory
-mv Chaco-2.2/* src
-rm -rf Chaco-2.2
-
-# Apply patches (all at once)
-# (written by diff -rc src ~/Libs/Chaco-2.2 > chaco.patch)
-patch -R -p0 < chaco.patch
-
-# Patch src/code/Makefile
-patch ./src/code/Makefile ./patches/Makefile.patch
-
-
-# Build chaco
-cd src/code
-if [ $# -eq 0 ]; then
-	make
-else
-	make -j $1
-fi
-make chacominusblas.a
-
-# Clean up objects (but not library or executable)
-make clean
-cd ../..
-
-# Populate install directory
-cp -p src/exec/README install
-cp -p src/exec/User_Params install
-cp -p src/exec/*.coords install
-cp -p src/exec/*.graph install
-mkdir install/include
-cp -p src/code/main/defs.h install/include/defs.h
-cp -p src/code/main/params.h install/include/params.h
-cp -p chaco.h install/include/chaco.h
-mkdir install/lib
-mv src/code/chaco.a install/lib/libchaco.a
-mv src/code/chacominusblas.a install/lib/libchacominusblas.a
-mkdir install/exec
-mv src/exec/chaco install/exec
Index: /issm/trunk/externalpackages/chaco/install-win-msys2-mingw.sh
===================================================================
--- /issm/trunk/externalpackages/chaco/install-win-msys2-mingw.sh	(revision 26744)
+++ /issm/trunk/externalpackages/chaco/install-win-msys2-mingw.sh	(revision 26744)
@@ -0,0 +1,62 @@
+#!/bin/bash
+set -eu
+
+
+## Constants
+#
+VER=2.2
+
+PREFIX="${ISSM_DIR}/externalpackages/chaco/install" # Set to location where external package should be installed
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/Chaco-${VER}.tar.gz" "Chaco-${VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf" "chaco_guide.pdf"
+
+# Unpack source
+tar -xvzf Chaco-${VER}.tar.gz
+
+# Move source to 'src' directory
+mv Chaco-${VER}/* src
+rm -rf Chaco-${VER}
+
+# Apply patches (all at once)
+# (written by diff -rc src ~/Libs/Chaco-${VER} > chaco.patch)
+patch -R -p0 < chaco.patch
+
+# Copy customized source and configuration files to 'src' directory
+cp configs/win/msys2/mingw64/src/code/Makefile src/code
+cp configs/win/msys2/mingw64/src/code/main/interface.c src/code/main
+cp configs/win/msys2/mingw64/src/code/util/bail.c src/code/util
+cp configs/win/msys2/mingw64/src/code/util/seconds.c src/code/util
+
+# Compile
+cd src/code
+if [ $# -eq 0 ]; then
+	make
+else
+	make -j $1
+fi
+make chacominusblas.a
+
+# Clean up objects (but not library or executable)
+make clean
+cd ../..
+
+# Install
+cp -p src/exec/README ${PREFIX}
+cp -p src/exec/User_Params ${PREFIX}
+cp -p src/exec/*.coords ${PREFIX}
+cp -p src/exec/*.graph ${PREFIX}
+mkdir ${PREFIX}/include
+cp -p src/code/main/defs.h ${PREFIX}/include/defs.h
+cp -p src/code/main/params.h ${PREFIX}/include/params.h
+cp -p chaco.h ${PREFIX}/include/chaco.h
+mkdir ${PREFIX}/lib
+mv src/code/chaco.a ${PREFIX}/lib/libchaco.a
+mv src/code/chacominusblas.a ${PREFIX}/lib/libchacominusblas.a
+mkdir ${PREFIX}/exec
+mv src/exec/chaco ${PREFIX}/exec
Index: /issm/trunk/externalpackages/chaco/install.sh
===================================================================
--- /issm/trunk/externalpackages/chaco/install.sh	(revision 26743)
+++ /issm/trunk/externalpackages/chaco/install.sh	(revision 26744)
@@ -2,26 +2,32 @@
 set -eu
 
-# Some cleanup
-rm -rf Chaco-2.2
-rm -rf src 
-rm -rf install 
-mkdir src install 
 
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Chaco-2.2.tar.gz' 'Chaco-2.2.tar.gz'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf' 'chaco_guide.pdf'
+## Constants
+#
+VER=2.2
 
-# Untar 
-tar -xvzf Chaco-2.2.tar.gz
+PREFIX="${ISSM_DIR}/externalpackages/chaco/install" # Set to location where external package should be installed
 
-# Move chaco to src directory
-mv Chaco-2.2/* src
-rm -rf Chaco-2.2
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/Chaco-${VER}.tar.gz" "Chaco-${VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf" "chaco_guide.pdf"
+
+# Unpack source
+tar -xvzf Chaco-${VER}.tar.gz
+
+# Move source to 'src' directory
+mv Chaco-${VER}/* src
+rm -rf Chaco-${VER}
 
 # Apply patches (all at once)
-# (written by diff -rc src ~/Libs/Chaco-2.2 > chaco.patch)
+# (written by diff -rc src ~/Libs/Chaco-${VER} > chaco.patch)
 patch -R -p0 < chaco.patch
+patch src/code/Makefile patches/Makefile.patch
 
-# Build chaco
+# Compile
 cd src/code
 if [ $# -eq 0 ]; then
@@ -36,16 +42,16 @@
 cd ../..
 
-# Populate install directory
-cp -p src/exec/README install
-cp -p src/exec/User_Params install
-cp -p src/exec/*.coords install
-cp -p src/exec/*.graph install
-mkdir install/include
-cp -p src/code/main/defs.h install/include/defs.h
-cp -p src/code/main/params.h install/include/params.h
-cp -p chaco.h install/include/chaco.h
-mkdir install/lib
-mv src/code/chaco.a install/lib/libchaco.a
-mv src/code/chacominusblas.a install/lib/libchacominusblas.a
-mkdir install/exec
-mv src/exec/chaco install/exec
+# Install
+cp -p src/exec/README ${PREFIX}
+cp -p src/exec/User_Params ${PREFIX}
+cp -p src/exec/*.coords ${PREFIX}
+cp -p src/exec/*.graph ${PREFIX}
+mkdir ${PREFIX}/include
+cp -p src/code/main/defs.h ${PREFIX}/include/defs.h
+cp -p src/code/main/params.h ${PREFIX}/include/params.h
+cp -p chaco.h ${PREFIX}/include/chaco.h
+mkdir ${PREFIX}/lib
+mv src/code/chaco.a ${PREFIX}/lib/libchaco.a
+mv src/code/chacominusblas.a ${PREFIX}/lib/libchacominusblas.a
+mkdir ${PREFIX}/exec
+mv src/exec/chaco ${PREFIX}/exec
Index: /issm/trunk/externalpackages/chaco/patches/Makefile.mac-sierra.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/patches/Makefile.mac-sierra.patch	(revision 26744)
+++ /issm/trunk/externalpackages/chaco/patches/Makefile.mac-sierra.patch	(revision 26744)
@@ -0,0 +1,11 @@
+--- ./src/code/Makefile	2016-02-16 19:39:30.000000000 -0800
++++ ./Makefile	2016-02-16 19:37:49.000000000 -0800
+@@ -6,7 +6,7 @@
+ #CFLAGS =	-O2
+ #OFLAGS =	-O2
+ #CFLAGS =	-fPIC -fno-omit-frame-pointer -D_GNU_SOURCE -pthread -fexceptions
+-CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g
++CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g -I/usr/local/include/ -Wno-implicit-function-declaration 
+ #CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -DMATLAB
+ OFLAGS =	-O2 
+ #AR =             /usr/ccs/bin/ar rcv   # for solaris 2
Index: sm/trunk/externalpackages/chaco/patches/Makefile.macosx64-sierra.patch
===================================================================
--- /issm/trunk/externalpackages/chaco/patches/Makefile.macosx64-sierra.patch	(revision 26743)
+++ 	(revision )
@@ -1,11 +1,0 @@
---- ./src/code/Makefile	2016-02-16 19:39:30.000000000 -0800
-+++ ./Makefile	2016-02-16 19:37:49.000000000 -0800
-@@ -6,7 +6,7 @@
- #CFLAGS =	-O2
- #OFLAGS =	-O2
- #CFLAGS =	-fPIC -fno-omit-frame-pointer -D_GNU_SOURCE -pthread -fexceptions
--CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g
-+CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g -I/usr/local/include/ -Wno-implicit-function-declaration 
- #CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -DMATLAB
- OFLAGS =	-O2 
- #AR =             /usr/ccs/bin/ar rcv   # for solaris 2
Index: /issm/trunk/externalpackages/cmake/install.sh
===================================================================
--- /issm/trunk/externalpackages/cmake/install.sh	(revision 26743)
+++ /issm/trunk/externalpackages/cmake/install.sh	(revision 26744)
@@ -5,5 +5,7 @@
 ## Constants
 #
-VER="3.16.2"
+VER="3.19.3"
+
+PREFIX="${ISSM_DIR}/externalpackages/cmake/install" # Set to location where external package should be installed
 
 # Download source
@@ -14,20 +16,23 @@
 
 # Cleanup
-rm -rf install
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX}
 
-# Move source into 'install' directory
-mv cmake-${VER} install
+# Move source into 'src' directory
+mv cmake-${VER} src
 
 # Configure
-cd install
+cd src
 #./bootstrap \
-#	--prefix=${ISSM_DIR}/externalpackages/cmake/install # Breaks on ronne
+#	--prefix=${PREFIX} # Breaks on ronne
 ./configure \
-	--prefix=${ISSM_DIR}/externalpackages/cmake/install
+	--prefix="${PREFIX}"
 
-# Compile
+# Compile and install
 if [ $# -eq 0 ]; then
 	make
+	make install
 else
-	make -j $1;
+	make -j $1
+	make install -j $1
 fi
Index: /issm/trunk/externalpackages/curl/install-7-linux-static.sh
===================================================================
--- /issm/trunk/externalpackages/curl/install-7-linux-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/curl/install-7-linux-static.sh	(revision 26744)
@@ -7,26 +7,31 @@
 VER="7.73.0"
 
+PREFIX="${ISSM_DIR}/externalpackages/curl/install" # Set to location where external package should be installed
+
 # Download source
 $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/curl-${VER}.tar.gz" "curl-${VER}.tar.gz"
 
 # Unpack source
-tar -zxvf curl-$VER.tar.gz
+tar -zxvf curl-${VER}.tar.gz
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
-mv curl-$VER/* src
-rm -rf curl-$VER
+mv curl-${VER}/* src
+rm -rf curl-${VER}
 
 # Configure
 cd src
 ./configure \
-	--prefix="${ISSM_DIR}/externalpackages/curl/install" \
+	--prefix="${PREFIX}" \
 	--disable-shared \
 	--disable-dependency-tracking \
 	--disable-manual \
 	--disable-verbose \
+	--disable-ldap \
+	--disable-ldaps \
+	--with-zlib="${ZLIB_ROOT}" \
 	--without-libidn2
 
Index: /issm/trunk/externalpackages/curl/install-7-linux-with_tests.sh
===================================================================
--- /issm/trunk/externalpackages/curl/install-7-linux-with_tests.sh	(revision 26743)
+++ /issm/trunk/externalpackages/curl/install-7-linux-with_tests.sh	(revision 26744)
@@ -7,26 +7,29 @@
 VER="7.73.0"
 
+PREFIX="${ISSM_DIR}/externalpackages/curl/install" # Set to location where external package should be installed
+
 # Download source
 $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/curl-${VER}.tar.gz" "curl-${VER}.tar.gz"
 
 # Unpack source
-tar -zxvf curl-$VER.tar.gz
+tar -zxvf curl-${VER}.tar.gz
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
-mv curl-$VER/* src
-rm -rf curl-$VER
+mv curl-${VER}/* src
+rm -rf curl-${VER}
 
 # Configure
 cd src
 ./configure \
-	--prefix="${ISSM_DIR}/externalpackages/curl/install" \
+	--prefix="${PREFIX}" \
 	--disable-static \
 	--disable-dependency-tracking \
 	--disable-manual \
-	--disable-verbose
+	--disable-verbose \
+	--with-zlib="${ZLIB_ROOT}"
 
 # Compile and install
Index: /issm/trunk/externalpackages/curl/install-7-linux.sh
===================================================================
--- /issm/trunk/externalpackages/curl/install-7-linux.sh	(revision 26743)
+++ /issm/trunk/externalpackages/curl/install-7-linux.sh	(revision 26744)
@@ -7,26 +7,29 @@
 VER="7.73.0"
 
+PREFIX="${ISSM_DIR}/externalpackages/curl/install" # Set to location where external package should be installed
+
 # Download source
 $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/curl-${VER}.tar.gz" "curl-${VER}.tar.gz"
 
 # Unpack source
-tar -zxvf curl-$VER.tar.gz
+tar -zxvf curl-${VER}.tar.gz
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
-mv curl-$VER/* src
-rm -rf curl-$VER
+mv curl-${VER}/* src
+rm -rf curl-${VER}
 
 # Configure
 cd src
 ./configure \
-	--prefix="${ISSM_DIR}/externalpackages/curl/install" \
+	--prefix="${PREFIX}" \
 	--disable-static \
 	--disable-dependency-tracking \
 	--disable-manual \
-	--disable-verbose
+	--disable-verbose \
+	--with-zlib="${ZLIB_ROOT}"
 
 # Compile and install
Index: /issm/trunk/externalpackages/curl/install-7-mac-static.sh
===================================================================
--- /issm/trunk/externalpackages/curl/install-7-mac-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/curl/install-7-mac-static.sh	(revision 26744)
@@ -6,4 +6,6 @@
 #
 VER="7.73.0"
+
+PREFIX="${ISSM_DIR}/externalpackages/curl/install" # Set to location where external package should be installed
 
 ## Environment
@@ -15,22 +17,25 @@
 
 # Unpack source
-tar -zxvf curl-$VER.tar.gz
+tar -zxvf curl-${VER}.tar.gz
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
-mv curl-$VER/* src
-rm -rf curl-$VER
+mv curl-${VER}/* src
+rm -rf curl-${VER}
 
 # Configure
 cd src
 ./configure \
-	--prefix="${ISSM_DIR}/externalpackages/curl/install" \
+	--prefix="${PREFIX}" \
 	--disable-shared \
 	--disable-dependency-tracking \
 	--disable-manual \
 	--disable-verbose \
+	--disable-ldap \
+	--disable-ldaps \
+	--with-zlib="${ZLIB_ROOT}" \
 	--without-libidn2 \
 	--with-secure-transport
Index: /issm/trunk/externalpackages/curl/install-7-mac.sh
===================================================================
--- /issm/trunk/externalpackages/curl/install-7-mac.sh	(revision 26743)
+++ /issm/trunk/externalpackages/curl/install-7-mac.sh	(revision 26744)
@@ -6,4 +6,6 @@
 #
 VER="7.73.0"
+
+PREFIX="${ISSM_DIR}/externalpackages/curl/install" # Set to location where external package should be installed
 
 ## Environment
@@ -15,22 +17,23 @@
 
 # Unpack source
-tar -zxvf curl-$VER.tar.gz
+tar -zxvf curl-${VER}.tar.gz
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
-mv curl-$VER/* src
-rm -rf curl-$VER
+mv curl-${VER}/* src
+rm -rf curl-${VER}
 
 # Configure
 cd src
 ./configure \
-	--prefix="${ISSM_DIR}/externalpackages/curl/install" \
+	--prefix="${PREFIX}" \
 	--disable-static \
 	--disable-dependency-tracking \
 	--disable-manual \
 	--disable-verbose \
+	--with-zlib="${ZLIB_ROOT}" \
 	--with-secure-transport
 
Index: /issm/trunk/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.discover20.patch
===================================================================
--- /issm/trunk/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.discover20.patch	(revision 26744)
+++ /issm/trunk/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.discover20.patch	(revision 26744)
@@ -0,0 +1,35 @@
+54,55c54,55
+< #set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} <flag>"
+< #     CACHE STRING "CXX Flags for my platform" )
+---
+> set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMPICH_IGNORE_CXX_SEEK"
+>      CACHE STRING "CXX Flags for my platform" )
+67a68,75
+> set( DAKOTA_HAVE_MPI ON
+>  CACHE BOOL "Always build with MPI enabled" FORCE)
+> set( MPI_INCLUDE_PATH
+>  "$ENV{ISSM_DIR}/externalpackages/mpich/install/include"
+>  CACHE FILEPATH "Use installed MPI headers" FORCE)
+> set( MPI_LIBRARY
+>  "$ENV{ISSM_DIR}/externalpackages/mpich/install/lib/libmpich.so"
+>  CACHE FILEPATH "Use installed MPI library" FORCE)
+73,77c73,77
+< #set(BOOST_ROOT
+< #    "path/to/custom/Boost/install/directory"
+< #    CACHE PATH "Use non-standard Boost install" FORCE)
+< #set( Boost_NO_SYSTEM_PATHS TRUE
+< #     CACHE BOOL "Supress search paths other than BOOST_ROOT" FORCE)
+---
+> set(BOOST_ROOT
+>     "$ENV{ISSM_DIR}/externalpackages/boost/install"
+>     CACHE PATH "Use non-standard Boost install" FORCE)
+> set( Boost_NO_SYSTEM_PATHS TRUE
+>      CACHE BOOL "Supress search paths other than BOOST_ROOT" FORCE)
+91,93c91,93
+< #set( CMAKE_INSTALL_PREFIX
+< #     "/path/to/Dakota/installation"
+< #     CACHE PATH "Path to Dakota installation" )
+---
+> set( CMAKE_INSTALL_PREFIX
+>      "$ENV{ISSM_DIR}/externalpackages/dakota/install"
+>      CACHE PATH "Path to Dakota installation" )
Index: /issm/trunk/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.pfe.patch
===================================================================
--- /issm/trunk/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.pfe.patch	(revision 26743)
+++ /issm/trunk/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.pfe.patch	(revision 26744)
@@ -3,8 +3,8 @@
 >  CACHE BOOL "Always build with MPI enabled" FORCE)
 > set( MPI_INCLUDE_PATH
->  "$ENV{ISSM_DIR}/externalpackages/mpich/install/include"
+>  "/nasa/hpe/mpt/2.17r13/include"
 >  CACHE FILEPATH "Use installed MPI headers" FORCE)
 > set( MPI_LIBRARY
->  "$ENV{ISSM_DIR}/externalpackages/mpich/install/lib/libmpich.so"
+>  "/nasa/hpe/mpt/2.17r13/lib/libmpi.so"
 >  CACHE FILEPATH "Use installed MPI library" FORCE)
 73,77c73,77
@@ -16,5 +16,5 @@
 ---
 > set(BOOST_ROOT
->     "/nasa/boost/1.50.0"
+>     "/nasa/pkgsrc/sles12/2018Q3/" 
 >     CACHE PATH "Use non-standard Boost install" FORCE)
 > set( Boost_NO_SYSTEM_PATHS TRUE
Index: /issm/trunk/externalpackages/dakota/configs/6.2/CMakeLists.txt.pfe.patch
===================================================================
--- /issm/trunk/externalpackages/dakota/configs/6.2/CMakeLists.txt.pfe.patch	(revision 26743)
+++ /issm/trunk/externalpackages/dakota/configs/6.2/CMakeLists.txt.pfe.patch	(revision 26744)
@@ -3,4 +3,4 @@
 ---
 > # TODO: Can't this be integrated into the following logic?
-> set(BLAS_LIBS "-L/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -L/usr/lib64/ -lpthread -lm")
-> set(LAPACK_LIBS "-L/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -L/usr/lib64/ -lpthread -lm")
+> set(BLAS_LIBS "-L/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core")
+> set(LAPACK_LIBS "-L/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core")
Index: /issm/trunk/externalpackages/dakota/configs/6.2/linux/cmake/BuildDakotaCustom.cmake
===================================================================
--- /issm/trunk/externalpackages/dakota/configs/6.2/linux/cmake/BuildDakotaCustom.cmake	(revision 26743)
+++ /issm/trunk/externalpackages/dakota/configs/6.2/linux/cmake/BuildDakotaCustom.cmake	(revision 26744)
@@ -68,4 +68,6 @@
 set( MPI_LIBRARY "-L$ENV{MPI_INSTALL}/lib -lmpich"
      CACHE FILEPATH "Use MPI library" FORCE)
+set( MPI_EXTRA_LIBRARY "-L$ENV{MPI_INSTALL}/lib -lmpich"
+	  CACHE FILEPATH "Use MPI extra libraries" FORCE)
 
 ##############################################################################
Index: /issm/trunk/externalpackages/dakota/configs/6.2/packages/VPISparseGrid/src/sandia_rules.cpp
===================================================================
--- /issm/trunk/externalpackages/dakota/configs/6.2/packages/VPISparseGrid/src/sandia_rules.cpp	(revision 26744)
+++ /issm/trunk/externalpackages/dakota/configs/6.2/packages/VPISparseGrid/src/sandia_rules.cpp	(revision 26744)
@@ -0,0 +1,25739 @@
+# include "sandia_rules.hpp"
+
+# include <cstdlib>
+# include <iomanip>
+# include <iostream>
+# include <cmath>
+# include <ctime>
+
+namespace webbur
+{
+//****************************************************************************80
+
+void binary_vector_next ( int n, int bvec[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    BINARY_VECTOR_NEXT generates the next binary vector.
+//
+//  Discussion:
+//
+//    A binary vector is a vector whose entries are 0 or 1.
+//
+//    The user inputs an initial zero vector to start.  The program returns
+//    the "next" vector.
+//
+//    The vectors are produced in the order:
+//
+//    ( 0, 0, 0, ..., 0 )
+//    ( 1, 0, 0, ..., 0 )
+//    ( 0, 1, 0, ..., 0 )
+//    ( 1, 1, 0, ..., 0 )
+//    ( 0, 0, 1, ..., 0 )
+//    ( 1, 0, 1, ..., 0 )
+//               ...
+//    ( 1, 1, 1, ..., 1)
+//
+//    and the "next" vector after (1,1,...,1) is (0,0,...,0).  That is,
+//    we allow wrap around.
+//
+//  Example:
+//
+//    N = 3
+//
+//    Input      Output
+//    -----      ------
+//    0 0 0  =>  1 0 0
+//    1 0 0  =>  0 1 0
+//    0 1 0  =>  1 1 0
+//    1 1 0  =>  0 0 1
+//    0 0 1  =>  1 0 1
+//    1 0 1  =>  0 1 1
+//    0 1 1  =>  1 1 1
+//    1 1 1  =>  0 0 0
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    04 September 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the dimension of the vectors.
+//
+//    Input/output, int BVEC[N], on output, the successor
+//    to the input vector.
+//
+{
+  int i;
+
+  for ( i = 0; i < n; i++ )
+  {
+    if ( bvec[i] == 1 )
+    {
+      bvec[i] = 0;
+    }
+    else
+    {
+      bvec[i] = 1;
+      break;
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void ccn_compute ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CCN_COMPUTE computes a nested Clenshaw Curtis quadrature rule.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    07 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::ccn_compute_points ( n, x );
+  webbur::ccn_compute_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+void ccn_compute_np ( int n, int np, double p[], double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CCN_COMPUTE_NP computes a nested Clenshaw Curtis quadrature rule.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    07 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::ccn_compute_points ( n, x );
+  webbur::ccn_compute_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+void ccn_compute_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CCN_COMPUTE_POINTS: compute nested Clenshaw Curtis points.
+//
+//  Discussion:
+//
+//    We want to compute the following sequence:
+//
+//    1/2,
+//    0, 1
+//    1/4, 3/4
+//    1/8, 3/8, 5/8, 7/8,
+//    1/16, 3/16, 5/16, 7/16, 9/16, 11/16, 13/16, 15/16, and so on.
+//
+//    But we would prefer that the numbers in each row be regrouped in pairs
+//    that are symmetric about 1/2, with the number above 1/2 coming first.
+//    Thus, the last row might become:
+//    (9/16, 7/16), (11/16, 5/16), ..., (15/16, 1/16).
+//
+//    Once we have our sequence, we apply the Chebyshev transformation
+//    which maps [0,1] to [-1,+1].
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    06 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of elements to compute.
+//
+//    Output, double X[N], the elements of the sequence.
+//
+{
+  int d;
+  int i;
+  int k;
+  int m;
+  double pi = 3.141592653589793;
+  int td;
+  int tu;
+//
+//  Handle first three entries specially.
+//
+  if ( 1 <= n )
+  {
+    x[0] = 0.5;
+  }
+
+  if ( 2 <= n )
+  {
+    x[1] = 1.0;
+  }
+
+  if ( 3 <= n )
+  {
+    x[2] = 0.0;
+  }
+
+  m = 3;
+  d = 2;
+
+  while ( m < n )
+  {
+    tu = d + 1;
+    td = d - 1;
+
+    k = webbur::i4_min ( d, n - m );
+
+    for ( i = 1; i <= k; i++ )
+    {
+      if ( ( i % 2 ) == 1 )
+      {
+        x[m+i-1] = tu / 2.0 / ( double ) ( k );
+        tu = tu + 2;
+      }
+      else
+      {
+        x[m+i-1] = td / 2.0 / ( double ) ( k );
+        td = td - 2;
+      }
+    }
+    m = m + k;
+    d = d * 2;
+  }
+//
+//  Apply the Chebyshev transformation.
+//
+  for ( i = 0; i < n; i++ )
+  {
+    x[i] = std::cos ( x[i] * pi );
+  }
+  x[0] = 0.0;
+
+  if ( 2 <= n )
+  {
+    x[1] = -1.0;
+  }
+
+  if ( 3 <= n )
+  {
+    x[2] = +1.0;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void ccn_compute_points_np ( int n, int np, double p[], double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CCN_COMPUTE_POINTS_NP: nested Clenshaw Curtis quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    07 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  webbur::ccn_compute_points ( n, x );
+
+  return;
+}
+//****************************************************************************80
+
+void ccn_compute_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CCN_COMPUTE_WEIGHTS: weights for nested Clenshaw Curtis rule.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    07 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order of the rule.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double *x;
+  double x_max;
+  double x_min;
+
+  x = new double[n];
+
+  webbur::ccn_compute_points ( n, x );
+//
+//  Get the weights.
+//
+  x_min = -1.0;
+  x_max = +1.0;
+
+  webbur::nc_compute ( n, x_min, x_max, x, w );
+
+  delete [] x;
+
+  return;
+}
+//****************************************************************************80
+
+void ccn_compute_weights_np ( int n, int np, double p[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CCN_COMPUTE_WEIGHTS_NP: nested Clenshaw Curtis quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    07 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::ccn_compute_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+void chebyshev1_compute ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CHEBYSHEV1_COMPUTE computes a Chebyshev type 1 quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( -1 <= X <= 1 ) F(X) / sqrt ( 1 - x^2 ) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  int i;
+  double pi = 3.141592653589793;
+
+  if ( n < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "CHEBYSHEV1_COMPUTE - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::exit ( 1 );
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    w[i] = pi / ( double ) ( n );
+  }
+  for ( i = 0; i < n; i++ )
+  {
+    x[i] = std::cos ( pi * ( double ) ( 2 * n - 1 - 2 * i )
+                         / ( double ) ( 2 * n ) );
+  }
+  if ( ( n % 2 ) == 1 )
+  {
+    x[(n-1)/2] = 0.0;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void chebyshev1_compute_np ( int n, int np, double p[], double x[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CHEBYSHEV1_COMPUTE_NP computes a Chebyshev type 1 quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( -1 <= X <= 1 ) F(X) / sqrt ( 1 - x^2 ) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::chebyshev1_compute ( n, x, w );
+
+  return;
+}
+//****************************************************************************80
+
+void chebyshev1_compute_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CHEBYSHEV1_COMPUTE_POINTS computes Chebyshev type 1 quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  int i;
+  double pi = 3.141592653589793;
+
+  if ( n < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "CHEBYSHEV1_COMPUTE_POINTS - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::exit ( 1 );
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    x[i] =  std::cos ( pi * ( double ) ( 2 * n - 1 - 2 * i )
+                          / ( double ) ( 2 * n ) );
+  }
+  if ( ( n % 2 ) == 1 )
+  {
+    x[(n-1)/2] = 0.0;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void chebyshev1_compute_points_np ( int n, int np, double p[], double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CHEBYSHEV1_COMPUTE_POINTS_NP computes Chebyshev type 1 quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  webbur::chebyshev1_compute_points ( n, x );
+
+  return;
+}
+//****************************************************************************80
+
+void chebyshev1_compute_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CHEBYSHEV1_COMPUTE_WEIGHTS computes Chebyshev type 1 quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Output, double W[N], the weights.
+//
+{
+  int i;
+  double pi = 3.141592653589793;
+
+  if ( n < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "CHEBYSHEV1_COMPUTE_WEIGHTS - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::exit ( 1 );
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    w[i] = pi / ( double ) ( n );
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void chebyshev1_compute_weights_np ( int n, int np, double p[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CHEBYSHEV1_COMPUTE_WEIGHTS_NP: Chebyshev type 1 quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::chebyshev1_compute_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+double chebyshev1_integral ( int expon )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CHEBYSHEV1_INTEGRAL evaluates a monomial Chebyshev type 1 integral.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( -1 <= x <= +1 ) x^n / sqrt ( 1 - x^2 ) dx
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    26 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int EXPON, the exponent.
+//
+//    Output, double CHEBYSHEV1_INTEGRAL, the value of the exact integral.
+//
+{
+  double bot;
+  double exact;
+  int i;
+  double pi = 3.141592653589793;
+  double top;
+//
+//  Get the exact value of the integral.
+//
+  if ( ( expon % 2 ) == 0 )
+  {
+    top = 1;
+    bot = 1;
+    for ( i = 2; i <= expon; i = i + 2 )
+    {
+      top = top * ( i - 1 );
+      bot = bot *   i;
+    }
+
+    exact = pi * ( double ) ( top ) / ( double ) ( bot );
+  }
+  else
+  {
+    exact = 0.0;
+  }
+
+  return exact;
+}
+//****************************************************************************80
+
+void chebyshev2_compute ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CHEBYSHEV2_COMPUTE computes a Chebyshev type 2 quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( -1 <= x <= 1 ) f(x)  sqrt ( 1 - x^2 )  dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double angle;
+  int i;
+  double pi = 3.141592653589793;
+
+  if ( n < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "CHEBYSHEV2_COMPUTE - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::exit ( 1 );
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    angle = pi * ( double ) ( n - i ) / ( double ) ( n + 1 );
+    w[i] = pi / ( double ) ( n + 1 ) * std::pow ( std::sin ( angle ), 2 );
+    x[i] = std::cos ( angle );
+  }
+
+  if ( ( n % 2 ) == 1 )
+  {
+    x[(n-1)/2] = 0.0;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void chebyshev2_compute_np ( int n, int np, double p[], double x[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CHEBYSHEV2_COMPUTE_NP computes a Chebyshev type 2 quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( -1 <= X <= 1 ) F(X)  sqrt ( 1 - x^2 )  dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::chebyshev2_compute ( n, x, w );
+
+  return;
+}
+//****************************************************************************80
+
+void chebyshev2_compute_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CHEBYSHEV2_COMPUTE_POINTS computes Chebyshev type 2 quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  double angle;
+  int i;
+  double pi = 3.141592653589793;
+
+  if ( n < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "CHEBYSHEV2_COMPUTE_POINTS - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::exit ( 1 );
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    angle = pi * ( double ) ( n - i ) / ( double ) ( n + 1 );
+    x[i] =  std::cos ( angle );
+  }
+
+  if ( ( n % 2 ) == 1 )
+  {
+    x[(n-1)/2] = 0.0;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void chebyshev2_compute_points_np ( int n, int np, double p[], double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CHEBYSHEV2_COMPUTE_POINTS_NP computes Chebyshev type 2 quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    03 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  webbur::chebyshev2_compute_points ( n, x );
+
+  return;
+}
+//****************************************************************************80
+
+void chebyshev2_compute_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CHEBYSHEV2_COMPUTE_WEIGHTS computes Chebyshev type 2 quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double angle;
+  int i;
+  double pi = 3.141592653589793;
+
+  if ( n < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "CHEBYSHEV2_COMPUTE_WEIGHTS - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::exit ( 1 );
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    angle = pi * ( double ) ( n - i ) / ( double ) ( n + 1 );
+    w[i] = pi / ( double ) ( n + 1 ) * std::pow ( std::sin ( angle ), 2 );
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void chebyshev2_compute_weights_np ( int n, int np, double p[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CHEBYSHEV2_COMPUTE_WEIGHTS_NP: Chebyshev type 2 quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::chebyshev2_compute_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+double chebyshev2_integral ( int expon )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CHEBYSHEV2_INTEGRAL evaluates a monomial Chebyshev type 2 integral.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( -1 <= x <= +1 ) x^n * sqrt ( 1 - x^2 ) dx
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    26 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int EXPON, the exponent.
+//
+//    Output, double CHEBYSHEV2_INTEGRAL, the value of the exact integral.
+//
+{
+  double bot;
+  double exact;
+  int i;
+  double pi = 3.141592653589793;
+  double top;
+//
+//  Get the exact value of the integral.
+//
+  if ( ( expon % 2 ) == 0 )
+  {
+    top = 1;
+    bot = 1;
+    for ( i = 2; i <= expon; i = i + 2 )
+    {
+      top = top * ( i - 1 );
+      bot = bot *   i;
+    }
+
+	bot = bot * ( double ) ( expon + 2 );
+
+    exact = pi * ( double ) ( top ) / ( double ) ( bot );
+  }
+  else
+  {
+    exact = 0.0;
+  }
+  return exact;
+}
+//****************************************************************************80
+
+void clenshaw_curtis_compute ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CLENSHAW_CURTIS_COMPUTE computes a Clenshaw Curtis quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( -1 <= X <= 1 ) F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 March 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double b;
+  int i;
+  int j;
+  double pi = 3.141592653589793;
+  double theta;
+
+  if ( n < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "CLENSHAW_CURTIS_COMPUTE - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::exit ( 1 );
+  }
+  else if ( n == 1 )
+  {
+    x[0] = 0.0;
+    w[0] = 2.0;
+  }
+  else
+  {
+    for ( i = 0; i < n; i++ )
+    {
+      x[i] =  std::cos ( ( double ) ( n - 1 - i ) * pi
+                       / ( double ) ( n - 1     ) );
+    }
+    x[0] = -1.0;
+    if ( ( n % 2 ) == 1 )
+    {
+      x[(n-1)/2] = 0.0;
+    }
+    x[n-1] = +1.0;
+
+    for ( i = 0; i < n; i++ )
+    {
+      theta = ( double ) ( i ) * pi / ( double ) ( n - 1 );
+
+      w[i] = 1.0;
+
+      for ( j = 1; j <= ( n - 1 ) / 2; j++ )
+      {
+        if ( 2 * j == ( n - 1 ) )
+        {
+          b = 1.0;
+        }
+        else
+        {
+          b = 2.0;
+        }
+
+        w[i] = w[i] - b *  std::cos ( 2.0 * ( double ) ( j ) * theta )
+          / ( double ) ( 4 * j * j - 1 );
+      }
+    }
+
+    w[0] = w[0] / ( double ) ( n - 1 );
+    for ( i = 1; i < n - 1; i++ )
+    {
+      w[i] = 2.0 * w[i] / ( double ) ( n - 1 );
+    }
+    w[n-1] = w[n-1] / ( double ) ( n - 1 );
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void clenshaw_curtis_compute_np ( int n, int np, double p[], double x[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CLENSHAW_CURTIS_COMPUTE_NP computes a Clenshaw Curtis quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( -1 <= X <= 1 ) F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::clenshaw_curtis_compute ( n, x, w );
+
+  return;
+}
+//****************************************************************************80
+
+void clenshaw_curtis_compute_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CLENSHAW_CURTIS_COMPUTE_POINTS computes Clenshaw Curtis quadrature points.
+//
+//  Discussion:
+//
+//    Our convention is that the abscissas are numbered from left to right.
+//
+//    This rule is defined on [-1,1].
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  int index;
+  double pi = 3.141592653589793;
+
+  if ( n < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "CLENSHAW_CURTIS_COMPUTE_POINTS - Fatal error!\n";
+    std::cerr << "  N < 1.\n";
+    std::exit ( 1 );
+  }
+  else if ( n == 1 )
+  {
+    x[0] = 0.0;
+  }
+  else
+  {
+    for ( index = 1; index <= n; index++ )
+    {
+      x[index-1] =  std::cos ( ( double ) ( n - index ) * pi
+                             / ( double ) ( n - 1     ) );
+    }
+    x[0] = -1.0;
+    if ( ( n % 2 ) == 1 )
+    {
+      x[(n-1)/2] = 0.0;
+    }
+    x[n-1] = +1.0;
+  }
+  return;
+}
+//****************************************************************************80
+
+void clenshaw_curtis_compute_points_np ( int n, int np, double p[], double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CLENSHAW_CURTIS_COMPUTE_POINTS_NP: Clenshaw Curtis quadrature points.
+//
+//  Discussion:
+//
+//    Our convention is that the abscissas are numbered from left to right.
+//
+//    This rule is defined on [-1,1].
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  webbur::clenshaw_curtis_compute_points ( n, x );
+
+  return;
+}
+//****************************************************************************80
+
+void clenshaw_curtis_compute_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CLENSHAW_CURTIS_COMPUTE_WEIGHTS computes Clenshaw Curtis quadrature weights.
+//
+//  Discussion:
+//
+//    The user must preallocate space for the output array W.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Charles Clenshaw, Alan Curtis,
+//    A Method for Numerical Integration on an Automatic Computer,
+//    Numerische Mathematik,
+//    Volume 2, Number 1, December 1960, pages 197-205.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double b;
+  int i;
+  int j;
+  double pi = 3.141592653589793;
+  double theta;
+
+  if ( n < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "CLENSHAW_CURTIS_COMPUTE_WEIGHTS - Fatal error!\n";
+    std::cerr << "  N < 1.\n";
+    std::exit ( 1 );
+  }
+  else if ( n == 1 )
+  {
+    w[0] = 2.0;
+    return;
+  }
+
+  for ( i = 1; i <= n; i++ )
+  {
+    theta = ( double ) ( i - 1 ) * pi / ( double ) ( n - 1 );
+
+    w[i-1] = 1.0;
+
+    for ( j = 1; j <= ( n - 1 ) / 2; j++ )
+    {
+      if ( 2 * j == ( n - 1 ) )
+      {
+        b = 1.0;
+      }
+      else
+      {
+        b = 2.0;
+      }
+
+      w[i-1] = w[i-1] - b *  std::cos ( 2.0 * ( double ) ( j ) * theta )
+           / ( double ) ( 4 * j * j - 1 );
+    }
+  }
+
+  w[0] = w[0] / ( double ) ( n - 1 );
+  for ( i = 1; i < n - 1; i++ )
+  {
+    w[i] = 2.0 * w[i] / ( double ) ( n - 1 );
+  }
+  w[n-1] = w[n-1] / ( double ) ( n - 1 );
+
+  return;
+}
+//****************************************************************************80
+
+void clenshaw_curtis_compute_weights_np ( int n, int np, double p[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CLENSHAW_CURTIS_COMPUTE_WEIGHTS_NP: Clenshaw Curtis quadrature weights.
+//
+//  Discussion:
+//
+//    The user must preallocate space for the output array W.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Charles Clenshaw, Alan Curtis,
+//    A Method for Numerical Integration on an Automatic Computer,
+//    Numerische Mathematik,
+//    Volume 2, Number 1, December 1960, pages 197-205.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::clenshaw_curtis_compute_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+void comp_next ( int n, int k, int a[], bool *more, int *h, int *t )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    COMP_NEXT computes the compositions of the integer N into K parts.
+//
+//  Discussion:
+//
+//    A composition of the integer N into K parts is an ordered sequence
+//    of K nonnegative integers which sum to N.  The compositions (1,2,1)
+//    and (1,1,2) are considered to be distinct.
+//
+//    The routine computes one composition on each call until there are no more.
+//    For instance, one composition of 6 into 3 parts is
+//    3+2+1, another would be 6+0+0.
+//
+//    On the first call to this routine, set MORE = FALSE.  The routine
+//    will compute the first element in the sequence of compositions, and
+//    return it, as well as setting MORE = TRUE.  If more compositions
+//    are desired, call again, and again.  Each time, the routine will
+//    return with a new composition.
+//
+//    However, when the LAST composition in the sequence is computed
+//    and returned, the routine will reset MORE to FALSE, signaling that
+//    the end of the sequence has been reached.
+//
+//    This routine originally used a SAVE statement to maintain the
+//    variables H and T.  I have decided that it is safer
+//    to pass these variables as arguments, even though the user should
+//    never alter them.  This allows this routine to safely shuffle
+//    between several ongoing calculations.
+//
+//
+//    There are 28 compositions of 6 into three parts.  This routine will
+//    produce those compositions in the following order:
+//
+//     I         A
+//     -     ---------
+//     1     6   0   0
+//     2     5   1   0
+//     3     4   2   0
+//     4     3   3   0
+//     5     2   4   0
+//     6     1   5   0
+//     7     0   6   0
+//     8     5   0   1
+//     9     4   1   1
+//    10     3   2   1
+//    11     2   3   1
+//    12     1   4   1
+//    13     0   5   1
+//    14     4   0   2
+//    15     3   1   2
+//    16     2   2   2
+//    17     1   3   2
+//    18     0   4   2
+//    19     3   0   3
+//    20     2   1   3
+//    21     1   2   3
+//    22     0   3   3
+//    23     2   0   4
+//    24     1   1   4
+//    25     0   2   4
+//    26     1   0   5
+//    27     0   1   5
+//    28     0   0   6
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    02 July 2008
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Albert Nijenhuis, Herbert Wilf.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Albert Nijenhuis, Herbert Wilf,
+//    Combinatorial Algorithms for Computers and Calculators,
+//    Second Edition,
+//    Academic Press, 1978,
+//    ISBN: 0-12-519260-6,
+//    LC: QA164.N54.
+//
+//  Parameters:
+//
+//    Input, int N, the integer whose compositions are desired.
+//
+//    Input, int K, the number of parts in the composition.
+//
+//    Input/output, int A[K], the parts of the composition.
+//
+//    Input/output, bool *MORE.
+//    Set MORE = FALSE on first call.  It will be reset to TRUE on return
+//    with a new composition.  Each new call returns another composition until
+//    MORE is set to FALSE when the last composition has been computed
+//    and returned.
+//
+//    Input/output, int *H, *T, two internal parameters needed for the
+//    computation.  The user should allocate space for these in the calling
+//    program, include them in the calling sequence, but never alter them!
+//
+{
+  int i;
+
+  if ( !( *more ) )
+  {
+    *t = n;
+    *h = 0;
+    a[0] = n;
+    for ( i = 1; i < k; i++ )
+    {
+       a[i] = 0;
+    }
+  }
+  else
+  {
+    if ( 1 < *t )
+    {
+      *h = 0;
+    }
+    *h = *h + 1;
+    *t = a[*h-1];
+    a[*h-1] = 0;
+    a[0] = *t - 1;
+    a[*h] = a[*h] + 1;
+  }
+
+  *more = ( a[k-1] != n );
+
+  return;
+}
+//****************************************************************************80
+
+double cpu_time ( )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    CPU_TIME reports the elapsed CPU time.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    26 July 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Output, double CPU_TIME, the current total elapsed CPU time in second.
+//
+{
+  double value;
+
+  value = ( double ) std::clock ( ) / ( double ) CLOCKS_PER_SEC;
+
+  return value;
+}
+//****************************************************************************80
+
+void dif_deriv ( int nd, double xd[], double yd[], int *ndp, double xdp[],
+  double ydp[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    DIF_DERIV computes the derivative of a polynomial in divided difference form.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    23 June 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Carl deBoor,
+//    A Practical Guide to Splines,
+//    Springer, 2001,
+//    ISBN: 0387953663,
+//    LC: QA1.A647.v27.
+//
+//  Parameters:
+//
+//    Input, int ND, the size of the input table.
+//
+//    Input, double XD[ND], the abscissas for the divided
+//    difference table.
+//
+//    Input, double YD[ND], the divided difference table.
+//
+//    Output, int *NDP, the size of the output table, which is ND-1.
+//
+//    Input, double XDP[NP], the abscissas for the divided
+//    difference table for the derivative.
+//
+//    Output, double YDP[NDP], the divided difference
+//    table for the derivative.
+//
+{
+  int i;
+  double *xd_temp;
+  double *yd_temp;
+//
+//  Using a temporary copy of the difference table, shift the
+//  abscissas to zero.
+//
+  xd_temp = new double[nd];
+  yd_temp = new double[nd];
+
+  for ( i = 0; i < nd; i++ )
+  {
+    xd_temp[i] = xd[i];
+  }
+  for ( i = 0; i < nd; i++ )
+  {
+    yd_temp[i] = yd[i];
+  }
+
+  webbur::dif_shift_zero ( nd, xd_temp, yd_temp );
+//
+//  Construct the derivative.
+//
+  *ndp = nd - 1;
+
+  for ( i = 0; i < *ndp; i++ )
+  {
+    xdp[i] = 0.0;
+  }
+
+  for ( i = 0; i < *ndp; i++ )
+  {
+    ydp[i] = ( double ) ( i + 1 ) * yd_temp[i+1];
+  }
+
+  delete [] xd_temp;
+  delete [] yd_temp;
+
+  return;
+}
+//****************************************************************************80
+
+void dif_shift_x ( int nd, double xd[], double yd[], double xv )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    DIF_SHIFT_X replaces one abscissa of a divided difference table with a new one.
+//
+//  Discussion:
+//
+//    This routine shifts the representation of a divided difference polynomial by
+//    dropping the last X value in XD, and adding a new X value to the
+//    beginning of the Xd array, suitably modifying the coefficients stored
+//    in YD.
+//
+//    The representation of the polynomial is changed, but the polynomial itself
+//    should be identical.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    23 June 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Carl deBoor,
+//    A Practical Guide to Splines,
+//    Springer, 2001,
+//    ISBN: 0387953663,
+//    LC: QA1.A647.v27.
+//
+//  Parameters:
+//
+//    Input, int ND, the number of divided difference coefficients, and
+//    the number of entries in XD.
+//
+//    Input/output, double XD[ND], the X values used in the representation of
+//    the divided difference polynomial.  After a call to this routine, the
+//    last entry of XD has been dropped, the other
+//    entries have shifted up one index, and XV has been inserted at the
+//    beginning of the array.
+//
+//    Input/output, double YD[ND], the divided difference coefficients
+//    corresponding to the XD array.  On output, this array has been
+//    adjusted.
+//
+//    Input, double XV, a new X value which is to be used in the representation
+//    of the polynomial.  On output, XD[0] equals XV and the representation
+//    of the polynomial has been suitably changed.
+//    Note that XV does not have to be distinct from any of the original XD
+//    values.
+//
+{
+  int i;
+//
+//  Recompute the divided difference coefficients.
+//
+  for ( i = nd - 2; 0 <= i; i-- )
+  {
+    yd[i] = yd[i] + ( xv - xd[i] ) * yd[i+1];
+  }
+//
+//  Shift the X values up one position and insert XV.
+//
+  for ( i = nd - 1; 0 < i; i-- )
+  {
+    xd[i] = xd[i-1];
+  }
+
+  xd[0] = xv;
+
+  return;
+}
+//****************************************************************************80
+
+void dif_shift_zero ( int nd, double xd[], double yd[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    DIF_SHIFT_ZERO shifts a divided difference table so that all abscissas are zero.
+//
+//  Discussion:
+//
+//    When the abscissas are changed, the coefficients naturally
+//    must also be changed.
+//
+//    The resulting pair (XD, YD) still represents the
+//    same polynomial, but the entries in YD are now the
+//    standard polynomial coefficients.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    23 June 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Carl deBoor,
+//    A Practical Guide to Splines,
+//    Springer, 2001,
+//    ISBN: 0387953663,
+//    LC: QA1.A647.v27.
+//
+//  Parameters:
+//
+//    Input, int ND, the length of the XD and YD arrays.
+//
+//    Input/output, double XD[ND], the X values that correspond to the
+//    divided difference table.  On output, XD contains only zeroes.
+//
+//    Input/output, double YD[ND], the divided difference table
+//    for the polynomial.  On output, YD is also
+//    the coefficient array for the standard representation
+//    of the polynomial.
+//
+{
+  int i;
+  double xv;
+
+  xv = 0.0;
+
+  for ( i = 1; i <= nd; i++ )
+  {
+    webbur::dif_shift_x ( nd, xd, yd, xv );
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void dif_to_r8poly ( int nd, double xd[], double yd[], double c[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    DIF_TO_R8POLY converts a divided difference table to a standard polynomial.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    21 February 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Carl deBoor,
+//    A Practical Guide to Splines,
+//    Springer, 2001,
+//    ISBN: 0387953663,
+//    LC: QA1.A647.v27.
+//
+//  Parameters:
+//
+//    Input, int ND, the number of coefficients, and abscissas.
+//
+//    Input, double XD[ND], the X values used in the divided difference
+//    representation of the polynomial.
+//
+//    Input, double YD[ND], the divided difference table.
+//
+//    Output, double C[ND], the standard form polyomial coefficients.
+//    C[0] is the constant term, and C[ND-1] is the coefficient
+//    of X^(ND-1).
+//
+{
+  int i;
+  int j;
+
+  for ( i = 0; i < nd; i++ )
+  {
+    c[i] = yd[i];
+  }
+//
+//  Recompute the divided difference coefficients.
+//
+  for ( j = 1; j <= nd - 1; j++ )
+  {
+    for ( i = 1; i <= nd - j; i++ )
+    {
+      c[nd-i-1] = c[nd-i-1] - xd[nd-i-j] * c[nd-i];
+    }
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void fejer2_compute ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    FEJER2_COMPUTE computes a Fejer type 2 rule.
+//
+//  Discussion:
+//
+//    Our convention is that the abscissas are numbered from left to right.
+//
+//    The rule is defined on [-1,1].
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  int i;
+  int j;
+  double p;
+  double pi = 3.141592653589793;
+  double theta;
+
+  if ( n < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "FEJER2_COMPUTE - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::exit ( 1 );
+  }
+  else if ( n == 1 )
+  {
+    x[0] = 0.0;
+    w[0] = 2.0;
+    return;
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    x[i] =  std::cos ( ( double ) ( n - i ) * pi
+                     / ( double ) ( n + 1 ) );
+  }
+  if ( ( n % 2 ) == 1 )
+  {
+    x[(n-1)/2] = 0.0;
+  }
+
+  if ( n == 2 )
+  {
+    w[0] = 1.0;
+    w[1] = 1.0;
+  }
+  else
+  {
+    for ( i = 0; i < n; i++ )
+    {
+      theta = ( double ) ( n - i ) * pi
+            / ( double ) ( n + 1 );
+
+      w[i] = 1.0;
+
+      for ( j = 1; j <= ( ( n - 1 ) / 2 ); j++ )
+      {
+        w[i] = w[i] - 2.0 *  std::cos ( 2.0 * ( double ) ( j ) * theta )
+          / ( double ) ( 4 * j * j - 1 );
+      }
+      p = 2.0 * ( double ) ( ( ( n + 1 ) / 2 ) ) - 1.0;
+      w[i] = w[i] -  std::cos ( ( p + 1.0 ) * theta ) / p;
+    }
+    for ( i = 0; i < n; i++ )
+    {
+      w[i] = 2.0 * w[i] / ( double ) ( n + 1 );
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void fejer2_compute_np ( int n, int np, double p[], double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    FEJER2_COMPUTE_NP computes a Fejer type 2 rule.
+//
+//  Discussion:
+//
+//    Our convention is that the abscissas are numbered from left to right.
+//
+//    The rule is defined on [-1,1].
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::fejer2_compute ( n, x, w );
+
+  return;
+}
+//****************************************************************************80
+
+void fejer2_compute_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    FEJER2_COMPUTE_POINTS computes Fejer type 2 quadrature points.
+//
+//  Discussion:
+//
+//    Our convention is that the abscissas are numbered from left to right.
+//
+//    The rule is defined on [-1,1].
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  int i;
+  double pi = 3.141592653589793;
+
+  if ( n < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "FEJER2_COMPUTE_POINTS - Fatal error!\n";
+    std::cerr << "  N < 1.\n";
+    std::exit ( 1 );
+  }
+  else if ( n == 1 )
+  {
+    x[0] = 0.0;
+  }
+  else
+  {
+    for ( i = 1; i <= n; i++ )
+    {
+      x[i-1] =  std::cos ( ( double ) ( n + 1 - i ) * pi
+                         / ( double ) ( n + 1 ) );
+    }
+    if ( ( n % 2 ) == 1 )
+    {
+      x[(n-1)/2] = 0.0;
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void fejer2_compute_points_np ( int n, int np, double p[], double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    FEJER2_COMPUTE_POINTS_NP computes Fejer type 2 quadrature points.
+//
+//  Discussion:
+//
+//    Our convention is that the abscissas are numbered from left to right.
+//
+//    The rule is defined on [-1,1].
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  webbur::fejer2_compute_points ( n, x );
+
+  return;
+}
+//****************************************************************************80
+
+void fejer2_compute_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    FEJER2_COMPUTE_WEIGHTS computes Fejer type 2 quadrature weights.
+//
+//  Discussion:
+//
+//    The user must preallocate space for the output array W.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//    Walter Gautschi,
+//    Numerical Quadrature in the Presence of a Singularity,
+//    SIAM Journal on Numerical Analysis,
+//    Volume 4, Number 3, 1967, pages 357-362.
+//
+//    Joerg Waldvogel,
+//    Fast Construction of the Fejer and Clenshaw-Curtis Quadrature Rules,
+//    BIT Numerical Mathematics,
+//    Volume 43, Number 1, 2003, pages 1-18.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double W[N], the weights.
+//
+{
+  int i;
+  int j;
+  double p;
+  double pi = 3.141592653589793;
+  double theta;
+
+  if ( n < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "FEJER2_COMPUTE_WEIGHTS - Fatal error!\n";
+    std::cerr << "  N < 1.\n";
+    std::exit ( 1 );
+  }
+  else if ( n == 1 )
+  {
+    w[0] = 2.0;
+  }
+  else if ( n == 2 )
+  {
+    w[0] = 1.0;
+    w[1] = 1.0;
+  }
+  else
+  {
+    for ( i = 1; i <= n; i++ )
+    {
+      theta = ( double ) ( n + 1 - i ) * pi
+            / ( double ) ( n + 1 );
+
+      w[i-1] = 1.0;
+
+      for ( j = 1; j <= ( ( n - 1 ) / 2 ); j++ )
+      {
+        w[i-1] = w[i-1] - 2.0 *  std::cos ( 2.0 * ( double ) ( j ) * theta )
+          / ( double ) ( 4 * j * j - 1 );
+      }
+      p = 2.0 * ( double ) ( ( ( n + 1 ) / 2 ) ) - 1.0;
+      w[i-1] = w[i-1] -  std::cos ( ( p + 1.0 ) * theta ) / p;
+    }
+    for ( i = 0; i < n; i++ )
+    {
+      w[i] = 2.0 * w[i] / ( double ) ( n + 1 );
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void fejer2_compute_weights_np ( int n, int np, double p[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    FEJER2_COMPUTE_WEIGHTS_NP computes Fejer type 2 quadrature weights.
+//
+//  Discussion:
+//
+//    The user must preallocate space for the output array W.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//    Walter Gautschi,
+//    Numerical Quadrature in the Presence of a Singularity,
+//    SIAM Journal on Numerical Analysis,
+//    Volume 4, Number 3, 1967, pages 357-362.
+//
+//    Joerg Waldvogel,
+//    Fast Construction of the Fejer and Clenshaw-Curtis Quadrature Rules,
+//    BIT Numerical Mathematics,
+//    Volume 43, Number 1, 2003, pages 1-18.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::fejer2_compute_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+void gegenbauer_compute ( int order, double alpha, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEGENBAUER_COMPUTE computes a Gegenbauer quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( -1 <= X <= 1 ) (1-X^2)^ALPHA * F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+//
+//    Thanks to Janiki Raman for pointing out a problem in an earlier
+//    version of the code that occurred when ALPHA was -0.5.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Input, double ALPHA, the exponent of (1-X^2).  -1.0 < ALPHA is required.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double an;
+  double *c;
+  double cc;
+  double delta;
+  double dp2;
+  int i;
+  double p1;
+  double prod;
+  double r1;
+  double r2;
+  double r3;
+  double temp;
+  double x0;
+//
+//  Check ORDER.
+//
+  if ( order < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "GEGENBAUER_COMPUTE - Fatal error!\n";
+    std::cerr << "  1 <= ORDER is required.\n";
+    std::exit ( 1 );
+  }
+  c = new double[order];
+//
+//  Check ALPHA.
+//
+  if ( alpha <= -1.0 )
+  {
+    std::cerr << "\n";
+    std::cerr << "GEGENBAUER_COMPUTE - Fatal error!\n";
+    std::cerr << "  -1.0 < ALPHA is required.\n";
+    std::exit ( 1 );
+  }
+//
+//  Set the recursion coefficients.
+//
+  c[0] = 0.0;
+  if ( 2 <= order )
+  {
+    c[1] = 1.0 / ( 2.0 * alpha + 3.0 );
+  }
+
+  for ( i = 3; i <= order; i++ )
+  {
+    c[i-1] = ( double ) ( i - 1 )
+          * ( alpha + alpha + ( double ) ( i - 1 ) ) /
+          ( ( alpha + alpha + ( double ) ( 2 * i - 1 ) )
+          * ( alpha + alpha + ( double ) ( 2 * i - 3 ) ) );
+  }
+
+  delta = webbur::r8_gamma ( alpha         + 1.0 )
+        * webbur::r8_gamma (         alpha + 1.0 )
+        / webbur::r8_gamma ( alpha + alpha + 2.0 );
+
+  prod = 1.0;
+  for ( i = 2; i <= order; i++ )
+  {
+    prod = prod * c[i-1];
+  }
+  cc = delta * std::pow ( 2.0, alpha + alpha + 1.0 ) * prod;
+
+  for ( i = 1; i <= order; i++ )
+  {
+    if ( i == 1 )
+    {
+      an = alpha / ( double ) ( order );
+
+      r1 = ( 1.0 + alpha )
+        * ( 2.78 / ( 4.0 + ( double ) ( order * order ) )
+        + 0.768 * an / ( double ) ( order ) );
+
+      r2 = 1.0 + 2.44 * an + 1.282 * an * an;
+
+      x0 = ( r2 - r1 ) / r2;
+    }
+    else if ( i == 2 )
+    {
+      r1 = ( 4.1 + alpha ) /
+        ( ( 1.0 + alpha ) * ( 1.0 + 0.156 * alpha ) );
+
+      r2 = 1.0 + 0.06 * ( ( double ) ( order ) - 8.0 ) *
+        ( 1.0 + 0.12 * alpha ) / ( double ) ( order );
+
+      r3 = 1.0 + 0.012 * alpha *
+        ( 1.0 + 0.25 * r8_abs ( alpha ) ) / ( double ) ( order );
+
+      x0 = x0 - r1 * r2 * r3 * ( 1.0 - x0 );
+    }
+    else if ( i == 3 )
+    {
+      r1 = ( 1.67 + 0.28 * alpha ) / ( 1.0 + 0.37 * alpha );
+
+      r2 = 1.0 + 0.22 * ( ( double ) ( order ) - 8.0 )
+        / ( double ) ( order );
+
+      r3 = 1.0 + 8.0 * alpha /
+        ( ( 6.28 + alpha ) * ( double ) ( order * order ) );
+
+      x0 = x0 - r1 * r2 * r3 * ( x[0] - x0 );
+    }
+    else if ( i < order - 1 )
+    {
+      x0 = 3.0 * x[i-2] - 3.0 * x[i-3] + x[i-4];
+    }
+    else if ( i == order - 1 )
+    {
+      r1 = ( 1.0 + 0.235 * alpha ) / ( 0.766 + 0.119 * alpha );
+
+      r2 = 1.0 / ( 1.0 + 0.639
+        * ( ( double ) ( order ) - 4.0 )
+        / ( 1.0 + 0.71 * ( ( double ) ( order ) - 4.0 ) ) );
+
+      r3 = 1.0 / ( 1.0 + 20.0 * alpha / ( ( 7.5 + alpha ) *
+        ( double ) ( order * order ) ) );
+
+      x0 = x0 + r1 * r2 * r3 * ( x0 - x[i-3] );
+    }
+    else if ( i == order )
+    {
+      r1 = ( 1.0 + 0.37 * alpha ) / ( 1.67 + 0.28 * alpha );
+
+      r2 = 1.0 /
+        ( 1.0 + 0.22 * ( ( double ) ( order ) - 8.0 )
+        / ( double ) ( order ) );
+
+      r3 = 1.0 / ( 1.0 + 8.0 * alpha /
+        ( ( 6.28 + alpha ) * ( double ) ( order * order ) ) );
+
+      x0 = x0 + r1 * r2 * r3 * ( x0 - x[i-3] );
+    }
+
+    webbur::gegenbauer_root ( &x0, order, alpha, &dp2, &p1, c );
+
+    x[i-1] = x0;
+    w[i-1] = cc / ( dp2 * p1 );
+  }
+//
+//  Reverse the order of the values.
+//
+  for ( i = 1; i <= order/2; i++ )
+  {
+    temp       = x[i-1];
+    x[i-1]     = x[order-i];
+    x[order-i] = temp;
+  }
+
+  for ( i = 1; i <=order/2; i++ )
+  {
+    temp       = w[i-1];
+    w[i-1]     = w[order-i];
+    w[order-i] = temp;
+  }
+
+  delete [] c;
+
+  return;
+}
+//****************************************************************************80
+
+void gegenbauer_compute_np ( int order, int np, double p[], double x[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEGENBAUER_COMPUTE_NP computes a Gegenbauer quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( -1 <= X <= 1 ) (1-X^2)^ALPHA * F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+//
+//    Thanks to Janiki Raman for pointing out a problem in an earlier
+//    version of the code that occurred when ALPHA was -0.5.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], contains parameters.
+//    P[0] = ALPHA = the exponent of (1-X^2).  -1.0 < ALPHA is required.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double alpha;
+
+  alpha = p[0];
+
+  webbur::gegenbauer_compute ( order, alpha, x, w );
+
+  return;
+}
+//****************************************************************************80
+
+void gegenbauer_compute_points ( int order, double alpha, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEGENBAUER_COMPUTE_POINTS computes Gegenbauer quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Input, double ALPHA, the exponent of (1-X^2).  -1.0 < ALPHA is required.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+{
+  double *w;
+
+  w = new double[order];
+
+  webbur::gegenbauer_compute ( order, alpha, x, w );
+
+  delete [] w;
+
+  return;
+}
+//****************************************************************************80
+
+void gegenbauer_compute_points_np ( int order, int np, double p[], double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEGENBAUER_COMPUTE_POINTS_NP computes Gegenbauer quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], contains parameters.
+//    P[0] = ALPHA = the exponent of (1-X^2).  -1.0 < ALPHA is required.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+{
+  double alpha;
+
+  alpha = p[0];
+
+  webbur::gegenbauer_compute_points ( order, alpha, x );
+
+  return;
+}
+//****************************************************************************80
+
+void gegenbauer_compute_weights ( int order, double alpha, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEGENBAUER_COMPUTE_WEIGHTS computes Gegenbauer quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Input, double ALPHA, the exponent of (1-X^2).  -1.0 < ALPHA is required.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double *x;
+
+  x = new double[order];
+
+  webbur::gegenbauer_compute ( order, alpha, x, w );
+
+  delete [] x;
+
+  return;
+}
+//****************************************************************************80
+
+void gegenbauer_compute_weights_np ( int order, int np, double p[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEGENBAUER_COMPUTE_WEIGHTS_NP computes Gegenbauer quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Input, double P[1], contains parameters.
+//    P[0] = ALPHA = the exponent of (1-X^2).  -1.0 < ALPHA is required.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double alpha;
+
+  alpha = p[0];
+
+  webbur::gegenbauer_compute_weights ( order, alpha, w );
+
+  return;
+}
+//****************************************************************************80
+
+double gegenbauer_integral ( int expon, double alpha )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEGENBAUER_INTEGRAL integrates a monomial with Gegenbauer weight.
+//
+//  Discussion:
+//
+//    VALUE = Integral ( -1 <= X <= +1 ) x^EXPON (1-x^2)^ALPHA dx
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    26 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int EXPON, the exponent.
+//
+//    Input, double ALPHA, the exponent of (1-X^2) in the weight factor.
+//
+//    Output, double GEGENBAUER_INTEGRAL, the value of the integral.
+//
+{
+  double arg1;
+  double arg2;
+  double arg3;
+  double arg4;
+  double c;
+  double value;
+  double value1;
+
+  if ( ( expon % 2 ) == 1 )
+  {
+    value = 0.0;
+    return value;
+  }
+
+  c = ( double ) ( expon );
+
+  arg1 = - alpha;
+  arg2 =   1.0 + c;
+  arg3 =   2.0 + alpha + c;
+  arg4 = - 1.0;
+
+  value1 = webbur::r8_hyper_2f1 ( arg1, arg2, arg3, arg4 );
+
+  value = webbur::r8_gamma ( 1.0 + c ) * 2.0
+    * webbur::r8_gamma ( 1.0 + alpha  ) * value1
+    / webbur::r8_gamma ( 2.0 + alpha  + c );
+
+  return value;
+}
+//****************************************************************************80
+
+void gegenbauer_recur ( double *p2, double *dp2, double *p1, double x,
+  int order, double alpha, double c[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEGENBAUER_RECUR evaluates a Gegenbauer polynomial.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    26 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Output, double *P2, the value of J(ORDER)(X).
+//
+//    Output, double *DP2, the value of J'(ORDER)(X).
+//
+//    Output, double *P1, the value of J(ORDER-1)(X).
+//
+//    Input, double X, the point at which polynomials are evaluated.
+//
+//    Input, int ORDER, the order of the polynomial.
+//
+//    Input, double ALPHA, the exponents of (1-X^2).
+//
+//    Input, double C[ORDER], the recursion coefficients.
+//
+{
+  double dp0;
+  double dp1;
+  int i;
+  double p0;
+
+  *p1 = 1.0;
+  dp1 = 0.0;
+
+  *p2 = x;
+  *dp2 = 1.0;
+
+  for ( i = 2; i <= order; i++ )
+  {
+    p0 = *p1;
+    dp0 = dp1;
+
+    *p1 = *p2;
+    dp1 = *dp2;
+
+    *p2 = x *  ( *p1 ) - c[i-1] * p0;
+    *dp2 = x * dp1 + ( *p1 ) - c[i-1] * dp0;
+  }
+  return;
+}
+//****************************************************************************80
+
+void gegenbauer_root ( double *x, int order, double alpha, double *dp2,
+  double *p1, double c[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEGENBAUER_ROOT improves an approximate root of a Gegenbauer polynomial.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    26 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input/output, double *X, the approximate root, which
+//    should be improved on output.
+//
+//    Input, int ORDER, the order of the polynomial.
+//
+//    Input, double ALPHA, the exponents of (1-X^2).
+//
+//    Output, double *DP2, the value of J'(ORDER)(X).
+//
+//    Output, double *P1, the value of J(ORDER-1)(X).
+//
+//    Input, double C[ORDER], the recursion coefficients.
+//
+{
+  double d;
+  double eps;
+  double p2;
+  int step;
+  int step_max = 10;
+
+  eps = webbur::r8_epsilon ( );
+
+  for ( step = 1; step <= step_max; step++ )
+  {
+    webbur::gegenbauer_recur ( &p2, dp2, p1, *x, order, alpha, c );
+
+    d = p2 / ( *dp2 );
+    *x = *x - d;
+
+    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
+    {
+      return;
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void gen_hermite_compute ( int n, double alpha, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_HERMITE_COMPUTE computes a generalized Gauss-Hermite quadrature rule.
+//
+//  Discussion:
+//
+//    The code uses an algorithm by Elhay and Kautsky.
+//
+//    The integral:
+//
+//      integral ( -oo < x < +oo ) |x|^alpha exp(-x^2) f(x) dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    30 April 2011
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Sylvan Elhay, Jaroslav Kautsky,
+//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
+//    Interpolatory Quadrature,
+//    ACM Transactions on Mathematical Software,
+//    Volume 13, Number 4, December 1987, pages 399-415.
+//
+//  Parameters:
+//
+//    Input, int N, the number of abscissas.
+//
+//    Input, double ALPHA, the parameter.
+//    -1.0 < ALPHA.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double *bj;
+  int i;
+  double i_r8;
+  double zemu;
+//
+//  Define the zero-th moment.
+//
+  zemu = webbur::r8_gamma ( ( alpha + 1.0 ) / 2.0 );
+//
+//  Define the Jacobi matrix.
+//
+  bj = new double[n];
+
+  for ( i = 0; i < n; i++ )
+  {
+    i_r8 = ( double ) ( i + 1 );
+    if ( ( i % 2 ) == 0 )
+    {
+      bj[i] = ( i_r8 + alpha ) / 2.0;
+    }
+    else
+    {
+      bj[i] = i_r8 / 2.0;
+    }
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    bj[i] = std::sqrt ( bj[i] );
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    x[i] = 0.0;
+  }
+
+  w[0] = std::sqrt ( zemu );
+  for ( i = 1; i < n; i++ )
+  {
+    w[i] = 0.0;
+  }
+//
+//  Diagonalize the Jacobi matrix.
+//
+  webbur::imtqlx ( n, x, bj, w );
+
+  for ( i = 0; i < n; i++ )
+  {
+    w[i] = w[i] * w[i];
+  }
+
+  delete [] bj;
+
+  return;
+}
+//****************************************************************************80
+
+void gen_hermite_compute_np ( int order, int np, double p[], double x[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_HERMITE_COMPUTE_NP computes a Generalized Hermite quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( -oo < x < +oo ) |x|^ALPHA exp(-x^2) f(x) dx
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], contains parameters.
+//    P[0] = ALPHA, the exponent of the X factor. -1.0 < ALPHA.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double alpha;
+
+  alpha = p[0];
+
+  webbur::gen_hermite_compute ( order, alpha, x, w );
+
+  return;
+}
+//****************************************************************************80
+
+void gen_hermite_compute_points ( int order, double alpha, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_HERMITE_COMPUTE_POINTS computes Generalized Hermite quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, double ALPHA, the exponent of the X factor.
+//    -1.0 < ALPHA.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+{
+  double *w;
+
+  w = new double[order];
+
+  webbur::gen_hermite_compute ( order, alpha, x, w );
+
+  delete [] w;
+
+  return;
+}
+//****************************************************************************80
+
+void gen_hermite_compute_points_np ( int order, int np, double p[], double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_HERMITE_COMPUTE_POINTS_NP: Generalized Hermite quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], contains parameters.
+//    P[0] = ALPHA, the exponent of the X factor. -1.0 < ALPHA.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+{
+  double alpha;
+
+  alpha = p[0];
+
+  webbur::gen_hermite_compute_points ( order, alpha, x );
+
+  return;
+}
+//****************************************************************************80
+
+void gen_hermite_compute_weights ( int order, double alpha, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_HERMITE_COMPUTE_WEIGHTS computes Generalized Hermite quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, double ALPHA, the exponent of the X factor.
+//    -1.0 < ALPHA.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double *x;
+
+  x = new double[order];
+
+  webbur::gen_hermite_compute ( order, alpha, x, w );
+
+  delete [] x;
+
+  return;
+}
+//****************************************************************************80
+
+void gen_hermite_compute_weights_np ( int order, int np, double p[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_HERMITE_COMPUTE_WEIGHTS_NP: Generalized Hermite quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], contains parameters.
+//    P[0] = ALPHA, the exponent of the X factor. -1.0 < ALPHA.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double alpha;
+
+  alpha = p[0];
+
+  webbur::gen_hermite_compute_weights ( order, alpha, w );
+
+  return;
+}
+//****************************************************************************80
+
+void gen_hermite_dr_compute ( int order, double alpha, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_HERMITE_DR_COMPUTE computes a Generalized Hermite quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( -oo < x < +oo ) |x|^ALPHA exp(-x^2) f(x) dx
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Input, double ALPHA, the exponent of the X factor.
+//    -1.0 < ALPHA.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double alpha_laguerre;
+  double arg;
+  int i;
+  int order_laguerre;
+  double *w_laguerre;
+  double *x_laguerre;
+
+  if ( order < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "GEN_HERMITE_DR_COMPUTE - Fatal error!\n";
+    std::cerr << "  Illegal value of ORDER = " << order << "\n";
+    std::exit ( 1 );
+  }
+
+  if ( order == 1 )
+  {
+    arg = ( alpha + 1.0 ) / 2.0;
+    x[0] = 0.0;
+    w[0] = webbur::r8_gamma ( arg );
+    return;
+  }
+
+  if ( ( order % 2 ) == 0 )
+  {
+    order_laguerre = order / 2;
+    alpha_laguerre = ( alpha - 1.0 ) / 2.0;
+  }
+  else
+  {
+    order_laguerre = ( order - 1 ) / 2;
+    alpha_laguerre = ( alpha + 1.0 ) / 2.0;
+  }
+
+  w_laguerre = new double[order_laguerre];
+  x_laguerre = new double[order_laguerre];
+
+  webbur::gen_laguerre_ss_compute ( order_laguerre, alpha_laguerre, x_laguerre,
+    w_laguerre );
+
+  if ( ( order % 2 ) == 0 )
+  {
+    for ( i = 0; i < order_laguerre; i++ )
+    {
+      x[i] = - std::sqrt ( x_laguerre[order_laguerre-1-i] );
+    }
+    for ( i = 0; i < order_laguerre; i++ )
+    {
+      x[order_laguerre+i] = std::sqrt ( x_laguerre[i] );
+	}
+    for ( i = 0; i < order_laguerre; i++ )
+    {
+      w[i] = 0.5 * w_laguerre[order_laguerre-1-i];
+    }
+    for ( i = 0; i < order_laguerre; i++ )
+    {
+      w[order_laguerre+i] = 0.5 * w_laguerre[i];
+    }
+  }
+  else if ( ( order % 2 ) == 1 )
+  {
+    for ( i = 0; i < order_laguerre; i++ )
+    {
+      x[i] = - std::sqrt ( x_laguerre[order_laguerre-1-i] );
+    }
+    x[order_laguerre] = 0.0;
+    for ( i = 0; i < order_laguerre; i++ )
+    {
+      x[order_laguerre+1+i] = std::sqrt ( x_laguerre[i] );
+	}
+    for ( i = 0; i < order_laguerre; i++ )
+    {
+      w[i] = 0.5 * w_laguerre[order_laguerre-1-i] / x_laguerre[order_laguerre-1-i];
+    }
+
+    arg = ( alpha + 1.0 ) / 2.0;
+    w[order_laguerre] = webbur::r8_gamma ( arg );
+    for ( i = 0; i < order_laguerre; i++ )
+    {
+      w[order_laguerre] = w[order_laguerre] - w_laguerre[i] / x_laguerre[i];
+    }
+
+    for ( i = 0; i < order_laguerre; i++ )
+    {
+      w[order_laguerre+1+i] = 0.5 * w_laguerre[i] / x_laguerre[i];
+    }
+  }
+  delete [] w_laguerre;
+  delete [] x_laguerre;
+
+  return;
+}
+//****************************************************************************80
+
+double gen_hermite_integral ( int expon, double alpha )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_HERMITE_INTEGRAL evaluates a monomial Generalized Hermite integral.
+//
+//  Discussion:
+//
+//    H(n,alpha) = Integral ( -oo < x < +oo ) x^n |x|^alpha exp(-x^2) dx
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int EXPON, the exponent of the monomial.
+//    0 <= EXPON.
+//
+//    Input, double ALPHA, the exponent of |X| in the weight function.
+//    -1.0 < ALPHA.
+//
+//    Output, double GEN_HERMITE_INTEGRAL, the value of the integral.
+//
+{
+  double a;
+  double arg;
+  double value;
+
+  if ( ( expon % 2 ) == 1 )
+  {
+    value = 0.0;
+  }
+  else
+  {
+    a = alpha + ( double ) ( expon );
+    if ( a <= - 1.0 )
+    {
+      value = - webbur::r8_huge ( );
+    }
+    else
+    {
+      arg = ( a + 1.0 ) / 2.0;
+      value = webbur::r8_gamma ( arg );
+    }
+  }
+  return value;
+}
+//****************************************************************************80
+
+void gen_laguerre_compute ( int n, double alpha, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_LAGUERRE_COMPUTE: generalized Gauss-Laguerre quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( 0 <= x < +oo ) exp ( - x ) * x^alpha * f(x) dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+//
+//    The integral:
+//
+//      integral ( 0 <= x < +oo ) x^alpha * f(x) dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * exp ( x(i) ) * f ( x(i) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    23 April 2011
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Sylvan Elhay, Jaroslav Kautsky,
+//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
+//    Interpolatory Quadrature,
+//    ACM Transactions on Mathematical Software,
+//    Volume 13, Number 4, December 1987, pages 399-415.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, double ALPHA, the exponent of the X factor.
+//    ALPHA must be nonnegative.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double *bj;
+  int i;
+  double i_r8;
+  double zemu;
+//
+//  Define the zero-th moment.
+//
+  zemu = webbur::r8_gamma ( alpha + 1.0 );
+//
+//  Define the Jacobi matrix.
+//
+  bj = new double[n];
+
+  for ( i = 0; i < n; i++ )
+  {
+    i_r8 = ( double ) ( i + 1 );
+    bj[i] = std::sqrt ( i_r8 * ( i_r8 + alpha ) );
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    i_r8 = ( double ) ( i + 1 );
+    x[i] = 2.0 * i_r8 - 1.0 + alpha;
+  }
+
+  w[0] = std::sqrt ( zemu );
+
+  for ( i = 1; i < n; i++ )
+  {
+    w[i] = 0.0;
+  }
+//
+//  Diagonalize the Jacobi matrix.
+//
+  imtqlx ( n, x, bj, w );
+
+  for ( i = 0; i < n; i++ )
+  {
+    w[i] = w[i] * w[i];
+  }
+
+  delete [] bj;
+
+  return;
+}
+//****************************************************************************80
+
+void gen_laguerre_compute_np ( int order, int np, double p[], double x[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_LAGUERRE_COMPUTE_NP computes a Generalized Laguerre quadrature rule.
+//
+//  Discussion:
+//
+//    In the simplest case, ALPHA is 0, and we are approximating the
+//    integral from 0 to +oo of exp(-X) * F(X).  When this is so,
+//    it is easy to modify the rule to approximate the integral from
+//    A to +oo as well.
+//
+//    If ALPHA is nonzero, then there is no simple way to extend the
+//    rule to approximate the integral from A to +oo.  The simplest
+//    procedures would be to approximate the integral from 0 to A.
+//
+//    If the integral to approximate is:
+//
+//        Integral ( A <= X < +oo ) exp ( - X ) * F(X) dX
+//      or
+//        Integral ( 0 <= X < +oo ) exp ( - X ) * X^ALPHA * F(X) dX
+//
+//    then the quadrature rule is:
+//
+//      exp ( - A ) * Sum ( 1 <= I <= ORDER ) W(I) * F ( A+X(I) )
+//    or
+//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+//
+//
+//    If the integral to approximate is:
+//
+//        Integral ( A <= X < +oo ) F(X) dX
+//      or
+//        Integral ( 0 <= X < +oo ) X^ALPHA * F(X) dX
+//
+//    then the quadrature rule is:
+//
+//      exp ( - A ) * Sum ( 1 <= I <= ORDER )
+//        W(I) * exp(A+X(I)) * F ( A+X(I) )
+//    or
+//      Sum ( 1 <= I <= ORDER ) W(I) * exp(X(I)) * F ( X(I) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Input, double P[1], contains parameters.
+//    P[0] = ALPHA, the exponent of the X factor.
+//    Set ALPHA = 0.0 for the simplest rule.
+//    ALPHA must be nonnegative.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double alpha;
+
+  alpha = p[0];
+
+  webbur::gen_laguerre_compute ( order, alpha, x, w );
+
+  return;
+}
+//****************************************************************************80
+
+void gen_laguerre_compute_points ( int order, double alpha, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_LAGUERRE_COMPUTE_POINTS: Generalized Laguerre quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 March 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, double ALPHA, the exponent of the X factor.
+//    Set ALPHA = 0.0 for the simplest rule.
+//    ALPHA must be nonnegative.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+{
+  double *w;
+
+  w = new double[order];
+
+  webbur::gen_laguerre_compute ( order, alpha, x, w );
+
+  delete [] w;
+
+  return;
+}
+//****************************************************************************80
+
+void gen_laguerre_compute_points_np ( int order, int np, double p[],
+  double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_LAGUERRE_COMPUTE_POINTS_NP: Generalized Laguerre quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], contains parameters.
+//    P[0] = ALPHA, the exponent of the X factor.
+//    Set ALPHA = 0.0 for the simplest rule.
+//    ALPHA must be nonnegative.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+{
+  double alpha;
+
+  alpha = p[0];
+
+  webbur::gen_laguerre_compute_points ( order, alpha, x );
+
+  return;
+}
+//****************************************************************************80
+
+void gen_laguerre_compute_weights ( int order, double alpha, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_LAGUERRE_COMPUTE_WEIGHTS: Generalized Laguerre quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, double ALPHA, the exponent of the X factor.
+//    Set ALPHA = 0.0 for the simplest rule.
+//    ALPHA must be nonnegative.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double *x;
+
+  x = new double[order];
+
+  webbur::gen_laguerre_compute ( order, alpha, x, w );
+
+  delete [] x;
+
+  return;
+}
+//****************************************************************************80
+
+void gen_laguerre_compute_weights_np ( int order, int np, double p[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_LAGUERRE_COMPUTE_WEIGHTS_NP: Generalized Laguerre quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], contains parameters.
+//    P[0] = ALPHA, the exponent of the X factor.
+//    Set ALPHA = 0.0 for the simplest rule.
+//    ALPHA must be nonnegative.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double alpha;
+
+  alpha = p[0];
+
+  webbur::gen_laguerre_compute_weights ( order, alpha, w );
+
+  return;
+}
+//****************************************************************************80
+
+double gen_laguerre_integral ( int expon, double alpha )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_LAGUERRE_INTEGRAL evaluates a monomial Generalized Laguerre integral.
+//
+//  Discussion:
+//
+//    L(n,alpha) = Integral ( 0 <= x < +oo ) x^n * x^alpha exp(-x) dx
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    20 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int EXPON, the exponent of the monomial.
+//    0 <= EXPON.
+//
+//    Input, double ALPHA, the exponent of X in the weight function.
+//    -1.0 < ALPHA.
+//
+//    Output, double GEN_LAGUERRE_INTEGRAL, the value of the integral.
+//
+{
+  double arg;
+  double value;
+
+  arg = alpha + ( double ) ( expon + 1.0 );
+  value = webbur::r8_gamma ( arg );
+
+  return value;
+}
+//****************************************************************************80
+
+void gen_laguerre_ss_compute ( int order, double alpha, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_LAGUERRE_SS_COMPUTE computes a Generalized Laguerre quadrature rule.
+//
+//  Discussion:
+//
+//    In the simplest case, ALPHA is 0, and we are approximating the
+//    integral from 0 to +oo of exp(-X) * F(X).  When this is so,
+//    it is easy to modify the rule to approximate the integral from
+//    A to +oo as well.
+//
+//    If ALPHA is nonzero, then there is no simple way to extend the
+//    rule to approximate the integral from A to +oo.  The simplest
+//    procedures would be to approximate the integral from 0 to A.
+//
+//    If the integral to approximate is:
+//
+//        Integral ( A <= X < +oo ) exp ( - X ) * F(X) dX
+//      or
+//        Integral ( 0 <= X < +oo ) exp ( - X ) * X^ALPHA * F(X) dX
+//
+//    then the quadrature rule is:
+//
+//      exp ( - A ) * Sum ( 1 <= I <= ORDER ) W(I) * F ( A+X(I) )
+//    or
+//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+//
+//
+//    If the integral to approximate is:
+//
+//        Integral ( A <= X < +oo ) F(X) dX
+//      or
+//        Integral ( 0 <= X < +oo ) X^ALPHA * F(X) dX
+//
+//    then the quadrature rule is:
+//
+//      exp ( - A ) * Sum ( 1 <= I <= ORDER )
+//        W(I) * exp(A+X(I)) * F ( A+X(I) )
+//    or
+//      Sum ( 1 <= I <= ORDER ) W(I) * exp(X(I)) * F ( X(I) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Input, double ALPHA, the exponent of the X factor.
+//    Set ALPHA = 0.0 for the simplest rule.
+//    ALPHA must be nonnegative.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double *b;
+  double *c;
+  double cc;
+  double dp2;
+  int i;
+  double p1;
+  double prod;
+  double r1;
+  double r2;
+  double ratio;
+  double x0;
+
+  if ( order < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "GEN_LAGUERRE_SS_COMPUTE - Fatal error!\n";
+    std::cerr << "  Illegal value of ORDER = " << order << "\n";
+    std::exit ( 1 );
+  }
+
+  b = new double[order];
+  c = new double[order];
+//
+//  Set the recursion coefficients.
+//
+  for ( i = 0; i < order; i++ )
+  {
+    b[i] = ( alpha + ( double ) ( 2 * i + 1 ) );
+  }
+
+  for ( i = 0; i < order; i++ )
+  {
+    c[i] = ( double ) ( i ) * ( alpha + ( double ) ( i ) );
+  }
+  prod = 1.0;
+  for ( i = 1; i < order; i++ )
+  {
+    prod = prod * c[i];
+  }
+  cc = webbur::r8_gamma ( alpha + 1.0 ) * prod;
+
+  for ( i = 0; i < order; i++ )
+  {
+//
+//  Compute an estimate for the root.
+//
+    if ( i == 0 )
+    {
+      x0 = ( 1.0 + alpha ) * ( 3.0+ 0.92 * alpha ) /
+        ( 1.0 + 2.4 * ( double ) ( order ) + 1.8 * alpha );
+    }
+    else if ( i == 1 )
+    {
+      x0 = x0 + ( 15.0 + 6.25 * alpha ) /
+        ( 1.0 + 0.9 * alpha + 2.5 * ( double ) ( order ) );
+    }
+    else
+    {
+      r1 = ( 1.0 + 2.55 * ( double ) ( i - 1 ) )
+        / ( 1.9 * ( double ) ( i - 1 ) );
+
+      r2 = 1.26 * ( double ) ( i - 1 ) * alpha /
+        ( 1.0 + 3.5 * ( double ) ( i - 1 ) );
+
+      ratio = ( r1 + r2 ) / ( 1.0 + 0.3 * alpha );
+
+      x0 = x0 + ratio * ( x0 - x[i-2] );
+    }
+//
+//  Use iteration to find the root.
+//
+    webbur::gen_laguerre_ss_root ( &x0, order, alpha, &dp2, &p1, b, c );
+//
+//  Set the abscissa and weight.
+//
+    x[i] = x0;
+    w[i] = ( cc / dp2 ) / p1;
+  }
+
+  delete [] b;
+  delete [] c;
+
+  return;
+}
+//****************************************************************************80
+
+void gen_laguerre_ss_recur ( double *p2, double *dp2, double *p1, double x,
+  int order, double alpha, double b[], double c[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_LAGUERRE_SS_RECUR evaluates a Generalized Laguerre polynomial.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 February 2008
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Output, double *P2, the value of L(ORDER)(X).
+//
+//    Output, double *DP2, the value of L'(ORDER)(X).
+//
+//    Output, double *P1, the value of L(ORDER-1)(X).
+//
+//    Input, double X, the point at which polynomials are evaluated.
+//
+//    Input, int ORDER, the order of the polynomial.
+//
+//    Input, double ALPHA, the exponent of the X factor in the
+//    integrand.
+//
+//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
+//
+{
+  double dp0;
+  double dp1;
+  int i;
+  double p0;
+
+  *p1 = 1.0;
+  dp1 = 0.0;
+
+  *p2 = x - alpha - 1.0;
+  *dp2 = 1.0;
+
+  for ( i = 1; i < order; i++ )
+  {
+    p0 = *p1;
+    dp0 = dp1;
+
+    *p1 = *p2;
+    dp1 = *dp2;
+
+    *p2  = ( x - b[i] ) * ( *p1 ) - c[i] * p0;
+    *dp2 = ( x - b[i] ) * dp1 + ( *p1 ) - c[i] * dp0;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void gen_laguerre_ss_root ( double *x, int order, double alpha, double *dp2,
+  double *p1, double b[], double c[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    GEN_LAGUERRE_SS_ROOT improves a root of a Generalized Laguerre polynomial.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 February 2008
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input/output, double *X, the approximate root, which
+//    should be improved on output.
+//
+//    Input, int ORDER, the order of the polynomial.
+//
+//    Input, double ALPHA, the exponent of the X factor.
+//
+//    Output, double *DP2, the value of L'(ORDER)(X).
+//
+//    Output, double *P1, the value of L(ORDER-1)(X).
+//
+//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
+//
+{
+  double d;
+  double eps;
+  double p2;
+  int step;
+  int step_max = 10;
+
+  eps = webbur::r8_epsilon ( );
+
+  for ( step = 1; step <= step_max; step++ )
+  {
+    webbur::gen_laguerre_ss_recur ( &p2, dp2, p1, *x, order, alpha, b, c );
+
+    d = p2 / ( *dp2 );
+    *x = *x - d;
+
+    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
+    {
+      break;
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void hc_compute_weights_from_points ( int nhalf, double xhalf[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HC_COMPUTE_WEIGHTS_FROM_POINTS: Hermite-Cubic weights, user-supplied points.
+//
+//  Discussion:
+//
+//    An interval [A,B] has been divided by NHALF points X; at each
+//    point both function and derivative information is available.
+//
+//    The piecewise cubic Hermite interpolant is constructed for this data.
+//
+//    A quadrature rule is determined for the interpolant.
+//
+//    There will be N=2*NHALF weights.  If the quadrature rule is to be written
+//    out, one would normally list each point twice, so that the number of points
+//    and weights are equal.  The listing of the same point value twice is an
+//    implicit indication that both function and derivative values should be
+//    used.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    28 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int NHALF, the number of points, not counting repetitions.
+//
+//    Input, double XHALF[NHALF], the points, without repetition.
+//
+//    Output, double W[2*NHALF], the weights.  The first two weights are
+//    associated with the first point, and so on.
+//
+{
+  int j;
+
+  w[0+0*2] =    0.5 * ( xhalf[1] - xhalf[0] );
+  w[1+0*2] = std::pow ( xhalf[1] - xhalf[0], 2 ) / 12.0;
+
+  for ( j = 1; j < nhalf - 1; j++ )
+  {
+    w[0+j*2] = 0.5 * ( xhalf[j+1] - xhalf[j-1] );
+    w[1+j*2] =       ( xhalf[j+1] - xhalf[j-1] )
+                   * ( xhalf[j+1] - 2.0 * xhalf[j] + xhalf[j-1] ) / 12.0;
+  }
+
+  w[0+(nhalf-1)*2] =      0.5 * ( xhalf[nhalf-1] - xhalf[nhalf-2]   );
+  w[1+(nhalf-1)*2] = - std::pow ( xhalf[nhalf-2] - xhalf[nhalf-1], 2 ) / 12.0;
+
+  return;
+}
+//****************************************************************************80
+
+void hcc_compute ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HCC_COMPUTE computes a Hermite-Cubic-Chebyshev-Spacing quadrature rule.
+//
+//  Discussion:
+//
+//    For the HCE rule, we assume that an interval has been divided by
+//    M nodes X into Chebyshev-spaced subintervals, and that at each
+//    abscissa both function and derivative information is available.
+//    The piecewise cubic Hermite interpolant is constructed for this data.
+//    The quadrature rule uses N = 2 * M abscissas, where each node is
+//    listed twice, and the weights occur in pairs, with the first multiplying
+//    the function value and the second the derivative.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    24 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  int nhalf;
+  double *xhalf;
+
+  nhalf = n / 2;
+  xhalf = new double[nhalf];
+
+  webbur::clenshaw_curtis_compute_points ( nhalf, xhalf );
+  webbur::r8vec_stutter ( nhalf, xhalf, 2, x );
+  webbur::hc_compute_weights_from_points ( nhalf, xhalf, w );
+
+  delete [] xhalf;
+
+  return;
+}
+//****************************************************************************80
+
+void hcc_compute_np ( int n, int np, double p[], double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HCC_COMPUTE_NP computes a Hermite-Cubic-Chebyshev-Spacing quadrature rule.
+//
+//  Discussion:
+//
+//    For the HCE rule, we assume that an interval has been divided by
+//    M nodes X into Chebyshev-spaced subintervals, and that at each
+//    abscissa both function and derivative information is available.
+//    The piecewise cubic Hermite interpolant is constructed for this data.
+//    The quadrature rule uses N = 2 * M abscissas, where each node is
+//    listed twice, and the weights occur in pairs, with the first multiplying
+//    the function value and the second the derivative.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    17 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::hcc_compute ( n, x, w );
+
+  return;
+}
+//****************************************************************************80
+
+void hcc_compute_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HCC_COMPUTE_POINTS computes Hermite-Cubic-Chebyshev-Spacing quadrature points.
+//
+//  Discussion:
+//
+//    For the HCE rule, we assume that an interval has been divided by
+//    M nodes X into Chebyshev-spaced subintervals, and that at each
+//    abscissa both function and derivative information is available.
+//    The piecewise cubic Hermite interpolant is constructed for this data.
+//    The quadrature rule uses N = 2 * M abscissas, where each node is
+//    listed twice, and the weights occur in pairs, with the first multiplying
+//    the function value and the second the derivative.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    24 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  int nhalf;
+  double *xhalf;
+
+  if ( ( n % 2 ) != 0 )
+  {
+    std::cerr << "\n";
+    std::cerr << "HCC_COMPUTE_POINTS - Fatal error!\n";
+    std::cerr << "  Order of rule N is not even.\n";
+    std::exit ( 1 );
+  }
+
+  nhalf = n / 2;
+  xhalf = new double[nhalf];
+
+  webbur::clenshaw_curtis_compute_points ( nhalf, xhalf );
+  webbur::r8vec_stutter ( nhalf, xhalf, 2, x );
+
+  delete [] xhalf;
+
+  return;
+}
+//****************************************************************************80
+
+void hcc_compute_points_np ( int n, int np, double p[], double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HCC_COMPUTE_POINTS_NP: Hermite-Cubic-Chebyshev-Spacing quadrature points.
+//
+//  Discussion:
+//
+//    For the HCE rule, we assume that an interval has been divided by
+//    M nodes X into Chebyshev-spaced subintervals, and that at each
+//    abscissa both function and derivative information is available.
+//    The piecewise cubic Hermite interpolant is constructed for this data.
+//    The quadrature rule uses N = 2 * M abscissas, where each node is
+//    listed twice, and the weights occur in pairs, with the first multiplying
+//    the function value and the second the derivative.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    17 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  webbur::hcc_compute_points ( n, x );
+
+  return;
+}
+//****************************************************************************80
+
+void hcc_compute_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HCC_COMPUTE_WEIGHTS: Hermite-Cubic-Chebyshev-Spacing quadrature weights.
+//
+//  Discussion:
+//
+//    For the HCE rule, we assume that an interval has been divided by
+//    M nodes X into Chebyshev-spaced subintervals, and that at each
+//    abscissa both function and derivative information is available.
+//    The piecewise cubic Hermite interpolant is constructed for this data.
+//    The quadrature rule uses N = 2 * M abscissas, where each node is
+//    listed twice, and the weights occur in pairs, with the first multiplying
+//    the function value and the second the derivative.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    24 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double W[N], the weights.
+//
+{
+  int nhalf;
+  double *xhalf;
+
+  if ( ( n % 2 ) != 0 )
+  {
+    std::cerr << "\n";
+    std::cerr << "HCC_COMPUTE_WEIGHTS - Fatal error!\n";
+    std::cerr << "  Order of rule N is not even.\n";
+    std::exit ( 1 );
+  }
+
+  nhalf = n / 2;
+  xhalf = new double[nhalf];
+
+  webbur::hc_compute_weights_from_points ( nhalf, xhalf, w );
+
+  delete [] xhalf;
+
+  return;
+}
+//****************************************************************************80
+
+void hcc_compute_weights_np ( int n, int np, double p[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HCC_COMPUTE_WEIGHTS_NP: Hermite-Cubic-Chebyshev-Spacing quadrature weights.
+//
+//  Discussion:
+//
+//    For the HCE rule, we assume that an interval has been divided by
+//    M nodes X into Chebyshev-spaced subintervals, and that at each
+//    abscissa both function and derivative information is available.
+//    The piecewise cubic Hermite interpolant is constructed for this data.
+//    The quadrature rule uses N = 2 * M abscissas, where each node is
+//    listed twice, and the weights occur in pairs, with the first multiplying
+//    the function value and the second the derivative.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    17 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::hcc_compute_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+void hce_compute ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HCE_COMPUTE computes a Hermite-Cubic-Equal-Spacing quadrature rule.
+//
+//  Discussion:
+//
+//    For the HCE rule, we assume that an interval has been divided by
+//    M nodes X into equally spaced subintervals, and that at each
+//    abscissa both function and derivative information is available.
+//    The piecewise cubic Hermite interpolant is constructed for this data.
+//    The quadrature rule uses N = 2 * M abscissas, where each node is
+//    listed twice, and the weights occur in pairs, with the first multiplying
+//    the function value and the second the derivative.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    28 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double a_high = 1.0;
+  double a_low = 0.0;
+  int nhalf;
+  double *xhalf;
+
+  a_low = 0.0;
+  a_high = 1.0;
+
+  nhalf = n / 2;
+
+  xhalf = webbur::r8vec_linspace_new ( nhalf, a_low, a_high );
+  webbur::r8vec_stutter ( nhalf, xhalf, 2, x );
+  webbur::hc_compute_weights_from_points ( nhalf, xhalf, w );
+
+  delete [] xhalf;
+
+  return;
+}
+//****************************************************************************80
+
+void hce_compute_np ( int n, int np, double p[], double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HCE_COMPUTE_NP computes a Hermite-Cubic-Equal-Spacing quadrature rule.
+//
+//  Discussion:
+//
+//    For the HCE rule, we assume that an interval has been divided by
+//    M nodes X into equally spaced subintervals, and that at each
+//    abscissa both function and derivative information is available.
+//    The piecewise cubic Hermite interpolant is constructed for this data.
+//    The quadrature rule uses N = 2 * M abscissas, where each node is
+//    listed twice, and the weights occur in pairs, with the first multiplying
+//    the function value and the second the derivative.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    07 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::hce_compute ( n, x, w );
+
+  return;
+}
+//****************************************************************************80
+
+void hce_compute_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HCE_COMPUTE_POINTS computes Hermite-Cubic-Equal-Spacing quadrature points.
+//
+//  Discussion:
+//
+//    For the HCE rule, we assume that an interval has been divided by
+//    M nodes X into equally spaced subintervals, and that at each
+//    abscissa both function and derivative information is available.
+//    The piecewise cubic Hermite interpolant is constructed for this data.
+//    The quadrature rule uses N = 2 * M abscissas, where each node is
+//    listed twice, and the weights occur in pairs, with the first multiplying
+//    the function value and the second the derivative.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    07 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  int i;
+  int j;
+  int m;
+  double x_value;
+
+  if ( ( n % 2 ) != 0 )
+  {
+    std::cerr << "\n";
+    std::cerr << "HCE_COMPUTE_POINTS - Fatal error!\n";
+    std::cerr << "  Order of rule N is not even.\n";
+    std::exit ( 1 );
+  }
+  m = n / 2;
+
+  for ( j = 0; j < m; j++ )
+  {
+    x_value = ( double ) ( 2 * j + 1 - m ) / ( double ) ( m - 1 );
+    for ( i = 0; i < 2; i++ )
+    {
+      x[i+j*2] = x_value;
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void hce_compute_points_np ( int n, int np, double p[], double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HCE_COMPUTE_POINTS_NP: Hermite-Cubic-Equal-Spacing quadrature points.
+//
+//  Discussion:
+//
+//    For the HCE rule, we assume that an interval has been divided by
+//    M nodes X into equally spaced subintervals, and that at each
+//    abscissa both function and derivative information is available.
+//    The piecewise cubic Hermite interpolant is constructed for this data.
+//    The quadrature rule uses N = 2 * M abscissas, where each node is
+//    listed twice, and the weights occur in pairs, with the first multiplying
+//    the function value and the second the derivative.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    07 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  webbur::hce_compute_points ( n, x );
+
+  return;
+}
+//****************************************************************************80
+
+void hce_compute_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HCE_COMPUTE_WEIGHTS: Hermite-Cubic-Equal-Spacing quadrature weights.
+//
+//  Discussion:
+//
+//    For the HCE rule, we assume that an interval has been divided by
+//    M nodes X into equally spaced subintervals, and that at each
+//    abscissa both function and derivative information is available.
+//    The piecewise cubic Hermite interpolant is constructed for this data.
+//    The quadrature rule uses N = 2 * M abscissas, where each node is
+//    listed twice, and the weights occur in pairs, with the first multiplying
+//    the function value and the second the derivative.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    24 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double W[N], the weights.
+//
+{
+  int nhalf;
+  double *xhalf;
+
+  if ( ( n % 2 ) != 0 )
+  {
+    std::cerr << "\n";
+    std::cerr << "HCE_COMPUTE_WEIGHTS - Fatal error!\n";
+    std::cerr << "  Order of rule N is not even.\n";
+    std::exit ( 1 );
+  }
+
+  nhalf = n / 2;
+  xhalf = new double[nhalf];
+
+  webbur::hc_compute_weights_from_points ( nhalf, xhalf, w );
+
+  delete [] xhalf;
+
+  return;
+}
+//****************************************************************************80
+
+void hce_compute_weights_np ( int n, int np, double p[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HCE_COMPUTE_WEIGHTS_NP: Hermite-Cubic-Equal-Spacing quadrature weights.
+//
+//  Discussion:
+//
+//    For the HCE rule, we assume that an interval has been divided by
+//    M nodes X into equally spaced subintervals, and that at each
+//    abscissa both function and derivative information is available.
+//    The piecewise cubic Hermite interpolant is constructed for this data.
+//    The quadrature rule uses N = 2 * M abscissas, where each node is
+//    listed twice, and the weights occur in pairs, with the first multiplying
+//    the function value and the second the derivative.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    07 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::hce_compute_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_compute ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_COMPUTE computes a Gauss-Hermite quadrature rule.
+//
+//  Discussion:
+//
+//    The code uses an algorithm by Elhay and Kautsky.
+//
+//    The abscissas are the zeros of the N-th order Hermite polynomial.
+//
+//    The integral:
+//
+//      integral ( -oo < x < +oo ) exp ( - x * x ) * f(x) dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 April 2011
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Sylvan Elhay, Jaroslav Kautsky,
+//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
+//    Interpolatory Quadrature,
+//    ACM Transactions on Mathematical Software,
+//    Volume 13, Number 4, December 1987, pages 399-415.
+//
+//  Parameters:
+//
+//    Input, int N, the number of abscissas.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double arg;
+  double *bj;
+  int i;
+  double zemu;
+//
+//  Define the zero-th moment.
+//
+  arg = 0.5;
+  zemu = webbur::r8_gamma ( arg );
+//
+//  Define the Jacobi matrix.
+//
+  bj = new double[n];
+
+  for ( i = 0; i < n; i++ )
+  {
+    bj[i] = std::sqrt ( ( double ) ( i + 1 ) / 2.0 );
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    x[i] = 0.0;
+  }
+
+  w[0] = std::sqrt ( zemu );
+  for ( i = 1; i < n; i++ )
+  {
+    w[i] = 0.0;
+  }
+//
+//  Diagonalize the Jacobi matrix.
+//
+  webbur::imtqlx ( n, x, bj, w );
+
+  for ( i = 0; i < n; i++ )
+  {
+    w[i] = w[i] * w[i];
+  }
+
+  delete [] bj;
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_compute_np ( int order, int np, double p[], double x[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_COMPUTE_NP computes a Hermite quadrature rule.
+//
+//  Discussion:
+//
+//    The abscissas are the zeros of the N-th order Hermite polynomial.
+//
+//    The integral:
+//
+//      Integral ( -oo < X < +oo ) exp ( - X * X ) * F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  webbur::hermite_compute ( order, x, w );
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_compute_points ( int order, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_COMPUTE_POINTS computes Hermite quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+{
+  double *w;
+
+  w = new double[order];
+
+  webbur::hermite_compute ( order, x, w );
+
+  delete [] w;
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_compute_points_np ( int order, int np, double p[], double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_COMPUTE_POINTS_NP computes Hermite quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+{
+  webbur::hermite_compute_points ( order, x );
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_compute_weights ( int order, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_COMPUTE_WEIGHTS computes Hermite quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double *x;
+
+  x = new double[order];
+
+  webbur::hermite_compute ( order, x, w );
+
+  delete [] x;
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_compute_weights_np ( int order, int np, double p[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_COMPUTE_WEIGHTS_NP computes Hermite quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  webbur::hermite_compute_weights ( order, w );
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_genz_keister_lookup ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_GENZ_KEISTER_LOOKUP looks up a Genz-Keister Hermite rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+//
+//    A nested family of rules for the Hermite integration problem
+//    was produced by Genz and Keister.  The structure of the nested
+//    family was denoted by 1+2+6+10+16, that is, it comprised rules
+//    of successive orders O = 1, 3, 9, 19, and 35.
+//
+//    The precisions of these rules are P = 1, 5, 15, 29, and 51.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    07 June 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Alan Genz, Bradley Keister,
+//    Fully symmetric interpolatory rules for multiple integrals
+//    over infinite regions with Gaussian weight,
+//    Journal of Computational and Applied Mathematics,
+//    Volume 71, 1996, pages 299-309
+//
+//    Florian Heiss, Viktor Winschel,
+//    Likelihood approximation by numerical integration on sparse grids,
+//    Journal of Econometrics,
+//    Volume 144, 2008, pages 62-80.
+//
+//    Thomas Patterson,
+//    The Optimal Addition of Points to Quadrature Formulae,
+//    Mathematics of Computation,
+//    Volume 22, Number 104, October 1968, pages 847-856.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be 1, 3, 9, 19, 35, 37, 41 or 43.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::hermite_genz_keister_lookup_points ( n, x );
+  webbur::hermite_genz_keister_lookup_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_genz_keister_lookup_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_GENZ_KEISTER_LOOKUP_POINTS looks up Genz-Keister Hermite abscissas.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+//
+//    A nested family of rules for the Hermite integration problem
+//    was produced by Genz and Keister.  The structure of the nested
+//    family was denoted by 1+2+6+10+?, that is, it comprised rules
+//    of successive orders O = 1, 3, 9, 19, and a final rule of order
+//    35, 37, 41 or 43.
+//
+//    The precisions of these rules are P = 1, 5, 15, 29,
+//    with the final rule of precision 51, 55, 63 or 67.
+//
+//    Three related families begin the same way, but end with a different final
+//    rule.  As a convenience, this function includes these final rules as well:
+//
+//    Designation  Orders       Precisions
+//
+//    1+2+6+10+16, 1,3,9,19,35  1,5,15,29,51
+//    1+2+6+10+18  1,3,9,19,37  1,5,15,29,55
+//    1+2+6+10+22  1,3,9,19,41  1,5,15,29,63
+//    1+2+6+10+24  1,3,9,19,43  1,5,15,29,67
+//
+//    Some of the data in this function was kindly supplied directly by
+//    Alan Genz on 24 April 2011.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    04 October 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Alan Genz, Bradley Keister,
+//    Fully symmetric interpolatory rules for multiple integrals
+//    over infinite regions with Gaussian weight,
+//    Journal of Computational and Applied Mathematics,
+//    Volume 71, 1996, pages 299-309
+//
+//    Florian Heiss, Viktor Winschel,
+//    Likelihood approximation by numerical integration on sparse grids,
+//    Journal of Econometrics,
+//    Volume 144, 2008, pages 62-80.
+//
+//    Thomas Patterson,
+//    The Optimal Addition of Points to Quadrature Formulae,
+//    Mathematics of Computation,
+//    Volume 22, Number 104, October 1968, pages 847-856.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be 1, 3, 9, 19, 35, 37, 41, or 43.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  if ( n == 1 )
+  {
+    x[ 0] =   0.0000000000000000E+00;
+  }
+  else if ( n == 3 )
+  {
+    x[ 0] =  -1.2247448713915889E+00;
+    x[ 1] =   0.0000000000000000E+00;
+    x[ 2] =   1.2247448713915889E+00;
+  }
+  else if ( n == 9 )
+  {
+    x[ 0] =  -2.9592107790638380E+00;
+    x[ 1] =  -2.0232301911005157E+00;
+    x[ 2] =  -1.2247448713915889E+00;
+    x[ 3] =  -5.2403354748695763E-01;
+    x[ 4] =   0.0000000000000000E+00;
+    x[ 5] =   5.2403354748695763E-01;
+    x[ 6] =   1.2247448713915889E+00;
+    x[ 7] =   2.0232301911005157E+00;
+    x[ 8] =   2.9592107790638380E+00;
+  }
+  else if ( n == 19 )
+  {
+    x[ 0] =  -4.4995993983103881E+00;
+    x[ 1] =  -3.6677742159463378E+00;
+    x[ 2] =  -2.9592107790638380E+00;
+    x[ 3] =  -2.2665132620567876E+00;
+    x[ 4] =  -2.0232301911005157E+00;
+    x[ 5] =  -1.8357079751751868E+00;
+    x[ 6] =  -1.2247448713915889E+00;
+    x[ 7] =  -8.7004089535290285E-01;
+    x[ 8] =  -5.2403354748695763E-01;
+    x[ 9] =   0.0000000000000000E+00;
+    x[10] =   5.2403354748695763E-01;
+    x[11] =   8.7004089535290285E-01;
+    x[12] =   1.2247448713915889E+00;
+    x[13] =   1.8357079751751868E+00;
+    x[14] =   2.0232301911005157E+00;
+    x[15] =   2.2665132620567876E+00;
+    x[16] =   2.9592107790638380E+00;
+    x[17] =   3.6677742159463378E+00;
+    x[18] =   4.4995993983103881E+00;
+  }
+  else if ( n == 35 )
+  {
+    x[ 0] =  -6.3759392709822356E+00;
+    x[ 1] =  -5.6432578578857449E+00;
+    x[ 2] =  -5.0360899444730940E+00;
+    x[ 3] =  -4.4995993983103881E+00;
+    x[ 4] =  -4.0292201405043713E+00;
+    x[ 5] =  -3.6677742159463378E+00;
+    x[ 6] =  -3.3491639537131945E+00;
+    x[ 7] =  -2.9592107790638380E+00;
+    x[ 8] =  -2.5705583765842968E+00;
+    x[ 9] =  -2.2665132620567876E+00;
+    x[10] =  -2.0232301911005157E+00;
+    x[11] =  -1.8357079751751868E+00;
+    x[12] =  -1.5794121348467671E+00;
+    x[13] =  -1.2247448713915889E+00;
+    x[14] =  -8.7004089535290285E-01;
+    x[15] =  -5.2403354748695763E-01;
+    x[16] =  -1.7606414208200893E-01;
+    x[17] =   0.0000000000000000E+00;
+    x[18] =   1.7606414208200893E-01;
+    x[19] =   5.2403354748695763E-01;
+    x[20] =   8.7004089535290285E-01;
+    x[21] =   1.2247448713915889E+00;
+    x[22] =   1.5794121348467671E+00;
+    x[23] =   1.8357079751751868E+00;
+    x[24] =   2.0232301911005157E+00;
+    x[25] =   2.2665132620567876E+00;
+    x[26] =   2.5705583765842968E+00;
+    x[27] =   2.9592107790638380E+00;
+    x[28] =   3.3491639537131945E+00;
+    x[29] =   3.6677742159463378E+00;
+    x[30] =   4.0292201405043713E+00;
+    x[31] =   4.4995993983103881E+00;
+    x[32] =   5.0360899444730940E+00;
+    x[33] =   5.6432578578857449E+00;
+    x[34] =   6.3759392709822356E+00;
+  }
+  else if ( n == 37 )
+  {
+    x[ 0] =  -6.853200069757519;
+    x[ 1] =  -6.124527854622158;
+    x[ 2] =  -5.521865209868350;
+    x[ 3] =  -4.986551454150765;
+    x[ 4] =  -4.499599398310388;
+    x[ 5] =  -4.057956316089741;
+    x[ 6] =  -3.667774215946338;
+    x[ 7] =  -3.315584617593290;
+    x[ 8] =  -2.959210779063838;
+    x[ 9] =  -2.597288631188366;
+    x[10] =  -2.266513262056788;
+    x[11] =  -2.023230191100516;
+    x[12] =  -1.835707975175187;
+    x[13] =  -1.561553427651873;
+    x[14] =  -1.224744871391589;
+    x[15] =  -0.870040895352903;
+    x[16] =  -0.524033547486958;
+    x[17] =  -0.214618180588171;
+    x[18] =   0.000000000000000;
+    x[19] =   0.214618180588171;
+    x[20] =   0.524033547486958;
+    x[21] =   0.870040895352903;
+    x[22] =   1.224744871391589;
+    x[23] =   1.561553427651873;
+    x[24] =   1.835707975175187;
+    x[25] =   2.023230191100516;
+    x[26] =   2.266513262056788;
+    x[27] =   2.597288631188366;
+    x[28] =   2.959210779063838;
+    x[29] =   3.315584617593290;
+    x[30] =   3.667774215946338;
+    x[31] =   4.057956316089741;
+    x[32] =   4.499599398310388;
+    x[33] =   4.986551454150765;
+    x[34] =   5.521865209868350;
+    x[35] =   6.124527854622158;
+    x[36] =   6.853200069757519;
+  }
+  else if ( n == 41 )
+  {
+    x[ 0] =  -7.251792998192644;
+    x[ 1] =  -6.547083258397540;
+    x[ 2] =  -5.961461043404500;
+    x[ 3] =  -5.437443360177798;
+    x[ 4] =  -4.953574342912980;
+    x[ 5] =  -4.4995993983103881;
+    x[ 6] =  -4.070919267883068;
+    x[ 7] =  -3.6677742159463378;
+    x[ 8] =  -3.296114596212218;
+    x[ 9] =  -2.9592107790638380;
+    x[10] =  -2.630415236459871;
+    x[11] =  -2.2665132620567876;
+    x[12] =  -2.043834754429505;
+    x[13] =  -2.0232301911005157;
+    x[14] =  -1.8357079751751868;
+    x[15] =  -1.585873011819188;
+    x[16] =  -1.2247448713915889;
+    x[17] =  -0.87004089535290285;
+    x[18] =  -0.52403354748695763;
+    x[19] =  -0.195324784415805;
+    x[20] =   0.0000000000000000;
+    x[21] =   0.195324784415805;
+    x[22] =   0.52403354748695763;
+    x[23] =   0.87004089535290285;
+    x[24] =   1.2247448713915889;
+    x[25] =   1.585873011819188;
+    x[26] =   1.8357079751751868;
+    x[27] =   2.0232301911005157;
+    x[28] =   2.043834754429505;
+    x[29] =   2.2665132620567876;
+    x[30] =   2.630415236459871;
+    x[31] =   2.9592107790638380;
+    x[32] =   3.296114596212218;
+    x[33] =   3.6677742159463378;
+    x[34] =   4.070919267883068;
+    x[35] =   4.4995993983103881;
+    x[36] =   4.953574342912980;
+    x[37] =   5.437443360177798;
+    x[38] =   5.961461043404500;
+    x[39] =   6.547083258397540;
+    x[40] =   7.251792998192644;
+  }
+  else if ( n == 43 )
+  {
+    x[ 0] = -10.167574994881873;
+    x[ 1] =  -7.231746029072501;
+    x[ 2] =  -6.535398426382995;
+    x[ 3] =  -5.954781975039809;
+    x[ 4] =  -5.434053000365068;
+    x[ 5] =  -4.952329763008589;
+    x[ 6] =  -4.4995993983103881;
+    x[ 7] =  -4.071335874253583;
+    x[ 8] =  -3.6677742159463378;
+    x[ 9] =  -3.295265921534226;
+    x[10] =  -2.9592107790638380;
+    x[11] =  -2.633356763661946;
+    x[12] =  -2.2665132620567876;
+    x[13] =  -2.089340389294661;
+    x[14] =  -2.0232301911005157;
+    x[15] =  -1.8357079751751868;
+    x[16] =  -1.583643465293944;
+    x[17] =  -1.2247448713915889;
+    x[18] =  -0.87004089535290285;
+    x[19] =  -0.52403354748695763;
+    x[20] =  -0.196029453662011;
+    x[21] =   0.0000000000000000;
+    x[22] =   0.196029453662011;
+    x[23] =   0.52403354748695763;
+    x[24] =   0.87004089535290285;
+    x[25] =   1.2247448713915889;
+    x[26] =   1.583643465293944;
+    x[27] =   1.8357079751751868;
+    x[28] =   2.0232301911005157;
+    x[29] =   2.089340389294661;
+    x[30] =   2.2665132620567876;
+    x[31] =   2.633356763661946;
+    x[32] =   2.9592107790638380;
+    x[33] =   3.295265921534226;
+    x[34] =   3.6677742159463378;
+    x[35] =   4.071335874253583;
+    x[36] =   4.4995993983103881;
+    x[37] =   4.952329763008589;
+    x[38] =   5.434053000365068;
+    x[39] =   5.954781975039809;
+    x[40] =   6.535398426382995;
+    x[41] =   7.231746029072501;
+    x[42] =  10.167574994881873;
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "HERMITE_GENZ_KEISTER_LOOKUP_POINTS - Fatal error!\n";
+    std::cerr << "  Illegal input value of N.\n";
+    std::cerr << "  N must be 1, 3, 9, 19, 35, 37, 41 or 43.\n";
+    std::exit ( 1 );
+  }
+  return;
+}
+//****************************************************************************80
+
+void hermite_genz_keister_lookup_points_np ( int n, int np, double p[],
+  double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_GENZ_KEISTER_LOOKUP_POINTS_NP looks up Genz-Keister Hermite abscissas.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+//
+//    A nested family of rules for the Hermite integration problem
+//    was produced by Genz and Keister.  The structure of the nested
+//    family was denoted by 1+2+6+10+?, that is, it comprised rules
+//    of successive orders O = 1, 3, 9, 19, and a final rule of order
+//    35, 37, 41 or 43.
+//
+//    The precisions of these rules are P = 1, 5, 15, 29,
+//    with the final rule of precision 51, 55, 63 or 67.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    04 October 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Alan Genz, Bradley Keister,
+//    Fully symmetric interpolatory rules for multiple integrals
+//    over infinite regions with Gaussian weight,
+//    Journal of Computational and Applied Mathematics,
+//    Volume 71, 1996, pages 299-309
+//
+//    Florian Heiss, Viktor Winschel,
+//    Likelihood approximation by numerical integration on sparse grids,
+//    Journal of Econometrics,
+//    Volume 144, 2008, pages 62-80.
+//
+//    Thomas Patterson,
+//    The Optimal Addition of Points to Quadrature Formulae,
+//    Mathematics of Computation,
+//    Volume 22, Number 104, October 1968, pages 847-856.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be 1, 3, 9, 19, 35, 37, 41 or 43.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  webbur::hermite_genz_keister_lookup_points ( n, x );
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_genz_keister_lookup_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_GENZ_KEISTER_LOOKUP_WEIGHTS looks up Genz-Keister Hermite weights.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+//
+//    A nested family of rules for the Hermite integration problem
+//    was produced by Genz and Keister.  The structure of the nested
+//    family was denoted by 1+2+6+10+?, that is, it comprised rules
+//    of successive orders O = 1, 3, 9, 19, and a final rule of order
+//    35, 37, 41 or 43.
+//
+//    The precisions of these rules are P = 1, 5, 15, 29,
+//    with the final rule of precision 51, 55, 63 or 67.
+//
+//    Three related families begin the same way, but end with a different final
+//    rule.  As a convenience, this function includes these final rules as well:
+//
+//    Designation  Orders       Precisions
+//
+//    1+2+6+10+16, 1,3,9,19,35  1,5,15,29,51
+//    1+2+6+10+18  1,3,9,19,37  1,5,15,29,55
+//    1+2+6+10+22  1,3,9,19,41  1,5,15,29,63
+//    1+2+6+10+24  1,3,9,19,43  1,5,15,29,67
+//
+//    Some of the data in this function was kindly supplied directly by
+//    Alan Genz on 24 April 2011.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    04 October 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Alan Genz, Bradley Keister,
+//    Fully symmetric interpolatory rules for multiple integrals
+//    over infinite regions with Gaussian weight,
+//    Journal of Computational and Applied Mathematics,
+//    Volume 71, 1996, pages 299-309
+//
+//    Florian Heiss, Viktor Winschel,
+//    Likelihood approximation by numerical integration on sparse grids,
+//    Journal of Econometrics,
+//    Volume 144, 2008, pages 62-80.
+//
+//    Thomas Patterson,
+//    The Optimal Addition of Points to Quadrature Formulae,
+//    Mathematics of Computation,
+//    Volume 22, Number 104, October 1968, pages 847-856.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be 1, 3, 9, 19, 35, 37, 41, or 43.
+//
+//    Output, double W[N], the weights.
+//
+{
+  static double sqrtpi = 1.7724538509055159;
+
+  if ( n == 1 )
+  {
+    w[ 0] =   1.7724538509055159E+00;
+  }
+  else if ( n == 3 )
+  {
+    w[ 0] =   2.9540897515091930E-01;
+    w[ 1] =   1.1816359006036772E+00;
+    w[ 2] =   2.9540897515091930E-01;
+  }
+  else if ( n == 9 )
+  {
+    w[ 0] =   1.6708826306882348E-04;
+    w[ 1] =   1.4173117873979098E-02;
+    w[ 2] =   1.6811892894767771E-01;
+    w[ 3] =   4.7869428549114124E-01;
+    w[ 4] =   4.5014700975378197E-01;
+    w[ 5] =   4.7869428549114124E-01;
+    w[ 6] =   1.6811892894767771E-01;
+    w[ 7] =   1.4173117873979098E-02;
+    w[ 8] =   1.6708826306882348E-04;
+  }
+  else if ( n == 19 )
+  {
+    w[ 0] =   1.5295717705322357E-09;
+    w[ 1] =   1.0802767206624762E-06;
+    w[ 2] =   1.0656589772852267E-04;
+    w[ 3] =   5.1133174390883855E-03;
+    w[ 4] =  -1.1232438489069229E-02;
+    w[ 5] =   3.2055243099445879E-02;
+    w[ 6] =   1.1360729895748269E-01;
+    w[ 7] =   1.0838861955003017E-01;
+    w[ 8] =   3.6924643368920851E-01;
+    w[ 9] =   5.3788160700510168E-01;
+    w[10] =   3.6924643368920851E-01;
+    w[11] =   1.0838861955003017E-01;
+    w[12] =   1.1360729895748269E-01;
+    w[13] =   3.2055243099445879E-02;
+    w[14] =  -1.1232438489069229E-02;
+    w[15] =   5.1133174390883855E-03;
+    w[16] =   1.0656589772852267E-04;
+    w[17] =   1.0802767206624762E-06;
+    w[18] =   1.5295717705322357E-09;
+  }
+  else if ( n == 35 )
+  {
+    w[ 0] =   1.8684014894510604E-18;
+    w[ 1] =   9.6599466278563243E-15;
+    w[ 2] =   5.4896836948499462E-12;
+    w[ 3] =   8.1553721816916897E-10;
+    w[ 4] =   3.7920222392319532E-08;
+    w[ 5] =   4.3737818040926989E-07;
+    w[ 6] =   4.8462799737020461E-06;
+    w[ 7] =   6.3328620805617891E-05;
+    w[ 8] =   4.8785399304443770E-04;
+    w[ 9] =   1.4515580425155904E-03;
+    w[10] =   4.0967527720344047E-03;
+    w[11] =   5.5928828911469180E-03;
+    w[12] =   2.7780508908535097E-02;
+    w[13] =   8.0245518147390893E-02;
+    w[14] =   1.6371221555735804E-01;
+    w[15] =   2.6244871488784277E-01;
+    w[16] =   3.3988595585585218E-01;
+    w[17] =   9.1262675363737921E-04;
+    w[18] =   3.3988595585585218E-01;
+    w[19] =   2.6244871488784277E-01;
+    w[20] =   1.6371221555735804E-01;
+    w[21] =   8.0245518147390893E-02;
+    w[22] =   2.7780508908535097E-02;
+    w[23] =   5.5928828911469180E-03;
+    w[24] =   4.0967527720344047E-03;
+    w[25] =   1.4515580425155904E-03;
+    w[26] =   4.8785399304443770E-04;
+    w[27] =   6.3328620805617891E-05;
+    w[28] =   4.8462799737020461E-06;
+    w[29] =   4.3737818040926989E-07;
+    w[30] =   3.7920222392319532E-08;
+    w[31] =   8.1553721816916897E-10;
+    w[32] =   5.4896836948499462E-12;
+    w[33] =   9.6599466278563243E-15;
+    w[34] =   1.8684014894510604E-18;
+  }
+  else if ( n == 37 )
+  {
+    w[ 0] = 0.337304188079177058E-20;
+    w[ 1] = 0.332834739632930463E-16;
+    w[ 2] = 0.323016866782871498E-13;
+    w[ 3] = 0.809333688669950037E-11;
+    w[ 4] = 0.748907559239519284E-09;
+    w[ 5] = 0.294146671497083432E-07;
+    w[ 6] = 0.524482423744884136E-06;
+    w[ 7] = 0.586639457073896277E-05;
+    w[ 8] = 0.571885531470621903E-04;
+    w[ 9] = 0.41642095727577091E-03;
+    w[10] = 0.174733389581099482E-02;
+    w[11] = 0.313373786000304381E-02;
+    w[12] = 0.768092665770660459E-02;
+    w[13] = 0.274962713372148476E-01;
+    w[14] = 0.783630990508037449E-01;
+    w[15] = 0.16611584261479281E+00;
+    w[16] = 0.253636910481387185E+00;
+    w[17] = 0.261712932511430884E+00;
+    w[18] = 0.171719680968980257E+00;
+    w[19] = 0.261712932511430884E+00;
+    w[20] = 0.253636910481387185E+00;
+    w[21] = 0.16611584261479281E+00;
+    w[22] = 0.783630990508037449E-01;
+    w[23] = 0.274962713372148476E-01;
+    w[24] = 0.768092665770660459E-02;
+    w[25] = 0.313373786000304381E-02;
+    w[26] = 0.174733389581099482E-02;
+    w[27] = 0.41642095727577091E-03;
+    w[28] = 0.571885531470621903E-04;
+    w[29] = 0.586639457073896277E-05;
+    w[30] = 0.524482423744884136E-06;
+    w[31] = 0.294146671497083432E-07;
+    w[32] = 0.748907559239519284E-09;
+    w[33] = 0.809333688669950037E-11;
+    w[34] = 0.323016866782871498E-13;
+    w[35] = 0.332834739632930463E-16;
+    w[36] = 0.337304188079177058E-20;
+  }
+  else if ( n == 41 )
+  {
+    w[ 0] =   0.117725656974405367E-22;
+    w[ 1] =   0.152506745534300636E-18;
+    w[ 2] =   0.202183949965101288E-15;
+    w[ 3] =   0.724614869051195508E-13;
+    w[ 4] =   0.103121966469463034E-10;
+    w[ 5] =   0.710371395169350952E-09;
+    w[ 6] =   0.264376044449260516E-07;
+    w[ 7] =   0.558982787078644997E-06;
+    w[ 8] =   0.675628907134744976E-05;
+    w[ 9] =   0.512198007019776873E-04;
+    w[10] =   0.335013114947200879E-03;
+    w[11] =   0.249379691096933139E-02;
+    w[12] = - 0.25616995850607458E-01;
+    w[13] =   0.317007878644325588E-01;
+    w[14] =   0.125041498584003435E-02;
+    w[15] =   0.293244560924894295E-01;
+    w[16] =   0.799536390803302298E-01;
+    w[17] =   0.164543666806555251E+00;
+    w[18] =   0.258718519718241095E+00;
+    w[19] =   0.293588795735908566E+00;
+    w[20] =   0.997525375254611951E-01;
+    w[21] =   0.293588795735908566E+00;
+    w[22] =   0.258718519718241095E+00;
+    w[23] =   0.164543666806555251E+00;
+    w[24] =   0.799536390803302298E-01;
+    w[25] =   0.293244560924894295E-01;
+    w[26] =   0.125041498584003435E-02;
+    w[27] =   0.317007878644325588E-01;
+    w[28] = - 0.25616995850607458E-01;
+    w[29] =   0.249379691096933139E-02;
+    w[30] =   0.335013114947200879E-03;
+    w[31] =   0.512198007019776873E-04;
+    w[32] =   0.675628907134744976E-05;
+    w[33] =   0.558982787078644997E-06;
+    w[34] =   0.264376044449260516E-07;
+    w[35] =   0.710371395169350952E-09;
+    w[36] =   0.103121966469463034E-10;
+    w[37] =   0.724614869051195508E-13;
+    w[38] =   0.202183949965101288E-15;
+    w[39] =   0.152506745534300636E-18;
+    w[40] =   0.117725656974405367E-22;
+  }
+  else if ( n == 43 )
+  {
+    w[ 0] =   0.968100020641528185E-37;
+    w[ 1] =   0.15516931262860431E-22;
+    w[ 2] =   0.175937309107750992E-18;
+    w[ 3] =   0.217337608710893738E-15;
+    w[ 4] =   0.747837010380540069E-13;
+    w[ 5] =   0.104028132097205732E-10;
+    w[ 6] =   0.70903573389336778E-09;
+    w[ 7] =   0.263481722999966618E-07;
+    w[ 8] =   0.560127964848432175E-06;
+    w[ 9] =   0.680410934802210232E-05;
+    w[10] =   0.508343873102544037E-04;
+    w[11] =   0.32753080006610181E-03;
+    w[12] =   0.267479828788552937E-02;
+    w[13] = - 0.687704270963253854E-02;
+    w[14] =   0.119383201790913588E-01;
+    w[15] =   0.248083722871002796E-02;
+    w[16] =   0.29000335749726387E-01;
+    w[17] =   0.798689557875757008E-01;
+    w[18] =   0.164609842422580606E+00;
+    w[19] =   0.258535954731607738E+00;
+    w[20] =   0.292243810406117141E+00;
+    w[21] =   0.102730713753441829E+00;
+    w[22] =   0.292243810406117141E+00;
+    w[23] =   0.258535954731607738E+00;
+    w[24] =   0.164609842422580606E+00;
+    w[25] =   0.798689557875757008E-01;
+    w[26] =   0.29000335749726387E-01;
+    w[27] =   0.248083722871002796E-02;
+    w[28] =   0.119383201790913588E-01;
+    w[29] = - 0.687704270963253854E-02;
+    w[30] =   0.267479828788552937E-02;
+    w[31] =   0.32753080006610181E-03;
+    w[32] =   0.508343873102544037E-04;
+    w[33] =   0.680410934802210232E-05;
+    w[34] =   0.560127964848432175E-06;
+    w[35] =   0.263481722999966618E-07;
+    w[36] =   0.70903573389336778E-09;
+    w[37] =   0.104028132097205732E-10;
+    w[38] =   0.747837010380540069E-13;
+    w[39] =   0.217337608710893738E-15;
+    w[40] =   0.175937309107750992E-18;
+    w[41] =   0.15516931262860431E-22;
+    w[42] =   0.968100020641528185E-37;
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "HERMITE_GENZ_KEISTER_LOOKUP_WEIGHTS - Fatal error!\n";
+    std::cerr << "  Illegal input value of N.\n";
+    std::cerr << "  N must be 1, 3, 9, 19, 35, 37, 41 or 43.\n";
+    std::exit ( 1 );
+  }
+  return;
+}
+//****************************************************************************80
+
+void hermite_genz_keister_lookup_weights_np ( int n, int np, double p[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_GENZ_KEISTER_LOOKUP_WEIGHTS_NP looks up Genz-Keister Hermite weights.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+//
+//    A nested family of rules for the Hermite integration problem
+//    was produced by Genz and Keister.  The structure of the nested
+//    family was denoted by 1+2+6+10+?, that is, it comprised rules
+//    of successive orders O = 1, 3, 9, 19, and a final rule of order
+//    35, 37, 41 or 43.
+//
+//    The precisions of these rules are P = 1, 5, 15, 29,
+//    with the final rule of precision 51, 55, 63 or 67.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    04 October 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Alan Genz, Bradley Keister,
+//    Fully symmetric interpolatory rules for multiple integrals
+//    over infinite regions with Gaussian weight,
+//    Journal of Computational and Applied Mathematics,
+//    Volume 71, 1996, pages 299-309
+//
+//    Florian Heiss, Viktor Winschel,
+//    Likelihood approximation by numerical integration on sparse grids,
+//    Journal of Econometrics,
+//    Volume 144, 2008, pages 62-80.
+//
+//    Thomas Patterson,
+//    The Optimal Addition of Points to Quadrature Formulae,
+//    Mathematics of Computation,
+//    Volume 22, Number 104, October 1968, pages 847-856.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be 1, 3, 9, 19, 35, 37, 41 or 43.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::hermite_genz_keister_lookup_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_gk18_lookup_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_GK18_LOOKUP_POINTS: abscissas of a Hermite Genz-Keister 18 rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+//
+//    A nested family of rules for the Hermite integration problem
+//    was produced by Genz and Keister.  The structure of the nested
+//    family was denoted by 1+2+6+10+18, that is, it comprised rules
+//    of successive orders O = 1, 3, 9, 19, and 37.
+//
+//    The precisions of these rules are P = 1, 5, 15, 29, and 55.
+//
+//    Some of the data in this function was kindly supplied directly by
+//    Alan Genz on 24 April 2011.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    30 April 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Alan Genz, Bradley Keister,
+//    Fully symmetric interpolatory rules for multiple integrals
+//    over infinite regions with Gaussian weight,
+//    Journal of Computational and Applied Mathematics,
+//    Volume 71, 1996, pages 299-309
+//
+//    Florian Heiss, Viktor Winschel,
+//    Likelihood approximation by numerical integration on sparse grids,
+//    Journal of Econometrics,
+//    Volume 144, 2008, pages 62-80.
+//
+//    Thomas Patterson,
+//    The Optimal Addition of Points to Quadrature Formulae,
+//    Mathematics of Computation,
+//    Volume 22, Number 104, October 1968, pages 847-856.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be 1, 3, 9, 19, or 37.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  if ( n == 1 )
+  {
+    x[ 0] =   0.0000000000000000E+00;
+  }
+  else if ( n == 3 )
+  {
+    x[ 0] =  -1.2247448713915889E+00;
+    x[ 1] =   0.0000000000000000E+00;
+    x[ 2] =   1.2247448713915889E+00;
+  }
+  else if ( n == 9 )
+  {
+    x[ 0] =  -2.9592107790638380E+00;
+    x[ 1] =  -2.0232301911005157E+00;
+    x[ 2] =  -1.2247448713915889E+00;
+    x[ 3] =  -5.2403354748695763E-01;
+    x[ 4] =   0.0000000000000000E+00;
+    x[ 5] =   5.2403354748695763E-01;
+    x[ 6] =   1.2247448713915889E+00;
+    x[ 7] =   2.0232301911005157E+00;
+    x[ 8] =   2.9592107790638380E+00;
+  }
+  else if ( n == 19 )
+  {
+    x[ 0] =  -4.4995993983103881E+00;
+    x[ 1] =  -3.6677742159463378E+00;
+    x[ 2] =  -2.9592107790638380E+00;
+    x[ 3] =  -2.2665132620567876E+00;
+    x[ 4] =  -2.0232301911005157E+00;
+    x[ 5] =  -1.8357079751751868E+00;
+    x[ 6] =  -1.2247448713915889E+00;
+    x[ 7] =  -8.7004089535290285E-01;
+    x[ 8] =  -5.2403354748695763E-01;
+    x[ 9] =   0.0000000000000000E+00;
+    x[10] =   5.2403354748695763E-01;
+    x[11] =   8.7004089535290285E-01;
+    x[12] =   1.2247448713915889E+00;
+    x[13] =   1.8357079751751868E+00;
+    x[14] =   2.0232301911005157E+00;
+    x[15] =   2.2665132620567876E+00;
+    x[16] =   2.9592107790638380E+00;
+    x[17] =   3.6677742159463378E+00;
+    x[18] =   4.4995993983103881E+00;
+  }
+  else if ( n == 35 )
+  {
+    x[ 0] =  -6.853200069757519;
+    x[ 1] =  -6.124527854622158;
+    x[ 2] =  -5.521865209868350;
+    x[ 3] =  -4.986551454150765;
+    x[ 4] =  -4.499599398310388;
+    x[ 5] =  -4.057956316089741;
+    x[ 6] =  -3.667774215946338;
+    x[ 7] =  -3.315584617593290;
+    x[ 8] =  -2.959210779063838;
+    x[ 9] =  -2.597288631188366;
+    x[10] =  -2.266513262056788;
+    x[11] =  -2.023230191100516;
+    x[12] =  -1.835707975175187;
+    x[13] =  -1.561553427651873;
+    x[14] =  -1.224744871391589;
+    x[15] =  -0.870040895352903;
+    x[16] =  -0.524033547486958;
+    x[17] =  -0.214618180588171;
+    x[18] =   0.000000000000000;
+    x[19] =   0.214618180588171;
+    x[20] =   0.524033547486958;
+    x[21] =   0.870040895352903;
+    x[22] =   1.224744871391589;
+    x[23] =   1.561553427651873;
+    x[24] =   1.835707975175187;
+    x[25] =   2.023230191100516;
+    x[26] =   2.266513262056788;
+    x[27] =   2.597288631188366;
+    x[28] =   2.959210779063838;
+    x[29] =   3.315584617593290;
+    x[30] =   3.667774215946338;
+    x[31] =   4.057956316089741;
+    x[32] =   4.499599398310388;
+    x[33] =   4.986551454150765;
+    x[34] =   5.521865209868350;
+    x[35] =   6.124527854622158;
+    x[36] =   6.853200069757519;
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "HERMITE_GK18_LOOKUP_POINTS - Fatal error!\n";
+    std::cerr << "  Illegal input value of N.\n";
+    std::cerr << "  N must be 1, 3, 9, 19, or 37.\n";
+    std::exit ( 1 );
+  }
+  return;
+}
+//****************************************************************************80
+
+void hermite_gk22_lookup_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_GK22_LOOKUP_POINTS looks up Hermite Genz-Keister 22 points.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+//
+//    A nested family of rules for the Hermite integration problem
+//    was produced by Genz and Keister.  The structure of the nested
+//    family was denoted by 1+2+6+10+16, that is, it comprised rules
+//    of successive orders O = 1, 3, 9, 19, and 41.
+//
+//    The precisions of these rules are P = 1, 5, 15, 29, and 63.
+//
+//    Some of the data in this function was kindly supplied directly by
+//    Alan Genz on 24 April 2011.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    26 April 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Alan Genz, Bradley Keister,
+//    Fully symmetric interpolatory rules for multiple integrals
+//    over infinite regions with Gaussian weight,
+//    Journal of Computational and Applied Mathematics,
+//    Volume 71, 1996, pages 299-309
+//
+//    Thomas Patterson,
+//    The Optimal Addition of Points to Quadrature Formulae,
+//    Mathematics of Computation,
+//    Volume 22, Number 104, October 1968, pages 847-856.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be 1, 3, 9, 19, or 41.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  if ( n == 1 )
+  {
+    x[ 0] =   0.0000000000000000E+00;
+  }
+  else if ( n == 3 )
+  {
+    x[ 0] =  -1.2247448713915889E+00;
+    x[ 1] =   0.0000000000000000E+00;
+    x[ 2] =   1.2247448713915889E+00;
+  }
+  else if ( n == 9 )
+  {
+    x[ 0] =  -2.9592107790638380E+00;
+    x[ 1] =  -2.0232301911005157E+00;
+    x[ 2] =  -1.2247448713915889E+00;
+    x[ 3] =  -5.2403354748695763E-01;
+    x[ 4] =   0.0000000000000000E+00;
+    x[ 5] =   5.2403354748695763E-01;
+    x[ 6] =   1.2247448713915889E+00;
+    x[ 7] =   2.0232301911005157E+00;
+    x[ 8] =   2.9592107790638380E+00;
+  }
+  else if ( n == 19 )
+  {
+    x[ 0] =  -4.4995993983103881E+00;
+    x[ 1] =  -3.6677742159463378E+00;
+    x[ 2] =  -2.9592107790638380E+00;
+    x[ 3] =  -2.2665132620567876E+00;
+    x[ 4] =  -2.0232301911005157E+00;
+    x[ 5] =  -1.8357079751751868E+00;
+    x[ 6] =  -1.2247448713915889E+00;
+    x[ 7] =  -8.7004089535290285E-01;
+    x[ 8] =  -5.2403354748695763E-01;
+    x[ 9] =   0.0000000000000000E+00;
+    x[10] =   5.2403354748695763E-01;
+    x[11] =   8.7004089535290285E-01;
+    x[12] =   1.2247448713915889E+00;
+    x[13] =   1.8357079751751868E+00;
+    x[14] =   2.0232301911005157E+00;
+    x[15] =   2.2665132620567876E+00;
+    x[16] =   2.9592107790638380E+00;
+    x[17] =   3.6677742159463378E+00;
+    x[18] =   4.4995993983103881E+00;
+  }
+  else if ( n == 41 )
+  {
+    x[ 0] =  -7.251792998192644;
+    x[ 1] =  -6.547083258397540;
+    x[ 2] =  -5.961461043404500;
+    x[ 3] =  -5.437443360177798;
+    x[ 4] =  -4.953574342912980;
+    x[ 5] =  -4.4995993983103881;
+    x[ 6] =  -4.070919267883068;
+    x[ 7] =  -3.6677742159463378;
+    x[ 8] =  -3.296114596212218;
+    x[ 9] =  -2.9592107790638380;
+    x[10] =  -2.630415236459871;
+    x[11] =  -2.2665132620567876;
+    x[12] =  -2.043834754429505;
+    x[13] =  -2.0232301911005157;
+    x[14] =  -1.8357079751751868;
+    x[15] =  -1.585873011819188;
+    x[16] =  -1.2247448713915889;
+    x[17] =  -0.87004089535290285;
+    x[18] =  -0.52403354748695763;
+    x[19] =  -0.195324784415805;
+    x[20] =   0.0000000000000000;
+    x[21] =   0.195324784415805;
+    x[22] =   0.52403354748695763;
+    x[23] =   0.87004089535290285;
+    x[24] =   1.2247448713915889;
+    x[25] =   1.585873011819188;
+    x[26] =   1.8357079751751868;
+    x[27] =   2.0232301911005157;
+    x[28] =   2.043834754429505;
+    x[29] =   2.2665132620567876;
+    x[30] =   2.630415236459871;
+    x[31] =   2.9592107790638380;
+    x[32] =   3.296114596212218;
+    x[33] =   3.6677742159463378;
+    x[34] =   4.070919267883068;
+    x[35] =   4.4995993983103881;
+    x[36] =   4.953574342912980;
+    x[37] =   5.437443360177798;
+    x[38] =   5.961461043404500;
+    x[39] =   6.547083258397540;
+    x[40] =   7.251792998192644;
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "HERMITE_GK22_LOOKUP_POINTS - Fatal error!\n";
+    std::cerr << "  Illegal input value of N.\n";
+    std::cerr << "  N must be 1, 3, 9, 19, or 41.\n";
+    std::exit ( 1 );
+  }
+  return;
+}
+//****************************************************************************80
+
+void hermite_gk24_lookup_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_GK24_LOOKUP_POINTS looks up Hermite Genz-Keister 24 points.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+//
+//    A nested family of rules for the Hermite integration problem
+//    was produced by Genz and Keister.  The structure of the nested
+//    family was denoted by 1+2+6+10+16, that is, it comprised rules
+//    of successive orders O = 1, 3, 9, 19, and 43.
+//
+//    The precisions of these rules are P = 1, 5, 15, 29, and 67.
+//
+//    Some of the data in this function was kindly supplied directly by
+//    Alan Genz on 24 April 2011.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    26 April 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Alan Genz, Bradley Keister,
+//    Fully symmetric interpolatory rules for multiple integrals
+//    over infinite regions with Gaussian weight,
+//    Journal of Computational and Applied Mathematics,
+//    Volume 71, 1996, pages 299-309
+//
+//    Thomas Patterson,
+//    The Optimal Addition of Points to Quadrature Formulae,
+//    Mathematics of Computation,
+//    Volume 22, Number 104, October 1968, pages 847-856.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be 1, 3, 9 19, or 43.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  if ( n == 1 )
+  {
+    x[ 0] =   0.0000000000000000E+00;
+  }
+  else if ( n == 3 )
+  {
+    x[ 0] =  -1.2247448713915889E+00;
+    x[ 1] =   0.0000000000000000E+00;
+    x[ 2] =   1.2247448713915889E+00;
+  }
+  else if ( n == 9 )
+  {
+    x[ 0] =  -2.9592107790638380E+00;
+    x[ 1] =  -2.0232301911005157E+00;
+    x[ 2] =  -1.2247448713915889E+00;
+    x[ 3] =  -5.2403354748695763E-01;
+    x[ 4] =   0.0000000000000000E+00;
+    x[ 5] =   5.2403354748695763E-01;
+    x[ 6] =   1.2247448713915889E+00;
+    x[ 7] =   2.0232301911005157E+00;
+    x[ 8] =   2.9592107790638380E+00;
+  }
+  else if ( n == 19 )
+  {
+    x[ 0] =  -4.4995993983103881E+00;
+    x[ 1] =  -3.6677742159463378E+00;
+    x[ 2] =  -2.9592107790638380E+00;
+    x[ 3] =  -2.2665132620567876E+00;
+    x[ 4] =  -2.0232301911005157E+00;
+    x[ 5] =  -1.8357079751751868E+00;
+    x[ 6] =  -1.2247448713915889E+00;
+    x[ 7] =  -8.7004089535290285E-01;
+    x[ 8] =  -5.2403354748695763E-01;
+    x[ 9] =   0.0000000000000000E+00;
+    x[10] =   5.2403354748695763E-01;
+    x[11] =   8.7004089535290285E-01;
+    x[12] =   1.2247448713915889E+00;
+    x[13] =   1.8357079751751868E+00;
+    x[14] =   2.0232301911005157E+00;
+    x[15] =   2.2665132620567876E+00;
+    x[16] =   2.9592107790638380E+00;
+    x[17] =   3.6677742159463378E+00;
+    x[18] =   4.4995993983103881E+00;
+  }
+  else if ( n == 43 )
+  {
+    x[ 0] = -10.167574994881873;
+    x[ 1] =  -7.231746029072501;
+    x[ 2] =  -6.535398426382995;
+    x[ 3] =  -5.954781975039809;
+    x[ 4] =  -5.434053000365068;
+    x[ 5] =  -4.952329763008589;
+    x[ 6] =  -4.4995993983103881;
+    x[ 7] =  -4.071335874253583;
+    x[ 8] =  -3.6677742159463378;
+    x[ 9] =  -3.295265921534226;
+    x[10] =  -2.9592107790638380;
+    x[11] =  -2.633356763661946;
+    x[12] =  -2.2665132620567876;
+    x[13] =  -2.089340389294661;
+    x[14] =  -2.0232301911005157;
+    x[15] =  -1.8357079751751868;
+    x[16] =  -1.583643465293944;
+    x[17] =  -1.2247448713915889;
+    x[18] =  -0.87004089535290285;
+    x[19] =  -0.52403354748695763;
+    x[20] =  -0.196029453662011;
+    x[21] =   0.0000000000000000;
+    x[22] =   0.196029453662011;
+    x[23] =   0.52403354748695763;
+    x[24] =   0.87004089535290285;
+    x[25] =   1.2247448713915889;
+    x[26] =   1.583643465293944;
+    x[27] =   1.8357079751751868;
+    x[28] =   2.0232301911005157;
+    x[29] =   2.089340389294661;
+    x[30] =   2.2665132620567876;
+    x[31] =   2.633356763661946;
+    x[32] =   2.9592107790638380;
+    x[33] =   3.295265921534226;
+    x[34] =   3.6677742159463378;
+    x[35] =   4.071335874253583;
+    x[36] =   4.4995993983103881;
+    x[37] =   4.952329763008589;
+    x[38] =   5.434053000365068;
+    x[39] =   5.954781975039809;
+    x[40] =   6.535398426382995;
+    x[41] =   7.231746029072501;
+    x[42] =  10.167574994881873;
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "HERMITE_GK24_LOOKUP_POINTS - Fatal error!\n";
+    std::cerr << "  Illegal input value of N.\n";
+    std::cerr << "  N must be 1, 3, 9, 19, or 43.\n";
+    std::exit ( 1 );
+  }
+  return;
+}
+//****************************************************************************80
+
+double hermite_integral ( int n )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_INTEGRAL evaluates a monomial Hermite integral.
+//
+//  Discussion:
+//
+//    H(n) = Integral ( -oo < x < +oo ) x^n exp(-x^2) dx
+//
+//    H(n) is 0 for n odd.
+//
+//    H(n) = (n-1)!! * sqrt(pi) / 2^(n/2) for n even.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order of the integral.
+//    0 <= N.
+//
+//    Output, double VALUE, the value of the integral.
+//
+{
+  double pi = 3.141592653589793;
+  double value;
+
+  if ( n < 0 )
+  {
+    value = - webbur::r8_huge ( );
+  }
+  else if ( ( n % 2 ) == 1 )
+  {
+    value = 0.0;
+  }
+  else
+  {
+    value = webbur::r8_factorial2 ( n - 1 ) * std::sqrt ( pi )
+      / std::pow ( 2.0, n / 2 );
+  }
+
+  return value;
+}
+//****************************************************************************80
+
+void hermite_interpolant ( int n, double x[], double y[], double yp[],
+  double xd[], double yd[], double xdp[], double ydp[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_INTERPOLANT sets up a divided difference table from Hermite data.
+//
+//  Discussion:
+//
+//    The polynomial represented by the divided difference table can be
+//    evaluated by calling DIF_VALS.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    31 October 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Carl deBoor,
+//    A Practical Guide to Splines,
+//    Springer, 2001,
+//    ISBN: 0387953663,
+//    LC: QA1.A647.v27.
+//
+//  Parameters:
+//
+//    Input, int N, of items of data
+//    ( X(I), Y(I), YP(I) ).
+//
+//    Input, double X[N], the abscissas.
+//    These values must be distinct.
+//
+//    Input, double Y[N], YP[N], the function and derivative values.
+//
+//    Output, double XD[2*N], YD[2*N], the divided difference table
+//    for the interpolant value.
+//
+//    Output, double XDP[2*N-1], YDP[2*N-1], the divided difference
+//    table for the interpolant derivative.
+//
+{
+  int i;
+  int j;
+  int nd;
+  int ndp;
+//
+//  Copy the data.
+//
+  nd = 2 * n;
+
+  for ( i = 0; i < n; i++ )
+  {
+    xd[0+i*2] = x[i];
+    xd[1+i*2] = x[i];
+  }
+//
+//  Carry out the first step of differencing.
+//
+  yd[0] = y[0];
+  for ( i = 1; i < n; i++ )
+  {
+    yd[0+2*i] = ( y[i] - y[i-1] ) / ( x[i] - x[i-1] );
+  }
+  for ( i = 0; i < n; i++ )
+  {
+    yd[1+2*i] = yp[i];
+  }
+//
+//  Carry out the remaining steps in the usual way.
+//
+  for ( i = 2; i < nd; i++ )
+  {
+    for ( j = nd - 1; i <= j; j-- )
+    {
+      yd[j] = ( yd[j] - yd[j-1] ) / ( xd[j] - xd[j-i] );
+    }
+  }
+//
+//  Compute the difference table for the derivative.
+//
+  webbur::dif_deriv ( nd, xd, yd, &ndp, xdp, ydp );
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_interpolant_rule ( int n, double a, double b, double x[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_INTERPOLANT_RULE: quadrature rule for a Hermite interpolant.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    23 October 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of abscissas.
+//
+//    Input, double A, B, the integration limits.
+//
+//    Input, double X[N], the abscissas.
+//
+//    Output, double W[2*N], the quadrature
+//    coefficients, given as pairs for function and derivative values
+//    at each abscissa.
+//
+{
+  double a_value;
+  double b_value;
+  double *c;
+  int i;
+  int j;
+  int k;
+  int nd;
+  int ndp;
+  double *xd;
+  double *xdp;
+  double *y;
+  double *yd;
+  double *ydp;
+  double *yp;
+
+  y = new double[n];
+  yp = new double[n];
+
+  nd = 2 * n;
+  c = new double[nd];
+  xd = new double[nd];
+  yd = new double[nd];
+
+  ndp = 2 * n - 1;
+  xdp = new double[ndp];
+  ydp = new double[ndp];
+
+  for ( i = 0; i < n; i++ )
+  {
+    y[i] = 0.0;
+    yp[i] = 0.0;
+  }
+
+  k = 0;
+
+  for ( i = 0; i < n; i++ )
+  {
+    y[i] = 1.0;
+    webbur::hermite_interpolant ( n, x, y, yp, xd, yd, xdp, ydp );
+    webbur::dif_to_r8poly ( nd, xd, yd, c );
+    a_value = webbur::r8poly_ant_val ( n, c, a );
+    b_value = webbur::r8poly_ant_val ( n, c, b );
+    w[k] = b_value - a_value;
+    y[i] = 0.0;
+    k = k + 1;
+
+    yp[i] = 1.0;
+    webbur::hermite_interpolant ( n, x, y, yp, xd, yd, xdp, ydp );
+    webbur::dif_to_r8poly ( nd, xd, yd, c );
+    a_value = webbur::r8poly_ant_val ( n, c, a );
+    b_value = webbur::r8poly_ant_val ( n, c, b );
+    w[k] = b_value - a_value;
+    yp[i] = 0.0;
+    k = k + 1;
+  }
+
+  delete [] c;
+  delete [] xd;
+  delete [] xdp;
+  delete [] y;
+  delete [] yd;
+  delete [] ydp;
+  delete [] yp;
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_interpolant_value ( int nd, double xd[], double yd[], double xdp[],
+  double ydp[], int nv, double xv[], double yv[], double yvp[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_INTERPOLANT_VALUE evaluates the Hermite interpolant polynomial.
+//
+//  Discussion:
+//
+//    In fact, this function will evaluate an arbitrary polynomial that is
+//    represented by a difference table.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    31 October 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Carl deBoor,
+//    A Practical Guide to Splines,
+//    Springer, 2001,
+//    ISBN: 0387953663,
+//    LC: QA1.A647.v27.
+//
+//  Parameters:
+//
+//    Input, int ND, the order of the difference table.
+//
+//    Input, double XD[ND], YD[ND], the difference table for the
+//    interpolant value.
+//
+//    Input, double XDP[ND-1], YDP[ND-1], the difference table for
+//    the interpolant derivative.
+//
+//    Input, int NV, the number of evaluation points.
+//
+//    Input, double XV[NV], the evaluation points.
+//
+//    Output, double YV[NV], YVP[NV], the value of the interpolant and
+//    its derivative at the evaluation points.
+//
+{
+  int i;
+  int j;
+  int ndp;
+
+  ndp = nd - 1;
+
+  for ( j = 0; j < nv; j++ )
+  {
+    yv[j] = yd[nd-1];
+    for ( i = nd - 2; 0 <= i; i-- )
+    {
+      yv[j] = yd[i] + ( xv[j] - xd[i] ) * yv[j];
+    }
+
+    yvp[j] = ydp[ndp-1];
+    for ( i = ndp - 2; 0 <= i; i-- )
+    {
+      yvp[j] = ydp[i] + ( xv[j] - xdp[i] ) * yvp[j];
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void hermite_lookup ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_LOOKUP looks up abscissas and weights for Gauss-Hermite quadrature.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    27 April 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Milton Abramowitz, Irene Stegun,
+//    Handbook of Mathematical Functions,
+//    National Bureau of Standards, 1964,
+//    ISBN: 0-486-61272-4,
+//    LC: QA47.A34.
+//
+//    Vladimir Krylov,
+//    Approximate Calculation of Integrals,
+//    Dover, 2006,
+//    ISBN: 0486445798.
+//    LC: QA311.K713.
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//    Stephen Wolfram,
+//    The Mathematica Book,
+//    Fourth Edition,
+//    Cambridge University Press, 1999,
+//    ISBN: 0-521-64314-7,
+//    LC: QA76.95.W65.
+//
+//    Daniel Zwillinger, editor,
+//    CRC Standard Mathematical Tables and Formulae,
+//    30th Edition,
+//    CRC Press, 1996,
+//    ISBN: 0-8493-2479-3,
+//    LC: QA47.M315.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be between 1 and 20.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::hermite_lookup_points ( n, x );
+
+  webbur::hermite_lookup_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_lookup_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_LOOKUP_POINTS looks up abscissas for Hermite quadrature.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( -oo < x < +oo ) exp ( - x * x ) * f(x) dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * f ( x(i) ).
+//
+//    Mathematica can numerically estimate the abscissas
+//    of order N to P digits by the command:
+//
+//      NSolve [ HermiteH [ n, x ] == 0, x, p ]
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    27 April 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Milton Abramowitz, Irene Stegun,
+//    Handbook of Mathematical Functions,
+//    National Bureau of Standards, 1964,
+//    ISBN: 0-486-61272-4,
+//    LC: QA47.A34.
+//
+//    Vladimir Krylov,
+//    Approximate Calculation of Integrals,
+//    Dover, 2006,
+//    ISBN: 0486445798,
+//    LC: QA311.K713.
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//    Stephen Wolfram,
+//    The Mathematica Book,
+//    Fourth Edition,
+//    Cambridge University Press, 1999,
+//    ISBN: 0-521-64314-7,
+//    LC: QA76.95.W65.
+//
+//    Daniel Zwillinger, editor,
+//    CRC Standard Mathematical Tables and Formulae,
+//    30th Edition,
+//    CRC Press, 1996,
+//    ISBN: 0-8493-2479-3,
+//    LC: QA47.M315.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be between 1 and 20.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  if ( n == 1 )
+  {
+    x[0] = 0.0;
+  }
+  else if ( n == 2 )
+  {
+    x[0] = - 0.707106781186547524400844362105E+00;
+    x[1] =   0.707106781186547524400844362105E+00;
+  }
+  else if ( n == 3 )
+  {
+    x[0] = - 0.122474487139158904909864203735E+01;
+    x[1] =   0.0E+00;
+    x[2] =   0.122474487139158904909864203735E+01;
+  }
+  else if ( n == 4 )
+  {
+    x[0] = - 0.165068012388578455588334111112E+01;
+    x[1] = - 0.524647623275290317884060253835E+00;
+    x[2] =   0.524647623275290317884060253835E+00;
+    x[3] =   0.165068012388578455588334111112E+01;
+  }
+  else if ( n == 5 )
+  {
+    x[0] = - 0.202018287045608563292872408814E+01;
+    x[1] = - 0.958572464613818507112770593893E+00;
+    x[2] =   0.0E+00;
+    x[3] =   0.958572464613818507112770593893E+00;
+    x[4] =   0.202018287045608563292872408814E+01;
+  }
+  else if ( n == 6 )
+  {
+    x[0] = - 0.235060497367449222283392198706E+01;
+    x[1] = - 0.133584907401369694971489528297E+01;
+    x[2] = - 0.436077411927616508679215948251E+00;
+    x[3] =   0.436077411927616508679215948251E+00;
+    x[4] =   0.133584907401369694971489528297E+01;
+    x[5] =   0.235060497367449222283392198706E+01;
+  }
+  else if ( n == 7 )
+  {
+    x[0] = - 0.265196135683523349244708200652E+01;
+    x[1] = - 0.167355162876747144503180139830E+01;
+    x[2] = - 0.816287882858964663038710959027E+00;
+    x[3] =   0.0E+00;
+    x[4] =   0.816287882858964663038710959027E+00;
+    x[5] =   0.167355162876747144503180139830E+01;
+    x[6] =   0.265196135683523349244708200652E+01;
+  }
+  else if ( n == 8 )
+  {
+    x[0] = - 0.293063742025724401922350270524E+01;
+    x[1] = - 0.198165675669584292585463063977E+01;
+    x[2] = - 0.115719371244678019472076577906E+01;
+    x[3] = - 0.381186990207322116854718885584E+00;
+    x[4] =   0.381186990207322116854718885584E+00;
+    x[5] =   0.115719371244678019472076577906E+01;
+    x[6] =   0.198165675669584292585463063977E+01;
+    x[7] =   0.293063742025724401922350270524E+01;
+  }
+  else if ( n == 9 )
+  {
+    x[0] = - 0.319099320178152760723004779538E+01;
+    x[1] = - 0.226658058453184311180209693284E+01;
+    x[2] = - 0.146855328921666793166701573925E+01;
+    x[3] = - 0.723551018752837573322639864579E+00;
+    x[4] =   0.0E+00;
+    x[5] =   0.723551018752837573322639864579E+00;
+    x[6] =   0.146855328921666793166701573925E+01;
+    x[7] =   0.226658058453184311180209693284E+01;
+    x[8] =   0.319099320178152760723004779538E+01;
+  }
+  else if ( n == 10 )
+  {
+    x[0] =  - 0.343615911883773760332672549432E+01;
+    x[1] =  - 0.253273167423278979640896079775E+01;
+    x[2] =  - 0.175668364929988177345140122011E+01;
+    x[3] =  - 0.103661082978951365417749191676E+01;
+    x[4] =  - 0.342901327223704608789165025557E+00;
+    x[5] =    0.342901327223704608789165025557E+00;
+    x[6] =    0.103661082978951365417749191676E+01;
+    x[7] =    0.175668364929988177345140122011E+01;
+    x[8] =    0.253273167423278979640896079775E+01;
+    x[9] =    0.343615911883773760332672549432E+01;
+  }
+  else if ( n == 11 )
+  {
+    x[0] =  - 0.366847084655958251845837146485E+01;
+    x[1] =  - 0.278329009978165177083671870152E+01;
+    x[2] =  - 0.202594801582575533516591283121E+01;
+    x[3] =  - 0.132655708449493285594973473558E+01;
+    x[4] =  - 0.656809566882099765024611575383E+00;
+    x[5] =    0.0E+00;
+    x[6] =    0.656809566882099765024611575383E+00;
+    x[7] =    0.132655708449493285594973473558E+01;
+    x[8] =    0.202594801582575533516591283121E+01;
+    x[9] =    0.278329009978165177083671870152E+01;
+    x[10] =   0.366847084655958251845837146485E+01;
+  }
+  else if ( n == 12 )
+  {
+    x[0] =  - 0.388972489786978191927164274724E+01;
+    x[1] =  - 0.302063702512088977171067937518E+01;
+    x[2] =  - 0.227950708050105990018772856942E+01;
+    x[3] =  - 0.159768263515260479670966277090E+01;
+    x[4] =  - 0.947788391240163743704578131060E+00;
+    x[5] =  - 0.314240376254359111276611634095E+00;
+    x[6] =    0.314240376254359111276611634095E+00;
+    x[7] =    0.947788391240163743704578131060E+00;
+    x[8] =    0.159768263515260479670966277090E+01;
+    x[9] =    0.227950708050105990018772856942E+01;
+    x[10] =   0.302063702512088977171067937518E+01;
+    x[11] =   0.388972489786978191927164274724E+01;
+  }
+  else if ( n == 13 )
+  {
+    x[0] =  - 0.410133759617863964117891508007E+01;
+    x[1] =  - 0.324660897837240998812205115236E+01;
+    x[2] =  - 0.251973568567823788343040913628E+01;
+    x[3] =  - 0.185310765160151214200350644316E+01;
+    x[4] =  - 0.122005503659074842622205526637E+01;
+    x[5] =  - 0.605763879171060113080537108602E+00;
+    x[6] =    0.0E+00;
+    x[7] =    0.605763879171060113080537108602E+00;
+    x[8] =    0.122005503659074842622205526637E+01;
+    x[9] =    0.185310765160151214200350644316E+01;
+    x[10] =   0.251973568567823788343040913628E+01;
+    x[11] =   0.324660897837240998812205115236E+01;
+    x[12] =   0.410133759617863964117891508007E+01;
+  }
+  else if ( n == 14 )
+  {
+    x[0] =  - 0.430444857047363181262129810037E+01;
+    x[1] =  - 0.346265693360227055020891736115E+01;
+    x[2] =  - 0.274847072498540256862499852415E+01;
+    x[3] =  - 0.209518325850771681573497272630E+01;
+    x[4] =  - 0.147668273114114087058350654421E+01;
+    x[5] =  - 0.878713787329399416114679311861E+00;
+    x[6] =  - 0.291745510672562078446113075799E+00;
+    x[7] =    0.291745510672562078446113075799E+00;
+    x[8] =    0.878713787329399416114679311861E+00;
+    x[9] =    0.147668273114114087058350654421E+01;
+    x[10] =   0.209518325850771681573497272630E+01;
+    x[11] =   0.274847072498540256862499852415E+01;
+    x[12] =   0.346265693360227055020891736115E+01;
+    x[13] =   0.430444857047363181262129810037E+01;
+  }
+  else if ( n == 15 )
+  {
+    x[0] =  - 0.449999070730939155366438053053E+01;
+    x[1] =  - 0.366995037340445253472922383312E+01;
+    x[2] =  - 0.296716692790560324848896036355E+01;
+    x[3] =  - 0.232573248617385774545404479449E+01;
+    x[4] =  - 0.171999257518648893241583152515E+01;
+    x[5] =  - 0.113611558521092066631913490556E+01;
+    x[6] =  - 0.565069583255575748526020337198E+00;
+    x[7] =    0.0E+00;
+    x[8] =    0.565069583255575748526020337198E+00;
+    x[9] =    0.113611558521092066631913490556E+01;
+    x[10] =   0.171999257518648893241583152515E+01;
+    x[11] =   0.232573248617385774545404479449E+01;
+    x[12] =   0.296716692790560324848896036355E+01;
+    x[13] =   0.366995037340445253472922383312E+01;
+    x[14] =   0.449999070730939155366438053053E+01;
+  }
+  else if ( n == 16 )
+  {
+    x[0] =  - 0.468873893930581836468849864875E+01;
+    x[1] =  - 0.386944790486012269871942409801E+01;
+    x[2] =  - 0.317699916197995602681399455926E+01;
+    x[3] =  - 0.254620215784748136215932870545E+01;
+    x[4] =  - 0.195178799091625397743465541496E+01;
+    x[5] =  - 0.138025853919888079637208966969E+01;
+    x[6] =  - 0.822951449144655892582454496734E+00;
+    x[7] =  - 0.273481046138152452158280401965E+00;
+    x[8] =    0.273481046138152452158280401965E+00;
+    x[9] =    0.822951449144655892582454496734E+00;
+    x[10] =   0.138025853919888079637208966969E+01;
+    x[11] =   0.195178799091625397743465541496E+01;
+    x[12] =   0.254620215784748136215932870545E+01;
+    x[13] =   0.317699916197995602681399455926E+01;
+    x[14] =   0.386944790486012269871942409801E+01;
+    x[15] =   0.468873893930581836468849864875E+01;
+  }
+  else if ( n == 17 )
+  {
+    x[0] =  - 0.487134519367440308834927655662E+01;
+    x[1] =  - 0.406194667587547430689245559698E+01;
+    x[2] =  - 0.337893209114149408338327069289E+01;
+    x[3] =  - 0.275776291570388873092640349574E+01;
+    x[4] =  - 0.217350282666662081927537907149E+01;
+    x[5] =  - 0.161292431422123133311288254454E+01;
+    x[6] =  - 0.106764872574345055363045773799E+01;
+    x[7] =  - 0.531633001342654731349086553718E+00;
+    x[8] =    0.0E+00;
+    x[9] =    0.531633001342654731349086553718E+00;
+    x[10] =   0.106764872574345055363045773799E+01;
+    x[11] =   0.161292431422123133311288254454E+01;
+    x[12] =   0.217350282666662081927537907149E+01;
+    x[13] =   0.275776291570388873092640349574E+01;
+    x[14] =   0.337893209114149408338327069289E+01;
+    x[15] =   0.406194667587547430689245559698E+01;
+    x[16] =   0.487134519367440308834927655662E+01;
+  }
+  else if ( n == 18 )
+  {
+    x[0] =  - 0.504836400887446676837203757885E+01;
+    x[1] =  - 0.424811787356812646302342016090E+01;
+    x[2] =  - 0.357376906848626607950067599377E+01;
+    x[3] =  - 0.296137750553160684477863254906E+01;
+    x[4] =  - 0.238629908916668600026459301424E+01;
+    x[5] =  - 0.183553160426162889225383944409E+01;
+    x[6] =  - 0.130092085838961736566626555439E+01;
+    x[7] =  - 0.776682919267411661316659462284E+00;
+    x[8] =  - 0.258267750519096759258116098711E+00;
+    x[9] =    0.258267750519096759258116098711E+00;
+    x[10] =   0.776682919267411661316659462284E+00;
+    x[11] =   0.130092085838961736566626555439E+01;
+    x[12] =   0.183553160426162889225383944409E+01;
+    x[13] =   0.238629908916668600026459301424E+01;
+    x[14] =   0.296137750553160684477863254906E+01;
+    x[15] =   0.357376906848626607950067599377E+01;
+    x[16] =   0.424811787356812646302342016090E+01;
+    x[17] =   0.504836400887446676837203757885E+01;
+  }
+  else if ( n == 19 )
+  {
+    x[0] =  - 0.522027169053748216460967142500E+01;
+    x[1] =  - 0.442853280660377943723498532226E+01;
+    x[2] =  - 0.376218735196402009751489394104E+01;
+    x[3] =  - 0.315784881834760228184318034120E+01;
+    x[4] =  - 0.259113378979454256492128084112E+01;
+    x[5] =  - 0.204923170985061937575050838669E+01;
+    x[6] =  - 0.152417061939353303183354859367E+01;
+    x[7] =  - 0.101036838713431135136859873726E+01;
+    x[8] =  - 0.503520163423888209373811765050E+00;
+    x[9] =    0.0E+00;
+    x[10] =   0.503520163423888209373811765050E+00;
+    x[11] =   0.101036838713431135136859873726E+01;
+    x[12] =   0.152417061939353303183354859367E+01;
+    x[13] =   0.204923170985061937575050838669E+01;
+    x[14] =   0.259113378979454256492128084112E+01;
+    x[15] =   0.315784881834760228184318034120E+01;
+    x[16] =   0.376218735196402009751489394104E+01;
+    x[17] =   0.442853280660377943723498532226E+01;
+    x[18] =   0.522027169053748216460967142500E+01;
+  }
+  else if ( n == 20 )
+  {
+    x[0] =  - 0.538748089001123286201690041068E+01;
+    x[1] =  - 0.460368244955074427307767524898E+01;
+    x[2] =  - 0.394476404011562521037562880052E+01;
+    x[3] =  - 0.334785456738321632691492452300E+01;
+    x[4] =  - 0.278880605842813048052503375640E+01;
+    x[5] =  - 0.225497400208927552308233334473E+01;
+    x[6] =  - 0.173853771211658620678086566214E+01;
+    x[7] =  - 0.123407621539532300788581834696E+01;
+    x[8] =  - 0.737473728545394358705605144252E+00;
+    x[9] =  - 0.245340708300901249903836530634E+00;
+    x[10] =   0.245340708300901249903836530634E+00;
+    x[11] =   0.737473728545394358705605144252E+00;
+    x[12] =   0.123407621539532300788581834696E+01;
+    x[13] =   0.173853771211658620678086566214E+01;
+    x[14] =   0.225497400208927552308233334473E+01;
+    x[15] =   0.278880605842813048052503375640E+01;
+    x[16] =   0.334785456738321632691492452300E+01;
+    x[17] =   0.394476404011562521037562880052E+01;
+    x[18] =   0.460368244955074427307767524898E+01;
+    x[19] =   0.538748089001123286201690041068E+01;
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "HERMITE_LOOKUP_POINTS - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::cerr << "  Legal values are 1 through 20.\n";
+    std::exit ( 1 );
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_lookup_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_LOOKUP_WEIGHTS looks up weights for Hermite quadrature.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( -oo < x < +oo ) exp ( - x * x ) * f(x) dx
+//
+//    The quadrature rule:
+//
+//      sum ( 1 <= i <= n ) w(i) * f ( x(i) ).
+//
+//    Mathematica can numerically estimate the abscissas
+//    of order N to P digits by the command:
+//
+//      NSolve [ HermiteH [ n, x ] == 0, x, p ]
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    27 April 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Milton Abramowitz, Irene Stegun,
+//    Handbook of Mathematical Functions,
+//    National Bureau of Standards, 1964,
+//    ISBN: 0-486-61272-4,
+//    LC: QA47.A34.
+//
+//    Vladimir Krylov,
+//    Approximate Calculation of Integrals,
+//    Dover, 2006,
+//    ISBN: 0486445798,
+//    LC: QA311.K713.
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//    Stephen Wolfram,
+//    The Mathematica Book,
+//    Fourth Edition,
+//    Cambridge University Press, 1999,
+//    ISBN: 0-521-64314-7,
+//    LC: QA76.95.W65.
+//
+//    Daniel Zwillinger, editor,
+//    CRC Standard Mathematical Tables and Formulae,
+//    30th Edition,
+//    CRC Press, 1996,
+//    ISBN: 0-8493-2479-3,
+//    LC: QA47.M315.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be between 1 and 20.
+//
+//    Output, double W[N], the weights.
+//
+{
+  if ( n == 1 )
+  {
+    w[0] = 1.77245385090551602729816748334;
+  }
+  else if ( n == 2 )
+  {
+    w[0] = 0.886226925452758013649083741671E+00;
+    w[1] = 0.886226925452758013649083741671E+00;
+  }
+  else if ( n == 3 )
+  {
+    w[0] = 0.295408975150919337883027913890E+00;
+    w[1] = 0.118163590060367735153211165556E+01;
+    w[2] = 0.295408975150919337883027913890E+00;
+  }
+  else if ( n == 4 )
+  {
+    w[0] = 0.813128354472451771430345571899E-01;
+    w[1] = 0.804914090005512836506049184481E+00;
+    w[2] = 0.804914090005512836506049184481E+00;
+    w[3] = 0.813128354472451771430345571899E-01;
+  }
+  else if ( n == 5 )
+  {
+    w[0] = 0.199532420590459132077434585942E-01;
+    w[1] = 0.393619323152241159828495620852E+00;
+    w[2] = 0.945308720482941881225689324449E+00;
+    w[3] = 0.393619323152241159828495620852E+00;
+    w[4] = 0.199532420590459132077434585942E-01;
+  }
+  else if ( n == 6 )
+  {
+    w[0] = 0.453000990550884564085747256463E-02;
+    w[1] = 0.157067320322856643916311563508E+00;
+    w[2] = 0.724629595224392524091914705598E+00;
+    w[3] = 0.724629595224392524091914705598E+00;
+    w[4] = 0.157067320322856643916311563508E+00;
+    w[5] = 0.453000990550884564085747256463E-02;
+  }
+  else if ( n == 7 )
+  {
+    w[0] = 0.971781245099519154149424255939E-03;
+    w[1] = 0.545155828191270305921785688417E-01;
+    w[2] = 0.425607252610127800520317466666E+00;
+    w[3] = 0.810264617556807326764876563813E+00;
+    w[4] = 0.425607252610127800520317466666E+00;
+    w[5] = 0.545155828191270305921785688417E-01;
+    w[6] = 0.971781245099519154149424255939E-03;
+  }
+  else if ( n == 8 )
+  {
+    w[0] = 0.199604072211367619206090452544E-03;
+    w[1] = 0.170779830074134754562030564364E-01;
+    w[2] = 0.207802325814891879543258620286E+00;
+    w[3] = 0.661147012558241291030415974496E+00;
+    w[4] = 0.661147012558241291030415974496E+00;
+    w[5] = 0.207802325814891879543258620286E+00;
+    w[6] = 0.170779830074134754562030564364E-01;
+    w[7] = 0.199604072211367619206090452544E-03;
+  }
+  else if ( n == 9 )
+  {
+    w[0] = 0.396069772632643819045862946425E-04;
+    w[1] = 0.494362427553694721722456597763E-02;
+    w[2] = 0.884745273943765732879751147476E-01;
+    w[3] = 0.432651559002555750199812112956E+00;
+    w[4] = 0.720235215606050957124334723389E+00;
+    w[5] = 0.432651559002555750199812112956E+00;
+    w[6] = 0.884745273943765732879751147476E-01;
+    w[7] = 0.494362427553694721722456597763E-02;
+    w[8] = 0.396069772632643819045862946425E-04;
+  }
+  else if ( n == 10 )
+  {
+    w[0] =  0.764043285523262062915936785960E-05;
+    w[1] =  0.134364574678123269220156558585E-02;
+    w[2] =  0.338743944554810631361647312776E-01;
+    w[3] =  0.240138611082314686416523295006E+00;
+    w[4] =  0.610862633735325798783564990433E+00;
+    w[5] =  0.610862633735325798783564990433E+00;
+    w[6] =  0.240138611082314686416523295006E+00;
+    w[7] =  0.338743944554810631361647312776E-01;
+    w[8] =  0.134364574678123269220156558585E-02;
+    w[9] =  0.764043285523262062915936785960E-05;
+  }
+  else if ( n == 11 )
+  {
+    w[0] =  0.143956039371425822033088366032E-05;
+    w[1] =  0.346819466323345510643413772940E-03;
+    w[2] =  0.119113954449115324503874202916E-01;
+    w[3] =  0.117227875167708503381788649308E+00;
+    w[4] =  0.429359752356125028446073598601E+00;
+    w[5] =  0.654759286914591779203940657627E+00;
+    w[6] =  0.429359752356125028446073598601E+00;
+    w[7] =  0.117227875167708503381788649308E+00;
+    w[8] =  0.119113954449115324503874202916E-01;
+    w[9] =  0.346819466323345510643413772940E-03;
+    w[10] = 0.143956039371425822033088366032E-05;
+  }
+  else if ( n == 12 )
+  {
+    w[0] =  0.265855168435630160602311400877E-06;
+    w[1] =  0.857368704358785865456906323153E-04;
+    w[2] =  0.390539058462906185999438432620E-02;
+    w[3] =  0.516079856158839299918734423606E-01;
+    w[4] =  0.260492310264161129233396139765E+00;
+    w[5] =  0.570135236262479578347113482275E+00;
+    w[6] =  0.570135236262479578347113482275E+00;
+    w[7] =  0.260492310264161129233396139765E+00;
+    w[8] =  0.516079856158839299918734423606E-01;
+    w[9] =  0.390539058462906185999438432620E-02;
+    w[10] = 0.857368704358785865456906323153E-04;
+    w[11] = 0.265855168435630160602311400877E-06;
+  }
+  else if ( n == 13 )
+  {
+    w[0] =  0.482573185007313108834997332342E-07;
+    w[1] =  0.204303604027070731248669432937E-04;
+    w[2] =  0.120745999271938594730924899224E-02;
+    w[3] =  0.208627752961699392166033805050E-01;
+    w[4] =  0.140323320687023437762792268873E+00;
+    w[5] =  0.421616296898543221746893558568E+00;
+    w[6] =  0.604393187921161642342099068579E+00;
+    w[7] =  0.421616296898543221746893558568E+00;
+    w[8] =  0.140323320687023437762792268873E+00;
+    w[9] =  0.208627752961699392166033805050E-01;
+    w[10] = 0.120745999271938594730924899224E-02;
+    w[11] = 0.204303604027070731248669432937E-04;
+    w[12] = 0.482573185007313108834997332342E-07;
+  }
+  else if ( n == 14 )
+  {
+    w[0] =  0.862859116812515794532041783429E-08;
+    w[1] =  0.471648435501891674887688950105E-05;
+    w[2] =  0.355092613551923610483661076691E-03;
+    w[3] =  0.785005472645794431048644334608E-02;
+    w[4] =  0.685055342234652055387163312367E-01;
+    w[5] =  0.273105609064246603352569187026E+00;
+    w[6] =  0.536405909712090149794921296776E+00;
+    w[7] =  0.536405909712090149794921296776E+00;
+    w[8] =  0.273105609064246603352569187026E+00;
+    w[9] =  0.685055342234652055387163312367E-01;
+    w[10] = 0.785005472645794431048644334608E-02;
+    w[11] = 0.355092613551923610483661076691E-03;
+    w[12] = 0.471648435501891674887688950105E-05;
+    w[13] = 0.862859116812515794532041783429E-08;
+  }
+  else if ( n == 15 )
+  {
+    w[0] =  0.152247580425351702016062666965E-08;
+    w[1] =  0.105911554771106663577520791055E-05;
+    w[2] =  0.100004441232499868127296736177E-03;
+    w[3] =  0.277806884291277589607887049229E-02;
+    w[4] =  0.307800338725460822286814158758E-01;
+    w[5] =  0.158488915795935746883839384960E+00;
+    w[6] =  0.412028687498898627025891079568E+00;
+    w[7] =  0.564100308726417532852625797340E+00;
+    w[8] =  0.412028687498898627025891079568E+00;
+    w[9] =  0.158488915795935746883839384960E+00;
+    w[10] = 0.307800338725460822286814158758E-01;
+    w[11] = 0.277806884291277589607887049229E-02;
+    w[12] = 0.100004441232499868127296736177E-03;
+    w[13] = 0.105911554771106663577520791055E-05;
+    w[14] = 0.152247580425351702016062666965E-08;
+  }
+  else if ( n == 16 )
+  {
+    w[0] =  0.265480747401118224470926366050E-09;
+    w[1] =  0.232098084486521065338749423185E-06;
+    w[2] =  0.271186009253788151201891432244E-04;
+    w[3] =  0.932284008624180529914277305537E-03;
+    w[4] =  0.128803115355099736834642999312E-01;
+    w[5] =  0.838100413989858294154207349001E-01;
+    w[6] =  0.280647458528533675369463335380E+00;
+    w[7] =  0.507929479016613741913517341791E+00;
+    w[8] =  0.507929479016613741913517341791E+00;
+    w[9] =  0.280647458528533675369463335380E+00;
+    w[10] = 0.838100413989858294154207349001E-01;
+    w[11] = 0.128803115355099736834642999312E-01;
+    w[12] = 0.932284008624180529914277305537E-03;
+    w[13] = 0.271186009253788151201891432244E-04;
+    w[14] = 0.232098084486521065338749423185E-06;
+    w[15] = 0.265480747401118224470926366050E-09;
+  }
+  else if ( n == 17 )
+  {
+    w[0] =  0.458057893079863330580889281222E-10;
+    w[1] =  0.497707898163079405227863353715E-07;
+    w[2] =  0.711228914002130958353327376218E-05;
+    w[3] =  0.298643286697753041151336643059E-03;
+    w[4] =  0.506734995762753791170069495879E-02;
+    w[5] =  0.409200341495762798094994877854E-01;
+    w[6] =  0.172648297670097079217645196219E+00;
+    w[7] =  0.401826469470411956577635085257E+00;
+    w[8] =  0.530917937624863560331883103379E+00;
+    w[9] =  0.401826469470411956577635085257E+00;
+    w[10] = 0.172648297670097079217645196219E+00;
+    w[11] = 0.409200341495762798094994877854E-01;
+    w[12] = 0.506734995762753791170069495879E-02;
+    w[13] = 0.298643286697753041151336643059E-03;
+    w[14] = 0.711228914002130958353327376218E-05;
+    w[15] = 0.497707898163079405227863353715E-07;
+    w[16] = 0.458057893079863330580889281222E-10;
+  }
+  else if ( n == 18 )
+  {
+    w[0] =  0.782819977211589102925147471012E-11;
+    w[1] =  0.104672057957920824443559608435E-07;
+    w[2] =  0.181065448109343040959702385911E-05;
+    w[3] =  0.918112686792940352914675407371E-04;
+    w[4] =  0.188852263026841789438175325426E-02;
+    w[5] =  0.186400423875446519219315221973E-01;
+    w[6] =  0.973017476413154293308537234155E-01;
+    w[7] =  0.284807285669979578595606820713E+00;
+    w[8] =  0.483495694725455552876410522141E+00;
+    w[9] =  0.483495694725455552876410522141E+00;
+    w[10] = 0.284807285669979578595606820713E+00;
+    w[11] = 0.973017476413154293308537234155E-01;
+    w[12] = 0.186400423875446519219315221973E-01;
+    w[13] = 0.188852263026841789438175325426E-02;
+    w[14] = 0.918112686792940352914675407371E-04;
+    w[15] = 0.181065448109343040959702385911E-05;
+    w[16] = 0.104672057957920824443559608435E-07;
+    w[17] = 0.782819977211589102925147471012E-11;
+  }
+  else if ( n == 19 )
+  {
+    w[0] =  0.132629709449851575185289154385E-11;
+    w[1] =  0.216305100986355475019693077221E-08;
+    w[2] =  0.448824314722312295179447915594E-06;
+    w[3] =  0.272091977631616257711941025214E-04;
+    w[4] =  0.670877521407181106194696282100E-03;
+    w[5] =  0.798886677772299020922211491861E-02;
+    w[6] =  0.508103869090520673569908110358E-01;
+    w[7] =  0.183632701306997074156148485766E+00;
+    w[8] =  0.391608988613030244504042313621E+00;
+    w[9] =  0.502974888276186530840731361096E+00;
+    w[10] = 0.391608988613030244504042313621E+00;
+    w[11] = 0.183632701306997074156148485766E+00;
+    w[12] = 0.508103869090520673569908110358E-01;
+    w[13] = 0.798886677772299020922211491861E-02;
+    w[14] = 0.670877521407181106194696282100E-03;
+    w[15] = 0.272091977631616257711941025214E-04;
+    w[16] = 0.448824314722312295179447915594E-06;
+    w[17] = 0.216305100986355475019693077221E-08;
+    w[18] = 0.132629709449851575185289154385E-11;
+  }
+  else if ( n == 20 )
+  {
+    w[0] =  0.222939364553415129252250061603E-12;
+    w[1] =  0.439934099227318055362885145547E-09;
+    w[2] =  0.108606937076928169399952456345E-06;
+    w[3] =  0.780255647853206369414599199965E-05;
+    w[4] =  0.228338636016353967257145917963E-03;
+    w[5] =  0.324377334223786183218324713235E-02;
+    w[6] =  0.248105208874636108821649525589E-01;
+    w[7] =  0.109017206020023320013755033535E+00;
+    w[8] =  0.286675505362834129719659706228E+00;
+    w[9] =  0.462243669600610089650328639861E+00;
+    w[10] = 0.462243669600610089650328639861E+00;
+    w[11] = 0.286675505362834129719659706228E+00;
+    w[12] = 0.109017206020023320013755033535E+00;
+    w[13] = 0.248105208874636108821649525589E-01;
+    w[14] = 0.324377334223786183218324713235E-02;
+    w[15] = 0.228338636016353967257145917963E-03;
+    w[16] = 0.780255647853206369414599199965E-05;
+    w[17] = 0.108606937076928169399952456345E-06;
+    w[18] = 0.439934099227318055362885145547E-09;
+    w[19] = 0.222939364553415129252250061603E-12;
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "HERMITE_LOOKUP_WEIGHTS - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::cerr << "  Legal values are 1 through 20.\n";
+    std::exit ( 1 );
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_ss_compute ( int order, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_SS_COMPUTE computes a Hermite quadrature rule.
+//
+//  Discussion:
+//
+//    The abscissas are the zeros of the N-th order Hermite polynomial.
+//
+//    The integral:
+//
+//      Integral ( -oo < X < +oo ) exp ( - X * X ) * F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 April 2011
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double cc;
+  double dp2;
+  int i;
+  double p1;
+  double s;
+  double temp;
+  double x0;
+
+  if ( order < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "HERMITE_SS_COMPUTE - Fatal error!\n";
+    std::cerr << "  Illegal value of ORDER = " << order << "\n";
+    std::exit ( 1 );
+  }
+
+  cc = 1.7724538509 * webbur::r8_gamma ( ( double ) ( order ) )
+    / std::pow ( 2.0, order - 1 );
+
+  s = std::pow ( 2.0 * ( double ) ( order ) + 1.0, 1.0 / 6.0 );
+
+  for ( i = 0; i < ( order + 1 ) / 2; i++ )
+  {
+    if ( i == 0 )
+    {
+      x0 = s * s * s - 1.85575 / s;
+    }
+    else if ( i == 1 )
+    {
+      x0 = x0 - 1.14 * std::pow ( ( double ) ( order ), 0.426 ) / x0;
+    }
+    else if ( i == 2 )
+    {
+      x0 = 1.86 * x0 - 0.86 * x[0];
+    }
+    else if ( i == 3 )
+    {
+      x0 = 1.91 * x0 - 0.91 * x[1];
+    }
+    else
+    {
+      x0 = 2.0 * x0 - x[i-2];
+    }
+
+    webbur::hermite_ss_root ( &x0, order, &dp2, &p1 );
+
+    x[i] = x0;
+    w[i] = ( cc / dp2 ) / p1;
+
+    x[order-i-1] = -x0;
+    w[order-i-1] = w[i];
+  }
+//
+//  Reverse the order of the abscissas.
+//
+  for ( i = 1; i <= order/2; i++ )
+  {
+    temp       = x[i-1];
+    x[i-1]     = x[order-i];
+    x[order-i] = temp;
+  }
+
+  if ( ( order % 2 ) == 1 )
+  {
+    x[(order-1)/2] = 0.0;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_ss_recur ( double *p2, double *dp2, double *p1, double x, int order )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_SS_RECUR finds the value and derivative of a Hermite polynomial.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 April 2011
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Output, double *P2, the value of H(ORDER)(X).
+//
+//    Output, double *DP2, the value of H'(ORDER)(X).
+//
+//    Output, double *P1, the value of H(ORDER-1)(X).
+//
+//    Input, double X, the point at which polynomials are evaluated.
+//
+//    Input, int ORDER, the order of the polynomial.
+//
+{
+  int i;
+  double dq0;
+  double dq1;
+  double dq2;
+  double q0;
+  double q1;
+  double q2;
+
+  q1 = 1.0;
+  dq1 = 0.0;
+
+  q2 = x;
+  dq2 = 1.0;
+
+  for ( i = 2; i <= order; i++ )
+  {
+    q0 = q1;
+    dq0 = dq1;
+
+    q1 = q2;
+    dq1 = dq2;
+
+    q2  = x * q1 - 0.5 * ( ( double ) ( i ) - 1.0 ) * q0;
+    dq2 = x * dq1 + q1 - 0.5 * ( ( double ) ( i ) - 1.0 ) * dq0;
+  }
+
+  *p2 = q2;
+  *dp2 = dq2;
+  *p1 = q1;
+
+  return;
+}
+//****************************************************************************80
+
+void hermite_ss_root ( double *x, int order, double *dp2, double *p1 )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    HERMITE_SS_ROOT improves an approximate root of a Hermite polynomial.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 April 2011
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input/output, double *X, the approximate root, which
+//    should be improved on output.
+//
+//    Input, int ORDER, the order of the Hermite polynomial.
+//
+//    Output, double *DP2, the value of H'(ORDER)(X).
+//
+//    Output, double *P1, the value of H(ORDER-1)(X).
+//
+{
+  double d;
+  double eps;
+  double p2;
+  int step;
+  int step_max = 10;
+
+  eps = webbur::r8_epsilon ( );
+
+  for ( step = 1; step <= step_max; step++ )
+  {
+    webbur::hermite_ss_recur ( &p2, dp2, p1, *x, order );
+
+    d = p2 / ( *dp2 );
+    *x = *x - d;
+
+    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
+    {
+      return;
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+int i4_choose ( int n, int k )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4_CHOOSE computes the binomial coefficient C(N,K).
+//
+//  Discussion:
+//
+//    The value is calculated in such a way as to avoid overflow and
+//    roundoff.  The calculation is done in integer arithmetic.
+//
+//    The formula used is:
+//
+//      C(N,K) = N! / ( K! * (N-K)! )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    09 November 2007
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    ML Wolfson, HV Wright,
+//    Algorithm 160:
+//    Combinatorial of M Things Taken N at a Time,
+//    Communications of the ACM,
+//    Volume 6, Number 4, April 1963, page 161.
+//
+//  Parameters:
+//
+//    Input, int N, K, the values of N and K.
+//
+//    Output, int I4_CHOOSE, the number of combinations of N
+//    things taken K at a time.
+//
+{
+  int i;
+  int mn;
+  int mx;
+  int value;
+
+  mn = i4_min ( k, n - k );
+
+  if ( mn < 0 )
+  {
+    value = 0;
+  }
+  else if ( mn == 0 )
+  {
+    value = 1;
+  }
+  else
+  {
+    mx = i4_max ( k, n - k );
+    value = mx + 1;
+
+    for ( i = 2; i <= mn; i++ )
+    {
+      value = ( value * ( mx + i ) ) / i;
+    }
+  }
+
+  return value;
+}
+//****************************************************************************80
+
+int i4_log_2 ( int i )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4_LOG_2 returns the integer part of the logarithm base 2 of an I4.
+//
+//  Example:
+//
+//        I  I4_LOG_10
+//    -----  --------
+//        0    0
+//        1    0
+//        2    1
+//        3    1
+//        4    2
+//        5    2
+//        7    2
+//        8    3
+//        9    3
+//     1000    9
+//     1024   10
+//
+//  Discussion:
+//
+//    I4_LOG_2 ( I ) + 1 is the number of binary digits in I.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    04 January 2004
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int I, the number whose logarithm base 2 is desired.
+//
+//    Output, int I4_LOG_2, the integer part of the logarithm base 2 of
+//    the absolute value of X.
+//
+{
+  int i_abs;
+  int two_pow;
+  int value;
+
+  if ( i == 0 )
+  {
+    value = 0;
+  }
+  else
+  {
+    value = 0;
+    two_pow = 2;
+
+    i_abs = std::abs ( i );
+
+    while ( two_pow <= i_abs )
+    {
+      value = value + 1;
+      two_pow = two_pow * 2;
+    }
+  }
+
+  return value;
+}
+//****************************************************************************80
+
+int i4_max ( int i1, int i2 )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4_MAX returns the maximum of two I4's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 October 1998
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int I1, I2, are two integers to be compared.
+//
+//    Output, int I4_MAX, the larger of I1 and I2.
+//
+{
+  int value;
+
+  if ( i2 < i1 )
+  {
+    value = i1;
+  }
+  else
+  {
+    value = i2;
+  }
+  return value;
+}
+//****************************************************************************80
+
+int i4_min ( int i1, int i2 )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4_MIN returns the minimum of two I4's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 October 1998
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int I1, I2, two integers to be compared.
+//
+//    Output, int I4_MIN, the smaller of I1 and I2.
+//
+{
+  int value;
+
+  if ( i1 < i2 )
+  {
+    value = i1;
+  }
+  else
+  {
+    value = i2;
+  }
+  return value;
+}
+//****************************************************************************80
+
+int i4_power ( int i, int j )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4_POWER returns the value of I^J.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    01 April 2004
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int I, J, the base and the power.  J should be nonnegative.
+//
+//    Output, int I4_POWER, the value of I^J.
+//
+{
+  int k;
+  int value;
+
+  if ( j < 0 )
+  {
+    if ( i == 1 )
+    {
+      value = 1;
+    }
+    else if ( i == 0 )
+    {
+      std::cerr << "\n";
+      std::cerr << "I4_POWER - Fatal error!\n";
+      std::cerr << "  I^J requested, with I = 0 and J negative.\n";
+      std::exit ( 1 );
+    }
+    else
+    {
+      value = 0;
+    }
+  }
+  else if ( j == 0 )
+  {
+    if ( i == 0 )
+    {
+      std::cerr << "\n";
+      std::cerr << "I4_POWER - Fatal error!\n";
+      std::cerr << "  I^J requested, with I = 0 and J = 0.\n";
+      std::exit ( 1 );
+    }
+    else
+    {
+      value = 1;
+    }
+  }
+  else if ( j == 1 )
+  {
+    value = i;
+  }
+  else
+  {
+    value = 1;
+    for ( k = 1; k <= j; k++ )
+    {
+      value = value * i;
+    }
+  }
+  return value;
+}
+//****************************************************************************80
+
+void i4mat_copy ( int m, int n, int a1[], int a2[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4MAT_COPY copies one I4MAT to another.
+//
+//  Discussion:
+//
+//    An I4MAT is an MxN array of I4's, stored by (I,J) -> [I+J*M].
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    27 August 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, N, the number of rows and columns.
+//
+//    Input, int A1[M*N], the matrix to be copied.
+//
+//    Output, int A2[M*N], the copy of A1.
+//
+{
+  int i;
+  int j;
+
+  for ( j = 0; j < n; j++ )
+  {
+    for ( i = 0; i < m; i++ )
+    {
+      a2[i+j*m] = a1[i+j*m];
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+int *i4mat_copy_new ( int m, int n, int a1[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4MAT_COPY_NEW copies an I4MAT to a "new" I4MAT.
+//
+//  Discussion:
+//
+//    An I4MAT is an MxN array of I4's, stored by (I,J) -> [I+J*M].
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    27 August 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, N, the number of rows and columns.
+//
+//    Input, int A1[M*N], the matrix to be copied.
+//
+//    Output, int I4MAT_COPY_NEW[M*N], the copy of A1.
+//
+{
+  int *a2;
+  int i;
+  int j;
+
+  a2 = new int[m*n];
+
+  for ( j = 0; j < n; j++ )
+  {
+    for ( i = 0; i < m; i++ )
+    {
+      a2[i+j*m] = a1[i+j*m];
+    }
+  }
+  return a2;
+}
+//****************************************************************************80
+
+void i4mat_transpose_print ( int m, int n, int a[], std::string title )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4MAT_TRANSPOSE_PRINT prints an I4MAT, transposed.
+//
+//  Discussion:
+//
+//    An I4MAT is an MxN array of I4's, stored by (I,J) -> [I+J*M].
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    31 January 2005
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, the number of rows in A.
+//
+//    Input, int N, the number of columns in A.
+//
+//    Input, int A[M*N], the M by N matrix.
+//
+//    Input, string TITLE, a title.
+//
+{
+  i4mat_transpose_print_some ( m, n, a, 1, 1, m, n, title );
+
+  return;
+}
+//****************************************************************************80
+
+void i4mat_transpose_print_some ( int m, int n, int a[], int ilo, int jlo,
+  int ihi, int jhi, std::string title )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4MAT_TRANSPOSE_PRINT_SOME prints some of an I4MAT, transposed.
+//
+//  Discussion:
+//
+//    An I4MAT is an MxN array of I4's, stored by (I,J) -> [I+J*M].
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    14 June 2005
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, the number of rows of the matrix.
+//    M must be positive.
+//
+//    Input, int N, the number of columns of the matrix.
+//    N must be positive.
+//
+//    Input, int A[M*N], the matrix.
+//
+//    Input, int ILO, JLO, IHI, JHI, designate the first row and
+//    column, and the last row and column to be printed.
+//
+//    Input, string TITLE, a title.
+//
+{
+# define INCX 10
+
+  int i;
+  int i2hi;
+  int i2lo;
+  int j;
+  int j2hi;
+  int j2lo;
+
+  std::cout << "\n";
+  std::cout << title << "\n";
+//
+//  Print the columns of the matrix, in strips of INCX.
+//
+  for ( i2lo = ilo; i2lo <= ihi; i2lo = i2lo + INCX )
+  {
+    i2hi = i2lo + INCX - 1;
+    i2hi = webbur::i4_min ( i2hi, m );
+    i2hi = webbur::i4_min ( i2hi, ihi );
+
+    std::cout << "\n";
+//
+//  For each row I in the current range...
+//
+//  Write the header.
+//
+    std::cout << "  Row: ";
+    for ( i = i2lo; i <= i2hi; i++ )
+    {
+      std::cout << std::setw(6) << i - 1 << "  ";
+    }
+    std::cout << "\n";
+    std::cout << "  Col\n";
+    std::cout << "\n";
+//
+//  Determine the range of the rows in this strip.
+//
+    j2lo = webbur::i4_max ( jlo, 1 );
+    j2hi = webbur::i4_min ( jhi, n );
+
+    for ( j = j2lo; j <= j2hi; j++ )
+    {
+//
+//  Print out (up to INCX) entries in column J, that lie in the current strip.
+//
+      std::cout << std::setw(5) << j - 1 << ":";
+      for ( i = i2lo; i <= i2hi; i++ )
+      {
+        std::cout << std::setw(6) << a[i-1+(j-1)*m] << "  ";
+      }
+      std::cout << "\n";
+    }
+  }
+
+  return;
+# undef INCX
+}
+//****************************************************************************80
+
+void i4mat_write ( std::string output_filename, int m, int n, int table[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4MAT_WRITE writes an I4MAT file.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    01 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, string OUTPUT_FILENAME, the output filename.
+//
+//    Input, int M, the spatial dimension.
+//
+//    Input, int N, the number of points.
+//
+//    Input, int TABLE[M*N], the table data.
+//
+{
+  int i;
+  int j;
+  std::ofstream output;
+//
+//  Open the file.
+//
+  output.open ( output_filename.c_str ( ) );
+
+  if ( !output )
+  {
+    std::cerr << "\n";
+    std::cerr << "I4MAT_WRITE - Fatal error!\n";
+    std::cerr << "  Could not open the output file.\n";
+    return;
+  }
+//
+//  Write the data.
+//
+  for ( j = 0; j < n; j++ )
+  {
+    for ( i = 0; i < m; i++ )
+    {
+      output << std::setw(10) << table[i+j*m] << "  ";
+    }
+    output << "\n";
+  }
+//
+//  Close the file.
+//
+  output.close ( );
+
+  return;
+}
+//****************************************************************************80
+
+int *i4vec_add_new ( int n, int a[], int b[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4VEC_ADD_NEW computes C = A + B for I4VEC's.
+//
+//  Discussion:
+//
+//    An I4VEC is a vector of I4's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    28 April 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries.
+//
+//    Input, int A[N], the first vector.
+//
+//    Input, int B[N], the second vector.
+//
+//    Output, int I4VEC_ADD_NEW[N], the sum of the vectors.
+//
+{
+  int *c;
+  int i;
+
+  c = new int[n];
+
+  for ( i = 0; i < n; i++ )
+  {
+    c[i] = a[i] + b[i];
+  }
+  return c;
+}
+//****************************************************************************80
+
+bool i4vec_any_lt ( int n, int a[], int b[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4VEC_ANY_LT: ( any ( A < B ) ) for I4VEC's.
+//
+//  Discussion:
+//
+//    An I4VEC is a vector of I4's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    28 April 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries.
+//
+//    Input, int A[N], the first vector.
+//
+//    Input, int B[N], the second vector.
+//
+//    Output, bool I4VEC_ANY_LT is TRUE if any entry
+//    of A is less than the corresponding entry of B.
+//
+{
+  int i;
+  bool value;
+
+  for ( i = 0; i < n; i++ )
+  {
+    if ( a[i] < b[i] )
+    {
+      value = true;
+      return value;
+    }
+  }
+  value = false;
+
+  return value;
+}
+//****************************************************************************80
+
+void i4vec_copy ( int n, int a1[], int a2[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4VEC_COPY copies an I4VEC.
+//
+//  Discussion:
+//
+//    An I4VEC is a vector of I4's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    25 April 2007
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vectors.
+//
+//    Input, int A1[N], the vector to be copied.
+//
+//    Output, int A2[N], the copy of A1.
+//
+{
+  int i;
+
+  for ( i = 0; i < n; i++ )
+  {
+    a2[i] = a1[i];
+  }
+  return;
+}
+//****************************************************************************80
+
+int *i4vec_copy_new ( int n, int a1[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4VEC_COPY_NEW copies an I4VEC to a "new" I4VEC.
+//
+//  Discussion:
+//
+//    An I4VEC is a vector of I4's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    04 July 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vectors.
+//
+//    Input, int A1[N], the vector to be copied.
+//
+//    Output, int I4VEC_COPY_NEW[N], the copy of A1.
+//
+{
+  int *a2;
+  int i;
+
+  a2 = new int[n];
+
+  for ( i = 0; i < n; i++ )
+  {
+    a2[i] = a1[i];
+  }
+  return a2;
+}
+//****************************************************************************80
+
+void i4vec_min_mv ( int m, int n, int u[], int v[], int w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4VEC_MIN_MV determines U(1:N) /\ V for vectors U and a single vector V.
+//
+//  Discussion:
+//
+//    For two vectors U and V, each of length M, we define
+//
+//      ( U /\ V ) (I) = min ( U(I), V(I) ).
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    12 January 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, the dimension of the vectors.
+//
+//    Input, int N, the number of vectors in U.
+//
+//    Input, int U[M*N], N vectors, each of length M.
+//
+//    Input, int V[M], a vector of length M.
+//
+//    Output, int W[M*N], the value of U /\ W.
+//
+{
+  int i;
+  int j;
+
+  for ( j = 0; j < n; j++ )
+  {
+    for ( i = 0; i < m; i++ )
+    {
+      w[i+j*m] = i4_min ( u[i+j*m], v[i] );
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void i4vec_print ( int n, int a[], std::string title )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4VEC_PRINT prints an I4VEC.
+//
+//  Discussion:
+//
+//    An I4VEC is a vector of I4's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    14 November 2003
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of components of the vector.
+//
+//    Input, int A[N], the vector to be printed.
+//
+//    Input, string TITLE, a title.
+//
+{
+  int i;
+
+  std::cout << "\n";
+  std::cout << title << "\n";
+  std::cout << "\n";
+  for ( i = 0; i < n; i++ )
+  {
+    std::cout << "  " << std::setw(8) << i
+              << ": " << std::setw(8) << a[i]  << "\n";
+  }
+  return;
+}
+//****************************************************************************80
+
+int i4vec_product ( int n, int a[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4VEC_PRODUCT multiplies the entries of an I4VEC.
+//
+//  Discussion:
+//
+//    An I4VEC is a vector of integer values.
+//
+//  Example:
+//
+//    Input:
+//
+//      A = ( 1, 2, 3, 4 )
+//
+//    Output:
+//
+//      I4VEC_PRODUCT = 24
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    17 May 2003
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vector.
+//
+//    Input, int A[N], the vector
+//
+//    Output, int I4VEC_PRODUCT, the product of the entries of A.
+//
+{
+  int i;
+  int product;
+
+  product = 1;
+  for ( i = 0; i < n; i++ )
+  {
+    product = product * a[i];
+  }
+
+  return product;
+}
+//****************************************************************************80
+
+int i4vec_sum ( int n, int a[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4VEC_SUM sums the entries of an I4VEC.
+//
+//  Discussion:
+//
+//    An I4VEC is a vector of I4's.
+//
+//  Example:
+//
+//    Input:
+//
+//      A = ( 1, 2, 3, 4 )
+//
+//    Output:
+//
+//      I4VEC_SUM = 10
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    04 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vector.
+//
+//    Input, int A[N], the vector to be summed.
+//
+//    Output, int I4VEC_SUM, the sum of the entries of A.
+//
+{
+  int i;
+  int sum;
+
+  sum = 0;
+  for ( i = 0; i < n; i++ )
+  {
+    sum = sum + a[i];
+  }
+
+  return sum;
+}
+//****************************************************************************80
+
+void i4vec_zero ( int n, int a[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4VEC_ZERO zeroes an I4VEC.
+//
+//  Discussion:
+//
+//    An I4VEC is a vector of I4's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    01 August 2005
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vector.
+//
+//    Output, int A[N], a vector of zeroes.
+//
+{
+  int i;
+
+  for ( i = 0; i < n; i++ )
+  {
+    a[i] = 0;
+  }
+  return;
+}
+//****************************************************************************80
+
+int *i4vec_zero_new ( int n )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    I4VEC_ZERO_NEW creates and zeroes an I4VEC.
+//
+//  Discussion:
+//
+//    An I4VEC is a vector of I4's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    11 July 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vector.
+//
+//    Output, int I4VEC_ZERO_NEW[N], a vector of zeroes.
+//
+{
+  int *a;
+  int i;
+
+  a = new int[n];
+
+  for ( i = 0; i < n; i++ )
+  {
+    a[i] = 0;
+  }
+  return a;
+}
+//****************************************************************************80
+
+void imtqlx ( int n, double d[], double e[], double z[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    IMTQLX diagonalizes a symmetric tridiagonal matrix.
+//
+//  Discussion:
+//
+//    This routine is a slightly modified version of the EISPACK routine to
+//    perform the implicit QL algorithm on a symmetric tridiagonal matrix.
+//
+//    The authors thank the authors of EISPACK for permission to use this
+//    routine.
+//
+//    It has been modified to produce the product Q' * Z, where Z is an input
+//    vector and Q is the orthogonal matrix diagonalizing the input matrix.
+//    The changes consist (essentially) of applying the orthogonal transformations
+//    directly to Z as they are generated.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    08 January 2010
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Sylvan Elhay, Jaroslav Kautsky,
+//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
+//    Interpolatory Quadrature,
+//    ACM Transactions on Mathematical Software,
+//    Volume 13, Number 4, December 1987, pages 399-415.
+//
+//    Roger Martin, James Wilkinson,
+//    The Implicit QL Algorithm,
+//    Numerische Mathematik,
+//    Volume 12, Number 5, December 1968, pages 377-383.
+//
+//  Parameters:
+//
+//    Input, int N, the order of the matrix.
+//
+//    Input/output, double D(N), the diagonal entries of the matrix.
+//    On output, the information in D has been overwritten.
+//
+//    Input/output, double E(N), the subdiagonal entries of the
+//    matrix, in entries E(1) through E(N-1).  On output, the information in
+//    E has been overwritten.
+//
+//    Input/output, double Z(N).  On input, a vector.  On output,
+//    the value of Q' * Z, where Q is the matrix that diagonalizes the
+//    input symmetric tridiagonal matrix.
+//
+{
+  double b;
+  double c;
+  double f;
+  double g;
+  int i;
+  int ii;
+  int itn = 30;
+  int j;
+  int k;
+  int l;
+  int m;
+  int mml;
+  double p;
+  double prec;
+  double r;
+  double s;
+
+  prec = webbur::r8_epsilon ( );
+
+  if ( n == 1 )
+  {
+    return;
+  }
+
+  e[n-1] = 0.0;
+
+  for ( l = 1; l <= n; l++ )
+  {
+    j = 0;
+    for ( ; ; )
+    {
+      for ( m = l; m <= n; m++ )
+      {
+        if ( m == n )
+        {
+          break;
+        }
+
+        if ( webbur::r8_abs ( e[m-1] ) <=
+          prec * ( webbur::r8_abs ( d[m-1] ) + webbur::r8_abs ( d[m] ) ) )
+        {
+          break;
+        }
+      }
+      p = d[l-1];
+      if ( m == l )
+      {
+        break;
+      }
+      if ( itn <= j )
+      {
+        std::cerr << "\n";
+        std::cerr << "IMTQLX - Fatal error!\n";
+        std::cerr << "  Iteration limit exceeded\n";
+        std::exit ( 1 );
+      }
+      j = j + 1;
+      g = ( d[l] - p ) / ( 2.0 * e[l-1] );
+      r = std::sqrt ( g * g + 1.0 );
+      g = d[m-1] - p + e[l-1] / ( g + webbur::r8_abs ( r ) * webbur::r8_sign ( g ) );
+      s = 1.0;
+      c = 1.0;
+      p = 0.0;
+      mml = m - l;
+
+      for ( ii = 1; ii <= mml; ii++ )
+      {
+        i = m - ii;
+        f = s * e[i-1];
+        b = c * e[i-1];
+
+        if ( webbur::r8_abs ( g ) <= webbur::r8_abs ( f ) )
+        {
+          c = g / f;
+          r = std::sqrt ( c * c + 1.0 );
+          e[i] = f * r;
+          s = 1.0 / r;
+          c = c * s;
+        }
+        else
+        {
+          s = f / g;
+          r = std::sqrt ( s * s + 1.0 );
+          e[i] = g * r;
+          c = 1.0 / r;
+          s = s * c;
+        }
+        g = d[i] - p;
+        r = ( d[i-1] - g ) * s + 2.0 * c * b;
+        p = s * r;
+        d[i] = g + p;
+        g = c * r - b;
+        f = z[i];
+        z[i] = s * z[i-1] + c * f;
+        z[i-1] = c * z[i-1] - s * f;
+      }
+      d[l-1] = d[l-1] - p;
+      e[l-1] = g;
+      e[m-1] = 0.0;
+    }
+  }
+//
+//  Sorting.
+//
+  for ( ii = 2; ii <= m; ii++ )
+  {
+    i = ii - 1;
+    k = i;
+    p = d[i-1];
+
+    for ( j = ii; j <= n; j++ )
+    {
+      if ( d[j-1] < p )
+      {
+         k = j;
+         p = d[j-1];
+      }
+    }
+
+    if ( k != i )
+    {
+      d[k-1] = d[i-1];
+      d[i-1] = p;
+      p = z[i-1];
+      z[i-1] = z[k-1];
+      z[k-1] = p;
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void jacobi_compute ( int n, double alpha, double beta, double x[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    JACOBI_COMPUTE: Elhay-Kautsky method for Gauss-Jacobi quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( -1 <= X <= 1 ) (1-X)**ALPHA * (1+X)**BETA * F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    30 April 2011
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Sylvan Elhay, Jaroslav Kautsky,
+//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
+//    Interpolatory Quadrature,
+//    ACM Transactions on Mathematical Software,
+//    Volume 13, Number 4, December 1987, pages 399-415.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, double ALPHA, BETA, the exponents of (1-X) and
+//    (1+X) in the quadrature rule.  For simple Gauss-Legendre quadrature,
+//    set ALPHA = BETA = 0.0.  -1.0 < ALPHA and -1.0 < BETA are required.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double abi;
+  double *bj;
+  int i;
+  double i_r8;
+  double zemu;
+//
+//  Define the zero-th moment.
+//
+  zemu = std::pow ( 2.0, alpha + beta + 1.0 )
+    * webbur::r8_gamma ( alpha + 1.0 )
+    * webbur::r8_gamma ( beta + 1.0 )
+    / webbur::r8_gamma ( 2.0 + alpha + beta );
+//
+//  Define the Jacobi matrix.
+//
+  bj = new double[n];
+
+  x[0] = ( beta - alpha ) / ( 2.0 + alpha + beta );
+
+  bj[0] = 4.0 * ( 1.0 + alpha ) * ( 1.0 + beta )
+    / ( ( 3.0 + alpha + beta )
+      * ( 2.0 + alpha + beta ) * ( 2.0 + alpha + beta ) );
+
+  for ( i = 1; i < n; i++ )
+  {
+    i_r8 = ( double ) ( i + 1 );
+    abi = 2.0 * i_r8 + alpha + beta;
+    x[i] = ( beta + alpha ) * ( beta - alpha ) / ( ( abi - 2.0 ) * abi );
+    bj[i] = 4.0 * i_r8 * ( i_r8 + alpha ) * ( i_r8 + beta )
+      * ( i_r8 + alpha + beta )
+      / ( ( abi - 1.0 ) * ( abi + 1.0 ) * abi * abi );
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    bj[i] = std::sqrt ( bj[i] );
+  }
+
+  w[0] = std::sqrt ( zemu );
+
+  for ( i = 1; i < n; i++ )
+  {
+    w[i] = 0.0;
+  }
+//
+//  Diagonalize the Jacobi matrix.
+//
+  webbur::imtqlx ( n, x, bj, w );
+
+  for ( i = 0; i < n; i++ )
+  {
+    w[i] = w[i] * w[i];
+  }
+
+  delete [] bj;
+
+  return;
+}
+//****************************************************************************80
+
+void jacobi_compute_np ( int order, int np, double p[], double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    JACOBI_COMPUTE_NP computes a Jacobi quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( -1 <= X <= 1 ) (1-X)^ALPHA * (1+X)^BETA * F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+//
+//    Thanks to Xu Xiang of Fudan University for pointing out that
+//    an earlier implementation of this routine was incorrect!
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameter values.
+//    P[0] = ALPHA, the exponent of (1-X)
+//    P[1] = BETA,  the exponent of (1+X).
+//    -1.0 < ALPHA and -1.0 < BETA are required.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double alpha;
+  double beta;
+
+  alpha = p[0];
+  beta = p[1];
+
+  webbur::jacobi_compute ( order, alpha, beta, x, w );
+
+  return;
+}
+//****************************************************************************80
+
+void jacobi_compute_points ( int order, double alpha, double beta,
+  double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    JACOBI_COMPUTE_POINTS computes Jacobi quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    14 October 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, double ALPHA, BETA, the exponents of the (1-X) and (1+X) factors.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+{
+  double *w;
+
+  w = new double[order];
+
+  webbur::jacobi_compute ( order, alpha, beta, x, w );
+
+  delete [] w;
+
+  return;
+}
+//****************************************************************************80
+
+void jacobi_compute_points_np ( int order, int np, double p[], double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    JACOBI_COMPUTE_POINTS_NP computes Jacobi quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameter values.
+//    P[0] = ALPHA, the exponent of (1-X)
+//    P[1] = BETA,  the exponent of (1+X).
+//    -1.0 < ALPHA and -1.0 < BETA are required.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+{
+  double alpha;
+  double beta;
+
+  alpha = p[0];
+  beta = p[1];
+
+  webbur::jacobi_compute_points ( order, alpha, beta, x );
+
+  return;
+}
+//****************************************************************************80
+
+void jacobi_compute_weights ( int order, double alpha, double beta,
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    JACOBI_COMPUTE_WEIGHTS computes Jacobi quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    14 October 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, double ALPHA, BETA, the exponents of the (1-X) and (1+X) factors.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double *x;
+
+  x = new double[order];
+
+  webbur::jacobi_compute ( order, alpha, beta, x, w );
+
+  delete [] x;
+
+  return;
+}
+//****************************************************************************80
+
+void jacobi_compute_weights_np ( int order, int np, double p[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    JACOBI_COMPUTE_WEIGHTS_NP computes Jacobi quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameter values.
+//    P[0] = ALPHA, the exponent of (1-X)
+//    P[1] = BETA,  the exponent of (1+X).
+//    -1.0 < ALPHA and -1.0 < BETA are required.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double alpha;
+  double beta;
+
+  alpha = p[0];
+  beta = p[1];
+
+  webbur::jacobi_compute_weights ( order, alpha, beta, w );
+
+  return;
+}
+//****************************************************************************80
+
+double jacobi_integral ( int expon, double alpha, double beta )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    JACOBI_INTEGRAL integrates a monomial with Jacobi weight.
+//
+//  Discussion:
+//
+//    VALUE = Integral ( -1 <= X <= +1 ) x^EXPON (1-x)^ALPHA (1+x)^BETA dx
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    08 September 2007
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int EXPON, the exponent.
+//
+//    Input, double ALPHA, the exponent of (1-X) in the weight factor.
+//
+//    Input, double BETA, the exponent of (1+X) in the weight factor.
+//
+//    Output, double JACOBI_INTEGRAL, the value of the integral.
+//
+{
+  double arg1;
+  double arg2;
+  double arg3;
+  double arg4;
+  double c;
+  double s;
+  double value;
+  double value1;
+  double value2;
+
+  c = ( double ) ( expon );
+
+  if ( ( expon % 2 ) == 0 )
+  {
+    s = +1.0;
+  }
+  else
+  {
+    s = -1.0;
+  }
+
+  arg1 = - alpha;
+  arg2 =   1.0 + c;
+  arg3 =   2.0 + beta + c;
+  arg4 = - 1.0;
+
+  value1 = webbur::r8_hyper_2f1 ( arg1, arg2, arg3, arg4 );
+
+  arg1 = - beta;
+  arg2 =   1.0 + c;
+  arg3 =   2.0 + alpha + c;
+  arg4 = - 1.0;
+
+  value2 = webbur::r8_hyper_2f1 ( arg1, arg2, arg3, arg4 );
+
+  value = webbur::r8_gamma ( 1.0 + c ) * (
+      s * webbur::r8_gamma ( 1.0 + beta  ) * value1
+    / webbur::r8_gamma ( 2.0 + beta  + c )
+    +     webbur::r8_gamma ( 1.0 + alpha ) * value2
+    / webbur::r8_gamma ( 2.0 + alpha + c ) );
+
+  return value;
+}
+//****************************************************************************80
+
+void jacobi_ss_compute ( int order, double alpha, double beta, double x[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    JACOBI_SS_COMPUTE computes a Jacobi quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( -1 <= X <= 1 ) (1-X)^ALPHA * (1+X)^BETA * F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+//
+//    Thanks to Xu Xiang of Fudan University for pointing out that
+//    an earlier implementation of this routine was incorrect!
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 February 2008
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Input, double ALPHA, BETA, the exponents of (1-X) and
+//    (1+X) in the quadrature rule.  For simple Legendre quadrature,
+//    set ALPHA = BETA = 0.0.  -1.0 < ALPHA and -1.0 < BETA are required.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double an;
+  double *b;
+  double bn;
+  double *c;
+  double cc;
+  double delta;
+  double dp2;
+  int i;
+  double p1;
+  double prod;
+  double r1;
+  double r2;
+  double r3;
+  double temp;
+  double x0;
+
+  if ( order < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "JACOBI_SS_COMPUTE - Fatal error!\n";
+    std::cerr << "  Illegal value of ORDER = " << order << "\n";
+    std::exit ( 1 );
+  }
+
+  b = new double[order];
+  c = new double[order];
+//
+//  Check ALPHA and BETA.
+//
+  if ( alpha <= -1.0 )
+  {
+    std::cerr << "\n";
+    std::cerr << "JACOBI_SS_COMPUTE - Fatal error!\n";
+    std::cerr << "  -1.0 < ALPHA is required.\n";
+    std::exit ( 1 );
+  }
+
+  if ( beta <= -1.0 )
+  {
+    std::cerr << "\n";
+    std::cerr << "JACOBI_SS_COMPUTE - Fatal error!\n";
+    std::cerr << "  -1.0 < BETA is required.\n";
+    std::exit ( 1 );
+  }
+//
+//  Set the recursion coefficients.
+//
+  for ( i = 1; i <= order; i++ )
+  {
+    if ( alpha + beta == 0.0 || beta - alpha == 0.0 )
+    {
+      b[i-1] = 0.0;
+    }
+    else
+    {
+      b[i-1] = ( alpha + beta ) * ( beta - alpha ) /
+             ( ( alpha + beta + ( double ) ( 2 * i ) )
+             * ( alpha + beta + ( double ) ( 2 * i - 2 ) ) );
+    }
+
+    if ( i == 1 )
+    {
+      c[i-1] = 0.0;
+    }
+    else
+    {
+      c[i-1] = 4.0 * ( double ) ( i - 1 )
+         * ( alpha + ( double ) ( i - 1 ) )
+          * ( beta + ( double ) ( i - 1 ) )
+            * ( alpha + beta + ( double ) ( i - 1 ) ) /
+            ( ( alpha + beta + ( double ) ( 2 * i - 1 ) )
+            * std::pow ( alpha + beta + ( double ) ( 2 * i - 2 ), 2 )
+            * ( alpha + beta + ( double ) ( 2 * i - 3 ) ) );
+    }
+  }
+
+  delta = webbur::r8_gamma ( alpha        + 1.0 )
+        * webbur::r8_gamma (         beta + 1.0 )
+        / webbur::r8_gamma ( alpha + beta + 2.0 );
+
+  prod = 1.0;
+  for ( i = 2; i <= order; i++ )
+  {
+    prod = prod * c[i-1];
+  }
+  cc = delta * std::pow ( 2.0, alpha + beta + 1.0 ) * prod;
+
+  for ( i = 1; i <= order; i++ )
+  {
+    if ( i == 1 )
+    {
+      an = alpha / ( double ) ( order );
+      bn = beta / ( double ) ( order );
+
+      r1 = ( 1.0 + alpha )
+        * ( 2.78 / ( 4.0 + ( double ) ( order * order ) )
+        + 0.768 * an / ( double ) ( order ) );
+
+      r2 = 1.0 + 1.48 * an + 0.96 * bn
+        + 0.452 * an * an + 0.83 * an * bn;
+
+      x0 = ( r2 - r1 ) / r2;
+    }
+    else if ( i == 2 )
+    {
+      r1 = ( 4.1 + alpha ) /
+        ( ( 1.0 + alpha ) * ( 1.0 + 0.156 * alpha ) );
+
+      r2 = 1.0 + 0.06 * ( ( double ) ( order ) - 8.0 ) *
+        ( 1.0 + 0.12 * alpha ) / ( double ) ( order );
+
+      r3 = 1.0 + 0.012 * beta *
+        ( 1.0 + 0.25 * r8_abs ( alpha ) ) / ( double ) ( order );
+
+      x0 = x0 - r1 * r2 * r3 * ( 1.0 - x0 );
+    }
+    else if ( i == 3 )
+    {
+      r1 = ( 1.67 + 0.28 * alpha ) / ( 1.0 + 0.37 * alpha );
+
+      r2 = 1.0 + 0.22 * ( ( double ) ( order ) - 8.0 )
+        / ( double ) ( order );
+
+      r3 = 1.0 + 8.0 * beta /
+        ( ( 6.28 + beta ) * ( double ) ( order * order ) );
+
+      x0 = x0 - r1 * r2 * r3 * ( x[0] - x0 );
+    }
+    else if ( i < order - 1 )
+    {
+      x0 = 3.0 * x[i-2] - 3.0 * x[i-3] + x[i-4];
+    }
+    else if ( i == order - 1 )
+    {
+      r1 = ( 1.0 + 0.235 * beta ) / ( 0.766 + 0.119 * beta );
+
+      r2 = 1.0 / ( 1.0 + 0.639
+        * ( ( double ) ( order ) - 4.0 )
+        / ( 1.0 + 0.71 * ( ( double ) ( order ) - 4.0 ) ) );
+
+      r3 = 1.0 / ( 1.0 + 20.0 * alpha / ( ( 7.5 + alpha ) *
+        ( double ) ( order * order ) ) );
+
+      x0 = x0 + r1 * r2 * r3 * ( x0 - x[i-3] );
+    }
+    else if ( i == order )
+    {
+      r1 = ( 1.0 + 0.37 * beta ) / ( 1.67 + 0.28 * beta );
+
+      r2 = 1.0 /
+        ( 1.0 + 0.22 * ( ( double ) ( order ) - 8.0 )
+        / ( double ) ( order ) );
+
+      r3 = 1.0 / ( 1.0 + 8.0 * alpha /
+        ( ( 6.28 + alpha ) * ( double ) ( order * order ) ) );
+
+      x0 = x0 + r1 * r2 * r3 * ( x0 - x[i-3] );
+    }
+
+    webbur::jacobi_ss_root ( &x0, order, alpha, beta, &dp2, &p1, b, c );
+
+    x[i-1] = x0;
+    w[i-1] = cc / ( dp2 * p1 );
+  }
+//
+//  Reverse the order of the values.
+//
+  for ( i = 1; i <= order/2; i++ )
+  {
+    temp       = x[i-1];
+    x[i-1]     = x[order-i];
+    x[order-i] = temp;
+  }
+
+  for ( i = 1; i <=order/2; i++ )
+  {
+    temp       = w[i-1];
+    w[i-1]     = w[order-i];
+    w[order-i] = temp;
+  }
+
+  delete [] b;
+  delete [] c;
+
+  return;
+}
+//****************************************************************************80
+
+void jacobi_ss_recur ( double *p2, double *dp2, double *p1, double x, int order,
+  double alpha, double beta, double b[], double c[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    JACOBI_SS_RECUR evaluates a Jacobi polynomial.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 February 2008
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Output, double *P2, the value of J(ORDER)(X).
+//
+//    Output, double *DP2, the value of J'(ORDER)(X).
+//
+//    Output, double *P1, the value of J(ORDER-1)(X).
+//
+//    Input, double X, the point at which polynomials are evaluated.
+//
+//    Input, int ORDER, the order of the polynomial.
+//
+//    Input, double ALPHA, BETA, the exponents of (1-X) and
+//    (1+X) in the quadrature rule.
+//
+//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
+//
+{
+  double dp0;
+  double dp1;
+  int i;
+  double p0;
+
+  *p1 = 1.0;
+  dp1 = 0.0;
+
+  *p2 = x + ( alpha - beta ) / ( alpha + beta + 2.0 );
+  *dp2 = 1.0;
+
+  for ( i = 2; i <= order; i++ )
+  {
+    p0 = *p1;
+    dp0 = dp1;
+
+    *p1 = *p2;
+    dp1 = *dp2;
+
+    *p2 = ( x - b[i-1] ) *  ( *p1 ) - c[i-1] * p0;
+    *dp2 = ( x - b[i-1] ) * dp1 + ( *p1 ) - c[i-1] * dp0;
+  }
+  return;
+}
+//****************************************************************************80
+
+void jacobi_ss_root ( double *x, int order, double alpha, double beta,
+  double *dp2, double *p1, double b[], double c[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    JACOBI_SS_ROOT improves an approximate root of a Jacobi polynomial.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 February 2008
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input/output, double *X, the approximate root, which
+//    should be improved on output.
+//
+//    Input, int ORDER, the order of the polynomial.
+//
+//    Input, double ALPHA, BETA, the exponents of (1-X) and
+//    (1+X) in the quadrature rule.
+//
+//    Output, double *DP2, the value of J'(ORDER)(X).
+//
+//    Output, double *P1, the value of J(ORDER-1)(X).
+//
+//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
+//
+{
+  double d;
+  double eps;
+  double p2;
+  int step;
+  int step_max = 10;
+
+  eps = webbur::r8_epsilon ( );
+
+  for ( step = 1; step <= step_max; step++ )
+  {
+    webbur::jacobi_ss_recur ( &p2, dp2, p1, *x, order, alpha, beta, b, c );
+
+    d = p2 / ( *dp2 );
+    *x = *x - d;
+
+    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
+    {
+      return;
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void laguerre_compute ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LAGUERRE_COMPUTE: Laguerre quadrature rule by the Elhay-Kautsky method.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    23 April 2011
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Sylvan Elhay, Jaroslav Kautsky,
+//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
+//    Interpolatory Quadrature,
+//    ACM Transactions on Mathematical Software,
+//    Volume 13, Number 4, December 1987, pages 399-415.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double *bj;
+  int i;
+  double zemu;
+//
+//  Define the zero-th moment.
+//
+  zemu = 1.0;
+//
+//  Define the Jacobi matrix.
+//
+  bj = new double[n];
+
+  for ( i = 0; i < n; i++ )
+  {
+    bj[i] = ( double ) ( i + 1 );
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    x[i] = ( double ) ( 2 * i + 1 );
+  }
+
+  w[0] = std::sqrt ( zemu );
+
+  for ( i = 1; i < n; i++ )
+  {
+    w[i] = 0.0;
+  }
+//
+//  Diagonalize the Jacobi matrix.
+//
+  webbur::imtqlx ( n, x, bj, w );
+
+  for ( i = 0; i < n; i++ )
+  {
+    w[i] = w[i] * w[i];
+  }
+
+  delete [] bj;
+
+  return;
+}
+//****************************************************************************80
+
+void laguerre_compute_np ( int order, int np, double p[], double x[],
+  double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LAGUERRE_COMPUTE_NP computes a Laguerre quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( 0 <= X < +oo ) exp ( - X ) * F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+//
+//    The integral:
+//
+//      Integral ( A <= X < +oo ) F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= ORDER ) W(I) * exp ( X(I) ) * F ( X(I) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  webbur::laguerre_compute ( order, x, w );
+
+  return;
+}
+//****************************************************************************80
+
+void laguerre_compute_points ( int order, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LAGUERRE_COMPUTE_POINTS computes Laguerre quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+{
+  double *w;
+
+  w = new double[order];
+
+  webbur::laguerre_compute ( order, x, w );
+
+  delete [] w;
+
+  return;
+}
+//****************************************************************************80
+
+void laguerre_compute_points_np ( int order, int np, double p[], double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LAGUERRE_COMPUTE_POINTS_NP computes Laguerre quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+{
+  webbur::laguerre_compute_points ( order, x );
+
+  return;
+}
+//****************************************************************************80
+
+void laguerre_compute_weights ( int order, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LAGUERRE_COMPUTE_WEIGHTS computes Laguerre quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double *x;
+
+  x = new double[order];
+
+  webbur::laguerre_compute ( order, x, w );
+
+  delete [] x;
+
+  return;
+}
+//****************************************************************************80
+
+void laguerre_compute_weights_np ( int order, int np, double p[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LAGUERRE_COMPUTE_WEIGHTS_NP computes Laguerre quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  webbur::laguerre_compute_weights ( order, w );
+
+  return;
+}
+//****************************************************************************80
+
+double laguerre_integral ( int expon )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LAGUERRE_INTEGRAL evaluates a monomial Laguerre integral.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( 0 <= x < +oo ) x^n * exp ( -x ) dx
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int EXPON, the exponent.
+//    0 <= EXPON.
+//
+//    Output, double EXACT, the value of the integral.
+//
+{
+  double exact;
+
+  exact = webbur::r8_factorial ( expon );
+
+  return exact;
+}
+//****************************************************************************80
+
+void laguerre_lookup ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LAGUERRE_LOOKUP looks up abscissas and weights for Laguerre quadrature.
+//
+//  Discussion:
+//
+//    The abscissas are the zeroes of the Laguerre polynomial L(N)(X).
+//
+//    The integral:
+//
+//      Integral ( 0 <= X < +oo ) exp ( -X ) * F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= N ) W(I) * f ( X(I) )
+//
+//    The integral:
+//
+//      Integral ( 0 <= X < +oo ) F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= N ) W(I) * exp ( X(I) ) * f ( X(I) )
+//
+//    Mathematica can numerically estimate the abscissas for the
+//    n-th order polynomial to p digits of precision by the command:
+//
+//      NSolve [ LaguerreL[n,x] == 0, x, p ]
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    27 April 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Milton Abramowitz, Irene Stegun,
+//    Handbook of Mathematical Functions,
+//    National Bureau of Standards, 1964,
+//    ISBN: 0-486-61272-4,
+//    LC: QA47.A34.
+//
+//    Vladimir Krylov,
+//    Approximate Calculation of Integrals,
+//    Dover, 2006,
+//    ISBN: 0486445798,
+//    LC: QA311.K713.
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//    Stephen Wolfram,
+//    The Mathematica Book,
+//    Fourth Edition,
+//    Cambridge University Press, 1999,
+//    ISBN: 0-521-64314-7,
+//    LC: QA76.95.W65.
+//
+//    Daniel Zwillinger, editor,
+//    CRC Standard Mathematical Tables and Formulae,
+//    30th Edition,
+//    CRC Press, 1996,
+//    ISBN: 0-8493-2479-3.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be between 1 and 20.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::laguerre_lookup_points ( n, x );
+
+  webbur::laguerre_lookup_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+void laguerre_lookup_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LAGUERRE_LOOKUP_POINTS looks up abscissas for Laguerre quadrature.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    27 April 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Milton Abramowitz, Irene Stegun,
+//    Handbook of Mathematical Functions,
+//    National Bureau of Standards, 1964,
+//    ISBN: 0-486-61272-4,
+//    LC: QA47.A34.
+//
+//    Vladimir Krylov,
+//    Approximate Calculation of Integrals,
+//    Dover, 2006,
+//    ISBN: 0486445798,
+//    LC: QA311.K713.
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//    Stephen Wolfram,
+//    The Mathematica Book,
+//    Fourth Edition,
+//    Cambridge University Press, 1999,
+//    ISBN: 0-521-64314-7,
+//    LC: QA76.95.W65.
+//
+//    Daniel Zwillinger, editor,
+//    CRC Standard Mathematical Tables and Formulae,
+//    30th Edition,
+//    CRC Press, 1996,
+//    ISBN: 0-8493-2479-3.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be between 1 and 20.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  if ( n == 1 )
+  {
+    x[0] =  1.00000000000000000000000000000E+00;
+  }
+  else if ( n == 2 )
+  {
+    x[0] = 0.585786437626904951198311275790E+00;
+    x[1] = 3.41421356237309504880168872421E+00;
+  }
+  else if ( n == 3 )
+  {
+    x[0] = 0.415774556783479083311533873128E+00;
+    x[1] = 2.29428036027904171982205036136E+00;
+    x[2] = 6.28994508293747919686641576551E+00;
+  }
+  else if ( n == 4 )
+  {
+    x[0] = 0.322547689619392311800361459104E+00;
+    x[1] = 1.74576110115834657568681671252E+00;
+    x[2] = 4.53662029692112798327928538496E+00;
+    x[3] = 9.39507091230113312923353644342E+00;
+  }
+  else if ( n == 5 )
+  {
+    x[0] = 0.263560319718140910203061943361E+00;
+    x[1] = 1.41340305910651679221840798019E+00;
+    x[2] = 3.59642577104072208122318658878E+00;
+    x[3] = 7.08581000585883755692212418111E+00;
+    x[4] = 12.6408008442757826594332193066E+00;
+  }
+  else if ( n == 6 )
+  {
+    x[0] = 0.222846604179260689464354826787E+00;
+    x[1] = 1.18893210167262303074315092194E+00;
+    x[2] = 2.99273632605931407769132528451E+00;
+    x[3] = 5.77514356910451050183983036943E+00;
+    x[4] = 9.83746741838258991771554702994E+00;
+    x[5] = 15.9828739806017017825457915674E+00;
+  }
+  else if ( n == 7 )
+  {
+    x[0] = 0.193043676560362413838247885004E+00;
+    x[1] = 1.02666489533919195034519944317E+00;
+    x[2] = 2.56787674495074620690778622666E+00;
+    x[3] = 4.90035308452648456810171437810E+00;
+    x[4] = 8.18215344456286079108182755123E+00;
+    x[5] = 12.7341802917978137580126424582E+00;
+    x[6] = 19.3957278622625403117125820576E+00;
+  }
+  else if ( n == 8 )
+  {
+    x[0] = 0.170279632305100999788861856608E+00;
+    x[1] = 0.903701776799379912186020223555E+00;
+    x[2] = 2.25108662986613068930711836697E+00;
+    x[3] = 4.26670017028765879364942182690E+00;
+    x[4] = 7.04590540239346569727932548212E+00;
+    x[5] = 10.7585160101809952240599567880E+00;
+    x[6] = 15.7406786412780045780287611584E+00;
+    x[7] = 22.8631317368892641057005342974E+00;
+  }
+  else if ( n == 9 )
+  {
+    x[0] = 0.152322227731808247428107073127E+00;
+    x[1] = 0.807220022742255847741419210952E+00;
+    x[2] = 2.00513515561934712298303324701E+00;
+    x[3] = 3.78347397333123299167540609364E+00;
+    x[4] = 6.20495677787661260697353521006E+00;
+    x[5] = 9.37298525168757620180971073215E+00;
+    x[6] = 13.4662369110920935710978818397E+00;
+    x[7] = 18.8335977889916966141498992996E+00;
+    x[8] = 26.3740718909273767961410072937E+00;
+  }
+  else if ( n == 10 )
+  {
+    x[0] = 0.137793470540492430830772505653E+00;
+    x[1] = 0.729454549503170498160373121676E+00;
+    x[2] = 1.80834290174031604823292007575E+00;
+    x[3] = 3.40143369785489951448253222141E+00;
+    x[4] = 5.55249614006380363241755848687E+00;
+    x[5] = 8.33015274676449670023876719727E+00;
+    x[6] = 11.8437858379000655649185389191E+00;
+    x[7] = 16.2792578313781020995326539358E+00;
+    x[8] = 21.9965858119807619512770901956E+00;
+    x[9] = 29.9206970122738915599087933408E+00;
+  }
+  else if ( n == 11 )
+  {
+    x[0] = 0.125796442187967522675794577516E+00;
+    x[1] = 0.665418255839227841678127839420E+00;
+    x[2] = 1.64715054587216930958700321365E+00;
+    x[3] = 3.09113814303525495330195934259E+00;
+    x[4] = 5.02928440157983321236999508366E+00;
+    x[5] = 7.50988786380661681941099714450E+00;
+    x[6] = 10.6059509995469677805559216457E+00;
+    x[7] = 14.4316137580641855353200450349E+00;
+    x[8] = 19.1788574032146786478174853989E+00;
+    x[9] = 25.2177093396775611040909447797E+00;
+    x[10] = 33.4971928471755372731917259395E+00;
+  }
+  else if ( n == 12 )
+  {
+    x[0] = 0.115722117358020675267196428240E+00;
+    x[1] = 0.611757484515130665391630053042E+00;
+    x[2] = 1.51261026977641878678173792687E+00;
+    x[3] = 2.83375133774350722862747177657E+00;
+    x[4] = 4.59922763941834848460572922485E+00;
+    x[5] = 6.84452545311517734775433041849E+00;
+    x[6] = 9.62131684245686704391238234923E+00;
+    x[7] = 13.0060549933063477203460524294E+00;
+    x[8] = 17.1168551874622557281840528008E+00;
+    x[9] = 22.1510903793970056699218950837E+00;
+    x[10] = 28.4879672509840003125686072325E+00;
+    x[11] = 37.0991210444669203366389142764E+00;
+  }
+  else if ( n == 13 )
+  {
+    x[0] = 0.107142388472252310648493376977E+00;
+    x[1] = 0.566131899040401853406036347177E+00;
+    x[2] = 1.39856433645101971792750259921E+00;
+    x[3] = 2.61659710840641129808364008472E+00;
+    x[4] = 4.23884592901703327937303389926E+00;
+    x[5] = 6.29225627114007378039376523025E+00;
+    x[6] = 8.81500194118697804733348868036E+00;
+    x[7] = 11.8614035888112425762212021880E+00;
+    x[8] = 15.5107620377037527818478532958E+00;
+    x[9] = 19.8846356638802283332036594634E+00;
+    x[10] = 25.1852638646777580842970297823E+00;
+    x[11] = 31.8003863019472683713663283526E+00;
+    x[12] = 40.7230086692655795658979667001E+00;
+  }
+  else if ( n == 14 )
+  {
+    x[0] = 0.0997475070325975745736829452514E+00;
+    x[1] = 0.526857648851902896404583451502E+00;
+    x[2] = 1.30062912125149648170842022116E+00;
+    x[3] = 2.43080107873084463616999751038E+00;
+    x[4] = 3.93210282229321888213134366778E+00;
+    x[5] = 5.82553621830170841933899983898E+00;
+    x[6] = 8.14024014156514503005978046052E+00;
+    x[7] = 10.9164995073660188408130510904E+00;
+    x[8] = 14.2108050111612886831059780825E+00;
+    x[9] = 18.1048922202180984125546272083E+00;
+    x[10] = 22.7233816282696248232280886985E+00;
+    x[11] = 28.2729817232482056954158923218E+00;
+    x[12] = 35.1494436605924265828643121364E+00;
+    x[13] = 44.3660817111174230416312423666E+00;
+  }
+  else if ( n == 15 )
+  {
+    x[0] = 0.0933078120172818047629030383672E+00;
+    x[1] = 0.492691740301883908960101791412E+00;
+    x[2] = 1.21559541207094946372992716488E+00;
+    x[3] = 2.26994952620374320247421741375E+00;
+    x[4] = 3.66762272175143727724905959436E+00;
+    x[5] = 5.42533662741355316534358132596E+00;
+    x[6] = 7.56591622661306786049739555812E+00;
+    x[7] = 10.1202285680191127347927394568E+00;
+    x[8] = 13.1302824821757235640991204176E+00;
+    x[9] = 16.6544077083299578225202408430E+00;
+    x[10] = 20.7764788994487667729157175676E+00;
+    x[11] = 25.6238942267287801445868285977E+00;
+    x[12] = 31.4075191697539385152432196202E+00;
+    x[13] = 38.5306833064860094162515167595E+00;
+    x[14] = 48.0260855726857943465734308508E+00;
+  }
+  else if ( n == 16 )
+  {
+    x[0] = 0.0876494104789278403601980973401E+00;
+    x[1] = 0.462696328915080831880838260664E+00;
+    x[2] = 1.14105777483122685687794501811E+00;
+    x[3] = 2.12928364509838061632615907066E+00;
+    x[4] = 3.43708663389320664523510701675E+00;
+    x[5] = 5.07801861454976791292305830814E+00;
+    x[6] = 7.07033853504823413039598947080E+00;
+    x[7] = 9.43831433639193878394724672911E+00;
+    x[8] = 12.2142233688661587369391246088E+00;
+    x[9] = 15.4415273687816170767647741622E+00;
+    x[10] = 19.1801568567531348546631409497E+00;
+    x[11] = 23.5159056939919085318231872752E+00;
+    x[12] = 28.5787297428821403675206137099E+00;
+    x[13] = 34.5833987022866258145276871778E+00;
+    x[14] = 41.9404526476883326354722330252E+00;
+    x[15] = 51.7011603395433183643426971197E+00;
+  }
+  else if ( n == 17 )
+  {
+    x[0] = 0.0826382147089476690543986151980E+00;
+    x[1] = 0.436150323558710436375959029847E+00;
+    x[2] = 1.07517657751142857732980316755E+00;
+    x[3] = 2.00519353164923224070293371933E+00;
+    x[4] = 3.23425612404744376157380120696E+00;
+    x[5] = 4.77351351370019726480932076262E+00;
+    x[6] = 6.63782920536495266541643929703E+00;
+    x[7] = 8.84668551116980005369470571184E+00;
+    x[8] = 11.4255293193733525869726151469E+00;
+    x[9] = 14.4078230374813180021982874959E+00;
+    x[10] = 17.8382847307011409290658752412E+00;
+    x[11] = 21.7782682577222653261749080522E+00;
+    x[12] = 26.3153178112487997766149598369E+00;
+    x[13] = 31.5817716804567331343908517497E+00;
+    x[14] = 37.7960938374771007286092846663E+00;
+    x[15] = 45.3757165339889661829258363215E+00;
+    x[16] = 55.3897517898396106640900199790E+00;
+  }
+  else if ( n == 18 )
+  {
+    x[0] = 0.0781691666697054712986747615334E+00;
+    x[1] = 0.412490085259129291039101536536E+00;
+    x[2] = 1.01652017962353968919093686187E+00;
+    x[3] = 1.89488850996976091426727831954E+00;
+    x[4] = 3.05435311320265975115241130719E+00;
+    x[5] = 4.50420553888989282633795571455E+00;
+    x[6] = 6.25672507394911145274209116326E+00;
+    x[7] = 8.32782515660563002170470261564E+00;
+    x[8] = 10.7379900477576093352179033397E+00;
+    x[9] = 13.5136562075550898190863812108E+00;
+    x[10] = 16.6893062819301059378183984163E+00;
+    x[11] = 20.3107676262677428561313764553E+00;
+    x[12] = 24.4406813592837027656442257980E+00;
+    x[13] = 29.1682086625796161312980677805E+00;
+    x[14] = 34.6279270656601721454012429438E+00;
+    x[15] = 41.0418167728087581392948614284E+00;
+    x[16] = 48.8339227160865227486586093290E+00;
+    x[17] = 59.0905464359012507037157810181E+00;
+  }
+  else if ( n == 19 )
+  {
+    x[0] = 0.0741587837572050877131369916024E+00;
+    x[1] = 0.391268613319994607337648350299E+00;
+    x[2] = 0.963957343997958058624878377130E+00;
+    x[3] = 1.79617558206832812557725825252E+00;
+    x[4] = 2.89365138187378399116494713237E+00;
+    x[5] = 4.26421553962776647436040018167E+00;
+    x[6] = 5.91814156164404855815360191408E+00;
+    x[7] = 7.86861891533473373105668358176E+00;
+    x[8] = 10.1324237168152659251627415800E+00;
+    x[9] = 12.7308814638423980045092979656E+00;
+    x[10] = 15.6912783398358885454136069861E+00;
+    x[11] = 19.0489932098235501532136429732E+00;
+    x[12] = 22.8508497608294829323930586693E+00;
+    x[13] = 27.1606693274114488789963947149E+00;
+    x[14] = 32.0691222518622423224362865906E+00;
+    x[15] = 37.7129058012196494770647508283E+00;
+    x[16] = 44.3173627958314961196067736013E+00;
+    x[17] = 52.3129024574043831658644222420E+00;
+    x[18] = 62.8024231535003758413504690673E+00;
+  }
+  else if ( n == 20 )
+  {
+    x[0] = 0.0705398896919887533666890045842E+00;
+    x[1] = 0.372126818001611443794241388761E+00;
+    x[2] = 0.916582102483273564667716277074E+00;
+    x[3] = 1.70730653102834388068768966741E+00;
+    x[4] = 2.74919925530943212964503046049E+00;
+    x[5] = 4.04892531385088692237495336913E+00;
+    x[6] = 5.61517497086161651410453988565E+00;
+    x[7] = 7.45901745367106330976886021837E+00;
+    x[8] = 9.59439286958109677247367273428E+00;
+    x[9] = 12.0388025469643163096234092989E+00;
+    x[10] = 14.8142934426307399785126797100E+00;
+    x[11] = 17.9488955205193760173657909926E+00;
+    x[12] = 21.4787882402850109757351703696E+00;
+    x[13] = 25.4517027931869055035186774846E+00;
+    x[14] = 29.9325546317006120067136561352E+00;
+    x[15] = 35.0134342404790000062849359067E+00;
+    x[16] = 40.8330570567285710620295677078E+00;
+    x[17] = 47.6199940473465021399416271529E+00;
+    x[18] = 55.8107957500638988907507734445E+00;
+    x[19] = 66.5244165256157538186403187915E+00;
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "LAGUERRE_LOOKUP_POINTS - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::cerr << "  Legal values are 1 through 20.\n";
+    std::exit ( 1 );
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void laguerre_lookup_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LAGUERRE_LOOKUP_WEIGHTS looks up weights for Laguerre quadrature.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    27 April 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Milton Abramowitz, Irene Stegun,
+//    Handbook of Mathematical Functions,
+//    National Bureau of Standards, 1964,
+//    ISBN: 0-486-61272-4,
+//    LC: QA47.A34.
+//
+//    Vladimir Krylov,
+//    Approximate Calculation of Integrals,
+//    Dover, 2006,
+//    ISBN: 0486445798,
+//    LC: QA311.K713.
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//    Stephen Wolfram,
+//    The Mathematica Book,
+//    Fourth Edition,
+//    Cambridge University Press, 1999,
+//    ISBN: 0-521-64314-7,
+//    LC: QA76.95.W65.
+//
+//    Daniel Zwillinger, editor,
+//    CRC Standard Mathematical Tables and Formulae,
+//    30th Edition,
+//    CRC Press, 1996,
+//    ISBN: 0-8493-2479-3.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be between 1 and 20.
+//
+//    Output, double W[N], the weights.
+//
+{
+  if ( n == 1 )
+  {
+    w[0] =  1.00000000000000000000000000000E+00;
+  }
+  else if ( n == 2 )
+  {
+    w[0] = 0.85355339059327376220042218105E+00;
+    w[1] = 0.146446609406726237799577818948E+00;
+  }
+  else if ( n == 3 )
+  {
+    w[0] = 0.71109300992917301544959019114E+00;
+    w[1] = 0.27851773356924084880144488846E+00;
+    w[2] = 0.010389256501586135748964920401E+00;
+  }
+  else if ( n == 4 )
+  {
+    w[0] = 0.60315410434163360163596602382E+00;
+    w[1] = 0.35741869243779968664149201746E+00;
+    w[2] = 0.03888790851500538427243816816E+00;
+    w[3] = 0.0005392947055613274501037905676E+00;
+  }
+  else if ( n == 5 )
+  {
+    w[0] = 0.52175561058280865247586092879E+00;
+    w[1] = 0.3986668110831759274541333481E+00;
+    w[2] = 0.0759424496817075953876533114E+00;
+    w[3] = 0.00361175867992204845446126257E+00;
+    w[4] = 0.00002336997238577622789114908455E+00;
+  }
+  else if ( n == 6 )
+  {
+    w[0] = 0.45896467394996359356828487771E+00;
+    w[1] = 0.4170008307721209941133775662E+00;
+    w[2] = 0.1133733820740449757387061851E+00;
+    w[3] = 0.01039919745314907489891330285E+00;
+    w[4] = 0.000261017202814932059479242860E+00;
+    w[5] = 8.98547906429621238825292053E-07;
+  }
+  else if ( n == 7 )
+  {
+    w[0] = 0.40931895170127390213043288002E+00;
+    w[1] = 0.4218312778617197799292810054E+00;
+    w[2] = 0.1471263486575052783953741846E+00;
+    w[3] = 0.0206335144687169398657056150E+00;
+    w[4] = 0.00107401014328074552213195963E+00;
+    w[5] = 0.0000158654643485642012687326223E+00;
+    w[6] = 3.17031547899558056227132215E-08;
+  }
+  else if ( n == 8 )
+  {
+    w[0] = 0.36918858934163752992058283938E+00;
+    w[1] = 0.4187867808143429560769785813E+00;
+    w[2] = 0.175794986637171805699659867E+00;
+    w[3] = 0.033343492261215651522132535E+00;
+    w[4] = 0.0027945362352256725249389241E+00;
+    w[5] = 0.00009076508773358213104238501E+00;
+    w[6] = 8.4857467162725315448680183E-07;
+    w[7] = 1.04800117487151038161508854E-09;
+  }
+  else if ( n == 9 )
+  {
+    w[0] = 0.336126421797962519673467717606E+00;
+    w[1] = 0.411213980423984387309146942793E+00;
+    w[2] = 0.199287525370885580860575607212E+00;
+    w[3] = 0.0474605627656515992621163600479E+00;
+    w[4] = 0.00559962661079458317700419900556E+00;
+    w[5] = 0.000305249767093210566305412824291E+00;
+    w[6] = 6.59212302607535239225572284875E-06;
+    w[7] = 4.1107693303495484429024104033E-08;
+    w[8] = 3.29087403035070757646681380323E-11;
+  }
+  else if ( n == 10 )
+  {
+    w[0] = 0.30844111576502014154747083468E+00;
+    w[1] = 0.4011199291552735515157803099E+00;
+    w[2] = 0.218068287611809421588648523E+00;
+    w[3] = 0.062087456098677747392902129E+00;
+    w[4] = 0.009501516975181100553839072E+00;
+    w[5] = 0.0007530083885875387754559644E+00;
+    w[6] = 0.00002825923349599565567422564E+00;
+    w[7] = 4.249313984962686372586577E-07;
+    w[8] = 1.839564823979630780921535E-09;
+    w[9] = 9.911827219609008558377547E-13;
+  }
+  else if ( n == 11 )
+  {
+    w[0] = 0.28493321289420060505605102472E+00;
+    w[1] = 0.3897208895278493779375535080E+00;
+    w[2] = 0.232781831848991333940223796E+00;
+    w[3] = 0.076564453546196686400854179E+00;
+    w[4] = 0.014393282767350695091863919E+00;
+    w[5] = 0.001518880846484873069847776E+00;
+    w[6] = 0.0000851312243547192259720424E+00;
+    w[7] = 2.29240387957450407857683E-06;
+    w[8] = 2.48635370276779587373391E-08;
+    w[9] = 7.71262693369132047028153E-11;
+    w[10] = 2.883775868323623861597778E-14;
+  }
+  else if ( n == 12 )
+  {
+    w[0] = 0.26473137105544319034973889206E+00;
+    w[1] = 0.3777592758731379820244905567E+00;
+    w[2] = 0.244082011319877564254870818E+00;
+    w[3] = 0.09044922221168093072750549E+00;
+    w[4] = 0.02010238115463409652266129E+00;
+    w[5] = 0.002663973541865315881054158E+00;
+    w[6] = 0.000203231592662999392121433E+00;
+    w[7] = 8.3650558568197987453363E-06;
+    w[8] = 1.66849387654091026116990E-07;
+    w[9] = 1.34239103051500414552392E-09;
+    w[10] = 3.06160163503502078142408E-12;
+    w[11] = 8.148077467426241682473119E-16;
+  }
+  else if ( n == 13 )
+  {
+    w[0] = 0.24718870842996262134624918596E+00;
+    w[1] = 0.3656888229005219453067175309E+00;
+    w[2] = 0.252562420057658502356824289E+00;
+    w[3] = 0.10347075802418370511421863E+00;
+    w[4] = 0.02643275441556161577815877E+00;
+    w[5] = 0.00422039604025475276555209E+00;
+    w[6] = 0.000411881770472734774892473E+00;
+    w[7] = 0.0000235154739815532386882897E+00;
+    w[8] = 7.3173116202490991040105E-07;
+    w[9] = 1.10884162570398067979151E-08;
+    w[10] = 6.7708266922058988406462E-11;
+    w[11] = 1.15997995990507606094507E-13;
+    w[12] = 2.245093203892758415991872E-17;
+  }
+  else if ( n == 14 )
+  {
+    w[0] = 0.23181557714486497784077486110E+00;
+    w[1] = 0.3537846915975431518023313013E+00;
+    w[2] = 0.258734610245428085987320561E+00;
+    w[3] = 0.11548289355692321008730499E+00;
+    w[4] = 0.03319209215933736003874996E+00;
+    w[5] = 0.00619286943700661021678786E+00;
+    w[6] = 0.00073989037786738594242589E+00;
+    w[7] = 0.000054907194668416983785733E+00;
+    w[8] = 2.4095857640853774967578E-06;
+    w[9] = 5.801543981676495180886E-08;
+    w[10] = 6.819314692484974119616E-10;
+    w[11] = 3.2212077518948479398089E-12;
+    w[12] = 4.2213524405165873515980E-15;
+    w[13] = 6.05237502228918880839871E-19;
+  }
+  else if ( n == 15 )
+  {
+    w[0] = 0.21823488594008688985641323645E+00;
+    w[1] = 0.3422101779228833296389489568E+00;
+    w[2] = 0.263027577941680097414812275E+00;
+    w[3] = 0.12642581810593053584303055E+00;
+    w[4] = 0.04020686492100091484158548E+00;
+    w[5] = 0.00856387780361183836391576E+00;
+    w[6] = 0.00121243614721425207621921E+00;
+    w[7] = 0.00011167439234425194199258E+00;
+    w[8] = 6.459926762022900924653E-06;
+    w[9] = 2.226316907096272630332E-07;
+    w[10] = 4.227430384979365007351E-09;
+    w[11] = 3.921897267041089290385E-11;
+    w[12] = 1.4565152640731264063327E-13;
+    w[13] = 1.4830270511133013354616E-16;
+    w[14] = 1.60059490621113323104998E-20;
+  }
+  else if ( n == 16 )
+  {
+    w[0] = 0.20615171495780099433427363674E+00;
+    w[1] = 0.3310578549508841659929830987E+00;
+    w[2] = 0.265795777644214152599502021E+00;
+    w[3] = 0.13629693429637753997554751E+00;
+    w[4] = 0.0473289286941252189780623E+00;
+    w[5] = 0.0112999000803394532312490E+00;
+    w[6] = 0.0018490709435263108642918E+00;
+    w[7] = 0.00020427191530827846012602E+00;
+    w[8] = 0.00001484458687398129877135E+00;
+    w[9] = 6.828319330871199564396E-07;
+    w[10] = 1.881024841079673213882E-08;
+    w[11] = 2.862350242973881619631E-10;
+    w[12] = 2.127079033224102967390E-12;
+    w[13] = 6.297967002517867787174E-15;
+    w[14] = 5.050473700035512820402E-18;
+    w[15] = 4.1614623703728551904265E-22;
+  }
+  else if ( n == 17 )
+  {
+    w[0] = 0.19533220525177083214592729770E+00;
+    w[1] = 0.3203753572745402813366256320E+00;
+    w[2] = 0.267329726357171097238809604E+00;
+    w[3] = 0.14512985435875862540742645E+00;
+    w[4] = 0.0544369432453384577793806E+00;
+    w[5] = 0.0143572977660618672917767E+00;
+    w[6] = 0.0026628247355727725684324E+00;
+    w[7] = 0.0003436797271562999206118E+00;
+    w[8] = 0.00003027551783782870109437E+00;
+    w[9] = 1.768515053231676895381E-06;
+    w[10] = 6.57627288681043332199E-08;
+    w[11] = 1.469730932159546790344E-09;
+    w[12] = 1.81691036255544979555E-11;
+    w[13] = 1.095401388928687402976E-13;
+    w[14] = 2.617373882223370421551E-16;
+    w[15] = 1.6729356931461546908502E-19;
+    w[16] = 1.06562631627404278815253E-23;
+  }
+  else if ( n == 18 )
+  {
+    w[0] = 0.18558860314691880562333775228E+00;
+    w[1] = 0.3101817663702252936495975957E+00;
+    w[2] = 0.267866567148536354820854395E+00;
+    w[3] = 0.15297974746807490655384308E+00;
+    w[4] = 0.0614349178609616527076780E+00;
+    w[5] = 0.0176872130807729312772600E+00;
+    w[6] = 0.0036601797677599177980266E+00;
+    w[7] = 0.0005406227870077353231284E+00;
+    w[8] = 0.0000561696505121423113818E+00;
+    w[9] = 4.01530788370115755859E-06;
+    w[10] = 1.91466985667567497969E-07;
+    w[11] = 5.8360952686315941292E-09;
+    w[12] = 1.07171126695539012773E-10;
+    w[13] = 1.08909871388883385562E-12;
+    w[14] = 5.38666474837830887608E-15;
+    w[15] = 1.049865978035703408779E-17;
+    w[16] = 5.405398451631053643566E-21;
+    w[17] = 2.6916532692010286270838E-25;
+  }
+  else if ( n == 19 )
+  {
+    w[0] = 0.17676847491591250225103547981E+00;
+    w[1] = 0.3004781436072543794821568077E+00;
+    w[2] = 0.267599547038175030772695441E+00;
+    w[3] = 0.15991337213558021678551215E+00;
+    w[4] = 0.0682493799761491134552355E+00;
+    w[5] = 0.0212393076065443249244062E+00;
+    w[6] = 0.0048416273511483959672501E+00;
+    w[7] = 0.0008049127473813667665946E+00;
+    w[8] = 0.0000965247209315350170843E+00;
+    w[9] = 8.20730525805103054409E-06;
+    w[10] = 4.8305667247307725394E-07;
+    w[11] = 1.90499136112328569994E-08;
+    w[12] = 4.8166846309280615577E-10;
+    w[13] = 7.3482588395511443768E-12;
+    w[14] = 6.2022753875726163989E-14;
+    w[15] = 2.54143084301542272372E-16;
+    w[16] = 4.07886129682571235007E-19;
+    w[17] = 1.707750187593837061004E-22;
+    w[18] = 6.715064649908189959990E-27;
+  }
+  else if ( n == 20 )
+  {
+    w[0] = 0.168746801851113862149223899689E+00;
+    w[1] = 0.291254362006068281716795323812E+00;
+    w[2] = 0.266686102867001288549520868998E+00;
+    w[3] = 0.166002453269506840031469127816E+00;
+    w[4] = 0.0748260646687923705400624639615E+00;
+    w[5] = 0.0249644173092832210728227383234E+00;
+    w[6] = 0.00620255084457223684744754785395E+00;
+    w[7] = 0.00114496238647690824203955356969E+00;
+    w[8] = 0.000155741773027811974779809513214E+00;
+    w[9] = 0.0000154014408652249156893806714048E+00;
+    w[10] = 1.08648636651798235147970004439E-06;
+    w[11] = 5.33012090955671475092780244305E-08;
+    w[12] = 1.7579811790505820035778763784E-09;
+    w[13] = 3.72550240251232087262924585338E-11;
+    w[14] = 4.76752925157819052449488071613E-13;
+    w[15] = 3.37284424336243841236506064991E-15;
+    w[16] = 1.15501433950039883096396247181E-17;
+    w[17] = 1.53952214058234355346383319667E-20;
+    w[18] = 5.28644272556915782880273587683E-24;
+    w[19] = 1.65645661249902329590781908529E-28;
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "LAGUERRE_LOOKUP_WEIGHTS - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::cerr << "  Legal values are 1 through 20.\n";
+    std::exit ( 1 );
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void laguerre_ss_compute ( int order, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LAGUERRE_SS_COMPUTE computes a Laguerre quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( 0 <= X < +oo ) exp ( - X ) * F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+//
+//    The integral:
+//
+//        Integral ( A <= X < +oo ) F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= ORDER ) W(I) * exp ( X(I) ) * F ( X(I) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    23 April 2011
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    1 <= ORDER.
+//
+//    Output, double X[ORDER], the abscissas.
+//
+//    Output, double W[ORDER], the weights.
+//
+{
+  double *b;
+  double *c;
+  double cc;
+  double dp2;
+  int i;
+  int j;
+  double p1;
+  double prod;
+  double r1;
+  double x0;
+
+  if ( order < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "LAGUERRE_COMPUTE - Fatal error!\n";
+    std::cerr << "  Illegal value of ORDER = " << order << "\n";
+    std::exit ( 1 );
+  }
+
+  b = new double[order];
+  c = new double[order];
+//
+//  Set the recursion coefficients.
+//
+  for ( i = 0; i < order; i++ )
+  {
+    b[i] = ( double ) ( 2 * i + 1 );
+  }
+
+  for ( i = 0; i < order; i++ )
+  {
+    c[i] = ( double ) ( i * i );
+  }
+  prod = 1.0;
+  for ( i = 1; i < order; i++ )
+  {
+    prod = prod * c[i];
+  }
+  cc = prod;
+
+  for ( i = 0; i < order; i++ )
+  {
+//
+//  Compute an estimate for the root.
+//
+    if ( i == 0 )
+    {
+      x0 =  3.0 / ( 1.0 + 2.4 * ( double ) ( order ) );
+    }
+    else if ( i == 1 )
+    {
+      x0 = x0 + 15.0 / ( 1.0 + 2.5 * ( double ) ( order ) );
+    }
+    else
+    {
+      r1 = ( 1.0 + 2.55 * ( double ) ( i - 1 ) )
+        / ( 1.9 * ( double ) ( i - 1 ) );
+
+      x0 = x0 + r1 * ( x0 - x[i-2] );
+    }
+//
+//  Use iteration to find the root.
+//
+    webbur::laguerre_ss_root ( &x0, order, &dp2, &p1, b, c );
+//
+//  Set the abscissa and weight.
+//
+    x[i] = x0;
+//
+//  Because of the huge values involved, this calculation breaks down
+//  for ORDER = 127.
+//
+//  It was originally w[i] = ( cc / dp2 ) / p1, which breaks down sooner.
+//
+    w[i] = ( 1.0 / dp2 );
+    for ( j = 2; j <= order; j++ )
+    {
+      w[i] = w[i] * ( double ) ( j - 1 );
+    }
+    w[i] = w[i] / p1;
+    for ( j = 2; j <= order; j++ )
+    {
+      w[i] = w[i] * ( double ) ( j - 1 );
+    }
+
+//  w[i] = ( cc / dp2 ) / p1;
+  }
+
+  delete [] b;
+  delete [] c;
+
+  return;
+}
+//****************************************************************************80
+
+void laguerre_ss_recur ( double *p2, double *dp2, double *p1, double x,
+  int order, double b[], double c[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LAGUERRE_SS_RECUR evaluates a Laguerre polynomial.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    23 April 2011
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Output, double *P2, the value of L(ORDER)(X).
+//
+//    Output, double *DP2, the value of L'(ORDER)(X).
+//
+//    Output, double *P1, the value of L(ORDER-1)(X).
+//
+//    Input, double X, the point at which polynomials are evaluated.
+//
+//    Input, int ORDER, the order of the polynomial.
+//
+//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
+//
+{
+  double dp0;
+  double dp1;
+  int i;
+  double p0;
+
+  *p1 = 1.0;
+  dp1 = 0.0;
+
+  *p2 = x - 1.0;
+  *dp2 = 1.0;
+
+  for ( i = 1; i < order; i++ )
+  {
+    p0 = *p1;
+    dp0 = dp1;
+
+    *p1 = *p2;
+    dp1 = *dp2;
+
+    *p2  = ( x - b[i] ) * ( *p1 ) - c[i] * p0;
+    *dp2 = ( x - b[i] ) * dp1 + ( *p1 ) - c[i] * dp0;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void laguerre_ss_root ( double *x, int order, double *dp2, double *p1,
+  double b[], double c[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LAGUERRE_SS_ROOT improves a root of a Laguerre polynomial.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    23 April 2011
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input/output, double *X, the approximate root, which
+//    should be improved on output.
+//
+//    Input, int ORDER, the order of the polynomial.
+//
+//    Output, double *DP2, the value of L'(ORDER)(X).
+//
+//    Output, double *P1, the value of L(ORDER-1)(X).
+//
+//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
+//
+{
+  double d;
+  double eps;
+  double p2;
+  int step;
+  int step_max = 10;
+
+  eps = webbur::r8_epsilon ( );
+
+  for ( step = 1; step <= step_max; step++ )
+  {
+    webbur::laguerre_ss_recur ( &p2, dp2, p1, *x, order, b, c );
+
+    d = p2 / ( *dp2 );
+    *x = *x - d;
+
+    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
+    {
+      break;
+    }
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void legendre_compute ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEGENDRE_COMPUTE: Legendre quadrature rule by the Elhay-Kautsky method.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 April 2011
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Sylvan Elhay, Jaroslav Kautsky,
+//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
+//    Interpolatory Quadrature,
+//    ACM Transactions on Mathematical Software,
+//    Volume 13, Number 4, December 1987, pages 399-415.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double *bj;
+  int i;
+  double zemu;
+//
+//  Define the zero-th moment.
+//
+  zemu = 2.0;
+//
+//  Define the Jacobi matrix.
+//
+  bj = new double[n];
+
+  for ( i = 0; i < n; i++ )
+  {
+    bj[i] = ( double ) ( ( i + 1 ) * ( i + 1 ) )
+          / ( double ) ( 4 * ( i + 1 ) * ( i + 1 ) - 1 );
+    bj[i] = std::sqrt ( bj[i] );
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    x[i] = 0.0;
+  }
+
+  w[0] = std::sqrt ( zemu );
+
+  for ( i = 1; i < n; i++ )
+  {
+    w[i] = 0.0;
+  }
+//
+//  Diagonalize the Jacobi matrix.
+//
+  webbur::imtqlx ( n, x, bj, w );
+
+  for ( i = 0; i < n; i++ )
+  {
+    w[i] = w[i] * w[i];
+  }
+
+  delete [] bj;
+
+  return;
+}
+//****************************************************************************80
+
+void legendre_compute_np ( int n, int np, double p[], double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEGENDRE_COMPUTE_NP computes a Legendre quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( -1 <= X <= 1 ) F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Philip Davis, Philip Rabinowitz.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::legendre_compute ( n, x, w );
+
+  return;
+}
+//****************************************************************************80
+
+void legendre_compute_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEGENDRE_COMPUTE_POINTS computes Legendre quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  double *w;
+
+  w= new double[n];
+
+  webbur::legendre_compute ( n, x, w );
+
+  delete [] w;
+
+  return;
+}
+//****************************************************************************80
+
+void legendre_compute_points_np ( int n, int np, double p[], double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEGENDRE_COMPUTE_POINTS_NP computes Legendre quadrature points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  webbur::legendre_compute_points ( n, x );
+
+  return;
+}
+//****************************************************************************80
+
+void legendre_compute_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEGENDRE_COMPUTE_WEIGHTS computes Legendre quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double *x;
+
+  x = new double[n];
+
+  webbur::legendre_compute ( n, x, w );
+
+  delete [] x;
+
+  return;
+}
+//****************************************************************************80
+
+void legendre_compute_weights_np ( int n, int np, double p[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEGENDRE_COMPUTE_WEIGHTS_NP computes Legendre quadrature weights.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double W[N], the weights.
+//
+{
+  webbur::legendre_compute_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+void legendre_dr_compute ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEGENDRE_DR_COMPUTE computes a Legendre quadrature rule.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      Integral ( -1 <= X <= 1 ) F(X) dX
+//
+//    The quadrature rule:
+//
+//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 June 2009
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Philip Davis, Philip Rabinowitz.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    1 <= N.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double d1;
+  double d2pn;
+  double d3pn;
+  double d4pn;
+  double dp;
+  double dpn;
+  double e1;
+  double fx;
+  double h;
+  int i;
+  int iback;
+  int k;
+  int m;
+  int mp1mi;
+  int ncopy;
+  int nmove;
+  double p;
+  double pi = 3.141592653589793;
+  double pk;
+  double pkm1;
+  double pkp1;
+  double t;
+  double u;
+  double v;
+  double x0;
+  double xtemp;
+
+  if ( n < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "LEGENDRE_DR_COMPUTE - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::exit ( 1 );
+  }
+
+  e1 = ( double ) ( n * ( n + 1 ) );
+
+  m = ( n + 1 ) / 2;
+
+  for ( i = 1; i <= m; i++ )
+  {
+    mp1mi = m + 1 - i;
+
+    t = ( double ) ( 4 * i - 1 ) * pi / ( double ) ( 4 * n + 2 );
+
+    x0 =  std::cos ( t ) * ( 1.0 - ( 1.0 - 1.0 / ( double ) ( n ) )
+      / ( double ) ( 8 * n * n ) );
+
+    pkm1 = 1.0;
+    pk = x0;
+
+    for ( k = 2; k <= n; k++ )
+    {
+      pkp1 = 2.0 * x0 * pk - pkm1 - ( x0 * pk - pkm1 ) / ( double ) ( k );
+      pkm1 = pk;
+      pk = pkp1;
+    }
+
+    d1 = ( double ) ( n ) * ( pkm1 - x0 * pk );
+
+    dpn = d1 / ( 1.0 - x0 * x0 );
+
+    d2pn = ( 2.0 * x0 * dpn - e1 * pk ) / ( 1.0 - x0 * x0 );
+
+    d3pn = ( 4.0 * x0 * d2pn + ( 2.0 - e1 ) * dpn ) / ( 1.0 - x0 * x0 );
+
+    d4pn = ( 6.0 * x0 * d3pn + ( 6.0 - e1 ) * d2pn ) / ( 1.0 - x0 * x0 );
+
+    u = pk / dpn;
+    v = d2pn / dpn;
+//
+//  Initial approximation H:
+//
+    h = -u * ( 1.0 + 0.5 * u * ( v + u * ( v * v - d3pn / ( 3.0 * dpn ) ) ) );
+//
+//  Refine H using one step of Newton's method:
+//
+    p = pk + h * ( dpn + 0.5 * h * ( d2pn + h / 3.0
+      * ( d3pn + 0.25 * h * d4pn ) ) );
+
+    dp = dpn + h * ( d2pn + 0.5 * h * ( d3pn + h * d4pn / 3.0 ) );
+
+    h = h - p / dp;
+
+    xtemp = x0 + h;
+
+    x[mp1mi-1] = xtemp;
+
+    fx = d1 - h * e1 * ( pk + 0.5 * h * ( dpn + h / 3.0
+      * ( d2pn + 0.25 * h * ( d3pn + 0.2 * h * d4pn ) ) ) );
+
+    w[mp1mi-1] = 2.0 * ( 1.0 - xtemp * xtemp ) / ( fx * fx );
+  }
+
+  if ( ( n % 2 ) == 1 )
+  {
+    x[0] = 0.0;
+  }
+//
+//  Shift the data up.
+//
+  nmove = ( n + 1 ) / 2;
+  ncopy = n - nmove;
+
+  for ( i = 1; i <= nmove; i++ )
+  {
+    iback = n + 1 - i;
+    x[iback-1] = x[iback-ncopy-1];
+    w[iback-1] = w[iback-ncopy-1];
+  }
+//
+//  Reflect values for the negative abscissas.
+//
+  for ( i = 1; i <= n - nmove; i++ )
+  {
+    x[i-1] = - x[n-i];
+    w[i-1] = w[n-i];
+  }
+
+  return;
+}
+//****************************************************************************80
+
+double legendre_integral ( int expon )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEGENDRE_INTEGRAL evaluates a monomial Legendre integral.
+//
+//  Discussion:
+//
+//    The integral:
+//
+//      integral ( -1 <= x <= +1 ) x^n dx
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int EXPON, the exponent.
+//
+//    Output, double LEGENDRE_INTEGRAL, the value of the exact integral.
+//
+{
+  double exact;
+//
+//  Get the exact value of the integral.
+//
+  if ( ( expon % 2 ) == 0 )
+  {
+    exact = 2.0 / ( double ) ( expon + 1 );
+  }
+  else
+  {
+    exact = 0.0;
+  }
+
+  return exact;
+}
+//****************************************************************************80
+
+void legendre_lookup ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEGENDRE_LOOKUP looks up abscissas and weights for Gauss-Legendre quadrature.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    27 April 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Milton Abramowitz, Irene Stegun,
+//    Handbook of Mathematical Functions,
+//    National Bureau of Standards, 1964,
+//    ISBN: 0-486-61272-4,
+//    LC: QA47.A34.
+//
+//    Vladimir Krylov,
+//    Approximate Calculation of Integrals,
+//    Dover, 2006,
+//    ISBN: 0486445798.
+//    LC: QA311.K713.
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//    Stephen Wolfram,
+//    The Mathematica Book,
+//    Fourth Edition,
+//    Cambridge University Press, 1999,
+//    ISBN: 0-521-64314-7,
+//    LC: QA76.95.W65.
+//
+//    Daniel Zwillinger, editor,
+//    CRC Standard Mathematical Tables and Formulae,
+//    30th Edition,
+//    CRC Press, 1996,
+//    ISBN: 0-8493-2479-3,
+//    LC: QA47.M315.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be between 1 and 33.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the abscissas.
+//
+{
+  webbur::legendre_lookup_points ( n, x );
+
+  webbur::legendre_lookup_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+void legendre_lookup_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEGENDRE_LOOKUP_POINTS looks up abscissas for Gauss-Legendre quadrature.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    27 April 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Milton Abramowitz, Irene Stegun,
+//    Handbook of Mathematical Functions,
+//    National Bureau of Standards, 1964,
+//    ISBN: 0-486-61272-4,
+//    LC: QA47.A34.
+//
+//    Vladimir Krylov,
+//    Approximate Calculation of Integrals,
+//    Dover, 2006,
+//    ISBN: 0486445798.
+//    LC: QA311.K713.
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//    Stephen Wolfram,
+//    The Mathematica Book,
+//    Fourth Edition,
+//    Cambridge University Press, 1999,
+//    ISBN: 0-521-64314-7,
+//    LC: QA76.95.W65.
+//
+//    Daniel Zwillinger, editor,
+//    CRC Standard Mathematical Tables and Formulae,
+//    30th Edition,
+//    CRC Press, 1996,
+//    ISBN: 0-8493-2479-3,
+//    LC: QA47.M315.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be between 1 and 33.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  if ( n == 1 )
+  {
+    x[0] = 0.000000000000000000000000000000;
+  }
+  else if ( n == 2 )
+  {
+    x[0] = -0.577350269189625764509148780502;
+    x[1] = 0.577350269189625764509148780502;
+  }
+  else if ( n == 3 )
+  {
+    x[0] = -0.774596669241483377035853079956;
+    x[1] = 0.000000000000000000000000000000;
+    x[2] = 0.774596669241483377035853079956;
+  }
+  else if ( n == 4 )
+  {
+    x[0] = -0.861136311594052575223946488893;
+    x[1] = -0.339981043584856264802665759103;
+    x[2] = 0.339981043584856264802665759103;
+    x[3] = 0.861136311594052575223946488893;
+  }
+  else if ( n == 5 )
+  {
+    x[0] = -0.906179845938663992797626878299;
+    x[1] = -0.538469310105683091036314420700;
+    x[2] = 0.000000000000000000000000000000;
+    x[3] = 0.538469310105683091036314420700;
+    x[4] = 0.906179845938663992797626878299;
+  }
+  else if ( n == 6 )
+  {
+    x[0] = -0.932469514203152027812301554494;
+    x[1] = -0.661209386466264513661399595020;
+    x[2] = -0.238619186083196908630501721681;
+    x[3] = 0.238619186083196908630501721681;
+    x[4] = 0.661209386466264513661399595020;
+    x[5] = 0.932469514203152027812301554494;
+  }
+  else if ( n == 7 )
+  {
+    x[0] = -0.949107912342758524526189684048;
+    x[1] = -0.741531185599394439863864773281;
+    x[2] = -0.405845151377397166906606412077;
+    x[3] = 0.000000000000000000000000000000;
+    x[4] = 0.405845151377397166906606412077;
+    x[5] = 0.741531185599394439863864773281;
+    x[6] = 0.949107912342758524526189684048;
+  }
+  else if ( n == 8 )
+  {
+    x[0] = -0.960289856497536231683560868569;
+    x[1] = -0.796666477413626739591553936476;
+    x[2] = -0.525532409916328985817739049189;
+    x[3] = -0.183434642495649804939476142360;
+    x[4] = 0.183434642495649804939476142360;
+    x[5] = 0.525532409916328985817739049189;
+    x[6] = 0.796666477413626739591553936476;
+    x[7] = 0.960289856497536231683560868569;
+  }
+  else if ( n == 9 )
+  {
+    x[0] = -0.968160239507626089835576203;
+    x[1] = -0.836031107326635794299429788;
+    x[2] = -0.613371432700590397308702039;
+    x[3] = -0.324253423403808929038538015;
+    x[4] = 0.000000000000000000000000000;
+    x[5] = 0.324253423403808929038538015;
+    x[6] = 0.613371432700590397308702039;
+    x[7] = 0.836031107326635794299429788;
+    x[8] = 0.968160239507626089835576203;
+  }
+  else if ( n == 10 )
+  {
+    x[0] = -0.973906528517171720077964012;
+    x[1] = -0.865063366688984510732096688;
+    x[2] = -0.679409568299024406234327365;
+    x[3] = -0.433395394129247190799265943;
+    x[4] = -0.148874338981631210884826001;
+    x[5] = 0.148874338981631210884826001;
+    x[6] = 0.433395394129247190799265943;
+    x[7] = 0.679409568299024406234327365;
+    x[8] = 0.865063366688984510732096688;
+    x[9] = 0.973906528517171720077964012;
+  }
+  else if ( n == 11 )
+  {
+    x[0] = -0.978228658146056992803938001;
+    x[1] = -0.887062599768095299075157769;
+    x[2] = -0.730152005574049324093416252;
+    x[3] = -0.519096129206811815925725669;
+    x[4] = -0.269543155952344972331531985;
+    x[5] = 0.000000000000000000000000000;
+    x[6] = 0.269543155952344972331531985;
+    x[7] = 0.519096129206811815925725669;
+    x[8] = 0.730152005574049324093416252;
+    x[9] = 0.887062599768095299075157769;
+    x[10] = 0.978228658146056992803938001;
+  }
+  else if ( n == 12 )
+  {
+    x[0] = -0.981560634246719250690549090;
+    x[1] = -0.904117256370474856678465866;
+    x[2] = -0.769902674194304687036893833;
+    x[3] = -0.587317954286617447296702419;
+    x[4] = -0.367831498998180193752691537;
+    x[5] = -0.125233408511468915472441369;
+    x[6] = 0.125233408511468915472441369;
+    x[7] = 0.367831498998180193752691537;
+    x[8] = 0.587317954286617447296702419;
+    x[9] = 0.769902674194304687036893833;
+    x[10] = 0.904117256370474856678465866;
+    x[11] = 0.981560634246719250690549090;
+  }
+  else if ( n == 13 )
+  {
+    x[0] = -0.984183054718588149472829449;
+    x[1] = -0.917598399222977965206547837;
+    x[2] = -0.801578090733309912794206490;
+    x[3] = -0.642349339440340220643984607;
+    x[4] = -0.448492751036446852877912852;
+    x[5] = -0.230458315955134794065528121;
+    x[6] = 0.000000000000000000000000000;
+    x[7] = 0.230458315955134794065528121;
+    x[8] = 0.448492751036446852877912852;
+    x[9] = 0.642349339440340220643984607;
+    x[10] = 0.80157809073330991279420649;
+    x[11] = 0.91759839922297796520654784;
+    x[12] = 0.98418305471858814947282945;
+  }
+  else if ( n == 14 )
+  {
+    x[0] = -0.986283808696812338841597267;
+    x[1] = -0.928434883663573517336391139;
+    x[2] = -0.827201315069764993189794743;
+    x[3] = -0.687292904811685470148019803;
+    x[4] = -0.515248636358154091965290719;
+    x[5] = -0.319112368927889760435671824;
+    x[6] = -0.108054948707343662066244650;
+    x[7] = 0.108054948707343662066244650;
+    x[8] = 0.31911236892788976043567182;
+    x[9] = 0.51524863635815409196529072;
+    x[10] = 0.68729290481168547014801980;
+    x[11] = 0.82720131506976499318979474;
+    x[12] = 0.92843488366357351733639114;
+    x[13] = 0.98628380869681233884159727;
+  }
+  else if ( n == 15 )
+  {
+    x[0] = -0.987992518020485428489565719;
+    x[1] = -0.937273392400705904307758948;
+    x[2] = -0.848206583410427216200648321;
+    x[3] = -0.724417731360170047416186055;
+    x[4] = -0.570972172608538847537226737;
+    x[5] = -0.394151347077563369897207371;
+    x[6] = -0.201194093997434522300628303;
+    x[7] = 0.00000000000000000000000000;
+    x[8] = 0.20119409399743452230062830;
+    x[9] = 0.39415134707756336989720737;
+    x[10] = 0.57097217260853884753722674;
+    x[11] = 0.72441773136017004741618605;
+    x[12] = 0.84820658341042721620064832;
+    x[13] = 0.93727339240070590430775895;
+    x[14] = 0.98799251802048542848956572;
+  }
+  else if ( n == 16 )
+  {
+    x[0] = -0.989400934991649932596154173;
+    x[1] = -0.944575023073232576077988416;
+    x[2] = -0.865631202387831743880467898;
+    x[3] = -0.755404408355003033895101195;
+    x[4] = -0.617876244402643748446671764;
+    x[5] = -0.458016777657227386342419443;
+    x[6] = -0.281603550779258913230460501;
+    x[7] = -0.09501250983763744018531934;
+    x[8] = 0.09501250983763744018531934;
+    x[9] = 0.28160355077925891323046050;
+    x[10] = 0.45801677765722738634241944;
+    x[11] = 0.61787624440264374844667176;
+    x[12] = 0.75540440835500303389510119;
+    x[13] = 0.86563120238783174388046790;
+    x[14] = 0.94457502307323257607798842;
+    x[15] = 0.98940093499164993259615417;
+  }
+  else if ( n == 17 )
+  {
+    x[0] = -0.990575475314417335675434020;
+    x[1] = -0.950675521768767761222716958;
+    x[2] = -0.880239153726985902122955694;
+    x[3] = -0.781514003896801406925230056;
+    x[4] = -0.657671159216690765850302217;
+    x[5] = -0.512690537086476967886246569;
+    x[6] = -0.35123176345387631529718552;
+    x[7] = -0.17848418149584785585067749;
+    x[8] = 0.00000000000000000000000000;
+    x[9] = 0.17848418149584785585067749;
+    x[10] = 0.35123176345387631529718552;
+    x[11] = 0.51269053708647696788624657;
+    x[12] = 0.65767115921669076585030222;
+    x[13] = 0.78151400389680140692523006;
+    x[14] = 0.88023915372698590212295569;
+    x[15] = 0.95067552176876776122271696;
+    x[16] = 0.99057547531441733567543402;
+  }
+  else if ( n == 18 )
+  {
+    x[0] = -0.991565168420930946730016005;
+    x[1] = -0.955823949571397755181195893;
+    x[2] = -0.892602466497555739206060591;
+    x[3] = -0.803704958972523115682417455;
+    x[4] = -0.691687043060353207874891081;
+    x[5] = -0.55977083107394753460787155;
+    x[6] = -0.41175116146284264603593179;
+    x[7] = -0.25188622569150550958897285;
+    x[8] = -0.08477501304173530124226185;
+    x[9] = 0.08477501304173530124226185;
+    x[10] = 0.25188622569150550958897285;
+    x[11] = 0.41175116146284264603593179;
+    x[12] = 0.55977083107394753460787155;
+    x[13] = 0.69168704306035320787489108;
+    x[14] = 0.80370495897252311568241746;
+    x[15] = 0.89260246649755573920606059;
+    x[16] = 0.95582394957139775518119589;
+    x[17] = 0.99156516842093094673001600;
+  }
+  else if ( n == 19 )
+  {
+    x[0] = -0.992406843843584403189017670;
+    x[1] = -0.960208152134830030852778841;
+    x[2] = -0.903155903614817901642660929;
+    x[3] = -0.822714656537142824978922487;
+    x[4] = -0.72096617733522937861709586;
+    x[5] = -0.60054530466168102346963816;
+    x[6] = -0.46457074137596094571726715;
+    x[7] = -0.31656409996362983199011733;
+    x[8] = -0.16035864564022537586809612;
+    x[9] = 0.00000000000000000000000000;
+    x[10] = 0.16035864564022537586809612;
+    x[11] = 0.31656409996362983199011733;
+    x[12] = 0.46457074137596094571726715;
+    x[13] = 0.60054530466168102346963816;
+    x[14] = 0.72096617733522937861709586;
+    x[15] = 0.82271465653714282497892249;
+    x[16] = 0.90315590361481790164266093;
+    x[17] = 0.96020815213483003085277884;
+    x[18] = 0.99240684384358440318901767;
+  }
+  else if ( n == 20 )
+  {
+    x[0] = -0.993128599185094924786122388;
+    x[1] = -0.963971927277913791267666131;
+    x[2] = -0.912234428251325905867752441;
+    x[3] = -0.83911697182221882339452906;
+    x[4] = -0.74633190646015079261430507;
+    x[5] = -0.63605368072651502545283670;
+    x[6] = -0.51086700195082709800436405;
+    x[7] = -0.37370608871541956067254818;
+    x[8] = -0.22778585114164507808049620;
+    x[9] = -0.07652652113349733375464041;
+    x[10] = 0.07652652113349733375464041;
+    x[11] = 0.22778585114164507808049620;
+    x[12] = 0.37370608871541956067254818;
+    x[13] = 0.51086700195082709800436405;
+    x[14] = 0.63605368072651502545283670;
+    x[15] = 0.74633190646015079261430507;
+    x[16] = 0.83911697182221882339452906;
+    x[17] = 0.91223442825132590586775244;
+    x[18] = 0.96397192727791379126766613;
+    x[19] = 0.99312859918509492478612239;
+  }
+  else if ( n == 21 )
+  {
+    x[ 0] =  -0.99375217062038950026024204;
+    x[ 1] =  -0.96722683856630629431662221;
+    x[ 2] =  -0.92009933415040082879018713;
+    x[ 3] =  -0.85336336458331728364725064;
+    x[ 4] =  -0.76843996347567790861587785;
+    x[ 5] =  -0.66713880419741231930596667;
+    x[ 6] =  -0.55161883588721980705901880;
+    x[ 7] =  -0.42434212020743878357366889;
+    x[ 8] =  -0.28802131680240109660079252;
+    x[9] =  -0.14556185416089509093703098;
+    x[10] =   0.00000000000000000000000000;
+    x[11] =  +0.14556185416089509093703098;
+    x[12] =  +0.28802131680240109660079252;
+    x[13] =  +0.42434212020743878357366889;
+    x[14] =  +0.55161883588721980705901880;
+    x[15] =  +0.66713880419741231930596667;
+    x[16] =  +0.76843996347567790861587785;
+    x[17] =  +0.85336336458331728364725064;
+    x[18] =  +0.92009933415040082879018713;
+    x[19] =  +0.96722683856630629431662221;
+    x[20] =  +0.99375217062038950026024204;
+  }
+  else if ( n == 22 )
+  {
+    x[0] = -0.99429458548239929207303142;
+    x[1] = -0.97006049783542872712395099;
+    x[2] = -0.92695677218717400052069294;
+    x[3] = -0.86581257772030013653642564;
+    x[4] = -0.78781680597920816200427796;
+    x[5] = -0.69448726318668278005068984;
+    x[6] = -0.58764040350691159295887693;
+    x[7] = -0.46935583798675702640633071;
+    x[8] = -0.34193582089208422515814742;
+    x[9] = -0.20786042668822128547884653;
+    x[10] = -0.06973927331972222121384180;
+    x[11] = 0.06973927331972222121384180;
+    x[12] = 0.20786042668822128547884653;
+    x[13] = 0.34193582089208422515814742;
+    x[14] = 0.46935583798675702640633071;
+    x[15] = 0.58764040350691159295887693;
+    x[16] = 0.69448726318668278005068984;
+    x[17] = 0.78781680597920816200427796;
+    x[18] = 0.86581257772030013653642564;
+    x[19] = 0.92695677218717400052069294;
+    x[20] = 0.97006049783542872712395099;
+    x[21] = 0.99429458548239929207303142;
+  }
+  else if ( n == 23 )
+  {
+    x[0] = -0.99476933499755212352392572;
+    x[1] = -0.97254247121811523195602408;
+    x[2] = -0.93297108682601610234919699;
+    x[3] = -0.87675235827044166737815689;
+    x[4] = -0.80488840161883989215111841;
+    x[5] = -0.71866136313195019446162448;
+    x[6] = -0.61960987576364615638509731;
+    x[7] = -0.50950147784600754968979305;
+    x[8] = -0.39030103803029083142148887;
+    x[9] = -0.26413568097034493053386954;
+    x[10] = -0.13325682429846611093174268;
+    x[11] = 0.00000000000000000000000000;
+    x[12] = 0.13325682429846611093174268;
+    x[13] = 0.26413568097034493053386954;
+    x[14] = 0.39030103803029083142148887;
+    x[15] = 0.50950147784600754968979305;
+    x[16] = 0.61960987576364615638509731;
+    x[17] = 0.71866136313195019446162448;
+    x[18] = 0.80488840161883989215111841;
+    x[19] = 0.87675235827044166737815689;
+    x[20] = 0.93297108682601610234919699;
+    x[21] = 0.97254247121811523195602408;
+    x[22] = 0.99476933499755212352392572;
+  }
+  else if ( n == 24 )
+  {
+    x[0] = -0.99518721999702136017999741;
+    x[1] = -0.97472855597130949819839199;
+    x[2] = -0.93827455200273275852364900;
+    x[3] = -0.88641552700440103421315434;
+    x[4] = -0.82000198597390292195394987;
+    x[5] = -0.74012419157855436424382810;
+    x[6] = -0.64809365193697556925249579;
+    x[7] = -0.54542147138883953565837562;
+    x[8] = -0.43379350762604513848708423;
+    x[9] = -0.31504267969616337438679329;
+    x[10] = -0.19111886747361630915863982;
+    x[11] = -0.06405689286260562608504308;
+    x[12] = 0.06405689286260562608504308;
+    x[13] = 0.19111886747361630915863982;
+    x[14] = 0.31504267969616337438679329;
+    x[15] = 0.43379350762604513848708423;
+    x[16] = 0.54542147138883953565837562;
+    x[17] = 0.64809365193697556925249579;
+    x[18] = 0.74012419157855436424382810;
+    x[19] = 0.82000198597390292195394987;
+    x[20] = 0.88641552700440103421315434;
+    x[21] = 0.93827455200273275852364900;
+    x[22] = 0.97472855597130949819839199;
+    x[23] = 0.99518721999702136017999741;
+  }
+  else if ( n == 25 )
+  {
+    x[0] = -0.99555696979049809790878495;
+    x[1] = -0.97666392145951751149831539;
+    x[2] = -0.94297457122897433941401117;
+    x[3] = -0.89499199787827536885104201;
+    x[4] = -0.83344262876083400142102111;
+    x[5] = -0.75925926303735763057728287;
+    x[6] = -0.67356636847346836448512063;
+    x[7] = -0.57766293024122296772368984;
+    x[8] = -0.47300273144571496052218212;
+    x[9] = -0.36117230580938783773582173;
+    x[10] = -0.24386688372098843204519036;
+    x[11] = -0.12286469261071039638735982;
+    x[12] = 0.00000000000000000000000000;
+    x[13] = 0.12286469261071039638735982;
+    x[14] = 0.24386688372098843204519036;
+    x[15] = 0.36117230580938783773582173;
+    x[16] = 0.47300273144571496052218212;
+    x[17] = 0.57766293024122296772368984;
+    x[18] = 0.67356636847346836448512063;
+    x[19] = 0.75925926303735763057728287;
+    x[20] = 0.83344262876083400142102111;
+    x[21] = 0.89499199787827536885104201;
+    x[22] = 0.94297457122897433941401117;
+    x[23] = 0.97666392145951751149831539;
+    x[24] = 0.99555696979049809790878495;
+  }
+  else if ( n == 26 )
+  {
+    x[0] = -0.99588570114561692900321696;
+    x[1] = -0.97838544595647099110058035;
+    x[2] = -0.94715906666171425013591528;
+    x[3] = -0.90263786198430707421766560;
+    x[4] = -0.84544594278849801879750706;
+    x[5] = -0.77638594882067885619296725;
+    x[6] = -0.69642726041995726486381391;
+    x[7] = -0.60669229301761806323197875;
+    x[8] = -0.50844071482450571769570306;
+    x[9] = -0.40305175512348630648107738;
+    x[10] = -0.29200483948595689514283538;
+    x[11] = -0.17685882035689018396905775;
+    x[12] = -0.05923009342931320709371858;
+    x[13] = 0.05923009342931320709371858;
+    x[14] = 0.17685882035689018396905775;
+    x[15] = 0.29200483948595689514283538;
+    x[16] = 0.40305175512348630648107738;
+    x[17] = 0.50844071482450571769570306;
+    x[18] = 0.60669229301761806323197875;
+    x[19] = 0.69642726041995726486381391;
+    x[20] = 0.77638594882067885619296725;
+    x[21] = 0.84544594278849801879750706;
+    x[22] = 0.90263786198430707421766560;
+    x[23] = 0.94715906666171425013591528;
+    x[24] = 0.97838544595647099110058035;
+    x[25] = 0.99588570114561692900321696;
+  }
+  else if ( n == 27 )
+  {
+    x[0] = -0.99617926288898856693888721;
+    x[1] = -0.97992347596150122285587336;
+    x[2] = -0.95090055781470500685190803;
+    x[3] = -0.90948232067749110430064502;
+    x[4] = -0.85620790801829449030273722;
+    x[5] = -0.79177163907050822714439734;
+    x[6] = -0.71701347373942369929481621;
+    x[7] = -0.63290797194649514092773464;
+    x[8] = -0.54055156457945689490030094;
+    x[9] = -0.44114825175002688058597416;
+    x[10] = -0.33599390363850889973031903;
+    x[11] = -0.22645936543953685885723911;
+    x[12] = -0.11397258560952996693289498;
+    x[13] = 0.00000000000000000000000000;
+    x[14] = 0.11397258560952996693289498;
+    x[15] = 0.22645936543953685885723911;
+    x[16] = 0.33599390363850889973031903;
+    x[17] = 0.44114825175002688058597416;
+    x[18] = 0.54055156457945689490030094;
+    x[19] = 0.63290797194649514092773464;
+    x[20] = 0.71701347373942369929481621;
+    x[21] = 0.79177163907050822714439734;
+    x[22] = 0.85620790801829449030273722;
+    x[23] = 0.90948232067749110430064502;
+    x[24] = 0.95090055781470500685190803;
+    x[25] = 0.97992347596150122285587336;
+    x[26] = 0.99617926288898856693888721;
+  }
+  else if ( n == 28 )
+  {
+    x[0] = -0.99644249757395444995043639;
+    x[1] = -0.98130316537087275369455995;
+    x[2] = -0.95425928062893819725410184;
+    x[3] = -0.91563302639213207386968942;
+    x[4] = -0.86589252257439504894225457;
+    x[5] = -0.80564137091717917144788596;
+    x[6] = -0.73561087801363177202814451;
+    x[7] = -0.65665109403886496121989818;
+    x[8] = -0.56972047181140171930800328;
+    x[9] = -0.47587422495511826103441185;
+    x[10] = -0.37625151608907871022135721;
+    x[11] = -0.27206162763517807767682636;
+    x[12] = -0.16456928213338077128147178;
+    x[13] = -0.05507928988403427042651653;
+    x[14] = 0.05507928988403427042651653;
+    x[15] = 0.16456928213338077128147178;
+    x[16] = 0.27206162763517807767682636;
+    x[17] = 0.37625151608907871022135721;
+    x[18] = 0.47587422495511826103441185;
+    x[19] = 0.56972047181140171930800328;
+    x[20] = 0.65665109403886496121989818;
+    x[21] = 0.73561087801363177202814451;
+    x[22] = 0.80564137091717917144788596;
+    x[23] = 0.86589252257439504894225457;
+    x[24] = 0.91563302639213207386968942;
+    x[25] = 0.95425928062893819725410184;
+    x[26] = 0.98130316537087275369455995;
+    x[27] = 0.99644249757395444995043639;
+  }
+  else if ( n == 29 )
+  {
+    x[0] = -0.99667944226059658616319153;
+    x[1] = -0.98254550526141317487092602;
+    x[2] = -0.95728559577808772579820804;
+    x[3] = -0.92118023295305878509375344;
+    x[4] = -0.87463780492010279041779342;
+    x[5] = -0.81818548761525244498957221;
+    x[6] = -0.75246285173447713391261008;
+    x[7] = -0.67821453760268651515618501;
+    x[8] = -0.59628179713822782037958621;
+    x[9] = -0.50759295512422764210262792;
+    x[10] = -0.41315288817400866389070659;
+    x[11] = -0.31403163786763993494819592;
+    x[12] = -0.21135228616600107450637573;
+    x[13] = -0.10627823013267923017098239;
+    x[14] = 0.00000000000000000000000000;
+    x[15] = 0.10627823013267923017098239;
+    x[16] = 0.21135228616600107450637573;
+    x[17] = 0.31403163786763993494819592;
+    x[18] = 0.41315288817400866389070659;
+    x[19] = 0.50759295512422764210262792;
+    x[20] = 0.59628179713822782037958621;
+    x[21] = 0.67821453760268651515618501;
+    x[22] = 0.75246285173447713391261008;
+    x[23] = 0.81818548761525244498957221;
+    x[24] = 0.87463780492010279041779342;
+    x[25] = 0.92118023295305878509375344;
+    x[26] = 0.95728559577808772579820804;
+    x[27] = 0.98254550526141317487092602;
+    x[28] = 0.99667944226059658616319153;
+  }
+  else if ( n == 30 )
+  {
+    x[0] = -0.99689348407464954027163005;
+    x[1] = -0.98366812327974720997003258;
+    x[2] = -0.96002186496830751221687103;
+    x[3] = -0.92620004742927432587932428;
+    x[4] = -0.88256053579205268154311646;
+    x[5] = -0.82956576238276839744289812;
+    x[6] = -0.76777743210482619491797734;
+    x[7] = -0.69785049479331579693229239;
+    x[8] = -0.62052618298924286114047756;
+    x[9] = -0.53662414814201989926416979;
+    x[10] = -0.44703376953808917678060990;
+    x[11] = -0.35270472553087811347103721;
+    x[12] = -0.25463692616788984643980513;
+    x[13] = -0.15386991360858354696379467;
+    x[14] = -0.05147184255531769583302521;
+    x[15] = 0.05147184255531769583302521;
+    x[16] = 0.15386991360858354696379467;
+    x[17] = 0.25463692616788984643980513;
+    x[18] = 0.35270472553087811347103721;
+    x[19] = 0.44703376953808917678060990;
+    x[20] = 0.53662414814201989926416979;
+    x[21] = 0.62052618298924286114047756;
+    x[22] = 0.69785049479331579693229239;
+    x[23] = 0.76777743210482619491797734;
+    x[24] = 0.82956576238276839744289812;
+    x[25] = 0.88256053579205268154311646;
+    x[26] = 0.92620004742927432587932428;
+    x[27] = 0.96002186496830751221687103;
+    x[28] = 0.98366812327974720997003258;
+    x[29] = 0.99689348407464954027163005;
+  }
+  else if ( n == 31 )
+  {
+    x[0] = -0.99708748181947707405562655;
+    x[1] = -0.98468590966515248400246517;
+    x[2] = -0.96250392509294966178905240;
+    x[3] = -0.93075699789664816495694576;
+    x[4] = -0.88976002994827104337419201;
+    x[5] = -0.83992032014626734008690454;
+    x[6] = -0.78173314841662494040636002;
+    x[7] = -0.71577678458685328390597087;
+    x[8] = -0.64270672292426034618441820;
+    x[9] = -0.56324916140714926272094492;
+    x[10] = -0.47819378204490248044059404;
+    x[11] = -0.38838590160823294306135146;
+    x[12] = -0.29471806998170161661790390;
+    x[13] = -0.19812119933557062877241300;
+    x[14] = -0.09955531215234152032517479;
+    x[15] = 0.00000000000000000000000000;
+    x[16] = 0.09955531215234152032517479;
+    x[17] = 0.19812119933557062877241300;
+    x[18] = 0.29471806998170161661790390;
+    x[19] = 0.38838590160823294306135146;
+    x[20] = 0.47819378204490248044059404;
+    x[21] = 0.56324916140714926272094492;
+    x[22] = 0.64270672292426034618441820;
+    x[23] = 0.71577678458685328390597087;
+    x[24] = 0.78173314841662494040636002;
+    x[25] = 0.83992032014626734008690454;
+    x[26] = 0.88976002994827104337419201;
+    x[27] = 0.93075699789664816495694576;
+    x[28] = 0.96250392509294966178905240;
+    x[29] = 0.98468590966515248400246517;
+    x[30] = 0.99708748181947707405562655;
+  }
+  else if ( n == 32 )
+  {
+    x[0] = -0.99726386184948156354498113;
+    x[1] = -0.98561151154526833540017504;
+    x[2] = -0.96476225558750643077381193;
+    x[3] = -0.93490607593773968917091913;
+    x[4] = -0.89632115576605212396530724;
+    x[5] = -0.84936761373256997013369300;
+    x[6] = -0.79448379596794240696309730;
+    x[7] = -0.73218211874028968038742667;
+    x[8] = -0.66304426693021520097511517;
+    x[9] = -0.58771575724076232904074548;
+    x[10] = -0.50689990893222939002374747;
+    x[11] = -0.42135127613063534536411944;
+    x[12] = -0.33186860228212764977991681;
+    x[13] = -0.23928736225213707454460321;
+    x[14] = -0.14447196158279649348518637;
+    x[15] = -0.04830766568773831623481257;
+    x[16] = 0.04830766568773831623481257;
+    x[17] = 0.14447196158279649348518637;
+    x[18] = 0.23928736225213707454460321;
+    x[19] = 0.33186860228212764977991681;
+    x[20] = 0.42135127613063534536411944;
+    x[21] = 0.50689990893222939002374747;
+    x[22] = 0.58771575724076232904074548;
+    x[23] = 0.66304426693021520097511517;
+    x[24] = 0.73218211874028968038742667;
+    x[25] = 0.79448379596794240696309730;
+    x[26] = 0.84936761373256997013369300;
+    x[27] = 0.89632115576605212396530724;
+    x[28] = 0.93490607593773968917091913;
+    x[29] = 0.96476225558750643077381193;
+    x[30] = 0.98561151154526833540017504;
+    x[31] = 0.99726386184948156354498113;
+  }
+  else if ( n == 33 )
+  {
+    x[0] = -0.99742469424645521726616802;
+    x[1] = -0.98645572623064248811037570;
+    x[2] = -0.96682290968999276892837771;
+    x[3] = -0.93869437261116835035583512;
+    x[4] = -0.90231676774343358304053133;
+    x[5] = -0.85800965267650406464306148;
+    x[6] = -0.80616235627416658979620087;
+    x[7] = -0.74723049644956215785905512;
+    x[8] = -0.68173195996974278626821595;
+    x[9] = -0.61024234583637902730728751;
+    x[10] = -0.53338990478634764354889426;
+    x[11] = -0.45185001727245069572599328;
+    x[12] = -0.36633925774807334107022062;
+    x[13] = -0.27760909715249702940324807;
+    x[14] = -0.18643929882799157233579876;
+    x[15] = -0.09363106585473338567074292;
+    x[16] = 0.00000000000000000000000000;
+    x[17] = 0.09363106585473338567074292;
+    x[18] = 0.18643929882799157233579876;
+    x[19] = 0.27760909715249702940324807;
+    x[20] = 0.36633925774807334107022062;
+    x[21] = 0.45185001727245069572599328;
+    x[22] = 0.53338990478634764354889426;
+    x[23] = 0.61024234583637902730728751;
+    x[24] = 0.68173195996974278626821595;
+    x[25] = 0.74723049644956215785905512;
+    x[26] = 0.80616235627416658979620087;
+    x[27] = 0.85800965267650406464306148;
+    x[28] = 0.90231676774343358304053133;
+    x[29] = 0.93869437261116835035583512;
+    x[30] = 0.96682290968999276892837771;
+    x[31] = 0.98645572623064248811037570;
+    x[32] = 0.99742469424645521726616802;
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "LEGENDRE_LOOKUP_POINTS - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::cerr << "  Legal values are 1 through 33.\n";
+    std::exit ( 1 );
+  }
+  return;
+}
+//****************************************************************************80
+
+void legendre_lookup_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEGENDRE_LOOKUP_WEIGHTS looks up weights for Gauss-Legendre quadrature.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    27 April 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Milton Abramowitz, Irene Stegun,
+//    Handbook of Mathematical Functions,
+//    National Bureau of Standards, 1964,
+//    ISBN: 0-486-61272-4,
+//    LC: QA47.A34.
+//
+//    Vladimir Krylov,
+//    Approximate Calculation of Integrals,
+//    Dover, 2006,
+//    ISBN: 0486445798.
+//    LC: QA311.K713.
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//    Stephen Wolfram,
+//    The Mathematica Book,
+//    Fourth Edition,
+//    Cambridge University Press, 1999,
+//    ISBN: 0-521-64314-7,
+//    LC: QA76.95.W65.
+//
+//    Daniel Zwillinger, editor,
+//    CRC Standard Mathematical Tables and Formulae,
+//    30th Edition,
+//    CRC Press, 1996,
+//    ISBN: 0-8493-2479-3,
+//    LC: QA47.M315.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    N must be between 1 and 33.
+//
+//    Output, double W[N], the weights.
+//
+{
+  if ( n == 1 )
+  {
+    w[0] = 2.000000000000000000000000000000;
+  }
+  else if ( n == 2 )
+  {
+    w[0] = 1.000000000000000000000000000000;
+    w[1] = 1.000000000000000000000000000000;
+  }
+  else if ( n == 3 )
+  {
+    w[0] = 0.555555555555555555555555555556;
+    w[1] = 0.888888888888888888888888888889;
+    w[2] = 0.555555555555555555555555555556;
+  }
+  else if ( n == 4 )
+  {
+    w[0] = 0.347854845137453857373063949222;
+    w[1] = 0.652145154862546142626936050778;
+    w[2] = 0.652145154862546142626936050778;
+    w[3] = 0.347854845137453857373063949222;
+  }
+  else if ( n == 5 )
+  {
+    w[0] = 0.236926885056189087514264040720;
+    w[1] = 0.478628670499366468041291514836;
+    w[2] = 0.568888888888888888888888888889;
+    w[3] = 0.478628670499366468041291514836;
+    w[4] = 0.236926885056189087514264040720;
+  }
+  else if ( n == 6 )
+  {
+    w[0] = 0.171324492379170345040296142173;
+    w[1] = 0.360761573048138607569833513838;
+    w[2] = 0.467913934572691047389870343990;
+    w[3] = 0.467913934572691047389870343990;
+    w[4] = 0.360761573048138607569833513838;
+    w[5] = 0.171324492379170345040296142173;
+  }
+  else if ( n == 7 )
+  {
+    w[0] = 0.129484966168869693270611432679;
+    w[1] = 0.279705391489276667901467771424;
+    w[2] = 0.381830050505118944950369775489;
+    w[3] = 0.417959183673469387755102040816;
+    w[4] = 0.381830050505118944950369775489;
+    w[5] = 0.279705391489276667901467771424;
+    w[6] = 0.129484966168869693270611432679;
+  }
+  else if ( n == 8 )
+  {
+    w[0] = 0.101228536290376259152531354310;
+    w[1] = 0.222381034453374470544355994426;
+    w[2] = 0.313706645877887287337962201987;
+    w[3] = 0.362683783378361982965150449277;
+    w[4] = 0.362683783378361982965150449277;
+    w[5] = 0.313706645877887287337962201987;
+    w[6] = 0.222381034453374470544355994426;
+    w[7] = 0.101228536290376259152531354310;
+  }
+  else if ( n == 9 )
+  {
+    w[0] = 0.081274388361574411971892158111;
+    w[1] = 0.18064816069485740405847203124;
+    w[2] = 0.26061069640293546231874286942;
+    w[3] = 0.31234707704000284006863040658;
+    w[4] = 0.33023935500125976316452506929;
+    w[5] = 0.31234707704000284006863040658;
+    w[6] = 0.26061069640293546231874286942;
+    w[7] = 0.18064816069485740405847203124;
+    w[8] = 0.081274388361574411971892158111;
+  }
+  else if ( n == 10 )
+  {
+    w[0] = 0.066671344308688137593568809893;
+    w[1] = 0.14945134915058059314577633966;
+    w[2] = 0.21908636251598204399553493423;
+    w[3] = 0.26926671930999635509122692157;
+    w[4] = 0.29552422471475287017389299465;
+    w[5] = 0.29552422471475287017389299465;
+    w[6] = 0.26926671930999635509122692157;
+    w[7] = 0.21908636251598204399553493423;
+    w[8] = 0.14945134915058059314577633966;
+    w[9] = 0.066671344308688137593568809893;
+  }
+  else if ( n == 11 )
+  {
+    w[0] = 0.055668567116173666482753720443;
+    w[1] = 0.12558036946490462463469429922;
+    w[2] = 0.18629021092773425142609764143;
+    w[3] = 0.23319376459199047991852370484;
+    w[4] = 0.26280454451024666218068886989;
+    w[5] = 0.27292508677790063071448352834;
+    w[6] = 0.26280454451024666218068886989;
+    w[7] = 0.23319376459199047991852370484;
+    w[8] = 0.18629021092773425142609764143;
+    w[9] = 0.12558036946490462463469429922;
+    w[10] = 0.055668567116173666482753720443;
+  }
+  else if ( n == 12 )
+  {
+    w[0] = 0.047175336386511827194615961485;
+    w[1] = 0.10693932599531843096025471819;
+    w[2] = 0.16007832854334622633465252954;
+    w[3] = 0.20316742672306592174906445581;
+    w[4] = 0.23349253653835480876084989892;
+    w[5] = 0.24914704581340278500056243604;
+    w[6] = 0.24914704581340278500056243604;
+    w[7] = 0.23349253653835480876084989892;
+    w[8] = 0.20316742672306592174906445581;
+    w[9] = 0.16007832854334622633465252954;
+    w[10] = 0.10693932599531843096025471819;
+    w[11] = 0.047175336386511827194615961485;
+  }
+  else if ( n == 13 )
+  {
+    w[0] = 0.040484004765315879520021592201;
+    w[1] = 0.092121499837728447914421775954;
+    w[2] = 0.13887351021978723846360177687;
+    w[3] = 0.17814598076194573828004669200;
+    w[4] = 0.20781604753688850231252321931;
+    w[5] = 0.22628318026289723841209018604;
+    w[6] = 0.23255155323087391019458951527;
+    w[7] = 0.22628318026289723841209018604;
+    w[8] = 0.20781604753688850231252321931;
+    w[9] = 0.17814598076194573828004669200;
+    w[10] = 0.13887351021978723846360177687;
+    w[11] = 0.092121499837728447914421775954;
+    w[12] = 0.040484004765315879520021592201;
+  }
+  else if ( n == 14 )
+  {
+    w[0] = 0.035119460331751863031832876138;
+    w[1] = 0.08015808715976020980563327706;
+    w[2] = 0.12151857068790318468941480907;
+    w[3] = 0.15720316715819353456960193862;
+    w[4] = 0.18553839747793781374171659013;
+    w[5] = 0.20519846372129560396592406566;
+    w[6] = 0.21526385346315779019587644332;
+    w[7] = 0.21526385346315779019587644332;
+    w[8] = 0.20519846372129560396592406566;
+    w[9] = 0.18553839747793781374171659013;
+    w[10] = 0.15720316715819353456960193862;
+    w[11] = 0.12151857068790318468941480907;
+    w[12] = 0.08015808715976020980563327706;
+    w[13] = 0.035119460331751863031832876138;
+  }
+  else if ( n == 15 )
+  {
+    w[0] = 0.030753241996117268354628393577;
+    w[1] = 0.070366047488108124709267416451;
+    w[2] = 0.107159220467171935011869546686;
+    w[3] = 0.13957067792615431444780479451;
+    w[4] = 0.16626920581699393355320086048;
+    w[5] = 0.18616100001556221102680056187;
+    w[6] = 0.19843148532711157645611832644;
+    w[7] = 0.20257824192556127288062019997;
+    w[8] = 0.19843148532711157645611832644;
+    w[9] = 0.18616100001556221102680056187;
+    w[10] = 0.16626920581699393355320086048;
+    w[11] = 0.13957067792615431444780479451;
+    w[12] = 0.107159220467171935011869546686;
+    w[13] = 0.070366047488108124709267416451;
+    w[14] = 0.030753241996117268354628393577;
+  }
+  else if ( n == 16 )
+  {
+    w[0] = 0.027152459411754094851780572456;
+    w[1] = 0.062253523938647892862843836994;
+    w[2] = 0.09515851168249278480992510760;
+    w[3] = 0.12462897125553387205247628219;
+    w[4] = 0.14959598881657673208150173055;
+    w[5] = 0.16915651939500253818931207903;
+    w[6] = 0.18260341504492358886676366797;
+    w[7] = 0.18945061045506849628539672321;
+    w[8] = 0.18945061045506849628539672321;
+    w[9] = 0.18260341504492358886676366797;
+    w[10] = 0.16915651939500253818931207903;
+    w[11] = 0.14959598881657673208150173055;
+    w[12] = 0.12462897125553387205247628219;
+    w[13] = 0.09515851168249278480992510760;
+    w[14] = 0.062253523938647892862843836994;
+    w[15] = 0.027152459411754094851780572456;
+  }
+  else if ( n == 17 )
+  {
+    w[0] = 0.024148302868547931960110026288;
+    w[1] = 0.055459529373987201129440165359;
+    w[2] = 0.085036148317179180883535370191;
+    w[3] = 0.111883847193403971094788385626;
+    w[4] = 0.13513636846852547328631998170;
+    w[5] = 0.15404576107681028808143159480;
+    w[6] = 0.16800410215645004450997066379;
+    w[7] = 0.17656270536699264632527099011;
+    w[8] = 0.17944647035620652545826564426;
+    w[9] = 0.17656270536699264632527099011;
+    w[10] = 0.16800410215645004450997066379;
+    w[11] = 0.15404576107681028808143159480;
+    w[12] = 0.13513636846852547328631998170;
+    w[13] = 0.111883847193403971094788385626;
+    w[14] = 0.085036148317179180883535370191;
+    w[15] = 0.055459529373987201129440165359;
+    w[16] = 0.024148302868547931960110026288;
+  }
+  else if ( n == 18 )
+  {
+    w[0] = 0.021616013526483310313342710266;
+    w[1] = 0.049714548894969796453334946203;
+    w[2] = 0.07642573025488905652912967762;
+    w[3] = 0.10094204410628716556281398492;
+    w[4] = 0.12255520671147846018451912680;
+    w[5] = 0.14064291467065065120473130375;
+    w[6] = 0.15468467512626524492541800384;
+    w[7] = 0.16427648374583272298605377647;
+    w[8] = 0.16914238296314359184065647013;
+    w[9] = 0.16914238296314359184065647013;
+    w[10] = 0.16427648374583272298605377647;
+    w[11] = 0.15468467512626524492541800384;
+    w[12] = 0.14064291467065065120473130375;
+    w[13] = 0.12255520671147846018451912680;
+    w[14] = 0.10094204410628716556281398492;
+    w[15] = 0.07642573025488905652912967762;
+    w[16] = 0.049714548894969796453334946203;
+    w[17] = 0.021616013526483310313342710266;
+  }
+  else if ( n == 19 )
+  {
+    w[0] = 0.019461788229726477036312041464;
+    w[1] = 0.044814226765699600332838157402;
+    w[2] = 0.069044542737641226580708258006;
+    w[3] = 0.091490021622449999464462094124;
+    w[4] = 0.111566645547333994716023901682;
+    w[5] = 0.12875396253933622767551578486;
+    w[6] = 0.14260670217360661177574610944;
+    w[7] = 0.15276604206585966677885540090;
+    w[8] = 0.15896884339395434764995643946;
+    w[9] = 0.16105444984878369597916362532;
+    w[10] = 0.15896884339395434764995643946;
+    w[11] = 0.15276604206585966677885540090;
+    w[12] = 0.14260670217360661177574610944;
+    w[13] = 0.12875396253933622767551578486;
+    w[14] = 0.111566645547333994716023901682;
+    w[15] = 0.091490021622449999464462094124;
+    w[16] = 0.069044542737641226580708258006;
+    w[17] = 0.044814226765699600332838157402;
+    w[18] = 0.019461788229726477036312041464;
+  }
+  else if ( n == 20 )
+  {
+    w[0] = 0.017614007139152118311861962352;
+    w[1] = 0.040601429800386941331039952275;
+    w[2] = 0.062672048334109063569506535187;
+    w[3] = 0.08327674157670474872475814322;
+    w[4] = 0.10193011981724043503675013548;
+    w[5] = 0.11819453196151841731237737771;
+    w[6] = 0.13168863844917662689849449975;
+    w[7] = 0.14209610931838205132929832507;
+    w[8] = 0.14917298647260374678782873700;
+    w[9] = 0.15275338713072585069808433195;
+    w[10] = 0.15275338713072585069808433195;
+    w[11] = 0.14917298647260374678782873700;
+    w[12] = 0.14209610931838205132929832507;
+    w[13] = 0.13168863844917662689849449975;
+    w[14] = 0.11819453196151841731237737771;
+    w[15] = 0.10193011981724043503675013548;
+    w[16] = 0.08327674157670474872475814322;
+    w[17] = 0.062672048334109063569506535187;
+    w[18] = 0.040601429800386941331039952275;
+    w[19] = 0.017614007139152118311861962352;
+  }
+  else if ( n == 21 )
+  {
+    w[ 0] =   0.016017228257774333324224616858;
+    w[ 1] =   0.036953789770852493799950668299;
+    w[ 2] =   0.057134425426857208283635826472;
+    w[ 3] =   0.076100113628379302017051653300;
+    w[ 4] =   0.093444423456033861553289741114;
+    w[ 5] =   0.108797299167148377663474578070;
+    w[ 6] =   0.12183141605372853419536717713;
+    w[ 7] =   0.13226893863333746178105257450;
+    w[ 8] =   0.13988739479107315472213342387;
+    w[9] =   0.14452440398997005906382716655;
+    w[10] =   0.14608113364969042719198514768;
+    w[11] =   0.14452440398997005906382716655;
+    w[12] =   0.13988739479107315472213342387;
+    w[13] =   0.13226893863333746178105257450;
+    w[14] =   0.12183141605372853419536717713;
+    w[15] =   0.108797299167148377663474578070;
+    w[16] =   0.093444423456033861553289741114;
+    w[17] =   0.076100113628379302017051653300;
+    w[18] =   0.057134425426857208283635826472;
+    w[19] =   0.036953789770852493799950668299;
+    w[20] =   0.016017228257774333324224616858;
+  }
+  else if ( n == 22 )
+  {
+    w[0] = 0.014627995298272200684991098047;
+    w[1] = 0.033774901584814154793302246866;
+    w[2] = 0.052293335152683285940312051273;
+    w[3] = 0.06979646842452048809496141893;
+    w[4] = 0.08594160621706772741444368137;
+    w[5] = 0.10041414444288096493207883783;
+    w[6] = 0.11293229608053921839340060742;
+    w[7] = 0.12325237681051242428556098615;
+    w[8] = 0.13117350478706237073296499253;
+    w[9] = 0.13654149834601517135257383123;
+    w[10] = 0.13925187285563199337541024834;
+    w[11] = 0.13925187285563199337541024834;
+    w[12] = 0.13654149834601517135257383123;
+    w[13] = 0.13117350478706237073296499253;
+    w[14] = 0.12325237681051242428556098615;
+    w[15] = 0.11293229608053921839340060742;
+    w[16] = 0.10041414444288096493207883783;
+    w[17] = 0.08594160621706772741444368137;
+    w[18] = 0.06979646842452048809496141893;
+    w[19] = 0.052293335152683285940312051273;
+    w[20] = 0.033774901584814154793302246866;
+    w[21] = 0.014627995298272200684991098047;
+  }
+  else if ( n == 23 )
+  {
+    w[0] = 0.013411859487141772081309493459;
+    w[1] = 0.030988005856979444310694219642;
+    w[2] = 0.048037671731084668571641071632;
+    w[3] = 0.064232421408525852127169615159;
+    w[4] = 0.079281411776718954922892524742;
+    w[5] = 0.092915766060035147477018617370;
+    w[6] = 0.104892091464541410074086185015;
+    w[7] = 0.11499664022241136494164351293;
+    w[8] = 0.12304908430672953046757840067;
+    w[9] = 0.12890572218808214997859533940;
+    w[10] = 0.13246203940469661737164246470;
+    w[11] = 0.13365457218610617535145711055;
+    w[12] = 0.13246203940469661737164246470;
+    w[13] = 0.12890572218808214997859533940;
+    w[14] = 0.12304908430672953046757840067;
+    w[15] = 0.11499664022241136494164351293;
+    w[16] = 0.104892091464541410074086185015;
+    w[17] = 0.092915766060035147477018617370;
+    w[18] = 0.079281411776718954922892524742;
+    w[19] = 0.064232421408525852127169615159;
+    w[20] = 0.048037671731084668571641071632;
+    w[21] = 0.030988005856979444310694219642;
+    w[22] = 0.013411859487141772081309493459;
+  }
+  else if ( n == 24 )
+  {
+    w[0] = 0.012341229799987199546805667070;
+    w[1] = 0.028531388628933663181307815952;
+    w[2] = 0.044277438817419806168602748211;
+    w[3] = 0.059298584915436780746367758500;
+    w[4] = 0.07334648141108030573403361525;
+    w[5] = 0.08619016153195327591718520298;
+    w[6] = 0.09761865210411388826988066446;
+    w[7] = 0.10744427011596563478257734245;
+    w[8] = 0.11550566805372560135334448391;
+    w[9] = 0.12167047292780339120446315348;
+    w[10] = 0.12583745634682829612137538251;
+    w[11] = 0.12793819534675215697405616522;
+    w[12] = 0.12793819534675215697405616522;
+    w[13] = 0.12583745634682829612137538251;
+    w[14] = 0.12167047292780339120446315348;
+    w[15] = 0.11550566805372560135334448391;
+    w[16] = 0.10744427011596563478257734245;
+    w[17] = 0.09761865210411388826988066446;
+    w[18] = 0.08619016153195327591718520298;
+    w[19] = 0.07334648141108030573403361525;
+    w[20] = 0.059298584915436780746367758500;
+    w[21] = 0.044277438817419806168602748211;
+    w[22] = 0.028531388628933663181307815952;
+    w[23] = 0.012341229799987199546805667070;
+  }
+  else if ( n == 25 )
+  {
+    w[0] = 0.0113937985010262879479029641132;
+    w[1] = 0.026354986615032137261901815295;
+    w[2] = 0.040939156701306312655623487712;
+    w[3] = 0.054904695975835191925936891541;
+    w[4] = 0.068038333812356917207187185657;
+    w[5] = 0.080140700335001018013234959669;
+    w[6] = 0.091028261982963649811497220703;
+    w[7] = 0.100535949067050644202206890393;
+    w[8] = 0.108519624474263653116093957050;
+    w[9] = 0.11485825914571164833932554587;
+    w[10] = 0.11945576353578477222817812651;
+    w[11] = 0.12224244299031004168895951895;
+    w[12] = 0.12317605372671545120390287308;
+    w[13] = 0.12224244299031004168895951895;
+    w[14] = 0.11945576353578477222817812651;
+    w[15] = 0.11485825914571164833932554587;
+    w[16] = 0.108519624474263653116093957050;
+    w[17] = 0.100535949067050644202206890393;
+    w[18] = 0.091028261982963649811497220703;
+    w[19] = 0.080140700335001018013234959669;
+    w[20] = 0.068038333812356917207187185657;
+    w[21] = 0.054904695975835191925936891541;
+    w[22] = 0.040939156701306312655623487712;
+    w[23] = 0.026354986615032137261901815295;
+    w[24] = 0.0113937985010262879479029641132;
+  }
+  else if ( n == 26 )
+  {
+    w[0] = 0.010551372617343007155651187685;
+    w[1] = 0.024417851092631908789615827520;
+    w[2] = 0.037962383294362763950303141249;
+    w[3] = 0.050975825297147811998319900724;
+    w[4] = 0.063274046329574835539453689907;
+    w[5] = 0.07468414976565974588707579610;
+    w[6] = 0.08504589431348523921044776508;
+    w[7] = 0.09421380035591414846366488307;
+    w[8] = 0.10205916109442542323841407025;
+    w[9] = 0.10847184052857659065657942673;
+    w[10] = 0.11336181654631966654944071844;
+    w[11] = 0.11666044348529658204466250754;
+    w[12] = 0.11832141527926227651637108570;
+    w[13] = 0.11832141527926227651637108570;
+    w[14] = 0.11666044348529658204466250754;
+    w[15] = 0.11336181654631966654944071844;
+    w[16] = 0.10847184052857659065657942673;
+    w[17] = 0.10205916109442542323841407025;
+    w[18] = 0.09421380035591414846366488307;
+    w[19] = 0.08504589431348523921044776508;
+    w[20] = 0.07468414976565974588707579610;
+    w[21] = 0.063274046329574835539453689907;
+    w[22] = 0.050975825297147811998319900724;
+    w[23] = 0.037962383294362763950303141249;
+    w[24] = 0.024417851092631908789615827520;
+    w[25] = 0.010551372617343007155651187685;
+  }
+  else if ( n == 27 )
+  {
+    w[0] = 0.0097989960512943602611500550912;
+    w[1] = 0.022686231596180623196034206447;
+    w[2] = 0.035297053757419711022578289305;
+    w[3] = 0.047449412520615062704096710114;
+    w[4] = 0.058983536859833599110300833720;
+    w[5] = 0.069748823766245592984322888357;
+    w[6] = 0.079604867773057771263074959010;
+    w[7] = 0.088423158543756950194322802854;
+    w[8] = 0.096088727370028507565652646558;
+    w[9] = 0.102501637817745798671247711533;
+    w[10] = 0.107578285788533187212162984427;
+    w[11] = 0.111252488356845192672163096043;
+    w[12] = 0.113476346108965148620369948092;
+    w[13] = 0.11422086737895698904504573690;
+    w[14] = 0.113476346108965148620369948092;
+    w[15] = 0.111252488356845192672163096043;
+    w[16] = 0.107578285788533187212162984427;
+    w[17] = 0.102501637817745798671247711533;
+    w[18] = 0.096088727370028507565652646558;
+    w[19] = 0.088423158543756950194322802854;
+    w[20] = 0.079604867773057771263074959010;
+    w[21] = 0.069748823766245592984322888357;
+    w[22] = 0.058983536859833599110300833720;
+    w[23] = 0.047449412520615062704096710114;
+    w[24] = 0.035297053757419711022578289305;
+    w[25] = 0.022686231596180623196034206447;
+    w[26] = 0.0097989960512943602611500550912;
+  }
+  else if ( n == 28 )
+  {
+    w[0] = 0.009124282593094517738816153923;
+    w[1] = 0.021132112592771259751500380993;
+    w[2] = 0.032901427782304379977630819171;
+    w[3] = 0.044272934759004227839587877653;
+    w[4] = 0.055107345675716745431482918227;
+    w[5] = 0.06527292396699959579339756678;
+    w[6] = 0.07464621423456877902393188717;
+    w[7] = 0.08311341722890121839039649824;
+    w[8] = 0.09057174439303284094218603134;
+    w[9] = 0.09693065799792991585048900610;
+    w[10] = 0.10211296757806076981421663851;
+    w[11] = 0.10605576592284641791041643700;
+    w[12] = 0.10871119225829413525357151930;
+    w[13] = 0.11004701301647519628237626560;
+    w[14] = 0.11004701301647519628237626560;
+    w[15] = 0.10871119225829413525357151930;
+    w[16] = 0.10605576592284641791041643700;
+    w[17] = 0.10211296757806076981421663851;
+    w[18] = 0.09693065799792991585048900610;
+    w[19] = 0.09057174439303284094218603134;
+    w[20] = 0.08311341722890121839039649824;
+    w[21] = 0.07464621423456877902393188717;
+    w[22] = 0.06527292396699959579339756678;
+    w[23] = 0.055107345675716745431482918227;
+    w[24] = 0.044272934759004227839587877653;
+    w[25] = 0.032901427782304379977630819171;
+    w[26] = 0.021132112592771259751500380993;
+    w[27] = 0.009124282593094517738816153923;
+  }
+  else if ( n == 29 )
+  {
+    w[0] = 0.0085169038787464096542638133022;
+    w[1] = 0.019732085056122705983859801640;
+    w[2] = 0.030740492202093622644408525375;
+    w[3] = 0.041402062518682836104830010114;
+    w[4] = 0.051594826902497923912594381180;
+    w[5] = 0.061203090657079138542109848024;
+    w[6] = 0.070117933255051278569581486949;
+    w[7] = 0.078238327135763783828144888660;
+    w[8] = 0.085472257366172527545344849297;
+    w[9] = 0.091737757139258763347966411077;
+    w[10] = 0.096963834094408606301900074883;
+    w[11] = 0.101091273759914966121820546907;
+    w[12] = 0.104073310077729373913328471285;
+    w[13] = 0.105876155097320941406591327852;
+    w[14] = 0.10647938171831424424651112691;
+    w[15] = 0.105876155097320941406591327852;
+    w[16] = 0.104073310077729373913328471285;
+    w[17] = 0.101091273759914966121820546907;
+    w[18] = 0.096963834094408606301900074883;
+    w[19] = 0.091737757139258763347966411077;
+    w[20] = 0.085472257366172527545344849297;
+    w[21] = 0.078238327135763783828144888660;
+    w[22] = 0.070117933255051278569581486949;
+    w[23] = 0.061203090657079138542109848024;
+    w[24] = 0.051594826902497923912594381180;
+    w[25] = 0.041402062518682836104830010114;
+    w[26] = 0.030740492202093622644408525375;
+    w[27] = 0.019732085056122705983859801640;
+    w[28] = 0.0085169038787464096542638133022;
+  }
+  else if ( n == 30 )
+  {
+    w[0] = 0.007968192496166605615465883475;
+    w[1] = 0.018466468311090959142302131912;
+    w[2] = 0.028784707883323369349719179611;
+    w[3] = 0.038799192569627049596801936446;
+    w[4] = 0.048402672830594052902938140423;
+    w[5] = 0.057493156217619066481721689402;
+    w[6] = 0.06597422988218049512812851512;
+    w[7] = 0.07375597473770520626824385002;
+    w[8] = 0.08075589522942021535469493846;
+    w[9] = 0.08689978720108297980238753072;
+    w[10] = 0.09212252223778612871763270709;
+    w[11] = 0.09636873717464425963946862635;
+    w[12] = 0.09959342058679526706278028210;
+    w[13] = 0.10176238974840550459642895217;
+    w[14] = 0.10285265289355884034128563671;
+    w[15] = 0.10285265289355884034128563671;
+    w[16] = 0.10176238974840550459642895217;
+    w[17] = 0.09959342058679526706278028210;
+    w[18] = 0.09636873717464425963946862635;
+    w[19] = 0.09212252223778612871763270709;
+    w[20] = 0.08689978720108297980238753072;
+    w[21] = 0.08075589522942021535469493846;
+    w[22] = 0.07375597473770520626824385002;
+    w[23] = 0.06597422988218049512812851512;
+    w[24] = 0.057493156217619066481721689402;
+    w[25] = 0.048402672830594052902938140423;
+    w[26] = 0.038799192569627049596801936446;
+    w[27] = 0.028784707883323369349719179611;
+    w[28] = 0.018466468311090959142302131912;
+    w[29] = 0.007968192496166605615465883475;
+  }
+  else if ( n == 31 )
+  {
+    w[0] = 0.0074708315792487758586968750322;
+    w[1] = 0.017318620790310582463157996087;
+    w[2] = 0.027009019184979421800608708092;
+    w[3] = 0.036432273912385464024392010468;
+    w[4] = 0.045493707527201102902315857895;
+    w[5] = 0.054103082424916853711666259087;
+    w[6] = 0.062174786561028426910343543687;
+    w[7] = 0.069628583235410366167756126255;
+    w[8] = 0.076390386598776616426357674901;
+    w[9] = 0.082392991761589263903823367432;
+    w[10] = 0.087576740608477876126198069695;
+    w[11] = 0.091890113893641478215362871607;
+    w[12] = 0.095290242912319512807204197488;
+    w[13] = 0.097743335386328725093474010979;
+    w[14] = 0.099225011226672307874875514429;
+    w[15] = 0.09972054479342645142753383373;
+    w[16] = 0.099225011226672307874875514429;
+    w[17] = 0.097743335386328725093474010979;
+    w[18] = 0.095290242912319512807204197488;
+    w[19] = 0.091890113893641478215362871607;
+    w[20] = 0.087576740608477876126198069695;
+    w[21] = 0.082392991761589263903823367432;
+    w[22] = 0.076390386598776616426357674901;
+    w[23] = 0.069628583235410366167756126255;
+    w[24] = 0.062174786561028426910343543687;
+    w[25] = 0.054103082424916853711666259087;
+    w[26] = 0.045493707527201102902315857895;
+    w[27] = 0.036432273912385464024392010468;
+    w[28] = 0.027009019184979421800608708092;
+    w[29] = 0.017318620790310582463157996087;
+    w[30] = 0.0074708315792487758586968750322;
+  }
+  else if ( n == 32 )
+  {
+    w[0] = 0.007018610009470096600407063739;
+    w[1] = 0.016274394730905670605170562206;
+    w[2] = 0.025392065309262059455752589789;
+    w[3] = 0.034273862913021433102687732252;
+    w[4] = 0.042835898022226680656878646606;
+    w[5] = 0.050998059262376176196163244690;
+    w[6] = 0.058684093478535547145283637300;
+    w[7] = 0.06582222277636184683765006371;
+    w[8] = 0.07234579410884850622539935648;
+    w[9] = 0.07819389578707030647174091883;
+    w[10] = 0.08331192422694675522219907460;
+    w[11] = 0.08765209300440381114277146275;
+    w[12] = 0.09117387869576388471286857711;
+    w[13] = 0.09384439908080456563918023767;
+    w[14] = 0.09563872007927485941908200220;
+    w[15] = 0.09654008851472780056676483006;
+    w[16] = 0.09654008851472780056676483006;
+    w[17] = 0.09563872007927485941908200220;
+    w[18] = 0.09384439908080456563918023767;
+    w[19] = 0.09117387869576388471286857711;
+    w[20] = 0.08765209300440381114277146275;
+    w[21] = 0.08331192422694675522219907460;
+    w[22] = 0.07819389578707030647174091883;
+    w[23] = 0.07234579410884850622539935648;
+    w[24] = 0.06582222277636184683765006371;
+    w[25] = 0.058684093478535547145283637300;
+    w[26] = 0.050998059262376176196163244690;
+    w[27] = 0.042835898022226680656878646606;
+    w[28] = 0.034273862913021433102687732252;
+    w[29] = 0.025392065309262059455752589789;
+    w[30] = 0.016274394730905670605170562206;
+    w[31] = 0.007018610009470096600407063739;
+  }
+  else if ( n == 33 )
+  {
+    w[0] = 0.0066062278475873780586492352085;
+    w[1] = 0.015321701512934676127945768534;
+    w[2] = 0.023915548101749480350533257529;
+    w[3] = 0.032300358632328953281561447250;
+    w[4] = 0.040401541331669591563409790527;
+    w[5] = 0.048147742818711695670146880138;
+    w[6] = 0.055470846631663561284944495439;
+    w[7] = 0.062306482530317480031627725771;
+    w[8] = 0.068594572818656712805955073015;
+    w[9] = 0.074279854843954149342472175919;
+    w[10] = 0.079312364794886738363908384942;
+    w[11] = 0.083647876067038707613928014518;
+    w[12] = 0.087248287618844337607281670945;
+    w[13] = 0.090081958660638577239743705500;
+    w[14] = 0.092123986643316846213240977717;
+    w[15] = 0.093356426065596116160999126274;
+    w[16] = 0.09376844616020999656730454155;
+    w[17] = 0.093356426065596116160999126274;
+    w[18] = 0.092123986643316846213240977717;
+    w[19] = 0.090081958660638577239743705500;
+    w[20] = 0.087248287618844337607281670945;
+    w[21] = 0.083647876067038707613928014518;
+    w[22] = 0.079312364794886738363908384942;
+    w[23] = 0.074279854843954149342472175919;
+    w[24] = 0.068594572818656712805955073015;
+    w[25] = 0.062306482530317480031627725771;
+    w[26] = 0.055470846631663561284944495439;
+    w[27] = 0.048147742818711695670146880138;
+    w[28] = 0.040401541331669591563409790527;
+    w[29] = 0.032300358632328953281561447250;
+    w[30] = 0.023915548101749480350533257529;
+    w[31] = 0.015321701512934676127945768534;
+    w[32] = 0.0066062278475873780586492352085;
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "LEGENDRE_LOOKUP_WEIGHTS - Fatal error!\n";
+    std::cerr << "  Illegal value of N = " << n << "\n";
+    std::cerr << "  Legal values are 1 through 33.\n";
+    std::exit ( 1 );
+  }
+  return;
+}
+//****************************************************************************80
+
+double *legendre_zeros ( int order )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEGENDRE_ZEROS returns the zeros of the Legendre polynomial of degree N.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    17 June 2011
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Philip Davis, Philip Rabinowitz.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Philip Davis, Philip Rabinowitz,
+//    Methods of Numerical Integration,
+//    Second Edition,
+//    Dover, 2007,
+//    ISBN: 0486453391,
+//    LC: QA299.3.D28.
+//
+//  Parameters:
+//
+//    Input, int ORDER, the order.
+//    ORDER must be greater than 0.
+//
+//    Output, double LEGENDRE_ZEROS[ORDER], the zeros.
+//
+{
+  double d1;
+  double d2pn;
+  double d3pn;
+  double d4pn;
+  double dp;
+  double dpn;
+  double e1;
+  double fx;
+  double h;
+  int i;
+  int iback;
+  int k;
+  int m;
+  int mp1mi;
+  int ncopy;
+  int nmove;
+  double p;
+  double pi = 3.141592653589793;
+  double pk;
+  double pkm1;
+  double pkp1;
+  double t;
+  double u;
+  double v;
+  double x0;
+  double *xtab;
+  double xtemp;
+
+  xtab = new double[order];
+
+  e1 = ( double ) ( order * ( order + 1 ) );
+
+  m = ( order + 1 ) / 2;
+
+  for ( i = 1; i <= m; i++ )
+  {
+    mp1mi = m + 1 - i;
+
+    t = ( double ) ( 4 * i - 1 ) * pi / ( double ) ( 4 * order + 2 );
+
+    x0 = std::cos ( t ) * ( 1.0 - ( 1.0 - 1.0 / ( double ) ( order ) )
+      / ( double ) ( 8 * order * order ) );
+
+    pkm1 = 1.0;
+    pk = x0;
+
+    for ( k = 2; k <= order; k++ )
+    {
+      pkp1 = 2.0 * x0 * pk - pkm1 - ( x0 * pk - pkm1 ) / ( double ) ( k );
+      pkm1 = pk;
+      pk = pkp1;
+    }
+
+    d1 = ( double ) ( order ) * ( pkm1 - x0 * pk );
+
+    dpn = d1 / ( 1.0 - x0 * x0 );
+
+    d2pn = ( 2.0 * x0 * dpn - e1 * pk ) / ( 1.0 - x0 * x0 );
+
+    d3pn = ( 4.0 * x0 * d2pn + ( 2.0 - e1 ) * dpn ) / ( 1.0 - x0 * x0 );
+
+    d4pn = ( 6.0 * x0 * d3pn + ( 6.0 - e1 ) * d2pn ) / ( 1.0 - x0 * x0 );
+
+    u = pk / dpn;
+    v = d2pn / dpn;
+//
+//  Initial approximation H:
+//
+    h = - u * ( 1.0 + 0.5 * u * ( v + u * ( v * v - d3pn / ( 3.0 * dpn ) ) ) );
+//
+//  Refine H using one step of Newton's method:
+//
+    p = pk + h * ( dpn + 0.5 * h * ( d2pn + h / 3.0
+      * ( d3pn + 0.25 * h * d4pn ) ) );
+
+    dp = dpn + h * ( d2pn + 0.5 * h * ( d3pn + h * d4pn / 3.0 ) );
+
+    h = h - p / dp;
+
+    xtemp = x0 + h;
+
+    xtab[mp1mi-1] = xtemp;
+
+    fx = d1 - h * e1 * ( pk + 0.5 * h * ( dpn + h / 3.0
+      * ( d2pn + 0.25 * h * ( d3pn + 0.2 * h * d4pn ) ) ) );
+  }
+
+  if ( ( order % 2 ) == 1 )
+  {
+    xtab[0] = 0.0;
+  }
+//
+//  Shift the data up.
+//
+  nmove = ( order + 1 ) / 2;
+  ncopy = order - nmove;
+
+  for ( i = 1; i <= nmove; i++ )
+  {
+    iback = order + 1 - i;
+    xtab[iback-1] = xtab[iback-ncopy-1];
+  }
+//
+//  Reflect values for the negative abscissas.
+//
+  for ( i = 1; i <= order - nmove; i++ )
+  {
+    xtab[i-1] = - xtab[order-i];
+  }
+
+  return xtab;
+}
+//****************************************************************************80
+
+void level_growth_to_order ( int dim_num, int level[], int rule[],
+  int growth[], int order[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEVEL_GROWTH_TO_ORDER: convert Level and Growth to Order.
+//
+//  Discussion:
+//
+//    This function is given level, rule, and growth information
+//    for each dimension of a quadrature rule, and determines the
+//    corresponding order of the rule in each dimension.
+//
+//    This is a revised version of LEVEL_GROWTH_TO_ORDER.
+//
+//    In particular, it revises the interpretation of the RULE vector as
+//    far as the values 10, 11, and 12 are concerned.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    16 October 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int DIM_NUM, the spatial dimension.
+//
+//    Input, int LEVEL[DIM_NUM], the 1D levels.
+//
+//    Input, int RULE[DIM_NUM], the rule in each dimension.
+//     1, "CC",  Clenshaw Curtis, Closed Fully Nested.
+//     2, "F2",  Fejer Type 2, Open Fully Nested.
+//     3, "GP",  Gauss Patterson, Open Fully Nested.
+//     4, "GL",  Gauss Legendre, Open Weakly Nested.
+//     5, "GH",  Gauss Hermite, Open Weakly Nested.
+//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested.
+//     7, "LG",  Gauss Laguerre, Open Non Nested.
+//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested.
+//     9, "GJ",  Gauss Jacobi, Open Non Nested.
+//    10, "HGK", Hermite Genz-Keister, Open Fully Nested.
+//    11, "UO",  User supplied Open, presumably Non Nested.
+//    12, "UC",  User supplied Closed, presumably Non Nested.
+//
+//    Input, int GROWTH[DIM_NUM], the desired growth in each dimension.
+//    0, "DF", default growth associated with this quadrature rule;
+//    1, "SL", slow linear, L+1;
+//    2  "SO", slow linear odd, O=1+2((L+1)/2)
+//    3, "ML", moderate linear, 2L+1;
+//    4, "SE", slow exponential;
+//    5, "ME", moderate exponential;
+//    6, "FE", full exponential.
+//
+//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
+//
+{
+  int dim;
+  int l;
+  int o;
+  static int o_hgk[6] = { 1, 3, 9, 19, 35, 43 };
+  int p;
+  static int p_hgk[6] = { 1, 5, 15, 29, 51, 67 };
+//
+//  Check the input.
+//
+  for ( dim = 0; dim < dim_num; dim++ )
+  {
+    if ( level[dim] < 0 )
+    {
+      std::cerr << "\n";
+      std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+      std::cerr << "  Negative value of LEVEL[DIM]!\n";
+      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
+      std::exit ( 1 );
+    }
+
+    if ( rule[dim] < 1 || 12 < rule[dim] )
+    {
+      std::cerr << "\n";
+      std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+      std::cerr << "  Illegal value of RULE[DIM]!\n";
+      std::cerr << "  RULE[" << dim << "] = " << rule[dim] << "\n";
+      std::exit ( 1 );
+    }
+
+    if ( growth[dim] < 0 || 6 < growth[dim] )
+    {
+      std::cerr << "\n";
+      std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+      std::cerr << "  Illegal value of GROWTH[DIM]!\n";
+      std::cerr << "  GROWTH[" << dim << "] = " << growth[dim] << "\n";
+      std::exit ( 1 );
+    }
+  }
+//
+//  Compute the order vector.
+//
+  for ( dim = 0; dim < dim_num; dim++ )
+  {
+//
+//  CC
+//  Default is Moderate Exponential Growth.
+//
+    if ( rule[dim] == 1 )
+    {
+      if ( growth[dim] == 1 )
+      {
+        o = level[dim] + 1;
+      }
+      else if ( growth[dim] == 2 )
+      {
+        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+      }
+      else if ( growth[dim] == 3 )
+      {
+        o = 2 * level[dim] + 1;
+      }
+      else if ( growth[dim] == 4 )
+      {
+        if ( level[dim] == 0 )
+        {
+          o = 1;
+        }
+        else
+        {
+          o = 2;
+          while ( o < 2 * level[dim] + 1 )
+          {
+            o = 2 * ( o - 1 ) + 1;
+          }
+        }
+      }
+      else if ( growth[dim] == 5 || growth[dim] == 0 )
+      {
+        if ( level[dim] == 0 )
+        {
+          o = 1;
+        }
+        else
+        {
+          o = 2;
+          while ( o < 4 * level[dim] + 1 )
+          {
+            o = 2 * ( o - 1 ) + 1;
+          }
+        }
+      }
+      else if ( growth[dim] == 6 )
+      {
+        if ( level[dim] == 0 )
+        {
+          o = 1;
+        }
+        else
+        {
+          o = webbur::i4_power ( 2, level[dim] ) + 1;
+        }
+      }
+    }
+//
+//  F2
+//  Default is Moderate Exponential Growth.
+//
+    else if ( rule[dim] == 2 )
+    {
+      if ( growth[dim] == 1 )
+      {
+        o = level[dim] + 1;
+      }
+      else if ( growth[dim] == 2 )
+      {
+        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+      }
+      else if ( growth[dim] == 3 )
+      {
+        o = 2 * level[dim] + 1;
+      }
+      else if ( growth[dim] == 4 )
+      {
+        o = 1;
+        while ( o < 2 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 5 || growth[dim] == 0 )
+      {
+        o = 1;
+        while ( o < 4 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 6 )
+      {
+        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+      }
+    }
+//
+//  GP
+//  Default is Moderate Exponential Growth.
+//
+    else if ( rule[dim] == 3 )
+    {
+      if ( growth[dim] == 1 )
+      {
+        std::cerr << "\n";
+        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+        std::cerr << "  Growth rate 1 for rule 3 not available!\n";
+        std::exit ( 1 );
+      }
+      else if ( growth[dim] == 2 )
+      {
+        std::cerr << "\n";
+        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+        std::cerr << "  Growth rate 2 for rule 3 not available!\n";
+        std::exit ( 1 );
+      }
+      else if ( growth[dim] == 3 )
+      {
+        std::cerr << "\n";
+        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+        std::cerr << "  Growth rate 3 for rule 3 not available!\n";
+        std::exit ( 1 );
+      }
+      else if ( growth[dim] == 4 )
+      {
+        if ( level[dim] == 0 )
+        {
+          o = 1;
+        }
+        else
+        {
+          p = 5;
+          o = 3;
+          while ( p < 2 * level[dim] + 1 )
+          {
+            p = 2 * p + 1;
+            o = 2 * o + 1;
+          }
+        }
+      }
+      else if ( growth[dim] == 5 || growth[dim] == 0 )
+      {
+        if ( level[dim] == 0 )
+        {
+          o = 1;
+        }
+        else
+        {
+          p = 5;
+          o = 3;
+          while ( p < 4 * level[dim] + 1 )
+          {
+            p = 2 * p + 1;
+            o = 2 * o + 1;
+          }
+        }
+      }
+      else if ( growth[dim] == 6 )
+      {
+        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+      }
+    }
+//
+//  GL
+//  Default is Moderate Linear Growth.
+//
+    else if ( rule[dim] == 4 )
+    {
+      if ( growth[dim] == 1 )
+      {
+        o = level[dim] + 1;
+      }
+      else if ( growth[dim] == 2 )
+      {
+        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+      }
+      else if ( growth[dim] == 3 || growth[dim] == 0 )
+      {
+        o = 2 * level[dim] + 1;
+      }
+      else if ( growth[dim] == 4 )
+      {
+        o = 1;
+        while ( 2 * o - 1 < 2 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 5 )
+      {
+        o = 1;
+        while ( 2 * o - 1 < 4 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 6 )
+      {
+        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+      }
+    }
+//
+//  GH
+//  Default is Moderate Linear Growth.
+//
+    else if ( rule[dim] == 5 )
+    {
+      if ( growth[dim] == 1 )
+      {
+        o = level[dim] + 1;
+      }
+      else if ( growth[dim] == 2 )
+      {
+        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+      }
+      else if ( growth[dim] == 3 || growth[dim] == 0 )
+      {
+        o = 2 * level[dim] + 1;
+      }
+      else if ( growth[dim] == 4 )
+      {
+        o = 1;
+        while ( 2 * o - 1 < 2 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 5 )
+      {
+        o = 1;
+        while ( 2 * o - 1 < 4 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 6 )
+      {
+        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+      }
+    }
+//
+//  GGH
+//  Default is Moderate Linear Growth.
+//
+    else if ( rule[dim] == 6 )
+    {
+      if ( growth[dim] == 1 )
+      {
+        o = level[dim] + 1;
+      }
+      else if ( growth[dim] == 2 )
+      {
+        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+      }
+      else if ( growth[dim] == 3 || growth[dim] == 0 )
+      {
+        o = 2 * level[dim] + 1;
+      }
+      else if ( growth[dim] == 4 )
+      {
+        o = 1;
+        while ( 2 * o - 1 < 2 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 5 )
+      {
+        o = 1;
+        while ( 2 * o - 1 < 4 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 6 )
+      {
+        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+      }
+    }
+//
+//  LG
+//  Default is Moderate Linear Growth.
+//
+    else if ( rule[dim] == 7 )
+    {
+      if ( growth[dim] == 1 )
+      {
+        o = level[dim] + 1;
+      }
+      else if ( growth[dim] == 2 )
+      {
+        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+      }
+      else if ( growth[dim] == 3 || growth[dim] == 0 )
+      {
+        o = 2 * level[dim] + 1;
+      }
+      else if ( growth[dim] == 4 )
+      {
+        o = 1;
+        while ( 2 * o - 1 < 2 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 5 )
+      {
+        o = 1;
+        while ( 2 * o - 1 < 4 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 6 )
+      {
+        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+      }
+    }
+//
+//  GLG
+//  Default is Moderate Linear Growth.
+//
+    else if ( rule[dim] == 8 )
+    {
+      if ( growth[dim] == 1 )
+      {
+        o = level[dim] + 1;
+      }
+      else if ( growth[dim] == 2 )
+      {
+        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+      }
+      else if ( growth[dim] == 3 || growth[dim] == 0 )
+      {
+        o = 2 * level[dim] + 1;
+      }
+      else if ( growth[dim] == 4 )
+      {
+        o = 1;
+        while ( 2 * o - 1 < 2 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 5 )
+      {
+        o = 1;
+        while ( 2 * o - 1 < 4 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 6 )
+      {
+        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+      }
+    }
+//
+//  GJ
+//  Default is Moderate Linear Growth.
+//
+    else if ( rule[dim] == 9 )
+    {
+      if ( growth[dim] == 1 )
+      {
+        o = level[dim] + 1;
+      }
+      else if ( growth[dim] == 2 )
+      {
+        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+      }
+      else if ( growth[dim] == 3 || growth[dim] == 0 )
+      {
+        o = 2 * level[dim] + 1;
+      }
+      else if ( growth[dim] == 4 )
+      {
+        o = 1;
+        while ( 2 * o - 1 < 2 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 5 )
+      {
+        o = 1;
+        while ( 2 * o - 1 < 4 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 6 )
+      {
+        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+      }
+    }
+//
+//  HGK
+//  Default is Moderate Exponential Growth.
+//  Exponential growth is interpreted to mean simply take successive rules.
+//
+    else if ( rule[dim] == 10 )
+    {
+      if ( growth[dim] == 1 )
+      {
+        std::cerr << "\n";
+        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+        std::cerr << "  Growth rate 1 for rule 10 not available!\n";
+        std::exit ( 1 );
+      }
+      else if ( growth[dim] == 2 )
+      {
+        std::cerr << "\n";
+        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+        std::cerr << "  Growth rate 2 for rule 10 not available!\n";
+        std::exit ( 1 );
+      }
+      else if ( growth[dim] == 3 )
+      {
+        std::cerr << "\n";
+        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+        std::cerr << "  Growth rate 3 for rule 10 not available!\n";
+        std::exit ( 1 );
+      }
+      else if ( growth[dim] == 4 )
+      {
+        l = 0;
+        p = p_hgk[l];
+        o = o_hgk[l];
+        while ( p < 2 * level[dim] + 1 )
+        {
+          l = l + 1;
+          if ( 5 < l )
+          {
+            std::cerr << "\n";
+            std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+            std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
+            std::exit ( 1 );
+          }
+          p = p_hgk[l];
+          o = o_hgk[l];
+        }
+      }
+      else if ( growth[dim] == 5 || growth[dim] == 0 )
+      {
+        l = 0;
+        p = p_hgk[l];
+        o = o_hgk[l];
+        while ( p < 4 * level[dim] + 1 )
+        {
+          l = l + 1;
+          if ( 5 < l )
+          {
+            std::cerr << "\n";
+            std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+            std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
+            std::exit ( 1 );
+          }
+          p = p_hgk[l];
+          o = o_hgk[l];
+        }
+      }
+      else if ( growth[dim] == 6 )
+      {
+        l = level[dim];
+        l = webbur::i4_max ( l, 0 );
+        if ( 5 < l )
+        {
+          std::cerr << "\n";
+          std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+          std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
+          std::exit ( 1 );
+        }
+        o = o_hgk[l];
+      }
+    }
+//
+//  UO
+//  Default is Moderate Linear Growth.
+//  We assume the rule is of OPEN type and that it
+//  has a precision typical of Gauss rules.
+//
+    else if ( rule[dim] == 11 )
+    {
+      if ( growth[dim] == 1 )
+      {
+        o = level[dim] + 1;
+      }
+      else if ( growth[dim] == 2 )
+      {
+        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+      }
+      else if ( growth[dim] == 3 || growth[dim] == 0 )
+      {
+        o = 2 * level[dim] + 1;
+      }
+      else if ( growth[dim] == 4 )
+      {
+        o = 1;
+        while ( 2 * o - 1 < 2 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 5 )
+      {
+        o = 1;
+        while ( 2 * o - 1 < 4 * level[dim] + 1 )
+        {
+          o = 2 * o + 1;
+        }
+      }
+      else if ( growth[dim] == 6 )
+      {
+        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+      }
+    }
+//
+//  UC
+//  Default is Moderate Linear Growth.
+//  We assume the rule is of CLOSED type and that it
+//  has a precision typical of Clenshaw-Curtis rules.
+//
+    else if ( rule[dim] == 12 )
+    {
+      if ( growth[dim] == 1 )
+      {
+        o = level[dim] + 1;
+      }
+      else if ( growth[dim] == 2 )
+      {
+        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+      }
+      else if ( growth[dim] == 3 || growth[dim] == 0 )
+      {
+        o = 2 * level[dim] + 1;
+      }
+      else if ( growth[dim] == 4 )
+      {
+        if ( level[dim] == 0 )
+        {
+          o = 1;
+        }
+        else
+        {
+          o = 2;
+          while ( o < 2 * level[dim] + 1 )
+          {
+            o = 2 * ( o - 1 ) + 1;
+          }
+        }
+      }
+      else if ( growth[dim] == 5 )
+      {
+        if ( level[dim] == 0 )
+        {
+          o = 1;
+        }
+        else
+        {
+          o = 2;
+          while ( o < 4 * level[dim] + 1 )
+          {
+            o = 2 * ( o - 1 ) + 1;
+          }
+        }
+      }
+      else if ( growth[dim] == 6 )
+      {
+        if ( level[dim] == 0 )
+        {
+          o = 1;
+        }
+        else
+        {
+          o = webbur::i4_power ( 2, level[dim] ) + 1;
+        }
+      }
+    }
+    order[dim] = o;
+  }
+  return;
+}
+//****************************************************************************80
+
+void level_to_order_default ( int dim_num, int level[], int rule[],
+  int order[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEVEL_TO_ORDER_DEFAULT: default growth.
+//
+//  Discussion:
+//
+//    This function uses:
+//
+//    * exponential growth rates for fully nested quadrature rules,
+//      ( "CC", "F2", "GP");
+//
+//    * linear growth rates for other rules.
+//      ( "GL", "GH", "GGH", "LG", "GLG", "GJ", "GW" ).
+//
+//    * slow exponential growth alternative for fully nested rules:
+//      ("CC_SE", "F2_SE", "GP_SE").
+//
+//    * moderate exponential growth alternative for fully nested rules:
+//      ("CC_ME", "F2_ME", "GP_ME").
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    07 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int DIM_NUM, the spatial dimension.
+//
+//    Input, int LEVEL[DIM_NUM], the 1D levels.
+//
+//    Input, int RULE[DIM_NUM], the rule in each dimension.
+//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
+//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
+//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
+//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
+//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
+//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
+//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
+//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
+//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
+//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
+//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
+//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
+//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
+//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
+//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
+//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
+//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
+//
+//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
+//
+{
+  int dim;
+  int o;
+  int p;
+
+  for ( dim = 0; dim < dim_num; dim++ )
+  {
+    if ( level[dim] < 0 )
+    {
+      std::cerr << "\n";
+      std::cerr << "LEVEL_TO_ORDER_DEFAULT - Fatal error!\n";
+      std::cerr << "  Negative value of LEVEL[DIM]!\n";
+      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
+      std::exit ( 1 );
+    }
+    else if ( rule[dim] == 1 )
+    {
+      if ( level[dim] == 0 )
+      {
+        order[dim] = 1;
+      }
+      else
+      {
+        order[dim] = webbur::i4_power ( 2, level[dim] ) + 1;
+      }
+    }
+    else if ( rule[dim] == 2 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 3 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 4 )
+    {
+      order[dim] = 2 * level[dim] + 1;
+    }
+    else if ( rule[dim] == 5 )
+    {
+      order[dim] = 2 * level[dim] + 1;
+    }
+    else if ( rule[dim] == 6 )
+    {
+      order[dim] = 2 * level[dim] + 1;
+    }
+    else if ( rule[dim] == 7 )
+    {
+      order[dim] = 2 * level[dim] + 1;
+    }
+    else if ( rule[dim] == 8 )
+    {
+      order[dim] = 2 * level[dim] + 1;
+    }
+    else if ( rule[dim] == 9 )
+    {
+      order[dim] = 2 * level[dim] + 1;
+    }
+    else if ( rule[dim] == 10 )
+    {
+      order[dim] = 2 * level[dim] + 1;
+    }
+    else if ( rule[dim] == 11 )
+    {
+      if ( level[dim] == 0 )
+      {
+        o = 1;
+      }
+      else
+      {
+        o = 2;
+        while ( o < 2 * level[dim] + 1 )
+        {
+          o = 2 * ( o - 1 ) + 1;
+        }
+      }
+      order[dim] = o;
+    }
+    else if ( rule[dim] == 12 )
+    {
+      o = 1;
+      while ( o < 2 * level[dim] + 1 )
+      {
+        o = 2 * o + 1;
+      }
+      order[dim] = o;
+    }
+    else if ( rule[dim] == 13 )
+    {
+      if ( level[dim] == 0 )
+      {
+        order[dim] = 1;
+      }
+      else
+      {
+        p = 5;
+        o = 3;
+        while ( p < 2 * level[dim] + 1 )
+        {
+          p = 2 * p + 1;
+          o = 2 * o + 1;
+        }
+        order[dim] = o;
+      }
+    }
+    else if ( rule[dim] == 14 )
+    {
+      if ( level[dim] == 0 )
+      {
+        o = 1;
+      }
+      else
+      {
+        o = 2;
+        while ( o < 4 * level[dim] + 1 )
+        {
+          o = 2 * ( o - 1 ) + 1;
+        }
+      }
+      order[dim] = o;
+    }
+    else if ( rule[dim] == 15 )
+    {
+      o = 1;
+      while ( o < 4 * level[dim] + 1 )
+      {
+        o = 2 * o + 1;
+      }
+      order[dim] = o;
+    }
+    else if ( rule[dim] == 16 )
+    {
+      if ( level[dim] == 0 )
+      {
+        order[dim] = 1;
+      }
+      else
+      {
+        p = 5;
+        o = 3;
+        while ( p < 4 * level[dim] + 1 )
+        {
+          p = 2 * p + 1;
+          o = 2 * o + 1;
+        }
+        order[dim] = o;
+      }
+    }
+    else if ( rule[dim] == 17 )
+    {
+      order[dim] = 2 * level[dim] + 1;
+    }
+    else
+    {
+      std::cerr << "\n";
+      std::cerr << "LEVEL_TO_ORDER_DEFAULT - Fatal error!\n";
+      std::cerr << "  Unexpected value of RULE["
+           << dim << "] = " << rule[dim] << ".\n";
+      std::exit ( 1 );
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void level_to_order_exponential ( int dim_num, int level[], int rule[],
+  int order[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEVEL_TO_ORDER_EXPONENTIAL: exponential growth.
+//
+//  Discussion:
+//
+//    The user must preallocate space for the output array ORDER.
+//
+//    Closed rules:
+//
+//      O(0) = 1
+//      O(L) = 2^L + 1;
+//
+//      O = 1, 3, 5, 9, 17, 33, ...
+//
+//    Open rules:
+//
+//      O(L) = 2^(L+1) - 1;
+//
+//      O = 1, 3, 7, 15, 31, 63, ...
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    07 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int DIM_NUM, the spatial dimension.
+//
+//    Input, int LEVEL[DIM_NUM], the 1D levels.
+//
+//    Input, int RULE[DIM_NUM], the rule in each dimension.
+//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
+//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
+//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
+//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
+//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
+//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
+//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
+//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
+//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
+//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
+//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
+//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
+//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
+//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
+//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
+//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
+//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
+//
+//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
+//
+{
+  int dim;
+
+  for ( dim = 0; dim < dim_num; dim++ )
+  {
+    if ( level[dim] < 0 )
+    {
+      std::cerr << "\n";
+      std::cerr << "LEVEL_TO_ORDER_EXPONENTIAL - Fatal error!\n";
+      std::cerr << "  Negative value of LEVEL[DIM]!\n";
+      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
+      std::exit ( 1 );
+    }
+    else if ( rule[dim] == 1 )
+    {
+      if ( level[dim] == 0 )
+      {
+        order[dim] = 1;
+      }
+      else
+      {
+        order[dim] = webbur::i4_power ( 2, level[dim] ) + 1;
+      }
+    }
+    else if ( rule[dim] == 2 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 3 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 4 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 5 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 6 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 7 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 8 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 9 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 10 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 11 )
+    {
+      if ( level[dim] == 0 )
+      {
+        order[dim] = 1;
+      }
+      else
+      {
+        order[dim] = webbur::i4_power ( 2, level[dim] ) + 1;
+      }
+    }
+    else if ( rule[dim] == 12 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 13 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 14 )
+    {
+      if ( level[dim] == 0 )
+      {
+        order[dim] = 1;
+      }
+      else
+      {
+        order[dim] = webbur::i4_power ( 2, level[dim] ) + 1;
+      }
+    }
+    else if ( rule[dim] == 15 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 16 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+    }
+    else if ( rule[dim] == 17 )
+    {
+      order[dim] = webbur::i4_power ( 2, level[dim] + 1 );
+    }
+    else
+    {
+      std::cerr << "\n";
+      std::cerr << "LEVEL_TO_ORDER_EXPONENTIAL - Fatal error!\n";
+      std::cerr << "  Unexpected value of RULE["
+           << dim << "] = " << rule[dim] << ".\n";
+      std::exit ( 1 );
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void level_to_order_exponential_slow ( int dim_num, int level[], int rule[],
+  int order[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEVEL_TO_ORDER_EXPONENTIAL_SLOW: slow exponential growth;
+//
+//  Discussion:
+//
+//    We seek a sequence of quadrature rules with two opposing constraints:
+//    * a measured rise in polynomial precision with increasing level;
+//    * a control on the increase in (new) points per level;
+//
+//    Essentially, we are trying to keep some of the advantages of nesting,
+//    while moderating the cost of the explosive growth in order that occurs
+//    due to the repeated order doubling of nesting.
+//
+//    We wish the number of points at a given level L to be "about" 2 * L + 1,
+//    but we also wish the rules to be completely nested.
+//
+//    One way to do this is to start with a nested family of rules, whose
+//    order will tend to grow exponentially (doubling from one to the next),
+//    but simply to REPEAT each rule as many times as possible.  We move to
+//    the next rule only when the desired precision 2 * L + 1 exceeds the
+//    precision of the current rule.
+//
+//    For both the Clenshaw Curtis and Fejer Type 2 rules, the order and
+//    precision are the same if the order is odd.   That is, an 11 point rule
+//    will integrate exactly all polynomials up to and including degree 11.
+//
+//    For Gauss Patterson rules, the relationship between order and precision
+//    is somewhat more complicated.  For that rule, we take the philosophy
+//    that at each level L, we wish to choose the rule of smallest order
+//    so that the precision of 2 * L + 1 is guaranteed.
+//
+//     L    2*L+1  CC Order    F2 Order    GP Order/Precision
+//
+//     0        1         1           1        1/1
+//     1        3         3           3        3/5
+//     2        5         5           7        3/5
+//     3        7         9           7        7/11
+//     4        9         9          15        7/11
+//     5       11        17          15        7/11
+//     6       13        17          15       15/23
+//     7       15        17          15       15/23
+//     8       17        17          31       15/23
+//     9       19        33          31       15/23
+//    10       21        33          31       15/23
+//    11       23        33          31       15/23
+//    12       25        33          31       31/47
+//    13       27        33          31       31/47
+//    14       29        33          31       31/47
+//    15       31        33          31       31/47
+//    16       33        33          63       31/47
+//    17       35        65          63       31/47
+//    18       37        65          63       31/47
+//    19       39        65          63       31/47
+//    20       41        65          63       31/47
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    07 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Knut Petras,
+//    Smolyak Cubature of Given Polynomial Degree with Few Nodes
+//    for Increasing Dimension,
+//    Numerische Mathematik,
+//    Volume 93, Number 4, February 2003, pages 729-753.
+//
+//  Parameters:
+//
+//    Input, int DIM_NUM, the spatial dimension.
+//
+//    Input, int LEVEL[DIM_NUM], the 1D levels.
+//
+//    Input, int RULE[DIM_NUM], the rule in each dimension.
+//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
+//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
+//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
+//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
+//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
+//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
+//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
+//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
+//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
+//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
+//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
+//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
+//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
+//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
+//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
+//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
+//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
+//
+//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
+//
+{
+  int dim;
+  int o;
+  int p;
+
+  for ( dim = 0; dim < dim_num; dim++ )
+  {
+    if ( level[dim] < 0 )
+    {
+      std::cerr << "\n";
+      std::cerr << "LEVEL_TO_ORDER_EXPONENTIAL_SLOW - Fatal error!\n";
+      std::cerr << "  Negative value of LEVEL[DIM]!\n";
+      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
+      std::exit ( 1 );
+    }
+  }
+
+  for ( dim = 0; dim < dim_num; dim++ )
+  {
+    if ( rule[dim] == 1 || rule[dim] == 11 || rule[dim] == 14 || rule[dim] == 17 )
+    {
+      if ( level[dim] == 0 )
+      {
+        o = 1;
+      }
+      else
+      {
+        o = 2;
+        while ( o < 2 * level[dim] + 1 )
+        {
+          o = 2 * ( o - 1 ) + 1;
+        }
+      }
+    }
+    else if ( rule[dim] == 3 || rule[dim] == 13 || rule[dim] == 16 )
+    {
+      if ( level[dim] == 0 )
+      {
+        o = 1;
+      }
+      else
+      {
+        p = 5;
+        o = 3;
+        while ( p < 2 * level[dim] + 1 )
+        {
+          p = 2 * p + 1;
+          o = 2 * o + 1;
+        }
+      }
+    }
+    else
+    {
+      o = 1;
+      while ( o < 2 * level[dim] + 1 )
+      {
+        o = 2 * o + 1;
+      }
+    }
+    order[dim] = o;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void level_to_order_linear ( int dim_num, int level[], int rule[],
+  int order[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEVEL_TO_ORDER_LINEAR: linear growth.
+//
+//  Discussion:
+//
+//    The user must preallocate space for the output array ORDER.
+//
+//      O(L) = 2 * L + 1;
+//
+//      O = 1, 3, 5, 7, 9, ...
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    07 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int DIM_NUM, the spatial dimension.
+//
+//    Input, int LEVEL[DIM_NUM], the 1D levels.
+//
+//    Input, int RULE[DIM_NUM], the rule in each dimension.
+//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
+//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
+//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
+//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
+//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
+//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
+//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
+//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
+//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
+//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
+//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
+//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
+//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
+//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
+//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
+//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
+//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
+//
+//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
+//
+{
+  int dim;
+
+  for ( dim = 0; dim < dim_num; dim++ )
+  {
+    if ( level[dim] < 0 )
+    {
+      std::cerr << "\n";
+      std::cerr << "LEVEL_TO_ORDER_LINEAR - Fatal error!\n";
+      std::cerr << "  Negative value of LEVEL[DIM]!\n";
+      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
+      std::exit ( 1 );
+    }
+  }
+
+  for ( dim = 0; dim < dim_num; dim++ )
+  {
+    order[dim] = 2 * level[dim] + 1;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+int level_to_order_exp_cc ( int level, int growth )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEVEL_TO_ORDER_EXP_CC is used for Clenshaw-Curtis type rules.
+//
+//  Discussion:
+//
+//    Rules of this type are assumed to be closed (including both endpoints
+//    except for the level 0 rule) and having a precision
+//    behavior typical of Clenshaw Curtis rules, namely, the ORDER-point
+//    rule is exact for polynomials of degree less than ORDER, and if
+//    ORDER is odd, then the exactness includes polynomials of degree ORDER
+//    as well.
+//
+//    LEVEL  ORDER  ORDER  ORDER
+//           G = 0  G = 1  G = 2
+//    -----  -----  -----  -----
+//        0      1      1      1
+//        1      3      5      3
+//        2      5      9      5
+//        3      9     17      9
+//        4      9     17     17
+//        5     17     33     33
+//        6     17     33     65
+//        7     17     33    129
+//        8     17     33    257
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    31 December 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int LEVEL, the level of the rule.
+//
+//    Input, int GROWTH, the growth policy:
+//    0, slow growth;
+//    1, moderate growth;
+//    2, full growth.
+//
+//    Output, int LEVEL_TO_ORDER_EXP_CC, the order of the rule.
+//
+{
+  int o;
+//
+//  Slow exponential growth.
+//
+  if ( growth == 0 )
+  {
+    if ( level == 0 )
+    {
+      o = 1;
+    }
+    else
+    {
+      o = 2;
+      while ( o < 2 * level + 1 )
+      {
+        o = 2 * ( o - 1 ) + 1;
+      }
+    }
+  }
+//
+//  Moderate Exponential Growth.
+//
+  else if ( growth == 1 )
+  {
+    if ( level == 0 )
+    {
+      o = 1;
+    }
+    else
+    {
+      o = 2;
+      while ( o < 4 * level + 1 )
+      {
+        o = 2 * ( o - 1 ) + 1;
+      }
+    }
+  }
+//
+//  Full Exponential Growth.
+//
+  else if ( growth == 2 )
+  {
+    if ( level == 0 )
+    {
+      o = 1;
+    }
+    else
+    {
+      o = webbur::i4_power ( 2, level ) + 1;
+    }
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "LEVEL_TO_ORDER_EXP_CC - Fatal error!\n";
+    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
+    std::exit ( 1 );
+  }
+  return o;
+}
+//****************************************************************************80
+
+int level_to_order_exp_f2 ( int level, int growth )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEVEL_TO_ORDER_EXP_F2 is used for Fejer 2 type rules.
+//
+//  Discussion:
+//
+//    Rules of this type are assumed to be open (not including either endpoint)
+//    and having a precision behavior typical of Fejer Type 2
+//    rules, namely, the ORDER-point rule is exact for polynomials of degree
+//    less than ORDER, and if ORDER is odd, then the exactness includes
+//    polynomials of degree ORDER as well.
+//
+//    LEVEL  ORDER  ORDER  ORDER
+//           G = 0  G = 1  G = 2
+//
+//        0      1      1      1
+//        1      3      7      3
+//        2      7     15      7
+//        3      7     15     15
+//        4     15     31     31
+//        5     15     31     63
+//        6     15     31    127
+//        7     15     31    255
+//        8     31     63    511
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    31 December 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int LEVEL, the level of the rule.
+//
+//    Input, int GROWTH, the growth policy:
+//    0, slow growth;
+//    1, moderate growth;
+//    2, full growth.
+//
+//    Output, int LEVEL_TO_ORDER_EXP_F2, the order of the rule.
+//
+{
+  int o;
+//
+//  Slow exponential growth.
+//
+  if ( growth == 0 )
+  {
+    if ( level == 0 )
+    {
+      o = 1;
+    }
+    else
+    {
+      o = 1;
+      while ( o < 2 * level + 1 )
+      {
+        o = 2 * o + 1;
+      }
+    }
+  }
+//
+//  Moderate Exponential Growth.
+//
+  else if ( growth == 1 )
+  {
+    if ( level == 0 )
+    {
+      o = 1;
+    }
+    else
+    {
+      o = 1;
+      while ( o < 4 * level + 1 )
+      {
+        o = 2 * o + 1;
+      }
+    }
+  }
+//
+//  Full Exponential Growth.
+//
+  else if ( growth == 2 )
+  {
+    if ( level == 0 )
+    {
+      o = 1;
+    }
+    else
+    {
+      o = webbur::i4_power ( 2, level + 1 ) - 1;
+    }
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "LEVEL_TO_ORDER_EXP_F2 - Fatal error!\n";
+    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
+    std::exit ( 1 );
+  }
+  return o;
+}
+//****************************************************************************80
+
+int level_to_order_exp_gauss ( int level, int growth )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEVEL_TO_ORDER_EXP_GAUSS is used for Gauss type rules.
+//
+//  Discussion:
+//
+//    Rules of this type are assumed to be open (not including either endpoint),
+//    and having a precision behavior typical of Gauss rules, namely, the
+//    ORDER-point rule is exact for polynomials of degree less than 2 * ORDER.
+//
+//    LEVEL  ORDER  ORDER  ORDER
+//           G = 0  G = 1  G = 2
+//
+//        0      1      1      1
+//        1      3      3      3
+//        2      3      7      7
+//        3      7      7     15
+//        4      7     15     31
+//        5      7     15     63
+//        6      7     15    127
+//        7     15     15    255
+//        8     15     31    511
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    31 December 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int LEVEL, the level of the rule.
+//
+//    Input, int GROWTH, the growth policy:
+//    0, slow growth;
+//    1, moderate growth;
+//    2, full growth.
+//
+//    Output, int LEVEL_TO_ORDER_EXP_GAUSS, the order of the rule.
+//
+{
+  int o;
+//
+//  Slow exponential growth.
+//
+  if ( growth == 0 )
+  {
+    if ( level == 0 )
+    {
+      o = 1;
+    }
+    else
+    {
+      o = 1;
+      while ( 2 * o - 1 < 2 * level + 1 )
+      {
+        o = 2 * o + 1;
+      }
+    }
+  }
+//
+//  Moderate Exponential Growth.
+//
+  else if ( growth == 1 )
+  {
+    if ( level == 0 )
+    {
+      o = 1;
+    }
+    else
+    {
+      o = 1;
+      while ( 2 * o - 1 < 4 * level + 1 )
+      {
+        o = 2 * o + 1;
+      }
+    }
+  }
+//
+//  Full Exponential Growth.
+//
+  else if ( growth == 2 )
+  {
+    if ( level == 0 )
+    {
+      o = 1;
+    }
+    else
+    {
+      o = webbur::i4_power ( 2, level + 1 ) - 1;
+    }
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "LEVEL_TO_ORDER_EXP_GAUSS - Fatal error!\n";
+    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
+    std::exit ( 1 );
+  }
+
+  return o;
+}
+//****************************************************************************80
+
+int level_to_order_exp_gp ( int level, int growth )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEVEL_TO_ORDER_EXP_GP is used for Gauss-Patterson type rules.
+//
+//  Discussion:
+//
+//    Rules of this type are assumed to be open (not including either endpoint)
+//    and having a precision behavior typical of Gauss Patterson rules.
+//
+//    Note that there are onlly 9 rules in the family, and so it is possible to
+//    specify input for which the function will fail.
+//
+//    LEVEL  ORDER  ORDER  ORDER
+//           G = 0  G = 1  G = 2
+//
+//        0      1      1      1
+//        1      3      3      3
+//        2      3      7      7
+//        3      7     15     15
+//        4      7     15     31
+//        5      7     15     63
+//        6     15     31    127
+//        7     15     31    255
+//        8     15     31    511
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    31 December 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int LEVEL, the level of the rule.
+//
+//    Input, int GROWTH, the growth policy:
+//    0, slow growth;
+//    1, moderate growth;
+//    2, full growth.
+//
+//    Output, int LEVEL_TO_ORDER_EXP_GP, the order of the rule.
+//
+{
+  int o;
+  int p;
+//
+//  Slow exponential growth.
+//
+  if ( growth == 0 )
+  {
+    if ( level == 0 )
+    {
+      o = 1;
+    }
+    else
+    {
+      p = 5;
+      o = 3;
+      while ( p < 2 * level + 1 )
+      {
+        p = 2 * p + 1;
+        o = 2 * o + 1;
+        if ( 511 < o )
+        {
+          std::cerr << "\n";
+          std::cerr << "LEVEL_TO_ORDER_EXP_GP - Fatal error!\n";
+          std::cerr << "  Request for unavailable Patterson rule.\n";
+          std::exit ( 1 );
+        }
+      }
+    }
+  }
+//
+//  Moderate Exponential Growth.
+//
+  else if ( growth == 1 )
+  {
+    if ( level == 0 )
+    {
+      o = 1;
+    }
+    else
+    {
+      p = 5;
+      o = 3;
+      while ( p < 4 * level + 1 )
+      {
+        p = 2 * p + 1;
+        o = 2 * o + 1;
+        if ( 511 < o )
+        {
+          std::cerr << "\n";
+          std::cerr << "LEVEL_TO_ORDER_EXP_GP - Fatal error!\n";
+          std::cerr << "  Request for unavailable Patterson rule.\n";
+          std::exit ( 1 );
+        }
+      }
+    }
+  }
+//
+//  Full Exponential Growth.
+//
+  else if ( growth == 2 )
+  {
+    if ( level == 0 )
+    {
+      o = 1;
+    }
+    else
+    {
+      o = webbur::i4_power ( 2, level + 1 ) - 1;
+      if ( 511 < o )
+      {
+        std::cerr << "\n";
+        std::cerr << "LEVEL_TO_ORDER_EXP_GP - Fatal error!\n";
+        std::cerr << "  Request for unavailable Patterson rule.\n";
+        std::exit ( 1 );
+      }
+    }
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "LEVEL_TO_ORDER_EXP_GP - Fatal error!\n";
+    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
+    std::exit ( 1 );
+  }
+
+  return o;
+}
+//****************************************************************************80
+
+int level_to_order_exp_hgk ( int level, int growth )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEVEL_TO_ORDER_EXP_HGK is used for Hermite Genz-Keister type rules.
+//
+//  Discussion:
+//
+//    Rules of this type are assumed to be open (not including either endpoint)
+//    and having a precision behavior typical of Hermite Genz-Keister rules.
+//
+//    Note that there are only 6 rules in the family, and so it is possible to
+//    specify input for which the function will fail.
+//
+//    LEVEL  ORDER  ORDER  ORDER
+//           G = 0  G = 1  G = 2
+//
+//        0      1      1      1
+//        1      3      3      3
+//        2      3      9      9
+//        3      9      9     19
+//        4      9     19     35
+//        5      9     19     43
+//        6      9     19     --
+//        7      9     19     --
+//        8     19     35     --
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    31 December 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int LEVEL, the level of the rule.
+//
+//    Input, int GROWTH, the growth policy:
+//    0, slow growth;
+//    1, moderate growth;
+//    2, full growth.
+//
+//    Output, int LEVEL_TO_ORDER_EXP_HGK, the order of the rule.
+//
+{
+  int l;
+  int o;
+  static int o_hgk[6] = { 1, 3, 9, 19, 35, 43 };
+  int p;
+  static int p_hgk[6] = { 1, 5, 15, 29, 51, 67 };
+//
+//  Slow exponential growth.
+//
+  if ( growth == 0 )
+  {
+    l = 0;
+    p = p_hgk[l];
+    o = o_hgk[l];
+    while ( p < 2 * level + 1 )
+    {
+      l = l + 1;
+      if ( 5 < l )
+      {
+        std::cerr << "\n";
+        std::cerr << "LEVEL_TO_ORDER_EXP_HGK - Fatal error!\n";
+        std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
+        std::exit ( 1 );
+      }
+      p = p_hgk[l];
+      o = o_hgk[l];
+    }
+  }
+  else if ( growth == 1 )
+  {
+    l = 0;
+    p = p_hgk[l];
+    o = o_hgk[l];
+    while ( p < 4 * level + 1 )
+    {
+      l = l + 1;
+      if ( 5 < l )
+      {
+        std::cerr << "\n";
+        std::cerr << "LEVEL_TO_ORDER_EXP_HGK - Fatal error!\n";
+        std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
+        std::exit ( 1 );
+      }
+      p = p_hgk[l];
+      o = o_hgk[l];
+    }
+  }
+  else if ( growth == 2 )
+  {
+    l = level;
+    l = webbur::i4_max ( l, 0 );
+    if ( 5 < l )
+    {
+      std::cerr << "\n";
+      std::cerr << "LEVEL_TO_ORDER_EXP_HGK - Fatal error!\n";
+      std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
+      std::exit ( 1 );
+    }
+    o = o_hgk[l];
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "LEVEL_TO_ORDER_EXP_HGK - Fatal error!\n";
+    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
+    std::exit ( 1 );
+  }
+
+  return o;
+}
+//****************************************************************************80
+
+int level_to_order_linear_nn ( int level, int growth )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEVEL_TO_ORDER_LINEAR_NN is used for non-nested Gauss type rules.
+//
+//  Discussion:
+//
+//    Rules of this type are assumed to be open (not including either endpoint),
+//    non-nested, and having a precision behavior typical of Gauss rules.
+//
+//    LEVEL  ORDER  ORDER
+//           G = 0  G = 1
+//
+//        0      1      1
+//        1      2      3
+//        2      3      5
+//        3      4      7
+//        4      5      9
+//        5      6     11
+//        6      7     13
+//        7      8     15
+//        8      9     17
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    31 December 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int LEVEL, the level of the rule.
+//
+//    Input, int GROWTH, the growth policy:
+//    0, slow growth;
+//    1, moderate growth;
+//
+//    Output, int LEVEL_TO_ORDER_LINEAR_NN, the order of the rule.
+//
+{
+  int o;
+//
+//  Slow linear growth.
+//
+  if ( growth == 0 )
+  {
+    o = level + 1;
+  }
+//
+//  Moderate linear growth.
+//
+  else if ( growth == 1 )
+  {
+    o = 2 * level + 1;
+  }
+  else if ( growth == 2 )
+  {
+    o = 2 * level + 1;
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "LEVEL_TO_ORDER_LINEAR_NN - Fatal error!\n";
+    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
+    std::exit ( 1 );
+  }
+  return o;
+}
+//****************************************************************************80
+
+int level_to_order_linear_wn ( int level, int growth )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    LEVEL_TO_ORDER_LINEAR_WN is used for weakly-nested Gauss type rules.
+//
+//  Discussion:
+//
+//    Rules of this type are assumed to be open (not including either endpoint),
+//    nested, and having a precision behavior typical of Gauss rules.
+//
+//    We assume the rules are to be generated with an odd number of points,
+//    and that all the rules will share a single point, namely 0.
+//
+//    Note that the "moderate growth" option for this function results in the
+//    same values as the moderate growth option for LEVEL_TO_ORDER_LINEAR_NN.
+//
+//    LEVEL  ORDER  ORDER
+//           G = 0  G = 1
+//
+//        0      1      1
+//        1      3      3
+//        2      3      5
+//        3      5      7
+//        4      5      9
+//        5      7     11
+//        6      7     13
+//        7      9     15
+//        8      9     17
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    31 December 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int LEVEL, the level of the rule.
+//
+//    Input, int GROWTH, the growth policy:
+//    0, slow growth;
+//    1, moderate growth;
+//
+//    Output, int LEVEL_TO_ORDER_LINEAR_WN, the order of the rule.
+//
+{
+  int o;
+//
+//  Slow growth.
+//
+  if ( growth == 0 )
+  {
+    o = 2 * ( ( level + 1 ) / 2 ) + 1;
+  }
+  else if ( growth == 1 )
+  {
+    o = 2 * level + 1;
+  }
+  else if ( growth == 2 )
+  {
+    o = 2 * level + 1;
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "LEVEL_TO_ORDER_LINEAR_WN - Fatal error!\n";
+    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
+    std::exit ( 1 );
+  }
+  return o;
+}
+//****************************************************************************80
+
+void nc_compute ( int n, double x_min, double x_max, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    NC_COMPUTE computes a Newton-Cotes quadrature rule.
+//
+//  Discussion:
+//
+//    For the interval [X_MIN,X_MAX], the Newton-Cotes quadrature rule
+//    estimates
+//
+//      Integral ( X_MIN <= X <= X_MAX ) F(X) dX
+//
+//    using N abscissas X and weights W:
+//
+//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) ).
+//
+//    For the CLOSED rule, the abscissas include the end points.
+//    For the OPEN rule, the abscissas do not include the end points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    17 November 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, double X_MIN, X_MAX, the endpoints of the interval.
+//
+//    Input, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  double *d;
+  int i;
+  int j;
+  int k;
+  double yvala;
+  double yvalb;
+
+  d = new double[n];
+
+  for ( i = 0; i < n; i++ )
+  {
+//
+//  Compute the Lagrange basis polynomial which is 1 at XTAB(I),
+//  and zero at the other nodes.
+//
+    for ( j = 0; j < n; j++ )
+    {
+      d[j] = 0.0;
+    }
+    d[i] = 1.0;
+
+    for ( j = 2; j <= n; j++ )
+    {
+      for ( k = j; k <= n; k++ )
+      {
+        d[n+j-k-1] = ( d[n+j-k-1-1] - d[n+j-k-1] ) / ( x[n+1-k-1] - x[n+j-k-1] );
+      }
+    }
+
+    for ( j = 1; j <= n - 1; j++ )
+    {
+      for ( k = 1; k <= n - j; k++ )
+      {
+        d[n-k-1] = d[n-k-1] - x[n-k-j] * d[n-k];
+      }
+    }
+//
+//  Evaluate the antiderivative of the polynomial at the left and
+//  right endpoints.
+//
+    yvala = d[n-1] / ( double ) ( n );
+    for ( j = n - 2; 0 <= j; j-- )
+    {
+      yvala = yvala * x_min + d[j] / ( double ) ( j + 1 );
+    }
+    yvala = yvala * x_min;
+
+    yvalb = d[n-1] / ( double ) ( n );
+    for ( j = n - 2; 0 <= j; j-- )
+    {
+      yvalb = yvalb * x_max + d[j] / ( double ) ( j + 1 );
+    }
+    yvalb = yvalb * x_max;
+
+    w[i] = yvalb - yvala;
+  }
+
+  delete [] d;
+
+  return;
+}
+//****************************************************************************80
+
+double *nc_compute_new ( int n, double x_min, double x_max, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    NC_COMPUTE_NEW computes a Newton-Cotes quadrature rule.
+//
+//  Discussion:
+//
+//    For the interval [X_MIN,X_MAX], the Newton-Cotes quadrature rule
+//    estimates
+//
+//      Integral ( X_MIN <= X <= X_MAX ) F(X) dX
+//
+//    using N abscissas X and weights W:
+//
+//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) ).
+//
+//    For the CLOSED rule, the abscissas include the end points.
+//    For the OPEN rule, the abscissas do not include the end points.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    17 November 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Input, double X_MIN, X_MAX, the endpoints of the interval.
+//
+//    Input, double X[N], the abscissas.
+//
+//    Output, double NC_COMPUTE_NEW[N], the weights.
+//
+{
+  double *d;
+  int i;
+  int j;
+  int k;
+  double *w;
+  double yvala;
+  double yvalb;
+
+  d = new double[n];
+  w = new double[n];
+
+  for ( i = 0; i < n; i++ )
+  {
+//
+//  Compute the Lagrange basis polynomial which is 1 at XTAB(I),
+//  and zero at the other nodes.
+//
+    for ( j = 0; j < n; j++ )
+    {
+      d[j] = 0.0;
+    }
+    d[i] = 1.0;
+
+    for ( j = 2; j <= n; j++ )
+    {
+      for ( k = j; k <= n; k++ )
+      {
+        d[n+j-k-1] = ( d[n+j-k-1-1] - d[n+j-k-1] ) / ( x[n+1-k-1] - x[n+j-k-1] );
+      }
+    }
+
+    for ( j = 1; j <= n - 1; j++ )
+    {
+      for ( k = 1; k <= n - j; k++ )
+      {
+        d[n-k-1] = d[n-k-1] - x[n-k-j] * d[n-k];
+      }
+    }
+//
+//  Evaluate the antiderivative of the polynomial at the left and
+//  right endpoints.
+//
+    yvala = d[n-1] / ( double ) ( n );
+    for ( j = n - 2; 0 <= j; j-- )
+    {
+      yvala = yvala * x_min + d[j] / ( double ) ( j + 1 );
+    }
+    yvala = yvala * x_min;
+
+    yvalb = d[n-1] / ( double ) ( n );
+    for ( j = n - 2; 0 <= j; j-- )
+    {
+      yvalb = yvalb * x_max + d[j] / ( double ) ( j + 1 );
+    }
+    yvalb = yvalb * x_max;
+
+    w[i] = yvalb - yvala;
+  }
+
+  delete [] d;
+
+  return w;
+}
+//****************************************************************************80
+
+void ncc_compute_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    NCC_COMPUTE_POINTS: points of a Newton-Cotes Closed quadrature rule.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    16 November 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  int i;
+  double x_max = 1.0;
+  double x_min = -1.0;
+
+  if ( n == 1 )
+  {
+    x[0] = ( x_max + x_min ) / 2.0;
+  }
+  else
+  {
+    for ( i = 0; i < n; i++ )
+    {
+      x[i] = ( ( double ) ( n - i - 1 ) * x_min
+             + ( double ) (     i     ) * x_max )
+             / ( double ) ( n     - 1 );
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void ncc_compute_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    NCC_COMPUTE_WEIGHTS: weights of a Newton-Cotes Closed quadrature rule.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    16 November 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double W[N], the weights.
+//
+{
+  int i;
+  double *x;
+  double x_max = 1.0;
+  double x_min = -1.0;
+
+  if ( n == 1 )
+  {
+    w[0] = x_max - x_min;
+  }
+  else
+  {
+    x = new double[n];
+
+    for ( i = 0; i < n; i++ )
+    {
+      x[i] = ( ( double ) ( n - i - 1 ) * x_min
+             + ( double ) (     i     ) * x_max )
+             / ( double ) ( n     - 1 );
+    }
+    webbur::nc_compute ( n, x_min, x_max, x, w );
+
+    delete [] x;
+  }
+  return;
+}
+//****************************************************************************80
+
+void nco_compute_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    NCO_COMPUTE_POINTS: points for a Newton-Cotes Open quadrature rule.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    17 November 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  int i;
+  double x_max = 1.0;
+  double x_min = -1.0;
+
+  for ( i = 0; i < n; i++ )
+  {
+    x[i] = ( ( double ) ( n - i     ) * x_min
+           + ( double ) (   + i + 1 ) * x_max )
+           / ( double ) ( n     + 1 );
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void nco_compute_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    NCO_COMPUTE_WEIGHTS: weights for a Newton-Cotes Open quadrature rule.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    17 November 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double W[N], the weights.
+//
+{
+  int i;
+  double *x;
+  double x_max = 1.0;
+  double x_min = -1.0;
+
+  x = new double[n];
+
+  webbur::nco_compute_points ( n, x );
+
+  webbur::nc_compute ( n, x_min, x_max, x, w );
+
+  delete [] x;
+
+  return;
+}
+//****************************************************************************80
+
+void ncoh_compute_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    NCOH_COMPUTE_POINTS computes points for a Newton-Cotes "open half" quadrature rule.
+//
+//  Discussion:
+//
+//    The input value N is used to define N equal subintervals of [-1,+1].
+//    The I-th abscissa is the center of the I-th subinterval.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    03 July 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  int i;
+  const double x_max = 1.0;
+  const double x_min = -1.0;
+
+  for ( i = 0; i < n; i++ )
+  {
+    x[i] = ( ( double ) ( 2 * n - 2 * i - 1 ) * x_min
+           + ( double ) (         2 * i + 1 ) * x_max )
+           / ( double ) ( 2 * n             );
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void ncoh_compute_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    NCOH_COMPUTE_WEIGHTS computes weights for a Newton-Cotes "open half" quadrature rule.
+//
+//  Discussion:
+//
+//    The input value N is used to define N equal subintervals of [-1,+1].
+//    The I-th abscissa is the center of the I-th subinterval.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    03 July 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//
+//    Output, double W[N], the weights.
+//
+{
+  int i;
+  double *x;
+  const double x_max = 1.0;
+  const double x_min = -1.0;
+
+  x = new double[n];
+
+  webbur::ncoh_compute_points ( n, x );
+
+  webbur::nc_compute ( n, x_min, x_max, x, w );
+
+  delete [] x;
+
+  return;
+}
+//****************************************************************************80
+
+void patterson_lookup ( int n, double x[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    PATTERSON_LOOKUP looks up Patterson quadrature points and weights.
+//
+//  Discussion:
+//
+//    Our convention is that the abscissas are numbered from left to right.
+//
+//    The rule is defined on [-1,1],
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    11 February 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Prem Kythe, Michael Schaeferkotter,
+//    Handbook of Computational Methods for Integration,
+//    Chapman and Hall, 2004,
+//    ISBN: 1-58488-428-2,
+//    LC: QA299.3.K98.
+//
+//    Thomas Patterson,
+//    The Optimal Addition of Points to Quadrature Formulae,
+//    Mathematics of Computation,
+//    Volume 22, Number 104, October 1968, pages 847-856.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
+//
+//    Output, double X[N], the abscissas.
+//
+//    Output, double W[N], the weights.
+//
+{
+  patterson_lookup_points ( n, x );
+  patterson_lookup_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+void patterson_lookup_points ( int n, double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    PATTERSON_LOOKUP_POINTS looks up Patterson quadrature points.
+//
+//  Discussion:
+//
+//    Our convention is that the abscissas are numbered from left to right.
+//
+//    The rule is defined on [-1,1],
+//
+//    These rules constitute a nested family.  The rules can integrate exactly
+//    any polynomial of degree 1, 5, 11, 23, 47, 95, 191, 383 or 767,
+//    respectively.
+//
+//    The data for N = 511 was supplied by Dirk Laurie, and is derived
+//    from a NAG Library function d01arf.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    14 September 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Prem Kythe, Michael Schaeferkotter,
+//    Handbook of Computational Methods for Integration,
+//    Chapman and Hall, 2004,
+//    ISBN: 1-58488-428-2,
+//    LC: QA299.3.K98.
+//
+//    NAG Library Documentation,
+//    D01ARF,
+//    The Numerical Algorithms Group.
+//
+//    Thomas Patterson,
+//    The Optimal Addition of Points to Quadrature Formulae,
+//    Mathematics of Computation,
+//    Volume 22, Number 104, October 1968, pages 847-856.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  static double x_001[1] =
+  {
+     0.0
+  };
+  static double x_003[3] =
+  {
+    -0.77459666924148337704,
+     0.0,
+     0.77459666924148337704
+  };
+  static double x_007[7] =
+  {
+    -0.96049126870802028342,
+    -0.77459666924148337704,
+    -0.43424374934680255800,
+     0.0,
+     0.43424374934680255800,
+     0.77459666924148337704,
+     0.96049126870802028342
+  };
+  static double x_015[15] =
+  {
+    -0.99383196321275502221,
+    -0.96049126870802028342,
+    -0.88845923287225699889,
+    -0.77459666924148337704,
+    -0.62110294673722640294,
+    -0.43424374934680255800,
+    -0.22338668642896688163,
+     0.0,
+     0.22338668642896688163,
+     0.43424374934680255800,
+     0.62110294673722640294,
+     0.77459666924148337704,
+     0.88845923287225699889,
+     0.96049126870802028342,
+     0.99383196321275502221
+  };
+  static double x_031[31] =
+  {
+    -0.99909812496766759766,
+    -0.99383196321275502221,
+    -0.98153114955374010687,
+    -0.96049126870802028342,
+    -0.92965485742974005667,
+    -0.88845923287225699889,
+    -0.83672593816886873550,
+    -0.77459666924148337704,
+    -0.70249620649152707861,
+    -0.62110294673722640294,
+    -0.53131974364437562397,
+    -0.43424374934680255800,
+    -0.33113539325797683309,
+    -0.22338668642896688163,
+    -0.11248894313318662575,
+     0.0,
+     0.11248894313318662575,
+     0.22338668642896688163,
+     0.33113539325797683309,
+     0.43424374934680255800,
+     0.53131974364437562397,
+     0.62110294673722640294,
+     0.70249620649152707861,
+     0.77459666924148337704,
+     0.83672593816886873550,
+     0.88845923287225699889,
+     0.92965485742974005667,
+     0.96049126870802028342,
+     0.98153114955374010687,
+     0.99383196321275502221,
+     0.99909812496766759766
+  };
+  static double x_063[63] =
+  {
+    -0.99987288812035761194,
+    -0.99909812496766759766,
+    -0.99720625937222195908,
+    -0.99383196321275502221,
+    -0.98868475754742947994,
+    -0.98153114955374010687,
+    -0.97218287474858179658,
+    -0.96049126870802028342,
+    -0.94634285837340290515,
+    -0.92965485742974005667,
+    -0.91037115695700429250,
+    -0.88845923287225699889,
+    -0.86390793819369047715,
+    -0.83672593816886873550,
+    -0.80694053195021761186,
+    -0.77459666924148337704,
+    -0.73975604435269475868,
+    -0.70249620649152707861,
+    -0.66290966002478059546,
+    -0.62110294673722640294,
+    -0.57719571005204581484,
+    -0.53131974364437562397,
+    -0.48361802694584102756,
+    -0.43424374934680255800,
+    -0.38335932419873034692,
+    -0.33113539325797683309,
+    -0.27774982202182431507,
+    -0.22338668642896688163,
+    -0.16823525155220746498,
+    -0.11248894313318662575,
+    -0.056344313046592789972,
+     0.0,
+     0.056344313046592789972,
+     0.11248894313318662575,
+     0.16823525155220746498,
+     0.22338668642896688163,
+     0.27774982202182431507,
+     0.33113539325797683309,
+     0.38335932419873034692,
+     0.43424374934680255800,
+     0.48361802694584102756,
+     0.53131974364437562397,
+     0.57719571005204581484,
+     0.62110294673722640294,
+     0.66290966002478059546,
+     0.70249620649152707861,
+     0.73975604435269475868,
+     0.77459666924148337704,
+     0.80694053195021761186,
+     0.83672593816886873550,
+     0.86390793819369047715,
+     0.88845923287225699889,
+     0.91037115695700429250,
+     0.92965485742974005667,
+     0.94634285837340290515,
+     0.96049126870802028342,
+     0.97218287474858179658,
+     0.98153114955374010687,
+     0.98868475754742947994,
+     0.99383196321275502221,
+     0.99720625937222195908,
+     0.99909812496766759766,
+     0.99987288812035761194
+  };
+  static double x_127[127] =
+  {
+    -0.99998243035489159858,
+    -0.99987288812035761194,
+    -0.99959879967191068325,
+    -0.99909812496766759766,
+    -0.99831663531840739253,
+    -0.99720625937222195908,
+    -0.99572410469840718851,
+    -0.99383196321275502221,
+    -0.99149572117810613240,
+    -0.98868475754742947994,
+    -0.98537149959852037111,
+    -0.98153114955374010687,
+    -0.97714151463970571416,
+    -0.97218287474858179658,
+    -0.96663785155841656709,
+    -0.96049126870802028342,
+    -0.95373000642576113641,
+    -0.94634285837340290515,
+    -0.93832039777959288365,
+    -0.92965485742974005667,
+    -0.92034002547001242073,
+    -0.91037115695700429250,
+    -0.89974489977694003664,
+    -0.88845923287225699889,
+    -0.87651341448470526974,
+    -0.86390793819369047715,
+    -0.85064449476835027976,
+    -0.83672593816886873550,
+    -0.82215625436498040737,
+    -0.80694053195021761186,
+    -0.79108493379984836143,
+    -0.77459666924148337704,
+    -0.75748396638051363793,
+    -0.73975604435269475868,
+    -0.72142308537009891548,
+    -0.70249620649152707861,
+    -0.68298743109107922809,
+    -0.66290966002478059546,
+    -0.64227664250975951377,
+    -0.62110294673722640294,
+    -0.59940393024224289297,
+    -0.57719571005204581484,
+    -0.55449513263193254887,
+    -0.53131974364437562397,
+    -0.50768775753371660215,
+    -0.48361802694584102756,
+    -0.45913001198983233287,
+    -0.43424374934680255800,
+    -0.40897982122988867241,
+    -0.38335932419873034692,
+    -0.35740383783153215238,
+    -0.33113539325797683309,
+    -0.30457644155671404334,
+    -0.27774982202182431507,
+    -0.25067873030348317661,
+    -0.22338668642896688163,
+    -0.19589750271110015392,
+    -0.16823525155220746498,
+    -0.14042423315256017459,
+    -0.11248894313318662575,
+    -0.084454040083710883710,
+    -0.056344313046592789972,
+    -0.028184648949745694339,
+     0.0,
+     0.028184648949745694339,
+     0.056344313046592789972,
+     0.084454040083710883710,
+     0.11248894313318662575,
+     0.14042423315256017459,
+     0.16823525155220746498,
+     0.19589750271110015392,
+     0.22338668642896688163,
+     0.25067873030348317661,
+     0.27774982202182431507,
+     0.30457644155671404334,
+     0.33113539325797683309,
+     0.35740383783153215238,
+     0.38335932419873034692,
+     0.40897982122988867241,
+     0.43424374934680255800,
+     0.45913001198983233287,
+     0.48361802694584102756,
+     0.50768775753371660215,
+     0.53131974364437562397,
+     0.55449513263193254887,
+     0.57719571005204581484,
+     0.59940393024224289297,
+     0.62110294673722640294,
+     0.64227664250975951377,
+     0.66290966002478059546,
+     0.68298743109107922809,
+     0.70249620649152707861,
+     0.72142308537009891548,
+     0.73975604435269475868,
+     0.75748396638051363793,
+     0.77459666924148337704,
+     0.79108493379984836143,
+     0.80694053195021761186,
+     0.82215625436498040737,
+     0.83672593816886873550,
+     0.85064449476835027976,
+     0.86390793819369047715,
+     0.87651341448470526974,
+     0.88845923287225699889,
+     0.89974489977694003664,
+     0.91037115695700429250,
+     0.92034002547001242073,
+     0.92965485742974005667,
+     0.93832039777959288365,
+     0.94634285837340290515,
+     0.95373000642576113641,
+     0.96049126870802028342,
+     0.96663785155841656709,
+     0.97218287474858179658,
+     0.97714151463970571416,
+     0.98153114955374010687,
+     0.98537149959852037111,
+     0.98868475754742947994,
+     0.99149572117810613240,
+     0.99383196321275502221,
+     0.99572410469840718851,
+     0.99720625937222195908,
+     0.99831663531840739253,
+     0.99909812496766759766,
+     0.99959879967191068325,
+     0.99987288812035761194,
+     0.99998243035489159858
+  };
+  static double x_255[255] =
+  {
+    -0.99999759637974846462,
+    -0.99998243035489159858,
+    -0.99994399620705437576,
+    -0.99987288812035761194,
+    -0.99976049092443204733,
+    -0.99959879967191068325,
+    -0.99938033802502358193,
+    -0.99909812496766759766,
+    -0.99874561446809511470,
+    -0.99831663531840739253,
+    -0.99780535449595727456,
+    -0.99720625937222195908,
+    -0.99651414591489027385,
+    -0.99572410469840718851,
+    -0.99483150280062100052,
+    -0.99383196321275502221,
+    -0.99272134428278861533,
+    -0.99149572117810613240,
+    -0.99015137040077015918,
+    -0.98868475754742947994,
+    -0.98709252795403406719,
+    -0.98537149959852037111,
+    -0.98351865757863272876,
+    -0.98153114955374010687,
+    -0.97940628167086268381,
+    -0.97714151463970571416,
+    -0.97473445975240266776,
+    -0.97218287474858179658,
+    -0.96948465950245923177,
+    -0.96663785155841656709,
+    -0.96364062156981213252,
+    -0.96049126870802028342,
+    -0.95718821610986096274,
+    -0.95373000642576113641,
+    -0.95011529752129487656,
+    -0.94634285837340290515,
+    -0.94241156519108305981,
+    -0.93832039777959288365,
+    -0.93406843615772578800,
+    -0.92965485742974005667,
+    -0.92507893290707565236,
+    -0.92034002547001242073,
+    -0.91543758715576504064,
+    -0.91037115695700429250,
+    -0.90514035881326159519,
+    -0.89974489977694003664,
+    -0.89418456833555902286,
+    -0.88845923287225699889,
+    -0.88256884024734190684,
+    -0.87651341448470526974,
+    -0.87029305554811390585,
+    -0.86390793819369047715,
+    -0.85735831088623215653,
+    -0.85064449476835027976,
+    -0.84376688267270860104,
+    -0.83672593816886873550,
+    -0.82952219463740140018,
+    -0.82215625436498040737,
+    -0.81462878765513741344,
+    -0.80694053195021761186,
+    -0.79909229096084140180,
+    -0.79108493379984836143,
+    -0.78291939411828301639,
+    -0.77459666924148337704,
+    -0.76611781930376009072,
+    -0.75748396638051363793,
+    -0.74869629361693660282,
+    -0.73975604435269475868,
+    -0.73066452124218126133,
+    -0.72142308537009891548,
+    -0.71203315536225203459,
+    -0.70249620649152707861,
+    -0.69281376977911470289,
+    -0.68298743109107922809,
+    -0.67301883023041847920,
+    -0.66290966002478059546,
+    -0.65266166541001749610,
+    -0.64227664250975951377,
+    -0.63175643771119423041,
+    -0.62110294673722640294,
+    -0.61031811371518640016,
+    -0.59940393024224289297,
+    -0.58836243444766254143,
+    -0.57719571005204581484,
+    -0.56590588542365442262,
+    -0.55449513263193254887,
+    -0.54296566649831149049,
+    -0.53131974364437562397,
+    -0.51955966153745702199,
+    -0.50768775753371660215,
+    -0.49570640791876146017,
+    -0.48361802694584102756,
+    -0.47142506587165887693,
+    -0.45913001198983233287,
+    -0.44673538766202847374,
+    -0.43424374934680255800,
+    -0.42165768662616330006,
+    -0.40897982122988867241,
+    -0.39621280605761593918,
+    -0.38335932419873034692,
+    -0.37042208795007823014,
+    -0.35740383783153215238,
+    -0.34430734159943802278,
+    -0.33113539325797683309,
+    -0.31789081206847668318,
+    -0.30457644155671404334,
+    -0.29119514851824668196,
+    -0.27774982202182431507,
+    -0.26424337241092676194,
+    -0.25067873030348317661,
+    -0.23705884558982972721,
+    -0.22338668642896688163,
+    -0.20966523824318119477,
+    -0.19589750271110015392,
+    -0.18208649675925219825,
+    -0.16823525155220746498,
+    -0.15434681148137810869,
+    -0.14042423315256017459,
+    -0.12647058437230196685,
+    -0.11248894313318662575,
+    -0.098482396598119202090,
+    -0.084454040083710883710,
+    -0.070406976042855179063,
+    -0.056344313046592789972,
+    -0.042269164765363603212,
+    -0.028184648949745694339,
+    -0.014093886410782462614,
+    0.0,
+    0.014093886410782462614,
+    0.028184648949745694339,
+    0.042269164765363603212,
+    0.056344313046592789972,
+    0.070406976042855179063,
+    0.084454040083710883710,
+    0.098482396598119202090,
+    0.11248894313318662575,
+    0.12647058437230196685,
+    0.14042423315256017459,
+    0.15434681148137810869,
+    0.16823525155220746498,
+    0.18208649675925219825,
+    0.19589750271110015392,
+    0.20966523824318119477,
+    0.22338668642896688163,
+    0.23705884558982972721,
+    0.25067873030348317661,
+    0.26424337241092676194,
+    0.27774982202182431507,
+    0.29119514851824668196,
+    0.30457644155671404334,
+    0.31789081206847668318,
+    0.33113539325797683309,
+    0.34430734159943802278,
+    0.35740383783153215238,
+    0.37042208795007823014,
+    0.38335932419873034692,
+    0.39621280605761593918,
+    0.40897982122988867241,
+    0.42165768662616330006,
+    0.43424374934680255800,
+    0.44673538766202847374,
+    0.45913001198983233287,
+    0.47142506587165887693,
+    0.48361802694584102756,
+    0.49570640791876146017,
+    0.50768775753371660215,
+    0.51955966153745702199,
+    0.53131974364437562397,
+    0.54296566649831149049,
+    0.55449513263193254887,
+    0.56590588542365442262,
+    0.57719571005204581484,
+    0.58836243444766254143,
+    0.59940393024224289297,
+    0.61031811371518640016,
+    0.62110294673722640294,
+    0.63175643771119423041,
+    0.64227664250975951377,
+    0.65266166541001749610,
+    0.66290966002478059546,
+    0.67301883023041847920,
+    0.68298743109107922809,
+    0.69281376977911470289,
+    0.70249620649152707861,
+    0.71203315536225203459,
+    0.72142308537009891548,
+    0.73066452124218126133,
+    0.73975604435269475868,
+    0.74869629361693660282,
+    0.75748396638051363793,
+    0.76611781930376009072,
+    0.77459666924148337704,
+    0.78291939411828301639,
+    0.79108493379984836143,
+    0.79909229096084140180,
+    0.80694053195021761186,
+    0.81462878765513741344,
+    0.82215625436498040737,
+    0.82952219463740140018,
+    0.83672593816886873550,
+    0.84376688267270860104,
+    0.85064449476835027976,
+    0.85735831088623215653,
+    0.86390793819369047715,
+    0.87029305554811390585,
+    0.87651341448470526974,
+    0.88256884024734190684,
+    0.88845923287225699889,
+    0.89418456833555902286,
+    0.89974489977694003664,
+    0.90514035881326159519,
+    0.91037115695700429250,
+    0.91543758715576504064,
+    0.92034002547001242073,
+    0.92507893290707565236,
+    0.92965485742974005667,
+    0.93406843615772578800,
+    0.93832039777959288365,
+    0.94241156519108305981,
+    0.94634285837340290515,
+    0.95011529752129487656,
+    0.95373000642576113641,
+    0.95718821610986096274,
+    0.96049126870802028342,
+    0.96364062156981213252,
+    0.96663785155841656709,
+    0.96948465950245923177,
+    0.97218287474858179658,
+    0.97473445975240266776,
+    0.97714151463970571416,
+    0.97940628167086268381,
+    0.98153114955374010687,
+    0.98351865757863272876,
+    0.98537149959852037111,
+    0.98709252795403406719,
+    0.98868475754742947994,
+    0.99015137040077015918,
+    0.99149572117810613240,
+    0.99272134428278861533,
+    0.99383196321275502221,
+    0.99483150280062100052,
+    0.99572410469840718851,
+    0.99651414591489027385,
+    0.99720625937222195908,
+    0.99780535449595727456,
+    0.99831663531840739253,
+    0.99874561446809511470,
+    0.99909812496766759766,
+    0.99938033802502358193,
+    0.99959879967191068325,
+    0.99976049092443204733,
+    0.99987288812035761194,
+    0.99994399620705437576,
+    0.99998243035489159858,
+    0.99999759637974846462
+  };
+  static double x_511[511] =
+  {
+    -0.999999672956734384381,
+    -0.999997596379748464620,
+    -0.999992298136257588028,
+    -0.999982430354891598580,
+    -0.999966730098486276883,
+    -0.999943996207054375764,
+    -0.999913081144678282800,
+    -0.999872888120357611938,
+    -0.999822363679787739196,
+    -0.999760490924432047330,
+    -0.999686286448317731776,
+    -0.999598799671910683252,
+    -0.999497112467187190535,
+    -0.999380338025023581928,
+    -0.999247618943342473599,
+    -0.999098124967667597662,
+    -0.998931050830810562236,
+    -0.998745614468095114704,
+    -0.998541055697167906027,
+    -0.998316635318407392531,
+    -0.998071634524930323302,
+    -0.997805354495957274562,
+    -0.997517116063472399965,
+    -0.997206259372221959076,
+    -0.996872143485260161299,
+    -0.996514145914890273849,
+    -0.996131662079315037786,
+    -0.995724104698407188509,
+    -0.995290903148810302261,
+    -0.994831502800621000519,
+    -0.994345364356723405931,
+    -0.993831963212755022209,
+    -0.993290788851684966211,
+    -0.992721344282788615328,
+    -0.992123145530863117683,
+    -0.991495721178106132399,
+    -0.990838611958294243677,
+    -0.990151370400770159181,
+    -0.989433560520240838716,
+    -0.988684757547429479939,
+    -0.987904547695124280467,
+    -0.987092527954034067190,
+    -0.986248305913007552681,
+    -0.985371499598520371114,
+    -0.984461737328814534596,
+    -0.983518657578632728762,
+    -0.982541908851080604251,
+    -0.981531149553740106867,
+    -0.980486047876721339416,
+    -0.979406281670862683806,
+    -0.978291538324758539526,
+    -0.977141514639705714156,
+    -0.975955916702011753129,
+    -0.974734459752402667761,
+    -0.973476868052506926773,
+    -0.972182874748581796578,
+    -0.970852221732792443256,
+    -0.969484659502459231771,
+    -0.968079947017759947964,
+    -0.966637851558416567092,
+    -0.965158148579915665979,
+    -0.963640621569812132521,
+    -0.962085061904651475741,
+    -0.960491268708020283423,
+    -0.958859048710200221356,
+    -0.957188216109860962736,
+    -0.955478592438183697574,
+    -0.953730006425761136415,
+    -0.951942293872573589498,
+    -0.950115297521294876558,
+    -0.948248866934137357063,
+    -0.946342858373402905148,
+    -0.944397134685866648591,
+    -0.942411565191083059813,
+    -0.940386025573669721370,
+    -0.938320397779592883655,
+    -0.936214569916450806625,
+    -0.934068436157725787999,
+    -0.931881896650953639345,
+    -0.929654857429740056670,
+    -0.927387230329536696843,
+    -0.925078932907075652364,
+    -0.922729888363349241523,
+    -0.920340025470012420730,
+    -0.917909278499077501636,
+    -0.915437587155765040644,
+    -0.912924896514370590080,
+    -0.910371156957004292498,
+    -0.907776324115058903624,
+    -0.905140358813261595189,
+    -0.902463227016165675048,
+    -0.899744899776940036639,
+    -0.896985353188316590376,
+    -0.894184568335559022859,
+    -0.891342531251319871666,
+    -0.888459232872256998890,
+    -0.885534668997285008926,
+    -0.882568840247341906842,
+    -0.879561752026556262568,
+    -0.876513414484705269742,
+    -0.873423842480859310192,
+    -0.870293055548113905851,
+    -0.867121077859315215614,
+    -0.863907938193690477146,
+    -0.860653669904299969802,
+    -0.857358310886232156525,
+    -0.854021903545468625813,
+    -0.850644494768350279758,
+    -0.847226135891580884381,
+    -0.843766882672708601038,
+    -0.840266795261030442350,
+    -0.836725938168868735503,
+    -0.833144380243172624728,
+    -0.829522194637401400178,
+    -0.825859458783650001088,
+    -0.822156254364980407373,
+    -0.818412667287925807395,
+    -0.814628787655137413436,
+    -0.810804709738146594361,
+    -0.806940531950217611856,
+    -0.803036356819268687782,
+    -0.799092290960841401800,
+    -0.795108445051100526780,
+    -0.791084933799848361435,
+    -0.787021875923539422170,
+    -0.782919394118283016385,
+    -0.778777615032822744702,
+    -0.774596669241483377036,
+    -0.770376691217076824278,
+    -0.766117819303760090717,
+    -0.761820195689839149173,
+    -0.757483966380513637926,
+    -0.753109281170558142523,
+    -0.748696293616936602823,
+    -0.744245161011347082309,
+    -0.739756044352694758677,
+    -0.735229108319491547663,
+    -0.730664521242181261329,
+    -0.726062455075389632685,
+    -0.721423085370098915485,
+    -0.716746591245747095767,
+    -0.712033155362252034587,
+    -0.707282963891961103412,
+    -0.702496206491527078610,
+    -0.697673076273711232906,
+    -0.692813769779114702895,
+    -0.687918486947839325756,
+    -0.682987431091079228087,
+    -0.678020808862644517838,
+    -0.673018830230418479199,
+    -0.667981708447749702165,
+    -0.662909660024780595461,
+    -0.657802904699713735422,
+    -0.652661665410017496101,
+    -0.647486168263572388782,
+    -0.642276642509759513774,
+    -0.637033320510492495071,
+    -0.631756437711194230414,
+    -0.626446232611719746542,
+    -0.621102946737226402941,
+    -0.615726824608992638014,
+    -0.610318113715186400156,
+    -0.604877064481584353319,
+    -0.599403930242242892974,
+    -0.593898967210121954393,
+    -0.588362434447662541434,
+    -0.582794593837318850840,
+    -0.577195710052045814844,
+    -0.571566050525742833992,
+    -0.565905885423654422623,
+    -0.560215487612728441818,
+    -0.554495132631932548866,
+    -0.548745098662529448608,
+    -0.542965666498311490492,
+    -0.537157119515795115982,
+    -0.531319743644375623972,
+    -0.525453827336442687395,
+    -0.519559661537457021993,
+    -0.513637539655988578507,
+    -0.507687757533716602155,
+    -0.501710613415391878251,
+    -0.495706407918761460170,
+    -0.489675444004456155436,
+    -0.483618026945841027562,
+    -0.477534464298829155284,
+    -0.471425065871658876934,
+    -0.465290143694634735858,
+    -0.459130011989832332874,
+    -0.452944987140767283784,
+    -0.446735387662028473742,
+    -0.440501534168875795783,
+    -0.434243749346802558002,
+    -0.427962357921062742583,
+    -0.421657686626163300056,
+    -0.415330064175321663764,
+    -0.408979821229888672409,
+    -0.402607290368737092671,
+    -0.396212806057615939183,
+    -0.389796704618470795479,
+    -0.383359324198730346916,
+    -0.376901004740559344802,
+    -0.370422087950078230138,
+    -0.363922917266549655269,
+    -0.357403837831532152376,
+    -0.350865196458001209011,
+    -0.344307341599438022777,
+    -0.337730623318886219621,
+    -0.331135393257976833093,
+    -0.324522004605921855207,
+    -0.317890812068476683182,
+    -0.311242171836871800300,
+    -0.304576441556714043335,
+    -0.297893980296857823437,
+    -0.291195148518246681964,
+    -0.284480308042725577496,
+    -0.277749822021824315065,
+    -0.271004054905512543536,
+    -0.264243372410926761945,
+    -0.257468141491069790481,
+    -0.250678730303483176613,
+    -0.243875508178893021593,
+    -0.237058845589829727213,
+    -0.230229114119222177156,
+    -0.223386686428966881628,
+    -0.216531936228472628081,
+    -0.209665238243181194766,
+    -0.202786968183064697557,
+    -0.195897502711100153915,
+    -0.188997219411721861059,
+    -0.182086496759252198246,
+    -0.175165714086311475707,
+    -0.168235251552207464982,
+    -0.161295490111305257361,
+    -0.154346811481378108692,
+    -0.147389598111939940054,
+    -0.140424233152560174594,
+    -0.133451100421161601344,
+    -0.126470584372301966851,
+    -0.119483070065440005133,
+    -0.112488943133186625746,
+    -0.105488589749541988533,
+    -0.984823965981192020903E-01,
+    -0.914707508403553909095E-01,
+    -0.844540400837108837102E-01,
+    -0.774326523498572825675E-01,
+    -0.704069760428551790633E-01,
+    -0.633773999173222898797E-01,
+    -0.563443130465927899720E-01,
+    -0.493081047908686267156E-01,
+    -0.422691647653636032124E-01,
+    -0.352278828084410232603E-01,
+    -0.281846489497456943394E-01,
+    -0.211398533783310883350E-01,
+    -0.140938864107824626142E-01,
+    -0.704713845933674648514E-02,
+    +0.000000000000000000000,
+    +0.704713845933674648514E-02,
+    +0.140938864107824626142E-01,
+    +0.211398533783310883350E-01,
+    +0.281846489497456943394E-01,
+    +0.352278828084410232603E-01,
+    +0.422691647653636032124E-01,
+    +0.493081047908686267156E-01,
+    +0.563443130465927899720E-01,
+    +0.633773999173222898797E-01,
+    +0.704069760428551790633E-01,
+    +0.774326523498572825675E-01,
+    +0.844540400837108837102E-01,
+    +0.914707508403553909095E-01,
+    +0.984823965981192020903E-01,
+    +0.105488589749541988533,
+    +0.112488943133186625746,
+    +0.119483070065440005133,
+    +0.126470584372301966851,
+    +0.133451100421161601344,
+    +0.140424233152560174594,
+    +0.147389598111939940054,
+    +0.154346811481378108692,
+    +0.161295490111305257361,
+    +0.168235251552207464982,
+    +0.175165714086311475707,
+    +0.182086496759252198246,
+    +0.188997219411721861059,
+    +0.195897502711100153915,
+    +0.202786968183064697557,
+    +0.209665238243181194766,
+    +0.216531936228472628081,
+    +0.223386686428966881628,
+    +0.230229114119222177156,
+    +0.237058845589829727213,
+    +0.243875508178893021593,
+    +0.250678730303483176613,
+    +0.257468141491069790481,
+    +0.264243372410926761945,
+    +0.271004054905512543536,
+    +0.277749822021824315065,
+    +0.284480308042725577496,
+    +0.291195148518246681964,
+    +0.297893980296857823437,
+    +0.304576441556714043335,
+    +0.311242171836871800300,
+    +0.317890812068476683182,
+    +0.324522004605921855207,
+    +0.331135393257976833093,
+    +0.337730623318886219621,
+    +0.344307341599438022777,
+    +0.350865196458001209011,
+    +0.357403837831532152376,
+    +0.363922917266549655269,
+    +0.370422087950078230138,
+    +0.376901004740559344802,
+    +0.383359324198730346916,
+    +0.389796704618470795479,
+    +0.396212806057615939183,
+    +0.402607290368737092671,
+    +0.408979821229888672409,
+    +0.415330064175321663764,
+    +0.421657686626163300056,
+    +0.427962357921062742583,
+    +0.434243749346802558002,
+    +0.440501534168875795783,
+    +0.446735387662028473742,
+    +0.452944987140767283784,
+    +0.459130011989832332874,
+    +0.465290143694634735858,
+    +0.471425065871658876934,
+    +0.477534464298829155284,
+    +0.483618026945841027562,
+    +0.489675444004456155436,
+    +0.495706407918761460170,
+    +0.501710613415391878251,
+    +0.507687757533716602155,
+    +0.513637539655988578507,
+    +0.519559661537457021993,
+    +0.525453827336442687395,
+    +0.531319743644375623972,
+    +0.537157119515795115982,
+    +0.542965666498311490492,
+    +0.548745098662529448608,
+    +0.554495132631932548866,
+    +0.560215487612728441818,
+    +0.565905885423654422623,
+    +0.571566050525742833992,
+    +0.577195710052045814844,
+    +0.582794593837318850840,
+    +0.588362434447662541434,
+    +0.593898967210121954393,
+    +0.599403930242242892974,
+    +0.604877064481584353319,
+    +0.610318113715186400156,
+    +0.615726824608992638014,
+    +0.621102946737226402941,
+    +0.626446232611719746542,
+    +0.631756437711194230414,
+    +0.637033320510492495071,
+    +0.642276642509759513774,
+    +0.647486168263572388782,
+    +0.652661665410017496101,
+    +0.657802904699713735422,
+    +0.662909660024780595461,
+    +0.667981708447749702165,
+    +0.673018830230418479199,
+    +0.678020808862644517838,
+    +0.682987431091079228087,
+    +0.687918486947839325756,
+    +0.692813769779114702895,
+    +0.697673076273711232906,
+    +0.702496206491527078610,
+    +0.707282963891961103412,
+    +0.712033155362252034587,
+    +0.716746591245747095767,
+    +0.721423085370098915485,
+    +0.726062455075389632685,
+    +0.730664521242181261329,
+    +0.735229108319491547663,
+    +0.739756044352694758677,
+    +0.744245161011347082309,
+    +0.748696293616936602823,
+    +0.753109281170558142523,
+    +0.757483966380513637926,
+    +0.761820195689839149173,
+    +0.766117819303760090717,
+    +0.770376691217076824278,
+    +0.774596669241483377036,
+    +0.778777615032822744702,
+    +0.782919394118283016385,
+    +0.787021875923539422170,
+    +0.791084933799848361435,
+    +0.795108445051100526780,
+    +0.799092290960841401800,
+    +0.803036356819268687782,
+    +0.806940531950217611856,
+    +0.810804709738146594361,
+    +0.814628787655137413436,
+    +0.818412667287925807395,
+    +0.822156254364980407373,
+    +0.825859458783650001088,
+    +0.829522194637401400178,
+    +0.833144380243172624728,
+    +0.836725938168868735503,
+    +0.840266795261030442350,
+    +0.843766882672708601038,
+    +0.847226135891580884381,
+    +0.850644494768350279758,
+    +0.854021903545468625813,
+    +0.857358310886232156525,
+    +0.860653669904299969802,
+    +0.863907938193690477146,
+    +0.867121077859315215614,
+    +0.870293055548113905851,
+    +0.873423842480859310192,
+    +0.876513414484705269742,
+    +0.879561752026556262568,
+    +0.882568840247341906842,
+    +0.885534668997285008926,
+    +0.888459232872256998890,
+    +0.891342531251319871666,
+    +0.894184568335559022859,
+    +0.896985353188316590376,
+    +0.899744899776940036639,
+    +0.902463227016165675048,
+    +0.905140358813261595189,
+    +0.907776324115058903624,
+    +0.910371156957004292498,
+    +0.912924896514370590080,
+    +0.915437587155765040644,
+    +0.917909278499077501636,
+    +0.920340025470012420730,
+    +0.922729888363349241523,
+    +0.925078932907075652364,
+    +0.927387230329536696843,
+    +0.929654857429740056670,
+    +0.931881896650953639345,
+    +0.934068436157725787999,
+    +0.936214569916450806625,
+    +0.938320397779592883655,
+    +0.940386025573669721370,
+    +0.942411565191083059813,
+    +0.944397134685866648591,
+    +0.946342858373402905148,
+    +0.948248866934137357063,
+    +0.950115297521294876558,
+    +0.951942293872573589498,
+    +0.953730006425761136415,
+    +0.955478592438183697574,
+    +0.957188216109860962736,
+    +0.958859048710200221356,
+    +0.960491268708020283423,
+    +0.962085061904651475741,
+    +0.963640621569812132521,
+    +0.965158148579915665979,
+    +0.966637851558416567092,
+    +0.968079947017759947964,
+    +0.969484659502459231771,
+    +0.970852221732792443256,
+    +0.972182874748581796578,
+    +0.973476868052506926773,
+    +0.974734459752402667761,
+    +0.975955916702011753129,
+    +0.977141514639705714156,
+    +0.978291538324758539526,
+    +0.979406281670862683806,
+    +0.980486047876721339416,
+    +0.981531149553740106867,
+    +0.982541908851080604251,
+    +0.983518657578632728762,
+    +0.984461737328814534596,
+    +0.985371499598520371114,
+    +0.986248305913007552681,
+    +0.987092527954034067190,
+    +0.987904547695124280467,
+    +0.988684757547429479939,
+    +0.989433560520240838716,
+    +0.990151370400770159181,
+    +0.990838611958294243677,
+    +0.991495721178106132399,
+    +0.992123145530863117683,
+    +0.992721344282788615328,
+    +0.993290788851684966211,
+    +0.993831963212755022209,
+    +0.994345364356723405931,
+    +0.994831502800621000519,
+    +0.995290903148810302261,
+    +0.995724104698407188509,
+    +0.996131662079315037786,
+    +0.996514145914890273849,
+    +0.996872143485260161299,
+    +0.997206259372221959076,
+    +0.997517116063472399965,
+    +0.997805354495957274562,
+    +0.998071634524930323302,
+    +0.998316635318407392531,
+    +0.998541055697167906027,
+    +0.998745614468095114704,
+    +0.998931050830810562236,
+    +0.999098124967667597662,
+    +0.999247618943342473599,
+    +0.999380338025023581928,
+    +0.999497112467187190535,
+    +0.999598799671910683252,
+    +0.999686286448317731776,
+    +0.999760490924432047330,
+    +0.999822363679787739196,
+    +0.999872888120357611938,
+    +0.999913081144678282800,
+    +0.999943996207054375764,
+    +0.999966730098486276883,
+    +0.999982430354891598580,
+    +0.999992298136257588028,
+    +0.999997596379748464620,
+    +0.999999672956734384381
+  };
+
+  if ( n == 1 )
+  {
+    webbur::r8vec_copy ( n, x_001, x );
+  }
+  else if ( n == 3 )
+  {
+    webbur::r8vec_copy ( n, x_003, x );
+  }
+  else if ( n == 7 )
+  {
+    webbur::r8vec_copy ( n, x_007, x );
+  }
+  else if ( n == 15 )
+  {
+    webbur::r8vec_copy ( n, x_015, x );
+  }
+  else if ( n == 31 )
+  {
+    webbur::r8vec_copy ( n, x_031, x );
+  }
+  else if ( n == 63 )
+  {
+    webbur::r8vec_copy ( n, x_063, x );
+  }
+  else if ( n == 127 )
+  {
+    webbur::r8vec_copy ( n, x_127, x );
+  }
+  else if ( n == 255 )
+  {
+    webbur::r8vec_copy ( n, x_255, x );
+  }
+  else if ( n == 511 )
+  {
+    webbur::r8vec_copy ( n, x_511, x );
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "PATTERSON_LOOKUP_POINTS - Fatal error!\n";
+    std::cerr << "  Unexpected value of N = " << n << "\n";
+    std::exit ( 1 );
+  }
+  return;
+}
+//****************************************************************************80
+
+void patterson_lookup_points_np ( int n, int np, double p[], double x[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    PATTERSON_LOOKUP_POINTS_NP looks up Patterson quadrature points.
+//
+//  Discussion:
+//
+//    Our convention is that the abscissas are numbered from left to right.
+//
+//    The rule is defined on [-1,1],
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    17 December 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Prem Kythe, Michael Schaeferkotter,
+//    Handbook of Computational Methods for Integration,
+//    Chapman and Hall, 2004,
+//    ISBN: 1-58488-428-2,
+//    LC: QA299.3.K98.
+//
+//    Thomas Patterson,
+//    The Optimal Addition of Points to Quadrature Formulae,
+//    Mathematics of Computation,
+//    Volume 22, Number 104, October 1968, pages 847-856.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double X[N], the abscissas.
+//
+{
+  patterson_lookup_points ( n, x );
+
+  return;
+}
+//****************************************************************************80
+
+void patterson_lookup_weights ( int n, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    PATTERSON_LOOKUP_WEIGHTS looks up Patterson quadrature weights.
+//
+//  Discussion:
+//
+//    The allowed orders are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
+//
+//    The weights are positive, symmetric and should sum to 2.
+//
+//    The user must preallocate space for the output array W.
+//
+//    These rules constitute a nested family.  The rules can integrate exactly
+//    any polynomial of degree 1, 5, 11, 23, 47, 95, 191, 383 or 767,
+//    respectively.
+//
+//    The data for N = 511 was supplied by Dirk Laurie, and is derived
+//    from a NAG Library function d01arf.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    14 September 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Prem Kythe, Michael Schaeferkotter,
+//    Handbook of Computational Methods for Integration,
+//    Chapman and Hall, 2004,
+//    ISBN: 1-58488-428-2,
+//    LC: QA299.3.K98.
+//
+//    NAG Library Documentation,
+//    D01ARF,
+//    The Numerical Algorithms Group.
+//
+//    Thomas Patterson,
+//    The Optimal Addition of Points to Quadrature Formulae,
+//    Mathematics of Computation,
+//    Volume 22, Number 104, October 1968, pages 847-856.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 or 511.
+//
+//    Output, double W[N], the weights.
+//
+{
+  static double w_001[1] =
+  {
+    2.0
+  };
+  static double w_003[3] =
+  {
+    0.555555555555555555556,
+    0.888888888888888888889,
+    0.555555555555555555556
+  };
+  static double w_007[7] =
+  {
+    0.104656226026467265194,
+    0.268488089868333440729,
+    0.401397414775962222905,
+    0.450916538658474142345,
+    0.401397414775962222905,
+    0.268488089868333440729,
+    0.104656226026467265194
+  };
+  static double w_015[15] =
+  {
+    0.0170017196299402603390,
+    0.0516032829970797396969,
+    0.0929271953151245376859,
+    0.134415255243784220360,
+    0.171511909136391380787,
+    0.200628529376989021034,
+    0.219156858401587496404,
+    0.225510499798206687386,
+    0.219156858401587496404,
+    0.200628529376989021034,
+    0.171511909136391380787,
+    0.134415255243784220360,
+    0.0929271953151245376859,
+    0.0516032829970797396969,
+    0.0170017196299402603390
+  };
+  static double w_031[31] =
+  {
+    0.00254478079156187441540,
+    0.00843456573932110624631,
+    0.0164460498543878109338,
+    0.0258075980961766535646,
+    0.0359571033071293220968,
+    0.0464628932617579865414,
+    0.0569795094941233574122,
+    0.0672077542959907035404,
+    0.0768796204990035310427,
+    0.0857559200499903511542,
+    0.0936271099812644736167,
+    0.100314278611795578771,
+    0.105669893580234809744,
+    0.109578421055924638237,
+    0.111956873020953456880,
+    0.112755256720768691607,
+    0.111956873020953456880,
+    0.109578421055924638237,
+    0.105669893580234809744,
+    0.100314278611795578771,
+    0.0936271099812644736167,
+    0.0857559200499903511542,
+    0.0768796204990035310427,
+    0.0672077542959907035404,
+    0.0569795094941233574122,
+    0.0464628932617579865414,
+    0.0359571033071293220968,
+    0.0258075980961766535646,
+    0.0164460498543878109338,
+    0.00843456573932110624631,
+    0.00254478079156187441540
+  };
+  static double w_063[63] =
+  {
+    0.000363221481845530659694,
+    0.00126515655623006801137,
+    0.00257904979468568827243,
+    0.00421763044155885483908,
+    0.00611550682211724633968,
+    0.00822300795723592966926,
+    0.0104982469096213218983,
+    0.0129038001003512656260,
+    0.0154067504665594978021,
+    0.0179785515681282703329,
+    0.0205942339159127111492,
+    0.0232314466399102694433,
+    0.0258696793272147469108,
+    0.0284897547458335486125,
+    0.0310735511116879648799,
+    0.0336038771482077305417,
+    0.0360644327807825726401,
+    0.0384398102494555320386,
+    0.0407155101169443189339,
+    0.0428779600250077344929,
+    0.0449145316536321974143,
+    0.0468135549906280124026,
+    0.0485643304066731987159,
+    0.0501571393058995374137,
+    0.0515832539520484587768,
+    0.0528349467901165198621,
+    0.0539054993352660639269,
+    0.0547892105279628650322,
+    0.0554814043565593639878,
+    0.0559784365104763194076,
+    0.0562776998312543012726,
+    0.0563776283603847173877,
+    0.0562776998312543012726,
+    0.0559784365104763194076,
+    0.0554814043565593639878,
+    0.0547892105279628650322,
+    0.0539054993352660639269,
+    0.0528349467901165198621,
+    0.0515832539520484587768,
+    0.0501571393058995374137,
+    0.0485643304066731987159,
+    0.0468135549906280124026,
+    0.0449145316536321974143,
+    0.0428779600250077344929,
+    0.0407155101169443189339,
+    0.0384398102494555320386,
+    0.0360644327807825726401,
+    0.0336038771482077305417,
+    0.0310735511116879648799,
+    0.0284897547458335486125,
+    0.0258696793272147469108,
+    0.0232314466399102694433,
+    0.0205942339159127111492,
+    0.0179785515681282703329,
+    0.0154067504665594978021,
+    0.0129038001003512656260,
+    0.0104982469096213218983,
+    0.00822300795723592966926,
+    0.00611550682211724633968,
+    0.00421763044155885483908,
+    0.00257904979468568827243,
+    0.00126515655623006801137,
+    0.000363221481845530659694
+  };
+  static double w_127[127] =
+  {
+    0.0000505360952078625176247,
+    0.000180739564445388357820,
+    0.000377746646326984660274,
+    0.000632607319362633544219,
+    0.000938369848542381500794,
+    0.00128952408261041739210,
+    0.00168114286542146990631,
+    0.00210881524572663287933,
+    0.00256876494379402037313,
+    0.00305775341017553113613,
+    0.00357289278351729964938,
+    0.00411150397865469304717,
+    0.00467105037211432174741,
+    0.00524912345480885912513,
+    0.00584344987583563950756,
+    0.00645190005017573692280,
+    0.00707248999543355546805,
+    0.00770337523327974184817,
+    0.00834283875396815770558,
+    0.00898927578406413572328,
+    0.00964117772970253669530,
+    0.0102971169579563555237,
+    0.0109557333878379016480,
+    0.0116157233199551347270,
+    0.0122758305600827700870,
+    0.0129348396636073734547,
+    0.0135915710097655467896,
+    0.0142448773729167743063,
+    0.0148936416648151820348,
+    0.0155367755558439824399,
+    0.0161732187295777199419,
+    0.0168019385741038652709,
+    0.0174219301594641737472,
+    0.0180322163903912863201,
+    0.0186318482561387901863,
+    0.0192199051247277660193,
+    0.0197954950480974994880,
+    0.0203577550584721594669,
+    0.0209058514458120238522,
+    0.0214389800125038672465,
+    0.0219563663053178249393,
+    0.0224572658268160987071,
+    0.0229409642293877487608,
+    0.0234067774953140062013,
+    0.0238540521060385400804,
+    0.0242821652033365993580,
+    0.0246905247444876769091,
+    0.0250785696529497687068,
+    0.0254457699654647658126,
+    0.0257916269760242293884,
+    0.0261156733767060976805,
+    0.0264174733950582599310,
+    0.0266966229274503599062,
+    0.0269527496676330319634,
+    0.0271855132296247918192,
+    0.0273946052639814325161,
+    0.0275797495664818730349,
+    0.0277407021782796819939,
+    0.0278772514766137016085,
+    0.0279892182552381597038,
+    0.0280764557938172466068,
+    0.0281388499156271506363,
+    0.0281763190330166021307,
+    0.0281888141801923586938,
+    0.0281763190330166021307,
+    0.0281388499156271506363,
+    0.0280764557938172466068,
+    0.0279892182552381597038,
+    0.0278772514766137016085,
+    0.0277407021782796819939,
+    0.0275797495664818730349,
+    0.0273946052639814325161,
+    0.0271855132296247918192,
+    0.0269527496676330319634,
+    0.0266966229274503599062,
+    0.0264174733950582599310,
+    0.0261156733767060976805,
+    0.0257916269760242293884,
+    0.0254457699654647658126,
+    0.0250785696529497687068,
+    0.0246905247444876769091,
+    0.0242821652033365993580,
+    0.0238540521060385400804,
+    0.0234067774953140062013,
+    0.0229409642293877487608,
+    0.0224572658268160987071,
+    0.0219563663053178249393,
+    0.0214389800125038672465,
+    0.0209058514458120238522,
+    0.0203577550584721594669,
+    0.0197954950480974994880,
+    0.0192199051247277660193,
+    0.0186318482561387901863,
+    0.0180322163903912863201,
+    0.0174219301594641737472,
+    0.0168019385741038652709,
+    0.0161732187295777199419,
+    0.0155367755558439824399,
+    0.0148936416648151820348,
+    0.0142448773729167743063,
+    0.0135915710097655467896,
+    0.0129348396636073734547,
+    0.0122758305600827700870,
+    0.0116157233199551347270,
+    0.0109557333878379016480,
+    0.0102971169579563555237,
+    0.00964117772970253669530,
+    0.00898927578406413572328,
+    0.00834283875396815770558,
+    0.00770337523327974184817,
+    0.00707248999543355546805,
+    0.00645190005017573692280,
+    0.00584344987583563950756,
+    0.00524912345480885912513,
+    0.00467105037211432174741,
+    0.00411150397865469304717,
+    0.00357289278351729964938,
+    0.00305775341017553113613,
+    0.00256876494379402037313,
+    0.00210881524572663287933,
+    0.00168114286542146990631,
+    0.00128952408261041739210,
+    0.000938369848542381500794,
+    0.000632607319362633544219,
+    0.000377746646326984660274,
+    0.000180739564445388357820,
+    0.0000505360952078625176247
+  };
+  static double w_255[255] =
+  {
+    0.69379364324108267170E-05,
+    0.25157870384280661489E-04,
+    0.53275293669780613125E-04,
+    0.90372734658751149261E-04,
+    0.13575491094922871973E-03,
+    0.18887326450650491366E-03,
+    0.24921240048299729402E-03,
+    0.31630366082226447689E-03,
+    0.38974528447328229322E-03,
+    0.46918492424785040975E-03,
+    0.55429531493037471492E-03,
+    0.64476204130572477933E-03,
+    0.74028280424450333046E-03,
+    0.84057143271072246365E-03,
+    0.94536151685852538246E-03,
+    0.10544076228633167722E-02,
+    0.11674841174299594077E-02,
+    0.12843824718970101768E-02,
+    0.14049079956551446427E-02,
+    0.15288767050877655684E-02,
+    0.16561127281544526052E-02,
+    0.17864463917586498247E-02,
+    0.19197129710138724125E-02,
+    0.20557519893273465236E-02,
+    0.21944069253638388388E-02,
+    0.23355251860571608737E-02,
+    0.24789582266575679307E-02,
+    0.26245617274044295626E-02,
+    0.27721957645934509940E-02,
+    0.29217249379178197538E-02,
+    0.30730184347025783234E-02,
+    0.32259500250878684614E-02,
+    0.33803979910869203823E-02,
+    0.35362449977167777340E-02,
+    0.36933779170256508183E-02,
+    0.38516876166398709241E-02,
+    0.40110687240750233989E-02,
+    0.41714193769840788528E-02,
+    0.43326409680929828545E-02,
+    0.44946378920320678616E-02,
+    0.46573172997568547773E-02,
+    0.48205888648512683476E-02,
+    0.49843645647655386012E-02,
+    0.51485584789781777618E-02,
+    0.53130866051870565663E-02,
+    0.54778666939189508240E-02,
+    0.56428181013844441585E-02,
+    0.58078616599775673635E-02,
+    0.59729195655081658049E-02,
+    0.61379152800413850435E-02,
+    0.63027734490857587172E-02,
+    0.64674198318036867274E-02,
+    0.66317812429018878941E-02,
+    0.67957855048827733948E-02,
+    0.69593614093904229394E-02,
+    0.71224386864583871532E-02,
+    0.72849479805538070639E-02,
+    0.74468208324075910174E-02,
+    0.76079896657190565832E-02,
+    0.77683877779219912200E-02,
+    0.79279493342948491103E-02,
+    0.80866093647888599710E-02,
+    0.82443037630328680306E-02,
+    0.84009692870519326354E-02,
+    0.85565435613076896192E-02,
+    0.87109650797320868736E-02,
+    0.88641732094824942641E-02,
+    0.90161081951956431600E-02,
+    0.91667111635607884067E-02,
+    0.93159241280693950932E-02,
+    0.94636899938300652943E-02,
+    0.96099525623638830097E-02,
+    0.97546565363174114611E-02,
+    0.98977475240487497440E-02,
+    0.10039172044056840798E-01,
+    0.10178877529236079733E-01,
+    0.10316812330947621682E-01,
+    0.10452925722906011926E-01,
+    0.10587167904885197931E-01,
+    0.10719490006251933623E-01,
+    0.10849844089337314099E-01,
+    0.10978183152658912470E-01,
+    0.11104461134006926537E-01,
+    0.11228632913408049354E-01,
+    0.11350654315980596602E-01,
+    0.11470482114693874380E-01,
+    0.11588074033043952568E-01,
+    0.11703388747657003101E-01,
+    0.11816385890830235763E-01,
+    0.11927026053019270040E-01,
+    0.12035270785279562630E-01,
+    0.12141082601668299679E-01,
+    0.12244424981611985899E-01,
+    0.12345262372243838455E-01,
+    0.12443560190714035263E-01,
+    0.12539284826474884353E-01,
+    0.12632403643542078765E-01,
+    0.12722884982732382906E-01,
+    0.12810698163877361967E-01,
+    0.12895813488012114694E-01,
+    0.12978202239537399286E-01,
+    0.13057836688353048840E-01,
+    0.13134690091960152836E-01,
+    0.13208736697529129966E-01,
+    0.13279951743930530650E-01,
+    0.13348311463725179953E-01,
+    0.13413793085110098513E-01,
+    0.13476374833816515982E-01,
+    0.13536035934956213614E-01,
+    0.13592756614812395910E-01,
+    0.13646518102571291428E-01,
+    0.13697302631990716258E-01,
+    0.13745093443001896632E-01,
+    0.13789874783240936517E-01,
+    0.13831631909506428676E-01,
+    0.13870351089139840997E-01,
+    0.13906019601325461264E-01,
+    0.13938625738306850804E-01,
+    0.13968158806516938516E-01,
+    0.13994609127619079852E-01,
+    0.14017968039456608810E-01,
+    0.14038227896908623303E-01,
+    0.14055382072649964277E-01,
+    0.14069424957813575318E-01,
+    0.14080351962553661325E-01,
+    0.14088159516508301065E-01,
+    0.14092845069160408355E-01,
+    0.14094407090096179347E-01,
+    0.14092845069160408355E-01,
+    0.14088159516508301065E-01,
+    0.14080351962553661325E-01,
+    0.14069424957813575318E-01,
+    0.14055382072649964277E-01,
+    0.14038227896908623303E-01,
+    0.14017968039456608810E-01,
+    0.13994609127619079852E-01,
+    0.13968158806516938516E-01,
+    0.13938625738306850804E-01,
+    0.13906019601325461264E-01,
+    0.13870351089139840997E-01,
+    0.13831631909506428676E-01,
+    0.13789874783240936517E-01,
+    0.13745093443001896632E-01,
+    0.13697302631990716258E-01,
+    0.13646518102571291428E-01,
+    0.13592756614812395910E-01,
+    0.13536035934956213614E-01,
+    0.13476374833816515982E-01,
+    0.13413793085110098513E-01,
+    0.13348311463725179953E-01,
+    0.13279951743930530650E-01,
+    0.13208736697529129966E-01,
+    0.13134690091960152836E-01,
+    0.13057836688353048840E-01,
+    0.12978202239537399286E-01,
+    0.12895813488012114694E-01,
+    0.12810698163877361967E-01,
+    0.12722884982732382906E-01,
+    0.12632403643542078765E-01,
+    0.12539284826474884353E-01,
+    0.12443560190714035263E-01,
+    0.12345262372243838455E-01,
+    0.12244424981611985899E-01,
+    0.12141082601668299679E-01,
+    0.12035270785279562630E-01,
+    0.11927026053019270040E-01,
+    0.11816385890830235763E-01,
+    0.11703388747657003101E-01,
+    0.11588074033043952568E-01,
+    0.11470482114693874380E-01,
+    0.11350654315980596602E-01,
+    0.11228632913408049354E-01,
+    0.11104461134006926537E-01,
+    0.10978183152658912470E-01,
+    0.10849844089337314099E-01,
+    0.10719490006251933623E-01,
+    0.10587167904885197931E-01,
+    0.10452925722906011926E-01,
+    0.10316812330947621682E-01,
+    0.10178877529236079733E-01,
+    0.10039172044056840798E-01,
+    0.98977475240487497440E-02,
+    0.97546565363174114611E-02,
+    0.96099525623638830097E-02,
+    0.94636899938300652943E-02,
+    0.93159241280693950932E-02,
+    0.91667111635607884067E-02,
+    0.90161081951956431600E-02,
+    0.88641732094824942641E-02,
+    0.87109650797320868736E-02,
+    0.85565435613076896192E-02,
+    0.84009692870519326354E-02,
+    0.82443037630328680306E-02,
+    0.80866093647888599710E-02,
+    0.79279493342948491103E-02,
+    0.77683877779219912200E-02,
+    0.76079896657190565832E-02,
+    0.74468208324075910174E-02,
+    0.72849479805538070639E-02,
+    0.71224386864583871532E-02,
+    0.69593614093904229394E-02,
+    0.67957855048827733948E-02,
+    0.66317812429018878941E-02,
+    0.64674198318036867274E-02,
+    0.63027734490857587172E-02,
+    0.61379152800413850435E-02,
+    0.59729195655081658049E-02,
+    0.58078616599775673635E-02,
+    0.56428181013844441585E-02,
+    0.54778666939189508240E-02,
+    0.53130866051870565663E-02,
+    0.51485584789781777618E-02,
+    0.49843645647655386012E-02,
+    0.48205888648512683476E-02,
+    0.46573172997568547773E-02,
+    0.44946378920320678616E-02,
+    0.43326409680929828545E-02,
+    0.41714193769840788528E-02,
+    0.40110687240750233989E-02,
+    0.38516876166398709241E-02,
+    0.36933779170256508183E-02,
+    0.35362449977167777340E-02,
+    0.33803979910869203823E-02,
+    0.32259500250878684614E-02,
+    0.30730184347025783234E-02,
+    0.29217249379178197538E-02,
+    0.27721957645934509940E-02,
+    0.26245617274044295626E-02,
+    0.24789582266575679307E-02,
+    0.23355251860571608737E-02,
+    0.21944069253638388388E-02,
+    0.20557519893273465236E-02,
+    0.19197129710138724125E-02,
+    0.17864463917586498247E-02,
+    0.16561127281544526052E-02,
+    0.15288767050877655684E-02,
+    0.14049079956551446427E-02,
+    0.12843824718970101768E-02,
+    0.11674841174299594077E-02,
+    0.10544076228633167722E-02,
+    0.94536151685852538246E-03,
+    0.84057143271072246365E-03,
+    0.74028280424450333046E-03,
+    0.64476204130572477933E-03,
+    0.55429531493037471492E-03,
+    0.46918492424785040975E-03,
+    0.38974528447328229322E-03,
+    0.31630366082226447689E-03,
+    0.24921240048299729402E-03,
+    0.18887326450650491366E-03,
+    0.13575491094922871973E-03,
+    0.90372734658751149261E-04,
+    0.53275293669780613125E-04,
+    0.25157870384280661489E-04,
+    0.69379364324108267170E-05
+  };
+  static double w_511[511] =
+  {
+    0.945715933950007048827E-06,
+    0.345456507169149134898E-05,
+    0.736624069102321668857E-05,
+    0.125792781889592743525E-04,
+    0.190213681905875816679E-04,
+    0.266376412339000901358E-04,
+    0.353751372055189588628E-04,
+    0.451863674126296143105E-04,
+    0.560319507856164252140E-04,
+    0.678774554733972416227E-04,
+    0.806899228014035293851E-04,
+    0.944366322532705527066E-04,
+    0.109085545645741522051E-03,
+    0.124606200241498368482E-03,
+    0.140970302204104791413E-03,
+    0.158151830411132242924E-03,
+    0.176126765545083195474E-03,
+    0.194872642236641146532E-03,
+    0.214368090034216937149E-03,
+    0.234592462123925204879E-03,
+    0.255525589595236862014E-03,
+    0.277147657465187357459E-03,
+    0.299439176850911730874E-03,
+    0.322381020652862389664E-03,
+    0.345954492129903871350E-03,
+    0.370141402122251665232E-03,
+    0.394924138246873704434E-03,
+    0.420285716355361231823E-03,
+    0.446209810101403247488E-03,
+    0.472680758429262691232E-03,
+    0.499683553312800484519E-03,
+    0.527203811431658386125E-03,
+    0.555227733977307579715E-03,
+    0.583742058714979703847E-03,
+    0.612734008012225209294E-03,
+    0.642191235948505088403E-03,
+    0.672101776960108194646E-03,
+    0.702453997827572321358E-03,
+    0.733236554224767912055E-03,
+    0.764438352543882784191E-03,
+    0.796048517297550871506E-03,
+    0.828056364077226302608E-03,
+    0.860451377808527848128E-03,
+    0.893223195879324912340E-03,
+    0.926361595613111283368E-03,
+    0.959856485506936206261E-03,
+    0.993697899638760857945E-03,
+    0.102787599466367326179E-02,
+    0.106238104885340071375E-02,
+    0.109720346268191941940E-02,
+    0.113233376051597664917E-02,
+    0.116776259302858043685E-02,
+    0.120348074001265964881E-02,
+    0.123947911332878396534E-02,
+    0.127574875977346947345E-02,
+    0.131228086370221478128E-02,
+    0.134906674928353113127E-02,
+    0.138609788229672549700E-02,
+    0.142336587141720519900E-02,
+    0.146086246895890987689E-02,
+    0.149857957106456636214E-02,
+    0.153650921735128916170E-02,
+    0.157464359003212166189E-02,
+    0.161297501254393423070E-02,
+    0.165149594771914570655E-02,
+    0.169019899554346019117E-02,
+    0.172907689054461607168E-02,
+    0.176812249885838886701E-02,
+    0.180732881501808930079E-02,
+    0.184668895851282540913E-02,
+    0.188619617015808475394E-02,
+    0.192584380831993546204E-02,
+    0.196562534503150547732E-02,
+    0.200553436203751169944E-02,
+    0.204556454679958293446E-02,
+    0.208570968849203942640E-02,
+    0.212596367401472533045E-02,
+    0.216632048404649142727E-02,
+    0.220677418916003329194E-02,
+    0.224731894601603393082E-02,
+    0.228794899365195972378E-02,
+    0.232865864987842738864E-02,
+    0.236944230779380495146E-02,
+    0.241029443242563417382E-02,
+    0.245120955750556483923E-02,
+    0.249218228238276930060E-02,
+    0.253320726907925325750E-02,
+    0.257427923948908888092E-02,
+    0.261539297272236109225E-02,
+    0.265654330259352828314E-02,
+    0.269772511525294586667E-02,
+    0.273893334695947541201E-02,
+    0.278016298199139435045E-02,
+    0.282140905069222207923E-02,
+    0.286266662764757868253E-02,
+    0.290393082998878368175E-02,
+    0.294519681581857582284E-02,
+    0.298645978275408290247E-02,
+    0.302771496658198544480E-02,
+    0.306895764002069252174E-02,
+    0.311018311158427546158E-02,
+    0.315138672454287935858E-02,
+    0.319256385597434736790E-02,
+    0.323370991590184336368E-02,
+    0.327482034651233969564E-02,
+    0.331589062145094394706E-02,
+    0.335691624518616761342E-02,
+    0.339789275244138669739E-02,
+    0.343881570768790591876E-02,
+    0.347968070469521146972E-02,
+    0.352048336613417922682E-02,
+    0.356121934322919357659E-02,
+    0.360188431545532431869E-02,
+    0.364247399027690353194E-02,
+    0.368298410292403911967E-02,
+    0.372341041620379550870E-02,
+    0.376374872034296338241E-02,
+    0.380399483285952829161E-02,
+    0.384414459846013158917E-02,
+    0.388419388896099560998E-02,
+    0.392413860322995774660E-02,
+    0.396397466714742455513E-02,
+    0.400369803358421688562E-02,
+    0.404330468239442998549E-02,
+    0.408279062042157838350E-02,
+    0.412215188151643401528E-02,
+    0.416138452656509745764E-02,
+    0.420048464352596631772E-02,
+    0.423944834747438184434E-02,
+    0.427827178065384480959E-02,
+    0.431695111253279479928E-02,
+    0.435548253986604343679E-02,
+    0.439386228676004195260E-02,
+    0.443208660474124713206E-02,
+    0.447015177282692726900E-02,
+    0.450805409759782158001E-02,
+    0.454578991327213285488E-02,
+    0.458335558178039420335E-02,
+    0.462074749284080687482E-02,
+    0.465796206403469754658E-02,
+    0.469499574088179046532E-02,
+    0.473184499691503264714E-02,
+    0.476850633375474925263E-02,
+    0.480497628118194150483E-02,
+    0.484125139721057135214E-02,
+    0.487732826815870573054E-02,
+    0.491320350871841897367E-02,
+    0.494887376202437487201E-02,
+    0.498433569972103029914E-02,
+    0.501958602202842039909E-02,
+    0.505462145780650125058E-02,
+    0.508943876461803986674E-02,
+    0.512403472879005351831E-02,
+    0.515840616547381084096E-02,
+    0.519254991870341614863E-02,
+    0.522646286145300596306E-02,
+    0.526014189569259311205E-02,
+    0.529358395244259896547E-02,
+    0.532678599182711857974E-02,
+    0.535974500312596681161E-02,
+    0.539245800482555593606E-02,
+    0.542492204466865704951E-02,
+    0.545713419970309863995E-02,
+    0.548909157632945623482E-02,
+    0.552079131034778706457E-02,
+    0.555223056700346326850E-02,
+    0.558340654103215637610E-02,
+    0.561431645670402467678E-02,
+    0.564495756786715368885E-02,
+    0.567532715799029830087E-02,
+    0.570542254020497332312E-02,
+    0.573524105734693719020E-02,
+    0.576478008199711142954E-02,
+    0.579403701652197628421E-02,
+    0.582300929311348057702E-02,
+    0.585169437382850155033E-02,
+    0.588008975062788803205E-02,
+    0.590819294541511788161E-02,
+    0.593600151007459827614E-02,
+    0.596351302650963502011E-02,
+    0.599072510668009471472E-02,
+    0.601763539263978131522E-02,
+    0.604424155657354634589E-02,
+    0.607054130083414983949E-02,
+    0.609653235797888692923E-02,
+    0.612221249080599294931E-02,
+    0.614757949239083790214E-02,
+    0.617263118612191922727E-02,
+    0.619736542573665996342E-02,
+    0.622178009535701763157E-02,
+    0.624587310952490748541E-02,
+    0.626964241323744217671E-02,
+    0.629308598198198836688E-02,
+    0.631620182177103938227E-02,
+    0.633898796917690165912E-02,
+    0.636144249136619145314E-02,
+    0.638356348613413709795E-02,
+    0.640534908193868098342E-02,
+    0.642679743793437438922E-02,
+    0.644790674400605734710E-02,
+    0.646867522080231481688E-02,
+    0.648910111976869964292E-02,
+    0.650918272318071200827E-02,
+    0.652891834417652442012E-02,
+    0.654830632678944064054E-02,
+    0.656734504598007641819E-02,
+    0.658603290766824937794E-02,
+    0.660436834876456498276E-02,
+    0.662234983720168509457E-02,
+    0.663997587196526532519E-02,
+    0.665724498312454708217E-02,
+    0.667415573186258997654E-02,
+    0.669070671050613006584E-02,
+    0.670689654255504925648E-02,
+    0.672272388271144108036E-02,
+    0.673818741690825799086E-02,
+    0.675328586233752529078E-02,
+    0.676801796747810680683E-02,
+    0.678238251212300746082E-02,
+    0.679637830740619795480E-02,
+    0.681000419582894688374E-02,
+    0.682325905128564571420E-02,
+    0.683614177908911221841E-02,
+    0.684865131599535812903E-02,
+    0.686078663022780697951E-02,
+    0.687254672150094831613E-02,
+    0.688393062104341470995E-02,
+    0.689493739162046825872E-02,
+    0.690556612755588354803E-02,
+    0.691581595475321433825E-02,
+    0.692568603071643155621E-02,
+    0.693517554456992049848E-02,
+    0.694428371707782549438E-02,
+    0.695300980066273063177E-02,
+    0.696135307942366551493E-02,
+    0.696931286915342540213E-02,
+    0.697688851735519545845E-02,
+    0.698407940325846925786E-02,
+    0.699088493783425207545E-02,
+    0.699730456380953992594E-02,
+    0.700333775568106572820E-02,
+    0.700898401972830440494E-02,
+    0.701424289402572916425E-02,
+    0.701911394845431165171E-02,
+    0.702359678471225911031E-02,
+    0.702769103632498213858E-02,
+    0.703139636865428709508E-02,
+    0.703471247890678765907E-02,
+    0.703763909614153052319E-02,
+    0.704017598127683066242E-02,
+    0.704232292709631209597E-02,
+    0.704407975825415053266E-02,
+    0.704544633127951476780E-02,
+    0.704642253458020417748E-02,
+    0.704700828844548013730E-02,
+    0.704720354504808967346E-02,
+    0.704700828844548013730E-02,
+    0.704642253458020417748E-02,
+    0.704544633127951476780E-02,
+    0.704407975825415053266E-02,
+    0.704232292709631209597E-02,
+    0.704017598127683066242E-02,
+    0.703763909614153052319E-02,
+    0.703471247890678765907E-02,
+    0.703139636865428709508E-02,
+    0.702769103632498213858E-02,
+    0.702359678471225911031E-02,
+    0.701911394845431165171E-02,
+    0.701424289402572916425E-02,
+    0.700898401972830440494E-02,
+    0.700333775568106572820E-02,
+    0.699730456380953992594E-02,
+    0.699088493783425207545E-02,
+    0.698407940325846925786E-02,
+    0.697688851735519545845E-02,
+    0.696931286915342540213E-02,
+    0.696135307942366551493E-02,
+    0.695300980066273063177E-02,
+    0.694428371707782549438E-02,
+    0.693517554456992049848E-02,
+    0.692568603071643155621E-02,
+    0.691581595475321433825E-02,
+    0.690556612755588354803E-02,
+    0.689493739162046825872E-02,
+    0.688393062104341470995E-02,
+    0.687254672150094831613E-02,
+    0.686078663022780697951E-02,
+    0.684865131599535812903E-02,
+    0.683614177908911221841E-02,
+    0.682325905128564571420E-02,
+    0.681000419582894688374E-02,
+    0.679637830740619795480E-02,
+    0.678238251212300746082E-02,
+    0.676801796747810680683E-02,
+    0.675328586233752529078E-02,
+    0.673818741690825799086E-02,
+    0.672272388271144108036E-02,
+    0.670689654255504925648E-02,
+    0.669070671050613006584E-02,
+    0.667415573186258997654E-02,
+    0.665724498312454708217E-02,
+    0.663997587196526532519E-02,
+    0.662234983720168509457E-02,
+    0.660436834876456498276E-02,
+    0.658603290766824937794E-02,
+    0.656734504598007641819E-02,
+    0.654830632678944064054E-02,
+    0.652891834417652442012E-02,
+    0.650918272318071200827E-02,
+    0.648910111976869964292E-02,
+    0.646867522080231481688E-02,
+    0.644790674400605734710E-02,
+    0.642679743793437438922E-02,
+    0.640534908193868098342E-02,
+    0.638356348613413709795E-02,
+    0.636144249136619145314E-02,
+    0.633898796917690165912E-02,
+    0.631620182177103938227E-02,
+    0.629308598198198836688E-02,
+    0.626964241323744217671E-02,
+    0.624587310952490748541E-02,
+    0.622178009535701763157E-02,
+    0.619736542573665996342E-02,
+    0.617263118612191922727E-02,
+    0.614757949239083790214E-02,
+    0.612221249080599294931E-02,
+    0.609653235797888692923E-02,
+    0.607054130083414983949E-02,
+    0.604424155657354634589E-02,
+    0.601763539263978131522E-02,
+    0.599072510668009471472E-02,
+    0.596351302650963502011E-02,
+    0.593600151007459827614E-02,
+    0.590819294541511788161E-02,
+    0.588008975062788803205E-02,
+    0.585169437382850155033E-02,
+    0.582300929311348057702E-02,
+    0.579403701652197628421E-02,
+    0.576478008199711142954E-02,
+    0.573524105734693719020E-02,
+    0.570542254020497332312E-02,
+    0.567532715799029830087E-02,
+    0.564495756786715368885E-02,
+    0.561431645670402467678E-02,
+    0.558340654103215637610E-02,
+    0.555223056700346326850E-02,
+    0.552079131034778706457E-02,
+    0.548909157632945623482E-02,
+    0.545713419970309863995E-02,
+    0.542492204466865704951E-02,
+    0.539245800482555593606E-02,
+    0.535974500312596681161E-02,
+    0.532678599182711857974E-02,
+    0.529358395244259896547E-02,
+    0.526014189569259311205E-02,
+    0.522646286145300596306E-02,
+    0.519254991870341614863E-02,
+    0.515840616547381084096E-02,
+    0.512403472879005351831E-02,
+    0.508943876461803986674E-02,
+    0.505462145780650125058E-02,
+    0.501958602202842039909E-02,
+    0.498433569972103029914E-02,
+    0.494887376202437487201E-02,
+    0.491320350871841897367E-02,
+    0.487732826815870573054E-02,
+    0.484125139721057135214E-02,
+    0.480497628118194150483E-02,
+    0.476850633375474925263E-02,
+    0.473184499691503264714E-02,
+    0.469499574088179046532E-02,
+    0.465796206403469754658E-02,
+    0.462074749284080687482E-02,
+    0.458335558178039420335E-02,
+    0.454578991327213285488E-02,
+    0.450805409759782158001E-02,
+    0.447015177282692726900E-02,
+    0.443208660474124713206E-02,
+    0.439386228676004195260E-02,
+    0.435548253986604343679E-02,
+    0.431695111253279479928E-02,
+    0.427827178065384480959E-02,
+    0.423944834747438184434E-02,
+    0.420048464352596631772E-02,
+    0.416138452656509745764E-02,
+    0.412215188151643401528E-02,
+    0.408279062042157838350E-02,
+    0.404330468239442998549E-02,
+    0.400369803358421688562E-02,
+    0.396397466714742455513E-02,
+    0.392413860322995774660E-02,
+    0.388419388896099560998E-02,
+    0.384414459846013158917E-02,
+    0.380399483285952829161E-02,
+    0.376374872034296338241E-02,
+    0.372341041620379550870E-02,
+    0.368298410292403911967E-02,
+    0.364247399027690353194E-02,
+    0.360188431545532431869E-02,
+    0.356121934322919357659E-02,
+    0.352048336613417922682E-02,
+    0.347968070469521146972E-02,
+    0.343881570768790591876E-02,
+    0.339789275244138669739E-02,
+    0.335691624518616761342E-02,
+    0.331589062145094394706E-02,
+    0.327482034651233969564E-02,
+    0.323370991590184336368E-02,
+    0.319256385597434736790E-02,
+    0.315138672454287935858E-02,
+    0.311018311158427546158E-02,
+    0.306895764002069252174E-02,
+    0.302771496658198544480E-02,
+    0.298645978275408290247E-02,
+    0.294519681581857582284E-02,
+    0.290393082998878368175E-02,
+    0.286266662764757868253E-02,
+    0.282140905069222207923E-02,
+    0.278016298199139435045E-02,
+    0.273893334695947541201E-02,
+    0.269772511525294586667E-02,
+    0.265654330259352828314E-02,
+    0.261539297272236109225E-02,
+    0.257427923948908888092E-02,
+    0.253320726907925325750E-02,
+    0.249218228238276930060E-02,
+    0.245120955750556483923E-02,
+    0.241029443242563417382E-02,
+    0.236944230779380495146E-02,
+    0.232865864987842738864E-02,
+    0.228794899365195972378E-02,
+    0.224731894601603393082E-02,
+    0.220677418916003329194E-02,
+    0.216632048404649142727E-02,
+    0.212596367401472533045E-02,
+    0.208570968849203942640E-02,
+    0.204556454679958293446E-02,
+    0.200553436203751169944E-02,
+    0.196562534503150547732E-02,
+    0.192584380831993546204E-02,
+    0.188619617015808475394E-02,
+    0.184668895851282540913E-02,
+    0.180732881501808930079E-02,
+    0.176812249885838886701E-02,
+    0.172907689054461607168E-02,
+    0.169019899554346019117E-02,
+    0.165149594771914570655E-02,
+    0.161297501254393423070E-02,
+    0.157464359003212166189E-02,
+    0.153650921735128916170E-02,
+    0.149857957106456636214E-02,
+    0.146086246895890987689E-02,
+    0.142336587141720519900E-02,
+    0.138609788229672549700E-02,
+    0.134906674928353113127E-02,
+    0.131228086370221478128E-02,
+    0.127574875977346947345E-02,
+    0.123947911332878396534E-02,
+    0.120348074001265964881E-02,
+    0.116776259302858043685E-02,
+    0.113233376051597664917E-02,
+    0.109720346268191941940E-02,
+    0.106238104885340071375E-02,
+    0.102787599466367326179E-02,
+    0.993697899638760857945E-03,
+    0.959856485506936206261E-03,
+    0.926361595613111283368E-03,
+    0.893223195879324912340E-03,
+    0.860451377808527848128E-03,
+    0.828056364077226302608E-03,
+    0.796048517297550871506E-03,
+    0.764438352543882784191E-03,
+    0.733236554224767912055E-03,
+    0.702453997827572321358E-03,
+    0.672101776960108194646E-03,
+    0.642191235948505088403E-03,
+    0.612734008012225209294E-03,
+    0.583742058714979703847E-03,
+    0.555227733977307579715E-03,
+    0.527203811431658386125E-03,
+    0.499683553312800484519E-03,
+    0.472680758429262691232E-03,
+    0.446209810101403247488E-03,
+    0.420285716355361231823E-03,
+    0.394924138246873704434E-03,
+    0.370141402122251665232E-03,
+    0.345954492129903871350E-03,
+    0.322381020652862389664E-03,
+    0.299439176850911730874E-03,
+    0.277147657465187357459E-03,
+    0.255525589595236862014E-03,
+    0.234592462123925204879E-03,
+    0.214368090034216937149E-03,
+    0.194872642236641146532E-03,
+    0.176126765545083195474E-03,
+    0.158151830411132242924E-03,
+    0.140970302204104791413E-03,
+    0.124606200241498368482E-03,
+    0.109085545645741522051E-03,
+    0.944366322532705527066E-04,
+    0.806899228014035293851E-04,
+    0.678774554733972416227E-04,
+    0.560319507856164252140E-04,
+    0.451863674126296143105E-04,
+    0.353751372055189588628E-04,
+    0.266376412339000901358E-04,
+    0.190213681905875816679E-04,
+    0.125792781889592743525E-04,
+    0.736624069102321668857E-05,
+    0.345456507169149134898E-05,
+    0.945715933950007048827E-06,
+  };
+
+  if ( n == 1 )
+  {
+    webbur::r8vec_copy ( n, w_001, w );
+  }
+  else if ( n == 3 )
+  {
+    webbur::r8vec_copy ( n, w_003, w );
+  }
+  else if ( n == 7 )
+  {
+    webbur::r8vec_copy ( n, w_007, w );
+  }
+  else if ( n == 15 )
+  {
+    webbur::r8vec_copy ( n, w_015, w );
+  }
+  else if ( n == 31 )
+  {
+    webbur::r8vec_copy ( n, w_031, w );
+  }
+  else if ( n == 63 )
+  {
+    webbur::r8vec_copy ( n, w_063, w );
+  }
+  else if ( n == 127 )
+  {
+    webbur::r8vec_copy ( n, w_127, w );
+  }
+  else if ( n == 255 )
+  {
+    webbur::r8vec_copy ( n, w_255, w );
+  }
+  else if ( n == 511 )
+  {
+    webbur::r8vec_copy ( n, w_511, w );
+  }
+  else
+  {
+    std::cerr << "\n";
+    std::cerr << "PATTERSON_LOOKUP_WEIGHTS - Fatal error!\n";
+    std::cerr << "  Unexpected value of N = " << n << ".\n";
+    std::exit ( 1 );
+  }
+  return;
+}
+//****************************************************************************80
+
+void patterson_lookup_weights_np ( int n, int np, double p[], double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    PATTERSON_LOOKUP_WEIGHTS_NP looks up Patterson quadrature weights.
+//
+//  Discussion:
+//
+//    The allowed orders are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
+//
+//    The weights are positive, symmetric and should sum to 2.
+//
+//    The user must preallocate space for the output array W.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    25 April 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Milton Abramowitz, Irene Stegun,
+//    Handbook of Mathematical Functions,
+//    National Bureau of Standards, 1964,
+//    ISBN: 0-486-61272-4,
+//    LC: QA47.A34.
+//
+//    Arthur Stroud, Don Secrest,
+//    Gaussian Quadrature Formulas,
+//    Prentice Hall, 1966,
+//    LC: QA299.4G3S7.
+//
+//  Parameters:
+//
+//    Input, int N, the order.
+//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 or 511.
+//
+//    Input, int NP, the number of parameters.
+//
+//    Input, double P[NP], parameters which are not needed by this function.
+//
+//    Output, double W[N], the weights.
+//
+{
+  patterson_lookup_weights ( n, w );
+
+  return;
+}
+//****************************************************************************80
+
+int point_radial_tol_unique_count ( int m, int n, double a[], double tol,
+  int *seed )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    POINT_RADIAL_TOL_UNIQUE_COUNT counts the tolerably unique points.
+//
+//  Discussion:
+//
+//    The input data is an M x N array A, representing the M-dimensional
+//    coordinates of N points.
+//
+//    The output is the number of tolerably unique points in the list.
+//
+//    This program performs the same task as POINT_TOL_UNIQUE_COUNT.
+//    But that program is guaranteed to use N^2 comparisons.
+//
+//    It is hoped that this function, on the other hand, will tend
+//    to use O(N) comparisons after an O(NLog(N)) sort.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    24 July 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, the number of rows.
+//
+//    Input, int N, the number of columns.
+//
+//    Input, double A[M*N], the array of N columns of data.
+//
+//    Input, double TOL, a tolerance for equality.
+//
+//    Input/output, int *SEED, a seed for the random
+//    number generator.
+//
+//    Output, int POINT_RADIAL_TOL_UNIQUE_COUNT, the number of tolerably
+//    unique points.
+//
+{
+  double dist;
+  int hi;
+  int i;
+  int *indx;
+  int j;
+  int k;
+  double *r;
+  bool *unique;
+  int unique_num;
+  double *w;
+  double w_sum;
+  double *z;
+
+  if ( n <= 0 )
+  {
+    unique_num = 0;
+    return unique_num;
+  }
+//
+//  Assign a base point Z randomly in the convex hull.
+//
+  w = webbur::r8vec_uniform_01_new ( n, seed );
+  w_sum = webbur::r8vec_sum ( n, w );
+  for ( j = 0; j < n; j++ )
+  {
+    w[j] = w[j] / w_sum;
+  }
+
+  z = new double[m];
+  for ( i = 0; i < m; i++ )
+  {
+    z[i] = 0.0;
+    for ( j = 0; j < n; j++ )
+    {
+      z[i] = z[i] + a[i+j*m] * w[j];
+    }
+  }
+//
+//  Compute the radial distance R of each point to Z.
+//
+  r = new double[n];
+
+  for ( j = 0; j < n; j++ )
+  {
+    r[j] = 0.0;
+    for ( i = 0; i < m; i++ )
+    {
+      r[j] = r[j] + std::pow ( a[i+j*m] - z[i], 2 );
+    }
+    r[j] = std::sqrt ( r[j] );
+  }
+//
+//  Implicitly sort the R array.
+//
+  indx = webbur::r8vec_sort_heap_index_a_new ( n, r );
+//
+//  To determine if a point I is tolerably unique, we only have to check
+//  whether it is distinct from all points J such that R(I) <= R(J) <= R(J)+TOL.
+//
+  unique_num = 0;
+
+  unique = new bool[n];
+  for ( i = 0; i < n; i++ )
+  {
+    unique[i] = true;
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    if ( unique[indx[i]] )
+    {
+//
+//  Point INDX(I) is unique, in that no earlier point is near it.
+//
+      unique_num = unique_num + 1;
+//
+//  Look for later points which are close to point INDX(I)
+//  in terms of R.
+//
+      hi = i;
+
+      while ( hi < n - 1 )
+      {
+        if ( r[indx[i]] + tol < r[indx[hi+1]] )
+        {
+          break;
+        }
+        hi = hi + 1;
+      }
+//
+//  Points INDX(I+1) through INDX(HI) have an R value close to
+//  point INDX(I).  Are they truly close to point INDEX(I)?
+//
+      for ( j = i + 1; j <= hi; j++ )
+      {
+        if ( unique[indx[j]] )
+        {
+          dist = 0.0;
+          for ( k = 0; k < m; k++ )
+          {
+            dist = dist + std::pow ( a[k+indx[i]*m] - a[k+indx[j]*m], 2 );
+          }
+          dist = std::sqrt ( dist );
+
+          if ( dist <= tol )
+          {
+            unique[indx[j]] = false;
+          }
+        }
+      }
+    }
+  }
+
+  delete [] indx;
+  delete [] r;
+  delete [] unique;
+  delete [] w;
+  delete [] z;
+
+  return unique_num;
+}
+//****************************************************************************80
+
+void point_radial_tol_unique_count_inc1 ( int m, int n1, double a1[],
+  double tol, int *seed, double z[], double r1[], int indx1[], bool unique1[],
+  int *unique_num1 )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    POINT_RADIAL_TOL_UNIQUE_COUNT_INC1 counts the tolerably unique points.
+//
+//  Discussion:
+//
+//    The input data includes an M x N1 array A1 of a set of N1
+//    "permanent" points and N2 "temporary" points.
+//
+//    This is a two step version of POINT_RADIAL_TOL_UNIQUE_COUNT_INC.
+//
+//    This means that we want to identify the tolerably unique points
+//    among the permanent points before processing the temporary points.
+//
+//    If many sets of temporary data are considered, this function will
+//    do a lot of unnecessary work resorting the permanent data; it would
+//    be possible to avoid repetitions of that work at the expense of saving
+//    various work vectors.  This function accepts the overhead of the
+//    repeated calculations for the benefit of only having to "remember"
+//    the number of unique points discovered.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    01 October 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, the number of rows.
+//
+//    Input, int N1, the number of permanent points.
+//
+//    Input, double A1[M*N1], the permanent points.
+//
+//    Input, double TOL, a tolerance for equality.
+//
+//    Input/output, int *SEED, a seed for the random
+//    number generator.
+//
+//    Output, double Z[M], a random base vector used to
+//    linearly sort the data.
+//
+//    Output, double R1[N1], the scalar values assigned to
+//    the data for sorting.
+//
+//    Output, int INDX1[N1], the ascending sort index
+//    for A1.
+//
+//    Output, bool UNIQUE1[N1], is TRUE for each unique permanent point.
+//
+//    Output, int *UNIQUE_NUM1, the number of tolerably
+//    unique permanent points.
+//
+{
+  double dist;
+  int hi;
+  int i;
+  int j;
+  int j1;
+  int k1;
+  double *w;
+  double w_sum;
+//
+//  Assign a base point Z randomly in the convex hull of the permanent points.
+//
+  w = webbur::r8vec_uniform_01_new ( n1, seed );
+  w_sum = webbur::r8vec_sum ( n1, w );
+  for ( j1 = 0; j1 < n1; j1++ )
+  {
+    w[j1] = w[j1] / w_sum;
+  }
+  for ( i = 0; i < m; i++ )
+  {
+    z[i] = 0.0;
+    for ( j1 = 0; j1 < n1; j1++ )
+    {
+      z[i] = z[i] + a1[i+j1*m] * w[j1];
+    }
+  }
+//
+//  Initialize the permanent point data.
+//
+  for ( j1 = 0; j1 < n1; j1++ )
+  {
+    r1[j1] = 0.0;
+    for ( i = 0; i < m; i++ )
+    {
+      r1[j1] = r1[j1] + std::pow ( a1[i+j1*m] - z[i], 2 );
+    }
+    r1[j1] = std::sqrt ( r1[j1] );
+  }
+  webbur::r8vec_sort_heap_index_a ( n1, r1, indx1 );
+
+  *unique_num1 = 0;
+  for ( j1 = 0; j1 < n1; j1++ )
+  {
+    unique1[j1] = true;
+  }
+//
+//  STEP 1:
+//  Compare PERMANENT POINTS to PERMANENT POINTS.
+//
+  for ( j1 = 0; j1 < n1; j1++ )
+  {
+    if ( unique1[indx1[j1]] )
+    {
+      *unique_num1 = *unique_num1 + 1;
+
+      hi = j1;
+
+      while ( hi < n1 - 1 )
+      {
+        if ( r1[indx1[j1]] + tol < r1[indx1[hi+1]] )
+        {
+          break;
+        }
+        hi = hi + 1;
+      }
+
+      for ( k1 = j1 + 1; k1 <= hi; k1++ )
+      {
+        if ( unique1[indx1[k1]] )
+        {
+          dist = 0.0;
+          for ( i = 0; i < m; i++ )
+          {
+            dist = dist + std::pow ( a1[i+indx1[j1]*m] - a1[i+indx1[k1]*m], 2 );
+          }
+          dist = std::sqrt ( dist );
+
+          if ( dist <= tol )
+          {
+            unique1[indx1[k1]] = false;
+          }
+        }
+      }
+    }
+  }
+
+  delete [] w;
+
+  return;
+}
+//****************************************************************************80
+
+void point_radial_tol_unique_count_inc2 ( int m, int n1, double a1[], int n2,
+  double a2[], double tol, double z[], double r1[], int indx1[], bool unique1[],
+  int *unique_num2 )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    POINT_RADIAL_TOL_UNIQUE_COUNT_INC2 counts the tolerably unique points.
+//
+//  Discussion:
+//
+//    The input data includes an M x N1 array A1 and an M x N2 array A2,
+//    representing the M-dimensional coordinates of a set of N1
+//    "permanent" points and N2 "temporary" points.
+//
+//    This is an "incremental" version of POINT_RADIAL_TOL_UNIQUE_COUNT.
+//
+//    This means that we want to identify the tolerably unique points
+//    among the permanent points before processing the temporary points.
+//
+//    If many sets of temporary data are considered, this function will
+//    do a lot of unnecessary work resorting the permanent data; it would
+//    be possible to avoid repetitions of that work at the expense of saving
+//    various work vectors.  This function accepts the overhead of the
+//    repeated calculations for the benefit of only having to "remember"
+//    the number of unique points discovered.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    01 October 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, the number of rows.
+//
+//    Input, int N1, the number of permanent points.
+//
+//    Input, double A1[M*N1], the permanent points.
+//
+//    Input, int N2, the number of temporary points.
+//
+//    Input, double A2[M*N2], the temporary points.
+//
+//    Input, double TOL, a tolerance for equality.
+//
+//    Input, double Z[M], a random base vector used to
+//    linearly sort the data.
+//
+//    Input, double R1[N1], the scalar values assigned to
+//    the data for sorting.
+//
+//    Input, int INDX1[N1], the ascending sort index
+//    for A1.
+//
+//    Input, bool UNIQUE1[N1], is TRUE for each unique permanent point.
+//
+//    Output, int *UNIQUE_NUM2, the number of additional
+//    tolerably unique points if the temporary points are included.
+//
+{
+  double dist;
+  int hi;
+  int i;
+  int *indx2;
+  int j;
+  int j1;
+  int j2;
+  int j2_hi;
+  int j2_lo;
+  int k1;
+  int k2;
+  double r_hi;
+  double r_lo;
+  double *r2;
+  bool *unique2;
+//
+//  Initialize the temporary point data.
+//
+  r2 = new double[n2];
+  for ( j2 = 0; j2 < n2; j2++ )
+  {
+    r2[j2] = 0.0;
+    for ( i = 0; i < m; i++ )
+    {
+      r2[j2] = r2[j2] + std::pow ( a2[i+j2*m] - z[i], 2 );
+    }
+    r2[j2] = std::sqrt ( r2[j2] );
+  }
+
+  indx2 = new int[n2];
+  webbur::r8vec_sort_heap_index_a ( n2, r2, indx2 );
+
+  unique2 = new bool[n2];
+  for ( j2 = 0; j2 < n2; j2++ )
+  {
+    unique2[j2] = true;
+  }
+
+  *unique_num2 = 0;
+//
+//  STEP 2:
+//  Use PERMANENT points to eliminate TEMPORARY points.
+//
+  for ( j1 = 0; j1 < n1; j1++ )
+  {
+    if ( unique1[indx1[j1]] )
+    {
+      r_lo = r1[indx1[j1]] - tol;
+      r_hi = r1[indx1[j1]] + tol;
+
+      webbur::r8vec_index_sorted_range ( n2, r2, indx2, r_lo, r_hi,
+        &j2_lo, &j2_hi );
+
+      for ( j2 = j2_lo; j2 <= j2_hi; j2++ )
+      {
+        if ( unique2[indx2[j2]] )
+        {
+          dist = 0.0;
+          for ( i = 0; i < m; i++ )
+          {
+            dist = dist + std::pow ( a1[i+indx1[j1]*m]
+                                   - a2[i+indx2[j2]*m], 2 );
+          }
+          dist = std::sqrt ( dist );
+          if ( dist <= tol )
+          {
+            unique2[indx2[j2]] = false;
+          }
+        }
+      }
+    }
+  }
+//
+//  STEP 3:
+//  Use TEMPORARY points to eliminate TEMPORARY points.
+//
+  for ( j2 = 0; j2 < n2; j2++ )
+  {
+    if ( unique2[indx2[j2]] )
+    {
+      *unique_num2 = *unique_num2 + 1;
+
+      hi = j2;
+
+      while ( hi < n2 - 1 )
+      {
+        if ( r2[indx2[j2]] + tol < r2[indx2[hi+1]] )
+        {
+          break;
+        }
+        hi = hi + 1;
+      }
+
+      for ( k2 = j2 + 1; k2 <= hi; k2++ )
+      {
+        if ( unique2[indx2[k2]] )
+        {
+          dist = 0.0;
+          for ( i = 0; i < m; i++ )
+          {
+            dist = dist + std::pow ( a2[i+indx2[j2]*m] - a2[i+indx2[k2]*m], 2 );
+          }
+          dist = std::sqrt ( dist );
+
+          if ( dist <= tol )
+          {
+            unique2[indx2[k2]] = false;
+          }
+        }
+      }
+    }
+  }
+  delete [] indx2;
+  delete [] r2;
+  delete [] unique2;
+
+  return;
+}
+//****************************************************************************80
+
+int point_radial_tol_unique_index ( int m, int n, double a[], double tol,
+  int *seed, int undx[], int xdnu[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    POINT_RADIAL_TOL_UNIQUE_INDEX indexes the tolerably unique points.
+//
+//  Discussion:
+//
+//    The input data is an M x N array A, representing the M-dimensional
+//    coordinates of N points.
+//
+//    The output is:
+//    * the number of tolerably unique points in the list;
+//    * the index, in the list of unique items, of the representatives
+//      of each point;
+//    * the index, in A, of the tolerably unique representatives.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    28 July 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, the number of rows.
+//
+//    Input, int N, the number of columns.
+//
+//    Input, double A[M*N], the array of N columns of data.
+//
+//    Input, double TOL, a tolerance for equality.
+//
+//    Input/output, int SEED, a seed for the random
+//    number generator.
+//
+//    Output, int UNDX[UNIQUE_NUM], the index, in A, of the
+//    tolerably unique points.
+//
+//    Output, int XDNU[N], the index, in UNDX, of the
+//    tolerably unique point that "represents" this point.
+//
+//    Output, int POINT_RADIAL_TOL_UNIQUE_INDEX, the number of tolerably
+//    unique points.
+//
+{
+  double dist;
+  int hi;
+  int i;
+  int *indx;
+  int j;
+  int k;
+  double *r;
+  bool *unique;
+  int unique_num;
+  double *w;
+  double w_sum;
+  double *z;
+
+  if ( n <= 0 )
+  {
+    unique_num = 0;
+    return unique_num;
+  }
+//
+//  Assign a base point Z randomly in the convex hull.
+//
+  w = webbur::r8vec_uniform_01_new ( n, seed );
+  w_sum = webbur::r8vec_sum ( n, w );
+  for ( j = 0; j < n; j++ )
+  {
+    w[j] = w[j] / w_sum;
+  }
+
+  z = new double[m];
+  for ( i = 0; i < m; i++ )
+  {
+    z[i] = 0.0;
+    for ( j = 0; j < n; j++ )
+    {
+      z[i] = z[i] + a[i+j*m] * w[j];
+    }
+  }
+//
+//  Compute the radial distance R of each point to Z.
+//
+  r = new double[n];
+
+  for ( j = 0; j < n; j++ )
+  {
+    r[j] = 0.0;
+    for ( i = 0; i < m; i++ )
+    {
+      r[j] = r[j] + std::pow ( a[i+j*m] - z[i], 2 );
+    }
+    r[j] = std::sqrt ( r[j] );
+  }
+//
+//  Implicitly sort the R array.
+//
+  indx = webbur::r8vec_sort_heap_index_a_new ( n, r );
+//
+//  To determine if a point I is tolerably unique, we only have to check
+//  whether it is distinct from all points J such that R(I) <= R(J) <= R(J)+TOL.
+//
+  unique_num = 0;
+
+  unique = new bool[n];
+  for ( i = 0; i < n; i++ )
+  {
+    unique[i] = true;
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    if ( unique[indx[i]] )
+    {
+//
+//  Point INDX(I) is unique, in that no earlier point is near it.
+//
+      xdnu[indx[i]] = unique_num;
+      undx[unique_num] = indx[i];
+      unique_num = unique_num + 1;
+//
+//  Look for later points which are close to point INDX(I)
+//  in terms of R.
+//
+      hi = i;
+
+      while ( hi < n - 1 )
+      {
+        if ( r[indx[i]] + tol < r[indx[hi+1]] )
+        {
+          break;
+        }
+        hi = hi + 1;
+      }
+//
+//  Points INDX(I+1) through INDX(HI) have an R value close to
+//  point INDX(I).  Are they truly close to point INDEX(I)?
+//
+      for ( j = i + 1; j <= hi; j++ )
+      {
+        if ( unique[indx[j]] )
+        {
+          dist = 0.0;
+          for ( k = 0; k < m; k++ )
+          {
+            dist = dist + std::pow ( a[k+indx[i]*m] - a[k+indx[j]*m], 2 );
+          }
+          dist = std::sqrt ( dist );
+
+          if ( dist <= tol )
+          {
+            unique[indx[j]] = false;
+            xdnu[indx[j]] = xdnu[indx[i]];
+          }
+        }
+      }
+    }
+  }
+
+  delete [] indx;
+  delete [] r;
+  delete [] unique;
+  delete [] w;
+  delete [] z;
+
+  return unique_num;
+}
+//****************************************************************************80
+
+void point_radial_tol_unique_index_inc1 ( int m, int n1, double a1[],
+  double tol, int *seed, double z[], double r1[], int indx1[], bool unique1[],
+  int *unique_num1, int undx1[], int xdnu1[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    POINT_RADIAL_TOL_UNIQUE_INDEX_INC1 indexes the tolerably unique points.
+//
+//  Discussion:
+//
+//    The input data includes an M x N1 array A1 of
+//    "permanent" points.
+//
+//    This is a two step version of POINT_RADIAL_TOL_UNIQUE_INDEX_INC.
+//
+//    The output is:
+//    * the number of tolerably unique points in the list;
+//    * the index, in the list of unique items, of the representatives
+//      of each point;
+//    * the index, in A1, of the tolerably unique representatives.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    02 October 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, the number of rows.
+//
+//    Input, int N1, the number of permanent points.
+//
+//    Input, double A1[M*N1], the permanent points.
+//
+//    Input, double TOL, a tolerance for equality.
+//
+//    Input/output, int *SEED, a seed for the random
+//    number generator.
+//
+//    Output, double Z[M], a random base vector used to
+//    linearly sort the data.
+//
+//    Output, double R1[N1], the scalar values assigned to
+//    the data for sorting.
+//
+//    Output, int INDX1[N1], the ascending sort index for A1.
+//
+//    Output, bool UNIQUE1[N1], is TRUE for unique permanent points.
+//
+//    Output, int *UNIQUE_NUM1, the number of tolerably unique points
+//    with just the permanent points.
+//
+//    Output, int UNDX1[UNIQUE_NUM1], the index, in A1, of the tolerably
+//    unique points.
+//
+//    Output, int XDNU1[N1], the index, in UNDX1, of the tolerably unique
+//    point that "represents" this point.
+//
+{
+  double dist;
+  int hi;
+  int i;
+  int j;
+  int j1;
+  int k1;
+  double *w;
+  double w_sum;
+//
+//  Assign a base point Z randomly in the convex hull of the permanent points.
+//
+  w = webbur::r8vec_uniform_01_new ( n1, seed );
+  w_sum = webbur::r8vec_sum ( n1, w );
+  for ( j1 = 0; j1 < n1; j1++ )
+  {
+    w[j1] = w[j1] / w_sum;
+  }
+
+  for ( i = 0; i < m; i++ )
+  {
+    z[i] = 0.0;
+    for ( j1 = 0; j1 < n1; j1++ )
+    {
+      z[i] = z[i] + a1[i+j1*m] * w[j1];
+    }
+  }
+//
+//  Initialize the permanent point data.
+//
+  for ( j1 = 0; j1 < n1; j1++ )
+  {
+    r1[j1] = 0.0;
+    for ( i = 0; i < m; i++ )
+    {
+      r1[j1] = r1[j1] + std::pow ( a1[i+j1*m] - z[i], 2 );
+    }
+    r1[j1] = std::sqrt ( r1[j1] );
+  }
+  webbur::r8vec_sort_heap_index_a ( n1, r1, indx1 );
+
+  *unique_num1 = 0;
+  for ( j1 = 0; j1 < n1; j1++ )
+  {
+    unique1[j1] = true;
+  }
+//
+//  STEP 1:
+//  Compare PERMANENT POINTS to PERMANENT POINTS.
+//
+  for ( j1 = 0; j1 < n1; j1++ )
+  {
+    if ( unique1[indx1[j1]] )
+    {
+      xdnu1[indx1[j1]] = *unique_num1;
+      undx1[*unique_num1] = indx1[j1];
+      *unique_num1 = *unique_num1 + 1;
+
+      hi = j1;
+
+      while ( hi < n1 - 1 )
+      {
+        if ( r1[indx1[j1]] + tol < r1[indx1[hi+1]] )
+        {
+          break;
+        }
+        hi = hi + 1;
+      }
+
+      for ( k1 = j1 + 1; k1 <= hi; k1++ )
+      {
+        if ( unique1[indx1[k1]] )
+        {
+          dist = 0.0;
+          for ( i = 0; i < m; i++ )
+          {
+            dist = dist + std::pow ( a1[i+indx1[j1]*m] - a1[i+indx1[k1]*m], 2 );
+          }
+          dist = std::sqrt ( dist );
+
+          if ( dist <= tol )
+          {
+            unique1[indx1[k1]] = false;
+            xdnu1[indx1[k1]] = xdnu1[indx1[j1]];
+          }
+        }
+      }
+    }
+  }
+
+  delete [] w;
+
+  return;
+}
+//****************************************************************************80
+
+void point_radial_tol_unique_index_inc2 ( int m, int n1, double a1[], int n2,
+  double a2[], double tol, double z[], double r1[], int indx1[], bool unique1[],
+  int unique_num1, int undx1[], int xdnu1[], double r2[],
+  int indx2[], bool unique2[], int *unique_num2, int undx2[], int xdnu2[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    POINT_RADIAL_TOL_UNIQUE_INDEX_INC2 indexes unique temporary points.
+//
+//  Discussion:
+//
+//    The input data includes an M x N1 array A1 and an M x N2 array A2,
+//    representing the M-dimensional coordinates of a set of N1
+//    "permanent" points and N2 "temporary" points.
+//
+//    For notation, we use "A" to describe the M x (N1+N2) array that would be
+//    formed by starting with A1 and appending A2.
+//
+//    The output is:
+//    * the number of tolerably unique points in the list;
+//    * the index, in the list of unique items, of the representatives
+//      of each point;
+//    * the index, in A, of the tolerably unique representatives.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    08 October 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, the number of rows.
+//
+//    Input, int N1, the number of permanent points.
+//
+//    Input, double A1[M*N1], the permanent points.
+//
+//    Input, int N2, the number of temporary points.
+//
+//    Input, double A2[M*N2], the temporary points.
+//
+//    Input, double TOL, a tolerance for equality.
+//
+//    Input, double Z[M], a random base vector used to
+//    linearly sort the data.
+//
+//    Input, double R1[N1], the scalar values assigned to
+//    A1 for sorting.
+//
+//    Input, int INDX1[N1], the ascending sort index for A1.
+//
+//    Input, bool UNIQUE1[N1], is TRUE for unique permanent points.
+//
+//    Input, int UNIQUE_NUM1, the number of tolerably unique permanent points.
+//
+//    Input, int UNDX1[UNIQUE_NUM1],
+//    the index in A1 of the tolerably unique permanent points.
+//
+//    Input, int XDNU1[N1], the index in UNDX1
+//    of the tolerably unique permanent point that "represents" this point.
+//
+//    Output, double R2[N2], the scalar values assigned to
+//    A2 for sorting.
+//
+//    Output, int INDX2[N2], the ascending sort index for A2.
+//
+//    Output, bool UNIQUE2[N2], is TRUE for unique temporary points.
+//
+//    Output, int *UNIQUE_NUM2, the number
+//    of tolerably unique temporary points.
+//
+//    Output, int UNDX2[UNIQUE_NUM2],
+//    the index in A2 of the tolerably unique points, incremented by N1.
+//
+//    Output, int XDNU2[N2], the index, in UNDX1
+//    or UNDX2, of the tolerably unique point that "represents" this
+//    temporary point.  If the value represents an index in UNDX2, this
+//    can be inferred by the fact that its value is greater than or
+//    equal to UNIQUE_NUM1.  To reference UNDX2, the value should then be
+//    decremented by UNIQUE_NUM1.
+//
+{
+  double dist;
+  int hi;
+  int i;
+  int j;
+  int j1;
+  int j2;
+  int j2_hi;
+  int j2_lo;
+  int k1;
+  int k2;
+  double r_hi;
+  double r_lo;
+//
+//  Initialize the temporary point data.
+//
+  for ( j2 = 0; j2 < n2; j2++ )
+  {
+    r2[j2] = 0.0;
+    for ( i = 0; i < m; i++ )
+    {
+      r2[j2] = r2[j2] + std::pow ( a2[i+j2*m] - z[i], 2 );
+    }
+    r2[j2] = std::sqrt ( r2[j2] );
+  }
+
+  webbur::r8vec_sort_heap_index_a ( n2, r2, indx2 );
+
+  for ( j2 = 0; j2 < n2; j2++ )
+  {
+    unique2[j2] = true;
+  }
+
+  *unique_num2 = 0;
+//
+//  STEP 2:
+//  Use PERMANENT points to eliminate TEMPORARY points.
+//
+  for ( j1 = 0; j1 < n1; j1++ )
+  {
+    if ( unique1[indx1[j1]] )
+    {
+      r_lo = r1[indx1[j1]] - tol;
+      r_hi = r1[indx1[j1]] + tol;
+
+      webbur::r8vec_index_sorted_range ( n2, r2, indx2, r_lo, r_hi,
+        &j2_lo, &j2_hi );
+
+      for ( j2 = j2_lo; j2 <= j2_hi; j2++ )
+      {
+        if ( unique2[indx2[j2]] )
+        {
+          dist = 0.0;
+          for ( i = 0; i < m; i++ )
+          {
+            dist = dist + std::pow ( a1[i+indx1[j1]*m]
+                                   - a2[i+indx2[j2]*m], 2 );
+          }
+          dist = std::sqrt ( dist );
+          if ( dist <= tol )
+          {
+            unique2[indx2[j2]] = false;
+            xdnu2[indx2[j2]] = xdnu1[indx1[j1]];
+          }
+        }
+      }
+    }
+  }
+//
+//  STEP 3:
+//  Use TEMPORARY points to eliminate TEMPORARY points.
+//
+  for ( j2 = 0; j2 < n2; j2++ )
+  {
+    if ( unique2[indx2[j2]] )
+    {
+      xdnu2[indx2[j2]] = unique_num1 + *unique_num2;
+      undx2[*unique_num2] = indx2[j2] + n1;
+      *unique_num2 = *unique_num2 + 1;
+
+      hi = j2;
+
+      while ( hi < n2 - 1 )
+      {
+        if ( r2[indx2[j2]] + tol < r2[indx2[hi+1]] )
+        {
+          break;
+        }
+        hi = hi + 1;
+      }
+
+      for ( k2 = j2 + 1; k2 <= hi; k2++ )
+      {
+        if ( unique2[indx2[k2]] )
+        {
+          dist = 0.0;
+          for ( i = 0; i < m; i++ )
+          {
+            dist = dist + std::pow ( a2[i+indx2[j2]*m] - a2[i+indx2[k2]*m], 2 );
+          }
+          dist = std::sqrt ( dist );
+
+          if ( dist <= tol )
+          {
+            unique2[indx2[k2]] = false;
+            xdnu2[indx2[k2]] = xdnu2[indx2[j2]];
+          }
+        }
+      }
+    }
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void point_radial_tol_unique_index_inc3 ( int m, int n1, double a1[],
+  double r1[], int indx1[], bool unique1[], int unique_num1, int undx1[],
+  int xdnu1[], int n2, double a2[], double r2[], int indx2[], bool unique2[],
+  int unique_num2, int undx2[], int xdnu2[], int *n3, double a3[], double r3[],
+  int indx3[], bool unique3[], int *unique_num3, int undx3[], int xdnu3[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    POINT_RADIAL_TOL_UNIQUE_INDEX_INC3 merges index data.
+//
+//  Discussion:
+//
+//    This function may be called after *INDEX_INC1 has created index
+//    information for the permanent data, and *INDEX_INC2 has created
+//    augmenting information for a set of temporary data which now is
+//    to be merged with the permanent data.
+//
+//    The function merges the data and index information to create a
+//    new "permanent" data set.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    08 October 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, the number of rows.
+//
+//    Input, int N1, the number of permanent points.
+//
+//    Input, double A1[M*N1], the permanent points.
+//
+//    Input, double R1[N1], the scalar values assigned to
+//    the data for sorting.
+//
+//    Input, int INDX1[N1], the ascending sort index
+//    for A1.
+//
+//    Input, bool UNIQUE1[N1], is TRUE for each unique permanent point.
+//
+//    Input, int UNIQUE_NUM1, the number
+//    of tolerably unique points with just the permanent points.
+//
+//    Input, int UNDX1[UNIQUE_NUM1],
+//    the index in A1 of the tolerably unique points.
+//
+//    Input, int XDNU1[N1], the index in UNDX1
+//    of the tolerably unique point that "represents" this point.
+//
+//    Input, int N2, the number of temporary points.
+//
+//    Input, double A2[M,N2], the temporary points.
+//
+//    Input, double R2[N2], the scalar values assigned to
+//    the data for sorting.
+//
+//    Input, int INDX2[N2], the ascending sort index
+//    for A2.
+//
+//    Input, bool UNIQUE2[N2], is TRUE for each unique temporary point.
+//
+//    Input, int UNIQUE_NUM2, the number
+//    of tolerably unique temporary points.
+//
+//    Input, int UNDX2[UNIQUE_NUM2],
+//    the index in A2 of the tolerably unique points, incremented by UNIQUE_NUM1.
+//
+//    Input, int XDNU2[N2], the index in UNDX1 or UNDX2
+//    of the tolerably unique point that "represents" this point.
+//
+//    Output, int *N3, the number of permanent points.
+//
+//    Output, double A3[M,N3], the permanent points.
+//
+//    Output, double R3[N3], the scalar values assigned to
+//    the data for sorting.
+//
+//    Output, int INDX3[N3], the ascending sort index
+//    for A3.
+//
+//    Output, bool UNIQUE3[N3], is TRUE for each unique permanent point.
+//
+//    Output, int *UNIQUE_NUM3, the number
+//    of tolerably unique points.
+//
+//    Output, int UNDX3[UNIQUE_NUM3],
+//    the index in A3 of the tolerably unique points.
+//
+//    Output, int XDNU3[N3], the index in UNDX3
+//    of the tolerably unique point that "represents" this point.
+//
+{
+  int i;
+  int i1;
+  int i2;
+  int i3;
+  double v1;
+  double v2;
+
+  *n3 = n1 + n2;
+
+  for ( i1 = 0; i1 < n1; i1++ )
+  {
+    for ( i = 0; i < m; i++ )
+    {
+      a3[i+i1*m] = a1[i+i1*m];
+    }
+  }
+  for ( i2 = 0; i2 < n2; i2++ )
+  {
+    i3 = n1 + i2;
+    for ( i = 0; i < m; i++ )
+    {
+      a3[i+i3*m] = a2[i+i2*m];
+    }
+  }
+  for ( i1 = 0; i1 < n1; i1++ )
+  {
+    r3[i1]= r1[i1];
+  }
+  for ( i2 = 0; i2 < n2; i2++ )
+  {
+    i3 = n1 + i2;
+    r3[i3] = r2[i2];
+  }
+//
+//  Interleave the two INDX arrays so that INDX3 presents the entries
+//  of A3 in ascending R3 order.
+//
+  i1 = 0;
+  i2 = 0;
+
+  for ( i3 = 0; i3 < *n3; i3++ )
+  {
+    if ( i1 < n1 )
+    {
+      v1 = r1[indx1[i1]];
+    }
+    else
+    {
+      v1 = r8_huge ( );
+    }
+
+    if ( i2 < n2 )
+    {
+      v2 = r2[indx2[i2]];
+    }
+    else
+    {
+      v2 = r8_huge ( );
+    }
+
+    if ( v1 <= v2 )
+    {
+      indx3[i3] = indx1[i1];
+      i1 = i1 + 1;
+    }
+    else
+    {
+      indx3[i3] = indx2[i2] + n1;
+      i2 = i2 + 1;
+    }
+  }
+
+  *unique_num3 = unique_num1 + unique_num2;
+
+  for ( i1 = 0; i1 < n1; i1++ )
+  {
+    unique3[i1] = unique1[i1];
+  }
+  for ( i2 = 0; i2 < n2; i2++ )
+  {
+    i3 = n1 + i2;
+    unique3[i3] = unique2[i2];
+  }
+//
+//  The entries in UNDX2 were already incremented by N2 if they pointed
+//  to an entry of A2, so all entries in UNDX2 correctly index A3.
+//
+  for ( i1 = 0; i1 < unique_num1; i1++ )
+  {
+    undx3[i1] = undx1[i1];
+  }
+  for ( i2 = 0; i2 < unique_num2; i2++ )
+  {
+    i3 = unique_num1 + i2;
+    undx3[i3] = undx2[i2];
+  }
+//
+//  Note that the entries of XDNU2 were already incremented by N2
+//  so that they correctly index A3, not A2.
+//
+  for ( i1 = 0; i1 < n1; i1++ )
+  {
+    xdnu3[i1] = xdnu1[i1];
+  }
+  for ( i2 = 0; i2 < n2; i2++ )
+  {
+    i3 = n1 + i2;
+    xdnu3[i3] = xdnu2[i2];
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void point_unique_index ( int m, int n, double a[], int unique_num, int undx[],
+  int xdnu[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    POINT_UNIQUE_INDEX indexes unique points.
+//
+//  Discussion:
+//
+//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+//    each of length M.
+//
+//    The goal of this routine is to determine a vector UNDX,
+//    which points to the unique elements of A, in sorted order,
+//    and a vector XDNU, which identifies, for each entry of A, the index of
+//    the unique sorted element of A.
+//
+//    This is all done with index vectors, so that the elements of
+//    A are never moved.
+//
+//    The first step of the algorithm requires the indexed sorting
+//    of A, which creates arrays INDX and XDNI.  (If all the entries
+//    of A are unique, then these arrays are the same as UNDX and XDNU.)
+//
+//    We then use INDX to examine the entries of A in sorted order,
+//    noting the unique entries, creating the entries of XDNU and
+//    UNDX as we go.
+//
+//    Once this process has been completed, the vector A could be
+//    replaced by a compressed vector XU, containing the unique entries
+//    of A in sorted order, using the formula
+//
+//      XU(*) = A(UNDX(*)).
+//
+//    We could then, if we wished, reconstruct the entire vector A, or
+//    any element of it, by index, as follows:
+//
+//      A(I) = XU(XDNU(I)).
+//
+//    We could then replace A by the combination of XU and XDNU.
+//
+//    Later, when we need the I-th entry of A, we can locate it as
+//    the XDNU(I)-th entry of XU.
+//
+//    Here is an example of a vector A, the sort and inverse sort
+//    index vectors, and the unique sort and inverse unique sort vectors
+//    and the compressed unique sorted vector.
+//
+//      I     A  Indx  Xdni       XU  Undx  Xdnu
+//    ----+-----+-----+-----+--------+-----+-----+
+//      0 | 11.     0     0 |    11.     0     0
+//      1 | 22.     2     4 |    22.     1     1
+//      2 | 11.     5     1 |    33.     3     0
+//      3 | 33.     8     7 |    55.     4     2
+//      4 | 55.     1     8 |                  3
+//      5 | 11.     6     2 |                  0
+//      6 | 22.     7     5 |                  1
+//      7 | 22.     3     6 |                  1
+//      8 | 11.     4     3 |                  0
+//
+//    INDX(2) = 3 means that sorted item(2) is A(3).
+//    XDNI(2) = 5 means that A(2) is sorted item(5).
+//
+//    UNDX(3) = 4 means that unique sorted item(3) is at A(4).
+//    XDNU(8) = 2 means that A(8) is at unique sorted item(2).
+//
+//    XU(XDNU(I))) = A(I).
+//    XU(I)        = A(UNDX(I)).
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 July 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, the dimension of the data values.
+//
+//    Input, int N, the number of data values,
+//
+//    Input, double A[M*N], the data values.
+//
+//    Input, int UNIQUE_NUM, the number of unique values in A.
+//    This value is only required for languages in which the size of
+//    UNDX must be known in advance.
+//
+//    Output, int UNDX[UNIQUE_NUM], the UNDX vector.
+//
+//    Output, int XDNU[N], the XDNU vector.
+//
+{
+  double diff;
+  int i;
+  int *indx;
+  int j;
+  int k;
+//
+//  Implicitly sort the array.
+//
+  indx = webbur::r8col_sort_heap_index_a ( m, n, a );
+//
+//  Walk through the implicitly sorted array.
+//
+  i = 0;
+
+  j = 0;
+  undx[j] = indx[i];
+
+  xdnu[indx[i]] = j;
+
+  for ( i = 1; i < n; i++ )
+  {
+    diff = 0.0;
+    for ( k = 0; k < m; k++ )
+    {
+      diff = webbur::r8_max ( diff,
+        webbur::r8_abs ( a[k+indx[i]*m] - a[k+undx[j]*m] ) );
+    }
+    if ( 0.0 < diff )
+    {
+      j = j + 1;
+      undx[j] = indx[i];
+    }
+    xdnu[indx[i]] = j;
+  }
+  delete [] indx;
+
+  return;
+}
+//****************************************************************************80
+
+void product_mixed_weight ( int dim_num, int order_1d[], int order_nd,
+  int rule[], double alpha[], double beta[], double weight_nd[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    PRODUCT_MIXED_WEIGHT computes the weights of a mixed product rule.
+//
+//  Discussion:
+//
+//    This routine computes the weights for a quadrature rule which is
+//    a product of 1D rules of varying order and kind.
+//
+//    The user must preallocate space for the output array WEIGHT_ND.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    11 February 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int DIM_NUM, the spatial dimension.
+//
+//    Input, int ORDER_1D[DIM_NUM], the order of the 1D rules.
+//
+//    Input, int ORDER_ND, the order of the product rule.
+//
+//    Input, int RULE[DIM_NUM], the rule in each dimension.
+//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
+//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
+//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
+//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
+//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
+//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
+//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
+//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
+//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
+//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
+//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
+//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
+//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
+//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
+//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
+//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
+//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
+//
+//    Input, double ALPHA[DIM_NUM], BETA[DIM_NUM], parameters used for
+//    Generalized Gauss Hermite, Generalized Gauss Laguerre,
+//    and Gauss Jacobi rules.
+//
+//    Output, double WEIGHT_ND[ORDER_ND], the product rule weights.
+//
+{
+  int dim;
+  int i;
+  double *weight_1d;
+
+  for ( i = 0; i < order_nd; i++ )
+  {
+    weight_nd[i] = 1.0;
+  }
+
+  for ( dim = 0; dim < dim_num; dim++ )
+  {
+    weight_1d = new double[order_1d[dim]];
+
+    if ( rule[dim] == 1 )
+    {
+      webbur::clenshaw_curtis_compute_weights ( order_1d[dim], weight_1d );
+    }
+    else if ( rule[dim] == 2 )
+    {
+      webbur::fejer2_compute_weights ( order_1d[dim], weight_1d );
+    }
+    else if ( rule[dim] == 3 )
+    {
+      webbur::patterson_lookup_weights ( order_1d[dim], weight_1d );
+    }
+    else if ( rule[dim] == 4 )
+    {
+      webbur::legendre_compute_weights ( order_1d[dim], weight_1d );
+    }
+    else if ( rule[dim] == 5 )
+    {
+      webbur::hermite_compute_weights ( order_1d[dim], weight_1d );
+    }
+    else if ( rule[dim] == 6 )
+    {
+      webbur::gen_hermite_compute_weights ( order_1d[dim], alpha[dim], weight_1d );
+    }
+    else if ( rule[dim] == 7 )
+    {
+      webbur::laguerre_compute_weights ( order_1d[dim], weight_1d );
+    }
+    else if ( rule[dim] == 8 )
+    {
+      webbur::gen_laguerre_compute_weights ( order_1d[dim], alpha[dim], weight_1d );
+    }
+    else if ( rule[dim] == 9 )
+    {
+      webbur::jacobi_compute_weights ( order_1d[dim], alpha[dim], beta[dim], weight_1d );
+    }
+    else if ( rule[dim] == 10 )
+    {
+      std::cerr << "\n";
+      std::cerr << "PRODUCT_MIXED_WEIGHT - Fatal error!\n";
+      std::cerr << "  Do not know how to set weights for rule 10.\n";
+      std::exit ( 1 );
+    }
+    else if ( rule[dim] == 11 )
+    {
+      webbur::clenshaw_curtis_compute_weights ( order_1d[dim], weight_1d );
+    }
+    else if ( rule[dim] == 12 )
+    {
+      webbur::fejer2_compute_weights ( order_1d[dim], weight_1d );
+    }
+    else if ( rule[dim] == 13 )
+    {
+      webbur::patterson_lookup_weights ( order_1d[dim], weight_1d );
+    }
+    else if ( rule[dim] == 14 )
+    {
+      webbur::clenshaw_curtis_compute_weights ( order_1d[dim], weight_1d );
+    }
+    else if ( rule[dim] == 15 )
+    {
+      webbur::fejer2_compute_weights ( order_1d[dim], weight_1d );
+    }
+    else if ( rule[dim] == 16 )
+    {
+      webbur::patterson_lookup_weights ( order_1d[dim], weight_1d );
+    }
+    else if ( rule[dim] == 17 )
+    {
+      webbur::ccn_compute_weights ( order_1d[dim], weight_1d );
+    }
+    else
+    {
+      std::cerr << "\n";
+      std::cerr << "PRODUCT_MIXED_WEIGHT - Fatal error!\n";
+      std::cerr << "  Unexpected value of RULE[" << dim << "] = "
+           << rule[dim] << ".\n";
+      std::exit ( 1 );
+    }
+
+    webbur::r8vec_direct_product2 ( dim, order_1d[dim], weight_1d,
+      dim_num, order_nd, weight_nd );
+
+    delete [] weight_1d;
+  }
+  return;
+}
+//****************************************************************************80
+
+double r8_abs ( double x )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_ABS returns the absolute value of an R8.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, double X, the quantity whose absolute value is desired.
+//
+//    Output, double R8_ABS, the absolute value of X.
+//
+{
+  double value;
+
+  if ( 0.0 <= x )
+  {
+    value = x;
+  }
+  else
+  {
+    value = -x;
+  }
+  return value;
+}
+//****************************************************************************80
+
+double r8_ceiling ( double x )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_CEILING rounds an R8 "up" (towards +oo) to the next integer.
+//
+//  Example:
+//
+//    X        R8_CEILING(X)
+//
+//   -1.1      -1.0
+//   -1.0      -1.0
+//   -0.9       0.0
+//   -0.1       0.0
+//    0.0       0.0
+//    0.1       1.0
+//    0.9       1.0
+//    1.0       1.0
+//    1.1       2.0
+//    2.9       3.0
+//    3.0       3.0
+//    3.14159   4.0
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    01 April 2004
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, double X, the number whose ceiling is desired.
+//
+//    Output, double R8_CEILING, the ceiling of X.
+//
+{
+  double value;
+
+  value = ( int ) x;
+
+  if ( value < x )
+  {
+    value = value + 1.0;
+  }
+
+  return value;
+}
+//****************************************************************************80
+
+double r8_choose ( int n, int k )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_CHOOSE computes the binomial coefficient C(N,K) as an R8.
+//
+//  Discussion:
+//
+//    The value is calculated in such a way as to avoid overflow and
+//    roundoff.  The calculation is done in R8 arithmetic.
+//
+//    The formula used is:
+//
+//      C(N,K) = N! / ( K! * (N-K)! )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    24 March 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    ML Wolfson, HV Wright,
+//    Algorithm 160:
+//    Combinatorial of M Things Taken N at a Time,
+//    Communications of the ACM,
+//    Volume 6, Number 4, April 1963, page 161.
+//
+//  Parameters:
+//
+//    Input, int N, K, the values of N and K.
+//
+//    Output, double R8_CHOOSE, the number of combinations of N
+//    things taken K at a time.
+//
+{
+  int i;
+  int mn;
+  int mx;
+  int value;
+
+  mn = webbur::i4_min ( k, n - k );
+
+  if ( mn < 0 )
+  {
+    value = 0.0;
+  }
+  else if ( mn == 0 )
+  {
+    value = 1.0;
+  }
+  else
+  {
+    mx = webbur::i4_max ( k, n - k );
+    value = ( double ) ( mx + 1 );
+
+    for ( i = 2; i <= mn; i++ )
+    {
+      value = ( value * ( double ) ( mx + i ) ) / ( double ) i;
+    }
+  }
+  return value;
+}
+//****************************************************************************80
+
+double r8_epsilon ( )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_EPSILON returns the R8 roundoff unit.
+//
+//  Discussion:
+//
+//    The roundoff unit is a number R which is a power of 2 with the
+//    property that, to the precision of the computer's arithmetic,
+//      1 < 1 + R
+//    but
+//      1 = ( 1 + R / 2 )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Output, double R8_EPSILON, the R8 round-off unit.
+//
+{
+  double value;
+
+  value = 1.0;
+
+  while ( 1.0 < ( double ) ( 1.0 + value )  )
+  {
+    value = value / 2.0;
+  }
+
+  value = 2.0 * value;
+
+  return value;
+}
+//****************************************************************************80
+
+double r8_factorial ( int n )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_FACTORIAL computes the factorial of N.
+//
+//  Discussion:
+//
+//    factorial ( N ) = product ( 1 <= I <= N ) I
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    16 January 1999
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the argument of the factorial function.
+//    If N is less than 1, the function value is returned as 1.
+//
+//    Output, double R8_FACTORIAL, the factorial function.
+//
+{
+  int i;
+  double value;
+
+  value = 1.0;
+
+  for ( i = 1; i <= n; i++ )
+  {
+    value = value * ( double ) ( i );
+  }
+
+  return value;
+}
+//****************************************************************************80
+
+double r8_factorial2 ( int n )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_FACTORIAL2 computes the double factorial function.
+//
+//  Discussion:
+//
+//    FACTORIAL2( N ) = Product ( N * (N-2) * (N-4) * ... * 2 )  (N even)
+//                    = Product ( N * (N-2) * (N-4) * ... * 1 )  (N odd)
+//
+//  Example:
+//
+//     N    FACTORIAL2(N)
+//
+//     0     1
+//     1     1
+//     2     2
+//     3     3
+//     4     8
+//     5    15
+//     6    48
+//     7   105
+//     8   384
+//     9   945
+//    10  3840
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 January 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the argument of the double factorial
+//    function.  If N is less than 1, R8_FACTORIAL2 is returned as 1.0.
+//
+//    Output, double R8_FACTORIAL2, the double factorial function.
+//
+{
+  int n_copy;
+  double value;
+
+  value = 1.0;
+
+  if ( n < 1 )
+  {
+    return value;
+  }
+
+  n_copy = n;
+
+  while ( 1 < n_copy )
+  {
+    value = value * ( double ) n_copy;
+    n_copy = n_copy - 2;
+  }
+
+  return value;
+}
+//****************************************************************************80
+
+double r8_floor ( double x )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_FLOOR rounds an R8 "down" (towards -infinity) to the next integer.
+//
+//  Example:
+//
+//    X        R8_FLOOR(X)
+//
+//   -1.1      -2.0
+//   -1.0      -1.0
+//   -0.9      -1.0
+//   -0.1      -1.0
+//    0.0       0.0
+//    0.1       0.0
+//    0.9       0.0
+//    1.0       1.0
+//    1.1       1.0
+//    2.9       2.0
+//    3.0       3.0
+//    3.14159   3.0
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    15 April 2007
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, double X, the number whose floor is desired.
+//
+//    Output, double R8_FLOOR, the floor of X.
+//
+{
+  double value;
+
+  value = ( int ) x;
+
+  if ( x < value )
+  {
+    value = value - 1.0;
+  }
+
+  return value;
+}
+//****************************************************************************80
+
+double r8_gamma ( double x )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_GAMMA evaluates Gamma(X) for a real argument.
+//
+//  Discussion:
+//
+//    This routine calculates the gamma function for a real argument X.
+//
+//    Computation is based on an algorithm outlined in reference 1.
+//    The program uses rational functions that approximate the gamma
+//    function to at least 20 significant decimal digits.  Coefficients
+//    for the approximation over the interval (1,2) are unpublished.
+//    Those for the approximation for 12 <= X are from reference 2.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 January 2008
+//
+//  Author:
+//
+//    Original FORTRAN77 version by William Cody, Laura Stoltz.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    William Cody,
+//    An Overview of Software Development for Special Functions,
+//    in Numerical Analysis Dundee, 1975,
+//    edited by GA Watson,
+//    Lecture Notes in Mathematics 506,
+//    Springer, 1976.
+//
+//    John Hart, Ward Cheney, Charles Lawson, Hans Maehly,
+//    Charles Mesztenyi, John Rice, Henry Thatcher,
+//    Christoph Witzgall,
+//    Computer Approximations,
+//    Wiley, 1968,
+//    LC: QA297.C64.
+//
+//  Parameters:
+//
+//    Input, double X, the argument of the function.
+//
+//    Output, double R8_GAMMA, the value of the function.
+//
+{
+//
+//  Coefficients for minimax approximation over (12, INF).
+//
+  double c[7] = {
+   -1.910444077728E-03,
+    8.4171387781295E-04,
+   -5.952379913043012E-04,
+    7.93650793500350248E-04,
+   -2.777777777777681622553E-03,
+    8.333333333333333331554247E-02,
+    5.7083835261E-03 };
+  double eps = 2.22E-16;
+  double fact;
+  int i;
+  int n;
+  double one = 1.0;
+  double p[8] = {
+  -1.71618513886549492533811E+00,
+   2.47656508055759199108314E+01,
+  -3.79804256470945635097577E+02,
+   6.29331155312818442661052E+02,
+   8.66966202790413211295064E+02,
+  -3.14512729688483675254357E+04,
+  -3.61444134186911729807069E+04,
+   6.64561438202405440627855E+04 };
+  bool parity;
+  double pi = 3.1415926535897932384626434;
+  double q[8] = {
+  -3.08402300119738975254353E+01,
+   3.15350626979604161529144E+02,
+  -1.01515636749021914166146E+03,
+  -3.10777167157231109440444E+03,
+   2.25381184209801510330112E+04,
+   4.75584627752788110767815E+03,
+  -1.34659959864969306392456E+05,
+  -1.15132259675553483497211E+05 };
+  double res;
+  double sqrtpi = 0.9189385332046727417803297;
+  double sum;
+  double twelve = 12.0;
+  double two = 2.0;
+  double value;
+  double xbig = 171.624;
+  double xden;
+  double xinf = 1.79E+308;
+  double xminin = 2.23E-308;
+  double xnum;
+  double y;
+  double y1;
+  double ysq;
+  double z;
+
+  parity = false;
+  fact = one;
+  n = 0;
+  y = x;
+//
+//  Argument is negative.
+//
+  if ( y <= 0.0 )
+  {
+    y = - x;
+    y1 = ( double ) ( int ) ( y );
+    res = y - y1;
+
+    if ( res != 0.0 )
+    {
+      if ( y1 != ( double ) ( int ) ( y1 * 0.5 ) * two )
+      {
+        parity = true;
+      }
+
+      fact = - pi / std::sin ( pi * res );
+      y = y + one;
+    }
+    else
+    {
+      res = xinf;
+      value = res;
+      return value;
+    }
+  }
+//
+//  Argument is positive.
+//
+  if ( y < eps )
+  {
+//
+//  Argument < EPS.
+//
+    if ( xminin <= y )
+    {
+      res = one / y;
+    }
+    else
+    {
+      res = xinf;
+      value = res;
+      return value;
+    }
+  }
+  else if ( y < twelve )
+  {
+    y1 = y;
+//
+//  0.0 < argument < 1.0.
+//
+    if ( y < one )
+    {
+      z = y;
+      y = y + one;
+    }
+//
+//  1.0 < argument < 12.0.
+//  Reduce argument if necessary.
+//
+    else
+    {
+      n = ( int ) ( y ) - 1;
+      y = y - ( double ) ( n );
+      z = y - one;
+    }
+//
+//  Evaluate approximation for 1.0 < argument < 2.0.
+//
+    xnum = 0.0;
+    xden = one;
+    for ( i = 0; i < 8; i++ )
+    {
+      xnum = ( xnum + p[i] ) * z;
+      xden = xden * z + q[i];
+    }
+    res = xnum / xden + one;
+//
+//  Adjust result for case  0.0 < argument < 1.0.
+//
+    if ( y1 < y )
+    {
+      res = res / y1;
+    }
+//
+//  Adjust result for case 2.0 < argument < 12.0.
+//
+    else if ( y < y1 )
+    {
+      for ( i = 1; i <= n; i++ )
+      {
+        res = res * y;
+        y = y + one;
+      }
+    }
+  }
+  else
+  {
+//
+//  Evaluate for 12.0 <= argument.
+//
+    if ( y <= xbig )
+    {
+      ysq = y * y;
+      sum = c[6];
+      for ( i = 0; i < 6; i++ )
+      {
+        sum = sum / ysq + c[i];
+      }
+      sum = sum / y - y + sqrtpi;
+      sum = sum + ( y - 0.5 ) * std::log ( y );
+      res = std::exp ( sum );
+    }
+    else
+    {
+      res = xinf;
+      value = res;
+      return value;
+    }
+  }
+//
+//  Final adjustments and return.
+//
+  if ( parity )
+  {
+    res = - res;
+  }
+
+  if ( fact != one )
+  {
+    res = fact / res;
+  }
+
+  value = res;
+
+  return value;
+}
+//****************************************************************************80
+
+double r8_huge ( )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_HUGE returns a "huge" R8.
+//
+//  Discussion:
+//
+//    The value returned by this function is NOT required to be the
+//    maximum representable R8.  This value varies from machine to machine,
+//    from compiler to compiler, and may cause problems when being printed.
+//    We simply want a "very large" but non-infinite number.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    06 October 2007
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Output, double R8_HUGE, a "huge" R8 value.
+//
+{
+  double value;
+
+  value = 1.0E+30;
+
+  return value;
+}
+//****************************************************************************80
+
+double r8_hyper_2f1 ( double a, double b, double c, double x )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_HYPER_2F1 evaluates the hypergeometric function 2F1(A,B,C,X).
+//
+//  Discussion:
+//
+//    A bug was corrected.  A line which read
+//      c1 = - ( - 1.0, m ) * gc / ( gam * gbm * rm );
+//    was corrected to read
+//      c1 = - std::pow ( - 1.0, m ) * gc / ( gam * gbm * rm );
+//    JVB, 05 July 2009.
+//
+//    A minor bug was corrected.  The HW variable, used in several places as
+//    the "old" value of a quantity being iteratively improved, was not
+//    being initialized.  JVB, 11 February 2008.
+//
+//    The FORTRAN77 original version of this routine is copyrighted by
+//    Shanjie Zhang and Jianming Jin.  However, they give permission to
+//    incorporate this routine into a user program provided that the copyright
+//    is acknowledged.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    05 July 2009
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Shanjie Zhang, Jianming Jin.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    Shanjie Zhang, Jianming Jin,
+//    Computation of Special Functions,
+//    Wiley, 1996,
+//    ISBN: 0-471-11963-6,
+//    LC: QA351.C45
+//
+//  Parameters:
+//
+//    Input, double A, B, C, X, the arguments of the function.
+//    C must not be equal to a nonpositive integer.
+//    X < 1.
+//
+//    Output, double R8_HYPER_2F1, the value of the function.
+//
+{
+  double a0;
+  double aa;
+  double bb;
+  double c0;
+  double c1;
+  double el = 0.5772156649015329;
+  double eps;
+  double f0;
+  double f1;
+  double g0;
+  double g1;
+  double g2;
+  double g3;
+  double ga;
+  double gabc;
+  double gam;
+  double gb;
+  double gbm;
+  double gc;
+  double gca;
+  double gcab;
+  double gcb;
+  double gm;
+  double hf;
+  double hw;
+  int j;
+  int k;
+  bool l0;
+  bool l1;
+  bool l2;
+  bool l3;
+  bool l4;
+  bool l5;
+  int m;
+  int nm;
+  double pa;
+  double pb;
+  double pi = 3.141592653589793;
+  double r;
+  double r0;
+  double r1;
+  double rm;
+  double rp;
+  double sm;
+  double sp;
+  double sp0;
+  double x1;
+
+  l0 = ( c == ( int ) ( c ) ) && ( c < 0.0 );
+  l1 = ( 1.0 - x < 1.0E-15 ) && ( c - a - b <= 0.0 );
+  l2 = ( a == ( int ) ( a ) ) && ( a < 0.0 );
+  l3 = ( b == ( int ) ( b ) ) && ( b < 0.0 );
+  l4 = ( c - a == ( int ) ( c - a ) ) && ( c - a <= 0.0 );
+  l5 = ( c - b == ( int ) ( c - b ) ) && ( c - b <= 0.0 );
+
+  if ( l0 )
+  {
+    std::cerr << "\n";
+    std::cerr << "R8_HYPER_2F1 - Fatal error!\n";
+    std::cerr << "  The hypergeometric series is divergent.\n";
+    std::cerr << "  C is integral and negative.\n";
+    std::cerr << "  C = " << c << "\n";
+    std::exit ( 1 );
+  }
+
+  if ( l1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "R8_HYPER_2F1 - Fatal error!\n";
+    std::cerr << "  The hypergeometric series is divergent.\n";
+    std::cerr << "  1 - X < 0, C - A - B <= 0\n";
+    std::cerr << "  A = " << a << "\n";
+    std::cerr << "  B = " << b << "\n";
+    std::cerr << "  C = " << c << "\n";
+    std::cerr << "  X = " << x << "\n";
+    std::exit ( 1 );
+  }
+
+  if ( 0.95 < x )
+  {
+    eps = 1.0E-08;
+  }
+  else
+  {
+    eps = 1.0E-15;
+  }
+
+  if ( x == 0.0 || a == 0.0 || b == 0.0 )
+  {
+    hf = 1.0;
+    return hf;
+  }
+  else if ( 1.0 - x == eps && 0.0 < c - a - b )
+  {
+    gc = webbur::r8_gamma ( c );
+    gcab = webbur::r8_gamma ( c - a - b );
+    gca = webbur::r8_gamma ( c - a );
+    gcb = webbur::r8_gamma ( c - b );
+    hf = gc * gcab / ( gca * gcb );
+    return hf;
+  }
+  else if ( 1.0 + x <= eps && r8_abs ( c - a + b - 1.0 ) <= eps )
+  {
+    g0 = std::sqrt ( pi ) * std::pow ( 2.0, - a );
+    g1 = webbur::r8_gamma ( c );
+    g2 = webbur::r8_gamma ( 1.0 + a / 2.0 - b );
+    g3 = webbur::r8_gamma ( 0.5 + 0.5 * a );
+    hf = g0 * g1 / ( g2 * g3 );
+    return hf;
+  }
+  else if ( l2 || l3 )
+  {
+    if ( l2 )
+    {
+      nm = ( int ) ( webbur::r8_abs ( a ) );
+    }
+
+    if ( l3 )
+    {
+      nm = ( int ) ( webbur::r8_abs ( b ) );
+    }
+
+    hf = 1.0;
+    r = 1.0;
+
+    for ( k = 1; k <= nm; k++ )
+    {
+      r = r * ( a + k - 1.0 ) * ( b + k - 1.0 )
+        / ( k * ( c + k - 1.0 ) ) * x;
+      hf = hf + r;
+    }
+
+    return hf;
+  }
+  else if ( l4 || l5 )
+  {
+    if ( l4 )
+    {
+      nm = ( int ) ( webbur::r8_abs ( c - a ) );
+    }
+
+    if ( l5 )
+    {
+      nm = ( int ) ( webbur::r8_abs ( c - b ) );
+    }
+
+    hf = 1.0;
+    r  = 1.0;
+    for ( k = 1; k <= nm; k++ )
+    {
+      r = r * ( c - a + k - 1.0 ) * ( c - b + k - 1.0 )
+        / ( k * ( c + k - 1.0 ) ) * x;
+      hf = hf + r;
+    }
+    hf = std::pow ( 1.0 - x, c - a - b ) * hf;
+    return hf;
+  }
+
+  aa = a;
+  bb = b;
+  x1 = x;
+
+  if ( x < 0.0 )
+  {
+    x = x / ( x - 1.0 );
+    if ( a < c && b < a && 0.0 < b )
+    {
+      a = bb;
+      b = aa;
+    }
+    b = c - b;
+  }
+
+  if ( 0.75 <= x )
+  {
+    gm = 0.0;
+
+    if ( webbur::r8_abs ( c - a - b - ( int ) ( c - a - b ) ) < 1.0E-15 )
+    {
+      m = ( int ) ( c - a - b );
+      ga = webbur::r8_gamma ( a );
+      gb = webbur::r8_gamma ( b );
+      gc = webbur::r8_gamma ( c );
+      gam = webbur::r8_gamma ( a + m );
+      gbm = webbur::r8_gamma ( b + m );
+
+      pa = webbur::r8_psi ( a );
+      pb = webbur::r8_psi ( b );
+
+      if ( m != 0 )
+      {
+        gm = 1.0;
+      }
+
+      for ( j = 1; j <= std::abs ( m ) - 1; j++ )
+      {
+        gm = gm * j;
+      }
+
+      rm = 1.0;
+      for ( j = 1; j <= std::abs ( m ); j++ )
+      {
+        rm = rm * j;
+      }
+
+      f0 = 1.0;
+      r0 = 1.0;;
+      r1 = 1.0;
+      sp0 = 0.0;;
+      sp = 0.0;
+
+      if ( 0 <= m )
+      {
+        c0 = gm * gc / ( gam * gbm );
+        c1 = - gc * std::pow ( x - 1.0, m ) / ( ga * gb * rm );
+
+        for ( k = 1; k <= m - 1; k++ )
+        {
+          r0 = r0 * ( a + k - 1.0 ) * ( b + k - 1.0 )
+            / ( k * ( k - m ) ) * ( 1.0 - x );
+          f0 = f0 + r0;
+        }
+
+        for ( k = 1; k <= m; k++ )
+        {
+          sp0 = sp0 + 1.0 / ( a + k - 1.0 ) + 1.0 / ( b + k - 1.0 )
+          - 1.0 / ( double ) ( k );
+        }
+
+        f1 = pa + pb + sp0 + 2.0 * el + std::log ( 1.0 - x );
+        hw = f1;
+
+        for ( k = 1; k <= 250; k++ )
+        {
+          sp = sp + ( 1.0 - a ) / ( k * ( a + k - 1.0 ) )
+            + ( 1.0 - b ) / ( k * ( b + k - 1.0 ) );
+
+          sm = 0.0;
+          for ( j = 1; j <= m; j++ )
+          {
+            sm = sm + ( 1.0 - a )
+              / ( ( j + k ) * ( a + j + k - 1.0 ) )
+              + 1.0 / ( b + j + k - 1.0 );
+          }
+
+          rp = pa + pb + 2.0 * el + sp + sm + std::log ( 1.0 - x );
+
+          r1 = r1 * ( a + m + k - 1.0 ) * ( b + m + k - 1.0 )
+            / ( k * ( m + k ) ) * ( 1.0 - x );
+
+          f1 = f1 + r1 * rp;
+
+          if ( r8_abs ( f1 - hw ) < r8_abs ( f1 ) * eps )
+          {
+            break;
+          }
+          hw = f1;
+        }
+        hf = f0 * c0 + f1 * c1;
+      }
+      else if ( m < 0 )
+      {
+        m = - m;
+        c0 = gm * gc / ( ga * gb * std::pow ( 1.0 - x, m ) );
+        c1 = - std::pow ( - 1.0, m ) * gc / ( gam * gbm * rm );
+
+        for ( k = 1; k <= m - 1; k++ )
+        {
+          r0 = r0 * ( a - m + k - 1.0 ) * ( b - m + k - 1.0 )
+            / ( k * ( k - m ) ) * ( 1.0 - x );
+          f0 = f0 + r0;
+        }
+
+        for ( k = 1; k <= m; k++ )
+        {
+          sp0 = sp0 + 1.0 / ( double ) ( k );
+        }
+
+        f1 = pa + pb - sp0 + 2.0 * el + std::log ( 1.0 - x );
+        hw = f1;
+
+        for ( k = 1; k <= 250; k++ )
+        {
+          sp = sp + ( 1.0 - a )
+            / ( k * ( a + k - 1.0 ) )
+            + ( 1.0 - b ) / ( k * ( b + k - 1.0 ) );
+
+          sm = 0.0;
+          for ( j = 1; j <= m; j++ )
+          {
+            sm = sm + 1.0 / ( double ) ( j + k );
+          }
+
+          rp = pa + pb + 2.0 * el + sp - sm + std::log ( 1.0 - x );
+
+          r1 = r1 * ( a + k - 1.0 ) * ( b + k - 1.0 )
+            / ( k * ( m + k ) ) * ( 1.0 - x );
+
+          f1 = f1 + r1 * rp;
+
+          if ( webbur::r8_abs ( f1 - hw ) < webbur::r8_abs ( f1 ) * eps )
+          {
+            break;
+          }
+
+          hw = f1;
+        }
+
+        hf = f0 * c0 + f1 * c1;
+      }
+    }
+    else
+    {
+      ga = webbur::r8_gamma ( a );
+      gb = webbur::r8_gamma ( b );
+      gc = webbur::r8_gamma ( c );
+      gca = webbur::r8_gamma ( c - a );
+      gcb = webbur::r8_gamma ( c - b );
+      gcab = webbur::r8_gamma ( c - a - b );
+      gabc = webbur::r8_gamma ( a + b - c );
+      c0 = gc * gcab / ( gca * gcb );
+      c1 = gc * gabc / ( ga * gb ) * std::pow ( 1.0 - x, c - a - b );
+      hf = 0.0;
+      hw = hf;
+      r0 = c0;
+      r1 = c1;
+
+      for ( k = 1; k <= 250; k++ )
+      {
+        r0 = r0 * ( a + k - 1.0 ) * ( b + k - 1.0 )
+          / ( k * ( a + b - c + k ) ) * ( 1.0 - x );
+
+        r1 = r1 * ( c - a + k - 1.0 ) * ( c - b + k - 1.0 )
+          / ( k * ( c - a - b + k ) ) * ( 1.0 - x );
+
+        hf = hf + r0 + r1;
+
+        if ( webbur::r8_abs ( hf - hw ) < webbur::r8_abs ( hf ) * eps )
+        {
+          break;
+        }
+        hw = hf;
+      }
+      hf = hf + c0 + c1;
+    }
+  }
+  else
+  {
+    a0 = 1.0;
+
+    if ( a < c && c < 2.0 * a && b < c && c < 2.0 * b )
+    {
+      a0 = std::pow ( 1.0 - x, c - a - b );
+      a = c - a;
+      b = c - b;
+    }
+
+    hf = 1.0;
+    hw = hf;
+    r = 1.0;
+
+    for ( k = 1; k <= 250; k++ )
+    {
+      r = r * ( a + k - 1.0 ) * ( b + k - 1.0 )
+        / ( k * ( c + k - 1.0 ) ) * x;
+
+      hf = hf + r;
+
+      if ( webbur::r8_abs ( hf - hw ) <= webbur::r8_abs ( hf ) * eps )
+      {
+        break;
+      }
+
+      hw = hf;
+    }
+    hf = a0 * hf;
+  }
+
+  if ( x1 < 0.0 )
+  {
+    x = x1;
+    c0 = 1.0 / std::pow ( 1.0 - x, aa );
+    hf = c0 * hf;
+  }
+
+  a = aa;
+  b = bb;
+
+  if ( 120 < k )
+  {
+    std::cerr << "\n";
+    std::cerr << "R8_HYPER_2F1 - Warning!\n";
+    std::cerr << "  A large number of iterations were needed.\n";
+    std::cerr << "  The accuracy of the results should be checked.\n";
+  }
+
+  return hf;
+}
+//****************************************************************************80
+
+double r8_max ( double x, double y )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_MAX returns the maximum of two R8's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 August 2004
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, double X, Y, the quantities to compare.
+//
+//    Output, double R8_MAX, the maximum of X and Y.
+//
+{
+  double value;
+
+  if ( y < x )
+  {
+    value = x;
+  }
+  else
+  {
+    value = y;
+  }
+  return value;
+}
+//****************************************************************************80
+
+double r8_min ( double x, double y )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_MIN returns the minimum of two R8's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    31 August 2004
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, double X, Y, the quantities to compare.
+//
+//    Output, double R8_MIN, the minimum of X and Y.
+//
+{
+  double value;
+
+  if ( y < x )
+  {
+    value = y;
+  }
+  else
+  {
+    value = x;
+  }
+  return value;
+}
+//****************************************************************************80
+
+double r8_mop ( int i )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_MOP returns the I-th power of -1 as an R8 value.
+//
+//  Discussion:
+//
+//    An R8 is an double value.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    16 November 2007
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int I, the power of -1.
+//
+//    Output, double R8_MOP, the I-th power of -1.
+//
+{
+  double value;
+
+  if ( ( i % 2 ) == 0 )
+  {
+    value = 1.0;
+  }
+  else
+  {
+    value = -1.0;
+  }
+
+  return value;
+}
+//****************************************************************************80
+
+double r8_psi ( double xx )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_PSI evaluates the function Psi(X).
+//
+//  Discussion:
+//
+//    This routine evaluates the logarithmic derivative of the
+//    Gamma function,
+//
+//      PSI(X) = d/dX ( GAMMA(X) ) / GAMMA(X)
+//             = d/dX LN ( GAMMA(X) )
+//
+//    for real X, where either
+//
+//      - XMAX1 < X < - XMIN, and X is not a negative integer,
+//
+//    or
+//
+//      XMIN < X.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    09 February 2008
+//
+//  Author:
+//
+//    Original FORTRAN77 version by William Cody.
+//    C++ version by John Burkardt.
+//
+//  Reference:
+//
+//    William Cody, Anthony Strecok, Henry Thacher,
+//    Chebyshev Approximations for the Psi Function,
+//    Mathematics of Computation,
+//    Volume 27, Number 121, January 1973, pages 123-127.
+//
+//  Parameters:
+//
+//    Input, double XX, the argument of the function.
+//
+//    Output, double R8_PSI, the value of the function.
+//
+{
+  double aug;
+  double den;
+  int i;
+  int n;
+  int nq;
+  double one = 1.0;
+  double p1[9] = {
+   4.5104681245762934160E-03,
+   5.4932855833000385356,
+   3.7646693175929276856E+02,
+   7.9525490849151998065E+03,
+   7.1451595818951933210E+04,
+   3.0655976301987365674E+05,
+   6.3606997788964458797E+05,
+   5.8041312783537569993E+05,
+   1.6585695029761022321E+05 };
+  double p2[7] = {
+  -2.7103228277757834192,
+  -1.5166271776896121383E+01,
+  -1.9784554148719218667E+01,
+  -8.8100958828312219821,
+  -1.4479614616899842986,
+  -7.3689600332394549911E-02,
+  -6.5135387732718171306E-21 };
+  double piov4 = 0.78539816339744830962;
+  double q1[8] = {
+   9.6141654774222358525E+01,
+   2.6287715790581193330E+03,
+   2.9862497022250277920E+04,
+   1.6206566091533671639E+05,
+   4.3487880712768329037E+05,
+   5.4256384537269993733E+05,
+   2.4242185002017985252E+05,
+   6.4155223783576225996E-08 };
+  double q2[6] = {
+   4.4992760373789365846E+01,
+   2.0240955312679931159E+02,
+   2.4736979003315290057E+02,
+   1.0742543875702278326E+02,
+   1.7463965060678569906E+01,
+   8.8427520398873480342E-01 };
+  double sgn;
+  double three = 3.0;
+  double upper;
+  double value;
+  double w;
+  double x;
+  double x01 = 187.0;
+  double x01d = 128.0;
+  double x02 = 6.9464496836234126266E-04;
+  double xinf = 1.70E+38;
+  double xlarge = 2.04E+15;
+  double xmax1 = 3.60E+16;
+  double xmin1 = 5.89E-39;
+  double xsmall = 2.05E-09;
+  double z;
+
+  x = xx;
+  w = webbur::r8_abs ( x );
+  aug = 0.0;
+//
+//  Check for valid arguments, then branch to appropriate algorithm.
+//
+  if ( xmax1 <= - x || w < xmin1 )
+  {
+    if ( 0.0 < x )
+    {
+      value = - xinf;
+    }
+    else
+    {
+      value = xinf;
+    }
+    return value;
+  }
+
+  if ( x < 0.5 )
+  {
+//
+//  X < 0.5, use reflection formula: psi(1-x) = psi(x) + pi * cot(pi*x)
+//  Use 1/X for PI*COTAN(PI*X)  when  XMIN1 < |X| <= XSMALL.
+//
+    if ( w <= xsmall )
+    {
+      aug = - one / x;
+    }
+//
+//  Argument reduction for cotangent.
+//
+    else
+    {
+      if ( x < 0.0 )
+      {
+        sgn = piov4;
+      }
+      else
+      {
+        sgn = - piov4;
+      }
+
+      w = w - ( double ) ( ( int ) ( w ) );
+      nq = ( int ) ( w * 4.0 );
+      w = 4.0 * ( w - ( double ) ( nq ) * 0.25 );
+//
+//  W is now related to the fractional part of 4.0 * X.
+//  Adjust argument to correspond to values in the first
+//  quadrant and determine the sign.
+//
+      n = nq / 2;
+
+      if ( n + n != nq )
+      {
+        w = one - w;
+      }
+
+      z = piov4 * w;
+
+      if ( ( n % 2 ) != 0 )
+      {
+        sgn = - sgn;
+      }
+//
+//  Determine the final value for  -pi * cotan(pi*x).
+//
+      n = ( nq + 1 ) / 2;
+      if ( ( n % 2 ) == 0 )
+      {
+//
+//  Check for singularity.
+//
+        if ( z == 0.0 )
+        {
+          if ( 0.0 < x )
+          {
+            value = -xinf;
+          }
+          else
+          {
+            value = xinf;
+          }
+          return value;
+        }
+        aug = sgn * ( 4.0 / std::tan ( z ) );
+      }
+      else
+      {
+        aug = sgn * ( 4.0 * std::tan ( z ) );
+      }
+    }
+    x = one - x;
+  }
+//
+//  0.5 <= X <= 3.0.
+//
+  if ( x <= three )
+  {
+    den = x;
+    upper = p1[0] * x;
+    for ( i = 1; i <= 7; i++ )
+    {
+      den = ( den + q1[i-1] ) * x;
+      upper = ( upper + p1[i]) * x;
+    }
+    den = ( upper + p1[8] ) / ( den + q1[7] );
+    x = ( x - x01 / x01d ) - x02;
+    value = den * x + aug;
+    return value;
+  }
+//
+//  3.0 < X.
+//
+  if ( x < xlarge )
+  {
+    w = one / ( x * x );
+    den = w;
+    upper = p2[0] * w;
+    for ( i = 1; i <= 5; i++ )
+    {
+      den = ( den + q2[i-1] ) * w;
+      upper = ( upper + p2[i] ) * w;
+    }
+    aug = ( upper + p2[6] ) / ( den + q2[5] ) - 0.5 / x + aug;
+  }
+
+  value = aug + std::log ( x );
+
+  return value;
+}
+//****************************************************************************80
+
+double r8_sign ( double x )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8_SIGN returns the sign of an R8.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 October 2004
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, double X, the number whose sign is desired.
+//
+//    Output, double R8_SIGN, the sign of X.
+//
+{
+  double value;
+
+  if ( x < 0.0 )
+  {
+    value = -1.0;
+  }
+  else
+  {
+    value = 1.0;
+  }
+  return value;
+}
+//****************************************************************************80
+
+int r8col_compare ( int m, int n, double a[], int i, int j )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8COL_COMPARE compares two columns in an R8COL.
+//
+//  Discussion:
+//
+//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+//    each of length M.
+//
+//  Example:
+//
+//    Input:
+//
+//      M = 3, N = 4, I = 2, J = 4
+//
+//      A = (
+//        1.  2.  3.  4.
+//        5.  6.  7.  8.
+//        9. 10. 11. 12. )
+//
+//    Output:
+//
+//      R8COL_COMPARE = -1
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    13 September 2005
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, N, the number of rows and columns.
+//
+//    Input, double A[M*N], the M by N array.
+//
+//    Input, int I, J, the columns to be compared.
+//    I and J must be between 1 and N.
+//
+//    Output, int R8COL_COMPARE, the results of the comparison:
+//    -1, column I < column J,
+//     0, column I = column J,
+//    +1, column J < column I.
+//
+{
+  int k;
+  int value;
+//
+//  Check.
+//
+  if ( i < 1 || n < i )
+  {
+    std::cerr << "\n";
+    std::cerr << "R8COL_COMPARE - Fatal error!\n";
+    std::cerr << "  Column index I is out of bounds.\n";
+    std::cerr << "  I = " << i << "\n";
+    std::exit ( 1 );
+  }
+
+  if ( j < 1 || n < j )
+  {
+    std::cerr << "\n";
+    std::cerr << "R8COL_COMPARE - Fatal error!\n";
+    std::cerr << "  Column index J is out of bounds.\n";
+    std::cerr << "  J = " << j << "\n";
+    std::exit ( 1 );
+  }
+
+  value = 0;
+
+  if ( i == j )
+  {
+    return value;
+  }
+
+  k = 0;
+
+  while ( k < m )
+  {
+    if ( a[k+(i-1)*m] < a[k+(j-1)*m] )
+    {
+      value = -1;
+      return value;
+    }
+    else if ( a[k+(j-1)*m] < a[k+(i-1)*m] )
+    {
+      value = +1;
+      return value;
+    }
+    k = k + 1;
+  }
+
+  return value;
+}
+//****************************************************************************80
+
+void r8col_sort_heap_a ( int m, int n, double a[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8COL_SORT_HEAP_A ascending heapsorts an R8COL.
+//
+//  Discussion:
+//
+//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+//    each of length M.
+//
+//    In lexicographic order, the statement "X < Y", applied to two real
+//    vectors X and Y of length M, means that there is some index I, with
+//    1 <= I <= M, with the property that
+//
+//      X(J) = Y(J) for J < I,
+//    and
+//      X(I) < Y(I).
+//
+//    In other words, the first time they differ, X is smaller.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    15 September 2005
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, N, the number of rows and columns.
+//
+//    Input/output, double A[M*N].
+//    On input, the array of N columns of M-vectors.
+//    On output, the columns of A have been sorted in lexicographic order.
+//
+{
+  int i;
+  int indx;
+  int isgn;
+  int j;
+
+  if ( m <= 0 )
+  {
+    return;
+  }
+
+  if ( n <= 1 )
+  {
+    return;
+  }
+//
+//  Initialize.
+//
+  i = 0;
+  indx = 0;
+  isgn = 0;
+  j = 0;
+//
+//  Call the external heap sorter.
+//
+  for ( ; ; )
+  {
+    webbur::sort_heap_external ( n, &indx, &i, &j, isgn );
+//
+//  Interchange the I and J objects.
+//
+    if ( 0 < indx )
+    {
+      webbur::r8col_swap ( m, n, a, i, j );
+    }
+//
+//  Compare the I and J objects.
+//
+    else if ( indx < 0 )
+    {
+      isgn = webbur::r8col_compare ( m, n, a, i, j );
+    }
+    else if ( indx == 0 )
+    {
+      break;
+    }
+  }
+
+  return;
+}
+//****************************************************************************80
+
+int *r8col_sort_heap_index_a ( int m, int n, double a[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8COL_SORT_HEAP_INDEX_A does an indexed heap ascending sort of an R8COL.
+//
+//  Discussion:
+//
+//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+//    each of length M.
+//
+//    The sorting is not actually carried out.  Rather an index array is
+//    created which defines the sorting.  This array may be used to sort
+//    or index the array, or to sort or index related arrays keyed on the
+//    original array.
+//
+//    A(*,J1) < A(*,J2) if the first nonzero entry of A(*,J1)-A(*,J2)
+//    is negative.
+//
+//    Once the index array is computed, the sorting can be carried out
+//    "implicitly:
+//
+//      A(*,INDX(*)) is sorted,
+//
+//    Note that the index vector is 0-based.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    01 November 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, the number of rows in each column of A.
+//
+//    Input, int N, the number of columns in A.
+//
+//    Input, double A[M*N], the array.
+//
+//    Output, int R8COL_SORT_HEAP_INDEX_A[N], contains the sort index.  The
+//    I-th column of the sorted array is A(*,INDX(I)).
+//
+{
+  double *column;
+  int i;
+  int *indx;
+  int indxt;
+  int ir;
+  int isgn;
+  int j;
+  int k;
+  int l;
+
+  if ( n < 1 )
+  {
+    return NULL;
+  }
+
+  indx = new int[n];
+
+  for ( i = 0; i < n; i++ )
+  {
+    indx[i] = i;
+  }
+
+  if ( n == 1 )
+  {
+    return indx;
+  }
+
+  column = new double[m];
+
+  l = n / 2 + 1;
+  ir = n;
+
+  for ( ; ; )
+  {
+    if ( 1 < l )
+    {
+      l = l - 1;
+      indxt = indx[l-1];
+      for ( k = 0; k < m; k++ )
+      {
+        column[k] = a[k+indxt*m];
+      }
+    }
+    else
+    {
+      indxt = indx[ir-1];
+      for ( k = 0; k < m; k++ )
+      {
+        column[k] = a[k+indxt*m];
+      }
+      indx[ir-1] = indx[0];
+      ir = ir - 1;
+
+      if ( ir == 1 )
+      {
+        indx[0] = indxt;
+        break;
+      }
+    }
+
+    i = l;
+    j = l + l;
+
+    while ( j <= ir )
+    {
+      if ( j < ir )
+      {
+        isgn = webbur::r8vec_compare ( m, a+indx[j-1]*m, a+indx[j]*m );
+
+        if ( isgn < 0 )
+        {
+          j = j + 1;
+        }
+      }
+
+      isgn = webbur::r8vec_compare ( m, column, a+indx[j-1]*m );
+
+      if ( isgn < 0 )
+      {
+        indx[i-1] = indx[j-1];
+        i = j;
+        j = j + j;
+      }
+      else
+      {
+        j = ir + 1;
+      }
+    }
+    indx[i-1] = indxt;
+  }
+  delete [] column;
+
+  return indx;
+}
+//****************************************************************************80
+
+int r8col_sorted_unique_count ( int m, int n, double a[], double tol )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8COL_SORTED_UNIQUE_COUNT counts unique elements in a sorted R8COL.
+//
+//  Discussion:
+//
+//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+//    each of length M.
+//
+//    The columns of the array may be ascending or descending sorted.
+//
+//    If the tolerance is large enough, then the concept of uniqueness
+//    can become ambiguous.  If we have a tolerance of 1.5, then in the
+//    list ( 1, 2, 3, 4, 5, 6, 7, 8, 9 ) is it fair to say we have only
+//    one unique entry?  That would be because 1 may be regarded as unique,
+//    and then 2 is too close to 1 to be unique, and 3 is too close to 2 to
+//    be unique and so on.
+//
+//    This seems wrongheaded.  So I prefer the idea that an item is not
+//    unique under a tolerance only if it is close to something that IS unique.
+//    Thus, the unique items are guaranteed to cover the space if we include
+//    a disk of radius TOL around each one.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    01 November 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, N, the number of rows and columns.
+//
+//    Input, double A[M*N], a sorted array, containing
+//    N columns of data.
+//
+//    Input, double TOL, a tolerance for equality.
+//
+//    Output, int R8COL_SORTED_UNIQUE_COUNT, the number of unique columns.
+//
+{
+  double diff;
+  int i;
+  int j1;
+  int j2;
+  int unique_num;
+
+  unique_num = 0;
+
+  if ( n <= 0 )
+  {
+    return unique_num;
+  }
+
+  unique_num = 1;
+  j1 = 0;
+
+  for ( j2 = 1; j2 < n; j2++ )
+  {
+    diff = 0.0;
+    for ( i = 0; i < m; i++ )
+    {
+      diff = webbur::r8_max ( diff, webbur::r8_abs ( a[i+j1*m] - a[i+j2*m] ) );
+    }
+    if ( tol < diff )
+    {
+      unique_num = unique_num + 1;
+      j1 = j2;
+    }
+  }
+
+  return unique_num;
+}
+//****************************************************************************80
+
+void r8col_swap ( int m, int n, double a[], int j1, int j2 )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8COL_SWAP swaps columns J1 and J2 of an R8COL.
+//
+//  Discussion:
+//
+//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+//    each of length M.
+//
+//  Example:
+//
+//    Input:
+//
+//      M = 3, N = 4, J1 = 2, J2 = 4
+//
+//      A = (
+//        1.  2.  3.  4.
+//        5.  6.  7.  8.
+//        9. 10. 11. 12. )
+//
+//    Output:
+//
+//      A = (
+//        1.  4.  3.  2.
+//        5.  8.  7.  6.
+//        9. 12. 11. 10. )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    23 October 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, N, the number of rows and columns.
+//
+//    Input/output, double A[M*N], the M by N array.
+//
+//    Input, int J1, J2, the columns to be swapped.
+//    These columns are 1-based.
+//
+{
+  int i;
+  double temp;
+
+  if ( j1 < 1 || n < j1 || j2 < 1 || n < j2 )
+  {
+    std::cerr << "\n";
+    std::cerr << "R8COL_SWAP - Fatal error!\n";
+    std::cerr << "  J1 or J2 is out of bounds.\n";
+    std::cerr << "  J1 =   " << j1 << "\n";
+    std::cerr << "  J2 =   " << j2 << "\n";
+    std::cerr << "  NCOL = " << n << "\n";
+    std::exit ( 1 );
+  }
+
+  if ( j1 == j2 )
+  {
+    return;
+  }
+
+  for ( i = 0; i < m; i++ )
+  {
+    temp          = a[i+(j1-1)*m];
+    a[i+(j1-1)*m] = a[i+(j2-1)*m];
+    a[i+(j2-1)*m] = temp;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void r8col_tol_undex ( int m, int n, double a[], int unique_num, double tol,
+  int undx[], int xdnu[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8COL_TOL_UNDEX indexes tolerably unique entries of an R8COL.
+//
+//  Discussion:
+//
+//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+//    each of length M.
+//
+//    The goal of this routine is to determine a vector UNDX,
+//    which points to the unique elements of A, in sorted order,
+//    and a vector XDNU, which identifies, for each entry of A, the index of
+//    the unique sorted element of A.
+//
+//    This is all done with index vectors, so that the elements of
+//    A are never moved.
+//
+//    The first step of the algorithm requires the indexed sorting
+//    of A, which creates arrays INDX and XDNI.  (If all the entries
+//    of A are unique, then these arrays are the same as UNDX and XDNU.)
+//
+//    We then use INDX to examine the entries of A in sorted order,
+//    noting the unique entries, creating the entries of XDNU and
+//    UNDX as we go.
+//
+//    Once this process has been completed, the vector A could be
+//    replaced by a compressed vector XU, containing the unique entries
+//    of A in sorted order, using the formula
+//
+//      XU(*) = A(UNDX(*)).
+//
+//    We could then, if we wished, reconstruct the entire vector A, or
+//    any element of it, by index, as follows:
+//
+//      A(I) = XU(XDNU(I)).
+//
+//    We could then replace A by the combination of XU and XDNU.
+//
+//    Later, when we need the I-th entry of A, we can locate it as
+//    the XDNU(I)-th entry of XU.
+//
+//    Here is an example of a vector A, the sort and inverse sort
+//    index vectors, and the unique sort and inverse unique sort vectors
+//    and the compressed unique sorted vector.
+//
+//      I     A  Indx  Xdni       XU  Undx  Xdnu
+//    ----+-----+-----+-----+--------+-----+-----+
+//      0 | 11.     0     0 |    11.     0     0
+//      1 | 22.     2     4 |    22.     1     1
+//      2 | 11.     5     1 |    33.     3     0
+//      3 | 33.     8     7 |    55.     4     2
+//      4 | 55.     1     8 |                  3
+//      5 | 11.     6     2 |                  0
+//      6 | 22.     7     5 |                  1
+//      7 | 22.     3     6 |                  1
+//      8 | 11.     4     3 |                  0
+//
+//    INDX(2) = 3 means that sorted item(2) is A(3).
+//    XDNI(2) = 5 means that A(2) is sorted item(5).
+//
+//    UNDX(3) = 4 means that unique sorted item(3) is at A(4).
+//    XDNU(8) = 2 means that A(8) is at unique sorted item(2).
+//
+//    XU(XDNU(I))) = X(I).
+//    XU(I)        = X(UNDX(I)).
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 July 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, the dimension of the data values.
+//
+//    Input, int N, the number of data values,
+//
+//    Input, double A[M*N], the data values.
+//
+//    Input, int UNIQUE_NUM, the number of unique values in A.
+//    This value is only required for languages in which the size of
+//    UNDX must be known in advance.
+//
+//    Input, double TOL, a tolerance for equality.
+//
+//    Output, int UNDX[UNIQUE_NUM], the UNDX vector.
+//
+//    Output, int XDNU[N], the XDNU vector.
+//
+{
+  double diff;
+  int i;
+  int i2;
+  int *indx;
+  int j;
+  int k;
+  bool unique;
+//
+//  Implicitly sort the array.
+//
+  indx = webbur::r8col_sort_heap_index_a ( m, n, a );
+//
+//  Consider entry I = 0.
+//  It is unique, so set the number of unique items to K.
+//  Set the K-th unique item to I.
+//  Set the representative of item I to the K-th unique item.
+//
+  i = 0;
+  k = 0;
+  undx[k] = indx[i];
+  xdnu[indx[i]] = k;
+//
+//  Consider entry I.
+//
+//  If it is unique, increase the unique count K, set the
+//  K-th unique item to I, and set the representative of I to K.
+//
+//  If it is not unique, set the representative of item I to a
+//  previously determined unique item that is close to it.
+//
+  for ( i = 1; i < n; i++ )
+  {
+    unique = true;
+    for ( j = 0; j <= k; j++ )
+    {
+      diff = 0.0;
+      for ( i2 = 0; i2 < m; i2++ )
+      {
+        diff = webbur::r8_max ( diff,
+          webbur::r8_abs ( a[i2+indx[i]*m] - a[i2+undx[j]*m] ) );
+      }
+      if ( diff <= tol )
+      {
+        unique = false;
+        xdnu[indx[i]] = j;
+        break;
+      }
+    }
+    if ( unique )
+    {
+      k = k + 1;
+      undx[k] = indx[i];
+      xdnu[indx[i]] = k;
+    }
+  }
+  delete [] indx;
+
+  return;
+}
+//****************************************************************************80
+
+int r8col_tol_unique_count ( int m, int n, double a[], double tol )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8COL_TOL_UNIQUE_COUNT counts tolerably unique entries in an R8COL.
+//
+//  Discussion:
+//
+//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+//    each of length M.
+//
+//    The columns of the array may be ascending or descending sorted.
+//
+//    If the tolerance is large enough, then the concept of uniqueness
+//    can become ambiguous.  If we have a tolerance of 1.5, then in the
+//    list ( 1, 2, 3, 4, 5, 6, 7, 8, 9 ) is it fair to say we have only
+//    one unique entry?  That would be because 1 may be regarded as unique,
+//    and then 2 is too close to 1 to be unique, and 3 is too close to 2 to
+//    be unique and so on.
+//
+//    This seems wrongheaded.  So I prefer the idea that an item is not
+//    unique under a tolerance only if it is close to something that IS unique.
+//    Thus, the unique items are guaranteed to cover the space if we include
+//    a disk of radius TOL around each one.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 July 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, N, the number of rows and columns.
+//
+//    Input, double A[M*N], the array of N columns of data.
+//
+//    Input, double TOL, a tolerance for equality.
+//
+//    Output, int R8COL_TOL_UNIQUE_COUNT, the number of unique columns.
+//
+{
+  double diff;
+  int i;
+  int i2;
+  int *indx;
+  int j;
+  int k;
+  bool unique;
+  int *undx;
+
+  undx = new int[n];
+//
+//  Implicitly sort the array.
+//
+  indx = webbur::r8col_sort_heap_index_a ( m, n, a );
+//
+//  Consider entry I = 0.
+//  It is unique, so set the number of unique items to K.
+//  Set the K-th unique item to I.
+//  Set the representative of item I to the K-th unique item.
+//
+  i = 0;
+  k = 0;
+  undx[k] = indx[i];
+//
+//  Consider entry I.
+//
+//  If it is unique, increase the unique count K, set the
+//  K-th unique item to I, and set the representative of I to K.
+//
+//  If it is not unique, set the representative of item I to a
+//  previously determined unique item that is close to it.
+//
+  for ( i = 1; i < n; i++ )
+  {
+    unique = true;
+    for ( j = 0; j <= k; j++ )
+    {
+      diff = 0.0;
+      for ( i2 = 0; i2 < m; i2++ )
+      {
+        diff = webbur::r8_max ( diff,
+          webbur::r8_abs ( a[i2+indx[i]*m] - a[i2+undx[j]*m] ) );
+      }
+      if ( diff <= tol )
+      {
+        unique = false;
+        break;
+      }
+    }
+    if ( unique )
+    {
+      k = k + 1;
+      undx[k] = indx[i];
+    }
+  }
+  delete [] indx;
+  delete [] undx;
+
+  k = k + 1;
+
+  return k;
+}
+//****************************************************************************80
+
+void r8col_undex ( int x_dim, int x_num, double x_val[], int x_unique_num,
+  double tol, int undx[], int xdnu[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8COL_UNDEX returns unique sorted indexes for an R8COL.
+//
+//  Discussion:
+//
+//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+//    each of length M.
+//
+//    The goal of this routine is to determine a vector UNDX,
+//    which points to the unique elements of X, in sorted order,
+//    and a vector XDNU, which identifies, for each entry of X, the index of
+//    the unique sorted element of X.
+//
+//    This is all done with index vectors, so that the elements of
+//    X are never moved.
+//
+//    The first step of the algorithm requires the indexed sorting
+//    of X, which creates arrays INDX and XDNI.  (If all the entries
+//    of X are unique, then these arrays are the same as UNDX and XDNU.)
+//
+//    We then use INDX to examine the entries of X in sorted order,
+//    noting the unique entries, creating the entries of XDNU and
+//    UNDX as we go.
+//
+//    Once this process has been completed, the vector X could be
+//    replaced by a compressed vector XU, containing the unique entries
+//    of X in sorted order, using the formula
+//
+//      XU(*) = X(UNDX(*)).
+//
+//    We could then, if we wished, reconstruct the entire vector X, or
+//    any element of it, by index, as follows:
+//
+//      X(I) = XU(XDNU(I)).
+//
+//    We could then replace X by the combination of XU and XDNU.
+//
+//    Later, when we need the I-th entry of X, we can locate it as
+//    the XDNU(I)-th entry of XU.
+//
+//    Here is an example of a vector X, the sort and inverse sort
+//    index vectors, and the unique sort and inverse unique sort vectors
+//    and the compressed unique sorted vector.
+//
+//      I     X  Indx  Xdni       XU  Undx  Xdnu
+//    ----+-----+-----+-----+--------+-----+-----+
+//      0 | 11.     0     0 |    11.     0     0
+//      1 | 22.     2     4 |    22.     1     1
+//      2 | 11.     5     1 |    33.     3     0
+//      3 | 33.     8     7 |    55.     4     2
+//      4 | 55.     1     8 |                  3
+//      5 | 11.     6     2 |                  0
+//      6 | 22.     7     5 |                  1
+//      7 | 22.     3     6 |                  1
+//      8 | 11.     4     3 |                  0
+//
+//    INDX(2) = 3 means that sorted item(2) is X(3).
+//    XDNI(2) = 5 means that X(2) is sorted item(5).
+//
+//    UNDX(3) = 4 means that unique sorted item(3) is at X(4).
+//    XDNU(8) = 2 means that X(8) is at unique sorted item(2).
+//
+//    XU(XDNU(I))) = X(I).
+//    XU(I)        = X(UNDX(I)).
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    02 November 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int X_DIM, the dimension of the data values.
+//    (the number of rows in the R8COL).
+//
+//    Input, int X_NUM, the number of data values,
+//    (the number of columns in the R8COL).
+//
+//    Input, double X_VAL[X_DIM*X_NUM], the data values.
+//
+//    Input, int X_UNIQUE_NUM, the number of unique values in X_VAL.
+//    This value is only required for languages in which the size of
+//    UNDX must be known in advance.
+//
+//    Input, double TOL, a tolerance for equality.
+//
+//    Output, int UNDX[X_UNIQUE_NUM], the UNDX vector.
+//
+//    Output, int XDNU[X_NUM], the XDNU vector.
+//
+{
+  double diff;
+  int i;
+  int *indx;
+  int j;
+  int k;
+//
+//  Implicitly sort the array.
+//
+  indx = webbur::r8col_sort_heap_index_a ( x_dim, x_num, x_val );
+//
+//  Walk through the implicitly sorted array X.
+//
+  i = 0;
+
+  j = 0;
+  undx[j] = indx[i];
+
+  xdnu[indx[i]] = j;
+
+  for ( i = 1; i < x_num; i++ )
+  {
+    diff = 0.0;
+    for ( k = 0; k < x_dim; k++ )
+    {
+      diff = r8_max ( diff,
+        webbur::r8_abs ( x_val[k+indx[i]*x_dim] - x_val[k+undx[j]*x_dim] ) );
+    }
+    if ( tol < diff )
+    {
+      j = j + 1;
+      undx[j] = indx[i];
+    }
+    xdnu[indx[i]] = j;
+  }
+  delete [] indx;
+
+  return;
+}
+//****************************************************************************80
+
+void r8col_unique_index ( int m, int n, double a[], double tol,
+  int unique_index[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8COL_UNIQUE_INDEX indexes the first occurrence of values in an R8COL.
+//
+//  Discussion:
+//
+//    An R8COL is an M by N array of R8 values.
+//    It is regarded as an array of N columns of length M.
+//
+//    For element A(1:M,J) of the matrix, UNIQUE_INDEX(J) is the uniqueness
+//   index of A(1:M,J).  That is, if A_UNIQUE contains the unique elements
+//    of A, gathered in order, then
+//
+//      A_UNIQUE ( 1:M, UNIQUE_INDEX(J) ) = A(1:M,J)
+//
+//    The user must preallocate space for the output array UNIQUE_INDEX.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    24 November 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, N, the number of rows and columns of A.
+//    The length of an "element" of A, and the number of "elements".
+//
+//    Input, double A[M*N], the array.
+//
+//    Input, double TOL, a tolerance for equality.
+//
+//    Output, int UNIQUE_INDEX[N], the unique index.
+//
+{
+  double diff;
+  int i;
+  int j1;
+  int j2;
+  int unique_num;
+
+  for ( j1 = 0; j1 < n; j1++ )
+  {
+    unique_index[j1] = -1;
+  }
+  unique_num = 0;
+
+  for ( j1 = 0; j1 < n; j1++ )
+  {
+    if ( unique_index[j1] == -1 )
+    {
+      unique_index[j1] = unique_num;
+
+      for ( j2 = j1 + 1; j2 < n; j2++ )
+      {
+        diff = 0.0;
+        for ( i = 0; i < m; i++ )
+        {
+          diff = webbur::r8_max ( diff,
+            webbur::r8_abs ( a[i+j1*m] - a[i+j2*m] ) );
+        }
+        if ( diff <= tol )
+        {
+          unique_index[j2] = unique_num;
+        }
+      }
+      unique_num = unique_num + 1;
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+void r8mat_transpose_print ( int m, int n, double a[], std::string title )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed.
+//
+//  Discussion:
+//
+//    An R8MAT is a doubly dimensioned array of R8 values, stored as a vector
+//    in column-major order.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    10 September 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, N, the number of rows and columns.
+//
+//    Input, double A[M*N], an M by N matrix to be printed.
+//
+//    Input, string TITLE, a title.
+//
+{
+  r8mat_transpose_print_some ( m, n, a, 1, 1, m, n, title );
+
+  return;
+}
+//****************************************************************************80
+
+void r8mat_transpose_print_some ( int m, int n, double a[], int ilo, int jlo,
+  int ihi, int jhi, std::string title )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.
+//
+//  Discussion:
+//
+//    An R8MAT is a doubly dimensioned array of R8 values, stored as a vector
+//    in column-major order.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    10 September 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int M, N, the number of rows and columns.
+//
+//    Input, double A[M*N], an M by N matrix to be printed.
+//
+//    Input, int ILO, JLO, the first row and column to print.
+//
+//    Input, int IHI, JHI, the last row and column to print.
+//
+//    Input, string TITLE, a title.
+//
+{
+# define INCX 5
+
+  int i;
+  int i2;
+  int i2hi;
+  int i2lo;
+  int inc;
+  int j;
+  int j2hi;
+  int j2lo;
+
+  std::cout << "\n";
+  std::cout << title << "\n";
+
+  for ( i2lo = i4_max ( ilo, 1 ); i2lo <= i4_min ( ihi, m ); i2lo = i2lo + INCX )
+  {
+    i2hi = i2lo + INCX - 1;
+    i2hi = i4_min ( i2hi, m );
+    i2hi = i4_min ( i2hi, ihi );
+
+    inc = i2hi + 1 - i2lo;
+
+    std::cout << "\n";
+    std::cout << "  Row: ";
+    for ( i = i2lo; i <= i2hi; i++ )
+    {
+      std::cout << std::setw(7) << i - 1 << "       ";
+    }
+    std::cout << "\n";
+    std::cout << "  Col\n";
+    std::cout << "\n";
+
+    j2lo = i4_max ( jlo, 1 );
+    j2hi = i4_min ( jhi, n );
+
+    for ( j = j2lo; j <= j2hi; j++ )
+    {
+      std::cout << std::setw(5) << j - 1 << ":";
+      for ( i2 = 1; i2 <= inc; i2++ )
+      {
+        i = i2lo - 1 + i2;
+        std::cout << std::setw(14) << a[(i-1)+(j-1)*m];
+      }
+      std::cout << "\n";
+    }
+  }
+
+  return;
+# undef INCX
+}
+//****************************************************************************80
+
+void r8mat_write ( std::string output_filename, int m, int n, double table[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8MAT_WRITE writes an R8MAT file.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    11 August 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, string OUTPUT_FILENAME, the output filename.
+//
+//    Input, int M, the spatial dimension.
+//
+//    Input, int N, the number of points.
+//
+//    Input, double TABLE[M*N], the table data.
+//
+{
+  int i;
+  int j;
+  std::ofstream output;
+//
+//  Open the file.
+//
+  output.open ( output_filename.c_str ( ) );
+
+  if ( !output )
+  {
+    std::cerr << "\n";
+    std::cerr << "R8MAT_WRITE - Fatal error!\n";
+    std::cerr << "  Could not open the output file.\n";
+    return;
+  }
+//
+//  Write the data.
+//
+  for ( j = 0; j < n; j++ )
+  {
+    for ( i = 0; i < m; i++ )
+    {
+      output << "  " << std::setw(24) << std::setprecision(16) << table[i+j*m];
+    }
+    output << "\n";
+  }
+//
+//  Close the file.
+//
+  output.close ( );
+
+  return;
+}
+//****************************************************************************80
+
+double r8poly_ant_val ( int n, double poly_cof[], double xval )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8POLY_ANT_VAL evaluates the antiderivative of an R8POLY in standard form.
+//
+//  Discussion:
+//
+//    The constant term of the antiderivative is taken to be zero.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    17 June 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the order of the polynomial.
+//
+//    Input, double POLY_COF[N], the polynomial coefficients.  POLY_COF[0]
+//    is the constant term, and POLY_COF[N-1] is the coefficient of X**(N-1).
+//
+//    Input, double XVAL, the point where the antiderivative is to be
+//    evaluated.
+//
+//    Output, double R8POLY_ANT_VAL, the value of the antiderivative of the polynomial
+//    at XVAL.
+//
+{
+  int i;
+  double value;
+
+  value = 0.0;
+
+  for ( i = n - 1; 0 <= i; i-- )
+  {
+    value = ( value + poly_cof[i] / ( double ) ( i + 1 ) ) * xval;
+  }
+
+  return value;
+}
+//****************************************************************************80
+
+double *r8vec_chebyshev_new ( int n, double a_first, double a_last )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_CHEBYSHEV_NEW creates a vector of Chebyshev spaced values.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    08 June 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vector.
+//
+//    Input, double A_FIRST, A_LAST, the first and last entries.
+//
+//    Output, double R8VEC_CHEBYSHEV_NEW[N], a vector of Chebyshev spaced data.
+//
+{
+  double *a;
+  double c;
+  int i;
+  double pi = 3.141592653589793;
+  double theta;
+
+  a = new double[n];
+
+  if ( n == 1 )
+  {
+    a[0] = ( a_first + a_last ) / 2.0;
+  }
+  else
+  {
+    for ( i = 0; i < n; i++ )
+    {
+      theta = ( double ) ( n - i - 1 ) * pi / ( double ) ( n - 1 );
+
+      c = std::cos ( theta );
+
+      if ( ( n % 2 ) == 1 )
+      {
+        if ( 2 * i + 1 == n )
+        {
+          c = 0.0;
+        }
+      }
+
+      a[i] = ( ( 1.0 - c ) * a_first
+             + ( 1.0 + c ) * a_last )
+             /   2.0;
+    }
+  }
+  return a;
+}
+//****************************************************************************80
+
+int r8vec_compare ( int n, double a[], double b[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_COMPARE compares two R8VEC's.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//    The lexicographic ordering is used.
+//
+//  Example:
+//
+//    Input:
+//
+//      A1 = ( 2.0, 6.0, 2.0 )
+//      A2 = ( 2.0, 8.0, 12.0 )
+//
+//    Output:
+//
+//      ISGN = -1
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    23 September 2005
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vectors.
+//
+//    Input, double A[N], B[N], the vectors to be compared.
+//
+//    Output, int R8VEC_COMPARE, the results of the comparison:
+//    -1, A is lexicographically less than B,
+//     0, A is equal to B,
+//    +1, A is lexicographically greater than B.
+//
+{
+  int isgn;
+  int k;
+
+  isgn = 0;
+
+  for ( k = 0; k < n; k++ )
+  {
+    if ( a[k] < b[k] )
+    {
+      isgn = -1;
+      return isgn;
+    }
+    else if ( b[k] < a[k] )
+    {
+      isgn = +1;
+      return isgn;
+    }
+  }
+  return isgn;
+}
+//****************************************************************************80
+
+void r8vec_copy ( int n, double a1[], double a2[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_COPY copies an R8VEC.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    03 July 2005
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vectors.
+//
+//    Input, double A1[N], the vector to be copied.
+//
+//    Output, double A2[N], the copy of A1.
+//
+{
+  int i;
+
+  for ( i = 0; i < n; i++ )
+  {
+    a2[i] = a1[i];
+  }
+  return;
+}
+//****************************************************************************80
+
+double *r8vec_copy_new ( int n, double a1[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_COPY_NEW copies an R8VEC to a "new" R8VEC.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    03 July 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vectors.
+//
+//    Input, double A1[N], the vector to be copied.
+//
+//    Output, double R8VEC_COPY_NEW[N], the copy of A1.
+//
+{
+  double *a2;
+  int i;
+
+  a2 = new double[n];
+
+  for ( i = 0; i < n; i++ )
+  {
+    a2[i] = a1[i];
+  }
+  return a2;
+}
+//****************************************************************************80
+
+double r8vec_diff_norm_li ( int n, double a[], double b[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_DIFF_NORM_LI returns the L-oo norm of the difference of R8VEC's.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//    The vector L-oo norm is defined as:
+//
+//      R8VEC_NORM_LI = max ( 1 <= I <= N ) abs ( A(I) ).
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    02 April 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in A.
+//
+//    Input, double A[N], B[N], the vectors.
+//
+//    Output, double R8VEC_DIFF_NORM_LI, the L-oo norm of A - B.
+//
+{
+  int i;
+  double value;
+
+  value = 0.0;
+
+  for ( i = 0; i < n; i++ )
+  {
+    value = webbur::r8_max ( value, webbur::r8_abs ( a[i] - b[i] ) );
+  }
+  return value;
+}
+//****************************************************************************80
+
+void r8vec_direct_product2 ( int factor_index, int factor_order,
+  double factor_value[], int factor_num, int point_num, double w[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_DIRECT_PRODUCT2 creates a direct product of R8VEC's.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//    To explain what is going on here, suppose we had to construct
+//    a multidimensional quadrature rule as the product of K rules
+//    for 1D quadrature.
+//
+//    The product rule will be represented as a list of points and weights.
+//
+//    The J-th item in the product rule will be associated with
+//      item J1 of 1D rule 1,
+//      item J2 of 1D rule 2,
+//      ...,
+//      item JK of 1D rule K.
+//
+//    In particular,
+//      X(J) = ( X(1,J1), X(2,J2), ..., X(K,JK))
+//    and
+//      W(J) = W(1,J1) * W(2,J2) * ... * W(K,JK)
+//
+//    So we can construct the quadrature rule if we can properly
+//    distribute the information in the 1D quadrature rules.
+//
+//    This routine carries out that task for the weights W.
+//
+//    Another way to do this would be to compute, one by one, the
+//    set of all possible indices (J1,J2,...,JK), and then index
+//    the appropriate information.  An advantage of the method shown
+//    here is that you can process the K-th set of information and
+//    then discard it.
+//
+//  Example:
+//
+//    Rule 1:
+//      Order = 4
+//      W(1:4) = ( 2, 3, 5, 7 )
+//
+//    Rule 2:
+//      Order = 3
+//      W(1:3) = ( 11, 13, 17 )
+//
+//    Rule 3:
+//      Order = 2
+//      W(1:2) = ( 19, 23 )
+//
+//    Product Rule:
+//      Order = 24
+//      W(1:24) =
+//        ( 2 * 11 * 19 )
+//        ( 3 * 11 * 19 )
+//        ( 4 * 11 * 19 )
+//        ( 7 * 11 * 19 )
+//        ( 2 * 13 * 19 )
+//        ( 3 * 13 * 19 )
+//        ( 5 * 13 * 19 )
+//        ( 7 * 13 * 19 )
+//        ( 2 * 17 * 19 )
+//        ( 3 * 17 * 19 )
+//        ( 5 * 17 * 19 )
+//        ( 7 * 17 * 19 )
+//        ( 2 * 11 * 23 )
+//        ( 3 * 11 * 23 )
+//        ( 5 * 11 * 23 )
+//        ( 7 * 11 * 23 )
+//        ( 2 * 13 * 23 )
+//        ( 3 * 13 * 23 )
+//        ( 5 * 13 * 23 )
+//        ( 7 * 13 * 23 )
+//        ( 2 * 17 * 23 )
+//        ( 3 * 17 * 23 )
+//        ( 5 * 17 * 23 )
+//        ( 7 * 17 * 23 )
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 April 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int FACTOR_INDEX, the index of the factor being processed.
+//    The first factor processed must be factor 0.
+//
+//    Input, int FACTOR_ORDER, the order of the factor.
+//
+//    Input, double FACTOR_VALUE[FACTOR_ORDER], the factor values for
+//    factor FACTOR_INDEX.
+//
+//    Input, int FACTOR_NUM, the number of factors.
+//
+//    Input, int POINT_NUM, the number of elements in the direct product.
+//
+//    Input/output, double W[POINT_NUM], the elements of the
+//    direct product, which are built up gradually.
+//
+//  Local Parameters:
+//
+//    Local, integer START, the first location of a block of values to set.
+//
+//    Local, integer CONTIG, the number of consecutive values to set.
+//
+//    Local, integer SKIP, the distance from the current value of START
+//    to the next location of a block of values to set.
+//
+//    Local, integer REP, the number of blocks of values to set.
+//
+{
+  static int contig = 0;
+  int i;
+  int j;
+  int k;
+  static int rep = 0;
+  static int skip = 0;
+  int start;
+
+  if ( factor_index == 0 )
+  {
+    contig = 1;
+    skip = 1;
+    rep = point_num;
+    for ( i = 0; i < point_num; i++ )
+    {
+      w[i] = 1.0;
+    }
+  }
+
+  rep = rep / factor_order;
+  skip = skip * factor_order;
+
+  for ( j = 0; j < factor_order; j++ )
+  {
+    start = 0 + j * contig;
+
+    for ( k = 1; k <= rep; k++ )
+    {
+      for ( i = start; i < start + contig; i++ )
+      {
+        w[i] = w[i] * factor_value[j];
+      }
+      start = start + skip;
+    }
+  }
+
+  contig = contig * factor_order;
+
+  return;
+}
+//****************************************************************************80
+
+double r8vec_dot_product ( int n, double a1[], double a2[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_DOT_PRODUCT computes the dot product of a pair of R8VEC's.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    03 July 2005
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vectors.
+//
+//    Input, double A1[N], A2[N], the two vectors to be considered.
+//
+//    Output, double R8VEC_DOT_PRODUCT, the dot product of the vectors.
+//
+{
+  int i;
+  double value;
+
+  value = 0.0;
+  for ( i = 0; i < n; i++ )
+  {
+    value = value + a1[i] * a2[i];
+  }
+  return value;
+}
+//****************************************************************************80
+
+double r8vec_i4vec_dot_product ( int n, double r8vec[], int i4vec[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_I4VEC_DOT_PRODUCT computes the dot product of an R8VEC and an I4VEC.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//    An I4VEC is a vector of I4's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    30 June 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vectors.
+//
+//    Input, double R8VEC[N], the first vector.
+//
+//    Input, int I4VEC[N], the second vector.
+//
+//    Output, double R8VEC_I4VEC_DOT_PRODUCT, the dot product of the vectors.
+//
+{
+  int i;
+  double value;
+
+  value = 0.0;
+  for ( i = 0; i < n; i++ )
+  {
+    value = value + r8vec[i] * ( double ) ( i4vec[i] );
+  }
+  return value;
+}
+//****************************************************************************80
+
+void r8vec_index_sorted_range ( int n, double r[], int indx[], double r_lo,
+  double r_hi, int *i_lo, int *i_hi )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_INDEX_SORTED_RANGE: search index sorted vector for elements in a range.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    27 September 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of items in the vector.
+//
+//    Input, double R[N], the index sorted vector.
+//
+//    Input, int INDX[N], the vector used to sort R.
+//    The vector R[INDX[*]] is sorted.
+//
+//    Input, double R_LO, R_HI, the limits of the range.
+//
+//    Output, int *I_LO, *I_HI, the range of indices
+//    so that I_LO <= I <= I_HI => R_LO <= R[INDX[I]] <= R_HI.  If no
+//    values in R lie in the range, then I_HI < I_LO will be returned.
+//
+{
+  int i1;
+  int i2;
+  int j1;
+  int j2;
+//
+//  Cases we can handle immediately.
+//
+  if ( r[indx[n-1]] < r_lo )
+  {
+    *i_lo = n;
+    *i_hi = n - 1;
+    return;
+  }
+
+  if ( r_hi < r[indx[0]] )
+  {
+    *i_lo = 0;
+    *i_hi = -1;
+    return;
+  }
+//
+//  Are there are least two intervals?
+//
+  if ( n == 1 )
+  {
+    if ( r_lo <= r[indx[0]] && r[indx[0]] <= r_hi )
+    {
+      *i_lo = 0;
+      *i_hi = 0;
+    }
+    else
+    {
+      *i_lo = -1;
+      *i_hi = -2;
+    }
+    return;
+  }
+//
+//  Bracket R_LO.
+//
+  if ( r_lo <= r[indx[0]] )
+  {
+    *i_lo = 0;
+  }
+  else
+  {
+//
+//  R_LO is in one of the intervals spanned by R(INDX(J1)) to R(INDX(J2)).
+//  Examine the intermediate interval [R(INDX(I1)), R(INDX(I1+1))].
+//  Does R_LO lie here, or below or above?
+//
+    j1 = 0;
+    j2 = n - 1;
+    i1 = ( j1 + j2 - 1 ) / 2;
+    i2 = i1 + 1;
+
+    for ( ; ; )
+    {
+      if ( r_lo < r[indx[i1]] )
+      {
+        j2 = i1;
+        i1 = ( j1 + j2 - 1 ) / 2;
+        i2 = i1 + 1;
+      }
+      else if ( r[indx[i2]] < r_lo )
+      {
+        j1 = i2;
+        i1 = ( j1 + j2 - 1 ) / 2;
+        i2 = i1 + 1;
+      }
+      else
+      {
+        *i_lo = i1;
+        break;
+      }
+    }
+  }
+//
+//  Bracket R_HI.
+//
+  if ( r[indx[n-1]] <= r_hi )
+  {
+    *i_hi = n - 1;
+  }
+  else
+  {
+    j1 = *i_lo;
+    j2 = n - 1;
+    i1 = ( j1 + j2 - 1 ) / 2;
+    i2 = i1 + 1;
+
+    for ( ; ; )
+    {
+      if ( r_hi < r[indx[i1]] )
+      {
+        j2 = i1;
+        i1 = ( j1 + j2 - 1 ) / 2;
+        i2 = i1 + 1;
+      }
+      else if ( r[indx[i2]] < r_hi )
+      {
+        j1 = i2;
+        i1 = ( j1 + j2 - 1 ) / 2;
+        i2 = i1 + 1;
+      }
+      else
+      {
+        *i_hi = i2;
+        break;
+      }
+    }
+  }
+//
+//  We expect to have computed the largest I_LO and smallest I_HI such that
+//    R(INDX(I_LO)) <= R_LO <= R_HI <= R(INDX(I_HI))
+//  but what we want is actually
+//    R_LO <= R(INDX(I_LO)) <= R(INDX(I_HI)) <= R_HI
+//  which we can usually get simply by incrementing I_LO and decrementing I_HI.
+//
+  if ( r[indx[*i_lo]] < r_lo )
+  {
+    *i_lo = *i_lo + 1;
+    if ( n - 1 < *i_lo )
+    {
+      *i_hi = *i_lo - 1;
+    }
+  }
+
+  if ( r_hi < r[indx[*i_hi]] )
+  {
+    *i_hi = *i_hi - 1;
+    if ( *i_hi < 0 )
+    {
+      *i_lo = *i_hi + 1;
+    }
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void r8vec_indexed_heap_d ( int n, double a[], int indx[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_INDEXED_HEAP_D creates a descending heap from an indexed R8VEC.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//    An indexed R8VEC is an R8VEC of data values, and an R8VEC of N indices,
+//    each referencing an entry of the data vector.
+//
+//    The function adjusts the index vector INDX so that, for 1 <= J <= N/2,
+//    we have:
+//      A[INDX[2*J+1]]   <= A[INDX[J]]
+//    and
+//      A[INDX[2*J+2]] <= A[INDX[J]]
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 August 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Albert Nijenhuis, Herbert Wilf,
+//    Combinatorial Algorithms for Computers and Calculators,
+//    Academic Press, 1978,
+//    ISBN: 0-12-519260-6,
+//    LC: QA164.N54.
+//
+//  Parameters:
+//
+//    Input, int N, the size of the index array.
+//
+//    Input, double A[*], the data vector.
+//
+//    Input/output, int INDX[N], the index array.
+//    Each entry of INDX must be a valid index for the array A.
+//    On output, the indices have been reordered into a descending heap.
+//
+{
+  int i;
+  int ifree;
+  int key;
+  int m;
+//
+//  Only nodes N/2 - 1 down to 0 can be "parent" nodes.
+//
+  for ( i = ( n / 2 ) - 1; 0 <= i; i-- )
+  {
+//
+//  Copy the value out of the parent node.
+//  Position IFREE is now "open".
+//
+    key = indx[i];
+    ifree = i;
+
+    for ( ; ; )
+    {
+//
+//  Positions 2*IFREE+1 and 2*IFREE+2 are the descendants of position
+//  IFREE.  (One or both may not exist because they exceed N-1.)
+//
+      m = 2 * ifree + 1;
+//
+//  Does the first position exist?
+//
+      if ( n - 1 < m )
+      {
+        break;
+      }
+//
+//  Does the second position exist?
+//
+      if ( m + 1 <= n - 1 )
+      {
+//
+//  If both positions exist, take the larger of the two values,
+//  and update M if necessary.
+//
+        if ( a[indx[m]] < a[indx[m+1]] )
+        {
+          m = m + 1;
+        }
+      }
+//
+//  If the large descendant is larger than KEY, move it up,
+//  and update IFREE, the location of the free position, and
+//  consider the descendants of THIS position.
+//
+      if ( a[indx[m]] <= a[key] )
+      {
+        break;
+      }
+
+      indx[ifree] = indx[m];
+      ifree = m;
+    }
+//
+//  Once there is no more shifting to do, KEY moves into the free spot IFREE.
+//
+    indx[ifree] = key;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+int r8vec_indexed_heap_d_extract ( int *n, double a[], int indx[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_INDEXED_HEAP_D_EXTRACT: extract from heap descending indexed R8VEC.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//    An indexed R8VEC is an R8VEC of data values, and an R8VEC of N indices,
+//    each referencing an entry of the data vector.
+//
+//    The routine finds the maximum value in the heap, returns that value to the
+//    user, deletes that value from the heap, and restores the heap to its
+//    proper form.
+//
+//    Note that the argument N must be a variable, which will be decremented
+//    before return, and that INDX will hold one less value on output than it
+//    held on input.
+//
+//    This is one of three functions needed to model a priority queue.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 August 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Thomas Cormen, Charles Leiserson, Ronald Rivest,
+//    Introduction to Algorithms,
+//    MIT Press, 2001,
+//    ISBN: 0262032937,
+//    LC: QA76.C662.
+//
+//  Parameters:
+//
+//    Input/output, int *N, the number of items in the index vector.
+//
+//    Input, double A[*], the data vector.
+//
+//    Input/output, int INDX[N], the index vector.
+//
+//    Output, int R8VEC_INDEXED_HEAP_D_EXTRACT, the index in A of the item of
+//    maximum value, which has now been removed from the heap.
+//
+{
+  int indx_extract;
+
+  if ( *n < 1 )
+  {
+    std::cerr << "\n";
+    std::cerr << "R8VEC_INDEXED_HEAP_D_EXTRACT - Fatal error!\n";
+    std::cerr << "  The heap is empty.\n";
+    std::exit ( 1 );
+  }
+//
+//  Get the index of the maximum value.
+//
+  indx_extract = indx[0];
+
+  if ( *n == 1 )
+  {
+    *n = 0;
+    return indx_extract;
+  }
+//
+//  Shift the last index down.
+//
+  indx[0] = indx[*n-1];
+//
+//  Restore the heap structure.
+//
+  *n = *n - 1;
+  webbur::r8vec_indexed_heap_d ( *n, a, indx );
+
+  return indx_extract;
+}
+//****************************************************************************80
+
+void r8vec_indexed_heap_d_insert ( int *n, double a[], int indx[],
+  int indx_insert )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_INDEXED_HEAP_D_INSERT: insert value into heap descending indexed R8VEC.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//    An indexed R8VEC is an R8VEC of data values, and an R8VEC of N indices,
+//    each referencing an entry of the data vector.
+//
+//    Note that the argument N must be a variable, and will be incremented before
+//    return, and that INDX must be able to hold one more entry on output than
+//    it held on input.
+//
+//    This is one of three functions needed to model a priority queue.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 August 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Thomas Cormen, Charles Leiserson, Ronald Rivest,
+//    Introduction to Algorithms,
+//    MIT Press, 2001,
+//    ISBN: 0262032937,
+//    LC: QA76.C662.
+//
+//  Parameters:
+//
+//    Input/output, int *N, the number of items in the index vector.
+//
+//    Input, double A[*], the data vector.
+//
+//    Input/output, int INDX[N], the index vector.
+//
+//    Input, int INDX_INSERT, the index in A of the value
+//    to be inserted into the heap.
+//
+{
+  int i;
+  int parent;
+
+  *n = *n + 1;
+  i = *n - 1;
+
+  while ( 0 < i )
+  {
+    parent = ( i - 1 ) / 2;
+
+    if ( a[indx_insert] <= a[indx[parent]] )
+    {
+      break;
+    }
+
+    indx[i] = indx[parent];
+    i = parent;
+  }
+
+  indx[i] = indx_insert;
+
+  return;
+}
+//****************************************************************************80
+
+int r8vec_indexed_heap_d_max ( int n, double a[], int indx[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_INDEXED_HEAP_D_MAX: maximum value in heap descending indexed R8VEC.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//    An indexed R8VEC is an R8VEC of data values, and an R8VEC of N indices,
+//    each referencing an entry of the data vector.
+//
+//    This is one of three functions needed to model a priority queue.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    18 August 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Thomas Cormen, Charles Leiserson, Ronald Rivest,
+//    Introduction to Algorithms,
+//    MIT Press, 2001,
+//    ISBN: 0262032937,
+//    LC: QA76.C662.
+//
+//  Parameters:
+//
+//    Input, int N, the number of items in the index vector.
+//
+//    Input, double A[*], the data vector.
+//
+//    Input, int INDX[N], the index vector.
+//
+//    Output, int R8VEC_INDEXED_HEAP_D_MAX, the index in A of the maximum value
+//    in the heap.
+//
+{
+  int indx_max;
+
+  indx_max = indx[0];
+
+  return indx_max;
+}
+//****************************************************************************80
+
+double *r8vec_legendre_new ( int n, double a_first, double a_last )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_LEGENDRE_NEW creates a vector of Chebyshev spaced values.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    17 June 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vector.
+//
+//    Input, double A_FIRST, A_LAST, the first and last entries.
+//
+//    Output, double R8VEC_LEGENDRE_NEW[N], a vector of Legendre spaced data.
+//
+{
+  double *a;
+  int i;
+
+  a = webbur::legendre_zeros ( n );
+
+  for ( i = 0; i < n; i++ )
+  {
+    a[i] = ( ( 1.0 - a[i] ) * a_first
+           + ( 1.0 + a[i] ) * a_last )
+           /   2.0;
+  }
+  return a;
+}
+//****************************************************************************80
+
+double *r8vec_linspace_new ( int n, double a_first, double a_last )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_LINSPACE_NEW creates a vector of linearly spaced values.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    14 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vector.
+//
+//    Input, double A_FIRST, A_LAST, the first and last entries.
+//
+//    Output, double R8VEC_LINSPACE_NEW[N], a vector of linearly spaced data.
+//
+{
+  double *a;
+  int i;
+
+  a = new double[n];
+
+  if ( n == 1 )
+  {
+    a[0] = ( a_first + a_last ) / 2.0;
+  }
+  else
+  {
+    for ( i = 0; i < n; i++ )
+    {
+      a[i] = ( ( double ) ( n - 1 - i ) * a_first
+             + ( double ) (         i ) * a_last )
+             / ( double ) ( n - 1     );
+    }
+  }
+  return a;
+}
+//****************************************************************************80
+
+double r8vec_min ( int n, double r8vec[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_MIN returns the value of the minimum element in an R8VEC.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    02 July 2005
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the array.
+//
+//    Input, double R8VEC[N], the array to be checked.
+//
+//    Output, double R8VEC_MIN, the value of the minimum element.
+//
+{
+  int i;
+  double value;
+
+  value = r8vec[0];
+
+  for ( i = 1; i < n; i++ )
+  {
+    if ( r8vec[i] < value )
+    {
+      value = r8vec[i];
+    }
+  }
+  return value;
+}
+//****************************************************************************80
+
+double r8vec_min_pos ( int n, double a[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_MIN_POS returns the minimum positive value of an R8VEC.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    08 November 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries.
+//
+//    Input, double A[N], the array.
+//
+//    Output, double R8VEC_MIN_POS, the smallest positive entry,
+//    or R8_HUGE if no entry is positive.
+//
+{
+  int i;
+  double r8_huge = 1.0E+30;
+  double value;
+
+  value = r8_huge;
+
+  for ( i = 0; i < n; i++ )
+  {
+    if ( 0.0 < a[i] )
+    {
+      if ( a[i] < value )
+      {
+        value = a[i];
+      }
+    }
+  }
+  return value;
+}
+//****************************************************************************80
+
+void r8vec_print ( int n, double a[], std::string title )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_PRINT prints an R8VEC.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    16 August 2004
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of components of the vector.
+//
+//    Input, double A[N], the vector to be printed.
+//
+//    Input, string TITLE, a title.
+//
+{
+  int i;
+
+  std::cout << "\n";
+  std::cout << title << "\n";
+  std::cout << "\n";
+  for ( i = 0; i < n; i++ )
+  {
+    std::cout << "  " << std::setw(8)  << i
+              << ": " << std::setw(14) << a[i]  << "\n";
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void r8vec_scale ( double s, int n, double a[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_SCALE multiples an R8VEC by a scale factor.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    22 September 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, double S, the scale factor.
+//
+//    Input, int N, the number of entries in the vectors.
+//
+//    Input/output, double A[N], the vector to be scaled.
+//    On output, A[] = S * A[].
+//
+{
+  int i;
+
+  for ( i = 0; i < n; i++ )
+  {
+    a[i] = s * a[i];
+  }
+  return;
+}
+//****************************************************************************80
+
+void r8vec_sort_heap_index_a ( int n, double a[], int indx[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_SORT_HEAP_INDEX_A does an indexed heap ascending sort of an R8VEC
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//    The sorting is not actually carried out.  Rather an index array is
+//    created which defines the sorting.  This array may be used to sort
+//    or index the array, or to sort or index related arrays keyed on the
+//    original array.
+//
+//    Once the index array is computed, the sorting can be carried out
+//    "implicitly:
+//
+//      a(indx(*))
+//
+//    or explicitly, by the call
+//
+//      r8vec_permute ( n, indx, 0, a )
+//
+//    after which a(*) is sorted.
+//
+//    Note that the index vector is 0-based.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    02 October 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the array.
+//
+//    Input, double A[N], an array to be index-sorted.
+//
+//    Output, int INDX[N], contains the sort index.  The
+//    I-th element of the sorted array is A(INDX(I)).
+//
+{
+  double aval;
+  int i;
+  int indxt;
+  int ir;
+  int j;
+  int l;
+
+  if ( n < 1 )
+  {
+    return;
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    indx[i] = i;
+  }
+
+  if ( n == 1 )
+  {
+    return;
+  }
+
+  l = n / 2 + 1;
+  ir = n;
+
+  for ( ; ; )
+  {
+    if ( 1 < l )
+    {
+      l = l - 1;
+      indxt = indx[l-1];
+      aval = a[indxt];
+    }
+    else
+    {
+      indxt = indx[ir-1];
+      aval = a[indxt];
+      indx[ir-1] = indx[0];
+      ir = ir - 1;
+
+      if ( ir == 1 )
+      {
+        indx[0] = indxt;
+        break;
+      }
+    }
+
+    i = l;
+    j = l + l;
+
+    while ( j <= ir )
+    {
+      if ( j < ir )
+      {
+        if ( a[indx[j-1]] < a[indx[j]] )
+        {
+          j = j + 1;
+        }
+      }
+
+      if ( aval < a[indx[j-1]] )
+      {
+        indx[i-1] = indx[j-1];
+        i = j;
+        j = j + j;
+      }
+      else
+      {
+        j = ir + 1;
+      }
+    }
+    indx[i-1] = indxt;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+int *r8vec_sort_heap_index_a_new ( int n, double a[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_SORT_HEAP_INDEX_A_NEW does an indexed heap ascending sort of an R8VEC
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//    The sorting is not actually carried out.  Rather an index array is
+//    created which defines the sorting.  This array may be used to sort
+//    or index the array, or to sort or index related arrays keyed on the
+//    original array.
+//
+//    Once the index array is computed, the sorting can be carried out
+//    "implicitly:
+//
+//      a(indx(*))
+//
+//    or explicitly, by the call
+//
+//      r8vec_permute ( n, indx, 0, a )
+//
+//    after which a(*) is sorted.
+//
+//    Note that the index vector is 0-based.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    02 October 2010
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the array.
+//
+//    Input, double A[N], an array to be index-sorted.
+//
+//    Output, int R8VEC_SORT_HEAP_INDEX_A_NEW[N], contains the sort index.  The
+//    I-th element of the sorted array is A(INDX(I)).
+//
+{
+  double aval;
+  int i;
+  int *indx;
+  int indxt;
+  int ir;
+  int j;
+  int l;
+
+  if ( n < 1 )
+  {
+    return NULL;
+  }
+
+  indx = new int[n];
+
+  for ( i = 0; i < n; i++ )
+  {
+    indx[i] = i;
+  }
+
+  if ( n == 1 )
+  {
+    return indx;
+  }
+
+  l = n / 2 + 1;
+  ir = n;
+
+  for ( ; ; )
+  {
+    if ( 1 < l )
+    {
+      l = l - 1;
+      indxt = indx[l-1];
+      aval = a[indxt];
+    }
+    else
+    {
+      indxt = indx[ir-1];
+      aval = a[indxt];
+      indx[ir-1] = indx[0];
+      ir = ir - 1;
+
+      if ( ir == 1 )
+      {
+        indx[0] = indxt;
+        break;
+      }
+    }
+
+    i = l;
+    j = l + l;
+
+    while ( j <= ir )
+    {
+      if ( j < ir )
+      {
+        if ( a[indx[j-1]] < a[indx[j]] )
+        {
+          j = j + 1;
+        }
+      }
+
+      if ( aval < a[indx[j-1]] )
+      {
+        indx[i-1] = indx[j-1];
+        i = j;
+        j = j + j;
+      }
+      else
+      {
+        j = ir + 1;
+      }
+    }
+    indx[i-1] = indxt;
+  }
+
+  return indx;
+}
+//****************************************************************************80
+
+void r8vec_stutter ( int n, double a[], int m, double am[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_STUTTER makes a "stuttering" copy of an R8VEC.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//    Applying a stuttering factor M of 3, the vector A = ( 1, 5, 8 ) becomes
+//    AM = ( 1, 1, 1, 5, 5, 5, 8, 8, 8 ).
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    28 March 2011
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the size of the input vector.
+//
+//    Input, double A[N], the vector.
+//
+//    Input, int M, the "stuttering factor".
+//
+//    Output, double AM[M*N], the stuttering vector.
+//
+{
+  int i;
+  int j;
+  int k;
+
+  k = 0;
+  for ( i = 0; i < n; i++ )
+  {
+    for ( j = 0; j < m; j++ )
+    {
+      am[k] = a[i];
+      k = k + 1;
+    }
+  }
+  return;
+}
+//****************************************************************************80
+
+double r8vec_sum ( int n, double a[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_SUM returns the sum of an R8VEC.
+//
+//  Discussion:
+//
+//    An R8VEC is a double precision vector.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    15 October 2004
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vector.
+//
+//    Input, double A[N], the vector.
+//
+//    Output, double R8VEC_SUM, the sum of the vector.
+//
+{
+  int i;
+  double value;
+
+  value = 0.0;
+  for ( i = 0; i < n; i++ )
+  {
+    value = value + a[i];
+  }
+
+  return value;
+}
+//****************************************************************************80
+
+void r8vec_uniform_01 ( int n, int *seed, double r[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_UNIFORM_01 returns a unit pseudorandom R8VEC.
+//
+//  Discussion:
+//
+//    This routine implements the recursion
+//
+//      seed = ( 16807 * seed ) mod ( 2^31 - 1 )
+//      u = seed / ( 2^31 - 1 )
+//
+//    The integer arithmetic never requires more than 32 bits,
+//    including a sign bit.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 August 2004
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Paul Bratley, Bennett Fox, Linus Schrage,
+//    A Guide to Simulation,
+//    Second Edition,
+//    Springer, 1987,
+//    ISBN: 0387964673,
+//    LC: QA76.9.C65.B73.
+//
+//    Bennett Fox,
+//    Algorithm 647:
+//    Implementation and Relative Efficiency of Quasirandom
+//    Sequence Generators,
+//    ACM Transactions on Mathematical Software,
+//    Volume 12, Number 4, December 1986, pages 362-376.
+//
+//    Pierre L'Ecuyer,
+//    Random Number Generation,
+//    in Handbook of Simulation,
+//    edited by Jerry Banks,
+//    Wiley, 1998,
+//    ISBN: 0471134031,
+//    LC: T57.62.H37.
+//
+//    Peter Lewis, Allen Goodman, James Miller,
+//    A Pseudo-Random Number Generator for the System/360,
+//    IBM Systems Journal,
+//    Volume 8, Number 2, 1969, pages 136-143.
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vector.
+//
+//    Input/output, int *SEED, a seed for the random number generator.
+//
+//    Output, double R[N], the vector of pseudorandom values.
+//
+{
+  int i;
+  int i4_huge = 2147483647;
+  int k;
+
+  if ( *seed == 0 )
+  {
+    std::cerr << "\n";
+    std::cerr << "R8VEC_UNIFORM_01 - Fatal error!\n";
+    std::cerr << "  Input value of SEED = 0.\n";
+    std::exit ( 1 );
+  }
+
+  for ( i = 0; i < n; i++ )
+  {
+    k = *seed / 127773;
+
+    *seed = 16807 * ( *seed - k * 127773 ) - k * 2836;
+
+    if ( *seed < 0 )
+    {
+      *seed = *seed + i4_huge;
+    }
+
+    r[i] = ( double ) ( *seed ) * 4.656612875E-10;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+double *r8vec_uniform_01_new ( int n, int *seed )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_UNIFORM_01_NEW returns a new unit pseudorandom R8VEC.
+//
+//  Discussion:
+//
+//    This routine implements the recursion
+//
+//      seed = ( 16807 * seed ) mod ( 2^31 - 1 )
+//      u = seed / ( 2^31 - 1 )
+//
+//    The integer arithmetic never requires more than 32 bits,
+//    including a sign bit.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 August 2004
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Paul Bratley, Bennett Fox, Linus Schrage,
+//    A Guide to Simulation,
+//    Second Edition,
+//    Springer, 1987,
+//    ISBN: 0387964673,
+//    LC: QA76.9.C65.B73.
+//
+//    Bennett Fox,
+//    Algorithm 647:
+//    Implementation and Relative Efficiency of Quasirandom
+//    Sequence Generators,
+//    ACM Transactions on Mathematical Software,
+//    Volume 12, Number 4, December 1986, pages 362-376.
+//
+//    Pierre L'Ecuyer,
+//    Random Number Generation,
+//    in Handbook of Simulation,
+//    edited by Jerry Banks,
+//    Wiley, 1998,
+//    ISBN: 0471134031,
+//    LC: T57.62.H37.
+//
+//    Peter Lewis, Allen Goodman, James Miller,
+//    A Pseudo-Random Number Generator for the System/360,
+//    IBM Systems Journal,
+//    Volume 8, Number 2, 1969, pages 136-143.
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vector.
+//
+//    Input/output, int *SEED, a seed for the random number generator.
+//
+//    Output, double R8VEC_UNIFORM_01_NEW[N], the vector of pseudorandom values.
+//
+{
+  int i;
+  int i4_huge = 2147483647;
+  int k;
+  double *r;
+
+  if ( *seed == 0 )
+  {
+    std::cerr << "\n";
+    std::cerr << "R8VEC_UNIFORM_01_NEW - Fatal error!\n";
+    std::cerr << "  Input value of SEED = 0.\n";
+    std::exit ( 1 );
+  }
+
+  r = new double[n];
+
+  for ( i = 0; i < n; i++ )
+  {
+    k = *seed / 127773;
+
+    *seed = 16807 * ( *seed - k * 127773 ) - k * 2836;
+
+    if ( *seed < 0 )
+    {
+      *seed = *seed + i4_huge;
+    }
+
+    r[i] = ( double ) ( *seed ) * 4.656612875E-10;
+  }
+
+  return r;
+}
+//****************************************************************************80
+
+void r8vec_zero ( int n, double a[] )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    R8VEC_ZERO zeroes an R8VEC.
+//
+//  Discussion:
+//
+//    An R8VEC is a vector of R8's.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    03 July 2005
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int N, the number of entries in the vector.
+//
+//    Output, double A[N], a vector of zeroes.
+//
+{
+  int i;
+
+  for ( i = 0; i < n; i++ )
+  {
+    a[i] = 0.0;
+  }
+  return;
+}
+//****************************************************************************80
+
+void sort_heap_external ( int n, int *indx, int *i, int *j, int isgn )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    SORT_HEAP_EXTERNAL externally sorts a list of items into ascending order.
+//
+//  Discussion:
+//
+//    The actual list is not passed to the routine.  Hence it may
+//    consist of integers, reals, numbers, names, etc.  The user,
+//    after each return from the routine, will be asked to compare or
+//    interchange two items.
+//
+//    The current version of this code mimics the FORTRAN version,
+//    so the values of I and J, in particular, are FORTRAN indices.
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    05 February 2004
+//
+//  Author:
+//
+//    Original FORTRAN77 version by Albert Nijenhuis, Herbert Wilf.
+//    C++ version by John Burkardt
+//
+//  Reference:
+//
+//    Albert Nijenhuis, Herbert Wilf,
+//    Combinatorial Algorithms,
+//    Academic Press, 1978, second edition,
+//    ISBN 0-12-519260-6.
+//
+//  Parameters:
+//
+//    Input, int N, the length of the input list.
+//
+//    Input/output, int *INDX.
+//    The user must set INDX to 0 before the first call.
+//    On return,
+//      if INDX is greater than 0, the user must interchange
+//      items I and J and recall the routine.
+//      If INDX is less than 0, the user is to compare items I
+//      and J and return in ISGN a negative value if I is to
+//      precede J, and a positive value otherwise.
+//      If INDX is 0, the sorting is done.
+//
+//    Output, int *I, *J.  On return with INDX positive,
+//    elements I and J of the user's list should be
+//    interchanged.  On return with INDX negative, elements I
+//    and J are to be compared by the user.
+//
+//    Input, int ISGN. On return with INDX negative, the
+//    user should compare elements I and J of the list.  If
+//    item I is to precede item J, set ISGN negative,
+//    otherwise set ISGN positive.
+//
+{
+  static int i_save = 0;
+  static int j_save = 0;
+  static int k = 0;
+  static int k1 = 0;
+  static int n1 = 0;
+//
+//  INDX = 0: This is the first call.
+//
+  if ( *indx == 0 )
+  {
+
+    i_save = 0;
+    j_save = 0;
+    k = n / 2;
+    k1 = k;
+    n1 = n;
+  }
+//
+//  INDX < 0: The user is returning the results of a comparison.
+//
+  else if ( *indx < 0 )
+  {
+    if ( *indx == -2 )
+    {
+      if ( isgn < 0 )
+      {
+        i_save = i_save + 1;
+      }
+      j_save = k1;
+      k1 = i_save;
+      *indx = -1;
+      *i = i_save;
+      *j = j_save;
+      return;
+    }
+
+    if ( 0 < isgn )
+    {
+      *indx = 2;
+      *i = i_save;
+      *j = j_save;
+      return;
+    }
+
+    if ( k <= 1 )
+    {
+      if ( n1 == 1 )
+      {
+        i_save = 0;
+        j_save = 0;
+        *indx = 0;
+      }
+      else
+      {
+        i_save = n1;
+        j_save = 1;
+        n1 = n1 - 1;
+        *indx = 1;
+      }
+      *i = i_save;
+      *j = j_save;
+      return;
+    }
+    k = k - 1;
+    k1 = k;
+  }
+//
+//  0 < INDX: the user was asked to make an interchange.
+//
+  else if ( *indx == 1 )
+  {
+    k1 = k;
+  }
+
+  for ( ; ; )
+  {
+
+    i_save = 2 * k1;
+
+    if ( i_save == n1 )
+    {
+      j_save = k1;
+      k1 = i_save;
+      *indx = -1;
+      *i = i_save;
+      *j = j_save;
+      return;
+    }
+    else if ( i_save <= n1 )
+    {
+      j_save = i_save + 1;
+      *indx = -2;
+      *i = i_save;
+      *j = j_save;
+      return;
+    }
+
+    if ( k <= 1 )
+    {
+      break;
+    }
+
+    k = k - 1;
+    k1 = k;
+  }
+
+  if ( n1 == 1 )
+  {
+    i_save = 0;
+    j_save = 0;
+    *indx = 0;
+    *i = i_save;
+    *j = j_save;
+  }
+  else
+  {
+    i_save = n1;
+    j_save = 1;
+    n1 = n1 - 1;
+    *indx = 1;
+    *i = i_save;
+    *j = j_save;
+  }
+
+  return;
+}
+//****************************************************************************80
+
+void timestamp ( )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    TIMESTAMP prints the current YMDHMS date as a time stamp.
+//
+//  Example:
+//
+//    31 May 2001 09:45:54 AM
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    08 July 2009
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    None
+//
+{
+# define TIME_SIZE 40
+
+  static char time_buffer[TIME_SIZE];
+  const struct std::tm *tm_ptr;
+  size_t len;
+  std::time_t now;
+
+  now = std::time ( NULL );
+  tm_ptr = std::localtime ( &now );
+
+  len = std::strftime ( time_buffer, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm_ptr );
+
+  std::cout << time_buffer << "\n";
+
+  return;
+# undef TIME_SIZE
+}
+//****************************************************************************80
+
+void vec_colex_next3 ( int dim_num, int base[], int a[], bool *more )
+
+//****************************************************************************80
+//
+//  Purpose:
+//
+//    VEC_COLEX_NEXT3 generates vectors in colex order.
+//
+//  Discussion:
+//
+//    The vectors are produced in colexical order, starting with
+//
+//    (1,        1,        ...,1),
+//    (2,        1,        ...,1),
+//     ...
+//    (BASE(1),  1,        ...,1)
+//
+//    (1,        2,        ...,1)
+//    (2,        2,        ...,1)
+//    ...
+//    (BASE(1),  2,        ...,1)
+//
+//    (1,        3,        ...,1)
+//    (2,        3,        ...,1)
+//    ...
+//    (BASE(1),  BASE(2), ...,BASE(DIM_NUM)).
+//
+//  Example:
+//
+//    DIM_NUM = 2,
+//    BASE = { 3, 3 }
+//
+//    1   1
+//    2   1
+//    3   1
+//    1   2
+//    2   2
+//    3   2
+//    1   3
+//    2   3
+//    3   3
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    19 August 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Parameters:
+//
+//    Input, int DIM_NUM, the spatial dimension.
+//
+//    Input, int BASE[DIM_NUM], the bases to be used in each dimension.
+//    In dimension I, entries will range from 1 to BASE[I].
+//
+//    Output, int A[DIM_NUM], the next vector.
+//
+//    Input/output, bool *MORE.  Set this variable false before
+//    the first call.  On return, MORE is TRUE if another vector has
+//    been computed.  If MORE is returned FALSE, ignore the output
+//    vector and stop calling the routine.
+//
+{
+  int i;
+
+  if ( !( *more ) )
+  {
+    for ( i = 0; i < dim_num; i++ )
+    {
+      a[i] = 1;
+    }
+    *more = true;
+  }
+  else
+  {
+    for ( i = 0; i < dim_num; i++ )
+    {
+      a[i] = a[i] + 1;
+
+      if ( a[i] <= base[i] )
+      {
+        return;
+      }
+      a[i] = 1;
+    }
+    *more = false;
+  }
+
+  return;
+}
+
+
+}
Index: /issm/trunk/externalpackages/dakota/configs/6.2/packages/queso/src/misc/src/1DQuadrature.C
===================================================================
--- /issm/trunk/externalpackages/dakota/configs/6.2/packages/queso/src/misc/src/1DQuadrature.C	(revision 26744)
+++ /issm/trunk/externalpackages/dakota/configs/6.2/packages/queso/src/misc/src/1DQuadrature.C	(revision 26744)
@@ -0,0 +1,755 @@
+//-----------------------------------------------------------------------bl-
+//--------------------------------------------------------------------------
+//
+// QUESO - a library to support the Quantification of Uncertainty
+// for Estimation, Simulation and Optimization
+//
+// Copyright (C) 2008-2015 The PECOS Development Team
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the Version 2.1 GNU Lesser General
+// Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc. 51 Franklin Street, Fifth Floor,
+// Boston, MA  02110-1301  USA
+//
+//-----------------------------------------------------------------------el-
+
+#include <queso/1DQuadrature.h>
+
+namespace QUESO {
+
+//*****************************************************
+// Base 1D quadrature class
+//*****************************************************
+Base1DQuadrature::Base1DQuadrature(
+  double minDomainValue,
+  double maxDomainValue,
+  unsigned int order)
+  :
+  m_minDomainValue(minDomainValue),
+  m_maxDomainValue(maxDomainValue),
+  m_order         (order),
+  m_positions     (0),
+  m_weights       (0)
+{
+  UQ_FATAL_TEST_MACRO(m_minDomainValue >= m_maxDomainValue,
+                      UQ_UNAVAILABLE_RANK,
+                      "Base1DQuadrature::constructor()",
+                      "min >= max");
+  //UQ_FATAL_TEST_MACRO(order == 0, // eep2011
+  //                    UQ_UNAVAILABLE_RANK,
+  //                    "Base1DQuadrature::constructor()",
+  //                    "order = 0");
+}
+
+Base1DQuadrature::~Base1DQuadrature()
+{
+}
+
+double
+Base1DQuadrature::minDomainValue() const
+{
+  return m_minDomainValue;
+}
+
+double
+Base1DQuadrature::maxDomainValue() const
+{
+  return m_maxDomainValue;
+}
+
+unsigned int
+Base1DQuadrature::order() const
+{
+  return m_order;
+}
+
+const std::vector<double>&
+Base1DQuadrature::positions() const
+{
+  UQ_FATAL_TEST_MACRO(m_positions.size() == 0,
+                      UQ_UNAVAILABLE_RANK,
+                      "Base1DQuadrature::positions()",
+                      "size = 0");
+  return m_positions;
+}
+
+const std::vector<double>&
+Base1DQuadrature::weights() const
+{
+  UQ_FATAL_TEST_MACRO(m_weights.size() == 0,
+                      UQ_UNAVAILABLE_RANK,
+                      "Base1DQuadrature::weights()",
+                      "size = 0");
+  return m_weights;
+}
+
+//*****************************************************
+// Generic 1D quadrature class
+//*****************************************************
+Generic1DQuadrature::Generic1DQuadrature(
+  double minDomainValue,
+  double maxDomainValue,
+  const std::vector<double>& positions,
+  const std::vector<double>& weights)
+  :
+  Base1DQuadrature(minDomainValue,maxDomainValue,positions.size()-1)
+{
+  m_positions = positions;
+  m_weights   = weights;
+
+  UQ_FATAL_TEST_MACRO(m_positions.size() == 0,
+                      UQ_UNAVAILABLE_RANK,
+                      "Generic1DQuadrature::constructor()",
+                      "invalid positions");
+
+  UQ_FATAL_TEST_MACRO(m_positions.size() != m_weights.size(),
+                      UQ_UNAVAILABLE_RANK,
+                      "Generic1DQuadrature::constructor()",
+                      "inconsistent positions and weight");
+}
+
+Generic1DQuadrature::~Generic1DQuadrature()
+{
+}
+
+void
+Generic1DQuadrature::dumbRoutine() const
+{
+  return;
+}
+
+//*****************************************************
+// UniformLegendre 1D quadrature class
+//*****************************************************
+UniformLegendre1DQuadrature::UniformLegendre1DQuadrature(
+  double       minDomainValue,
+  double       maxDomainValue,
+  unsigned int order,
+  bool         densityIsNormalized)
+  :
+  Base1DQuadrature(minDomainValue,maxDomainValue,order)
+{
+  m_positions.resize(m_order+1,0.); // Yes, '+1'
+  m_weights.resize  (m_order+1,0.); // Yes, '+1'
+
+  // http://www.holoborodko.com/pavel/?page_id=679
+  switch (m_order) { // eep2011
+    case 1:
+      m_weights  [0] =  1.;
+      m_weights  [1] =  1.;
+
+      m_positions[0] = -1./sqrt(3.);
+      m_positions[1] =  1./sqrt(3.);
+    break;
+
+    case 2:
+      m_weights  [0] =  5./9.;
+      m_weights  [1] =  8./9.;
+      m_weights  [2] =  5./9.;
+
+      m_positions[0] = -sqrt(.6);
+      m_positions[1] =  0.;
+      m_positions[2] =  sqrt(.6);
+    break;
+
+    case 3:
+      m_weights  [0] =  0.5 - sqrt(30.)/36.;
+      m_weights  [1] =  0.5 + sqrt(30.)/36.;
+      m_weights  [2] =  0.5 + sqrt(30.)/36.;
+      m_weights  [3] =  0.5 - sqrt(30.)/36.;
+
+      m_positions[0] = -sqrt(3.+2.*sqrt(1.2))/sqrt(7.);
+      m_positions[1] = -sqrt(3.-2.*sqrt(1.2))/sqrt(7.);
+      m_positions[2] =  sqrt(3.-2.*sqrt(1.2))/sqrt(7.);
+      m_positions[3] =  sqrt(3.+2.*sqrt(1.2))/sqrt(7.);
+    break;
+
+    case 4:
+      m_weights  [0] =  (322.-13.*sqrt(70.))/900.; // 0.236926885
+      m_weights  [1] =  (322.+13.*sqrt(70.))/900.; // 0.478628670
+      m_weights  [2] =  128./225.;                 // 0.568888889
+      m_weights  [3] =  (322.+13.*sqrt(70.))/900.;
+      m_weights  [4] =  (322.-13.*sqrt(70.))/900.;
+
+      m_positions[0] = -sqrt(5.+2.*sqrt(10./7.))/3.;
+      m_positions[1] = -sqrt(5.-2.*sqrt(10./7.))/3.;
+      m_positions[2] =  0.;
+      m_positions[3] =  sqrt(5.-2.*sqrt(10./7.))/3.;
+      m_positions[4] =  sqrt(5.+2.*sqrt(10./7.))/3.;
+    break;
+
+    case 5:
+      m_weights  [0] =  0.1713244923791703450402961;
+      m_weights  [1] =  0.3607615730481386075698335;
+      m_weights  [2] =  0.4679139345726910473898703;
+      m_weights  [3] =  0.4679139345726910473898703;
+      m_weights  [4] =  0.3607615730481386075698335;
+      m_weights  [5] =  0.1713244923791703450402961;
+
+      m_positions[0] = -0.9324695142031520278123016;
+      m_positions[1] = -0.6612093864662645136613996;
+      m_positions[2] = -0.2386191860831969086305017;
+      m_positions[3] =  0.2386191860831969086305017;
+      m_positions[4] =  0.6612093864662645136613996;
+      m_positions[5] =  0.9324695142031520278123016;
+    break;
+
+    case 6:
+      m_weights  [0] =  0.1294849661688696932706114;
+      m_weights  [1] =  0.2797053914892766679014678;
+      m_weights  [2] =  0.3818300505051189449503698;
+      m_weights  [3] =  0.4179591836734693877551020;
+      m_weights  [4] =  0.3818300505051189449503698;
+      m_weights  [5] =  0.2797053914892766679014678;
+      m_weights  [6] =  0.1294849661688696932706114;
+
+      m_positions[0] = -0.9491079123427585245261897;
+      m_positions[1] = -0.7415311855993944398638648;
+      m_positions[2] = -0.4058451513773971669066064;
+      m_positions[3] =  0.;
+      m_positions[4] =  0.4058451513773971669066064;
+      m_positions[5] =  0.7415311855993944398638648;
+      m_positions[6] =  0.9491079123427585245261897;
+    break;
+
+    case 7:
+      m_weights  [0] =  0.10122854;
+      m_weights  [1] =  0.22238103;
+      m_weights  [2] =  0.31370665;
+      m_weights  [3] =  0.36268378;
+      m_weights  [4] =  0.36268378;
+      m_weights  [5] =  0.31370665;
+      m_weights  [6] =  0.22238103;
+      m_weights  [7] =  0.10122854;
+
+      m_positions[0] = -0.96028986;
+      m_positions[1] = -0.79666648;
+      m_positions[2] = -0.52553241;
+      m_positions[3] = -0.18343464;
+      m_positions[4] =  0.18343464;
+      m_positions[5] =  0.52553241;
+      m_positions[6] =  0.79666648;
+      m_positions[7] =  0.96028986;
+    break;
+
+    case 10:
+      m_weights  [ 0] =  0.0556685671161736664827537;
+      m_weights  [ 1] =  0.1255803694649046246346943;
+      m_weights  [ 2] =  0.1862902109277342514260976;
+      m_weights  [ 3] =  0.2331937645919904799185237;
+      m_weights  [ 4] =  0.2628045445102466621806889;
+      m_weights  [ 5] =  0.2729250867779006307144835;
+      m_weights  [ 6] =  0.2628045445102466621806889;
+      m_weights  [ 7] =  0.2331937645919904799185237;
+      m_weights  [ 8] =  0.1862902109277342514260976;
+      m_weights  [ 9] =  0.1255803694649046246346943;
+      m_weights  [10] =  0.0556685671161736664827537;
+
+      m_positions[ 0] = -0.9782286581460569928039380;
+      m_positions[ 1] = -0.8870625997680952990751578;
+      m_positions[ 2] = -0.7301520055740493240934163;
+      m_positions[ 3] = -0.5190961292068118159257257;
+      m_positions[ 4] = -0.2695431559523449723315320;
+      m_positions[ 5] =  0.;
+      m_positions[ 6] =  0.2695431559523449723315320;
+      m_positions[ 7] =  0.5190961292068118159257257;
+      m_positions[ 8] =  0.7301520055740493240934163;
+      m_positions[ 9] =  0.8870625997680952990751578;
+      m_positions[10] =  0.9782286581460569928039380;
+    break;
+
+    case 11:
+      m_weights  [ 0] =  0.0471753363865118271946160;
+      m_weights  [ 1] =  0.1069393259953184309602547;
+      m_weights  [ 2] =  0.1600783285433462263346525;
+      m_weights  [ 3] =  0.2031674267230659217490645;
+      m_weights  [ 4] =  0.2334925365383548087608499;
+      m_weights  [ 5] =  0.2491470458134027850005624;
+      m_weights  [ 6] =  0.2491470458134027850005624;
+      m_weights  [ 7] =  0.2334925365383548087608499;
+      m_weights  [ 8] =  0.2031674267230659217490645;
+      m_weights  [ 9] =  0.1600783285433462263346525;
+      m_weights  [10] =  0.1069393259953184309602547;
+      m_weights  [11] =  0.0471753363865118271946160;
+
+      m_positions[ 0] = -0.9815606342467192506905491;
+      m_positions[ 1] = -0.9041172563704748566784659;
+      m_positions[ 2] = -0.7699026741943046870368938;
+      m_positions[ 3] = -0.5873179542866174472967024;
+      m_positions[ 4] = -0.3678314989981801937526915;
+      m_positions[ 5] = -0.1252334085114689154724414;
+      m_positions[ 6] =  0.1252334085114689154724414;
+      m_positions[ 7] =  0.3678314989981801937526915;
+      m_positions[ 8] =  0.5873179542866174472967024;
+      m_positions[ 9] =  0.7699026741943046870368938;
+      m_positions[10] =  0.9041172563704748566784659;
+      m_positions[11] =  0.9815606342467192506905491;
+    break;
+
+    case 12:
+      m_weights  [ 0] =  0.0404840047653158795200216;
+      m_weights  [ 1] =  0.0921214998377284479144218;
+      m_weights  [ 2] =  0.1388735102197872384636018;
+      m_weights  [ 3] =  0.1781459807619457382800467;
+      m_weights  [ 4] =  0.2078160475368885023125232;
+      m_weights  [ 5] =  0.2262831802628972384120902;
+      m_weights  [ 6] =  0.2325515532308739101945895;
+      m_weights  [ 7] =  0.2262831802628972384120902;
+      m_weights  [ 8] =  0.2078160475368885023125232;
+      m_weights  [ 9] =  0.1781459807619457382800467;
+      m_weights  [10] =  0.1388735102197872384636018;
+      m_weights  [11] =  0.0921214998377284479144218;
+      m_weights  [12] =  0.0404840047653158795200216;
+
+      m_positions[ 0] = -0.9841830547185881494728294;
+      m_positions[ 1] = -0.9175983992229779652065478;
+      m_positions[ 2] = -0.8015780907333099127942065;
+      m_positions[ 3] = -0.6423493394403402206439846;
+      m_positions[ 4] = -0.4484927510364468528779129;
+      m_positions[ 5] = -0.2304583159551347940655281;
+      m_positions[ 6] =  0.;
+      m_positions[ 7] =  0.2304583159551347940655281;
+      m_positions[ 8] =  0.4484927510364468528779129;
+      m_positions[ 9] =  0.6423493394403402206439846;
+      m_positions[10] =  0.8015780907333099127942065;
+      m_positions[11] =  0.9175983992229779652065478;
+      m_positions[12] =  0.9841830547185881494728294;
+    break;
+#if 0
+    case 13:
+      m_weights  [ 0] =  ;
+      m_weights  [ 1] =  ;
+      m_weights  [ 2] =  ;
+      m_weights  [ 3] =  ;
+      m_weights  [ 4] =  ;
+      m_weights  [ 5] =  ;
+      m_weights  [ 6] =  ;
+      m_weights  [ 7] =  ;
+      m_weights  [ 8] =  ;
+      m_weights  [ 9] =  ;
+      m_weights  [10] =  ;
+      m_weights  [11] =  ;
+      m_weights  [12] =  ;
+      m_weights  [13] =  ;
+
+      m_positions[ 0] = -;
+      m_positions[ 1] = -;
+      m_positions[ 2] = -;
+      m_positions[ 3] = -;
+      m_positions[ 4] = -;
+      m_positions[ 5] = -;
+      m_positions[ 6] = -;
+      m_positions[ 7] =  ;
+      m_positions[ 8] =  ;
+      m_positions[ 9] =  ;
+      m_positions[10] =  ;
+      m_positions[11] =  ;
+      m_positions[12] =  ;
+      m_positions[13] =  ;
+    break;
+#endif
+/*
+    14 ±0.1080549487073436620662447 0.2152638534631577901958764
+    ±0.3191123689278897604356718 0.2051984637212956039659241
+    ±0.5152486363581540919652907 0.1855383974779378137417166
+    ±0.6872929048116854701480198 0.1572031671581935345696019
+    ±0.8272013150697649931897947 0.1215185706879031846894148
+    ±0.9284348836635735173363911 0.0801580871597602098056333
+    ±0.9862838086968123388415973 0.0351194603317518630318329
+*/
+
+    case 16:
+      m_weights  [ 0] =  0.0241483028685479319601100;
+      m_weights  [ 1] =  0.0554595293739872011294402;
+      m_weights  [ 2] =  0.0850361483171791808835354;
+      m_weights  [ 3] =  0.1118838471934039710947884;
+      m_weights  [ 4] =  0.1351363684685254732863200;
+      m_weights  [ 5] =  0.1540457610768102880814316;
+      m_weights  [ 6] =  0.1680041021564500445099707;
+      m_weights  [ 7] =  0.1765627053669926463252710;
+      m_weights  [ 8] =  0.1794464703562065254582656;
+      m_weights  [ 9] =  0.1765627053669926463252710;
+      m_weights  [10] =  0.1680041021564500445099707;
+      m_weights  [11] =  0.1540457610768102880814316;
+      m_weights  [12] =  0.1351363684685254732863200;
+      m_weights  [13] =  0.1118838471934039710947884;
+      m_weights  [14] =  0.0850361483171791808835354;
+      m_weights  [15] =  0.0554595293739872011294402;
+      m_weights  [16] =  0.0241483028685479319601100;
+
+      m_positions[ 0] = -0.9905754753144173356754340;
+      m_positions[ 1] = -0.9506755217687677612227170;
+      m_positions[ 2] = -0.8802391537269859021229557;
+      m_positions[ 3] = -0.7815140038968014069252301;
+      m_positions[ 4] = -0.6576711592166907658503022;
+      m_positions[ 5] = -0.5126905370864769678862466;
+      m_positions[ 6] = -0.3512317634538763152971855;
+      m_positions[ 7] = -0.1784841814958478558506775;
+      m_positions[ 8] =  0.;
+      m_positions[ 9] =  0.1784841814958478558506775;
+      m_positions[10] =  0.3512317634538763152971855;
+      m_positions[11] =  0.5126905370864769678862466;
+      m_positions[12] =  0.6576711592166907658503022;
+      m_positions[13] =  0.7815140038968014069252301;
+      m_positions[14] =  0.8802391537269859021229557;
+      m_positions[15] =  0.9506755217687677612227170;
+      m_positions[16] =  0.9905754753144173356754340;
+    break;
+
+    default:
+      std::cerr << "In UniformLegendre1DQuadrature::constructor()"
+                << ": m_order = " << m_order
+                << std::endl;
+      UQ_FATAL_TEST_MACRO(true,
+                          UQ_UNAVAILABLE_RANK,
+                          "UniformLegendre1DQuadrature::constructor()",
+                          "order not supported");
+    break;
+  }
+
+  // Scale positions from the interval [-1, 1] to the interval [min,max]
+  for (unsigned int j = 0; j < m_positions.size(); ++j) {
+    m_positions[j] = .5*(m_maxDomainValue - m_minDomainValue)*m_positions[j] + .5*(m_maxDomainValue + m_minDomainValue);
+    if (densityIsNormalized) {
+      // Since \rho is "1/\Delta", we just multiply by ".5"
+      m_weights[j] *= .5;
+    }
+    else {
+      // Since \rho is "1", we multiply by ".5 * \Delta"
+      m_weights[j] *= .5*(m_maxDomainValue - m_minDomainValue);
+    }
+  }
+}
+
+UniformLegendre1DQuadrature::~UniformLegendre1DQuadrature()
+{
+}
+
+void
+UniformLegendre1DQuadrature::dumbRoutine() const
+{
+  return;
+}
+
+//*****************************************************
+// GaussianHermite 1D quadrature class
+//*****************************************************
+GaussianHermite1DQuadrature::GaussianHermite1DQuadrature(
+  double mean,
+  double stddev,
+  unsigned int order)
+  :
+  Base1DQuadrature(-INFINITY,INFINITY,order),
+  m_mean  (mean),
+  m_stddev(stddev)
+{
+  // FIX ME: prepare code for mean != 0 and stddev != 1
+  m_positions.resize(m_order+1,0.); // Yes, '+1'
+  m_weights.resize  (m_order+1,0.); // Yes, '+1'
+
+  // http://www.efunda.com/math/num_integration/findgausshermite.cfm
+  switch (m_order) { // eep2011
+    case 1:
+      m_weights  [0] =  sqrt(M_PI)/2.;
+      m_weights  [1] =  sqrt(M_PI)/2.;
+
+      m_positions[0] = -1./sqrt(2.);
+      m_positions[1] =  1./sqrt(2.);
+    break;
+
+    case 2:
+      m_weights  [0] =  sqrt(M_PI)/6.;
+      m_weights  [1] =  2.*sqrt(M_PI)/3.;
+      m_weights  [2] =  sqrt(M_PI)/6.;
+
+      m_positions[0] = -sqrt(1.5);
+      m_positions[1] =  0.;
+      m_positions[2] =  sqrt(1.5);
+    break;
+
+    case 3:
+      m_weights  [0] =  sqrt(M_PI)/4./(3.-sqrt(6.));
+      m_weights  [1] =  sqrt(M_PI)/4./(3.+sqrt(6.));
+      m_weights  [2] =  sqrt(M_PI)/4./(3.+sqrt(6.));
+      m_weights  [3] =  sqrt(M_PI)/4./(3.-sqrt(6.));
+
+      m_positions[0] = -sqrt(1.5+sqrt(1.5));
+      m_positions[1] = -sqrt(1.5-sqrt(1.5));
+      m_positions[2] =  sqrt(1.5-sqrt(1.5));
+      m_positions[3] =  sqrt(1.5+sqrt(1.5));
+    break;
+
+    case 4:
+      m_weights  [0] =  0.019953242049;
+      m_weights  [1] =  0.393619323152;
+      m_weights  [2] =  0.945308720483;
+      m_weights  [3] =  0.393619323152;
+      m_weights  [4] =  0.019953242059;
+
+      m_positions[0] = -sqrt(2.5+sqrt(2.5));
+      m_positions[1] = -sqrt(2.5-sqrt(2.5));
+      m_positions[2] =  0.;
+      m_positions[3] =  sqrt(2.5-sqrt(2.5));
+      m_positions[4] =  sqrt(2.5+sqrt(2.5));
+    break;
+
+    case 5:
+      m_weights   [0] = 0.00453000990551;
+      m_weights   [1] = 0.157067320323;
+      m_weights   [2] = 0.724629595224;
+      m_weights   [3] = 0.724629595224;
+      m_weights   [4] = 0.157067320323;
+      m_weights   [5] = 0.00453000990551;
+
+      m_positions [0] = -2.35060497367;
+      m_positions [1] = -1.33584907401;
+      m_positions [2] = -0.436077411928;
+      m_positions [3] =  0.436077411928;
+      m_positions [4] =  1.33584907401;
+      m_positions [5] =  2.35060497367;
+    break;
+
+    case 6:
+      m_weights   [0] = 0.0009717812451;
+      m_weights   [1] = 0.0545155828191;
+      m_weights   [2] = 0.42560725261;
+      m_weights   [3] = 0.810264617557;
+      m_weights   [4] = 0.42560725261;
+      m_weights   [5] = 0.0545155828191;
+      m_weights   [6] = 0.0009717812451;
+
+      m_positions [0] = -2.65196135684;
+      m_positions [1] = -1.67355162877;
+      m_positions [2] = -0.816287882859;
+      m_positions [3] =  0.;
+      m_positions [4] =  0.816287882859;
+      m_positions [5] =  1.67355162877;
+      m_positions [6] =  2.65196135684;
+    break;
+
+    case 7:
+      m_weights   [0] = 0.000199604072211;
+      m_weights   [1] = 0.0170779830074;
+      m_weights   [2] = 0.207802325815;
+      m_weights   [3] = 0.661147012558;
+      m_weights   [4] = 0.661147012558;
+      m_weights   [5] = 0.207802325815;
+      m_weights   [6] = 0.0170779830074;
+      m_weights   [7] = 0.000199604072211;
+
+      m_positions [0] = -2.93063742026;
+      m_positions [1] = -1.9816567567;
+      m_positions [2] = -1.15719371245;
+      m_positions [3] = -0.381186990207;
+      m_positions [4] =  0.381186990207;
+      m_positions [5] =  1.15719371245;
+      m_positions [6] =  1.9816567567;
+      m_positions [7] =  2.93063742026;
+    break;
+
+    case 8:
+      m_weights   [0] = 3.96069772633e-5;
+      m_weights   [1] = 0.00494362427554;
+      m_weights   [2] = 0.0884745273944;
+      m_weights   [3] = 0.432651559003;
+      m_weights   [4] = 0.720235215606;
+      m_weights   [5] = 0.432651559003;
+      m_weights   [6] = 0.0884745273944;
+      m_weights   [7] = 0.00494362427554;
+      m_weights   [8] = 3.96069772633e-5;
+
+      m_positions [0] = -3.19099320178;
+      m_positions [1] = -2.26658058453;
+      m_positions [2] = -1.46855328922;
+      m_positions [3] = -0.723551018753;
+      m_positions [4] =  0.;
+      m_positions [5] =  0.723551018753;
+      m_positions [6] =  1.46855328922;
+      m_positions [7] =  2.26658058453;
+      m_positions [8] =  3.19099320178;
+    break;
+
+    case 9:
+      m_weights   [0] = 7.64043285523e-6;
+      m_weights   [1] = 0.00134364574678;
+      m_weights   [2] = 0.0338743944555;
+      m_weights   [3] = 0.240138611082;
+      m_weights   [4] = 0.610862633735;
+      m_weights   [5] = 0.610862633735;
+      m_weights   [6] = 0.240138611082;
+      m_weights   [7] = 0.0338743944555;
+      m_weights   [8] = 0.00134364574678;
+      m_weights   [9] = 7.64043285523e-6;
+
+      m_positions [0] = -3.43615911884;
+      m_positions [1] = -2.53273167423;
+      m_positions [2] = -1.7566836493;
+      m_positions [3] = -1.03661082979;
+      m_positions [4] = -0.342901327224;
+      m_positions [5] =  0.342901327224;
+      m_positions [6] =  1.03661082979;
+      m_positions [7] =  1.7566836493;
+      m_positions [8] =  2.53273167423;
+      m_positions [9] =  3.43615911884;
+    break;
+
+    case 19:
+      m_weights   [0] =  2.22939364554e-13;
+      m_weights   [1] =  4.39934099226e-10;
+      m_weights   [2] =  1.08606937077e-7;
+      m_weights   [3] =  7.8025564785e-6;
+      m_weights   [4] =  0.000228338636017;
+      m_weights   [5] =  0.00324377334224;
+      m_weights   [6] =  0.0248105208875;
+      m_weights   [7] =  0.10901720602;
+      m_weights   [8] =  0.286675505363;
+      m_weights   [9] =  0.462243669601;
+      m_weights  [10] =  0.462243669601;
+      m_weights  [11] =  0.286675505363;
+      m_weights  [12] =  0.10901720602;
+      m_weights  [13] =  0.0248105208875;
+      m_weights  [14] =  0.00324377334224;
+      m_weights  [15] =  0.000228338636017;
+      m_weights  [16] =  7.8025564785e-6;
+      m_weights  [17] =  1.08606937077e-7;
+      m_weights  [18] =  4.39934099226e-10;
+      m_weights  [19] =  2.22939364554e-13;
+
+      m_positions [0] = -5.38748089001;
+      m_positions [1] = -4.60368244955;
+      m_positions [2] = -3.94476404012;
+      m_positions [3] = -3.34785456738;
+      m_positions [4] = -2.78880605843;
+      m_positions [5] = -2.25497400209;
+      m_positions [6] = -1.73853771212;
+      m_positions [7] = -1.2340762154;
+      m_positions [8] = -0.737473728545;
+      m_positions [9] = -0.245340708301;
+      m_positions[10] =  0.245340708301;
+      m_positions[11] =  0.737473728545;
+      m_positions[12] =  1.2340762154;
+      m_positions[13] =  1.73853771212;
+      m_positions[14] =  2.25497400209;
+      m_positions[15] =  2.78880605843;
+      m_positions[16] =  3.34785456738;
+      m_positions[17] =  3.94476404012;
+      m_positions[18] =  4.60368244955;
+      m_positions[19] =  5.38748089001;
+    break;
+
+    default:
+      std::cerr << "In GaussianHermite1DQuadrature::constructor()"
+                << ": m_order = " << m_order
+                << std::endl;
+      UQ_FATAL_TEST_MACRO(true,
+                          UQ_UNAVAILABLE_RANK,
+                          "GaussianHermite1DQuadrature::constructor()",
+                          "order not supported");
+    break;
+  }
+  for (unsigned int j = 0; j < (m_order+1); ++j) {
+    m_weights  [j] *= sqrt(2.);
+    m_positions[j] *= sqrt(2.);
+  }
+}
+
+GaussianHermite1DQuadrature::~GaussianHermite1DQuadrature()
+{
+}
+
+void
+GaussianHermite1DQuadrature::dumbRoutine() const
+{
+  return;
+}
+
+//*****************************************************
+// WignerInverseChebyshev1st 1D quadrature class
+//*****************************************************
+WignerInverseChebyshev1st1DQuadrature::WignerInverseChebyshev1st1DQuadrature(
+  double       minDomainValue,
+  double       maxDomainValue,
+  unsigned int order)
+  :
+  Base1DQuadrature(minDomainValue,maxDomainValue,order)
+{
+  m_positions.resize(m_order+1,0.); // Yes, '+1'
+  m_weights.resize  (m_order+1,0.); // Yes, '+1'
+
+  // http://en.wikipedia.org/wiki/Chebyshev-Gauss_quadrature
+  switch (m_order) {
+    default:
+      UQ_FATAL_TEST_MACRO(true,
+                          UQ_UNAVAILABLE_RANK,
+                          "WignerInverseChebyshev1st1DQuadrature::constructor()",
+                          "order not supported");
+    break;
+  }
+
+  // Scale positions from the interval [-1, 1] to the interval [min,max]
+  for (unsigned int j = 0; j < m_positions.size(); ++j) {
+    m_positions[j] = .5*(m_maxDomainValue - m_minDomainValue)*m_positions[j] + .5*(m_maxDomainValue + m_minDomainValue);
+    m_weights[j] *= .5*(m_maxDomainValue - m_minDomainValue);
+  }
+}
+
+WignerInverseChebyshev1st1DQuadrature::~WignerInverseChebyshev1st1DQuadrature()
+{
+}
+
+void
+WignerInverseChebyshev1st1DQuadrature::dumbRoutine() const
+{
+  return;
+}
+
+//*****************************************************
+// WignerChebyshev2nd 1D quadrature class
+//*****************************************************
+WignerChebyshev2nd1DQuadrature::WignerChebyshev2nd1DQuadrature(
+  double       minDomainValue,
+  double       maxDomainValue,
+  unsigned int order)
+  :
+  Base1DQuadrature(minDomainValue,maxDomainValue,order)
+{
+  m_positions.resize(m_order+1,0.); // Yes, '+1'
+  m_weights.resize  (m_order+1,0.); // Yes, '+1'
+
+  // http://en.wikipedia.org/wiki/Chebyshev-Gauss_quadrature
+  unsigned int n = m_order+1;
+  for (unsigned int i = 0; i < n; ++i) {
+    double angle = M_PI*((double)(i+1))/((double)(n+1));
+    double cosValue = cos(angle);
+    double sinValue = sin(angle);
+    m_positions[i] = cosValue;
+    m_weights[i] = ( M_PI/((double)(n+1)) )*sinValue*sinValue;
+  }
+
+  // Scale positions from the interval [-1, 1] to the interval [min,max]
+  for (unsigned int j = 0; j < m_positions.size(); ++j) {
+    m_positions[j] = .5*(m_maxDomainValue - m_minDomainValue)*m_positions[j] + .5*(m_maxDomainValue + m_minDomainValue);
+    m_weights[j] *= .5*(m_maxDomainValue - m_minDomainValue);
+  }
+}
+
+WignerChebyshev2nd1DQuadrature::~WignerChebyshev2nd1DQuadrature()
+{
+}
+
+void
+WignerChebyshev2nd1DQuadrature::dumbRoutine() const
+{
+  return;
+}
+
+}  // End namespace QUESO
Index: /issm/trunk/externalpackages/dakota/install-6.2-discover.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-discover.sh	(revision 26744)
+++ /issm/trunk/externalpackages/dakota/install-6.2-discover.sh	(revision 26744)
@@ -0,0 +1,63 @@
+#!/bin/bash
+set -eu
+
+#Some cleanup
+rm -rf Dakota
+rm -rf src 
+rm -rf build 
+rm -rf install 
+mkdir src build install 
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
+
+#Untar 
+tar -zxvf dakota-6.2-public-src.tar.gz
+
+#Move Dakota to src directory
+mv dakota-6.2.0.src/* src
+rm -rf dakota-6.2.0.src
+
+#Set up Dakota cmake variables and config
+export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
+export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
+export MPIHOME=$ISSM_DIR/externalpackages/mpich/install
+cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
+patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.discover.patch
+patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
+patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.discover20.patch
+
+#Apply patches
+patch src/src/NonDSampling.cpp configs/6.2/NonDSampling.cpp.patch
+patch src/src/NonDLocalReliability.cpp configs/6.2/NonDLocalReliability.cpp.patch
+patch src/packages/pecos/src/pecos_global_defs.hpp configs/6.2/pecos_global_defs.hpp.patch
+
+#Configure dakota
+cd $DAK_BUILD
+
+cmake -D CMAKE_C_COMPILER=mpicc \
+	   -D CMAKE_CXX_COMPILER=mpicxx \
+	   -D CMAKE_Fortran_COMPILER=/usr/bin/gfortran \
+		-DBUILD_SHARED_LIBS=ON \
+		-DBUILD_STATIC_LIBS=OFF \
+		-DBoost_NO_BOOST_CMAKE=TRUE \
+		-DHAVE_ACRO=OFF \
+		-DHAVE_JEGA=OFF \
+		-DHAVE_QUESO=ON \
+		-DDAKOTA_HAVE_GSL=ON \
+		-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
+		-C $DAK_SRC/cmake/DakotaDev.cmake \
+		$DAK_SRC
+cd ..
+
+#Compile and install dakota
+cd $DAK_BUILD
+if [ $# -eq 0 ];
+then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+cd ..
Index: sm/trunk/externalpackages/dakota/install-6.2-intel15-discover.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-intel15-discover.sh	(revision 26743)
+++ 	(revision )
@@ -1,58 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf build 
-rm -rf install 
-mkdir src build install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
-
-#Untar 
-tar -zxvf dakota-6.2-public-src.tar.gz
-
-#Move Dakota to src directory
-mv dakota-6.2.0.src/* src
-rm -rf dakota-6.2.0.src
-
-#Set up Dakota cmake variables and config
-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
-export MPIHOME=$ISSM_DIR/externalpackages/mpich/install
-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.discover.patch
-patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
-patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.discover.patch
-
-#Apply patches
-patch src/src/NonDSampling.cpp configs/6.2/NonDSampling.cpp.patch
-patch src/src/NonDLocalReliability.cpp configs/6.2/NonDLocalReliability.cpp.patch
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/6.2/pecos_global_defs.hpp.patch
-
-#Configure dakota
-cd $DAK_BUILD
-
-cmake -D CMAKE_C_COMPILER=mpicc \
-	   -D CMAKE_CXX_COMPILER=mpicxx \
-	   -D CMAKE_Fortran_COMPILER=/usr/bin/gfortran \
-		-DHAVE_ACRO=off \
-		-DHAVE_JEGA=off \
-		-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
-		-C $DAK_SRC/cmake/DakotaDev.cmake \
-		$DAK_SRC
-cd ..
-
-#Compile and install dakota
-cd $DAK_BUILD
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: sm/trunk/externalpackages/dakota/install-6.2-intel16-discover.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-intel16-discover.sh	(revision 26743)
+++ 	(revision )
@@ -1,58 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf build 
-rm -rf install 
-mkdir src build install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
-
-#Untar 
-tar -zxvf dakota-6.2-public-src.tar.gz
-
-#Move Dakota to src directory
-mv dakota-6.2.0.src/* src
-rm -rf dakota-6.2.0.src
-
-#Set up Dakota cmake variables and config
-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
-export MPIHOME=$ISSM_DIR/externalpackages/mpich/install
-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.discover.patch
-patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
-patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.discover16.patch
-
-#Apply patches
-patch src/src/NonDSampling.cpp configs/6.2/NonDSampling.cpp.patch
-patch src/src/NonDLocalReliability.cpp configs/6.2/NonDLocalReliability.cpp.patch
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/6.2/pecos_global_defs.hpp.patch
-
-#Configure dakota
-cd $DAK_BUILD
-
-cmake -D CMAKE_C_COMPILER=mpicc \
-	   -D CMAKE_CXX_COMPILER=mpicxx \
-	   -D CMAKE_Fortran_COMPILER=/usr/bin/gfortran \
-		-DHAVE_ACRO=off \
-		-DHAVE_JEGA=off \
-		-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
-		-C $DAK_SRC/cmake/DakotaDev.cmake \
-		$DAK_SRC
-cd ..
-
-#Compile and install dakota
-cd $DAK_BUILD
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: sm/trunk/externalpackages/dakota/install-6.2-intel20-discover.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-intel20-discover.sh	(revision 26743)
+++ 	(revision )
@@ -1,58 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf Dakota
-rm -rf src 
-rm -rf build 
-rm -rf install 
-mkdir src build install 
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
-
-#Untar 
-tar -zxvf dakota-6.2-public-src.tar.gz
-
-#Move Dakota to src directory
-mv dakota-6.2.0.src/* src
-rm -rf dakota-6.2.0.src
-
-#Set up Dakota cmake variables and config
-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
-export MPIHOME=$ISSM_DIR/externalpackages/mpich/install
-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.discover.patch
-patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
-patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.discover20.patch
-
-#Apply patches
-patch src/src/NonDSampling.cpp configs/6.2/NonDSampling.cpp.patch
-patch src/src/NonDLocalReliability.cpp configs/6.2/NonDLocalReliability.cpp.patch
-patch src/packages/pecos/src/pecos_global_defs.hpp configs/6.2/pecos_global_defs.hpp.patch
-
-#Configure dakota
-cd $DAK_BUILD
-
-cmake -D CMAKE_C_COMPILER=mpicc \
-	   -D CMAKE_CXX_COMPILER=mpicxx \
-	   -D CMAKE_Fortran_COMPILER=/usr/bin/gfortran \
-		-DHAVE_ACRO=off \
-		-DHAVE_JEGA=off \
-		-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
-		-C $DAK_SRC/cmake/DakotaDev.cmake \
-		$DAK_SRC
-cd ..
-
-#Compile and install dakota
-cd $DAK_BUILD
-if [ $# -eq 0 ];
-then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
-cd ..
Index: /issm/trunk/externalpackages/dakota/install-6.2-linux-static.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-linux-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/dakota/install-6.2-linux-static.sh	(revision 26744)
@@ -3,23 +3,22 @@
 
 
-# Constants
+## Constants
 #
-DAK_ROOT=${ISSM_DIR}/externalpackages/dakota
 VER="6.2"
+
+PREFIX="${ISSM_DIR}/externalpackages/dakota/install" # Set to location where external package should be installed
 
 ## Environment
 #
-export BLAS_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lfblas -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
-export BOOST_ROOT=${ISSM_DIR}/externalpackages/boost/install
+export BLAS_LIBS="-L${BLAS_ROOT}/lib -lfblas -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
 export CXXFLAGS='-std=c++98' # Setting CXXFLAGS to deal with C++11 incompatibility with MATLAB's Boost (absolutely necessary for this version)
-export DAK_BUILD=${DAK_ROOT}/build
-export DAK_INSTALL=${DAK_ROOT}/install
-export DAK_SRC=${DAK_ROOT}/src
-export GSL_HOME=${ISSM_DIR}/externalpackages/gsl/install
-export LAPACK_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lflapack -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+export DAK_BUILD=${ISSM_DIR}/externalpackages/dakota/build # DO NOT CHANGE THIS
+export DAK_INSTALL=${PREFIX} # DO NOT CHANGE THIS
+export DAK_SRC=${ISSM_DIR}/externalpackages/dakota/src # DO NOT CHANGE THIS
+export LAPACK_LIBS="-L${LAPACK_ROOT}/lib -lflapack -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
 
 # Cleanup
-rm -rf build install src
-mkdir build install src
+rm -rf ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
+mkdir -p ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
 
 # Download source
@@ -30,10 +29,12 @@
 
 # Move source to 'src' directory
-mv dakota-${VER}.0.src/* src
+mv dakota-${VER}.0.src/* ${DAK_SRC}
 rm -rf dakota-${VER}.0.src
 
 # Copy customized source and configuration files to 'src' directory
 cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
+cp configs/${VER}/packages/queso/src/misc/src/1DQuadrature.C ${DAK_SRC}/packages/queso/src/misc/src
 cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
+cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
 cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
 cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
@@ -50,9 +51,8 @@
 	-DBUILD_STATIC_LIBS=ON \
 	-DCMAKE_C_COMPILER=${MPI_HOME}/bin/mpicc \
+	-DCMAKE_C_FLAGS="-fPIC -Wno-error=implicit-function-declaration" \
 	-DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
+	-DCMAKE_CXX_FLAGS="-fPIC" \
 	-DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
-	-DCMAKE_C_FLAGS="-fPIC" \
-	-DCMAKE_CXX_FLAGS="-fPIC" \
-	-DCMAKE_Fortran_FLAGS="-fPIC" \
 	-DBoost_NO_BOOST_CMAKE=TRUE \
 	-DHAVE_ACRO=OFF \
Index: /issm/trunk/externalpackages/dakota/install-6.2-linux.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-linux.sh	(revision 26743)
+++ /issm/trunk/externalpackages/dakota/install-6.2-linux.sh	(revision 26744)
@@ -3,24 +3,23 @@
 
 
-# Constants
+## Constants
 #
-DAK_ROOT=${ISSM_DIR}/externalpackages/dakota
 VER="6.2"
+
+PREFIX="${ISSM_DIR}/externalpackages/dakota/install" # Set to location where external package should be installed
 
 ## Environment
 #
-export BLAS_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lfblas -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
-export BOOST_ROOT=${ISSM_DIR}/externalpackages/boost/install
+export BLAS_LIBS="-L${BLAS_ROOT}/lib -lfblas -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
 export CXXFLAGS='-std=c++98' # Setting CXXFLAGS to deal with C++11 incompatibility with MATLAB's Boost (absolutely necessary for this version)
 #export CXXFLAGS='-std=c++11'
-export DAK_BUILD=${DAK_ROOT}/build
-export DAK_INSTALL=${DAK_ROOT}/install
-export DAK_SRC=${DAK_ROOT}/src
-export GSL_HOME=${ISSM_DIR}/externalpackages/gsl/install
-export LAPACK_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lflapack -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+export DAK_BUILD=${ISSM_DIR}/externalpackages/dakota/build # DO NOT CHANGE THIS
+export DAK_INSTALL=${PREFIX} # DO NOT CHANGE THIS
+export DAK_SRC=${ISSM_DIR}/externalpackages/dakota/src # DO NOT CHANGE THIS
+export LAPACK_LIBS="-L${LAPACK_ROOT}/lib -lflapack -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
 
 # Cleanup
-rm -rf build install src
-mkdir build install src
+rm -rf ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
+mkdir -p ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
 
 # Download source
@@ -31,10 +30,12 @@
 
 # Move source to 'src' directory
-mv dakota-${VER}.0.src/* src
+mv dakota-${VER}.0.src/* ${DAK_SRC}
 rm -rf dakota-${VER}.0.src
 
 # Copy customized source and configuration files to 'src' directory
 cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
+cp configs/${VER}/packages/queso/src/misc/src/1DQuadrature.C ${DAK_SRC}/packages/queso/src/misc/src
 cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
+cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
 cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
 cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
@@ -51,4 +52,5 @@
 	-DBUILD_STATIC_LIBS=OFF \
 	-DCMAKE_C_COMPILER=${MPI_HOME}/bin/mpicc \
+	-DCMAKE_C_FLAGS="-Wno-error=implicit-function-declaration" \
 	-DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
 	-DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
Index: /issm/trunk/externalpackages/dakota/install-6.2-mac-static.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-mac-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/dakota/install-6.2-mac-static.sh	(revision 26744)
@@ -3,8 +3,9 @@
 
 
-# Constants
+## Constants
 #
-DAK_ROOT=${ISSM_DIR}/externalpackages/dakota
 VER="6.2"
+
+PREFIX="${ISSM_DIR}/externalpackages/dakota/install" # Set to location where external package should be installed
 
 ## Environment
@@ -17,6 +18,7 @@
 #
 # TODO:
-# - Test if -static-libgfortran flag will avoid all of this.
-# - Otherwise, refactor this to work with other gfortran installations.
+# - Move this to etc/environment.sh
+# - Test if -static-libgfortran flag will avoid all of this
+# - Otherwise, refactor this to work with other gfortran installations
 #
 LIBGFORTRAN=$(mdfind -onlyin /usr -name libgfortran | grep -n libgfortran.a | grep -v i386 | sed "s/[0-9]*://g" | head -1)
@@ -24,15 +26,13 @@
 LIBGCC=$(mdfind -onlyin ${LIBGFORTRAN_ROOT} -name libgcc | grep -n libgcc.a | grep -v i386 | sed "s/[0-9]*://g" | head -1)
 
-export BLAS_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lfblas ${LIBGFORTRAN_ROOT}/libgfortran.a ${LIBGFORTRAN_ROOT}/libquadmath.a ${LIBGCC}" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
-export BOOST_ROOT=${ISSM_DIR}/externalpackages/boost/install
-export DAK_BUILD=${DAK_ROOT}/build
-export DAK_INSTALL=${DAK_ROOT}/install
-export DAK_SRC=${DAK_ROOT}/src
-export GSL_HOME=${ISSM_DIR}/externalpackages/gsl/install
-export LAPACK_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lflapack ${LIBGFORTRAN_ROOT}/libgfortran.a ${LIBGFORTRAN_ROOT}/libquadmath.a ${LIBGCC}" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+export BLAS_LIBS="-L${BLAS_ROOT}/lib -lfblas ${LIBGFORTRAN_ROOT}/libgfortran.a ${LIBGFORTRAN_ROOT}/libquadmath.a ${LIBGCC}" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+export DAK_BUILD=${ISSM_DIR}/externalpackages/dakota/build # DO NOT CHANGE THIS
+export DAK_INSTALL=${PREFIX} # DO NOT CHANGE THIS
+export DAK_SRC=${ISSM_DIR}/externalpackages/dakota/src # DO NOT CHANGE THIS
+export LAPACK_LIBS="-L${LAPACK_ROOT}/lib -lflapack ${LIBGFORTRAN_ROOT}/libgfortran.a ${LIBGFORTRAN_ROOT}/libquadmath.a ${LIBGCC}" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
 
 # Cleanup
-rm -rf build install src
-mkdir build install src
+rm -rf ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
+mkdir -p ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
 
 # Download source
@@ -43,10 +43,12 @@
 
 # Move source to 'src' directory
-mv dakota-${VER}.0.src/* src
+mv dakota-${VER}.0.src/* ${DAK_SRC}
 rm -rf dakota-${VER}.0.src
 
 # Copy customized source and configuration files to 'src' directory
 cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
+cp configs/${VER}/packages/queso/src/misc/src/1DQuadrature.C ${DAK_SRC}/packages/queso/src/misc/src
 cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
+cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
 cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
 cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
@@ -57,5 +59,4 @@
 cp configs/${VER}/mac/cmake/DakotaDev.cmake ${DAK_SRC}/cmake
 cp configs/${VER}/mac/cmake/InstallDarwinDylibs.cmake ${DAK_SRC}/cmake
-cp configs/${VER}/mac/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
 
 # Uncomment to copy the following customized source files if using C99 or later 
@@ -77,9 +78,9 @@
 	-DBUILD_STATIC_LIBS=ON \
 	-DCMAKE_C_COMPILER=${MPI_HOME}/bin/mpicc \
+	-DCMAKE_C_FLAGS="-fPIC -Wno-error=implicit-function-declaration" \
 	-DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
+	-DCMAKE_CXX_FLAGS="-fPIC -fdelayed-template-parsing" \
 	-DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
-	-DCMAKE_C_FLAGS="-fPIC -Wno-error=implicit-function-declaration" \
-	-DCMAKE_CXX_FLAGS="-fPIC -fdelayed-template-parsing" \
-	-DCMAKE_Fortran_FLAGS="-fPIC" \
+	-DCMAKE_Fortran_FLAGS="-fPIC -fallow-argument-mismatch" \
 	-DBoost_NO_BOOST_CMAKE=TRUE \
 	-DHAVE_ACRO=OFF \
Index: /issm/trunk/externalpackages/dakota/install-6.2-mac.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-mac.sh	(revision 26743)
+++ /issm/trunk/externalpackages/dakota/install-6.2-mac.sh	(revision 26744)
@@ -3,8 +3,9 @@
 
 
-# Constants
+## Constants
 #
-DAK_ROOT=${ISSM_DIR}/externalpackages/dakota
 VER="6.2"
+
+PREFIX="${ISSM_DIR}/externalpackages/dakota/install" # Set to location where external package should be installed
 
 ## Environment
@@ -16,18 +17,19 @@
 # returning one that is installed via package manager.
 #
+# TODO:
+# - Move this to etc/environment.sh
+#
 LIBGFORTRAN=$(mdfind -onlyin /usr -name libgfortran | grep -n libgfortran.a | grep -v i386 | sed "s/[0-9]*://g" | head -1)
 LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
 
-export BLAS_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lfblas -L${LIBGFORTRAN_ROOT} -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
-export BOOST_ROOT=${ISSM_DIR}/externalpackages/boost/install
-export DAK_BUILD=${DAK_ROOT}/build
-export DAK_INSTALL=${DAK_ROOT}/install
-export DAK_SRC=${DAK_ROOT}/src
-export GSL_HOME=${ISSM_DIR}/externalpackages/gsl/install
-export LAPACK_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lflapack -L${LIBGFORTRAN_ROOT} -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+export BLAS_LIBS="-L${BLAS_ROOT}/lib -lfblas -L${LIBGFORTRAN_ROOT} -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+export DAK_BUILD=${ISSM_DIR}/externalpackages/dakota/build # DO NOT CHANGE THIS
+export DAK_INSTALL=${PREFIX} # DO NOT CHANGE THIS
+export DAK_SRC=${ISSM_DIR}/externalpackages/dakota/src # DO NOT CHANGE THIS
+export LAPACK_LIBS="-L${LAPACK_ROOT}/lib -lflapack -L${LIBGFORTRAN_ROOT} -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
 
 # Cleanup
-rm -rf build install src
-mkdir build install src
+rm -rf ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
+mkdir -p ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
 
 # Download source
@@ -38,10 +40,12 @@
 
 # Move source to 'src' directory
-mv dakota-${VER}.0.src/* src
+mv dakota-${VER}.0.src/* ${DAK_SRC}
 rm -rf dakota-${VER}.0.src
 
 # Copy customized source and configuration files to 'src' directory
 cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
+cp configs/${VER}/packages/queso/src/misc/src/1DQuadrature.C ${DAK_SRC}/packages/queso/src/misc/src
 cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
+cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
 cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
 cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
@@ -52,5 +56,4 @@
 cp configs/${VER}/mac/cmake/DakotaDev.cmake ${DAK_SRC}/cmake
 cp configs/${VER}/mac/cmake/InstallDarwinDylibs.cmake ${DAK_SRC}/cmake
-cp configs/${VER}/mac/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
 
 # Configure
@@ -61,6 +64,7 @@
 	-DCMAKE_C_COMPILER=${MPI_HOME}/bin/mpicc \
 	-DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
+	-DCMAKE_CXX_FLAGS="-fdelayed-template-parsing" \
 	-DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
-	-DCMAKE_CXX_FLAGS="-fdelayed-template-parsing" \
+	-DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch" \
 	-DBoost_NO_BOOST_CMAKE=TRUE \
 	-DHAVE_ACRO=OFF \
Index: /issm/trunk/externalpackages/dakota/install-6.2-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-pleiades.sh	(revision 26743)
+++ /issm/trunk/externalpackages/dakota/install-6.2-pleiades.sh	(revision 26744)
@@ -22,7 +22,6 @@
 export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
 export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
-export MPIHOME=$ISSM_DIR/externalpackages/mpich/install
 cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.patch
+patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.pfe.patch
 patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
 patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.pfe.patch
@@ -36,12 +35,19 @@
 cd $DAK_BUILD
 
-cmake -D CMAKE_C_COMPILER=mpicc \
-	   -D CMAKE_CXX_COMPILER=mpicxx \
-	   -D CMAKE_Fortran_COMPILER=/usr/bin/gfortran \
-		-DHAVE_ACRO=off \
-		-DHAVE_JEGA=off \
-		-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
-		-C $DAK_SRC/cmake/DakotaDev.cmake \
-		$DAK_SRC
+cmake \
+	-DBUILD_SHARED_LIBS=ON \
+	-DBUILD_STATIC_LIBS=OFF \
+	-DCMAKE_C_COMPILER=mpicc \
+	-DCMAKE_CXX_COMPILER=mpicxx \
+	-DCMAKE_Fortran_COMPILER=mpif77 \
+	-DBoost_NO_BOOST_CMAKE=TRUE \
+	-DHAVE_ACRO=OFF \
+	-DHAVE_JEGA=OFF \
+	-DHAVE_QUESO=ON \
+	-DDAKOTA_HAVE_GSL=ON \
+	-C${DAK_SRC}/cmake/BuildDakotaCustom.cmake \
+	-C${DAK_SRC}/cmake/DakotaDev.cmake \
+	${DAK_SRC}
+
 cd ..
 
Index: /issm/trunk/externalpackages/emscripten/install.sh
===================================================================
--- /issm/trunk/externalpackages/emscripten/install.sh	(revision 26743)
+++ /issm/trunk/externalpackages/emscripten/install.sh	(revision 26744)
@@ -5,32 +5,37 @@
 # TODO:
 # - Introduce build step to $ISSM_DIR/jenkins/jenkins.sh to compile Fortran code in $ISSM_DIR/src/c/modules/GiaDefelectionCorex/ to C with f2c
-#	- Then, revert $ISSM_DIR/externalpackages/emscripten/install.sh to r24306 and test clean build
-#	- When builtin support for Fortran is available, remove build step
+#       - Then, revert $ISSM_DIR/externalpackages/emscripten/install.sh to r24306 and test clean build
+#       - When builtin support for Fortran is available, remove build step
 #
 
+## Constants
+#
 VER="latest" # Set this to "latest", or last tag that works in case of failure
 
-# Get Emscripten SDK (emsdk) driver if we have not previously installed
-# Emscripten. Otherwise, just get the latest version.
-if [[ ! -d ./install ]]; then
-	# Get the emsdk repo
-	git clone https://github.com/emscripten-core/emsdk.git
+## Environment
+#
+PREFIX="${ISSM_DIR}/externalpackages/emscripten/install"
 
-	# Move source to 'install' directory
-	mv ./emsdk ./install
+# Cleanup
+rm -rf ${PREFIX}
 
-	cd ./install
-else
-	# Fetch the latest version of the emsdk
-	cd ./install
-	git pull
-fi
+# Get the emsdk repo
+git clone https://github.com/emscripten-core/emsdk.git
+
+# Create $PREFIX directory
+mkdir -p ${PREFIX}
+
+# Move source to $PREFIX directory
+mv emsdk/* ${PREFIX}
+rm -rf emsdk
+
+cd ${PREFIX}
 
 # Download and install the latest SDK tools.
-./emsdk install $VER
+./emsdk install ${VER}
 
 # Make the "latest" SDK "active" for the current user. (writes ~/.emscripten
 # file)
-./emsdk activate $VER
+./emsdk activate ${VER}
 
 # Activate PATH and other environment variables in the current terminal
Index: /issm/trunk/externalpackages/fisoc/install.sh
===================================================================
--- /issm/trunk/externalpackages/fisoc/install.sh	(revision 26744)
+++ /issm/trunk/externalpackages/fisoc/install.sh	(revision 26744)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+git clone https://github.com/RupertGladstone/FISOC.git 
Index: /issm/trunk/externalpackages/gdal/install-1.10-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-1.10-macosx64.sh	(revision 26743)
+++ /issm/trunk/externalpackages/gdal/install-1.10-macosx64.sh	(revision 26744)
@@ -11,5 +11,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${GDAL_VER}.tar.gz" "gdal-${GDAL_VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${GDAL_VER}.tar.gz" "gdal-${GDAL_VER}.tar.gz"
 
 # Untar
Index: /issm/trunk/externalpackages/gdal/install-1.11.2-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-1.11.2-macosx64.sh	(revision 26743)
+++ /issm/trunk/externalpackages/gdal/install-1.11.2-macosx64.sh	(revision 26744)
@@ -11,5 +11,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${GDAL_VER}.tar.gz" "gdal-${GDAL_VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${GDAL_VER}.tar.gz" "gdal-${GDAL_VER}.tar.gz"
 
 # Untar
Index: sm/trunk/externalpackages/gdal/install-3-netcdf-static.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-3-netcdf-static.sh	(revision 26743)
+++ 	(revision )
@@ -1,63 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# TODO
-# - May want to supply path to Python instead of, effectively, using result of 
-#	`which python`
-#
-
-## Constants
-#
-VER="3.1.1"
-
-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-NETCDF_ROOT="${ISSM_DIR}/externalpackages/netcdf/install"
-PROJ_ROOT="${ISSM_DIR}/externalpackages/proj/install"
-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-
-## Environment
-#
-export CC=mpicc
-export CXX=mpicxx
-export LDFLAGS="-L${HDF5_ROOT}/lib" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
-export LIBS="-lhdf5_hl -lhdf5" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build; do not need for this configuration, but including it for consistency)
-
-# Cleanup
-rm -rf install src
-mkdir install src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf gdal-$VER.tar.gz
-
-# Move source into 'src' directory
-mv gdal-$VER/* src
-rm -rf gdal-$VER
-
-# Configure
-cd src
-./configure \
-	--prefix="${PREFIX}" \
-	--enable-fast-install \
-	--disable-shared \
-	--without-ld-shared \
-	--enable-static \
-	--with-pic \
-	--with-libz="${ZLIB_ROOT}" \
-	--with-hdf5="${HDF5_ROOT}" \
-	--with-netcdf="${NETCDF_ROOT}" \
-	--with-proj="${PROJ_ROOT}" \
-	--with-pg=no
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/gdal/install-3-netcdf.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-3-netcdf.sh	(revision 26743)
+++ 	(revision )
@@ -1,49 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-VER="3.1.1"
-
-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-NETCDF_ROOT="${ISSM_DIR}/externalpackages/netcdf/install"
-PROJ_ROOT="${ISSM_DIR}/externalpackages/proj/install"
-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-
-## Environment
-#
-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build; do not need for this configuration, but including it for consistency)
-
-# Cleanup
-rm -rf install src
-mkdir install src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf gdal-$VER.tar.gz
-
-# Move source into 'src' directory
-mv gdal-$VER/* src
-rm -rf gdal-$VER
-
-# Configure
-cd src
-./configure \
-	--prefix="${PREFIX}" \
-	--enable-fast-install \
-	--with-libz="${ZLIB_ROOT}" \
-	--with-hdf5="${HDF5_ROOT}" \
-	--with-netcdf="${NETCDF_ROOT}" \
-	--with-proj="${PROJ_ROOT}"
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/gdal/install-3-python-netcdf-static.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-3-python-netcdf-static.sh	(revision 26743)
+++ 	(revision )
@@ -1,64 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# TODO
-# - May want to supply path to Python instead of, effectively, using result of 
-#	`which python`
-#
-
-## Constants
-#
-VER="3.1.1"
-
-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-NETCDF_ROOT="${ISSM_DIR}/externalpackages/netcdf/install"
-PROJ_ROOT="${ISSM_DIR}/externalpackages/proj/install"
-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-
-## Environment
-#
-export CC=mpicc
-export CXX=mpicxx
-export LDFLAGS="-L${HDF5_ROOT}/lib" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
-export LIBS="-lhdf5_hl -lhdf5" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build; do not need for this configuration, but including it for consistency)
-
-# Cleanup
-rm -rf install src
-mkdir install src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf gdal-$VER.tar.gz
-
-# Move source into 'src' directory
-mv gdal-$VER/* src
-rm -rf gdal-$VER
-
-# Configure
-cd src
-./configure \
-	--prefix="${PREFIX}" \
-	--enable-fast-install \
-	--disable-shared \
-	--without-ld-shared \
-	--enable-static \
-	--with-pic \
-	--with-python \
-	--with-libz="${ZLIB_ROOT}" \
-	--with-hdf5="${HDF5_ROOT}" \
-	--with-netcdf="${NETCDF_ROOT}" \
-	--with-proj="${PROJ_ROOT}" \
-	--with-pg=no
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/gdal/install-3-python-netcdf.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-3-python-netcdf.sh	(revision 26743)
+++ 	(revision )
@@ -1,54 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-## TODO
-#	- May want to supply path to Python instead of, effectively, using result of `which python`
-#
-
-## Constants
-#
-VER="3.1.1"
-
-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-NETCDF_ROOT="${ISSM_DIR}/externalpackages/netcdf/install"
-PROJ_ROOT="${ISSM_DIR}/externalpackages/proj/install"
-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-
-## Environment
-#
-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build)
-
-# Cleanup
-rm -rf install src
-mkdir install src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf gdal-$VER.tar.gz
-
-# Move source into 'src' directory
-mv gdal-$VER/* src
-rm -rf gdal-$VER
-
-# Configure
-cd src
-./configure \
-	--prefix="${PREFIX}" \
-	--enable-fast-install \
-	--with-python \
-	--with-libz="${ZLIB_ROOT}" \
-	--with-hdf5="${HDF5_ROOT}" \
-	--with-netcdf="${NETCDF_ROOT}" \
-	--with-proj="${PROJ_ROOT}"
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: /issm/trunk/externalpackages/gdal/install-3-python-static.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-3-python-static.sh	(revision 26744)
+++ /issm/trunk/externalpackages/gdal/install-3-python-static.sh	(revision 26744)
@@ -0,0 +1,58 @@
+#!/bin/bash
+set -eu
+
+
+## TODO
+#	- May want to supply path to Python instead of, effectively, using result of `which python`
+#
+
+## Constants
+#
+VER="3.1.1"
+
+## Environment
+#
+export CC=mpicc
+export CXX=mpicxx
+export LDFLAGS="-L${HDF5_ROOT}/lib" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
+export LIBS="-lhdf5_hl -lhdf5" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
+export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build; do not need for this configuration, but including it for consistency)
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf gdal-${VER}.tar.gz
+
+# Move source into 'src' directory
+mv gdal-${VER}/* src
+rm -rf gdal-${VER}
+
+# Configure
+cd src
+./configure \
+	--prefix="${PREFIX}" \
+	--enable-fast-install \
+	--disable-shared \
+	--without-ld-shared \
+	--enable-static \
+	--with-pic \
+	--with-python \
+	--with-libz="${ZLIB_ROOT}" \
+	--with-hdf5="${HDF5_ROOT}" \
+	--with-netcdf="${NETCDF_ROOT}" \
+	--with-proj="${PROJ_ROOT}" \
+	--with-pg=no
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
Index: /issm/trunk/externalpackages/gdal/install-3-python.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-3-python.sh	(revision 26743)
+++ /issm/trunk/externalpackages/gdal/install-3-python.sh	(revision 26744)
@@ -11,23 +11,21 @@
 VER="3.1.1"
 
-PROJ_ROOT="${ISSM_DIR}/externalpackages/proj/install"
-
 ## Environment
 #
-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build)
+export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # NOTE: Need to export this to properly set destination root for Python libraries on macOS (should not affect Linux build). Set to location where external package should be installed.
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
 
 # Unpack source
-tar -zxvf gdal-$VER.tar.gz
+tar -zxvf gdal-${VER}.tar.gz
 
 # Move source into 'src' directory
-mv gdal-$VER/* src
-rm -rf gdal-$VER
+mv gdal-${VER}/* src
+rm -rf gdal-${VER}
 
 # Configure
@@ -37,6 +35,7 @@
 	--enable-fast-install \
 	--with-python \
-	--without-hdf5 \
-	--without-netcdf \
+	--with-libz="${ZLIB_ROOT}" \
+	--with-hdf5="${HDF5_ROOT}" \
+	--with-netcdf="${NETCDF_ROOT}" \
 	--with-proj="${PROJ_ROOT}"
 
Index: /issm/trunk/externalpackages/gdal/install-3-static.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-3-static.sh	(revision 26744)
+++ /issm/trunk/externalpackages/gdal/install-3-static.sh	(revision 26744)
@@ -0,0 +1,57 @@
+#!/bin/bash
+set -eu
+
+
+## TODO
+#	- May want to supply path to Python instead of, effectively, using result of `which python`
+#
+
+## Constants
+#
+VER="3.1.1"
+
+## Environment
+#
+export CC=mpicc
+export CXX=mpicxx
+export LDFLAGS="-L${HDF5_ROOT}/lib" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
+export LIBS="-lhdf5_hl -lhdf5" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
+export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # NOTE: Need to export this to properly set destination root for Python libraries on macOS (should not affect Linux build). Set to location where external package should be installed.
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf gdal-${VER}.tar.gz
+
+# Move source into 'src' directory
+mv gdal-${VER}/* src
+rm -rf gdal-${VER}
+
+# Configure
+cd src
+./configure \
+	--prefix="${PREFIX}" \
+	--enable-fast-install \
+	--disable-shared \
+	--without-ld-shared \
+	--enable-static \
+	--with-pic \
+	--with-libz="${ZLIB_ROOT}" \
+	--with-hdf5="${HDF5_ROOT}" \
+	--with-netcdf="${NETCDF_ROOT}" \
+	--with-proj="${PROJ_ROOT}" \
+	--with-pg=no
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
Index: /issm/trunk/externalpackages/gdal/install-3.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-3.sh	(revision 26743)
+++ /issm/trunk/externalpackages/gdal/install-3.sh	(revision 26744)
@@ -3,20 +3,18 @@
 
 
-# Constants
+## Constants
 #
 VER="3.1.1"
 
-PROJ_ROOT="${ISSM_DIR}/externalpackages/proj/install"
-
 ## Environment
 #
-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build; do not need for this configuration, but including it for consistency)
+export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # NOTE: Need to export this to properly set destination root for Python libraries on macOS (should not affect Linux build). Set to location where external package should be installed.
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
 
 # Unpack source
@@ -24,6 +22,6 @@
 
 # Move source into 'src' directory
-mv gdal-$VER/* src
-rm -rf gdal-$VER
+mv gdal-${VER}/* src
+rm -rf gdal-${VER}
 
 # Configure
@@ -32,6 +30,7 @@
 	--prefix="${PREFIX}" \
 	--enable-fast-install \
-	--without-hdf5 \
-	--without-netcdf \
+	--with-libz="${ZLIB_ROOT}" \
+	--with-hdf5="${HDF5_ROOT}" \
+	--with-netcdf="${NETCDF_ROOT}" \
 	--with-proj="${PROJ_ROOT}"
 
@@ -44,5 +43,2 @@
 	make -j $1 install
 fi
-
-# Return to initial directory
-cd ..
Index: /issm/trunk/externalpackages/gmsh/install-3.sh
===================================================================
--- /issm/trunk/externalpackages/gmsh/install-3.sh	(revision 26743)
+++ /issm/trunk/externalpackages/gmsh/install-3.sh	(revision 26744)
@@ -37,2 +37,8 @@
 	make -j $1 install
 fi
+
+# Make necessary link on RHEL
+if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
+	cd ${PREFIX}
+	ln -s ./lib64 ./lib
+fi
Index: sm/trunk/externalpackages/gmsh/install-4-linux-python-static.sh
===================================================================
--- /issm/trunk/externalpackages/gmsh/install-4-linux-python-static.sh	(revision 26743)
+++ 	(revision )
@@ -1,67 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# TODO:
-# - Add support for,
-#	- BLAS_LAPACK
-#	- MUMPS
-#	- NUMPY
-#	- PETSC4PY
-#	- PETSC
-# (see configs/4/linux/static/CMakeLists.txt)
-#
-
-## Constants
-#
-VER="4.5.6"
-
-PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-
-# Cleanup
-rm -rf install src
-mkdir install src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
-
-# Untar source
-tar -xvzf gmsh-${VER}-source.tgz
-
-# Move source to 'src' directory
-mv gmsh-${VER}-source/* src
-rm -rf gmsh-${VER}-source
-
-# Copy customized source and config files to 'src' directory
-cp configs/${VER}/static/CMakeLists.txt src
-
-# Configure
-#
-# NOTE:
-# - Option -DENABLE_FLTK=0 is used because we do not need GUI.
-# - Option -DENABLE_MPEG_ENCODE=0 is used because we do not need to record MPEG 
-#	movies.
-# - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not 
-#	importing STEP/IGES files.
-# - Option -DENABLE_TOUCHBAR=0 is used because we do not have GUI, therefore we 
-#	do not need to support Apple Touch bar.
-#
-cd install
-cmake ../src \
-	-DCMAKE_BUILD_TYPE=Release \
-	-DCMAKE_INSTALL_PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" \
-	-DENABLE_BUILD_LIB=1 \
-	-DENABLE_FLTK=0 \
-	-DENABLE_MPEG_ENCODE=0 \
-	-DENABLE_MPI=1 \
-	-DENABLE_OCC=0 \
-	-DMETIS_ROOT="${PETSC_ROOT}"
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/gmsh/install-4-linux-static.sh
===================================================================
--- /issm/trunk/externalpackages/gmsh/install-4-linux-static.sh	(revision 26743)
+++ 	(revision )
@@ -1,63 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# TODO:
-# - Add support for,
-#	- BLAS_LAPACK
-#	- MUMPS
-#	- PETSC
-# (see configs/4/linux/static/CMakeLists.txt)
-#
-
-## Constants
-#
-VER="4.5.6"
-
-PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-
-# Cleanup
-rm -rf install src
-mkdir install src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
-
-# Untar source
-tar -xvzf gmsh-${VER}-source.tgz
-
-# Move source to 'src' directory
-mv gmsh-${VER}-source/* src
-rm -rf gmsh-${VER}-source
-
-# Copy customized source and config files to 'src' directory
-cp configs/${VER}/static/CMakeLists.txt src
-
-# Configure
-#
-# NOTE:
-# - Option -DENABLE_FLTK=0 is used because we do not need GUI.
-# - Option -DENABLE_MPEG_ENCODE=0 is used because we do not need to record MPEG 
-#	movies.
-# - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not 
-#	importing STEP/IGES files.
-#
-cd install
-cmake ../src \
-	-DCMAKE_BUILD_TYPE=Release \
-	-DCMAKE_INSTALL_PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" \
-	-DENABLE_BUILD_LIB=1 \
-	-DENABLE_FLTK=0 \
-	-DENABLE_MPEG_ENCODE=0 \
-	-DENABLE_MPI=1 \
-	-DENABLE_OCC=0 \
-	-DMETIS_ROOT="${PETSC_ROOT}"
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/gmsh/install-4-mac-python-static.sh
===================================================================
--- /issm/trunk/externalpackages/gmsh/install-4-mac-python-static.sh	(revision 26743)
+++ 	(revision )
@@ -1,68 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# TODO:
-# - Add support for,
-#	- BLAS_LAPACK
-#	- MUMPS
-#	- NUMPY
-#	- PETSC4PY
-#	- PETSC
-# (see configs/4/mac/static/CMakeLists.txt)
-#
-
-## Constants
-#
-VER="4.5.6"
-
-PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-
-# Cleanup
-rm -rf install src
-mkdir install src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
-
-# Untar source
-tar -xvzf gmsh-${VER}-source.tgz
-
-# Move source to 'src' directory
-mv gmsh-${VER}-source/* src
-rm -rf gmsh-${VER}-source
-
-# Copy customized source and config files to 'src' directory
-cp configs/${VER}/mac/static/CMakeLists.txt src
-
-# Configure
-#
-# NOTE:
-# - Option -DENABLE_FLTK=0 is used because we do not need GUI.
-# - Option -DENABLE_MPEG_ENCODE=0 is used because we do not need to record MPEG 
-#	movies.
-# - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not 
-#	importing STEP/IGES files.
-# - Option -DENABLE_TOUCHBAR=0 is used because we do not have GUI, therefore we 
-#	do not need to support Apple Touch bar.
-#
-cd install
-cmake ../src \
-	-DCMAKE_BUILD_TYPE=Release \
-	-DCMAKE_INSTALL_PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" \
-	-DENABLE_BUILD_LIB=1 \
-	-DENABLE_FLTK=0 \
-	-DENABLE_MPEG_ENCODE=0 \
-	-DENABLE_MPI=1 \
-	-DENABLE_OCC=0 \
-	-DENABLE_TOUCHBAR=0 \
-	-DMETIS_ROOT="${PETSC_ROOT}"
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/gmsh/install-4-mac-static.sh
===================================================================
--- /issm/trunk/externalpackages/gmsh/install-4-mac-static.sh	(revision 26743)
+++ 	(revision )
@@ -1,65 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# TODO:
-# - Add support for,
-#	- BLAS_LAPACK
-#	- MUMPS
-#	- PETSC
-# (see configs/4/mac/static/CMakeLists.txt)
-#
-
-## Constants
-#
-VER="4.5.6"
-
-PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-
-# Cleanup
-rm -rf install src
-mkdir install src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
-
-# Untar source
-tar -xvzf gmsh-${VER}-source.tgz
-
-# Move source to 'src' directory
-mv gmsh-${VER}-source/* src
-rm -rf gmsh-${VER}-source
-
-# Copy customized source and config files to 'src' directory
-cp configs/${VER}/mac/static/CMakeLists.txt src
-
-# Configure
-#
-# NOTE:
-# - Option -DENABLE_FLTK=0 is used because we do not need GUI.
-# - Option -DENABLE_MPEG_ENCODE=0 is used because we do not need to record MPEG 
-#	movies.
-# - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not 
-#	importing STEP/IGES files.
-# - Option -DENABLE_TOUCHBAR=0 is used because we do not have GUI, therefore we 
-#	do not need to support Apple Touch bar.
-#
-cd install
-cmake ../src \
-	-DCMAKE_INSTALL_PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" \
-	-DENABLE_BUILD_LIB=1 \
-	-DENABLE_FLTK=0 \
-	-DENABLE_MPEG_ENCODE=0 \
-	-DENABLE_MPI=1 \
-	-DENABLE_OCC=0 \
-	-DENABLE_TOUCHBAR=0 \
-	-DMETIS_ROOT="${PETSC_ROOT}"
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: /issm/trunk/externalpackages/gmsh/install-4-static.sh
===================================================================
--- /issm/trunk/externalpackages/gmsh/install-4-static.sh	(revision 26744)
+++ /issm/trunk/externalpackages/gmsh/install-4-static.sh	(revision 26744)
@@ -0,0 +1,72 @@
+#!/bin/bash
+set -eu
+
+
+# TODO:
+# - Add support for,
+#	- BLAS_LAPACK
+#	- MUMPS
+#	- PETSC
+# (see configs/4/static/CMakeLists.txt)
+#
+
+## Constants
+#
+VER="4.5.6"
+
+PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" # Set to location where external package should be installed
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
+
+# Unpack source
+tar -xvzf gmsh-${VER}-source.tgz
+
+# Move source to 'src' directory
+mv gmsh-${VER}-source/* src
+rm -rf gmsh-${VER}-source
+
+# Copy customized source and config files to 'src' directory
+cp configs/${VER}/static/CMakeLists.txt src
+
+# Configure
+#
+# NOTE:
+# - Option -DENABLE_FLTK=0 is used because we do not need GUI.
+# - Option -DENABLE_MPEG_ENCODE=0 is used because we do not need to record MPEG 
+#	movies.
+# - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not 
+#	importing STEP/IGES files.
+# - Option -DENABLE_TOUCHBAR=0 is used because we do not have GUI, therefore we 
+#	do not need to support Apple Touch bar (does not affect compilation on 
+#	Linux).
+#
+cd src
+cmake \
+	-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
+	-DENABLE_BUILD_LIB=1 \
+	-DENABLE_FLTK=0 \
+	-DENABLE_MPEG_ENCODE=0 \
+	-DENABLE_MPI=1 \
+	-DENABLE_OCC=0 \
+	-DENABLE_TOUCHBAR=0 \
+	-DMETIS_ROOT="${METIS_ROOT}"
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+
+# Make necessary link on RHEL
+if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
+	cd ${PREFIX}
+	ln -s ./lib64 ./lib
+fi
Index: /issm/trunk/externalpackages/gmsh/install-4.sh
===================================================================
--- /issm/trunk/externalpackages/gmsh/install-4.sh	(revision 26743)
+++ /issm/trunk/externalpackages/gmsh/install-4.sh	(revision 26744)
@@ -2,4 +2,12 @@
 set -eu
 
+
+# TODO:
+# - Add support for,
+#	- BLAS_LAPACK
+#	- MUMPS
+#	- PETSC
+# (see configs/4/static/CMakeLists.txt)
+#
 
 ## Constants
@@ -7,14 +15,14 @@
 VER="4.5.6"
 
-PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" # Set to location where external package should be installed
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Download source
 $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
 
-# Untar source
+# Unpack source
 tar -xvzf gmsh-${VER}-source.tgz
 
@@ -32,9 +40,10 @@
 #	importing STEP/IGES files.
 # - Option -DENABLE_TOUCHBAR=0 is used because we do not have GUI, therefore we 
-#	do not need to support Apple Touch bar.
+#	do not need to support Apple Touch bar (does not affect compilation on 
+#	Linux).
 #
-cd install
-cmake ../src \
-	-DCMAKE_INSTALL_PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" \
+cd src
+cmake \
+	-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
 	-DENABLE_BUILD_DYNAMIC=1 \
 	-DENABLE_BUILD_SHARED=1 \
@@ -44,5 +53,5 @@
 	-DENABLE_OCC=0 \
 	-DENABLE_TOUCHBAR=0 \
-	-DMETIS_ROOT="${PETSC_ROOT}"
+	-DMETIS_ROOT="${METIS_ROOT}"
 
 # Compile and install
@@ -54,2 +63,8 @@
 	make -j $1 install
 fi
+
+# Make necessary link on RHEL
+if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
+	cd ${PREFIX}
+	ln -s ./lib64 ./lib
+fi
Index: sm/trunk/externalpackages/gmsh/install-mac-precompiled.sh
===================================================================
--- /issm/trunk/externalpackages/gmsh/install-mac-precompiled.sh	(revision 26743)
+++ 	(revision )
@@ -1,23 +1,0 @@
-#!/bin/bash
-set -eu
-
-# Set gmsh version
-GMSH_VER="3.0.5"
-
-# Set tarball name
-GMSH_TARBALL_NAME="gmsh-${GMSH_VER}-mac-precompiled"
-
-# Clean up from previous installation
-rm -f $GMSH_TARBALL_NAME.tar.gz
-rm -rf install src
-
-# Download Mac precompiled gmsh from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${GMSH_TARBALL_NAME}.tar.gz" "${GMSH_TARBALL_NAME}.tar.gz"
-
-# Untar gmsh
-tar -xvzf $GMSH_TARBALL_NAME.tar.gz
-
-# Copy gmsh to path expected by packager
-mkdir install
-cp gmsh install
-rm gmsh
Index: sm/trunk/externalpackages/gmsh/install-win64-precompiled.sh
===================================================================
--- /issm/trunk/externalpackages/gmsh/install-win64-precompiled.sh	(revision 26743)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-# Set gmsh version
-VER="3.0.5"
-
-# Set tarball name
-TARBALL_NAME="gmsh-${VER}-win64-precompiled"
-TARBALL=${TARBALL_NAME}.tar.gz
-
-# Clean up from previous installation
-rm -rf install
-
-# Download Windows 64-bit precompiled gmsh from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${TARBALL}" "${TARBALL}"
-
-# Untar gmsh
-tar -xvzf $TARBALL
-
-# Rename untarred dir
-mv $TARBALL_NAME install
-
-# Clean up
-rm -f $TARBALL
Index: /issm/trunk/externalpackages/gmt/configs/6/linux/cmake/ConfigUser.cmake
===================================================================
--- /issm/trunk/externalpackages/gmt/configs/6/linux/cmake/ConfigUser.cmake	(revision 26744)
+++ /issm/trunk/externalpackages/gmt/configs/6/linux/cmake/ConfigUser.cmake	(revision 26744)
@@ -0,0 +1,308 @@
+#
+#
+# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
+# See LICENSE.TXT file for copying and redistribution conditions.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; version 3 or any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+# for more details.
+#
+# Contact info: www.generic-mapping-tools.org
+# ----------------------------------------------------------------------------
+
+# Use this file to override variables in 'ConfigDefault.cmake' on a per-user
+# basis.  First copy 'ConfigUserTemplate.cmake' to 'ConfigUser.cmake', then
+# edit 'ConfigUser.cmake'.  'ConfigUser.cmake' is not version controlled
+# (currently listed in .gitignore).
+#
+# Note: CMake considers an empty string, "FALSE", "OFF", "NO", or any string
+# ending in "-NOTFOUND" to be false (this happens to be case-insensitive, so
+# "False", "off", "no", and "something-NotFound" are all false).  Other values
+# are true.  Thus it does not matter whether you use TRUE and FALSE, ON and
+# OFF, or YES and NO for your booleans.
+
+##
+## Section 1: Installation paths
+##
+
+# ============================================================================
+# Basic setup begins here.  All settings are optional.  In most cases, setting
+# CMAKE_INSTALL_PREFIX should be all you need to do in order to build GMT with
+# reasonable defaults enabled.  Note: If you need to specify directory names
+# with spaces (e.g., on Windows) then you must put them in quotes.
+# ============================================================================
+
+# Installation path (usually defaults to /usr/local) [auto]:
+set (CMAKE_INSTALL_PREFIX "$ENV{PREFIX}")
+
+# Set install name suffix used for directories and gmt executables
+# [undefined]:
+#set (GMT_INSTALL_NAME_SUFFIX "suffix")
+
+# Install into traditional directory structure. Disable to install a
+# distribution type directory structure (doc and share separated) [on]:
+#set (GMT_INSTALL_TRADITIONAL_FOLDERNAMES OFF)
+
+# Install convenience links for GMT modules. Disable to install only the main
+# gmt program and access modules as "gmt modulename options" [TRUE]:
+#set (GMT_INSTALL_MODULE_LINKS FALSE)
+
+# Make executables relocatable on supported platforms (relative RPATH) [FALSE]:
+set (GMT_INSTALL_RELOCATABLE TRUE)
+
+# Exclude optional GDAL, PCRE, PCRE2, FFTW3, LAPACK, BLAS, ZLIB dependencies even if you have them installed [FALSE]
+#set (GMT_EXCLUDE_GDAL TRUE)
+#set (GMT_EXCLUDE_PCRE TRUE)
+#set (GMT_EXCLUDE_PCRE2 TRUE)
+#set (GMT_EXCLUDE_FFTW3 TRUE)
+#set (GMT_EXCLUDE_LAPACK TRUE)
+#set (GMT_EXCLUDE_BLAS TRUE)
+#set (GMT_EXCLUDE_ZLIB TRUE)
+
+# ============================================================================
+# Advanced configuration begins here.  Usually it is not necessary to edit any
+# settings below.  You should know what you are doing if you do though.  Note:
+# installation paths are relative to ${CMAKE_INSTALL_PREFIX} unless absolute
+# path is given.
+# ============================================================================
+
+# Set binary installation path [bin]:
+#set (GMT_BINDIR "bin")
+
+# Set library installation path [lib or lib64]:
+#set (GMT_LIBDIR "lib")
+
+# Set include installation path [include/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_INCLUDEDIR "include/gmt")
+
+# Set share installation path [share or share/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_DATADIR "share/gmt")
+
+# Set doc installation path [share/doc or
+# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_DOCDIR "share/doc/gmt")
+
+# Set manpage installation path [share/man or
+# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}/man]:
+#set (GMT_MANDIR "share/doc/gmt/man")
+
+# Install documentation files from this external location instead of creating
+# new HTML documents from scratch [${GMT_SOURCE_DIR}/doc_release]:
+#set (GMT_INSTALL_EXTERNAL_DOC OFF)
+
+# Install manual pages from this external location instead of creating the
+# manpages from scratch [${GMT_SOURCE_DIR}/man_release]:
+#set (GMT_INSTALL_EXTERNAL_MAN OFF)
+
+##
+## Section 2: Build dependencies (should only be needed if CMake cannot
+## automatically detect the rights version or path.)
+##
+
+# Set URL to GMT Data server [auto]:
+#set (GMT_DATA_SERVER "data_server_url")
+
+# Set path to GSHHG Shoreline Database [auto]:
+set (GSHHG_ROOT "$ENV{GSHHG_ROOT}")
+
+# Copy GSHHG files to ${GMT_DATADIR}/coast [FALSE]:
+#set (COPY_GSHHG TRUE)
+
+# Set path to DCW Digital Chart of the World for GMT [auto]:
+#set (DCW_ROOT "dcw-gmt_path")
+
+# Copy DCW files to ${GMT_DATADIR}/dcw [FALSE]:
+#set (COPY_DCW TRUE)
+
+# Copy GDAL's 'data' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
+#set (GDAL_DATA_PATH C:/programs/compa_libs/gdal_GIT/compileds/VC14_64/data)
+
+# Copy PROJ4's 'share' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
+#set (PROJ_DATA_PATH C:/programs/compa_libs/proj5_GIT/compileds/VC14_64/share/proj)
+
+# FOR WINDOWS ONLY
+# Set path to location of Ghostscript binaries (optional install)
+#set (GHOST_DATA_PATH C:/programs/compa_libs/ghostscript/bin)
+
+# FOR WINDOWS ONLY
+# Set path to location where the gmtmex is located.
+#set (GMTMEX_PATH "C:/progs_cygw/GMTdev/gmtmex/${GMTver}")
+
+# Set location of NetCDF (can be root directory, path to header file or path
+# to nc-config) [auto]:
+set (NETCDF_ROOT "$ENV{NETCDF_ROOT}")
+
+# Set location of GDAL (can be root directory, path to header file or path to
+# gdal-config) [auto]:
+set (GDAL_ROOT "$ENV{GDAL_ROOT}")
+
+# Set location of PCRE (can be root directory, path to header file or path to
+# pcre-config) [auto]:
+#set (PCRE_ROOT "pcre_install_prefix")
+# Alternatively, set location of PCRE2 (can be root directory, path to header file or path to
+# pcre2-config) [auto]:
+#set (PCRE2_ROOT "pcre2_install_prefix")
+
+# Set location of single precision FFTW (can be root directory or path to
+# header file) [auto]:
+#set (FFTW3_ROOT "fftw_install_prefix")
+
+# Set location of ZLIB (can be root directory or path to header file) [auto]:
+set (ZLIB_ROOT "$ENV{ZLIB_ROOT}")
+
+# Set location of CURL (can be root directory or path to header file) [auto]:
+#set (CURL_ROOT "curl_install_prefix")
+
+# Set location of GLIB component gthread [auto].  This is an optional (and
+# experimental) option which you need to enable:
+#set (GMT_USE_THREADS TRUE)
+# If pkg-config is not installed (e.g. on Windows) you need to specify these:
+#set (GLIB_INCLUDE_DIR c:/path/to/glib-dev/include/glib-2.0)
+#set (GLIB_LIBRARIES c:/path/to/glib-dev/lib/glib-2.0.lib)
+
+# Set LAPACK location. Use this when want to link with LAPACK and it's not found automatically
+set (LAPACK_LIBRARY "-L$ENV{LAPACK_ROOT} -lflapack -L/usr/lib/x86_64-linux-gnu -lgfortran")
+set (BLAS_LIBRARY "-L$ENV{BLAS_ROOT} -lfblas -L/usr/lib/x86_64-linux-gnu -lgfortran")
+
+##
+## Section 3: GMT features
+##
+
+# Enforce GPL or LGPL conformity. Use this to disable routines that cannot be
+# redistributed under the terms of the GPL or LGPL such as Shewchuk's
+# triangulation (valid values are GPL, LGPL and off) [off]:
+#set (LICENSE_RESTRICTED GPL)
+
+# Allow building of OpenMP if compiler supports it
+# set (GMT_ENABLE_OPENMP TRUE)
+
+# Configure default units (possible values are SI and US) [SI]:
+#set (UNITS "US")
+
+# Enable building of shared libraries [TRUE] (disable to use static libraries;
+# not recommended; on non-x86 architectures uncomment the next option as well):
+#set (BUILD_SHARED_LIBS FALSE)
+
+# Create position independent code on all targets [auto] (needed for static
+# build on non-x86):
+#set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+
+# Build GMT shared lib with supplemental modules [TRUE]:
+#set (BUILD_SUPPLEMENTS FALSE)
+
+# Build/Install GMT Developer include files [TRUE]:
+# This installs the extra include files and configured files needed by 3rd-party
+# developers.  Until we build a separate gmt-devel we include them in the main
+# Distribution.
+#set (BUILD_DEVELOPER FALSE)
+
+##
+## Section 4: Advanced tweaking
+##
+
+#
+# Testing and development
+#
+
+# Enable running examples/tests with "ctest" or "make check" (out-of-source).
+# Need to set either DO_EXAMPLES, DO_TESTS or both and uncomment the following
+# line.
+#enable_testing()
+#set (DO_EXAMPLES TRUE)
+#set (DO_TESTS TRUE)
+#set (DO_ANIMATIONS TRUE)
+# Number of parallel test jobs with "make check":
+#set (N_TEST_JOBS 4)
+
+# Enable this option to run GMT programs from within ${GMT_BINARY_DIR} without
+# installing or setting GMT_SHAREDIR and GMT_USERDIR first. This is required
+# for testing [OFF]:
+#set (SUPPORT_EXEC_IN_BINARY_DIR ON)
+
+# List extra sub-dirs of 'src' with a CMakeList.txt to build non-module codes
+# that link against the full gmt libs (not just the API; for building codes
+# that only need the GMT API, see the gmt-custom project).
+#set (EXTRA_BUILD_DIRS apidemo)
+# Uncomment the following line to enable running low-level C tests of the API
+#set (DO_API_TESTS ON)
+
+# Directory in which to install the release sources per default
+# [${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION}]:
+#set (GMT_RELEASE_PREFIX "release-src-prefix")
+
+# If set to false, image conversion from PS images to PNG and PDF does
+# not depend on the gmt binary target. Note: "make gmt" is then required
+# before docs_depends [TRUE].
+#set (GMT_DOCS_DEPEND_ON_GMT FALSE)
+
+#
+# Debugging
+#
+
+# Set build type can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
+# [Release]:
+#set (CMAKE_BUILD_TYPE Debug)
+
+# Extra debugging for developers:
+#if ( CMAKE_GENERATOR STREQUAL "Xcode" )
+##	So Xcode can find the supplemental plug-ins during debug sessions
+#	add_definitions(-DXCODER)
+#   add_definitions(-DDEBUG_MODERN)			# To set PPID == 0 during Xcode test
+#	message("Add Xcode definition for GMT")
+#endif()
+#add_definitions(-DDEBUG)
+#add_definitions(-DMEMDEBUG) # Turn on memory tracking see gmt_support.c for extra info
+#set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement") # recommended even for release build
+#set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")            # extra warnings
+#set (CMAKE_C_FLAGS_DEBUG -ggdb3)                          # gdb debugging symbols
+#set (CMAKE_LINK_DEPENDS_DEBUG_MODE TRUE)                  # debug link dependencies
+if (HAVE_OPENMP)
+	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized -flax-vector-conversions")  # check uninitialized variables
+else (HAVE_OPENMP)
+	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized")  # check uninitialized variables
+endif (HAVE_OPENMP)
+
+#
+# System specific tweaks
+#
+
+# This is for GCC on Solaris to avoid "relocations remain against allocatable
+# but non-writable sections" problems:
+#set (USER_GMTLIB_LINK_FLAGS -mimpure-text)
+
+# This may be needed to enable strdup and extended math functions with GCC and
+# Suncc on Solaris:
+#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
+
+# Do not warn when building with Windows SDK or Visual Studio Express:
+#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+
+# Manually select runtime library when compiling with Windows SDK or Visual
+# Studio Express:
+#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS c:/Windows/System32/msvcr100.dll)
+
+# If your NetCDF library is static (not recommended, applies to Windows only)
+#set (NETCDF_STATIC TRUE)
+
+# If want to rename the DLLs to something else than the default (e.g. to
+# append the bitness - Windows only)
+# WARNING: if using this option it is mandatory that the suffix starts with an underscore.
+#if (WIN32)
+# set (BITAGE 32)
+# # Detect if we are building a 32 or 64 bits version
+# if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+#   set (BITAGE 64)
+# endif ()
+# set (GMT_DLL_RENAME gmt_w${BITAGE})
+# set (PSL_DLL_RENAME psl_w${BITAGE})
+#endif(WIN32)
+
+# On Windows Visual C 2012 needs _ALLOW_KEYWORD_MACROS to build
+#if(MSVC11)
+#  add_definitions(/D_ALLOW_KEYWORD_MACROS)
+#endif(MSVC11)
Index: /issm/trunk/externalpackages/gmt/configs/6/mac/cmake/ConfigUser.cmake
===================================================================
--- /issm/trunk/externalpackages/gmt/configs/6/mac/cmake/ConfigUser.cmake	(revision 26744)
+++ /issm/trunk/externalpackages/gmt/configs/6/mac/cmake/ConfigUser.cmake	(revision 26744)
@@ -0,0 +1,308 @@
+#
+#
+# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
+# See LICENSE.TXT file for copying and redistribution conditions.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; version 3 or any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+# for more details.
+#
+# Contact info: www.generic-mapping-tools.org
+# ----------------------------------------------------------------------------
+
+# Use this file to override variables in 'ConfigDefault.cmake' on a per-user
+# basis.  First copy 'ConfigUserTemplate.cmake' to 'ConfigUser.cmake', then
+# edit 'ConfigUser.cmake'.  'ConfigUser.cmake' is not version controlled
+# (currently listed in .gitignore).
+#
+# Note: CMake considers an empty string, "FALSE", "OFF", "NO", or any string
+# ending in "-NOTFOUND" to be false (this happens to be case-insensitive, so
+# "False", "off", "no", and "something-NotFound" are all false).  Other values
+# are true.  Thus it does not matter whether you use TRUE and FALSE, ON and
+# OFF, or YES and NO for your booleans.
+
+##
+## Section 1: Installation paths
+##
+
+# ============================================================================
+# Basic setup begins here.  All settings are optional.  In most cases, setting
+# CMAKE_INSTALL_PREFIX should be all you need to do in order to build GMT with
+# reasonable defaults enabled.  Note: If you need to specify directory names
+# with spaces (e.g., on Windows) then you must put them in quotes.
+# ============================================================================
+
+# Installation path (usually defaults to /usr/local) [auto]:
+set (CMAKE_INSTALL_PREFIX "$ENV{PREFIX}")
+
+# Set install name suffix used for directories and gmt executables
+# [undefined]:
+#set (GMT_INSTALL_NAME_SUFFIX "suffix")
+
+# Install into traditional directory structure. Disable to install a
+# distribution type directory structure (doc and share separated) [on]:
+#set (GMT_INSTALL_TRADITIONAL_FOLDERNAMES OFF)
+
+# Install convenience links for GMT modules. Disable to install only the main
+# gmt program and access modules as "gmt modulename options" [TRUE]:
+#set (GMT_INSTALL_MODULE_LINKS FALSE)
+
+# Make executables relocatable on supported platforms (relative RPATH) [FALSE]:
+set (GMT_INSTALL_RELOCATABLE TRUE)
+
+# Exclude optional GDAL, PCRE, PCRE2, FFTW3, LAPACK, BLAS, ZLIB dependencies even if you have them installed [FALSE]
+#set (GMT_EXCLUDE_GDAL TRUE)
+#set (GMT_EXCLUDE_PCRE TRUE)
+#set (GMT_EXCLUDE_PCRE2 TRUE)
+#set (GMT_EXCLUDE_FFTW3 TRUE)
+#set (GMT_EXCLUDE_LAPACK TRUE)
+#set (GMT_EXCLUDE_BLAS TRUE)
+#set (GMT_EXCLUDE_ZLIB TRUE)
+
+# ============================================================================
+# Advanced configuration begins here.  Usually it is not necessary to edit any
+# settings below.  You should know what you are doing if you do though.  Note:
+# installation paths are relative to ${CMAKE_INSTALL_PREFIX} unless absolute
+# path is given.
+# ============================================================================
+
+# Set binary installation path [bin]:
+#set (GMT_BINDIR "bin")
+
+# Set library installation path [lib or lib64]:
+#set (GMT_LIBDIR "lib")
+
+# Set include installation path [include/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_INCLUDEDIR "include/gmt")
+
+# Set share installation path [share or share/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_DATADIR "share/gmt")
+
+# Set doc installation path [share/doc or
+# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_DOCDIR "share/doc/gmt")
+
+# Set manpage installation path [share/man or
+# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}/man]:
+#set (GMT_MANDIR "share/doc/gmt/man")
+
+# Install documentation files from this external location instead of creating
+# new HTML documents from scratch [${GMT_SOURCE_DIR}/doc_release]:
+#set (GMT_INSTALL_EXTERNAL_DOC OFF)
+
+# Install manual pages from this external location instead of creating the
+# manpages from scratch [${GMT_SOURCE_DIR}/man_release]:
+#set (GMT_INSTALL_EXTERNAL_MAN OFF)
+
+##
+## Section 2: Build dependencies (should only be needed if CMake cannot
+## automatically detect the rights version or path.)
+##
+
+# Set URL to GMT Data server [auto]:
+#set (GMT_DATA_SERVER "data_server_url")
+
+# Set path to GSHHG Shoreline Database [auto]:
+set (GSHHG_ROOT "$ENV{GSHHG_ROOT}")
+
+# Copy GSHHG files to ${GMT_DATADIR}/coast [FALSE]:
+#set (COPY_GSHHG TRUE)
+
+# Set path to DCW Digital Chart of the World for GMT [auto]:
+#set (DCW_ROOT "dcw-gmt_path")
+
+# Copy DCW files to ${GMT_DATADIR}/dcw [FALSE]:
+#set (COPY_DCW TRUE)
+
+# Copy GDAL's 'data' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
+#set (GDAL_DATA_PATH C:/programs/compa_libs/gdal_GIT/compileds/VC14_64/data)
+
+# Copy PROJ4's 'share' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
+#set (PROJ_DATA_PATH C:/programs/compa_libs/proj5_GIT/compileds/VC14_64/share/proj)
+
+# FOR WINDOWS ONLY
+# Set path to location of Ghostscript binaries (optional install)
+#set (GHOST_DATA_PATH C:/programs/compa_libs/ghostscript/bin)
+
+# FOR WINDOWS ONLY
+# Set path to location where the gmtmex is located.
+#set (GMTMEX_PATH "C:/progs_cygw/GMTdev/gmtmex/${GMTver}")
+
+# Set location of NetCDF (can be root directory, path to header file or path
+# to nc-config) [auto]:
+set (NETCDF_ROOT "$ENV{NETCDF_ROOT}")
+
+# Set location of GDAL (can be root directory, path to header file or path to
+# gdal-config) [auto]:
+set (GDAL_ROOT "$ENV{GDAL_ROOT}")
+
+# Set location of PCRE (can be root directory, path to header file or path to
+# pcre-config) [auto]:
+#set (PCRE_ROOT "pcre_install_prefix")
+# Alternatively, set location of PCRE2 (can be root directory, path to header file or path to
+# pcre2-config) [auto]:
+#set (PCRE2_ROOT "pcre2_install_prefix")
+
+# Set location of single precision FFTW (can be root directory or path to
+# header file) [auto]:
+#set (FFTW3_ROOT "fftw_install_prefix")
+
+# Set location of ZLIB (can be root directory or path to header file) [auto]:
+set (ZLIB_ROOT "$ENV{ZLIB_ROOT}")
+
+# Set location of CURL (can be root directory or path to header file) [auto]:
+#set (CURL_ROOT "curl_install_prefix")
+
+# Set location of GLIB component gthread [auto].  This is an optional (and
+# experimental) option which you need to enable:
+#set (GMT_USE_THREADS TRUE)
+# If pkg-config is not installed (e.g. on Windows) you need to specify these:
+#set (GLIB_INCLUDE_DIR c:/path/to/glib-dev/include/glib-2.0)
+#set (GLIB_LIBRARIES c:/path/to/glib-dev/lib/glib-2.0.lib)
+
+# Set LAPACK location. Use this when want to link with LAPACK and it's not found automatically
+set (LAPACK_LIBRARY "-L$ENV{LAPACK_ROOT} -lflapack")
+set (BLAS_LIBRARY "-L$ENV{BLAS_ROOT} -lfblas")
+
+##
+## Section 3: GMT features
+##
+
+# Enforce GPL or LGPL conformity. Use this to disable routines that cannot be
+# redistributed under the terms of the GPL or LGPL such as Shewchuk's
+# triangulation (valid values are GPL, LGPL and off) [off]:
+#set (LICENSE_RESTRICTED GPL)
+
+# Allow building of OpenMP if compiler supports it
+# set (GMT_ENABLE_OPENMP TRUE)
+
+# Configure default units (possible values are SI and US) [SI]:
+#set (UNITS "US")
+
+# Enable building of shared libraries [TRUE] (disable to use static libraries;
+# not recommended; on non-x86 architectures uncomment the next option as well):
+#set (BUILD_SHARED_LIBS FALSE)
+
+# Create position independent code on all targets [auto] (needed for static
+# build on non-x86):
+#set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+
+# Build GMT shared lib with supplemental modules [TRUE]:
+#set (BUILD_SUPPLEMENTS FALSE)
+
+# Build/Install GMT Developer include files [TRUE]:
+# This installs the extra include files and configured files needed by 3rd-party
+# developers.  Until we build a separate gmt-devel we include them in the main
+# Distribution.
+#set (BUILD_DEVELOPER FALSE)
+
+##
+## Section 4: Advanced tweaking
+##
+
+#
+# Testing and development
+#
+
+# Enable running examples/tests with "ctest" or "make check" (out-of-source).
+# Need to set either DO_EXAMPLES, DO_TESTS or both and uncomment the following
+# line.
+#enable_testing()
+#set (DO_EXAMPLES TRUE)
+#set (DO_TESTS TRUE)
+#set (DO_ANIMATIONS TRUE)
+# Number of parallel test jobs with "make check":
+#set (N_TEST_JOBS 4)
+
+# Enable this option to run GMT programs from within ${GMT_BINARY_DIR} without
+# installing or setting GMT_SHAREDIR and GMT_USERDIR first. This is required
+# for testing [OFF]:
+#set (SUPPORT_EXEC_IN_BINARY_DIR ON)
+
+# List extra sub-dirs of 'src' with a CMakeList.txt to build non-module codes
+# that link against the full gmt libs (not just the API; for building codes
+# that only need the GMT API, see the gmt-custom project).
+#set (EXTRA_BUILD_DIRS apidemo)
+# Uncomment the following line to enable running low-level C tests of the API
+#set (DO_API_TESTS ON)
+
+# Directory in which to install the release sources per default
+# [${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION}]:
+#set (GMT_RELEASE_PREFIX "release-src-prefix")
+
+# If set to false, image conversion from PS images to PNG and PDF does
+# not depend on the gmt binary target. Note: "make gmt" is then required
+# before docs_depends [TRUE].
+#set (GMT_DOCS_DEPEND_ON_GMT FALSE)
+
+#
+# Debugging
+#
+
+# Set build type can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
+# [Release]:
+#set (CMAKE_BUILD_TYPE Debug)
+
+# Extra debugging for developers:
+#if ( CMAKE_GENERATOR STREQUAL "Xcode" )
+##	So Xcode can find the supplemental plug-ins during debug sessions
+#	add_definitions(-DXCODER)
+#   add_definitions(-DDEBUG_MODERN)			# To set PPID == 0 during Xcode test
+#	message("Add Xcode definition for GMT")
+#endif()
+#add_definitions(-DDEBUG)
+#add_definitions(-DMEMDEBUG) # Turn on memory tracking see gmt_support.c for extra info
+#set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement") # recommended even for release build
+#set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")            # extra warnings
+#set (CMAKE_C_FLAGS_DEBUG -ggdb3)                          # gdb debugging symbols
+#set (CMAKE_LINK_DEPENDS_DEBUG_MODE TRUE)                  # debug link dependencies
+if (HAVE_OPENMP)
+	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized -flax-vector-conversions")  # check uninitialized variables
+else (HAVE_OPENMP)
+	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized")  # check uninitialized variables
+endif (HAVE_OPENMP)
+
+#
+# System specific tweaks
+#
+
+# This is for GCC on Solaris to avoid "relocations remain against allocatable
+# but non-writable sections" problems:
+#set (USER_GMTLIB_LINK_FLAGS -mimpure-text)
+
+# This may be needed to enable strdup and extended math functions with GCC and
+# Suncc on Solaris:
+#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
+
+# Do not warn when building with Windows SDK or Visual Studio Express:
+#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+
+# Manually select runtime library when compiling with Windows SDK or Visual
+# Studio Express:
+#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS c:/Windows/System32/msvcr100.dll)
+
+# If your NetCDF library is static (not recommended, applies to Windows only)
+#set (NETCDF_STATIC TRUE)
+
+# If want to rename the DLLs to something else than the default (e.g. to
+# append the bitness - Windows only)
+# WARNING: if using this option it is mandatory that the suffix starts with an underscore.
+#if (WIN32)
+# set (BITAGE 32)
+# # Detect if we are building a 32 or 64 bits version
+# if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+#   set (BITAGE 64)
+# endif ()
+# set (GMT_DLL_RENAME gmt_w${BITAGE})
+# set (PSL_DLL_RENAME psl_w${BITAGE})
+#endif(WIN32)
+
+# On Windows Visual C 2012 needs _ALLOW_KEYWORD_MACROS to build
+#if(MSVC11)
+#  add_definitions(/D_ALLOW_KEYWORD_MACROS)
+#endif(MSVC11)
Index: sm/trunk/externalpackages/gmt/configs/6/static/cmake/ConfigUser.static.cmake
===================================================================
--- /issm/trunk/externalpackages/gmt/configs/6/static/cmake/ConfigUser.static.cmake	(revision 26743)
+++ 	(revision )
@@ -1,308 +1,0 @@
-#
-#
-# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
-# See LICENSE.TXT file for copying and redistribution conditions.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by the
-# Free Software Foundation; version 3 or any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
-# for more details.
-#
-# Contact info: www.generic-mapping-tools.org
-# ----------------------------------------------------------------------------
-
-# Use this file to override variables in 'ConfigDefault.cmake' on a per-user
-# basis.  First copy 'ConfigUserTemplate.cmake' to 'ConfigUser.cmake', then
-# edit 'ConfigUser.cmake'.  'ConfigUser.cmake' is not version controlled
-# (currently listed in .gitignore).
-#
-# Note: CMake considers an empty string, "FALSE", "OFF", "NO", or any string
-# ending in "-NOTFOUND" to be false (this happens to be case-insensitive, so
-# "False", "off", "no", and "something-NotFound" are all false).  Other values
-# are true.  Thus it does not matter whether you use TRUE and FALSE, ON and
-# OFF, or YES and NO for your booleans.
-
-##
-## Section 1: Installation paths
-##
-
-# ============================================================================
-# Basic setup begins here.  All settings are optional.  In most cases, setting
-# CMAKE_INSTALL_PREFIX should be all you need to do in order to build GMT with
-# reasonable defaults enabled.  Note: If you need to specify directory names
-# with spaces (e.g., on Windows) then you must put them in quotes.
-# ============================================================================
-
-# Installation path (usually defaults to /usr/local) [auto]:
-set (CMAKE_INSTALL_PREFIX "$ENV{ISSM_DIR}/externalpackages/gmt/install")
-
-# Set install name suffix used for directories and gmt executables
-# [undefined]:
-#set (GMT_INSTALL_NAME_SUFFIX "suffix")
-
-# Install into traditional directory structure. Disable to install a
-# distribution type directory structure (doc and share separated) [on]:
-#set (GMT_INSTALL_TRADITIONAL_FOLDERNAMES OFF)
-
-# Install convenience links for GMT modules. Disable to install only the main
-# gmt program and access modules as "gmt modulename options" [TRUE]:
-#set (GMT_INSTALL_MODULE_LINKS FALSE)
-
-# Make executables relocatable on supported platforms (relative RPATH) [FALSE]:
-set (GMT_INSTALL_RELOCATABLE TRUE)
-
-# Exclude optional GDAL, PCRE, PCRE2, FFTW3, LAPACK, BLAS, ZLIB dependencies even if you have them installed [FALSE]
-#set (GMT_EXCLUDE_GDAL TRUE)
-#set (GMT_EXCLUDE_PCRE TRUE)
-#set (GMT_EXCLUDE_PCRE2 TRUE)
-#set (GMT_EXCLUDE_FFTW3 TRUE)
-#set (GMT_EXCLUDE_LAPACK TRUE)
-#set (GMT_EXCLUDE_BLAS TRUE)
-#set (GMT_EXCLUDE_ZLIB TRUE)
-
-# ============================================================================
-# Advanced configuration begins here.  Usually it is not necessary to edit any
-# settings below.  You should know what you are doing if you do though.  Note:
-# installation paths are relative to ${CMAKE_INSTALL_PREFIX} unless absolute
-# path is given.
-# ============================================================================
-
-# Set binary installation path [bin]:
-#set (GMT_BINDIR "bin")
-
-# Set library installation path [lib or lib64]:
-#set (GMT_LIBDIR "lib")
-
-# Set include installation path [include/gmt${GMT_INSTALL_NAME_SUFFIX}]:
-#set (GMT_INCLUDEDIR "include/gmt")
-
-# Set share installation path [share or share/gmt${GMT_INSTALL_NAME_SUFFIX}]:
-#set (GMT_DATADIR "share/gmt")
-
-# Set doc installation path [share/doc or
-# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}]:
-#set (GMT_DOCDIR "share/doc/gmt")
-
-# Set manpage installation path [share/man or
-# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}/man]:
-#set (GMT_MANDIR "share/doc/gmt/man")
-
-# Install documentation files from this external location instead of creating
-# new HTML documents from scratch [${GMT_SOURCE_DIR}/doc_release]:
-#set (GMT_INSTALL_EXTERNAL_DOC OFF)
-
-# Install manual pages from this external location instead of creating the
-# manpages from scratch [${GMT_SOURCE_DIR}/man_release]:
-#set (GMT_INSTALL_EXTERNAL_MAN OFF)
-
-##
-## Section 2: Build dependencies (should only be needed if CMake cannot
-## automatically detect the rights version or path.)
-##
-
-# Set URL to GMT Data server [auto]:
-#set (GMT_DATA_SERVER "data_server_url")
-
-# Set path to GSHHG Shoreline Database [auto]:
-set (GSHHG_ROOT "$ENV{ISSM_DIR}/externalpackages/gshhg/install")
-
-# Copy GSHHG files to ${GMT_DATADIR}/coast [FALSE]:
-#set (COPY_GSHHG TRUE)
-
-# Set path to DCW Digital Chart of the World for GMT [auto]:
-#set (DCW_ROOT "dcw-gmt_path")
-
-# Copy DCW files to ${GMT_DATADIR}/dcw [FALSE]:
-#set (COPY_DCW TRUE)
-
-# Copy GDAL's 'data' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
-#set (GDAL_DATA_PATH C:/programs/compa_libs/gdal_GIT/compileds/VC14_64/data)
-
-# Copy PROJ4's 'share' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
-#set (PROJ_DATA_PATH C:/programs/compa_libs/proj5_GIT/compileds/VC14_64/share/proj)
-
-# FOR WINDOWS ONLY
-# Set path to location of Ghostscript binaries (optional install)
-#set (GHOST_DATA_PATH C:/programs/compa_libs/ghostscript/bin)
-
-# FOR WINDOWS ONLY
-# Set path to location where the gmtmex is located.
-#set (GMTMEX_PATH "C:/progs_cygw/GMTdev/gmtmex/${GMTver}")
-
-# Set location of NetCDF (can be root directory, path to header file or path
-# to nc-config) [auto]:
-set (NETCDF_ROOT "$ENV{ISSM_DIR}/externalpackages/netcdf/install")
-
-# Set location of GDAL (can be root directory, path to header file or path to
-# gdal-config) [auto]:
-set (GDAL_ROOT "$ENV{ISSM_DIR}/externalpackages/gdal/install")
-
-# Set location of PCRE (can be root directory, path to header file or path to
-# pcre-config) [auto]:
-#set (PCRE_ROOT "pcre_install_prefix")
-# Alternatively, set location of PCRE2 (can be root directory, path to header file or path to
-# pcre2-config) [auto]:
-#set (PCRE2_ROOT "pcre2_install_prefix")
-
-# Set location of single precision FFTW (can be root directory or path to
-# header file) [auto]:
-#set (FFTW3_ROOT "fftw_install_prefix")
-
-# Set location of ZLIB (can be root directory or path to header file) [auto]:
-set (ZLIB_ROOT "$ENV{ISSM_DIR}/externalpackages/petsc/install")
-
-# Set location of CURL (can be root directory or path to header file) [auto]:
-set (CURL_ROOT "$ENV{ISSM_DIR}/externalpackages/curl/install")
-
-# Set location of GLIB component gthread [auto].  This is an optional (and
-# experimental) option which you need to enable:
-#set (GMT_USE_THREADS TRUE)
-# If pkg-config is not installed (e.g. on Windows) you need to specify these:
-#set (GLIB_INCLUDE_DIR c:/path/to/glib-dev/include/glib-2.0)
-#set (GLIB_LIBRARIES c:/path/to/glib-dev/lib/glib-2.0.lib)
-
-# Set LAPACK location. Use this when want to link with LAPACK and it's not found automatically
-#set (LAPACK_LIBRARY "-L$ENV{ISSM_DIR}/externalpackages/petsc/install/lib -lflapack")
-#set (BLAS_LIBRARY "-L$ENV{ISSM_DIR}/externalpackages/petsc/install/lib -lfblas")
-
-##
-## Section 3: GMT features
-##
-
-# Enforce GPL or LGPL conformity. Use this to disable routines that cannot be
-# redistributed under the terms of the GPL or LGPL such as Shewchuk's
-# triangulation (valid values are GPL, LGPL and off) [off]:
-#set (LICENSE_RESTRICTED GPL)
-
-# Allow building of OpenMP if compiler supports it
-# set (GMT_ENABLE_OPENMP TRUE)
-
-# Configure default units (possible values are SI and US) [SI]:
-#set (UNITS "US")
-
-# Enable building of shared libraries [TRUE] (disable to use static libraries;
-# not recommended; on non-x86 architectures uncomment the next option as well):
-set (BUILD_SHARED_LIBS FALSE)
-
-# Create position independent code on all targets [auto] (needed for static
-# build on non-x86):
-set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
-
-# Build GMT shared lib with supplemental modules [TRUE]:
-set (BUILD_SUPPLEMENTS FALSE)
-
-# Build/Install GMT Developer include files [TRUE]:
-# This installs the extra include files and configured files needed by 3rd-party
-# developers.  Until we build a separate gmt-devel we include them in the main
-# Distribution.
-#set (BUILD_DEVELOPER FALSE)
-
-##
-## Section 4: Advanced tweaking
-##
-
-#
-# Testing and development
-#
-
-# Enable running examples/tests with "ctest" or "make check" (out-of-source).
-# Need to set either DO_EXAMPLES, DO_TESTS or both and uncomment the following
-# line.
-#enable_testing()
-#set (DO_EXAMPLES TRUE)
-#set (DO_TESTS TRUE)
-#set (DO_ANIMATIONS TRUE)
-# Number of parallel test jobs with "make check":
-#set (N_TEST_JOBS 4)
-
-# Enable this option to run GMT programs from within ${GMT_BINARY_DIR} without
-# installing or setting GMT_SHAREDIR and GMT_USERDIR first. This is required
-# for testing [OFF]:
-#set (SUPPORT_EXEC_IN_BINARY_DIR ON)
-
-# List extra sub-dirs of 'src' with a CMakeList.txt to build non-module codes
-# that link against the full gmt libs (not just the API; for building codes
-# that only need the GMT API, see the gmt-custom project).
-#set (EXTRA_BUILD_DIRS apidemo)
-# Uncomment the following line to enable running low-level C tests of the API
-#set (DO_API_TESTS ON)
-
-# Directory in which to install the release sources per default
-# [${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION}]:
-#set (GMT_RELEASE_PREFIX "release-src-prefix")
-
-# If set to false, image conversion from PS images to PNG and PDF does
-# not depend on the gmt binary target. Note: "make gmt" is then required
-# before docs_depends [TRUE].
-#set (GMT_DOCS_DEPEND_ON_GMT FALSE)
-
-#
-# Debugging
-#
-
-# Set build type can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
-# [Release]:
-#set (CMAKE_BUILD_TYPE Debug)
-
-# Extra debugging for developers:
-#if ( CMAKE_GENERATOR STREQUAL "Xcode" )
-##	So Xcode can find the supplemental plug-ins during debug sessions
-#	add_definitions(-DXCODER)
-#   add_definitions(-DDEBUG_MODERN)			# To set PPID == 0 during Xcode test
-#	message("Add Xcode definition for GMT")
-#endif()
-#add_definitions(-DDEBUG)
-#add_definitions(-DMEMDEBUG) # Turn on memory tracking see gmt_support.c for extra info
-#set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement") # recommended even for release build
-#set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")            # extra warnings
-#set (CMAKE_C_FLAGS_DEBUG -ggdb3)                          # gdb debugging symbols
-#set (CMAKE_LINK_DEPENDS_DEBUG_MODE TRUE)                  # debug link dependencies
-if (HAVE_OPENMP)
-	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized -flax-vector-conversions")  # check uninitialized variables
-else (HAVE_OPENMP)
-	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized")  # check uninitialized variables
-endif (HAVE_OPENMP)
-
-#
-# System specific tweaks
-#
-
-# This is for GCC on Solaris to avoid "relocations remain against allocatable
-# but non-writable sections" problems:
-#set (USER_GMTLIB_LINK_FLAGS -mimpure-text)
-
-# This may be needed to enable strdup and extended math functions with GCC and
-# Suncc on Solaris:
-#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
-
-# Do not warn when building with Windows SDK or Visual Studio Express:
-#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
-
-# Manually select runtime library when compiling with Windows SDK or Visual
-# Studio Express:
-#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS c:/Windows/System32/msvcr100.dll)
-
-# If your NetCDF library is static (not recommended, applies to Windows only)
-set (NETCDF_STATIC TRUE)
-
-# If want to rename the DLLs to something else than the default (e.g. to
-# append the bitness - Windows only)
-# WARNING: if using this option it is mandatory that the suffix starts with an underscore.
-#if (WIN32)
-# set (BITAGE 32)
-# # Detect if we are building a 32 or 64 bits version
-# if (CMAKE_SIZEOF_VOID_P EQUAL 8)
-#   set (BITAGE 64)
-# endif ()
-# set (GMT_DLL_RENAME gmt_w${BITAGE})
-# set (PSL_DLL_RENAME psl_w${BITAGE})
-#endif(WIN32)
-
-# On Windows Visual C 2012 needs _ALLOW_KEYWORD_MACROS to build
-#if(MSVC11)
-#  add_definitions(/D_ALLOW_KEYWORD_MACROS)
-#endif(MSVC11)
Index: /issm/trunk/externalpackages/gmt/configs/6/static/linux/cmake/ConfigUser.static.cmake
===================================================================
--- /issm/trunk/externalpackages/gmt/configs/6/static/linux/cmake/ConfigUser.static.cmake	(revision 26744)
+++ /issm/trunk/externalpackages/gmt/configs/6/static/linux/cmake/ConfigUser.static.cmake	(revision 26744)
@@ -0,0 +1,308 @@
+#
+#
+# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
+# See LICENSE.TXT file for copying and redistribution conditions.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; version 3 or any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+# for more details.
+#
+# Contact info: www.generic-mapping-tools.org
+# ----------------------------------------------------------------------------
+
+# Use this file to override variables in 'ConfigDefault.cmake' on a per-user
+# basis.  First copy 'ConfigUserTemplate.cmake' to 'ConfigUser.cmake', then
+# edit 'ConfigUser.cmake'.  'ConfigUser.cmake' is not version controlled
+# (currently listed in .gitignore).
+#
+# Note: CMake considers an empty string, "FALSE", "OFF", "NO", or any string
+# ending in "-NOTFOUND" to be false (this happens to be case-insensitive, so
+# "False", "off", "no", and "something-NotFound" are all false).  Other values
+# are true.  Thus it does not matter whether you use TRUE and FALSE, ON and
+# OFF, or YES and NO for your booleans.
+
+##
+## Section 1: Installation paths
+##
+
+# ============================================================================
+# Basic setup begins here.  All settings are optional.  In most cases, setting
+# CMAKE_INSTALL_PREFIX should be all you need to do in order to build GMT with
+# reasonable defaults enabled.  Note: If you need to specify directory names
+# with spaces (e.g., on Windows) then you must put them in quotes.
+# ============================================================================
+
+# Installation path (usually defaults to /usr/local) [auto]:
+set (CMAKE_INSTALL_PREFIX "$ENV{ISSM_DIR}/externalpackages/gmt/install")
+
+# Set install name suffix used for directories and gmt executables
+# [undefined]:
+#set (GMT_INSTALL_NAME_SUFFIX "suffix")
+
+# Install into traditional directory structure. Disable to install a
+# distribution type directory structure (doc and share separated) [on]:
+#set (GMT_INSTALL_TRADITIONAL_FOLDERNAMES OFF)
+
+# Install convenience links for GMT modules. Disable to install only the main
+# gmt program and access modules as "gmt modulename options" [TRUE]:
+#set (GMT_INSTALL_MODULE_LINKS FALSE)
+
+# Make executables relocatable on supported platforms (relative RPATH) [FALSE]:
+set (GMT_INSTALL_RELOCATABLE TRUE)
+
+# Exclude optional GDAL, PCRE, PCRE2, FFTW3, LAPACK, BLAS, ZLIB dependencies even if you have them installed [FALSE]
+#set (GMT_EXCLUDE_GDAL TRUE)
+#set (GMT_EXCLUDE_PCRE TRUE)
+#set (GMT_EXCLUDE_PCRE2 TRUE)
+#set (GMT_EXCLUDE_FFTW3 TRUE)
+#set (GMT_EXCLUDE_LAPACK TRUE)
+#set (GMT_EXCLUDE_BLAS TRUE)
+#set (GMT_EXCLUDE_ZLIB TRUE)
+
+# ============================================================================
+# Advanced configuration begins here.  Usually it is not necessary to edit any
+# settings below.  You should know what you are doing if you do though.  Note:
+# installation paths are relative to ${CMAKE_INSTALL_PREFIX} unless absolute
+# path is given.
+# ============================================================================
+
+# Set binary installation path [bin]:
+#set (GMT_BINDIR "bin")
+
+# Set library installation path [lib or lib64]:
+#set (GMT_LIBDIR "lib")
+
+# Set include installation path [include/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_INCLUDEDIR "include/gmt")
+
+# Set share installation path [share or share/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_DATADIR "share/gmt")
+
+# Set doc installation path [share/doc or
+# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_DOCDIR "share/doc/gmt")
+
+# Set manpage installation path [share/man or
+# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}/man]:
+#set (GMT_MANDIR "share/doc/gmt/man")
+
+# Install documentation files from this external location instead of creating
+# new HTML documents from scratch [${GMT_SOURCE_DIR}/doc_release]:
+#set (GMT_INSTALL_EXTERNAL_DOC OFF)
+
+# Install manual pages from this external location instead of creating the
+# manpages from scratch [${GMT_SOURCE_DIR}/man_release]:
+#set (GMT_INSTALL_EXTERNAL_MAN OFF)
+
+##
+## Section 2: Build dependencies (should only be needed if CMake cannot
+## automatically detect the rights version or path.)
+##
+
+# Set URL to GMT Data server [auto]:
+#set (GMT_DATA_SERVER "data_server_url")
+
+# Set path to GSHHG Shoreline Database [auto]:
+set (GSHHG_ROOT "$ENV{GSHHG_ROOT}")
+
+# Copy GSHHG files to ${GMT_DATADIR}/coast [FALSE]:
+#set (COPY_GSHHG TRUE)
+
+# Set path to DCW Digital Chart of the World for GMT [auto]:
+#set (DCW_ROOT "dcw-gmt_path")
+
+# Copy DCW files to ${GMT_DATADIR}/dcw [FALSE]:
+#set (COPY_DCW TRUE)
+
+# Copy GDAL's 'data' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
+#set (GDAL_DATA_PATH C:/programs/compa_libs/gdal_GIT/compileds/VC14_64/data)
+
+# Copy PROJ4's 'share' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
+#set (PROJ_DATA_PATH C:/programs/compa_libs/proj5_GIT/compileds/VC14_64/share/proj)
+
+# FOR WINDOWS ONLY
+# Set path to location of Ghostscript binaries (optional install)
+#set (GHOST_DATA_PATH C:/programs/compa_libs/ghostscript/bin)
+
+# FOR WINDOWS ONLY
+# Set path to location where the gmtmex is located.
+#set (GMTMEX_PATH "C:/progs_cygw/GMTdev/gmtmex/${GMTver}")
+
+# Set location of NetCDF (can be root directory, path to header file or path
+# to nc-config) [auto]:
+set (NETCDF_ROOT "$ENV{NETCDF_ROOT}")
+
+# Set location of GDAL (can be root directory, path to header file or path to
+# gdal-config) [auto]:
+set (GDAL_ROOT "$ENV{GDAL_ROOT}")
+
+# Set location of PCRE (can be root directory, path to header file or path to
+# pcre-config) [auto]:
+#set (PCRE_ROOT "pcre_install_prefix")
+# Alternatively, set location of PCRE2 (can be root directory, path to header file or path to
+# pcre2-config) [auto]:
+#set (PCRE2_ROOT "pcre2_install_prefix")
+
+# Set location of single precision FFTW (can be root directory or path to
+# header file) [auto]:
+#set (FFTW3_ROOT "fftw_install_prefix")
+
+# Set location of ZLIB (can be root directory or path to header file) [auto]:
+set (ZLIB_ROOT "$ENV{ZLIB_ROOT}")
+
+# Set location of CURL (can be root directory or path to header file) [auto]:
+#set (CURL_ROOT "curl_install_prefix")
+
+# Set location of GLIB component gthread [auto].  This is an optional (and
+# experimental) option which you need to enable:
+#set (GMT_USE_THREADS TRUE)
+# If pkg-config is not installed (e.g. on Windows) you need to specify these:
+#set (GLIB_INCLUDE_DIR c:/path/to/glib-dev/include/glib-2.0)
+#set (GLIB_LIBRARIES c:/path/to/glib-dev/lib/glib-2.0.lib)
+
+# Set LAPACK location. Use this when want to link with LAPACK and it's not found automatically
+set (LAPACK_LIBRARY "-L$ENV{LAPACK_ROOT} -lflapack -L/usr/lib/x86_64-linux-gnu -lgfortran")
+set (BLAS_LIBRARY "-L$ENV{BLAS_ROOT} -lfblas -L/usr/lib/x86_64-linux-gnu -lgfortran")
+
+##
+## Section 3: GMT features
+##
+
+# Enforce GPL or LGPL conformity. Use this to disable routines that cannot be
+# redistributed under the terms of the GPL or LGPL such as Shewchuk's
+# triangulation (valid values are GPL, LGPL and off) [off]:
+#set (LICENSE_RESTRICTED GPL)
+
+# Allow building of OpenMP if compiler supports it
+# set (GMT_ENABLE_OPENMP TRUE)
+
+# Configure default units (possible values are SI and US) [SI]:
+#set (UNITS "US")
+
+# Enable building of shared libraries [TRUE] (disable to use static libraries;
+# not recommended; on non-x86 architectures uncomment the next option as well):
+set (BUILD_SHARED_LIBS FALSE)
+
+# Create position independent code on all targets [auto] (needed for static
+# build on non-x86):
+set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+
+# Build GMT shared lib with supplemental modules [TRUE]:
+set (BUILD_SUPPLEMENTS FALSE)
+
+# Build/Install GMT Developer include files [TRUE]:
+# This installs the extra include files and configured files needed by 3rd-party
+# developers.  Until we build a separate gmt-devel we include them in the main
+# Distribution.
+#set (BUILD_DEVELOPER FALSE)
+
+##
+## Section 4: Advanced tweaking
+##
+
+#
+# Testing and development
+#
+
+# Enable running examples/tests with "ctest" or "make check" (out-of-source).
+# Need to set either DO_EXAMPLES, DO_TESTS or both and uncomment the following
+# line.
+#enable_testing()
+#set (DO_EXAMPLES TRUE)
+#set (DO_TESTS TRUE)
+#set (DO_ANIMATIONS TRUE)
+# Number of parallel test jobs with "make check":
+#set (N_TEST_JOBS 4)
+
+# Enable this option to run GMT programs from within ${GMT_BINARY_DIR} without
+# installing or setting GMT_SHAREDIR and GMT_USERDIR first. This is required
+# for testing [OFF]:
+#set (SUPPORT_EXEC_IN_BINARY_DIR ON)
+
+# List extra sub-dirs of 'src' with a CMakeList.txt to build non-module codes
+# that link against the full gmt libs (not just the API; for building codes
+# that only need the GMT API, see the gmt-custom project).
+#set (EXTRA_BUILD_DIRS apidemo)
+# Uncomment the following line to enable running low-level C tests of the API
+#set (DO_API_TESTS ON)
+
+# Directory in which to install the release sources per default
+# [${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION}]:
+#set (GMT_RELEASE_PREFIX "release-src-prefix")
+
+# If set to false, image conversion from PS images to PNG and PDF does
+# not depend on the gmt binary target. Note: "make gmt" is then required
+# before docs_depends [TRUE].
+#set (GMT_DOCS_DEPEND_ON_GMT FALSE)
+
+#
+# Debugging
+#
+
+# Set build type can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
+# [Release]:
+#set (CMAKE_BUILD_TYPE Debug)
+
+# Extra debugging for developers:
+#if ( CMAKE_GENERATOR STREQUAL "Xcode" )
+##	So Xcode can find the supplemental plug-ins during debug sessions
+#	add_definitions(-DXCODER)
+#   add_definitions(-DDEBUG_MODERN)			# To set PPID == 0 during Xcode test
+#	message("Add Xcode definition for GMT")
+#endif()
+#add_definitions(-DDEBUG)
+#add_definitions(-DMEMDEBUG) # Turn on memory tracking see gmt_support.c for extra info
+#set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement") # recommended even for release build
+#set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")            # extra warnings
+#set (CMAKE_C_FLAGS_DEBUG -ggdb3)                          # gdb debugging symbols
+#set (CMAKE_LINK_DEPENDS_DEBUG_MODE TRUE)                  # debug link dependencies
+if (HAVE_OPENMP)
+	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized -flax-vector-conversions")  # check uninitialized variables
+else (HAVE_OPENMP)
+	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized")  # check uninitialized variables
+endif (HAVE_OPENMP)
+
+#
+# System specific tweaks
+#
+
+# This is for GCC on Solaris to avoid "relocations remain against allocatable
+# but non-writable sections" problems:
+#set (USER_GMTLIB_LINK_FLAGS -mimpure-text)
+
+# This may be needed to enable strdup and extended math functions with GCC and
+# Suncc on Solaris:
+#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
+
+# Do not warn when building with Windows SDK or Visual Studio Express:
+#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+
+# Manually select runtime library when compiling with Windows SDK or Visual
+# Studio Express:
+#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS c:/Windows/System32/msvcr100.dll)
+
+# If your NetCDF library is static (not recommended, applies to Windows only)
+set (NETCDF_STATIC TRUE)
+
+# If want to rename the DLLs to something else than the default (e.g. to
+# append the bitness - Windows only)
+# WARNING: if using this option it is mandatory that the suffix starts with an underscore.
+#if (WIN32)
+# set (BITAGE 32)
+# # Detect if we are building a 32 or 64 bits version
+# if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+#   set (BITAGE 64)
+# endif ()
+# set (GMT_DLL_RENAME gmt_w${BITAGE})
+# set (PSL_DLL_RENAME psl_w${BITAGE})
+#endif(WIN32)
+
+# On Windows Visual C 2012 needs _ALLOW_KEYWORD_MACROS to build
+#if(MSVC11)
+#  add_definitions(/D_ALLOW_KEYWORD_MACROS)
+#endif(MSVC11)
Index: /issm/trunk/externalpackages/gmt/configs/6/static/mac/cmake/ConfigUser.static.cmake
===================================================================
--- /issm/trunk/externalpackages/gmt/configs/6/static/mac/cmake/ConfigUser.static.cmake	(revision 26744)
+++ /issm/trunk/externalpackages/gmt/configs/6/static/mac/cmake/ConfigUser.static.cmake	(revision 26744)
@@ -0,0 +1,308 @@
+#
+#
+# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
+# See LICENSE.TXT file for copying and redistribution conditions.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; version 3 or any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+# for more details.
+#
+# Contact info: www.generic-mapping-tools.org
+# ----------------------------------------------------------------------------
+
+# Use this file to override variables in 'ConfigDefault.cmake' on a per-user
+# basis.  First copy 'ConfigUserTemplate.cmake' to 'ConfigUser.cmake', then
+# edit 'ConfigUser.cmake'.  'ConfigUser.cmake' is not version controlled
+# (currently listed in .gitignore).
+#
+# Note: CMake considers an empty string, "FALSE", "OFF", "NO", or any string
+# ending in "-NOTFOUND" to be false (this happens to be case-insensitive, so
+# "False", "off", "no", and "something-NotFound" are all false).  Other values
+# are true.  Thus it does not matter whether you use TRUE and FALSE, ON and
+# OFF, or YES and NO for your booleans.
+
+##
+## Section 1: Installation paths
+##
+
+# ============================================================================
+# Basic setup begins here.  All settings are optional.  In most cases, setting
+# CMAKE_INSTALL_PREFIX should be all you need to do in order to build GMT with
+# reasonable defaults enabled.  Note: If you need to specify directory names
+# with spaces (e.g., on Windows) then you must put them in quotes.
+# ============================================================================
+
+# Installation path (usually defaults to /usr/local) [auto]:
+set (CMAKE_INSTALL_PREFIX "$ENV{ISSM_DIR}/externalpackages/gmt/install")
+
+# Set install name suffix used for directories and gmt executables
+# [undefined]:
+#set (GMT_INSTALL_NAME_SUFFIX "suffix")
+
+# Install into traditional directory structure. Disable to install a
+# distribution type directory structure (doc and share separated) [on]:
+#set (GMT_INSTALL_TRADITIONAL_FOLDERNAMES OFF)
+
+# Install convenience links for GMT modules. Disable to install only the main
+# gmt program and access modules as "gmt modulename options" [TRUE]:
+#set (GMT_INSTALL_MODULE_LINKS FALSE)
+
+# Make executables relocatable on supported platforms (relative RPATH) [FALSE]:
+set (GMT_INSTALL_RELOCATABLE TRUE)
+
+# Exclude optional GDAL, PCRE, PCRE2, FFTW3, LAPACK, BLAS, ZLIB dependencies even if you have them installed [FALSE]
+#set (GMT_EXCLUDE_GDAL TRUE)
+#set (GMT_EXCLUDE_PCRE TRUE)
+#set (GMT_EXCLUDE_PCRE2 TRUE)
+#set (GMT_EXCLUDE_FFTW3 TRUE)
+#set (GMT_EXCLUDE_LAPACK TRUE)
+#set (GMT_EXCLUDE_BLAS TRUE)
+#set (GMT_EXCLUDE_ZLIB TRUE)
+
+# ============================================================================
+# Advanced configuration begins here.  Usually it is not necessary to edit any
+# settings below.  You should know what you are doing if you do though.  Note:
+# installation paths are relative to ${CMAKE_INSTALL_PREFIX} unless absolute
+# path is given.
+# ============================================================================
+
+# Set binary installation path [bin]:
+#set (GMT_BINDIR "bin")
+
+# Set library installation path [lib or lib64]:
+#set (GMT_LIBDIR "lib")
+
+# Set include installation path [include/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_INCLUDEDIR "include/gmt")
+
+# Set share installation path [share or share/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_DATADIR "share/gmt")
+
+# Set doc installation path [share/doc or
+# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+#set (GMT_DOCDIR "share/doc/gmt")
+
+# Set manpage installation path [share/man or
+# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}/man]:
+#set (GMT_MANDIR "share/doc/gmt/man")
+
+# Install documentation files from this external location instead of creating
+# new HTML documents from scratch [${GMT_SOURCE_DIR}/doc_release]:
+#set (GMT_INSTALL_EXTERNAL_DOC OFF)
+
+# Install manual pages from this external location instead of creating the
+# manpages from scratch [${GMT_SOURCE_DIR}/man_release]:
+#set (GMT_INSTALL_EXTERNAL_MAN OFF)
+
+##
+## Section 2: Build dependencies (should only be needed if CMake cannot
+## automatically detect the rights version or path.)
+##
+
+# Set URL to GMT Data server [auto]:
+#set (GMT_DATA_SERVER "data_server_url")
+
+# Set path to GSHHG Shoreline Database [auto]:
+set (GSHHG_ROOT "$ENV{GSHHG_ROOT}")
+
+# Copy GSHHG files to ${GMT_DATADIR}/coast [FALSE]:
+#set (COPY_GSHHG TRUE)
+
+# Set path to DCW Digital Chart of the World for GMT [auto]:
+#set (DCW_ROOT "dcw-gmt_path")
+
+# Copy DCW files to ${GMT_DATADIR}/dcw [FALSE]:
+#set (COPY_DCW TRUE)
+
+# Copy GDAL's 'data' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
+#set (GDAL_DATA_PATH C:/programs/compa_libs/gdal_GIT/compileds/VC14_64/data)
+
+# Copy PROJ4's 'share' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
+#set (PROJ_DATA_PATH C:/programs/compa_libs/proj5_GIT/compileds/VC14_64/share/proj)
+
+# FOR WINDOWS ONLY
+# Set path to location of Ghostscript binaries (optional install)
+#set (GHOST_DATA_PATH C:/programs/compa_libs/ghostscript/bin)
+
+# FOR WINDOWS ONLY
+# Set path to location where the gmtmex is located.
+#set (GMTMEX_PATH "C:/progs_cygw/GMTdev/gmtmex/${GMTver}")
+
+# Set location of NetCDF (can be root directory, path to header file or path
+# to nc-config) [auto]:
+set (NETCDF_ROOT "$ENV{NETCDF_ROOT}")
+
+# Set location of GDAL (can be root directory, path to header file or path to
+# gdal-config) [auto]:
+set (GDAL_ROOT "$ENV{GDAL_ROOT}")
+
+# Set location of PCRE (can be root directory, path to header file or path to
+# pcre-config) [auto]:
+#set (PCRE_ROOT "pcre_install_prefix")
+# Alternatively, set location of PCRE2 (can be root directory, path to header file or path to
+# pcre2-config) [auto]:
+#set (PCRE2_ROOT "pcre2_install_prefix")
+
+# Set location of single precision FFTW (can be root directory or path to
+# header file) [auto]:
+#set (FFTW3_ROOT "fftw_install_prefix")
+
+# Set location of ZLIB (can be root directory or path to header file) [auto]:
+set (ZLIB_ROOT "$ENV{ZLIB_ROOT}")
+
+# Set location of CURL (can be root directory or path to header file) [auto]:
+#set (CURL_ROOT "curl_install_prefix")
+
+# Set location of GLIB component gthread [auto].  This is an optional (and
+# experimental) option which you need to enable:
+#set (GMT_USE_THREADS TRUE)
+# If pkg-config is not installed (e.g. on Windows) you need to specify these:
+#set (GLIB_INCLUDE_DIR c:/path/to/glib-dev/include/glib-2.0)
+#set (GLIB_LIBRARIES c:/path/to/glib-dev/lib/glib-2.0.lib)
+
+# Set LAPACK location. Use this when want to link with LAPACK and it's not found automatically
+#set (LAPACK_LIBRARY "-L$ENV{LAPACK_ROOT} -lflapack")
+#set (BLAS_LIBRARY "-L$ENV{BLAS_ROOT} -lfblas")
+
+##
+## Section 3: GMT features
+##
+
+# Enforce GPL or LGPL conformity. Use this to disable routines that cannot be
+# redistributed under the terms of the GPL or LGPL such as Shewchuk's
+# triangulation (valid values are GPL, LGPL and off) [off]:
+#set (LICENSE_RESTRICTED GPL)
+
+# Allow building of OpenMP if compiler supports it
+# set (GMT_ENABLE_OPENMP TRUE)
+
+# Configure default units (possible values are SI and US) [SI]:
+#set (UNITS "US")
+
+# Enable building of shared libraries [TRUE] (disable to use static libraries;
+# not recommended; on non-x86 architectures uncomment the next option as well):
+set (BUILD_SHARED_LIBS FALSE)
+
+# Create position independent code on all targets [auto] (needed for static
+# build on non-x86):
+set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+
+# Build GMT shared lib with supplemental modules [TRUE]:
+set (BUILD_SUPPLEMENTS FALSE)
+
+# Build/Install GMT Developer include files [TRUE]:
+# This installs the extra include files and configured files needed by 3rd-party
+# developers.  Until we build a separate gmt-devel we include them in the main
+# Distribution.
+#set (BUILD_DEVELOPER FALSE)
+
+##
+## Section 4: Advanced tweaking
+##
+
+#
+# Testing and development
+#
+
+# Enable running examples/tests with "ctest" or "make check" (out-of-source).
+# Need to set either DO_EXAMPLES, DO_TESTS or both and uncomment the following
+# line.
+#enable_testing()
+#set (DO_EXAMPLES TRUE)
+#set (DO_TESTS TRUE)
+#set (DO_ANIMATIONS TRUE)
+# Number of parallel test jobs with "make check":
+#set (N_TEST_JOBS 4)
+
+# Enable this option to run GMT programs from within ${GMT_BINARY_DIR} without
+# installing or setting GMT_SHAREDIR and GMT_USERDIR first. This is required
+# for testing [OFF]:
+#set (SUPPORT_EXEC_IN_BINARY_DIR ON)
+
+# List extra sub-dirs of 'src' with a CMakeList.txt to build non-module codes
+# that link against the full gmt libs (not just the API; for building codes
+# that only need the GMT API, see the gmt-custom project).
+#set (EXTRA_BUILD_DIRS apidemo)
+# Uncomment the following line to enable running low-level C tests of the API
+#set (DO_API_TESTS ON)
+
+# Directory in which to install the release sources per default
+# [${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION}]:
+#set (GMT_RELEASE_PREFIX "release-src-prefix")
+
+# If set to false, image conversion from PS images to PNG and PDF does
+# not depend on the gmt binary target. Note: "make gmt" is then required
+# before docs_depends [TRUE].
+#set (GMT_DOCS_DEPEND_ON_GMT FALSE)
+
+#
+# Debugging
+#
+
+# Set build type can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
+# [Release]:
+#set (CMAKE_BUILD_TYPE Debug)
+
+# Extra debugging for developers:
+#if ( CMAKE_GENERATOR STREQUAL "Xcode" )
+##	So Xcode can find the supplemental plug-ins during debug sessions
+#	add_definitions(-DXCODER)
+#   add_definitions(-DDEBUG_MODERN)			# To set PPID == 0 during Xcode test
+#	message("Add Xcode definition for GMT")
+#endif()
+#add_definitions(-DDEBUG)
+#add_definitions(-DMEMDEBUG) # Turn on memory tracking see gmt_support.c for extra info
+#set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement") # recommended even for release build
+#set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")            # extra warnings
+#set (CMAKE_C_FLAGS_DEBUG -ggdb3)                          # gdb debugging symbols
+#set (CMAKE_LINK_DEPENDS_DEBUG_MODE TRUE)                  # debug link dependencies
+if (HAVE_OPENMP)
+	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized -flax-vector-conversions")  # check uninitialized variables
+else (HAVE_OPENMP)
+	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized")  # check uninitialized variables
+endif (HAVE_OPENMP)
+
+#
+# System specific tweaks
+#
+
+# This is for GCC on Solaris to avoid "relocations remain against allocatable
+# but non-writable sections" problems:
+#set (USER_GMTLIB_LINK_FLAGS -mimpure-text)
+
+# This may be needed to enable strdup and extended math functions with GCC and
+# Suncc on Solaris:
+#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
+
+# Do not warn when building with Windows SDK or Visual Studio Express:
+#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+
+# Manually select runtime library when compiling with Windows SDK or Visual
+# Studio Express:
+#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS c:/Windows/System32/msvcr100.dll)
+
+# If your NetCDF library is static (not recommended, applies to Windows only)
+set (NETCDF_STATIC TRUE)
+
+# If want to rename the DLLs to something else than the default (e.g. to
+# append the bitness - Windows only)
+# WARNING: if using this option it is mandatory that the suffix starts with an underscore.
+#if (WIN32)
+# set (BITAGE 32)
+# # Detect if we are building a 32 or 64 bits version
+# if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+#   set (BITAGE 64)
+# endif ()
+# set (GMT_DLL_RENAME gmt_w${BITAGE})
+# set (PSL_DLL_RENAME psl_w${BITAGE})
+#endif(WIN32)
+
+# On Windows Visual C 2012 needs _ALLOW_KEYWORD_MACROS to build
+#if(MSVC11)
+#  add_definitions(/D_ALLOW_KEYWORD_MACROS)
+#endif(MSVC11)
Index: /issm/trunk/externalpackages/gmt/install-6-linux-static.sh
===================================================================
--- /issm/trunk/externalpackages/gmt/install-6-linux-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/gmt/install-6-linux-static.sh	(revision 26744)
@@ -7,10 +7,4 @@
 VER="6.0.0"
 
-CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
-PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-
-BLASLAPACK_ROOT="${PETSC_ROOT}"
-HDF5_ROOT="${PETSC_ROOT}"
-
 # Find libgfortran and libgcc so we do not have to hardcode them
 #
@@ -18,4 +12,5 @@
 #
 # TODO:
+# - Move this to etc/environment.sh
 # - Figure out how to find and grep for single result like we do with mdfind 
 #	under macOS.
@@ -25,6 +20,4 @@
 LIBGCC="/usr/lib/gcc/x86_64-linux-gnu/8/libgcc.a"
 
-CURL_INCLUDE_DIRS="${CURL_ROOT}/include" \
-CURL_LIBRARIES="${CURL_ROOT}/lib/libcurl.a;/usr/lib/x86_64-linux-gnu/libssl.a;/usr/lib/x86_64-linux-gnu/libcrypto.a" \
 GDAL_EXTRA_LIBS="-lstdc++" # Determined by running `$GDAL_ROOT/bin/gdal-config --dep-libs` then removing duplicate libs
 NETCDF_EXTRA_LIBS="-lm -ldl -lz" # `$NETCDF_ROOT/bin/nc-config --libs` does not report certain dependencies of certain static libraries (see also customized configuration file ./configs/6.0/static/cmake/modules/FindNETCDF.cmake)
@@ -33,6 +26,7 @@
 #
 export CC=mpicc
-export CURL_INCLUDE_DIRS=${CURL_INCLUDE_DIRS}
-export CURL_LIBRARIES=${CURL_LIBRARIES}
+export CURL_INCLUDE_DIRS="${CURL_ROOT}/include"
+export CURL_LIBRARIES="${CURL_ROOT}/lib/libcurl.a;/usr/lib/x86_64-linux-gnu/libssl.a;/usr/lib/x86_64-linux-gnu/libcrypto.a"
+export PREFIX="${ISSM_DIR}/externalpackages/gmt/install" # NOTE: Need to export this to be picked up by customized ConfigUser.cmake (see below). Set to location where external package should be installed.
 
 # Download source
@@ -43,6 +37,6 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
@@ -51,5 +45,5 @@
 
 # Copy custom configuration files
-cp ./configs/6/static/cmake/ConfigUser.static.cmake ./src/cmake/ConfigUser.cmake
+cp ./configs/6/static/linux/cmake/ConfigUser.static.cmake ./src/cmake/ConfigUser.cmake
 cp ./configs/6/static/cmake/modules/FindGDAL.cmake ./src/cmake/modules
 cp ./configs/6/static/cmake/modules/FindGSHHG.cmake ./src/cmake/modules
@@ -70,8 +64,8 @@
 #
 cmake \
-	-DBLAS_LIBRARIES="${BLASLAPACK_ROOT}/lib/libfblas.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
+	-DBLAS_LIBRARIES="${BLAS_ROOT}/lib/libfblas.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
 	-DGDAL_EXTRA_LIBS="${GDAL_EXTRA_LIBS}" \
 	-DHDF5_ROOT="${HDF5_ROOT}" \
-	-DLAPACK_LIBRARIES="${BLASLAPACK_ROOT}/lib/libflapack.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
+	-DLAPACK_LIBRARIES="${LAPACK_ROOT}/lib/libflapack.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
 	-DNETCDF_EXTRA_LIBS="${NETCDF_EXTRA_LIBS}" \
 	..
@@ -85,2 +79,8 @@
 	make -j $1 install
 fi
+
+# Make necessary link on RHEL
+if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
+	cd ${PREFIX}
+	ln -s ./lib64 ./lib
+fi
Index: /issm/trunk/externalpackages/gmt/install-6-linux.sh
===================================================================
--- /issm/trunk/externalpackages/gmt/install-6-linux.sh	(revision 26743)
+++ /issm/trunk/externalpackages/gmt/install-6-linux.sh	(revision 26744)
@@ -7,9 +7,8 @@
 VER="6.0.0"
 
-CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
-
 # Environment
 #
 export CC=mpicc
+export PREFIX="${ISSM_DIR}/externalpackages/gmt/install" # NOTE: Need to export this to be picked up by customized ConfigUser.cmake (see below). Set to location where external package should be installed.
 
 # Download source
@@ -20,6 +19,6 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
@@ -28,5 +27,5 @@
 
 # Copy custom configuration files
-cp ./configs/6/cmake/ConfigUser.cmake ./src/cmake
+cp ./configs/6/linux/cmake/ConfigUser.cmake ./src/cmake
 
 # Configure
@@ -55,2 +54,8 @@
 	make -j $1 install
 fi
+
+# Make necessary link on RHEL
+if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
+	cd ${PREFIX}
+	ln -s ./lib64 ./lib
+fi
Index: /issm/trunk/externalpackages/gmt/install-6-mac-static.sh
===================================================================
--- /issm/trunk/externalpackages/gmt/install-6-mac-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/gmt/install-6-mac-static.sh	(revision 26744)
@@ -7,9 +7,4 @@
 VER="6.0.0"
 
-PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-
-BLASLAPACK_ROOT="${PETSC_ROOT}"
-HDF5_ROOT="${PETSC_ROOT}"
-
 # Find libgfortran and libgcc so we do not have to hardcode them
 #
@@ -17,4 +12,5 @@
 #
 # TODO:
+# - Move this to etc/environment.sh
 # - Test if -static-libgfortran flag will avoid all of this.
 # - Otherwise, refactor this to work with other gfortran installations.
@@ -30,4 +26,8 @@
 #
 export CC=mpicc
+export CURL_INCLUDE_DIRS="${CURL_ROOT}/include"
+export CURL_LIBRARIES="${CURL_ROOT}/lib/libcurl.a;${ZLIB_ROOT}/lib/libz.a"
+export LDFLAGS="-framework CoreFoundation -framework Security"
+export PREFIX="${ISSM_DIR}/externalpackages/gmt/install" # NOTE: Need to export this to be picked up by customized ConfigUser.cmake (see below). Set to location where external package should be installed.
 
 # Download source
@@ -38,6 +38,6 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
@@ -46,5 +46,5 @@
 
 # Copy custom configuration files
-cp ./configs/6/static/cmake/ConfigUser.static.cmake ./src/cmake/ConfigUser.cmake
+cp ./configs/6/static/mac/cmake/ConfigUser.static.cmake ./src/cmake/ConfigUser.cmake
 cp ./configs/6/static/cmake/modules/FindGDAL.cmake ./src/cmake/modules
 cp ./configs/6/static/cmake/modules/FindGSHHG.cmake ./src/cmake/modules
@@ -56,9 +56,16 @@
 cd build
 
+# NOTE:
+# - The CMake modules used to find and probe the BLAS and LAPACK libraries do
+#	not seem to handle the situation where BLAS_LIBRARY and LAPACK_LIBRARY are
+#	set but we are working with static libraries
+#	(see customized ConfigUser.static.cmake). Using BLAS_LIBRARIES and
+#	LAPACK_LIBRARIES is a workaround.
+#
 cmake \
-	-DBLAS_LIBRARIES="${BLASLAPACK_ROOT}/lib/libfblas.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
+	-DBLAS_LIBRARIES="${BLAS_ROOT}/lib/libfblas.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
 	-DGDAL_EXTRA_LIBS="${GDAL_EXTRA_LIBS}" \
 	-DHDF5_ROOT="${HDF5_ROOT}" \
-	-DLAPACK_LIBRARIES="${BLASLAPACK_ROOT}/lib/libflapack.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
+	-DLAPACK_LIBRARIES="${LAPACK_ROOT}/lib/libflapack.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
 	-DNETCDF_EXTRA_LIBS="${NETCDF_EXTRA_LIBS}" \
 	..
Index: /issm/trunk/externalpackages/gmt/install-6-mac.sh
===================================================================
--- /issm/trunk/externalpackages/gmt/install-6-mac.sh	(revision 26743)
+++ /issm/trunk/externalpackages/gmt/install-6-mac.sh	(revision 26744)
@@ -7,9 +7,8 @@
 VER="6.0.0"
 
-CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
-
 # Environment
 #
 export CC=mpicc
+export PREFIX="${ISSM_DIR}/externalpackages/gmt/install" # NOTE: Need to export this to be picked up by customized ConfigUser.cmake (see below). Set to location where external package should be installed.
 
 # Download source
@@ -20,6 +19,6 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
@@ -28,5 +27,5 @@
 
 # Copy custom configuration files
-cp ./configs/6/cmake/ConfigUser.cmake ./src/cmake
+cp ./configs/6/mac/cmake/ConfigUser.cmake ./src/cmake
 
 # Configure
Index: sm/trunk/externalpackages/gmt/install-mac-precompiled.sh
===================================================================
--- /issm/trunk/externalpackages/gmt/install-mac-precompiled.sh	(revision 26743)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-# Set gmt version
-VER="5.4.4"
-
-# Set tarball name
-TARBALL_NAME="gmt-${VER}-mac-precompiled"
-TARBALL=${TARBALL_NAME}.tar.gz
-
-# Clean up from previous installation
-rm -rf install
-
-# Download Mac precompiled gmsh from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${TARBALL}" "${TARBALL}"
-
-# Untar gmt
-tar -xvzf $TARBALL
-
-# Rename untarred dir
-mv $TARBALL_NAME install
-
-# Clean up
-rm -f $TARBALL
Index: sm/trunk/externalpackages/gmt/install-win64-precompiled.sh
===================================================================
--- /issm/trunk/externalpackages/gmt/install-win64-precompiled.sh	(revision 26743)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#!/bin/bash
-set -eu
-
-# Set gmt version
-VER="5.4.4"
-
-# Set tarball name
-TARBALL_NAME="gmt-${VER}-win64-precompiled"
-TARBALL=${TARBALL_NAME}.tar.gz
-
-# Clean up from previous installation
-rm -rf install
-
-# Download Windows 64-bit precompiled gmsh from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${TARBALL}" "${TARBALL}"
-
-# Untar gmt
-tar -xvzf $TARBALL
-
-# Rename untarred dir
-mv $TARBALL_NAME install
-
-# Clean up
-rm -f $TARBALL
Index: /issm/trunk/externalpackages/gshhg/install.sh
===================================================================
--- /issm/trunk/externalpackages/gshhg/install.sh	(revision 26743)
+++ /issm/trunk/externalpackages/gshhg/install.sh	(revision 26744)
@@ -7,6 +7,9 @@
 VER="2.3.4"
 
+PREFIX="${ISSM_DIR}/externalpackages/gshhg/install" # Set to location where external package should be installed
+
 # Cleanup
-rm -rf install
+rm -rf ${PREFIX}
+mkdir -p ${PREFIX}
 
 # Download source
@@ -17,3 +20,3 @@
 
 # Install
-mv gshhg-gmt-${VER} install
+mv gshhg-gmt-${VER}/* ${PREFIX}
Index: /issm/trunk/externalpackages/gsl/install-javascript.sh
===================================================================
--- /issm/trunk/externalpackages/gsl/install-javascript.sh	(revision 26743)
+++ /issm/trunk/externalpackages/gsl/install-javascript.sh	(revision 26744)
@@ -3,10 +3,17 @@
 
 
-# TODO:
+## TODO:
 # - Revisit enviroment variables (especially EMCC_CFLAGS) once support for
 #	Fortran has been accomplished.
 #
 
-# Environment
+## Constants
+#
+VER="1.15"
+
+PREFIX="${ISSM_DIR}/externalpackages/gsl/install" # Set to location where external package should be installed
+
+## Environment
+#
 export CC=emcc
 export CXX=em++
@@ -17,35 +24,35 @@
 
 # Source Emscripten environment
-source $ISSM_DIR/externalpackages/emscripten/install/emsdk_env.sh
+source ${EMSCRIPTEN_ROOT}/emsdk_env.sh
 
 # Issue with variadic function signatures.
 #export CFLAGS=-DSTDC_HEADERS
 
-# Cleanup from previous installation
-rm -rf src-javascript install-javascript gsl-1.15
-mkdir src-javascript install-javascript
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
+${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gsl-${VER}.tar.gz" "gsl-${VER}.tar.gz"
 
-#Untar
-tar -zxvf  gsl-1.15.tar.gz
+# Unpack source
+tar -zxvf gsl-${VER}.tar.gz
 
-#Move gsl into src directory
-mv gsl-1.15/* src-javascript
-rm -rf gsl-1.15
+# Move source to 'src' directory
+mv gsl-${VER}/* src
+rm -rf gsl-${VER}
 
-#Configure gsl
-cd src-javascript
-
+# Configure
+cd src
 ./configure \
-	--prefix="$ISSM_DIR/externalpackages/gsl/install-javascript" \
-	--disable-shared
+	--prefix="${PREFIX}" \
+	--disable-shared \
 
 #Compile gsl
 if [ $# -eq 0 ]; then
 	make
+	make install
 else
 	make -j $1
+	make -j $1 install
 fi
-make install
Index: /issm/trunk/externalpackages/gsl/install-static.sh
===================================================================
--- /issm/trunk/externalpackages/gsl/install-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/gsl/install-static.sh	(revision 26744)
@@ -3,12 +3,13 @@
 
 
-# Constants
+## Constants
 #
-GSL_ROOT=${ISSM_DIR}/externalpackages/gsl
 VER="1.15"
 
-# Cleanup=
-rm -rf install src
-mkdir install src
+PREFIX="${ISSM_DIR}/externalpackages/gsl/install" # Set to location where external package should be installed
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Download source
@@ -25,5 +26,5 @@
 cd src
 ./configure \
-	--prefix="${GSL_ROOT}/install" \
+	--prefix="${PREFIX}" \
 	--disable-shared \
 	--with-pic
Index: /issm/trunk/externalpackages/gsl/install.sh
===================================================================
--- /issm/trunk/externalpackages/gsl/install.sh	(revision 26743)
+++ /issm/trunk/externalpackages/gsl/install.sh	(revision 26744)
@@ -5,10 +5,11 @@
 # Constants
 #
-GSL_ROOT=${ISSM_DIR}/externalpackages/gsl
 VER="1.15"
 
-# Cleanup=
-rm -rf install src
-mkdir install src
+PREFIX="${ISSM_DIR}/externalpackages/gsl/install" # Set to location where external package should be installed
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Download source
@@ -25,5 +26,5 @@
 cd src
 ./configure \
-	--prefix="${GSL_ROOT}/install" \
+	--prefix="${PREFIX}" \
 	--disable-static
 
Index: /issm/trunk/externalpackages/lapack/install-3-win-msys2-gcc.sh
===================================================================
--- /issm/trunk/externalpackages/lapack/install-3-win-msys2-gcc.sh	(revision 26744)
+++ /issm/trunk/externalpackages/lapack/install-3-win-msys2-gcc.sh	(revision 26744)
@@ -0,0 +1,49 @@
+#!/bin/bash
+set -eu
+
+
+## Constants
+#
+VER="3.9.0"
+
+PREFIX="${ISSM_DIR}/externalpackages/lapack/install"
+
+# Cleanup
+rm -rf ${PREFIX} build src
+mkdir ${PREFIX} build src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/lapack-${VER}.tar.gz" "lapack-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf lapack-${VER}.tar.gz
+
+# Move source into 'src' directory
+mv lapack-${VER}/* src
+rm -rf lapack-${VER}
+
+# Configure
+#
+cd build
+cmake \
+	-DBUILD_SHARED_LIBS=ON \
+	-DCMAKE_C_COMPILER=/usr/bin/gcc \
+	-DCMAKE_Fortran_COMPILER=/usr/bin/gfortran \
+	-DBLAS_LIBRARIES="-L${BLAS_ROOT}/lib -lblas" \
+	../src
+
+# Compile
+make
+
+# Copy libraries to lib directory (on Windows, CMake installs .dll files next
+# to the .exe files that need them, making tests easy to run, so let's not 
+# change the CMake configuration).
+mkdir ${PREFIX}/lib
+cp bin/msys-* ${PREFIX}/lib
+
+# Create link to versioned library
+cd ${PREFIX}/lib
+ln -s msys-lapack-3.dll msys-lapack.dll
+
+# Create link to shared version of library so that libtool can find it
+ln -s msys-lapack-3.dll liblapack.dll
Index: /issm/trunk/externalpackages/lapack/install-3-win-msys2-mingw.sh
===================================================================
--- /issm/trunk/externalpackages/lapack/install-3-win-msys2-mingw.sh	(revision 26744)
+++ /issm/trunk/externalpackages/lapack/install-3-win-msys2-mingw.sh	(revision 26744)
@@ -0,0 +1,54 @@
+#!/bin/bash
+set -eu
+
+
+# TODO:
+# - Modify configuration/makefiles so that dll rather than so is produced.
+#
+
+## Constants
+#
+VER="3.9.0"
+
+PREFIX="${ISSM_DIR}/externalpackages/lapack/install"
+
+# Cleanup
+rm -rf ${PREFIX} build src
+mkdir ${PREFIX} build src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/lapack-${VER}.tar.gz" "lapack-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf lapack-${VER}.tar.gz
+
+# Move source into 'src' directory
+mv lapack-${VER}/* src
+rm -rf lapack-${VER}
+
+# Configure
+#
+cd build
+cmake \
+	-DBUILD_SHARED_LIBS=ON \
+	-DCMAKE_C_COMPILER=/mingw64/bin/gcc \
+	-DCMAKE_Fortran_COMPILER=/mingw64/bin/gfortran \
+	-DBLAS_LIBRARIES="-L${BLAS_ROOT}/lib -lblas" \
+	../src
+
+# Compile
+make
+
+# Copy libraries to lib directory (on Windows, CMake installs .dll files next
+# to the .exe files that need them, making tests easy to run, so let's not 
+# change the CMake configuration).
+mkdir ${PREFIX}/lib
+cp lib/liblapack.* ${PREFIX}/lib
+
+# # Create link to versioned library
+# cd ${PREFIX}/lib
+# ln -s msys-lapack-3.dll msys-lapack.dll
+
+# Create link to shared version of library so that libtool can find it
+cd ${PREFIX}/lib
+ln -s liblapack.so liblapack.dll
Index: /issm/trunk/externalpackages/libtiff/install-4-mac.sh
===================================================================
--- /issm/trunk/externalpackages/libtiff/install-4-mac.sh	(revision 26744)
+++ /issm/trunk/externalpackages/libtiff/install-4-mac.sh	(revision 26744)
@@ -0,0 +1,45 @@
+#!/bin/bash
+set -eu
+
+
+# NOTE:
+# - This installation script should work equally well under Linux. If your 
+#	Linux distribution does not include libtiff, please,
+#		- copy this file to install-4-linux.sh
+#		- verify that it successfully compiles and installs libtiff
+#		- commit the new script (including any modifications) to the repo
+#
+
+# Constants
+#
+VER="4.2.0"
+
+PREFIX="${ISSM_EXT_SHARED_DIR}/libtiff/install" # Set to location where external package should be installed
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/libtiff-v${VER}.tar.gz" "libtiff-v${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf libtiff-v${VER}.tar.gz
+
+# Move source into 'src' directory
+mv libtiff-v${VER}/* src
+rm -rf libtiff-v${VER}
+
+# Configure
+cd src
+cmake -S . -B ${PREFIX}
+cd ${PREFIX}
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
Index: /issm/trunk/externalpackages/m1qn3/install.sh
===================================================================
--- /issm/trunk/externalpackages/m1qn3/install.sh	(revision 26743)
+++ /issm/trunk/externalpackages/m1qn3/install.sh	(revision 26744)
@@ -2,14 +2,27 @@
 set -eu
 
-#Some cleanup 
-rm -rf install src m1qn3-3.3-distrib
-mkdir install
+## Constants
+#
+VER=3.3
 
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/m1qn3-3.3-distrib.tgz' 'm1qn3-3.3-distrib.tgz'
+PREFIX="${ISSM_DIR}/externalpackages/m1qn3/install" # Set to location where external package should be installed
 
-#Untar 
-tar -xzf m1qn3-3.3-distrib.tgz
-mv m1qn3-3.3-distrib src
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m1qn3-${VER}-distrib.tgz" "m1qn3-${VER}-distrib.tgz"
+
+# Unpack source
+tar -xzf m1qn3-${VER}-distrib.tgz
+
+# Move source to 'src' directory
+mv m1qn3-${VER}-distrib/* src
+rm -rf m1qn3-${VER}-distrib
+
+#patch
+#patch -u -b src/src/m1qn3.f -i patch/m1qn3.f.patch
+patch src/src/m1qn3.f patch/m1qn3.f.patch
 
 if which ifort >/dev/null; then
@@ -22,5 +35,5 @@
 fi
 
-#Compile m1qn3
+# Compile and install
 cd src/src/
 (
@@ -29,5 +42,5 @@
 FC=$FC
 install: libm1qn3.\$(LIB_EXT)
-	cp libm1qn3.\$(LIB_EXT) ../../install/
+	cp libm1qn3.\$(LIB_EXT) ${PREFIX}
 OBJECTS= m1qn3.o
 libm1qn3.\$(LIB_EXT): \$(OBJECTS)
@@ -42,5 +55,4 @@
 make
 
-#compile ddot
 cd ../blas
 (
@@ -49,5 +61,5 @@
 FC=$FC
 install: libddot.\$(LIB_EXT)
-	cp libddot.\$(LIB_EXT) ../../install/
+	cp libddot.\$(LIB_EXT) ${PREFIX}
 OBJECTS= ddot.o
 libddot.\$(LIB_EXT): \$(OBJECTS)
Index: /issm/trunk/externalpackages/m1qn3/patch/m1qn3.f.patch
===================================================================
--- /issm/trunk/externalpackages/m1qn3/patch/m1qn3.f.patch	(revision 26744)
+++ /issm/trunk/externalpackages/m1qn3/patch/m1qn3.f.patch	(revision 26744)
@@ -0,0 +1,11 @@
+--- src/src/m1qn3.f	2009-10-20 06:39:35.000000000 -0400
++++ m1qn3.f	2021-08-13 14:44:30.276019165 -0400
+@@ -802,7 +802,7 @@
+      &        "  iter  simul  stepsize            f                |g|",
+      &        "       |g|/|g0|"
+           write(io,
+-     &        '(1x,i5,2x,i5,2x,1pd8.2,2x,d21.14,2x,d11.5,2x,d10.4)')
++     &        '(1x,i5,2x,i5,2x,1pd9.2,2x,d21.14,2x,d12.5,2x,d11.4)')
+      &        niter, isim, t, f, gnorm, eps1
+       endif
+       if (impres.ge.5) write (io,940) eps1
Index: /issm/trunk/externalpackages/medipack/install.sh
===================================================================
--- /issm/trunk/externalpackages/medipack/install.sh	(revision 26743)
+++ /issm/trunk/externalpackages/medipack/install.sh	(revision 26744)
@@ -3,5 +3,5 @@
 
 #Some cleanup
-rm -rf install 
+rm -rf install
 
 #Download development version
Index: /issm/trunk/externalpackages/metis/configs/5.1/win/msys2/GKlib/gk_arch.h
===================================================================
--- /issm/trunk/externalpackages/metis/configs/5.1/win/msys2/GKlib/gk_arch.h	(revision 26744)
+++ /issm/trunk/externalpackages/metis/configs/5.1/win/msys2/GKlib/gk_arch.h	(revision 26744)
@@ -0,0 +1,73 @@
+/*!
+\file gk_arch.h
+\brief This file contains various architecture-specific declerations
+
+\date   Started 3/27/2007
+\author George
+\version\verbatim $Id: gk_arch.h 10711 2011-08-31 22:23:04Z karypis $ \endverbatim
+*/
+
+#ifndef _GK_ARCH_H_
+#define _GK_ARCH_H_
+
+/*************************************************************************
+* Architecture-specific differences in header files
+**************************************************************************/
+#ifdef LINUX
+#if !defined(__USE_XOPEN)
+#define __USE_XOPEN
+#endif
+#if !defined(_XOPEN_SOURCE)
+#define _XOPEN_SOURCE 600
+#endif
+#if !defined(__USE_XOPEN2K)
+#define __USE_XOPEN2K
+#endif
+#endif
+
+
+#ifdef HAVE_EXECINFO_H
+#include <execinfo.h>
+#endif
+
+
+#ifdef __MSC__ 
+  #include "ms_stdint.h"
+  #include "ms_inttypes.h"
+  #include "ms_stat.h"
+#else
+#ifndef SUNOS
+  #include <stdint.h>
+#endif
+  #include <inttypes.h>
+  #include <sys/types.h>
+  #ifndef __MINGW32__
+  #include <sys/resource.h>
+  #endif
+  #include <sys/time.h>
+#endif
+
+
+/*************************************************************************
+* Architecture-specific modifications
+**************************************************************************/
+#ifdef WIN32
+typedef ptrdiff_t ssize_t;
+#endif
+
+
+#ifdef SUNOS
+#define PTRDIFF_MAX  INT64_MAX
+#endif
+
+#ifdef __MSC__
+/* MSC does not have rint() function */
+#define rint(x) ((int)((x)+0.5))  
+
+/* MSC does not have INFINITY defined */
+#ifndef INFINITY
+#define INFINITY FLT_MAX
+#endif
+#endif
+
+#endif
Index: /issm/trunk/externalpackages/metis/configs/5.1/win/msys2/GKlib/gk_getopt.h
===================================================================
--- /issm/trunk/externalpackages/metis/configs/5.1/win/msys2/GKlib/gk_getopt.h	(revision 26744)
+++ /issm/trunk/externalpackages/metis/configs/5.1/win/msys2/GKlib/gk_getopt.h	(revision 26744)
@@ -0,0 +1,53 @@
+/*!
+\file gk_getopt.h
+\brief This file contains GNU's externs/structs/prototypes
+
+\date   Started 3/27/2007
+\author George
+\version\verbatim $Id: gk_getopt.h 10711 2011-08-31 22:23:04Z karypis $ \endverbatim
+*/
+
+#ifndef _GK_GETOPT_H_
+#define _GK_GETOPT_H_
+
+
+/* Externals from getopt.c */
+extern char *gk_optarg;
+extern int gk_optind;
+extern int gk_opterr;
+extern int gk_optopt;
+
+
+/*! \brief The structure that stores the information about the command-line options 
+
+This structure describes a single long option name for the sake of 
+gk_getopt_long(). The argument <tt>long_options</tt> must be an array 
+of these structures, one for each long option. Terminate the array with 
+an element containing all zeros.
+*/
+struct gk_option {
+  char *name;       /*!< This field is the name of the option. */
+  int has_arg;      /*!< This field says whether the option takes an argument. 
+                         It is an integer, and there are three legitimate values: 
+                         no_argument, required_argument and optional_argument. 
+                         */
+  int *flag;        /*!< See the discussion on ::gk_option#val */
+  int val;          /*!< These fields control how to report or act on the option 
+                         when it occurs. 
+                         
+                         If flag is a null pointer, then the val is a value which 
+                         identifies this option. Often these values are chosen 
+                         to uniquely identify particular long options.
+
+                         If flag is not a null pointer, it should be the address 
+                         of an int variable which is the flag for this option. 
+                         The value in val is the value to store in the flag to 
+                         indicate that the option was seen. */
+};
+
+/* Names for the values of the `has_arg' field of `struct gk_option'.  */
+#define no_argument		0
+#define required_argument	1
+#define optional_argument	2
+
+#endif
Index: /issm/trunk/externalpackages/metis/configs/5.1/win/msys2/Makefile
===================================================================
--- /issm/trunk/externalpackages/metis/configs/5.1/win/msys2/Makefile	(revision 26744)
+++ /issm/trunk/externalpackages/metis/configs/5.1/win/msys2/Makefile	(revision 26744)
@@ -0,0 +1,133 @@
+# Configuration options.
+gdb        = not-set
+assert     = not-set
+assert2    = not-set
+debug      = not-set
+gprof      = not-set
+openmp     = not-set
+prefix     = not-set
+gklib_path = not-set
+windows    = not-set
+shared     = not-set
+cc         = not-set
+cxx        = not-set
+ar         = not-set
+gcc-ar     = not-set
+ranlib     = not-set
+gcc-ranlib = not-set
+linker     = not-set
+nm         = not-set
+objcopy    = not-set
+objdump    = not-set
+rc         = not-set
+strip      = not-set
+
+
+# Basically proxies everything to the builddir cmake.
+
+cputype = $(shell uname -m | sed "s/\\ /_/g")
+systype = $(shell uname -s)
+
+BUILDDIR = build/$(systype)-$(cputype)
+
+# Process configuration options.
+CONFIG_FLAGS = -DCMAKE_VERBOSE_MAKEFILE=1
+ifeq ($(gklib_path), not-set)
+    gklib_path = GKlib
+endif
+CONFIG_FLAGS += -DGKLIB_PATH=$(abspath $(gklib_path))
+ifneq ($(gdb), not-set)
+    CONFIG_FLAGS += -DGDB=$(gdb)
+endif
+ifneq ($(assert), not-set)
+    CONFIG_FLAGS += -DASSERT=$(assert)
+endif
+ifneq ($(assert2), not-set)
+    CONFIG_FLAGS += -DASSERT2=$(assert2)
+endif
+ifneq ($(debug), not-set)
+    CONFIG_FLAGS += -DDEBUG=$(debug)
+endif
+ifneq ($(gprof), not-set)
+    CONFIG_FLAGS += -DGPROF=$(gprof)
+endif
+ifneq ($(openmp), not-set)
+    CONFIG_FLAGS += -DOPENMP=$(openmp)
+endif
+ifneq ($(prefix), not-set)
+    CONFIG_FLAGS += -DCMAKE_INSTALL_PREFIX=$(prefix)
+endif
+ifneq ($(windows), not-set)
+    CONFIG_FLAGS += -DMSVC=0
+endif
+ifneq ($(shared), not-set)
+    CONFIG_FLAGS += -DSHARED=1 -DCMAKE_SHARED_LINKER_FLAGS=-Wl,--no-undefined
+endif
+ifneq ($(cc), not-set)
+    CONFIG_FLAGS += -DCMAKE_C_COMPILER=$(cc)
+endif
+ifneq ($(cxx), not-set)
+    CONFIG_FLAGS += -DCMAKE_CXX_COMPILER=$(cxx)
+endif
+ifneq ($(ar), not-set)
+    CONFIG_FLAGS += -DCMAKE_AR=$(ar)
+endif
+ifneq ($(gcc-ar), not-set)
+    CONFIG_FLAGS += -DCMAKE_C_COMPILER_AR=$(gcc-ar) -DCMAKE_CXX_COMPILER_AR=$(gcc-ar)
+endif
+ifneq ($(ranlib), not-set)
+    CONFIG_FLAGS += -DCMAKE_RANLIB=$(ranlib)
+endif
+ifneq ($(gcc-ranlib), not-set)
+    CONFIG_FLAGS += -DCMAKE_C_COMPILER_RANLIB=$(gcc-ranlib) -DCMAKE_CXX_COMPILER_RANLIB=$(gcc-ranlib)
+endif
+ifneq ($(linker), not-set)
+    CONFIG_FLAGS += -DCMAKE_LINKER=$(linker)
+endif
+ifneq ($(nm), not-set)
+    CONFIG_FLAGS += -DCMAKE_NM=$(nm)
+endif
+ifneq ($(objcopy), not-set)
+    CONFIG_FLAGS += -DCMAKE_OBJCOPY=$(objcopy)
+endif
+ifneq ($(objdump), not-set)
+    CONFIG_FLAGS += -DCMAKE_OBJDUMP=$(objdump)
+endif
+ifneq ($(rc), not-set)
+    CONFIG_FLAGS += -DCMAKE_RC_COMPILER=$(rc)
+endif
+ifneq ($(strip), not-set)
+    CONFIG_FLAGS += -DCMAKE_STRIP=$(strip)
+endif
+
+VERNUM=5.1.0
+PKGNAME=metis-$(VERNUM)
+
+define run-config
+mkdir -p $(BUILDDIR)
+cd $(BUILDDIR) && cmake $(CURDIR) $(CONFIG_FLAGS)
+endef
+
+all clean install:
+	@if [ ! -f $(BUILDDIR)/Makefile ]; then \
+		more BUILD.txt; \
+	else \
+	  	make -C $(BUILDDIR) $@ $(MAKEFLAGS); \
+	fi
+
+uninstall:
+	xargs rm < $(BUILDDIR)/install_manifest.txt
+
+config: distclean
+	$(run-config)
+
+distclean:
+	rm -rf $(BUILDDIR)
+
+remake:
+	find . -name CMakeLists.txt -exec touch {} ';'
+
+dist:
+	utils/mkdist.sh $(PKGNAME)
+
+.PHONY: config distclean all clean install uninstall remake dist
Index: /issm/trunk/externalpackages/metis/install-5-win-msys2-gcc.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-5-win-msys2-gcc.sh	(revision 26744)
+++ /issm/trunk/externalpackages/metis/install-5-win-msys2-gcc.sh	(revision 26744)
@@ -0,0 +1,68 @@
+#!/bin/bash
+set -eu
+
+
+# TODO
+# - Move installation of GKlib to $PREFIX to Makefile instead of simply copying 
+#	it
+#
+
+## Constants
+#
+VER=5.1.0
+
+PREFIX="${ISSM_DIR}/externalpackages/metis/install"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/metis-${VER}.tar.gz" "metis-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf metis-$VER.tar.gz
+
+# Move source into 'src' directory
+mv metis-${VER}/* src
+rm -rf metis-${VER}
+
+# Copy customized source and configuration files to 'src' directory
+cp configs/5.1/win/msys2/Makefile src
+cp configs/5.1/win/msys2/gcc/GKlib/gk_arch.h src/GKlib
+cp configs/5.1/win/msys2/gcc/GKlib/gk_getopt.h src/GKlib
+
+# Configure
+cd src
+make config \
+	prefix=${PREFIX} \
+	shared=1 \
+	cc=/usr/bin/gcc \
+	cxx=/usr/bin/g++
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+
+# Install GKlib
+cp -R GKlib ${PREFIX}
+
+# Create link to shared version of library so that libtool can find it
+#
+# NOTE: MSYS2 needs to be run as administrator for this to work.
+#
+cd ${PREFIX}/lib
+ln -s ./msys-metis.dll ./libmetis.dll
+
+# Create link to lib directory (PETSc, by default, looks for libraries in 
+# lib64/ if it detects that 64-bit integers are being used)
+#
+# NOTE: MSYS2 needs to be run as administrator for this to work.
+#
+cd ${PREFIX}
+ln -s ./lib ./lib64
Index: /issm/trunk/externalpackages/metis/install-5-win-msys2-mingw.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-5-win-msys2-mingw.sh	(revision 26744)
+++ /issm/trunk/externalpackages/metis/install-5-win-msys2-mingw.sh	(revision 26744)
@@ -0,0 +1,65 @@
+#!/bin/bash
+set -eu
+
+
+# TODO
+# - Move installation of GKlib to $PREFIX to Makefile instead of simply copying 
+#	it
+#
+
+## Constants
+#
+VER=5.1.0
+
+PREFIX="${ISSM_DIR}/externalpackages/metis/install"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/metis-${VER}.tar.gz" "metis-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf metis-$VER.tar.gz
+
+# Move source into 'src' directory
+mv metis-${VER}/* src
+rm -rf metis-${VER}
+
+# Copy customized source and configuration files to 'src' directory
+cp configs/5.1/win/msys2/Makefile src
+cp configs/5.1/win/msys2/GKlib/gk_arch.h src/GKlib
+cp configs/5.1/win/msys2/GKlib/gk_getopt.h src/GKlib
+
+# Configure
+cd src
+make config \
+	prefix=${PREFIX} \
+	shared=1 \
+	cc=/mingw64/bin/gcc \
+	cxx=/mingw64/bin/g++
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+
+# Install GKlib
+cp -R GKlib ${PREFIX}
+
+# Create link to lib directory (PETSc, by default, looks for libraries in 
+# lib64/ if it detects that 64-bit integers are being used)
+#
+# NOTE: MSYS2 needs to be run as administrator for this to work.
+#
+cd ${PREFIX}
+ln -s ./lib ./lib64
+
+# Create link to shared version of library so that libtool can find it
+cd ${PREFIX}/lib
+ln -s libmetis.so libmetis.dll
Index: /issm/trunk/externalpackages/mingw-mex/README
===================================================================
--- /issm/trunk/externalpackages/mingw-mex/README	(revision 26744)
+++ /issm/trunk/externalpackages/mingw-mex/README	(revision 26744)
@@ -0,0 +1,55 @@
+This directory contains instructions (this file) and supporting files for 
+setting up mex to use MinGW compilers to produce MEX-files.
+
+NOTE: This does not apply to the 'MATLAB Support for MinGW-w64 C/C++ Compiler' 
+Add-On: what we are concerned with here is setting mex to use external MinGW 
+compilers.
+
+==========================================
+Setup MinGW compilers to produce MEX files
+==========================================
+- Start an instance of MATLAB
+- Navigate to $ISSM_DIR/externalpackages/mingw-mex
+- In the MATLAB Command Window run,
+
+	>> configuremingw
+
+- In the resulting prompt, navigate to the root MinGW gcc directory (if you 
+have followed the Windows installation instructions on our Web site, 
+https://issm.jpl.nasa.gov/download/windows, this should be 
+'C:\msys64\mingw64').
+- Verify that configuration was successful,
+
+	>> mex -setup C
+	MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.
+	>> mex -setup C++
+	MEX configured to use 'MinGW64 Compiler (C++)' for C++ language compilation.
+
+If configuration was unsuccessful, see if a new version of configuremingw.p is 
+available at,
+
+	https://www.mathworks.com/matlabcentral/answers/313298-i-already-have-mingw-on-my-computer-how-do-i-configure-it-to-work-with-matlab
+
+If so, please notify us on the ISSM Forum at https://issm.ess.uci.edu/forum so 
+that we can update the file in our repository.
+
+=========================
+Building yprime.c Example
+=========================
+- Start an instance of MATLAB
+- Navigate to $ISSM_DIR/externalpackages/mingw-mex
+- In the MATLAB Command Window run,
+
+	>> copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'),'.','f')
+	>> mex yprime.c
+
+- Test the generate MEX file with,
+
+	>> yprime(1,1:4)
+
+	ans =
+
+	    2.0000    8.9685    4.0000   -1.0947
+
+Sources:
+- https://www.mathworks.com/help/matlab/matlab_external/install-mingw-support-package.html
Index: /issm/trunk/externalpackages/mpich/install-3.2-mac-static.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-3.2-mac-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/mpich/install-3.2-mac-static.sh	(revision 26744)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich-3.2.tar.gz' 'mpich-3.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich-3.2.tar.gz' 'mpich-3.2.tar.gz'
 
 #Untar
Index: /issm/trunk/externalpackages/mplapack/install-0-linux.sh
===================================================================
--- /issm/trunk/externalpackages/mplapack/install-0-linux.sh	(revision 26744)
+++ /issm/trunk/externalpackages/mplapack/install-0-linux.sh	(revision 26744)
@@ -0,0 +1,73 @@
+#!/bin/bash
+set -eu
+
+##
+# Source code and installation guidelines available at,
+#
+#	https://github.com/nakatamaho/mplapack
+#
+# Note that original website (for MPACK) at,
+#
+#	http://mplapack.sourceforge.net
+#
+# is not maintained.
+#
+
+## Constants
+#
+VER="0.9.3"
+
+PREFIX="${ISSM_DIR}/externalpackages/mplapack/install" # Set to location where external package should be installed
+
+## Environment
+#
+export CC=gcc
+export CXX=g++
+export FC=gfortran
+export F77=gfortran
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
+
+# Download source
+${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/mplapack-${VER}.tar.gz" "mplapack-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf mplapack-${VER}.tar.gz
+
+# Move source to 'src' directory
+mv mplapack-${VER}/* src
+rm -rf mplapack-${VER}
+
+# Configure
+cd src
+pushd mplapack/debug
+bash gen.Makefile.am.sh
+popd
+autoreconf -ivf
+./configure \
+	--prefix="${PREFIX}" \
+	--disable-static \
+	--enable-fast-install=yes \
+	--disable-dependency-tracking \
+	--enable-debug=yes \
+	--enable-fortranwrapper=yes \
+	--enable-gmp=yes \
+	--enable-mpfr=yes \
+	--enable-qd=yes \
+	--enable-dd=yes \
+	--enable-double=yes \
+	--enable-_Float128=yes \
+	--enable-_Float64x=yes \
+	--with-external-blas="-L${BLAS_ROOT}/lib -lfblas" \
+	--with-external-lapack="-L${LAPACK_ROOT}/lib -lflapack"
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
Index: /issm/trunk/externalpackages/msmpi/install.sh
===================================================================
--- /issm/trunk/externalpackages/msmpi/install.sh	(revision 26744)
+++ /issm/trunk/externalpackages/msmpi/install.sh	(revision 26744)
@@ -0,0 +1,55 @@
+#!/bin/bash
+#
+# Creates a local MS-MPI directory to be used for supplying MPI headers files 
+# and libraries to ISSM configuration and certain external packages.
+#
+# Assumes that Microsoft MPI and MPI SDK have been installed. To do so,
+# - Navigate to https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi
+# - Under the 'MS-MPI Downloads' heading, click the link for 
+#	'MS-MPI v<version>', where <version> is the latest version available (as of 
+#	this writing, 10.1.2)
+# - Click the 'Download' button
+# - Make sure both boxes are checked
+# - Click the 'Save File' button in each prompt
+# - When the downloads are complete, run each installer
+#
+# TODO:
+# - Commit Microsoft MPI and Microsoft SDK installers or source code to 
+#	external packages source repository, then update this documentation to note 
+#	that they are available
+# - Attempt to download Microsoft MPI and Microsoft SDK installers or source 
+#	code and (compile and) install with this script
+# - Alternatively, instruct users to install MSYS2 MinGW 64-bit MS-MPI package 
+#	with,
+#
+#		pacman -S mingw-w64-x86_64-msmpi
+#
+# remove this script, its parent directory, and references to it from 
+# configuration files in $ISSM_DIR/jenkins directory and documentation
+#
+
+
+## Constants
+#
+PREFIX="${ISSM_DIR}/externalpackages/msmpi/install"
+
+MSMPI_LIB="/c/Windows/System32/msmpi.dll"
+MSMPI_INC=$(cygpath -u $(cygpath -ms "/c/Program Files (x86)/Microsoft SDKs/MPI/Include"))
+
+# Cleanup
+rm -rf ${PREFIX}
+mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib
+
+# Copy MS-MPI header files to 'include' directory
+cp ${MSMPI_INC}/mpi.h ${PREFIX}/include
+cp ${MSMPI_INC}/mpi.f90 ${PREFIX}/include
+cp ${MSMPI_INC}/mpif.h ${PREFIX}/include
+cp ${MSMPI_INC}/mpio.h ${PREFIX}/include
+cp ${MSMPI_INC}/x64/mpifptr.h ${PREFIX}/include
+
+# Copy MS-MPI library to 'lib' directory
+cp ${MSMPI_LIB} ${PREFIX}/lib
+
+# Create link to shared library so that libtool can find it
+cd ${PREFIX}/lib
+ln -s msmpi.dll libmsmpi.dll
Index: /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/Makefile.inc
===================================================================
--- /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/Makefile.inc	(revision 26744)
+++ /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/Makefile.inc	(revision 26744)
@@ -0,0 +1,189 @@
+#
+#  This file is part of MUMPS 5.3.5, released
+#  on Thu Oct 22 09:29:08 UTC 2020
+#
+################################################################################
+#
+#   Makefile.inc.generic
+#
+#   This defines some parameters dependent on your platform; you should
+#   look for the approriate file in the directory ./Make.inc/ and copy it
+#   into a file called Makefile.inc. For example, from the MUMPS root
+#   directory, use 
+#   "cp Make.inc/Makefile.inc.generic ./Makefile.inc"
+#   (see the main README file for details)
+#
+#   If you do not find any suitable Makefile in Makefile.inc, use this file:
+#   "cp Make.inc/Makefile.inc.generic ./Makefile.inc" and modify it according
+#   to the comments given below. If you manage to build MUMPS on a new platform,
+#   and think that this could be useful to others, you may want to send us
+#   the corresponding Makefile.inc file.
+#
+################################################################################
+
+
+########################################################################
+#Begin orderings
+#
+# NOTE that PORD is distributed within MUMPS by default. It is recommended to
+# install other orderings. For that, you need to obtain the corresponding package
+# and modify the variables below accordingly.
+# For example, to have Metis available within MUMPS:
+#          1/ download Metis and compile it
+#          2/ uncomment (suppress # in first column) lines
+#             starting with LMETISDIR,  LMETIS
+#          3/ add -Dmetis in line ORDERINGSF
+#             ORDERINGSF  = -Dpord -Dmetis
+#          4/ Compile and install MUMPS
+#             make clean; make   (to clean up previous installation)
+#
+#          Metis/ParMetis and SCOTCH/PT-SCOTCH (ver 6.0 and later) orderings are recommended.
+#
+
+#SCOTCHDIR  = ${HOME}/scotch_6.0
+#ISCOTCH    = -I$(SCOTCHDIR)/include
+#
+# You have to choose one among the following two lines depending on
+# the type of analysis you want to perform. If you want to perform only
+# sequential analysis choose the first (remember to add -Dscotch in the ORDERINGSF
+# variable below); for both parallel and sequential analysis choose the second 
+# line (remember to add -Dptscotch in the ORDERINGSF variable below)
+
+#LSCOTCH    = -L$(SCOTCHDIR)/lib -lesmumps -lscotch -lscotcherr
+#LSCOTCH    = -L$(SCOTCHDIR)/lib -lptesmumps -lptscotch -lptscotcherr
+
+
+LPORDDIR = $(topdir)/PORD/lib
+IPORD    = -I$(topdir)/PORD/include
+LPORD    = -L$(LPORDDIR) -lpord
+
+LMSMPIDIR = ${MSMPI_ROOT}/lib
+IMSMPIDIR = -I${MSMPI_ROOT}/include
+
+#LMETISDIR = /opt/metis-5.1.0/build/Linux-x86_64/libmetis
+#IMETIS    = /opt/metis-5.1.0/include
+
+# You have to choose one among the following two lines depending on
+# the type of analysis you want to perform. If you want to perform only
+# sequential analysis choose the first (remember to add -Dmetis in the ORDERINGSF
+# variable below); for both parallel and sequential analysis choose the second 
+# line (remember to add -Dparmetis in the ORDERINGSF variable below)
+
+#LMETIS    = -L$(LMETISDIR) -lmetis
+#LMETIS    = -L$(LMETISDIR) -lparmetis -lmetis
+
+LMETISDIR		= ${METIS_ROOT}/lib
+IMETIS			= -I${METIS_ROOT}/include
+LPARMETISDIR	= ${PARMETIS_ROOT}/lib
+IPARMETIS		= -I${PARMETIS_ROOT}/include
+
+LMETIS    = -L$(LPARMETISDIR) -lparmetis -L$(LMSMPIDIR) -lmsmpi -L$(LMETISDIR) -lmetis
+
+# The following variables will be used in the compilation process.
+# Please note that -Dptscotch and -Dparmetis imply -Dscotch and -Dmetis respectively.
+# If you want to use Metis 4.X or an older version, you should use -Dmetis4 instead of -Dmetis
+# or in addition with -Dparmetis (if you are using parmetis 3.X or older).
+#ORDERINGSF = -Dscotch -Dmetis -Dpord -Dptscotch -Dparmetis
+#ORDERINGSF  = -Dpord
+ORDERINGSF  = -Dmetis -Dpord -Dparmetis
+ORDERINGSC  = $(ORDERINGSF)
+
+# LORDERINGS = $(LMETIS) $(LPORD) $(LSCOTCH)
+# IORDERINGSF = $(ISCOTCH)
+# IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH)
+LORDERINGS = $(LPARMETIS) $(LMETIS)  $(LPORD) $(LSCOTCH)
+IORDERINGSF = $(ISCOTCH)
+IORDERINGSC = $(IPARMETIS) $(IMETIS) $(IPORD) $(ISCOTCH)
+
+#End orderings
+########################################################################
+
+########################################################################
+# DEFINE HERE SOME COMMON COMMANDS, THE COMPILER NAMES, ETC...
+
+# PLAT : use it to add a default suffix to the generated libraries
+PLAT    = 
+# Library extension, + C and Fortran "-o" option
+# may be different under Windows
+LIBEXT  = .dll
+OUTC    = -o 
+OUTF    = -o 
+# RM : remove files
+RM      = /usr/bin/rm -f
+# CC : C compiler
+CC      = /usr/bin/gcc
+# FC : Fortran 90 compiler
+FC      = /usr/bin/gfortran
+# FL : Fortran linker
+FL      = /usr/bin/gfortran
+# AR : Archive object in a library
+#      keep a space at the end if options have to be separated from lib name
+AR      = /usr/bin/ar cr 
+# RANLIB : generate index of an archive file
+#   (optionnal use "RANLIB = echo" in case of problem)
+RANLIB  = /usr/bin/ranlib
+#RANLIB  = echo
+
+# DEFINE HERE YOUR LAPACK LIBRARY
+
+LAPACK = -L${LAPACK_ROOT}/lib -llapack
+
+# SCALAP should define the SCALAPACK and BLACS libraries.
+SCALAP  = -L${SCALAPACK_ROOT}/lib -lscalapack
+
+# INCLUDE DIRECTORY FOR MPI
+INCPAR  = $(IMSMPIDIR)
+
+# LIBRARIES USED BY THE PARALLEL VERSION OF MUMPS: $(SCALAP) and MPI
+LIBPAR  = $(SCALAP) $(LAPACK) -L$(LMSMPIDIR) -lmsmpi
+
+# The parallel version is not concerned by the next two lines.
+# They are related to the sequential library provided by MUMPS,
+# to use instead of ScaLAPACK and MPI.
+INCSEQ  = -I$(topdir)/libseq
+LIBSEQ  = $(LAPACK) -L$(topdir)/libseq -lmpiseq
+
+# DEFINE HERE YOUR BLAS LIBRARY
+
+LIBBLAS = -L${BLAS_ROOT}/lib -lblas
+
+# DEFINE HERE YOUR PTHREAD LIBRARY
+LIBOTHERS = -lpthread
+
+# FORTRAN/C COMPATIBILITY:
+#  Use:
+#    -DAdd_ if your Fortran compiler adds an underscore at the end
+#              of symbols,
+#     -DAdd__ if your Fortran compiler adds 2 underscores,
+#
+#     -DUPPER if your Fortran compiler uses uppercase symbols
+#
+#     leave empty if your Fortran compiler does not change the symbols.
+#
+
+CDEFS = -DAdd_
+
+#COMPILER OPTIONS
+#
+# NOTE:
+# - Added -fallow-argument-mismatch option to OPTF in order to clear "Error: 
+#	Rank mismatch between actual argument at [...]"
+# - Added -fallow-invalid-boz option to OPTF in order to clear "Error: BOZ 
+#	literal constant at [...]"
+#
+OPTF    = -O -fPIC -fallow-argument-mismatch -fallow-invalid-boz
+OPTC    = -O -fPIC -I.
+OPTL    = -O
+
+# CHOOSE BETWEEN USING THE SEQUENTIAL OR THE PARALLEL VERSION.
+
+#Sequential:
+#INCS = $(INCSEQ)
+#LIBS = $(LIBSEQ)
+#LIBSEQNEEDED = libseqneeded
+
+#Parallel:
+INCS = $(INCPAR)
+LIBS = $(LIBPAR)
+LIBSEQNEEDED = libseqneeded # NOTE: Create libmpiseq because PETSc looks for it (rather than patching PETSc config tests)
+
Index: /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/PORD/lib/Makefile
===================================================================
--- /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/PORD/lib/Makefile	(revision 26744)
+++ /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/PORD/lib/Makefile	(revision 26744)
@@ -0,0 +1,34 @@
+
+# To compile directly, uncomment the line below.
+# include ../Make.in
+#
+# Otherwise, adequate variables for CC, CFLAGS, AR and RANLIB must be passed to 
+# make.
+#
+
+INCLUDES = -I../include
+
+# NOTE:
+#- CFLAGS = $(OPTC) (see ../../src/Makefile; OPTC is set in ../../Makefile.inc)
+#
+COPTIONS = $(INCLUDES) $(CFLAGS) $(OPTFLAGS)
+
+OBJS = graph.o gbipart.o gbisect.o ddcreate.o ddbisect.o nestdiss.o \
+       multisector.o gelim.o bucket.o tree.o \
+       symbfac.o interface.o sort.o minpriority.o 
+
+# NOTE: numfac.c read.c mapping.c triangular.c matrix.c kernel.c were not 
+# directly used by MUMPS and have been removed from the original SPACE 
+# package.
+
+.c.o:
+	$(CC) $(COPTIONS) -c $*.c $(OUTC) $*.o
+
+libpord$(LIBEXT):$(OBJS)
+	$(CC) -shared $(OUTC) $@ $(OBJS)
+
+clean:
+	$(RM) *.o
+
+realclean:
+	$(RM) *.o libpord*
Index: /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/libseq/Makefile
===================================================================
--- /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/libseq/Makefile	(revision 26744)
+++ /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/libseq/Makefile	(revision 26744)
@@ -0,0 +1,25 @@
+#
+#  This file is part of MUMPS 5.3.5, released
+#  on Thu Oct 22 09:29:08 UTC 2020
+#
+all: libmpiseq
+
+.PHONY: all libmpiseq clean
+
+include ../Makefile.inc
+
+libmpiseq: libmpiseq$(PLAT)$(LIBEXT)
+
+# NOTE:
+# - We need to use Fortran compiler or otherwise link in Fortran libraries 
+#   using C compiler (which does not make a lot of sense, but is possible)
+#
+libmpiseq$(PLAT)$(LIBEXT): mpi.o mpic.o elapse.o
+	$(FC) -shared $(OUTF) $@ mpi.o mpic.o elapse.o
+.f.o:
+	$(FC) $(OPTF)              -c $*.f $(OUTF)$*.o
+.c.o:
+	$(CC) $(OPTC) $(CDEFS) -I. -c $*.c $(OUTC)$*.o
+
+clean:
+	$(RM) *.o *$(LIBEXT)
Index: /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/src/Makefile
===================================================================
--- /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/src/Makefile	(revision 26744)
+++ /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/src/Makefile	(revision 26744)
@@ -0,0 +1,425 @@
+#
+#  This file is part of MUMPS 5.3.5, released
+#  on Thu Oct 22 09:29:08 UTC 2020
+#
+#
+topdir = ..
+libdir = $(topdir)/lib
+incdir = $(topdir)/include
+
+default: d
+
+.PHONY: default s d c z mumps_lib clean
+
+s:
+	$(MAKE) ARITH=s mumps_lib
+d:
+	$(MAKE) ARITH=d mumps_lib
+c:
+	$(MAKE) ARITH=c mumps_lib
+z:
+	$(MAKE) ARITH=z mumps_lib
+
+include $(topdir)/Makefile.inc
+
+mumps_lib:    $(incdir)/mumps_int_def.h \
+              $(libdir)/libmumps_common$(PLAT)$(LIBEXT) \
+              $(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT)
+
+# Build $(incdir)/mumps_int_def.h, needed by mumps_c_types.h
+$(incdir)/mumps_int_def.h: build_mumps_int_def 
+	./build_mumps_int_def > $(incdir)/mumps_int_def.h
+build_mumps_int_def:build_mumps_int_def.o
+	$(CC) $(OPTL) build_mumps_int_def.o -o build_mumps_int_def
+
+OBJS_COMMON_MOD = \
+        ana_omp_m.o\
+        ana_blk_m.o\
+        ana_orderings_wrappers_m.o\
+        double_linked_list.o\
+        fac_asm_build_sort_index_ELT_m.o\
+        fac_asm_build_sort_index_m.o\
+        fac_descband_data_m.o\
+        fac_future_niv2_mod.o\
+        fac_ibct_data_m.o\
+        fac_maprow_data_m.o\
+        front_data_mgt_m.o\
+        lr_common.o \
+        mumps_comm_ibcast.o\
+        mumps_l0_omp_m.o\
+        mumps_memory_mod.o\
+        mumps_mpitoomp_m.o\
+        mumps_ooc_common.o\
+        mumps_static_mapping.o\
+        omp_tps_common_m.o
+
+
+OBJS_COMMON_OTHER = \
+        ana_blk.o\
+        ana_orderings.o\
+        ana_set_ordering.o\
+        ana_AMDMF.o\
+        bcast_errors.o\
+        estim_flops.o\
+        mumps_type_size.o \
+        mumps_type2_blocking.o \
+        mumps_version.o \
+        mumps_print_defined.o \
+        mumps_common.o\
+        mumps_pord.o\
+        mumps_metis.o\
+        mumps_metis64.o\
+        mumps_metis_int.o\
+        mumps_scotch.o\
+        mumps_scotch64.o\
+        mumps_scotch_int.o\
+        mumps_size.o\
+        mumps_io.o\
+        mumps_io_basic.o\
+        mumps_io_thread.o\
+        mumps_io_err.o\
+        mumps_numa.o \
+        mumps_thread.o \
+        mumps_save_restore_C.o \
+        mumps_config_file_C.o \
+        mumps_thread_affinity.o \
+        tools_common.o \
+        sol_common.o
+
+OBJS_MOD =   \
+        $(ARITH)ana_aux.o \
+        $(ARITH)ana_aux_par.o \
+        $(ARITH)ana_lr.o\
+        $(ARITH)fac_asm_master_ELT_m.o\
+        $(ARITH)fac_asm_master_m.o\
+        $(ARITH)fac_front_aux.o\
+        $(ARITH)fac_front_LU_type1.o\
+        $(ARITH)fac_front_LU_type2.o\
+        $(ARITH)fac_front_LDLT_type1.o\
+        $(ARITH)fac_front_LDLT_type2.o\
+        $(ARITH)fac_front_type2_aux.o\
+        $(ARITH)fac_sispointers_m.o\
+        $(ARITH)fac_lr.o\
+        $(ARITH)fac_mem_dynamic.o\
+        $(ARITH)fac_omp_m.o\
+        $(ARITH)fac_par_m.o\
+        $(ARITH)fac_sol_l0omp_m.o\
+        $(ARITH)lr_core.o\
+        $(ARITH)lr_stats.o\
+        $(ARITH)lr_type.o\
+        $(ARITH)mumps_comm_buffer.o\
+        $(ARITH)mumps_config_file.o\
+        $(ARITH)mumps_load.o\
+        $(ARITH)mumps_lr_data_m.o\
+        $(ARITH)mumps_ooc_buffer.o\
+        $(ARITH)mumps_ooc.o\
+        $(ARITH)mumps_sol_es.o\
+        $(ARITH)mumps_save_restore.o\
+        $(ARITH)mumps_save_restore_files.o\
+        $(ARITH)mumps_struc_def.o\
+        $(ARITH)omp_tps_m.o\
+        $(ARITH)sol_lr.o\
+        $(ARITH)sol_omp_m.o\
+        $(ARITH)static_ptr_m.o
+
+OBJS_OTHER = \
+        $(ARITH)ini_driver.o\
+        $(ARITH)ana_driver.o\
+        $(ARITH)fac_driver.o\
+        $(ARITH)sol_driver.o\
+        $(ARITH)sol_distrhs.o\
+        $(ARITH)end_driver.o\
+        $(ARITH)ana_aux_ELT.o\
+        $(ARITH)ana_dist_m.o\
+        $(ARITH)ana_LDLT_preprocess.o\
+        $(ARITH)ana_reordertree.o\
+        $(ARITH)arrowheads.o\
+        $(ARITH)bcast_int.o\
+        $(ARITH)fac_asm_ELT.o\
+        $(ARITH)fac_asm.o\
+        $(ARITH)fac_b.o\
+        $(ARITH)fac_distrib_distentry.o\
+        $(ARITH)fac_distrib_ELT.o\
+        $(ARITH)fac_lastrtnelind.o\
+        $(ARITH)fac_mem_alloc_cb.o\
+        $(ARITH)fac_mem_compress_cb.o\
+        $(ARITH)fac_mem_free_block_cb.o\
+        $(ARITH)fac_mem_stack_aux.o\
+        $(ARITH)fac_mem_stack.o\
+        $(ARITH)fac_process_band.o\
+        $(ARITH)fac_process_blfac_slave.o\
+        $(ARITH)fac_process_blocfacto_LDLT.o\
+        $(ARITH)fac_process_blocfacto.o\
+        $(ARITH)fac_process_bf.o\
+        $(ARITH)fac_process_end_facto_slave.o\
+        $(ARITH)fac_process_contrib_type1.o\
+        $(ARITH)fac_process_contrib_type2.o\
+        $(ARITH)fac_process_contrib_type3.o\
+        $(ARITH)fac_process_maprow.o\
+        $(ARITH)fac_process_master2.o\
+        $(ARITH)fac_process_message.o\
+        $(ARITH)fac_process_root2slave.o\
+        $(ARITH)fac_process_root2son.o\
+        $(ARITH)fac_process_rtnelind.o\
+        $(ARITH)fac_root_parallel.o\
+        $(ARITH)fac_scalings.o\
+        $(ARITH)fac_determinant.o\
+        $(ARITH)fac_scalings_simScaleAbs.o\
+        $(ARITH)fac_scalings_simScale_util.o\
+        $(ARITH)fac_sol_pool.o\
+        $(ARITH)fac_type3_symmetrize.o\
+        $(ARITH)ini_defaults.o\
+        $(ARITH)mumps_c.o\
+        $(ARITH)mumps_driver.o\
+        $(ARITH)mumps_f77.o\
+        $(ARITH)mumps_gpu.o\
+        $(ARITH)mumps_iXamax.o\
+        $(ARITH)ana_mtrans.o\
+        $(ARITH)ooc_panel_piv.o\
+        $(ARITH)rank_revealing.o\
+        $(ARITH)sol_aux.o\
+        $(ARITH)sol_bwd_aux.o\
+        $(ARITH)sol_bwd.o\
+        $(ARITH)sol_c.o\
+        $(ARITH)sol_fwd_aux.o\
+        $(ARITH)sol_fwd.o\
+        $(ARITH)sol_matvec.o\
+        $(ARITH)sol_root_parallel.o\
+        $(ARITH)tools.o\
+        $(ARITH)type3_root.o
+
+# NOTE:
+# - We need to use Fortran compiler or otherwise link in Fortran libraries 
+#	using C compiler (which does not make a lot of sense, but is possible)
+# - In case of "Makefile:[line_number]: *** missing separator.  Stop.", ensure 
+#	that $(FC) is preceded by a tab and not four spaces
+#
+$(libdir)/libmumps_common$(PLAT)$(LIBEXT):      $(OBJS_COMMON_MOD) $(OBJS_COMMON_OTHER)
+	$(FC) -shared $(OUTF) $@ \
+		$? $(LORDERINGS) $(LIBS) $(LIBLAPACK) $(LIBBLAS) $(LIBOTHERS) \
+		-Wl,--out-implib=$(libdir)/libmumps_common$(PLAT).dll.a
+
+$(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT):    $(OBJS_MOD) $(OBJS_OTHER)
+	$(FC) -shared $(OUTF) $@ \
+		$? -L$(libdir) -lmumps_common$(PLAT) $(LORDERINGS) $(LIBS) $(LIBLAPACK) $(LIBBLAS) $(LIBOTHERS) \
+		-Wl,--out-implib=$(libdir)/lib$(ARITH)mumps$(PLAT).dll.a
+
+# Dependencies between modules:
+# i) arithmetic-dependent modules:
+$(ARITH)ana_aux.o:              $(ARITH)mumps_struc_def.o \
+                                mumps_static_mapping.o \
+                                ana_orderings_wrappers_m.o \
+                                ana_blk_m.o
+$(ARITH)ana_aux_par.o:          $(ARITH)mumps_struc_def.o \
+                                mumps_memory_mod.o \
+                                ana_orderings_wrappers_m.o
+$(ARITH)ana_lr.o:                $(ARITH)lr_core.o\
+                                $(ARITH)lr_stats.o\
+                                lr_common.o\
+                                ana_orderings_wrappers_m.o \
+                                ana_blk_m.o 
+$(ARITH)fac_asm_master_ELT_m.o: omp_tps_common_m.o \
+                                fac_ibct_data_m.o \
+                                fac_asm_build_sort_index_ELT_m.o \
+                                lr_common.o \
+                                $(ARITH)fac_mem_dynamic.o \
+                                $(ARITH)lr_core.o \
+                                $(ARITH)ana_lr.o \
+                                $(ARITH)mumps_lr_data_m.o \
+                                $(ARITH)mumps_struc_def.o \
+                                $(ARITH)omp_tps_m.o \
+                                $(ARITH)mumps_comm_buffer.o \
+                                $(ARITH)mumps_load.o
+$(ARITH)fac_asm_master_m.o:     omp_tps_common_m.o \
+                                fac_ibct_data_m.o \
+                                fac_asm_build_sort_index_m.o \
+                                lr_common.o \
+                                $(ARITH)fac_mem_dynamic.o \
+                                $(ARITH)lr_core.o \
+                                $(ARITH)ana_lr.o \
+                                $(ARITH)mumps_lr_data_m.o \
+                                $(ARITH)mumps_struc_def.o \
+                                $(ARITH)omp_tps_m.o \
+                                $(ARITH)mumps_comm_buffer.o \
+                                $(ARITH)mumps_load.o
+
+$(ARITH)fac_front_aux.o:        $(ARITH)lr_type.o\
+                                $(ARITH)lr_stats.o\
+                                $(ARITH)mumps_comm_buffer.o\
+                                $(ARITH)mumps_load.o\
+                                $(ARITH)mumps_ooc.o\
+                                mumps_ooc_common.o\
+                                mumps_l0_omp_m.o
+
+$(ARITH)fac_front_LU_type1.o   : $(ARITH)fac_front_aux.o\
+                                 $(ARITH)mumps_ooc.o\
+                                 $(ARITH)fac_lr.o\
+                                 $(ARITH)lr_type.o\
+                                 $(ARITH)lr_stats.o\
+                                 $(ARITH)ana_lr.o\
+                                 $(ARITH)mumps_lr_data_m.o\
+                                 mumps_l0_omp_m.o
+
+$(ARITH)fac_front_LU_type2.o   : $(ARITH)fac_front_aux.o\
+                                 $(ARITH)fac_front_type2_aux.o\
+                                 $(ARITH)mumps_ooc.o\
+                                 $(ARITH)mumps_comm_buffer.o\
+                                 mumps_comm_ibcast.o\
+                                 $(ARITH)fac_lr.o\
+                                 $(ARITH)lr_core.o\
+                                 $(ARITH)lr_type.o\
+                                 $(ARITH)lr_stats.o\
+                                 $(ARITH)ana_lr.o\
+                                 $(ARITH)mumps_lr_data_m.o\
+                                 $(ARITH)mumps_struc_def.o
+
+$(ARITH)fac_front_LDLT_type1.o : $(ARITH)fac_front_aux.o\
+                                 $(ARITH)mumps_ooc.o\
+                                 $(ARITH)fac_lr.o\
+                                 $(ARITH)lr_type.o\
+                                 $(ARITH)lr_stats.o\
+                                 $(ARITH)ana_lr.o\
+                                 $(ARITH)mumps_lr_data_m.o\
+                                 mumps_l0_omp_m.o
+
+$(ARITH)fac_front_LDLT_type2.o : $(ARITH)fac_front_aux.o\
+                                 $(ARITH)fac_front_type2_aux.o\
+                                 $(ARITH)mumps_ooc.o\
+                                 $(ARITH)mumps_comm_buffer.o\
+                                 $(ARITH)mumps_load.o\
+                                 $(ARITH)fac_lr.o\
+                                 $(ARITH)lr_type.o\
+                                 $(ARITH)lr_stats.o\
+                                 $(ARITH)ana_lr.o\
+                                 $(ARITH)mumps_lr_data_m.o\
+                                 $(ARITH)mumps_struc_def.o
+
+$(ARITH)fac_front_type2_aux.o : mumps_ooc_common.o\
+                                $(ARITH)fac_front_aux.o\
+                                $(ARITH)lr_type.o\
+                                $(ARITH)mumps_struc_def.o\
+                                $(ARITH)mumps_comm_buffer.o\
+                                $(ARITH)mumps_load.o\
+                                mumps_comm_ibcast.o\
+                                fac_ibct_data_m.o
+
+$(ARITH)fac_lr.o:               $(ARITH)lr_core.o\
+                                $(ARITH)lr_type.o\
+                                $(ARITH)mumps_lr_data_m.o\
+                                $(ARITH)lr_stats.o
+
+$(ARITH)fac_mem_dynamic.o:      $(ARITH)mumps_load.o\
+                                $(ARITH)static_ptr_m.o
+
+$(ARITH)fac_omp_m.o:            $(ARITH)fac_asm_master_m.o\
+                                $(ARITH)fac_asm_master_ELT_m.o\
+                                $(ARITH)fac_front_LU_type1.o\
+                                $(ARITH)fac_front_LDLT_type1.o\
+                                $(ARITH)mumps_load.o\
+                                $(ARITH)omp_tps_m.o\
+                                $(ARITH)lr_stats.o\
+                                $(ARITH)mumps_struc_def.o\
+                                omp_tps_common_m.o\
+                                mumps_l0_omp_m.o
+
+$(ARITH)fac_sol_l0omp_m.o:      $(ARITH)mumps_struc_def.o
+
+$(ARITH)fac_omp_m.o:            $(ARITH)mumps_struc_def.o \
+                                $(ARITH)fac_mem_dynamic.o\
+                                $(ARITH)omp_tps_m.o\
+                                omp_tps_common_m.o
+
+$(ARITH)fac_par_m.o:            $(ARITH)mumps_load.o\
+                                $(ARITH)mumps_ooc.o\
+                                $(ARITH)fac_asm_master_m.o\
+                                $(ARITH)fac_asm_master_ELT_m.o\
+                                $(ARITH)omp_tps_m.o\
+                                $(ARITH)fac_front_LU_type1.o\
+                                $(ARITH)fac_front_LU_type2.o\
+                                $(ARITH)fac_front_LDLT_type1.o\
+                                $(ARITH)fac_front_LDLT_type2.o\
+                                $(ARITH)fac_mem_dynamic.o\
+                                $(ARITH)mumps_struc_def.o\
+                                $(ARITH)lr_stats.o\
+                                omp_tps_common_m.o\
+                                mumps_l0_omp_m.o
+
+$(ARITH)lr_core.o:              $(ARITH)lr_type.o\
+                                $(ARITH)mumps_lr_data_m.o\
+                                $(ARITH)lr_stats.o\
+                                lr_common.o
+
+$(ARITH)lr_stats.o:             $(ARITH)lr_type.o
+
+$(ARITH)mumps_comm_buffer.o:    mumps_comm_ibcast.o \
+                                $(ARITH)lr_type.o \
+                                $(ARITH)lr_core.o \
+                                $(ARITH)mumps_lr_data_m.o \
+                                fac_ibct_data_m.o
+
+$(ARITH)mumps_config_file.o:    $(ARITH)mumps_struc_def.o
+
+$(ARITH)mumps_load.o:           $(ARITH)mumps_comm_buffer.o \
+                                $(ARITH)mumps_struc_def.o \
+                                fac_future_niv2_mod.o
+
+$(ARITH)mumps_lr_data_m.o:      $(ARITH)lr_type.o\
+                                front_data_mgt_m.o
+
+$(ARITH)mumps_ooc_buffer.o:     mumps_ooc_common.o
+
+$(ARITH)mumps_ooc.o:            $(ARITH)mumps_struc_def.o \
+                                $(ARITH)mumps_ooc_buffer.o \
+                                mumps_ooc_common.o
+
+$(ARITH)mumps_sol_es.o:         $(ARITH)lr_type.o \
+                                $(ARITH)mumps_lr_data_m.o
+
+$(ARITH)mumps_save_restore.o:   $(ARITH)mumps_struc_def.o \
+                                $(ARITH)mumps_save_restore_files.o \
+                                $(ARITH)mumps_lr_data_m.o \
+                                $(ARITH)mumps_ooc.o \
+                                $(ARITH)fac_sol_l0omp_m.o \
+                                front_data_mgt_m.o
+
+$(ARITH)mumps_save_restore_files.o : $(ARITH)mumps_struc_def.o
+
+$(ARITH)sol_lr.o:               $(ARITH)lr_type.o\
+                                $(ARITH)lr_stats.o\
+                                $(ARITH)mumps_lr_data_m.o
+
+$(ARITH)sol_omp_m.o:            $(ARITH)mumps_struc_def.o
+
+
+
+
+
+# Dependencies between modules:
+# ii) arithmetic-independent modules:
+
+ana_omp_m.o:                     double_linked_list.o
+fac_asm_build_sort_index_ELT_m.o:omp_tps_common_m.o
+fac_asm_build_sort_index_m.o:    omp_tps_common_m.o
+fac_descband_data_m.o:           front_data_mgt_m.o
+fac_ibct_data_m.o:               front_data_mgt_m.o
+fac_maprow_data_m.o:             front_data_mgt_m.o
+mumps_comm_ibcast.o:             fac_future_niv2_mod.o
+mumps_static_mapping.o:          lr_common.o
+
+
+# Compile modules before the rest
+$(OBJS_COMMON_OTHER):$(OBJS_COMMON_MOD)
+$(OBJS_OTHER):$(OBJS_COMMON_MOD) $(OBJS_MOD)
+
+.SUFFIXES: .c .F .o
+.F.o:
+	$(FC) $(OPTF) -I. -I../include $(INCS) $(IORDERINGSF) $(ORDERINGSF) -c $*.F $(OUTF) $*.o
+.c.o:
+	$(CC) $(OPTC) -I../include $(INCS) $(CDEFS) $(IORDERINGSC) $(ORDERINGSC) -c $*.c $(OUTC) $*.o
+
+$(ARITH)mumps_c.o:	mumps_c.c
+	$(CC) $(OPTC) -I../include $(INCS) $(CDEFS) -DMUMPS_ARITH=MUMPS_ARITH_$(ARITH) \
+	      $(IORDERINGSC) $(ORDERINGSC) -c mumps_c.c $(OUTC) $@
+
+clean:
+	$(RM) *.o *.mod $(incdir)/mumps_int_def.h
Index: /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/Makefile.inc
===================================================================
--- /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/Makefile.inc	(revision 26744)
+++ /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/Makefile.inc	(revision 26744)
@@ -0,0 +1,189 @@
+#
+#  This file is part of MUMPS 5.3.5, released
+#  on Thu Oct 22 09:29:08 UTC 2020
+#
+################################################################################
+#
+#   Makefile.inc.generic
+#
+#   This defines some parameters dependent on your platform; you should
+#   look for the approriate file in the directory ./Make.inc/ and copy it
+#   into a file called Makefile.inc. For example, from the MUMPS root
+#   directory, use 
+#   "cp Make.inc/Makefile.inc.generic ./Makefile.inc"
+#   (see the main README file for details)
+#
+#   If you do not find any suitable Makefile in Makefile.inc, use this file:
+#   "cp Make.inc/Makefile.inc.generic ./Makefile.inc" and modify it according
+#   to the comments given below. If you manage to build MUMPS on a new platform,
+#   and think that this could be useful to others, you may want to send us
+#   the corresponding Makefile.inc file.
+#
+################################################################################
+
+
+########################################################################
+#Begin orderings
+#
+# NOTE that PORD is distributed within MUMPS by default. It is recommended to
+# install other orderings. For that, you need to obtain the corresponding package
+# and modify the variables below accordingly.
+# For example, to have Metis available within MUMPS:
+#          1/ download Metis and compile it
+#          2/ uncomment (suppress # in first column) lines
+#             starting with LMETISDIR,  LMETIS
+#          3/ add -Dmetis in line ORDERINGSF
+#             ORDERINGSF  = -Dpord -Dmetis
+#          4/ Compile and install MUMPS
+#             make clean; make   (to clean up previous installation)
+#
+#          Metis/ParMetis and SCOTCH/PT-SCOTCH (ver 6.0 and later) orderings are recommended.
+#
+
+#SCOTCHDIR  = ${HOME}/scotch_6.0
+#ISCOTCH    = -I$(SCOTCHDIR)/include
+#
+# You have to choose one among the following two lines depending on
+# the type of analysis you want to perform. If you want to perform only
+# sequential analysis choose the first (remember to add -Dscotch in the ORDERINGSF
+# variable below); for both parallel and sequential analysis choose the second 
+# line (remember to add -Dptscotch in the ORDERINGSF variable below)
+
+#LSCOTCH    = -L$(SCOTCHDIR)/lib -lesmumps -lscotch -lscotcherr
+#LSCOTCH    = -L$(SCOTCHDIR)/lib -lptesmumps -lptscotch -lptscotcherr
+
+
+LPORDDIR = $(topdir)/PORD/lib
+IPORD    = -I$(topdir)/PORD/include
+LPORD    = -L$(LPORDDIR) -lpord
+
+LMSMPIDIR = ${MSMPI_ROOT}/lib
+IMSMPIDIR = -I${MSMPI_ROOT}/include
+
+#LMETISDIR = /opt/metis-5.1.0/build/Linux-x86_64/libmetis
+#IMETIS    = /opt/metis-5.1.0/include
+
+# You have to choose one among the following two lines depending on
+# the type of analysis you want to perform. If you want to perform only
+# sequential analysis choose the first (remember to add -Dmetis in the ORDERINGSF
+# variable below); for both parallel and sequential analysis choose the second 
+# line (remember to add -Dparmetis in the ORDERINGSF variable below)
+
+#LMETIS    = -L$(LMETISDIR) -lmetis
+#LMETIS    = -L$(LMETISDIR) -lparmetis -lmetis
+
+LMETISDIR		= ${METIS_ROOT}/lib
+IMETIS			= -I${METIS_ROOT}/include
+LPARMETISDIR	= ${PARMETIS_ROOT}/lib
+IPARMETIS		= -I${PARMETIS_ROOT}/include
+
+LMETIS    = -L$(LPARMETISDIR) -lparmetis -L$(LMSMPIDIR) -lmsmpi -L$(LMETISDIR) -lmetis
+
+# The following variables will be used in the compilation process.
+# Please note that -Dptscotch and -Dparmetis imply -Dscotch and -Dmetis respectively.
+# If you want to use Metis 4.X or an older version, you should use -Dmetis4 instead of -Dmetis
+# or in addition with -Dparmetis (if you are using parmetis 3.X or older).
+#ORDERINGSF = -Dscotch -Dmetis -Dpord -Dptscotch -Dparmetis
+#ORDERINGSF  = -Dpord
+ORDERINGSF  = -Dmetis -Dpord -Dparmetis
+ORDERINGSC  = $(ORDERINGSF)
+
+# LORDERINGS = $(LMETIS) $(LPORD) $(LSCOTCH)
+# IORDERINGSF = $(ISCOTCH)
+# IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH)
+LORDERINGS = $(LPARMETIS) $(LMETIS)  $(LPORD) $(LSCOTCH)
+IORDERINGSF = $(ISCOTCH)
+IORDERINGSC = $(IPARMETIS) $(IMETIS) $(IPORD) $(ISCOTCH)
+
+#End orderings
+########################################################################
+
+########################################################################
+# DEFINE HERE SOME COMMON COMMANDS, THE COMPILER NAMES, ETC...
+
+# PLAT : use it to add a default suffix to the generated libraries
+PLAT    = 
+# Library extension, + C and Fortran "-o" option
+# may be different under Windows
+LIBEXT  = .dll
+OUTC    = -o 
+OUTF    = -o 
+# RM : remove files
+RM      = /usr/bin/rm -f
+# CC : C compiler
+CC      = /mingw64/bin/gcc
+# FC : Fortran 90 compiler
+FC      = /mingw64/bin/gfortran
+# FL : Fortran linker
+FL      = /mingw64/bin/gfortran
+# AR : Archive object in a library
+#      keep a space at the end if options have to be separated from lib name
+AR      = /mingw64/bin/ar cr 
+# RANLIB : generate index of an archive file
+#   (optionnal use "RANLIB = echo" in case of problem)
+RANLIB  = /mingw64/bin/ranlib
+#RANLIB  = echo
+
+# DEFINE HERE YOUR LAPACK LIBRARY
+
+LAPACK = -L${LAPACK_ROOT}/lib -llapack
+
+# SCALAP should define the SCALAPACK and BLACS libraries.
+SCALAP  = -L${SCALAPACK_ROOT}/lib -lscalapack
+
+# INCLUDE DIRECTORY FOR MPI
+INCPAR  = $(IMSMPIDIR)
+
+# LIBRARIES USED BY THE PARALLEL VERSION OF MUMPS: $(SCALAP) and MPI
+LIBPAR  = $(SCALAP) $(LAPACK) -L$(LMSMPIDIR) -lmsmpi
+
+# The parallel version is not concerned by the next two lines.
+# They are related to the sequential library provided by MUMPS,
+# to use instead of ScaLAPACK and MPI.
+INCSEQ  = -I$(topdir)/libseq
+LIBSEQ  = $(LAPACK) -L$(topdir)/libseq -lmpiseq
+
+# DEFINE HERE YOUR BLAS LIBRARY
+
+LIBBLAS = -L${BLAS_ROOT}/lib -lblas
+
+# DEFINE HERE YOUR PTHREAD LIBRARY
+LIBOTHERS = -lpthread
+
+# FORTRAN/C COMPATIBILITY:
+#  Use:
+#    -DAdd_ if your Fortran compiler adds an underscore at the end
+#              of symbols,
+#     -DAdd__ if your Fortran compiler adds 2 underscores,
+#
+#     -DUPPER if your Fortran compiler uses uppercase symbols
+#
+#     leave empty if your Fortran compiler does not change the symbols.
+#
+
+CDEFS = -DAdd_
+
+#COMPILER OPTIONS
+#
+# NOTE:
+# - Added -fallow-argument-mismatch option to OPTF in order to clear "Error: 
+#	Rank mismatch between actual argument at [...]"
+# - Added -fallow-invalid-boz option to OPTF in order to clear "Error: BOZ 
+#	literal constant at [...]"
+#
+OPTF    = -O -fPIC -fallow-argument-mismatch -fallow-invalid-boz
+OPTC    = -O -fPIC -I.
+OPTL    = -O
+
+# CHOOSE BETWEEN USING THE SEQUENTIAL OR THE PARALLEL VERSION.
+
+#Sequential:
+#INCS = $(INCSEQ)
+#LIBS = $(LIBSEQ)
+#LIBSEQNEEDED = libseqneeded
+
+#Parallel:
+INCS = $(INCPAR)
+LIBS = $(LIBPAR)
+LIBSEQNEEDED = libseqneeded # NOTE: Create libmpiseq because PETSc looks for it (rather than patching PETSc config tests)
+
Index: /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/PORD/lib/Makefile
===================================================================
--- /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/PORD/lib/Makefile	(revision 26744)
+++ /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/PORD/lib/Makefile	(revision 26744)
@@ -0,0 +1,34 @@
+
+# To compile directly, uncomment the line below.
+# include ../Make.in
+#
+# Otherwise, adequate variables for CC, CFLAGS, AR and RANLIB must be passed to 
+# make.
+#
+
+INCLUDES = -I../include
+
+# NOTE:
+#- CFLAGS = $(OPTC) (see ../../src/Makefile; OPTC is set in ../../Makefile.inc)
+#
+COPTIONS = $(INCLUDES) $(CFLAGS) $(OPTFLAGS)
+
+OBJS = graph.o gbipart.o gbisect.o ddcreate.o ddbisect.o nestdiss.o \
+       multisector.o gelim.o bucket.o tree.o \
+       symbfac.o interface.o sort.o minpriority.o 
+
+# NOTE: numfac.c read.c mapping.c triangular.c matrix.c kernel.c were not 
+# directly used by MUMPS and have been removed from the original SPACE 
+# package.
+
+.c.o:
+	$(CC) $(COPTIONS) -c $*.c $(OUTC) $*.o
+
+libpord$(LIBEXT):$(OBJS)
+	$(CC) -shared $(OUTC) $@ $(OBJS)
+
+clean:
+	$(RM) *.o
+
+realclean:
+	$(RM) *.o libpord*
Index: /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/libseq/Makefile
===================================================================
--- /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/libseq/Makefile	(revision 26744)
+++ /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/libseq/Makefile	(revision 26744)
@@ -0,0 +1,25 @@
+#
+#  This file is part of MUMPS 5.3.5, released
+#  on Thu Oct 22 09:29:08 UTC 2020
+#
+all: libmpiseq
+
+.PHONY: all libmpiseq clean
+
+include ../Makefile.inc
+
+libmpiseq: libmpiseq$(PLAT)$(LIBEXT)
+
+# NOTE:
+# - We need to use Fortran compiler or otherwise link in Fortran libraries 
+#   using C compiler (which does not make a lot of sense, but is possible)
+#
+libmpiseq$(PLAT)$(LIBEXT): mpi.o mpic.o elapse.o
+	$(FC) -shared $(OUTF) $@ mpi.o mpic.o elapse.o
+.f.o:
+	$(FC) $(OPTF)              -c $*.f $(OUTF)$*.o
+.c.o:
+	$(CC) $(OPTC) $(CDEFS) -I. -c $*.c $(OUTC)$*.o
+
+clean:
+	$(RM) *.o *$(LIBEXT)
Index: /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/src/Makefile
===================================================================
--- /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/src/Makefile	(revision 26744)
+++ /issm/trunk/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/src/Makefile	(revision 26744)
@@ -0,0 +1,425 @@
+#
+#  This file is part of MUMPS 5.3.5, released
+#  on Thu Oct 22 09:29:08 UTC 2020
+#
+#
+topdir = ..
+libdir = $(topdir)/lib
+incdir = $(topdir)/include
+
+default: d
+
+.PHONY: default s d c z mumps_lib clean
+
+s:
+	$(MAKE) ARITH=s mumps_lib
+d:
+	$(MAKE) ARITH=d mumps_lib
+c:
+	$(MAKE) ARITH=c mumps_lib
+z:
+	$(MAKE) ARITH=z mumps_lib
+
+include $(topdir)/Makefile.inc
+
+mumps_lib:    $(incdir)/mumps_int_def.h \
+              $(libdir)/libmumps_common$(PLAT)$(LIBEXT) \
+              $(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT)
+
+# Build $(incdir)/mumps_int_def.h, needed by mumps_c_types.h
+$(incdir)/mumps_int_def.h: build_mumps_int_def 
+	./build_mumps_int_def > $(incdir)/mumps_int_def.h
+build_mumps_int_def:build_mumps_int_def.o
+	$(CC) $(OPTL) build_mumps_int_def.o -o build_mumps_int_def
+
+OBJS_COMMON_MOD = \
+        ana_omp_m.o\
+        ana_blk_m.o\
+        ana_orderings_wrappers_m.o\
+        double_linked_list.o\
+        fac_asm_build_sort_index_ELT_m.o\
+        fac_asm_build_sort_index_m.o\
+        fac_descband_data_m.o\
+        fac_future_niv2_mod.o\
+        fac_ibct_data_m.o\
+        fac_maprow_data_m.o\
+        front_data_mgt_m.o\
+        lr_common.o \
+        mumps_comm_ibcast.o\
+        mumps_l0_omp_m.o\
+        mumps_memory_mod.o\
+        mumps_mpitoomp_m.o\
+        mumps_ooc_common.o\
+        mumps_static_mapping.o\
+        omp_tps_common_m.o
+
+
+OBJS_COMMON_OTHER = \
+        ana_blk.o\
+        ana_orderings.o\
+        ana_set_ordering.o\
+        ana_AMDMF.o\
+        bcast_errors.o\
+        estim_flops.o\
+        mumps_type_size.o \
+        mumps_type2_blocking.o \
+        mumps_version.o \
+        mumps_print_defined.o \
+        mumps_common.o\
+        mumps_pord.o\
+        mumps_metis.o\
+        mumps_metis64.o\
+        mumps_metis_int.o\
+        mumps_scotch.o\
+        mumps_scotch64.o\
+        mumps_scotch_int.o\
+        mumps_size.o\
+        mumps_io.o\
+        mumps_io_basic.o\
+        mumps_io_thread.o\
+        mumps_io_err.o\
+        mumps_numa.o \
+        mumps_thread.o \
+        mumps_save_restore_C.o \
+        mumps_config_file_C.o \
+        mumps_thread_affinity.o \
+        tools_common.o \
+        sol_common.o
+
+OBJS_MOD =   \
+        $(ARITH)ana_aux.o \
+        $(ARITH)ana_aux_par.o \
+        $(ARITH)ana_lr.o\
+        $(ARITH)fac_asm_master_ELT_m.o\
+        $(ARITH)fac_asm_master_m.o\
+        $(ARITH)fac_front_aux.o\
+        $(ARITH)fac_front_LU_type1.o\
+        $(ARITH)fac_front_LU_type2.o\
+        $(ARITH)fac_front_LDLT_type1.o\
+        $(ARITH)fac_front_LDLT_type2.o\
+        $(ARITH)fac_front_type2_aux.o\
+        $(ARITH)fac_sispointers_m.o\
+        $(ARITH)fac_lr.o\
+        $(ARITH)fac_mem_dynamic.o\
+        $(ARITH)fac_omp_m.o\
+        $(ARITH)fac_par_m.o\
+        $(ARITH)fac_sol_l0omp_m.o\
+        $(ARITH)lr_core.o\
+        $(ARITH)lr_stats.o\
+        $(ARITH)lr_type.o\
+        $(ARITH)mumps_comm_buffer.o\
+        $(ARITH)mumps_config_file.o\
+        $(ARITH)mumps_load.o\
+        $(ARITH)mumps_lr_data_m.o\
+        $(ARITH)mumps_ooc_buffer.o\
+        $(ARITH)mumps_ooc.o\
+        $(ARITH)mumps_sol_es.o\
+        $(ARITH)mumps_save_restore.o\
+        $(ARITH)mumps_save_restore_files.o\
+        $(ARITH)mumps_struc_def.o\
+        $(ARITH)omp_tps_m.o\
+        $(ARITH)sol_lr.o\
+        $(ARITH)sol_omp_m.o\
+        $(ARITH)static_ptr_m.o
+
+OBJS_OTHER = \
+        $(ARITH)ini_driver.o\
+        $(ARITH)ana_driver.o\
+        $(ARITH)fac_driver.o\
+        $(ARITH)sol_driver.o\
+        $(ARITH)sol_distrhs.o\
+        $(ARITH)end_driver.o\
+        $(ARITH)ana_aux_ELT.o\
+        $(ARITH)ana_dist_m.o\
+        $(ARITH)ana_LDLT_preprocess.o\
+        $(ARITH)ana_reordertree.o\
+        $(ARITH)arrowheads.o\
+        $(ARITH)bcast_int.o\
+        $(ARITH)fac_asm_ELT.o\
+        $(ARITH)fac_asm.o\
+        $(ARITH)fac_b.o\
+        $(ARITH)fac_distrib_distentry.o\
+        $(ARITH)fac_distrib_ELT.o\
+        $(ARITH)fac_lastrtnelind.o\
+        $(ARITH)fac_mem_alloc_cb.o\
+        $(ARITH)fac_mem_compress_cb.o\
+        $(ARITH)fac_mem_free_block_cb.o\
+        $(ARITH)fac_mem_stack_aux.o\
+        $(ARITH)fac_mem_stack.o\
+        $(ARITH)fac_process_band.o\
+        $(ARITH)fac_process_blfac_slave.o\
+        $(ARITH)fac_process_blocfacto_LDLT.o\
+        $(ARITH)fac_process_blocfacto.o\
+        $(ARITH)fac_process_bf.o\
+        $(ARITH)fac_process_end_facto_slave.o\
+        $(ARITH)fac_process_contrib_type1.o\
+        $(ARITH)fac_process_contrib_type2.o\
+        $(ARITH)fac_process_contrib_type3.o\
+        $(ARITH)fac_process_maprow.o\
+        $(ARITH)fac_process_master2.o\
+        $(ARITH)fac_process_message.o\
+        $(ARITH)fac_process_root2slave.o\
+        $(ARITH)fac_process_root2son.o\
+        $(ARITH)fac_process_rtnelind.o\
+        $(ARITH)fac_root_parallel.o\
+        $(ARITH)fac_scalings.o\
+        $(ARITH)fac_determinant.o\
+        $(ARITH)fac_scalings_simScaleAbs.o\
+        $(ARITH)fac_scalings_simScale_util.o\
+        $(ARITH)fac_sol_pool.o\
+        $(ARITH)fac_type3_symmetrize.o\
+        $(ARITH)ini_defaults.o\
+        $(ARITH)mumps_c.o\
+        $(ARITH)mumps_driver.o\
+        $(ARITH)mumps_f77.o\
+        $(ARITH)mumps_gpu.o\
+        $(ARITH)mumps_iXamax.o\
+        $(ARITH)ana_mtrans.o\
+        $(ARITH)ooc_panel_piv.o\
+        $(ARITH)rank_revealing.o\
+        $(ARITH)sol_aux.o\
+        $(ARITH)sol_bwd_aux.o\
+        $(ARITH)sol_bwd.o\
+        $(ARITH)sol_c.o\
+        $(ARITH)sol_fwd_aux.o\
+        $(ARITH)sol_fwd.o\
+        $(ARITH)sol_matvec.o\
+        $(ARITH)sol_root_parallel.o\
+        $(ARITH)tools.o\
+        $(ARITH)type3_root.o
+
+# NOTE:
+# - We need to use Fortran compiler or otherwise link in Fortran libraries 
+#	using C compiler (which does not make a lot of sense, but is possible)
+# - In case of "Makefile:[line_number]: *** missing separator.  Stop.", ensure 
+#	that $(FC) is preceded by a tab and not four spaces
+#
+$(libdir)/libmumps_common$(PLAT)$(LIBEXT):      $(OBJS_COMMON_MOD) $(OBJS_COMMON_OTHER)
+	$(FC) -shared $(OUTF) $@ \
+		$? $(LORDERINGS) $(LIBS) $(LIBLAPACK) $(LIBBLAS) $(LIBOTHERS) \
+		-Wl,--out-implib=$(libdir)/libmumps_common$(PLAT).dll.a
+
+$(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT):    $(OBJS_MOD) $(OBJS_OTHER)
+	$(FC) -shared $(OUTF) $@ \
+		$? -L$(libdir) -lmumps_common$(PLAT) $(LORDERINGS) $(LIBS) $(LIBLAPACK) $(LIBBLAS) $(LIBOTHERS) \
+		-Wl,--out-implib=$(libdir)/lib$(ARITH)mumps$(PLAT).dll.a
+
+# Dependencies between modules:
+# i) arithmetic-dependent modules:
+$(ARITH)ana_aux.o:              $(ARITH)mumps_struc_def.o \
+                                mumps_static_mapping.o \
+                                ana_orderings_wrappers_m.o \
+                                ana_blk_m.o
+$(ARITH)ana_aux_par.o:          $(ARITH)mumps_struc_def.o \
+                                mumps_memory_mod.o \
+                                ana_orderings_wrappers_m.o
+$(ARITH)ana_lr.o:                $(ARITH)lr_core.o\
+                                $(ARITH)lr_stats.o\
+                                lr_common.o\
+                                ana_orderings_wrappers_m.o \
+                                ana_blk_m.o 
+$(ARITH)fac_asm_master_ELT_m.o: omp_tps_common_m.o \
+                                fac_ibct_data_m.o \
+                                fac_asm_build_sort_index_ELT_m.o \
+                                lr_common.o \
+                                $(ARITH)fac_mem_dynamic.o \
+                                $(ARITH)lr_core.o \
+                                $(ARITH)ana_lr.o \
+                                $(ARITH)mumps_lr_data_m.o \
+                                $(ARITH)mumps_struc_def.o \
+                                $(ARITH)omp_tps_m.o \
+                                $(ARITH)mumps_comm_buffer.o \
+                                $(ARITH)mumps_load.o
+$(ARITH)fac_asm_master_m.o:     omp_tps_common_m.o \
+                                fac_ibct_data_m.o \
+                                fac_asm_build_sort_index_m.o \
+                                lr_common.o \
+                                $(ARITH)fac_mem_dynamic.o \
+                                $(ARITH)lr_core.o \
+                                $(ARITH)ana_lr.o \
+                                $(ARITH)mumps_lr_data_m.o \
+                                $(ARITH)mumps_struc_def.o \
+                                $(ARITH)omp_tps_m.o \
+                                $(ARITH)mumps_comm_buffer.o \
+                                $(ARITH)mumps_load.o
+
+$(ARITH)fac_front_aux.o:        $(ARITH)lr_type.o\
+                                $(ARITH)lr_stats.o\
+                                $(ARITH)mumps_comm_buffer.o\
+                                $(ARITH)mumps_load.o\
+                                $(ARITH)mumps_ooc.o\
+                                mumps_ooc_common.o\
+                                mumps_l0_omp_m.o
+
+$(ARITH)fac_front_LU_type1.o   : $(ARITH)fac_front_aux.o\
+                                 $(ARITH)mumps_ooc.o\
+                                 $(ARITH)fac_lr.o\
+                                 $(ARITH)lr_type.o\
+                                 $(ARITH)lr_stats.o\
+                                 $(ARITH)ana_lr.o\
+                                 $(ARITH)mumps_lr_data_m.o\
+                                 mumps_l0_omp_m.o
+
+$(ARITH)fac_front_LU_type2.o   : $(ARITH)fac_front_aux.o\
+                                 $(ARITH)fac_front_type2_aux.o\
+                                 $(ARITH)mumps_ooc.o\
+                                 $(ARITH)mumps_comm_buffer.o\
+                                 mumps_comm_ibcast.o\
+                                 $(ARITH)fac_lr.o\
+                                 $(ARITH)lr_core.o\
+                                 $(ARITH)lr_type.o\
+                                 $(ARITH)lr_stats.o\
+                                 $(ARITH)ana_lr.o\
+                                 $(ARITH)mumps_lr_data_m.o\
+                                 $(ARITH)mumps_struc_def.o
+
+$(ARITH)fac_front_LDLT_type1.o : $(ARITH)fac_front_aux.o\
+                                 $(ARITH)mumps_ooc.o\
+                                 $(ARITH)fac_lr.o\
+                                 $(ARITH)lr_type.o\
+                                 $(ARITH)lr_stats.o\
+                                 $(ARITH)ana_lr.o\
+                                 $(ARITH)mumps_lr_data_m.o\
+                                 mumps_l0_omp_m.o
+
+$(ARITH)fac_front_LDLT_type2.o : $(ARITH)fac_front_aux.o\
+                                 $(ARITH)fac_front_type2_aux.o\
+                                 $(ARITH)mumps_ooc.o\
+                                 $(ARITH)mumps_comm_buffer.o\
+                                 $(ARITH)mumps_load.o\
+                                 $(ARITH)fac_lr.o\
+                                 $(ARITH)lr_type.o\
+                                 $(ARITH)lr_stats.o\
+                                 $(ARITH)ana_lr.o\
+                                 $(ARITH)mumps_lr_data_m.o\
+                                 $(ARITH)mumps_struc_def.o
+
+$(ARITH)fac_front_type2_aux.o : mumps_ooc_common.o\
+                                $(ARITH)fac_front_aux.o\
+                                $(ARITH)lr_type.o\
+                                $(ARITH)mumps_struc_def.o\
+                                $(ARITH)mumps_comm_buffer.o\
+                                $(ARITH)mumps_load.o\
+                                mumps_comm_ibcast.o\
+                                fac_ibct_data_m.o
+
+$(ARITH)fac_lr.o:               $(ARITH)lr_core.o\
+                                $(ARITH)lr_type.o\
+                                $(ARITH)mumps_lr_data_m.o\
+                                $(ARITH)lr_stats.o
+
+$(ARITH)fac_mem_dynamic.o:      $(ARITH)mumps_load.o\
+                                $(ARITH)static_ptr_m.o
+
+$(ARITH)fac_omp_m.o:            $(ARITH)fac_asm_master_m.o\
+                                $(ARITH)fac_asm_master_ELT_m.o\
+                                $(ARITH)fac_front_LU_type1.o\
+                                $(ARITH)fac_front_LDLT_type1.o\
+                                $(ARITH)mumps_load.o\
+                                $(ARITH)omp_tps_m.o\
+                                $(ARITH)lr_stats.o\
+                                $(ARITH)mumps_struc_def.o\
+                                omp_tps_common_m.o\
+                                mumps_l0_omp_m.o
+
+$(ARITH)fac_sol_l0omp_m.o:      $(ARITH)mumps_struc_def.o
+
+$(ARITH)fac_omp_m.o:            $(ARITH)mumps_struc_def.o \
+                                $(ARITH)fac_mem_dynamic.o\
+                                $(ARITH)omp_tps_m.o\
+                                omp_tps_common_m.o
+
+$(ARITH)fac_par_m.o:            $(ARITH)mumps_load.o\
+                                $(ARITH)mumps_ooc.o\
+                                $(ARITH)fac_asm_master_m.o\
+                                $(ARITH)fac_asm_master_ELT_m.o\
+                                $(ARITH)omp_tps_m.o\
+                                $(ARITH)fac_front_LU_type1.o\
+                                $(ARITH)fac_front_LU_type2.o\
+                                $(ARITH)fac_front_LDLT_type1.o\
+                                $(ARITH)fac_front_LDLT_type2.o\
+                                $(ARITH)fac_mem_dynamic.o\
+                                $(ARITH)mumps_struc_def.o\
+                                $(ARITH)lr_stats.o\
+                                omp_tps_common_m.o\
+                                mumps_l0_omp_m.o
+
+$(ARITH)lr_core.o:              $(ARITH)lr_type.o\
+                                $(ARITH)mumps_lr_data_m.o\
+                                $(ARITH)lr_stats.o\
+                                lr_common.o
+
+$(ARITH)lr_stats.o:             $(ARITH)lr_type.o
+
+$(ARITH)mumps_comm_buffer.o:    mumps_comm_ibcast.o \
+                                $(ARITH)lr_type.o \
+                                $(ARITH)lr_core.o \
+                                $(ARITH)mumps_lr_data_m.o \
+                                fac_ibct_data_m.o
+
+$(ARITH)mumps_config_file.o:    $(ARITH)mumps_struc_def.o
+
+$(ARITH)mumps_load.o:           $(ARITH)mumps_comm_buffer.o \
+                                $(ARITH)mumps_struc_def.o \
+                                fac_future_niv2_mod.o
+
+$(ARITH)mumps_lr_data_m.o:      $(ARITH)lr_type.o\
+                                front_data_mgt_m.o
+
+$(ARITH)mumps_ooc_buffer.o:     mumps_ooc_common.o
+
+$(ARITH)mumps_ooc.o:            $(ARITH)mumps_struc_def.o \
+                                $(ARITH)mumps_ooc_buffer.o \
+                                mumps_ooc_common.o
+
+$(ARITH)mumps_sol_es.o:         $(ARITH)lr_type.o \
+                                $(ARITH)mumps_lr_data_m.o
+
+$(ARITH)mumps_save_restore.o:   $(ARITH)mumps_struc_def.o \
+                                $(ARITH)mumps_save_restore_files.o \
+                                $(ARITH)mumps_lr_data_m.o \
+                                $(ARITH)mumps_ooc.o \
+                                $(ARITH)fac_sol_l0omp_m.o \
+                                front_data_mgt_m.o
+
+$(ARITH)mumps_save_restore_files.o : $(ARITH)mumps_struc_def.o
+
+$(ARITH)sol_lr.o:               $(ARITH)lr_type.o\
+                                $(ARITH)lr_stats.o\
+                                $(ARITH)mumps_lr_data_m.o
+
+$(ARITH)sol_omp_m.o:            $(ARITH)mumps_struc_def.o
+
+
+
+
+
+# Dependencies between modules:
+# ii) arithmetic-independent modules:
+
+ana_omp_m.o:                     double_linked_list.o
+fac_asm_build_sort_index_ELT_m.o:omp_tps_common_m.o
+fac_asm_build_sort_index_m.o:    omp_tps_common_m.o
+fac_descband_data_m.o:           front_data_mgt_m.o
+fac_ibct_data_m.o:               front_data_mgt_m.o
+fac_maprow_data_m.o:             front_data_mgt_m.o
+mumps_comm_ibcast.o:             fac_future_niv2_mod.o
+mumps_static_mapping.o:          lr_common.o
+
+
+# Compile modules before the rest
+$(OBJS_COMMON_OTHER):$(OBJS_COMMON_MOD)
+$(OBJS_OTHER):$(OBJS_COMMON_MOD) $(OBJS_MOD)
+
+.SUFFIXES: .c .F .o
+.F.o:
+	$(FC) $(OPTF) -I. -I../include $(INCS) $(IORDERINGSF) $(ORDERINGSF) -c $*.F $(OUTF) $*.o
+.c.o:
+	$(CC) $(OPTC) -I../include $(INCS) $(CDEFS) $(IORDERINGSC) $(ORDERINGSC) -c $*.c $(OUTC) $*.o
+
+$(ARITH)mumps_c.o:	mumps_c.c
+	$(CC) $(OPTC) -I../include $(INCS) $(CDEFS) -DMUMPS_ARITH=MUMPS_ARITH_$(ARITH) \
+	      $(IORDERINGSC) $(ORDERINGSC) -c mumps_c.c $(OUTC) $@
+
+clean:
+	$(RM) *.o *.mod $(incdir)/mumps_int_def.h
Index: /issm/trunk/externalpackages/mumps/install-5-win-msys2-gcc-msmpi.sh
===================================================================
--- /issm/trunk/externalpackages/mumps/install-5-win-msys2-gcc-msmpi.sh	(revision 26744)
+++ /issm/trunk/externalpackages/mumps/install-5-win-msys2-gcc-msmpi.sh	(revision 26744)
@@ -0,0 +1,61 @@
+#!/bin/bash
+set -eu
+
+
+# Sources:
+# - https://www.scivision.dev/windows-mpi-msys2/
+#
+# NOTE:
+# - Source is pulled from https://github.com/scivision/mumps/releases, which 
+#	provides patches to the releases from developer (http://mumps-solver.org/)
+#
+# TODO:
+# - Create install alias in Makefiles
+# - Alternatively, use cmake rather than make
+#
+
+## Constants
+#
+VER=5.3.5.2
+
+PREFIX="${ISSM_DIR}/externalpackages/mumps/install"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir ${PREFIX} src src/lib
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/mumps-${VER}.tar.gz" "mumps-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf mumps-${VER}.tar.gz
+
+# Move source into 'src' directory
+mv mumps-${VER}/* src
+rm -rf mumps-${VER}
+
+# Copy customized source and configuration files to 'src' directory
+cp configs/5.3/win/msys2/gcc/msmpi/Makefile.inc src
+cp configs/5.3/win/msys2/gcc/msmpi/libseq/Makefile src/libseq
+cp configs/5.3/win/msys2/gcc/msmpi/PORD/lib/Makefile src/PORD/lib
+cp configs/5.3/win/msys2/gcc/msmpi/src/Makefile src/src
+
+# Compile
+cd src
+if [ $# -eq 0 ]; then
+	make all
+else
+	make -j $1 all
+fi
+
+# Install
+mkdir ${PREFIX}/lib
+cp lib/lib* ${PREFIX}/lib
+cp libseq/lib* ${PREFIX}/lib
+mkdir ${PREFIX}/include
+cp include/* ${PREFIX}/include
+
+# Create link to lib directory (PETSc, by default, looks for libraries in 
+# lib64/ if it detects that 64-bit integers are being used).
+cd ${PREFIX}
+ln -s lib lib64
Index: /issm/trunk/externalpackages/mumps/install-5-win-msys2-mingw-msmpi.sh
===================================================================
--- /issm/trunk/externalpackages/mumps/install-5-win-msys2-mingw-msmpi.sh	(revision 26744)
+++ /issm/trunk/externalpackages/mumps/install-5-win-msys2-mingw-msmpi.sh	(revision 26744)
@@ -0,0 +1,61 @@
+#!/bin/bash
+set -eu
+
+
+# Sources:
+# - https://www.scivision.dev/windows-mpi-msys2/
+#
+# NOTE:
+# - Source is pulled from https://github.com/scivision/mumps/releases, which 
+#	provides patches to the releases from developer (http://mumps-solver.org/)
+#
+# TODO:
+# - Create install alias in Makefiles
+# - Alternatively, use cmake rather than make
+#
+
+## Constants
+#
+VER=5.3.5.2
+
+PREFIX="${ISSM_DIR}/externalpackages/mumps/install"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir ${PREFIX} src src/lib
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/mumps-${VER}.tar.gz" "mumps-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf mumps-${VER}.tar.gz
+
+# Move source into 'src' directory
+mv mumps-${VER}/* src
+rm -rf mumps-${VER}
+
+# Copy customized source and configuration files to 'src' directory
+cp configs/5.3/win/msys2/mingw64/msmpi/Makefile.inc src
+cp configs/5.3/win/msys2/mingw64/msmpi/libseq/Makefile src/libseq
+cp configs/5.3/win/msys2/mingw64/msmpi/PORD/lib/Makefile src/PORD/lib
+cp configs/5.3/win/msys2/mingw64/msmpi/src/Makefile src/src
+
+# Compile
+cd src
+if [ $# -eq 0 ]; then
+	make all
+else
+	make -j $1 all
+fi
+
+# Install
+mkdir ${PREFIX}/lib
+cp lib/lib* ${PREFIX}/lib
+cp libseq/lib* ${PREFIX}/lib
+mkdir ${PREFIX}/include
+cp include/* ${PREFIX}/include
+
+# Create link to lib directory (PETSc, by default, looks for libraries in 
+# lib64/ if it detects that 64-bit integers are being used).
+cd ${PREFIX}
+ln -s lib lib64
Index: /issm/trunk/externalpackages/muq/install.sh
===================================================================
--- /issm/trunk/externalpackages/muq/install.sh	(revision 26744)
+++ /issm/trunk/externalpackages/muq/install.sh	(revision 26744)
@@ -0,0 +1,21 @@
+#!/bin/bash
+set -eu
+
+# Cleanup from previous installation
+rm -rf install 
+
+#Download development version
+git clone https://bitbucket.org/mituq/muq2 install
+
+#configure
+cd install
+cmake -DCMAKE_INSTALL_PREFIX="${ISSM_DIR}/externalpackages/muq/install"
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
Index: /issm/trunk/externalpackages/neopz/install.sh
===================================================================
--- /issm/trunk/externalpackages/neopz/install.sh	(revision 26743)
+++ /issm/trunk/externalpackages/neopz/install.sh	(revision 26744)
@@ -9,4 +9,9 @@
 #GIT must be installed first. See $ISSM_DIR/externalpackages/git
 git clone https://github.com/labmec/neopz.git
+
+#use these 3 lines if one would like to change to a stable version
+cd neopz
+git checkout 5b1d4fa3cf61dcc500742b8cfdfb01d86ec724b3
+cd ..
 
 #Untar and set src directory
Index: /issm/trunk/externalpackages/netcdf/install-4.7-parallel-static-with_tests.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install-4.7-parallel-static-with_tests.sh	(revision 26743)
+++ /issm/trunk/externalpackages/netcdf/install-4.7-parallel-static-with_tests.sh	(revision 26744)
@@ -9,12 +9,15 @@
 # - curl (7.18.0 or later, for DAP remote access client support)
 #
-# For most ISSM installations, only hdf5 will be necessary
-#
 # Sources:
 # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
 #
-
 # NOTE:
 # - Certain configuration tests fail if libraries are not supplied explicitly
+#
+# TODO:
+# - Compile and link curl statically (issue with DAP and system libs on macOS 
+#	with more restirctive Gatekeeper; see also --disable-dap option in 
+#	configuration)
+#
 
 # Constants
@@ -22,6 +25,5 @@
 VER="4.7.2"
 
-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
 
 # Environment
@@ -37,18 +39,18 @@
 
 # Unpack source
-tar -zxvf netcdf-c-$VER.tar.gz
+tar -zxvf netcdf-c-${VER}.tar.gz
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
-mv netcdf-c-$VER/* src/
-rm -rf netcdf-c-$VER
+mv netcdf-c-${VER}/* src
+rm -rf netcdf-c-${VER}
 
 # Configure
 cd src
 ./configure \
-	--prefix="${ISSM_DIR}/externalpackages/netcdf/install" \
+	--prefix="${PREFIX}" \
 	--disable-shared \
 	--disable-dependency-tracking \
@@ -72,5 +74,2 @@
 	make -j $1 install
 fi
-
-# Return to initial directory
-cd ..
Index: /issm/trunk/externalpackages/netcdf/install-4.7-parallel-static.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install-4.7-parallel-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/netcdf/install-4.7-parallel-static.sh	(revision 26744)
@@ -9,12 +9,15 @@
 # - curl (7.18.0 or later, for DAP remote access client support)
 #
-# For most ISSM installations, only hdf5 will be necessary
-#
 # Sources:
 # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
 #
-
 # NOTE:
 # - Certain configuration tests fail if libraries are not supplied explicitly
+#
+# TODO:
+# - Compile and link curl statically (issue with DAP and system libs on macOS 
+#	with more restirctive Gatekeeper; see also --disable-dap option in 
+#	configuration)
+#
 
 # Constants
@@ -22,6 +25,5 @@
 VER="4.7.2"
 
-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
 
 # Environment
@@ -37,18 +39,18 @@
 
 # Unpack source
-tar -zxvf netcdf-c-$VER.tar.gz
+tar -zxvf netcdf-c-${VER}.tar.gz
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
-mv netcdf-c-$VER/* src/
-rm -rf netcdf-c-$VER
+mv netcdf-c-${VER}/* src
+rm -rf netcdf-c-${VER}
 
 # Configure
 cd src
 ./configure \
-	--prefix="${ISSM_DIR}/externalpackages/netcdf/install" \
+	--prefix="${PREFIX}" \
 	--disable-shared \
 	--disable-dependency-tracking \
@@ -69,5 +71,2 @@
 	make -j $1 install
 fi
-
-# Return to initial directory
-cd ..
Index: /issm/trunk/externalpackages/netcdf/install-4.7-parallel-with_tests.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install-4.7-parallel-with_tests.sh	(revision 26743)
+++ /issm/trunk/externalpackages/netcdf/install-4.7-parallel-with_tests.sh	(revision 26744)
@@ -9,6 +9,4 @@
 # - curl (7.18.0 or later, for DAP remote access client support)
 #
-# For most ISSM installations, only hdf5 will be necessary
-#
 # Sources:
 # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
@@ -19,7 +17,5 @@
 VER="4.7.2"
 
-CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
 
 # Environment
@@ -33,18 +29,18 @@
 
 # Unpack source
-tar -zxvf netcdf-c-$VER.tar.gz
+tar -zxvf netcdf-c-${VER}.tar.gz
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
-mv netcdf-c-$VER/* src/
-rm -rf netcdf-c-$VER
+mv netcdf-c-${VER}/* src
+rm -rf netcdf-c-${VER}
 
 # Configure
 cd src
 ./configure \
-	--prefix="${ISSM_DIR}/externalpackages/netcdf/install" \
+	--prefix="${PREFIX}" \
 	--disable-static \
 	--disable-dependency-tracking \
@@ -67,5 +63,2 @@
 	make -j $1 install
 fi
-
-# Return to initial directory
-cd ..
Index: /issm/trunk/externalpackages/netcdf/install-4.7-parallel.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install-4.7-parallel.sh	(revision 26743)
+++ /issm/trunk/externalpackages/netcdf/install-4.7-parallel.sh	(revision 26744)
@@ -9,6 +9,4 @@
 # - curl (7.18.0 or later, for DAP remote access client support)
 #
-# For most ISSM installations, only hdf5 will be necessary
-#
 # Sources:
 # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
@@ -19,7 +17,5 @@
 VER="4.7.2"
 
-CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
 
 # Environment
@@ -33,18 +29,18 @@
 
 # Unpack source
-tar -zxvf netcdf-c-$VER.tar.gz
+tar -zxvf netcdf-c-${VER}.tar.gz
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
-mv netcdf-c-$VER/* src/
-rm -rf netcdf-c-$VER
+mv netcdf-c-${VER}/* src
+rm -rf netcdf-c-${VER}
 
 # Configure
 cd src
 ./configure \
-	--prefix="${ISSM_DIR}/externalpackages/netcdf/install" \
+	--prefix="${PREFIX}" \
 	--disable-static \
 	--disable-dependency-tracking \
@@ -64,5 +60,2 @@
 	make -j $1 install
 fi
-
-# Return to initial directory
-cd ..
Index: /issm/trunk/externalpackages/netcdf/install-4.7-with_tests.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install-4.7-with_tests.sh	(revision 26743)
+++ /issm/trunk/externalpackages/netcdf/install-4.7-with_tests.sh	(revision 26744)
@@ -9,6 +9,4 @@
 # - curl (7.18.0 or later, for DAP remote access client support)
 #
-# For most ISSM installations, only hdf5 will be necessary
-#
 # Sources:
 # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
@@ -19,7 +17,5 @@
 VER="4.7.2"
 
-CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
 
 # Environment
@@ -32,18 +28,18 @@
 
 # Unpack source
-tar -zxvf netcdf-c-$VER.tar.gz
+tar -zxvf netcdf-c-${VER}.tar.gz
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
-mv netcdf-c-$VER/* src/
-rm -rf netcdf-c-$VER
+mv netcdf-c-${VER}/* src
+rm -rf netcdf-c-${VER}
 
 # Configure
 cd src
 ./configure \
-	--prefix="${ISSM_DIR}/externalpackages/netcdf/install" \
+	--prefix="${PREFIX}" \
 	--disable-static \
 	--disable-dependency-tracking \
@@ -65,5 +61,2 @@
 	make -j $1 install
 fi
-
-# Return to initial directory
-cd ..
Index: /issm/trunk/externalpackages/netcdf/install-4.7.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install-4.7.sh	(revision 26743)
+++ /issm/trunk/externalpackages/netcdf/install-4.7.sh	(revision 26744)
@@ -9,6 +9,4 @@
 # - curl (7.18.0 or later, for DAP remote access client support)
 #
-# For most ISSM installations, only hdf5 will be necessary
-#
 # Sources:
 # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
@@ -18,7 +16,6 @@
 #
 VER="4.7.2"
-CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+
+PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
 
 # Environment
@@ -34,9 +31,9 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
 
 # Move source to 'src' directory
-mv netcdf-c-${VER}/* src/
+mv netcdf-c-${VER}/* src
 rm -rf netcdf-c-${VER}
 
@@ -44,5 +41,5 @@
 cd src
 ./configure \
-	--prefix="${ISSM_DIR}/externalpackages/netcdf/install" \
+	--prefix="${PREFIX}" \
 	--disable-static \
 	--disable-dependency-tracking \
Index: /issm/trunk/externalpackages/parmetis/compil.log
===================================================================
--- /issm/trunk/externalpackages/parmetis/compil.log	(revision 26744)
+++ /issm/trunk/externalpackages/parmetis/compil.log	(revision 26744)
@@ -0,0 +1,524 @@
+File parmetis-4.0.3.tar.gz already exists and will not be downloaded...
+parmetis-4.0.3/
+parmetis-4.0.3/build/
+parmetis-4.0.3/BUILD.txt
+parmetis-4.0.3/Changelog
+parmetis-4.0.3/CMakeLists.txt
+parmetis-4.0.3/Graphs/
+parmetis-4.0.3/include/
+parmetis-4.0.3/Install.txt
+parmetis-4.0.3/libparmetis/
+parmetis-4.0.3/LICENSE.txt
+parmetis-4.0.3/Makefile
+parmetis-4.0.3/manual/
+parmetis-4.0.3/metis/
+parmetis-4.0.3/programs/
+parmetis-4.0.3/programs/adaptgraph.c
+parmetis-4.0.3/programs/CMakeLists.txt
+parmetis-4.0.3/programs/io.c
+parmetis-4.0.3/programs/mtest.c
+parmetis-4.0.3/programs/otest.c
+parmetis-4.0.3/programs/parmetis.c
+parmetis-4.0.3/programs/parmetisbin.h
+parmetis-4.0.3/programs/plotorder.pl
+parmetis-4.0.3/programs/pometis.c
+parmetis-4.0.3/programs/proto.h
+parmetis-4.0.3/programs/ptest.c
+parmetis-4.0.3/metis/build/
+parmetis-4.0.3/metis/BUILD-Windows.txt
+parmetis-4.0.3/metis/BUILD.txt
+parmetis-4.0.3/metis/Changelog
+parmetis-4.0.3/metis/CMakeLists.txt
+parmetis-4.0.3/metis/GKlib/
+parmetis-4.0.3/metis/include/
+parmetis-4.0.3/metis/Install.txt
+parmetis-4.0.3/metis/libmetis/
+parmetis-4.0.3/metis/LICENSE.txt
+parmetis-4.0.3/metis/Makefile
+parmetis-4.0.3/metis/programs/
+parmetis-4.0.3/metis/vsgen.bat
+parmetis-4.0.3/metis/programs/CMakeLists.txt
+parmetis-4.0.3/metis/programs/cmdline_gpmetis.c
+parmetis-4.0.3/metis/programs/cmdline_m2gmetis.c
+parmetis-4.0.3/metis/programs/cmdline_mpmetis.c
+parmetis-4.0.3/metis/programs/cmdline_ndmetis.c
+parmetis-4.0.3/metis/programs/cmpfillin.c
+parmetis-4.0.3/metis/programs/defs.h
+parmetis-4.0.3/metis/programs/gpmetis.c
+parmetis-4.0.3/metis/programs/graphchk.c
+parmetis-4.0.3/metis/programs/io.c
+parmetis-4.0.3/metis/programs/m2gmetis.c
+parmetis-4.0.3/metis/programs/metisbin.h
+parmetis-4.0.3/metis/programs/mpmetis.c
+parmetis-4.0.3/metis/programs/ndmetis.c
+parmetis-4.0.3/metis/programs/proto.h
+parmetis-4.0.3/metis/programs/smbfactor.c
+parmetis-4.0.3/metis/programs/stat.c
+parmetis-4.0.3/metis/programs/struct.h
+parmetis-4.0.3/metis/libmetis/auxapi.c
+parmetis-4.0.3/metis/libmetis/balance.c
+parmetis-4.0.3/metis/libmetis/bucketsort.c
+parmetis-4.0.3/metis/libmetis/checkgraph.c
+parmetis-4.0.3/metis/libmetis/CMakeLists.txt
+parmetis-4.0.3/metis/libmetis/coarsen.c
+parmetis-4.0.3/metis/libmetis/compress.c
+parmetis-4.0.3/metis/libmetis/contig.c
+parmetis-4.0.3/metis/libmetis/debug.c
+parmetis-4.0.3/metis/libmetis/defs.h
+parmetis-4.0.3/metis/libmetis/fm.c
+parmetis-4.0.3/metis/libmetis/fortran.c
+parmetis-4.0.3/metis/libmetis/frename.c
+parmetis-4.0.3/metis/libmetis/gklib.c
+parmetis-4.0.3/metis/libmetis/gklib_defs.h
+parmetis-4.0.3/metis/libmetis/gklib_rename.h
+parmetis-4.0.3/metis/libmetis/graph.c
+parmetis-4.0.3/metis/libmetis/initpart.c
+parmetis-4.0.3/metis/libmetis/kmetis.c
+parmetis-4.0.3/metis/libmetis/kwayfm.c
+parmetis-4.0.3/metis/libmetis/kwayrefine.c
+parmetis-4.0.3/metis/libmetis/macros.h
+parmetis-4.0.3/metis/libmetis/mcutil.c
+parmetis-4.0.3/metis/libmetis/mesh.c
+parmetis-4.0.3/metis/libmetis/meshpart.c
+parmetis-4.0.3/metis/libmetis/metislib.h
+parmetis-4.0.3/metis/libmetis/minconn.c
+parmetis-4.0.3/metis/libmetis/mincover.c
+parmetis-4.0.3/metis/libmetis/mmd.c
+parmetis-4.0.3/metis/libmetis/ometis.c
+parmetis-4.0.3/metis/libmetis/options.c
+parmetis-4.0.3/metis/libmetis/parmetis.c
+parmetis-4.0.3/metis/libmetis/pmetis.c
+parmetis-4.0.3/metis/libmetis/proto.h
+parmetis-4.0.3/metis/libmetis/refine.c
+parmetis-4.0.3/metis/libmetis/rename.h
+parmetis-4.0.3/metis/libmetis/separator.c
+parmetis-4.0.3/metis/libmetis/sfm.c
+parmetis-4.0.3/metis/libmetis/srefine.c
+parmetis-4.0.3/metis/libmetis/stat.c
+parmetis-4.0.3/metis/libmetis/stdheaders.h
+parmetis-4.0.3/metis/libmetis/struct.h
+parmetis-4.0.3/metis/libmetis/timing.c
+parmetis-4.0.3/metis/libmetis/util.c
+parmetis-4.0.3/metis/libmetis/wspace.c
+parmetis-4.0.3/metis/include/CMakeLists.txt
+parmetis-4.0.3/metis/include/metis.h
+parmetis-4.0.3/metis/GKlib/b64.c
+parmetis-4.0.3/metis/GKlib/blas.c
+parmetis-4.0.3/metis/GKlib/BUILD.txt
+parmetis-4.0.3/metis/GKlib/CMakeLists.txt
+parmetis-4.0.3/metis/GKlib/conf/
+parmetis-4.0.3/metis/GKlib/csr.c
+parmetis-4.0.3/metis/GKlib/error.c
+parmetis-4.0.3/metis/GKlib/evaluate.c
+parmetis-4.0.3/metis/GKlib/fkvkselect.c
+parmetis-4.0.3/metis/GKlib/fs.c
+parmetis-4.0.3/metis/GKlib/getopt.c
+parmetis-4.0.3/metis/GKlib/gk_arch.h
+parmetis-4.0.3/metis/GKlib/gk_defs.h
+parmetis-4.0.3/metis/GKlib/gk_externs.h
+parmetis-4.0.3/metis/GKlib/gk_getopt.h
+parmetis-4.0.3/metis/GKlib/gk_macros.h
+parmetis-4.0.3/metis/GKlib/gk_mkblas.h
+parmetis-4.0.3/metis/GKlib/gk_mkmemory.h
+parmetis-4.0.3/metis/GKlib/gk_mkpqueue.h
+parmetis-4.0.3/metis/GKlib/gk_mkpqueue2.h
+parmetis-4.0.3/metis/GKlib/gk_mkrandom.h
+parmetis-4.0.3/metis/GKlib/gk_mksort.h
+parmetis-4.0.3/metis/GKlib/gk_mkutils.h
+parmetis-4.0.3/metis/GKlib/gk_proto.h
+parmetis-4.0.3/metis/GKlib/gk_struct.h
+parmetis-4.0.3/metis/GKlib/gk_types.h
+parmetis-4.0.3/metis/GKlib/GKlib.h
+parmetis-4.0.3/metis/GKlib/GKlibSystem.cmake
+parmetis-4.0.3/metis/GKlib/gkregex.c
+parmetis-4.0.3/metis/GKlib/gkregex.h
+parmetis-4.0.3/metis/GKlib/graph.c
+parmetis-4.0.3/metis/GKlib/htable.c
+parmetis-4.0.3/metis/GKlib/io.c
+parmetis-4.0.3/metis/GKlib/itemsets.c
+parmetis-4.0.3/metis/GKlib/Makefile
+parmetis-4.0.3/metis/GKlib/mcore.c
+parmetis-4.0.3/metis/GKlib/memory.c
+parmetis-4.0.3/metis/GKlib/ms_inttypes.h
+parmetis-4.0.3/metis/GKlib/ms_stat.h
+parmetis-4.0.3/metis/GKlib/ms_stdint.h
+parmetis-4.0.3/metis/GKlib/omp.c
+parmetis-4.0.3/metis/GKlib/pdb.c
+parmetis-4.0.3/metis/GKlib/pqueue.c
+parmetis-4.0.3/metis/GKlib/random.c
+parmetis-4.0.3/metis/GKlib/rw.c
+parmetis-4.0.3/metis/GKlib/seq.c
+parmetis-4.0.3/metis/GKlib/sort.c
+parmetis-4.0.3/metis/GKlib/string.c
+parmetis-4.0.3/metis/GKlib/test/
+parmetis-4.0.3/metis/GKlib/timers.c
+parmetis-4.0.3/metis/GKlib/tokenizer.c
+parmetis-4.0.3/metis/GKlib/util.c
+parmetis-4.0.3/metis/GKlib/test/CMakeLists.txt
+parmetis-4.0.3/metis/GKlib/test/fis.c
+parmetis-4.0.3/metis/GKlib/test/gkgraph.c
+parmetis-4.0.3/metis/GKlib/test/gksort.c
+parmetis-4.0.3/metis/GKlib/test/Makefile.in.old
+parmetis-4.0.3/metis/GKlib/test/Makefile.old
+parmetis-4.0.3/metis/GKlib/test/rw.c
+parmetis-4.0.3/metis/GKlib/test/strings.c
+parmetis-4.0.3/metis/GKlib/conf/check_thread_storage.c
+parmetis-4.0.3/manual/manual.pdf
+parmetis-4.0.3/libparmetis/akwayfm.c
+parmetis-4.0.3/libparmetis/ametis.c
+parmetis-4.0.3/libparmetis/balancemylink.c
+parmetis-4.0.3/libparmetis/CMakeLists.txt
+parmetis-4.0.3/libparmetis/comm.c
+parmetis-4.0.3/libparmetis/csrmatch.c
+parmetis-4.0.3/libparmetis/ctrl.c
+parmetis-4.0.3/libparmetis/debug.c
+parmetis-4.0.3/libparmetis/defs.h
+parmetis-4.0.3/libparmetis/diffutil.c
+parmetis-4.0.3/libparmetis/frename.c
+parmetis-4.0.3/libparmetis/gkmetis.c
+parmetis-4.0.3/libparmetis/gkmpi.c
+parmetis-4.0.3/libparmetis/graph.c
+parmetis-4.0.3/libparmetis/initbalance.c
+parmetis-4.0.3/libparmetis/initmsection.c
+parmetis-4.0.3/libparmetis/initpart.c
+parmetis-4.0.3/libparmetis/kmetis.c
+parmetis-4.0.3/libparmetis/kwayrefine.c
+parmetis-4.0.3/libparmetis/macros.h
+parmetis-4.0.3/libparmetis/match.c
+parmetis-4.0.3/libparmetis/mdiffusion.c
+parmetis-4.0.3/libparmetis/mesh.c
+parmetis-4.0.3/libparmetis/mmetis.c
+parmetis-4.0.3/libparmetis/move.c
+parmetis-4.0.3/libparmetis/msetup.c
+parmetis-4.0.3/libparmetis/node_refine.c
+parmetis-4.0.3/libparmetis/ometis.c
+parmetis-4.0.3/libparmetis/parmetislib.h
+parmetis-4.0.3/libparmetis/proto.h
+parmetis-4.0.3/libparmetis/pspases.c
+parmetis-4.0.3/libparmetis/redomylink.c
+parmetis-4.0.3/libparmetis/remap.c
+parmetis-4.0.3/libparmetis/rename.h
+parmetis-4.0.3/libparmetis/renumber.c
+parmetis-4.0.3/libparmetis/rmetis.c
+parmetis-4.0.3/libparmetis/selectq.c
+parmetis-4.0.3/libparmetis/serial.c
+parmetis-4.0.3/libparmetis/stat.c
+parmetis-4.0.3/libparmetis/struct.h
+parmetis-4.0.3/libparmetis/timer.c
+parmetis-4.0.3/libparmetis/util.c
+parmetis-4.0.3/libparmetis/wave.c
+parmetis-4.0.3/libparmetis/weird.c
+parmetis-4.0.3/libparmetis/wspace.c
+parmetis-4.0.3/libparmetis/xyzpart.c
+parmetis-4.0.3/include/CMakeLists.txt
+parmetis-4.0.3/include/parmetis.h
+parmetis-4.0.3/Graphs/bricks.hex3d
+parmetis-4.0.3/Graphs/rotor.graph
+parmetis-4.0.3/Graphs/rotor.graph.xyz
+rm -rf build/MSYS_NT-10.0-17763-x86_64
+mkdir -p build/MSYS_NT-10.0-17763-x86_64
+cd build/MSYS_NT-10.0-17763-x86_64 && cmake /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src -DCMAKE_VERBOSE_MAKEFILE=1 -DGKLIB_PATH=/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -DMETIS_PATH=/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install -DLOCAL_MSMPI=1 -DMSMPI_ROOT=/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI -DCMAKE_INSTALL_PREFIX=/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install -DSHARED=1 -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
+CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
+  Compatibility with CMake < 2.8.12 will be removed from a future version of
+  CMake.
+
+  Update the VERSION argument <min> value or use a ...<max> suffix to tell
+  CMake that the project does not need compatibility with older versions.
+
+
+-- The C compiler identification is GNU 10.2.0
+-- The CXX compiler identification is GNU 10.2.0
+CMake Warning at /usr/share/cmake-3.19.3/Modules/Platform/MSYS.cmake:15 (message):
+  CMake no longer defines WIN32 on MSYS!
+
+  (1) If you are just trying to build this project, ignore this warning or
+  quiet it by setting CMAKE_LEGACY_CYGWIN_WIN32=0 in your environment or in
+  the CMake cache.  If later configuration or build errors occur then this
+  project may have been written under the assumption that MSYS is WIN32.  In
+  that case, set CMAKE_LEGACY_CYGWIN_WIN32=1 instead.
+
+  (2) If you are developing this project, add the line
+
+    set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
+
+  at the top of your top-level CMakeLists.txt file or set the minimum
+  required version of CMake to 2.8.4 or higher.  Then teach your project to
+  build on Cygwin without WIN32.
+Call Stack (most recent call first):
+  /usr/share/cmake-3.19.3/Modules/CMakeSystemSpecificInformation.cmake:27 (include)
+  CMakeLists.txt:2 (project)
+
+
+-- Detecting C compiler ABI info
+-- Detecting C compiler ABI info - done
+-- Check for working C compiler: /usr/bin/gcc - skipped
+-- Detecting C compile features
+-- Detecting C compile features - done
+-- Detecting CXX compiler ABI info
+-- Detecting CXX compiler ABI info - done
+-- Check for working CXX compiler: /usr/bin/g++ - skipped
+-- Detecting CXX compile features
+-- Detecting CXX compile features - done
+-- Looking for execinfo.h
+-- Looking for execinfo.h - not found
+-- Looking for getline
+-- Looking for getline - found
+-- checking for thread-local storage - found
+-- Found user-supplied METIS: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/lib/libmetis.dll
+-- MSMPI: /c/Windows/System32/msmpi.dll
+-- Configuring done
+-- Generating done
+-- Build files have been written to: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64
+make[1]: warning: -j4 forced in submake: resetting jobserver mode.
+make[1]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+/usr/bin/cmake.exe -S/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src -B/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 --check-build-system CMakeFiles/Makefile.cmake 0
+/usr/bin/cmake.exe -E cmake_progress_start /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/CMakeFiles /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64//CMakeFiles/progress.marks
+make  -f CMakeFiles/Makefile2 all
+make[2]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make  -f libparmetis/CMakeFiles/parmetis.dir/build.make libparmetis/CMakeFiles/parmetis.dir/depend
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis/CMakeFiles/parmetis.dir/DependInfo.cmake --color=
+Scanning dependencies of target parmetis
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make  -f libparmetis/CMakeFiles/parmetis.dir/build.make libparmetis/CMakeFiles/parmetis.dir/build
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+[  1%] Building C object libparmetis/CMakeFiles/parmetis.dir/akwayfm.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/akwayfm.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/akwayfm.c
+[  3%] Building C object libparmetis/CMakeFiles/parmetis.dir/ametis.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/ametis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/ametis.c
+[  5%] Building C object libparmetis/CMakeFiles/parmetis.dir/balancemylink.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/balancemylink.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/balancemylink.c
+[  7%] Building C object libparmetis/CMakeFiles/parmetis.dir/comm.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/comm.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/comm.c
+/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/balancemylink.c: In function ‘libparmetis__BalanceMyLink’:
+/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/balancemylink.c:324:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
+  324 |     if (where[i] != home[i])
+      |     ^~
+/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/balancemylink.c:327:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
+  327 |       for (j=xadj[i]; j<xadj[i+1]; j++) {
+      |       ^~~
+[  9%] Building C object libparmetis/CMakeFiles/parmetis.dir/csrmatch.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/csrmatch.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/csrmatch.c
+[ 11%] Building C object libparmetis/CMakeFiles/parmetis.dir/ctrl.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/ctrl.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/ctrl.c
+[ 12%] Building C object libparmetis/CMakeFiles/parmetis.dir/debug.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/debug.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/debug.c
+[ 14%] Building C object libparmetis/CMakeFiles/parmetis.dir/diffutil.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/diffutil.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/diffutil.c
+[ 16%] Building C object libparmetis/CMakeFiles/parmetis.dir/frename.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/frename.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/frename.c
+[ 18%] Building C object libparmetis/CMakeFiles/parmetis.dir/gkmetis.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/gkmetis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/gkmetis.c
+[ 20%] Building C object libparmetis/CMakeFiles/parmetis.dir/gkmpi.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/gkmpi.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/gkmpi.c
+[ 22%] Building C object libparmetis/CMakeFiles/parmetis.dir/graph.c.o
+[ 24%] Building C object libparmetis/CMakeFiles/parmetis.dir/initbalance.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/graph.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/graph.c
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/initbalance.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/initbalance.c
+[ 25%] Building C object libparmetis/CMakeFiles/parmetis.dir/initmsection.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/initmsection.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/initmsection.c
+[ 27%] Building C object libparmetis/CMakeFiles/parmetis.dir/initpart.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/initpart.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/initpart.c
+[ 29%] Building C object libparmetis/CMakeFiles/parmetis.dir/kmetis.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/kmetis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/kmetis.c
+[ 31%] Building C object libparmetis/CMakeFiles/parmetis.dir/kwayrefine.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/kwayrefine.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/kwayrefine.c
+[ 33%] Building C object libparmetis/CMakeFiles/parmetis.dir/match.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/match.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/match.c
+[ 35%] Building C object libparmetis/CMakeFiles/parmetis.dir/mdiffusion.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/mdiffusion.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/mdiffusion.c
+[ 37%] Building C object libparmetis/CMakeFiles/parmetis.dir/mesh.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/mesh.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/mesh.c
+[ 38%] Building C object libparmetis/CMakeFiles/parmetis.dir/mmetis.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/mmetis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/mmetis.c
+[ 40%] Building C object libparmetis/CMakeFiles/parmetis.dir/move.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/move.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/move.c
+[ 42%] Building C object libparmetis/CMakeFiles/parmetis.dir/msetup.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/msetup.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/msetup.c
+[ 44%] Building C object libparmetis/CMakeFiles/parmetis.dir/node_refine.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/node_refine.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/node_refine.c
+[ 46%] Building C object libparmetis/CMakeFiles/parmetis.dir/ometis.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/ometis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/ometis.c
+[ 48%] Building C object libparmetis/CMakeFiles/parmetis.dir/pspases.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/pspases.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/pspases.c
+[ 50%] Building C object libparmetis/CMakeFiles/parmetis.dir/redomylink.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/redomylink.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/redomylink.c
+[ 51%] Building C object libparmetis/CMakeFiles/parmetis.dir/remap.c.o
+[ 53%] Building C object libparmetis/CMakeFiles/parmetis.dir/renumber.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/renumber.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/renumber.c
+[ 55%] Building C object libparmetis/CMakeFiles/parmetis.dir/rmetis.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/remap.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/remap.c
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/rmetis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/rmetis.c
+[ 57%] Building C object libparmetis/CMakeFiles/parmetis.dir/selectq.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/selectq.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/selectq.c
+[ 59%] Building C object libparmetis/CMakeFiles/parmetis.dir/serial.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/serial.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/serial.c
+[ 61%] Building C object libparmetis/CMakeFiles/parmetis.dir/stat.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/stat.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/stat.c
+[ 62%] Building C object libparmetis/CMakeFiles/parmetis.dir/timer.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/timer.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/timer.c
+[ 64%] Building C object libparmetis/CMakeFiles/parmetis.dir/util.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/util.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/util.c
+[ 66%] Building C object libparmetis/CMakeFiles/parmetis.dir/wave.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/wave.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/wave.c
+[ 68%] Building C object libparmetis/CMakeFiles/parmetis.dir/weird.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/weird.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/weird.c
+/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/wave.c: In function ‘libparmetis__WavefrontDiffusion’:
+/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/wave.c:253:1: warning: label ‘CleanUpAndExit’ defined but not used [-Wunused-label]
+  253 | CleanUpAndExit:
+      | ^~~~~~~~~~~~~~
+[ 70%] Building C object libparmetis/CMakeFiles/parmetis.dir/wspace.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/wspace.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/wspace.c
+[ 72%] Building C object libparmetis/CMakeFiles/parmetis.dir/xyzpart.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/xyzpart.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/xyzpart.c
+[ 74%] Linking C shared library msys-parmetis.dll
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/cmake.exe -E cmake_link_script CMakeFiles/parmetis.dir/link.txt --verbose=1
+/usr/bin/gcc  -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -shared -Wl,--enable-auto-import -o msys-parmetis.dll -Wl,--out-implib,libparmetis.dll.a -Wl,--major-image-version,0,--minor-image-version,0 CMakeFiles/parmetis.dir/akwayfm.c.o CMakeFiles/parmetis.dir/ametis.c.o CMakeFiles/parmetis.dir/balancemylink.c.o CMakeFiles/parmetis.dir/comm.c.o CMakeFiles/parmetis.dir/csrmatch.c.o CMakeFiles/parmetis.dir/ctrl.c.o CMakeFiles/parmetis.dir/debug.c.o CMakeFiles/parmetis.dir/diffutil.c.o CMakeFiles/parmetis.dir/frename.c.o CMakeFiles/parmetis.dir/gkmetis.c.o CMakeFiles/parmetis.dir/gkmpi.c.o CMakeFiles/parmetis.dir/graph.c.o CMakeFiles/parmetis.dir/initbalance.c.o CMakeFiles/parmetis.dir/initmsection.c.o CMakeFiles/parmetis.dir/initpart.c.o CMakeFiles/parmetis.dir/kmetis.c.o CMakeFiles/parmetis.dir/kwayrefine.c.o CMakeFiles/parmetis.dir/match.c.o CMakeFiles/parmetis.dir/mdiffusion.c.o CMakeFiles/parmetis.dir/mesh.c.o CMakeFiles/parmetis.dir/mmetis.c.o CMakeFiles/parmetis.dir/move.c.o CMakeFiles/parmetis.dir/msetup.c.o CMakeFiles/parmetis.dir/node_refine.c.o CMakeFiles/parmetis.dir/ometis.c.o CMakeFiles/parmetis.dir/pspases.c.o CMakeFiles/parmetis.dir/redomylink.c.o CMakeFiles/parmetis.dir/remap.c.o CMakeFiles/parmetis.dir/renumber.c.o CMakeFiles/parmetis.dir/rmetis.c.o CMakeFiles/parmetis.dir/selectq.c.o CMakeFiles/parmetis.dir/serial.c.o CMakeFiles/parmetis.dir/stat.c.o CMakeFiles/parmetis.dir/timer.c.o CMakeFiles/parmetis.dir/util.c.o CMakeFiles/parmetis.dir/wave.c.o CMakeFiles/parmetis.dir/weird.c.o CMakeFiles/parmetis.dir/wspace.c.o CMakeFiles/parmetis.dir/xyzpart.c.o  -lmetis /c/Windows/System32/msmpi.dll 
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+[ 74%] Built target parmetis
+make  -f programs/CMakeFiles/pometis.dir/build.make programs/CMakeFiles/pometis.dir/depend
+make  -f programs/CMakeFiles/parmetis_prog.dir/build.make programs/CMakeFiles/parmetis_prog.dir/depend
+make  -f programs/CMakeFiles/mtest.dir/build.make programs/CMakeFiles/mtest.dir/depend
+make  -f programs/CMakeFiles/ptest.dir/build.make programs/CMakeFiles/ptest.dir/depend
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/pometis.dir/DependInfo.cmake --color=
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/parmetis_prog.dir/DependInfo.cmake --color=
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/mtest.dir/DependInfo.cmake --color=
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/ptest.dir/DependInfo.cmake --color=
+Scanning dependencies of target pometis
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+Scanning dependencies of target mtest
+make  -f programs/CMakeFiles/pometis.dir/build.make programs/CMakeFiles/pometis.dir/build
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+Scanning dependencies of target parmetis_prog
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make  -f programs/CMakeFiles/mtest.dir/build.make programs/CMakeFiles/mtest.dir/build
+Scanning dependencies of target ptest
+make  -f programs/CMakeFiles/parmetis_prog.dir/build.make programs/CMakeFiles/parmetis_prog.dir/build
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make  -f programs/CMakeFiles/ptest.dir/build.make programs/CMakeFiles/ptest.dir/build
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+[ 75%] Building C object programs/CMakeFiles/pometis.dir/pometis.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/pometis.dir/pometis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/pometis.c
+[ 77%] Building C object programs/CMakeFiles/mtest.dir/mtest.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/mtest.dir/mtest.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/mtest.c
+[ 79%] Building C object programs/CMakeFiles/ptest.dir/ptest.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/ptest.dir/ptest.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/ptest.c
+[ 81%] Building C object programs/CMakeFiles/parmetis_prog.dir/parmetis.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis_prog.dir/parmetis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/parmetis.c
+/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/ptest.c: In function ‘TestParMetis_GPart’:
+/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/ptest.c:166:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
+  166 |     if (mype == 0)
+      |     ^~
+/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/ptest.c:169:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
+  169 |       ParMETIS_V3_PartGeom(graph.vtxdist, &ndims, xyz, part, &comm);
+      |       ^~~~~~~~~~~~~~~~~~~~
+[ 83%] Building C object programs/CMakeFiles/pometis.dir/io.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/pometis.dir/io.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/io.c
+[ 85%] Building C object programs/CMakeFiles/mtest.dir/io.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/mtest.dir/io.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/io.c
+[ 87%] Building C object programs/CMakeFiles/parmetis_prog.dir/io.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis_prog.dir/io.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/io.c
+[ 88%] Building C object programs/CMakeFiles/ptest.dir/io.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/ptest.dir/io.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/io.c
+[ 90%] Linking C executable pometis.exe
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/cmake.exe -E cmake_link_script CMakeFiles/pometis.dir/link.txt --verbose=1
+/usr/bin/gcc  -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -Wl,--enable-auto-import CMakeFiles/pometis.dir/pometis.c.o CMakeFiles/pometis.dir/io.c.o -o pometis.exe -Wl,--out-implib,libpometis.dll.a -Wl,--major-image-version,0,--minor-image-version,0  ../libparmetis/libparmetis.dll.a -lmetis /c/Windows/System32/msmpi.dll 
+[ 92%] Linking C executable mtest.exe
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/cmake.exe -E cmake_link_script CMakeFiles/mtest.dir/link.txt --verbose=1
+/usr/bin/gcc  -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -Wl,--enable-auto-import CMakeFiles/mtest.dir/mtest.c.o CMakeFiles/mtest.dir/io.c.o -o mtest.exe -Wl,--out-implib,libmtest.dll.a -Wl,--major-image-version,0,--minor-image-version,0  ../libparmetis/libparmetis.dll.a -lmetis /c/Windows/System32/msmpi.dll 
+[ 94%] Building C object programs/CMakeFiles/parmetis_prog.dir/adaptgraph.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis_prog.dir/adaptgraph.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/adaptgraph.c
+[ 96%] Building C object programs/CMakeFiles/ptest.dir/adaptgraph.c.o
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/ptest.dir/adaptgraph.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/adaptgraph.c
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+[ 96%] Built target pometis
+[ 96%] Built target mtest
+[ 98%] Linking C executable parmetis.exe
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/cmake.exe -E cmake_link_script CMakeFiles/parmetis_prog.dir/link.txt --verbose=1
+/usr/bin/gcc  -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -Wl,--enable-auto-import CMakeFiles/parmetis_prog.dir/parmetis.c.o CMakeFiles/parmetis_prog.dir/io.c.o CMakeFiles/parmetis_prog.dir/adaptgraph.c.o -o parmetis.exe -Wl,--out-implib,libparmetis.dll.a -Wl,--major-image-version,0,--minor-image-version,0  ../libparmetis/libparmetis.dll.a -lmetis /c/Windows/System32/msmpi.dll 
+[100%] Linking C executable ptest.exe
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/cmake.exe -E cmake_link_script CMakeFiles/ptest.dir/link.txt --verbose=1
+/usr/bin/gcc  -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -Wl,--enable-auto-import CMakeFiles/ptest.dir/ptest.c.o CMakeFiles/ptest.dir/io.c.o CMakeFiles/ptest.dir/adaptgraph.c.o -o ptest.exe -Wl,--out-implib,libptest.dll.a -Wl,--major-image-version,0,--minor-image-version,0  ../libparmetis/libparmetis.dll.a -lmetis /c/Windows/System32/msmpi.dll 
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+[100%] Built target parmetis_prog
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+[100%] Built target ptest
+make[2]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+/usr/bin/cmake.exe -E cmake_progress_start /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/CMakeFiles 0
+make[1]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[1]: warning: -j4 forced in submake: resetting jobserver mode.
+make[1]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+/usr/bin/cmake.exe -S/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src -B/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 --check-build-system CMakeFiles/Makefile.cmake 0
+/usr/bin/cmake.exe -E cmake_progress_start /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/CMakeFiles /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64//CMakeFiles/progress.marks
+make  -f CMakeFiles/Makefile2 all
+make[2]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make  -f libparmetis/CMakeFiles/parmetis.dir/build.make libparmetis/CMakeFiles/parmetis.dir/depend
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis/CMakeFiles/parmetis.dir/DependInfo.cmake --color=
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make  -f libparmetis/CMakeFiles/parmetis.dir/build.make libparmetis/CMakeFiles/parmetis.dir/build
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[3]: Nothing to be done for 'libparmetis/CMakeFiles/parmetis.dir/build'.
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+[ 74%] Built target parmetis
+make  -f programs/CMakeFiles/pometis.dir/build.make programs/CMakeFiles/pometis.dir/depend
+make  -f programs/CMakeFiles/parmetis_prog.dir/build.make programs/CMakeFiles/parmetis_prog.dir/depend
+make  -f programs/CMakeFiles/mtest.dir/build.make programs/CMakeFiles/mtest.dir/depend
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/pometis.dir/DependInfo.cmake --color=
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/parmetis_prog.dir/DependInfo.cmake --color=
+make  -f programs/CMakeFiles/ptest.dir/build.make programs/CMakeFiles/ptest.dir/depend
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/ptest.dir/DependInfo.cmake --color=
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/mtest.dir/DependInfo.cmake --color=
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make  -f programs/CMakeFiles/parmetis_prog.dir/build.make programs/CMakeFiles/parmetis_prog.dir/build
+make  -f programs/CMakeFiles/pometis.dir/build.make programs/CMakeFiles/pometis.dir/build
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[3]: Nothing to be done for 'programs/CMakeFiles/parmetis_prog.dir/build'.
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[3]: Nothing to be done for 'programs/CMakeFiles/pometis.dir/build'.
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make  -f programs/CMakeFiles/ptest.dir/build.make programs/CMakeFiles/ptest.dir/build
+make  -f programs/CMakeFiles/mtest.dir/build.make programs/CMakeFiles/mtest.dir/build
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[3]: Nothing to be done for 'programs/CMakeFiles/ptest.dir/build'.
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+[ 79%] Built target pometis
+[ 87%] Built target parmetis_prog
+make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[3]: Nothing to be done for 'programs/CMakeFiles/mtest.dir/build'.
+make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+[ 94%] Built target ptest
+[100%] Built target mtest
+make[2]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+/usr/bin/cmake.exe -E cmake_progress_start /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/CMakeFiles 0
+make  -f CMakeFiles/Makefile2 preinstall
+make[2]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+make[2]: Nothing to be done for 'preinstall'.
+make[2]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+Install the project...
+/usr/bin/cmake.exe -P cmake_install.cmake
+-- Install configuration: ""
+-- Installing: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install/include/parmetis.h
+-- Installing: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install/lib/libparmetis.dll.a
+-- Installing: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install/lib/msys-parmetis.dll
+-- Installing: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install/bin/ptest.exe
+-- Installing: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install/bin/mtest.exe
+-- Installing: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install/bin/parmetis.exe
+-- Installing: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install/bin/pometis.exe
+make[1]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
Index: /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/CMakeLists.txt
===================================================================
--- /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/CMakeLists.txt	(revision 26744)
+++ /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/CMakeLists.txt	(revision 26744)
@@ -0,0 +1,45 @@
+cmake_minimum_required(VERSION 2.8)
+project(ParMETIS)
+
+set(GKLIB_PATH METIS/GKlib CACHE PATH "path to GKlib")
+set(METIS_PATH METIS CACHE PATH "path to METIS")
+
+# Symlink ./metis to wherever metis is. This allows files to be
+# included from metis/libmetis/.
+#execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${METIS_PATH} metis)
+
+# Search for MPI.
+# GK commented this out as it seems to be creating problems
+# include(FindMPI)
+# if(NOT MPI_FOUND)
+#   message(FATAL_ERROR "mpi is not found")
+# endif()
+# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_COMPILE_FLAGS}")
+
+# Prepare libraries.
+if(SHARED)
+  set(ParMETIS_LIBRARY_TYPE SHARED)
+else()
+  set(ParMETIS_LIBRARY_TYPE STATIC)
+endif()
+
+include(${GKLIB_PATH}/GKlibSystem.cmake)
+
+# List of paths that the compiler will search for header files.
+# i.e., the -I equivalent
+include_directories(include)
+include_directories(${GKLIB_PATH})
+include_directories(${METIS_PATH}/include)
+
+if(LOCAL_MSMPI)
+	include_directories(${MSMPI_ROOT}/include)
+endif()
+
+# List of directories that cmake will look for CMakeLists.txt
+#add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis)
+add_subdirectory(include)
+add_subdirectory(libparmetis)
+add_subdirectory(programs)
+
+# This is for testing during development and is not being distributed
+#add_subdirectory(test)
Index: /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/Makefile
===================================================================
--- /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/Makefile	(revision 26744)
+++ /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/Makefile	(revision 26744)
@@ -0,0 +1,133 @@
+# Configuration options.
+gdb              = not-set
+assert           = not-set
+assert2          = not-set
+debug            = not-set
+openmp           = not-set
+prefix           = not-set
+gklib_path       = not-set
+metis_path       = not-set
+msmpi_root       = not-set
+shared           = not-set
+cc               = mpicc
+cxx              = mpicxx
+ar               = not-set
+gcc-ar           = not-set
+ranlib           = not-set
+gcc-ranlib       = not-set
+linker           = not-set
+nm               = not-set
+objcopy          = not-set
+objdump          = not-set
+rc               = not-set
+strip            = not-set
+
+
+# Basically proxies everything to the builddir cmake.
+
+PKGNAME = parmetis-4.0.3
+
+cputype = $(shell uname -m | sed "s/\\ /_/g")
+systype = $(shell uname -s)
+
+BUILDDIR = build/$(systype)-$(cputype)
+
+# Process configuration options.
+CONFIG_FLAGS = -DCMAKE_VERBOSE_MAKEFILE=1
+ifeq ($(gklib_path), not-set)
+    gklib_path = metis/GKlib
+endif
+ifeq ($(metis_path), not-set)
+    metis_path = metis
+endif
+CONFIG_FLAGS += -DGKLIB_PATH=$(abspath $(gklib_path)) -DMETIS_PATH=$(abspath $(metis_path))
+ifneq ($(local_msmpi), not-set)
+    CONFIG_FLAGS += -DLOCAL_MSMPI=1 -DMSMPI_ROOT=$(abspath $(msmpi_root))
+endif
+ifneq ($(gdb), not-set)
+    CONFIG_FLAGS += -DGDB=$(gdb)
+endif
+ifneq ($(assert), not-set)
+    CONFIG_FLAGS += -DASSERT=$(assert)
+endif
+ifneq ($(assert2), not-set)
+    CONFIG_FLAGS += -DASSERT2=$(assert2)
+endif
+ifneq ($(debug), not-set)
+    CONFIG_FLAGS += -DDEBUG=$(debug)
+endif
+ifneq ($(openmp), not-set)
+    CONFIG_FLAGS += -DOPENMP=$(openmp)
+endif
+ifneq ($(prefix), not-set)
+    CONFIG_FLAGS += -DCMAKE_INSTALL_PREFIX=$(prefix)
+endif
+ifneq ($(shared), not-set)
+    CONFIG_FLAGS += -DSHARED=1
+endif
+ifneq ($(cc), not-set)
+    CONFIG_FLAGS += -DCMAKE_C_COMPILER=$(cc)
+endif
+ifneq ($(cxx), not-set)
+    CONFIG_FLAGS += -DCMAKE_CXX_COMPILER=$(cxx)
+endif
+ifneq ($(ar), not-set)
+    CONFIG_FLAGS += -DCMAKE_AR=$(ar)
+endif
+ifneq ($(gcc-ar), not-set)
+    CONFIG_FLAGS += -DCMAKE_C_COMPILER_AR=$(gcc-ar) -DCMAKE_CXX_COMPILER_AR=$(gcc-ar)
+endif
+ifneq ($(ranlib), not-set)
+    CONFIG_FLAGS += -DCMAKE_RANLIB=$(ranlib)
+endif
+ifneq ($(gcc-ranlib), not-set)
+    CONFIG_FLAGS += -DCMAKE_C_COMPILER_RANLIB=$(gcc-ranlib) -DCMAKE_CXX_COMPILER_RANLIB=$(gcc-ranlib)
+endif
+ifneq ($(linker), not-set)
+    CONFIG_FLAGS += -DCMAKE_LINKER=$(linker)
+endif
+ifneq ($(nm), not-set)
+    CONFIG_FLAGS += -DCMAKE_NM=$(nm)
+endif
+ifneq ($(objcopy), not-set)
+    CONFIG_FLAGS += -DCMAKE_OBJCOPY=$(objcopy)
+endif
+ifneq ($(objdump), not-set)
+    CONFIG_FLAGS += -DCMAKE_OBJDUMP=$(objdump)
+endif
+ifneq ($(rc), not-set)
+    CONFIG_FLAGS += -DCMAKE_RC_COMPILER=$(rc)
+endif
+ifneq ($(strip), not-set)
+    CONFIG_FLAGS += -DCMAKE_STRIP=$(strip)
+endif
+
+define run-config
+mkdir -p $(BUILDDIR)
+cd $(BUILDDIR) && cmake $(CURDIR) $(CONFIG_FLAGS)
+endef
+
+all clean install:
+	@if [ ! -f $(BUILDDIR)/Makefile ]; then \
+		more BUILD.txt; \
+	else \
+	  	make -C $(BUILDDIR) $@ $(MAKEFLAGS); \
+	fi
+
+uninstall:
+	xargs rm < $(BUILDDIR)/install_manifest.txt
+
+config: distclean
+	$(run-config)
+
+distclean:
+	rm -rf $(BUILDDIR)
+
+remake:
+	find . -name CMakeLists.txt -exec touch {} ';'
+
+dist:
+	util/mkdist.sh $(PKGNAME)
+
+
+.PHONY: config distclean dist all clean install uninstall remake
Index: /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/gcc/libparmetis/CMakeLists.txt
===================================================================
--- /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/gcc/libparmetis/CMakeLists.txt	(revision 26744)
+++ /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/gcc/libparmetis/CMakeLists.txt	(revision 26744)
@@ -0,0 +1,32 @@
+# Include directories for library code.
+include_directories(.)
+# Find sources.
+file(GLOB parmetis_sources *.c)
+# Create libparmetis
+add_library(parmetis ${ParMETIS_LIBRARY_TYPE} ${parmetis_sources})
+
+# Link with metis and MPI libraries.
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "msys-" "")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".so")
+find_library(METIS metis PATHS ${METIS_PATH}/lib)
+if(METIS)
+	message("-- Found user-supplied METIS: ${METIS}")
+	target_link_libraries(parmetis ${METIS})
+else(METIS)
+	target_link_libraries(parmetis metis)
+endif()
+
+if(LOCAL_MSMPI)
+	# Add local MS-MPI libraries
+	find_library(MSMPI msmpi PATHS ${MSMPI_ROOT}/lib)
+	message(STATUS "MSMPI: ${MSMPI}")
+	target_link_libraries(parmetis ${MSMPI})
+else(LOCAL_MSMPI)
+	target_link_libraries(parmetis ${MPI_LIBRARIES})
+	set_target_properties(parmetis PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
+endif()
+
+install(TARGETS parmetis
+  LIBRARY DESTINATION lib
+  RUNTIME DESTINATION lib
+  ARCHIVE DESTINATION lib)
Index: /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/include/parmetis.h
===================================================================
--- /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/include/parmetis.h	(revision 26744)
+++ /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/include/parmetis.h	(revision 26744)
@@ -0,0 +1,159 @@
+/*
+ * Copyright 1997-2003, Regents of the University of Minnesota
+ *
+ * parmetis.h
+ *
+ * This file contains function prototypes and constrant definitions for 
+ * ParMETIS
+ *
+ * Started 7/21/03
+ * George
+ *
+ */
+
+#ifndef __parmetis_h__
+#define __parmetis_h__
+
+#include <mpi.h>
+#include <metis.h>
+
+#if IDXTYPEWIDTH == 32
+  /*#define IDX_T         MPI_INT32_T */
+  #define IDX_T         MPI_INT
+  #define KEEP_BIT      0x40000000L
+#elif IDXTYPEWIDTH == 64
+  /*#define IDX_T         MPI_INT64_T */
+  #define IDX_T         MPI_LONG_LONG_INT
+  #define KEEP_BIT      0x4000000000000000LL
+#else
+  #error "Incorrect user-supplied value fo IDXTYPEWIDTH"
+#endif
+
+
+#if REALTYPEWIDTH == 32
+  #define REAL_T        MPI_FLOAT
+#elif REALTYPEWIDTH == 64
+  #define REAL_T        MPI_DOUBLE
+#else
+  #error "Incorrect user-supplied value fo REALTYPEWIDTH"
+#endif
+
+
+
+/*************************************************************************
+* Constants 
+**************************************************************************/
+#define PARMETIS_MAJOR_VERSION        4
+#define PARMETIS_MINOR_VERSION        0
+#define PARMETIS_SUBMINOR_VERSION     3
+
+
+/*************************************************************************
+* Function prototypes
+**************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*-------------------------------------------------------------------
+* API Introduced with Release 3.0 (current API) 
+*--------------------------------------------------------------------*/
+int __cdecl ParMETIS_V3_PartKway(
+             idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, 
+	     idx_t *adjwgt, idx_t *wgtflag, idx_t *numflag, idx_t *ncon, idx_t *nparts, 
+	     real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *edgecut, idx_t *part, 
+	     MPI_Comm *comm);
+
+int __cdecl ParMETIS_V3_PartGeomKway(
+             idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, 
+	     idx_t *adjwgt, idx_t *wgtflag, idx_t *numflag, idx_t *ndims, real_t *xyz, 
+	     idx_t *ncon, idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, 
+	     idx_t *edgecut, idx_t *part, MPI_Comm *comm);
+
+int __cdecl ParMETIS_V3_PartGeom(
+             idx_t *vtxdist, idx_t *ndims, real_t *xyz, idx_t *part, MPI_Comm *comm);
+
+int __cdecl ParMETIS_V3_RefineKway(
+             idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, 
+	     idx_t *adjwgt, idx_t *wgtflag, idx_t *numflag, idx_t *ncon, idx_t *nparts, 
+	     real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *edgecut, 
+	     idx_t *part, MPI_Comm *comm);
+
+int __cdecl ParMETIS_V3_AdaptiveRepart(
+             idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, 
+	     idx_t *vsize, idx_t *adjwgt, idx_t *wgtflag, idx_t *numflag, idx_t *ncon, 
+	     idx_t *nparts, real_t *tpwgts, real_t *ubvec, real_t *ipc2redist, 
+	     idx_t *options, idx_t *edgecut, idx_t *part, MPI_Comm *comm);
+
+int __cdecl ParMETIS_V3_Mesh2Dual(
+             idx_t *elmdist, idx_t *eptr, idx_t *eind, idx_t *numflag, 
+	     idx_t *ncommonnodes, idx_t **xadj, idx_t **adjncy, MPI_Comm *comm);
+
+int __cdecl ParMETIS_V3_PartMeshKway(
+             idx_t *elmdist, idx_t *eptr, idx_t *eind, idx_t *elmwgt, 
+	     idx_t *wgtflag, idx_t *numflag, idx_t *ncon, idx_t *ncommonnodes, idx_t *nparts, 
+	     real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *edgecut, idx_t *part, 
+	     MPI_Comm *comm);
+
+int __cdecl ParMETIS_V3_NodeND(
+             idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *numflag, 
+	     idx_t *options, idx_t *order, idx_t *sizes, MPI_Comm *comm);
+
+int __cdecl ParMETIS_V32_NodeND(
+             idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt,
+             idx_t *numflag, idx_t *mtype, idx_t *rtype, idx_t *p_nseps, idx_t *s_nseps,
+             real_t *ubfrac, idx_t *seed, idx_t *dbglvl, idx_t *order, 
+             idx_t *sizes, MPI_Comm *comm);
+
+int __cdecl ParMETIS_SerialNodeND(
+             idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *numflag, 
+             idx_t *options, idx_t *order, idx_t *sizes, MPI_Comm *comm);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/*------------------------------------------------------------------------
+* Enum type definitions 
+*-------------------------------------------------------------------------*/
+/*! Operation type codes */
+typedef enum {
+  PARMETIS_OP_KMETIS,
+  PARMETIS_OP_GKMETIS,
+  PARMETIS_OP_GMETIS,
+  PARMETIS_OP_RMETIS,
+  PARMETIS_OP_AMETIS,
+  PARMETIS_OP_OMETIS,
+  PARMETIS_OP_M2DUAL,
+  PARMETIS_OP_MKMETIS
+} pmoptype_et;
+
+
+/*************************************************************************
+* Various constants used for the different parameters
+**************************************************************************/
+/* Matching types */
+#define PARMETIS_MTYPE_LOCAL     1    /* Restrict matching to within processor vertices */
+#define PARMETIS_MTYPE_GLOBAL    2    /* Remote vertices can be matched */
+
+/* Separator refinement types */
+#define PARMETIS_SRTYPE_GREEDY    1    /* Vertices are visted from highest to lowest gain */
+#define PARMETIS_SRTYPE_2PHASE    2    /* Separators are refined in a two-phase fashion using
+                                          PARMETIS_SRTYPE_GREEDY for the 2nd phase */
+
+/* Coupling types for ParMETIS_V3_RefineKway & ParMETIS_V3_AdaptiveRepart */
+#define PARMETIS_PSR_COUPLED    1    /* # of partitions == # of processors */
+#define PARMETIS_PSR_UNCOUPLED  2    /* # of partitions != # of processors */
+
+
+/* Debug levels (fields should be ORed) */
+#define PARMETIS_DBGLVL_TIME        1      /* Perform timing analysis */
+#define PARMETIS_DBGLVL_INFO        2      /* Perform timing analysis */
+#define PARMETIS_DBGLVL_PROGRESS    4      /* Show the coarsening progress */
+#define PARMETIS_DBGLVL_REFINEINFO  8      /* Show info on communication during folding */
+#define PARMETIS_DBGLVL_MATCHINFO   16     /* Show info on matching */
+#define PARMETIS_DBGLVL_RMOVEINFO   32     /* Show info on communication during folding */
+#define PARMETIS_DBGLVL_REMAP       64     /* Determines if remapping will take place */
+
+#endif 
Index: /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/mingw64/libparmetis/CMakeLists.txt
===================================================================
--- /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/mingw64/libparmetis/CMakeLists.txt	(revision 26744)
+++ /issm/trunk/externalpackages/parmetis/configs/4.0/win/msys2/mingw64/libparmetis/CMakeLists.txt	(revision 26744)
@@ -0,0 +1,32 @@
+# Include directories for library code.
+include_directories(.)
+# Find sources.
+file(GLOB parmetis_sources *.c)
+# Create libparmetis
+add_library(parmetis ${ParMETIS_LIBRARY_TYPE} ${parmetis_sources})
+
+# Link with metis and MPI libraries.
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "msys-" "")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".so")
+find_library(METIS metis PATHS ${METIS_PATH}/lib)
+if(METIS)
+	message("-- Found user-supplied METIS: ${METIS}")
+	target_link_libraries(parmetis ${METIS})
+else(METIS)
+	target_link_libraries(parmetis metis)
+endif()
+
+if(LOCAL_MSMPI)
+	# Add local MS-MPI libraries
+	find_library(MSMPI msmpi PATHS ${MSMPI_ROOT}/lib)
+	message(STATUS "MSMPI: ${MSMPI}")
+	target_link_libraries(parmetis ${MSMPI})
+else(LOCAL_MSMPI)
+	target_link_libraries(parmetis ${MPI_LIBRARIES})
+	set_target_properties(parmetis PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
+endif()
+
+install(TARGETS parmetis
+  LIBRARY DESTINATION lib
+  RUNTIME DESTINATION lib
+  ARCHIVE DESTINATION lib)
Index: /issm/trunk/externalpackages/parmetis/install-4-win-msys2-gcc-msmpi.sh
===================================================================
--- /issm/trunk/externalpackages/parmetis/install-4-win-msys2-gcc-msmpi.sh	(revision 26744)
+++ /issm/trunk/externalpackages/parmetis/install-4-win-msys2-gcc-msmpi.sh	(revision 26744)
@@ -0,0 +1,68 @@
+#!/bin/bash
+set -eu
+
+
+# NOTE:
+# - This configuration depends on the successful installation of METIS via 
+# 	$ISSM_DIR/externalpackages/metis/install-5-win-msys2-gcc-msmpi.sh
+# - METIS_ROOT and MSMPI_ROOT should be available after etc/environment.sh is 
+#	sourced
+#
+
+## Constants
+#
+VER=4.0.3
+
+PREFIX="${ISSM_DIR}/externalpackages/parmetis/install"
+
+GKLIB_ROOT="${METIS_ROOT}/GKlib"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/parmetis-${VER}.tar.gz" "parmetis-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf parmetis-${VER}.tar.gz
+
+# Move source into 'src' directory
+mv parmetis-${VER}/* src
+rm -rf parmetis-${VER}
+
+# Copy customized source and configuration files to 'src' directory
+cp configs/4.0/win/msys2/CMakeLists.txt src
+cp configs/4.0/win/msys2/Makefile src
+cp configs/4.0/win/msys2/include/parmetis.h src/include
+cp configs/4.0/win/msys2/gcc/libparmetis/CMakeLists.txt src/libparmetis
+
+# Configure
+cd src
+make config \
+	prefix=${PREFIX} \
+	shared=1 \
+	cc=/usr/bin/gcc \
+	cxx=/usr/bin/g++ \
+	metis_path=${METIS_ROOT} \
+	gklib_path=${GKLIB_ROOT} \
+	local_msmpi=1 \
+	msmpi_root=${MSMPI_ROOT}
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+
+# Create link to shared version of library so that libtool can find it
+cd ${PREFIX}/lib
+ln -s ./msys-parmetis.dll ./libparmetis.dll
+
+# Create link to lib directory (PETSc, by default, looks for libraries in 
+# lib64/ if it detects that 64-bit integers are being used)
+cd ${PREFIX}
+ln -s ./lib ./lib64
Index: /issm/trunk/externalpackages/parmetis/install-4-win-msys2-mingw-msmpi.sh
===================================================================
--- /issm/trunk/externalpackages/parmetis/install-4-win-msys2-mingw-msmpi.sh	(revision 26744)
+++ /issm/trunk/externalpackages/parmetis/install-4-win-msys2-mingw-msmpi.sh	(revision 26744)
@@ -0,0 +1,68 @@
+#!/bin/bash
+set -eu
+
+
+# NOTE:
+# - This configuration depends on the successful installation of METIS via 
+# 	$ISSM_DIR/externalpackages/metis/install-5-win-msys2-gcc-msmpi.sh
+# - METIS_ROOT and MSMPI_ROOT should be available after etc/environment.sh is 
+#	sourced
+#
+
+## Constants
+#
+VER=4.0.3
+
+PREFIX="${ISSM_DIR}/externalpackages/parmetis/install"
+
+GKLIB_ROOT="${METIS_ROOT}/GKlib"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/parmetis-${VER}.tar.gz" "parmetis-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf parmetis-${VER}.tar.gz
+
+# Move source into 'src' directory
+mv parmetis-${VER}/* src
+rm -rf parmetis-${VER}
+
+# Copy customized source and configuration files to 'src' directory
+cp configs/4.0/win/msys2/CMakeLists.txt src
+cp configs/4.0/win/msys2/Makefile src
+cp configs/4.0/win/msys2/include/parmetis.h src/include
+cp configs/4.0/win/msys2/mingw64/libparmetis/CMakeLists.txt src/libparmetis
+
+# Configure
+cd src
+make config \
+	prefix=${PREFIX} \
+	shared=1 \
+	cc=/mingw64/bin/gcc \
+	cxx=/mingw64/bin/g++ \
+	metis_path=${METIS_ROOT} \
+	gklib_path=${GKLIB_ROOT} \
+	local_msmpi=1 \
+	msmpi_root=${MSMPI_ROOT}
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+
+# Create link to lib directory (PETSc, by default, looks for libraries in 
+# lib64/ if it detects that 64-bit integers are being used)
+cd ${PREFIX}
+ln -s ./lib ./lib64
+
+# Create link to shared version of library so that libtool can find it
+cd ${PREFIX}/lib
+ln -s libparmetis.so libparmetis.dll
Index: /issm/trunk/externalpackages/petsc/configs/3.14/win/msys2/mingw64/config/configure.py
===================================================================
--- /issm/trunk/externalpackages/petsc/configs/3.14/win/msys2/mingw64/config/configure.py	(revision 26744)
+++ /issm/trunk/externalpackages/petsc/configs/3.14/win/msys2/mingw64/config/configure.py	(revision 26744)
@@ -0,0 +1,558 @@
+#!/usr/bin/python3
+from __future__ import print_function
+import os, sys
+
+extraLogs = []
+petsc_arch = ''
+
+# Use en_US as language so that BuildSystem parses compiler messages in english
+def fixLang(lang):
+  if lang in os.environ and os.environ[lang] != '':
+    lv = os.environ[lang]
+    enc = ''
+    try: lv,enc = lv.split('.')
+    except: pass
+    if lv not in ['en_US','C']: lv = 'en_US'
+    if enc: lv = lv+'.'+enc
+    os.environ[lang] = lv
+
+fixLang('LC_LOCAL')
+fixLang('LANG')
+
+
+def check_for_option_mistakes(opts):
+  for opt in opts[1:]:
+    name = opt.split('=')[0]
+    if name.find(' ') >= 0:
+      raise ValueError('The option "'+name+'" has a space character in the name - this is likely incorrect usage.');
+    if name.find('_') >= 0:
+      exception = False
+      for exc in ['mkl_sparse', 'mkl_sparse_optimize', 'mkl_cpardiso', 'mkl_pardiso', 'superlu_dist', 'PETSC_ARCH', 'PETSC_DIR', 'CXX_CXXFLAGS', 'LD_SHARED', 'CC_LINKER_FLAGS', 'CXX_LINKER_FLAGS', 'FC_LINKER_FLAGS', 'AR_FLAGS', 'C_VERSION', 'CXX_VERSION', 'FC_VERSION', 'size_t', 'MPI_Comm','MPI_Fint','int64_t']:
+        if name.find(exc) >= 0:
+          exception = True
+      if not exception:
+        raise ValueError('The option '+name+' should probably be '+name.replace('_', '-'));
+    if opt.find('=') >=0:
+      optval = opt.split('=')[1]
+      if optval == 'ifneeded':
+        raise ValueError('The option '+opt+' should probably be '+opt.replace('ifneeded', '1'));
+    for exc in ['mkl_sparse', 'mkl_sparse_optimize', 'mkl_cpardiso', 'mkl_pardiso', 'superlu_dist']:
+      if name.find(exc.replace('_','-')) > -1:
+        raise ValueError('The option '+opt+' should be '+opt.replace(exc.replace('_','-'),exc));
+  return
+
+def check_for_unsupported_combinations(opts):
+  if '--with-precision=single' in opts and '--with-clanguage=cxx' in opts and '--with-scalar-type=complex' in opts:
+    sys.exit(ValueError('PETSc does not support single precision complex with C++ clanguage, run with --with-clanguage=c'))
+
+def check_for_option_changed(opts):
+# Document changes in command line options here.
+  optMap = [('with-64bit-indices','with-64-bit-indices'),
+            ('with-mpi-exec','with-mpiexec'),
+            ('c-blas-lapack','f2cblaslapack'),
+            ('cholmod','suitesparse'),
+            ('umfpack','suitesparse'),
+            ('matlabengine','matlab-engine'),            
+            ('f-blas-lapack','fblaslapack'),
+            ('with-cuda-arch',
+             'CUDAFLAGS=-arch'),
+            ('with-packages-dir','with-packages-download-dir'),
+            ('with-external-packages-dir','with-packages-build-dir'),
+            ('package-dirs','with-packages-search-path'),
+            ('download-petsc4py-python','with-python-exec'),
+            ('search-dirs','with-executables-search-path')]
+  for opt in opts[1:]:
+    optname = opt.split('=')[0].strip('-')
+    for oldname,newname in optMap:
+      if optname.find(oldname) >=0:
+        raise ValueError('The option '+opt+' should probably be '+opt.replace(oldname,newname))
+  return
+
+def check_petsc_arch(opts):
+  # If PETSC_ARCH not specified - use script name (if not configure.py)
+  global petsc_arch
+  found = 0
+  for name in opts:
+    if name.find('PETSC_ARCH=') >= 0:
+      petsc_arch=name.split('=')[1]
+      found = 1
+      break
+  # If not yet specified - use the filename of script
+  if not found:
+      filename = os.path.basename(sys.argv[0])
+      if not filename.startswith('configure') and not filename.startswith('reconfigure') and not filename.startswith('setup'):
+        petsc_arch=os.path.splitext(os.path.basename(sys.argv[0]))[0]
+        useName = 'PETSC_ARCH='+petsc_arch
+        opts.append(useName)
+  return 0
+
+def chkenable():
+  #Replace all 'enable-'/'disable-' with 'with-'=0/1/tail
+  #enable-fortran is a special case, the resulting --with-fortran is ambiguous.
+  #Would it mean --with-fc=
+  en_dash = u'\N{EN DASH}'
+  if sys.version_info < (3, 0):
+    en_dash = en_dash.encode('utf-8')
+  for l in range(0,len(sys.argv)):
+    name = sys.argv[l]
+
+    if name.find(en_dash)  >= 0:
+      sys.argv[l] = name.replace(en_dash,'-')
+    if name.find('enable-cxx') >= 0:
+      if name.find('=') == -1:
+        sys.argv[l] = name.replace('enable-cxx','with-clanguage=C++')
+      else:
+        head, tail = name.split('=', 1)
+        if tail=='0':
+          sys.argv[l] = head.replace('enable-cxx','with-clanguage=C')
+        else:
+          sys.argv[l] = head.replace('enable-cxx','with-clanguage=C++')
+      continue
+    if name.find('disable-cxx') >= 0:
+      if name.find('=') == -1:
+        sys.argv[l] = name.replace('disable-cxx','with-clanguage=C')
+      else:
+        head, tail = name.split('=', 1)
+        if tail == '0':
+          sys.argv[l] = head.replace('disable-cxx','with-clanguage=C++')
+        else:
+          sys.argv[l] = head.replace('disable-cxx','with-clanguage=C')
+      continue
+
+
+    if name.find('enable-') >= 0:
+      if name.find('=') == -1:
+        sys.argv[l] = name.replace('enable-','with-')+'=1'
+      else:
+        head, tail = name.split('=', 1)
+        sys.argv[l] = head.replace('enable-','with-')+'='+tail
+    if name.find('disable-') >= 0:
+      if name.find('=') == -1:
+        sys.argv[l] = name.replace('disable-','with-')+'=0'
+      else:
+        head, tail = name.split('=', 1)
+        if tail == '1': tail = '0'
+        sys.argv[l] = head.replace('disable-','with-')+'='+tail
+    if name.find('without-') >= 0:
+      if name.find('=') == -1:
+        sys.argv[l] = name.replace('without-','with-')+'=0'
+      else:
+        head, tail = name.split('=', 1)
+        if tail == '1': tail = '0'
+        sys.argv[l] = head.replace('without-','with-')+'='+tail
+
+def chksynonyms():
+  #replace common configure options with ones that PETSc BuildSystem recognizes
+  simplereplacements = {'F77' : 'FC', 'F90' : 'FC'}
+  for l in range(0,len(sys.argv)):
+    name = sys.argv[l]
+
+    name = name.replace('with-openmpi','with-mpi')
+    name = name.replace('with-mpich','with-mpi')
+    name = name.replace('with-blas-lapack','with-blaslapack')
+
+    if name.find('with-debug=') >= 0 or name.endswith('with-debug'):
+      if name.find('=') == -1:
+        name = name.replace('with-debug','with-debugging')+'=1'
+      else:
+        head, tail = name.split('=', 1)
+        name = head.replace('with-debug','with-debugging')+'='+tail
+
+    if name.find('with-shared=') >= 0 or name.endswith('with-shared'):
+      if name.find('=') == -1:
+        name = name.replace('with-shared','with-shared-libraries')+'=1'
+      else:
+        head, tail = name.split('=', 1)
+        name = head.replace('with-shared','with-shared-libraries')+'='+tail
+
+    if name.find('with-index-size=') >=0:
+      head,tail = name.split('=',1)
+      if int(tail)==32:
+        name = '--with-64-bit-indices=0'
+      elif int(tail)==64:
+        name = '--with-64-bit-indices=1'
+      else:
+        raise RuntimeError('--with-index-size= must be 32 or 64')
+
+    if name.find('with-precision=') >=0:
+      head,tail = name.split('=',1)
+      if tail.find('quad')>=0:
+        name='--with-precision=__float128'
+
+    for i,j in simplereplacements.items():
+      if name.find(i+'=') >= 0:
+        name = name.replace(i+'=',j+'=')
+      elif name.find('with-'+i.lower()+'=') >= 0:
+        name = name.replace(i.lower()+'=',j.lower()+'=')
+
+    # restore 'sys.argv[l]' from the intermediate var 'name'
+    sys.argv[l] = name
+
+def chkwincompilerusinglink():
+  for arg in sys.argv:
+    if (arg.find('win32fe') >= 0 and (arg.find('f90') >=0 or arg.find('ifort') >=0 or arg.find('icl') >=0)):
+      return 1
+  return 0
+
+def chkdosfiles():
+  # cygwin - but not a hg clone - so check one of files in bin dir
+  if b"\r\n" in open(os.path.join('lib','petsc','bin','petscmpiexec'),"rb").read():
+    print('===============================================================================')
+    print(' *** Scripts are in DOS mode. Was winzip used to extract petsc sources?    ****')
+    print(' *** Please restart with a fresh tarball and use "tar -xzf petsc.tar.gz"   ****')
+    print('===============================================================================')
+    sys.exit(3)
+  return
+
+def chkcygwinlink():
+  if os.path.exists('/usr/bin/cygcheck.exe') and os.path.exists('/usr/bin/link.exe') and chkwincompilerusinglink():
+      if '--ignore-cygwin-link' in sys.argv: return 0
+      print('===============================================================================')
+      print(' *** Cygwin /usr/bin/link detected! Compiles with Intel icl/ifort can break!  **')
+      print(' *** To workarround do: "mv /usr/bin/link.exe /usr/bin/link-cygwin.exe"     **')
+      print(' *** Or to ignore this check, use configure option: --ignore-cygwin-link. But compiles can fail. **')
+      print('===============================================================================')
+      sys.exit(3)
+  return 0
+
+def chkbrokencygwin():
+  if os.path.exists('/usr/bin/cygcheck.exe'):
+    buf = os.popen('/usr/bin/cygcheck.exe -c cygwin').read()
+    if buf.find('1.5.11-1') > -1:
+      print('===============================================================================')
+      print(' *** cygwin-1.5.11-1 detected. ./configure fails with this version ***')
+      print(' *** Please upgrade to cygwin-1.5.12-1 or newer version. This can  ***')
+      print(' *** be done by running cygwin-setup, selecting "next" all the way.***')
+      print('===============================================================================')
+      sys.exit(3)
+  return 0
+
+def chkusingwindowspython():
+  if sys.platform == 'win32':
+    print('===============================================================================')
+    print(' *** Windows python detected. Please rerun ./configure with cygwin-python. ***')
+    print('===============================================================================')
+    sys.exit(3)
+  return 0
+
+def chkcygwinpython():
+  if sys.platform == 'cygwin' :
+    import platform
+    import re
+    r=re.compile("([0-9]+).([0-9]+).([0-9]+)")
+    m=r.match(platform.release())
+    major=int(m.group(1))
+    minor=int(m.group(2))
+    subminor=int(m.group(3))
+    if ((major < 1) or (major == 1 and minor < 7) or (major == 1 and minor == 7 and subminor < 34)):
+      sys.argv.append('--useThreads=0')
+      extraLogs.append('''\
+===============================================================================
+** Cygwin version is older than 1.7.34. Python threads do not work correctly. ***
+** Disabling thread usage for this run of ./configure *******
+===============================================================================''')
+  return 0
+
+def chkcygwinwindowscompilers():
+  '''Adds win32fe for Microsoft/Intel compilers'''
+  if os.path.exists('/usr/bin/cygcheck.exe'):
+    for l in range(1,len(sys.argv)):
+      option = sys.argv[l]
+      for i in ['cl','icl','ifort']:
+        if option.startswith(i):
+          sys.argv[l] = 'win32fe '+option
+          break
+  return 0
+
+def chkrhl9():
+  if os.path.exists('/etc/redhat-release'):
+    try:
+      file = open('/etc/redhat-release','r')
+      buf = file.read()
+      file.close()
+    except:
+      # can't read file - assume dangerous RHL9
+      buf = 'Shrike'
+    if buf.find('Shrike') > -1:
+      sys.argv.append('--useThreads=0')
+      extraLogs.append('''\
+==============================================================================
+   *** RHL9 detected. Threads do not work correctly with this distribution ***
+   ****** Disabling thread usage for this run of ./configure *********
+===============================================================================''')
+  return 0
+
+def chktmpnoexec():
+  if not hasattr(os,'ST_NOEXEC'): return # novermin
+  if 'TMPDIR' in os.environ: tmpDir = os.environ['TMPDIR']
+  else: tmpDir = '/tmp'
+  if os.statvfs(tmpDir).f_flag & os.ST_NOEXEC: # novermin
+    if os.statvfs(os.path.abspath('.')).f_flag & os.ST_NOEXEC: # novermin
+      print('************************************************************************')
+      print('* TMPDIR '+tmpDir+' has noexec attribute. Same with '+os.path.abspath('.')+' where petsc is built.')
+      print('* Suggest building PETSc in a location without this restriction!')
+      print('* Alternatively, set env variable TMPDIR to a location that is not restricted to run binaries.')
+      print('************************************************************************')
+      sys.exit(4)
+    else:
+      newTmp = os.path.abspath('tmp-petsc')
+      print('************************************************************************')
+      print('* TMPDIR '+tmpDir+' has noexec attribute. Using '+newTmp+' instead.')
+      print('************************************************************************')
+      if not os.path.isdir(newTmp): os.mkdir(os.path.abspath(newTmp))
+      os.environ['TMPDIR'] = newTmp
+  return
+
+def check_cray_modules():
+  import script
+  '''For Cray systems check if the cc, CC, ftn compiler suite modules have been set'''
+  cray = os.getenv('CRAY_SITE_LIST_DIR')
+  if not cray: return
+  cray = os.getenv('CRAYPE_DIR')
+  if not cray:
+   print('************************************************************************')
+   print('* You are on a Cray system but no programming environments have been loaded')
+   print('* Perhaps you need:')
+   print('*       module load intel ; module load PrgEnv-intel')
+   print('*   or  module load PrgEnv-cray')
+   print('*   or  module load PrgEnv-gnu')
+   print('* See https://www.mcs.anl.gov/petsc/documentation/installation.html#doemachines')
+   print('************************************************************************')
+   sys.exit(4)
+
+def check_broken_configure_log_links():
+  '''Sometime symlinks can get broken if the original files are deleted. Delete such broken links'''
+  import os
+  for logfile in ['configure.log','configure.log.bkp']:
+    if os.path.islink(logfile) and not os.path.isfile(logfile): os.remove(logfile)
+  return
+
+def move_configure_log(framework):
+  '''Move configure.log to PETSC_ARCH/lib/petsc/conf - and update configure.log.bkp in both locations appropriately'''
+  global petsc_arch
+
+  if hasattr(framework,'arch'): petsc_arch = framework.arch
+  if hasattr(framework,'logName'): curr_file = framework.logName
+  else: curr_file = 'configure.log'
+
+  if petsc_arch:
+    import shutil
+    import os
+
+    # Just in case - confdir is not created
+    lib_dir = os.path.join(petsc_arch,'lib')
+    petsc_dir = os.path.join(petsc_arch,'lib','petsc')
+    conf_dir = os.path.join(petsc_arch,'lib','petsc','conf')
+    if not os.path.isdir(petsc_arch): os.mkdir(petsc_arch)
+    if not os.path.isdir(lib_dir): os.mkdir(lib_dir)
+    if not os.path.isdir(petsc_dir): os.mkdir(petsc_dir)
+    if not os.path.isdir(conf_dir): os.mkdir(conf_dir)
+
+    curr_bkp  = curr_file + '.bkp'
+    new_file  = os.path.join(conf_dir,curr_file)
+    new_bkp   = new_file + '.bkp'
+
+    # Keep backup in $PETSC_ARCH/lib/petsc/conf location
+    if os.path.isfile(new_bkp): os.remove(new_bkp)
+    if os.path.isfile(new_file): os.rename(new_file,new_bkp)
+    if os.path.isfile(curr_file):
+      shutil.copyfile(curr_file,new_file)
+      os.remove(curr_file)
+    if os.path.isfile(new_file): os.symlink(new_file,curr_file)
+    # If the old bkp is using the same PETSC_ARCH/lib/petsc/conf - then update bkp link
+    if os.path.realpath(curr_bkp) == os.path.realpath(new_file):
+      if os.path.isfile(curr_bkp): os.remove(curr_bkp)
+      if os.path.isfile(new_bkp): os.symlink(new_bkp,curr_bkp)
+  return
+
+def print_final_timestamp(framework):
+  import time
+  framework.log.write(('='*80)+'\n')
+  framework.log.write('Finishing configure run at '+time.strftime('%a, %d %b %Y %H:%M:%S %z')+'\n')
+  framework.log.write(('='*80)+'\n')
+  return
+
+def petsc_configure(configure_options):
+  if 'PETSC_DIR' in os.environ:
+    petscdir = os.environ['PETSC_DIR']
+    if petscdir.find(' ') > -1:
+      raise RuntimeError('Your PETSC_DIR '+petscdir+' has spaces in it; this is not allowed.\n Change the directory with PETSc to not have spaces in it')
+    try:
+      sys.path.append(os.path.join(petscdir,'lib','petsc','bin'))
+      import petscnagupgrade
+      file     = os.path.join(petscdir,'.nagged')
+      if not petscnagupgrade.naggedtoday(file):
+        petscnagupgrade.currentversion(petscdir)
+    except:
+      pass
+  print('===============================================================================')
+  print('             Configuring PETSc to compile on your system                       ')
+  print('===============================================================================')
+
+  try:
+    # Command line arguments take precedence (but don't destroy argv[0])
+    sys.argv = sys.argv[:1] + configure_options + sys.argv[1:]
+    check_for_option_mistakes(sys.argv)
+    check_for_option_changed(sys.argv)
+  except (TypeError, ValueError) as e:
+    emsg = str(e)
+    if not emsg.endswith('\n'): emsg = emsg+'\n'
+    msg ='*******************************************************************************\n'\
+    +'                ERROR in COMMAND LINE ARGUMENT to ./configure \n' \
+    +'-------------------------------------------------------------------------------\n'  \
+    +emsg+'*******************************************************************************\n'
+    sys.exit(msg)
+  # check PETSC_ARCH
+  check_for_unsupported_combinations(sys.argv)
+  check_petsc_arch(sys.argv)
+  check_broken_configure_log_links()
+
+  #rename '--enable-' to '--with-'
+  chkenable()
+  # support a few standard configure option types
+  chksynonyms()
+  # Check for broken cygwin
+  chkbrokencygwin()
+  # Disable threads on RHL9
+  chkrhl9()
+  # Make sure cygwin-python is used on windows
+  chkusingwindowspython()
+  # Threads don't work for cygwin & python...
+  chkcygwinpython()
+  chkcygwinlink()
+  chkdosfiles()
+  chkcygwinwindowscompilers()
+  chktmpnoexec()
+
+  for l in range(1,len(sys.argv)):
+    if sys.argv[l].startswith('--with-fc=') and sys.argv[l].endswith('nagfor'):
+      # need a way to save this value and later CC so that petscnagfor may use them
+      name = sys.argv[l].split('=')[1]
+      sys.argv[l] = '--with-fc='+os.path.join(os.path.abspath('.'),'lib','petsc','bin','petscnagfor')
+      break
+
+
+  # Should be run from the toplevel
+  configDir = os.path.abspath('config')
+  bsDir     = os.path.join(configDir, 'BuildSystem')
+  if not os.path.isdir(configDir):
+    raise RuntimeError('Run configure from $PETSC_DIR, not '+os.path.abspath('.'))
+  sys.path.insert(0, bsDir)
+  sys.path.insert(0, configDir)
+  import config.base
+  import config.framework
+  import pickle
+  import traceback
+
+  # Check Cray without modules
+  check_cray_modules()
+
+  tbo = None
+  framework = None
+  try:
+    framework = config.framework.Framework(['--configModules=PETSc.Configure','--optionsModule=config.compilerOptions']+sys.argv[1:], loadArgDB = 0)
+    framework.setup()
+    framework.logPrint('\n'.join(extraLogs))
+    framework.configure(out = sys.stdout)
+    framework.storeSubstitutions(framework.argDB)
+    framework.argDB['configureCache'] = pickle.dumps(framework)
+    framework.printSummary()
+    framework.argDB.save(force = True)
+    framework.logClear()
+    print_final_timestamp(framework)
+    framework.closeLog()
+    try:
+      move_configure_log(framework)
+    except:
+      # perhaps print an error about unable to shuffle logs?
+      pass
+    return 0
+  except (RuntimeError, config.base.ConfigureSetupError) as e:
+    tbo = sys.exc_info()[2]
+    emsg = str(e)
+    if not emsg.endswith('\n'): emsg = emsg+'\n'
+    msg ='*******************************************************************************\n'\
+    +'         UNABLE to CONFIGURE with GIVEN OPTIONS    (see configure.log for details):\n' \
+    +'-------------------------------------------------------------------------------\n'  \
+    +emsg+'*******************************************************************************\n'
+    se = ''
+  except (TypeError, ValueError) as e:
+    # this exception is automatically deleted by Python so we need to save it to print below
+    tbo = sys.exc_info()[2]
+    emsg = str(e)
+    if not emsg.endswith('\n'): emsg = emsg+'\n'
+    msg ='*******************************************************************************\n'\
+    +'    TypeError or ValueError possibly related to ERROR in COMMAND LINE ARGUMENT while running ./configure \n' \
+    +'-------------------------------------------------------------------------------\n'  \
+    +emsg+'*******************************************************************************\n'
+    se = ''
+  except ImportError as e :
+    # this exception is automatically deleted by Python so we need to save it to print below
+    tbo = sys.exc_info()[2]
+    emsg = str(e)
+    if not emsg.endswith('\n'): emsg = emsg+'\n'
+    msg ='*******************************************************************************\n'\
+    +'                     ImportError while runing ./configure \n' \
+    +'-------------------------------------------------------------------------------\n'  \
+    +emsg+'*******************************************************************************\n'
+    se = ''
+  except OSError as e :
+    tbo = sys.exc_info()[2]
+    emsg = str(e)
+    if not emsg.endswith('\n'): emsg = emsg+'\n'
+    msg ='*******************************************************************************\n'\
+    +'                    OSError while running ./configure \n' \
+    +'-------------------------------------------------------------------------------\n'  \
+    +emsg+'*******************************************************************************\n'
+    se = ''
+  except SystemExit as e:
+    tbo = sys.exc_info()[2]
+    if e.code is None or e.code == 0:
+      return
+    if e.code == 10:
+      sys.exit(10)
+    msg ='*******************************************************************************\n'\
+    +'         CONFIGURATION FAILURE  (Please send configure.log to petsc-maint@mcs.anl.gov)\n' \
+    +'*******************************************************************************\n'
+    se  = str(e)
+  except Exception as e:
+    tbo = sys.exc_info()[2]
+    msg ='*******************************************************************************\n'\
+    +'        CONFIGURATION CRASH  (Please send configure.log to petsc-maint@mcs.anl.gov)\n' \
+    +'*******************************************************************************\n'
+    se  = str(e)
+
+  print(msg)
+  if not framework is None:
+    framework.logClear()
+    if hasattr(framework, 'log'):
+      try:
+        if hasattr(framework,'compilerDefines'):
+          framework.log.write('**** Configure header '+framework.compilerDefines+' ****\n')
+          framework.outputHeader(framework.log)
+        if hasattr(framework,'compilerFixes'):
+          framework.log.write('**** C specific Configure header '+framework.compilerFixes+' ****\n')
+          framework.outputCHeader(framework.log)
+      except Exception as e:
+        framework.log.write('Problem writing headers to log: '+str(e))
+      try:
+        framework.log.write(msg+se)
+        traceback.print_tb(tbo, file = framework.log)
+        print_final_timestamp(framework)
+        if hasattr(framework,'log'): framework.log.close()
+        move_configure_log(framework)
+      except Exception as e:
+        print('Error printing error message from exception or printing the traceback:'+str(e))
+        traceback.print_tb(sys.exc_info()[2])
+      sys.exit(1)
+    else:
+      print(se)
+      traceback.print_tb(tbo)
+  else:
+    print(se)
+    traceback.print_tb(tbo)
+  if hasattr(framework,'log'): framework.log.close()
+
+if __name__ == '__main__':
+  petsc_configure([])
+
Index: sm/trunk/externalpackages/petsc/install-3.12-linux-solid_earth-static.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.12-linux-solid_earth-static.sh	(revision 26743)
+++ 	(revision )
@@ -1,60 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# NOTE: There is a single difference between the Linux and macOS 
-#		configurations, which is the addition of the -static-libgfortran 
-#		option to FFLAGS on the macOS static configurations. For the sake of 
-#		consistency, we maintain separate files for each, respective Linux and 
-#		macOS configuration.
-
-## Constants
-#
-VER="3.12.3"
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf petsc-${VER}.tar.gz
-
-# Cleanup
-rm -rf install src
-mkdir install src
-
-# Move source to 'src' directory
-mv petsc-${VER}/* src/
-rm -rf petsc-${VER}
-
-# Configure
-#
-# NOTE: Cannot use --with-fpic option when compiling static libs,
-#
-#		Cannot determine compiler PIC flags if shared libraries is turned off
-#		Either run using --with-shared-libraries or --with-pic=0 and supply the
-#		compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS
-#
-cd src
-./config/configure.py \
-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
-	--with-shared-libraries=0 \
-	--CFLAGS="-fPIC" \
-	--CXXFLAGS="-fPIC" \
-	--FFLAGS="-fPIC" \
-	--with-debugging=0 \
-	--with-valgrind=0 \
-	--with-x=0 \
-	--with-ssl=0 \
-	--download-fblaslapack=1 \
-	--download-mpich=1 \
-	--download-metis=1 \
-	--download-parmetis=1 \
-	--download-scalapack=1 \
-	--download-mumps=1 \
-	--download-zlib=1 \
-	--download-hdf5=1
-
-# Compile and install
-make
-make install
Index: /issm/trunk/externalpackages/petsc/install-3.12-linux-static.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.12-linux-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/petsc/install-3.12-linux-static.sh	(revision 26744)
@@ -3,13 +3,10 @@
 
 
-# NOTE: There is a single difference between the Linux and macOS 
-#		configurations, which is the addition of the -static-libgfortran 
-#		option to FFLAGS on the macOS static configurations. For the sake of 
-#		consistency, we maintain separate files for each, respective Linux and 
-#		macOS configuration.
-
 ## Constants
 #
 VER="3.12.3"
+
+PETSC_DIR=${ISSM_DIR}/externalpackages/petsc/src # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
 
 # Download source
@@ -20,14 +17,14 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
-# Move source to 'src' directory
-mv petsc-${VER}/* src/
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
 # Configure
 #
-# NOTE: 
+# NOTE:
 # - Cannot use --with-fpic option when compiling static libs,
 #
@@ -36,8 +33,15 @@
 #		compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS
 #
-cd src
+# - Added -fallow-argument-mismatch to FFLAGS in order to clear,
+#
+#		error: The Fortran compiler gfortran will not compile files that call 
+#		the same routine with arguments of different types.
+#
+#	for gfortran 10 or later (may need to remove it for earlier versions).
+#
+cd ${PETSC_DIR}
 ./config/configure.py \
-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	--with-shared-libraries=0 \
 	--CFLAGS="-fPIC" \
Index: /issm/trunk/externalpackages/petsc/install-3.12-linux.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.12-linux.sh	(revision 26743)
+++ /issm/trunk/externalpackages/petsc/install-3.12-linux.sh	(revision 26744)
@@ -7,4 +7,7 @@
 VER="3.12.3"
 
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+
 # Download source
 $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
@@ -14,16 +17,16 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir ${PETSC_DIR}
 
-# Move source to 'src' directory
-mv petsc-${VER}/* src/
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
 # Configure
-cd src
+cd ${PETSC_DIR}
 ./config/configure.py \
-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	--with-debugging=0 \
 	--with-valgrind=0 \
@@ -40,5 +43,4 @@
 	--download-hdf5=1
 
-
 # Compile and install
 make
Index: /issm/trunk/externalpackages/petsc/install-3.12-lonestar.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.12-lonestar.sh	(revision 26744)
+++ /issm/trunk/externalpackages/petsc/install-3.12-lonestar.sh	(revision 26744)
@@ -0,0 +1,45 @@
+#!/bin/bash
+set -eu
+
+## Constants
+#
+VER="3.12.3"
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf petsc-${VER}.tar.gz
+
+# Cleanup
+rm -rf install src
+mkdir install src
+
+# Move source to 'src' directory
+mv petsc-${VER}/* src/
+rm -rf petsc-${VER}
+
+#configure
+cd src
+./config/configure.py \
+	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
+	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+	--with-mpi-dir="/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/" \
+	--with-blas-lapack-dir="$TACC_MKL_LIB" \
+	--with-scalapack-include="$TACC_MKL_INC" \
+	--with-scalapack-lib="$TACC_MKL_LIB/libmkl_scalapack_lp64.so $TACC_MKL_LIB/libmkl_blacs_intelmpi_lp64.so" \
+	--with-shared-libraries=1 \
+	--known-mpi-shared-libraries=1 \
+	--with-debugging=0 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-batch  \
+	--download-metis=1 \
+	--download-parmetis=1 \
+	--download-mumps=1 \
+	--download-scalapack=1
+
+# Compile and install
+make
+make install
Index: /issm/trunk/externalpackages/petsc/install-3.12-mac-static.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.12-mac-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/petsc/install-3.12-mac-static.sh	(revision 26744)
@@ -7,4 +7,7 @@
 VER="3.12.3"
 
+PETSC_DIR=${ISSM_DIR}/externalpackages/petsc/src # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+
 # Download source
 $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
@@ -14,14 +17,14 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
-# Move source to 'src' directory
-mv petsc-${VER}/* src/
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
 # Configure
 #
-# NOTE: 
+# NOTE:
 # - Cannot use --with-fpic option when compiling static libs,
 #
@@ -41,8 +44,8 @@
 #	work out of the box on Linux.
 #
-cd src
+cd ${PETSC_DIR}
 ./config/configure.py \
-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	--with-shared-libraries=0 \
 	--CFLAGS="-fPIC -Wno-error=implicit-function-declaration" \
Index: /issm/trunk/externalpackages/petsc/install-3.12-mac.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.12-mac.sh	(revision 26743)
+++ /issm/trunk/externalpackages/petsc/install-3.12-mac.sh	(revision 26744)
@@ -7,4 +7,7 @@
 VER="3.12.3"
 
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+
 # Download source
 $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
@@ -14,9 +17,9 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir ${PETSC_DIR}
 
-# Move source to 'src' directory
-mv petsc-${VER}/* src/
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
@@ -24,4 +27,6 @@
 #
 # NOTE:
+# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
+#	(may need to remove it for earlier versions not using the C99 standard).
 # - Added -fallow-argument-mismatch to FFLAGS in order to clear,
 #
@@ -30,11 +35,9 @@
 #
 #	for gfortran 10 or later (may need to remove it for earlier versions).
-# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
-#	(may need to remove it for earlier versions not using the C99 standard).
 #
-cd src
+cd ${PETSC_DIR}
 ./config/configure.py \
-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	--CFLAGS="-Wno-error=implicit-function-declaration" \
 	--FFLAGS="-fallow-argument-mismatch" \
Index: /issm/trunk/externalpackages/petsc/install-3.12-win-msys2-gcc-msmpi.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.12-win-msys2-gcc-msmpi.sh	(revision 26744)
+++ /issm/trunk/externalpackages/petsc/install-3.12-win-msys2-gcc-msmpi.sh	(revision 26744)
@@ -0,0 +1,65 @@
+#!/bin/bash
+set -u # NOTE: Do not set -e as it will cause this script to fail when there are errors in underlying Python scripts
+
+
+## Constants
+#
+VER="3.12.3"
+
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf petsc-${VER}.tar.gz
+
+# Cleanup
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir ${PETSC_DIR}
+
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
+rm -rf petsc-${VER}
+
+# Configure
+#
+# - Added -fallow-argument-mismatch option to FFLAGS in order to clear "Error: 
+#	Rank mismatch between actual argument at [...]"
+# - Added -fallow-invalid-boz option to FFLAGS in order to clear "Error: BOZ 
+#	literal constant at [...]"
+#
+cd ${PETSC_DIR}
+./config/configure.py \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
+	--FFLAGS="-fallow-argument-mismatch -fallow-invalid-boz" \
+	--with-debugging=0 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-pic=1 \
+	--with-mpiexec="/c/PROGRA~1/MICROS~1/Bin/mpiexec.exe" \
+	--with-mpi-lib="-L${MSMPI_ROOT}/lib -lmsmpi" \
+	--with-mpi-include="${MSMPI_ROOT}/include" \
+	--with-metis-dir=${METIS_ROOT} \
+	--with-parmetis-dir=${PARMETIS_ROOT} \
+	--with-blas-lib="-L${BLAS_ROOT}/lib -lblas" \
+	--known-64-bit-blas-indices=0 \
+	--with-lapack-lib="-L${LAPACK_ROOT}/lib -llapack" \
+	--with-scalapack-dir=${SCALAPACK_ROOT} \
+	--with-mumps-dir=${MUMPS_ROOT}
+
+# Compile and install
+make
+make install
+
+# NOTE:
+# - Hack to recover from failed installation (appears to happen only on Windows 
+#	when reproducing symbolic links in destination directory) rather than 
+#	trying to patch src/config/install.py
+#
+if [ $? -ne 0 ]; then
+	make install
+fi
Index: /issm/trunk/externalpackages/petsc/install-3.13-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.13-pleiades.sh	(revision 26743)
+++ /issm/trunk/externalpackages/petsc/install-3.13-pleiades.sh	(revision 26744)
@@ -2,36 +2,60 @@
 set -eu
 
-#Some cleanup
-rm -rf install petsc-3.13.3 src
-mkdir install src
 
-#Download from ISSM server
-#$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.13.3.tar.gz' 'petsc-3.13.3.tar.gz'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.13.3.tar.gz' 'petsc-3.13.3.tar.gz'
+## Constants
+#
+VER="3.13.6"
 
-#Untar and move petsc to install directory
-tar -zxvf  petsc-3.13.3.tar.gz
-mv petsc-3.13.3/* src/
-rm -rf petsc-3.13.3
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
 
-#configure (based on /nasa/petsc/3.7.5/intel_mpt/lib/petsc/conf/petscvariables look for CONFIGURE_OPTIONS)
-cd src
+# Download source
+echo "OK1 ($ISSM_DIR)"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+echo OK2
+
+# Unpack source
+tar -zxvf petsc-${VER}.tar.gz
+
+# Cleanup
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir ${PETSC_DIR}
+
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
+rm -rf petsc-${VER}
+
+
+# Configure
+#
+# NOTE: Based on /nasa/petsc/3.7.5/intel_mpt/lib/petsc/conf/petscvariables; look for CONFIGURE_OPTIONS
+#
+cd ${PETSC_DIR}
 ./config/configure.py \
-	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
-	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
-	--with-cc=icc --with-cxx=icpc --with-fc=ifort --with-f77=ifort\
-	-COPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" -CXXOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" -FOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
+	--with-cc=icc \
+	--with-cpp=/usr/bin/cpp \
+	--with-cxx=icpc \
+	--with-fc=ifort \
+	-COPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" \
+	-CXXOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" \
+	-FOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" \
 	--with-blas-lapack-dir="/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/mkl/" \
+	--with-scalapack-include=/nasa/intel/Compiler/2016.2.181/mkl/include \
+	--with-scalapack-lib="/nasa/intel/Compiler/2016.2.181/mkl/lib/intel64/libmkl_scalapack_lp64.so /nasa/intel/Compiler/2016.2.181/mkl/lib/intel64/libmkl_blacs_sgimpt_lp64.so" \
 	--known-mpi-shared-libraries=1 \
+	--with-gnu-compilers=0 \
+	--with-vendor-compilers=intel \
 	--with-debugging=0 \
 	--with-valgrind=0 \
 	--with-x=0 \
 	--with-ssl=0 \
-	--with-batch=1  \
+	--with-batch=1 \
 	--with-shared-libraries=1 \
 	--download-metis=1 \
 	--download-parmetis=1 \
 	--download-mumps=1 \
-	--download-scalapack=1
+	--download-zlib=1
 
 # Compile and install
Index: /issm/trunk/externalpackages/petsc/install-3.14-discover.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-discover.sh	(revision 26744)
+++ /issm/trunk/externalpackages/petsc/install-3.14-discover.sh	(revision 26744)
@@ -0,0 +1,56 @@
+#!/bin/bash
+set -eu
+
+
+# NOTE: There is a single difference between the Linux and macOS 
+#		configurations, which is the addition of the -static-libgfortran 
+#		option to FFLAGS on the macOS static configurations. For the sake of 
+#		consistency, we maintain separate files for each, respective Linux and 
+#		macOS configuration.
+
+# Constants
+VER="3.14.0"
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf petsc-${VER}.tar.gz
+
+# Cleanup
+rm -rf install src
+mkdir install src
+
+# Move source to 'src' directory
+mv petsc-${VER}/* src/
+rm -rf petsc-${VER}
+
+# Configure
+cd src
+./config/configure.py \
+	COPTFLAGS="-g -O3" CXXOPTFLAGS="-g -O3" FOPTFLAGS="-g -O3" \
+	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
+	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	--with-debugging=0 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-pic=1 \
+	--with-blas-lapack-dir="/usr/local/intel/2020/compilers_and_libraries_2020.0.166/linux/mkl/" \
+	--with-cc="/usr/local/sgi/mpi/mpt-2.17/bin/mpicc" \
+	--with-cxx="/usr/local/sgi/mpi/mpt-2.17/bin/mpicxx" \
+	--with-fc="/usr/local/sgi/mpi/mpt-2.17/bin/mpif90" \
+	--known-mpi-shared-libraries=1 \
+	--known-64-bit-blas-indices \
+	--known-mpi-long-double=1 \
+	--known-mpi-int64_t=1 \
+	--known-mpi-c-double-complex=1 \
+	--with-shared-libraries=1 \
+	--download-metis=1 \
+	--download-parmetis=1 \
+	--download-scalapack=1 \
+	--download-mumps=1
+
+# Compile and install
+make
+make install
Index: /issm/trunk/externalpackages/petsc/install-3.14-linux.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-linux.sh	(revision 26743)
+++ /issm/trunk/externalpackages/petsc/install-3.14-linux.sh	(revision 26744)
@@ -4,5 +4,9 @@
 
 ## Constants
+#
 VER="3.14.0"
+
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
 
 # Download source
@@ -13,16 +17,16 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir ${PETSC_DIR}
 
-# Move source to 'src' directory
-mv petsc-${VER}/* src/
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
 # Configure
-cd src
+cd ${PETSC_DIR}
 ./config/configure.py \
-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	--with-debugging=0 \
 	--with-valgrind=0 \
@@ -39,5 +43,4 @@
 	--download-hdf5=1
 
-
 # Compile and install
 make
Index: /issm/trunk/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh	(revision 26744)
+++ /issm/trunk/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh	(revision 26744)
@@ -0,0 +1,84 @@
+#!/bin/bash
+set -u # NOTE: Do not set -e as it will cause this script to fail when there are errors in underlying Python scripts
+
+# NOTE:
+# - You must install various needed packages with,
+#
+#		pacman -S mingw-w64-x86_64-toolchain python
+#
+# - You must use MSYS2 MinGW 64-bit version of cmake to be able to install 
+#	external packages correctly,
+#
+#		pacman -R mingw-w64-x86_64-cmake
+#
+# Sources:
+# - https://gitlab.com/petsc/petsc/-/issues/820#note_487483240
+#
+
+## Constants
+#
+VER="3.14.4"
+
+MAKEFILE_GENERATOR='-G "MSYS Makefiles"'
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf petsc-${VER}.tar.gz
+
+# Cleanup
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir ${PETSC_DIR}
+
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
+rm -rf petsc-${VER}
+
+# Copy customized source files to $PETSC_DIR
+cp configs/3.14/win/msys2/mingw64/config/configure.py ${PETSC_DIR}/config
+
+# Configure
+# - Cannot use --with-fpic option when compiling static libs,
+#
+#		Cannot determine compiler PIC flags if shared libraries is turned off
+#		Either run using --with-shared-libraries or --with-pic=0 and supply the
+#		compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS
+#
+# - Added -fallow-argument-mismatch option to FFLAGS in order to clear "Error: 
+#	Rank mismatch between actual argument at [...]"
+# - Added -fallow-invalid-boz option to FFLAGS in order to clear "Error: BOZ 
+#	literal constant at [...]"
+# - Argument to --with-mpi-include must be a list or it gets expanded 
+#	incorrectly
+#
+cd ${PETSC_DIR}
+./config/configure.py \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
+	--CFLAGS="-fPIC -Wno-error=implicit-function-declaration" \
+	--CXXFLAGS="-fPIC" \
+	--FFLAGS="-fPIC -fallow-argument-mismatch -fallow-invalid-boz" \
+	--with-shared-libraries=0 \
+	--with-debugging=0 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-proc-filesystem=0 \
+	--with-mpiexec="${MPIEXEC_DIR}/mpiexec.exe" \
+	--with-mpi-lib="-L${MSMPI_ROOT}/lib -lmsmpi" \
+	--with-mpi-include="${MSMPI_ROOT}/include" \
+	--download-fblaslapack=1 \
+	--download-metis=1 \
+	--download-metis-cmake-arguments="${MAKEFILE_GENERATOR}" \
+	--download-parmetis=1 \
+	--download-parmetis-cmake-arguments="${MAKEFILE_GENERATOR}" \
+	--download-scalapack=1 \
+	--download-scalapack-cmake-arguments="${MAKEFILE_GENERATOR}" \
+	--download-mumps=1
+
+# Compile and install
+make
+make install
Index: /issm/trunk/externalpackages/petsc/install-3.15-babylon.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.15-babylon.sh	(revision 26744)
+++ /issm/trunk/externalpackages/petsc/install-3.15-babylon.sh	(revision 26744)
@@ -0,0 +1,48 @@
+#!/bin/bash
+set -eu
+
+
+## Constants
+#
+VER="3.15.3"
+
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf petsc-${VER}.tar.gz
+
+# Cleanup
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir ${PETSC_DIR}
+
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
+rm -rf petsc-${VER}
+
+# Configure
+cd ${PETSC_DIR}
+./config/configure.py \
+	--with-cc=icc --with-cxx=icpc --with-fc=ifort \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
+	--with-debugging=0 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-pic=1 \
+	--download-fblaslapack=1 \
+	--download-mpich=1 \
+	--download-metis=1 \
+	--download-parmetis=1 \
+	--download-scalapack=1 \
+	--download-mumps=1 \
+	--download-zlib=1 \
+	--download-hdf5=1
+
+# Compile and install
+make
+make install
Index: /issm/trunk/externalpackages/petsc/install-3.15-discovery.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.15-discovery.sh	(revision 26744)
+++ /issm/trunk/externalpackages/petsc/install-3.15-discovery.sh	(revision 26744)
@@ -0,0 +1,43 @@
+#!/bin/bash
+set -eu
+
+## Constants
+VER="3.15.3"
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf petsc-${VER}.tar.gz
+
+# Cleanup
+rm -rf install src
+mkdir install src
+
+# Move source to 'src' directory
+mv petsc-${VER}/* src/
+rm -rf petsc-${VER}
+
+cd src
+./config/configure.py \
+        COPTFLAGS="-g -O3" CXXOPTFLAGS="-g -O3" FOPTFLAGS="-g -O3" \
+		  --with-make-np=20 \
+        --with-blas-lapack-dir=$MKL_ROOT \
+        --with-mpi-dir="/optnfs/el7/mpich/3.3-intel19.3/" \
+        --known-mpi-shared-libraries=1 \
+        --known-mpi-long-double=1 \
+        --known-mpi-int64_t=1 \
+        --known-mpi-c-double-complex=1 \
+        --with-debugging=0 \
+        --with-valgrind=0 \
+        --with-x=0 \
+        --with-ssl=0 \
+        --with-pic=1 \
+        --download-metis=1 \
+        --download-parmetis=1 \
+        --download-scalapack=1 \
+        --download-mumps=1
+
+# Compile and install
+make
+make install
Index: /issm/trunk/externalpackages/petsc/install-3.15-mac-arm.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.15-mac-arm.sh	(revision 26744)
+++ /issm/trunk/externalpackages/petsc/install-3.15-mac-arm.sh	(revision 26744)
@@ -0,0 +1,56 @@
+#!/bin/bash
+set -eu
+
+
+## Constants
+VER="3.15.2"
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf petsc-${VER}.tar.gz
+
+# Cleanup
+rm -rf install src
+mkdir install src
+
+# Move source to 'src' directory
+mv petsc-${VER}/* src/
+rm -rf petsc-${VER}
+
+# Configure
+#
+# NOTE:
+# - Added -fallow-argument-mismatch to FFLAGS in order to clear,
+#
+#		error: The Fortran compiler gfortran will not compile files that call 
+#		the same routine with arguments of different types.
+#
+#	for gfortran 10 or later (may need to remove it for earlier versions).
+# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
+#	(may need to remove it for earlier versions not using the C99 standard).
+#
+cd src
+./config/configure.py \
+	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
+	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	--CFLAGS="-Wno-error=implicit-function-declaration" \
+	--FFLAGS="-fallow-argument-mismatch" \
+	--LDFLAGS="-Wl,-no_compact_unwind" \
+	--with-debugging=0 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-pic=1 \
+	--download-fblaslapack=1 \
+	--download-mpich=1 \
+	--download-metis=1 \
+	--download-parmetis=1 \
+	--download-scalapack=1 \
+	--download-mumps=1 \
+	--download-zlib=1 
+
+# Compile and install
+make
+make install
Index: /issm/trunk/externalpackages/petsc/install-3.15-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.15-pleiades.sh	(revision 26744)
+++ /issm/trunk/externalpackages/petsc/install-3.15-pleiades.sh	(revision 26744)
@@ -0,0 +1,50 @@
+#!/bin/bash
+set -eu
+
+
+## Constants
+#
+VER="3.15.0"
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.15.0.tar.gz' 'petsc-3.15.0.tar.gz'
+
+# Unpack source
+tar -zxvf petsc-3.15.0.tar.gz
+
+# Cleanup
+rm -rf install src
+mkdir install src
+
+# Move source to $PETSC_DIR
+mv petsc-3.15.0/* src/
+rm -rf petsc-3.15.0
+
+
+# Configure
+#
+# NOTE: Based on /nasa/petsc/3.7.5/intel_mpt/lib/petsc/conf/petscvariables; look for CONFIGURE_OPTIONS
+#
+cd src
+./config/configure.py \
+	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
+	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	--with-cc=icc --with-cxx=icpc --with-fc=ifort --with-f77=ifort\
+	-COPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" -CXXOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" -FOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" \
+	--with-make-np=10 \
+	--with-blas-lapack-dir="/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/mkl/" \
+	--known-mpi-shared-libraries=1 \
+	--with-debugging=0 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-batch=1  \
+	--with-shared-libraries=1 \
+	--download-metis=1 \
+	--download-parmetis=1 \
+	--download-mumps=1 \
+	--download-scalapack=1
+
+# Compile and install
+make
+make install
Index: /issm/trunk/externalpackages/petsc/install-3.16-linux.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.16-linux.sh	(revision 26744)
+++ /issm/trunk/externalpackages/petsc/install-3.16-linux.sh	(revision 26744)
@@ -0,0 +1,46 @@
+#!/bin/bash
+set -eu
+
+## Constants
+VER="3.16.0"
+
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf petsc-${VER}.tar.gz
+
+# Cleanup
+rm -rf install src
+mkdir install src
+
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* src/
+rm -rf petsc-${VER}
+
+# Configure
+cd src
+./config/configure.py \
+	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
+	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	-COPTFLAGS="-g -O2" -CXXOPTFLAGS="-g -O2" -FOPTFLAGS="-g -O2" \
+	--with-debugging=0 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-pic=1 \
+	--download-fblaslapack=1 \
+	--download-mpich=1 \
+	--download-metis=1 \
+	--download-parmetis=1 \
+	--download-scalapack=1 \
+	--download-mumps=1 \
+	--download-zlib=1 \
+	--download-hdf5=1
+
+# Compile and install
+make
+make install
Index: /issm/trunk/externalpackages/petsc/install-3.7-discover.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.7-discover.sh	(revision 26744)
+++ /issm/trunk/externalpackages/petsc/install-3.7-discover.sh	(revision 26744)
@@ -0,0 +1,62 @@
+#!/bin/bash
+set -eu
+
+#Some cleanup
+rm -rf install petsc-3.7.6 src
+mkdir install src
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-3.7.6.tar.gz
+mv petsc-3.7.6/* src/
+rm -rf petsc-3.7.6
+
+#configure
+cd src
+./config/configure.py \
+	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
+	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+	--with-blas-lapack-dir="/usr/local/intel/2020/compilers_and_libraries_2020.0.166/linux/mkl/" \
+	--with-mpi-lib="/usr/local/sgi/mpi/mpt-2.17/lib/libmpi.so" \
+	--with-mpi-include="/usr/local/sgi/mpi/mpt-2.17/include/" \
+	--known-mpi-shared-libraries=1 \
+	--with-debugging=0 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-batch=1  \
+	--with-shared-libraries=1 \
+	--download-metis=1 \
+	--download-parmetis=1 \
+	--download-mumps=1 \
+	--download-scalapack=1 
+
+#prepare script to reconfigure petsc
+cat > script.queue << EOF
+#!/bin/bash
+#SBATCH -J petscinstall # Job Name
+#SBATCH -N 1
+#SBATCH -n 1
+#SBATCH -A s1690
+#SBATCH -t 00:01:00 # Run time (hh:mm:ss) - 1.5 hours
+#SBATCH --qos=debug
+#SBATCH -o petscinstall.outlog
+#SBATCH -e petscinstall.errlog
+
+. /usr/share/modules/init/bash
+module purge
+module load comp/intel/20.0.0.166
+module load mpi/sgi-mpt/2.17
+module load cmake/3.17.0
+
+export PATH="$PATH:."
+export MPI_GROUP_MAX=64
+mpiexec -np 1 ./conftest-arch-linux2-c-opt
+EOF
+
+#print instructions
+echo "== Now: cd src/ "
+echo "== sbatch script.queue "
+echo "== Then run reconfigure script generated by PETSc and follow instructions"
Index: sm/trunk/externalpackages/proj/install-6.2-static-with_tests.sh
===================================================================
--- /issm/trunk/externalpackages/proj/install-6.2-static-with_tests.sh	(revision 26743)
+++ 	(revision )
@@ -1,56 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-VER="6.2.1"
-
-## Environnment
-#
-export CC=mpicc
-export CXX=mpicxx
-# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently
-#		requires,
-#
-#			SQLITE3_LIBS="-lsqlite3".
-#
-#		On Ubuntu Linux, install the SQLite3 binary, libraries and headers
-#		with,
-#
-#			`apt-get install sqlite3 libsqlite3-dev`
-#
-export SQLITE3_LIBS="-lsqlite3"
-
-# Cleanup
-rm -rf install src
-mkdir install src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf proj-$VER.tar.gz
-
-# Move source into 'src' directory
-mv proj-$VER/* src
-rm -rf proj-$VER
-
-# Configure
-cd src
-./configure \
-	--prefix="${ISSM_DIR}/externalpackages/proj/install" \
-	--disable-dependency-tracking \
-	--enable-fast-install \
-	--disable-shared
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make check
-	make install
-else
-	make -j $1
-	make -j $1 check
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/proj/install-6.2-static.sh
===================================================================
--- /issm/trunk/externalpackages/proj/install-6.2-static.sh	(revision 26743)
+++ 	(revision )
@@ -1,54 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-VER="6.2.1"
-
-## Environment
-#
-export CC=mpicc
-export CXX=mpicxx
-# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently
-#		requires,
-#
-#			SQLITE3_LIBS="-lsqlite3".
-#
-#		On Ubuntu Linux, install the SQLite3 binary, libraries and headers
-#		with,
-#
-#			`apt-get install sqlite3 libsqlite3-dev`
-#
-export SQLITE3_LIBS="-lsqlite3"
-
-# Cleanup
-rm -rf install src
-mkdir install src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf proj-$VER.tar.gz
-
-# Move source into 'src' directory
-mv proj-$VER/* src
-rm -rf proj-$VER
-
-# Configure
-cd src
-./configure \
-	--prefix="${ISSM_DIR}/externalpackages/proj/install" \
-	--disable-dependency-tracking \
-	--enable-fast-install \
-	--disable-shared
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/proj/install-6.2-with_tests.sh
===================================================================
--- /issm/trunk/externalpackages/proj/install-6.2-with_tests.sh	(revision 26743)
+++ 	(revision )
@@ -1,55 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-VER="6.2.1"
-
-## Environnment
-#
-export CC=mpicc
-export CXX=mpicxx
-# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently
-#		requires,
-#
-#			SQLITE3_LIBS="-lsqlite3".
-#
-#		On Ubuntu Linux, install the SQLite3 binary, libraries and headers
-#		with,
-#
-#			`apt-get install sqlite3 libsqlite3-dev`
-#
-export SQLITE3_LIBS="-lsqlite3"
-
-# Cleanup
-rm -rf install src
-mkdir install src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf proj-$VER.tar.gz
-
-# Move source into 'src' directory
-mv proj-$VER/* src
-rm -rf proj-$VER
-
-# Configure
-cd src
-./configure \
-	--prefix="${ISSM_DIR}/externalpackages/proj/install" \
-	--disable-dependency-tracking \
-	--enable-fast-install
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make check
-	make install
-else
-	make -j $1
-	make -j $1 check
-	make -j $1 install
-fi
Index: sm/trunk/externalpackages/proj/install-6.2.sh
===================================================================
--- /issm/trunk/externalpackages/proj/install-6.2.sh	(revision 26743)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#!/bin/bash
-set -eu
-
-
-# Constants
-#
-VER="6.2.1"
-
-## Environnment
-#
-export CC=mpicc
-export CXX=mpicxx
-# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently
-#		requires,
-#
-#			SQLITE3_LIBS="-lsqlite3".
-#
-#		On Ubuntu Linux, install the SQLite3 binary, libraries and headers
-#		with,
-#
-#			`apt-get install sqlite3 libsqlite3-dev`
-#
-export SQLITE3_LIBS="-lsqlite3"
-
-# Cleanup
-rm -rf install src
-mkdir install src
-
-# Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
-
-# Unpack source
-tar -zxvf proj-$VER.tar.gz
-
-# Move source into 'src' directory
-mv proj-$VER/* src
-rm -rf proj-$VER
-
-# Configure
-cd src
-./configure \
-	--prefix="${ISSM_DIR}/externalpackages/proj/install" \
-	--disable-dependency-tracking \
-	--enable-fast-install
-
-# Compile and install
-if [ $# -eq 0 ]; then
-	make
-	make install
-else
-	make -j $1
-	make -j $1 install
-fi
Index: /issm/trunk/externalpackages/proj/install-6.sh
===================================================================
--- /issm/trunk/externalpackages/proj/install-6.sh	(revision 26744)
+++ /issm/trunk/externalpackages/proj/install-6.sh	(revision 26744)
@@ -0,0 +1,56 @@
+#!/bin/bash
+set -eu
+
+
+# Constants
+#
+VER="6.2.1"
+
+PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
+
+## Environment
+#
+export CC=mpicc
+export CXX=mpicxx
+# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently
+#		requires,
+#
+#			SQLITE3_LIBS="-lsqlite3".
+#
+#		On Ubuntu Linux, install the SQLite3 binary, libraries and headers
+#		with,
+#
+#			`apt-get install sqlite3 libsqlite3-dev`
+#
+export SQLITE3_LIBS="-lsqlite3"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf proj-${VER}.tar.gz
+
+# Move source into 'src' directory
+mv proj-${VER}/* src
+rm -rf proj-${VER}
+
+# Configure
+cd src
+./configure \
+	--prefix="${PREFIX}" \
+	--disable-dependency-tracking \
+	--enable-fast-install \
+	--disable-tiff
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
Index: /issm/trunk/externalpackages/proj/install-8-static-with_tests.sh
===================================================================
--- /issm/trunk/externalpackages/proj/install-8-static-with_tests.sh	(revision 26744)
+++ /issm/trunk/externalpackages/proj/install-8-static-with_tests.sh	(revision 26744)
@@ -0,0 +1,60 @@
+#!/bin/bash
+set -eu
+
+
+# Constants
+#
+VER="8.1.0"
+
+PREFIX="${ISSM_EXT_STATIC_DIR}/proj/install" # Set to location where external package should be installed
+
+## Environment
+#
+export CC=mpicc
+export CXX=mpicxx
+
+# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently 
+# requires,
+#
+#	SQLITE3_LIBS="-lsqlite3".
+#
+# On Ubuntu Linux, install the SQLite3 binary, libraries and headers with,
+#
+#	`apt-get install sqlite3 libsqlite3-dev`
+#
+export SQLITE3_LIBS="-lsqlite3"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf proj-${VER}.tar.gz
+
+# Move source into 'src' directory
+mv proj-${VER}/* src
+rm -rf proj-${VER}
+
+# Configure
+cd src
+./configure \
+	--prefix="${PREFIX}" \
+	--disable-dependency-tracking \
+	--enable-fast-install \
+	--disable-shared \
+	--disable-tiff
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make check
+	make install
+else
+	make -j $1
+	mack -j $1 check
+	make -j $1 install
+fi
+
Index: /issm/trunk/externalpackages/proj/install-8-static.sh
===================================================================
--- /issm/trunk/externalpackages/proj/install-8-static.sh	(revision 26744)
+++ /issm/trunk/externalpackages/proj/install-8-static.sh	(revision 26744)
@@ -0,0 +1,57 @@
+#!/bin/bash
+set -eu
+
+
+# Constants
+#
+VER="8.1.0"
+
+PREFIX="${ISSM_EXT_STATIC_DIR}/proj/install" # Set to location where external package should be installed
+
+## Environment
+#
+export CC=mpicc
+export CXX=mpicxx
+
+# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently 
+# requires,
+#
+#	SQLITE3_LIBS="-lsqlite3".
+#
+# On Ubuntu Linux, install the SQLite3 binary, libraries and headers with,
+#
+#	`apt-get install sqlite3 libsqlite3-dev`
+#
+export SQLITE3_LIBS="-lsqlite3"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf proj-${VER}.tar.gz
+
+# Move source into 'src' directory
+mv proj-${VER}/* src
+rm -rf proj-${VER}
+
+# Configure
+cd src
+./configure \
+	--prefix="${PREFIX}" \
+	--disable-dependency-tracking \
+	--enable-fast-install \
+	--disable-shared \
+	--disable-tiff
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
Index: /issm/trunk/externalpackages/proj/install-8-with_tests.sh
===================================================================
--- /issm/trunk/externalpackages/proj/install-8-with_tests.sh	(revision 26744)
+++ /issm/trunk/externalpackages/proj/install-8-with_tests.sh	(revision 26744)
@@ -0,0 +1,58 @@
+#!/bin/bash
+set -eu
+
+
+# Constants
+#
+VER="8.1.0"
+
+PREFIX="${ISSM_EXT_SHARED_DIR}/proj/install" # Set to location where external package should be installed
+
+## Environment
+#
+export CC=mpicc
+export CXX=mpicxx
+
+# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently 
+# requires,
+#
+#	SQLITE3_LIBS="-lsqlite3".
+#
+# On Ubuntu Linux, install the SQLite3 binary, libraries and headers with,
+#
+#	`apt-get install sqlite3 libsqlite3-dev`
+#
+export SQLITE3_LIBS="-lsqlite3"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf proj-${VER}.tar.gz
+
+# Move source into 'src' directory
+mv proj-${VER}/* src
+rm -rf proj-${VER}
+
+# Configure
+cd src
+./configure \
+	--prefix="${PREFIX}" \
+	--disable-dependency-tracking \
+	--enable-fast-install \
+	--disable-tiff
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make check
+	make install
+else
+	make -j $1
+	mack -j $1 check
+	make -j $1 install
+fi
Index: /issm/trunk/externalpackages/proj/install-8.sh
===================================================================
--- /issm/trunk/externalpackages/proj/install-8.sh	(revision 26744)
+++ /issm/trunk/externalpackages/proj/install-8.sh	(revision 26744)
@@ -0,0 +1,56 @@
+#!/bin/bash
+set -eu
+
+
+# Constants
+#
+VER="8.1.0"
+
+PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
+
+## Environment
+#
+export CC=mpicc
+export CXX=mpicxx
+
+# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently 
+# requires,
+#
+#	SQLITE3_LIBS="-lsqlite3".
+#
+# On Ubuntu Linux, install the SQLite3 binary, libraries and headers with,
+#
+#	`apt-get install sqlite3 libsqlite3-dev`
+#
+export SQLITE3_LIBS="-lsqlite3"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf proj-${VER}.tar.gz
+
+# Move source into 'src' directory
+mv proj-${VER}/* src
+rm -rf proj-${VER}
+
+# Configure
+cd src
+./configure \
+	--prefix="${PREFIX}" \
+	--disable-dependency-tracking \
+	--enable-fast-install \
+	--disable-tiff
+
+# Compile and install
+if [ $# -eq 0 ]; then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
Index: sm/trunk/externalpackages/proj/install.sh
===================================================================
--- /issm/trunk/externalpackages/proj/install.sh	(revision 26743)
+++ 	(revision )
@@ -1,15 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf install
-
-#Download trunk
-svn checkout http://svn.osgeo.org/metacrs/proj/trunk/proj install
-
-#compile
-cd install
-./configure --prefix="$ISSM_DIR/externalpackages/proj/install"
-make 
-make install
-cd ..
Index: /issm/trunk/externalpackages/scalapack/configs/2.1/win/msys2/gcc/msmpi/CMakeLists.txt
===================================================================
--- /issm/trunk/externalpackages/scalapack/configs/2.1/win/msys2/gcc/msmpi/CMakeLists.txt	(revision 26744)
+++ /issm/trunk/externalpackages/scalapack/configs/2.1/win/msys2/gcc/msmpi/CMakeLists.txt	(revision 26744)
@@ -0,0 +1,277 @@
+cmake_minimum_required(VERSION 2.8)
+project(SCALAPACK C Fortran)
+# Configure the warning and code coverage suppression file
+configure_file( 
+  "${SCALAPACK_SOURCE_DIR}/CMAKE/CTestCustom.cmake.in"
+  "${SCALAPACK_BINARY_DIR}/CTestCustom.cmake"
+  COPYONLY
+)
+
+# Add the CMake directory for custon CMake modules
+set(CMAKE_MODULE_PATH "${SCALAPACK_SOURCE_DIR}/CMAKE" ${CMAKE_MODULE_PATH})
+
+if (UNIX)
+   if ( "${CMAKE_Fortran_COMPILER}" MATCHES "ifort" )
+  set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fltconsistency -fp_port" )
+   endif ()
+endif ()
+
+#
+#   MPI
+#
+if (LOCAL_MSMPI)
+  set(CMAKE_FIND_LIBRARY_PREFIXES "msys-" "")
+  set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
+  find_library(MSMPI msmpi PATHS ${MSMPI_ROOT}/lib)
+  if(MSMPI)
+    message(STATUS "--> Using MS-MPI library ${MSMPI}")
+  else(MSMPI)
+    message(FATAL_ERROR "MS-MPI library not found at ${MSMPI_ROOT}/lib")
+  endif()
+
+  include_directories("${MSMPI_ROOT}/include")
+endif()
+
+if (UNIX)
+   if ( "${CMAKE_Fortran_COMPILER}" MATCHES "ifort" )
+  set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fltconsistency -fp_port" )
+   endif ()
+endif ()
+
+macro(SCALAPACK_install_library lib)
+  install(TARGETS ${lib} EXPORT scalapack-targets
+    ARCHIVE DESTINATION lib${LIB_SUFFIX}
+    LIBRARY DESTINATION lib${LIB_SUFFIX}
+    RUNTIME DESTINATION Testing
+  )
+endmacro()
+
+# --------------------------------------------------
+# Testing
+SET(DART_TESTING_TIMEOUT 600)
+
+enable_testing()
+include(CTest)
+enable_testing()
+# --------------------------------------------------
+
+# Organize output files.  On Windows this also keeps .dll files next
+# to the .exe files that need them, making tests easy to run.
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCALAPACK_BINARY_DIR}/TESTING)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCALAPACK_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCALAPACK_BINARY_DIR}/lib)
+
+# --------------------------------------------------
+# Check for any necessary platform specific compiler flags
+include( CheckBLACSCompilerFlags )
+CheckBLACSCompilerFlags()
+
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
+set(PKG_CONFIG_DIR ${libdir}/pkgconfig)
+
+# --------------------------------------------------
+# BLACS Internal variables
+#
+#   Fortran Mangling, MPI Tests and BLACS settings
+#
+include(FortranMangling)
+COMPILE(install_COMPILED)
+
+FORTRAN_MANGLING(CDEFS)
+#MESSAGE(STATUS "Setting CDEFS = ${CDEFS}")
+#set(CDEFS ${CDEFS} CACHE STRING "Fortran Mangling" FORCE)
+MESSAGE(STATUS "=========")
+
+# --------------------------------------------------
+# Compiler Flags
+ADD_DEFINITIONS( "-D${CDEFS}")
+
+# --------------------------------------------------
+# ScaLAPACK needs BLAS and LAPACK
+
+option(USE_OPTIMIZED_LAPACK_BLAS "Whether or not to search for optimized LAPACK and BLAS libraries on your machine (if not found, Reference LAPACK and BLAS will be downloaded and installed)" ON)
+
+message(STATUS "CHECKING BLAS AND LAPACK LIBRARIES")
+
+IF(BLAS_LIBRARIES)
+  include(CheckFortranFunctionExists)
+  message(STATUS "--> BLAS supplied by user is ${BLAS_LIBRARIES}.")
+  set(CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRARIES})
+  CHECK_FORTRAN_FUNCTION_EXISTS("dgemm" BLAS_FOUND)
+  unset(CMAKE_REQUIRED_LIBRARIES)
+  message(STATUS "--> BLAS routine dgemm is found: ${BLAS_FOUND}.")
+ENDIF()
+
+IF(LAPACK_LIBRARIES)
+  include(CheckFortranFunctionExists)
+  message(STATUS "--> LAPACK supplied by user is ${LAPACK_LIBRARIES}.")
+  set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
+  CHECK_FORTRAN_FUNCTION_EXISTS("dgesv" LAPACK_FOUND)
+  unset(CMAKE_REQUIRED_LIBRARIES)
+  message(STATUS "--> LAPACK routine dgesv is found: ${LAPACK_FOUND}.")
+ENDIF()
+
+if(BLAS_FOUND AND LAPACK_FOUND)
+  message(STATUS "--> LAPACK supplied by user is WORKING, will use ${LAPACK_LIBRARIES}.")
+else(LAPACK_FOUND)
+   if(USE_OPTIMIZED_LAPACK_BLAS)
+      message(STATUS "--> Searching for optimized LAPACK and BLAS libraries on your machine.")
+      find_package(LAPACK)
+   ENDIF(USE_OPTIMIZED_LAPACK_BLAS)
+   if(NOT LAPACK_FOUND)
+      message(STATUS "--> LAPACK and BLAS were not found. Reference LAPACK and BLAS will be downloaded and installed")
+      include(ExternalProject)
+      ExternalProject_Add(
+		lapack
+		URL http://www.netlib.org/lapack/lapack.tgz
+		CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${SCALAPACK_BINARY_DIR}
+        PREFIX ${SCALAPACK_BINARY_DIR}/dependencies
+      )
+	  if (UNIX)
+         SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/liblapack.a CACHE STRING "LAPACK library" FORCE)
+         SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/libblas.a CACHE STRING "BLAS library" FORCE)
+	  else (UNIX) # On Windows
+         SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/liblapack.lib CACHE STRING "LAPACK library" FORCE)
+         SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/libblas.lib CACHE STRING "BLAS library" FORCE)
+      endif (UNIX)
+   ENDIF()
+ENDIF()
+
+message(STATUS "BLAS library: ${BLAS_LIBRARIES}")
+message(STATUS "LAPACK library: ${LAPACK_LIBRARIES}")
+
+MESSAGE(STATUS "=========")
+
+# --------------------------------------------------
+# By default static library
+OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF )
+OPTION(BUILD_STATIC_LIBS "Build static libraries" ON )
+
+# --------------------------------------------------
+# Subdirectories that need to be processed
+   
+macro(append_subdir_files variable dirname)
+get_directory_property(holder DIRECTORY ${dirname} DEFINITION ${variable})
+foreach(depfile ${holder})
+  list(APPEND ${variable} "${dirname}/${depfile}")
+endforeach()
+endmacro()
+
+
+#
+# BLACS
+#
+add_subdirectory(BLACS)
+append_subdir_files(blacs "BLACS/SRC")
+
+#
+# TOOLS
+#
+add_subdirectory(TOOLS)
+append_subdir_files(tools TOOLS)
+append_subdir_files(tools-C TOOLS)
+append_subdir_files(extra_lapack "TOOLS/LAPACK")
+
+#
+# PBLAS
+#
+add_subdirectory(PBLAS)
+append_subdir_files(pblas "PBLAS/SRC")
+append_subdir_files(pblas-F "PBLAS/SRC")
+append_subdir_files(pbblas "PBLAS/SRC/PBBLAS")
+append_subdir_files(ptzblas "PBLAS/SRC/PTZBLAS")
+append_subdir_files(ptools "PBLAS/SRC/PTOOLS")
+
+#
+# REDIST
+#
+add_subdirectory(REDIST)
+append_subdir_files(redist "REDIST/SRC")
+
+#
+# SRC
+#
+add_subdirectory(SRC)
+append_subdir_files(src "SRC")
+append_subdir_files(src-C "SRC")
+
+if (UNIX)
+   add_library(scalapack ${blacs} ${tools} ${tools-C} ${extra_lapack} ${pblas} ${pblas-F} ${ptzblas} ${ptools} ${pbblas} ${redist} ${src} ${src-C})
+   target_link_libraries( scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MSMPI})
+   scalapack_install_library(scalapack)
+else (UNIX) # Need to separate Fortran and C Code
+   OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON )
+   add_library(scalapack ${blacs} ${tools-C} ${pblas} ${ptools} ${redist} ${src-C})
+   target_link_libraries( scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MSMPI})
+   add_library(scalapack-F ${pblas-F} ${pbblas} ${ptzblas} ${tools} ${src} ${extra_lapack})
+   target_link_libraries( scalapack-F ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MSMPI})
+   scalapack_install_library(scalapack)
+   scalapack_install_library(scalapack-F)
+endif (UNIX)
+add_subdirectory(TESTING)
+
+# --------------------------------------------------
+# CPACK Packaging 
+
+SET(CPACK_PACKAGE_NAME "ScaLAPACK")
+SET(CPACK_PACKAGE_VENDOR "University of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd")
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ScaLAPACK- Linear Algebra Package")
+set(SCALAPACK_VERSION 2.0.2)
+set(CPACK_PACKAGE_VERSION_MAJOR 2)
+set(CPACK_PACKAGE_VERSION_MINOR 0)
+set(CPACK_PACKAGE_VERSION_PATCH 2)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
+SET(CPACK_PACKAGE_INSTALL_DIRECTORY "SCALAPACK")
+IF(WIN32 AND NOT UNIX)
+  # There is a bug in NSI that does not handle full unix paths properly. Make
+  # sure there is at least one set of four (4) backslashes.
+  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\http://icl.cs.utk.edu/lapack-forum")
+  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.netlib.org/scalapack")
+  SET(CPACK_NSIS_CONTACT "scalapack@eecs.utk.edu")
+  SET(CPACK_NSIS_MODIFY_PATH ON)
+  SET(CPACK_NSIS_DISPLAY_NAME "SCALAPACK-${SCALAPACK_VERSION}")
+  set(CPACK_PACKAGE_RELOCATABLE "true")
+ELSE(WIN32 AND NOT UNIX)
+  SET(CPACK_GENERATOR "TGZ")
+  SET(CPACK_SOURCE_GENERATOR TGZ)
+  SET(CPACK_SOURCE_PACKAGE_FILE_NAME "scalapack-${SCALAPACK_VERSION}" )
+  SET(CPACK_SOURCE_IGNORE_FILES ~$ .svn ${CPACK_SOURCE_IGNORE_FILES} )
+ENDIF(WIN32 AND NOT UNIX)
+INCLUDE(CPack)
+
+
+# --------------------------------------------------
+
+
+export(TARGETS scalapack FILE scalapack-targets.cmake)
+
+if( NOT LAPACK_FOUND )
+ install(FILES
+  ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}
+  DESTINATION lib
+   )
+endif( NOT LAPACK_FOUND )
+
+configure_file(${SCALAPACK_SOURCE_DIR}/CMAKE/scalapack-config-version.cmake.in
+  ${SCALAPACK_BINARY_DIR}/scalapack-config-version.cmake @ONLY)
+configure_file(${SCALAPACK_SOURCE_DIR}/CMAKE/scalapack-config-build.cmake.in
+  ${SCALAPACK_BINARY_DIR}/scalapack-config.cmake @ONLY)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scalapack.pc.in ${CMAKE_CURRENT_BINARY_DIR}/scalapack.pc)
+ install(FILES
+  ${CMAKE_CURRENT_BINARY_DIR}/scalapack.pc
+  DESTINATION ${PKG_CONFIG_DIR}
+   )
+
+configure_file(${SCALAPACK_SOURCE_DIR}/CMAKE/scalapack-config-install.cmake.in
+  ${SCALAPACK_BINARY_DIR}/CMakeFiles/scalapack-config.cmake @ONLY)
+install(FILES
+  ${SCALAPACK_BINARY_DIR}/CMakeFiles/scalapack-config.cmake
+  ${SCALAPACK_BINARY_DIR}/scalapack-config-version.cmake
+  DESTINATION lib/cmake/scalapack-${SCALAPACK_VERSION}
+  )
+
+install(EXPORT scalapack-targets
+  DESTINATION lib/cmake/scalapack-${SCALAPACK_VERSION})
+
Index: /issm/trunk/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/BLACS/SRC/src-C.c.in
===================================================================
--- /issm/trunk/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/BLACS/SRC/src-C.c.in	(revision 26744)
+++ /issm/trunk/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/BLACS/SRC/src-C.c.in	(revision 26744)
@@ -0,0 +1,2 @@
+#define CallFromC
+#include "./@src@"
Index: /issm/trunk/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/CMakeLists.txt
===================================================================
--- /issm/trunk/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/CMakeLists.txt	(revision 26744)
+++ /issm/trunk/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/CMakeLists.txt	(revision 26744)
@@ -0,0 +1,323 @@
+cmake_minimum_required(VERSION 2.8)
+project(SCALAPACK C Fortran)
+# Configure the warning and code coverage suppression file
+configure_file( 
+  "${SCALAPACK_SOURCE_DIR}/CMAKE/CTestCustom.cmake.in"
+  "${SCALAPACK_BINARY_DIR}/CTestCustom.cmake"
+  COPYONLY
+)
+
+# Add the CMake directory for custon CMake modules
+set(CMAKE_MODULE_PATH "${SCALAPACK_SOURCE_DIR}/CMAKE" ${CMAKE_MODULE_PATH})
+
+if (UNIX)
+   if ( "${CMAKE_Fortran_COMPILER}" MATCHES "ifort" )
+  set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fltconsistency -fp_port" )
+   endif ()
+endif ()
+
+#
+#   MPI
+#
+# #set(MPI_BASE_DIR "/Users/julie/opt/openmpi/" CACHE PATH "MPI Path")
+# #set(MPI_BASE_DIR "/Users/julie/opt/mpich2/" CACHE PATH "MPI Path")
+# set(CMAKE_PREFIX_PATH "${MPI_BASE_DIR};${CMAKE_PREFIX_PATH}")
+# #set(MPI_COMPILER ${MPI_BASE_DIR}/bin/mpicc)
+
+# find_package(MPI)
+# if (MPI_FOUND)
+#    message(STATUS "Found MPI_LIBRARY : ${MPI_FOUND} ")
+#    INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH})
+
+#    find_program(MPI_C_COMPILER
+#       NAMES mpicc
+#       HINTS "${MPI_BASE_DIR}"
+#       PATH_SUFFIXES bin
+#       DOC "MPI C compiler.")
+#    MARK_AS_ADVANCED(MPI_C_COMPILER)
+#    if ("${MPI_C_COMPILER}" STREQUAL "MPI_C_COMPILER-NOTFOUND")
+#       message(ERROR "--> MPI C Compiler NOT FOUND (please set MPI_BASE_DIR accordingly")
+#    else()
+#       message(STATUS "--> MPI C Compiler : ${MPI_C_COMPILER}")
+#       SET(CMAKE_C_COMPILER "${MPI_C_COMPILER}")
+#       message(STATUS "--> C Compiler : ${CMAKE_C_COMPILER}")
+#    endif()
+#    find_program(MPI_Fortran_COMPILER
+#       NAMES mpif77
+#       HINTS "${MPI_BASE_DIR}"
+#       PATH_SUFFIXES bin
+#       DOC "MPI Fortran compiler.")
+#    MARK_AS_ADVANCED(MPI_Fortran_COMPILER)
+   
+   
+
+#    if ("${MPI_Fortran_COMPILER}" STREQUAL "MPI_Fortran_COMPILER-NOTFOUND")
+#       message(ERROR "--> MPI Fortran Compiler NOT FOUND (please set MPI_BASE_DIR accordingly")
+#    else()
+#       message(STATUS "--> MPI Fortran Compiler : ${MPI_Fortran_COMPILER}")
+#       SET(Fortran_COMPILER "${CMAKE_Fortran_COMPILER}")
+#       SET(CMAKE_Fortran_COMPILER "${MPI_Fortran_COMPILER}")
+#       message(STATUS "--> Fortran Compiler : ${CMAKE_Fortran_COMPILER}")
+#    endif()
+   
+# else()
+#    message(STATUS "Found MPI_LIBRARY : ${MPI_FOUND} ")
+#    set(MPI_BASE_DIR ${MPI_BASE_DIR} CACHE PATH "MPI Path")
+#    UNSET(MPIEXEC CACHE)
+#    UNSET(MPIEXEC_POSTFLAGS CACHE)
+#    UNSET(MPIEXEC_PREFLAGS CACHE)
+#    UNSET(MPIEXEC_MAX_NUMPROCS CACHE)
+#    UNSET(MPIEXEC_NUMPROC_FLAG CACHE)
+#    UNSET(MPI_COMPILE_FLAGS CACHE)
+#    UNSET(MPI_LINK_FLAGS CACHE)
+#    UNSET(MPI_INCLUDE_PATH CACHE)
+#    message(FATAL_ERROR "--> MPI Library NOT FOUND -- please set MPI_BASE_DIR accordingly --")
+# endif()
+
+if (LOCAL_MSMPI)
+  set(CMAKE_FIND_LIBRARY_PREFIXES "msys-" "")
+  set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
+  find_library(MSMPI msmpi PATHS "${MSMPI_ROOT}/lib")
+  if(MSMPI)
+    message(STATUS "--> Using MS-MPI library ${MSMPI}")
+  else(MSMPI)
+    message(FATAL_ERROR "MS-MPI library not found at ${MSMPI_PATH}/lib")
+  endif()
+
+  include_directories("${MSMPI_ROOT}/include")
+endif()
+
+if (UNIX)
+   if ( "${CMAKE_Fortran_COMPILER}" MATCHES "ifort" )
+  set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fltconsistency -fp_port" )
+   endif ()
+endif ()
+
+macro(SCALAPACK_install_library lib)
+  install(TARGETS ${lib} EXPORT scalapack-targets
+    ARCHIVE DESTINATION lib${LIB_SUFFIX}
+    LIBRARY DESTINATION lib${LIB_SUFFIX}
+    RUNTIME DESTINATION Testing
+  )
+endmacro()
+
+# --------------------------------------------------
+# Testing
+SET(DART_TESTING_TIMEOUT 600)
+
+enable_testing()
+include(CTest)
+enable_testing()
+# --------------------------------------------------
+
+# Organize output files.  On Windows this also keeps .dll files next
+# to the .exe files that need them, making tests easy to run.
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCALAPACK_BINARY_DIR}/TESTING)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCALAPACK_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCALAPACK_BINARY_DIR}/lib)
+
+# --------------------------------------------------
+# Check for any necessary platform specific compiler flags
+include( CheckBLACSCompilerFlags )
+CheckBLACSCompilerFlags()
+
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
+set(PKG_CONFIG_DIR ${libdir}/pkgconfig)
+
+# --------------------------------------------------
+# BLACS Internal variables
+#
+#   Fortran Mangling, MPI Tests and BLACS settings
+#
+include(FortranMangling)
+COMPILE(install_COMPILED)
+
+FORTRAN_MANGLING(CDEFS)
+#MESSAGE(STATUS "Setting CDEFS = ${CDEFS}")
+#set(CDEFS ${CDEFS} CACHE STRING "Fortran Mangling" FORCE)
+MESSAGE(STATUS "=========")
+
+# --------------------------------------------------
+# Compiler Flags
+ADD_DEFINITIONS( "-D${CDEFS}")
+
+# --------------------------------------------------
+# ScaLAPACK needs BLAS and LAPACK
+
+option(USE_OPTIMIZED_LAPACK_BLAS "Whether or not to search for optimized LAPACK and BLAS libraries on your machine (if not found, Reference LAPACK and BLAS will be downloaded and installed)" ON)
+
+message(STATUS "CHECKING BLAS AND LAPACK LIBRARIES")
+
+IF(LAPACK_LIBRARIES)
+  include(CheckFortranFunctionExists)
+  message(STATUS "--> LAPACK supplied by user is ${LAPACK_LIBRARIES}.")
+  set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
+  CHECK_FORTRAN_FUNCTION_EXISTS("dgesv" LAPACK_FOUND)
+  unset( CMAKE_REQUIRED_LIBRARIES )
+  message(STATUS "--> LAPACK routine dgesv is found: ${LAPACK_FOUND}.")
+ENDIF()
+
+if(LAPACK_FOUND)
+      message(STATUS "--> LAPACK supplied by user is WORKING, will use ${LAPACK_LIBRARIES}.")
+else(LAPACK_FOUND)
+   if(USE_OPTIMIZED_LAPACK_BLAS)
+      message(STATUS "--> Searching for optimized LAPACK and BLAS libraries on your machine.")
+      find_package(LAPACK)
+   ENDIF(USE_OPTIMIZED_LAPACK_BLAS)
+   if(NOT LAPACK_FOUND)
+      message(STATUS "--> LAPACK and BLAS were not found. Reference LAPACK and BLAS will be downloaded and installed")
+      include(ExternalProject)
+      ExternalProject_Add(
+		lapack
+		URL http://www.netlib.org/lapack/lapack.tgz
+		CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${SCALAPACK_BINARY_DIR}
+        PREFIX ${SCALAPACK_BINARY_DIR}/dependencies
+      )
+	  if (UNIX)
+         SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/liblapack.a CACHE STRING "LAPACK library" FORCE)
+         SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/libblas.a CACHE STRING "BLAS library" FORCE)
+	  else (UNIX) # On Windows
+         SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/liblapack.lib CACHE STRING "LAPACK library" FORCE)
+         SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/libblas.lib CACHE STRING "BLAS library" FORCE)
+      endif (UNIX)
+   ENDIF()
+ENDIF()
+
+message(STATUS "BLAS library: ${BLAS_LIBRARIES}")
+message(STATUS "LAPACK library: ${LAPACK_LIBRARIES}")
+
+MESSAGE(STATUS "=========")
+
+# --------------------------------------------------
+# By default static library
+OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF )
+OPTION(BUILD_STATIC_LIBS "Build static libraries" ON )
+
+# --------------------------------------------------
+# Subdirectories that need to be processed
+   
+macro(append_subdir_files variable dirname)
+get_directory_property(holder DIRECTORY ${dirname} DEFINITION ${variable})
+foreach(depfile ${holder})
+  list(APPEND ${variable} "${dirname}/${depfile}")
+endforeach()
+endmacro()
+
+
+#
+# BLACS
+#
+add_subdirectory(BLACS)
+append_subdir_files(blacs "BLACS/SRC")
+
+#
+# TOOLS
+#
+add_subdirectory(TOOLS)
+append_subdir_files(tools TOOLS)
+append_subdir_files(tools-C TOOLS)
+append_subdir_files(extra_lapack "TOOLS/LAPACK")
+
+#
+# PBLAS
+#
+add_subdirectory(PBLAS)
+append_subdir_files(pblas "PBLAS/SRC")
+append_subdir_files(pblas-F "PBLAS/SRC")
+append_subdir_files(pbblas "PBLAS/SRC/PBBLAS")
+append_subdir_files(ptzblas "PBLAS/SRC/PTZBLAS")
+append_subdir_files(ptools "PBLAS/SRC/PTOOLS")
+
+#
+# REDIST
+#
+add_subdirectory(REDIST)
+append_subdir_files(redist "REDIST/SRC")
+
+#
+# SRC
+#
+add_subdirectory(SRC)
+append_subdir_files(src "SRC")
+append_subdir_files(src-C "SRC")
+
+# if (UNIX)
+   add_library(scalapack ${blacs} ${tools} ${tools-C} ${extra_lapack} ${pblas} ${pblas-F} ${ptzblas} ${ptools} ${pbblas} ${redist} ${src} ${src-C})
+   target_link_libraries( scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MSMPI})
+   scalapack_install_library(scalapack)
+# else (UNIX) # Need to separate Fortran and C Code
+#    OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON )
+#    add_library(scalapack ${blacs} ${tools-C} ${pblas} ${ptools} ${redist} ${src-C})
+#    target_link_libraries( scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
+#    add_library(scalapack-F ${blacs} ${pblas-F} ${pbblas} ${ptzblas} ${tools} ${src} ${extra_lapack} )
+#    target_link_libraries( scalapack-F ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MSMPI})
+#    scalapack_install_library(scalapack)
+#    scalapack_install_library(scalapack-F)
+# endif (UNIX)
+add_subdirectory(TESTING)
+
+# --------------------------------------------------
+# CPACK Packaging 
+
+SET(CPACK_PACKAGE_NAME "ScaLAPACK")
+SET(CPACK_PACKAGE_VENDOR "University of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd")
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ScaLAPACK- Linear Algebra Package")
+set(SCALAPACK_VERSION 2.1.0)
+set(CPACK_PACKAGE_VERSION_MAJOR 2)
+set(CPACK_PACKAGE_VERSION_MINOR 1)
+set(CPACK_PACKAGE_VERSION_PATCH 0)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
+SET(CPACK_PACKAGE_INSTALL_DIRECTORY "SCALAPACK")
+IF(WIN32 AND NOT UNIX)
+  # There is a bug in NSI that does not handle full unix paths properly. Make
+  # sure there is at least one set of four (4) backlasshes.
+  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\http://icl.cs.utk.edu/lapack-forum")
+  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.netlib.org/scalapack")
+  SET(CPACK_NSIS_CONTACT "scalapack@eecs.utk.edu")
+  SET(CPACK_NSIS_MODIFY_PATH ON)
+  SET(CPACK_NSIS_DISPLAY_NAME "SCALAPACK-${SCALAPACK_VERSION}")
+  set(CPACK_PACKAGE_RELOCATABLE "true")
+ELSE(WIN32 AND NOT UNIX)
+  SET(CPACK_GENERATOR "TGZ")
+  SET(CPACK_SOURCE_GENERATOR TGZ)
+  SET(CPACK_SOURCE_PACKAGE_FILE_NAME "scalapack-${SCALAPACK_VERSION}" )
+  SET(CPACK_SOURCE_IGNORE_FILES ~$ .svn ${CPACK_SOURCE_IGNORE_FILES} )
+ENDIF(WIN32 AND NOT UNIX)
+INCLUDE(CPack)
+
+
+# --------------------------------------------------
+
+
+export(TARGETS scalapack FILE scalapack-targets.cmake)
+
+if( NOT LAPACK_FOUND )
+ install(FILES
+  ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}
+  DESTINATION lib
+   )
+endif( NOT LAPACK_FOUND )
+
+configure_file(${SCALAPACK_SOURCE_DIR}/CMAKE/scalapack-config-version.cmake.in
+  ${SCALAPACK_BINARY_DIR}/scalapack-config-version.cmake @ONLY)
+configure_file(${SCALAPACK_SOURCE_DIR}/CMAKE/scalapack-config-build.cmake.in
+  ${SCALAPACK_BINARY_DIR}/scalapack-config.cmake @ONLY)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scalapack.pc.in ${CMAKE_CURRENT_BINARY_DIR}/scalapack.pc)
+ install(FILES
+  ${CMAKE_CURRENT_BINARY_DIR}/scalapack.pc
+  DESTINATION ${PKG_CONFIG_DIR}
+   )
+
+configure_file(${SCALAPACK_SOURCE_DIR}/CMAKE/scalapack-config-install.cmake.in
+  ${SCALAPACK_BINARY_DIR}/CMakeFiles/scalapack-config.cmake @ONLY)
+install(FILES
+  ${SCALAPACK_BINARY_DIR}/CMakeFiles/scalapack-config.cmake
+  ${SCALAPACK_BINARY_DIR}/scalapack-config-version.cmake
+  DESTINATION lib/cmake/scalapack-${SCALAPACK_VERSION}
+  )
+
+install(EXPORT scalapack-targets
+  DESTINATION lib/cmake/scalapack-${SCALAPACK_VERSION})
+
Index: /issm/trunk/externalpackages/scalapack/install-2-win-msys2-gcc-msmpi.sh
===================================================================
--- /issm/trunk/externalpackages/scalapack/install-2-win-msys2-gcc-msmpi.sh	(revision 26744)
+++ /issm/trunk/externalpackages/scalapack/install-2-win-msys2-gcc-msmpi.sh	(revision 26744)
@@ -0,0 +1,70 @@
+#!/bin/bash
+set -eu
+
+
+# NOTE:
+# - This configuration depends on the successful installation of METIS via 
+# 	$ISSM_DIR/externalpackages/metis/install-5-win-msys2-gcc-msmpi.sh
+# - MSMPI_ROOT should be available after etc/environment.sh is 
+#	sourced
+#
+
+## Constants
+#
+VER=2.1.0
+
+PREFIX="${ISSM_DIR}/externalpackages/scalapack/install"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/scalapack-${VER}.tgz" "scalapack-${VER}.tgz"
+
+# Unpack source
+tar -zxvf scalapack-${VER}.tgz
+
+# Move source into 'src' directory
+mv scalapack-${VER}/* src
+rm -rf scalapack-${VER}
+
+# Copy customized source and configuration files to 'src' directory
+cp configs/2.1/win/msys2/gcc/msmpi/CMakeLists.txt src
+
+# Compile
+#
+# NOTE:
+# - The CMakeLists.txt copied above is really just hacked from the original to 
+#	push through library and include paths, especially in the case of the 
+#	MS-MPI assets
+# - Added -fallow-argument-mismatch option to CMAKE_Fortran_FLAGS in order to 
+#	clear "Error: Rank mismatch between actual argument at [...]"
+# - Added -fallow-invalid-boz option to CMAKE_Fortran_FLAGS in order to clear 
+#	"Error: BOZ literal constant at [...]"
+#
+# TODO:
+# - Modify CMakeLists.txt to allow for more flexibility in configuration
+#
+cd src
+cmake \
+	-DCMAKE_INSTALL_PREFIX=${PREFIX} \
+	-DBUILD_SHARED_LIBS=ON \
+	-DCMAKE_C_COMPILER=/usr/bin/gcc \
+	-DCMAKE_Fortran_COMPILER=/usr/bin/gfortran \
+	-DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch -fallow-invalid-boz" \
+	-DLOCAL_MSMPI=1 \
+	-DMSMPI_ROOT="${MSMPI_ROOT}" \
+	-DBLAS_LIBRARIES="-L${BLAS_ROOT}/lib -lblas" \
+	-DLAPACK_LIBRARIES="-L${LAPACK_ROOT}/lib -llapack" \
+	.
+
+make
+
+# Install
+mkdir ${PREFIX}/lib
+cp TESTING/msys-scalapack.dll ${PREFIX}/lib
+
+# Create link to shared version of library so that libtool can find it
+cd ${PREFIX}/lib
+ln -s ./msys-scalapack.dll ./libscalapack.dll
Index: /issm/trunk/externalpackages/scalapack/install-2-win-msys2-mingw-msmpi.sh
===================================================================
--- /issm/trunk/externalpackages/scalapack/install-2-win-msys2-mingw-msmpi.sh	(revision 26744)
+++ /issm/trunk/externalpackages/scalapack/install-2-win-msys2-mingw-msmpi.sh	(revision 26744)
@@ -0,0 +1,73 @@
+#!/bin/bash
+set -eu
+
+
+# NOTE:
+# - This configuration depends on the successful installation of METIS via 
+# 	$ISSM_DIR/externalpackages/metis/install-5-win-msys2-gcc-msmpi.sh
+# - MSMPI_ROOT should be available after etc/environment.sh is 
+#	sourced
+#
+
+## Constants
+#
+VER=2.1.0
+
+PREFIX="${ISSM_DIR}/externalpackages/scalapack/install"
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir ${PREFIX} src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/scalapack-${VER}.tgz" "scalapack-${VER}.tgz"
+
+# Unpack source
+tar -zxvf scalapack-${VER}.tgz
+
+# Move source into 'src' directory
+mv scalapack-${VER}/* src
+rm -rf scalapack-${VER}
+
+# Copy customized source and configuration files to 'src' directory
+cp configs/2.1/win/msys2/mingw64/msmpi/CMakeLists.txt src
+cp configs/2.1/win/msys2/mingw64/msmpi/BLACS/SRC/src-C.c.in src/BLACS/SRC
+
+# Compile
+#
+# NOTE:
+# - The CMakeLists.txt copied above is really just hacked from the original to 
+#	push through library and include paths, especially in the case of the 
+#	MS-MPI assets
+# - Added -fallow-argument-mismatch option to CMAKE_Fortran_FLAGS in order to 
+#	clear "Error: Rank mismatch between actual argument at [...]"
+# - Added -fallow-invalid-boz option to CMAKE_Fortran_FLAGS in order to clear 
+#	"Error: BOZ literal constant at [...]"
+#
+# TODO:
+# - Modify CMakeLists.txt to allow for more flexibility in configuration
+#
+cd src
+cmake \
+	-DCMAKE_INSTALL_PREFIX=${PREFIX} \
+	-DBUILD_SHARED_LIBS=ON \
+	-DBUILD_STATIC_LIBS=OFF \
+	-DCMAKE_C_COMPILER=/mingw64/bin/gcc \
+	-DCMAKE_C_FLAGS="-Wno-error=implicit-function-declaration" \
+	-DCMAKE_Fortran_COMPILER=/mingw64/bin/gfortran \
+	-DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch -fallow-invalid-boz" \
+	-DLOCAL_MSMPI=1 \
+	-DMSMPI_ROOT="${MSMPI_ROOT}" \
+	-DBLAS_LIBRARIES="-L${BLAS_ROOT}/lib -lblas" \
+	-DLAPACK_LIBRARIES="-L${LAPACK_ROOT}/lib -llapack" \
+	.
+
+make
+
+# Install
+mkdir ${PREFIX}/lib
+cp lib/libscalapack.* ${PREFIX}/lib
+
+# Create link to shared version of library so that libtool can find it
+cd ${PREFIX}/lib
+ln -s liblapack.so liblapack.dll
Index: /issm/trunk/externalpackages/semic/configs/surface_physics.f90.patch
===================================================================
--- /issm/trunk/externalpackages/semic/configs/surface_physics.f90.patch	(revision 26744)
+++ /issm/trunk/externalpackages/semic/configs/surface_physics.f90.patch	(revision 26744)
@@ -0,0 +1,15 @@
+--- surface_physics.f90	2018-12-10 08:27:55.000000000 +0100
++++ my_surface_physics.f90	2018-12-10 08:58:14.000000000 +0100
+@@ -775,9 +775,9 @@
+         n_ksub        = par%n_ksub
+ 
+         ! Read parameters from input namelist file
+-        open(7,file=trim(filename))
+-        read(7,nml=surface_physics)
+-        close(7)
++        !open(7,file=trim(filename))
++        !read(7,nml=surface_physics)
++        !close(7)
+ !         write(*,nml=surface_physics)
+ 
+         ! Store local parameter values in output object
Index: /issm/trunk/externalpackages/semic/install.sh
===================================================================
--- /issm/trunk/externalpackages/semic/install.sh	(revision 26743)
+++ /issm/trunk/externalpackages/semic/install.sh	(revision 26744)
@@ -2,9 +2,14 @@
 set -eu
 
-#Some cleanup
-rm -rf install src
-mkdir install
 
-#Download latest version
+## Constants
+#
+PREFIX="${ISSM_DIR}/externalpackages/semic/install" # Set to location where external package should be installed
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX}/lib
+
+# Download source
 git clone https://github.com/mkrapp/semic.git src
 
@@ -22,5 +27,5 @@
 fi
 
-#Compile semic module utils.f90
+# Compile and install semic module utils.f90
 cd src/
 (
@@ -30,6 +35,6 @@
 FFLAGS=$FFLAGS
 install: libutils.\$(LIB_EXT)
-	cp libutils.\$(LIB_EXT) ../install/
-	cp utils.mod ../install/
+	cp libutils.\$(LIB_EXT) ${PREFIX}/lib
+	cp utils.mod ${PREFIX}
 OBJECTS= utils.o
 libutils.\$(LIB_EXT): \$(OBJECTS)
@@ -44,8 +49,8 @@
 make
 
-# patch surface_physics
-patch surface_physics.f90 < ../surface_physics.f90.patch
+# Apply patch surface_physics
+patch surface_physics.f90 < ../configs/surface_physics.f90.patch
 
-#Compile semic module surface_physics.f90
+# Compile semic module surface_physics.f90
 (
 cat << EOF
@@ -54,6 +59,6 @@
 FFLAGS=$FFLAGS
 install: libsurface_physics.\$(LIB_EXT)
-	cp libsurface_physics.\$(LIB_EXT) ../install/
-	cp surface_physics.mod ../install/
+	cp libsurface_physics.\$(LIB_EXT) ${PREFIX}/lib
+	cp surface_physics.mod ${PREFIX}
 OBJECTS= surface_physics.o
 libsurface_physics.\$(LIB_EXT): \$(OBJECTS)
Index: sm/trunk/externalpackages/semic/surface_physics.f90.patch
===================================================================
--- /issm/trunk/externalpackages/semic/surface_physics.f90.patch	(revision 26743)
+++ 	(revision )
@@ -1,15 +1,0 @@
---- surface_physics.f90	2018-12-10 08:27:55.000000000 +0100
-+++ my_surface_physics.f90	2018-12-10 08:58:14.000000000 +0100
-@@ -775,9 +775,9 @@
-         n_ksub        = par%n_ksub
- 
-         ! Read parameters from input namelist file
--        open(7,file=trim(filename))
--        read(7,nml=surface_physics)
--        close(7)
-+        !open(7,file=trim(filename))
-+        !read(7,nml=surface_physics)
-+        !close(7)
- !         write(*,nml=surface_physics)
- 
-         ! Store local parameter values in output object
Index: sm/trunk/externalpackages/shell2junit/README
===================================================================
--- /issm/trunk/externalpackages/shell2junit/README	(revision 26743)
+++ 	(revision )
@@ -1,9 +1,0 @@
-http://code.google.com/p/shell2junit/
-
-Shell2junit
-
-Shell2junit is a simple utility which facilitates to generate junit reports for batch processes executed in shell scripts. 
-
-The reports can be easily parsed in Hudson and other CI software in order to monitor and generate trends and alerts. 
-
-This page teaches how to do it in Hudson. 
Index: /issm/trunk/externalpackages/shell2junit/install.sh
===================================================================
--- /issm/trunk/externalpackages/shell2junit/install.sh	(revision 26743)
+++ /issm/trunk/externalpackages/shell2junit/install.sh	(revision 26744)
@@ -3,7 +3,23 @@
 
 
-#Some cleanup
-rm -rf install 
-mkdir install 
+## Constants
+#
+VER="1.0.0"
 
-cp patch/sh2ju.sh install/
+PREFIX="${ISSM_DIR}/externalpackages/shell2junit/install" # Set to location where external package should be installed
+
+# Cleanup
+rm -rf ${PREFIX}
+mkdir -p ${PREFIX}/bin
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/shell2junit-${VER}.zip" "shell2junit-${VER}.zip"
+
+# Unpack source
+unzip -q shell2junit-${VER}.zip
+
+# Install
+mv shell2junit-${VER}/sh2ju.sh ${PREFIX}/bin
+
+# Cleanup
+rm -rf shell2junit-${VER}
Index: sm/trunk/externalpackages/shell2junit/install.sh.old
===================================================================
--- /issm/trunk/externalpackages/shell2junit/install.sh.old	(revision 26743)
+++ 	(revision )
@@ -1,20 +1,0 @@
-#!/bin/bash
-set -eu
-
-#Some cleanup
-rm -rf install src
-rm -rf shell2junit
-mkdir install src
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/shell2junit-1.0.0.zip' 'shell2junit-1.0.0.zip'
-
-#Untar 
-unzip shell2junit-1.0.0.zip
-
-#Move shell2junit into install directory
-mv shell2junit/* src
-rm -rf shell2junit
-
-#Copy executable: 
-cp src/sh2ju.sh install
Index: /issm/trunk/externalpackages/sqlite/install.sh
===================================================================
--- /issm/trunk/externalpackages/sqlite/install.sh	(revision 26743)
+++ /issm/trunk/externalpackages/sqlite/install.sh	(revision 26744)
@@ -10,5 +10,5 @@
 
 # Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/sqlite-autoconf-${VER}.tar.gz" "sqlite-autoconf-${VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/sqlite-autoconf-${VER}.tar.gz" "sqlite-autoconf-${VER}.tar.gz"
 
 # Unpack source
Index: /issm/trunk/externalpackages/triangle/configs/makefile
===================================================================
--- /issm/trunk/externalpackages/triangle/configs/makefile	(revision 26743)
+++ /issm/trunk/externalpackages/triangle/configs/makefile	(revision 26744)
@@ -35,5 +35,5 @@
 
 libtriangle.dylib: $(OBJECTS)
-	$(CC) $(CSWITCHES) $(TRILIBDEFS) -dynamiclib -install_name ${INSTALL_DIR}/lib/$@ -o $@ triangle.c
+	$(CC) $(CSWITCHES) $(TRILIBDEFS) -dynamiclib -install_name ${PREFIX}/lib/$@ -o $@ triangle.c
 
 libtriangle.lib: $(OBJECTS)
Index: /issm/trunk/externalpackages/triangle/configs/win/msys2/gcc/configure.make
===================================================================
--- /issm/trunk/externalpackages/triangle/configs/win/msys2/gcc/configure.make	(revision 26744)
+++ /issm/trunk/externalpackages/triangle/configs/win/msys2/gcc/configure.make	(revision 26744)
@@ -0,0 +1,6 @@
+CC=gcc
+CSWITCHES=$(CFLAGS) -DNO_TIMER -fpic
+TRILIBDEFS=-DTRILIBRARY
+STATIC_LIB_EXT=a
+SHARED_LIB_EXT=dll
+OBJ_EXT=o
Index: /issm/trunk/externalpackages/triangle/configs/win/msys2/mingw64/configure.make
===================================================================
--- /issm/trunk/externalpackages/triangle/configs/win/msys2/mingw64/configure.make	(revision 26744)
+++ /issm/trunk/externalpackages/triangle/configs/win/msys2/mingw64/configure.make	(revision 26744)
@@ -0,0 +1,6 @@
+CC=gcc
+CSWITCHES=$(CFLAGS) -DNO_TIMER -fpic
+TRILIBDEFS=-DTRILIBRARY
+STATIC_LIB_EXT=a
+SHARED_LIB_EXT=dll
+OBJ_EXT=o
Index: /issm/trunk/externalpackages/triangle/install-discover.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-discover.sh	(revision 26743)
+++ /issm/trunk/externalpackages/triangle/install-discover.sh	(revision 26744)
@@ -2,23 +2,33 @@
 set -eu
 
-#Some cleanup 
-rm -rf install triangle
-mkdir install
 
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
+# Constants
+#
+export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
 
-#Untar 
-cd install
-cp ../triangle.zip ./
-unzip triangle.zip
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
 
-#copy new makefile
-cp ../configs/pleiades/configure.make ./
-cp ../makefile ./
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
 
-#Compile triangle
-make
+# Unpack source
+unzip triangle.zip -d src
 
-#Patch triangle.h
-patch triangle.h ../triangle.h.patch
+# Copy customized source files to 'src' directory
+cp configs/makefile src
+cp configs/triangle.h src
+cp configs/linux/configure.make src
+
+# Compile
+cd src
+make shared
+
+# Install
+cd ..
+cp src/libtriangle.* ${PREFIX}/lib
+cp src/triangle.h ${PREFIX}/include
+
+# Cleanup
+rm -rf src
Index: /issm/trunk/externalpackages/triangle/install-linux-javascript.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-linux-javascript.sh	(revision 26743)
+++ /issm/trunk/externalpackages/triangle/install-linux-javascript.sh	(revision 26744)
@@ -10,5 +10,5 @@
 # Constants
 #
-INSTALL_DIR="install-javascript"
+export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
 
 # Environment
@@ -22,9 +22,9 @@
 
 # Source Emscripten environment
-source ${ISSM_DIR}/externalpackages/emscripten/install/emsdk_env.sh
+source ${EMSCRIPTEN_ROOT}/emsdk_env.sh
 
 # Cleanup
-rm -rf ${INSTALL_DIR} src
-mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/share src
+rm -rf ${PREFIX} src
+mkdir ${PREFIX} ${PREFIX}/include ${PREFIX}/share src
 
 # Download source
@@ -45,4 +45,4 @@
 # Install
 cd ..
-cp src/triangle.o ${INSTALL_DIR}/share
-cp src/triangle.h ${INSTALL_DIR}/include
+cp src/triangle.o ${PREFIX}/share
+cp src/triangle.h ${PREFIX}/include
Index: /issm/trunk/externalpackages/triangle/install-linux-static.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-linux-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/triangle/install-linux-static.sh	(revision 26744)
@@ -5,9 +5,9 @@
 # Constants
 #
-INSTALL_DIR="install"
+export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
 
 # Cleanup
-rm -rf ${INSTALL_DIR} src
-mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/lib src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
 
 # Download source
@@ -28,6 +28,6 @@
 # Install
 cd ..
-cp src/libtriangle.* ${INSTALL_DIR}/lib
-cp src/triangle.h ${INSTALL_DIR}/include
+cp src/libtriangle.* ${PREFIX}/lib
+cp src/triangle.h ${PREFIX}/include
 
 # Cleanup
Index: /issm/trunk/externalpackages/triangle/install-linux.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-linux.sh	(revision 26743)
+++ /issm/trunk/externalpackages/triangle/install-linux.sh	(revision 26744)
@@ -5,9 +5,9 @@
 # Constants
 #
-INSTALL_DIR="install"
+export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
 
 # Cleanup
-rm -rf ${INSTALL_DIR} src
-mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/lib src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
 
 # Download source
@@ -28,6 +28,6 @@
 # Install
 cd ..
-cp src/libtriangle.* ${INSTALL_DIR}/lib
-cp src/triangle.h ${INSTALL_DIR}/include
+cp src/libtriangle.* ${PREFIX}/lib
+cp src/triangle.h ${PREFIX}/include
 
 # Cleanup
Index: /issm/trunk/externalpackages/triangle/install-mac-static.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-mac-static.sh	(revision 26743)
+++ /issm/trunk/externalpackages/triangle/install-mac-static.sh	(revision 26744)
@@ -5,9 +5,9 @@
 # Constants
 #
-INSTALL_DIR="install"
+export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
 
 # Cleanup
-rm -rf ${INSTALL_DIR} src
-mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/lib src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
 
 # Download source
@@ -28,6 +28,6 @@
 # Install
 cd ..
-cp src/libtriangle.* ${INSTALL_DIR}/lib
-cp src/triangle.h ${INSTALL_DIR}/include
+cp src/libtriangle.* ${PREFIX}/lib
+cp src/triangle.h ${PREFIX}/include
 
 # Cleanup
Index: /issm/trunk/externalpackages/triangle/install-mac.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-mac.sh	(revision 26743)
+++ /issm/trunk/externalpackages/triangle/install-mac.sh	(revision 26744)
@@ -5,9 +5,9 @@
 # Constants
 #
-export INSTALL_DIR="${ISSM_DIR}/externalpackages/triangle/install"
+export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
 
 # Cleanup
-rm -rf ${INSTALL_DIR} src
-mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/lib src
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
 
 # Download source
@@ -28,6 +28,6 @@
 # Install
 cd ..
-cp src/libtriangle.* ${INSTALL_DIR}/lib
-cp src/triangle.h ${INSTALL_DIR}/include
+cp src/libtriangle.* ${PREFIX}/lib
+cp src/triangle.h ${PREFIX}/include
 
 # Cleanup
Index: /issm/trunk/externalpackages/triangle/install-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-pleiades.sh	(revision 26743)
+++ /issm/trunk/externalpackages/triangle/install-pleiades.sh	(revision 26744)
@@ -2,23 +2,33 @@
 set -eu
 
-#Some cleanup 
-rm -rf install triangle
-mkdir install
 
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
+# Constants
+#
+INSTALL_DIR="install"
 
-#Untar 
-cd install
-cp ../triangle.zip ./
-unzip triangle.zip
+# Cleanup
+rm -rf ${INSTALL_DIR} src
+mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/lib src
 
-#copy new makefile
-cp ../configs/pleiades/configure.make ./
-cp ../makefile ./
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
 
-#Compile triangle
-make
+# Unpack source
+unzip triangle.zip -d src
 
-#Patch triangle.h
-patch triangle.h ../triangle.h.patch
+# Copy customized source files to 'src' directory
+cp configs/makefile src
+cp configs/triangle.h src
+cp configs/linux/configure.make src
+
+# Compile
+cd src
+make shared
+
+# Install
+cd ..
+cp src/libtriangle.* ${INSTALL_DIR}/lib
+cp src/triangle.h ${INSTALL_DIR}/include
+
+# Cleanup
+rm -rf src
Index: /issm/trunk/externalpackages/triangle/install-win-msys2-gcc.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-win-msys2-gcc.sh	(revision 26744)
+++ /issm/trunk/externalpackages/triangle/install-win-msys2-gcc.sh	(revision 26744)
@@ -0,0 +1,34 @@
+#!/bin/bash
+set -eu
+
+
+# Constants
+#
+export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
+
+# Unpack source
+unzip triangle.zip -d src
+
+# Copy customized source files to 'src' directory
+cp configs/makefile src
+cp configs/triangle.h src
+cp configs/win/msys2/gcc/configure.make src
+
+# Compile
+cd src
+make shared
+
+# Install
+cd ..
+cp src/libtriangle.* ${PREFIX}/lib
+cp src/triangle.h ${PREFIX}/include
+
+# Cleanup
+rm -rf src
Index: /issm/trunk/externalpackages/triangle/install-win-msys2-mingw.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-win-msys2-mingw.sh	(revision 26744)
+++ /issm/trunk/externalpackages/triangle/install-win-msys2-mingw.sh	(revision 26744)
@@ -0,0 +1,34 @@
+#!/bin/bash
+set -eu
+
+
+# Constants
+#
+export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
+
+# Cleanup
+rm -rf ${PREFIX} src
+mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
+
+# Unpack source
+unzip triangle.zip -d src
+
+# Copy customized source files to 'src' directory
+cp configs/makefile src
+cp configs/triangle.h src
+cp configs/win/msys2/mingw64/configure.make src
+
+# Compile
+cd src
+make shared
+
+# Install
+cd ..
+cp src/libtriangle.* ${PREFIX}/lib
+cp src/triangle.h ${PREFIX}/include
+
+# Cleanup
+rm -rf src
Index: /issm/trunk/externalpackages/triangle/makefile
===================================================================
--- /issm/trunk/externalpackages/triangle/makefile	(revision 26743)
+++ /issm/trunk/externalpackages/triangle/makefile	(revision 26744)
@@ -35,5 +35,5 @@
 
 libtriangle.dylib: $(OBJECTS)
-	$(CC) $(CSWITCHES) $(TRILIBDEFS) -dynamiclib -install_name $(PREFIX)/$@ -o $@ triangle.c
+	$(CC) $(CSWITCHES) $(TRILIBDEFS) -dynamiclib -install_name ${PREFIX}/lib/$@ -o $@ triangle.c
 
 libtriangle.lib: $(OBJECTS)
Index: /issm/trunk/externalpackages/valgrind/install-mac.sh
===================================================================
--- /issm/trunk/externalpackages/valgrind/install-mac.sh	(revision 26743)
+++ /issm/trunk/externalpackages/valgrind/install-mac.sh	(revision 26744)
@@ -3,10 +3,14 @@
 
 
+## Constants
+#
+PREFIX="${ISSM_DIR}/externalpackages/valgrind/install" # Set to location where external package should be installed
+
 # Clean up
-rm -rf install
+rm -rf ${PREFIX}
 
 # Download development version (the current release never supports the latest 
 # OS X releases)
-git clone git://sourceware.org/git/valgrind.git install
+git clone git://sourceware.org/git/valgrind.git ${PREFIX}
 
 # Configure
@@ -14,5 +18,5 @@
 ./autogen.sh
 ./configure \
-	--prefix="$ISSM_DIR/externalpackages/valgrind/install" \
+	--prefix="${PREFIX}" \
 	--enable-only64bit
 
@@ -25,3 +29,2 @@
 	make install -j $1
 fi
-
Index: /issm/trunk/externalpackages/valgrind/issm.supp
===================================================================
--- /issm/trunk/externalpackages/valgrind/issm.supp	(revision 26743)
+++ /issm/trunk/externalpackages/valgrind/issm.supp	(revision 26744)
@@ -310,4 +310,5 @@
 	  fun:dmumps_
 }
+
 {
 	<iparmetis1>
@@ -327,2 +328,432 @@
 }
 #}}}
+{
+   <main1>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   fun:strdup
+   fun:mca_base_var_enum_create_flag
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libopen-pal.so.20.10.1
+   fun:mca_base_framework_register
+   fun:mca_base_framework_open
+   fun:mca_base_framework_open
+   fun:ompi_mpi_init
+   fun:PMPI_Init
+   fun:_Z15EnvironmentInitiPPc
+   fun:main
+}
+{
+   <main2>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   fun:strdup
+   fun:mca_base_var_enum_create_flag
+   fun:ompi_mpi_init
+   fun:PMPI_Init
+   fun:_Z15EnvironmentInitiPPc
+   fun:main
+}
+{
+   <main3>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   fun:mca_base_component_repository_open
+   fun:mca_base_component_find
+   fun:mca_base_framework_components_register
+   fun:mca_base_framework_register
+   fun:mca_base_framework_open
+   fun:opal_init
+   fun:orte_init
+   fun:ompi_mpi_init
+   fun:PMPI_Init
+   fun:_Z15EnvironmentInitiPPc
+   fun:main
+}
+{
+   <main4>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:*
+   obj:*
+   obj:*
+   fun:orte_oob_base_select
+   fun:orte_ess_base_app_setup
+   obj:*
+   fun:orte_init
+   fun:ompi_mpi_init
+   fun:PMPI_Init
+   fun:_Z15EnvironmentInitiPPc
+   fun:main
+}
+{
+   <main5>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   fun:PMIx_Store_internal
+   fun:pmix1_store_local
+   fun:orte_ess_base_app_setup
+   obj:*
+   fun:orte_init
+   fun:ompi_mpi_init
+   fun:PMPI_Init
+   fun:_Z15EnvironmentInitiPPc
+   fun:main
+}
+{
+   <main6>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:*
+   obj:*
+   fun:ompi_mpi_init
+   fun:PMPI_Init
+   fun:_Z15EnvironmentInitiPPc
+   fun:main
+}
+{
+   <main7>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   fun:opal_free_list_grow_st
+   fun:opal_rb_tree_init
+   obj:*
+   obj:*
+   fun:mca_base_framework_components_open
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libopen-pal.so.20.10.1
+   fun:mca_base_framework_open
+   fun:ompi_mpi_init
+   fun:PMPI_Init
+   fun:_Z15EnvironmentInitiPPc
+   fun:main
+}
+{
+   <Z15>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   fun:strdup
+   obj:*
+   obj:*
+   obj:*
+   obj:*
+   fun:ompi_mtl_base_select
+   obj:*
+   fun:mca_pml_base_select
+   fun:ompi_mpi_init
+   fun:PMPI_Init
+   fun:_Z15EnvironmentInitiPPc
+}
+{
+   <clone1>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
+   fun:opal_libevent2022_event_base_loop
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
+   fun:start_thread
+   fun:clone
+}
+{
+   <clone2>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:*
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libopen-rte.so.20.10.1
+   fun:orte_oob_base_set_addr
+   fun:opal_libevent2022_event_base_loop
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libopen-pal.so.20.10.1
+   fun:start_thread
+   fun:clone
+}
+{
+   <clone3>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
+   fun:opal_libevent2022_event_base_loop
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
+   fun:start_thread
+   fun:clone
+}
+{
+   <clone4>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
+   fun:opal_libevent2022_event_base_loop
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
+   fun:start_thread
+   fun:clone
+}
+{
+   <dlopen>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   fun:strdup
+   obj:*
+   fun:call_init
+   fun:_dl_init
+   fun:dl_open_worker
+   fun:_dl_catch_exception
+   fun:_dl_open
+   fun:dlopen_doit
+   fun:_dl_catch_exception
+   fun:_dl_catch_error
+   fun:_dlerror_run
+   fun:dlopen@@GLIBC_2.2.5
+}
+{
+   <ompi1>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:*
+   obj:*
+   obj:*
+   obj:*
+   obj:*
+   obj:/usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6
+   obj:/usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6
+   fun:hwloc_topology_set_xmlbuffer
+   obj:*
+   fun:orte_init
+   fun:ompi_mpi_init
+}
+{
+   <pmpi1>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   fun:lt__malloc
+   fun:lt__zalloc
+   obj:/usr/lib/x86_64-linux-gnu/libltdl.so.7.3.1
+   fun:lt_dlopenadvise
+   obj:*
+   obj:/usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6
+   fun:hwloc_topology_init
+   obj:*
+   fun:orte_init
+   fun:ompi_mpi_init
+   fun:PMPI_Init
+}
+{
+   <pmpi2>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:*
+   obj:*
+   obj:*
+   obj:*
+   obj:/usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6
+   obj:/usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6
+   fun:hwloc_topology_set_xmlbuffer
+   obj:*
+   fun:orte_init
+   fun:ompi_mpi_init
+   fun:PMPI_Init
+}
+{
+   <hwloc>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:*
+   obj:*
+   fun:__pthread_once_slow
+   obj:*
+   obj:*
+   obj:*
+   obj:*
+   obj:*
+   obj:/usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6
+   obj:/usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6
+   fun:hwloc_topology_set_xmlbuffer
+}
+{
+   <petsc4>
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:malloc
+   obj:*
+   fun:mca_coll_base_comm_select
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   fun:opal_progress
+   fun:ompi_comm_activate
+   fun:ompi_comm_dup_with_info
+   fun:PMPI_Comm_dup
+   fun:PetscCommDuplicate
+   fun:PetscHeaderCreate_Private
+   fun:MatCreate
+}
+{
+   <petsc5>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:*
+   fun:mca_coll_base_comm_select
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   fun:opal_progress
+   fun:ompi_comm_activate
+   fun:ompi_comm_dup_with_info
+   fun:PMPI_Comm_dup
+   fun:PetscCommDuplicate
+   fun:PetscHeaderCreate_Private
+   fun:MatCreate
+}
+{
+   <petsc6>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:*
+   fun:mca_coll_base_comm_select
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   fun:opal_progress
+   fun:ompi_comm_activate
+   fun:ompi_comm_dup_with_info
+   fun:PMPI_Comm_dup
+   fun:PetscCommDuplicate
+   fun:PetscHeaderCreate_Private
+   fun:VecCreate
+}
+{
+   <petsc7>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:*
+   fun:mca_coll_base_comm_select
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   fun:opal_progress
+   fun:ompi_comm_activate
+   fun:ompi_comm_dup_with_info
+   fun:PMPI_Comm_dup
+   fun:_Z20PetscInitializeMUMPSP6_p_MatP9Mat_MUMPS
+   obj:/usr/lib/x86_64-linux-gnu/libpetsc_real.so.3.7.7
+   fun:MatGetFactor
+}
+{
+   <mumps17>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:*
+   fun:mca_coll_base_comm_select
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   fun:opal_progress
+   fun:ompi_comm_activate
+   fun:ompi_comm_dup_with_info
+   fun:PMPI_Comm_dup
+   fun:MPI_COMM_DUP
+   fun:dmumps_ini_driver_
+   fun:dmumps_
+}
+{
+   <mumps18>
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:malloc
+   obj:*
+   fun:mca_coll_base_comm_select
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   fun:opal_progress
+   fun:ompi_comm_activate
+   fun:ompi_comm_dup_with_info
+   fun:PMPI_Comm_dup
+   fun:MPI_COMM_DUP
+   fun:dmumps_ini_driver_
+   fun:dmumps_
+}
+{
+   <mumps19>
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:malloc
+   obj:*
+   fun:mca_coll_base_comm_select
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   fun:opal_progress
+   fun:ompi_comm_activate
+   fun:ompi_comm_dup_with_info
+   fun:PMPI_Comm_dup
+   fun:MPI_COMM_DUP
+   fun:dmumps_
+   fun:dmumps_f77_
+}
+{
+   <mumps20>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:*
+   fun:mca_coll_base_comm_select
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   fun:opal_progress
+   fun:ompi_comm_activate
+   fun:ompi_comm_dup_with_info
+   fun:PMPI_Comm_dup
+   fun:MPI_COMM_DUP
+   fun:dmumps_
+   fun:dmumps_f77_
+}
+{
+   <mumps21>
+   Memcheck:Leak
+   match-leak-kinds: definite
+   fun:malloc
+   obj:*
+   fun:mca_coll_base_comm_select
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   fun:opal_progress
+   fun:ompi_comm_activate
+   fun:ompi_comm_split
+   fun:PMPI_Comm_split
+   fun:MPI_COMM_SPLIT
+   fun:dmumps_fac_driver_
+   fun:dmumps_
+}
+{
+   <mumps22>
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:malloc
+   obj:*
+   fun:mca_coll_base_comm_select
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
+   fun:opal_progress
+   fun:ompi_comm_activate
+   fun:ompi_comm_split
+   fun:PMPI_Comm_split
+   fun:MPI_COMM_SPLIT
+   fun:dmumps_fac_driver_
+   fun:dmumps_
+}
Index: /issm/trunk/externalpackages/vim/addons/vim/autoload/LaTeXtoUnicode.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/autoload/LaTeXtoUnicode.vim	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/autoload/LaTeXtoUnicode.vim	(revision 26744)
@@ -0,0 +1,755 @@
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Support for LaTex-to-Unicode conversion as in the Julia REPL "
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+function! s:L2U_Setup()
+
+  call s:L2U_SetupGlobal()
+
+  " Keep track of whether LaTeX-to-Unicode is activated
+  " (used when filetype changes)
+  let b:l2u_enabled = get(b:, "l2u_enabled", 0)
+  let b:l2u_autodetect_enable = get(b:, "l2u_autodetect_enable", 1)
+
+  " Did we install the L2U tab/as-you-type/keymap... mappings?
+  let b:l2u_tab_set = get(b:, "l2u_tab_set", 0)
+  let b:l2u_cmdtab_set = get(b:, "l2u_cmdtab_set", 0)
+  let b:l2u_autosub_set = get(b:, "l2u_autosub_set", 0)
+  let b:l2u_keymap_set = get(b:, "l2u_keymap_set", 0)
+
+  " Following are some flags used to pass information between the function which
+  " attempts the LaTeX-to-Unicode completion and the fallback function
+
+  " Was a (possibly partial) completion found?
+  let b:l2u_found_completion = 0
+  " Is the cursor just after a single backslash
+  let b:l2u_singlebslash = 0
+  " Are we in the middle of a L2U tab completion?
+  let b:l2u_tab_completing = 0
+  " Are we calling the tab fallback?
+  let b:l2u_in_fallback = 0
+
+endfunction
+
+function! s:L2U_SetupGlobal()
+
+  " Initialization of global and script-local variables
+  " is only performed once
+  if get(g:, "l2u_did_global_setup", 0)
+    return
+  endif
+
+  let g:l2u_did_global_setup = 1
+
+  let g:l2u_symbols_dict = julia_latex_symbols#get_dict()
+
+  call s:L2U_deprecated_options()
+
+  if v:version < 704
+      let g:latex_to_unicode_tab = "off"
+      let g:latex_to_unicode_auto = 0
+  endif
+
+  " YouCompleteMe and neocomplcache/neocomplete/deoplete plug-ins do not work well
+  " with LaTeX symbols suggestions
+  if exists("g:loaded_youcompleteme") ||
+        \ exists("g:loaded_neocomplcache") ||
+        \ exists("g:loaded_neocomplete") ||
+        \ exists("g:loaded_deoplete")
+    let g:latex_to_unicode_suggestions = 0
+  endif
+
+  " Forcibly get out of completion mode: feed
+  " this string with feedkeys(s:l2u_esc_sequence, 'n')
+  let s:l2u_esc_sequence = " \b"
+
+  " Trigger for the previous mapping of <Tab>
+  let s:l2u_fallback_trigger = "\u0091L2UFallbackTab"
+
+  " Trigger for the previous mapping of <CR>
+  let s:l2u_fallback_trigger_cr = "\u0091L2UFallbackCR"
+
+endfunction
+
+" Each time the filetype changes, we may need to enable or
+" disable the LaTeX-to-Unicode functionality
+function! LaTeXtoUnicode#Refresh()
+  call s:L2U_Setup()
+
+  " skip if manually overridden
+  if !b:l2u_autodetect_enable
+    return ''
+  endif
+
+  " by default, LaTeX-to-Unicode is only active on julia files
+  let file_types = s:L2U_file_type_regex(get(g:, "latex_to_unicode_file_types", "julia"))
+  let file_types_blacklist = s:L2U_file_type_regex(get(g:, "latex_to_unicode_file_types_blacklist", "$^"))
+
+  if match(&filetype, file_types) < 0 || match(&filetype, file_types_blacklist) >= 0
+    if b:l2u_enabled
+      call LaTeXtoUnicode#Disable(1)
+    else
+      return ''
+    endif
+  elseif !b:l2u_enabled
+    call LaTeXtoUnicode#Enable(1)
+  endif
+endfunction
+
+function! LaTeXtoUnicode#Enable(...)
+  let auto_set = a:0 > 0 ? a:1 : 0
+
+  if b:l2u_enabled
+    return ''
+  end
+
+  call s:L2U_ResetLastCompletionInfo()
+
+  let b:l2u_enabled = 1
+  let b:l2u_autodetect_enable = auto_set
+
+  " If we're editing the first file upon opening vim, this will only init the
+  " command line mode mapping, and the full initialization will be performed by
+  " the autocmd triggered by InsertEnter, defined in /ftdetect.vim.
+  " Otherwise, if we're opening a file from within a running vim session, this
+  " will actually initialize all the LaTeX-to-Unicode substitutions.
+  call LaTeXtoUnicode#Init()
+  return ''
+endfunction
+
+function! LaTeXtoUnicode#Disable(...)
+  let auto_set = a:0 > 0 ? a:1 : 0
+  if !b:l2u_enabled
+    return ''
+  endif
+  let b:l2u_enabled = 0
+  let b:l2u_autodetect_enable = auto_set
+  call LaTeXtoUnicode#Init()
+  return ''
+endfunction
+
+" Translate old options to their new equivalents
+function! s:L2U_deprecated_options()
+  for [new, old] in [["latex_to_unicode_tab",         "julia_latex_to_unicode"],
+                 \   ["latex_to_unicode_auto",        "julia_auto_latex_to_unicode"],
+                 \   ["latex_to_unicode_suggestions", "julia_latex_suggestions_enabled"],
+                 \   ["latex_to_unicode_eager",       "julia_latex_to_unicode_eager"]]
+    if !has_key(g:, new) && has_key(g:, old)
+      exec "let g:" . new . " = g:" . old
+    endif
+  endfor
+
+  if has_key(g:, "latex_to_unicode_tab")
+    if g:latex_to_unicode_tab is# 1
+      let g:latex_to_unicode_tab = "on"
+    elseif g:latex_to_unicode_tab is# 0
+      let g:latex_to_unicode_tab = "off"
+    endif
+  endif
+endfunction
+
+function! s:L2U_file_type_regex(ft)
+  if type(a:ft) == 3
+    let file_types = "\\%(" . join(a:ft, "\\|") . "\\)"
+  elseif type(a:ft) == 1
+    let file_types = a:ft
+  else
+    echoerr "invalid file_type specification"
+  endif
+  return "^" . file_types . "$"
+endfunction
+
+" Some data used to keep track of the previous completion attempt.
+" Used to detect
+" 1) if we just attempted the same completion, or
+" 2) if backspace was just pressed while completing
+" This function initializes and resets the required info
+
+function! s:L2U_ResetLastCompletionInfo()
+  let b:l2u_completed_once = 0
+  let b:l2u_bs_while_completing = 0
+  let b:l2u_last_compl = {
+        \ 'line': '',
+        \ 'col0': -1,
+        \ 'col1': -1,
+        \ }
+endfunction
+
+" This function only detects whether an exact match is found for a LaTeX
+" symbol in front of the cursor
+function! s:L2U_ismatch()
+  let col1 = col('.')
+  let l = getline('.')
+  let col0 = match(l[0:col1-2], '\\[^[:space:]\\]\+$')
+  if col0 == -1
+    return 0
+  endif
+  let base = l[col0:col1-2]
+  return has_key(g:l2u_symbols_dict, base)
+endfunction
+
+" Helper function to sort suggestion entries
+function! s:L2U_partmatches_sort(p1, p2)
+  return a:p1.word > a:p2.word ? 1 : a:p1.word < a:p2.word ? -1 : 0
+endfunction
+
+" Helper function to fix display of Unicode compose characters
+" in the suggestions menu (they are displayed on top of '◌')
+function! s:L2U_fix_compose_chars(uni)
+  let u = matchstr(a:uni, '^.')
+  let isc = ("\u0300" <= u && u <= "\u036F") ||
+          \ ("\u1DC0" <= u && u <= "\u1DFF") ||
+          \ ("\u20D0" <= u && u <= "\u20FF") ||
+          \ ("\uFE20" <= u && u <= "\uFE2F")
+  return isc ? "\u25CC" . a:uni : a:uni
+endfunction
+
+" Helper function to find the longest common prefix among
+" partial completion matches (used when suggestions are disabled
+" and in command line mode)
+function! s:L2U_longest_common_prefix(partmatches)
+  let common = a:partmatches[0]
+  for i in range(1, len(a:partmatches)-1)
+    let p = a:partmatches[i]
+    if len(p) < len(common)
+      let common = common[0 : len(p)-1]
+    endif
+    for j in range(1, len(common)-1)
+      if p[j] != common[j]
+        let common = common[0 : j-1]
+        break
+      endif
+    endfor
+  endfor
+  return common
+endfunction
+
+" Completion function. Besides the usual two-stage completefunc behaviour,
+" it has the following peculiar features:
+"  *) keeps track of the previous completion attempt
+"  *) sets some info to be used by the fallback function
+"  *) either returns a list of completions if a partial match is found, or a
+"     Unicode char if an exact match is found
+"  *) forces its way out of completion mode through a hack in some cases
+function! LaTeXtoUnicode#completefunc(findstart, base)
+  if a:findstart
+    " first stage
+    " avoid infinite loop if the fallback happens to call completion
+    if b:l2u_in_fallback
+      let b:l2u_in_fallback = 0
+      return -3
+    endif
+    " make sure that the options are still set
+    " (it may happen that <C-X><C-U> itself triggers the fallback before
+    " restarting, thus reseetting them; this happens when the prompt is
+    " waiting for ^U^N^P during a partial completion)
+    call s:L2U_SetCompleteopt()
+    " setup the cleanup/fallback operations when we're done
+    call s:L2U_InsertCompleteDoneAutocommand()
+    call s:L2U_InsertInsertLeaveAutocommand()
+    " set info for the callback
+    let b:l2u_found_completion = 1
+    " analyse current line
+    let col1 = col('.')
+    let l = getline('.')
+    let col0 = match(l[0:col1-2], '\\[^[:space:]\\]\+$')
+    " compare with previous completion attempt
+    let b:l2u_bs_while_completing = 0
+    let b:l2u_completed_once = 0
+    if col0 == b:l2u_last_compl['col0']
+      let prevl = b:l2u_last_compl['line']
+      if col1 == b:l2u_last_compl['col1'] && l ==# prevl
+        let b:l2u_completed_once = 1
+      elseif col1 == b:l2u_last_compl['col1'] - 1 && l ==# prevl[0 : col1-2] . prevl[col1 : -1]
+        let b:l2u_bs_while_completing = 1
+      endif
+    endif
+    " store completion info for next attempt
+    let b:l2u_last_compl['col0'] = col0
+    let b:l2u_last_compl['col1'] = col1
+    let b:l2u_last_compl['line'] = l
+    " is the cursor right after a backslash?
+    let b:l2u_singlebslash = (match(l[0:col1-2], '\\$') >= 0)
+    " completion not found
+    if col0 == -1
+      let b:l2u_found_completion = 0
+      call feedkeys(s:l2u_esc_sequence, 'n')
+      let col0 = -2
+    endif
+    return col0
+  else
+    " read settings (eager mode is implicit when suggestions are disabled)
+    let suggestions = get(g:, "latex_to_unicode_suggestions", 1)
+    let eager = get(g:, "latex_to_unicode_eager", 1) || !suggestions
+    " search for matches
+    let partmatches = []
+    let exact_match = 0
+    for k in keys(g:l2u_symbols_dict)
+      if k ==# a:base
+        let exact_match = 1
+      endif
+      if len(k) >= len(a:base) && k[0 : len(a:base)-1] ==# a:base
+        let menu = s:L2U_fix_compose_chars(g:l2u_symbols_dict[k])
+        if suggestions
+          call add(partmatches, {'word': k, 'menu': menu})
+        else
+          call add(partmatches, k)
+        endif
+      endif
+    endfor
+    " exact matches are replaced with Unicode
+    " exceptions:
+    "  *) we reached an exact match by pressing backspace while completing
+    "  *) the exact match is one among many, and the eager setting is
+    "     disabled, and it's the first time this completion is attempted
+    if exact_match && !b:l2u_bs_while_completing && (len(partmatches) == 1 || eager || b:l2u_completed_once)
+      " the completion is successful: reset the last completion info...
+      call s:L2U_ResetLastCompletionInfo()
+      " ...force our way out of completion mode...
+      call feedkeys(s:l2u_esc_sequence, 'n')
+      " ...return the Unicode symbol
+      return [g:l2u_symbols_dict[a:base]]
+    endif
+    if !empty(partmatches)
+      " here, only partial matches were found; either keep just the longest
+      " common prefix, or pass them on
+      if !suggestions
+        let partmatches = [s:L2U_longest_common_prefix(partmatches)]
+      else
+        call sort(partmatches, "s:L2U_partmatches_sort")
+      endif
+    endif
+    if empty(partmatches)
+      call feedkeys(s:l2u_esc_sequence, 'n')
+      let b:l2u_found_completion = 0
+    endif
+    return partmatches
+  endif
+endfunction
+
+function! LaTeXtoUnicode#PutLiteral(k)
+  call feedkeys(a:k, 'ni')
+  return ''
+endfunction
+
+function! LaTeXtoUnicode#PutLiteralCR()
+  call feedkeys('
+', 'ni')
+  return ''
+endfunction
+
+" Function which saves the current insert-mode mapping of a key sequence `s`
+" and associates it with another key sequence `k` (e.g. stores the current
+" <Tab> mapping into the Fallback trigger).
+" It returns the previous maparg dictionary, so that the previous mapping can
+" be reinstated if needed.
+function! s:L2U_SetFallbackMapping(s, k)
+  let mmdict = maparg(a:s, 'i', 0, 1)
+  if empty(mmdict)
+    exe 'inoremap <buffer> ' . a:k . ' ' . a:s
+    return mmdict
+  endif
+  let rhs = mmdict["rhs"]
+  if rhs =~# '^<Plug>L2U'
+    return mmdict
+  endif
+  let pre = '<buffer>'
+  let pre = pre . (mmdict["silent"] ? '<silent>' : '')
+  let pre = pre . (mmdict["expr"] ? '<expr>' : '')
+  if mmdict["noremap"]
+    let cmd = 'inoremap '
+  else
+    let cmd = 'imap '
+    " This is a nasty hack used to prevent infinite recursion. It's not a
+    " general solution. Also, it doesn't work with <CR> since that stops
+    " parsing of the <C-R>=... expression, so we need to special-case it.
+    " Also, if the original mapping was intended to be recursive, this
+    " will break it.
+    if a:s != "<CR>"
+      let rhs = substitute(rhs, '\c' . a:s, "\<C-R>=LaTeXtoUnicode#PutLiteral('" . a:s . "')\<CR>", 'g')
+    else
+      let rhs = substitute(rhs, '\c' . a:s, "\<C-R>=LaTeXtoUnicode#PutLiteralCR()\<CR>", 'g')
+    endif
+    " Make the mapping silent even if it wasn't originally
+    if !mmdict["silent"]
+      let pre = pre . '<silent>'
+    endif
+  endif
+  exe cmd . pre . ' ' . a:k . ' ' . rhs
+  return mmdict
+endfunction
+
+" Reinstate a mapping from the maparg dict returned by SetFallbackMapping
+" (only if buffer-local, since otherwise it should still be available)
+function! s:L2U_ReinstateMapping(mmdict)
+  if empty(a:mmdict) || !a:mmdict["buffer"]
+    return ''
+  endif
+  let lhs = a:mmdict["lhs"]
+  let rhs = a:mmdict["rhs"]
+  if rhs =~# '^<Plug>L2U'
+    return ''
+  endif
+  let pre = '<buffer>'
+  let pre = pre . (a:mmdict["silent"] ? '<silent>' : '')
+  let pre = pre . (a:mmdict["expr"] ? '<expr>' : '')
+  let cmd = a:mmdict["noremap"] ? 'inoremap ' : 'imap '
+  exe cmd . pre . ' ' . lhs . ' ' . rhs
+endfunction
+
+" This is the function which is mapped to <Tab>
+function! LaTeXtoUnicode#Tab()
+  " the <Tab> is passed through to the fallback mapping if the completion
+  " menu is present, and it hasn't been raised by the L2U tab, and there
+  " isn't an exact match before the cursor
+  if pumvisible() && !b:l2u_tab_completing && !s:L2U_ismatch()
+    call feedkeys(s:l2u_fallback_trigger)
+    return ''
+  endif
+  " ensure that we start completion with some reasonable options
+  call s:L2U_SetCompleteopt()
+  " reset the in_fallback info
+  let b:l2u_in_fallback = 0
+  let b:l2u_tab_completing = 1
+  " invoke completion; failure to perform LaTeX-to-Unicode completion is
+  " handled by the CompleteDone autocommand.
+  call feedkeys("\<C-X>\<C-U>", 'n')
+  return ""
+endfunction
+
+" This function is called at every CompleteDone event, and is meant to handle
+" the failures of LaTeX-to-Unicode completion by calling a fallback
+function! LaTeXtoUnicode#FallbackCallback()
+  call s:L2U_RemoveCompleteDoneAutocommand()
+  call s:L2U_RestoreCompleteopt()
+  if !b:l2u_tab_completing
+    " completion was not initiated by L2U, nothing to do
+    return
+  endif
+  " at this point L2U tab completion is over
+  let b:l2u_tab_completing = 0
+  " if the completion was successful do nothing
+  if b:l2u_found_completion == 1 || b:l2u_singlebslash == 1
+    return
+  endif
+  " fallback
+  let b:l2u_in_fallback = 1
+  call feedkeys(s:l2u_fallback_trigger)
+  return
+endfunction
+
+" This is the function that performs the substitution in command-line mode
+function! LaTeXtoUnicode#CmdTab(trigger)
+  " first stage
+  " analyse command line
+  let col1 = getcmdpos() - 1
+  let l = getcmdline()
+  let col0 = match(l[0:col1-1], '\\[^[:space:]\\]\+$')
+  let b:l2u_singlebslash = (match(l[0:col1-1], '\\$') >= 0)
+  " completion not found
+  if col0 == -1
+    if a:trigger == &wildchar
+      call feedkeys(nr2char(a:trigger), 'nt') " fall-back to the default wildchar
+    elseif a:trigger == char2nr("\<S-Tab>")
+      call feedkeys("\<S-Tab>", 'nt') " fall-back to the default <S-Tab>
+    endif
+    return ''
+  endif
+  let base = l[col0 : col1-1]
+  " search for matches
+  let partmatches = []
+  let exact_match = 0
+  for k in keys(g:l2u_symbols_dict)
+    if k ==# base
+      let exact_match = 1
+      break
+    elseif len(k) >= len(base) && k[0 : len(base)-1] ==# base
+      call add(partmatches, k)
+    endif
+  endfor
+  if !exact_match && len(partmatches) == 0
+    " no matches, call fallbacks
+    if a:trigger == &wildchar
+      call feedkeys(nr2char(a:trigger), 'nt') " fall-back to the default wildchar
+    elseif a:trigger == char2nr("\<S-Tab>")
+      call feedkeys("\<S-Tab>", 'nt') " fall-back to the default <S-Tab>
+    endif
+  elseif exact_match
+    " exact matches are replaced with Unicode
+    let unicode = g:l2u_symbols_dict[base]
+    call feedkeys(repeat("\b", len(base)) . unicode, 'nt')
+  else
+    " no exact match: complete with the longest common prefix
+    let common = s:L2U_longest_common_prefix(partmatches)
+    call feedkeys(common[len(base):], 'nt')
+  endif
+  return ''
+endfunction
+
+function! s:L2U_SetCompleteopt()
+  " temporary change completeopt to use settings which make sense
+  " for L2U
+  let backup_new = 0
+  if !exists('b:l2u_backup_completeopt')
+    let b:l2u_backup_completeopt = &completeopt
+    let backup_new = 1
+  endif
+  noautocmd set completeopt+=longest
+  noautocmd set completeopt-=noinsert
+  noautocmd set completeopt-=noselect
+  noautocmd set completeopt-=menuone
+  if backup_new
+    let b:l2u_modified_completeopt = &completeopt
+  endif
+endfunction
+
+function! s:L2U_RestoreCompleteopt()
+  " restore completeopt, but only if nothing else has
+  " messed with it in the meanwhile
+  if exists('b:l2u_backup_completeopt')
+    if exists('b:l2u_modified_completeopt')
+      if &completeopt ==# b:l2u_modified_completeopt
+        noautocmd let &completeopt = b:l2u_backup_completeopt
+      endif
+      unlet b:l2u_modified_completeopt
+    endif
+    unlet b:l2u_backup_completeopt
+  endif
+endfunction
+
+function! s:L2U_InsertCompleteDoneAutocommand()
+  augroup L2UCompleteDone
+    autocmd! * <buffer>
+    " Every time a L2U completion finishes, the fallback may be invoked
+    autocmd CompleteDone <buffer> call LaTeXtoUnicode#FallbackCallback()
+  augroup END
+endfunction
+
+function! s:L2U_RemoveCompleteDoneAutocommand()
+  augroup L2UCompleteDone
+    autocmd! * <buffer>
+  augroup END
+endfunction
+
+function s:L2U_InsertLeaveClenup()
+    call s:L2U_ResetLastCompletionInfo()
+    augroup L2UInsertLeave
+      autocmd! * <buffer>
+    augroup END
+endfunction
+
+function! s:L2U_InsertInsertLeaveAutocommand()
+  augroup L2UInsertLeave
+    autocmd! * <buffer>
+    autocmd InsertLeave <buffer> call s:L2U_InsertLeaveClenup()
+  augroup END
+endfunction
+
+" Setup the L2U tab mapping
+function! s:L2U_SetTab(wait_insert_enter)
+  let opt_do_cmdtab = index(["on", "command", "cmd"], get(g:, "latex_to_unicode_tab", "on")) != -1
+  let opt_do_instab = index(["on", "insert", "ins"], get(g:, "latex_to_unicode_tab", "on")) != -1
+  if !b:l2u_cmdtab_set && opt_do_cmdtab && b:l2u_enabled
+    let b:l2u_cmdtab_keys = get(g:, "latex_to_unicode_cmd_mapping", ['<Tab>','<S-Tab>'])
+    if type(b:l2u_cmdtab_keys) != type([]) " avoid using v:t_list for backward compatibility
+      let b:l2u_cmdtab_keys = [b:l2u_cmdtab_keys]
+    endif
+    for k in b:l2u_cmdtab_keys
+      exec 'let trigger = char2nr("'.(k[0] == '<' ? '\' : '').k.'")'
+      exec 'cnoremap <buffer><expr> '.k.' LaTeXtoUnicode#CmdTab('.trigger.')'
+    endfor
+    let b:l2u_cmdtab_set = 1
+  endif
+  if b:l2u_tab_set
+    return
+  endif
+  " g:did_insert_enter is set from an autocommand in ftdetect
+  if a:wait_insert_enter && !get(g:, "did_insert_enter", 0)
+    return
+  endif
+  if !opt_do_instab || !b:l2u_enabled
+    return
+  endif
+
+  " Backup the previous completefunc (the check is probably not really needed)
+  if get(b:, "l2u_prev_completefunc", "") != "LaTeXtoUnicode#completefunc"
+    let b:l2u_prev_completefunc = &completefunc
+  endif
+  setlocal completefunc=LaTeXtoUnicode#completefunc
+
+  let b:l2u_prev_map_tab = s:L2U_SetFallbackMapping('<Tab>', s:l2u_fallback_trigger)
+  imap <buffer> <Tab> <Plug>L2UTab
+  inoremap <buffer><expr> <Plug>L2UTab LaTeXtoUnicode#Tab()
+
+  let b:l2u_tab_set = 1
+endfunction
+
+" Revert the LaTeX-to-Unicode tab mapping settings
+function! s:L2U_UnsetTab()
+  if b:l2u_cmdtab_set
+    for k in b:l2u_cmdtab_keys
+      exec 'cunmap <buffer> '.k
+    endfor
+    let b:l2u_cmdtab_set = 0
+  endif
+  if !b:l2u_tab_set
+    return
+  endif
+  exec "setlocal completefunc=" . get(b:, "l2u_prev_completefunc", "")
+  iunmap <buffer> <Tab>
+  if empty(maparg("<Tab>", "i"))
+    call s:L2U_ReinstateMapping(b:l2u_prev_map_tab)
+  endif
+  iunmap <buffer> <Plug>L2UTab
+  exe 'iunmap <buffer> ' . s:l2u_fallback_trigger
+  let b:l2u_tab_set = 0
+endfunction
+
+" Function which looks for viable LaTeX-to-Unicode supstitutions as you type
+function! LaTeXtoUnicode#AutoSub(...)
+  " avoid recursive calls
+  if get(b:, "l2u_in_autosub", 0)
+    return ''
+  endif
+  let vc = a:0 == 0 ? v:char : a:1
+  " for some reason function keys seem to be passed as characters 149 (F1-F12)
+  " or 186 (F13-F37, these are entered with shift/ctrl). In such cases, we
+  " can't really do any better than giving up.
+  if char2nr(vc) == 149 || char2nr(vc) == 186
+    return ''
+  endif
+  let b:l2u_in_autosub = 1
+  let col1 = col('.')
+  let lnum = line('.')
+  if col1 == 1
+    if a:0 > 1
+      call feedkeys(a:2, 'mi')
+    endif
+    let b:l2u_in_autosub = 0
+    return ''
+  endif
+  let bs = (vc != "\n")
+  let l = getline(lnum)[0 : col1-1-bs] . v:char
+  let col0 = match(l, '\\\%([_^]\?[A-Za-z]\+\%' . col1 . 'c\%([^A-Za-z]\|$\)\|[_^]\%([0-9()=+-]\)\%' . col1 .'c\%(.\|$\)\)')
+  if col0 == -1
+    if a:0 > 1
+      call feedkeys(a:2, 'mi')
+    endif
+    let b:l2u_in_autosub = 0
+    return ''
+  endif
+  let base = l[col0 : col1-1-bs]
+  let unicode = get(g:l2u_symbols_dict, base, '')
+  if empty(unicode)
+    if a:0 > 1
+      call feedkeys(a:2, 'mi')
+    endif
+    let b:l2u_in_autosub = 0
+    return ''
+  endif
+
+  " perform the substitution, wrapping it in undo breakpoints so that
+  " we can revert it as a whole
+  " at the end, reset the l2u_in_autosub variable without leaving insert mode
+  " the 'i' mode is the only one that works correctly when executing macros
+  " the 'n' mode is to avoid user-defined mappings of \b, <C-G> and <C-\><C-O>
+  call feedkeys("\<C-G>u" .
+             \  repeat("\b", len(base) + bs) . unicode . vc . s:l2u_esc_sequence .
+             \  "\<C-G>u" .
+             \  "\<C-\>\<C-O>:let b:l2u_in_autosub = 0\<CR>",
+             \  'ni')
+  return ''
+endfunction
+
+" Setup the auto as-you-type LaTeX-to-Unicode substitution
+function! s:L2U_SetAutoSub(wait_insert_enter)
+  if b:l2u_autosub_set
+    return
+  endif
+  " g:did_insert_enter is set from an autocommand in ftdetect
+  if a:wait_insert_enter && !get(g:, "did_insert_enter", 0)
+    return
+  endif
+  if !get(g:, "latex_to_unicode_auto", 0) || !b:l2u_enabled
+    return
+  endif
+  " Viable substitutions are searched at every character insertion via the
+  " autocmd InsertCharPre. The <Enter> key does not seem to be catched in
+  " this way though, so we use a mapping for that case.
+
+  let b:l2u_prev_map_cr = s:L2U_SetFallbackMapping('<CR>', s:l2u_fallback_trigger_cr)
+  imap <buffer> <CR> <Plug>L2UAutoSub
+  exec 'inoremap <buffer><expr> <Plug>L2UAutoSub LaTeXtoUnicode#AutoSub("\n", "' . s:l2u_fallback_trigger_cr . '")'
+
+  augroup L2UAutoSub
+    autocmd! * <buffer>
+    autocmd InsertCharPre <buffer> call LaTeXtoUnicode#AutoSub()
+  augroup END
+
+  let b:l2u_autosub_set = 1
+endfunction
+
+" Revert the auto LaTeX-to-Unicode settings
+function! s:L2U_UnsetAutoSub()
+  if !b:l2u_autosub_set
+    return
+  endif
+
+  iunmap <buffer> <CR>
+  if empty(maparg("<CR>", "i"))
+    call s:L2U_ReinstateMapping(b:l2u_prev_map_cr)
+  endif
+  iunmap <buffer> <Plug>L2UAutoSub
+  exe 'iunmap <buffer> ' . s:l2u_fallback_trigger_cr
+  augroup L2UAutoSub
+    autocmd! * <buffer>
+  augroup END
+  let b:l2u_autosub_set = 0
+endfunction
+
+function! s:L2U_SetKeymap()
+  if !b:l2u_keymap_set && get(g:, "latex_to_unicode_keymap", 0) && b:l2u_enabled
+    setlocal keymap=latex2unicode
+    let b:l2u_keymap_set = 1
+  endif
+endfunction
+
+function! s:L2U_UnsetKeymap()
+  if !b:l2u_keymap_set
+    return
+  endif
+  setlocal keymap=
+  let b:l2u_keymap_set = 0
+endfunction
+
+" Initialization. Can be used to re-init when global settings have changed.
+function! LaTeXtoUnicode#Init(...)
+  let wait_insert_enter = a:0 > 0 ? a:1 : 1
+
+  if !wait_insert_enter
+    augroup L2UInit
+      autocmd!
+    augroup END
+  endif
+
+  call s:L2U_UnsetTab()
+  call s:L2U_UnsetAutoSub()
+  call s:L2U_UnsetKeymap()
+
+  call s:L2U_SetTab(wait_insert_enter)
+  call s:L2U_SetAutoSub(wait_insert_enter)
+  call s:L2U_SetKeymap()
+  return ''
+endfunction
+
+function! LaTeXtoUnicode#Toggle()
+  call s:L2U_Setup()
+  if b:l2u_enabled
+    call LaTeXtoUnicode#Disable()
+    echo "LaTeX-to-Unicode disabled"
+  else
+    call LaTeXtoUnicode#Enable()
+    echo "LaTeX-to-Unicode enabled"
+  endif
+  return ''
+endfunction
Index: /issm/trunk/externalpackages/vim/addons/vim/autoload/generate_latex_symbols_table.jl
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/autoload/generate_latex_symbols_table.jl	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/autoload/generate_latex_symbols_table.jl	(revision 26744)
@@ -0,0 +1,17 @@
+#!/bin/env julia
+
+const filename = "julia_latex_symbols"
+const funcname = "get_dict"
+
+open("$filename.vim","w") do f
+    println(f, "\" This file is autogenerated from the script '$(basename(Base.source_path()))'")
+    println(f, "\" The symbols are based on Julia version $VERSION\n")
+    println(f, "scriptencoding utf-8\n")
+    println(f, "function! $filename#$funcname()\n",
+               "  return {\n",
+               "    \\ ",
+               join([string("'", latex, "': '", unicode, "'") for (latex,unicode) in sort!(vcat(collect(REPL.REPLCompletions.latex_symbols),collect(REPL.REPLCompletions.emoji_symbols)), by=x->x[2])],
+                    ",\n    \\ "),
+               "}")
+    println(f, "endfunction")
+end
Index: /issm/trunk/externalpackages/vim/addons/vim/autoload/julia.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/autoload/julia.vim	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/autoload/julia.vim	(revision 26744)
@@ -0,0 +1,166 @@
+function! julia#set_syntax_version(jvers)
+  echo "The julia#set_syntax_version function is deprecated"
+endfunction
+
+function! julia#toggle_deprecated_syntax()
+  echo "The julia#toggle_deprecated_syntax function is deprecated"
+endfunction
+
+if exists("loaded_matchit")
+
+function! julia#toggle_function_blockassign()
+    let sav_pos = getcurpos()
+    let l = getline('.')
+    let c = match(l, '\C\m\<function\s\+.\+(')
+    if c != -1
+        return julia#function_block2assign()
+    endif
+    let c = match(l, '\C\m)\%(::\S\+\)\?\%(\s\+where\s\+.*\)\?\s*=\s*')
+    if c == -1
+        echohl WarningMsg | echo "Not on a function definition or assignment line" | echohl None
+        return
+    endif
+    return julia#function_assign2block()
+endfunction
+
+function! julia#function_block2assign()
+    let sav_pos = getcurpos()
+    let l = getline('.')
+    let c = match(l, '\C\m\<function\s\+.\+(')
+    if c == -1
+        echohl WarningMsg | echo "Not on a function definition line" | echohl None
+        return
+    endif
+    let fpos = copy(sav_pos)
+    let fpos[2] = c+1
+    call setpos('.', fpos)
+    normal %
+    if line('.') != fpos[1]+2 || match(getline('.'), '\C\m^\s*end\s*$') == -1
+        echohl WarningMsg | echo "Only works with 3-lines functions" | echohl None
+        call setpos('.', sav_pos)
+        return
+    endif
+    call setpos('.', fpos)
+    normal! f(
+    normal %
+    while line('.') == fpos[1] && match(l[col('.')-1:], '\C\m)(') == 0
+        normal! l
+        normal %
+    endwhile
+    if line('.') != fpos[1] || match(l[(col('.')-1):], '\C\m)\%(::\S\+\)\?\%(\s\+where\s\+.*\)\?\s*$') != 0
+        echohl WarningMsg | echo "Unrecognized function definition format" | echohl None
+        call setpos('.', sav_pos)
+        return
+    endif
+
+    call setpos('.', fpos)
+    normal! dwA = J
+    if match(getline('.')[(col('.')-1):], '\C\mreturn\>') == 0
+        normal! dw
+    endif
+    if match(getline('.')[(col('.')-1):], '\C\m\s*$') == 0
+        normal! F=C= nothing
+    endif
+    normal! jddk^
+    return
+endfunction
+
+function! julia#function_assign2block()
+    let sav_pos = getcurpos()
+    let l = getline('.')
+    let c = match(l, '\C\m)\%(::\S\+\)\?\%(\s\+where\s\+.*\)\?\s*=\s*')
+    if c == -1
+        echohl WarningMsg | echo "Not on a function assignment-definition line" | echohl None
+        return
+    endif
+    normal ^
+    while match(l[(col('.')-1):], '\%(\S\+\.\)*@') == 0
+        normal! W
+    endwhile
+    normal! ifunction 
+    let l = getline('.')
+    let c = match(l, '\C\m)\%(::\S\+\)\?\%(\s\+where\s\+.*\)\?\s*\zs=\s*')
+    let eqpos = copy(sav_pos)
+    let eqpos[2] = c+1
+    call setpos('.', eqpos)
+    normal! cw
+oend
+    normal %
+    s/\s*$// | noh
+    return
+endfunction
+
+
+let s:nonid_chars = "\U01-\U07" . "\U0E-\U1F" .
+      \             "\"#$'(,.:;=?@`\\U5B{" .
+      \             "\U80-\UA1" . "\UA7\UA8\UAB\UAD\UAF\UB4" . "\UB6-\UB8" . "\UBB\UBF"
+
+let s:nonidS_chars = "[:space:])\\U5D}" . s:nonid_chars
+
+" the following excludes '!' since it can be used as an identifier,
+" and '$' since it can be used in interpolations
+" note that \U2D is '-'
+let s:uniop_chars = "+\\U2D~¬√∛∜"
+
+let s:binop_chars = "=+\\U2D*/\\%÷^&|⊻<>≤≥≡≠≢∈∉⋅×∪∩⊆⊈⊂⊄⊊←→∋∌⊕⊖⊞⊟∘∧⊗⊘↑↓∨⊠±"
+
+" the following is a list of all remainig valid operator chars,
+" but it's more efficient when expressed with ranges (see below)
+" let s:binop_chars_extra = "↔↚↛↠↣↦↮⇎⇏⇒⇔⇴⇶⇷⇸⇹⇺⇻⇼⇽⇾⇿⟵⟶⟷⟷⟹⟺⟻⟼⟽⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤌⤍⤎⤏⤐⤑⤔⤕⤖⤗⤘⤝⤞⤟⤠⥄⥅⥆⥇⥈⥊⥋⥎⥐⥒⥓⥖⥗⥚⥛⥞⥟⥢⥤⥦⥧⥨⥩⥪⥫⥬⥭⥰⧴⬱⬰⬲⬳⬴⬵⬶⬷⬸⬹⬺⬻⬼⬽⬾⬿⭀⭁⭂⭃⭄⭇⭈⭉⭊⭋⭌￩￫" .
+"       \                   "∝∊∍∥∦∷∺∻∽∾≁≃≄≅≆≇≈≉≊≋≌≍≎≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≣≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊃⊅⊇⊉⊋⊏⊐⊑⊒⊜⊩⊬⊮⊰⊱⊲⊳⊴⊵⊶⊷⋍⋐⋑⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⟈⟉⟒⦷⧀⧁⧡⧣⧤⧥⩦⩧⩪⩫⩬⩭⩮⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫷⫸⫹⫺⊢⊣" .
+"       \                   "⊔∓∔∸≂≏⊎⊽⋎⋓⧺⧻⨈⨢⨣⨤⨥⨦⨧⨨⨩⨪⨫⨬⨭⨮⨹⨺⩁⩂⩅⩊⩌⩏⩐⩒⩔⩖⩗⩛⩝⩡⩢⩣" .
+"       \                   "⊙⊚⊛⊡⊓∗∙∤⅋≀⊼⋄⋆⋇⋉⋊⋋⋌⋏⋒⟑⦸⦼⦾⦿⧶⧷⨇⨰⨱⨲⨳⨴⨵⨶⨷⨸⨻⨼⨽⩀⩃⩄⩋⩍⩎⩑⩓⩕⩘⩚⩜⩞⩟⩠⫛⊍▷⨝⟕⟖⟗" .
+"       \                   "⇵⟰⟱⤈⤉⤊⤋⤒⤓⥉⥌⥍⥏⥑⥔⥕⥘⥙⥜⥝⥠⥡⥣⥥⥮⥯￪￬"
+
+" same as above, but with character ranges, for performance
+let s:binop_chars_extra = "\\U214B\\U2190-\\U2194\\U219A\\U219B\\U21A0\\U21A3\\U21A6\\U21AE\\U21CE\\U21CF\\U21D2\\U21D4\\U21F4-\\U21FF\\U2208-\\U220D\\U2213\\U2214\\U2217-\\U2219\\U221D\\U2224-\\U222A\\U2237\\U2238\\U223A\\U223B\\U223D\\U223E\\U2240-\\U228B\\U228D-\\U229C\\U229E-\\U22A3\\U22A9\\U22AC\\U22AE\\U22B0-\\U22B7\\U22BB-\\U22BD\\U22C4-\\U22C7\\U22C9-\\U22D3\\U22D5-\\U22ED\\U22F2-\\U22FF\\U25B7\\U27C8\\U27C9\\U27D1\\U27D2\\U27D5-\\U27D7\\U27F0\\U27F1\\U27F5-\\U27F7\\U27F7\\U27F9-\\U27FF\\U2900-\\U2918\\U291D-\\U2920\\U2944-\\U2970\\U29B7\\U29B8\\U29BC\\U29BE-\\U29C1\\U29E1\\U29E3-\\U29E5\\U29F4\\U29F6\\U29F7\\U29FA\\U29FB\\U2A07\\U2A08\\U2A1D\\U2A22-\\U2A2E\\U2A30-\\U2A3D\\U2A40-\\U2A45\\U2A4A-\\U2A58\\U2A5A-\\U2A63\\U2A66\\U2A67\\U2A6A-\\U2AD9\\U2ADB\\U2AF7-\\U2AFA\\U2B30-\\U2B44\\U2B47-\\U2B4C\\UFFE9-\\UFFEC"
+
+" a Julia identifier, sort of
+let s:idregex = '[^' . s:nonidS_chars . '0-9!' . s:uniop_chars . s:binop_chars . '][^' . s:nonidS_chars . s:uniop_chars . s:binop_chars . s:binop_chars_extra . ']*'
+
+let s:operators = '\%(' . '\.\%([-+*/^÷%|&!]\|//\|\\\|<<\|>>>\?\)\?=' .
+      \           '\|'  . '[:$<>]=\|||\|&&\||>\|<|\|<:\|:>\|::\|<<\|>>>\?\|//\|[-=]>\|\.\{3\}' .
+      \           '\|'  . '[' . s:uniop_chars . '!$]' .
+      \           '\|'  . '\.\?[' . s:binop_chars . s:binop_chars_extra . ']' .
+      \           '\)'
+
+function! julia#idundercursor()
+    " TODO...
+    let w = expand('<cword>')
+    " let [l,c] = [line('.'),col('.')]
+    " let ll = getline(l)
+    return w
+endfunction
+
+function! julia#gotodefinition()
+    let w = julia#idundercursor()
+    if empty(w)
+        return ''
+    endif
+    let [l,c] = [line('.'),col('.')]
+    let st = map(synstack(l,c), 'synIDattr(v:val, "name")')
+    let n = len(st)
+    if n > 0 && st[-1] =~# '^julia\%(\%(Range\|Ternary\|CTrans\)\?Operator\|\%(Possible\)\?SymbolS\?\|\%(Bl\|Rep\)\?Keyword\|Conditional\|ParDelim\|Char\|Colon\|Typedef\|Number\|Float\|Const\%(Generic\|Bool\)\|ComplexUnit\|\%(Special\|\%(Octal\|Hex\)Escape\)Char\|UniChar\%(Small\|Large\)\|Comment[LM]\|Todo\|Semicolon\)$'
+        return ''
+    endif
+
+    let comprehension = 0
+    let indollar = 0
+    for i in range(n-1, 0, -1)
+        if st[i] =~# '^juliaDollar\%(Var\|Par\|SqBra\)$'
+            let indollar = 1
+        endif
+        if !indollar && st[i] =~# '^julia\%(\a*String\|QuotedParBlockS\?\)$'
+            return ''
+        endif
+        if st[i] =~# '^julia\%(ParBlock\%(InRange\)\?\|SqBraBlock\|\%(Dollar\|StringVars\)\%(Par\|SqBra\)\)$'
+            let comprehension = 1
+        endif
+    endfor
+
+    let s1 = search('\C\<' . w . '\s*=[^=]', 'bcWzs')
+
+    return
+endfunction
+
+endif
Index: /issm/trunk/externalpackages/vim/addons/vim/autoload/julia/doc.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/autoload/julia/doc.vim	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/autoload/julia/doc.vim	(revision 26744)
@@ -0,0 +1,242 @@
+" path to the julia binary to communicate with
+if has('win32') || has('win64')
+  if exists('g:julia#doc#juliapath')
+    " use assigned g:julia#doc#juliapath
+  elseif executable('julia')
+    " use julia command in PATH
+    let g:julia#doc#juliapath = 'julia'
+  else
+    " search julia binary in the default installation paths
+    let pathlist = sort(glob($LOCALAPPDATA . '\Julia-*\bin\julia.exe', 1, 1))
+    let g:julia#doc#juliapath = get(pathlist, -1, 'julia')
+  endif
+else
+  let g:julia#doc#juliapath = get(g:, 'julia#doc#juliapath', 'julia')
+endif
+
+function! s:version() abort
+  let VERSION = {'major': 0, 'minor': 0}
+  if !executable(g:julia#doc#juliapath)
+    return VERSION
+  endif
+
+  let cmd = printf('%s -v', g:julia#doc#juliapath)
+  let output = system(cmd)
+  let versionstr = matchstr(output, '\C^julia version \zs\d\+\.\d\+\ze')
+  let [major, minor] = map(split(versionstr, '\.'), 'str2nr(v:val)')
+  let VERSION.major = major
+  let VERSION.minor = minor
+  return VERSION
+endfunction
+
+let s:VERSION = s:version()
+let s:NODOCPATTERN = '\C\VNo documentation found.'
+
+function! julia#doc#lookup(keyword, ...) abort
+  let juliapath = get(a:000, 0, g:julia#doc#juliapath)
+  let keyword = escape(a:keyword, '"\')
+  let cmd = printf('%s --compile=min --optimize=0 -E "@doc %s"', juliapath, keyword)
+  return systemlist(cmd)
+endfunction
+
+function! julia#doc#open(keyword) abort
+  if empty(a:keyword)
+    call s:warn('Not an appropriate keyword.')
+    return
+  endif
+
+  if !executable(g:julia#doc#juliapath)
+    call s:warn('%s command is not executable', g:julia#doc#juliapath)
+    return
+  endif
+
+  let doc = julia#doc#lookup(a:keyword, g:julia#doc#juliapath)
+  if empty(doc) || match(doc[0], s:NODOCPATTERN) > -1
+    call s:warn('No documentation found for "%s".', a:keyword)
+    return
+  endif
+
+  " workaround for * and ? since a buffername cannot include them
+  let keyword = a:keyword
+  let keyword = substitute(keyword, '\*', ':asterisk:', 'g')
+  let keyword = substitute(keyword, '?', ':question:', 'g')
+  let buffername = printf('juliadoc: %s', keyword)
+
+  call s:write_to_preview_window(doc, "juliadoc", buffername)
+
+  call filter(s:HELPHISTORY, 'v:val isnot# a:keyword')
+  call add(s:HELPHISTORY, a:keyword)
+endfunction
+
+function! s:write_to_preview_window(content, ftype, buffername)
+  " Are we in the preview window from the outset? If not, best to close any
+  " preview windows that might exist.
+  let pvw = &previewwindow
+  if !pvw
+    silent! pclose!
+  endif
+  execute "silent! pedit +setlocal\\ nobuflisted\\ noswapfile\\"
+        \ "buftype=nofile\\ bufhidden=wipe" a:buffername
+  silent! wincmd P
+  if &previewwindow
+    setlocal modifiable noreadonly
+    silent! %delete _
+    call append(0, a:content)
+    silent! $delete _
+    normal! ggj
+    setlocal nomodified readonly nomodifiable
+    execute "setfiletype" a:ftype
+    " Only return to a normal window if we didn't start in a preview window.
+    if !pvw
+      silent! wincmd p
+    endif
+  else
+    " We couldn't make it to the preview window, so as a fallback we dump the
+    " contents in the status area.
+    echo join(a:content, "\n")
+  endif
+endfunction
+
+function! s:warn(...) abort
+  if a:0 == 0
+    return
+  endif
+
+  echohl WarningMsg
+  try
+    if a:0 == 1
+      echo a:1
+    else
+      echo call('printf', a:000)
+    endif
+  finally
+    echohl None
+  endtry
+endfunction
+
+
+
+let s:KEYWORDPATTERN = '\m@\?\h\k*!\?'
+
+" This function is called in normal mode or visual mode.
+function! julia#doc#keywordprg(word) abort
+  if a:word is# ''
+    return
+  endif
+
+  let word = s:unfnameescape(a:word)
+  if word is# expand('<cword>')
+    " 'K' in normal mode
+    " NOTE: Because ! and @ is not in 'iskeyword' option, this func ignore
+    "       the argument to recognize keywords like "@time" and "push!"
+    let view = winsaveview()
+    let lnum = line('.')
+    let tail = searchpos(s:KEYWORDPATTERN, 'ce', lnum)
+    let head = searchpos(s:KEYWORDPATTERN, 'bc', lnum)
+    call winrestview(view)
+    if head == [0, 0] || tail == [0, 0]
+      return
+    else
+      let start = head[1] - 1
+      let end = tail[1] - 1
+      let word = getline(lnum)[start : end]
+    endif
+  endif
+  call julia#doc#open(word)
+endfunction
+
+if exists('+shellslash')
+  let s:ESCAPEDCHARS = " \t\n\"#%'*<?`|"
+else
+  let s:ESCAPEDCHARS = " \t\n*?[{`$\\%#'\"|!<"
+endif
+let s:FNAMEESCAPEPATTERN = '\\\ze[' . escape(s:ESCAPEDCHARS, ']^-\') . ']'
+
+" this function reproduces an original string escaped by fnameescape()
+function! s:unfnameescape(str) abort
+  if a:str is# ''
+    return ''
+  endif
+
+  " NOTE: We cannot determine the original string if a:str starts from '\-',
+  "       '\+' or '\>' because fnameescape('-') ==# fnameescape('\-').
+  if a:str is# '\-'
+    " Remove escape anyway.
+    return '-'
+  endif
+
+  if a:str =~# '^\\[+>]'
+    let str = a:str[1:]
+  else
+    let str = a:str
+  endif
+  return substitute(str, s:FNAMEESCAPEPATTERN, '', 'g')
+endfunction
+
+
+
+let s:HELPPROMPT = 'help?> '
+let s:HELPHISTORY = []
+
+function! julia#doc#prompt() abort
+  let inputhist = s:savehistory('input')
+  echohl MoreMsg
+  try
+    call s:restorehistory('input', s:HELPHISTORY)
+    let keyword = input(s:HELPPROMPT, '', 'customlist,julia#doc#complete')
+
+    " Clear the last prompt
+    normal! :
+  finally
+    echohl None
+    call s:restorehistory('input', inputhist)
+  endtry
+
+  if empty(keyword)
+    return
+  endif
+
+  call julia#doc#open(keyword)
+endfunction
+
+function! s:savehistory(name) abort
+  if histnr(a:name) == -1
+    return []
+  endif
+
+  let history = []
+  for i in range(1, histnr(a:name))
+    let item = histget(a:name, i)
+    if !empty(item)
+      call add(history, item)
+    endif
+  endfor
+  return history
+endfunction
+
+function! s:restorehistory(name, history) abort
+  call histdel(a:name)
+  for item in a:history
+    call histadd(a:name, item)
+  endfor
+endfunction
+
+
+
+if s:VERSION.major == 0 && s:VERSION.minor <= 6
+  let s:REPL_SEARCH = 'Base.Docs.repl_search'
+else
+  let s:REPL_SEARCH = 'import REPL.repl_search; repl_search'
+endif
+
+function! julia#doc#complete(ArgLead, CmdLine, CursorPos) abort
+  return s:likely(a:ArgLead)
+endfunction
+
+function! s:likely(str) abort
+  " escape twice
+  let str = escape(escape(a:str, '"\'), '"\')
+  let cmd = printf('%s --compile=min --optimize=0 -E "%s(\"%s\")"', g:julia#doc#juliapath, s:REPL_SEARCH, str)
+  let output = systemlist(cmd)
+  return split(matchstr(output[0], '\C^search: \zs.*'))
+endfunction
Index: /issm/trunk/externalpackages/vim/addons/vim/autoload/julia_blocks.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/autoload/julia_blocks.vim	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/autoload/julia_blocks.vim	(revision 26744)
@@ -0,0 +1,794 @@
+" Facilities for moving around Julia blocks (e.g. if/end, function/end etc.)
+" (AKA a collection of horrible hacks)
+
+let s:default_mappings = {
+  \  "moveblock_n" : "]]",
+  \  "moveblock_N" : "][",
+  \  "moveblock_p" : "[[",
+  \  "moveblock_P" : "[]",
+  \
+  \  "move_n" : "]j",
+  \  "move_N" : "]J",
+  \  "move_p" : "[j",
+  \  "move_P" : "[J",
+  \
+  \  "select_a" : "aj",
+  \  "select_i" : "ij",
+  \
+  \  "whereami" : "",
+  \  }
+
+function! s:getmapchars(function)
+  if exists("g:julia_blocks_mappings") && has_key(g:julia_blocks_mappings, a:function)
+    return s:escape(g:julia_blocks_mappings[a:function])
+  else
+    return s:escape(s:default_mappings[a:function])
+  endif
+endfunction
+
+function! s:map_move(function, toend, backwards)
+  let chars = s:getmapchars(a:function)
+  if empty(chars)
+    return
+  endif
+  let fn = "julia_blocks#" . a:function
+  let lhs = "<buffer> <nowait> <silent> " . chars . " "
+  let cnt = ":<C-U>let b:jlblk_count=v:count1"
+  exe "nnoremap " . lhs . cnt
+    \ . " <Bar> call " . fn . "()<CR>"
+  exe "onoremap " . lhs . cnt
+    \ . "<CR><Esc>:call julia_blocks#owrapper_move(v:operator, \"" . fn . "\", " . a:toend . ", " . a:backwards . ")<CR>"
+  exe "xnoremap " . lhs . cnt
+    \ . "<CR>gv<Esc>:call julia_blocks#vwrapper_move(\"" . fn . "\")<CR>"
+  let b:jlblk_mapped[a:function] = 1
+endfunction
+
+function! julia_blocks#owrapper_move(oper, function, toend, backwards)
+  let F = function(a:function)
+
+  let save_redraw = &lazyredraw
+  let save_select = &selection
+
+  let restore_cmds = "\<Esc>"
+    \ . ":let &l:selection = \"" . save_select . "\"\<CR>"
+    \ . ":let &l:lazyredraw = " . save_redraw . "\<CR>"
+    \ . ":\<BS>"
+
+  setlocal lazyredraw
+
+  let start_pos = getpos('.')
+  let b:jlblk_abort_calls_esc = 0
+  call F()
+  let b:jlblk_abort_calls_esc = 1
+  let end_pos = getpos('.')
+  if start_pos == end_pos
+    call feedkeys(restore_cmds, 'n')
+  endif
+
+  let &l:selection = "inclusive"
+  if a:backwards || !a:toend
+    let &l:selection = "exclusive"
+  endif
+  if a:toend && a:backwards
+    let end_pos[2] += 1
+  endif
+
+  if s:compare_pos(start_pos, end_pos) > 0
+    let [start_pos, end_pos] = [end_pos, start_pos]
+  endif
+
+  call setpos("'<", start_pos)
+  call setpos("'>", end_pos)
+
+  " NOTE: the 'c' operator behaves differently, for mysterious reasons. We
+  "       simulate it with 'd' followed by 'i' instead
+  call feedkeys("gv" . (a:oper == "c" ? "d" : a:oper) . restore_cmds . (a:oper == "c" ? "i" : ""), 'n')
+endfunction
+
+function! julia_blocks#vwrapper_move(function)
+  let F = function(a:function)
+
+  let s = getpos('.')
+  let b1 = getpos("'<")
+  let b2 = getpos("'>")
+
+  let b = b1 == s ? b2 : b1
+  call setpos('.', s)
+  let b:jlblk_abort_calls_esc = 0
+  call F()
+  let b:jlblk_abort_calls_esc = 1
+  let e = getpos('.')
+  call setpos('.', b)
+  exe "normal " . visualmode()
+  call setpos('.', e)
+endfunction
+
+function! s:unmap(function)
+  if !get(b:jlblk_mapped, a:function, 0)
+    return
+  endif
+  let chars = s:getmapchars(a:function)
+  if empty(chars)
+    " shouldn't happen
+    return
+  endif
+  let mapids = a:function =~# "^move" ? ["n", "x", "o"] :
+	\      a:function =~# "^select" ? ["x", "o"] :
+	\      ["n"]
+  let fn = "julia_blocks#" . a:function
+  let cmd = "<buffer> " . chars
+  for m in mapids
+    exe m . "unmap " . cmd
+  endfor
+  let b:jlblk_mapped[a:function] = 0
+endfunction
+
+function! s:escape(chars)
+  let c = a:chars
+  let c = substitute(c, '|', '<Bar>', 'g')
+  return c
+endfunction
+
+function! s:map_select(function)
+  let chars = s:getmapchars(a:function)
+  if empty(chars)
+    return
+  endif
+  let fn = "julia_blocks#" . a:function
+  let lhs = "<buffer> <nowait> <silent> " . chars . " "
+  let cnt = ":<C-U>let b:jlblk_inwrapper=1<CR>:let b:jlblk_count=max([v:prevcount,1])<CR>"
+  exe "onoremap " . lhs . "<Esc>" . cnt
+    \ . ":call julia_blocks#owrapper_select(v:operator, \"" . fn . "\")<CR>"
+  exe "xnoremap " . lhs . cnt
+    \ . ":call julia_blocks#vwrapper_select(\"" . fn . "\")<CR>"
+  let b:jlblk_mapped[a:function] = 1
+endfunction
+
+function! julia_blocks#owrapper_select(oper, function) ", toend, backwards)
+  let F = function(a:function)
+
+  let save_redraw = &lazyredraw
+  let save_select = &selection
+
+  let restore_cmds = "\<Esc>"
+    \ . ":let &l:selection = \"" . save_select . "\"\<CR>"
+    \ . ":let &l:lazyredraw = " . save_redraw . "\<CR>"
+    \ . ":\<BS>"
+
+  setlocal lazyredraw
+
+  let b:jlblk_abort_calls_esc = 0
+  let retF = F()
+  let b:jlblk_abort_calls_esc = 1
+  if empty(retF)
+    let b:jlblk_inwrapper = 0
+    call feedkeys(restore_cmds, 'n')
+    return
+  end
+  let [start_pos, end_pos] = retF
+
+  if start_pos == end_pos
+    call feedkeys(restore_cmds, 'n')
+  endif
+
+  let &l:selection = "inclusive"
+
+  call setpos("'<", start_pos)
+  call setpos("'>", end_pos)
+
+  let b:jlblk_inwrapper = 0
+  " NOTE: the 'c' operator behaves differently, for mysterious reasons. We
+  "       simulate it with 'd' followed by 'i' instead
+  call feedkeys("gv" . (a:oper == "c" ? "d" : a:oper) . restore_cmds . (a:oper == "c" ? "i" : ""), 'n')
+endfunction
+
+function! julia_blocks#vwrapper_select(function)
+  let F = function(a:function)
+
+  let b:jlblk_abort_calls_esc = 0
+  let retF = F()
+  let b:jlblk_abort_calls_esc = 1
+  if empty(retF)
+    let b:jlblk_inwrapper = 0
+    return
+  end
+  let [start_pos, end_pos] = retF
+  call setpos("'<", start_pos)
+  call setpos("'>", end_pos)
+  normal! gv
+  let b:jlblk_inwrapper = 0
+endfunction
+
+function! s:map_aux(function)
+  let chars = s:getmapchars(a:function)
+  if empty(chars)
+    return
+  endif
+  let fn = "julia_blocks#" . a:function
+  let lhs = "<buffer> <nowait> <silent> " . chars . " "
+  exe "nnoremap " . lhs . ":<C-U>echo " . fn . "()<CR>"
+  let b:jlblk_mapped[a:function] = 1
+endfunction
+
+let s:julia_blocks_functions = {
+      \  "moveblock_N": [1, 0],
+      \  "moveblock_n": [0, 0],
+      \  "moveblock_p": [0, 1],
+      \  "moveblock_P": [1, 1],
+      \
+      \  "move_N": [1, 0],
+      \  "move_n": [0, 0],
+      \  "move_p": [0, 1],
+      \  "move_P": [1, 1],
+      \
+      \  "select_a": [],
+      \  "select_i": [],
+      \
+      \  "whereami": [],
+      \  }
+
+function! julia_blocks#init_mappings()
+  let b:jlblk_mapped = {}
+  for f in keys(s:julia_blocks_functions)
+    if f =~# "^move"
+      let [te, bw] = s:julia_blocks_functions[f]
+      call s:map_move(f, te, bw)
+    elseif f =~# "^select"
+      call s:map_select(f)
+    else
+      call s:map_aux(f)
+    endif
+  endfor
+  call julia_blocks#select_reset()
+  augroup JuliaBlocks
+    au!
+    au InsertEnter <buffer> call julia_blocks#select_reset()
+    au CursorMoved <buffer> call s:cursor_moved()
+  augroup END
+
+  " we would need some autocmd event associated with exiting from
+  " visual mode, but there isn't any, so we resort to this crude
+  " hack
+  " ACTUALLY this creates more problems than it solves, so the crude hack
+  " is just disabled
+  "vnoremap <buffer><silent><unique> <Esc> <Esc>:call julia_blocks#select_reset()<CR>
+endfunction
+
+function! julia_blocks#remove_mappings()
+  if exists("b:jlblk_mapped")
+    for f in keys(s:julia_blocks_functions)
+      call s:unmap(f)
+    endfor
+  endif
+  unlet! b:jlblk_save_pos b:jlblk_view b:jlblk_count b:jlblk_abort_calls_esc
+  unlet! b:jlblk_inwrapper b:jlblk_did_select b:jlblk_doing_select
+  unlet! b:jlblk_last_start_pos b:jlblk_last_end_pos b:jlblk_last_mode
+  augroup JuliaBlocks
+    au!
+  augroup END
+  augroup! JuliaBlocks
+  let md = maparg("<Esc>", "x", 0, 1)
+  if !empty(md) && md["buffer"]
+    vunmap <buffer> <Esc>
+  endif
+endfunction
+
+function! s:restore_view()
+  "redraw! " would ensure correct behaviour, but is annoying
+  let pos = getpos('.')
+  if pos == b:jlblk_save_pos
+    call winrestview(b:jlblk_view)
+    return
+  endif
+  let oldtopline = b:jlblk_view["topline"]
+  let newtopline = winsaveview()["topline"]
+  let l = pos[1]
+  if l >= oldtopline + &l:scrolloff && l <= oldtopline + winheight(0) - 1 - &l:scrolloff
+    if newtopline > oldtopline
+      exe ":normal! " . (newtopline - oldtopline) . "\<C-Y>"
+    elseif newtopline < oldtopline
+      exe ":normal! " . (oldtopline - newtopline) . "\<C-E>"
+    endif
+  " these reduce the scrolling to the minimum (which is maybe not
+  " standard ViM behaviour?)
+  elseif newtopline < oldtopline && (l - newtopline - &l:scrolloff) > 0
+    exe ":normal! " . (l - newtopline - &l:scrolloff) . "\<C-E>"
+  elseif newtopline > oldtopline && (newtopline + &l:scrolloff - l) > 0
+    exe ":normal! " . (l - newtopline - &l:scrolloff) . "\<C-E>"
+  endif
+  call setpos('.', pos) " make sure we didn't screw up
+                        " (since winsaveview may not be up to date)
+endfunction
+
+function! s:abort()
+  call setpos('.', b:jlblk_save_pos)
+  call s:restore_view()
+  if get(b:, "jlblk_abort_calls_esc", 1)
+    call feedkeys("\<Esc>", 'n')
+  endif
+  return 0
+endfunction
+
+function! s:set_mark_tick(...)
+  " This could be a one-liner:
+  "   call setpos("''", b:jlblk_save_pos)
+  " but we want to append to the jumplist,
+  " which setpos doesn't do
+  let p = getpos('.')
+  call setpos('.', b:jlblk_save_pos)
+  normal! m'
+  call setpos('.', p)
+endfunction
+
+function! s:get_save_pos(...)
+  if !exists("b:jlblk_save_pos") || (a:0 == 0) || (a:0 > 0 && a:1)
+    let b:jlblk_save_pos = getpos('.')
+  endif
+  let b:jlblk_view = winsaveview()
+endfunction
+
+function! s:on_end()
+  return getline('.')[col('.')-1] =~# '\k' && expand("<cword>") =~# b:julia_end_keywords
+endfunction
+
+function! s:on_begin()
+  let [l,c] = [line('.'), col('.')]
+  normal! ^
+  let patt = '\%<'.(c+1).'c\(' . b:julia_begin_keywordsm . '\)\%>'.(c-1).'c'
+  let n = search(patt, 'Wnc', l)
+  call cursor(l, c)
+  return n > 0
+endfunction
+
+function! s:matchit()
+  let lkj = exists(":lockjumps") == 2 ? "lockjumps " : ""
+  exe lkj . "normal %"
+endfunction
+
+function! s:move_before_begin()
+  call search(b:julia_begin_keywordsm, 'Wbc')
+  normal! h
+endfunction
+
+function! s:cycle_until_end()
+  let pos = getpos('.')
+  while !s:on_end()
+    call s:matchit()
+    let c = 0
+    if getpos('.') == pos || c > 1000
+      " shouldn't happen, but let's avoid infinite loops anyway
+      return 0
+    endif
+    let c += 1
+  endwhile
+  return 1
+endfunction
+
+function! s:moveto_block_delim(toend, backwards, ...)
+  let pattern = a:toend ? b:julia_end_keywords : b:julia_begin_keywordsm
+  let flags = a:backwards ? 'Wb' : 'W'
+  let cnt = a:0 > 0 ? a:1 : b:jlblk_count
+  if !a:toend && a:backwards && s:on_begin()
+    call s:move_before_begin()
+  endif
+  let ret = 0
+  for c in range(cnt)
+    if a:toend && a:backwards && s:on_end()
+      normal! l
+      normal! bh
+    endif
+    while 1
+      let searchret = search(pattern, flags)
+      if !searchret
+	return ret
+      endif
+      exe "let skip = " . b:match_skip
+      if !skip
+	let ret = 1
+	break
+      endif
+    endwhile
+  endfor
+  return ret
+endfunction
+
+function! s:compare_pos(pos1, pos2)
+  if a:pos1[1] < a:pos2[1]
+    return -1
+  elseif a:pos1[1] > a:pos2[1]
+    return 1
+  elseif a:pos1[2] < a:pos2[2]
+    return -1
+  elseif a:pos1[2] > a:pos2[2]
+    return 1
+  else
+    return 0
+  endif
+endfunction
+
+function! julia_blocks#move_N()
+  call s:get_save_pos()
+
+  let ret = s:moveto_block_delim(1, 0)
+  if !ret
+    return s:abort()
+  endif
+
+  normal! e
+  call s:set_mark_tick()
+
+  return 1
+endfunction
+
+function! julia_blocks#move_n()
+  call s:get_save_pos()
+
+  let ret = s:moveto_block_delim(0, 0)
+  if !ret
+    return s:abort()
+  endif
+
+  call s:set_mark_tick()
+
+  return 1
+endfunction
+
+function! julia_blocks#move_p()
+  call s:get_save_pos()
+
+  let ret = s:moveto_block_delim(0, 1)
+  if !ret
+    return s:abort()
+  endif
+
+  call s:set_mark_tick()
+
+  return 1
+endfunction
+
+function! julia_blocks#move_P()
+  call s:get_save_pos()
+
+  let ret = s:moveto_block_delim(1, 1)
+  if !ret
+    return s:abort()
+  endif
+
+  normal! e
+  call s:set_mark_tick()
+
+  return 1
+endfunction
+
+function! s:moveto_currentblock_end()
+  let flags = 'W'
+  if s:on_end()
+    let flags .= 'c'
+    " NOTE: using "normal! lb" fails at the end of the file (?!)
+    normal! l
+    normal! b
+  endif
+
+  let ret = searchpair(b:julia_begin_keywordsm, '', b:julia_end_keywords, flags, b:match_skip)
+  if ret <= 0
+    return s:abort()
+  endif
+
+  normal! e
+  return 1
+endfunction
+
+function! julia_blocks#moveblock_N()
+  call s:get_save_pos()
+
+  let ret = 0
+  for c in range(b:jlblk_count)
+    let last_seen_pos = getpos('.')
+    if s:on_end()
+      normal! hel
+      let save_pos = getpos('.')
+      let ret_start = s:moveto_block_delim(0, 0, 1)
+      let start1_pos = ret_start ? getpos('.') : [0,0,0,0]
+      call setpos('.', save_pos)
+      if s:on_end()
+	normal! h
+      endif
+      let ret_end = s:moveto_block_delim(1, 0, 1)
+      let end1_pos = ret_end ? getpos('.')  : [0,0,0,0]
+
+      if ret_start && (!ret_end || s:compare_pos(start1_pos, end1_pos) < 0)
+	call setpos('.', start1_pos)
+      else
+	call setpos('.', save_pos)
+      endif
+    endif
+
+    let moveret = s:moveto_currentblock_end()
+    if !moveret && c == 0
+      let moveret = s:moveto_block_delim(0, 0, 1) && s:cycle_until_end()
+      if moveret
+        normal! e
+      endif
+    endif
+    if !moveret
+      call setpos('.', last_seen_pos)
+      break
+    endif
+
+    let ret = 1
+  endfor
+  if !ret
+    return s:abort()
+  endif
+
+  call s:set_mark_tick()
+
+  return 1
+endfunction
+
+function! julia_blocks#moveblock_n()
+  call s:get_save_pos()
+
+  let ret = 0
+  for c in range(b:jlblk_count)
+    let last_seen_pos = getpos('.')
+
+    call s:moveto_currentblock_end()
+    if s:moveto_block_delim(0, 0, 1)
+      let ret = 1
+    else
+      call setpos('.', last_seen_pos)
+      break
+    endif
+  endfor
+
+  if !ret
+    return s:abort()
+  endif
+
+  call s:set_mark_tick()
+
+  return 1
+endfunction
+
+function! julia_blocks#moveblock_p()
+  call s:get_save_pos()
+
+  let ret = 0
+  for c in range(b:jlblk_count)
+    let last_seen_pos = getpos('.')
+    if s:on_begin()
+      call s:move_before_begin()
+      if s:on_end()
+	normal! l
+      endif
+      let save_pos = getpos('.')
+      let ret_start = s:moveto_block_delim(0, 1, 1)
+      let start1_pos = ret_start ? getpos('.') : [0,0,0,0]
+      call setpos('.', save_pos)
+      let ret_end = s:moveto_block_delim(1, 1, 1)
+      let end1_pos = ret_end ? getpos('.') : [0,0,0,0]
+
+      if ret_end && (!ret_start || s:compare_pos(start1_pos, end1_pos) < 0)
+	call setpos('.', end1_pos)
+      else
+	call setpos('.', save_pos)
+      endif
+    endif
+
+    let moveret = s:moveto_currentblock_end()
+    if !moveret && c == 0
+      let moveret = s:moveto_block_delim(1, 1, 1)
+    endif
+    if !moveret
+      call setpos('.', last_seen_pos)
+      break
+    endif
+
+    call s:matchit()
+    let ret = 1
+  endfor
+  if !ret
+    return s:abort()
+  endif
+
+  call s:set_mark_tick()
+  call s:restore_view()
+
+  return 1
+endfunction
+
+function! julia_blocks#moveblock_P()
+  call s:get_save_pos()
+
+  let ret = 0
+  for c in range(b:jlblk_count)
+    let last_seen_pos = getpos('.')
+
+    call s:moveto_currentblock_end()
+    if s:on_end()
+      call s:matchit()
+    endif
+
+    if s:moveto_block_delim(1, 1, 1)
+      " NOTE: normal! he does not work unless &whichwrap inlcudes h
+      normal! h
+      normal! e
+      let ret = 1
+    else
+      call setpos('.', last_seen_pos)
+    endif
+  endfor
+
+  if !ret
+    return s:abort()
+  endif
+
+  call s:set_mark_tick()
+  call s:restore_view()
+
+  return 1
+endfunction
+
+function! julia_blocks#whereami()
+  let b:jlblk_count = v:count1
+  let save_redraw = &lazyredraw
+  setlocal lazyredraw
+  let pos = getpos('.')
+  let ret = julia_blocks#select_a('w')
+  if empty(ret)
+    call setpos('.', pos)
+    let &l:lazyredraw = save_redraw
+    return ""
+  end
+  let [start_pos, end_pos] = ret
+  let m = getline(start_pos[1])[start_pos[2]-1:]
+
+  " If cursor_moved was not forced from select_a, we force it now
+  " (TODO: this is *really* ugly)
+  if end_pos != pos
+    call s:cursor_moved(1)
+  endif
+  call setpos('.', pos)
+  call s:restore_view()
+  let &l:lazyredraw = save_redraw
+  return m
+endfunction
+
+" Block text objects
+
+function! s:find_block(current_mode)
+
+  let flags = 'W'
+
+  if b:jlblk_did_select
+    call setpos('.', b:jlblk_last_start_pos)
+    if !s:cycle_until_end()
+      return s:abort()
+    endif
+    if !(a:current_mode[0] == 'a' && a:current_mode == b:jlblk_last_mode)
+      let flags .= 'c'
+    endif
+  elseif s:on_end()
+    let flags .= 'c'
+    " NOTE: using "normal! lb" fails at the end of the file (?!)
+    normal! l
+    normal! b
+  endif
+  let searchret = searchpair(b:julia_begin_keywordsm, '', b:julia_end_keywords, flags, b:match_skip)
+  if searchret <= 0
+    if !b:jlblk_did_select
+      return s:abort()
+    else
+     call setpos('.', b:jlblk_last_end_pos)
+    endif
+  endif
+
+  let end_pos = getpos('.')
+  " Jump to match
+  call s:matchit()
+  let start_pos = getpos('.')
+
+  let b:jlblk_last_start_pos = copy(start_pos)
+  let b:jlblk_last_end_pos = copy(end_pos)
+
+  return [start_pos, end_pos]
+endfunction
+
+function! s:repeated_find(ai_mode)
+  let repeat = b:jlblk_count + (a:ai_mode == 'i' && v:count1 > 1 ? 1 : 0)
+  for c in range(repeat)
+    let current_mode = (c < repeat - 1 ? 'a' : a:ai_mode)
+    let ret_find_block = s:find_block(current_mode)
+    if empty(ret_find_block)
+      return 0
+    endif
+    let [start_pos, end_pos] = ret_find_block
+    call setpos('.', end_pos)
+    let b:jlblk_last_mode = current_mode
+    if c < repeat - 1
+      let b:jlblk_doing_select = 0
+      let b:jlblk_did_select = 1
+    endif
+  endfor
+  return [start_pos, end_pos]
+endfunction
+
+function! julia_blocks#select_a(...)
+  let mode_flag = a:0 > 0 ? a:1 : ''
+  call s:get_save_pos(!b:jlblk_did_select)
+  let current_pos = getpos('.')
+  let ret_find_block = s:repeated_find('a' . mode_flag)
+  if empty(ret_find_block)
+    return 0
+  endif
+  let [start_pos, end_pos] = ret_find_block
+
+  call setpos('.', end_pos)
+  normal! e
+  let end_pos = getpos('.')
+
+  let b:jlblk_doing_select = 1
+
+  " CursorMove is only triggered if end_pos
+  " end_pos is different than the staring position;
+  " so when starting from the 'd' in 'end' we need to
+  " force it
+  if current_pos == end_pos
+    call s:cursor_moved(1)
+  endif
+
+  call s:set_mark_tick()
+  return [start_pos, end_pos]
+endfunction
+
+function! julia_blocks#select_i()
+  call s:get_save_pos(!b:jlblk_did_select)
+  let current_pos = getpos('.')
+  let ret_find_block = s:repeated_find('i')
+  if empty(ret_find_block)
+    return 0
+  endif
+  let [start_pos, end_pos] = ret_find_block
+
+  if end_pos[1] <= start_pos[1]+1
+    return s:abort()
+  endif
+
+  call setpos('.', end_pos)
+
+  let b:jlblk_doing_select = 1
+
+  let start_pos[1] += 1
+  call setpos('.', start_pos)
+  normal! ^
+  let start_pos = getpos('.')
+  let end_pos[1] -= 1
+  let end_pos[2] = len(getline(end_pos[1]))
+
+  " CursorMove is only triggered if end_pos
+  " end_pos is different than the staring position;
+  " so when starting from the 'd' in 'end' we need to
+  " force it
+  if current_pos == end_pos
+    call s:cursor_moved(1)
+  endif
+
+  call s:set_mark_tick()
+  return [start_pos, end_pos]
+endfunction
+
+function julia_blocks#select_reset()
+  let b:jlblk_did_select = 0
+  let b:jlblk_doing_select = 0
+  let b:jlblk_inwrapper = 0
+  let b:jlblk_last_mode = ""
+endfunction
+
+function! s:cursor_moved(...)
+  if b:jlblk_inwrapper && !(a:0 > 0 && a:1)
+    return
+  endif
+  let b:jlblk_did_select = b:jlblk_doing_select
+  let b:jlblk_doing_select = 0
+endfunction
Index: /issm/trunk/externalpackages/vim/addons/vim/autoload/julia_latex_symbols.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/autoload/julia_latex_symbols.vim	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/autoload/julia_latex_symbols.vim	(revision 26744)
@@ -0,0 +1,3332 @@
+" This file is autogenerated from the script 'generate_latex_symbols_table.jl'
+" The symbols are based on Julia version 1.5.0-DEV.67
+
+scriptencoding utf-8
+
+function! julia_latex_symbols#get_dict()
+  return {
+    \ '\exclamdown': '¡',
+    \ '\sterling': '£',
+    \ '\yen': '¥',
+    \ '\brokenbar': '¦',
+    \ '\S': '§',
+    \ '\copyright': '©',
+    \ '\:copyright:': '©',
+    \ '\ordfeminine': 'ª',
+    \ '\neg': '¬',
+    \ '\circledR': '®',
+    \ '\:registered:': '®',
+    \ '\highminus': '¯',
+    \ '\degree': '°',
+    \ '\pm': '±',
+    \ '\^2': '²',
+    \ '\^3': '³',
+    \ '\P': '¶',
+    \ '\cdotp': '·',
+    \ '\^1': '¹',
+    \ '\ordmasculine': 'º',
+    \ '\1/4': '¼',
+    \ '\1/2': '½',
+    \ '\3/4': '¾',
+    \ '\questiondown': '¿',
+    \ '\AA': 'Å',
+    \ '\AE': 'Æ',
+    \ '\DH': 'Ð',
+    \ '\times': '×',
+    \ '\O': 'Ø',
+    \ '\TH': 'Þ',
+    \ '\ss': 'ß',
+    \ '\aa': 'å',
+    \ '\ae': 'æ',
+    \ '\eth': 'ð',
+    \ '\dh': 'ð',
+    \ '\div': '÷',
+    \ '\o': 'ø',
+    \ '\th': 'þ',
+    \ '\DJ': 'Đ',
+    \ '\dj': 'đ',
+    \ '\hbar': 'ħ',
+    \ '\imath': 'ı',
+    \ '\L': 'Ł',
+    \ '\l': 'ł',
+    \ '\NG': 'Ŋ',
+    \ '\ng': 'ŋ',
+    \ '\OE': 'Œ',
+    \ '\oe': 'œ',
+    \ '\hvlig': 'ƕ',
+    \ '\nrleg': 'ƞ',
+    \ '\Zbar': 'Ƶ',
+    \ '\doublepipe': 'ǂ',
+    \ '\jmath': 'ȷ',
+    \ '\trna': 'ɐ',
+    \ '\trnsa': 'ɒ',
+    \ '\openo': 'ɔ',
+    \ '\rtld': 'ɖ',
+    \ '\schwa': 'ə',
+    \ '\pgamma': 'ɣ',
+    \ '\pbgam': 'ɤ',
+    \ '\trnh': 'ɥ',
+    \ '\btdl': 'ɬ',
+    \ '\rtll': 'ɭ',
+    \ '\trnm': 'ɯ',
+    \ '\trnmlr': 'ɰ',
+    \ '\ltlmr': 'ɱ',
+    \ '\ltln': 'ɲ',
+    \ '\rtln': 'ɳ',
+    \ '\clomeg': 'ɷ',
+    \ '\ltphi': 'ɸ',
+    \ '\trnr': 'ɹ',
+    \ '\trnrl': 'ɺ',
+    \ '\rttrnr': 'ɻ',
+    \ '\rl': 'ɼ',
+    \ '\rtlr': 'ɽ',
+    \ '\fhr': 'ɾ',
+    \ '\rtls': 'ʂ',
+    \ '\esh': 'ʃ',
+    \ '\trnt': 'ʇ',
+    \ '\rtlt': 'ʈ',
+    \ '\pupsil': 'ʊ',
+    \ '\pscrv': 'ʋ',
+    \ '\invv': 'ʌ',
+    \ '\invw': 'ʍ',
+    \ '\trny': 'ʎ',
+    \ '\rtlz': 'ʐ',
+    \ '\yogh': 'ʒ',
+    \ '\glst': 'ʔ',
+    \ '\reglst': 'ʕ',
+    \ '\inglst': 'ʖ',
+    \ '\turnk': 'ʞ',
+    \ '\dyogh': 'ʤ',
+    \ '\tesh': 'ʧ',
+    \ '\^h': 'ʰ',
+    \ '\^j': 'ʲ',
+    \ '\^r': 'ʳ',
+    \ '\^w': 'ʷ',
+    \ '\^y': 'ʸ',
+    \ '\rasp': 'ʼ',
+    \ '\verts': 'ˈ',
+    \ '\verti': 'ˌ',
+    \ '\lmrk': 'ː',
+    \ '\hlmrk': 'ˑ',
+    \ '\sbrhr': '˒',
+    \ '\sblhr': '˓',
+    \ '\rais': '˔',
+    \ '\low': '˕',
+    \ '\u': '˘',
+    \ '\tildelow': '˜',
+    \ '\^l': 'ˡ',
+    \ '\^s': 'ˢ',
+    \ '\^x': 'ˣ',
+    \ '\grave': '̀',
+    \ '\acute': '́',
+    \ '\hat': '̂',
+    \ '\tilde': '̃',
+    \ '\bar': '̄',
+    \ '\overbar': '̅',
+    \ '\breve': '̆',
+    \ '\dot': '̇',
+    \ '\ddot': '̈',
+    \ '\ovhook': '̉',
+    \ '\ocirc': '̊',
+    \ '\H': '̋',
+    \ '\check': '̌',
+    \ '\candra': '̐',
+    \ '\oturnedcomma': '̒',
+    \ '\ocommatopright': '̕',
+    \ '\droang': '̚',
+    \ '\palh': '̡',
+    \ '\rh': '̢',
+    \ '\c': '̧',
+    \ '\k': '̨',
+    \ '\sbbrg': '̪',
+    \ '\wideutilde': '̰',
+    \ '\underbar': '̲',
+    \ '\strike': '̶',
+    \ '\sout': '̶',
+    \ '\not': '̸',
+    \ '\underleftrightarrow': '͍',
+    \ '\Alpha': 'Α',
+    \ '\Beta': 'Β',
+    \ '\Gamma': 'Γ',
+    \ '\Delta': 'Δ',
+    \ '\Epsilon': 'Ε',
+    \ '\Zeta': 'Ζ',
+    \ '\Eta': 'Η',
+    \ '\Theta': 'Θ',
+    \ '\Iota': 'Ι',
+    \ '\Kappa': 'Κ',
+    \ '\Lambda': 'Λ',
+    \ '\upMu': 'Μ',
+    \ '\upNu': 'Ν',
+    \ '\Xi': 'Ξ',
+    \ '\upOmicron': 'Ο',
+    \ '\Pi': 'Π',
+    \ '\Rho': 'Ρ',
+    \ '\Sigma': 'Σ',
+    \ '\Tau': 'Τ',
+    \ '\Upsilon': 'Υ',
+    \ '\Phi': 'Φ',
+    \ '\Chi': 'Χ',
+    \ '\Psi': 'Ψ',
+    \ '\Omega': 'Ω',
+    \ '\alpha': 'α',
+    \ '\beta': 'β',
+    \ '\gamma': 'γ',
+    \ '\delta': 'δ',
+    \ '\upepsilon': 'ε',
+    \ '\varepsilon': 'ε',
+    \ '\zeta': 'ζ',
+    \ '\eta': 'η',
+    \ '\theta': 'θ',
+    \ '\iota': 'ι',
+    \ '\kappa': 'κ',
+    \ '\lambda': 'λ',
+    \ '\mu': 'μ',
+    \ '\nu': 'ν',
+    \ '\xi': 'ξ',
+    \ '\upomicron': 'ο',
+    \ '\pi': 'π',
+    \ '\rho': 'ρ',
+    \ '\varsigma': 'ς',
+    \ '\sigma': 'σ',
+    \ '\tau': 'τ',
+    \ '\upsilon': 'υ',
+    \ '\varphi': 'φ',
+    \ '\chi': 'χ',
+    \ '\psi': 'ψ',
+    \ '\omega': 'ω',
+    \ '\upvarbeta': 'ϐ',
+    \ '\vartheta': 'ϑ',
+    \ '\phi': 'ϕ',
+    \ '\varpi': 'ϖ',
+    \ '\upoldKoppa': 'Ϙ',
+    \ '\upoldkoppa': 'ϙ',
+    \ '\Stigma': 'Ϛ',
+    \ '\upstigma': 'ϛ',
+    \ '\Digamma': 'Ϝ',
+    \ '\digamma': 'ϝ',
+    \ '\Koppa': 'Ϟ',
+    \ '\upkoppa': 'ϟ',
+    \ '\Sampi': 'Ϡ',
+    \ '\upsampi': 'ϡ',
+    \ '\varkappa': 'ϰ',
+    \ '\varrho': 'ϱ',
+    \ '\varTheta': 'ϴ',
+    \ '\epsilon': 'ϵ',
+    \ '\backepsilon': '϶',
+    \ '\^A': 'ᴬ',
+    \ '\^B': 'ᴮ',
+    \ '\^D': 'ᴰ',
+    \ '\^E': 'ᴱ',
+    \ '\^G': 'ᴳ',
+    \ '\^H': 'ᴴ',
+    \ '\^I': 'ᴵ',
+    \ '\^J': 'ᴶ',
+    \ '\^K': 'ᴷ',
+    \ '\^L': 'ᴸ',
+    \ '\^M': 'ᴹ',
+    \ '\^N': 'ᴺ',
+    \ '\^O': 'ᴼ',
+    \ '\^P': 'ᴾ',
+    \ '\^R': 'ᴿ',
+    \ '\^T': 'ᵀ',
+    \ '\^U': 'ᵁ',
+    \ '\^W': 'ᵂ',
+    \ '\^a': 'ᵃ',
+    \ '\^alpha': 'ᵅ',
+    \ '\^b': 'ᵇ',
+    \ '\^d': 'ᵈ',
+    \ '\^e': 'ᵉ',
+    \ '\^epsilon': 'ᵋ',
+    \ '\^g': 'ᵍ',
+    \ '\^k': 'ᵏ',
+    \ '\^m': 'ᵐ',
+    \ '\^o': 'ᵒ',
+    \ '\^p': 'ᵖ',
+    \ '\^t': 'ᵗ',
+    \ '\^u': 'ᵘ',
+    \ '\^v': 'ᵛ',
+    \ '\^beta': 'ᵝ',
+    \ '\^gamma': 'ᵞ',
+    \ '\^delta': 'ᵟ',
+    \ '\^phi': 'ᵠ',
+    \ '\^chi': 'ᵡ',
+    \ '\_i': 'ᵢ',
+    \ '\_r': 'ᵣ',
+    \ '\_u': 'ᵤ',
+    \ '\_v': 'ᵥ',
+    \ '\_beta': 'ᵦ',
+    \ '\_gamma': 'ᵧ',
+    \ '\_rho': 'ᵨ',
+    \ '\_phi': 'ᵩ',
+    \ '\_chi': 'ᵪ',
+    \ '\^c': 'ᶜ',
+    \ '\^f': 'ᶠ',
+    \ '\^iota': 'ᶥ',
+    \ '\^Phi': 'ᶲ',
+    \ '\^z': 'ᶻ',
+    \ '\^theta': 'ᶿ',
+    \ '\enspace': ' ',
+    \ '\quad': ' ',
+    \ '\thickspace': ' ',
+    \ '\thinspace': ' ',
+    \ '\hspace': ' ',
+    \ '\endash': '–',
+    \ '\emdash': '—',
+    \ '\Vert': '‖',
+    \ '\lq': '‘',
+    \ '\rq': '’',
+    \ '\reapos': '‛',
+    \ '\quotedblleft': '“',
+    \ '\quotedblright': '”',
+    \ '\dagger': '†',
+    \ '\ddagger': '‡',
+    \ '\bullet': '•',
+    \ '\dots': '…',
+    \ '\ldots': '…',
+    \ '\perthousand': '‰',
+    \ '\pertenthousand': '‱',
+    \ '\prime': '′',
+    \ '\pprime': '″',
+    \ '\ppprime': '‴',
+    \ '\backprime': '‵',
+    \ '\backpprime': '‶',
+    \ '\backppprime': '‷',
+    \ '\guilsinglleft': '‹',
+    \ '\guilsinglright': '›',
+    \ '\:bangbang:': '‼',
+    \ '\tieconcat': '⁀',
+    \ '\:interrobang:': '⁉',
+    \ '\pppprime': '⁗',
+    \ '\tricolon': '⁝',
+    \ '\nolinebreak': '⁠',
+    \ '\^0': '⁰',
+    \ '\^i': 'ⁱ',
+    \ '\^4': '⁴',
+    \ '\^5': '⁵',
+    \ '\^6': '⁶',
+    \ '\^7': '⁷',
+    \ '\^8': '⁸',
+    \ '\^9': '⁹',
+    \ '\^+': '⁺',
+    \ '\^-': '⁻',
+    \ '\^=': '⁼',
+    \ '\^(': '⁽',
+    \ '\^)': '⁾',
+    \ '\^n': 'ⁿ',
+    \ '\_0': '₀',
+    \ '\_1': '₁',
+    \ '\_2': '₂',
+    \ '\_3': '₃',
+    \ '\_4': '₄',
+    \ '\_5': '₅',
+    \ '\_6': '₆',
+    \ '\_7': '₇',
+    \ '\_8': '₈',
+    \ '\_9': '₉',
+    \ '\_+': '₊',
+    \ '\_-': '₋',
+    \ '\_=': '₌',
+    \ '\_(': '₍',
+    \ '\_)': '₎',
+    \ '\_a': 'ₐ',
+    \ '\_e': 'ₑ',
+    \ '\_o': 'ₒ',
+    \ '\_x': 'ₓ',
+    \ '\_schwa': 'ₔ',
+    \ '\_h': 'ₕ',
+    \ '\_k': 'ₖ',
+    \ '\_l': 'ₗ',
+    \ '\_m': 'ₘ',
+    \ '\_n': 'ₙ',
+    \ '\_p': 'ₚ',
+    \ '\_s': 'ₛ',
+    \ '\_t': 'ₜ',
+    \ '\pes': '₧',
+    \ '\euro': '€',
+    \ '\leftharpoonaccent': '⃐',
+    \ '\rightharpoonaccent': '⃑',
+    \ '\vertoverlay': '⃒',
+    \ '\overleftarrow': '⃖',
+    \ '\vec': '⃗',
+    \ '\dddot': '⃛',
+    \ '\ddddot': '⃜',
+    \ '\enclosecircle': '⃝',
+    \ '\enclosesquare': '⃞',
+    \ '\enclosediamond': '⃟',
+    \ '\overleftrightarrow': '⃡',
+    \ '\enclosetriangle': '⃤',
+    \ '\annuity': '⃧',
+    \ '\threeunderdot': '⃨',
+    \ '\widebridgeabove': '⃩',
+    \ '\underrightharpoondown': '⃬',
+    \ '\underleftharpoondown': '⃭',
+    \ '\underleftarrow': '⃮',
+    \ '\underrightarrow': '⃯',
+    \ '\asteraccent': '⃰',
+    \ '\bbC': 'ℂ',
+    \ '\eulermascheroni': 'ℇ',
+    \ '\scrg': 'ℊ',
+    \ '\scrH': 'ℋ',
+    \ '\frakH': 'ℌ',
+    \ '\bbH': 'ℍ',
+    \ '\planck': 'ℎ',
+    \ '\hslash': 'ℏ',
+    \ '\scrI': 'ℐ',
+    \ '\Im': 'ℑ',
+    \ '\scrL': 'ℒ',
+    \ '\ell': 'ℓ',
+    \ '\bbN': 'ℕ',
+    \ '\numero': '№',
+    \ '\wp': '℘',
+    \ '\bbP': 'ℙ',
+    \ '\bbQ': 'ℚ',
+    \ '\scrR': 'ℛ',
+    \ '\Re': 'ℜ',
+    \ '\bbR': 'ℝ',
+    \ '\xrat': '℞',
+    \ '\trademark': '™',
+    \ '\:tm:': '™',
+    \ '\bbZ': 'ℤ',
+    \ '\ohm': 'Ω',
+    \ '\mho': '℧',
+    \ '\frakZ': 'ℨ',
+    \ '\turnediota': '℩',
+    \ '\Angstrom': 'Å',
+    \ '\scrB': 'ℬ',
+    \ '\frakC': 'ℭ',
+    \ '\scre': 'ℯ',
+    \ '\euler': 'ℯ',
+    \ '\scrE': 'ℰ',
+    \ '\scrF': 'ℱ',
+    \ '\Finv': 'Ⅎ',
+    \ '\scrM': 'ℳ',
+    \ '\scro': 'ℴ',
+    \ '\aleph': 'ℵ',
+    \ '\beth': 'ℶ',
+    \ '\gimel': 'ℷ',
+    \ '\daleth': 'ℸ',
+    \ '\:information_source:': 'ℹ',
+    \ '\bbpi': 'ℼ',
+    \ '\bbgamma': 'ℽ',
+    \ '\bbGamma': 'ℾ',
+    \ '\bbPi': 'ℿ',
+    \ '\bbsum': '⅀',
+    \ '\Game': '⅁',
+    \ '\sansLturned': '⅂',
+    \ '\sansLmirrored': '⅃',
+    \ '\Yup': '⅄',
+    \ '\bbiD': 'ⅅ',
+    \ '\bbid': 'ⅆ',
+    \ '\bbie': 'ⅇ',
+    \ '\bbii': 'ⅈ',
+    \ '\bbij': 'ⅉ',
+    \ '\PropertyLine': '⅊',
+    \ '\upand': '⅋',
+    \ '\1/7': '⅐',
+    \ '\1/9': '⅑',
+    \ '\1/10': '⅒',
+    \ '\1/3': '⅓',
+    \ '\2/3': '⅔',
+    \ '\1/5': '⅕',
+    \ '\2/5': '⅖',
+    \ '\3/5': '⅗',
+    \ '\4/5': '⅘',
+    \ '\1/6': '⅙',
+    \ '\5/6': '⅚',
+    \ '\1/8': '⅛',
+    \ '\3/8': '⅜',
+    \ '\5/8': '⅝',
+    \ '\7/8': '⅞',
+    \ '\1/': '⅟',
+    \ '\0/3': '↉',
+    \ '\leftarrow': '←',
+    \ '\uparrow': '↑',
+    \ '\to': '→',
+    \ '\rightarrow': '→',
+    \ '\downarrow': '↓',
+    \ '\leftrightarrow': '↔',
+    \ '\:left_right_arrow:': '↔',
+    \ '\updownarrow': '↕',
+    \ '\:arrow_up_down:': '↕',
+    \ '\nwarrow': '↖',
+    \ '\:arrow_upper_left:': '↖',
+    \ '\nearrow': '↗',
+    \ '\:arrow_upper_right:': '↗',
+    \ '\searrow': '↘',
+    \ '\:arrow_lower_right:': '↘',
+    \ '\swarrow': '↙',
+    \ '\:arrow_lower_left:': '↙',
+    \ '\nleftarrow': '↚',
+    \ '\nrightarrow': '↛',
+    \ '\leftwavearrow': '↜',
+    \ '\rightwavearrow': '↝',
+    \ '\twoheadleftarrow': '↞',
+    \ '\twoheaduparrow': '↟',
+    \ '\twoheadrightarrow': '↠',
+    \ '\twoheaddownarrow': '↡',
+    \ '\leftarrowtail': '↢',
+    \ '\rightarrowtail': '↣',
+    \ '\mapsfrom': '↤',
+    \ '\mapsup': '↥',
+    \ '\mapsto': '↦',
+    \ '\mapsdown': '↧',
+    \ '\updownarrowbar': '↨',
+    \ '\hookleftarrow': '↩',
+    \ '\:leftwards_arrow_with_hook:': '↩',
+    \ '\hookrightarrow': '↪',
+    \ '\:arrow_right_hook:': '↪',
+    \ '\looparrowleft': '↫',
+    \ '\looparrowright': '↬',
+    \ '\leftrightsquigarrow': '↭',
+    \ '\nleftrightarrow': '↮',
+    \ '\downzigzagarrow': '↯',
+    \ '\Lsh': '↰',
+    \ '\Rsh': '↱',
+    \ '\Ldsh': '↲',
+    \ '\Rdsh': '↳',
+    \ '\linefeed': '↴',
+    \ '\carriagereturn': '↵',
+    \ '\curvearrowleft': '↶',
+    \ '\curvearrowright': '↷',
+    \ '\barovernorthwestarrow': '↸',
+    \ '\barleftarrowrightarrowbar': '↹',
+    \ '\circlearrowleft': '↺',
+    \ '\circlearrowright': '↻',
+    \ '\leftharpoonup': '↼',
+    \ '\leftharpoondown': '↽',
+    \ '\upharpoonright': '↾',
+    \ '\upharpoonleft': '↿',
+    \ '\rightharpoonup': '⇀',
+    \ '\rightharpoondown': '⇁',
+    \ '\downharpoonright': '⇂',
+    \ '\downharpoonleft': '⇃',
+    \ '\rightleftarrows': '⇄',
+    \ '\dblarrowupdown': '⇅',
+    \ '\leftrightarrows': '⇆',
+    \ '\leftleftarrows': '⇇',
+    \ '\upuparrows': '⇈',
+    \ '\rightrightarrows': '⇉',
+    \ '\downdownarrows': '⇊',
+    \ '\leftrightharpoons': '⇋',
+    \ '\rightleftharpoons': '⇌',
+    \ '\nLeftarrow': '⇍',
+    \ '\nLeftrightarrow': '⇎',
+    \ '\nRightarrow': '⇏',
+    \ '\Leftarrow': '⇐',
+    \ '\Uparrow': '⇑',
+    \ '\Rightarrow': '⇒',
+    \ '\Downarrow': '⇓',
+    \ '\Leftrightarrow': '⇔',
+    \ '\Updownarrow': '⇕',
+    \ '\Nwarrow': '⇖',
+    \ '\Nearrow': '⇗',
+    \ '\Searrow': '⇘',
+    \ '\Swarrow': '⇙',
+    \ '\Lleftarrow': '⇚',
+    \ '\Rrightarrow': '⇛',
+    \ '\leftsquigarrow': '⇜',
+    \ '\rightsquigarrow': '⇝',
+    \ '\nHuparrow': '⇞',
+    \ '\nHdownarrow': '⇟',
+    \ '\leftdasharrow': '⇠',
+    \ '\updasharrow': '⇡',
+    \ '\rightdasharrow': '⇢',
+    \ '\downdasharrow': '⇣',
+    \ '\barleftarrow': '⇤',
+    \ '\rightarrowbar': '⇥',
+    \ '\leftwhitearrow': '⇦',
+    \ '\upwhitearrow': '⇧',
+    \ '\rightwhitearrow': '⇨',
+    \ '\downwhitearrow': '⇩',
+    \ '\whitearrowupfrombar': '⇪',
+    \ '\circleonrightarrow': '⇴',
+    \ '\DownArrowUpArrow': '⇵',
+    \ '\rightthreearrows': '⇶',
+    \ '\nvleftarrow': '⇷',
+    \ '\nvrightarrow': '⇸',
+    \ '\nvleftrightarrow': '⇹',
+    \ '\nVleftarrow': '⇺',
+    \ '\nVrightarrow': '⇻',
+    \ '\nVleftrightarrow': '⇼',
+    \ '\leftarrowtriangle': '⇽',
+    \ '\rightarrowtriangle': '⇾',
+    \ '\leftrightarrowtriangle': '⇿',
+    \ '\forall': '∀',
+    \ '\complement': '∁',
+    \ '\partial': '∂',
+    \ '\exists': '∃',
+    \ '\nexists': '∄',
+    \ '\varnothing': '∅',
+    \ '\emptyset': '∅',
+    \ '\increment': '∆',
+    \ '\del': '∇',
+    \ '\nabla': '∇',
+    \ '\in': '∈',
+    \ '\notin': '∉',
+    \ '\smallin': '∊',
+    \ '\ni': '∋',
+    \ '\nni': '∌',
+    \ '\smallni': '∍',
+    \ '\QED': '∎',
+    \ '\prod': '∏',
+    \ '\coprod': '∐',
+    \ '\sum': '∑',
+    \ '\minus': '−',
+    \ '\mp': '∓',
+    \ '\dotplus': '∔',
+    \ '\setminus': '∖',
+    \ '\ast': '∗',
+    \ '\circ': '∘',
+    \ '\vysmblkcircle': '∙',
+    \ '\surd': '√',
+    \ '\sqrt': '√',
+    \ '\cbrt': '∛',
+    \ '\fourthroot': '∜',
+    \ '\propto': '∝',
+    \ '\infty': '∞',
+    \ '\rightangle': '∟',
+    \ '\angle': '∠',
+    \ '\measuredangle': '∡',
+    \ '\sphericalangle': '∢',
+    \ '\mid': '∣',
+    \ '\nmid': '∤',
+    \ '\parallel': '∥',
+    \ '\nparallel': '∦',
+    \ '\wedge': '∧',
+    \ '\vee': '∨',
+    \ '\cap': '∩',
+    \ '\cup': '∪',
+    \ '\int': '∫',
+    \ '\iint': '∬',
+    \ '\iiint': '∭',
+    \ '\oint': '∮',
+    \ '\oiint': '∯',
+    \ '\oiiint': '∰',
+    \ '\clwintegral': '∱',
+    \ '\varointclockwise': '∲',
+    \ '\ointctrclockwise': '∳',
+    \ '\therefore': '∴',
+    \ '\because': '∵',
+    \ '\Colon': '∷',
+    \ '\dotminus': '∸',
+    \ '\dotsminusdots': '∺',
+    \ '\kernelcontraction': '∻',
+    \ '\sim': '∼',
+    \ '\backsim': '∽',
+    \ '\lazysinv': '∾',
+    \ '\sinewave': '∿',
+    \ '\wr': '≀',
+    \ '\nsim': '≁',
+    \ '\eqsim': '≂',
+    \ '\neqsim': '≂̸',
+    \ '\simeq': '≃',
+    \ '\nsime': '≄',
+    \ '\cong': '≅',
+    \ '\approxnotequal': '≆',
+    \ '\ncong': '≇',
+    \ '\approx': '≈',
+    \ '\napprox': '≉',
+    \ '\approxeq': '≊',
+    \ '\tildetrpl': '≋',
+    \ '\allequal': '≌',
+    \ '\asymp': '≍',
+    \ '\Bumpeq': '≎',
+    \ '\nBumpeq': '≎̸',
+    \ '\bumpeq': '≏',
+    \ '\nbumpeq': '≏̸',
+    \ '\doteq': '≐',
+    \ '\Doteq': '≑',
+    \ '\fallingdotseq': '≒',
+    \ '\risingdotseq': '≓',
+    \ '\coloneq': '≔',
+    \ '\eqcolon': '≕',
+    \ '\eqcirc': '≖',
+    \ '\circeq': '≗',
+    \ '\arceq': '≘',
+    \ '\wedgeq': '≙',
+    \ '\veeeq': '≚',
+    \ '\starequal': '≛',
+    \ '\triangleq': '≜',
+    \ '\eqdef': '≝',
+    \ '\measeq': '≞',
+    \ '\questeq': '≟',
+    \ '\ne': '≠',
+    \ '\equiv': '≡',
+    \ '\nequiv': '≢',
+    \ '\Equiv': '≣',
+    \ '\le': '≤',
+    \ '\leq': '≤',
+    \ '\ge': '≥',
+    \ '\geq': '≥',
+    \ '\leqq': '≦',
+    \ '\geqq': '≧',
+    \ '\lneqq': '≨',
+    \ '\lvertneqq': '≨︀',
+    \ '\gneqq': '≩',
+    \ '\gvertneqq': '≩︀',
+    \ '\ll': '≪',
+    \ '\NotLessLess': '≪̸',
+    \ '\gg': '≫',
+    \ '\NotGreaterGreater': '≫̸',
+    \ '\between': '≬',
+    \ '\nasymp': '≭',
+    \ '\nless': '≮',
+    \ '\ngtr': '≯',
+    \ '\nleq': '≰',
+    \ '\ngeq': '≱',
+    \ '\lesssim': '≲',
+    \ '\gtrsim': '≳',
+    \ '\nlesssim': '≴',
+    \ '\ngtrsim': '≵',
+    \ '\lessgtr': '≶',
+    \ '\gtrless': '≷',
+    \ '\notlessgreater': '≸',
+    \ '\notgreaterless': '≹',
+    \ '\prec': '≺',
+    \ '\succ': '≻',
+    \ '\preccurlyeq': '≼',
+    \ '\succcurlyeq': '≽',
+    \ '\precsim': '≾',
+    \ '\nprecsim': '≾̸',
+    \ '\succsim': '≿',
+    \ '\nsuccsim': '≿̸',
+    \ '\nprec': '⊀',
+    \ '\nsucc': '⊁',
+    \ '\subset': '⊂',
+    \ '\supset': '⊃',
+    \ '\nsubset': '⊄',
+    \ '\nsupset': '⊅',
+    \ '\subseteq': '⊆',
+    \ '\supseteq': '⊇',
+    \ '\nsubseteq': '⊈',
+    \ '\nsupseteq': '⊉',
+    \ '\subsetneq': '⊊',
+    \ '\varsubsetneqq': '⊊︀',
+    \ '\supsetneq': '⊋',
+    \ '\varsupsetneq': '⊋︀',
+    \ '\cupdot': '⊍',
+    \ '\uplus': '⊎',
+    \ '\sqsubset': '⊏',
+    \ '\NotSquareSubset': '⊏̸',
+    \ '\sqsupset': '⊐',
+    \ '\NotSquareSuperset': '⊐̸',
+    \ '\sqsubseteq': '⊑',
+    \ '\sqsupseteq': '⊒',
+    \ '\sqcap': '⊓',
+    \ '\sqcup': '⊔',
+    \ '\oplus': '⊕',
+    \ '\ominus': '⊖',
+    \ '\otimes': '⊗',
+    \ '\oslash': '⊘',
+    \ '\odot': '⊙',
+    \ '\circledcirc': '⊚',
+    \ '\circledast': '⊛',
+    \ '\circledequal': '⊜',
+    \ '\circleddash': '⊝',
+    \ '\boxplus': '⊞',
+    \ '\boxminus': '⊟',
+    \ '\boxtimes': '⊠',
+    \ '\boxdot': '⊡',
+    \ '\vdash': '⊢',
+    \ '\dashv': '⊣',
+    \ '\top': '⊤',
+    \ '\bot': '⊥',
+    \ '\models': '⊧',
+    \ '\vDash': '⊨',
+    \ '\Vdash': '⊩',
+    \ '\Vvdash': '⊪',
+    \ '\VDash': '⊫',
+    \ '\nvdash': '⊬',
+    \ '\nvDash': '⊭',
+    \ '\nVdash': '⊮',
+    \ '\nVDash': '⊯',
+    \ '\prurel': '⊰',
+    \ '\scurel': '⊱',
+    \ '\vartriangleleft': '⊲',
+    \ '\vartriangleright': '⊳',
+    \ '\trianglelefteq': '⊴',
+    \ '\trianglerighteq': '⊵',
+    \ '\original': '⊶',
+    \ '\image': '⊷',
+    \ '\multimap': '⊸',
+    \ '\hermitconjmatrix': '⊹',
+    \ '\intercal': '⊺',
+    \ '\veebar': '⊻',
+    \ '\xor': '⊻',
+    \ '\barwedge': '⊼',
+    \ '\barvee': '⊽',
+    \ '\rightanglearc': '⊾',
+    \ '\varlrtriangle': '⊿',
+    \ '\bigwedge': '⋀',
+    \ '\bigvee': '⋁',
+    \ '\bigcap': '⋂',
+    \ '\bigcup': '⋃',
+    \ '\diamond': '⋄',
+    \ '\cdot': '⋅',
+    \ '\star': '⋆',
+    \ '\divideontimes': '⋇',
+    \ '\bowtie': '⋈',
+    \ '\ltimes': '⋉',
+    \ '\rtimes': '⋊',
+    \ '\leftthreetimes': '⋋',
+    \ '\rightthreetimes': '⋌',
+    \ '\backsimeq': '⋍',
+    \ '\curlyvee': '⋎',
+    \ '\curlywedge': '⋏',
+    \ '\Subset': '⋐',
+    \ '\Supset': '⋑',
+    \ '\Cap': '⋒',
+    \ '\Cup': '⋓',
+    \ '\pitchfork': '⋔',
+    \ '\equalparallel': '⋕',
+    \ '\lessdot': '⋖',
+    \ '\gtrdot': '⋗',
+    \ '\verymuchless': '⋘',
+    \ '\ggg': '⋙',
+    \ '\lesseqgtr': '⋚',
+    \ '\gtreqless': '⋛',
+    \ '\eqless': '⋜',
+    \ '\eqgtr': '⋝',
+    \ '\curlyeqprec': '⋞',
+    \ '\curlyeqsucc': '⋟',
+    \ '\npreccurlyeq': '⋠',
+    \ '\nsucccurlyeq': '⋡',
+    \ '\nsqsubseteq': '⋢',
+    \ '\nsqsupseteq': '⋣',
+    \ '\sqsubsetneq': '⋤',
+    \ '\sqspne': '⋥',
+    \ '\lnsim': '⋦',
+    \ '\gnsim': '⋧',
+    \ '\precnsim': '⋨',
+    \ '\succnsim': '⋩',
+    \ '\ntriangleleft': '⋪',
+    \ '\ntriangleright': '⋫',
+    \ '\ntrianglelefteq': '⋬',
+    \ '\ntrianglerighteq': '⋭',
+    \ '\vdots': '⋮',
+    \ '\cdots': '⋯',
+    \ '\adots': '⋰',
+    \ '\ddots': '⋱',
+    \ '\disin': '⋲',
+    \ '\varisins': '⋳',
+    \ '\isins': '⋴',
+    \ '\isindot': '⋵',
+    \ '\varisinobar': '⋶',
+    \ '\isinobar': '⋷',
+    \ '\isinvb': '⋸',
+    \ '\isinE': '⋹',
+    \ '\nisd': '⋺',
+    \ '\varnis': '⋻',
+    \ '\nis': '⋼',
+    \ '\varniobar': '⋽',
+    \ '\niobar': '⋾',
+    \ '\bagmember': '⋿',
+    \ '\diameter': '⌀',
+    \ '\house': '⌂',
+    \ '\varbarwedge': '⌅',
+    \ '\vardoublebarwedge': '⌆',
+    \ '\lceil': '⌈',
+    \ '\rceil': '⌉',
+    \ '\lfloor': '⌊',
+    \ '\rfloor': '⌋',
+    \ '\invnot': '⌐',
+    \ '\sqlozenge': '⌑',
+    \ '\profline': '⌒',
+    \ '\profsurf': '⌓',
+    \ '\recorder': '⌕',
+    \ '\viewdata': '⌗',
+    \ '\turnednot': '⌙',
+    \ '\:watch:': '⌚',
+    \ '\:hourglass:': '⌛',
+    \ '\ulcorner': '⌜',
+    \ '\urcorner': '⌝',
+    \ '\llcorner': '⌞',
+    \ '\lrcorner': '⌟',
+    \ '\frown': '⌢',
+    \ '\smile': '⌣',
+    \ '\varhexagonlrbonds': '⌬',
+    \ '\conictaper': '⌲',
+    \ '\topbot': '⌶',
+    \ '\obar': '⌽',
+    \ '\notslash': '⌿',
+    \ '\notbackslash': '⍀',
+    \ '\boxupcaret': '⍓',
+    \ '\boxquestion': '⍰',
+    \ '\hexagon': '⎔',
+    \ '\dlcorn': '⎣',
+    \ '\lmoustache': '⎰',
+    \ '\rmoustache': '⎱',
+    \ '\overbracket': '⎴',
+    \ '\underbracket': '⎵',
+    \ '\bbrktbrk': '⎶',
+    \ '\sqrtbottom': '⎷',
+    \ '\lvboxline': '⎸',
+    \ '\rvboxline': '⎹',
+    \ '\varcarriagereturn': '⏎',
+    \ '\overbrace': '⏞',
+    \ '\underbrace': '⏟',
+    \ '\trapezium': '⏢',
+    \ '\benzenr': '⏣',
+    \ '\strns': '⏤',
+    \ '\fltns': '⏥',
+    \ '\accurrent': '⏦',
+    \ '\elinters': '⏧',
+    \ '\:fast_forward:': '⏩',
+    \ '\:rewind:': '⏪',
+    \ '\:arrow_double_up:': '⏫',
+    \ '\:arrow_double_down:': '⏬',
+    \ '\:alarm_clock:': '⏰',
+    \ '\:hourglass_flowing_sand:': '⏳',
+    \ '\blanksymbol': '␢',
+    \ '\visiblespace': '␣',
+    \ '\:m:': 'Ⓜ',
+    \ '\circledS': 'Ⓢ',
+    \ '\dshfnc': '┆',
+    \ '\sqfnw': '┙',
+    \ '\diagup': '╱',
+    \ '\diagdown': '╲',
+    \ '\blockuphalf': '▀',
+    \ '\blocklowhalf': '▄',
+    \ '\blockfull': '█',
+    \ '\blocklefthalf': '▌',
+    \ '\blockrighthalf': '▐',
+    \ '\blockqtrshaded': '░',
+    \ '\blockhalfshaded': '▒',
+    \ '\blockthreeqtrshaded': '▓',
+    \ '\blacksquare': '■',
+    \ '\square': '□',
+    \ '\squoval': '▢',
+    \ '\blackinwhitesquare': '▣',
+    \ '\squarehfill': '▤',
+    \ '\squarevfill': '▥',
+    \ '\squarehvfill': '▦',
+    \ '\squarenwsefill': '▧',
+    \ '\squareneswfill': '▨',
+    \ '\squarecrossfill': '▩',
+    \ '\smblksquare': '▪',
+    \ '\:black_small_square:': '▪',
+    \ '\smwhtsquare': '▫',
+    \ '\:white_small_square:': '▫',
+    \ '\hrectangleblack': '▬',
+    \ '\hrectangle': '▭',
+    \ '\vrectangleblack': '▮',
+    \ '\vrecto': '▯',
+    \ '\parallelogramblack': '▰',
+    \ '\parallelogram': '▱',
+    \ '\bigblacktriangleup': '▲',
+    \ '\bigtriangleup': '△',
+    \ '\blacktriangle': '▴',
+    \ '\vartriangle': '▵',
+    \ '\blacktriangleright': '▶',
+    \ '\:arrow_forward:': '▶',
+    \ '\triangleright': '▷',
+    \ '\smallblacktriangleright': '▸',
+    \ '\smalltriangleright': '▹',
+    \ '\blackpointerright': '►',
+    \ '\whitepointerright': '▻',
+    \ '\bigblacktriangledown': '▼',
+    \ '\bigtriangledown': '▽',
+    \ '\blacktriangledown': '▾',
+    \ '\triangledown': '▿',
+    \ '\blacktriangleleft': '◀',
+    \ '\:arrow_backward:': '◀',
+    \ '\triangleleft': '◁',
+    \ '\smallblacktriangleleft': '◂',
+    \ '\smalltriangleleft': '◃',
+    \ '\blackpointerleft': '◄',
+    \ '\whitepointerleft': '◅',
+    \ '\mdlgblkdiamond': '◆',
+    \ '\mdlgwhtdiamond': '◇',
+    \ '\blackinwhitediamond': '◈',
+    \ '\fisheye': '◉',
+    \ '\lozenge': '◊',
+    \ '\bigcirc': '○',
+    \ '\dottedcircle': '◌',
+    \ '\circlevertfill': '◍',
+    \ '\bullseye': '◎',
+    \ '\mdlgblkcircle': '●',
+    \ '\cirfl': '◐',
+    \ '\cirfr': '◑',
+    \ '\cirfb': '◒',
+    \ '\circletophalfblack': '◓',
+    \ '\circleurquadblack': '◔',
+    \ '\blackcircleulquadwhite': '◕',
+    \ '\blacklefthalfcircle': '◖',
+    \ '\blackrighthalfcircle': '◗',
+    \ '\rvbull': '◘',
+    \ '\inversewhitecircle': '◙',
+    \ '\invwhiteupperhalfcircle': '◚',
+    \ '\invwhitelowerhalfcircle': '◛',
+    \ '\ularc': '◜',
+    \ '\urarc': '◝',
+    \ '\lrarc': '◞',
+    \ '\llarc': '◟',
+    \ '\topsemicircle': '◠',
+    \ '\botsemicircle': '◡',
+    \ '\lrblacktriangle': '◢',
+    \ '\llblacktriangle': '◣',
+    \ '\ulblacktriangle': '◤',
+    \ '\urblacktriangle': '◥',
+    \ '\smwhtcircle': '◦',
+    \ '\sqfl': '◧',
+    \ '\sqfr': '◨',
+    \ '\squareulblack': '◩',
+    \ '\sqfse': '◪',
+    \ '\boxbar': '◫',
+    \ '\trianglecdot': '◬',
+    \ '\triangleleftblack': '◭',
+    \ '\trianglerightblack': '◮',
+    \ '\lgwhtcircle': '◯',
+    \ '\squareulquad': '◰',
+    \ '\squarellquad': '◱',
+    \ '\squarelrquad': '◲',
+    \ '\squareurquad': '◳',
+    \ '\circleulquad': '◴',
+    \ '\circlellquad': '◵',
+    \ '\circlelrquad': '◶',
+    \ '\circleurquad': '◷',
+    \ '\ultriangle': '◸',
+    \ '\urtriangle': '◹',
+    \ '\lltriangle': '◺',
+    \ '\mdwhtsquare': '◻',
+    \ '\:white_medium_square:': '◻',
+    \ '\mdblksquare': '◼',
+    \ '\:black_medium_square:': '◼',
+    \ '\mdsmwhtsquare': '◽',
+    \ '\:white_medium_small_square:': '◽',
+    \ '\mdsmblksquare': '◾',
+    \ '\:black_medium_small_square:': '◾',
+    \ '\lrtriangle': '◿',
+    \ '\:sunny:': '☀',
+    \ '\:cloud:': '☁',
+    \ '\bigstar': '★',
+    \ '\bigwhitestar': '☆',
+    \ '\astrosun': '☉',
+    \ '\:phone:': '☎',
+    \ '\:ballot_box_with_check:': '☑',
+    \ '\:umbrella:': '☔',
+    \ '\:coffee:': '☕',
+    \ '\:point_up:': '☝',
+    \ '\danger': '☡',
+    \ '\:relaxed:': '☺',
+    \ '\blacksmiley': '☻',
+    \ '\sun': '☼',
+    \ '\rightmoon': '☽',
+    \ '\leftmoon': '☾',
+    \ '\mercury': '☿',
+    \ '\venus': '♀',
+    \ '\female': '♀',
+    \ '\male': '♂',
+    \ '\mars': '♂',
+    \ '\jupiter': '♃',
+    \ '\saturn': '♄',
+    \ '\uranus': '♅',
+    \ '\neptune': '♆',
+    \ '\pluto': '♇',
+    \ '\aries': '♈',
+    \ '\:aries:': '♈',
+    \ '\taurus': '♉',
+    \ '\:taurus:': '♉',
+    \ '\gemini': '♊',
+    \ '\:gemini:': '♊',
+    \ '\cancer': '♋',
+    \ '\:cancer:': '♋',
+    \ '\leo': '♌',
+    \ '\:leo:': '♌',
+    \ '\virgo': '♍',
+    \ '\:virgo:': '♍',
+    \ '\libra': '♎',
+    \ '\:libra:': '♎',
+    \ '\scorpio': '♏',
+    \ '\:scorpius:': '♏',
+    \ '\sagittarius': '♐',
+    \ '\:sagittarius:': '♐',
+    \ '\capricornus': '♑',
+    \ '\:capricorn:': '♑',
+    \ '\aquarius': '♒',
+    \ '\:aquarius:': '♒',
+    \ '\pisces': '♓',
+    \ '\:pisces:': '♓',
+    \ '\spadesuit': '♠',
+    \ '\:spades:': '♠',
+    \ '\heartsuit': '♡',
+    \ '\diamondsuit': '♢',
+    \ '\clubsuit': '♣',
+    \ '\:clubs:': '♣',
+    \ '\varspadesuit': '♤',
+    \ '\varheartsuit': '♥',
+    \ '\:hearts:': '♥',
+    \ '\vardiamondsuit': '♦',
+    \ '\:diamonds:': '♦',
+    \ '\varclubsuit': '♧',
+    \ '\:hotsprings:': '♨',
+    \ '\quarternote': '♩',
+    \ '\eighthnote': '♪',
+    \ '\twonotes': '♫',
+    \ '\flat': '♭',
+    \ '\natural': '♮',
+    \ '\sharp': '♯',
+    \ '\:recycle:': '♻',
+    \ '\acidfree': '♾',
+    \ '\:wheelchair:': '♿',
+    \ '\dicei': '⚀',
+    \ '\diceii': '⚁',
+    \ '\diceiii': '⚂',
+    \ '\diceiv': '⚃',
+    \ '\dicev': '⚄',
+    \ '\dicevi': '⚅',
+    \ '\circledrightdot': '⚆',
+    \ '\circledtwodots': '⚇',
+    \ '\blackcircledrightdot': '⚈',
+    \ '\blackcircledtwodots': '⚉',
+    \ '\:anchor:': '⚓',
+    \ '\:warning:': '⚠',
+    \ '\:zap:': '⚡',
+    \ '\hermaphrodite': '⚥',
+    \ '\mdwhtcircle': '⚪',
+    \ '\:white_circle:': '⚪',
+    \ '\mdblkcircle': '⚫',
+    \ '\:black_circle:': '⚫',
+    \ '\mdsmwhtcircle': '⚬',
+    \ '\neuter': '⚲',
+    \ '\:soccer:': '⚽',
+    \ '\:baseball:': '⚾',
+    \ '\:snowman:': '⛄',
+    \ '\:partly_sunny:': '⛅',
+    \ '\:ophiuchus:': '⛎',
+    \ '\:no_entry:': '⛔',
+    \ '\:church:': '⛪',
+    \ '\:fountain:': '⛲',
+    \ '\:golf:': '⛳',
+    \ '\:boat:': '⛵',
+    \ '\:tent:': '⛺',
+    \ '\:fuelpump:': '⛽',
+    \ '\:scissors:': '✂',
+    \ '\:white_check_mark:': '✅',
+    \ '\:airplane:': '✈',
+    \ '\:email:': '✉',
+    \ '\:fist:': '✊',
+    \ '\:hand:': '✋',
+    \ '\:v:': '✌',
+    \ '\:pencil2:': '✏',
+    \ '\:black_nib:': '✒',
+    \ '\checkmark': '✓',
+    \ '\:heavy_check_mark:': '✔',
+    \ '\:heavy_multiplication_x:': '✖',
+    \ '\maltese': '✠',
+    \ '\:sparkles:': '✨',
+    \ '\circledstar': '✪',
+    \ '\:eight_spoked_asterisk:': '✳',
+    \ '\:eight_pointed_black_star:': '✴',
+    \ '\varstar': '✶',
+    \ '\dingasterisk': '✽',
+    \ '\:snowflake:': '❄',
+    \ '\:sparkle:': '❇',
+    \ '\:x:': '❌',
+    \ '\:negative_squared_cross_mark:': '❎',
+    \ '\:question:': '❓',
+    \ '\:grey_question:': '❔',
+    \ '\:grey_exclamation:': '❕',
+    \ '\:exclamation:': '❗',
+    \ '\:heart:': '❤',
+    \ '\:heavy_plus_sign:': '➕',
+    \ '\:heavy_minus_sign:': '➖',
+    \ '\:heavy_division_sign:': '➗',
+    \ '\draftingarrow': '➛',
+    \ '\:arrow_right:': '➡',
+    \ '\:curly_loop:': '➰',
+    \ '\:loop:': '➿',
+    \ '\threedangle': '⟀',
+    \ '\whiteinwhitetriangle': '⟁',
+    \ '\perp': '⟂',
+    \ '\bsolhsub': '⟈',
+    \ '\suphsol': '⟉',
+    \ '\wedgedot': '⟑',
+    \ '\upin': '⟒',
+    \ '\leftouterjoin': '⟕',
+    \ '\rightouterjoin': '⟖',
+    \ '\fullouterjoin': '⟗',
+    \ '\bigbot': '⟘',
+    \ '\bigtop': '⟙',
+    \ '\llbracket': '⟦',
+    \ '\openbracketleft': '⟦',
+    \ '\openbracketright': '⟧',
+    \ '\rrbracket': '⟧',
+    \ '\langle': '⟨',
+    \ '\rangle': '⟩',
+    \ '\UUparrow': '⟰',
+    \ '\DDownarrow': '⟱',
+    \ '\longleftarrow': '⟵',
+    \ '\longrightarrow': '⟶',
+    \ '\longleftrightarrow': '⟷',
+    \ '\impliedby': '⟸',
+    \ '\Longleftarrow': '⟸',
+    \ '\implies': '⟹',
+    \ '\Longrightarrow': '⟹',
+    \ '\Longleftrightarrow': '⟺',
+    \ '\iff': '⟺',
+    \ '\longmapsfrom': '⟻',
+    \ '\longmapsto': '⟼',
+    \ '\Longmapsfrom': '⟽',
+    \ '\Longmapsto': '⟾',
+    \ '\longrightsquigarrow': '⟿',
+    \ '\nvtwoheadrightarrow': '⤀',
+    \ '\nVtwoheadrightarrow': '⤁',
+    \ '\nvLeftarrow': '⤂',
+    \ '\nvRightarrow': '⤃',
+    \ '\nvLeftrightarrow': '⤄',
+    \ '\twoheadmapsto': '⤅',
+    \ '\Mapsfrom': '⤆',
+    \ '\Mapsto': '⤇',
+    \ '\downarrowbarred': '⤈',
+    \ '\uparrowbarred': '⤉',
+    \ '\Uuparrow': '⤊',
+    \ '\Ddownarrow': '⤋',
+    \ '\leftbkarrow': '⤌',
+    \ '\bkarow': '⤍',
+    \ '\leftdbkarrow': '⤎',
+    \ '\dbkarow': '⤏',
+    \ '\drbkarrow': '⤐',
+    \ '\rightdotarrow': '⤑',
+    \ '\UpArrowBar': '⤒',
+    \ '\DownArrowBar': '⤓',
+    \ '\nvrightarrowtail': '⤔',
+    \ '\nVrightarrowtail': '⤕',
+    \ '\twoheadrightarrowtail': '⤖',
+    \ '\nvtwoheadrightarrowtail': '⤗',
+    \ '\nVtwoheadrightarrowtail': '⤘',
+    \ '\diamondleftarrow': '⤝',
+    \ '\rightarrowdiamond': '⤞',
+    \ '\diamondleftarrowbar': '⤟',
+    \ '\barrightarrowdiamond': '⤠',
+    \ '\hksearow': '⤥',
+    \ '\hkswarow': '⤦',
+    \ '\tona': '⤧',
+    \ '\toea': '⤨',
+    \ '\tosa': '⤩',
+    \ '\towa': '⤪',
+    \ '\rdiagovfdiag': '⤫',
+    \ '\fdiagovrdiag': '⤬',
+    \ '\seovnearrow': '⤭',
+    \ '\neovsearrow': '⤮',
+    \ '\fdiagovnearrow': '⤯',
+    \ '\rdiagovsearrow': '⤰',
+    \ '\neovnwarrow': '⤱',
+    \ '\nwovnearrow': '⤲',
+    \ '\:arrow_heading_up:': '⤴',
+    \ '\:arrow_heading_down:': '⤵',
+    \ '\Rlarr': '⥂',
+    \ '\rLarr': '⥄',
+    \ '\rightarrowplus': '⥅',
+    \ '\leftarrowplus': '⥆',
+    \ '\rarrx': '⥇',
+    \ '\leftrightarrowcircle': '⥈',
+    \ '\twoheaduparrowcircle': '⥉',
+    \ '\leftrightharpoonupdown': '⥊',
+    \ '\leftrightharpoondownup': '⥋',
+    \ '\updownharpoonrightleft': '⥌',
+    \ '\updownharpoonleftright': '⥍',
+    \ '\LeftRightVector': '⥎',
+    \ '\RightUpDownVector': '⥏',
+    \ '\DownLeftRightVector': '⥐',
+    \ '\LeftUpDownVector': '⥑',
+    \ '\LeftVectorBar': '⥒',
+    \ '\RightVectorBar': '⥓',
+    \ '\RightUpVectorBar': '⥔',
+    \ '\RightDownVectorBar': '⥕',
+    \ '\DownLeftVectorBar': '⥖',
+    \ '\DownRightVectorBar': '⥗',
+    \ '\LeftUpVectorBar': '⥘',
+    \ '\LeftDownVectorBar': '⥙',
+    \ '\LeftTeeVector': '⥚',
+    \ '\RightTeeVector': '⥛',
+    \ '\RightUpTeeVector': '⥜',
+    \ '\RightDownTeeVector': '⥝',
+    \ '\DownLeftTeeVector': '⥞',
+    \ '\DownRightTeeVector': '⥟',
+    \ '\LeftUpTeeVector': '⥠',
+    \ '\LeftDownTeeVector': '⥡',
+    \ '\leftharpoonsupdown': '⥢',
+    \ '\upharpoonsleftright': '⥣',
+    \ '\rightharpoonsupdown': '⥤',
+    \ '\downharpoonsleftright': '⥥',
+    \ '\leftrightharpoonsup': '⥦',
+    \ '\leftrightharpoonsdown': '⥧',
+    \ '\rightleftharpoonsup': '⥨',
+    \ '\rightleftharpoonsdown': '⥩',
+    \ '\leftharpoonupdash': '⥪',
+    \ '\dashleftharpoondown': '⥫',
+    \ '\rightharpoonupdash': '⥬',
+    \ '\dashrightharpoondown': '⥭',
+    \ '\UpEquilibrium': '⥮',
+    \ '\ReverseUpEquilibrium': '⥯',
+    \ '\RoundImplies': '⥰',
+    \ '\Vvert': '⦀',
+    \ '\Elroang': '⦆',
+    \ '\ddfnc': '⦙',
+    \ '\measuredangleleft': '⦛',
+    \ '\Angle': '⦜',
+    \ '\rightanglemdot': '⦝',
+    \ '\angles': '⦞',
+    \ '\angdnr': '⦟',
+    \ '\lpargt': '⦠',
+    \ '\sphericalangleup': '⦡',
+    \ '\turnangle': '⦢',
+    \ '\revangle': '⦣',
+    \ '\angleubar': '⦤',
+    \ '\revangleubar': '⦥',
+    \ '\wideangledown': '⦦',
+    \ '\wideangleup': '⦧',
+    \ '\measanglerutone': '⦨',
+    \ '\measanglelutonw': '⦩',
+    \ '\measanglerdtose': '⦪',
+    \ '\measangleldtosw': '⦫',
+    \ '\measangleurtone': '⦬',
+    \ '\measangleultonw': '⦭',
+    \ '\measangledrtose': '⦮',
+    \ '\measangledltosw': '⦯',
+    \ '\revemptyset': '⦰',
+    \ '\emptysetobar': '⦱',
+    \ '\emptysetocirc': '⦲',
+    \ '\emptysetoarr': '⦳',
+    \ '\emptysetoarrl': '⦴',
+    \ '\circledparallel': '⦷',
+    \ '\obslash': '⦸',
+    \ '\odotslashdot': '⦼',
+    \ '\circledwhitebullet': '⦾',
+    \ '\circledbullet': '⦿',
+    \ '\olessthan': '⧀',
+    \ '\ogreaterthan': '⧁',
+    \ '\boxdiag': '⧄',
+    \ '\boxbslash': '⧅',
+    \ '\boxast': '⧆',
+    \ '\boxcircle': '⧇',
+    \ '\Lap': '⧊',
+    \ '\defas': '⧋',
+    \ '\LeftTriangleBar': '⧏',
+    \ '\NotLeftTriangleBar': '⧏̸',
+    \ '\RightTriangleBar': '⧐',
+    \ '\NotRightTriangleBar': '⧐̸',
+    \ '\dualmap': '⧟',
+    \ '\lrtriangleeq': '⧡',
+    \ '\shuffle': '⧢',
+    \ '\eparsl': '⧣',
+    \ '\smeparsl': '⧤',
+    \ '\eqvparsl': '⧥',
+    \ '\blacklozenge': '⧫',
+    \ '\RuleDelayed': '⧴',
+    \ '\dsol': '⧶',
+    \ '\rsolbar': '⧷',
+    \ '\doubleplus': '⧺',
+    \ '\tripleplus': '⧻',
+    \ '\bigodot': '⨀',
+    \ '\bigoplus': '⨁',
+    \ '\bigotimes': '⨂',
+    \ '\bigcupdot': '⨃',
+    \ '\biguplus': '⨄',
+    \ '\bigsqcap': '⨅',
+    \ '\bigsqcup': '⨆',
+    \ '\conjquant': '⨇',
+    \ '\disjquant': '⨈',
+    \ '\bigtimes': '⨉',
+    \ '\modtwosum': '⨊',
+    \ '\sumint': '⨋',
+    \ '\iiiint': '⨌',
+    \ '\intbar': '⨍',
+    \ '\intBar': '⨎',
+    \ '\clockoint': '⨏',
+    \ '\cirfnint': '⨐',
+    \ '\awint': '⨑',
+    \ '\rppolint': '⨒',
+    \ '\scpolint': '⨓',
+    \ '\npolint': '⨔',
+    \ '\pointint': '⨕',
+    \ '\sqrint': '⨖',
+    \ '\intx': '⨘',
+    \ '\intcap': '⨙',
+    \ '\intcup': '⨚',
+    \ '\upint': '⨛',
+    \ '\lowint': '⨜',
+    \ '\Join': '⨝',
+    \ '\join': '⨝',
+    \ '\ringplus': '⨢',
+    \ '\plushat': '⨣',
+    \ '\simplus': '⨤',
+    \ '\plusdot': '⨥',
+    \ '\plussim': '⨦',
+    \ '\plussubtwo': '⨧',
+    \ '\plustrif': '⨨',
+    \ '\commaminus': '⨩',
+    \ '\minusdot': '⨪',
+    \ '\minusfdots': '⨫',
+    \ '\minusrdots': '⨬',
+    \ '\opluslhrim': '⨭',
+    \ '\oplusrhrim': '⨮',
+    \ '\Times': '⨯',
+    \ '\dottimes': '⨰',
+    \ '\timesbar': '⨱',
+    \ '\btimes': '⨲',
+    \ '\smashtimes': '⨳',
+    \ '\otimeslhrim': '⨴',
+    \ '\otimesrhrim': '⨵',
+    \ '\otimeshat': '⨶',
+    \ '\Otimes': '⨷',
+    \ '\odiv': '⨸',
+    \ '\triangleplus': '⨹',
+    \ '\triangleminus': '⨺',
+    \ '\triangletimes': '⨻',
+    \ '\intprod': '⨼',
+    \ '\intprodr': '⨽',
+    \ '\amalg': '⨿',
+    \ '\capdot': '⩀',
+    \ '\uminus': '⩁',
+    \ '\barcup': '⩂',
+    \ '\barcap': '⩃',
+    \ '\capwedge': '⩄',
+    \ '\cupvee': '⩅',
+    \ '\twocups': '⩊',
+    \ '\twocaps': '⩋',
+    \ '\closedvarcup': '⩌',
+    \ '\closedvarcap': '⩍',
+    \ '\Sqcap': '⩎',
+    \ '\Sqcup': '⩏',
+    \ '\closedvarcupsmashprod': '⩐',
+    \ '\wedgeodot': '⩑',
+    \ '\veeodot': '⩒',
+    \ '\And': '⩓',
+    \ '\Or': '⩔',
+    \ '\wedgeonwedge': '⩕',
+    \ '\ElOr': '⩖',
+    \ '\bigslopedvee': '⩗',
+    \ '\bigslopedwedge': '⩘',
+    \ '\wedgemidvert': '⩚',
+    \ '\veemidvert': '⩛',
+    \ '\midbarwedge': '⩜',
+    \ '\midbarvee': '⩝',
+    \ '\perspcorrespond': '⩞',
+    \ '\minhat': '⩟',
+    \ '\wedgedoublebar': '⩠',
+    \ '\varveebar': '⩡',
+    \ '\doublebarvee': '⩢',
+    \ '\veedoublebar': '⩣',
+    \ '\eqdot': '⩦',
+    \ '\dotequiv': '⩧',
+    \ '\dotsim': '⩪',
+    \ '\simrdots': '⩫',
+    \ '\simminussim': '⩬',
+    \ '\congdot': '⩭',
+    \ '\asteq': '⩮',
+    \ '\hatapprox': '⩯',
+    \ '\approxeqq': '⩰',
+    \ '\eqqplus': '⩱',
+    \ '\pluseqq': '⩲',
+    \ '\eqqsim': '⩳',
+    \ '\Coloneq': '⩴',
+    \ '\Equal': '⩵',
+    \ '\eqeqeq': '⩶',
+    \ '\ddotseq': '⩷',
+    \ '\equivDD': '⩸',
+    \ '\ltcir': '⩹',
+    \ '\gtcir': '⩺',
+    \ '\ltquest': '⩻',
+    \ '\gtquest': '⩼',
+    \ '\leqslant': '⩽',
+    \ '\nleqslant': '⩽̸',
+    \ '\geqslant': '⩾',
+    \ '\ngeqslant': '⩾̸',
+    \ '\lesdot': '⩿',
+    \ '\gesdot': '⪀',
+    \ '\lesdoto': '⪁',
+    \ '\gesdoto': '⪂',
+    \ '\lesdotor': '⪃',
+    \ '\gesdotol': '⪄',
+    \ '\lessapprox': '⪅',
+    \ '\gtrapprox': '⪆',
+    \ '\lneq': '⪇',
+    \ '\gneq': '⪈',
+    \ '\lnapprox': '⪉',
+    \ '\gnapprox': '⪊',
+    \ '\lesseqqgtr': '⪋',
+    \ '\gtreqqless': '⪌',
+    \ '\lsime': '⪍',
+    \ '\gsime': '⪎',
+    \ '\lsimg': '⪏',
+    \ '\gsiml': '⪐',
+    \ '\lgE': '⪑',
+    \ '\glE': '⪒',
+    \ '\lesges': '⪓',
+    \ '\gesles': '⪔',
+    \ '\eqslantless': '⪕',
+    \ '\eqslantgtr': '⪖',
+    \ '\elsdot': '⪗',
+    \ '\egsdot': '⪘',
+    \ '\eqqless': '⪙',
+    \ '\eqqgtr': '⪚',
+    \ '\eqqslantless': '⪛',
+    \ '\eqqslantgtr': '⪜',
+    \ '\simless': '⪝',
+    \ '\simgtr': '⪞',
+    \ '\simlE': '⪟',
+    \ '\simgE': '⪠',
+    \ '\NestedLessLess': '⪡',
+    \ '\NotNestedLessLess': '⪡̸',
+    \ '\NestedGreaterGreater': '⪢',
+    \ '\NotNestedGreaterGreater': '⪢̸',
+    \ '\partialmeetcontraction': '⪣',
+    \ '\glj': '⪤',
+    \ '\gla': '⪥',
+    \ '\ltcc': '⪦',
+    \ '\gtcc': '⪧',
+    \ '\lescc': '⪨',
+    \ '\gescc': '⪩',
+    \ '\smt': '⪪',
+    \ '\lat': '⪫',
+    \ '\smte': '⪬',
+    \ '\late': '⪭',
+    \ '\bumpeqq': '⪮',
+    \ '\preceq': '⪯',
+    \ '\npreceq': '⪯̸',
+    \ '\succeq': '⪰',
+    \ '\nsucceq': '⪰̸',
+    \ '\precneq': '⪱',
+    \ '\succneq': '⪲',
+    \ '\preceqq': '⪳',
+    \ '\succeqq': '⪴',
+    \ '\precneqq': '⪵',
+    \ '\succneqq': '⪶',
+    \ '\precapprox': '⪷',
+    \ '\succapprox': '⪸',
+    \ '\precnapprox': '⪹',
+    \ '\succnapprox': '⪺',
+    \ '\Prec': '⪻',
+    \ '\Succ': '⪼',
+    \ '\subsetdot': '⪽',
+    \ '\supsetdot': '⪾',
+    \ '\subsetplus': '⪿',
+    \ '\supsetplus': '⫀',
+    \ '\submult': '⫁',
+    \ '\supmult': '⫂',
+    \ '\subedot': '⫃',
+    \ '\supedot': '⫄',
+    \ '\subseteqq': '⫅',
+    \ '\nsubseteqq': '⫅̸',
+    \ '\supseteqq': '⫆',
+    \ '\nsupseteqq': '⫆̸',
+    \ '\subsim': '⫇',
+    \ '\supsim': '⫈',
+    \ '\subsetapprox': '⫉',
+    \ '\supsetapprox': '⫊',
+    \ '\subsetneqq': '⫋',
+    \ '\supsetneqq': '⫌',
+    \ '\lsqhook': '⫍',
+    \ '\rsqhook': '⫎',
+    \ '\csub': '⫏',
+    \ '\csup': '⫐',
+    \ '\csube': '⫑',
+    \ '\csupe': '⫒',
+    \ '\subsup': '⫓',
+    \ '\supsub': '⫔',
+    \ '\subsub': '⫕',
+    \ '\supsup': '⫖',
+    \ '\suphsub': '⫗',
+    \ '\supdsub': '⫘',
+    \ '\forkv': '⫙',
+    \ '\mlcp': '⫛',
+    \ '\forks': '⫝̸',
+    \ '\forksnot': '⫝',
+    \ '\dashV': '⫣',
+    \ '\Dashv': '⫤',
+    \ '\interleave': '⫴',
+    \ '\tdcol': '⫶',
+    \ '\lllnest': '⫷',
+    \ '\gggnest': '⫸',
+    \ '\leqqslant': '⫹',
+    \ '\geqqslant': '⫺',
+    \ '\:arrow_left:': '⬅',
+    \ '\:arrow_up:': '⬆',
+    \ '\:arrow_down:': '⬇',
+    \ '\squaretopblack': '⬒',
+    \ '\squarebotblack': '⬓',
+    \ '\squareurblack': '⬔',
+    \ '\squarellblack': '⬕',
+    \ '\diamondleftblack': '⬖',
+    \ '\diamondrightblack': '⬗',
+    \ '\diamondtopblack': '⬘',
+    \ '\diamondbotblack': '⬙',
+    \ '\dottedsquare': '⬚',
+    \ '\lgblksquare': '⬛',
+    \ '\:black_large_square:': '⬛',
+    \ '\lgwhtsquare': '⬜',
+    \ '\:white_large_square:': '⬜',
+    \ '\vysmblksquare': '⬝',
+    \ '\vysmwhtsquare': '⬞',
+    \ '\pentagonblack': '⬟',
+    \ '\pentagon': '⬠',
+    \ '\varhexagon': '⬡',
+    \ '\varhexagonblack': '⬢',
+    \ '\hexagonblack': '⬣',
+    \ '\lgblkcircle': '⬤',
+    \ '\mdblkdiamond': '⬥',
+    \ '\mdwhtdiamond': '⬦',
+    \ '\mdblklozenge': '⬧',
+    \ '\mdwhtlozenge': '⬨',
+    \ '\smblkdiamond': '⬩',
+    \ '\smblklozenge': '⬪',
+    \ '\smwhtlozenge': '⬫',
+    \ '\blkhorzoval': '⬬',
+    \ '\whthorzoval': '⬭',
+    \ '\blkvertoval': '⬮',
+    \ '\whtvertoval': '⬯',
+    \ '\circleonleftarrow': '⬰',
+    \ '\leftthreearrows': '⬱',
+    \ '\leftarrowonoplus': '⬲',
+    \ '\longleftsquigarrow': '⬳',
+    \ '\nvtwoheadleftarrow': '⬴',
+    \ '\nVtwoheadleftarrow': '⬵',
+    \ '\twoheadmapsfrom': '⬶',
+    \ '\twoheadleftdbkarrow': '⬷',
+    \ '\leftdotarrow': '⬸',
+    \ '\nvleftarrowtail': '⬹',
+    \ '\nVleftarrowtail': '⬺',
+    \ '\twoheadleftarrowtail': '⬻',
+    \ '\nvtwoheadleftarrowtail': '⬼',
+    \ '\nVtwoheadleftarrowtail': '⬽',
+    \ '\leftarrowx': '⬾',
+    \ '\leftcurvedarrow': '⬿',
+    \ '\equalleftarrow': '⭀',
+    \ '\bsimilarleftarrow': '⭁',
+    \ '\leftarrowbackapprox': '⭂',
+    \ '\rightarrowgtr': '⭃',
+    \ '\rightarrowsupset': '⭄',
+    \ '\LLeftarrow': '⭅',
+    \ '\RRightarrow': '⭆',
+    \ '\bsimilarrightarrow': '⭇',
+    \ '\rightarrowbackapprox': '⭈',
+    \ '\similarleftarrow': '⭉',
+    \ '\leftarrowapprox': '⭊',
+    \ '\leftarrowbsimilar': '⭋',
+    \ '\rightarrowbsimilar': '⭌',
+    \ '\medwhitestar': '⭐',
+    \ '\:star:': '⭐',
+    \ '\medblackstar': '⭑',
+    \ '\smwhitestar': '⭒',
+    \ '\rightpentagonblack': '⭓',
+    \ '\rightpentagon': '⭔',
+    \ '\:o:': '⭕',
+    \ '\_j': 'ⱼ',
+    \ '\^V': 'ⱽ',
+    \ '\postalmark': '〒',
+    \ '\:wavy_dash:': '〰',
+    \ '\:part_alternation_mark:': '〽',
+    \ '\:congratulations:': '㊗',
+    \ '\:secret:': '㊙',
+    \ '\bfA': '𝐀',
+    \ '\bfB': '𝐁',
+    \ '\bfC': '𝐂',
+    \ '\bfD': '𝐃',
+    \ '\bfE': '𝐄',
+    \ '\bfF': '𝐅',
+    \ '\bfG': '𝐆',
+    \ '\bfH': '𝐇',
+    \ '\bfI': '𝐈',
+    \ '\bfJ': '𝐉',
+    \ '\bfK': '𝐊',
+    \ '\bfL': '𝐋',
+    \ '\bfM': '𝐌',
+    \ '\bfN': '𝐍',
+    \ '\bfO': '𝐎',
+    \ '\bfP': '𝐏',
+    \ '\bfQ': '𝐐',
+    \ '\bfR': '𝐑',
+    \ '\bfS': '𝐒',
+    \ '\bfT': '𝐓',
+    \ '\bfU': '𝐔',
+    \ '\bfV': '𝐕',
+    \ '\bfW': '𝐖',
+    \ '\bfX': '𝐗',
+    \ '\bfY': '𝐘',
+    \ '\bfZ': '𝐙',
+    \ '\bfa': '𝐚',
+    \ '\bfb': '𝐛',
+    \ '\bfc': '𝐜',
+    \ '\bfd': '𝐝',
+    \ '\bfe': '𝐞',
+    \ '\bff': '𝐟',
+    \ '\bfg': '𝐠',
+    \ '\bfh': '𝐡',
+    \ '\bfi': '𝐢',
+    \ '\bfj': '𝐣',
+    \ '\bfk': '𝐤',
+    \ '\bfl': '𝐥',
+    \ '\bfm': '𝐦',
+    \ '\bfn': '𝐧',
+    \ '\bfo': '𝐨',
+    \ '\bfp': '𝐩',
+    \ '\bfq': '𝐪',
+    \ '\bfr': '𝐫',
+    \ '\bfs': '𝐬',
+    \ '\bft': '𝐭',
+    \ '\bfu': '𝐮',
+    \ '\bfv': '𝐯',
+    \ '\bfw': '𝐰',
+    \ '\bfx': '𝐱',
+    \ '\bfy': '𝐲',
+    \ '\bfz': '𝐳',
+    \ '\itA': '𝐴',
+    \ '\itB': '𝐵',
+    \ '\itC': '𝐶',
+    \ '\itD': '𝐷',
+    \ '\itE': '𝐸',
+    \ '\itF': '𝐹',
+    \ '\itG': '𝐺',
+    \ '\itH': '𝐻',
+    \ '\itI': '𝐼',
+    \ '\itJ': '𝐽',
+    \ '\itK': '𝐾',
+    \ '\itL': '𝐿',
+    \ '\itM': '𝑀',
+    \ '\itN': '𝑁',
+    \ '\itO': '𝑂',
+    \ '\itP': '𝑃',
+    \ '\itQ': '𝑄',
+    \ '\itR': '𝑅',
+    \ '\itS': '𝑆',
+    \ '\itT': '𝑇',
+    \ '\itU': '𝑈',
+    \ '\itV': '𝑉',
+    \ '\itW': '𝑊',
+    \ '\itX': '𝑋',
+    \ '\itY': '𝑌',
+    \ '\itZ': '𝑍',
+    \ '\ita': '𝑎',
+    \ '\itb': '𝑏',
+    \ '\itc': '𝑐',
+    \ '\itd': '𝑑',
+    \ '\ite': '𝑒',
+    \ '\itf': '𝑓',
+    \ '\itg': '𝑔',
+    \ '\iti': '𝑖',
+    \ '\itj': '𝑗',
+    \ '\itk': '𝑘',
+    \ '\itl': '𝑙',
+    \ '\itm': '𝑚',
+    \ '\itn': '𝑛',
+    \ '\ito': '𝑜',
+    \ '\itp': '𝑝',
+    \ '\itq': '𝑞',
+    \ '\itr': '𝑟',
+    \ '\its': '𝑠',
+    \ '\itt': '𝑡',
+    \ '\itu': '𝑢',
+    \ '\itv': '𝑣',
+    \ '\itw': '𝑤',
+    \ '\itx': '𝑥',
+    \ '\ity': '𝑦',
+    \ '\itz': '𝑧',
+    \ '\biA': '𝑨',
+    \ '\biB': '𝑩',
+    \ '\biC': '𝑪',
+    \ '\biD': '𝑫',
+    \ '\biE': '𝑬',
+    \ '\biF': '𝑭',
+    \ '\biG': '𝑮',
+    \ '\biH': '𝑯',
+    \ '\biI': '𝑰',
+    \ '\biJ': '𝑱',
+    \ '\biK': '𝑲',
+    \ '\biL': '𝑳',
+    \ '\biM': '𝑴',
+    \ '\biN': '𝑵',
+    \ '\biO': '𝑶',
+    \ '\biP': '𝑷',
+    \ '\biQ': '𝑸',
+    \ '\biR': '𝑹',
+    \ '\biS': '𝑺',
+    \ '\biT': '𝑻',
+    \ '\biU': '𝑼',
+    \ '\biV': '𝑽',
+    \ '\biW': '𝑾',
+    \ '\biX': '𝑿',
+    \ '\biY': '𝒀',
+    \ '\biZ': '𝒁',
+    \ '\bia': '𝒂',
+    \ '\bib': '𝒃',
+    \ '\bic': '𝒄',
+    \ '\bid': '𝒅',
+    \ '\bie': '𝒆',
+    \ '\bif': '𝒇',
+    \ '\big': '𝒈',
+    \ '\bih': '𝒉',
+    \ '\bii': '𝒊',
+    \ '\bij': '𝒋',
+    \ '\bik': '𝒌',
+    \ '\bil': '𝒍',
+    \ '\bim': '𝒎',
+    \ '\bin': '𝒏',
+    \ '\bio': '𝒐',
+    \ '\bip': '𝒑',
+    \ '\biq': '𝒒',
+    \ '\bir': '𝒓',
+    \ '\bis': '𝒔',
+    \ '\bit': '𝒕',
+    \ '\biu': '𝒖',
+    \ '\biv': '𝒗',
+    \ '\biw': '𝒘',
+    \ '\bix': '𝒙',
+    \ '\biy': '𝒚',
+    \ '\biz': '𝒛',
+    \ '\scrA': '𝒜',
+    \ '\scrC': '𝒞',
+    \ '\scrD': '𝒟',
+    \ '\scrG': '𝒢',
+    \ '\scrJ': '𝒥',
+    \ '\scrK': '𝒦',
+    \ '\scrN': '𝒩',
+    \ '\scrO': '𝒪',
+    \ '\scrP': '𝒫',
+    \ '\scrQ': '𝒬',
+    \ '\scrS': '𝒮',
+    \ '\scrT': '𝒯',
+    \ '\scrU': '𝒰',
+    \ '\scrV': '𝒱',
+    \ '\scrW': '𝒲',
+    \ '\scrX': '𝒳',
+    \ '\scrY': '𝒴',
+    \ '\scrZ': '𝒵',
+    \ '\scra': '𝒶',
+    \ '\scrb': '𝒷',
+    \ '\scrc': '𝒸',
+    \ '\scrd': '𝒹',
+    \ '\scrf': '𝒻',
+    \ '\scrh': '𝒽',
+    \ '\scri': '𝒾',
+    \ '\scrj': '𝒿',
+    \ '\scrk': '𝓀',
+    \ '\scrl': '𝓁',
+    \ '\scrm': '𝓂',
+    \ '\scrn': '𝓃',
+    \ '\scrp': '𝓅',
+    \ '\scrq': '𝓆',
+    \ '\scrr': '𝓇',
+    \ '\scrs': '𝓈',
+    \ '\scrt': '𝓉',
+    \ '\scru': '𝓊',
+    \ '\scrv': '𝓋',
+    \ '\scrw': '𝓌',
+    \ '\scrx': '𝓍',
+    \ '\scry': '𝓎',
+    \ '\scrz': '𝓏',
+    \ '\bscrA': '𝓐',
+    \ '\bscrB': '𝓑',
+    \ '\bscrC': '𝓒',
+    \ '\bscrD': '𝓓',
+    \ '\bscrE': '𝓔',
+    \ '\bscrF': '𝓕',
+    \ '\bscrG': '𝓖',
+    \ '\bscrH': '𝓗',
+    \ '\bscrI': '𝓘',
+    \ '\bscrJ': '𝓙',
+    \ '\bscrK': '𝓚',
+    \ '\bscrL': '𝓛',
+    \ '\bscrM': '𝓜',
+    \ '\bscrN': '𝓝',
+    \ '\bscrO': '𝓞',
+    \ '\bscrP': '𝓟',
+    \ '\bscrQ': '𝓠',
+    \ '\bscrR': '𝓡',
+    \ '\bscrS': '𝓢',
+    \ '\bscrT': '𝓣',
+    \ '\bscrU': '𝓤',
+    \ '\bscrV': '𝓥',
+    \ '\bscrW': '𝓦',
+    \ '\bscrX': '𝓧',
+    \ '\bscrY': '𝓨',
+    \ '\bscrZ': '𝓩',
+    \ '\bscra': '𝓪',
+    \ '\bscrb': '𝓫',
+    \ '\bscrc': '𝓬',
+    \ '\bscrd': '𝓭',
+    \ '\bscre': '𝓮',
+    \ '\bscrf': '𝓯',
+    \ '\bscrg': '𝓰',
+    \ '\bscrh': '𝓱',
+    \ '\bscri': '𝓲',
+    \ '\bscrj': '𝓳',
+    \ '\bscrk': '𝓴',
+    \ '\bscrl': '𝓵',
+    \ '\bscrm': '𝓶',
+    \ '\bscrn': '𝓷',
+    \ '\bscro': '𝓸',
+    \ '\bscrp': '𝓹',
+    \ '\bscrq': '𝓺',
+    \ '\bscrr': '𝓻',
+    \ '\bscrs': '𝓼',
+    \ '\bscrt': '𝓽',
+    \ '\bscru': '𝓾',
+    \ '\bscrv': '𝓿',
+    \ '\bscrw': '𝔀',
+    \ '\bscrx': '𝔁',
+    \ '\bscry': '𝔂',
+    \ '\bscrz': '𝔃',
+    \ '\frakA': '𝔄',
+    \ '\frakB': '𝔅',
+    \ '\frakD': '𝔇',
+    \ '\frakE': '𝔈',
+    \ '\frakF': '𝔉',
+    \ '\frakG': '𝔊',
+    \ '\frakJ': '𝔍',
+    \ '\frakK': '𝔎',
+    \ '\frakL': '𝔏',
+    \ '\frakM': '𝔐',
+    \ '\frakN': '𝔑',
+    \ '\frakO': '𝔒',
+    \ '\frakP': '𝔓',
+    \ '\frakQ': '𝔔',
+    \ '\frakS': '𝔖',
+    \ '\frakT': '𝔗',
+    \ '\frakU': '𝔘',
+    \ '\frakV': '𝔙',
+    \ '\frakW': '𝔚',
+    \ '\frakX': '𝔛',
+    \ '\frakY': '𝔜',
+    \ '\fraka': '𝔞',
+    \ '\frakb': '𝔟',
+    \ '\frakc': '𝔠',
+    \ '\frakd': '𝔡',
+    \ '\frake': '𝔢',
+    \ '\frakf': '𝔣',
+    \ '\frakg': '𝔤',
+    \ '\frakh': '𝔥',
+    \ '\fraki': '𝔦',
+    \ '\frakj': '𝔧',
+    \ '\frakk': '𝔨',
+    \ '\frakl': '𝔩',
+    \ '\frakm': '𝔪',
+    \ '\frakn': '𝔫',
+    \ '\frako': '𝔬',
+    \ '\frakp': '𝔭',
+    \ '\frakq': '𝔮',
+    \ '\frakr': '𝔯',
+    \ '\fraks': '𝔰',
+    \ '\frakt': '𝔱',
+    \ '\fraku': '𝔲',
+    \ '\frakv': '𝔳',
+    \ '\frakw': '𝔴',
+    \ '\frakx': '𝔵',
+    \ '\fraky': '𝔶',
+    \ '\frakz': '𝔷',
+    \ '\bbA': '𝔸',
+    \ '\bbB': '𝔹',
+    \ '\bbD': '𝔻',
+    \ '\bbE': '𝔼',
+    \ '\bbF': '𝔽',
+    \ '\bbG': '𝔾',
+    \ '\bbI': '𝕀',
+    \ '\bbJ': '𝕁',
+    \ '\bbK': '𝕂',
+    \ '\bbL': '𝕃',
+    \ '\bbM': '𝕄',
+    \ '\bbO': '𝕆',
+    \ '\bbS': '𝕊',
+    \ '\bbT': '𝕋',
+    \ '\bbU': '𝕌',
+    \ '\bbV': '𝕍',
+    \ '\bbW': '𝕎',
+    \ '\bbX': '𝕏',
+    \ '\bbY': '𝕐',
+    \ '\bba': '𝕒',
+    \ '\bbb': '𝕓',
+    \ '\bbc': '𝕔',
+    \ '\bbd': '𝕕',
+    \ '\bbe': '𝕖',
+    \ '\bbf': '𝕗',
+    \ '\bbg': '𝕘',
+    \ '\bbh': '𝕙',
+    \ '\bbi': '𝕚',
+    \ '\bbj': '𝕛',
+    \ '\bbk': '𝕜',
+    \ '\bbl': '𝕝',
+    \ '\bbm': '𝕞',
+    \ '\bbn': '𝕟',
+    \ '\bbo': '𝕠',
+    \ '\bbp': '𝕡',
+    \ '\bbq': '𝕢',
+    \ '\bbr': '𝕣',
+    \ '\bbs': '𝕤',
+    \ '\bbt': '𝕥',
+    \ '\bbu': '𝕦',
+    \ '\bbv': '𝕧',
+    \ '\bbw': '𝕨',
+    \ '\bbx': '𝕩',
+    \ '\bby': '𝕪',
+    \ '\bbz': '𝕫',
+    \ '\bfrakA': '𝕬',
+    \ '\bfrakB': '𝕭',
+    \ '\bfrakC': '𝕮',
+    \ '\bfrakD': '𝕯',
+    \ '\bfrakE': '𝕰',
+    \ '\bfrakF': '𝕱',
+    \ '\bfrakG': '𝕲',
+    \ '\bfrakH': '𝕳',
+    \ '\bfrakI': '𝕴',
+    \ '\bfrakJ': '𝕵',
+    \ '\bfrakK': '𝕶',
+    \ '\bfrakL': '𝕷',
+    \ '\bfrakM': '𝕸',
+    \ '\bfrakN': '𝕹',
+    \ '\bfrakO': '𝕺',
+    \ '\bfrakP': '𝕻',
+    \ '\bfrakQ': '𝕼',
+    \ '\bfrakR': '𝕽',
+    \ '\bfrakS': '𝕾',
+    \ '\bfrakT': '𝕿',
+    \ '\bfrakU': '𝖀',
+    \ '\bfrakV': '𝖁',
+    \ '\bfrakW': '𝖂',
+    \ '\bfrakX': '𝖃',
+    \ '\bfrakY': '𝖄',
+    \ '\bfrakZ': '𝖅',
+    \ '\bfraka': '𝖆',
+    \ '\bfrakb': '𝖇',
+    \ '\bfrakc': '𝖈',
+    \ '\bfrakd': '𝖉',
+    \ '\bfrake': '𝖊',
+    \ '\bfrakf': '𝖋',
+    \ '\bfrakg': '𝖌',
+    \ '\bfrakh': '𝖍',
+    \ '\bfraki': '𝖎',
+    \ '\bfrakj': '𝖏',
+    \ '\bfrakk': '𝖐',
+    \ '\bfrakl': '𝖑',
+    \ '\bfrakm': '𝖒',
+    \ '\bfrakn': '𝖓',
+    \ '\bfrako': '𝖔',
+    \ '\bfrakp': '𝖕',
+    \ '\bfrakq': '𝖖',
+    \ '\bfrakr': '𝖗',
+    \ '\bfraks': '𝖘',
+    \ '\bfrakt': '𝖙',
+    \ '\bfraku': '𝖚',
+    \ '\bfrakv': '𝖛',
+    \ '\bfrakw': '𝖜',
+    \ '\bfrakx': '𝖝',
+    \ '\bfraky': '𝖞',
+    \ '\bfrakz': '𝖟',
+    \ '\sansA': '𝖠',
+    \ '\sansB': '𝖡',
+    \ '\sansC': '𝖢',
+    \ '\sansD': '𝖣',
+    \ '\sansE': '𝖤',
+    \ '\sansF': '𝖥',
+    \ '\sansG': '𝖦',
+    \ '\sansH': '𝖧',
+    \ '\sansI': '𝖨',
+    \ '\sansJ': '𝖩',
+    \ '\sansK': '𝖪',
+    \ '\sansL': '𝖫',
+    \ '\sansM': '𝖬',
+    \ '\sansN': '𝖭',
+    \ '\sansO': '𝖮',
+    \ '\sansP': '𝖯',
+    \ '\sansQ': '𝖰',
+    \ '\sansR': '𝖱',
+    \ '\sansS': '𝖲',
+    \ '\sansT': '𝖳',
+    \ '\sansU': '𝖴',
+    \ '\sansV': '𝖵',
+    \ '\sansW': '𝖶',
+    \ '\sansX': '𝖷',
+    \ '\sansY': '𝖸',
+    \ '\sansZ': '𝖹',
+    \ '\sansa': '𝖺',
+    \ '\sansb': '𝖻',
+    \ '\sansc': '𝖼',
+    \ '\sansd': '𝖽',
+    \ '\sanse': '𝖾',
+    \ '\sansf': '𝖿',
+    \ '\sansg': '𝗀',
+    \ '\sansh': '𝗁',
+    \ '\sansi': '𝗂',
+    \ '\sansj': '𝗃',
+    \ '\sansk': '𝗄',
+    \ '\sansl': '𝗅',
+    \ '\sansm': '𝗆',
+    \ '\sansn': '𝗇',
+    \ '\sanso': '𝗈',
+    \ '\sansp': '𝗉',
+    \ '\sansq': '𝗊',
+    \ '\sansr': '𝗋',
+    \ '\sanss': '𝗌',
+    \ '\sanst': '𝗍',
+    \ '\sansu': '𝗎',
+    \ '\sansv': '𝗏',
+    \ '\sansw': '𝗐',
+    \ '\sansx': '𝗑',
+    \ '\sansy': '𝗒',
+    \ '\sansz': '𝗓',
+    \ '\bsansA': '𝗔',
+    \ '\bsansB': '𝗕',
+    \ '\bsansC': '𝗖',
+    \ '\bsansD': '𝗗',
+    \ '\bsansE': '𝗘',
+    \ '\bsansF': '𝗙',
+    \ '\bsansG': '𝗚',
+    \ '\bsansH': '𝗛',
+    \ '\bsansI': '𝗜',
+    \ '\bsansJ': '𝗝',
+    \ '\bsansK': '𝗞',
+    \ '\bsansL': '𝗟',
+    \ '\bsansM': '𝗠',
+    \ '\bsansN': '𝗡',
+    \ '\bsansO': '𝗢',
+    \ '\bsansP': '𝗣',
+    \ '\bsansQ': '𝗤',
+    \ '\bsansR': '𝗥',
+    \ '\bsansS': '𝗦',
+    \ '\bsansT': '𝗧',
+    \ '\bsansU': '𝗨',
+    \ '\bsansV': '𝗩',
+    \ '\bsansW': '𝗪',
+    \ '\bsansX': '𝗫',
+    \ '\bsansY': '𝗬',
+    \ '\bsansZ': '𝗭',
+    \ '\bsansa': '𝗮',
+    \ '\bsansb': '𝗯',
+    \ '\bsansc': '𝗰',
+    \ '\bsansd': '𝗱',
+    \ '\bsanse': '𝗲',
+    \ '\bsansf': '𝗳',
+    \ '\bsansg': '𝗴',
+    \ '\bsansh': '𝗵',
+    \ '\bsansi': '𝗶',
+    \ '\bsansj': '𝗷',
+    \ '\bsansk': '𝗸',
+    \ '\bsansl': '𝗹',
+    \ '\bsansm': '𝗺',
+    \ '\bsansn': '𝗻',
+    \ '\bsanso': '𝗼',
+    \ '\bsansp': '𝗽',
+    \ '\bsansq': '𝗾',
+    \ '\bsansr': '𝗿',
+    \ '\bsanss': '𝘀',
+    \ '\bsanst': '𝘁',
+    \ '\bsansu': '𝘂',
+    \ '\bsansv': '𝘃',
+    \ '\bsansw': '𝘄',
+    \ '\bsansx': '𝘅',
+    \ '\bsansy': '𝘆',
+    \ '\bsansz': '𝘇',
+    \ '\isansA': '𝘈',
+    \ '\isansB': '𝘉',
+    \ '\isansC': '𝘊',
+    \ '\isansD': '𝘋',
+    \ '\isansE': '𝘌',
+    \ '\isansF': '𝘍',
+    \ '\isansG': '𝘎',
+    \ '\isansH': '𝘏',
+    \ '\isansI': '𝘐',
+    \ '\isansJ': '𝘑',
+    \ '\isansK': '𝘒',
+    \ '\isansL': '𝘓',
+    \ '\isansM': '𝘔',
+    \ '\isansN': '𝘕',
+    \ '\isansO': '𝘖',
+    \ '\isansP': '𝘗',
+    \ '\isansQ': '𝘘',
+    \ '\isansR': '𝘙',
+    \ '\isansS': '𝘚',
+    \ '\isansT': '𝘛',
+    \ '\isansU': '𝘜',
+    \ '\isansV': '𝘝',
+    \ '\isansW': '𝘞',
+    \ '\isansX': '𝘟',
+    \ '\isansY': '𝘠',
+    \ '\isansZ': '𝘡',
+    \ '\isansa': '𝘢',
+    \ '\isansb': '𝘣',
+    \ '\isansc': '𝘤',
+    \ '\isansd': '𝘥',
+    \ '\isanse': '𝘦',
+    \ '\isansf': '𝘧',
+    \ '\isansg': '𝘨',
+    \ '\isansh': '𝘩',
+    \ '\isansi': '𝘪',
+    \ '\isansj': '𝘫',
+    \ '\isansk': '𝘬',
+    \ '\isansl': '𝘭',
+    \ '\isansm': '𝘮',
+    \ '\isansn': '𝘯',
+    \ '\isanso': '𝘰',
+    \ '\isansp': '𝘱',
+    \ '\isansq': '𝘲',
+    \ '\isansr': '𝘳',
+    \ '\isanss': '𝘴',
+    \ '\isanst': '𝘵',
+    \ '\isansu': '𝘶',
+    \ '\isansv': '𝘷',
+    \ '\isansw': '𝘸',
+    \ '\isansx': '𝘹',
+    \ '\isansy': '𝘺',
+    \ '\isansz': '𝘻',
+    \ '\bisansA': '𝘼',
+    \ '\bisansB': '𝘽',
+    \ '\bisansC': '𝘾',
+    \ '\bisansD': '𝘿',
+    \ '\bisansE': '𝙀',
+    \ '\bisansF': '𝙁',
+    \ '\bisansG': '𝙂',
+    \ '\bisansH': '𝙃',
+    \ '\bisansI': '𝙄',
+    \ '\bisansJ': '𝙅',
+    \ '\bisansK': '𝙆',
+    \ '\bisansL': '𝙇',
+    \ '\bisansM': '𝙈',
+    \ '\bisansN': '𝙉',
+    \ '\bisansO': '𝙊',
+    \ '\bisansP': '𝙋',
+    \ '\bisansQ': '𝙌',
+    \ '\bisansR': '𝙍',
+    \ '\bisansS': '𝙎',
+    \ '\bisansT': '𝙏',
+    \ '\bisansU': '𝙐',
+    \ '\bisansV': '𝙑',
+    \ '\bisansW': '𝙒',
+    \ '\bisansX': '𝙓',
+    \ '\bisansY': '𝙔',
+    \ '\bisansZ': '𝙕',
+    \ '\bisansa': '𝙖',
+    \ '\bisansb': '𝙗',
+    \ '\bisansc': '𝙘',
+    \ '\bisansd': '𝙙',
+    \ '\bisanse': '𝙚',
+    \ '\bisansf': '𝙛',
+    \ '\bisansg': '𝙜',
+    \ '\bisansh': '𝙝',
+    \ '\bisansi': '𝙞',
+    \ '\bisansj': '𝙟',
+    \ '\bisansk': '𝙠',
+    \ '\bisansl': '𝙡',
+    \ '\bisansm': '𝙢',
+    \ '\bisansn': '𝙣',
+    \ '\bisanso': '𝙤',
+    \ '\bisansp': '𝙥',
+    \ '\bisansq': '𝙦',
+    \ '\bisansr': '𝙧',
+    \ '\bisanss': '𝙨',
+    \ '\bisanst': '𝙩',
+    \ '\bisansu': '𝙪',
+    \ '\bisansv': '𝙫',
+    \ '\bisansw': '𝙬',
+    \ '\bisansx': '𝙭',
+    \ '\bisansy': '𝙮',
+    \ '\bisansz': '𝙯',
+    \ '\ttA': '𝙰',
+    \ '\ttB': '𝙱',
+    \ '\ttC': '𝙲',
+    \ '\ttD': '𝙳',
+    \ '\ttE': '𝙴',
+    \ '\ttF': '𝙵',
+    \ '\ttG': '𝙶',
+    \ '\ttH': '𝙷',
+    \ '\ttI': '𝙸',
+    \ '\ttJ': '𝙹',
+    \ '\ttK': '𝙺',
+    \ '\ttL': '𝙻',
+    \ '\ttM': '𝙼',
+    \ '\ttN': '𝙽',
+    \ '\ttO': '𝙾',
+    \ '\ttP': '𝙿',
+    \ '\ttQ': '𝚀',
+    \ '\ttR': '𝚁',
+    \ '\ttS': '𝚂',
+    \ '\ttT': '𝚃',
+    \ '\ttU': '𝚄',
+    \ '\ttV': '𝚅',
+    \ '\ttW': '𝚆',
+    \ '\ttX': '𝚇',
+    \ '\ttY': '𝚈',
+    \ '\ttZ': '𝚉',
+    \ '\tta': '𝚊',
+    \ '\ttb': '𝚋',
+    \ '\ttc': '𝚌',
+    \ '\ttd': '𝚍',
+    \ '\tte': '𝚎',
+    \ '\ttf': '𝚏',
+    \ '\ttg': '𝚐',
+    \ '\tth': '𝚑',
+    \ '\tti': '𝚒',
+    \ '\ttj': '𝚓',
+    \ '\ttk': '𝚔',
+    \ '\ttl': '𝚕',
+    \ '\ttm': '𝚖',
+    \ '\ttn': '𝚗',
+    \ '\tto': '𝚘',
+    \ '\ttp': '𝚙',
+    \ '\ttq': '𝚚',
+    \ '\ttr': '𝚛',
+    \ '\tts': '𝚜',
+    \ '\ttt': '𝚝',
+    \ '\ttu': '𝚞',
+    \ '\ttv': '𝚟',
+    \ '\ttw': '𝚠',
+    \ '\ttx': '𝚡',
+    \ '\tty': '𝚢',
+    \ '\ttz': '𝚣',
+    \ '\itimath': '𝚤',
+    \ '\itjmath': '𝚥',
+    \ '\bfAlpha': '𝚨',
+    \ '\bfBeta': '𝚩',
+    \ '\bfGamma': '𝚪',
+    \ '\bfDelta': '𝚫',
+    \ '\bfEpsilon': '𝚬',
+    \ '\bfZeta': '𝚭',
+    \ '\bfEta': '𝚮',
+    \ '\bfTheta': '𝚯',
+    \ '\bfIota': '𝚰',
+    \ '\bfKappa': '𝚱',
+    \ '\bfLambda': '𝚲',
+    \ '\bfMu': '𝚳',
+    \ '\bfNu': '𝚴',
+    \ '\bfXi': '𝚵',
+    \ '\bfOmicron': '𝚶',
+    \ '\bfPi': '𝚷',
+    \ '\bfRho': '𝚸',
+    \ '\bfvarTheta': '𝚹',
+    \ '\bfSigma': '𝚺',
+    \ '\bfTau': '𝚻',
+    \ '\bfUpsilon': '𝚼',
+    \ '\bfPhi': '𝚽',
+    \ '\bfChi': '𝚾',
+    \ '\bfPsi': '𝚿',
+    \ '\bfOmega': '𝛀',
+    \ '\bfnabla': '𝛁',
+    \ '\bfalpha': '𝛂',
+    \ '\bfbeta': '𝛃',
+    \ '\bfgamma': '𝛄',
+    \ '\bfdelta': '𝛅',
+    \ '\bfepsilon': '𝛆',
+    \ '\bfzeta': '𝛇',
+    \ '\bfeta': '𝛈',
+    \ '\bftheta': '𝛉',
+    \ '\bfiota': '𝛊',
+    \ '\bfkappa': '𝛋',
+    \ '\bflambda': '𝛌',
+    \ '\bfmu': '𝛍',
+    \ '\bfnu': '𝛎',
+    \ '\bfxi': '𝛏',
+    \ '\bfomicron': '𝛐',
+    \ '\bfpi': '𝛑',
+    \ '\bfrho': '𝛒',
+    \ '\bfvarsigma': '𝛓',
+    \ '\bfsigma': '𝛔',
+    \ '\bftau': '𝛕',
+    \ '\bfupsilon': '𝛖',
+    \ '\bfvarphi': '𝛗',
+    \ '\bfchi': '𝛘',
+    \ '\bfpsi': '𝛙',
+    \ '\bfomega': '𝛚',
+    \ '\bfpartial': '𝛛',
+    \ '\bfvarepsilon': '𝛜',
+    \ '\bfvartheta': '𝛝',
+    \ '\bfvarkappa': '𝛞',
+    \ '\bfphi': '𝛟',
+    \ '\bfvarrho': '𝛠',
+    \ '\bfvarpi': '𝛡',
+    \ '\itAlpha': '𝛢',
+    \ '\itBeta': '𝛣',
+    \ '\itGamma': '𝛤',
+    \ '\itDelta': '𝛥',
+    \ '\itEpsilon': '𝛦',
+    \ '\itZeta': '𝛧',
+    \ '\itEta': '𝛨',
+    \ '\itTheta': '𝛩',
+    \ '\itIota': '𝛪',
+    \ '\itKappa': '𝛫',
+    \ '\itLambda': '𝛬',
+    \ '\itMu': '𝛭',
+    \ '\itNu': '𝛮',
+    \ '\itXi': '𝛯',
+    \ '\itOmicron': '𝛰',
+    \ '\itPi': '𝛱',
+    \ '\itRho': '𝛲',
+    \ '\itvarTheta': '𝛳',
+    \ '\itSigma': '𝛴',
+    \ '\itTau': '𝛵',
+    \ '\itUpsilon': '𝛶',
+    \ '\itPhi': '𝛷',
+    \ '\itChi': '𝛸',
+    \ '\itPsi': '𝛹',
+    \ '\itOmega': '𝛺',
+    \ '\itnabla': '𝛻',
+    \ '\italpha': '𝛼',
+    \ '\itbeta': '𝛽',
+    \ '\itgamma': '𝛾',
+    \ '\itdelta': '𝛿',
+    \ '\itepsilon': '𝜀',
+    \ '\itzeta': '𝜁',
+    \ '\iteta': '𝜂',
+    \ '\ittheta': '𝜃',
+    \ '\itiota': '𝜄',
+    \ '\itkappa': '𝜅',
+    \ '\itlambda': '𝜆',
+    \ '\itmu': '𝜇',
+    \ '\itnu': '𝜈',
+    \ '\itxi': '𝜉',
+    \ '\itomicron': '𝜊',
+    \ '\itpi': '𝜋',
+    \ '\itrho': '𝜌',
+    \ '\itvarsigma': '𝜍',
+    \ '\itsigma': '𝜎',
+    \ '\ittau': '𝜏',
+    \ '\itupsilon': '𝜐',
+    \ '\itphi': '𝜑',
+    \ '\itchi': '𝜒',
+    \ '\itpsi': '𝜓',
+    \ '\itomega': '𝜔',
+    \ '\itpartial': '𝜕',
+    \ '\itvarepsilon': '𝜖',
+    \ '\itvartheta': '𝜗',
+    \ '\itvarkappa': '𝜘',
+    \ '\itvarphi': '𝜙',
+    \ '\itvarrho': '𝜚',
+    \ '\itvarpi': '𝜛',
+    \ '\biAlpha': '𝜜',
+    \ '\biBeta': '𝜝',
+    \ '\biGamma': '𝜞',
+    \ '\biDelta': '𝜟',
+    \ '\biEpsilon': '𝜠',
+    \ '\biZeta': '𝜡',
+    \ '\biEta': '𝜢',
+    \ '\biTheta': '𝜣',
+    \ '\biIota': '𝜤',
+    \ '\biKappa': '𝜥',
+    \ '\biLambda': '𝜦',
+    \ '\biMu': '𝜧',
+    \ '\biNu': '𝜨',
+    \ '\biXi': '𝜩',
+    \ '\biOmicron': '𝜪',
+    \ '\biPi': '𝜫',
+    \ '\biRho': '𝜬',
+    \ '\bivarTheta': '𝜭',
+    \ '\biSigma': '𝜮',
+    \ '\biTau': '𝜯',
+    \ '\biUpsilon': '𝜰',
+    \ '\biPhi': '𝜱',
+    \ '\biChi': '𝜲',
+    \ '\biPsi': '𝜳',
+    \ '\biOmega': '𝜴',
+    \ '\binabla': '𝜵',
+    \ '\bialpha': '𝜶',
+    \ '\bibeta': '𝜷',
+    \ '\bigamma': '𝜸',
+    \ '\bidelta': '𝜹',
+    \ '\biepsilon': '𝜺',
+    \ '\bizeta': '𝜻',
+    \ '\bieta': '𝜼',
+    \ '\bitheta': '𝜽',
+    \ '\biiota': '𝜾',
+    \ '\bikappa': '𝜿',
+    \ '\bilambda': '𝝀',
+    \ '\bimu': '𝝁',
+    \ '\binu': '𝝂',
+    \ '\bixi': '𝝃',
+    \ '\biomicron': '𝝄',
+    \ '\bipi': '𝝅',
+    \ '\birho': '𝝆',
+    \ '\bivarsigma': '𝝇',
+    \ '\bisigma': '𝝈',
+    \ '\bitau': '𝝉',
+    \ '\biupsilon': '𝝊',
+    \ '\biphi': '𝝋',
+    \ '\bichi': '𝝌',
+    \ '\bipsi': '𝝍',
+    \ '\biomega': '𝝎',
+    \ '\bipartial': '𝝏',
+    \ '\bivarepsilon': '𝝐',
+    \ '\bivartheta': '𝝑',
+    \ '\bivarkappa': '𝝒',
+    \ '\bivarphi': '𝝓',
+    \ '\bivarrho': '𝝔',
+    \ '\bivarpi': '𝝕',
+    \ '\bsansAlpha': '𝝖',
+    \ '\bsansBeta': '𝝗',
+    \ '\bsansGamma': '𝝘',
+    \ '\bsansDelta': '𝝙',
+    \ '\bsansEpsilon': '𝝚',
+    \ '\bsansZeta': '𝝛',
+    \ '\bsansEta': '𝝜',
+    \ '\bsansTheta': '𝝝',
+    \ '\bsansIota': '𝝞',
+    \ '\bsansKappa': '𝝟',
+    \ '\bsansLambda': '𝝠',
+    \ '\bsansMu': '𝝡',
+    \ '\bsansNu': '𝝢',
+    \ '\bsansXi': '𝝣',
+    \ '\bsansOmicron': '𝝤',
+    \ '\bsansPi': '𝝥',
+    \ '\bsansRho': '𝝦',
+    \ '\bsansvarTheta': '𝝧',
+    \ '\bsansSigma': '𝝨',
+    \ '\bsansTau': '𝝩',
+    \ '\bsansUpsilon': '𝝪',
+    \ '\bsansPhi': '𝝫',
+    \ '\bsansChi': '𝝬',
+    \ '\bsansPsi': '𝝭',
+    \ '\bsansOmega': '𝝮',
+    \ '\bsansnabla': '𝝯',
+    \ '\bsansalpha': '𝝰',
+    \ '\bsansbeta': '𝝱',
+    \ '\bsansgamma': '𝝲',
+    \ '\bsansdelta': '𝝳',
+    \ '\bsansepsilon': '𝝴',
+    \ '\bsanszeta': '𝝵',
+    \ '\bsanseta': '𝝶',
+    \ '\bsanstheta': '𝝷',
+    \ '\bsansiota': '𝝸',
+    \ '\bsanskappa': '𝝹',
+    \ '\bsanslambda': '𝝺',
+    \ '\bsansmu': '𝝻',
+    \ '\bsansnu': '𝝼',
+    \ '\bsansxi': '𝝽',
+    \ '\bsansomicron': '𝝾',
+    \ '\bsanspi': '𝝿',
+    \ '\bsansrho': '𝞀',
+    \ '\bsansvarsigma': '𝞁',
+    \ '\bsanssigma': '𝞂',
+    \ '\bsanstau': '𝞃',
+    \ '\bsansupsilon': '𝞄',
+    \ '\bsansphi': '𝞅',
+    \ '\bsanschi': '𝞆',
+    \ '\bsanspsi': '𝞇',
+    \ '\bsansomega': '𝞈',
+    \ '\bsanspartial': '𝞉',
+    \ '\bsansvarepsilon': '𝞊',
+    \ '\bsansvartheta': '𝞋',
+    \ '\bsansvarkappa': '𝞌',
+    \ '\bsansvarphi': '𝞍',
+    \ '\bsansvarrho': '𝞎',
+    \ '\bsansvarpi': '𝞏',
+    \ '\bisansAlpha': '𝞐',
+    \ '\bisansBeta': '𝞑',
+    \ '\bisansGamma': '𝞒',
+    \ '\bisansDelta': '𝞓',
+    \ '\bisansEpsilon': '𝞔',
+    \ '\bisansZeta': '𝞕',
+    \ '\bisansEta': '𝞖',
+    \ '\bisansTheta': '𝞗',
+    \ '\bisansIota': '𝞘',
+    \ '\bisansKappa': '𝞙',
+    \ '\bisansLambda': '𝞚',
+    \ '\bisansMu': '𝞛',
+    \ '\bisansNu': '𝞜',
+    \ '\bisansXi': '𝞝',
+    \ '\bisansOmicron': '𝞞',
+    \ '\bisansPi': '𝞟',
+    \ '\bisansRho': '𝞠',
+    \ '\bisansvarTheta': '𝞡',
+    \ '\bisansSigma': '𝞢',
+    \ '\bisansTau': '𝞣',
+    \ '\bisansUpsilon': '𝞤',
+    \ '\bisansPhi': '𝞥',
+    \ '\bisansChi': '𝞦',
+    \ '\bisansPsi': '𝞧',
+    \ '\bisansOmega': '𝞨',
+    \ '\bisansnabla': '𝞩',
+    \ '\bisansalpha': '𝞪',
+    \ '\bisansbeta': '𝞫',
+    \ '\bisansgamma': '𝞬',
+    \ '\bisansdelta': '𝞭',
+    \ '\bisansepsilon': '𝞮',
+    \ '\bisanszeta': '𝞯',
+    \ '\bisanseta': '𝞰',
+    \ '\bisanstheta': '𝞱',
+    \ '\bisansiota': '𝞲',
+    \ '\bisanskappa': '𝞳',
+    \ '\bisanslambda': '𝞴',
+    \ '\bisansmu': '𝞵',
+    \ '\bisansnu': '𝞶',
+    \ '\bisansxi': '𝞷',
+    \ '\bisansomicron': '𝞸',
+    \ '\bisanspi': '𝞹',
+    \ '\bisansrho': '𝞺',
+    \ '\bisansvarsigma': '𝞻',
+    \ '\bisanssigma': '𝞼',
+    \ '\bisanstau': '𝞽',
+    \ '\bisansupsilon': '𝞾',
+    \ '\bisansphi': '𝞿',
+    \ '\bisanschi': '𝟀',
+    \ '\bisanspsi': '𝟁',
+    \ '\bisansomega': '𝟂',
+    \ '\bisanspartial': '𝟃',
+    \ '\bisansvarepsilon': '𝟄',
+    \ '\bisansvartheta': '𝟅',
+    \ '\bisansvarkappa': '𝟆',
+    \ '\bisansvarphi': '𝟇',
+    \ '\bisansvarrho': '𝟈',
+    \ '\bisansvarpi': '𝟉',
+    \ '\bfDigamma': '𝟊',
+    \ '\bfdigamma': '𝟋',
+    \ '\bfzero': '𝟎',
+    \ '\bfone': '𝟏',
+    \ '\bftwo': '𝟐',
+    \ '\bfthree': '𝟑',
+    \ '\bffour': '𝟒',
+    \ '\bffive': '𝟓',
+    \ '\bfsix': '𝟔',
+    \ '\bfseven': '𝟕',
+    \ '\bfeight': '𝟖',
+    \ '\bfnine': '𝟗',
+    \ '\bbzero': '𝟘',
+    \ '\bbone': '𝟙',
+    \ '\bbtwo': '𝟚',
+    \ '\bbthree': '𝟛',
+    \ '\bbfour': '𝟜',
+    \ '\bbfive': '𝟝',
+    \ '\bbsix': '𝟞',
+    \ '\bbseven': '𝟟',
+    \ '\bbeight': '𝟠',
+    \ '\bbnine': '𝟡',
+    \ '\sanszero': '𝟢',
+    \ '\sansone': '𝟣',
+    \ '\sanstwo': '𝟤',
+    \ '\sansthree': '𝟥',
+    \ '\sansfour': '𝟦',
+    \ '\sansfive': '𝟧',
+    \ '\sanssix': '𝟨',
+    \ '\sansseven': '𝟩',
+    \ '\sanseight': '𝟪',
+    \ '\sansnine': '𝟫',
+    \ '\bsanszero': '𝟬',
+    \ '\bsansone': '𝟭',
+    \ '\bsanstwo': '𝟮',
+    \ '\bsansthree': '𝟯',
+    \ '\bsansfour': '𝟰',
+    \ '\bsansfive': '𝟱',
+    \ '\bsanssix': '𝟲',
+    \ '\bsansseven': '𝟳',
+    \ '\bsanseight': '𝟴',
+    \ '\bsansnine': '𝟵',
+    \ '\ttzero': '𝟶',
+    \ '\ttone': '𝟷',
+    \ '\tttwo': '𝟸',
+    \ '\ttthree': '𝟹',
+    \ '\ttfour': '𝟺',
+    \ '\ttfive': '𝟻',
+    \ '\ttsix': '𝟼',
+    \ '\ttseven': '𝟽',
+    \ '\tteight': '𝟾',
+    \ '\ttnine': '𝟿',
+    \ '\:mahjong:': '🀄',
+    \ '\:black_joker:': '🃏',
+    \ '\:a:': '🅰',
+    \ '\:b:': '🅱',
+    \ '\:o2:': '🅾',
+    \ '\:parking:': '🅿',
+    \ '\:ab:': '🆎',
+    \ '\:cl:': '🆑',
+    \ '\:cool:': '🆒',
+    \ '\:free:': '🆓',
+    \ '\:id:': '🆔',
+    \ '\:new:': '🆕',
+    \ '\:ng:': '🆖',
+    \ '\:ok:': '🆗',
+    \ '\:sos:': '🆘',
+    \ '\:up:': '🆙',
+    \ '\:vs:': '🆚',
+    \ '\:koko:': '🈁',
+    \ '\:sa:': '🈂',
+    \ '\:u7121:': '🈚',
+    \ '\:u6307:': '🈯',
+    \ '\:u7981:': '🈲',
+    \ '\:u7a7a:': '🈳',
+    \ '\:u5408:': '🈴',
+    \ '\:u6e80:': '🈵',
+    \ '\:u6709:': '🈶',
+    \ '\:u6708:': '🈷',
+    \ '\:u7533:': '🈸',
+    \ '\:u5272:': '🈹',
+    \ '\:u55b6:': '🈺',
+    \ '\:ideograph_advantage:': '🉐',
+    \ '\:accept:': '🉑',
+    \ '\:cyclone:': '🌀',
+    \ '\:foggy:': '🌁',
+    \ '\:closed_umbrella:': '🌂',
+    \ '\:night_with_stars:': '🌃',
+    \ '\:sunrise_over_mountains:': '🌄',
+    \ '\:sunrise:': '🌅',
+    \ '\:city_sunset:': '🌆',
+    \ '\:city_sunrise:': '🌇',
+    \ '\:rainbow:': '🌈',
+    \ '\:bridge_at_night:': '🌉',
+    \ '\:ocean:': '🌊',
+    \ '\:volcano:': '🌋',
+    \ '\:milky_way:': '🌌',
+    \ '\:earth_africa:': '🌍',
+    \ '\:earth_americas:': '🌎',
+    \ '\:earth_asia:': '🌏',
+    \ '\:globe_with_meridians:': '🌐',
+    \ '\:new_moon:': '🌑',
+    \ '\:waxing_crescent_moon:': '🌒',
+    \ '\:first_quarter_moon:': '🌓',
+    \ '\:moon:': '🌔',
+    \ '\:full_moon:': '🌕',
+    \ '\:waning_gibbous_moon:': '🌖',
+    \ '\:last_quarter_moon:': '🌗',
+    \ '\:waning_crescent_moon:': '🌘',
+    \ '\:crescent_moon:': '🌙',
+    \ '\:new_moon_with_face:': '🌚',
+    \ '\:first_quarter_moon_with_face:': '🌛',
+    \ '\:last_quarter_moon_with_face:': '🌜',
+    \ '\:full_moon_with_face:': '🌝',
+    \ '\:sun_with_face:': '🌞',
+    \ '\:star2:': '🌟',
+    \ '\:stars:': '🌠',
+    \ '\:chestnut:': '🌰',
+    \ '\:seedling:': '🌱',
+    \ '\:evergreen_tree:': '🌲',
+    \ '\:deciduous_tree:': '🌳',
+    \ '\:palm_tree:': '🌴',
+    \ '\:cactus:': '🌵',
+    \ '\:tulip:': '🌷',
+    \ '\:cherry_blossom:': '🌸',
+    \ '\:rose:': '🌹',
+    \ '\:hibiscus:': '🌺',
+    \ '\:sunflower:': '🌻',
+    \ '\:blossom:': '🌼',
+    \ '\:corn:': '🌽',
+    \ '\:ear_of_rice:': '🌾',
+    \ '\:herb:': '🌿',
+    \ '\:four_leaf_clover:': '🍀',
+    \ '\:maple_leaf:': '🍁',
+    \ '\:fallen_leaf:': '🍂',
+    \ '\:leaves:': '🍃',
+    \ '\:mushroom:': '🍄',
+    \ '\:tomato:': '🍅',
+    \ '\:eggplant:': '🍆',
+    \ '\:grapes:': '🍇',
+    \ '\:melon:': '🍈',
+    \ '\:watermelon:': '🍉',
+    \ '\:tangerine:': '🍊',
+    \ '\:lemon:': '🍋',
+    \ '\:banana:': '🍌',
+    \ '\:pineapple:': '🍍',
+    \ '\:apple:': '🍎',
+    \ '\:green_apple:': '🍏',
+    \ '\:pear:': '🍐',
+    \ '\:peach:': '🍑',
+    \ '\:cherries:': '🍒',
+    \ '\:strawberry:': '🍓',
+    \ '\:hamburger:': '🍔',
+    \ '\:pizza:': '🍕',
+    \ '\:meat_on_bone:': '🍖',
+    \ '\:poultry_leg:': '🍗',
+    \ '\:rice_cracker:': '🍘',
+    \ '\:rice_ball:': '🍙',
+    \ '\:rice:': '🍚',
+    \ '\:curry:': '🍛',
+    \ '\:ramen:': '🍜',
+    \ '\:spaghetti:': '🍝',
+    \ '\:bread:': '🍞',
+    \ '\:fries:': '🍟',
+    \ '\:sweet_potato:': '🍠',
+    \ '\:dango:': '🍡',
+    \ '\:oden:': '🍢',
+    \ '\:sushi:': '🍣',
+    \ '\:fried_shrimp:': '🍤',
+    \ '\:fish_cake:': '🍥',
+    \ '\:icecream:': '🍦',
+    \ '\:shaved_ice:': '🍧',
+    \ '\:ice_cream:': '🍨',
+    \ '\:doughnut:': '🍩',
+    \ '\:cookie:': '🍪',
+    \ '\:chocolate_bar:': '🍫',
+    \ '\:candy:': '🍬',
+    \ '\:lollipop:': '🍭',
+    \ '\:custard:': '🍮',
+    \ '\:honey_pot:': '🍯',
+    \ '\:cake:': '🍰',
+    \ '\:bento:': '🍱',
+    \ '\:stew:': '🍲',
+    \ '\:egg:': '🍳',
+    \ '\:fork_and_knife:': '🍴',
+    \ '\:tea:': '🍵',
+    \ '\:sake:': '🍶',
+    \ '\:wine_glass:': '🍷',
+    \ '\:cocktail:': '🍸',
+    \ '\:tropical_drink:': '🍹',
+    \ '\:beer:': '🍺',
+    \ '\:beers:': '🍻',
+    \ '\:baby_bottle:': '🍼',
+    \ '\:ribbon:': '🎀',
+    \ '\:gift:': '🎁',
+    \ '\:birthday:': '🎂',
+    \ '\:jack_o_lantern:': '🎃',
+    \ '\:christmas_tree:': '🎄',
+    \ '\:santa:': '🎅',
+    \ '\:fireworks:': '🎆',
+    \ '\:sparkler:': '🎇',
+    \ '\:balloon:': '🎈',
+    \ '\:tada:': '🎉',
+    \ '\:confetti_ball:': '🎊',
+    \ '\:tanabata_tree:': '🎋',
+    \ '\:crossed_flags:': '🎌',
+    \ '\:bamboo:': '🎍',
+    \ '\:dolls:': '🎎',
+    \ '\:flags:': '🎏',
+    \ '\:wind_chime:': '🎐',
+    \ '\:rice_scene:': '🎑',
+    \ '\:school_satchel:': '🎒',
+    \ '\:mortar_board:': '🎓',
+    \ '\:carousel_horse:': '🎠',
+    \ '\:ferris_wheel:': '🎡',
+    \ '\:roller_coaster:': '🎢',
+    \ '\:fishing_pole_and_fish:': '🎣',
+    \ '\:microphone:': '🎤',
+    \ '\:movie_camera:': '🎥',
+    \ '\:cinema:': '🎦',
+    \ '\:headphones:': '🎧',
+    \ '\:art:': '🎨',
+    \ '\:tophat:': '🎩',
+    \ '\:circus_tent:': '🎪',
+    \ '\:ticket:': '🎫',
+    \ '\:clapper:': '🎬',
+    \ '\:performing_arts:': '🎭',
+    \ '\:video_game:': '🎮',
+    \ '\:dart:': '🎯',
+    \ '\:slot_machine:': '🎰',
+    \ '\:8ball:': '🎱',
+    \ '\:game_die:': '🎲',
+    \ '\:bowling:': '🎳',
+    \ '\:flower_playing_cards:': '🎴',
+    \ '\:musical_note:': '🎵',
+    \ '\:notes:': '🎶',
+    \ '\:saxophone:': '🎷',
+    \ '\:guitar:': '🎸',
+    \ '\:musical_keyboard:': '🎹',
+    \ '\:trumpet:': '🎺',
+    \ '\:violin:': '🎻',
+    \ '\:musical_score:': '🎼',
+    \ '\:running_shirt_with_sash:': '🎽',
+    \ '\:tennis:': '🎾',
+    \ '\:ski:': '🎿',
+    \ '\:basketball:': '🏀',
+    \ '\:checkered_flag:': '🏁',
+    \ '\:snowboarder:': '🏂',
+    \ '\:runner:': '🏃',
+    \ '\:surfer:': '🏄',
+    \ '\:trophy:': '🏆',
+    \ '\:horse_racing:': '🏇',
+    \ '\:football:': '🏈',
+    \ '\:rugby_football:': '🏉',
+    \ '\:swimmer:': '🏊',
+    \ '\:house:': '🏠',
+    \ '\:house_with_garden:': '🏡',
+    \ '\:office:': '🏢',
+    \ '\:post_office:': '🏣',
+    \ '\:european_post_office:': '🏤',
+    \ '\:hospital:': '🏥',
+    \ '\:bank:': '🏦',
+    \ '\:atm:': '🏧',
+    \ '\:hotel:': '🏨',
+    \ '\:love_hotel:': '🏩',
+    \ '\:convenience_store:': '🏪',
+    \ '\:school:': '🏫',
+    \ '\:department_store:': '🏬',
+    \ '\:factory:': '🏭',
+    \ '\:izakaya_lantern:': '🏮',
+    \ '\:japanese_castle:': '🏯',
+    \ '\:european_castle:': '🏰',
+    \ '\:skin-tone-2:': '🏻',
+    \ '\:skin-tone-3:': '🏼',
+    \ '\:skin-tone-4:': '🏽',
+    \ '\:skin-tone-5:': '🏾',
+    \ '\:skin-tone-6:': '🏿',
+    \ '\:rat:': '🐀',
+    \ '\:mouse2:': '🐁',
+    \ '\:ox:': '🐂',
+    \ '\:water_buffalo:': '🐃',
+    \ '\:cow2:': '🐄',
+    \ '\:tiger2:': '🐅',
+    \ '\:leopard:': '🐆',
+    \ '\:rabbit2:': '🐇',
+    \ '\:cat2:': '🐈',
+    \ '\:dragon:': '🐉',
+    \ '\:crocodile:': '🐊',
+    \ '\:whale2:': '🐋',
+    \ '\:snail:': '🐌',
+    \ '\:snake:': '🐍',
+    \ '\:racehorse:': '🐎',
+    \ '\:ram:': '🐏',
+    \ '\:goat:': '🐐',
+    \ '\:sheep:': '🐑',
+    \ '\:monkey:': '🐒',
+    \ '\:rooster:': '🐓',
+    \ '\:chicken:': '🐔',
+    \ '\:dog2:': '🐕',
+    \ '\:pig2:': '🐖',
+    \ '\:boar:': '🐗',
+    \ '\:elephant:': '🐘',
+    \ '\:octopus:': '🐙',
+    \ '\:shell:': '🐚',
+    \ '\:bug:': '🐛',
+    \ '\:ant:': '🐜',
+    \ '\:bee:': '🐝',
+    \ '\:beetle:': '🐞',
+    \ '\:fish:': '🐟',
+    \ '\:tropical_fish:': '🐠',
+    \ '\:blowfish:': '🐡',
+    \ '\:turtle:': '🐢',
+    \ '\:hatching_chick:': '🐣',
+    \ '\:baby_chick:': '🐤',
+    \ '\:hatched_chick:': '🐥',
+    \ '\:bird:': '🐦',
+    \ '\:penguin:': '🐧',
+    \ '\:koala:': '🐨',
+    \ '\:poodle:': '🐩',
+    \ '\:dromedary_camel:': '🐪',
+    \ '\:camel:': '🐫',
+    \ '\:dolphin:': '🐬',
+    \ '\:mouse:': '🐭',
+    \ '\:cow:': '🐮',
+    \ '\:tiger:': '🐯',
+    \ '\:rabbit:': '🐰',
+    \ '\:cat:': '🐱',
+    \ '\:dragon_face:': '🐲',
+    \ '\:whale:': '🐳',
+    \ '\:horse:': '🐴',
+    \ '\:monkey_face:': '🐵',
+    \ '\:dog:': '🐶',
+    \ '\:pig:': '🐷',
+    \ '\:frog:': '🐸',
+    \ '\:hamster:': '🐹',
+    \ '\:wolf:': '🐺',
+    \ '\:bear:': '🐻',
+    \ '\:panda_face:': '🐼',
+    \ '\:pig_nose:': '🐽',
+    \ '\:feet:': '🐾',
+    \ '\:eyes:': '👀',
+    \ '\:ear:': '👂',
+    \ '\:nose:': '👃',
+    \ '\:lips:': '👄',
+    \ '\:tongue:': '👅',
+    \ '\:point_up_2:': '👆',
+    \ '\:point_down:': '👇',
+    \ '\:point_left:': '👈',
+    \ '\:point_right:': '👉',
+    \ '\:facepunch:': '👊',
+    \ '\:wave:': '👋',
+    \ '\:ok_hand:': '👌',
+    \ '\:+1:': '👍',
+    \ '\:-1:': '👎',
+    \ '\:clap:': '👏',
+    \ '\:open_hands:': '👐',
+    \ '\:crown:': '👑',
+    \ '\:womans_hat:': '👒',
+    \ '\:eyeglasses:': '👓',
+    \ '\:necktie:': '👔',
+    \ '\:shirt:': '👕',
+    \ '\:jeans:': '👖',
+    \ '\:dress:': '👗',
+    \ '\:kimono:': '👘',
+    \ '\:bikini:': '👙',
+    \ '\:womans_clothes:': '👚',
+    \ '\:purse:': '👛',
+    \ '\:handbag:': '👜',
+    \ '\:pouch:': '👝',
+    \ '\:mans_shoe:': '👞',
+    \ '\:athletic_shoe:': '👟',
+    \ '\:high_heel:': '👠',
+    \ '\:sandal:': '👡',
+    \ '\:boot:': '👢',
+    \ '\:footprints:': '👣',
+    \ '\:bust_in_silhouette:': '👤',
+    \ '\:busts_in_silhouette:': '👥',
+    \ '\:boy:': '👦',
+    \ '\:girl:': '👧',
+    \ '\:man:': '👨',
+    \ '\:woman:': '👩',
+    \ '\:family:': '👪',
+    \ '\:couple:': '👫',
+    \ '\:two_men_holding_hands:': '👬',
+    \ '\:two_women_holding_hands:': '👭',
+    \ '\:cop:': '👮',
+    \ '\:dancers:': '👯',
+    \ '\:bride_with_veil:': '👰',
+    \ '\:person_with_blond_hair:': '👱',
+    \ '\:man_with_gua_pi_mao:': '👲',
+    \ '\:man_with_turban:': '👳',
+    \ '\:older_man:': '👴',
+    \ '\:older_woman:': '👵',
+    \ '\:baby:': '👶',
+    \ '\:construction_worker:': '👷',
+    \ '\:princess:': '👸',
+    \ '\:japanese_ogre:': '👹',
+    \ '\:japanese_goblin:': '👺',
+    \ '\:ghost:': '👻',
+    \ '\:angel:': '👼',
+    \ '\:alien:': '👽',
+    \ '\:space_invader:': '👾',
+    \ '\:imp:': '👿',
+    \ '\:skull:': '💀',
+    \ '\:information_desk_person:': '💁',
+    \ '\:guardsman:': '💂',
+    \ '\:dancer:': '💃',
+    \ '\:lipstick:': '💄',
+    \ '\:nail_care:': '💅',
+    \ '\:massage:': '💆',
+    \ '\:haircut:': '💇',
+    \ '\:barber:': '💈',
+    \ '\:syringe:': '💉',
+    \ '\:pill:': '💊',
+    \ '\:kiss:': '💋',
+    \ '\:love_letter:': '💌',
+    \ '\:ring:': '💍',
+    \ '\:gem:': '💎',
+    \ '\:couplekiss:': '💏',
+    \ '\:bouquet:': '💐',
+    \ '\:couple_with_heart:': '💑',
+    \ '\:wedding:': '💒',
+    \ '\:heartbeat:': '💓',
+    \ '\:broken_heart:': '💔',
+    \ '\:two_hearts:': '💕',
+    \ '\:sparkling_heart:': '💖',
+    \ '\:heartpulse:': '💗',
+    \ '\:cupid:': '💘',
+    \ '\:blue_heart:': '💙',
+    \ '\:green_heart:': '💚',
+    \ '\:yellow_heart:': '💛',
+    \ '\:purple_heart:': '💜',
+    \ '\:gift_heart:': '💝',
+    \ '\:revolving_hearts:': '💞',
+    \ '\:heart_decoration:': '💟',
+    \ '\:diamond_shape_with_a_dot_inside:': '💠',
+    \ '\:bulb:': '💡',
+    \ '\:anger:': '💢',
+    \ '\:bomb:': '💣',
+    \ '\:zzz:': '💤',
+    \ '\:boom:': '💥',
+    \ '\:sweat_drops:': '💦',
+    \ '\:droplet:': '💧',
+    \ '\:dash:': '💨',
+    \ '\:hankey:': '💩',
+    \ '\:muscle:': '💪',
+    \ '\:dizzy:': '💫',
+    \ '\:speech_balloon:': '💬',
+    \ '\:thought_balloon:': '💭',
+    \ '\:white_flower:': '💮',
+    \ '\:100:': '💯',
+    \ '\:moneybag:': '💰',
+    \ '\:currency_exchange:': '💱',
+    \ '\:heavy_dollar_sign:': '💲',
+    \ '\:credit_card:': '💳',
+    \ '\:yen:': '💴',
+    \ '\:dollar:': '💵',
+    \ '\:euro:': '💶',
+    \ '\:pound:': '💷',
+    \ '\:money_with_wings:': '💸',
+    \ '\:chart:': '💹',
+    \ '\:seat:': '💺',
+    \ '\:computer:': '💻',
+    \ '\:briefcase:': '💼',
+    \ '\:minidisc:': '💽',
+    \ '\:floppy_disk:': '💾',
+    \ '\:cd:': '💿',
+    \ '\:dvd:': '📀',
+    \ '\:file_folder:': '📁',
+    \ '\:open_file_folder:': '📂',
+    \ '\:page_with_curl:': '📃',
+    \ '\:page_facing_up:': '📄',
+    \ '\:date:': '📅',
+    \ '\:calendar:': '📆',
+    \ '\:card_index:': '📇',
+    \ '\:chart_with_upwards_trend:': '📈',
+    \ '\:chart_with_downwards_trend:': '📉',
+    \ '\:bar_chart:': '📊',
+    \ '\:clipboard:': '📋',
+    \ '\:pushpin:': '📌',
+    \ '\:round_pushpin:': '📍',
+    \ '\:paperclip:': '📎',
+    \ '\:straight_ruler:': '📏',
+    \ '\:triangular_ruler:': '📐',
+    \ '\:bookmark_tabs:': '📑',
+    \ '\:ledger:': '📒',
+    \ '\:notebook:': '📓',
+    \ '\:notebook_with_decorative_cover:': '📔',
+    \ '\:closed_book:': '📕',
+    \ '\:book:': '📖',
+    \ '\:green_book:': '📗',
+    \ '\:blue_book:': '📘',
+    \ '\:orange_book:': '📙',
+    \ '\:books:': '📚',
+    \ '\:name_badge:': '📛',
+    \ '\:scroll:': '📜',
+    \ '\:memo:': '📝',
+    \ '\:telephone_receiver:': '📞',
+    \ '\:pager:': '📟',
+    \ '\:fax:': '📠',
+    \ '\:satellite:': '📡',
+    \ '\:loudspeaker:': '📢',
+    \ '\:mega:': '📣',
+    \ '\:outbox_tray:': '📤',
+    \ '\:inbox_tray:': '📥',
+    \ '\:package:': '📦',
+    \ '\:e-mail:': '📧',
+    \ '\:incoming_envelope:': '📨',
+    \ '\:envelope_with_arrow:': '📩',
+    \ '\:mailbox_closed:': '📪',
+    \ '\:mailbox:': '📫',
+    \ '\:mailbox_with_mail:': '📬',
+    \ '\:mailbox_with_no_mail:': '📭',
+    \ '\:postbox:': '📮',
+    \ '\:postal_horn:': '📯',
+    \ '\:newspaper:': '📰',
+    \ '\:iphone:': '📱',
+    \ '\:calling:': '📲',
+    \ '\:vibration_mode:': '📳',
+    \ '\:mobile_phone_off:': '📴',
+    \ '\:no_mobile_phones:': '📵',
+    \ '\:signal_strength:': '📶',
+    \ '\:camera:': '📷',
+    \ '\:video_camera:': '📹',
+    \ '\:tv:': '📺',
+    \ '\:radio:': '📻',
+    \ '\:vhs:': '📼',
+    \ '\:twisted_rightwards_arrows:': '🔀',
+    \ '\:repeat:': '🔁',
+    \ '\:repeat_one:': '🔂',
+    \ '\:arrows_clockwise:': '🔃',
+    \ '\:arrows_counterclockwise:': '🔄',
+    \ '\:low_brightness:': '🔅',
+    \ '\:high_brightness:': '🔆',
+    \ '\:mute:': '🔇',
+    \ '\:speaker:': '🔈',
+    \ '\:sound:': '🔉',
+    \ '\:loud_sound:': '🔊',
+    \ '\:battery:': '🔋',
+    \ '\:electric_plug:': '🔌',
+    \ '\:mag:': '🔍',
+    \ '\:mag_right:': '🔎',
+    \ '\:lock_with_ink_pen:': '🔏',
+    \ '\:closed_lock_with_key:': '🔐',
+    \ '\:key:': '🔑',
+    \ '\:lock:': '🔒',
+    \ '\:unlock:': '🔓',
+    \ '\:bell:': '🔔',
+    \ '\:no_bell:': '🔕',
+    \ '\:bookmark:': '🔖',
+    \ '\:link:': '🔗',
+    \ '\:radio_button:': '🔘',
+    \ '\:back:': '🔙',
+    \ '\:end:': '🔚',
+    \ '\:on:': '🔛',
+    \ '\:soon:': '🔜',
+    \ '\:top:': '🔝',
+    \ '\:underage:': '🔞',
+    \ '\:keycap_ten:': '🔟',
+    \ '\:capital_abcd:': '🔠',
+    \ '\:abcd:': '🔡',
+    \ '\:1234:': '🔢',
+    \ '\:symbols:': '🔣',
+    \ '\:abc:': '🔤',
+    \ '\:fire:': '🔥',
+    \ '\:flashlight:': '🔦',
+    \ '\:wrench:': '🔧',
+    \ '\:hammer:': '🔨',
+    \ '\:nut_and_bolt:': '🔩',
+    \ '\:hocho:': '🔪',
+    \ '\:gun:': '🔫',
+    \ '\:microscope:': '🔬',
+    \ '\:telescope:': '🔭',
+    \ '\:crystal_ball:': '🔮',
+    \ '\:six_pointed_star:': '🔯',
+    \ '\:beginner:': '🔰',
+    \ '\:trident:': '🔱',
+    \ '\:black_square_button:': '🔲',
+    \ '\:white_square_button:': '🔳',
+    \ '\:red_circle:': '🔴',
+    \ '\:large_blue_circle:': '🔵',
+    \ '\:large_orange_diamond:': '🔶',
+    \ '\:large_blue_diamond:': '🔷',
+    \ '\:small_orange_diamond:': '🔸',
+    \ '\:small_blue_diamond:': '🔹',
+    \ '\:small_red_triangle:': '🔺',
+    \ '\:small_red_triangle_down:': '🔻',
+    \ '\:arrow_up_small:': '🔼',
+    \ '\:arrow_down_small:': '🔽',
+    \ '\:clock1:': '🕐',
+    \ '\:clock2:': '🕑',
+    \ '\:clock3:': '🕒',
+    \ '\:clock4:': '🕓',
+    \ '\:clock5:': '🕔',
+    \ '\:clock6:': '🕕',
+    \ '\:clock7:': '🕖',
+    \ '\:clock8:': '🕗',
+    \ '\:clock9:': '🕘',
+    \ '\:clock10:': '🕙',
+    \ '\:clock11:': '🕚',
+    \ '\:clock12:': '🕛',
+    \ '\:clock130:': '🕜',
+    \ '\:clock230:': '🕝',
+    \ '\:clock330:': '🕞',
+    \ '\:clock430:': '🕟',
+    \ '\:clock530:': '🕠',
+    \ '\:clock630:': '🕡',
+    \ '\:clock730:': '🕢',
+    \ '\:clock830:': '🕣',
+    \ '\:clock930:': '🕤',
+    \ '\:clock1030:': '🕥',
+    \ '\:clock1130:': '🕦',
+    \ '\:clock1230:': '🕧',
+    \ '\:mount_fuji:': '🗻',
+    \ '\:tokyo_tower:': '🗼',
+    \ '\:statue_of_liberty:': '🗽',
+    \ '\:japan:': '🗾',
+    \ '\:moyai:': '🗿',
+    \ '\:grinning:': '😀',
+    \ '\:grin:': '😁',
+    \ '\:joy:': '😂',
+    \ '\:smiley:': '😃',
+    \ '\:smile:': '😄',
+    \ '\:sweat_smile:': '😅',
+    \ '\:laughing:': '😆',
+    \ '\:innocent:': '😇',
+    \ '\:smiling_imp:': '😈',
+    \ '\:wink:': '😉',
+    \ '\:blush:': '😊',
+    \ '\:yum:': '😋',
+    \ '\:relieved:': '😌',
+    \ '\:heart_eyes:': '😍',
+    \ '\:sunglasses:': '😎',
+    \ '\:smirk:': '😏',
+    \ '\:neutral_face:': '😐',
+    \ '\:expressionless:': '😑',
+    \ '\:unamused:': '😒',
+    \ '\:sweat:': '😓',
+    \ '\:pensive:': '😔',
+    \ '\:confused:': '😕',
+    \ '\:confounded:': '😖',
+    \ '\:kissing:': '😗',
+    \ '\:kissing_heart:': '😘',
+    \ '\:kissing_smiling_eyes:': '😙',
+    \ '\:kissing_closed_eyes:': '😚',
+    \ '\:stuck_out_tongue:': '😛',
+    \ '\:stuck_out_tongue_winking_eye:': '😜',
+    \ '\:stuck_out_tongue_closed_eyes:': '😝',
+    \ '\:disappointed:': '😞',
+    \ '\:worried:': '😟',
+    \ '\:angry:': '😠',
+    \ '\:rage:': '😡',
+    \ '\:cry:': '😢',
+    \ '\:persevere:': '😣',
+    \ '\:triumph:': '😤',
+    \ '\:disappointed_relieved:': '😥',
+    \ '\:frowning:': '😦',
+    \ '\:anguished:': '😧',
+    \ '\:fearful:': '😨',
+    \ '\:weary:': '😩',
+    \ '\:sleepy:': '😪',
+    \ '\:tired_face:': '😫',
+    \ '\:grimacing:': '😬',
+    \ '\:sob:': '😭',
+    \ '\:open_mouth:': '😮',
+    \ '\:hushed:': '😯',
+    \ '\:cold_sweat:': '😰',
+    \ '\:scream:': '😱',
+    \ '\:astonished:': '😲',
+    \ '\:flushed:': '😳',
+    \ '\:sleeping:': '😴',
+    \ '\:dizzy_face:': '😵',
+    \ '\:no_mouth:': '😶',
+    \ '\:mask:': '😷',
+    \ '\:smile_cat:': '😸',
+    \ '\:joy_cat:': '😹',
+    \ '\:smiley_cat:': '😺',
+    \ '\:heart_eyes_cat:': '😻',
+    \ '\:smirk_cat:': '😼',
+    \ '\:kissing_cat:': '😽',
+    \ '\:pouting_cat:': '😾',
+    \ '\:crying_cat_face:': '😿',
+    \ '\:scream_cat:': '🙀',
+    \ '\:no_good:': '🙅',
+    \ '\:ok_woman:': '🙆',
+    \ '\:bow:': '🙇',
+    \ '\:see_no_evil:': '🙈',
+    \ '\:hear_no_evil:': '🙉',
+    \ '\:speak_no_evil:': '🙊',
+    \ '\:raising_hand:': '🙋',
+    \ '\:raised_hands:': '🙌',
+    \ '\:person_frowning:': '🙍',
+    \ '\:person_with_pouting_face:': '🙎',
+    \ '\:pray:': '🙏',
+    \ '\:rocket:': '🚀',
+    \ '\:helicopter:': '🚁',
+    \ '\:steam_locomotive:': '🚂',
+    \ '\:railway_car:': '🚃',
+    \ '\:bullettrain_side:': '🚄',
+    \ '\:bullettrain_front:': '🚅',
+    \ '\:train2:': '🚆',
+    \ '\:metro:': '🚇',
+    \ '\:light_rail:': '🚈',
+    \ '\:station:': '🚉',
+    \ '\:tram:': '🚊',
+    \ '\:train:': '🚋',
+    \ '\:bus:': '🚌',
+    \ '\:oncoming_bus:': '🚍',
+    \ '\:trolleybus:': '🚎',
+    \ '\:busstop:': '🚏',
+    \ '\:minibus:': '🚐',
+    \ '\:ambulance:': '🚑',
+    \ '\:fire_engine:': '🚒',
+    \ '\:police_car:': '🚓',
+    \ '\:oncoming_police_car:': '🚔',
+    \ '\:taxi:': '🚕',
+    \ '\:oncoming_taxi:': '🚖',
+    \ '\:car:': '🚗',
+    \ '\:oncoming_automobile:': '🚘',
+    \ '\:blue_car:': '🚙',
+    \ '\:truck:': '🚚',
+    \ '\:articulated_lorry:': '🚛',
+    \ '\:tractor:': '🚜',
+    \ '\:monorail:': '🚝',
+    \ '\:mountain_railway:': '🚞',
+    \ '\:suspension_railway:': '🚟',
+    \ '\:mountain_cableway:': '🚠',
+    \ '\:aerial_tramway:': '🚡',
+    \ '\:ship:': '🚢',
+    \ '\:rowboat:': '🚣',
+    \ '\:speedboat:': '🚤',
+    \ '\:traffic_light:': '🚥',
+    \ '\:vertical_traffic_light:': '🚦',
+    \ '\:construction:': '🚧',
+    \ '\:rotating_light:': '🚨',
+    \ '\:triangular_flag_on_post:': '🚩',
+    \ '\:door:': '🚪',
+    \ '\:no_entry_sign:': '🚫',
+    \ '\:smoking:': '🚬',
+    \ '\:no_smoking:': '🚭',
+    \ '\:put_litter_in_its_place:': '🚮',
+    \ '\:do_not_litter:': '🚯',
+    \ '\:potable_water:': '🚰',
+    \ '\:non-potable_water:': '🚱',
+    \ '\:bike:': '🚲',
+    \ '\:no_bicycles:': '🚳',
+    \ '\:bicyclist:': '🚴',
+    \ '\:mountain_bicyclist:': '🚵',
+    \ '\:walking:': '🚶',
+    \ '\:no_pedestrians:': '🚷',
+    \ '\:children_crossing:': '🚸',
+    \ '\:mens:': '🚹',
+    \ '\:womens:': '🚺',
+    \ '\:restroom:': '🚻',
+    \ '\:baby_symbol:': '🚼',
+    \ '\:toilet:': '🚽',
+    \ '\:wc:': '🚾',
+    \ '\:shower:': '🚿',
+    \ '\:bath:': '🛀',
+    \ '\:bathtub:': '🛁',
+    \ '\:passport_control:': '🛂',
+    \ '\:customs:': '🛃',
+    \ '\:baggage_claim:': '🛄',
+    \ '\:left_luggage:': '🛅'}
+endfunction
Index: /issm/trunk/externalpackages/vim/addons/vim/doc/generate_latex_symbols_table.jl
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/doc/generate_latex_symbols_table.jl	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/doc/generate_latex_symbols_table.jl	(revision 26744)
@@ -0,0 +1,111 @@
+#!/bin/env julia
+
+const filename = "julia-vim-L2U-table"
+
+# Keeping this from an old revision, just in case:
+# Combining chars ranges, as obtained from https://en.wikipedia.org/wiki/Combining_character:
+# ('\u0300' ≤ u ≤ '\u036F') ||
+# ('\u1AB0' ≤ u ≤ '\u1AFF') ||
+# ('\u1DC0' ≤ u ≤ '\u1DFF') ||
+# ('\u20D0' ≤ u ≤ '\u20FF') ||
+# ('\uFE20' ≤ u ≤ '\uFE2F')
+
+# Most of this code is copy-pasted and slightly adapted from here:
+# JULIA_HOME/doc/src/manual/unicode-input.md
+# except that instead of producing Markdown we want to generate a vim
+# documentation file.
+#
+# Note that this requires to run `make docs` from the julia source root directory to download
+# the UnicodeData.txt file.
+
+function tab_completions(symbols...)
+    completions = Dict{String, Vector{String}}()
+    for each in symbols, (k, v) in each
+        completions[v] = push!(get!(completions, v, String[]), k)
+    end
+    return completions
+end
+
+function unicode_data()
+    file = normpath(Sys.BINDIR, "..", "..", "doc", "UnicodeData.txt")
+    names = Dict{UInt32, String}()
+    open(file) do unidata
+        for line in readlines(unidata)
+            id, name, desc = split(line, ";")[[1, 2, 11]]
+            codepoint = parse(UInt32, "0x$id")
+            names[codepoint] = (name == "" ? desc : desc == "" ? name : "$name / $desc")
+        end
+    end
+    return names
+end
+
+# Prepend a dotted circle ('◌' i.e. '\u25CC') to combining characters
+function fix_combining_chars(char)
+    cat = Base.Unicode.category_code(char)
+    return string(cat == 6 || cat == 8 ? "◌" : "", char)
+end
+
+function table_entries(completions, unicode_dict)
+    code = String[]
+    unicode = String[]
+    latex = String[]
+    desc = String[]
+
+    for (chars, inputs) in sort!(collect(completions), by = first)
+        code_points, unicode_names, characters = String[], String[], String[]
+        for char in chars
+            push!(code_points, "U+$(uppercase(string(UInt32(char), base = 16, pad = 5)))")
+            push!(unicode_names, get(unicode_dict, UInt32(char), "(No Unicode name)"))
+            push!(characters, isempty(characters) ? fix_combining_chars(char) : "$char")
+        end
+        push!(code, join(code_points, " + "))
+        push!(unicode, join(characters))
+        push!(latex, replace(join(inputs, ", "), "\\\\" => "\\"))
+        push!(desc, join(unicode_names, " + "))
+    end
+    return code, unicode, latex, desc
+end
+
+open("$filename.txt","w") do f
+    print(f, """
+        $filename.txt  LaTeX-to-Unicode reference table
+
+        ===================================================================
+        LATEX-TO-UNICODE REFERENCE TABLE    *L2U-ref* *julia-vim-L2U-reference*
+
+          Note: This file is autogenerated from the script '$(basename(Base.source_path()))'
+          The symbols are based on the documentation of Julia version $VERSION
+          See |julia-vim| for the LaTeX-to-Unicode manual.
+
+        """)
+
+    col_headers = ["Code point(s)", "Character(s)", "Tab completion sequence(s)", "Unicode name(s)"]
+
+    code, unicode, latex, desc =
+        table_entries(
+            tab_completions(
+                REPL.REPLCompletions.latex_symbols,
+                REPL.REPLCompletions.emoji_symbols
+                ),
+            unicode_data()
+            )
+
+    cw = max(length(col_headers[1]), maximum(map(length, code)))
+    uw = max(length(col_headers[2]), maximum(map(length, unicode)))
+    lw = max(length(col_headers[3]), maximum(map(length, latex)))
+    dw = max(length(col_headers[4]), maximum(map(length, desc)))
+
+    print_padded(c, u, l, d) = println(f, rpad(c, cw), " ", rpad(u, uw), " ", rpad(l, lw), " ", d)
+
+    print_padded(col_headers[1:3]..., col_headers[4] * "~")
+    print_padded("-"^cw, "-"^uw, "-"^lw, "-"^dw)
+
+    for (c, u, l, d) in zip(code, unicode, latex, desc)
+        print_padded(c, u, l, d)
+    end
+    print_padded("-"^cw, "-"^uw, "-"^lw, "-"^dw)
+
+    println(f)
+    println(f, "  vim", # separated to avoid an error from vim which otherwise tries to parse this line
+               ":tw=$(cw+uw+lw+dw+3):et:ft=help:norl:")
+end
Index: /issm/trunk/externalpackages/vim/addons/vim/doc/julia-vim-L2U-table.txt
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/doc/julia-vim-L2U-table.txt	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/doc/julia-vim-L2U-table.txt	(revision 26744)
@@ -0,0 +1,3278 @@
+julia-vim-L2U-table.txt  LaTeX-to-Unicode reference table
+
+===================================================================
+LATEX-TO-UNICODE REFERENCE TABLE    *L2U-ref* *julia-vim-L2U-reference*
+
+  Note: This file is autogenerated from the script 'generate_latex_symbols_table.jl'
+  The symbols are based on the documentation of Julia version 1.5.0-DEV.67
+  See |julia-vim| for the LaTeX-to-Unicode manual.
+
+Code point(s)     Character(s) Tab completion sequence(s)                   Unicode name(s)~
+----------------- ------------ -------------------------------------------- --------------------------------------------------------------------------------------------------------
+U+000A1           ¡            \exclamdown                                  INVERTED EXCLAMATION MARK
+U+000A3           £            \sterling                                    POUND SIGN
+U+000A5           ¥            \yen                                         YEN SIGN
+U+000A6           ¦            \brokenbar                                   BROKEN BAR / BROKEN VERTICAL BAR
+U+000A7           §            \S                                           SECTION SIGN
+U+000A9           ©            \copyright, \:copyright:                     COPYRIGHT SIGN
+U+000AA           ª            \ordfeminine                                 FEMININE ORDINAL INDICATOR
+U+000AC           ¬            \neg                                         NOT SIGN
+U+000AE           ®            \circledR, \:registered:                     REGISTERED SIGN / REGISTERED TRADE MARK SIGN
+U+000AF           ¯            \highminus                                   MACRON / SPACING MACRON
+U+000B0           °            \degree                                      DEGREE SIGN
+U+000B1           ±            \pm                                          PLUS-MINUS SIGN / PLUS-OR-MINUS SIGN
+U+000B2           ²            \^2                                          SUPERSCRIPT TWO / SUPERSCRIPT DIGIT TWO
+U+000B3           ³            \^3                                          SUPERSCRIPT THREE / SUPERSCRIPT DIGIT THREE
+U+000B6           ¶            \P                                           PILCROW SIGN / PARAGRAPH SIGN
+U+000B7           ·            \cdotp                                       MIDDLE DOT
+U+000B9           ¹            \^1                                          SUPERSCRIPT ONE / SUPERSCRIPT DIGIT ONE
+U+000BA           º            \ordmasculine                                MASCULINE ORDINAL INDICATOR
+U+000BC           ¼            \1/4                                         VULGAR FRACTION ONE QUARTER / FRACTION ONE QUARTER
+U+000BD           ½            \1/2                                         VULGAR FRACTION ONE HALF / FRACTION ONE HALF
+U+000BE           ¾            \3/4                                         VULGAR FRACTION THREE QUARTERS / FRACTION THREE QUARTERS
+U+000BF           ¿            \questiondown                                INVERTED QUESTION MARK
+U+000C5           Å            \AA                                          LATIN CAPITAL LETTER A WITH RING ABOVE / LATIN CAPITAL LETTER A RING
+U+000C6           Æ            \AE                                          LATIN CAPITAL LETTER AE / LATIN CAPITAL LETTER A E
+U+000D0           Ð            \DH                                          LATIN CAPITAL LETTER ETH
+U+000D7           ×            \times                                       MULTIPLICATION SIGN
+U+000D8           Ø            \O                                           LATIN CAPITAL LETTER O WITH STROKE / LATIN CAPITAL LETTER O SLASH
+U+000DE           Þ            \TH                                          LATIN CAPITAL LETTER THORN
+U+000DF           ß            \ss                                          LATIN SMALL LETTER SHARP S
+U+000E5           å            \aa                                          LATIN SMALL LETTER A WITH RING ABOVE / LATIN SMALL LETTER A RING
+U+000E6           æ            \ae                                          LATIN SMALL LETTER AE / LATIN SMALL LETTER A E
+U+000F0           ð            \eth, \dh                                    LATIN SMALL LETTER ETH
+U+000F7           ÷            \div                                         DIVISION SIGN
+U+000F8           ø            \o                                           LATIN SMALL LETTER O WITH STROKE / LATIN SMALL LETTER O SLASH
+U+000FE           þ            \th                                          LATIN SMALL LETTER THORN
+U+00110           Đ            \DJ                                          LATIN CAPITAL LETTER D WITH STROKE / LATIN CAPITAL LETTER D BAR
+U+00111           đ            \dj                                          LATIN SMALL LETTER D WITH STROKE / LATIN SMALL LETTER D BAR
+U+00127           ħ            \hbar                                        LATIN SMALL LETTER H WITH STROKE / LATIN SMALL LETTER H BAR
+U+00131           ı            \imath                                       LATIN SMALL LETTER DOTLESS I
+U+00141           Ł            \L                                           LATIN CAPITAL LETTER L WITH STROKE / LATIN CAPITAL LETTER L SLASH
+U+00142           ł            \l                                           LATIN SMALL LETTER L WITH STROKE / LATIN SMALL LETTER L SLASH
+U+0014A           Ŋ            \NG                                          LATIN CAPITAL LETTER ENG
+U+0014B           ŋ            \ng                                          LATIN SMALL LETTER ENG
+U+00152           Œ            \OE                                          LATIN CAPITAL LIGATURE OE / LATIN CAPITAL LETTER O E
+U+00153           œ            \oe                                          LATIN SMALL LIGATURE OE / LATIN SMALL LETTER O E
+U+00195           ƕ            \hvlig                                       LATIN SMALL LETTER HV / LATIN SMALL LETTER H V
+U+0019E           ƞ            \nrleg                                       LATIN SMALL LETTER N WITH LONG RIGHT LEG
+U+001B5           Ƶ            \Zbar                                        LATIN CAPITAL LETTER Z WITH STROKE / LATIN CAPITAL LETTER Z BAR
+U+001C2           ǂ            \doublepipe                                  LATIN LETTER ALVEOLAR CLICK / LATIN LETTER PIPE DOUBLE BAR
+U+00237           ȷ            \jmath                                       LATIN SMALL LETTER DOTLESS J
+U+00250           ɐ            \trna                                        LATIN SMALL LETTER TURNED A
+U+00252           ɒ            \trnsa                                       LATIN SMALL LETTER TURNED ALPHA / LATIN SMALL LETTER TURNED SCRIPT A
+U+00254           ɔ            \openo                                       LATIN SMALL LETTER OPEN O
+U+00256           ɖ            \rtld                                        LATIN SMALL LETTER D WITH TAIL / LATIN SMALL LETTER D RETROFLEX HOOK
+U+00259           ə            \schwa                                       LATIN SMALL LETTER SCHWA
+U+00263           ɣ            \pgamma                                      LATIN SMALL LETTER GAMMA
+U+00264           ɤ            \pbgam                                       LATIN SMALL LETTER RAMS HORN / LATIN SMALL LETTER BABY GAMMA
+U+00265           ɥ            \trnh                                        LATIN SMALL LETTER TURNED H
+U+0026C           ɬ            \btdl                                        LATIN SMALL LETTER L WITH BELT / LATIN SMALL LETTER L BELT
+U+0026D           ɭ            \rtll                                        LATIN SMALL LETTER L WITH RETROFLEX HOOK / LATIN SMALL LETTER L RETROFLEX HOOK
+U+0026F           ɯ            \trnm                                        LATIN SMALL LETTER TURNED M
+U+00270           ɰ            \trnmlr                                      LATIN SMALL LETTER TURNED M WITH LONG LEG
+U+00271           ɱ            \ltlmr                                       LATIN SMALL LETTER M WITH HOOK / LATIN SMALL LETTER M HOOK
+U+00272           ɲ            \ltln                                        LATIN SMALL LETTER N WITH LEFT HOOK / LATIN SMALL LETTER N HOOK
+U+00273           ɳ            \rtln                                        LATIN SMALL LETTER N WITH RETROFLEX HOOK / LATIN SMALL LETTER N RETROFLEX HOOK
+U+00277           ɷ            \clomeg                                      LATIN SMALL LETTER CLOSED OMEGA
+U+00278           ɸ            \ltphi                                       LATIN SMALL LETTER PHI
+U+00279           ɹ            \trnr                                        LATIN SMALL LETTER TURNED R
+U+0027A           ɺ            \trnrl                                       LATIN SMALL LETTER TURNED R WITH LONG LEG
+U+0027B           ɻ            \rttrnr                                      LATIN SMALL LETTER TURNED R WITH HOOK / LATIN SMALL LETTER TURNED R HOOK
+U+0027C           ɼ            \rl                                          LATIN SMALL LETTER R WITH LONG LEG
+U+0027D           ɽ            \rtlr                                        LATIN SMALL LETTER R WITH TAIL / LATIN SMALL LETTER R HOOK
+U+0027E           ɾ            \fhr                                         LATIN SMALL LETTER R WITH FISHHOOK / LATIN SMALL LETTER FISHHOOK R
+U+00282           ʂ            \rtls                                        LATIN SMALL LETTER S WITH HOOK / LATIN SMALL LETTER S HOOK
+U+00283           ʃ            \esh                                         LATIN SMALL LETTER ESH
+U+00287           ʇ            \trnt                                        LATIN SMALL LETTER TURNED T
+U+00288           ʈ            \rtlt                                        LATIN SMALL LETTER T WITH RETROFLEX HOOK / LATIN SMALL LETTER T RETROFLEX HOOK
+U+0028A           ʊ            \pupsil                                      LATIN SMALL LETTER UPSILON
+U+0028B           ʋ            \pscrv                                       LATIN SMALL LETTER V WITH HOOK / LATIN SMALL LETTER SCRIPT V
+U+0028C           ʌ            \invv                                        LATIN SMALL LETTER TURNED V
+U+0028D           ʍ            \invw                                        LATIN SMALL LETTER TURNED W
+U+0028E           ʎ            \trny                                        LATIN SMALL LETTER TURNED Y
+U+00290           ʐ            \rtlz                                        LATIN SMALL LETTER Z WITH RETROFLEX HOOK / LATIN SMALL LETTER Z RETROFLEX HOOK
+U+00292           ʒ            \yogh                                        LATIN SMALL LETTER EZH / LATIN SMALL LETTER YOGH
+U+00294           ʔ            \glst                                        LATIN LETTER GLOTTAL STOP
+U+00295           ʕ            \reglst                                      LATIN LETTER PHARYNGEAL VOICED FRICATIVE / LATIN LETTER REVERSED GLOTTAL STOP
+U+00296           ʖ            \inglst                                      LATIN LETTER INVERTED GLOTTAL STOP
+U+0029E           ʞ            \turnk                                       LATIN SMALL LETTER TURNED K
+U+002A4           ʤ            \dyogh                                       LATIN SMALL LETTER DEZH DIGRAPH / LATIN SMALL LETTER D YOGH
+U+002A7           ʧ            \tesh                                        LATIN SMALL LETTER TESH DIGRAPH / LATIN SMALL LETTER T ESH
+U+002B0           ʰ            \^h                                          MODIFIER LETTER SMALL H
+U+002B2           ʲ            \^j                                          MODIFIER LETTER SMALL J
+U+002B3           ʳ            \^r                                          MODIFIER LETTER SMALL R
+U+002B7           ʷ            \^w                                          MODIFIER LETTER SMALL W
+U+002B8           ʸ            \^y                                          MODIFIER LETTER SMALL Y
+U+002BC           ʼ            \rasp                                        MODIFIER LETTER APOSTROPHE
+U+002C8           ˈ            \verts                                       MODIFIER LETTER VERTICAL LINE
+U+002CC           ˌ            \verti                                       MODIFIER LETTER LOW VERTICAL LINE
+U+002D0           ː            \lmrk                                        MODIFIER LETTER TRIANGULAR COLON
+U+002D1           ˑ            \hlmrk                                       MODIFIER LETTER HALF TRIANGULAR COLON
+U+002D2           ˒            \sbrhr                                       MODIFIER LETTER CENTRED RIGHT HALF RING / MODIFIER LETTER CENTERED RIGHT HALF RING
+U+002D3           ˓            \sblhr                                       MODIFIER LETTER CENTRED LEFT HALF RING / MODIFIER LETTER CENTERED LEFT HALF RING
+U+002D4           ˔            \rais                                        MODIFIER LETTER UP TACK
+U+002D5           ˕            \low                                         MODIFIER LETTER DOWN TACK
+U+002D8           ˘            \u                                           BREVE / SPACING BREVE
+U+002DC           ˜            \tildelow                                    SMALL TILDE / SPACING TILDE
+U+002E1           ˡ            \^l                                          MODIFIER LETTER SMALL L
+U+002E2           ˢ            \^s                                          MODIFIER LETTER SMALL S
+U+002E3           ˣ            \^x                                          MODIFIER LETTER SMALL X
+U+00300           ◌̀           \grave                                       COMBINING GRAVE ACCENT / NON-SPACING GRAVE
+U+00301           ◌́           \acute                                       COMBINING ACUTE ACCENT / NON-SPACING ACUTE
+U+00302           ◌̂           \hat                                         COMBINING CIRCUMFLEX ACCENT / NON-SPACING CIRCUMFLEX
+U+00303           ◌̃           \tilde                                       COMBINING TILDE / NON-SPACING TILDE
+U+00304           ◌̄           \bar                                         COMBINING MACRON / NON-SPACING MACRON
+U+00305           ◌̅           \overbar                                     COMBINING OVERLINE / NON-SPACING OVERSCORE
+U+00306           ◌̆           \breve                                       COMBINING BREVE / NON-SPACING BREVE
+U+00307           ◌̇           \dot                                         COMBINING DOT ABOVE / NON-SPACING DOT ABOVE
+U+00308           ◌̈           \ddot                                        COMBINING DIAERESIS / NON-SPACING DIAERESIS
+U+00309           ◌̉           \ovhook                                      COMBINING HOOK ABOVE / NON-SPACING HOOK ABOVE
+U+0030A           ◌̊           \ocirc                                       COMBINING RING ABOVE / NON-SPACING RING ABOVE
+U+0030B           ◌̋           \H                                           COMBINING DOUBLE ACUTE ACCENT / NON-SPACING DOUBLE ACUTE
+U+0030C           ◌̌           \check                                       COMBINING CARON / NON-SPACING HACEK
+U+00310           ◌̐           \candra                                      COMBINING CANDRABINDU / NON-SPACING CANDRABINDU
+U+00312           ◌̒           \oturnedcomma                                COMBINING TURNED COMMA ABOVE / NON-SPACING TURNED COMMA ABOVE
+U+00315           ◌̕           \ocommatopright                              COMBINING COMMA ABOVE RIGHT / NON-SPACING COMMA ABOVE RIGHT
+U+0031A           ◌̚           \droang                                      COMBINING LEFT ANGLE ABOVE / NON-SPACING LEFT ANGLE ABOVE
+U+00321           ◌̡           \palh                                        COMBINING PALATALIZED HOOK BELOW / NON-SPACING PALATALIZED HOOK BELOW
+U+00322           ◌̢           \rh                                          COMBINING RETROFLEX HOOK BELOW / NON-SPACING RETROFLEX HOOK BELOW
+U+00327           ◌̧           \c                                           COMBINING CEDILLA / NON-SPACING CEDILLA
+U+00328           ◌̨           \k                                           COMBINING OGONEK / NON-SPACING OGONEK
+U+0032A           ◌̪           \sbbrg                                       COMBINING BRIDGE BELOW / NON-SPACING BRIDGE BELOW
+U+00330           ◌̰           \wideutilde                                  COMBINING TILDE BELOW / NON-SPACING TILDE BELOW
+U+00332           ◌̲           \underbar                                    COMBINING LOW LINE / NON-SPACING UNDERSCORE
+U+00336           ◌̶           \strike, \sout                               COMBINING LONG STROKE OVERLAY / NON-SPACING LONG BAR OVERLAY
+U+00338           ◌̸           \not                                         COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+0034D           ◌͍           \underleftrightarrow                         COMBINING LEFT RIGHT ARROW BELOW
+U+00391           Α            \Alpha                                       GREEK CAPITAL LETTER ALPHA
+U+00392           Β            \Beta                                        GREEK CAPITAL LETTER BETA
+U+00393           Γ            \Gamma                                       GREEK CAPITAL LETTER GAMMA
+U+00394           Δ            \Delta                                       GREEK CAPITAL LETTER DELTA
+U+00395           Ε            \Epsilon                                     GREEK CAPITAL LETTER EPSILON
+U+00396           Ζ            \Zeta                                        GREEK CAPITAL LETTER ZETA
+U+00397           Η            \Eta                                         GREEK CAPITAL LETTER ETA
+U+00398           Θ            \Theta                                       GREEK CAPITAL LETTER THETA
+U+00399           Ι            \Iota                                        GREEK CAPITAL LETTER IOTA
+U+0039A           Κ            \Kappa                                       GREEK CAPITAL LETTER KAPPA
+U+0039B           Λ            \Lambda                                      GREEK CAPITAL LETTER LAMDA / GREEK CAPITAL LETTER LAMBDA
+U+0039C           Μ            \upMu                                        GREEK CAPITAL LETTER MU
+U+0039D           Ν            \upNu                                        GREEK CAPITAL LETTER NU
+U+0039E           Ξ            \Xi                                          GREEK CAPITAL LETTER XI
+U+0039F           Ο            \upOmicron                                   GREEK CAPITAL LETTER OMICRON
+U+003A0           Π            \Pi                                          GREEK CAPITAL LETTER PI
+U+003A1           Ρ            \Rho                                         GREEK CAPITAL LETTER RHO
+U+003A3           Σ            \Sigma                                       GREEK CAPITAL LETTER SIGMA
+U+003A4           Τ            \Tau                                         GREEK CAPITAL LETTER TAU
+U+003A5           Υ            \Upsilon                                     GREEK CAPITAL LETTER UPSILON
+U+003A6           Φ            \Phi                                         GREEK CAPITAL LETTER PHI
+U+003A7           Χ            \Chi                                         GREEK CAPITAL LETTER CHI
+U+003A8           Ψ            \Psi                                         GREEK CAPITAL LETTER PSI
+U+003A9           Ω            \Omega                                       GREEK CAPITAL LETTER OMEGA
+U+003B1           α            \alpha                                       GREEK SMALL LETTER ALPHA
+U+003B2           β            \beta                                        GREEK SMALL LETTER BETA
+U+003B3           γ            \gamma                                       GREEK SMALL LETTER GAMMA
+U+003B4           δ            \delta                                       GREEK SMALL LETTER DELTA
+U+003B5           ε            \upepsilon, \varepsilon                      GREEK SMALL LETTER EPSILON
+U+003B6           ζ            \zeta                                        GREEK SMALL LETTER ZETA
+U+003B7           η            \eta                                         GREEK SMALL LETTER ETA
+U+003B8           θ            \theta                                       GREEK SMALL LETTER THETA
+U+003B9           ι            \iota                                        GREEK SMALL LETTER IOTA
+U+003BA           κ            \kappa                                       GREEK SMALL LETTER KAPPA
+U+003BB           λ            \lambda                                      GREEK SMALL LETTER LAMDA / GREEK SMALL LETTER LAMBDA
+U+003BC           μ            \mu                                          GREEK SMALL LETTER MU
+U+003BD           ν            \nu                                          GREEK SMALL LETTER NU
+U+003BE           ξ            \xi                                          GREEK SMALL LETTER XI
+U+003BF           ο            \upomicron                                   GREEK SMALL LETTER OMICRON
+U+003C0           π            \pi                                          GREEK SMALL LETTER PI
+U+003C1           ρ            \rho                                         GREEK SMALL LETTER RHO
+U+003C2           ς            \varsigma                                    GREEK SMALL LETTER FINAL SIGMA
+U+003C3           σ            \sigma                                       GREEK SMALL LETTER SIGMA
+U+003C4           τ            \tau                                         GREEK SMALL LETTER TAU
+U+003C5           υ            \upsilon                                     GREEK SMALL LETTER UPSILON
+U+003C6           φ            \varphi                                      GREEK SMALL LETTER PHI
+U+003C7           χ            \chi                                         GREEK SMALL LETTER CHI
+U+003C8           ψ            \psi                                         GREEK SMALL LETTER PSI
+U+003C9           ω            \omega                                       GREEK SMALL LETTER OMEGA
+U+003D0           ϐ            \upvarbeta                                   GREEK BETA SYMBOL / GREEK SMALL LETTER CURLED BETA
+U+003D1           ϑ            \vartheta                                    GREEK THETA SYMBOL / GREEK SMALL LETTER SCRIPT THETA
+U+003D5           ϕ            \phi                                         GREEK PHI SYMBOL / GREEK SMALL LETTER SCRIPT PHI
+U+003D6           ϖ            \varpi                                       GREEK PI SYMBOL / GREEK SMALL LETTER OMEGA PI
+U+003D8           Ϙ            \upoldKoppa                                  GREEK LETTER ARCHAIC KOPPA
+U+003D9           ϙ            \upoldkoppa                                  GREEK SMALL LETTER ARCHAIC KOPPA
+U+003DA           Ϛ            \Stigma                                      GREEK LETTER STIGMA / GREEK CAPITAL LETTER STIGMA
+U+003DB           ϛ            \upstigma                                    GREEK SMALL LETTER STIGMA
+U+003DC           Ϝ            \Digamma                                     GREEK LETTER DIGAMMA / GREEK CAPITAL LETTER DIGAMMA
+U+003DD           ϝ            \digamma                                     GREEK SMALL LETTER DIGAMMA
+U+003DE           Ϟ            \Koppa                                       GREEK LETTER KOPPA / GREEK CAPITAL LETTER KOPPA
+U+003DF           ϟ            \upkoppa                                     GREEK SMALL LETTER KOPPA
+U+003E0           Ϡ            \Sampi                                       GREEK LETTER SAMPI / GREEK CAPITAL LETTER SAMPI
+U+003E1           ϡ            \upsampi                                     GREEK SMALL LETTER SAMPI
+U+003F0           ϰ            \varkappa                                    GREEK KAPPA SYMBOL / GREEK SMALL LETTER SCRIPT KAPPA
+U+003F1           ϱ            \varrho                                      GREEK RHO SYMBOL / GREEK SMALL LETTER TAILED RHO
+U+003F4           ϴ            \varTheta                                    GREEK CAPITAL THETA SYMBOL
+U+003F5           ϵ            \epsilon                                     GREEK LUNATE EPSILON SYMBOL
+U+003F6           ϶            \backepsilon                                 GREEK REVERSED LUNATE EPSILON SYMBOL
+U+01D2C           ᴬ            \^A                                          MODIFIER LETTER CAPITAL A
+U+01D2E           ᴮ            \^B                                          MODIFIER LETTER CAPITAL B
+U+01D30           ᴰ            \^D                                          MODIFIER LETTER CAPITAL D
+U+01D31           ᴱ            \^E                                          MODIFIER LETTER CAPITAL E
+U+01D33           ᴳ            \^G                                          MODIFIER LETTER CAPITAL G
+U+01D34           ᴴ            \^H                                          MODIFIER LETTER CAPITAL H
+U+01D35           ᴵ            \^I                                          MODIFIER LETTER CAPITAL I
+U+01D36           ᴶ            \^J                                          MODIFIER LETTER CAPITAL J
+U+01D37           ᴷ            \^K                                          MODIFIER LETTER CAPITAL K
+U+01D38           ᴸ            \^L                                          MODIFIER LETTER CAPITAL L
+U+01D39           ᴹ            \^M                                          MODIFIER LETTER CAPITAL M
+U+01D3A           ᴺ            \^N                                          MODIFIER LETTER CAPITAL N
+U+01D3C           ᴼ            \^O                                          MODIFIER LETTER CAPITAL O
+U+01D3E           ᴾ            \^P                                          MODIFIER LETTER CAPITAL P
+U+01D3F           ᴿ            \^R                                          MODIFIER LETTER CAPITAL R
+U+01D40           ᵀ            \^T                                          MODIFIER LETTER CAPITAL T
+U+01D41           ᵁ            \^U                                          MODIFIER LETTER CAPITAL U
+U+01D42           ᵂ            \^W                                          MODIFIER LETTER CAPITAL W
+U+01D43           ᵃ            \^a                                          MODIFIER LETTER SMALL A
+U+01D45           ᵅ            \^alpha                                      MODIFIER LETTER SMALL ALPHA
+U+01D47           ᵇ            \^b                                          MODIFIER LETTER SMALL B
+U+01D48           ᵈ            \^d                                          MODIFIER LETTER SMALL D
+U+01D49           ᵉ            \^e                                          MODIFIER LETTER SMALL E
+U+01D4B           ᵋ            \^epsilon                                    MODIFIER LETTER SMALL OPEN E
+U+01D4D           ᵍ            \^g                                          MODIFIER LETTER SMALL G
+U+01D4F           ᵏ            \^k                                          MODIFIER LETTER SMALL K
+U+01D50           ᵐ            \^m                                          MODIFIER LETTER SMALL M
+U+01D52           ᵒ            \^o                                          MODIFIER LETTER SMALL O
+U+01D56           ᵖ            \^p                                          MODIFIER LETTER SMALL P
+U+01D57           ᵗ            \^t                                          MODIFIER LETTER SMALL T
+U+01D58           ᵘ            \^u                                          MODIFIER LETTER SMALL U
+U+01D5B           ᵛ            \^v                                          MODIFIER LETTER SMALL V
+U+01D5D           ᵝ            \^beta                                       MODIFIER LETTER SMALL BETA
+U+01D5E           ᵞ            \^gamma                                      MODIFIER LETTER SMALL GREEK GAMMA
+U+01D5F           ᵟ            \^delta                                      MODIFIER LETTER SMALL DELTA
+U+01D60           ᵠ            \^phi                                        MODIFIER LETTER SMALL GREEK PHI
+U+01D61           ᵡ            \^chi                                        MODIFIER LETTER SMALL CHI
+U+01D62           ᵢ            \_i                                          LATIN SUBSCRIPT SMALL LETTER I
+U+01D63           ᵣ            \_r                                          LATIN SUBSCRIPT SMALL LETTER R
+U+01D64           ᵤ            \_u                                          LATIN SUBSCRIPT SMALL LETTER U
+U+01D65           ᵥ            \_v                                          LATIN SUBSCRIPT SMALL LETTER V
+U+01D66           ᵦ            \_beta                                       GREEK SUBSCRIPT SMALL LETTER BETA
+U+01D67           ᵧ            \_gamma                                      GREEK SUBSCRIPT SMALL LETTER GAMMA
+U+01D68           ᵨ            \_rho                                        GREEK SUBSCRIPT SMALL LETTER RHO
+U+01D69           ᵩ            \_phi                                        GREEK SUBSCRIPT SMALL LETTER PHI
+U+01D6A           ᵪ            \_chi                                        GREEK SUBSCRIPT SMALL LETTER CHI
+U+01D9C           ᶜ            \^c                                          MODIFIER LETTER SMALL C
+U+01DA0           ᶠ            \^f                                          MODIFIER LETTER SMALL F
+U+01DA5           ᶥ            \^iota                                       MODIFIER LETTER SMALL IOTA
+U+01DB2           ᶲ            \^Phi                                        MODIFIER LETTER SMALL PHI
+U+01DBB           ᶻ            \^z                                          MODIFIER LETTER SMALL Z
+U+01DBF           ᶿ            \^theta                                      MODIFIER LETTER SMALL THETA
+U+02002                        \enspace                                     EN SPACE
+U+02003                        \quad                                        EM SPACE
+U+02005                        \thickspace                                  FOUR-PER-EM SPACE
+U+02009                        \thinspace                                   THIN SPACE
+U+0200A                        \hspace                                      HAIR SPACE
+U+02013           –            \endash                                      EN DASH
+U+02014           —            \emdash                                      EM DASH
+U+02016           ‖            \Vert                                        DOUBLE VERTICAL LINE / DOUBLE VERTICAL BAR
+U+02018           ‘            \lq                                          LEFT SINGLE QUOTATION MARK / SINGLE TURNED COMMA QUOTATION MARK
+U+02019           ’            \rq                                          RIGHT SINGLE QUOTATION MARK / SINGLE COMMA QUOTATION MARK
+U+0201B           ‛            \reapos                                      SINGLE HIGH-REVERSED-9 QUOTATION MARK / SINGLE REVERSED COMMA QUOTATION MARK
+U+0201C           “            \quotedblleft                                LEFT DOUBLE QUOTATION MARK / DOUBLE TURNED COMMA QUOTATION MARK
+U+0201D           ”            \quotedblright                               RIGHT DOUBLE QUOTATION MARK / DOUBLE COMMA QUOTATION MARK
+U+02020           †            \dagger                                      DAGGER
+U+02021           ‡            \ddagger                                     DOUBLE DAGGER
+U+02022           •            \bullet                                      BULLET
+U+02026           …            \dots, \ldots                                HORIZONTAL ELLIPSIS
+U+02030           ‰            \perthousand                                 PER MILLE SIGN
+U+02031           ‱            \pertenthousand                              PER TEN THOUSAND SIGN
+U+02032           ′            \prime                                       PRIME
+U+02033           ″            \pprime                                      DOUBLE PRIME
+U+02034           ‴            \ppprime                                     TRIPLE PRIME
+U+02035           ‵            \backprime                                   REVERSED PRIME
+U+02036           ‶            \backpprime                                  REVERSED DOUBLE PRIME
+U+02037           ‷            \backppprime                                 REVERSED TRIPLE PRIME
+U+02039           ‹            \guilsinglleft                               SINGLE LEFT-POINTING ANGLE QUOTATION MARK / LEFT POINTING SINGLE GUILLEMET
+U+0203A           ›            \guilsinglright                              SINGLE RIGHT-POINTING ANGLE QUOTATION MARK / RIGHT POINTING SINGLE GUILLEMET
+U+0203C           ‼            \:bangbang:                                  DOUBLE EXCLAMATION MARK
+U+02040           ⁀            \tieconcat                                   CHARACTER TIE
+U+02049           ⁉            \:interrobang:                               EXCLAMATION QUESTION MARK
+U+02057           ⁗            \pppprime                                    QUADRUPLE PRIME
+U+0205D           ⁝            \tricolon                                    TRICOLON
+U+02060           ⁠            \nolinebreak                                 WORD JOINER
+U+02070           ⁰            \^0                                          SUPERSCRIPT ZERO / SUPERSCRIPT DIGIT ZERO
+U+02071           ⁱ            \^i                                          SUPERSCRIPT LATIN SMALL LETTER I
+U+02074           ⁴            \^4                                          SUPERSCRIPT FOUR / SUPERSCRIPT DIGIT FOUR
+U+02075           ⁵            \^5                                          SUPERSCRIPT FIVE / SUPERSCRIPT DIGIT FIVE
+U+02076           ⁶            \^6                                          SUPERSCRIPT SIX / SUPERSCRIPT DIGIT SIX
+U+02077           ⁷            \^7                                          SUPERSCRIPT SEVEN / SUPERSCRIPT DIGIT SEVEN
+U+02078           ⁸            \^8                                          SUPERSCRIPT EIGHT / SUPERSCRIPT DIGIT EIGHT
+U+02079           ⁹            \^9                                          SUPERSCRIPT NINE / SUPERSCRIPT DIGIT NINE
+U+0207A           ⁺            \^+                                          SUPERSCRIPT PLUS SIGN
+U+0207B           ⁻            \^-                                          SUPERSCRIPT MINUS / SUPERSCRIPT HYPHEN-MINUS
+U+0207C           ⁼            \^=                                          SUPERSCRIPT EQUALS SIGN
+U+0207D           ⁽            \^(                                          SUPERSCRIPT LEFT PARENTHESIS / SUPERSCRIPT OPENING PARENTHESIS
+U+0207E           ⁾            \^)                                          SUPERSCRIPT RIGHT PARENTHESIS / SUPERSCRIPT CLOSING PARENTHESIS
+U+0207F           ⁿ            \^n                                          SUPERSCRIPT LATIN SMALL LETTER N
+U+02080           ₀            \_0                                          SUBSCRIPT ZERO / SUBSCRIPT DIGIT ZERO
+U+02081           ₁            \_1                                          SUBSCRIPT ONE / SUBSCRIPT DIGIT ONE
+U+02082           ₂            \_2                                          SUBSCRIPT TWO / SUBSCRIPT DIGIT TWO
+U+02083           ₃            \_3                                          SUBSCRIPT THREE / SUBSCRIPT DIGIT THREE
+U+02084           ₄            \_4                                          SUBSCRIPT FOUR / SUBSCRIPT DIGIT FOUR
+U+02085           ₅            \_5                                          SUBSCRIPT FIVE / SUBSCRIPT DIGIT FIVE
+U+02086           ₆            \_6                                          SUBSCRIPT SIX / SUBSCRIPT DIGIT SIX
+U+02087           ₇            \_7                                          SUBSCRIPT SEVEN / SUBSCRIPT DIGIT SEVEN
+U+02088           ₈            \_8                                          SUBSCRIPT EIGHT / SUBSCRIPT DIGIT EIGHT
+U+02089           ₉            \_9                                          SUBSCRIPT NINE / SUBSCRIPT DIGIT NINE
+U+0208A           ₊            \_+                                          SUBSCRIPT PLUS SIGN
+U+0208B           ₋            \_-                                          SUBSCRIPT MINUS / SUBSCRIPT HYPHEN-MINUS
+U+0208C           ₌            \_=                                          SUBSCRIPT EQUALS SIGN
+U+0208D           ₍            \_(                                          SUBSCRIPT LEFT PARENTHESIS / SUBSCRIPT OPENING PARENTHESIS
+U+0208E           ₎            \_)                                          SUBSCRIPT RIGHT PARENTHESIS / SUBSCRIPT CLOSING PARENTHESIS
+U+02090           ₐ            \_a                                          LATIN SUBSCRIPT SMALL LETTER A
+U+02091           ₑ            \_e                                          LATIN SUBSCRIPT SMALL LETTER E
+U+02092           ₒ            \_o                                          LATIN SUBSCRIPT SMALL LETTER O
+U+02093           ₓ            \_x                                          LATIN SUBSCRIPT SMALL LETTER X
+U+02094           ₔ            \_schwa                                      LATIN SUBSCRIPT SMALL LETTER SCHWA
+U+02095           ₕ            \_h                                          LATIN SUBSCRIPT SMALL LETTER H
+U+02096           ₖ            \_k                                          LATIN SUBSCRIPT SMALL LETTER K
+U+02097           ₗ            \_l                                          LATIN SUBSCRIPT SMALL LETTER L
+U+02098           ₘ            \_m                                          LATIN SUBSCRIPT SMALL LETTER M
+U+02099           ₙ            \_n                                          LATIN SUBSCRIPT SMALL LETTER N
+U+0209A           ₚ            \_p                                          LATIN SUBSCRIPT SMALL LETTER P
+U+0209B           ₛ            \_s                                          LATIN SUBSCRIPT SMALL LETTER S
+U+0209C           ₜ            \_t                                          LATIN SUBSCRIPT SMALL LETTER T
+U+020A7           ₧            \pes                                         PESETA SIGN
+U+020AC           €            \euro                                        EURO SIGN
+U+020D0           ◌⃐           \leftharpoonaccent                           COMBINING LEFT HARPOON ABOVE / NON-SPACING LEFT HARPOON ABOVE
+U+020D1           ◌⃑           \rightharpoonaccent                          COMBINING RIGHT HARPOON ABOVE / NON-SPACING RIGHT HARPOON ABOVE
+U+020D2           ◌⃒           \vertoverlay                                 COMBINING LONG VERTICAL LINE OVERLAY / NON-SPACING LONG VERTICAL BAR OVERLAY
+U+020D6           ◌⃖           \overleftarrow                               COMBINING LEFT ARROW ABOVE / NON-SPACING LEFT ARROW ABOVE
+U+020D7           ◌⃗           \vec                                         COMBINING RIGHT ARROW ABOVE / NON-SPACING RIGHT ARROW ABOVE
+U+020DB           ◌⃛           \dddot                                       COMBINING THREE DOTS ABOVE / NON-SPACING THREE DOTS ABOVE
+U+020DC           ◌⃜           \ddddot                                      COMBINING FOUR DOTS ABOVE / NON-SPACING FOUR DOTS ABOVE
+U+020DD           ◌⃝           \enclosecircle                               COMBINING ENCLOSING CIRCLE / ENCLOSING CIRCLE
+U+020DE           ◌⃞           \enclosesquare                               COMBINING ENCLOSING SQUARE / ENCLOSING SQUARE
+U+020DF           ◌⃟           \enclosediamond                              COMBINING ENCLOSING DIAMOND / ENCLOSING DIAMOND
+U+020E1           ◌⃡           \overleftrightarrow                          COMBINING LEFT RIGHT ARROW ABOVE / NON-SPACING LEFT RIGHT ARROW ABOVE
+U+020E4           ◌⃤           \enclosetriangle                             COMBINING ENCLOSING UPWARD POINTING TRIANGLE
+U+020E7           ◌⃧           \annuity                                     COMBINING ANNUITY SYMBOL
+U+020E8           ◌⃨           \threeunderdot                               COMBINING TRIPLE UNDERDOT
+U+020E9           ◌⃩           \widebridgeabove                             COMBINING WIDE BRIDGE ABOVE
+U+020EC           ◌⃬           \underrightharpoondown                       COMBINING RIGHTWARDS HARPOON WITH BARB DOWNWARDS
+U+020ED           ◌⃭           \underleftharpoondown                        COMBINING LEFTWARDS HARPOON WITH BARB DOWNWARDS
+U+020EE           ◌⃮           \underleftarrow                              COMBINING LEFT ARROW BELOW
+U+020EF           ◌⃯           \underrightarrow                             COMBINING RIGHT ARROW BELOW
+U+020F0           ◌⃰           \asteraccent                                 COMBINING ASTERISK ABOVE
+U+02102           ℂ            \bbC                                         DOUBLE-STRUCK CAPITAL C / DOUBLE-STRUCK C
+U+02107           ℇ            \eulermascheroni                             EULER CONSTANT / EULERS
+U+0210A           ℊ            \scrg                                        SCRIPT SMALL G
+U+0210B           ℋ            \scrH                                        SCRIPT CAPITAL H / SCRIPT H
+U+0210C           ℌ            \frakH                                       BLACK-LETTER CAPITAL H / BLACK-LETTER H
+U+0210D           ℍ            \bbH                                         DOUBLE-STRUCK CAPITAL H / DOUBLE-STRUCK H
+U+0210E           ℎ            \planck                                      PLANCK CONSTANT
+U+0210F           ℏ            \hslash                                      PLANCK CONSTANT OVER TWO PI / PLANCK CONSTANT OVER 2 PI
+U+02110           ℐ            \scrI                                        SCRIPT CAPITAL I / SCRIPT I
+U+02111           ℑ            \Im                                          BLACK-LETTER CAPITAL I / BLACK-LETTER I
+U+02112           ℒ            \scrL                                        SCRIPT CAPITAL L / SCRIPT L
+U+02113           ℓ            \ell                                         SCRIPT SMALL L
+U+02115           ℕ            \bbN                                         DOUBLE-STRUCK CAPITAL N / DOUBLE-STRUCK N
+U+02116           №            \numero                                      NUMERO SIGN / NUMERO
+U+02118           ℘            \wp                                          SCRIPT CAPITAL P / SCRIPT P
+U+02119           ℙ            \bbP                                         DOUBLE-STRUCK CAPITAL P / DOUBLE-STRUCK P
+U+0211A           ℚ            \bbQ                                         DOUBLE-STRUCK CAPITAL Q / DOUBLE-STRUCK Q
+U+0211B           ℛ            \scrR                                        SCRIPT CAPITAL R / SCRIPT R
+U+0211C           ℜ            \Re                                          BLACK-LETTER CAPITAL R / BLACK-LETTER R
+U+0211D           ℝ            \bbR                                         DOUBLE-STRUCK CAPITAL R / DOUBLE-STRUCK R
+U+0211E           ℞            \xrat                                        PRESCRIPTION TAKE
+U+02122           ™            \trademark, \:tm:                            TRADE MARK SIGN / TRADEMARK
+U+02124           ℤ            \bbZ                                         DOUBLE-STRUCK CAPITAL Z / DOUBLE-STRUCK Z
+U+02126           Ω            \ohm                                         OHM SIGN / OHM
+U+02127           ℧            \mho                                         INVERTED OHM SIGN / MHO
+U+02128           ℨ            \frakZ                                       BLACK-LETTER CAPITAL Z / BLACK-LETTER Z
+U+02129           ℩            \turnediota                                  TURNED GREEK SMALL LETTER IOTA
+U+0212B           Å            \Angstrom                                    ANGSTROM SIGN / ANGSTROM UNIT
+U+0212C           ℬ            \scrB                                        SCRIPT CAPITAL B / SCRIPT B
+U+0212D           ℭ            \frakC                                       BLACK-LETTER CAPITAL C / BLACK-LETTER C
+U+0212F           ℯ            \scre, \euler                                SCRIPT SMALL E
+U+02130           ℰ            \scrE                                        SCRIPT CAPITAL E / SCRIPT E
+U+02131           ℱ            \scrF                                        SCRIPT CAPITAL F / SCRIPT F
+U+02132           Ⅎ            \Finv                                        TURNED CAPITAL F / TURNED F
+U+02133           ℳ            \scrM                                        SCRIPT CAPITAL M / SCRIPT M
+U+02134           ℴ            \scro                                        SCRIPT SMALL O
+U+02135           ℵ            \aleph                                       ALEF SYMBOL / FIRST TRANSFINITE CARDINAL
+U+02136           ℶ            \beth                                        BET SYMBOL / SECOND TRANSFINITE CARDINAL
+U+02137           ℷ            \gimel                                       GIMEL SYMBOL / THIRD TRANSFINITE CARDINAL
+U+02138           ℸ            \daleth                                      DALET SYMBOL / FOURTH TRANSFINITE CARDINAL
+U+02139           ℹ            \:information_source:                        INFORMATION SOURCE
+U+0213C           ℼ            \bbpi                                        DOUBLE-STRUCK SMALL PI
+U+0213D           ℽ            \bbgamma                                     DOUBLE-STRUCK SMALL GAMMA
+U+0213E           ℾ            \bbGamma                                     DOUBLE-STRUCK CAPITAL GAMMA
+U+0213F           ℿ            \bbPi                                        DOUBLE-STRUCK CAPITAL PI
+U+02140           ⅀            \bbsum                                       DOUBLE-STRUCK N-ARY SUMMATION
+U+02141           ⅁            \Game                                        TURNED SANS-SERIF CAPITAL G
+U+02142           ⅂            \sansLturned                                 TURNED SANS-SERIF CAPITAL L
+U+02143           ⅃            \sansLmirrored                               REVERSED SANS-SERIF CAPITAL L
+U+02144           ⅄            \Yup                                         TURNED SANS-SERIF CAPITAL Y
+U+02145           ⅅ            \bbiD                                        DOUBLE-STRUCK ITALIC CAPITAL D
+U+02146           ⅆ            \bbid                                        DOUBLE-STRUCK ITALIC SMALL D
+U+02147           ⅇ            \bbie                                        DOUBLE-STRUCK ITALIC SMALL E
+U+02148           ⅈ            \bbii                                        DOUBLE-STRUCK ITALIC SMALL I
+U+02149           ⅉ            \bbij                                        DOUBLE-STRUCK ITALIC SMALL J
+U+0214A           ⅊            \PropertyLine                                PROPERTY LINE
+U+0214B           ⅋            \upand                                       TURNED AMPERSAND
+U+02150           ⅐            \1/7                                         VULGAR FRACTION ONE SEVENTH
+U+02151           ⅑            \1/9                                         VULGAR FRACTION ONE NINTH
+U+02152           ⅒            \1/10                                        VULGAR FRACTION ONE TENTH
+U+02153           ⅓            \1/3                                         VULGAR FRACTION ONE THIRD / FRACTION ONE THIRD
+U+02154           ⅔            \2/3                                         VULGAR FRACTION TWO THIRDS / FRACTION TWO THIRDS
+U+02155           ⅕            \1/5                                         VULGAR FRACTION ONE FIFTH / FRACTION ONE FIFTH
+U+02156           ⅖            \2/5                                         VULGAR FRACTION TWO FIFTHS / FRACTION TWO FIFTHS
+U+02157           ⅗            \3/5                                         VULGAR FRACTION THREE FIFTHS / FRACTION THREE FIFTHS
+U+02158           ⅘            \4/5                                         VULGAR FRACTION FOUR FIFTHS / FRACTION FOUR FIFTHS
+U+02159           ⅙            \1/6                                         VULGAR FRACTION ONE SIXTH / FRACTION ONE SIXTH
+U+0215A           ⅚            \5/6                                         VULGAR FRACTION FIVE SIXTHS / FRACTION FIVE SIXTHS
+U+0215B           ⅛            \1/8                                         VULGAR FRACTION ONE EIGHTH / FRACTION ONE EIGHTH
+U+0215C           ⅜            \3/8                                         VULGAR FRACTION THREE EIGHTHS / FRACTION THREE EIGHTHS
+U+0215D           ⅝            \5/8                                         VULGAR FRACTION FIVE EIGHTHS / FRACTION FIVE EIGHTHS
+U+0215E           ⅞            \7/8                                         VULGAR FRACTION SEVEN EIGHTHS / FRACTION SEVEN EIGHTHS
+U+0215F           ⅟            \1/                                          FRACTION NUMERATOR ONE
+U+02189           ↉            \0/3                                         VULGAR FRACTION ZERO THIRDS
+U+02190           ←            \leftarrow                                   LEFTWARDS ARROW / LEFT ARROW
+U+02191           ↑            \uparrow                                     UPWARDS ARROW / UP ARROW
+U+02192           →            \to, \rightarrow                             RIGHTWARDS ARROW / RIGHT ARROW
+U+02193           ↓            \downarrow                                   DOWNWARDS ARROW / DOWN ARROW
+U+02194           ↔            \leftrightarrow, \:left_right_arrow:         LEFT RIGHT ARROW
+U+02195           ↕            \updownarrow, \:arrow_up_down:               UP DOWN ARROW
+U+02196           ↖            \nwarrow, \:arrow_upper_left:                NORTH WEST ARROW / UPPER LEFT ARROW
+U+02197           ↗            \nearrow, \:arrow_upper_right:               NORTH EAST ARROW / UPPER RIGHT ARROW
+U+02198           ↘            \searrow, \:arrow_lower_right:               SOUTH EAST ARROW / LOWER RIGHT ARROW
+U+02199           ↙            \swarrow, \:arrow_lower_left:                SOUTH WEST ARROW / LOWER LEFT ARROW
+U+0219A           ↚            \nleftarrow                                  LEFTWARDS ARROW WITH STROKE / LEFT ARROW WITH STROKE
+U+0219B           ↛            \nrightarrow                                 RIGHTWARDS ARROW WITH STROKE / RIGHT ARROW WITH STROKE
+U+0219C           ↜            \leftwavearrow                               LEFTWARDS WAVE ARROW / LEFT WAVE ARROW
+U+0219D           ↝            \rightwavearrow                              RIGHTWARDS WAVE ARROW / RIGHT WAVE ARROW
+U+0219E           ↞            \twoheadleftarrow                            LEFTWARDS TWO HEADED ARROW / LEFT TWO HEADED ARROW
+U+0219F           ↟            \twoheaduparrow                              UPWARDS TWO HEADED ARROW / UP TWO HEADED ARROW
+U+021A0           ↠            \twoheadrightarrow                           RIGHTWARDS TWO HEADED ARROW / RIGHT TWO HEADED ARROW
+U+021A1           ↡            \twoheaddownarrow                            DOWNWARDS TWO HEADED ARROW / DOWN TWO HEADED ARROW
+U+021A2           ↢            \leftarrowtail                               LEFTWARDS ARROW WITH TAIL / LEFT ARROW WITH TAIL
+U+021A3           ↣            \rightarrowtail                              RIGHTWARDS ARROW WITH TAIL / RIGHT ARROW WITH TAIL
+U+021A4           ↤            \mapsfrom                                    LEFTWARDS ARROW FROM BAR / LEFT ARROW FROM BAR
+U+021A5           ↥            \mapsup                                      UPWARDS ARROW FROM BAR / UP ARROW FROM BAR
+U+021A6           ↦            \mapsto                                      RIGHTWARDS ARROW FROM BAR / RIGHT ARROW FROM BAR
+U+021A7           ↧            \mapsdown                                    DOWNWARDS ARROW FROM BAR / DOWN ARROW FROM BAR
+U+021A8           ↨            \updownarrowbar                              UP DOWN ARROW WITH BASE
+U+021A9           ↩            \hookleftarrow, \:leftwards_arrow_with_hook: LEFTWARDS ARROW WITH HOOK / LEFT ARROW WITH HOOK
+U+021AA           ↪            \hookrightarrow, \:arrow_right_hook:         RIGHTWARDS ARROW WITH HOOK / RIGHT ARROW WITH HOOK
+U+021AB           ↫            \looparrowleft                               LEFTWARDS ARROW WITH LOOP / LEFT ARROW WITH LOOP
+U+021AC           ↬            \looparrowright                              RIGHTWARDS ARROW WITH LOOP / RIGHT ARROW WITH LOOP
+U+021AD           ↭            \leftrightsquigarrow                         LEFT RIGHT WAVE ARROW
+U+021AE           ↮            \nleftrightarrow                             LEFT RIGHT ARROW WITH STROKE
+U+021AF           ↯            \downzigzagarrow                             DOWNWARDS ZIGZAG ARROW / DOWN ZIGZAG ARROW
+U+021B0           ↰            \Lsh                                         UPWARDS ARROW WITH TIP LEFTWARDS / UP ARROW WITH TIP LEFT
+U+021B1           ↱            \Rsh                                         UPWARDS ARROW WITH TIP RIGHTWARDS / UP ARROW WITH TIP RIGHT
+U+021B2           ↲            \Ldsh                                        DOWNWARDS ARROW WITH TIP LEFTWARDS / DOWN ARROW WITH TIP LEFT
+U+021B3           ↳            \Rdsh                                        DOWNWARDS ARROW WITH TIP RIGHTWARDS / DOWN ARROW WITH TIP RIGHT
+U+021B4           ↴            \linefeed                                    RIGHTWARDS ARROW WITH CORNER DOWNWARDS / RIGHT ARROW WITH CORNER DOWN
+U+021B5           ↵            \carriagereturn                              DOWNWARDS ARROW WITH CORNER LEFTWARDS / DOWN ARROW WITH CORNER LEFT
+U+021B6           ↶            \curvearrowleft                              ANTICLOCKWISE TOP SEMICIRCLE ARROW
+U+021B7           ↷            \curvearrowright                             CLOCKWISE TOP SEMICIRCLE ARROW
+U+021B8           ↸            \barovernorthwestarrow                       NORTH WEST ARROW TO LONG BAR / UPPER LEFT ARROW TO LONG BAR
+U+021B9           ↹            \barleftarrowrightarrowbar                   LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR / LEFT ARROW TO BAR OVER RIGHT ARROW TO BAR
+U+021BA           ↺            \circlearrowleft                             ANTICLOCKWISE OPEN CIRCLE ARROW
+U+021BB           ↻            \circlearrowright                            CLOCKWISE OPEN CIRCLE ARROW
+U+021BC           ↼            \leftharpoonup                               LEFTWARDS HARPOON WITH BARB UPWARDS / LEFT HARPOON WITH BARB UP
+U+021BD           ↽            \leftharpoondown                             LEFTWARDS HARPOON WITH BARB DOWNWARDS / LEFT HARPOON WITH BARB DOWN
+U+021BE           ↾            \upharpoonright                              UPWARDS HARPOON WITH BARB RIGHTWARDS / UP HARPOON WITH BARB RIGHT
+U+021BF           ↿            \upharpoonleft                               UPWARDS HARPOON WITH BARB LEFTWARDS / UP HARPOON WITH BARB LEFT
+U+021C0           ⇀            \rightharpoonup                              RIGHTWARDS HARPOON WITH BARB UPWARDS / RIGHT HARPOON WITH BARB UP
+U+021C1           ⇁            \rightharpoondown                            RIGHTWARDS HARPOON WITH BARB DOWNWARDS / RIGHT HARPOON WITH BARB DOWN
+U+021C2           ⇂            \downharpoonright                            DOWNWARDS HARPOON WITH BARB RIGHTWARDS / DOWN HARPOON WITH BARB RIGHT
+U+021C3           ⇃            \downharpoonleft                             DOWNWARDS HARPOON WITH BARB LEFTWARDS / DOWN HARPOON WITH BARB LEFT
+U+021C4           ⇄            \rightleftarrows                             RIGHTWARDS ARROW OVER LEFTWARDS ARROW / RIGHT ARROW OVER LEFT ARROW
+U+021C5           ⇅            \dblarrowupdown                              UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW / UP ARROW LEFT OF DOWN ARROW
+U+021C6           ⇆            \leftrightarrows                             LEFTWARDS ARROW OVER RIGHTWARDS ARROW / LEFT ARROW OVER RIGHT ARROW
+U+021C7           ⇇            \leftleftarrows                              LEFTWARDS PAIRED ARROWS / LEFT PAIRED ARROWS
+U+021C8           ⇈            \upuparrows                                  UPWARDS PAIRED ARROWS / UP PAIRED ARROWS
+U+021C9           ⇉            \rightrightarrows                            RIGHTWARDS PAIRED ARROWS / RIGHT PAIRED ARROWS
+U+021CA           ⇊            \downdownarrows                              DOWNWARDS PAIRED ARROWS / DOWN PAIRED ARROWS
+U+021CB           ⇋            \leftrightharpoons                           LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON / LEFT HARPOON OVER RIGHT HARPOON
+U+021CC           ⇌            \rightleftharpoons                           RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON / RIGHT HARPOON OVER LEFT HARPOON
+U+021CD           ⇍            \nLeftarrow                                  LEFTWARDS DOUBLE ARROW WITH STROKE / LEFT DOUBLE ARROW WITH STROKE
+U+021CE           ⇎            \nLeftrightarrow                             LEFT RIGHT DOUBLE ARROW WITH STROKE
+U+021CF           ⇏            \nRightarrow                                 RIGHTWARDS DOUBLE ARROW WITH STROKE / RIGHT DOUBLE ARROW WITH STROKE
+U+021D0           ⇐            \Leftarrow                                   LEFTWARDS DOUBLE ARROW / LEFT DOUBLE ARROW
+U+021D1           ⇑            \Uparrow                                     UPWARDS DOUBLE ARROW / UP DOUBLE ARROW
+U+021D2           ⇒            \Rightarrow                                  RIGHTWARDS DOUBLE ARROW / RIGHT DOUBLE ARROW
+U+021D3           ⇓            \Downarrow                                   DOWNWARDS DOUBLE ARROW / DOWN DOUBLE ARROW
+U+021D4           ⇔            \Leftrightarrow                              LEFT RIGHT DOUBLE ARROW
+U+021D5           ⇕            \Updownarrow                                 UP DOWN DOUBLE ARROW
+U+021D6           ⇖            \Nwarrow                                     NORTH WEST DOUBLE ARROW / UPPER LEFT DOUBLE ARROW
+U+021D7           ⇗            \Nearrow                                     NORTH EAST DOUBLE ARROW / UPPER RIGHT DOUBLE ARROW
+U+021D8           ⇘            \Searrow                                     SOUTH EAST DOUBLE ARROW / LOWER RIGHT DOUBLE ARROW
+U+021D9           ⇙            \Swarrow                                     SOUTH WEST DOUBLE ARROW / LOWER LEFT DOUBLE ARROW
+U+021DA           ⇚            \Lleftarrow                                  LEFTWARDS TRIPLE ARROW / LEFT TRIPLE ARROW
+U+021DB           ⇛            \Rrightarrow                                 RIGHTWARDS TRIPLE ARROW / RIGHT TRIPLE ARROW
+U+021DC           ⇜            \leftsquigarrow                              LEFTWARDS SQUIGGLE ARROW / LEFT SQUIGGLE ARROW
+U+021DD           ⇝            \rightsquigarrow                             RIGHTWARDS SQUIGGLE ARROW / RIGHT SQUIGGLE ARROW
+U+021DE           ⇞            \nHuparrow                                   UPWARDS ARROW WITH DOUBLE STROKE / UP ARROW WITH DOUBLE STROKE
+U+021DF           ⇟            \nHdownarrow                                 DOWNWARDS ARROW WITH DOUBLE STROKE / DOWN ARROW WITH DOUBLE STROKE
+U+021E0           ⇠            \leftdasharrow                               LEFTWARDS DASHED ARROW / LEFT DASHED ARROW
+U+021E1           ⇡            \updasharrow                                 UPWARDS DASHED ARROW / UP DASHED ARROW
+U+021E2           ⇢            \rightdasharrow                              RIGHTWARDS DASHED ARROW / RIGHT DASHED ARROW
+U+021E3           ⇣            \downdasharrow                               DOWNWARDS DASHED ARROW / DOWN DASHED ARROW
+U+021E4           ⇤            \barleftarrow                                LEFTWARDS ARROW TO BAR / LEFT ARROW TO BAR
+U+021E5           ⇥            \rightarrowbar                               RIGHTWARDS ARROW TO BAR / RIGHT ARROW TO BAR
+U+021E6           ⇦            \leftwhitearrow                              LEFTWARDS WHITE ARROW / WHITE LEFT ARROW
+U+021E7           ⇧            \upwhitearrow                                UPWARDS WHITE ARROW / WHITE UP ARROW
+U+021E8           ⇨            \rightwhitearrow                             RIGHTWARDS WHITE ARROW / WHITE RIGHT ARROW
+U+021E9           ⇩            \downwhitearrow                              DOWNWARDS WHITE ARROW / WHITE DOWN ARROW
+U+021EA           ⇪            \whitearrowupfrombar                         UPWARDS WHITE ARROW FROM BAR / WHITE UP ARROW FROM BAR
+U+021F4           ⇴            \circleonrightarrow                          RIGHT ARROW WITH SMALL CIRCLE
+U+021F5           ⇵            \DownArrowUpArrow                            DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW
+U+021F6           ⇶            \rightthreearrows                            THREE RIGHTWARDS ARROWS
+U+021F7           ⇷            \nvleftarrow                                 LEFTWARDS ARROW WITH VERTICAL STROKE
+U+021F8           ⇸            \nvrightarrow                                RIGHTWARDS ARROW WITH VERTICAL STROKE
+U+021F9           ⇹            \nvleftrightarrow                            LEFT RIGHT ARROW WITH VERTICAL STROKE
+U+021FA           ⇺            \nVleftarrow                                 LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE
+U+021FB           ⇻            \nVrightarrow                                RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE
+U+021FC           ⇼            \nVleftrightarrow                            LEFT RIGHT ARROW WITH DOUBLE VERTICAL STROKE
+U+021FD           ⇽            \leftarrowtriangle                           LEFTWARDS OPEN-HEADED ARROW
+U+021FE           ⇾            \rightarrowtriangle                          RIGHTWARDS OPEN-HEADED ARROW
+U+021FF           ⇿            \leftrightarrowtriangle                      LEFT RIGHT OPEN-HEADED ARROW
+U+02200           ∀            \forall                                      FOR ALL
+U+02201           ∁            \complement                                  COMPLEMENT
+U+02202           ∂            \partial                                     PARTIAL DIFFERENTIAL
+U+02203           ∃            \exists                                      THERE EXISTS
+U+02204           ∄            \nexists                                     THERE DOES NOT EXIST
+U+02205           ∅            \varnothing, \emptyset                       EMPTY SET
+U+02206           ∆            \increment                                   INCREMENT
+U+02207           ∇            \del, \nabla                                 NABLA
+U+02208           ∈            \in                                          ELEMENT OF
+U+02209           ∉            \notin                                       NOT AN ELEMENT OF
+U+0220A           ∊            \smallin                                     SMALL ELEMENT OF
+U+0220B           ∋            \ni                                          CONTAINS AS MEMBER
+U+0220C           ∌            \nni                                         DOES NOT CONTAIN AS MEMBER
+U+0220D           ∍            \smallni                                     SMALL CONTAINS AS MEMBER
+U+0220E           ∎            \QED                                         END OF PROOF
+U+0220F           ∏            \prod                                        N-ARY PRODUCT
+U+02210           ∐            \coprod                                      N-ARY COPRODUCT
+U+02211           ∑            \sum                                         N-ARY SUMMATION
+U+02212           −            \minus                                       MINUS SIGN
+U+02213           ∓            \mp                                          MINUS-OR-PLUS SIGN
+U+02214           ∔            \dotplus                                     DOT PLUS
+U+02216           ∖            \setminus                                    SET MINUS
+U+02217           ∗            \ast                                         ASTERISK OPERATOR
+U+02218           ∘            \circ                                        RING OPERATOR
+U+02219           ∙            \vysmblkcircle                               BULLET OPERATOR
+U+0221A           √            \surd, \sqrt                                 SQUARE ROOT
+U+0221B           ∛            \cbrt                                        CUBE ROOT
+U+0221C           ∜            \fourthroot                                  FOURTH ROOT
+U+0221D           ∝            \propto                                      PROPORTIONAL TO
+U+0221E           ∞            \infty                                       INFINITY
+U+0221F           ∟            \rightangle                                  RIGHT ANGLE
+U+02220           ∠            \angle                                       ANGLE
+U+02221           ∡            \measuredangle                               MEASURED ANGLE
+U+02222           ∢            \sphericalangle                              SPHERICAL ANGLE
+U+02223           ∣            \mid                                         DIVIDES
+U+02224           ∤            \nmid                                        DOES NOT DIVIDE
+U+02225           ∥            \parallel                                    PARALLEL TO
+U+02226           ∦            \nparallel                                   NOT PARALLEL TO
+U+02227           ∧            \wedge                                       LOGICAL AND
+U+02228           ∨            \vee                                         LOGICAL OR
+U+02229           ∩            \cap                                         INTERSECTION
+U+0222A           ∪            \cup                                         UNION
+U+0222B           ∫            \int                                         INTEGRAL
+U+0222C           ∬            \iint                                        DOUBLE INTEGRAL
+U+0222D           ∭            \iiint                                       TRIPLE INTEGRAL
+U+0222E           ∮            \oint                                        CONTOUR INTEGRAL
+U+0222F           ∯            \oiint                                       SURFACE INTEGRAL
+U+02230           ∰            \oiiint                                      VOLUME INTEGRAL
+U+02231           ∱            \clwintegral                                 CLOCKWISE INTEGRAL
+U+02232           ∲            \varointclockwise                            CLOCKWISE CONTOUR INTEGRAL
+U+02233           ∳            \ointctrclockwise                            ANTICLOCKWISE CONTOUR INTEGRAL
+U+02234           ∴            \therefore                                   THEREFORE
+U+02235           ∵            \because                                     BECAUSE
+U+02237           ∷            \Colon                                       PROPORTION
+U+02238           ∸            \dotminus                                    DOT MINUS
+U+0223A           ∺            \dotsminusdots                               GEOMETRIC PROPORTION
+U+0223B           ∻            \kernelcontraction                           HOMOTHETIC
+U+0223C           ∼            \sim                                         TILDE OPERATOR
+U+0223D           ∽            \backsim                                     REVERSED TILDE
+U+0223E           ∾            \lazysinv                                    INVERTED LAZY S
+U+0223F           ∿            \sinewave                                    SINE WAVE
+U+02240           ≀            \wr                                          WREATH PRODUCT
+U+02241           ≁            \nsim                                        NOT TILDE
+U+02242           ≂            \eqsim                                       MINUS TILDE
+U+02242 + U+00338 ≂̸           \neqsim                                      MINUS TILDE + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+02243           ≃            \simeq                                       ASYMPTOTICALLY EQUAL TO
+U+02244           ≄            \nsime                                       NOT ASYMPTOTICALLY EQUAL TO
+U+02245           ≅            \cong                                        APPROXIMATELY EQUAL TO
+U+02246           ≆            \approxnotequal                              APPROXIMATELY BUT NOT ACTUALLY EQUAL TO
+U+02247           ≇            \ncong                                       NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO
+U+02248           ≈            \approx                                      ALMOST EQUAL TO
+U+02249           ≉            \napprox                                     NOT ALMOST EQUAL TO
+U+0224A           ≊            \approxeq                                    ALMOST EQUAL OR EQUAL TO
+U+0224B           ≋            \tildetrpl                                   TRIPLE TILDE
+U+0224C           ≌            \allequal                                    ALL EQUAL TO
+U+0224D           ≍            \asymp                                       EQUIVALENT TO
+U+0224E           ≎            \Bumpeq                                      GEOMETRICALLY EQUIVALENT TO
+U+0224E + U+00338 ≎̸           \nBumpeq                                     GEOMETRICALLY EQUIVALENT TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+0224F           ≏            \bumpeq                                      DIFFERENCE BETWEEN
+U+0224F + U+00338 ≏̸           \nbumpeq                                     DIFFERENCE BETWEEN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+02250           ≐            \doteq                                       APPROACHES THE LIMIT
+U+02251           ≑            \Doteq                                       GEOMETRICALLY EQUAL TO
+U+02252           ≒            \fallingdotseq                               APPROXIMATELY EQUAL TO OR THE IMAGE OF
+U+02253           ≓            \risingdotseq                                IMAGE OF OR APPROXIMATELY EQUAL TO
+U+02254           ≔            \coloneq                                     COLON EQUALS / COLON EQUAL
+U+02255           ≕            \eqcolon                                     EQUALS COLON / EQUAL COLON
+U+02256           ≖            \eqcirc                                      RING IN EQUAL TO
+U+02257           ≗            \circeq                                      RING EQUAL TO
+U+02258           ≘            \arceq                                       CORRESPONDS TO
+U+02259           ≙            \wedgeq                                      ESTIMATES
+U+0225A           ≚            \veeeq                                       EQUIANGULAR TO
+U+0225B           ≛            \starequal                                   STAR EQUALS
+U+0225C           ≜            \triangleq                                   DELTA EQUAL TO
+U+0225D           ≝            \eqdef                                       EQUAL TO BY DEFINITION
+U+0225E           ≞            \measeq                                      MEASURED BY
+U+0225F           ≟            \questeq                                     QUESTIONED EQUAL TO
+U+02260           ≠            \ne                                          NOT EQUAL TO
+U+02261           ≡            \equiv                                       IDENTICAL TO
+U+02262           ≢            \nequiv                                      NOT IDENTICAL TO
+U+02263           ≣            \Equiv                                       STRICTLY EQUIVALENT TO
+U+02264           ≤            \le, \leq                                    LESS-THAN OR EQUAL TO / LESS THAN OR EQUAL TO
+U+02265           ≥            \ge, \geq                                    GREATER-THAN OR EQUAL TO / GREATER THAN OR EQUAL TO
+U+02266           ≦            \leqq                                        LESS-THAN OVER EQUAL TO / LESS THAN OVER EQUAL TO
+U+02267           ≧            \geqq                                        GREATER-THAN OVER EQUAL TO / GREATER THAN OVER EQUAL TO
+U+02268           ≨            \lneqq                                       LESS-THAN BUT NOT EQUAL TO / LESS THAN BUT NOT EQUAL TO
+U+02268 + U+0FE00 ≨︀           \lvertneqq                                   LESS-THAN BUT NOT EQUAL TO / LESS THAN BUT NOT EQUAL TO + VARIATION SELECTOR-1
+U+02269           ≩            \gneqq                                       GREATER-THAN BUT NOT EQUAL TO / GREATER THAN BUT NOT EQUAL TO
+U+02269 + U+0FE00 ≩︀           \gvertneqq                                   GREATER-THAN BUT NOT EQUAL TO / GREATER THAN BUT NOT EQUAL TO + VARIATION SELECTOR-1
+U+0226A           ≪            \ll                                          MUCH LESS-THAN / MUCH LESS THAN
+U+0226A + U+00338 ≪̸           \NotLessLess                                 MUCH LESS-THAN / MUCH LESS THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+0226B           ≫            \gg                                          MUCH GREATER-THAN / MUCH GREATER THAN
+U+0226B + U+00338 ≫̸           \NotGreaterGreater                           MUCH GREATER-THAN / MUCH GREATER THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+0226C           ≬            \between                                     BETWEEN
+U+0226D           ≭            \nasymp                                      NOT EQUIVALENT TO
+U+0226E           ≮            \nless                                       NOT LESS-THAN / NOT LESS THAN
+U+0226F           ≯            \ngtr                                        NOT GREATER-THAN / NOT GREATER THAN
+U+02270           ≰            \nleq                                        NEITHER LESS-THAN NOR EQUAL TO / NEITHER LESS THAN NOR EQUAL TO
+U+02271           ≱            \ngeq                                        NEITHER GREATER-THAN NOR EQUAL TO / NEITHER GREATER THAN NOR EQUAL TO
+U+02272           ≲            \lesssim                                     LESS-THAN OR EQUIVALENT TO / LESS THAN OR EQUIVALENT TO
+U+02273           ≳            \gtrsim                                      GREATER-THAN OR EQUIVALENT TO / GREATER THAN OR EQUIVALENT TO
+U+02274           ≴            \nlesssim                                    NEITHER LESS-THAN NOR EQUIVALENT TO / NEITHER LESS THAN NOR EQUIVALENT TO
+U+02275           ≵            \ngtrsim                                     NEITHER GREATER-THAN NOR EQUIVALENT TO / NEITHER GREATER THAN NOR EQUIVALENT TO
+U+02276           ≶            \lessgtr                                     LESS-THAN OR GREATER-THAN / LESS THAN OR GREATER THAN
+U+02277           ≷            \gtrless                                     GREATER-THAN OR LESS-THAN / GREATER THAN OR LESS THAN
+U+02278           ≸            \notlessgreater                              NEITHER LESS-THAN NOR GREATER-THAN / NEITHER LESS THAN NOR GREATER THAN
+U+02279           ≹            \notgreaterless                              NEITHER GREATER-THAN NOR LESS-THAN / NEITHER GREATER THAN NOR LESS THAN
+U+0227A           ≺            \prec                                        PRECEDES
+U+0227B           ≻            \succ                                        SUCCEEDS
+U+0227C           ≼            \preccurlyeq                                 PRECEDES OR EQUAL TO
+U+0227D           ≽            \succcurlyeq                                 SUCCEEDS OR EQUAL TO
+U+0227E           ≾            \precsim                                     PRECEDES OR EQUIVALENT TO
+U+0227E + U+00338 ≾̸           \nprecsim                                    PRECEDES OR EQUIVALENT TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+0227F           ≿            \succsim                                     SUCCEEDS OR EQUIVALENT TO
+U+0227F + U+00338 ≿̸           \nsuccsim                                    SUCCEEDS OR EQUIVALENT TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+02280           ⊀            \nprec                                       DOES NOT PRECEDE
+U+02281           ⊁            \nsucc                                       DOES NOT SUCCEED
+U+02282           ⊂            \subset                                      SUBSET OF
+U+02283           ⊃            \supset                                      SUPERSET OF
+U+02284           ⊄            \nsubset                                     NOT A SUBSET OF
+U+02285           ⊅            \nsupset                                     NOT A SUPERSET OF
+U+02286           ⊆            \subseteq                                    SUBSET OF OR EQUAL TO
+U+02287           ⊇            \supseteq                                    SUPERSET OF OR EQUAL TO
+U+02288           ⊈            \nsubseteq                                   NEITHER A SUBSET OF NOR EQUAL TO
+U+02289           ⊉            \nsupseteq                                   NEITHER A SUPERSET OF NOR EQUAL TO
+U+0228A           ⊊            \subsetneq                                   SUBSET OF WITH NOT EQUAL TO / SUBSET OF OR NOT EQUAL TO
+U+0228A + U+0FE00 ⊊︀           \varsubsetneqq                               SUBSET OF WITH NOT EQUAL TO / SUBSET OF OR NOT EQUAL TO + VARIATION SELECTOR-1
+U+0228B           ⊋            \supsetneq                                   SUPERSET OF WITH NOT EQUAL TO / SUPERSET OF OR NOT EQUAL TO
+U+0228B + U+0FE00 ⊋︀           \varsupsetneq                                SUPERSET OF WITH NOT EQUAL TO / SUPERSET OF OR NOT EQUAL TO + VARIATION SELECTOR-1
+U+0228D           ⊍            \cupdot                                      MULTISET MULTIPLICATION
+U+0228E           ⊎            \uplus                                       MULTISET UNION
+U+0228F           ⊏            \sqsubset                                    SQUARE IMAGE OF
+U+0228F + U+00338 ⊏̸           \NotSquareSubset                             SQUARE IMAGE OF + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+02290           ⊐            \sqsupset                                    SQUARE ORIGINAL OF
+U+02290 + U+00338 ⊐̸           \NotSquareSuperset                           SQUARE ORIGINAL OF + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+02291           ⊑            \sqsubseteq                                  SQUARE IMAGE OF OR EQUAL TO
+U+02292           ⊒            \sqsupseteq                                  SQUARE ORIGINAL OF OR EQUAL TO
+U+02293           ⊓            \sqcap                                       SQUARE CAP
+U+02294           ⊔            \sqcup                                       SQUARE CUP
+U+02295           ⊕            \oplus                                       CIRCLED PLUS
+U+02296           ⊖            \ominus                                      CIRCLED MINUS
+U+02297           ⊗            \otimes                                      CIRCLED TIMES
+U+02298           ⊘            \oslash                                      CIRCLED DIVISION SLASH
+U+02299           ⊙            \odot                                        CIRCLED DOT OPERATOR
+U+0229A           ⊚            \circledcirc                                 CIRCLED RING OPERATOR
+U+0229B           ⊛            \circledast                                  CIRCLED ASTERISK OPERATOR
+U+0229C           ⊜            \circledequal                                CIRCLED EQUALS
+U+0229D           ⊝            \circleddash                                 CIRCLED DASH
+U+0229E           ⊞            \boxplus                                     SQUARED PLUS
+U+0229F           ⊟            \boxminus                                    SQUARED MINUS
+U+022A0           ⊠            \boxtimes                                    SQUARED TIMES
+U+022A1           ⊡            \boxdot                                      SQUARED DOT OPERATOR
+U+022A2           ⊢            \vdash                                       RIGHT TACK
+U+022A3           ⊣            \dashv                                       LEFT TACK
+U+022A4           ⊤            \top                                         DOWN TACK
+U+022A5           ⊥            \bot                                         UP TACK
+U+022A7           ⊧            \models                                      MODELS
+U+022A8           ⊨            \vDash                                       TRUE
+U+022A9           ⊩            \Vdash                                       FORCES
+U+022AA           ⊪            \Vvdash                                      TRIPLE VERTICAL BAR RIGHT TURNSTILE
+U+022AB           ⊫            \VDash                                       DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
+U+022AC           ⊬            \nvdash                                      DOES NOT PROVE
+U+022AD           ⊭            \nvDash                                      NOT TRUE
+U+022AE           ⊮            \nVdash                                      DOES NOT FORCE
+U+022AF           ⊯            \nVDash                                      NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
+U+022B0           ⊰            \prurel                                      PRECEDES UNDER RELATION
+U+022B1           ⊱            \scurel                                      SUCCEEDS UNDER RELATION
+U+022B2           ⊲            \vartriangleleft                             NORMAL SUBGROUP OF
+U+022B3           ⊳            \vartriangleright                            CONTAINS AS NORMAL SUBGROUP
+U+022B4           ⊴            \trianglelefteq                              NORMAL SUBGROUP OF OR EQUAL TO
+U+022B5           ⊵            \trianglerighteq                             CONTAINS AS NORMAL SUBGROUP OR EQUAL TO
+U+022B6           ⊶            \original                                    ORIGINAL OF
+U+022B7           ⊷            \image                                       IMAGE OF
+U+022B8           ⊸            \multimap                                    MULTIMAP
+U+022B9           ⊹            \hermitconjmatrix                            HERMITIAN CONJUGATE MATRIX
+U+022BA           ⊺            \intercal                                    INTERCALATE
+U+022BB           ⊻            \veebar, \xor                                XOR
+U+022BC           ⊼            \barwedge                                    NAND
+U+022BD           ⊽            \barvee                                      NOR
+U+022BE           ⊾            \rightanglearc                               RIGHT ANGLE WITH ARC
+U+022BF           ⊿            \varlrtriangle                               RIGHT TRIANGLE
+U+022C0           ⋀            \bigwedge                                    N-ARY LOGICAL AND
+U+022C1           ⋁            \bigvee                                      N-ARY LOGICAL OR
+U+022C2           ⋂            \bigcap                                      N-ARY INTERSECTION
+U+022C3           ⋃            \bigcup                                      N-ARY UNION
+U+022C4           ⋄            \diamond                                     DIAMOND OPERATOR
+U+022C5           ⋅            \cdot                                        DOT OPERATOR
+U+022C6           ⋆            \star                                        STAR OPERATOR
+U+022C7           ⋇            \divideontimes                               DIVISION TIMES
+U+022C8           ⋈            \bowtie                                      BOWTIE
+U+022C9           ⋉            \ltimes                                      LEFT NORMAL FACTOR SEMIDIRECT PRODUCT
+U+022CA           ⋊            \rtimes                                      RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT
+U+022CB           ⋋            \leftthreetimes                              LEFT SEMIDIRECT PRODUCT
+U+022CC           ⋌            \rightthreetimes                             RIGHT SEMIDIRECT PRODUCT
+U+022CD           ⋍            \backsimeq                                   REVERSED TILDE EQUALS
+U+022CE           ⋎            \curlyvee                                    CURLY LOGICAL OR
+U+022CF           ⋏            \curlywedge                                  CURLY LOGICAL AND
+U+022D0           ⋐            \Subset                                      DOUBLE SUBSET
+U+022D1           ⋑            \Supset                                      DOUBLE SUPERSET
+U+022D2           ⋒            \Cap                                         DOUBLE INTERSECTION
+U+022D3           ⋓            \Cup                                         DOUBLE UNION
+U+022D4           ⋔            \pitchfork                                   PITCHFORK
+U+022D5           ⋕            \equalparallel                               EQUAL AND PARALLEL TO
+U+022D6           ⋖            \lessdot                                     LESS-THAN WITH DOT / LESS THAN WITH DOT
+U+022D7           ⋗            \gtrdot                                      GREATER-THAN WITH DOT / GREATER THAN WITH DOT
+U+022D8           ⋘            \verymuchless                                VERY MUCH LESS-THAN / VERY MUCH LESS THAN
+U+022D9           ⋙            \ggg                                         VERY MUCH GREATER-THAN / VERY MUCH GREATER THAN
+U+022DA           ⋚            \lesseqgtr                                   LESS-THAN EQUAL TO OR GREATER-THAN / LESS THAN EQUAL TO OR GREATER THAN
+U+022DB           ⋛            \gtreqless                                   GREATER-THAN EQUAL TO OR LESS-THAN / GREATER THAN EQUAL TO OR LESS THAN
+U+022DC           ⋜            \eqless                                      EQUAL TO OR LESS-THAN / EQUAL TO OR LESS THAN
+U+022DD           ⋝            \eqgtr                                       EQUAL TO OR GREATER-THAN / EQUAL TO OR GREATER THAN
+U+022DE           ⋞            \curlyeqprec                                 EQUAL TO OR PRECEDES
+U+022DF           ⋟            \curlyeqsucc                                 EQUAL TO OR SUCCEEDS
+U+022E0           ⋠            \npreccurlyeq                                DOES NOT PRECEDE OR EQUAL
+U+022E1           ⋡            \nsucccurlyeq                                DOES NOT SUCCEED OR EQUAL
+U+022E2           ⋢            \nsqsubseteq                                 NOT SQUARE IMAGE OF OR EQUAL TO
+U+022E3           ⋣            \nsqsupseteq                                 NOT SQUARE ORIGINAL OF OR EQUAL TO
+U+022E4           ⋤            \sqsubsetneq                                 SQUARE IMAGE OF OR NOT EQUAL TO
+U+022E5           ⋥            \sqspne                                      SQUARE ORIGINAL OF OR NOT EQUAL TO
+U+022E6           ⋦            \lnsim                                       LESS-THAN BUT NOT EQUIVALENT TO / LESS THAN BUT NOT EQUIVALENT TO
+U+022E7           ⋧            \gnsim                                       GREATER-THAN BUT NOT EQUIVALENT TO / GREATER THAN BUT NOT EQUIVALENT TO
+U+022E8           ⋨            \precnsim                                    PRECEDES BUT NOT EQUIVALENT TO
+U+022E9           ⋩            \succnsim                                    SUCCEEDS BUT NOT EQUIVALENT TO
+U+022EA           ⋪            \ntriangleleft                               NOT NORMAL SUBGROUP OF
+U+022EB           ⋫            \ntriangleright                              DOES NOT CONTAIN AS NORMAL SUBGROUP
+U+022EC           ⋬            \ntrianglelefteq                             NOT NORMAL SUBGROUP OF OR EQUAL TO
+U+022ED           ⋭            \ntrianglerighteq                            DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL
+U+022EE           ⋮            \vdots                                       VERTICAL ELLIPSIS
+U+022EF           ⋯            \cdots                                       MIDLINE HORIZONTAL ELLIPSIS
+U+022F0           ⋰            \adots                                       UP RIGHT DIAGONAL ELLIPSIS
+U+022F1           ⋱            \ddots                                       DOWN RIGHT DIAGONAL ELLIPSIS
+U+022F2           ⋲            \disin                                       ELEMENT OF WITH LONG HORIZONTAL STROKE
+U+022F3           ⋳            \varisins                                    ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
+U+022F4           ⋴            \isins                                       SMALL ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
+U+022F5           ⋵            \isindot                                     ELEMENT OF WITH DOT ABOVE
+U+022F6           ⋶            \varisinobar                                 ELEMENT OF WITH OVERBAR
+U+022F7           ⋷            \isinobar                                    SMALL ELEMENT OF WITH OVERBAR
+U+022F8           ⋸            \isinvb                                      ELEMENT OF WITH UNDERBAR
+U+022F9           ⋹            \isinE                                       ELEMENT OF WITH TWO HORIZONTAL STROKES
+U+022FA           ⋺            \nisd                                        CONTAINS WITH LONG HORIZONTAL STROKE
+U+022FB           ⋻            \varnis                                      CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
+U+022FC           ⋼            \nis                                         SMALL CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
+U+022FD           ⋽            \varniobar                                   CONTAINS WITH OVERBAR
+U+022FE           ⋾            \niobar                                      SMALL CONTAINS WITH OVERBAR
+U+022FF           ⋿            \bagmember                                   Z NOTATION BAG MEMBERSHIP
+U+02300           ⌀            \diameter                                    DIAMETER SIGN
+U+02302           ⌂            \house                                       HOUSE
+U+02305           ⌅            \varbarwedge                                 PROJECTIVE
+U+02306           ⌆            \vardoublebarwedge                           PERSPECTIVE
+U+02308           ⌈            \lceil                                       LEFT CEILING
+U+02309           ⌉            \rceil                                       RIGHT CEILING
+U+0230A           ⌊            \lfloor                                      LEFT FLOOR
+U+0230B           ⌋            \rfloor                                      RIGHT FLOOR
+U+02310           ⌐            \invnot                                      REVERSED NOT SIGN
+U+02311           ⌑            \sqlozenge                                   SQUARE LOZENGE
+U+02312           ⌒            \profline                                    ARC
+U+02313           ⌓            \profsurf                                    SEGMENT
+U+02315           ⌕            \recorder                                    TELEPHONE RECORDER
+U+02317           ⌗            \viewdata                                    VIEWDATA SQUARE
+U+02319           ⌙            \turnednot                                   TURNED NOT SIGN
+U+0231A           ⌚            \:watch:                                     WATCH
+U+0231B           ⌛            \:hourglass:                                 HOURGLASS
+U+0231C           ⌜            \ulcorner                                    TOP LEFT CORNER
+U+0231D           ⌝            \urcorner                                    TOP RIGHT CORNER
+U+0231E           ⌞            \llcorner                                    BOTTOM LEFT CORNER
+U+0231F           ⌟            \lrcorner                                    BOTTOM RIGHT CORNER
+U+02322           ⌢            \frown                                       FROWN
+U+02323           ⌣            \smile                                       SMILE
+U+0232C           ⌬            \varhexagonlrbonds                           BENZENE RING
+U+02332           ⌲            \conictaper                                  CONICAL TAPER
+U+02336           ⌶            \topbot                                      APL FUNCTIONAL SYMBOL I-BEAM
+U+0233D           ⌽            \obar                                        APL FUNCTIONAL SYMBOL CIRCLE STILE
+U+0233F           ⌿            \notslash                                    APL FUNCTIONAL SYMBOL SLASH BAR
+U+02340           ⍀            \notbackslash                                APL FUNCTIONAL SYMBOL BACKSLASH BAR
+U+02353           ⍓            \boxupcaret                                  APL FUNCTIONAL SYMBOL QUAD UP CARET
+U+02370           ⍰            \boxquestion                                 APL FUNCTIONAL SYMBOL QUAD QUESTION
+U+02394           ⎔            \hexagon                                     SOFTWARE-FUNCTION SYMBOL
+U+023A3           ⎣            \dlcorn                                      LEFT SQUARE BRACKET LOWER CORNER
+U+023B0           ⎰            \lmoustache                                  UPPER LEFT OR LOWER RIGHT CURLY BRACKET SECTION
+U+023B1           ⎱            \rmoustache                                  UPPER RIGHT OR LOWER LEFT CURLY BRACKET SECTION
+U+023B4           ⎴            \overbracket                                 TOP SQUARE BRACKET
+U+023B5           ⎵            \underbracket                                BOTTOM SQUARE BRACKET
+U+023B6           ⎶            \bbrktbrk                                    BOTTOM SQUARE BRACKET OVER TOP SQUARE BRACKET
+U+023B7           ⎷            \sqrtbottom                                  RADICAL SYMBOL BOTTOM
+U+023B8           ⎸            \lvboxline                                   LEFT VERTICAL BOX LINE
+U+023B9           ⎹            \rvboxline                                   RIGHT VERTICAL BOX LINE
+U+023CE           ⏎            \varcarriagereturn                           RETURN SYMBOL
+U+023DE           ⏞            \overbrace                                   TOP CURLY BRACKET
+U+023DF           ⏟            \underbrace                                  BOTTOM CURLY BRACKET
+U+023E2           ⏢            \trapezium                                   WHITE TRAPEZIUM
+U+023E3           ⏣            \benzenr                                     BENZENE RING WITH CIRCLE
+U+023E4           ⏤            \strns                                       STRAIGHTNESS
+U+023E5           ⏥            \fltns                                       FLATNESS
+U+023E6           ⏦            \accurrent                                   AC CURRENT
+U+023E7           ⏧            \elinters                                    ELECTRICAL INTERSECTION
+U+023E9           ⏩            \:fast_forward:                              BLACK RIGHT-POINTING DOUBLE TRIANGLE
+U+023EA           ⏪            \:rewind:                                    BLACK LEFT-POINTING DOUBLE TRIANGLE
+U+023EB           ⏫            \:arrow_double_up:                           BLACK UP-POINTING DOUBLE TRIANGLE
+U+023EC           ⏬            \:arrow_double_down:                         BLACK DOWN-POINTING DOUBLE TRIANGLE
+U+023F0           ⏰            \:alarm_clock:                               ALARM CLOCK
+U+023F3           ⏳            \:hourglass_flowing_sand:                    HOURGLASS WITH FLOWING SAND
+U+02422           ␢            \blanksymbol                                 BLANK SYMBOL / BLANK
+U+02423           ␣            \visiblespace                                OPEN BOX
+U+024C2           Ⓜ            \:m:                                         CIRCLED LATIN CAPITAL LETTER M
+U+024C8           Ⓢ            \circledS                                    CIRCLED LATIN CAPITAL LETTER S
+U+02506           ┆            \dshfnc                                      BOX DRAWINGS LIGHT TRIPLE DASH VERTICAL / FORMS LIGHT TRIPLE DASH VERTICAL
+U+02519           ┙            \sqfnw                                       BOX DRAWINGS UP LIGHT AND LEFT HEAVY / FORMS UP LIGHT AND LEFT HEAVY
+U+02571           ╱            \diagup                                      BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT / FORMS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT
+U+02572           ╲            \diagdown                                    BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT / FORMS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT
+U+02580           ▀            \blockuphalf                                 UPPER HALF BLOCK
+U+02584           ▄            \blocklowhalf                                LOWER HALF BLOCK
+U+02588           █            \blockfull                                   FULL BLOCK
+U+0258C           ▌            \blocklefthalf                               LEFT HALF BLOCK
+U+02590           ▐            \blockrighthalf                              RIGHT HALF BLOCK
+U+02591           ░            \blockqtrshaded                              LIGHT SHADE
+U+02592           ▒            \blockhalfshaded                             MEDIUM SHADE
+U+02593           ▓            \blockthreeqtrshaded                         DARK SHADE
+U+025A0           ■            \blacksquare                                 BLACK SQUARE
+U+025A1           □            \square                                      WHITE SQUARE
+U+025A2           ▢            \squoval                                     WHITE SQUARE WITH ROUNDED CORNERS
+U+025A3           ▣            \blackinwhitesquare                          WHITE SQUARE CONTAINING BLACK SMALL SQUARE
+U+025A4           ▤            \squarehfill                                 SQUARE WITH HORIZONTAL FILL
+U+025A5           ▥            \squarevfill                                 SQUARE WITH VERTICAL FILL
+U+025A6           ▦            \squarehvfill                                SQUARE WITH ORTHOGONAL CROSSHATCH FILL
+U+025A7           ▧            \squarenwsefill                              SQUARE WITH UPPER LEFT TO LOWER RIGHT FILL
+U+025A8           ▨            \squareneswfill                              SQUARE WITH UPPER RIGHT TO LOWER LEFT FILL
+U+025A9           ▩            \squarecrossfill                             SQUARE WITH DIAGONAL CROSSHATCH FILL
+U+025AA           ▪            \smblksquare, \:black_small_square:          BLACK SMALL SQUARE
+U+025AB           ▫            \smwhtsquare, \:white_small_square:          WHITE SMALL SQUARE
+U+025AC           ▬            \hrectangleblack                             BLACK RECTANGLE
+U+025AD           ▭            \hrectangle                                  WHITE RECTANGLE
+U+025AE           ▮            \vrectangleblack                             BLACK VERTICAL RECTANGLE
+U+025AF           ▯            \vrecto                                      WHITE VERTICAL RECTANGLE
+U+025B0           ▰            \parallelogramblack                          BLACK PARALLELOGRAM
+U+025B1           ▱            \parallelogram                               WHITE PARALLELOGRAM
+U+025B2           ▲            \bigblacktriangleup                          BLACK UP-POINTING TRIANGLE / BLACK UP POINTING TRIANGLE
+U+025B3           △            \bigtriangleup                               WHITE UP-POINTING TRIANGLE / WHITE UP POINTING TRIANGLE
+U+025B4           ▴            \blacktriangle                               BLACK UP-POINTING SMALL TRIANGLE / BLACK UP POINTING SMALL TRIANGLE
+U+025B5           ▵            \vartriangle                                 WHITE UP-POINTING SMALL TRIANGLE / WHITE UP POINTING SMALL TRIANGLE
+U+025B6           ▶            \blacktriangleright, \:arrow_forward:        BLACK RIGHT-POINTING TRIANGLE / BLACK RIGHT POINTING TRIANGLE
+U+025B7           ▷            \triangleright                               WHITE RIGHT-POINTING TRIANGLE / WHITE RIGHT POINTING TRIANGLE
+U+025B8           ▸            \smallblacktriangleright                     BLACK RIGHT-POINTING SMALL TRIANGLE / BLACK RIGHT POINTING SMALL TRIANGLE
+U+025B9           ▹            \smalltriangleright                          WHITE RIGHT-POINTING SMALL TRIANGLE / WHITE RIGHT POINTING SMALL TRIANGLE
+U+025BA           ►            \blackpointerright                           BLACK RIGHT-POINTING POINTER / BLACK RIGHT POINTING POINTER
+U+025BB           ▻            \whitepointerright                           WHITE RIGHT-POINTING POINTER / WHITE RIGHT POINTING POINTER
+U+025BC           ▼            \bigblacktriangledown                        BLACK DOWN-POINTING TRIANGLE / BLACK DOWN POINTING TRIANGLE
+U+025BD           ▽            \bigtriangledown                             WHITE DOWN-POINTING TRIANGLE / WHITE DOWN POINTING TRIANGLE
+U+025BE           ▾            \blacktriangledown                           BLACK DOWN-POINTING SMALL TRIANGLE / BLACK DOWN POINTING SMALL TRIANGLE
+U+025BF           ▿            \triangledown                                WHITE DOWN-POINTING SMALL TRIANGLE / WHITE DOWN POINTING SMALL TRIANGLE
+U+025C0           ◀            \blacktriangleleft, \:arrow_backward:        BLACK LEFT-POINTING TRIANGLE / BLACK LEFT POINTING TRIANGLE
+U+025C1           ◁            \triangleleft                                WHITE LEFT-POINTING TRIANGLE / WHITE LEFT POINTING TRIANGLE
+U+025C2           ◂            \smallblacktriangleleft                      BLACK LEFT-POINTING SMALL TRIANGLE / BLACK LEFT POINTING SMALL TRIANGLE
+U+025C3           ◃            \smalltriangleleft                           WHITE LEFT-POINTING SMALL TRIANGLE / WHITE LEFT POINTING SMALL TRIANGLE
+U+025C4           ◄            \blackpointerleft                            BLACK LEFT-POINTING POINTER / BLACK LEFT POINTING POINTER
+U+025C5           ◅            \whitepointerleft                            WHITE LEFT-POINTING POINTER / WHITE LEFT POINTING POINTER
+U+025C6           ◆            \mdlgblkdiamond                              BLACK DIAMOND
+U+025C7           ◇            \mdlgwhtdiamond                              WHITE DIAMOND
+U+025C8           ◈            \blackinwhitediamond                         WHITE DIAMOND CONTAINING BLACK SMALL DIAMOND
+U+025C9           ◉            \fisheye                                     FISHEYE
+U+025CA           ◊            \lozenge                                     LOZENGE
+U+025CB           ○            \bigcirc                                     WHITE CIRCLE
+U+025CC           ◌            \dottedcircle                                DOTTED CIRCLE
+U+025CD           ◍            \circlevertfill                              CIRCLE WITH VERTICAL FILL
+U+025CE           ◎            \bullseye                                    BULLSEYE
+U+025CF           ●            \mdlgblkcircle                               BLACK CIRCLE
+U+025D0           ◐            \cirfl                                       CIRCLE WITH LEFT HALF BLACK
+U+025D1           ◑            \cirfr                                       CIRCLE WITH RIGHT HALF BLACK
+U+025D2           ◒            \cirfb                                       CIRCLE WITH LOWER HALF BLACK
+U+025D3           ◓            \circletophalfblack                          CIRCLE WITH UPPER HALF BLACK
+U+025D4           ◔            \circleurquadblack                           CIRCLE WITH UPPER RIGHT QUADRANT BLACK
+U+025D5           ◕            \blackcircleulquadwhite                      CIRCLE WITH ALL BUT UPPER LEFT QUADRANT BLACK
+U+025D6           ◖            \blacklefthalfcircle                         LEFT HALF BLACK CIRCLE
+U+025D7           ◗            \blackrighthalfcircle                        RIGHT HALF BLACK CIRCLE
+U+025D8           ◘            \rvbull                                      INVERSE BULLET
+U+025D9           ◙            \inversewhitecircle                          INVERSE WHITE CIRCLE
+U+025DA           ◚            \invwhiteupperhalfcircle                     UPPER HALF INVERSE WHITE CIRCLE
+U+025DB           ◛            \invwhitelowerhalfcircle                     LOWER HALF INVERSE WHITE CIRCLE
+U+025DC           ◜            \ularc                                       UPPER LEFT QUADRANT CIRCULAR ARC
+U+025DD           ◝            \urarc                                       UPPER RIGHT QUADRANT CIRCULAR ARC
+U+025DE           ◞            \lrarc                                       LOWER RIGHT QUADRANT CIRCULAR ARC
+U+025DF           ◟            \llarc                                       LOWER LEFT QUADRANT CIRCULAR ARC
+U+025E0           ◠            \topsemicircle                               UPPER HALF CIRCLE
+U+025E1           ◡            \botsemicircle                               LOWER HALF CIRCLE
+U+025E2           ◢            \lrblacktriangle                             BLACK LOWER RIGHT TRIANGLE
+U+025E3           ◣            \llblacktriangle                             BLACK LOWER LEFT TRIANGLE
+U+025E4           ◤            \ulblacktriangle                             BLACK UPPER LEFT TRIANGLE
+U+025E5           ◥            \urblacktriangle                             BLACK UPPER RIGHT TRIANGLE
+U+025E6           ◦            \smwhtcircle                                 WHITE BULLET
+U+025E7           ◧            \sqfl                                        SQUARE WITH LEFT HALF BLACK
+U+025E8           ◨            \sqfr                                        SQUARE WITH RIGHT HALF BLACK
+U+025E9           ◩            \squareulblack                               SQUARE WITH UPPER LEFT DIAGONAL HALF BLACK
+U+025EA           ◪            \sqfse                                       SQUARE WITH LOWER RIGHT DIAGONAL HALF BLACK
+U+025EB           ◫            \boxbar                                      WHITE SQUARE WITH VERTICAL BISECTING LINE
+U+025EC           ◬            \trianglecdot                                WHITE UP-POINTING TRIANGLE WITH DOT / WHITE UP POINTING TRIANGLE WITH DOT
+U+025ED           ◭            \triangleleftblack                           UP-POINTING TRIANGLE WITH LEFT HALF BLACK / UP POINTING TRIANGLE WITH LEFT HALF BLACK
+U+025EE           ◮            \trianglerightblack                          UP-POINTING TRIANGLE WITH RIGHT HALF BLACK / UP POINTING TRIANGLE WITH RIGHT HALF BLACK
+U+025EF           ◯            \lgwhtcircle                                 LARGE CIRCLE
+U+025F0           ◰            \squareulquad                                WHITE SQUARE WITH UPPER LEFT QUADRANT
+U+025F1           ◱            \squarellquad                                WHITE SQUARE WITH LOWER LEFT QUADRANT
+U+025F2           ◲            \squarelrquad                                WHITE SQUARE WITH LOWER RIGHT QUADRANT
+U+025F3           ◳            \squareurquad                                WHITE SQUARE WITH UPPER RIGHT QUADRANT
+U+025F4           ◴            \circleulquad                                WHITE CIRCLE WITH UPPER LEFT QUADRANT
+U+025F5           ◵            \circlellquad                                WHITE CIRCLE WITH LOWER LEFT QUADRANT
+U+025F6           ◶            \circlelrquad                                WHITE CIRCLE WITH LOWER RIGHT QUADRANT
+U+025F7           ◷            \circleurquad                                WHITE CIRCLE WITH UPPER RIGHT QUADRANT
+U+025F8           ◸            \ultriangle                                  UPPER LEFT TRIANGLE
+U+025F9           ◹            \urtriangle                                  UPPER RIGHT TRIANGLE
+U+025FA           ◺            \lltriangle                                  LOWER LEFT TRIANGLE
+U+025FB           ◻            \mdwhtsquare, \:white_medium_square:         WHITE MEDIUM SQUARE
+U+025FC           ◼            \mdblksquare, \:black_medium_square:         BLACK MEDIUM SQUARE
+U+025FD           ◽            \mdsmwhtsquare, \:white_medium_small_square: WHITE MEDIUM SMALL SQUARE
+U+025FE           ◾            \mdsmblksquare, \:black_medium_small_square: BLACK MEDIUM SMALL SQUARE
+U+025FF           ◿            \lrtriangle                                  LOWER RIGHT TRIANGLE
+U+02600           ☀            \:sunny:                                     BLACK SUN WITH RAYS
+U+02601           ☁            \:cloud:                                     CLOUD
+U+02605           ★            \bigstar                                     BLACK STAR
+U+02606           ☆            \bigwhitestar                                WHITE STAR
+U+02609           ☉            \astrosun                                    SUN
+U+0260E           ☎            \:phone:                                     BLACK TELEPHONE
+U+02611           ☑            \:ballot_box_with_check:                     BALLOT BOX WITH CHECK
+U+02614           ☔            \:umbrella:                                  UMBRELLA WITH RAIN DROPS
+U+02615           ☕            \:coffee:                                    HOT BEVERAGE
+U+0261D           ☝            \:point_up:                                  WHITE UP POINTING INDEX
+U+02621           ☡            \danger                                      CAUTION SIGN
+U+0263A           ☺            \:relaxed:                                   WHITE SMILING FACE
+U+0263B           ☻            \blacksmiley                                 BLACK SMILING FACE
+U+0263C           ☼            \sun                                         WHITE SUN WITH RAYS
+U+0263D           ☽            \rightmoon                                   FIRST QUARTER MOON
+U+0263E           ☾            \leftmoon                                    LAST QUARTER MOON
+U+0263F           ☿            \mercury                                     MERCURY
+U+02640           ♀            \venus, \female                              FEMALE SIGN
+U+02642           ♂            \male, \mars                                 MALE SIGN
+U+02643           ♃            \jupiter                                     JUPITER
+U+02644           ♄            \saturn                                      SATURN
+U+02645           ♅            \uranus                                      URANUS
+U+02646           ♆            \neptune                                     NEPTUNE
+U+02647           ♇            \pluto                                       PLUTO
+U+02648           ♈            \aries, \:aries:                             ARIES
+U+02649           ♉            \taurus, \:taurus:                           TAURUS
+U+0264A           ♊            \gemini, \:gemini:                           GEMINI
+U+0264B           ♋            \cancer, \:cancer:                           CANCER
+U+0264C           ♌            \leo, \:leo:                                 LEO
+U+0264D           ♍            \virgo, \:virgo:                             VIRGO
+U+0264E           ♎            \libra, \:libra:                             LIBRA
+U+0264F           ♏            \scorpio, \:scorpius:                        SCORPIUS
+U+02650           ♐            \sagittarius, \:sagittarius:                 SAGITTARIUS
+U+02651           ♑            \capricornus, \:capricorn:                   CAPRICORN
+U+02652           ♒            \aquarius, \:aquarius:                       AQUARIUS
+U+02653           ♓            \pisces, \:pisces:                           PISCES
+U+02660           ♠            \spadesuit, \:spades:                        BLACK SPADE SUIT
+U+02661           ♡            \heartsuit                                   WHITE HEART SUIT
+U+02662           ♢            \diamondsuit                                 WHITE DIAMOND SUIT
+U+02663           ♣            \clubsuit, \:clubs:                          BLACK CLUB SUIT
+U+02664           ♤            \varspadesuit                                WHITE SPADE SUIT
+U+02665           ♥            \varheartsuit, \:hearts:                     BLACK HEART SUIT
+U+02666           ♦            \vardiamondsuit, \:diamonds:                 BLACK DIAMOND SUIT
+U+02667           ♧            \varclubsuit                                 WHITE CLUB SUIT
+U+02668           ♨            \:hotsprings:                                HOT SPRINGS
+U+02669           ♩            \quarternote                                 QUARTER NOTE
+U+0266A           ♪            \eighthnote                                  EIGHTH NOTE
+U+0266B           ♫            \twonotes                                    BEAMED EIGHTH NOTES / BARRED EIGHTH NOTES
+U+0266D           ♭            \flat                                        MUSIC FLAT SIGN / FLAT
+U+0266E           ♮            \natural                                     MUSIC NATURAL SIGN / NATURAL
+U+0266F           ♯            \sharp                                       MUSIC SHARP SIGN / SHARP
+U+0267B           ♻            \:recycle:                                   BLACK UNIVERSAL RECYCLING SYMBOL
+U+0267E           ♾            \acidfree                                    PERMANENT PAPER SIGN
+U+0267F           ♿            \:wheelchair:                                WHEELCHAIR SYMBOL
+U+02680           ⚀            \dicei                                       DIE FACE-1
+U+02681           ⚁            \diceii                                      DIE FACE-2
+U+02682           ⚂            \diceiii                                     DIE FACE-3
+U+02683           ⚃            \diceiv                                      DIE FACE-4
+U+02684           ⚄            \dicev                                       DIE FACE-5
+U+02685           ⚅            \dicevi                                      DIE FACE-6
+U+02686           ⚆            \circledrightdot                             WHITE CIRCLE WITH DOT RIGHT
+U+02687           ⚇            \circledtwodots                              WHITE CIRCLE WITH TWO DOTS
+U+02688           ⚈            \blackcircledrightdot                        BLACK CIRCLE WITH WHITE DOT RIGHT
+U+02689           ⚉            \blackcircledtwodots                         BLACK CIRCLE WITH TWO WHITE DOTS
+U+02693           ⚓            \:anchor:                                    ANCHOR
+U+026A0           ⚠            \:warning:                                   WARNING SIGN
+U+026A1           ⚡            \:zap:                                       HIGH VOLTAGE SIGN
+U+026A5           ⚥            \hermaphrodite                               MALE AND FEMALE SIGN
+U+026AA           ⚪            \mdwhtcircle, \:white_circle:                MEDIUM WHITE CIRCLE
+U+026AB           ⚫            \mdblkcircle, \:black_circle:                MEDIUM BLACK CIRCLE
+U+026AC           ⚬            \mdsmwhtcircle                               MEDIUM SMALL WHITE CIRCLE
+U+026B2           ⚲            \neuter                                      NEUTER
+U+026BD           ⚽            \:soccer:                                    SOCCER BALL
+U+026BE           ⚾            \:baseball:                                  BASEBALL
+U+026C4           ⛄            \:snowman:                                   SNOWMAN WITHOUT SNOW
+U+026C5           ⛅            \:partly_sunny:                              SUN BEHIND CLOUD
+U+026CE           ⛎            \:ophiuchus:                                 OPHIUCHUS
+U+026D4           ⛔            \:no_entry:                                  NO ENTRY
+U+026EA           ⛪            \:church:                                    CHURCH
+U+026F2           ⛲            \:fountain:                                  FOUNTAIN
+U+026F3           ⛳            \:golf:                                      FLAG IN HOLE
+U+026F5           ⛵            \:boat:                                      SAILBOAT
+U+026FA           ⛺            \:tent:                                      TENT
+U+026FD           ⛽            \:fuelpump:                                  FUEL PUMP
+U+02702           ✂            \:scissors:                                  BLACK SCISSORS
+U+02705           ✅            \:white_check_mark:                          WHITE HEAVY CHECK MARK
+U+02708           ✈            \:airplane:                                  AIRPLANE
+U+02709           ✉            \:email:                                     ENVELOPE
+U+0270A           ✊            \:fist:                                      RAISED FIST
+U+0270B           ✋            \:hand:                                      RAISED HAND
+U+0270C           ✌            \:v:                                         VICTORY HAND
+U+0270F           ✏            \:pencil2:                                   PENCIL
+U+02712           ✒            \:black_nib:                                 BLACK NIB
+U+02713           ✓            \checkmark                                   CHECK MARK
+U+02714           ✔            \:heavy_check_mark:                          HEAVY CHECK MARK
+U+02716           ✖            \:heavy_multiplication_x:                    HEAVY MULTIPLICATION X
+U+02720           ✠            \maltese                                     MALTESE CROSS
+U+02728           ✨            \:sparkles:                                  SPARKLES
+U+0272A           ✪            \circledstar                                 CIRCLED WHITE STAR
+U+02733           ✳            \:eight_spoked_asterisk:                     EIGHT SPOKED ASTERISK
+U+02734           ✴            \:eight_pointed_black_star:                  EIGHT POINTED BLACK STAR
+U+02736           ✶            \varstar                                     SIX POINTED BLACK STAR
+U+0273D           ✽            \dingasterisk                                HEAVY TEARDROP-SPOKED ASTERISK
+U+02744           ❄            \:snowflake:                                 SNOWFLAKE
+U+02747           ❇            \:sparkle:                                   SPARKLE
+U+0274C           ❌            \:x:                                         CROSS MARK
+U+0274E           ❎            \:negative_squared_cross_mark:               NEGATIVE SQUARED CROSS MARK
+U+02753           ❓            \:question:                                  BLACK QUESTION MARK ORNAMENT
+U+02754           ❔            \:grey_question:                             WHITE QUESTION MARK ORNAMENT
+U+02755           ❕            \:grey_exclamation:                          WHITE EXCLAMATION MARK ORNAMENT
+U+02757           ❗            \:exclamation:                               HEAVY EXCLAMATION MARK SYMBOL
+U+02764           ❤            \:heart:                                     HEAVY BLACK HEART
+U+02795           ➕            \:heavy_plus_sign:                           HEAVY PLUS SIGN
+U+02796           ➖            \:heavy_minus_sign:                          HEAVY MINUS SIGN
+U+02797           ➗            \:heavy_division_sign:                       HEAVY DIVISION SIGN
+U+0279B           ➛            \draftingarrow                               DRAFTING POINT RIGHTWARDS ARROW / DRAFTING POINT RIGHT ARROW
+U+027A1           ➡            \:arrow_right:                               BLACK RIGHTWARDS ARROW / BLACK RIGHT ARROW
+U+027B0           ➰            \:curly_loop:                                CURLY LOOP
+U+027BF           ➿            \:loop:                                      DOUBLE CURLY LOOP
+U+027C0           ⟀            \threedangle                                 THREE DIMENSIONAL ANGLE
+U+027C1           ⟁            \whiteinwhitetriangle                        WHITE TRIANGLE CONTAINING SMALL WHITE TRIANGLE
+U+027C2           ⟂            \perp                                        PERPENDICULAR
+U+027C8           ⟈            \bsolhsub                                    REVERSE SOLIDUS PRECEDING SUBSET
+U+027C9           ⟉            \suphsol                                     SUPERSET PRECEDING SOLIDUS
+U+027D1           ⟑            \wedgedot                                    AND WITH DOT
+U+027D2           ⟒            \upin                                        ELEMENT OF OPENING UPWARDS
+U+027D5           ⟕            \leftouterjoin                               LEFT OUTER JOIN
+U+027D6           ⟖            \rightouterjoin                              RIGHT OUTER JOIN
+U+027D7           ⟗            \fullouterjoin                               FULL OUTER JOIN
+U+027D8           ⟘            \bigbot                                      LARGE UP TACK
+U+027D9           ⟙            \bigtop                                      LARGE DOWN TACK
+U+027E6           ⟦            \llbracket, \openbracketleft                 MATHEMATICAL LEFT WHITE SQUARE BRACKET
+U+027E7           ⟧            \openbracketright, \rrbracket                MATHEMATICAL RIGHT WHITE SQUARE BRACKET
+U+027E8           ⟨            \langle                                      MATHEMATICAL LEFT ANGLE BRACKET
+U+027E9           ⟩            \rangle                                      MATHEMATICAL RIGHT ANGLE BRACKET
+U+027F0           ⟰            \UUparrow                                    UPWARDS QUADRUPLE ARROW
+U+027F1           ⟱            \DDownarrow                                  DOWNWARDS QUADRUPLE ARROW
+U+027F5           ⟵            \longleftarrow                               LONG LEFTWARDS ARROW
+U+027F6           ⟶            \longrightarrow                              LONG RIGHTWARDS ARROW
+U+027F7           ⟷            \longleftrightarrow                          LONG LEFT RIGHT ARROW
+U+027F8           ⟸            \impliedby, \Longleftarrow                   LONG LEFTWARDS DOUBLE ARROW
+U+027F9           ⟹            \implies, \Longrightarrow                    LONG RIGHTWARDS DOUBLE ARROW
+U+027FA           ⟺            \Longleftrightarrow, \iff                    LONG LEFT RIGHT DOUBLE ARROW
+U+027FB           ⟻            \longmapsfrom                                LONG LEFTWARDS ARROW FROM BAR
+U+027FC           ⟼            \longmapsto                                  LONG RIGHTWARDS ARROW FROM BAR
+U+027FD           ⟽            \Longmapsfrom                                LONG LEFTWARDS DOUBLE ARROW FROM BAR
+U+027FE           ⟾            \Longmapsto                                  LONG RIGHTWARDS DOUBLE ARROW FROM BAR
+U+027FF           ⟿            \longrightsquigarrow                         LONG RIGHTWARDS SQUIGGLE ARROW
+U+02900           ⤀            \nvtwoheadrightarrow                         RIGHTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE
+U+02901           ⤁            \nVtwoheadrightarrow                         RIGHTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE
+U+02902           ⤂            \nvLeftarrow                                 LEFTWARDS DOUBLE ARROW WITH VERTICAL STROKE
+U+02903           ⤃            \nvRightarrow                                RIGHTWARDS DOUBLE ARROW WITH VERTICAL STROKE
+U+02904           ⤄            \nvLeftrightarrow                            LEFT RIGHT DOUBLE ARROW WITH VERTICAL STROKE
+U+02905           ⤅            \twoheadmapsto                               RIGHTWARDS TWO-HEADED ARROW FROM BAR
+U+02906           ⤆            \Mapsfrom                                    LEFTWARDS DOUBLE ARROW FROM BAR
+U+02907           ⤇            \Mapsto                                      RIGHTWARDS DOUBLE ARROW FROM BAR
+U+02908           ⤈            \downarrowbarred                             DOWNWARDS ARROW WITH HORIZONTAL STROKE
+U+02909           ⤉            \uparrowbarred                               UPWARDS ARROW WITH HORIZONTAL STROKE
+U+0290A           ⤊            \Uuparrow                                    UPWARDS TRIPLE ARROW
+U+0290B           ⤋            \Ddownarrow                                  DOWNWARDS TRIPLE ARROW
+U+0290C           ⤌            \leftbkarrow                                 LEFTWARDS DOUBLE DASH ARROW
+U+0290D           ⤍            \bkarow                                      RIGHTWARDS DOUBLE DASH ARROW
+U+0290E           ⤎            \leftdbkarrow                                LEFTWARDS TRIPLE DASH ARROW
+U+0290F           ⤏            \dbkarow                                     RIGHTWARDS TRIPLE DASH ARROW
+U+02910           ⤐            \drbkarrow                                   RIGHTWARDS TWO-HEADED TRIPLE DASH ARROW
+U+02911           ⤑            \rightdotarrow                               RIGHTWARDS ARROW WITH DOTTED STEM
+U+02912           ⤒            \UpArrowBar                                  UPWARDS ARROW TO BAR
+U+02913           ⤓            \DownArrowBar                                DOWNWARDS ARROW TO BAR
+U+02914           ⤔            \nvrightarrowtail                            RIGHTWARDS ARROW WITH TAIL WITH VERTICAL STROKE
+U+02915           ⤕            \nVrightarrowtail                            RIGHTWARDS ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
+U+02916           ⤖            \twoheadrightarrowtail                       RIGHTWARDS TWO-HEADED ARROW WITH TAIL
+U+02917           ⤗            \nvtwoheadrightarrowtail                     RIGHTWARDS TWO-HEADED ARROW WITH TAIL WITH VERTICAL STROKE
+U+02918           ⤘            \nVtwoheadrightarrowtail                     RIGHTWARDS TWO-HEADED ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
+U+0291D           ⤝            \diamondleftarrow                            LEFTWARDS ARROW TO BLACK DIAMOND
+U+0291E           ⤞            \rightarrowdiamond                           RIGHTWARDS ARROW TO BLACK DIAMOND
+U+0291F           ⤟            \diamondleftarrowbar                         LEFTWARDS ARROW FROM BAR TO BLACK DIAMOND
+U+02920           ⤠            \barrightarrowdiamond                        RIGHTWARDS ARROW FROM BAR TO BLACK DIAMOND
+U+02925           ⤥            \hksearow                                    SOUTH EAST ARROW WITH HOOK
+U+02926           ⤦            \hkswarow                                    SOUTH WEST ARROW WITH HOOK
+U+02927           ⤧            \tona                                        NORTH WEST ARROW AND NORTH EAST ARROW
+U+02928           ⤨            \toea                                        NORTH EAST ARROW AND SOUTH EAST ARROW
+U+02929           ⤩            \tosa                                        SOUTH EAST ARROW AND SOUTH WEST ARROW
+U+0292A           ⤪            \towa                                        SOUTH WEST ARROW AND NORTH WEST ARROW
+U+0292B           ⤫            \rdiagovfdiag                                RISING DIAGONAL CROSSING FALLING DIAGONAL
+U+0292C           ⤬            \fdiagovrdiag                                FALLING DIAGONAL CROSSING RISING DIAGONAL
+U+0292D           ⤭            \seovnearrow                                 SOUTH EAST ARROW CROSSING NORTH EAST ARROW
+U+0292E           ⤮            \neovsearrow                                 NORTH EAST ARROW CROSSING SOUTH EAST ARROW
+U+0292F           ⤯            \fdiagovnearrow                              FALLING DIAGONAL CROSSING NORTH EAST ARROW
+U+02930           ⤰            \rdiagovsearrow                              RISING DIAGONAL CROSSING SOUTH EAST ARROW
+U+02931           ⤱            \neovnwarrow                                 NORTH EAST ARROW CROSSING NORTH WEST ARROW
+U+02932           ⤲            \nwovnearrow                                 NORTH WEST ARROW CROSSING NORTH EAST ARROW
+U+02934           ⤴            \:arrow_heading_up:                          ARROW POINTING RIGHTWARDS THEN CURVING UPWARDS
+U+02935           ⤵            \:arrow_heading_down:                        ARROW POINTING RIGHTWARDS THEN CURVING DOWNWARDS
+U+02942           ⥂            \Rlarr                                       RIGHTWARDS ARROW ABOVE SHORT LEFTWARDS ARROW
+U+02944           ⥄            \rLarr                                       SHORT RIGHTWARDS ARROW ABOVE LEFTWARDS ARROW
+U+02945           ⥅            \rightarrowplus                              RIGHTWARDS ARROW WITH PLUS BELOW
+U+02946           ⥆            \leftarrowplus                               LEFTWARDS ARROW WITH PLUS BELOW
+U+02947           ⥇            \rarrx                                       RIGHTWARDS ARROW THROUGH X
+U+02948           ⥈            \leftrightarrowcircle                        LEFT RIGHT ARROW THROUGH SMALL CIRCLE
+U+02949           ⥉            \twoheaduparrowcircle                        UPWARDS TWO-HEADED ARROW FROM SMALL CIRCLE
+U+0294A           ⥊            \leftrightharpoonupdown                      LEFT BARB UP RIGHT BARB DOWN HARPOON
+U+0294B           ⥋            \leftrightharpoondownup                      LEFT BARB DOWN RIGHT BARB UP HARPOON
+U+0294C           ⥌            \updownharpoonrightleft                      UP BARB RIGHT DOWN BARB LEFT HARPOON
+U+0294D           ⥍            \updownharpoonleftright                      UP BARB LEFT DOWN BARB RIGHT HARPOON
+U+0294E           ⥎            \LeftRightVector                             LEFT BARB UP RIGHT BARB UP HARPOON
+U+0294F           ⥏            \RightUpDownVector                           UP BARB RIGHT DOWN BARB RIGHT HARPOON
+U+02950           ⥐            \DownLeftRightVector                         LEFT BARB DOWN RIGHT BARB DOWN HARPOON
+U+02951           ⥑            \LeftUpDownVector                            UP BARB LEFT DOWN BARB LEFT HARPOON
+U+02952           ⥒            \LeftVectorBar                               LEFTWARDS HARPOON WITH BARB UP TO BAR
+U+02953           ⥓            \RightVectorBar                              RIGHTWARDS HARPOON WITH BARB UP TO BAR
+U+02954           ⥔            \RightUpVectorBar                            UPWARDS HARPOON WITH BARB RIGHT TO BAR
+U+02955           ⥕            \RightDownVectorBar                          DOWNWARDS HARPOON WITH BARB RIGHT TO BAR
+U+02956           ⥖            \DownLeftVectorBar                           LEFTWARDS HARPOON WITH BARB DOWN TO BAR
+U+02957           ⥗            \DownRightVectorBar                          RIGHTWARDS HARPOON WITH BARB DOWN TO BAR
+U+02958           ⥘            \LeftUpVectorBar                             UPWARDS HARPOON WITH BARB LEFT TO BAR
+U+02959           ⥙            \LeftDownVectorBar                           DOWNWARDS HARPOON WITH BARB LEFT TO BAR
+U+0295A           ⥚            \LeftTeeVector                               LEFTWARDS HARPOON WITH BARB UP FROM BAR
+U+0295B           ⥛            \RightTeeVector                              RIGHTWARDS HARPOON WITH BARB UP FROM BAR
+U+0295C           ⥜            \RightUpTeeVector                            UPWARDS HARPOON WITH BARB RIGHT FROM BAR
+U+0295D           ⥝            \RightDownTeeVector                          DOWNWARDS HARPOON WITH BARB RIGHT FROM BAR
+U+0295E           ⥞            \DownLeftTeeVector                           LEFTWARDS HARPOON WITH BARB DOWN FROM BAR
+U+0295F           ⥟            \DownRightTeeVector                          RIGHTWARDS HARPOON WITH BARB DOWN FROM BAR
+U+02960           ⥠            \LeftUpTeeVector                             UPWARDS HARPOON WITH BARB LEFT FROM BAR
+U+02961           ⥡            \LeftDownTeeVector                           DOWNWARDS HARPOON WITH BARB LEFT FROM BAR
+U+02962           ⥢            \leftharpoonsupdown                          LEFTWARDS HARPOON WITH BARB UP ABOVE LEFTWARDS HARPOON WITH BARB DOWN
+U+02963           ⥣            \upharpoonsleftright                         UPWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT
+U+02964           ⥤            \rightharpoonsupdown                         RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN
+U+02965           ⥥            \downharpoonsleftright                       DOWNWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT
+U+02966           ⥦            \leftrightharpoonsup                         LEFTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB UP
+U+02967           ⥧            \leftrightharpoonsdown                       LEFTWARDS HARPOON WITH BARB DOWN ABOVE RIGHTWARDS HARPOON WITH BARB DOWN
+U+02968           ⥨            \rightleftharpoonsup                         RIGHTWARDS HARPOON WITH BARB UP ABOVE LEFTWARDS HARPOON WITH BARB UP
+U+02969           ⥩            \rightleftharpoonsdown                       RIGHTWARDS HARPOON WITH BARB DOWN ABOVE LEFTWARDS HARPOON WITH BARB DOWN
+U+0296A           ⥪            \leftharpoonupdash                           LEFTWARDS HARPOON WITH BARB UP ABOVE LONG DASH
+U+0296B           ⥫            \dashleftharpoondown                         LEFTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH
+U+0296C           ⥬            \rightharpoonupdash                          RIGHTWARDS HARPOON WITH BARB UP ABOVE LONG DASH
+U+0296D           ⥭            \dashrightharpoondown                        RIGHTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH
+U+0296E           ⥮            \UpEquilibrium                               UPWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT
+U+0296F           ⥯            \ReverseUpEquilibrium                        DOWNWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT
+U+02970           ⥰            \RoundImplies                                RIGHT DOUBLE ARROW WITH ROUNDED HEAD
+U+02980           ⦀            \Vvert                                       TRIPLE VERTICAL BAR DELIMITER
+U+02986           ⦆            \Elroang                                     RIGHT WHITE PARENTHESIS
+U+02999           ⦙            \ddfnc                                       DOTTED FENCE
+U+0299B           ⦛            \measuredangleleft                           MEASURED ANGLE OPENING LEFT
+U+0299C           ⦜            \Angle                                       RIGHT ANGLE VARIANT WITH SQUARE
+U+0299D           ⦝            \rightanglemdot                              MEASURED RIGHT ANGLE WITH DOT
+U+0299E           ⦞            \angles                                      ANGLE WITH S INSIDE
+U+0299F           ⦟            \angdnr                                      ACUTE ANGLE
+U+029A0           ⦠            \lpargt                                      SPHERICAL ANGLE OPENING LEFT
+U+029A1           ⦡            \sphericalangleup                            SPHERICAL ANGLE OPENING UP
+U+029A2           ⦢            \turnangle                                   TURNED ANGLE
+U+029A3           ⦣            \revangle                                    REVERSED ANGLE
+U+029A4           ⦤            \angleubar                                   ANGLE WITH UNDERBAR
+U+029A5           ⦥            \revangleubar                                REVERSED ANGLE WITH UNDERBAR
+U+029A6           ⦦            \wideangledown                               OBLIQUE ANGLE OPENING UP
+U+029A7           ⦧            \wideangleup                                 OBLIQUE ANGLE OPENING DOWN
+U+029A8           ⦨            \measanglerutone                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND RIGHT
+U+029A9           ⦩            \measanglelutonw                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND LEFT
+U+029AA           ⦪            \measanglerdtose                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND RIGHT
+U+029AB           ⦫            \measangleldtosw                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND LEFT
+U+029AC           ⦬            \measangleurtone                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND UP
+U+029AD           ⦭            \measangleultonw                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING LEFT AND UP
+U+029AE           ⦮            \measangledrtose                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND DOWN
+U+029AF           ⦯            \measangledltosw                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING LEFT AND DOWN
+U+029B0           ⦰            \revemptyset                                 REVERSED EMPTY SET
+U+029B1           ⦱            \emptysetobar                                EMPTY SET WITH OVERBAR
+U+029B2           ⦲            \emptysetocirc                               EMPTY SET WITH SMALL CIRCLE ABOVE
+U+029B3           ⦳            \emptysetoarr                                EMPTY SET WITH RIGHT ARROW ABOVE
+U+029B4           ⦴            \emptysetoarrl                               EMPTY SET WITH LEFT ARROW ABOVE
+U+029B7           ⦷            \circledparallel                             CIRCLED PARALLEL
+U+029B8           ⦸            \obslash                                     CIRCLED REVERSE SOLIDUS
+U+029BC           ⦼            \odotslashdot                                CIRCLED ANTICLOCKWISE-ROTATED DIVISION SIGN
+U+029BE           ⦾            \circledwhitebullet                          CIRCLED WHITE BULLET
+U+029BF           ⦿            \circledbullet                               CIRCLED BULLET
+U+029C0           ⧀            \olessthan                                   CIRCLED LESS-THAN
+U+029C1           ⧁            \ogreaterthan                                CIRCLED GREATER-THAN
+U+029C4           ⧄            \boxdiag                                     SQUARED RISING DIAGONAL SLASH
+U+029C5           ⧅            \boxbslash                                   SQUARED FALLING DIAGONAL SLASH
+U+029C6           ⧆            \boxast                                      SQUARED ASTERISK
+U+029C7           ⧇            \boxcircle                                   SQUARED SMALL CIRCLE
+U+029CA           ⧊            \Lap                                         TRIANGLE WITH DOT ABOVE
+U+029CB           ⧋            \defas                                       TRIANGLE WITH UNDERBAR
+U+029CF           ⧏            \LeftTriangleBar                             LEFT TRIANGLE BESIDE VERTICAL BAR
+U+029CF + U+00338 ⧏̸           \NotLeftTriangleBar                          LEFT TRIANGLE BESIDE VERTICAL BAR + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+029D0           ⧐            \RightTriangleBar                            VERTICAL BAR BESIDE RIGHT TRIANGLE
+U+029D0 + U+00338 ⧐̸           \NotRightTriangleBar                         VERTICAL BAR BESIDE RIGHT TRIANGLE + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+029DF           ⧟            \dualmap                                     DOUBLE-ENDED MULTIMAP
+U+029E1           ⧡            \lrtriangleeq                                INCREASES AS
+U+029E2           ⧢            \shuffle                                     SHUFFLE PRODUCT
+U+029E3           ⧣            \eparsl                                      EQUALS SIGN AND SLANTED PARALLEL
+U+029E4           ⧤            \smeparsl                                    EQUALS SIGN AND SLANTED PARALLEL WITH TILDE ABOVE
+U+029E5           ⧥            \eqvparsl                                    IDENTICAL TO AND SLANTED PARALLEL
+U+029EB           ⧫            \blacklozenge                                BLACK LOZENGE
+U+029F4           ⧴            \RuleDelayed                                 RULE-DELAYED
+U+029F6           ⧶            \dsol                                        SOLIDUS WITH OVERBAR
+U+029F7           ⧷            \rsolbar                                     REVERSE SOLIDUS WITH HORIZONTAL STROKE
+U+029FA           ⧺            \doubleplus                                  DOUBLE PLUS
+U+029FB           ⧻            \tripleplus                                  TRIPLE PLUS
+U+02A00           ⨀            \bigodot                                     N-ARY CIRCLED DOT OPERATOR
+U+02A01           ⨁            \bigoplus                                    N-ARY CIRCLED PLUS OPERATOR
+U+02A02           ⨂            \bigotimes                                   N-ARY CIRCLED TIMES OPERATOR
+U+02A03           ⨃            \bigcupdot                                   N-ARY UNION OPERATOR WITH DOT
+U+02A04           ⨄            \biguplus                                    N-ARY UNION OPERATOR WITH PLUS
+U+02A05           ⨅            \bigsqcap                                    N-ARY SQUARE INTERSECTION OPERATOR
+U+02A06           ⨆            \bigsqcup                                    N-ARY SQUARE UNION OPERATOR
+U+02A07           ⨇            \conjquant                                   TWO LOGICAL AND OPERATOR
+U+02A08           ⨈            \disjquant                                   TWO LOGICAL OR OPERATOR
+U+02A09           ⨉            \bigtimes                                    N-ARY TIMES OPERATOR
+U+02A0A           ⨊            \modtwosum                                   MODULO TWO SUM
+U+02A0B           ⨋            \sumint                                      SUMMATION WITH INTEGRAL
+U+02A0C           ⨌            \iiiint                                      QUADRUPLE INTEGRAL OPERATOR
+U+02A0D           ⨍            \intbar                                      FINITE PART INTEGRAL
+U+02A0E           ⨎            \intBar                                      INTEGRAL WITH DOUBLE STROKE
+U+02A0F           ⨏            \clockoint                                   INTEGRAL AVERAGE WITH SLASH
+U+02A10           ⨐            \cirfnint                                    CIRCULATION FUNCTION
+U+02A11           ⨑            \awint                                       ANTICLOCKWISE INTEGRATION
+U+02A12           ⨒            \rppolint                                    LINE INTEGRATION WITH RECTANGULAR PATH AROUND POLE
+U+02A13           ⨓            \scpolint                                    LINE INTEGRATION WITH SEMICIRCULAR PATH AROUND POLE
+U+02A14           ⨔            \npolint                                     LINE INTEGRATION NOT INCLUDING THE POLE
+U+02A15           ⨕            \pointint                                    INTEGRAL AROUND A POINT OPERATOR
+U+02A16           ⨖            \sqrint                                      QUATERNION INTEGRAL OPERATOR
+U+02A18           ⨘            \intx                                        INTEGRAL WITH TIMES SIGN
+U+02A19           ⨙            \intcap                                      INTEGRAL WITH INTERSECTION
+U+02A1A           ⨚            \intcup                                      INTEGRAL WITH UNION
+U+02A1B           ⨛            \upint                                       INTEGRAL WITH OVERBAR
+U+02A1C           ⨜            \lowint                                      INTEGRAL WITH UNDERBAR
+U+02A1D           ⨝            \Join, \join                                 JOIN
+U+02A22           ⨢            \ringplus                                    PLUS SIGN WITH SMALL CIRCLE ABOVE
+U+02A23           ⨣            \plushat                                     PLUS SIGN WITH CIRCUMFLEX ACCENT ABOVE
+U+02A24           ⨤            \simplus                                     PLUS SIGN WITH TILDE ABOVE
+U+02A25           ⨥            \plusdot                                     PLUS SIGN WITH DOT BELOW
+U+02A26           ⨦            \plussim                                     PLUS SIGN WITH TILDE BELOW
+U+02A27           ⨧            \plussubtwo                                  PLUS SIGN WITH SUBSCRIPT TWO
+U+02A28           ⨨            \plustrif                                    PLUS SIGN WITH BLACK TRIANGLE
+U+02A29           ⨩            \commaminus                                  MINUS SIGN WITH COMMA ABOVE
+U+02A2A           ⨪            \minusdot                                    MINUS SIGN WITH DOT BELOW
+U+02A2B           ⨫            \minusfdots                                  MINUS SIGN WITH FALLING DOTS
+U+02A2C           ⨬            \minusrdots                                  MINUS SIGN WITH RISING DOTS
+U+02A2D           ⨭            \opluslhrim                                  PLUS SIGN IN LEFT HALF CIRCLE
+U+02A2E           ⨮            \oplusrhrim                                  PLUS SIGN IN RIGHT HALF CIRCLE
+U+02A2F           ⨯            \Times                                       VECTOR OR CROSS PRODUCT
+U+02A30           ⨰            \dottimes                                    MULTIPLICATION SIGN WITH DOT ABOVE
+U+02A31           ⨱            \timesbar                                    MULTIPLICATION SIGN WITH UNDERBAR
+U+02A32           ⨲            \btimes                                      SEMIDIRECT PRODUCT WITH BOTTOM CLOSED
+U+02A33           ⨳            \smashtimes                                  SMASH PRODUCT
+U+02A34           ⨴            \otimeslhrim                                 MULTIPLICATION SIGN IN LEFT HALF CIRCLE
+U+02A35           ⨵            \otimesrhrim                                 MULTIPLICATION SIGN IN RIGHT HALF CIRCLE
+U+02A36           ⨶            \otimeshat                                   CIRCLED MULTIPLICATION SIGN WITH CIRCUMFLEX ACCENT
+U+02A37           ⨷            \Otimes                                      MULTIPLICATION SIGN IN DOUBLE CIRCLE
+U+02A38           ⨸            \odiv                                        CIRCLED DIVISION SIGN
+U+02A39           ⨹            \triangleplus                                PLUS SIGN IN TRIANGLE
+U+02A3A           ⨺            \triangleminus                               MINUS SIGN IN TRIANGLE
+U+02A3B           ⨻            \triangletimes                               MULTIPLICATION SIGN IN TRIANGLE
+U+02A3C           ⨼            \intprod                                     INTERIOR PRODUCT
+U+02A3D           ⨽            \intprodr                                    RIGHTHAND INTERIOR PRODUCT
+U+02A3F           ⨿            \amalg                                       AMALGAMATION OR COPRODUCT
+U+02A40           ⩀            \capdot                                      INTERSECTION WITH DOT
+U+02A41           ⩁            \uminus                                      UNION WITH MINUS SIGN
+U+02A42           ⩂            \barcup                                      UNION WITH OVERBAR
+U+02A43           ⩃            \barcap                                      INTERSECTION WITH OVERBAR
+U+02A44           ⩄            \capwedge                                    INTERSECTION WITH LOGICAL AND
+U+02A45           ⩅            \cupvee                                      UNION WITH LOGICAL OR
+U+02A4A           ⩊            \twocups                                     UNION BESIDE AND JOINED WITH UNION
+U+02A4B           ⩋            \twocaps                                     INTERSECTION BESIDE AND JOINED WITH INTERSECTION
+U+02A4C           ⩌            \closedvarcup                                CLOSED UNION WITH SERIFS
+U+02A4D           ⩍            \closedvarcap                                CLOSED INTERSECTION WITH SERIFS
+U+02A4E           ⩎            \Sqcap                                       DOUBLE SQUARE INTERSECTION
+U+02A4F           ⩏            \Sqcup                                       DOUBLE SQUARE UNION
+U+02A50           ⩐            \closedvarcupsmashprod                       CLOSED UNION WITH SERIFS AND SMASH PRODUCT
+U+02A51           ⩑            \wedgeodot                                   LOGICAL AND WITH DOT ABOVE
+U+02A52           ⩒            \veeodot                                     LOGICAL OR WITH DOT ABOVE
+U+02A53           ⩓            \And                                         DOUBLE LOGICAL AND
+U+02A54           ⩔            \Or                                          DOUBLE LOGICAL OR
+U+02A55           ⩕            \wedgeonwedge                                TWO INTERSECTING LOGICAL AND
+U+02A56           ⩖            \ElOr                                        TWO INTERSECTING LOGICAL OR
+U+02A57           ⩗            \bigslopedvee                                SLOPING LARGE OR
+U+02A58           ⩘            \bigslopedwedge                              SLOPING LARGE AND
+U+02A5A           ⩚            \wedgemidvert                                LOGICAL AND WITH MIDDLE STEM
+U+02A5B           ⩛            \veemidvert                                  LOGICAL OR WITH MIDDLE STEM
+U+02A5C           ⩜            \midbarwedge                                 LOGICAL AND WITH HORIZONTAL DASH
+U+02A5D           ⩝            \midbarvee                                   LOGICAL OR WITH HORIZONTAL DASH
+U+02A5E           ⩞            \perspcorrespond                             LOGICAL AND WITH DOUBLE OVERBAR
+U+02A5F           ⩟            \minhat                                      LOGICAL AND WITH UNDERBAR
+U+02A60           ⩠            \wedgedoublebar                              LOGICAL AND WITH DOUBLE UNDERBAR
+U+02A61           ⩡            \varveebar                                   SMALL VEE WITH UNDERBAR
+U+02A62           ⩢            \doublebarvee                                LOGICAL OR WITH DOUBLE OVERBAR
+U+02A63           ⩣            \veedoublebar                                LOGICAL OR WITH DOUBLE UNDERBAR
+U+02A66           ⩦            \eqdot                                       EQUALS SIGN WITH DOT BELOW
+U+02A67           ⩧            \dotequiv                                    IDENTICAL WITH DOT ABOVE
+U+02A6A           ⩪            \dotsim                                      TILDE OPERATOR WITH DOT ABOVE
+U+02A6B           ⩫            \simrdots                                    TILDE OPERATOR WITH RISING DOTS
+U+02A6C           ⩬            \simminussim                                 SIMILAR MINUS SIMILAR
+U+02A6D           ⩭            \congdot                                     CONGRUENT WITH DOT ABOVE
+U+02A6E           ⩮            \asteq                                       EQUALS WITH ASTERISK
+U+02A6F           ⩯            \hatapprox                                   ALMOST EQUAL TO WITH CIRCUMFLEX ACCENT
+U+02A70           ⩰            \approxeqq                                   APPROXIMATELY EQUAL OR EQUAL TO
+U+02A71           ⩱            \eqqplus                                     EQUALS SIGN ABOVE PLUS SIGN
+U+02A72           ⩲            \pluseqq                                     PLUS SIGN ABOVE EQUALS SIGN
+U+02A73           ⩳            \eqqsim                                      EQUALS SIGN ABOVE TILDE OPERATOR
+U+02A74           ⩴            \Coloneq                                     DOUBLE COLON EQUAL
+U+02A75           ⩵            \Equal                                       TWO CONSECUTIVE EQUALS SIGNS
+U+02A76           ⩶            \eqeqeq                                      THREE CONSECUTIVE EQUALS SIGNS
+U+02A77           ⩷            \ddotseq                                     EQUALS SIGN WITH TWO DOTS ABOVE AND TWO DOTS BELOW
+U+02A78           ⩸            \equivDD                                     EQUIVALENT WITH FOUR DOTS ABOVE
+U+02A79           ⩹            \ltcir                                       LESS-THAN WITH CIRCLE INSIDE
+U+02A7A           ⩺            \gtcir                                       GREATER-THAN WITH CIRCLE INSIDE
+U+02A7B           ⩻            \ltquest                                     LESS-THAN WITH QUESTION MARK ABOVE
+U+02A7C           ⩼            \gtquest                                     GREATER-THAN WITH QUESTION MARK ABOVE
+U+02A7D           ⩽            \leqslant                                    LESS-THAN OR SLANTED EQUAL TO
+U+02A7D + U+00338 ⩽̸           \nleqslant                                   LESS-THAN OR SLANTED EQUAL TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+02A7E           ⩾            \geqslant                                    GREATER-THAN OR SLANTED EQUAL TO
+U+02A7E + U+00338 ⩾̸           \ngeqslant                                   GREATER-THAN OR SLANTED EQUAL TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+02A7F           ⩿            \lesdot                                      LESS-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
+U+02A80           ⪀            \gesdot                                      GREATER-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
+U+02A81           ⪁            \lesdoto                                     LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
+U+02A82           ⪂            \gesdoto                                     GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
+U+02A83           ⪃            \lesdotor                                    LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE RIGHT
+U+02A84           ⪄            \gesdotol                                    GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE LEFT
+U+02A85           ⪅            \lessapprox                                  LESS-THAN OR APPROXIMATE
+U+02A86           ⪆            \gtrapprox                                   GREATER-THAN OR APPROXIMATE
+U+02A87           ⪇            \lneq                                        LESS-THAN AND SINGLE-LINE NOT EQUAL TO
+U+02A88           ⪈            \gneq                                        GREATER-THAN AND SINGLE-LINE NOT EQUAL TO
+U+02A89           ⪉            \lnapprox                                    LESS-THAN AND NOT APPROXIMATE
+U+02A8A           ⪊            \gnapprox                                    GREATER-THAN AND NOT APPROXIMATE
+U+02A8B           ⪋            \lesseqqgtr                                  LESS-THAN ABOVE DOUBLE-LINE EQUAL ABOVE GREATER-THAN
+U+02A8C           ⪌            \gtreqqless                                  GREATER-THAN ABOVE DOUBLE-LINE EQUAL ABOVE LESS-THAN
+U+02A8D           ⪍            \lsime                                       LESS-THAN ABOVE SIMILAR OR EQUAL
+U+02A8E           ⪎            \gsime                                       GREATER-THAN ABOVE SIMILAR OR EQUAL
+U+02A8F           ⪏            \lsimg                                       LESS-THAN ABOVE SIMILAR ABOVE GREATER-THAN
+U+02A90           ⪐            \gsiml                                       GREATER-THAN ABOVE SIMILAR ABOVE LESS-THAN
+U+02A91           ⪑            \lgE                                         LESS-THAN ABOVE GREATER-THAN ABOVE DOUBLE-LINE EQUAL
+U+02A92           ⪒            \glE                                         GREATER-THAN ABOVE LESS-THAN ABOVE DOUBLE-LINE EQUAL
+U+02A93           ⪓            \lesges                                      LESS-THAN ABOVE SLANTED EQUAL ABOVE GREATER-THAN ABOVE SLANTED EQUAL
+U+02A94           ⪔            \gesles                                      GREATER-THAN ABOVE SLANTED EQUAL ABOVE LESS-THAN ABOVE SLANTED EQUAL
+U+02A95           ⪕            \eqslantless                                 SLANTED EQUAL TO OR LESS-THAN
+U+02A96           ⪖            \eqslantgtr                                  SLANTED EQUAL TO OR GREATER-THAN
+U+02A97           ⪗            \elsdot                                      SLANTED EQUAL TO OR LESS-THAN WITH DOT INSIDE
+U+02A98           ⪘            \egsdot                                      SLANTED EQUAL TO OR GREATER-THAN WITH DOT INSIDE
+U+02A99           ⪙            \eqqless                                     DOUBLE-LINE EQUAL TO OR LESS-THAN
+U+02A9A           ⪚            \eqqgtr                                      DOUBLE-LINE EQUAL TO OR GREATER-THAN
+U+02A9B           ⪛            \eqqslantless                                DOUBLE-LINE SLANTED EQUAL TO OR LESS-THAN
+U+02A9C           ⪜            \eqqslantgtr                                 DOUBLE-LINE SLANTED EQUAL TO OR GREATER-THAN
+U+02A9D           ⪝            \simless                                     SIMILAR OR LESS-THAN
+U+02A9E           ⪞            \simgtr                                      SIMILAR OR GREATER-THAN
+U+02A9F           ⪟            \simlE                                       SIMILAR ABOVE LESS-THAN ABOVE EQUALS SIGN
+U+02AA0           ⪠            \simgE                                       SIMILAR ABOVE GREATER-THAN ABOVE EQUALS SIGN
+U+02AA1           ⪡            \NestedLessLess                              DOUBLE NESTED LESS-THAN
+U+02AA1 + U+00338 ⪡̸           \NotNestedLessLess                           DOUBLE NESTED LESS-THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+02AA2           ⪢            \NestedGreaterGreater                        DOUBLE NESTED GREATER-THAN
+U+02AA2 + U+00338 ⪢̸           \NotNestedGreaterGreater                     DOUBLE NESTED GREATER-THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+02AA3           ⪣            \partialmeetcontraction                      DOUBLE NESTED LESS-THAN WITH UNDERBAR
+U+02AA4           ⪤            \glj                                         GREATER-THAN OVERLAPPING LESS-THAN
+U+02AA5           ⪥            \gla                                         GREATER-THAN BESIDE LESS-THAN
+U+02AA6           ⪦            \ltcc                                        LESS-THAN CLOSED BY CURVE
+U+02AA7           ⪧            \gtcc                                        GREATER-THAN CLOSED BY CURVE
+U+02AA8           ⪨            \lescc                                       LESS-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL
+U+02AA9           ⪩            \gescc                                       GREATER-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL
+U+02AAA           ⪪            \smt                                         SMALLER THAN
+U+02AAB           ⪫            \lat                                         LARGER THAN
+U+02AAC           ⪬            \smte                                        SMALLER THAN OR EQUAL TO
+U+02AAD           ⪭            \late                                        LARGER THAN OR EQUAL TO
+U+02AAE           ⪮            \bumpeqq                                     EQUALS SIGN WITH BUMPY ABOVE
+U+02AAF           ⪯            \preceq                                      PRECEDES ABOVE SINGLE-LINE EQUALS SIGN
+U+02AAF + U+00338 ⪯̸           \npreceq                                     PRECEDES ABOVE SINGLE-LINE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+02AB0           ⪰            \succeq                                      SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN
+U+02AB0 + U+00338 ⪰̸           \nsucceq                                     SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+02AB1           ⪱            \precneq                                     PRECEDES ABOVE SINGLE-LINE NOT EQUAL TO
+U+02AB2           ⪲            \succneq                                     SUCCEEDS ABOVE SINGLE-LINE NOT EQUAL TO
+U+02AB3           ⪳            \preceqq                                     PRECEDES ABOVE EQUALS SIGN
+U+02AB4           ⪴            \succeqq                                     SUCCEEDS ABOVE EQUALS SIGN
+U+02AB5           ⪵            \precneqq                                    PRECEDES ABOVE NOT EQUAL TO
+U+02AB6           ⪶            \succneqq                                    SUCCEEDS ABOVE NOT EQUAL TO
+U+02AB7           ⪷            \precapprox                                  PRECEDES ABOVE ALMOST EQUAL TO
+U+02AB8           ⪸            \succapprox                                  SUCCEEDS ABOVE ALMOST EQUAL TO
+U+02AB9           ⪹            \precnapprox                                 PRECEDES ABOVE NOT ALMOST EQUAL TO
+U+02ABA           ⪺            \succnapprox                                 SUCCEEDS ABOVE NOT ALMOST EQUAL TO
+U+02ABB           ⪻            \Prec                                        DOUBLE PRECEDES
+U+02ABC           ⪼            \Succ                                        DOUBLE SUCCEEDS
+U+02ABD           ⪽            \subsetdot                                   SUBSET WITH DOT
+U+02ABE           ⪾            \supsetdot                                   SUPERSET WITH DOT
+U+02ABF           ⪿            \subsetplus                                  SUBSET WITH PLUS SIGN BELOW
+U+02AC0           ⫀            \supsetplus                                  SUPERSET WITH PLUS SIGN BELOW
+U+02AC1           ⫁            \submult                                     SUBSET WITH MULTIPLICATION SIGN BELOW
+U+02AC2           ⫂            \supmult                                     SUPERSET WITH MULTIPLICATION SIGN BELOW
+U+02AC3           ⫃            \subedot                                     SUBSET OF OR EQUAL TO WITH DOT ABOVE
+U+02AC4           ⫄            \supedot                                     SUPERSET OF OR EQUAL TO WITH DOT ABOVE
+U+02AC5           ⫅            \subseteqq                                   SUBSET OF ABOVE EQUALS SIGN
+U+02AC5 + U+00338 ⫅̸           \nsubseteqq                                  SUBSET OF ABOVE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+02AC6           ⫆            \supseteqq                                   SUPERSET OF ABOVE EQUALS SIGN
+U+02AC6 + U+00338 ⫆̸           \nsupseteqq                                  SUPERSET OF ABOVE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+U+02AC7           ⫇            \subsim                                      SUBSET OF ABOVE TILDE OPERATOR
+U+02AC8           ⫈            \supsim                                      SUPERSET OF ABOVE TILDE OPERATOR
+U+02AC9           ⫉            \subsetapprox                                SUBSET OF ABOVE ALMOST EQUAL TO
+U+02ACA           ⫊            \supsetapprox                                SUPERSET OF ABOVE ALMOST EQUAL TO
+U+02ACB           ⫋            \subsetneqq                                  SUBSET OF ABOVE NOT EQUAL TO
+U+02ACC           ⫌            \supsetneqq                                  SUPERSET OF ABOVE NOT EQUAL TO
+U+02ACD           ⫍            \lsqhook                                     SQUARE LEFT OPEN BOX OPERATOR
+U+02ACE           ⫎            \rsqhook                                     SQUARE RIGHT OPEN BOX OPERATOR
+U+02ACF           ⫏            \csub                                        CLOSED SUBSET
+U+02AD0           ⫐            \csup                                        CLOSED SUPERSET
+U+02AD1           ⫑            \csube                                       CLOSED SUBSET OR EQUAL TO
+U+02AD2           ⫒            \csupe                                       CLOSED SUPERSET OR EQUAL TO
+U+02AD3           ⫓            \subsup                                      SUBSET ABOVE SUPERSET
+U+02AD4           ⫔            \supsub                                      SUPERSET ABOVE SUBSET
+U+02AD5           ⫕            \subsub                                      SUBSET ABOVE SUBSET
+U+02AD6           ⫖            \supsup                                      SUPERSET ABOVE SUPERSET
+U+02AD7           ⫗            \suphsub                                     SUPERSET BESIDE SUBSET
+U+02AD8           ⫘            \supdsub                                     SUPERSET BESIDE AND JOINED BY DASH WITH SUBSET
+U+02AD9           ⫙            \forkv                                       ELEMENT OF OPENING DOWNWARDS
+U+02ADB           ⫛            \mlcp                                        TRANSVERSAL INTERSECTION
+U+02ADC           ⫝̸            \forks                                       FORKING
+U+02ADD           ⫝            \forksnot                                    NONFORKING
+U+02AE3           ⫣            \dashV                                       DOUBLE VERTICAL BAR LEFT TURNSTILE
+U+02AE4           ⫤            \Dashv                                       VERTICAL BAR DOUBLE LEFT TURNSTILE
+U+02AF4           ⫴            \interleave                                  TRIPLE VERTICAL BAR BINARY RELATION
+U+02AF6           ⫶            \tdcol                                       TRIPLE COLON OPERATOR
+U+02AF7           ⫷            \lllnest                                     TRIPLE NESTED LESS-THAN
+U+02AF8           ⫸            \gggnest                                     TRIPLE NESTED GREATER-THAN
+U+02AF9           ⫹            \leqqslant                                   DOUBLE-LINE SLANTED LESS-THAN OR EQUAL TO
+U+02AFA           ⫺            \geqqslant                                   DOUBLE-LINE SLANTED GREATER-THAN OR EQUAL TO
+U+02B05           ⬅            \:arrow_left:                                LEFTWARDS BLACK ARROW
+U+02B06           ⬆            \:arrow_up:                                  UPWARDS BLACK ARROW
+U+02B07           ⬇            \:arrow_down:                                DOWNWARDS BLACK ARROW
+U+02B12           ⬒            \squaretopblack                              SQUARE WITH TOP HALF BLACK
+U+02B13           ⬓            \squarebotblack                              SQUARE WITH BOTTOM HALF BLACK
+U+02B14           ⬔            \squareurblack                               SQUARE WITH UPPER RIGHT DIAGONAL HALF BLACK
+U+02B15           ⬕            \squarellblack                               SQUARE WITH LOWER LEFT DIAGONAL HALF BLACK
+U+02B16           ⬖            \diamondleftblack                            DIAMOND WITH LEFT HALF BLACK
+U+02B17           ⬗            \diamondrightblack                           DIAMOND WITH RIGHT HALF BLACK
+U+02B18           ⬘            \diamondtopblack                             DIAMOND WITH TOP HALF BLACK
+U+02B19           ⬙            \diamondbotblack                             DIAMOND WITH BOTTOM HALF BLACK
+U+02B1A           ⬚            \dottedsquare                                DOTTED SQUARE
+U+02B1B           ⬛            \lgblksquare, \:black_large_square:          BLACK LARGE SQUARE
+U+02B1C           ⬜            \lgwhtsquare, \:white_large_square:          WHITE LARGE SQUARE
+U+02B1D           ⬝            \vysmblksquare                               BLACK VERY SMALL SQUARE
+U+02B1E           ⬞            \vysmwhtsquare                               WHITE VERY SMALL SQUARE
+U+02B1F           ⬟            \pentagonblack                               BLACK PENTAGON
+U+02B20           ⬠            \pentagon                                    WHITE PENTAGON
+U+02B21           ⬡            \varhexagon                                  WHITE HEXAGON
+U+02B22           ⬢            \varhexagonblack                             BLACK HEXAGON
+U+02B23           ⬣            \hexagonblack                                HORIZONTAL BLACK HEXAGON
+U+02B24           ⬤            \lgblkcircle                                 BLACK LARGE CIRCLE
+U+02B25           ⬥            \mdblkdiamond                                BLACK MEDIUM DIAMOND
+U+02B26           ⬦            \mdwhtdiamond                                WHITE MEDIUM DIAMOND
+U+02B27           ⬧            \mdblklozenge                                BLACK MEDIUM LOZENGE
+U+02B28           ⬨            \mdwhtlozenge                                WHITE MEDIUM LOZENGE
+U+02B29           ⬩            \smblkdiamond                                BLACK SMALL DIAMOND
+U+02B2A           ⬪            \smblklozenge                                BLACK SMALL LOZENGE
+U+02B2B           ⬫            \smwhtlozenge                                WHITE SMALL LOZENGE
+U+02B2C           ⬬            \blkhorzoval                                 BLACK HORIZONTAL ELLIPSE
+U+02B2D           ⬭            \whthorzoval                                 WHITE HORIZONTAL ELLIPSE
+U+02B2E           ⬮            \blkvertoval                                 BLACK VERTICAL ELLIPSE
+U+02B2F           ⬯            \whtvertoval                                 WHITE VERTICAL ELLIPSE
+U+02B30           ⬰            \circleonleftarrow                           LEFT ARROW WITH SMALL CIRCLE
+U+02B31           ⬱            \leftthreearrows                             THREE LEFTWARDS ARROWS
+U+02B32           ⬲            \leftarrowonoplus                            LEFT ARROW WITH CIRCLED PLUS
+U+02B33           ⬳            \longleftsquigarrow                          LONG LEFTWARDS SQUIGGLE ARROW
+U+02B34           ⬴            \nvtwoheadleftarrow                          LEFTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE
+U+02B35           ⬵            \nVtwoheadleftarrow                          LEFTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE
+U+02B36           ⬶            \twoheadmapsfrom                             LEFTWARDS TWO-HEADED ARROW FROM BAR
+U+02B37           ⬷            \twoheadleftdbkarrow                         LEFTWARDS TWO-HEADED TRIPLE DASH ARROW
+U+02B38           ⬸            \leftdotarrow                                LEFTWARDS ARROW WITH DOTTED STEM
+U+02B39           ⬹            \nvleftarrowtail                             LEFTWARDS ARROW WITH TAIL WITH VERTICAL STROKE
+U+02B3A           ⬺            \nVleftarrowtail                             LEFTWARDS ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
+U+02B3B           ⬻            \twoheadleftarrowtail                        LEFTWARDS TWO-HEADED ARROW WITH TAIL
+U+02B3C           ⬼            \nvtwoheadleftarrowtail                      LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH VERTICAL STROKE
+U+02B3D           ⬽            \nVtwoheadleftarrowtail                      LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
+U+02B3E           ⬾            \leftarrowx                                  LEFTWARDS ARROW THROUGH X
+U+02B3F           ⬿            \leftcurvedarrow                             WAVE ARROW POINTING DIRECTLY LEFT
+U+02B40           ⭀            \equalleftarrow                              EQUALS SIGN ABOVE LEFTWARDS ARROW
+U+02B41           ⭁            \bsimilarleftarrow                           REVERSE TILDE OPERATOR ABOVE LEFTWARDS ARROW
+U+02B42           ⭂            \leftarrowbackapprox                         LEFTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO
+U+02B43           ⭃            \rightarrowgtr                               RIGHTWARDS ARROW THROUGH GREATER-THAN
+U+02B44           ⭄            \rightarrowsupset                            RIGHTWARDS ARROW THROUGH SUPERSET
+U+02B45           ⭅            \LLeftarrow                                  LEFTWARDS QUADRUPLE ARROW
+U+02B46           ⭆            \RRightarrow                                 RIGHTWARDS QUADRUPLE ARROW
+U+02B47           ⭇            \bsimilarrightarrow                          REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW
+U+02B48           ⭈            \rightarrowbackapprox                        RIGHTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO
+U+02B49           ⭉            \similarleftarrow                            TILDE OPERATOR ABOVE LEFTWARDS ARROW
+U+02B4A           ⭊            \leftarrowapprox                             LEFTWARDS ARROW ABOVE ALMOST EQUAL TO
+U+02B4B           ⭋            \leftarrowbsimilar                           LEFTWARDS ARROW ABOVE REVERSE TILDE OPERATOR
+U+02B4C           ⭌            \rightarrowbsimilar                          RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR
+U+02B50           ⭐            \medwhitestar, \:star:                       WHITE MEDIUM STAR
+U+02B51           ⭑            \medblackstar                                BLACK SMALL STAR
+U+02B52           ⭒            \smwhitestar                                 WHITE SMALL STAR
+U+02B53           ⭓            \rightpentagonblack                          BLACK RIGHT-POINTING PENTAGON
+U+02B54           ⭔            \rightpentagon                               WHITE RIGHT-POINTING PENTAGON
+U+02B55           ⭕            \:o:                                         HEAVY LARGE CIRCLE
+U+02C7C           ⱼ            \_j                                          LATIN SUBSCRIPT SMALL LETTER J
+U+02C7D           ⱽ            \^V                                          MODIFIER LETTER CAPITAL V
+U+03012           〒            \postalmark                                  POSTAL MARK
+U+03030           〰            \:wavy_dash:                                 WAVY DASH
+U+0303D           〽            \:part_alternation_mark:                     PART ALTERNATION MARK
+U+03297           ㊗            \:congratulations:                           CIRCLED IDEOGRAPH CONGRATULATION
+U+03299           ㊙            \:secret:                                    CIRCLED IDEOGRAPH SECRET
+U+1D400           𝐀            \bfA                                         MATHEMATICAL BOLD CAPITAL A
+U+1D401           𝐁            \bfB                                         MATHEMATICAL BOLD CAPITAL B
+U+1D402           𝐂            \bfC                                         MATHEMATICAL BOLD CAPITAL C
+U+1D403           𝐃            \bfD                                         MATHEMATICAL BOLD CAPITAL D
+U+1D404           𝐄            \bfE                                         MATHEMATICAL BOLD CAPITAL E
+U+1D405           𝐅            \bfF                                         MATHEMATICAL BOLD CAPITAL F
+U+1D406           𝐆            \bfG                                         MATHEMATICAL BOLD CAPITAL G
+U+1D407           𝐇            \bfH                                         MATHEMATICAL BOLD CAPITAL H
+U+1D408           𝐈            \bfI                                         MATHEMATICAL BOLD CAPITAL I
+U+1D409           𝐉            \bfJ                                         MATHEMATICAL BOLD CAPITAL J
+U+1D40A           𝐊            \bfK                                         MATHEMATICAL BOLD CAPITAL K
+U+1D40B           𝐋            \bfL                                         MATHEMATICAL BOLD CAPITAL L
+U+1D40C           𝐌            \bfM                                         MATHEMATICAL BOLD CAPITAL M
+U+1D40D           𝐍            \bfN                                         MATHEMATICAL BOLD CAPITAL N
+U+1D40E           𝐎            \bfO                                         MATHEMATICAL BOLD CAPITAL O
+U+1D40F           𝐏            \bfP                                         MATHEMATICAL BOLD CAPITAL P
+U+1D410           𝐐            \bfQ                                         MATHEMATICAL BOLD CAPITAL Q
+U+1D411           𝐑            \bfR                                         MATHEMATICAL BOLD CAPITAL R
+U+1D412           𝐒            \bfS                                         MATHEMATICAL BOLD CAPITAL S
+U+1D413           𝐓            \bfT                                         MATHEMATICAL BOLD CAPITAL T
+U+1D414           𝐔            \bfU                                         MATHEMATICAL BOLD CAPITAL U
+U+1D415           𝐕            \bfV                                         MATHEMATICAL BOLD CAPITAL V
+U+1D416           𝐖            \bfW                                         MATHEMATICAL BOLD CAPITAL W
+U+1D417           𝐗            \bfX                                         MATHEMATICAL BOLD CAPITAL X
+U+1D418           𝐘            \bfY                                         MATHEMATICAL BOLD CAPITAL Y
+U+1D419           𝐙            \bfZ                                         MATHEMATICAL BOLD CAPITAL Z
+U+1D41A           𝐚            \bfa                                         MATHEMATICAL BOLD SMALL A
+U+1D41B           𝐛            \bfb                                         MATHEMATICAL BOLD SMALL B
+U+1D41C           𝐜            \bfc                                         MATHEMATICAL BOLD SMALL C
+U+1D41D           𝐝            \bfd                                         MATHEMATICAL BOLD SMALL D
+U+1D41E           𝐞            \bfe                                         MATHEMATICAL BOLD SMALL E
+U+1D41F           𝐟            \bff                                         MATHEMATICAL BOLD SMALL F
+U+1D420           𝐠            \bfg                                         MATHEMATICAL BOLD SMALL G
+U+1D421           𝐡            \bfh                                         MATHEMATICAL BOLD SMALL H
+U+1D422           𝐢            \bfi                                         MATHEMATICAL BOLD SMALL I
+U+1D423           𝐣            \bfj                                         MATHEMATICAL BOLD SMALL J
+U+1D424           𝐤            \bfk                                         MATHEMATICAL BOLD SMALL K
+U+1D425           𝐥            \bfl                                         MATHEMATICAL BOLD SMALL L
+U+1D426           𝐦            \bfm                                         MATHEMATICAL BOLD SMALL M
+U+1D427           𝐧            \bfn                                         MATHEMATICAL BOLD SMALL N
+U+1D428           𝐨            \bfo                                         MATHEMATICAL BOLD SMALL O
+U+1D429           𝐩            \bfp                                         MATHEMATICAL BOLD SMALL P
+U+1D42A           𝐪            \bfq                                         MATHEMATICAL BOLD SMALL Q
+U+1D42B           𝐫            \bfr                                         MATHEMATICAL BOLD SMALL R
+U+1D42C           𝐬            \bfs                                         MATHEMATICAL BOLD SMALL S
+U+1D42D           𝐭            \bft                                         MATHEMATICAL BOLD SMALL T
+U+1D42E           𝐮            \bfu                                         MATHEMATICAL BOLD SMALL U
+U+1D42F           𝐯            \bfv                                         MATHEMATICAL BOLD SMALL V
+U+1D430           𝐰            \bfw                                         MATHEMATICAL BOLD SMALL W
+U+1D431           𝐱            \bfx                                         MATHEMATICAL BOLD SMALL X
+U+1D432           𝐲            \bfy                                         MATHEMATICAL BOLD SMALL Y
+U+1D433           𝐳            \bfz                                         MATHEMATICAL BOLD SMALL Z
+U+1D434           𝐴            \itA                                         MATHEMATICAL ITALIC CAPITAL A
+U+1D435           𝐵            \itB                                         MATHEMATICAL ITALIC CAPITAL B
+U+1D436           𝐶            \itC                                         MATHEMATICAL ITALIC CAPITAL C
+U+1D437           𝐷            \itD                                         MATHEMATICAL ITALIC CAPITAL D
+U+1D438           𝐸            \itE                                         MATHEMATICAL ITALIC CAPITAL E
+U+1D439           𝐹            \itF                                         MATHEMATICAL ITALIC CAPITAL F
+U+1D43A           𝐺            \itG                                         MATHEMATICAL ITALIC CAPITAL G
+U+1D43B           𝐻            \itH                                         MATHEMATICAL ITALIC CAPITAL H
+U+1D43C           𝐼            \itI                                         MATHEMATICAL ITALIC CAPITAL I
+U+1D43D           𝐽            \itJ                                         MATHEMATICAL ITALIC CAPITAL J
+U+1D43E           𝐾            \itK                                         MATHEMATICAL ITALIC CAPITAL K
+U+1D43F           𝐿            \itL                                         MATHEMATICAL ITALIC CAPITAL L
+U+1D440           𝑀            \itM                                         MATHEMATICAL ITALIC CAPITAL M
+U+1D441           𝑁            \itN                                         MATHEMATICAL ITALIC CAPITAL N
+U+1D442           𝑂            \itO                                         MATHEMATICAL ITALIC CAPITAL O
+U+1D443           𝑃            \itP                                         MATHEMATICAL ITALIC CAPITAL P
+U+1D444           𝑄            \itQ                                         MATHEMATICAL ITALIC CAPITAL Q
+U+1D445           𝑅            \itR                                         MATHEMATICAL ITALIC CAPITAL R
+U+1D446           𝑆            \itS                                         MATHEMATICAL ITALIC CAPITAL S
+U+1D447           𝑇            \itT                                         MATHEMATICAL ITALIC CAPITAL T
+U+1D448           𝑈            \itU                                         MATHEMATICAL ITALIC CAPITAL U
+U+1D449           𝑉            \itV                                         MATHEMATICAL ITALIC CAPITAL V
+U+1D44A           𝑊            \itW                                         MATHEMATICAL ITALIC CAPITAL W
+U+1D44B           𝑋            \itX                                         MATHEMATICAL ITALIC CAPITAL X
+U+1D44C           𝑌            \itY                                         MATHEMATICAL ITALIC CAPITAL Y
+U+1D44D           𝑍            \itZ                                         MATHEMATICAL ITALIC CAPITAL Z
+U+1D44E           𝑎            \ita                                         MATHEMATICAL ITALIC SMALL A
+U+1D44F           𝑏            \itb                                         MATHEMATICAL ITALIC SMALL B
+U+1D450           𝑐            \itc                                         MATHEMATICAL ITALIC SMALL C
+U+1D451           𝑑            \itd                                         MATHEMATICAL ITALIC SMALL D
+U+1D452           𝑒            \ite                                         MATHEMATICAL ITALIC SMALL E
+U+1D453           𝑓            \itf                                         MATHEMATICAL ITALIC SMALL F
+U+1D454           𝑔            \itg                                         MATHEMATICAL ITALIC SMALL G
+U+1D456           𝑖            \iti                                         MATHEMATICAL ITALIC SMALL I
+U+1D457           𝑗            \itj                                         MATHEMATICAL ITALIC SMALL J
+U+1D458           𝑘            \itk                                         MATHEMATICAL ITALIC SMALL K
+U+1D459           𝑙            \itl                                         MATHEMATICAL ITALIC SMALL L
+U+1D45A           𝑚            \itm                                         MATHEMATICAL ITALIC SMALL M
+U+1D45B           𝑛            \itn                                         MATHEMATICAL ITALIC SMALL N
+U+1D45C           𝑜            \ito                                         MATHEMATICAL ITALIC SMALL O
+U+1D45D           𝑝            \itp                                         MATHEMATICAL ITALIC SMALL P
+U+1D45E           𝑞            \itq                                         MATHEMATICAL ITALIC SMALL Q
+U+1D45F           𝑟            \itr                                         MATHEMATICAL ITALIC SMALL R
+U+1D460           𝑠            \its                                         MATHEMATICAL ITALIC SMALL S
+U+1D461           𝑡            \itt                                         MATHEMATICAL ITALIC SMALL T
+U+1D462           𝑢            \itu                                         MATHEMATICAL ITALIC SMALL U
+U+1D463           𝑣            \itv                                         MATHEMATICAL ITALIC SMALL V
+U+1D464           𝑤            \itw                                         MATHEMATICAL ITALIC SMALL W
+U+1D465           𝑥            \itx                                         MATHEMATICAL ITALIC SMALL X
+U+1D466           𝑦            \ity                                         MATHEMATICAL ITALIC SMALL Y
+U+1D467           𝑧            \itz                                         MATHEMATICAL ITALIC SMALL Z
+U+1D468           𝑨            \biA                                         MATHEMATICAL BOLD ITALIC CAPITAL A
+U+1D469           𝑩            \biB                                         MATHEMATICAL BOLD ITALIC CAPITAL B
+U+1D46A           𝑪            \biC                                         MATHEMATICAL BOLD ITALIC CAPITAL C
+U+1D46B           𝑫            \biD                                         MATHEMATICAL BOLD ITALIC CAPITAL D
+U+1D46C           𝑬            \biE                                         MATHEMATICAL BOLD ITALIC CAPITAL E
+U+1D46D           𝑭            \biF                                         MATHEMATICAL BOLD ITALIC CAPITAL F
+U+1D46E           𝑮            \biG                                         MATHEMATICAL BOLD ITALIC CAPITAL G
+U+1D46F           𝑯            \biH                                         MATHEMATICAL BOLD ITALIC CAPITAL H
+U+1D470           𝑰            \biI                                         MATHEMATICAL BOLD ITALIC CAPITAL I
+U+1D471           𝑱            \biJ                                         MATHEMATICAL BOLD ITALIC CAPITAL J
+U+1D472           𝑲            \biK                                         MATHEMATICAL BOLD ITALIC CAPITAL K
+U+1D473           𝑳            \biL                                         MATHEMATICAL BOLD ITALIC CAPITAL L
+U+1D474           𝑴            \biM                                         MATHEMATICAL BOLD ITALIC CAPITAL M
+U+1D475           𝑵            \biN                                         MATHEMATICAL BOLD ITALIC CAPITAL N
+U+1D476           𝑶            \biO                                         MATHEMATICAL BOLD ITALIC CAPITAL O
+U+1D477           𝑷            \biP                                         MATHEMATICAL BOLD ITALIC CAPITAL P
+U+1D478           𝑸            \biQ                                         MATHEMATICAL BOLD ITALIC CAPITAL Q
+U+1D479           𝑹            \biR                                         MATHEMATICAL BOLD ITALIC CAPITAL R
+U+1D47A           𝑺            \biS                                         MATHEMATICAL BOLD ITALIC CAPITAL S
+U+1D47B           𝑻            \biT                                         MATHEMATICAL BOLD ITALIC CAPITAL T
+U+1D47C           𝑼            \biU                                         MATHEMATICAL BOLD ITALIC CAPITAL U
+U+1D47D           𝑽            \biV                                         MATHEMATICAL BOLD ITALIC CAPITAL V
+U+1D47E           𝑾            \biW                                         MATHEMATICAL BOLD ITALIC CAPITAL W
+U+1D47F           𝑿            \biX                                         MATHEMATICAL BOLD ITALIC CAPITAL X
+U+1D480           𝒀            \biY                                         MATHEMATICAL BOLD ITALIC CAPITAL Y
+U+1D481           𝒁            \biZ                                         MATHEMATICAL BOLD ITALIC CAPITAL Z
+U+1D482           𝒂            \bia                                         MATHEMATICAL BOLD ITALIC SMALL A
+U+1D483           𝒃            \bib                                         MATHEMATICAL BOLD ITALIC SMALL B
+U+1D484           𝒄            \bic                                         MATHEMATICAL BOLD ITALIC SMALL C
+U+1D485           𝒅            \bid                                         MATHEMATICAL BOLD ITALIC SMALL D
+U+1D486           𝒆            \bie                                         MATHEMATICAL BOLD ITALIC SMALL E
+U+1D487           𝒇            \bif                                         MATHEMATICAL BOLD ITALIC SMALL F
+U+1D488           𝒈            \big                                         MATHEMATICAL BOLD ITALIC SMALL G
+U+1D489           𝒉            \bih                                         MATHEMATICAL BOLD ITALIC SMALL H
+U+1D48A           𝒊            \bii                                         MATHEMATICAL BOLD ITALIC SMALL I
+U+1D48B           𝒋            \bij                                         MATHEMATICAL BOLD ITALIC SMALL J
+U+1D48C           𝒌            \bik                                         MATHEMATICAL BOLD ITALIC SMALL K
+U+1D48D           𝒍            \bil                                         MATHEMATICAL BOLD ITALIC SMALL L
+U+1D48E           𝒎            \bim                                         MATHEMATICAL BOLD ITALIC SMALL M
+U+1D48F           𝒏            \bin                                         MATHEMATICAL BOLD ITALIC SMALL N
+U+1D490           𝒐            \bio                                         MATHEMATICAL BOLD ITALIC SMALL O
+U+1D491           𝒑            \bip                                         MATHEMATICAL BOLD ITALIC SMALL P
+U+1D492           𝒒            \biq                                         MATHEMATICAL BOLD ITALIC SMALL Q
+U+1D493           𝒓            \bir                                         MATHEMATICAL BOLD ITALIC SMALL R
+U+1D494           𝒔            \bis                                         MATHEMATICAL BOLD ITALIC SMALL S
+U+1D495           𝒕            \bit                                         MATHEMATICAL BOLD ITALIC SMALL T
+U+1D496           𝒖            \biu                                         MATHEMATICAL BOLD ITALIC SMALL U
+U+1D497           𝒗            \biv                                         MATHEMATICAL BOLD ITALIC SMALL V
+U+1D498           𝒘            \biw                                         MATHEMATICAL BOLD ITALIC SMALL W
+U+1D499           𝒙            \bix                                         MATHEMATICAL BOLD ITALIC SMALL X
+U+1D49A           𝒚            \biy                                         MATHEMATICAL BOLD ITALIC SMALL Y
+U+1D49B           𝒛            \biz                                         MATHEMATICAL BOLD ITALIC SMALL Z
+U+1D49C           𝒜            \scrA                                        MATHEMATICAL SCRIPT CAPITAL A
+U+1D49E           𝒞            \scrC                                        MATHEMATICAL SCRIPT CAPITAL C
+U+1D49F           𝒟            \scrD                                        MATHEMATICAL SCRIPT CAPITAL D
+U+1D4A2           𝒢            \scrG                                        MATHEMATICAL SCRIPT CAPITAL G
+U+1D4A5           𝒥            \scrJ                                        MATHEMATICAL SCRIPT CAPITAL J
+U+1D4A6           𝒦            \scrK                                        MATHEMATICAL SCRIPT CAPITAL K
+U+1D4A9           𝒩            \scrN                                        MATHEMATICAL SCRIPT CAPITAL N
+U+1D4AA           𝒪            \scrO                                        MATHEMATICAL SCRIPT CAPITAL O
+U+1D4AB           𝒫            \scrP                                        MATHEMATICAL SCRIPT CAPITAL P
+U+1D4AC           𝒬            \scrQ                                        MATHEMATICAL SCRIPT CAPITAL Q
+U+1D4AE           𝒮            \scrS                                        MATHEMATICAL SCRIPT CAPITAL S
+U+1D4AF           𝒯            \scrT                                        MATHEMATICAL SCRIPT CAPITAL T
+U+1D4B0           𝒰            \scrU                                        MATHEMATICAL SCRIPT CAPITAL U
+U+1D4B1           𝒱            \scrV                                        MATHEMATICAL SCRIPT CAPITAL V
+U+1D4B2           𝒲            \scrW                                        MATHEMATICAL SCRIPT CAPITAL W
+U+1D4B3           𝒳            \scrX                                        MATHEMATICAL SCRIPT CAPITAL X
+U+1D4B4           𝒴            \scrY                                        MATHEMATICAL SCRIPT CAPITAL Y
+U+1D4B5           𝒵            \scrZ                                        MATHEMATICAL SCRIPT CAPITAL Z
+U+1D4B6           𝒶            \scra                                        MATHEMATICAL SCRIPT SMALL A
+U+1D4B7           𝒷            \scrb                                        MATHEMATICAL SCRIPT SMALL B
+U+1D4B8           𝒸            \scrc                                        MATHEMATICAL SCRIPT SMALL C
+U+1D4B9           𝒹            \scrd                                        MATHEMATICAL SCRIPT SMALL D
+U+1D4BB           𝒻            \scrf                                        MATHEMATICAL SCRIPT SMALL F
+U+1D4BD           𝒽            \scrh                                        MATHEMATICAL SCRIPT SMALL H
+U+1D4BE           𝒾            \scri                                        MATHEMATICAL SCRIPT SMALL I
+U+1D4BF           𝒿            \scrj                                        MATHEMATICAL SCRIPT SMALL J
+U+1D4C0           𝓀            \scrk                                        MATHEMATICAL SCRIPT SMALL K
+U+1D4C1           𝓁            \scrl                                        MATHEMATICAL SCRIPT SMALL L
+U+1D4C2           𝓂            \scrm                                        MATHEMATICAL SCRIPT SMALL M
+U+1D4C3           𝓃            \scrn                                        MATHEMATICAL SCRIPT SMALL N
+U+1D4C5           𝓅            \scrp                                        MATHEMATICAL SCRIPT SMALL P
+U+1D4C6           𝓆            \scrq                                        MATHEMATICAL SCRIPT SMALL Q
+U+1D4C7           𝓇            \scrr                                        MATHEMATICAL SCRIPT SMALL R
+U+1D4C8           𝓈            \scrs                                        MATHEMATICAL SCRIPT SMALL S
+U+1D4C9           𝓉            \scrt                                        MATHEMATICAL SCRIPT SMALL T
+U+1D4CA           𝓊            \scru                                        MATHEMATICAL SCRIPT SMALL U
+U+1D4CB           𝓋            \scrv                                        MATHEMATICAL SCRIPT SMALL V
+U+1D4CC           𝓌            \scrw                                        MATHEMATICAL SCRIPT SMALL W
+U+1D4CD           𝓍            \scrx                                        MATHEMATICAL SCRIPT SMALL X
+U+1D4CE           𝓎            \scry                                        MATHEMATICAL SCRIPT SMALL Y
+U+1D4CF           𝓏            \scrz                                        MATHEMATICAL SCRIPT SMALL Z
+U+1D4D0           𝓐            \bscrA                                       MATHEMATICAL BOLD SCRIPT CAPITAL A
+U+1D4D1           𝓑            \bscrB                                       MATHEMATICAL BOLD SCRIPT CAPITAL B
+U+1D4D2           𝓒            \bscrC                                       MATHEMATICAL BOLD SCRIPT CAPITAL C
+U+1D4D3           𝓓            \bscrD                                       MATHEMATICAL BOLD SCRIPT CAPITAL D
+U+1D4D4           𝓔            \bscrE                                       MATHEMATICAL BOLD SCRIPT CAPITAL E
+U+1D4D5           𝓕            \bscrF                                       MATHEMATICAL BOLD SCRIPT CAPITAL F
+U+1D4D6           𝓖            \bscrG                                       MATHEMATICAL BOLD SCRIPT CAPITAL G
+U+1D4D7           𝓗            \bscrH                                       MATHEMATICAL BOLD SCRIPT CAPITAL H
+U+1D4D8           𝓘            \bscrI                                       MATHEMATICAL BOLD SCRIPT CAPITAL I
+U+1D4D9           𝓙            \bscrJ                                       MATHEMATICAL BOLD SCRIPT CAPITAL J
+U+1D4DA           𝓚            \bscrK                                       MATHEMATICAL BOLD SCRIPT CAPITAL K
+U+1D4DB           𝓛            \bscrL                                       MATHEMATICAL BOLD SCRIPT CAPITAL L
+U+1D4DC           𝓜            \bscrM                                       MATHEMATICAL BOLD SCRIPT CAPITAL M
+U+1D4DD           𝓝            \bscrN                                       MATHEMATICAL BOLD SCRIPT CAPITAL N
+U+1D4DE           𝓞            \bscrO                                       MATHEMATICAL BOLD SCRIPT CAPITAL O
+U+1D4DF           𝓟            \bscrP                                       MATHEMATICAL BOLD SCRIPT CAPITAL P
+U+1D4E0           𝓠            \bscrQ                                       MATHEMATICAL BOLD SCRIPT CAPITAL Q
+U+1D4E1           𝓡            \bscrR                                       MATHEMATICAL BOLD SCRIPT CAPITAL R
+U+1D4E2           𝓢            \bscrS                                       MATHEMATICAL BOLD SCRIPT CAPITAL S
+U+1D4E3           𝓣            \bscrT                                       MATHEMATICAL BOLD SCRIPT CAPITAL T
+U+1D4E4           𝓤            \bscrU                                       MATHEMATICAL BOLD SCRIPT CAPITAL U
+U+1D4E5           𝓥            \bscrV                                       MATHEMATICAL BOLD SCRIPT CAPITAL V
+U+1D4E6           𝓦            \bscrW                                       MATHEMATICAL BOLD SCRIPT CAPITAL W
+U+1D4E7           𝓧            \bscrX                                       MATHEMATICAL BOLD SCRIPT CAPITAL X
+U+1D4E8           𝓨            \bscrY                                       MATHEMATICAL BOLD SCRIPT CAPITAL Y
+U+1D4E9           𝓩            \bscrZ                                       MATHEMATICAL BOLD SCRIPT CAPITAL Z
+U+1D4EA           𝓪            \bscra                                       MATHEMATICAL BOLD SCRIPT SMALL A
+U+1D4EB           𝓫            \bscrb                                       MATHEMATICAL BOLD SCRIPT SMALL B
+U+1D4EC           𝓬            \bscrc                                       MATHEMATICAL BOLD SCRIPT SMALL C
+U+1D4ED           𝓭            \bscrd                                       MATHEMATICAL BOLD SCRIPT SMALL D
+U+1D4EE           𝓮            \bscre                                       MATHEMATICAL BOLD SCRIPT SMALL E
+U+1D4EF           𝓯            \bscrf                                       MATHEMATICAL BOLD SCRIPT SMALL F
+U+1D4F0           𝓰            \bscrg                                       MATHEMATICAL BOLD SCRIPT SMALL G
+U+1D4F1           𝓱            \bscrh                                       MATHEMATICAL BOLD SCRIPT SMALL H
+U+1D4F2           𝓲            \bscri                                       MATHEMATICAL BOLD SCRIPT SMALL I
+U+1D4F3           𝓳            \bscrj                                       MATHEMATICAL BOLD SCRIPT SMALL J
+U+1D4F4           𝓴            \bscrk                                       MATHEMATICAL BOLD SCRIPT SMALL K
+U+1D4F5           𝓵            \bscrl                                       MATHEMATICAL BOLD SCRIPT SMALL L
+U+1D4F6           𝓶            \bscrm                                       MATHEMATICAL BOLD SCRIPT SMALL M
+U+1D4F7           𝓷            \bscrn                                       MATHEMATICAL BOLD SCRIPT SMALL N
+U+1D4F8           𝓸            \bscro                                       MATHEMATICAL BOLD SCRIPT SMALL O
+U+1D4F9           𝓹            \bscrp                                       MATHEMATICAL BOLD SCRIPT SMALL P
+U+1D4FA           𝓺            \bscrq                                       MATHEMATICAL BOLD SCRIPT SMALL Q
+U+1D4FB           𝓻            \bscrr                                       MATHEMATICAL BOLD SCRIPT SMALL R
+U+1D4FC           𝓼            \bscrs                                       MATHEMATICAL BOLD SCRIPT SMALL S
+U+1D4FD           𝓽            \bscrt                                       MATHEMATICAL BOLD SCRIPT SMALL T
+U+1D4FE           𝓾            \bscru                                       MATHEMATICAL BOLD SCRIPT SMALL U
+U+1D4FF           𝓿            \bscrv                                       MATHEMATICAL BOLD SCRIPT SMALL V
+U+1D500           𝔀            \bscrw                                       MATHEMATICAL BOLD SCRIPT SMALL W
+U+1D501           𝔁            \bscrx                                       MATHEMATICAL BOLD SCRIPT SMALL X
+U+1D502           𝔂            \bscry                                       MATHEMATICAL BOLD SCRIPT SMALL Y
+U+1D503           𝔃            \bscrz                                       MATHEMATICAL BOLD SCRIPT SMALL Z
+U+1D504           𝔄            \frakA                                       MATHEMATICAL FRAKTUR CAPITAL A
+U+1D505           𝔅            \frakB                                       MATHEMATICAL FRAKTUR CAPITAL B
+U+1D507           𝔇            \frakD                                       MATHEMATICAL FRAKTUR CAPITAL D
+U+1D508           𝔈            \frakE                                       MATHEMATICAL FRAKTUR CAPITAL E
+U+1D509           𝔉            \frakF                                       MATHEMATICAL FRAKTUR CAPITAL F
+U+1D50A           𝔊            \frakG                                       MATHEMATICAL FRAKTUR CAPITAL G
+U+1D50D           𝔍            \frakJ                                       MATHEMATICAL FRAKTUR CAPITAL J
+U+1D50E           𝔎            \frakK                                       MATHEMATICAL FRAKTUR CAPITAL K
+U+1D50F           𝔏            \frakL                                       MATHEMATICAL FRAKTUR CAPITAL L
+U+1D510           𝔐            \frakM                                       MATHEMATICAL FRAKTUR CAPITAL M
+U+1D511           𝔑            \frakN                                       MATHEMATICAL FRAKTUR CAPITAL N
+U+1D512           𝔒            \frakO                                       MATHEMATICAL FRAKTUR CAPITAL O
+U+1D513           𝔓            \frakP                                       MATHEMATICAL FRAKTUR CAPITAL P
+U+1D514           𝔔            \frakQ                                       MATHEMATICAL FRAKTUR CAPITAL Q
+U+1D516           𝔖            \frakS                                       MATHEMATICAL FRAKTUR CAPITAL S
+U+1D517           𝔗            \frakT                                       MATHEMATICAL FRAKTUR CAPITAL T
+U+1D518           𝔘            \frakU                                       MATHEMATICAL FRAKTUR CAPITAL U
+U+1D519           𝔙            \frakV                                       MATHEMATICAL FRAKTUR CAPITAL V
+U+1D51A           𝔚            \frakW                                       MATHEMATICAL FRAKTUR CAPITAL W
+U+1D51B           𝔛            \frakX                                       MATHEMATICAL FRAKTUR CAPITAL X
+U+1D51C           𝔜            \frakY                                       MATHEMATICAL FRAKTUR CAPITAL Y
+U+1D51E           𝔞            \fraka                                       MATHEMATICAL FRAKTUR SMALL A
+U+1D51F           𝔟            \frakb                                       MATHEMATICAL FRAKTUR SMALL B
+U+1D520           𝔠            \frakc                                       MATHEMATICAL FRAKTUR SMALL C
+U+1D521           𝔡            \frakd                                       MATHEMATICAL FRAKTUR SMALL D
+U+1D522           𝔢            \frake                                       MATHEMATICAL FRAKTUR SMALL E
+U+1D523           𝔣            \frakf                                       MATHEMATICAL FRAKTUR SMALL F
+U+1D524           𝔤            \frakg                                       MATHEMATICAL FRAKTUR SMALL G
+U+1D525           𝔥            \frakh                                       MATHEMATICAL FRAKTUR SMALL H
+U+1D526           𝔦            \fraki                                       MATHEMATICAL FRAKTUR SMALL I
+U+1D527           𝔧            \frakj                                       MATHEMATICAL FRAKTUR SMALL J
+U+1D528           𝔨            \frakk                                       MATHEMATICAL FRAKTUR SMALL K
+U+1D529           𝔩            \frakl                                       MATHEMATICAL FRAKTUR SMALL L
+U+1D52A           𝔪            \frakm                                       MATHEMATICAL FRAKTUR SMALL M
+U+1D52B           𝔫            \frakn                                       MATHEMATICAL FRAKTUR SMALL N
+U+1D52C           𝔬            \frako                                       MATHEMATICAL FRAKTUR SMALL O
+U+1D52D           𝔭            \frakp                                       MATHEMATICAL FRAKTUR SMALL P
+U+1D52E           𝔮            \frakq                                       MATHEMATICAL FRAKTUR SMALL Q
+U+1D52F           𝔯            \frakr                                       MATHEMATICAL FRAKTUR SMALL R
+U+1D530           𝔰            \fraks                                       MATHEMATICAL FRAKTUR SMALL S
+U+1D531           𝔱            \frakt                                       MATHEMATICAL FRAKTUR SMALL T
+U+1D532           𝔲            \fraku                                       MATHEMATICAL FRAKTUR SMALL U
+U+1D533           𝔳            \frakv                                       MATHEMATICAL FRAKTUR SMALL V
+U+1D534           𝔴            \frakw                                       MATHEMATICAL FRAKTUR SMALL W
+U+1D535           𝔵            \frakx                                       MATHEMATICAL FRAKTUR SMALL X
+U+1D536           𝔶            \fraky                                       MATHEMATICAL FRAKTUR SMALL Y
+U+1D537           𝔷            \frakz                                       MATHEMATICAL FRAKTUR SMALL Z
+U+1D538           𝔸            \bbA                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL A
+U+1D539           𝔹            \bbB                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL B
+U+1D53B           𝔻            \bbD                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL D
+U+1D53C           𝔼            \bbE                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL E
+U+1D53D           𝔽            \bbF                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL F
+U+1D53E           𝔾            \bbG                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL G
+U+1D540           𝕀            \bbI                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL I
+U+1D541           𝕁            \bbJ                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL J
+U+1D542           𝕂            \bbK                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL K
+U+1D543           𝕃            \bbL                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL L
+U+1D544           𝕄            \bbM                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL M
+U+1D546           𝕆            \bbO                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL O
+U+1D54A           𝕊            \bbS                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL S
+U+1D54B           𝕋            \bbT                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL T
+U+1D54C           𝕌            \bbU                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL U
+U+1D54D           𝕍            \bbV                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL V
+U+1D54E           𝕎            \bbW                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL W
+U+1D54F           𝕏            \bbX                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL X
+U+1D550           𝕐            \bbY                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL Y
+U+1D552           𝕒            \bba                                         MATHEMATICAL DOUBLE-STRUCK SMALL A
+U+1D553           𝕓            \bbb                                         MATHEMATICAL DOUBLE-STRUCK SMALL B
+U+1D554           𝕔            \bbc                                         MATHEMATICAL DOUBLE-STRUCK SMALL C
+U+1D555           𝕕            \bbd                                         MATHEMATICAL DOUBLE-STRUCK SMALL D
+U+1D556           𝕖            \bbe                                         MATHEMATICAL DOUBLE-STRUCK SMALL E
+U+1D557           𝕗            \bbf                                         MATHEMATICAL DOUBLE-STRUCK SMALL F
+U+1D558           𝕘            \bbg                                         MATHEMATICAL DOUBLE-STRUCK SMALL G
+U+1D559           𝕙            \bbh                                         MATHEMATICAL DOUBLE-STRUCK SMALL H
+U+1D55A           𝕚            \bbi                                         MATHEMATICAL DOUBLE-STRUCK SMALL I
+U+1D55B           𝕛            \bbj                                         MATHEMATICAL DOUBLE-STRUCK SMALL J
+U+1D55C           𝕜            \bbk                                         MATHEMATICAL DOUBLE-STRUCK SMALL K
+U+1D55D           𝕝            \bbl                                         MATHEMATICAL DOUBLE-STRUCK SMALL L
+U+1D55E           𝕞            \bbm                                         MATHEMATICAL DOUBLE-STRUCK SMALL M
+U+1D55F           𝕟            \bbn                                         MATHEMATICAL DOUBLE-STRUCK SMALL N
+U+1D560           𝕠            \bbo                                         MATHEMATICAL DOUBLE-STRUCK SMALL O
+U+1D561           𝕡            \bbp                                         MATHEMATICAL DOUBLE-STRUCK SMALL P
+U+1D562           𝕢            \bbq                                         MATHEMATICAL DOUBLE-STRUCK SMALL Q
+U+1D563           𝕣            \bbr                                         MATHEMATICAL DOUBLE-STRUCK SMALL R
+U+1D564           𝕤            \bbs                                         MATHEMATICAL DOUBLE-STRUCK SMALL S
+U+1D565           𝕥            \bbt                                         MATHEMATICAL DOUBLE-STRUCK SMALL T
+U+1D566           𝕦            \bbu                                         MATHEMATICAL DOUBLE-STRUCK SMALL U
+U+1D567           𝕧            \bbv                                         MATHEMATICAL DOUBLE-STRUCK SMALL V
+U+1D568           𝕨            \bbw                                         MATHEMATICAL DOUBLE-STRUCK SMALL W
+U+1D569           𝕩            \bbx                                         MATHEMATICAL DOUBLE-STRUCK SMALL X
+U+1D56A           𝕪            \bby                                         MATHEMATICAL DOUBLE-STRUCK SMALL Y
+U+1D56B           𝕫            \bbz                                         MATHEMATICAL DOUBLE-STRUCK SMALL Z
+U+1D56C           𝕬            \bfrakA                                      MATHEMATICAL BOLD FRAKTUR CAPITAL A
+U+1D56D           𝕭            \bfrakB                                      MATHEMATICAL BOLD FRAKTUR CAPITAL B
+U+1D56E           𝕮            \bfrakC                                      MATHEMATICAL BOLD FRAKTUR CAPITAL C
+U+1D56F           𝕯            \bfrakD                                      MATHEMATICAL BOLD FRAKTUR CAPITAL D
+U+1D570           𝕰            \bfrakE                                      MATHEMATICAL BOLD FRAKTUR CAPITAL E
+U+1D571           𝕱            \bfrakF                                      MATHEMATICAL BOLD FRAKTUR CAPITAL F
+U+1D572           𝕲            \bfrakG                                      MATHEMATICAL BOLD FRAKTUR CAPITAL G
+U+1D573           𝕳            \bfrakH                                      MATHEMATICAL BOLD FRAKTUR CAPITAL H
+U+1D574           𝕴            \bfrakI                                      MATHEMATICAL BOLD FRAKTUR CAPITAL I
+U+1D575           𝕵            \bfrakJ                                      MATHEMATICAL BOLD FRAKTUR CAPITAL J
+U+1D576           𝕶            \bfrakK                                      MATHEMATICAL BOLD FRAKTUR CAPITAL K
+U+1D577           𝕷            \bfrakL                                      MATHEMATICAL BOLD FRAKTUR CAPITAL L
+U+1D578           𝕸            \bfrakM                                      MATHEMATICAL BOLD FRAKTUR CAPITAL M
+U+1D579           𝕹            \bfrakN                                      MATHEMATICAL BOLD FRAKTUR CAPITAL N
+U+1D57A           𝕺            \bfrakO                                      MATHEMATICAL BOLD FRAKTUR CAPITAL O
+U+1D57B           𝕻            \bfrakP                                      MATHEMATICAL BOLD FRAKTUR CAPITAL P
+U+1D57C           𝕼            \bfrakQ                                      MATHEMATICAL BOLD FRAKTUR CAPITAL Q
+U+1D57D           𝕽            \bfrakR                                      MATHEMATICAL BOLD FRAKTUR CAPITAL R
+U+1D57E           𝕾            \bfrakS                                      MATHEMATICAL BOLD FRAKTUR CAPITAL S
+U+1D57F           𝕿            \bfrakT                                      MATHEMATICAL BOLD FRAKTUR CAPITAL T
+U+1D580           𝖀            \bfrakU                                      MATHEMATICAL BOLD FRAKTUR CAPITAL U
+U+1D581           𝖁            \bfrakV                                      MATHEMATICAL BOLD FRAKTUR CAPITAL V
+U+1D582           𝖂            \bfrakW                                      MATHEMATICAL BOLD FRAKTUR CAPITAL W
+U+1D583           𝖃            \bfrakX                                      MATHEMATICAL BOLD FRAKTUR CAPITAL X
+U+1D584           𝖄            \bfrakY                                      MATHEMATICAL BOLD FRAKTUR CAPITAL Y
+U+1D585           𝖅            \bfrakZ                                      MATHEMATICAL BOLD FRAKTUR CAPITAL Z
+U+1D586           𝖆            \bfraka                                      MATHEMATICAL BOLD FRAKTUR SMALL A
+U+1D587           𝖇            \bfrakb                                      MATHEMATICAL BOLD FRAKTUR SMALL B
+U+1D588           𝖈            \bfrakc                                      MATHEMATICAL BOLD FRAKTUR SMALL C
+U+1D589           𝖉            \bfrakd                                      MATHEMATICAL BOLD FRAKTUR SMALL D
+U+1D58A           𝖊            \bfrake                                      MATHEMATICAL BOLD FRAKTUR SMALL E
+U+1D58B           𝖋            \bfrakf                                      MATHEMATICAL BOLD FRAKTUR SMALL F
+U+1D58C           𝖌            \bfrakg                                      MATHEMATICAL BOLD FRAKTUR SMALL G
+U+1D58D           𝖍            \bfrakh                                      MATHEMATICAL BOLD FRAKTUR SMALL H
+U+1D58E           𝖎            \bfraki                                      MATHEMATICAL BOLD FRAKTUR SMALL I
+U+1D58F           𝖏            \bfrakj                                      MATHEMATICAL BOLD FRAKTUR SMALL J
+U+1D590           𝖐            \bfrakk                                      MATHEMATICAL BOLD FRAKTUR SMALL K
+U+1D591           𝖑            \bfrakl                                      MATHEMATICAL BOLD FRAKTUR SMALL L
+U+1D592           𝖒            \bfrakm                                      MATHEMATICAL BOLD FRAKTUR SMALL M
+U+1D593           𝖓            \bfrakn                                      MATHEMATICAL BOLD FRAKTUR SMALL N
+U+1D594           𝖔            \bfrako                                      MATHEMATICAL BOLD FRAKTUR SMALL O
+U+1D595           𝖕            \bfrakp                                      MATHEMATICAL BOLD FRAKTUR SMALL P
+U+1D596           𝖖            \bfrakq                                      MATHEMATICAL BOLD FRAKTUR SMALL Q
+U+1D597           𝖗            \bfrakr                                      MATHEMATICAL BOLD FRAKTUR SMALL R
+U+1D598           𝖘            \bfraks                                      MATHEMATICAL BOLD FRAKTUR SMALL S
+U+1D599           𝖙            \bfrakt                                      MATHEMATICAL BOLD FRAKTUR SMALL T
+U+1D59A           𝖚            \bfraku                                      MATHEMATICAL BOLD FRAKTUR SMALL U
+U+1D59B           𝖛            \bfrakv                                      MATHEMATICAL BOLD FRAKTUR SMALL V
+U+1D59C           𝖜            \bfrakw                                      MATHEMATICAL BOLD FRAKTUR SMALL W
+U+1D59D           𝖝            \bfrakx                                      MATHEMATICAL BOLD FRAKTUR SMALL X
+U+1D59E           𝖞            \bfraky                                      MATHEMATICAL BOLD FRAKTUR SMALL Y
+U+1D59F           𝖟            \bfrakz                                      MATHEMATICAL BOLD FRAKTUR SMALL Z
+U+1D5A0           𝖠            \sansA                                       MATHEMATICAL SANS-SERIF CAPITAL A
+U+1D5A1           𝖡            \sansB                                       MATHEMATICAL SANS-SERIF CAPITAL B
+U+1D5A2           𝖢            \sansC                                       MATHEMATICAL SANS-SERIF CAPITAL C
+U+1D5A3           𝖣            \sansD                                       MATHEMATICAL SANS-SERIF CAPITAL D
+U+1D5A4           𝖤            \sansE                                       MATHEMATICAL SANS-SERIF CAPITAL E
+U+1D5A5           𝖥            \sansF                                       MATHEMATICAL SANS-SERIF CAPITAL F
+U+1D5A6           𝖦            \sansG                                       MATHEMATICAL SANS-SERIF CAPITAL G
+U+1D5A7           𝖧            \sansH                                       MATHEMATICAL SANS-SERIF CAPITAL H
+U+1D5A8           𝖨            \sansI                                       MATHEMATICAL SANS-SERIF CAPITAL I
+U+1D5A9           𝖩            \sansJ                                       MATHEMATICAL SANS-SERIF CAPITAL J
+U+1D5AA           𝖪            \sansK                                       MATHEMATICAL SANS-SERIF CAPITAL K
+U+1D5AB           𝖫            \sansL                                       MATHEMATICAL SANS-SERIF CAPITAL L
+U+1D5AC           𝖬            \sansM                                       MATHEMATICAL SANS-SERIF CAPITAL M
+U+1D5AD           𝖭            \sansN                                       MATHEMATICAL SANS-SERIF CAPITAL N
+U+1D5AE           𝖮            \sansO                                       MATHEMATICAL SANS-SERIF CAPITAL O
+U+1D5AF           𝖯            \sansP                                       MATHEMATICAL SANS-SERIF CAPITAL P
+U+1D5B0           𝖰            \sansQ                                       MATHEMATICAL SANS-SERIF CAPITAL Q
+U+1D5B1           𝖱            \sansR                                       MATHEMATICAL SANS-SERIF CAPITAL R
+U+1D5B2           𝖲            \sansS                                       MATHEMATICAL SANS-SERIF CAPITAL S
+U+1D5B3           𝖳            \sansT                                       MATHEMATICAL SANS-SERIF CAPITAL T
+U+1D5B4           𝖴            \sansU                                       MATHEMATICAL SANS-SERIF CAPITAL U
+U+1D5B5           𝖵            \sansV                                       MATHEMATICAL SANS-SERIF CAPITAL V
+U+1D5B6           𝖶            \sansW                                       MATHEMATICAL SANS-SERIF CAPITAL W
+U+1D5B7           𝖷            \sansX                                       MATHEMATICAL SANS-SERIF CAPITAL X
+U+1D5B8           𝖸            \sansY                                       MATHEMATICAL SANS-SERIF CAPITAL Y
+U+1D5B9           𝖹            \sansZ                                       MATHEMATICAL SANS-SERIF CAPITAL Z
+U+1D5BA           𝖺            \sansa                                       MATHEMATICAL SANS-SERIF SMALL A
+U+1D5BB           𝖻            \sansb                                       MATHEMATICAL SANS-SERIF SMALL B
+U+1D5BC           𝖼            \sansc                                       MATHEMATICAL SANS-SERIF SMALL C
+U+1D5BD           𝖽            \sansd                                       MATHEMATICAL SANS-SERIF SMALL D
+U+1D5BE           𝖾            \sanse                                       MATHEMATICAL SANS-SERIF SMALL E
+U+1D5BF           𝖿            \sansf                                       MATHEMATICAL SANS-SERIF SMALL F
+U+1D5C0           𝗀            \sansg                                       MATHEMATICAL SANS-SERIF SMALL G
+U+1D5C1           𝗁            \sansh                                       MATHEMATICAL SANS-SERIF SMALL H
+U+1D5C2           𝗂            \sansi                                       MATHEMATICAL SANS-SERIF SMALL I
+U+1D5C3           𝗃            \sansj                                       MATHEMATICAL SANS-SERIF SMALL J
+U+1D5C4           𝗄            \sansk                                       MATHEMATICAL SANS-SERIF SMALL K
+U+1D5C5           𝗅            \sansl                                       MATHEMATICAL SANS-SERIF SMALL L
+U+1D5C6           𝗆            \sansm                                       MATHEMATICAL SANS-SERIF SMALL M
+U+1D5C7           𝗇            \sansn                                       MATHEMATICAL SANS-SERIF SMALL N
+U+1D5C8           𝗈            \sanso                                       MATHEMATICAL SANS-SERIF SMALL O
+U+1D5C9           𝗉            \sansp                                       MATHEMATICAL SANS-SERIF SMALL P
+U+1D5CA           𝗊            \sansq                                       MATHEMATICAL SANS-SERIF SMALL Q
+U+1D5CB           𝗋            \sansr                                       MATHEMATICAL SANS-SERIF SMALL R
+U+1D5CC           𝗌            \sanss                                       MATHEMATICAL SANS-SERIF SMALL S
+U+1D5CD           𝗍            \sanst                                       MATHEMATICAL SANS-SERIF SMALL T
+U+1D5CE           𝗎            \sansu                                       MATHEMATICAL SANS-SERIF SMALL U
+U+1D5CF           𝗏            \sansv                                       MATHEMATICAL SANS-SERIF SMALL V
+U+1D5D0           𝗐            \sansw                                       MATHEMATICAL SANS-SERIF SMALL W
+U+1D5D1           𝗑            \sansx                                       MATHEMATICAL SANS-SERIF SMALL X
+U+1D5D2           𝗒            \sansy                                       MATHEMATICAL SANS-SERIF SMALL Y
+U+1D5D3           𝗓            \sansz                                       MATHEMATICAL SANS-SERIF SMALL Z
+U+1D5D4           𝗔            \bsansA                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL A
+U+1D5D5           𝗕            \bsansB                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL B
+U+1D5D6           𝗖            \bsansC                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL C
+U+1D5D7           𝗗            \bsansD                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL D
+U+1D5D8           𝗘            \bsansE                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL E
+U+1D5D9           𝗙            \bsansF                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL F
+U+1D5DA           𝗚            \bsansG                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL G
+U+1D5DB           𝗛            \bsansH                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL H
+U+1D5DC           𝗜            \bsansI                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL I
+U+1D5DD           𝗝            \bsansJ                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL J
+U+1D5DE           𝗞            \bsansK                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL K
+U+1D5DF           𝗟            \bsansL                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL L
+U+1D5E0           𝗠            \bsansM                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL M
+U+1D5E1           𝗡            \bsansN                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL N
+U+1D5E2           𝗢            \bsansO                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL O
+U+1D5E3           𝗣            \bsansP                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL P
+U+1D5E4           𝗤            \bsansQ                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL Q
+U+1D5E5           𝗥            \bsansR                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL R
+U+1D5E6           𝗦            \bsansS                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL S
+U+1D5E7           𝗧            \bsansT                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL T
+U+1D5E8           𝗨            \bsansU                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL U
+U+1D5E9           𝗩            \bsansV                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL V
+U+1D5EA           𝗪            \bsansW                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL W
+U+1D5EB           𝗫            \bsansX                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL X
+U+1D5EC           𝗬            \bsansY                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL Y
+U+1D5ED           𝗭            \bsansZ                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL Z
+U+1D5EE           𝗮            \bsansa                                      MATHEMATICAL SANS-SERIF BOLD SMALL A
+U+1D5EF           𝗯            \bsansb                                      MATHEMATICAL SANS-SERIF BOLD SMALL B
+U+1D5F0           𝗰            \bsansc                                      MATHEMATICAL SANS-SERIF BOLD SMALL C
+U+1D5F1           𝗱            \bsansd                                      MATHEMATICAL SANS-SERIF BOLD SMALL D
+U+1D5F2           𝗲            \bsanse                                      MATHEMATICAL SANS-SERIF BOLD SMALL E
+U+1D5F3           𝗳            \bsansf                                      MATHEMATICAL SANS-SERIF BOLD SMALL F
+U+1D5F4           𝗴            \bsansg                                      MATHEMATICAL SANS-SERIF BOLD SMALL G
+U+1D5F5           𝗵            \bsansh                                      MATHEMATICAL SANS-SERIF BOLD SMALL H
+U+1D5F6           𝗶            \bsansi                                      MATHEMATICAL SANS-SERIF BOLD SMALL I
+U+1D5F7           𝗷            \bsansj                                      MATHEMATICAL SANS-SERIF BOLD SMALL J
+U+1D5F8           𝗸            \bsansk                                      MATHEMATICAL SANS-SERIF BOLD SMALL K
+U+1D5F9           𝗹            \bsansl                                      MATHEMATICAL SANS-SERIF BOLD SMALL L
+U+1D5FA           𝗺            \bsansm                                      MATHEMATICAL SANS-SERIF BOLD SMALL M
+U+1D5FB           𝗻            \bsansn                                      MATHEMATICAL SANS-SERIF BOLD SMALL N
+U+1D5FC           𝗼            \bsanso                                      MATHEMATICAL SANS-SERIF BOLD SMALL O
+U+1D5FD           𝗽            \bsansp                                      MATHEMATICAL SANS-SERIF BOLD SMALL P
+U+1D5FE           𝗾            \bsansq                                      MATHEMATICAL SANS-SERIF BOLD SMALL Q
+U+1D5FF           𝗿            \bsansr                                      MATHEMATICAL SANS-SERIF BOLD SMALL R
+U+1D600           𝘀            \bsanss                                      MATHEMATICAL SANS-SERIF BOLD SMALL S
+U+1D601           𝘁            \bsanst                                      MATHEMATICAL SANS-SERIF BOLD SMALL T
+U+1D602           𝘂            \bsansu                                      MATHEMATICAL SANS-SERIF BOLD SMALL U
+U+1D603           𝘃            \bsansv                                      MATHEMATICAL SANS-SERIF BOLD SMALL V
+U+1D604           𝘄            \bsansw                                      MATHEMATICAL SANS-SERIF BOLD SMALL W
+U+1D605           𝘅            \bsansx                                      MATHEMATICAL SANS-SERIF BOLD SMALL X
+U+1D606           𝘆            \bsansy                                      MATHEMATICAL SANS-SERIF BOLD SMALL Y
+U+1D607           𝘇            \bsansz                                      MATHEMATICAL SANS-SERIF BOLD SMALL Z
+U+1D608           𝘈            \isansA                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL A
+U+1D609           𝘉            \isansB                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL B
+U+1D60A           𝘊            \isansC                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL C
+U+1D60B           𝘋            \isansD                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL D
+U+1D60C           𝘌            \isansE                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL E
+U+1D60D           𝘍            \isansF                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL F
+U+1D60E           𝘎            \isansG                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL G
+U+1D60F           𝘏            \isansH                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL H
+U+1D610           𝘐            \isansI                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL I
+U+1D611           𝘑            \isansJ                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL J
+U+1D612           𝘒            \isansK                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL K
+U+1D613           𝘓            \isansL                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL L
+U+1D614           𝘔            \isansM                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL M
+U+1D615           𝘕            \isansN                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL N
+U+1D616           𝘖            \isansO                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL O
+U+1D617           𝘗            \isansP                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL P
+U+1D618           𝘘            \isansQ                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL Q
+U+1D619           𝘙            \isansR                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL R
+U+1D61A           𝘚            \isansS                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL S
+U+1D61B           𝘛            \isansT                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL T
+U+1D61C           𝘜            \isansU                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL U
+U+1D61D           𝘝            \isansV                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL V
+U+1D61E           𝘞            \isansW                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL W
+U+1D61F           𝘟            \isansX                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL X
+U+1D620           𝘠            \isansY                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL Y
+U+1D621           𝘡            \isansZ                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL Z
+U+1D622           𝘢            \isansa                                      MATHEMATICAL SANS-SERIF ITALIC SMALL A
+U+1D623           𝘣            \isansb                                      MATHEMATICAL SANS-SERIF ITALIC SMALL B
+U+1D624           𝘤            \isansc                                      MATHEMATICAL SANS-SERIF ITALIC SMALL C
+U+1D625           𝘥            \isansd                                      MATHEMATICAL SANS-SERIF ITALIC SMALL D
+U+1D626           𝘦            \isanse                                      MATHEMATICAL SANS-SERIF ITALIC SMALL E
+U+1D627           𝘧            \isansf                                      MATHEMATICAL SANS-SERIF ITALIC SMALL F
+U+1D628           𝘨            \isansg                                      MATHEMATICAL SANS-SERIF ITALIC SMALL G
+U+1D629           𝘩            \isansh                                      MATHEMATICAL SANS-SERIF ITALIC SMALL H
+U+1D62A           𝘪            \isansi                                      MATHEMATICAL SANS-SERIF ITALIC SMALL I
+U+1D62B           𝘫            \isansj                                      MATHEMATICAL SANS-SERIF ITALIC SMALL J
+U+1D62C           𝘬            \isansk                                      MATHEMATICAL SANS-SERIF ITALIC SMALL K
+U+1D62D           𝘭            \isansl                                      MATHEMATICAL SANS-SERIF ITALIC SMALL L
+U+1D62E           𝘮            \isansm                                      MATHEMATICAL SANS-SERIF ITALIC SMALL M
+U+1D62F           𝘯            \isansn                                      MATHEMATICAL SANS-SERIF ITALIC SMALL N
+U+1D630           𝘰            \isanso                                      MATHEMATICAL SANS-SERIF ITALIC SMALL O
+U+1D631           𝘱            \isansp                                      MATHEMATICAL SANS-SERIF ITALIC SMALL P
+U+1D632           𝘲            \isansq                                      MATHEMATICAL SANS-SERIF ITALIC SMALL Q
+U+1D633           𝘳            \isansr                                      MATHEMATICAL SANS-SERIF ITALIC SMALL R
+U+1D634           𝘴            \isanss                                      MATHEMATICAL SANS-SERIF ITALIC SMALL S
+U+1D635           𝘵            \isanst                                      MATHEMATICAL SANS-SERIF ITALIC SMALL T
+U+1D636           𝘶            \isansu                                      MATHEMATICAL SANS-SERIF ITALIC SMALL U
+U+1D637           𝘷            \isansv                                      MATHEMATICAL SANS-SERIF ITALIC SMALL V
+U+1D638           𝘸            \isansw                                      MATHEMATICAL SANS-SERIF ITALIC SMALL W
+U+1D639           𝘹            \isansx                                      MATHEMATICAL SANS-SERIF ITALIC SMALL X
+U+1D63A           𝘺            \isansy                                      MATHEMATICAL SANS-SERIF ITALIC SMALL Y
+U+1D63B           𝘻            \isansz                                      MATHEMATICAL SANS-SERIF ITALIC SMALL Z
+U+1D63C           𝘼            \bisansA                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL A
+U+1D63D           𝘽            \bisansB                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL B
+U+1D63E           𝘾            \bisansC                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL C
+U+1D63F           𝘿            \bisansD                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL D
+U+1D640           𝙀            \bisansE                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL E
+U+1D641           𝙁            \bisansF                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL F
+U+1D642           𝙂            \bisansG                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL G
+U+1D643           𝙃            \bisansH                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL H
+U+1D644           𝙄            \bisansI                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL I
+U+1D645           𝙅            \bisansJ                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL J
+U+1D646           𝙆            \bisansK                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL K
+U+1D647           𝙇            \bisansL                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL L
+U+1D648           𝙈            \bisansM                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL M
+U+1D649           𝙉            \bisansN                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL N
+U+1D64A           𝙊            \bisansO                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL O
+U+1D64B           𝙋            \bisansP                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL P
+U+1D64C           𝙌            \bisansQ                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Q
+U+1D64D           𝙍            \bisansR                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL R
+U+1D64E           𝙎            \bisansS                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL S
+U+1D64F           𝙏            \bisansT                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL T
+U+1D650           𝙐            \bisansU                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL U
+U+1D651           𝙑            \bisansV                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL V
+U+1D652           𝙒            \bisansW                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL W
+U+1D653           𝙓            \bisansX                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL X
+U+1D654           𝙔            \bisansY                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Y
+U+1D655           𝙕            \bisansZ                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Z
+U+1D656           𝙖            \bisansa                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL A
+U+1D657           𝙗            \bisansb                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL B
+U+1D658           𝙘            \bisansc                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL C
+U+1D659           𝙙            \bisansd                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL D
+U+1D65A           𝙚            \bisanse                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL E
+U+1D65B           𝙛            \bisansf                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL F
+U+1D65C           𝙜            \bisansg                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL G
+U+1D65D           𝙝            \bisansh                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL H
+U+1D65E           𝙞            \bisansi                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL I
+U+1D65F           𝙟            \bisansj                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL J
+U+1D660           𝙠            \bisansk                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL K
+U+1D661           𝙡            \bisansl                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL L
+U+1D662           𝙢            \bisansm                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL M
+U+1D663           𝙣            \bisansn                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL N
+U+1D664           𝙤            \bisanso                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL O
+U+1D665           𝙥            \bisansp                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL P
+U+1D666           𝙦            \bisansq                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Q
+U+1D667           𝙧            \bisansr                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL R
+U+1D668           𝙨            \bisanss                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL S
+U+1D669           𝙩            \bisanst                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL T
+U+1D66A           𝙪            \bisansu                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL U
+U+1D66B           𝙫            \bisansv                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL V
+U+1D66C           𝙬            \bisansw                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL W
+U+1D66D           𝙭            \bisansx                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL X
+U+1D66E           𝙮            \bisansy                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Y
+U+1D66F           𝙯            \bisansz                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Z
+U+1D670           𝙰            \ttA                                         MATHEMATICAL MONOSPACE CAPITAL A
+U+1D671           𝙱            \ttB                                         MATHEMATICAL MONOSPACE CAPITAL B
+U+1D672           𝙲            \ttC                                         MATHEMATICAL MONOSPACE CAPITAL C
+U+1D673           𝙳            \ttD                                         MATHEMATICAL MONOSPACE CAPITAL D
+U+1D674           𝙴            \ttE                                         MATHEMATICAL MONOSPACE CAPITAL E
+U+1D675           𝙵            \ttF                                         MATHEMATICAL MONOSPACE CAPITAL F
+U+1D676           𝙶            \ttG                                         MATHEMATICAL MONOSPACE CAPITAL G
+U+1D677           𝙷            \ttH                                         MATHEMATICAL MONOSPACE CAPITAL H
+U+1D678           𝙸            \ttI                                         MATHEMATICAL MONOSPACE CAPITAL I
+U+1D679           𝙹            \ttJ                                         MATHEMATICAL MONOSPACE CAPITAL J
+U+1D67A           𝙺            \ttK                                         MATHEMATICAL MONOSPACE CAPITAL K
+U+1D67B           𝙻            \ttL                                         MATHEMATICAL MONOSPACE CAPITAL L
+U+1D67C           𝙼            \ttM                                         MATHEMATICAL MONOSPACE CAPITAL M
+U+1D67D           𝙽            \ttN                                         MATHEMATICAL MONOSPACE CAPITAL N
+U+1D67E           𝙾            \ttO                                         MATHEMATICAL MONOSPACE CAPITAL O
+U+1D67F           𝙿            \ttP                                         MATHEMATICAL MONOSPACE CAPITAL P
+U+1D680           𝚀            \ttQ                                         MATHEMATICAL MONOSPACE CAPITAL Q
+U+1D681           𝚁            \ttR                                         MATHEMATICAL MONOSPACE CAPITAL R
+U+1D682           𝚂            \ttS                                         MATHEMATICAL MONOSPACE CAPITAL S
+U+1D683           𝚃            \ttT                                         MATHEMATICAL MONOSPACE CAPITAL T
+U+1D684           𝚄            \ttU                                         MATHEMATICAL MONOSPACE CAPITAL U
+U+1D685           𝚅            \ttV                                         MATHEMATICAL MONOSPACE CAPITAL V
+U+1D686           𝚆            \ttW                                         MATHEMATICAL MONOSPACE CAPITAL W
+U+1D687           𝚇            \ttX                                         MATHEMATICAL MONOSPACE CAPITAL X
+U+1D688           𝚈            \ttY                                         MATHEMATICAL MONOSPACE CAPITAL Y
+U+1D689           𝚉            \ttZ                                         MATHEMATICAL MONOSPACE CAPITAL Z
+U+1D68A           𝚊            \tta                                         MATHEMATICAL MONOSPACE SMALL A
+U+1D68B           𝚋            \ttb                                         MATHEMATICAL MONOSPACE SMALL B
+U+1D68C           𝚌            \ttc                                         MATHEMATICAL MONOSPACE SMALL C
+U+1D68D           𝚍            \ttd                                         MATHEMATICAL MONOSPACE SMALL D
+U+1D68E           𝚎            \tte                                         MATHEMATICAL MONOSPACE SMALL E
+U+1D68F           𝚏            \ttf                                         MATHEMATICAL MONOSPACE SMALL F
+U+1D690           𝚐            \ttg                                         MATHEMATICAL MONOSPACE SMALL G
+U+1D691           𝚑            \tth                                         MATHEMATICAL MONOSPACE SMALL H
+U+1D692           𝚒            \tti                                         MATHEMATICAL MONOSPACE SMALL I
+U+1D693           𝚓            \ttj                                         MATHEMATICAL MONOSPACE SMALL J
+U+1D694           𝚔            \ttk                                         MATHEMATICAL MONOSPACE SMALL K
+U+1D695           𝚕            \ttl                                         MATHEMATICAL MONOSPACE SMALL L
+U+1D696           𝚖            \ttm                                         MATHEMATICAL MONOSPACE SMALL M
+U+1D697           𝚗            \ttn                                         MATHEMATICAL MONOSPACE SMALL N
+U+1D698           𝚘            \tto                                         MATHEMATICAL MONOSPACE SMALL O
+U+1D699           𝚙            \ttp                                         MATHEMATICAL MONOSPACE SMALL P
+U+1D69A           𝚚            \ttq                                         MATHEMATICAL MONOSPACE SMALL Q
+U+1D69B           𝚛            \ttr                                         MATHEMATICAL MONOSPACE SMALL R
+U+1D69C           𝚜            \tts                                         MATHEMATICAL MONOSPACE SMALL S
+U+1D69D           𝚝            \ttt                                         MATHEMATICAL MONOSPACE SMALL T
+U+1D69E           𝚞            \ttu                                         MATHEMATICAL MONOSPACE SMALL U
+U+1D69F           𝚟            \ttv                                         MATHEMATICAL MONOSPACE SMALL V
+U+1D6A0           𝚠            \ttw                                         MATHEMATICAL MONOSPACE SMALL W
+U+1D6A1           𝚡            \ttx                                         MATHEMATICAL MONOSPACE SMALL X
+U+1D6A2           𝚢            \tty                                         MATHEMATICAL MONOSPACE SMALL Y
+U+1D6A3           𝚣            \ttz                                         MATHEMATICAL MONOSPACE SMALL Z
+U+1D6A4           𝚤            \itimath                                     MATHEMATICAL ITALIC SMALL DOTLESS I
+U+1D6A5           𝚥            \itjmath                                     MATHEMATICAL ITALIC SMALL DOTLESS J
+U+1D6A8           𝚨            \bfAlpha                                     MATHEMATICAL BOLD CAPITAL ALPHA
+U+1D6A9           𝚩            \bfBeta                                      MATHEMATICAL BOLD CAPITAL BETA
+U+1D6AA           𝚪            \bfGamma                                     MATHEMATICAL BOLD CAPITAL GAMMA
+U+1D6AB           𝚫            \bfDelta                                     MATHEMATICAL BOLD CAPITAL DELTA
+U+1D6AC           𝚬            \bfEpsilon                                   MATHEMATICAL BOLD CAPITAL EPSILON
+U+1D6AD           𝚭            \bfZeta                                      MATHEMATICAL BOLD CAPITAL ZETA
+U+1D6AE           𝚮            \bfEta                                       MATHEMATICAL BOLD CAPITAL ETA
+U+1D6AF           𝚯            \bfTheta                                     MATHEMATICAL BOLD CAPITAL THETA
+U+1D6B0           𝚰            \bfIota                                      MATHEMATICAL BOLD CAPITAL IOTA
+U+1D6B1           𝚱            \bfKappa                                     MATHEMATICAL BOLD CAPITAL KAPPA
+U+1D6B2           𝚲            \bfLambda                                    MATHEMATICAL BOLD CAPITAL LAMDA
+U+1D6B3           𝚳            \bfMu                                        MATHEMATICAL BOLD CAPITAL MU
+U+1D6B4           𝚴            \bfNu                                        MATHEMATICAL BOLD CAPITAL NU
+U+1D6B5           𝚵            \bfXi                                        MATHEMATICAL BOLD CAPITAL XI
+U+1D6B6           𝚶            \bfOmicron                                   MATHEMATICAL BOLD CAPITAL OMICRON
+U+1D6B7           𝚷            \bfPi                                        MATHEMATICAL BOLD CAPITAL PI
+U+1D6B8           𝚸            \bfRho                                       MATHEMATICAL BOLD CAPITAL RHO
+U+1D6B9           𝚹            \bfvarTheta                                  MATHEMATICAL BOLD CAPITAL THETA SYMBOL
+U+1D6BA           𝚺            \bfSigma                                     MATHEMATICAL BOLD CAPITAL SIGMA
+U+1D6BB           𝚻            \bfTau                                       MATHEMATICAL BOLD CAPITAL TAU
+U+1D6BC           𝚼            \bfUpsilon                                   MATHEMATICAL BOLD CAPITAL UPSILON
+U+1D6BD           𝚽            \bfPhi                                       MATHEMATICAL BOLD CAPITAL PHI
+U+1D6BE           𝚾            \bfChi                                       MATHEMATICAL BOLD CAPITAL CHI
+U+1D6BF           𝚿            \bfPsi                                       MATHEMATICAL BOLD CAPITAL PSI
+U+1D6C0           𝛀            \bfOmega                                     MATHEMATICAL BOLD CAPITAL OMEGA
+U+1D6C1           𝛁            \bfnabla                                     MATHEMATICAL BOLD NABLA
+U+1D6C2           𝛂            \bfalpha                                     MATHEMATICAL BOLD SMALL ALPHA
+U+1D6C3           𝛃            \bfbeta                                      MATHEMATICAL BOLD SMALL BETA
+U+1D6C4           𝛄            \bfgamma                                     MATHEMATICAL BOLD SMALL GAMMA
+U+1D6C5           𝛅            \bfdelta                                     MATHEMATICAL BOLD SMALL DELTA
+U+1D6C6           𝛆            \bfepsilon                                   MATHEMATICAL BOLD SMALL EPSILON
+U+1D6C7           𝛇            \bfzeta                                      MATHEMATICAL BOLD SMALL ZETA
+U+1D6C8           𝛈            \bfeta                                       MATHEMATICAL BOLD SMALL ETA
+U+1D6C9           𝛉            \bftheta                                     MATHEMATICAL BOLD SMALL THETA
+U+1D6CA           𝛊            \bfiota                                      MATHEMATICAL BOLD SMALL IOTA
+U+1D6CB           𝛋            \bfkappa                                     MATHEMATICAL BOLD SMALL KAPPA
+U+1D6CC           𝛌            \bflambda                                    MATHEMATICAL BOLD SMALL LAMDA
+U+1D6CD           𝛍            \bfmu                                        MATHEMATICAL BOLD SMALL MU
+U+1D6CE           𝛎            \bfnu                                        MATHEMATICAL BOLD SMALL NU
+U+1D6CF           𝛏            \bfxi                                        MATHEMATICAL BOLD SMALL XI
+U+1D6D0           𝛐            \bfomicron                                   MATHEMATICAL BOLD SMALL OMICRON
+U+1D6D1           𝛑            \bfpi                                        MATHEMATICAL BOLD SMALL PI
+U+1D6D2           𝛒            \bfrho                                       MATHEMATICAL BOLD SMALL RHO
+U+1D6D3           𝛓            \bfvarsigma                                  MATHEMATICAL BOLD SMALL FINAL SIGMA
+U+1D6D4           𝛔            \bfsigma                                     MATHEMATICAL BOLD SMALL SIGMA
+U+1D6D5           𝛕            \bftau                                       MATHEMATICAL BOLD SMALL TAU
+U+1D6D6           𝛖            \bfupsilon                                   MATHEMATICAL BOLD SMALL UPSILON
+U+1D6D7           𝛗            \bfvarphi                                    MATHEMATICAL BOLD SMALL PHI
+U+1D6D8           𝛘            \bfchi                                       MATHEMATICAL BOLD SMALL CHI
+U+1D6D9           𝛙            \bfpsi                                       MATHEMATICAL BOLD SMALL PSI
+U+1D6DA           𝛚            \bfomega                                     MATHEMATICAL BOLD SMALL OMEGA
+U+1D6DB           𝛛            \bfpartial                                   MATHEMATICAL BOLD PARTIAL DIFFERENTIAL
+U+1D6DC           𝛜            \bfvarepsilon                                MATHEMATICAL BOLD EPSILON SYMBOL
+U+1D6DD           𝛝            \bfvartheta                                  MATHEMATICAL BOLD THETA SYMBOL
+U+1D6DE           𝛞            \bfvarkappa                                  MATHEMATICAL BOLD KAPPA SYMBOL
+U+1D6DF           𝛟            \bfphi                                       MATHEMATICAL BOLD PHI SYMBOL
+U+1D6E0           𝛠            \bfvarrho                                    MATHEMATICAL BOLD RHO SYMBOL
+U+1D6E1           𝛡            \bfvarpi                                     MATHEMATICAL BOLD PI SYMBOL
+U+1D6E2           𝛢            \itAlpha                                     MATHEMATICAL ITALIC CAPITAL ALPHA
+U+1D6E3           𝛣            \itBeta                                      MATHEMATICAL ITALIC CAPITAL BETA
+U+1D6E4           𝛤            \itGamma                                     MATHEMATICAL ITALIC CAPITAL GAMMA
+U+1D6E5           𝛥            \itDelta                                     MATHEMATICAL ITALIC CAPITAL DELTA
+U+1D6E6           𝛦            \itEpsilon                                   MATHEMATICAL ITALIC CAPITAL EPSILON
+U+1D6E7           𝛧            \itZeta                                      MATHEMATICAL ITALIC CAPITAL ZETA
+U+1D6E8           𝛨            \itEta                                       MATHEMATICAL ITALIC CAPITAL ETA
+U+1D6E9           𝛩            \itTheta                                     MATHEMATICAL ITALIC CAPITAL THETA
+U+1D6EA           𝛪            \itIota                                      MATHEMATICAL ITALIC CAPITAL IOTA
+U+1D6EB           𝛫            \itKappa                                     MATHEMATICAL ITALIC CAPITAL KAPPA
+U+1D6EC           𝛬            \itLambda                                    MATHEMATICAL ITALIC CAPITAL LAMDA
+U+1D6ED           𝛭            \itMu                                        MATHEMATICAL ITALIC CAPITAL MU
+U+1D6EE           𝛮            \itNu                                        MATHEMATICAL ITALIC CAPITAL NU
+U+1D6EF           𝛯            \itXi                                        MATHEMATICAL ITALIC CAPITAL XI
+U+1D6F0           𝛰            \itOmicron                                   MATHEMATICAL ITALIC CAPITAL OMICRON
+U+1D6F1           𝛱            \itPi                                        MATHEMATICAL ITALIC CAPITAL PI
+U+1D6F2           𝛲            \itRho                                       MATHEMATICAL ITALIC CAPITAL RHO
+U+1D6F3           𝛳            \itvarTheta                                  MATHEMATICAL ITALIC CAPITAL THETA SYMBOL
+U+1D6F4           𝛴            \itSigma                                     MATHEMATICAL ITALIC CAPITAL SIGMA
+U+1D6F5           𝛵            \itTau                                       MATHEMATICAL ITALIC CAPITAL TAU
+U+1D6F6           𝛶            \itUpsilon                                   MATHEMATICAL ITALIC CAPITAL UPSILON
+U+1D6F7           𝛷            \itPhi                                       MATHEMATICAL ITALIC CAPITAL PHI
+U+1D6F8           𝛸            \itChi                                       MATHEMATICAL ITALIC CAPITAL CHI
+U+1D6F9           𝛹            \itPsi                                       MATHEMATICAL ITALIC CAPITAL PSI
+U+1D6FA           𝛺            \itOmega                                     MATHEMATICAL ITALIC CAPITAL OMEGA
+U+1D6FB           𝛻            \itnabla                                     MATHEMATICAL ITALIC NABLA
+U+1D6FC           𝛼            \italpha                                     MATHEMATICAL ITALIC SMALL ALPHA
+U+1D6FD           𝛽            \itbeta                                      MATHEMATICAL ITALIC SMALL BETA
+U+1D6FE           𝛾            \itgamma                                     MATHEMATICAL ITALIC SMALL GAMMA
+U+1D6FF           𝛿            \itdelta                                     MATHEMATICAL ITALIC SMALL DELTA
+U+1D700           𝜀            \itepsilon                                   MATHEMATICAL ITALIC SMALL EPSILON
+U+1D701           𝜁            \itzeta                                      MATHEMATICAL ITALIC SMALL ZETA
+U+1D702           𝜂            \iteta                                       MATHEMATICAL ITALIC SMALL ETA
+U+1D703           𝜃            \ittheta                                     MATHEMATICAL ITALIC SMALL THETA
+U+1D704           𝜄            \itiota                                      MATHEMATICAL ITALIC SMALL IOTA
+U+1D705           𝜅            \itkappa                                     MATHEMATICAL ITALIC SMALL KAPPA
+U+1D706           𝜆            \itlambda                                    MATHEMATICAL ITALIC SMALL LAMDA
+U+1D707           𝜇            \itmu                                        MATHEMATICAL ITALIC SMALL MU
+U+1D708           𝜈            \itnu                                        MATHEMATICAL ITALIC SMALL NU
+U+1D709           𝜉            \itxi                                        MATHEMATICAL ITALIC SMALL XI
+U+1D70A           𝜊            \itomicron                                   MATHEMATICAL ITALIC SMALL OMICRON
+U+1D70B           𝜋            \itpi                                        MATHEMATICAL ITALIC SMALL PI
+U+1D70C           𝜌            \itrho                                       MATHEMATICAL ITALIC SMALL RHO
+U+1D70D           𝜍            \itvarsigma                                  MATHEMATICAL ITALIC SMALL FINAL SIGMA
+U+1D70E           𝜎            \itsigma                                     MATHEMATICAL ITALIC SMALL SIGMA
+U+1D70F           𝜏            \ittau                                       MATHEMATICAL ITALIC SMALL TAU
+U+1D710           𝜐            \itupsilon                                   MATHEMATICAL ITALIC SMALL UPSILON
+U+1D711           𝜑            \itphi                                       MATHEMATICAL ITALIC SMALL PHI
+U+1D712           𝜒            \itchi                                       MATHEMATICAL ITALIC SMALL CHI
+U+1D713           𝜓            \itpsi                                       MATHEMATICAL ITALIC SMALL PSI
+U+1D714           𝜔            \itomega                                     MATHEMATICAL ITALIC SMALL OMEGA
+U+1D715           𝜕            \itpartial                                   MATHEMATICAL ITALIC PARTIAL DIFFERENTIAL
+U+1D716           𝜖            \itvarepsilon                                MATHEMATICAL ITALIC EPSILON SYMBOL
+U+1D717           𝜗            \itvartheta                                  MATHEMATICAL ITALIC THETA SYMBOL
+U+1D718           𝜘            \itvarkappa                                  MATHEMATICAL ITALIC KAPPA SYMBOL
+U+1D719           𝜙            \itvarphi                                    MATHEMATICAL ITALIC PHI SYMBOL
+U+1D71A           𝜚            \itvarrho                                    MATHEMATICAL ITALIC RHO SYMBOL
+U+1D71B           𝜛            \itvarpi                                     MATHEMATICAL ITALIC PI SYMBOL
+U+1D71C           𝜜            \biAlpha                                     MATHEMATICAL BOLD ITALIC CAPITAL ALPHA
+U+1D71D           𝜝            \biBeta                                      MATHEMATICAL BOLD ITALIC CAPITAL BETA
+U+1D71E           𝜞            \biGamma                                     MATHEMATICAL BOLD ITALIC CAPITAL GAMMA
+U+1D71F           𝜟            \biDelta                                     MATHEMATICAL BOLD ITALIC CAPITAL DELTA
+U+1D720           𝜠            \biEpsilon                                   MATHEMATICAL BOLD ITALIC CAPITAL EPSILON
+U+1D721           𝜡            \biZeta                                      MATHEMATICAL BOLD ITALIC CAPITAL ZETA
+U+1D722           𝜢            \biEta                                       MATHEMATICAL BOLD ITALIC CAPITAL ETA
+U+1D723           𝜣            \biTheta                                     MATHEMATICAL BOLD ITALIC CAPITAL THETA
+U+1D724           𝜤            \biIota                                      MATHEMATICAL BOLD ITALIC CAPITAL IOTA
+U+1D725           𝜥            \biKappa                                     MATHEMATICAL BOLD ITALIC CAPITAL KAPPA
+U+1D726           𝜦            \biLambda                                    MATHEMATICAL BOLD ITALIC CAPITAL LAMDA
+U+1D727           𝜧            \biMu                                        MATHEMATICAL BOLD ITALIC CAPITAL MU
+U+1D728           𝜨            \biNu                                        MATHEMATICAL BOLD ITALIC CAPITAL NU
+U+1D729           𝜩            \biXi                                        MATHEMATICAL BOLD ITALIC CAPITAL XI
+U+1D72A           𝜪            \biOmicron                                   MATHEMATICAL BOLD ITALIC CAPITAL OMICRON
+U+1D72B           𝜫            \biPi                                        MATHEMATICAL BOLD ITALIC CAPITAL PI
+U+1D72C           𝜬            \biRho                                       MATHEMATICAL BOLD ITALIC CAPITAL RHO
+U+1D72D           𝜭            \bivarTheta                                  MATHEMATICAL BOLD ITALIC CAPITAL THETA SYMBOL
+U+1D72E           𝜮            \biSigma                                     MATHEMATICAL BOLD ITALIC CAPITAL SIGMA
+U+1D72F           𝜯            \biTau                                       MATHEMATICAL BOLD ITALIC CAPITAL TAU
+U+1D730           𝜰            \biUpsilon                                   MATHEMATICAL BOLD ITALIC CAPITAL UPSILON
+U+1D731           𝜱            \biPhi                                       MATHEMATICAL BOLD ITALIC CAPITAL PHI
+U+1D732           𝜲            \biChi                                       MATHEMATICAL BOLD ITALIC CAPITAL CHI
+U+1D733           𝜳            \biPsi                                       MATHEMATICAL BOLD ITALIC CAPITAL PSI
+U+1D734           𝜴            \biOmega                                     MATHEMATICAL BOLD ITALIC CAPITAL OMEGA
+U+1D735           𝜵            \binabla                                     MATHEMATICAL BOLD ITALIC NABLA
+U+1D736           𝜶            \bialpha                                     MATHEMATICAL BOLD ITALIC SMALL ALPHA
+U+1D737           𝜷            \bibeta                                      MATHEMATICAL BOLD ITALIC SMALL BETA
+U+1D738           𝜸            \bigamma                                     MATHEMATICAL BOLD ITALIC SMALL GAMMA
+U+1D739           𝜹            \bidelta                                     MATHEMATICAL BOLD ITALIC SMALL DELTA
+U+1D73A           𝜺            \biepsilon                                   MATHEMATICAL BOLD ITALIC SMALL EPSILON
+U+1D73B           𝜻            \bizeta                                      MATHEMATICAL BOLD ITALIC SMALL ZETA
+U+1D73C           𝜼            \bieta                                       MATHEMATICAL BOLD ITALIC SMALL ETA
+U+1D73D           𝜽            \bitheta                                     MATHEMATICAL BOLD ITALIC SMALL THETA
+U+1D73E           𝜾            \biiota                                      MATHEMATICAL BOLD ITALIC SMALL IOTA
+U+1D73F           𝜿            \bikappa                                     MATHEMATICAL BOLD ITALIC SMALL KAPPA
+U+1D740           𝝀            \bilambda                                    MATHEMATICAL BOLD ITALIC SMALL LAMDA
+U+1D741           𝝁            \bimu                                        MATHEMATICAL BOLD ITALIC SMALL MU
+U+1D742           𝝂            \binu                                        MATHEMATICAL BOLD ITALIC SMALL NU
+U+1D743           𝝃            \bixi                                        MATHEMATICAL BOLD ITALIC SMALL XI
+U+1D744           𝝄            \biomicron                                   MATHEMATICAL BOLD ITALIC SMALL OMICRON
+U+1D745           𝝅            \bipi                                        MATHEMATICAL BOLD ITALIC SMALL PI
+U+1D746           𝝆            \birho                                       MATHEMATICAL BOLD ITALIC SMALL RHO
+U+1D747           𝝇            \bivarsigma                                  MATHEMATICAL BOLD ITALIC SMALL FINAL SIGMA
+U+1D748           𝝈            \bisigma                                     MATHEMATICAL BOLD ITALIC SMALL SIGMA
+U+1D749           𝝉            \bitau                                       MATHEMATICAL BOLD ITALIC SMALL TAU
+U+1D74A           𝝊            \biupsilon                                   MATHEMATICAL BOLD ITALIC SMALL UPSILON
+U+1D74B           𝝋            \biphi                                       MATHEMATICAL BOLD ITALIC SMALL PHI
+U+1D74C           𝝌            \bichi                                       MATHEMATICAL BOLD ITALIC SMALL CHI
+U+1D74D           𝝍            \bipsi                                       MATHEMATICAL BOLD ITALIC SMALL PSI
+U+1D74E           𝝎            \biomega                                     MATHEMATICAL BOLD ITALIC SMALL OMEGA
+U+1D74F           𝝏            \bipartial                                   MATHEMATICAL BOLD ITALIC PARTIAL DIFFERENTIAL
+U+1D750           𝝐            \bivarepsilon                                MATHEMATICAL BOLD ITALIC EPSILON SYMBOL
+U+1D751           𝝑            \bivartheta                                  MATHEMATICAL BOLD ITALIC THETA SYMBOL
+U+1D752           𝝒            \bivarkappa                                  MATHEMATICAL BOLD ITALIC KAPPA SYMBOL
+U+1D753           𝝓            \bivarphi                                    MATHEMATICAL BOLD ITALIC PHI SYMBOL
+U+1D754           𝝔            \bivarrho                                    MATHEMATICAL BOLD ITALIC RHO SYMBOL
+U+1D755           𝝕            \bivarpi                                     MATHEMATICAL BOLD ITALIC PI SYMBOL
+U+1D756           𝝖            \bsansAlpha                                  MATHEMATICAL SANS-SERIF BOLD CAPITAL ALPHA
+U+1D757           𝝗            \bsansBeta                                   MATHEMATICAL SANS-SERIF BOLD CAPITAL BETA
+U+1D758           𝝘            \bsansGamma                                  MATHEMATICAL SANS-SERIF BOLD CAPITAL GAMMA
+U+1D759           𝝙            \bsansDelta                                  MATHEMATICAL SANS-SERIF BOLD CAPITAL DELTA
+U+1D75A           𝝚            \bsansEpsilon                                MATHEMATICAL SANS-SERIF BOLD CAPITAL EPSILON
+U+1D75B           𝝛            \bsansZeta                                   MATHEMATICAL SANS-SERIF BOLD CAPITAL ZETA
+U+1D75C           𝝜            \bsansEta                                    MATHEMATICAL SANS-SERIF BOLD CAPITAL ETA
+U+1D75D           𝝝            \bsansTheta                                  MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA
+U+1D75E           𝝞            \bsansIota                                   MATHEMATICAL SANS-SERIF BOLD CAPITAL IOTA
+U+1D75F           𝝟            \bsansKappa                                  MATHEMATICAL SANS-SERIF BOLD CAPITAL KAPPA
+U+1D760           𝝠            \bsansLambda                                 MATHEMATICAL SANS-SERIF BOLD CAPITAL LAMDA
+U+1D761           𝝡            \bsansMu                                     MATHEMATICAL SANS-SERIF BOLD CAPITAL MU
+U+1D762           𝝢            \bsansNu                                     MATHEMATICAL SANS-SERIF BOLD CAPITAL NU
+U+1D763           𝝣            \bsansXi                                     MATHEMATICAL SANS-SERIF BOLD CAPITAL XI
+U+1D764           𝝤            \bsansOmicron                                MATHEMATICAL SANS-SERIF BOLD CAPITAL OMICRON
+U+1D765           𝝥            \bsansPi                                     MATHEMATICAL SANS-SERIF BOLD CAPITAL PI
+U+1D766           𝝦            \bsansRho                                    MATHEMATICAL SANS-SERIF BOLD CAPITAL RHO
+U+1D767           𝝧            \bsansvarTheta                               MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA SYMBOL
+U+1D768           𝝨            \bsansSigma                                  MATHEMATICAL SANS-SERIF BOLD CAPITAL SIGMA
+U+1D769           𝝩            \bsansTau                                    MATHEMATICAL SANS-SERIF BOLD CAPITAL TAU
+U+1D76A           𝝪            \bsansUpsilon                                MATHEMATICAL SANS-SERIF BOLD CAPITAL UPSILON
+U+1D76B           𝝫            \bsansPhi                                    MATHEMATICAL SANS-SERIF BOLD CAPITAL PHI
+U+1D76C           𝝬            \bsansChi                                    MATHEMATICAL SANS-SERIF BOLD CAPITAL CHI
+U+1D76D           𝝭            \bsansPsi                                    MATHEMATICAL SANS-SERIF BOLD CAPITAL PSI
+U+1D76E           𝝮            \bsansOmega                                  MATHEMATICAL SANS-SERIF BOLD CAPITAL OMEGA
+U+1D76F           𝝯            \bsansnabla                                  MATHEMATICAL SANS-SERIF BOLD NABLA
+U+1D770           𝝰            \bsansalpha                                  MATHEMATICAL SANS-SERIF BOLD SMALL ALPHA
+U+1D771           𝝱            \bsansbeta                                   MATHEMATICAL SANS-SERIF BOLD SMALL BETA
+U+1D772           𝝲            \bsansgamma                                  MATHEMATICAL SANS-SERIF BOLD SMALL GAMMA
+U+1D773           𝝳            \bsansdelta                                  MATHEMATICAL SANS-SERIF BOLD SMALL DELTA
+U+1D774           𝝴            \bsansepsilon                                MATHEMATICAL SANS-SERIF BOLD SMALL EPSILON
+U+1D775           𝝵            \bsanszeta                                   MATHEMATICAL SANS-SERIF BOLD SMALL ZETA
+U+1D776           𝝶            \bsanseta                                    MATHEMATICAL SANS-SERIF BOLD SMALL ETA
+U+1D777           𝝷            \bsanstheta                                  MATHEMATICAL SANS-SERIF BOLD SMALL THETA
+U+1D778           𝝸            \bsansiota                                   MATHEMATICAL SANS-SERIF BOLD SMALL IOTA
+U+1D779           𝝹            \bsanskappa                                  MATHEMATICAL SANS-SERIF BOLD SMALL KAPPA
+U+1D77A           𝝺            \bsanslambda                                 MATHEMATICAL SANS-SERIF BOLD SMALL LAMDA
+U+1D77B           𝝻            \bsansmu                                     MATHEMATICAL SANS-SERIF BOLD SMALL MU
+U+1D77C           𝝼            \bsansnu                                     MATHEMATICAL SANS-SERIF BOLD SMALL NU
+U+1D77D           𝝽            \bsansxi                                     MATHEMATICAL SANS-SERIF BOLD SMALL XI
+U+1D77E           𝝾            \bsansomicron                                MATHEMATICAL SANS-SERIF BOLD SMALL OMICRON
+U+1D77F           𝝿            \bsanspi                                     MATHEMATICAL SANS-SERIF BOLD SMALL PI
+U+1D780           𝞀            \bsansrho                                    MATHEMATICAL SANS-SERIF BOLD SMALL RHO
+U+1D781           𝞁            \bsansvarsigma                               MATHEMATICAL SANS-SERIF BOLD SMALL FINAL SIGMA
+U+1D782           𝞂            \bsanssigma                                  MATHEMATICAL SANS-SERIF BOLD SMALL SIGMA
+U+1D783           𝞃            \bsanstau                                    MATHEMATICAL SANS-SERIF BOLD SMALL TAU
+U+1D784           𝞄            \bsansupsilon                                MATHEMATICAL SANS-SERIF BOLD SMALL UPSILON
+U+1D785           𝞅            \bsansphi                                    MATHEMATICAL SANS-SERIF BOLD SMALL PHI
+U+1D786           𝞆            \bsanschi                                    MATHEMATICAL SANS-SERIF BOLD SMALL CHI
+U+1D787           𝞇            \bsanspsi                                    MATHEMATICAL SANS-SERIF BOLD SMALL PSI
+U+1D788           𝞈            \bsansomega                                  MATHEMATICAL SANS-SERIF BOLD SMALL OMEGA
+U+1D789           𝞉            \bsanspartial                                MATHEMATICAL SANS-SERIF BOLD PARTIAL DIFFERENTIAL
+U+1D78A           𝞊            \bsansvarepsilon                             MATHEMATICAL SANS-SERIF BOLD EPSILON SYMBOL
+U+1D78B           𝞋            \bsansvartheta                               MATHEMATICAL SANS-SERIF BOLD THETA SYMBOL
+U+1D78C           𝞌            \bsansvarkappa                               MATHEMATICAL SANS-SERIF BOLD KAPPA SYMBOL
+U+1D78D           𝞍            \bsansvarphi                                 MATHEMATICAL SANS-SERIF BOLD PHI SYMBOL
+U+1D78E           𝞎            \bsansvarrho                                 MATHEMATICAL SANS-SERIF BOLD RHO SYMBOL
+U+1D78F           𝞏            \bsansvarpi                                  MATHEMATICAL SANS-SERIF BOLD PI SYMBOL
+U+1D790           𝞐            \bisansAlpha                                 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ALPHA
+U+1D791           𝞑            \bisansBeta                                  MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL BETA
+U+1D792           𝞒            \bisansGamma                                 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL GAMMA
+U+1D793           𝞓            \bisansDelta                                 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL DELTA
+U+1D794           𝞔            \bisansEpsilon                               MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL EPSILON
+U+1D795           𝞕            \bisansZeta                                  MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ZETA
+U+1D796           𝞖            \bisansEta                                   MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ETA
+U+1D797           𝞗            \bisansTheta                                 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA
+U+1D798           𝞘            \bisansIota                                  MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL IOTA
+U+1D799           𝞙            \bisansKappa                                 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL KAPPA
+U+1D79A           𝞚            \bisansLambda                                MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL LAMDA
+U+1D79B           𝞛            \bisansMu                                    MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL MU
+U+1D79C           𝞜            \bisansNu                                    MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL NU
+U+1D79D           𝞝            \bisansXi                                    MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL XI
+U+1D79E           𝞞            \bisansOmicron                               MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMICRON
+U+1D79F           𝞟            \bisansPi                                    MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PI
+U+1D7A0           𝞠            \bisansRho                                   MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL RHO
+U+1D7A1           𝞡            \bisansvarTheta                              MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA SYMBOL
+U+1D7A2           𝞢            \bisansSigma                                 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL SIGMA
+U+1D7A3           𝞣            \bisansTau                                   MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL TAU
+U+1D7A4           𝞤            \bisansUpsilon                               MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL UPSILON
+U+1D7A5           𝞥            \bisansPhi                                   MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PHI
+U+1D7A6           𝞦            \bisansChi                                   MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL CHI
+U+1D7A7           𝞧            \bisansPsi                                   MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PSI
+U+1D7A8           𝞨            \bisansOmega                                 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMEGA
+U+1D7A9           𝞩            \bisansnabla                                 MATHEMATICAL SANS-SERIF BOLD ITALIC NABLA
+U+1D7AA           𝞪            \bisansalpha                                 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ALPHA
+U+1D7AB           𝞫            \bisansbeta                                  MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL BETA
+U+1D7AC           𝞬            \bisansgamma                                 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL GAMMA
+U+1D7AD           𝞭            \bisansdelta                                 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL DELTA
+U+1D7AE           𝞮            \bisansepsilon                               MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL EPSILON
+U+1D7AF           𝞯            \bisanszeta                                  MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ZETA
+U+1D7B0           𝞰            \bisanseta                                   MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ETA
+U+1D7B1           𝞱            \bisanstheta                                 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL THETA
+U+1D7B2           𝞲            \bisansiota                                  MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL IOTA
+U+1D7B3           𝞳            \bisanskappa                                 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL KAPPA
+U+1D7B4           𝞴            \bisanslambda                                MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL LAMDA
+U+1D7B5           𝞵            \bisansmu                                    MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL MU
+U+1D7B6           𝞶            \bisansnu                                    MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL NU
+U+1D7B7           𝞷            \bisansxi                                    MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL XI
+U+1D7B8           𝞸            \bisansomicron                               MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMICRON
+U+1D7B9           𝞹            \bisanspi                                    MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PI
+U+1D7BA           𝞺            \bisansrho                                   MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL RHO
+U+1D7BB           𝞻            \bisansvarsigma                              MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL FINAL SIGMA
+U+1D7BC           𝞼            \bisanssigma                                 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL SIGMA
+U+1D7BD           𝞽            \bisanstau                                   MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL TAU
+U+1D7BE           𝞾            \bisansupsilon                               MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL UPSILON
+U+1D7BF           𝞿            \bisansphi                                   MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PHI
+U+1D7C0           𝟀            \bisanschi                                   MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL CHI
+U+1D7C1           𝟁            \bisanspsi                                   MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PSI
+U+1D7C2           𝟂            \bisansomega                                 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMEGA
+U+1D7C3           𝟃            \bisanspartial                               MATHEMATICAL SANS-SERIF BOLD ITALIC PARTIAL DIFFERENTIAL
+U+1D7C4           𝟄            \bisansvarepsilon                            MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL
+U+1D7C5           𝟅            \bisansvartheta                              MATHEMATICAL SANS-SERIF BOLD ITALIC THETA SYMBOL
+U+1D7C6           𝟆            \bisansvarkappa                              MATHEMATICAL SANS-SERIF BOLD ITALIC KAPPA SYMBOL
+U+1D7C7           𝟇            \bisansvarphi                                MATHEMATICAL SANS-SERIF BOLD ITALIC PHI SYMBOL
+U+1D7C8           𝟈            \bisansvarrho                                MATHEMATICAL SANS-SERIF BOLD ITALIC RHO SYMBOL
+U+1D7C9           𝟉            \bisansvarpi                                 MATHEMATICAL SANS-SERIF BOLD ITALIC PI SYMBOL
+U+1D7CA           𝟊            \bfDigamma                                   MATHEMATICAL BOLD CAPITAL DIGAMMA
+U+1D7CB           𝟋            \bfdigamma                                   MATHEMATICAL BOLD SMALL DIGAMMA
+U+1D7CE           𝟎            \bfzero                                      MATHEMATICAL BOLD DIGIT ZERO
+U+1D7CF           𝟏            \bfone                                       MATHEMATICAL BOLD DIGIT ONE
+U+1D7D0           𝟐            \bftwo                                       MATHEMATICAL BOLD DIGIT TWO
+U+1D7D1           𝟑            \bfthree                                     MATHEMATICAL BOLD DIGIT THREE
+U+1D7D2           𝟒            \bffour                                      MATHEMATICAL BOLD DIGIT FOUR
+U+1D7D3           𝟓            \bffive                                      MATHEMATICAL BOLD DIGIT FIVE
+U+1D7D4           𝟔            \bfsix                                       MATHEMATICAL BOLD DIGIT SIX
+U+1D7D5           𝟕            \bfseven                                     MATHEMATICAL BOLD DIGIT SEVEN
+U+1D7D6           𝟖            \bfeight                                     MATHEMATICAL BOLD DIGIT EIGHT
+U+1D7D7           𝟗            \bfnine                                      MATHEMATICAL BOLD DIGIT NINE
+U+1D7D8           𝟘            \bbzero                                      MATHEMATICAL DOUBLE-STRUCK DIGIT ZERO
+U+1D7D9           𝟙            \bbone                                       MATHEMATICAL DOUBLE-STRUCK DIGIT ONE
+U+1D7DA           𝟚            \bbtwo                                       MATHEMATICAL DOUBLE-STRUCK DIGIT TWO
+U+1D7DB           𝟛            \bbthree                                     MATHEMATICAL DOUBLE-STRUCK DIGIT THREE
+U+1D7DC           𝟜            \bbfour                                      MATHEMATICAL DOUBLE-STRUCK DIGIT FOUR
+U+1D7DD           𝟝            \bbfive                                      MATHEMATICAL DOUBLE-STRUCK DIGIT FIVE
+U+1D7DE           𝟞            \bbsix                                       MATHEMATICAL DOUBLE-STRUCK DIGIT SIX
+U+1D7DF           𝟟            \bbseven                                     MATHEMATICAL DOUBLE-STRUCK DIGIT SEVEN
+U+1D7E0           𝟠            \bbeight                                     MATHEMATICAL DOUBLE-STRUCK DIGIT EIGHT
+U+1D7E1           𝟡            \bbnine                                      MATHEMATICAL DOUBLE-STRUCK DIGIT NINE
+U+1D7E2           𝟢            \sanszero                                    MATHEMATICAL SANS-SERIF DIGIT ZERO
+U+1D7E3           𝟣            \sansone                                     MATHEMATICAL SANS-SERIF DIGIT ONE
+U+1D7E4           𝟤            \sanstwo                                     MATHEMATICAL SANS-SERIF DIGIT TWO
+U+1D7E5           𝟥            \sansthree                                   MATHEMATICAL SANS-SERIF DIGIT THREE
+U+1D7E6           𝟦            \sansfour                                    MATHEMATICAL SANS-SERIF DIGIT FOUR
+U+1D7E7           𝟧            \sansfive                                    MATHEMATICAL SANS-SERIF DIGIT FIVE
+U+1D7E8           𝟨            \sanssix                                     MATHEMATICAL SANS-SERIF DIGIT SIX
+U+1D7E9           𝟩            \sansseven                                   MATHEMATICAL SANS-SERIF DIGIT SEVEN
+U+1D7EA           𝟪            \sanseight                                   MATHEMATICAL SANS-SERIF DIGIT EIGHT
+U+1D7EB           𝟫            \sansnine                                    MATHEMATICAL SANS-SERIF DIGIT NINE
+U+1D7EC           𝟬            \bsanszero                                   MATHEMATICAL SANS-SERIF BOLD DIGIT ZERO
+U+1D7ED           𝟭            \bsansone                                    MATHEMATICAL SANS-SERIF BOLD DIGIT ONE
+U+1D7EE           𝟮            \bsanstwo                                    MATHEMATICAL SANS-SERIF BOLD DIGIT TWO
+U+1D7EF           𝟯            \bsansthree                                  MATHEMATICAL SANS-SERIF BOLD DIGIT THREE
+U+1D7F0           𝟰            \bsansfour                                   MATHEMATICAL SANS-SERIF BOLD DIGIT FOUR
+U+1D7F1           𝟱            \bsansfive                                   MATHEMATICAL SANS-SERIF BOLD DIGIT FIVE
+U+1D7F2           𝟲            \bsanssix                                    MATHEMATICAL SANS-SERIF BOLD DIGIT SIX
+U+1D7F3           𝟳            \bsansseven                                  MATHEMATICAL SANS-SERIF BOLD DIGIT SEVEN
+U+1D7F4           𝟴            \bsanseight                                  MATHEMATICAL SANS-SERIF BOLD DIGIT EIGHT
+U+1D7F5           𝟵            \bsansnine                                   MATHEMATICAL SANS-SERIF BOLD DIGIT NINE
+U+1D7F6           𝟶            \ttzero                                      MATHEMATICAL MONOSPACE DIGIT ZERO
+U+1D7F7           𝟷            \ttone                                       MATHEMATICAL MONOSPACE DIGIT ONE
+U+1D7F8           𝟸            \tttwo                                       MATHEMATICAL MONOSPACE DIGIT TWO
+U+1D7F9           𝟹            \ttthree                                     MATHEMATICAL MONOSPACE DIGIT THREE
+U+1D7FA           𝟺            \ttfour                                      MATHEMATICAL MONOSPACE DIGIT FOUR
+U+1D7FB           𝟻            \ttfive                                      MATHEMATICAL MONOSPACE DIGIT FIVE
+U+1D7FC           𝟼            \ttsix                                       MATHEMATICAL MONOSPACE DIGIT SIX
+U+1D7FD           𝟽            \ttseven                                     MATHEMATICAL MONOSPACE DIGIT SEVEN
+U+1D7FE           𝟾            \tteight                                     MATHEMATICAL MONOSPACE DIGIT EIGHT
+U+1D7FF           𝟿            \ttnine                                      MATHEMATICAL MONOSPACE DIGIT NINE
+U+1F004           🀄            \:mahjong:                                   MAHJONG TILE RED DRAGON
+U+1F0CF           🃏            \:black_joker:                               PLAYING CARD BLACK JOKER
+U+1F170           🅰            \:a:                                         NEGATIVE SQUARED LATIN CAPITAL LETTER A
+U+1F171           🅱            \:b:                                         NEGATIVE SQUARED LATIN CAPITAL LETTER B
+U+1F17E           🅾            \:o2:                                        NEGATIVE SQUARED LATIN CAPITAL LETTER O
+U+1F17F           🅿            \:parking:                                   NEGATIVE SQUARED LATIN CAPITAL LETTER P
+U+1F18E           🆎            \:ab:                                        NEGATIVE SQUARED AB
+U+1F191           🆑            \:cl:                                        SQUARED CL
+U+1F192           🆒            \:cool:                                      SQUARED COOL
+U+1F193           🆓            \:free:                                      SQUARED FREE
+U+1F194           🆔            \:id:                                        SQUARED ID
+U+1F195           🆕            \:new:                                       SQUARED NEW
+U+1F196           🆖            \:ng:                                        SQUARED NG
+U+1F197           🆗            \:ok:                                        SQUARED OK
+U+1F198           🆘            \:sos:                                       SQUARED SOS
+U+1F199           🆙            \:up:                                        SQUARED UP WITH EXCLAMATION MARK
+U+1F19A           🆚            \:vs:                                        SQUARED VS
+U+1F201           🈁            \:koko:                                      SQUARED KATAKANA KOKO
+U+1F202           🈂            \:sa:                                        SQUARED KATAKANA SA
+U+1F21A           🈚            \:u7121:                                     SQUARED CJK UNIFIED IDEOGRAPH-7121
+U+1F22F           🈯            \:u6307:                                     SQUARED CJK UNIFIED IDEOGRAPH-6307
+U+1F232           🈲            \:u7981:                                     SQUARED CJK UNIFIED IDEOGRAPH-7981
+U+1F233           🈳            \:u7a7a:                                     SQUARED CJK UNIFIED IDEOGRAPH-7A7A
+U+1F234           🈴            \:u5408:                                     SQUARED CJK UNIFIED IDEOGRAPH-5408
+U+1F235           🈵            \:u6e80:                                     SQUARED CJK UNIFIED IDEOGRAPH-6E80
+U+1F236           🈶            \:u6709:                                     SQUARED CJK UNIFIED IDEOGRAPH-6709
+U+1F237           🈷            \:u6708:                                     SQUARED CJK UNIFIED IDEOGRAPH-6708
+U+1F238           🈸            \:u7533:                                     SQUARED CJK UNIFIED IDEOGRAPH-7533
+U+1F239           🈹            \:u5272:                                     SQUARED CJK UNIFIED IDEOGRAPH-5272
+U+1F23A           🈺            \:u55b6:                                     SQUARED CJK UNIFIED IDEOGRAPH-55B6
+U+1F250           🉐            \:ideograph_advantage:                       CIRCLED IDEOGRAPH ADVANTAGE
+U+1F251           🉑            \:accept:                                    CIRCLED IDEOGRAPH ACCEPT
+U+1F300           🌀            \:cyclone:                                   CYCLONE
+U+1F301           🌁            \:foggy:                                     FOGGY
+U+1F302           🌂            \:closed_umbrella:                           CLOSED UMBRELLA
+U+1F303           🌃            \:night_with_stars:                          NIGHT WITH STARS
+U+1F304           🌄            \:sunrise_over_mountains:                    SUNRISE OVER MOUNTAINS
+U+1F305           🌅            \:sunrise:                                   SUNRISE
+U+1F306           🌆            \:city_sunset:                               CITYSCAPE AT DUSK
+U+1F307           🌇            \:city_sunrise:                              SUNSET OVER BUILDINGS
+U+1F308           🌈            \:rainbow:                                   RAINBOW
+U+1F309           🌉            \:bridge_at_night:                           BRIDGE AT NIGHT
+U+1F30A           🌊            \:ocean:                                     WATER WAVE
+U+1F30B           🌋            \:volcano:                                   VOLCANO
+U+1F30C           🌌            \:milky_way:                                 MILKY WAY
+U+1F30D           🌍            \:earth_africa:                              EARTH GLOBE EUROPE-AFRICA
+U+1F30E           🌎            \:earth_americas:                            EARTH GLOBE AMERICAS
+U+1F30F           🌏            \:earth_asia:                                EARTH GLOBE ASIA-AUSTRALIA
+U+1F310           🌐            \:globe_with_meridians:                      GLOBE WITH MERIDIANS
+U+1F311           🌑            \:new_moon:                                  NEW MOON SYMBOL
+U+1F312           🌒            \:waxing_crescent_moon:                      WAXING CRESCENT MOON SYMBOL
+U+1F313           🌓            \:first_quarter_moon:                        FIRST QUARTER MOON SYMBOL
+U+1F314           🌔            \:moon:                                      WAXING GIBBOUS MOON SYMBOL
+U+1F315           🌕            \:full_moon:                                 FULL MOON SYMBOL
+U+1F316           🌖            \:waning_gibbous_moon:                       WANING GIBBOUS MOON SYMBOL
+U+1F317           🌗            \:last_quarter_moon:                         LAST QUARTER MOON SYMBOL
+U+1F318           🌘            \:waning_crescent_moon:                      WANING CRESCENT MOON SYMBOL
+U+1F319           🌙            \:crescent_moon:                             CRESCENT MOON
+U+1F31A           🌚            \:new_moon_with_face:                        NEW MOON WITH FACE
+U+1F31B           🌛            \:first_quarter_moon_with_face:              FIRST QUARTER MOON WITH FACE
+U+1F31C           🌜            \:last_quarter_moon_with_face:               LAST QUARTER MOON WITH FACE
+U+1F31D           🌝            \:full_moon_with_face:                       FULL MOON WITH FACE
+U+1F31E           🌞            \:sun_with_face:                             SUN WITH FACE
+U+1F31F           🌟            \:star2:                                     GLOWING STAR
+U+1F320           🌠            \:stars:                                     SHOOTING STAR
+U+1F330           🌰            \:chestnut:                                  CHESTNUT
+U+1F331           🌱            \:seedling:                                  SEEDLING
+U+1F332           🌲            \:evergreen_tree:                            EVERGREEN TREE
+U+1F333           🌳            \:deciduous_tree:                            DECIDUOUS TREE
+U+1F334           🌴            \:palm_tree:                                 PALM TREE
+U+1F335           🌵            \:cactus:                                    CACTUS
+U+1F337           🌷            \:tulip:                                     TULIP
+U+1F338           🌸            \:cherry_blossom:                            CHERRY BLOSSOM
+U+1F339           🌹            \:rose:                                      ROSE
+U+1F33A           🌺            \:hibiscus:                                  HIBISCUS
+U+1F33B           🌻            \:sunflower:                                 SUNFLOWER
+U+1F33C           🌼            \:blossom:                                   BLOSSOM
+U+1F33D           🌽            \:corn:                                      EAR OF MAIZE
+U+1F33E           🌾            \:ear_of_rice:                               EAR OF RICE
+U+1F33F           🌿            \:herb:                                      HERB
+U+1F340           🍀            \:four_leaf_clover:                          FOUR LEAF CLOVER
+U+1F341           🍁            \:maple_leaf:                                MAPLE LEAF
+U+1F342           🍂            \:fallen_leaf:                               FALLEN LEAF
+U+1F343           🍃            \:leaves:                                    LEAF FLUTTERING IN WIND
+U+1F344           🍄            \:mushroom:                                  MUSHROOM
+U+1F345           🍅            \:tomato:                                    TOMATO
+U+1F346           🍆            \:eggplant:                                  AUBERGINE
+U+1F347           🍇            \:grapes:                                    GRAPES
+U+1F348           🍈            \:melon:                                     MELON
+U+1F349           🍉            \:watermelon:                                WATERMELON
+U+1F34A           🍊            \:tangerine:                                 TANGERINE
+U+1F34B           🍋            \:lemon:                                     LEMON
+U+1F34C           🍌            \:banana:                                    BANANA
+U+1F34D           🍍            \:pineapple:                                 PINEAPPLE
+U+1F34E           🍎            \:apple:                                     RED APPLE
+U+1F34F           🍏            \:green_apple:                               GREEN APPLE
+U+1F350           🍐            \:pear:                                      PEAR
+U+1F351           🍑            \:peach:                                     PEACH
+U+1F352           🍒            \:cherries:                                  CHERRIES
+U+1F353           🍓            \:strawberry:                                STRAWBERRY
+U+1F354           🍔            \:hamburger:                                 HAMBURGER
+U+1F355           🍕            \:pizza:                                     SLICE OF PIZZA
+U+1F356           🍖            \:meat_on_bone:                              MEAT ON BONE
+U+1F357           🍗            \:poultry_leg:                               POULTRY LEG
+U+1F358           🍘            \:rice_cracker:                              RICE CRACKER
+U+1F359           🍙            \:rice_ball:                                 RICE BALL
+U+1F35A           🍚            \:rice:                                      COOKED RICE
+U+1F35B           🍛            \:curry:                                     CURRY AND RICE
+U+1F35C           🍜            \:ramen:                                     STEAMING BOWL
+U+1F35D           🍝            \:spaghetti:                                 SPAGHETTI
+U+1F35E           🍞            \:bread:                                     BREAD
+U+1F35F           🍟            \:fries:                                     FRENCH FRIES
+U+1F360           🍠            \:sweet_potato:                              ROASTED SWEET POTATO
+U+1F361           🍡            \:dango:                                     DANGO
+U+1F362           🍢            \:oden:                                      ODEN
+U+1F363           🍣            \:sushi:                                     SUSHI
+U+1F364           🍤            \:fried_shrimp:                              FRIED SHRIMP
+U+1F365           🍥            \:fish_cake:                                 FISH CAKE WITH SWIRL DESIGN
+U+1F366           🍦            \:icecream:                                  SOFT ICE CREAM
+U+1F367           🍧            \:shaved_ice:                                SHAVED ICE
+U+1F368           🍨            \:ice_cream:                                 ICE CREAM
+U+1F369           🍩            \:doughnut:                                  DOUGHNUT
+U+1F36A           🍪            \:cookie:                                    COOKIE
+U+1F36B           🍫            \:chocolate_bar:                             CHOCOLATE BAR
+U+1F36C           🍬            \:candy:                                     CANDY
+U+1F36D           🍭            \:lollipop:                                  LOLLIPOP
+U+1F36E           🍮            \:custard:                                   CUSTARD
+U+1F36F           🍯            \:honey_pot:                                 HONEY POT
+U+1F370           🍰            \:cake:                                      SHORTCAKE
+U+1F371           🍱            \:bento:                                     BENTO BOX
+U+1F372           🍲            \:stew:                                      POT OF FOOD
+U+1F373           🍳            \:egg:                                       COOKING
+U+1F374           🍴            \:fork_and_knife:                            FORK AND KNIFE
+U+1F375           🍵            \:tea:                                       TEACUP WITHOUT HANDLE
+U+1F376           🍶            \:sake:                                      SAKE BOTTLE AND CUP
+U+1F377           🍷            \:wine_glass:                                WINE GLASS
+U+1F378           🍸            \:cocktail:                                  COCKTAIL GLASS
+U+1F379           🍹            \:tropical_drink:                            TROPICAL DRINK
+U+1F37A           🍺            \:beer:                                      BEER MUG
+U+1F37B           🍻            \:beers:                                     CLINKING BEER MUGS
+U+1F37C           🍼            \:baby_bottle:                               BABY BOTTLE
+U+1F380           🎀            \:ribbon:                                    RIBBON
+U+1F381           🎁            \:gift:                                      WRAPPED PRESENT
+U+1F382           🎂            \:birthday:                                  BIRTHDAY CAKE
+U+1F383           🎃            \:jack_o_lantern:                            JACK-O-LANTERN
+U+1F384           🎄            \:christmas_tree:                            CHRISTMAS TREE
+U+1F385           🎅            \:santa:                                     FATHER CHRISTMAS
+U+1F386           🎆            \:fireworks:                                 FIREWORKS
+U+1F387           🎇            \:sparkler:                                  FIREWORK SPARKLER
+U+1F388           🎈            \:balloon:                                   BALLOON
+U+1F389           🎉            \:tada:                                      PARTY POPPER
+U+1F38A           🎊            \:confetti_ball:                             CONFETTI BALL
+U+1F38B           🎋            \:tanabata_tree:                             TANABATA TREE
+U+1F38C           🎌            \:crossed_flags:                             CROSSED FLAGS
+U+1F38D           🎍            \:bamboo:                                    PINE DECORATION
+U+1F38E           🎎            \:dolls:                                     JAPANESE DOLLS
+U+1F38F           🎏            \:flags:                                     CARP STREAMER
+U+1F390           🎐            \:wind_chime:                                WIND CHIME
+U+1F391           🎑            \:rice_scene:                                MOON VIEWING CEREMONY
+U+1F392           🎒            \:school_satchel:                            SCHOOL SATCHEL
+U+1F393           🎓            \:mortar_board:                              GRADUATION CAP
+U+1F3A0           🎠            \:carousel_horse:                            CAROUSEL HORSE
+U+1F3A1           🎡            \:ferris_wheel:                              FERRIS WHEEL
+U+1F3A2           🎢            \:roller_coaster:                            ROLLER COASTER
+U+1F3A3           🎣            \:fishing_pole_and_fish:                     FISHING POLE AND FISH
+U+1F3A4           🎤            \:microphone:                                MICROPHONE
+U+1F3A5           🎥            \:movie_camera:                              MOVIE CAMERA
+U+1F3A6           🎦            \:cinema:                                    CINEMA
+U+1F3A7           🎧            \:headphones:                                HEADPHONE
+U+1F3A8           🎨            \:art:                                       ARTIST PALETTE
+U+1F3A9           🎩            \:tophat:                                    TOP HAT
+U+1F3AA           🎪            \:circus_tent:                               CIRCUS TENT
+U+1F3AB           🎫            \:ticket:                                    TICKET
+U+1F3AC           🎬            \:clapper:                                   CLAPPER BOARD
+U+1F3AD           🎭            \:performing_arts:                           PERFORMING ARTS
+U+1F3AE           🎮            \:video_game:                                VIDEO GAME
+U+1F3AF           🎯            \:dart:                                      DIRECT HIT
+U+1F3B0           🎰            \:slot_machine:                              SLOT MACHINE
+U+1F3B1           🎱            \:8ball:                                     BILLIARDS
+U+1F3B2           🎲            \:game_die:                                  GAME DIE
+U+1F3B3           🎳            \:bowling:                                   BOWLING
+U+1F3B4           🎴            \:flower_playing_cards:                      FLOWER PLAYING CARDS
+U+1F3B5           🎵            \:musical_note:                              MUSICAL NOTE
+U+1F3B6           🎶            \:notes:                                     MULTIPLE MUSICAL NOTES
+U+1F3B7           🎷            \:saxophone:                                 SAXOPHONE
+U+1F3B8           🎸            \:guitar:                                    GUITAR
+U+1F3B9           🎹            \:musical_keyboard:                          MUSICAL KEYBOARD
+U+1F3BA           🎺            \:trumpet:                                   TRUMPET
+U+1F3BB           🎻            \:violin:                                    VIOLIN
+U+1F3BC           🎼            \:musical_score:                             MUSICAL SCORE
+U+1F3BD           🎽            \:running_shirt_with_sash:                   RUNNING SHIRT WITH SASH
+U+1F3BE           🎾            \:tennis:                                    TENNIS RACQUET AND BALL
+U+1F3BF           🎿            \:ski:                                       SKI AND SKI BOOT
+U+1F3C0           🏀            \:basketball:                                BASKETBALL AND HOOP
+U+1F3C1           🏁            \:checkered_flag:                            CHEQUERED FLAG
+U+1F3C2           🏂            \:snowboarder:                               SNOWBOARDER
+U+1F3C3           🏃            \:runner:                                    RUNNER
+U+1F3C4           🏄            \:surfer:                                    SURFER
+U+1F3C6           🏆            \:trophy:                                    TROPHY
+U+1F3C7           🏇            \:horse_racing:                              HORSE RACING
+U+1F3C8           🏈            \:football:                                  AMERICAN FOOTBALL
+U+1F3C9           🏉            \:rugby_football:                            RUGBY FOOTBALL
+U+1F3CA           🏊            \:swimmer:                                   SWIMMER
+U+1F3E0           🏠            \:house:                                     HOUSE BUILDING
+U+1F3E1           🏡            \:house_with_garden:                         HOUSE WITH GARDEN
+U+1F3E2           🏢            \:office:                                    OFFICE BUILDING
+U+1F3E3           🏣            \:post_office:                               JAPANESE POST OFFICE
+U+1F3E4           🏤            \:european_post_office:                      EUROPEAN POST OFFICE
+U+1F3E5           🏥            \:hospital:                                  HOSPITAL
+U+1F3E6           🏦            \:bank:                                      BANK
+U+1F3E7           🏧            \:atm:                                       AUTOMATED TELLER MACHINE
+U+1F3E8           🏨            \:hotel:                                     HOTEL
+U+1F3E9           🏩            \:love_hotel:                                LOVE HOTEL
+U+1F3EA           🏪            \:convenience_store:                         CONVENIENCE STORE
+U+1F3EB           🏫            \:school:                                    SCHOOL
+U+1F3EC           🏬            \:department_store:                          DEPARTMENT STORE
+U+1F3ED           🏭            \:factory:                                   FACTORY
+U+1F3EE           🏮            \:izakaya_lantern:                           IZAKAYA LANTERN
+U+1F3EF           🏯            \:japanese_castle:                           JAPANESE CASTLE
+U+1F3F0           🏰            \:european_castle:                           EUROPEAN CASTLE
+U+1F3FB           🏻            \:skin-tone-2:                               EMOJI MODIFIER FITZPATRICK TYPE-1-2
+U+1F3FC           🏼            \:skin-tone-3:                               EMOJI MODIFIER FITZPATRICK TYPE-3
+U+1F3FD           🏽            \:skin-tone-4:                               EMOJI MODIFIER FITZPATRICK TYPE-4
+U+1F3FE           🏾            \:skin-tone-5:                               EMOJI MODIFIER FITZPATRICK TYPE-5
+U+1F3FF           🏿            \:skin-tone-6:                               EMOJI MODIFIER FITZPATRICK TYPE-6
+U+1F400           🐀            \:rat:                                       RAT
+U+1F401           🐁            \:mouse2:                                    MOUSE
+U+1F402           🐂            \:ox:                                        OX
+U+1F403           🐃            \:water_buffalo:                             WATER BUFFALO
+U+1F404           🐄            \:cow2:                                      COW
+U+1F405           🐅            \:tiger2:                                    TIGER
+U+1F406           🐆            \:leopard:                                   LEOPARD
+U+1F407           🐇            \:rabbit2:                                   RABBIT
+U+1F408           🐈            \:cat2:                                      CAT
+U+1F409           🐉            \:dragon:                                    DRAGON
+U+1F40A           🐊            \:crocodile:                                 CROCODILE
+U+1F40B           🐋            \:whale2:                                    WHALE
+U+1F40C           🐌            \:snail:                                     SNAIL
+U+1F40D           🐍            \:snake:                                     SNAKE
+U+1F40E           🐎            \:racehorse:                                 HORSE
+U+1F40F           🐏            \:ram:                                       RAM
+U+1F410           🐐            \:goat:                                      GOAT
+U+1F411           🐑            \:sheep:                                     SHEEP
+U+1F412           🐒            \:monkey:                                    MONKEY
+U+1F413           🐓            \:rooster:                                   ROOSTER
+U+1F414           🐔            \:chicken:                                   CHICKEN
+U+1F415           🐕            \:dog2:                                      DOG
+U+1F416           🐖            \:pig2:                                      PIG
+U+1F417           🐗            \:boar:                                      BOAR
+U+1F418           🐘            \:elephant:                                  ELEPHANT
+U+1F419           🐙            \:octopus:                                   OCTOPUS
+U+1F41A           🐚            \:shell:                                     SPIRAL SHELL
+U+1F41B           🐛            \:bug:                                       BUG
+U+1F41C           🐜            \:ant:                                       ANT
+U+1F41D           🐝            \:bee:                                       HONEYBEE
+U+1F41E           🐞            \:beetle:                                    LADY BEETLE
+U+1F41F           🐟            \:fish:                                      FISH
+U+1F420           🐠            \:tropical_fish:                             TROPICAL FISH
+U+1F421           🐡            \:blowfish:                                  BLOWFISH
+U+1F422           🐢            \:turtle:                                    TURTLE
+U+1F423           🐣            \:hatching_chick:                            HATCHING CHICK
+U+1F424           🐤            \:baby_chick:                                BABY CHICK
+U+1F425           🐥            \:hatched_chick:                             FRONT-FACING BABY CHICK
+U+1F426           🐦            \:bird:                                      BIRD
+U+1F427           🐧            \:penguin:                                   PENGUIN
+U+1F428           🐨            \:koala:                                     KOALA
+U+1F429           🐩            \:poodle:                                    POODLE
+U+1F42A           🐪            \:dromedary_camel:                           DROMEDARY CAMEL
+U+1F42B           🐫            \:camel:                                     BACTRIAN CAMEL
+U+1F42C           🐬            \:dolphin:                                   DOLPHIN
+U+1F42D           🐭            \:mouse:                                     MOUSE FACE
+U+1F42E           🐮            \:cow:                                       COW FACE
+U+1F42F           🐯            \:tiger:                                     TIGER FACE
+U+1F430           🐰            \:rabbit:                                    RABBIT FACE
+U+1F431           🐱            \:cat:                                       CAT FACE
+U+1F432           🐲            \:dragon_face:                               DRAGON FACE
+U+1F433           🐳            \:whale:                                     SPOUTING WHALE
+U+1F434           🐴            \:horse:                                     HORSE FACE
+U+1F435           🐵            \:monkey_face:                               MONKEY FACE
+U+1F436           🐶            \:dog:                                       DOG FACE
+U+1F437           🐷            \:pig:                                       PIG FACE
+U+1F438           🐸            \:frog:                                      FROG FACE
+U+1F439           🐹            \:hamster:                                   HAMSTER FACE
+U+1F43A           🐺            \:wolf:                                      WOLF FACE
+U+1F43B           🐻            \:bear:                                      BEAR FACE
+U+1F43C           🐼            \:panda_face:                                PANDA FACE
+U+1F43D           🐽            \:pig_nose:                                  PIG NOSE
+U+1F43E           🐾            \:feet:                                      PAW PRINTS
+U+1F440           👀            \:eyes:                                      EYES
+U+1F442           👂            \:ear:                                       EAR
+U+1F443           👃            \:nose:                                      NOSE
+U+1F444           👄            \:lips:                                      MOUTH
+U+1F445           👅            \:tongue:                                    TONGUE
+U+1F446           👆            \:point_up_2:                                WHITE UP POINTING BACKHAND INDEX
+U+1F447           👇            \:point_down:                                WHITE DOWN POINTING BACKHAND INDEX
+U+1F448           👈            \:point_left:                                WHITE LEFT POINTING BACKHAND INDEX
+U+1F449           👉            \:point_right:                               WHITE RIGHT POINTING BACKHAND INDEX
+U+1F44A           👊            \:facepunch:                                 FISTED HAND SIGN
+U+1F44B           👋            \:wave:                                      WAVING HAND SIGN
+U+1F44C           👌            \:ok_hand:                                   OK HAND SIGN
+U+1F44D           👍            \:+1:                                        THUMBS UP SIGN
+U+1F44E           👎            \:-1:                                        THUMBS DOWN SIGN
+U+1F44F           👏            \:clap:                                      CLAPPING HANDS SIGN
+U+1F450           👐            \:open_hands:                                OPEN HANDS SIGN
+U+1F451           👑            \:crown:                                     CROWN
+U+1F452           👒            \:womans_hat:                                WOMANS HAT
+U+1F453           👓            \:eyeglasses:                                EYEGLASSES
+U+1F454           👔            \:necktie:                                   NECKTIE
+U+1F455           👕            \:shirt:                                     T-SHIRT
+U+1F456           👖            \:jeans:                                     JEANS
+U+1F457           👗            \:dress:                                     DRESS
+U+1F458           👘            \:kimono:                                    KIMONO
+U+1F459           👙            \:bikini:                                    BIKINI
+U+1F45A           👚            \:womans_clothes:                            WOMANS CLOTHES
+U+1F45B           👛            \:purse:                                     PURSE
+U+1F45C           👜            \:handbag:                                   HANDBAG
+U+1F45D           👝            \:pouch:                                     POUCH
+U+1F45E           👞            \:mans_shoe:                                 MANS SHOE
+U+1F45F           👟            \:athletic_shoe:                             ATHLETIC SHOE
+U+1F460           👠            \:high_heel:                                 HIGH-HEELED SHOE
+U+1F461           👡            \:sandal:                                    WOMANS SANDAL
+U+1F462           👢            \:boot:                                      WOMANS BOOTS
+U+1F463           👣            \:footprints:                                FOOTPRINTS
+U+1F464           👤            \:bust_in_silhouette:                        BUST IN SILHOUETTE
+U+1F465           👥            \:busts_in_silhouette:                       BUSTS IN SILHOUETTE
+U+1F466           👦            \:boy:                                       BOY
+U+1F467           👧            \:girl:                                      GIRL
+U+1F468           👨            \:man:                                       MAN
+U+1F469           👩            \:woman:                                     WOMAN
+U+1F46A           👪            \:family:                                    FAMILY
+U+1F46B           👫            \:couple:                                    MAN AND WOMAN HOLDING HANDS
+U+1F46C           👬            \:two_men_holding_hands:                     TWO MEN HOLDING HANDS
+U+1F46D           👭            \:two_women_holding_hands:                   TWO WOMEN HOLDING HANDS
+U+1F46E           👮            \:cop:                                       POLICE OFFICER
+U+1F46F           👯            \:dancers:                                   WOMAN WITH BUNNY EARS
+U+1F470           👰            \:bride_with_veil:                           BRIDE WITH VEIL
+U+1F471           👱            \:person_with_blond_hair:                    PERSON WITH BLOND HAIR
+U+1F472           👲            \:man_with_gua_pi_mao:                       MAN WITH GUA PI MAO
+U+1F473           👳            \:man_with_turban:                           MAN WITH TURBAN
+U+1F474           👴            \:older_man:                                 OLDER MAN
+U+1F475           👵            \:older_woman:                               OLDER WOMAN
+U+1F476           👶            \:baby:                                      BABY
+U+1F477           👷            \:construction_worker:                       CONSTRUCTION WORKER
+U+1F478           👸            \:princess:                                  PRINCESS
+U+1F479           👹            \:japanese_ogre:                             JAPANESE OGRE
+U+1F47A           👺            \:japanese_goblin:                           JAPANESE GOBLIN
+U+1F47B           👻            \:ghost:                                     GHOST
+U+1F47C           👼            \:angel:                                     BABY ANGEL
+U+1F47D           👽            \:alien:                                     EXTRATERRESTRIAL ALIEN
+U+1F47E           👾            \:space_invader:                             ALIEN MONSTER
+U+1F47F           👿            \:imp:                                       IMP
+U+1F480           💀            \:skull:                                     SKULL
+U+1F481           💁            \:information_desk_person:                   INFORMATION DESK PERSON
+U+1F482           💂            \:guardsman:                                 GUARDSMAN
+U+1F483           💃            \:dancer:                                    DANCER
+U+1F484           💄            \:lipstick:                                  LIPSTICK
+U+1F485           💅            \:nail_care:                                 NAIL POLISH
+U+1F486           💆            \:massage:                                   FACE MASSAGE
+U+1F487           💇            \:haircut:                                   HAIRCUT
+U+1F488           💈            \:barber:                                    BARBER POLE
+U+1F489           💉            \:syringe:                                   SYRINGE
+U+1F48A           💊            \:pill:                                      PILL
+U+1F48B           💋            \:kiss:                                      KISS MARK
+U+1F48C           💌            \:love_letter:                               LOVE LETTER
+U+1F48D           💍            \:ring:                                      RING
+U+1F48E           💎            \:gem:                                       GEM STONE
+U+1F48F           💏            \:couplekiss:                                KISS
+U+1F490           💐            \:bouquet:                                   BOUQUET
+U+1F491           💑            \:couple_with_heart:                         COUPLE WITH HEART
+U+1F492           💒            \:wedding:                                   WEDDING
+U+1F493           💓            \:heartbeat:                                 BEATING HEART
+U+1F494           💔            \:broken_heart:                              BROKEN HEART
+U+1F495           💕            \:two_hearts:                                TWO HEARTS
+U+1F496           💖            \:sparkling_heart:                           SPARKLING HEART
+U+1F497           💗            \:heartpulse:                                GROWING HEART
+U+1F498           💘            \:cupid:                                     HEART WITH ARROW
+U+1F499           💙            \:blue_heart:                                BLUE HEART
+U+1F49A           💚            \:green_heart:                               GREEN HEART
+U+1F49B           💛            \:yellow_heart:                              YELLOW HEART
+U+1F49C           💜            \:purple_heart:                              PURPLE HEART
+U+1F49D           💝            \:gift_heart:                                HEART WITH RIBBON
+U+1F49E           💞            \:revolving_hearts:                          REVOLVING HEARTS
+U+1F49F           💟            \:heart_decoration:                          HEART DECORATION
+U+1F4A0           💠            \:diamond_shape_with_a_dot_inside:           DIAMOND SHAPE WITH A DOT INSIDE
+U+1F4A1           💡            \:bulb:                                      ELECTRIC LIGHT BULB
+U+1F4A2           💢            \:anger:                                     ANGER SYMBOL
+U+1F4A3           💣            \:bomb:                                      BOMB
+U+1F4A4           💤            \:zzz:                                       SLEEPING SYMBOL
+U+1F4A5           💥            \:boom:                                      COLLISION SYMBOL
+U+1F4A6           💦            \:sweat_drops:                               SPLASHING SWEAT SYMBOL
+U+1F4A7           💧            \:droplet:                                   DROPLET
+U+1F4A8           💨            \:dash:                                      DASH SYMBOL
+U+1F4A9           💩            \:hankey:                                    PILE OF POO
+U+1F4AA           💪            \:muscle:                                    FLEXED BICEPS
+U+1F4AB           💫            \:dizzy:                                     DIZZY SYMBOL
+U+1F4AC           💬            \:speech_balloon:                            SPEECH BALLOON
+U+1F4AD           💭            \:thought_balloon:                           THOUGHT BALLOON
+U+1F4AE           💮            \:white_flower:                              WHITE FLOWER
+U+1F4AF           💯            \:100:                                       HUNDRED POINTS SYMBOL
+U+1F4B0           💰            \:moneybag:                                  MONEY BAG
+U+1F4B1           💱            \:currency_exchange:                         CURRENCY EXCHANGE
+U+1F4B2           💲            \:heavy_dollar_sign:                         HEAVY DOLLAR SIGN
+U+1F4B3           💳            \:credit_card:                               CREDIT CARD
+U+1F4B4           💴            \:yen:                                       BANKNOTE WITH YEN SIGN
+U+1F4B5           💵            \:dollar:                                    BANKNOTE WITH DOLLAR SIGN
+U+1F4B6           💶            \:euro:                                      BANKNOTE WITH EURO SIGN
+U+1F4B7           💷            \:pound:                                     BANKNOTE WITH POUND SIGN
+U+1F4B8           💸            \:money_with_wings:                          MONEY WITH WINGS
+U+1F4B9           💹            \:chart:                                     CHART WITH UPWARDS TREND AND YEN SIGN
+U+1F4BA           💺            \:seat:                                      SEAT
+U+1F4BB           💻            \:computer:                                  PERSONAL COMPUTER
+U+1F4BC           💼            \:briefcase:                                 BRIEFCASE
+U+1F4BD           💽            \:minidisc:                                  MINIDISC
+U+1F4BE           💾            \:floppy_disk:                               FLOPPY DISK
+U+1F4BF           💿            \:cd:                                        OPTICAL DISC
+U+1F4C0           📀            \:dvd:                                       DVD
+U+1F4C1           📁            \:file_folder:                               FILE FOLDER
+U+1F4C2           📂            \:open_file_folder:                          OPEN FILE FOLDER
+U+1F4C3           📃            \:page_with_curl:                            PAGE WITH CURL
+U+1F4C4           📄            \:page_facing_up:                            PAGE FACING UP
+U+1F4C5           📅            \:date:                                      CALENDAR
+U+1F4C6           📆            \:calendar:                                  TEAR-OFF CALENDAR
+U+1F4C7           📇            \:card_index:                                CARD INDEX
+U+1F4C8           📈            \:chart_with_upwards_trend:                  CHART WITH UPWARDS TREND
+U+1F4C9           📉            \:chart_with_downwards_trend:                CHART WITH DOWNWARDS TREND
+U+1F4CA           📊            \:bar_chart:                                 BAR CHART
+U+1F4CB           📋            \:clipboard:                                 CLIPBOARD
+U+1F4CC           📌            \:pushpin:                                   PUSHPIN
+U+1F4CD           📍            \:round_pushpin:                             ROUND PUSHPIN
+U+1F4CE           📎            \:paperclip:                                 PAPERCLIP
+U+1F4CF           📏            \:straight_ruler:                            STRAIGHT RULER
+U+1F4D0           📐            \:triangular_ruler:                          TRIANGULAR RULER
+U+1F4D1           📑            \:bookmark_tabs:                             BOOKMARK TABS
+U+1F4D2           📒            \:ledger:                                    LEDGER
+U+1F4D3           📓            \:notebook:                                  NOTEBOOK
+U+1F4D4           📔            \:notebook_with_decorative_cover:            NOTEBOOK WITH DECORATIVE COVER
+U+1F4D5           📕            \:closed_book:                               CLOSED BOOK
+U+1F4D6           📖            \:book:                                      OPEN BOOK
+U+1F4D7           📗            \:green_book:                                GREEN BOOK
+U+1F4D8           📘            \:blue_book:                                 BLUE BOOK
+U+1F4D9           📙            \:orange_book:                               ORANGE BOOK
+U+1F4DA           📚            \:books:                                     BOOKS
+U+1F4DB           📛            \:name_badge:                                NAME BADGE
+U+1F4DC           📜            \:scroll:                                    SCROLL
+U+1F4DD           📝            \:memo:                                      MEMO
+U+1F4DE           📞            \:telephone_receiver:                        TELEPHONE RECEIVER
+U+1F4DF           📟            \:pager:                                     PAGER
+U+1F4E0           📠            \:fax:                                       FAX MACHINE
+U+1F4E1           📡            \:satellite:                                 SATELLITE ANTENNA
+U+1F4E2           📢            \:loudspeaker:                               PUBLIC ADDRESS LOUDSPEAKER
+U+1F4E3           📣            \:mega:                                      CHEERING MEGAPHONE
+U+1F4E4           📤            \:outbox_tray:                               OUTBOX TRAY
+U+1F4E5           📥            \:inbox_tray:                                INBOX TRAY
+U+1F4E6           📦            \:package:                                   PACKAGE
+U+1F4E7           📧            \:e-mail:                                    E-MAIL SYMBOL
+U+1F4E8           📨            \:incoming_envelope:                         INCOMING ENVELOPE
+U+1F4E9           📩            \:envelope_with_arrow:                       ENVELOPE WITH DOWNWARDS ARROW ABOVE
+U+1F4EA           📪            \:mailbox_closed:                            CLOSED MAILBOX WITH LOWERED FLAG
+U+1F4EB           📫            \:mailbox:                                   CLOSED MAILBOX WITH RAISED FLAG
+U+1F4EC           📬            \:mailbox_with_mail:                         OPEN MAILBOX WITH RAISED FLAG
+U+1F4ED           📭            \:mailbox_with_no_mail:                      OPEN MAILBOX WITH LOWERED FLAG
+U+1F4EE           📮            \:postbox:                                   POSTBOX
+U+1F4EF           📯            \:postal_horn:                               POSTAL HORN
+U+1F4F0           📰            \:newspaper:                                 NEWSPAPER
+U+1F4F1           📱            \:iphone:                                    MOBILE PHONE
+U+1F4F2           📲            \:calling:                                   MOBILE PHONE WITH RIGHTWARDS ARROW AT LEFT
+U+1F4F3           📳            \:vibration_mode:                            VIBRATION MODE
+U+1F4F4           📴            \:mobile_phone_off:                          MOBILE PHONE OFF
+U+1F4F5           📵            \:no_mobile_phones:                          NO MOBILE PHONES
+U+1F4F6           📶            \:signal_strength:                           ANTENNA WITH BARS
+U+1F4F7           📷            \:camera:                                    CAMERA
+U+1F4F9           📹            \:video_camera:                              VIDEO CAMERA
+U+1F4FA           📺            \:tv:                                        TELEVISION
+U+1F4FB           📻            \:radio:                                     RADIO
+U+1F4FC           📼            \:vhs:                                       VIDEOCASSETTE
+U+1F500           🔀            \:twisted_rightwards_arrows:                 TWISTED RIGHTWARDS ARROWS
+U+1F501           🔁            \:repeat:                                    CLOCKWISE RIGHTWARDS AND LEFTWARDS OPEN CIRCLE ARROWS
+U+1F502           🔂            \:repeat_one:                                CLOCKWISE RIGHTWARDS AND LEFTWARDS OPEN CIRCLE ARROWS WITH CIRCLED ONE OVERLAY
+U+1F503           🔃            \:arrows_clockwise:                          CLOCKWISE DOWNWARDS AND UPWARDS OPEN CIRCLE ARROWS
+U+1F504           🔄            \:arrows_counterclockwise:                   ANTICLOCKWISE DOWNWARDS AND UPWARDS OPEN CIRCLE ARROWS
+U+1F505           🔅            \:low_brightness:                            LOW BRIGHTNESS SYMBOL
+U+1F506           🔆            \:high_brightness:                           HIGH BRIGHTNESS SYMBOL
+U+1F507           🔇            \:mute:                                      SPEAKER WITH CANCELLATION STROKE
+U+1F508           🔈            \:speaker:                                   SPEAKER
+U+1F509           🔉            \:sound:                                     SPEAKER WITH ONE SOUND WAVE
+U+1F50A           🔊            \:loud_sound:                                SPEAKER WITH THREE SOUND WAVES
+U+1F50B           🔋            \:battery:                                   BATTERY
+U+1F50C           🔌            \:electric_plug:                             ELECTRIC PLUG
+U+1F50D           🔍            \:mag:                                       LEFT-POINTING MAGNIFYING GLASS
+U+1F50E           🔎            \:mag_right:                                 RIGHT-POINTING MAGNIFYING GLASS
+U+1F50F           🔏            \:lock_with_ink_pen:                         LOCK WITH INK PEN
+U+1F510           🔐            \:closed_lock_with_key:                      CLOSED LOCK WITH KEY
+U+1F511           🔑            \:key:                                       KEY
+U+1F512           🔒            \:lock:                                      LOCK
+U+1F513           🔓            \:unlock:                                    OPEN LOCK
+U+1F514           🔔            \:bell:                                      BELL
+U+1F515           🔕            \:no_bell:                                   BELL WITH CANCELLATION STROKE
+U+1F516           🔖            \:bookmark:                                  BOOKMARK
+U+1F517           🔗            \:link:                                      LINK SYMBOL
+U+1F518           🔘            \:radio_button:                              RADIO BUTTON
+U+1F519           🔙            \:back:                                      BACK WITH LEFTWARDS ARROW ABOVE
+U+1F51A           🔚            \:end:                                       END WITH LEFTWARDS ARROW ABOVE
+U+1F51B           🔛            \:on:                                        ON WITH EXCLAMATION MARK WITH LEFT RIGHT ARROW ABOVE
+U+1F51C           🔜            \:soon:                                      SOON WITH RIGHTWARDS ARROW ABOVE
+U+1F51D           🔝            \:top:                                       TOP WITH UPWARDS ARROW ABOVE
+U+1F51E           🔞            \:underage:                                  NO ONE UNDER EIGHTEEN SYMBOL
+U+1F51F           🔟            \:keycap_ten:                                KEYCAP TEN
+U+1F520           🔠            \:capital_abcd:                              INPUT SYMBOL FOR LATIN CAPITAL LETTERS
+U+1F521           🔡            \:abcd:                                      INPUT SYMBOL FOR LATIN SMALL LETTERS
+U+1F522           🔢            \:1234:                                      INPUT SYMBOL FOR NUMBERS
+U+1F523           🔣            \:symbols:                                   INPUT SYMBOL FOR SYMBOLS
+U+1F524           🔤            \:abc:                                       INPUT SYMBOL FOR LATIN LETTERS
+U+1F525           🔥            \:fire:                                      FIRE
+U+1F526           🔦            \:flashlight:                                ELECTRIC TORCH
+U+1F527           🔧            \:wrench:                                    WRENCH
+U+1F528           🔨            \:hammer:                                    HAMMER
+U+1F529           🔩            \:nut_and_bolt:                              NUT AND BOLT
+U+1F52A           🔪            \:hocho:                                     HOCHO
+U+1F52B           🔫            \:gun:                                       PISTOL
+U+1F52C           🔬            \:microscope:                                MICROSCOPE
+U+1F52D           🔭            \:telescope:                                 TELESCOPE
+U+1F52E           🔮            \:crystal_ball:                              CRYSTAL BALL
+U+1F52F           🔯            \:six_pointed_star:                          SIX POINTED STAR WITH MIDDLE DOT
+U+1F530           🔰            \:beginner:                                  JAPANESE SYMBOL FOR BEGINNER
+U+1F531           🔱            \:trident:                                   TRIDENT EMBLEM
+U+1F532           🔲            \:black_square_button:                       BLACK SQUARE BUTTON
+U+1F533           🔳            \:white_square_button:                       WHITE SQUARE BUTTON
+U+1F534           🔴            \:red_circle:                                LARGE RED CIRCLE
+U+1F535           🔵            \:large_blue_circle:                         LARGE BLUE CIRCLE
+U+1F536           🔶            \:large_orange_diamond:                      LARGE ORANGE DIAMOND
+U+1F537           🔷            \:large_blue_diamond:                        LARGE BLUE DIAMOND
+U+1F538           🔸            \:small_orange_diamond:                      SMALL ORANGE DIAMOND
+U+1F539           🔹            \:small_blue_diamond:                        SMALL BLUE DIAMOND
+U+1F53A           🔺            \:small_red_triangle:                        UP-POINTING RED TRIANGLE
+U+1F53B           🔻            \:small_red_triangle_down:                   DOWN-POINTING RED TRIANGLE
+U+1F53C           🔼            \:arrow_up_small:                            UP-POINTING SMALL RED TRIANGLE
+U+1F53D           🔽            \:arrow_down_small:                          DOWN-POINTING SMALL RED TRIANGLE
+U+1F550           🕐            \:clock1:                                    CLOCK FACE ONE OCLOCK
+U+1F551           🕑            \:clock2:                                    CLOCK FACE TWO OCLOCK
+U+1F552           🕒            \:clock3:                                    CLOCK FACE THREE OCLOCK
+U+1F553           🕓            \:clock4:                                    CLOCK FACE FOUR OCLOCK
+U+1F554           🕔            \:clock5:                                    CLOCK FACE FIVE OCLOCK
+U+1F555           🕕            \:clock6:                                    CLOCK FACE SIX OCLOCK
+U+1F556           🕖            \:clock7:                                    CLOCK FACE SEVEN OCLOCK
+U+1F557           🕗            \:clock8:                                    CLOCK FACE EIGHT OCLOCK
+U+1F558           🕘            \:clock9:                                    CLOCK FACE NINE OCLOCK
+U+1F559           🕙            \:clock10:                                   CLOCK FACE TEN OCLOCK
+U+1F55A           🕚            \:clock11:                                   CLOCK FACE ELEVEN OCLOCK
+U+1F55B           🕛            \:clock12:                                   CLOCK FACE TWELVE OCLOCK
+U+1F55C           🕜            \:clock130:                                  CLOCK FACE ONE-THIRTY
+U+1F55D           🕝            \:clock230:                                  CLOCK FACE TWO-THIRTY
+U+1F55E           🕞            \:clock330:                                  CLOCK FACE THREE-THIRTY
+U+1F55F           🕟            \:clock430:                                  CLOCK FACE FOUR-THIRTY
+U+1F560           🕠            \:clock530:                                  CLOCK FACE FIVE-THIRTY
+U+1F561           🕡            \:clock630:                                  CLOCK FACE SIX-THIRTY
+U+1F562           🕢            \:clock730:                                  CLOCK FACE SEVEN-THIRTY
+U+1F563           🕣            \:clock830:                                  CLOCK FACE EIGHT-THIRTY
+U+1F564           🕤            \:clock930:                                  CLOCK FACE NINE-THIRTY
+U+1F565           🕥            \:clock1030:                                 CLOCK FACE TEN-THIRTY
+U+1F566           🕦            \:clock1130:                                 CLOCK FACE ELEVEN-THIRTY
+U+1F567           🕧            \:clock1230:                                 CLOCK FACE TWELVE-THIRTY
+U+1F5FB           🗻            \:mount_fuji:                                MOUNT FUJI
+U+1F5FC           🗼            \:tokyo_tower:                               TOKYO TOWER
+U+1F5FD           🗽            \:statue_of_liberty:                         STATUE OF LIBERTY
+U+1F5FE           🗾            \:japan:                                     SILHOUETTE OF JAPAN
+U+1F5FF           🗿            \:moyai:                                     MOYAI
+U+1F600           😀            \:grinning:                                  GRINNING FACE
+U+1F601           😁            \:grin:                                      GRINNING FACE WITH SMILING EYES
+U+1F602           😂            \:joy:                                       FACE WITH TEARS OF JOY
+U+1F603           😃            \:smiley:                                    SMILING FACE WITH OPEN MOUTH
+U+1F604           😄            \:smile:                                     SMILING FACE WITH OPEN MOUTH AND SMILING EYES
+U+1F605           😅            \:sweat_smile:                               SMILING FACE WITH OPEN MOUTH AND COLD SWEAT
+U+1F606           😆            \:laughing:                                  SMILING FACE WITH OPEN MOUTH AND TIGHTLY-CLOSED EYES
+U+1F607           😇            \:innocent:                                  SMILING FACE WITH HALO
+U+1F608           😈            \:smiling_imp:                               SMILING FACE WITH HORNS
+U+1F609           😉            \:wink:                                      WINKING FACE
+U+1F60A           😊            \:blush:                                     SMILING FACE WITH SMILING EYES
+U+1F60B           😋            \:yum:                                       FACE SAVOURING DELICIOUS FOOD
+U+1F60C           😌            \:relieved:                                  RELIEVED FACE
+U+1F60D           😍            \:heart_eyes:                                SMILING FACE WITH HEART-SHAPED EYES
+U+1F60E           😎            \:sunglasses:                                SMILING FACE WITH SUNGLASSES
+U+1F60F           😏            \:smirk:                                     SMIRKING FACE
+U+1F610           😐            \:neutral_face:                              NEUTRAL FACE
+U+1F611           😑            \:expressionless:                            EXPRESSIONLESS FACE
+U+1F612           😒            \:unamused:                                  UNAMUSED FACE
+U+1F613           😓            \:sweat:                                     FACE WITH COLD SWEAT
+U+1F614           😔            \:pensive:                                   PENSIVE FACE
+U+1F615           😕            \:confused:                                  CONFUSED FACE
+U+1F616           😖            \:confounded:                                CONFOUNDED FACE
+U+1F617           😗            \:kissing:                                   KISSING FACE
+U+1F618           😘            \:kissing_heart:                             FACE THROWING A KISS
+U+1F619           😙            \:kissing_smiling_eyes:                      KISSING FACE WITH SMILING EYES
+U+1F61A           😚            \:kissing_closed_eyes:                       KISSING FACE WITH CLOSED EYES
+U+1F61B           😛            \:stuck_out_tongue:                          FACE WITH STUCK-OUT TONGUE
+U+1F61C           😜            \:stuck_out_tongue_winking_eye:              FACE WITH STUCK-OUT TONGUE AND WINKING EYE
+U+1F61D           😝            \:stuck_out_tongue_closed_eyes:              FACE WITH STUCK-OUT TONGUE AND TIGHTLY-CLOSED EYES
+U+1F61E           😞            \:disappointed:                              DISAPPOINTED FACE
+U+1F61F           😟            \:worried:                                   WORRIED FACE
+U+1F620           😠            \:angry:                                     ANGRY FACE
+U+1F621           😡            \:rage:                                      POUTING FACE
+U+1F622           😢            \:cry:                                       CRYING FACE
+U+1F623           😣            \:persevere:                                 PERSEVERING FACE
+U+1F624           😤            \:triumph:                                   FACE WITH LOOK OF TRIUMPH
+U+1F625           😥            \:disappointed_relieved:                     DISAPPOINTED BUT RELIEVED FACE
+U+1F626           😦            \:frowning:                                  FROWNING FACE WITH OPEN MOUTH
+U+1F627           😧            \:anguished:                                 ANGUISHED FACE
+U+1F628           😨            \:fearful:                                   FEARFUL FACE
+U+1F629           😩            \:weary:                                     WEARY FACE
+U+1F62A           😪            \:sleepy:                                    SLEEPY FACE
+U+1F62B           😫            \:tired_face:                                TIRED FACE
+U+1F62C           😬            \:grimacing:                                 GRIMACING FACE
+U+1F62D           😭            \:sob:                                       LOUDLY CRYING FACE
+U+1F62E           😮            \:open_mouth:                                FACE WITH OPEN MOUTH
+U+1F62F           😯            \:hushed:                                    HUSHED FACE
+U+1F630           😰            \:cold_sweat:                                FACE WITH OPEN MOUTH AND COLD SWEAT
+U+1F631           😱            \:scream:                                    FACE SCREAMING IN FEAR
+U+1F632           😲            \:astonished:                                ASTONISHED FACE
+U+1F633           😳            \:flushed:                                   FLUSHED FACE
+U+1F634           😴            \:sleeping:                                  SLEEPING FACE
+U+1F635           😵            \:dizzy_face:                                DIZZY FACE
+U+1F636           😶            \:no_mouth:                                  FACE WITHOUT MOUTH
+U+1F637           😷            \:mask:                                      FACE WITH MEDICAL MASK
+U+1F638           😸            \:smile_cat:                                 GRINNING CAT FACE WITH SMILING EYES
+U+1F639           😹            \:joy_cat:                                   CAT FACE WITH TEARS OF JOY
+U+1F63A           😺            \:smiley_cat:                                SMILING CAT FACE WITH OPEN MOUTH
+U+1F63B           😻            \:heart_eyes_cat:                            SMILING CAT FACE WITH HEART-SHAPED EYES
+U+1F63C           😼            \:smirk_cat:                                 CAT FACE WITH WRY SMILE
+U+1F63D           😽            \:kissing_cat:                               KISSING CAT FACE WITH CLOSED EYES
+U+1F63E           😾            \:pouting_cat:                               POUTING CAT FACE
+U+1F63F           😿            \:crying_cat_face:                           CRYING CAT FACE
+U+1F640           🙀            \:scream_cat:                                WEARY CAT FACE
+U+1F645           🙅            \:no_good:                                   FACE WITH NO GOOD GESTURE
+U+1F646           🙆            \:ok_woman:                                  FACE WITH OK GESTURE
+U+1F647           🙇            \:bow:                                       PERSON BOWING DEEPLY
+U+1F648           🙈            \:see_no_evil:                               SEE-NO-EVIL MONKEY
+U+1F649           🙉            \:hear_no_evil:                              HEAR-NO-EVIL MONKEY
+U+1F64A           🙊            \:speak_no_evil:                             SPEAK-NO-EVIL MONKEY
+U+1F64B           🙋            \:raising_hand:                              HAPPY PERSON RAISING ONE HAND
+U+1F64C           🙌            \:raised_hands:                              PERSON RAISING BOTH HANDS IN CELEBRATION
+U+1F64D           🙍            \:person_frowning:                           PERSON FROWNING
+U+1F64E           🙎            \:person_with_pouting_face:                  PERSON WITH POUTING FACE
+U+1F64F           🙏            \:pray:                                      PERSON WITH FOLDED HANDS
+U+1F680           🚀            \:rocket:                                    ROCKET
+U+1F681           🚁            \:helicopter:                                HELICOPTER
+U+1F682           🚂            \:steam_locomotive:                          STEAM LOCOMOTIVE
+U+1F683           🚃            \:railway_car:                               RAILWAY CAR
+U+1F684           🚄            \:bullettrain_side:                          HIGH-SPEED TRAIN
+U+1F685           🚅            \:bullettrain_front:                         HIGH-SPEED TRAIN WITH BULLET NOSE
+U+1F686           🚆            \:train2:                                    TRAIN
+U+1F687           🚇            \:metro:                                     METRO
+U+1F688           🚈            \:light_rail:                                LIGHT RAIL
+U+1F689           🚉            \:station:                                   STATION
+U+1F68A           🚊            \:tram:                                      TRAM
+U+1F68B           🚋            \:train:                                     TRAM CAR
+U+1F68C           🚌            \:bus:                                       BUS
+U+1F68D           🚍            \:oncoming_bus:                              ONCOMING BUS
+U+1F68E           🚎            \:trolleybus:                                TROLLEYBUS
+U+1F68F           🚏            \:busstop:                                   BUS STOP
+U+1F690           🚐            \:minibus:                                   MINIBUS
+U+1F691           🚑            \:ambulance:                                 AMBULANCE
+U+1F692           🚒            \:fire_engine:                               FIRE ENGINE
+U+1F693           🚓            \:police_car:                                POLICE CAR
+U+1F694           🚔            \:oncoming_police_car:                       ONCOMING POLICE CAR
+U+1F695           🚕            \:taxi:                                      TAXI
+U+1F696           🚖            \:oncoming_taxi:                             ONCOMING TAXI
+U+1F697           🚗            \:car:                                       AUTOMOBILE
+U+1F698           🚘            \:oncoming_automobile:                       ONCOMING AUTOMOBILE
+U+1F699           🚙            \:blue_car:                                  RECREATIONAL VEHICLE
+U+1F69A           🚚            \:truck:                                     DELIVERY TRUCK
+U+1F69B           🚛            \:articulated_lorry:                         ARTICULATED LORRY
+U+1F69C           🚜            \:tractor:                                   TRACTOR
+U+1F69D           🚝            \:monorail:                                  MONORAIL
+U+1F69E           🚞            \:mountain_railway:                          MOUNTAIN RAILWAY
+U+1F69F           🚟            \:suspension_railway:                        SUSPENSION RAILWAY
+U+1F6A0           🚠            \:mountain_cableway:                         MOUNTAIN CABLEWAY
+U+1F6A1           🚡            \:aerial_tramway:                            AERIAL TRAMWAY
+U+1F6A2           🚢            \:ship:                                      SHIP
+U+1F6A3           🚣            \:rowboat:                                   ROWBOAT
+U+1F6A4           🚤            \:speedboat:                                 SPEEDBOAT
+U+1F6A5           🚥            \:traffic_light:                             HORIZONTAL TRAFFIC LIGHT
+U+1F6A6           🚦            \:vertical_traffic_light:                    VERTICAL TRAFFIC LIGHT
+U+1F6A7           🚧            \:construction:                              CONSTRUCTION SIGN
+U+1F6A8           🚨            \:rotating_light:                            POLICE CARS REVOLVING LIGHT
+U+1F6A9           🚩            \:triangular_flag_on_post:                   TRIANGULAR FLAG ON POST
+U+1F6AA           🚪            \:door:                                      DOOR
+U+1F6AB           🚫            \:no_entry_sign:                             NO ENTRY SIGN
+U+1F6AC           🚬            \:smoking:                                   SMOKING SYMBOL
+U+1F6AD           🚭            \:no_smoking:                                NO SMOKING SYMBOL
+U+1F6AE           🚮            \:put_litter_in_its_place:                   PUT LITTER IN ITS PLACE SYMBOL
+U+1F6AF           🚯            \:do_not_litter:                             DO NOT LITTER SYMBOL
+U+1F6B0           🚰            \:potable_water:                             POTABLE WATER SYMBOL
+U+1F6B1           🚱            \:non-potable_water:                         NON-POTABLE WATER SYMBOL
+U+1F6B2           🚲            \:bike:                                      BICYCLE
+U+1F6B3           🚳            \:no_bicycles:                               NO BICYCLES
+U+1F6B4           🚴            \:bicyclist:                                 BICYCLIST
+U+1F6B5           🚵            \:mountain_bicyclist:                        MOUNTAIN BICYCLIST
+U+1F6B6           🚶            \:walking:                                   PEDESTRIAN
+U+1F6B7           🚷            \:no_pedestrians:                            NO PEDESTRIANS
+U+1F6B8           🚸            \:children_crossing:                         CHILDREN CROSSING
+U+1F6B9           🚹            \:mens:                                      MENS SYMBOL
+U+1F6BA           🚺            \:womens:                                    WOMENS SYMBOL
+U+1F6BB           🚻            \:restroom:                                  RESTROOM
+U+1F6BC           🚼            \:baby_symbol:                               BABY SYMBOL
+U+1F6BD           🚽            \:toilet:                                    TOILET
+U+1F6BE           🚾            \:wc:                                        WATER CLOSET
+U+1F6BF           🚿            \:shower:                                    SHOWER
+U+1F6C0           🛀            \:bath:                                      BATH
+U+1F6C1           🛁            \:bathtub:                                   BATHTUB
+U+1F6C2           🛂            \:passport_control:                          PASSPORT CONTROL
+U+1F6C3           🛃            \:customs:                                   CUSTOMS
+U+1F6C4           🛄            \:baggage_claim:                             BAGGAGE CLAIM
+U+1F6C5           🛅            \:left_luggage:                              LEFT LUGGAGE
+----------------- ------------ -------------------------------------------- --------------------------------------------------------------------------------------------------------
+
+  vim:tw=180:et:ft=help:norl:
Index: /issm/trunk/externalpackages/vim/addons/vim/doc/julia-vim-L2U.txt
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/doc/julia-vim-L2U.txt	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/doc/julia-vim-L2U.txt	(revision 26744)
@@ -0,0 +1,410 @@
+*julia-vim-L2U.txt*  Support for LaTeX-to-Unicode substitutions
+
+Author:  Carlo Baldassi <carlobaldassi@gmail.com>
+License: MIT license  {{{
+    Permission is hereby granted, free of charge, to any person obtaining
+    a copy of this software and associated documentation files (the
+    "Software"), to deal in the Software without restriction, including
+    without limitation the rights to use, copy, modify, merge, publish,
+    distribute, sublicense, and/or sell copies of the Software, and to
+    permit persons to whom the Software is furnished to do so, subject to
+    the following conditions:
+    The above copyright notice and this permission notice shall be included
+    in all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+}}}
+CONTENTS					*julia-vim-L2U*
+
+LaTeX-to-Unicode substitutions      |julia-vim-L2U-introdction|
+  Via Tab key                       |julia-vim-L2U-tab|
+  As you type                       |julia-vim-L2U-as-you-type|
+  Via Keymap                        |julia-vim-L2U-keymap|
+  On different file types           |julia-vim-L2U-file-types|
+  Enabling and disabling            |julia-vim-L2U-enable-disable|
+Variables                           |julia-vim-L2U-variables|
+Functions                           |julia-vim-L2U-functions|
+
+==============================================================================
+LATEX TO UNICODE                              *julia-vim-L2U-introduction*
+
+In the Julia REPL, entering a LaTeX-like sequence such as `\alpha` and pressing
+the <Tab> key substitutes it with a Unicode character such as `α`. The Julia
+REPL also provides partial completions, and suggestions for possible
+completions upon repeated pressing of the <Tab> key. Emojis are also
+available, with their names written between colons, e.g. `\:interrobang:`
+produces `⁉`.
+
+See |julia-vim-L2U-reference| for the complete table of substitutions.
+
+This Vim plug-in also provides the functionality needed to convert LaTeX
+input sequences into Unicode characters. There are 3 different methods
+available:
+
+  1. The default one is the most similar to the Julia one: substitutions are
+     triggered by pressing the <Tab> key; if a partial match is found a list
+     of suggested completions is presented in a menu together with their
+     Unicode counterpart. The exact behaviour of this feature can be
+     customized, see |julia-vim-L2U-tab|.
+
+  2. The second one substitutes symbols on the fly as you type, but only in
+     |Insert| mode. See |julia-vim-L2U-as-you-type|.
+
+  3. The third is based on |keymap|. It also substitutes as-you-type, but it
+     doesn't show you the full LaTeX sequence as you're typing it, and there
+     is a time-out. Its main advantage over the previous one is that can be
+     used in more circumstances, e.g. in |Command-line| mode or when searching
+     for a character with |f| or |t|, as explained in |language-mapping|. See
+     |julia-vim-L2U-keymap|.
+
+All of these methods are independent and can be used together without issues.
+
+The default configuration is to use the first method, and it's only active
+when editing Julia files. It only works in |Insert| and |Command-line| modes.
+
+It is possible to enable it with other file types, see
+|julia-vim-L2U-file-types|, and it can be even turned on/off on the fly
+regardless of the file type, see |julia-vim-L2U-enable-disable|.
+
+In |Command-line| mode, e.g. when searching with the |/| or |?| commands, the
+default behavior is very similar to the default |Insert| mode behavior, but
+slightly more limited, see |julia-vim-L2U-cmdmode|.
+
+These features only work as described with Vim version 7.4 or higher. Tab
+completion can still be made available on lower Vim versions, see
+|julia-vim-L2U-workaround|. The keymap mode might work but it hasn't been
+tested.
+
+See |julia-vim| for the general reference about the other features of the
+julia-vim plug-in.
+
+------------------------------------------------------------------------------
+LATEX TO UNICODE VIA TAB KEY                            *julia-vim-L2U-tab*
+
+Substitution of LaTeX sequences when pressing the <Tab> key (in |Insert| mode or
+in |Command-line| modes) is active by default. Use |g:latex_to_unicode_tab| to
+control it.
+
+When this feature is active, the julia-vim plug-in creates a mapping for the
+<Tab> key (in |Insert| mode) which takes precedence on any previously defined
+mapping assigned to it, such that when the <Tab> key is pressed the plug-in
+looks for potential LaTeX symbol matches before the cursor, and if it fails to
+find anything of interest it will fall-back to the previous mapping for <Tab>
+(with default Vim settings, this means it will insert a literal <Tab>; but if
+you have defined some other behavior for that key, e.g. by installing another
+plug-in such as supertab (https://github.com/ervandew/supertab) than that will
+be used).
+
+For example, entering this text in a file:
+>
+    1 + \alpha
+<
+and then pressing <Tab>, results in:
+>
+    1 + α
+<
+
+This feature is associated with 'completefunc' completion, and therefore can
+always be accessed via CTRL-X CTRL-U, even when |g:latex_to_unicode_tab| is
+off.
+
+A literal <Tab> key can always be entered by using CTRL-V before <Tab> (see
+|i_CTRL-V|).
+
+Partial sequence recognition triggers auto-completion (performed as if the
+`longest` setting was used in 'completeopt') and shows a menu of suggestions
+together with their corresponding Unicode symbol (provided the `menu` setting
+is included in 'completeopt', and more then one match is found). So for
+example, entering `\al` and pressing <Tab> will result in the following list:
+>
+    +-------------+
+    | \aleph    ℵ |
+    | \allequal ≌ |
+    | \alpha    α |
+    +-------------+
+>
+Then, pressing `p` will reduce the list to `\alpha`, pressing <Tab> will
+complete it and pressing <Tab> again will perform the substitution.
+
+The completion menu can be disbled, and this will happen automatically if a
+plug-in which is known to be incompatible with this feature is detected: see
+|g:latex_to_unicode_suggestions|.
+
+Some LaTeX sequences can be valid both as they are and as partial matches for
+other sequences, e.g. `\ne` is associated with `≠`, but it is also a partial
+match for `\nequiv` (`≢`). By default, if <Tab> finds an exact match it performs
+the substitution, but this can be controlled by the |g:latex_to_unicode_eager|
+setting.
+
+Command-line mode                                      *julia-vim-L2U-cmdmode*
+
+In |Command-line| mode, the behavior is largely the same except that both
+<Tab> and <S-Tab> are mapped by default, and the functionality is slightly
+more limited. No suggestions are shown for partial completions. Pre-existing
+user-defined mappings of <Tab> are overridden. In order to avoid that, the
+completion can be mapped onto a defferent key combination, see
+|g:latex_to_unicode_cmd_mapping|. When using <Tab>, if no matches are found
+the behavior falls back to the standard Vim command-line completion.
+
+Vim versions lower than 7.4                     *julia-vim-L2U-workaround*
+
+The <Tab> key remapping is not performed by default with Vim versions lower
+than 7.4. However, the functionality is still available via user-defined
+completion, which is accessible by the CTRL-X CTRL-U key combination. You
+can map some other key combination to this by adding something like
+>
+  inoremap <C-Tab> <C-X><C-U>
+<
+in your |.vimrc| file. If you'd map <Tab> directly, then you'd need to use
+CTRL-V <Tab> to insert a literal <Tab>.
+
+The settings |g:latex_to_unicode_eager| and |g:latex_to_unicode_suggestions|
+are still meaningful in this case.
+
+------------------------------------------------------------------------------
+LATEX TO UNICODE AS YOU TYPE                    *julia-vim-L2U-as-you-type*
+
+This feature is disabled by default, see |g:latex_to_unicode_auto|, and it is
+only available with Vim version 7.4 or higher. It consists in substituting
+valid LaTeX sequences with Unicode symbols automatically as the typing
+progresses, as soon as the sequences is unambiguously complete. For example,
+when typing:
+>
+    \chi\^2 = 1
+<
+The result is
+>
+    χ² = 1
+<
+The `\chi` is substituted right when the second backslash is entered, and the
+`\^2` is substituted when the following space is entered, before the equal
+sign.
+
+This feature does not currently work with emojis.
+
+This feature does not interfere with the <Tab> based substitution.
+
+------------------------------------------------------------------------------
+LATEX TO UNICODE VIA KEYMAP                          *julia-vim-L2U-keymap*
+
+This method is somewhat similar to the as-you-type one described above, but it
+uses |keymap| to generate the mappings. This has the advantage that it works
+in more circumstances, e.g. in |Command-line| mode or when searching within a
+line with |f| or |t| (since it uses |language-mapping| underneath). It can
+also be easily turned on or off like any other keymap (see |i_CTRL-^| and
+|c_CTRL-^|). Like the as-you-type feature, it doesn't work with emojis.
+The disadvantage is that you don't see the whole sequence as you're typing
+it, and you can't fix mistakes with backspace, for example.
+Another difference is that there is a |timeout| like for any other mapping.
+
+In order to use this method, set |g:latex_to_unicode_keymap| to `1`.
+You can use it in parallel with the other methods, they don't interfere. For
+example, typing a partial sequence and pressing <Tab> still triggers
+completions and suggestions if |g:latex_to_unicode_tab| is active.
+
+When this feature is active, in insert or replace mode you'll see `(L2U)` in
+the mode indicator. If you use this feature, and you use a GUI, it may also
+be useful to set |lCursor|.
+
+------------------------------------------------------------------------------
+LATEX TO UNICODE ON DIFFERENT FILE TYPES         *julia-vim-L2U-file-types*
+
+By default, the LaTeX-to-Unicode substitutions are only active when editing
+Julia files. However, you can use the variable |g:latex_to_unicode_file_types|
+to specify for which file types this feature is active by default. The
+variable must be set to a string containing a |pattern| (a regular expression)
+which matches the desired file types, or to a list of such patterns. For
+example, to activate the feature on all file types by default, you could put
+this in your |.vimrc| file:
+>
+    let g:latex_to_unicode_file_types = ".*"
+<
+To make it active only on, say, Julia and Lisp files, you could use:
+>
+    let g:latex_to_unicode_file_types = ["julia", "lisp"]
+<
+
+Another option, |g:latex_to_unicode_file_types_blacklist|, can be used to
+exclude certain file types. For example, if you'd wish to enable the feature
+in all cases except for Python and untyped files, you would use:
+>
+    let g:latex_to_unicode_file_types = ".*"
+    let g:latex_to_unicode_file_types_blacklist = ["python", ""]
+<
+
+NOTE: enabling the functionality will override the |'completefunc'| setting,
+which can be undesirable, and interfere with plug-ins for different file types.
+In any case, the previous |'completefunc'| setting is restored when the
+functionality is disabled, see |julia-vim-L2U-enable-disable|.
+
+------------------------------------------------------------------------------
+ENABLING AND DISABLING LATEX TO UNICODE      *julia-vim-L2U-enable-disable*
+
+The LaTeX-to-Unicode functionality can be enabled or disabled at any time,
+regardless of the |'filetype'| of the file you're editing, using the functions
+|LaTeXtoUnicode#Enable()|, |LaTeXtoUnicode#Disable()|, |LaTeXtoUnicode#Toggle()|.
+For example, you could use a mapping like:
+>
+    noremap <expr> <F7> LaTeXtoUnicode#Toggle()
+    noremap! <expr> <F7> LaTeXtoUnicode#Toggle()
+<
+and then use the <F7> key to quickly switch the functionality on and off as
+needed (see |noremap| and |noremap!|).
+
+NOTE: these functions are different from the variables |g:latex_to_unicode_tab|,
+|g:latex_to_unicode_auto| and |g:latex_to_unicode_keymap|: the functions
+enable/disable the functionality as a whole, while the variables control
+individual features (tab, auto and keymap substitution).
+
+==============================================================================
+VARIABLES                                         *julia-vim-L2U-variables*
+
+                                                   *g:latex_to_unicode_tab*
+g:latex_to_unicode_tab
+
+                A string that determines whether to map LaTeX-to-Unicode
+                substitution to the <Tab> key while in |Insert| and |Command-line|
+                modes, see |julia-vim-L2U-tab|. If unspecified, it is `"on"`,
+                meaning it is active in both insert and command-line modes.
+                You can set it to the value `"command"` or `"cmd"` to only
+                activate it in command-line mode. Or you can set it to
+                `"insert"` or `"ins"` to only have the insert mode mapping. Set it
+                to `"off"` or any other value to disable this feature entirely.
+                So for example you can disable the feature for insert mode by
+                adding the line
+>
+                    let g:latex_to_unicode_tab = "command"
+<
+                in your |.vimrc| file. You can change this setting at any moment
+                while editing, but you need to invoke |LaTeXtoUnicode#Init()|
+                for the change to take effect.
+
+                                           *g:latex_to_unicode_suggestions*
+g:latex_to_unicode_suggestions
+
+                Determines whether the <Tab> key mapping produces suggestions
+                for partial matches. By default, this is set to `1` (active),
+                unless a plug-in which is known to be incompatible with it is
+                detected. Currently, known incompatible plug-ins are
+                YouCompleteMe (https://github.com/Valloric/YouCompleteMe),
+                neocomplcache (https://github.com/Shougo/neocomplcache.vim),
+                neocomplete (https://github.com/Shougo/neocomplete.vim) and
+                deoplete (https://github.com/Shougo/deoplete.nvim),
+
+                This variable can be set at any time, changes will immediately
+                take effect.
+
+                                                 *g:latex_to_unicode_eager*
+g:latex_to_unicode_eager
+
+                Determines whether the <Tab> key mapping performs the
+                substitution immediately upon finding an exact match. By
+                default this setting is set to `1` (active), so that e.g. typing
+                `\ne` and pressing the <Tab> key triggers the substitution. If
+                this variable is set to `0`, an exact match which is also a
+                possible partial match to some other sequence triggers the
+                suggestions menu first, but another <Tab> forces the
+                substitution, so that e.g. typing `\ne` and then <Tab>
+                produces a list with `\ne`, `\neg`, `\nequiv` etc., and
+                pressing <Tab> again performs the substitution.
+
+                This variable can be set at any time, changes will immediately
+                take effect. When |g:latex_to_unicode_suggestions| is `0`,
+                this setting has no effect (it's like if it was always on).
+
+                                                  *g:latex_to_unicode_auto*
+g:latex_to_unicode_auto
+
+                Determines whether to activate LaTeX-to-Unicode substitution
+                on the fly as you type (in |Insert| mode), see
+                |julia-vim-L2U-as-you-type|. If unspecified, it is `0` (off).
+                You can enable the feature by default by inserting the line
+>
+                    let g:latex_to_unicode_auto = 1
+<
+                in your |.vimrc| file. You can change this setting at any
+                moment while editing, but you need to invoke
+                |LaTeXtoUnicode#Init()| for the change to take effect.
+
+
+                                                *g:latex_to_unicode_keymap*
+g:latex_to_unicode_keymap
+
+                Determines whether to activate the |keymap|-based
+                LaTeX-to-Unicode substitutions, see |julia-vim-L2U-keymap|.
+                If unspecified, it is `0` (off). You can enable the feature by
+                default by inserting the line
+>
+                    let g:latex_to_unicode_keymap = 1
+<
+                in your |.vimrc| file. You can change this setting at any
+                moment while editing, but you need to invoke
+                |LaTeXtoUnicode#Init()| for the change to take effect.
+
+                                            *g:latex_to_unicode_file_types*
+g:latex_to_unicode_file_types
+
+                Contains a |pattern|, or a list of patterns, which are matched
+                against the |'filetype'| to determine when to enable the
+                LaTeX-to-Unicode functionality, see |julia-vim-L2U-file-types|.
+                By default, its value is `"julia"`. The patterns provided must
+                match the whole filetype name. See also
+                |g:latex_to_unicode_file_types_blacklist|.
+
+                                  *g:latex_to_unicode_file_types_blacklist*
+g:latex_to_unicode_file_types_blacklist
+
+                Same as |g:latex_to_unicode_file_types|, but acts in reverse:
+                it disables the LaTeX-to-Unicode functionality when the
+                |'filetype'| matches the provided pattern (or any of the
+                patterns if a list is provided). By default, it contains an
+                unmatchable pattern, i.e. it is effectively disabled.
+
+                                           *g:latex_to_unicode_cmd_mapping*
+g:latex_to_unicode_cmd_mapping
+
+                Specifies the mapping (or list of mappings) for the
+                substitution in |Command-line| mode. By default, it is
+                `['<Tab>', '<S-Tab>']`, but it can be changed to avoid
+                overriding other user-defined mappings, e.g. to `'<S-Tab>'`
+                (if your terminal suppoorts it) or `'<C-\><Tab>'`.
+                The `'<Tab>'` (or to be more precise the |wildchar| key) and
+                `'<S-Tab>'` mappings are special in that they fall back to
+                performing default Vim completions in case no suitable
+                substitutions are found.
+
+==============================================================================
+FUNCTIONS                                         *julia-vim-L2U-functions*
+
+                                                    *LaTeXtoUnicode#Init()*
+LaTeXtoUnicode#Init()
+
+                Initialize or re-initialize the LaTeX-to-Unicode substitutions
+                (see |julia-vim-L2U-introduction|). Must be invoked after
+                changing |g:latex_to_unicode_tab| or |g:latex_to_unicode_auto|
+                to make the changes take effect.
+
+                                                  *LaTeXtoUnicode#Enable()*
+                                                 *LaTeXtoUnicode#Disable()*
+                                                  *LaTeXtoUnicode#Toggle()*
+LaTeXtoUnicode#Enable()
+LaTeXtoUnicode#Disable()
+LaTeXtoUnicode#Toggle()
+
+                These functions enable/disable/toggle the LaTeX-to-Unicode
+                functionality, regardless of the |'filetype'| specified in
+                |g:latex_to_unicode_file_types| and
+                |g:latex_to_unicode_file_types_blacklist|. See
+                |julia-vim-L2U-enable-disable|. Note that LaTeXtoUnicode#Enable()
+                will override the |'completefunc'| definition, if present.
+                However, LaTeXtoUnicode#Disable() will restore it.
+                These functions implicitly invoke |LaTeXtoUnicode#Init()|.
+
+
+ vim:tw=78:et:ft=help:norl:
Index: /issm/trunk/externalpackages/vim/addons/vim/doc/julia-vim.txt
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/doc/julia-vim.txt	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/doc/julia-vim.txt	(revision 26744)
@@ -0,0 +1,505 @@
+*julia-vim.txt*  Support for Julia in Vim
+
+Author:  Carlo Baldassi <carlobaldassi@gmail.com>
+License: MIT license  {{{
+    Permission is hereby granted, free of charge, to any person obtaining
+    a copy of this software and associated documentation files (the
+    "Software"), to deal in the Software without restriction, including
+    without limitation the rights to use, copy, modify, merge, publish,
+    distribute, sublicense, and/or sell copies of the Software, and to
+    permit persons to whom the Software is furnished to do so, subject to
+    the following conditions:
+    The above copyright notice and this permission notice shall be included
+    in all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+}}}
+
+CONTENTS					*julia-vim*
+
+Introduction	                    |julia-vim-introduction|
+Block-wise movements/objects        |julia-vim-blocks|
+  Keyword-oriented movements        |julia-vim-blocks-move|
+  Block-oriented movements          |julia-vim-blocks-moveblock|
+  Block text objects                |julia-vim-blocks-objects|
+  Variables                         |julia-vim-blocks-variables|
+Referring to documents              |julia-vim-doc|
+Extras                              |julia-vim-extras|
+Customizations                      |julia-vim-options|
+Extra syntax colors                 |julia-vim-extra-colors|
+About                               |julia-vim-about|
+
+==============================================================================
+INTRODUCTION                                       *julia-vim-introduction*
+
+The julia-vim plug-in provides:
+  - basic support for editing Julia files (automatic filetype detection,
+    indentation, syntax highlighting)
+  - support for the |matchit| plugin
+  - support for Julia block-wise movements (i.e. jumping around between
+    Julia blocks like if/end, function/end etc.) and block text-objects
+  - facilities for conversion of LaTeX entries to Unicode symbols which mimic
+    and extend what the Julia REPL and the IJulia notebook interface do.
+    Optionally, this functionality can be used with all file types, not
+    just Julia files. See |julia-vim-L2U|.
+  - a keymapping |K| to refer julia documents.
+
+This help file documents: 1) the block-wise movements and objects, how they
+work and what variables can be used to enable/disable/tweak them; 2) The
+documentation lookup facility; 3) Some extra functions and customization
+options.
+The LaTeX-to-Unicode facilities are documented in |julia-vim-L2U|.
+
+==============================================================================
+BLOCK-WISE MOVEMENTS AND BLOCK TEXT OBJECTS              *julia-vim-blocks*
+
+In Julia, all blocks start with a keyword (`module`, `function`, `if`, `for`,
+`while`, `type`, etc.) and end with the `end` keyword.
+
+This plug-in adds support for the |matchit| plugin, such that pressing |%| while
+on a block keyword will jump to the other keywords pertaining to the same
+block. For example, if the cursor is at the beginning of the following code:
+>
+    if a == 1
+      if b > 0
+        println("yes")
+      end
+    else
+      println("no")
+    end
+<
+then pressing |%| will jump to the `else` keyword, pressing it again will jump
+to `end`, and pressing it again will go back to the first `if`.
+
+Note that the matchit plugin is normally distributed with ViM, but it is
+disabled by default. To enable it, add this line to your |.vimrc| file:
+>
+    runtime macros/matchit.vim
+<
+The julia-vim plug-in also adds commands to jump around block keywords in
+normal, operator-pending and visual modes (see |vim-modes|). These are somehow
+similar to the |]]| and |]m| mappings when used in C and Java files,
+respectively, but are more powerful. These commands also require that the
+matchit plugin is enabled.
+
+There are two families of block movements, keyword-oriented (see
+|julia-vim-blocks-move|) and block-oriented (see
+|julia-vim-blocks-moveblock|).
+
+Finally, this plug-in also adds block |text-objects| special mappings, so that
+whole blocks can be manipulated as a whole when in visual mode or
+operator-pending mode, see |julia-vim-blocks-objects|.
+
+The block movements and block objects mappings can be collectively disabled,
+see |g:julia_blocks|, and customized, see |g:julia_blocks_mappings|.
+
+NOTE: in all cases, macros at the beginning of a block are considered as part
+of the block itself. For example, in this code:
+>
+    @inbounds for i = 1:5
+      s += v[i]
+    end
+<
+the block begins at `@inbounds`.
+
+------------------------------------------------------------------------------
+KEYWORD-ORIENTED MOVEMENTS                          *julia-vim-blocks-move*
+
+These movements jump to the following/preceding block keyword, and they
+differentiate between begin keywords and end keywords. Some block keywords can
+also be used outside blocks (e.g. `for` in comprehensions, or `end` within
+indexing expressions): these instances are ignored by these commands.
+
+The following movements are provided:
+
+                                      *julia_]j* *julia_]J* *julia_[j* *julia_[J*
+move_n : jumps to the next begin keyword. By default, it is mapped to `]j`.
+move_N : jumps to the next end keyword. By default, it is mapped to `]J`.
+move_p : jumps to the preceding begin keyword. By default, it is mapped to `[j`.
+move_P : jumps to the preceding end keyword. By default, it is mapped to `[J`.
+
+Use |g:julia_blocks_mappings| to customize the mappings.
+
+------------------------------------------------------------------------------
+BLOCK-ORIENTED MOVEMENTS                       *julia-vim-blocks-moveblock*
+
+These movements are like keyword-oriented movements (|julia-vim-blocks-move|),
+except that they ignore nested blocks within the block where the cursor is.
+For example, given the following code (with line annotations):
+>
+    1  while true
+    2    a += 1
+    3    if a > 5
+    4      break
+    5    end
+    6  end
+    7  if b == 2
+    8    return
+    9  end
+<
+if the cursor is on line 2, these movements will ignore the inner
+`if/end` block (lines 3 to 5). You would then be able to jump directly
+to lines 1 (with `[[`), 6 (with `][`), 7 (with `]]`), or 9 (with `2][`).
+
+The following movements are provided:
+
+                                      *julia_]]* *julia_][* *julia_[[* *julia_[]*
+moveblock_n : gets out from the current block (if any) and jumps to the next
+              begin keyword. (Similar to |w| for word movements.) By default,
+              it is mapped to `]]`.
+moveblock_N : jumps to the end of the current block, if any. If the cursor is
+              already at the end of a block, jumps to the end of the following
+              block at the same level of the current one, or at the end of the
+              enclosing block. (Similar to |e| for word movements.) By
+              default, it is mapped to `][`.
+moveblock_p : jumps to the beginning of the current block, if any. If the
+              cursor is already at the beginning of a block, jumps to the
+              beginning of the preceding block at the same level of the
+              current one, or at the beginning of the enclosing block.
+              (Similar to |b| for word movements.) By default, it is mapped to
+              `[[`.
+moveblock_P : gets out from the current block (if any) and jumps to the
+              preceding end keyword. (Similar to |ge| for word movements.)
+              By default, it is mapped to `[]`.
+
+Use |g:julia_blocks_mappings| to customize the mappings.
+
+------------------------------------------------------------------------------
+BLOCK TEXT OBJECTS                               *julia-vim-blocks-objects*
+
+The julia-vim plug-in extends the ViM |text-objects| by defining special
+mappings which allow to operate on blocks as a whole when in visual mode
+or operator-pending mode. The default mappings use `aj` and `ij` to refer to
+these objects.
+For example, given the following code (with line annotations):
+>
+    1  while true
+    2    a += 1
+    3    if a > 5
+    4      break
+    5    end
+    6  end
+<
+if the cursor is on `break` on line 4, pressing `vaj` will select the whole
+inner `if` block (lines 3 to 5), and pressing `aj` again will select the whole
+`while` block (lines 1 to 6). The same effect could have been obtained with a
+counter, i.e. using `v2aj`. If the cursor were initially on line 2, the whole
+`while` block would have been selected with the first `vaj`. Using `daj` would
+delete a block, `caj` would delete it and leave ViM in insert mode, `=aj`
+would indent it, etc.
+Starting from line 2, pressing `vij` wuold only select the inner part of the
+`while` block (lines 2 to 5).
+
+The following mappings are provided:
+
+                                                        *julia_aj* *julia_ij*
+select_a : the block which contains the cursor, including its delimiters.
+           By default, this is mapped to `aj`. Repeated application (e.g.
+           `vajaj`) selects the enclosing blocks. A counter can be used to
+           the same effect as repetition (e.g. `v2aj`).
+select_i : same as select_a, but only selects the lines included between the
+           delimiters. Thus, this does not work with single-line blocks.
+           By default, this is mapped to `ij`. Repeated application (e.g.
+           `vijij`) has no effect, but using a counter has the same effect as
+           using "select_a" and then selecting the inner part of the outermost
+           block. For example, with the default mappings, `v3ij` is the same as
+           `v3ajij`, or `vajajajij`.
+
+Use |g:julia_blocks_mappings| to customize the mappings.
+
+The following auxiliary function is only mapped to normal mode:
+
+                                                           *julia_whereami*
+whereami : this mapping prints the first line of the current block on the
+           command line. If invoked repeatedly, or if given a count, it prints
+           the first line of the enclosing blocks, like `select_a`. If followed
+           by `select_a`, the selection, or operation, will refer to the last
+           block printed. By default, it is not mapped to any key, but a
+           mapping can be easily provided in |g:julia_blocks_mappings|. It is
+           possible to obtain the string, instead of having it printed, by
+           calling the function `julia_blocks#whereami()`. In such case, use
+           the function `julia_blocks#select_reset()` to reset the block
+           nesting level.
+
+------------------------------------------------------------------------------
+VARIABLES                                      *julia-vim-blocks-variables*
+
+                                                           *g:julia_blocks*
+g:julia_blocks
+
+                Determines whether to map block-wise movements and objects. If
+                unspecified, it is on. You can disable the feature by default
+                by inserting the line
+>
+                    let g:julia_blocks = 0
+<
+                in your |.vimrc| file.
+
+                                                  *g:julia_blocks_mappings*
+g:julia_blocks_mappings
+
+                Custom mapping for block-wise movements. This must be a |dict|
+                associating movements to key combinations. Use empty strings
+                to disable individual mappings. The following is equivalent
+                to the default mappings (see |julia-vim-blocks-moveblock|,
+                |julia-vim-blocks-move| and |julia-vim-blocks-objects|):
+>
+                  let g:julia_blocks_mappings = {
+                    \  "move_n" : "]j",
+                    \  "move_N" : "]J",
+                    \  "move_p" : "[j",
+                    \  "move_P" : "[J",
+                    \
+                    \  "moveblock_n" : "]]",
+                    \  "moveblock_N" : "][",
+                    \  "moveblock_p" : "[[",
+                    \  "moveblock_P" : "[]",
+                    \
+                    \  "select_a" : "aj",
+                    \  "select_i" : "ij",
+                    \
+                    \  "whereami" : "",
+                    \  }
+<
+                You can change individual mappings by writing something like
+                this in your |.vimrc| file:
+>
+                  let g:julia_blocks_mappings = {
+                    \  "move_N"   : "]n",
+                    \  "move_P"   : "[n",
+                    \  "whereami" : "<Leader>j",
+                    \  }
+<
+                Or you can disable individual mappings by writing something like
+                this in your |.vimrc| file:
+>
+                  let g:julia_blocks_mappings = {
+                    \  "moveblock_n" : "",
+                    \  "moveblock_p" : "",
+                    \  }
+<
+                All unspecified entries keep their default value.
+
+
+==============================================================================
+REFERRING TO DOCUMENTATION                                  *julia-vim-doc*
+
+                                                              *julia-vim-K*
+K
+        Look up documentation for the keyword under the cursor. If found,
+        a preview window with the documentation is opened.
+
+        This also works for keywords within the opened preview window,
+        allowing effortless browsing of the documentation.
+
+        (This is not really a key mapping, but uses the built-in
+        |keywordprg|-mechanism in vim; see |K| if you're curious).
+
+
+                                                   *<Plug>(JuliaDocPrompt)*
+<Plug>(JuliaDocPrompt)
+        Open a prompt for keyword documentation lookup. If you don't use |?|
+        for backward search, you can use the following to make `?` work like
+        in the Julia REPL:
+>
+        autocmd FileType julia nmap <buffer> ? <Plug>(JuliaDocPrompt)
+<
+        Apply |:augroup| as needed.
+
+
+                                                                *:JuliaDoc*
+:JuliaDoc {keyword}
+        Look up documentation for {keyword}.
+
+
+==============================================================================
+EXTRAS                                                   *julia-vim-extras*
+
+
+                                        *julia#toggle_function_blockassign*
+                                        *julia#function_block2assign*
+                                        *julia#function_assign2block*
+julia#toggle_function_blockassign()
+julia#function_block2assign()
+julia#function_assign2block()
+
+                These functions allow to transform function definitions
+                between block format and assignment format. For example,
+                these two definitions are equivalent:
+>
+                function test(x, y)
+                    x + 2y
+                end
+
+                test(x, y) = x + 2y
+<
+                You can use the function `julia#toggle_function_blockassign()`
+                to switch between the two forms (the cursor needs to be on the
+                first line of the block form). This functionality requires
+                that the |matchit| plugin is loaded. Only three-line function
+                blocks like the one in the example are recognized. When
+                changing the block form into the assignment form, `return`
+                statements are removed; if the result is empty, `nothing` is
+                substituted. Leading macros (e.g. `@inline` or `@compat`) are
+                recognized and preserved by the transformation.
+
+                In order to make this functionality practical, it is advisable
+                to map it to some key combination, e.g.:
+>
+                noremap <Leader>fb :call julia#toggle_function_blockassign()<CR>
+<
+
+==============================================================================
+CUSTOMIZATIONS                                          *julia-vim-options*
+
+The following options allows customizing some aspects of the plugin.
+
+                                             *g:julia_spellcheck_docstrings*
+g:julia_spellcheck_docstrings
+
+                Determines whether to enable spell-checking for docstrings,
+                i.e. triple quoted strings that start in the first column. See
+                |spell|. Default: on (set to `1`).
+
+                                               *g:julia_spellcheck_strings*
+g:julia_spellcheck_strings
+
+                Determines whether to enable spell-checking for all strings.
+                See |spell|. Default: off (set to `0`).
+
+                                              *g:julia_spellcheck_comments*
+g:julia_spellcheck_comments
+
+                Determines whether to enable spell-checking for comments. See
+                |spell|. Default: on (set to `1`).
+
+                                              *g:julia_highlight_operators*
+g:julia_highlight_operators
+
+                Determines whether to apply syntax highlighting to operators.
+                Default: on (set to `1`).
+
+                                              *g:julia_indent_align_import*
+g:julia_indent_align_import
+
+                In a multi-line import/using/export statment, the lines after
+                the first one use some special alignment rules by default,
+                e.g.:
+>
+                import X: one,
+                          two,
+                          three
+                export four,
+                       five,
+                       six
+<
+                When `g:julia_indent_align_import` is `0` instead, the usual
+                indentation is used:
+>
+                import X: one,
+                    two,
+                    three
+                export four,
+                    five,
+                    six
+
+                                              *g:julia_indent_align_brackets*
+g:julia_indent_align_brackets
+
+                In a multi-line bracketed expression (except for function
+                arguments, see |g:julia_indent_align_funcargs|), the lines
+                after the first one use some special alignment rules by
+                default, e.g.:
+>
+                matrix = [1 2 3;
+                          4 5 6]
+                tpl = (
+                       abc = Dict(a=>1,
+                                  b=>2),
+                       def = [1 2;
+                              3 4],
+                       xyz = SubArray{eltype(P),
+                                      N, P, I,
+                                      false}
+                      )
+<
+                When `g:julia_indent_align_brackets` is `0` instead, an extra
+                indent is used:
+>
+                matrix = [1 2 3;
+                    4 5 6]
+                tpl = (
+                    abc = Dict(a=>1,
+                        b=>2),
+                    def = [1 2;
+                        3 4],
+                    xyz = SubArray{eltype(P),
+                        N, P, I,
+                        false}
+                )
+<
+
+                                              *g:julia_indent_align_funcargs*
+g:julia_indent_align_funcargs
+
+                In a function definition, when the arguments span multiple
+                lines, the lines after the first one get an extra indentation
+                step by default, e.g.:
+>
+                function functionanme(
+                        arg1, arg2,
+                        arg3, arg4
+                    )
+                    # function body
+                end
+<
+                By setting `g:julia_indent_align_funcargs` to `1`, the
+                arguments are aligned to the bracket instead (they work as any
+                other bracket with the default value of
+                |g:julia_indent_align_brackets|):
+>
+                function functionanme(arg1, arg2,
+                                      arg3, arg4
+                                     )
+                    # function body
+                end
+<
+==============================================================================
+EXTRA SYNTAX COLORS                                *julia-vim-extra-colors*
+
+Some syntax elements are recognized but not highlighted by default:
+
+  juliaParDelim       parentheses
+  juliaSemicolon      semicolons
+  juliaComma          commas
+  juliaFunctionCall   function calls
+
+In order to highlight them, just use the |hi| command in your configuration
+file. To use existing highlight groups (see |group-name|), you can do e.g.:
+>
+  hi link juliaParDelim Delimiter
+  hi link juliaSemicolon Operator
+  hi link juliaFunctionCall Identifier
+<
+
+The above will use the colors specified by your colorscheme, if defined.
+If you want to define a color manually instead, you can use something like
+this:
+>
+  hi juliaFunctionCall guifg=#AB5033 ctermfg=Red
+<
+
+==============================================================================
+ABOUT                                                     *julia-vim-about*
+
+Grab the latest version or report a bug on GitHub:
+
+http://github.com/JuliaEditorSupport/julia-vim
+
+ vim:tw=78:et:ft=help:norl:
Index: /issm/trunk/externalpackages/vim/addons/vim/ftdetect/julia.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/ftdetect/julia.vim	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/ftdetect/julia.vim	(revision 26744)
@@ -0,0 +1,34 @@
+if v:version < 704
+  " NOTE: this line fixes an issue with the default system-wide lisp ftplugin
+  "       which didn't define b:undo_ftplugin on older Vim versions
+  "       (*.jl files are recognized as lisp)
+  autocmd BufRead,BufNewFile *.jl    let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp<"
+endif
+
+autocmd BufRead,BufNewFile *.jl      set filetype=julia
+
+autocmd FileType *                   call LaTeXtoUnicode#Refresh()
+autocmd BufNew *                     call LaTeXtoUnicode#Refresh()
+autocmd BufEnter *                   call LaTeXtoUnicode#Refresh()
+autocmd CmdwinEnter *                call LaTeXtoUnicode#Refresh()
+
+" This autocommand is used to postpone the first initialization of LaTeXtoUnicode as much as possible,
+" by calling LaTeXtoUnicode#SetTab and LaTeXtoUnicode#SetAutoSub only at InsertEnter or later
+function! s:L2UTrigger()
+  augroup L2UInit
+    autocmd!
+    autocmd InsertEnter *            let g:did_insert_enter = 1 | call LaTeXtoUnicode#Init(0)
+  augroup END
+endfunction
+autocmd BufEnter *                   call s:L2UTrigger()
+
+function! s:HighlightJuliaMarkdown()
+  if !exists('g:markdown_fenced_languages')
+    let g:markdown_fenced_languages = []
+  endif
+  if index(g:markdown_fenced_languages, 'julia') == -1
+    call add(g:markdown_fenced_languages, 'julia')
+  endif
+endfunction
+autocmd BufRead,BufNewFile *.jmd     call s:HighlightJuliaMarkdown()
+autocmd BufRead,BufNewFile *.jmd     set filetype=markdown
Index: /issm/trunk/externalpackages/vim/addons/vim/ftplugin/julia.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/ftplugin/julia.vim	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/ftplugin/julia.vim	(revision 26744)
@@ -0,0 +1,114 @@
+" Vim filetype plugin file
+" Language:	Julia
+" Maintainer:	Carlo Baldassi <carlobaldassi@gmail.com>
+" Last Change:	2014 may 29
+
+if exists("b:did_ftplugin")
+  finish
+endif
+let b:did_ftplugin = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+setlocal include=^\\s*\\%(reload\\\|include\\)\\>
+setlocal suffixesadd=.jl
+setlocal comments=:#
+setlocal commentstring=#=%s=#
+setlocal cinoptions+=#1
+setlocal define=^\\s*macro\\>
+setlocal fo-=t fo+=croql
+
+let b:julia_vim_loaded = 1
+
+let b:undo_ftplugin = "setlocal include< suffixesadd< comments< commentstring<"
+      \ . " define< fo< shiftwidth< expandtab< indentexpr< indentkeys< cinoptions< completefunc<"
+      \ . " | unlet! b:commentary_format"
+      \ . " | unlet! b:smartcomment_force_linemode"
+      \ . " | unlet! b:julia_vim_loaded"
+
+" MatchIt plugin support
+if exists("loaded_matchit")
+  let b:match_ignorecase = 0
+
+  " note: begin_keywords must contain all blocks, in order
+  " for nested-structures-skipping to work properly
+  " note: 'mutable struct' and 'struct' are defined separately because
+  " using \? puts the cursor on 'struct' instead of 'mutable' for some reason
+  let b:julia_begin_keywords = '\%(\.\s*\|@\)\@<!\<\%(function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|let\|do\|\%(bare\)\?module\|quote\|if\|for\|while\|try\)\>'
+  " note: the following regex not only recognizes macros, but also local/global keywords.
+  " the purpose is recognizing things like `@inline myfunction()`
+  " or `global myfunction(...)` etc, for matchit and block movement functionality
+  let s:macro_regex = '\%(@\%([#(]\@!\S\)\+\|\<\%(local\|global\)\)\s\+'
+  let s:nomacro = '\%(' . s:macro_regex . '\)\@<!'
+  let s:yesmacro = s:nomacro . '\%('. s:macro_regex . '\)\+'
+  let b:julia_begin_keywordsm = '\%(' . s:yesmacro . b:julia_begin_keywords . '\)\|'
+        \ . '\%(' . s:nomacro . b:julia_begin_keywords . '\)'
+  let b:julia_end_keywords = '\<end\>'
+
+  " note: this function relies heavily on the syntax file
+  function! JuliaGetMatchWords()
+    let [l,c] = [line('.'),col('.')]
+    let attr = synIDattr(synID(l, c, 1),"name")
+    let c1 = c
+    while attr == 'juliaMacro' || expand('<cword>') =~# '\<\%(global\|local\)\>'
+      normal! W
+      if line('.') > l || col('.') == c1
+        call cursor(l, c)
+        return ''
+      endif
+      let attr = synIDattr(synID(l, col('.'), 1),"name")
+      let c1 = col('.')
+    endwhile
+    call cursor(l, c)
+    if attr == 'juliaConditional'
+      return b:julia_begin_keywordsm . ':\<\%(elseif\|else\)\>:' . b:julia_end_keywords
+    elseif attr =~# '\<\%(juliaRepeat\|juliaRepKeyword\)\>'
+      return b:julia_begin_keywordsm . ':\<\%(break\|continue\)\>:' . b:julia_end_keywords
+    elseif attr == 'juliaBlKeyword'
+      return b:julia_begin_keywordsm . ':' . b:julia_end_keywords
+    elseif attr == 'juliaException'
+      return b:julia_begin_keywordsm . ':\<\%(catch\|finally\)\>:' . b:julia_end_keywords
+    endif
+    return '\<\>:\<\>'
+  endfunction
+
+  let b:match_words = 'JuliaGetMatchWords()'
+
+  " we need to skip everything within comments, strings and
+  " the 'begin' and 'end' keywords when they are used as a range rather than as
+  " the delimiter of a block
+  let b:match_skip = 'synIDattr(synID(line("."),col("."),0),"name") =~# '
+        \ . '"\\<julia\\%(Comprehension\\%(For\\|If\\)\\|RangeKeyword\\|Comment\\%([LM]\\|Delim\\)\\|\\%([bs]\\|Shell\\|Printf\\|Doc\\)\\?String\\|StringPrefixed\\|DocStringM\\(Raw\\)\\?\\|RegEx\\|SymbolS\\?\\|Dotted\\)\\>"'
+
+  let b:undo_ftplugin = b:undo_ftplugin
+        \ . " | unlet! b:match_words b:match_skip b:match_ignorecase"
+        \ . " | unlet! b:julia_begin_keywords b:julia_end_keywords"
+        \ . " | delfunction JuliaGetMatchWords"
+
+  if get(g:, "julia_blocks", 1)
+    call julia_blocks#init_mappings()
+    let b:undo_ftplugin .= " | call julia_blocks#remove_mappings()"
+  endif
+
+endif
+
+" Some plugin-specific tweaks for commenting
+let b:commentary_format = "# %s"           " for tpope/vim-commentary
+let b:smartcomment_force_linemode = 1      " for carlobaldassi/vim-smartcomment
+
+if has("gui_win32")
+  let b:browsefilter = "Julia Source Files (*.jl)\t*.jl\n"
+  let b:undo_ftplugin = b:undo_ftplugin . " | unlet! b:browsefilter"
+endif
+
+" Lookup documents
+nnoremap <silent><buffer> <Plug>(JuliaDocPrompt) :<C-u>call julia#doc#prompt()<CR>
+command! -nargs=1 -buffer -complete=customlist,julia#doc#complete JuliaDoc call julia#doc#open(<q-args>)
+command! -nargs=1 -buffer JuliaDocKeywordprg call julia#doc#keywordprg(<q-args>)
+setlocal keywordprg=:JuliaDocKeywordprg
+let b:undo_ftplugin .= " | setlocal keywordprg<"
+let b:undo_ftplugin .= " | delcommand JuliaDoc | delcommand JuliaDocKeywordprg"
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
Index: /issm/trunk/externalpackages/vim/addons/vim/ftplugin/juliadoc.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/ftplugin/juliadoc.vim	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/ftplugin/juliadoc.vim	(revision 26744)
@@ -0,0 +1,30 @@
+" Vim filetype plugin file
+" Language: Julia document
+
+if exists("b:did_ftplugin")
+  finish
+endif
+let b:did_ftplugin = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+setlocal conceallevel=2
+setlocal concealcursor=nc
+setlocal wrap
+
+if !exists('b:undo_ftplugin')
+  let b:undo_ftplugin = ''
+endif
+let b:undo_ftplugin .= 'setlocal conceallevel< concealcursor< wrap<'
+
+" Lookup documents
+nnoremap <silent><buffer> <Plug>(JuliaDocPrompt) :<C-u>call julia#doc#prompt()<CR>
+command! -nargs=1 -buffer -complete=customlist,julia#doc#complete JuliaDoc call julia#doc#open(<q-args>)
+command! -nargs=1 -buffer JuliaDocKeywordprg call julia#doc#keywordprg(<q-args>)
+setlocal keywordprg=:JuliaDocKeywordprg
+let b:undo_ftplugin .= " | setlocal keywordprg<"
+let b:undo_ftplugin .= " | delcommand JuliaDoc | delcommand JuliaDocKeywordprg"
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
Index: /issm/trunk/externalpackages/vim/addons/vim/indent/julia.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/indent/julia.vim	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/indent/julia.vim	(revision 26744)
@@ -0,0 +1,490 @@
+" Vim indent file
+" Language:	Julia
+" Maintainer:	Carlo Baldassi <carlobaldassi@gmail.com>
+" Last Change:	2016 jun 16
+" Notes:        originally based on Bram Molenaar's indent file for vim
+
+setlocal autoindent
+
+setlocal indentexpr=GetJuliaIndent()
+setlocal indentkeys+==end,=else,=catch,=finally,),],}
+setlocal indentkeys-=0#
+setlocal indentkeys-=:
+setlocal indentkeys-=0{
+setlocal indentkeys-=0}
+setlocal nosmartindent
+
+" Only define the function once.
+if exists("*GetJuliaIndent")
+  finish
+endif
+
+let s:skipPatternsBasic = '\<julia\%(Comment\%([LM]\|Delim\)\)\>'
+let s:skipPatterns = '\<julia\%(Comprehension\%(For\|If\)\|RangeKeyword\|Comment\%([LM]\|Delim\)\|\%([bs]\|Shell\|Printf\|Doc\)\?String\|StringPrefixed\|DocStringM\(Raw\)\?\|RegEx\|SymbolS\?\|Macro\|Dotted\)\>'
+
+function JuliaMatch(lnum, str, regex, st, ...)
+  let s = a:st
+  let e = a:0 > 0 ? a:1 : -1
+  let basic_skip = a:0 > 1 ? a:2 : 'all'
+  let skip = basic_skip ==# 'basic' ? s:skipPatternsBasic : s:skipPatterns
+  while 1
+    let f = match(a:str, '\C' . a:regex, s)
+    if e >= 0 && f >= e
+      return -1
+    endif
+    if f >= 0
+      let attr = synIDattr(synID(a:lnum,f+1,1),"name")
+      let attrT = synIDattr(synID(a:lnum,f+1,0),"name")
+      if attr =~# skip || attrT =~# skip
+        let s = f+1
+        continue
+      endif
+    endif
+    break
+  endwhile
+  return f
+endfunction
+
+function GetJuliaNestingStruct(lnum, ...)
+  " Auxiliary function to inspect the block structure of a line
+  let line = getline(a:lnum)
+  let s = a:0 > 0 ? a:1 : 0
+  let e = a:0 > 1 ? a:2 : -1
+  let blocks_stack = []
+  let num_closed_blocks = 0
+  while 1
+    let fb = JuliaMatch(a:lnum, line, '\<\%(if\|else\%(if\)\?\|while\|for\|try\|catch\|finally\|\%(staged\)\?function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|let\|\%(bare\)\?module\|quote\|do\)\>', s, e)
+    let fe = JuliaMatch(a:lnum, line, '\<end\>', s, e)
+
+    if fb < 0 && fe < 0
+      " No blocks found
+      break
+    end
+
+    if fb >= 0 && (fb < fe || fe < 0)
+      " The first occurrence is an opening block keyword
+      " Note: some keywords (elseif,else,catch,finally) are both
+      "       closing blocks and opening new ones
+
+      let i = JuliaMatch(a:lnum, line, '\<if\>', s)
+      if i >= 0 && i == fb
+        let s = i+1
+        call add(blocks_stack, 'if')
+        continue
+      endif
+      let i = JuliaMatch(a:lnum, line, '\<elseif\>', s)
+      if i >= 0 && i == fb
+        let s = i+1
+        if len(blocks_stack) > 0 && blocks_stack[-1] == 'if'
+          let blocks_stack[-1] = 'elseif'
+        elseif (len(blocks_stack) > 0 && blocks_stack[-1] != 'elseif') || len(blocks_stack) == 0
+          call add(blocks_stack, 'elseif')
+          let num_closed_blocks += 1
+        endif
+        continue
+      endif
+      let i = JuliaMatch(a:lnum, line, '\<else\>', s)
+      if i >= 0 && i == fb
+        let s = i+1
+        if len(blocks_stack) > 0 && blocks_stack[-1] =~# '\<\%(else\)\=if\>'
+          let blocks_stack[-1] = 'else'
+        else
+          call add(blocks_stack, 'else')
+          let num_closed_blocks += 1
+        endif
+        continue
+      endif
+
+      let i = JuliaMatch(a:lnum, line, '\<try\>', s)
+      if i >= 0 && i == fb
+        let s = i+1
+        call add(blocks_stack, 'try')
+        continue
+      endif
+      let i = JuliaMatch(a:lnum, line, '\<catch\>', s)
+      if i >= 0 && i == fb
+        let s = i+1
+        if len(blocks_stack) > 0 && blocks_stack[-1] == 'try'
+          let blocks_stack[-1] = 'catch'
+        else
+          call add(blocks_stack, 'catch')
+          let num_closed_blocks += 1
+        endif
+        continue
+      endif
+      let i = JuliaMatch(a:lnum, line, '\<finally\>', s)
+      if i >= 0 && i == fb
+        let s = i+1
+        if len(blocks_stack) > 0 && (blocks_stack[-1] == 'try' || blocks_stack[-1] == 'catch')
+          let blocks_stack[-1] = 'finally'
+        else
+          call add(blocks_stack, 'finally')
+          let num_closed_blocks += 1
+        endif
+        continue
+      endif
+
+      let i = JuliaMatch(a:lnum, line, '\<\%(bare\)\?module\>', s)
+      if i >= 0 && i == fb
+        let s = i+1
+        if i == 0
+          call add(blocks_stack, 'col1module')
+        else
+          call add(blocks_stack, 'other')
+        endif
+        continue
+      endif
+
+      let i = JuliaMatch(a:lnum, line, '\<\%(while\|for\|function\|macro\|begin\|\%(mutable\s\+\)\?struct\|\%(abstract\|primitive\)\s\+type\|let\|quote\|do\)\>', s)
+      if i >= 0 && i == fb
+        if match(line, '\C\<\%(mutable\|abstract\|primitive\)', i) != -1
+          let s = i+11
+        else
+          let s = i+1
+        endif
+        call add(blocks_stack, 'other')
+        continue
+      endif
+
+      " Note: it should be impossible to get here
+      break
+
+    else
+      " The first occurrence is an 'end'
+
+      let s = fe+1
+      if len(blocks_stack) == 0
+        let num_closed_blocks += 1
+      else
+        call remove(blocks_stack, -1)
+      endif
+      continue
+
+    endif
+
+    " Note: it should be impossible to get here
+    break
+  endwhile
+  let num_open_blocks = len(blocks_stack) - count(blocks_stack, 'col1module')
+  return [num_open_blocks, num_closed_blocks]
+endfunction
+
+function GetJuliaNestingBrackets(lnum, c)
+  " Auxiliary function to inspect the brackets structure of a line
+  let line = getline(a:lnum)[0 : (a:c - 1)]
+  let s = 0
+  let brackets_stack = []
+  let last_closed_bracket = -1
+  while 1
+    let fb = JuliaMatch(a:lnum, line, '[([{]', s)
+    let fe = JuliaMatch(a:lnum, line, '[])}]', s)
+
+    if fb < 0 && fe < 0
+      " No brackets found
+      break
+    end
+
+    if fb >= 0 && (fb < fe || fe < 0)
+      " The first occurrence is an opening bracket
+
+      let i = JuliaMatch(a:lnum, line, '(', s)
+      if i >= 0 && i == fb
+        let s = i+1
+        call add(brackets_stack, ['par',i])
+        continue
+      endif
+
+      let i = JuliaMatch(a:lnum, line, '\[', s)
+      if i >= 0 && i == fb
+        let s = i+1
+        call add(brackets_stack, ['sqbra',i])
+        continue
+      endif
+
+      let i = JuliaMatch(a:lnum, line, '{', s)
+      if i >= 0 && i == fb
+        let s = i+1
+        call add(brackets_stack, ['curbra',i])
+        continue
+      endif
+
+      " Note: it should be impossible to get here
+      break
+
+    else
+      " The first occurrence is a closing bracket
+
+      let i = JuliaMatch(a:lnum, line, ')', s)
+      if i >= 0 && i == fe
+        let s = i+1
+        if len(brackets_stack) > 0 && brackets_stack[-1][0] == 'par'
+          call remove(brackets_stack, -1)
+        else
+          let last_closed_bracket = i + 1
+        endif
+        continue
+      endif
+
+      let i = JuliaMatch(a:lnum, line, ']', s)
+      if i >= 0 && i == fe
+        let s = i+1
+        if len(brackets_stack) > 0 && brackets_stack[-1][0] == 'sqbra'
+          call remove(brackets_stack, -1)
+        else
+          let last_closed_bracket = i + 1
+        endif
+        continue
+      endif
+
+      let i = JuliaMatch(a:lnum, line, '}', s)
+      if i >= 0 && i == fe
+        let s = i+1
+        if len(brackets_stack) > 0 && brackets_stack[-1][0] == 'curbra'
+          call remove(brackets_stack, -1)
+        else
+          let last_closed_bracket = i + 1
+        endif
+        continue
+      endif
+
+      " Note: it should be impossible to get here
+      break
+
+    endif
+
+    " Note: it should be impossible to get here
+    break
+  endwhile
+  let first_open_bracket = -1
+  let last_open_bracket = -1
+  let infuncargs = 0
+  if len(brackets_stack) > 0
+    let first_open_bracket = brackets_stack[0][1]
+    let last_open_bracket = brackets_stack[-1][1]
+    if brackets_stack[-1][0] == 'par' && IsFunctionArgPar(a:lnum, last_open_bracket+1)
+      let infuncargs = 1
+    endif
+  endif
+  return [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs]
+endfunction
+
+let s:bracketBlocks = '\<julia\%(\%(\%(Printf\)\?Par\|SqBra\%(Idx\)\?\|CurBra\)Block\|ParBlockInRange\|StringVars\%(Par\|SqBra\|CurBra\)\|Dollar\%(Par\|SqBra\)\|QuotedParBlockS\?\)\>'
+
+function IsInBrackets(lnum, c)
+  let stack = map(synstack(a:lnum, a:c), 'synIDattr(v:val, "name")')
+  call filter(stack, 'v:val =~# s:bracketBlocks')
+  return len(stack) > 0
+endfunction
+
+function IsInDocString(lnum)
+  let stack = map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")')
+  call filter(stack, 'v:val =~# "\\<juliaDocString\\(Delim\\|M\\\(Raw\\)\\?\\)\\?\\>"')
+  return len(stack) > 0
+endfunction
+
+function IsInContinuationImportLine(lnum)
+  let stack = map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")')
+  call filter(stack, 'v:val =~# "\\<juliaImportLine\\>"')
+  if len(stack) == 0
+    return 0
+  endif
+  return JuliaMatch(a:lnum, getline(a:lnum), '\<\%(import\|using\|export\)\>', indent(a:lnum)) == -1
+endfunction
+
+function IsFunctionArgPar(lnum, c)
+  if a:c == 0
+    return 0
+  endif
+  let stack = map(synstack(a:lnum, a:c-1), 'synIDattr(v:val, "name")')
+  return len(stack) >= 2 && stack[-2] ==# 'juliaFunctionDef'
+endfunction
+
+function JumpToMatch(lnum, last_closed_bracket)
+  " we use the % command to skip back (tries to ues matchit if possible,
+  " otherwise resorts to vim's default, which is buggy but better than
+  " nothing)
+  call cursor(a:lnum, a:last_closed_bracket)
+  let percmap = maparg("%", "n") 
+  if exists("g:loaded_matchit") && percmap =~# 'Match\%(it\|_wrapper\)'
+    normal %
+  else
+    normal! %
+  end
+endfunction
+
+" Auxiliary function to find a line which does not start in the middle of a
+" multiline bracketed expression, to be used as reference for block
+" indentation.
+function LastBlockIndent(lnum)
+  let lnum = a:lnum
+  let ind = 0
+  while lnum > 0
+    let ind = indent(lnum)
+    if ind == 0
+      return [lnum, 0]
+    endif
+    if !IsInBrackets(lnum, 1)
+      break
+    endif
+    let lnum = prevnonblank(lnum - 1)
+  endwhile
+  return [max([lnum,1]), ind]
+endfunction
+
+function GetJuliaIndent()
+  " Do not alter doctrings indentation
+  if IsInDocString(v:lnum)
+    return -1
+  endif
+
+  " Find a non-blank line above the current line.
+  let lnum = prevnonblank(v:lnum - 1)
+
+  " At the start of the file use zero indent.
+  if lnum == 0
+    return 0
+  endif
+
+  let ind = -1
+  let st = -1
+  let lim = -1
+
+  " Multiline bracketed expressions take precedence
+  let align_brackets = get(g:, "julia_indent_align_brackets", 1)
+  let align_funcargs = get(g:, "julia_indent_align_funcargs", 0)
+  let c = len(getline(lnum)) + 1
+  while IsInBrackets(lnum, c)
+    let [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs] = GetJuliaNestingBrackets(lnum, c)
+
+    " First scenario: the previous line has a hanging open bracket:
+    " set the indentation to match the opening bracket (plus an extra space)
+    " unless we're in a function arguments list or alignment is disabled, in
+    " which case we just add an extra indent
+    if last_open_bracket != -1
+      if (!infuncargs && align_brackets) || (infuncargs && align_funcargs)
+        let st = last_open_bracket
+        let ind = virtcol([lnum, st + 1])
+      else
+        let ind = indent(lnum) + shiftwidth()
+      endif
+
+    " Second scenario: some multiline bracketed expression was closed in the
+    " previous line. But since we know we are still in a bracketed expression,
+    " we need to find the line where the bracket was opened
+    elseif last_closed_bracket != -1
+      call JumpToMatch(lnum, last_closed_bracket)
+      if line(".") == lnum
+        " something wrong here, give up
+        let ind = indent(lnum)
+      else
+        let lnum = line(".")
+        let c = col(".") - 1
+        if c == 0
+          " uhm, give up
+          let ind = 0
+        else
+          " we skipped a bracket set, keep searching for an opening bracket
+          let lim = c
+          continue
+        endif
+      endif
+
+    " Third scenario: nothing special: keep the indentation
+    else
+      let ind = indent(lnum)
+    endif
+
+    " Does the current line start with a closing bracket? Then depending on
+    " the situation we align it with the opening one, or we let the rest of
+    " the code figure it out (the case in which we're closing a function
+    " argument list is special-cased)
+    if JuliaMatch(v:lnum, getline(v:lnum), '[])}]', indent(v:lnum)) == indent(v:lnum) && ind > 0
+      if !align_brackets && !align_funcargs
+        call JumpToMatch(v:lnum, indent(v:lnum))
+        return indent(line("."))
+      elseif (align_brackets && getline(v:lnum)[indent(v:lnum)] != ')') || align_funcargs
+        return ind - 1
+      else " must be a ')' and align_brackets==1 and align_funcargs==0
+        call JumpToMatch(v:lnum, indent(v:lnum))
+        if IsFunctionArgPar(line("."), col("."))
+          let ind = -1
+        else
+          return ind - 1
+        endif
+      endif
+    endif
+
+    break
+  endwhile
+
+  if ind == -1
+    " We are not in a multiline bracketed expression. Thus we look for a
+    " previous line to use as a reference
+    let [lnum,ind] = LastBlockIndent(lnum)
+    let c = len(getline(lnum)) + 1
+    if IsInBrackets(lnum, c)
+      let [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs] = GetJuliaNestingBrackets(lnum, c)
+      let lim = first_open_bracket
+    endif
+  end
+
+  " Analyse the reference line
+  let [num_open_blocks, num_closed_blocks] = GetJuliaNestingStruct(lnum, st, lim)
+  " Increase indentation for each newly opened block in the reference line
+  let ind += shiftwidth() * num_open_blocks
+
+  " Analyse the current line
+  let [num_open_blocks, num_closed_blocks] = GetJuliaNestingStruct(v:lnum)
+  " Decrease indentation for each closed block in the current line
+  let ind -= shiftwidth() * num_closed_blocks
+
+  " Additional special case: multiline import/using/export statements
+
+  let prevline = getline(lnum)
+  " Are we in a multiline import/using/export statement, right below the
+  " opening line?
+  if IsInContinuationImportLine(v:lnum) && !IsInContinuationImportLine(lnum)
+    if get(g:, 'julia_indent_align_import', 1)
+      " if the opening line has a colon followed by non-comments, use it as
+      " reference point
+      let cind = JuliaMatch(lnum, prevline, ':', indent(lnum), lim)
+      if cind >= 0
+        let nonwhiteind = JuliaMatch(lnum, prevline, '\S', cind+1, -1, 'basic')
+        if nonwhiteind >= 0
+          " return match(prevline, '\S', cind+1) " a bit overkill...
+          return cind + 2
+        endif
+      else
+        " if the opening line is not a naked import/using/export statement, use
+        " it as reference
+        let iind = JuliaMatch(lnum, prevline, '\<import\|using\|export\>', indent(lnum), lim)
+        if iind >= 0
+          " assuming whitespace after using... so no `using(XYZ)` please!
+          let nonwhiteind = JuliaMatch(lnum, prevline, '\S', iind+6, -1, 'basic')
+          if nonwhiteind >= 0
+            return match(prevline, '\S', iind+6)
+          endif
+        endif
+      endif
+    endif
+    let ind += shiftwidth()
+
+  " Or did we just close a multiline import/using/export statement?
+  elseif !IsInContinuationImportLine(v:lnum) && IsInContinuationImportLine(lnum)
+    " find the starting line of the statement
+    let ilnum = 0
+    for iln in range(lnum-1, 1, -1)
+      if !IsInContinuationImportLine(iln)
+        let ilnum = iln
+        break
+      endif
+    endfor
+    if ilnum == 0
+      " something went horribly wrong, give up
+      let ind = indent(lnum)
+    endif
+    let ind = indent(ilnum)
+  endif
+
+  return ind
+endfunction
Index: /issm/trunk/externalpackages/vim/addons/vim/keymap/generate_L2U_keymap.jl
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/keymap/generate_L2U_keymap.jl	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/keymap/generate_L2U_keymap.jl	(revision 26744)
@@ -0,0 +1,137 @@
+#!/bin/env julia
+
+import REPL
+
+const filename = "latex2unicode_utf-8"
+const include_emoji = false # set this to true if you want to keymap empjis as well
+
+# We want to avoid situations in which the user types e.g. \delt and pauses,
+# and the result is "∇t" because "\del" gets recognized and then there is some leftover "t".
+# This allows us to get completions with <Tab> for example.
+function fix_completions(completions::Dict{String,String})
+    allinputs = sort!(collect(keys(completions)))
+    new_completions = copy(completions)
+
+    for input in allinputs
+        chars = completions[input]
+        l = length(input)
+        longer = filter(x->startswith(x, input)&&length(x)>l, allinputs)
+        n = length(longer)
+        n == 0 && continue
+        new_completions[input * "<Tab>"] = chars
+        for other in longer
+            add = other[1:(l+1)]
+            get!(new_completions, add, add)
+        end
+    end
+    return new_completions
+end
+
+function unicode_data()
+    file = normpath(Sys.BINDIR, "..", "..", "doc", "UnicodeData.txt")
+    names = Dict{UInt32, String}()
+    open(file) do unidata
+        for line in readlines(unidata)
+            id, name, desc = split(line, ";")[[1, 2, 11]]
+            codepoint = parse(UInt32, "0x$id")
+            names[codepoint] = (name == "" ? desc : desc == "" ? name : "$name / $desc")
+        end
+    end
+    return names
+end
+
+# Prepend a dotted circle ('◌' i.e. '\u25CC') to combining characters
+function fix_combining_chars(char)
+    cat = Base.Unicode.category_code(char)
+    return string(cat == 6 || cat == 8 ? "◌" : "", char)
+end
+
+function table_entries(completions::Dict{String,String}, unicode_dict)
+    latex = String[]
+    code = String[]
+    unicode = String[]
+    desc = String[]
+
+    for (input, chars) in sort!(collect(completions))
+        code_points, unicode_names, characters = String[], String[], String[]
+        if startswith(chars, "\\")
+            push!(code_points, replace(chars, "\\" => "\\\\"))
+            push!(unicode_names, "(Incomplete sequence)")
+            push!(characters, "")
+        else
+            for char in chars
+                push!(code_points, "<char-0x$(uppercase(string(UInt32(char), base = 16, pad = 5)))>")
+                push!(unicode_names, get(unicode_dict, UInt32(char), "(No Unicode name)"))
+                push!(characters, isempty(characters) ? fix_combining_chars(char) : "$char")
+            end
+        end
+        push!(latex, replace(input, "\\"=>"\\\\"))
+        push!(code, join(code_points))
+        push!(unicode, join(characters))
+        push!(desc, join(unicode_names, " + "))
+    end
+    return latex, code, unicode, desc
+end
+
+open("$filename.vim","w") do f
+    print(f, """
+        " This file is autogenerated from the script '$(basename(Base.source_path()))'
+        " The symbols are based on Julia version $VERSION
+        " The full generating script can be found in the comments at the bottom of this file,
+        " and it can be extracted with:
+        "
+        "     \$ grep '^\">' $filename.vim | cut -c4- > '$(basename(Base.source_path()))'
+        "
+        " To produce this keymap file you need to have Julia compilied from source, and
+        " to run `make deps` inside Julia's `doc` directory.
+        " Then you can run:
+        "
+        "     \$ julia $(basename(Base.source_path()))
+        "
+
+        scriptencoding utf-8
+
+        let b:keymap_name = "L2U"
+        loadkeymap
+
+        """)
+
+    col_headers = ["\" Tab completion sequence", "Code point", "Character", "Unicode name"]
+
+    orig_completions = include_emoji ? merge(
+                REPL.REPLCompletions.latex_symbols,
+                REPL.REPLCompletions.emoji_symbols
+                ) :
+                REPL.REPLCompletions.latex_symbols
+
+    latex, code, unicode, desc =
+        table_entries(
+            fix_completions(orig_completions),
+            unicode_data()
+            )
+
+    lw = max(length(col_headers[3]), maximum(map(length, latex)))
+    cw = max(length(col_headers[1]), maximum(map(length, code)))
+    uw = max(length(col_headers[2]), maximum(map(length, unicode)))
+    dw = max(length(col_headers[4]), maximum(map(length, desc)))
+
+    print_padded(l, c, u, d) = println(f, rpad(l, lw), " ", rpad(c, cw), " \" ", rpad(u, uw), " : ", d)
+
+    print_padded(col_headers...)
+    print_padded("\" " * "-"^(lw-2), "-"^cw, "-"^uw, "-"^dw)
+
+    for (l, c, u, d) in zip(latex, code, unicode, desc)
+        print_padded(l, c, u, d)
+    end
+    print_padded("\" " * "-"^(lw-2), "-"^cw, "-"^uw, "-"^dw)
+
+    print(f, """
+
+        " Below here is the script that was used to produce this file.
+
+        """)
+    for l in readlines(Base.source_path())
+        println(f, "\"> ", l)
+    end
+    println(f)
+end
Index: /issm/trunk/externalpackages/vim/addons/vim/keymap/latex2unicode_utf-8.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/keymap/latex2unicode_utf-8.vim	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/keymap/latex2unicode_utf-8.vim	(revision 26744)
@@ -0,0 +1,3662 @@
+" This file is autogenerated from the script 'generate_L2U_keymap.jl'
+" The symbols are based on Julia version 1.7.0-DEV.390
+" The full generating script can be found in the comments at the bottom of this file,
+" and it can be extracted with:
+"
+"     $ grep '^">' latex2unicode_utf-8.vim | cut -c4- > 'generate_L2U_keymap.jl'
+"
+" To produce this keymap file you need to have Julia compilied from source, and
+" to run `make deps` inside Julia's `doc` directory.
+" Then you can run:
+"
+"     $ julia generate_L2U_keymap.jl
+"
+
+scriptencoding utf-8
+
+let b:keymap_name = "L2U"
+loadkeymap
+
+" Tab completion sequence   Code point                   " Character  : Unicode name
+" ------------------------- ---------------------------- " ---------- : --------------------------------------------------------------------------------------------------------
+\\0/3                       <char-0x02189>               " ↉          : VULGAR FRACTION ZERO THIRDS
+\\1/                        <char-0x0215F>               " ⅟          : FRACTION NUMERATOR ONE
+\\1/1                       \\1/1                        "            : (Incomplete sequence)
+\\1/10                      <char-0x02152>               " ⅒          : VULGAR FRACTION ONE TENTH
+\\1/2                       <char-0x000BD>               " ½          : VULGAR FRACTION ONE HALF / FRACTION ONE HALF
+\\1/3                       <char-0x02153>               " ⅓          : VULGAR FRACTION ONE THIRD / FRACTION ONE THIRD
+\\1/4                       <char-0x000BC>               " ¼          : VULGAR FRACTION ONE QUARTER / FRACTION ONE QUARTER
+\\1/5                       <char-0x02155>               " ⅕          : VULGAR FRACTION ONE FIFTH / FRACTION ONE FIFTH
+\\1/6                       <char-0x02159>               " ⅙          : VULGAR FRACTION ONE SIXTH / FRACTION ONE SIXTH
+\\1/7                       <char-0x02150>               " ⅐          : VULGAR FRACTION ONE SEVENTH
+\\1/8                       <char-0x0215B>               " ⅛          : VULGAR FRACTION ONE EIGHTH / FRACTION ONE EIGHTH
+\\1/9                       <char-0x02151>               " ⅑          : VULGAR FRACTION ONE NINTH
+\\1/<Tab>                   <char-0x0215F>               " ⅟          : FRACTION NUMERATOR ONE
+\\2/3                       <char-0x02154>               " ⅔          : VULGAR FRACTION TWO THIRDS / FRACTION TWO THIRDS
+\\2/5                       <char-0x02156>               " ⅖          : VULGAR FRACTION TWO FIFTHS / FRACTION TWO FIFTHS
+\\3/4                       <char-0x000BE>               " ¾          : VULGAR FRACTION THREE QUARTERS / FRACTION THREE QUARTERS
+\\3/5                       <char-0x02157>               " ⅗          : VULGAR FRACTION THREE FIFTHS / FRACTION THREE FIFTHS
+\\3/8                       <char-0x0215C>               " ⅜          : VULGAR FRACTION THREE EIGHTHS / FRACTION THREE EIGHTHS
+\\4/5                       <char-0x02158>               " ⅘          : VULGAR FRACTION FOUR FIFTHS / FRACTION FOUR FIFTHS
+\\5/6                       <char-0x0215A>               " ⅚          : VULGAR FRACTION FIVE SIXTHS / FRACTION FIVE SIXTHS
+\\5/8                       <char-0x0215D>               " ⅝          : VULGAR FRACTION FIVE EIGHTHS / FRACTION FIVE EIGHTHS
+\\7/8                       <char-0x0215E>               " ⅞          : VULGAR FRACTION SEVEN EIGHTHS / FRACTION SEVEN EIGHTHS
+\\AA                        <char-0x000C5>               " Å          : LATIN CAPITAL LETTER A WITH RING ABOVE / LATIN CAPITAL LETTER A RING
+\\AE                        <char-0x000C6>               " Æ          : LATIN CAPITAL LETTER AE / LATIN CAPITAL LETTER A E
+\\Alpha                     <char-0x00391>               " Α          : GREEK CAPITAL LETTER ALPHA
+\\And                       <char-0x02A53>               " ⩓          : DOUBLE LOGICAL AND
+\\Angle                     <char-0x0299C>               " ⦜          : RIGHT ANGLE VARIANT WITH SQUARE
+\\Angstrom                  <char-0x0212B>               " Å          : ANGSTROM SIGN / ANGSTROM UNIT
+\\Beta                      <char-0x00392>               " Β          : GREEK CAPITAL LETTER BETA
+\\Bot                       <char-0x02AEB>               " ⫫          : DOUBLE UP TACK
+\\Bumpeq                    <char-0x0224E>               " ≎          : GEOMETRICALLY EQUIVALENT TO
+\\Cap                       <char-0x022D2>               " ⋒          : DOUBLE INTERSECTION
+\\Chi                       <char-0x003A7>               " Χ          : GREEK CAPITAL LETTER CHI
+\\Colon                     <char-0x02237>               " ∷          : PROPORTION
+\\Colon<Tab>                <char-0x02237>               " ∷          : PROPORTION
+\\Colone                    \\Colone                     "            : (Incomplete sequence)
+\\Coloneq                   <char-0x02A74>               " ⩴          : DOUBLE COLON EQUAL
+\\Cup                       <char-0x022D3>               " ⋓          : DOUBLE UNION
+\\DDownarrow                <char-0x027F1>               " ⟱          : DOWNWARDS QUADRUPLE ARROW
+\\DH                        <char-0x000D0>               " Ð          : LATIN CAPITAL LETTER ETH
+\\DJ                        <char-0x00110>               " Đ          : LATIN CAPITAL LETTER D WITH STROKE / LATIN CAPITAL LETTER D BAR
+\\Dashv                     <char-0x02AE4>               " ⫤          : VERTICAL BAR DOUBLE LEFT TURNSTILE
+\\Ddownarrow                <char-0x0290B>               " ⤋          : DOWNWARDS TRIPLE ARROW
+\\Delta                     <char-0x00394>               " Δ          : GREEK CAPITAL LETTER DELTA
+\\Digamma                   <char-0x003DC>               " Ϝ          : GREEK LETTER DIGAMMA / GREEK CAPITAL LETTER DIGAMMA
+\\Doteq                     <char-0x02251>               " ≑          : GEOMETRICALLY EQUAL TO
+\\DownArrowBar              <char-0x02913>               " ⤓          : DOWNWARDS ARROW TO BAR
+\\DownArrowUpArrow          <char-0x021F5>               " ⇵          : DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW
+\\DownLeftRightVector       <char-0x02950>               " ⥐          : LEFT BARB DOWN RIGHT BARB DOWN HARPOON
+\\DownLeftTeeVector         <char-0x0295E>               " ⥞          : LEFTWARDS HARPOON WITH BARB DOWN FROM BAR
+\\DownLeftVectorBar         <char-0x02956>               " ⥖          : LEFTWARDS HARPOON WITH BARB DOWN TO BAR
+\\DownRightTeeVector        <char-0x0295F>               " ⥟          : RIGHTWARDS HARPOON WITH BARB DOWN FROM BAR
+\\DownRightVectorBar        <char-0x02957>               " ⥗          : RIGHTWARDS HARPOON WITH BARB DOWN TO BAR
+\\Downarrow                 <char-0x021D3>               " ⇓          : DOWNWARDS DOUBLE ARROW / DOWN DOUBLE ARROW
+\\ElOr                      <char-0x02A56>               " ⩖          : TWO INTERSECTING LOGICAL OR
+\\Elroang                   <char-0x02986>               " ⦆          : RIGHT WHITE PARENTHESIS
+\\Epsilon                   <char-0x00395>               " Ε          : GREEK CAPITAL LETTER EPSILON
+\\Equal                     <char-0x02A75>               " ⩵          : TWO CONSECUTIVE EQUALS SIGNS
+\\Equiv                     <char-0x02263>               " ≣          : STRICTLY EQUIVALENT TO
+\\Eta                       <char-0x00397>               " Η          : GREEK CAPITAL LETTER ETA
+\\Finv                      <char-0x02132>               " Ⅎ          : TURNED CAPITAL F / TURNED F
+\\Game                      <char-0x02141>               " ⅁          : TURNED SANS-SERIF CAPITAL G
+\\Gamma                     <char-0x00393>               " Γ          : GREEK CAPITAL LETTER GAMMA
+\\H                         <char-0x0030B>               " ◌̋         : COMBINING DOUBLE ACUTE ACCENT / NON-SPACING DOUBLE ACUTE
+\\Im                        <char-0x02111>               " ℑ          : BLACK-LETTER CAPITAL I / BLACK-LETTER I
+\\Iota                      <char-0x00399>               " Ι          : GREEK CAPITAL LETTER IOTA
+\\Kappa                     <char-0x0039A>               " Κ          : GREEK CAPITAL LETTER KAPPA
+\\Koppa                     <char-0x003DE>               " Ϟ          : GREEK LETTER KOPPA / GREEK CAPITAL LETTER KOPPA
+\\L                         <char-0x00141>               " Ł          : LATIN CAPITAL LETTER L WITH STROKE / LATIN CAPITAL LETTER L SLASH
+\\L<Tab>                    <char-0x00141>               " Ł          : LATIN CAPITAL LETTER L WITH STROKE / LATIN CAPITAL LETTER L SLASH
+\\LL                        \\LL                         "            : (Incomplete sequence)
+\\LLeftarrow                <char-0x02B45>               " ⭅          : LEFTWARDS QUADRUPLE ARROW
+\\La                        \\La                         "            : (Incomplete sequence)
+\\Lambda                    <char-0x0039B>               " Λ          : GREEK CAPITAL LETTER LAMDA / GREEK CAPITAL LETTER LAMBDA
+\\Lap                       <char-0x029CA>               " ⧊          : TRIANGLE WITH DOT ABOVE
+\\Ld                        \\Ld                         "            : (Incomplete sequence)
+\\Ldsh                      <char-0x021B2>               " ↲          : DOWNWARDS ARROW WITH TIP LEFTWARDS / DOWN ARROW WITH TIP LEFT
+\\Le                        \\Le                         "            : (Incomplete sequence)
+\\LeftDownTeeVector         <char-0x02961>               " ⥡          : DOWNWARDS HARPOON WITH BARB LEFT FROM BAR
+\\LeftDownVectorBar         <char-0x02959>               " ⥙          : DOWNWARDS HARPOON WITH BARB LEFT TO BAR
+\\LeftRightVector           <char-0x0294E>               " ⥎          : LEFT BARB UP RIGHT BARB UP HARPOON
+\\LeftTeeVector             <char-0x0295A>               " ⥚          : LEFTWARDS HARPOON WITH BARB UP FROM BAR
+\\LeftTriangleBar           <char-0x029CF>               " ⧏          : LEFT TRIANGLE BESIDE VERTICAL BAR
+\\LeftUpDownVector          <char-0x02951>               " ⥑          : UP BARB LEFT DOWN BARB LEFT HARPOON
+\\LeftUpTeeVector           <char-0x02960>               " ⥠          : UPWARDS HARPOON WITH BARB LEFT FROM BAR
+\\LeftUpVectorBar           <char-0x02958>               " ⥘          : UPWARDS HARPOON WITH BARB LEFT TO BAR
+\\LeftVectorBar             <char-0x02952>               " ⥒          : LEFTWARDS HARPOON WITH BARB UP TO BAR
+\\Leftarrow                 <char-0x021D0>               " ⇐          : LEFTWARDS DOUBLE ARROW / LEFT DOUBLE ARROW
+\\Leftrightarrow            <char-0x021D4>               " ⇔          : LEFT RIGHT DOUBLE ARROW
+\\Ll                        \\Ll                         "            : (Incomplete sequence)
+\\Lleftarrow                <char-0x021DA>               " ⇚          : LEFTWARDS TRIPLE ARROW / LEFT TRIPLE ARROW
+\\Lo                        \\Lo                         "            : (Incomplete sequence)
+\\Longleftarrow             <char-0x027F8>               " ⟸          : LONG LEFTWARDS DOUBLE ARROW
+\\Longleftrightarrow        <char-0x027FA>               " ⟺          : LONG LEFT RIGHT DOUBLE ARROW
+\\Longmapsfrom              <char-0x027FD>               " ⟽          : LONG LEFTWARDS DOUBLE ARROW FROM BAR
+\\Longmapsto                <char-0x027FE>               " ⟾          : LONG RIGHTWARDS DOUBLE ARROW FROM BAR
+\\Longrightarrow            <char-0x027F9>               " ⟹          : LONG RIGHTWARDS DOUBLE ARROW
+\\Ls                        \\Ls                         "            : (Incomplete sequence)
+\\Lsh                       <char-0x021B0>               " ↰          : UPWARDS ARROW WITH TIP LEFTWARDS / UP ARROW WITH TIP LEFT
+\\Mapsfrom                  <char-0x02906>               " ⤆          : LEFTWARDS DOUBLE ARROW FROM BAR
+\\Mapsto                    <char-0x02907>               " ⤇          : RIGHTWARDS DOUBLE ARROW FROM BAR
+\\NG                        <char-0x0014A>               " Ŋ          : LATIN CAPITAL LETTER ENG
+\\Nearrow                   <char-0x021D7>               " ⇗          : NORTH EAST DOUBLE ARROW / UPPER RIGHT DOUBLE ARROW
+\\NestedGreaterGreater      <char-0x02AA2>               " ⪢          : DOUBLE NESTED GREATER-THAN
+\\NestedLessLess            <char-0x02AA1>               " ⪡          : DOUBLE NESTED LESS-THAN
+\\NotGreaterGreater         <char-0x0226B><char-0x00338> " ≫̸         : MUCH GREATER-THAN / MUCH GREATER THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\NotLeftTriangleBar        <char-0x029CF><char-0x00338> " ⧏̸         : LEFT TRIANGLE BESIDE VERTICAL BAR + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\NotLessLess               <char-0x0226A><char-0x00338> " ≪̸         : MUCH LESS-THAN / MUCH LESS THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\NotNestedGreaterGreater   <char-0x02AA2><char-0x00338> " ⪢̸         : DOUBLE NESTED GREATER-THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\NotNestedLessLess         <char-0x02AA1><char-0x00338> " ⪡̸         : DOUBLE NESTED LESS-THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\NotRightTriangleBar       <char-0x029D0><char-0x00338> " ⧐̸         : VERTICAL BAR BESIDE RIGHT TRIANGLE + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\NotSquareSubset           <char-0x0228F><char-0x00338> " ⊏̸         : SQUARE IMAGE OF + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\NotSquareSuperset         <char-0x02290><char-0x00338> " ⊐̸         : SQUARE ORIGINAL OF + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\Nwarrow                   <char-0x021D6>               " ⇖          : NORTH WEST DOUBLE ARROW / UPPER LEFT DOUBLE ARROW
+\\O                         <char-0x000D8>               " Ø          : LATIN CAPITAL LETTER O WITH STROKE / LATIN CAPITAL LETTER O SLASH
+\\O<Tab>                    <char-0x000D8>               " Ø          : LATIN CAPITAL LETTER O WITH STROKE / LATIN CAPITAL LETTER O SLASH
+\\OE                        <char-0x00152>               " Œ          : LATIN CAPITAL LIGATURE OE / LATIN CAPITAL LETTER O E
+\\Om                        \\Om                         "            : (Incomplete sequence)
+\\Omega                     <char-0x003A9>               " Ω          : GREEK CAPITAL LETTER OMEGA
+\\Or                        <char-0x02A54>               " ⩔          : DOUBLE LOGICAL OR
+\\Ot                        \\Ot                         "            : (Incomplete sequence)
+\\Otimes                    <char-0x02A37>               " ⨷          : MULTIPLICATION SIGN IN DOUBLE CIRCLE
+\\P                         <char-0x000B6>               " ¶          : PILCROW SIGN / PARAGRAPH SIGN
+\\P<Tab>                    <char-0x000B6>               " ¶          : PILCROW SIGN / PARAGRAPH SIGN
+\\Ph                        \\Ph                         "            : (Incomplete sequence)
+\\Phi                       <char-0x003A6>               " Φ          : GREEK CAPITAL LETTER PHI
+\\Pi                        <char-0x003A0>               " Π          : GREEK CAPITAL LETTER PI
+\\Pr                        \\Pr                         "            : (Incomplete sequence)
+\\Prec                      <char-0x02ABB>               " ⪻          : DOUBLE PRECEDES
+\\PropertyLine              <char-0x0214A>               " ⅊          : PROPERTY LINE
+\\Ps                        \\Ps                         "            : (Incomplete sequence)
+\\Psi                       <char-0x003A8>               " Ψ          : GREEK CAPITAL LETTER PSI
+\\QED                       <char-0x0220E>               " ∎          : END OF PROOF
+\\RRightarrow               <char-0x02B46>               " ⭆          : RIGHTWARDS QUADRUPLE ARROW
+\\Rdsh                      <char-0x021B3>               " ↳          : DOWNWARDS ARROW WITH TIP RIGHTWARDS / DOWN ARROW WITH TIP RIGHT
+\\Re                        <char-0x0211C>               " ℜ          : BLACK-LETTER CAPITAL R / BLACK-LETTER R
+\\Re<Tab>                   <char-0x0211C>               " ℜ          : BLACK-LETTER CAPITAL R / BLACK-LETTER R
+\\Rev                       \\Rev                        "            : (Incomplete sequence)
+\\ReverseUpEquilibrium      <char-0x0296F>               " ⥯          : DOWNWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT
+\\Rho                       <char-0x003A1>               " Ρ          : GREEK CAPITAL LETTER RHO
+\\RightDownTeeVector        <char-0x0295D>               " ⥝          : DOWNWARDS HARPOON WITH BARB RIGHT FROM BAR
+\\RightDownVectorBar        <char-0x02955>               " ⥕          : DOWNWARDS HARPOON WITH BARB RIGHT TO BAR
+\\RightTeeVector            <char-0x0295B>               " ⥛          : RIGHTWARDS HARPOON WITH BARB UP FROM BAR
+\\RightTriangleBar          <char-0x029D0>               " ⧐          : VERTICAL BAR BESIDE RIGHT TRIANGLE
+\\RightUpDownVector         <char-0x0294F>               " ⥏          : UP BARB RIGHT DOWN BARB RIGHT HARPOON
+\\RightUpTeeVector          <char-0x0295C>               " ⥜          : UPWARDS HARPOON WITH BARB RIGHT FROM BAR
+\\RightUpVectorBar          <char-0x02954>               " ⥔          : UPWARDS HARPOON WITH BARB RIGHT TO BAR
+\\RightVectorBar            <char-0x02953>               " ⥓          : RIGHTWARDS HARPOON WITH BARB UP TO BAR
+\\Rightarrow                <char-0x021D2>               " ⇒          : RIGHTWARDS DOUBLE ARROW / RIGHT DOUBLE ARROW
+\\Rlarr                     <char-0x02942>               " ⥂          : RIGHTWARDS ARROW ABOVE SHORT LEFTWARDS ARROW
+\\RoundImplies              <char-0x02970>               " ⥰          : RIGHT DOUBLE ARROW WITH ROUNDED HEAD
+\\Rrightarrow               <char-0x021DB>               " ⇛          : RIGHTWARDS TRIPLE ARROW / RIGHT TRIPLE ARROW
+\\Rsh                       <char-0x021B1>               " ↱          : UPWARDS ARROW WITH TIP RIGHTWARDS / UP ARROW WITH TIP RIGHT
+\\RuleDelayed               <char-0x029F4>               " ⧴          : RULE-DELAYED
+\\S                         <char-0x000A7>               " §          : SECTION SIGN
+\\S<Tab>                    <char-0x000A7>               " §          : SECTION SIGN
+\\Sa                        \\Sa                         "            : (Incomplete sequence)
+\\Sampi                     <char-0x003E0>               " Ϡ          : GREEK LETTER SAMPI / GREEK CAPITAL LETTER SAMPI
+\\Se                        \\Se                         "            : (Incomplete sequence)
+\\Searrow                   <char-0x021D8>               " ⇘          : SOUTH EAST DOUBLE ARROW / LOWER RIGHT DOUBLE ARROW
+\\Si                        \\Si                         "            : (Incomplete sequence)
+\\Sigma                     <char-0x003A3>               " Σ          : GREEK CAPITAL LETTER SIGMA
+\\Sq                        \\Sq                         "            : (Incomplete sequence)
+\\Sqcap                     <char-0x02A4E>               " ⩎          : DOUBLE SQUARE INTERSECTION
+\\Sqcup                     <char-0x02A4F>               " ⩏          : DOUBLE SQUARE UNION
+\\St                        \\St                         "            : (Incomplete sequence)
+\\Stigma                    <char-0x003DA>               " Ϛ          : GREEK LETTER STIGMA / GREEK CAPITAL LETTER STIGMA
+\\Su                        \\Su                         "            : (Incomplete sequence)
+\\Subset                    <char-0x022D0>               " ⋐          : DOUBLE SUBSET
+\\Succ                      <char-0x02ABC>               " ⪼          : DOUBLE SUCCEEDS
+\\Supset                    <char-0x022D1>               " ⋑          : DOUBLE SUPERSET
+\\Sw                        \\Sw                         "            : (Incomplete sequence)
+\\Swarrow                   <char-0x021D9>               " ⇙          : SOUTH WEST DOUBLE ARROW / LOWER LEFT DOUBLE ARROW
+\\TH                        <char-0x000DE>               " Þ          : LATIN CAPITAL LETTER THORN
+\\Tau                       <char-0x003A4>               " Τ          : GREEK CAPITAL LETTER TAU
+\\Theta                     <char-0x00398>               " Θ          : GREEK CAPITAL LETTER THETA
+\\Times                     <char-0x02A2F>               " ⨯          : VECTOR OR CROSS PRODUCT
+\\Top                       <char-0x02AEA>               " ⫪          : DOUBLE DOWN TACK
+\\UUparrow                  <char-0x027F0>               " ⟰          : UPWARDS QUADRUPLE ARROW
+\\UpArrowBar                <char-0x02912>               " ⤒          : UPWARDS ARROW TO BAR
+\\UpEquilibrium             <char-0x0296E>               " ⥮          : UPWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT
+\\Uparrow                   <char-0x021D1>               " ⇑          : UPWARDS DOUBLE ARROW / UP DOUBLE ARROW
+\\Updownarrow               <char-0x021D5>               " ⇕          : UP DOWN DOUBLE ARROW
+\\Upsilon                   <char-0x003A5>               " Υ          : GREEK CAPITAL LETTER UPSILON
+\\Uuparrow                  <char-0x0290A>               " ⤊          : UPWARDS TRIPLE ARROW
+\\VDash                     <char-0x022AB>               " ⊫          : DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
+\\Vdash                     <char-0x022A9>               " ⊩          : FORCES
+\\Vert                      <char-0x02016>               " ‖          : DOUBLE VERTICAL LINE / DOUBLE VERTICAL BAR
+\\Vvdash                    <char-0x022AA>               " ⊪          : TRIPLE VERTICAL BAR RIGHT TURNSTILE
+\\Vvert                     <char-0x02980>               " ⦀          : TRIPLE VERTICAL BAR DELIMITER
+\\Xi                        <char-0x0039E>               " Ξ          : GREEK CAPITAL LETTER XI
+\\Yup                       <char-0x02144>               " ⅄          : TURNED SANS-SERIF CAPITAL Y
+\\Zbar                      <char-0x001B5>               " Ƶ          : LATIN CAPITAL LETTER Z WITH STROKE / LATIN CAPITAL LETTER Z BAR
+\\Zeta                      <char-0x00396>               " Ζ          : GREEK CAPITAL LETTER ZETA
+\\^!                        <char-0x0A71D>               " ꜝ          : MODIFIER LETTER RAISED EXCLAMATION MARK
+\\^(                        <char-0x0207D>               " ⁽          : SUPERSCRIPT LEFT PARENTHESIS / SUPERSCRIPT OPENING PARENTHESIS
+\\^)                        <char-0x0207E>               " ⁾          : SUPERSCRIPT RIGHT PARENTHESIS / SUPERSCRIPT CLOSING PARENTHESIS
+\\^+                        <char-0x0207A>               " ⁺          : SUPERSCRIPT PLUS SIGN
+\\^-                        <char-0x0207B>               " ⁻          : SUPERSCRIPT MINUS / SUPERSCRIPT HYPHEN-MINUS
+\\^0                        <char-0x02070>               " ⁰          : SUPERSCRIPT ZERO / SUPERSCRIPT DIGIT ZERO
+\\^1                        <char-0x000B9>               " ¹          : SUPERSCRIPT ONE / SUPERSCRIPT DIGIT ONE
+\\^2                        <char-0x000B2>               " ²          : SUPERSCRIPT TWO / SUPERSCRIPT DIGIT TWO
+\\^3                        <char-0x000B3>               " ³          : SUPERSCRIPT THREE / SUPERSCRIPT DIGIT THREE
+\\^4                        <char-0x02074>               " ⁴          : SUPERSCRIPT FOUR / SUPERSCRIPT DIGIT FOUR
+\\^5                        <char-0x02075>               " ⁵          : SUPERSCRIPT FIVE / SUPERSCRIPT DIGIT FIVE
+\\^6                        <char-0x02076>               " ⁶          : SUPERSCRIPT SIX / SUPERSCRIPT DIGIT SIX
+\\^7                        <char-0x02077>               " ⁷          : SUPERSCRIPT SEVEN / SUPERSCRIPT DIGIT SEVEN
+\\^8                        <char-0x02078>               " ⁸          : SUPERSCRIPT EIGHT / SUPERSCRIPT DIGIT EIGHT
+\\^9                        <char-0x02079>               " ⁹          : SUPERSCRIPT NINE / SUPERSCRIPT DIGIT NINE
+\\^=                        <char-0x0207C>               " ⁼          : SUPERSCRIPT EQUALS SIGN
+\\^A                        <char-0x01D2C>               " ᴬ          : MODIFIER LETTER CAPITAL A
+\\^B                        <char-0x01D2E>               " ᴮ          : MODIFIER LETTER CAPITAL B
+\\^D                        <char-0x01D30>               " ᴰ          : MODIFIER LETTER CAPITAL D
+\\^E                        <char-0x01D31>               " ᴱ          : MODIFIER LETTER CAPITAL E
+\\^G                        <char-0x01D33>               " ᴳ          : MODIFIER LETTER CAPITAL G
+\\^H                        <char-0x01D34>               " ᴴ          : MODIFIER LETTER CAPITAL H
+\\^I                        <char-0x01D35>               " ᴵ          : MODIFIER LETTER CAPITAL I
+\\^J                        <char-0x01D36>               " ᴶ          : MODIFIER LETTER CAPITAL J
+\\^K                        <char-0x01D37>               " ᴷ          : MODIFIER LETTER CAPITAL K
+\\^L                        <char-0x01D38>               " ᴸ          : MODIFIER LETTER CAPITAL L
+\\^M                        <char-0x01D39>               " ᴹ          : MODIFIER LETTER CAPITAL M
+\\^N                        <char-0x01D3A>               " ᴺ          : MODIFIER LETTER CAPITAL N
+\\^O                        <char-0x01D3C>               " ᴼ          : MODIFIER LETTER CAPITAL O
+\\^P                        <char-0x01D3E>               " ᴾ          : MODIFIER LETTER CAPITAL P
+\\^R                        <char-0x01D3F>               " ᴿ          : MODIFIER LETTER CAPITAL R
+\\^T                        <char-0x01D40>               " ᵀ          : MODIFIER LETTER CAPITAL T
+\\^U                        <char-0x01D41>               " ᵁ          : MODIFIER LETTER CAPITAL U
+\\^V                        <char-0x02C7D>               " ⱽ          : MODIFIER LETTER CAPITAL V
+\\^W                        <char-0x01D42>               " ᵂ          : MODIFIER LETTER CAPITAL W
+\\^a                        <char-0x01D43>               " ᵃ          : MODIFIER LETTER SMALL A
+\\^a<Tab>                   <char-0x01D43>               " ᵃ          : MODIFIER LETTER SMALL A
+\\^al                       \\^al                        "            : (Incomplete sequence)
+\\^alpha                    <char-0x01D45>               " ᵅ          : MODIFIER LETTER SMALL ALPHA
+\\^b                        <char-0x01D47>               " ᵇ          : MODIFIER LETTER SMALL B
+\\^b<Tab>                   <char-0x01D47>               " ᵇ          : MODIFIER LETTER SMALL B
+\\^be                       \\^be                        "            : (Incomplete sequence)
+\\^beta                     <char-0x01D5D>               " ᵝ          : MODIFIER LETTER SMALL BETA
+\\^c                        <char-0x01D9C>               " ᶜ          : MODIFIER LETTER SMALL C
+\\^c<Tab>                   <char-0x01D9C>               " ᶜ          : MODIFIER LETTER SMALL C
+\\^ch                       \\^ch                        "            : (Incomplete sequence)
+\\^chi                      <char-0x01D61>               " ᵡ          : MODIFIER LETTER SMALL CHI
+\\^d                        <char-0x01D48>               " ᵈ          : MODIFIER LETTER SMALL D
+\\^d<Tab>                   <char-0x01D48>               " ᵈ          : MODIFIER LETTER SMALL D
+\\^de                       \\^de                        "            : (Incomplete sequence)
+\\^delta                    <char-0x01D5F>               " ᵟ          : MODIFIER LETTER SMALL DELTA
+\\^do                       \\^do                        "            : (Incomplete sequence)
+\\^downarrow                <char-0x0A71C>               " ꜜ          : MODIFIER LETTER RAISED DOWN ARROW
+\\^e                        <char-0x01D49>               " ᵉ          : MODIFIER LETTER SMALL E
+\\^e<Tab>                   <char-0x01D49>               " ᵉ          : MODIFIER LETTER SMALL E
+\\^ep                       \\^ep                        "            : (Incomplete sequence)
+\\^epsilon                  <char-0x01D4B>               " ᵋ          : MODIFIER LETTER SMALL OPEN E
+\\^f                        <char-0x01DA0>               " ᶠ          : MODIFIER LETTER SMALL F
+\\^g                        <char-0x01D4D>               " ᵍ          : MODIFIER LETTER SMALL G
+\\^g<Tab>                   <char-0x01D4D>               " ᵍ          : MODIFIER LETTER SMALL G
+\\^ga                       \\^ga                        "            : (Incomplete sequence)
+\\^gamma                    <char-0x01D5E>               " ᵞ          : MODIFIER LETTER SMALL GREEK GAMMA
+\\^h                        <char-0x002B0>               " ʰ          : MODIFIER LETTER SMALL H
+\\^i                        <char-0x02071>               " ⁱ          : SUPERSCRIPT LATIN SMALL LETTER I
+\\^i<Tab>                   <char-0x02071>               " ⁱ          : SUPERSCRIPT LATIN SMALL LETTER I
+\\^io                       \\^io                        "            : (Incomplete sequence)
+\\^iota                     <char-0x01DA5>               " ᶥ          : MODIFIER LETTER SMALL IOTA
+\\^j                        <char-0x002B2>               " ʲ          : MODIFIER LETTER SMALL J
+\\^k                        <char-0x01D4F>               " ᵏ          : MODIFIER LETTER SMALL K
+\\^l                        <char-0x002E1>               " ˡ          : MODIFIER LETTER SMALL L
+\\^l<Tab>                   <char-0x002E1>               " ˡ          : MODIFIER LETTER SMALL L
+\\^lt                       \\^lt                        "            : (Incomplete sequence)
+\\^ltphi                    <char-0x01DB2>               " ᶲ          : MODIFIER LETTER SMALL PHI
+\\^m                        <char-0x01D50>               " ᵐ          : MODIFIER LETTER SMALL M
+\\^n                        <char-0x0207F>               " ⁿ          : SUPERSCRIPT LATIN SMALL LETTER N
+\\^o                        <char-0x01D52>               " ᵒ          : MODIFIER LETTER SMALL O
+\\^p                        <char-0x01D56>               " ᵖ          : MODIFIER LETTER SMALL P
+\\^p<Tab>                   <char-0x01D56>               " ᵖ          : MODIFIER LETTER SMALL P
+\\^ph                       \\^ph                        "            : (Incomplete sequence)
+\\^phi                      <char-0x01D60>               " ᵠ          : MODIFIER LETTER SMALL GREEK PHI
+\\^r                        <char-0x002B3>               " ʳ          : MODIFIER LETTER SMALL R
+\\^s                        <char-0x002E2>               " ˢ          : MODIFIER LETTER SMALL S
+\\^t                        <char-0x01D57>               " ᵗ          : MODIFIER LETTER SMALL T
+\\^t<Tab>                   <char-0x01D57>               " ᵗ          : MODIFIER LETTER SMALL T
+\\^th                       \\^th                        "            : (Incomplete sequence)
+\\^theta                    <char-0x01DBF>               " ᶿ          : MODIFIER LETTER SMALL THETA
+\\^u                        <char-0x01D58>               " ᵘ          : MODIFIER LETTER SMALL U
+\\^u<Tab>                   <char-0x01D58>               " ᵘ          : MODIFIER LETTER SMALL U
+\\^up                       \\^up                        "            : (Incomplete sequence)
+\\^uparrow                  <char-0x0A71B>               " ꜛ          : MODIFIER LETTER RAISED UP ARROW
+\\^v                        <char-0x01D5B>               " ᵛ          : MODIFIER LETTER SMALL V
+\\^w                        <char-0x002B7>               " ʷ          : MODIFIER LETTER SMALL W
+\\^x                        <char-0x002E3>               " ˣ          : MODIFIER LETTER SMALL X
+\\^y                        <char-0x002B8>               " ʸ          : MODIFIER LETTER SMALL Y
+\\^z                        <char-0x01DBB>               " ᶻ          : MODIFIER LETTER SMALL Z
+\\_(                        <char-0x0208D>               " ₍          : SUBSCRIPT LEFT PARENTHESIS / SUBSCRIPT OPENING PARENTHESIS
+\\_)                        <char-0x0208E>               " ₎          : SUBSCRIPT RIGHT PARENTHESIS / SUBSCRIPT CLOSING PARENTHESIS
+\\_+                        <char-0x0208A>               " ₊          : SUBSCRIPT PLUS SIGN
+\\_-                        <char-0x0208B>               " ₋          : SUBSCRIPT MINUS / SUBSCRIPT HYPHEN-MINUS
+\\_0                        <char-0x02080>               " ₀          : SUBSCRIPT ZERO / SUBSCRIPT DIGIT ZERO
+\\_1                        <char-0x02081>               " ₁          : SUBSCRIPT ONE / SUBSCRIPT DIGIT ONE
+\\_2                        <char-0x02082>               " ₂          : SUBSCRIPT TWO / SUBSCRIPT DIGIT TWO
+\\_3                        <char-0x02083>               " ₃          : SUBSCRIPT THREE / SUBSCRIPT DIGIT THREE
+\\_4                        <char-0x02084>               " ₄          : SUBSCRIPT FOUR / SUBSCRIPT DIGIT FOUR
+\\_5                        <char-0x02085>               " ₅          : SUBSCRIPT FIVE / SUBSCRIPT DIGIT FIVE
+\\_6                        <char-0x02086>               " ₆          : SUBSCRIPT SIX / SUBSCRIPT DIGIT SIX
+\\_7                        <char-0x02087>               " ₇          : SUBSCRIPT SEVEN / SUBSCRIPT DIGIT SEVEN
+\\_8                        <char-0x02088>               " ₈          : SUBSCRIPT EIGHT / SUBSCRIPT DIGIT EIGHT
+\\_9                        <char-0x02089>               " ₉          : SUBSCRIPT NINE / SUBSCRIPT DIGIT NINE
+\\_=                        <char-0x0208C>               " ₌          : SUBSCRIPT EQUALS SIGN
+\\_a                        <char-0x02090>               " ₐ          : LATIN SUBSCRIPT SMALL LETTER A
+\\_beta                     <char-0x01D66>               " ᵦ          : GREEK SUBSCRIPT SMALL LETTER BETA
+\\_chi                      <char-0x01D6A>               " ᵪ          : GREEK SUBSCRIPT SMALL LETTER CHI
+\\_e                        <char-0x02091>               " ₑ          : LATIN SUBSCRIPT SMALL LETTER E
+\\_gamma                    <char-0x01D67>               " ᵧ          : GREEK SUBSCRIPT SMALL LETTER GAMMA
+\\_h                        <char-0x02095>               " ₕ          : LATIN SUBSCRIPT SMALL LETTER H
+\\_i                        <char-0x01D62>               " ᵢ          : LATIN SUBSCRIPT SMALL LETTER I
+\\_j                        <char-0x02C7C>               " ⱼ          : LATIN SUBSCRIPT SMALL LETTER J
+\\_k                        <char-0x02096>               " ₖ          : LATIN SUBSCRIPT SMALL LETTER K
+\\_l                        <char-0x02097>               " ₗ          : LATIN SUBSCRIPT SMALL LETTER L
+\\_m                        <char-0x02098>               " ₘ          : LATIN SUBSCRIPT SMALL LETTER M
+\\_n                        <char-0x02099>               " ₙ          : LATIN SUBSCRIPT SMALL LETTER N
+\\_o                        <char-0x02092>               " ₒ          : LATIN SUBSCRIPT SMALL LETTER O
+\\_p                        <char-0x0209A>               " ₚ          : LATIN SUBSCRIPT SMALL LETTER P
+\\_p<Tab>                   <char-0x0209A>               " ₚ          : LATIN SUBSCRIPT SMALL LETTER P
+\\_ph                       \\_ph                        "            : (Incomplete sequence)
+\\_phi                      <char-0x01D69>               " ᵩ          : GREEK SUBSCRIPT SMALL LETTER PHI
+\\_r                        <char-0x01D63>               " ᵣ          : LATIN SUBSCRIPT SMALL LETTER R
+\\_r<Tab>                   <char-0x01D63>               " ᵣ          : LATIN SUBSCRIPT SMALL LETTER R
+\\_rh                       \\_rh                        "            : (Incomplete sequence)
+\\_rho                      <char-0x01D68>               " ᵨ          : GREEK SUBSCRIPT SMALL LETTER RHO
+\\_s                        <char-0x0209B>               " ₛ          : LATIN SUBSCRIPT SMALL LETTER S
+\\_s<Tab>                   <char-0x0209B>               " ₛ          : LATIN SUBSCRIPT SMALL LETTER S
+\\_sc                       \\_sc                        "            : (Incomplete sequence)
+\\_schwa                    <char-0x02094>               " ₔ          : LATIN SUBSCRIPT SMALL LETTER SCHWA
+\\_t                        <char-0x0209C>               " ₜ          : LATIN SUBSCRIPT SMALL LETTER T
+\\_u                        <char-0x01D64>               " ᵤ          : LATIN SUBSCRIPT SMALL LETTER U
+\\_v                        <char-0x01D65>               " ᵥ          : LATIN SUBSCRIPT SMALL LETTER V
+\\_x                        <char-0x02093>               " ₓ          : LATIN SUBSCRIPT SMALL LETTER X
+\\aa                        <char-0x000E5>               " å          : LATIN SMALL LETTER A WITH RING ABOVE / LATIN SMALL LETTER A RING
+\\accurrent                 <char-0x023E6>               " ⏦          : AC CURRENT
+\\acidfree                  <char-0x0267E>               " ♾          : PERMANENT PAPER SIGN
+\\acute                     <char-0x00301>               " ◌́         : COMBINING ACUTE ACCENT / NON-SPACING ACUTE
+\\adots                     <char-0x022F0>               " ⋰          : UP RIGHT DIAGONAL ELLIPSIS
+\\ae                        <char-0x000E6>               " æ          : LATIN SMALL LETTER AE / LATIN SMALL LETTER A E
+\\aleph                     <char-0x02135>               " ℵ          : ALEF SYMBOL / FIRST TRANSFINITE CARDINAL
+\\allequal                  <char-0x0224C>               " ≌          : ALL EQUAL TO
+\\alpha                     <char-0x003B1>               " α          : GREEK SMALL LETTER ALPHA
+\\amalg                     <char-0x02A3F>               " ⨿          : AMALGAMATION OR COPRODUCT
+\\angdnr                    <char-0x0299F>               " ⦟          : ACUTE ANGLE
+\\angle                     <char-0x02220>               " ∠          : ANGLE
+\\angle<Tab>                <char-0x02220>               " ∠          : ANGLE
+\\angles                    <char-0x0299E>               " ⦞          : ANGLE WITH S INSIDE
+\\angleu                    \\angleu                     "            : (Incomplete sequence)
+\\angleubar                 <char-0x029A4>               " ⦤          : ANGLE WITH UNDERBAR
+\\annuity                   <char-0x020E7>               " ◌⃧         : COMBINING ANNUITY SYMBOL
+\\approx                    <char-0x02248>               " ≈          : ALMOST EQUAL TO
+\\approx<Tab>               <char-0x02248>               " ≈          : ALMOST EQUAL TO
+\\approxe                   \\approxe                    "            : (Incomplete sequence)
+\\approxeq                  <char-0x0224A>               " ≊          : ALMOST EQUAL OR EQUAL TO
+\\approxeq<Tab>             <char-0x0224A>               " ≊          : ALMOST EQUAL OR EQUAL TO
+\\approxeqq                 <char-0x02A70>               " ⩰          : APPROXIMATELY EQUAL OR EQUAL TO
+\\approxn                   \\approxn                    "            : (Incomplete sequence)
+\\approxnotequal            <char-0x02246>               " ≆          : APPROXIMATELY BUT NOT ACTUALLY EQUAL TO
+\\aquarius                  <char-0x02652>               " ♒          : AQUARIUS
+\\arceq                     <char-0x02258>               " ≘          : CORRESPONDS TO
+\\aries                     <char-0x02648>               " ♈          : ARIES
+\\ast                       <char-0x02217>               " ∗          : ASTERISK OPERATOR
+\\ast<Tab>                  <char-0x02217>               " ∗          : ASTERISK OPERATOR
+\\aste                      \\aste                       "            : (Incomplete sequence)
+\\asteq                     <char-0x02A6E>               " ⩮          : EQUALS WITH ASTERISK
+\\asteraccent               <char-0x020F0>               " ◌⃰         : COMBINING ASTERISK ABOVE
+\\astr                      \\astr                       "            : (Incomplete sequence)
+\\astrosun                  <char-0x02609>               " ☉          : SUN
+\\asymp                     <char-0x0224D>               " ≍          : EQUIVALENT TO
+\\awint                     <char-0x02A11>               " ⨑          : ANTICLOCKWISE INTEGRATION
+\\backepsilon               <char-0x003F6>               " ϶          : GREEK REVERSED LUNATE EPSILON SYMBOL
+\\backppprime               <char-0x02037>               " ‷          : REVERSED TRIPLE PRIME
+\\backpprime                <char-0x02036>               " ‶          : REVERSED DOUBLE PRIME
+\\backprime                 <char-0x02035>               " ‵          : REVERSED PRIME
+\\backsim                   <char-0x0223D>               " ∽          : REVERSED TILDE
+\\backsim<Tab>              <char-0x0223D>               " ∽          : REVERSED TILDE
+\\backsime                  \\backsime                   "            : (Incomplete sequence)
+\\backsimeq                 <char-0x022CD>               " ⋍          : REVERSED TILDE EQUALS
+\\bagmember                 <char-0x022FF>               " ⋿          : Z NOTATION BAG MEMBERSHIP
+\\bar                       <char-0x00304>               " ◌̄         : COMBINING MACRON / NON-SPACING MACRON
+\\bar<Tab>                  <char-0x00304>               " ◌̄         : COMBINING MACRON / NON-SPACING MACRON
+\\barc                      \\barc                       "            : (Incomplete sequence)
+\\barcap                    <char-0x02A43>               " ⩃          : INTERSECTION WITH OVERBAR
+\\barcup                    <char-0x02A42>               " ⩂          : UNION WITH OVERBAR
+\\barl                      \\barl                       "            : (Incomplete sequence)
+\\barleftarrow              <char-0x021E4>               " ⇤          : LEFTWARDS ARROW TO BAR / LEFT ARROW TO BAR
+\\barleftarrow<Tab>         <char-0x021E4>               " ⇤          : LEFTWARDS ARROW TO BAR / LEFT ARROW TO BAR
+\\barleftarrowr             \\barleftarrowr              "            : (Incomplete sequence)
+\\barleftarrowrightarrowbar <char-0x021B9>               " ↹          : LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR / LEFT ARROW TO BAR OVER RIGHT ARROW TO BAR
+\\baro                      \\baro                       "            : (Incomplete sequence)
+\\barovernorthwestarrow     <char-0x021B8>               " ↸          : NORTH WEST ARROW TO LONG BAR / UPPER LEFT ARROW TO LONG BAR
+\\barr                      \\barr                       "            : (Incomplete sequence)
+\\barrightarrowdiamond      <char-0x02920>               " ⤠          : RIGHTWARDS ARROW FROM BAR TO BLACK DIAMOND
+\\barv                      \\barv                       "            : (Incomplete sequence)
+\\barvee                    <char-0x022BD>               " ⊽          : NOR
+\\barw                      \\barw                       "            : (Incomplete sequence)
+\\barwedge                  <char-0x022BC>               " ⊼          : NAND
+\\bbA                       <char-0x1D538>               " 𝔸          : MATHEMATICAL DOUBLE-STRUCK CAPITAL A
+\\bbB                       <char-0x1D539>               " 𝔹          : MATHEMATICAL DOUBLE-STRUCK CAPITAL B
+\\bbC                       <char-0x02102>               " ℂ          : DOUBLE-STRUCK CAPITAL C / DOUBLE-STRUCK C
+\\bbD                       <char-0x1D53B>               " 𝔻          : MATHEMATICAL DOUBLE-STRUCK CAPITAL D
+\\bbE                       <char-0x1D53C>               " 𝔼          : MATHEMATICAL DOUBLE-STRUCK CAPITAL E
+\\bbF                       <char-0x1D53D>               " 𝔽          : MATHEMATICAL DOUBLE-STRUCK CAPITAL F
+\\bbG                       <char-0x1D53E>               " 𝔾          : MATHEMATICAL DOUBLE-STRUCK CAPITAL G
+\\bbG<Tab>                  <char-0x1D53E>               " 𝔾          : MATHEMATICAL DOUBLE-STRUCK CAPITAL G
+\\bbGa                      \\bbGa                       "            : (Incomplete sequence)
+\\bbGamma                   <char-0x0213E>               " ℾ          : DOUBLE-STRUCK CAPITAL GAMMA
+\\bbH                       <char-0x0210D>               " ℍ          : DOUBLE-STRUCK CAPITAL H / DOUBLE-STRUCK H
+\\bbI                       <char-0x1D540>               " 𝕀          : MATHEMATICAL DOUBLE-STRUCK CAPITAL I
+\\bbJ                       <char-0x1D541>               " 𝕁          : MATHEMATICAL DOUBLE-STRUCK CAPITAL J
+\\bbK                       <char-0x1D542>               " 𝕂          : MATHEMATICAL DOUBLE-STRUCK CAPITAL K
+\\bbL                       <char-0x1D543>               " 𝕃          : MATHEMATICAL DOUBLE-STRUCK CAPITAL L
+\\bbM                       <char-0x1D544>               " 𝕄          : MATHEMATICAL DOUBLE-STRUCK CAPITAL M
+\\bbN                       <char-0x02115>               " ℕ          : DOUBLE-STRUCK CAPITAL N / DOUBLE-STRUCK N
+\\bbO                       <char-0x1D546>               " 𝕆          : MATHEMATICAL DOUBLE-STRUCK CAPITAL O
+\\bbP                       <char-0x02119>               " ℙ          : DOUBLE-STRUCK CAPITAL P / DOUBLE-STRUCK P
+\\bbP<Tab>                  <char-0x02119>               " ℙ          : DOUBLE-STRUCK CAPITAL P / DOUBLE-STRUCK P
+\\bbPi                      <char-0x0213F>               " ℿ          : DOUBLE-STRUCK CAPITAL PI
+\\bbQ                       <char-0x0211A>               " ℚ          : DOUBLE-STRUCK CAPITAL Q / DOUBLE-STRUCK Q
+\\bbR                       <char-0x0211D>               " ℝ          : DOUBLE-STRUCK CAPITAL R / DOUBLE-STRUCK R
+\\bbS                       <char-0x1D54A>               " 𝕊          : MATHEMATICAL DOUBLE-STRUCK CAPITAL S
+\\bbT                       <char-0x1D54B>               " 𝕋          : MATHEMATICAL DOUBLE-STRUCK CAPITAL T
+\\bbU                       <char-0x1D54C>               " 𝕌          : MATHEMATICAL DOUBLE-STRUCK CAPITAL U
+\\bbV                       <char-0x1D54D>               " 𝕍          : MATHEMATICAL DOUBLE-STRUCK CAPITAL V
+\\bbW                       <char-0x1D54E>               " 𝕎          : MATHEMATICAL DOUBLE-STRUCK CAPITAL W
+\\bbX                       <char-0x1D54F>               " 𝕏          : MATHEMATICAL DOUBLE-STRUCK CAPITAL X
+\\bbY                       <char-0x1D550>               " 𝕐          : MATHEMATICAL DOUBLE-STRUCK CAPITAL Y
+\\bbZ                       <char-0x02124>               " ℤ          : DOUBLE-STRUCK CAPITAL Z / DOUBLE-STRUCK Z
+\\bba                       <char-0x1D552>               " 𝕒          : MATHEMATICAL DOUBLE-STRUCK SMALL A
+\\bbb                       <char-0x1D553>               " 𝕓          : MATHEMATICAL DOUBLE-STRUCK SMALL B
+\\bbc                       <char-0x1D554>               " 𝕔          : MATHEMATICAL DOUBLE-STRUCK SMALL C
+\\bbd                       <char-0x1D555>               " 𝕕          : MATHEMATICAL DOUBLE-STRUCK SMALL D
+\\bbe                       <char-0x1D556>               " 𝕖          : MATHEMATICAL DOUBLE-STRUCK SMALL E
+\\bbe<Tab>                  <char-0x1D556>               " 𝕖          : MATHEMATICAL DOUBLE-STRUCK SMALL E
+\\bbei                      \\bbei                       "            : (Incomplete sequence)
+\\bbeight                   <char-0x1D7E0>               " 𝟠          : MATHEMATICAL DOUBLE-STRUCK DIGIT EIGHT
+\\bbf                       <char-0x1D557>               " 𝕗          : MATHEMATICAL DOUBLE-STRUCK SMALL F
+\\bbf<Tab>                  <char-0x1D557>               " 𝕗          : MATHEMATICAL DOUBLE-STRUCK SMALL F
+\\bbfi                      \\bbfi                       "            : (Incomplete sequence)
+\\bbfive                    <char-0x1D7DD>               " 𝟝          : MATHEMATICAL DOUBLE-STRUCK DIGIT FIVE
+\\bbfo                      \\bbfo                       "            : (Incomplete sequence)
+\\bbfour                    <char-0x1D7DC>               " 𝟜          : MATHEMATICAL DOUBLE-STRUCK DIGIT FOUR
+\\bbg                       <char-0x1D558>               " 𝕘          : MATHEMATICAL DOUBLE-STRUCK SMALL G
+\\bbg<Tab>                  <char-0x1D558>               " 𝕘          : MATHEMATICAL DOUBLE-STRUCK SMALL G
+\\bbga                      \\bbga                       "            : (Incomplete sequence)
+\\bbgamma                   <char-0x0213D>               " ℽ          : DOUBLE-STRUCK SMALL GAMMA
+\\bbh                       <char-0x1D559>               " 𝕙          : MATHEMATICAL DOUBLE-STRUCK SMALL H
+\\bbi                       <char-0x1D55A>               " 𝕚          : MATHEMATICAL DOUBLE-STRUCK SMALL I
+\\bbi<Tab>                  <char-0x1D55A>               " 𝕚          : MATHEMATICAL DOUBLE-STRUCK SMALL I
+\\bbiD                      <char-0x02145>               " ⅅ          : DOUBLE-STRUCK ITALIC CAPITAL D
+\\bbid                      <char-0x02146>               " ⅆ          : DOUBLE-STRUCK ITALIC SMALL D
+\\bbie                      <char-0x02147>               " ⅇ          : DOUBLE-STRUCK ITALIC SMALL E
+\\bbii                      <char-0x02148>               " ⅈ          : DOUBLE-STRUCK ITALIC SMALL I
+\\bbij                      <char-0x02149>               " ⅉ          : DOUBLE-STRUCK ITALIC SMALL J
+\\bbj                       <char-0x1D55B>               " 𝕛          : MATHEMATICAL DOUBLE-STRUCK SMALL J
+\\bbk                       <char-0x1D55C>               " 𝕜          : MATHEMATICAL DOUBLE-STRUCK SMALL K
+\\bbl                       <char-0x1D55D>               " 𝕝          : MATHEMATICAL DOUBLE-STRUCK SMALL L
+\\bbm                       <char-0x1D55E>               " 𝕞          : MATHEMATICAL DOUBLE-STRUCK SMALL M
+\\bbn                       <char-0x1D55F>               " 𝕟          : MATHEMATICAL DOUBLE-STRUCK SMALL N
+\\bbn<Tab>                  <char-0x1D55F>               " 𝕟          : MATHEMATICAL DOUBLE-STRUCK SMALL N
+\\bbni                      \\bbni                       "            : (Incomplete sequence)
+\\bbnine                    <char-0x1D7E1>               " 𝟡          : MATHEMATICAL DOUBLE-STRUCK DIGIT NINE
+\\bbo                       <char-0x1D560>               " 𝕠          : MATHEMATICAL DOUBLE-STRUCK SMALL O
+\\bbo<Tab>                  <char-0x1D560>               " 𝕠          : MATHEMATICAL DOUBLE-STRUCK SMALL O
+\\bbon                      \\bbon                       "            : (Incomplete sequence)
+\\bbone                     <char-0x1D7D9>               " 𝟙          : MATHEMATICAL DOUBLE-STRUCK DIGIT ONE
+\\bbp                       <char-0x1D561>               " 𝕡          : MATHEMATICAL DOUBLE-STRUCK SMALL P
+\\bbp<Tab>                  <char-0x1D561>               " 𝕡          : MATHEMATICAL DOUBLE-STRUCK SMALL P
+\\bbpi                      <char-0x0213C>               " ℼ          : DOUBLE-STRUCK SMALL PI
+\\bbq                       <char-0x1D562>               " 𝕢          : MATHEMATICAL DOUBLE-STRUCK SMALL Q
+\\bbr                       <char-0x1D563>               " 𝕣          : MATHEMATICAL DOUBLE-STRUCK SMALL R
+\\bbr<Tab>                  <char-0x1D563>               " 𝕣          : MATHEMATICAL DOUBLE-STRUCK SMALL R
+\\bbrk                      \\bbrk                       "            : (Incomplete sequence)
+\\bbrktbrk                  <char-0x023B6>               " ⎶          : BOTTOM SQUARE BRACKET OVER TOP SQUARE BRACKET
+\\bbs                       <char-0x1D564>               " 𝕤          : MATHEMATICAL DOUBLE-STRUCK SMALL S
+\\bbs<Tab>                  <char-0x1D564>               " 𝕤          : MATHEMATICAL DOUBLE-STRUCK SMALL S
+\\bbse                      \\bbse                       "            : (Incomplete sequence)
+\\bbsemi                    <char-0x02A1F>               " ⨟          : Z NOTATION SCHEMA COMPOSITION
+\\bbseven                   <char-0x1D7DF>               " 𝟟          : MATHEMATICAL DOUBLE-STRUCK DIGIT SEVEN
+\\bbsi                      \\bbsi                       "            : (Incomplete sequence)
+\\bbsix                     <char-0x1D7DE>               " 𝟞          : MATHEMATICAL DOUBLE-STRUCK DIGIT SIX
+\\bbsu                      \\bbsu                       "            : (Incomplete sequence)
+\\bbsum                     <char-0x02140>               " ⅀          : DOUBLE-STRUCK N-ARY SUMMATION
+\\bbt                       <char-0x1D565>               " 𝕥          : MATHEMATICAL DOUBLE-STRUCK SMALL T
+\\bbt<Tab>                  <char-0x1D565>               " 𝕥          : MATHEMATICAL DOUBLE-STRUCK SMALL T
+\\bbth                      \\bbth                       "            : (Incomplete sequence)
+\\bbthree                   <char-0x1D7DB>               " 𝟛          : MATHEMATICAL DOUBLE-STRUCK DIGIT THREE
+\\bbtw                      \\bbtw                       "            : (Incomplete sequence)
+\\bbtwo                     <char-0x1D7DA>               " 𝟚          : MATHEMATICAL DOUBLE-STRUCK DIGIT TWO
+\\bbu                       <char-0x1D566>               " 𝕦          : MATHEMATICAL DOUBLE-STRUCK SMALL U
+\\bbv                       <char-0x1D567>               " 𝕧          : MATHEMATICAL DOUBLE-STRUCK SMALL V
+\\bbw                       <char-0x1D568>               " 𝕨          : MATHEMATICAL DOUBLE-STRUCK SMALL W
+\\bbx                       <char-0x1D569>               " 𝕩          : MATHEMATICAL DOUBLE-STRUCK SMALL X
+\\bby                       <char-0x1D56A>               " 𝕪          : MATHEMATICAL DOUBLE-STRUCK SMALL Y
+\\bbz                       <char-0x1D56B>               " 𝕫          : MATHEMATICAL DOUBLE-STRUCK SMALL Z
+\\bbz<Tab>                  <char-0x1D56B>               " 𝕫          : MATHEMATICAL DOUBLE-STRUCK SMALL Z
+\\bbze                      \\bbze                       "            : (Incomplete sequence)
+\\bbzero                    <char-0x1D7D8>               " 𝟘          : MATHEMATICAL DOUBLE-STRUCK DIGIT ZERO
+\\because                   <char-0x02235>               " ∵          : BECAUSE
+\\benzenr                   <char-0x023E3>               " ⏣          : BENZENE RING WITH CIRCLE
+\\beta                      <char-0x003B2>               " β          : GREEK SMALL LETTER BETA
+\\beth                      <char-0x02136>               " ℶ          : BET SYMBOL / SECOND TRANSFINITE CARDINAL
+\\between                   <char-0x0226C>               " ≬          : BETWEEN
+\\bfA                       <char-0x1D400>               " 𝐀          : MATHEMATICAL BOLD CAPITAL A
+\\bfA<Tab>                  <char-0x1D400>               " 𝐀          : MATHEMATICAL BOLD CAPITAL A
+\\bfAl                      \\bfAl                       "            : (Incomplete sequence)
+\\bfAlpha                   <char-0x1D6A8>               " 𝚨          : MATHEMATICAL BOLD CAPITAL ALPHA
+\\bfB                       <char-0x1D401>               " 𝐁          : MATHEMATICAL BOLD CAPITAL B
+\\bfB<Tab>                  <char-0x1D401>               " 𝐁          : MATHEMATICAL BOLD CAPITAL B
+\\bfBe                      \\bfBe                       "            : (Incomplete sequence)
+\\bfBeta                    <char-0x1D6A9>               " 𝚩          : MATHEMATICAL BOLD CAPITAL BETA
+\\bfC                       <char-0x1D402>               " 𝐂          : MATHEMATICAL BOLD CAPITAL C
+\\bfC<Tab>                  <char-0x1D402>               " 𝐂          : MATHEMATICAL BOLD CAPITAL C
+\\bfCh                      \\bfCh                       "            : (Incomplete sequence)
+\\bfChi                     <char-0x1D6BE>               " 𝚾          : MATHEMATICAL BOLD CAPITAL CHI
+\\bfD                       <char-0x1D403>               " 𝐃          : MATHEMATICAL BOLD CAPITAL D
+\\bfD<Tab>                  <char-0x1D403>               " 𝐃          : MATHEMATICAL BOLD CAPITAL D
+\\bfDe                      \\bfDe                       "            : (Incomplete sequence)
+\\bfDelta                   <char-0x1D6AB>               " 𝚫          : MATHEMATICAL BOLD CAPITAL DELTA
+\\bfDi                      \\bfDi                       "            : (Incomplete sequence)
+\\bfDigamma                 <char-0x1D7CA>               " 𝟊          : MATHEMATICAL BOLD CAPITAL DIGAMMA
+\\bfE                       <char-0x1D404>               " 𝐄          : MATHEMATICAL BOLD CAPITAL E
+\\bfE<Tab>                  <char-0x1D404>               " 𝐄          : MATHEMATICAL BOLD CAPITAL E
+\\bfEp                      \\bfEp                       "            : (Incomplete sequence)
+\\bfEpsilon                 <char-0x1D6AC>               " 𝚬          : MATHEMATICAL BOLD CAPITAL EPSILON
+\\bfEt                      \\bfEt                       "            : (Incomplete sequence)
+\\bfEta                     <char-0x1D6AE>               " 𝚮          : MATHEMATICAL BOLD CAPITAL ETA
+\\bfF                       <char-0x1D405>               " 𝐅          : MATHEMATICAL BOLD CAPITAL F
+\\bfG                       <char-0x1D406>               " 𝐆          : MATHEMATICAL BOLD CAPITAL G
+\\bfG<Tab>                  <char-0x1D406>               " 𝐆          : MATHEMATICAL BOLD CAPITAL G
+\\bfGa                      \\bfGa                       "            : (Incomplete sequence)
+\\bfGamma                   <char-0x1D6AA>               " 𝚪          : MATHEMATICAL BOLD CAPITAL GAMMA
+\\bfH                       <char-0x1D407>               " 𝐇          : MATHEMATICAL BOLD CAPITAL H
+\\bfI                       <char-0x1D408>               " 𝐈          : MATHEMATICAL BOLD CAPITAL I
+\\bfI<Tab>                  <char-0x1D408>               " 𝐈          : MATHEMATICAL BOLD CAPITAL I
+\\bfIo                      \\bfIo                       "            : (Incomplete sequence)
+\\bfIota                    <char-0x1D6B0>               " 𝚰          : MATHEMATICAL BOLD CAPITAL IOTA
+\\bfJ                       <char-0x1D409>               " 𝐉          : MATHEMATICAL BOLD CAPITAL J
+\\bfK                       <char-0x1D40A>               " 𝐊          : MATHEMATICAL BOLD CAPITAL K
+\\bfK<Tab>                  <char-0x1D40A>               " 𝐊          : MATHEMATICAL BOLD CAPITAL K
+\\bfKa                      \\bfKa                       "            : (Incomplete sequence)
+\\bfKappa                   <char-0x1D6B1>               " 𝚱          : MATHEMATICAL BOLD CAPITAL KAPPA
+\\bfL                       <char-0x1D40B>               " 𝐋          : MATHEMATICAL BOLD CAPITAL L
+\\bfL<Tab>                  <char-0x1D40B>               " 𝐋          : MATHEMATICAL BOLD CAPITAL L
+\\bfLa                      \\bfLa                       "            : (Incomplete sequence)
+\\bfLambda                  <char-0x1D6B2>               " 𝚲          : MATHEMATICAL BOLD CAPITAL LAMDA
+\\bfM                       <char-0x1D40C>               " 𝐌          : MATHEMATICAL BOLD CAPITAL M
+\\bfM<Tab>                  <char-0x1D40C>               " 𝐌          : MATHEMATICAL BOLD CAPITAL M
+\\bfMu                      <char-0x1D6B3>               " 𝚳          : MATHEMATICAL BOLD CAPITAL MU
+\\bfN                       <char-0x1D40D>               " 𝐍          : MATHEMATICAL BOLD CAPITAL N
+\\bfN<Tab>                  <char-0x1D40D>               " 𝐍          : MATHEMATICAL BOLD CAPITAL N
+\\bfNu                      <char-0x1D6B4>               " 𝚴          : MATHEMATICAL BOLD CAPITAL NU
+\\bfO                       <char-0x1D40E>               " 𝐎          : MATHEMATICAL BOLD CAPITAL O
+\\bfO<Tab>                  <char-0x1D40E>               " 𝐎          : MATHEMATICAL BOLD CAPITAL O
+\\bfOm                      \\bfOm                       "            : (Incomplete sequence)
+\\bfOmega                   <char-0x1D6C0>               " 𝛀          : MATHEMATICAL BOLD CAPITAL OMEGA
+\\bfOmicron                 <char-0x1D6B6>               " 𝚶          : MATHEMATICAL BOLD CAPITAL OMICRON
+\\bfP                       <char-0x1D40F>               " 𝐏          : MATHEMATICAL BOLD CAPITAL P
+\\bfP<Tab>                  <char-0x1D40F>               " 𝐏          : MATHEMATICAL BOLD CAPITAL P
+\\bfPh                      \\bfPh                       "            : (Incomplete sequence)
+\\bfPhi                     <char-0x1D6BD>               " 𝚽          : MATHEMATICAL BOLD CAPITAL PHI
+\\bfPi                      <char-0x1D6B7>               " 𝚷          : MATHEMATICAL BOLD CAPITAL PI
+\\bfPs                      \\bfPs                       "            : (Incomplete sequence)
+\\bfPsi                     <char-0x1D6BF>               " 𝚿          : MATHEMATICAL BOLD CAPITAL PSI
+\\bfQ                       <char-0x1D410>               " 𝐐          : MATHEMATICAL BOLD CAPITAL Q
+\\bfR                       <char-0x1D411>               " 𝐑          : MATHEMATICAL BOLD CAPITAL R
+\\bfR<Tab>                  <char-0x1D411>               " 𝐑          : MATHEMATICAL BOLD CAPITAL R
+\\bfRh                      \\bfRh                       "            : (Incomplete sequence)
+\\bfRho                     <char-0x1D6B8>               " 𝚸          : MATHEMATICAL BOLD CAPITAL RHO
+\\bfS                       <char-0x1D412>               " 𝐒          : MATHEMATICAL BOLD CAPITAL S
+\\bfS<Tab>                  <char-0x1D412>               " 𝐒          : MATHEMATICAL BOLD CAPITAL S
+\\bfSi                      \\bfSi                       "            : (Incomplete sequence)
+\\bfSigma                   <char-0x1D6BA>               " 𝚺          : MATHEMATICAL BOLD CAPITAL SIGMA
+\\bfT                       <char-0x1D413>               " 𝐓          : MATHEMATICAL BOLD CAPITAL T
+\\bfT<Tab>                  <char-0x1D413>               " 𝐓          : MATHEMATICAL BOLD CAPITAL T
+\\bfTa                      \\bfTa                       "            : (Incomplete sequence)
+\\bfTau                     <char-0x1D6BB>               " 𝚻          : MATHEMATICAL BOLD CAPITAL TAU
+\\bfTh                      \\bfTh                       "            : (Incomplete sequence)
+\\bfTheta                   <char-0x1D6AF>               " 𝚯          : MATHEMATICAL BOLD CAPITAL THETA
+\\bfU                       <char-0x1D414>               " 𝐔          : MATHEMATICAL BOLD CAPITAL U
+\\bfU<Tab>                  <char-0x1D414>               " 𝐔          : MATHEMATICAL BOLD CAPITAL U
+\\bfUp                      \\bfUp                       "            : (Incomplete sequence)
+\\bfUpsilon                 <char-0x1D6BC>               " 𝚼          : MATHEMATICAL BOLD CAPITAL UPSILON
+\\bfV                       <char-0x1D415>               " 𝐕          : MATHEMATICAL BOLD CAPITAL V
+\\bfW                       <char-0x1D416>               " 𝐖          : MATHEMATICAL BOLD CAPITAL W
+\\bfX                       <char-0x1D417>               " 𝐗          : MATHEMATICAL BOLD CAPITAL X
+\\bfX<Tab>                  <char-0x1D417>               " 𝐗          : MATHEMATICAL BOLD CAPITAL X
+\\bfXi                      <char-0x1D6B5>               " 𝚵          : MATHEMATICAL BOLD CAPITAL XI
+\\bfY                       <char-0x1D418>               " 𝐘          : MATHEMATICAL BOLD CAPITAL Y
+\\bfZ                       <char-0x1D419>               " 𝐙          : MATHEMATICAL BOLD CAPITAL Z
+\\bfZ<Tab>                  <char-0x1D419>               " 𝐙          : MATHEMATICAL BOLD CAPITAL Z
+\\bfZe                      \\bfZe                       "            : (Incomplete sequence)
+\\bfZeta                    <char-0x1D6AD>               " 𝚭          : MATHEMATICAL BOLD CAPITAL ZETA
+\\bfa                       <char-0x1D41A>               " 𝐚          : MATHEMATICAL BOLD SMALL A
+\\bfa<Tab>                  <char-0x1D41A>               " 𝐚          : MATHEMATICAL BOLD SMALL A
+\\bfal                      \\bfal                       "            : (Incomplete sequence)
+\\bfalpha                   <char-0x1D6C2>               " 𝛂          : MATHEMATICAL BOLD SMALL ALPHA
+\\bfb                       <char-0x1D41B>               " 𝐛          : MATHEMATICAL BOLD SMALL B
+\\bfb<Tab>                  <char-0x1D41B>               " 𝐛          : MATHEMATICAL BOLD SMALL B
+\\bfbe                      \\bfbe                       "            : (Incomplete sequence)
+\\bfbeta                    <char-0x1D6C3>               " 𝛃          : MATHEMATICAL BOLD SMALL BETA
+\\bfc                       <char-0x1D41C>               " 𝐜          : MATHEMATICAL BOLD SMALL C
+\\bfc<Tab>                  <char-0x1D41C>               " 𝐜          : MATHEMATICAL BOLD SMALL C
+\\bfch                      \\bfch                       "            : (Incomplete sequence)
+\\bfchi                     <char-0x1D6D8>               " 𝛘          : MATHEMATICAL BOLD SMALL CHI
+\\bfd                       <char-0x1D41D>               " 𝐝          : MATHEMATICAL BOLD SMALL D
+\\bfd<Tab>                  <char-0x1D41D>               " 𝐝          : MATHEMATICAL BOLD SMALL D
+\\bfde                      \\bfde                       "            : (Incomplete sequence)
+\\bfdelta                   <char-0x1D6C5>               " 𝛅          : MATHEMATICAL BOLD SMALL DELTA
+\\bfdi                      \\bfdi                       "            : (Incomplete sequence)
+\\bfdigamma                 <char-0x1D7CB>               " 𝟋          : MATHEMATICAL BOLD SMALL DIGAMMA
+\\bfe                       <char-0x1D41E>               " 𝐞          : MATHEMATICAL BOLD SMALL E
+\\bfe<Tab>                  <char-0x1D41E>               " 𝐞          : MATHEMATICAL BOLD SMALL E
+\\bfei                      \\bfei                       "            : (Incomplete sequence)
+\\bfeight                   <char-0x1D7D6>               " 𝟖          : MATHEMATICAL BOLD DIGIT EIGHT
+\\bfep                      \\bfep                       "            : (Incomplete sequence)
+\\bfepsilon                 <char-0x1D6DC>               " 𝛜          : MATHEMATICAL BOLD EPSILON SYMBOL
+\\bfet                      \\bfet                       "            : (Incomplete sequence)
+\\bfeta                     <char-0x1D6C8>               " 𝛈          : MATHEMATICAL BOLD SMALL ETA
+\\bff                       <char-0x1D41F>               " 𝐟          : MATHEMATICAL BOLD SMALL F
+\\bff<Tab>                  <char-0x1D41F>               " 𝐟          : MATHEMATICAL BOLD SMALL F
+\\bffi                      \\bffi                       "            : (Incomplete sequence)
+\\bffive                    <char-0x1D7D3>               " 𝟓          : MATHEMATICAL BOLD DIGIT FIVE
+\\bffo                      \\bffo                       "            : (Incomplete sequence)
+\\bffour                    <char-0x1D7D2>               " 𝟒          : MATHEMATICAL BOLD DIGIT FOUR
+\\bfg                       <char-0x1D420>               " 𝐠          : MATHEMATICAL BOLD SMALL G
+\\bfg<Tab>                  <char-0x1D420>               " 𝐠          : MATHEMATICAL BOLD SMALL G
+\\bfga                      \\bfga                       "            : (Incomplete sequence)
+\\bfgamma                   <char-0x1D6C4>               " 𝛄          : MATHEMATICAL BOLD SMALL GAMMA
+\\bfh                       <char-0x1D421>               " 𝐡          : MATHEMATICAL BOLD SMALL H
+\\bfi                       <char-0x1D422>               " 𝐢          : MATHEMATICAL BOLD SMALL I
+\\bfi<Tab>                  <char-0x1D422>               " 𝐢          : MATHEMATICAL BOLD SMALL I
+\\bfio                      \\bfio                       "            : (Incomplete sequence)
+\\bfiota                    <char-0x1D6CA>               " 𝛊          : MATHEMATICAL BOLD SMALL IOTA
+\\bfj                       <char-0x1D423>               " 𝐣          : MATHEMATICAL BOLD SMALL J
+\\bfk                       <char-0x1D424>               " 𝐤          : MATHEMATICAL BOLD SMALL K
+\\bfk<Tab>                  <char-0x1D424>               " 𝐤          : MATHEMATICAL BOLD SMALL K
+\\bfka                      \\bfka                       "            : (Incomplete sequence)
+\\bfkappa                   <char-0x1D6CB>               " 𝛋          : MATHEMATICAL BOLD SMALL KAPPA
+\\bfl                       <char-0x1D425>               " 𝐥          : MATHEMATICAL BOLD SMALL L
+\\bfl<Tab>                  <char-0x1D425>               " 𝐥          : MATHEMATICAL BOLD SMALL L
+\\bfla                      \\bfla                       "            : (Incomplete sequence)
+\\bflambda                  <char-0x1D6CC>               " 𝛌          : MATHEMATICAL BOLD SMALL LAMDA
+\\bfm                       <char-0x1D426>               " 𝐦          : MATHEMATICAL BOLD SMALL M
+\\bfm<Tab>                  <char-0x1D426>               " 𝐦          : MATHEMATICAL BOLD SMALL M
+\\bfmu                      <char-0x1D6CD>               " 𝛍          : MATHEMATICAL BOLD SMALL MU
+\\bfn                       <char-0x1D427>               " 𝐧          : MATHEMATICAL BOLD SMALL N
+\\bfn<Tab>                  <char-0x1D427>               " 𝐧          : MATHEMATICAL BOLD SMALL N
+\\bfna                      \\bfna                       "            : (Incomplete sequence)
+\\bfnabla                   <char-0x1D6C1>               " 𝛁          : MATHEMATICAL BOLD NABLA
+\\bfni                      \\bfni                       "            : (Incomplete sequence)
+\\bfnine                    <char-0x1D7D7>               " 𝟗          : MATHEMATICAL BOLD DIGIT NINE
+\\bfnu                      <char-0x1D6CE>               " 𝛎          : MATHEMATICAL BOLD SMALL NU
+\\bfo                       <char-0x1D428>               " 𝐨          : MATHEMATICAL BOLD SMALL O
+\\bfo<Tab>                  <char-0x1D428>               " 𝐨          : MATHEMATICAL BOLD SMALL O
+\\bfom                      \\bfom                       "            : (Incomplete sequence)
+\\bfomega                   <char-0x1D6DA>               " 𝛚          : MATHEMATICAL BOLD SMALL OMEGA
+\\bfomicron                 <char-0x1D6D0>               " 𝛐          : MATHEMATICAL BOLD SMALL OMICRON
+\\bfon                      \\bfon                       "            : (Incomplete sequence)
+\\bfone                     <char-0x1D7CF>               " 𝟏          : MATHEMATICAL BOLD DIGIT ONE
+\\bfp                       <char-0x1D429>               " 𝐩          : MATHEMATICAL BOLD SMALL P
+\\bfp<Tab>                  <char-0x1D429>               " 𝐩          : MATHEMATICAL BOLD SMALL P
+\\bfpa                      \\bfpa                       "            : (Incomplete sequence)
+\\bfpartial                 <char-0x1D6DB>               " 𝛛          : MATHEMATICAL BOLD PARTIAL DIFFERENTIAL
+\\bfph                      \\bfph                       "            : (Incomplete sequence)
+\\bfphi                     <char-0x1D6DF>               " 𝛟          : MATHEMATICAL BOLD PHI SYMBOL
+\\bfpi                      <char-0x1D6D1>               " 𝛑          : MATHEMATICAL BOLD SMALL PI
+\\bfps                      \\bfps                       "            : (Incomplete sequence)
+\\bfpsi                     <char-0x1D6D9>               " 𝛙          : MATHEMATICAL BOLD SMALL PSI
+\\bfq                       <char-0x1D42A>               " 𝐪          : MATHEMATICAL BOLD SMALL Q
+\\bfr                       <char-0x1D42B>               " 𝐫          : MATHEMATICAL BOLD SMALL R
+\\bfr<Tab>                  <char-0x1D42B>               " 𝐫          : MATHEMATICAL BOLD SMALL R
+\\bfra                      \\bfra                       "            : (Incomplete sequence)
+\\bfrakA                    <char-0x1D56C>               " 𝕬          : MATHEMATICAL BOLD FRAKTUR CAPITAL A
+\\bfrakB                    <char-0x1D56D>               " 𝕭          : MATHEMATICAL BOLD FRAKTUR CAPITAL B
+\\bfrakC                    <char-0x1D56E>               " 𝕮          : MATHEMATICAL BOLD FRAKTUR CAPITAL C
+\\bfrakD                    <char-0x1D56F>               " 𝕯          : MATHEMATICAL BOLD FRAKTUR CAPITAL D
+\\bfrakE                    <char-0x1D570>               " 𝕰          : MATHEMATICAL BOLD FRAKTUR CAPITAL E
+\\bfrakF                    <char-0x1D571>               " 𝕱          : MATHEMATICAL BOLD FRAKTUR CAPITAL F
+\\bfrakG                    <char-0x1D572>               " 𝕲          : MATHEMATICAL BOLD FRAKTUR CAPITAL G
+\\bfrakH                    <char-0x1D573>               " 𝕳          : MATHEMATICAL BOLD FRAKTUR CAPITAL H
+\\bfrakI                    <char-0x1D574>               " 𝕴          : MATHEMATICAL BOLD FRAKTUR CAPITAL I
+\\bfrakJ                    <char-0x1D575>               " 𝕵          : MATHEMATICAL BOLD FRAKTUR CAPITAL J
+\\bfrakK                    <char-0x1D576>               " 𝕶          : MATHEMATICAL BOLD FRAKTUR CAPITAL K
+\\bfrakL                    <char-0x1D577>               " 𝕷          : MATHEMATICAL BOLD FRAKTUR CAPITAL L
+\\bfrakM                    <char-0x1D578>               " 𝕸          : MATHEMATICAL BOLD FRAKTUR CAPITAL M
+\\bfrakN                    <char-0x1D579>               " 𝕹          : MATHEMATICAL BOLD FRAKTUR CAPITAL N
+\\bfrakO                    <char-0x1D57A>               " 𝕺          : MATHEMATICAL BOLD FRAKTUR CAPITAL O
+\\bfrakP                    <char-0x1D57B>               " 𝕻          : MATHEMATICAL BOLD FRAKTUR CAPITAL P
+\\bfrakQ                    <char-0x1D57C>               " 𝕼          : MATHEMATICAL BOLD FRAKTUR CAPITAL Q
+\\bfrakR                    <char-0x1D57D>               " 𝕽          : MATHEMATICAL BOLD FRAKTUR CAPITAL R
+\\bfrakS                    <char-0x1D57E>               " 𝕾          : MATHEMATICAL BOLD FRAKTUR CAPITAL S
+\\bfrakT                    <char-0x1D57F>               " 𝕿          : MATHEMATICAL BOLD FRAKTUR CAPITAL T
+\\bfrakU                    <char-0x1D580>               " 𝖀          : MATHEMATICAL BOLD FRAKTUR CAPITAL U
+\\bfrakV                    <char-0x1D581>               " 𝖁          : MATHEMATICAL BOLD FRAKTUR CAPITAL V
+\\bfrakW                    <char-0x1D582>               " 𝖂          : MATHEMATICAL BOLD FRAKTUR CAPITAL W
+\\bfrakX                    <char-0x1D583>               " 𝖃          : MATHEMATICAL BOLD FRAKTUR CAPITAL X
+\\bfrakY                    <char-0x1D584>               " 𝖄          : MATHEMATICAL BOLD FRAKTUR CAPITAL Y
+\\bfrakZ                    <char-0x1D585>               " 𝖅          : MATHEMATICAL BOLD FRAKTUR CAPITAL Z
+\\bfraka                    <char-0x1D586>               " 𝖆          : MATHEMATICAL BOLD FRAKTUR SMALL A
+\\bfrakb                    <char-0x1D587>               " 𝖇          : MATHEMATICAL BOLD FRAKTUR SMALL B
+\\bfrakc                    <char-0x1D588>               " 𝖈          : MATHEMATICAL BOLD FRAKTUR SMALL C
+\\bfrakd                    <char-0x1D589>               " 𝖉          : MATHEMATICAL BOLD FRAKTUR SMALL D
+\\bfrake                    <char-0x1D58A>               " 𝖊          : MATHEMATICAL BOLD FRAKTUR SMALL E
+\\bfrakf                    <char-0x1D58B>               " 𝖋          : MATHEMATICAL BOLD FRAKTUR SMALL F
+\\bfrakg                    <char-0x1D58C>               " 𝖌          : MATHEMATICAL BOLD FRAKTUR SMALL G
+\\bfrakh                    <char-0x1D58D>               " 𝖍          : MATHEMATICAL BOLD FRAKTUR SMALL H
+\\bfraki                    <char-0x1D58E>               " 𝖎          : MATHEMATICAL BOLD FRAKTUR SMALL I
+\\bfrakj                    <char-0x1D58F>               " 𝖏          : MATHEMATICAL BOLD FRAKTUR SMALL J
+\\bfrakk                    <char-0x1D590>               " 𝖐          : MATHEMATICAL BOLD FRAKTUR SMALL K
+\\bfrakl                    <char-0x1D591>               " 𝖑          : MATHEMATICAL BOLD FRAKTUR SMALL L
+\\bfrakm                    <char-0x1D592>               " 𝖒          : MATHEMATICAL BOLD FRAKTUR SMALL M
+\\bfrakn                    <char-0x1D593>               " 𝖓          : MATHEMATICAL BOLD FRAKTUR SMALL N
+\\bfrako                    <char-0x1D594>               " 𝖔          : MATHEMATICAL BOLD FRAKTUR SMALL O
+\\bfrakp                    <char-0x1D595>               " 𝖕          : MATHEMATICAL BOLD FRAKTUR SMALL P
+\\bfrakq                    <char-0x1D596>               " 𝖖          : MATHEMATICAL BOLD FRAKTUR SMALL Q
+\\bfrakr                    <char-0x1D597>               " 𝖗          : MATHEMATICAL BOLD FRAKTUR SMALL R
+\\bfraks                    <char-0x1D598>               " 𝖘          : MATHEMATICAL BOLD FRAKTUR SMALL S
+\\bfrakt                    <char-0x1D599>               " 𝖙          : MATHEMATICAL BOLD FRAKTUR SMALL T
+\\bfraku                    <char-0x1D59A>               " 𝖚          : MATHEMATICAL BOLD FRAKTUR SMALL U
+\\bfrakv                    <char-0x1D59B>               " 𝖛          : MATHEMATICAL BOLD FRAKTUR SMALL V
+\\bfrakw                    <char-0x1D59C>               " 𝖜          : MATHEMATICAL BOLD FRAKTUR SMALL W
+\\bfrakx                    <char-0x1D59D>               " 𝖝          : MATHEMATICAL BOLD FRAKTUR SMALL X
+\\bfraky                    <char-0x1D59E>               " 𝖞          : MATHEMATICAL BOLD FRAKTUR SMALL Y
+\\bfrakz                    <char-0x1D59F>               " 𝖟          : MATHEMATICAL BOLD FRAKTUR SMALL Z
+\\bfrh                      \\bfrh                       "            : (Incomplete sequence)
+\\bfrho                     <char-0x1D6D2>               " 𝛒          : MATHEMATICAL BOLD SMALL RHO
+\\bfs                       <char-0x1D42C>               " 𝐬          : MATHEMATICAL BOLD SMALL S
+\\bfs<Tab>                  <char-0x1D42C>               " 𝐬          : MATHEMATICAL BOLD SMALL S
+\\bfse                      \\bfse                       "            : (Incomplete sequence)
+\\bfseven                   <char-0x1D7D5>               " 𝟕          : MATHEMATICAL BOLD DIGIT SEVEN
+\\bfsi                      \\bfsi                       "            : (Incomplete sequence)
+\\bfsigma                   <char-0x1D6D4>               " 𝛔          : MATHEMATICAL BOLD SMALL SIGMA
+\\bfsix                     <char-0x1D7D4>               " 𝟔          : MATHEMATICAL BOLD DIGIT SIX
+\\bft                       <char-0x1D42D>               " 𝐭          : MATHEMATICAL BOLD SMALL T
+\\bft<Tab>                  <char-0x1D42D>               " 𝐭          : MATHEMATICAL BOLD SMALL T
+\\bfta                      \\bfta                       "            : (Incomplete sequence)
+\\bftau                     <char-0x1D6D5>               " 𝛕          : MATHEMATICAL BOLD SMALL TAU
+\\bfth                      \\bfth                       "            : (Incomplete sequence)
+\\bftheta                   <char-0x1D6C9>               " 𝛉          : MATHEMATICAL BOLD SMALL THETA
+\\bfthree                   <char-0x1D7D1>               " 𝟑          : MATHEMATICAL BOLD DIGIT THREE
+\\bftw                      \\bftw                       "            : (Incomplete sequence)
+\\bftwo                     <char-0x1D7D0>               " 𝟐          : MATHEMATICAL BOLD DIGIT TWO
+\\bfu                       <char-0x1D42E>               " 𝐮          : MATHEMATICAL BOLD SMALL U
+\\bfu<Tab>                  <char-0x1D42E>               " 𝐮          : MATHEMATICAL BOLD SMALL U
+\\bfup                      \\bfup                       "            : (Incomplete sequence)
+\\bfupsilon                 <char-0x1D6D6>               " 𝛖          : MATHEMATICAL BOLD SMALL UPSILON
+\\bfv                       <char-0x1D42F>               " 𝐯          : MATHEMATICAL BOLD SMALL V
+\\bfv<Tab>                  <char-0x1D42F>               " 𝐯          : MATHEMATICAL BOLD SMALL V
+\\bfva                      \\bfva                       "            : (Incomplete sequence)
+\\bfvarTheta                <char-0x1D6B9>               " 𝚹          : MATHEMATICAL BOLD CAPITAL THETA SYMBOL
+\\bfvarepsilon              <char-0x1D6C6>               " 𝛆          : MATHEMATICAL BOLD SMALL EPSILON
+\\bfvarkappa                <char-0x1D6DE>               " 𝛞          : MATHEMATICAL BOLD KAPPA SYMBOL
+\\bfvarphi                  <char-0x1D6D7>               " 𝛗          : MATHEMATICAL BOLD SMALL PHI
+\\bfvarpi                   <char-0x1D6E1>               " 𝛡          : MATHEMATICAL BOLD PI SYMBOL
+\\bfvarrho                  <char-0x1D6E0>               " 𝛠          : MATHEMATICAL BOLD RHO SYMBOL
+\\bfvarsigma                <char-0x1D6D3>               " 𝛓          : MATHEMATICAL BOLD SMALL FINAL SIGMA
+\\bfvartheta                <char-0x1D6DD>               " 𝛝          : MATHEMATICAL BOLD THETA SYMBOL
+\\bfw                       <char-0x1D430>               " 𝐰          : MATHEMATICAL BOLD SMALL W
+\\bfx                       <char-0x1D431>               " 𝐱          : MATHEMATICAL BOLD SMALL X
+\\bfx<Tab>                  <char-0x1D431>               " 𝐱          : MATHEMATICAL BOLD SMALL X
+\\bfxi                      <char-0x1D6CF>               " 𝛏          : MATHEMATICAL BOLD SMALL XI
+\\bfy                       <char-0x1D432>               " 𝐲          : MATHEMATICAL BOLD SMALL Y
+\\bfz                       <char-0x1D433>               " 𝐳          : MATHEMATICAL BOLD SMALL Z
+\\bfz<Tab>                  <char-0x1D433>               " 𝐳          : MATHEMATICAL BOLD SMALL Z
+\\bfze                      \\bfze                       "            : (Incomplete sequence)
+\\bfzero                    <char-0x1D7CE>               " 𝟎          : MATHEMATICAL BOLD DIGIT ZERO
+\\bfzeta                    <char-0x1D6C7>               " 𝛇          : MATHEMATICAL BOLD SMALL ZETA
+\\biA                       <char-0x1D468>               " 𝑨          : MATHEMATICAL BOLD ITALIC CAPITAL A
+\\biA<Tab>                  <char-0x1D468>               " 𝑨          : MATHEMATICAL BOLD ITALIC CAPITAL A
+\\biAl                      \\biAl                       "            : (Incomplete sequence)
+\\biAlpha                   <char-0x1D71C>               " 𝜜          : MATHEMATICAL BOLD ITALIC CAPITAL ALPHA
+\\biB                       <char-0x1D469>               " 𝑩          : MATHEMATICAL BOLD ITALIC CAPITAL B
+\\biB<Tab>                  <char-0x1D469>               " 𝑩          : MATHEMATICAL BOLD ITALIC CAPITAL B
+\\biBe                      \\biBe                       "            : (Incomplete sequence)
+\\biBeta                    <char-0x1D71D>               " 𝜝          : MATHEMATICAL BOLD ITALIC CAPITAL BETA
+\\biC                       <char-0x1D46A>               " 𝑪          : MATHEMATICAL BOLD ITALIC CAPITAL C
+\\biC<Tab>                  <char-0x1D46A>               " 𝑪          : MATHEMATICAL BOLD ITALIC CAPITAL C
+\\biCh                      \\biCh                       "            : (Incomplete sequence)
+\\biChi                     <char-0x1D732>               " 𝜲          : MATHEMATICAL BOLD ITALIC CAPITAL CHI
+\\biD                       <char-0x1D46B>               " 𝑫          : MATHEMATICAL BOLD ITALIC CAPITAL D
+\\biD<Tab>                  <char-0x1D46B>               " 𝑫          : MATHEMATICAL BOLD ITALIC CAPITAL D
+\\biDe                      \\biDe                       "            : (Incomplete sequence)
+\\biDelta                   <char-0x1D71F>               " 𝜟          : MATHEMATICAL BOLD ITALIC CAPITAL DELTA
+\\biE                       <char-0x1D46C>               " 𝑬          : MATHEMATICAL BOLD ITALIC CAPITAL E
+\\biE<Tab>                  <char-0x1D46C>               " 𝑬          : MATHEMATICAL BOLD ITALIC CAPITAL E
+\\biEp                      \\biEp                       "            : (Incomplete sequence)
+\\biEpsilon                 <char-0x1D720>               " 𝜠          : MATHEMATICAL BOLD ITALIC CAPITAL EPSILON
+\\biEt                      \\biEt                       "            : (Incomplete sequence)
+\\biEta                     <char-0x1D722>               " 𝜢          : MATHEMATICAL BOLD ITALIC CAPITAL ETA
+\\biF                       <char-0x1D46D>               " 𝑭          : MATHEMATICAL BOLD ITALIC CAPITAL F
+\\biG                       <char-0x1D46E>               " 𝑮          : MATHEMATICAL BOLD ITALIC CAPITAL G
+\\biG<Tab>                  <char-0x1D46E>               " 𝑮          : MATHEMATICAL BOLD ITALIC CAPITAL G
+\\biGa                      \\biGa                       "            : (Incomplete sequence)
+\\biGamma                   <char-0x1D71E>               " 𝜞          : MATHEMATICAL BOLD ITALIC CAPITAL GAMMA
+\\biH                       <char-0x1D46F>               " 𝑯          : MATHEMATICAL BOLD ITALIC CAPITAL H
+\\biI                       <char-0x1D470>               " 𝑰          : MATHEMATICAL BOLD ITALIC CAPITAL I
+\\biI<Tab>                  <char-0x1D470>               " 𝑰          : MATHEMATICAL BOLD ITALIC CAPITAL I
+\\biIo                      \\biIo                       "            : (Incomplete sequence)
+\\biIota                    <char-0x1D724>               " 𝜤          : MATHEMATICAL BOLD ITALIC CAPITAL IOTA
+\\biJ                       <char-0x1D471>               " 𝑱          : MATHEMATICAL BOLD ITALIC CAPITAL J
+\\biK                       <char-0x1D472>               " 𝑲          : MATHEMATICAL BOLD ITALIC CAPITAL K
+\\biK<Tab>                  <char-0x1D472>               " 𝑲          : MATHEMATICAL BOLD ITALIC CAPITAL K
+\\biKa                      \\biKa                       "            : (Incomplete sequence)
+\\biKappa                   <char-0x1D725>               " 𝜥          : MATHEMATICAL BOLD ITALIC CAPITAL KAPPA
+\\biL                       <char-0x1D473>               " 𝑳          : MATHEMATICAL BOLD ITALIC CAPITAL L
+\\biL<Tab>                  <char-0x1D473>               " 𝑳          : MATHEMATICAL BOLD ITALIC CAPITAL L
+\\biLa                      \\biLa                       "            : (Incomplete sequence)
+\\biLambda                  <char-0x1D726>               " 𝜦          : MATHEMATICAL BOLD ITALIC CAPITAL LAMDA
+\\biM                       <char-0x1D474>               " 𝑴          : MATHEMATICAL BOLD ITALIC CAPITAL M
+\\biM<Tab>                  <char-0x1D474>               " 𝑴          : MATHEMATICAL BOLD ITALIC CAPITAL M
+\\biMu                      <char-0x1D727>               " 𝜧          : MATHEMATICAL BOLD ITALIC CAPITAL MU
+\\biN                       <char-0x1D475>               " 𝑵          : MATHEMATICAL BOLD ITALIC CAPITAL N
+\\biN<Tab>                  <char-0x1D475>               " 𝑵          : MATHEMATICAL BOLD ITALIC CAPITAL N
+\\biNu                      <char-0x1D728>               " 𝜨          : MATHEMATICAL BOLD ITALIC CAPITAL NU
+\\biO                       <char-0x1D476>               " 𝑶          : MATHEMATICAL BOLD ITALIC CAPITAL O
+\\biO<Tab>                  <char-0x1D476>               " 𝑶          : MATHEMATICAL BOLD ITALIC CAPITAL O
+\\biOm                      \\biOm                       "            : (Incomplete sequence)
+\\biOmega                   <char-0x1D734>               " 𝜴          : MATHEMATICAL BOLD ITALIC CAPITAL OMEGA
+\\biOmicron                 <char-0x1D72A>               " 𝜪          : MATHEMATICAL BOLD ITALIC CAPITAL OMICRON
+\\biP                       <char-0x1D477>               " 𝑷          : MATHEMATICAL BOLD ITALIC CAPITAL P
+\\biP<Tab>                  <char-0x1D477>               " 𝑷          : MATHEMATICAL BOLD ITALIC CAPITAL P
+\\biPh                      \\biPh                       "            : (Incomplete sequence)
+\\biPhi                     <char-0x1D731>               " 𝜱          : MATHEMATICAL BOLD ITALIC CAPITAL PHI
+\\biPi                      <char-0x1D72B>               " 𝜫          : MATHEMATICAL BOLD ITALIC CAPITAL PI
+\\biPs                      \\biPs                       "            : (Incomplete sequence)
+\\biPsi                     <char-0x1D733>               " 𝜳          : MATHEMATICAL BOLD ITALIC CAPITAL PSI
+\\biQ                       <char-0x1D478>               " 𝑸          : MATHEMATICAL BOLD ITALIC CAPITAL Q
+\\biR                       <char-0x1D479>               " 𝑹          : MATHEMATICAL BOLD ITALIC CAPITAL R
+\\biR<Tab>                  <char-0x1D479>               " 𝑹          : MATHEMATICAL BOLD ITALIC CAPITAL R
+\\biRh                      \\biRh                       "            : (Incomplete sequence)
+\\biRho                     <char-0x1D72C>               " 𝜬          : MATHEMATICAL BOLD ITALIC CAPITAL RHO
+\\biS                       <char-0x1D47A>               " 𝑺          : MATHEMATICAL BOLD ITALIC CAPITAL S
+\\biS<Tab>                  <char-0x1D47A>               " 𝑺          : MATHEMATICAL BOLD ITALIC CAPITAL S
+\\biSi                      \\biSi                       "            : (Incomplete sequence)
+\\biSigma                   <char-0x1D72E>               " 𝜮          : MATHEMATICAL BOLD ITALIC CAPITAL SIGMA
+\\biT                       <char-0x1D47B>               " 𝑻          : MATHEMATICAL BOLD ITALIC CAPITAL T
+\\biT<Tab>                  <char-0x1D47B>               " 𝑻          : MATHEMATICAL BOLD ITALIC CAPITAL T
+\\biTa                      \\biTa                       "            : (Incomplete sequence)
+\\biTau                     <char-0x1D72F>               " 𝜯          : MATHEMATICAL BOLD ITALIC CAPITAL TAU
+\\biTh                      \\biTh                       "            : (Incomplete sequence)
+\\biTheta                   <char-0x1D723>               " 𝜣          : MATHEMATICAL BOLD ITALIC CAPITAL THETA
+\\biU                       <char-0x1D47C>               " 𝑼          : MATHEMATICAL BOLD ITALIC CAPITAL U
+\\biU<Tab>                  <char-0x1D47C>               " 𝑼          : MATHEMATICAL BOLD ITALIC CAPITAL U
+\\biUp                      \\biUp                       "            : (Incomplete sequence)
+\\biUpsilon                 <char-0x1D730>               " 𝜰          : MATHEMATICAL BOLD ITALIC CAPITAL UPSILON
+\\biV                       <char-0x1D47D>               " 𝑽          : MATHEMATICAL BOLD ITALIC CAPITAL V
+\\biW                       <char-0x1D47E>               " 𝑾          : MATHEMATICAL BOLD ITALIC CAPITAL W
+\\biX                       <char-0x1D47F>               " 𝑿          : MATHEMATICAL BOLD ITALIC CAPITAL X
+\\biX<Tab>                  <char-0x1D47F>               " 𝑿          : MATHEMATICAL BOLD ITALIC CAPITAL X
+\\biXi                      <char-0x1D729>               " 𝜩          : MATHEMATICAL BOLD ITALIC CAPITAL XI
+\\biY                       <char-0x1D480>               " 𝒀          : MATHEMATICAL BOLD ITALIC CAPITAL Y
+\\biZ                       <char-0x1D481>               " 𝒁          : MATHEMATICAL BOLD ITALIC CAPITAL Z
+\\biZ<Tab>                  <char-0x1D481>               " 𝒁          : MATHEMATICAL BOLD ITALIC CAPITAL Z
+\\biZe                      \\biZe                       "            : (Incomplete sequence)
+\\biZeta                    <char-0x1D721>               " 𝜡          : MATHEMATICAL BOLD ITALIC CAPITAL ZETA
+\\bia                       <char-0x1D482>               " 𝒂          : MATHEMATICAL BOLD ITALIC SMALL A
+\\bia<Tab>                  <char-0x1D482>               " 𝒂          : MATHEMATICAL BOLD ITALIC SMALL A
+\\bial                      \\bial                       "            : (Incomplete sequence)
+\\bialpha                   <char-0x1D736>               " 𝜶          : MATHEMATICAL BOLD ITALIC SMALL ALPHA
+\\bib                       <char-0x1D483>               " 𝒃          : MATHEMATICAL BOLD ITALIC SMALL B
+\\bib<Tab>                  <char-0x1D483>               " 𝒃          : MATHEMATICAL BOLD ITALIC SMALL B
+\\bibe                      \\bibe                       "            : (Incomplete sequence)
+\\bibeta                    <char-0x1D737>               " 𝜷          : MATHEMATICAL BOLD ITALIC SMALL BETA
+\\bic                       <char-0x1D484>               " 𝒄          : MATHEMATICAL BOLD ITALIC SMALL C
+\\bic<Tab>                  <char-0x1D484>               " 𝒄          : MATHEMATICAL BOLD ITALIC SMALL C
+\\bich                      \\bich                       "            : (Incomplete sequence)
+\\bichi                     <char-0x1D74C>               " 𝝌          : MATHEMATICAL BOLD ITALIC SMALL CHI
+\\bid                       <char-0x1D485>               " 𝒅          : MATHEMATICAL BOLD ITALIC SMALL D
+\\bid<Tab>                  <char-0x1D485>               " 𝒅          : MATHEMATICAL BOLD ITALIC SMALL D
+\\bide                      \\bide                       "            : (Incomplete sequence)
+\\bidelta                   <char-0x1D739>               " 𝜹          : MATHEMATICAL BOLD ITALIC SMALL DELTA
+\\bie                       <char-0x1D486>               " 𝒆          : MATHEMATICAL BOLD ITALIC SMALL E
+\\bie<Tab>                  <char-0x1D486>               " 𝒆          : MATHEMATICAL BOLD ITALIC SMALL E
+\\biep                      \\biep                       "            : (Incomplete sequence)
+\\biepsilon                 <char-0x1D750>               " 𝝐          : MATHEMATICAL BOLD ITALIC EPSILON SYMBOL
+\\biet                      \\biet                       "            : (Incomplete sequence)
+\\bieta                     <char-0x1D73C>               " 𝜼          : MATHEMATICAL BOLD ITALIC SMALL ETA
+\\bif                       <char-0x1D487>               " 𝒇          : MATHEMATICAL BOLD ITALIC SMALL F
+\\big                       <char-0x1D488>               " 𝒈          : MATHEMATICAL BOLD ITALIC SMALL G
+\\big<Tab>                  <char-0x1D488>               " 𝒈          : MATHEMATICAL BOLD ITALIC SMALL G
+\\biga                      \\biga                       "            : (Incomplete sequence)
+\\bigamma                   <char-0x1D738>               " 𝜸          : MATHEMATICAL BOLD ITALIC SMALL GAMMA
+\\bigb                      \\bigb                       "            : (Incomplete sequence)
+\\bigblacktriangledown      <char-0x025BC>               " ▼          : BLACK DOWN-POINTING TRIANGLE / BLACK DOWN POINTING TRIANGLE
+\\bigblacktriangleup        <char-0x025B2>               " ▲          : BLACK UP-POINTING TRIANGLE / BLACK UP POINTING TRIANGLE
+\\bigbot                    <char-0x027D8>               " ⟘          : LARGE UP TACK
+\\bigc                      \\bigc                       "            : (Incomplete sequence)
+\\bigcap                    <char-0x022C2>               " ⋂          : N-ARY INTERSECTION
+\\bigcirc                   <char-0x025CB>               " ○          : WHITE CIRCLE
+\\bigcup                    <char-0x022C3>               " ⋃          : N-ARY UNION
+\\bigcup<Tab>               <char-0x022C3>               " ⋃          : N-ARY UNION
+\\bigcupd                   \\bigcupd                    "            : (Incomplete sequence)
+\\bigcupdot                 <char-0x02A03>               " ⨃          : N-ARY UNION OPERATOR WITH DOT
+\\bigo                      \\bigo                       "            : (Incomplete sequence)
+\\bigodot                   <char-0x02A00>               " ⨀          : N-ARY CIRCLED DOT OPERATOR
+\\bigoplus                  <char-0x02A01>               " ⨁          : N-ARY CIRCLED PLUS OPERATOR
+\\bigotimes                 <char-0x02A02>               " ⨂          : N-ARY CIRCLED TIMES OPERATOR
+\\bigs                      \\bigs                       "            : (Incomplete sequence)
+\\bigslopedvee              <char-0x02A57>               " ⩗          : SLOPING LARGE OR
+\\bigslopedwedge            <char-0x02A58>               " ⩘          : SLOPING LARGE AND
+\\bigsqcap                  <char-0x02A05>               " ⨅          : N-ARY SQUARE INTERSECTION OPERATOR
+\\bigsqcup                  <char-0x02A06>               " ⨆          : N-ARY SQUARE UNION OPERATOR
+\\bigstar                   <char-0x02605>               " ★          : BLACK STAR
+\\bigt                      \\bigt                       "            : (Incomplete sequence)
+\\bigtimes                  <char-0x02A09>               " ⨉          : N-ARY TIMES OPERATOR
+\\bigtop                    <char-0x027D9>               " ⟙          : LARGE DOWN TACK
+\\bigtriangledown           <char-0x025BD>               " ▽          : WHITE DOWN-POINTING TRIANGLE / WHITE DOWN POINTING TRIANGLE
+\\bigtriangleup             <char-0x025B3>               " △          : WHITE UP-POINTING TRIANGLE / WHITE UP POINTING TRIANGLE
+\\bigu                      \\bigu                       "            : (Incomplete sequence)
+\\biguplus                  <char-0x02A04>               " ⨄          : N-ARY UNION OPERATOR WITH PLUS
+\\bigv                      \\bigv                       "            : (Incomplete sequence)
+\\bigvee                    <char-0x022C1>               " ⋁          : N-ARY LOGICAL OR
+\\bigw                      \\bigw                       "            : (Incomplete sequence)
+\\bigwedge                  <char-0x022C0>               " ⋀          : N-ARY LOGICAL AND
+\\bigwhitestar              <char-0x02606>               " ☆          : WHITE STAR
+\\bih                       <char-0x1D489>               " 𝒉          : MATHEMATICAL BOLD ITALIC SMALL H
+\\bii                       <char-0x1D48A>               " 𝒊          : MATHEMATICAL BOLD ITALIC SMALL I
+\\bii<Tab>                  <char-0x1D48A>               " 𝒊          : MATHEMATICAL BOLD ITALIC SMALL I
+\\biio                      \\biio                       "            : (Incomplete sequence)
+\\biiota                    <char-0x1D73E>               " 𝜾          : MATHEMATICAL BOLD ITALIC SMALL IOTA
+\\bij                       <char-0x1D48B>               " 𝒋          : MATHEMATICAL BOLD ITALIC SMALL J
+\\bik                       <char-0x1D48C>               " 𝒌          : MATHEMATICAL BOLD ITALIC SMALL K
+\\bik<Tab>                  <char-0x1D48C>               " 𝒌          : MATHEMATICAL BOLD ITALIC SMALL K
+\\bika                      \\bika                       "            : (Incomplete sequence)
+\\bikappa                   <char-0x1D73F>               " 𝜿          : MATHEMATICAL BOLD ITALIC SMALL KAPPA
+\\bil                       <char-0x1D48D>               " 𝒍          : MATHEMATICAL BOLD ITALIC SMALL L
+\\bil<Tab>                  <char-0x1D48D>               " 𝒍          : MATHEMATICAL BOLD ITALIC SMALL L
+\\bila                      \\bila                       "            : (Incomplete sequence)
+\\bilambda                  <char-0x1D740>               " 𝝀          : MATHEMATICAL BOLD ITALIC SMALL LAMDA
+\\bim                       <char-0x1D48E>               " 𝒎          : MATHEMATICAL BOLD ITALIC SMALL M
+\\bim<Tab>                  <char-0x1D48E>               " 𝒎          : MATHEMATICAL BOLD ITALIC SMALL M
+\\bimu                      <char-0x1D741>               " 𝝁          : MATHEMATICAL BOLD ITALIC SMALL MU
+\\bin                       <char-0x1D48F>               " 𝒏          : MATHEMATICAL BOLD ITALIC SMALL N
+\\bin<Tab>                  <char-0x1D48F>               " 𝒏          : MATHEMATICAL BOLD ITALIC SMALL N
+\\bina                      \\bina                       "            : (Incomplete sequence)
+\\binabla                   <char-0x1D735>               " 𝜵          : MATHEMATICAL BOLD ITALIC NABLA
+\\binu                      <char-0x1D742>               " 𝝂          : MATHEMATICAL BOLD ITALIC SMALL NU
+\\bio                       <char-0x1D490>               " 𝒐          : MATHEMATICAL BOLD ITALIC SMALL O
+\\bio<Tab>                  <char-0x1D490>               " 𝒐          : MATHEMATICAL BOLD ITALIC SMALL O
+\\biom                      \\biom                       "            : (Incomplete sequence)
+\\biomega                   <char-0x1D74E>               " 𝝎          : MATHEMATICAL BOLD ITALIC SMALL OMEGA
+\\biomicron                 <char-0x1D744>               " 𝝄          : MATHEMATICAL BOLD ITALIC SMALL OMICRON
+\\bip                       <char-0x1D491>               " 𝒑          : MATHEMATICAL BOLD ITALIC SMALL P
+\\bip<Tab>                  <char-0x1D491>               " 𝒑          : MATHEMATICAL BOLD ITALIC SMALL P
+\\bipa                      \\bipa                       "            : (Incomplete sequence)
+\\bipartial                 <char-0x1D74F>               " 𝝏          : MATHEMATICAL BOLD ITALIC PARTIAL DIFFERENTIAL
+\\biph                      \\biph                       "            : (Incomplete sequence)
+\\biphi                     <char-0x1D753>               " 𝝓          : MATHEMATICAL BOLD ITALIC PHI SYMBOL
+\\bipi                      <char-0x1D745>               " 𝝅          : MATHEMATICAL BOLD ITALIC SMALL PI
+\\bips                      \\bips                       "            : (Incomplete sequence)
+\\bipsi                     <char-0x1D74D>               " 𝝍          : MATHEMATICAL BOLD ITALIC SMALL PSI
+\\biq                       <char-0x1D492>               " 𝒒          : MATHEMATICAL BOLD ITALIC SMALL Q
+\\bir                       <char-0x1D493>               " 𝒓          : MATHEMATICAL BOLD ITALIC SMALL R
+\\bir<Tab>                  <char-0x1D493>               " 𝒓          : MATHEMATICAL BOLD ITALIC SMALL R
+\\birh                      \\birh                       "            : (Incomplete sequence)
+\\birho                     <char-0x1D746>               " 𝝆          : MATHEMATICAL BOLD ITALIC SMALL RHO
+\\bis                       <char-0x1D494>               " 𝒔          : MATHEMATICAL BOLD ITALIC SMALL S
+\\bis<Tab>                  <char-0x1D494>               " 𝒔          : MATHEMATICAL BOLD ITALIC SMALL S
+\\bisa                      \\bisa                       "            : (Incomplete sequence)
+\\bisansA                   <char-0x1D63C>               " 𝘼          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL A
+\\bisansA<Tab>              <char-0x1D63C>               " 𝘼          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL A
+\\bisansAl                  \\bisansAl                   "            : (Incomplete sequence)
+\\bisansAlpha               <char-0x1D790>               " 𝞐          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ALPHA
+\\bisansB                   <char-0x1D63D>               " 𝘽          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL B
+\\bisansB<Tab>              <char-0x1D63D>               " 𝘽          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL B
+\\bisansBe                  \\bisansBe                   "            : (Incomplete sequence)
+\\bisansBeta                <char-0x1D791>               " 𝞑          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL BETA
+\\bisansC                   <char-0x1D63E>               " 𝘾          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL C
+\\bisansC<Tab>              <char-0x1D63E>               " 𝘾          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL C
+\\bisansCh                  \\bisansCh                   "            : (Incomplete sequence)
+\\bisansChi                 <char-0x1D7A6>               " 𝞦          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL CHI
+\\bisansD                   <char-0x1D63F>               " 𝘿          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL D
+\\bisansD<Tab>              <char-0x1D63F>               " 𝘿          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL D
+\\bisansDe                  \\bisansDe                   "            : (Incomplete sequence)
+\\bisansDelta               <char-0x1D793>               " 𝞓          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL DELTA
+\\bisansE                   <char-0x1D640>               " 𝙀          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL E
+\\bisansE<Tab>              <char-0x1D640>               " 𝙀          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL E
+\\bisansEp                  \\bisansEp                   "            : (Incomplete sequence)
+\\bisansEpsilon             <char-0x1D794>               " 𝞔          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL EPSILON
+\\bisansEt                  \\bisansEt                   "            : (Incomplete sequence)
+\\bisansEta                 <char-0x1D796>               " 𝞖          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ETA
+\\bisansF                   <char-0x1D641>               " 𝙁          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL F
+\\bisansG                   <char-0x1D642>               " 𝙂          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL G
+\\bisansG<Tab>              <char-0x1D642>               " 𝙂          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL G
+\\bisansGa                  \\bisansGa                   "            : (Incomplete sequence)
+\\bisansGamma               <char-0x1D792>               " 𝞒          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL GAMMA
+\\bisansH                   <char-0x1D643>               " 𝙃          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL H
+\\bisansI                   <char-0x1D644>               " 𝙄          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL I
+\\bisansI<Tab>              <char-0x1D644>               " 𝙄          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL I
+\\bisansIo                  \\bisansIo                   "            : (Incomplete sequence)
+\\bisansIota                <char-0x1D798>               " 𝞘          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL IOTA
+\\bisansJ                   <char-0x1D645>               " 𝙅          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL J
+\\bisansK                   <char-0x1D646>               " 𝙆          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL K
+\\bisansK<Tab>              <char-0x1D646>               " 𝙆          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL K
+\\bisansKa                  \\bisansKa                   "            : (Incomplete sequence)
+\\bisansKappa               <char-0x1D799>               " 𝞙          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL KAPPA
+\\bisansL                   <char-0x1D647>               " 𝙇          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL L
+\\bisansL<Tab>              <char-0x1D647>               " 𝙇          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL L
+\\bisansLa                  \\bisansLa                   "            : (Incomplete sequence)
+\\bisansLambda              <char-0x1D79A>               " 𝞚          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL LAMDA
+\\bisansM                   <char-0x1D648>               " 𝙈          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL M
+\\bisansM<Tab>              <char-0x1D648>               " 𝙈          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL M
+\\bisansMu                  <char-0x1D79B>               " 𝞛          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL MU
+\\bisansN                   <char-0x1D649>               " 𝙉          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL N
+\\bisansN<Tab>              <char-0x1D649>               " 𝙉          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL N
+\\bisansNu                  <char-0x1D79C>               " 𝞜          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL NU
+\\bisansO                   <char-0x1D64A>               " 𝙊          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL O
+\\bisansO<Tab>              <char-0x1D64A>               " 𝙊          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL O
+\\bisansOm                  \\bisansOm                   "            : (Incomplete sequence)
+\\bisansOmega               <char-0x1D7A8>               " 𝞨          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMEGA
+\\bisansOmicron             <char-0x1D79E>               " 𝞞          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMICRON
+\\bisansP                   <char-0x1D64B>               " 𝙋          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL P
+\\bisansP<Tab>              <char-0x1D64B>               " 𝙋          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL P
+\\bisansPh                  \\bisansPh                   "            : (Incomplete sequence)
+\\bisansPhi                 <char-0x1D7A5>               " 𝞥          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PHI
+\\bisansPi                  <char-0x1D79F>               " 𝞟          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PI
+\\bisansPs                  \\bisansPs                   "            : (Incomplete sequence)
+\\bisansPsi                 <char-0x1D7A7>               " 𝞧          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PSI
+\\bisansQ                   <char-0x1D64C>               " 𝙌          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Q
+\\bisansR                   <char-0x1D64D>               " 𝙍          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL R
+\\bisansR<Tab>              <char-0x1D64D>               " 𝙍          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL R
+\\bisansRh                  \\bisansRh                   "            : (Incomplete sequence)
+\\bisansRho                 <char-0x1D7A0>               " 𝞠          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL RHO
+\\bisansS                   <char-0x1D64E>               " 𝙎          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL S
+\\bisansS<Tab>              <char-0x1D64E>               " 𝙎          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL S
+\\bisansSi                  \\bisansSi                   "            : (Incomplete sequence)
+\\bisansSigma               <char-0x1D7A2>               " 𝞢          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL SIGMA
+\\bisansT                   <char-0x1D64F>               " 𝙏          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL T
+\\bisansT<Tab>              <char-0x1D64F>               " 𝙏          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL T
+\\bisansTa                  \\bisansTa                   "            : (Incomplete sequence)
+\\bisansTau                 <char-0x1D7A3>               " 𝞣          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL TAU
+\\bisansTh                  \\bisansTh                   "            : (Incomplete sequence)
+\\bisansTheta               <char-0x1D797>               " 𝞗          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA
+\\bisansU                   <char-0x1D650>               " 𝙐          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL U
+\\bisansU<Tab>              <char-0x1D650>               " 𝙐          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL U
+\\bisansUp                  \\bisansUp                   "            : (Incomplete sequence)
+\\bisansUpsilon             <char-0x1D7A4>               " 𝞤          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL UPSILON
+\\bisansV                   <char-0x1D651>               " 𝙑          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL V
+\\bisansW                   <char-0x1D652>               " 𝙒          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL W
+\\bisansX                   <char-0x1D653>               " 𝙓          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL X
+\\bisansX<Tab>              <char-0x1D653>               " 𝙓          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL X
+\\bisansXi                  <char-0x1D79D>               " 𝞝          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL XI
+\\bisansY                   <char-0x1D654>               " 𝙔          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Y
+\\bisansZ                   <char-0x1D655>               " 𝙕          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Z
+\\bisansZ<Tab>              <char-0x1D655>               " 𝙕          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Z
+\\bisansZe                  \\bisansZe                   "            : (Incomplete sequence)
+\\bisansZeta                <char-0x1D795>               " 𝞕          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ZETA
+\\bisansa                   <char-0x1D656>               " 𝙖          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL A
+\\bisansa<Tab>              <char-0x1D656>               " 𝙖          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL A
+\\bisansal                  \\bisansal                   "            : (Incomplete sequence)
+\\bisansalpha               <char-0x1D7AA>               " 𝞪          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ALPHA
+\\bisansb                   <char-0x1D657>               " 𝙗          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL B
+\\bisansb<Tab>              <char-0x1D657>               " 𝙗          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL B
+\\bisansbe                  \\bisansbe                   "            : (Incomplete sequence)
+\\bisansbeta                <char-0x1D7AB>               " 𝞫          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL BETA
+\\bisansc                   <char-0x1D658>               " 𝙘          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL C
+\\bisansc<Tab>              <char-0x1D658>               " 𝙘          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL C
+\\bisansch                  \\bisansch                   "            : (Incomplete sequence)
+\\bisanschi                 <char-0x1D7C0>               " 𝟀          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL CHI
+\\bisansd                   <char-0x1D659>               " 𝙙          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL D
+\\bisansd<Tab>              <char-0x1D659>               " 𝙙          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL D
+\\bisansde                  \\bisansde                   "            : (Incomplete sequence)
+\\bisansdelta               <char-0x1D7AD>               " 𝞭          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL DELTA
+\\bisanse                   <char-0x1D65A>               " 𝙚          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL E
+\\bisanse<Tab>              <char-0x1D65A>               " 𝙚          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL E
+\\bisansep                  \\bisansep                   "            : (Incomplete sequence)
+\\bisansepsilon             <char-0x1D7C4>               " 𝟄          : MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL
+\\bisanset                  \\bisanset                   "            : (Incomplete sequence)
+\\bisanseta                 <char-0x1D7B0>               " 𝞰          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ETA
+\\bisansf                   <char-0x1D65B>               " 𝙛          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL F
+\\bisansg                   <char-0x1D65C>               " 𝙜          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL G
+\\bisansg<Tab>              <char-0x1D65C>               " 𝙜          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL G
+\\bisansga                  \\bisansga                   "            : (Incomplete sequence)
+\\bisansgamma               <char-0x1D7AC>               " 𝞬          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL GAMMA
+\\bisansh                   <char-0x1D65D>               " 𝙝          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL H
+\\bisansi                   <char-0x1D65E>               " 𝙞          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL I
+\\bisansi<Tab>              <char-0x1D65E>               " 𝙞          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL I
+\\bisansio                  \\bisansio                   "            : (Incomplete sequence)
+\\bisansiota                <char-0x1D7B2>               " 𝞲          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL IOTA
+\\bisansj                   <char-0x1D65F>               " 𝙟          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL J
+\\bisansk                   <char-0x1D660>               " 𝙠          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL K
+\\bisansk<Tab>              <char-0x1D660>               " 𝙠          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL K
+\\bisanska                  \\bisanska                   "            : (Incomplete sequence)
+\\bisanskappa               <char-0x1D7B3>               " 𝞳          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL KAPPA
+\\bisansl                   <char-0x1D661>               " 𝙡          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL L
+\\bisansl<Tab>              <char-0x1D661>               " 𝙡          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL L
+\\bisansla                  \\bisansla                   "            : (Incomplete sequence)
+\\bisanslambda              <char-0x1D7B4>               " 𝞴          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL LAMDA
+\\bisansm                   <char-0x1D662>               " 𝙢          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL M
+\\bisansm<Tab>              <char-0x1D662>               " 𝙢          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL M
+\\bisansmu                  <char-0x1D7B5>               " 𝞵          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL MU
+\\bisansn                   <char-0x1D663>               " 𝙣          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL N
+\\bisansn<Tab>              <char-0x1D663>               " 𝙣          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL N
+\\bisansna                  \\bisansna                   "            : (Incomplete sequence)
+\\bisansnabla               <char-0x1D7A9>               " 𝞩          : MATHEMATICAL SANS-SERIF BOLD ITALIC NABLA
+\\bisansnu                  <char-0x1D7B6>               " 𝞶          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL NU
+\\bisanso                   <char-0x1D664>               " 𝙤          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL O
+\\bisanso<Tab>              <char-0x1D664>               " 𝙤          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL O
+\\bisansom                  \\bisansom                   "            : (Incomplete sequence)
+\\bisansomega               <char-0x1D7C2>               " 𝟂          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMEGA
+\\bisansomicron             <char-0x1D7B8>               " 𝞸          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMICRON
+\\bisansp                   <char-0x1D665>               " 𝙥          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL P
+\\bisansp<Tab>              <char-0x1D665>               " 𝙥          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL P
+\\bisanspa                  \\bisanspa                   "            : (Incomplete sequence)
+\\bisanspartial             <char-0x1D7C3>               " 𝟃          : MATHEMATICAL SANS-SERIF BOLD ITALIC PARTIAL DIFFERENTIAL
+\\bisansph                  \\bisansph                   "            : (Incomplete sequence)
+\\bisansphi                 <char-0x1D7C7>               " 𝟇          : MATHEMATICAL SANS-SERIF BOLD ITALIC PHI SYMBOL
+\\bisanspi                  <char-0x1D7B9>               " 𝞹          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PI
+\\bisansps                  \\bisansps                   "            : (Incomplete sequence)
+\\bisanspsi                 <char-0x1D7C1>               " 𝟁          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PSI
+\\bisansq                   <char-0x1D666>               " 𝙦          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Q
+\\bisansr                   <char-0x1D667>               " 𝙧          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL R
+\\bisansr<Tab>              <char-0x1D667>               " 𝙧          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL R
+\\bisansrh                  \\bisansrh                   "            : (Incomplete sequence)
+\\bisansrho                 <char-0x1D7BA>               " 𝞺          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL RHO
+\\bisanss                   <char-0x1D668>               " 𝙨          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL S
+\\bisanss<Tab>              <char-0x1D668>               " 𝙨          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL S
+\\bisanssi                  \\bisanssi                   "            : (Incomplete sequence)
+\\bisanssigma               <char-0x1D7BC>               " 𝞼          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL SIGMA
+\\bisanst                   <char-0x1D669>               " 𝙩          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL T
+\\bisanst<Tab>              <char-0x1D669>               " 𝙩          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL T
+\\bisansta                  \\bisansta                   "            : (Incomplete sequence)
+\\bisanstau                 <char-0x1D7BD>               " 𝞽          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL TAU
+\\bisansth                  \\bisansth                   "            : (Incomplete sequence)
+\\bisanstheta               <char-0x1D7B1>               " 𝞱          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL THETA
+\\bisansu                   <char-0x1D66A>               " 𝙪          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL U
+\\bisansu<Tab>              <char-0x1D66A>               " 𝙪          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL U
+\\bisansup                  \\bisansup                   "            : (Incomplete sequence)
+\\bisansupsilon             <char-0x1D7BE>               " 𝞾          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL UPSILON
+\\bisansv                   <char-0x1D66B>               " 𝙫          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL V
+\\bisansv<Tab>              <char-0x1D66B>               " 𝙫          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL V
+\\bisansva                  \\bisansva                   "            : (Incomplete sequence)
+\\bisansvarTheta            <char-0x1D7A1>               " 𝞡          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA SYMBOL
+\\bisansvarepsilon          <char-0x1D7AE>               " 𝞮          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL EPSILON
+\\bisansvarkappa            <char-0x1D7C6>               " 𝟆          : MATHEMATICAL SANS-SERIF BOLD ITALIC KAPPA SYMBOL
+\\bisansvarphi              <char-0x1D7BF>               " 𝞿          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PHI
+\\bisansvarpi               <char-0x1D7C9>               " 𝟉          : MATHEMATICAL SANS-SERIF BOLD ITALIC PI SYMBOL
+\\bisansvarrho              <char-0x1D7C8>               " 𝟈          : MATHEMATICAL SANS-SERIF BOLD ITALIC RHO SYMBOL
+\\bisansvarsigma            <char-0x1D7BB>               " 𝞻          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL FINAL SIGMA
+\\bisansvartheta            <char-0x1D7C5>               " 𝟅          : MATHEMATICAL SANS-SERIF BOLD ITALIC THETA SYMBOL
+\\bisansw                   <char-0x1D66C>               " 𝙬          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL W
+\\bisansx                   <char-0x1D66D>               " 𝙭          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL X
+\\bisansx<Tab>              <char-0x1D66D>               " 𝙭          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL X
+\\bisansxi                  <char-0x1D7B7>               " 𝞷          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL XI
+\\bisansy                   <char-0x1D66E>               " 𝙮          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Y
+\\bisansz                   <char-0x1D66F>               " 𝙯          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Z
+\\bisansz<Tab>              <char-0x1D66F>               " 𝙯          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Z
+\\bisansze                  \\bisansze                   "            : (Incomplete sequence)
+\\bisanszeta                <char-0x1D7AF>               " 𝞯          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ZETA
+\\bisi                      \\bisi                       "            : (Incomplete sequence)
+\\bisigma                   <char-0x1D748>               " 𝝈          : MATHEMATICAL BOLD ITALIC SMALL SIGMA
+\\bit                       <char-0x1D495>               " 𝒕          : MATHEMATICAL BOLD ITALIC SMALL T
+\\bit<Tab>                  <char-0x1D495>               " 𝒕          : MATHEMATICAL BOLD ITALIC SMALL T
+\\bita                      \\bita                       "            : (Incomplete sequence)
+\\bitau                     <char-0x1D749>               " 𝝉          : MATHEMATICAL BOLD ITALIC SMALL TAU
+\\bith                      \\bith                       "            : (Incomplete sequence)
+\\bitheta                   <char-0x1D73D>               " 𝜽          : MATHEMATICAL BOLD ITALIC SMALL THETA
+\\biu                       <char-0x1D496>               " 𝒖          : MATHEMATICAL BOLD ITALIC SMALL U
+\\biu<Tab>                  <char-0x1D496>               " 𝒖          : MATHEMATICAL BOLD ITALIC SMALL U
+\\biup                      \\biup                       "            : (Incomplete sequence)
+\\biupsilon                 <char-0x1D74A>               " 𝝊          : MATHEMATICAL BOLD ITALIC SMALL UPSILON
+\\biv                       <char-0x1D497>               " 𝒗          : MATHEMATICAL BOLD ITALIC SMALL V
+\\biv<Tab>                  <char-0x1D497>               " 𝒗          : MATHEMATICAL BOLD ITALIC SMALL V
+\\biva                      \\biva                       "            : (Incomplete sequence)
+\\bivarTheta                <char-0x1D72D>               " 𝜭          : MATHEMATICAL BOLD ITALIC CAPITAL THETA SYMBOL
+\\bivarepsilon              <char-0x1D73A>               " 𝜺          : MATHEMATICAL BOLD ITALIC SMALL EPSILON
+\\bivarkappa                <char-0x1D752>               " 𝝒          : MATHEMATICAL BOLD ITALIC KAPPA SYMBOL
+\\bivarphi                  <char-0x1D74B>               " 𝝋          : MATHEMATICAL BOLD ITALIC SMALL PHI
+\\bivarpi                   <char-0x1D755>               " 𝝕          : MATHEMATICAL BOLD ITALIC PI SYMBOL
+\\bivarrho                  <char-0x1D754>               " 𝝔          : MATHEMATICAL BOLD ITALIC RHO SYMBOL
+\\bivarsigma                <char-0x1D747>               " 𝝇          : MATHEMATICAL BOLD ITALIC SMALL FINAL SIGMA
+\\bivartheta                <char-0x1D751>               " 𝝑          : MATHEMATICAL BOLD ITALIC THETA SYMBOL
+\\biw                       <char-0x1D498>               " 𝒘          : MATHEMATICAL BOLD ITALIC SMALL W
+\\bix                       <char-0x1D499>               " 𝒙          : MATHEMATICAL BOLD ITALIC SMALL X
+\\bix<Tab>                  <char-0x1D499>               " 𝒙          : MATHEMATICAL BOLD ITALIC SMALL X
+\\bixi                      <char-0x1D743>               " 𝝃          : MATHEMATICAL BOLD ITALIC SMALL XI
+\\biy                       <char-0x1D49A>               " 𝒚          : MATHEMATICAL BOLD ITALIC SMALL Y
+\\biz                       <char-0x1D49B>               " 𝒛          : MATHEMATICAL BOLD ITALIC SMALL Z
+\\biz<Tab>                  <char-0x1D49B>               " 𝒛          : MATHEMATICAL BOLD ITALIC SMALL Z
+\\bize                      \\bize                       "            : (Incomplete sequence)
+\\bizeta                    <char-0x1D73B>               " 𝜻          : MATHEMATICAL BOLD ITALIC SMALL ZETA
+\\bkarow                    <char-0x0290D>               " ⤍          : RIGHTWARDS DOUBLE DASH ARROW
+\\blackcircledrightdot      <char-0x02688>               " ⚈          : BLACK CIRCLE WITH WHITE DOT RIGHT
+\\blackcircledtwodots       <char-0x02689>               " ⚉          : BLACK CIRCLE WITH TWO WHITE DOTS
+\\blackcircleulquadwhite    <char-0x025D5>               " ◕          : CIRCLE WITH ALL BUT UPPER LEFT QUADRANT BLACK
+\\blackinwhitediamond       <char-0x025C8>               " ◈          : WHITE DIAMOND CONTAINING BLACK SMALL DIAMOND
+\\blackinwhitesquare        <char-0x025A3>               " ▣          : WHITE SQUARE CONTAINING BLACK SMALL SQUARE
+\\blacklefthalfcircle       <char-0x025D6>               " ◖          : LEFT HALF BLACK CIRCLE
+\\blacklozenge              <char-0x029EB>               " ⧫          : BLACK LOZENGE
+\\blackpointerleft          <char-0x025C4>               " ◄          : BLACK LEFT-POINTING POINTER / BLACK LEFT POINTING POINTER
+\\blackpointerright         <char-0x025BA>               " ►          : BLACK RIGHT-POINTING POINTER / BLACK RIGHT POINTING POINTER
+\\blackrighthalfcircle      <char-0x025D7>               " ◗          : RIGHT HALF BLACK CIRCLE
+\\blacksmiley               <char-0x0263B>               " ☻          : BLACK SMILING FACE
+\\blacksquare               <char-0x025A0>               " ■          : BLACK SQUARE
+\\blacktriangle             <char-0x025B4>               " ▴          : BLACK UP-POINTING SMALL TRIANGLE / BLACK UP POINTING SMALL TRIANGLE
+\\blacktriangle<Tab>        <char-0x025B4>               " ▴          : BLACK UP-POINTING SMALL TRIANGLE / BLACK UP POINTING SMALL TRIANGLE
+\\blacktriangled            \\blacktriangled             "            : (Incomplete sequence)
+\\blacktriangledown         <char-0x025BE>               " ▾          : BLACK DOWN-POINTING SMALL TRIANGLE / BLACK DOWN POINTING SMALL TRIANGLE
+\\blacktrianglel            \\blacktrianglel             "            : (Incomplete sequence)
+\\blacktriangleleft         <char-0x025C0>               " ◀          : BLACK LEFT-POINTING TRIANGLE / BLACK LEFT POINTING TRIANGLE
+\\blacktriangler            \\blacktriangler             "            : (Incomplete sequence)
+\\blacktriangleright        <char-0x025B6>               " ▶          : BLACK RIGHT-POINTING TRIANGLE / BLACK RIGHT POINTING TRIANGLE
+\\blanksymbol               <char-0x02422>               " ␢          : BLANK SYMBOL / BLANK
+\\blkhorzoval               <char-0x02B2C>               " ⬬          : BLACK HORIZONTAL ELLIPSE
+\\blkvertoval               <char-0x02B2E>               " ⬮          : BLACK VERTICAL ELLIPSE
+\\blockfull                 <char-0x02588>               " █          : FULL BLOCK
+\\blockhalfshaded           <char-0x02592>               " ▒          : MEDIUM SHADE
+\\blocklefthalf             <char-0x0258C>               " ▌          : LEFT HALF BLOCK
+\\blocklowhalf              <char-0x02584>               " ▄          : LOWER HALF BLOCK
+\\blockqtrshaded            <char-0x02591>               " ░          : LIGHT SHADE
+\\blockrighthalf            <char-0x02590>               " ▐          : RIGHT HALF BLOCK
+\\blockthreeqtrshaded       <char-0x02593>               " ▓          : DARK SHADE
+\\blockuphalf               <char-0x02580>               " ▀          : UPPER HALF BLOCK
+\\bot                       <char-0x022A5>               " ⊥          : UP TACK
+\\bot<Tab>                  <char-0x022A5>               " ⊥          : UP TACK
+\\bots                      \\bots                       "            : (Incomplete sequence)
+\\botsemicircle             <char-0x025E1>               " ◡          : LOWER HALF CIRCLE
+\\bowtie                    <char-0x022C8>               " ⋈          : BOWTIE
+\\boxast                    <char-0x029C6>               " ⧆          : SQUARED ASTERISK
+\\boxbar                    <char-0x025EB>               " ◫          : WHITE SQUARE WITH VERTICAL BISECTING LINE
+\\boxbslash                 <char-0x029C5>               " ⧅          : SQUARED FALLING DIAGONAL SLASH
+\\boxcircle                 <char-0x029C7>               " ⧇          : SQUARED SMALL CIRCLE
+\\boxdiag                   <char-0x029C4>               " ⧄          : SQUARED RISING DIAGONAL SLASH
+\\boxdot                    <char-0x022A1>               " ⊡          : SQUARED DOT OPERATOR
+\\boxminus                  <char-0x0229F>               " ⊟          : SQUARED MINUS
+\\boxplus                   <char-0x0229E>               " ⊞          : SQUARED PLUS
+\\boxquestion               <char-0x02370>               " ⍰          : APL FUNCTIONAL SYMBOL QUAD QUESTION
+\\boxtimes                  <char-0x022A0>               " ⊠          : SQUARED TIMES
+\\boxupcaret                <char-0x02353>               " ⍓          : APL FUNCTIONAL SYMBOL QUAD UP CARET
+\\breve                     <char-0x00306>               " ◌̆         : COMBINING BREVE / NON-SPACING BREVE
+\\brokenbar                 <char-0x000A6>               " ¦          : BROKEN BAR / BROKEN VERTICAL BAR
+\\bsansA                    <char-0x1D5D4>               " 𝗔          : MATHEMATICAL SANS-SERIF BOLD CAPITAL A
+\\bsansA<Tab>               <char-0x1D5D4>               " 𝗔          : MATHEMATICAL SANS-SERIF BOLD CAPITAL A
+\\bsansAl                   \\bsansAl                    "            : (Incomplete sequence)
+\\bsansAlpha                <char-0x1D756>               " 𝝖          : MATHEMATICAL SANS-SERIF BOLD CAPITAL ALPHA
+\\bsansB                    <char-0x1D5D5>               " 𝗕          : MATHEMATICAL SANS-SERIF BOLD CAPITAL B
+\\bsansB<Tab>               <char-0x1D5D5>               " 𝗕          : MATHEMATICAL SANS-SERIF BOLD CAPITAL B
+\\bsansBe                   \\bsansBe                    "            : (Incomplete sequence)
+\\bsansBeta                 <char-0x1D757>               " 𝝗          : MATHEMATICAL SANS-SERIF BOLD CAPITAL BETA
+\\bsansC                    <char-0x1D5D6>               " 𝗖          : MATHEMATICAL SANS-SERIF BOLD CAPITAL C
+\\bsansC<Tab>               <char-0x1D5D6>               " 𝗖          : MATHEMATICAL SANS-SERIF BOLD CAPITAL C
+\\bsansCh                   \\bsansCh                    "            : (Incomplete sequence)
+\\bsansChi                  <char-0x1D76C>               " 𝝬          : MATHEMATICAL SANS-SERIF BOLD CAPITAL CHI
+\\bsansD                    <char-0x1D5D7>               " 𝗗          : MATHEMATICAL SANS-SERIF BOLD CAPITAL D
+\\bsansD<Tab>               <char-0x1D5D7>               " 𝗗          : MATHEMATICAL SANS-SERIF BOLD CAPITAL D
+\\bsansDe                   \\bsansDe                    "            : (Incomplete sequence)
+\\bsansDelta                <char-0x1D759>               " 𝝙          : MATHEMATICAL SANS-SERIF BOLD CAPITAL DELTA
+\\bsansE                    <char-0x1D5D8>               " 𝗘          : MATHEMATICAL SANS-SERIF BOLD CAPITAL E
+\\bsansE<Tab>               <char-0x1D5D8>               " 𝗘          : MATHEMATICAL SANS-SERIF BOLD CAPITAL E
+\\bsansEp                   \\bsansEp                    "            : (Incomplete sequence)
+\\bsansEpsilon              <char-0x1D75A>               " 𝝚          : MATHEMATICAL SANS-SERIF BOLD CAPITAL EPSILON
+\\bsansEt                   \\bsansEt                    "            : (Incomplete sequence)
+\\bsansEta                  <char-0x1D75C>               " 𝝜          : MATHEMATICAL SANS-SERIF BOLD CAPITAL ETA
+\\bsansF                    <char-0x1D5D9>               " 𝗙          : MATHEMATICAL SANS-SERIF BOLD CAPITAL F
+\\bsansG                    <char-0x1D5DA>               " 𝗚          : MATHEMATICAL SANS-SERIF BOLD CAPITAL G
+\\bsansG<Tab>               <char-0x1D5DA>               " 𝗚          : MATHEMATICAL SANS-SERIF BOLD CAPITAL G
+\\bsansGa                   \\bsansGa                    "            : (Incomplete sequence)
+\\bsansGamma                <char-0x1D758>               " 𝝘          : MATHEMATICAL SANS-SERIF BOLD CAPITAL GAMMA
+\\bsansH                    <char-0x1D5DB>               " 𝗛          : MATHEMATICAL SANS-SERIF BOLD CAPITAL H
+\\bsansI                    <char-0x1D5DC>               " 𝗜          : MATHEMATICAL SANS-SERIF BOLD CAPITAL I
+\\bsansI<Tab>               <char-0x1D5DC>               " 𝗜          : MATHEMATICAL SANS-SERIF BOLD CAPITAL I
+\\bsansIo                   \\bsansIo                    "            : (Incomplete sequence)
+\\bsansIota                 <char-0x1D75E>               " 𝝞          : MATHEMATICAL SANS-SERIF BOLD CAPITAL IOTA
+\\bsansJ                    <char-0x1D5DD>               " 𝗝          : MATHEMATICAL SANS-SERIF BOLD CAPITAL J
+\\bsansK                    <char-0x1D5DE>               " 𝗞          : MATHEMATICAL SANS-SERIF BOLD CAPITAL K
+\\bsansK<Tab>               <char-0x1D5DE>               " 𝗞          : MATHEMATICAL SANS-SERIF BOLD CAPITAL K
+\\bsansKa                   \\bsansKa                    "            : (Incomplete sequence)
+\\bsansKappa                <char-0x1D75F>               " 𝝟          : MATHEMATICAL SANS-SERIF BOLD CAPITAL KAPPA
+\\bsansL                    <char-0x1D5DF>               " 𝗟          : MATHEMATICAL SANS-SERIF BOLD CAPITAL L
+\\bsansL<Tab>               <char-0x1D5DF>               " 𝗟          : MATHEMATICAL SANS-SERIF BOLD CAPITAL L
+\\bsansLa                   \\bsansLa                    "            : (Incomplete sequence)
+\\bsansLambda               <char-0x1D760>               " 𝝠          : MATHEMATICAL SANS-SERIF BOLD CAPITAL LAMDA
+\\bsansM                    <char-0x1D5E0>               " 𝗠          : MATHEMATICAL SANS-SERIF BOLD CAPITAL M
+\\bsansM<Tab>               <char-0x1D5E0>               " 𝗠          : MATHEMATICAL SANS-SERIF BOLD CAPITAL M
+\\bsansMu                   <char-0x1D761>               " 𝝡          : MATHEMATICAL SANS-SERIF BOLD CAPITAL MU
+\\bsansN                    <char-0x1D5E1>               " 𝗡          : MATHEMATICAL SANS-SERIF BOLD CAPITAL N
+\\bsansN<Tab>               <char-0x1D5E1>               " 𝗡          : MATHEMATICAL SANS-SERIF BOLD CAPITAL N
+\\bsansNu                   <char-0x1D762>               " 𝝢          : MATHEMATICAL SANS-SERIF BOLD CAPITAL NU
+\\bsansO                    <char-0x1D5E2>               " 𝗢          : MATHEMATICAL SANS-SERIF BOLD CAPITAL O
+\\bsansO<Tab>               <char-0x1D5E2>               " 𝗢          : MATHEMATICAL SANS-SERIF BOLD CAPITAL O
+\\bsansOm                   \\bsansOm                    "            : (Incomplete sequence)
+\\bsansOmega                <char-0x1D76E>               " 𝝮          : MATHEMATICAL SANS-SERIF BOLD CAPITAL OMEGA
+\\bsansOmicron              <char-0x1D764>               " 𝝤          : MATHEMATICAL SANS-SERIF BOLD CAPITAL OMICRON
+\\bsansP                    <char-0x1D5E3>               " 𝗣          : MATHEMATICAL SANS-SERIF BOLD CAPITAL P
+\\bsansP<Tab>               <char-0x1D5E3>               " 𝗣          : MATHEMATICAL SANS-SERIF BOLD CAPITAL P
+\\bsansPh                   \\bsansPh                    "            : (Incomplete sequence)
+\\bsansPhi                  <char-0x1D76B>               " 𝝫          : MATHEMATICAL SANS-SERIF BOLD CAPITAL PHI
+\\bsansPi                   <char-0x1D765>               " 𝝥          : MATHEMATICAL SANS-SERIF BOLD CAPITAL PI
+\\bsansPs                   \\bsansPs                    "            : (Incomplete sequence)
+\\bsansPsi                  <char-0x1D76D>               " 𝝭          : MATHEMATICAL SANS-SERIF BOLD CAPITAL PSI
+\\bsansQ                    <char-0x1D5E4>               " 𝗤          : MATHEMATICAL SANS-SERIF BOLD CAPITAL Q
+\\bsansR                    <char-0x1D5E5>               " 𝗥          : MATHEMATICAL SANS-SERIF BOLD CAPITAL R
+\\bsansR<Tab>               <char-0x1D5E5>               " 𝗥          : MATHEMATICAL SANS-SERIF BOLD CAPITAL R
+\\bsansRh                   \\bsansRh                    "            : (Incomplete sequence)
+\\bsansRho                  <char-0x1D766>               " 𝝦          : MATHEMATICAL SANS-SERIF BOLD CAPITAL RHO
+\\bsansS                    <char-0x1D5E6>               " 𝗦          : MATHEMATICAL SANS-SERIF BOLD CAPITAL S
+\\bsansS<Tab>               <char-0x1D5E6>               " 𝗦          : MATHEMATICAL SANS-SERIF BOLD CAPITAL S
+\\bsansSi                   \\bsansSi                    "            : (Incomplete sequence)
+\\bsansSigma                <char-0x1D768>               " 𝝨          : MATHEMATICAL SANS-SERIF BOLD CAPITAL SIGMA
+\\bsansT                    <char-0x1D5E7>               " 𝗧          : MATHEMATICAL SANS-SERIF BOLD CAPITAL T
+\\bsansT<Tab>               <char-0x1D5E7>               " 𝗧          : MATHEMATICAL SANS-SERIF BOLD CAPITAL T
+\\bsansTa                   \\bsansTa                    "            : (Incomplete sequence)
+\\bsansTau                  <char-0x1D769>               " 𝝩          : MATHEMATICAL SANS-SERIF BOLD CAPITAL TAU
+\\bsansTh                   \\bsansTh                    "            : (Incomplete sequence)
+\\bsansTheta                <char-0x1D75D>               " 𝝝          : MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA
+\\bsansU                    <char-0x1D5E8>               " 𝗨          : MATHEMATICAL SANS-SERIF BOLD CAPITAL U
+\\bsansU<Tab>               <char-0x1D5E8>               " 𝗨          : MATHEMATICAL SANS-SERIF BOLD CAPITAL U
+\\bsansUp                   \\bsansUp                    "            : (Incomplete sequence)
+\\bsansUpsilon              <char-0x1D76A>               " 𝝪          : MATHEMATICAL SANS-SERIF BOLD CAPITAL UPSILON
+\\bsansV                    <char-0x1D5E9>               " 𝗩          : MATHEMATICAL SANS-SERIF BOLD CAPITAL V
+\\bsansW                    <char-0x1D5EA>               " 𝗪          : MATHEMATICAL SANS-SERIF BOLD CAPITAL W
+\\bsansX                    <char-0x1D5EB>               " 𝗫          : MATHEMATICAL SANS-SERIF BOLD CAPITAL X
+\\bsansX<Tab>               <char-0x1D5EB>               " 𝗫          : MATHEMATICAL SANS-SERIF BOLD CAPITAL X
+\\bsansXi                   <char-0x1D763>               " 𝝣          : MATHEMATICAL SANS-SERIF BOLD CAPITAL XI
+\\bsansY                    <char-0x1D5EC>               " 𝗬          : MATHEMATICAL SANS-SERIF BOLD CAPITAL Y
+\\bsansZ                    <char-0x1D5ED>               " 𝗭          : MATHEMATICAL SANS-SERIF BOLD CAPITAL Z
+\\bsansZ<Tab>               <char-0x1D5ED>               " 𝗭          : MATHEMATICAL SANS-SERIF BOLD CAPITAL Z
+\\bsansZe                   \\bsansZe                    "            : (Incomplete sequence)
+\\bsansZeta                 <char-0x1D75B>               " 𝝛          : MATHEMATICAL SANS-SERIF BOLD CAPITAL ZETA
+\\bsansa                    <char-0x1D5EE>               " 𝗮          : MATHEMATICAL SANS-SERIF BOLD SMALL A
+\\bsansa<Tab>               <char-0x1D5EE>               " 𝗮          : MATHEMATICAL SANS-SERIF BOLD SMALL A
+\\bsansal                   \\bsansal                    "            : (Incomplete sequence)
+\\bsansalpha                <char-0x1D770>               " 𝝰          : MATHEMATICAL SANS-SERIF BOLD SMALL ALPHA
+\\bsansb                    <char-0x1D5EF>               " 𝗯          : MATHEMATICAL SANS-SERIF BOLD SMALL B
+\\bsansb<Tab>               <char-0x1D5EF>               " 𝗯          : MATHEMATICAL SANS-SERIF BOLD SMALL B
+\\bsansbe                   \\bsansbe                    "            : (Incomplete sequence)
+\\bsansbeta                 <char-0x1D771>               " 𝝱          : MATHEMATICAL SANS-SERIF BOLD SMALL BETA
+\\bsansc                    <char-0x1D5F0>               " 𝗰          : MATHEMATICAL SANS-SERIF BOLD SMALL C
+\\bsansc<Tab>               <char-0x1D5F0>               " 𝗰          : MATHEMATICAL SANS-SERIF BOLD SMALL C
+\\bsansch                   \\bsansch                    "            : (Incomplete sequence)
+\\bsanschi                  <char-0x1D786>               " 𝞆          : MATHEMATICAL SANS-SERIF BOLD SMALL CHI
+\\bsansd                    <char-0x1D5F1>               " 𝗱          : MATHEMATICAL SANS-SERIF BOLD SMALL D
+\\bsansd<Tab>               <char-0x1D5F1>               " 𝗱          : MATHEMATICAL SANS-SERIF BOLD SMALL D
+\\bsansde                   \\bsansde                    "            : (Incomplete sequence)
+\\bsansdelta                <char-0x1D773>               " 𝝳          : MATHEMATICAL SANS-SERIF BOLD SMALL DELTA
+\\bsanse                    <char-0x1D5F2>               " 𝗲          : MATHEMATICAL SANS-SERIF BOLD SMALL E
+\\bsanse<Tab>               <char-0x1D5F2>               " 𝗲          : MATHEMATICAL SANS-SERIF BOLD SMALL E
+\\bsansei                   \\bsansei                    "            : (Incomplete sequence)
+\\bsanseight                <char-0x1D7F4>               " 𝟴          : MATHEMATICAL SANS-SERIF BOLD DIGIT EIGHT
+\\bsansep                   \\bsansep                    "            : (Incomplete sequence)
+\\bsansepsilon              <char-0x1D78A>               " 𝞊          : MATHEMATICAL SANS-SERIF BOLD EPSILON SYMBOL
+\\bsanset                   \\bsanset                    "            : (Incomplete sequence)
+\\bsanseta                  <char-0x1D776>               " 𝝶          : MATHEMATICAL SANS-SERIF BOLD SMALL ETA
+\\bsansf                    <char-0x1D5F3>               " 𝗳          : MATHEMATICAL SANS-SERIF BOLD SMALL F
+\\bsansf<Tab>               <char-0x1D5F3>               " 𝗳          : MATHEMATICAL SANS-SERIF BOLD SMALL F
+\\bsansfi                   \\bsansfi                    "            : (Incomplete sequence)
+\\bsansfive                 <char-0x1D7F1>               " 𝟱          : MATHEMATICAL SANS-SERIF BOLD DIGIT FIVE
+\\bsansfo                   \\bsansfo                    "            : (Incomplete sequence)
+\\bsansfour                 <char-0x1D7F0>               " 𝟰          : MATHEMATICAL SANS-SERIF BOLD DIGIT FOUR
+\\bsansg                    <char-0x1D5F4>               " 𝗴          : MATHEMATICAL SANS-SERIF BOLD SMALL G
+\\bsansg<Tab>               <char-0x1D5F4>               " 𝗴          : MATHEMATICAL SANS-SERIF BOLD SMALL G
+\\bsansga                   \\bsansga                    "            : (Incomplete sequence)
+\\bsansgamma                <char-0x1D772>               " 𝝲          : MATHEMATICAL SANS-SERIF BOLD SMALL GAMMA
+\\bsansh                    <char-0x1D5F5>               " 𝗵          : MATHEMATICAL SANS-SERIF BOLD SMALL H
+\\bsansi                    <char-0x1D5F6>               " 𝗶          : MATHEMATICAL SANS-SERIF BOLD SMALL I
+\\bsansi<Tab>               <char-0x1D5F6>               " 𝗶          : MATHEMATICAL SANS-SERIF BOLD SMALL I
+\\bsansio                   \\bsansio                    "            : (Incomplete sequence)
+\\bsansiota                 <char-0x1D778>               " 𝝸          : MATHEMATICAL SANS-SERIF BOLD SMALL IOTA
+\\bsansj                    <char-0x1D5F7>               " 𝗷          : MATHEMATICAL SANS-SERIF BOLD SMALL J
+\\bsansk                    <char-0x1D5F8>               " 𝗸          : MATHEMATICAL SANS-SERIF BOLD SMALL K
+\\bsansk<Tab>               <char-0x1D5F8>               " 𝗸          : MATHEMATICAL SANS-SERIF BOLD SMALL K
+\\bsanska                   \\bsanska                    "            : (Incomplete sequence)
+\\bsanskappa                <char-0x1D779>               " 𝝹          : MATHEMATICAL SANS-SERIF BOLD SMALL KAPPA
+\\bsansl                    <char-0x1D5F9>               " 𝗹          : MATHEMATICAL SANS-SERIF BOLD SMALL L
+\\bsansl<Tab>               <char-0x1D5F9>               " 𝗹          : MATHEMATICAL SANS-SERIF BOLD SMALL L
+\\bsansla                   \\bsansla                    "            : (Incomplete sequence)
+\\bsanslambda               <char-0x1D77A>               " 𝝺          : MATHEMATICAL SANS-SERIF BOLD SMALL LAMDA
+\\bsansm                    <char-0x1D5FA>               " 𝗺          : MATHEMATICAL SANS-SERIF BOLD SMALL M
+\\bsansm<Tab>               <char-0x1D5FA>               " 𝗺          : MATHEMATICAL SANS-SERIF BOLD SMALL M
+\\bsansmu                   <char-0x1D77B>               " 𝝻          : MATHEMATICAL SANS-SERIF BOLD SMALL MU
+\\bsansn                    <char-0x1D5FB>               " 𝗻          : MATHEMATICAL SANS-SERIF BOLD SMALL N
+\\bsansn<Tab>               <char-0x1D5FB>               " 𝗻          : MATHEMATICAL SANS-SERIF BOLD SMALL N
+\\bsansna                   \\bsansna                    "            : (Incomplete sequence)
+\\bsansnabla                <char-0x1D76F>               " 𝝯          : MATHEMATICAL SANS-SERIF BOLD NABLA
+\\bsansni                   \\bsansni                    "            : (Incomplete sequence)
+\\bsansnine                 <char-0x1D7F5>               " 𝟵          : MATHEMATICAL SANS-SERIF BOLD DIGIT NINE
+\\bsansnu                   <char-0x1D77C>               " 𝝼          : MATHEMATICAL SANS-SERIF BOLD SMALL NU
+\\bsanso                    <char-0x1D5FC>               " 𝗼          : MATHEMATICAL SANS-SERIF BOLD SMALL O
+\\bsanso<Tab>               <char-0x1D5FC>               " 𝗼          : MATHEMATICAL SANS-SERIF BOLD SMALL O
+\\bsansom                   \\bsansom                    "            : (Incomplete sequence)
+\\bsansomega                <char-0x1D788>               " 𝞈          : MATHEMATICAL SANS-SERIF BOLD SMALL OMEGA
+\\bsansomicron              <char-0x1D77E>               " 𝝾          : MATHEMATICAL SANS-SERIF BOLD SMALL OMICRON
+\\bsanson                   \\bsanson                    "            : (Incomplete sequence)
+\\bsansone                  <char-0x1D7ED>               " 𝟭          : MATHEMATICAL SANS-SERIF BOLD DIGIT ONE
+\\bsansp                    <char-0x1D5FD>               " 𝗽          : MATHEMATICAL SANS-SERIF BOLD SMALL P
+\\bsansp<Tab>               <char-0x1D5FD>               " 𝗽          : MATHEMATICAL SANS-SERIF BOLD SMALL P
+\\bsanspa                   \\bsanspa                    "            : (Incomplete sequence)
+\\bsanspartial              <char-0x1D789>               " 𝞉          : MATHEMATICAL SANS-SERIF BOLD PARTIAL DIFFERENTIAL
+\\bsansph                   \\bsansph                    "            : (Incomplete sequence)
+\\bsansphi                  <char-0x1D78D>               " 𝞍          : MATHEMATICAL SANS-SERIF BOLD PHI SYMBOL
+\\bsanspi                   <char-0x1D77F>               " 𝝿          : MATHEMATICAL SANS-SERIF BOLD SMALL PI
+\\bsansps                   \\bsansps                    "            : (Incomplete sequence)
+\\bsanspsi                  <char-0x1D787>               " 𝞇          : MATHEMATICAL SANS-SERIF BOLD SMALL PSI
+\\bsansq                    <char-0x1D5FE>               " 𝗾          : MATHEMATICAL SANS-SERIF BOLD SMALL Q
+\\bsansr                    <char-0x1D5FF>               " 𝗿          : MATHEMATICAL SANS-SERIF BOLD SMALL R
+\\bsansr<Tab>               <char-0x1D5FF>               " 𝗿          : MATHEMATICAL SANS-SERIF BOLD SMALL R
+\\bsansrh                   \\bsansrh                    "            : (Incomplete sequence)
+\\bsansrho                  <char-0x1D780>               " 𝞀          : MATHEMATICAL SANS-SERIF BOLD SMALL RHO
+\\bsanss                    <char-0x1D600>               " 𝘀          : MATHEMATICAL SANS-SERIF BOLD SMALL S
+\\bsanss<Tab>               <char-0x1D600>               " 𝘀          : MATHEMATICAL SANS-SERIF BOLD SMALL S
+\\bsansse                   \\bsansse                    "            : (Incomplete sequence)
+\\bsansseven                <char-0x1D7F3>               " 𝟳          : MATHEMATICAL SANS-SERIF BOLD DIGIT SEVEN
+\\bsanssi                   \\bsanssi                    "            : (Incomplete sequence)
+\\bsanssigma                <char-0x1D782>               " 𝞂          : MATHEMATICAL SANS-SERIF BOLD SMALL SIGMA
+\\bsanssix                  <char-0x1D7F2>               " 𝟲          : MATHEMATICAL SANS-SERIF BOLD DIGIT SIX
+\\bsanst                    <char-0x1D601>               " 𝘁          : MATHEMATICAL SANS-SERIF BOLD SMALL T
+\\bsanst<Tab>               <char-0x1D601>               " 𝘁          : MATHEMATICAL SANS-SERIF BOLD SMALL T
+\\bsansta                   \\bsansta                    "            : (Incomplete sequence)
+\\bsanstau                  <char-0x1D783>               " 𝞃          : MATHEMATICAL SANS-SERIF BOLD SMALL TAU
+\\bsansth                   \\bsansth                    "            : (Incomplete sequence)
+\\bsanstheta                <char-0x1D777>               " 𝝷          : MATHEMATICAL SANS-SERIF BOLD SMALL THETA
+\\bsansthree                <char-0x1D7EF>               " 𝟯          : MATHEMATICAL SANS-SERIF BOLD DIGIT THREE
+\\bsanstw                   \\bsanstw                    "            : (Incomplete sequence)
+\\bsanstwo                  <char-0x1D7EE>               " 𝟮          : MATHEMATICAL SANS-SERIF BOLD DIGIT TWO
+\\bsansu                    <char-0x1D602>               " 𝘂          : MATHEMATICAL SANS-SERIF BOLD SMALL U
+\\bsansu<Tab>               <char-0x1D602>               " 𝘂          : MATHEMATICAL SANS-SERIF BOLD SMALL U
+\\bsansup                   \\bsansup                    "            : (Incomplete sequence)
+\\bsansupsilon              <char-0x1D784>               " 𝞄          : MATHEMATICAL SANS-SERIF BOLD SMALL UPSILON
+\\bsansv                    <char-0x1D603>               " 𝘃          : MATHEMATICAL SANS-SERIF BOLD SMALL V
+\\bsansv<Tab>               <char-0x1D603>               " 𝘃          : MATHEMATICAL SANS-SERIF BOLD SMALL V
+\\bsansva                   \\bsansva                    "            : (Incomplete sequence)
+\\bsansvarTheta             <char-0x1D767>               " 𝝧          : MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA SYMBOL
+\\bsansvarepsilon           <char-0x1D774>               " 𝝴          : MATHEMATICAL SANS-SERIF BOLD SMALL EPSILON
+\\bsansvarkappa             <char-0x1D78C>               " 𝞌          : MATHEMATICAL SANS-SERIF BOLD KAPPA SYMBOL
+\\bsansvarphi               <char-0x1D785>               " 𝞅          : MATHEMATICAL SANS-SERIF BOLD SMALL PHI
+\\bsansvarpi                <char-0x1D78F>               " 𝞏          : MATHEMATICAL SANS-SERIF BOLD PI SYMBOL
+\\bsansvarrho               <char-0x1D78E>               " 𝞎          : MATHEMATICAL SANS-SERIF BOLD RHO SYMBOL
+\\bsansvarsigma             <char-0x1D781>               " 𝞁          : MATHEMATICAL SANS-SERIF BOLD SMALL FINAL SIGMA
+\\bsansvartheta             <char-0x1D78B>               " 𝞋          : MATHEMATICAL SANS-SERIF BOLD THETA SYMBOL
+\\bsansw                    <char-0x1D604>               " 𝘄          : MATHEMATICAL SANS-SERIF BOLD SMALL W
+\\bsansx                    <char-0x1D605>               " 𝘅          : MATHEMATICAL SANS-SERIF BOLD SMALL X
+\\bsansx<Tab>               <char-0x1D605>               " 𝘅          : MATHEMATICAL SANS-SERIF BOLD SMALL X
+\\bsansxi                   <char-0x1D77D>               " 𝝽          : MATHEMATICAL SANS-SERIF BOLD SMALL XI
+\\bsansy                    <char-0x1D606>               " 𝘆          : MATHEMATICAL SANS-SERIF BOLD SMALL Y
+\\bsansz                    <char-0x1D607>               " 𝘇          : MATHEMATICAL SANS-SERIF BOLD SMALL Z
+\\bsansz<Tab>               <char-0x1D607>               " 𝘇          : MATHEMATICAL SANS-SERIF BOLD SMALL Z
+\\bsansze                   \\bsansze                    "            : (Incomplete sequence)
+\\bsanszero                 <char-0x1D7EC>               " 𝟬          : MATHEMATICAL SANS-SERIF BOLD DIGIT ZERO
+\\bsanszeta                 <char-0x1D775>               " 𝝵          : MATHEMATICAL SANS-SERIF BOLD SMALL ZETA
+\\bscrA                     <char-0x1D4D0>               " 𝓐          : MATHEMATICAL BOLD SCRIPT CAPITAL A
+\\bscrB                     <char-0x1D4D1>               " 𝓑          : MATHEMATICAL BOLD SCRIPT CAPITAL B
+\\bscrC                     <char-0x1D4D2>               " 𝓒          : MATHEMATICAL BOLD SCRIPT CAPITAL C
+\\bscrD                     <char-0x1D4D3>               " 𝓓          : MATHEMATICAL BOLD SCRIPT CAPITAL D
+\\bscrE                     <char-0x1D4D4>               " 𝓔          : MATHEMATICAL BOLD SCRIPT CAPITAL E
+\\bscrF                     <char-0x1D4D5>               " 𝓕          : MATHEMATICAL BOLD SCRIPT CAPITAL F
+\\bscrG                     <char-0x1D4D6>               " 𝓖          : MATHEMATICAL BOLD SCRIPT CAPITAL G
+\\bscrH                     <char-0x1D4D7>               " 𝓗          : MATHEMATICAL BOLD SCRIPT CAPITAL H
+\\bscrI                     <char-0x1D4D8>               " 𝓘          : MATHEMATICAL BOLD SCRIPT CAPITAL I
+\\bscrJ                     <char-0x1D4D9>               " 𝓙          : MATHEMATICAL BOLD SCRIPT CAPITAL J
+\\bscrK                     <char-0x1D4DA>               " 𝓚          : MATHEMATICAL BOLD SCRIPT CAPITAL K
+\\bscrL                     <char-0x1D4DB>               " 𝓛          : MATHEMATICAL BOLD SCRIPT CAPITAL L
+\\bscrM                     <char-0x1D4DC>               " 𝓜          : MATHEMATICAL BOLD SCRIPT CAPITAL M
+\\bscrN                     <char-0x1D4DD>               " 𝓝          : MATHEMATICAL BOLD SCRIPT CAPITAL N
+\\bscrO                     <char-0x1D4DE>               " 𝓞          : MATHEMATICAL BOLD SCRIPT CAPITAL O
+\\bscrP                     <char-0x1D4DF>               " 𝓟          : MATHEMATICAL BOLD SCRIPT CAPITAL P
+\\bscrQ                     <char-0x1D4E0>               " 𝓠          : MATHEMATICAL BOLD SCRIPT CAPITAL Q
+\\bscrR                     <char-0x1D4E1>               " 𝓡          : MATHEMATICAL BOLD SCRIPT CAPITAL R
+\\bscrS                     <char-0x1D4E2>               " 𝓢          : MATHEMATICAL BOLD SCRIPT CAPITAL S
+\\bscrT                     <char-0x1D4E3>               " 𝓣          : MATHEMATICAL BOLD SCRIPT CAPITAL T
+\\bscrU                     <char-0x1D4E4>               " 𝓤          : MATHEMATICAL BOLD SCRIPT CAPITAL U
+\\bscrV                     <char-0x1D4E5>               " 𝓥          : MATHEMATICAL BOLD SCRIPT CAPITAL V
+\\bscrW                     <char-0x1D4E6>               " 𝓦          : MATHEMATICAL BOLD SCRIPT CAPITAL W
+\\bscrX                     <char-0x1D4E7>               " 𝓧          : MATHEMATICAL BOLD SCRIPT CAPITAL X
+\\bscrY                     <char-0x1D4E8>               " 𝓨          : MATHEMATICAL BOLD SCRIPT CAPITAL Y
+\\bscrZ                     <char-0x1D4E9>               " 𝓩          : MATHEMATICAL BOLD SCRIPT CAPITAL Z
+\\bscra                     <char-0x1D4EA>               " 𝓪          : MATHEMATICAL BOLD SCRIPT SMALL A
+\\bscrb                     <char-0x1D4EB>               " 𝓫          : MATHEMATICAL BOLD SCRIPT SMALL B
+\\bscrc                     <char-0x1D4EC>               " 𝓬          : MATHEMATICAL BOLD SCRIPT SMALL C
+\\bscrd                     <char-0x1D4ED>               " 𝓭          : MATHEMATICAL BOLD SCRIPT SMALL D
+\\bscre                     <char-0x1D4EE>               " 𝓮          : MATHEMATICAL BOLD SCRIPT SMALL E
+\\bscrf                     <char-0x1D4EF>               " 𝓯          : MATHEMATICAL BOLD SCRIPT SMALL F
+\\bscrg                     <char-0x1D4F0>               " 𝓰          : MATHEMATICAL BOLD SCRIPT SMALL G
+\\bscrh                     <char-0x1D4F1>               " 𝓱          : MATHEMATICAL BOLD SCRIPT SMALL H
+\\bscri                     <char-0x1D4F2>               " 𝓲          : MATHEMATICAL BOLD SCRIPT SMALL I
+\\bscrj                     <char-0x1D4F3>               " 𝓳          : MATHEMATICAL BOLD SCRIPT SMALL J
+\\bscrk                     <char-0x1D4F4>               " 𝓴          : MATHEMATICAL BOLD SCRIPT SMALL K
+\\bscrl                     <char-0x1D4F5>               " 𝓵          : MATHEMATICAL BOLD SCRIPT SMALL L
+\\bscrm                     <char-0x1D4F6>               " 𝓶          : MATHEMATICAL BOLD SCRIPT SMALL M
+\\bscrn                     <char-0x1D4F7>               " 𝓷          : MATHEMATICAL BOLD SCRIPT SMALL N
+\\bscro                     <char-0x1D4F8>               " 𝓸          : MATHEMATICAL BOLD SCRIPT SMALL O
+\\bscrp                     <char-0x1D4F9>               " 𝓹          : MATHEMATICAL BOLD SCRIPT SMALL P
+\\bscrq                     <char-0x1D4FA>               " 𝓺          : MATHEMATICAL BOLD SCRIPT SMALL Q
+\\bscrr                     <char-0x1D4FB>               " 𝓻          : MATHEMATICAL BOLD SCRIPT SMALL R
+\\bscrs                     <char-0x1D4FC>               " 𝓼          : MATHEMATICAL BOLD SCRIPT SMALL S
+\\bscrt                     <char-0x1D4FD>               " 𝓽          : MATHEMATICAL BOLD SCRIPT SMALL T
+\\bscru                     <char-0x1D4FE>               " 𝓾          : MATHEMATICAL BOLD SCRIPT SMALL U
+\\bscrv                     <char-0x1D4FF>               " 𝓿          : MATHEMATICAL BOLD SCRIPT SMALL V
+\\bscrw                     <char-0x1D500>               " 𝔀          : MATHEMATICAL BOLD SCRIPT SMALL W
+\\bscrx                     <char-0x1D501>               " 𝔁          : MATHEMATICAL BOLD SCRIPT SMALL X
+\\bscry                     <char-0x1D502>               " 𝔂          : MATHEMATICAL BOLD SCRIPT SMALL Y
+\\bscrz                     <char-0x1D503>               " 𝔃          : MATHEMATICAL BOLD SCRIPT SMALL Z
+\\bsimilarleftarrow         <char-0x02B41>               " ⭁          : REVERSE TILDE OPERATOR ABOVE LEFTWARDS ARROW
+\\bsimilarrightarrow        <char-0x02B47>               " ⭇          : REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW
+\\bsolhsub                  <char-0x027C8>               " ⟈          : REVERSE SOLIDUS PRECEDING SUBSET
+\\btdl                      <char-0x0026C>               " ɬ          : LATIN SMALL LETTER L WITH BELT / LATIN SMALL LETTER L BELT
+\\btimes                    <char-0x02A32>               " ⨲          : SEMIDIRECT PRODUCT WITH BOTTOM CLOSED
+\\bullet                    <char-0x02022>               " •          : BULLET
+\\bullseye                  <char-0x025CE>               " ◎          : BULLSEYE
+\\bumpeq                    <char-0x0224F>               " ≏          : DIFFERENCE BETWEEN
+\\bumpeq<Tab>               <char-0x0224F>               " ≏          : DIFFERENCE BETWEEN
+\\bumpeqq                   <char-0x02AAE>               " ⪮          : EQUALS SIGN WITH BUMPY ABOVE
+\\c                         <char-0x00327>               " ◌̧         : COMBINING CEDILLA / NON-SPACING CEDILLA
+\\c<Tab>                    <char-0x00327>               " ◌̧         : COMBINING CEDILLA / NON-SPACING CEDILLA
+\\ca                        \\ca                         "            : (Incomplete sequence)
+\\cancer                    <char-0x0264B>               " ♋          : CANCER
+\\candra                    <char-0x00310>               " ◌̐         : COMBINING CANDRABINDU / NON-SPACING CANDRABINDU
+\\cap                       <char-0x02229>               " ∩          : INTERSECTION
+\\cap<Tab>                  <char-0x02229>               " ∩          : INTERSECTION
+\\capd                      \\capd                       "            : (Incomplete sequence)
+\\capdot                    <char-0x02A40>               " ⩀          : INTERSECTION WITH DOT
+\\capr                      \\capr                       "            : (Incomplete sequence)
+\\capricornus               <char-0x02651>               " ♑          : CAPRICORN
+\\capw                      \\capw                       "            : (Incomplete sequence)
+\\capwedge                  <char-0x02A44>               " ⩄          : INTERSECTION WITH LOGICAL AND
+\\carriagereturn            <char-0x021B5>               " ↵          : DOWNWARDS ARROW WITH CORNER LEFTWARDS / DOWN ARROW WITH CORNER LEFT
+\\cb                        \\cb                         "            : (Incomplete sequence)
+\\cbrt                      <char-0x0221B>               " ∛          : CUBE ROOT
+\\cd                        \\cd                         "            : (Incomplete sequence)
+\\cdot                      <char-0x022C5>               " ⋅          : DOT OPERATOR
+\\cdot<Tab>                 <char-0x022C5>               " ⋅          : DOT OPERATOR
+\\cdotp                     <char-0x000B7>               " ·          : MIDDLE DOT
+\\cdots                     <char-0x022EF>               " ⋯          : MIDLINE HORIZONTAL ELLIPSIS
+\\ch                        \\ch                         "            : (Incomplete sequence)
+\\check                     <char-0x0030C>               " ◌̌         : COMBINING CARON / NON-SPACING HACEK
+\\check<Tab>                <char-0x0030C>               " ◌̌         : COMBINING CARON / NON-SPACING HACEK
+\\checkm                    \\checkm                     "            : (Incomplete sequence)
+\\checkmark                 <char-0x02713>               " ✓          : CHECK MARK
+\\chi                       <char-0x003C7>               " χ          : GREEK SMALL LETTER CHI
+\\ci                        \\ci                         "            : (Incomplete sequence)
+\\circ                      <char-0x02218>               " ∘          : RING OPERATOR
+\\circ<Tab>                 <char-0x02218>               " ∘          : RING OPERATOR
+\\circe                     \\circe                      "            : (Incomplete sequence)
+\\circeq                    <char-0x02257>               " ≗          : RING EQUAL TO
+\\circl                     \\circl                      "            : (Incomplete sequence)
+\\circlearrowleft           <char-0x021BA>               " ↺          : ANTICLOCKWISE OPEN CIRCLE ARROW
+\\circlearrowright          <char-0x021BB>               " ↻          : CLOCKWISE OPEN CIRCLE ARROW
+\\circledR                  <char-0x000AE>               " ®          : REGISTERED SIGN / REGISTERED TRADE MARK SIGN
+\\circledS                  <char-0x024C8>               " Ⓢ          : CIRCLED LATIN CAPITAL LETTER S
+\\circledast                <char-0x0229B>               " ⊛          : CIRCLED ASTERISK OPERATOR
+\\circledbullet             <char-0x029BF>               " ⦿          : CIRCLED BULLET
+\\circledcirc               <char-0x0229A>               " ⊚          : CIRCLED RING OPERATOR
+\\circleddash               <char-0x0229D>               " ⊝          : CIRCLED DASH
+\\circledequal              <char-0x0229C>               " ⊜          : CIRCLED EQUALS
+\\circledparallel           <char-0x029B7>               " ⦷          : CIRCLED PARALLEL
+\\circledrightdot           <char-0x02686>               " ⚆          : WHITE CIRCLE WITH DOT RIGHT
+\\circledstar               <char-0x0272A>               " ✪          : CIRCLED WHITE STAR
+\\circledtwodots            <char-0x02687>               " ⚇          : WHITE CIRCLE WITH TWO DOTS
+\\circledwhitebullet        <char-0x029BE>               " ⦾          : CIRCLED WHITE BULLET
+\\circlellquad              <char-0x025F5>               " ◵          : WHITE CIRCLE WITH LOWER LEFT QUADRANT
+\\circlelrquad              <char-0x025F6>               " ◶          : WHITE CIRCLE WITH LOWER RIGHT QUADRANT
+\\circleonleftarrow         <char-0x02B30>               " ⬰          : LEFT ARROW WITH SMALL CIRCLE
+\\circleonrightarrow        <char-0x021F4>               " ⇴          : RIGHT ARROW WITH SMALL CIRCLE
+\\circletophalfblack        <char-0x025D3>               " ◓          : CIRCLE WITH UPPER HALF BLACK
+\\circleulquad              <char-0x025F4>               " ◴          : WHITE CIRCLE WITH UPPER LEFT QUADRANT
+\\circleurquad              <char-0x025F7>               " ◷          : WHITE CIRCLE WITH UPPER RIGHT QUADRANT
+\\circleurquad<Tab>         <char-0x025F7>               " ◷          : WHITE CIRCLE WITH UPPER RIGHT QUADRANT
+\\circleurquadb             \\circleurquadb              "            : (Incomplete sequence)
+\\circleurquadblack         <char-0x025D4>               " ◔          : CIRCLE WITH UPPER RIGHT QUADRANT BLACK
+\\circlevertfill            <char-0x025CD>               " ◍          : CIRCLE WITH VERTICAL FILL
+\\cirfb                     <char-0x025D2>               " ◒          : CIRCLE WITH LOWER HALF BLACK
+\\cirfl                     <char-0x025D0>               " ◐          : CIRCLE WITH LEFT HALF BLACK
+\\cirfnint                  <char-0x02A10>               " ⨐          : CIRCULATION FUNCTION
+\\cirfr                     <char-0x025D1>               " ◑          : CIRCLE WITH RIGHT HALF BLACK
+\\cl                        \\cl                         "            : (Incomplete sequence)
+\\clockoint                 <char-0x02A0F>               " ⨏          : INTEGRAL AVERAGE WITH SLASH
+\\clomeg                    <char-0x00277>               " ɷ          : LATIN SMALL LETTER CLOSED OMEGA
+\\closedvarcap              <char-0x02A4D>               " ⩍          : CLOSED INTERSECTION WITH SERIFS
+\\closedvarcup              <char-0x02A4C>               " ⩌          : CLOSED UNION WITH SERIFS
+\\closedvarcup<Tab>         <char-0x02A4C>               " ⩌          : CLOSED UNION WITH SERIFS
+\\closedvarcups             \\closedvarcups              "            : (Incomplete sequence)
+\\closedvarcupsmashprod     <char-0x02A50>               " ⩐          : CLOSED UNION WITH SERIFS AND SMASH PRODUCT
+\\clubsuit                  <char-0x02663>               " ♣          : BLACK CLUB SUIT
+\\clwintegral               <char-0x02231>               " ∱          : CLOCKWISE INTEGRAL
+\\co                        \\co                         "            : (Incomplete sequence)
+\\coloneq                   <char-0x02254>               " ≔          : COLON EQUALS / COLON EQUAL
+\\commaminus                <char-0x02A29>               " ⨩          : MINUS SIGN WITH COMMA ABOVE
+\\complement                <char-0x02201>               " ∁          : COMPLEMENT
+\\cong                      <char-0x02245>               " ≅          : APPROXIMATELY EQUAL TO
+\\cong<Tab>                 <char-0x02245>               " ≅          : APPROXIMATELY EQUAL TO
+\\congd                     \\congd                      "            : (Incomplete sequence)
+\\congdot                   <char-0x02A6D>               " ⩭          : CONGRUENT WITH DOT ABOVE
+\\conictaper                <char-0x02332>               " ⌲          : CONICAL TAPER
+\\conjquant                 <char-0x02A07>               " ⨇          : TWO LOGICAL AND OPERATOR
+\\coprod                    <char-0x02210>               " ∐          : N-ARY COPRODUCT
+\\copyright                 <char-0x000A9>               " ©          : COPYRIGHT SIGN
+\\cs                        \\cs                         "            : (Incomplete sequence)
+\\csub                      <char-0x02ACF>               " ⫏          : CLOSED SUBSET
+\\csub<Tab>                 <char-0x02ACF>               " ⫏          : CLOSED SUBSET
+\\csube                     <char-0x02AD1>               " ⫑          : CLOSED SUBSET OR EQUAL TO
+\\csup                      <char-0x02AD0>               " ⫐          : CLOSED SUPERSET
+\\csup<Tab>                 <char-0x02AD0>               " ⫐          : CLOSED SUPERSET
+\\csupe                     <char-0x02AD2>               " ⫒          : CLOSED SUPERSET OR EQUAL TO
+\\cu                        \\cu                         "            : (Incomplete sequence)
+\\cup                       <char-0x0222A>               " ∪          : UNION
+\\cup<Tab>                  <char-0x0222A>               " ∪          : UNION
+\\cupd                      \\cupd                       "            : (Incomplete sequence)
+\\cupdot                    <char-0x0228D>               " ⊍          : MULTISET MULTIPLICATION
+\\cupv                      \\cupv                       "            : (Incomplete sequence)
+\\cupvee                    <char-0x02A45>               " ⩅          : UNION WITH LOGICAL OR
+\\curlyeqprec               <char-0x022DE>               " ⋞          : EQUAL TO OR PRECEDES
+\\curlyeqsucc               <char-0x022DF>               " ⋟          : EQUAL TO OR SUCCEEDS
+\\curlyvee                  <char-0x022CE>               " ⋎          : CURLY LOGICAL OR
+\\curlywedge                <char-0x022CF>               " ⋏          : CURLY LOGICAL AND
+\\curvearrowleft            <char-0x021B6>               " ↶          : ANTICLOCKWISE TOP SEMICIRCLE ARROW
+\\curvearrowright           <char-0x021B7>               " ↷          : CLOCKWISE TOP SEMICIRCLE ARROW
+\\dagger                    <char-0x02020>               " †          : DAGGER
+\\daleth                    <char-0x02138>               " ℸ          : DALET SYMBOL / FOURTH TRANSFINITE CARDINAL
+\\danger                    <char-0x02621>               " ☡          : CAUTION SIGN
+\\dashV                     <char-0x02AE3>               " ⫣          : DOUBLE VERTICAL BAR LEFT TURNSTILE
+\\dashleftharpoondown       <char-0x0296B>               " ⥫          : LEFTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH
+\\dashrightharpoondown      <char-0x0296D>               " ⥭          : RIGHTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH
+\\dashv                     <char-0x022A3>               " ⊣          : LEFT TACK
+\\dbkarow                   <char-0x0290F>               " ⤏          : RIGHTWARDS TRIPLE DASH ARROW
+\\dblarrowupdown            <char-0x021C5>               " ⇅          : UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW / UP ARROW LEFT OF DOWN ARROW
+\\ddagger                   <char-0x02021>               " ‡          : DOUBLE DAGGER
+\\ddddot                    <char-0x020DC>               " ◌⃜         : COMBINING FOUR DOTS ABOVE / NON-SPACING FOUR DOTS ABOVE
+\\dddot                     <char-0x020DB>               " ◌⃛         : COMBINING THREE DOTS ABOVE / NON-SPACING THREE DOTS ABOVE
+\\ddfnc                     <char-0x02999>               " ⦙          : DOTTED FENCE
+\\ddot                      <char-0x00308>               " ◌̈         : COMBINING DIAERESIS / NON-SPACING DIAERESIS
+\\ddot<Tab>                 <char-0x00308>               " ◌̈         : COMBINING DIAERESIS / NON-SPACING DIAERESIS
+\\ddots                     <char-0x022F1>               " ⋱          : DOWN RIGHT DIAGONAL ELLIPSIS
+\\ddots<Tab>                <char-0x022F1>               " ⋱          : DOWN RIGHT DIAGONAL ELLIPSIS
+\\ddotse                    \\ddotse                     "            : (Incomplete sequence)
+\\ddotseq                   <char-0x02A77>               " ⩷          : EQUALS SIGN WITH TWO DOTS ABOVE AND TWO DOTS BELOW
+\\defas                     <char-0x029CB>               " ⧋          : TRIANGLE WITH UNDERBAR
+\\degree                    <char-0x000B0>               " °          : DEGREE SIGN
+\\del                       <char-0x02207>               " ∇          : NABLA
+\\del<Tab>                  <char-0x02207>               " ∇          : NABLA
+\\delt                      \\delt                       "            : (Incomplete sequence)
+\\delta                     <char-0x003B4>               " δ          : GREEK SMALL LETTER DELTA
+\\dh                        <char-0x000F0>               " ð          : LATIN SMALL LETTER ETH
+\\diagdown                  <char-0x02572>               " ╲          : BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT / FORMS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT
+\\diagup                    <char-0x02571>               " ╱          : BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT / FORMS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT
+\\diameter                  <char-0x02300>               " ⌀          : DIAMETER SIGN
+\\diamond                   <char-0x022C4>               " ⋄          : DIAMOND OPERATOR
+\\diamond<Tab>              <char-0x022C4>               " ⋄          : DIAMOND OPERATOR
+\\diamondb                  \\diamondb                   "            : (Incomplete sequence)
+\\diamondbotblack           <char-0x02B19>               " ⬙          : DIAMOND WITH BOTTOM HALF BLACK
+\\diamondl                  \\diamondl                   "            : (Incomplete sequence)
+\\diamondleftarrow          <char-0x0291D>               " ⤝          : LEFTWARDS ARROW TO BLACK DIAMOND
+\\diamondleftarrow<Tab>     <char-0x0291D>               " ⤝          : LEFTWARDS ARROW TO BLACK DIAMOND
+\\diamondleftarrowb         \\diamondleftarrowb          "            : (Incomplete sequence)
+\\diamondleftarrowbar       <char-0x0291F>               " ⤟          : LEFTWARDS ARROW FROM BAR TO BLACK DIAMOND
+\\diamondleftblack          <char-0x02B16>               " ⬖          : DIAMOND WITH LEFT HALF BLACK
+\\diamondr                  \\diamondr                   "            : (Incomplete sequence)
+\\diamondrightblack         <char-0x02B17>               " ⬗          : DIAMOND WITH RIGHT HALF BLACK
+\\diamonds                  \\diamonds                   "            : (Incomplete sequence)
+\\diamondsuit               <char-0x02662>               " ♢          : WHITE DIAMOND SUIT
+\\diamondt                  \\diamondt                   "            : (Incomplete sequence)
+\\diamondtopblack           <char-0x02B18>               " ⬘          : DIAMOND WITH TOP HALF BLACK
+\\dicei                     <char-0x02680>               " ⚀          : DIE FACE-1
+\\dicei<Tab>                <char-0x02680>               " ⚀          : DIE FACE-1
+\\diceii                    <char-0x02681>               " ⚁          : DIE FACE-2
+\\diceii<Tab>               <char-0x02681>               " ⚁          : DIE FACE-2
+\\diceiii                   <char-0x02682>               " ⚂          : DIE FACE-3
+\\diceiv                    <char-0x02683>               " ⚃          : DIE FACE-4
+\\dicev                     <char-0x02684>               " ⚄          : DIE FACE-5
+\\dicev<Tab>                <char-0x02684>               " ⚄          : DIE FACE-5
+\\dicevi                    <char-0x02685>               " ⚅          : DIE FACE-6
+\\digamma                   <char-0x003DD>               " ϝ          : GREEK SMALL LETTER DIGAMMA
+\\dingasterisk              <char-0x0273D>               " ✽          : HEAVY TEARDROP-SPOKED ASTERISK
+\\disin                     <char-0x022F2>               " ⋲          : ELEMENT OF WITH LONG HORIZONTAL STROKE
+\\disjquant                 <char-0x02A08>               " ⨈          : TWO LOGICAL OR OPERATOR
+\\div                       <char-0x000F7>               " ÷          : DIVISION SIGN
+\\div<Tab>                  <char-0x000F7>               " ÷          : DIVISION SIGN
+\\divi                      \\divi                       "            : (Incomplete sequence)
+\\divideontimes             <char-0x022C7>               " ⋇          : DIVISION TIMES
+\\dj                        <char-0x00111>               " đ          : LATIN SMALL LETTER D WITH STROKE / LATIN SMALL LETTER D BAR
+\\dlcorn                    <char-0x023A3>               " ⎣          : LEFT SQUARE BRACKET LOWER CORNER
+\\dot                       <char-0x00307>               " ◌̇         : COMBINING DOT ABOVE / NON-SPACING DOT ABOVE
+\\dot<Tab>                  <char-0x00307>               " ◌̇         : COMBINING DOT ABOVE / NON-SPACING DOT ABOVE
+\\dote                      \\dote                       "            : (Incomplete sequence)
+\\doteq                     <char-0x02250>               " ≐          : APPROACHES THE LIMIT
+\\doteq<Tab>                <char-0x02250>               " ≐          : APPROACHES THE LIMIT
+\\dotequ                    \\dotequ                     "            : (Incomplete sequence)
+\\dotequiv                  <char-0x02A67>               " ⩧          : IDENTICAL WITH DOT ABOVE
+\\dotm                      \\dotm                       "            : (Incomplete sequence)
+\\dotminus                  <char-0x02238>               " ∸          : DOT MINUS
+\\dotp                      \\dotp                       "            : (Incomplete sequence)
+\\dotplus                   <char-0x02214>               " ∔          : DOT PLUS
+\\dots                      <char-0x02026>               " …          : HORIZONTAL ELLIPSIS
+\\dots<Tab>                 <char-0x02026>               " …          : HORIZONTAL ELLIPSIS
+\\dotsi                     \\dotsi                      "            : (Incomplete sequence)
+\\dotsim                    <char-0x02A6A>               " ⩪          : TILDE OPERATOR WITH DOT ABOVE
+\\dotsm                     \\dotsm                      "            : (Incomplete sequence)
+\\dotsminusdots             <char-0x0223A>               " ∺          : GEOMETRIC PROPORTION
+\\dott                      \\dott                       "            : (Incomplete sequence)
+\\dottedcircle              <char-0x025CC>               " ◌          : DOTTED CIRCLE
+\\dottedsquare              <char-0x02B1A>               " ⬚          : DOTTED SQUARE
+\\dottimes                  <char-0x02A30>               " ⨰          : MULTIPLICATION SIGN WITH DOT ABOVE
+\\doublebarvee              <char-0x02A62>               " ⩢          : LOGICAL OR WITH DOUBLE OVERBAR
+\\doublepipe                <char-0x001C2>               " ǂ          : LATIN LETTER ALVEOLAR CLICK / LATIN LETTER PIPE DOUBLE BAR
+\\doubleplus                <char-0x029FA>               " ⧺          : DOUBLE PLUS
+\\downarrow                 <char-0x02193>               " ↓          : DOWNWARDS ARROW / DOWN ARROW
+\\downarrow<Tab>            <char-0x02193>               " ↓          : DOWNWARDS ARROW / DOWN ARROW
+\\downarrowb                \\downarrowb                 "            : (Incomplete sequence)
+\\downarrowbarred           <char-0x02908>               " ⤈          : DOWNWARDS ARROW WITH HORIZONTAL STROKE
+\\downdasharrow             <char-0x021E3>               " ⇣          : DOWNWARDS DASHED ARROW / DOWN DASHED ARROW
+\\downdownarrows            <char-0x021CA>               " ⇊          : DOWNWARDS PAIRED ARROWS / DOWN PAIRED ARROWS
+\\downharpoonleft           <char-0x021C3>               " ⇃          : DOWNWARDS HARPOON WITH BARB LEFTWARDS / DOWN HARPOON WITH BARB LEFT
+\\downharpoonright          <char-0x021C2>               " ⇂          : DOWNWARDS HARPOON WITH BARB RIGHTWARDS / DOWN HARPOON WITH BARB RIGHT
+\\downharpoonsleftright     <char-0x02965>               " ⥥          : DOWNWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT
+\\downvDash                 <char-0x02AEA>               " ⫪          : DOUBLE DOWN TACK
+\\downwhitearrow            <char-0x021E9>               " ⇩          : DOWNWARDS WHITE ARROW / WHITE DOWN ARROW
+\\downzigzagarrow           <char-0x021AF>               " ↯          : DOWNWARDS ZIGZAG ARROW / DOWN ZIGZAG ARROW
+\\draftingarrow             <char-0x0279B>               " ➛          : DRAFTING POINT RIGHTWARDS ARROW / DRAFTING POINT RIGHT ARROW
+\\drbkarrow                 <char-0x02910>               " ⤐          : RIGHTWARDS TWO-HEADED TRIPLE DASH ARROW
+\\droang                    <char-0x0031A>               " ◌̚         : COMBINING LEFT ANGLE ABOVE / NON-SPACING LEFT ANGLE ABOVE
+\\dshfnc                    <char-0x02506>               " ┆          : BOX DRAWINGS LIGHT TRIPLE DASH VERTICAL / FORMS LIGHT TRIPLE DASH VERTICAL
+\\dsol                      <char-0x029F6>               " ⧶          : SOLIDUS WITH OVERBAR
+\\dualmap                   <char-0x029DF>               " ⧟          : DOUBLE-ENDED MULTIMAP
+\\dyogh                     <char-0x002A4>               " ʤ          : LATIN SMALL LETTER DEZH DIGRAPH / LATIN SMALL LETTER D YOGH
+\\egsdot                    <char-0x02A98>               " ⪘          : SLANTED EQUAL TO OR GREATER-THAN WITH DOT INSIDE
+\\eighthnote                <char-0x0266A>               " ♪          : EIGHTH NOTE
+\\elinters                  <char-0x023E7>               " ⏧          : ELECTRICAL INTERSECTION
+\\ell                       <char-0x02113>               " ℓ          : SCRIPT SMALL L
+\\elsdot                    <char-0x02A97>               " ⪗          : SLANTED EQUAL TO OR LESS-THAN WITH DOT INSIDE
+\\emdash                    <char-0x02014>               " —          : EM DASH
+\\emptyset                  <char-0x02205>               " ∅          : EMPTY SET
+\\emptyset<Tab>             <char-0x02205>               " ∅          : EMPTY SET
+\\emptyseto                 \\emptyseto                  "            : (Incomplete sequence)
+\\emptysetoarr              <char-0x029B3>               " ⦳          : EMPTY SET WITH RIGHT ARROW ABOVE
+\\emptysetoarr<Tab>         <char-0x029B3>               " ⦳          : EMPTY SET WITH RIGHT ARROW ABOVE
+\\emptysetoarrl             <char-0x029B4>               " ⦴          : EMPTY SET WITH LEFT ARROW ABOVE
+\\emptysetobar              <char-0x029B1>               " ⦱          : EMPTY SET WITH OVERBAR
+\\emptysetocirc             <char-0x029B2>               " ⦲          : EMPTY SET WITH SMALL CIRCLE ABOVE
+\\enclosecircle             <char-0x020DD>               " ◌⃝         : COMBINING ENCLOSING CIRCLE / ENCLOSING CIRCLE
+\\enclosediamond            <char-0x020DF>               " ◌⃟         : COMBINING ENCLOSING DIAMOND / ENCLOSING DIAMOND
+\\enclosesquare             <char-0x020DE>               " ◌⃞         : COMBINING ENCLOSING SQUARE / ENCLOSING SQUARE
+\\enclosetriangle           <char-0x020E4>               " ◌⃤         : COMBINING ENCLOSING UPWARD POINTING TRIANGLE
+\\endash                    <char-0x02013>               " –          : EN DASH
+\\enspace                   <char-0x02002>               "            : EN SPACE
+\\eparsl                    <char-0x029E3>               " ⧣          : EQUALS SIGN AND SLANTED PARALLEL
+\\epsilon                   <char-0x003F5>               " ϵ          : GREEK LUNATE EPSILON SYMBOL
+\\eqcirc                    <char-0x02256>               " ≖          : RING IN EQUAL TO
+\\eqcolon                   <char-0x02255>               " ≕          : EQUALS COLON / EQUAL COLON
+\\eqdef                     <char-0x0225D>               " ≝          : EQUAL TO BY DEFINITION
+\\eqdot                     <char-0x02A66>               " ⩦          : EQUALS SIGN WITH DOT BELOW
+\\eqeqeq                    <char-0x02A76>               " ⩶          : THREE CONSECUTIVE EQUALS SIGNS
+\\eqgtr                     <char-0x022DD>               " ⋝          : EQUAL TO OR GREATER-THAN / EQUAL TO OR GREATER THAN
+\\eqless                    <char-0x022DC>               " ⋜          : EQUAL TO OR LESS-THAN / EQUAL TO OR LESS THAN
+\\eqqgtr                    <char-0x02A9A>               " ⪚          : DOUBLE-LINE EQUAL TO OR GREATER-THAN
+\\eqqless                   <char-0x02A99>               " ⪙          : DOUBLE-LINE EQUAL TO OR LESS-THAN
+\\eqqplus                   <char-0x02A71>               " ⩱          : EQUALS SIGN ABOVE PLUS SIGN
+\\eqqsim                    <char-0x02A73>               " ⩳          : EQUALS SIGN ABOVE TILDE OPERATOR
+\\eqqslantgtr               <char-0x02A9C>               " ⪜          : DOUBLE-LINE SLANTED EQUAL TO OR GREATER-THAN
+\\eqqslantless              <char-0x02A9B>               " ⪛          : DOUBLE-LINE SLANTED EQUAL TO OR LESS-THAN
+\\eqsim                     <char-0x02242>               " ≂          : MINUS TILDE
+\\eqslantgtr                <char-0x02A96>               " ⪖          : SLANTED EQUAL TO OR GREATER-THAN
+\\eqslantless               <char-0x02A95>               " ⪕          : SLANTED EQUAL TO OR LESS-THAN
+\\equalleftarrow            <char-0x02B40>               " ⭀          : EQUALS SIGN ABOVE LEFTWARDS ARROW
+\\equalparallel             <char-0x022D5>               " ⋕          : EQUAL AND PARALLEL TO
+\\equiv                     <char-0x02261>               " ≡          : IDENTICAL TO
+\\equiv<Tab>                <char-0x02261>               " ≡          : IDENTICAL TO
+\\equivD                    \\equivD                     "            : (Incomplete sequence)
+\\equivDD                   <char-0x02A78>               " ⩸          : EQUIVALENT WITH FOUR DOTS ABOVE
+\\eqvparsl                  <char-0x029E5>               " ⧥          : IDENTICAL TO AND SLANTED PARALLEL
+\\esh                       <char-0x00283>               " ʃ          : LATIN SMALL LETTER ESH
+\\eta                       <char-0x003B7>               " η          : GREEK SMALL LETTER ETA
+\\eth                       <char-0x000F0>               " ð          : LATIN SMALL LETTER ETH
+\\euler                     <char-0x0212F>               " ℯ          : SCRIPT SMALL E
+\\euler<Tab>                <char-0x0212F>               " ℯ          : SCRIPT SMALL E
+\\eulerm                    \\eulerm                     "            : (Incomplete sequence)
+\\eulermascheroni           <char-0x02107>               " ℇ          : EULER CONSTANT / EULERS
+\\euro                      <char-0x020AC>               " €          : EURO SIGN
+\\exclamdown                <char-0x000A1>               " ¡          : INVERTED EXCLAMATION MARK
+\\exists                    <char-0x02203>               " ∃          : THERE EXISTS
+\\fallingdotseq             <char-0x02252>               " ≒          : APPROXIMATELY EQUAL TO OR THE IMAGE OF
+\\fdiagovnearrow            <char-0x0292F>               " ⤯          : FALLING DIAGONAL CROSSING NORTH EAST ARROW
+\\fdiagovrdiag              <char-0x0292C>               " ⤬          : FALLING DIAGONAL CROSSING RISING DIAGONAL
+\\female                    <char-0x02640>               " ♀          : FEMALE SIGN
+\\fhr                       <char-0x0027E>               " ɾ          : LATIN SMALL LETTER R WITH FISHHOOK / LATIN SMALL LETTER FISHHOOK R
+\\fisheye                   <char-0x025C9>               " ◉          : FISHEYE
+\\flat                      <char-0x0266D>               " ♭          : MUSIC FLAT SIGN / FLAT
+\\fltns                     <char-0x023E5>               " ⏥          : FLATNESS
+\\forall                    <char-0x02200>               " ∀          : FOR ALL
+\\forks                     <char-0x02ADC>               " ⫝̸          : FORKING
+\\forks<Tab>                <char-0x02ADC>               " ⫝̸          : FORKING
+\\forksn                    \\forksn                     "            : (Incomplete sequence)
+\\forksnot                  <char-0x02ADD>               " ⫝          : NONFORKING
+\\forkv                     <char-0x02AD9>               " ⫙          : ELEMENT OF OPENING DOWNWARDS
+\\fourthroot                <char-0x0221C>               " ∜          : FOURTH ROOT
+\\frakA                     <char-0x1D504>               " 𝔄          : MATHEMATICAL FRAKTUR CAPITAL A
+\\frakB                     <char-0x1D505>               " 𝔅          : MATHEMATICAL FRAKTUR CAPITAL B
+\\frakC                     <char-0x0212D>               " ℭ          : BLACK-LETTER CAPITAL C / BLACK-LETTER C
+\\frakD                     <char-0x1D507>               " 𝔇          : MATHEMATICAL FRAKTUR CAPITAL D
+\\frakE                     <char-0x1D508>               " 𝔈          : MATHEMATICAL FRAKTUR CAPITAL E
+\\frakF                     <char-0x1D509>               " 𝔉          : MATHEMATICAL FRAKTUR CAPITAL F
+\\frakG                     <char-0x1D50A>               " 𝔊          : MATHEMATICAL FRAKTUR CAPITAL G
+\\frakH                     <char-0x0210C>               " ℌ          : BLACK-LETTER CAPITAL H / BLACK-LETTER H
+\\frakI                     <char-0x02111>               " ℑ          : BLACK-LETTER CAPITAL I / BLACK-LETTER I
+\\frakJ                     <char-0x1D50D>               " 𝔍          : MATHEMATICAL FRAKTUR CAPITAL J
+\\frakK                     <char-0x1D50E>               " 𝔎          : MATHEMATICAL FRAKTUR CAPITAL K
+\\frakL                     <char-0x1D50F>               " 𝔏          : MATHEMATICAL FRAKTUR CAPITAL L
+\\frakM                     <char-0x1D510>               " 𝔐          : MATHEMATICAL FRAKTUR CAPITAL M
+\\frakN                     <char-0x1D511>               " 𝔑          : MATHEMATICAL FRAKTUR CAPITAL N
+\\frakO                     <char-0x1D512>               " 𝔒          : MATHEMATICAL FRAKTUR CAPITAL O
+\\frakP                     <char-0x1D513>               " 𝔓          : MATHEMATICAL FRAKTUR CAPITAL P
+\\frakQ                     <char-0x1D514>               " 𝔔          : MATHEMATICAL FRAKTUR CAPITAL Q
+\\frakR                     <char-0x0211C>               " ℜ          : BLACK-LETTER CAPITAL R / BLACK-LETTER R
+\\frakS                     <char-0x1D516>               " 𝔖          : MATHEMATICAL FRAKTUR CAPITAL S
+\\frakT                     <char-0x1D517>               " 𝔗          : MATHEMATICAL FRAKTUR CAPITAL T
+\\frakU                     <char-0x1D518>               " 𝔘          : MATHEMATICAL FRAKTUR CAPITAL U
+\\frakV                     <char-0x1D519>               " 𝔙          : MATHEMATICAL FRAKTUR CAPITAL V
+\\frakW                     <char-0x1D51A>               " 𝔚          : MATHEMATICAL FRAKTUR CAPITAL W
+\\frakX                     <char-0x1D51B>               " 𝔛          : MATHEMATICAL FRAKTUR CAPITAL X
+\\frakY                     <char-0x1D51C>               " 𝔜          : MATHEMATICAL FRAKTUR CAPITAL Y
+\\frakZ                     <char-0x02128>               " ℨ          : BLACK-LETTER CAPITAL Z / BLACK-LETTER Z
+\\fraka                     <char-0x1D51E>               " 𝔞          : MATHEMATICAL FRAKTUR SMALL A
+\\frakb                     <char-0x1D51F>               " 𝔟          : MATHEMATICAL FRAKTUR SMALL B
+\\frakc                     <char-0x1D520>               " 𝔠          : MATHEMATICAL FRAKTUR SMALL C
+\\frakd                     <char-0x1D521>               " 𝔡          : MATHEMATICAL FRAKTUR SMALL D
+\\frake                     <char-0x1D522>               " 𝔢          : MATHEMATICAL FRAKTUR SMALL E
+\\frakf                     <char-0x1D523>               " 𝔣          : MATHEMATICAL FRAKTUR SMALL F
+\\frakg                     <char-0x1D524>               " 𝔤          : MATHEMATICAL FRAKTUR SMALL G
+\\frakh                     <char-0x1D525>               " 𝔥          : MATHEMATICAL FRAKTUR SMALL H
+\\fraki                     <char-0x1D526>               " 𝔦          : MATHEMATICAL FRAKTUR SMALL I
+\\frakj                     <char-0x1D527>               " 𝔧          : MATHEMATICAL FRAKTUR SMALL J
+\\frakk                     <char-0x1D528>               " 𝔨          : MATHEMATICAL FRAKTUR SMALL K
+\\frakl                     <char-0x1D529>               " 𝔩          : MATHEMATICAL FRAKTUR SMALL L
+\\frakm                     <char-0x1D52A>               " 𝔪          : MATHEMATICAL FRAKTUR SMALL M
+\\frakn                     <char-0x1D52B>               " 𝔫          : MATHEMATICAL FRAKTUR SMALL N
+\\frako                     <char-0x1D52C>               " 𝔬          : MATHEMATICAL FRAKTUR SMALL O
+\\frakp                     <char-0x1D52D>               " 𝔭          : MATHEMATICAL FRAKTUR SMALL P
+\\frakq                     <char-0x1D52E>               " 𝔮          : MATHEMATICAL FRAKTUR SMALL Q
+\\frakr                     <char-0x1D52F>               " 𝔯          : MATHEMATICAL FRAKTUR SMALL R
+\\fraks                     <char-0x1D530>               " 𝔰          : MATHEMATICAL FRAKTUR SMALL S
+\\frakt                     <char-0x1D531>               " 𝔱          : MATHEMATICAL FRAKTUR SMALL T
+\\fraku                     <char-0x1D532>               " 𝔲          : MATHEMATICAL FRAKTUR SMALL U
+\\frakv                     <char-0x1D533>               " 𝔳          : MATHEMATICAL FRAKTUR SMALL V
+\\frakw                     <char-0x1D534>               " 𝔴          : MATHEMATICAL FRAKTUR SMALL W
+\\frakx                     <char-0x1D535>               " 𝔵          : MATHEMATICAL FRAKTUR SMALL X
+\\fraky                     <char-0x1D536>               " 𝔶          : MATHEMATICAL FRAKTUR SMALL Y
+\\frakz                     <char-0x1D537>               " 𝔷          : MATHEMATICAL FRAKTUR SMALL Z
+\\frown                     <char-0x02322>               " ⌢          : FROWN
+\\fullouterjoin             <char-0x027D7>               " ⟗          : FULL OUTER JOIN
+\\gamma                     <char-0x003B3>               " γ          : GREEK SMALL LETTER GAMMA
+\\ge                        <char-0x02265>               " ≥          : GREATER-THAN OR EQUAL TO / GREATER THAN OR EQUAL TO
+\\ge<Tab>                   <char-0x02265>               " ≥          : GREATER-THAN OR EQUAL TO / GREATER THAN OR EQUAL TO
+\\gem                       \\gem                        "            : (Incomplete sequence)
+\\gemini                    <char-0x0264A>               " ♊          : GEMINI
+\\geq                       <char-0x02265>               " ≥          : GREATER-THAN OR EQUAL TO / GREATER THAN OR EQUAL TO
+\\geq<Tab>                  <char-0x02265>               " ≥          : GREATER-THAN OR EQUAL TO / GREATER THAN OR EQUAL TO
+\\geqq                      <char-0x02267>               " ≧          : GREATER-THAN OVER EQUAL TO / GREATER THAN OVER EQUAL TO
+\\geqq<Tab>                 <char-0x02267>               " ≧          : GREATER-THAN OVER EQUAL TO / GREATER THAN OVER EQUAL TO
+\\geqqs                     \\geqqs                      "            : (Incomplete sequence)
+\\geqqslant                 <char-0x02AFA>               " ⫺          : DOUBLE-LINE SLANTED GREATER-THAN OR EQUAL TO
+\\geqs                      \\geqs                       "            : (Incomplete sequence)
+\\geqslant                  <char-0x02A7E>               " ⩾          : GREATER-THAN OR SLANTED EQUAL TO
+\\ges                       \\ges                        "            : (Incomplete sequence)
+\\gescc                     <char-0x02AA9>               " ⪩          : GREATER-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL
+\\gesdot                    <char-0x02A80>               " ⪀          : GREATER-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
+\\gesdot<Tab>               <char-0x02A80>               " ⪀          : GREATER-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
+\\gesdoto                   <char-0x02A82>               " ⪂          : GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
+\\gesdoto<Tab>              <char-0x02A82>               " ⪂          : GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
+\\gesdotol                  <char-0x02A84>               " ⪄          : GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE LEFT
+\\gesles                    <char-0x02A94>               " ⪔          : GREATER-THAN ABOVE SLANTED EQUAL ABOVE LESS-THAN ABOVE SLANTED EQUAL
+\\gg                        <char-0x0226B>               " ≫          : MUCH GREATER-THAN / MUCH GREATER THAN
+\\gg<Tab>                   <char-0x0226B>               " ≫          : MUCH GREATER-THAN / MUCH GREATER THAN
+\\ggg                       <char-0x022D9>               " ⋙          : VERY MUCH GREATER-THAN / VERY MUCH GREATER THAN
+\\ggg<Tab>                  <char-0x022D9>               " ⋙          : VERY MUCH GREATER-THAN / VERY MUCH GREATER THAN
+\\gggn                      \\gggn                       "            : (Incomplete sequence)
+\\gggnest                   <char-0x02AF8>               " ⫸          : TRIPLE NESTED GREATER-THAN
+\\gimel                     <char-0x02137>               " ℷ          : GIMEL SYMBOL / THIRD TRANSFINITE CARDINAL
+\\glE                       <char-0x02A92>               " ⪒          : GREATER-THAN ABOVE LESS-THAN ABOVE DOUBLE-LINE EQUAL
+\\gla                       <char-0x02AA5>               " ⪥          : GREATER-THAN BESIDE LESS-THAN
+\\glj                       <char-0x02AA4>               " ⪤          : GREATER-THAN OVERLAPPING LESS-THAN
+\\glst                      <char-0x00294>               " ʔ          : LATIN LETTER GLOTTAL STOP
+\\gnapprox                  <char-0x02A8A>               " ⪊          : GREATER-THAN AND NOT APPROXIMATE
+\\gneq                      <char-0x02A88>               " ⪈          : GREATER-THAN AND SINGLE-LINE NOT EQUAL TO
+\\gneq<Tab>                 <char-0x02A88>               " ⪈          : GREATER-THAN AND SINGLE-LINE NOT EQUAL TO
+\\gneqq                     <char-0x02269>               " ≩          : GREATER-THAN BUT NOT EQUAL TO / GREATER THAN BUT NOT EQUAL TO
+\\gnsim                     <char-0x022E7>               " ⋧          : GREATER-THAN BUT NOT EQUIVALENT TO / GREATER THAN BUT NOT EQUIVALENT TO
+\\grave                     <char-0x00300>               " ◌̀         : COMBINING GRAVE ACCENT / NON-SPACING GRAVE
+\\gsime                     <char-0x02A8E>               " ⪎          : GREATER-THAN ABOVE SIMILAR OR EQUAL
+\\gsiml                     <char-0x02A90>               " ⪐          : GREATER-THAN ABOVE SIMILAR ABOVE LESS-THAN
+\\gtcc                      <char-0x02AA7>               " ⪧          : GREATER-THAN CLOSED BY CURVE
+\\gtcir                     <char-0x02A7A>               " ⩺          : GREATER-THAN WITH CIRCLE INSIDE
+\\gtquest                   <char-0x02A7C>               " ⩼          : GREATER-THAN WITH QUESTION MARK ABOVE
+\\gtrapprox                 <char-0x02A86>               " ⪆          : GREATER-THAN OR APPROXIMATE
+\\gtrdot                    <char-0x022D7>               " ⋗          : GREATER-THAN WITH DOT / GREATER THAN WITH DOT
+\\gtreqless                 <char-0x022DB>               " ⋛          : GREATER-THAN EQUAL TO OR LESS-THAN / GREATER THAN EQUAL TO OR LESS THAN
+\\gtreqqless                <char-0x02A8C>               " ⪌          : GREATER-THAN ABOVE DOUBLE-LINE EQUAL ABOVE LESS-THAN
+\\gtrless                   <char-0x02277>               " ≷          : GREATER-THAN OR LESS-THAN / GREATER THAN OR LESS THAN
+\\gtrsim                    <char-0x02273>               " ≳          : GREATER-THAN OR EQUIVALENT TO / GREATER THAN OR EQUIVALENT TO
+\\guilsinglleft             <char-0x02039>               " ‹          : SINGLE LEFT-POINTING ANGLE QUOTATION MARK / LEFT POINTING SINGLE GUILLEMET
+\\guilsinglright            <char-0x0203A>               " ›          : SINGLE RIGHT-POINTING ANGLE QUOTATION MARK / RIGHT POINTING SINGLE GUILLEMET
+\\gvertneqq                 <char-0x02269><char-0x0FE00> " ≩︀         : GREATER-THAN BUT NOT EQUAL TO / GREATER THAN BUT NOT EQUAL TO + VARIATION SELECTOR-1
+\\hat                       <char-0x00302>               " ◌̂         : COMBINING CIRCUMFLEX ACCENT / NON-SPACING CIRCUMFLEX
+\\hat<Tab>                  <char-0x00302>               " ◌̂         : COMBINING CIRCUMFLEX ACCENT / NON-SPACING CIRCUMFLEX
+\\hata                      \\hata                       "            : (Incomplete sequence)
+\\hatapprox                 <char-0x02A6F>               " ⩯          : ALMOST EQUAL TO WITH CIRCUMFLEX ACCENT
+\\hbar                      <char-0x00127>               " ħ          : LATIN SMALL LETTER H WITH STROKE / LATIN SMALL LETTER H BAR
+\\heartsuit                 <char-0x02661>               " ♡          : WHITE HEART SUIT
+\\hermaphrodite             <char-0x026A5>               " ⚥          : MALE AND FEMALE SIGN
+\\hermitconjmatrix          <char-0x022B9>               " ⊹          : HERMITIAN CONJUGATE MATRIX
+\\hexagon                   <char-0x02394>               " ⎔          : SOFTWARE-FUNCTION SYMBOL
+\\hexagon<Tab>              <char-0x02394>               " ⎔          : SOFTWARE-FUNCTION SYMBOL
+\\hexagonb                  \\hexagonb                   "            : (Incomplete sequence)
+\\hexagonblack              <char-0x02B23>               " ⬣          : HORIZONTAL BLACK HEXAGON
+\\highminus                 <char-0x000AF>               " ¯          : MACRON / SPACING MACRON
+\\hksearow                  <char-0x02925>               " ⤥          : SOUTH EAST ARROW WITH HOOK
+\\hkswarow                  <char-0x02926>               " ⤦          : SOUTH WEST ARROW WITH HOOK
+\\hlmrk                     <char-0x002D1>               " ˑ          : MODIFIER LETTER HALF TRIANGULAR COLON
+\\hookleftarrow             <char-0x021A9>               " ↩          : LEFTWARDS ARROW WITH HOOK / LEFT ARROW WITH HOOK
+\\hookrightarrow            <char-0x021AA>               " ↪          : RIGHTWARDS ARROW WITH HOOK / RIGHT ARROW WITH HOOK
+\\house                     <char-0x02302>               " ⌂          : HOUSE
+\\hrectangle                <char-0x025AD>               " ▭          : WHITE RECTANGLE
+\\hrectangle<Tab>           <char-0x025AD>               " ▭          : WHITE RECTANGLE
+\\hrectangleb               \\hrectangleb                "            : (Incomplete sequence)
+\\hrectangleblack           <char-0x025AC>               " ▬          : BLACK RECTANGLE
+\\hslash                    <char-0x0210F>               " ℏ          : PLANCK CONSTANT OVER TWO PI / PLANCK CONSTANT OVER 2 PI
+\\hspace                    <char-0x0200A>               "            : HAIR SPACE
+\\hvlig                     <char-0x00195>               " ƕ          : LATIN SMALL LETTER HV / LATIN SMALL LETTER H V
+\\iff                       <char-0x027FA>               " ⟺          : LONG LEFT RIGHT DOUBLE ARROW
+\\iiiint                    <char-0x02A0C>               " ⨌          : QUADRUPLE INTEGRAL OPERATOR
+\\iiint                     <char-0x0222D>               " ∭          : TRIPLE INTEGRAL
+\\iint                      <char-0x0222C>               " ∬          : DOUBLE INTEGRAL
+\\image                     <char-0x022B7>               " ⊷          : IMAGE OF
+\\imath                     <char-0x00131>               " ı          : LATIN SMALL LETTER DOTLESS I
+\\impliedby                 <char-0x027F8>               " ⟸          : LONG LEFTWARDS DOUBLE ARROW
+\\implies                   <char-0x027F9>               " ⟹          : LONG RIGHTWARDS DOUBLE ARROW
+\\in                        <char-0x02208>               " ∈          : ELEMENT OF
+\\in<Tab>                   <char-0x02208>               " ∈          : ELEMENT OF
+\\inc                       \\inc                        "            : (Incomplete sequence)
+\\increment                 <char-0x02206>               " ∆          : INCREMENT
+\\ind                       \\ind                        "            : (Incomplete sequence)
+\\indep                     <char-0x02AEB>               " ⫫          : DOUBLE UP TACK
+\\inf                       \\inf                        "            : (Incomplete sequence)
+\\infty                     <char-0x0221E>               " ∞          : INFINITY
+\\ing                       \\ing                        "            : (Incomplete sequence)
+\\inglst                    <char-0x00296>               " ʖ          : LATIN LETTER INVERTED GLOTTAL STOP
+\\int                       <char-0x0222B>               " ∫          : INTEGRAL
+\\int<Tab>                  <char-0x0222B>               " ∫          : INTEGRAL
+\\intB                      \\intB                       "            : (Incomplete sequence)
+\\intBar                    <char-0x02A0E>               " ⨎          : INTEGRAL WITH DOUBLE STROKE
+\\intb                      \\intb                       "            : (Incomplete sequence)
+\\intbar                    <char-0x02A0D>               " ⨍          : FINITE PART INTEGRAL
+\\intc                      \\intc                       "            : (Incomplete sequence)
+\\intcap                    <char-0x02A19>               " ⨙          : INTEGRAL WITH INTERSECTION
+\\intcup                    <char-0x02A1A>               " ⨚          : INTEGRAL WITH UNION
+\\inte                      \\inte                       "            : (Incomplete sequence)
+\\intercal                  <char-0x022BA>               " ⊺          : INTERCALATE
+\\interleave                <char-0x02AF4>               " ⫴          : TRIPLE VERTICAL BAR BINARY RELATION
+\\intp                      \\intp                       "            : (Incomplete sequence)
+\\intprod                   <char-0x02A3C>               " ⨼          : INTERIOR PRODUCT
+\\intprod<Tab>              <char-0x02A3C>               " ⨼          : INTERIOR PRODUCT
+\\intprodr                  <char-0x02A3D>               " ⨽          : RIGHTHAND INTERIOR PRODUCT
+\\intx                      <char-0x02A18>               " ⨘          : INTEGRAL WITH TIMES SIGN
+\\inv                       \\inv                        "            : (Incomplete sequence)
+\\inversewhitecircle        <char-0x025D9>               " ◙          : INVERSE WHITE CIRCLE
+\\invnot                    <char-0x02310>               " ⌐          : REVERSED NOT SIGN
+\\invv                      <char-0x0028C>               " ʌ          : LATIN SMALL LETTER TURNED V
+\\invw                      <char-0x0028D>               " ʍ          : LATIN SMALL LETTER TURNED W
+\\invw<Tab>                 <char-0x0028D>               " ʍ          : LATIN SMALL LETTER TURNED W
+\\invwh                     \\invwh                      "            : (Incomplete sequence)
+\\invwhitelowerhalfcircle   <char-0x025DB>               " ◛          : LOWER HALF INVERSE WHITE CIRCLE
+\\invwhiteupperhalfcircle   <char-0x025DA>               " ◚          : UPPER HALF INVERSE WHITE CIRCLE
+\\iota                      <char-0x003B9>               " ι          : GREEK SMALL LETTER IOTA
+\\isansA                    <char-0x1D608>               " 𝘈          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL A
+\\isansB                    <char-0x1D609>               " 𝘉          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL B
+\\isansC                    <char-0x1D60A>               " 𝘊          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL C
+\\isansD                    <char-0x1D60B>               " 𝘋          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL D
+\\isansE                    <char-0x1D60C>               " 𝘌          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL E
+\\isansF                    <char-0x1D60D>               " 𝘍          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL F
+\\isansG                    <char-0x1D60E>               " 𝘎          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL G
+\\isansH                    <char-0x1D60F>               " 𝘏          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL H
+\\isansI                    <char-0x1D610>               " 𝘐          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL I
+\\isansJ                    <char-0x1D611>               " 𝘑          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL J
+\\isansK                    <char-0x1D612>               " 𝘒          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL K
+\\isansL                    <char-0x1D613>               " 𝘓          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL L
+\\isansM                    <char-0x1D614>               " 𝘔          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL M
+\\isansN                    <char-0x1D615>               " 𝘕          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL N
+\\isansO                    <char-0x1D616>               " 𝘖          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL O
+\\isansP                    <char-0x1D617>               " 𝘗          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL P
+\\isansQ                    <char-0x1D618>               " 𝘘          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL Q
+\\isansR                    <char-0x1D619>               " 𝘙          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL R
+\\isansS                    <char-0x1D61A>               " 𝘚          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL S
+\\isansT                    <char-0x1D61B>               " 𝘛          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL T
+\\isansU                    <char-0x1D61C>               " 𝘜          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL U
+\\isansV                    <char-0x1D61D>               " 𝘝          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL V
+\\isansW                    <char-0x1D61E>               " 𝘞          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL W
+\\isansX                    <char-0x1D61F>               " 𝘟          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL X
+\\isansY                    <char-0x1D620>               " 𝘠          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL Y
+\\isansZ                    <char-0x1D621>               " 𝘡          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL Z
+\\isansa                    <char-0x1D622>               " 𝘢          : MATHEMATICAL SANS-SERIF ITALIC SMALL A
+\\isansb                    <char-0x1D623>               " 𝘣          : MATHEMATICAL SANS-SERIF ITALIC SMALL B
+\\isansc                    <char-0x1D624>               " 𝘤          : MATHEMATICAL SANS-SERIF ITALIC SMALL C
+\\isansd                    <char-0x1D625>               " 𝘥          : MATHEMATICAL SANS-SERIF ITALIC SMALL D
+\\isanse                    <char-0x1D626>               " 𝘦          : MATHEMATICAL SANS-SERIF ITALIC SMALL E
+\\isansf                    <char-0x1D627>               " 𝘧          : MATHEMATICAL SANS-SERIF ITALIC SMALL F
+\\isansg                    <char-0x1D628>               " 𝘨          : MATHEMATICAL SANS-SERIF ITALIC SMALL G
+\\isansh                    <char-0x1D629>               " 𝘩          : MATHEMATICAL SANS-SERIF ITALIC SMALL H
+\\isansi                    <char-0x1D62A>               " 𝘪          : MATHEMATICAL SANS-SERIF ITALIC SMALL I
+\\isansj                    <char-0x1D62B>               " 𝘫          : MATHEMATICAL SANS-SERIF ITALIC SMALL J
+\\isansk                    <char-0x1D62C>               " 𝘬          : MATHEMATICAL SANS-SERIF ITALIC SMALL K
+\\isansl                    <char-0x1D62D>               " 𝘭          : MATHEMATICAL SANS-SERIF ITALIC SMALL L
+\\isansm                    <char-0x1D62E>               " 𝘮          : MATHEMATICAL SANS-SERIF ITALIC SMALL M
+\\isansn                    <char-0x1D62F>               " 𝘯          : MATHEMATICAL SANS-SERIF ITALIC SMALL N
+\\isanso                    <char-0x1D630>               " 𝘰          : MATHEMATICAL SANS-SERIF ITALIC SMALL O
+\\isansp                    <char-0x1D631>               " 𝘱          : MATHEMATICAL SANS-SERIF ITALIC SMALL P
+\\isansq                    <char-0x1D632>               " 𝘲          : MATHEMATICAL SANS-SERIF ITALIC SMALL Q
+\\isansr                    <char-0x1D633>               " 𝘳          : MATHEMATICAL SANS-SERIF ITALIC SMALL R
+\\isanss                    <char-0x1D634>               " 𝘴          : MATHEMATICAL SANS-SERIF ITALIC SMALL S
+\\isanst                    <char-0x1D635>               " 𝘵          : MATHEMATICAL SANS-SERIF ITALIC SMALL T
+\\isansu                    <char-0x1D636>               " 𝘶          : MATHEMATICAL SANS-SERIF ITALIC SMALL U
+\\isansv                    <char-0x1D637>               " 𝘷          : MATHEMATICAL SANS-SERIF ITALIC SMALL V
+\\isansw                    <char-0x1D638>               " 𝘸          : MATHEMATICAL SANS-SERIF ITALIC SMALL W
+\\isansx                    <char-0x1D639>               " 𝘹          : MATHEMATICAL SANS-SERIF ITALIC SMALL X
+\\isansy                    <char-0x1D63A>               " 𝘺          : MATHEMATICAL SANS-SERIF ITALIC SMALL Y
+\\isansz                    <char-0x1D63B>               " 𝘻          : MATHEMATICAL SANS-SERIF ITALIC SMALL Z
+\\isinE                     <char-0x022F9>               " ⋹          : ELEMENT OF WITH TWO HORIZONTAL STROKES
+\\isindot                   <char-0x022F5>               " ⋵          : ELEMENT OF WITH DOT ABOVE
+\\isinobar                  <char-0x022F7>               " ⋷          : SMALL ELEMENT OF WITH OVERBAR
+\\isins                     <char-0x022F4>               " ⋴          : SMALL ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
+\\isinvb                    <char-0x022F8>               " ⋸          : ELEMENT OF WITH UNDERBAR
+\\itA                       <char-0x1D434>               " 𝐴          : MATHEMATICAL ITALIC CAPITAL A
+\\itA<Tab>                  <char-0x1D434>               " 𝐴          : MATHEMATICAL ITALIC CAPITAL A
+\\itAl                      \\itAl                       "            : (Incomplete sequence)
+\\itAlpha                   <char-0x1D6E2>               " 𝛢          : MATHEMATICAL ITALIC CAPITAL ALPHA
+\\itB                       <char-0x1D435>               " 𝐵          : MATHEMATICAL ITALIC CAPITAL B
+\\itB<Tab>                  <char-0x1D435>               " 𝐵          : MATHEMATICAL ITALIC CAPITAL B
+\\itBe                      \\itBe                       "            : (Incomplete sequence)
+\\itBeta                    <char-0x1D6E3>               " 𝛣          : MATHEMATICAL ITALIC CAPITAL BETA
+\\itC                       <char-0x1D436>               " 𝐶          : MATHEMATICAL ITALIC CAPITAL C
+\\itC<Tab>                  <char-0x1D436>               " 𝐶          : MATHEMATICAL ITALIC CAPITAL C
+\\itCh                      \\itCh                       "            : (Incomplete sequence)
+\\itChi                     <char-0x1D6F8>               " 𝛸          : MATHEMATICAL ITALIC CAPITAL CHI
+\\itD                       <char-0x1D437>               " 𝐷          : MATHEMATICAL ITALIC CAPITAL D
+\\itD<Tab>                  <char-0x1D437>               " 𝐷          : MATHEMATICAL ITALIC CAPITAL D
+\\itDe                      \\itDe                       "            : (Incomplete sequence)
+\\itDelta                   <char-0x1D6E5>               " 𝛥          : MATHEMATICAL ITALIC CAPITAL DELTA
+\\itE                       <char-0x1D438>               " 𝐸          : MATHEMATICAL ITALIC CAPITAL E
+\\itE<Tab>                  <char-0x1D438>               " 𝐸          : MATHEMATICAL ITALIC CAPITAL E
+\\itEp                      \\itEp                       "            : (Incomplete sequence)
+\\itEpsilon                 <char-0x1D6E6>               " 𝛦          : MATHEMATICAL ITALIC CAPITAL EPSILON
+\\itEt                      \\itEt                       "            : (Incomplete sequence)
+\\itEta                     <char-0x1D6E8>               " 𝛨          : MATHEMATICAL ITALIC CAPITAL ETA
+\\itF                       <char-0x1D439>               " 𝐹          : MATHEMATICAL ITALIC CAPITAL F
+\\itG                       <char-0x1D43A>               " 𝐺          : MATHEMATICAL ITALIC CAPITAL G
+\\itG<Tab>                  <char-0x1D43A>               " 𝐺          : MATHEMATICAL ITALIC CAPITAL G
+\\itGa                      \\itGa                       "            : (Incomplete sequence)
+\\itGamma                   <char-0x1D6E4>               " 𝛤          : MATHEMATICAL ITALIC CAPITAL GAMMA
+\\itH                       <char-0x1D43B>               " 𝐻          : MATHEMATICAL ITALIC CAPITAL H
+\\itI                       <char-0x1D43C>               " 𝐼          : MATHEMATICAL ITALIC CAPITAL I
+\\itI<Tab>                  <char-0x1D43C>               " 𝐼          : MATHEMATICAL ITALIC CAPITAL I
+\\itIo                      \\itIo                       "            : (Incomplete sequence)
+\\itIota                    <char-0x1D6EA>               " 𝛪          : MATHEMATICAL ITALIC CAPITAL IOTA
+\\itJ                       <char-0x1D43D>               " 𝐽          : MATHEMATICAL ITALIC CAPITAL J
+\\itK                       <char-0x1D43E>               " 𝐾          : MATHEMATICAL ITALIC CAPITAL K
+\\itK<Tab>                  <char-0x1D43E>               " 𝐾          : MATHEMATICAL ITALIC CAPITAL K
+\\itKa                      \\itKa                       "            : (Incomplete sequence)
+\\itKappa                   <char-0x1D6EB>               " 𝛫          : MATHEMATICAL ITALIC CAPITAL KAPPA
+\\itL                       <char-0x1D43F>               " 𝐿          : MATHEMATICAL ITALIC CAPITAL L
+\\itL<Tab>                  <char-0x1D43F>               " 𝐿          : MATHEMATICAL ITALIC CAPITAL L
+\\itLa                      \\itLa                       "            : (Incomplete sequence)
+\\itLambda                  <char-0x1D6EC>               " 𝛬          : MATHEMATICAL ITALIC CAPITAL LAMDA
+\\itM                       <char-0x1D440>               " 𝑀          : MATHEMATICAL ITALIC CAPITAL M
+\\itM<Tab>                  <char-0x1D440>               " 𝑀          : MATHEMATICAL ITALIC CAPITAL M
+\\itMu                      <char-0x1D6ED>               " 𝛭          : MATHEMATICAL ITALIC CAPITAL MU
+\\itN                       <char-0x1D441>               " 𝑁          : MATHEMATICAL ITALIC CAPITAL N
+\\itN<Tab>                  <char-0x1D441>               " 𝑁          : MATHEMATICAL ITALIC CAPITAL N
+\\itNu                      <char-0x1D6EE>               " 𝛮          : MATHEMATICAL ITALIC CAPITAL NU
+\\itO                       <char-0x1D442>               " 𝑂          : MATHEMATICAL ITALIC CAPITAL O
+\\itO<Tab>                  <char-0x1D442>               " 𝑂          : MATHEMATICAL ITALIC CAPITAL O
+\\itOm                      \\itOm                       "            : (Incomplete sequence)
+\\itOmega                   <char-0x1D6FA>               " 𝛺          : MATHEMATICAL ITALIC CAPITAL OMEGA
+\\itOmicron                 <char-0x1D6F0>               " 𝛰          : MATHEMATICAL ITALIC CAPITAL OMICRON
+\\itP                       <char-0x1D443>               " 𝑃          : MATHEMATICAL ITALIC CAPITAL P
+\\itP<Tab>                  <char-0x1D443>               " 𝑃          : MATHEMATICAL ITALIC CAPITAL P
+\\itPh                      \\itPh                       "            : (Incomplete sequence)
+\\itPhi                     <char-0x1D6F7>               " 𝛷          : MATHEMATICAL ITALIC CAPITAL PHI
+\\itPi                      <char-0x1D6F1>               " 𝛱          : MATHEMATICAL ITALIC CAPITAL PI
+\\itPs                      \\itPs                       "            : (Incomplete sequence)
+\\itPsi                     <char-0x1D6F9>               " 𝛹          : MATHEMATICAL ITALIC CAPITAL PSI
+\\itQ                       <char-0x1D444>               " 𝑄          : MATHEMATICAL ITALIC CAPITAL Q
+\\itR                       <char-0x1D445>               " 𝑅          : MATHEMATICAL ITALIC CAPITAL R
+\\itR<Tab>                  <char-0x1D445>               " 𝑅          : MATHEMATICAL ITALIC CAPITAL R
+\\itRh                      \\itRh                       "            : (Incomplete sequence)
+\\itRho                     <char-0x1D6F2>               " 𝛲          : MATHEMATICAL ITALIC CAPITAL RHO
+\\itS                       <char-0x1D446>               " 𝑆          : MATHEMATICAL ITALIC CAPITAL S
+\\itS<Tab>                  <char-0x1D446>               " 𝑆          : MATHEMATICAL ITALIC CAPITAL S
+\\itSi                      \\itSi                       "            : (Incomplete sequence)
+\\itSigma                   <char-0x1D6F4>               " 𝛴          : MATHEMATICAL ITALIC CAPITAL SIGMA
+\\itT                       <char-0x1D447>               " 𝑇          : MATHEMATICAL ITALIC CAPITAL T
+\\itT<Tab>                  <char-0x1D447>               " 𝑇          : MATHEMATICAL ITALIC CAPITAL T
+\\itTa                      \\itTa                       "            : (Incomplete sequence)
+\\itTau                     <char-0x1D6F5>               " 𝛵          : MATHEMATICAL ITALIC CAPITAL TAU
+\\itTh                      \\itTh                       "            : (Incomplete sequence)
+\\itTheta                   <char-0x1D6E9>               " 𝛩          : MATHEMATICAL ITALIC CAPITAL THETA
+\\itU                       <char-0x1D448>               " 𝑈          : MATHEMATICAL ITALIC CAPITAL U
+\\itU<Tab>                  <char-0x1D448>               " 𝑈          : MATHEMATICAL ITALIC CAPITAL U
+\\itUp                      \\itUp                       "            : (Incomplete sequence)
+\\itUpsilon                 <char-0x1D6F6>               " 𝛶          : MATHEMATICAL ITALIC CAPITAL UPSILON
+\\itV                       <char-0x1D449>               " 𝑉          : MATHEMATICAL ITALIC CAPITAL V
+\\itW                       <char-0x1D44A>               " 𝑊          : MATHEMATICAL ITALIC CAPITAL W
+\\itX                       <char-0x1D44B>               " 𝑋          : MATHEMATICAL ITALIC CAPITAL X
+\\itX<Tab>                  <char-0x1D44B>               " 𝑋          : MATHEMATICAL ITALIC CAPITAL X
+\\itXi                      <char-0x1D6EF>               " 𝛯          : MATHEMATICAL ITALIC CAPITAL XI
+\\itY                       <char-0x1D44C>               " 𝑌          : MATHEMATICAL ITALIC CAPITAL Y
+\\itZ                       <char-0x1D44D>               " 𝑍          : MATHEMATICAL ITALIC CAPITAL Z
+\\itZ<Tab>                  <char-0x1D44D>               " 𝑍          : MATHEMATICAL ITALIC CAPITAL Z
+\\itZe                      \\itZe                       "            : (Incomplete sequence)
+\\itZeta                    <char-0x1D6E7>               " 𝛧          : MATHEMATICAL ITALIC CAPITAL ZETA
+\\ita                       <char-0x1D44E>               " 𝑎          : MATHEMATICAL ITALIC SMALL A
+\\ita<Tab>                  <char-0x1D44E>               " 𝑎          : MATHEMATICAL ITALIC SMALL A
+\\ital                      \\ital                       "            : (Incomplete sequence)
+\\italpha                   <char-0x1D6FC>               " 𝛼          : MATHEMATICAL ITALIC SMALL ALPHA
+\\itb                       <char-0x1D44F>               " 𝑏          : MATHEMATICAL ITALIC SMALL B
+\\itb<Tab>                  <char-0x1D44F>               " 𝑏          : MATHEMATICAL ITALIC SMALL B
+\\itbe                      \\itbe                       "            : (Incomplete sequence)
+\\itbeta                    <char-0x1D6FD>               " 𝛽          : MATHEMATICAL ITALIC SMALL BETA
+\\itc                       <char-0x1D450>               " 𝑐          : MATHEMATICAL ITALIC SMALL C
+\\itc<Tab>                  <char-0x1D450>               " 𝑐          : MATHEMATICAL ITALIC SMALL C
+\\itch                      \\itch                       "            : (Incomplete sequence)
+\\itchi                     <char-0x1D712>               " 𝜒          : MATHEMATICAL ITALIC SMALL CHI
+\\itd                       <char-0x1D451>               " 𝑑          : MATHEMATICAL ITALIC SMALL D
+\\itd<Tab>                  <char-0x1D451>               " 𝑑          : MATHEMATICAL ITALIC SMALL D
+\\itde                      \\itde                       "            : (Incomplete sequence)
+\\itdelta                   <char-0x1D6FF>               " 𝛿          : MATHEMATICAL ITALIC SMALL DELTA
+\\ite                       <char-0x1D452>               " 𝑒          : MATHEMATICAL ITALIC SMALL E
+\\ite<Tab>                  <char-0x1D452>               " 𝑒          : MATHEMATICAL ITALIC SMALL E
+\\itep                      \\itep                       "            : (Incomplete sequence)
+\\itepsilon                 <char-0x1D716>               " 𝜖          : MATHEMATICAL ITALIC EPSILON SYMBOL
+\\itet                      \\itet                       "            : (Incomplete sequence)
+\\iteta                     <char-0x1D702>               " 𝜂          : MATHEMATICAL ITALIC SMALL ETA
+\\itf                       <char-0x1D453>               " 𝑓          : MATHEMATICAL ITALIC SMALL F
+\\itg                       <char-0x1D454>               " 𝑔          : MATHEMATICAL ITALIC SMALL G
+\\itg<Tab>                  <char-0x1D454>               " 𝑔          : MATHEMATICAL ITALIC SMALL G
+\\itga                      \\itga                       "            : (Incomplete sequence)
+\\itgamma                   <char-0x1D6FE>               " 𝛾          : MATHEMATICAL ITALIC SMALL GAMMA
+\\ith                       <char-0x0210E>               " ℎ          : PLANCK CONSTANT
+\\iti                       <char-0x1D456>               " 𝑖          : MATHEMATICAL ITALIC SMALL I
+\\iti<Tab>                  <char-0x1D456>               " 𝑖          : MATHEMATICAL ITALIC SMALL I
+\\itim                      \\itim                       "            : (Incomplete sequence)
+\\itimath                   <char-0x1D6A4>               " 𝚤          : MATHEMATICAL ITALIC SMALL DOTLESS I
+\\itio                      \\itio                       "            : (Incomplete sequence)
+\\itiota                    <char-0x1D704>               " 𝜄          : MATHEMATICAL ITALIC SMALL IOTA
+\\itj                       <char-0x1D457>               " 𝑗          : MATHEMATICAL ITALIC SMALL J
+\\itj<Tab>                  <char-0x1D457>               " 𝑗          : MATHEMATICAL ITALIC SMALL J
+\\itjm                      \\itjm                       "            : (Incomplete sequence)
+\\itjmath                   <char-0x1D6A5>               " 𝚥          : MATHEMATICAL ITALIC SMALL DOTLESS J
+\\itk                       <char-0x1D458>               " 𝑘          : MATHEMATICAL ITALIC SMALL K
+\\itk<Tab>                  <char-0x1D458>               " 𝑘          : MATHEMATICAL ITALIC SMALL K
+\\itka                      \\itka                       "            : (Incomplete sequence)
+\\itkappa                   <char-0x1D705>               " 𝜅          : MATHEMATICAL ITALIC SMALL KAPPA
+\\itl                       <char-0x1D459>               " 𝑙          : MATHEMATICAL ITALIC SMALL L
+\\itl<Tab>                  <char-0x1D459>               " 𝑙          : MATHEMATICAL ITALIC SMALL L
+\\itla                      \\itla                       "            : (Incomplete sequence)
+\\itlambda                  <char-0x1D706>               " 𝜆          : MATHEMATICAL ITALIC SMALL LAMDA
+\\itm                       <char-0x1D45A>               " 𝑚          : MATHEMATICAL ITALIC SMALL M
+\\itm<Tab>                  <char-0x1D45A>               " 𝑚          : MATHEMATICAL ITALIC SMALL M
+\\itmu                      <char-0x1D707>               " 𝜇          : MATHEMATICAL ITALIC SMALL MU
+\\itn                       <char-0x1D45B>               " 𝑛          : MATHEMATICAL ITALIC SMALL N
+\\itn<Tab>                  <char-0x1D45B>               " 𝑛          : MATHEMATICAL ITALIC SMALL N
+\\itna                      \\itna                       "            : (Incomplete sequence)
+\\itnabla                   <char-0x1D6FB>               " 𝛻          : MATHEMATICAL ITALIC NABLA
+\\itnu                      <char-0x1D708>               " 𝜈          : MATHEMATICAL ITALIC SMALL NU
+\\ito                       <char-0x1D45C>               " 𝑜          : MATHEMATICAL ITALIC SMALL O
+\\ito<Tab>                  <char-0x1D45C>               " 𝑜          : MATHEMATICAL ITALIC SMALL O
+\\itom                      \\itom                       "            : (Incomplete sequence)
+\\itomega                   <char-0x1D714>               " 𝜔          : MATHEMATICAL ITALIC SMALL OMEGA
+\\itomicron                 <char-0x1D70A>               " 𝜊          : MATHEMATICAL ITALIC SMALL OMICRON
+\\itp                       <char-0x1D45D>               " 𝑝          : MATHEMATICAL ITALIC SMALL P
+\\itp<Tab>                  <char-0x1D45D>               " 𝑝          : MATHEMATICAL ITALIC SMALL P
+\\itpa                      \\itpa                       "            : (Incomplete sequence)
+\\itpartial                 <char-0x1D715>               " 𝜕          : MATHEMATICAL ITALIC PARTIAL DIFFERENTIAL
+\\itph                      \\itph                       "            : (Incomplete sequence)
+\\itphi                     <char-0x1D719>               " 𝜙          : MATHEMATICAL ITALIC PHI SYMBOL
+\\itpi                      <char-0x1D70B>               " 𝜋          : MATHEMATICAL ITALIC SMALL PI
+\\itps                      \\itps                       "            : (Incomplete sequence)
+\\itpsi                     <char-0x1D713>               " 𝜓          : MATHEMATICAL ITALIC SMALL PSI
+\\itq                       <char-0x1D45E>               " 𝑞          : MATHEMATICAL ITALIC SMALL Q
+\\itr                       <char-0x1D45F>               " 𝑟          : MATHEMATICAL ITALIC SMALL R
+\\itr<Tab>                  <char-0x1D45F>               " 𝑟          : MATHEMATICAL ITALIC SMALL R
+\\itrh                      \\itrh                       "            : (Incomplete sequence)
+\\itrho                     <char-0x1D70C>               " 𝜌          : MATHEMATICAL ITALIC SMALL RHO
+\\its                       <char-0x1D460>               " 𝑠          : MATHEMATICAL ITALIC SMALL S
+\\its<Tab>                  <char-0x1D460>               " 𝑠          : MATHEMATICAL ITALIC SMALL S
+\\itsi                      \\itsi                       "            : (Incomplete sequence)
+\\itsigma                   <char-0x1D70E>               " 𝜎          : MATHEMATICAL ITALIC SMALL SIGMA
+\\itt                       <char-0x1D461>               " 𝑡          : MATHEMATICAL ITALIC SMALL T
+\\itt<Tab>                  <char-0x1D461>               " 𝑡          : MATHEMATICAL ITALIC SMALL T
+\\itta                      \\itta                       "            : (Incomplete sequence)
+\\ittau                     <char-0x1D70F>               " 𝜏          : MATHEMATICAL ITALIC SMALL TAU
+\\itth                      \\itth                       "            : (Incomplete sequence)
+\\ittheta                   <char-0x1D703>               " 𝜃          : MATHEMATICAL ITALIC SMALL THETA
+\\itu                       <char-0x1D462>               " 𝑢          : MATHEMATICAL ITALIC SMALL U
+\\itu<Tab>                  <char-0x1D462>               " 𝑢          : MATHEMATICAL ITALIC SMALL U
+\\itup                      \\itup                       "            : (Incomplete sequence)
+\\itupsilon                 <char-0x1D710>               " 𝜐          : MATHEMATICAL ITALIC SMALL UPSILON
+\\itv                       <char-0x1D463>               " 𝑣          : MATHEMATICAL ITALIC SMALL V
+\\itv<Tab>                  <char-0x1D463>               " 𝑣          : MATHEMATICAL ITALIC SMALL V
+\\itva                      \\itva                       "            : (Incomplete sequence)
+\\itvarTheta                <char-0x1D6F3>               " 𝛳          : MATHEMATICAL ITALIC CAPITAL THETA SYMBOL
+\\itvarepsilon              <char-0x1D700>               " 𝜀          : MATHEMATICAL ITALIC SMALL EPSILON
+\\itvarkappa                <char-0x1D718>               " 𝜘          : MATHEMATICAL ITALIC KAPPA SYMBOL
+\\itvarphi                  <char-0x1D711>               " 𝜑          : MATHEMATICAL ITALIC SMALL PHI
+\\itvarpi                   <char-0x1D71B>               " 𝜛          : MATHEMATICAL ITALIC PI SYMBOL
+\\itvarrho                  <char-0x1D71A>               " 𝜚          : MATHEMATICAL ITALIC RHO SYMBOL
+\\itvarsigma                <char-0x1D70D>               " 𝜍          : MATHEMATICAL ITALIC SMALL FINAL SIGMA
+\\itvartheta                <char-0x1D717>               " 𝜗          : MATHEMATICAL ITALIC THETA SYMBOL
+\\itw                       <char-0x1D464>               " 𝑤          : MATHEMATICAL ITALIC SMALL W
+\\itx                       <char-0x1D465>               " 𝑥          : MATHEMATICAL ITALIC SMALL X
+\\itx<Tab>                  <char-0x1D465>               " 𝑥          : MATHEMATICAL ITALIC SMALL X
+\\itxi                      <char-0x1D709>               " 𝜉          : MATHEMATICAL ITALIC SMALL XI
+\\ity                       <char-0x1D466>               " 𝑦          : MATHEMATICAL ITALIC SMALL Y
+\\itz                       <char-0x1D467>               " 𝑧          : MATHEMATICAL ITALIC SMALL Z
+\\itz<Tab>                  <char-0x1D467>               " 𝑧          : MATHEMATICAL ITALIC SMALL Z
+\\itze                      \\itze                       "            : (Incomplete sequence)
+\\itzeta                    <char-0x1D701>               " 𝜁          : MATHEMATICAL ITALIC SMALL ZETA
+\\jmath                     <char-0x00237>               " ȷ          : LATIN SMALL LETTER DOTLESS J
+\\join                      <char-0x02A1D>               " ⨝          : JOIN
+\\jupiter                   <char-0x02643>               " ♃          : JUPITER
+\\k                         <char-0x00328>               " ◌̨         : COMBINING OGONEK / NON-SPACING OGONEK
+\\k<Tab>                    <char-0x00328>               " ◌̨         : COMBINING OGONEK / NON-SPACING OGONEK
+\\ka                        \\ka                         "            : (Incomplete sequence)
+\\kappa                     <char-0x003BA>               " κ          : GREEK SMALL LETTER KAPPA
+\\ke                        \\ke                         "            : (Incomplete sequence)
+\\kernelcontraction         <char-0x0223B>               " ∻          : HOMOTHETIC
+\\l                         <char-0x00142>               " ł          : LATIN SMALL LETTER L WITH STROKE / LATIN SMALL LETTER L SLASH
+\\l<Tab>                    <char-0x00142>               " ł          : LATIN SMALL LETTER L WITH STROKE / LATIN SMALL LETTER L SLASH
+\\la                        \\la                         "            : (Incomplete sequence)
+\\lambda                    <char-0x003BB>               " λ          : GREEK SMALL LETTER LAMDA / GREEK SMALL LETTER LAMBDA
+\\langle                    <char-0x027E8>               " ⟨          : MATHEMATICAL LEFT ANGLE BRACKET
+\\lat                       <char-0x02AAB>               " ⪫          : LARGER THAN
+\\lat<Tab>                  <char-0x02AAB>               " ⪫          : LARGER THAN
+\\late                      <char-0x02AAD>               " ⪭          : LARGER THAN OR EQUAL TO
+\\lazysinv                  <char-0x0223E>               " ∾          : INVERTED LAZY S
+\\lc                        \\lc                         "            : (Incomplete sequence)
+\\lceil                     <char-0x02308>               " ⌈          : LEFT CEILING
+\\ld                        \\ld                         "            : (Incomplete sequence)
+\\ldots                     <char-0x02026>               " …          : HORIZONTAL ELLIPSIS
+\\ldq                       <char-0x0201C>               " “          : LEFT DOUBLE QUOTATION MARK / DOUBLE TURNED COMMA QUOTATION MARK
+\\le                        <char-0x02264>               " ≤          : LESS-THAN OR EQUAL TO / LESS THAN OR EQUAL TO
+\\le<Tab>                   <char-0x02264>               " ≤          : LESS-THAN OR EQUAL TO / LESS THAN OR EQUAL TO
+\\lef                       \\lef                        "            : (Incomplete sequence)
+\\leftarrow                 <char-0x02190>               " ←          : LEFTWARDS ARROW / LEFT ARROW
+\\leftarrow<Tab>            <char-0x02190>               " ←          : LEFTWARDS ARROW / LEFT ARROW
+\\leftarrowa                \\leftarrowa                 "            : (Incomplete sequence)
+\\leftarrowapprox           <char-0x02B4A>               " ⭊          : LEFTWARDS ARROW ABOVE ALMOST EQUAL TO
+\\leftarrowb                \\leftarrowb                 "            : (Incomplete sequence)
+\\leftarrowbackapprox       <char-0x02B42>               " ⭂          : LEFTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO
+\\leftarrowbsimilar         <char-0x02B4B>               " ⭋          : LEFTWARDS ARROW ABOVE REVERSE TILDE OPERATOR
+\\leftarrowo                \\leftarrowo                 "            : (Incomplete sequence)
+\\leftarrowonoplus          <char-0x02B32>               " ⬲          : LEFT ARROW WITH CIRCLED PLUS
+\\leftarrowp                \\leftarrowp                 "            : (Incomplete sequence)
+\\leftarrowplus             <char-0x02946>               " ⥆          : LEFTWARDS ARROW WITH PLUS BELOW
+\\leftarrowt                \\leftarrowt                 "            : (Incomplete sequence)
+\\leftarrowtail             <char-0x021A2>               " ↢          : LEFTWARDS ARROW WITH TAIL / LEFT ARROW WITH TAIL
+\\leftarrowtriangle         <char-0x021FD>               " ⇽          : LEFTWARDS OPEN-HEADED ARROW
+\\leftarrowx                <char-0x02B3E>               " ⬾          : LEFTWARDS ARROW THROUGH X
+\\leftbkarrow               <char-0x0290C>               " ⤌          : LEFTWARDS DOUBLE DASH ARROW
+\\leftcurvedarrow           <char-0x02B3F>               " ⬿          : WAVE ARROW POINTING DIRECTLY LEFT
+\\leftdasharrow             <char-0x021E0>               " ⇠          : LEFTWARDS DASHED ARROW / LEFT DASHED ARROW
+\\leftdbkarrow              <char-0x0290E>               " ⤎          : LEFTWARDS TRIPLE DASH ARROW
+\\leftdotarrow              <char-0x02B38>               " ⬸          : LEFTWARDS ARROW WITH DOTTED STEM
+\\leftharpoonaccent         <char-0x020D0>               " ◌⃐         : COMBINING LEFT HARPOON ABOVE / NON-SPACING LEFT HARPOON ABOVE
+\\leftharpoondown           <char-0x021BD>               " ↽          : LEFTWARDS HARPOON WITH BARB DOWNWARDS / LEFT HARPOON WITH BARB DOWN
+\\leftharpoonsupdown        <char-0x02962>               " ⥢          : LEFTWARDS HARPOON WITH BARB UP ABOVE LEFTWARDS HARPOON WITH BARB DOWN
+\\leftharpoonup             <char-0x021BC>               " ↼          : LEFTWARDS HARPOON WITH BARB UPWARDS / LEFT HARPOON WITH BARB UP
+\\leftharpoonup<Tab>        <char-0x021BC>               " ↼          : LEFTWARDS HARPOON WITH BARB UPWARDS / LEFT HARPOON WITH BARB UP
+\\leftharpoonupd            \\leftharpoonupd             "            : (Incomplete sequence)
+\\leftharpoonupdash         <char-0x0296A>               " ⥪          : LEFTWARDS HARPOON WITH BARB UP ABOVE LONG DASH
+\\leftleftarrows            <char-0x021C7>               " ⇇          : LEFTWARDS PAIRED ARROWS / LEFT PAIRED ARROWS
+\\leftmoon                  <char-0x0263E>               " ☾          : LAST QUARTER MOON
+\\leftouterjoin             <char-0x027D5>               " ⟕          : LEFT OUTER JOIN
+\\leftrightarrow            <char-0x02194>               " ↔          : LEFT RIGHT ARROW
+\\leftrightarrow<Tab>       <char-0x02194>               " ↔          : LEFT RIGHT ARROW
+\\leftrightarrowc           \\leftrightarrowc            "            : (Incomplete sequence)
+\\leftrightarrowcircle      <char-0x02948>               " ⥈          : LEFT RIGHT ARROW THROUGH SMALL CIRCLE
+\\leftrightarrows           <char-0x021C6>               " ⇆          : LEFTWARDS ARROW OVER RIGHTWARDS ARROW / LEFT ARROW OVER RIGHT ARROW
+\\leftrightarrowt           \\leftrightarrowt            "            : (Incomplete sequence)
+\\leftrightarrowtriangle    <char-0x021FF>               " ⇿          : LEFT RIGHT OPEN-HEADED ARROW
+\\leftrightharpoondownup    <char-0x0294B>               " ⥋          : LEFT BARB DOWN RIGHT BARB UP HARPOON
+\\leftrightharpoons         <char-0x021CB>               " ⇋          : LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON / LEFT HARPOON OVER RIGHT HARPOON
+\\leftrightharpoons<Tab>    <char-0x021CB>               " ⇋          : LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON / LEFT HARPOON OVER RIGHT HARPOON
+\\leftrightharpoonsd        \\leftrightharpoonsd         "            : (Incomplete sequence)
+\\leftrightharpoonsdown     <char-0x02967>               " ⥧          : LEFTWARDS HARPOON WITH BARB DOWN ABOVE RIGHTWARDS HARPOON WITH BARB DOWN
+\\leftrightharpoonsu        \\leftrightharpoonsu         "            : (Incomplete sequence)
+\\leftrightharpoonsup       <char-0x02966>               " ⥦          : LEFTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB UP
+\\leftrightharpoonupdown    <char-0x0294A>               " ⥊          : LEFT BARB UP RIGHT BARB DOWN HARPOON
+\\leftrightsquigarrow       <char-0x021AD>               " ↭          : LEFT RIGHT WAVE ARROW
+\\leftsquigarrow            <char-0x021DC>               " ⇜          : LEFTWARDS SQUIGGLE ARROW / LEFT SQUIGGLE ARROW
+\\leftthreearrows           <char-0x02B31>               " ⬱          : THREE LEFTWARDS ARROWS
+\\leftthreetimes            <char-0x022CB>               " ⋋          : LEFT SEMIDIRECT PRODUCT
+\\leftwavearrow             <char-0x0219C>               " ↜          : LEFTWARDS WAVE ARROW / LEFT WAVE ARROW
+\\leftwhitearrow            <char-0x021E6>               " ⇦          : LEFTWARDS WHITE ARROW / WHITE LEFT ARROW
+\\leo                       <char-0x0264C>               " ♌          : LEO
+\\leq                       <char-0x02264>               " ≤          : LESS-THAN OR EQUAL TO / LESS THAN OR EQUAL TO
+\\leq<Tab>                  <char-0x02264>               " ≤          : LESS-THAN OR EQUAL TO / LESS THAN OR EQUAL TO
+\\leqq                      <char-0x02266>               " ≦          : LESS-THAN OVER EQUAL TO / LESS THAN OVER EQUAL TO
+\\leqq<Tab>                 <char-0x02266>               " ≦          : LESS-THAN OVER EQUAL TO / LESS THAN OVER EQUAL TO
+\\leqqs                     \\leqqs                      "            : (Incomplete sequence)
+\\leqqslant                 <char-0x02AF9>               " ⫹          : DOUBLE-LINE SLANTED LESS-THAN OR EQUAL TO
+\\leqs                      \\leqs                       "            : (Incomplete sequence)
+\\leqslant                  <char-0x02A7D>               " ⩽          : LESS-THAN OR SLANTED EQUAL TO
+\\les                       \\les                        "            : (Incomplete sequence)
+\\lescc                     <char-0x02AA8>               " ⪨          : LESS-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL
+\\lesdot                    <char-0x02A7F>               " ⩿          : LESS-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
+\\lesdot<Tab>               <char-0x02A7F>               " ⩿          : LESS-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
+\\lesdoto                   <char-0x02A81>               " ⪁          : LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
+\\lesdoto<Tab>              <char-0x02A81>               " ⪁          : LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
+\\lesdotor                  <char-0x02A83>               " ⪃          : LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE RIGHT
+\\lesges                    <char-0x02A93>               " ⪓          : LESS-THAN ABOVE SLANTED EQUAL ABOVE GREATER-THAN ABOVE SLANTED EQUAL
+\\lessapprox                <char-0x02A85>               " ⪅          : LESS-THAN OR APPROXIMATE
+\\lessdot                   <char-0x022D6>               " ⋖          : LESS-THAN WITH DOT / LESS THAN WITH DOT
+\\lesseqgtr                 <char-0x022DA>               " ⋚          : LESS-THAN EQUAL TO OR GREATER-THAN / LESS THAN EQUAL TO OR GREATER THAN
+\\lesseqqgtr                <char-0x02A8B>               " ⪋          : LESS-THAN ABOVE DOUBLE-LINE EQUAL ABOVE GREATER-THAN
+\\lessgtr                   <char-0x02276>               " ≶          : LESS-THAN OR GREATER-THAN / LESS THAN OR GREATER THAN
+\\lesssim                   <char-0x02272>               " ≲          : LESS-THAN OR EQUIVALENT TO / LESS THAN OR EQUIVALENT TO
+\\lf                        \\lf                         "            : (Incomplete sequence)
+\\lfloor                    <char-0x0230A>               " ⌊          : LEFT FLOOR
+\\lg                        \\lg                         "            : (Incomplete sequence)
+\\lgE                       <char-0x02A91>               " ⪑          : LESS-THAN ABOVE GREATER-THAN ABOVE DOUBLE-LINE EQUAL
+\\lgblkcircle               <char-0x02B24>               " ⬤          : BLACK LARGE CIRCLE
+\\lgblksquare               <char-0x02B1B>               " ⬛          : BLACK LARGE SQUARE
+\\lgwhtcircle               <char-0x025EF>               " ◯          : LARGE CIRCLE
+\\lgwhtsquare               <char-0x02B1C>               " ⬜          : WHITE LARGE SQUARE
+\\li                        \\li                         "            : (Incomplete sequence)
+\\libra                     <char-0x0264E>               " ♎          : LIBRA
+\\linefeed                  <char-0x021B4>               " ↴          : RIGHTWARDS ARROW WITH CORNER DOWNWARDS / RIGHT ARROW WITH CORNER DOWN
+\\ll                        <char-0x0226A>               " ≪          : MUCH LESS-THAN / MUCH LESS THAN
+\\ll<Tab>                   <char-0x0226A>               " ≪          : MUCH LESS-THAN / MUCH LESS THAN
+\\lla                       \\lla                        "            : (Incomplete sequence)
+\\llarc                     <char-0x025DF>               " ◟          : LOWER LEFT QUADRANT CIRCULAR ARC
+\\llb                       \\llb                        "            : (Incomplete sequence)
+\\llblacktriangle           <char-0x025E3>               " ◣          : BLACK LOWER LEFT TRIANGLE
+\\llbracket                 <char-0x027E6>               " ⟦          : MATHEMATICAL LEFT WHITE SQUARE BRACKET
+\\llc                       \\llc                        "            : (Incomplete sequence)
+\\llcorner                  <char-0x0231E>               " ⌞          : BOTTOM LEFT CORNER
+\\lll                       \\lll                        "            : (Incomplete sequence)
+\\lllnest                   <char-0x02AF7>               " ⫷          : TRIPLE NESTED LESS-THAN
+\\llt                       \\llt                        "            : (Incomplete sequence)
+\\lltriangle                <char-0x025FA>               " ◺          : LOWER LEFT TRIANGLE
+\\lm                        \\lm                         "            : (Incomplete sequence)
+\\lmoustache                <char-0x023B0>               " ⎰          : UPPER LEFT OR LOWER RIGHT CURLY BRACKET SECTION
+\\lmrk                      <char-0x002D0>               " ː          : MODIFIER LETTER TRIANGULAR COLON
+\\ln                        \\ln                         "            : (Incomplete sequence)
+\\lnapprox                  <char-0x02A89>               " ⪉          : LESS-THAN AND NOT APPROXIMATE
+\\lneq                      <char-0x02A87>               " ⪇          : LESS-THAN AND SINGLE-LINE NOT EQUAL TO
+\\lneq<Tab>                 <char-0x02A87>               " ⪇          : LESS-THAN AND SINGLE-LINE NOT EQUAL TO
+\\lneqq                     <char-0x02268>               " ≨          : LESS-THAN BUT NOT EQUAL TO / LESS THAN BUT NOT EQUAL TO
+\\lnsim                     <char-0x022E6>               " ⋦          : LESS-THAN BUT NOT EQUIVALENT TO / LESS THAN BUT NOT EQUIVALENT TO
+\\lo                        \\lo                         "            : (Incomplete sequence)
+\\longleftarrow             <char-0x027F5>               " ⟵          : LONG LEFTWARDS ARROW
+\\longleftrightarrow        <char-0x027F7>               " ⟷          : LONG LEFT RIGHT ARROW
+\\longleftsquigarrow        <char-0x02B33>               " ⬳          : LONG LEFTWARDS SQUIGGLE ARROW
+\\longmapsfrom              <char-0x027FB>               " ⟻          : LONG LEFTWARDS ARROW FROM BAR
+\\longmapsto                <char-0x027FC>               " ⟼          : LONG RIGHTWARDS ARROW FROM BAR
+\\longrightarrow            <char-0x027F6>               " ⟶          : LONG RIGHTWARDS ARROW
+\\longrightsquigarrow       <char-0x027FF>               " ⟿          : LONG RIGHTWARDS SQUIGGLE ARROW
+\\looparrowleft             <char-0x021AB>               " ↫          : LEFTWARDS ARROW WITH LOOP / LEFT ARROW WITH LOOP
+\\looparrowright            <char-0x021AC>               " ↬          : RIGHTWARDS ARROW WITH LOOP / RIGHT ARROW WITH LOOP
+\\low                       <char-0x002D5>               " ˕          : MODIFIER LETTER DOWN TACK
+\\low<Tab>                  <char-0x002D5>               " ˕          : MODIFIER LETTER DOWN TACK
+\\lowi                      \\lowi                       "            : (Incomplete sequence)
+\\lowint                    <char-0x02A1C>               " ⨜          : INTEGRAL WITH UNDERBAR
+\\lozenge                   <char-0x025CA>               " ◊          : LOZENGE
+\\lp                        \\lp                         "            : (Incomplete sequence)
+\\lpargt                    <char-0x029A0>               " ⦠          : SPHERICAL ANGLE OPENING LEFT
+\\lq                        <char-0x02018>               " ‘          : LEFT SINGLE QUOTATION MARK / SINGLE TURNED COMMA QUOTATION MARK
+\\lr                        \\lr                         "            : (Incomplete sequence)
+\\lrarc                     <char-0x025DE>               " ◞          : LOWER RIGHT QUADRANT CIRCULAR ARC
+\\lrblacktriangle           <char-0x025E2>               " ◢          : BLACK LOWER RIGHT TRIANGLE
+\\lrcorner                  <char-0x0231F>               " ⌟          : BOTTOM RIGHT CORNER
+\\lrtriangle                <char-0x025FF>               " ◿          : LOWER RIGHT TRIANGLE
+\\lrtriangle<Tab>           <char-0x025FF>               " ◿          : LOWER RIGHT TRIANGLE
+\\lrtrianglee               \\lrtrianglee                "            : (Incomplete sequence)
+\\lrtriangleeq              <char-0x029E1>               " ⧡          : INCREASES AS
+\\ls                        \\ls                         "            : (Incomplete sequence)
+\\lsime                     <char-0x02A8D>               " ⪍          : LESS-THAN ABOVE SIMILAR OR EQUAL
+\\lsimg                     <char-0x02A8F>               " ⪏          : LESS-THAN ABOVE SIMILAR ABOVE GREATER-THAN
+\\lsqhook                   <char-0x02ACD>               " ⫍          : SQUARE LEFT OPEN BOX OPERATOR
+\\lt                        \\lt                         "            : (Incomplete sequence)
+\\ltcc                      <char-0x02AA6>               " ⪦          : LESS-THAN CLOSED BY CURVE
+\\ltcir                     <char-0x02A79>               " ⩹          : LESS-THAN WITH CIRCLE INSIDE
+\\ltimes                    <char-0x022C9>               " ⋉          : LEFT NORMAL FACTOR SEMIDIRECT PRODUCT
+\\ltlmr                     <char-0x00271>               " ɱ          : LATIN SMALL LETTER M WITH HOOK / LATIN SMALL LETTER M HOOK
+\\ltln                      <char-0x00272>               " ɲ          : LATIN SMALL LETTER N WITH LEFT HOOK / LATIN SMALL LETTER N HOOK
+\\ltphi                     <char-0x00278>               " ɸ          : LATIN SMALL LETTER PHI
+\\ltquest                   <char-0x02A7B>               " ⩻          : LESS-THAN WITH QUESTION MARK ABOVE
+\\lv                        \\lv                         "            : (Incomplete sequence)
+\\lvboxline                 <char-0x023B8>               " ⎸          : LEFT VERTICAL BOX LINE
+\\lvertneqq                 <char-0x02268><char-0x0FE00> " ≨︀         : LESS-THAN BUT NOT EQUAL TO / LESS THAN BUT NOT EQUAL TO + VARIATION SELECTOR-1
+\\male                      <char-0x02642>               " ♂          : MALE SIGN
+\\maltese                   <char-0x02720>               " ✠          : MALTESE CROSS
+\\mapsdown                  <char-0x021A7>               " ↧          : DOWNWARDS ARROW FROM BAR / DOWN ARROW FROM BAR
+\\mapsfrom                  <char-0x021A4>               " ↤          : LEFTWARDS ARROW FROM BAR / LEFT ARROW FROM BAR
+\\mapsto                    <char-0x021A6>               " ↦          : RIGHTWARDS ARROW FROM BAR / RIGHT ARROW FROM BAR
+\\mapsup                    <char-0x021A5>               " ↥          : UPWARDS ARROW FROM BAR / UP ARROW FROM BAR
+\\mars                      <char-0x02642>               " ♂          : MALE SIGN
+\\mdblkcircle               <char-0x026AB>               " ⚫          : MEDIUM BLACK CIRCLE
+\\mdblkdiamond              <char-0x02B25>               " ⬥          : BLACK MEDIUM DIAMOND
+\\mdblklozenge              <char-0x02B27>               " ⬧          : BLACK MEDIUM LOZENGE
+\\mdblksquare               <char-0x025FC>               " ◼          : BLACK MEDIUM SQUARE
+\\mdlgblkcircle             <char-0x025CF>               " ●          : BLACK CIRCLE
+\\mdlgblkdiamond            <char-0x025C6>               " ◆          : BLACK DIAMOND
+\\mdlgwhtdiamond            <char-0x025C7>               " ◇          : WHITE DIAMOND
+\\mdsmblksquare             <char-0x025FE>               " ◾          : BLACK MEDIUM SMALL SQUARE
+\\mdsmwhtcircle             <char-0x026AC>               " ⚬          : MEDIUM SMALL WHITE CIRCLE
+\\mdsmwhtsquare             <char-0x025FD>               " ◽          : WHITE MEDIUM SMALL SQUARE
+\\mdwhtcircle               <char-0x026AA>               " ⚪          : MEDIUM WHITE CIRCLE
+\\mdwhtdiamond              <char-0x02B26>               " ⬦          : WHITE MEDIUM DIAMOND
+\\mdwhtlozenge              <char-0x02B28>               " ⬨          : WHITE MEDIUM LOZENGE
+\\mdwhtsquare               <char-0x025FB>               " ◻          : WHITE MEDIUM SQUARE
+\\measangledltosw           <char-0x029AF>               " ⦯          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING LEFT AND DOWN
+\\measangledrtose           <char-0x029AE>               " ⦮          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND DOWN
+\\measangleldtosw           <char-0x029AB>               " ⦫          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND LEFT
+\\measanglelutonw           <char-0x029A9>               " ⦩          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND LEFT
+\\measanglerdtose           <char-0x029AA>               " ⦪          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND RIGHT
+\\measanglerutone           <char-0x029A8>               " ⦨          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND RIGHT
+\\measangleultonw           <char-0x029AD>               " ⦭          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING LEFT AND UP
+\\measangleurtone           <char-0x029AC>               " ⦬          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND UP
+\\measeq                    <char-0x0225E>               " ≞          : MEASURED BY
+\\measuredangle             <char-0x02221>               " ∡          : MEASURED ANGLE
+\\measuredangle<Tab>        <char-0x02221>               " ∡          : MEASURED ANGLE
+\\measuredanglel            \\measuredanglel             "            : (Incomplete sequence)
+\\measuredangleleft         <char-0x0299B>               " ⦛          : MEASURED ANGLE OPENING LEFT
+\\medblackstar              <char-0x02B51>               " ⭑          : BLACK SMALL STAR
+\\medwhitestar              <char-0x02B50>               " ⭐          : WHITE MEDIUM STAR
+\\mercury                   <char-0x0263F>               " ☿          : MERCURY
+\\mho                       <char-0x02127>               " ℧          : INVERTED OHM SIGN / MHO
+\\mid                       <char-0x02223>               " ∣          : DIVIDES
+\\mid<Tab>                  <char-0x02223>               " ∣          : DIVIDES
+\\midb                      \\midb                       "            : (Incomplete sequence)
+\\midbarvee                 <char-0x02A5D>               " ⩝          : LOGICAL OR WITH HORIZONTAL DASH
+\\midbarwedge               <char-0x02A5C>               " ⩜          : LOGICAL AND WITH HORIZONTAL DASH
+\\minhat                    <char-0x02A5F>               " ⩟          : LOGICAL AND WITH UNDERBAR
+\\minus                     <char-0x02212>               " −          : MINUS SIGN
+\\minus<Tab>                <char-0x02212>               " −          : MINUS SIGN
+\\minusd                    \\minusd                     "            : (Incomplete sequence)
+\\minusdot                  <char-0x02A2A>               " ⨪          : MINUS SIGN WITH DOT BELOW
+\\minusf                    \\minusf                     "            : (Incomplete sequence)
+\\minusfdots                <char-0x02A2B>               " ⨫          : MINUS SIGN WITH FALLING DOTS
+\\minusr                    \\minusr                     "            : (Incomplete sequence)
+\\minusrdots                <char-0x02A2C>               " ⨬          : MINUS SIGN WITH RISING DOTS
+\\mlcp                      <char-0x02ADB>               " ⫛          : TRANSVERSAL INTERSECTION
+\\models                    <char-0x022A7>               " ⊧          : MODELS
+\\modtwosum                 <char-0x02A0A>               " ⨊          : MODULO TWO SUM
+\\mp                        <char-0x02213>               " ∓          : MINUS-OR-PLUS SIGN
+\\mu                        <char-0x003BC>               " μ          : GREEK SMALL LETTER MU
+\\mu<Tab>                   <char-0x003BC>               " μ          : GREEK SMALL LETTER MU
+\\mul                       \\mul                        "            : (Incomplete sequence)
+\\multimap                  <char-0x022B8>               " ⊸          : MULTIMAP
+\\nBumpeq                   <char-0x0224E><char-0x00338> " ≎̸         : GEOMETRICALLY EQUIVALENT TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\nHdownarrow               <char-0x021DF>               " ⇟          : DOWNWARDS ARROW WITH DOUBLE STROKE / DOWN ARROW WITH DOUBLE STROKE
+\\nHuparrow                 <char-0x021DE>               " ⇞          : UPWARDS ARROW WITH DOUBLE STROKE / UP ARROW WITH DOUBLE STROKE
+\\nLeftarrow                <char-0x021CD>               " ⇍          : LEFTWARDS DOUBLE ARROW WITH STROKE / LEFT DOUBLE ARROW WITH STROKE
+\\nLeftrightarrow           <char-0x021CE>               " ⇎          : LEFT RIGHT DOUBLE ARROW WITH STROKE
+\\nRightarrow               <char-0x021CF>               " ⇏          : RIGHTWARDS DOUBLE ARROW WITH STROKE / RIGHT DOUBLE ARROW WITH STROKE
+\\nVDash                    <char-0x022AF>               " ⊯          : NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
+\\nVdash                    <char-0x022AE>               " ⊮          : DOES NOT FORCE
+\\nVleftarrow               <char-0x021FA>               " ⇺          : LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE
+\\nVleftarrow<Tab>          <char-0x021FA>               " ⇺          : LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE
+\\nVleftarrowt              \\nVleftarrowt               "            : (Incomplete sequence)
+\\nVleftarrowtail           <char-0x02B3A>               " ⬺          : LEFTWARDS ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
+\\nVleftrightarrow          <char-0x021FC>               " ⇼          : LEFT RIGHT ARROW WITH DOUBLE VERTICAL STROKE
+\\nVrightarrow              <char-0x021FB>               " ⇻          : RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE
+\\nVrightarrow<Tab>         <char-0x021FB>               " ⇻          : RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE
+\\nVrightarrowt             \\nVrightarrowt              "            : (Incomplete sequence)
+\\nVrightarrowtail          <char-0x02915>               " ⤕          : RIGHTWARDS ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
+\\nVtwoheadleftarrow        <char-0x02B35>               " ⬵          : LEFTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE
+\\nVtwoheadleftarrow<Tab>   <char-0x02B35>               " ⬵          : LEFTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE
+\\nVtwoheadleftarrowt       \\nVtwoheadleftarrowt        "            : (Incomplete sequence)
+\\nVtwoheadleftarrowtail    <char-0x02B3D>               " ⬽          : LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
+\\nVtwoheadrightarrow       <char-0x02901>               " ⤁          : RIGHTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE
+\\nVtwoheadrightarrow<Tab>  <char-0x02901>               " ⤁          : RIGHTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE
+\\nVtwoheadrightarrowt      \\nVtwoheadrightarrowt       "            : (Incomplete sequence)
+\\nVtwoheadrightarrowtail   <char-0x02918>               " ⤘          : RIGHTWARDS TWO-HEADED ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
+\\nabla                     <char-0x02207>               " ∇          : NABLA
+\\napprox                   <char-0x02249>               " ≉          : NOT ALMOST EQUAL TO
+\\nasymp                    <char-0x0226D>               " ≭          : NOT EQUIVALENT TO
+\\natural                   <char-0x0266E>               " ♮          : MUSIC NATURAL SIGN / NATURAL
+\\nbumpeq                   <char-0x0224F><char-0x00338> " ≏̸         : DIFFERENCE BETWEEN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\ncong                     <char-0x02247>               " ≇          : NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO
+\\ne                        <char-0x02260>               " ≠          : NOT EQUAL TO
+\\ne<Tab>                   <char-0x02260>               " ≠          : NOT EQUAL TO
+\\nea                       \\nea                        "            : (Incomplete sequence)
+\\nearrow                   <char-0x02197>               " ↗          : NORTH EAST ARROW / UPPER RIGHT ARROW
+\\neg                       <char-0x000AC>               " ¬          : NOT SIGN
+\\neo                       \\neo                        "            : (Incomplete sequence)
+\\neovnwarrow               <char-0x02931>               " ⤱          : NORTH EAST ARROW CROSSING NORTH WEST ARROW
+\\neovsearrow               <char-0x0292E>               " ⤮          : NORTH EAST ARROW CROSSING SOUTH EAST ARROW
+\\nep                       \\nep                        "            : (Incomplete sequence)
+\\neptune                   <char-0x02646>               " ♆          : NEPTUNE
+\\neq                       \\neq                        "            : (Incomplete sequence)
+\\neqsim                    <char-0x02242><char-0x00338> " ≂̸         : MINUS TILDE + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\nequiv                    <char-0x02262>               " ≢          : NOT IDENTICAL TO
+\\neu                       \\neu                        "            : (Incomplete sequence)
+\\neuter                    <char-0x026B2>               " ⚲          : NEUTER
+\\nex                       \\nex                        "            : (Incomplete sequence)
+\\nexists                   <char-0x02204>               " ∄          : THERE DOES NOT EXIST
+\\ng                        <char-0x0014B>               " ŋ          : LATIN SMALL LETTER ENG
+\\ng<Tab>                   <char-0x0014B>               " ŋ          : LATIN SMALL LETTER ENG
+\\nge                       \\nge                        "            : (Incomplete sequence)
+\\ngeq                      <char-0x02271>               " ≱          : NEITHER GREATER-THAN NOR EQUAL TO / NEITHER GREATER THAN NOR EQUAL TO
+\\ngeq<Tab>                 <char-0x02271>               " ≱          : NEITHER GREATER-THAN NOR EQUAL TO / NEITHER GREATER THAN NOR EQUAL TO
+\\ngeqs                     \\ngeqs                      "            : (Incomplete sequence)
+\\ngeqslant                 <char-0x02A7E><char-0x00338> " ⩾̸         : GREATER-THAN OR SLANTED EQUAL TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\ngt                       \\ngt                        "            : (Incomplete sequence)
+\\ngtr                      <char-0x0226F>               " ≯          : NOT GREATER-THAN / NOT GREATER THAN
+\\ngtr<Tab>                 <char-0x0226F>               " ≯          : NOT GREATER-THAN / NOT GREATER THAN
+\\ngtrs                     \\ngtrs                      "            : (Incomplete sequence)
+\\ngtrsim                   <char-0x02275>               " ≵          : NEITHER GREATER-THAN NOR EQUIVALENT TO / NEITHER GREATER THAN NOR EQUIVALENT TO
+\\ni                        <char-0x0220B>               " ∋          : CONTAINS AS MEMBER
+\\ni<Tab>                   <char-0x0220B>               " ∋          : CONTAINS AS MEMBER
+\\nio                       \\nio                        "            : (Incomplete sequence)
+\\niobar                    <char-0x022FE>               " ⋾          : SMALL CONTAINS WITH OVERBAR
+\\nis                       <char-0x022FC>               " ⋼          : SMALL CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
+\\nis<Tab>                  <char-0x022FC>               " ⋼          : SMALL CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
+\\nisd                      <char-0x022FA>               " ⋺          : CONTAINS WITH LONG HORIZONTAL STROKE
+\\nleftarrow                <char-0x0219A>               " ↚          : LEFTWARDS ARROW WITH STROKE / LEFT ARROW WITH STROKE
+\\nleftrightarrow           <char-0x021AE>               " ↮          : LEFT RIGHT ARROW WITH STROKE
+\\nleq                      <char-0x02270>               " ≰          : NEITHER LESS-THAN NOR EQUAL TO / NEITHER LESS THAN NOR EQUAL TO
+\\nleq<Tab>                 <char-0x02270>               " ≰          : NEITHER LESS-THAN NOR EQUAL TO / NEITHER LESS THAN NOR EQUAL TO
+\\nleqs                     \\nleqs                      "            : (Incomplete sequence)
+\\nleqslant                 <char-0x02A7D><char-0x00338> " ⩽̸         : LESS-THAN OR SLANTED EQUAL TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\nless                     <char-0x0226E>               " ≮          : NOT LESS-THAN / NOT LESS THAN
+\\nless<Tab>                <char-0x0226E>               " ≮          : NOT LESS-THAN / NOT LESS THAN
+\\nlesss                    \\nlesss                     "            : (Incomplete sequence)
+\\nlesssim                  <char-0x02274>               " ≴          : NEITHER LESS-THAN NOR EQUIVALENT TO / NEITHER LESS THAN NOR EQUIVALENT TO
+\\nmid                      <char-0x02224>               " ∤          : DOES NOT DIVIDE
+\\nni                       <char-0x0220C>               " ∌          : DOES NOT CONTAIN AS MEMBER
+\\nolinebreak               <char-0x02060>               " ⁠          : WORD JOINER
+\\not                       <char-0x00338>               " ◌̸         : COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\not<Tab>                  <char-0x00338>               " ◌̸         : COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\notb                      \\notb                       "            : (Incomplete sequence)
+\\notbackslash              <char-0x02340>               " ⍀          : APL FUNCTIONAL SYMBOL BACKSLASH BAR
+\\notg                      \\notg                       "            : (Incomplete sequence)
+\\notgreaterless            <char-0x02279>               " ≹          : NEITHER GREATER-THAN NOR LESS-THAN / NEITHER GREATER THAN NOR LESS THAN
+\\noti                      \\noti                       "            : (Incomplete sequence)
+\\notin                     <char-0x02209>               " ∉          : NOT AN ELEMENT OF
+\\notl                      \\notl                       "            : (Incomplete sequence)
+\\notlessgreater            <char-0x02278>               " ≸          : NEITHER LESS-THAN NOR GREATER-THAN / NEITHER LESS THAN NOR GREATER THAN
+\\nots                      \\nots                       "            : (Incomplete sequence)
+\\notslash                  <char-0x0233F>               " ⌿          : APL FUNCTIONAL SYMBOL SLASH BAR
+\\nparallel                 <char-0x02226>               " ∦          : NOT PARALLEL TO
+\\npolint                   <char-0x02A14>               " ⨔          : LINE INTEGRATION NOT INCLUDING THE POLE
+\\nprec                     <char-0x02280>               " ⊀          : DOES NOT PRECEDE
+\\nprec<Tab>                <char-0x02280>               " ⊀          : DOES NOT PRECEDE
+\\nprecc                    \\nprecc                     "            : (Incomplete sequence)
+\\npreccurlyeq              <char-0x022E0>               " ⋠          : DOES NOT PRECEDE OR EQUAL
+\\nprece                    \\nprece                     "            : (Incomplete sequence)
+\\npreceq                   <char-0x02AAF><char-0x00338> " ⪯̸         : PRECEDES ABOVE SINGLE-LINE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\nprecs                    \\nprecs                     "            : (Incomplete sequence)
+\\nprecsim                  <char-0x0227E><char-0x00338> " ≾̸         : PRECEDES OR EQUIVALENT TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\nrightarrow               <char-0x0219B>               " ↛          : RIGHTWARDS ARROW WITH STROKE / RIGHT ARROW WITH STROKE
+\\nrleg                     <char-0x0019E>               " ƞ          : LATIN SMALL LETTER N WITH LONG RIGHT LEG
+\\nsim                      <char-0x02241>               " ≁          : NOT TILDE
+\\nsim<Tab>                 <char-0x02241>               " ≁          : NOT TILDE
+\\nsime                     <char-0x02244>               " ≄          : NOT ASYMPTOTICALLY EQUAL TO
+\\nsqsubseteq               <char-0x022E2>               " ⋢          : NOT SQUARE IMAGE OF OR EQUAL TO
+\\nsqsupseteq               <char-0x022E3>               " ⋣          : NOT SQUARE ORIGINAL OF OR EQUAL TO
+\\nsubset                   <char-0x02284>               " ⊄          : NOT A SUBSET OF
+\\nsubset<Tab>              <char-0x02284>               " ⊄          : NOT A SUBSET OF
+\\nsubsete                  \\nsubsete                   "            : (Incomplete sequence)
+\\nsubseteq                 <char-0x02288>               " ⊈          : NEITHER A SUBSET OF NOR EQUAL TO
+\\nsubseteq<Tab>            <char-0x02288>               " ⊈          : NEITHER A SUBSET OF NOR EQUAL TO
+\\nsubseteqq                <char-0x02AC5><char-0x00338> " ⫅̸         : SUBSET OF ABOVE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\nsucc                     <char-0x02281>               " ⊁          : DOES NOT SUCCEED
+\\nsucc<Tab>                <char-0x02281>               " ⊁          : DOES NOT SUCCEED
+\\nsuccc                    \\nsuccc                     "            : (Incomplete sequence)
+\\nsucccurlyeq              <char-0x022E1>               " ⋡          : DOES NOT SUCCEED OR EQUAL
+\\nsucce                    \\nsucce                     "            : (Incomplete sequence)
+\\nsucceq                   <char-0x02AB0><char-0x00338> " ⪰̸         : SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\nsuccs                    \\nsuccs                     "            : (Incomplete sequence)
+\\nsuccsim                  <char-0x0227F><char-0x00338> " ≿̸         : SUCCEEDS OR EQUIVALENT TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\nsupset                   <char-0x02285>               " ⊅          : NOT A SUPERSET OF
+\\nsupset<Tab>              <char-0x02285>               " ⊅          : NOT A SUPERSET OF
+\\nsupsete                  \\nsupsete                   "            : (Incomplete sequence)
+\\nsupseteq                 <char-0x02289>               " ⊉          : NEITHER A SUPERSET OF NOR EQUAL TO
+\\nsupseteq<Tab>            <char-0x02289>               " ⊉          : NEITHER A SUPERSET OF NOR EQUAL TO
+\\nsupseteqq                <char-0x02AC6><char-0x00338> " ⫆̸         : SUPERSET OF ABOVE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
+\\ntriangleleft             <char-0x022EA>               " ⋪          : NOT NORMAL SUBGROUP OF
+\\ntriangleleft<Tab>        <char-0x022EA>               " ⋪          : NOT NORMAL SUBGROUP OF
+\\ntrianglelefte            \\ntrianglelefte             "            : (Incomplete sequence)
+\\ntrianglelefteq           <char-0x022EC>               " ⋬          : NOT NORMAL SUBGROUP OF OR EQUAL TO
+\\ntriangleright            <char-0x022EB>               " ⋫          : DOES NOT CONTAIN AS NORMAL SUBGROUP
+\\ntriangleright<Tab>       <char-0x022EB>               " ⋫          : DOES NOT CONTAIN AS NORMAL SUBGROUP
+\\ntrianglerighte           \\ntrianglerighte            "            : (Incomplete sequence)
+\\ntrianglerighteq          <char-0x022ED>               " ⋭          : DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL
+\\nu                        <char-0x003BD>               " ν          : GREEK SMALL LETTER NU
+\\nu<Tab>                   <char-0x003BD>               " ν          : GREEK SMALL LETTER NU
+\\num                       \\num                        "            : (Incomplete sequence)
+\\numero                    <char-0x02116>               " №          : NUMERO SIGN / NUMERO
+\\nvDash                    <char-0x022AD>               " ⊭          : NOT TRUE
+\\nvLeftarrow               <char-0x02902>               " ⤂          : LEFTWARDS DOUBLE ARROW WITH VERTICAL STROKE
+\\nvLeftrightarrow          <char-0x02904>               " ⤄          : LEFT RIGHT DOUBLE ARROW WITH VERTICAL STROKE
+\\nvRightarrow              <char-0x02903>               " ⤃          : RIGHTWARDS DOUBLE ARROW WITH VERTICAL STROKE
+\\nvdash                    <char-0x022AC>               " ⊬          : DOES NOT PROVE
+\\nvleftarrow               <char-0x021F7>               " ⇷          : LEFTWARDS ARROW WITH VERTICAL STROKE
+\\nvleftarrow<Tab>          <char-0x021F7>               " ⇷          : LEFTWARDS ARROW WITH VERTICAL STROKE
+\\nvleftarrowt              \\nvleftarrowt               "            : (Incomplete sequence)
+\\nvleftarrowtail           <char-0x02B39>               " ⬹          : LEFTWARDS ARROW WITH TAIL WITH VERTICAL STROKE
+\\nvleftrightarrow          <char-0x021F9>               " ⇹          : LEFT RIGHT ARROW WITH VERTICAL STROKE
+\\nvrightarrow              <char-0x021F8>               " ⇸          : RIGHTWARDS ARROW WITH VERTICAL STROKE
+\\nvrightarrow<Tab>         <char-0x021F8>               " ⇸          : RIGHTWARDS ARROW WITH VERTICAL STROKE
+\\nvrightarrowt             \\nvrightarrowt              "            : (Incomplete sequence)
+\\nvrightarrowtail          <char-0x02914>               " ⤔          : RIGHTWARDS ARROW WITH TAIL WITH VERTICAL STROKE
+\\nvtwoheadleftarrow        <char-0x02B34>               " ⬴          : LEFTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE
+\\nvtwoheadleftarrow<Tab>   <char-0x02B34>               " ⬴          : LEFTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE
+\\nvtwoheadleftarrowt       \\nvtwoheadleftarrowt        "            : (Incomplete sequence)
+\\nvtwoheadleftarrowtail    <char-0x02B3C>               " ⬼          : LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH VERTICAL STROKE
+\\nvtwoheadrightarrow       <char-0x02900>               " ⤀          : RIGHTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE
+\\nvtwoheadrightarrow<Tab>  <char-0x02900>               " ⤀          : RIGHTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE
+\\nvtwoheadrightarrowt      \\nvtwoheadrightarrowt       "            : (Incomplete sequence)
+\\nvtwoheadrightarrowtail   <char-0x02917>               " ⤗          : RIGHTWARDS TWO-HEADED ARROW WITH TAIL WITH VERTICAL STROKE
+\\nwarrow                   <char-0x02196>               " ↖          : NORTH WEST ARROW / UPPER LEFT ARROW
+\\nwovnearrow               <char-0x02932>               " ⤲          : NORTH WEST ARROW CROSSING NORTH EAST ARROW
+\\o                         <char-0x000F8>               " ø          : LATIN SMALL LETTER O WITH STROKE / LATIN SMALL LETTER O SLASH
+\\o<Tab>                    <char-0x000F8>               " ø          : LATIN SMALL LETTER O WITH STROKE / LATIN SMALL LETTER O SLASH
+\\ob                        \\ob                         "            : (Incomplete sequence)
+\\obar                      <char-0x0233D>               " ⌽          : APL FUNCTIONAL SYMBOL CIRCLE STILE
+\\obslash                   <char-0x029B8>               " ⦸          : CIRCLED REVERSE SOLIDUS
+\\oc                        \\oc                         "            : (Incomplete sequence)
+\\ocirc                     <char-0x0030A>               " ◌̊         : COMBINING RING ABOVE / NON-SPACING RING ABOVE
+\\ocommatopright            <char-0x00315>               " ◌̕         : COMBINING COMMA ABOVE RIGHT / NON-SPACING COMMA ABOVE RIGHT
+\\od                        \\od                         "            : (Incomplete sequence)
+\\odiv                      <char-0x02A38>               " ⨸          : CIRCLED DIVISION SIGN
+\\odot                      <char-0x02299>               " ⊙          : CIRCLED DOT OPERATOR
+\\odot<Tab>                 <char-0x02299>               " ⊙          : CIRCLED DOT OPERATOR
+\\odots                     \\odots                      "            : (Incomplete sequence)
+\\odotslashdot              <char-0x029BC>               " ⦼          : CIRCLED ANTICLOCKWISE-ROTATED DIVISION SIGN
+\\oe                        <char-0x00153>               " œ          : LATIN SMALL LIGATURE OE / LATIN SMALL LETTER O E
+\\og                        \\og                         "            : (Incomplete sequence)
+\\ogreaterthan              <char-0x029C1>               " ⧁          : CIRCLED GREATER-THAN
+\\oh                        \\oh                         "            : (Incomplete sequence)
+\\ohm                       <char-0x02126>               " Ω          : OHM SIGN / OHM
+\\oi                        \\oi                         "            : (Incomplete sequence)
+\\oiiint                    <char-0x02230>               " ∰          : VOLUME INTEGRAL
+\\oiint                     <char-0x0222F>               " ∯          : SURFACE INTEGRAL
+\\oint                      <char-0x0222E>               " ∮          : CONTOUR INTEGRAL
+\\oint<Tab>                 <char-0x0222E>               " ∮          : CONTOUR INTEGRAL
+\\ointc                     \\ointc                      "            : (Incomplete sequence)
+\\ointctrclockwise          <char-0x02233>               " ∳          : ANTICLOCKWISE CONTOUR INTEGRAL
+\\ol                        \\ol                         "            : (Incomplete sequence)
+\\olessthan                 <char-0x029C0>               " ⧀          : CIRCLED LESS-THAN
+\\om                        \\om                         "            : (Incomplete sequence)
+\\omega                     <char-0x003C9>               " ω          : GREEK SMALL LETTER OMEGA
+\\ominus                    <char-0x02296>               " ⊖          : CIRCLED MINUS
+\\op                        \\op                         "            : (Incomplete sequence)
+\\openbracketleft           <char-0x027E6>               " ⟦          : MATHEMATICAL LEFT WHITE SQUARE BRACKET
+\\openbracketright          <char-0x027E7>               " ⟧          : MATHEMATICAL RIGHT WHITE SQUARE BRACKET
+\\openo                     <char-0x00254>               " ɔ          : LATIN SMALL LETTER OPEN O
+\\oplus                     <char-0x02295>               " ⊕          : CIRCLED PLUS
+\\oplus<Tab>                <char-0x02295>               " ⊕          : CIRCLED PLUS
+\\oplusl                    \\oplusl                     "            : (Incomplete sequence)
+\\opluslhrim                <char-0x02A2D>               " ⨭          : PLUS SIGN IN LEFT HALF CIRCLE
+\\oplusr                    \\oplusr                     "            : (Incomplete sequence)
+\\oplusrhrim                <char-0x02A2E>               " ⨮          : PLUS SIGN IN RIGHT HALF CIRCLE
+\\or                        \\or                         "            : (Incomplete sequence)
+\\ordfeminine               <char-0x000AA>               " ª          : FEMININE ORDINAL INDICATOR
+\\ordmasculine              <char-0x000BA>               " º          : MASCULINE ORDINAL INDICATOR
+\\original                  <char-0x022B6>               " ⊶          : ORIGINAL OF
+\\os                        \\os                         "            : (Incomplete sequence)
+\\oslash                    <char-0x02298>               " ⊘          : CIRCLED DIVISION SLASH
+\\ot                        \\ot                         "            : (Incomplete sequence)
+\\otimes                    <char-0x02297>               " ⊗          : CIRCLED TIMES
+\\otimes<Tab>               <char-0x02297>               " ⊗          : CIRCLED TIMES
+\\otimesh                   \\otimesh                    "            : (Incomplete sequence)
+\\otimeshat                 <char-0x02A36>               " ⨶          : CIRCLED MULTIPLICATION SIGN WITH CIRCUMFLEX ACCENT
+\\otimesl                   \\otimesl                    "            : (Incomplete sequence)
+\\otimeslhrim               <char-0x02A34>               " ⨴          : MULTIPLICATION SIGN IN LEFT HALF CIRCLE
+\\otimesr                   \\otimesr                    "            : (Incomplete sequence)
+\\otimesrhrim               <char-0x02A35>               " ⨵          : MULTIPLICATION SIGN IN RIGHT HALF CIRCLE
+\\oturnedcomma              <char-0x00312>               " ◌̒         : COMBINING TURNED COMMA ABOVE / NON-SPACING TURNED COMMA ABOVE
+\\ov                        \\ov                         "            : (Incomplete sequence)
+\\overbar                   <char-0x00305>               " ◌̅         : COMBINING OVERLINE / NON-SPACING OVERSCORE
+\\overbrace                 <char-0x023DE>               " ⏞          : TOP CURLY BRACKET
+\\overbracket               <char-0x023B4>               " ⎴          : TOP SQUARE BRACKET
+\\overleftarrow             <char-0x020D6>               " ◌⃖         : COMBINING LEFT ARROW ABOVE / NON-SPACING LEFT ARROW ABOVE
+\\overleftrightarrow        <char-0x020E1>               " ◌⃡         : COMBINING LEFT RIGHT ARROW ABOVE / NON-SPACING LEFT RIGHT ARROW ABOVE
+\\ovhook                    <char-0x00309>               " ◌̉         : COMBINING HOOK ABOVE / NON-SPACING HOOK ABOVE
+\\palh                      <char-0x00321>               " ◌̡         : COMBINING PALATALIZED HOOK BELOW / NON-SPACING PALATALIZED HOOK BELOW
+\\parallel                  <char-0x02225>               " ∥          : PARALLEL TO
+\\parallel<Tab>             <char-0x02225>               " ∥          : PARALLEL TO
+\\parallelo                 \\parallelo                  "            : (Incomplete sequence)
+\\parallelogram             <char-0x025B1>               " ▱          : WHITE PARALLELOGRAM
+\\parallelogram<Tab>        <char-0x025B1>               " ▱          : WHITE PARALLELOGRAM
+\\parallelogramb            \\parallelogramb             "            : (Incomplete sequence)
+\\parallelogramblack        <char-0x025B0>               " ▰          : BLACK PARALLELOGRAM
+\\partial                   <char-0x02202>               " ∂          : PARTIAL DIFFERENTIAL
+\\partial<Tab>              <char-0x02202>               " ∂          : PARTIAL DIFFERENTIAL
+\\partialm                  \\partialm                   "            : (Incomplete sequence)
+\\partialmeetcontraction    <char-0x02AA3>               " ⪣          : DOUBLE NESTED LESS-THAN WITH UNDERBAR
+\\pbgam                     <char-0x00264>               " ɤ          : LATIN SMALL LETTER RAMS HORN / LATIN SMALL LETTER BABY GAMMA
+\\pentagon                  <char-0x02B20>               " ⬠          : WHITE PENTAGON
+\\pentagon<Tab>             <char-0x02B20>               " ⬠          : WHITE PENTAGON
+\\pentagonb                 \\pentagonb                  "            : (Incomplete sequence)
+\\pentagonblack             <char-0x02B1F>               " ⬟          : BLACK PENTAGON
+\\perp                      <char-0x027C2>               " ⟂          : PERPENDICULAR
+\\perspcorrespond           <char-0x02A5E>               " ⩞          : LOGICAL AND WITH DOUBLE OVERBAR
+\\pertenthousand            <char-0x02031>               " ‱          : PER TEN THOUSAND SIGN
+\\perthousand               <char-0x02030>               " ‰          : PER MILLE SIGN
+\\pes                       <char-0x020A7>               " ₧          : PESETA SIGN
+\\pgamma                    <char-0x00263>               " ɣ          : LATIN SMALL LETTER GAMMA
+\\phi                       <char-0x003D5>               " ϕ          : GREEK PHI SYMBOL / GREEK SMALL LETTER SCRIPT PHI
+\\pi                        <char-0x003C0>               " π          : GREEK SMALL LETTER PI
+\\pi<Tab>                   <char-0x003C0>               " π          : GREEK SMALL LETTER PI
+\\pis                       \\pis                        "            : (Incomplete sequence)
+\\pisces                    <char-0x02653>               " ♓          : PISCES
+\\pit                       \\pit                        "            : (Incomplete sequence)
+\\pitchfork                 <char-0x022D4>               " ⋔          : PITCHFORK
+\\planck                    <char-0x0210E>               " ℎ          : PLANCK CONSTANT
+\\plusdot                   <char-0x02A25>               " ⨥          : PLUS SIGN WITH DOT BELOW
+\\pluseqq                   <char-0x02A72>               " ⩲          : PLUS SIGN ABOVE EQUALS SIGN
+\\plushat                   <char-0x02A23>               " ⨣          : PLUS SIGN WITH CIRCUMFLEX ACCENT ABOVE
+\\plussim                   <char-0x02A26>               " ⨦          : PLUS SIGN WITH TILDE BELOW
+\\plussubtwo                <char-0x02A27>               " ⨧          : PLUS SIGN WITH SUBSCRIPT TWO
+\\plustrif                  <char-0x02A28>               " ⨨          : PLUS SIGN WITH BLACK TRIANGLE
+\\pluto                     <char-0x02647>               " ♇          : PLUTO
+\\pm                        <char-0x000B1>               " ±          : PLUS-MINUS SIGN / PLUS-OR-MINUS SIGN
+\\pointint                  <char-0x02A15>               " ⨕          : INTEGRAL AROUND A POINT OPERATOR
+\\postalmark                <char-0x03012>               " 〒          : POSTAL MARK
+\\pppprime                  <char-0x02057>               " ⁗          : QUADRUPLE PRIME
+\\ppprime                   <char-0x02034>               " ‴          : TRIPLE PRIME
+\\pprime                    <char-0x02033>               " ″          : DOUBLE PRIME
+\\prec                      <char-0x0227A>               " ≺          : PRECEDES
+\\prec<Tab>                 <char-0x0227A>               " ≺          : PRECEDES
+\\preca                     \\preca                      "            : (Incomplete sequence)
+\\precapprox                <char-0x02AB7>               " ⪷          : PRECEDES ABOVE ALMOST EQUAL TO
+\\precc                     \\precc                      "            : (Incomplete sequence)
+\\preccurlyeq               <char-0x0227C>               " ≼          : PRECEDES OR EQUAL TO
+\\prece                     \\prece                      "            : (Incomplete sequence)
+\\preceq                    <char-0x02AAF>               " ⪯          : PRECEDES ABOVE SINGLE-LINE EQUALS SIGN
+\\preceq<Tab>               <char-0x02AAF>               " ⪯          : PRECEDES ABOVE SINGLE-LINE EQUALS SIGN
+\\preceqq                   <char-0x02AB3>               " ⪳          : PRECEDES ABOVE EQUALS SIGN
+\\precn                     \\precn                      "            : (Incomplete sequence)
+\\precnapprox               <char-0x02AB9>               " ⪹          : PRECEDES ABOVE NOT ALMOST EQUAL TO
+\\precneq                   <char-0x02AB1>               " ⪱          : PRECEDES ABOVE SINGLE-LINE NOT EQUAL TO
+\\precneq<Tab>              <char-0x02AB1>               " ⪱          : PRECEDES ABOVE SINGLE-LINE NOT EQUAL TO
+\\precneqq                  <char-0x02AB5>               " ⪵          : PRECEDES ABOVE NOT EQUAL TO
+\\precnsim                  <char-0x022E8>               " ⋨          : PRECEDES BUT NOT EQUIVALENT TO
+\\precs                     \\precs                      "            : (Incomplete sequence)
+\\precsim                   <char-0x0227E>               " ≾          : PRECEDES OR EQUIVALENT TO
+\\prime                     <char-0x02032>               " ′          : PRIME
+\\prod                      <char-0x0220F>               " ∏          : N-ARY PRODUCT
+\\profline                  <char-0x02312>               " ⌒          : ARC
+\\profsurf                  <char-0x02313>               " ⌓          : SEGMENT
+\\propto                    <char-0x0221D>               " ∝          : PROPORTIONAL TO
+\\prurel                    <char-0x022B0>               " ⊰          : PRECEDES UNDER RELATION
+\\pscrv                     <char-0x0028B>               " ʋ          : LATIN SMALL LETTER V WITH HOOK / LATIN SMALL LETTER SCRIPT V
+\\psi                       <char-0x003C8>               " ψ          : GREEK SMALL LETTER PSI
+\\pupsil                    <char-0x0028A>               " ʊ          : LATIN SMALL LETTER UPSILON
+\\quad                      <char-0x02003>               "            : EM SPACE
+\\quarternote               <char-0x02669>               " ♩          : QUARTER NOTE
+\\questeq                   <char-0x0225F>               " ≟          : QUESTIONED EQUAL TO
+\\questiondown              <char-0x000BF>               " ¿          : INVERTED QUESTION MARK
+\\rLarr                     <char-0x02944>               " ⥄          : SHORT RIGHTWARDS ARROW ABOVE LEFTWARDS ARROW
+\\rais                      <char-0x002D4>               " ˔          : MODIFIER LETTER UP TACK
+\\rangle                    <char-0x027E9>               " ⟩          : MATHEMATICAL RIGHT ANGLE BRACKET
+\\rarrx                     <char-0x02947>               " ⥇          : RIGHTWARDS ARROW THROUGH X
+\\rasp                      <char-0x002BC>               " ʼ          : MODIFIER LETTER APOSTROPHE
+\\rceil                     <char-0x02309>               " ⌉          : RIGHT CEILING
+\\rdiagovfdiag              <char-0x0292B>               " ⤫          : RISING DIAGONAL CROSSING FALLING DIAGONAL
+\\rdiagovsearrow            <char-0x02930>               " ⤰          : RISING DIAGONAL CROSSING SOUTH EAST ARROW
+\\rdq                       <char-0x0201D>               " ”          : RIGHT DOUBLE QUOTATION MARK / DOUBLE COMMA QUOTATION MARK
+\\reapos                    <char-0x0201B>               " ‛          : SINGLE HIGH-REVERSED-9 QUOTATION MARK / SINGLE REVERSED COMMA QUOTATION MARK
+\\recorder                  <char-0x02315>               " ⌕          : TELEPHONE RECORDER
+\\reglst                    <char-0x00295>               " ʕ          : LATIN LETTER PHARYNGEAL VOICED FRICATIVE / LATIN LETTER REVERSED GLOTTAL STOP
+\\revangle                  <char-0x029A3>               " ⦣          : REVERSED ANGLE
+\\revangle<Tab>             <char-0x029A3>               " ⦣          : REVERSED ANGLE
+\\revangleu                 \\revangleu                  "            : (Incomplete sequence)
+\\revangleubar              <char-0x029A5>               " ⦥          : REVERSED ANGLE WITH UNDERBAR
+\\revemptyset               <char-0x029B0>               " ⦰          : REVERSED EMPTY SET
+\\rfloor                    <char-0x0230B>               " ⌋          : RIGHT FLOOR
+\\rh                        <char-0x00322>               " ◌̢         : COMBINING RETROFLEX HOOK BELOW / NON-SPACING RETROFLEX HOOK BELOW
+\\rh<Tab>                   <char-0x00322>               " ◌̢         : COMBINING RETROFLEX HOOK BELOW / NON-SPACING RETROFLEX HOOK BELOW
+\\rho                       <char-0x003C1>               " ρ          : GREEK SMALL LETTER RHO
+\\rightangle                <char-0x0221F>               " ∟          : RIGHT ANGLE
+\\rightangle<Tab>           <char-0x0221F>               " ∟          : RIGHT ANGLE
+\\rightanglea               \\rightanglea                "            : (Incomplete sequence)
+\\rightanglearc             <char-0x022BE>               " ⊾          : RIGHT ANGLE WITH ARC
+\\rightanglem               \\rightanglem                "            : (Incomplete sequence)
+\\rightanglemdot            <char-0x0299D>               " ⦝          : MEASURED RIGHT ANGLE WITH DOT
+\\rightarrow                <char-0x02192>               " →          : RIGHTWARDS ARROW / RIGHT ARROW
+\\rightarrow<Tab>           <char-0x02192>               " →          : RIGHTWARDS ARROW / RIGHT ARROW
+\\rightarrowb               \\rightarrowb                "            : (Incomplete sequence)
+\\rightarrowbackapprox      <char-0x02B48>               " ⭈          : RIGHTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO
+\\rightarrowbar             <char-0x021E5>               " ⇥          : RIGHTWARDS ARROW TO BAR / RIGHT ARROW TO BAR
+\\rightarrowbsimilar        <char-0x02B4C>               " ⭌          : RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR
+\\rightarrowd               \\rightarrowd                "            : (Incomplete sequence)
+\\rightarrowdiamond         <char-0x0291E>               " ⤞          : RIGHTWARDS ARROW TO BLACK DIAMOND
+\\rightarrowg               \\rightarrowg                "            : (Incomplete sequence)
+\\rightarrowgtr             <char-0x02B43>               " ⭃          : RIGHTWARDS ARROW THROUGH GREATER-THAN
+\\rightarrowp               \\rightarrowp                "            : (Incomplete sequence)
+\\rightarrowplus            <char-0x02945>               " ⥅          : RIGHTWARDS ARROW WITH PLUS BELOW
+\\rightarrows               \\rightarrows                "            : (Incomplete sequence)
+\\rightarrowsupset          <char-0x02B44>               " ⭄          : RIGHTWARDS ARROW THROUGH SUPERSET
+\\rightarrowt               \\rightarrowt                "            : (Incomplete sequence)
+\\rightarrowtail            <char-0x021A3>               " ↣          : RIGHTWARDS ARROW WITH TAIL / RIGHT ARROW WITH TAIL
+\\rightarrowtriangle        <char-0x021FE>               " ⇾          : RIGHTWARDS OPEN-HEADED ARROW
+\\rightdasharrow            <char-0x021E2>               " ⇢          : RIGHTWARDS DASHED ARROW / RIGHT DASHED ARROW
+\\rightdotarrow             <char-0x02911>               " ⤑          : RIGHTWARDS ARROW WITH DOTTED STEM
+\\rightharpoonaccent        <char-0x020D1>               " ◌⃑         : COMBINING RIGHT HARPOON ABOVE / NON-SPACING RIGHT HARPOON ABOVE
+\\rightharpoondown          <char-0x021C1>               " ⇁          : RIGHTWARDS HARPOON WITH BARB DOWNWARDS / RIGHT HARPOON WITH BARB DOWN
+\\rightharpoonsupdown       <char-0x02964>               " ⥤          : RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN
+\\rightharpoonup            <char-0x021C0>               " ⇀          : RIGHTWARDS HARPOON WITH BARB UPWARDS / RIGHT HARPOON WITH BARB UP
+\\rightharpoonup<Tab>       <char-0x021C0>               " ⇀          : RIGHTWARDS HARPOON WITH BARB UPWARDS / RIGHT HARPOON WITH BARB UP
+\\rightharpoonupd           \\rightharpoonupd            "            : (Incomplete sequence)
+\\rightharpoonupdash        <char-0x0296C>               " ⥬          : RIGHTWARDS HARPOON WITH BARB UP ABOVE LONG DASH
+\\rightleftarrows           <char-0x021C4>               " ⇄          : RIGHTWARDS ARROW OVER LEFTWARDS ARROW / RIGHT ARROW OVER LEFT ARROW
+\\rightleftharpoons         <char-0x021CC>               " ⇌          : RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON / RIGHT HARPOON OVER LEFT HARPOON
+\\rightleftharpoons<Tab>    <char-0x021CC>               " ⇌          : RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON / RIGHT HARPOON OVER LEFT HARPOON
+\\rightleftharpoonsd        \\rightleftharpoonsd         "            : (Incomplete sequence)
+\\rightleftharpoonsdown     <char-0x02969>               " ⥩          : RIGHTWARDS HARPOON WITH BARB DOWN ABOVE LEFTWARDS HARPOON WITH BARB DOWN
+\\rightleftharpoonsu        \\rightleftharpoonsu         "            : (Incomplete sequence)
+\\rightleftharpoonsup       <char-0x02968>               " ⥨          : RIGHTWARDS HARPOON WITH BARB UP ABOVE LEFTWARDS HARPOON WITH BARB UP
+\\rightmoon                 <char-0x0263D>               " ☽          : FIRST QUARTER MOON
+\\rightouterjoin            <char-0x027D6>               " ⟖          : RIGHT OUTER JOIN
+\\rightpentagon             <char-0x02B54>               " ⭔          : WHITE RIGHT-POINTING PENTAGON
+\\rightpentagon<Tab>        <char-0x02B54>               " ⭔          : WHITE RIGHT-POINTING PENTAGON
+\\rightpentagonb            \\rightpentagonb             "            : (Incomplete sequence)
+\\rightpentagonblack        <char-0x02B53>               " ⭓          : BLACK RIGHT-POINTING PENTAGON
+\\rightrightarrows          <char-0x021C9>               " ⇉          : RIGHTWARDS PAIRED ARROWS / RIGHT PAIRED ARROWS
+\\rightsquigarrow           <char-0x021DD>               " ⇝          : RIGHTWARDS SQUIGGLE ARROW / RIGHT SQUIGGLE ARROW
+\\rightthreearrows          <char-0x021F6>               " ⇶          : THREE RIGHTWARDS ARROWS
+\\rightthreetimes           <char-0x022CC>               " ⋌          : RIGHT SEMIDIRECT PRODUCT
+\\rightwavearrow            <char-0x0219D>               " ↝          : RIGHTWARDS WAVE ARROW / RIGHT WAVE ARROW
+\\rightwhitearrow           <char-0x021E8>               " ⇨          : RIGHTWARDS WHITE ARROW / WHITE RIGHT ARROW
+\\ringplus                  <char-0x02A22>               " ⨢          : PLUS SIGN WITH SMALL CIRCLE ABOVE
+\\risingdotseq              <char-0x02253>               " ≓          : IMAGE OF OR APPROXIMATELY EQUAL TO
+\\rl                        <char-0x0027C>               " ɼ          : LATIN SMALL LETTER R WITH LONG LEG
+\\rmoustache                <char-0x023B1>               " ⎱          : UPPER RIGHT OR LOWER LEFT CURLY BRACKET SECTION
+\\rppolint                  <char-0x02A12>               " ⨒          : LINE INTEGRATION WITH RECTANGULAR PATH AROUND POLE
+\\rq                        <char-0x02019>               " ’          : RIGHT SINGLE QUOTATION MARK / SINGLE COMMA QUOTATION MARK
+\\rrbracket                 <char-0x027E7>               " ⟧          : MATHEMATICAL RIGHT WHITE SQUARE BRACKET
+\\rsolbar                   <char-0x029F7>               " ⧷          : REVERSE SOLIDUS WITH HORIZONTAL STROKE
+\\rsqhook                   <char-0x02ACE>               " ⫎          : SQUARE RIGHT OPEN BOX OPERATOR
+\\rtimes                    <char-0x022CA>               " ⋊          : RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT
+\\rtld                      <char-0x00256>               " ɖ          : LATIN SMALL LETTER D WITH TAIL / LATIN SMALL LETTER D RETROFLEX HOOK
+\\rtll                      <char-0x0026D>               " ɭ          : LATIN SMALL LETTER L WITH RETROFLEX HOOK / LATIN SMALL LETTER L RETROFLEX HOOK
+\\rtln                      <char-0x00273>               " ɳ          : LATIN SMALL LETTER N WITH RETROFLEX HOOK / LATIN SMALL LETTER N RETROFLEX HOOK
+\\rtlr                      <char-0x0027D>               " ɽ          : LATIN SMALL LETTER R WITH TAIL / LATIN SMALL LETTER R HOOK
+\\rtls                      <char-0x00282>               " ʂ          : LATIN SMALL LETTER S WITH HOOK / LATIN SMALL LETTER S HOOK
+\\rtlt                      <char-0x00288>               " ʈ          : LATIN SMALL LETTER T WITH RETROFLEX HOOK / LATIN SMALL LETTER T RETROFLEX HOOK
+\\rtlz                      <char-0x00290>               " ʐ          : LATIN SMALL LETTER Z WITH RETROFLEX HOOK / LATIN SMALL LETTER Z RETROFLEX HOOK
+\\rttrnr                    <char-0x0027B>               " ɻ          : LATIN SMALL LETTER TURNED R WITH HOOK / LATIN SMALL LETTER TURNED R HOOK
+\\rvboxline                 <char-0x023B9>               " ⎹          : RIGHT VERTICAL BOX LINE
+\\rvbull                    <char-0x025D8>               " ◘          : INVERSE BULLET
+\\sagittarius               <char-0x02650>               " ♐          : SAGITTARIUS
+\\sansA                     <char-0x1D5A0>               " 𝖠          : MATHEMATICAL SANS-SERIF CAPITAL A
+\\sansB                     <char-0x1D5A1>               " 𝖡          : MATHEMATICAL SANS-SERIF CAPITAL B
+\\sansC                     <char-0x1D5A2>               " 𝖢          : MATHEMATICAL SANS-SERIF CAPITAL C
+\\sansD                     <char-0x1D5A3>               " 𝖣          : MATHEMATICAL SANS-SERIF CAPITAL D
+\\sansE                     <char-0x1D5A4>               " 𝖤          : MATHEMATICAL SANS-SERIF CAPITAL E
+\\sansF                     <char-0x1D5A5>               " 𝖥          : MATHEMATICAL SANS-SERIF CAPITAL F
+\\sansG                     <char-0x1D5A6>               " 𝖦          : MATHEMATICAL SANS-SERIF CAPITAL G
+\\sansH                     <char-0x1D5A7>               " 𝖧          : MATHEMATICAL SANS-SERIF CAPITAL H
+\\sansI                     <char-0x1D5A8>               " 𝖨          : MATHEMATICAL SANS-SERIF CAPITAL I
+\\sansJ                     <char-0x1D5A9>               " 𝖩          : MATHEMATICAL SANS-SERIF CAPITAL J
+\\sansK                     <char-0x1D5AA>               " 𝖪          : MATHEMATICAL SANS-SERIF CAPITAL K
+\\sansL                     <char-0x1D5AB>               " 𝖫          : MATHEMATICAL SANS-SERIF CAPITAL L
+\\sansL<Tab>                <char-0x1D5AB>               " 𝖫          : MATHEMATICAL SANS-SERIF CAPITAL L
+\\sansLm                    \\sansLm                     "            : (Incomplete sequence)
+\\sansLmirrored             <char-0x02143>               " ⅃          : REVERSED SANS-SERIF CAPITAL L
+\\sansLt                    \\sansLt                     "            : (Incomplete sequence)
+\\sansLturned               <char-0x02142>               " ⅂          : TURNED SANS-SERIF CAPITAL L
+\\sansM                     <char-0x1D5AC>               " 𝖬          : MATHEMATICAL SANS-SERIF CAPITAL M
+\\sansN                     <char-0x1D5AD>               " 𝖭          : MATHEMATICAL SANS-SERIF CAPITAL N
+\\sansO                     <char-0x1D5AE>               " 𝖮          : MATHEMATICAL SANS-SERIF CAPITAL O
+\\sansP                     <char-0x1D5AF>               " 𝖯          : MATHEMATICAL SANS-SERIF CAPITAL P
+\\sansQ                     <char-0x1D5B0>               " 𝖰          : MATHEMATICAL SANS-SERIF CAPITAL Q
+\\sansR                     <char-0x1D5B1>               " 𝖱          : MATHEMATICAL SANS-SERIF CAPITAL R
+\\sansS                     <char-0x1D5B2>               " 𝖲          : MATHEMATICAL SANS-SERIF CAPITAL S
+\\sansT                     <char-0x1D5B3>               " 𝖳          : MATHEMATICAL SANS-SERIF CAPITAL T
+\\sansU                     <char-0x1D5B4>               " 𝖴          : MATHEMATICAL SANS-SERIF CAPITAL U
+\\sansV                     <char-0x1D5B5>               " 𝖵          : MATHEMATICAL SANS-SERIF CAPITAL V
+\\sansW                     <char-0x1D5B6>               " 𝖶          : MATHEMATICAL SANS-SERIF CAPITAL W
+\\sansX                     <char-0x1D5B7>               " 𝖷          : MATHEMATICAL SANS-SERIF CAPITAL X
+\\sansY                     <char-0x1D5B8>               " 𝖸          : MATHEMATICAL SANS-SERIF CAPITAL Y
+\\sansZ                     <char-0x1D5B9>               " 𝖹          : MATHEMATICAL SANS-SERIF CAPITAL Z
+\\sansa                     <char-0x1D5BA>               " 𝖺          : MATHEMATICAL SANS-SERIF SMALL A
+\\sansb                     <char-0x1D5BB>               " 𝖻          : MATHEMATICAL SANS-SERIF SMALL B
+\\sansc                     <char-0x1D5BC>               " 𝖼          : MATHEMATICAL SANS-SERIF SMALL C
+\\sansd                     <char-0x1D5BD>               " 𝖽          : MATHEMATICAL SANS-SERIF SMALL D
+\\sanse                     <char-0x1D5BE>               " 𝖾          : MATHEMATICAL SANS-SERIF SMALL E
+\\sanse<Tab>                <char-0x1D5BE>               " 𝖾          : MATHEMATICAL SANS-SERIF SMALL E
+\\sansei                    \\sansei                     "            : (Incomplete sequence)
+\\sanseight                 <char-0x1D7EA>               " 𝟪          : MATHEMATICAL SANS-SERIF DIGIT EIGHT
+\\sansf                     <char-0x1D5BF>               " 𝖿          : MATHEMATICAL SANS-SERIF SMALL F
+\\sansf<Tab>                <char-0x1D5BF>               " 𝖿          : MATHEMATICAL SANS-SERIF SMALL F
+\\sansfi                    \\sansfi                     "            : (Incomplete sequence)
+\\sansfive                  <char-0x1D7E7>               " 𝟧          : MATHEMATICAL SANS-SERIF DIGIT FIVE
+\\sansfo                    \\sansfo                     "            : (Incomplete sequence)
+\\sansfour                  <char-0x1D7E6>               " 𝟦          : MATHEMATICAL SANS-SERIF DIGIT FOUR
+\\sansg                     <char-0x1D5C0>               " 𝗀          : MATHEMATICAL SANS-SERIF SMALL G
+\\sansh                     <char-0x1D5C1>               " 𝗁          : MATHEMATICAL SANS-SERIF SMALL H
+\\sansi                     <char-0x1D5C2>               " 𝗂          : MATHEMATICAL SANS-SERIF SMALL I
+\\sansj                     <char-0x1D5C3>               " 𝗃          : MATHEMATICAL SANS-SERIF SMALL J
+\\sansk                     <char-0x1D5C4>               " 𝗄          : MATHEMATICAL SANS-SERIF SMALL K
+\\sansl                     <char-0x1D5C5>               " 𝗅          : MATHEMATICAL SANS-SERIF SMALL L
+\\sansm                     <char-0x1D5C6>               " 𝗆          : MATHEMATICAL SANS-SERIF SMALL M
+\\sansn                     <char-0x1D5C7>               " 𝗇          : MATHEMATICAL SANS-SERIF SMALL N
+\\sansn<Tab>                <char-0x1D5C7>               " 𝗇          : MATHEMATICAL SANS-SERIF SMALL N
+\\sansni                    \\sansni                     "            : (Incomplete sequence)
+\\sansnine                  <char-0x1D7EB>               " 𝟫          : MATHEMATICAL SANS-SERIF DIGIT NINE
+\\sanso                     <char-0x1D5C8>               " 𝗈          : MATHEMATICAL SANS-SERIF SMALL O
+\\sanso<Tab>                <char-0x1D5C8>               " 𝗈          : MATHEMATICAL SANS-SERIF SMALL O
+\\sanson                    \\sanson                     "            : (Incomplete sequence)
+\\sansone                   <char-0x1D7E3>               " 𝟣          : MATHEMATICAL SANS-SERIF DIGIT ONE
+\\sansp                     <char-0x1D5C9>               " 𝗉          : MATHEMATICAL SANS-SERIF SMALL P
+\\sansq                     <char-0x1D5CA>               " 𝗊          : MATHEMATICAL SANS-SERIF SMALL Q
+\\sansr                     <char-0x1D5CB>               " 𝗋          : MATHEMATICAL SANS-SERIF SMALL R
+\\sanss                     <char-0x1D5CC>               " 𝗌          : MATHEMATICAL SANS-SERIF SMALL S
+\\sanss<Tab>                <char-0x1D5CC>               " 𝗌          : MATHEMATICAL SANS-SERIF SMALL S
+\\sansse                    \\sansse                     "            : (Incomplete sequence)
+\\sansseven                 <char-0x1D7E9>               " 𝟩          : MATHEMATICAL SANS-SERIF DIGIT SEVEN
+\\sanssi                    \\sanssi                     "            : (Incomplete sequence)
+\\sanssix                   <char-0x1D7E8>               " 𝟨          : MATHEMATICAL SANS-SERIF DIGIT SIX
+\\sanst                     <char-0x1D5CD>               " 𝗍          : MATHEMATICAL SANS-SERIF SMALL T
+\\sanst<Tab>                <char-0x1D5CD>               " 𝗍          : MATHEMATICAL SANS-SERIF SMALL T
+\\sansth                    \\sansth                     "            : (Incomplete sequence)
+\\sansthree                 <char-0x1D7E5>               " 𝟥          : MATHEMATICAL SANS-SERIF DIGIT THREE
+\\sanstw                    \\sanstw                     "            : (Incomplete sequence)
+\\sanstwo                   <char-0x1D7E4>               " 𝟤          : MATHEMATICAL SANS-SERIF DIGIT TWO
+\\sansu                     <char-0x1D5CE>               " 𝗎          : MATHEMATICAL SANS-SERIF SMALL U
+\\sansv                     <char-0x1D5CF>               " 𝗏          : MATHEMATICAL SANS-SERIF SMALL V
+\\sansw                     <char-0x1D5D0>               " 𝗐          : MATHEMATICAL SANS-SERIF SMALL W
+\\sansx                     <char-0x1D5D1>               " 𝗑          : MATHEMATICAL SANS-SERIF SMALL X
+\\sansy                     <char-0x1D5D2>               " 𝗒          : MATHEMATICAL SANS-SERIF SMALL Y
+\\sansz                     <char-0x1D5D3>               " 𝗓          : MATHEMATICAL SANS-SERIF SMALL Z
+\\sansz<Tab>                <char-0x1D5D3>               " 𝗓          : MATHEMATICAL SANS-SERIF SMALL Z
+\\sansze                    \\sansze                     "            : (Incomplete sequence)
+\\sanszero                  <char-0x1D7E2>               " 𝟢          : MATHEMATICAL SANS-SERIF DIGIT ZERO
+\\saturn                    <char-0x02644>               " ♄          : SATURN
+\\sbbrg                     <char-0x0032A>               " ◌̪         : COMBINING BRIDGE BELOW / NON-SPACING BRIDGE BELOW
+\\sblhr                     <char-0x002D3>               " ˓          : MODIFIER LETTER CENTRED LEFT HALF RING / MODIFIER LETTER CENTERED LEFT HALF RING
+\\sbrhr                     <char-0x002D2>               " ˒          : MODIFIER LETTER CENTRED RIGHT HALF RING / MODIFIER LETTER CENTERED RIGHT HALF RING
+\\schwa                     <char-0x00259>               " ə          : LATIN SMALL LETTER SCHWA
+\\scorpio                   <char-0x0264F>               " ♏          : SCORPIUS
+\\scpolint                  <char-0x02A13>               " ⨓          : LINE INTEGRATION WITH SEMICIRCULAR PATH AROUND POLE
+\\scrA                      <char-0x1D49C>               " 𝒜          : MATHEMATICAL SCRIPT CAPITAL A
+\\scrB                      <char-0x0212C>               " ℬ          : SCRIPT CAPITAL B / SCRIPT B
+\\scrC                      <char-0x1D49E>               " 𝒞          : MATHEMATICAL SCRIPT CAPITAL C
+\\scrD                      <char-0x1D49F>               " 𝒟          : MATHEMATICAL SCRIPT CAPITAL D
+\\scrE                      <char-0x02130>               " ℰ          : SCRIPT CAPITAL E / SCRIPT E
+\\scrF                      <char-0x02131>               " ℱ          : SCRIPT CAPITAL F / SCRIPT F
+\\scrG                      <char-0x1D4A2>               " 𝒢          : MATHEMATICAL SCRIPT CAPITAL G
+\\scrH                      <char-0x0210B>               " ℋ          : SCRIPT CAPITAL H / SCRIPT H
+\\scrI                      <char-0x02110>               " ℐ          : SCRIPT CAPITAL I / SCRIPT I
+\\scrJ                      <char-0x1D4A5>               " 𝒥          : MATHEMATICAL SCRIPT CAPITAL J
+\\scrK                      <char-0x1D4A6>               " 𝒦          : MATHEMATICAL SCRIPT CAPITAL K
+\\scrL                      <char-0x02112>               " ℒ          : SCRIPT CAPITAL L / SCRIPT L
+\\scrM                      <char-0x02133>               " ℳ          : SCRIPT CAPITAL M / SCRIPT M
+\\scrN                      <char-0x1D4A9>               " 𝒩          : MATHEMATICAL SCRIPT CAPITAL N
+\\scrO                      <char-0x1D4AA>               " 𝒪          : MATHEMATICAL SCRIPT CAPITAL O
+\\scrP                      <char-0x1D4AB>               " 𝒫          : MATHEMATICAL SCRIPT CAPITAL P
+\\scrQ                      <char-0x1D4AC>               " 𝒬          : MATHEMATICAL SCRIPT CAPITAL Q
+\\scrR                      <char-0x0211B>               " ℛ          : SCRIPT CAPITAL R / SCRIPT R
+\\scrS                      <char-0x1D4AE>               " 𝒮          : MATHEMATICAL SCRIPT CAPITAL S
+\\scrT                      <char-0x1D4AF>               " 𝒯          : MATHEMATICAL SCRIPT CAPITAL T
+\\scrU                      <char-0x1D4B0>               " 𝒰          : MATHEMATICAL SCRIPT CAPITAL U
+\\scrV                      <char-0x1D4B1>               " 𝒱          : MATHEMATICAL SCRIPT CAPITAL V
+\\scrW                      <char-0x1D4B2>               " 𝒲          : MATHEMATICAL SCRIPT CAPITAL W
+\\scrX                      <char-0x1D4B3>               " 𝒳          : MATHEMATICAL SCRIPT CAPITAL X
+\\scrY                      <char-0x1D4B4>               " 𝒴          : MATHEMATICAL SCRIPT CAPITAL Y
+\\scrZ                      <char-0x1D4B5>               " 𝒵          : MATHEMATICAL SCRIPT CAPITAL Z
+\\scra                      <char-0x1D4B6>               " 𝒶          : MATHEMATICAL SCRIPT SMALL A
+\\scrb                      <char-0x1D4B7>               " 𝒷          : MATHEMATICAL SCRIPT SMALL B
+\\scrc                      <char-0x1D4B8>               " 𝒸          : MATHEMATICAL SCRIPT SMALL C
+\\scrd                      <char-0x1D4B9>               " 𝒹          : MATHEMATICAL SCRIPT SMALL D
+\\scre                      <char-0x0212F>               " ℯ          : SCRIPT SMALL E
+\\scrf                      <char-0x1D4BB>               " 𝒻          : MATHEMATICAL SCRIPT SMALL F
+\\scrg                      <char-0x0210A>               " ℊ          : SCRIPT SMALL G
+\\scrh                      <char-0x1D4BD>               " 𝒽          : MATHEMATICAL SCRIPT SMALL H
+\\scri                      <char-0x1D4BE>               " 𝒾          : MATHEMATICAL SCRIPT SMALL I
+\\scrj                      <char-0x1D4BF>               " 𝒿          : MATHEMATICAL SCRIPT SMALL J
+\\scrk                      <char-0x1D4C0>               " 𝓀          : MATHEMATICAL SCRIPT SMALL K
+\\scrl                      <char-0x1D4C1>               " 𝓁          : MATHEMATICAL SCRIPT SMALL L
+\\scrm                      <char-0x1D4C2>               " 𝓂          : MATHEMATICAL SCRIPT SMALL M
+\\scrn                      <char-0x1D4C3>               " 𝓃          : MATHEMATICAL SCRIPT SMALL N
+\\scro                      <char-0x02134>               " ℴ          : SCRIPT SMALL O
+\\scrp                      <char-0x1D4C5>               " 𝓅          : MATHEMATICAL SCRIPT SMALL P
+\\scrq                      <char-0x1D4C6>               " 𝓆          : MATHEMATICAL SCRIPT SMALL Q
+\\scrr                      <char-0x1D4C7>               " 𝓇          : MATHEMATICAL SCRIPT SMALL R
+\\scrs                      <char-0x1D4C8>               " 𝓈          : MATHEMATICAL SCRIPT SMALL S
+\\scrt                      <char-0x1D4C9>               " 𝓉          : MATHEMATICAL SCRIPT SMALL T
+\\scru                      <char-0x1D4CA>               " 𝓊          : MATHEMATICAL SCRIPT SMALL U
+\\scrv                      <char-0x1D4CB>               " 𝓋          : MATHEMATICAL SCRIPT SMALL V
+\\scrw                      <char-0x1D4CC>               " 𝓌          : MATHEMATICAL SCRIPT SMALL W
+\\scrx                      <char-0x1D4CD>               " 𝓍          : MATHEMATICAL SCRIPT SMALL X
+\\scry                      <char-0x1D4CE>               " 𝓎          : MATHEMATICAL SCRIPT SMALL Y
+\\scrz                      <char-0x1D4CF>               " 𝓏          : MATHEMATICAL SCRIPT SMALL Z
+\\scurel                    <char-0x022B1>               " ⊱          : SUCCEEDS UNDER RELATION
+\\searrow                   <char-0x02198>               " ↘          : SOUTH EAST ARROW / LOWER RIGHT ARROW
+\\seovnearrow               <char-0x0292D>               " ⤭          : SOUTH EAST ARROW CROSSING NORTH EAST ARROW
+\\setminus                  <char-0x02216>               " ∖          : SET MINUS
+\\sharp                     <char-0x0266F>               " ♯          : MUSIC SHARP SIGN / SHARP
+\\shuffle                   <char-0x029E2>               " ⧢          : SHUFFLE PRODUCT
+\\sigma                     <char-0x003C3>               " σ          : GREEK SMALL LETTER SIGMA
+\\sim                       <char-0x0223C>               " ∼          : TILDE OPERATOR
+\\sim<Tab>                  <char-0x0223C>               " ∼          : TILDE OPERATOR
+\\sime                      \\sime                       "            : (Incomplete sequence)
+\\simeq                     <char-0x02243>               " ≃          : ASYMPTOTICALLY EQUAL TO
+\\simg                      \\simg                       "            : (Incomplete sequence)
+\\simgE                     <char-0x02AA0>               " ⪠          : SIMILAR ABOVE GREATER-THAN ABOVE EQUALS SIGN
+\\simgtr                    <char-0x02A9E>               " ⪞          : SIMILAR OR GREATER-THAN
+\\simi                      \\simi                       "            : (Incomplete sequence)
+\\similarleftarrow          <char-0x02B49>               " ⭉          : TILDE OPERATOR ABOVE LEFTWARDS ARROW
+\\siml                      \\siml                       "            : (Incomplete sequence)
+\\simlE                     <char-0x02A9F>               " ⪟          : SIMILAR ABOVE LESS-THAN ABOVE EQUALS SIGN
+\\simless                   <char-0x02A9D>               " ⪝          : SIMILAR OR LESS-THAN
+\\simm                      \\simm                       "            : (Incomplete sequence)
+\\simminussim               <char-0x02A6C>               " ⩬          : SIMILAR MINUS SIMILAR
+\\simp                      \\simp                       "            : (Incomplete sequence)
+\\simplus                   <char-0x02A24>               " ⨤          : PLUS SIGN WITH TILDE ABOVE
+\\simr                      \\simr                       "            : (Incomplete sequence)
+\\simrdots                  <char-0x02A6B>               " ⩫          : TILDE OPERATOR WITH RISING DOTS
+\\sinewave                  <char-0x0223F>               " ∿          : SINE WAVE
+\\smallblacktriangleleft    <char-0x025C2>               " ◂          : BLACK LEFT-POINTING SMALL TRIANGLE / BLACK LEFT POINTING SMALL TRIANGLE
+\\smallblacktriangleright   <char-0x025B8>               " ▸          : BLACK RIGHT-POINTING SMALL TRIANGLE / BLACK RIGHT POINTING SMALL TRIANGLE
+\\smallin                   <char-0x0220A>               " ∊          : SMALL ELEMENT OF
+\\smallni                   <char-0x0220D>               " ∍          : SMALL CONTAINS AS MEMBER
+\\smalltriangleleft         <char-0x025C3>               " ◃          : WHITE LEFT-POINTING SMALL TRIANGLE / WHITE LEFT POINTING SMALL TRIANGLE
+\\smalltriangleright        <char-0x025B9>               " ▹          : WHITE RIGHT-POINTING SMALL TRIANGLE / WHITE RIGHT POINTING SMALL TRIANGLE
+\\smashtimes                <char-0x02A33>               " ⨳          : SMASH PRODUCT
+\\smblkdiamond              <char-0x02B29>               " ⬩          : BLACK SMALL DIAMOND
+\\smblklozenge              <char-0x02B2A>               " ⬪          : BLACK SMALL LOZENGE
+\\smblksquare               <char-0x025AA>               " ▪          : BLACK SMALL SQUARE
+\\smeparsl                  <char-0x029E4>               " ⧤          : EQUALS SIGN AND SLANTED PARALLEL WITH TILDE ABOVE
+\\smile                     <char-0x02323>               " ⌣          : SMILE
+\\smt                       <char-0x02AAA>               " ⪪          : SMALLER THAN
+\\smt<Tab>                  <char-0x02AAA>               " ⪪          : SMALLER THAN
+\\smte                      <char-0x02AAC>               " ⪬          : SMALLER THAN OR EQUAL TO
+\\smwhitestar               <char-0x02B52>               " ⭒          : WHITE SMALL STAR
+\\smwhtcircle               <char-0x025E6>               " ◦          : WHITE BULLET
+\\smwhtlozenge              <char-0x02B2B>               " ⬫          : WHITE SMALL LOZENGE
+\\smwhtsquare               <char-0x025AB>               " ▫          : WHITE SMALL SQUARE
+\\sout                      <char-0x00336>               " ◌̶         : COMBINING LONG STROKE OVERLAY / NON-SPACING LONG BAR OVERLAY
+\\spadesuit                 <char-0x02660>               " ♠          : BLACK SPADE SUIT
+\\sphericalangle            <char-0x02222>               " ∢          : SPHERICAL ANGLE
+\\sphericalangle<Tab>       <char-0x02222>               " ∢          : SPHERICAL ANGLE
+\\sphericalangleu           \\sphericalangleu            "            : (Incomplete sequence)
+\\sphericalangleup          <char-0x029A1>               " ⦡          : SPHERICAL ANGLE OPENING UP
+\\sqcap                     <char-0x02293>               " ⊓          : SQUARE CAP
+\\sqcup                     <char-0x02294>               " ⊔          : SQUARE CUP
+\\sqfl                      <char-0x025E7>               " ◧          : SQUARE WITH LEFT HALF BLACK
+\\sqfnw                     <char-0x02519>               " ┙          : BOX DRAWINGS UP LIGHT AND LEFT HEAVY / FORMS UP LIGHT AND LEFT HEAVY
+\\sqfr                      <char-0x025E8>               " ◨          : SQUARE WITH RIGHT HALF BLACK
+\\sqfse                     <char-0x025EA>               " ◪          : SQUARE WITH LOWER RIGHT DIAGONAL HALF BLACK
+\\sqlozenge                 <char-0x02311>               " ⌑          : SQUARE LOZENGE
+\\sqrint                    <char-0x02A16>               " ⨖          : QUATERNION INTEGRAL OPERATOR
+\\sqrt                      <char-0x0221A>               " √          : SQUARE ROOT
+\\sqrt<Tab>                 <char-0x0221A>               " √          : SQUARE ROOT
+\\sqrtb                     \\sqrtb                      "            : (Incomplete sequence)
+\\sqrtbottom                <char-0x023B7>               " ⎷          : RADICAL SYMBOL BOTTOM
+\\sqspne                    <char-0x022E5>               " ⋥          : SQUARE ORIGINAL OF OR NOT EQUAL TO
+\\sqsubset                  <char-0x0228F>               " ⊏          : SQUARE IMAGE OF
+\\sqsubset<Tab>             <char-0x0228F>               " ⊏          : SQUARE IMAGE OF
+\\sqsubsete                 \\sqsubsete                  "            : (Incomplete sequence)
+\\sqsubseteq                <char-0x02291>               " ⊑          : SQUARE IMAGE OF OR EQUAL TO
+\\sqsubsetn                 \\sqsubsetn                  "            : (Incomplete sequence)
+\\sqsubsetneq               <char-0x022E4>               " ⋤          : SQUARE IMAGE OF OR NOT EQUAL TO
+\\sqsupset                  <char-0x02290>               " ⊐          : SQUARE ORIGINAL OF
+\\sqsupset<Tab>             <char-0x02290>               " ⊐          : SQUARE ORIGINAL OF
+\\sqsupsete                 \\sqsupsete                  "            : (Incomplete sequence)
+\\sqsupseteq                <char-0x02292>               " ⊒          : SQUARE ORIGINAL OF OR EQUAL TO
+\\square                    <char-0x025A1>               " □          : WHITE SQUARE
+\\square<Tab>               <char-0x025A1>               " □          : WHITE SQUARE
+\\squareb                   \\squareb                    "            : (Incomplete sequence)
+\\squarebotblack            <char-0x02B13>               " ⬓          : SQUARE WITH BOTTOM HALF BLACK
+\\squarec                   \\squarec                    "            : (Incomplete sequence)
+\\squarecrossfill           <char-0x025A9>               " ▩          : SQUARE WITH DIAGONAL CROSSHATCH FILL
+\\squareh                   \\squareh                    "            : (Incomplete sequence)
+\\squarehfill               <char-0x025A4>               " ▤          : SQUARE WITH HORIZONTAL FILL
+\\squarehvfill              <char-0x025A6>               " ▦          : SQUARE WITH ORTHOGONAL CROSSHATCH FILL
+\\squarel                   \\squarel                    "            : (Incomplete sequence)
+\\squarellblack             <char-0x02B15>               " ⬕          : SQUARE WITH LOWER LEFT DIAGONAL HALF BLACK
+\\squarellquad              <char-0x025F1>               " ◱          : WHITE SQUARE WITH LOWER LEFT QUADRANT
+\\squarelrquad              <char-0x025F2>               " ◲          : WHITE SQUARE WITH LOWER RIGHT QUADRANT
+\\squaren                   \\squaren                    "            : (Incomplete sequence)
+\\squareneswfill            <char-0x025A8>               " ▨          : SQUARE WITH UPPER RIGHT TO LOWER LEFT FILL
+\\squarenwsefill            <char-0x025A7>               " ▧          : SQUARE WITH UPPER LEFT TO LOWER RIGHT FILL
+\\squaret                   \\squaret                    "            : (Incomplete sequence)
+\\squaretopblack            <char-0x02B12>               " ⬒          : SQUARE WITH TOP HALF BLACK
+\\squareu                   \\squareu                    "            : (Incomplete sequence)
+\\squareulblack             <char-0x025E9>               " ◩          : SQUARE WITH UPPER LEFT DIAGONAL HALF BLACK
+\\squareulquad              <char-0x025F0>               " ◰          : WHITE SQUARE WITH UPPER LEFT QUADRANT
+\\squareurblack             <char-0x02B14>               " ⬔          : SQUARE WITH UPPER RIGHT DIAGONAL HALF BLACK
+\\squareurquad              <char-0x025F3>               " ◳          : WHITE SQUARE WITH UPPER RIGHT QUADRANT
+\\squarev                   \\squarev                    "            : (Incomplete sequence)
+\\squarevfill               <char-0x025A5>               " ▥          : SQUARE WITH VERTICAL FILL
+\\squoval                   <char-0x025A2>               " ▢          : WHITE SQUARE WITH ROUNDED CORNERS
+\\ss                        <char-0x000DF>               " ß          : LATIN SMALL LETTER SHARP S
+\\star                      <char-0x022C6>               " ⋆          : STAR OPERATOR
+\\star<Tab>                 <char-0x022C6>               " ⋆          : STAR OPERATOR
+\\stare                     \\stare                      "            : (Incomplete sequence)
+\\starequal                 <char-0x0225B>               " ≛          : STAR EQUALS
+\\sterling                  <char-0x000A3>               " £          : POUND SIGN
+\\strike                    <char-0x00336>               " ◌̶         : COMBINING LONG STROKE OVERLAY / NON-SPACING LONG BAR OVERLAY
+\\strns                     <char-0x023E4>               " ⏤          : STRAIGHTNESS
+\\subedot                   <char-0x02AC3>               " ⫃          : SUBSET OF OR EQUAL TO WITH DOT ABOVE
+\\submult                   <char-0x02AC1>               " ⫁          : SUBSET WITH MULTIPLICATION SIGN BELOW
+\\subset                    <char-0x02282>               " ⊂          : SUBSET OF
+\\subset<Tab>               <char-0x02282>               " ⊂          : SUBSET OF
+\\subseta                   \\subseta                    "            : (Incomplete sequence)
+\\subsetapprox              <char-0x02AC9>               " ⫉          : SUBSET OF ABOVE ALMOST EQUAL TO
+\\subsetd                   \\subsetd                    "            : (Incomplete sequence)
+\\subsetdot                 <char-0x02ABD>               " ⪽          : SUBSET WITH DOT
+\\subsete                   \\subsete                    "            : (Incomplete sequence)
+\\subseteq                  <char-0x02286>               " ⊆          : SUBSET OF OR EQUAL TO
+\\subseteq<Tab>             <char-0x02286>               " ⊆          : SUBSET OF OR EQUAL TO
+\\subseteqq                 <char-0x02AC5>               " ⫅          : SUBSET OF ABOVE EQUALS SIGN
+\\subsetn                   \\subsetn                    "            : (Incomplete sequence)
+\\subsetneq                 <char-0x0228A>               " ⊊          : SUBSET OF WITH NOT EQUAL TO / SUBSET OF OR NOT EQUAL TO
+\\subsetneq<Tab>            <char-0x0228A>               " ⊊          : SUBSET OF WITH NOT EQUAL TO / SUBSET OF OR NOT EQUAL TO
+\\subsetneqq                <char-0x02ACB>               " ⫋          : SUBSET OF ABOVE NOT EQUAL TO
+\\subsetp                   \\subsetp                    "            : (Incomplete sequence)
+\\subsetplus                <char-0x02ABF>               " ⪿          : SUBSET WITH PLUS SIGN BELOW
+\\subsim                    <char-0x02AC7>               " ⫇          : SUBSET OF ABOVE TILDE OPERATOR
+\\subsub                    <char-0x02AD5>               " ⫕          : SUBSET ABOVE SUBSET
+\\subsup                    <char-0x02AD3>               " ⫓          : SUBSET ABOVE SUPERSET
+\\succ                      <char-0x0227B>               " ≻          : SUCCEEDS
+\\succ<Tab>                 <char-0x0227B>               " ≻          : SUCCEEDS
+\\succa                     \\succa                      "            : (Incomplete sequence)
+\\succapprox                <char-0x02AB8>               " ⪸          : SUCCEEDS ABOVE ALMOST EQUAL TO
+\\succc                     \\succc                      "            : (Incomplete sequence)
+\\succcurlyeq               <char-0x0227D>               " ≽          : SUCCEEDS OR EQUAL TO
+\\succe                     \\succe                      "            : (Incomplete sequence)
+\\succeq                    <char-0x02AB0>               " ⪰          : SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN
+\\succeq<Tab>               <char-0x02AB0>               " ⪰          : SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN
+\\succeqq                   <char-0x02AB4>               " ⪴          : SUCCEEDS ABOVE EQUALS SIGN
+\\succn                     \\succn                      "            : (Incomplete sequence)
+\\succnapprox               <char-0x02ABA>               " ⪺          : SUCCEEDS ABOVE NOT ALMOST EQUAL TO
+\\succneq                   <char-0x02AB2>               " ⪲          : SUCCEEDS ABOVE SINGLE-LINE NOT EQUAL TO
+\\succneq<Tab>              <char-0x02AB2>               " ⪲          : SUCCEEDS ABOVE SINGLE-LINE NOT EQUAL TO
+\\succneqq                  <char-0x02AB6>               " ⪶          : SUCCEEDS ABOVE NOT EQUAL TO
+\\succnsim                  <char-0x022E9>               " ⋩          : SUCCEEDS BUT NOT EQUIVALENT TO
+\\succs                     \\succs                      "            : (Incomplete sequence)
+\\succsim                   <char-0x0227F>               " ≿          : SUCCEEDS OR EQUIVALENT TO
+\\sum                       <char-0x02211>               " ∑          : N-ARY SUMMATION
+\\sum<Tab>                  <char-0x02211>               " ∑          : N-ARY SUMMATION
+\\sumi                      \\sumi                       "            : (Incomplete sequence)
+\\sumint                    <char-0x02A0B>               " ⨋          : SUMMATION WITH INTEGRAL
+\\sun                       <char-0x0263C>               " ☼          : WHITE SUN WITH RAYS
+\\supdsub                   <char-0x02AD8>               " ⫘          : SUPERSET BESIDE AND JOINED BY DASH WITH SUBSET
+\\supedot                   <char-0x02AC4>               " ⫄          : SUPERSET OF OR EQUAL TO WITH DOT ABOVE
+\\suphsol                   <char-0x027C9>               " ⟉          : SUPERSET PRECEDING SOLIDUS
+\\suphsub                   <char-0x02AD7>               " ⫗          : SUPERSET BESIDE SUBSET
+\\supmult                   <char-0x02AC2>               " ⫂          : SUPERSET WITH MULTIPLICATION SIGN BELOW
+\\supset                    <char-0x02283>               " ⊃          : SUPERSET OF
+\\supset<Tab>               <char-0x02283>               " ⊃          : SUPERSET OF
+\\supseta                   \\supseta                    "            : (Incomplete sequence)
+\\supsetapprox              <char-0x02ACA>               " ⫊          : SUPERSET OF ABOVE ALMOST EQUAL TO
+\\supsetd                   \\supsetd                    "            : (Incomplete sequence)
+\\supsetdot                 <char-0x02ABE>               " ⪾          : SUPERSET WITH DOT
+\\supsete                   \\supsete                    "            : (Incomplete sequence)
+\\supseteq                  <char-0x02287>               " ⊇          : SUPERSET OF OR EQUAL TO
+\\supseteq<Tab>             <char-0x02287>               " ⊇          : SUPERSET OF OR EQUAL TO
+\\supseteqq                 <char-0x02AC6>               " ⫆          : SUPERSET OF ABOVE EQUALS SIGN
+\\supsetn                   \\supsetn                    "            : (Incomplete sequence)
+\\supsetneq                 <char-0x0228B>               " ⊋          : SUPERSET OF WITH NOT EQUAL TO / SUPERSET OF OR NOT EQUAL TO
+\\supsetneq<Tab>            <char-0x0228B>               " ⊋          : SUPERSET OF WITH NOT EQUAL TO / SUPERSET OF OR NOT EQUAL TO
+\\supsetneqq                <char-0x02ACC>               " ⫌          : SUPERSET OF ABOVE NOT EQUAL TO
+\\supsetp                   \\supsetp                    "            : (Incomplete sequence)
+\\supsetplus                <char-0x02AC0>               " ⫀          : SUPERSET WITH PLUS SIGN BELOW
+\\supsim                    <char-0x02AC8>               " ⫈          : SUPERSET OF ABOVE TILDE OPERATOR
+\\supsub                    <char-0x02AD4>               " ⫔          : SUPERSET ABOVE SUBSET
+\\supsup                    <char-0x02AD6>               " ⫖          : SUPERSET ABOVE SUPERSET
+\\surd                      <char-0x0221A>               " √          : SQUARE ROOT
+\\swarrow                   <char-0x02199>               " ↙          : SOUTH WEST ARROW / LOWER LEFT ARROW
+\\tau                       <char-0x003C4>               " τ          : GREEK SMALL LETTER TAU
+\\tau<Tab>                  <char-0x003C4>               " τ          : GREEK SMALL LETTER TAU
+\\taur                      \\taur                       "            : (Incomplete sequence)
+\\taurus                    <char-0x02649>               " ♉          : TAURUS
+\\tdcol                     <char-0x02AF6>               " ⫶          : TRIPLE COLON OPERATOR
+\\tesh                      <char-0x002A7>               " ʧ          : LATIN SMALL LETTER TESH DIGRAPH / LATIN SMALL LETTER T ESH
+\\th                        <char-0x000FE>               " þ          : LATIN SMALL LETTER THORN
+\\th<Tab>                   <char-0x000FE>               " þ          : LATIN SMALL LETTER THORN
+\\the                       \\the                        "            : (Incomplete sequence)
+\\therefore                 <char-0x02234>               " ∴          : THEREFORE
+\\theta                     <char-0x003B8>               " θ          : GREEK SMALL LETTER THETA
+\\thi                       \\thi                        "            : (Incomplete sequence)
+\\thickspace                <char-0x02005>               "            : FOUR-PER-EM SPACE
+\\thinspace                 <char-0x02009>               "            : THIN SPACE
+\\thr                       \\thr                        "            : (Incomplete sequence)
+\\threedangle               <char-0x027C0>               " ⟀          : THREE DIMENSIONAL ANGLE
+\\threeunderdot             <char-0x020E8>               " ◌⃨         : COMBINING TRIPLE UNDERDOT
+\\tieconcat                 <char-0x02040>               " ⁀          : CHARACTER TIE
+\\tilde                     <char-0x00303>               " ◌̃         : COMBINING TILDE / NON-SPACING TILDE
+\\tilde<Tab>                <char-0x00303>               " ◌̃         : COMBINING TILDE / NON-SPACING TILDE
+\\tildel                    \\tildel                     "            : (Incomplete sequence)
+\\tildelow                  <char-0x002DC>               " ˜          : SMALL TILDE / SPACING TILDE
+\\tildet                    \\tildet                     "            : (Incomplete sequence)
+\\tildetrpl                 <char-0x0224B>               " ≋          : TRIPLE TILDE
+\\times                     <char-0x000D7>               " ×          : MULTIPLICATION SIGN
+\\times<Tab>                <char-0x000D7>               " ×          : MULTIPLICATION SIGN
+\\timesb                    \\timesb                     "            : (Incomplete sequence)
+\\timesbar                  <char-0x02A31>               " ⨱          : MULTIPLICATION SIGN WITH UNDERBAR
+\\to                        <char-0x02192>               " →          : RIGHTWARDS ARROW / RIGHT ARROW
+\\to<Tab>                   <char-0x02192>               " →          : RIGHTWARDS ARROW / RIGHT ARROW
+\\toe                       \\toe                        "            : (Incomplete sequence)
+\\toea                      <char-0x02928>               " ⤨          : NORTH EAST ARROW AND SOUTH EAST ARROW
+\\ton                       \\ton                        "            : (Incomplete sequence)
+\\tona                      <char-0x02927>               " ⤧          : NORTH WEST ARROW AND NORTH EAST ARROW
+\\top                       <char-0x022A4>               " ⊤          : DOWN TACK
+\\top<Tab>                  <char-0x022A4>               " ⊤          : DOWN TACK
+\\topb                      \\topb                       "            : (Incomplete sequence)
+\\topbot                    <char-0x02336>               " ⌶          : APL FUNCTIONAL SYMBOL I-BEAM
+\\tops                      \\tops                       "            : (Incomplete sequence)
+\\topsemicircle             <char-0x025E0>               " ◠          : UPPER HALF CIRCLE
+\\tos                       \\tos                        "            : (Incomplete sequence)
+\\tosa                      <char-0x02929>               " ⤩          : SOUTH EAST ARROW AND SOUTH WEST ARROW
+\\tow                       \\tow                        "            : (Incomplete sequence)
+\\towa                      <char-0x0292A>               " ⤪          : SOUTH WEST ARROW AND NORTH WEST ARROW
+\\trademark                 <char-0x02122>               " ™          : TRADE MARK SIGN / TRADEMARK
+\\trapezium                 <char-0x023E2>               " ⏢          : WHITE TRAPEZIUM
+\\trianglecdot              <char-0x025EC>               " ◬          : WHITE UP-POINTING TRIANGLE WITH DOT / WHITE UP POINTING TRIANGLE WITH DOT
+\\triangledown              <char-0x025BF>               " ▿          : WHITE DOWN-POINTING SMALL TRIANGLE / WHITE DOWN POINTING SMALL TRIANGLE
+\\triangleleft              <char-0x025C1>               " ◁          : WHITE LEFT-POINTING TRIANGLE / WHITE LEFT POINTING TRIANGLE
+\\triangleleft<Tab>         <char-0x025C1>               " ◁          : WHITE LEFT-POINTING TRIANGLE / WHITE LEFT POINTING TRIANGLE
+\\triangleleftb             \\triangleleftb              "            : (Incomplete sequence)
+\\triangleleftblack         <char-0x025ED>               " ◭          : UP-POINTING TRIANGLE WITH LEFT HALF BLACK / UP POINTING TRIANGLE WITH LEFT HALF BLACK
+\\trianglelefte             \\trianglelefte              "            : (Incomplete sequence)
+\\trianglelefteq            <char-0x022B4>               " ⊴          : NORMAL SUBGROUP OF OR EQUAL TO
+\\triangleminus             <char-0x02A3A>               " ⨺          : MINUS SIGN IN TRIANGLE
+\\triangleplus              <char-0x02A39>               " ⨹          : PLUS SIGN IN TRIANGLE
+\\triangleq                 <char-0x0225C>               " ≜          : DELTA EQUAL TO
+\\triangleright             <char-0x025B7>               " ▷          : WHITE RIGHT-POINTING TRIANGLE / WHITE RIGHT POINTING TRIANGLE
+\\triangleright<Tab>        <char-0x025B7>               " ▷          : WHITE RIGHT-POINTING TRIANGLE / WHITE RIGHT POINTING TRIANGLE
+\\trianglerightb            \\trianglerightb             "            : (Incomplete sequence)
+\\trianglerightblack        <char-0x025EE>               " ◮          : UP-POINTING TRIANGLE WITH RIGHT HALF BLACK / UP POINTING TRIANGLE WITH RIGHT HALF BLACK
+\\trianglerighte            \\trianglerighte             "            : (Incomplete sequence)
+\\trianglerighteq           <char-0x022B5>               " ⊵          : CONTAINS AS NORMAL SUBGROUP OR EQUAL TO
+\\triangletimes             <char-0x02A3B>               " ⨻          : MULTIPLICATION SIGN IN TRIANGLE
+\\tricolon                  <char-0x0205D>               " ⁝          : TRICOLON
+\\tripleplus                <char-0x029FB>               " ⧻          : TRIPLE PLUS
+\\trna                      <char-0x00250>               " ɐ          : LATIN SMALL LETTER TURNED A
+\\trnh                      <char-0x00265>               " ɥ          : LATIN SMALL LETTER TURNED H
+\\trnm                      <char-0x0026F>               " ɯ          : LATIN SMALL LETTER TURNED M
+\\trnm<Tab>                 <char-0x0026F>               " ɯ          : LATIN SMALL LETTER TURNED M
+\\trnml                     \\trnml                      "            : (Incomplete sequence)
+\\trnmlr                    <char-0x00270>               " ɰ          : LATIN SMALL LETTER TURNED M WITH LONG LEG
+\\trnr                      <char-0x00279>               " ɹ          : LATIN SMALL LETTER TURNED R
+\\trnr<Tab>                 <char-0x00279>               " ɹ          : LATIN SMALL LETTER TURNED R
+\\trnrl                     <char-0x0027A>               " ɺ          : LATIN SMALL LETTER TURNED R WITH LONG LEG
+\\trnsa                     <char-0x00252>               " ɒ          : LATIN SMALL LETTER TURNED ALPHA / LATIN SMALL LETTER TURNED SCRIPT A
+\\trnt                      <char-0x00287>               " ʇ          : LATIN SMALL LETTER TURNED T
+\\trny                      <char-0x0028E>               " ʎ          : LATIN SMALL LETTER TURNED Y
+\\ttA                       <char-0x1D670>               " 𝙰          : MATHEMATICAL MONOSPACE CAPITAL A
+\\ttB                       <char-0x1D671>               " 𝙱          : MATHEMATICAL MONOSPACE CAPITAL B
+\\ttC                       <char-0x1D672>               " 𝙲          : MATHEMATICAL MONOSPACE CAPITAL C
+\\ttD                       <char-0x1D673>               " 𝙳          : MATHEMATICAL MONOSPACE CAPITAL D
+\\ttE                       <char-0x1D674>               " 𝙴          : MATHEMATICAL MONOSPACE CAPITAL E
+\\ttF                       <char-0x1D675>               " 𝙵          : MATHEMATICAL MONOSPACE CAPITAL F
+\\ttG                       <char-0x1D676>               " 𝙶          : MATHEMATICAL MONOSPACE CAPITAL G
+\\ttH                       <char-0x1D677>               " 𝙷          : MATHEMATICAL MONOSPACE CAPITAL H
+\\ttI                       <char-0x1D678>               " 𝙸          : MATHEMATICAL MONOSPACE CAPITAL I
+\\ttJ                       <char-0x1D679>               " 𝙹          : MATHEMATICAL MONOSPACE CAPITAL J
+\\ttK                       <char-0x1D67A>               " 𝙺          : MATHEMATICAL MONOSPACE CAPITAL K
+\\ttL                       <char-0x1D67B>               " 𝙻          : MATHEMATICAL MONOSPACE CAPITAL L
+\\ttM                       <char-0x1D67C>               " 𝙼          : MATHEMATICAL MONOSPACE CAPITAL M
+\\ttN                       <char-0x1D67D>               " 𝙽          : MATHEMATICAL MONOSPACE CAPITAL N
+\\ttO                       <char-0x1D67E>               " 𝙾          : MATHEMATICAL MONOSPACE CAPITAL O
+\\ttP                       <char-0x1D67F>               " 𝙿          : MATHEMATICAL MONOSPACE CAPITAL P
+\\ttQ                       <char-0x1D680>               " 𝚀          : MATHEMATICAL MONOSPACE CAPITAL Q
+\\ttR                       <char-0x1D681>               " 𝚁          : MATHEMATICAL MONOSPACE CAPITAL R
+\\ttS                       <char-0x1D682>               " 𝚂          : MATHEMATICAL MONOSPACE CAPITAL S
+\\ttT                       <char-0x1D683>               " 𝚃          : MATHEMATICAL MONOSPACE CAPITAL T
+\\ttU                       <char-0x1D684>               " 𝚄          : MATHEMATICAL MONOSPACE CAPITAL U
+\\ttV                       <char-0x1D685>               " 𝚅          : MATHEMATICAL MONOSPACE CAPITAL V
+\\ttW                       <char-0x1D686>               " 𝚆          : MATHEMATICAL MONOSPACE CAPITAL W
+\\ttX                       <char-0x1D687>               " 𝚇          : MATHEMATICAL MONOSPACE CAPITAL X
+\\ttY                       <char-0x1D688>               " 𝚈          : MATHEMATICAL MONOSPACE CAPITAL Y
+\\ttZ                       <char-0x1D689>               " 𝚉          : MATHEMATICAL MONOSPACE CAPITAL Z
+\\tta                       <char-0x1D68A>               " 𝚊          : MATHEMATICAL MONOSPACE SMALL A
+\\ttb                       <char-0x1D68B>               " 𝚋          : MATHEMATICAL MONOSPACE SMALL B
+\\ttc                       <char-0x1D68C>               " 𝚌          : MATHEMATICAL MONOSPACE SMALL C
+\\ttd                       <char-0x1D68D>               " 𝚍          : MATHEMATICAL MONOSPACE SMALL D
+\\tte                       <char-0x1D68E>               " 𝚎          : MATHEMATICAL MONOSPACE SMALL E
+\\tte<Tab>                  <char-0x1D68E>               " 𝚎          : MATHEMATICAL MONOSPACE SMALL E
+\\ttei                      \\ttei                       "            : (Incomplete sequence)
+\\tteight                   <char-0x1D7FE>               " 𝟾          : MATHEMATICAL MONOSPACE DIGIT EIGHT
+\\ttf                       <char-0x1D68F>               " 𝚏          : MATHEMATICAL MONOSPACE SMALL F
+\\ttf<Tab>                  <char-0x1D68F>               " 𝚏          : MATHEMATICAL MONOSPACE SMALL F
+\\ttfi                      \\ttfi                       "            : (Incomplete sequence)
+\\ttfive                    <char-0x1D7FB>               " 𝟻          : MATHEMATICAL MONOSPACE DIGIT FIVE
+\\ttfo                      \\ttfo                       "            : (Incomplete sequence)
+\\ttfour                    <char-0x1D7FA>               " 𝟺          : MATHEMATICAL MONOSPACE DIGIT FOUR
+\\ttg                       <char-0x1D690>               " 𝚐          : MATHEMATICAL MONOSPACE SMALL G
+\\tth                       <char-0x1D691>               " 𝚑          : MATHEMATICAL MONOSPACE SMALL H
+\\tti                       <char-0x1D692>               " 𝚒          : MATHEMATICAL MONOSPACE SMALL I
+\\ttj                       <char-0x1D693>               " 𝚓          : MATHEMATICAL MONOSPACE SMALL J
+\\ttk                       <char-0x1D694>               " 𝚔          : MATHEMATICAL MONOSPACE SMALL K
+\\ttl                       <char-0x1D695>               " 𝚕          : MATHEMATICAL MONOSPACE SMALL L
+\\ttm                       <char-0x1D696>               " 𝚖          : MATHEMATICAL MONOSPACE SMALL M
+\\ttn                       <char-0x1D697>               " 𝚗          : MATHEMATICAL MONOSPACE SMALL N
+\\ttn<Tab>                  <char-0x1D697>               " 𝚗          : MATHEMATICAL MONOSPACE SMALL N
+\\ttni                      \\ttni                       "            : (Incomplete sequence)
+\\ttnine                    <char-0x1D7FF>               " 𝟿          : MATHEMATICAL MONOSPACE DIGIT NINE
+\\tto                       <char-0x1D698>               " 𝚘          : MATHEMATICAL MONOSPACE SMALL O
+\\tto<Tab>                  <char-0x1D698>               " 𝚘          : MATHEMATICAL MONOSPACE SMALL O
+\\tton                      \\tton                       "            : (Incomplete sequence)
+\\ttone                     <char-0x1D7F7>               " 𝟷          : MATHEMATICAL MONOSPACE DIGIT ONE
+\\ttp                       <char-0x1D699>               " 𝚙          : MATHEMATICAL MONOSPACE SMALL P
+\\ttq                       <char-0x1D69A>               " 𝚚          : MATHEMATICAL MONOSPACE SMALL Q
+\\ttr                       <char-0x1D69B>               " 𝚛          : MATHEMATICAL MONOSPACE SMALL R
+\\tts                       <char-0x1D69C>               " 𝚜          : MATHEMATICAL MONOSPACE SMALL S
+\\tts<Tab>                  <char-0x1D69C>               " 𝚜          : MATHEMATICAL MONOSPACE SMALL S
+\\ttse                      \\ttse                       "            : (Incomplete sequence)
+\\ttseven                   <char-0x1D7FD>               " 𝟽          : MATHEMATICAL MONOSPACE DIGIT SEVEN
+\\ttsi                      \\ttsi                       "            : (Incomplete sequence)
+\\ttsix                     <char-0x1D7FC>               " 𝟼          : MATHEMATICAL MONOSPACE DIGIT SIX
+\\ttt                       <char-0x1D69D>               " 𝚝          : MATHEMATICAL MONOSPACE SMALL T
+\\ttt<Tab>                  <char-0x1D69D>               " 𝚝          : MATHEMATICAL MONOSPACE SMALL T
+\\ttth                      \\ttth                       "            : (Incomplete sequence)
+\\ttthree                   <char-0x1D7F9>               " 𝟹          : MATHEMATICAL MONOSPACE DIGIT THREE
+\\tttw                      \\tttw                       "            : (Incomplete sequence)
+\\tttwo                     <char-0x1D7F8>               " 𝟸          : MATHEMATICAL MONOSPACE DIGIT TWO
+\\ttu                       <char-0x1D69E>               " 𝚞          : MATHEMATICAL MONOSPACE SMALL U
+\\ttv                       <char-0x1D69F>               " 𝚟          : MATHEMATICAL MONOSPACE SMALL V
+\\ttw                       <char-0x1D6A0>               " 𝚠          : MATHEMATICAL MONOSPACE SMALL W
+\\ttx                       <char-0x1D6A1>               " 𝚡          : MATHEMATICAL MONOSPACE SMALL X
+\\tty                       <char-0x1D6A2>               " 𝚢          : MATHEMATICAL MONOSPACE SMALL Y
+\\ttz                       <char-0x1D6A3>               " 𝚣          : MATHEMATICAL MONOSPACE SMALL Z
+\\ttz<Tab>                  <char-0x1D6A3>               " 𝚣          : MATHEMATICAL MONOSPACE SMALL Z
+\\ttze                      \\ttze                       "            : (Incomplete sequence)
+\\ttzero                    <char-0x1D7F6>               " 𝟶          : MATHEMATICAL MONOSPACE DIGIT ZERO
+\\turnangle                 <char-0x029A2>               " ⦢          : TURNED ANGLE
+\\turnediota                <char-0x02129>               " ℩          : TURNED GREEK SMALL LETTER IOTA
+\\turnednot                 <char-0x02319>               " ⌙          : TURNED NOT SIGN
+\\turnk                     <char-0x0029E>               " ʞ          : LATIN SMALL LETTER TURNED K
+\\twocaps                   <char-0x02A4B>               " ⩋          : INTERSECTION BESIDE AND JOINED WITH INTERSECTION
+\\twocups                   <char-0x02A4A>               " ⩊          : UNION BESIDE AND JOINED WITH UNION
+\\twoheaddownarrow          <char-0x021A1>               " ↡          : DOWNWARDS TWO HEADED ARROW / DOWN TWO HEADED ARROW
+\\twoheadleftarrow          <char-0x0219E>               " ↞          : LEFTWARDS TWO HEADED ARROW / LEFT TWO HEADED ARROW
+\\twoheadleftarrow<Tab>     <char-0x0219E>               " ↞          : LEFTWARDS TWO HEADED ARROW / LEFT TWO HEADED ARROW
+\\twoheadleftarrowt         \\twoheadleftarrowt          "            : (Incomplete sequence)
+\\twoheadleftarrowtail      <char-0x02B3B>               " ⬻          : LEFTWARDS TWO-HEADED ARROW WITH TAIL
+\\twoheadleftdbkarrow       <char-0x02B37>               " ⬷          : LEFTWARDS TWO-HEADED TRIPLE DASH ARROW
+\\twoheadmapsfrom           <char-0x02B36>               " ⬶          : LEFTWARDS TWO-HEADED ARROW FROM BAR
+\\twoheadmapsto             <char-0x02905>               " ⤅          : RIGHTWARDS TWO-HEADED ARROW FROM BAR
+\\twoheadrightarrow         <char-0x021A0>               " ↠          : RIGHTWARDS TWO HEADED ARROW / RIGHT TWO HEADED ARROW
+\\twoheadrightarrow<Tab>    <char-0x021A0>               " ↠          : RIGHTWARDS TWO HEADED ARROW / RIGHT TWO HEADED ARROW
+\\twoheadrightarrowt        \\twoheadrightarrowt         "            : (Incomplete sequence)
+\\twoheadrightarrowtail     <char-0x02916>               " ⤖          : RIGHTWARDS TWO-HEADED ARROW WITH TAIL
+\\twoheaduparrow            <char-0x0219F>               " ↟          : UPWARDS TWO HEADED ARROW / UP TWO HEADED ARROW
+\\twoheaduparrow<Tab>       <char-0x0219F>               " ↟          : UPWARDS TWO HEADED ARROW / UP TWO HEADED ARROW
+\\twoheaduparrowc           \\twoheaduparrowc            "            : (Incomplete sequence)
+\\twoheaduparrowcircle      <char-0x02949>               " ⥉          : UPWARDS TWO-HEADED ARROW FROM SMALL CIRCLE
+\\twonotes                  <char-0x0266B>               " ♫          : BEAMED EIGHTH NOTES / BARRED EIGHTH NOTES
+\\u                         <char-0x002D8>               " ˘          : BREVE / SPACING BREVE
+\\u<Tab>                    <char-0x002D8>               " ˘          : BREVE / SPACING BREVE
+\\ul                        \\ul                         "            : (Incomplete sequence)
+\\ularc                     <char-0x025DC>               " ◜          : UPPER LEFT QUADRANT CIRCULAR ARC
+\\ulblacktriangle           <char-0x025E4>               " ◤          : BLACK UPPER LEFT TRIANGLE
+\\ulcorner                  <char-0x0231C>               " ⌜          : TOP LEFT CORNER
+\\ultriangle                <char-0x025F8>               " ◸          : UPPER LEFT TRIANGLE
+\\um                        \\um                         "            : (Incomplete sequence)
+\\uminus                    <char-0x02A41>               " ⩁          : UNION WITH MINUS SIGN
+\\un                        \\un                         "            : (Incomplete sequence)
+\\underbar                  <char-0x00332>               " ◌̲         : COMBINING LOW LINE / NON-SPACING UNDERSCORE
+\\underbrace                <char-0x023DF>               " ⏟          : BOTTOM CURLY BRACKET
+\\underbracket              <char-0x023B5>               " ⎵          : BOTTOM SQUARE BRACKET
+\\underleftarrow            <char-0x020EE>               " ◌⃮         : COMBINING LEFT ARROW BELOW
+\\underleftharpoondown      <char-0x020ED>               " ◌⃭         : COMBINING LEFTWARDS HARPOON WITH BARB DOWNWARDS
+\\underleftrightarrow       <char-0x0034D>               " ◌͍         : COMBINING LEFT RIGHT ARROW BELOW
+\\underrightarrow           <char-0x020EF>               " ◌⃯         : COMBINING RIGHT ARROW BELOW
+\\underrightharpoondown     <char-0x020EC>               " ◌⃬         : COMBINING RIGHTWARDS HARPOON WITH BARB DOWNWARDS
+\\up                        \\up                         "            : (Incomplete sequence)
+\\upMu                      <char-0x0039C>               " Μ          : GREEK CAPITAL LETTER MU
+\\upNu                      <char-0x0039D>               " Ν          : GREEK CAPITAL LETTER NU
+\\upOmicron                 <char-0x0039F>               " Ο          : GREEK CAPITAL LETTER OMICRON
+\\upand                     <char-0x0214B>               " ⅋          : TURNED AMPERSAND
+\\uparrow                   <char-0x02191>               " ↑          : UPWARDS ARROW / UP ARROW
+\\uparrow<Tab>              <char-0x02191>               " ↑          : UPWARDS ARROW / UP ARROW
+\\uparrowb                  \\uparrowb                   "            : (Incomplete sequence)
+\\uparrowbarred             <char-0x02909>               " ⤉          : UPWARDS ARROW WITH HORIZONTAL STROKE
+\\updasharrow               <char-0x021E1>               " ⇡          : UPWARDS DASHED ARROW / UP DASHED ARROW
+\\updownarrow               <char-0x02195>               " ↕          : UP DOWN ARROW
+\\updownarrow<Tab>          <char-0x02195>               " ↕          : UP DOWN ARROW
+\\updownarrowb              \\updownarrowb               "            : (Incomplete sequence)
+\\updownarrowbar            <char-0x021A8>               " ↨          : UP DOWN ARROW WITH BASE
+\\updownharpoonleftright    <char-0x0294D>               " ⥍          : UP BARB LEFT DOWN BARB RIGHT HARPOON
+\\updownharpoonrightleft    <char-0x0294C>               " ⥌          : UP BARB RIGHT DOWN BARB LEFT HARPOON
+\\upepsilon                 <char-0x003B5>               " ε          : GREEK SMALL LETTER EPSILON
+\\upharpoonleft             <char-0x021BF>               " ↿          : UPWARDS HARPOON WITH BARB LEFTWARDS / UP HARPOON WITH BARB LEFT
+\\upharpoonright            <char-0x021BE>               " ↾          : UPWARDS HARPOON WITH BARB RIGHTWARDS / UP HARPOON WITH BARB RIGHT
+\\upharpoonsleftright       <char-0x02963>               " ⥣          : UPWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT
+\\upin                      <char-0x027D2>               " ⟒          : ELEMENT OF OPENING UPWARDS
+\\upin<Tab>                 <char-0x027D2>               " ⟒          : ELEMENT OF OPENING UPWARDS
+\\upint                     <char-0x02A1B>               " ⨛          : INTEGRAL WITH OVERBAR
+\\upkoppa                   <char-0x003DF>               " ϟ          : GREEK SMALL LETTER KOPPA
+\\uplus                     <char-0x0228E>               " ⊎          : MULTISET UNION
+\\upoldKoppa                <char-0x003D8>               " Ϙ          : GREEK LETTER ARCHAIC KOPPA
+\\upoldkoppa                <char-0x003D9>               " ϙ          : GREEK SMALL LETTER ARCHAIC KOPPA
+\\upomicron                 <char-0x003BF>               " ο          : GREEK SMALL LETTER OMICRON
+\\upsampi                   <char-0x003E1>               " ϡ          : GREEK SMALL LETTER SAMPI
+\\upsilon                   <char-0x003C5>               " υ          : GREEK SMALL LETTER UPSILON
+\\upstigma                  <char-0x003DB>               " ϛ          : GREEK SMALL LETTER STIGMA
+\\upuparrows                <char-0x021C8>               " ⇈          : UPWARDS PAIRED ARROWS / UP PAIRED ARROWS
+\\upvDash                   <char-0x02AEB>               " ⫫          : DOUBLE UP TACK
+\\upvarbeta                 <char-0x003D0>               " ϐ          : GREEK BETA SYMBOL / GREEK SMALL LETTER CURLED BETA
+\\upwhitearrow              <char-0x021E7>               " ⇧          : UPWARDS WHITE ARROW / WHITE UP ARROW
+\\ur                        \\ur                         "            : (Incomplete sequence)
+\\uranus                    <char-0x02645>               " ♅          : URANUS
+\\urarc                     <char-0x025DD>               " ◝          : UPPER RIGHT QUADRANT CIRCULAR ARC
+\\urblacktriangle           <char-0x025E5>               " ◥          : BLACK UPPER RIGHT TRIANGLE
+\\urcorner                  <char-0x0231D>               " ⌝          : TOP RIGHT CORNER
+\\urtriangle                <char-0x025F9>               " ◹          : UPPER RIGHT TRIANGLE
+\\vDash                     <char-0x022A8>               " ⊨          : TRUE
+\\varTheta                  <char-0x003F4>               " ϴ          : GREEK CAPITAL THETA SYMBOL
+\\varbarwedge               <char-0x02305>               " ⌅          : PROJECTIVE
+\\varcarriagereturn         <char-0x023CE>               " ⏎          : RETURN SYMBOL
+\\varclubsuit               <char-0x02667>               " ♧          : WHITE CLUB SUIT
+\\vardiamondsuit            <char-0x02666>               " ♦          : BLACK DIAMOND SUIT
+\\vardoublebarwedge         <char-0x02306>               " ⌆          : PERSPECTIVE
+\\varepsilon                <char-0x003B5>               " ε          : GREEK SMALL LETTER EPSILON
+\\varheartsuit              <char-0x02665>               " ♥          : BLACK HEART SUIT
+\\varhexagon                <char-0x02B21>               " ⬡          : WHITE HEXAGON
+\\varhexagon<Tab>           <char-0x02B21>               " ⬡          : WHITE HEXAGON
+\\varhexagonb               \\varhexagonb                "            : (Incomplete sequence)
+\\varhexagonblack           <char-0x02B22>               " ⬢          : BLACK HEXAGON
+\\varhexagonl               \\varhexagonl                "            : (Incomplete sequence)
+\\varhexagonlrbonds         <char-0x0232C>               " ⌬          : BENZENE RING
+\\varisinobar               <char-0x022F6>               " ⋶          : ELEMENT OF WITH OVERBAR
+\\varisins                  <char-0x022F3>               " ⋳          : ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
+\\varkappa                  <char-0x003F0>               " ϰ          : GREEK KAPPA SYMBOL / GREEK SMALL LETTER SCRIPT KAPPA
+\\varlrtriangle             <char-0x022BF>               " ⊿          : RIGHT TRIANGLE
+\\varniobar                 <char-0x022FD>               " ⋽          : CONTAINS WITH OVERBAR
+\\varnis                    <char-0x022FB>               " ⋻          : CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
+\\varnothing                <char-0x02205>               " ∅          : EMPTY SET
+\\varointclockwise          <char-0x02232>               " ∲          : CLOCKWISE CONTOUR INTEGRAL
+\\varphi                    <char-0x003C6>               " φ          : GREEK SMALL LETTER PHI
+\\varpi                     <char-0x003D6>               " ϖ          : GREEK PI SYMBOL / GREEK SMALL LETTER OMEGA PI
+\\varrho                    <char-0x003F1>               " ϱ          : GREEK RHO SYMBOL / GREEK SMALL LETTER TAILED RHO
+\\varsigma                  <char-0x003C2>               " ς          : GREEK SMALL LETTER FINAL SIGMA
+\\varspadesuit              <char-0x02664>               " ♤          : WHITE SPADE SUIT
+\\varstar                   <char-0x02736>               " ✶          : SIX POINTED BLACK STAR
+\\varsubsetneqq             <char-0x0228A><char-0x0FE00> " ⊊︀         : SUBSET OF WITH NOT EQUAL TO / SUBSET OF OR NOT EQUAL TO + VARIATION SELECTOR-1
+\\varsupsetneq              <char-0x0228B><char-0x0FE00> " ⊋︀         : SUPERSET OF WITH NOT EQUAL TO / SUPERSET OF OR NOT EQUAL TO + VARIATION SELECTOR-1
+\\vartheta                  <char-0x003D1>               " ϑ          : GREEK THETA SYMBOL / GREEK SMALL LETTER SCRIPT THETA
+\\vartriangle               <char-0x025B5>               " ▵          : WHITE UP-POINTING SMALL TRIANGLE / WHITE UP POINTING SMALL TRIANGLE
+\\vartriangle<Tab>          <char-0x025B5>               " ▵          : WHITE UP-POINTING SMALL TRIANGLE / WHITE UP POINTING SMALL TRIANGLE
+\\vartrianglel              \\vartrianglel               "            : (Incomplete sequence)
+\\vartriangleleft           <char-0x022B2>               " ⊲          : NORMAL SUBGROUP OF
+\\vartriangler              \\vartriangler               "            : (Incomplete sequence)
+\\vartriangleright          <char-0x022B3>               " ⊳          : CONTAINS AS NORMAL SUBGROUP
+\\varveebar                 <char-0x02A61>               " ⩡          : SMALL VEE WITH UNDERBAR
+\\vdash                     <char-0x022A2>               " ⊢          : RIGHT TACK
+\\vdots                     <char-0x022EE>               " ⋮          : VERTICAL ELLIPSIS
+\\vec                       <char-0x020D7>               " ◌⃗         : COMBINING RIGHT ARROW ABOVE / NON-SPACING RIGHT ARROW ABOVE
+\\vee                       <char-0x02228>               " ∨          : LOGICAL OR
+\\vee<Tab>                  <char-0x02228>               " ∨          : LOGICAL OR
+\\veeb                      \\veeb                       "            : (Incomplete sequence)
+\\veebar                    <char-0x022BB>               " ⊻          : XOR
+\\veed                      \\veed                       "            : (Incomplete sequence)
+\\veedoublebar              <char-0x02A63>               " ⩣          : LOGICAL OR WITH DOUBLE UNDERBAR
+\\veee                      \\veee                       "            : (Incomplete sequence)
+\\veeeq                     <char-0x0225A>               " ≚          : EQUIANGULAR TO
+\\veem                      \\veem                       "            : (Incomplete sequence)
+\\veemidvert                <char-0x02A5B>               " ⩛          : LOGICAL OR WITH MIDDLE STEM
+\\veeo                      \\veeo                       "            : (Incomplete sequence)
+\\veeodot                   <char-0x02A52>               " ⩒          : LOGICAL OR WITH DOT ABOVE
+\\venus                     <char-0x02640>               " ♀          : FEMALE SIGN
+\\verti                     <char-0x002CC>               " ˌ          : MODIFIER LETTER LOW VERTICAL LINE
+\\vertoverlay               <char-0x020D2>               " ◌⃒         : COMBINING LONG VERTICAL LINE OVERLAY / NON-SPACING LONG VERTICAL BAR OVERLAY
+\\verts                     <char-0x002C8>               " ˈ          : MODIFIER LETTER VERTICAL LINE
+\\verymuchless              <char-0x022D8>               " ⋘          : VERY MUCH LESS-THAN / VERY MUCH LESS THAN
+\\viewdata                  <char-0x02317>               " ⌗          : VIEWDATA SQUARE
+\\virgo                     <char-0x0264D>               " ♍          : VIRGO
+\\visiblespace              <char-0x02423>               " ␣          : OPEN BOX
+\\vrectangleblack           <char-0x025AE>               " ▮          : BLACK VERTICAL RECTANGLE
+\\vrecto                    <char-0x025AF>               " ▯          : WHITE VERTICAL RECTANGLE
+\\vysmblkcircle             <char-0x02219>               " ∙          : BULLET OPERATOR
+\\vysmblksquare             <char-0x02B1D>               " ⬝          : BLACK VERY SMALL SQUARE
+\\vysmwhtsquare             <char-0x02B1E>               " ⬞          : WHITE VERY SMALL SQUARE
+\\wedge                     <char-0x02227>               " ∧          : LOGICAL AND
+\\wedge<Tab>                <char-0x02227>               " ∧          : LOGICAL AND
+\\wedged                    \\wedged                     "            : (Incomplete sequence)
+\\wedgedot                  <char-0x027D1>               " ⟑          : AND WITH DOT
+\\wedgedoublebar            <char-0x02A60>               " ⩠          : LOGICAL AND WITH DOUBLE UNDERBAR
+\\wedgem                    \\wedgem                     "            : (Incomplete sequence)
+\\wedgemidvert              <char-0x02A5A>               " ⩚          : LOGICAL AND WITH MIDDLE STEM
+\\wedgeo                    \\wedgeo                     "            : (Incomplete sequence)
+\\wedgeodot                 <char-0x02A51>               " ⩑          : LOGICAL AND WITH DOT ABOVE
+\\wedgeonwedge              <char-0x02A55>               " ⩕          : TWO INTERSECTING LOGICAL AND
+\\wedgeq                    <char-0x02259>               " ≙          : ESTIMATES
+\\whitearrowupfrombar       <char-0x021EA>               " ⇪          : UPWARDS WHITE ARROW FROM BAR / WHITE UP ARROW FROM BAR
+\\whiteinwhitetriangle      <char-0x027C1>               " ⟁          : WHITE TRIANGLE CONTAINING SMALL WHITE TRIANGLE
+\\whitepointerleft          <char-0x025C5>               " ◅          : WHITE LEFT-POINTING POINTER / WHITE LEFT POINTING POINTER
+\\whitepointerright         <char-0x025BB>               " ▻          : WHITE RIGHT-POINTING POINTER / WHITE RIGHT POINTING POINTER
+\\whthorzoval               <char-0x02B2D>               " ⬭          : WHITE HORIZONTAL ELLIPSE
+\\whtvertoval               <char-0x02B2F>               " ⬯          : WHITE VERTICAL ELLIPSE
+\\wideangledown             <char-0x029A6>               " ⦦          : OBLIQUE ANGLE OPENING UP
+\\wideangleup               <char-0x029A7>               " ⦧          : OBLIQUE ANGLE OPENING DOWN
+\\widebridgeabove           <char-0x020E9>               " ◌⃩         : COMBINING WIDE BRIDGE ABOVE
+\\wideutilde                <char-0x00330>               " ◌̰         : COMBINING TILDE BELOW / NON-SPACING TILDE BELOW
+\\wp                        <char-0x02118>               " ℘          : SCRIPT CAPITAL P / SCRIPT P
+\\wr                        <char-0x02240>               " ≀          : WREATH PRODUCT
+\\xi                        <char-0x003BE>               " ξ          : GREEK SMALL LETTER XI
+\\xor                       <char-0x022BB>               " ⊻          : XOR
+\\xrat                      <char-0x0211E>               " ℞          : PRESCRIPTION TAKE
+\\yen                       <char-0x000A5>               " ¥          : YEN SIGN
+\\yogh                      <char-0x00292>               " ʒ          : LATIN SMALL LETTER EZH / LATIN SMALL LETTER YOGH
+\\zeta                      <char-0x003B6>               " ζ          : GREEK SMALL LETTER ZETA
+" ------------------------- ---------------------------- " ---------- : --------------------------------------------------------------------------------------------------------
+
+" Below here is the script that was used to produce this file.
+
+"> #!/bin/env julia
+"> 
+"> import REPL
+"> 
+"> const filename = "latex2unicode_utf-8"
+"> const include_emoji = false # set this to true if you want to keymap empjis as well
+"> 
+"> # We want to avoid situations in which the user types e.g. \delt and pauses,
+"> # and the result is "∇t" because "\del" gets recognized and then there is some leftover "t".
+"> # This allows us to get completions with <Tab> for example.
+"> function fix_completions(completions::Dict{String,String})
+">     allinputs = sort!(collect(keys(completions)))
+">     new_completions = copy(completions)
+"> 
+">     for input in allinputs
+">         chars = completions[input]
+">         l = length(input)
+">         longer = filter(x->startswith(x, input)&&length(x)>l, allinputs)
+">         n = length(longer)
+">         n == 0 && continue
+">         new_completions[input * "<Tab>"] = chars
+">         for other in longer
+">             add = other[1:(l+1)]
+">             get!(new_completions, add, add)
+">         end
+">     end
+">     return new_completions
+"> end
+"> 
+"> function unicode_data()
+">     file = normpath(Sys.BINDIR, "..", "..", "doc", "UnicodeData.txt")
+">     names = Dict{UInt32, String}()
+">     open(file) do unidata
+">         for line in readlines(unidata)
+">             id, name, desc = split(line, ";")[[1, 2, 11]]
+">             codepoint = parse(UInt32, "0x$id")
+">             names[codepoint] = (name == "" ? desc : desc == "" ? name : "$name / $desc")
+">         end
+">     end
+">     return names
+"> end
+"> 
+"> # Prepend a dotted circle ('◌' i.e. '\u25CC') to combining characters
+"> function fix_combining_chars(char)
+">     cat = Base.Unicode.category_code(char)
+">     return string(cat == 6 || cat == 8 ? "◌" : "", char)
+"> end
+"> 
+"> function table_entries(completions::Dict{String,String}, unicode_dict)
+">     latex = String[]
+">     code = String[]
+">     unicode = String[]
+">     desc = String[]
+"> 
+">     for (input, chars) in sort!(collect(completions))
+">         code_points, unicode_names, characters = String[], String[], String[]
+">         if startswith(chars, "\\")
+">             push!(code_points, replace(chars, "\\" => "\\\\"))
+">             push!(unicode_names, "(Incomplete sequence)")
+">             push!(characters, "")
+">         else
+">             for char in chars
+">                 push!(code_points, "<char-0x$(uppercase(string(UInt32(char), base = 16, pad = 5)))>")
+">                 push!(unicode_names, get(unicode_dict, UInt32(char), "(No Unicode name)"))
+">                 push!(characters, isempty(characters) ? fix_combining_chars(char) : "$char")
+">             end
+">         end
+">         push!(latex, replace(input, "\\"=>"\\\\"))
+">         push!(code, join(code_points))
+">         push!(unicode, join(characters))
+">         push!(desc, join(unicode_names, " + "))
+">     end
+">     return latex, code, unicode, desc
+"> end
+"> 
+"> open("$filename.vim","w") do f
+">     print(f, """
+">         " This file is autogenerated from the script '$(basename(Base.source_path()))'
+">         " The symbols are based on Julia version $VERSION
+">         " The full generating script can be found in the comments at the bottom of this file,
+">         " and it can be extracted with:
+">         "
+">         "     \$ grep '^\">' $filename.vim | cut -c4- > '$(basename(Base.source_path()))'
+">         "
+">         " To produce this keymap file you need to have Julia compilied from source, and
+">         " to run `make deps` inside Julia's `doc` directory.
+">         " Then you can run:
+">         "
+">         "     \$ julia $(basename(Base.source_path()))
+">         "
+"> 
+">         scriptencoding utf-8
+"> 
+">         let b:keymap_name = "L2U"
+">         loadkeymap
+"> 
+">         """)
+"> 
+">     col_headers = ["\" Tab completion sequence", "Code point", "Character", "Unicode name"]
+"> 
+">     orig_completions = include_emoji ? merge(
+">                 REPL.REPLCompletions.latex_symbols,
+">                 REPL.REPLCompletions.emoji_symbols
+">                 ) :
+">                 REPL.REPLCompletions.latex_symbols
+"> 
+">     latex, code, unicode, desc =
+">         table_entries(
+">             fix_completions(orig_completions),
+">             unicode_data()
+">             )
+"> 
+">     lw = max(length(col_headers[3]), maximum(map(length, latex)))
+">     cw = max(length(col_headers[1]), maximum(map(length, code)))
+">     uw = max(length(col_headers[2]), maximum(map(length, unicode)))
+">     dw = max(length(col_headers[4]), maximum(map(length, desc)))
+"> 
+">     print_padded(l, c, u, d) = println(f, rpad(l, lw), " ", rpad(c, cw), " \" ", rpad(u, uw), " : ", d)
+"> 
+">     print_padded(col_headers...)
+">     print_padded("\" " * "-"^(lw-2), "-"^cw, "-"^uw, "-"^dw)
+"> 
+">     for (l, c, u, d) in zip(latex, code, unicode, desc)
+">         print_padded(l, c, u, d)
+">     end
+">     print_padded("\" " * "-"^(lw-2), "-"^cw, "-"^uw, "-"^dw)
+"> 
+">     print(f, """
+"> 
+">         " Below here is the script that was used to produce this file.
+"> 
+">         """)
+">     for l in readlines(Base.source_path())
+">         println(f, "\"> ", l)
+">     end
+">     println(f)
+"> end
+
Index: /issm/trunk/externalpackages/vim/addons/vim/syntax/julia.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/syntax/julia.vim	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/syntax/julia.vim	(revision 26744)
@@ -0,0 +1,557 @@
+" Vim syntax file
+" Language:	julia
+" Maintainer:	Carlo Baldassi <carlobaldassi@gmail.com>
+" Last Change:	2013 feb 11
+
+if version < 600
+  syntax clear
+elseif exists("b:current_syntax")
+  finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+if version < 704
+  " this is used to disable regex syntax like `\@3<='
+  " on older vim versions
+  function! s:d(x)
+    return ''
+  endfunction
+else
+  function! s:d(x)
+    return string(a:x)
+  endfunction
+endif
+
+scriptencoding utf-8
+
+let s:julia_spellcheck_strings = get(g:, "julia_spellcheck_strings", 0)
+let s:julia_spellcheck_docstrings = get(g:, "julia_spellcheck_docstrings", 1)
+let s:julia_spellcheck_comments = get(g:, "julia_spellcheck_comments", 1)
+
+let s:julia_highlight_operators = get(g:, "julia_highlight_operators", 1)
+
+" List of characters, up to \UFF, which cannot be used in identifiers.
+" (It includes operator characters; we don't consider them identifiers.)
+" This is used mostly in lookbehinds with `\@<=`, e.g. when we need to check
+" that that we're not in the middle of an identifier.
+" It doesn't include a few characters (spaces and all closing parentheses)
+" because those may or may not be valid in the lookbehind on a case-by-case
+" basis.
+let s:nonid_chars = '\U00-\U08' . '\U0A-\U1F'
+      \           . '\U21-\U28' . '\U2A-\U2F' . '\U3A-\U40' . '\U5B-\U5E' . '\U60' . '\U7B\U7C'
+      \           . '\U7E-\UA1' . '\UA7\UA8' . '\UAB-\UAD' . '\UAF\UB1\UB4' . '\UB6-\UB8' . '\UBB\UBF' . '\UD7\UF7'
+
+" The complete list
+let s:nonidS_chars = '[:space:])\U5D}' . s:nonid_chars
+
+
+" List of all valid operator chars up to \UFF (NOTE: they must all be included
+" in s:nonidS_chars, so that if we include that, then this is redundant)
+" It does not include '!' since it can be used in an identifier.
+" The list contains the following characters: '%&*+-/<=>\\^|~¬±×÷'
+let s:op_chars = '\U25\U26\U2A\U2B\U2D\U2F\U3C-\U3E\U5C\U5E\U7C\U7E\UAC\UB1\UD7\UF7'
+
+" List of all valid operator chars above \UFF
+" Written with ranges for performance reasons
+" The list contains the following characters: '…⁝⅋←↑→↓↔↚↛↜↝↞↠↢↣↤↦↩↪↫↬↮↶↷↺↻↼↽⇀⇁⇄⇆⇇⇉⇋⇌⇍⇎⇏⇐⇒⇔⇚⇛⇜⇝⇠⇢⇴⇵⇶⇷⇸⇹⇺⇻⇼⇽⇾⇿∈∉∊∋∌∍∓∔∗∘∙√∛∜∝∤∥∦∧∨∩∪∷∸∺∻∽∾≀≁≂≃≄≅≆≇≈≉≊≋≌≍≎≏≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≠≡≢≣≤≥≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊂⊃⊄⊅⊆⊇⊈⊉⊊⊋⊍⊎⊏⊐⊑⊒⊓⊔⊕⊖⊗⊘⊙⊚⊛⊜⊞⊟⊠⊡⊢⊣⊩⊬⊮⊰⊱⊲⊳⊴⊵⊶⊷⊻⊼⊽⋄⋅⋆⋇⋉⋊⋋⋌⋍⋎⋏⋐⋑⋒⋓⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋮⋯⋰⋱⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⌿▷⟂⟈⟉⟑⟒⟕⟖⟗⟰⟱⟵⟶⟷⟹⟺⟻⟼⟽⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤈⤉⤊⤋⤌⤍⤎⤏⤐⤑⤒⤓⤔⤕⤖⤗⤘⤝⤞⤟⤠⥄⥅⥆⥇⥈⥉⥊⥋⥌⥍⥎⥏⥐⥑⥒⥓⥔⥕⥖⥗⥘⥙⥚⥛⥜⥝⥞⥟⥠⥡⥢⥣⥤⥥⥦⥧⥨⥩⥪⥫⥬⥭⥮⥯⥰⦷⦸⦼⦾⦿⧀⧁⧡⧣⧤⧥⧴⧶⧷⧺⧻⨇⨈⨝⨟⨢⨣⨤⨥⨦⨧⨨⨩⨪⨫⨬⨭⨮⨰⨱⨲⨳⨴⨵⨶⨷⨸⨹⨺⨻⨼⨽⩀⩁⩂⩃⩄⩅⩊⩋⩌⩍⩎⩏⩐⩑⩒⩓⩔⩕⩖⩗⩘⩚⩛⩜⩝⩞⩟⩠⩡⩢⩣⩦⩧⩪⩫⩬⩭⩮⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫛⫷⫸⫹⫺⬰⬱⬲⬳⬴⬵⬶⬷⬸⬹⬺⬻⬼⬽⬾⬿⭀⭁⭂⭃⭄⭇⭈⭉⭊⭋⭌￩￪￫￬'
+let s:op_chars_wc = '\U2026\U205D\U214B\U2190-\U2194\U219A-\U219E\U21A0\U21A2-\U21A4\U21A6\U21A9-\U21AC\U21AE\U21B6\U21B7\U21BA-\U21BD\U21C0\U21C1\U21C4\U21C6\U21C7\U21C9\U21CB-\U21D0\U21D2\U21D4\U21DA-\U21DD\U21E0\U21E2\U21F4-\U21FF\U2208-\U220D\U2213\U2214\U2217-\U221D\U2224-\U222A\U2237\U2238\U223A\U223B\U223D\U223E\U2240-\U228B\U228D-\U229C\U229E-\U22A3\U22A9\U22AC\U22AE\U22B0-\U22B7\U22BB-\U22BD\U22C4-\U22C7\U22C9-\U22D3\U22D5-\U22FF\U233F\U25B7\U27C2\U27C8\U27C9\U27D1\U27D2\U27D5-\U27D7\U27F0\U27F1\U27F5-\U27F7\U27F9-\U27FF\U2900-\U2918\U291D-\U2920\U2944-\U2970\U29B7\U29B8\U29BC\U29BE-\U29C1\U29E1\U29E3-\U29E5\U29F4\U29F6\U29F7\U29FA\U29FB\U2A07\U2A08\U2A1D\U2A1F\U2A22-\U2A2E\U2A30-\U2A3D\U2A40-\U2A45\U2A4A-\U2A58\U2A5A-\U2A63\U2A66\U2A67\U2A6A-\U2AD9\U2ADB\U2AF7-\U2AFA\U2B30-\U2B44\U2B47-\U2B4C\UFFE9-\UFFEC'
+
+" Full operators regex
+let s:operators = '\%(' . '\.\%([-+*/^÷%|&⊻]\|//\|\\\|>>\|>>>\?\)\?='
+      \         . '\|'  . '[:<>]=\|||\|&&\||>\|<|\|[<>:]:\|<<\|>>>\?\|//\|[-=]>\|\.\.\.\?'
+      \         . '\|'  . '\.\?[!' . s:op_chars . s:op_chars_wc . ']'
+      \         . '\)'
+
+
+" Characters that can be used to start an identifier. Above \UBF we don't
+" bother checking. (If a UTF8 operator is used, it will take precedence anyway.)
+let s:id_charsH = '\%([A-Za-z_\UA2-\UA6\UA9\UAA\UAE\UB0\UB5\UBA]\|[^\U00-\UBF]\)'
+" Characters that can appear in an identifier, starting in 2nd position. Above
+" \UBF we check for operators since we need to stop the identifier if one
+" appears. We don't check for invalid characters though.
+let s:id_charsW = '\%([0-9A-Za-z_!\UA2-\UA6\UA9\UAA\UAE-\UB0\UB2-\UB5\UB8-\UBA\UBC-\UBE]\|[^\U00-\UBF]\@=[^' . s:op_chars_wc . ']\)'
+
+" A valid julia identifier, more or less
+let s:idregex = '\%(' . s:id_charsH . s:id_charsW . '*\)'
+
+
+
+syn case match
+
+syntax cluster juliaExpressions		contains=@juliaParItems,@juliaStringItems,@juliaKeywordItems,@juliaBlocksItems,@juliaTypesItems,@juliaConstItems,@juliaMacroItems,@juliaSymbolItems,@juliaOperatorItems,@juliaNumberItems,@juliaCommentItems,@juliaErrorItems,@juliaSyntaxRegions
+syntax cluster juliaExprsPrintf		contains=@juliaExpressions,@juliaPrintfItems
+syntax cluster juliaExprsNodot		contains=@juliaParItems,@juliaStringItems,@juliaMacroItems,@juliaSymbolItems,@juliaOperatorItems,@juliaCommentItems,juliaIdSymbol
+
+syntax cluster juliaParItems		contains=juliaParBlock,juliaSqBraIdxBlock,juliaSqBraBlock,juliaCurBraBlock,juliaQuotedParBlock,juliaQuotedQMarkPar
+syntax cluster juliaKeywordItems	contains=juliaKeyword,juliaWhereKeyword,juliaImportLine,juliaInfixKeyword,juliaRepKeyword
+syntax cluster juliaBlocksItems		contains=juliaConditionalBlock,juliaWhileBlock,juliaForBlock,juliaBeginBlock,juliaFunctionBlock,juliaMacroBlock,juliaQuoteBlock,juliaTypeBlock,juliaImmutableBlock,juliaExceptionBlock,juliaLetBlock,juliaDoBlock,juliaModuleBlock,juliaStructBlock,juliaMutableStructBlock,juliaAbstractBlock,juliaPrimitiveBlock
+syntax cluster juliaTypesItems		contains=juliaBaseTypeBasic,juliaBaseTypeNum,juliaBaseTypeC,juliaBaseTypeError,juliaBaseTypeIter,juliaBaseTypeString,juliaBaseTypeArray,juliaBaseTypeDict,juliaBaseTypeSet,juliaBaseTypeIO,juliaBaseTypeProcess,juliaBaseTypeRange,juliaBaseTypeRegex,juliaBaseTypeFact,juliaBaseTypeFact,juliaBaseTypeSort,juliaBaseTypeRound,juliaBaseTypeSpecial,juliaBaseTypeRandom,juliaBaseTypeDisplay,juliaBaseTypeTime,juliaBaseTypeOther
+
+syntax cluster juliaConstItems  	contains=juliaConstNum,juliaConstBool,juliaConstEnv,juliaConstMMap,juliaConstC,juliaConstGeneric,juliaConstIO,juliaPossibleEuler
+
+syntax cluster juliaMacroItems		contains=juliaPossibleMacro,juliaDollarVar,juliaDollarPar,juliaDollarSqBra
+syntax cluster juliaSymbolItems		contains=juliaPossibleSymbol
+syntax cluster juliaNumberItems		contains=juliaNumbers
+syntax cluster juliaStringItems		contains=juliaChar,juliaString,juliabString,juliasString,juliaShellString,juliaDocString,juliaRegEx
+syntax cluster juliaPrintfItems		contains=juliaPrintfParBlock,juliaPrintfString
+syntax cluster juliaOperatorItems	contains=juliaOperator,juliaRangeOperator,juliaCTransOperator,juliaTernaryRegion,juliaColon,juliaSemicolon,juliaComma
+syntax cluster juliaCommentItems	contains=juliaCommentL,juliaCommentM
+syntax cluster juliaErrorItems		contains=juliaErrorPar,juliaErrorEnd,juliaErrorElse,juliaErrorCatch,juliaErrorFinally
+
+syntax cluster juliaSyntaxRegions	contains=juliaIdSymbol,juliaTypeOperatorR2,juliaTypeOperatorR3,juliaWhereR,juliaDotted
+
+syntax cluster juliaSpellcheckStrings		contains=@spell
+syntax cluster juliaSpellcheckDocStrings	contains=@spell
+syntax cluster juliaSpellcheckComments		contains=@spell
+
+if !s:julia_spellcheck_docstrings
+  syntax cluster juliaSpellcheckDocStrings	remove=@spell
+endif
+if !s:julia_spellcheck_strings
+  syntax cluster juliaSpellcheckStrings		remove=@spell
+endif
+if !s:julia_spellcheck_comments
+  syntax cluster juliaSpellcheckComments	remove=@spell
+endif
+
+syntax match   juliaSemicolon		display ";"
+syntax match   juliaComma		display ","
+syntax match   juliaColon		display ":"
+
+" A dot can introduce a sort of 'environment' such that words after it are not
+" recognized as keywords. This has low precedence so that it can be overridden
+" by operators
+syntax match   juliaDotted		transparent "\.\s*[^])}.]" contains=@juliaExprsNodot
+syntax match   juliaDottedT		contained transparent "\.\s*[^])}.]" contains=@juliaExprsNodot,juliaType
+
+syntax match   juliaErrorPar		display "[])}]"
+syntax match   juliaErrorEnd		display "\<end\>"
+syntax match   juliaErrorElse		display "\<\%(else\|elseif\)\>"
+syntax match   juliaErrorCatch		display "\<catch\>"
+syntax match   juliaErrorFinally	display "\<finally\>"
+syntax match   juliaErrorSemicol	display contained ";"
+
+syntax region  juliaParBlock		matchgroup=juliaParDelim start="(" end=")" contains=@juliaExpressions,juliaComprehensionFor
+syntax region  juliaParBlockInRange	matchgroup=juliaParDelim contained start="(" end=")" contains=@juliaExpressions,juliaParBlockInRange,juliaRangeKeyword,juliaComprehensionFor
+syntax region  juliaSqBraIdxBlock	matchgroup=juliaParDelim start="\[" end="\]" contains=@juliaExpressions,juliaParBlockInRange,juliaRangeKeyword,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS
+exec 'syntax region  juliaSqBraBlock	matchgroup=juliaParDelim start="\%(^\|\s\|' . s:operators . '\)\@'.s:d(3).'<=\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS'
+syntax region  juliaCurBraBlock		matchgroup=juliaParDelim start="{" end="}" contains=juliaType,juliaDottedT,@juliaExpressions
+
+exec 'syntax match   juliaType		contained "\%(' . s:idregex . '\.\)*\zs' . s:idregex . '"'
+
+" This is a generic identifier followed by some symbol, either a type
+" operator (<: or >:), or an open parenthesis, or an open curly bracket.
+" It's used to recognize one of the contained regions looking for identifiers
+" only once. Once recognized, those regions no longer need to use the
+" expensive s:idregex.
+exec 'syntax match   juliaIdSymbol	transparent "' . s:idregex . '\%(\s*[<>]:\|\.\?(\|{\|\"\)\@=" contains=juliaFunctionCall,juliaParamType,juliaStringPrefixed,juliaTypeOperatorR1'
+
+syntax match  juliaFunctionCall		contained "[^{([:space:]<>\"]\+(\@=" nextgroup=juliaParBlock
+
+exec 'syntax match   juliaFunctionDef	contained transparent "\%(\<\%(function\|macro\)\)\@'.s:d(8).'<=\s\+\zs' . s:idregex . '\%(\.' . s:idregex . '\)*\ze\s*\%((\|\send\>\|$\)" contains=juliaFunctionName'
+exec 'syntax match   juliaFunctionName	contained "\%(\<\%(function\|macro\)\s\+\)\@'.s:d(20).'<=\%(' . s:idregex . '\.\)*\zs' . s:idregex . '"'
+
+exec 'syntax match   juliaStructR	contained transparent "\%(\<\%(\%(mutable\s\+\)\?struct\|\%(abstract\|primitive\)\s\+type\)\s\+\)\@'.s:d(20).'<=\%(' . s:idregex . '\.\)*' . s:idregex . '\>\(\s*(\)\@!" contains=juliaType'
+
+syntax match   juliaKeyword		display "\<\%(return\|local\|global\|const\)\>"
+syntax match   juliaInfixKeyword	display "\%(=\s*\)\@<!\<\%(in\|isa\)\>\S\@!\%(\s*=\)\@!"
+
+" The import/export/using keywords introduce a sort of special parsing
+" environment with its own rules
+exec 'syntax region  juliaImportLine		matchgroup=juliaKeyword excludenl start="\<\%(import\|using\|export\)\>" skip="\%(\%(\<\%(import\|using\|export\)\>\)\|^\)\@'.s:d(6).'<=$" end="$" end="\%([])}]\)\@=" contains=@juliaExpressions,juliaAsKeyword,@juliaContinuationItems,juliaMacroName'
+syntax match   juliaAsKeyword		display contained "\<as\>"
+
+syntax match   juliaRepKeyword		display "\<\%(break\|continue\)\>"
+syntax region  juliaConditionalBlock	matchgroup=juliaConditional start="\<if\>" end="\<end\>" contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock fold
+syntax region  juliaConditionalEIBlock	matchgroup=juliaConditional transparent contained start="\<elseif\>" end="\<\%(end\|else\|elseif\)\>"me=s-1 contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock
+syntax region  juliaConditionalEBlock	matchgroup=juliaConditional transparent contained start="\<else\>" end="\<end\>"me=s-1 contains=@juliaExpressions
+syntax region  juliaWhileBlock		matchgroup=juliaRepeat start="\<while\>" end="\<end\>" contains=@juliaExpressions fold
+syntax region  juliaForBlock		matchgroup=juliaRepeat start="\<for\>" end="\<end\>" contains=@juliaExpressions,juliaOuter fold
+syntax region  juliaBeginBlock		matchgroup=juliaBlKeyword start="\<begin\>" end="\<end\>" contains=@juliaExpressions fold
+syntax region  juliaFunctionBlock	matchgroup=juliaBlKeyword start="\<function\>" end="\<end\>" contains=@juliaExpressions,juliaFunctionDef fold
+syntax region  juliaMacroBlock		matchgroup=juliaBlKeyword start="\<macro\>" end="\<end\>" contains=@juliaExpressions,juliaFunctionDef fold
+syntax region  juliaQuoteBlock		matchgroup=juliaBlKeyword start="\<quote\>" end="\<end\>" contains=@juliaExpressions fold
+syntax region  juliaStructBlock		matchgroup=juliaBlKeyword start="\<struct\>" end="\<end\>" contains=@juliaExpressions,juliaStructR fold
+syntax region  juliaMutableStructBlock	matchgroup=juliaBlKeyword start="\<mutable\s\+struct\>" end="\<end\>" contains=@juliaExpressions,juliaStructR fold
+syntax region  juliaLetBlock		matchgroup=juliaBlKeyword start="\<let\>" end="\<end\>" contains=@juliaExpressions fold
+syntax region  juliaDoBlock		matchgroup=juliaBlKeyword start="\<do\>" end="\<end\>" contains=@juliaExpressions fold
+syntax region  juliaModuleBlock		matchgroup=juliaBlKeyword start="\<\%(bare\)\?module\>" end="\<end\>" contains=@juliaExpressions fold
+syntax region  juliaExceptionBlock	matchgroup=juliaException start="\<try\>" end="\<end\>" contains=@juliaExpressions,juliaCatchBlock,juliaFinallyBlock fold
+syntax region  juliaCatchBlock		matchgroup=juliaException transparent contained start="\<catch\>" end="\<end\>"me=s-1 contains=@juliaExpressions,juliaFinallyBlock
+syntax region  juliaFinallyBlock	matchgroup=juliaException transparent contained start="\<finally\>" end="\<end\>"me=s-1 contains=@juliaExpressions
+syntax region  juliaAbstractBlock	matchgroup=juliaBlKeyword start="\<abstract\s\+type\>" end="\<end\>" fold contains=@juliaExpressions,juliaStructR
+syntax region  juliaPrimitiveBlock	matchgroup=juliaBlKeyword start="\<primitive\s\+type\>" end="\<end\>" fold contains=@juliaExpressions,juliaStructR
+
+exec 'syntax region  juliaComprehensionFor	matchgroup=juliaComprehensionFor transparent contained start="\%([^[:space:],;:({[]\_s*\)\@'.s:d(80).'<=\<for\>" end="\ze[]);]" contains=@juliaExpressions,juliaComprehensionIf,juliaComprehensionFor'
+syntax match   juliaComprehensionIf	contained "\<if\>"
+
+exec 'syntax match   juliaOuter		contained "\<outer\ze\s\+' . s:idregex . '\>"'
+
+syntax match   juliaRangeKeyword	contained "\<\%(begin\|end\)\>"
+
+syntax match   juliaBaseTypeBasic	display "\<\%(\%(N\|Named\)\?Tuple\|Symbol\|Function\|Union\%(All\)\?\|Type\%(Name\|Var\)\?\|Any\|ANY\|Vararg\|Ptr\|Exception\|Module\|Expr\|DataType\|\%(LineNumber\|Quote\)Node\|\%(Weak\|Global\)\?Ref\|Method\|Pair\|Val\|Nothing\|Some\|Missing\)\>"
+syntax match   juliaBaseTypeNum		display "\<\%(U\?Int\%(8\|16\|32\|64\|128\)\?\|Float\%(16\|32\|64\)\|Complex\|Bool\|Char\|Number\|Signed\|Unsigned\|Integer\|AbstractFloat\|Real\|Rational\|\%(Abstract\)\?Irrational\|Enum\|BigInt\|BigFloat\|MathConst\|ComplexF\%(16\|32\|64\)\)\>"
+syntax match   juliaBaseTypeC		display "\<\%(FileOffset\|C\%(u\?\%(char\|short\|int\|long\(long\)\?\|w\?string\)\|float\|double\|\%(ptrdiff\|s\?size\|wchar\|off\|u\?intmax\)_t\|void\)\)\>"
+syntax match   juliaBaseTypeError	display "\<\%(\%(Bounds\|Divide\|Domain\|\%(Stack\)\?Overflow\|EOF\|Undef\%(Ref\|Var\)\|System\|Type\|Parse\|Argument\|Key\|Load\|Method\|Inexact\|OutOfMemory\|Init\|Assertion\|ReadOnlyMemory\|StringIndex\)Error\|\%(Interrupt\|Error\|ProcessExited\|Captured\|Composite\|InvalidState\|Missing\|\%(Process\|Task\)Failed\)Exception\|DimensionMismatch\|SegmentationFault\)\>"
+syntax match   juliaBaseTypeIter	display "\<\%(EachLine\|Enumerate\|Cartesian\%(Index\|Range\)\|LinSpace\|CartesianIndices\)\>"
+syntax match   juliaBaseTypeString	display "\<\%(DirectIndex\|Sub\|Rep\|Rev\|Abstract\|Substitution\)\?String\>"
+syntax match   juliaBaseTypeArray	display "\<\%(\%(Sub\)\?Array\|\%(Abstract\|Dense\|Strided\)\?\%(Array\|Matrix\|Vec\%(tor\|OrMat\)\)\|SparseMatrixCSC\|\%(AbstractSparse\|Bit\|Shared\)\%(Array\|Vector\|Matrix\)\|\%\(D\|Bid\|\%(Sym\)\?Trid\)iagonal\|Hermitian\|Symmetric\|UniformScaling\|\%(Lower\|Upper\)Triangular\|\%(Sparse\|Row\)Vector\|VecElement\|Conj\%(Array\|Matrix\|Vector\)\|Index\%(Cartesian\|Linear\|Style\)\|PermutedDimsArray\|Broadcasted\|Adjoint\|Transpose\|LinearIndices\)\>"
+syntax match   juliaBaseTypeDict	display "\<\%(WeakKey\|Id\|Abstract\)\?Dict\>"
+syntax match   juliaBaseTypeSet		display "\<\%(\%(Abstract\|Bit\)\?Set\)\>"
+syntax match   juliaBaseTypeIO		display "\<\%(IO\%(Stream\|Buffer\|Context\)\?\|RawFD\|StatStruct\|FileMonitor\|PollingFileWatcher\|Timer\|Base64\%(Decode\|Encode\)Pipe\|\%(UDP\|TCP\)Socket\|\%(Abstract\)\?Channel\|BufferStream\|ReentrantLock\|GenericIOBuffer\)\>"
+syntax match   juliaBaseTypeProcess	display "\<\%(Pipe\|Cmd\|PipeBuffer\)\>"
+syntax match   juliaBaseTypeRange	display "\<\%(Dims\|RangeIndex\|\%(Abstract\|Lin\|Ordinal\|Step\|\%(Abstract\)\?Unit\)Range\|Colon\|ExponentialBackOff\|StepRangeLen\)\>"
+syntax match   juliaBaseTypeRegex	display "\<Regex\%(Match\)\?\>"
+syntax match   juliaBaseTypeFact	display "\<\%(Factorization\|BunchKaufman\|\%(Cholesky\|QR\)\%(Pivoted\)\?\|\%(Generalized\)\?\%(Eigen\|SVD\|Schur\)\|Hessenberg\|LDLt\|LQ\|LU\)\>"
+syntax match   juliaBaseTypeSort	display "\<\%(Insertion\|\(Partial\)\?Quick\|Merge\)Sort\>"
+syntax match   juliaBaseTypeRound	display "\<Round\%(ingMode\|FromZero\|Down\|Nearest\%(Ties\%(Away\|Up\)\)\?\|ToZero\|Up\)\>"
+syntax match   juliaBaseTypeSpecial	display "\<\%(LocalProcess\|ClusterManager\)\>"
+syntax match   juliaBaseTypeRandom	display "\<\%(AbstractRNG\|MersenneTwister\|RandomDevice\)\>"
+syntax match   juliaBaseTypeDisplay	display "\<\%(Text\(Display\)\?\|\%(Abstract\)\?Display\|MIME\|HTML\)\>"
+syntax match   juliaBaseTypeTime	display "\<\%(Date\%(Time\)\?\|DateFormat\)\>"
+syntax match   juliaBaseTypeOther	display "\<\%(RemoteRef\|Task\|Condition\|VersionNumber\|IPv[46]\|SerializationState\|WorkerConfig\|Future\|RemoteChannel\|IPAddr\|Stack\%(Trace\|Frame\)\|\(Caching\|Worker\)Pool\|AbstractSerializer\)\>"
+
+syntax match   juliaConstNum		display "\%(\<\%(\%(NaN\|Inf\)\%(16\|32\|64\)\?\|pi\|π\)\>\)"
+" Note: recognition of ℯ, which Vim does not consider a valid identifier, is
+" complicated. We detect possible uses by just looking for the character (for
+" performance) and then check that it's actually used by its own.
+" (This also tries to detect preceding number constants; it does so in a crude
+" way.)
+syntax match   juliaPossibleEuler	"ℯ" contains=juliaEuler
+exec 'syntax match   juliaEuler		contained "\%(\%(^\|[' . s:nonidS_chars . s:op_chars_wc . ']\)\%(.\?[0-9][.0-9eEf_]*\d\)\?\)\@'.s:d(80).'<=ℯ\ze[' . s:nonidS_chars . s:op_chars_wc . ']"'
+syntax match   juliaConstBool		display "\<\%(true\|false\)\>"
+syntax match   juliaConstEnv		display "\<\%(ARGS\|ENV\|ENDIAN_BOM\|LOAD_PATH\|VERSION\|PROGRAM_FILE\|DEPOT_PATH\)\>"
+syntax match   juliaConstIO		display "\<\%(std\%(out\|in\|err\)\|devnull\)\>"
+syntax match   juliaConstC		display "\<\%(C_NULL\)\>"
+syntax match   juliaConstGeneric	display "\<\%(nothing\|Main\|undef\|missing\)\>"
+
+syntax match   juliaParamType		contained "[^{([:space:]<>\"]\+\ze{" nextgroup=juliaCurBraBlock
+
+syntax match   juliaPossibleMacro	transparent "@" contains=juliaMacroCall,juliaMacroCallP,juliaPrintfMacro,juliaDocMacro,juliaDocMacroPre
+
+exec 'syntax match   juliaMacro		contained "@' . s:idregex . '\%(\.' . s:idregex . '\)*"'
+syntax match   juliaMacro		contained "@[!.~$%^*/\\|<>+-]\ze[^0-9]"
+exec 'syntax region  juliaMacroCall	contained transparent start="\(@' . s:idregex . '\%(\.' . s:idregex . '\)*\)\@=\1\%([^(]\|$\)" end="\ze\%([])};#]\|$\|\<for\>\|\<end\>\)" contains=@juliaExpressions,juliaMacro,juliaSymbolS,juliaQuotedParBlockS'
+exec 'syntax region  juliaMacroCall	contained transparent start="\(@.\)\@=\1\%([^(]\|$\)" end="\ze\%([])};#]\|$\|\<for\>\|\<end\>\)" contains=@juliaExpressions,juliaMacro,juliaSymbolS,juliaQuotedParBlockS'
+exec 'syntax region  juliaMacroCallP	contained transparent start="@' . s:idregex . '\%(\.' . s:idregex . '\)*(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaParBlock'
+exec 'syntax region  juliaMacroCallP	contained transparent start="@.(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaParBlock'
+
+exec 'syntax match   juliaNumbers	transparent "\%(^\|[' . s:nonidS_chars . s:op_chars_wc . ']\)\@'.s:d(1).'<=\d\|\.\d\|im\>" contains=juliaNumber,juliaFloat,juliaComplexUnit'
+
+"integer regexes
+let s:dec_regex = '\d\%(_\?\d\)*\%(\>\|im\>\|\ze\D\)'
+let s:hex_regex = '0x\x\%(_\?\x\)*\%(\>\|im\>\|\ze\X\)'
+let s:bin_regex = '0b[01]\%(_\?[01]\)*\%(\>\|im\>\|\ze[^01]\)'
+let s:oct_regex = '0o\o\%(_\?\o\)*\%(\>\|im\>\|\ze\O\)'
+
+let s:int_regex = '\%(' . s:hex_regex
+      \         . '\|'  . s:bin_regex
+      \         . '\|'  . s:oct_regex
+      \         . '\|'  . s:dec_regex
+      \         . '\)'
+
+"floating point regexes
+"  starting with a dot, optional exponent
+let s:float_regex1 = '\.\d\%(_\?\d\)*\%([eEf][-+]\?\d\+\)\?\%(\>\|im\>\|\ze\D\)'
+"  with dot, optional exponent
+let s:float_regex2 = '\d\%(_\?\d\)*\.\%(\d\%(_\?\d\)*\)\?\%([eEf][-+]\?\d\+\)\?\%(\>\|im\>\|\ze\D\)'
+"  without dot, with exponent
+let s:float_regex3 = '\d\%(_\?\d\)*[eEf][-+]\?\d\+\%(\>\|im\>\|\ze\D\)'
+
+"hex floating point numbers
+"  starting with a dot
+let s:hexfloat_regex1 = '0x\.\%\(\x\%(_\?\x\)*\)\?[pP][-+]\?\d\+\%(\>\|im\>\|\ze\X\)'
+"  starting with a digit
+let s:hexfloat_regex2 = '0x\x\%(_\?\x\)*\%\(\.\%\(\x\%(_\?\x\)*\)\?\)\?[pP][-+]\?\d\+\%(\>\|im\>\|\ze\X\)'
+
+let s:float_regex = '\%(' . s:float_regex3
+      \           . '\|'  . s:float_regex2
+      \           . '\|'  . s:float_regex1
+      \           . '\|'  . s:hexfloat_regex2
+      \           . '\|'  . s:hexfloat_regex1
+      \           . '\)'
+
+exec 'syntax match   juliaNumber	contained "' . s:int_regex . '" contains=juliaComplexUnit'
+exec 'syntax match   juliaFloat		contained "' . s:float_regex . '" contains=juliaComplexUnit'
+syntax match   juliaComplexUnit		display	contained "\<im\>"
+
+syntax match   juliaRangeOperator	display ":"
+exec 'syntax match   juliaOperator	"' . s:operators . '"'
+
+exec 'syntax region  juliaTernaryRegion	matchgroup=juliaTernaryOperator start="\s\zs?\ze\s" skip="\%(:\(:\|[^:[:space:]'."'".'"({[]\+\s*\ze:\)\|\%(?\s*\)\@'.s:d(6).'<=:(\)" end=":" contains=@juliaExpressions,juliaErrorSemicol'
+
+let s:interp_dollar = '\([' . s:nonidS_chars . s:op_chars_wc . '!]\|^\)\@'.s:d(1).'<=\$'
+
+exec 'syntax match   juliaDollarVar	display contained "' . s:interp_dollar . s:idregex . '"'
+exec 'syntax region  juliaDollarPar	matchgroup=juliaDollarVar contained start="' .s:interp_dollar . '(" end=")" contains=@juliaExpressions'
+exec 'syntax region  juliaDollarSqBra	matchgroup=juliaDollarVar contained start="' .s:interp_dollar . '\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS'
+
+syntax match   juliaChar		"'\\\?.'" contains=juliaSpecialChar
+syntax match   juliaChar		display "'\\\o\{3\}'" contains=juliaOctalEscapeChar
+syntax match   juliaChar		display "'\\x\x\{2\}'" contains=juliaHexEscapeChar
+syntax match   juliaChar		display "'\\u\x\{1,4\}'" contains=juliaUniCharSmall
+syntax match   juliaChar		display "'\\U\x\{1,8\}'" contains=juliaUniCharLarge
+
+exec 'syntax match   juliaCTransOperator	"[[:space:]}' . s:nonid_chars . s:op_chars_wc . '!]\@'.s:d(1).'<!\.\?' . "'" . 'ᵀ\?"'
+
+" TODO: some of these might be specialized; the rest could be just left to the
+"       generic juliaStringPrefixed fallback
+syntax region  juliaString		matchgroup=juliaStringDelim start=+\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaStringVars,@juliaSpecialChars,@juliaSpellcheckStrings
+syntax region  juliaStringPrefixed	contained matchgroup=juliaStringDelim start=+[^{([:space:]<>"]\+\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialCharsRaw
+syntax region  juliabString		matchgroup=juliaStringDelim start=+\<b\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialChars
+syntax region  juliasString		matchgroup=juliaStringDelim start=+\<s\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialChars
+
+syntax region  juliaDocString		matchgroup=juliaDocStringDelim fold start=+^"""+ skip=+\%(\\\\\)*\\"+ end=+"""+ contains=@juliaStringVars,@juliaSpecialChars,@juliaSpellcheckDocStrings
+
+exec 'syntax region  juliaPrintfMacro		contained transparent start="@s\?printf(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaPrintfParBlock'
+syntax region  juliaPrintfMacro		contained transparent start="@s\?printf\s\+" end="\ze\%([])};#]\|$\|\<for\>\)" contains=@juliaExprsPrintf,juliaMacro,juliaSymbolS,juliaQuotedParBlockS
+syntax region  juliaPrintfParBlock	contained matchgroup=juliaParDelim start="(" end=")" contains=@juliaExprsPrintf
+syntax region  juliaPrintfString	contained matchgroup=juliaStringDelim start=+"+ skip=+\%(\\\\\)*\\"+ end=+"+ contains=@juliaSpecialChars,@juliaPrintfChars
+
+exec 'syntax region  juliaDocMacroPre	contained transparent start=+@doc\s\+\%(' . s:idregex . '\%(\.' . s:idregex . '\)*\)\z("\%(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\(\z1\)\@'.s:d(3).'<=+ contains=juliaMacro,juliaDocStringMRaw'
+exec 'syntax region  juliaDocMacro	contained transparent start=+@doc\s\+\z("\%(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\(\z1\)\@'.s:d(3).'<=+ contains=juliaMacro,juliaDocStringM'
+syntax region  juliaDocStringMRaw	contained fold matchgroup=juliaDocStringDelim fold start=+\z\("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpellcheckDocStrings
+syntax region  juliaDocStringM		contained fold matchgroup=juliaDocStringDelim fold start=+\z\("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaStringVars,@juliaSpecialChars,@juliaSpellcheckDocStrings
+
+syntax region  juliaShellString		matchgroup=juliaStringDelim start=+`+ skip=+\%(\\\\\)*\\`+ end=+`+ contains=@juliaStringVars,juliaSpecialChar
+
+syntax cluster juliaStringVars		contains=juliaStringVarsPar,juliaStringVarsSqBra,juliaStringVarsCurBra,juliaStringVarsPla
+syntax region  juliaStringVarsPar	contained matchgroup=juliaStringVarDelim start="$(" end=")" contains=@juliaExpressions
+syntax region  juliaStringVarsSqBra	contained matchgroup=juliaStringVarDelim start="$\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS
+syntax region  juliaStringVarsCurBra	contained matchgroup=juliaStringVarDelim start="${" end="}" contains=@juliaExpressions
+exec 'syntax match   juliaStringVarsPla	contained "\$' . s:idregex . '"'
+
+" TODO improve RegEx
+syntax region  juliaRegEx		matchgroup=juliaStringDelim start=+\<r\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1[imsx]*+
+
+syntax cluster juliaSpecialChars	contains=juliaSpecialChar,juliaDoubleBackslash,juliaEscapedQuote,juliaOctalEscapeChar,juliaHexEscapeChar,juliaUniCharSmall,juliaUniCharLarge
+syntax match   juliaSpecialChar		display contained "\\."
+syntax match   juliaOctalEscapeChar	display contained "\\\o\{3\}"
+syntax match   juliaHexEscapeChar	display contained "\\x\x\{2\}"
+syntax match   juliaUniCharSmall	display contained "\\u\x\{1,4\}"
+syntax match   juliaUniCharLarge	display contained "\\U\x\{1,8\}"
+syntax cluster juliaSpecialCharsRaw	contains=juliaDoubleBackslash,juliaEscapedQuote
+syntax match   juliaDoubleBackslash	contained "\\\\"
+syntax match   juliaEscapedQuote	contained "\\\""
+
+syntax cluster juliaPrintfChars		contains=juliaErrorPrintfFmt,juliaPrintfFmt
+syntax match   juliaErrorPrintfFmt	display contained "\\\?%."
+syntax match   juliaPrintfFmt		display contained "%\%(\d\+\$\)\=[-+' #0]*\%(\d*\|\*\|\*\d\+\$\)\%(\.\%(\d*\|\*\|\*\d\+\$\)\)\=\%([hlLjqzt]\|ll\|hh\)\=[aAbdiuoxXDOUfFeEgGcCsSpn]"
+syntax match   juliaPrintfFmt		display contained "%%"
+syntax match   juliaPrintfFmt		display contained "\\%\%(\d\+\$\)\=[-+' #0]*\%(\d*\|\*\|\*\d\+\$\)\%(\.\%(\d*\|\*\|\*\d\+\$\)\)\=\%([hlLjqzt]\|ll\|hh\)\=[aAbdiuoxXDOUfFeEgGcCsSpn]"hs=s+1
+syntax match   juliaPrintfFmt		display contained "\\%%"hs=s+1
+
+" this is used to restrict the search for Symbols to when colons appear at all
+" (for performance reasons)
+syntax match   juliaPossibleSymbol	transparent ":\ze[^:]" contains=juliaSymbol,juliaQuotedParBlock,juliaQuotedQMarkPar,juliaColon
+
+let s:quotable = '\%(' . s:idregex . '\|' . s:operators . '\|[?.]\|' . s:float_regex . '\|' . s:int_regex . '\)'
+let s:quoting_colon = '\%(\%(^\s*\|\s\{6,\}\|[' . s:nonid_chars . s:op_chars_wc . ']\s*\)\@'.s:d(6).'<=\|\%(\<\%(return\|if\|else\%(if\)\?\|while\|try\|begin\)\s\+\)\@'.s:d(9).'<=\)\zs:'
+let s:quoting_colonS = '\s\@'.s:d(1).'<=:'
+
+" note: juliaSymbolS only works within whitespace-sensitive contexts,
+" such as in macro calls without parentheses, or within square brackets.
+" It is used to override the recognition of expressions like `a :b` as
+" ranges rather than symbols in those contexts.
+" (Note that such `a :b` expressions only allows at most 5 spaces between
+" the identifier and the colon anyway.)
+
+exec 'syntax match   juliaSymbol	contained "' . s:quoting_colon . s:quotable . '"'
+exec 'syntax match   juliaSymbolS	contained "' . s:quoting_colonS . s:quotable . '"'
+
+" same as above for quoted expressions such as :(expr)
+exec 'syntax region   juliaQuotedParBlock	matchgroup=juliaQParDelim start="' . s:quoting_colon . '(" end=")" contains=@juliaExpressions'
+exec 'syntax match    juliaQuotedQMarkPar	"' . s:quoting_colon . '(\s*?\s*)" contains=juliaQuotedQMark'
+exec 'syntax region   juliaQuotedParBlockS	matchgroup=juliaQParDelim contained start="' . s:quoting_colonS . '(" end=")" contains=@juliaExpressions'
+
+
+syntax match   juliaTypeOperatorR1	contained "[^{([:space:]<>\"]\+\%(\s*[<>]:\)\@="
+
+" force precedence over Symbols
+syntax match   juliaTypeOperator	contained "[<>:]:"
+exec 'syntax match   juliaTypeOperatorR2	transparent "[<>:]:\s*\%(' . s:idregex . '\.\)*' . s:idregex . '" contains=juliaTypeOperator,juliaType,juliaDottedT,@juliaExpressions nextgroup=juliaTypeOperator'
+syntax match   juliaIsaKeyword		contained "\<isa\>"
+exec 'syntax match   juliaTypeOperatorR3	transparent "\<isa\s\+\%(' . s:idregex . '\.\)*' . s:idregex . '" contains=juliaIsaKeyword,juliaType,juliaDottedT,@juliaExpressions nextgroup=juliaIsaKeyword'
+
+syntax match   juliaWhereKeyword       	"\<where\>"
+exec 'syntax match   juliaWhereR	transparent "\<where\s\+' . s:idregex . '" contains=juliaWhereKeyword,juliaType,juliaDottedT,juliaIdSymbol'
+
+syntax region  juliaCommentL		matchgroup=juliaCommentDelim excludenl start="#\ze\%([^=]\|$\)" end="$" contains=juliaTodo,@juliaSpellcheckComments
+syntax region  juliaCommentM		matchgroup=juliaCommentDelim fold start="#=\ze\%([^#]\|$\)" end="=#" contains=juliaTodo,juliaCommentM,@juliaSpellcheckComments
+syntax keyword juliaTodo		contained TODO FIXME XXX
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+"ISSM special syntax                                                                                             "
+let enumfile=$ISSM_DIR."/src/c/shared/Enum/Enumjl.vim"
+if filereadable(enumfile)
+   exec 'source ' . enumfile
+endif
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+" detect an end-of-line with only whitespace or comments before it
+let s:eol = '\s*\%(\%(\%(#=\%(=#\@!\|[^=]\|\n\)\{-}=#\)\s*\)\+\)\?\%(#=\@!.*\)\?\n'
+
+" a trailing comma, or colon, or an empty line in an import/using/export
+" multi-line command. Used to recognize the as keyword, and for indentation
+" (this needs to take precedence over normal commas and colons, and comments)
+syntax cluster juliaContinuationItems	contains=juliaContinuationComma,juliaContinuationColon,juliaContinuationNone
+exec 'syntax region  juliaContinuationComma	matchgroup=juliaComma contained start=",\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems'
+exec 'syntax region  juliaContinuationColon	matchgroup=juliaColon contained start=":\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems'
+exec 'syntax region  juliaContinuationNone	matchgroup=NONE contained start="\%(\<\%(import\|using\|export\)\>\|^\)\@'.s:d(6).'<=\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems,juliaAsKeyword'
+exec 'syntax match   juliaMacroName		contained "@' . s:idregex . '\%(\.' . s:idregex . '\)*"'
+
+" the following are disabled by default, but
+" can be enabled by entering e.g.
+"   :hi link juliaParDelim Delimiter
+hi def link juliaParDelim		juliaNone
+hi def link juliaSemicolon		juliaNone
+hi def link juliaComma			juliaNone
+hi def link juliaFunctionCall		juliaNone
+
+hi def link juliaColon			juliaOperator
+
+hi def link juliaFunctionName		juliaFunction
+hi def link juliaFunctionName1		juliaFunction
+hi def link juliaMacroName		juliaMacro
+
+
+hi def link juliaKeyword		Keyword
+hi def link juliaWhereKeyword		Keyword
+hi def link juliaInfixKeyword		Keyword
+hi def link juliaIsaKeyword		Keyword
+hi def link juliaAsKeyword		Keyword
+hi def link juliaRepKeyword		Keyword
+hi def link juliaBlKeyword		Keyword
+hi def link juliaConditional		Conditional
+hi def link juliaRepeat			Repeat
+hi def link juliaException		Exception
+hi def link juliaOuter			Keyword
+hi def link juliaBaseTypeBasic		Type
+hi def link juliaBaseTypeNum		Type
+hi def link juliaBaseTypeC		Type
+hi def link juliaBaseTypeError		Type
+hi def link juliaBaseTypeIter		Type
+hi def link juliaBaseTypeString		Type
+hi def link juliaBaseTypeArray		Type
+hi def link juliaBaseTypeDict		Type
+hi def link juliaBaseTypeSet		Type
+hi def link juliaBaseTypeIO		Type
+hi def link juliaBaseTypeProcess	Type
+hi def link juliaBaseTypeRange		Type
+hi def link juliaBaseTypeRegex		Type
+hi def link juliaBaseTypeFact		Type
+hi def link juliaBaseTypeSort		Type
+hi def link juliaBaseTypeRound		Type
+hi def link juliaBaseTypeSpecial	Type
+hi def link juliaBaseTypeRandom		Type
+hi def link juliaBaseTypeDisplay	Type
+hi def link juliaBaseTypeTime		Type
+hi def link juliaBaseTypeOther		Type
+
+hi def link juliaType			Type
+hi def link juliaParamType		Type
+hi def link juliaTypeOperatorR1		Type
+
+" NOTE: deprecated constants are not highlighted as such. For once,
+" one can still legitimately use them by importing Base.MathConstants.
+" Plus, one-letter variables like `e` and `γ` can be used with other
+" meanings.
+hi def link juliaConstNum		Constant
+hi def link juliaEuler			Constant
+
+hi def link juliaConstEnv		Constant
+hi def link juliaConstC			Constant
+hi def link juliaConstLimits		Constant
+hi def link juliaConstGeneric		Constant
+hi def link juliaRangeKeyword		Constant
+hi def link juliaConstBool		Boolean
+hi def link juliaConstIO		Boolean
+
+hi def link juliaComprehensionFor	Keyword
+hi def link juliaComprehensionIf	Keyword
+
+hi def link juliaDollarVar		Identifier
+
+hi def link juliaFunction		Function
+hi def link juliaMacro			Macro
+hi def link juliaSymbol			Identifier
+hi def link juliaSymbolS		Identifier
+hi def link juliaQParDelim		Identifier
+hi def link juliaQuotedQMarkPar		Identifier
+hi def link juliaQuotedQMark		juliaOperatorHL
+
+hi def link juliaNumber			Number
+hi def link juliaFloat			Float
+hi def link juliaComplexUnit		Constant
+
+hi def link juliaChar			Character
+
+hi def link juliaString			String
+hi def link juliaStringPrefixed		juliaString
+hi def link juliabString		juliaString
+hi def link juliasString		juliaString
+hi def link juliavString		juliaString
+hi def link juliarString		juliaString
+hi def link juliaipString		juliaString
+hi def link juliabigString		juliaString
+hi def link juliaMIMEString		juliaString
+hi def link juliarawString		juliaString
+hi def link juliatestString		juliaString
+hi def link juliahtmlString		juliaString
+hi def link juliaint128String		juliaString
+hi def link juliaPrintfString		juliaString
+hi def link juliaShellString		juliaString
+hi def link juliaDocString		juliaString
+hi def link juliaDocStringM		juliaDocString
+hi def link juliaDocStringMRaw		juliaDocString
+hi def link juliaStringDelim		juliaString
+hi def link juliaDocStringDelim		juliaDocString
+hi def link juliaStringVarsPla		Identifier
+hi def link juliaStringVarDelim		Identifier
+
+hi def link juliaRegEx			String
+
+hi def link juliaSpecialChar		SpecialChar
+hi def link juliaOctalEscapeChar	SpecialChar
+hi def link juliaHexEscapeChar		SpecialChar
+hi def link juliaUniCharSmall		SpecialChar
+hi def link juliaUniCharLarge		SpecialChar
+hi def link juliaDoubleBackslash	SpecialChar
+hi def link juliaEscapedQuote		SpecialChar
+
+hi def link juliaPrintfFmt		SpecialChar
+
+if s:julia_highlight_operators
+  hi! def link juliaOperatorHL		Operator
+else
+  hi! def link juliaOperatorHL		juliaNone
+endif
+hi def link juliaOperator		juliaOperatorHL
+hi def link juliaRangeOperator		juliaOperatorHL
+hi def link juliaCTransOperator		juliaOperatorHL
+hi def link juliaTernaryOperator	juliaOperatorHL
+hi def link juliaTypeOperator		juliaOperatorHL
+
+hi def link juliaCommentL		Comment
+hi def link juliaCommentM		Comment
+hi def link juliaCommentDelim		Comment
+hi def link juliaTodo			Todo
+
+hi def link juliaErrorPar		juliaError
+hi def link juliaErrorEnd		juliaError
+hi def link juliaErrorElse		juliaError
+hi def link juliaErrorCatch		juliaError
+hi def link juliaErrorFinally		juliaError
+hi def link juliaErrorSemicol		juliaError
+hi def link juliaErrorPrintfFmt		juliaError
+
+hi def link juliaError			Error
+
+syntax sync fromstart
+
+let b:current_syntax = "julia"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
Index: /issm/trunk/externalpackages/vim/addons/vim/syntax/juliadoc.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/syntax/juliadoc.vim	(revision 26744)
+++ /issm/trunk/externalpackages/vim/addons/vim/syntax/juliadoc.vim	(revision 26744)
@@ -0,0 +1,71 @@
+" Vim syntax file for julia document view
+scriptencoding utf-8
+
+if exists('b:current_syntax')
+  finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+syntax sync fromstart
+
+syntax region juliadocCode matchgroup=juliadocCodeDelimiter start="`" end="`" concealends display oneline
+syntax region juliadocCode matchgroup=juliadocCodeDelimiter start="``" end="``" concealends display oneline contains=juliadocCodeLatex
+syntax region juliadocCode matchgroup=juliadocCodeDelimiter start="^\s*```.*$" end='^\s*```' concealends
+syntax region juliadocH1 matchgroup=juliadocHeadingDelimiter start="##\@!"      end="$" concealends display oneline
+syntax region juliadocH2 matchgroup=juliadocHeadingDelimiter start="###\@!"     end="$" concealends display oneline
+syntax region juliadocH3 matchgroup=juliadocHeadingDelimiter start="####\@!"    end="$" concealends display oneline
+syntax region juliadocH4 matchgroup=juliadocHeadingDelimiter start="#####\@!"   end="$" concealends display oneline
+syntax region juliadocH5 matchgroup=juliadocHeadingDelimiter start="######\@!"  end="$" concealends display oneline
+syntax region juliadocH6 matchgroup=juliadocHeadingDelimiter start="#######\@!" end="$" concealends display oneline
+syntax match juliadocLink "\[\^\@!.\{-1,}\](.\{-1,})" contains=juliadocLinkBody,juliadocLinkUrl display keepend
+syntax region juliadocLinkBody matchgroup=juliadocLinkDelimiter start="\[" end="\]" concealends display contained oneline
+syntax match juliadocLinkUrl "(\zs@ref\s\+.\{-1,}\ze)" contains=juliadocLinkUrlConceal display keepend
+syntax match juliadocLinkUrlConceal "@ref\s\+" conceal display contained
+syntax match juliadocCrossref "\[`.\{-1,}`\](@ref)" contains=juliadocCrossrefBody display keepend
+syntax region juliadocCrossrefBody matchgroup=juliadocCrossrefDelimiter start="\[`" end="`\](@ref)" concealends display contained oneline
+syntax region juliadocMath matchgroup=juliadocMathDelimiter start="\$" end="\$" concealends display oneline
+syntax match juliadocListing "^\s*\zs\%([-+*]\|\d\+[.)]\)\ze\s" display
+syntax match juliadocFootnote "^\s*\[\^[[:alnum:]]\+\]:\s*" display contains=juliadocFootnoteBody keepend
+syntax region juliadocFootnoteBody matchgroup=juliadocFootnoteDelimiter start="^\s*\zs\[\^" end="\]" concealends display contained oneline
+syntax match juliadocFootnoteRef "\s\[\^[[:alnum:]]\+\]" display contains=juliadocFootnoteRefBody,juliadocFootnoteRefConceal keepend
+syntax match juliadocFootnoteRefBody "[[:alnum:]]\+" display contained
+syntax match juliadocFootnoteRefConceal "\^" conceal display contained
+syntax region juliadocBlockquote matchgroup=juliadocBlockquoteDelimiter start="^\s*>\s" end="$" concealends display oneline
+syntax match juliadocRules "^-\{3,}" display
+syntax region juliadocAdmonitions matchgroup=juliadocAdmonitionsDelimiter start="^\s*!!!" end="$" concealends display contains=juliadocAdmonitionsType,juliadocAdmonitionsTitle oneline keepend
+syntax match juliadocAdmonitionsType "\c\%(danger\|warning\|info\|note\|tip\)\>" display contained
+syntax region juliadocAdmonitionsTitle matchgroup=juliadocAdmonitionsTitleDelimiter start='"' end='"' display contained oneline
+
+if &encoding ==# 'utf-8'
+  for [s:from, s:to] in items(julia_latex_symbols#get_dict())
+    execute printf('syntax match juliadocCodeLatex "\\%s" conceal cchar=%s display contained', escape(s:from, '~"\.^$[]*'), s:to)
+  endfor
+endif
+
+highlight default link juliadocCode String
+highlight default link juliadocCodeLatex String
+highlight default link juliadocH1 Title
+highlight default link juliadocH2 Title
+highlight default link juliadocH3 Title
+highlight default link juliadocH4 Title
+highlight default link juliadocH5 Title
+highlight default link juliadocH6 Title
+highlight default link juliadocLinkBody Identifier
+highlight default link juliadocLinkUrl Underlined
+highlight default link juliadocCrossref Underlined
+highlight default link juliadocCrossrefBody Underlined
+highlight default link juliadocMath Special
+highlight default link juliadocListing PreProc
+highlight default link juliadocFootnoteBody PreProc
+highlight default link juliadocFootnoteRefBody PreProc
+highlight default link juliadocBlockquote Comment
+highlight default link juliadocRules PreProc
+highlight default link juliadocAdmonitionsType Todo
+highlight default link juliadocAdmonitionsTitle Title
+
+let b:current_syntax = "juliadoc"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
Index: /issm/trunk/externalpackages/vim/addons/vimrc
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vimrc	(revision 26743)
+++ /issm/trunk/externalpackages/vim/addons/vimrc	(revision 26744)
@@ -214,4 +214,5 @@
 au BufRead,BufNewFile *.py     iabbr <silent> ER  raise NameError('')<Left><Left><C-R>=Eatchar('\s')<CR>
 au BufRead,BufNewFile *.m      iabbr <silent> ER  error('');<Left><Left><Left><C-R>=Eatchar('\s')<CR>
+au BufRead,BufNewFile *.jl     iabbr <silent> ER  error("")<Left><Left><C-R>=Eatchar('\s')<CR>
 au BufRead,BufNewFile *.c*     ab VV VecView(ug,PETSC_VIEWER_STDOUT_WORLD);
 au BufRead,BufNewFile *.c*,*.h ab AS _assert_();<Left><Left><C-R>=Eatchar('\s')<CR>
Index: /issm/trunk/jenkins/aws-amazon_linux-solid_earth
===================================================================
--- /issm/trunk/jenkins/aws-amazon_linux-solid_earth	(revision 26743)
+++ /issm/trunk/jenkins/aws-amazon_linux-solid_earth	(revision 26744)
@@ -22,6 +22,7 @@
 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-petsc-dir=${ISSM_DIR}/externalpackages/petsc/install \
-	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
-	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install
+	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install
 '
 
@@ -31,5 +32,5 @@
 
 EXTERNALPACKAGES="
-	autotools		install-debian-linux.sh
+	autotools		install-linux.sh
 	cmake			install.sh
 	petsc			install-3.12-linux.sh
@@ -41,6 +42,6 @@
 	curl			install-7-linux.sh
 	netcdf			install-4.7-parallel.sh
-	proj			install-6.2.sh
-	gdal			install-3-python-netcdf.sh
+	proj			install-8.sh
+	gdal			install-3-python.sh
 	gshhg			install.sh
 	gmt				install-6-linux.sh
@@ -79,4 +80,4 @@
 # - Test 2021 is excluded as Gmsh produces different-sized meshes on macOS and Linux for 3d objects (archives are generated on macOS).
 #
-MATLAB_NROPTIONS="'benchmark','slr','exclude',[2021]"
-PYTHON_NROPTIONS="--benchmark slr --exclude 2021"
+MATLAB_NROPTIONS="'benchmark','slc','exclude',[2021]"
+PYTHON_NROPTIONS="--benchmark slc --exclude 2021"
Index: /issm/trunk/jenkins/examples_tests.sh
===================================================================
--- /issm/trunk/jenkins/examples_tests.sh	(revision 26744)
+++ /issm/trunk/jenkins/examples_tests.sh	(revision 26744)
@@ -0,0 +1,744 @@
+#!/bin/bash
+################################################################################
+# This script runs the examples tests (i.e. contents of examples directory, 
+# which are implementations of the tutorials found at 
+# https://issm.jpl.nasa.gov/documentation/tutorials/). It is intended to be 
+# called from jenkins/jenkins.sh.
+#
+# runme files are modifed as needed to fill in statements that would otherwise 
+# be added by user.
+#
+# NOTE:
+# - Indentation of replacement string literals (e.g. 'STEP_EIGHT') is set to 
+#	nest cleanly in this file, but will result in unclean nesting in the runme 
+#	files (which should not be an issue)
+# - Single-line string replacements in runme.m can effectively be performed 
+#	using sed. When performing multi-line replacements, perl is a better 
+#	option.
+#
+# TODO:
+# - Figure out how to remove \ and \n\ from multiline string variables while 
+#	preserving formatting when value is printed to file.
+################################################################################
+
+## Constants
+#
+RUNME_FILE='runme.m'
+RUN_EXAMPLE=0
+STATUS_HANDLING="\
+		disp('SUCCESS');\n\
+	catch me\n\
+		message=getReport(me);\n\
+		fprintf('%s',message);\n\
+		disp('FAILURE');\n\
+	end\n\
+	exit\n\
+"
+
+cd $ISSM_DIR/examples
+
+for dir in ./* ; do
+	if [ -d "${dir}" ]; then
+		# Some of the examples are incomplete (on purpose). As such, we will 
+		# have to populate the missing steps in order to make sure that 
+		# everything is working.
+
+		cd ${dir}
+
+		if [ "${dir}" == "./AMR" ]; then
+			sed -i.bak -e '1 s|^.*$|try\n\n&|' $RUNME_FILE
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./Data" ]; then
+			echo 'Directory contains datasets only; no example to run.'
+			RUN_EXAMPLE=0
+		elif [ "${dir}" == "./EsaGRACE" ]; then
+			sed -i.bak -e 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./EsaWahr" ]; then
+			sed -i.bak -e 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./Functions" ]; then
+			echo "Directory contains functions only; no example to run."
+			RUN_EXAMPLE=0
+		elif [ "${dir}" == "./Greenland" ]; then
+			# STEP_SEVEN #{{{
+			STEP_SEVEN="\
+				if any(steps==7)\n\
+					disp('   Step 7: Historical Relaxation run');\n\
+					md = loadmodel('./Models/Greenland.Control_drag');\n\
+					\n\
+					load smbbox\n\
+					\n\
+					%convert mesh x,y into the Box projection\n\
+					[md.mesh.lat,md.mesh.long]  = xy2ll(md.mesh.x,md.mesh.y,+1,39,71);\n\
+					[xi,yi]= ll2xy(md.mesh.lat,md.mesh.long,+1,45,70);\n\
+					\n\
+					%Interpolate and set surface mass balance\n\
+					index = BamgTriangulate(x1(:),y1(:));\n\
+					smb_mo = InterpFromMeshToMesh2d(index,x1(:),y1(:),smbmean(:),xi,yi);\n\
+					smb = smb_mo*12/1000*md.materials.rho_freshwater/md.materials.rho_ice;\n\
+					md.smb.mass_balance = [smb;1 ];\n\
+					\n\
+					%Set transient options, run for 20 years, saving every 5 timesteps\n\
+					md.timestepping.time_step=0.2;\n\
+					md.timestepping.final_time=200;\n\
+					md.settings.output_frequency=5;\n\
+					\n\
+					%Additional options\n\
+					md.inversion.iscontrol=0;\n\
+					md.transient.requested_outputs={'IceVolume','TotalSmb', ...\n\
+						'SmbMassBalance'};\n\
+					md.verbose=verbose('solution',true,'module',true);\n\
+					\n\
+					%Go solve\n\
+					md.cluster=generic('name',oshostname,'np',2);\n\
+					md=solve(md,'Transient');\n\
+					\n\
+					save ./Models/Greenland.HistoricTransient_200yr md;\n\
+				end\n\
+			"
+			#}}}
+			# STEP_EIGHT #{{{
+			STEP_EIGHT="\
+				if any(steps==8)\n\
+					%Load historic transient model\n\
+					md=loadmodel('./Models/Greenland.HistoricTransient_200yr');\n\
+					\n\
+					%Create Line Plots of relaxation run. Create a figure.\n\
+					figure;\n\
+					\n\
+					%Save surface mass balance, by looping through 200 years (1000 steps)\n\
+					%Note, the first output will always contain output from time step 1\n\
+					surfmb=[];\n\
+					for i=2:201;\n\
+						surfmb=[surfmb md.results.TransientSolution(i).SmbMassBalance];\n\
+					end\n\
+					\n\
+					%Plot surface mass balance time series in first subplot\n\
+					subplot(3,1,1);\n\
+					plot([1:200],mean(surfmb));\n\
+					\n\
+					%Title this plot Mean surface mass balance\n\
+					title('Mean Surface mass balance');\n\
+					\n\
+					%Save velocity by looping through 200 years\n\
+					vel=[];\n\
+					for i=2:201;\n\
+						vel=[vel md.results.TransientSolution(i).Vel];\n\
+					end\n\
+					\n\
+					%Plot velocity time series in second subplot\n\
+					subplot(3,1,2);\n\
+					plot([1:200],mean(vel));\n\
+					\n\
+					%Title this plot Mean Velocity\n\
+					title('Mean Velocity');\n\
+					\n\
+					%Save Ice Volume by looping through 200 years\n\
+					volume=[];\n\
+					for i=2:201;\n\
+						volume=[volume md.results.TransientSolution(i).IceVolume];\n\
+					end\n\
+					\n\
+					%Plot volume time series in third subplot\n\
+					subplot(3,1,3);\n\
+					plot([1:200],volume);\n\
+					\n\
+					%Title this plot Mean Velocity and add an x label of years\n\
+					title('Ice Volume');\n\
+					xlabel('years');\n\
+				end\n\
+			"
+			#}}}
+			sed -i.bak -e 's|steps=\[1\];|steps=\[1:8\];\n\ntry\n|' $RUNME_FILE
+			perl -0755 -p -i -e "s|if any\(steps==7\).*% step 7 end|${STEP_SEVEN}|s" $RUNME_FILE
+			perl -0755 -p -i -e "s|if any\(steps==8\).*% step 8 end|${STEP_EIGHT}|s" $RUNME_FILE
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./IceBridge" ]; then
+			sed -i.bak -e 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
+			perl -0755 -p -i -e "s|\n\t%Mesh greenland without.*return;\n||s" $RUNME_FILE
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./IceflowModels" ]; then
+			sed -i.bak -e '1 s|^.*$|try\n\n&|' $RUNME_FILE
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./Inversion" ]; then
+			sed -i.bak -e 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./ISMIP" ]; then
+			# TODO:
+			# - Run test again with ISMIPF configuration (will likely need to 
+			#	add conditional after 'RUN_EXAMPLE -eq 1' block)
+			#
+
+			# RUNME #{{{
+			RUNME="\
+				try\n\
+					%which steps to perform; steps are from 1 to 8\n\
+					%step 7 is specific to ISMIPA\n\
+					%step 8 is specific to ISMIPF\n\
+					\n\
+					steps=[1:7]; %ISMIPA\n\
+					%steps=[1:6,8]; %ISMIPF\n\
+					\n\
+					% parameter file to be used, choose between IsmipA.par or IsmipF.par\n\
+					ParamFile='IsmipA.par';\n\
+					%ParamFile='IsmipF.par';\n\
+					\n\
+					%Run Steps\n\
+					\n\
+					%Mesh Generation #1\n\
+					if any(steps==1)\n\
+						%initialize md as a new model #help model\n\
+						%->\n\
+						md=model();\n\
+						% generate a squaremesh #help squaremesh\n\
+						% Side is 80 km long with 20 points\n\
+						%->\n\
+						if(ParamFile=='IsmipA.par'),\n\
+							md=squaremesh(md,80000,80000,20,20);\n\
+						elseif(ParamFile=='IsmipF.par'),\n\
+							md=squaremesh(md,100000,100000,30,30);\n\
+						end\n\
+						% plot the given mesh #plotdoc\n\
+						%->\n\
+						plotmodel(md,'data','mesh')\n\
+						% save the given model\n\
+						%->\n\
+						save ./Models/ISMIP.Mesh_generation md;\n\
+					end\n\
+					\n\
+					%Masks #2\n\
+					if any(steps==2)\n\
+						% load the preceding step #help loadmodel\n\
+						% path is given by the organizer with the name of the given step\n\
+						%->\n\
+						md = loadmodel('./Models/ISMIP.Mesh_generation');\n\
+						% set the mask #help setmask\n\
+						% all MISMIP nodes are grounded\n\
+						%->\n\
+						md=setmask(md,'','');\n\
+						% plot the given mask #md.mask to locate the field\n\
+						%->\n\
+						plotmodel(md,'data',md.mask.ocean_levelset);\n\
+						% save the given model\n\
+						%->\n\
+						save ./Models/ISMIP.SetMask md;\n\
+					end\n\
+					\n\
+					%Parameterization #3\n\
+					if any(steps==3)\n\
+						% load the preceding step #help loadmodel\n\
+						% path is given by the organizer with the name of the given step\n\
+						%->\n\
+						md = loadmodel('./Models/ISMIP.SetMask');\n\
+						% parametrize the model # help parameterize\n\
+						% you will need to fil-up the parameter file defined by the\n\
+						% ParamFile variable\n\
+						%->\n\
+						md=parameterize(md,ParamFile);\n\
+						% save the given model\n\
+						%->\n\
+						save ./Models/ISMIP.Parameterization md;\n\
+					end\n\
+					\n\
+					%Extrusion #4\n\
+					if any(steps==4)\n\
+						\n\
+						% load the preceding step #help loadmodel\n\
+						% path is given by the organizer with the name of the given step\n\
+						%->\n\
+						md = loadmodel('./Models/ISMIP.Parameterization');\n\
+						% vertically extrude the preceding mesh #help extrude\n\
+						% only 5 layers exponent 1\n\
+						%->\n\
+						md=extrude(md,5,1);\n\
+						% plot the 3D geometry #plotdoc\n\
+						%->\n\
+						plotmodel(md,'data',md.geometry.base)\n\
+						% save the given model\n\
+						%->\n\
+						save ./Models/ISMIP.Extrusion md;\n\
+					end\n\
+					\n\
+					%Set the flow computing method #5\n\
+					if any(steps==5)\n\
+						\n\
+						% load the preceding step #help loadmodel\n\
+						% path is given by the organizer with the name of the given step\n\
+						%->\n\
+						md = loadmodel('./Models/ISMIP.Extrusion');\n\
+						% set the approximation for the flow computation #help setflowequation\n\
+						% We will be using the Higher Order Model (HO)\n\
+						%->\n\
+						md=setflowequation(md,'HO','all');\n\
+						% save the given model\n\
+						%->\n\
+						save ./Models/ISMIP.SetFlow md;\n\
+					end\n\
+					\n\
+					%Set Boundary Conditions #6\n\
+					if any(steps==6)\n\
+						\n\
+						% load the preceding step #help loadmodel\n\
+						% path is given by the organizer with the name of the given step\n\
+						%->\n\
+						md = loadmodel('./Models/ISMIP.SetFlow');\n\
+						% dirichlet boundary condition are known as SPCs\n\
+						% ice frozen to the base, no velocity	#md.stressbalance\n\
+						% SPCs are initialized at NaN one value per vertex\n\
+						%->\n\
+						md.stressbalance.spcvx=NaN*ones(md.mesh.numberofvertices,1);\n\
+						%->\n\
+						md.stressbalance.spcvy=NaN*ones(md.mesh.numberofvertices,1);\n\
+						%->\n\
+						md.stressbalance.spcvz=NaN*ones(md.mesh.numberofvertices,1);\n\
+						% extract the nodenumbers at the base #md.mesh.vertexonbase\n\
+						%->\n\
+						basalnodes=find(md.mesh.vertexonbase);\n\
+						% set the sliding to zero on the bed\n\
+						%->\n\
+						md.stressbalance.spcvx(basalnodes)=0.0;\n\
+						%->\n\
+						md.stressbalance.spcvy(basalnodes)=0.0;\n\
+						% periodic boundaries have to be fixed on the sides\n\
+						% Find the indices of the sides of the domain, for x and then for y\n\
+						% for x\n\
+						% create maxX, list of indices where x is equal to max of x (use >> help find)\n\
+						%->\n\
+						maxX=find(md.mesh.x==max(md.mesh.x));\n\
+						% create minX, list of indices where x is equal to min of x\n\
+						%->\n\
+						minX=find(md.mesh.x==min(md.mesh.x));\n\
+						% for y\n\
+						% create maxY, list of indices where y is equal to max of y\n\
+						% but not where x is equal to max or min of x\n\
+						% (i.e, indices in maxX and minX should be excluded from maxY and minY)\n\
+						% but not where x is equal to max or min of x\n\
+						%->\n\
+						maxY=find(md.mesh.y==max(md.mesh.y) & md.mesh.x~=max(md.mesh.x) & md.mesh.x~=min(md.mesh.x));\n\
+						% create minY, list of indices where y is equal to max of y\n\
+						%->\n\
+						minY=find(md.mesh.y==min(md.mesh.y) & md.mesh.x~=max(md.mesh.x) & md.mesh.x~=min(md.mesh.x));\n\
+						% set the node that should be paired together, minX with maxX and minY with maxY\n\
+						% #md.stressbalance.vertex_pairing\n\
+						%->\n\
+						md.stressbalance.vertex_pairing=[minX,maxX;minY,maxY];\n\
+						if (ParamFile=='IsmipF.par')\n\
+							% if we are dealing with IsmipF the solution is in\n\
+							% masstransport\n\
+							md.masstransport.vertex_pairing=md.stressbalance.vertex_pairing;\n\
+						end\n\
+						% save the given model\n\
+						%->\n\
+						save ./Models/ISMIP.BoundaryCondition md;\n\
+					end\n\
+					\n\
+					%Solving #7\n\
+					if any(steps==7)\n\
+						% load the preceding step #help loadmodel\n\
+						% path is given by the organizer with the name of the given step\n\
+						%->\n\
+						md = loadmodel('./Models/ISMIP.BoundaryCondition');\n\
+						% Set cluster #md.cluster\n\
+						% generic parameters #help generic\n\
+						% set only the name and number of process\n\
+						%->\n\
+						md.cluster=generic('name',oshostname(),'np',2);\n\
+						% Set which control message you want to see #help verbose\n\
+						%->\n\
+						md.verbose=verbose('convergence',true);\n\
+						% Solve #help solve\n\
+						% we are solving a StressBalanc\n\
+						%->\n\
+						md=solve(md,'Stressbalance');\n\
+						% save the given model\n\
+						%->\n\
+						save ./Models/ISMIP.StressBalance md;\n\
+						% plot the surface velocities #plotdoc\n\
+						%->\n\
+						plotmodel(md,'data',md.results.StressbalanceSolution.Vel)\n\
+					end\n\
+					\n\
+					%Solving #8\n\
+					if any(steps==8)\n\
+						% load the preceding step #help loadmodel\n\
+						% path is given by the organizer with the name of the given step\n\
+						%->\n\
+						md = loadmodel('./Models/ISMIP.BoundaryCondition');\n\
+						% Set cluster #md.cluster\n\
+						% generic parameters #help generic\n\
+						% set only the name and number of process\n\
+						%->\n\
+						md.cluster=generic('name',oshostname(),'np',2);\n\
+						% Set which control message you want to see #help verbose\n\
+						%->\n\
+						md.verbose=verbose('convergence',true);\n\
+						% set the transient model to ignore the thermal model\n\
+						% #md.transient \n\
+						%->\n\
+						md.transient.isthermal=0;\n\
+						% define the timestepping scheme\n\
+						% everything here should be provided in years #md.timestepping\n\
+						% give the length of the time_step (4 years)\n\
+						%->\n\
+						md.timestepping.time_step=4;\n\
+						% give final_time (20*4 years time_steps)\n\
+						%->\n\
+						md.timestepping.final_time=4*20;\n\
+						% Solve #help solve\n\
+						% we are solving a TransientSolution\n\
+						%->\n\
+						md=solve(md,'Transient');\n\
+						% save the given model\n\
+						%->\n\
+						save ./Models/ISMIP.Transient md;\n\
+						% plot the surface velocities #plotdoc\n\
+						%->\n\
+						plotmodel(md,'data',md.results.TransientSolution(20).Vel)\n\
+					end\n\
+			"
+			#}}}
+			# PAR_A #{{{
+			PAR_A="\
+				%Parameterization for ISMIP A experiment\n\
+				\n\
+				%Set the Simulation generic name #md.miscellaneous\n\
+				%->\n\
+				\n\
+				%Geometry\n\
+				disp('   Constructing Geometry');\n\
+				\n\
+				%Define the geometry of the simulation #md.geometry\n\
+				%surface is [-x*tan(0.5*pi/180)] #md.mesh\n\
+				%->\n\
+				md.geometry.surface=-md.mesh.x*tan(0.5*pi/180.);\n\
+				%base is [surface-1000+500*sin(x*2*pi/L).*sin(y*2*pi/L)]\n\
+				%L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)\n\
+				%->\n\
+				L=max(md.mesh.x)-min(md.mesh.x);\n\
+				md.geometry.base=md.geometry.surface-1000.0+500.0*sin(md.mesh.x*2.0*pi/L).*sin(md.mesh.y*2.0*pi/L);\n\
+				%thickness is the difference between surface and base #md.geometry\n\
+				%->\n\
+				md.geometry.thickness=md.geometry.surface-md.geometry.base;\n\
+				%plot the geometry to check it out\n\
+				%->\n\
+				plotmodel(md,'data',md.geometry.thickness);\n\
+				\n\
+				disp('   Defining friction parameters');\n\
+				\n\
+				%These parameters will not be used but need to be fixed #md.friction\n\
+				%one friciton coefficient per node (md.mesh.numberofvertices,1)\n\
+				%->\n\
+				md.friction.coefficient=200.0*ones(md.mesh.numberofvertices,1);\n\
+				%one friciton exponent (p,q) per element\n\
+				%->\n\
+				md.friction.p=ones(md.mesh.numberofelements,1);\n\
+				%->\n\
+				md.friction.q=ones(md.mesh.numberofelements,1);\n\
+				\n\
+				disp('   Construct ice rheological properties');\n\
+				\n\
+				%The rheology parameters sit in the material section #md.materials\n\
+				%B has one value per vertex\n\
+				%->\n\
+				md.materials.rheology_B=6.8067e7*ones(md.mesh.numberofvertices,1);\n\
+				%n has one value per element\n\
+				%->\n\
+				md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);\n\
+				\n\
+				disp('   Set boundary conditions');\n\
+				\n\
+				%Set the default boundary conditions for an ice-sheet \n\
+				% #help SetIceSheetBC\n\
+				%->\n\
+				md=SetIceSheetBC(md);\n\
+			"
+			#}}}
+			# PAR_F #{{{
+			PAR_F="\
+				%Parameterization for ISMIP F experiment\n\
+				\n\
+				%Set the Simulation generic name #md.miscellaneous\n\
+				%->\n\
+				\n\
+				%Geometry\n\
+				disp('   Constructing Geometry');\n\
+				\n\
+				%Define the geometry of the simulation #md.geometry\n\
+				%surface is [-x*tan(3.0*pi/180)] #md.mesh\n\
+				%->\n\
+				md.geometry.surface=-md.mesh.x*tan(3.0*pi/180.0);\n\
+				%base is [surface-1000+100*exp(-((x-L/2).^2+(y-L/2).^2)/(10000.^2))]\n\
+				%L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)\n\
+				%->\n\
+				L=max(md.mesh.x)-min(md.mesh.x);\n\
+				%->\n\
+				md.geometry.base=md.geometry.surface-1000.0+100.0*exp(-((md.mesh.x-L/2.0).^2.0+(md.mesh.y-L/2.0).^2.0)/(10000.^2.0));\n\
+				%thickness is the difference between surface and base #md.geometry\n\
+				%->\n\
+				md.geometry.thickness=md.geometry.surface-md.geometry.base;\n\
+				%plot the geometry to check it out\n\
+				%->\n\
+				plotmodel(md,'data',md.geometry.thickness);\n\
+				\n\
+				disp('   Defining friction parameters');\n\
+				\n\
+				%These parameters will not be used but need to be fixed #md.friction\n\
+				%one friciton coefficient per node (md.mesh.numberofvertices,1)\n\
+				%conversion from year to seconds with #md.constants.yts\n\
+				%->\n\
+				md.friction.coefficient=sqrt(md.constants.yts/(1000*2.140373*10^-7))*ones(md.mesh.numberofvertices,1);\n\
+				%one friciton exponent (p,q) per element\n\
+				%->\n\
+				md.friction.p=ones(md.mesh.numberofelements,1);\n\
+				%->\n\
+				md.friction.q=zeros(md.mesh.numberofelements,1);\n\
+				\n\
+				disp('   Construct ice rheological properties');\n\
+				\n\
+				%The rheology parameters sit in the material section #md.materials\n\
+				%B has one value per vertex\n\
+				%->\n\
+				md.materials.rheology_B=(1/(2.140373*10^-7/md.constants.yts))*ones(md.mesh.numberofvertices,1);\n\
+				%n has one value per element\n\
+				%->\n\
+				md.materials.rheology_n=1*ones(md.mesh.numberofelements,1);\n\
+				\n\
+				disp('   Set boundary conditions');\n\
+				\n\
+				%Set the default boundary conditions for an ice-sheet \n\
+				% #help SetIceSheetBC\n\
+				%->\n\
+				md=SetIceSheetBC(md);\n\
+				\n\
+				disp('   Initializing velocity and pressure');\n\
+				\n\
+				%initialize the velocity and pressurefields of #md.initialization\n\
+				%->\n\
+				md.initialization.vx=zeros(md.mesh.numberofvertices,1);\n\
+				%->\n\
+				md.initialization.vy=zeros(md.mesh.numberofvertices,1);\n\
+				%->\n\
+				md.initialization.vz=zeros(md.mesh.numberofvertices,1);\n\
+				%->\n\
+				md.initialization.pressure=zeros(md.mesh.numberofvertices,1);\n\
+			"
+			#}}}
+			perl -0755 -p -i'.bak' -e "s|^.*$|${RUNME}|s" $RUNME_FILE
+			perl -0755 -p -i'.bak' -e "s|^.*$|${PAR_A}|s" IsmipA.par
+			perl -0755 -p -i'.bak' -e "s|^.*$|${PAR_F}|s" IsmipF.par
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./Jakobshavn" ]; then
+			sed -i.bak -e 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./LcurveAnalysis" ]; then
+			sed -i.bak -e 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./Mesh" ]; then
+			# NOTE: Cannot test exptool region selection without GUI
+			#
+
+			# RUNME #{{{
+			RUNME="\
+				try\n\
+					steps=[1:7];\n\
+					\n\
+					if any(steps==1) % Model\n\
+						md=model;\n\
+					end\n\
+					\n\
+					if any(steps==2) % squaremesh\n\
+						md=squaremesh(md,100,200,15,25);\n\
+						plotmodel(md,'data','mesh');\n\
+					end\n\
+					\n\
+					if any(steps==3) % roundmesh\n\
+						md=roundmesh(model,100,10);\n\
+						plotmodel(md,'data','mesh');\n\
+					end\n\
+					\n\
+					if any(steps==4) % triangle\n\
+						md=triangle(model,'Square.exp',.2);\n\
+						plotmodel(md,'data','mesh');\n\
+					end\n\
+					\n\
+					if any(steps==5) % bamg\n\
+						md=bamg(model,'domain','Square.exp','hmax',.05);\n\
+						plotmodel(md,'data','mesh');\n\
+					end\n\
+					\n\
+					if any(steps==6) % Non-Uniform mesh\n\
+						hvertices=[0.2;0.2;0.005;0.2];\n\
+						md=bamg(md,'domain','Square.exp','hvertices',hvertices);\n\
+						plotmodel(md,'data','mesh');\n\
+					end\n\
+					\n\
+					if any(steps==7) % Mesh adaptation\n\
+						md=bamg(model,'domain','Square.exp','hmax',.05);\n\
+						vel=shock(md.mesh.x,md.mesh.y);\n\
+						plotmodel(md,'data',vel,'edgecolor','w');\n\
+						\n\
+						md=bamg(model,'domain','Square.exp','hmax',.005);\n\
+						vel=shock(md.mesh.x,md.mesh.y);\n\
+						md=bamg(md,'field',vel,'err',0.05,'hmin',0.005,'hmax',0.3);\n\
+						vel=shock(md.mesh.x,md.mesh.y);\n\
+						plotmodel(md,'data',vel,'edgecolor','w');\n\
+						\n\
+						md=bamg(model,'domain','Square.exp','hmax',.005);\n\
+						vel=shock(md.mesh.x,md.mesh.y);\n\
+						md=bamg(md,'field',vel,'err',0.03,'hmin',0.005,'hmax',0.3,'gradation',3);\n\
+						vel=shock(md.mesh.x,md.mesh.y);\n\
+						plotmodel(md,'data',vel,'edgecolor','w');\n\
+						\n\
+						md=bamg(model,'domain','Square.exp','hmax',.005);\n\
+						vel=shock(md.mesh.x,md.mesh.y);\n\
+						md=bamg(md,'field',vel,'err',0.03,'hmin',0.005,'hmax',0.3,'gradation',1.3,'anisomax',1);\n\
+						vel=shock(md.mesh.x,md.mesh.y);\n\
+						plotmodel(md,'data',vel,'edgecolor','w');\n\
+					end\n\
+					\n\
+					if any(steps==8) % Mesh refinement in a specific region\n\
+						plotmodel(md,'data',vel,'edgecolor','w');\n\
+						exptool('refinement.exp');\n\
+						h=NaN*ones(md.mesh.numberofvertices,1);\n\
+						in=ContourToNodes(md.mesh.x,md.mesh.y,'refinement.exp',1);\n\
+						h(find(in))=0.02;\n\
+						plotmodel(md,'data',in,'edgecolor','w');\n\
+						\n\
+						vel=shock(md.mesh.x,md.mesh.y);\n\
+						md=bamg(md,'field',vel,'err',0.03,'hmin',0.005,'hmax',0.3,'hVertices',h);\n\
+						vel=shock(md.mesh.x,md.mesh.y);\n\
+						plotmodel(md,'data',vel,'edgecolor','w');\n\
+					end\n\
+			"
+			#}}}
+			touch $RUNME_FILE
+			perl -0755 -p -i'.bak' -e "s|^.*$|${RUNME}|s" $RUNME_FILE
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./Pig" ]; then
+			# STEP_SIX #{{{
+			STEP_SIX="\
+				if any(steps==6)\n\
+					% Load Model\n\
+					md = loadmodel('./Models/PIG_Control_drag');\n\
+					% Disable inversion\n\
+					md.inversion.iscontrol=0;\n\
+					% Extrude Mesh\n\
+					disp('   Extruding mesh');\n\
+					number_of_layers=3;\n\
+					md=extrude(md,number_of_layers,1);\n\
+					% Set Flowequation\n\
+					disp('   Using HO Ice Flow Model');\n\
+					md=setflowequation(md,'HO','all');\n\
+					% Solve\n\
+					md=solve(md,'Stressbalance');\n\
+					% Save Model\n\
+					save ./Models/PIG_ModelHO md;\n\
+				end\n\
+			"
+			#}}}
+			mv ./DomainOutline.bkp ./DomainOutline.exp > /dev/null 2>&1
+			sed -i.bak -e 's|steps=\[1\];|steps=\[1:7\];\ntry\n|' $RUNME_FILE
+			perl -0755 -p -i -e "s|if any\(steps==6\).*% step 6 end|${STEP_SIX}|s" $RUNME_FILE
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./Pig2" ]; then
+			STEP_NINE="\n disp('Needs work!'); exit"
+			sed -i.bak -e 's|steps=\[1\];|steps=\[1:9\];\n\ntry\n|' $RUNME_FILE
+			perl -0755 -p -i -e "s|if any\(steps==9\).*% step 9 end|${STEP_NINE}|s" $RUNME_FILE
+			RUN_EXAMPLE=0
+		elif [ "${dir}" == "./PigSensitivity" ]; then
+			# STEP_FOUR # {{{
+			STEP_FOUR="\
+				if any(steps==4)\n\
+					%Load model\n\
+					md = loadmodel('./Models/PIG_Transient');\n\
+					\n\
+					%Change external forcing basal melting rate and surface mass balance)\n\
+					md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);\n\
+					md.basalforcings.floatingice_melting_rate=25*ones(md.mesh.numberofvertices,1);\n\
+					md.smb.mass_balance=2*md.smb.mass_balance;\n\
+					\n\
+					%Define time steps and time span of the simulation\n\
+					md.timestepping.time_step=0.1;\n\
+					md.timestepping.final_time=10;\n\
+					\n\
+					%Request additional outputs\n\
+					md.transient.requested_outputs={'default','IceVolume','IceVolumeAboveFloatation'};\n\
+					\n\
+					%Solve\n\
+					md=solve(md,'Transient');\n\
+					\n\
+					%Plot\n\
+					plotmodel(md, 'data', md.results.TransientSolution(1).Vel,...\n\
+						'title#1', 'Velocity t=0 years (m/yr)',...\n\
+						'data', md.results.TransientSolution(end).Vel,...\n\
+						'title#2', 'Velocity t=10 years (m/yr)',...\n\
+						'data', md.results.TransientSolution(1).MaskOceanLevelset,...\n\
+						'title#3', 'Floating ice t=0 years',...\n\
+						'data', md.results.TransientSolution(end).MaskOceanLevelset,...\n\
+						'title#4', 'Floating ice t=10 years',...\n\
+						'caxis#1',([0 4500]),'caxis#2',([0 4500]),...\n\
+						'caxis#3',([-1,1]),'caxis#4',([-1,1]));\n\
+					\n\
+					%Save model\n\
+					save ./Models/PIG_SMB md;\n\
+				end\n\
+			"
+			#}}}
+			sed -i.bak -e 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
+			perl -0755 -p -i -e "s|if any\(steps==4\).*% step 4 end|${STEP_FOUR}|s" $RUNME_FILE
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./shakti" ]; then
+			sed -i.bak -e 's|steps=\[1:3\];|steps=\[1:3\];\n\ntry\n|' $RUNME_FILE
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./SlrFarrell" ]; then
+			# TODO: Convert from md.slr
+			sed -i.bak -e 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
+			RUN_EXAMPLE=0
+		elif [ "${dir}" == "./SlrGRACE" ]; then
+			# TODO: Convert from md.slr
+			sed -i.bak -e 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
+			RUN_EXAMPLE=0
+		elif [ "${dir}" == "./SlrGRACE_NIMS" ]; then
+			# TODO: Convert from md.slr
+			sed -i.bak -e 's|steps=\[1\];|steps=\[1:8\];\n\ntry\n|' $RUNME_FILE
+			RUN_EXAMPLE=0
+		elif [ "${dir}" == "./SquareIceShelf" ]; then
+			sed -i.bak -e '1 s|^.*$|try\n\n&|' $RUNME_FILE
+			RUN_EXAMPLE=1
+		elif [ "${dir}" == "./UncertaintyQuantification" ]; then
+			sed -i.bak -e 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
+			RUN_EXAMPLE=1
+		else
+			echo "Not implemented yet!"
+			exit 1
+		fi
+
+		if [ $RUN_EXAMPLE -eq 1 ]; then
+			echo "Testing example: $(basename $dir)"
+			LOG_RUNME_FILE="matlab_log_$(basename $dir)_examples.log"
+			echo -e ${STATUS_HANDLING} >> ${RUNME_FILE}
+			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR/src/m/dev; devpath; addpath $ISSM_DIR/nightlylog/; runme" -logfile $ISSM_DIR/nightlylog/$LOG_RUNME_FILE
+			echo "starting: $(basename $dir)" >> $ISSM_DIR/nightlylog/matlab_log_examples.log
+			cat $ISSM_DIR/nightlylog/$LOG_RUNME_FILE >> $ISSM_DIR/nightlylog/matlab_log_examples.log
+			echo "finished: $(basename $dir)" >> $ISSM_DIR/nightlylog/matlab_log_examples.log
+			mv -f ${RUNME_FILE}.bak ${RUNME_FILE}
+		fi
+
+		# Extra clean up
+		if [ "${dir}" == "./ISMIP" ]; then
+			mv -f IsmipA.par.bak IsmipA.par
+			mv -f IsmipF.par.bak IsmipF.par
+		fi
+
+		if [ "${dir}" == "./Mesh" ]; then
+			rm -f $RUNME_FILE
+		fi
+
+		if [ "${dir}" == "./Pig" ]; then
+			mv -f DomainOutline.exp DomainOutline.bkp
+		fi
+
+		cd ..
+	fi
+done
Index: /issm/trunk/jenkins/jenkins.sh
===================================================================
--- /issm/trunk/jenkins/jenkins.sh	(revision 26743)
+++ /issm/trunk/jenkins/jenkins.sh	(revision 26744)
@@ -1,9 +1,13 @@
 #!/bin/bash
 ################################################################################
-# This bash script manages installation of ISSM on a given Jenkins node using a
+# This script manages installation of ISSM on a given Jenkins node using a
 # configuration file passed as the only argument. This file also contains
 # details about which nightly run tests should be executed after the build has
 # been completed. Finally, results of the build and tests are emailed to the
 # members of the ISSM development team.
+#
+# NOTE:
+# - Variable OS is set in environment by running 
+#	`source $ISSM_DIR/etc/environment.sh`.
 #
 # TODO:
@@ -13,8 +17,11 @@
 ################################################################################
 
+# Override certain aliases
+alias grep=$(which grep)
+
 echo "Cleaning up execution directory"
-rm -rf $ISSM_DIR/execution/*
-rm -rf $ISSM_DIR/nightlylog
-mkdir $ISSM_DIR/nightlylog
+rm -rf ${ISSM_DIR}/execution/*
+rm -rf ${ISSM_DIR}/nightlylog
+mkdir ${ISSM_DIR}/nightlylog
 
 #Server URI
@@ -23,12 +30,10 @@
 #Get configuration
 #Source config file{{{
-if [ $# -ne 1 ];
-then
+if [ $# -ne 1 ]; then
 	#no config file specified: exit
 	echo "no config file specified. Exiting..." >&2 # Error message to stderr.
 	exit 1
 fi
-if [ ! -f "$1" ]
-then
+if [ ! -f "$1" ]; then
 	echo "File $1 not found!" >&2 # Error message to stderr.
 	exit 1
@@ -46,14 +51,12 @@
 NUMCPUS_RUN=1
 
-
 #source configuration script
 source $1;
 #}}}
-#Get Operating system (OS) name{{{
-OS=$(uname -s)
-if [[ $OS == CYGWIN* ]]; then
-	OS="win";
-fi
-#}}}
+
+if [[ $EXAMPLES_TEST -eq 1 && $MATLAB_TEST+$PYTHON_TEST+$JAVASCRIPT_TEST -ne 0 ]]; then
+	echo "When running examples tests, set *only* EXAMPLES_TEST=1"
+	exit 1
+fi
 
 #Install ISSM
@@ -62,7 +65,6 @@
 echo "             Determining Installation type            "
 echo "======================================================";
-if [ -a $ISSM_DIR/svn_revision_old ]
-then
-	SVN_PREVIOUS=$(cat $ISSM_DIR/svn_revision_old)
+if [ -a ${ISSM_DIR}/svn_revision_old ]; then
+	SVN_PREVIOUS=$(cat ${ISSM_DIR}/svn_revision_old)
 	SVN_CURRENT=$SVN_REVISION_1
 	echo "Previous revision number: $SVN_PREVIOUS"
@@ -72,5 +74,5 @@
 	#
 
-	#svn --non-interactive --no-auth-cache --trust-server-cert diff -r $SVN_PREVIOUS:$SVN_CURRENT --summarize $ISSM_DIR | awk '{print $NF}' > $ISSM_DIR/TEMP
+	#svn --non-interactive --no-auth-cache --trust-server-cert diff -r $SVN_PREVIOUS:$SVN_CURRENT --summarize ${ISSM_DIR} | awk '{print $NF}' > ${ISSM_DIR}/TEMP
 
 	# Get list of changes from Jenkins itself as svn requires credentials
@@ -79,13 +81,13 @@
 
 	# Process html page and get the list of files that has changed (tricky...)
-	#cat changes | grep '="The file was modified"' | sed -e 's/.*<\/td><td><a>\(.*\)<\/a><\/td><td>.*/\1/' > $ISSM_DIR/TEMP
+	#cat changes | grep '="The file was modified"' | sed -e 's/.*<\/td><td><a>\(.*\)<\/a><\/td><td>.*/\1/' > ${ISSM_DIR}/TEMP
 	#cat changes | grep 'document_edit' |sed -e 's/document_edit.png/document_edit.png\
-		#/g' | sed -e 's/.*<\/a><\/td><td>\(.*\)<\/td><\/tr>.*/\1/' | grep -v 'document_edit.png' > $ISSM_DIR/TEMP
-	cat changes | tr " " "\n" | grep trunk | sed -e 's/.*<a>\(.*\)<\/a>.*/\1/' > $ISSM_DIR/TEMP
+		#/g' | sed -e 's/.*<\/a><\/td><td>\(.*\)<\/td><\/tr>.*/\1/' | grep -v 'document_edit.png' > ${ISSM_DIR}/TEMP
+	cat changes | tr " " "\n" | grep trunk | sed -e 's/.*<a>\(.*\)<\/a>.*/\1/' > ${ISSM_DIR}/TEMP
 
 	# Print list of changed files
 	echo "   "
 	echo "List of updated files"
-	cat $ISSM_DIR/TEMP
+	cat ${ISSM_DIR}/TEMP
 	echo "   "
 
@@ -97,9 +99,9 @@
 	# If the contents of the externalpackages directory were modified in any
 	# way, check for changed external packages
-	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep externalpackages)" ] ; then
-		echo "  -- checking for changed externalpackages... yes";
+	if [ ! -z "$(cat ${ISSM_DIR}/TEMP | grep externalpackages)" ]; then
+		echo "  -- checking for changed externalpackages... yes"
 		ISSM_EXTERNALPACKAGES="yes"
 	else
-		echo "  -- checking for changed externalpackages... no";
+		echo "  -- checking for changed externalpackages... no"
 		ISSM_EXTERNALPACKAGES="no"
 	fi
@@ -107,23 +109,21 @@
 	# If the Makefile or m4 diirectory were changed in any way or if certain
 	# binary files from a previous compilation do not exist, reconfigure
-	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "Makefile.am" -e "m4" )" ] ||
-		[ ! -f "$ISSM_DIR/bin/issm.exe" ] && [ ! -f "$ISSM_DIR/bin/issm-bin.js" ] ||
-		[ "$ISSM_EXTERNALPACKAGES" == "yes" ] ;
-	then
-		echo "  -- checking for reconfiguration... yes";
+	if [ ! -z "$(cat ${ISSM_DIR}/TEMP | grep -e "Makefile.am" -e "m4" )" ] ||
+		[ ! -f "${ISSM_DIR}/bin/issm.exe" ] && [ ! -f "${ISSM_DIR}/bin/issm-bin.js" ] ||
+		[ "$ISSM_EXTERNALPACKAGES" == "yes" ]; then
+		echo "  -- checking for reconfiguration... yes"
 		ISSM_RECONFIGURE="yes"
 	else
-		echo "  -- checking for reconfiguration... no";
+		echo "  -- checking for reconfiguration... no"
 		ISSM_RECONFIGURE="no"
 	fi
 
 	# If source files were changed in any way, recompile
-	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "\.cpp" -e "\.h" )" ] ||
-		[ "$ISSM_RECONFIGURE" == "yes" ] ;
-	then
-		echo "  -- checking for recompilation... yes";
+	if [ ! -z "$(cat ${ISSM_DIR}/TEMP | grep -e "\.cpp" -e "\.h" )" ] ||
+		[ "$ISSM_RECONFIGURE" == "yes" ]; then
+		echo "  -- checking for recompilation... yes"
 		ISSM_COMPILATION="yes"
 	else
-		echo "  -- checking for recompilation... no";
+		echo "  -- checking for recompilation... no"
 		ISSM_COMPILATION="no"
 	fi
@@ -131,10 +131,10 @@
 	# Cleanup
 	rm changes
-	rm $ISSM_DIR/TEMP
+	rm ${ISSM_DIR}/TEMP
 else
 	echo "Previous revision not found, this must be a fresh install"
-	echo "  -- checking for changed externalpackages... yes";
-	echo "  -- checking for reconfiguration... yes";
-	echo "  -- checking for recompilation... yes";
+	echo "  -- checking for changed externalpackages... yes"
+	echo "  -- checking for reconfiguration... yes"
+	echo "  -- checking for recompilation... yes"
 	ISSM_EXTERNALPACKAGES="yes"
 	ISSM_RECONFIGURE="yes"
@@ -144,5 +144,5 @@
 echo " "
 echo "Recording current svn version: $SVN_REVISION_1"
-echo $SVN_REVISION_1 > $ISSM_DIR/svn_revision_old
+echo $SVN_REVISION_1 > ${ISSM_DIR}/svn_revision_old
 #}}}
 
@@ -154,20 +154,19 @@
 
 #Jenkins XML files for individual packages
-EXTERNAL_TEST_FILE="$ISSM_DIR/nightlylog/results/external.xml"
-mkdir -p $ISSM_DIR/nightlylog/results
+EXTERNAL_TEST_FILE="${ISSM_DIR}/nightlylog/results/external.xml"
+mkdir -p ${ISSM_DIR}/nightlylog/results
 echo "<testsuite tests=\"$NUMPACKAGES\">" > $EXTERNAL_TEST_FILE
 
 # Need a source here for when builds start midway through installation of externalpackages.
-source $ISSM_DIR/etc/environment.sh
-
-if [ "$OS" == "win" ]; then
+source ${ISSM_DIR}/etc/environment.sh
+
+if [ "${OS}" == CYGWIN* ]; then
 	echo " == WINDOWS ENVIRONMENT DETECTED =="
-	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
+	source ${ISSM_DIR}/externalpackages/windows/windows_environment.sh
 fi
 
 EXTERNALPACKAGES_FAILED=0;
 
-for ((i=1;i<=$NUMPACKAGES;i++))
-do
+for ((i=1;i<=$NUMPACKAGES;i++)); do
 	NUM1=$((2*$i-1))
 	NUM2=$((2*$i))
@@ -175,8 +174,8 @@
 	PACKAGEINST=$(echo $EXTERNALPACKAGES | cut -d " " -f $NUM2-$NUM2)
 
-	cd $ISSM_DIR/externalpackages/$PACKAGENAME
-
 	#install if requested or if previous install has not been successful
-	if [ "$ISSM_EXTERNALPACKAGES" == "yes" ] || [[ ! -d ./install && ! -d ./install-javascript ]]; then
+	if [ "${ISSM_EXTERNALPACKAGES}" == "yes" ]; then # NOTE: Removed check on if 'install' directory exist
+		cd ${ISSM_DIR}/externalpackages/$PACKAGENAME
+
 		echo "======================================================";
 		echo "       Installing $PACKAGENAME                        ";
@@ -184,5 +183,5 @@
 
 		./$PACKAGEINST $NUMCPUS_INSTALL &> compil.log
-		if [ $? -ne 0 ] && [ "$PACKAGENAME" != "boost" ]; then
+		if [ $? -ne 0 ] && [ "${PACKAGENAME}" != "boost" ]; then
 			cat compil.log
 			echo "======================================================";
@@ -198,5 +197,5 @@
 			echo "<testcase classname=\"externalpackages\" name=\"$PACKAGENAME\"/>" >> $EXTERNAL_TEST_FILE
 		fi
-		source $ISSM_DIR/etc/environment.sh
+		source ${ISSM_DIR}/etc/environment.sh
 
 		#If external package is rebuilt, we also need to recompile
@@ -210,4 +209,5 @@
 	fi
 done
+
 echo '</testsuite>' >> $EXTERNAL_TEST_FILE
 
@@ -219,13 +219,14 @@
 fi
 
-# Source here to include any newly installed externalpackages on the path.
-source $ISSM_DIR/etc/environment.sh
-
-if [ "$OS" == "win" ]; then
+# Source here to include any newly-installed external packages on the path
+source ${ISSM_DIR}/etc/environment.sh
+
+if [ "${OS}" == CYGWIN* ]; then
 	echo " == WINDOWS ENVIRONMENT DETECTED =="
-	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
-fi
-
-# Set CXX/CC flags for JS runs after exnteralpackages to avoid conflicts during their compilation
+	source ${ISSM_DIR}/externalpackages/windows/windows_environment.sh
+fi
+
+# Set CXX/CC flags for JS runs after external packages to avoid conflicts 
+# during their compilation
 #
 # TODO:
@@ -235,4 +236,5 @@
 # - Revisit enviroment variables (especially EMCC_CFLAGS) once support for
 #	Fortran has been accomplished.
+#
 CXX_PREVIOUS=$CXX
 CC_PREVIOUS=$CC
@@ -244,14 +246,12 @@
 	#export EMCC_DEBUG=1 # Uncomment to enable debugging
 	export EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0" # Required after v1.38.14 to avoid undefined symbol warnings from our Fortran object files being treated as errors
-	source $ISSM_DIR/externalpackages/emscripten/install/emsdk_env.sh
+	source ${ISSM_DIR}/externalpackages/emscripten/install/emsdk_env.sh
 fi
 
 #}}}
 #ISSM compilation yes/no                (ISSM_COMPILATION) {{{
-if [ "$ISSM_COMPILATION" == "yes" ]
-then
+if [ "${ISSM_COMPILATION}" == "yes" ]; then
 	cd $ISSM_DIR
-	if [ "$ISSM_RECONFIGURE" == "yes" ]
-	then
+	if [ "${ISSM_RECONFIGURE}" == "yes" ]; then
 		echo "======================================================";
 		echo "             Cleaning up and reconfiguring            "
@@ -264,5 +264,5 @@
 			exit 1
 		fi
-		eval "./configure $ISSM_CONFIG"
+		eval "./configure ${ISSM_CONFIG}"
 		if [ $? -ne 0 ]; then
 			echo "ISSM configuration failed (see options below)"
@@ -274,11 +274,15 @@
 
 	#4: compile and install ISSM
-	echo "======================================================";
+	echo "======================================================"
 	echo "                    Compiling ISSM                    "
-	echo "======================================================";
+	echo "======================================================"
 	if [ $NUMCPUS_INSTALL -gt 1 ]; then
-		echo "Making with " $NUMCPUS_INSTALL " cpus"
+		echo "Making with ${NUMCPUS_INSTALL} cpus"
+
+		# To debug compilation/linking, add 'V=1' option to the call to make
+		#make -j $NUMCPUS_INSTALL V=1
 		make -j $NUMCPUS_INSTALL
 	else
+		#make V=1
 		make
 	fi
@@ -294,6 +298,5 @@
 	fi
 	make install
-elif [ "$ISSM_COMPILATION" == "no" ]
-then
+elif [ "${ISSM_COMPILATION}" == "no" ]; then
 	echo "Skipping ISSM compilation"
 else
@@ -310,80 +313,94 @@
 # {{{
 if [ $MATLAB_TEST -eq 1 ]; then
-#Launch all tests on different cpus
-for (( i=1;i<=$NUMCPUS_RUN;i++ ))
-do
-	#Launch matlab and the nightly run script
-	cat > $ISSM_DIR/nightlylog/matlab_run$i.m << EOF
-	warning off %necessary to avoid a log of several Go for parallel runs
-	try,
-	$(if [ "$MATLAB_NROPTIONS" = "" ]; then
-		echo "runme('output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
+	MINGW=0
+	if [[ $(uname -s) == MINGW* ]]; then
+		MINGW=1
+		if [ -z "${ISSM_DIR_WIN+x}" ]; then
+			export ISSM_DIR_WIN=$(cygpath -w "${ISSM_DIR}")
+		fi
+	fi
+
+	#Launch all tests on different cpus
+	for (( i=1;i<=$NUMCPUS_RUN;i++ )); do
+		#Launch matlab and the nightly run script
+		cat > ${ISSM_DIR}/nightlylog/matlab_run$i.m << EOF
+		warning off %necessary to avoid a log of several Go for parallel runs
+		try,
+			$(if [ "${MATLAB_NROPTIONS}" = "" ]; then
+				echo "runme('output','nightly','rank',${i},'numprocs',${NUMCPUS_RUN});"
+			else
+				echo "runme(${MATLAB_NROPTIONS},'output','nightly','rank',${i},'numprocs',${NUMCPUS_RUN});"
+			fi)
+		catch me,
+			%An error occured, get report and exit
+			message=getReport(me)
+			directory=strsplit(pwd,'/');
+			fid=fopen([issmdir '/nightlylog/matlaberror.log'], 'at');
+			fprintf(fid,'\nMatlab error occured in: %s\n\n',directory{end});
+			fprintf(fid,'%s',message);
+			fclose(fid);
+		end
+		disp('MATLABEXITEDCORRECTLY');
+		exit
+EOF
+		cd $ISSM_DIR/test/NightlyRun
+		if [[ "${OS}" == CYGWIN* || ${MINGW} -eq 1 ]]; then
+			$MATLAB_PATH/bin/matlab -nodesktop -nosplash -nojvm -r "addpath ${ISSM_DIR_WIN}/src/m/dev; devpath; addpath ${ISSM_DIR_WIN}/nightlylog; matlab_run$i" -logfile ${ISSM_DIR_WIN}/nightlylog/matlab_log$i.log &
+		else
+			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath ${ISSM_DIR}/src/m/dev; devpath; addpath ${ISSM_DIR}/nightlylog; matlab_run$i" -logfile ${ISSM_DIR}/nightlylog/matlab_log$i.log &
+		fi
+	done
+
+	# Wait for MATLAB to exit
+	#
+	# TODO:
+	# - Replace by adding -wait option to above calls to matlab?
+	#
+	if [[ "${OS}" == CYGWIN* ]]; then
+		sleep 5;
+		echo "Waiting for MATLAB to exit"
+		pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
+		echo '-----------------------------'
+		echo "pid: ${pid}"
+		echo '-----------------------------'
+		while [ -n "${pid}" ]; do
+			pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
+			sleep 1;
+		done
+		echo "DONE!"
+	elif [[ ${MINGW} -eq 1 ]]; then
+		# NOTE: The PID query used here may work as well on Cygwin. If so, combine the two conditional blocks.
+		sleep 5;
+		echo "Waiting for MATLAB to exit"
+		pid=$(ps -W | grep MATLAB | awk '{print $1}')
+		echo '-----------------------------'
+		echo "pid: ${pid}"
+		echo '-----------------------------'
+		while [ -n "${pid}" ]; do
+			pid=$(ps -W | grep MATLAB | awk '{print $1}')
+			sleep 1;
+		done
 	else
-		echo "runme($MATLAB_NROPTIONS,'output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
-	fi
-	)
-	catch me,
-		%An error occured, get report and exit
-		message=getReport(me)
-		directory=strsplit(pwd,'/');
-		fid=fopen([issmdir '/nightlylog/matlaberror.log'], 'at');
-		fprintf(fid,'\nMatlab error occured in: %s\n\n',directory{end});
-		fprintf(fid,'%s',message);
-		fclose(fid);
-	end
-	disp('MATLABEXITEDCORRECTLY');
-
-	exit
-EOF
-	cd $ISSM_DIR/test/NightlyRun
-	if [ "$OS" = "win" ]; then
-		$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR_WIN/src/m/dev; devpath; addpath $ISSM_DIR_WIN/nightlylog/; matlab_run$i" -logfile $ISSM_DIR_WIN/nightlylog/matlab_log$i.log &
-	else
-		$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR/src/m/dev; devpath; addpath $ISSM_DIR/nightlylog/; matlab_run$i" -logfile $ISSM_DIR/nightlylog/matlab_log$i.log &
-	fi
-done
-
-#wait until matlab closes
-if [ "$OS" = "win" ]; then
-	sleep 5;
-	echo "Waiting for matlab on windows"
-	pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
-	echo '-----------------------------'
-	echo "pid: $pid"
-	echo '-----------------------------'
-	while [ -n "$pid" ]
-	do
-		pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
-		sleep 1;
-	done
-	echo "DONE!"
-else
-	wait
-fi
-
-#concatenate reports
-cd $ISSM_DIR/nightlylog/
-#echo 'CHECKING NIGHTLYLOG DIRECTORY'
-#echo '-----------------------------'
-#ls -la
-#echo '-----------------------------'
-
-if [ -f matlab_log.log ]; then
-	rm matlab_log.log
-fi
-
-for job in `jobs -p`
-do
-	echo "Waiting on: $job"
-	wait $job
-done
-
-for (( i=1;i<=$NUMCPUS_RUN;i++ ))
-do
-	cat matlab_log$i.log >> matlab_log.log
-done
-
-#filter out windows characters:
-cat matlab_log.log | tr -cd '\11\12\40-\176' > matlab_log.log2 && mv matlab_log.log2 matlab_log.log
+		wait
+	fi
+
+	# Concatenate logs
+	cd $ISSM_DIR/nightlylog
+
+	if [ -f matlab_log.log ]; then
+		rm matlab_log.log
+	fi
+
+	for job in `jobs -p`; do
+		#echo "Waiting on: ${job}" # Commented out because it really has nothing to do with MATLAB processes
+		wait $job
+	done
+
+	for (( i=1;i<=$NUMCPUS_RUN;i++ )); do
+		cat matlab_log$i.log >> matlab_log.log
+	done
+
+	#filter out windows characters:
+	cat matlab_log.log | tr -cd '\11\12\40-\176' > matlab_log.log2 && mv matlab_log.log2 matlab_log.log
 fi
 # }}}
@@ -395,5 +412,5 @@
 if [ $PYTHON_TEST -eq 1 ]; then
 	#Launch all tests on different cpus
-	export PYTHONPATH="$ISSM_DIR/src/m/dev"
+	export PYTHONPATH="${ISSM_DIR}/src/m/dev"
 	export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
 	export PYTHONUNBUFFERED=1 #we don't want python to buffer otherwise issm.exe output is not captured
@@ -406,6 +423,6 @@
 	done
 
-	# concatenate reports
-	cd $ISSM_DIR/nightlylog/
+	# Concatenate logs
+	cd $ISSM_DIR/nightlylog
 	if [ -f python_log.log ]; then
 		rm python_log.log
@@ -414,5 +431,5 @@
 	for job in `jobs -p`
 	do
-		echo "Waiting on: $job"
+		echo "Waiting on: ${job}"
 		wait $job
 	done
@@ -429,109 +446,16 @@
 rm -f $ISSM_DIR/execution/*/ADOLC-*
 
-# Examples Test
+# Examples Tests
 # {{{
-# This test will allow us to check on the status of the examples.
-if [ $EXAMPLES_TEST -eq 1 ];
-then
-	FILE='runme.m'
-	cd $ISSM_DIR/examples
-
-	for dir in ./* ;
-	do
-		if [ -d "${dir}" ];
-		then
-		# Some of the examples are incomplete (on purpose). As such, we will
-		# have to populate the missing steps in order to make sure that
-		# everything is working.
-			echo "Testing directory example: $(basename $dir)"
-
-			if [ -z "$SED" ];
-			then
-				SED='sed'
-			fi
-
-			cd ${dir}
-
-			if [ "${dir}" == "./Greenland" ];
-			then
-				# Greenland is missing step 8
-				STEP_EIGHT="\n	disp('   Step 8: Plotting exercise');\n	md = loadmodel('.\/Models\/Greenland.HistoricTransient');\n	figure\n	surfmb=[]; for i=2:201; surfmb=[surfmb ...\n		md.results.TransientSolution(i).SmbMassBalance]; end\n	subplot(3,1,1); plot([1:200],mean(surfmb));\n	title('Mean Surface mass balance');\n	vel=[]; for i=2:201; vel=[vel md.results.TransientSolution(i).Vel]; end\n	subplot(3,1,2); plot([1:200],mean(vel));\n	title('Mean Velocity');\n	volume=[]; for i=2:201; volume=[volume md.results.TransientSolution(i).IceVolume]; end\n	subplot(3,1,3); plot([1:200],volume);\n	title('Ice Volume'); xlabel('years');"
-
-				$SED -i .bak 's/steps=\[1\];/steps=\[1:8\];\n\ntry\n/' $FILE
-				$SED -i .bak "s/if any(steps==8)/&${STEP_EIGHT}/" $FILE
-			elif [ "${dir}" == "./IceBridge" ];
-			then
-				$SED -i .bak 's/steps=\[1\];/steps=\[1:5\];\n\ntry\n/' $FILE
-			elif [ "${dir}" == "./IceflowModels" ];
-			then
-				# Almost nothing to this example
-				$SED -i .bak '1 s/^.*$/try\n\n&/' $FILE
-			elif [ "${dir}" == "./ISMIP" ];
-			then
-				# Eight steps... none of which are implmented in the script...
-				$SED -i .bak '1 s/^.*$/try\n\n&/' $FILE
-			elif [ "${dir}" == "./Inversion" ];
-			then
-				$SED -i .bak 's/steps=\[1\];/steps=\[1:4\];\n\ntry\n/' $FILE
-			elif [ "${dir}" == "./Jakobshavn" ];
-			then
-				$SED -i .bak 's/steps=\[1\];/steps=\[1:4\];\n\ntry\n/' $FILE
-			elif [ "${dir}" == "./Jakobshavn" ];
-			then
-				$SED -i .bak 's/steps=\[1\];/steps=\[1:4\];\n\ntry\n/' $FILE
-			elif [ "${dir}" == "./Pig" ];
-			then
-				# Step 6 is needed
-				STEP_SIX="\n disp('Needs work!')"
-				$SED -i .bak 's/steps=\[1\];/steps=\[1:7\];\n!mv DomainOutline.bkp DomainOutline.exp;\n\ntry\n/' $FILE
-				$SED -i .bak "s/if any(steps==6)/&${STEP_SIX}/" $FILE
-			elif [ "${dir}" == "./PigSensitivity" ];
-			then
-				# Step 4 is needed
-				STEP_FOUR="\n disp('Needs work!')"
-				$SED -i .bak 's/steps=\[1\];/steps=\[1:4\];\n\ntry\n/' $FILE
-				$SED -i .bak "s/if any(steps==6)/&${STEP_FOUR}/" $FILE
-			elif [ "${dir}" == "./SquareIceShelf" ];
-			then
-				# Almost nothing to this example
-				$SED -i .bak '1 s/^.*$/try\n\n&/' $FILE
-			elif [ "${dir}" == "./UncertaintyQuantification" ];
-			then
-				$SED -i .bak 's/steps=\[1\];/steps=\[1:7\];\n\ntry\n/' $FILE
-			elif [ "${dir}" == "./Data" ];
-			then
-				echo "Data directory is used by examples. No modifications required."
-			else
-				echo "Not implemented yet!"
-				$SED -i .bak '1 s/^.*$/try\n\n&/' $FILE
-			fi
-
-			if [ "${dir}" == "./Data" ];
-			then
-				./Download.sh
-			else
-				LOG_FILE="matlab_log_$(basename $dir)_examples.log"
-				echo "disp('SUCCESS');" >> $FILE
-				echo 'catch me' >> $FILE
-				echo 'message=getReport(me);' >> $FILE
-				echo "fprintf('%s',message);" >> $FILE
-				echo "disp('FAILURE');" >> $FILE
-				echo 'end' >> $FILE
-
-				$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR/src/m/dev; devpath; addpath $ISSM_DIR/nightlylog/; runme" -logfile $ISSM_DIR/nightlylog/$LOG_FILE
-				echo "starting: $(basename $dir)" >> $ISSM_DIR/nightlylog/matlab_log_examples.log
-				cat $ISSM_DIR/nightlylog/$LOG_FILE >> $ISSM_DIR/nightlylog/matlab_log_examples.log
-				echo "finished: $(basename $dir)" >> $ISSM_DIR/nightlylog/matlab_log_examples.log
-			fi
-			cd ..
-		fi
-	done
+if [ $EXAMPLES_TEST -eq 1 ]; then
+	export MATLAB_PATH
+	$ISSM_DIR/jenkins/examples_tests.sh
 fi
 # }}}
 
-#process logs to be junit compatible
+# Process logs to be JUnit compatible
 #{{{
-cd $ISSM_DIR/nightlylog/
-source $ISSM_DIR/externalpackages/shell2junit/install/sh2ju.sh
+cd $ISSM_DIR/nightlylog
+source $ISSM_EXT_DIR/shell2junit/install/bin/sh2ju.sh
 juLogClean
 
@@ -541,16 +465,14 @@
 	testlist=`cat matlab_log.log | grep "\-\-\-\-\-\-\-\-starting" | sed 's/----------------starting://g' | sed 's/-//g'`
 
-	#look through numtests:
-	for i in `echo $testlist`
-	do
-		juLog -test=MATLAB-$i -name=Error -error=ERROR awk "/starting:$i/{flag=1;next}/finished/{flag=0} flag{print}" matlab_log.log
-		juLog -test=MATLAB-$i -name=Failure -error=FAILURE awk "/starting:$i/{flag=1;next}/finished/{flag=0} flag{print}" matlab_log.log
+	# NOTE: Matching pattern is "----------------starting:<TEST_NUM>-". Note trailing hyphen, which guards against greedy matching of, for example, "2010" when searching for "201".
+	for i in `echo $testlist`; do
+		juLog -test=MATLAB-$i -name=Error -error=ERROR awk "/starting:${i}-/{flag=1;next}/finished:${i}-/{flag=0} flag{print}" matlab_log.log
+		juLog -test=MATLAB-$i -name=Failure -error=FAILURE awk "/starting:${i}-/{flag=1;next}/finished:${i}-/{flag=0} flag{print}" matlab_log.log
 	done
 
 	# Check that MATLAB did not exit in error
-	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run|license" matlab_log.log | wc -l`
-
-	if [ $matlabExitedInError -ne 0 ]
-	then
+	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run|Illegal use of reserved keyword" matlab_log.log | wc -l`
+
+	if [ $matlabExitedInError -ne 0 ]; then
 		echo "----------MATLAB exited in error!----------"
 		cat matlab_log.log
@@ -569,9 +491,8 @@
 	testlist=`cat python_log.log | grep "\-\-\-\-\-\-\-\-starting" | sed 's/----------------starting://g' | sed 's/-//g'`
 
-	#look through numtests:
-	for i in `echo $testlist`
-	do
-		juLog -test=PYTHON-$i -name=Error -error=ERROR awk "/starting:$i/{flag=1;next}/finished/{flag=0} flag{print}" python_log.log
-		juLog -test=PYTHON-$i -name=Failure -error=FAILURE awk "/starting:$i/{flag=1;next}/finished/{flag=0} flag{print}" python_log.log
+	# NOTE: Matching pattern is "----------------starting:<TEST_NUM>-". Note trailing hyphen, which guards against greedy matching of, for example, "2010" when searching for "201".
+	for i in `echo $testlist`; do
+		juLog -test=PYTHON-$i -name=Error -error=ERROR awk "/starting:${i}-/{flag=1;next}/finished:${i}-/{flag=0} flag{print}" python_log.log
+		juLog -test=PYTHON-$i -name=Failure -error=FAILURE awk "/starting:${i}-/{flag=1;next}/finished:${i}-/{flag=0} flag{print}" python_log.log
 	done
 
@@ -579,6 +500,5 @@
 	pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python_log.log | wc -l`
 
-	if [ $pythonExitedInError -ne 0 ]
-	then
+	if [ $pythonExitedInError -ne 0 ]; then
 		echo "----------Python exited in error!----------"
 		cat python_log.log
@@ -590,22 +510,31 @@
 		exit 1
 	fi
-
-	# Python tests must have run and exited successfully (unless we have missed something)
-	echo "PYTHONEXITEDCORRECTLY"
-fi
-
-if [ $EXAMPLES_TEST -eq 1 ];
-then
-	# Inexplicably, there are backspace chars in the error output that are causing issues
-	$SED -i .bak 's///g' matlab_log_examples.log
+fi
+
+if [ $EXAMPLES_TEST -eq 1 ]; then
+	# Inexplicably, there are backspace characters in the error output; remove them
+	perl -p -i'.bak' -e 's/\x08//g' matlab_log_examples.log
 
 	numtests=`cat matlab_log_examples.log | grep "starting: " | wc -l`
 	testlist=`cat matlab_log_examples.log | grep "starting: " | sed 's/starting: //'`
 
-	echo "Processing: $numtests"
-	for i in `echo $testlist`
-	do
-		juLog -test=Example-$i -name=Error -error=FAILURE awk "/starting: $i/{flag=1;next}/finished: $i/{flag=0} flag{print}" matlab_log_examples.log
-	done
+	for i in `echo $testlist`; do
+		juLog -test=Example-$i -name=Error -error=ERROR awk "/^starting: ${i}$/{flag=1;next}/^finished: ${i}$/{flag=0} flag{print}" matlab_log_examples.log
+		juLog -test=Example-$i -name=Failure -error=FAILURE awk "/^starting: ${i}$/{flag=1;next}/^finished: ${i}$/{flag=0} flag{print}" matlab_log_examples.log
+	done
+
+	# Check that MATLAB did not exit in error
+	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run|Illegal use of reserved keyword" matlab_log_examples.log | wc -l`
+
+	if [ $matlabExitedInError -ne 0 ]; then
+		echo "----------MATLAB exited in error!----------"
+		cat matlab_log_examples.log
+		echo "-----------End of matlab_log.log-----------"
+
+		# Clean up execution directory
+		rm -rf $ISSM_DIR/execution/*
+
+		exit 1
+	fi
 fi
 
Index: /issm/trunk/jenkins/linux64_caladan
===================================================================
--- /issm/trunk/jenkins/linux64_caladan	(revision 26743)
+++ /issm/trunk/jenkins/linux64_caladan	(revision 26744)
@@ -16,4 +16,5 @@
 	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
 	--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
 	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
Index: /issm/trunk/jenkins/linux64_caladan_ad
===================================================================
--- /issm/trunk/jenkins/linux64_caladan_ad	(revision 26743)
+++ /issm/trunk/jenkins/linux64_caladan_ad	(revision 26744)
@@ -14,5 +14,5 @@
 	--without-kriging \
 	--without-kml \
-	--without-Gia \
+	--without-Sealevelchange \
 	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
 	--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install \
@@ -31,5 +31,5 @@
 #List of external pakages to be installed and their installation scripts
 EXTERNALPACKAGES="
-	autotools	install.sh
+	autotools	install-linux.sh
 	cmake		install.sh
 	mpich		install-3.2-linux64.sh
Index: /issm/trunk/jenkins/linux64_caladan_ampi
===================================================================
--- /issm/trunk/jenkins/linux64_caladan_ampi	(revision 26743)
+++ /issm/trunk/jenkins/linux64_caladan_ampi	(revision 26744)
@@ -13,5 +13,5 @@
 	--without-kriging \
 	--without-kml \
-	--without-Gia \
+	--without-Sealevelchange \
 	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
 	--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install \
@@ -19,4 +19,5 @@
 	--with-matlab-dir=$MATLAB_PATH \
 	--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include \
 	--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpi" \
@@ -40,5 +41,5 @@
 #List of external pakages to be installed and their installation scripts
 EXTERNALPACKAGES="
-	autotools		install.sh
+	autotools		install-linux.sh
 	cmake			install.sh
 	mpich			install-3.2-linux64.sh
Index: /issm/trunk/jenkins/pine_island-mac-adolc-ampion
===================================================================
--- /issm/trunk/jenkins/pine_island-mac-adolc-ampion	(revision 26743)
+++ /issm/trunk/jenkins/pine_island-mac-adolc-ampion	(revision 26744)
@@ -13,14 +13,15 @@
 	--without-kriging \
 	--without-kml \
-	--without-Gia \
+	--without-Sealevelchange \
 	--without-Love \
 	--with-matlab-dir=${MATLAB_PATH} \
 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
+	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include  \
 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -40,5 +41,5 @@
 #
 EXTERNALPACKAGES="
-	autotools		install.sh
+	autotools		install-mac.sh
 	cmake			install.sh
 	petsc			install-3.12-mac.sh
Index: /issm/trunk/jenkins/pine_island-mac-basic
===================================================================
--- /issm/trunk/jenkins/pine_island-mac-basic	(revision 26743)
+++ /issm/trunk/jenkins/pine_island-mac-basic	(revision 26744)
@@ -12,9 +12,10 @@
 	--with-numthreads=4 \
 	--with-matlab-dir=${MATLAB_PATH} \
-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
+	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -32,5 +33,5 @@
 # List of external pakages to be installed and their installation scripts
 EXTERNALPACKAGES="
-	autotools	install.sh
+	autotools	install-mac.sh
 	cmake		install.sh
 	petsc		install-3.12-mac.sh
Index: /issm/trunk/jenkins/pine_island-mac-binaries-matlab
===================================================================
--- /issm/trunk/jenkins/pine_island-mac-binaries-matlab	(revision 26743)
+++ /issm/trunk/jenkins/pine_island-mac-binaries-matlab	(revision 26744)
@@ -19,9 +19,10 @@
 	--disable-dependency-tracking \
 	--with-matlab-dir=${MATLAB_PATH} \
-	--with-fortran-lib="/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/libgfortran.a /usr/local/Cellar/gcc/10.2.0/lib/gcc/10/libquadmath.a /usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin15/10.2.0/libgcc.a" \
+	--with-fortran-lib="/usr/local/Cellar/gcc/10.3.0/lib/gcc/10/libgfortran.a /usr/local/Cellar/gcc/10.3.0/lib/gcc/10/libquadmath.a /usr/local/Cellar/gcc/10.3.0/lib/gcc/10/gcc/x86_64-apple-darwin15/10.3.0/libgcc.a" \
 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -31,4 +32,5 @@
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
@@ -42,5 +44,5 @@
 
 EXTERNALPACKAGES="
-	autotools	install.sh
+	autotools	install-mac.sh
 	cmake		install.sh
 	petsc		install-3.12-mac-static.sh
@@ -50,9 +52,9 @@
 	curl		install-7-mac-static.sh
 	netcdf		install-4.7-parallel-static.sh
-	proj		install-6.2-static.sh
-	gdal		install-3-netcdf-static.sh
+	proj		install-8-static.sh
+	gdal		install-3-static.sh
 	gshhg		install.sh
 	gmt			install-6-mac-static.sh
-	gmsh		install-4-mac-static.sh
+	gmsh		install-4-static.sh
 	triangle	install-mac-static.sh
 	chaco		install.sh
Index: /issm/trunk/jenkins/pine_island-mac-binaries-python
===================================================================
--- /issm/trunk/jenkins/pine_island-mac-binaries-python	(revision 26743)
+++ /issm/trunk/jenkins/pine_island-mac-binaries-python	(revision 26744)
@@ -17,9 +17,10 @@
 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
-	--with-fortran-lib="/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/libgfortran.a /usr/local/Cellar/gcc/10.2.0/lib/gcc/10/libquadmath.a /usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin15/10.2.0/libgcc.a" \
+	--with-fortran-lib="/usr/local/Cellar/gcc/10.3.0/lib/gcc/10/libgfortran.a /usr/local/Cellar/gcc/10.3.0/lib/gcc/10/libquadmath.a /usr/local/Cellar/gcc/10.3.0/lib/gcc/10/gcc/x86_64-apple-darwin15/10.3.0/libgcc.a" \
 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -29,4 +30,5 @@
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
@@ -40,5 +42,5 @@
 
 EXTERNALPACKAGES="
-	autotools	install.sh
+	autotools	install-mac.sh
 	cmake		install.sh
 	petsc		install-3.12-mac-static.sh
@@ -48,9 +50,9 @@
 	curl		install-7-mac-static.sh
 	netcdf		install-4.7-parallel-static.sh
-	proj		install-6.2-static.sh
-	gdal		install-3-python-netcdf-static.sh
+	proj		install-8-static.sh
+	gdal		install-3-python-static.sh
 	gshhg		install.sh
 	gmt			install-6-mac-static.sh
-	gmsh		install-4-mac-python-static.sh
+	gmsh		install-4-static.sh
 	triangle	install-mac-static.sh
 	chaco		install.sh
Index: /issm/trunk/jenkins/pine_island-mac-dakota
===================================================================
--- /issm/trunk/jenkins/pine_island-mac-dakota	(revision 26743)
+++ /issm/trunk/jenkins/pine_island-mac-dakota	(revision 26744)
@@ -1,2 +1,6 @@
+# TODO: Change PROJ installation script to latest version once Jenkins macOS 
+#		build node has been upgraded.
+#
+
 #--------------------#
 # ISSM Configuration #
@@ -14,9 +18,10 @@
 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
+	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -26,4 +31,5 @@
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
@@ -38,22 +44,22 @@
 #List of external pakages to be installed and their installation scripts
 EXTERNALPACKAGES="
-	autotools		install.sh
-	cmake			install.sh
-	petsc			install-3.12-mac.sh
-	gsl				install.sh
-	boost			install-1.7-mac.sh
-	dakota			install-6.2-mac.sh
-	curl			install-7-mac.sh
-	netcdf			install-4.7-parallel.sh
-	proj			install-6.2.sh
-	gdal			install-3-python-netcdf.sh
-	gshhg			install.sh
-	gmt				install-6-mac.sh
-	gmsh			install-4.sh
-	triangle		install-mac.sh
-	chaco			install.sh
-	m1qn3			install.sh
-	semic			install.sh
-	shell2junit		install.sh
+	autotools	install-mac.sh
+	cmake		install.sh
+	petsc		install-3.12-mac.sh
+	gsl			install.sh
+	boost		install-1.7-mac.sh
+	dakota		install-6.2-mac.sh
+	curl		install-7-mac.sh
+	netcdf		install-4.7-parallel.sh
+	proj		install-6.sh
+	gdal		install-3-python.sh
+	gshhg		install.sh
+	gmt			install-6-mac.sh
+	gmsh		install-4.sh
+	triangle	install-mac.sh
+	chaco		install.sh
+	m1qn3		install.sh
+	semic		install.sh
+	shell2junit	install.sh
 "
 
Index: /issm/trunk/jenkins/pine_island-mac-examples
===================================================================
--- /issm/trunk/jenkins/pine_island-mac-examples	(revision 26744)
+++ /issm/trunk/jenkins/pine_island-mac-examples	(revision 26744)
@@ -0,0 +1,89 @@
+# NOTE: Same configuration as pine_island-mac-full
+#
+# TODO: Change PROJ installation script to latest version once Jenkins macOS 
+#		build node has been upgraded.
+#
+
+#--------------------#
+# ISSM Configuration #
+#--------------------#
+
+MATLAB_PATH="/Applications/MATLAB_R2018a.app"
+
+ISSM_CONFIG='\
+	--prefix=${ISSM_DIR} \
+	--disable-static \
+	--enable-development \
+	--enable-debugging \
+	--with-numthreads=4 \
+	--with-matlab-dir=${MATLAB_PATH} \
+	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
+	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
+	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-petsc-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+	--with-semic-dir=${ISSM_DIR}/externalpackages/semic/install \
+'
+
+#-------------------#
+# External Packages #
+#-------------------#
+
+EXTERNALPACKAGES="
+	autotools	install-mac.sh
+	cmake		install.sh
+	petsc		install-3.12-mac.sh
+	gsl			install.sh
+	boost		install-1.7-mac.sh
+	dakota		install-6.2-mac.sh
+	curl		install-7-mac.sh
+	netcdf		install-4.7-parallel.sh
+	proj		install-6.sh
+	gdal		install-3-python.sh
+	gshhg		install.sh
+	gmt			install-6-mac.sh
+	gmsh		install-4.sh
+	triangle	install-mac.sh
+	chaco		install.sh
+	m1qn3		install.sh
+	semic		install.sh
+	shell2junit	install.sh
+"
+
+#---------#
+# Testing #
+#---------#
+
+# Test suites
+MATLAB_TEST=0
+PYTHON_TEST=0
+JAVASCRIPT_TEST=0
+EXAMPLES_TEST=1
+
+# Number of CPUs used in ISSM compilation
+#
+# NOTE: One is usually safer as some packages are very sensitive to parallel
+# 		compilation
+#
+NUMCPUS_INSTALL=8
+
+# Number of CPUs used in the nightly runs
+NUMCPUS_RUN=1
+
+# Nightly run options
+MATLAB_NROPTIONS=""
+PYTHON_NROPTIONS=""
Index: /issm/trunk/jenkins/pine_island-mac-full
===================================================================
--- /issm/trunk/jenkins/pine_island-mac-full	(revision 26743)
+++ /issm/trunk/jenkins/pine_island-mac-full	(revision 26744)
@@ -1,4 +1,4 @@
 # NOTE: This configuration adds solid earth and Dakota capabilities to the 
-		basic build.
+#		basic build.
 
 #--------------------#
@@ -17,9 +17,10 @@
 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
+	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -29,4 +30,5 @@
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
@@ -40,5 +42,5 @@
 
 EXTERNALPACKAGES="
-	autotools	install.sh
+	autotools	install-mac.sh
 	cmake		install.sh
 	petsc		install-3.12-mac.sh
@@ -48,8 +50,8 @@
 	curl		install-7-mac.sh
 	netcdf		install-4.7-parallel.sh
-	proj		install-6.2.sh
-	gdal		install-3-python-netcdf.sh
+	proj		install-8.sh
+	gdal		install-3-python.sh
 	gshhg		install.sh
-	gmt			install-6.0-mac.sh
+	gmt			install-6-mac.sh
 	gmsh		install-4.sh
 	triangle	install-mac.sh
Index: /issm/trunk/jenkins/pine_island-mac-full-valgrind
===================================================================
--- /issm/trunk/jenkins/pine_island-mac-full-valgrind	(revision 26743)
+++ /issm/trunk/jenkins/pine_island-mac-full-valgrind	(revision 26744)
@@ -1,4 +1,4 @@
 # NOTE: This configuration adds solid earth and Dakota capabilities to the 
-		basic build, as well as the ability to debug with Valgrind.
+#		basic build, as well as the ability to debug with Valgrind.
 
 #--------------------#
@@ -17,9 +17,10 @@
 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
+	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -29,4 +30,5 @@
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
@@ -40,5 +42,5 @@
 
 EXTERNALPACKAGES="
-	autotools	install.sh
+	autotools	install-mac.sh
 	cmake		install.sh
 	petsc		install-3.12-mac.sh
@@ -48,8 +50,8 @@
 	curl		install-7-mac.sh
 	netcdf		install-4.7-parallel.sh
-	proj		install-6.2.sh
-	gdal		install-3-python-netcdf.sh
+	proj		install-8.sh
+	gdal		install-3-python.sh
 	gshhg		install.sh
-	gmt			install-6.0-mac.sh
+	gmt			install-6-mac.sh
 	gmsh		install-4.sh
 	triangle	install-mac.sh
Index: /issm/trunk/jenkins/pine_island-mac-python
===================================================================
--- /issm/trunk/jenkins/pine_island-mac-python	(revision 26743)
+++ /issm/trunk/jenkins/pine_island-mac-python	(revision 26744)
@@ -11,9 +11,10 @@
 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
+	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -23,4 +24,5 @@
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
@@ -35,5 +37,5 @@
 # List of external pakages to be installed and their installation scripts
 EXTERNALPACKAGES="
-	autotools	install.sh
+	autotools	install-mac.sh
 	cmake		install.sh
 	petsc		install-3.12-mac.sh
@@ -43,6 +45,6 @@
 	curl		install-7-mac.sh
 	netcdf		install-4.7-parallel.sh
-	proj		install-6.2.sh
-	gdal		install-3-python-netcdf.sh
+	proj		install-8.sh
+	gdal		install-3-python.sh
 	gshhg		install.sh
 	gmt			install-6-mac.sh
Index: /issm/trunk/jenkins/pine_island-mac-solid_earth
===================================================================
--- /issm/trunk/jenkins/pine_island-mac-solid_earth	(revision 26743)
+++ /issm/trunk/jenkins/pine_island-mac-solid_earth	(revision 26744)
@@ -1,2 +1,6 @@
+# TODO: Change PROJ installation script to latest version once Jenkins macOS 
+#		build node has been upgraded.
+#
+
 #--------------------#
 # ISSM Configuration #
@@ -14,9 +18,10 @@
 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
+	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -26,4 +31,5 @@
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
@@ -38,22 +44,22 @@
 #List of external pakages to be installed and their installation scripts
 EXTERNALPACKAGES="
-	autotools		install.sh
-	cmake			install.sh
-	petsc			install-3.12-mac.sh
-	gsl				install.sh
-	boost			install-1.7-mac.sh
-	dakota			install-6.2-mac.sh
-	curl			install-7-mac.sh
-	netcdf			install-4.7-parallel.sh
-	proj			install-6.2.sh
-	gdal			install-3-python-netcdf.sh
-	gshhg			install.sh
-	gmt				install-6-mac.sh
-	gmsh			install-4.sh
-	triangle		install-mac.sh
-	chaco			install.sh
-	m1qn3			install.sh
-	semic			install.sh
-	shell2junit		install.sh
+	autotools	install-mac.sh
+	cmake		install.sh
+	petsc		install-3.12-mac.sh
+	gsl			install.sh
+	boost		install-1.7-mac.sh
+	dakota		install-6.2-mac.sh
+	curl		install-7-mac.sh
+	netcdf		install-4.7-parallel.sh
+	proj		install-6.sh
+	gdal		install-3-python.sh
+	gshhg		install.sh
+	gmt			install-6-mac.sh
+	gmsh		install-4.sh
+	triangle	install-mac.sh
+	chaco		install.sh
+	m1qn3		install.sh
+	semic		install.sh
+	shell2junit	install.sh
 "
 
@@ -85,4 +91,4 @@
 # - Excluding 2006 until it can be debugged (file I/O)
 #
-MATLAB_NROPTIONS="'benchmark','slr','exclude',[2006]"
-PYTHON_NROPTIONS="--benchmark slr --exclude 2005 2006"
+MATLAB_NROPTIONS="'benchmark','slc','exclude',[2004 2006 2051 2052 2053 2084 2085 2424 2425]"
+PYTHON_NROPTIONS="--benchmark slc --exclude 2004 2006 2051 2052 2053 2084 2085 2424 2425"
Index: /issm/trunk/jenkins/pine_island-mac-solid_earth-lambert
===================================================================
--- /issm/trunk/jenkins/pine_island-mac-solid_earth-lambert	(revision 26744)
+++ /issm/trunk/jenkins/pine_island-mac-solid_earth-lambert	(revision 26744)
@@ -0,0 +1,94 @@
+# TODO: Change PROJ installation script to latest version once Jenkins macOS 
+#		build node has been upgraded.
+#
+
+#--------------------#
+# ISSM Configuration #
+#--------------------#
+
+MATLAB_PATH="/Applications/MATLAB_R2018a.app"
+
+ISSM_CONFIG='\
+	--prefix=${ISSM_DIR} \
+	--disable-static \
+	--enable-development \
+	--enable-debugging \
+	--with-numthreads=4 \
+	--with-matlab-dir=${MATLAB_PATH} \
+	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
+	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
+	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-petsc-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+	--with-semic-dir=${ISSM_DIR}/externalpackages/semic/install \
+'
+
+#-------------------#
+# External Packages #
+#-------------------#
+
+#List of external pakages to be installed and their installation scripts
+EXTERNALPACKAGES="
+	autotools	install-mac.sh
+	cmake		install.sh
+	petsc		install-3.12-mac.sh
+	gsl			install.sh
+	boost		install-1.7-mac.sh
+	dakota		install-6.2-mac.sh
+	curl		install-7-mac.sh
+	netcdf		install-4.7-parallel.sh
+	proj		install-6.sh
+	gdal		install-3-python.sh
+	gshhg		install.sh
+	gmt			install-6-mac.sh
+	gmsh		install-4.sh
+	triangle	install-mac.sh
+	chaco		install.sh
+	m1qn3		install.sh
+	semic		install.sh
+	shell2junit	install.sh
+"
+
+#---------#
+# Testing #
+#---------#
+
+# Test suites
+MATLAB_TEST=1
+PYTHON_TEST=1
+JAVASCRIPT_TEST=0
+EXAMPLES_TEST=0
+
+# Number of CPUs used in ISSM compilation
+#
+# NOTE: One is usually safer as some packages are very sensitive to parallel
+# 		compilation
+#
+NUMCPUS_INSTALL=4
+
+# Number of CPUs used in the nightly runs
+NUMCPUS_RUN=2
+
+# Nightly run options
+#
+# See documentation in test/NightlyRun/runme.* for more information.
+#
+# NOTE:
+# - Excluding 2006 until it can be debugged (file I/O)
+#
+MATLAB_NROPTIONS="'benchmark','slc','exclude',[2006]"
+PYTHON_NROPTIONS="--benchmark slc --exclude 2005 2006"
Index: /issm/trunk/jenkins/pleiades-basic
===================================================================
--- /issm/trunk/jenkins/pleiades-basic	(revision 26744)
+++ /issm/trunk/jenkins/pleiades-basic	(revision 26744)
@@ -0,0 +1,56 @@
+#--------------------#
+# ISSM Configuration #
+#--------------------#
+
+ISSM_CONFIG='\
+	--prefix=${ISSM_DIR} \
+	--with-wrappers=no \
+	--with-petsc-dir="${ISSM_DIR}/externalpackages/petsc/install" \
+	--with-m1qn3-dir="${ISSM_DIR}/externalpackages/m1qn3/install" \
+	--with-mpi-include=" " \
+	--with-mpi-libflags=" -lmpi" \
+	--with-mkl-libflags="-L/nasa/intel/Compiler/2016.2.181/mkl/lib/intel64/ -mkl=cluster " \
+	--with-metis-dir="${ISSM_DIR}/externalpackages/petsc/install" \
+	--with-mumps-dir="${ISSM_DIR}/externalpackages/petsc/install" \
+	--with-scalapack-dir="${ISSM_DIR}/externalpackages/petsc/install" \
+	--with-cxxoptflags="-g -O3 -axCORE-AVX2,AVX -xSSE4.2 -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile " \
+	--with-fortran-lib="-L/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64/ -lifcore -lifport" \
+	--with-vendor="intel-pleiades" \
+	--enable-development
+'
+
+#-------------------#
+# External Packages #
+#-------------------#
+
+EXTERNALPACKAGES="
+	petsc	install-3.13-pleiades.sh
+	m1qn3	install.sh
+"
+
+#---------#
+# Testing #
+#---------#
+
+# Test suites
+MATLAB_TEST=0
+PYTHON_TEST=0
+JAVASCRIPT_TEST=0
+EXAMPLES_TEST=0
+
+# Number of CPUs used in ISSM compilation
+#
+# NOTE: One is usually safer as some packages are very sensitive to parallel
+# 		compilation.
+#
+NUMCPUS_INSTALL=8
+
+# Number of CPUs used in the nightly runs
+NUMCPUS_RUN=1
+
+# Nightly run options
+#
+# See documentation in test/NightlyRun/runme.* for more information.
+#
+MATLAB_NROPTIONS=""
+PYTHON_NROPTIONS=""
Index: /issm/trunk/jenkins/ross-debian_linux-adolc-ampioff
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-adolc-ampioff	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-adolc-ampioff	(revision 26744)
@@ -12,5 +12,5 @@
 	--without-kriging \
 	--without-kml \
-	--without-Gia \
+	--without-Sealevelchange \
 	--without-Love \
 	--with-matlab-dir=${MATLAB_PATH} \
@@ -21,4 +21,5 @@
 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -38,5 +39,5 @@
 #
 EXTERNALPACKAGES="
-	autotools	install-debian-linux.sh
+	autotools	install-linux.sh
 	cmake		install.sh
 	petsc		install-3.12-linux.sh
Index: /issm/trunk/jenkins/ross-debian_linux-adolc-ampion
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-adolc-ampion	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-adolc-ampion	(revision 26744)
@@ -12,5 +12,5 @@
 	--without-kriging \
 	--without-kml \
-	--without-Gia \
+	--without-Sealevelchange \
 	--without-Love \
 	--with-matlab-dir=${MATLAB_PATH} \
@@ -22,4 +22,5 @@
 	--with-ampi-dir=${ISSM_DIR}/externalpackages/adjoinablempi/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -39,5 +40,5 @@
 #
 EXTERNALPACKAGES="
-	autotools		install-debian-linux.sh
+	autotools		install-linux.sh
 	cmake			install.sh
 	petsc			install-3.12-linux.sh
Index: /issm/trunk/jenkins/ross-debian_linux-basic
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-basic	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-basic	(revision 26744)
@@ -16,4 +16,5 @@
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -30,5 +31,5 @@
 
 EXTERNALPACKAGES="
-	autotools	install-debian-linux.sh
+	autotools	install-linux.sh
 	cmake		install.sh
 	petsc		install-3.12-linux.sh
Index: /issm/trunk/jenkins/ross-debian_linux-binaries
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-binaries	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-binaries	(revision 26744)
@@ -25,4 +25,5 @@
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -38,5 +39,5 @@
 
 EXTERNALPACKAGES="
-	autotools	install-debian-linux.sh
+	autotools	install-linux.sh
 	cmake		install.sh
 	petsc		install-3.12-linux-static.sh
Index: /issm/trunk/jenkins/ross-debian_linux-binaries-matlab
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-binaries-matlab	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-binaries-matlab	(revision 26744)
@@ -31,4 +31,5 @@
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
@@ -41,5 +42,5 @@
 
 EXTERNALPACKAGES="
-	autotools	install-debian-linux.sh
+	autotools	install-linux.sh
 	cmake		install.sh
 	petsc		install-3.12-linux-static.sh
@@ -49,9 +50,9 @@
 	curl		install-7-linux-static.sh
 	netcdf		install-4.7-parallel-static.sh
-	proj		install-6.2-static.sh
-	gdal		install-3-netcdf-static.sh
+	proj		install-8-static.sh
+	gdal		install-3-static.sh
 	gshhg		install.sh
 	gmt			install-6-linux-static.sh
-	gmsh		install-4-linux-static.sh
+	gmsh		install-4-static.sh
 	triangle	install-linux-static.sh
 	chaco		install.sh
Index: /issm/trunk/jenkins/ross-debian_linux-binaries-python
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-binaries-python	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-binaries-python	(revision 26744)
@@ -23,4 +23,5 @@
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -30,4 +31,5 @@
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
@@ -40,5 +42,5 @@
 
 EXTERNALPACKAGES="
-	autotools	install-debian-linux.sh
+	autotools	install-linux.sh
 	cmake		install.sh
 	petsc		install-3.12-linux-static.sh
@@ -48,9 +50,9 @@
 	curl		install-7-linux-static.sh
 	netcdf		install-4.7-parallel-static.sh
-	proj		install-6.2-static.sh
-	gdal		install-3-python-netcdf-static.sh
+	proj		install-8-static.sh
+	gdal		install-3-python-static.sh
 	gshhg		install.sh
 	gmt			install-6-linux-static.sh
-	gmsh		install-4-linux-static.sh
+	gmsh		install-4-static.sh
 	triangle	install-linux-static.sh
 	chaco		install.sh
Index: /issm/trunk/jenkins/ross-debian_linux-codipack
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-codipack	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-codipack	(revision 26744)
@@ -12,5 +12,5 @@
 	--without-kriging \
 	--without-kml \
-	--without-Gia \
+	--without-Sealevelchange \
 	--without-Love \
 	--with-matlab-dir=${MATLAB_PATH} \
@@ -20,4 +20,5 @@
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -36,5 +37,5 @@
 
 EXTERNALPACKAGES="
-	autotools	install-debian-linux.sh
+	autotools	install-linux.sh
 	cmake		install.sh
 	petsc		install-3.12-linux.sh
Index: /issm/trunk/jenkins/ross-debian_linux-dakota
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-dakota	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-dakota	(revision 26744)
@@ -21,4 +21,5 @@
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -28,4 +29,5 @@
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
@@ -39,5 +41,5 @@
 
 EXTERNALPACKAGES="
-	autotools		install-debian-linux.sh
+	autotools		install-linux.sh
 	cmake			install.sh
 	petsc			install-3.12-linux.sh
@@ -45,9 +47,8 @@
 	boost			install-1.7-linux.sh
 	dakota			install-6.2-linux.sh
-	boost			install-1.7-linux.sh
 	curl			install-7-linux.sh
 	netcdf			install-4.7-parallel.sh
-	proj			install-6.2.sh
-	gdal			install-3-python-netcdf.sh
+	proj			install-8.sh
+	gdal			install-3-python.sh
 	gshhg			install.sh
 	gmt				install-6-linux.sh
Index: /issm/trunk/jenkins/ross-debian_linux-full
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-full	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-full	(revision 26744)
@@ -22,4 +22,5 @@
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -29,4 +30,5 @@
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
@@ -40,14 +42,14 @@
 
 EXTERNALPACKAGES="
-	autotools	install-debian-linux.sh
+	autotools	install-linux.sh
 	cmake		install.sh
 	petsc		install-3.12-linux.sh
 	gsl			install.sh
-	boost		install-1.7-linux-valgrind.sh
+	boost		install-1.7-linux.sh
 	dakota		install-6.2-linux.sh
 	curl		install-7-linux.sh
 	netcdf		install-4.7-parallel.sh
-	proj		install-6.2.sh
-	gdal		install-3-python-netcdf.sh
+	proj		install-8.sh
+	gdal		install-3-python.sh
 	gshhg		install.sh
 	gmt			install-6-linux.sh
Index: /issm/trunk/jenkins/ross-debian_linux-full-valgrind
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-full-valgrind	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-full-valgrind	(revision 26744)
@@ -22,4 +22,5 @@
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -29,4 +30,5 @@
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
@@ -40,5 +42,5 @@
 
 EXTERNALPACKAGES="
-	autotools	install-debian-linux.sh
+	autotools	install-linux.sh
 	cmake		install.sh
 	petsc		install-3.12-linux.sh
@@ -48,6 +50,6 @@
 	curl		install-7-linux.sh
 	netcdf		install-4.7-parallel.sh
-	proj		install-6.2.sh
-	gdal		install-3-python-netcdf.sh
+	proj		install-8.sh
+	gdal		install-3-python.sh
 	gshhg		install.sh
 	gmt			install-6-linux.sh
Index: /issm/trunk/jenkins/ross-debian_linux-gia
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-gia	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-gia	(revision 26744)
@@ -19,4 +19,5 @@
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -31,5 +32,5 @@
 
 EXTERNALPACKAGES="
-	autotools	install-debian-linux.sh
+	autotools	install-linux.sh
 	cmake		install.sh
 	petsc		install-3.12-linux.sh
Index: /issm/trunk/jenkins/ross-debian_linux-iceocean
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-iceocean	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-iceocean	(revision 26744)
@@ -17,4 +17,5 @@
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -31,5 +32,5 @@
 
 EXTERNALPACKAGES="
-	autotools	install-debian-linux.sh
+	autotools	install-linux.sh
 	cmake		install.sh
 	petsc		install-3.12-linux.sh
Index: /issm/trunk/jenkins/ross-debian_linux-javascript
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-javascript	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-javascript	(revision 26744)
@@ -10,10 +10,10 @@
 	--with-javascript \
 	--without-fortran \
-	--without-Gia \
+	--without-Sealevelchange \
 	--without-Love \
 	--without-kml \
 	--without-kriging \
-	--with-gsl-dir="${ISSM_DIR}/externalpackages/gsl/install-javascript" \
-	--with-triangle-dir="${ISSM_DIR}/externalpackages/triangle/install-javascript" \
+	--with-gsl-dir="${ISSM_DIR}/externalpackages/gsl/install" \
+	--with-triangle-dir="${ISSM_DIR}/externalpackages/triangle/install" \
 '
 
@@ -23,5 +23,5 @@
 
 EXTERNALPACKAGES="
-	autotools	install-debian-linux.sh
+	autotools	install-linux.sh
 	cmake		install.sh
 	emscripten	install.sh
Index: /issm/trunk/jenkins/ross-debian_linux-python
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-python	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-python	(revision 26744)
@@ -16,4 +16,5 @@
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -23,4 +24,5 @@
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
@@ -34,5 +36,5 @@
 
 EXTERNALPACKAGES="
-	autotools	install-debian-linux.sh
+	autotools	install-linux.sh
 	cmake		install.sh
 	petsc		install-3.12-linux.sh
@@ -42,6 +44,6 @@
 	curl		install-7-linux.sh
 	netcdf		install-4.7-parallel.sh
-	proj		install-6.2.sh
-	gdal		install-3-python-netcdf.sh
+	proj		install-8.sh
+	gdal		install-3-python.sh
 	gshhg		install.sh
 	gmt			install-6-linux.sh
Index: /issm/trunk/jenkins/ross-debian_linux-solid_earth
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-solid_earth	(revision 26743)
+++ /issm/trunk/jenkins/ross-debian_linux-solid_earth	(revision 26744)
@@ -19,4 +19,5 @@
 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
@@ -26,4 +27,5 @@
 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
+	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
@@ -37,5 +39,5 @@
 
 EXTERNALPACKAGES="
-	autotools		install-debian-linux.sh
+	autotools		install-linux.sh
 	cmake			install.sh
 	petsc			install-3.12-linux.sh
@@ -43,9 +45,8 @@
 	boost			install-1.7-linux.sh
 	dakota			install-6.2-linux.sh
-	boost			install-1.7-linux.sh
 	curl			install-7-linux.sh
 	netcdf			install-4.7-parallel.sh
-	proj			install-6.2.sh
-	gdal			install-3-python-netcdf.sh
+	proj			install-8.sh
+	gdal			install-3-python.sh
 	gshhg			install.sh
 	gmt				install-6-linux.sh
@@ -86,9 +87,9 @@
 #
 # NOTE:
-# - Tests 2002, 2003, 2005, 2010, 2101, and 2021 are excluded as Gmsh produces 
-# different-sized meshes on macOS and Linux for 3d objects (archives are 
-# generated on macOS).
 # - Excluding 2006 until it can be debugged (PETSc crash)
+# - Tests 2002, 2003, 2005, 2008, 2010, 2011, 2021, 2090, and 2101, are 
+#   excluded as Gmsh produces different meshes on macOS and Linux for (archives 
+#   are generated on macOS).
 #
-MATLAB_NROPTIONS="'benchmark','slr','exclude',[2002 2003 2005 2006 2010 2021 2101]"
-PYTHON_NROPTIONS="--benchmark slr --exclude 2002 2003 2005 2006 2010 2021 2101"
+MATLAB_NROPTIONS="'benchmark','slc','exclude',[2002 2003 2004 2005 2006 2007 2008 2010 2011 2021 2051 2052 2053 2084 2085 2090 2101 2424 2425]"
+PYTHON_NROPTIONS="--benchmark slc --exclude 2002 2003 2004 2005 2006 2007 2008 2010 2011 2021 2051 2052 2053 2084 2085 2090 2101 2424 2425"
Index: sm/trunk/jenkins/ross-debian_linux-trunk
===================================================================
--- /issm/trunk/jenkins/ross-debian_linux-trunk	(revision 26743)
+++ 	(revision )
@@ -1,67 +1,0 @@
-#--------------------#
-# ISSM Configuration #
-#--------------------#
-
-MATLAB_PATH="/usr/local/MATLAB/R2019b"
-ISSM_CONFIG='\
-	--prefix=${ISSM_DIR} \
-	--disable-static \
-	--enable-development \
-	--enable-debugging \
-	--with-numthreads=4 \
-	--with-matlab-dir=${MATLAB_PATH} \
-	--with-fortran-lib="-L/usr/lib/x86_64-linux-gnu -lgfortran" \
-	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
-	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
-	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
-	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
-	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
-	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
-	--with-petsc-dir=${ISSM_DIR}/externalpackages/petsc/install \
-	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
-	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
-	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
-	--with-semic-dir=${ISSM_DIR}/externalpackages/semic/install \
-'
-
-#-------------------#
-# External Packages #
-#-------------------#
-
-EXTERNALPACKAGES="
-	autotools	install-debian-linux.sh
-	cmake		install.sh
-	petsc		install-3.12-linux.sh
-	triangle	install-linux.sh
-	chaco		install.sh
-	m1qn3		install.sh
-	semic		install.sh
-	shell2junit	install.sh
-"
-
-#---------#
-# Testing #
-#---------#
-
-# Test suites
-MATLAB_TEST=1
-PYTHON_TEST=0
-JAVASCRIPT_TEST=0
-EXAMPLES_TEST=0
-
-# Number of CPUs used in ISSM compilation
-#
-# NOTE: One is usually safer as some packages are very sensitive to parallel
-# 		compilation.
-#
-NUMCPUS_INSTALL=8
-
-# Number of CPUs used in the nightly runs
-NUMCPUS_RUN=2
-
-# Nightly run options
-#
-# See documentation in test/NightlyRun/runme.* for more information.
-#
-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
-PYTHON_NROPTIONS=""
Index: /issm/trunk/jenkins/ross-win-msys2-gcc-msmpi-basic
===================================================================
--- /issm/trunk/jenkins/ross-win-msys2-gcc-msmpi-basic	(revision 26744)
+++ /issm/trunk/jenkins/ross-win-msys2-gcc-msmpi-basic	(revision 26744)
@@ -0,0 +1,63 @@
+ISSM_CONFIG='\
+	--prefix=${ISSM_DIR} \
+	--enable-debugging \
+	--with-numthreads=4 \
+	--with-vendor="win-msys2-msmpi" \
+	--with-matlab-dir=${MATLAB_PATH} \
+	--with-mpi-include="${MSMPI_ROOT}/include" \
+	--with-mpi-libdir="${MSMPI_ROOT}/lib" \
+	--with-mpi-libflags="-lmsmpi" \
+	--with-fortran-lib="-L/c/msys64/usr/bin -lgfortran" \
+	--with-metis-dir="${ISSM_DIR}/externalpackages/metis/install" \
+	--with-parmetis-dir="${ISSM_DIR}/externalpackages/parmetis/install" \
+	--with-blas-dir="${ISSM_DIR}/externalpackages/blas/install" \
+	--with-lapack-dir="${ISSM_DIR}/externalpackages/lapack/install" \
+	--with-scalapack-dir=$ISSM_DIR/externalpackages/scalapack/install \
+	--with-mumps-dir=$ISSM_DIR/externalpackages/mumps/install \
+	--with-petsc-dir="${ISSM_DIR}/externalpackages/petsc/install" \
+	--with-triangle-dir="${ISSM_DIR}/externalpackages/triangle/install" \
+'
+
+#-------------------#
+# External Packages #
+#-------------------#
+
+#List of external pakages to be installed and their installation scripts
+EXTERNALPACKAGES="
+	metis		install-5-win-msys2-gcc.sh
+	parmetis	install-4-win-msys2-gcc-msmpi.sh
+	blas		install-3-win-msys2-gcc.sh
+	lapack		install-3-win-msys2-gcc.sh
+	scalapack	install-2-win-msys2-gcc-msmpi.sh
+	mumps		install-5-win-msys2-gcc-msmpi.sh
+	petsc		install-3.12-win-msys2-gcc-msmpi.sh
+	triangle	install-win-msys2-gcc.sh
+	shell2junit	install.sh
+"
+
+#---------#
+# Testing #
+#---------#
+
+# Test suites
+MATLAB_TEST=1
+PYTHON_TEST=0
+JAVASCRIPT_TEST=0
+EXAMPLES_TEST=0
+
+# Number of CPUs used in ISSM compilation
+#
+# NOTE: One is usually safer as some packages are very sensitive to parallel
+# 		compilation
+#
+NUMCPUS_INSTALL=4
+
+# Number of CPUs used in the nightly runs
+NUMCPUS_RUN=2
+
+# Nightly run options
+#
+# See documentation in test/NightlyRun/runme.* for more information
+#
+MATLAB_NROPTIONS=""
+PYTHON_NROPTIONS=""
Index: /issm/trunk/jenkins/ross-win-msys2-mingw-msmpi-basic
===================================================================
--- /issm/trunk/jenkins/ross-win-msys2-mingw-msmpi-basic	(revision 26744)
+++ /issm/trunk/jenkins/ross-win-msys2-mingw-msmpi-basic	(revision 26744)
@@ -0,0 +1,71 @@
+MATLAB_PATH=$(cygpath -u $(cygpath -ms "/c/Program Files/MATLAB/R2019b"))
+
+ISSM_CONFIG='\
+	--prefix=${ISSM_DIR} \
+	--enable-development \
+	--enable-debugging \
+	--with-numthreads=4 \
+	--with-vendor="win-msys2" \
+	--with-matlab-dir=${MATLAB_PATH} \
+	--with-mpi-include="${MSMPI_ROOT}/include" \
+	--with-mpi-libdir="${MSMPI_ROOT}/lib" \
+	--with-mpi-libflags="-lmsmpi" \
+	--with-fortran-lib="-L/c/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0/ -lgfortran" \
+	--with-metis-dir="${ISSM_DIR}/externalpackages/petsc/install" \
+	--with-parmetis-dir="${ISSM_DIR}/externalpackages/petsc/install" \
+	--with-blas-lapack-dir="${ISSM_DIR}/externalpackages/petsc/install" \
+	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-petsc-dir="${ISSM_DIR}/externalpackages/petsc/install" \
+	--with-triangle-dir="${ISSM_DIR}/externalpackages/triangle/install" \
+	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+	--with-semic-dir=${ISSM_DIR}/externalpackages/semic/install \
+'
+
+#-------------------#
+# External Packages #
+#-------------------#
+
+#List of external pakages to be installed and their installation scripts
+EXTERNALPACKAGES="
+	msmpi		install.sh
+	petsc		install-3.14-win-msys2-mingw-msmpi.sh
+	triangle	install-win-msys2-mingw.sh
+	chaco		install-win-msys2-mingw.sh
+	m1qn3		install.sh
+	semic		install.sh
+	shell2junit	install.sh
+"
+
+#---------#
+# Testing #
+#---------#
+
+# Test suites
+MATLAB_TEST=1
+PYTHON_TEST=0
+JAVASCRIPT_TEST=0
+EXAMPLES_TEST=0
+
+# Number of CPUs used in ISSM compilation
+#
+# NOTE: One is usually safer as some packages are very sensitive to parallel
+# 		compilation
+#
+NUMCPUS_INSTALL=4
+
+# Number of CPUs used in the nightly runs
+NUMCPUS_RUN=2
+
+# Nightly run options
+#
+# See documentation in test/NightlyRun/runme.* for more information
+#
+# NOTE:
+# - Tests 125, 126, and 129 are skipped because restart is not yet implemented 
+#	for Windows (under MSYS2)
+# - test701 is skipped because it uses full Stokes equations
+#
+MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),125,126,129,435,701,702,703]"
+PYTHON_NROPTIONS=""
Index: /issm/trunk/jenkins/windows
===================================================================
--- /issm/trunk/jenkins/windows	(revision 26743)
+++ /issm/trunk/jenkins/windows	(revision 26744)
@@ -14,5 +14,5 @@
 	--enable-standalone-libraries \
 	--with-fortran=no  \
-	--without-Gia \
+	--without-Sealevelchange \
 	--without-Love \
 	--without-kriging \
Index: /issm/trunk/jenkins/windows-par
===================================================================
--- /issm/trunk/jenkins/windows-par	(revision 26743)
+++ /issm/trunk/jenkins/windows-par	(revision 26744)
@@ -13,5 +13,5 @@
 	--enable-standalone-libraries \
 	--with-fortran=no  \
-	--without-Gia \
+	--without-Sealevelchange \
 	--without-kriging \
 	--without-kml \
Index: /issm/trunk/jenkins/windows_static
===================================================================
--- /issm/trunk/jenkins/windows_static	(revision 26743)
+++ /issm/trunk/jenkins/windows_static	(revision 26744)
@@ -15,5 +15,5 @@
 	--with-vendor=MSVC-Win64 \
 	--with-fortran=no \
-	--without-Gia \
+	--without-Sealevelchange \
 	--without-Love \
 	--without-kriging \
Index: /issm/trunk/m4/analyses.m4
===================================================================
--- /issm/trunk/m4/analyses.m4	(revision 26743)
+++ /issm/trunk/m4/analyses.m4	(revision 26744)
@@ -10,535 +10,1069 @@
 [
 
+dnl with-HydrologyTws{{{
+
+AC_ARG_WITH([HydrologyTws],
+
+	AS_HELP_STRING([--with-HydrologyTws = YES], [compile with HydrologyTws capabilities (default is yes)]),
+
+	[HYDROLOGYTWS=$withval],[HYDROLOGYTWS=yes])
+
+AC_MSG_CHECKING(for HydrologyTws capability compilation)
+
+
+HAVE_HYDROLOGYTWS=no 
+
+if test "x$HYDROLOGYTWS" = "xyes"; then
+
+	HAVE_HYDROLOGYTWS=yes
+
+	AC_DEFINE([_HAVE_HYDROLOGYTWS_],[1],[with HydrologyTws capability])
+
+fi
+
+AM_CONDITIONAL([HYDROLOGYTWS], [test x$HAVE_HYDROLOGYTWS = xyes])
+
+AC_MSG_RESULT($HAVE_HYDROLOGYTWS)
+
+dnl }}}
 dnl with-AdjointBalancethickness2{{{
+
 AC_ARG_WITH([AdjointBalancethickness2],
+
 	AS_HELP_STRING([--with-AdjointBalancethickness2 = YES], [compile with AdjointBalancethickness2 capabilities (default is yes)]),
+
 	[ADJOINTBALANCETHICKNESS2=$withval],[ADJOINTBALANCETHICKNESS2=yes])
+
 AC_MSG_CHECKING(for AdjointBalancethickness2 capability compilation)
 
+
 HAVE_ADJOINTBALANCETHICKNESS2=no 
+
 if test "x$ADJOINTBALANCETHICKNESS2" = "xyes"; then
+
 	HAVE_ADJOINTBALANCETHICKNESS2=yes
+
 	AC_DEFINE([_HAVE_ADJOINTBALANCETHICKNESS2_],[1],[with AdjointBalancethickness2 capability])
-fi
+
+fi
+
 AM_CONDITIONAL([ADJOINTBALANCETHICKNESS2], [test x$HAVE_ADJOINTBALANCETHICKNESS2 = xyes])
+
 AC_MSG_RESULT($HAVE_ADJOINTBALANCETHICKNESS2)
+
 dnl }}}
 dnl with-AdjointBalancethickness{{{
+
 AC_ARG_WITH([AdjointBalancethickness],
+
 	AS_HELP_STRING([--with-AdjointBalancethickness = YES], [compile with AdjointBalancethickness capabilities (default is yes)]),
+
 	[ADJOINTBALANCETHICKNESS=$withval],[ADJOINTBALANCETHICKNESS=yes])
+
 AC_MSG_CHECKING(for AdjointBalancethickness capability compilation)
 
+
 HAVE_ADJOINTBALANCETHICKNESS=no 
+
 if test "x$ADJOINTBALANCETHICKNESS" = "xyes"; then
+
 	HAVE_ADJOINTBALANCETHICKNESS=yes
+
 	AC_DEFINE([_HAVE_ADJOINTBALANCETHICKNESS_],[1],[with AdjointBalancethickness capability])
-fi
+
+fi
+
 AM_CONDITIONAL([ADJOINTBALANCETHICKNESS], [test x$HAVE_ADJOINTBALANCETHICKNESS = xyes])
+
 AC_MSG_RESULT($HAVE_ADJOINTBALANCETHICKNESS)
+
 dnl }}}
 dnl with-AdjointHoriz{{{
+
 AC_ARG_WITH([AdjointHoriz],
+
 	AS_HELP_STRING([--with-AdjointHoriz = YES], [compile with AdjointHoriz capabilities (default is yes)]),
+
 	[ADJOINTHORIZ=$withval],[ADJOINTHORIZ=yes])
+
 AC_MSG_CHECKING(for AdjointHoriz capability compilation)
 
+
 HAVE_ADJOINTHORIZ=no 
+
 if test "x$ADJOINTHORIZ" = "xyes"; then
+
 	HAVE_ADJOINTHORIZ=yes
+
 	AC_DEFINE([_HAVE_ADJOINTHORIZ_],[1],[with AdjointHoriz capability])
-fi
+
+fi
+
 AM_CONDITIONAL([ADJOINTHORIZ], [test x$HAVE_ADJOINTHORIZ = xyes])
+
 AC_MSG_RESULT($HAVE_ADJOINTHORIZ)
+
 dnl }}}
 dnl with-Balancethickness2{{{
+
 AC_ARG_WITH([Balancethickness2],
+
 	AS_HELP_STRING([--with-Balancethickness2 = YES], [compile with Balancethickness2 capabilities (default is yes)]),
+
 	[BALANCETHICKNESS2=$withval],[BALANCETHICKNESS2=yes])
+
 AC_MSG_CHECKING(for Balancethickness2 capability compilation)
 
+
 HAVE_BALANCETHICKNESS2=no 
+
 if test "x$BALANCETHICKNESS2" = "xyes"; then
+
 	HAVE_BALANCETHICKNESS2=yes
+
 	AC_DEFINE([_HAVE_BALANCETHICKNESS2_],[1],[with Balancethickness2 capability])
-fi
+
+fi
+
 AM_CONDITIONAL([BALANCETHICKNESS2], [test x$HAVE_BALANCETHICKNESS2 = xyes])
+
 AC_MSG_RESULT($HAVE_BALANCETHICKNESS2)
+
 dnl }}}
 dnl with-Balancethickness{{{
+
 AC_ARG_WITH([Balancethickness],
+
 	AS_HELP_STRING([--with-Balancethickness = YES], [compile with Balancethickness capabilities (default is yes)]),
+
 	[BALANCETHICKNESS=$withval],[BALANCETHICKNESS=yes])
+
 AC_MSG_CHECKING(for Balancethickness capability compilation)
 
+
 HAVE_BALANCETHICKNESS=no 
+
 if test "x$BALANCETHICKNESS" = "xyes"; then
+
 	HAVE_BALANCETHICKNESS=yes
+
 	AC_DEFINE([_HAVE_BALANCETHICKNESS_],[1],[with Balancethickness capability])
-fi
+
+fi
+
 AM_CONDITIONAL([BALANCETHICKNESS], [test x$HAVE_BALANCETHICKNESS = xyes])
+
 AC_MSG_RESULT($HAVE_BALANCETHICKNESS)
+
 dnl }}}
 dnl with-BalancethicknessSoft{{{
+
 AC_ARG_WITH([BalancethicknessSoft],
+
 	AS_HELP_STRING([--with-BalancethicknessSoft = YES], [compile with BalancethicknessSoft capabilities (default is yes)]),
+
 	[BALANCETHICKNESSSOFT=$withval],[BALANCETHICKNESSSOFT=yes])
+
 AC_MSG_CHECKING(for BalancethicknessSoft capability compilation)
 
+
 HAVE_BALANCETHICKNESSSOFT=no 
+
 if test "x$BALANCETHICKNESSSOFT" = "xyes"; then
+
 	HAVE_BALANCETHICKNESSSOFT=yes
+
 	AC_DEFINE([_HAVE_BALANCETHICKNESSSOFT_],[1],[with BalancethicknessSoft capability])
-fi
+
+fi
+
 AM_CONDITIONAL([BALANCETHICKNESSSOFT], [test x$HAVE_BALANCETHICKNESSSOFT = xyes])
+
 AC_MSG_RESULT($HAVE_BALANCETHICKNESSSOFT)
+
 dnl }}}
 dnl with-Balancevelocity{{{
+
 AC_ARG_WITH([Balancevelocity],
+
 	AS_HELP_STRING([--with-Balancevelocity = YES], [compile with Balancevelocity capabilities (default is yes)]),
+
 	[BALANCEVELOCITY=$withval],[BALANCEVELOCITY=yes])
+
 AC_MSG_CHECKING(for Balancevelocity capability compilation)
 
+
 HAVE_BALANCEVELOCITY=no 
+
 if test "x$BALANCEVELOCITY" = "xyes"; then
+
 	HAVE_BALANCEVELOCITY=yes
+
 	AC_DEFINE([_HAVE_BALANCEVELOCITY_],[1],[with Balancevelocity capability])
-fi
+
+fi
+
 AM_CONDITIONAL([BALANCEVELOCITY], [test x$HAVE_BALANCEVELOCITY = xyes])
+
 AC_MSG_RESULT($HAVE_BALANCEVELOCITY)
+
 dnl }}}
 dnl with-DamageEvolution{{{
+
 AC_ARG_WITH([DamageEvolution],
+
 	AS_HELP_STRING([--with-DamageEvolution = YES], [compile with DamageEvolution capabilities (default is yes)]),
+
 	[DAMAGEEVOLUTION=$withval],[DAMAGEEVOLUTION=yes])
+
 AC_MSG_CHECKING(for DamageEvolution capability compilation)
 
+
 HAVE_DAMAGEEVOLUTION=no 
+
 if test "x$DAMAGEEVOLUTION" = "xyes"; then
+
 	HAVE_DAMAGEEVOLUTION=yes
+
 	AC_DEFINE([_HAVE_DAMAGEEVOLUTION_],[1],[with DamageEvolution capability])
-fi
+
+fi
+
 AM_CONDITIONAL([DAMAGEEVOLUTION], [test x$HAVE_DAMAGEEVOLUTION = xyes])
+
 AC_MSG_RESULT($HAVE_DAMAGEEVOLUTION)
+
 dnl }}}
 dnl with-DepthAverage{{{
+
 AC_ARG_WITH([DepthAverage],
+
 	AS_HELP_STRING([--with-DepthAverage = YES], [compile with DepthAverage capabilities (default is yes)]),
+
 	[DEPTHAVERAGE=$withval],[DEPTHAVERAGE=yes])
+
 AC_MSG_CHECKING(for DepthAverage capability compilation)
 
+
 HAVE_DEPTHAVERAGE=no 
+
 if test "x$DEPTHAVERAGE" = "xyes"; then
+
 	HAVE_DEPTHAVERAGE=yes
+
 	AC_DEFINE([_HAVE_DEPTHAVERAGE_],[1],[with DepthAverage capability])
-fi
+
+fi
+
 AM_CONDITIONAL([DEPTHAVERAGE], [test x$HAVE_DEPTHAVERAGE = xyes])
+
 AC_MSG_RESULT($HAVE_DEPTHAVERAGE)
+
 dnl }}}
 dnl with-Enthalpy{{{
+
 AC_ARG_WITH([Enthalpy],
+
 	AS_HELP_STRING([--with-Enthalpy = YES], [compile with Enthalpy capabilities (default is yes)]),
+
 	[ENTHALPY=$withval],[ENTHALPY=yes])
+
 AC_MSG_CHECKING(for Enthalpy capability compilation)
 
+
 HAVE_ENTHALPY=no 
+
 if test "x$ENTHALPY" = "xyes"; then
+
 	HAVE_ENTHALPY=yes
+
 	AC_DEFINE([_HAVE_ENTHALPY_],[1],[with Enthalpy capability])
-fi
+
+fi
+
 AM_CONDITIONAL([ENTHALPY], [test x$HAVE_ENTHALPY = xyes])
+
 AC_MSG_RESULT($HAVE_ENTHALPY)
+
 dnl }}}
 dnl with-Esa{{{
+
 AC_ARG_WITH([Esa],
+
 	AS_HELP_STRING([--with-Esa = YES], [compile with Esa capabilities (default is yes)]),
+
 	[ESA=$withval],[ESA=yes])
+
 AC_MSG_CHECKING(for Esa capability compilation)
 
+
 HAVE_ESA=no 
+
 if test "x$ESA" = "xyes"; then
+
 	HAVE_ESA=yes
+
 	AC_DEFINE([_HAVE_ESA_],[1],[with Esa capability])
-fi
+
+fi
+
 AM_CONDITIONAL([ESA], [test x$HAVE_ESA = xyes])
+
 AC_MSG_RESULT($HAVE_ESA)
+
 dnl }}}
 dnl with-Extrapolation{{{
+
 AC_ARG_WITH([Extrapolation],
+
 	AS_HELP_STRING([--with-Extrapolation = YES], [compile with Extrapolation capabilities (default is yes)]),
+
 	[EXTRAPOLATION=$withval],[EXTRAPOLATION=yes])
+
 AC_MSG_CHECKING(for Extrapolation capability compilation)
 
+
 HAVE_EXTRAPOLATION=no 
+
 if test "x$EXTRAPOLATION" = "xyes"; then
+
 	HAVE_EXTRAPOLATION=yes
+
 	AC_DEFINE([_HAVE_EXTRAPOLATION_],[1],[with Extrapolation capability])
-fi
+
+fi
+
 AM_CONDITIONAL([EXTRAPOLATION], [test x$HAVE_EXTRAPOLATION = xyes])
+
 AC_MSG_RESULT($HAVE_EXTRAPOLATION)
+
 dnl }}}
 dnl with-ExtrudeFromBase{{{
+
 AC_ARG_WITH([ExtrudeFromBase],
+
 	AS_HELP_STRING([--with-ExtrudeFromBase = YES], [compile with ExtrudeFromBase capabilities (default is yes)]),
+
 	[EXTRUDEFROMBASE=$withval],[EXTRUDEFROMBASE=yes])
+
 AC_MSG_CHECKING(for ExtrudeFromBase capability compilation)
 
+
 HAVE_EXTRUDEFROMBASE=no 
+
 if test "x$EXTRUDEFROMBASE" = "xyes"; then
+
 	HAVE_EXTRUDEFROMBASE=yes
+
 	AC_DEFINE([_HAVE_EXTRUDEFROMBASE_],[1],[with ExtrudeFromBase capability])
-fi
+
+fi
+
 AM_CONDITIONAL([EXTRUDEFROMBASE], [test x$HAVE_EXTRUDEFROMBASE = xyes])
+
 AC_MSG_RESULT($HAVE_EXTRUDEFROMBASE)
+
 dnl }}}
 dnl with-ExtrudeFromTop{{{
+
 AC_ARG_WITH([ExtrudeFromTop],
+
 	AS_HELP_STRING([--with-ExtrudeFromTop = YES], [compile with ExtrudeFromTop capabilities (default is yes)]),
+
 	[EXTRUDEFROMTOP=$withval],[EXTRUDEFROMTOP=yes])
+
 AC_MSG_CHECKING(for ExtrudeFromTop capability compilation)
 
+
 HAVE_EXTRUDEFROMTOP=no 
+
 if test "x$EXTRUDEFROMTOP" = "xyes"; then
+
 	HAVE_EXTRUDEFROMTOP=yes
+
 	AC_DEFINE([_HAVE_EXTRUDEFROMTOP_],[1],[with ExtrudeFromTop capability])
-fi
+
+fi
+
 AM_CONDITIONAL([EXTRUDEFROMTOP], [test x$HAVE_EXTRUDEFROMTOP = xyes])
+
 AC_MSG_RESULT($HAVE_EXTRUDEFROMTOP)
+
 dnl }}}
 dnl with-FreeSurfaceBase{{{
+
 AC_ARG_WITH([FreeSurfaceBase],
+
 	AS_HELP_STRING([--with-FreeSurfaceBase = YES], [compile with FreeSurfaceBase capabilities (default is yes)]),
+
 	[FREESURFACEBASE=$withval],[FREESURFACEBASE=yes])
+
 AC_MSG_CHECKING(for FreeSurfaceBase capability compilation)
 
+
 HAVE_FREESURFACEBASE=no 
+
 if test "x$FREESURFACEBASE" = "xyes"; then
+
 	HAVE_FREESURFACEBASE=yes
+
 	AC_DEFINE([_HAVE_FREESURFACEBASE_],[1],[with FreeSurfaceBase capability])
-fi
+
+fi
+
 AM_CONDITIONAL([FREESURFACEBASE], [test x$HAVE_FREESURFACEBASE = xyes])
+
 AC_MSG_RESULT($HAVE_FREESURFACEBASE)
+
 dnl }}}
 dnl with-FreeSurfaceTop{{{
+
 AC_ARG_WITH([FreeSurfaceTop],
+
 	AS_HELP_STRING([--with-FreeSurfaceTop = YES], [compile with FreeSurfaceTop capabilities (default is yes)]),
+
 	[FREESURFACETOP=$withval],[FREESURFACETOP=yes])
+
 AC_MSG_CHECKING(for FreeSurfaceTop capability compilation)
 
+
 HAVE_FREESURFACETOP=no 
+
 if test "x$FREESURFACETOP" = "xyes"; then
+
 	HAVE_FREESURFACETOP=yes
+
 	AC_DEFINE([_HAVE_FREESURFACETOP_],[1],[with FreeSurfaceTop capability])
-fi
+
+fi
+
 AM_CONDITIONAL([FREESURFACETOP], [test x$HAVE_FREESURFACETOP = xyes])
+
 AC_MSG_RESULT($HAVE_FREESURFACETOP)
+
 dnl }}}
 dnl with-GLheightadvection{{{
+
 AC_ARG_WITH([GLheightadvection],
+
 	AS_HELP_STRING([--with-GLheightadvection = YES], [compile with GLheightadvection capabilities (default is yes)]),
+
 	[GLHEIGHTADVECTION=$withval],[GLHEIGHTADVECTION=yes])
+
 AC_MSG_CHECKING(for GLheightadvection capability compilation)
 
+
 HAVE_GLHEIGHTADVECTION=no 
+
 if test "x$GLHEIGHTADVECTION" = "xyes"; then
+
 	HAVE_GLHEIGHTADVECTION=yes
+
 	AC_DEFINE([_HAVE_GLHEIGHTADVECTION_],[1],[with GLheightadvection capability])
-fi
+
+fi
+
 AM_CONDITIONAL([GLHEIGHTADVECTION], [test x$HAVE_GLHEIGHTADVECTION = xyes])
+
 AC_MSG_RESULT($HAVE_GLHEIGHTADVECTION)
-dnl }}}
-dnl with-Gia{{{
-AC_ARG_WITH([Gia],
-	AS_HELP_STRING([--with-Gia= YES], [compile with Gia capabilities (default is yes)]),
-	[GIA=$withval],[GIA=yes])
-AC_MSG_CHECKING(for Gia capability compilation)
-
-HAVE_GIA=no 
-if test "x$GIA" = "xyes"; then
-	HAVE_GIA=yes
-	AC_DEFINE([_HAVE_GIA_],[1],[with Giacapability])
-fi
-AM_CONDITIONAL([GIA], [test x$HAVE_GIA = xyes])
-AC_MSG_RESULT($HAVE_GIA)
+
 dnl }}}
 dnl with-HydrologyDCEfficient{{{
+
 AC_ARG_WITH([HydrologyDCEfficient],
+
 	AS_HELP_STRING([--with-HydrologyDCEfficient = YES], [compile with HydrologyDCEfficient capabilities (default is yes)]),
+
 	[HYDROLOGYDCEFFICIENT=$withval],[HYDROLOGYDCEFFICIENT=yes])
+
 AC_MSG_CHECKING(for HydrologyDCEfficient capability compilation)
 
+
 HAVE_HYDROLOGYDCEFFICIENT=no 
+
 if test "x$HYDROLOGYDCEFFICIENT" = "xyes"; then
+
 	HAVE_HYDROLOGYDCEFFICIENT=yes
+
 	AC_DEFINE([_HAVE_HYDROLOGYDCEFFICIENT_],[1],[with HydrologyDCEfficient capability])
-fi
+
+fi
+
 AM_CONDITIONAL([HYDROLOGYDCEFFICIENT], [test x$HAVE_HYDROLOGYDCEFFICIENT = xyes])
+
 AC_MSG_RESULT($HAVE_HYDROLOGYDCEFFICIENT)
+
 dnl }}}
 dnl with-HydrologyDCInefficient{{{
+
 AC_ARG_WITH([HydrologyDCInefficient],
+
 	AS_HELP_STRING([--with-HydrologyDCInefficient = YES], [compile with HydrologyDCInefficient capabilities (default is yes)]),
+
 	[HYDROLOGYDCINEFFICIENT=$withval],[HYDROLOGYDCINEFFICIENT=yes])
+
 AC_MSG_CHECKING(for HydrologyDCInefficient capability compilation)
 
+
 HAVE_HYDROLOGYDCINEFFICIENT=no 
+
 if test "x$HYDROLOGYDCINEFFICIENT" = "xyes"; then
+
 	HAVE_HYDROLOGYDCINEFFICIENT=yes
+
 	AC_DEFINE([_HAVE_HYDROLOGYDCINEFFICIENT_],[1],[with HydrologyDCInefficient capability])
-fi
+
+fi
+
 AM_CONDITIONAL([HYDROLOGYDCINEFFICIENT], [test x$HAVE_HYDROLOGYDCINEFFICIENT = xyes])
+
 AC_MSG_RESULT($HAVE_HYDROLOGYDCINEFFICIENT)
+
+dnl }}}
+dnl with-HydrologyGlaDS{{{
+
+AC_ARG_WITH([HydrologyGlaDS],
+
+	AS_HELP_STRING([--with-HydrologyGlaDS = YES], [compile with HydrologyGlaDS capabilities (default is yes)]),
+
+	[HYDROLOGYGLADS=$withval],[HYDROLOGYGLADS=yes])
+
+AC_MSG_CHECKING(for HydrologyGlaDS capability compilation)
+
+
+HAVE_HYDROLOGYGLADS=no 
+
+if test "x$HYDROLOGYGLADS" = "xyes"; then
+
+	HAVE_HYDROLOGYGLADS=yes
+
+	AC_DEFINE([_HAVE_HYDROLOGYGLADS_],[1],[with HydrologyGlaDS capability])
+
+fi
+
+AM_CONDITIONAL([HYDROLOGYGLADS], [test x$HAVE_HYDROLOGYGLADS = xyes])
+
+AC_MSG_RESULT($HAVE_HYDROLOGYGLADS)
+
+dnl }}}
+dnl with-HydrologyPism{{{
+
+AC_ARG_WITH([HydrologyPism],
+
+	AS_HELP_STRING([--with-HydrologyPism = YES], [compile with HydrologyPism capabilities (default is yes)]),
+
+	[HYDROLOGYPISM=$withval],[HYDROLOGYPISM=yes])
+
+AC_MSG_CHECKING(for HydrologyPism capability compilation)
+
+
+HAVE_HYDROLOGYPISM=no 
+
+if test "x$HYDROLOGYPISM" = "xyes"; then
+
+	HAVE_HYDROLOGYPISM=yes
+
+	AC_DEFINE([_HAVE_HYDROLOGYPISM_],[1],[with HydrologyPism capability])
+
+fi
+
+AM_CONDITIONAL([HYDROLOGYPISM], [test x$HAVE_HYDROLOGYPISM = xyes])
+
+AC_MSG_RESULT($HAVE_HYDROLOGYPISM)
+
+dnl }}}
+dnl with-HydrologyShakti{{{
+
+AC_ARG_WITH([HydrologyShakti],
+
+	AS_HELP_STRING([--with-HydrologyShakti = YES], [compile with HydrologyShakti capabilities (default is yes)]),
+
+	[HYDROLOGYSHAKTI=$withval],[HYDROLOGYSHAKTI=yes])
+
+AC_MSG_CHECKING(for HydrologyShakti capability compilation)
+
+
+HAVE_HYDROLOGYSHAKTI=no 
+
+if test "x$HYDROLOGYSHAKTI" = "xyes"; then
+
+	HAVE_HYDROLOGYSHAKTI=yes
+
+	AC_DEFINE([_HAVE_HYDROLOGYSHAKTI_],[1],[with HydrologyShakti capability])
+
+fi
+
+AM_CONDITIONAL([HYDROLOGYSHAKTI], [test x$HAVE_HYDROLOGYSHAKTI = xyes])
+
+AC_MSG_RESULT($HAVE_HYDROLOGYSHAKTI)
+
 dnl }}}
 dnl with-HydrologyShreve{{{
+
 AC_ARG_WITH([HydrologyShreve],
+
 	AS_HELP_STRING([--with-HydrologyShreve = YES], [compile with HydrologyShreve capabilities (default is yes)]),
+
 	[HYDROLOGYSHREVE=$withval],[HYDROLOGYSHREVE=yes])
+
 AC_MSG_CHECKING(for HydrologyShreve capability compilation)
 
+
 HAVE_HYDROLOGYSHREVE=no 
+
 if test "x$HYDROLOGYSHREVE" = "xyes"; then
+
 	HAVE_HYDROLOGYSHREVE=yes
+
 	AC_DEFINE([_HAVE_HYDROLOGYSHREVE_],[1],[with HydrologyShreve capability])
-fi
+
+fi
+
 AM_CONDITIONAL([HYDROLOGYSHREVE], [test x$HAVE_HYDROLOGYSHREVE = xyes])
+
 AC_MSG_RESULT($HAVE_HYDROLOGYSHREVE)
-dnl }}}
-dnl with-HydrologyGlaDS{{{
-AC_ARG_WITH([HydrologyGlaDS],
-	AS_HELP_STRING([--with-HydrologyGlaDS = YES], [compile with HydrologyGlaDS capabilities (default is yes)]),
-	[HYDROLOGYGLADS=$withval],[HYDROLOGYGLADS=yes])
-AC_MSG_CHECKING(for HydrologyGlaDS capability compilation)
-
-HAVE_HYDROLOGYGLADS=no 
-if test "x$HYDROLOGYGLADS" = "xyes"; then
-	HAVE_HYDROLOGYGLADS=yes
-	AC_DEFINE([_HAVE_HYDROLOGYGLADS_],[1],[with HydrologyGlaDS capability])
-fi
-AM_CONDITIONAL([HYDROLOGYGLADS], [test x$HAVE_HYDROLOGYGLADS = xyes])
-AC_MSG_RESULT($HAVE_HYDROLOGYGLADS)
-dnl }}}
-dnl with-HydrologyShakti{{{
-AC_ARG_WITH([HydrologyShakti],
-	AS_HELP_STRING([--with-HydrologyShakti = YES], [compile with HydrologyShakti capabilities (default is yes)]),
-	[HYDROLOGYSHAKTI=$withval],[HYDROLOGYSHAKTI=yes])
-AC_MSG_CHECKING(for HydrologyShakti capability compilation)
-
-HAVE_HYDROLOGYSHAKTI=no 
-if test "x$HYDROLOGYSHAKTI" = "xyes"; then
-	HAVE_HYDROLOGYSHAKTI=yes
-	AC_DEFINE([_HAVE_HYDROLOGYSHAKTI_],[1],[with HydrologyShakti capability])
-fi
-AM_CONDITIONAL([HYDROLOGYSHAKTI], [test x$HAVE_HYDROLOGYSHAKTI = xyes])
-AC_MSG_RESULT($HAVE_HYDROLOGYSHAKTI)
-dnl }}}
-dnl with-HydrologyPism{{{
-AC_ARG_WITH([HydrologyPism],
-	AS_HELP_STRING([--with-HydrologyPism = YES], [compile with HydrologyPism capabilities (default is yes)]),
-	[HYDROLOGYPISM=$withval],[HYDROLOGYPISM=yes])
-AC_MSG_CHECKING(for HydrologyPism capability compilation)
-
-HAVE_HYDROLOGYPISM=no 
-if test "x$HYDROLOGYPISM" = "xyes"; then
-	HAVE_HYDROLOGYPISM=yes
-	AC_DEFINE([_HAVE_HYDROLOGYPISM_],[1],[with HydrologyPism capability])
-fi
-AM_CONDITIONAL([HYDROLOGYPISM], [test x$HAVE_HYDROLOGYPISM = xyes])
-AC_MSG_RESULT($HAVE_HYDROLOGYPISM)
+
 dnl }}}
 dnl with-L2ProjectionBase{{{
+
 AC_ARG_WITH([L2ProjectionBase],
+
 	AS_HELP_STRING([--with-L2ProjectionBase = YES], [compile with L2ProjectionBase capabilities (default is yes)]),
+
 	[L2PROJECTIONBASE=$withval],[L2PROJECTIONBASE=yes])
+
 AC_MSG_CHECKING(for L2ProjectionBase capability compilation)
 
+
 HAVE_L2PROJECTIONBASE=no 
+
 if test "x$L2PROJECTIONBASE" = "xyes"; then
+
 	HAVE_L2PROJECTIONBASE=yes
+
 	AC_DEFINE([_HAVE_L2PROJECTIONBASE_],[1],[with L2ProjectionBase capability])
-fi
+
+fi
+
 AM_CONDITIONAL([L2PROJECTIONBASE], [test x$HAVE_L2PROJECTIONBASE = xyes])
+
 AC_MSG_RESULT($HAVE_L2PROJECTIONBASE)
+
 dnl }}}
 dnl with-L2ProjectionEPL{{{
+
 AC_ARG_WITH([L2ProjectionEPL],
+
 	AS_HELP_STRING([--with-L2ProjectionEPL = YES], [compile with L2ProjectionEPL capabilities (default is yes)]),
+
 	[L2PROJECTIONEPL=$withval],[L2PROJECTIONEPL=yes])
+
 AC_MSG_CHECKING(for L2ProjectionEPL capability compilation)
 
+
 HAVE_L2PROJECTIONEPL=no 
+
 if test "x$L2PROJECTIONEPL" = "xyes"; then
+
 	HAVE_L2PROJECTIONEPL=yes
+
 	AC_DEFINE([_HAVE_L2PROJECTIONEPL_],[1],[with L2ProjectionEPL capability])
-fi
+
+fi
+
 AM_CONDITIONAL([L2PROJECTIONEPL], [test x$HAVE_L2PROJECTIONEPL = xyes])
+
 AC_MSG_RESULT($HAVE_L2PROJECTIONEPL)
+
 dnl }}}
 dnl with-Levelset{{{
+
 AC_ARG_WITH([Levelset],
+
 	AS_HELP_STRING([--with-Levelset = YES], [compile with Levelset capabilities (default is yes)]),
+
 	[LEVELSET=$withval],[LEVELSET=yes])
+
 AC_MSG_CHECKING(for Levelset capability compilation)
 
+
 HAVE_LEVELSET=no 
+
 if test "x$LEVELSET" = "xyes"; then
+
 	HAVE_LEVELSET=yes
+
 	AC_DEFINE([_HAVE_LEVELSET_],[1],[with Levelset capability])
-fi
+
+fi
+
 AM_CONDITIONAL([LEVELSET], [test x$HAVE_LEVELSET = xyes])
+
 AC_MSG_RESULT($HAVE_LEVELSET)
+
 dnl }}}
 dnl with-Love{{{
+
 AC_ARG_WITH([Love],
+
 	AS_HELP_STRING([--with-Love = YES], [compile with Love capabilities (default is yes)]),
+
 	[LOVE=$withval],[LOVE=yes])
+
 AC_MSG_CHECKING(for Love capability compilation)
 
+
 HAVE_LOVE=no 
+
 if test "x$LOVE" = "xyes"; then
+
 	HAVE_LOVE=yes
+
 	AC_DEFINE([_HAVE_LOVE_],[1],[with Love capability])
-fi
+
+fi
+
 AM_CONDITIONAL([LOVE], [test x$HAVE_LOVE = xyes])
+
 AC_MSG_RESULT($HAVE_LOVE)
+
 dnl }}}
 dnl with-Masstransport{{{
+
 AC_ARG_WITH([Masstransport],
+
 	AS_HELP_STRING([--with-Masstransport = YES], [compile with Masstransport capabilities (default is yes)]),
+
 	[MASSTRANSPORT=$withval],[MASSTRANSPORT=yes])
+
 AC_MSG_CHECKING(for Masstransport capability compilation)
 
+
 HAVE_MASSTRANSPORT=no 
+
 if test "x$MASSTRANSPORT" = "xyes"; then
+
 	HAVE_MASSTRANSPORT=yes
+
 	AC_DEFINE([_HAVE_MASSTRANSPORT_],[1],[with Masstransport capability])
-fi
+
+fi
+
 AM_CONDITIONAL([MASSTRANSPORT], [test x$HAVE_MASSTRANSPORT = xyes])
+
 AC_MSG_RESULT($HAVE_MASSTRANSPORT)
+
 dnl }}}
 dnl with-Melting{{{
+
 AC_ARG_WITH([Melting],
+
 	AS_HELP_STRING([--with-Melting = YES], [compile with Melting capabilities (default is yes)]),
+
 	[MELTING=$withval],[MELTING=yes])
+
 AC_MSG_CHECKING(for Melting capability compilation)
 
+
 HAVE_MELTING=no 
+
 if test "x$MELTING" = "xyes"; then
+
 	HAVE_MELTING=yes
+
 	AC_DEFINE([_HAVE_MELTING_],[1],[with Melting capability])
-fi
+
+fi
+
 AM_CONDITIONAL([MELTING], [test x$HAVE_MELTING = xyes])
+
 AC_MSG_RESULT($HAVE_MELTING)
-dnl }}}
-dnl with-Sealevelrise{{{
-AC_ARG_WITH([Sealevelrise],
-	AS_HELP_STRING([--with-Sealevelrise = YES], [compile with Sealevelrise capabilities (default is yes)]),
-	[SEALEVELRISE=$withval],[SEALEVELRISE=yes])
-AC_MSG_CHECKING(for Sealevelrise capability compilation)
-
-HAVE_SEALEVELRISE=no 
-if test "x$SEALEVELRISE" = "xyes"; then
-	HAVE_SEALEVELRISE=yes
-	AC_DEFINE([_HAVE_SEALEVELRISE_],[1],[with Sealevelrise capability])
-fi
-AM_CONDITIONAL([SEALEVELRISE], [test x$HAVE_SEALEVELRISE = xyes])
-AC_MSG_RESULT($HAVE_SEALEVELRISE)
+
+dnl }}}
+dnl with-Oceantransport{{{
+
+AC_ARG_WITH([Oceantransport],
+
+	AS_HELP_STRING([--with-Oceantransport = YES], [compile with Oceantransport capabilities (default is yes)]),
+
+	[OCEANTRANSPORT=$withval],[OCEANTRANSPORT=yes])
+
+AC_MSG_CHECKING(for Oceantransport capability compilation)
+
+
+HAVE_OCEANTRANSPORT=no 
+
+if test "x$OCEANTRANSPORT" = "xyes"; then
+
+	HAVE_OCEANTRANSPORT=yes
+
+	AC_DEFINE([_HAVE_OCEANTRANSPORT_],[1],[with Oceantransport capability])
+
+fi
+
+AM_CONDITIONAL([OCEANTRANSPORT], [test x$HAVE_OCEANTRANSPORT = xyes])
+
+AC_MSG_RESULT($HAVE_OCEANTRANSPORT)
+
+dnl }}}
+dnl with-Recovery{{{
+
+AC_ARG_WITH([Recovery],
+
+	AS_HELP_STRING([--with-Recovery = YES], [compile with Recovery capabilities (default is yes)]),
+
+	[RECOVERY=$withval],[RECOVERY=yes])
+
+AC_MSG_CHECKING(for Recovery capability compilation)
+
+
+HAVE_RECOVERY=no 
+
+if test "x$RECOVERY" = "xyes"; then
+
+	HAVE_RECOVERY=yes
+
+	AC_DEFINE([_HAVE_RECOVERY_],[1],[with Recovery capability])
+
+fi
+
+AM_CONDITIONAL([RECOVERY], [test x$HAVE_RECOVERY = xyes])
+
+AC_MSG_RESULT($HAVE_RECOVERY)
+
+dnl }}}
+dnl with-Sampling{{{
+
+AC_ARG_WITH([Sampling],
+
+	AS_HELP_STRING([--with-Sampling = YES], [compile with Sampling capabilities (default is yes)]),
+
+	[SAMPLING=$withval],[SAMPLING=yes])
+
+AC_MSG_CHECKING(for Sampling capability compilation)
+
+
+HAVE_SAMPLING=no 
+
+if test "x$SAMPLING" = "xyes"; then
+
+	HAVE_SAMPLING=yes
+
+	AC_DEFINE([_HAVE_SAMPLING_],[1],[with Sampling capability])
+
+fi
+
+AM_CONDITIONAL([SAMPLING], [test x$HAVE_SAMPLING = xyes])
+
+AC_MSG_RESULT($HAVE_SAMPLING)
+
+dnl }}}
+dnl with-Sealevelchange{{{
+
+AC_ARG_WITH([Sealevelchange],
+
+	AS_HELP_STRING([--with-Sealevelchange = YES], [compile with Sealevelchange capabilities (default is yes)]),
+
+	[SEALEVELCHANGE=$withval],[SEALEVELCHANGE=yes])
+
+AC_MSG_CHECKING(for Sealevelchange capability compilation)
+
+
+HAVE_SEALEVELCHANGE=no 
+
+if test "x$SEALEVELCHANGE" = "xyes"; then
+
+	HAVE_SEALEVELCHANGE=yes
+
+	AC_DEFINE([_HAVE_SEALEVELCHANGE_],[1],[with Sealevelchange capability])
+
+fi
+
+AM_CONDITIONAL([SEALEVELCHANGE], [test x$HAVE_SEALEVELCHANGE = xyes])
+
+AC_MSG_RESULT($HAVE_SEALEVELCHANGE)
+
 dnl }}}
 dnl with-Smb{{{
+
 AC_ARG_WITH([Smb],
+
 	AS_HELP_STRING([--with-Smb = YES], [compile with Smb capabilities (default is yes)]),
+
 	[SMB=$withval],[SMB=yes])
+
 AC_MSG_CHECKING(for Smb capability compilation)
 
+
 HAVE_SMB=no 
+
 if test "x$SMB" = "xyes"; then
+
 	HAVE_SMB=yes
+
 	AC_DEFINE([_HAVE_SMB_],[1],[with Smb capability])
-fi
+
+fi
+
 AM_CONDITIONAL([SMB], [test x$HAVE_SMB = xyes])
+
 AC_MSG_RESULT($HAVE_SMB)
+
 dnl }}}
 dnl with-Smooth{{{
+
 AC_ARG_WITH([Smooth],
+
 	AS_HELP_STRING([--with-Smooth = YES], [compile with Smooth capabilities (default is yes)]),
+
 	[SMOOTH=$withval],[SMOOTH=yes])
+
 AC_MSG_CHECKING(for Smooth capability compilation)
 
+
 HAVE_SMOOTH=no 
+
 if test "x$SMOOTH" = "xyes"; then
+
 	HAVE_SMOOTH=yes
+
 	AC_DEFINE([_HAVE_SMOOTH_],[1],[with Smooth capability])
-fi
+
+fi
+
 AM_CONDITIONAL([SMOOTH], [test x$HAVE_SMOOTH = xyes])
+
 AC_MSG_RESULT($HAVE_SMOOTH)
+
 dnl }}}
 dnl with-Stressbalance{{{
+
 AC_ARG_WITH([Stressbalance],
+
 	AS_HELP_STRING([--with-Stressbalance = YES], [compile with Stressbalance capabilities (default is yes)]),
+
 	[STRESSBALANCE=$withval],[STRESSBALANCE=yes])
+
 AC_MSG_CHECKING(for Stressbalance capability compilation)
 
+
 HAVE_STRESSBALANCE=no 
+
 if test "x$STRESSBALANCE" = "xyes"; then
+
 	HAVE_STRESSBALANCE=yes
+
 	AC_DEFINE([_HAVE_STRESSBALANCE_],[1],[with Stressbalance capability])
-fi
+
+fi
+
 AM_CONDITIONAL([STRESSBALANCE], [test x$HAVE_STRESSBALANCE = xyes])
+
 AC_MSG_RESULT($HAVE_STRESSBALANCE)
+
 dnl }}}
 dnl with-StressbalanceSIA{{{
+
 AC_ARG_WITH([StressbalanceSIA],
+
 	AS_HELP_STRING([--with-StressbalanceSIA = YES], [compile with StressbalanceSIA capabilities (default is yes)]),
+
 	[STRESSBALANCESIA=$withval],[STRESSBALANCESIA=yes])
+
 AC_MSG_CHECKING(for StressbalanceSIA capability compilation)
 
+
 HAVE_STRESSBALANCESIA=no 
+
 if test "x$STRESSBALANCESIA" = "xyes"; then
+
 	HAVE_STRESSBALANCESIA=yes
+
 	AC_DEFINE([_HAVE_STRESSBALANCESIA_],[1],[with StressbalanceSIA capability])
-fi
+
+fi
+
 AM_CONDITIONAL([STRESSBALANCESIA], [test x$HAVE_STRESSBALANCESIA = xyes])
+
 AC_MSG_RESULT($HAVE_STRESSBALANCESIA)
+
 dnl }}}
 dnl with-StressbalanceVertical{{{
+
 AC_ARG_WITH([StressbalanceVertical],
+
 	AS_HELP_STRING([--with-StressbalanceVertical = YES], [compile with StressbalanceVertical capabilities (default is yes)]),
+
 	[STRESSBALANCEVERTICAL=$withval],[STRESSBALANCEVERTICAL=yes])
+
 AC_MSG_CHECKING(for StressbalanceVertical capability compilation)
 
+
 HAVE_STRESSBALANCEVERTICAL=no 
+
 if test "x$STRESSBALANCEVERTICAL" = "xyes"; then
+
 	HAVE_STRESSBALANCEVERTICAL=yes
+
 	AC_DEFINE([_HAVE_STRESSBALANCEVERTICAL_],[1],[with StressbalanceVertical capability])
-fi
+
+fi
+
 AM_CONDITIONAL([STRESSBALANCEVERTICAL], [test x$HAVE_STRESSBALANCEVERTICAL = xyes])
+
 AC_MSG_RESULT($HAVE_STRESSBALANCEVERTICAL)
+
 dnl }}}
 dnl with-Thermal{{{
+
 AC_ARG_WITH([Thermal],
+
 	AS_HELP_STRING([--with-Thermal = YES], [compile with Thermal capabilities (default is yes)]),
+
 	[THERMAL=$withval],[THERMAL=yes])
+
 AC_MSG_CHECKING(for Thermal capability compilation)
 
+
 HAVE_THERMAL=no 
+
 if test "x$THERMAL" = "xyes"; then
+
 	HAVE_THERMAL=yes
+
 	AC_DEFINE([_HAVE_THERMAL_],[1],[with Thermal capability])
-fi
+
+fi
+
 AM_CONDITIONAL([THERMAL], [test x$HAVE_THERMAL = xyes])
+
 AC_MSG_RESULT($HAVE_THERMAL)
+
 dnl }}}
 dnl with-UzawaPressure{{{
+
 AC_ARG_WITH([UzawaPressure],
+
 	AS_HELP_STRING([--with-UzawaPressure = YES], [compile with UzawaPressure capabilities (default is yes)]),
+
 	[UZAWAPRESSURE=$withval],[UZAWAPRESSURE=yes])
+
 AC_MSG_CHECKING(for UzawaPressure capability compilation)
 
+
 HAVE_UZAWAPRESSURE=no 
+
 if test "x$UZAWAPRESSURE" = "xyes"; then
+
 	HAVE_UZAWAPRESSURE=yes
+
 	AC_DEFINE([_HAVE_UZAWAPRESSURE_],[1],[with UzawaPressure capability])
-fi
+
+fi
+
 AM_CONDITIONAL([UZAWAPRESSURE], [test x$HAVE_UZAWAPRESSURE = xyes])
+
 AC_MSG_RESULT($HAVE_UZAWAPRESSURE)
+
 dnl }}}
 
Index: /issm/trunk/m4/issm_options.m4
===================================================================
--- /issm/trunk/m4/issm_options.m4	(revision 26743)
+++ /issm/trunk/m4/issm_options.m4	(revision 26744)
@@ -31,5 +31,5 @@
 		PACKAGE_DATE="unknown"
 	fi
-	AC_DEFINE_UNQUOTED(PACKAGE_BUILD_DATE, "$PACKAGE_DATE", [build date])
+	AC_DEFINE_UNQUOTED([PACKAGE_BUILD_DATE], "${PACKAGE_DATE}", [build date])
 	AC_MSG_RESULT([${PACKAGE_DATE}])
 
@@ -46,5 +46,5 @@
 		fi
 	fi
-	AC_DEFINE_UNQUOTED(USER_NAME, "$user_name", [user name])
+	AC_DEFINE_UNQUOTED([USER_NAME], "${user_name}", [user name])
 	AC_MSG_RESULT([${user_name}])
 
@@ -55,13 +55,13 @@
 		linux-gnu* | lignux* )	host_os=linux ;;
 	esac
-	AC_DEFINE_UNQUOTED(HOST_OS, "$host_os", [host full OS name and version])
+	AC_DEFINE_UNQUOTED([HOST_OS], "${host_os}", [host full OS name and version])
 	AC_MSG_RESULT([${host_os}])
 
 	AC_MSG_CHECKING([host cpu])
-	AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu", [host CPU])
+	AC_DEFINE_UNQUOTED([HOST_CPU], "${host_cpu}", [host CPU])
 	AC_MSG_RESULT([${host_cpu}])
 
 	AC_MSG_CHECKING([vendor])
-	AC_DEFINE_UNQUOTED(HOST_VENDOR, "$host_vendor", [host vendor])
+	AC_DEFINE_UNQUOTED([HOST_VENDOR], "${host_vendor}", [host vendor])
 	AC_MSG_RESULT([${host_vendor}])
 
@@ -73,5 +73,5 @@
 		linux-gnu* | lignux* )	host_os_name=linux ;;
 	esac
-	AC_DEFINE_UNQUOTED(HOST_OS_NAME, "$host_os_name", [host OS name])
+	AC_DEFINE_UNQUOTED([HOST_OS_NAME], "${host_os_name}", [host OS name])
 	AC_MSG_RESULT([${host_os_name}])
 
@@ -82,5 +82,5 @@
 		host_os_version=`(uname -r) 2>/dev/null` || host_os_version=unknown
 	fi
-	AC_DEFINE_UNQUOTED(HOST_OS_VERSION, "$host_os_version", [host OS version])
+	AC_DEFINE_UNQUOTED([HOST_OS_VERSION], "${host_os_version}", [host OS version])
 	AC_MSG_RESULT([${host_os_version}])
 
@@ -95,5 +95,5 @@
 		i?86 )	host_arch=i386 ;; # all x86 should show up as i386
 	esac
-	AC_DEFINE_UNQUOTED(HOST_ARCH, "$host_arch", [host archictecture])
+	AC_DEFINE_UNQUOTED([HOST_ARCH], "${host_arch}", [host archictecture])
 	AC_MSG_RESULT([${host_arch}])
 
@@ -219,7 +219,8 @@
 		AC_MSG_RESULT([no])
 	fi
-	AC_DEFINE_UNQUOTED([_SYSTEM_HAS_FMEMOPEN_], $SYSTEM_FMEMOPEN, [does system copy of libc have fmemopen])
+	AC_DEFINE_UNQUOTED([_SYSTEM_HAS_FMEMOPEN_], ${SYSTEM_FMEMOPEN}, [does system copy of libc have fmemopen])
 	AM_CONDITIONAL([SYSTEM_HAS_FMEMOPEN], [test "${SYSTEM_FMEMOPEN}" == "1"])
 
+	IS_MSYS2=no
 	IS_WINDOWS=no
 	AC_MSG_CHECKING([for vendor compilers])
@@ -290,7 +291,7 @@
 			export CFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK"
 		elif test "${VENDOR}" == "intel-discover"; then
-			export CC=icc
-			export CXX=icpc
-			export CXXFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK"
+		   export CC=mpicc
+		   export CXX=mpicxx
+			export CXXFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK -std=c++11"
 			export CFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK"
 		elif test "${VENDOR}" == "intel-pleiades"; then
@@ -309,22 +310,42 @@
 			export CXXFLAGS="-O3 -march=corei7-avx -std=c++11"
 			export CFLAGS="-O3 -march=corei7-avx"
+		elif test "${VENDOR}" == "intel-pleiades-mpi"; then
+			export CC=mpicc
+			export CXX=mpicxx
+			export CXXFLAGS="-O3 -march=corei7-avx -std=c++11"
+			export CFLAGS="-O3 -march=corei7-avx"
 		elif test "${VENDOR}" == "intel-pleiades-icpc"; then
 			export CXXFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict -std=c++11"
 			export CFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict"
 			AC_DEFINE([_HAVE_RESTRICT_], [1], [with restrict buffers])
+		elif test "${VENDOR}" == "win-msys2"; then
+			export CXXFLAGS="-D_MSYS2_"
+			export LDFLAGS="${LDFLAGS} -no-undefined"
+			export OSLIBS="-Wl,-L/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0 -Wl,-L/mingw64/x86_64-w64-mingw32/lib -Wl,-lstdc++ -Wl,-lgfortran -Wl,-lmingw32 -Wl,-lgcc_s -Wl,-lmoldname -Wl,-lmingwex -Wl,-lmsvcrt -Wl,-lm -Wl,-lpthread -Wl,-lshell32 -Wl,-luser32 -Wl,-lgdi32 -Wl,-luser32 -Wl,-ladvapi32 -Wl,-lkernel32 -Wl,-lquadmath -Wl,-lstdc++ -Wl,-lgcc"
+			IS_MSYS2=yes
 		else
 			AC_MSG_ERROR([unknown compiler vendor!])
 		fi
 	fi
+	dnl Set default standard for C++
+	if test "${CXXFLAGS}" == ""; then
+		export CXXFLAGS="-std=C++11"
+	fi
 	AC_SUBST([OSLIBS])
 	AC_MSG_RESULT([done])
 
-	AC_MSG_CHECKING([if this is a Windows build])
+	AC_MSG_CHECKING([if this is a MSVC (Windows) build])
 	AM_CONDITIONAL([WINDOWS], [test "x${IS_WINDOWS}" == "xyes"])
 	AC_MSG_RESULT([${IS_WINDOWS}])
+
+	AC_MSG_CHECKING([if this is a MSYS2 (Windows) build])
+	AM_CONDITIONAL([MSYS2], [test "x${IS_MSYS2}" == "xyes"])
+	AC_MSG_RESULT([${IS_MSYS2}])
+	AC_DEFINE([_IS_MSYS2_], [1], [is a MSYS2 (Windows) build])
 	dnl }}}
 	dnl MATLAB{{{
 
 	dnl See if MATLAB has been provided
+	AC_MSG_CHECKING([for MATLAB])
 	AC_ARG_WITH(
 		[matlab-dir],														dnl feature
@@ -333,9 +354,7 @@
 		[MATLAB_ROOT="no"]													dnl action if not given
 	)
-	AC_MSG_CHECKING([for MATLAB])
 	if test "x${MATLAB_ROOT}" == "xno"; then
 		HAVE_MATLAB=no
 	else
-		HAVE_MATLAB=yes
 		if ! test -d "${MATLAB_ROOT}"; then
 			AC_MSG_ERROR([MATLAB directory provided (${MATLAB_ROOT}) does not exist!]);
@@ -344,4 +363,5 @@
 			AC_MSG_ERROR([Couldn't find mex.h... check your installation of MATLAB])
 		fi
+		HAVE_MATLAB=yes
 	fi
 	AC_MSG_RESULT([${HAVE_MATLAB}])
@@ -352,5 +372,5 @@
 		AC_DEFINE([_HAVE_MATLAB_], [1], [with MATLAB in ISSM src])
 
-		dnl Set MEXLIB, MEXLINK, and MEXEXT
+		dnl Set MEX* variable
 		AC_MSG_CHECKING([MATLAB's mex compilation flags])
 
@@ -362,24 +382,47 @@
 				if test "${VENDOR}" == "intel-win7-32"; then
 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
-					MEXLINK="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win32/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+					MEXLINKFLAGS="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win32/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
 					MEXEXT=`${MATLAB_ROOT}/bin/mexext.bat`
 					MEXEXT=".${MEXEXT}"
 				elif test "${VENDOR}" == "intel-win7-64"; then
 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
-					MEXLINK="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+					MEXLINKFLAGS="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
 					MEXEXT=".mexw64"
 				elif test "${VENDOR}" == "MSVC-Win64" || test "${VENDOR}" == "MSVC-Win64-par"; then
 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
-					MEXLINK="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+					MEXLINKFLAGS="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
 					MATLABINCL="-I`cygpath -m ${MATLAB_ROOT}/extern/include`"
 					MEXEXT=".mexw64"
 				fi
 			;;
+			*mingw*)
+				if test "${IS_MSYS2}" == "yes"; then
+					dnl Value to set MEXEXT to can be found on Windows by running $MATLAB_ROOT/bin/mexext.bat
+					MEXEXT=".mexw64"
+					MATLABINCL="-I${MATLAB_ROOT}/extern/include"
+					MEXOPTFLAGS="-O2 -fwrapv -DNDEBUG -g"
+					MEXCFLAGS="-fexceptions -fno-omit-frame-pointer -m64 -DMATLAB_MEX_FILE"
+					MEXCXXFLAGS="-fexceptions -fno-omit-frame-pointer -std=c++11 -m64 -DMATLAB_MEX_FILE"
+					MEXLINKFLAGS="-m64 -Wl,--no-undefined -shared -static -Wl,${MATLAB_ROOT}/extern/lib/win64/mingw64/mexFunction.def"
+					MEXLIB_DIR="${MATLAB_ROOT}/extern/lib/win64/mingw64"
+					MEXLIB="-L${MEXLIB_DIR} -lmx -lmex -lmat -lm -lmwlapack -lmwblas"
+				fi
+			;;
+			*msys*)
+				dnl Value to set MEXEXT to can be found on Windows by running $MATLAB_ROOT/bin/mexext.bat
+				MEXEXT=".mexw64"
+				MATLABINCL="-I${MATLAB_ROOT}/extern/include"
+				MEXOPTFLAGS="-O2 -fwrapv -DNDEBUG -g"
+				MEXCFLAGS="-fexceptions -fno-omit-frame-pointer -m64 -DMATLAB_MEX_FILE"
+				MEXCXXFLAGS="-fexceptions -fno-omit-frame-pointer -std=c++11 -m64 -DMATLAB_MEX_FILE"
+				MEXLINKFLAGS="-m64 -Wl,--no-undefined -shared -static -Wl,${MATLAB_ROOT}/extern/lib/win64/mingw64/mexFunction.def"
+				MEXLIB_DIR="${MATLAB_ROOT}/extern/lib/win64/mingw64"
+				MEXLIB="-L${MEXLIB_DIR} -lmx -lmex -lmat -lm -lmwlapack -lmwblas"
+			;;
 			*)
+				MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
 				MATLABINCL="-I${MATLAB_ROOT}/extern/include"
-				MEXLINK=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS | sed -e "s/         LDFLAGS            = //g")
+				MEXLINKFLAGS=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS | sed -e "s/         LDFLAGS            = //g")
 				MEXLIB=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep CXXLIBS | sed -e "s/         CXXLIBS            = //g")
-				MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
-				dnl version 2014 and up
 				if test -z "${MEXEXT}"; then
 					echo "#include <mex.h>" > conftest.cpp
@@ -387,5 +430,5 @@
 					${MATLAB_ROOT}/bin/mex -v -lmex conftest.cpp > conftest.tmp 2>&1
 					rm -f conftest.cpp
-					MEXLINK=$(cat conftest.tmp | grep LDFLAGS | sed -e "s/LDFLAGS ://g")
+					MEXLINKFLAGS=$(cat conftest.tmp | grep LDFLAGS | sed -e "s/LDFLAGS ://g")
 					MEXLIB=$(cat conftest.tmp | grep LINKLIBS | sed -e "s/LINKLIBS ://g")
 					MEXEXT=$(cat conftest.tmp | grep LDEXT | sed -e "s/LDEXT ://g" | awk '{print $[1]}')
@@ -397,6 +440,6 @@
 
 				dnl Make sure mexFunction.map is not in MEXLIB to avoid problems with global variables
-				dnl MEXLINK=$(echo ${MEXLINK} | sed -e "s/,-expo.*mexFunction\\.map\"//g" | sed -e "s/-[[^ ]]*mexFunction\\.map//g")
-				MEXLINK="" dnl We actually don't need MEXLINK????
+				dnl MEXLINKFLAGS=$(echo ${MEXLINKFLAGS} | sed -e "s/,-expo.*mexFunction\\.map\"//g" | sed -e "s/-[[^ ]]*mexFunction\\.map//g")
+				MEXLINKFLAGS="" dnl We actually don't need MEXLINK????
 			;;
 		esac
@@ -406,12 +449,15 @@
 		fi
 
+		AC_SUBST([MEXEXT])
+		AC_SUBST([MEXOPTFLAGS])
+		AC_SUBST([MEXCFLAGS])
+		AC_SUBST([MEXCXXFLAGS])
 		AC_SUBST([MATLABINCL])
-		MATLABWRAPPEREXT=${MEXEXT}
-		AC_SUBST([MATLABWRAPPEREXT])
+		AC_SUBST([MEXLINKFLAGS])
 		AC_SUBST([MEXLIB])
-		AC_SUBST([MEXLINK])
 	fi
 	dnl }}}
 	dnl JavaScript{{{
+	AC_MSG_CHECKING([for JavaScript])
 	AC_ARG_WITH(
 		[javascript],
@@ -420,5 +466,4 @@
 		[JAVASCRIPT="no"]
 	)
-	AC_MSG_CHECKING([for JavaScript])
 	if test "x${JAVASCRIPT}" == "xno"; then
 		HAVE_JAVASCRIPT=no
@@ -433,4 +478,5 @@
 	dnl }}}
 	dnl Triangle {{{
+	AC_MSG_CHECKING([for triangle])
 	AC_ARG_WITH(
 		[triangle-dir],
@@ -439,5 +485,4 @@
 		[TRIANGLE_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for triangle])
 	if test "x${TRIANGLE_ROOT}" == "xno"; then
 		HAVE_TRIANGLE=no
@@ -478,4 +523,20 @@
 				fi
 			;;
+			*mingw*)
+				if test "x${HAVE_JAVASCRIPT}" == "xyes"; then
+					dnl Link to the object file, not the library
+					TRIANGLELIB=${TRIANGLE_ROOT}/share/triangle.o
+				else
+					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
+				fi
+			;;
+			*msys*)
+				if test "x${HAVE_JAVASCRIPT}" == "xyes"; then
+					dnl Link to the object file, not the library
+					TRIANGLELIB=${TRIANGLE_ROOT}/share/triangle.o
+				else
+					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
+				fi
+			;;
 		esac
 		AC_DEFINE([_HAVE_TRIANGLE_], [1], [with Triangle in ISSM src])
@@ -485,4 +546,5 @@
 	dnl }}}
 	dnl Boost{{{
+	AC_MSG_CHECKING([for Boost])
 	AC_ARG_WITH(
 		[boost-dir],
@@ -491,5 +553,4 @@
 		[BOOST_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for Boost])
 	if test "x${BOOST_ROOT}" == "xno"; then
 		HAVE_BOOST=no
@@ -518,4 +579,5 @@
 	dnl }}}
 	dnl Dakota{{{
+	AC_MSG_CHECKING([for Dakota])
 	AC_ARG_WITH(
 		[dakota-dir],
@@ -524,5 +586,4 @@
 		[DAKOTA_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for Dakota])
 	if test "x${DAKOTA_ROOT}" == "xno"; then
 		HAVE_DAKOTA=no
@@ -541,20 +602,27 @@
 
 		AC_MSG_CHECKING(for Dakota version)
-		dnl TODO:	Check if this method applies to all other versions of 
-		dnl			Dakota (it should as long as the Dakota binaries have been
-		dnl 		compiled). If so, we can remove the other methods of 
-		dnl			getting the version.
+		dnl TODO:
+		dnl - Check if this method applies to all other versions of Dakota (it 
+		dnl   should as long as the Dakota binaries have been compiled). If so, 
+		dnl   we can remove the other methods of getting the version.
+		dnl - Modify src/wrappers/IssmConfig/IssmConfig.cpp so that strlen is 
+		dnl   not called with _DAKOTA_VERSION_ as an argument so that we can 
+		dnl   do,
 		dnl
-		DAKOTA_VERSION_OUTPUT=`${DAKOTA_ROOT}/bin/dakota -v`
-		if test -n "${DAKOTA_VERSION_OUTPUT}"; then
-			DAKOTA_VERSION=`echo ${DAKOTA_VERSION_OUTPUT} grep "Dakota version" | sed 's/Dakota version //' | sed 's/ .*//'`
-		elif test -f "${DAKOTA_ROOT}/VERSION"; then
+		dnl   	AC_DEFINE_UNQUOTED([_DAKOTA_VERSION_], ${DAKOTA_VERSION}, [Dakota version number])
+		dnl
+		if test -f "${DAKOTA_ROOT}/VERSION"; then
 			DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/VERSION | grep 'DAKOTA Version' | sed 's/.*DAKOTA Version //' | sed 's/ .*//'`
-		elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.C"; then
-			DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.C | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
-		elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp"; then
-			DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
 		else
-			AC_MSG_ERROR([Dakota CommandLineHandler.C or CommandLineHandler.cpp file not found to determine DAKOTA_VERSION!]);
+			DAKOTA_VERSION_OUTPUT=`${DAKOTA_ROOT}/bin/dakota -v`
+			if test -n "${DAKOTA_VERSION_OUTPUT}"; then
+				DAKOTA_VERSION=`echo ${DAKOTA_VERSION_OUTPUT} grep "Dakota version" | sed 's/Dakota version //' | sed 's/ .*//'`
+			elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.C"; then
+				DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.C | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
+			elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp"; then
+				DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
+			else
+				AC_MSG_ERROR([Dakota CommandLineHandler.C or CommandLineHandler.cpp file not found to determine DAKOTA_VERSION!]);
+			fi
 		fi
 		AC_MSG_RESULT([${DAKOTA_VERSION}])
@@ -674,11 +742,11 @@
 		AC_MSG_CHECKING(for Dakota major version)
 		AC_MSG_RESULT(${DAKOTA_MAJOR})
-		AC_DEFINE_UNQUOTED(_DAKOTA_MAJOR_, $DAKOTA_MAJOR, [Dakota major version number])
+		AC_DEFINE_UNQUOTED([_DAKOTA_MAJOR_], ${DAKOTA_MAJOR}, [Dakota major version number])
 		AC_MSG_CHECKING(for Dakota minor version)
 		AC_MSG_RESULT(${DAKOTA_MINOR})
-		AC_DEFINE_UNQUOTED(_DAKOTA_MINOR_, $DAKOTA_MINOR, [Dakota minor version number])
+		AC_DEFINE_UNQUOTED([_DAKOTA_MINOR_], ${DAKOTA_MINOR}, [Dakota minor version number])
 		AC_MSG_CHECKING(for Dakota build version)
 		AC_MSG_RESULT(${DAKOTA_BUILD})
-		AC_DEFINE_UNQUOTED(_DAKOTA_BUILD_, $DAKOTA_BUILD, [Dakota build version number])
+		AC_DEFINE_UNQUOTED([_DAKOTA_BUILD_], ${DAKOTA_BUILD}, [Dakota build version number])
 
 		AC_DEFINE([_HAVE_DAKOTA_], [1], [with Dakota in ISSM src])
@@ -690,4 +758,5 @@
 	dnl }}}
 	dnl Python{{{
+	AC_MSG_CHECKING([for Python])
 	AC_ARG_WITH(
 		[python-dir],
@@ -703,5 +772,4 @@
 		[PYTHON_VERSION="no"]
 	)
-	AC_MSG_CHECKING([for Python])
 	if test "x${PYTHON_ROOT}" == "xno"; then
 		HAVE_PYTHON=no
@@ -730,5 +798,5 @@
 		dnl Determine major version
 		PYTHON_MAJOR=${PYTHON_VERSION%.*}
-		AC_DEFINE_UNQUOTED(_PYTHON_MAJOR_, $PYTHON_MAJOR, [Python version major])
+		AC_DEFINE_UNQUOTED([_PYTHON_MAJOR_], ${PYTHON_MAJOR}, [Python version major])
 		if test "x${PYTHON_MAJOR}" == "x3"; then
 			HAVE_PYTHON3="yes"
@@ -746,8 +814,12 @@
 			PYTHONINCL=-I${PYTHON_ROOT}/include/python${PYTHON_VERSION}m
 		else
-			AC_MSG_ERROR([Python.h not found, locate this file and contact ISSM developers]);
+			AC_MSG_ERROR([Python.h not found! Please locate this file and contact ISSM developers via forum or email.]);
 		fi
 		AC_MSG_RESULT([found])
-		if test "x${PYTHON_MAJOR}" == "x3"; then
+		if ls ${PYTHON_ROOT}/lib/x86_64-linux-gnu/libpython${PYTHON_VERSION}m.* 1> /dev/null 2>&1; then
+			PYTHONLIB="-L${PYTHON_ROOT}/lib/x86_64-linux-gnu -lpython${PYTHON_VERSION}m"
+		elif ls ${PYTHON_ROOT}/lib/x86_64-linux-gnu/libpython${PYTHON_VERSION}.* 1> /dev/null 2>&1; then
+			PYTHONLIB="-L${PYTHON_ROOT}/lib/x86_64-linux-gnu -lpython${PYTHON_VERSION}"
+		elif ls ${PYTHON_ROOT}/lib/libpython${PYTHON_VERSION}m.* 1> /dev/null 2>&1; then
 			PYTHONLIB="-L${PYTHON_ROOT}/lib -lpython${PYTHON_VERSION}m"
 		else
@@ -759,9 +831,15 @@
 				PYTHONLINK="-shared"
 			;;
+			*darwin*)
+				PYTHONLINK="-dynamiclib"
+			;;
 			*linux*)
 				PYTHONLINK="-shared"
 			;;
-			*darwin*)
-				PYTHONLINK="-dynamiclib"
+			*mingw*)
+				PYTHONLINK="-shared"
+			;;
+			*msys*)
+				PYTHONLINK="-shared"
 			;;
 		esac
@@ -776,15 +854,4 @@
 	dnl }}}
 	dnl NumPy{{{
-	dnl TODO:
-	dnl - Replace references to python-numpy with numpy (and similar terms)
-	dnl	  project-wide
-	dnl
-	AC_ARG_WITH(
-		[python-numpy-dir],
-		AS_HELP_STRING([--with-python-numpy-dir=DIR], [python-numpy root directory]),
-		[PYTHON_NUMPY_ROOT=${withval}],
-		[PYTHON_NUMPY_ROOT="no"]
-	)
-
 	dnl NOTE: You can find NumPy by running,
 	dnl
@@ -792,6 +859,15 @@
 	dnl		>>> numpy.__file__
 	dnl
-
+	dnl TODO:
+	dnl - Replace references to python-numpy with numpy (and similar terms)
+	dnl	  project-wide
+	dnl
 	AC_MSG_CHECKING(for python-numpy)
+	AC_ARG_WITH(
+		[python-numpy-dir],
+		AS_HELP_STRING([--with-python-numpy-dir=DIR], [python-numpy root directory]),
+		[PYTHON_NUMPY_ROOT=${withval}],
+		[PYTHON_NUMPY_ROOT="no"]
+	)
 	if test "x${PYTHON_NUMPY_ROOT}" == "xno"; then
 		HAVE_PYTHON_NUMPY=no
@@ -812,4 +888,5 @@
 	dnl }}}
 	dnl Chaco{{{
+	AC_MSG_CHECKING([for Chaco])
 	AC_ARG_WITH(
 		[chaco-dir],
@@ -818,5 +895,4 @@
 		[CHACO_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for Chaco])
 	if test "x${CHACO_ROOT}" == "xno"; then
 		HAVE_CHACO=no
@@ -832,6 +908,10 @@
 	dnl Chaco libraries and header files
 	if test "x${HAVE_CHACO}" == "xyes"; then
-		CHACOINCL=-I${CHACO_ROOT}/include
-		CHACOLIB="-L${CHACO_ROOT}/lib -lchacominusblas"
+		CHACOINCL="-I${CHACO_ROOT}/include"
+		if test "${IS_MSYS2}" == "yes"; then
+			CHACOLIB="-Wl,-L${CHACO_ROOT}/lib -Wl,-lchacominusblas"
+		else
+			CHACOLIB="-L${CHACO_ROOT}/lib -lchacominusblas"
+		fi
 		AC_DEFINE([_HAVE_CHACO_], [1], [with Chaco in ISSM src])
 		AC_SUBST([CHACOINCL])
@@ -840,4 +920,5 @@
 	dnl }}}
 	dnl ESMF{{{
+	AC_MSG_CHECKING([for ESMF])
 	AC_ARG_WITH(
 		[esmf-dir],
@@ -846,5 +927,4 @@
 		[ESMF_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for ESMF])
 	if test "x${ESMF_ROOT}" == "xno"; then
 		HAVE_ESMF=no
@@ -860,5 +940,5 @@
 	if test "x${HAVE_ESMF}" == "xyes"; then
 		ESMFINCL="-I${ESMF_ROOT}/include"
-		ESMFLIB="-L${ESMF_ROOT}/lib -lesmf"
+		ESMFLIB="-L${ESMF_ROOT}/lib/libO/Linux.gfortran.64.mpich.default/ -lesmf"
 		AC_DEFINE([_HAVE_ESMF_], [1], [with ESMF in ISSM src])
 		AC_SUBST([ESMFINCL])
@@ -868,4 +948,5 @@
 	dnl }}}
 	dnl CoDiPack{{{
+	AC_MSG_CHECKING([for CoDiPack])
 	AC_ARG_WITH(
 		[codipack-dir],
@@ -874,5 +955,4 @@
 		[CODIPACK_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for CoDiPack])
 	if test "x${CODIPACK_ROOT}" == "xno"; then
 		HAVE_CODIPACK=no
@@ -887,4 +967,19 @@
 	dnl CoDiPack libraries and header files
 	if test "x${HAVE_CODIPACK}" == "xyes"; then
+
+		AC_MSG_CHECKING(for CoDiPack version)
+		CODIPACK_MAJOR=`cat ${CODIPACK_ROOT}/include/codi.hpp | grep "#define CODI_MAJOR_VERSION" | sed 's/#define CODI_MAJOR_VERSION//' | sed 's/ //g'`
+		CODIPACK_MINOR=`cat ${CODIPACK_ROOT}/include/codi.hpp | grep "#define CODI_MINOR_VERSION" | sed 's/#define CODI_MINOR_VERSION//' | sed 's/ //g'`
+		if test -z "${CODIPACK_MAJOR}"; then
+			 CODIPACK_MAJOR=`cat ${CODIPACK_ROOT}/include/codi/configure.h | grep "#define CODI_MAJOR_VERSION" | sed 's/#define CODI_MAJOR_VERSION//' | sed 's/ //g'`
+			 CODIPACK_MINOR=`cat ${CODIPACK_ROOT}/include/codi/configure.h | grep "#define CODI_MINOR_VERSION" | sed 's/#define CODI_MINOR_VERSION//' | sed 's/ //g'`
+		fi
+		if test -z "${CODIPACK_MAJOR}"; then
+			AC_MSG_ERROR([Couldn't determine CoDiPack version])
+		fi
+		AC_DEFINE_UNQUOTED([_CODIPACK_MAJOR_], ${CODIPACK_MAJOR}, [CoDiPack version major])
+		AC_DEFINE_UNQUOTED([_CODIPACK_MINOR_], ${CODIPACK_MINOR}, [CoDiPack version minor])
+		AC_MSG_RESULT([${CODIPACK_MAJOR}.${CODIPACK_MINOR}])
+
 		CODIPACKINCL="-I${CODIPACK_ROOT}/include"
 		AC_DEFINE([_HAVE_CODIPACK_], [1], [with CoDiPack in ISSM src])
@@ -896,4 +991,5 @@
 	dnl }}}
 	dnl Tape Allocation {{{
+	AC_MSG_CHECKING(for tape allocation)
 	AC_ARG_ENABLE(
 		[tape-alloc],																dnl feature
@@ -902,5 +998,4 @@
 		[enable_tape_alloc=no]
 	)
-	AC_MSG_CHECKING(for tape allocation)
 	if test "x${enable_tape_alloc}" == "xyes"; then
 		AC_DEFINE([_AD_TAPE_ALLOC_], [1], [enable a priori tape allocation for AD])
@@ -909,4 +1004,5 @@
 	dnl }}}
 	dnl ADOL-C {{{
+	AC_MSG_CHECKING([for ADOL-C])
 	AC_ARG_WITH(
 		[adolc-dir],
@@ -915,5 +1011,4 @@
 		[ADOLC_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for ADOL-C])
 	if test "x${ADOLC_ROOT}" == "xno"; then
 		HAVE_ADOLC=no
@@ -940,4 +1035,5 @@
 	dnl }}}
 	dnl ADOL-C version{{{
+	AC_MSG_CHECKING(for ADOL-C version)
 	AC_ARG_WITH(
 		[adolc-version],
@@ -946,10 +1042,9 @@
 		[ADOLC_VERSION=2]
 	)
-	AC_MSG_CHECKING(for ADOL-C version)
-
-	AC_DEFINE_UNQUOTED(_ADOLC_VERSION_, $ADOLC_VERSION, [ADOL-C version])
+	AC_DEFINE_UNQUOTED([_ADOLC_VERSION_], ${ADOLC_VERSION}, [ADOL-C version])
 	AC_MSG_RESULT(${ADOLC_VERSION})
 	dnl }}}
 	dnl ADIC2 {{{
+	AC_MSG_CHECKING([for ADIC2])
 	AC_ARG_WITH(
 		[adic2-dir],
@@ -958,5 +1053,4 @@
 		[ADIC2_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for ADIC2])
 	if test "x${ADIC2_ROOT}" == "xno"; then
 		HAVE_ADIC2=no
@@ -980,4 +1074,5 @@
 	dnl }}}
 	dnl ATLAS {{{
+	AC_MSG_CHECKING(for ATLAS and CBLAS libraries)
 	AC_ARG_WITH(
 		[atlas-dir],
@@ -986,5 +1081,4 @@
 		[ATLAS_ROOT="no"]
 	)
-	AC_MSG_CHECKING(for ATLAS and CBLAS libraries)
 	if test "x${ATLAS_ROOT}" == "xno"; then
 		HAVE_ATLAS=no
@@ -1003,9 +1097,15 @@
 				ATLASLIB="-L`cygpath -m ${ATLAS_ROOT}` -Wl,libatlas.lib  -Wl,libcblas.lib"
 			;;
+			*darwin*)
+				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
+			;;
 			*linux*)
-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm "
-			;;
-			*darwin*)
-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm "
+				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
+			;;
+			*mingw*)
+				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
+			;;
+			*msys*)
+				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
 			;;
 		esac
@@ -1015,4 +1115,5 @@
 	dnl }}}
 	dnl GSL{{{
+	AC_MSG_CHECKING([for GSL])
 	AC_ARG_WITH(
 		[gsl-dir],
@@ -1021,5 +1122,4 @@
 		[GSL_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for GSL])
 	if test "x${GSL_ROOT}" == "xno"; then
 		HAVE_GSL=no
@@ -1047,4 +1147,5 @@
 	dnl }}}
 	dnl AMPI (ADOL-C){{{
+	AC_MSG_CHECKING([for AMPI])
 	AC_ARG_WITH(
 		[ampi-dir],
@@ -1053,5 +1154,4 @@
 		[AMPI_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for AMPI])
 	if test "x${AMPI_ROOT}" == "xno"; then
 		HAVE_AMPI=no
@@ -1083,4 +1183,5 @@
 	dnl }}}
 	dnl Adjoint MPI (CoDiPack){{{
+	AC_MSG_CHECKING([for Adjoint MPI])
 	AC_ARG_WITH(
 		[adjointmpi-dir],
@@ -1089,5 +1190,4 @@
 		[ADJOINTMPI_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for Adjoint MPI])
 	if test "x${ADJOINTMPI_ROOT}" == "xno"; then
 		HAVE_ADJOINTMPI=no
@@ -1117,4 +1217,5 @@
 	dnl }}}
 	dnl MeDiPack (CoDiPack, ADOL-C dev){{{
+	AC_MSG_CHECKING([for MeDiPack])
 	AC_ARG_WITH(
 		[medipack-dir],
@@ -1123,5 +1224,4 @@
 		[MEDIPACK_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for MeDiPack])
 	if test "x${MEDIPACK_ROOT}" == "xno"; then
 		HAVE_MEDIPACK=no
@@ -1149,4 +1249,5 @@
 	dnl }}}
 	dnl HDF5 {{{
+	AC_MSG_CHECKING(for HDF5 libraries)
 	AC_ARG_WITH(
 		[hdf5-dir],
@@ -1155,5 +1256,4 @@
 		[HDF5_ROOT="no"]
 	)
-	AC_MSG_CHECKING(for HDF5 libraries)
 	if test "x${HDF5_ROOT}" == "xno"; then
 		HAVE_HDF5=no
@@ -1176,8 +1276,14 @@
 				HDF5LIB="-L`cygpath -m ${HDF5_ROOT}` -Wl,libhdf5.lib  -Wl,libhdf5_hl.lib"
 			;;
+			*darwin*)
+				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
+			;;
 			*linux*)
 				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
 			;;
-			*darwin*)
+			*mingw*)
+				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
+			;;
+			*msys*)
 				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
 			;;
@@ -1188,4 +1294,5 @@
 	dnl }}}
 	dnl PETSc{{{
+	AC_MSG_CHECKING([for PETSc])
 	AC_ARG_WITH(
 		[petsc-dir],
@@ -1194,5 +1301,4 @@
 		[PETSC_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for PETSc])
 	if test "x${PETSC_ROOT}" == "xno"; then
 		HAVE_PETSC=no
@@ -1215,6 +1321,6 @@
 		PETSC_MAJOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MAJOR" | sed 's/#define PETSC_VERSION_MAJOR//' | sed 's/ //g'`
 		PETSC_MINOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MINOR" | sed 's/#define PETSC_VERSION_MINOR//' | sed 's/ //g'`
-		AC_DEFINE_UNQUOTED([_PETSC_MAJOR_], [$PETSC_MAJOR], [PETSc version major])
-		AC_DEFINE_UNQUOTED([_PETSC_MINOR_], [$PETSC_MINOR], [PETSc version minor])
+		AC_DEFINE_UNQUOTED([_PETSC_MAJOR_], ${PETSC_MAJOR}, [PETSc version major])
+		AC_DEFINE_UNQUOTED([_PETSC_MINOR_], ${PETSC_MINOR}, [PETSc version minor])
 		AC_MSG_RESULT([${PETSC_MAJOR}.${PETSC_MINOR}])
 
@@ -1257,4 +1363,14 @@
 					PETSCLIB="/link -Wl,/LIBPATH:`cygpath -m ${PETSC_ROOT}/lib` -Wl,libpetsc.lib"
 					PETSCINCL="/I`cygpath -m ${PETSC_ROOT}/include`"
+				fi
+			;;
+			*darwin*)
+				if test ${PETSC_MAJOR} -lt 3; then
+					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc"
+				else
+					PETSCLIB="-L${PETSC_ROOT}/lib -lpetsc"
+					if test ${PETSC_MAJOR} -gt 3 || test ${PETSC_MINOR} -ge 3; then
+						PETSCLIB+=" -lmetis"
+					fi
 				fi
 			;;
@@ -1275,13 +1391,9 @@
 				fi
 			;;
-			*darwin*)
-				if test ${PETSC_MAJOR} -lt 3; then
-					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc"
-				else
-					PETSCLIB="-L${PETSC_ROOT}/lib -lpetsc"
-					if test ${PETSC_MAJOR} -gt 3 || test ${PETSC_MINOR} -ge 3; then
-						PETSCLIB+=" -lmetis"
-					fi
-				fi
+			*mingw*)
+				PETSCLIB="-Wl,${PETSC_ROOT}/lib/libpetsc.a"
+			;;
+			*msys*)
+				PETSCLIB="${PETSC_ROOT}/lib -lpetsc"
 			;;
 		esac
@@ -1294,5 +1406,4 @@
 	dnl MPI{{{
 	AC_MSG_CHECKING(for MPI)
-
 	AC_ARG_WITH(
 		[mpi-include],
@@ -1301,5 +1412,4 @@
 		[MPI_INCLUDE=""]
 	)
-
 	AC_ARG_WITH(
 		[mpi-libdir],
@@ -1308,5 +1418,4 @@
 		[MPI_LIBDIR=""]
 	)
-
 	AC_ARG_WITH(
 		[mpi-libflags],
@@ -1315,5 +1424,4 @@
 		[MPI_LIBFLAGS=""]
 	)
-
 	if test -z "${MPI_INCLUDE}"; then
 		HAVE_MPI=no
@@ -1358,4 +1466,5 @@
 	dnl }}}
 	dnl SCOTCH{{{
+	AC_MSG_CHECKING([for SCOTCH])
 	AC_ARG_WITH(
 		[scotch-dir],
@@ -1364,5 +1473,4 @@
 		[SCOTCH_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for SCOTCH])
 	if test "x${SCOTCH_ROOT}" == "xno"; then
 		HAVE_SCOTCH=no
@@ -1397,82 +1505,136 @@
 	dnl }}}
 	dnl METIS{{{
-
-	dnl NOTE: We know $VENDOR cannot be empty at this point, so no need to
-	dnl		  check again in the following conditionals
-	dnl
-	if test "x${HAVE_PETSC}" == "xyes" && test "x${PETSC_MAJOR}" == "x3" && test ${PETSC_MINOR} -ge 3 && test "${VENDOR}" != "MSVC-Win64" && test "${VENDOR}" != "MSVC-Win64-par"; then
-		dnl In PETSc >=3.3, METIS is provided
-		HAVE_METIS="yes"
-		AC_DEFINE([_METIS_VERSION_], [5], [METIS version number])
+	AC_MSG_CHECKING([for METIS])
+	AC_ARG_WITH(
+		[metis-dir],
+		AS_HELP_STRING([--with-metis-dir=DIR], [METIS root directory, necessary for serial build]),
+		[METIS_ROOT=${withval}],
+		[METIS_ROOT="no"]
+	)
+	HAVE_METIS=no
+	if test "x${METIS_ROOT}" == "xno"; then
+		dnl Check if METIS was installed via PETSc
+		if test -f ${PETSC_ROOT}/install/include/metis.h; then
+			HAVE_METIS=yes
+			METIS_ROOT="${PETSC_ROOT}"
+		fi
+	else
+		if ! test -d "${METIS_ROOT}"; then
+			AC_MSG_ERROR([METIS directory provided (${METIS_ROOT}) does not exist!]);
+		fi
+		HAVE_METIS=yes
+	fi
+	if test "${HAVE_METIS}" = "yes"; then
+		METIS_VERSION=$(grep "#define METIS_VER_MAJOR" ${METIS_ROOT}/include/metis.h | sed 's|.*METIS_VER_MAJOR[[:space:]]*||')
+		dnl METIS libraries and header files
+		if test "x${METIS_VERSION}" == "x4"; then
+			METISINCL="-I${METIS_ROOT}/Lib"
+			case "${host_os}" in
+				*cygwin*)
+					METISINCL="/I`cygpath -m ${METIS_ROOT}/Lib`"
+					METISLIB="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${METIS_ROOT}` -Wl,libmetis.lib"
+				;;
+				*darwin*)
+					METISLIB="-L${METIS_ROOT} -lmetis"
+				;;
+				*linux*)
+					METISLIB="-L${METIS_ROOT} -lmetis"
+				;;
+				*mingw*)
+					METISLIB="-Wl,${METIS_ROOT}/lib/libmetis.a"
+				;;
+				*msys*)
+					METISLIB="-L${METIS_ROOT} -lmetis"
+				;;
+			esac
+		elif test "x${METIS_VERSION}" == "x5"; then
+			METISINCL="-I${METIS_ROOT}/include"
+			case "${host_os}" in
+				*cygwin*)
+					METISLIB="-L${METIS_ROOT} libmetis.lib"
+				;;
+				*darwin*)
+					METISLIB="-L${METIS_ROOT}/lib -lmetis"
+				;;
+				*linux*)
+					METISLIB="-L${METIS_ROOT}/lib -lmetis"
+				;;
+				*mingw*)
+					METISLIB="-Wl,${METIS_ROOT}/lib/libmetis.a"
+				;;
+				*msys*)
+					METISLIB="-L${METIS_ROOT}/lib -lmetis"
+				;;
+			esac
+		else
+			AC_MSG_ERROR([METIS version ${METIS_VERSION} not yet supported! Please contact ISSM developers via forum or email.])
+		fi
 		AC_DEFINE([_HAVE_METIS_], [1], [with METIS in ISSM src])
-	else
-		AC_ARG_WITH(
-			[metis-dir],
-			AS_HELP_STRING([--with-metis-dir=DIR], [METIS root directory, necessary for serial build]),
-			[METIS_ROOT=${withval}],
-			[METIS_ROOT="no"]
-		)
-		AC_MSG_CHECKING([for METIS])
-		if test "x${METIS_ROOT}" == "xno"; then
-			HAVE_METIS=no
-		else
-			HAVE_METIS=yes
-			if ! test -d "${METIS_ROOT}"; then
-				AC_MSG_ERROR([METIS directory provided (${METIS_ROOT}) does not exist!]);
-			fi
-		fi
-		AC_MSG_RESULT([${HAVE_METIS}])
-		AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" == "xyes"])
-
+		AC_DEFINE_UNQUOTED([_METIS_VERSION_], ${METIS_VERSION}, [METIS version number])
+		AC_SUBST([METISINCL])
+		AC_SUBST([METISLIB])
+	fi
+	AC_MSG_RESULT([${HAVE_METIS}])
+	AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" = "xyes"])
+	dnl }}}
+	dnl ParMETIS{{{
+	AC_MSG_CHECKING([for ParMETIS])
+	AC_ARG_WITH(
+		[parmetis-dir],
+		AS_HELP_STRING([--with-parmetis-dir=DIR], [ParMETIS root directory, necessary for parallel build]),
+		[PARMETIS_ROOT=${withval}],
+		[PARMETIS_ROOT="no"]
+	)
+	HAVE_PARMETIS=no
+	if test "x${PARMETIS_ROOT}" == "xno"; then
+		dnl Check if ParMETIS was installed via PETSc
+		if test -f ${PETSC_ROOT}/install/include/parmetis.h; then
+			HAVE_PARMETIS="yes"
+			PARMETIS_ROOT="${PETSC_ROOT}"
+		fi
+	else
+		if ! test -d "${PARMETIS_ROOT}"; then
+			AC_MSG_ERROR([ParMETIS directory provided (${PARMETIS_ROOT}) does not exist!]);
+		fi
+		if ! test -d "${METIS_ROOT}"; then
+			AC_MSG_ERROR([If supplying path to ParMETIS with option --with-parmetis-dir, must also supply path to METIS with option --with-metis-dir]);
+		fi
+		HAVE_PARMETIS="yes"
+	fi
+	if test "${HAVE_PARMETIS}" == "yes"; then
+		#PARMETIS_VERSION=$(grep "#define PARMETIS_MAJOR_VERSION" ${PARMETIS_ROOT}/include/parmetis.h | sed 's|.*PARMETIS_MAJOR_VERSION[[:space:]]*||')
 		dnl METIS libraries and header files
-		if test "x${HAVE_METIS}" == "xyes"; then
-			dnl Retrieve METIS version (does the VERSION file exist?)
-			if test -f "${METIS_ROOT}/VERSION"; then
-				METIS_VERSION=4
-			else
-				METIS_VERSION=5
-			fi
-
-			if test "x${METIS_VERSION}" == "x4"; then
-				METISINCL="-I${METIS_ROOT}/Lib"
-				case "${host_os}" in
-					*cygwin*)
-						METISINCL="/I`cygpath -m ${METIS_ROOT}/Lib`"
-						METISLIB="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${METIS_ROOT}` -Wl,libmetis.lib"
-					;;
-					*linux*)
-						METISLIB="-L${METIS_ROOT} -lparmetis -lmetis"
-					;;
-					*darwin*)
-						METISLIB="-L${METIS_ROOT} -lparmetis -lmetis"
-					;;
-				esac
-				AC_DEFINE([_METIS_VERSION_], [4], [ METIS version number])
-			fi
-
-			if test "x${METIS_VERSION}" == "x5"; then
-				case "${host_os}" in
-					*cygwin*)
-						METISLIB="-L${METIS_ROOT} libmetis.lib"
-					;;
-					*linux*)
-						METISLIB="-L${METIS_ROOT}/lib -lparmetis -lmetis"
-					;;
-					*darwin*)
-						METISLIB="-L${METIS_ROOT}/lib -lparmetis -lmetis"
-					;;
-				esac
-				METISINCL="-I${METIS_ROOT}/include"
-				AC_DEFINE([_METIS_VERSION_], [5], [METIS version number])
-			fi
-
-			AC_DEFINE([_HAVE_METIS_], [1], [with METIS in ISSM src])
-			AC_SUBST([METISINCL])
-			AC_SUBST([METISLIB])
-		fi
-	fi
-	AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" == "xyes"])
+		#if test "x${PARMETIS_VERSION}" == "x4"; then
+			PARMETISINCL="-I${PARMETIS_ROOT}/include"
+			case "${host_os}" in
+				*cygwin*)
+					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
+				;;
+				*darwin*)
+					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
+				;;
+				*linux*)
+					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
+				;;
+				*mingw*)
+					PARMETISLIB="-Wl,${PARMETIS_ROOT}/lib/libparmetis.a"
+				;;
+				*msys*)
+					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
+				;;
+			esac
+		#else
+		#	AC_MSG_ERROR([ParMETIS version ${PARMETIS_VERSION} not yet supported! Please contact ISSM developers via forum or email.])
+		#fi
+		AC_DEFINE([_HAVE_PARMETIS_], [1], [with ParMETIS in ISSM src])
+		#AC_DEFINE([_PARMETIS_VERSION_], [${PARMETIS_VERSION}], [ParMETIS version number])
+		AC_SUBST([PARMETISINCL])
+		AC_SUBST([PARMETISLIB])
+	fi
+	AC_MSG_RESULT([${HAVE_PARMETIS}])
+	AM_CONDITIONAL([PARMETIS], [test "x${HAVE_PARMETIS}" = "xyes"])
 	dnl }}}
 	dnl Toolkit for Advanced Optimization (TAO){{{
+	AC_MSG_CHECKING([for TAO])
 	AC_ARG_WITH(
 		[tao-dir],
@@ -1481,6 +1643,4 @@
 		[TAO_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for TAO])
-
 	if test "x${HAVE_PETSC}" == "xyes" && test "x${PETSC_MAJOR}" == "x3" && test ${PETSC_MINOR} -ge 5; then
 		dnl In PETSc >= 3.5, TAO is provided
@@ -1510,4 +1670,5 @@
 	dnl }}}
 	dnl M1QN3{{{
+	AC_MSG_CHECKING([for M1QN3])
 	AC_ARG_WITH(
 		[m1qn3-dir],
@@ -1516,5 +1677,4 @@
 		[M1QN3_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for M1QN3])
 	if test "x${M1QN3_ROOT}" == "xno"; then
 		HAVE_M1QN3=no
@@ -1529,5 +1689,9 @@
 	dnl M1QN3 libraries and header files
 	if test "x${HAVE_M1QN3}" == "xyes"; then
-		M1QN3LIB="${M1QN3_ROOT}/libm1qn3.a ${M1QN3_ROOT}/libddot.a"
+		if test "${IS_MSYS2}" == "yes"; then
+			M1QN3LIB="-Wl,${M1QN3_ROOT}/libm1qn3.a -Wl,${M1QN3_ROOT}/libddot.a"
+		else
+			M1QN3LIB="${M1QN3_ROOT}/libm1qn3.a ${M1QN3_ROOT}/libddot.a"
+		fi
 		AC_DEFINE([_HAVE_M1QN3_], [1], [with M1QN3 in ISSM src])
 		AC_SUBST([M1QN3LIB])
@@ -1535,4 +1699,5 @@
 	dnl }}}
 	dnl PROJ{{{
+	AC_MSG_CHECKING([for PROJ])
 	AC_ARG_WITH(
 		[proj-dir],
@@ -1541,5 +1706,4 @@
 		[PROJ_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for PROJ])
 	if test "x${PROJ_ROOT}" == "xno"; then
 		HAVE_PROJ=no
@@ -1563,4 +1727,5 @@
 	dnl }}}
 	dnl SLEPc{{{
+	AC_MSG_CHECKING([for SLEPc])
 	AC_ARG_WITH(
 		[slepc-dir],
@@ -1569,5 +1734,4 @@
 		[SLEPC_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for SLEPc])
 	if test "x${SLEPC_ROOT}" == "xno"; then
 		HAVE_SLEPC=no
@@ -1590,4 +1754,5 @@
 	dnl }}}
 	dnl shapelib{{{
+	AC_MSG_CHECKING([for shapelib])
 	AC_ARG_WITH(
 		[shapelib-dir],
@@ -1596,5 +1761,4 @@
 		[SHAPELIB_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for shapelib])
 	if test "x${SHAPELIB_ROOT}" == "xno"; then
 		HAVE_SHAPELIB=no
@@ -1615,8 +1779,10 @@
 		AC_SUBST([SHAPELIBLIB])
 	fi
+	AM_CONDITIONAL([SHP], [test "x${HAVE_SHAPELIB}" == "xyes"])
 	dnl }}}
 	dnl ScaLAPACK{{{
-
 	dnl NOTE: User should supply path to root directory or libraries, but not both
+	dnl
+	AC_MSG_CHECKING([for ScaLAPACK])
 	AC_ARG_WITH(
 		[scalapack-dir],
@@ -1631,5 +1797,4 @@
 		[SCALAPACKLIB="no"]
 	)
-	AC_MSG_CHECKING([for ScaLAPACK])
 	if test "x${SCALAPACK_ROOT}" == "xno" && test "x${SCALAPACKLIB}" == "xno"; then
 		HAVE_SCALAPACK=no
@@ -1640,5 +1805,9 @@
 		fi
 		HAVE_SCALAPACK=yes
-		SCALAPACKLIB="-L${SCALAPACK_ROOT}/lib -lscalapack"
+		if test "${VENDOR}" == "win-msys2"; then
+			SCALAPACKLIB="-Wl,${SCALAPACK_ROOT}/lib/libscalapack.a"
+		else
+			SCALAPACKLIB="-L${SCALAPACK_ROOT}/lib -lscalapack"
+		fi
 	elif test "x${SCALAPACKLIB}" != "xno"; then
 		dnl Value of SCALAPACKLIB should be valid here, so no need to set it (as above)
@@ -1656,4 +1825,17 @@
 	dnl }}}
 	dnl BLAS/LAPACK{{{
+	AC_MSG_CHECKING([for BLAS/LAPACK])
+	AC_ARG_WITH(
+		[blas-dir],
+		[AS_HELP_STRING([--with-blas-dir=DIR], [BLAS root directory])],
+		[BLAS_ROOT=$withval],
+		[BLAS_ROOT="no"]
+	)
+	AC_ARG_WITH(
+		[lapack-dir],
+		[AS_HELP_STRING([--with-lapack-dir=DIR], [LAPACK root directory])],
+		[LAPACK_ROOT=$withval],
+		[LAPACK_ROOT="no"]
+	)
 	AC_ARG_WITH(
 		[blas-lapack-dir],
@@ -1662,11 +1844,12 @@
 		[BLASLAPACK_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for BLAS/LAPACK])
-	if test "x${BLASLAPACK_ROOT}" == "xno" ; then
+	if (test "x${BLAS_ROOT}" = "xno" || test "x${LAPACK_ROOT}" = "xno") && test "x${BLASLAPACK_ROOT}" = "xno"; then
 		HAVE_BLASLAPACK=no
 	else
 		HAVE_BLASLAPACK=yes
-		if ! test -d "${BLASLAPACK_ROOT}"; then
-			AC_MSG_ERROR([BLAS/LAPACK directory provided (${BLASLAPACK_ROOT}) does not exist!]);
+		if ! test -d "${BLAS_ROOT}" || ! test -d "${LAPACK_ROOT}"; then
+			if ! test -d "${BLASLAPACK_ROOT}"; then
+				AC_MSG_ERROR([Use either --with-blas-dir and --with-lapack-dir *or* --with-blaslapack-dir]);
+			fi
 		fi
 	fi
@@ -1675,5 +1858,4 @@
 	dnl BLAS/LAPACK libraries and header files
 	if test "x${HAVE_BLASLAPACK}" == "xyes"; then
-		BLASLAPACKINCL=""
 		case "${host_os}" in
 			*cygwin*)
@@ -1704,11 +1886,42 @@
 				fi
 			;;
+			*mingw*)
+				if test -d "${BLASLAPACK_ROOT}"; then
+					BLASLAPACKLIB="-L${BLASLAPACK_ROOT}/lib"
+					if ls ${BLASLAPACK_ROOT}/lib/libopenblas.* 1> /dev/null 2>&1; then
+						BLASLAPACKLIB+=" -lopenblas"
+					elif ls ${BLASLAPACK_ROOT}/lib/libf2clapack.* 1> /dev/null 2>&1; then
+						BLASLAPACKLIB+=" -lf2clapack -lf2cblas"
+					elif ls ${BLASLAPACK_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
+						BLASLAPACKLIB="-Wl,${BLASLAPACK_ROOT}/lib/libflapack.a -Wl,${BLASLAPACK_ROOT}/lib/libfblas.a"
+					else
+						BLASLAPACKLIB+=" -llapack -lblas"
+					fi
+				else
+					BLASLAPACKLIB="-Wl,${LAPACK_ROOT}/lib/liblapack.a -Wl,${BLAS_ROOT}/lib/libblas.a"
+				fi
+			;;
+			*msys*)
+				if test -d "${BLASLAPACK_ROOT}"; then
+					if ls ${BLASLAPACK_ROOT}/lib/libopenblas.* 1> /dev/null 2>&1; then
+						BLASLAPACKLIB=" -lopenblas"
+					elif ls ${BLASLAPACK_ROOT}/lib/libf2clapack.* 1> /dev/null 2>&1; then
+						BLASLAPACKLIB=" -lf2clapack -lf2cblas"
+					elif ls ${BLASLAPACK_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
+						BLASLAPACKLIB+=" -lflapack -lfblas"
+					else
+						BLASLAPACKLIB=" -llapack -lblas"
+					fi
+				else
+					BLASLAPACKLIB="-L${LAPACK_ROOT}/lib -llapack -L${BLAS_ROOT}/lib -lblas"
+				fi
+			;;
 		esac
 		AC_DEFINE([_HAVE_BLASLAPACK_], [1], [with BLAS/LAPACK in ISSM src])
 		AC_SUBST([BLASLAPACKLIB])
-		AC_SUBST([BLASLAPACKINCL])
 	fi
 	dnl }}}
 	dnl Math Kernel Library (MKL){{{
+	AC_MSG_CHECKING([for MKL])
 	AC_ARG_WITH(
 		[mkl-libflags],
@@ -1717,5 +1930,4 @@
 		[MKL_LIBFLAGS="no"]
 	)
-	AC_MSG_CHECKING([for MKL])
 	if test "x${MKL_LIBFLAGS}" == "xno"; then
 		HAVE_MKL=no
@@ -1730,5 +1942,4 @@
 	dnl }}}
 	dnl PlaLAPACK{{{
-
 	dnl TODO: 	Handle user supplying path to root directory *or* individual
 	dnl 		arguments (like ScaLAPACK)
@@ -1765,4 +1976,5 @@
 	dnl }}}
 	dnl MUMPS{{{
+	AC_MSG_CHECKING([for MUMPS])
 	AC_ARG_WITH(
 		[mumps-dir],
@@ -1771,5 +1983,4 @@
 		[MUMPS_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for MUMPS])
 	if test "x${MUMPS_ROOT}" == "xno"; then
 		HAVE_MUMPS=no
@@ -1786,11 +1997,11 @@
 		MUMPSINCL="-I${MUMPS_ROOT}/include"
 		if test "x${MUMPS_ROOT}" == "x${PETSC_ROOT}"; then
-			if test "x${PETSC_MAJOR}" == "x2"; then
-				MUMPSLIB="-L${MUMPS_ROOT}/lib "
+			if test "${VENDOR}" == "win-msys2"; then
+				MUMPSLIB="-Wl,${MUMPS_ROOT}/lib/libcmumps.a -Wl,${MUMPS_ROOT}/lib/libdmumps.a -Wl,${MUMPS_ROOT}/lib/libsmumps.a -Wl,${MUMPS_ROOT}/lib/libzmumps.a -Wl,${MUMPS_ROOT}/lib/libmumps_common.a -Wl,${MUMPS_ROOT}/lib/libpord.a"
 			else
 				MUMPSLIB="-L${MUMPS_ROOT}/lib -ldmumps -lcmumps -lmumps_common -lpord -lparmetis -lzmumps -lmetis"
 			fi
 		else
-			MUMPSLIB="-L${MUMPS_ROOT}/lib -ldmumps -lmumps_common -lpord"
+			MUMPSLIB="-L${MUMPS_ROOT}/lib -ldmumps -lmumps_common -lpord -lparmetis"
 		fi
 		AC_DEFINE([_HAVE_MUMPS_], [1], [with MUMPS in ISSM src])
@@ -1836,4 +2047,5 @@
 	dnl }}}
 	dnl BLACS{{{
+	AC_MSG_CHECKING([for BLACS])
 	AC_ARG_WITH(
 		[blacs-dir],
@@ -1842,5 +2054,4 @@
 		[BLACS_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for BLACS])
 	if test "x${BLACS_ROOT}" == "xno"; then
 		HAVE_BLACS=no
@@ -1863,4 +2074,5 @@
 	dnl }}}
 	dnl HYPRE{{{
+	AC_MSG_CHECKING([for HYPRE])
 	AC_ARG_WITH(
 		[hypre-dir],
@@ -1869,5 +2081,4 @@
 		[HYPRE_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for HYPRE])
 	if test "x${HYPRE_ROOT}" == "xno"; then
 		HAVE_HYPRE=no
@@ -1890,4 +2101,5 @@
 	dnl }}}
 	dnl Prometheus{{{
+	AC_MSG_CHECKING([for Prometheus])
 	AC_ARG_WITH(
 		[prometheus-dir],
@@ -1896,5 +2108,4 @@
 		[PROMETHEUS_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for Prometheus])
 	if test "x${PROMETHEUS_ROOT}" == "xno"; then
 		HAVE_PROMETHEUS=no
@@ -1917,4 +2128,5 @@
 	dnl }}}
 	dnl SEMIC{{{
+	AC_MSG_CHECKING([for SEMIC])
 	AC_ARG_WITH(
 		[semic-dir],
@@ -1923,5 +2135,4 @@
 		[SEMIC_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for SEMIC])
 	if test "x${SEMIC_ROOT}" == "xno"; then
 		HAVE_SEMIC=no
@@ -1937,6 +2148,10 @@
 	if test "x${HAVE_SEMIC}" == "xyes"; then
 		SEMICINCL="-I${SEMIC_ROOT}"
+		if test "${IS_MSYS2}" == "yes"; then
+			SEMICLIB="-Wl,-L${SEMIC_ROOT}/lib -Wl,-lsurface_physics -Wl,-lutils"
+		else
+			SEMICLIB="-L${SEMIC_ROOT}/lib -lsurface_physics -lutils"
+		fi
 		AC_DEFINE([_HAVE_SEMIC_], [1], [with SEMIC in ISSM src])
-		SEMICLIB="-L${SEMIC_ROOT} -lsurface_physics -lutils"
 		AC_SUBST([SEMICLIB])
 		AC_SUBST([SEMICINCL])
@@ -1945,4 +2160,5 @@
 	dnl }}}
 	dnl SPAI{{{
+	AC_MSG_CHECKING([for SPAI])
 	AC_ARG_WITH(
 		[spai-dir],
@@ -1951,5 +2167,4 @@
 		[SPAI_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for SPAI])
 	if test "x${SPAI_ROOT}" == "xno"; then
 		HAVE_SPAI=no
@@ -1972,4 +2187,5 @@
 	dnl }}}
 	dnl SuperLU{{{
+	AC_MSG_CHECKING([for SuperLU])
 	AC_ARG_WITH(
 		[superlu-dir],
@@ -1978,5 +2194,4 @@
 		[SUPERLU_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for SuperLU])
 	if test "x${SUPERLU_ROOT}" == "xno"; then
 		HAVE_SUPERLU=no
@@ -1999,4 +2214,5 @@
 	dnl }}}
 	dnl SPOOLES{{{
+	AC_MSG_CHECKING([for SPOOLES])
 	AC_ARG_WITH(
 		[spooles-dir],
@@ -2005,5 +2221,4 @@
 		[SPOOLES_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for SPOOLES])
 	if test "x${SPOOLES_ROOT}" == "xno"; then
 		HAVE_SPOOLES=no
@@ -2026,4 +2241,5 @@
 	dnl }}}
 	dnl PaStiX{{{
+	AC_MSG_CHECKING([for PaStiX])
 	AC_ARG_WITH(
 		[pastix-dir],
@@ -2032,5 +2248,4 @@
 		[PASTIX_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for PaStiX])
 	if test "x${PASTIX_ROOT}" == "xno"; then
 		HAVE_PASTIX=no
@@ -2054,4 +2269,5 @@
 	dnl }}}
 	dnl ml{{{
+	AC_MSG_CHECKING([for ml])
 	AC_ARG_WITH(
 		[ml-dir],
@@ -2060,5 +2276,4 @@
 		[ML_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for ml])
 	if test "x${ML_ROOT}" == "xno"; then
 		HAVE_ML=no
@@ -2081,4 +2296,5 @@
 	dnl }}}
 	dnl UMFPACK{{{
+	AC_MSG_CHECKING([for UMFPACK])
 	AC_ARG_WITH(
 		[umfpack-dir],
@@ -2087,5 +2303,4 @@
 		[UMFPACK_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for UMFPACK])
 	if test "x${UMFPACK_ROOT}" == "xno"; then
 		HAVE_UMFPACK=no
@@ -2124,4 +2339,5 @@
 	dnl }}}
 	dnl MATH77{{{
+	AC_MSG_CHECKING([for MATH77])
 	AC_ARG_WITH(
 		[math77-dir],
@@ -2130,5 +2346,4 @@
 		[MATH77_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for MATH77])
 	if test "x${MATH77_ROOT}" == "xno"; then
 		HAVE_MATH77=no
@@ -2149,4 +2364,5 @@
 	dnl }}}
 	dnl Fortran{{{
+	AC_MSG_CHECKING(for Fortran compilation)
 	AC_ARG_WITH(
 		[fortran],
@@ -2155,5 +2371,4 @@
 		[FORTRAN=yes]
 	)
-	AC_MSG_CHECKING(for Fortran compilation)
 	if test "x${FORTRAN}" == "xyes"; then
 		HAVE_FORTRAN=yes
@@ -2219,4 +2434,5 @@
 	dnl }}}
 	dnl MeteoIO{{{
+	AC_MSG_CHECKING([for MeteoIO])
 	AC_ARG_WITH(
 		[meteoio-dir],
@@ -2225,5 +2441,4 @@
 		[METEOIO_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for MeteoIO])
 	if test "x${METEOIO_ROOT}" == "xno"; then
 		HAVE_METEOIO=no
@@ -2248,4 +2463,5 @@
 	dnl }}}
 	dnl SNOWPACK{{{
+	AC_MSG_CHECKING([for SNOWPACK])
 	AC_ARG_WITH(
 		[snowpack-dir],
@@ -2254,5 +2470,4 @@
 		[SNOWPACK_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for SNOWPACK])
 	if test "x${SNOWPACK_ROOT}" == "xno"; then
 		HAVE_SNOWPACK=no
@@ -2276,4 +2491,5 @@
 	dnl }}}
 	dnl NeoPZ{{{
+	AC_MSG_CHECKING([for NeoPZ])
 	AC_ARG_WITH(
 		[neopz-dir],
@@ -2282,5 +2498,4 @@
 		[NEOPZ_ROOT="no"]
 	)
-	AC_MSG_CHECKING([for NeoPZ])
 	if test "x${NEOPZ_ROOT}" == "xno"; then
 		HAVE_NEOPZ=no
@@ -2351,9 +2566,10 @@
 		GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f 1`
 		AC_MSG_RESULT([${GMSH_VERSION_MAJOR}])
-		AC_DEFINE_UNQUOTED(_GMSH_VERSION_MAJOR_, $GMSH_VERSION_MAJOR, [Gmsh major version])
+		AC_DEFINE_UNQUOTED([_GMSH_VERSION_MAJOR_], ${GMSH_VERSION_MAJOR}, [Gmsh major version])
 	fi	
 	dnl }}}
 	dnl Capabilities
 	dnl with-bamg{{{
+	AC_MSG_CHECKING([for BAMG capability compilation])
 	AC_ARG_WITH(
 		[bamg],
@@ -2362,5 +2578,4 @@
 		[BAMG=yes]
 	)
-	AC_MSG_CHECKING([for BAMG capability compilation])
 	HAVE_BAMG=no
 	if test "x${BAMG}" == "xyes"; then
@@ -2372,4 +2587,5 @@
 	dnl }}}
 	dnl with-ocean{{{
+	AC_MSG_CHECKING(for ice/ocean coupling capability compilation)
 	AC_ARG_WITH(
 		[ocean],
@@ -2378,6 +2594,4 @@
 		[OCEAN=no]
 	)
-	AC_MSG_CHECKING(for ice/ocean coupling capability compilation)
-
 	HAVE_OCEAN=no
 	if test "x${OCEAN}" == "xyes"; then
@@ -2389,4 +2603,5 @@
 	dnl }}}
 	dnl with-kml{{{
+	AC_MSG_CHECKING(for kml capability compilation)
 	AC_ARG_WITH(
 		[kml],
@@ -2395,6 +2610,4 @@
 		[KML=no]
 	)
-	AC_MSG_CHECKING(for kml capability compilation)
-
 	HAVE_KML=no
 	if test "x${KML}" == "xyes"; then
@@ -2406,4 +2619,5 @@
 	dnl }}}
 	dnl with-kriging{{{
+	AC_MSG_CHECKING(for kriging capability compilation)
 	AC_ARG_WITH(
 		[kriging],
@@ -2412,6 +2626,4 @@
 		[KRIGING=yes]
 	)
-	AC_MSG_CHECKING(for kriging capability compilation)
-
 	HAVE_KRIGING=no
 	if test "x${KRIGING}" == "xyes"; then
@@ -2428,4 +2640,5 @@
 	dnl Platform specifics
 	dnl with-ios{{{
+	AC_MSG_CHECKING(for iOS compilation)
 	AC_ARG_WITH(
 		[ios],
@@ -2434,6 +2647,4 @@
 		[IOS=no]
 	)
-	AC_MSG_CHECKING(for iOS compilation)
-
 	HAVE_IOS=no
 	if test "x${IOS}" == "xyes"; then
@@ -2445,11 +2656,11 @@
 	dnl }}}
 	dnl with-android{{{
+	AC_MSG_CHECKING([for Android capability compilation])
 	AC_ARG_WITH(
 		[android],
 		AS_HELP_STRING([--with-android=EXE], [compile with Android capabilities (default: "no"; alternatives: "exe", "jni")]),
 		[ANDROID=${withval}],
-		[ANDROID=no])
-	AC_MSG_CHECKING([for Android capability compilation])
-
+		[ANDROID=no]
+	)
 	if test "x${ANDROID}" == "xjni"; then
 		HAVE_ANDROID=jni
@@ -2470,4 +2681,5 @@
 	dnl }}}
 	dnl with-android-ndk{{{
+	AC_MSG_CHECKING([with Android Native Development Kit (NDK)])
 	AC_ARG_WITH(
 		[android-ndk],
@@ -2476,6 +2688,4 @@
 		[ANDROID_NDK_ROOT=""]
 	)
-	AC_MSG_CHECKING([with Android Native Development Kit (NDK)])
-
 	if test -d "${ANDROID_NDK_ROOT}"; then
 		HAVE_ANDROID_NDK=yes
@@ -2491,5 +2701,6 @@
 	dnl other options
 	dnl optimization{{{
-	dnl -- bypass standard optimization -g -O2 -fPIC -std=c++11?
+	dnl -- bypass standard optimization -g -O2 -fPIC?
+	AC_MSG_CHECKING(for C++ optimization flags)
 	AC_ARG_WITH(
 		[cxxoptflags],
@@ -2498,9 +2709,9 @@
 		[CXXOPTFLAGS="-g -O2 -fPIC -std=c++11"]
 	)
-	AC_MSG_CHECKING(for C++ optimization flags)
 	AC_SUBST([CXXOPTFLAGS])
-	AC_MSG_RESULT([done])
+	AC_MSG_RESULT([${CXXOPTFLAGS}])
 	dnl }}}
 	dnl multithreading{{{
+	AC_MSG_CHECKING(for number of threads)
 	AC_ARG_WITH(
 		[numthreads],
@@ -2509,5 +2720,4 @@
 		[NUMTHREADS_VALUE=1]
 	)
-	AC_MSG_CHECKING(for number of threads)
 	dnl Check that supplied value is an integer
 	if [[ "${NUMTHREADS_VALUE}" != "${NUMTHREADS_VALUE}" 2> /dev/null ]]; then
@@ -2524,18 +2734,25 @@
 				MULTITHREADINGLIB="-lpthread -lrt"
 			;;
+			*darwin*)
+				MULTITHREADINGLIB="-lpthread"
+			;;
 			*linux*)
 				MULTITHREADINGLIB="-lpthread -lrt"
 			;;
-			*darwin*)
-				MULTITHREADINGLIB="-lpthread"
+			*mingw*)
+				MULTITHREADINGLIB=""
+			;;
+			*msys*)
+				MULTITHREADINGLIB=""
 			;;
 		esac
 		AC_DEFINE([_MULTITHREADING_], [1], [with multithreading enabled])
 	fi
-	AC_DEFINE_UNQUOTED(_NUMTHREADS_, $NUMTHREADS_VALUE, [number of threads])
+	AC_DEFINE_UNQUOTED([_NUMTHREADS_], ${NUMTHREADS_VALUE}, [number of threads])
 	AC_SUBST([MULTITHREADINGLIB])
 	AC_MSG_RESULT([${NUMTHREADS_VALUE}])
 	dnl }}}
 	dnl 64-bit indices{{{
+	AC_MSG_CHECKING([for 64-bit indices])
 	AC_ARG_WITH(
 		[64bit-indices],
@@ -2544,6 +2761,4 @@
 		[USE_64BIT_INDICES=0]
 	)
-	AC_MSG_CHECKING([for 64-bit indices])
-
 	if test "x${USE_64BIT_INDICES}" == "x1"; then
 		AC_DEFINE([ISSM_USE_64BIT_INDICES], [1], [with 64-bit indices])
@@ -2555,5 +2770,5 @@
 
 	dnl Checks {{{
-	AC_MSG_CHECKING(consistency between all libraries)
+	AC_MSG_CHECKING(consistency between all external packages)
 
 	dnl Check that if PETSc is requested, MPI is specified
@@ -2585,5 +2800,5 @@
 
 	dnl Check that if we run ADOL-C, we don't compile kriging.exe
-	if test "x$HAVE_ADOLC" == "xyes" && test "${HAVE_KRIGING}" == "xyes"; then
+	if test "x${HAVE_ADOLC}" == "xyes" && test "${HAVE_KRIGING}" == "xyes"; then
 		AC_MSG_ERROR([cannot compile kriging.exe under ADOL-C conditions!]);
 	fi
Index: /issm/trunk/packagers/linux/complete-issm-linux-binaries-matlab.sh
===================================================================
--- /issm/trunk/packagers/linux/complete-issm-linux-binaries-matlab.sh	(revision 26744)
+++ /issm/trunk/packagers/linux/complete-issm-linux-binaries-matlab.sh	(revision 26744)
@@ -0,0 +1,94 @@
+#!/bin/bash
+
+################################################################################
+# Wrapper script to build, package, and transfer to ISSM Web site ISSM 
+# distributable package for Linux with MATLAB API.
+#
+# Normally, we would put this directly into the project configuration under 
+# 'Build' -> 'Excute shell', but becasue it is a bit more involved, it is a 
+# good idea to version it.
+#
+# When no failures/errors occur, performs the following:
+# - Builds ISSM according to configuration.
+# - Packages executables and libraries.
+# - Runs test suite against package.
+# - Transmits package to ISSM Web site for distribution.
+#
+# Options:
+# -b/--skipbuild		Skip ISSM compilation.
+# -s/--skiptests		Skip ISSM compilation and testing during packaging 
+#						step. Use if packaging fails for some reason but build 
+#						is valid.
+# -t/--transferonly		Transfer package to ISSM Web site only. Use if transfer 
+#						fails for some reason to skip building, packaging, and 
+#						signing.
+#
+# NOTE:
+# - Use only *one* of the above options at a time, and make sure it is removed 
+#	again after a single run.
+# - Builds will fail when any of the above options are used on a clean 
+#	workspace. For example, if 'Source Code Management' -> 'Check-out Strategy' 
+#	select menu is set to "Always check out a fresh copy".
+################################################################################
+
+## Constants
+#
+PKG="ISSM-Linux-MATLAB" # Name of directory to copy distributable files to
+
+COMPRESSED_PKG="${PKG}.tar.gz"
+
+## Environment
+#
+export COMPRESSED_PKG
+export PKG
+
+## Parse options
+#
+if [ $# -gt 1 ]; then
+	echo "Can use only one option at a time"
+	exit 1
+fi
+
+# NOTE: We could do this with binary switching (i.e. 0011 to sign and transfer, 
+#		but the following is self-documenting).
+#
+build=1
+package=1
+transfer=1
+
+if [ $# -eq 1 ]; then
+	case $1 in
+		-b|--skipbuild)		build=0;				shift	;;
+		-s|--skiptests)		build=0;						;;
+		-t|--transferonly)	build=0;	package=0;			;;
+		*) echo "Unknown parameter passed: $1"; exit 1 		;;
+	esac
+fi
+
+# Build
+if [ ${build} -eq 1 ]; then
+	./jenkins/jenkins.sh ./jenkins/ross-debian_linux-binaries-matlab
+
+	if [ $? -ne 0 ]; then 
+		exit 1
+	fi
+fi
+
+# Package
+if [ ${package} -eq 1 ]; then
+	./packagers/linux/package-issm-linux-binaries-matlab.sh $1
+
+	if [ $? -ne 0 ]; then 
+		exit 1
+	fi
+fi
+
+# Transfer distributable package to ISSM Web site
+if [ ${transfer} -eq 1 ]; then
+	./packagers/linux/transfer-issm-linux-binaries.sh
+
+	if [ $? -ne 0 ]; then 
+		exit 1
+	fi
+fi
+
Index: /issm/trunk/packagers/linux/complete-issm-linux-binaries-python.sh
===================================================================
--- /issm/trunk/packagers/linux/complete-issm-linux-binaries-python.sh	(revision 26744)
+++ /issm/trunk/packagers/linux/complete-issm-linux-binaries-python.sh	(revision 26744)
@@ -0,0 +1,94 @@
+#!/bin/bash
+
+################################################################################
+# Wrapper script to build, package, and transfer to ISSM Web site ISSM 
+# distributable package for Linux with Python API.
+#
+# Normally, we would put this directly into the project configuration under 
+# 'Build' -> 'Excute shell', but becasue it is a bit more involved, it is a 
+# good idea to version it.
+#
+# When no failures/errors occur, performs the following:
+# - Builds ISSM according to configuration.
+# - Packages executables and libraries.
+# - Runs test suite against package.
+# - Transmits package to ISSM Web site for distribution.
+#
+# Options:
+# -b/--skipbuild		Skip ISSM compilation.
+# -s/--skiptests		Skip ISSM compilation and testing during packaging 
+#						step. Use if packaging fails for some reason but build 
+#						is valid.
+# -t/--transferonly		Transfer package to ISSM Web site only. Use if transfer 
+#						fails for some reason to skip building, packaging, and 
+#						signing.
+#
+# NOTE:
+# - Use only *one* of the above options at a time, and make sure it is removed 
+#	again after a single run.
+# - Builds will fail when any of the above options are used on a clean 
+#	workspace. For example, if 'Source Code Management' -> 'Check-out Strategy' 
+#	select menu is set to "Always check out a fresh copy".
+################################################################################
+
+## Constants
+#
+PKG="ISSM-Linux-Python" # Name of directory to copy distributable files to
+
+COMPRESSED_PKG="${PKG}.tar.gz"
+
+## Environment
+#
+export COMPRESSED_PKG
+export PKG
+
+## Parse options
+#
+if [ $# -gt 1 ]; then
+	echo "Can use only one option at a time"
+	exit 1
+fi
+
+# NOTE: We could do this with binary switching (i.e. 0011 to sign and transfer, 
+#		but the following is self-documenting).
+#
+build=1
+package=1
+transfer=1
+
+if [ $# -eq 1 ]; then
+	case $1 in
+		-b|--skipbuild)		build=0;				shift	;;
+		-s|--skiptests)		build=0;						;;
+		-t|--transferonly)	build=0;	package=0;			;;
+		*) echo "Unknown parameter passed: $1"; exit 1 		;;
+	esac
+fi
+
+# Build
+if [ ${build} -eq 1 ]; then
+	./jenkins/jenkins.sh ./jenkins/ross-debian_linux-binaries-python
+
+	if [ $? -ne 0 ]; then 
+		exit 1
+	fi
+fi
+
+# Package
+if [ ${package} -eq 1 ]; then
+	./packagers/linux/package-issm-linux-binaries-python.sh $1
+
+	if [ $? -ne 0 ]; then 
+		exit 1
+	fi
+fi
+
+# Transfer distributable package to ISSM Web site
+if [ ${transfer} -eq 1 ]; then
+	./packagers/linux/transfer-issm-linux-binaries.sh
+
+	if [ $? -ne 0 ]; then 
+		exit 1
+	fi
+fi
+
Index: /issm/trunk/packagers/linux/package-issm-linux-binaries-matlab.sh
===================================================================
--- /issm/trunk/packagers/linux/package-issm-linux-binaries-matlab.sh	(revision 26743)
+++ /issm/trunk/packagers/linux/package-issm-linux-binaries-matlab.sh	(revision 26744)
@@ -2,21 +2,19 @@
 
 ################################################################################
-# To be used after running,
-#
-#	${ISSM_DIR}/jenkins/jenkins.sh ${ISSM_DIR}/jenkins/ross-debian_linux-binaries-matlab
-#
-# in the context of a Jenkins project.
-#
-# When no runtime errors occur, performs the following:
-# - Checks resulting executables and libraries against test suite.
-# - Packages and compresses executables and libraries.
-# - Transmits it to ISSM Web site for distribution.
+# Packages and tests ISSM distributable package for Linux with MATLAB API.
 #
 # Options:
-# -s/--skiptests		Skip tests (use if this script fails for some reason 
-#						after tests have successfully passed to save time)
-# -t/--transferonly		Transfer package to ISSM Web site only (use if 
-#						transfer fails for some reason to skip testing and
-#						signing)
+# -s/--skiptests		Skip testing during packaging Use if packaging fails 
+#						for some reason but build is valid.
+#
+# NOTE:
+# - Assumes that the following constants are defined,
+#
+#		COMPRESSED_PKG
+#		ISSM_DIR
+#		PKG
+#
+# See also:
+# - packagers/linux/complete-issm-linux-binaries-matlab.sh
 ################################################################################
 
@@ -32,9 +30,6 @@
 LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
 LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
-MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2002,2003,2005,2006,2010,2020,2021,2051,2052,2053,2101,2102,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2002,2003,2004,2006,2007,2008,2010,2011,2021,2051,2052,2053,2084,2085,2090,2101,2424,2425,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
 MATLAB_PATH="/usr/local/MATLAB/R2019b"
-PKG="ISSM-Linux-MATLAB" # Name of directory to copy distributable files to
-
-COMPRESSED_PKG="${PKG}.tar.gz"
 
 ## Environment
@@ -50,136 +45,121 @@
 
 skip_tests=0
-transfer_only=0
-while [ $# -gt 0 ]; do
-    case $1 in
-        -s|--skiptests) skip_tests=1; shift ;;
-        -t|--transferonly) transfer_only=1; shift ;;
-        *) echo "Unknown parameter passed: $1"; exit 1 ;;
-    esac
-    shift
-done
 
-if [ ${transfer_only} -eq 0 ]; then
-	# Check if MATLAB exists
-	if ! [ -d ${MATLAB_PATH} ]; then
-		echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
+if [ $# -eq 1 ]; then
+	case $1 in
+		-s|--skiptests) skip_tests=1;					;;
+		*) echo "Unknown parameter passed: $1"; exit 1	;;
+	esac
+fi
+
+# Check if MATLAB exists
+if ! [ -d ${MATLAB_PATH} ]; then
+	echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
+	exit 1
+fi
+
+# Clean up from previous packaging
+echo "Cleaning up existing assets"
+cd ${ISSM_DIR}
+rm -rf ${PKG} ${COMPRESSED_PKG}
+mkdir ${PKG}
+
+# Add required binaries and libraries to package and modify them where needed
+cd ${ISSM_DIR}/bin
+
+echo "Modify generic"
+cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
+
+echo "Moving MPICH binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
+	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
+	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
+elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
+	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
+	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
+else
+	echo "MPICH not found"
+	exit 1
+fi
+
+echo "Moving GDAL binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
+	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
+	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
+else
+	echo "GDAL not found"
+	exit 1
+fi
+
+echo "Moving GMT binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
+	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
+	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
+else
+	echo "GMT not found"
+	exit 1
+fi
+
+echo "Moving Gmsh binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
+	cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
+else
+	echo "Gmsh not found"
+	exit 1
+fi
+
+echo "Moving libgfortran to lib/"
+cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
+
+# Run tests
+if [ ${skip_tests} -eq 0 ]; then
+	echo "Running tests"
+	cd ${ISSM_DIR}/test/NightlyRun
+	rm matlab.log 2> /dev/null
+
+	# Run tests, redirecting output to logfile and suppressing output to console
+	${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+
+	# Check that MATLAB did not exit in error
+	matlabExitCode=`echo $?`
+	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run" matlab.log | wc -l`
+
+	if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+		echo "----------MATLAB exited in error!----------"
+		cat matlab.log
+		echo "-----------End of matlab.log-----------"
+
+		# Clean up execution directory
+		rm -rf ${ISSM_DIR}/execution/*
+
 		exit 1
 	fi
 
-	# Clean up from previous packaging
-	echo "Cleaning up existing assets"
-	cd ${ISSM_DIR}
-	rm -rf ${PKG} ${COMPRESSED_PKG}
-	mkdir ${PKG}
+	# Check that all tests passed
+	numTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
 
-	# Add/modify required binaries and libraries
-	cd ${ISSM_DIR}/bin
-
-	echo "Modify generic"
-	cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
-
-	echo "Moving MPICH binaries to bin/"
-	if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
-		cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
-		cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
-	elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
-		cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
-		cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
+	if [[ ${numTestsFailed} -ne 0 ]]; then
+		echo "One or more tests FAILED"
+		exit 1
 	else
-		echo "MPICH not found"
-		exit 1
+		echo "All tests PASSED"
 	fi
-
-	echo "Moving GDAL binaries to bin/"
-	if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
-		cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
-		cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
-	else
-		echo "GDAL not found"
-		exit 1
-	fi
-
-	echo "Moving GMT binaries to bin/"
-	if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
-		cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
-		cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
-	else
-		echo "GMT not found"
-		exit 1
-	fi
-
-	echo "Moving Gmsh binaries to bin/"
-	if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
-		cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
-	else
-		echo "Gmsh not found"
-		exit 1
-	fi
-
-	echo "Moving libgfortran to lib/"
-	cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
-
-
-	# Run tests
-	if [ ${skip_tests} -eq 0 ]; then
-		echo "Running tests"
-		cd ${ISSM_DIR}/test/NightlyRun
-		rm matlab.log 2> /dev/null
-
-		# Run tests, redirecting output to logfile and suppressing output to console
-		${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
-
-		# Check that MATLAB did not exit in error
-		matlabExitCode=`echo $?`
-		matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
-
-		if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
-			echo "----------MATLAB exited in error!----------"
-			cat matlab.log
-			echo "-----------End of matlab.log-----------"
-
-			# Clean up execution directory
-			rm -rf ${ISSM_DIR}/execution/*
-
-			exit 1
-		fi
-
-		# Check that all tests passed
-		numTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
-
-		if [[ ${numTestsFailed} -ne 0 ]]; then
-			echo "One or more tests FAILED"
-			exit 1
-		else
-			echo "All tests PASSED"
-		fi
-	else
-		echo "Skipping tests"
-	fi
-
-	# Create package
-	cd ${ISSM_DIR}
-	svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
-	echo "Copying assets to package: ${PKG}"
-	cp -rf bin examples lib scripts test ${PKG}/
-	mkdir ${PKG}/execution
-	echo "Cleaning up unneeded/unwanted files"
-	rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
-	rm -f ${PKG}/lib/*.a # Remove static libraries from package
-	rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
-	rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
-
-	# Compress package
-	echo "Compressing package"
-	tar -czf ${COMPRESSED_PKG} ${PKG}
-	ls -lah ${ISSM_DIR}/${COMPRESSED_PKG}
+else
+	echo "Skipping tests"
 fi
 
-# Transfer package to ISSM Web site
-echo "Transferring package to ISSM Web site"
-scp -i ~/.ssh/debian_linux-vm_to_ross ${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
+# Create package
+cd ${ISSM_DIR}
+svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+echo "Copying assets to package: ${PKG}"
+cp -rf bin examples lib scripts test ${PKG}
+mkdir ${PKG}/execution
+echo "Cleaning up unneeded/unwanted files"
+rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
+rm -f ${PKG}/lib/*.a # Remove static libraries from package
+rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
+rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
 
-if [ $? -ne 0 ]; then
-	echo "Transfer failed! Verify connection then build this project again."
-	exit 1
-fi
+# Compress package
+echo "Compressing package"
+tar -czf ${COMPRESSED_PKG} ${PKG}
Index: /issm/trunk/packagers/linux/package-issm-linux-binaries-python.sh
===================================================================
--- /issm/trunk/packagers/linux/package-issm-linux-binaries-python.sh	(revision 26743)
+++ /issm/trunk/packagers/linux/package-issm-linux-binaries-python.sh	(revision 26744)
@@ -2,21 +2,19 @@
 
 ################################################################################
-# To be used after running,
-#
-#	${ISSM_DIR}/jenkins/jenkins.sh ${ISSM_DIR}/jenkins/ross-debian_linux-binaries-matlab
-#
-# in the context of a Jenkins project.
-#
-# When no runtime errors occur, performs the following:
-# - Checks resulting executables and libraries against test suite.
-# - Packages and compresses executables and libraries.
-# - Transmits it to ISSM Web site for distribution.
+# Packages and tests ISSM distributable package for Linux with Python API.
 #
 # Options:
-# -s/--skiptests		Skip tests (use if this script fails for some reason 
-#						after tests have successfully passed to save time)
-# -t/--transferonly		Transfer package to ISSM Web site only (use if 
-#						transfer fails for some reason to skip testing and
-#						signing)
+# -s/--skiptests		Skip testing during packaging Use if packaging fails 
+#						for some reason but build is valid.
+#
+# NOTE:
+# - Assumes that the following constants are defined,
+#
+#		COMPRESSED_PKG
+#		ISSM_DIR
+#		PKG
+#
+# See also:
+# - packagers/linux/complete-issm-linux-binaries-python.sh
 ################################################################################
 
@@ -32,8 +30,5 @@
 LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
 LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
-PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2002 2003 2005 2006 2010 2020 2021 2051 2052 2053 2101 2102 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
-PKG="ISSM-Linux-Python" # Name of directory to copy distributable files to
-
-COMPRESSED_PKG="${PKG}.tar.gz"
+PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2002 2003 2004 2005 2006 2007 2008 2010 2011 2021 2051 2052 2053 2084 2085 2090 2101 2424 2425 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
 
 ## Environment
@@ -49,143 +44,123 @@
 
 skip_tests=0
-transfer_only=0
-while [ $# -gt 0 ]; do
-    case $1 in
-        -s|--skiptests) skip_tests=1; shift ;;
-        -t|--transferonly) transfer_only=1; shift ;;
-        *) echo "Unknown parameter passed: $1"; exit 1 ;;
-    esac
-    shift
-done
 
-if [ ${transfer_only} -eq 0 ]; then
-	# Check if MATLAB exists
-	if ! [ -d ${MATLAB_PATH} ]; then
-		echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
+if [ $# -eq 1 ]; then
+	case $1 in
+		-s|--skiptests) skip_tests=1;					;;
+		*) echo "Unknown parameter passed: $1"; exit 1	;;
+	esac
+fi
+
+# Clean up from previous packaging
+echo "Cleaning up existing assets"
+cd ${ISSM_DIR}
+rm -rf ${PKG} ${COMPRESSED_PKG}
+mkdir ${PKG}
+
+# Add required binaries and libraries to package and modify them where needed
+cd ${ISSM_DIR}/bin
+
+echo "Modify generic"
+cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py
+
+echo "Moving MPICH binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
+	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
+	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
+elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
+	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
+	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
+else
+	echo "MPICH not found"
+	exit 1
+fi
+
+echo "Moving GDAL binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
+	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
+	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
+else
+	echo "GDAL not found"
+	exit 1
+fi
+
+echo "Moving GMT binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
+	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
+	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
+else
+	echo "GMT not found"
+	exit 1
+fi
+
+echo "Moving Gmsh binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
+	cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
+else
+	echo "Gmsh not found"
+	exit 1
+fi
+
+echo "Moving libgfortran to lib/"
+cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
+
+
+# Run tests
+if [ ${skip_tests} -eq 0 ]; then
+	echo "Running tests"
+	cd ${ISSM_DIR}/test/NightlyRun
+	rm python.log 2> /dev/null
+
+	# Set Python environment
+	export PYTHONPATH="${ISSM_DIR}/src/m/dev"
+	export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+	export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
+
+	# Run tests, redirecting output to logfile and suppressing output to console
+	./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
+
+	# Check that Python did not exit in error
+	pythonExitCode=`echo $?`
+	pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python.log | wc -l`
+
+	if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
+		echo "----------Python exited in error!----------"
+		cat python.log
+		echo "-----------End of python.log-----------"
+
+		# Clean up execution directory
+		rm -rf ${ISSM_DIR}/execution/*
+
 		exit 1
 	fi
 
-	# Clean up from previous packaging
-	echo "Cleaning up existing assets"
-	cd ${ISSM_DIR}
-	rm -rf ${PKG} ${COMPRESSED_PKG}
-	mkdir ${PKG}
+	# Check that all tests passed
+	numTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
 
-	# Add/modify required binaries and libraries
-	cd ${ISSM_DIR}/bin
-
-	echo "Modify generic"
-	cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py
-
-	echo "Moving MPICH binaries to bin/"
-	if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
-		cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
-		cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
-	elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
-		cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
-		cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
+	if [[ ${numTestsFailed} -ne 0 ]]; then
+		echo "One or more tests FAILED"
+		exit 1
 	else
-		echo "MPICH not found"
-		exit 1
+		echo "All tests PASSED"
 	fi
-
-	echo "Moving GDAL binaries to bin/"
-	if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
-		cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
-		cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
-	else
-		echo "GDAL not found"
-		exit 1
-	fi
-
-	echo "Moving GMT binaries to bin/"
-	if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
-		cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
-		cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
-	else
-		echo "GMT not found"
-		exit 1
-	fi
-
-	echo "Moving Gmsh binaries to bin/"
-	if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
-		cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
-	else
-		echo "Gmsh not found"
-		exit 1
-	fi
-
-	echo "Moving libgfortran to lib/"
-	cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
-
-
-	# Run tests
-	if [ ${skip_tests} -eq 0 ]; then
-		echo "Running tests"
-		cd ${ISSM_DIR}/test/NightlyRun
-		rm python.log 2> /dev/null
-
-		# Set Python environment
-		export PYTHONPATH="${ISSM_DIR}/src/m/dev"
-		export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
-		export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
-
-		# Run tests, redirecting output to logfile and suppressing output to console
-		./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
-
-		# Check that Python did not exit in error
-		pythonExitCode=`echo $?`
-		pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python.log | wc -l`
-
-		if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
-			echo "----------Python exited in error!----------"
-			cat python.log
-			echo "-----------End of python.log-----------"
-
-			# Clean up execution directory
-			rm -rf ${ISSM_DIR}/execution/*
-
-			exit 1
-		fi
-
-		# Check that all tests passed
-		numTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
-
-		if [[ ${numTestsFailed} -ne 0 ]]; then
-			echo "One or more tests FAILED"
-			exit 1
-		else
-			echo "All tests PASSED"
-		fi
-	else
-		echo "Skipping tests"
-	fi
-
-	# Create package
-	cd ${ISSM_DIR}
-	svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
-	echo "Copying assets to package: ${PKG}"
-	cp -rf bin examples lib scripts test ${PKG}/
-	mkdir ${PKG}/execution
-	${ISSM_DIR}/scripts/py_to_pyc.sh ${PKG}/bin # Compile Python source files
-	echo "Cleaning up unneeded/unwanted files"
-	rm -f ${PKG}/bin/*.py # Remove all Python scripts
-	rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
-	rm -f ${PKG}/lib/*.a # Remove static libraries from package
-	rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
-	rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
-
-	# Compress package
-	echo "Compressing package"
-	tar -czf ${COMPRESSED_PKG} ${PKG}
-	ls -lah ${ISSM_DIR}/${COMPRESSED_PKG}
+else
+	echo "Skipping tests"
 fi
 
-# Transfer package to ISSM Web site
-echo "Transferring package to ISSM Web site"
-scp -i ~/.ssh/debian_linux-vm_to_ross ${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
+# Create package
+cd ${ISSM_DIR}
+svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+echo "Copying assets to package: ${PKG}"
+cp -rf bin examples lib scripts test ${PKG}
+mkdir ${PKG}/execution
+${ISSM_DIR}/scripts/py_to_pyc.sh ${PKG}/bin # Compile Python source files
+echo "Cleaning up unneeded/unwanted files"
+rm -f ${PKG}/bin/*.py # Remove all Python scripts
+rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
+rm -f ${PKG}/lib/*.a # Remove static libraries from package
+rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
+rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
 
-if [ $? -ne 0 ]; then
-	echo "Transfer failed! Verify connection then build this project again."
-	exit 1
-fi
+# Compress package
+echo "Compressing package"
+tar -czf ${COMPRESSED_PKG} ${PKG}
Index: sm/trunk/packagers/linux/package-issm-linux-binaries-solid_earth.sh
===================================================================
--- /issm/trunk/packagers/linux/package-issm-linux-binaries-solid_earth.sh	(revision 26743)
+++ 	(revision )
@@ -1,181 +1,0 @@
-#!/bin/bash
-
-
-# Script to test, package, and transfer distributable to ISSM Web site.
-# Corresponds with build generated by configuration in 
-# $ISSM_DIR/jenkins/ross-debian_linux-binaries-solid_earth.
-#
-
-## Constants
-#
-LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
-LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
-MATLAB_NROPTIONS="'benchmark','slr','exclude',[2002 2003 2010 2020 2021 2101]"
-MATLAB_PATH="/usr/local/MATLAB/R2019b"
-PACKAGE="ISSM-Solid_Earth" # Name of directory to copy distributable files to
-PYTHON_NROPTIONS="--benchmark slr --exclude 2002 2003 2010 2020 2021 2101"
-TARBALL_NAME="issm-linux-solid_earth"
-TARBALL="${TARBALL_NAME}.tar.gz"
-
-## Environment
-#
-export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
-
-# Check if MATLAB exists
-if ! [ -d ${MATLAB_PATH} ]; then
-	echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
-	exit 1
-fi
-
-# Clean up from previous packaging
-echo "Cleaning up existing assets"
-cd ${ISSM_DIR}
-rm -rf ${PACKAGE}
-mkdir ${PACKAGE}
-
-# Add/modify required binaries
-cd ${ISSM_DIR}/bin
-
-echo "Modifying generic"
-cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
-cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py
-
-echo "Moving MPICH binaries to bin/"
-if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
-	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
-	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
-elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
-	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
-	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
-else
-	echo "MPICH not found"
-	exit 1
-fi
-
-echo "Moving GDAL binaries to bin/"
-if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
-	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
-	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
-else
-	echo "GDAL not found"
-	exit 1
-fi
-
-echo "Moving GMT binaries to bin/"
-if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
-	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
-	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
-else
-	echo "GMT not found"
-	exit 1
-fi
-
-echo "Moving Gmsh binaries to bin/"
-if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
-	cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
-else
-	echo "Gmsh not found"
-	exit 1
-fi
-
-# Add/modify required libraries
-echo "Moving libgfortran to lib/"
-cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
-
-# Run tests
-echo "Running tests"
-cd ${ISSM_DIR}/test/NightlyRun
-
-# Check that MATLAB tests run
-echo "Running MATLAB tests"
-
-rm matlab.log 2> /dev/null
-
-# Run MATLAB tests redirecting output to logfile and suppressing output to console
-${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
-
-# Check that MATLAB did not exit in error
-matlabExitCode=`echo $?`
-matlabExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" matlab.log | wc -l`
-
-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
-	echo "----------MATLAB exited in error!----------"
-	cat matlab.log
-	echo "-----------End of matlab.log-----------"
-
-	# Clean up execution directory
-	rm -rf ${ISSM_DIR}/execution/*
-
-	exit 1
-fi
-
-# Check that all MATLAB tests passed
-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
-
-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
-	echo "One or more MATLAB tests FAILED"
-	exit 1;
-else
-	echo "All MATLAB tests PASSED"
-fi
-
-# Check that Python tests run
-echo "Running Python tests"
-
-export PATH="${PATH}:${ISSM_DIR}/bin"
-export PYTHONPATH="${ISSM_DIR}/src/m/dev"
-export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
-export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
-
-rm python.log 2> /dev/null
-./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
-
-# Check that Python did not exit in error
-pythonExitCode=`echo $?`
-pythonExitedInError=`grep -E "Error|Traceback|bad interpreter" python.log | wc -l`
-
-if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
-	echo "----------Python exited in error!----------"
-	cat python.log
-	echo "-----------End of python.log-----------"
-
-	# Clean up execution directory
-	rm -rf ${ISSM_DIR}/execution/*
-
-	exit 1
-fi
-
-# Check that all Python tests passed
-numPythonTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
-
-if [[ ${numPythonTestsFailed} -ne 0 ]]; then
-	echo "One or more Python tests FAILED"
-	exit 1
-else
-	echo "All Python tests PASSED"
-fi
-
-# Create tarball
-cd ${ISSM_DIR}
-rm -f ${TARBALL}
-svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
-echo "Copying assets to package: ${PACKAGE}"
-cp -rf bin examples lib scripts test ${PACKAGE}/
-echo "Cleaning up unneeded/unwanted files"
-python -m compileall ${PACKAGE}/bin # Precompile all Python scripts to bytecode
-rm -f ${PACKAGE}/bin/*.py # Remove all Python scripts
-rm -f ${PACKAGE}/bin/generic_static.* # Remove static versions of generic cluster classes
-rm -f ${PACKAGE}/lib/*.a # Remove static libraries from package
-rm -f ${PACKAGE}/lib/*.la # Remove libtool libraries from package
-rm -rf ${PACKAGE}/test/SandBox # Remove testing sandbox from package
-echo "Creating tarball: ${TARBALL_NAME}"
-tar -czf ${TARBALL} ${PACKAGE}
-ls -lah ${ISSM_DIR}/${TARBALL}
-
-echo "Transferring binaries to ISSM Web site"
-scp -i ~/.ssh/debian_linux-vm_to_ross ${TARBALL} jenkins@ross.ics.uci.edu:/var/www/html/${TARBALL}
-
-if [ $? -ne 0 ]; then
-	echo "FAILED: Manually check connection"
-	exit 1
-fi
Index: sm/trunk/packagers/linux/package-issm-linux-binaries-with_dakota.sh
===================================================================
--- /issm/trunk/packagers/linux/package-issm-linux-binaries-with_dakota.sh	(revision 26743)
+++ 	(revision )
@@ -1,155 +1,0 @@
-#!/bin/bash
-
-
-# Script to test, package, and transfer distributable to ISSM Web site.
-# Corresponds with build generated by configuration in 
-# $ISSM_DIR/jenkins/ross-debian_linux-binaries-with_dakota.
-#
-
-## Constants
-#
-LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
-LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
-MATLAB_NROPTIONS="'id',[IdFromString('Dakota')]"
-MATLAB_PATH="/usr/local/MATLAB/R2019b"
-PACKAGE="ISSM" # Name of directory to copy distributable files to
-PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 418 420"
-TARBALL_NAME="issm-linux-with_dakota"
-TARBALL="${TARBALL_NAME}.tar.gz"
-
-## Environment
-#
-export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
-
-# Check if MATLAB exists
-if ! [ -d ${MATLAB_PATH} ]; then
-	echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
-	exit 1
-fi
-
-# Clean up from previous packaging
-echo "Cleaning up existing assets"
-cd ${ISSM_DIR}
-rm -rf ${PACKAGE}
-mkdir ${PACKAGE}
-
-# Add/modify required binaries
-cd ${ISSM_DIR}/bin
-
-echo "Modifying generic"
-cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
-cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py
-
-echo "Moving MPICH binaries to bin/"
-if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
-	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
-	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
-elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
-	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
-	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
-else
-	echo "MPICH not found"
-	exit 1
-fi
-
-# Add/modify required libraries
-echo "Moving libgfortran to lib/"
-cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
-
-# Run tests
-echo "Running tests"
-cd ${ISSM_DIR}/test/NightlyRun
-
-# Check that MATLAB tests run
-echo "Running MATLAB tests"
-
-rm matlab.log 2> /dev/null
-
-# Run MATLAB tests redirecting output to logfile and suppressing output to console
-${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
-
-# Check that MATLAB did not exit in error
-matlabExitCode=`echo $?`
-matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
-
-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
-	echo "----------MATLAB exited in error!----------"
-	cat matlab.log
-	echo "-----------End of matlab.log-----------"
-
-	# Clean up execution directory
-	rm -rf ${ISSM_DIR}/execution/*
-
-	exit 1
-fi
-
-# Check that all MATLAB tests passed
-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
-
-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
-	echo "One or more MATLAB tests FAILED"
-	exit 1;
-else
-	echo "All MATLAB tests PASSED"
-fi
-
-# Check that Python tests run
-echo "Running Python tests"
-
-export PATH="${PATH}:${ISSM_DIR}/bin"
-export PYTHONPATH="${ISSM_DIR}/src/m/dev"
-export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
-export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
-
-rm python.log 2> /dev/null
-./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
-
-# Check that Python did not exit in error
-pythonExitCode=`echo $?`
-pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python.log | wc -l`
-
-if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
-	echo "----------Python exited in error!----------"
-	cat python.log
-	echo "-----------End of python.log-----------"
-
-	# Clean up execution directory
-	rm -rf ${ISSM_DIR}/execution/*
-
-	exit 1
-fi
-
-# Check that all Python tests passed
-numPythonTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
-
-if [[ ${numPythonTestsFailed} -ne 0 ]]; then
-	echo "One or more Python tests FAILED"
-	exit 1
-else
-	echo "All Python tests PASSED"
-fi
-
-# Create tarball
-cd ${ISSM_DIR}
-rm -f ${TARBALL}
-svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
-echo "Copying assets to package: ${PACKAGE}"
-cp -rf bin examples lib scripts test ${PACKAGE}/
-echo "Cleaning up unneeded/unwanted files"
-python -m compileall ${PACKAGE}/bin # Precompile all Python scripts to bytecode
-rm -f ${PACKAGE}/bin/*.py # Remove all Python scripts
-rm -f ${PACKAGE}/bin/generic_static.* # Remove static versions of generic cluster classes
-rm -f ${PACKAGE}/lib/*.a # Remove static libraries from package
-rm -f ${PACKAGE}/lib/*.la # Remove libtool libraries from package
-rm -rf ${PACKAGE}/test/SandBox # Remove testing sandbox from package
-echo "Creating tarball: ${TARBALL_NAME}"
-tar -czf ${TARBALL} ${PACKAGE}
-ls -lah ${ISSM_DIR}/${TARBALL}
-
-echo "Transferring binaries to ISSM Web site"
-scp -i ~/.ssh/debian_linux-vm_to_ross ${TARBALL} jenkins@ross.ics.uci.edu:/var/www/html/${TARBALL}
-
-if [ $? -ne 0 ]; then
-	echo "FAILED: Manually check connection"
-	exit 1
-fi
Index: sm/trunk/packagers/linux/package-issm-linux-binaries.sh
===================================================================
--- /issm/trunk/packagers/linux/package-issm-linux-binaries.sh	(revision 26743)
+++ 	(revision )
@@ -1,114 +1,0 @@
-#!/bin/bash
-
-
-# Script to test, package, and transfer distributable to ISSM Web site.
-# Corresponds with build generated by configuration in 
-# $ISSM_DIR/jenkins/ross-debian_linux-binaries.
-#
-
-## Constants
-#
-LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
-LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
-MATLAB_PATH="/usr/local/MATLAB/R2019b"
-PACKAGE="ISSM" # Name of directory to copy distributable files to
-TARBALL_NAME="issm-linux"
-TARBALL="${TARBALL_NAME}.tar.gz"
-
-## Environment
-#
-export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
-
-# Check if MATLAB exists
-if ! [ -d ${MATLAB_PATH} ]; then
-	echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
-	exit 1
-fi
-
-# Clean up from previous packaging
-echo "Cleaning up existing assets"
-cd ${ISSM_DIR}
-rm -rf ${PACKAGE}
-mkdir ${PACKAGE}
-
-# Add/modify required binaries and libraries
-cd ${ISSM_DIR}/bin
-
-echo "Modify generic"
-cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
-
-echo "Moving MPICH binaries to bin/"
-if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
-	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
-	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
-elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
-	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
-	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
-else
-	echo "MPICH not found"
-	exit 1
-fi
-
-echo "Moving libgfortran to lib/"
-cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
-
-# Run tests
-echo "Running tests"
-cd ${ISSM_DIR}/test/NightlyRun
-
-# Check that MATLAB tests run
-echo "Running MATLAB tests"
-
-rm matlab.log 2> /dev/null
-
-# Run MATLAB tests redirecting output to logfile and suppressing output to console
-${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
-
-# Check that MATLAB did not exit in error
-matlabExitCode=`echo $?`
-matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
-
-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
-	echo "----------MATLAB exited in error!----------"
-	cat matlab.log
-	echo "-----------End of matlab.log-----------"
-
-	# Clean up execution directory
-	rm -rf ${ISSM_DIR}/execution/*
-
-	exit 1
-fi
-
-# Check that all MATLAB tests passed
-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
-
-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
-	echo "One or more MATLAB tests FAILED"
-	exit 1
-else
-	echo "All MATLAB tests PASSED"
-fi
-
-# Create tarball
-cd ${ISSM_DIR}
-rm -f ${TARBALL}
-svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
-echo "Copying assets to package: ${PACKAGE}"
-cp -rf bin examples lib scripts test ${PACKAGE}/
-echo "Cleaning up unneeded/unwanted files"
-rm -f ${PACKAGE}/bin/generic_static.* # Remove static versions of generic cluster classes
-rm -f ${PACKAGE}/lib/*.a # Remove static libraries from package
-rm -f ${PACKAGE}/lib/*.la # Remove libtool libraries from package
-rm -rf ${PACKAGE}/test/SandBox # Remove testing sandbox from package
-echo "Creating tarball: ${TARBALL_NAME}"
-tar -czf ${TARBALL} ${PACKAGE}
-ls -lah ${ISSM_DIR}/${TARBALL}
-
-echo "Transferring binaries to ISSM Web site"
-scp -i ~/.ssh/debian_linux-vm_to_ross ${TARBALL} jenkins@ross.ics.uci.edu:/var/www/html/${TARBALL}
-
-if [ $? -ne 0 ]; then
-	echo "FAILED: Manually check connection"
-	exit 1
-fi
Index: /issm/trunk/packagers/linux/transfer-issm-linux-binaries.sh
===================================================================
--- /issm/trunk/packagers/linux/transfer-issm-linux-binaries.sh	(revision 26744)
+++ /issm/trunk/packagers/linux/transfer-issm-linux-binaries.sh	(revision 26744)
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+################################################################################
+# Transfers ISSM distributable package for Linux with MATLAB API to ISSM Web 
+# site.
+#
+# NOTE:
+# - Assumes that the following constants are defined,
+#
+#		COMPRESSED_PKG
+#
+# See also:
+# - packagers/linux/complete-issm-linux-binaries-matlab.sh
+# - packagers/linux/complete-issm-linux-binaries-python.sh
+################################################################################
+
+# Transfer package to ISSM Web site
+echo "Transferring package to ISSM Web site"
+scp -i ~/.ssh/debian_linux-vm_to_ross ${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
+
+if [ $? -ne 0 ]; then
+	echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip building and packaging)."
+	exit 1
+fi
Index: /issm/trunk/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh
===================================================================
--- /issm/trunk/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh	(revision 26744)
+++ /issm/trunk/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh	(revision 26744)
@@ -0,0 +1,243 @@
+#!/bin/bash
+
+################################################################################
+# Commits ISSM distributable package for macOS with MATLAB API to repository 
+# for signing. This repository is polled by a project running on a JPL 
+# Cybersecurity Jenkins server and performs the actual signing and 
+# notarization.
+#
+# Options:
+# -r/--resign			Skip ISSM compilation and packaging. Use to retrigger 
+#						signing/notarization if it fails but build and package 
+#						are valid.
+# -u/--unlock			Remove lock file from signed package repository. Use if 
+#						build is aborted to allow for subsequent fresh build.
+#
+# NOTE:
+# - Assumes that the following constants are defined,
+#
+#		COMPRESSED_PKG
+#		ISSM_BINARIES_REPO_PASS
+#		ISSM_BINARIES_REPO_USER
+#		SIGNED_REPO_COPY
+#		SIGNED_REPO_URL
+#
+# See also:
+# - packagers/mac/complete-issm-mac-binaries-matlab.sh
+# - packagers/mac/sign-issm-mac-binaries-matlab.sh
+#
+# TODO:
+# - Generalize checkout_*_repo_copy and validate_*_repo_copy functions (e.g. 
+#	pass 'signed' or 'unsigned' as argument)
+################################################################################
+
+# Expand aliases within the context of this script
+shopt -s expand_aliases
+
+# From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
+#
+#	Command line tool support for Subversion — including svn, git-svn, and 
+#	related commands — is no longer provided by Xcode. (50266910)
+#
+# which results in,
+#
+#	svn: error: The subversion command line tools are no longer provided by 
+#	Xcode.
+#
+# when calling svn, even when subversion is installed via Homebrew and its path 
+# is available in PATH.
+#
+# NOTE: May be able to remove this after updating macOS.
+#
+alias svn='/usr/local/bin/svn'
+
+## Override certain other aliases
+#
+alias cp=$(which cp)
+alias grep=$(which grep)
+
+## Constants
+#
+MAX_SIGNING_CHECK_ATTEMPTS=30
+NOTARIZATION_LOGFILE="notarization.log"
+RETRIGGER_SIGNING_FILE="retrigger.txt"
+SIGNING_CHECK_PERIOD=60 # in seconds
+SIGNING_LOCK_FILE="signing.lock"
+UNSIGNED_REPO_COPY="./unsigned"
+UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned"
+
+## Functions
+#
+checkout_signed_repo_copy(){
+	echo "Checking out copy of repository for signed packages"
+
+	# NOTE: Get empty copy because we do not want to have to check out package 
+	#		from previous signing.
+	#
+	svn checkout \
+		--trust-server-cert \
+		--non-interactive \
+		--depth empty \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_PASS} \
+		${SIGNED_REPO_URL} \
+		${SIGNED_REPO_COPY} > /dev/null 2>&1
+}
+checkout_unsigned_repo_copy(){
+	echo "Checking out copy of repository for unsigned packages"
+	svn checkout \
+		--trust-server-cert \
+		--non-interactive \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_PASS} \
+		${UNSIGNED_REPO_URL} \
+		${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+}
+validate_signed_repo_copy(){
+	# Validate copy of repository for signed binaries (e.g. 
+	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
+	# initial checkout failed)
+	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
+		rm -rf ${SIGNED_REPO_COPY}
+		checkout_signed_repo_copy
+	fi
+}
+validate_unsigned_repo_copy(){
+	# Validate copy of repository for unsigned binaries (e.g. 
+	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
+	# initial checkout failed)
+	if [[ ! -d ${UNSIGNED_REPO_COPY} || ! -d ${UNSIGNED_REPO_COPY}/.svn ]]; then
+		rm -rf ${UNSIGNED_REPO_COPY}
+		checkout_unsigned_repo_copy
+	fi
+}
+
+## Parse options
+#
+if [ $# -gt 1 ]; then
+	echo "Can use only one option at a time"
+	exit 1
+fi
+
+retrigger_signing=0
+unlock=0
+
+if [ $# -eq 1 ]; then
+	case $1 in
+		-r|--resign)	retrigger_signing=1;	;;
+		-u|--unlock)	unlock=1;				;;
+		*) echo "Unknown parameter passed: $1"; exit 1	;;
+	esac
+fi
+
+validate_signed_repo_copy
+
+if [ ${unlock} -eq 1 ]; then
+	# Remove signing lock file from signed package repository so that a new 
+	# build can run
+	echo "Removing lock file from repository for signed packages"
+	svn update \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_PASS} \
+		${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+	svn commit \
+		--trust-server-cert \
+		--non-interactive \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_PASS} \
+		--message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+	svn cleanup ${SIGNED_REPO_COPY} > /dev/null 2>&1
+
+	echo "Remove -u/--unlock option from configuration and run again"
+	exit 1
+fi
+
+# If lock file exists, a signing build is still in process by JPL Cybersecurity
+svn update \
+	--username ${ISSM_BINARIES_REPO_USER} \
+	--password ${ISSM_BINARIES_REPO_PASS} \
+	${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+
+if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+	echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
+	exit 1
+fi
+
+# Commit lock file to repository for signed packages
+echo "Committing lock file to repository for signed packages"
+touch ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+svn commit \
+	--trust-server-cert \
+	--non-interactive \
+	--username ${ISSM_BINARIES_REPO_USER} \
+	--password ${ISSM_BINARIES_REPO_PASS} \
+	--message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+
+# Check out copy of repository for unsigned packages
+validate_unsigned_repo_copy
+
+if [ ${retrigger_signing} -eq 0 ]; then
+	# Commit new compressed package to repository for unsigned binaries
+	echo "Committing package to repository for unsigned packages"
+	cp ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
+	svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
+	svn commit \
+		--trust-server-cert \
+		--non-interactive \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_PASS} \
+		--message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+else
+	# NOTE: If notarize_only == 1, we commit a dummy file as we do not want to 
+	#		have to commit the entire compressed package again simply to 
+	#		retrigger the signing build on the remote JPL Cybersecurity Jenkins 
+	#		server.
+	#
+	echo "Attempting to sign existing package again"
+	echo $(date +'%Y-%m-%d-%H-%M-%S') > ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} # Write datetime stamp to file to ensure modification is made
+	svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
+	svn commit \
+		--trust-server-cert \
+		--non-interactive \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_PASS} \
+		--message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+fi
+
+# Check status of signing
+echo "Checking progress of signing..."
+SIGNING_CHECK_ATTEMPT=0
+while [ ${SIGNING_CHECK_ATTEMPT} -lt ${MAX_SIGNING_CHECK_ATTEMPTS} ]; do
+	echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
+	sleep ${SIGNING_CHECK_PERIOD}
+	svn update \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_PASS} \
+		${SIGNED_REPO_COPY} > /dev/null 2>&1
+
+	if [ ! -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+		# Retrieve notarization lock file
+		svn update \
+			--username ${ISSM_BINARIES_REPO_USER} \
+			--password ${ISSM_BINARIES_REPO_PASS} \
+			${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
+
+		# Check status
+		STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
+		if [[ "${STATUS}" == "success" ]]; then
+			echo "Notarization successful!"
+			break
+		else
+			echo "Notarization failed!"
+			echo "----------------------- Contents of notarization logfile -----------------------"
+			cat ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
+			echo "--------------------------------------------------------------------------------"
+
+			exit 1
+		fi
+	else
+		((++SIGNING_CHECK_ATTEMPT))
+	fi
+done
Index: /issm/trunk/packagers/mac/commit_for_signing-issm-mac-binaries-python.sh
===================================================================
--- /issm/trunk/packagers/mac/commit_for_signing-issm-mac-binaries-python.sh	(revision 26744)
+++ /issm/trunk/packagers/mac/commit_for_signing-issm-mac-binaries-python.sh	(revision 26744)
@@ -0,0 +1,243 @@
+#!/bin/bash
+
+################################################################################
+# Commits ISSM distributable package for macOS with Python API to repository 
+# for signing. This repository is polled by a project running on a JPL 
+# Cybersecurity Jenkins server and performs the actual signing and 
+# notarization.
+#
+# Options:
+# -r/--resign			Skip ISSM compilation and packaging. Use to retrigger 
+#						signing/notarization if it fails but build and package 
+#						are valid.
+# -u/--unlock			Remove lock file from signed package repository. Use if 
+#						build is aborted to allow for subsequent fresh build.
+#
+# NOTE:
+# - Assumes that the following constants are defined,
+#
+#		COMPRESSED_PKG
+#		ISSM_BINARIES_REPO_PASS
+#		ISSM_BINARIES_REPO_USER
+#		SIGNED_REPO_COPY
+#		SIGNED_REPO_URL
+#
+# See also:
+# - packagers/mac/complete-issm-mac-binaries-python.sh
+# - packagers/mac/sign-issm-mac-binaries-python.sh
+#
+# TODO:
+# - Generalize checkout_*_repo_copy and validate_*_repo_copy functions (e.g. 
+#	pass 'signed' or 'unsigned' as argument)
+################################################################################
+
+# Expand aliases within the context of this script
+shopt -s expand_aliases
+
+# From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
+#
+#	Command line tool support for Subversion — including svn, git-svn, and 
+#	related commands — is no longer provided by Xcode. (50266910)
+#
+# which results in,
+#
+#	svn: error: The subversion command line tools are no longer provided by 
+#	Xcode.
+#
+# when calling svn, even when subversion is installed via Homebrew and its path 
+# is available in PATH.
+#
+# NOTE: May be able to remove this after updating macOS.
+#
+alias svn='/usr/local/bin/svn'
+
+## Override certain other aliases
+#
+alias cp=$(which cp)
+alias grep=$(which grep)
+
+## Constants
+#
+MAX_SIGNING_CHECK_ATTEMPTS=30
+NOTARIZATION_LOGFILE="notarization.log"
+RETRIGGER_SIGNING_FILE="retrigger.txt"
+SIGNING_CHECK_PERIOD=60 # in seconds
+SIGNING_LOCK_FILE="signing.lock"
+UNSIGNED_REPO_COPY="./unsigned"
+UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/unsigned"
+
+## Functions
+#
+checkout_signed_repo_copy(){
+	echo "Checking out copy of repository for signed packages"
+
+	# NOTE: Get empty copy because we do not want to have to check out package 
+	#		from previous signing.
+	#
+	svn checkout \
+		--trust-server-cert \
+		--non-interactive \
+		--depth empty \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_PASS} \
+		${SIGNED_REPO_URL} \
+		${SIGNED_REPO_COPY} > /dev/null 2>&1
+}
+checkout_unsigned_repo_copy(){
+	echo "Checking out copy of repository for unsigned packages"
+	svn checkout \
+		--trust-server-cert \
+		--non-interactive \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_PASS} \
+		${UNSIGNED_REPO_URL} \
+		${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+}
+validate_signed_repo_copy(){
+	# Validate copy of repository for signed binaries (e.g. 
+	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
+	# initial checkout failed)
+	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
+		rm -rf ${SIGNED_REPO_COPY}
+		checkout_signed_repo_copy
+	fi
+}
+validate_unsigned_repo_copy(){
+	# Validate copy of repository for unsigned binaries (e.g. 
+	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
+	# initial checkout failed)
+	if [[ ! -d ${UNSIGNED_REPO_COPY} || ! -d ${UNSIGNED_REPO_COPY}/.svn ]]; then
+		rm -rf ${UNSIGNED_REPO_COPY}
+		checkout_unsigned_repo_copy
+	fi
+}
+
+## Parse options
+#
+if [ $# -gt 1 ]; then
+	echo "Can use only one option at a time"
+	exit 1
+fi
+
+retrigger_signing=0
+unlock=0
+
+if [ $# -eq 1 ]; then
+	case $1 in
+		-r|--resign)	retrigger_signing=1;	;;
+		-u|--unlock)	unlock=1;				;;
+		*) echo "Unknown parameter passed: $1"; exit 1	;;
+	esac
+fi
+
+validate_signed_repo_copy
+
+if [ ${unlock} -eq 1 ]; then
+	# Remove signing lock file from signed package repository so that a new 
+	# build can run
+	echo "Removing lock file from repository for signed packages"
+	svn update \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_PASS} \
+		${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+	svn commit \
+		--trust-server-cert \
+		--non-interactive \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_PASS} \
+		--message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+	svn cleanup ${SIGNED_REPO_COPY} > /dev/null 2>&1
+
+	echo "Remove -u/--unlock option from configuration and run again"
+	exit 1
+fi
+
+# If lock file exists, a signing build is still in process by JPL Cybersecurity
+svn update \
+	--username ${ISSM_BINARIES_REPO_USER} \
+	--password ${ISSM_BINARIES_REPO_PASS} \
+	${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+
+if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+	echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
+	exit 1
+fi
+
+# Commit lock file to repository for signed packages
+echo "Committing lock file to repository for signed packages"
+touch ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+svn commit \
+	--trust-server-cert \
+	--non-interactive \
+	--username ${ISSM_BINARIES_REPO_USER} \
+	--password ${ISSM_BINARIES_REPO_PASS} \
+	--message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+
+# Check out copy of repository for unsigned packages
+validate_unsigned_repo_copy
+
+if [ ${retrigger_signing} -eq 0 ]; then
+	# Commit new compressed package to repository for unsigned binaries
+	echo "Committing package to repository for unsigned packages"
+	cp ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
+	svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
+	svn commit \
+		--trust-server-cert \
+		--non-interactive \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_PASS} \
+		--message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+else
+	# NOTE: If notarize_only == 1, we commit a dummy file as we do not want to 
+	#		have to commit the entire compressed package again simply to 
+	#		retrigger the signing build on the remote JPL Cybersecurity Jenkins 
+	#		server.
+	#
+	echo "Attempting to sign existing package again"
+	echo $(date +'%Y-%m-%d-%H-%M-%S') > ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} # Write datetime stamp to file to ensure modification is made
+	svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
+	svn commit \
+		--trust-server-cert \
+		--non-interactive \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_PASS} \
+		--message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+fi
+
+# Check status of signing
+echo "Checking progress of signing..."
+SIGNING_CHECK_ATTEMPT=0
+while [ ${SIGNING_CHECK_ATTEMPT} -lt ${MAX_SIGNING_CHECK_ATTEMPTS} ]; do
+	echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
+	sleep ${SIGNING_CHECK_PERIOD}
+	svn update \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_PASS} \
+		${SIGNED_REPO_COPY} > /dev/null 2>&1
+
+	if [ ! -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+		# Retrieve notarization lock file
+		svn update \
+			--username ${ISSM_BINARIES_REPO_USER} \
+			--password ${ISSM_BINARIES_REPO_PASS} \
+			${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
+
+		# Check status
+		STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
+		if [[ "${STATUS}" == "success" ]]; then
+			echo "Notarization successful!"
+			break
+		else
+			echo "Notarization failed!"
+			echo "----------------------- Contents of notarization logfile -----------------------"
+			cat ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
+			echo "--------------------------------------------------------------------------------"
+
+			exit 1
+		fi
+	else
+		((++SIGNING_CHECK_ATTEMPT))
+	fi
+done
Index: /issm/trunk/packagers/mac/complete-issm-mac-binaries-matlab.sh
===================================================================
--- /issm/trunk/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 26744)
+++ /issm/trunk/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 26744)
@@ -0,0 +1,133 @@
+#!/bin/bash
+
+################################################################################
+# Wrapper script to build, package, send for signing, and transfer to ISSM Web 
+# site ISSM distributable package for macOS with MATLAB API.
+#
+# Normally, we would put this directly into the project configuration under 
+# 'Build' -> 'Excute shell', but becasue it is a bit more involved, it is a 
+# good idea to version it.
+#
+# When no failures/errors occur, performs the following:
+# - Builds ISSM according to configuration.
+# - Packages executables and libraries.
+# - Runs test suite against package.
+# - Commits compressed package to repository to be signed by JPL Cybersecurity.
+# - Retrieves signed package and transmits it to ISSM Web site for 
+#	distribution.
+#
+# Options:
+# -b/--skipbuild		Skip ISSM compilation.
+# -r/--resign			Skip ISSM compilation and packaging. Use to retrigger 
+#						signing/notarization if it fails but build and package 
+#						are valid.
+# -s/--skiptests		Skip ISSM compilation and testing during packaging 
+#						step. Use if packaging fails for some reason but build 
+#						is valid.
+# -t/--transferonly		Transfer package to ISSM Web site only. Use if transfer 
+#						fails for some reason to skip building, packaging, and 
+#						signing.
+# -u/--unlock			Remove lock file from signed package repository. Use if 
+#						build is aborted to allow for subsequent fresh build.
+#
+# Debugging:
+# - Relies on a very tight handshake with project on remote JPL Cybersecurity 
+#	Jenkins server. Debugging may be perfomed locally by running,
+#
+#		packagers/mac/sign-issm-mac-binaries-matlab.sh
+#
+#	with "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" hardcoded to Apple 
+#	Developer credentials.
+# - Removing stdout/stderr redirections to null device (> /dev/null 2>&1) can 
+#	help debug potential SVN issues.
+#
+# NOTE:
+# - Use only *one* of the above options at a time, and make sure it is removed 
+#	again after a single run.
+# - Builds will fail when any of the above options are used on a clean 
+#	workspace. For example, if 'Source Code Management' -> 'Check-out Strategy' 
+#	select menu is set to "Always check out a fresh copy".
+# - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in 
+#	the 'Bindings' section under a 'Username and password (separated)' binding 
+#	(requires 'Credentials Binding Plugin') with 'Credentials' select menu set 
+#	to "jenkins/****** (SVN repository for ISSM binaries)".
+################################################################################
+
+## Constants
+#
+PKG="ISSM-macOS-MATLAB" # Name of directory to copy distributable files to
+SIGNED_REPO_COPY="./signed"
+SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/signed"
+
+COMPRESSED_PKG="${PKG}.zip"
+
+## Environment
+#
+export COMPRESSED_PKG
+export PKG
+export SIGNED_REPO_COPY
+export SIGNED_REPO_URL
+
+## Parse options
+#
+if [ $# -gt 1 ]; then
+	echo "Can use only one option at a time"
+	exit 1
+fi
+
+# NOTE: We could do this with binary switching (i.e. 0011 to sign and transfer, 
+#		but the following is self-documenting).
+#
+build=1
+package=1
+sign=1
+transfer=1
+
+if [ $# -eq 1 ]; then
+	case $1 in
+		-b|--skipbuild)		build=0;							shift	;;
+		-r|--resign)		build=0;	package=0;						;;
+		-s|--skiptests)		build=0;									;;
+		-t|--transferonly)	build=0;	package=0;	sign=0;				;;
+		-u|--unlock)		build=0;	package=0;	transfer=0;			;;
+		*) echo "Unknown parameter passed: $1"; exit 1 					;;
+	esac
+fi
+
+# Build
+if [ ${build} -eq 1 ]; then
+	./jenkins/jenkins.sh ./jenkins/pine_island-mac-binaries-matlab
+
+	if [ $? -ne 0 ]; then 
+		exit 1
+	fi
+fi
+
+# Package
+if [ ${package} -eq 1 ]; then
+	./packagers/mac/package-issm-mac-binaries-matlab.sh $1
+	shift # Clear $1 so that it is not passed to commit_for_signing script
+
+	if [ $? -ne 0 ]; then 
+		exit 1
+	fi
+fi
+
+# Commit for signing
+if [ ${sign} -eq 1 ]; then
+	./packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh $1
+
+	if [ $? -ne 0 ]; then 
+		exit 1
+	fi
+fi
+
+# Transfer distributable package to ISSM Web site
+if [ ${transfer} -eq 1 ]; then
+	./packagers/mac/transfer-issm-mac-binaries.sh
+
+	if [ $? -ne 0 ]; then 
+		exit 1
+	fi
+fi
+
Index: /issm/trunk/packagers/mac/complete-issm-mac-binaries-python.sh
===================================================================
--- /issm/trunk/packagers/mac/complete-issm-mac-binaries-python.sh	(revision 26744)
+++ /issm/trunk/packagers/mac/complete-issm-mac-binaries-python.sh	(revision 26744)
@@ -0,0 +1,133 @@
+#!/bin/bash
+
+################################################################################
+# Wrapper script to build, package, send for signing, and transfer to ISSM Web 
+# site ISSM distributable package for macOS with Python API.
+#
+# Normally, we would put this directly into the project configuration under 
+# 'Build' -> 'Excute shell', but becasue it is a bit more involved, it is a 
+# good idea to version it.
+#
+# When no failures/errors occur, performs the following:
+# - Builds ISSM according to configuration.
+# - Packages executables and libraries.
+# - Runs test suite against package.
+# - Commits compressed package to repository to be signed by JPL Cybersecurity.
+# - Retrieves signed package and transmits it to ISSM Web site for 
+#	distribution.
+#
+# Options:
+# -b/--skipbuild		Skip ISSM compilation.
+# -r/--resign			Skip ISSM compilation and packaging. Use to retrigger 
+#						signing/notarization if it fails but build and package 
+#						are valid.
+# -s/--skiptests		Skip ISSM compilation and testing during packaging 
+#						step. Use if packaging fails for some reason but build 
+#						is valid.
+# -t/--transferonly		Transfer package to ISSM Web site only. Use if transfer 
+#						fails for some reason to skip building, packaging, and 
+#						signing.
+# -u/--unlock			Remove lock file from signed package repository. Use if 
+#						build is aborted to allow for subsequent fresh build.
+#
+# Debugging:
+# - Relies on a very tight handshake with project on remote JPL Cybersecurity 
+#	Jenkins server. Debugging may be perfomed locally by running,
+#
+#		packagers/mac/sign-issm-mac-binaries-python.sh
+#
+#	with "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" hardcoded to Apple 
+#	Developer credentials.
+# - Removing stdout/stderr redirections to null device (> /dev/null 2>&1) can 
+#	help debug potential SVN issues.
+#
+# NOTE:
+# - Use only *one* of the above options at a time, and make sure it is removed 
+#	again after a single run.
+# - Builds will fail when any of the above options are used on a clean 
+#	workspace. For example, if 'Source Code Management' -> 'Check-out Strategy' 
+#	select menu is set to "Always check out a fresh copy".
+# - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in 
+#	the 'Bindings' section under a 'Username and password (separated)' binding 
+#	(requires 'Credentials Binding Plugin') with 'Credentials' select menu set 
+#	to "jenkins/****** (SVN repository for ISSM binaries)".
+################################################################################
+
+## Constants
+#
+PKG="ISSM-macOS-Python" # Name of directory to copy distributable files to
+SIGNED_REPO_COPY="./signed"
+SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/signed"
+
+COMPRESSED_PKG="${PKG}.zip"
+
+## Environment
+#
+export COMPRESSED_PKG
+export PKG
+export SIGNED_REPO_COPY
+export SIGNED_REPO_URL
+
+## Parse options
+#
+if [ $# -gt 1 ]; then
+	echo "Can use only one option at a time"
+	exit 1
+fi
+
+# NOTE: We could do this with binary switching (i.e. 0011 to sign and transfer, 
+#		but the following is self-documenting).
+#
+build=1
+package=1
+sign=1
+transfer=1
+
+if [ $# -eq 1 ]; then
+	case $1 in
+		-b|--skipbuild)		build=0;							shift	;;
+		-r|--resign)		build=0;	package=0;						;;
+		-s|--skiptests)		build=0;									;;
+		-t|--transferonly)	build=0;	package=0;	sign=0;				;;
+		-u|--unlock)		build=0;	package=0;	transfer=0;			;;
+		*) echo "Unknown parameter passed: $1"; exit 1 					;;
+	esac
+fi
+
+# Build
+if [ ${build} -eq 1 ]; then
+	./jenkins/jenkins.sh ./jenkins/pine_island-mac-binaries-python
+
+	if [ $? -ne 0 ]; then 
+		exit 1
+	fi
+fi
+
+# Package
+if [ ${package} -eq 1 ]; then
+	./packagers/mac/package-issm-mac-binaries-python.sh $1
+	shift # Clear $1 so that it is not passed to commit_for_signing script
+
+	if [ $? -ne 0 ]; then 
+		exit 1
+	fi
+fi
+
+# Commit for signing
+if [ ${sign} -eq 1 ]; then
+	./packagers/mac/commit_for_signing-issm-mac-binaries-python.sh $1
+
+	if [ $? -ne 0 ]; then 
+		exit 1
+	fi
+fi
+
+# Transfer distributable package to ISSM Web site
+if [ ${transfer} -eq 1 ]; then
+	./packagers/mac/transfer-issm-mac-binaries.sh
+
+	if [ $? -ne 0 ]; then 
+		exit 1
+	fi
+fi
+
Index: /issm/trunk/packagers/mac/package-issm-mac-binaries-matlab.sh
===================================================================
--- /issm/trunk/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 26743)
+++ /issm/trunk/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 26744)
@@ -2,44 +2,20 @@
 
 ################################################################################
-# To be used after running,
-#
-#	${ISSM_DIR}/jenkins/jenkins.sh ${ISSM_DIR}/jenkins/pine_island-mac-binaries-matlab
-#
-# in the context of a Jenkins project.
-#
-# When no runtime errors occur, performs the following:
-# - Checks resulting executables and libraries against test suite.
-# - Packages and compresses executables and libraries.
-# - Commits compressed package to repository to be signed by JPL Cybersecurity.
-# - Retrieves signed package and transmits it to ISSM Web site for 
-#	distribution.
+# Packages and tests ISSM distributable package for macOS with MATLAB API.
 #
 # Options:
-# -c/--cleanup			Remove lock file from signed package repository (use if 
-#						build is aborted to allow for subsequent fresh build)
-# -n/--notarizeonly		Sign/notarize only (use if signing/notarization fails 
-#						to skip tests/packaging)
-# -s/--skiptests		Skip tests (use if this script fails for some reason 
-#						after tests have successfully passed to save time)
-# -t/--transferonly		Transfer package to ISSM Web site only (use if 
-#						transfer fails for some reason to skip testing and
-#						signing)
-#
-# Debugging:
-# - Relies on a very tight handshake with project on remote JPL Cybersecurity 
-#	Jenkins server. Debugging may be perfomed locally by running,
-#
-#		packagers/mac/sign-issm-mac-binaries-matlab.sh
-#
-#	with Apple Developer credentials.
-# - Removing stdout/stderr redirections to null device (> /dev/null 2>&1) can 
-#	help debug potential SVN issues.
+# -s/--skiptests		Skip testing during packaging Use if packaging fails 
+#						for some reason but build is valid.
 #
 # NOTE:
-# - Assumes that 'issm-binaries-user' and 'issm-binaries-pass' are set up in 
-#	the 'Bindings' section under a 'Username and password (separated)' binding 
-#	(requires 'Credentials Binding Plugin').
-# - For local debugging, the aformentioned credentials can be hardcoded into 
-#	the 'USERNAME' and 'PASSWORD' constants below.
+# - Assumes that the following constants are defined,
+#
+#		COMPRESSED_PKG
+#		ISSM_DIR
+#		PKG
+#
+# See also:
+# - packagers/mac/complete-issm-mac-binaries-matlab.sh
+# - packagers/mac/sign-issm-mac-binaries-matlab.sh
 ################################################################################
 
@@ -66,4 +42,5 @@
 ## Override certain other aliases
 #
+alias cp=$(which cp)
 alias grep=$(which grep)
 
@@ -71,22 +48,9 @@
 #
 MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2006,2020,2021,2051,2052,2053,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
-MATLAB_PATH="/Applications/MATLAB_R2019b.app"
-NOTARIZATION_LOGFILE="notarization.log"
-PASSWORD=$env:issm-binaries-pass
-PKG="ISSM-macOS-MATLAB" # Name of directory to copy distributable files to
-RETRIGGER_SIGNING_FILE="retrigger.txt"
-SIGNED_REPO_COPY="./signed"
-SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/signed"
-SIGNING_CHECK_PERIOD=60 # in seconds
-SIGNING_LOCK_FILE="signing.lock"
-UNSIGNED_REPO_COPY="./unsigned"
-UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned"
-USERNAME=$env:issm-binaries-user
-
-COMPRESSED_PKG="${PKG}.zip"
+MATLAB_PATH="/Applications/MATLAB_R2018a.app"
 
 ## Environment
 #
-export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
+export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'; used when running tests
 
 ## Parse options
@@ -97,259 +61,120 @@
 fi
 
-cleanup=0
-notarize_only=0
 skip_tests=0
-transfer_only=0
-while [ $# -gt 0 ]; do
-    case $1 in
-        -c|--cleanup) cleanup=1; shift ;;
-        -n|--notarizeonly) notarize_only=1; shift ;;
-        -s|--skiptests) skip_tests=1; shift ;;
-        -t|--transferonly) transfer_only=1; shift ;;
-        *) echo "Unknown parameter passed: $1"; exit 1 ;;
-    esac
-    shift
-done
 
-if [ ${cleanup} -eq 1 ]; then
-	# Remove signing lock file from signed package repository so that a new 
-	# build can run
-	echo "Removing lock file from repository for signed packages"
-	svn co \
-		--username ${USERNAME} \
-		--password ${PASSWORD} \
-		--depth empty \
-		${SIGNED_REPO_URL} \
-		${SIGNED_REPO_COPY} > /dev/null 2>&1
-	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
-	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
-	svn commit --message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY} > /dev/null 2>&1
-	svn cleanup ${SIGNED_REPO_COPY} > /dev/null 2>&1
+if [ $# -eq 1 ]; then
+	case $1 in
+		-s|--skiptests)	skip_tests=1;					;;
+		*) echo "Unknown parameter passed: $1"; exit 1	;;
+	esac
+fi
+
+# Check if MATLAB exists
+if ! [ -d ${MATLAB_PATH} ]; then
+	echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
 	exit 1
 fi
 
-if [ ${transfer_only} -eq 0 ]; then
-	if [ ${notarize_only} -eq 0 ]; then
-		# Check if MATLAB exists
-		if ! [ -d ${MATLAB_PATH} ]; then
-			echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
-			exit 1
-		fi
+# Clean up from previous packaging
+echo "Cleaning up existing assets"
+cd ${ISSM_DIR}
+rm -rf ${PKG} ${COMPRESSED_PKG}
+mkdir ${PKG}
 
-		# Clean up from previous packaging
-		echo "Cleaning up existing assets"
-		cd ${ISSM_DIR}
-		rm -rf ${PKG} ${COMPRESSED_PKG} ${SIGNED_REPO_COPY} ${UNSIGNED_REPO_COPY}
-		mkdir ${PKG}
+# Add required binaries and libraries to package and modify them where needed
+cd ${ISSM_DIR}/bin
 
-		# Check out copy of SVN repository for signed packages
-		#
-		# NOTE: Get empty copy because we do not want to have to check out package from 
-		#		previous signing.
-		#
-		echo "Checking out copy of repository for signed packages"
-		svn co \
-			--username ${USERNAME} \
-			--password ${PASSWORD} \
-			--depth empty \
-			${SIGNED_REPO_URL} \
-			${SIGNED_REPO_COPY} > /dev/null 2>&1
+echo "Modify generic"
+cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
 
-		# If lock file exists, a signing build is still in process by JPL Cybersecurity
-		svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
-		if [[ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]]; then
-			echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
-			exit 1
-		fi
+echo "Moving MPICH binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
+	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
+	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
+elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
+	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
+	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
+else
+	echo "MPICH not found"
+	exit 1
+fi
 
-		# Add required binaries and libraries to package and modify them where needed
-		cd ${ISSM_DIR}/bin
+echo "Moving GDAL binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
+	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
+	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
+else
+	echo "GDAL not found"
+	exit 1
+fi
 
-		echo "Modify generic"
-		cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
+echo "Moving GMT binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
+	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
+	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
+else
+	echo "GMT not found"
+	exit 1
+fi
 
-		echo "Moving MPICH binaries to bin/"
-		if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
-			cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
-			cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
-		elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
-			cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
-			cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
-		else
-			echo "MPICH not found"
-			exit 1
-		fi
+echo "Moving Gmsh binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
+	cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
+else
+	echo "Gmsh not found"
+	exit 1
+fi
 
-		echo "Moving GDAL binaries to bin/"
-		if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
-			cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
-			cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
-		else
-			echo "GDAL not found"
-			exit 1
-		fi
+# Run tests
+if [ ${skip_tests} -eq 0 ]; then
+	echo "Running tests"
+	cd ${ISSM_DIR}/test/NightlyRun
+	rm matlab.log 2> /dev/null
 
-		echo "Moving GMT binaries to bin/"
-		if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
-			cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
-			cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
-		else
-			echo "GMT not found"
-			exit 1
-		fi
+	# Run tests, redirecting output to logfile and suppressing output to console
+	${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
 
-		echo "Moving Gmsh binaries to bin/"
-		if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
-			cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
-		else
-			echo "Gmsh not found"
-			exit 1
-		fi
+	# Check that MATLAB did not exit in error
+	matlabExitCode=`echo $?`
+	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run" matlab.log | wc -l`
 
-		# Run tests
-		if [ ${skip_tests} -eq 0 ]; then
-			echo "Running tests"
-			cd ${ISSM_DIR}/test/NightlyRun
-			rm matlab.log 2> /dev/null
+	if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+		echo "----------MATLAB exited in error!----------"
+		cat matlab.log
+		echo "-----------End of matlab.log-----------"
 
-			# Run tests, redirecting output to logfile and suppressing output to console
-			${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+		# Clean up execution directory
+		rm -rf ${ISSM_DIR}/execution/*
 
-			# Check that MATLAB did not exit in error
-			matlabExitCode=`echo $?`
-			matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
-
-			if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
-				echo "----------MATLAB exited in error!----------"
-				cat matlab.log
-				echo "-----------End of matlab.log-----------"
-
-				# Clean up execution directory
-				rm -rf ${ISSM_DIR}/execution/*
-
-				exit 1
-			fi
-
-			# Check that all tests passed
-			numTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
-
-			if [[ ${numTestsFailed} -ne 0 ]]; then
-				echo "One or more tests FAILED"
-				exit 1
-			else
-				echo "All tests PASSED"
-			fi
-		else
-			echo "Skipping tests"
-		fi
-
-		# Create package
-		cd ${ISSM_DIR}
-		svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
-		echo "Copying assets to package: ${PKG}"
-		cp -rf bin examples lib scripts test ${PKG}/
-		mkdir ${PKG}/execution
-		cp packagers/mac/issm-executable_entitlements.plist ${PKG}/bin/entitlements.plist
-		echo "Cleaning up unneeded/unwanted files"
-		rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
-		rm -f ${PKG}/lib/*.a # Remove static libraries from package
-		rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
-		rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
-
-		# Compress package
-		echo "Compressing package"
-		ditto -ck --sequesterRsrc --keepParent ${PKG} ${COMPRESSED_PKG}
+		exit 1
 	fi
 
-	# Commit lock file to repository for signed packages
-	echo "Committing lock file to repository for signed packages"
-	touch ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
-	svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
-	svn commit --message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+	# Check that all tests passed
+	numTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
 
-	# Save current working copy revision number
-	svn up ${SIGNED_REPO_COPY} > /dev/null 2>&1
-	CURRENT_REV=$(svn info --show-item last-changed-revision ${SIGNED_REPO_COPY})
-
-	# Check out copy of SVN repository for unsigned packages
-	echo "Checking out copy of repository for unsigned packages"
-	svn co \
-		--username ${USERNAME} \
-		--password ${PASSWORD} \
-		${UNSIGNED_REPO_URL} \
-		${UNSIGNED_REPO_COPY} > /dev/null 2>&1
-
-	if [ ${notarize_only} -eq 0 ]; then
-		# Commit new compressed package to repository for unsigned binaries
-		#
-		# NOTE: This will not work if, for any reason, the checksum on the compressed 
-		#		package is unchanged.
-		#
-		echo "Committing package to repository for unsigned packages"
-		cp ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
-		svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
-		svn commit --message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+	if [ ${numTestsFailed} -ne 0 ]; then
+		echo "One or more tests FAILED"
+		exit 1
 	else
-		# NOTE: If notarize_only == 1, we commit a dummy file as the signing 
-		#		build on the remote JPL Cybersecurity Jenkins server is 
-		#		triggered by polling SCM.
-		#
-		echo "Attempting to sign existing package again"
-		touch ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE}
-		svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
-		svn commit --message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+		echo "All tests PASSED"
 	fi
-
-	# Check status of signing
-	echo "Checking progress of signing..."
-	IN_PROCESS=1
-	SUCCESS=0
-
-	while [ ${IN_PROCESS} -eq 1 ]; do
-		echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
-		sleep ${SIGNING_CHECK_PERIOD}
-		svn up ${SIGNED_REPO_COPY} > /dev/null 2>&1
-		NEW_REV=$(svn info --show-item last-changed-revision ${SIGNED_REPO_COPY})
-
-		if [ ${NEW_REV} -ne ${CURRENT_REV} ]; then
-			IN_PROCESS=0
-
-			svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} > /dev/null 2>&1
-			svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
-
-			# No error, so check status
-			STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
-			if [[ "${STATUS}" == "success" ]]; then
-				echo "Notarization successful!"
-
-				# Set flag indicating notarization was successful
-				SUCCESS=1
-			else
-				echo "Notarization failed!"
-			fi
-		fi
-	done
 else
-	# Assume that previous build resulted in successful signing of package but 
-	# that transfer to ISSM Web site failed and user built this project again 
-	# with -t/--transferonly option.
-	SUCCESS=1
+	echo "Skipping tests"
 fi
 
-# Handle result of signing
-if [ ${SUCCESS} -eq 1 ]; then
-	# Transfer signed package to ISSM Web site
-	echo "Transferring signed package to ISSM Web site"
-	scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
+# Create package
+cd ${ISSM_DIR}
+svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+echo "Copying assets to package: ${PKG}"
+cp -rf bin examples lib scripts test ${PKG}
+mkdir ${PKG}/execution
+cp packagers/mac/issm-executable_entitlements.plist ${PKG}/bin/entitlements.plist
+echo "Cleaning up unneeded/unwanted files"
+rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
+rm -f ${PKG}/lib/*.a # Remove static libraries from package
+rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
+rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
 
-	if [ $? -ne 0 ]; then
-		echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip testing and signing)."
-		exit 1
-	fi
-else
-	echo "----------------------- Contents of notarization logfile -----------------------"
-	cat ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
-	echo "--------------------------------------------------------------------------------"
-
-	exit 1
-fi
+# Compress package
+echo "Compressing package"
+ditto -ck --sequesterRsrc --keepParent ${PKG} ${COMPRESSED_PKG}
Index: /issm/trunk/packagers/mac/package-issm-mac-binaries-python.sh
===================================================================
--- /issm/trunk/packagers/mac/package-issm-mac-binaries-python.sh	(revision 26743)
+++ /issm/trunk/packagers/mac/package-issm-mac-binaries-python.sh	(revision 26744)
@@ -2,44 +2,20 @@
 
 ################################################################################
-# To be used after running,
-#
-#	${ISSM_DIR}/jenkins/jenkins.sh ${ISSM_DIR}/jenkins/pine_island-mac-binaries-python
-#
-# in the context of a Jenkins project.
-#
-# When no runtime errors occur, performs the following:
-# - Checks resulting executables and libraries against test suite.
-# - Packages and compresses executables and libraries.
-# - Commits compressed package to repository to be signed by JPL Cybersecurity.
-# - Retrieves signed package and transmits it to ISSM Web site for 
-#	distribution.
+# Packages and tests ISSM distributable package for macOS with Python API.
 #
 # Options:
-# -c/--cleanup			Remove lock file from signed package repository (use if 
-#						build is aborted to allow for subsequent fresh build)
-# -n/--notarizeonly		Sign/notarize only (use if signing/notarization fails 
-#						to skip tests/packaging)
-# -s/--skiptests		Skip tests (use if this script fails for some reason 
-#						after tests have successfully passed to save time)
-# -t/--transferonly		Transfer package to ISSM Web site only (use if 
-#						transfer fails for some reason to skip testing and
-#						signing)
-#
-# Debugging:
-# - Relies on a very tight handshake with project on remote JPL Cybersecurity 
-#	Jenkins server. Debugging may be perfomed locally by running,
-#
-#		packagers/mac/sign-issm-mac-binaries-python.sh
-#
-#	with Apple Developer credentials.
-# - Removing stdout/stderr redirections to null device (> /dev/null 2>&1) can 
-#	help debug potential SVN issues.
+# -s/--skiptests		Skip testing during packaging Use if packaging fails 
+#						for some reason but build is valid.
 #
 # NOTE:
-# - Assumes that 'issm-binaries-user' and 'issm-binaries-pass' are set up in 
-#	the 'Bindings' section under a 'Username and password (separated)' binding 
-#	(requires 'Credentials Binding Plugin').
-# - For local debugging, the aformentioned credentials can be hardcoded into 
-#	the 'USERNAME' and 'PASSWORD' constants below.
+# - Assumes that the following constants are defined,
+#
+#		COMPRESSED_PKG
+#		ISSM_DIR
+#		PKG
+#
+# See also:
+# - packagers/mac/complete-issm-mac-binaries-python.sh
+# - packagers/mac/sign-issm-mac-binaries-python.sh
 ################################################################################
 
@@ -70,18 +46,5 @@
 ## Constants
 #
-NOTARIZATION_LOGFILE="notarization.log"
-PASSWORD=$env:issm-binaries-pass
-PKG="ISSM-macOS-Python" # Name of directory to copy distributable files to
 PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2006 2020 2021 2051 2052 2053 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
-RETRIGGER_SIGNING_FILE="retrigger.txt"
-SIGNED_REPO_COPY="./signed"
-SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/signed"
-SIGNING_CHECK_PERIOD=60 # in seconds
-SIGNING_LOCK_FILE="signing.lock"
-UNSIGNED_REPO_COPY="./unsigned"
-UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/unsigned"
-USERNAME=$env:issm-binaries-user
-
-COMPRESSED_PKG="${PKG}.zip"
 
 ## Environment
@@ -96,261 +59,121 @@
 fi
 
-cleanup=0
-notarize_only=0
 skip_tests=0
-transfer_only=0
-while [ $# -gt 0 ]; do
-    case $1 in
-        -c|--cleanup) cleanup=1; shift ;;
-        -n|--notarizeonly) notarize_only=1; shift ;;
-        -s|--skiptests) skip_tests=1; shift ;;
-        -t|--transferonly) transfer_only=1; shift ;;
-        *) echo "Unknown parameter passed: $1"; exit 1 ;;
-    esac
-    shift
-done
 
-if [ ${cleanup} -eq 1 ]; then
-	# Remove signing lock file from signed package repository so that a new 
-	# build can run
-	echo "Removing lock file from repository for signed packages"
-	svn co \
-		--username ${USERNAME} \
-		--password ${PASSWORD} \
-		--depth empty \
-		${SIGNED_REPO_URL} \
-		${SIGNED_REPO_COPY} > /dev/null 2>&1
-	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
-	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
-	svn commit --message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY} > /dev/null 2>&1
-	svn cleanup ${SIGNED_REPO_COPY} > /dev/null 2>&1
+if [ $# -eq 1 ]; then
+	case $1 in
+		-s|--skiptests)	skip_tests=1;					;;
+		*) echo "Unknown parameter passed: $1"; exit 1	;;
+	esac
+fi
+
+# Clean up from previous packaging
+echo "Cleaning up existing assets"
+cd ${ISSM_DIR}
+rm -rf ${PKG} ${COMPRESSED_PKG}
+mkdir ${PKG}
+
+# Add required binaries and libraries to package and modify them where needed
+cd ${ISSM_DIR}/bin
+
+echo "Modify generic"
+cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py
+
+echo "Moving MPICH binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
+	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
+	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
+elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
+	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
+	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
+else
+	echo "MPICH not found"
 	exit 1
 fi
 
-if [ ${transfer_only} -eq 0 ]; then
-	if [ ${notarize_only} -eq 0 ]; then
-		# Clean up from previous packaging
-		echo "Cleaning up existing assets"
-		cd ${ISSM_DIR}
-		rm -rf ${PKG} ${COMPRESSED_PKG} ${SIGNED_REPO_COPY} ${UNSIGNED_REPO_COPY}
-		mkdir ${PKG}
+echo "Moving GDAL binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
+	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
+	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
+else
+	echo "GDAL not found"
+	exit 1
+fi
 
-		# Check out copy of SVN repository for signed packages
-		#
-		# NOTE: Get empty copy because we do not want to have to check out package 
-		#		from previous signing.
-		#
-		echo "Checking out copy of repository for signed packages"
-		svn co \
-			--username ${USERNAME} \
-			--password ${PASSWORD} \
-			--depth empty \
-			${SIGNED_REPO_URL} \
-			${SIGNED_REPO_COPY} > /dev/null 2>&1
+echo "Moving GMT binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
+	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
+	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
+else
+	echo "GMT not found"
+	exit 1
+fi
 
-		# If lock file exists, a signing build is still in process by JPL Cybersecurity
-		svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
-		if [[ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]]; then
-			echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
-			exit 1
-		fi
+echo "Moving Gmsh binaries to bin/"
+if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
+	cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
+else
+	echo "Gmsh not found"
+	exit 1
+fi
 
-		# Add required binaries and libraries to package and modify them where needed
-		cd ${ISSM_DIR}/bin
+# Run tests
+if [ ${skip_tests} -eq 0 ]; then
+	echo "Running tests"
+	cd ${ISSM_DIR}/test/NightlyRun
+	rm python.log 2> /dev/null
 
-		echo "Modify generic"
-		cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py
+	# Set Python environment
+	export PYTHONPATH="${ISSM_DIR}/src/m/dev"
+	export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+	export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
 
-		echo "Moving MPICH binaries to bin/"
-		if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
-			cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
-			cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
-		elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
-			cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
-			cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
-		else
-			echo "MPICH not found"
-			exit 1
-		fi
+	# Run tests, redirecting output to logfile and suppressing output to console
+	./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
 
-		echo "Moving GDAL binaries to bin/"
-		if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
-			cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
-			cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
-		else
-			echo "GDAL not found"
-			exit 1
-		fi
+	# Check that Python did not exit in error
+	pythonExitCode=`echo $?`
+	pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python.log | wc -l`
 
-		echo "Moving GMT binaries to bin/"
-		if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
-			cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
-			cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
-		else
-			echo "GMT not found"
-			exit 1
-		fi
+	if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
+		echo "----------Python exited in error!----------"
+		cat python.log
+		echo "-----------End of python.log-----------"
 
-		echo "Moving Gmsh binaries to bin/"
-		if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
-			cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
-		else
-			echo "Gmsh not found"
-			exit 1
-		fi
+		# Clean up execution directory
+		rm -rf ${ISSM_DIR}/execution/*
 
-		# Run tests
-		if [ ${skip_tests} -eq 0 ]; then
-			echo "Running tests"
-
-			cd ${ISSM_DIR}/test/NightlyRun
-			rm python.log 2> /dev/null
-
-			# Set Python environment
-			export PYTHONPATH="${ISSM_DIR}/src/m/dev"
-			export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
-			export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
-
-			# Run tests, redirecting output to logfile and suppressing output to console
-			./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
-
-			# Check that Python did not exit in error
-			pythonExitCode=`echo $?`
-			pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python.log | wc -l`
-
-			if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
-				echo "----------Python exited in error!----------"
-				cat python.log
-				echo "-----------End of python.log-----------"
-
-				# Clean up execution directory
-				rm -rf ${ISSM_DIR}/execution/*
-
-				exit 1
-			fi
-
-			# Check that all tests passed
-			numTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
-
-			if [[ ${numTestsFailed} -ne 0 ]]; then
-				echo "One or more tests FAILED"
-				exit 1
-			else
-				echo "All tests PASSED"
-			fi
-		else
-			echo "Skipping tests"
-		fi
-
-		# Create package
-		cd ${ISSM_DIR}
-		svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
-		echo "Copying assets to package: ${PKG}"
-		cp -rf bin examples lib scripts test ${PKG}/
-		mkdir ${PKG}/execution
-		cp packagers/mac/issm-executable_entitlements.plist ${PKG}/bin/entitlements.plist
-		${ISSM_DIR}/scripts/py_to_pyc.sh ${PKG}/bin # Compile Python source files
-		echo "Cleaning up unneeded/unwanted files"
-		rm -f ${PKG}/bin/*.py # Remove all Python scripts
-		rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
-		rm -f ${PKG}/lib/*.a # Remove static libraries from package
-		rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
-		rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
-
-		# Compress package
-		echo "Compressing package"
-		ditto -ck --sequesterRsrc --keepParent ${PKG} ${COMPRESSED_PKG}
+		exit 1
 	fi
 
-	# Commit lock file to repository for signed packages
-	echo "Committing lock file to repository for signed packages"
-	touch ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
-	svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
-	svn commit --message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+	# Check that all tests passed
+	numTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
 
-	# Save current working copy revision number
-	svn up ${SIGNED_REPO_COPY} > /dev/null 2>&1
-	CURRENT_REV=$(svn info --show-item last-changed-revision ${SIGNED_REPO_COPY})
-
-	# Check out copy of SVN repository for unsigned packages
-	echo "Checking out copy of repository for unsigned packages"
-	svn co \
-		--username ${USERNAME} \
-		--password ${PASSWORD} \
-		${UNSIGNED_REPO_URL} \
-		${UNSIGNED_REPO_COPY} > /dev/null 2>&1
-
-	if [ ${notarize_only} -eq 0 ]; then
-		# Commit new compressed package to repository for unsigned binaries
-		#
-		# NOTE: This will not work if, for any reason, the checksum on the compressed 
-		#		package is unchanged.
-		#
-		echo "Committing package to repository for unsigned packages"
-		cp ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
-		svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
-		svn commit --message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+	if [ ${numTestsFailed} -ne 0 ]; then
+		echo "One or more tests FAILED"
+		exit 1
 	else
-		# NOTE: If notarize_only == 1, we commit a dummy file as the signing 
-		#		build on the remote JPL Cybersecurity Jenkins server is 
-		#		triggered by polling SCM.
-		#
-		echo "Attempting to sign existing package again"
-		touch ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE}
-		svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
-		svn commit --message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+		echo "All tests PASSED"
 	fi
-
-	# Check status of signing
-	echo "Checking progress of signing..."
-	IN_PROCESS=1
-	SUCCESS=0
-
-	while [ ${IN_PROCESS} -eq 1 ]; do
-		echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
-		sleep ${SIGNING_CHECK_PERIOD}
-		svn up ${SIGNED_REPO_COPY} > /dev/null 2>&1
-		NEW_REV=$(svn info --show-item last-changed-revision ${SIGNED_REPO_COPY})
-
-		if [ ${NEW_REV} -ne ${CURRENT_REV} ]; then
-			IN_PROCESS=0
-
-			svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} > /dev/null 2>&1
-			svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
-
-			# No error, so check status
-			STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
-			if [[ "${STATUS}" == "success" ]]; then
-				echo "Notarization successful!"
-				
-				# Set flag indicating notarization was successful
-				SUCCESS=1
-			else
-				echo "Notarization failed!"
-			fi
-		fi
-	done
 else
-	# Assume that previous build resulted in successful signing of package but 
-	# that transfer to ISSM Web site failed and user built this project again 
-	# with -t/--transferonly option.
-	SUCCESS=1
+	echo "Skipping tests"
 fi
 
-# Handle result of signing
-if [ ${SUCCESS} -eq 1 ]; then
-	# Transfer signed package to ISSM Web site
-	echo "Transferring signed package to ISSM Web site"
-	scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
+# Create package
+cd ${ISSM_DIR}
+svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+echo "Copying assets to package: ${PKG}"
+cp -rf bin examples lib scripts test ${PKG}
+mkdir ${PKG}/execution
+cp packagers/mac/issm-executable_entitlements.plist ${PKG}/bin/entitlements.plist
+${ISSM_DIR}/scripts/py_to_pyc.sh ${PKG}/bin # Compile Python source files
+echo "Cleaning up unneeded/unwanted files"
+rm -f ${PKG}/bin/*.py # Remove all Python scripts
+rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
+rm -f ${PKG}/lib/*.a # Remove static libraries from package
+rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
+rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
 
-	if [ $? -ne 0 ]; then
-		echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip testing and signing)."
-		exit 1
-	fi
-else
-	echo "----------------------- Contents of notarization logfile -----------------------"
-	cat ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
-	echo "--------------------------------------------------------------------------------"
-
-	exit 1
-fi
+# Compress package
+echo "Compressing package"
+ditto -ck --sequesterRsrc --keepParent ${PKG} ${COMPRESSED_PKG}
Index: /issm/trunk/packagers/mac/sign-issm-mac-binaries-matlab.sh
===================================================================
--- /issm/trunk/packagers/mac/sign-issm-mac-binaries-matlab.sh	(revision 26743)
+++ /issm/trunk/packagers/mac/sign-issm-mac-binaries-matlab.sh	(revision 26744)
@@ -17,9 +17,11 @@
 #	'Add Credentials' and enter the crendentials from above.
 # - From the 'Dashboard', select 'New Item' -> 'Freestyle project'.
-# - Under 'Source Code Management', select 'Subversion'. 
+# - Under 'Source Code Management', select 'Subversion'.
 #		- The 'Repository URL' text field should be set to 
-#		"https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned"
+#		"https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned".
 #		- The 'Credentials' select menu should be set to the new credentials 
 #		created previously.
+#		- The 'Local module directory' text field should be set to the same 
+#		value as the constant UNSIGNED_REPO_COPY (set below to './unsigned').
 # - Under 'Build Trigggers', check the box for 'Poll SCM' and set the 
 #	'Schedule' text area to "H/5 * * * *".
@@ -27,6 +29,6 @@
 #	file(s)', then under 'Bindings' click the 'Add...' button and select 
 #	'Username and password (separated)'.
-#		- Set 'Username Variable' to "issm-binaries-user”.
-#		- Set 'Password Variable' to "issm-binaries-pass”.
+#		- Set 'Username Variable' to "ISSM_BINARIES_USER".
+#		- Set 'Password Variable' to "ISSM_BINARIES_PASS".
 # - Under 'Credentials', select the same, new credentials that created 
 #	previously.
@@ -40,5 +42,5 @@
 #
 # NOTE:
-# - Assumes that 'issm-binaries-user' and 'issm-binaries-pass' are set up in 
+# - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in 
 #	the 'Bindings' section under a 'Username and password (separated)' binding 
 #	(requires 'Credentials Binding Plugin').
@@ -78,11 +80,12 @@
 ALTOOL_PASSWORD="@keychain:**********" # altool password (assumed to be stored in keychain)
 ASC_PROVIDER="**********"
-NOTARIZATION_CHECK_ATTEMPTS=60
+MAX_SVN_ATTEMPTS=10
+NOTARIZATION_CHECK_ATTEMPTS=20
 NOTARIZATION_CHECK_PERIOD=60
 NOTARIZATION_LOGFILE="notarization.log"
 NOTARIZATION_LOGFILE_PATH="."
+PASSWORD=${ISSM_BINARIES_PASS}
 PKG="ISSM-macOS-MATLAB"
-PRIMARY_BUNDLE_ID="**********.issm.matlab" # Maybe "nasa.jpl.issm.matlab"?
-RETRIGGER_SIGNING_FILE="retrigger.txt"
+PRIMARY_BUNDLE_ID="gov.nasa.jpl.issm.matlab"
 SIGNED_REPO_COPY="./signed"
 SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/signed"
@@ -91,21 +94,29 @@
 UNSIGNED_REPO_COPY="./unsigned"
 UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned"
+USERNAME=${ISSM_BINARIES_USER}
 
 COMPRESSED_PKG="${PKG}.zip"
 EXE_ENTITLEMENTS_PLIST="${PKG}/bin/entitlements.plist"
 
-# Clean up from previous packaging (not necessary for single builds on Jenkins, 
-# but useful when testing packaging locally)
-echo "Cleaning up existing assets"
-rm -rf ${PKG} ${COMPRESSED_PKG} ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE} ${SIGNED_REPO_COPY} ${UNSIGNED_REPO_COPY}
-mkdir ${PKG}
-
-# Check out copy of repository for unsigned packages
-echo "Checking out copy of respository for unsigned packages"
-svn co \
-	--username ${USERNAME} \
-	--password ${PASSWORD} \
-	${UNSIGNED_REPO_URL} \
-	${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+# NOTE: Uncomment the following for local testing (Jenkins checks out copy of 
+#		repository for unsigned packages to working directory)
+#
+
+# # Clean up from previous packaging (not necessary for single builds on Jenkins, 
+# # but useful when testing packaging locally)
+# echo "Cleaning up existing assets"
+# rm -rf ${COMPRESSED_PKG} ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE} ${UNSIGNED_REPO_COPY}
+
+# # Check out copy of repository for unsigned packages
+# echo "Checking out copy of respository for unsigned packages"
+# svn checkout \
+# 	--trust-server-cert \
+# 	--non-interactive \
+# 	--username ${USERNAME} \
+# 	--password ${PASSWORD} \
+# 	${UNSIGNED_REPO_URL} \
+# 	${UNSIGNED_REPO_COPY}
+
+rm -rf ${PKG} ${SIGNED_REPO_COPY}
 
 # Extract package contents
@@ -158,5 +169,5 @@
 # Check if UUID exists in response
 HAS_UUID=$(grep 'RequestUUID = ' ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE}) # NOTE: Checking for "RequestUUID = " because "RequestUUID" shows up in some error messages
-if [[ -z "${HAS_UUID}" ]]; then
+if [ -z "${HAS_UUID}" ]; then
 	echo "Notarization failed!"
 	echo "----------------------- Contents of notarization logfile -----------------------"
@@ -190,5 +201,5 @@
 		# First, check if there is an error
 		ERROR_CHECK=$(grep 'Error' ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE})
-		if [[ ! -z "${ERROR_CHECK}" ]]; then
+		if [ ! -z "${ERROR_CHECK}" ]; then
 			break
 		fi
@@ -237,15 +248,30 @@
 fi
 
-# Remove dummy file for retriggering signing/notarization (if it exists)
-svn delete ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
-svn commit --message "DEL: Removing dummy file for retriggering signing of same package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
-
 # Check out copy of repository for signed packages
 echo "Checking out copy of respository for signed packages"
-svn co \
-	--username ${USERNAME} \
-	--password ${PASSWORD} \
-	${SIGNED_REPO_URL} \
-	${SIGNED_REPO_COPY} > /dev/null 2>&1
+SVN_ATTEMPT=0
+SVN_SUCCESS=0
+while [[ ${SVN_ATTEMPT} -lt ${MAX_SVN_ATTEMPTS} && ${SVN_SUCCESS} -eq 0 ]]; do
+	rm -rf ${SIGNED_REPO_COPY}
+	svn checkout \
+		--trust-server-cert \
+		--non-interactive \
+		--username ${USERNAME} \
+		--password ${PASSWORD} \
+		${SIGNED_REPO_URL} \
+		${SIGNED_REPO_COPY} > /dev/null 2>&1
+	if [ $? -eq 0 ]; then
+		SVN_SUCCESS=1
+		break
+	else
+		((++SVN_ATTEMPT))
+		sleep 5
+	fi
+done
+
+if [ ${SVN_SUCCESS} -eq 0 ]; then
+	echo "Checkout of respository for signed packages failed"
+	exit 1
+fi
 
 # Copy notarization file to repository for signed packages
@@ -256,4 +282,6 @@
 svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
 
+SVN_ATTEMPT=0
+SVN_SUCCESS=0
 if [ ${SUCCESS} -eq 1 ]; then
 	# Copy signed package to repository for signed packages
@@ -263,9 +291,47 @@
 	# Commit changes
 	echo "Committing changes to repository for signed packages"
-	svn commit --message "CHG: New signed package (success)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+	while [[ ${SVN_ATTEMPT} -lt ${MAX_SVN_ATTEMPTS} && ${SVN_SUCCESS} -eq 0 ]]; do
+		svn commit \
+			--trust-server-cert \
+			--non-interactive \
+			--username ${USERNAME} \
+			--password ${PASSWORD} \
+			--message "CHG: New signed package (success)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+		if [ $? -eq 0 ]; then
+			SVN_SUCCESS=1
+			break
+		else
+			((++SVN_ATTEMPT))
+			sleep 5
+		fi
+	done
+
+	if [ ${SVN_SUCCESS} -eq 0 ]; then
+		echo "Commit to respository for signed packages failed"
+		exit 1
+	fi
 else
 	# Commit changes
 	echo "Committing changes to repository for signed packages"
-	svn commit --message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+	while [[ ${SVN_ATTEMPT} -lt ${MAX_SVN_ATTEMPTS} && ${SVN_SUCCESS} -eq 0 ]]; do
+		svn commit \
+			--trust-server-cert \
+			--non-interactive \
+			--username ${USERNAME} \
+			--password ${PASSWORD} \
+			--message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+		if [ $? -eq 0 ]; then
+			SVN_SUCCESS=1
+			break
+		else
+			((++SVN_ATTEMPT))
+			sleep 5
+		fi
+	done
+
+	if [ ${SVN_SUCCESS} -eq 0 ]; then
+		echo "Commit to respository for signed packages failed"
+		exit 1
+	fi
 
 	exit 1
Index: /issm/trunk/packagers/mac/sign-issm-mac-binaries-python.sh
===================================================================
--- /issm/trunk/packagers/mac/sign-issm-mac-binaries-python.sh	(revision 26743)
+++ /issm/trunk/packagers/mac/sign-issm-mac-binaries-python.sh	(revision 26744)
@@ -5,5 +5,5 @@
 # Cybersecurity server for signing macOS applications. Polls SCM of the 
 # Subversion repository hosted at 
-# https://issm.ess.uci.edu/svn/issm-binaries/mac/python/unsigned to trigger new 
+# https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned to trigger new 
 # builds.
 #
@@ -17,9 +17,11 @@
 #	'Add Credentials' and enter the crendentials from above.
 # - From the 'Dashboard', select 'New Item' -> 'Freestyle project'.
-# - Under 'Source Code Management', select 'Subversion'. 
+# - Under 'Source Code Management', select 'Subversion'.
 #		- The 'Repository URL' text field should be set to 
-#		"https://issm.ess.uci.edu/svn/issm-binaries/mac/python/unsigned"
+#		"https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned".
 #		- The 'Credentials' select menu should be set to the new credentials 
 #		created previously.
+#		- The 'Local module directory' text field should be set to the same 
+#		value as the constant UNSIGNED_REPO_COPY (set below to './unsigned').
 # - Under 'Build Trigggers', check the box for 'Poll SCM' and set the 
 #	'Schedule' text area to "H/5 * * * *".
@@ -27,6 +29,6 @@
 #	file(s)', then under 'Bindings' click the 'Add...' button and select 
 #	'Username and password (separated)'.
-#		- Set 'Username Variable' to "issm-binaries-user”.
-#		- Set 'Password Variable' to "issm-binaries-pass”.
+#		- Set 'Username Variable' to "ISSM_BINARIES_USER".
+#		- Set 'Password Variable' to "ISSM_BINARIES_PASS".
 # - Under 'Credentials', select the same, new credentials that created 
 #	previously.
@@ -40,5 +42,5 @@
 #
 # NOTE:
-# - Assumes that 'issm-binaries-user' and 'issm-binaries-pass' are set up in 
+# - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in 
 #	the 'Bindings' section under a 'Username and password (separated)' binding 
 #	(requires 'Credentials Binding Plugin').
@@ -47,4 +49,7 @@
 ################################################################################
 
+# Expand aliases within the context of this script
+shopt -s expand_aliases
+
 # From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
 #
@@ -60,5 +65,6 @@
 # is available in PATH.
 #
-shopt -s expand_aliases
+# NOTE: May be able to remove this after updating macOS.
+#
 alias svn='/usr/local/bin/svn'
 
@@ -74,11 +80,12 @@
 ALTOOL_PASSWORD="@keychain:**********" # altool password (assumed to be stored in keychain)
 ASC_PROVIDER="**********"
-NOTARIZATION_CHECK_ATTEMPTS=60
+MAX_SVN_ATTEMPTS=10
+NOTARIZATION_CHECK_ATTEMPTS=20
 NOTARIZATION_CHECK_PERIOD=60
 NOTARIZATION_LOGFILE="notarization.log"
 NOTARIZATION_LOGFILE_PATH="."
+PASSWORD=${ISSM_BINARIES_PASS}
 PKG="ISSM-macOS-Python"
-PRIMARY_BUNDLE_ID="**********.issm.python" # Maybe "nasa.jpl.issm.matlab"?
-RETRIGGER_SIGNING_FILE="retrigger.txt"
+PRIMARY_BUNDLE_ID="gov.nasa.jpl.issm.python"
 SIGNED_REPO_COPY="./signed"
 SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/signed"
@@ -87,21 +94,30 @@
 UNSIGNED_REPO_COPY="./unsigned"
 UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/unsigned"
+USERNAME=${ISSM_BINARIES_USER}
 
 COMPRESSED_PKG="${PKG}.zip"
 EXE_ENTITLEMENTS_PLIST="${PKG}/bin/entitlements.plist"
 
-# Clean up from previous packaging (not necessary for single builds on Jenkins, 
-# but useful when testing packaging locally)
-echo "Cleaning up existing assets"
-rm -rf ${PKG} ${COMPRESSED_PKG} ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE} ${SIGNED_REPO_COPY} ${UNSIGNED_REPO_COPY}
-mkdir ${PKG}
-
-# Check out copy of repository for unsigned packages
-echo "Checking out copy of respository for unsigned packages"
-svn co \
-	--username ${USERNAME} \
-	--password ${PASSWORD} \
-	${UNSIGNED_REPO_URL} \
-	${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+# NOTE: Uncomment the following for local testing (Jenkins checks out copy of 
+#		repository for unsigned packages to working directory)
+#
+
+# # Clean up from previous packaging (not necessary for single builds on Jenkins, 
+# # but useful when testing packaging locally)
+# echo "Cleaning up existing assets"
+# rm -rf ${COMPRESSED_PKG} ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE} ${UNSIGNED_REPO_COPY}
+
+# # Check out copy of repository for unsigned packages
+# echo "Checking out copy of respository for unsigned packages"
+# svn checkout \
+# 	--trust-server-cert \
+# 	--non-interactive \
+# 	--username ${USERNAME} \
+# 	--password ${PASSWORD} \
+# 	${UNSIGNED_REPO_URL} \
+# 	${UNSIGNED_REPO_COPY}
+
+rm -rf ${PKG} ${SIGNED_REPO_COPY}
+
 
 # Extract package contents
@@ -163,5 +179,5 @@
 # Check if UUID exists in response
 HAS_UUID=$(grep 'RequestUUID = ' ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE}) # NOTE: Checking for "RequestUUID = " because "RequestUUID" shows up in some error messages
-if [[ -z "${HAS_UUID}" ]]; then
+if [ -z "${HAS_UUID}" ]; then
 	echo "Notarization failed!"
 	echo "----------------------- Contents of notarization logfile -----------------------"
@@ -195,5 +211,5 @@
 		# First, check if there is an error
 		ERROR_CHECK=$(grep 'Error' ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE})
-		if [[ ! -z "${ERROR_CHECK}" ]]; then
+		if [ ! -z "${ERROR_CHECK}" ]; then
 			break
 		fi
@@ -242,15 +258,30 @@
 fi
 
-# Remove dummy file for retriggering signing/notarization (if it exists)
-svn delete ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
-svn commit --message "DEL: Removing dummy file for retriggering signing of same package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
-
 # Check out copy of repository for signed packages
 echo "Checking out copy of respository for signed packages"
-svn co \
-	--username ${USERNAME} \
-	--password ${PASSWORD} \
-	${SIGNED_REPO_URL} \
-	${SIGNED_REPO_COPY} > /dev/null 2>&1
+SVN_ATTEMPT=0
+SVN_SUCCESS=0
+while [[ ${SVN_ATTEMPT} -lt ${MAX_SVN_ATTEMPTS} && ${SVN_SUCCESS} -eq 0 ]]; do
+	rm -rf ${SIGNED_REPO_COPY}
+	svn checkout \
+		--trust-server-cert \
+		--non-interactive \
+		--username ${USERNAME} \
+		--password ${PASSWORD} \
+		${SIGNED_REPO_URL} \
+		${SIGNED_REPO_COPY} > /dev/null 2>&1
+	if [ $? -eq 0 ]; then
+		SVN_SUCCESS=1
+		break
+	else
+		((++SVN_ATTEMPT))
+		sleep 5
+	fi
+done
+
+if [ ${SVN_SUCCESS} -eq 0 ]; then
+	echo "Checkout of respository for signed packages failed"
+	exit 1
+fi
 
 # Copy notarization file to repository for signed packages
@@ -259,6 +290,8 @@
 
 # Remove lock file from repository for signed packages
-svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
-
+svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+
+SVN_ATTEMPT=0
+SVN_SUCCESS=0
 if [ ${SUCCESS} -eq 1 ]; then
 	# Copy signed package to repository for signed packages
@@ -268,9 +301,47 @@
 	# Commit changes
 	echo "Committing changes to repository for signed packages"
-	svn commit --message "CHG: New signed package (success)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+	while [[ ${SVN_ATTEMPT} -lt ${MAX_SVN_ATTEMPTS} && ${SVN_SUCCESS} -eq 0 ]]; do
+		svn commit \
+			--trust-server-cert \
+			--non-interactive \
+			--username ${USERNAME} \
+			--password ${PASSWORD} \
+			--message "CHG: New signed package (success)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+		if [ $? -eq 0 ]; then
+			SVN_SUCCESS=1
+			break
+		else
+			((++SVN_ATTEMPT))
+			sleep 5
+		fi
+	done
+
+	if [ ${SVN_SUCCESS} -eq 0 ]; then
+		echo "Commit to respository for signed packages failed"
+		exit 1
+	fi
 else
 	# Commit changes
 	echo "Committing changes to repository for signed packages"
-	svn commit --message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+	while [[ ${SVN_ATTEMPT} -lt ${MAX_SVN_ATTEMPTS} && ${SVN_SUCCESS} -eq 0 ]]; do
+		svn commit \
+			--trust-server-cert \
+			--non-interactive \
+			--username ${USERNAME} \
+			--password ${PASSWORD} \
+			--message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+		if [ $? -eq 0 ]; then
+			SVN_SUCCESS=1
+			break
+		else
+			((++SVN_ATTEMPT))
+			sleep 5
+		fi
+	done
+
+	if [ ${SVN_SUCCESS} -eq 0 ]; then
+		echo "Commit to respository for signed packages failed"
+		exit 1
+	fi
 
 	exit 1
Index: /issm/trunk/packagers/mac/test-issm-mac-binaries-matlab.sh
===================================================================
--- /issm/trunk/packagers/mac/test-issm-mac-binaries-matlab.sh	(revision 26743)
+++ /issm/trunk/packagers/mac/test-issm-mac-binaries-matlab.sh	(revision 26744)
@@ -11,5 +11,5 @@
 #
 INSTALL_DIR=.
-MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2006,2020,2021,2051,2052,2053,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2004,2006,2051,2052,2053,2084,2085,2424,2425,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
 MATLAB_PATH="/Applications/MATLAB_R2018a.app"
 PKG="ISSM-macOS-MATLAB"
Index: /issm/trunk/packagers/mac/test-issm-mac-binaries-python.sh
===================================================================
--- /issm/trunk/packagers/mac/test-issm-mac-binaries-python.sh	(revision 26743)
+++ /issm/trunk/packagers/mac/test-issm-mac-binaries-python.sh	(revision 26744)
@@ -12,5 +12,5 @@
 INSTALL_DIR=.
 PKG="ISSM-macOS-Python"
-PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2006 2020 2021 2051 2052 2053 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2004 2006 2007 2051 2052 2053 2084 2085 2424 2425 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
 
 COMPRESSED_PKG="${PKG}.zip"
Index: /issm/trunk/packagers/mac/transfer-issm-mac-binaries.sh
===================================================================
--- /issm/trunk/packagers/mac/transfer-issm-mac-binaries.sh	(revision 26744)
+++ /issm/trunk/packagers/mac/transfer-issm-mac-binaries.sh	(revision 26744)
@@ -0,0 +1,89 @@
+#!/bin/bash
+
+################################################################################
+# Transfers ISSM distributable package for macOS with MATLAB API to ISSM Web 
+# site.
+#
+# NOTE:
+# - Assumes that the following constants are defined,
+#
+#		COMPRESSED_PKG
+#		ISSM_BINARIES_REPO_PASS
+#		ISSM_BINARIES_REPO_USER
+#		SIGNED_REPO_COPY
+#		SIGNED_REPO_URL
+#
+# See also:
+# - packagers/mac/complete-issm-mac-binaries-matlab.sh
+# - packagers/mac/complete-issm-mac-binaries-python.sh
+################################################################################
+
+# Expand aliases within the context of this script
+shopt -s expand_aliases
+
+# From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
+#
+#	Command line tool support for Subversion — including svn, git-svn, and 
+#	related commands — is no longer provided by Xcode. (50266910)
+#
+# which results in,
+#
+#	svn: error: The subversion command line tools are no longer provided by 
+#	Xcode.
+#
+# when calling svn, even when subversion is installed via Homebrew and its path 
+# is available in PATH.
+#
+# NOTE: May be able to remove this after updating macOS.
+#
+alias svn='/usr/local/bin/svn'
+
+## Override certain other aliases
+#
+alias cp=$(which cp)
+alias grep=$(which grep)
+
+## Functions
+#
+checkout_signed_repo_copy(){
+	echo "Checking out copy of repository for signed packages"
+
+	# NOTE: Get empty copy because we do not want to have to check out package 
+	#		from previous signing.
+	#
+	svn checkout \
+		--trust-server-cert \
+		--non-interactive \
+		--depth empty \
+		--username ${ISSM_BINARIES_REPO_USER} \
+		--password ${ISSM_BINARIES_REPO_USER} \
+		${SIGNED_REPO_URL} \
+		${SIGNED_REPO_COPY} > /dev/null 2>&1
+}
+validate_signed_repo_copy(){
+	# Validate copy of repository for signed binaries (e.g. 
+	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
+	# initial checkout failed)
+	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
+		rm -rf ${SIGNED_REPO_COPY}
+		checkout_signed_repo_copy
+	fi
+}
+
+# Check if working copy of repository for signed packages is missing
+validate_signed_repo_copy
+
+# Retrieve signed and notarized package
+svn update \
+	--username ${ISSM_BINARIES_REPO_USER} \
+	--password ${ISSM_BINARIES_REPO_PASS} \
+	${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
+
+# Transfer signed package to ISSM Web site
+echo "Transferring signed package to ISSM Web site"
+scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
+
+if [ $? -ne 0 ]; then
+	echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip building, packaging, and signing)."
+	exit 1
+fi
Index: /issm/trunk/scripts/DownloadExamplesDatasets.sh
===================================================================
--- /issm/trunk/scripts/DownloadExamplesDatasets.sh	(revision 26744)
+++ /issm/trunk/scripts/DownloadExamplesDatasets.sh	(revision 26744)
@@ -0,0 +1,39 @@
+#!/bin/bash
+################################################################################
+# This script downloads all datasets needed for running the ISSM tutorials.
+#
+# The default behavior is to download datasets to the examples/Data directory 
+# relative to this script. An alternate output directory can be designated by 
+# supplying a command line argument.
+#
+# NOTE:
+# - This script does not clobber existing files, intentionally. To download and 
+#	unzip new copies, first remove existing files manually.
+################################################################################
+
+## Constants
+#
+DATASETS_URL="https://issm.jpl.nasa.gov/documentation/tutorials/datasets"
+DIRECTORY_PREFIX=$(cd $(dirname "$0"); pwd)"/../examples/Data" # Default behavior is to download datasets to examples/Data directory relative to this script
+
+if [ $# -gt 0 ]; then
+	DIRECTORY_PREFIX=$1
+
+	if [ ! -d "${DIRECTORY_PREFIX}" ]; then
+		mkdir -p "${DIRECTORY_PREFIX}"
+	fi
+fi
+
+# Get content of page that hosts datasets, reduce to just datasets list, then 
+# parse out dataset links
+dataset_urls=$(\
+	curl -Ls ${DATASETS_URL} |\
+	sed '/<!--DATASETS LIST START-->/,/<!--DATASETS LIST END-->/ !d' |\
+	sed -n 's/.*<li><a href="\([^"]*\)">.*/\1/p'
+)
+
+# Get datasets
+wget --no-clobber --directory-prefix="${DIRECTORY_PREFIX}" -i - <<< "${dataset_urls}"
+
+# Expand zip files
+unzip -n -d "${DIRECTORY_PREFIX}" "${DIRECTORY_PREFIX}/*.zip"
Index: /issm/trunk/scripts/DownloadExternalPackage.sh
===================================================================
--- /issm/trunk/scripts/DownloadExternalPackage.sh	(revision 26743)
+++ /issm/trunk/scripts/DownloadExternalPackage.sh	(revision 26744)
@@ -42,11 +42,11 @@
 
 ## Download file
-#
-if [ ! -z `which wget` ]
+
+if [ ! -z `which curl` ]
+then
+	curl --silent $URL -o $OUT_FILE
+elif [ ! -z `which wget` ]
 then
 	wget --quiet -O $OUT_FILE $URL
-elif [ ! -z `which curl` ]
-then
-	curl --silent $URL -o $OUT_FILE
 else
 	echo $MSG_ERR_NO_GET_CMD
Index: sm/trunk/scripts/installExternalPackages.sh
===================================================================
--- /issm/trunk/scripts/installExternalPackages.sh	(revision 26743)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#!/bin/bash
-
-#Jenkins xml files for individual packages
-EXTERNAL_TEST_FILE="$ISSM_DIR/nightlylog/results/external.xml"
-mkdir -p $ISSM_DIR/nightlylog/results
-echo "<testsuite tests=\"$NUMPACKAGES\">" > $EXTERNAL_TEST_FILE
-
-source $ISSM_DIR/BuildConfig/externalpackages
-
-#number of packages: 
-NUMPACKAGES=$(($(echo $EXTERNALPACKAGES | wc -w )/2))
-for ((i=1;i<=$NUMPACKAGES;i++))
-do
-	NUM1=$((2*$i-1))
-	NUM2=$((2*$i))
-	PACKAGENAME=$(echo $EXTERNALPACKAGES | cut -d " " -f $NUM1-$NUM1)
-	PACKAGEINST=$(echo $EXTERNALPACKAGES | cut -d " " -f $NUM2-$NUM2)
-
-	cd $ISSM_DIR/externalpackages/$PACKAGENAME
-
-	#install if requested or if previous install has not been successful
-	echo "======================================================";
-	echo "       Installing $PACKAGENAME                        ";
-	echo "======================================================";
-	echo "<testcase classname=\"externalpackages\" name=\"$PACKAGENAME\">" >> $EXTERNAL_TEST_FILE
-	./$PACKAGEINST |  tee compil.log
-	if [ $? -ne 0 ]; then
-		echo "======================================================";
-		echo "    ERROR: installation of $PACKAGENAME failed        ";
-		echo "======================================================";
-		echo '<failure message="failure">' >> $EXTERNAL_TEST_FILE
-		cat ./compil.log >> $EXTERNAL_TEST_FILE
-		echo '</failure>' >> $EXTERNAL_TEST_FILE
-		exit 1
-	else
-		echo '<success message="success">' >> $EXTERNAL_TEST_FILE
-		cat ./compil.log >> $EXTERNAL_TEST_FILE
-		echo '</success>' >> $EXTERNAL_TEST_FILE
-		touch SUCCESS
-	fi
-	echo '</testcase>' >> $EXTERNAL_TEST_FILE
-	source $ISSM_DIR/etc/environment.sh
-done
-echo '</testsuite>' >> $EXTERNAL_TEST_FILE
Index: sm/trunk/scripts/test-issm-linux-binaries-solid_earth.sh
===================================================================
--- /issm/trunk/scripts/test-issm-linux-binaries-solid_earth.sh	(revision 26743)
+++ 	(revision )
@@ -1,81 +1,0 @@
-#!/bin/bash
-
-# This script is intended to test binaries downloaded to a user-end machine.
-#
-# NOTE: Tarball must already exist in INSTALL_DIR
-#
-
-MATLAB_NROPTIONS="'benchmark','slr'"
-MATLAB_PATH="/usr/local/MATLAB/R2019b"
-INSTALL_DIR=~/Downloads
-PACKAGE_NAME="ISSM-Solid_Earth"
-PYTHON_NROPTIONS="--benchmark slr"
-TARBALL_NAME="issm-linux-solid_earth"
-TARBALL="${TARBALL_NAME}.tar.gz"
-
-export ISSM_DIR="${INSTALL_DIR}/${PACKAGE_NAME}"
-export PATH="${PATH}:${ISSM_DIR}/bin:${ISSM_DIR}/scripts"
-
-cd ${INSTALL_DIR}
-rm -rf ${PACKAGE_NAME}
-tar -zxvf ${TARBALL}
-cd ${PACKAGE_NAME}/test/NightlyRun
-
-# Check that MATLAB tests run
-echo "Running MATLAB tests"
-rm matlab.log 2> /dev/null
-
-# Run MATLAB tests redirecting output to logfile and suppressing output to console
-${MATLAB_PATH}/bin/matlab -nosplash -nodesktop -nojvm -r "try, addpath ../../bin; addpath ../../lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
-
-# Check that MATLAB did not exit in error
-matlabExitCode=`echo $?`
-matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
-
-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
-	echo "----------MATLAB exited in error!----------"
-	cat matlab.log
-	echo "-----------End of matlab.log-----------"
-	exit 1
-fi
-
-# Check that all MATLAB tests passed
-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
-
-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
-	echo "One or more MATLAB tests FAILED"
-	exit 1
-else
-	echo "All MATLAB tests PASSED"
-fi
-
-# Check that Python tests run
-echo "Running Python tests"
-
-export PYTHONPATH="${ISSM_DIR}/scripts"
-export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
-export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
-
-rm python.log 2> /dev/null
-./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
-
-# Check that Python did not exit in error
-pythonExitCode=`echo $?`
-pythonExitedInError=`grep -E "runme.py: error" python.log | wc -l`
-
-if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
-	echo "----------Python exited in error!----------"
-	cat python.log
-	echo "-----------End of python.log-----------"
-	exit 1
-fi
-
-# Check that all Python tests passed
-numPythonTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
-
-if [[ ${numPythonTestsFailed} -ne 0 ]]; then
-	echo "One or more Python tests FAILED"
-	exit 1
-else
-	echo "All Python tests PASSED"
-fi
Index: sm/trunk/scripts/test-issm-linux-binaries-with_dakota.sh
===================================================================
--- /issm/trunk/scripts/test-issm-linux-binaries-with_dakota.sh	(revision 26743)
+++ 	(revision )
@@ -1,83 +1,0 @@
-#!/bin/bash
-
-# This script is intended to test binaries downloaded to a user-end machine.
-#
-# NOTE: Tarball must already exist in INSTALL_DIR
-#
-
-MATLAB_NROPTIONS="'id',[IdFromString('Dakota')]"
-MATLAB_PATH="/usr/local/MATLAB/R2019b"
-INSTALL_DIR=~/Downloads
-PACKAGE_NAME="ISSM"
-PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 418 420"
-TARBALL_NAME="issm-linux-with_dakota"
-TARBALL="${TARBALL_NAME}.tar.gz"
-
-export ISSM_DIR="${INSTALL_DIR}/${PACKAGE_NAME}"
-export PATH="${PATH}:${ISSM_DIR}/bin:${ISSM_DIR}/scripts"
-
-cd ${INSTALL_DIR}
-rm -rf ${PACKAGE_NAME}
-tar -zxvf ${TARBALL}
-cd ${PACKAGE_NAME}/test/NightlyRun
-
-# Check that MATLAB tests run
-echo "Running MATLAB tests"
-rm matlab.log 2> /dev/null
-
-# Run MATLAB tests redirecting output to logfile and suppressing output to console
-${MATLAB_PATH}/bin/matlab -nosplash -nodesktop -nojvm -r "try, addpath ../../bin; addpath ../../lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
-
-# Check that MATLAB did not exit in error
-matlabExitCode=`echo $?`
-matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
-
-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
-	echo "----------MATLAB exited in error!----------"
-	cat matlab.log
-	echo "-----------End of matlab.log-----------"
-	exit 1
-fi
-
-# Check that all MATLAB tests passed
-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
-
-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
-	echo "One or more MATLAB tests FAILED"
-	exit 1
-else
-	echo "All MATLAB tests PASSED"
-fi
-
-# Check that Python tests run
-echo "Running Python tests"
-
-export ISSM_DIR="${INSTALL_DIR}"
-export PATH="${PATH}:${ISSM_DIR}/bin"
-export PYTHONPATH="${ISSM_DIR}/scripts"
-export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
-export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
-
-rm python.log 2> /dev/null
-./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
-
-# Check that Python did not exit in error
-pythonExitCode=`echo $?`
-pythonExitedInError=`grep -E "runme.py: error" python.log | wc -l`
-
-if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
-	echo "----------Python exited in error!----------"
-	cat python.log
-	echo "-----------End of python.log-----------"
-	exit 1
-fi
-
-# Check that all Python tests passed
-numPythonTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
-
-if [[ ${numPythonTestsFailed} -ne 0 ]]; then
-	echo "One or more Python tests FAILED"
-	exit 1
-else
-	echo "All Python tests PASSED"
-fi
Index: sm/trunk/scripts/test-issm-linux-binaries.sh
===================================================================
--- /issm/trunk/scripts/test-issm-linux-binaries.sh	(revision 26743)
+++ 	(revision )
@@ -1,49 +1,0 @@
-#!/bin/bash
-
-# This script is intended to test binaries downloaded to a user-end machine.
-#
-# NOTE: Tarball must already exist in INSTALL_DIR
-#
-
-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
-MATLAB_PATH="/usr/local/MATLAB/R2019b"
-INSTALL_DIR=~/Downloads
-PACKAGE_NAME="ISSM"
-TARBALL_NAME="issm-linux"
-TARBALL="${TARBALL_NAME}.tar.gz"
-
-export ISSM_DIR="${INSTALL_DIR}/${PACKAGE_NAME}"
-export PATH="${PATH}:${ISSM_DIR}/bin:${ISSM_DIR}/scripts"
-
-cd ${INSTALL_DIR}
-rm -rf ${PACKAGE_NAME}
-tar -zxvf ${TARBALL}
-cd ${PACKAGE_NAME}/test/NightlyRun
-
-# Check that MATLAB tests run
-echo "Running MATLAB tests"
-rm matlab.log 2> /dev/null
-
-# Run MATLAB tests redirecting output to logfile and suppressing output to console
-${MATLAB_PATH}/bin/matlab -nosplash -nodesktop -nojvm -r "try, addpath ../../bin; addpath ../../lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
-
-# Check that MATLAB did not exit in error
-matlabExitCode=`echo $?`
-matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
-
-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
-	echo "----------MATLAB exited in error!----------"
-	cat matlab.log
-	echo "-----------End of matlab.log-----------"
-	exit 1
-fi
-
-# Check that all MATLAB tests passed
-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
-
-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
-	echo "One or more MATLAB tests FAILED"
-	exit 1
-else
-	echo "All MATLAB tests PASSED"
-fi
Index: /issm/trunk/src/Makefile.am
===================================================================
--- /issm/trunk/src/Makefile.am	(revision 26743)
+++ /issm/trunk/src/Makefile.am	(revision 26744)
@@ -1,2 +1,2 @@
 EXTRA_DIST =  perl
-SUBDIRS = c m wrappers mobile
+SUBDIRS = c m wrappers
Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 26743)
+++ /issm/trunk/src/c/Makefile.am	(revision 26744)
@@ -1,3 +1,3 @@
-AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @MPIINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJINCL@ @ESMFINCL@
+AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @TRIANGLEINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @MPIINCL@ @PARMETISINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJINCL@ @ESMFINCL@ @PROJINCL@
 AM_FCFLAGS = @SEMICINCL@
 
@@ -6,7 +6,10 @@
 EXEEXT=$(ISSMEXT)
 
-#Library declaration {{{
+# Library declaration {{{
 if !WINDOWS
-lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la
+lib_LTLIBRARIES = libISSMCore.la
+if !MSYS2
+lib_LTLIBRARIES += libISSMOverload.la
+endif
 if WRAPPERS
 lib_LTLIBRARIES += libISSMModules.la
@@ -20,8 +23,8 @@
 #}}}
 
-#Core sources
+# Core sources
 issm_sources =
 
-#BAMG sources  {{{
+# BAMG sources {{{
 if BAMG
 issm_sources += \
@@ -54,5 +57,5 @@
 	./modules/BamgTriangulatex/BamgTriangulatex.cpp
 
-#do not include AmrBamg with AD
+# Do not include AmrBamg with AD
 if ADOLC
 issm_sources += \
@@ -68,5 +71,5 @@
 endif
 #}}}
-#Core sources{{{
+# Core sources {{{
 issm_sources += \
 	./datastructures/DataSet.cpp \
@@ -88,4 +91,5 @@
 	./classes/Cfdragcoeffabsgrad.cpp \
 	./classes/Cfsurfacelogvel.cpp \
+	./classes/Cflevelsetmisfit.cpp \
 	./classes/Regionaloutput.cpp \
 	./classes/Nodalvalue.cpp \
@@ -94,4 +98,5 @@
 	./classes/Hook.cpp \
 	./classes/Radar.cpp \
+	./classes/BarystaticContributions.cpp \
 	./classes/ExternalResults/Results.cpp \
 	./classes/Elements/Element.cpp \
@@ -182,4 +187,6 @@
 	./shared/Elements/DrainageFunctionWaterfraction.cpp \
 	./shared/Elements/EstarComponents.cpp \
+	./shared/Random/random.cpp \
+	./shared/Random/randomgenerator.cpp \
 	./shared/String/DescriptorIndex.cpp \
 	./toolkits/issm/IssmToolkitUtils.cpp \
@@ -191,4 +198,5 @@
 	./toolkits/mpi/commops/GetOwnershipBoundariesFromRange.cpp \
 	./toolkits/ToolkitOptions.cpp \
+	./modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp\
 	./modules/ModelProcessorx/ModelProcessorx.cpp \
 	./modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp \
@@ -208,4 +216,5 @@
 	./modules/NodalValuex/NodalValuex.cpp \
 	./modules/VertexCoordinatesx/VertexCoordinatesx.cpp \
+	./modules/ElementCoordinatesx/ElementCoordinatesx.cpp \
 	./modules/OutputResultsx/OutputResultsx.cpp \
 	./modules/InputDepthAverageAtBasex/InputDepthAverageAtBasex.cpp \
@@ -239,8 +248,10 @@
 	./modules/ResetFSBasalBoundaryConditionx/ResetFSBasalBoundaryConditionx.cpp \
 	./modules/Solverx/Solverx.cpp \
+	./modules/StochasticForcingx/StochasticForcingx.cpp \
 	./modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp \
 	./cores/ProcessArguments.cpp \
 	./cores/ResetBoundaryConditions.cpp \
 	./cores/WrapperCorePointerFromSolutionEnum.cpp \
+	./cores/WrapperPreCorePointerFromSolutionEnum.cpp \
 	./cores/CorePointerFromSolutionEnum.cpp \
 	./cores/ad_core.cpp \
@@ -256,4 +267,5 @@
 	./solutionsequences/solutionsequence_fct.cpp \
 	./solutionsequences/solutionsequence_schurcg.cpp \
+	./solutionsequences/solutionsequence_sampling.cpp \
 	./solutionsequences/convergence.cpp \
 	./classes/Options/Options.cpp \
@@ -264,4 +276,5 @@
 	./cores/steadystate_core.cpp \
 	./cores/masstransport_core.cpp \
+	./cores/oceantransport_core.cpp \
 	./cores/depthaverage_core.cpp \
 	./cores/extrudefrombase_core.cpp \
@@ -334,5 +347,5 @@
 	./classes/Inputs/ArrayInput.cpp
 #}}}
-#ADJOINTMPI/MeDiPack sources {{{
+# ADJOINTMPI/MeDiPack sources {{{
 if ADJOINTMPI
 issm_sources += ./toolkits/codipack/ampi_interface.cpp
@@ -341,6 +354,6 @@
 issm_sources += ./toolkits/codipack/ampi_interface.cpp
 endif
-# }}}
-#DAKOTA sources  {{{
+#}}}
+# DAKOTA sources {{{
 if DAKOTA
 issm_sources += \
@@ -359,5 +372,5 @@
 endif
 #}}}
-#Petsc sources  {{{
+# PETSc sources {{{
 if PETSC
 issm_sources += \
@@ -365,5 +378,5 @@
 	./toolkits/petsc/patches \
 	./toolkits/petsc/patches/VecToMPISerial.cpp \
-	./toolkits/petsc/patches/MatToSerial.cpp \
+	./toolkits/petsc/patches/MatToMPISerial.cpp \
 	./toolkits/petsc/patches/NewVec.cpp \
 	./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp \
@@ -381,20 +394,20 @@
 endif
 #}}}
-#Mumps sources  {{{
+# MUMPS sources {{{
 if MUMPS
 issm_sources += ./toolkits/mumps/MumpsSolve.cpp
 endif
 #}}}
-#Gsl sources  {{{
+#GSL sources {{{
 if GSL
 issm_sources += ./toolkits/gsl/DenseGslSolve.cpp
 endif
 #}}}
-#proj sources  {{{
+# PROJ sources {{{
 if PROJ
 issm_sources += ./modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp
 endif
 #}}}
-#Analyses{{{
+# Analyses {{{
 if ADJOINTBALANCETHICKNESS
 issm_sources += ./analyses/AdjointBalancethicknessAnalysis.cpp
@@ -446,4 +459,8 @@
 issm_sources += ./analyses/HydrologyShreveAnalysis.cpp
 endif
+if HYDROLOGYTWS
+issm_sources += ./analyses/HydrologyTwsAnalysis.cpp
+endif
+
 if HYDROLOGYSHAKTI
 issm_sources += ./analyses/HydrologyShaktiAnalysis.cpp
@@ -469,4 +486,7 @@
 if MASSTRANSPORT
 issm_sources += ./analyses/MasstransportAnalysis.cpp
+endif
+if OCEANTRANSPORT
+issm_sources += ./analyses/OceantransportAnalysis.cpp
 endif
 if SMB
@@ -504,10 +524,49 @@
 endif
 #}}}
-#Gia sources (only if have fortran){{{
-if GIA
+# Love sources (only if have Fortran) {{{
+if LOVE
 if FORTRAN
 issm_sources += \
-	./cores/gia_core.cpp \
-	./analyses/GiaAnalysis.cpp \
+	./cores/love_core.cpp \
+	./analyses/LoveAnalysis.cpp \
+	./modules/FourierLoveCorex/FourierLoveCorex.cpp \
+	./modules/FourierLoveCorex/lnb_param.f90 \
+	./modules/FourierLoveCorex/model.f90 \
+	./modules/FourierLoveCorex/util.f90 \
+	./modules/FourierLoveCorex/lovenb_sub.f90 \
+	./modules/FourierLoveCorex/love_numbers.f90
+endif
+endif
+#}}}
+# Esa sources {{{
+if ESA
+issm_sources += \
+	./cores/esa_core.cpp \
+	./analyses/EsaAnalysis.cpp
+endif
+#}}}
+# Ocean sources {{{
+if OCEAN
+issm_sources += ./modules/OceanExchangeDatax/OceanExchangeDatax.cpp
+endif
+#}}}
+# Sampling sources {{{
+if SAMPLING
+issm_sources += \
+	./cores/sampling_core.cpp \
+	./analyses/SamplingAnalysis.cpp
+endif
+#}}}
+# SLC sources {{{
+if SEALEVELCHANGE
+issm_sources += \
+	./cores/sealevelchange_core.cpp \
+	./analyses/SealevelchangeAnalysis.cpp\
+	./classes/GrdLoads.cpp\
+	./classes/SealevelGeometry.cpp
+
+# GIA Ivins physics (only if have Fortran)
+if FORTRAN
+issm_sources += \
 	./modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp \
 	./modules/GiaDeflectionCorex/distme.f \
@@ -519,51 +578,18 @@
 	./modules/GiaDeflectionCorex/what0.f
 endif
-endif
-#}}}
-#Love sources (only if have fortran){{{
-if LOVE
-if FORTRAN
-issm_sources += \
-	./cores/love_core.cpp \
-	./analyses/LoveAnalysis.cpp \
-	./modules/FourierLoveCorex/FourierLoveCorex.cpp \
-	./modules/FourierLoveCorex/lnb_param.f90 \
-	./modules/FourierLoveCorex/model.f90 \
-	./modules/FourierLoveCorex/util.f90 \
-	./modules/FourierLoveCorex/lovenb_sub.f90 \
-	./modules/FourierLoveCorex/love_numbers.f90
-endif
-endif
-#}}}
-#Esa sources  {{{
-if ESA
-issm_sources += \
-	./cores/esa_core.cpp \
-	./analyses/EsaAnalysis.cpp
-endif
-#}}}
-#Oceansources  {{{
-if OCEAN
-issm_sources += ./modules/OceanExchangeDatax/OceanExchangeDatax.cpp
-endif
-#}}}
-#Slr sources  {{{
-if SEALEVELRISE
-issm_sources += \
-	./cores/sealevelchange_core.cpp \
-	./analyses/SealevelriseAnalysis.cpp
-endif
-#}}}
-#Metis sources  {{{
+
+endif
+#}}}
+# METIS sources {{{
 if METIS
 issm_sources += ./toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
 endif
 #}}}
-#Esmf sources  {{{
+# Esmf sources {{{
 if ESMF
 issm_sources += ./main/esmfbinders.cpp
 endif
 #}}}
-#SEMIC sources  {{{
+# SEMIC sources {{{
 if SEMIC
 if FORTRAN
@@ -572,6 +598,6 @@
 endif
 #}}}
-#Wrapper sources
-#Kml sources  {{{
+# Wrapper sources
+# Kml sources {{{
 kml_sources = \
 	./modules/Exp2Kmlx/Exp2Kmlx.cpp \
@@ -609,8 +635,8 @@
 	./kml/KMLFileReadUtils.cpp
 #}}}
-#NEOPZ sources  {{{
+# NEOPZ sources {{{
 neopz_sources = ./classes/AmrNeopz.cpp
 #}}}
-#Modules sources{{{
+# Modules sources {{{
 modules_sources = \
 	./shared/Threads/LaunchThread.cpp \
@@ -641,5 +667,5 @@
 	./modules/NodeConnectivityx/NodeConnectivityx.cpp \
 	./modules/ElementConnectivityx/ElementConnectivityx.cpp \
-	./modules/PropagateFlagsFromConnectivityx/PropagateFlagsFromConnectivityx.cpp 
+	./modules/PropagateFlagsFromConnectivityx/PropagateFlagsFromConnectivityx.cpp
 
 if CHACO
@@ -655,6 +681,6 @@
 #}}}
 
-#kriging (WRAPPER and executable)
-#Kriging sources  {{{
+# Kriging (wrapper and executable)
+# Kriging sources {{{
 if KRIGING
 issm_sources += \
@@ -674,14 +700,19 @@
 endif
 #}}}
-#Library flags and sources {{{
-ALLCXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
+# Library flags and sources {{{
+ALL_CXXFLAGS = $(CXXFLAGS) $(CXXOPTFLAGS)
+
+if MSYS2
+ALL_CXXFLAGS += -D_DO_NOT_LOAD_GLOBALS_ # Cannot have undefined symbols under MSYS2
+ALL_CXXFLAGS += -D_USE_MATH_DEFINES # Need to open fence to math.h definitions when --std=c++ is used (which is the default)
+endif
 
 libISSMCore_la_SOURCES  = $(issm_sources)
-libISSMCore_la_CXXFLAGS = $(ALLCXXFLAGS) $(DAKOTAFLAGS)
+libISSMCore_la_CXXFLAGS = $(ALL_CXXFLAGS) $(DAKOTAFLAGS)
 libISSMCore_la_FFLAGS = $(AM_FFLAGS)
 
 if !WINDOWS
 if !STANDALONE_LIBRARIES
-libISSMCore_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
+libISSMCore_la_LIBADD = $(CHACOLIB) $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(OSLIBS)
 if FORTRAN
 libISSMCore_la_LIBADD += $(FLIBS) $(FORTRANLIB)
@@ -704,10 +735,10 @@
 endif
 
-libISSMModules_la_CXXFLAGS = $(ALLCXXFLAGS)
+libISSMModules_la_CXXFLAGS = $(ALL_CXXFLAGS)
 if !WINDOWS
 if STANDALONE_LIBRARIES
 libISSMModules_la_LIBADD = ./libISSMCore.la
 else
-libISSMModules_la_LIBADD = ./libISSMCore.la $(TRIANGLELIB) $(CHACOLIB)
+libISSMModules_la_LIBADD = ./libISSMCore.la $(TRIANGLELIB) $(CHACOLIB) $(BLASLAPACKLIB) $(OSLIBS)
 endif
 endif
@@ -736,27 +767,44 @@
 endif
 
+if VERSION
+libISSMCore_la_LDFLAGS =
+if WRAPPERS
+libISSMModules_la_LDFLAGS =
+endif
+else
+libISSMCore_la_LDFLAGS = -avoid-version
+if WRAPPERS
+libISSMModules_la_LDFLAGS = -avoid-version
+endif
+endif
+
 if STANDALONE_LIBRARIES
-libISSMCore_la_LDFLAGS = -static
-libISSMOverload_la_LDFLAGS = -static
+libISSMCore_la_LDFLAGS += -static
 if WRAPPERS
-libISSMModules_la_LDFLAGS = -static
-else
-libISSMModules_la_LDFLAGS =
-endif
-else
-libISSMCore_la_LDFLAGS =
+libISSMModules_la_LDFLAGS += -static
+endif
+endif
+#}}}
+
+if !MSYS2
+# Overload library, to overload any non-standard symbols {{{
+libISSMOverload_la_SOURCES = ./shared/String/ApiPrintf.cpp
+libISSMOverload_la_CFLAGS  = -D_C_ -fPIC $(COPTFLAGS) $(CFLAGS)
+
+if VERSION
 libISSMOverload_la_LDFLAGS =
-endif
-
-#}}}
-#Overload library, to overload any non-standard symbols. {{{
-libISSMOverload_la_SOURCES = ./shared/String/ApiPrintf.cpp
-
-libISSMOverload_la_CFLAGS  = -D_C_ -fPIC $(COPTFLAGS) $(CFLAGS)
-#}}}
-#Executable {{{
+else
+libISSMOverload_la_LDFLAGS = -avoid-version
+endif
+
+if STANDALONE_LIBRARIES
+libISSMOverload_la_LDFLAGS += -static
+endif
+endif
+#}}}
+# Executable {{{
 if ANDROID
 if ANDROIDEXE
-bin_PROGRAMS = issm issm_slr
+bin_PROGRAMS = issm issm_slc
 else
 bin_PROGRAMS =
@@ -766,16 +814,21 @@
 bin_PROGRAMS =
 else
-bin_PROGRAMS = issm issm_slr
-endif
-endif
-
-#Standard libraries
-LDADD = ./libISSMCore.la ./libISSMOverload.la
+bin_PROGRAMS = issm issm_slc
+endif
+endif
+
+# Standard libraries
+LDADD = ./libISSMCore.la
+
+if !MSYS2
+LDADD += ./libISSMOverload.la
+endif
+
 if WRAPPERS
 LDADD += ./libISSMModules.la $(TRIANGLELIB)
 endif
 
-#External packages
-LDADD += $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(PETSCLIB) $(HDF5LIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(ESMFLIB)
+# External packages
+LDADD += $(CHACOLIB) $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HDF5LIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(ESMFLIB) $(OSLIBS)
 
 if FORTRAN
@@ -783,9 +836,9 @@
 endif
 
-issm_SOURCES = main/issm.cpp 
+issm_SOURCES = main/issm.cpp
 issm_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
 
-issm_slr_SOURCES = main/issm_slr.cpp
-issm_slr_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
+issm_slc_SOURCES = main/issm_slc.cpp
+issm_slc_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
 
 if OCEAN
Index: /issm/trunk/src/c/analyses/AdjointBalancethickness2Analysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 26744)
@@ -28,4 +28,7 @@
 /*Finite Element Analysis*/
 void           AdjointBalancethickness2Analysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           AdjointBalancethickness2Analysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/AdjointBalancethickness2Analysis.h
===================================================================
--- /issm/trunk/src/c/analyses/AdjointBalancethickness2Analysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/AdjointBalancethickness2Analysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 26744)
@@ -28,4 +28,7 @@
 /*Finite Element Analysis*/
 void           AdjointBalancethicknessAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           AdjointBalancethicknessAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
@@ -148,5 +151,5 @@
 	xDelete<IssmDouble>(basis);
 	xDelete<IssmDouble>(dbasis);
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	delete gauss;
 	return pe;
@@ -224,9 +227,9 @@
 	/*Transpose and return Ke*/
 	Ke->Transpose();
-	_assert_(Ke->nrows == numvertices && Ke->ncols == numvertices);
+	_assert_(Ke->nrows == numvertices);
 
 	for(int i=0;i<numvertices;i++){
 		for(int j=0;j<numvertices;j++){
-			ge[i] += Ke->values[i*Ke->ncols + j] * lambda[j];
+			ge[i] += Ke->values[i*Ke->nrows + j] * lambda[j];
 		}
 		//ge[i]=-lambda[i];
Index: /issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/AdjointHorizAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26744)
@@ -28,4 +28,7 @@
 /*Finite Element Analysis*/
 void AdjointHorizAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void AdjointHorizAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
@@ -49,4 +52,8 @@
 		case FSApproximationEnum: 
 			return CreateKMatrixFS(element);
+      case MLHOApproximationEnum:
+		// a more accurate option, but integrate in the vertical direction numerically.
+		//	return CreateKMatrixMLHOVerticalIntergrated(element);
+			return CreateKMatrixMLHO(element);
 		case NoneApproximationEnum:
 			return NULL;
@@ -147,5 +154,5 @@
 }/*}}}*/
 ElementMatrix* AdjointHorizAnalysis::CreateKMatrixHO(Element* element){/*{{{*/
-	
+
 	/* Check if ice in element */
 	if(!element->IsIceInElement()) return NULL;
@@ -213,4 +220,277 @@
 	return Ke;
 }/*}}}*/
+ElementMatrix* AdjointHorizAnalysis::CreateKMatrixMLHO(Element* element){/*{{{*/
+
+	/* Check if ice in element */
+	if(!element->IsIceInElement()) return NULL;
+
+	/*Intermediaries */
+	bool        incomplete_adjoint;
+	IssmDouble  Jdet,mu_prime,n,thickness,mu,effmu;
+	IssmDouble *xyz_list = NULL;
+	IssmDouble  viscosity[9]; //9 mu for different integrand
+   int			domaintype;
+	int			dim=2;
+
+	IssmDouble  eb1i,eb1j,esh1i,esh1j,eb2i,eb2j,esh2i,esh2j;
+	IssmDouble  epsilon[5],epsilonbase[5],epsilonshear[5];/* epsilon=[exx,eyy,exy,exz,eyz];*/
+	IssmDouble  e1b[2], e2b[2], e1sh[2], e2sh[2];
+	IssmDouble  vxshear, vyshear;
+
+   Element* basalelement;
+
+   /*Get basal element*/
+   element->FindParam(&domaintype,DomainTypeEnum);
+   switch(domaintype){
+      case Domain2DhorizontalEnum:
+         basalelement = element;
+         break;
+      case Domain3DEnum: case Domain2DverticalEnum:
+         _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+         break;
+      default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+   }
+	/*Fetch number of nodes and dof for this finite element*/
+   int numnodes = basalelement->GetNumberOfNodes();
+   IssmDouble* dbasis = xNew<IssmDouble>(2*numnodes); // like SSA
+   IssmDouble* basis  = xNew<IssmDouble>(numnodes); // like SSA
+
+	/*Initialize Jacobian with regular HO (first part of the Gateau derivative)*/
+	element->FindParam(&incomplete_adjoint,InversionIncompleteAdjointEnum);
+	StressbalanceAnalysis* analysis = new StressbalanceAnalysis();
+	ElementMatrix* Ke=analysis->CreateKMatrix(basalelement);
+	delete analysis;
+	if(incomplete_adjoint) return Ke;
+
+	/*Retrieve all inputs and parameters*/
+	element->GetVerticesCoordinates(&xyz_list);
+   Input* vx_input       = element->GetInput(VxEnum);        _assert_(vx_input); //vertically integrated vx
+   Input* vy_input       = element->GetInput(VyEnum);        _assert_(vy_input); //vertically integrated vy
+   Input* vxbase_input   = element->GetInput(VxBaseEnum);    _assert_(vxbase_input);
+   Input* vybase_input   = element->GetInput(VyBaseEnum);    _assert_(vybase_input);
+   Input* vxshear_input  = element->GetInput(VxShearEnum);   _assert_(vxshear_input);
+   Input* vyshear_input  = element->GetInput(VyShearEnum);   _assert_(vyshear_input);
+   Input* thickness_input= element->GetInput(ThicknessEnum); _assert_(thickness_input);
+   Input* n_input        = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
+
+	/* Start  looping on the number of gaussian points: */
+   Gauss* gauss      = element->NewGauss(5);
+   Gauss* gauss_base = basalelement->NewGauss();
+   while(gauss->next()){
+      gauss->SynchronizeGaussBase(gauss_base);
+
+      element->JacobianDeterminant(&Jdet,xyz_list,gauss_base);
+      basalelement->NodalFunctionsDerivatives(dbasis,xyz_list,gauss_base);
+      basalelement->NodalFunctions(basis, gauss_base);
+
+      thickness_input->GetInputValue(&thickness, gauss);
+      n_input->GetInputValue(&n,gauss);
+
+      vxshear_input->GetInputValue(&vxshear,gauss);
+      vyshear_input->GetInputValue(&vyshear,gauss);
+
+		element->material->ViscosityMLHOAdjoint(&viscosity[0],dim,xyz_list,gauss,vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input);
+
+		effmu = 2.0*(1-n)/2.0/n;
+
+		element->StrainRateHO(&epsilonbase[0],xyz_list,gauss,vxbase_input, vybase_input);
+		element->StrainRateHO(&epsilonshear[0],xyz_list,gauss,vxshear_input, vyshear_input);
+
+		e1b[0] = 2*epsilonbase[0]+epsilonbase[1];		e1b[1] = epsilonbase[2];
+		e2b[1] = epsilonbase[0]+2*epsilonbase[1];		e2b[0] = epsilonbase[2];
+
+		e1sh[0] = 2*epsilonshear[0]+epsilonshear[1];		e1sh[1] = epsilonshear[2];
+		e2sh[1] = epsilonshear[0]+2*epsilonshear[1];		e2sh[0] = epsilonshear[2];
+
+		for(int i=0;i<numnodes;i++){
+			for(int j=0;j<numnodes;j++){
+				eb1i = e1b[0]*dbasis[0*numnodes+i]+e1b[1]*dbasis[1*numnodes+i];
+				eb1j = e1b[0]*dbasis[0*numnodes+j]+e1b[1]*dbasis[1*numnodes+j];
+				eb2i = e2b[0]*dbasis[0*numnodes+i]+e2b[1]*dbasis[1*numnodes+i];
+				eb2j = e2b[0]*dbasis[0*numnodes+j]+e2b[1]*dbasis[1*numnodes+j];
+            esh1i = e1sh[0]*dbasis[0*numnodes+i]+e1sh[1]*dbasis[1*numnodes+i];
+            esh1j = e1sh[0]*dbasis[0*numnodes+j]+e1sh[1]*dbasis[1*numnodes+j];
+            esh2i = e2sh[0]*dbasis[0*numnodes+i]+e2sh[1]*dbasis[1*numnodes+i];
+            esh2j = e2sh[0]*dbasis[0*numnodes+j]+e2sh[1]*dbasis[1*numnodes+j];
+
+				Ke->values[4*numnodes*(4*i+0)+4*j+0]+=gauss->weight*Jdet*effmu*(viscosity[0]*eb1j*eb1i+viscosity[1]*(esh1j*eb1i+eb1j*esh1i)+viscosity[2]*esh1j*esh1i);
+				Ke->values[4*numnodes*(4*i+1)+4*j+0]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb1j*eb1i+viscosity[2]*(esh1j*eb1i+eb1j*esh1i)+viscosity[4]*esh1j*esh1i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*eb1j*basis[i]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*esh1j*basis[i]);
+				Ke->values[4*numnodes*(4*i+2)+4*j+0]+=gauss->weight*Jdet*effmu*(viscosity[0]*eb1j*eb2i+viscosity[1]*(esh1j*eb2i+eb1j*esh2i)+viscosity[2]*esh1j*esh2i);
+				Ke->values[4*numnodes*(4*i+3)+4*j+0]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb1j*eb2i+viscosity[2]*(esh1j*eb2i+eb1j*esh2i)+viscosity[4]*esh1j*esh2i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*eb1j*basis[i]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*esh1j*basis[i]);
+
+				Ke->values[4*numnodes*(4*i+0)+4*j+1]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb1j*eb1i+viscosity[2]*(esh1j*eb1i+eb1j*esh1i)+viscosity[4]*esh1j*esh1i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*eb1i*basis[j]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*esh1i*basis[j]);
+				Ke->values[4*numnodes*(4*i+1)+4*j+1]+=gauss->weight*Jdet*effmu*(viscosity[2]*eb1j*eb1i+viscosity[4]*(esh1j*eb1i+eb1j*esh1i)+viscosity[5]*esh1j*esh1i+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*(eb1i*basis[j]+eb1j*basis[i])+viscosity[7]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*(esh1i*basis[j]+esh1j*basis[i])+viscosity[8]*(n+1)*(n+1)*(n+1)*(n+1)/4.0/thickness/thickness/thickness/thickness*vxshear*vxshear*basis[j]*basis[i]);
+				Ke->values[4*numnodes*(4*i+2)+4*j+1]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb1j*eb2i+viscosity[2]*(esh1j*eb2i+eb1j*esh2i)+viscosity[4]*esh1j*esh2i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*eb2i*basis[j]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*esh2i*basis[j]);
+				Ke->values[4*numnodes*(4*i+3)+4*j+1]+=gauss->weight*Jdet*effmu*(viscosity[2]*eb1j*eb2i+viscosity[4]*(esh1j*eb2i+eb1j*esh2i)+viscosity[5]*esh1j*esh2i+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*(vxshear*eb2i*basis[j]+vyshear*eb1j*basis[i])+viscosity[7]*(n+1)*(n+1)/2.0/thickness/thickness*(vxshear*esh2i*basis[j]+vyshear*esh1j*basis[i])+viscosity[8]*(n+1)*(n+1)*(n+1)*(n+1)/4.0/thickness/thickness/thickness/thickness*vxshear*vyshear*basis[j]*basis[i]);
+				
+
+				Ke->values[4*numnodes*(4*i+0)+4*j+2]+=gauss->weight*Jdet*effmu*(viscosity[0]*eb2j*eb1i+viscosity[1]*(esh2j*eb1i+eb2j*esh1i)+viscosity[2]*esh2j*esh1i);
+				Ke->values[4*numnodes*(4*i+1)+4*j+2]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb2j*eb1i+viscosity[2]*(esh2j*eb1i+eb2j*esh1i)+viscosity[4]*esh2j*esh1i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*eb2j*basis[i]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*esh2j*basis[i]);
+				Ke->values[4*numnodes*(4*i+2)+4*j+2]+=gauss->weight*Jdet*effmu*(viscosity[0]*eb2j*eb2i+viscosity[1]*(esh2j*eb2i+eb2j*esh2i)+viscosity[2]*esh2j*esh2i);
+				Ke->values[4*numnodes*(4*i+3)+4*j+2]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb2j*eb2i+viscosity[2]*(esh2j*eb2i+eb2j*esh2i)+viscosity[4]*esh2j*esh2i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*eb2j*basis[i]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*esh2j*basis[i]);
+
+
+				Ke->values[4*numnodes*(4*i+0)+4*j+3]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb2j*eb1i+viscosity[2]*(esh2j*eb1i+eb2j*esh1i)+viscosity[4]*esh2j*esh1i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*eb1i*basis[j]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*esh1i*basis[j]);
+				Ke->values[4*numnodes*(4*i+1)+4*j+3]+=gauss->weight*Jdet*effmu*(viscosity[2]*eb2j*eb1i+viscosity[4]*(esh2j*eb1i+eb2j*esh1i)+viscosity[5]*esh2j*esh1i+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*(vyshear*eb1i*basis[j]+vxshear*eb2j*basis[i])+viscosity[7]*(n+1)*(n+1)/2.0/thickness/thickness*(vxshear*esh2j*basis[i]+vyshear*esh1i*basis[j])+viscosity[8]*(n+1)*(n+1)*(n+1)*(n+1)/4.0/thickness/thickness/thickness/thickness*vxshear*vxshear*basis[j]*basis[i]);
+				Ke->values[4*numnodes*(4*i+2)+4*j+3]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb2j*eb2i+viscosity[2]*(esh2j*eb2i+eb2j*esh2i)+viscosity[4]*esh2j*esh2i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*eb2i*basis[j]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*esh2i*basis[j]);
+				Ke->values[4*numnodes*(4*i+3)+4*j+3]+=gauss->weight*Jdet*effmu*(viscosity[2]*eb2j*eb2i+viscosity[4]*(esh2j*eb2i+eb2j*esh2i)+viscosity[5]*esh2j*esh2i+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*(eb2i*basis[j]+eb1j*basis[i])+viscosity[7]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*(esh2i*basis[j]+esh1j*basis[i])+viscosity[8]*(n+1)*(n+1)*(n+1)*(n+1)/4.0/thickness/thickness/thickness/thickness*vyshear*vyshear*basis[j]*basis[i]);
+			}
+		}
+	}
+
+	/*Transform Coordinate System*/
+	/*element->TransformStiffnessMatrixCoord(Ke,XYEnum);*/
+
+   /*Clean up and return*/
+   delete gauss;
+   delete gauss_base;
+   if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+   xDelete<IssmDouble>(xyz_list);
+   xDelete<IssmDouble>(dbasis);
+   xDelete<IssmDouble>(basis);
+   return Ke;
+}/*}}}*/
+ElementMatrix* AdjointHorizAnalysis::CreateKMatrixMLHOVerticalIntergrated(Element* element){/*{{{*/
+
+	/* Check if ice in element */
+	if(!element->IsIceInElement()) return NULL;
+
+	/*Intermediaries */
+	bool        incomplete_adjoint;
+	IssmDouble  Jdet,mu_prime,n,thickness,mu,effmu;
+	IssmDouble *xyz_list = NULL;
+	IssmDouble	zeta, epsilon_eff;
+   int			domaintype;
+	int			dim=2;
+
+	IssmDouble  e1phi1i, e1phi1j, e2phi1i, e2phi1j, e1phi2i, e1phi2j, e2phi2i, e2phi2j;
+	IssmDouble  epsilon[5];/* epsilon=[exx,eyy,exy,exz,eyz];*/
+	IssmDouble	e1[3],e2[3];
+
+   Element* basalelement;
+
+   /*Get basal element*/
+   element->FindParam(&domaintype,DomainTypeEnum);
+   switch(domaintype){
+      case Domain2DhorizontalEnum:
+         basalelement = element;
+         break;
+      case Domain3DEnum: case Domain2DverticalEnum:
+         _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+         break;
+      default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+   }
+	/*Fetch number of nodes and dof for this finite element*/
+   int numnodes = basalelement->GetNumberOfNodes();
+   IssmDouble* dbasis = xNew<IssmDouble>(2*numnodes); // like SSA
+   IssmDouble* basis  = xNew<IssmDouble>(numnodes); // like SSA
+
+	/*Initialize Jacobian with regular HO (first part of the Gateau derivative)*/
+	element->FindParam(&incomplete_adjoint,InversionIncompleteAdjointEnum);
+	StressbalanceAnalysis* analysis = new StressbalanceAnalysis();
+	ElementMatrix* Ke=analysis->CreateKMatrix(basalelement);
+	delete analysis;
+	if(incomplete_adjoint) return Ke;
+
+	/*Retrieve all inputs and parameters*/
+	element->GetVerticesCoordinates(&xyz_list);
+   Input* vxbase_input   = element->GetInput(VxBaseEnum);    _assert_(vxbase_input);
+   Input* vybase_input   = element->GetInput(VyBaseEnum);    _assert_(vybase_input);
+   Input* vxshear_input  = element->GetInput(VxShearEnum);   _assert_(vxshear_input);
+   Input* vyshear_input  = element->GetInput(VyShearEnum);   _assert_(vyshear_input);
+   Input* thickness_input= element->GetInput(ThicknessEnum); _assert_(thickness_input);
+   Input* n_input        = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
+
+	/* Start  looping on the number of gaussian points: */
+   Gauss* gauss      = element->NewGauss(10);
+   Gauss* gauss_base = basalelement->NewGauss();
+	
+	GaussSeg* gauss_seg=new GaussSeg(5);
+
+   while(gauss->next()){
+      gauss->SynchronizeGaussBase(gauss_base);
+
+      element->JacobianDeterminant(&Jdet,xyz_list,gauss_base);
+      basalelement->NodalFunctionsDerivatives(dbasis,xyz_list,gauss_base);
+      basalelement->NodalFunctions(basis, gauss_base);
+
+      thickness_input->GetInputValue(&thickness, gauss);
+      n_input->GetInputValue(&n,gauss);
+
+		effmu = 2*(1-n)/2.0/n;
+
+		/* Get the integration in the vertical direction */
+		gauss_seg->Reset();
+		while(gauss_seg->next()){
+			/*Compute zeta for gauss_seg point (0=surface, 1=base)*/
+	      zeta=0.5*(gauss_seg->coord1+1);
+
+		   /* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exz^2 + eyz^2 + exx*eyy (for a given zeta)*/
+			element->StrainRateMLHO(&epsilon[0],xyz_list,gauss,
+                  vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input,zeta);
+			epsilon_eff=sqrt(epsilon[0]*epsilon[0] + epsilon[1]*epsilon[1] + epsilon[2]*epsilon[2]
+                    +  epsilon[3]*epsilon[3] + epsilon[4]*epsilon[4] + epsilon[0]*epsilon[1]);
+
+			/*Get viscosity at zeta*/
+			element->material->GetViscosity(&mu,epsilon_eff,gauss);
+			/*the adjoint viscosity with zeta dependent term*/
+			mu = mu /epsilon_eff/epsilon_eff;
+
+			e1[0] = 2.0*epsilon[0]+epsilon[1];
+			e1[1] = epsilon[2];
+			e1[2] = epsilon[3];
+	
+			e2[0] = epsilon[2];
+			e2[1] = epsilon[0]+2.0*epsilon[1];
+			e2[2] = epsilon[4];
+
+			for(int i=0;i<numnodes;i++){
+				for(int j=0;j<numnodes;j++){
+					e1phi1i = e1[0]*dbasis[0*numnodes+i]+e1[1]*dbasis[1*numnodes+i];
+					e2phi1i = e2[0]*dbasis[0*numnodes+i]+e2[1]*dbasis[1*numnodes+i];
+					e1phi1j = e1[0]*dbasis[0*numnodes+j]+e1[1]*dbasis[1*numnodes+j];
+					e2phi1j = e2[0]*dbasis[0*numnodes+j]+e2[1]*dbasis[1*numnodes+j];
+	
+					e1phi2i = (1-pow(zeta, n+1))*(e1[0]*dbasis[0*numnodes+i]+e1[1]*dbasis[1*numnodes+i])+(n+1)/thickness*pow(zeta, n)*e1[2]*basis[i];
+					e2phi2i = (1-pow(zeta, n+1))*(e2[0]*dbasis[0*numnodes+i]+e2[1]*dbasis[1*numnodes+i])+(n+1)/thickness*pow(zeta, n)*e2[2]*basis[i];
+					e1phi2j = (1-pow(zeta, n+1))*(e1[0]*dbasis[0*numnodes+j]+e1[1]*dbasis[1*numnodes+j])+(n+1)/thickness*pow(zeta, n)*e1[2]*basis[j];
+					e2phi2j = (1-pow(zeta, n+1))*(e2[0]*dbasis[0*numnodes+j]+e2[1]*dbasis[1*numnodes+j])+(n+1)/thickness*pow(zeta, n)*e2[2]*basis[j];
+
+					Ke->values[4*numnodes*(4*i+0)+4*j+0]+=gauss->weight*Jdet*effmu*mu*e1phi1i*e1phi1j*thickness*0.5*gauss_seg->weight;
+					Ke->values[4*numnodes*(4*i+1)+4*j+0]+=gauss->weight*Jdet*effmu*mu*e1phi2i*e1phi1j*thickness*0.5*gauss_seg->weight;
+					Ke->values[4*numnodes*(4*i+2)+4*j+0]+=gauss->weight*Jdet*effmu*mu*e2phi1i*e1phi1j*thickness*0.5*gauss_seg->weight;
+					Ke->values[4*numnodes*(4*i+3)+4*j+0]+=gauss->weight*Jdet*effmu*mu*e2phi2i*e1phi1j*thickness*0.5*gauss_seg->weight;
+					
+					Ke->values[4*numnodes*(4*i+0)+4*j+1]+=gauss->weight*Jdet*effmu*mu*e1phi1i*e1phi2j*thickness*0.5*gauss_seg->weight;
+					Ke->values[4*numnodes*(4*i+1)+4*j+1]+=gauss->weight*Jdet*effmu*mu*e1phi2i*e1phi2j*thickness*0.5*gauss_seg->weight;
+					Ke->values[4*numnodes*(4*i+2)+4*j+1]+=gauss->weight*Jdet*effmu*mu*e2phi1i*e1phi2j*thickness*0.5*gauss_seg->weight;
+					Ke->values[4*numnodes*(4*i+3)+4*j+1]+=gauss->weight*Jdet*effmu*mu*e2phi2i*e1phi2j*thickness*0.5*gauss_seg->weight;
+					
+					Ke->values[4*numnodes*(4*i+0)+4*j+2]+=gauss->weight*Jdet*effmu*mu*e1phi1i*e2phi1j*thickness*0.5*gauss_seg->weight;
+					Ke->values[4*numnodes*(4*i+1)+4*j+2]+=gauss->weight*Jdet*effmu*mu*e1phi2i*e2phi1j*thickness*0.5*gauss_seg->weight;
+					Ke->values[4*numnodes*(4*i+2)+4*j+2]+=gauss->weight*Jdet*effmu*mu*e2phi1i*e2phi1j*thickness*0.5*gauss_seg->weight;
+					Ke->values[4*numnodes*(4*i+3)+4*j+2]+=gauss->weight*Jdet*effmu*mu*e2phi2i*e2phi1j*thickness*0.5*gauss_seg->weight;
+
+					Ke->values[4*numnodes*(4*i+0)+4*j+3]+=gauss->weight*Jdet*effmu*mu*e1phi1i*e2phi2j*thickness*0.5*gauss_seg->weight;
+					Ke->values[4*numnodes*(4*i+1)+4*j+3]+=gauss->weight*Jdet*effmu*mu*e1phi2i*e2phi2j*thickness*0.5*gauss_seg->weight;
+					Ke->values[4*numnodes*(4*i+2)+4*j+3]+=gauss->weight*Jdet*effmu*mu*e2phi1i*e2phi2j*thickness*0.5*gauss_seg->weight;
+					Ke->values[4*numnodes*(4*i+3)+4*j+3]+=gauss->weight*Jdet*effmu*mu*e2phi2i*e2phi2j*thickness*0.5*gauss_seg->weight;
+				}
+			}
+		}
+	}
+	/*Transform Coordinate System*/
+	/*element->TransformStiffnessMatrixCoord(Ke,XYEnum);*/
+
+   /*Clean up and return*/
+   delete gauss;
+   delete gauss_base;
+	delete gauss_seg;
+   if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+   xDelete<IssmDouble>(xyz_list);
+   xDelete<IssmDouble>(dbasis);
+   xDelete<IssmDouble>(basis);
+   return Ke;
+}/*}}}*/
 ElementMatrix* AdjointHorizAnalysis::CreateKMatrixL1L2(Element* element){/*{{{*/
 
@@ -268,5 +548,5 @@
 	delete analysis;
 	if(incomplete_adjoint){
-		if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 		return Ke;
 	}
@@ -316,5 +596,5 @@
 	xDelete<IssmDouble>(dbasis);
 	xDelete<IssmDouble>(xyz_list);
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return Ke;
 }/*}}}*/
@@ -332,4 +612,6 @@
 		case FSApproximationEnum: 
 			return CreatePVectorFS(element);
+      case MLHOApproximationEnum:
+			return CreatePVectorMLHO(element);
 		case NoneApproximationEnum:
 			return NULL;
@@ -507,5 +789,5 @@
 					for(i=0;i<vnumnodes;i++){
 						if (domaintype!=Domain2DverticalEnum){
-							scale=1./(S*2*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
+							scale=1./(S*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
 							dux=scale*(vxobs-vx);
 							duy=scale*(vyobs-vy);
@@ -514,5 +796,5 @@
 						}
 						else{
-							scale=1./(S*2*fabs(vx-vxobs)+epsvel);
+							scale=1./(S*fabs(vx-vxobs)+epsvel);
 							dux=scale*(vxobs-vx);
 							pe->values[i*2+0]+=dux*weight*Jdet*gauss->weight*vbasis[i]; 
@@ -743,5 +1025,5 @@
 					for(i=0;i<numnodes;i++){
 						if(domaintype!=Domain2DverticalEnum){
-							scale=1./(S*2*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
+							scale=1./(S*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
 							dux=scale*(vxobs-vx);
 							duy=scale*(vyobs-vy);
@@ -816,4 +1098,259 @@
 	return pe;
 
+}/*}}}*/
+ElementVector* AdjointHorizAnalysis::CreatePVectorMLHO(Element* element){/*{{{*/
+
+	/*Intermediaries*/
+	int      domaintype;
+	Element* basalelement;
+
+	/* Check if ice in element */
+	if(!element->IsIceInElement()) return NULL;
+
+	/*Get basal element*/
+	element->FindParam(&domaintype,DomainTypeEnum);
+	switch(domaintype){
+		case Domain2DhorizontalEnum:
+			basalelement = element;
+			break;
+		case Domain2DverticalEnum:
+			if(!element->IsOnBase()) return NULL;
+			basalelement = element->SpawnBasalElement();
+			break;
+		case Domain3DEnum:
+			if(!element->IsOnBase()) return NULL;
+			basalelement = element->SpawnBasalElement(true);
+			break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+
+	/*Intermediaries */
+	int         num_responses,i;
+	IssmDouble  Jdet,obs_velocity_mag,velocity_mag;
+	IssmDouble  vx,vy,vxobs,vyobs,dux,duy,weight;
+	IssmDouble scalex,scaley,scale,S,thickness,n;
+	int        *responses = NULL;
+	IssmDouble *xyz_list  = NULL;
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numnodes = basalelement->GetNumberOfNodes();
+
+	/*Initialize Element vector and vectors*/
+	ElementVector* pe    = basalelement->NewElementVector(MLHOApproximationEnum);
+	IssmDouble*    basis = xNew<IssmDouble>(numnodes);
+
+	/*Retrieve all inputs and parameters*/
+	basalelement->GetVerticesCoordinates(&xyz_list);
+	basalelement->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+	basalelement->FindParam(&responses,NULL,InversionCostFunctionsEnum);
+	DatasetInput* weights_input = basalelement->GetDatasetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+	Input* vx_input      = basalelement->GetInput(VxSurfaceEnum);                                        _assert_(vx_input);
+	Input* vxobs_input   = basalelement->GetInput(InversionVxObsEnum);                                   _assert_(vxobs_input);
+   Input* thickness_input=basalelement->GetInput(ThicknessEnum);													  _assert_(thickness_input);
+   Input*     n_input        =element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
+	Input* vy_input=NULL;
+	Input* vyobs_input=NULL;
+	if(domaintype!=Domain2DverticalEnum){
+		vy_input      = basalelement->GetInput(VySurfaceEnum);       _assert_(vy_input);
+		vyobs_input   = basalelement->GetInput(InversionVyObsEnum);  _assert_(vyobs_input);
+	}
+	IssmDouble epsvel  = 2.220446049250313e-16;
+	IssmDouble meanvel = 3.170979198376458e-05; /*1000 m/yr*/
+
+	/*Get Surface if required by one response*/
+	Input* S_input = NULL;
+	for(int resp=0;resp<num_responses;resp++){
+		if(responses[resp]==SurfaceAverageVelMisfitEnum){
+			S_input = element->GetInput(SurfaceAreaEnum);  _assert_(S_input); break;
+		}
+	}
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=basalelement->NewGauss(4);
+	while(gauss->next()){
+
+		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
+		basalelement->NodalFunctions(basis, gauss);
+      
+		thickness_input->GetInputValue(&thickness,gauss);
+      n_input->GetInputValue(&n,gauss);
+		vx_input->GetInputValue(&vx,gauss);
+		vxobs_input->GetInputValue(&vxobs,gauss);
+		if(domaintype!=Domain2DverticalEnum){
+			vy_input->GetInputValue(&vy,gauss);
+			vyobs_input->GetInputValue(&vyobs,gauss);
+		}
+		/*Loop over all requested responses*/
+		for(int resp=0;resp<num_responses;resp++){
+			weights_input->GetInputValue(&weight,gauss,responses[resp]);
+
+			switch(responses[resp]){
+				case SurfaceAbsVelMisfitEnum:
+					/*
+					 *      1  [           2              2 ]
+					 * J = --- | (u - u   )  +  (v - v   )  |
+					 *      2  [       obs            obs   ]
+					 *
+					 *        dJ
+					 * DU = - -- = (u   - u )
+					 *        du     obs
+					 */
+					for(i=0;i<numnodes;i++){
+						if(domaintype!=Domain2DverticalEnum){
+							dux=vxobs-vx;
+							duy=vyobs-vy;
+							pe->values[i*4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+							pe->values[i*4+1]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+							pe->values[i*4+2]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+							pe->values[i*4+3]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+						}
+						else {
+							_error_("2D vertical is not implemented for MLHO");
+						}
+					}
+					break;
+				case SurfaceRelVelMisfitEnum:
+					/*
+					 *      1  [     \bar{v}^2             2   \bar{v}^2              2 ]
+					 * J = --- | -------------  (u - u   ) + -------------  (v - v   )  |
+					 *      2  [  (u   + eps)^2       obs    (v   + eps)^2       obs    ]
+					 *              obs                        obs                      
+					 *
+					 *        dJ     \bar{v}^2
+					 * DU = - -- = ------------- (u   - u )
+					 *        du   (u   + eps)^2    obs
+					 *               obs
+					 */
+					for(i=0;i<numnodes;i++){
+						if(domaintype!=Domain2DverticalEnum){
+							scalex=pow(meanvel/(vxobs+epsvel),2); if(vxobs==0)scalex=0;
+							scaley=pow(meanvel/(vyobs+epsvel),2); if(vyobs==0)scaley=0;
+							dux=scalex*(vxobs-vx);
+							duy=scaley*(vyobs-vy);
+							pe->values[i*4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+							pe->values[i*4+1]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+							pe->values[i*4+2]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+							pe->values[i*4+3]+=duy*weight*Jdet*gauss->weight*basis[i];
+						}
+						else{
+							_error_("2D vertical is not implemented for MLHO");
+						}
+					}
+					break;
+				case SurfaceLogVelMisfitEnum:
+					/*
+					 *                 [        vel + eps     ] 2
+					 * J = 4 \bar{v}^2 | log ( -----------  ) |  
+					 *                 [       vel   + eps    ]
+					 *                            obs
+					 *
+					 *        dJ                 2 * log(...)
+					 * DU = - -- = - 4 \bar{v}^2 -------------  u
+					 *        du                 vel^2 + eps
+					 *            
+					 */
+					for(i=0;i<numnodes;i++){
+						if(domaintype!=Domain2DverticalEnum){
+							velocity_mag    =sqrt(pow(vx,   2)+pow(vy,   2))+epsvel;
+							obs_velocity_mag=sqrt(pow(vxobs,2)+pow(vyobs,2))+epsvel;
+							scale=-8*pow(meanvel,2)/pow(velocity_mag,2)*log(velocity_mag/obs_velocity_mag);
+							dux=scale*vx;
+							duy=scale*vy;
+							pe->values[i*4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+							pe->values[i*4+1]+=dux*weight*Jdet*gauss->weight*basis[i];
+							pe->values[i*4+2]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+							pe->values[i*4+3]+=duy*weight*Jdet*gauss->weight*basis[i];
+						}
+						else{
+							_error_("2D vertical is not implemented for MLHO");
+						}
+					}
+					break;
+				case SurfaceAverageVelMisfitEnum:
+					/*
+					 *      1                    2              2
+					 * J = ---  sqrt(  (u - u   )  +  (v - v   )  )
+					 *      S                obs            obs
+					 *
+					 *        dJ      1       1 
+					 * DU = - -- = - --- ----------- * 2 (u - u   )
+					 *        du      S  2 sqrt(...)           obs
+					 */
+					S_input->GetInputValue(&S,gauss);
+					for(i=0;i<numnodes;i++){
+						if(domaintype!=Domain2DverticalEnum){
+							scale=1./(S*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
+							dux=scale*(vxobs-vx);
+							duy=scale*(vyobs-vy);
+							pe->values[i*4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+							pe->values[i*4+1]+=dux*weight*Jdet*gauss->weight*basis[i];
+							pe->values[i*4+2]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+							pe->values[i*4+3]+=duy*weight*Jdet*gauss->weight*basis[i];
+						}
+						else{
+							_error_("2D vertical is not implemented for MLHO");
+						}
+					}
+					break;
+				case SurfaceLogVxVyMisfitEnum:
+					/*
+					 *      1            [        |u| + eps     2          |v| + eps     2  ]
+					 * J = --- \bar{v}^2 | log ( -----------  )   +  log ( -----------  )   |  
+					 *      2            [       |u    |+ eps              |v    |+ eps     ]
+					 *                              obs                       obs
+					 *        dJ                              1      u                             1
+					 * DU = - -- = - \bar{v}^2 log(u...) --------- ----  ~ - \bar{v}^2 log(u...) ------
+					 *        du                         |u| + eps  |u|                           u + eps
+					 */
+					for(i=0;i<numnodes;i++){
+						if(domaintype!=Domain2DverticalEnum){
+							dux = - meanvel*meanvel * log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)) / (vx+epsvel);
+							duy = - meanvel*meanvel * log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)) / (vy+epsvel);
+							pe->values[i*4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+							pe->values[i*4+1]+=dux*weight*Jdet*gauss->weight*basis[i];
+							pe->values[i*4+2]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+							pe->values[i*4+3]+=duy*weight*Jdet*gauss->weight*basis[i];
+						}
+						else{
+							_error_("2D vertical is not implemented for MLHO");
+						}
+					}
+					break;
+				case DragCoefficientAbsGradientEnum:
+					/*Nothing in P vector*/
+					break;
+				case ThicknessAbsGradientEnum:
+					/*Nothing in P vector*/
+					break;
+				case ThicknessAlongGradientEnum:
+					/*Nothing in P vector*/
+					break;
+				case ThicknessAcrossGradientEnum:
+					/*Nothing in P vector*/
+					break;
+				case RheologyBbarAbsGradientEnum:
+					/*Nothing in P vector*/
+					break;
+				case RheologyBAbsGradientEnum:
+					/*Nothing in P vector*/
+					break;
+				case RheologyBInitialguessMisfitEnum:
+					/*Nothing in P vector*/
+					break;
+				default:
+					_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+			}
+		}
+	}
+
+	/*Transform coordinate system*/
+	//if(domaintype!=Domain2DverticalEnum)	basalelement->TransformLoadVectorCoord(pe,XYEnum);
+	/*Clean up and return*/
+	xDelete<int>(responses);
+	xDelete<IssmDouble>(xyz_list);
+	xDelete<IssmDouble>(basis);
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+	delete gauss;
+	return pe;
 }/*}}}*/
 ElementVector* AdjointHorizAnalysis::CreatePVectorSSA(Element* element){/*{{{*/
@@ -995,5 +1532,5 @@
 					for(i=0;i<numnodes;i++){
 						if(domaintype!=Domain2DverticalEnum){
-							scale=1./(S*2*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
+							scale=1./(S*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
 							dux=scale*(vxobs-vx);
 							duy=scale*(vyobs-vy);
@@ -1002,5 +1539,5 @@
 						}
 						else{
-							scale=1./(S*2*fabs(vx-vxobs)+epsvel);
+							scale=1./(S*fabs(vx-vxobs)+epsvel);
 							dux=scale*(vxobs-vx);
 							pe->values[i]+=dux*weight*Jdet*gauss->weight*basis[i]; 
@@ -1065,5 +1602,5 @@
 	xDelete<IssmDouble>(xyz_list);
 	xDelete<IssmDouble>(basis);
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	delete gauss;
 	return pe;
@@ -1126,4 +1663,5 @@
 				case L1L2ApproximationEnum:GradientJDragL1L2(element,gradient,control_interp,control_index); break;
 				case HOApproximationEnum:  GradientJDragHO( element,gradient,control_interp,control_index); break;
+				case MLHOApproximationEnum:  GradientJDragMLHO( element,gradient,control_interp,control_index); break;
 				case FSApproximationEnum:  GradientJDragFS( element,gradient,control_interp,control_index); break;
 				case NoneApproximationEnum: /*Gradient is 0*/                    break;
@@ -1146,4 +1684,5 @@
 				case L1L2ApproximationEnum:GradientJBbarL1L2(element,gradient,control_interp,control_index); break;
 				case HOApproximationEnum:  GradientJBbarHO( element,gradient,control_interp,control_index); break;
+				case MLHOApproximationEnum:  GradientJBbarMLHO( element,gradient,control_interp,control_index); break;
 				case FSApproximationEnum:  GradientJBbarFS( element,gradient,control_interp,control_index); break;
 				case NoneApproximationEnum: /*Gradient is 0*/                    break;
@@ -1155,4 +1694,5 @@
 				case SSAApproximationEnum: GradientJBSSA(element,gradient,control_interp,control_index); break;
 				case HOApproximationEnum:  GradientJBHO( element,gradient,control_interp,control_index); break;
+			//	case MLHOApproximationEnum:  GradientJBMLHO( element,gradient,control_interp,control_index); break;
 				case FSApproximationEnum:  GradientJBFS( element,gradient,control_interp,control_index); break;
 				case NoneApproximationEnum: /*Gradient is 0*/                    break;
@@ -1183,4 +1723,6 @@
 	int      domaintype;
 	Element* basalelement;
+
+	if(control_interp==P0Enum) _error_("cannot require regularization for P0 controls");
 
 	/*Get basal element*/
@@ -1250,5 +1792,5 @@
 	xDelete<int>(vertexpidlist);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 }/*}}}*/
 void           AdjointHorizAnalysis::GradientJBbarL1L2(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
@@ -1261,4 +1803,132 @@
 	/*WARNING: We use SSA as an estimate for now*/
 	this->GradientJBbarSSA(element,gradient,control_interp,control_index);
+}/*}}}*/
+void           AdjointHorizAnalysis::GradientJBbarMLHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+
+   if(control_interp!=P1Enum) _error_("not implemented yet...");
+	/*Intermediaries*/
+	int      domaintype,dim;
+	Element* basalelement;
+
+	/*Get basal element*/
+	element->FindParam(&domaintype,DomainTypeEnum);
+	switch(domaintype){
+		case Domain2DhorizontalEnum:
+			basalelement = element;
+			dim          = 2;
+			break;
+		case Domain2DverticalEnum:
+			if(!element->IsOnBase()) return;
+			basalelement = element->SpawnBasalElement();
+			dim          = 1;
+			break;
+		case Domain3DEnum:
+			if(!element->IsOnBase()) return;
+			basalelement = element->SpawnBasalElement(true);
+			dim          = 2;
+			break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+
+	/*Intermediaries*/
+	IssmDouble Jdet,weight;
+	IssmDouble thickness,dmudB,n;
+	IssmDouble dvx[3],dvy[3],dadjbx[3],dadjby[3],dadjshx[3],dadjshy[3]; 
+	IssmDouble *xyz_list= NULL;
+
+	/*Fetch number of vertices for this finite element*/
+	int numvertices = basalelement->GetNumberOfVertices();
+
+	/*Initialize some vectors*/
+	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
+	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
+	int*        vertexpidlist = xNew<int>(numvertices);
+	IssmDouble  zeta;
+   IssmDouble  e1[3],e2[3], phishx[3], phishy[3];
+   IssmDouble  epsilon[5];/* epsilon=[exx,eyy,exy,exz,eyz];*/
+	IssmDouble  adjshx, adjshy;
+
+	/*Retrieve all inputs we will be needing: */
+	basalelement->GetVerticesCoordinates(&xyz_list);
+	basalelement->GradientIndexing(&vertexpidlist[0],control_index);
+	Input* thickness_input	= basalelement->GetInput(ThicknessEnum);					_assert_(thickness_input);
+   Input* n_input				= basalelement->GetInput(MaterialsRheologyNEnum);		_assert_(n_input);
+   Input* vxbase_input		= basalelement->GetInput(VxBaseEnum);						_assert_(vxbase_input);
+   Input* vybase_input		= basalelement->GetInput(VyBaseEnum);						_assert_(vybase_input);
+   Input* vxshear_input		= basalelement->GetInput(VxShearEnum);						_assert_(vxshear_input);
+   Input* vyshear_input		= basalelement->GetInput(VyShearEnum);						_assert_(vyshear_input);
+
+	Input* adjointbx_input	= basalelement->GetInput(AdjointxBaseEnum);				_assert_(adjointbx_input);
+	Input* adjointby_input	= basalelement->GetInput(AdjointyBaseEnum);				_assert_(adjointby_input);
+	Input* adjointshx_input	= basalelement->GetInput(AdjointxShearEnum);				_assert_(adjointshx_input);
+	Input* adjointshy_input	= basalelement->GetInput(AdjointyShearEnum);				_assert_(adjointshy_input);
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=basalelement->NewGauss(5);
+   GaussSeg* gauss_seg=new GaussSeg(2);
+
+	while(gauss->next()){
+
+		thickness_input->GetInputValue(&thickness,gauss);
+	   n_input->GetInputValue(&n,gauss);
+		adjointbx_input->GetInputDerivativeValue(&dadjbx[0],xyz_list,gauss);
+		adjointby_input->GetInputDerivativeValue(&dadjby[0],xyz_list,gauss);
+		adjointshx_input->GetInputDerivativeValue(&dadjshx[0],xyz_list,gauss);
+		adjointshy_input->GetInputDerivativeValue(&dadjshy[0],xyz_list,gauss);
+		adjointshx_input->GetInputValue(&adjshx, gauss);
+		adjointshy_input->GetInputValue(&adjshy, gauss);
+		
+		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
+		basalelement->NodalFunctionsP1(basis,gauss);
+
+	   /* Get the integration in the vertical direction */
+      gauss_seg->Reset();
+      while(gauss_seg->next()){
+			zeta=0.5*(gauss_seg->coord1+1);
+
+			basalelement->StrainRateMLHO(&epsilon[0],xyz_list,gauss,
+                  vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input,zeta);
+
+			basalelement->dViscositydBMLHO(&dmudB,dim,xyz_list,gauss,vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input,zeta);
+
+			e1[0] = 2.0*epsilon[0]+epsilon[1];
+         e1[1] = epsilon[2];
+         e1[2] = epsilon[3];
+
+         e2[0] = epsilon[2];
+         e2[1] = epsilon[0]+2.0*epsilon[1];
+         e2[2] = epsilon[4];
+
+			phishx[0] = dadjbx[0] + (1-pow(zeta, n+1))*dadjshx[0];
+			phishx[1] = dadjbx[1] + (1-pow(zeta, n+1))*dadjshx[1];
+			phishx[2] = (n+1)/thickness*pow(zeta, n)*adjshx;
+			phishy[0] = dadjby[0] + (1-pow(zeta, n+1))*dadjshy[0];
+			phishy[1] = dadjby[1] + (1-pow(zeta, n+1))*dadjshy[1];
+			phishy[2] = (n+1)/thickness*pow(zeta, n)*adjshy;
+
+			/*Build gradient vector (actually -dJ/dB): */
+			for(int i=0;i<numvertices;i++){
+				for (int j=0;j<3;j++){
+					ge[i]+=(-dmudB)*2*(e1[j]*phishx[j]+e2[j]*phishy[j])*Jdet*gauss->weight*basis[i]*thickness*0.5*gauss_seg->weight;
+					_assert_(!xIsNan<IssmDouble>(ge[i]));
+				}
+			}
+		}
+	}
+	if(control_interp==P1Enum){
+		gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
+	}
+	else{
+		_error_("not supported");
+	}
+
+	/*Clean up and return*/
+	xDelete<IssmDouble>(xyz_list);
+	xDelete<IssmDouble>(basis);
+	xDelete<IssmDouble>(ge);
+	xDelete<int>(vertexpidlist);
+	delete gauss;
+	delete gauss_seg;
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 }/*}}}*/
 void           AdjointHorizAnalysis::GradientJBbarSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
@@ -1362,5 +2032,5 @@
 	xDelete<int>(vertexpidlist);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 }/*}}}*/
 void           AdjointHorizAnalysis::GradientJBFS(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
@@ -1372,4 +2042,6 @@
 	/*Intermediaries*/
 	int      domaintype;
+
+	if(control_interp==P0Enum) _error_("cannot require regularization for P0 controls");
 
 	/*Get basal element*/
@@ -1437,4 +2109,5 @@
 	/*Intermediaries*/
 	int      domaintype;
+	if(control_interp!=P1Enum) _error_("not implemented yet...");
 
 	/*Get basal element*/
@@ -1499,4 +2172,5 @@
 	/*Intermediaries*/
 	int      domaintype,dim;
+	if(control_interp!=P1Enum) _error_("not implemented yet...");
 
 	/*Get domaintype*/
@@ -1571,4 +2245,7 @@
 	delete gauss;
 }/*}}}*/
+void           AdjointHorizAnalysis::GradientJBMLHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+	_error_("not implemented yet...");
+}/*}}}*/
 void           AdjointHorizAnalysis::GradientJBSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
 
@@ -1576,4 +2253,5 @@
 	int      domaintype,dim;
 	Element* basalelement;
+	if(control_interp!=P1Enum) _error_("not implemented yet...");
 
 	/*Get basal element*/
@@ -1652,14 +2330,14 @@
 	xDelete<int>(vertexpidlist);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 }/*}}}*/
 void           AdjointHorizAnalysis::GradientJDragGradient(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
 
 	/*return if floating (gradient is 0)*/
-	if(element->IsFloating()) return;
+	if(element->IsAllFloating()) return;
+	if(control_interp==P0Enum) _error_("cannot require regularization for P0 controls");
 
 	/*Intermediaries*/
 	int      domaintype,dim;
-	int frictionlaw;
 	Element* basalelement;
 
@@ -1702,5 +2380,5 @@
 
 	/* get the friction law: if 2-Weertman, 11-Schoof, use a special name for the coefficient*/
-	element->FindParam(&frictionlaw, FrictionLawEnum);
+	int frictionlaw; element->FindParam(&frictionlaw, FrictionLawEnum);
 	Input* dragcoefficient_input;
 	switch(frictionlaw) {
@@ -1745,5 +2423,5 @@
 	xDelete<int>(vertexpidlist);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 
 }/*}}}*/
@@ -1751,6 +2429,7 @@
 
 	/*return if floating or not on bed (gradient is 0)*/
-	if(element->IsFloating()) return;
+	if(element->IsAllFloating()) return;
 	if(!element->IsOnBase()) return;
+	if(control_interp!=P1Enum) _error_("not implemented yet...");
 
 	/*Intermediaries*/
@@ -1790,5 +2469,18 @@
 		adjointz_input  = element->GetInput(AdjointzEnum);             _assert_(adjointz_input);
 	}
-	Input* dragcoeff_input = element->GetInput(FrictionCoefficientEnum);  _assert_(dragcoeff_input);
+	/* get the friction law: 1- Budd, 11-Schoof*/
+	int frictionlaw; element->FindParam(&frictionlaw, FrictionLawEnum);
+	Input* dragcoeff_input = NULL;
+	switch(frictionlaw) {
+		case 1:
+			dragcoeff_input = element->GetInput(FrictionCoefficientEnum); _assert_(dragcoeff_input);
+			break;
+		case 2:
+		case 11:
+			dragcoeff_input = element->GetInput(FrictionCEnum); _assert_(dragcoeff_input);
+			break;
+		default:
+			_error_("Friction law "<< frictionlaw <<" not supported in the inversion.");
+	}
 
 	/* Start  looping on the number of gaussian points: */
@@ -1851,5 +2543,5 @@
 
 	/*return if floating or not on bed (gradient is 0)*/
-	if(element->IsFloating()) return;
+	if(element->IsAllFloating()) return;
 	if(!element->IsOnBase()) return;
 
@@ -1882,9 +2574,23 @@
 	Input* adjointx_input  = element->GetInput(AdjointxEnum);             _assert_(adjointx_input);
 	Input* adjointy_input  = NULL;
-	Input* dragcoeff_input = element->GetInput(FrictionCoefficientEnum);  _assert_(dragcoeff_input);
 	if(domaintype!=Domain2DverticalEnum){
 		vy_input        = element->GetInput(VyEnum);                   _assert_(vy_input);
 		adjointy_input  = element->GetInput(AdjointyEnum);             _assert_(adjointy_input);
 	}
+	/* get the friction law: 1- Budd, 11-Schoof*/
+	int frictionlaw; element->FindParam(&frictionlaw, FrictionLawEnum);
+	Input* dragcoeff_input = NULL;
+	switch(frictionlaw) {
+		case 1:
+			dragcoeff_input = element->GetInput(FrictionCoefficientEnum); _assert_(dragcoeff_input);
+			break;
+		case 2:
+		case 11:
+			dragcoeff_input = element->GetInput(FrictionCEnum); _assert_(dragcoeff_input);
+			break;
+		default:
+			_error_("Friction law "<< frictionlaw <<" not supported in the inversion.");
+	}
+
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGaussBase(4);
@@ -1905,11 +2611,29 @@
 
 		/*Build gradient vector (actually -dJ/dD): */
-		for(int i=0;i<numvertices;i++){
-			if(domaintype!=Domain2DverticalEnum) ge[i]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
-			else ge[i]+=-2.*drag*dalpha2dk*(lambda*vx)*Jdet*gauss->weight*basis[i];
-			_assert_(!xIsNan<IssmDouble>(ge[i]));
-		}
-	}
-	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
+		if(control_interp==P1Enum){
+			for(int i=0;i<numvertices;i++){
+				if(domaintype!=Domain2DverticalEnum) ge[i]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
+				else ge[i]+=-2.*drag*dalpha2dk*(lambda*vx)*Jdet*gauss->weight*basis[i];
+				_assert_(!xIsNan<IssmDouble>(ge[i]));
+			}
+		}
+		else if(control_interp==P0Enum){
+			if(domaintype!=Domain2DverticalEnum) ge[0]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight;
+			else ge[0]+=-2.*drag*dalpha2dk*(lambda*vx)*Jdet*gauss->weight;
+			_assert_(!xIsNan<IssmDouble>(ge[0]));
+		}
+		else{
+			_error_("not supported");
+		}
+	}
+	if(control_interp==P1Enum){
+		gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
+	}
+	else if(control_interp==P0Enum){
+		gradient->SetValue(vertexpidlist[0],ge[0],ADD_VAL);
+	}
+	else{
+		_error_("not supported");
+	}
 
 	/*Clean up and return*/
@@ -1921,8 +2645,8 @@
 	delete friction;
 }/*}}}*/
-void           AdjointHorizAnalysis::GradientJDragSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+void           AdjointHorizAnalysis::GradientJDragMLHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
 
 	/*return if floating (gradient is 0)*/
-	if(element->IsFloating()) return;
+	if(element->IsAllFloating()) return;
 
 	/*Intermediaries*/
@@ -1958,5 +2682,122 @@
 	/*Fetch number of vertices for this finite element*/
 	int numvertices = basalelement->GetNumberOfVertices();
-	int frictionlaw;
+
+	/*Initialize some vectors*/
+	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
+	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
+	int*        vertexpidlist = xNew<int>(numvertices);
+
+	/*Build friction element, needed later: */
+	Friction* friction=new Friction(basalelement,dim);
+
+	/*Retrieve all inputs we will be needing: */
+	basalelement->GetVerticesCoordinates(&xyz_list);
+	basalelement->GradientIndexing(&vertexpidlist[0],control_index);
+	Input* vx_input        = basalelement->GetInput(VxBaseEnum);                   _assert_(vx_input);
+	Input* vy_input        = basalelement->GetInput(VyBaseEnum);                   _assert_(vy_input);
+	Input* adjointx_input  = basalelement->GetInput(AdjointxBaseEnum);             _assert_(adjointx_input);
+	Input* adjointy_input  = basalelement->GetInput(AdjointyBaseEnum);             _assert_(adjointy_input);
+
+	/* get the friction law: 1- Budd, 11-Schoof*/
+	int frictionlaw;element->FindParam(&frictionlaw, FrictionLawEnum);
+	Input* dragcoeff_input = NULL;
+	switch(frictionlaw) {
+		case 1:
+			dragcoeff_input = basalelement->GetInput(FrictionCoefficientEnum); _assert_(dragcoeff_input);
+			break;
+		case 2:
+		case 11:
+			dragcoeff_input = basalelement->GetInput(FrictionCEnum); _assert_(dragcoeff_input);
+			break;
+		default:
+			_error_("Friction law "<< frictionlaw <<" not supported in the inversion.");
+	}
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=basalelement->NewGauss(4);
+	while(gauss->next()){
+
+		adjointx_input->GetInputValue(&lambda, gauss);
+		adjointy_input->GetInputValue(&mu, gauss);
+		vx_input->GetInputValue(&vx,gauss);
+		vy_input->GetInputValue(&vy,gauss);
+		dragcoeff_input->GetInputValue(&drag, gauss);
+
+		friction->GetAlphaComplement(&dalpha2dk,gauss);
+
+		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
+		basalelement->NodalFunctionsP1(basis,gauss);
+
+		/*Build gradient vector (actually -dJ/dD): */
+		if(control_interp==P1Enum){
+			for(int i=0;i<numvertices;i++){
+				ge[i]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
+				_assert_(!xIsNan<IssmDouble>(ge[i]));
+			}
+		}
+		else if(control_interp==P0Enum){
+			ge[0]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight;
+			_assert_(!xIsNan<IssmDouble>(ge[0]));
+		}
+		else{
+			_error_("not supported");
+		}
+	}
+	if(control_interp==P1Enum){
+		gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
+	}
+	else if(control_interp==P0Enum){
+		gradient->SetValue(vertexpidlist[0],ge[0],ADD_VAL);
+	}
+	else{
+		_error_("not supported");
+	}
+
+	/*Clean up and return*/
+	xDelete<IssmDouble>(xyz_list);
+	xDelete<IssmDouble>(basis);
+	xDelete<IssmDouble>(ge);
+	xDelete<int>(vertexpidlist);
+	delete gauss;
+	delete friction;
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+}/*}}}*/
+void           AdjointHorizAnalysis::GradientJDragSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+
+	/*return if floating (gradient is 0)*/
+	if(element->IsAllFloating()) return;
+
+	/*Intermediaries*/
+	int      domaintype,dim;
+	Element* basalelement;
+
+	/*Get basal element*/
+	element->FindParam(&domaintype,DomainTypeEnum);
+	switch(domaintype){
+		case Domain2DhorizontalEnum:
+			basalelement = element;
+			dim          = 2;
+			break;
+		case Domain2DverticalEnum:
+			if(!element->IsOnBase()) return;
+			basalelement = element->SpawnBasalElement();
+			dim          = 1;
+			break;
+		case Domain3DEnum:
+			if(!element->IsOnBase()) return;
+			basalelement = element->SpawnBasalElement();
+			dim          = 2;
+			break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+
+	/*Intermediaries*/
+	IssmDouble Jdet,weight;
+	IssmDouble drag,dalpha2dk;
+	IssmDouble vx,vy,lambda,mu;
+	IssmDouble *xyz_list= NULL;
+
+	/*Fetch number of vertices for this finite element*/
+	int numvertices = basalelement->GetNumberOfVertices();
 
 	/*Initialize some vectors*/
@@ -1977,6 +2818,6 @@
 
 	/* get the friction law: 1- Budd, 11-Schoof*/
-	element->FindParam(&frictionlaw, FrictionLawEnum);
-	Input* dragcoeff_input;
+	int frictionlaw;element->FindParam(&frictionlaw, FrictionLawEnum);
+	Input* dragcoeff_input = NULL;
 	switch(frictionlaw) {
 		case 1:
@@ -2007,10 +2848,27 @@
 
 		/*Build gradient vector (actually -dJ/dD): */
-		for(int i=0;i<numvertices;i++){
-			ge[i]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
-			_assert_(!xIsNan<IssmDouble>(ge[i]));
-		}
-	}
-	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
+		if(control_interp==P1Enum){
+			for(int i=0;i<numvertices;i++){
+				ge[i]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
+				_assert_(!xIsNan<IssmDouble>(ge[i]));
+			}
+		}
+		else if(control_interp==P0Enum){
+			ge[0]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight;
+			_assert_(!xIsNan<IssmDouble>(ge[0]));
+		}
+		else{
+			_error_("not supported");
+		}
+	}
+	if(control_interp==P1Enum){
+		gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
+	}
+	else if(control_interp==P0Enum){
+		gradient->SetValue(vertexpidlist[0],ge[0],ADD_VAL);
+	}
+	else{
+		_error_("not supported");
+	}
 
 	/*Clean up and return*/
@@ -2021,11 +2879,12 @@
 	delete gauss;
 	delete friction;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 }/*}}}*/
 void           AdjointHorizAnalysis::GradientJDragHydroFS(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
 
 	/*return if floating or not on bed (gradient is 0)*/
-	if(element->IsFloating()) return;
+	if(element->IsAllFloating()) return;
 	if(!element->IsOnBase()) return;
+	if(control_interp!=P1Enum) _error_("not implemented yet...");
 
 	/*Intermediaries*/
@@ -2124,6 +2983,7 @@
 
 	/*return if floating or not on bed (gradient is 0)*/
-	if(element->IsFloating()) return;
+	if(element->IsAllFloating()) return;
 	if(!element->IsOnBase()) return;
+	if(control_interp!=P1Enum) _error_("not implemented yet...");
 
 	/*Intermediaries*/
@@ -2195,5 +3055,6 @@
 
 	/*return if floating (gradient is 0)*/
-	if(element->IsFloating()) return;
+	if(element->IsAllFloating()) return;
+	if(control_interp!=P1Enum) _error_("not implemented yet...");
 
 	/*Intermediaries*/
@@ -2314,5 +3175,5 @@
 	delete gauss;
 	delete friction;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 }/*}}}*/
 void           AdjointHorizAnalysis::GradientJDSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
@@ -2321,4 +3182,5 @@
 	int      domaintype,dim;
 	Element* basalelement;
+	if(control_interp!=P1Enum) _error_("not implemented yet...");
 
 	/*Get basal element*/
@@ -2396,5 +3258,5 @@
 	xDelete<int>(vertexpidlist);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 }/*}}}*/
 void           AdjointHorizAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
@@ -2403,4 +3265,7 @@
 	if(approximation==FSApproximationEnum || approximation==NoneApproximationEnum){
 		InputUpdateFromSolutionFS(solution,element);
+	}
+	else if (approximation==MLHOApproximationEnum) {
+		InputUpdateFromSolutionMLHO(solution, element);
 	}
 	else{
@@ -2549,4 +3414,77 @@
 	xDelete<int>(doflist);
 }/*}}}*/
+void           AdjointHorizAnalysis::InputUpdateFromSolutionMLHO(IssmDouble* solution,Element* element){/*{{{*/
+	int  i;
+	int* doflist=NULL;
+
+	int    domaintype;
+	element->FindParam(&domaintype,DomainTypeEnum);
+	if (domaintype!=Domain2DhorizontalEnum) _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numnodes = element->GetNumberOfNodes();
+	int numdof = numnodes * 4;
+
+	/*Fetch dof list and allocate solution vectors*/
+	element->GetDofListLocal(&doflist,MLHOApproximationEnum,GsetEnum);
+	IssmDouble* values  = xNew<IssmDouble>(numdof);
+	IssmDouble* lambdax = xNew<IssmDouble>(numnodes);
+	IssmDouble* lambday = xNew<IssmDouble>(numnodes);
+	IssmDouble* lambdabx = xNew<IssmDouble>(numnodes);
+	IssmDouble* lambdaby = xNew<IssmDouble>(numnodes);
+	IssmDouble* lambdashx = xNew<IssmDouble>(numnodes);
+	IssmDouble* lambdashy = xNew<IssmDouble>(numnodes);
+	IssmDouble* n			 = xNew<IssmDouble>(numnodes);
+
+	/*Use the dof list to index into the solution vector: */
+	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+
+	/*Transform solution in Cartesian Space*/
+	if(domaintype!=Domain2DverticalEnum)	element->TransformSolutionCoord(&values[0],XYEnum);
+
+	element->GetInputListOnNodes(&n[0],MaterialsRheologyNEnum,0.);
+
+	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+	for(i=0;i<numnodes;i++){
+		lambdabx[i] =values[i*4+0];
+		lambdashx[i]=values[i*4+1];
+		/*Check solution*/
+		if(xIsNan<IssmDouble>(lambdabx[i])) _error_("NaN found in solution vector");
+		if(xIsInf<IssmDouble>(lambdabx[i])) _error_("Inf found in solution vector");
+		if(xIsNan<IssmDouble>(lambdashx[i])) _error_("NaN found in solution vector");
+		if(xIsInf<IssmDouble>(lambdashx[i])) _error_("Inf found in solution vector");
+		/* adjoint for the surface velocity */
+		lambdax[i] = lambdabx[i] + lambdashx[i]*(n[i]+1)/(n[i]+2);
+
+		lambdaby[i] =values[i*4+2];
+		lambdashy[i]=values[i*4+3];
+		/*Check solution*/
+		if(xIsNan<IssmDouble>(lambdaby[i])) _error_("NaN found in solution vector");
+		if(xIsInf<IssmDouble>(lambdaby[i])) _error_("Inf found in solution vector");
+		if(xIsNan<IssmDouble>(lambdashy[i])) _error_("NaN found in solution vector");
+		if(xIsInf<IssmDouble>(lambdashy[i])) _error_("Inf found in solution vector");
+		/* adjoint for the surface velocity */
+		lambday[i] = lambdaby[i] + lambdashy[i]*(n[i]+1)/(n[i]+2);
+	}
+
+	/*Add vx and vy as inputs to the tria element: */
+	element->AddInput(AdjointxBaseEnum,lambdabx,element->GetElementType());
+	element->AddInput(AdjointyBaseEnum,lambdaby,element->GetElementType());
+	element->AddInput(AdjointxShearEnum,lambdashx,element->GetElementType());
+	element->AddInput(AdjointyShearEnum,lambdashy,element->GetElementType());
+
+	element->AddInput(AdjointxEnum,lambdax,element->GetElementType());
+	element->AddInput(AdjointyEnum,lambday,element->GetElementType());
+
+	/*Free ressources:*/
+	xDelete<IssmDouble>(values);
+	xDelete<IssmDouble>(lambdax);
+	xDelete<IssmDouble>(lambday);
+	xDelete<IssmDouble>(lambdabx);
+	xDelete<IssmDouble>(lambdaby);
+	xDelete<IssmDouble>(lambdashx);
+	xDelete<IssmDouble>(lambdashy);
+	xDelete<int>(doflist);
+}/*}}}*/
 void           AdjointHorizAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
 	/*Default, do nothing*/
Index: /issm/trunk/src/c/analyses/AdjointHorizAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/AdjointHorizAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/AdjointHorizAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
@@ -27,4 +28,6 @@
 		ElementMatrix* CreateKMatrixFS(Element* element);
 		ElementMatrix* CreateKMatrixHO(Element* element);
+		ElementMatrix* CreateKMatrixMLHO(Element* element);
+		ElementMatrix* CreateKMatrixMLHOVerticalIntergrated(Element* element);
 		ElementMatrix* CreateKMatrixL1L2(Element* element);
 		ElementMatrix* CreateKMatrixSSA(Element* element);
@@ -33,4 +36,5 @@
 		ElementVector* CreatePVectorL1L2(Element* element);
 		ElementVector* CreatePVectorHO(Element* element);
+		ElementVector* CreatePVectorMLHO(Element* element);
 		ElementVector* CreatePVectorSSA(Element* element);
 		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
@@ -41,8 +45,10 @@
 		void           GradientJBbarL1L2(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
 		void           GradientJBbarHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+		void           GradientJBbarMLHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
 		void           GradientJBbarSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
 		void           GradientJBFS(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
 		void           GradientJBGradient(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
 		void           GradientJBHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+		void           GradientJBMLHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
 		void           GradientJBSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
 		void           GradientJDragFS(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
@@ -50,4 +56,5 @@
 		void           GradientJDragL1L2(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
 		void           GradientJDragHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+		void           GradientJDragMLHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
 		void           GradientJDragSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
 		void           GradientJDragHydroFS(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
@@ -59,4 +66,5 @@
 		void           InputUpdateFromSolutionFS(IssmDouble* solution,Element* element);
 		void           InputUpdateFromSolutionHoriz(IssmDouble* solution,Element* element);
+		void           InputUpdateFromSolutionMLHO(IssmDouble* solution,Element* element);
 		void           UpdateConstraints(FemModel* femmodel);
 };
Index: /issm/trunk/src/c/analyses/Analysis.h
===================================================================
--- /issm/trunk/src/c/analyses/Analysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/Analysis.h	(revision 26744)
@@ -39,9 +39,10 @@
 		virtual void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false)=0;
 		virtual int  DofsPerNode(int** doflist,int domaintype,int approximation)=0;
-		virtual void UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type)=0;
+		virtual void UpdateElements(Elements* elements,Inputs* inputs, IoModel* iomodel,int analysis_counter,int analysis_type)=0;
 		virtual void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum)=0;
 
 		/*Finite element Analysis*/
 		virtual void           Core(FemModel* femmodel)=0;
+		virtual void           PreCore(FemModel* femmodel)=0;
 		virtual ElementVector* CreateDVector(Element* element)=0;
 		virtual ElementMatrix* CreateJacobianMatrix(Element* element)=0;
Index: /issm/trunk/src/c/analyses/Balancethickness2Analysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/Balancethickness2Analysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/Balancethickness2Analysis.cpp	(revision 26744)
@@ -32,5 +32,5 @@
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
@@ -57,4 +57,7 @@
 /*Finite Element Analysis*/
 void           Balancethickness2Analysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented yet");
+}/*}}}*/
+void           Balancethickness2Analysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented yet");
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/Balancethickness2Analysis.h
===================================================================
--- /issm/trunk/src/c/analyses/Balancethickness2Analysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/Balancethickness2Analysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/BalancethicknessAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 26744)
@@ -99,5 +99,5 @@
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
@@ -118,4 +118,7 @@
 /*Finite Element Analysis*/
 void           BalancethicknessAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           BalancethicknessAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
@@ -146,5 +149,5 @@
 	int domaintype;
 	element->FindParam(&domaintype,DomainTypeEnum);
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return Ke;
 }/*}}}*/
@@ -334,5 +337,5 @@
 	int domaintype;
 	element->FindParam(&domaintype,DomainTypeEnum);
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return pe;
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/BalancethicknessAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/BalancethicknessAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/BalancethicknessAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/BalancethicknessSoftAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/BalancethicknessSoftAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/BalancethicknessSoftAnalysis.cpp	(revision 26744)
@@ -29,4 +29,7 @@
 	_error_("not implemented");
 }/*}}}*/
+void           BalancethicknessSoftAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
 ElementVector* BalancethicknessSoftAnalysis::CreateDVector(Element* element){/*{{{*/
 	/*Default, return NULL*/
Index: /issm/trunk/src/c/analyses/BalancethicknessSoftAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/BalancethicknessSoftAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/BalancethicknessSoftAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/BalancevelocityAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 26744)
@@ -41,5 +41,5 @@
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
@@ -59,4 +59,7 @@
 /*Finite Element Analysis*/
 void           BalancevelocityAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           BalancevelocityAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
@@ -231,5 +234,5 @@
 	xDelete<IssmDouble>(Ny);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return pe;
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/BalancevelocityAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/BalancevelocityAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/BalancevelocityAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/DamageEvolutionAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 26744)
@@ -70,5 +70,4 @@
 		element->SetElementInput(inputs,DamageFEnum,0.);
 	}
-
 
 	/*What input do I need to run my damage evolution model?*/
@@ -121,4 +120,7 @@
 /*Finite Element Analysis*/
 void           DamageEvolutionAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           DamageEvolutionAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
@@ -806,4 +808,9 @@
 	return Me;
 }/*}}}*/
+ElementVector* DamageEvolutionAnalysis::CreateFctPVector(Element* element){/*{{{*/
+
+	return this->CreatePVector(element);
+
+}/*}}}*/
 void           DamageEvolutionAnalysis::FctKMatrix(Matrix<IssmDouble>** pKff,Matrix<IssmDouble>** pKfs,FemModel* femmodel){/*{{{*/
 
@@ -834,4 +841,24 @@
 	}
 }/*}}}*/
+void           DamageEvolutionAnalysis::FctPVector(Vector<IssmDouble>** ppf,FemModel* femmodel){/*{{{*/
+
+	/*Output*/
+	Vector<IssmDouble>* pf = NULL;
+
+	/*Initialize P vector*/
+	AllocateSystemMatricesx(NULL,NULL,NULL,&pf,femmodel);
+
+	/*Create and assemble matrix*/
+	for(Object* & object : femmodel->elements->objects){
+		Element*       element = xDynamicCast<Element*>(object);
+		ElementVector* pe      = this->CreateFctPVector(element);
+		if(pe) pe->AddToGlobal(pf);
+		delete pe;
+	}
+	pf->Assemble();
+
+	/*Assign output pointer*/
+	*ppf=pf;
+}/*}}}*/
 void           DamageEvolutionAnalysis::MassMatrix(Matrix<IssmDouble>** pMff,FemModel* femmodel){/*{{{*/
 
Index: /issm/trunk/src/c/analyses/DamageEvolutionAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/DamageEvolutionAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/DamageEvolutionAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		void           CreateDamageFInput(Element* element);
 		void           CreateDamageFInputArctan(Element* element);
@@ -38,6 +39,8 @@
 		ElementMatrix* CreateFctKMatrix(Element* element);
 		ElementMatrix* CreateMassMatrix(Element* element);
+		ElementVector* CreateFctPVector(Element* element);
 		void           FctKMatrix(Matrix<IssmDouble>** pKff,Matrix<IssmDouble>** pKfs,FemModel* femmodel);
 		void           MassMatrix(Matrix<IssmDouble>** pMff,FemModel* femmodel);
+		void				FctPVector(Vector<IssmDouble>** ppf,FemModel* femmodel);
 };
 #endif
Index: /issm/trunk/src/c/analyses/DepthAverageAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/DepthAverageAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/DepthAverageAnalysis.cpp	(revision 26744)
@@ -38,4 +38,7 @@
 /*Finite Element Analysis*/
 void           DepthAverageAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           DepthAverageAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/DepthAverageAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/DepthAverageAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/DepthAverageAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/EnthalpyAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/EnthalpyAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/EnthalpyAnalysis.cpp	(revision 26744)
@@ -136,5 +136,5 @@
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.thickness",ThicknessEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
@@ -307,5 +307,5 @@
 
 /*Finite Element Analysis*/
-void           EnthalpyAnalysis::ApplyBasalConstraints(IssmDouble* serial_spc,Element* element){/*{{{*/
+void           EnthalpyAnalysis::ApplyBasalConstraints(IssmDouble* local_spc,Element* element){/*{{{*/
 
 	/* Do not check if ice in element, this may lead to inconsistencies between cpu partitions */
@@ -317,5 +317,4 @@
 	int         numindices;
 	int        *indices = NULL;
-	Node*       node = NULL;
 	IssmDouble	pressure;
 
@@ -325,5 +324,5 @@
 
 	/*Get parameters and inputs: */
-	Input* pressure_input		 = element->GetInput(PressureEnum);							 _assert_(pressure_input);
+	Input* pressure_input = element->GetInput(PressureEnum); _assert_(pressure_input);
 
 	/*Fetch indices of basal & surface nodes for this finite element*/
@@ -338,7 +337,7 @@
 
 		/*apply or release spc*/
-		node=element->GetNode(indices[i]);
+		Node* node=element->GetNode(indices[i]);
 		if(!node->IsActive()) continue;
-		if(serial_spc[node->Sid()]==1.){
+		if(local_spc[node->Lid()]==1.){
 			pressure_input->GetInputValue(&pressure, gauss);
 			node->ApplyConstraint(0,PureIceEnthalpy(element,pressure));
@@ -372,5 +371,5 @@
 
 	/* Only compute melt rates at the base of grounded ice*/
-	if(!element->IsOnBase() || element->IsFloating()) return;
+	if(!element->IsOnBase() || element->IsAllFloating()) return;
 
 	/* Intermediaries */
@@ -410,10 +409,7 @@
 	Input* pressure_input       = element->GetInput(PressureEnum);                    _assert_(pressure_input);
 	Input* geothermalflux_input = element->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
-	Input* vx_input             = element->GetInput(VxEnum);                          _assert_(vx_input);
-	Input* vy_input             = element->GetInput(VyEnum);                          _assert_(vy_input);
-	Input* vz_input             = element->GetInput(VzEnum);                          _assert_(vz_input);
 
 	/*Build friction element, needed later: */
-	Friction* friction=new Friction(element,dim);
+	Friction* friction=new Friction(element,3);
 
 	/******** MELTING RATES  ************************************//*{{{*/
@@ -471,5 +467,5 @@
 			/*basal friction*/
 			friction->GetAlpha2(&alpha2,gauss);
-			vx_input->GetInputValue(&vx,gauss);		vy_input->GetInputValue(&vy,gauss);		vz_input->GetInputValue(&vz,gauss);
+			friction->GetBasalSlidingSpeeds(&vx, &vy, &vz, gauss);
 			basalfriction=alpha2*(vx*vx + vy*vy + vz*vz);
 			geothermalflux_input->GetInputValue(&geothermalflux,gauss);
@@ -547,4 +543,7 @@
 	PostProcessing(femmodel);
 
+}/*}}}*/
+void           EnthalpyAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
 }/*}}}*/
 ElementVector* EnthalpyAnalysis::CreateDVector(Element* element){/*{{{*/
@@ -726,5 +725,5 @@
 
 	/*Initialize Element matrix and return if necessary*/
-	if(!element->IsOnBase() || !element->IsFloating()) return NULL;
+	if(!element->IsOnBase() || !element->IsAllFloating()) return NULL;
 
 	/*Intermediaries*/
@@ -920,5 +919,5 @@
 
 	/* implementation of the basal condition decision chart of Aschwanden 2012, Fig.5 */
-	if(!element->IsOnBase() || element->IsFloating()) return NULL;
+	if(!element->IsOnBase() || element->IsAllFloating()) return NULL;
 
 	bool converged, isdynamicbasalspc;
@@ -945,7 +944,4 @@
 	if(dt==0. && !converged) enthalpy_enum=EnthalpyPicardEnum; // use enthalpy from last iteration
 	else enthalpy_enum=EnthalpyEnum; // use enthalpy from last time step
-	Input* vx_input             = element->GetInput(VxEnum);                          _assert_(vx_input);
-	Input* vy_input             = element->GetInput(VyEnum);                          _assert_(vy_input);
-	Input* vz_input             = element->GetInput(VzEnum);                          _assert_(vz_input);
 	Input* enthalpy_input		 = element->GetInput(enthalpy_enum);					 _assert_(enthalpy_input);
 	Input* pressure_input		 = element->GetInput(PressureEnum);							 _assert_(pressure_input);
@@ -986,7 +982,5 @@
 				geothermalflux_input->GetInputValue(&geothermalflux,gauss);
 				friction->GetAlpha2(&alpha2,gauss);
-				vx_input->GetInputValue(&vx,gauss);
-				vy_input->GetInputValue(&vy,gauss);
-				vz_input->GetInputValue(&vz,gauss);
+				friction->GetBasalSlidingSpeeds(&vx, &vy, &vz, gauss);
 				basalfriction=alpha2*(vx*vx+vy*vy+vz*vz);
 				heatflux=(basalfriction+geothermalflux)/(rho_ice);
@@ -1021,5 +1015,5 @@
 
 	/*Get basal element*/
-	if(!element->IsOnBase() || !element->IsFloating()) return NULL;
+	if(!element->IsOnBase() || !element->IsAllFloating()) return NULL;
 
 	IssmDouble  Hpmp,dt,Jdet,scalar_ocean,pressure;
@@ -1306,5 +1300,5 @@
 	/* Only update constraints at the base.
 	 * Floating ice is not affected by basal BC decision chart. */
-	if(!(element->IsOnBase()) || element->IsFloating()) return;
+	if(!(element->IsOnBase()) || element->IsAllFloating()) return;
 
 	/*Intermediary*/
@@ -1341,21 +1335,21 @@
 			case 0:
 				// cold, dry base: apply basal surface forcing
-				vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),0.,INS_VAL);
 				break;
 			case 1:
 				// cold, wet base: keep at pressure melting point
-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
 				break;
 			case 2:
 				// temperate, thin refreezing base:
-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
 				break;
 			case 3:
 				// temperate, thin melting base: set spc
-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
 				break;
 			case 4:
 				// temperate, thick melting base:
-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
 				break;
 			default:
@@ -1377,5 +1371,5 @@
 	/* Only update constraints at the base.
 	 * Floating ice is not affected by basal BC decision chart.*/
-	if(!(element->IsOnBase()) || element->IsFloating()) return;
+	if(!(element->IsOnBase()) || element->IsAllFloating()) return;
 
 	/*Intermediary*/
@@ -1414,21 +1408,21 @@
 			case 0:
 				// cold, dry base: apply basal surface forcing
-				vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),0.,INS_VAL);
 				break;
 			case 1:
 				// cold, wet base: keep at pressure melting point
-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
 				break;
 			case 2:
 				// temperate, thin refreezing base: release spc
-				vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),0.,INS_VAL);
 				break;
 			case 3:
 				// temperate, thin melting base: set spc
-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
 				break;
 			case 4:
 				// temperate, thick melting base: set grad H*n=0
-				vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
+				vec_spc->SetValue(element->nodes[i]->Pid(),0.,INS_VAL);
 				break;
 			default:
@@ -1665,8 +1659,8 @@
 
 	/*Update basal dirichlet BCs for enthalpy: */
-	Vector<IssmDouble>* spc           = NULL;
-	IssmDouble*         serial_spc    = NULL;
-
-	spc=new Vector<IssmDouble>(femmodel->nodes->NumberOfNodes());
+	int numnodes            = femmodel->nodes->NumberOfNodes();
+   int localmasters        = femmodel->nodes->NumberOfNodesLocal();
+	Vector<IssmDouble>* spc = new Vector<IssmDouble>(localmasters,numnodes);
+
 	/*First create a vector to figure out what elements should be constrained*/
 	for(Object* & object : femmodel->elements->objects){
@@ -1675,7 +1669,10 @@
 	}
 
-	/*Assemble and serialize*/
+	/*Assemble*/
 	spc->Assemble();
-	serial_spc=spc->ToMPISerial();
+
+	/*Get local vector with both masters and slaves:*/
+	IssmDouble *local_spc = NULL;
+	femmodel->GetLocalVectorWithClonesNodes(&local_spc,spc);
 	delete spc;
 
@@ -1683,5 +1680,5 @@
 	for(Object* & object : femmodel->elements->objects){
 		Element* element=xDynamicCast<Element*>(object);
-		ApplyBasalConstraints(serial_spc,element);
+		ApplyBasalConstraints(local_spc,element);
 	}
 
@@ -1689,5 +1686,5 @@
 
 	/*Delete*/
-	xDelete<IssmDouble>(serial_spc);
+	xDelete<IssmDouble>(local_spc);
 }/*}}}*/
 void           EnthalpyAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
Index: /issm/trunk/src/c/analyses/EnthalpyAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/EnthalpyAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/EnthalpyAnalysis.h	(revision 26744)
@@ -26,4 +26,5 @@
 		static void       ComputeBasalMeltingrate(Element* element);
 		void              Core(FemModel* femmodel);
+		void              PreCore(FemModel* femmodel);
 		ElementVector*    CreateDVector(Element* element);
 		ElementMatrix*    CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/EnumToAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/EnumToAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/EnumToAnalysis.cpp	(revision 26744)
@@ -14,4 +14,7 @@
 
 	switch(analysis_enum){
+		#ifdef _HAVE_HYDROLOGYTWS_
+		case HydrologyTwsAnalysisEnum : return new HydrologyTwsAnalysis();
+		#endif
 		#ifdef _HAVE_ADJOINTBALANCETHICKNESS2_
 		case AdjointBalancethickness2AnalysisEnum : return new AdjointBalancethickness2Analysis();
@@ -65,7 +68,4 @@
 		case GLheightadvectionAnalysisEnum : return new GLheightadvectionAnalysis();
 		#endif
-		#ifdef _HAVE_GIA_
-		case GiaAnalysisEnum : return new GiaAnalysis();
-		#endif
 		#ifdef _HAVE_HYDROLOGYDCEFFICIENT_
 		case HydrologyDCEfficientAnalysisEnum : return new HydrologyDCEfficientAnalysis();
@@ -74,15 +74,15 @@
 		case HydrologyDCInefficientAnalysisEnum : return new HydrologyDCInefficientAnalysis();
 		#endif
-		#ifdef _HAVE_HYDROLOGYSHREVE_
-		case HydrologyShreveAnalysisEnum : return new HydrologyShreveAnalysis();
-		#endif
 		#ifdef _HAVE_HYDROLOGYGLADS_
 		case HydrologyGlaDSAnalysisEnum : return new HydrologyGlaDSAnalysis();
+		#endif
+		#ifdef _HAVE_HYDROLOGYPISM_
+		case HydrologyPismAnalysisEnum : return new HydrologyPismAnalysis();
 		#endif
 		#ifdef _HAVE_HYDROLOGYSHAKTI_
 		case HydrologyShaktiAnalysisEnum : return new HydrologyShaktiAnalysis();
 		#endif
-		#ifdef _HAVE_HYDROLOGYPISM_
-		case HydrologyPismAnalysisEnum : return new HydrologyPismAnalysis();
+		#ifdef _HAVE_HYDROLOGYSHREVE_
+		case HydrologyShreveAnalysisEnum : return new HydrologyShreveAnalysis();
 		#endif
 		#ifdef _HAVE_L2PROJECTIONBASE_
@@ -104,6 +104,12 @@
 		case MeltingAnalysisEnum : return new MeltingAnalysis();
 		#endif
-		#ifdef _HAVE_SEALEVELRISE_
-		case SealevelriseAnalysisEnum : return new SealevelriseAnalysis();
+		#ifdef _HAVE_OCEANTRANSPORT_
+		case OceantransportAnalysisEnum : return new OceantransportAnalysis();
+		#endif
+		#ifdef _HAVE_SAMPLING_
+		case SamplingAnalysisEnum : return new SamplingAnalysis();
+		#endif
+		#ifdef _HAVE_SEALEVELCHANGE_
+		case SealevelchangeAnalysisEnum : return new SealevelchangeAnalysis();
 		#endif
 		#ifdef _HAVE_SMB_
Index: /issm/trunk/src/c/analyses/EnumToAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/EnumToAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/EnumToAnalysis.h	(revision 26744)
@@ -17,4 +17,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/EsaAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/EsaAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/EsaAnalysis.cpp	(revision 26744)
@@ -32,5 +32,5 @@
 	/*Create inputs: */
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.esa.deltathickness",EsaDeltathicknessEnum);
+	iomodel->FetchDataToInput(inputs,elements,"md.esa.deltathickness",DeltaIceThicknessEnum);
 
 }/*}}}*/
@@ -61,5 +61,5 @@
 	/*some constant parameters: */
 	parameters->AddObject(iomodel->CopyConstantObject("md.esa.hemisphere",EsaHemisphereEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.rigid",SolidearthSettingsRigidEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.selfattraction",SolidearthSettingsSelfAttractionEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.horiz",SolidearthSettingsHorizEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.elastic",SolidearthSettingsElasticEnum));
@@ -189,4 +189,7 @@
 	_error_("not implemented");
 }/*}}}*/
+void           EsaAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
 ElementVector* EsaAnalysis::CreateDVector(Element* element){/*{{{*/
 	/*Default, return NULL*/
Index: /issm/trunk/src/c/analyses/EsaAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/EsaAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/EsaAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/ExtrapolationAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/ExtrapolationAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/ExtrapolationAnalysis.cpp	(revision 26744)
@@ -71,4 +71,7 @@
 		femmodel->RequestedOutputsx(&femmodel->results,&extvar_enum,1);
 	}
+}/*}}}*/
+void           ExtrapolationAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
 }/*}}}*/
 ElementVector* ExtrapolationAnalysis::CreateDVector(Element* element){/*{{{*/
Index: /issm/trunk/src/c/analyses/ExtrapolationAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/ExtrapolationAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/ExtrapolationAnalysis.h	(revision 26744)
@@ -10,5 +10,5 @@
 
 class ExtrapolationAnalysis: public Analysis{
-	
+
  public:
 	/*Model processing*/
@@ -22,4 +22,5 @@
 	/*Finite element Analysis*/
 	void           Core(FemModel* femmodel);
+	void           PreCore(FemModel* femmodel);
 	ElementVector* CreateDVector(Element* element);
 	ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/ExtrudeFromBaseAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/ExtrudeFromBaseAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/ExtrudeFromBaseAnalysis.cpp	(revision 26744)
@@ -38,4 +38,7 @@
 /*Finite Element Analysis*/
 void           ExtrudeFromBaseAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           ExtrudeFromBaseAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/ExtrudeFromBaseAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/ExtrudeFromBaseAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/ExtrudeFromBaseAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/ExtrudeFromTopAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/ExtrudeFromTopAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/ExtrudeFromTopAnalysis.cpp	(revision 26744)
@@ -38,4 +38,7 @@
 /*Finite Element Analysis*/
 void           ExtrudeFromTopAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           ExtrudeFromTopAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/ExtrudeFromTopAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/ExtrudeFromTopAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/ExtrudeFromTopAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/FreeSurfaceBaseAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 26744)
@@ -74,5 +74,5 @@
 
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum,0.);
@@ -88,9 +88,15 @@
 
 	/*Get what we need for ocean-induced basal melting*/
+	bool isstochastic;
 	int basalforcing_model;
 	iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model");
+	iomodel->FindConstant(&isstochastic,"md.stochasticforcing.isstochasticforcing");
 	switch(basalforcing_model){
 		case FloatingMeltRateEnum:
 			iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum);
+			if(isstochastic){
+            iomodel->FetchDataToInput(inputs,elements,"md.stochasticforcing.default_id",StochasticForcingDefaultIdEnum);
+            iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BaselineBasalforcingsFloatingiceMeltingRateEnum);
+         }
 			break;
 		case LinearFloatingMeltRateEnum:
@@ -127,4 +133,7 @@
 /*Finite Element Analysis*/
 void           FreeSurfaceBaseAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           FreeSurfaceBaseAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
@@ -267,5 +276,5 @@
 	xDelete<IssmDouble>(D);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return Ke;
 }/*}}}*/
@@ -341,5 +350,5 @@
 	xDelete<IssmDouble>(basis);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return pe;
 
Index: /issm/trunk/src/c/analyses/FreeSurfaceBaseAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/FreeSurfaceBaseAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/FreeSurfaceBaseAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/FreeSurfaceTopAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/FreeSurfaceTopAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/FreeSurfaceTopAnalysis.cpp	(revision 26744)
@@ -77,5 +77,5 @@
 
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
@@ -101,4 +101,7 @@
 /*Finite Element Analysis*/
 void           FreeSurfaceTopAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           FreeSurfaceTopAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
@@ -244,5 +247,5 @@
 	xDelete<IssmDouble>(D);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
+	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
 	return Ke;
 }/*}}}*/
@@ -313,5 +316,5 @@
 	xDelete<IssmDouble>(basis);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
+	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
 	return pe;
 
Index: /issm/trunk/src/c/analyses/FreeSurfaceTopAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/FreeSurfaceTopAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/FreeSurfaceTopAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/GLheightadvectionAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/GLheightadvectionAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/GLheightadvectionAnalysis.cpp	(revision 26744)
@@ -47,4 +47,7 @@
 /*Finite Element Analysis*/
 void           GLheightadvectionAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           GLheightadvectionAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
@@ -90,5 +93,4 @@
 	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
 	IssmDouble*    dbasis = xNew<IssmDouble>(dim*numnodes);
-	IssmDouble*    Bprime = xNew<IssmDouble>(dim*numnodes);
 	IssmDouble     D[2][2] = {0.};
 
@@ -175,5 +177,5 @@
 	xDelete<IssmDouble>(dbasis);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return Ke;
 
Index: /issm/trunk/src/c/analyses/GLheightadvectionAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/GLheightadvectionAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/GLheightadvectionAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: sm/trunk/src/c/analyses/GiaAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/GiaAnalysis.cpp	(revision 26743)
+++ 	(revision )
@@ -1,117 +1,0 @@
-#include "./GiaAnalysis.h"
-#include "../toolkits/toolkits.h"
-#include "../classes/classes.h"
-#include "../shared/shared.h"
-#include "../modules/modules.h"
-
-/*Model processing*/
-void GiaAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
-	/*No constraints*/
-}/*}}}*/
-void GiaAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
-	/*No loads*/
-}/*}}}*/
-void GiaAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
-	::CreateNodes(nodes,iomodel,GiaAnalysisEnum,P1Enum);
-}/*}}}*/
-int  GiaAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
-	return 1;
-}/*}}}*/
-void GiaAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
-
-	int giamodel=0;
-	int nummodels=0;
-
-	/*Update elements: */
-	int counter=0;
-	for(int i=0;i<iomodel->numberofelements;i++){
-		if(iomodel->my_elements[i]){
-			Element* element=(Element*)elements->GetObjectByOffset(counter);
-			element->Update(inputs,i,iomodel,analysis_counter,analysis_type,P1Enum);
-			counter++;
-		}
-	}
-
-	/*fetch gia model type: */
-	iomodel->FetchData(&giamodel,"md.gia.model");
-	if(giamodel==1){ //GiaIvins
-		iomodel->FetchDataToInput(inputs,elements,"md.geometry.thickness",ThicknessEnum);
-		iomodel->FetchDataToInput(inputs,elements,"md.gia.mantle_viscosity",GiaMantleViscosityEnum);
-		iomodel->FetchDataToInput(inputs,elements,"md.gia.lithosphere_thickness",GiaLithosphereThicknessEnum);
-		iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
-	}
-	else if(giamodel==2){ //GiaCaron: not implemneted yet
-	}
-	else if(giamodel==3){
-		/*take Ngia and Ugia from the offline models and plug into the element inputs:*/
-		iomodel->FetchDataToDatasetInput(inputs,elements,"md.gia.Ngia",GiaMmeNgiaEnum);
-		iomodel->FetchDataToDatasetInput(inputs,elements,"md.gia.Ugia",GiaMmeUgiaEnum);
-	}
-}/*}}}*/
-void GiaAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
-
-	int                 giamodel;
-	IssmDouble          modelid; 
-	int                 nummodels;
-
-	/*find gia model type: */
-	parameters->AddObject(iomodel->CopyConstantObject("md.gia.model",GiaModelEnum));
-	parameters->FindParam(&giamodel,GiaModelEnum);
-
-	if(giamodel==1){ //GiaIvins
-		parameters->AddObject(iomodel->CopyConstantObject("md.gia.cross_section_shape",GiaCrossSectionShapeEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.materials.lithosphere_shear_modulus",MaterialsLithosphereShearModulusEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.materials.lithosphere_density",MaterialsLithosphereDensityEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.materials.mantle_shear_modulus",MaterialsMantleShearModulusEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.materials.mantle_density",MaterialsMantleDensityEnum));
-	}
-	else if(giamodel==2){ //GiaCaron
-	}
-	else if(giamodel==3){ //GiaMme
-		
-		parameters->AddObject(iomodel->CopyConstantObject("md.gia.nummodels",GiaNummodelsEnum));
-		parameters->FindParam(&nummodels,GiaNummodelsEnum);
-
-		/*create double param, not int param, because Dakota will be updating it as 
-		 * a double potentially: */
-		iomodel->FetchData(&modelid,"md.gia.modelid");
-		parameters->AddObject(new DoubleParam(GiaModelidEnum,modelid));
-
-		/*quick checks: */
-		if(nummodels<=0)_error_("giamme object in  md.gia field should contain at least 1 ensemble model!");
-		if(modelid<=0 || modelid>nummodels)_error_("modelid field in giamme object of md.gia field should be between 1 and the number of ensemble runs!");
-	} 
-
-
-}/*}}}*/
-
-/*Finite Element Analysis*/
-void           GiaAnalysis::Core(FemModel* femmodel){/*{{{*/
-	_error_("not implemented");
-}/*}}}*/
-ElementVector* GiaAnalysis::CreateDVector(Element* element){/*{{{*/
-	/*Default, return NULL*/
-	return NULL;
-}/*}}}*/
-ElementMatrix* GiaAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
-_error_("Not implemented");
-}/*}}}*/
-ElementMatrix* GiaAnalysis::CreateKMatrix(Element* element){/*{{{*/
-	_error_("not implemented yet");
-}/*}}}*/
-ElementVector* GiaAnalysis::CreatePVector(Element* element){/*{{{*/
-_error_("not implemented yet");
-}/*}}}*/
-void           GiaAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
-	   _error_("not implemented yet");
-}/*}}}*/
-void           GiaAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
-	_error_("Not implemented yet");
-}/*}}}*/
-void           GiaAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
-	_error_("not implemented yet");
-}/*}}}*/
-void           GiaAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
-	/*Default, do nothing*/
-	return;
-}/*}}}*/
Index: sm/trunk/src/c/analyses/GiaAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/GiaAnalysis.h	(revision 26743)
+++ 	(revision )
@@ -1,33 +1,0 @@
-/*! \file GiaAnalysis.h 
- *  \brief: header file for generic external result object
- */
-
-#ifndef _GiaAnalysis_
-#define _GiaAnalysis_
-
-/*Headers*/
-#include "./Analysis.h"
-
-class GiaAnalysis: public Analysis{
-
-	public:
-		/*Model processing*/
-		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
-		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
-		int  DofsPerNode(int** doflist,int domaintype,int approximation);
-		void UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type);
-		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
-
-		/*Finite element Analysis*/
-		void           Core(FemModel* femmodel);
-		ElementVector* CreateDVector(Element* element);
-		ElementMatrix* CreateJacobianMatrix(Element* element);
-		ElementMatrix* CreateKMatrix(Element* element);
-		ElementVector* CreatePVector(Element* element);
-		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
-		void           GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index);
-		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
-		void           UpdateConstraints(FemModel* femmodel);
-};
-#endif
Index: /issm/trunk/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 26744)
@@ -156,4 +156,7 @@
 	_error_("not implemented");
 }/*}}}*/
+void HydrologyDCEfficientAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
 ElementVector* HydrologyDCEfficientAnalysis::CreateDVector(Element* element){/*{{{*/
 	/*Default, return NULL*/
@@ -186,8 +189,5 @@
 	/*Check that all nodes are active, else return empty matrix*/
 	if(!active_element) {
-		if(domaintype!=Domain2DhorizontalEnum){
-			basalelement->DeleteMaterials();
-			delete basalelement;
-		}
+		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 		return NULL;
 	}
@@ -247,5 +247,5 @@
 	xDelete<IssmDouble>(dbasis);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return Ke;
 }/*}}}*/
@@ -274,8 +274,5 @@
 	/*Check that all nodes are active, else return empty matrix*/
 	if(!active_element) {
-		if(domaintype!=Domain2DhorizontalEnum){
-			basalelement->DeleteMaterials();
-			delete basalelement;
-		}
+		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 		return NULL;
 	}
@@ -376,5 +373,5 @@
 	xDelete<IssmDouble>(basis);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return pe;
 }/*}}}*/
@@ -425,5 +422,5 @@
 	xDelete<IssmDouble>(eplHeads);
 	xDelete<int>(doflist);
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 } /*}}}*/
 void HydrologyDCEfficientAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
@@ -538,5 +535,4 @@
 	int iseplthickcomp;
 
-
 	/*Skip if we don't want to compute thicknesses*/
 	femmodel->parameters->FindParam(&iseplthickcomp,HydrologydcEplThickCompEnum);
@@ -561,5 +557,4 @@
 	femmodel->parameters->FindParam(&gravity,ConstantsGEnum);
 	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
-
 
 	for(Object* & object : femmodel->elements->objects){
@@ -733,8 +728,5 @@
 	element->AddBasalInput(HydrologydcEplThicknessSubstepEnum,epl_thickness,basalelement->GetElementType());
 
-	if(domaintype!=Domain2DhorizontalEnum){
-		basalelement->DeleteMaterials();
-		delete basalelement;
-	}
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	xDelete<IssmDouble>(epl_thickness);
 	xDelete<IssmDouble>(old_active);
@@ -788,5 +780,5 @@
 		/*Do not do anything: at least one node is active for this element but this element is not solved for*/
 	}
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	xDelete<IssmDouble>(active);
 }
Index: /issm/trunk/src/c/analyses/HydrologyDCEfficientAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyDCEfficientAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/HydrologyDCEfficientAnalysis.h	(revision 26744)
@@ -25,4 +25,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 26744)
@@ -178,4 +178,7 @@
 	_error_("not implemented");
 }/*}}}*/
+void           HydrologyDCInefficientAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
 ElementVector* HydrologyDCInefficientAnalysis::CreateDVector(Element* element){/*{{{*/
 	/*Default, return NULL*/
@@ -209,8 +212,5 @@
 	/*Check that all nodes are active, else return empty matrix*/
 	if(!thawed_element) {
-		if(domaintype!=Domain2DhorizontalEnum){
-			basalelement->DeleteMaterials();
-			delete basalelement;
-		}
+		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 		return NULL;
 	}
@@ -280,8 +280,5 @@
 	xDelete<IssmDouble>(dbasis);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){
-		basalelement->DeleteMaterials();
-		delete basalelement;
-	}
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return Ke;
 }/*}}}*/
@@ -310,8 +307,5 @@
 	/*Check that all nodes are active, else return empty matrix*/
 	if(!thawed_element) {
-	if(domaintype!=Domain2DhorizontalEnum){
-			basalelement->DeleteMaterials();
-			delete basalelement;
-		}
+		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 		return NULL;
 	}
@@ -437,8 +431,5 @@
 	xDelete<IssmDouble>(basis);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){
-		basalelement->DeleteMaterials();
-		delete basalelement;
-	}
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return pe;
 }/*}}}*/
@@ -532,8 +523,5 @@
 	xDelete<IssmDouble>(pressure);
 	xDelete<int>(doflist);
-	if(domaintype!=Domain2DhorizontalEnum){
-		basalelement->DeleteMaterials();
-		delete basalelement;
-	}
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 }/*}}}*/
 void HydrologyDCInefficientAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
@@ -735,8 +723,5 @@
 	}
 
-	if(domaintype!=Domain2DhorizontalEnum){
-		basalelement->DeleteMaterials();
-		delete basalelement;
-	}
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	xDelete<IssmDouble>(meltingrate);
 	xDelete<IssmDouble>(groundedice);
@@ -804,5 +789,5 @@
 		/*Do not do anything: at least one node is active for this element but this element is not solved for*/
 	}
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	xDelete<IssmDouble>(active);
 }
Index: /issm/trunk/src/c/analyses/HydrologyDCInefficientAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyDCInefficientAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/HydrologyDCInefficientAnalysis.h	(revision 26744)
@@ -23,4 +23,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/HydrologyGlaDSAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26744)
@@ -129,5 +129,5 @@
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0); /*Needed for friction*/
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
 	iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.geothermalflux",BasalforcingsGeothermalfluxEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
@@ -144,7 +144,14 @@
 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.watercolumn",HydrologySheetThicknessEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.hydraulic_potential",HydraulicPotentialEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
-	iomodel->FindConstant(&frictionlaw,"md.friction.law");
+	if(iomodel->domaintype==Domain2DhorizontalEnum){
+		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxBaseEnum);
+		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyBaseEnum);
+		iomodel->FindConstant(&frictionlaw,"md.friction.law");
+	}
+	else{
+		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
+		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
+		iomodel->FindConstant(&frictionlaw,"md.friction.law");
+	}
 
 	/*Friction law variables*/
@@ -213,4 +220,7 @@
 /*Finite Element Analysis*/
 void           HydrologyGlaDSAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           HydrologyGlaDSAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
@@ -322,5 +332,5 @@
 
 	/*Skip if water or ice shelf element*/
-	if(element->IsFloating()) return NULL;
+	if(element->IsAllFloating()) return NULL;
 
 	/*Intermediaries */
@@ -350,6 +360,4 @@
 	IssmDouble e_v       = element->FindParam(HydrologyEnglacialVoidRatioEnum);
 	Input* hr_input     = element->GetInput(HydrologyBumpHeightEnum);_assert_(hr_input);
-	Input* vx_input     = element->GetInput(VxEnum);_assert_(vx_input);
-	Input* vy_input     = element->GetInput(VyEnum);_assert_(vy_input);
 	Input* h_input      = element->GetInput(HydrologySheetThicknessEnum);_assert_(h_input);
 	Input* H_input      = element->GetInput(ThicknessEnum); _assert_(H_input);
@@ -373,6 +381,4 @@
 
 		/*Get input values at gauss points*/
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
 		h_input->GetInputValue(&h,gauss);
 		G_input->GetInputValue(&G,gauss);
@@ -385,4 +391,5 @@
 
 		/*Get basal velocity*/
+		friction->GetBasalSlidingSpeeds(&vx, &vy ,gauss);
 		ub = sqrt(vx*vx + vy*vy);
 
@@ -465,5 +472,5 @@
 
 	/*Skip if water or ice shelf element*/
-	if(element->IsFloating()) return;
+	if(element->IsAllFloating()) return;
 
 	/*Intermediaries */
@@ -485,6 +492,6 @@
 	IssmDouble g         = element->FindParam(ConstantsGEnum);
 	Input* hr_input = element->GetInput(HydrologyBumpHeightEnum);_assert_(hr_input);
-	Input* vx_input = element->GetInput(VxEnum);_assert_(vx_input);
-	Input* vy_input = element->GetInput(VyEnum);_assert_(vy_input);
+	Input* vx_input = element->GetInput(VxBaseEnum);_assert_(vx_input);
+	Input* vy_input = element->GetInput(VyBaseEnum);_assert_(vy_input);
 	Input* H_input  = element->GetInput(ThicknessEnum); _assert_(H_input);
 	Input* b_input  = element->GetInput(BedEnum); _assert_(b_input);
@@ -554,6 +561,6 @@
 
 	/*Skip if water or ice shelf element*/
-	if(element->IsFloating()) return;
-	
+	if(element->IsAllFloating()) return;
+
 	/*Intermediary*/
 	IssmDouble phi_0, phi_m, p_i;
Index: /issm/trunk/src/c/analyses/HydrologyGlaDSAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyGlaDSAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/HydrologyGlaDSAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/HydrologyPismAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyPismAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/HydrologyPismAnalysis.cpp	(revision 26744)
@@ -64,4 +64,7 @@
 	_error_("not implemented");
 }/*}}}*/
+void           HydrologyPismAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
 ElementVector* HydrologyPismAnalysis::CreateDVector(Element* element){/*{{{*/
 	_error_("not implemented");
@@ -101,5 +104,5 @@
 
 	/*Skip if water or ice shelf element*/
-	if(element->IsFloating()) return;
+	if(element->IsAllFloating()) return;
 
 	/*Intermediaries */
@@ -131,5 +134,5 @@
 
 	/* Divide by connectivity, add degree of channelization as an input */
-	/*FIXME: should be changed to P1, this is due to the NR, IsFloating will return 0 on this element, but it should not be DG*/
+	/*FIXME: should be changed to P1, this is due to the NR, IsAllFloating will return 0 on this element, but it should not be DG*/
 	element->AddInput(WatercolumnEnum,&watercolumn[0],P1DGEnum);
 
Index: /issm/trunk/src/c/analyses/HydrologyPismAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyPismAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/HydrologyPismAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/HydrologyShaktiAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26744)
@@ -119,4 +119,8 @@
 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
+	if(iomodel->domaintype==Domain2DhorizontalEnum){
+		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxBaseEnum);
+		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyBaseEnum);
+	}
 	iomodel->FindConstant(&frictionlaw,"md.friction.law");
 
@@ -151,4 +155,25 @@
 	parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.storage",HydrologyStorageEnum));
 
+	/*Deal with friction parameters*/
+	int frictionlaw;
+	iomodel->FindConstant(&frictionlaw,"md.friction.law");
+	if(frictionlaw==6){
+		parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
+	}
+	if(frictionlaw==4){
+		parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
+	}
+	if(frictionlaw==1 || frictionlaw==3 || frictionlaw==7){
+		parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
+	}
+	if(frictionlaw==9){
+		parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
+		parameters->AddObject(new IntParam(FrictionCouplingEnum,0));
+	}
+
   /*Requested outputs*/
   iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.hydrology.requested_outputs");
@@ -162,4 +187,7 @@
 	_error_("not implemented");
 }/*}}}*/
+void           HydrologyShaktiAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
 ElementVector* HydrologyShaktiAnalysis::CreateDVector(Element* element){/*{{{*/
 	/*Default, return NULL*/
@@ -174,4 +202,5 @@
 	IssmDouble Jdet;
 	IssmDouble* xyz_list = NULL;
+	IssmDouble  gap,bed,thickness,head,g,rho_ice,rho_water,A,B,n;
 
 	/*Fetch number of nodes and dof for this finite element*/
@@ -194,4 +223,15 @@
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
 
+        /*Get all inputs and parameters*/
+        element->FindParam(&rho_water,MaterialsRhoFreshwaterEnum);
+        element->FindParam(&rho_ice,MaterialsRhoIceEnum);
+        element->FindParam(&g,ConstantsGEnum);
+        Input* B_input = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
+        Input* n_input = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
+        Input* gap_input = element->GetInput(HydrologyGapHeightEnum);         _assert_(gap_input);
+        Input* thickness_input = element->GetInput(ThicknessEnum);                  _assert_(thickness_input);
+        Input* head_input = element->GetInput(HydrologyHeadEnum);              _assert_(head_input);
+        Input* base_input = element->GetInput(BaseEnum);                      _assert_(base_input);
+
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(1);
@@ -202,8 +242,27 @@
 		element->NodalFunctions(basis,gauss);
 
+		/***/
+                base_input->GetInputValue(&bed,gauss);
+                thickness_input->GetInputValue(&thickness,gauss);
+                gap_input->GetInputValue(&gap,gauss);
+                head_input->GetInputValue(&head,gauss);
+
+                /*Get ice A parameter*/
+                B_input->GetInputValue(&B,gauss);
+                n_input->GetInputValue(&n,gauss);
+                A=pow(B,-n);
+
+                /*Get water and ice pressures*/
+                IssmDouble pressure_ice   = rho_ice*g*thickness;    _assert_(pressure_ice>0.);
+                IssmDouble pressure_water = rho_water*g*(head-bed);
+                if(pressure_water>pressure_ice) pressure_water = pressure_ice;
+
+
+
 		for(int i=0;i<numnodes;i++){
 			for(int j=0;j<numnodes;j++){
 				Ke->values[i*numnodes+j] += conductivity*gauss->weight*Jdet*(dbasis[0*numnodes+i]*dbasis[0*numnodes+j] + dbasis[1*numnodes+i]*dbasis[1*numnodes+j])
-				  + gauss->weight*Jdet*storage/dt*basis[i]*basis[j];
+				  + gauss->weight*Jdet*storage/dt*basis[i]*basis[j]
+                			+gauss->weight*Jdet*A*(n)*(pow(fabs(pressure_ice-pressure_water),(n-1))*rho_water*g)*gap*basis[i]*basis[j];
 			}
 		}
@@ -220,13 +279,15 @@
 
 	/*Skip if water or ice shelf element*/
-	if(element->IsFloating()) return NULL;
+	if(element->IsAllFloating()) return NULL;
 
 	/*Intermediaries */
 	IssmDouble  Jdet,meltrate,G,dh[2],B,A,n;
 	IssmDouble  gap,bed,thickness,head,ieb,head_old;
-	IssmDouble  lr,br,vx,vy,beta;
+	IssmDouble  lr,br,vx,vy,beta,lc;
 	IssmDouble  alpha2,frictionheat;
    IssmDouble  PMPheat,dpressure_water[2],dbed[2];	
 	IssmDouble* xyz_list = NULL;
+//        IssmDouble dgapxx; /***/
+//	IssmDouble dgapyy; /***/
 
 	/*Fetch number of nodes and dof for this finite element*/
@@ -251,9 +312,9 @@
 	Input* n_input              = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
 	Input* englacial_input      = element->GetInput(HydrologyEnglacialInputEnum);    _assert_(englacial_input);
-	Input* vx_input             = element->GetInput(VxEnum);                         _assert_(vx_input);
-	Input* vy_input             = element->GetInput(VyEnum);                         _assert_(vy_input);
 	Input* lr_input             = element->GetInput(HydrologyBumpSpacingEnum);       _assert_(lr_input);
 	Input* br_input             = element->GetInput(HydrologyBumpHeightEnum);        _assert_(br_input);
    Input* headold_input        = element->GetInput(HydrologyHeadOldEnum);           _assert_(headold_input);
+//	Input* dgapxx_input	    = element->GetInput(HydrologyGapHeightXXEnum); /***/
+//	Input* dgapyy_input	    = element->GetInput(HydrologyGapHeightYYEnum); /***/
 
 	/*Get conductivity from inputs*/
@@ -284,7 +345,7 @@
 		lr_input->GetInputValue(&lr,gauss);
 		br_input->GetInputValue(&br,gauss);
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
-      headold_input->GetInputValue(&head_old,gauss);
+                headold_input->GetInputValue(&head_old,gauss);
+//		dgapxx_input->GetInputValue(&dgapxx,gauss); /***/
+//		dgapyy_input->GetInputValue(&dgapyy,gauss); /***/
 
 		/*Get ice A parameter*/
@@ -301,7 +362,10 @@
 		/*Compute frictional heat flux*/
 		friction->GetAlpha2(&alpha2,gauss);
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
+		friction->GetBasalSlidingSpeeds(&vx, &vy, gauss);
 		frictionheat=alpha2*(vx*vx+vy*vy);
+
+		/* Take out frictional heat for large gap height */
+		if(gap>br)
+		 frictionheat=0.;
 
 		/*Get water and ice pressures*/
@@ -322,12 +386,27 @@
 		_assert_(meltrate>0.);
 
-		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
-		 (
-		  meltrate*(1/rho_water-1/rho_ice)
-		  +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice - pressure_water)*gap
-		  -beta*sqrt(vx*vx+vy*vy)
-		  +ieb
-		  +storage*head_old/dt
-		  )*basis[i];     	
+                  for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
+                   (
+                    meltrate*(1/rho_water-1/rho_ice)
+                    +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice + rho_water*g*bed)*gap
+                    +(n-1)*A*pow(fabs(pressure_ice - pressure_water),n-1)*(rho_water*g*head)*gap
+                    -beta*sqrt(vx*vx+vy*vy)
+                    +ieb
+                    +storage*head_old/dt
+                    )*basis[i];
+
+                /* Test with experimental diffusivity term*/
+//                   for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
+ //                   (
+  //                   meltrate*(1/rho_water-1/rho_ice)
+   //                  +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice + rho_water*g*bed)*gap
+    //                 +(n-1)*A*pow(fabs(pressure_ice - pressure_water),n-1)*(rho_water*g*head)*gap
+     //                -beta*sqrt(vx*vx+vy*vy)
+      //               +ieb
+       //              +storage*head_old/dt
+        //             +0.e-5*(dgapxx+dgapyy)
+         //            )*basis[i];
+
+	
 	}
 	/*Clean up and return*/
@@ -362,5 +441,4 @@
 
 	/*Get thickness and base on nodes to apply cap on water head*/
-   IssmDouble* eff_pressure = xNew<IssmDouble>(numnodes);
 	IssmDouble* thickness = xNew<IssmDouble>(numnodes);
 	IssmDouble* bed       = xNew<IssmDouble>(numnodes);
@@ -380,20 +458,17 @@
 		values[i]=solution[doflist[i]];
 
-		/*make sure that p_water<p_ice ->  h<rho_i H/rho_w + zb*/
-		if(values[i]>rho_ice*thickness[i]/rho_water+bed[i]){
-			values[i] = rho_ice*thickness[i]/rho_water+bed[i];
-		}
+		/*overburden cap: make sure that p_water<p_ice ->  h<rho_i H/rho_w + zb*/
+//		if(values[i]>rho_ice*thickness[i]/rho_water+bed[i]){
+//			values[i] = rho_ice*thickness[i]/rho_water+bed[i];
+//		}
 
 		/*Make sure that negative pressure is not allowed*/
-  //    if(values[i]<bed[i]){
-	//		values[i] = bed[i];
-	//	}
+//      if(values[i]<bed[i]){
+//			values[i] = bed[i];
+//		}
 
 		/*Under-relaxation*/
 	   values[i] = head_old[i] - relaxation*(head_old[i]-values[i]);
 
-		/*Calculate effective pressure*/
-		eff_pressure[i] = rho_ice*g*thickness[i] - rho_water*g*(values[i]-bed[i]);
-
 		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
 		if(xIsInf<IssmDouble>(values[i])) _error_("Inf found in solution vector");
@@ -402,5 +477,4 @@
 	/*Add input to the element: */
 	element->AddInput(HydrologyHeadEnum,values,element->GetElementType());
-   element->AddInput(EffectivePressureEnum,eff_pressure,P1Enum);
 
 	/*Update reynolds number according to new solution*/
@@ -416,4 +490,7 @@
 	IssmDouble reynolds = conductivity*sqrt(dh[0]*dh[0]+dh[1]*dh[1])/NU;
 	element->AddInput(HydrologyReynoldsEnum,&reynolds,P0Enum);
+
+   /*Compute new effective pressure*/
+   this->UpdateEffectivePressure(element);
 
 	/*Free resources:*/
@@ -423,5 +500,4 @@
 	xDelete<IssmDouble>(xyz_list);
 	xDelete<int>(doflist);
-	xDelete<IssmDouble>(eff_pressure);
    xDelete<IssmDouble>(head_old);
 }/*}}}*/
@@ -464,5 +540,5 @@
 
 	/*Skip if water or ice shelf element*/
-	if(element->IsFloating()) return;
+	if(element->IsAllFloating()) return;
 
 	/*Intermediaries */
@@ -470,5 +546,5 @@
 	IssmDouble  Jdet,meltrate,G,dh[2],B,A,n,dt;
 	IssmDouble  gap,bed,thickness,head;
-	IssmDouble  lr,br,vx,vy,beta;
+	IssmDouble  lr,br,vx,vy,beta,lc;
 	IssmDouble  alpha2,frictionheat;
 	IssmDouble* xyz_list = NULL;
@@ -476,4 +552,6 @@
 	IssmDouble q = 0.;
    IssmDouble channelization = 0.;
+//	IssmDouble dgapxx; /***/
+//	IssmDouble dgapyy; /***/
 
 	/*Retrieve all inputs and parameters*/
@@ -491,8 +569,8 @@
 	Input* B_input              = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
 	Input* n_input              = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
-	Input* vx_input             = element->GetInput(VxEnum);                         _assert_(vx_input);
-	Input* vy_input             = element->GetInput(VyEnum);                         _assert_(vy_input);
 	Input* lr_input             = element->GetInput(HydrologyBumpSpacingEnum);       _assert_(lr_input);
 	Input* br_input             = element->GetInput(HydrologyBumpHeightEnum);        _assert_(br_input);
+ //       Input* dgapxx_input         = element->GetInput(HydrologyGapHeightXXEnum); /***/
+  //      Input* dgapyy_input         = element->GetInput(HydrologyGapHeightYYEnum); /***/
 
 	/*Get conductivity from inputs*/
@@ -520,6 +598,6 @@
 		lr_input->GetInputValue(&lr,gauss);
 		br_input->GetInputValue(&br,gauss);
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
+//		dgapxx_input->GetInputValue(&dgapxx,gauss); /***/
+//		dgapyy_input->GetInputValue(&dgapyy,gauss); /***/
 
 		/*Get ice A parameter*/
@@ -536,7 +614,10 @@
 		/*Compute frictional heat flux*/
 		friction->GetAlpha2(&alpha2,gauss);
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
+		friction->GetBasalSlidingSpeeds(&vx, &vy, gauss);
 		frictionheat=alpha2*(vx*vx+vy*vy);
+
+		/* Take out frictional heat for large gap height */
+		if(gap>br)
+		 frictionheat=0.;
 
 		/*Get water and ice pressures*/
@@ -558,4 +639,14 @@
 					+beta*sqrt(vx*vx+vy*vy)
 					));
+
+		/* TEST with experimental gap height "diffusivity" for melting walls */
+//                newgap += gauss->weight*Jdet*(gap+dt*(
+ //                                        meltrate/rho_ice
+  //                                       -A*pow(fabs(pressure_ice-pressure_water),n-1)*(pressure_ice-pressure_water)*lc
+   //                                      +beta*sqrt(vx*vx+vy*vy)
+//					 +0.e-5*(dgapxx+dgapyy))
+ //                                        );
+
+
 		totalweights +=gauss->weight*Jdet;
 
@@ -592,2 +683,49 @@
 	delete gauss;
 }/*}}}*/
+void HydrologyShaktiAnalysis::UpdateEffectivePressure(FemModel* femmodel){/*{{{*/
+
+	for(Object* & object : femmodel->elements->objects){
+		Element* element=xDynamicCast<Element*>(object);
+		UpdateEffectivePressure(element);
+	}
+
+}/*}}}*/
+void HydrologyShaktiAnalysis::UpdateEffectivePressure(Element* element){/*{{{*/
+
+	/*Skip if water or ice shelf element*/
+	if(element->IsAllFloating()) return;
+
+	/*Intermediaries*/
+	IssmDouble bed,thickness,head;
+
+	/* Fetch number of nodes and allocate output*/
+   int numnodes = element->GetNumberOfNodes();
+   IssmDouble* N = xNew<IssmDouble>(numnodes);
+
+	/*Retrieve all inputs and parameters*/
+	IssmDouble  g          = element->FindParam(ConstantsGEnum);
+	IssmDouble  rho_ice    = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  rho_water  = element->FindParam(MaterialsRhoFreshwaterEnum);
+	Input* head_input      = element->GetInput(HydrologyHeadEnum); _assert_(head_input);
+	Input* thickness_input = element->GetInput(ThicknessEnum);     _assert_(thickness_input);
+	Input* base_input      = element->GetInput(BaseEnum);          _assert_(base_input);
+
+
+   Gauss* gauss=element->NewGauss();
+   for (int i=0;i<numnodes;i++){
+      gauss->GaussNode(element->GetElementType(),i);
+
+		base_input->GetInputValue(&bed,gauss);
+		thickness_input->GetInputValue(&thickness,gauss);
+		head_input->GetInputValue(&head,gauss);
+
+		N[i] = rho_ice*g*thickness - rho_water*g*(head-bed);
+	}
+
+	/*Add new gap as an input*/
+	element->AddInput(EffectivePressureEnum,N,element->GetElementType());
+
+	/*Clean up and return*/
+   xDelete<IssmDouble>(N);
+	delete gauss;
+}/*}}}*/
Index: /issm/trunk/src/c/analyses/HydrologyShaktiAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyShaktiAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/HydrologyShaktiAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
@@ -35,4 +36,6 @@
 		void UpdateGapHeight(FemModel* femmodel);
 		void UpdateGapHeight(Element* element);
+		void UpdateEffectivePressure(FemModel* femmodel);
+		void UpdateEffectivePressure(Element* element);
 };
 #endif
Index: /issm/trunk/src/c/analyses/HydrologyShreveAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 26744)
@@ -58,5 +58,5 @@
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
 	if(iomodel->domaintype!=Domain2DhorizontalEnum){
 		iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
@@ -93,4 +93,7 @@
 /*Finite Element Analysis*/
 void           HydrologyShreveAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           HydrologyShreveAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
@@ -231,5 +234,5 @@
 
 	/*Skip if water or ice shelf element*/
-	if(element->IsFloating()) return NULL;
+	if(element->IsAllFloating()) return NULL;
 
 	/*Intermediaries */
@@ -292,19 +295,33 @@
 	/*Fetch dof list and allocate solution vector*/
 	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
-	IssmDouble* values = xNew<IssmDouble>(numnodes);
+	IssmDouble* watercolumn = xNew<IssmDouble>(numnodes);
 
 	/*Use the dof list to index into the solution vector: */
 	for(int i=0;i<numnodes;i++){
-		values[i]=solution[doflist[i]];
-		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
-		if(xIsInf<IssmDouble>(values[i])) _error_("Inf found in solution vector");
-		if (values[i]<10e-10) values[i]=10e-10; //correcting the water column to positive values
+		watercolumn[i]=solution[doflist[i]];
+		if(xIsNan<IssmDouble>(watercolumn[i])) _error_("NaN found in solution vector");
+		if(xIsInf<IssmDouble>(watercolumn[i])) _error_("Inf found in solution vector");
+		if (watercolumn[i]<10e-10) watercolumn[i]=10e-10; //correcting the water column to positive watercolumn
 	}
 
 	/*Add input to the element: */
-	element->AddInput(WatercolumnEnum,values,element->GetElementType());
+	element->AddInput(WatercolumnEnum,watercolumn,element->GetElementType());
+
+	/*Also update the hydrological loads for the sealevel core: */
+	IssmDouble* oldwatercolumn      = xNew<IssmDouble>(numnodes);
+	IssmDouble* deltawatercolumn = xNew<IssmDouble>(numnodes);
+
+	element->GetInputListOnVertices(&watercolumn[0],WatercolumnEnum);
+	element->GetInputListOnVertices(&oldwatercolumn[0],WaterColumnOldEnum);
+	element->GetInputListOnVertices(&deltawatercolumn[0],AccumulatedDeltaTwsEnum);
+	for(int i=0;i<numnodes;i++){
+		deltawatercolumn[i] += watercolumn[i]-oldwatercolumn[i];
+	}
+	element->AddInput(AccumulatedDeltaTwsEnum,deltawatercolumn,P1Enum);
 
 	/*Free ressources:*/
-	xDelete<IssmDouble>(values);
+	xDelete<IssmDouble>(oldwatercolumn);
+	xDelete<IssmDouble>(deltawatercolumn);
+	xDelete<IssmDouble>(watercolumn);
 	xDelete<int>(doflist);
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/HydrologyShreveAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyShreveAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/HydrologyShreveAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		void           CreateHydrologyWaterVelocityInput(Element* element);
Index: /issm/trunk/src/c/analyses/HydrologyTwsAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyTwsAnalysis.cpp	(revision 26744)
+++ /issm/trunk/src/c/analyses/HydrologyTwsAnalysis.cpp	(revision 26744)
@@ -0,0 +1,103 @@
+#include "./HydrologyTwsAnalysis.h"
+#include <math.h>
+#include "../toolkits/toolkits.h"
+#include "../classes/classes.h"
+#include "../classes/Inputs/TransientInput.h"
+#include "../shared/shared.h"
+#include "../modules/modules.h"
+
+/*Model processing*/
+void HydrologyTwsAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+	/*No constraints*/
+}/*}}}*/
+void HydrologyTwsAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
+	/*No loads*/
+}/*}}}*/
+void HydrologyTwsAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
+	::CreateNodes(nodes,iomodel,HydrologyTwsAnalysisEnum,P1Enum);
+}/*}}}*/
+int  HydrologyTwsAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
+	return 1;
+}/*}}}*/
+void HydrologyTwsAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+
+	int nature=0;
+
+	/*Update elements: */
+	int counter=0;
+	for(int i=0;i<iomodel->numberofelements;i++){
+		if(iomodel->my_elements[i]){
+			Element* element=(Element*)elements->GetObjectByOffset(counter);
+			element->Update(inputs,i,iomodel,analysis_counter,analysis_type,P1Enum);
+			counter++;
+		}
+	}
+
+	/*Plug inputs into element:*/
+	iomodel->FetchDataToInput(inputs,elements,"md.hydrology.spcwatercolum", HydrologyTwsSpcEnum);
+
+	/*Initialize sea level cumulated sea level loads :*/
+	iomodel->ConstantToInput(inputs,elements,0.,AccumulatedDeltaTwsEnum,P1Enum);
+	iomodel->ConstantToInput(inputs,elements,0.,OldAccumulatedDeltaTwsEnum,P1Enum);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.watercolumn",WatercolumnEnum);
+
+}/*}}}*/
+void HydrologyTwsAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+
+}/*}}}*/
+
+/*Finite Element Analysis*/
+void           HydrologyTwsAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           HydrologyTwsAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+ElementVector* HydrologyTwsAnalysis::CreateDVector(Element* element){/*{{{*/
+	/*Default, return NULL*/
+	return NULL;
+}/*}}}*/
+ElementMatrix* HydrologyTwsAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
+_error_("Not implemented");
+}/*}}}*/
+ElementMatrix* HydrologyTwsAnalysis::CreateKMatrix(Element* element){/*{{{*/
+	_error_("not implemented yet");
+}/*}}}*/
+ElementVector* HydrologyTwsAnalysis::CreatePVector(Element* element){/*{{{*/
+_error_("not implemented yet");
+}/*}}}*/
+void           HydrologyTwsAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+	   _error_("not implemented yet");
+}/*}}}*/
+void           HydrologyTwsAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
+	_error_("Not implemented yet");
+}/*}}}*/
+void           HydrologyTwsAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+
+	/*Only update if on base*/
+	if(!element->IsOnBase()) return;
+
+	/*Fetch dof list and allocate solution vector*/
+	int *doflist = NULL;
+	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+
+	int numnodes = element->GetNumberOfNodes();
+	IssmDouble* watercolumn = xNew<IssmDouble>(numnodes);
+
+	/*Use the dof list to index into the solution vector: */
+	for(int i=0;i<numnodes;i++){
+		watercolumn[i]=solution[doflist[i]];
+		/*Check solution*/
+		if(xIsNan<IssmDouble>(watercolumn[i])) _error_("NaN found in solution vector");
+		if(xIsInf<IssmDouble>(watercolumn[i])) _error_("Inf found in solution vector");
+	}
+	element->AddBasalInput(WatercolumnEnum,watercolumn,element->GetElementType());
+
+	xDelete<int>(doflist);
+	xDelete<IssmDouble>(watercolumn);
+
+}/*}}}*/
+void           HydrologyTwsAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+	/*Default, do nothing*/
+	return;
+}/*}}}*/
Index: /issm/trunk/src/c/analyses/HydrologyTwsAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyTwsAnalysis.h	(revision 26744)
+++ /issm/trunk/src/c/analyses/HydrologyTwsAnalysis.h	(revision 26744)
@@ -0,0 +1,34 @@
+/*! \file HydrologyTwsAnalysis.h 
+ *  \brief: header file for generic external result object
+ */
+
+#ifndef _HydrologyTwsAnalysis_
+#define _HydrologyTwsAnalysis_
+
+/*Headers*/
+#include "./Analysis.h"
+
+class HydrologyTwsAnalysis: public Analysis{
+
+	public:
+		/*Model processing*/
+		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
+		void CreateLoads(Loads* loads, IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
+		int  DofsPerNode(int** doflist,int domaintype,int approximation);
+		void UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type);
+		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
+
+		/*Finite element Analysis*/
+		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
+		ElementVector* CreateDVector(Element* element);
+		ElementMatrix* CreateJacobianMatrix(Element* element);
+		ElementMatrix* CreateKMatrix(Element* element);
+		ElementVector* CreatePVector(Element* element);
+		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+		void           GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index);
+		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
+		void           UpdateConstraints(FemModel* femmodel);
+};
+#endif
Index: /issm/trunk/src/c/analyses/L2ProjectionBaseAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 26744)
@@ -41,6 +41,6 @@
 
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
-   iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
 	if(iomodel->domaintype!=Domain2DhorizontalEnum & iomodel->domaintype!=Domain3DsurfaceEnum){
@@ -54,4 +54,7 @@
 /*Finite Element Analysis*/
 void           L2ProjectionBaseAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           L2ProjectionBaseAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
@@ -114,5 +117,5 @@
 	xDelete<IssmDouble>(basis);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return Ke;
 }/*}}}*/
@@ -164,4 +167,8 @@
 		case BaseSlopeXEnum:    input2 = basalelement->GetInput(BaseEnum);    _assert_(input2); break;
 		case BaseSlopeYEnum:    input2 = basalelement->GetInput(BaseEnum);    _assert_(input2); break;
+		case HydrologyGapHeightXEnum:    input2 = basalelement->GetInput(HydrologyGapHeightEnum);  _assert_(input2); break;
+		case HydrologyGapHeightXXEnum:   input2 = basalelement->GetInput(HydrologyGapHeightXEnum); _assert_(input2); break;
+		case HydrologyGapHeightYEnum:    input2 = basalelement->GetInput(HydrologyGapHeightEnum);  _assert_(input2); break;
+		case HydrologyGapHeightYYEnum:   input2 = basalelement->GetInput(HydrologyGapHeightYEnum); _assert_(input2); break;
 		case LevelsetfunctionSlopeXEnum: input2 = basalelement->GetInput(MaskIceLevelsetEnum);     _assert_(input2); break;
 		case LevelsetfunctionSlopeYEnum: input2 = basalelement->GetInput(MaskIceLevelsetEnum);     _assert_(input2); break;
@@ -178,7 +185,14 @@
 		if(input2) input2->GetInputDerivativeValue(&slopes[0],xyz_list,gauss);
 		switch(input_enum){
-			case SurfaceSlopeXEnum: case BedSlopeXEnum: case BaseSlopeXEnum: case LevelsetfunctionSlopeXEnum: value = slopes[0]; break;
-			case SurfaceSlopeYEnum: case BedSlopeYEnum: case BaseSlopeYEnum: case LevelsetfunctionSlopeYEnum: value = slopes[1]; break;
-			default: input->GetInputValue(&value,gauss);
+			case SurfaceSlopeXEnum: case BedSlopeXEnum: case BaseSlopeXEnum: case LevelsetfunctionSlopeXEnum: 
+			case HydrologyGapHeightXEnum: case HydrologyGapHeightXXEnum:
+				value = slopes[0];
+				break;
+			case SurfaceSlopeYEnum: case BedSlopeYEnum: case BaseSlopeYEnum: case LevelsetfunctionSlopeYEnum: 
+			case HydrologyGapHeightYEnum: case HydrologyGapHeightYYEnum:
+				value = slopes[1];
+				break;
+			default:
+				input->GetInputValue(&value,gauss);
 		}
 
@@ -190,5 +204,5 @@
 	xDelete<IssmDouble>(basis);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return pe;
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/L2ProjectionBaseAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/L2ProjectionBaseAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/L2ProjectionBaseAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/L2ProjectionEPLAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/L2ProjectionEPLAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/L2ProjectionEPLAnalysis.cpp	(revision 26744)
@@ -74,4 +74,7 @@
 	_error_("not implemented");
 }/*}}}*/
+void           L2ProjectionEPLAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
 ElementVector* L2ProjectionEPLAnalysis::CreateDVector(Element* element){/*{{{*/
 	/*Default, return NULL*/
@@ -109,8 +112,5 @@
 	/* Check that all nodes are active, else return empty matrix */
 	if(!active_element){
-		if(domaintype!=Domain2DhorizontalEnum){
-			basalelement->DeleteMaterials();
-			delete basalelement;
-		}
+		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 		return NULL;
 	}
@@ -144,5 +144,5 @@
 	xDelete<IssmDouble>(basis);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return Ke;
 }/*}}}*/
@@ -171,8 +171,5 @@
 	/*Check that all nodes are active, else return empty matrix*/
 	if(!active_element) {
-		if(domaintype!=Domain2DhorizontalEnum){
-			basalelement->DeleteMaterials();
-			delete basalelement;
-		}
+		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 		return NULL;
 	}
@@ -215,5 +212,5 @@
 	xDelete<IssmDouble>(basis);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return pe;
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/L2ProjectionEPLAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/L2ProjectionEPLAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/L2ProjectionEPLAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/LevelsetAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/LevelsetAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/LevelsetAnalysis.cpp	(revision 26744)
@@ -12,7 +12,37 @@
 
 void LevelsetAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+	
+	/*intermediary: */
 	int finiteelement;
+	int         code,vector_layout;
+	IssmDouble *spcdata = NULL;
+	int         M,N;
+
+	/*Get finite element type for this analysis*/
 	iomodel->FindConstant(&finiteelement,"md.levelset.fe");
-	IoModelToConstraintsx(constraints,iomodel,"md.levelset.spclevelset",LevelsetAnalysisEnum,finiteelement);
+
+	/*First of, find the record for the enum, and get code  of data type: */
+	iomodel->SetFilePointerToData(&code, &vector_layout,"md.levelset.spclevelset");
+	if(code!=7)_error_("expecting a IssmDouble vector for constraints md.levelset.spclevelset");
+	if(vector_layout!=1)_error_("expecting a nodal vector for constraints md.levelset.spclevelset");
+
+	/*Fetch vector:*/
+	iomodel->FetchData(&spcdata,&M,&N,"md.levelset.spclevelset");
+
+	/*Call IoModelToConstraintsx*/
+	if(N>1){
+		/*If it is a time series, most likely we are forcing the ice front position and do not want to have a Dynamic Constraint*/
+		_assert_(M==iomodel->numberofvertices+1);
+		IoModelToConstraintsx(constraints,iomodel,spcdata,M,N,LevelsetAnalysisEnum,finiteelement);
+	}
+	else{
+		/*This is not a time series, we probably have calving on, we need the levelset constraints to update as the levelset moves*/
+		_assert_(N==1);
+		_assert_(M==iomodel->numberofvertices);
+		IoModelToDynamicConstraintsx(constraints,iomodel,spcdata,M,N,LevelsetAnalysisEnum,finiteelement);
+	}
+
+	/*Clean up*/
+	xDelete<IssmDouble>(spcdata);
 }
 /*}}}*/
@@ -53,10 +83,16 @@
 
 	/*Get moving front parameters*/
-	int  calvinglaw;
-	iomodel->FindConstant(&calvinglaw,"md.calving.law");
-	switch(calvinglaw){
-		case DefaultCalvingEnum:
-			iomodel->FetchDataToInput(inputs,elements,"md.calving.calvingrate",CalvingCalvingrateEnum);
-			break;
+	bool isstochastic;
+   int  calvinglaw;
+   iomodel->FindConstant(&calvinglaw,"md.calving.law");
+   iomodel->FindConstant(&isstochastic,"md.stochasticforcing.isstochasticforcing");
+   switch(calvinglaw){
+      case DefaultCalvingEnum:
+         iomodel->FetchDataToInput(inputs,elements,"md.calving.calvingrate",CalvingCalvingrateEnum);
+         if(isstochastic){
+				iomodel->FetchDataToInput(inputs,elements,"md.stochasticforcing.default_id",StochasticForcingDefaultIdEnum);
+            iomodel->FetchDataToInput(inputs,elements,"md.calving.calvingrate",BaselineCalvingCalvingrateEnum);
+         }
+         break;	
 		case CalvingLevermannEnum:
 			iomodel->FetchDataToInput(inputs,elements,"md.calving.coeff",CalvinglevermannCoeffEnum);
@@ -92,8 +128,11 @@
 			break;
 		case FrontalForcingsRignotEnum:
-			iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.basin",FrontalForcingsBasinIdEnum);
-			iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.subglacial_discharge",FrontalForcingsSubglacialDischargeEnum);
-			iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.thermalforcing",FrontalForcingsThermalForcingEnum);
-			break;
+         /*Retrieve thermal forcing only in the case of non-autoregressive FrontalForcingsRignot*/
+         iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.thermalforcing",FrontalForcingsThermalForcingEnum);
+         /* Do not break here, still retrieve basin_ID,subglacial_discharge, etc.*/
+      case FrontalForcingsRignotAutoregressionEnum:
+         iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.basin_id",FrontalForcingsBasinIdEnum);
+         iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.subglacial_discharge",FrontalForcingsSubglacialDischargeEnum);
+         break;	
 		default:
 			_error_("Frontal forcings"<<EnumToStringx(melt_parameterization)<<" not supported yet");
@@ -124,4 +163,5 @@
 		case CalvingCrevasseDepthEnum:
 			parameters->AddObject(iomodel->CopyConstantObject("md.calving.crevasse_opening_stress",CalvingCrevasseDepthEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.calving.crevasse_threshold",CalvingCrevasseThresholdEnum));
 			break;
 		case CalvingDev2Enum:
@@ -135,9 +175,26 @@
 	int melt_parameterization;
 	iomodel->FindConstant(&melt_parameterization,"md.frontalforcings.parameterization");
+	int M,N;
+	IssmDouble* transparam = NULL;
 	switch(melt_parameterization){
 		case FrontalForcingsDefaultEnum:
 			break;
+		case FrontalForcingsRignotAutoregressionEnum:
+			/*Retrieve autoregressive parameters*/
+         parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.ar_order",FrontalForcingsAutoregressiveOrderEnum));
+         parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.ar_initialtime",FrontalForcingsAutoregressionInitialTimeEnum));
+         parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.ar_timestep",FrontalForcingsAutoregressionTimestepEnum));
+			iomodel->FetchData(&transparam,&M,&N,"md.frontalforcings.beta0");
+         parameters->AddObject(new DoubleVecParam(FrontalForcingsBeta0Enum,transparam,N));
+         xDelete<IssmDouble>(transparam);
+         iomodel->FetchData(&transparam,&M,&N,"md.frontalforcings.beta1");
+         parameters->AddObject(new DoubleVecParam(FrontalForcingsBeta1Enum,transparam,N));
+         xDelete<IssmDouble>(transparam);
+         iomodel->FetchData(&transparam,&M,&N,"md.frontalforcings.phi");
+         parameters->AddObject(new DoubleMatParam(FrontalForcingsPhiEnum,transparam,M,N));
+         xDelete<IssmDouble>(transparam);
+			/*Do not break here, generic FrontalForcingsRignot parameters still to be retrieved*/
 		case FrontalForcingsRignotEnum:
-			parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.numberofbasins",FrontalForcingsNumberofBasinsEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.num_basins",FrontalForcingsNumberofBasinsEnum));
 			break;
 		default:
@@ -172,4 +229,7 @@
 	}
 }/*}}}*/
+void           LevelsetAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
 ElementVector* LevelsetAnalysis::CreateDVector(Element* element){/*{{{*/
 	/*Default, return NULL*/
@@ -186,17 +246,15 @@
 
 	/*Intermediaries */
-	int  stabilization,dim, domaintype, calvinglaw;
+	int  stabilization,dim,domaintype;
 	int i,j,k,row, col;
 	IssmDouble kappa;
 	IssmDouble Jdet, dt, D_scalar;
 	IssmDouble h,hx,hy,hz;
-	IssmDouble vel,v[3],w[3],c[3],m[3],dlsf[3];
-	IssmDouble norm_dlsf, norm_calving, calvingrate, meltingrate, groundedice;
-	IssmDouble migrationmax, calvinghaf, heaviside, haf_eps;
+	IssmDouble vel,w[3];
+	IssmDouble migrationmax;
 	IssmDouble* xyz_list = NULL;
 
 	/*Get problem dimension and whether there is moving front or not*/
 	basalelement->FindParam(&domaintype,DomainTypeEnum);
-	basalelement->FindParam(&calvinglaw,CalvingLawEnum);
 	basalelement->FindParam(&stabilization,LevelsetStabilizationEnum);
 	switch(domaintype){
@@ -206,7 +264,4 @@
 		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
 	}
-
-	/*Calving threshold*/
-
 	/*Fetch number of nodes and dof for this finite element*/
 	int numnodes    = basalelement->GetNumberOfNodes();
@@ -216,8 +271,4 @@
 	IssmDouble*    basis    = xNew<IssmDouble>(numnodes);
 	IssmDouble*    dbasis   = xNew<IssmDouble>(2*numnodes);
-	IssmDouble*    Bprime = NULL;
-	if(stabilization==2){
-		Bprime   = xNew<IssmDouble>(dim*numnodes);
-	}
 
 	/*Retrieve all inputs and parameters*/
@@ -225,82 +276,24 @@
 	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
 	basalelement->FindParam(&migrationmax,MigrationMaxEnum);
-	Input* vx_input           = NULL;
-	Input* vy_input           = NULL;
-	Input* calvingratex_input = NULL;
-	Input* calvingratey_input = NULL;
-	Input* lsf_slopex_input   = NULL;
-	Input* lsf_slopey_input   = NULL;
-	Input* calvingrate_input  = NULL;
-	Input* meltingrate_input  = NULL;
-	Input* gr_input           = NULL;
+
+	h = basalelement->CharacteristicLength();
+
+	Input* mf_vx_input        = NULL;
+	Input* mf_vy_input        = NULL;
 
 	/*Load velocities*/
 	switch(domaintype){
 		case Domain2DverticalEnum:
-			vx_input=basalelement->GetInput(VxEnum); _assert_(vx_input);
+			mf_vx_input=basalelement->GetInput(MovingFrontalVxEnum); _assert_(mf_vx_input);
 			break;
 		case Domain2DhorizontalEnum:
-			vx_input=basalelement->GetInput(VxEnum); _assert_(vx_input);
-			vy_input=basalelement->GetInput(VyEnum); _assert_(vy_input);
-			gr_input=basalelement->GetInput(MaskOceanLevelsetEnum); _assert_(gr_input);
+			mf_vx_input=basalelement->GetInput(MovingFrontalVxEnum); _assert_(mf_vx_input);
+			mf_vy_input=basalelement->GetInput(MovingFrontalVyEnum); _assert_(mf_vy_input);
 			break;
 		case Domain3DEnum:
-			vx_input=basalelement->GetInput(VxAverageEnum); _assert_(vx_input);
-			vy_input=basalelement->GetInput(VyAverageEnum); _assert_(vy_input);
-			gr_input=basalelement->GetInput(MaskOceanLevelsetEnum); _assert_(gr_input);
+			mf_vx_input=basalelement->GetInput(MovingFrontalVxEnum); _assert_(mf_vx_input);
+			mf_vy_input=basalelement->GetInput(MovingFrontalVyEnum); _assert_(mf_vy_input);
 			break;
 		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
-	}
-
-	/*Load calving inputs*/
-	switch(calvinglaw){
-		case DefaultCalvingEnum:
-		case CalvingVonmisesEnum:
-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
-			calvingrate_input = basalelement->GetInput(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
-			break;
-		case CalvingLevermannEnum:
-			switch(domaintype){
-				case Domain2DverticalEnum:
-					calvingratex_input=basalelement->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
-					break;
-				case Domain2DhorizontalEnum:
-					calvingratex_input=basalelement->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
-					calvingratey_input=basalelement->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
-					break;
-				case Domain3DEnum:
-					calvingratex_input=basalelement->GetInput(CalvingratexAverageEnum); _assert_(calvingratex_input);
-					calvingratey_input=basalelement->GetInput(CalvingrateyAverageEnum); _assert_(calvingratey_input);
-					break;
-				default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
-			}
-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
-			break;
-		case CalvingMinthicknessEnum:
-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
-			break;
-		case CalvingHabEnum:
-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
-			break;
-		case CalvingCrevasseDepthEnum:
-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
-			break;
-		case CalvingDev2Enum:
-			basalelement->FindParam(&calvinghaf,CalvingHeightAboveFloatationEnum);
-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
-			calvingrate_input = basalelement->GetInput(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
-			break;
-		default:
-			_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
 	}
 
@@ -324,163 +317,16 @@
 		}
 
-		/* Advection */
-		vx_input->GetInputValue(&v[0],gauss);
-		vy_input->GetInputValue(&v[1],gauss);
-		gr_input->GetInputValue(&groundedice,gauss);
-
-		/*Get calving speed*/
-		switch(calvinglaw){
-			case DefaultCalvingEnum:
-			case CalvingVonmisesEnum:
-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
-				calvingrate_input->GetInputValue(&calvingrate,gauss);
-				meltingrate_input->GetInputValue(&meltingrate,gauss);
-
-				/*Limit calving rate to c <= v + 3 km/yr */
-				vel=sqrt(v[0]*v[0] + v[1]*v[1]);
-				if(calvingrate>migrationmax+vel) calvingrate = vel+migrationmax;
-				if(groundedice<0) meltingrate = 0.;
-
-				norm_dlsf=0.;
-				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
-				norm_dlsf=sqrt(norm_dlsf);
-
-				if(norm_dlsf>1.e-10)
-				 for(i=0;i<dim;i++){
-					 c[i]=calvingrate*dlsf[i]/norm_dlsf; m[i]=meltingrate*dlsf[i]/norm_dlsf;
-				 }
-				else
-				 for(i=0;i<dim;i++){
-					 c[i]=0.; m[i]=0.;
-				 }
-				break;
-
-			case CalvingLevermannEnum:
-				calvingratex_input->GetInputValue(&c[0],gauss);
-				if(dim==2) calvingratey_input->GetInputValue(&c[1],gauss);
-				meltingrate_input->GetInputValue(&meltingrate,gauss);
-				norm_calving=0.;
-				for(i=0;i<dim;i++) norm_calving+=pow(c[i],2);
-				norm_calving=sqrt(norm_calving)+1.e-14;
-				for(i=0;i<dim;i++) m[i]=meltingrate*c[i]/norm_calving;
-				break;
-
-			case CalvingMinthicknessEnum:
-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
-				meltingrate_input->GetInputValue(&meltingrate,gauss);
-
-				norm_dlsf=0.;
-				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
-				norm_dlsf=sqrt(norm_dlsf);
-
-				if(norm_dlsf>1.e-10)
-				 for(i=0;i<dim;i++){
-					 c[i]=0.;
-					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
-				 }
-				else
-				 for(i=0;i<dim;i++){
-					 c[i]=0.;
-					 m[i]=0.;
-				 }
-				break;
-
-			case CalvingHabEnum:
-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
-				meltingrate_input->GetInputValue(&meltingrate,gauss);
-
-				norm_dlsf=0.;
-				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
-				norm_dlsf=sqrt(norm_dlsf);
-
-				if(norm_dlsf>1.e-10)
-				 for(i=0;i<dim;i++){
-					 c[i]=0.;
-					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
-				 }
-				else
-				 for(i=0;i<dim;i++){
-					 c[i]=0.;
-					 m[i]=0.;
-				 }
-				break;
-
-			case CalvingCrevasseDepthEnum:
-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
-				meltingrate_input->GetInputValue(&meltingrate,gauss);
-
-				if(groundedice<0) meltingrate = 0.;
-
-				norm_dlsf=0.;
-				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
-				norm_dlsf=sqrt(norm_dlsf);
-
-				if(norm_dlsf>1.e-10)
-				 for(i=0;i<dim;i++){
-					 c[i]=0.;
-					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
-				 }
-				else
-				 for(i=0;i<dim;i++){
-					 c[i]=0.;
-					 m[i]=0.;
-				 }
-				break;
-
-			case CalvingDev2Enum:
-				  {
-					lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
-					if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
-					calvingrate_input->GetInputValue(&calvingrate,gauss);
-					meltingrate_input->GetInputValue(&meltingrate,gauss);
-					gr_input->GetInputValue(&groundedice,gauss);
-
-					//idea: no retreat on ice above critical calving height "calvinghaf" . Limit using regularized Heaviside function.
-					vel=sqrt(v[0]*v[0] + v[1]*v[1]);
-					haf_eps=10.;
-					if(groundedice-calvinghaf<=-haf_eps){
-						// ice floats freely below calvinghaf: calve freely
-						// undercutting has no effect:
-						meltingrate=0.;
-					}
-					else if(groundedice-calvinghaf>=haf_eps){
-						// ice is well above calvinghaf -> no calving back, i.e. limit calving rate to ice velocity
-						calvingrate=min(calvingrate,vel);
-						// ice is almost grounded: frontal undercutting has maximum effect (do nothing).
-					}
-					else{ // ice is close to calvinghaf: smooth transition between limitation and free calving.
-						//heaviside: 0 for floating, 1 for grounded
-						heaviside=(groundedice-calvinghaf+haf_eps)/(2.*haf_eps) + sin(PI*(groundedice-calvinghaf)/haf_eps)/(2.*PI);
-						calvingrate=heaviside*(min(calvingrate,vel)-calvingrate)+calvingrate;
-						meltingrate=heaviside*meltingrate+0.;
-					}
-
-					norm_dlsf=0.;
-					for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
-					norm_dlsf=sqrt(norm_dlsf);
-
-					if(norm_dlsf>1.e-10)
-					 for(i=0;i<dim;i++){
-						 c[i]=calvingrate*dlsf[i]/norm_dlsf;
-						 m[i]=meltingrate*dlsf[i]/norm_dlsf;
-					 }
-					else
-					 for(i=0;i<dim;i++){
-						 c[i]=0.;
-						 m[i]=0.;
-					 }
-					break;
-				  }
-
-			default:
-				_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
-		}
-
-		/*Levelset speed is ice velocity - calving rate*/
-		for(i=0;i<dim;i++) w[i]=v[i]-c[i]-m[i];
+		/* Levelset speed */
+		mf_vx_input->GetInputValue(&w[0], gauss);
+		mf_vy_input->GetInputValue(&w[1], gauss);
+
+		/* Apply limiter to the migration rate */		
+		vel = 0.;
+		for(i=0;i<dim;i++) vel += w[i]*w[i];
+		vel = sqrt(vel)+1e-14;
+		/* !!NOTE: This is different from the previous version 25838 (and before). The current threshold restrict both advance and retreat velocity. */
+		if (vel > migrationmax) {
+			for(i=0;i<dim;i++) w[i] = w[i]/vel*migrationmax;
+		}
 
 		/*Compute D*/
@@ -499,5 +345,5 @@
 		switch(stabilization){
 			case 0:
-				// no stabilization, do nothing
+				/*Nothing to be done*/
 				break;
 			case 1:
@@ -517,16 +363,41 @@
 				  {
 					/* Streamline Upwinding */
-					basalelement->ElementSizes(&hx,&hy,&hz);
-					h=sqrt( pow(hx*w[0]/vel,2) + pow(hy*w[1]/vel,2) );
+					mf_vx_input->GetInputAverage(&w[0]);
+					mf_vy_input->GetInputAverage(&w[1]);
+					vel=sqrt(w[0]*w[0]+w[1]*w[1])+1.e-8;
+					IssmDouble tau=h/(2*vel);
 					for(int i=0;i<numnodes;i++){
 						for(int j=0;j<numnodes;j++){
-							Ke->values[i*numnodes+j] += D_scalar*h/(2.*vel)*(
-										dbasis[0*numnodes+i] *(w[0]*w[0]*dbasis[0*numnodes+j] + w[0]*w[1]*dbasis[1*numnodes+j]) +
-										dbasis[1*numnodes+i] *(w[1]*w[0]*dbasis[0*numnodes+j] + w[1]*w[1]*dbasis[1*numnodes+j]) 
-										);
+							Ke->values[i*numnodes+j]+=dt*gauss->weight*Jdet*tau*(
+										w[0]*dbasis[0*numnodes+i]+w[1]*dbasis[1*numnodes+i])*(w[0]*dbasis[0*numnodes+j]+w[1]*dbasis[1*numnodes+j]);
 						}
 					}
 				  }
 				break;
+			case 5:{
+				/*SUPG*/
+				IssmDouble vx,vy;
+				mf_vx_input->GetInputAverage(&vx);
+				mf_vy_input->GetInputAverage(&vy);
+				vel=sqrt(vx*vx+vy*vy)+1.e-8;
+				IssmPDouble xi=1.;
+				IssmDouble  tau=xi*h/(2*vel);
+
+				/*Mass matrix - part 2*/
+				for(int i=0;i<numnodes;i++){
+					for(int j=0;j<numnodes;j++){
+						Ke->values[i*numnodes+j]+=gauss->weight*Jdet*tau*basis[j]*(vx*dbasis[0*numnodes+i]+vy*dbasis[1*numnodes+i]);
+					}
+				}
+
+				/*Advection matrix - part 2, A*/
+				for(int i=0;i<numnodes;i++){
+					for(int j=0;j<numnodes;j++){
+						Ke->values[i*numnodes+j]+=dt*gauss->weight*Jdet*tau*(vx*dbasis[0*numnodes+j]+vy*dbasis[1*numnodes+j])*(vx*dbasis[0*numnodes+i]+vy*dbasis[1*numnodes+i]);
+					}
+				}
+
+				break;
+			}
 			default:
 				_error_("unknown type of stabilization in LevelsetAnalysis.cpp");
@@ -538,7 +409,6 @@
 	xDelete<IssmDouble>(basis);
 	xDelete<IssmDouble>(dbasis);
-	xDelete<IssmDouble>(Bprime);
 	delete gauss;
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return Ke;
 }/*}}}*/
@@ -549,5 +419,5 @@
 
 	/*Intermediaries */
-	int domaintype;
+	int         domaintype,stabilization;
 	IssmDouble  Jdet,dt;
 	IssmDouble  lsf;
@@ -556,35 +426,56 @@
 	/*Fetch number of nodes and dof for this finite element*/
 	int numnodes = basalelement->GetNumberOfNodes();
+	basalelement->FindParam(&stabilization,LevelsetStabilizationEnum);
 
 	/*Initialize Element vector*/
 	ElementVector* pe = basalelement->NewElementVector();
-	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
-
-	if(dt!=0.){
-		/*Initialize basis vector*/
-		IssmDouble*    basis = xNew<IssmDouble>(numnodes);
-
-		/*Retrieve all inputs and parameters*/
-		basalelement->GetVerticesCoordinates(&xyz_list);
-		Input* levelset_input     = basalelement->GetInput(MaskIceLevelsetEnum);                    _assert_(levelset_input);
-
-		/* Start  looping on the number of gaussian points: */
-		Gauss* gauss=basalelement->NewGauss(2);
-		while(gauss->next()){
-			basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
-			basalelement->NodalFunctions(basis,gauss);
-
-			/* old function value */
-			levelset_input->GetInputValue(&lsf,gauss);
-			for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*lsf*basis[i];
-		}
-
-		/*Clean up and return*/
-		xDelete<IssmDouble>(xyz_list);
-		xDelete<IssmDouble>(basis);
-		basalelement->FindParam(&domaintype,DomainTypeEnum);
-		if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
-		delete gauss;
-	}
+	basalelement->FindParam(&dt,TimesteppingTimeStepEnum); _assert_(dt>0.);
+
+	/*Initialize basis vector*/
+	IssmDouble*    basis = xNew<IssmDouble>(numnodes);
+	IssmDouble*    dbasis = NULL;
+	if(stabilization==5) dbasis= xNew<IssmDouble>(2*numnodes);
+
+	/*Retrieve all inputs and parameters*/
+	basalelement->GetVerticesCoordinates(&xyz_list);
+	Input* levelset_input = basalelement->GetInput(MaskIceLevelsetEnum); _assert_(levelset_input);
+	Input* mf_vx_input    = basalelement->GetInput(MovingFrontalVxEnum); _assert_(mf_vx_input);
+	Input* mf_vy_input    = basalelement->GetInput(MovingFrontalVyEnum); _assert_(mf_vy_input);
+
+	IssmDouble h=basalelement->CharacteristicLength();
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=basalelement->NewGauss(2);
+	while(gauss->next()){
+		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
+		basalelement->NodalFunctions(basis,gauss);
+
+		/* old function value */
+		levelset_input->GetInputValue(&lsf,gauss);
+		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*lsf*basis[i];
+
+		if(stabilization==5){ /*SUPG*/
+         IssmDouble vx,vy,vel;
+			basalelement->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+			mf_vx_input->GetInputAverage(&vx);
+			mf_vy_input->GetInputAverage(&vy);
+			vel=sqrt(vx*vx+vy*vy)+1.e-8;
+			IssmPDouble xi=1.;
+			IssmDouble  tau=xi*h/(2*vel);
+
+			/*Force vector - part 2*/
+			for(int i=0;i<numnodes;i++){
+				pe->values[i]+=Jdet*gauss->weight*lsf*(tau*vx*dbasis[0*numnodes+i]+tau*vy*dbasis[1*numnodes+i]);
+			}
+		}
+	}
+
+	/*Clean up and return*/
+	xDelete<IssmDouble>(xyz_list);
+	xDelete<IssmDouble>(basis);
+   xDelete<IssmDouble>(dbasis);
+	basalelement->FindParam(&domaintype,DomainTypeEnum);
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+	delete gauss;
 
 	return pe;
@@ -615,5 +506,5 @@
 }/*}}}*/
 void           LevelsetAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
-	_error_("not implemented yet");
+	element->GetSolutionFromInputsOneDof(solution,MaskIceLevelsetEnum);
 }/*}}}*/
 void           LevelsetAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
@@ -637,17 +528,12 @@
 
 	/*Intermediaries*/
-	int         calvinglaw;
-	IssmDouble  min_thickness,thickness,hab_fraction;
-	IssmDouble	crevassedepth,surface_crevasse,surface,critical_fraction;
-	IssmDouble  rho_ice,rho_water;
-	IssmDouble  bed,water_depth;
-	IssmDouble  levelset,sealevel;
-
+	int  calvinglaw;
 	femmodel->parameters->FindParam(&calvinglaw,CalvingLawEnum);
 
 	if(calvinglaw==CalvingMinthicknessEnum || calvinglaw==CalvingVonmisesEnum){
 
-		/*Get minimum thickness threshold*/
-		femmodel->parameters->FindParam(&min_thickness,CalvingMinthicknessEnum);
+		/*Intermediaries*/
+		IssmDouble thickness,bed,sealevel;
+		IssmDouble min_thickness = femmodel->parameters->FindParam(CalvingMinthicknessEnum);
 
 		/*Loop over all elements of this partition*/
@@ -681,6 +567,8 @@
 		}
 	}
-
-	if(calvinglaw==CalvingHabEnum){
+   else if(calvinglaw==CalvingHabEnum){
+
+		/*Intermediaries*/
+		IssmDouble  thickness,water_depth,levelset,hab_fraction;
 
 		/*Get the fraction of the flotation thickness at the terminus*/
@@ -692,6 +580,6 @@
 			Element* element  = xDynamicCast<Element*>(object);
 
-			rho_ice = element->FindParam(MaterialsRhoIceEnum);
-			rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+			IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+			IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
 
 			int      numnodes           = element->GetNumberOfNodes();
@@ -724,9 +612,8 @@
 		}
 	}
-
-	if(calvinglaw==CalvingCrevasseDepthEnum){
-
-		int                 nflipped,local_nflipped;
-		Vector<IssmDouble>* vec_constraint_nodes = NULL;
+   else if(calvinglaw==CalvingCrevasseDepthEnum){
+
+		/*Intermediaries*/
+		IssmDouble  levelset,crevassedepth,bed,surface_crevasse,thickness,surface;
 		IssmDouble* constraint_nodes = NULL;
 
@@ -736,15 +623,22 @@
 
 		/*Vector of size number of nodes*/
-		vec_constraint_nodes=new Vector<IssmDouble>(femmodel->nodes->NumberOfNodes());
+      int numnodes      = femmodel->nodes->NumberOfNodes();
+      int localmasters  = femmodel->nodes->NumberOfNodesLocal();
+      Vector<IssmDouble>* vec_constraint_nodes = vec_constraint_nodes=new Vector<IssmDouble>(localmasters,numnodes);
+
+		IssmDouble crevasse_threshold = femmodel->parameters->FindParam(CalvingCrevasseThresholdEnum);
+		IssmDouble mig_max            = femmodel->parameters->FindParam(MigrationMaxEnum);
+		IssmDouble dt                 = femmodel->parameters->FindParam(TimesteppingTimeStepEnum);
 
 		for(Object* & object : femmodel->elements->objects){
-			Element* element               = xDynamicCast<Element*>(object);
-			int      numnodes              = element->GetNumberOfNodes();
-			Gauss*   gauss                 = element->NewGauss();
-			Input*   crevassedepth_input   = element->GetInput(CrevasseDepthEnum); _assert_(crevassedepth_input);
-			Input*   bed_input             = element->GetInput(BedEnum); _assert_(bed_input);
+			Element* element   = xDynamicCast<Element*>(object);
+			int      numnodes  = element->GetNumberOfNodes();
+			Gauss*   gauss     = element->NewGauss();
+
+			Input*   crevassedepth_input    = element->GetInput(CrevasseDepthEnum); _assert_(crevassedepth_input);
+			Input*   bed_input              = element->GetInput(BedEnum); _assert_(bed_input);
 			Input*   surface_crevasse_input = element->GetInput(SurfaceCrevasseEnum); _assert_(surface_crevasse_input);
-			Input*   thickness_input       = element->GetInput(ThicknessEnum); _assert_(thickness_input);
-			Input*   surface_input         = element->GetInput(SurfaceEnum); _assert_(surface_input);
+			Input*   thickness_input        = element->GetInput(ThicknessEnum); _assert_(thickness_input);
+			Input*   surface_input          = element->GetInput(SurfaceEnum); _assert_(surface_input);
 
 			/*First, look at ice front and figure out if any of the nodes will be calved*/
@@ -761,6 +655,6 @@
 					surface_input->GetInputValue(&surface,gauss);
 
-					if((surface_crevasse-surface>0. || crevassedepth-thickness>0.) && bed<0.){
-						vec_constraint_nodes->SetValue(node->Sid(),1.0,INS_VAL);
+					if((surface_crevasse>surface || crevassedepth>crevasse_threshold*thickness) && bed<0.){
+						vec_constraint_nodes->SetValue(node->Pid(),1.0,INS_VAL);
 					}
 				}
@@ -771,19 +665,19 @@
 		/*Assemble vector and serialize: */
 		vec_constraint_nodes->Assemble();
-		constraint_nodes=vec_constraint_nodes->ToMPISerial();
-
-		nflipped=1;
+      femmodel->GetLocalVectorWithClonesNodes(&constraint_nodes,vec_constraint_nodes);
+
+		int nflipped=1;
 		while(nflipped){
-			local_nflipped=0;
+			int local_nflipped=0;
 			for(Object* & object : femmodel->elements->objects){
-				Element* element                = xDynamicCast<Element*>(object);
-				int      numnodes               = element->GetNumberOfNodes();
-				Gauss*   gauss                  = element->NewGauss();
-				Input*   levelset_input         = element->GetInput(DistanceToCalvingfrontEnum); _assert_(levelset_input);
-				Input*   crevassedepth_input    = element->GetInput(CrevasseDepthEnum); _assert_(crevassedepth_input);
-				Input*   bed_input              = element->GetInput(BedEnum); _assert_(bed_input);
-				Input*   surface_crevasse_input = element->GetInput(SurfaceCrevasseEnum); _assert_(surface_crevasse_input);
-				Input*   thickness_input        = element->GetInput(ThicknessEnum); _assert_(thickness_input);
-				Input*   surface_input          = element->GetInput(SurfaceEnum); _assert_(surface_input);
+				Element* element  = xDynamicCast<Element*>(object);
+				int      numnodes = element->GetNumberOfNodes();
+
+				Input *levelset_input         = element->GetInput(DistanceToCalvingfrontEnum); _assert_(levelset_input);
+				Input *crevassedepth_input    = element->GetInput(CrevasseDepthEnum);          _assert_(crevassedepth_input);
+				Input *bed_input              = element->GetInput(BedEnum);                    _assert_(bed_input);
+				Input *surface_crevasse_input = element->GetInput(SurfaceCrevasseEnum);        _assert_(surface_crevasse_input);
+				Input *thickness_input        = element->GetInput(ThicknessEnum);              _assert_(thickness_input);
+				Input *surface_input          = element->GetInput(SurfaceEnum);                _assert_(surface_input);
 
 				/*Is this element connected to a node that should be calved*/
@@ -791,5 +685,5 @@
 				for(int in=0;in<numnodes;in++){
 					Node* node=element->GetNode(in);
-					if(constraint_nodes[node->Sid()]==1.){
+					if(constraint_nodes[node->Lid()]>0.){
 						isconnected = true;
 						break;
@@ -799,4 +693,5 @@
 				/*Check status if connected*/
 				if(isconnected){
+					Gauss* gauss = element->NewGauss();
 					for(int in=0;in<numnodes;in++){
 						gauss->GaussNode(element->GetElementType(),in);
@@ -809,9 +704,10 @@
 						surface_input->GetInputValue(&surface,gauss);
 
-						if((surface_crevasse-surface>0. || crevassedepth-thickness>0.) && bed<0. && levelset>-300. && levelset<0. && constraint_nodes[node->Sid()]==0.){
+                  if((surface_crevasse>surface || crevassedepth>crevasse_threshold*thickness) && bed<0. && levelset<0. && levelset>-mig_max*dt && constraint_nodes[node->Lid()]==0.){
 							local_nflipped++;
-							vec_constraint_nodes->SetValue(node->Sid(),1.0,INS_VAL);
+							vec_constraint_nodes->SetValue(node->Pid(),1.0,INS_VAL);
 						}
 					}
+					delete gauss;
 				}
 			}
@@ -819,11 +715,12 @@
 			/*Count how many new nodes were found*/
 			ISSM_MPI_Allreduce(&local_nflipped,&nflipped,1,ISSM_MPI_INT,ISSM_MPI_SUM,IssmComm::GetComm());
-			//_printf0_("Found "<<nflipped<<" to flip\n");
+			_printf0_("Found "<<nflipped<<" to flip\n");
 
 			/*Assemble and serialize flag vector*/
 			vec_constraint_nodes->Assemble();
 			xDelete<IssmDouble>(constraint_nodes);
-			constraint_nodes=vec_constraint_nodes->ToMPISerial();
-		}
+         femmodel->GetLocalVectorWithClonesNodes(&constraint_nodes,vec_constraint_nodes);
+		}
+
 		/*Free ressources:*/
 		delete vec_constraint_nodes;
@@ -840,5 +737,5 @@
 				if(!node->IsActive()) continue;
 
-				if(constraint_nodes[node->Sid()]>0.){
+				if(constraint_nodes[node->Lid()]>0.){
 					node->ApplyConstraint(0,+1.);
 				}
Index: /issm/trunk/src/c/analyses/LevelsetAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/LevelsetAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/LevelsetAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/LoveAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/LoveAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/LoveAnalysis.cpp	(revision 26744)
@@ -19,5 +19,4 @@
 }/*}}}*/
 void LoveAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
-
 	IssmDouble* frequencies = NULL;
 	int         nfreq;
@@ -33,7 +32,15 @@
 	parameters->AddObject(iomodel->CopyConstantObject("md.love.r0",LoveR0Enum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.love.mu0",LoveMu0Enum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.Gravitational_Constant",LoveGravitationalConstantEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.love.allow_layer_deletion",LoveAllowLayerDeletionEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.underflow_tol",LoveUnderflowTolEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.integration_steps_per_layer",LoveIntStepsPerLayerEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.istemporal",LoveIsTemporalEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.n_temporal_iterations",LoveNTemporalIterationsEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.love.love_kernels",LoveKernelsEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.love.forcing_type",LoveForcingTypeEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.inner_core_boundary",LoveInnerCoreBoundaryEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.core_mantle_boundary",LoveCoreMantleBoundaryEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.complex_computation",LoveComplexComputationEnum));
 }/*}}}*/
 void LoveAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
@@ -44,4 +51,7 @@
 /*Finite Element Analysis*/
 void           LoveAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_(" not needed!");
+}/*}}}*/
+void           LoveAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_(" not needed!");
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/LoveAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/LoveAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/LoveAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/MasstransportAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/MasstransportAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/MasstransportAnalysis.cpp	(revision 26744)
@@ -4,4 +4,5 @@
 #include "../shared/shared.h"
 #include "../modules/modules.h"
+#include "../classes/Inputs/TransientInput.h"
 
 #define FINITEELEMENT P1Enum
@@ -61,5 +62,5 @@
 	IssmDouble *nodeonbase=NULL;
 	iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.masstransport.vertex_pairing");
-	if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(&nodeonbase,NULL,NULL,"md.mesh.vertexonbase");
+	if(iomodel->domaintype!=Domain2DhorizontalEnum && iomodel->domaintype!=Domain3DsurfaceEnum) iomodel->FetchData(&nodeonbase,NULL,NULL,"md.mesh.vertexonbase");
 
 	for(int i=0;i<numvertex_pairing;i++){
@@ -99,5 +100,5 @@
 
 	/*Create Nodes either DG or CG depending on stabilization*/
-	if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
+	if(iomodel->domaintype!=Domain2DhorizontalEnum && iomodel->domaintype!=Domain3DsurfaceEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
 	if(stabilization!=3){
 		::CreateNodes(nodes,iomodel,MasstransportAnalysisEnum,FINITEELEMENT,isamr);
@@ -119,4 +120,5 @@
 	bool   isoceancoupling;
 	bool   issmb;
+	int    grdmodel;
 
 	/*Fetch data needed: */
@@ -148,5 +150,5 @@
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
@@ -155,15 +157,19 @@
 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
 	if(isgroundingline) 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
-	/*Initialize cumdeltalthickness input*/
-	InputUpdateFromConstantx(inputs,elements,0.,SealevelriseCumDeltathicknessEnum);
 	/*Initialize ThicknessResidual input*/
 	InputUpdateFromConstantx(inputs,elements,0.,ThicknessResidualEnum);
 
 	/*Get what we need for ocean-induced basal melting*/
+	bool isstochastic;
 	int basalforcing_model;
 	iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model");
+	iomodel->FindConstant(&isstochastic,"md.stochasticforcing.isstochasticforcing");
 	switch(basalforcing_model){
 		case FloatingMeltRateEnum:
 			iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum);
+			if(isstochastic){
+            iomodel->FetchDataToInput(inputs,elements,"md.stochasticforcing.default_id",StochasticForcingDefaultIdEnum);
+            iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BaselineBasalforcingsFloatingiceMeltingRateEnum);
+         }
 			break;
 		case LinearFloatingMeltRateEnum:
@@ -221,8 +227,16 @@
 	}
 
-	if(iomodel->domaintype!=Domain2DhorizontalEnum){
+	if(iomodel->domaintype!=Domain2DhorizontalEnum && iomodel->domaintype!=Domain3DsurfaceEnum){
 		iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
 		iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum);
 	}
+
+	/*Initialize sea level cumulated sea level loads :*/
+	iomodel->ConstantToInput(inputs,elements,0,AccumulatedDeltaIceThicknessEnum,P1Enum);
+	iomodel->ConstantToInput(inputs,elements,0,OldAccumulatedDeltaIceThicknessEnum,P1Enum);
+
+	/*for Ivins deformation model, initialize history of ice thickness changes:*/
+	iomodel->FindConstant(&grdmodel,"md.solidearth.settings.grdmodel");
+	if(grdmodel==IvinsEnum) inputs->SetTransientInput(TransientAccumulatedDeltaIceThicknessEnum,NULL,0);
 
 }/*}}}*/
@@ -248,4 +262,7 @@
 /*Finite Element Analysis*/
 void           MasstransportAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           MasstransportAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
@@ -280,5 +297,5 @@
 	int domaintype;
 	element->FindParam(&domaintype,DomainTypeEnum);
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return Ke;
 }/*}}}*/
@@ -572,7 +589,5 @@
 	}
 
-	int domaintype;
-	element->FindParam(&domaintype,DomainTypeEnum);
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return pe;
 }/*}}}*/
@@ -798,4 +813,13 @@
 	if(!element->IsOnBase()) return;
 
+	/*deal with logic of accumulating thickness if we are coupled to a 
+	 * sea level core:*/
+	int frequency,count,isgrd;
+	element->FindParam(&isgrd,SolidearthSettingsGRDEnum);
+	if(isgrd){
+		element->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+		element->FindParam(&count,SealevelchangeRunCountEnum);
+	}
+
 	/*Fetch dof list and allocate solution vector*/
 	int *doflist = NULL;
@@ -839,6 +863,4 @@
 	newthickness  = xNew<IssmDouble>(numvertices);
 	IssmDouble* oldthickness      = xNew<IssmDouble>(numvertices);
-	IssmDouble* cumdeltathickness = xNew<IssmDouble>(numvertices);
-	IssmDouble* deltathickness    = xNew<IssmDouble>(numvertices);
 	IssmDouble* newbase           = xNew<IssmDouble>(numvertices);
 	IssmDouble* bed               = xNew<IssmDouble>(numvertices);
@@ -856,5 +878,4 @@
 	basalelement->GetInputListOnVertices(&phi[0],MaskOceanLevelsetEnum);
 	basalelement->GetInputListOnVertices(&sealevel[0],SealevelEnum);
-	basalelement->GetInputListOnVertices(&cumdeltathickness[0],SealevelriseCumDeltathicknessOldEnum);
 
 	/*Do we do grounding line migration?*/
@@ -862,10 +883,4 @@
 	element->FindParam(&isgroundingline,TransientIsgroundinglineEnum);
 	if(isgroundingline) basalelement->GetInputListOnVertices(&bed[0],BedEnum);
-
-	/*What is the delta thickness forcing the sea-level rise core: cumulated over time, hence the +=:*/
-	for(int i=0;i<numvertices;i++){
-		cumdeltathickness[i] += newthickness[i]-oldthickness[i];
-		deltathickness[i]     = newthickness[i]-oldthickness[i];
-	}
 
 	/*Find MasstransportHydrostaticAdjustment to figure out how to update the geometry:*/
@@ -902,14 +917,10 @@
 	element->AddBasalInput(SurfaceEnum,newsurface,P1Enum);
 	element->AddBasalInput(BaseEnum,newbase,P1Enum);
-	element->AddBasalInput(SealevelriseCumDeltathicknessEnum,cumdeltathickness,P1Enum);
-	element->AddBasalInput(SurfaceloadIceThicknessChangeEnum,deltathickness,P1Enum);
 
 	/*Free ressources:*/
 	xDelete<IssmDouble>(newthickness);
-	xDelete<IssmDouble>(cumdeltathickness);
 	xDelete<IssmDouble>(newbase);
 	xDelete<IssmDouble>(newsurface);
 	xDelete<IssmDouble>(oldthickness);
-	xDelete<IssmDouble>(deltathickness);
 	xDelete<IssmDouble>(oldbase);
 	xDelete<IssmDouble>(oldsurface);
@@ -918,5 +929,5 @@
 	xDelete<IssmDouble>(bed);
 	xDelete<int>(doflist);
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 }/*}}}*/
 void           MasstransportAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
Index: /issm/trunk/src/c/analyses/MasstransportAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/MasstransportAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/MasstransportAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/MeltingAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/MeltingAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/MeltingAnalysis.cpp	(revision 26744)
@@ -56,5 +56,5 @@
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
 	if(iomodel->domaintype!=Domain2DhorizontalEnum){
@@ -69,4 +69,7 @@
 /*Finite Element Analysis*/
 void           MeltingAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           MeltingAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
@@ -115,5 +118,5 @@
 	xDelete<IssmDouble>(basis);
 	delete gauss;
-	basalelement->DeleteMaterials(); delete basalelement;
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return Ke;
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/MeltingAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/MeltingAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/MeltingAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/OceantransportAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/OceantransportAnalysis.cpp	(revision 26744)
+++ /issm/trunk/src/c/analyses/OceantransportAnalysis.cpp	(revision 26744)
@@ -0,0 +1,210 @@
+#include "./OceantransportAnalysis.h"
+#include <math.h>
+#include "../toolkits/toolkits.h"
+#include "../classes/classes.h"
+#include "../classes/Inputs/TransientInput.h"
+#include "../shared/shared.h"
+#include "../modules/modules.h"
+
+/*Model processing*/
+void OceantransportAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+	/*No constraints*/
+}/*}}}*/
+void OceantransportAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
+	/*No loads*/
+}/*}}}*/
+void OceantransportAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
+	::CreateNodes(nodes,iomodel,OceantransportAnalysisEnum,P1Enum);
+}/*}}}*/
+int  OceantransportAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
+	return 3;
+}/*}}}*/
+void OceantransportAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+
+	int  nature=0;
+	bool isdakota=0;
+
+	/*Update elements: */
+	int counter=0;
+	for(int i=0;i<iomodel->numberofelements;i++){
+		if(iomodel->my_elements[i]){
+			Element* element=(Element*)elements->GetObjectByOffset(counter);
+			element->Update(inputs,i,iomodel,analysis_counter,analysis_type,P1Enum);
+			counter++;
+		}
+	}
+
+	/*Plug inputs into element:*/
+	iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_water_pressure_at_sea_floor", OceantransportSpcbottompressureEnum);
+	iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_surface_height_above_geoid",  OceantransportSpcdslEnum);
+	iomodel->FetchDataToInput(inputs,elements,"md.dsl.global_average_thermosteric_sea_level",OceantransportSpcstrEnum);
+
+	/*Resolve mmes if we not running Dakota. Otherwise, Dakota will provide a modelid, which will be use to resolve Mme, 
+	 *but it will be done in InputUpdateFromDakota:*/
+	iomodel->FetchData(&isdakota,"md.qmu.isdakota");
+	if (inputs->GetInputObjectEnum(OceantransportSpcbottompressureEnum)==DatasetInputEnum && isdakota){
+		int modelid;
+
+		/*retrieve model id: */
+		iomodel->FetchData(&modelid,"md.dsl.modelid");
+
+		/*replace dataset of forcings with only one, the modelid'th:*/
+		MmeToInputFromIdx(inputs,elements,modelid,OceantransportSpcbottompressureEnum, P1Enum);
+		MmeToInputFromIdx(inputs,elements,modelid,OceantransportSpcdslEnum, P1Enum);
+		MmeToInputFromIdx(inputs,elements,modelid,OceantransportSpcstrEnum, P0Enum);
+	}
+
+	/*Initialize sea level cumulated sea level loads :*/
+	iomodel->ConstantToInput(inputs,elements,0.,AccumulatedDeltaBottomPressureEnum,P1Enum);
+	iomodel->ConstantToInput(inputs,elements,0.,OldAccumulatedDeltaBottomPressureEnum,P1Enum);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.bottompressure",BottomPressureEnum);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.dsl",DslEnum);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.str",StrEnum);
+
+}/*}}}*/
+void OceantransportAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+
+	int dslmodel=0;
+	int     numoutputs;
+	char**  requestedoutputs = NULL;
+
+	/*Deal with dsl multi-model ensembles: {{{*/
+	iomodel->FetchData(&dslmodel,"md.dsl.model");
+	if(dslmodel==2){
+		IssmDouble modelid; 
+		int nummodels;
+
+		/*create double param, not int param, because Dakota will be updating it as 
+		 * a double potentially: */
+		iomodel->FetchData(&modelid,"md.dsl.modelid");
+		parameters->AddObject(new DoubleParam(DslModelidEnum,modelid));
+		parameters->AddObject(iomodel->CopyConstantObject("md.dsl.nummodels",DslNummodelsEnum));
+		iomodel->FetchData(&nummodels,"md.dsl.nummodels");
+
+		/*quick checks: */
+		if(nummodels<=0)_error_("dslmme object in  md.dsl field should contain at least 1 ensemble model!");
+		if(modelid<=0 || modelid>nummodels)_error_("modelid field in dslmme object of md.dsl field should be between 1 and the number of ensemble runs!");
+	} /*}}}*/
+	/*Requested outputs {{{*/
+	iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.solidearth.requested_outputs");
+	if(numoutputs)parameters->AddObject(new StringArrayParam(SealevelchangeRequestedOutputsEnum,requestedoutputs,numoutputs));
+	iomodel->DeleteData(&requestedoutputs,numoutputs,"md.solidearth.requested_outputs");
+	/*}}}*/
+
+}/*}}}*/
+
+/*Finite Element Analysis*/
+void           OceantransportAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           OceantransportAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+ElementVector* OceantransportAnalysis::CreateDVector(Element* element){/*{{{*/
+	/*Default, return NULL*/
+	return NULL;
+}/*}}}*/
+ElementMatrix* OceantransportAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
+_error_("Not implemented");
+}/*}}}*/
+ElementMatrix* OceantransportAnalysis::CreateKMatrix(Element* element){/*{{{*/
+	_error_("not implemented yet");
+}/*}}}*/
+ElementVector* OceantransportAnalysis::CreatePVector(Element* element){/*{{{*/
+_error_("not implemented yet");
+}/*}}}*/
+void           OceantransportAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+
+	/*retrieve bottom pressure, dsl and str from the spcs in our element:*/
+
+	IssmDouble bp,dsl,str;
+	int       *doflist = NULL;
+
+	/*Fetch number of nodes and initialize values*/
+	int         numnodes = element->GetNumberOfNodes();
+	int         numdof   = numnodes*3;
+	IssmDouble* values   = xNew<IssmDouble>(numdof);
+
+	/*Get dof list and inputs */
+	element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	Input* bp_input=element->GetInput(OceantransportSpcbottompressureEnum); _assert_(bp_input);
+	Input* dsl_input=element->GetInput(OceantransportSpcdslEnum); _assert_(dsl_input);
+	Input* str_input=element->GetInput(OceantransportSpcstrEnum); _assert_(str_input);
+
+	/*Ok, we have the velocities in inputs, fill in solution */
+	Gauss* gauss=element->NewGauss();
+	for(int i=0;i<numnodes;i++){
+		gauss->GaussVertex(i);
+		bp_input->GetInputValue(&bp,gauss);
+		dsl_input->GetInputValue(&dsl,gauss);
+		str_input->GetInputValue(&str,gauss);
+		values[i*3+0]=bp;
+		values[i*3+1]=dsl;
+		values[i*3+2]=str;
+	}
+
+	/*Add value to global vector*/
+	solution->SetValues(numdof,doflist,values,INS_VAL);
+
+	/*Free ressources:*/
+	delete gauss;
+	xDelete<int>(doflist);
+	xDelete<IssmDouble>(values);
+}/*}}}*/
+void           OceantransportAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
+	_error_("Not implemented yet");
+}/*}}}*/
+void           OceantransportAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+
+	int         i,domaintype;
+	int*        doflist=NULL;
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numnodes = element->GetNumberOfNodes();
+	int numdof   = numnodes*3;
+
+	/*Fetch dof list and allocate solution vectors*/
+	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+	IssmDouble* values    = xNew<IssmDouble>(numdof);
+	IssmDouble* bp        = xNew<IssmDouble>(numnodes);
+	IssmDouble* dsl        = xNew<IssmDouble>(numnodes);
+	IssmDouble* str        = xNew<IssmDouble>(numnodes);
+	IssmDouble  strmean;
+
+	/*Use the dof list to index into the solution vector: */
+	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+
+	/*Retrieve bp,dsl and str:*/
+	strmean=0;
+	for(i=0;i<numnodes;i++){
+		bp[i]=values[i*3+0];
+		dsl[i]=values[i*3+1];
+		str[i]=values[i*3+2];
+		strmean+=str[i]/numnodes;
+
+		/*Check solution*/
+		if(xIsNan<IssmDouble>(bp[i])) _error_("NaN found in bottom pressure solution vector");
+		if(xIsInf<IssmDouble>(bp[i])) _error_("Inf found in bottom pressure  solution vector");
+		if(xIsNan<IssmDouble>(dsl[i])) _error_("NaN found in dsl solution vector");
+		if(xIsInf<IssmDouble>(dsl[i])) _error_("Inf found in dsl solution vector");
+		if(xIsNan<IssmDouble>(str[i])) _error_("NaN found in str solution vector");
+		if(xIsInf<IssmDouble>(str[i])) _error_("Inf found in str solution vector");
+	}
+
+	/*Add bp, dsl and str as inputs to the tria element: */
+	element->AddInput(BottomPressureEnum,bp,P1Enum);
+	element->AddInput(DslEnum,dsl,P1Enum);
+	element->AddInput(StrEnum,&strmean,P0Enum); 
+
+	/*Free ressources:*/
+	xDelete<IssmDouble>(bp);
+	xDelete<IssmDouble>(str);
+	xDelete<IssmDouble>(dsl);
+	xDelete<IssmDouble>(values);
+	xDelete<int>(doflist);
+
+}/*}}}*/
+void           OceantransportAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+	/*Default, do nothing*/
+	return;
+}/*}}}*/
Index: /issm/trunk/src/c/analyses/OceantransportAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/OceantransportAnalysis.h	(revision 26744)
+++ /issm/trunk/src/c/analyses/OceantransportAnalysis.h	(revision 26744)
@@ -0,0 +1,34 @@
+/*! \file OceantransportAnalysis.h 
+ *  \brief: header file for generic external result object
+ */
+
+#ifndef _OceantransportAnalysis_
+#define _OceantransportAnalysis_
+
+/*Headers*/
+#include "./Analysis.h"
+
+class OceantransportAnalysis: public Analysis{
+
+	public:
+		/*Model processing*/
+		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
+		void CreateLoads(Loads* loads, IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
+		int  DofsPerNode(int** doflist,int domaintype,int approximation);
+		void UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type);
+		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
+
+		/*Finite element Analysis*/
+		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
+		ElementVector* CreateDVector(Element* element);
+		ElementMatrix* CreateJacobianMatrix(Element* element);
+		ElementMatrix* CreateKMatrix(Element* element);
+		ElementVector* CreatePVector(Element* element);
+		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+		void           GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index);
+		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
+		void           UpdateConstraints(FemModel* femmodel);
+};
+#endif
Index: /issm/trunk/src/c/analyses/SamplingAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/SamplingAnalysis.cpp	(revision 26744)
+++ /issm/trunk/src/c/analyses/SamplingAnalysis.cpp	(revision 26744)
@@ -0,0 +1,419 @@
+#include "./SamplingAnalysis.h" //
+#include "../toolkits/toolkits.h"
+#include "../classes/classes.h"
+#include "../shared/shared.h"
+#include "../modules/modules.h"
+#include <random>
+
+#define FINITEELEMENT P1Enum
+#define 	NUMVERTICES   3
+
+/* Reimplementation of IsFaceOnBoundary with two edges on boundary supported */
+bool IsFaceOnBoundary(Element*  element)
+{
+
+	IssmDouble values[NUMVERTICES];
+	IssmDouble sum;
+
+	/*Retrieve all inputs and parameters*/
+	element->GetInputListOnVertices(&values[0],MeshVertexonboundaryEnum);
+	sum = values[0]+values[1]+values[2];
+
+	_assert_(sum==0. || sum==1. || sum==2. || sum==3.);
+
+	if(sum>1.){
+	 	return true;
+	}
+	else{
+	 return false;
+	}
+}
+
+/*Model processing*/
+void SamplingAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+	/*Default, do nothing*/
+	return;
+}/*}}}*/
+void SamplingAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
+	/*Default, do nothing*/
+	return;
+}/*}}}*/
+void SamplingAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
+
+	int finiteelement;
+	finiteelement = FINITEELEMENT;
+
+	/*Check in 2d*/
+	if(iomodel->domaintype!=Domain2DhorizontalEnum) _error_("Only 2D horizontal domain is implemented.");
+
+	::CreateNodes(nodes,iomodel,SamplingAnalysisEnum,finiteelement);
+
+}/*}}}*/
+int  SamplingAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
+	return 1;
+}/*}}}*/
+void SamplingAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+
+	int    finiteelement;
+
+	/*Finite element type*/
+	finiteelement = FINITEELEMENT;
+
+	/*Update elements: */
+	int counter=0;
+	for(int i=0;i<iomodel->numberofelements;i++){
+		if(iomodel->my_elements[i]){
+			Element* element=(Element*)elements->GetObjectByOffset(counter);
+			element->Update(inputs,i,iomodel,analysis_counter,analysis_type,finiteelement);
+			counter++;
+		}
+	}
+
+	/*Create inputs: */
+	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+	iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonboundary",MeshVertexonboundaryEnum);
+
+  iomodel->FetchDataToInput(inputs,elements,"md.sampling.kappa",SamplingKappaEnum);
+	iomodel->FetchDataToInput(inputs,elements,"md.sampling.beta",SamplingBetaEnum,0.);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sample",SampleEnum,0.);
+
+}/*}}}*/
+void SamplingAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+
+	int     numoutputs;
+	char**  requestedoutputs = NULL;
+
+	parameters->AddObject(iomodel->CopyConstantObject("md.sampling.tau",SamplingTauEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.sampling.alpha",SamplingAlphaEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.sampling.robin",SamplingRobinEnum));
+	if(solution_enum==TransientSolutionEnum) parameters->AddObject(iomodel->CopyConstantObject("md.sampling.phi",SamplingPhiEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.sampling.seed",SamplingSeedEnum));
+
+	iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.sampling.requested_outputs");
+	parameters->AddObject(new IntParam(SamplingNumRequestedOutputsEnum,numoutputs));
+	if(numoutputs)parameters->AddObject(new StringArrayParam(SamplingRequestedOutputsEnum,requestedoutputs,numoutputs));
+	iomodel->DeleteData(&requestedoutputs,numoutputs,"md.sampling.requested_outputs");
+
+}/*}}}*/
+
+/*Finite Element Analysis*/
+void           SamplingAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           SamplingAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+ElementVector* SamplingAnalysis::CreateDVector(Element* element){/*{{{*/
+	/*Default, return NULL*/
+	return NULL;
+}/*}}}*/
+ElementMatrix* SamplingAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
+_error_("not implemented");
+}/*}}}*/
+ElementMatrix* SamplingAnalysis::CreateKMatrix(Element* element){/*{{{*/
+
+	/* Check if ice in element */
+	//if(!element->IsIceInElement()) return NULL; // Ice in element not required for sampling capability
+
+	/*Intermediaries*/
+	bool robin;
+	int      domaintype;
+
+	/*compute all stiffness matrices for this element*/
+
+	ElementMatrix* Ke = NULL;
+	element->FindParam(&robin,SamplingRobinEnum);
+
+  if(!robin) Ke=CreateKMatrixModifiedHelmholtz(element);
+  else{
+		ElementMatrix* Ke1=CreateKMatrixModifiedHelmholtz(element);
+		ElementMatrix* Ke2=CreateKMatrixRobinBC(element);
+		Ke =new ElementMatrix(Ke1,Ke2);
+
+		delete Ke1;
+		delete Ke2;
+  }
+
+	/*clean-up and return*/
+	return Ke;
+
+}/*}}}*/
+ElementMatrix* SamplingAnalysis::CreateKMatrixModifiedHelmholtz(Element* element){/*{{{*/
+
+	/* Check if ice in element */
+	//if(!element->IsIceInElement()) return NULL;
+
+	/*Intermediaries*/
+	int dim;
+	IssmDouble  D,Jdet;
+	IssmDouble* xyz_list = NULL;
+	IssmDouble kappa;
+
+	/*Get problem dimension*/
+	dim=2;	// Only 2D horizontal domain is implemented so far
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numnodes = element->GetNumberOfNodes();
+
+	/*Initialize Element vector and other vectors*/
+	ElementMatrix* Ke     = element->NewElementMatrix();
+	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
+	IssmDouble*    dbasis = xNew<IssmDouble>(dim*numnodes);
+
+	/*Retrieve all inputs and parameters*/
+	element->GetVerticesCoordinates(&xyz_list);
+	Input*	kappa_input=element->GetInput(SamplingKappaEnum); _assert_(kappa_input);
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=element->NewGauss(2);
+	while(gauss->next()){
+
+		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+		element->NodalFunctions(basis,gauss);
+		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+
+		kappa_input->GetInputValue(&kappa,gauss); _assert_(kappa>0);
+
+		D=gauss->weight*Jdet;
+
+		/* Laplacian operator */
+		for(int i=0;i<numnodes;i++){
+				for(int j=0;j<numnodes;j++){
+						Ke->values[i*numnodes+j] += D*(dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]);
+			}
+ 		}
+
+		/* Identity identity */
+		for(int i=0;i<numnodes;i++){
+				for(int j=0;j<numnodes;j++){
+					Ke->values[i*numnodes+j] += D*kappa*kappa*(basis[j]*basis[i]);
+			}
+ 		}
+
+	}
+
+	/*Clean up and return*/
+	xDelete<IssmDouble>(xyz_list);
+	xDelete<IssmDouble>(basis);
+	xDelete<IssmDouble>(dbasis);
+	delete gauss;
+	return Ke;
+
+}/*}}}*/
+ElementMatrix* SamplingAnalysis::CreateKMatrixRobinBC(Element* element){/*{{{*/
+
+	/* Check if ice in element */
+	//if(!element->IsIceInElement()) return NULL;
+
+	/*If no boundary, return NULL*/
+	if(!IsFaceOnBoundary(element)) return NULL;
+
+	/*Intermediaries*/
+	IssmDouble  D,Jdet;
+	IssmDouble* xyz_list = NULL;
+	IssmDouble* xyz_list_boundary = NULL;
+	IssmDouble beta;
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numnodes = element->GetNumberOfNodes();
+
+	/*Initialize Element vector and other vectors*/
+	ElementMatrix* Ke     = element->NewElementMatrix();
+	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
+
+	/*Retrieve all inputs and parameters*/
+	element->GetVerticesCoordinates(&xyz_list);
+	element->GetLevelCoordinates(&xyz_list_boundary,xyz_list,MeshVertexonboundaryEnum,1.);
+	Input*	beta_input=element->GetInput(SamplingBetaEnum); _assert_(beta_input);
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=element->NewGauss(xyz_list,xyz_list_boundary,3);
+	while(gauss->next()){
+
+		element->JacobianDeterminantSurface(&Jdet,xyz_list_boundary,gauss);
+		element->NodalFunctions(basis,gauss);
+
+		beta_input->GetInputValue(&beta,gauss); _assert_(beta>=0);
+
+		D=gauss->weight*Jdet;
+
+		for(int i=0;i<numnodes;i++){
+				for(int j=0;j<numnodes;j++){
+						Ke->values[i*numnodes+j] += D*beta*(basis[j]*basis[i]);
+			}
+ 		}
+
+	}
+
+	/*Clean up and return*/
+	xDelete<IssmDouble>(xyz_list);
+	xDelete<IssmDouble>(xyz_list_boundary);
+	xDelete<IssmDouble>(basis);
+	delete gauss;
+	return Ke;
+
+}/*}}}*/
+ElementVector* SamplingAnalysis::CreatePVector(Element* element){/*{{{*/
+	//_error_("not supported");
+	return NULL;
+}/*}}}*/
+void           SamplingAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+	element->GetSolutionFromInputsOneDof(solution,SampleEnum);
+}/*}}}*/
+void           SamplingAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
+	_error_("not supported");
+}/*}}}*/
+void           SamplingAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+
+    /*Fetch number of nodes and dof for this finite element*/
+    int numnodes = element->GetNumberOfNodes();
+
+		/*Fetch dof list and allocate solution vector*/
+		int* doflist=NULL;
+    element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+    IssmDouble* newsample = xNew<IssmDouble>(numnodes);
+
+    /*Use the dof list to index into the solution vector: */
+    for(int i=0;i<numnodes;i++){
+			newsample[i]=solution[doflist[i]];
+			/*Check solution*/
+			if(xIsNan<IssmDouble>(newsample[i])) _error_("NaN found in solution vector");
+			if(xIsInf<IssmDouble>(newsample[i])) _error_("Inf found in solution vector");
+		}
+
+    /*Add sample inputs to the tria element: */
+    element->AddInput(SampleEnum,newsample,element->GetElementType());
+
+    /*Free ressources:*/
+    xDelete<IssmDouble>(newsample);
+    xDelete<int>(doflist);
+ }/*}}}*/
+void           SamplingAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+	/*Default, do nothing*/
+  return;
+}/*}}}*/
+
+ElementMatrix* SamplingAnalysis::CreateMassMatrix(Element* element){/*{{{*/
+
+	/* Check if ice in element */
+	//if(!element->IsIceInElement()) return NULL;
+
+	/*Intermediaries*/
+	IssmDouble  D,Jdet;
+	IssmDouble* xyz_list = NULL;
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numnodes = element->GetNumberOfNodes();
+
+	/*Initialize Element vector and other vectors*/
+	ElementMatrix* Me     = element->NewElementMatrix();
+	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
+
+	/*Retrieve all inputs and parameters*/
+	element->GetVerticesCoordinates(&xyz_list);
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=element->NewGauss(2);
+	while(gauss->next()){
+
+		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+		element->NodalFunctions(basis,gauss);
+
+		D=gauss->weight*Jdet;
+		TripleMultiply(basis,1,numnodes,1,
+					&D,1,1,0,
+					basis,1,numnodes,0,
+					&Me->values[0],1);
+	}
+
+	/*Clean up and return*/
+	xDelete<IssmDouble>(xyz_list);
+	xDelete<IssmDouble>(basis);
+	delete gauss;
+	return Me;
+}/*}}}*/
+void           SamplingAnalysis::LumpedKMatrix(Vector<IssmDouble>** pKlff,FemModel* femmodel){/*{{{*/
+
+	/*Initialize Lumped mass matrix (actually we just save its diagonal)*/
+	int fsize      = femmodel->nodes->NumberOfDofs(FsetEnum);
+	int flocalsize = femmodel->nodes->NumberOfDofsLocal(FsetEnum);
+	Vector<IssmDouble>* Klff = new Vector<IssmDouble>(flocalsize,fsize);
+
+	/*Create and assemble matrix*/
+	for(int i=0;i<femmodel->elements->Size();i++){
+		Element*       element = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+		ElementMatrix* KLe     = this->CreateKMatrix(element);
+		if(KLe){
+			KLe->Lump();
+			KLe->AddDiagonalToGlobal(Klff);
+		}
+		delete KLe;
+	}
+	Klff->Assemble();
+
+	/*Assign output pointer*/
+	*pKlff=Klff;
+}/*}}}*/
+void           SamplingAnalysis::KMatrix(Matrix<IssmDouble>** pKff,FemModel* femmodel){/*{{{*/
+
+	/*Initialize K matrix*/
+	Matrix<IssmDouble> *Kff = NULL;
+	AllocateSystemMatricesx(&Kff,NULL,NULL,NULL,femmodel);
+
+	/*Create and assemble matrix*/
+	for(int i=0;i<femmodel->elements->Size();i++){
+		Element*       element = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+		ElementMatrix* Ke     = this->CreateKMatrix(element);
+		if(Ke){
+			Ke->AddToGlobal(Kff);
+		}
+		delete Ke;
+	}
+	Kff->Assemble();
+
+	/*Assign output pointer*/
+	*pKff=Kff;
+
+}/*}}}*/
+void           SamplingAnalysis::LumpedMassMatrix(Vector<IssmDouble>** pMlff,FemModel* femmodel){/*{{{*/
+
+	/*Initialize Lumped mass matrix (actually we just save its diagonal)*/
+	int fsize      = femmodel->nodes->NumberOfDofs(FsetEnum);
+	int flocalsize = femmodel->nodes->NumberOfDofsLocal(FsetEnum);
+	Vector<IssmDouble>* Mlff = new Vector<IssmDouble>(flocalsize,fsize);
+
+	/*Create and assemble matrix*/
+	for(int i=0;i<femmodel->elements->Size();i++){
+		Element*       element = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+		ElementMatrix* MLe     = this->CreateMassMatrix(element);
+		if(MLe){
+			MLe->Lump();
+			MLe->AddDiagonalToGlobal(Mlff);
+		}
+		delete MLe;
+	}
+	Mlff->Assemble();
+
+	/*Assign output pointer*/
+	*pMlff=Mlff;
+}/*}}}*/
+void           SamplingAnalysis::MassMatrix(Matrix<IssmDouble>** pMff,FemModel* femmodel){/*{{{*/
+
+	/*Initialize Mass matrix*/
+	Matrix<IssmDouble> *Mff = NULL;
+	AllocateSystemMatricesx(&Mff,NULL,NULL,NULL,femmodel);
+
+	/*Create and assemble matrix*/
+	for(int i=0;i<femmodel->elements->Size();i++){
+		Element*       element = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+		ElementMatrix* MLe     = this->CreateMassMatrix(element);
+		if(MLe){
+			MLe->AddToGlobal(Mff);
+		}
+		delete MLe;
+	}
+	Mff->Assemble();
+
+	/*Assign output pointer*/
+	*pMff=Mff;
+}/*}}}*/
Index: /issm/trunk/src/c/analyses/SamplingAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/SamplingAnalysis.h	(revision 26744)
+++ /issm/trunk/src/c/analyses/SamplingAnalysis.h	(revision 26744)
@@ -0,0 +1,43 @@
+/*! \file SamplingAnalysis.h
+ *  \brief: header file for generic external result object
+ */
+
+#ifndef _SamplingAnalysis_
+#define _SamplingAnalysis_
+
+/*Headers*/
+#include "./Analysis.h"
+
+class SamplingAnalysis: public Analysis{
+
+	public:
+		/*Model processing*/
+		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
+		void CreateLoads(Loads* loads, IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
+		int  DofsPerNode(int** doflist,int domaintype,int approximation);
+		void UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type);
+		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
+
+		/*Finite element Analysis*/
+		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
+		ElementVector* CreateDVector(Element* element);
+		ElementMatrix* CreateJacobianMatrix(Element* element);
+		ElementMatrix* CreateKMatrix(Element* element);
+		ElementMatrix* CreateKMatrixModifiedHelmholtz(Element* element);
+		ElementMatrix* CreateKMatrixRobinBC(Element* element);
+		ElementMatrix* CreateMassMatrix(Element* element);
+    ElementVector* CreatePVector(Element* element);
+		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+		void           GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index);
+		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
+		void           UpdateConstraints(FemModel* femmodel);
+
+		void           LumpedKMatrix(Vector<IssmDouble>** pKLff,FemModel* femmodel);
+		void           KMatrix(Matrix<IssmDouble>** pKff,FemModel* femmodel);
+		void           LumpedMassMatrix(Vector<IssmDouble>** pMLff,FemModel* femmodel);
+		void           MassMatrix(Matrix<IssmDouble>** pMff,FemModel* femmodel);
+
+};
+#endif
Index: /issm/trunk/src/c/analyses/SealevelchangeAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26744)
+++ /issm/trunk/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26744)
@@ -0,0 +1,586 @@
+#include "./SealevelchangeAnalysis.h"
+#include <math.h>
+#include "../toolkits/toolkits.h"
+#include "../classes/classes.h"
+#include "../classes/Inputs/TransientInput.h"
+#include "../shared/shared.h"
+#include "../modules/modules.h"
+#include "../cores/cores.h"
+
+/*Model processing*/
+void SealevelchangeAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+	/*No constraints*/
+}/*}}}*/
+void SealevelchangeAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
+	/*No loads*/
+}/*}}}*/
+void SealevelchangeAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
+	::CreateNodes(nodes,iomodel,SealevelchangeAnalysisEnum,P1Enum);
+}/*}}}*/
+int  SealevelchangeAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
+	return 1;
+}/*}}}*/
+void SealevelchangeAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+
+	int isexternal=0;
+
+	/*Update elements: */
+	int counter=0;
+	for(int i=0;i<iomodel->numberofelements;i++){
+		if(iomodel->my_elements[i]){
+			Element* element=(Element*)elements->GetObjectByOffset(counter);
+			element->Update(inputs,i,iomodel,analysis_counter,analysis_type,P1Enum);
+			counter++;
+		}
+	}
+
+	/*Create inputs: */
+	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
+	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+	iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
+
+	/*external solidearthsolution: solid-Earth model*/
+	iomodel->FetchData(&isexternal,"md.solidearth.isexternal");
+
+	if(isexternal){
+		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.displacementeast",SolidearthExternalDisplacementEastRateEnum);
+		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.displacementnorth",SolidearthExternalDisplacementNorthRateEnum);
+		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.displacementup",SolidearthExternalDisplacementUpRateEnum);
+		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.geoid",SolidearthExternalGeoidRateEnum);
+
+		/*Resolve Mmes using the modelid, if necessary:*/
+		if (inputs->GetInputObjectEnum(SolidearthExternalDisplacementEastRateEnum)==DatasetInputEnum){
+			int modelid;
+
+			/*retrieve model id: */
+			iomodel->FetchData(&modelid,"md.solidearth.external.modelid");
+
+			/*replace dataset of forcings with only one, the modelid'th:*/
+			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalDisplacementNorthRateEnum, P1Enum);
+			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalDisplacementEastRateEnum, P1Enum);
+			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalDisplacementUpRateEnum, P1Enum);
+			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalGeoidRateEnum, P1Enum);
+		}
+	}
+
+	/*Initialize solid earth motion and sea level: */
+	iomodel->ConstantToInput(inputs,elements,0.,BedEastEnum,P1Enum);
+	iomodel->ConstantToInput(inputs,elements,0.,BedNorthEnum,P1Enum);
+    iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum);
+
+	/*Initialize loads:*/
+	iomodel->ConstantToInput(inputs,elements,0.,DeltaTwsEnum,P1Enum);
+	iomodel->ConstantToInput(inputs,elements,0.,DeltaIceThicknessEnum,P1Enum);
+	iomodel->ConstantToInput(inputs,elements,0.,DeltaBottomPressureEnum,P1Enum);
+
+}/*}}}*/
+void SealevelchangeAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+
+	int         nl;
+	int         ntimesteps;
+	IssmDouble* love_h=NULL;
+	IssmDouble* love_k=NULL;
+	IssmDouble* love_l=NULL;
+	IssmDouble* love_th=NULL;
+	IssmDouble* love_tk=NULL;
+	IssmDouble* love_tl=NULL;
+	IssmDouble* love_timefreq=NULL;
+	bool        love_istime=true;
+	int         externalnature=0;
+	int         isexternal=0;
+
+	IssmDouble* G_gravi = NULL;
+	IssmDouble* G_gravi_local = NULL;
+	IssmDouble* G_viscoelastic = NULL;
+	IssmDouble* G_viscoelastic_interpolated = NULL;
+	IssmDouble* G_viscoelastic_local = NULL;
+	IssmDouble* U_viscoelastic = NULL;
+	IssmDouble* U_viscoelastic_interpolated = NULL;
+	IssmDouble* U_viscoelastic_local = NULL;
+	IssmDouble* H_viscoelastic = NULL;
+	IssmDouble* H_viscoelastic_interpolated= NULL;
+	IssmDouble* H_viscoelastic_local = NULL;
+	int         M,m,lower_row,upper_row;
+	IssmDouble  degacc=.01;
+	IssmDouble  timeacc;
+	IssmDouble  planetradius=0;
+	IssmDouble  planetarea=0;
+	bool		selfattraction=false;
+	bool		elastic=false;
+	bool		viscous=false;
+	bool		rotation=false;
+	int         ndeg;
+	int         horiz;
+
+	bool istime=true;
+	IssmDouble start_time,final_time;
+	int  nt,precomputednt;
+
+	int     numoutputs;
+	char**  requestedoutputs = NULL;
+
+	/*transition vectors: */
+	IssmDouble **transitions    = NULL;
+	int         *transitions_M    = NULL;
+	int         *transitions_N    = NULL;
+	int          ntransitions;
+	IssmDouble*  partitionice=NULL;
+	IssmDouble*  partitionhydro=NULL;
+	IssmDouble*  partitionocean=NULL;
+	IssmDouble*  bslcice_partition=NULL;
+	IssmDouble*  bslchydro_partition=NULL;
+	IssmDouble*  bslcocean_partition=NULL;
+	int          npartice,nparthydro,npartocean,nel;
+	int          grdmodel;
+
+	/*some constant parameters: */
+	parameters->AddObject(iomodel->CopyConstantObject("md.dsl.model",DslModelEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.isexternal",SolidearthIsExternalEnum));
+	iomodel->FetchData(&isexternal,"md.solidearth.isexternal");
+	if(isexternal) parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.external.nature",SolidearthExternalNatureEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.runfrequency",SolidearthSettingsRunFrequencyEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.reltol",SolidearthSettingsReltolEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.abstol",SolidearthSettingsAbstolEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.maxiter",SolidearthSettingsMaxiterEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.selfattraction",SolidearthSettingsSelfAttractionEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.horiz",SolidearthSettingsHorizEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.elastic",SolidearthSettingsElasticEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.viscous",SolidearthSettingsViscousEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.rotation",SolidearthSettingsRotationEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.equatorialmoi",RotationalEquatorialMoiEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.polarmoi",RotationalPolarMoiEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.angularvelocity",RotationalAngularVelocityEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.grdocean",SolidearthSettingsGrdOceanEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.ocean_area_scaling",SolidearthSettingsOceanAreaScalingEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.sealevelloading",SolidearthSettingsSealevelLoadingEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.isgrd",SolidearthSettingsGRDEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.compute_bp_grd",SolidearthSettingsComputeBpGrdEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.planetradius",SolidearthPlanetRadiusEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.cross_section_shape",SolidearthSettingsCrossSectionShapeEnum));
+
+	parameters->AddObject(new DoubleParam(CumBslcEnum,0.0));
+	parameters->AddObject(new DoubleParam(CumBslcIceEnum,0.0));
+	parameters->AddObject(new DoubleParam(CumBslcHydroEnum,0.0));
+	parameters->AddObject(new DoubleParam(CumGmtslcEnum,0.0));
+
+	/*compute planet area and plug into parameters:*/
+	iomodel->FetchData(&planetradius,"md.solidearth.planetradius");
+	planetarea=4*PI*planetradius*planetradius;
+	parameters->AddObject(new DoubleParam(SolidearthPlanetAreaEnum,planetarea));
+
+	/*Deal with partition of the barystatic contribution:*/
+	iomodel->FetchData(&npartice,"md.solidearth.npartice");
+	parameters->AddObject(new IntParam(SolidearthNpartIceEnum,npartice));
+	if(npartice){
+		iomodel->FetchData(&partitionice,&nel,NULL,"md.solidearth.partitionice");
+		parameters->AddObject(new DoubleMatParam(SolidearthPartitionIceEnum,partitionice,nel,1));
+		parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.npartice",SolidearthNpartIceEnum));
+		bslcice_partition=xNewZeroInit<IssmDouble>(npartice);
+		parameters->AddObject(new DoubleMatParam(CumBslcIcePartitionEnum,bslcice_partition,npartice,1));
+		xDelete<IssmDouble>(partitionice);
+	}
+
+	iomodel->FetchData(&nparthydro,"md.solidearth.nparthydro");
+	parameters->AddObject(new IntParam(SolidearthNpartHydroEnum,nparthydro));
+	if(nparthydro){
+		iomodel->FetchData(&partitionhydro,&nel,NULL,"md.solidearth.partitionhydro");
+		parameters->AddObject(new DoubleMatParam(SolidearthPartitionHydroEnum,partitionhydro,nel,1));
+		parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.nparthydro",SolidearthNpartHydroEnum));
+		bslchydro_partition=xNewZeroInit<IssmDouble>(nparthydro);
+		parameters->AddObject(new DoubleMatParam(CumBslcHydroPartitionEnum,bslchydro_partition,nparthydro,1));
+		xDelete<IssmDouble>(partitionhydro);
+	}
+
+	iomodel->FetchData(&npartocean,"md.solidearth.npartocean");
+	parameters->AddObject(new IntParam(SolidearthNpartOceanEnum,npartocean));
+	if(npartocean){
+		iomodel->FetchData(&partitionocean,&nel,NULL,"md.solidearth.partitionocean");
+		parameters->AddObject(new DoubleMatParam(SolidearthPartitionOceanEnum,partitionocean,nel,1));
+		parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.npartocean",SolidearthNpartOceanEnum));
+		bslcocean_partition=xNewZeroInit<IssmDouble>(npartocean);
+		parameters->AddObject(new DoubleMatParam(CumBslcOceanPartitionEnum,bslcocean_partition,npartocean,1));
+		xDelete<IssmDouble>(partitionocean);
+	}
+	/*New optimized code:*/
+	ToolkitsOptionsFromAnalysis(parameters,SealevelchangeAnalysisEnum); //this is requested by the BarystaticContributions class inner vectors.
+	BarystaticContributions* barystaticcontributions=new BarystaticContributions(iomodel);
+	parameters->AddObject(new GenericParam<BarystaticContributions*>(barystaticcontributions,BarystaticContributionsEnum));
+
+	/*Deal with external multi-model ensembles: {{{*/
+	if(isexternal){
+		iomodel->FetchData(&externalnature,"md.solidearth.external.nature");
+		if(externalnature>=3){
+			IssmDouble modelid; 
+			int nummodels;
+
+			/*create double param, not int param, because Dakota will be updating it as a double potentially: */
+			iomodel->FetchData(&modelid,"md.solidearth.external.modelid");
+			parameters->AddObject(new DoubleParam(SolidearthExternalModelidEnum,modelid));
+			parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.external.nummodels",SolidearthExternalNummodelsEnum));
+			iomodel->FetchData(&nummodels,"md.solidearth.external.nummodels");
+
+			/*quick checks: */
+			if(nummodels<=0)_error_("mme solidearth solution object in  md.solidearth.external field should contain at least 1 ensemble model!");
+			if(modelid<=0 || modelid>nummodels)_error_("modelid field in md.solidearth.external field should be between 1 and the number of ensemble runs!");
+		} /*}}}*/
+	}
+
+	parameters->FindParam(&grdmodel,GrdModelEnum);
+	if(grdmodel==ElasticEnum){
+		/*Deal with elasticity {{{*/
+		iomodel->FetchData(&selfattraction,"md.solidearth.settings.selfattraction");
+		iomodel->FetchData(&elastic,"md.solidearth.settings.elastic");
+		iomodel->FetchData(&viscous,"md.solidearth.settings.viscous");
+		iomodel->FetchData(&rotation,"md.solidearth.settings.rotation");
+		iomodel->FetchData(&horiz,"md.solidearth.settings.horiz");
+
+		if(selfattraction){
+			/*compute green functions for a range of angles*/
+			iomodel->FetchData(&degacc,"md.solidearth.settings.degacc");
+			M=reCast<int,IssmDouble>(180./degacc+1.);
+		}
+
+		/*love numbers: */
+		if(viscous || elastic){
+			int dummy;
+
+			iomodel->FetchData(&timeacc,"md.solidearth.settings.timeacc");
+			iomodel->FetchData(&start_time,"md.timestepping.start_time");
+			iomodel->FetchData(&final_time,"md.timestepping.final_time");
+			iomodel->FetchData(&love_istime,"md.solidearth.lovenumbers.istime");
+			iomodel->FetchData(&love_timefreq,&precomputednt,&dummy,"md.solidearth.lovenumbers.timefreq");
+			iomodel->FetchData(&love_h,&ndeg,&precomputednt,"md.solidearth.lovenumbers.h");
+			iomodel->FetchData(&love_k,&ndeg,&precomputednt,"md.solidearth.lovenumbers.k");
+			iomodel->FetchData(&love_l,&ndeg,&precomputednt,"md.solidearth.lovenumbers.l");
+			iomodel->FetchData(&love_th,&ndeg,&precomputednt,"md.solidearth.lovenumbers.th");
+			iomodel->FetchData(&love_tk,&ndeg,&precomputednt,"md.solidearth.lovenumbers.tk");
+			iomodel->FetchData(&love_tl,&ndeg,&precomputednt,"md.solidearth.lovenumbers.tl");
+
+			parameters->AddObject(new DoubleParam(SolidearthSettingsTimeAccEnum,timeacc));
+			parameters->AddObject(new DoubleMatParam(LoadLoveHEnum,love_h,ndeg,precomputednt));
+			parameters->AddObject(new DoubleMatParam(LoadLoveKEnum,love_k,ndeg,precomputednt));
+			parameters->AddObject(new DoubleMatParam(LoadLoveLEnum,love_l,ndeg,precomputednt));
+			parameters->AddObject(new DoubleMatParam(TidalLoveHEnum,love_th,ndeg,precomputednt));
+			parameters->AddObject(new DoubleMatParam(TidalLoveKEnum,love_tk,ndeg,precomputednt));
+			parameters->AddObject(new DoubleMatParam(TidalLoveLEnum,love_tl,ndeg,precomputednt));
+			parameters->AddObject(new DoubleMatParam(LoveTimeFreqEnum,love_timefreq,precomputednt,1));
+			parameters->AddObject(new BoolParam(LoveIsTimeEnum,love_istime));
+
+			// AD performance is sensitive to calls to ensurecontiguous.
+			// // Providing "t" will cause ensurecontiguous to be called.
+			if(viscous){
+				IssmDouble* viscoustimes=NULL;
+				ntimesteps=precomputednt; 
+				nt=reCast<int,IssmDouble>((final_time-start_time)/timeacc)+1;
+
+				parameters->AddObject(new IntParam(SealevelchangeViscousNumStepsEnum,nt));
+				/*Initialize viscous stack times:*/
+				viscoustimes=xNew<IssmDouble>(nt);
+				for(int t=0;t<nt;t++){
+					viscoustimes[t]=start_time+timeacc*t;
+				}
+				parameters->AddObject(new DoubleVecParam(SealevelchangeViscousTimesEnum,viscoustimes,nt));
+				parameters->AddObject(new IntParam(SealevelchangeViscousIndexEnum,0));
+				xDelete<IssmDouble>(viscoustimes);
+			}
+			else {
+				ntimesteps=1;
+				nt=1;
+			}
+
+#ifdef _HAVE_AD_
+			G_viscoelastic=xNew<IssmDouble>(M*ntimesteps,"t");
+			U_viscoelastic=xNew<IssmDouble>(M*ntimesteps,"t");
+			if(horiz)H_viscoelastic=xNew<IssmDouble>(M*ntimesteps,"t");
+#else
+			G_viscoelastic=xNew<IssmDouble>(M*ntimesteps);
+			U_viscoelastic=xNew<IssmDouble>(M*ntimesteps);
+			if(horiz)H_viscoelastic=xNew<IssmDouble>(M*ntimesteps);
+#endif
+		}
+		if(selfattraction){
+#ifdef _HAVE_AD_
+			G_gravi=xNew<IssmDouble>(M,"t");
+#else
+			G_gravi=xNew<IssmDouble>(M);
+#endif
+		}
+
+		if(rotation)parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.lovenumbers.tk2secular",TidalLoveK2SecularEnum));
+
+		if(selfattraction){
+
+			/*compute combined legendre + love number (elastic green function:*/
+			m=DetermineLocalSize(M,IssmComm::GetComm());
+			GetOwnershipBoundariesFromRange(&lower_row,&upper_row,m,IssmComm::GetComm());
+		}
+		if(viscous | elastic){
+#ifdef _HAVE_AD_
+			G_viscoelastic_local=xNew<IssmDouble>(m*ntimesteps,"t");
+			U_viscoelastic_local=xNew<IssmDouble>(m*ntimesteps,"t");
+			if(horiz)H_viscoelastic_local=xNew<IssmDouble>(m*ntimesteps,"t");
+#else
+			G_viscoelastic_local=xNew<IssmDouble>(m*ntimesteps);
+			U_viscoelastic_local=xNew<IssmDouble>(m*ntimesteps);
+			if(horiz)H_viscoelastic_local=xNew<IssmDouble>(m*ntimesteps);
+#endif
+		}
+		if(selfattraction){
+#ifdef _HAVE_AD_
+			G_gravi_local=xNew<IssmDouble>(m,"t");
+#else
+			G_gravi_local=xNew<IssmDouble>(m);
+#endif
+		}
+
+		if(selfattraction){
+			for(int i=lower_row;i<upper_row;i++){
+				IssmDouble alpha,x;
+				alpha= reCast<IssmDouble>(i)*degacc * M_PI / 180.0;
+				G_gravi_local[i-lower_row]= .5/sin(alpha/2.0);
+			}
+		}
+		if(viscous | elastic){
+			for(int i=lower_row;i<upper_row;i++){
+				IssmDouble alpha,x;
+				alpha= reCast<IssmDouble>(i)*degacc * M_PI / 180.0;
+
+				for(int t=0;t<ntimesteps;t++){
+					G_viscoelastic_local[(i-lower_row)*ntimesteps+t]= (love_k[(ndeg-1)*precomputednt+t]-love_h[(ndeg-1)*precomputednt+t])*G_gravi_local[i-lower_row];
+					U_viscoelastic_local[(i-lower_row)*ntimesteps+t]= (love_h[(ndeg-1)*precomputednt+t])*G_gravi_local[i-lower_row];
+					if(horiz)H_viscoelastic_local[(i-lower_row)*ntimesteps+t]= 0; 
+				}
+
+				IssmDouble Pn = 0.; 
+				IssmDouble Pn1 = 0.; 
+				IssmDouble Pn2 = 0.; 
+				IssmDouble Pn_p = 0.; 
+				IssmDouble Pn_p1 = 0.; 
+				IssmDouble Pn_p2 = 0.; 
+
+				for (int n=0;n<ndeg;n++) {
+
+					/*compute legendre polynomials: P_n(cos\theta) & d P_n(cos\theta)/ d\theta: */
+					if(n==0){
+						Pn=1; 
+						Pn_p=0; 
+					}
+					else if(n==1){ 
+						Pn = cos(alpha); 
+						Pn_p = 1; 
+					}
+					else{
+						Pn = ( (2*n-1)*cos(alpha)*Pn1 - (n-1)*Pn2 ) /n;
+						Pn_p = ( (2*n-1)*(Pn1+cos(alpha)*Pn_p1) - (n-1)*Pn_p2 ) /n;
+					}
+					Pn2=Pn1; Pn1=Pn;
+					Pn_p2=Pn_p1; Pn_p1=Pn_p;
+
+					for(int t=0;t<ntimesteps;t++){
+						IssmDouble deltalove_G;
+						IssmDouble deltalove_U;
+
+						deltalove_G = (love_k[n*precomputednt+t]-love_k[(ndeg-1)*precomputednt+t]-love_h[n*precomputednt+t]+love_h[(ndeg-1)*precomputednt+t]);
+						deltalove_U = (love_h[n*precomputednt+t]-love_h[(ndeg-1)*precomputednt+t]);
+
+						G_viscoelastic_local[(i-lower_row)*ntimesteps+t] += deltalove_G*Pn;		                // gravitational potential 
+						U_viscoelastic_local[(i-lower_row)*ntimesteps+t] += deltalove_U*Pn;		                // vertical (up) displacement 
+						if(horiz)H_viscoelastic_local[(i-lower_row)*ntimesteps+t] += sin(alpha)*love_l[n*precomputednt+t]*Pn_p;		// horizontal displacements 
+					}
+				}
+			}
+		}
+		if(selfattraction){
+
+			/*merge G_viscoelastic_local into G_viscoelastic; U_viscoelastic_local into U_viscoelastic; H_viscoelastic_local to H_viscoelastic:{{{*/
+			int* recvcounts=xNew<int>(IssmComm::GetSize());
+			int* displs=xNew<int>(IssmComm::GetSize());
+			int  rc;
+			int  offset;
+
+			//deal with selfattraction first: 
+			ISSM_MPI_Allgather(&m,1,ISSM_MPI_INT,recvcounts,1,ISSM_MPI_INT,IssmComm::GetComm());
+
+			/*displs: */
+			ISSM_MPI_Allgather(&lower_row,1,ISSM_MPI_INT,displs,1,ISSM_MPI_INT,IssmComm::GetComm());
+
+			/*All gather:*/
+			ISSM_MPI_Allgatherv(G_gravi_local, m, ISSM_MPI_DOUBLE, G_gravi, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
+
+			if(elastic){
+				rc=m*ntimesteps;
+				offset=lower_row*ntimesteps;
+				ISSM_MPI_Allgather(&rc,1,ISSM_MPI_INT,recvcounts,1,ISSM_MPI_INT,IssmComm::GetComm());
+				ISSM_MPI_Allgather(&offset,1,ISSM_MPI_INT,displs,1,ISSM_MPI_INT,IssmComm::GetComm());
+
+				ISSM_MPI_Allgatherv(G_viscoelastic_local, m*ntimesteps, ISSM_MPI_DOUBLE, G_viscoelastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
+				ISSM_MPI_Allgatherv(U_viscoelastic_local, m*ntimesteps, ISSM_MPI_DOUBLE, U_viscoelastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
+				if(horiz)ISSM_MPI_Allgatherv(H_viscoelastic_local, m*ntimesteps, ISSM_MPI_DOUBLE, H_viscoelastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
+			}
+
+			/*free resources: */
+			xDelete<int>(recvcounts);
+			xDelete<int>(displs);
+
+			/*Avoid singularity at 0: */
+			G_gravi[0]=G_gravi[1];
+			if(elastic){
+				for(int t=0;t<ntimesteps;t++){
+					G_viscoelastic[t]=G_viscoelastic[ntimesteps+t];
+					U_viscoelastic[t]=U_viscoelastic[ntimesteps+t];
+					if(horiz)H_viscoelastic[t]=H_viscoelastic[ntimesteps+t];
+				}
+			}
+
+			/*Reinterpolate viscoelastic green kernels onto a regular gridded time 
+			 *with steps equal to timeacc:*/
+			if(viscous){
+				nt=reCast<int>((final_time-start_time)/timeacc)+1;
+#ifdef _HAVE_AD_
+				G_viscoelastic_interpolated=xNew<IssmDouble>(M*nt,"t");
+				U_viscoelastic_interpolated=xNew<IssmDouble>(M*nt,"t");
+				if(horiz)H_viscoelastic_interpolated=xNew<IssmDouble>(M*nt,"t");
+#else
+				G_viscoelastic_interpolated=xNew<IssmDouble>(M*nt);
+				U_viscoelastic_interpolated=xNew<IssmDouble>(M*nt);
+				if(horiz)H_viscoelastic_interpolated=xNew<IssmDouble>(M*nt);
+#endif
+
+				for(int t=0;t<nt;t++){
+					IssmDouble lincoeff;
+					IssmDouble viscoelastic_time=t*timeacc;
+					int        timeindex2=-1;
+
+					/*Find a way to interpolate precomputed Gkernels to our solution time stepping:*/
+					if(t!=0){
+						for(int t2=0;t2<ntimesteps;t2++){
+							if (viscoelastic_time<love_timefreq[t2]){
+								timeindex2=t2-1;
+								if(timeindex2<0)_error_("Temporal Love numbers are computed  with a time accuracy superior to the requested solution time step!");
+								lincoeff=(viscoelastic_time-love_timefreq[t2-1])/(love_timefreq[t2]-love_timefreq[t2-1]);
+								break;
+							}
+						}
+						if(timeindex2==-1)_error_("Temporal love numbers should be extended in time to encompass the requested solution time interval!");
+					}
+					else{
+						timeindex2=0;
+						lincoeff=0;
+					}
+
+					for(int index=0;index<M;index++){
+
+						int timeindex=index*nt+t;
+						int timepreindex= index*ntimesteps+timeindex2;
+						G_viscoelastic_interpolated[timeindex]=(1-lincoeff)*G_viscoelastic[timepreindex]+lincoeff*G_viscoelastic[timepreindex+1];
+						U_viscoelastic_interpolated[timeindex]=(1-lincoeff)*U_viscoelastic[timepreindex]+lincoeff*U_viscoelastic[timepreindex+1];
+						if(horiz)H_viscoelastic_interpolated[timeindex]=(1-lincoeff)*H_viscoelastic[timepreindex]+lincoeff*H_viscoelastic[timepreindex+1];
+					}
+				}
+
+			}
+			else if(elastic){
+				nt=1; //in elastic, or if we run only selfattraction, we need only one step
+#ifdef _HAVE_AD_
+				G_viscoelastic_interpolated=G_viscoelastic;
+				U_viscoelastic_interpolated=U_viscoelastic;
+				if(horiz)H_viscoelastic_interpolated=H_viscoelastic;
+#else
+				G_viscoelastic_interpolated=G_viscoelastic;
+				U_viscoelastic_interpolated=U_viscoelastic;
+				if(horiz)H_viscoelastic_interpolated=H_viscoelastic;
+#endif
+			}	
+
+			/*Save our precomputed tables into parameters*/
+			parameters->AddObject(new DoubleVecParam(SealevelchangeGSelfAttractionEnum,G_gravi,M));
+			if(viscous || elastic){
+				parameters->AddObject(new DoubleVecParam(SealevelchangeGViscoElasticEnum,G_viscoelastic_interpolated,M*nt));
+				parameters->AddObject(new DoubleVecParam(SealevelchangeUViscoElasticEnum,U_viscoelastic_interpolated,M*nt));
+				if(horiz)parameters->AddObject(new DoubleVecParam(SealevelchangeHViscoElasticEnum,H_viscoelastic_interpolated,M*nt));
+			}
+
+			/*free resources: */
+			xDelete<IssmDouble>(G_gravi);
+			xDelete<IssmDouble>(G_gravi_local);
+			if(elastic){
+				xDelete<IssmDouble>(love_h);
+				xDelete<IssmDouble>(love_k);
+				xDelete<IssmDouble>(love_l);
+				xDelete<IssmDouble>(love_th);
+				xDelete<IssmDouble>(love_tk);
+				xDelete<IssmDouble>(love_tl);
+				xDelete<IssmDouble>(G_viscoelastic);
+				xDelete<IssmDouble>(G_viscoelastic_local);
+				xDelete<IssmDouble>(U_viscoelastic);
+				xDelete<IssmDouble>(U_viscoelastic_local);
+				if(horiz){
+					xDelete<IssmDouble>(H_viscoelastic);
+					xDelete<IssmDouble>(H_viscoelastic_local);
+				}
+			}
+		} /*}}}*/
+
+		/*Indicate we have not yet run the Geometry Core module: */
+		parameters->AddObject(new BoolParam(SealevelchangeGeometryDoneEnum,false));
+		/*}}}*/
+	}
+
+	/*Transitions:{{{ */
+	iomodel->FetchData(&transitions,&transitions_M,&transitions_N,&ntransitions,"md.solidearth.transitions");
+	if(transitions){
+		parameters->AddObject(new DoubleMatArrayParam(SealevelchangeTransitionsEnum,transitions,ntransitions,transitions_M,transitions_N));
+
+		for(int i=0;i<ntransitions;i++){
+			IssmDouble* transition=transitions[i];
+			xDelete<IssmDouble>(transition);
+		}
+		xDelete<IssmDouble*>(transitions);
+		xDelete<int>(transitions_M);
+		xDelete<int>(transitions_N);
+	} /*}}}*/
+	/*Requested outputs {{{*/
+	iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.solidearth.requested_outputs");
+	if(numoutputs)parameters->AddObject(new StringArrayParam(SealevelchangeRequestedOutputsEnum,requestedoutputs,numoutputs));
+	iomodel->DeleteData(&requestedoutputs,numoutputs,"md.solidearth.requested_outputs");
+	/*}}}*/
+
+}/*}}}*/
+
+/*Finite Element Analysis*/
+void           SealevelchangeAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           SealevelchangeAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+
+	/*run sea level change core geometry only once, after the Model Processor is done:*/
+	sealevelchange_initialgeometry(femmodel);
+
+}/*}}}*/
+ElementVector* SealevelchangeAnalysis::CreateDVector(Element* element){/*{{{*/
+	/*Default, return NULL*/
+	return NULL;
+}/*}}}*/
+ElementMatrix* SealevelchangeAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
+_error_("Not implemented");
+}/*}}}*/
+ElementMatrix* SealevelchangeAnalysis::CreateKMatrix(Element* element){/*{{{*/
+	_error_("not implemented yet");
+}/*}}}*/
+ElementVector* SealevelchangeAnalysis::CreatePVector(Element* element){/*{{{*/
+_error_("not implemented yet");
+}/*}}}*/
+void           SealevelchangeAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+	   _error_("not implemented yet");
+}/*}}}*/
+void           SealevelchangeAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
+	_error_("Not implemented yet");
+}/*}}}*/
+void           SealevelchangeAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+	_error_("not implemeneted yet!");
+
+}/*}}}*/
+void           SealevelchangeAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+	/*Default, do nothing*/
+	return;
+}/*}}}*/
Index: /issm/trunk/src/c/analyses/SealevelchangeAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/SealevelchangeAnalysis.h	(revision 26744)
+++ /issm/trunk/src/c/analyses/SealevelchangeAnalysis.h	(revision 26744)
@@ -0,0 +1,34 @@
+/*! \file SealevelchangeAnalysis.h 
+ *  \brief: header file for generic external result object
+ */
+
+#ifndef _SealevelchangeAnalysis_
+#define _SealevelchangeAnalysis_
+
+/*Headers*/
+#include "./Analysis.h"
+
+class SealevelchangeAnalysis: public Analysis{
+
+	public:
+		/*Model processing*/
+		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
+		void CreateLoads(Loads* loads, IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
+		int  DofsPerNode(int** doflist,int domaintype,int approximation);
+		void UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type);
+		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
+
+		/*Finite element Analysis*/
+		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
+		ElementVector* CreateDVector(Element* element);
+		ElementMatrix* CreateJacobianMatrix(Element* element);
+		ElementMatrix* CreateKMatrix(Element* element);
+		ElementVector* CreatePVector(Element* element);
+		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+		void           GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index);
+		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
+		void           UpdateConstraints(FemModel* femmodel);
+};
+#endif
Index: sm/trunk/src/c/analyses/SealevelriseAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/SealevelriseAnalysis.cpp	(revision 26743)
+++ 	(revision )
@@ -1,504 +1,0 @@
-#include "./SealevelriseAnalysis.h"
-#include <math.h>
-#include "../toolkits/toolkits.h"
-#include "../classes/classes.h"
-#include "../classes/Inputs/TransientInput.h"
-#include "../shared/shared.h"
-#include "../modules/modules.h"
-
-/*Model processing*/
-void SealevelriseAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
-	/*No constraints*/
-}/*}}}*/
-void SealevelriseAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
-	/*No loads*/
-}/*}}}*/
-void SealevelriseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
-	::CreateNodes(nodes,iomodel,SealevelriseAnalysisEnum,P1Enum);
-}/*}}}*/
-int  SealevelriseAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
-	return 1;
-}/*}}}*/
-void SealevelriseAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
-
-	int geodetic=0;
-	int dslmodel=0;
-
-	/*Update elements: */
-	int counter=0;
-	for(int i=0;i<iomodel->numberofelements;i++){
-		if(iomodel->my_elements[i]){
-			Element* element=(Element*)elements->GetObjectByOffset(counter);
-			element->Update(inputs,i,iomodel,analysis_counter,analysis_type,P1Enum);
-			counter++;
-		}
-	}
-
-	/*Create inputs: */
-	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
-	iomodel->FetchData(&geodetic,"md.solidearth.settings.computesealevelchange");
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.icethicknesschange",SurfaceloadIceThicknessChangeEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
-	iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.waterheightchange",SurfaceloadWaterHeightChangeEnum);
-		
-	/*dynamic sea level: */
-	iomodel->FetchData(&dslmodel,"md.dsl.model");
-	if (dslmodel==1){ /*standard dsl model:{{{*/
-
-		/*deal with global mean steric rate: */
-		IssmDouble* str=NULL; 
-		IssmDouble* times = NULL;
-		int M,N;
-
-		/*fetch str vector:*/
-		iomodel->FetchData(&str,&M,&N,"md.dsl.global_average_thermosteric_sea_level_change"); _assert_(M==2);
-		
-		//recover time vector: 
-		times=xNew<IssmDouble>(N);
-		for(int t=0;t<N;t++) times[t] = str[N+t];
-
-		/*create transient input: */
-		inputs->SetTransientInput(DslGlobalAverageThermostericSeaLevelChangeEnum,times,N);
-		TransientInput* transientinput = inputs->GetTransientInput(DslGlobalAverageThermostericSeaLevelChangeEnum);
-		
-			
-		for(Object* & object : elements->objects){
-			Element* element=xDynamicCast<Element*>(object);
-
-			for(int t=0;t<N;t++){
-				switch(element->ObjectEnum()){
-					case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&element->lid,&str[t],P0Enum); break;
-					case PentaEnum: transientinput->AddPentaTimeInput(t,1,&element->lid,&str[t],P0Enum); break;
-					default: _error_("Not implemented yet");
-				}
-			}
-		}
-
-		/*cleanup:*/
-		xDelete<IssmDouble>(times);
-		iomodel->DeleteData(str,"md.dsl.global_average_thermosteric_sea_level_change");
-
-		/*deal with dynamic sea level fields: */
-		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_surface_height_change_above_geoid", DslSeaSurfaceHeightChangeAboveGeoidEnum);
-		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_water_pressure_change_at_sea_floor", DslSeaWaterPressureChangeAtSeaFloorEnum);
-		
-	} /*}}}*/
-	else if (dslmodel==2){ /*multi-model ensemble dsl model:{{{*/
-	
-		/*variables:*/
-		int nummodels;
-		IssmDouble** pstr=NULL; 
-		IssmDouble*  str=NULL;
-		IssmDouble*  times = NULL;
-		int* pM = NULL;
-		int* pN = NULL;
-		int M,N;
-
-		/*deal with dsl.global_average_thermosteric_sea_level_change {{{*/
-		iomodel->FetchData(&pstr,&pM,&pN,&nummodels,"md.dsl.global_average_thermosteric_sea_level_change");
-
-		/*go through the mat array and create a dataset of transient inputs:*/
-		for (int i=0;i<nummodels;i++){
-
-			M=pM[i];
-			N=pN[i];
-			str=pstr[i];
-
-			//recover time vector: 
-			times=xNew<IssmDouble>(N);
-			for(int t=0;t<N;t++) times[t] = str[(M-1)*N+t];
-
-			TransientInput* transientinput=inputs->SetDatasetTransientInput(DslGlobalAverageThermostericSeaLevelChangeEnum,i, times,N);
-			
-			for(Object* & object : elements->objects){
-				Element* element=xDynamicCast<Element*>(object);
-
-				for(int t=0;t<N;t++){
-					switch(element->ObjectEnum()){
-						case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&element->lid,&str[t],P0Enum); break;
-						case PentaEnum: transientinput->AddPentaTimeInput(t,1,&element->lid,&str[t],P0Enum); break;
-						default: _error_("Not implemented yet");
-					}
-				}
-			}
-			xDelete<IssmDouble>(times);
-		}
-		/*Delete data:*/
-		for(int i=0;i<nummodels;i++){
-			IssmDouble* str=pstr[i];
-			xDelete<IssmDouble>(str);
-		}
-		xDelete<IssmDouble*>(pstr);
-		xDelete<int>(pM);
-		xDelete<int>(pN);
-		/*}}}*/
-		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_surface_height_change_above_geoid",DslSeaSurfaceHeightChangeAboveGeoidEnum);
-		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_water_pressure_change_at_sea_floor",DslSeaWaterPressureChangeAtSeaFloorEnum);
-
-	} /*}}}*/
-	else _error_("Dsl model " << dslmodel << " not implemented yet!");
-		
-	
-
-	/*Initialize cumdeltalthickness and sealevel rise rate input*/
-	InputUpdateFromConstantx(inputs,elements,0.,SealevelriseCumDeltathicknessEnum);
-	InputUpdateFromConstantx(inputs,elements,0.,SealevelNEsaRateEnum);
-	InputUpdateFromConstantx(inputs,elements,0.,SealevelUEsaRateEnum);
-	InputUpdateFromConstantx(inputs,elements,0.,SealevelRSLRateEnum);
-	InputUpdateFromConstantx(inputs,elements,0.,SealevelEustaticMaskEnum);
-	InputUpdateFromConstantx(inputs,elements,0.,SealevelEustaticOceanMaskEnum);
-
-}/*}}}*/
-void SealevelriseAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
-
-	int         nl;
-	IssmDouble* love_h=NULL;
-	IssmDouble* love_k=NULL;
-	IssmDouble* love_l=NULL;
-	IssmDouble* love_th=NULL;
-	IssmDouble* love_tk=NULL;
-	IssmDouble* love_tl=NULL;
-	int         dslmodel=0;
-
-	IssmDouble* G_rigid = NULL;
-	IssmDouble* G_rigid_local = NULL;
-	IssmDouble* G_elastic = NULL;
-	IssmDouble* G_elastic_local = NULL;
-	IssmDouble* U_elastic = NULL;
-	IssmDouble* U_elastic_local = NULL;
-	IssmDouble* H_elastic = NULL;
-	IssmDouble* H_elastic_local = NULL;
-	int         M,m,lower_row,upper_row;
-	IssmDouble  degacc=.01;
-	IssmDouble  planetradius=0;
-	IssmDouble  planetarea=0;
-	bool		rigid=false;
-	bool		elastic=false;
-	bool		rotation=false;
-
-	int     numoutputs;
-	char**  requestedoutputs = NULL;
-
-	/*transition vectors: */
-	IssmDouble **transitions    = NULL;
-	int         *transitions_M    = NULL;
-	int         *transitions_N    = NULL;
-	int          ntransitions;
-	IssmDouble*  partitionice=NULL;
-	IssmDouble*  partitionhydro=NULL;
-	IssmDouble*  bslrice_partition=NULL;
-	IssmDouble*  bslrhydro_partition=NULL;
-	int          npartice,nparthydro,nel;
-
-
-	/*some constant parameters: */
-	parameters->AddObject(iomodel->CopyConstantObject("md.dsl.model",DslModelEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.runfrequency",SolidearthSettingsRunFrequencyEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.reltol",SolidearthSettingsReltolEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.abstol",SolidearthSettingsAbstolEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.maxiter",SolidearthSettingsMaxiterEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.rigid",SolidearthSettingsRigidEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.horiz",SolidearthSettingsHorizEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.elastic",SolidearthSettingsElasticEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.rotation",SolidearthSettingsRotationEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.equatorialmoi",RotationalEquatorialMoiEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.polarmoi",RotationalPolarMoiEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.angularvelocity",RotationalAngularVelocityEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.ocean_area_scaling",SolidearthSettingsOceanAreaScalingEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.computesealevelchange",SolidearthSettingsComputesealevelchangeEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.isgrd",SolidearthSettingsGRDEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.planetradius",SolidearthPlanetRadiusEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.glfraction",SolidearthSettingsGlfractionEnum));
-	parameters->AddObject(new DoubleParam(CumBslrEnum,0.0));
-	parameters->AddObject(new DoubleParam(CumBslrIceEnum,0.0));
-	parameters->AddObject(new DoubleParam(CumBslrHydroEnum,0.0));
-	parameters->AddObject(new DoubleParam(CumGmtslrEnum,0.0));
-
-	/*compute planet area and plug into parameters:*/
-	iomodel->FetchData(&planetradius,"md.solidearth.planetradius");
-	planetarea=4*PI*planetradius*planetradius;
-	parameters->AddObject(new DoubleParam(SolidearthPlanetAreaEnum,planetarea));
-
-	/*Deal with partition of the barystatic contribution:*/
-	iomodel->FetchData(&npartice,"md.solidearth.npartice");
-	parameters->AddObject(new IntParam(SolidearthNpartIceEnum,npartice));
-	if(npartice){
-		iomodel->FetchData(&partitionice,&nel,NULL,"md.solidearth.partitionice");
-		parameters->AddObject(new DoubleMatParam(SolidearthPartitionIceEnum,partitionice,nel,1));
-		parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.npartice",SolidearthNpartIceEnum));
-		bslrice_partition=xNewZeroInit<IssmDouble>(npartice);
-		parameters->AddObject(new DoubleMatParam(CumBslrIcePartitionEnum,bslrice_partition,npartice,1));
-		xDelete<IssmDouble>(partitionice);
-	}
-	iomodel->FetchData(&nparthydro,"md.solidearth.nparthydro");
-	parameters->AddObject(new IntParam(SolidearthNpartHydroEnum,nparthydro));
-	if(nparthydro){
-		iomodel->FetchData(&partitionhydro,&nel,NULL,"md.solidearth.partitionhydro");
-		parameters->AddObject(new DoubleMatParam(SolidearthPartitionHydroEnum,partitionhydro,nel,1));
-		parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.nparthydro",SolidearthNpartHydroEnum));
-		bslrhydro_partition=xNewZeroInit<IssmDouble>(nparthydro);
-		parameters->AddObject(new DoubleMatParam(CumBslrHydroPartitionEnum,bslrhydro_partition,nparthydro,1));
-		xDelete<IssmDouble>(partitionhydro);
-	}
-
-	/*Deal with dsl multi-model ensembles: {{{*/
-	iomodel->FetchData(&dslmodel,"md.dsl.model");
-	parameters->AddObject(iomodel->CopyConstantObject("md.dsl.compute_fingerprints",DslComputeFingerprintsEnum));
-	if(dslmodel==2){
-		IssmDouble modelid; 
-		int nummodels;
-		
-		/*create double param, not int param, because Dakota will be updating it as 
-		 * a double potentially: */
-		iomodel->FetchData(&modelid,"md.dsl.modelid");
-		parameters->AddObject(new DoubleParam(DslModelidEnum,modelid));
-		parameters->AddObject(iomodel->CopyConstantObject("md.dsl.nummodels",DslNummodelsEnum));
-		iomodel->FetchData(&nummodels,"md.dsl.nummodels");
-
-		/*quick checks: */
-		if(nummodels<=0)_error_("dslmme object in  md.dsl field should contain at least 1 ensemble model!");
-		if(modelid<=0 || modelid>nummodels)_error_("modelid field in dslmme object of md.dsl field should be between 1 and the number of ensemble runs!");
-	} /*}}}*/
-	/*Deal with elasticity {{{*/
-	iomodel->FetchData(&rigid,"md.solidearth.settings.rigid");
-	iomodel->FetchData(&elastic,"md.solidearth.settings.elastic");
-	iomodel->FetchData(&rotation,"md.solidearth.settings.rotation");
-
-	if(elastic | rigid){
-		/*compute green functions for a range of angles*/
-		iomodel->FetchData(&degacc,"md.solidearth.settings.degacc");
-		M=reCast<int,IssmDouble>(180./degacc+1.);
-	}
-
-	/*love numbers: */
-	if(elastic){
-		iomodel->FetchData(&love_h,&nl,NULL,"md.solidearth.lovenumbers.h");
-		iomodel->FetchData(&love_k,&nl,NULL,"md.solidearth.lovenumbers.k");
-		iomodel->FetchData(&love_l,&nl,NULL,"md.solidearth.lovenumbers.l");
-		iomodel->FetchData(&love_th,&nl,NULL,"md.solidearth.lovenumbers.th");
-		iomodel->FetchData(&love_tk,&nl,NULL,"md.solidearth.lovenumbers.tk");
-		iomodel->FetchData(&love_tl,&nl,NULL,"md.solidearth.lovenumbers.tl");
-
-		parameters->AddObject(new DoubleMatParam(LoadLoveHEnum,love_h,nl,1));
-		parameters->AddObject(new DoubleMatParam(LoadLoveKEnum,love_k,nl,1));
-		parameters->AddObject(new DoubleMatParam(LoadLoveLEnum,love_l,nl,1));
-		parameters->AddObject(new DoubleMatParam(TidalLoveHEnum,love_th,nl,1));
-		parameters->AddObject(new DoubleMatParam(TidalLoveKEnum,love_tk,nl,1));
-		parameters->AddObject(new DoubleMatParam(TidalLoveLEnum,love_tl,nl,1));
-
-		// AD performance is sensitive to calls to ensurecontiguous.
-		// // Providing "t" will cause ensurecontiguous to be called.
-		#ifdef _HAVE_AD_
-		G_elastic=xNew<IssmDouble>(M,"t");
-		U_elastic=xNew<IssmDouble>(M,"t");
-		H_elastic=xNew<IssmDouble>(M,"t");
-		#else
-		G_elastic=xNew<IssmDouble>(M);
-		U_elastic=xNew<IssmDouble>(M);
-		H_elastic=xNew<IssmDouble>(M);
-		#endif
-	}
-	if(rigid){
-		#ifdef _HAVE_AD_
-		G_rigid=xNew<IssmDouble>(M,"t");
-		#else
-		G_rigid=xNew<IssmDouble>(M);
-		#endif
-	}
-	
-	if(rotation)parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.lovenumbers.tk2secular",TidalLoveK2SecularEnum));
-
-	if(rigid | elastic){
-
-		/*compute combined legendre + love number (elastic green function:*/
-		m=DetermineLocalSize(M,IssmComm::GetComm());
-		GetOwnershipBoundariesFromRange(&lower_row,&upper_row,m,IssmComm::GetComm());
-	}
-	if(elastic){
-		#ifdef _HAVE_AD_
-		G_elastic_local=xNew<IssmDouble>(m,"t");
-		U_elastic_local=xNew<IssmDouble>(m,"t");
-		H_elastic_local=xNew<IssmDouble>(m,"t");
-		#else
-		G_elastic_local=xNew<IssmDouble>(m);
-		U_elastic_local=xNew<IssmDouble>(m);
-		H_elastic_local=xNew<IssmDouble>(m);
-		#endif
-	}
-	if(rigid){
-		#ifdef _HAVE_AD_
-		G_rigid_local=xNew<IssmDouble>(m,"t");
-		#else
-		G_rigid_local=xNew<IssmDouble>(m);
-		#endif
-	}
-
-	if(rigid){
-		for(int i=lower_row;i<upper_row;i++){
-			IssmDouble alpha,x;
-			alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;
-			G_rigid_local[i-lower_row]= .5/sin(alpha/2.0);
-		}
-	}
-	if(elastic){
-		for(int i=lower_row;i<upper_row;i++){
-			IssmDouble alpha,x;
-			alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;
-
-			G_elastic_local[i-lower_row]= (love_k[nl-1]-love_h[nl-1])*G_rigid_local[i-lower_row];
-			U_elastic_local[i-lower_row]= (love_h[nl-1])*G_rigid_local[i-lower_row];
-			H_elastic_local[i-lower_row]= 0; 
-			IssmDouble Pn = 0.; 
-			IssmDouble Pn1 = 0.; 
-			IssmDouble Pn2 = 0.; 
-			IssmDouble Pn_p = 0.; 
-			IssmDouble Pn_p1 = 0.; 
-			IssmDouble Pn_p2 = 0.; 
-
-			for (int n=0;n<nl;n++) {
-				IssmDouble deltalove_G;
-				IssmDouble deltalove_U;
-
-				deltalove_G = (love_k[n]-love_k[nl-1]-love_h[n]+love_h[nl-1]);
-				deltalove_U = (love_h[n]-love_h[nl-1]);
-
-				/*compute legendre polynomials: P_n(cos\theta) & d P_n(cos\theta)/ d\theta: */
-				if(n==0){
-					Pn=1; 
-					Pn_p=0; 
-				}
-				else if(n==1){ 
-					Pn = cos(alpha); 
-					Pn_p = 1; 
-				}
-				else{
-					Pn = ( (2*n-1)*cos(alpha)*Pn1 - (n-1)*Pn2 ) /n;
-					Pn_p = ( (2*n-1)*(Pn1+cos(alpha)*Pn_p1) - (n-1)*Pn_p2 ) /n;
-				}
-				Pn2=Pn1; Pn1=Pn;
-				Pn_p2=Pn_p1; Pn_p1=Pn_p;
-
-				G_elastic_local[i-lower_row] += deltalove_G*Pn;		// gravitational potential 
-				U_elastic_local[i-lower_row] += deltalove_U*Pn;		// vertical (up) displacement 
-				H_elastic_local[i-lower_row] += sin(alpha)*love_l[n]*Pn_p;		// horizontal displacements 
-			}
-		}
-	}
-	if(rigid){
-
-		/*merge G_elastic_local into G_elastic; U_elastic_local into U_elastic; H_elastic_local to H_elastic:{{{*/
-		int* recvcounts=xNew<int>(IssmComm::GetSize());
-		int* displs=xNew<int>(IssmComm::GetSize());
-
-		//recvcounts:
-		ISSM_MPI_Allgather(&m,1,ISSM_MPI_INT,recvcounts,1,ISSM_MPI_INT,IssmComm::GetComm());
-
-		/*displs: */
-		ISSM_MPI_Allgather(&lower_row,1,ISSM_MPI_INT,displs,1,ISSM_MPI_INT,IssmComm::GetComm());
-
-		/*All gather:*/
-		ISSM_MPI_Allgatherv(G_rigid_local, m, ISSM_MPI_DOUBLE, G_rigid, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
-		if(elastic){
-			ISSM_MPI_Allgatherv(G_elastic_local, m, ISSM_MPI_DOUBLE, G_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
-			ISSM_MPI_Allgatherv(U_elastic_local, m, ISSM_MPI_DOUBLE, U_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
-			ISSM_MPI_Allgatherv(H_elastic_local, m, ISSM_MPI_DOUBLE, H_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
-		}
-		
-		/*free resources: */
-		xDelete<int>(recvcounts);
-		xDelete<int>(displs);
-
-		/*Avoid singularity at 0: */
-		G_rigid[0]=G_rigid[1];
-		if(elastic){
-			G_elastic[0]=G_elastic[1];
-			U_elastic[0]=U_elastic[1];
-			H_elastic[0]=H_elastic[1];
-		}
-		
-
-		/*Save our precomputed tables into parameters*/
-		parameters->AddObject(new DoubleVecParam(SealevelriseGRigidEnum,G_rigid,M));
-		if(elastic){
-			parameters->AddObject(new DoubleVecParam(SealevelriseGElasticEnum,G_elastic,M));
-			parameters->AddObject(new DoubleVecParam(SealevelriseUElasticEnum,U_elastic,M));
-			parameters->AddObject(new DoubleVecParam(SealevelriseHElasticEnum,H_elastic,M));
-		}
-
-		/*free resources: */
-		xDelete<IssmDouble>(G_rigid);
-		xDelete<IssmDouble>(G_rigid_local);
-		if(elastic){
-			xDelete<IssmDouble>(love_h);
-			xDelete<IssmDouble>(love_k);
-			xDelete<IssmDouble>(love_l);
-			xDelete<IssmDouble>(love_th);
-			xDelete<IssmDouble>(love_tk);
-			xDelete<IssmDouble>(love_tl);
-			xDelete<IssmDouble>(G_elastic);
-			xDelete<IssmDouble>(G_elastic_local);
-			xDelete<IssmDouble>(U_elastic);
-			xDelete<IssmDouble>(U_elastic_local);
-			xDelete<IssmDouble>(H_elastic);
-			xDelete<IssmDouble>(H_elastic_local);
-		}
-	} /*}}}*/
-
-	/*Indicate we have not yet run the Geometry Core module: */
-	parameters->AddObject(new BoolParam(SealevelriseGeometryDoneEnum,false));
-	/*}}}*/
-
-	/*Transitions:{{{ */
-	iomodel->FetchData(&transitions,&transitions_M,&transitions_N,&ntransitions,"md.solidearth.transitions");
-	if(transitions){
-		parameters->AddObject(new DoubleMatArrayParam(SealevelriseTransitionsEnum,transitions,ntransitions,transitions_M,transitions_N));
-
-		for(int i=0;i<ntransitions;i++){
-			IssmDouble* transition=transitions[i];
-			xDelete<IssmDouble>(transition);
-		}
-		xDelete<IssmDouble*>(transitions);
-		xDelete<int>(transitions_M);
-		xDelete<int>(transitions_N);
-	} /*}}}*/
-	/*Requested outputs {{{*/
-	iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.solidearth.requested_outputs");
-	if(numoutputs)parameters->AddObject(new StringArrayParam(SealevelriseRequestedOutputsEnum,requestedoutputs,numoutputs));
-	iomodel->DeleteData(&requestedoutputs,numoutputs,"md.solidearth.requested_outputs");
-	/*}}}*/
-
-}/*}}}*/
-
-/*Finite Element Analysis*/
-void           SealevelriseAnalysis::Core(FemModel* femmodel){/*{{{*/
-	_error_("not implemented");
-}/*}}}*/
-ElementVector* SealevelriseAnalysis::CreateDVector(Element* element){/*{{{*/
-	/*Default, return NULL*/
-	return NULL;
-}/*}}}*/
-ElementMatrix* SealevelriseAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
-_error_("Not implemented");
-}/*}}}*/
-ElementMatrix* SealevelriseAnalysis::CreateKMatrix(Element* element){/*{{{*/
-	_error_("not implemented yet");
-}/*}}}*/
-ElementVector* SealevelriseAnalysis::CreatePVector(Element* element){/*{{{*/
-_error_("not implemented yet");
-}/*}}}*/
-void           SealevelriseAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
-	   _error_("not implemented yet");
-}/*}}}*/
-void           SealevelriseAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
-	_error_("Not implemented yet");
-}/*}}}*/
-void           SealevelriseAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
-	_error_("not implemeneted yet!");
-
-}/*}}}*/
-void           SealevelriseAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
-	/*Default, do nothing*/
-	return;
-}/*}}}*/
Index: sm/trunk/src/c/analyses/SealevelriseAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/SealevelriseAnalysis.h	(revision 26743)
+++ 	(revision )
@@ -1,33 +1,0 @@
-/*! \file SealevelriseAnalysis.h 
- *  \brief: header file for generic external result object
- */
-
-#ifndef _SealevelriseAnalysis_
-#define _SealevelriseAnalysis_
-
-/*Headers*/
-#include "./Analysis.h"
-
-class SealevelriseAnalysis: public Analysis{
-
-	public:
-		/*Model processing*/
-		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
-		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
-		int  DofsPerNode(int** doflist,int domaintype,int approximation);
-		void UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type);
-		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
-
-		/*Finite element Analysis*/
-		void           Core(FemModel* femmodel);
-		ElementVector* CreateDVector(Element* element);
-		ElementMatrix* CreateJacobianMatrix(Element* element);
-		ElementMatrix* CreateKMatrix(Element* element);
-		ElementVector* CreatePVector(Element* element);
-		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
-		void           GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index);
-		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
-		void           UpdateConstraints(FemModel* femmodel);
-};
-#endif
Index: /issm/trunk/src/c/analyses/SmbAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/SmbAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/SmbAnalysis.cpp	(revision 26744)
@@ -46,4 +46,5 @@
 			iomodel->FetchDataToInput(inputs,elements,"md.smb.V",SmbVEnum);
 			iomodel->FetchDataToInput(inputs,elements,"md.smb.dswrf",SmbDswrfEnum);
+			iomodel->FetchDataToInput(inputs,elements,"md.smb.dswdiffrf",SmbDswdiffrfEnum);
 			iomodel->FetchDataToInput(inputs,elements,"md.smb.dlwrf",SmbDlwrfEnum);
 			iomodel->FetchDataToInput(inputs,elements,"md.smb.P",SmbPEnum);
@@ -70,8 +71,14 @@
 			iomodel->FetchDataToInput(inputs,elements,"md.smb.Wini",SmbWiniEnum);
 			iomodel->FetchDataToInput(inputs,elements,"md.smb.Aini",SmbAiniEnum);
+			iomodel->FetchDataToInput(inputs,elements,"md.smb.Adiffini",SmbAdiffiniEnum);
 			iomodel->FetchDataToInput(inputs,elements,"md.smb.Tini",SmbTiniEnum);
 			iomodel->FetchDataToInput(inputs,elements,"md.smb.Sizeini",SmbSizeiniEnum);
 			iomodel->FetchDataToInput(inputs,elements,"md.smb.aValue",SmbAValueEnum);
+			iomodel->FetchDataToInput(inputs,elements,"md.smb.dulwrfValue",SmbDulwrfValueEnum);
 			iomodel->FetchDataToInput(inputs,elements,"md.smb.teValue",SmbTeValueEnum);
+			iomodel->FetchDataToInput(inputs,elements,"md.smb.szaValue",SmbSzaValueEnum);
+			iomodel->FetchDataToInput(inputs,elements,"md.smb.cotValue",SmbCotValueEnum);
+			iomodel->FetchDataToInput(inputs,elements,"md.smb.ccsnowValue",SmbCcsnowValueEnum);
+			iomodel->FetchDataToInput(inputs,elements,"md.smb.cciceValue",SmbCciceValueEnum);
 			break;
 		case SMBpddEnum:
@@ -173,4 +180,7 @@
 			iomodel->FetchDataToInput(inputs,elements,"md.smb.b_min",SmbBMinEnum);
 			break;
+		case SMBautoregressionEnum:
+         iomodel->FetchDataToInput(inputs,elements,"md.smb.basin_id",SmbBasinsIdEnum);
+         break;
 		case SMBhenningEnum:
 			iomodel->FetchDataToInput(inputs,elements,"md.smb.smbref",SmbSmbrefEnum,0.);
@@ -212,5 +222,5 @@
 	int     numoutputs;
 	char**  requestedoutputs = NULL;
-	bool    isdelta18o,ismungsm,isd18opd,issetpddfac,interp,isfirnwarming;
+	bool    isdelta18o,ismungsm,isd18opd,issetpddfac,interp,cycle,isfirnwarming;
 	int     smb_model, smbslices, averaging;
 	IssmDouble *temp = NULL;
@@ -220,18 +230,18 @@
 
 	iomodel->FindConstant(&smb_model,"md.smb.model");
-	iomodel->FindConstant(&interp,"md.timestepping.interp_forcings");
+	iomodel->FindConstant(&interp,"md.timestepping.interp_forcing");
+	iomodel->FindConstant(&cycle,"md.timestepping.cycle_forcing");
 
 	iomodel->FindConstant(&smbslices,"md.smb.steps_per_step");
 	parameters->AddObject(new IntParam(SmbStepsPerStepEnum,smbslices));
 
-
 	parameters->AddObject(iomodel->CopyConstantObject("md.smb.averaging",SmbAveragingEnum));
 
 	switch(smb_model){
 		case SMBforcingEnum:
-			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isclimatology",SmbIsclimatologyEnum));
 			break;
 		case SMBgembEnum:
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.aIdx",SmbAIdxEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.eIdx",SmbEIdxEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.swIdx",SmbSwIdxEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.denIdx",SmbDenIdxEnum));
@@ -252,9 +262,10 @@
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isdensification",SmbIsdensificationEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isturbulentflux",SmbIsturbulentfluxEnum));
-			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isclimatology",SmbIsclimatologyEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isconstrainsurfaceT",SmbIsconstrainsurfaceTEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isdeltaLWup",SmbIsdeltaLWupEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.InitDensityScaling",SmbInitDensityScalingEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.ThermoDeltaTScaling",SmbThermoDeltaTScalingEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.adThresh",SmbAdThreshEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.teThresh",SmbTeThreshEnum));
 			break;
 		case SMBpddEnum:
@@ -267,22 +278,22 @@
 			if(ismungsm){
 			  iomodel->FetchData(&temp,&N,&M,"md.smb.Pfac"); _assert_(N==2);
-			  parameters->AddObject(new TransientParam(SmbPfacEnum,&temp[0],&temp[M],interp,M));
+			  parameters->AddObject(new TransientParam(SmbPfacEnum,&temp[0],&temp[M],interp,cycle,M));
 			  iomodel->DeleteData(temp,"md.smb.Pfac");
 
 			  iomodel->FetchData(&temp,&N,&M,"md.smb.Tdiff"); _assert_(N==2);
-			  parameters->AddObject(new TransientParam(SmbTdiffEnum,&temp[0],&temp[M],interp,M));
+			  parameters->AddObject(new TransientParam(SmbTdiffEnum,&temp[0],&temp[M],interp,cycle,M));
 			  iomodel->DeleteData(temp,"md.smb.Tdiff");
 
 			  iomodel->FetchData(&temp,&N,&M,"md.smb.sealev"); _assert_(N==2);
-			  parameters->AddObject(new TransientParam(SmbSealevEnum,&temp[0],&temp[M],interp,M));
+			  parameters->AddObject(new TransientParam(SmbSealevEnum,&temp[0],&temp[M],interp,cycle,M));
 			  iomodel->DeleteData(temp,"md.smb.sealev");
 			}
 			if(isdelta18o){
 				iomodel->FetchData(&temp,&N,&M,"md.smb.delta18o"); _assert_(N==2);
-				parameters->AddObject(new TransientParam(SmbDelta18oEnum,&temp[0],&temp[M],interp,M));
+				parameters->AddObject(new TransientParam(SmbDelta18oEnum,&temp[0],&temp[M],interp,cycle,M));
 				iomodel->DeleteData(temp,"md.smb.delta18o");
 
 				iomodel->FetchData(&temp,&N,&M,"md.smb.delta18o_surface"); _assert_(N==2);
-				parameters->AddObject(new TransientParam(SmbDelta18oSurfaceEnum,&temp[0],&temp[M],interp,M));
+				parameters->AddObject(new TransientParam(SmbDelta18oSurfaceEnum,&temp[0],&temp[M],interp,cycle,M));
 				iomodel->DeleteData(temp,"md.smb.delta18o_surface");
 			}
@@ -304,5 +315,5 @@
 				parameters->AddObject(iomodel->CopyConstantObject("md.smb.isprecipscaled",SmbIsprecipscaledEnum));
 				iomodel->FetchData(&temp,&N,&M,"md.smb.delta18o"); _assert_(N==2);
-				parameters->AddObject(new TransientParam(SmbDelta18oEnum,&temp[0],&temp[M],interp,M));
+				parameters->AddObject(new TransientParam(SmbDelta18oEnum,&temp[0],&temp[M],interp,cycle,M));
 				iomodel->DeleteData(temp,"md.smb.delta18o");
 
@@ -371,12 +382,13 @@
 			/*Nothing to add to parameters*/
 			break;
+		case SMBautoregressionEnum:
+         /*Nothing to add to parameters*/
+         break;
 		case SMBhenningEnum:
 			/*Nothing to add to parameters*/
 			break;
 		case SMBcomponentsEnum:
-			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isclimatology",SmbIsclimatologyEnum));
 			break;
 		case SMBmeltcomponentsEnum:
-			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isclimatology",SmbIsclimatologyEnum));
 			break;
 		case SMBgradientscomponentsEnum:
@@ -385,15 +397,15 @@
 
 				iomodel->FetchData(&temp,&N,&M,"md.smb.accugrad"); _assert_(N==2);
-				parameters->AddObject(new TransientParam(SmbAccugradEnum,&temp[0],&temp[M],interp,M));
+				parameters->AddObject(new TransientParam(SmbAccugradEnum,&temp[0],&temp[M],interp,cycle,M));
 				iomodel->DeleteData(temp,"md.smb.accugrad");
 				iomodel->FetchData(&temp,&N,&M,"md.smb.runoffgrad"); _assert_(N==2);
-				parameters->AddObject(new TransientParam(SmbRunoffgradEnum,&temp[0],&temp[M],interp,M));
+				parameters->AddObject(new TransientParam(SmbRunoffgradEnum,&temp[0],&temp[M],interp,cycle,M));
 				iomodel->DeleteData(temp,"md.smb.runoffgrad");
 
 				iomodel->FetchData(&temp,&N,&M,"md.smb.accuref"); _assert_(N==2);
-				parameters->AddObject(new TransientParam(SmbAccurefEnum,&temp[0],&temp[M],interp,M));
+				parameters->AddObject(new TransientParam(SmbAccurefEnum,&temp[0],&temp[M],interp,cycle,M));
 				iomodel->DeleteData(temp,"md.smb.accuref");
 				iomodel->FetchData(&temp,&N,&M,"md.smb.runoffref"); _assert_(N==2);
-				parameters->AddObject(new TransientParam(SmbRunoffrefEnum,&temp[0],&temp[M],interp,M));
+				parameters->AddObject(new TransientParam(SmbRunoffrefEnum,&temp[0],&temp[M],interp,cycle,M));
 				iomodel->DeleteData(temp,"md.smb.runoffref");
 			break;
@@ -465,4 +477,8 @@
 			SmbGradientsElax(femmodel);
 			break;
+		case SMBautoregressionEnum:
+         if(VerboseSolution())_printf0_("    call smb autoregression module\n");
+         Smbautoregressionx(femmodel);
+         break;
 		case SMBhenningEnum:
 			if(VerboseSolution())_printf0_("  call smb Henning module\n");
@@ -497,4 +513,7 @@
 
 }/*}}}*/
+void           SmbAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
 ElementVector* SmbAnalysis::CreateDVector(Element* element){/*{{{*/
 	_error_("not implemented");
Index: /issm/trunk/src/c/analyses/SmbAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/SmbAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/SmbAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/SmoothAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/SmoothAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/SmoothAnalysis.cpp	(revision 26744)
@@ -35,4 +35,7 @@
 /*Finite Element Analysis*/
 void           SmoothAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           SmoothAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/SmoothAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/SmoothAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/SmoothAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/StressbalanceAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26744)
@@ -188,7 +188,15 @@
 		}
 		else{
-			IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,0);
-			if(iomodel->domaintype!=Domain2DverticalEnum){
-				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,1);
+			if(!isMLHO){
+				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,0);
+				if(iomodel->domaintype!=Domain2DverticalEnum){
+					IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,1);
+				}
+			}
+			else{//MLHO 
+				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx_base",StressbalanceAnalysisEnum,finiteelement,0);
+				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx_shear",StressbalanceAnalysisEnum,finiteelement,1);
+				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy_base",StressbalanceAnalysisEnum,finiteelement,2);
+				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy_shear",StressbalanceAnalysisEnum,finiteelement,3);
 			}
 		}
@@ -371,5 +379,5 @@
 				}
 				else if (IoCodeToEnumVertexEquation(reCast<int>(vertices_type[i]))==SIAApproximationEnum){
-					constraints->AddObject(new SpcDynamic(count+1,i+1,0,StressbalanceAnalysisEnum));
+					constraints->AddObject(new SpcDynamic(count+1,i+1,0,0.,StressbalanceAnalysisEnum));
 					count++;
 				}
@@ -394,5 +402,5 @@
 				}
 				else if (IoCodeToEnumVertexEquation(reCast<int>(vertices_type[i]))==SIAApproximationEnum){
-					constraints->AddObject(new SpcDynamic(count+1,i+1,1,StressbalanceAnalysisEnum));
+					constraints->AddObject(new SpcDynamic(count+1,i+1,1,0.,StressbalanceAnalysisEnum));
 					count++;
 				}
@@ -768,9 +776,25 @@
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum,0.);
 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum,0.);
+	/*MLHO*/
+	if(isMLHO){
+		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxShearEnum,0.);
+		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyShearEnum,0.);
+		/*3D MLHO also need to have VxBase and VyBase for reconstruting Vx and Vy*/
+		if (iomodel->domaintype==Domain3DEnum) {
+			iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxBaseEnum,0.);
+			iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyBaseEnum,0.);
+		}
+	}
+   if(iomodel->domaintype==Domain2DhorizontalEnum){
+		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxBaseEnum,0.);
+		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyBaseEnum,0.);
+		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxSurfaceEnum,0.);
+		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VySurfaceEnum,0.);
+	}
 	iomodel->FetchDataToInput(inputs,elements,"md.stressbalance.loadingforcex",LoadingforceXEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.stressbalance.loadingforcey",LoadingforceYEnum);
@@ -792,9 +816,15 @@
 
 		/*Add basal forcings to compute melt rate*/
+		bool isstochastic;
 		int basalforcing_model;
 		iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model");
+		iomodel->FindConstant(&isstochastic,"md.stochasticforcing.isstochasticforcing");
 		switch(basalforcing_model){
 			case FloatingMeltRateEnum:
 				iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum);
+				if(isstochastic){
+					iomodel->FetchDataToInput(inputs,elements,"md.stochasticforcing.default_id",StochasticForcingDefaultIdEnum);
+					iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BaselineBasalforcingsFloatingiceMeltingRateEnum);
+				}
 				break;
 			case LinearFloatingMeltRateEnum:
@@ -907,7 +937,13 @@
 			break;
 		case 11:
+			iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling");
 			iomodel->FetchDataToInput(inputs,elements,"md.friction.m",FrictionMEnum);
 			iomodel->FetchDataToInput(inputs,elements,"md.friction.C",FrictionCEnum);
 			iomodel->FetchDataToInput(inputs,elements,"md.friction.Cmax",FrictionCmaxEnum);
+			if(FrictionCoupling==3){
+				iomodel->FetchDataToInput(inputs,elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);}
+			else if(FrictionCoupling==4){
+				iomodel->FetchDataToInput(inputs,elements,"md.friction.effective_pressure",EffectivePressureEnum);
+			}
 			break;
 		case 12:
@@ -915,4 +951,14 @@
 			iomodel->FetchDataToInput(inputs,elements,"md.friction.C",FrictionCEnum);
 			iomodel->FetchDataToInput(inputs,elements,"md.friction.f",FrictionfEnum);
+			break;
+		case 13:
+			iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling");
+			iomodel->FetchDataToInput(inputs,elements,"md.friction.C",FrictionCEnum);
+			iomodel->FetchDataToInput(inputs,elements,"md.friction.m",FrictionMEnum);
+			if(FrictionCoupling==3){
+				iomodel->FetchDataToInput(inputs,elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);}
+			else if(FrictionCoupling==4){
+				iomodel->FetchDataToInput(inputs,elements,"md.friction.effective_pressure",EffectivePressureEnum);
+			}
 			break;
 		default:
@@ -1011,4 +1057,5 @@
 			parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
+			parameters->AddObject(new IntParam(FrictionCouplingEnum,0));
 			break;
 		case 10:
@@ -1021,9 +1068,13 @@
 			break;
 		case 11:
-			parameters->AddObject(new IntParam(FrictionCouplingEnum,2));
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
 			break;
 		case 12:
 			parameters->AddObject(new IntParam(FrictionCouplingEnum,2));
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
+			break;
+		case 13:
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
 			break;
@@ -1061,5 +1112,4 @@
 		if(solver_type==FSSolverEnum) is_schur_cg_solver = true;
 		#endif
-
 
 		if(is_schur_cg_solver)
@@ -1096,4 +1146,7 @@
 	}
 
+}/*}}}*/
+void           StressbalanceAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
 }/*}}}*/
 ElementVector* StressbalanceAnalysis::CreateDVector(Element* element){/*{{{*/
@@ -1192,6 +1245,9 @@
 			GetSolutionFromInputsFS(solution,element);
 			return;
-		case SSAApproximationEnum: case HOApproximationEnum: case L1L2ApproximationEnum: case MLHOApproximationEnum: case SIAApproximationEnum:
+		case SSAApproximationEnum: case HOApproximationEnum: case L1L2ApproximationEnum: case SIAApproximationEnum:
 			GetSolutionFromInputsHoriz(solution,element);
+			return;
+		case MLHOApproximationEnum:
+			GetSolutionFromInputsMLHO(solution,element);
 			return;
 		case SSAHOApproximationEnum: case HOFSApproximationEnum: case SSAFSApproximationEnum:
@@ -1373,5 +1429,5 @@
 
 	/*clean-up and return*/
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return Ke;
 
@@ -1411,5 +1467,5 @@
 
 	/*clean-up and return*/
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	delete Ke1;
 	delete Ke2;
@@ -1419,5 +1475,5 @@
 
 	/*Return if element is inactive*/
-	if(element->IsFloating() || !element->IsIceInElement()) return NULL;
+	if(element->IsAllFloating() || !element->IsIceInElement()) return NULL;
 
 	/*Intermediaries*/
@@ -1688,5 +1744,5 @@
 
 	/*clean-up and return*/
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	delete pe1;
 	delete pe2;
@@ -2071,6 +2127,13 @@
 
 	/*Add vx and vy as inputs to the tria element: */
+	/*Also add surface vx and vy for the misfit, and base vx and vy for friction*/
 	element->AddBasalInput(VxEnum,vx,element->GetElementType());
-	if(dim==2)element->AddBasalInput(VyEnum,vy,element->GetElementType());
+	element->AddBasalInput(VxSurfaceEnum,vx,element->GetElementType());
+	element->AddBasalInput(VxBaseEnum,vx,element->GetElementType());
+	if(dim==2) {
+		element->AddBasalInput(VyEnum,vy,element->GetElementType());
+		element->AddBasalInput(VySurfaceEnum,vy,element->GetElementType());
+		element->AddBasalInput(VyBaseEnum,vy,element->GetElementType());
+	}
 	element->AddBasalInput(VelEnum,vel,element->GetElementType());
 
@@ -2083,5 +2146,5 @@
 	xDelete<IssmDouble>(xyz_list);
 	xDelete<int>(doflist);
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 }/*}}}*/
 #ifdef DISCSLOPE
@@ -2384,10 +2447,10 @@
 ElementMatrix* StressbalanceAnalysis::CreateKMatrixL1L2Friction(Element* element){/*{{{*/
 
-	if(!element->IsOnBase() || element->IsFloating()) return NULL;
+	if(!element->IsOnBase() || element->IsAllFloating()) return NULL;
 	Element* basalelement = element->SpawnBasalElement();
 	ElementMatrix* Ke = CreateKMatrixSSAFriction(basalelement);
 
 	/*clean-up and return*/
-	basalelement->DeleteMaterials(); delete basalelement;
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	return Ke;
 }/*}}}*/
@@ -2449,5 +2512,5 @@
 	delete gauss;
 	delete gauss_base;
-	basalelement->DeleteMaterials(); delete basalelement;
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	xDelete<IssmDouble>(xyz_list);
 	xDelete<IssmDouble>(dbasis);
@@ -2482,5 +2545,5 @@
 
 	/*clean-up and return*/
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	delete pe1;
 	delete pe2;
@@ -2536,5 +2599,5 @@
 
 	/*Intermediaries*/
-	IssmDouble  Jdet,thickness,bed,sealevel,water_pressure,ice_pressure;
+	IssmDouble  Jdet,thickness,base,sealevel,water_pressure,ice_pressure;
 	IssmDouble  surface_under_water,base_under_water,pressure;
 	IssmDouble *xyz_list = NULL;
@@ -2564,11 +2627,11 @@
 	while(gauss->next()){
 		thickness_input->GetInputValue(&thickness,gauss);
-		base_input->GetInputValue(&bed,gauss);
+		base_input->GetInputValue(&base,gauss);
 		sealevel_input->GetInputValue(&sealevel,gauss);
 		element->JacobianDeterminantSurface(&Jdet,xyz_list_front,gauss);
 		element->NodalFunctions(basis,gauss);
 
-		surface_under_water = min(0.,thickness+bed-sealevel); // 0 if the top of the glacier is above water level
-		base_under_water    = min(0.,bed-sealevel);           // 0 if the bottom of the glacier is above water level
+		surface_under_water = min(0.,thickness+base-sealevel); // 0 if the top of the glacier is above water level
+		base_under_water    = min(0.,base-sealevel);           // 0 if the bottom of the glacier is above water level
 		water_pressure = 1.0/2.0*gravity*rho_water*(surface_under_water*surface_under_water - base_under_water*base_under_water);
 		ice_pressure   = 1.0/2.0*gravity*rho_ice*thickness*thickness;
@@ -2675,4 +2738,10 @@
 	element->AddBasalInput(VelEnum,vel,element->GetElementType());
 
+	/*Also add surface vx and vy for the misfit, and base vx and vy for friction*/
+	element->AddBasalInput(VxSurfaceEnum,vx,element->GetElementType());
+	element->AddBasalInput(VySurfaceEnum,vy,element->GetElementType());
+	element->AddBasalInput(VxBaseEnum,vx,element->GetElementType());
+	element->AddBasalInput(VyBaseEnum,vy,element->GetElementType());
+
 	/*Free ressources:*/
 	xDelete<IssmDouble>(vel);
@@ -2683,20 +2752,37 @@
 	xDelete<IssmDouble>(xyz_list);
 	xDelete<int>(doflist);
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 }/*}}}*/
 
 /*MLHO*/
 ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHO(Element* element){/*{{{*/
-	_error_("not implemented yet");
 
 	/* Check if ice in element */
 	if(!element->IsIceInElement()) return NULL;
 
+	/*Intermediaries*/
+	int      domaintype;
+	Element* basalelement;
+
+	/*Get basal element*/
+	element->FindParam(&domaintype,DomainTypeEnum);
+	switch(domaintype){
+		case Domain2DhorizontalEnum:
+			basalelement = element;
+			break;
+		case Domain3DEnum: 
+			if(!element->IsOnBase()) return NULL;
+			basalelement = element->SpawnBasalElement(true);
+			break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+
 	/*compute all stiffness matrices for this element*/
-	ElementMatrix* Ke1=CreateKMatrixMLHOViscous(element);
-	ElementMatrix* Ke2=CreateKMatrixMLHOFriction(element);
+	ElementMatrix* Ke1=CreateKMatrixMLHOViscous(basalelement);
+	ElementMatrix* Ke2=CreateKMatrixMLHOFriction(basalelement);
 	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
 
 	/*clean-up and return*/
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	delete Ke1;
 	delete Ke2;
@@ -2704,79 +2790,200 @@
 }/*}}}*/
 ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHOFriction(Element* element){/*{{{*/
-	_error_("not implemented yet");
-
-	if(!element->IsOnBase() || element->IsFloating()) return NULL;
-	Element* basalelement = element->SpawnBasalElement();
-	ElementMatrix* Ke = CreateKMatrixSSAFriction(basalelement);
-
-	/*clean-up and return*/
-	basalelement->DeleteMaterials(); delete basalelement;
-	return Ke;
-}/*}}}*/
-ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHOViscous(Element* element){/*{{{*/
-	_error_("not implemented yet");
+
+	if(element->IsAllFloating()) return NULL;
 
 	/*Intermediaries*/
-	IssmDouble  viscosity,Jdet;
-	IssmDouble *xyz_list = NULL;
-
-	/*Get element on base*/
-	Element* basalelement = element->GetBasalElement()->SpawnBasalElement(true);
+	int         dim,domaintype;
+	bool        mainlyfloating;
+	int         friction_style,point1;
+	IssmDouble  alpha2,Jdet,fraction1,fraction2;
+	IssmDouble  gllevelset,phi=1.;
+	IssmDouble *xyz_list  = NULL;
+	Gauss*      gauss     = NULL;
+
+	/*Get problem dimension*/
+	element->FindParam(&domaintype,DomainTypeEnum);
+	switch(domaintype){
+		case Domain2DverticalEnum:   dim = 1;break;
+		case Domain2DhorizontalEnum: dim = 2;break;
+		case Domain3DEnum:           dim = 2;break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
 
 	/*Fetch number of nodes and dof for this finite element*/
-	int numnodes = basalelement->GetNumberOfNodes();
+	int numnodes = element->GetNumberOfNodes();
+	int numdof   = numnodes*dim;
 
 	/*Initialize Element matrix and vectors*/
-	ElementMatrix* Ke     = basalelement->NewElementMatrix(MLHOApproximationEnum);
-	IssmDouble*    dbasis = xNew<IssmDouble>(3*numnodes);
+	ElementMatrix* Ke = element->NewElementMatrix(MLHOApproximationEnum);
+	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
 
 	/*Retrieve all inputs and parameters*/
 	element->GetVerticesCoordinates(&xyz_list);
-	Input* surface_input = element->GetInput(SurfaceEnum); _assert_(surface_input);
-	Input* vx_input      = element->GetInput(VxEnum);      _assert_(vx_input);
-	Input* vy_input      = element->GetInput(VyEnum);      _assert_(vy_input);
+	element->FindParam(&friction_style,GroundinglineFrictionInterpolationEnum);
+	Input* surface_input    = element->GetInput(SurfaceEnum); _assert_(surface_input);
+	Input* gllevelset_input = NULL;
+
+	/*build friction object, used later on: */
+	Friction* friction=new Friction(element, dim);
+
+	/*Recover portion of element that is grounded*/
+	if(!(friction_style==SubelementFriction2Enum)) phi=element->GetGroundedPortion(xyz_list);
+	if(friction_style==SubelementFriction2Enum){
+		gllevelset_input=element->GetInput(MaskOceanLevelsetEnum); _assert_(gllevelset_input);
+		element->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
+	   gauss = element->NewGauss(point1,fraction1,fraction2,mainlyfloating,2);
+	}
+	else{
+		gauss = element->NewGauss(2);
+	}
 
 	/* Start  looping on the number of gaussian points: */
-	Gauss* gauss      = element->NewGauss(5);
-	Gauss* gauss_base = basalelement->NewGauss();
 	while(gauss->next()){
-		gauss->SynchronizeGaussBase(gauss_base);
-
-		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
-		basalelement->NodalFunctionsDerivatives(dbasis,xyz_list,gauss_base);
-
-		element->material->ViscosityL1L2(&viscosity,xyz_list,gauss,vx_input,vy_input,surface_input);
+
+		friction->GetAlpha2(&alpha2,gauss);
+		if(friction_style==SubelementFriction1Enum) alpha2=phi*alpha2;
+		else if(friction_style==SubelementFriction2Enum){
+			gllevelset_input->GetInputValue(&gllevelset, gauss);
+			if(gllevelset<0.) alpha2=0.;
+		}
+		else if(friction_style==NoFrictionOnPartiallyFloatingEnum){
+			if (phi<0.99999999) alpha2=0.;
+		}
+		else  _error_("friction interpolation "<<EnumToStringx(friction_style)<<" not implemented yet");
+
+		element->NodalFunctions(basis,gauss);
+		element->JacobianDeterminant(&Jdet, xyz_list,gauss);
 
 		for(int i=0;i<numnodes;i++){
 			for(int j=0;j<numnodes;j++){
-				Ke->values[2*i*2*numnodes+2*j] += gauss->weight*Jdet*viscosity*(
-							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
-							);
-				Ke->values[2*i*2*numnodes+2*j+1] += gauss->weight*Jdet*viscosity*(
-							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
-							);
-				Ke->values[(2*i+1)*2*numnodes+2*j] += gauss->weight*Jdet*viscosity*(
-							2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
-							);
-				Ke->values[(2*i+1)*2*numnodes+2*j+1] += gauss->weight*Jdet*viscosity*(
-							dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + 4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
-							);
+				Ke->values[(4*i+0)*2*2*numnodes+4*j+0] += alpha2*gauss->weight*Jdet*basis[i]*basis[j];
+				Ke->values[(4*i+2)*2*2*numnodes+4*j+2] += alpha2*gauss->weight*Jdet*basis[i]*basis[j];
 			}
 		}
 	}
-
-	/*Transform Coordinate System*/
-	basalelement->TransformStiffnessMatrixCoord(Ke,XYEnum);
 
 	/*Clean up and return*/
 	delete gauss;
-	delete gauss_base;
-	basalelement->DeleteMaterials(); delete basalelement;
+	delete friction;
+	xDelete<IssmDouble>(xyz_list);
+	xDelete<IssmDouble>(basis);
+	return Ke;
+}/*}}}*/
+ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHOViscous(Element* element){/*{{{*/
+
+	/* Check if ice in element */
+	if(!element->IsIceInElement()) return NULL;
+
+	/*Intermediaries*/
+	IssmDouble  viscosity[4],Jdet,thickness,n;
+	IssmDouble *xyz_list = NULL;
+	int      domaintype;
+	int dim=2;
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numnodes = element->GetNumberOfNodes();
+
+	/*Initialize Element matrix and vectors*/
+	ElementMatrix* Ke     = element->NewElementMatrix(MLHOApproximationEnum);
+	IssmDouble*    dbasis = xNew<IssmDouble>(2*numnodes); // like SSA
+	IssmDouble*    basis  = xNew<IssmDouble>(numnodes); // like SSA
+
+	/*Retrieve all inputs and parameters*/
+	element->GetVerticesCoordinates(&xyz_list);
+	Input* thickness_input= element->GetInput(ThicknessEnum); _assert_(thickness_input);
+	Input* surface_input  = element->GetInput(SurfaceEnum);   _assert_(surface_input);
+	Input* vxbase_input   = element->GetInput(VxBaseEnum);    _assert_(vxbase_input); 
+	Input* vybase_input   = element->GetInput(VyBaseEnum);    _assert_(vybase_input);
+	Input* vxshear_input  = element->GetInput(VxShearEnum);   _assert_(vxshear_input); //shear vx at the surface 
+	Input* vyshear_input  = element->GetInput(VyShearEnum);   _assert_(vyshear_input); //shear vy at the surface
+	Input* n_input			 = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss      = element->NewGauss(2);
+	while(gauss->next()){
+
+		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+		element->NodalFunctions(basis, gauss);
+
+		thickness_input->GetInputValue(&thickness, gauss);
+		n_input->GetInputValue(&n,gauss);
+		element->material->ViscosityMLHO(&viscosity[0],dim,xyz_list,gauss,vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input);
+
+		for(int i=0;i<numnodes;i++){//shape functions on tria element
+			for(int j=0;j<numnodes;j++){
+				Ke->values[(4*i+0)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity[0]*thickness*(
+							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+							);//K11
+				Ke->values[(4*i+0)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity[1]*thickness*(
+							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+							)*(n+1)/(n+2);//K12
+				Ke->values[(4*i+0)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity[0]*thickness*(
+							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+							);//K13
+				Ke->values[ (4*i+0)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity[1]*thickness*(
+                     2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+                     )*(n+1)/(n+2);//K14
+
+				Ke->values[(4*i+1)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity[1]*thickness*(
+							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+							)*(n+1)/(n+2);//K21
+				Ke->values[(4*i+1)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity[2]*thickness*(
+							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+							)*2*pow(n+1,2)/((2*n+3)*(n+2)) 
+							+ 
+							gauss->weight*Jdet*viscosity[3]*basis[j]*basis[i]*pow(n+1,2)/(thickness*(2*n+1))
+							;//K22
+				Ke->values[(4*i+1)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity[1]*thickness*(
+							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+							)*(n+1)/(n+2);//K23
+				Ke->values[(4*i+1)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity[2]*thickness*(
+							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+							)*2*pow(n+1,2)/((2*n+3)*(n+2));//K24
+
+				Ke->values[(4*i+2)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity[0]*thickness*(
+							2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+							);//K31
+				Ke->values[(4*i+2)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity[1]*thickness*(
+							2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+							)*(n+1)/(n+2);//K32
+				Ke->values[(4*i+2)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity[0]*thickness*(
+							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+							);//K33
+				Ke->values[(4*i+2)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity[1]*thickness*(
+							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+							)*(n+1)/(n+2);//K34
+
+				Ke->values[(4*i+3)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity[1]*thickness*(
+                     2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+                     )*(n+1)/(n+2);//K41
+				Ke->values[(4*i+3)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity[2]*thickness*(
+                     2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+                     )*2*pow(n+1,2)/((2*n+3)*(n+2));//K42
+				Ke->values[(4*i+3)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity[1]*thickness*(
+							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+							)*(n+1)/(n+2);//K43
+				Ke->values[(4*i+3)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity[2]*thickness*(
+							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+							)*2*pow(n+1,2)/((2*n+3)*(n+2))
+							+ 
+							gauss->weight*Jdet*viscosity[3]*basis[j]*basis[i]*pow(n+1,2)/(thickness*(2*n+1))
+							;//K44
+			}
+		}
+	}
+
+	/*Transform Coordinate System*/
+	//basalelement->TransformStiffnessMatrixCoord(Ke,XYMLHOEnum);
+
+	/*Clean up and return*/
+	delete gauss;
 	xDelete<IssmDouble>(xyz_list);
 	xDelete<IssmDouble>(dbasis);
+	xDelete<IssmDouble>(basis);
 	return Ke;
 }/*}}}*/
 ElementVector* StressbalanceAnalysis::CreatePVectorMLHO(Element* element){/*{{{*/
-	_error_("not implemented yet");
 
 	/* Check if ice in element */
@@ -2806,5 +3013,5 @@
 
 	/*clean-up and return*/
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	delete pe1;
 	delete pe2;
@@ -2812,8 +3019,7 @@
 }/*}}}*/
 ElementVector* StressbalanceAnalysis::CreatePVectorMLHODrivingStress(Element* element){/*{{{*/
-	_error_("not implemented yet");
 
 	/*Intermediaries */
-	IssmDouble  thickness,Jdet,slope[2];
+	IssmDouble  thickness,Jdet,slope[2],n;
 	IssmDouble* xyz_list = NULL;
 
@@ -2829,4 +3035,5 @@
 	Input*     thickness_input=element->GetInput(ThicknessEnum); _assert_(thickness_input);
 	Input*     surface_input  =element->GetInput(SurfaceEnum);   _assert_(surface_input);
+	Input*     n_input        =element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
 	IssmDouble rhog = element->FindParam(MaterialsRhoIceEnum)*element->FindParam(ConstantsGEnum);
 
@@ -2839,13 +3046,16 @@
 		thickness_input->GetInputValue(&thickness,gauss);
 		surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
-
-		for(int i=0;i<numnodes;i++){
-			pe->values[i*2+0]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i];
-			pe->values[i*2+1]+=-rhog*thickness*slope[1]*Jdet*gauss->weight*basis[i];
+		n_input->GetInputValue(&n,gauss);
+
+		for(int i=0;i<numnodes;i++){// per node: vx (basal vx), vshx, vy (basal vy), vshy
+			pe->values[i*4+0]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]; //F1
+			pe->values[i*4+1]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]*(n+1)/(n+2); //F2
+			pe->values[i*4+2]+=-rhog*thickness*slope[1]*Jdet*gauss->weight*basis[i]; //F3
+			pe->values[i*4+3]+=-rhog*thickness*slope[1]*Jdet*gauss->weight*basis[i]*(n+1)/(n+2); //F4
 		}
 	}
 
 	/*Transform coordinate system*/
-	element->TransformLoadVectorCoord(pe,XYEnum);
+	//element->TransformLoadVectorCoord(pe,XYMLHOEnum);
 
 	/*Clean up and return*/
@@ -2856,5 +3066,4 @@
 }/*}}}*/
 ElementVector* StressbalanceAnalysis::CreatePVectorMLHOFront(Element* element){/*{{{*/
-	_error_("not implemented yet");
 
 	/*If no front, return NULL*/
@@ -2862,6 +3071,6 @@
 
 	/*Intermediaries*/
-	IssmDouble  Jdet,thickness,bed,sealevel,water_pressure,ice_pressure;
-	IssmDouble  surface_under_water,base_under_water,pressure;
+	IssmDouble  Jdet,thickness,base,sealevel,water_pressure,ice_pressure;
+	IssmDouble  water_pressure_sh,ice_pressure_sh,pressure_sh,pressure,n,s,b;
 	IssmDouble *xyz_list = NULL;
 	IssmDouble *xyz_list_front = NULL;
@@ -2877,6 +3086,7 @@
 	/*Retrieve all inputs and parameters*/
 	Input* thickness_input = element->GetInput(ThicknessEnum); _assert_(thickness_input);
-	Input* base_input       = element->GetInput(BaseEnum);       _assert_(base_input);
-	Input* sealevel_input       = element->GetInput(SealevelEnum);       _assert_(sealevel_input);
+	Input* base_input      = element->GetInput(BaseEnum);       _assert_(base_input);
+	Input* sealevel_input  = element->GetInput(SealevelEnum);       _assert_(sealevel_input);
+	Input* n_input         = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
 	IssmDouble rho_water   = element->FindParam(MaterialsRhoSeawaterEnum);
 	IssmDouble rho_ice     = element->FindParam(MaterialsRhoIceEnum);
@@ -2890,23 +3100,35 @@
 	while(gauss->next()){
 		thickness_input->GetInputValue(&thickness,gauss);
-		base_input->GetInputValue(&bed,gauss);
+		base_input->GetInputValue(&base,gauss);
+		n_input->GetInputValue(&n,gauss);
 		sealevel_input->GetInputValue(&sealevel,gauss);
 		element->JacobianDeterminantSurface(&Jdet,xyz_list_front,gauss);
 		element->NodalFunctions(basis,gauss);
 
-		surface_under_water = min(0.,thickness+bed-sealevel); // 0 if the top of the glacier is above water level
-		base_under_water    = min(0.,bed-sealevel);           // 0 if the bottom of the glacier is above water level
-		water_pressure = 1.0/2.0*gravity*rho_water*(surface_under_water*surface_under_water - base_under_water*base_under_water);
-		ice_pressure   = 1.0/2.0*gravity*rho_ice*thickness*thickness;
+		b = base-sealevel; // ice base shifted by the sea level
+		s = thickness+b;   // ice surface shifted by the sea level
+		/*Vertically integrated pressure - SSA type*/
+		water_pressure = -(1.0/2.0)*gravity*rho_water*(b*b);
+		ice_pressure   =  (1.0/2.0)*gravity*rho_ice*thickness*thickness;
 		pressure = ice_pressure + water_pressure;
+		/*Vertically integrated pressure - HO type*/
+		water_pressure_sh = gravity*rho_water*( -b*b/2 - (s*thickness/(n+2))*(1-pow(s/thickness,n+2)) + (thickness*thickness/(n+3))*(1-pow(s/thickness,n+3)) );
+		ice_pressure_sh   = gravity*rho_ice*thickness*thickness*(n+1)/(2*(n+3));
+		pressure_sh = ice_pressure_sh + water_pressure_sh;
+		if (b>0) {
+			pressure = ice_pressure;
+			pressure_sh = ice_pressure_sh;
+		}
 
 		for (int i=0;i<numnodes;i++){
-			pe->values[2*i+0]+= pressure*Jdet*gauss->weight*normal[0]*basis[i];
-			pe->values[2*i+1]+= pressure*Jdet*gauss->weight*normal[1]*basis[i];
+			pe->values[i*4+0]+= pressure*Jdet*gauss->weight*normal[0]*basis[i]; // F1
+			pe->values[i*4+1]+= pressure_sh*Jdet*gauss->weight*normal[0]*basis[i]; // F2
+			pe->values[i*4+2]+= pressure*Jdet*gauss->weight*normal[1]*basis[i]; // F3
+			pe->values[i*4+3]+= pressure_sh*Jdet*gauss->weight*normal[1]*basis[i]; // F4
 		}
 	}
 
 	/*Transform coordinate system*/
-	element->TransformLoadVectorCoord(pe,XYEnum);
+	//element->TransformLoadVectorCoord(pe,XYMLHOEnum);
 
 	/*Clean up and return*/
@@ -2919,6 +3141,4 @@
 void           StressbalanceAnalysis::InputUpdateFromSolutionMLHO(IssmDouble* solution,Element* element){/*{{{*/
 
-	_error_("not implemented yet");
-
 	int         i,dim,domaintype;
 	IssmDouble  rho_ice,g;
@@ -2933,16 +3153,20 @@
 	IssmDouble* surface   = xNew<IssmDouble>(numvertices);
 
-	element->FindParam(&dim,DomainDimensionEnum);
 	element->FindParam(&domaintype,DomainTypeEnum);
 	rho_ice =element->FindParam(MaterialsRhoIceEnum);
 	g       =element->FindParam(ConstantsGEnum);
-	if(dim==2){
-		element->GetInputListOnVertices(thickness,ThicknessEnum);
-		for(i=0;i<numvertices;i++) pressure[i]=rho_ice*g*thickness[i];
-	}
-	else{
-		element->GetVerticesCoordinates(&xyz_list);
-		element->GetInputListOnVertices(surface,SurfaceEnum);
-		for(i=0;i<numvertices;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i*3+2]);
+	switch(domaintype){
+		case Domain2DhorizontalEnum:
+			element->GetInputListOnVertices(thickness,ThicknessEnum);
+			for(i=0;i<numvertices;i++) pressure[i]=rho_ice*g*thickness[i];
+			dim=2;
+			break;
+		case Domain3DEnum:
+			element->GetVerticesCoordinates(&xyz_list);
+			element->GetInputListOnVertices(surface,SurfaceEnum);
+			for(i=0;i<numvertices;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i*3+2]);
+			dim=2;
+			break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
 	}
 	element->AddInput(PressureEnum,pressure,P1Enum);
@@ -2965,13 +3189,22 @@
 	/*Fetch number of nodes and dof for this finite element*/
 	int numnodes = basalelement->GetNumberOfNodes();
-	int numdof   = numnodes*2;
+	int numdof   = numnodes*dim*2; //2xdim DOFs per node
 
 	/*Fetch dof list and allocate solution vectors*/
-	basalelement->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+	basalelement->GetDofListLocal(&doflist,MLHOApproximationEnum,GsetEnum); 
 	IssmDouble* values    = xNew<IssmDouble>(numdof);
+	IssmDouble* vbx       = xNew<IssmDouble>(numnodes);
+	IssmDouble* vby       = xNew<IssmDouble>(numnodes);
+   IssmDouble* vshx      = xNew<IssmDouble>(numnodes); 
+   IssmDouble* vshy      = xNew<IssmDouble>(numnodes);
+	IssmDouble* vsx       = xNew<IssmDouble>(numnodes);
+	IssmDouble* vsy       = xNew<IssmDouble>(numnodes);
 	IssmDouble* vx        = xNew<IssmDouble>(numnodes);
 	IssmDouble* vy        = xNew<IssmDouble>(numnodes);
 	IssmDouble* vz        = xNew<IssmDouble>(numnodes);
 	IssmDouble* vel       = xNew<IssmDouble>(numnodes);
+	IssmDouble* n			 = xNew<IssmDouble>(numnodes);
+	IssmDouble* H			 = xNew<IssmDouble>(numnodes);
+	IssmDouble* s			 = xNew<IssmDouble>(numnodes);
 
 	/*Use the dof list to index into the solution vector: */
@@ -2979,37 +3212,134 @@
 
 	/*Transform solution in Cartesian Space*/
-	basalelement->TransformSolutionCoord(&values[0],XYEnum);
-	basalelement->FindParam(&domaintype,DomainTypeEnum);
-
-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
-	for(i=0;i<numnodes;i++){
-		vx[i]=values[i*2+0];
-		vy[i]=values[i*2+1];
-
-		/*Check solution*/
-		if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector");
-		if(xIsInf<IssmDouble>(vx[i])) _error_("Inf found in solution vector");
-		if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector");
-		if(xIsInf<IssmDouble>(vy[i])) _error_("Inf found in solution vector");
-	}
-
-	/*Get Vz and compute vel*/
-	basalelement->GetInputListOnNodes(&vz[0],VzEnum,0.);
-	for(i=0;i<numnodes;i++) vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i] + vz[i]*vz[i]);
-
-	/*Add vx and vy as inputs to the tria element: */
-	element->AddBasalInput(VxEnum,vx,element->GetElementType());
-	element->AddBasalInput(VyEnum,vy,element->GetElementType());
-	element->AddBasalInput(VelEnum,vel,element->GetElementType());
+	if(dim==2) basalelement->TransformSolutionCoord(&values[0],XYEnum);
+
+   /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+   for(i=0;i<numnodes;i++){ //numnodes of the 2D mesh in which the MLHO is written
+      vbx[i] =values[i*4+0]; //base vx
+      vshx[i]=values[i*4+1]; //shear vx
+		vsx[i] =vbx[i]+vshx[i]; //surface vx
+		if(xIsNan<IssmDouble>(vbx[i]))	_error_("NaN found in solution vector");
+      if(xIsInf<IssmDouble>(vbx[i]))	_error_("Inf found in solution vector");
+		if(xIsNan<IssmDouble>(vshx[i]))	_error_("NaN found in solution vector");
+      if(xIsInf<IssmDouble>(vshx[i]))	_error_("Inf found in solution vector");
+		vby[i] =values[i*4+2]; //base vy
+		vshy[i]=values[i*4+3]; //shear vy
+		vsy[i] =vby[i]+vshy[i]; //surface vy
+		if(xIsNan<IssmDouble>(vby[i]))	_error_("NaN found in solution vector");
+		if(xIsInf<IssmDouble>(vby[i]))	_error_("Inf found in solution vector");
+		if(xIsNan<IssmDouble>(vshy[i]))	_error_("NaN found in solution vector");
+		if(xIsInf<IssmDouble>(vshy[i]))	_error_("Inf found in solution vector");
+	}
+
+	/*Add vx and vy as inputs to the tria element (shear velocities): */
+	element->AddBasalInput(VxShearEnum,vshx,element->GetElementType());
+	element->AddBasalInput(VyShearEnum,vshy,element->GetElementType());
+
+	/*Add vx and vy as inputs to the tria element (base velocities): */
+	element->AddBasalInput(VxBaseEnum,vbx,element->GetElementType());
+	element->AddBasalInput(VyBaseEnum,vby,element->GetElementType());
+
+	/*Add vx and vy as inputs to the tria element (surface velocities): */
+	element->AddBasalInput(VxSurfaceEnum,vsx,element->GetElementType());
+	element->AddBasalInput(VySurfaceEnum,vsy,element->GetElementType());
+
+	/*Compute the vertically averaged velocities on each node*/
+	basalelement->GetInputListOnNodes(&n[0],MaterialsRheologyNEnum,0.); 
+
+	/* Reconstruct vx, vy and vz solutions for 3D problem
+	 * Add vx and vy as inputs to the tria element (vertically averaged velocities): */
+
+   switch(domaintype){
+      case Domain2DhorizontalEnum:
+			for(i=0;i<numnodes;i++){ //numnodes of the 2D mesh in which the MLHO is written
+				vx[i]=vbx[i]+vshx[i]*(n[i]+1)/(n[i]+2);
+				vy[i]=vby[i]+vshy[i]*(n[i]+1)/(n[i]+2);
+				vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i]); 
+			}
+			element->AddBasalInput(VxEnum,vx,element->GetElementType());
+			element->AddBasalInput(VyEnum,vy,element->GetElementType());
+			element->AddBasalInput(VelEnum,vel,element->GetElementType()); 
+         break;
+      case Domain3DEnum:
+		   basalelement->GetInputListOnNodes(&H[0],ThicknessEnum,0.);
+		   basalelement->GetInputListOnNodes(&s[0],SurfaceEnum,0.);
+			element->Recover3DMLHOInput(VxEnum, numnodes, vbx, vshx, n, H, s);
+			element->Recover3DMLHOInput(VyEnum, numnodes, vby, vshy, n, H, s);
+			break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
 
 	/*Free ressources:*/
 	xDelete<IssmDouble>(vel);
+	xDelete<IssmDouble>(vx);
+	xDelete<IssmDouble>(vy);
 	xDelete<IssmDouble>(vz);
-	xDelete<IssmDouble>(vy);
-	xDelete<IssmDouble>(vx);
+	xDelete<IssmDouble>(vby);
+	xDelete<IssmDouble>(vbx);
+	xDelete<IssmDouble>(vsy);
+	xDelete<IssmDouble>(vsx);
+	xDelete<IssmDouble>(vshy);
+	xDelete<IssmDouble>(vshx);
 	xDelete<IssmDouble>(values);
 	xDelete<IssmDouble>(xyz_list);
+	xDelete<IssmDouble>(n);
+	xDelete<IssmDouble>(s);
+	xDelete<IssmDouble>(H);
 	xDelete<int>(doflist);
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+}/*}}}*/
+void           StressbalanceAnalysis::GetSolutionFromInputsMLHO(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+
+	IssmDouble   vbx,vby,vshx,vshy;
+	int          domaintype,dim,approximation,dofpernode;
+	int*         doflist = NULL;
+
+	/*Get some parameters*/
+	element->FindParam(&domaintype,DomainTypeEnum);
+	switch(domaintype){
+		case Domain2DhorizontalEnum: dim = 2; dofpernode = 4; break;
+		case Domain3DEnum: dim = 2; dofpernode = 4; break;
+		case Domain2DverticalEnum: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet"); break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numnodes = element->GetNumberOfNodes();
+	int numdof   = numnodes*dofpernode;
+	element->GetInputValue(&approximation,ApproximationEnum);
+	if(approximation!=MLHOApproximationEnum) _error_("mesh "<<EnumToStringx(approximation)<<" not supported here");
+
+	/*Fetch dof list and allocate solution vector*/
+	element->GetDofList(&doflist,approximation,GsetEnum); 
+	IssmDouble* values = xNew<IssmDouble>(numdof);
+
+	/*Get inputs*/
+	Input* vxbase_input	=element->GetInput(VxBaseEnum);	_assert_(vxbase_input);
+	Input* vxshear_input	=element->GetInput(VxShearEnum);	_assert_(vxshear_input);
+	Input* vybase_input	=element->GetInput(VyBaseEnum);	_assert_(vybase_input);
+	Input* vyshear_input	=element->GetInput(VyShearEnum);	_assert_(vyshear_input);
+
+	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+	Gauss* gauss=element->NewGauss();
+	for(int i=0;i<numnodes;i++){
+		gauss->GaussNode(element->FiniteElement(),i);
+
+		/*Recover vx and vy*/
+		vxbase_input->GetInputValue(&vbx,gauss);	//base vx
+		vxshear_input->GetInputValue(&vshx,gauss);//shear vx
+		values[i*dofpernode+0]=vbx;  //base vx
+		values[i*dofpernode+1]=vshx; //shear vx
+		vybase_input->GetInputValue(&vby,gauss);	//base vy
+		vyshear_input->GetInputValue(&vshy,gauss);//shear vy
+		values[i*dofpernode+2]=vby; //base vy
+		values[i*dofpernode+3]=vshy;//shear vy  
+	}
+
+	solution->SetValues(numdof,doflist,values,INS_VAL);
+
+	/*Free ressources:*/
+	delete gauss;
+	xDelete<IssmDouble>(values);
+	xDelete<int>(doflist);
 }/*}}}*/
 
@@ -3095,5 +3425,5 @@
 	if(!element->IsIceInElement()) return NULL;
 
-	if(element->IsFloating() || !element->IsOnBase()) return NULL;
+	if(element->IsAllFloating() || !element->IsOnBase()) return NULL;
 
 	/*Intermediaries*/
@@ -3123,5 +3453,6 @@
 
 	/*build friction object, used later on: */
-	Friction* friction=new Friction(element,dim==3?2:1);
+	/*dim=4 is special for HO, which is actually 2.5D*/
+	Friction* friction=new Friction(element,dim==3?2.5:1);
 
 	/*Recover portion of element that is grounded*/
@@ -3816,5 +4147,5 @@
 ElementMatrix* StressbalanceAnalysis::CreateKMatrixFSShelf(Element* element){/*{{{*/
 
-	if(!element->IsFloating() || !element->IsOnBase()) return NULL;
+	if(!element->IsAllFloating() || !element->IsOnBase()) return NULL;
 
 	/*If on not water or not FS, skip stiffness: */
@@ -4040,5 +4371,4 @@
 	if(dim==3){vz_input=element->GetInput(VzEnum); _assert_(vz_input);}
 
-
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss = element->NewGauss(5);
@@ -4048,5 +4378,4 @@
 		element->NodalFunctionsPressure(pbasis,gauss);
 		element->material->ViscosityFS(&viscosity,dim,xyz_list,gauss,vx_input,vy_input,vz_input);
-
 
 		if(dim==3 || dim==2){
@@ -4139,8 +4468,7 @@
 		mk = 1.0 /3.0;
 		element->ElementSizes(&hx,&hy,&hz);
-		hk = max(max(hx, hy), hz);
-		// if(!element->IsOnDirichletBoundary()) {
-			Tau = - mk * hk * hk * 0.125 / viscosity;
-
+		// hk = max(max(hx, hy), hz);
+		hk = max(hx, hy);
+		Tau = - mk * hk * hk * 0.125 / viscosity;
 
 		for (int q=0;q<dim;q++){
@@ -4148,5 +4476,5 @@
 			for (int p=0;p<dim;p++){
 				for(int i=0;i<vnumnodes;i++){
-					SU[q*vnumnodes*(dim+1)+i*dim+p] = (-gradViscos[p])*vdbasis[q*vnumnodes+i];
+					SU[q*numdof+i*dim+p] = (-gradViscos[p])*vdbasis[q*vnumnodes+i];
 				}
 			}
@@ -4154,10 +4482,10 @@
 			for(int i=0;i<vnumnodes;i++){
 				for (int p=0;p<dim;p++){
-					SU[q*vnumnodes*(dim+1)+i*dim+q] += (-gradViscos[p])*vdbasis[p*vnumnodes+i];
+					SU[q*numdof+i*dim+q] += (-gradViscos[p])*vdbasis[p*vnumnodes+i];
 				}
 			}
 			/* column 4 for the pressure */
-			for(int i=0;i<vnumnodes;i++){
-					SU[q*vnumnodes*(dim+1)+dim*vnumnodes+i] = FSreconditioning*vdbasis[q*vnumnodes+i];
+			for(int i=0;i<pnumnodes;i++){
+					SU[q*numdof+dim*vnumnodes+i] = FSreconditioning*vdbasis[q*vnumnodes+i];
 			}
 		}
@@ -4225,4 +4553,5 @@
 	int vnumnodes = element->NumberofNodesVelocity();
 	int pnumnodes = element->NumberofNodesPressure();
+	int numdof    = vnumnodes*dim + pnumnodes;
 
 	/*Prepare coordinate system list*/
@@ -4290,11 +4619,7 @@
 		mk = 1.0 /3.0;
 		element->ElementSizes(&hx,&hy,&hz);
-		hk = max(max(hx, hy), hz);
-		// if(!element->IsOnDirichletBoundary()) {
-			Tau = - mk * hk * hk * 0.125 / viscosity;
-		// }
-		// else {
-		// 	Tau = 0.0;
-		// }
+		// hk = max(max(hx, hy), hz);
+		hk = max(hx, hy);
+		Tau = - mk * hk * hk * 0.125 / viscosity;
 
 		for (int q=0;q<dim;q++){
@@ -4302,5 +4627,5 @@
 			for (int p=0;p<dim;p++){
 				for(int i=0;i<vnumnodes;i++){
-					SU[q*vnumnodes*(dim+1)+i*dim+p] = (-gradViscos[p])*vdbasis[q*vnumnodes+i];
+					SU[q*numdof+i*dim+p] = (-gradViscos[p])*vdbasis[q*vnumnodes+i];
 				}
 			}
@@ -4308,13 +4633,12 @@
 			for(int i=0;i<vnumnodes;i++){
 				for (int p=0;p<dim;p++){
-					SU[q*vnumnodes*(dim+1)+i*dim+q] += (-gradViscos[p])*vdbasis[p*vnumnodes+i];
+					SU[q*numdof+i*dim+q] += (-gradViscos[p])*vdbasis[p*vnumnodes+i];
 				}
 			}
 			/* column 4 for the pressure */
-			for(int i=0;i<vnumnodes;i++){
-					SU[q*vnumnodes*(dim+1)+dim*vnumnodes+i] = FSreconditioning*vdbasis[q*vnumnodes+i];
+			for(int i=0;i<pnumnodes;i++){
+					SU[q*numdof+dim*vnumnodes+i] = FSreconditioning*vdbasis[q*vnumnodes+i];
 			}
 		}
-
 		for(i=0;i<vnumnodes;i++){
 			pe->values[i*dim+0] += +rho_ice*forcex *Jdet*gauss->weight*vbasis[i];
@@ -4325,6 +4649,6 @@
 		}
 
-		for(int i=0;i<vnumnodes*(dim+1);i++){
-			pe->values[i] += Tau*Jdet*gauss->weight*rho_ice*(-gravity)*SU[(dim-1)*(dim+1)*vnumnodes+i];
+		for(int i=0;i<numdof;i++){
+			pe->values[i] += Tau*Jdet*gauss->weight*rho_ice*(-gravity)*SU[(dim-1)*numdof+i];
 		}
 	}
@@ -4541,5 +4865,5 @@
 ElementMatrix* StressbalanceAnalysis::CreateKMatrixFSFriction(Element* element){/*{{{*/
 
-	if(element->IsFloating() || !element->IsOnBase()) return NULL;
+	if(element->IsAllFloating() || !element->IsOnBase()) return NULL;
 
 	/*If on water or not FS, skip stiffness: */
@@ -4813,5 +5137,5 @@
 ElementMatrix* StressbalanceAnalysis::CreateKMatrixFSFriction(Element* element){/*{{{*/
 
-	if(element->IsFloating() || !element->IsOnBase()) return NULL;
+	if(element->IsAllFloating() || !element->IsOnBase()) return NULL;
 
 	/*If on water or not FS, skip stiffness: */
@@ -5033,5 +5357,5 @@
 ElementMatrix* StressbalanceAnalysis::CreateKMatrixFSFrictionNitsche(Element* element){/*{{{*/
 
-	if(element->IsFloating() || !element->IsOnBase()) return NULL;
+	if(element->IsAllFloating() || !element->IsOnBase()) return NULL;
 
 	/*If on water or not FS, skip stiffness: */
@@ -5052,5 +5376,4 @@
 	/*coefficient of Nitsche's method*/
 	IssmDouble gamma, hx, hy, hz;
-	IssmDouble pnu, qnv;
 
 	/*Get problem dimension*/
@@ -5069,7 +5392,4 @@
 	IssmDouble* vdbasis = xNew<IssmDouble>(dim*vnumnodes);
 	IssmDouble* pbasis  = xNew<IssmDouble>(pnumnodes);
-	IssmDouble* vdbasisn = xNew<IssmDouble>(vnumnodes);
-	IssmDouble* nsigma = xNew<IssmDouble>(numdof);
-	IssmDouble  bed_normal[3], bed_tangent[6];
 
 	/*Prepare coordinate system list*/
@@ -5104,6 +5424,4 @@
 	}
 
-	element->NormalBase(&bed_normal[0],xyz_list_base);
-	element->TangentBase(&bed_tangent[0], &bed_normal[0]);
 	element->ElementSizes(&hx,&hy,&hz);
 	element->FindParam(&gamma,FeFSNitscheGammaEnum);
@@ -5131,24 +5449,12 @@
 		element->material->ViscosityFS(&viscosity,dim,xyz_list,gauss,vx_input,vy_input,vz_input);
 
-		/*Frictions*/
 		for(int i=0;i<vnumnodes;i++){
 			for(int j=0;j<vnumnodes;j++){
-				for (int d=0; d<2; d++) {
-					for (int p=0; p<dim; p++) {
-						for (int q=0; q<dim; q++) {
-							Ke->values[(dim*i+p)*numdof+dim*j+q] += alpha2*gauss->weight*Jdet*vbasis[i]*vbasis[j]*bed_tangent[d*3+p]*bed_tangent[d*3+q];
-						}
-					}
+				for (int d=0; d<dim; d++) {
+						Ke->values[(dim*i+d)*numdof+dim*j+d] += alpha2*gauss->weight*Jdet*vbasis[i]*vbasis[j];
 				}
 			}
 		}
 		/* -------- Nitsche terms -------- */
-		/* n\cdot\nabla\phi*/
-		for(int i=0;i<vnumnodes;i++){
-			vdbasisn[i] = 0.0;
-			for (int d=0; d<dim; d++) {
-				vdbasisn[i] += bed_normal[d]*vdbasis[d*vnumnodes+i];
-			}
-		}
 		/* Boundary terms for integration by parts.
 			The coefficient matrix of n*sigma*n-gamma*n*u is stored in the following order:
@@ -5157,50 +5463,26 @@
 		*/
 		for(int i=0;i<vnumnodes;i++){
-			for(int d=0;d<dim;d++){
-				nsigma[d*vnumnodes+i] = 2.0 * viscosity * bed_normal[d]*vdbasisn[i];
+			for(int j=0;j<vnumnodes;j++){
+				/* gamma*(n*u)*(n*v) */
+				Ke->values[(dim*i+(dim-1))*numdof+dim*j+(dim-1)] += gauss->weight*Jdet * (gamma*viscosity) * vbasis[j] * vbasis[i];
+				/* -sigma(v)*(n*u) */
+				Ke->values[(dim*i+(dim-1))*numdof+dim*j+(dim-1)] += (- gauss->weight*Jdet) * 2.0 * viscosity * (-vbasis[j]) * vdbasis[(dim-1)*vnumnodes+i];
+				/* -sigma(u)*(n*v) */
+				Ke->values[(dim*i+(dim-1))*numdof+dim*j+(dim-1)] += (- gauss->weight*Jdet) * 2.0 * viscosity * vdbasis[(dim-1)*vnumnodes+j] * (-vbasis[i]);
 			}
 		}
-		for(int i=0;i<pnumnodes;i++){
-			nsigma[dim*vnumnodes+i] = -FSreconditioning*pbasis[i];
-		}
-
-		/*velocity components A11 */
-		for(int i=0;i<vnumnodes;i++){
-			for (int p=0; p<dim; p++) {
-				for(int j=0;j<vnumnodes;j++){
-					for (int q=0; q<dim; q++) {
-						/* gamma*(n*u)*(n*v) */
-						Ke->values[(dim*i+p)*numdof+dim*j+q] += gauss->weight*Jdet * (-gamma) * bed_normal[q] * vbasis[j]*bed_normal[p] * vbasis[i];
-						/* sigma(u)*(n*v) */
-						Ke->values[(dim*i+p)*numdof+dim*j+q] += (- gauss->weight*Jdet)* nsigma[p*vnumnodes+i] * bed_normal[q] * vbasis[j];
-						/* sigma(v)*(n*u) */
-						Ke->values[(dim*i+p)*numdof+dim*j+q] += (- gauss->weight*Jdet)* bed_normal[p] * vbasis[i] * nsigma[q*vnumnodes+j];
-					}
-				}
+		/* pressure x velocity  component A12, +p*(n*v) */
+		for(int k=0;k<pnumnodes;k++){
+			for(int i=0;i<vnumnodes;i++){
+				Ke->values[(dim*i+dim-1)*numdof+dim*vnumnodes+k] += gauss->weight*Jdet * FSreconditioning*pbasis[k] * (-vbasis[i]);
 			}
 		}
-
-		/* pressure x velocity  component A12 */
+		/* velocity x pressure component A21, +(n*u)*q */
 		for(int k=0;k<pnumnodes;k++){
-			pnu = nsigma[dim*vnumnodes+k];
-			for(int i=0;i<vnumnodes;i++){
-				for (int p=0;p<dim;p++) {
-					Ke->values[(dim*i+p)*numdof+dim*vnumnodes+k] += gauss->weight*Jdet * pnu * (- bed_normal[p] * vbasis[i]);
-				}
+			for(int j=0;j<vnumnodes;j++){
+				Ke->values[(dim*vnumnodes+k)*numdof+dim*j+dim-1] += gauss->weight*Jdet * (-vbasis[j]) * FSreconditioning*pbasis[k];
 			}
 		}
-		/* velocity x pressure component A21 */
-		for(int k=0;k<pnumnodes;k++){
-			qnv = nsigma[dim*vnumnodes+k];
-			for(int j=0;j<vnumnodes;j++){
-				for (int q=0;q<dim;q++) {
-					Ke->values[(dim*vnumnodes+k)*numdof+dim*j+q] += gauss->weight*Jdet * ( - bed_normal[q] * vbasis[j]) * qnv;
-				}
-			}
-		}
-	}
-
-	/*Transform Coordinate System*/
-	element->TransformStiffnessMatrixCoord(Ke,cs_list);
+	}
 
 	/*Clean up and return*/
@@ -5212,7 +5494,4 @@
 	xDelete<IssmDouble>(vdbasis);
 	xDelete<IssmDouble>(pbasis);
-	xDelete<IssmDouble>(vdbasisn);
-	xDelete<IssmDouble>(nsigma);
-	xDelete<int>(cs_list);
 	return Ke;
 }/*}}}*/
@@ -5300,5 +5579,5 @@
 
 	/*Get basal element*/
-	if(!element->IsOnBase() || !element->IsFloating()) return NULL;
+	if(!element->IsOnBase() || !element->IsAllFloating()) return NULL;
 
 	/*Get problem dimension*/
@@ -6854,5 +7133,5 @@
 	/*If on water or not FS, skip stiffness: */
 	element->GetInputValue(&approximation,ApproximationEnum);
-	if(element->IsFloating() || !element->IsOnBase()) return NULL;
+	if(element->IsAllFloating() || !element->IsOnBase()) return NULL;
 
 	int vnumnodes = element->NumberofNodesVelocity();
@@ -7071,5 +7350,5 @@
 	if(!element->IsIceInElement()) return NULL;
 
-	if(element->IsFloating() || !element->IsOnBase()) return NULL;
+	if(element->IsAllFloating() || !element->IsOnBase()) return NULL;
 
 	/*Constants*/
@@ -7299,5 +7578,5 @@
 
 	/*Initialize Element matrix and return if necessary*/
-	if(element->IsFloating() || !element->IsOnBase()) return NULL;
+	if(element->IsAllFloating() || !element->IsOnBase()) return NULL;
 
 	/*Build a tria element using the 3 nodes of the base of the penta. Then use
@@ -7306,5 +7585,5 @@
 	Element* basalelement = element->SpawnBasalElement();
 	ElementMatrix* Ke=CreateKMatrixSSAFriction(basalelement);
-	basalelement->DeleteMaterials(); delete basalelement;
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 
 	/*clean-up and return*/
@@ -7416,5 +7695,5 @@
 
 	/*Initialize Element vector and return if necessary*/
-	if(!element->IsOnBase() || element->IsFloating()) return NULL;
+	if(!element->IsOnBase() || element->IsAllFloating()) return NULL;
 	element->GetInputValue(&approximation,ApproximationEnum);
 	if(approximation!=HOFSApproximationEnum) return NULL;
@@ -7582,5 +7861,5 @@
 
 	/*Initialize Element vector and return if necessary*/
-	if(!element->IsOnBase() || element->IsFloating()) return NULL;
+	if(!element->IsOnBase() || element->IsAllFloating()) return NULL;
 	element->GetInputValue(&approximation,ApproximationEnum);
 	if(approximation!=SSAFSApproximationEnum) return NULL;
Index: /issm/trunk/src/c/analyses/StressbalanceAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/StressbalanceAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/StressbalanceAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
@@ -64,4 +65,5 @@
 		ElementVector* CreatePVectorMLHODrivingStress(Element* element);
 		void           InputUpdateFromSolutionMLHO(IssmDouble* solution,Element* element);
+		void           GetSolutionFromInputsMLHO(Vector<IssmDouble>* solution,Element* element);
 		/*HO*/
 		ElementMatrix* CreateJacobianMatrixHO(Element* element);
Index: /issm/trunk/src/c/analyses/StressbalanceSIAAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 26744)
@@ -181,4 +181,7 @@
 		femmodel->SetCurrentConfiguration(StressbalanceSIAAnalysisEnum);
 		solutionsequence_linear(femmodel);
+}/*}}}*/
+void           StressbalanceSIAAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+_error_("not implemented");
 }/*}}}*/
 ElementVector* StressbalanceSIAAnalysis::CreateDVector(Element* element){/*{{{*/
Index: /issm/trunk/src/c/analyses/StressbalanceSIAAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/StressbalanceSIAAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/StressbalanceSIAAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/StressbalanceVerticalAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 26744)
@@ -5,4 +5,6 @@
 #include "../modules/modules.h"
 #include "../solutionsequences/solutionsequences.h"
+
+//#define INWOOVZ 1 //For Inwoo Park 0: incompressible assumption(IA), 1: internal deformation(ID), 2: IA+ID
 
 /*Model processing*/
@@ -105,5 +107,5 @@
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
 	if(iomodel->domaintype!=Domain2DhorizontalEnum){
@@ -112,13 +114,20 @@
 	}
 	iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
-	//iomodel->FetchDataToInput(inputs,elements,"md.smb.mass_balance",SmbMassBalanceEnum);
-
+	#ifdef INWOOVZ
+	iomodel->FetchDataToInput(inputs,elements,"md.smb.mass_balance",SmbMassBalanceEnum);
+	#endif
 
 	/*Add basal forcings to compute melt rate*/
+	bool isstochastic;
 	int basalforcing_model;
 	iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model");
+	iomodel->FindConstant(&isstochastic,"md.stochasticforcing.isstochasticforcing");
 	switch(basalforcing_model){
 		case FloatingMeltRateEnum:
 			iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum);
+			if(isstochastic){
+            iomodel->FetchDataToInput(inputs,elements,"md.stochasticforcing.default_id",StochasticForcingDefaultIdEnum);
+            iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BaselineBasalforcingsFloatingiceMeltingRateEnum);
+         }
 			break;
 		case LinearFloatingMeltRateEnum:
@@ -153,5 +162,5 @@
 void StressbalanceVerticalAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
 
-	/*No specific parameters*/
+	/* specific parameters*/
 
 }/*}}}*/
@@ -163,4 +172,7 @@
 		femmodel->SetCurrentConfiguration(StressbalanceVerticalAnalysisEnum);
 		solutionsequence_linear(femmodel);
+}/*}}}*/
+void           StressbalanceVerticalAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
 }/*}}}*/
 ElementVector* StressbalanceVerticalAnalysis::CreateDVector(Element* element){/*{{{*/
@@ -576,4 +588,45 @@
 	}
 
+	#ifdef INWOOVZ
+	IssmDouble*  thickness = xNew<IssmDouble>(numnodes);
+	IssmDouble*  base	     = xNew<IssmDouble>(numnodes);
+	IssmDouble*  smb       = xNew<IssmDouble>(numnodes);
+
+	IssmDouble rheology_n=element->material->GetN();
+	IssmDouble isvelbc   = 10./(365.25*24*3600); /*10 m/yr*/
+	/*Set analytical vertical velocity field at slow flow region.*/
+	if(INWOOVZ == 1){
+		element->GetInputListOnNodes(&thickness[0],ThicknessEnum,0.);
+		element->GetInputListOnNodes(&base[0],BaseEnum,0.);
+		element->GetInputListOnNodes(&smb[0],SmbMassBalanceEnum,0.);
+		for(i=0;i<numnodes;i++){
+			IssmDouble eta = (base[i]+thickness[i]-xyz_list[i*3+2])/thickness[i];
+			vz[i] = -(pow(eta,rheology_n+2.0)-1-(rheology_n+2.0)*(eta-1.))/(rheology_n+1.)*smb[i];
+		}	
+	}
+	else if(INWOOVZ== 2) {
+		element->GetInputListOnNodes(&thickness[0],ThicknessEnum,0.);
+		element->GetInputListOnNodes(&base[0],BaseEnum,0.);
+		element->GetInputListOnNodes(&smb[0],SmbMassBalanceEnum,0.);
+		for(i=0;i<numnodes;i++){
+			if ( vx[i]*vx[i]+vy[i]*vy[i] < isvelbc*isvelbc ){
+				IssmDouble eta = (base[i]+thickness[i]-xyz_list[i*3+2])/thickness[i];
+				vz[i] = -(pow(eta,rheology_n+2.0)-1-(rheology_n+2.0)*(eta-1.))/(rheology_n+1.)*smb[i];
+			}
+		}	
+	}
+	else if(INWOOVZ==0){
+		/*nothing to add*/
+	}
+	else{
+		_error_("not supported yet");
+	}
+
+	/*Cleanup*/
+	xDelete<IssmDouble>(smb);
+	xDelete<IssmDouble>(base);
+	xDelete<IssmDouble>(thickness);
+	#endif
+
 	/*Now Compute vel*/
 	for(i=0;i<numnodes;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
Index: /issm/trunk/src/c/analyses/StressbalanceVerticalAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/StressbalanceVerticalAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/StressbalanceVerticalAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/ThermalAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/ThermalAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/ThermalAnalysis.cpp	(revision 26744)
@@ -133,5 +133,5 @@
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
@@ -299,4 +299,7 @@
 	_error_("not implemented");
 }/*}}}*/
+void           ThermalAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
 ElementVector* ThermalAnalysis::CreateDVector(Element* element){/*{{{*/
 	/*Default, return NULL*/
@@ -327,5 +330,5 @@
 
 	/*Initialize Element matrix and return if necessary*/
-	if(!element->IsOnBase() || !element->IsFloating()) return NULL;
+	if(!element->IsOnBase() || !element->IsAllFloating()) return NULL;
 
 	IssmDouble  dt,Jdet,D;
@@ -333,5 +336,5 @@
 
 	/*Get basal element*/
-	if(!element->IsOnBase() || !element->IsFloating()) return NULL;
+	if(!element->IsOnBase() || !element->IsAllFloating()) return NULL;
 
 	/*Fetch number of nodes for this finite element*/
@@ -534,5 +537,5 @@
 
 	/* Geothermal flux on ice sheet base and basal friction */
-	if(!element->IsOnBase() || element->IsFloating()) return NULL;
+	if(!element->IsOnBase() || element->IsAllFloating()) return NULL;
 
 	IssmDouble  dt,Jdet,geothermalflux,vx,vy,vz;
@@ -598,5 +601,5 @@
 
 	/*Get basal element*/
-	if(!element->IsOnBase() || !element->IsFloating()) return NULL;
+	if(!element->IsOnBase() || !element->IsAllFloating()) return NULL;
 
 	/*Fetch number of nodes for this finite element*/
Index: /issm/trunk/src/c/analyses/ThermalAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/ThermalAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/ThermalAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/UzawaPressureAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 26743)
+++ /issm/trunk/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 26744)
@@ -61,4 +61,7 @@
 /*Finite Element Analysis*/
 void           UzawaPressureAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+void           UzawaPressureAnalysis::PreCore(FemModel* femmodel){/*{{{*/
 	_error_("not implemented");
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/UzawaPressureAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/UzawaPressureAnalysis.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/UzawaPressureAnalysis.h	(revision 26744)
@@ -22,4 +22,5 @@
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
+		void           PreCore(FemModel* femmodel);
 		ElementVector* CreateDVector(Element* element);
 		ElementMatrix* CreateJacobianMatrix(Element* element);
Index: /issm/trunk/src/c/analyses/analyses.h
===================================================================
--- /issm/trunk/src/c/analyses/analyses.h	(revision 26743)
+++ /issm/trunk/src/c/analyses/analyses.h	(revision 26744)
@@ -1,4 +1,4 @@
 /*
- * analyses.h: 
+ * analyses.h:
  */
 
@@ -23,5 +23,4 @@
 #include "./FreeSurfaceBaseAnalysis.h"
 #include "./FreeSurfaceTopAnalysis.h"
-#include "./GiaAnalysis.h"
 #include "./GLheightadvectionAnalysis.h"
 #include "./LoveAnalysis.h"
@@ -30,4 +29,5 @@
 #include "./HydrologyDCInefficientAnalysis.h"
 #include "./HydrologyShreveAnalysis.h"
+#include "./HydrologyTwsAnalysis.h"
 #include "./HydrologyGlaDSAnalysis.h"
 #include "./HydrologyShaktiAnalysis.h"
@@ -35,6 +35,8 @@
 #include "./LevelsetAnalysis.h"
 #include "./MasstransportAnalysis.h"
+#include "./OceantransportAnalysis.h"
+#include "./SamplingAnalysis.h"
 #include "./SmbAnalysis.h"
-#include "./SealevelriseAnalysis.h"
+#include "./SealevelchangeAnalysis.h"
 #include "./MeltingAnalysis.h"
 #include "./SmoothAnalysis.h"
Index: /issm/trunk/src/c/classes/AmrBamg.cpp
===================================================================
--- /issm/trunk/src/c/classes/AmrBamg.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/AmrBamg.cpp	(revision 26744)
@@ -86,5 +86,5 @@
 /*Methods*/
 void AmrBamg::SetMesh(int** elementslist_in,IssmDouble** x_in,IssmDouble** y_in,int* numberofvertices_in,int* numberofelements_in){/*{{{*/
-	
+
 	/*Delete previous mesh and keep the entire mesh*/
 	if(this->elementslist) xDelete<int>(this->elementslist);
@@ -99,5 +99,5 @@
 }/*}}}*/
 void AmrBamg::GetMesh(int** elementslist_out,IssmDouble** x_out,IssmDouble** y_out,int* numberofvertices_out,int* numberofelements_out){/*{{{*/
-	
+
 	/*Get the entire mesh*/
 	*elementslist_out		= this->elementslist;
@@ -128,5 +128,5 @@
 }/*}}}*/
 void AmrBamg::ExecuteRefinementBamg(IssmDouble* field,IssmDouble* hmaxVertices,int** pdatalist,IssmDouble** pxylist,int** pelementslist){/*{{{*/
-	
+
 	/*Intermediaries*/
 	BamgGeom* geomout=new BamgGeom();
@@ -142,5 +142,5 @@
 	this->options->field			 = field;
 	this->options->hmaxVertices = hmaxVertices;
-	
+
 	/*remesh*/
 	if(this->previousmesh){
Index: /issm/trunk/src/c/classes/AmrBamg.h
===================================================================
--- /issm/trunk/src/c/classes/AmrBamg.h	(revision 26743)
+++ /issm/trunk/src/c/classes/AmrBamg.h	(revision 26744)
@@ -28,8 +28,7 @@
 		IssmDouble deviatoricerror_maximum;
 
-
 		/* Constructor, destructor etc*/
 		AmrBamg();
-		
+
 		~AmrBamg();
 
@@ -40,8 +39,8 @@
 		void ExecuteRefinementBamg(IssmDouble* field,IssmDouble* hmaxVertices,int** pdatalist,IssmDouble** pxylist,int** pelementslist);
 		void SetBamgOpts(IssmDouble hmin_in,IssmDouble hmax_in,IssmDouble err_in,IssmDouble gradation_in);
-		
+
 		/*Access Method*/
 		BamgOpts* GetBamgOpts(){return this->options;}
-		
+
 	private:
 		BamgGeom* geometry;
Index: /issm/trunk/src/c/classes/AmrNeopz.cpp
===================================================================
--- /issm/trunk/src/c/classes/AmrNeopz.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/AmrNeopz.cpp	(revision 26744)
@@ -137,5 +137,5 @@
 /*Mesh refinement methods*/
 void AmrNeopz::SetMesh(int** elementslist_in,IssmDouble** x_in,IssmDouble** y_in,int* numberofvertices_in,int* numberofelements_in){/*{{{*/
-   
+
    /*Delete previous mesh and keep the entire mesh*/
    if(this->elementslist) xDelete<int>(this->elementslist);
@@ -150,5 +150,5 @@
 }/*}}}*/
 void AmrNeopz::GetMesh(int** elementslist_out,IssmDouble** x_out,IssmDouble** y_out,int* numberofvertices_out,int* numberofelements_out){/*{{{*/
-   
+
    /*Get the entire mesh*/
    *elementslist_out    = this->elementslist;
@@ -394,5 +394,5 @@
 		if(type>1) break;
 	}
-	
+
 	/*Verify and return*/
 	if(type>1) type=2;
@@ -416,5 +416,5 @@
 
 	count=1;
-	
+
 	while(count>0){
 		count=0;
@@ -438,5 +438,5 @@
 				}
 			}
-			
+
 			/*refine the element if requested*/
 			if(type==2){gmesh->Element(i)->Divide(sons);	count++;}
@@ -926,5 +926,5 @@
 	this->fathermesh = dynamic_cast<TPZGeoMesh *>(TPZPersistenceManager::ReadFromFile());
 	TPZPersistenceManager::CloseRead();
-	
+
 	TPZPersistenceManager::OpenRead(previousmeshfile);
 	this->previousmesh = dynamic_cast<TPZGeoMesh *>(TPZPersistenceManager::ReadFromFile());
@@ -933,9 +933,9 @@
 	if(!amrifstream.is_open()) _error_("amr ifstream is not open!");
 	amrifstream.seekg(0);
-	
+
 	this->sid2index.clear();
 	this->index2sid.clear();
 	this->specialelementsindex.clear();
-	
+
 	amrifstream>>size;
 	for(int i=0;i<size;i++){
@@ -943,5 +943,5 @@
 		this->sid2index.push_back(value);
 	}
-	
+
 	amrifstream>>size;
 	for(int i=0;i<size;i++){
@@ -949,5 +949,5 @@
 		this->index2sid.push_back(value);
 	}
-	
+
 	amrifstream>>size;
 	for(int i=0;i<size;i++){
@@ -982,5 +982,5 @@
 		}
 	}
-	
+
 	if(this->index2sid.size()>0){
 		amrofstream << this->index2sid.size() << std::endl;
Index: /issm/trunk/src/c/classes/BarystaticContributions.cpp
===================================================================
--- /issm/trunk/src/c/classes/BarystaticContributions.cpp	(revision 26744)
+++ /issm/trunk/src/c/classes/BarystaticContributions.cpp	(revision 26744)
@@ -0,0 +1,185 @@
+/*!\file BarystaticContributions.c
+ * \brief: implementation of the BarystaticContributions object
+ */
+
+/*Include files: {{{*/
+#ifdef HAVE_CONFIG_H
+	#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "./BarystaticContributions.h" 
+#include "../toolkits/toolkits.h"
+#include "./classes.h"
+/*}}}*/
+
+/*Constructors and destructors:*/
+BarystaticContributions::BarystaticContributions(IoModel* iomodel ){ /*{{{*/
+
+	int nel;
+
+	iomodel->FetchData(&nice,"md.solidearth.npartice");
+	if(nice){
+		iomodel->FetchData(&pice,&nel,NULL,"md.solidearth.partitionice");
+		ice=new Vector<IssmDouble>(nice);
+		cumice=new Vector<IssmDouble>(nice); cumice->Set(0); cumice->Assemble();
+	}
+	else{
+		ice=new Vector<IssmDouble>(1);
+		cumice=new Vector<IssmDouble>(1);
+	}
+
+	iomodel->FetchData(&nhydro,"md.solidearth.nparthydro");
+	if(nhydro){
+		iomodel->FetchData(&phydro,&nel,NULL,"md.solidearth.partitionhydro");
+		hydro=new Vector<IssmDouble>(nhydro);
+		cumhydro=new Vector<IssmDouble>(nhydro); cumhydro->Set(0); cumhydro->Assemble();
+	}
+	else{
+		hydro=new Vector<IssmDouble>(1);
+		cumhydro=new Vector<IssmDouble>(1);
+	}
+	iomodel->FetchData(&nocean,"md.solidearth.npartocean");
+	if(nocean){
+		iomodel->FetchData(&pocean,&nel,NULL,"md.solidearth.partitionocean");
+		ocean=new Vector<IssmDouble>(nocean);
+		cumocean=new Vector<IssmDouble>(nocean); cumocean->Set(0); cumocean->Assemble();
+	}
+	else{
+		ocean=new Vector<IssmDouble>(1);
+		cumocean=new Vector<IssmDouble>(1);
+	}
+
+} /*}}}*/
+BarystaticContributions::~BarystaticContributions(){ /*{{{*/
+	delete ice;   delete cumice;
+	delete hydro; delete cumhydro;
+	delete ocean; delete cumocean;
+	if(nice)xDelete<IssmDouble>(pice);
+	if(nhydro)xDelete<IssmDouble>(phydro);
+	if(nocean)xDelete<IssmDouble>(pocean);
+}; /*}}}*/
+
+/*Support routines:*/
+IssmDouble BarystaticContributions::Total(){ /*{{{*/
+
+	IssmDouble  sumice,sumhydro,sumocean;
+
+	ice->Assemble();
+	hydro->Assemble();
+	ocean->Assemble();
+
+	ice->Sum(&sumice);
+	hydro->Sum(&sumhydro);
+	ocean->Sum(&sumocean);
+
+	return sumice+sumhydro+sumocean;
+
+} /*}}}*/
+IssmDouble BarystaticContributions::CumTotal(){ /*{{{*/
+
+	IssmDouble sumice,sumhydro,sumocean;
+
+	cumice->Assemble();
+	cumhydro->Assemble();
+	cumocean->Assemble();
+
+	cumice->Sum(&sumice);
+	cumhydro->Sum(&sumhydro);
+	cumocean->Sum(&sumocean);
+
+	return sumice+sumhydro+sumocean;
+
+} /*}}}*/
+void BarystaticContributions::Cumulate(Parameters* parameters){ /*{{{*/
+
+	cumice->AXPY(ice,1);
+	cumocean->AXPY(ocean,1);
+	cumhydro->AXPY(hydro,1);
+
+} /*}}}*/
+void BarystaticContributions::Set(int eid, IssmDouble icevalue, IssmDouble hydrovalue, IssmDouble oceanvalue){ /*{{{*/
+
+	int id;
+	if(nice){
+		id=reCast<int>(pice[eid]);
+		ice->SetValue(id,icevalue,ADD_VAL);
+	}
+	else{
+		ice->SetValue(0,icevalue,ADD_VAL);
+	}
+
+	if(nhydro){
+		id=reCast<int>(phydro[eid]);
+		hydro->SetValue(id,hydrovalue,ADD_VAL);
+	}
+	else{
+		hydro->SetValue(0,hydrovalue,ADD_VAL);
+	}
+
+	if(nocean){
+		id=reCast<int>(pocean[eid]);
+		ocean->SetValue(id,oceanvalue,ADD_VAL);
+	}
+	else{
+		ocean->SetValue(0,oceanvalue,ADD_VAL);
+	}
+
+} /*}}}*/
+void BarystaticContributions::Reset(){ /*{{{*/
+
+	ice->Set(0.);
+	hydro->Set(0.);
+	ocean->Set(0.);
+
+} /*}}}*/
+void BarystaticContributions::Save(Results* results, Parameters* parameters, IssmDouble oceanarea){ /*{{{*/
+
+	int        step;
+	IssmDouble time;
+	IssmDouble rho_water;
+
+	IssmDouble* cumice_serial=NULL;
+	IssmDouble* cumhydro_serial=NULL;
+	IssmDouble* cumocean_serial=NULL;
+
+	IssmDouble sumice,sumhydro,sumocean;
+
+	parameters->FindParam(&step,StepEnum);
+	parameters->FindParam(&time,TimeEnum);
+	parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
+
+	ice->Sum(&sumice); hydro->Sum(&sumhydro); ocean->Sum(&sumocean);
+	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcEnum,this->Total()/oceanarea/rho_water,step,time));
+	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcIceEnum,sumice/oceanarea/rho_water,step,time));
+	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcHydroEnum,sumice/oceanarea/rho_water,step,time));
+	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcOceanEnum,sumocean/oceanarea/rho_water,step,time));
+
+	cumice->Sum(&sumice); cumhydro->Sum(&sumhydro); cumocean->Sum(&sumocean);
+	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcEnum,this->CumTotal()/oceanarea/rho_water,step,time));
+	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcIceEnum,sumice/oceanarea/rho_water,step,time));
+	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcHydroEnum,sumhydro/oceanarea/rho_water,step,time));
+	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcOceanEnum,sumocean/oceanarea/rho_water,step,time));
+
+	if(nice){
+		cumice_serial=this->cumice->ToMPISerial0(); for (int i=0;i<nice;i++)cumice_serial[i]=cumice_serial[i]/oceanarea/rho_water;
+		results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcIcePartitionEnum,cumice_serial,nice,1,step,time));
+	}
+	if(nhydro){
+		cumhydro_serial=this->cumhydro->ToMPISerial0(); for (int i=0;i<nhydro;i++)cumhydro_serial[i]=cumhydro_serial[i]/oceanarea/rho_water;
+		results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcHydroPartitionEnum,cumhydro_serial,nhydro,1,step,time));
+	}
+	if(nocean){
+		cumocean_serial=this->cumocean->ToMPISerial0(); for (int i=0;i<nocean;i++)cumocean_serial[i]=cumocean_serial[i]/oceanarea/rho_water;
+		results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcOceanPartitionEnum,cumocean_serial,nocean,1,step,time));
+	}
+
+	if(IssmComm::GetRank()==0){
+		if(nice)xDelete<IssmDouble>(cumice_serial);
+		if(nhydro)xDelete<IssmDouble>(cumhydro_serial);
+		if(nocean)xDelete<IssmDouble>(cumocean_serial);
+	}
+	return;
+
+} /*}}}*/
Index: /issm/trunk/src/c/classes/BarystaticContributions.h
===================================================================
--- /issm/trunk/src/c/classes/BarystaticContributions.h	(revision 26744)
+++ /issm/trunk/src/c/classes/BarystaticContributions.h	(revision 26744)
@@ -0,0 +1,47 @@
+/*!\file BarystaticContributions.h
+ * \brief: header file for barystatic contribution object
+ */
+
+#ifndef _BARYSTATICCONTRIBUTIONS_H_
+#define _BARYSTATICCONTRIBUTIONS_H_
+
+/*Headers:*/
+class IoModel;
+class Parameters;
+class Results;
+template <class doubletype> class Vector;
+#include "../shared/shared.h"
+
+class BarystaticContributions {
+
+	public: 
+
+		Vector<IssmDouble>* ice;  //contributions to every ice partition (size nice x 1)
+		Vector<IssmDouble>* cumice;  //cumulated contributions to every ice partition
+		int                 nice; //number of ice partitions 
+		IssmDouble*         pice; //ice partition (nel)
+
+		Vector<IssmDouble>* hydro;  //contributions to every hydro partition (size nhydro x 1)
+		Vector<IssmDouble>* cumhydro;  //cumulated contributions to every hydro partition
+		int                 nhydro; //number of hydro partitions 
+		IssmDouble*         phydro; //hydro partition (nel)
+
+		Vector<IssmDouble>* ocean;  //contributions to every ocean partition (size nocean x 1)
+		Vector<IssmDouble>* cumocean;  //cumulated contributions to every ocean partition
+		int                 nocean; //number of ocean partitions 
+		IssmDouble*         pocean; //ocean partition (nel)
+
+		/*BarystaticContributions constructors, destructors :*/
+		BarystaticContributions(IoModel* iomodel );
+		~BarystaticContributions();
+
+		/*routines:*/
+		IssmDouble Total();
+		IssmDouble CumTotal();
+		void Cumulate(Parameters* parameters);
+		void Save(Results* results, Parameters* parameters, IssmDouble oceanarea);
+		void Set(int eid, IssmDouble icevalue, IssmDouble hydrovalue, IssmDouble oceanvalue);
+		void Reset();
+
+};
+#endif  /* _BARYSTATICCONTRIBUTIONS_H_ */
Index: /issm/trunk/src/c/classes/Cfdragcoeffabsgrad.cpp
===================================================================
--- /issm/trunk/src/c/classes/Cfdragcoeffabsgrad.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Cfdragcoeffabsgrad.cpp	(revision 26744)
@@ -161,5 +161,5 @@
 
 	/*clean up and Return: */
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	xDelete<IssmDouble>(xyz_list);
 	delete gauss;
Index: /issm/trunk/src/c/classes/Cfdragcoeffabsgrad.h
===================================================================
--- /issm/trunk/src/c/classes/Cfdragcoeffabsgrad.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Cfdragcoeffabsgrad.h	(revision 26744)
@@ -21,12 +21,12 @@
 		int         weights_enum;
 		bool			timepassedflag;
-		
+
 		IssmDouble  misfit; //value carried over in time.
-		
+
 		/*Cfdragcoeffabsgrad constructors, destructors :*/
 		Cfdragcoeffabsgrad();
 		Cfdragcoeffabsgrad(char* in_name, int in_definitionenum, int in_weights_enum,  bool timepassedflag);
 		~Cfdragcoeffabsgrad();
-		
+
 		/*Object virtual function resolutoin: */
 		Object* copy();
@@ -36,5 +36,5 @@
 		void Marshall(MarshallHandle* marshallhandle);
 		int ObjectEnum(void);
-		
+
 		/*Definition virtual function resolutoin: */
 		int DefinitionEnum();
Index: /issm/trunk/src/c/classes/Cflevelsetmisfit.cpp
===================================================================
--- /issm/trunk/src/c/classes/Cflevelsetmisfit.cpp	(revision 26744)
+++ /issm/trunk/src/c/classes/Cflevelsetmisfit.cpp	(revision 26744)
@@ -0,0 +1,215 @@
+/*!\file Cflevelsetmisfit.cpp
+ * \brief: Cflevelsetmisfit Object
+ */
+
+/*Headers:*/
+/*{{{*/
+#ifdef HAVE_CONFIG_H
+   #include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "./classes.h"
+#include "./ExternalResults/ExternalResult.h"
+#include "./ExternalResults/Results.h"
+#include "../datastructures/datastructures.h"
+#include "./Elements/Element.h"
+#include "./Elements/Elements.h"
+#include "./FemModel.h"
+#include "../modules/SurfaceAreax/SurfaceAreax.h"
+#include "../classes/Params/Parameters.h"
+#include "../classes/gauss/Gauss.h"
+#include "./Inputs/DatasetInput.h"
+/*}}}*/
+
+/*Cflevelsetmisfit constructors, destructors :*/
+Cflevelsetmisfit::Cflevelsetmisfit(){/*{{{*/
+
+	this->definitionenum = -1;
+	this->name = NULL;
+	this->model_enum = UNDEF;
+	this->observation_enum = UNDEF;
+	this->weights_enum = UNDEF;
+	this->misfit=0;
+	this->datatime=0.;
+	this->timepassedflag = false;
+}
+/*}}}*/
+Cflevelsetmisfit::Cflevelsetmisfit(char* in_name, int in_definitionenum, int in_model_enum, int in_observation_enum, int in_weights_enum, IssmDouble in_datatime, bool in_timepassedflag){/*{{{*/
+
+	this->definitionenum=in_definitionenum;
+
+	this->name		= xNew<char>(strlen(in_name)+1);
+	xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
+
+	this->model_enum=in_model_enum;
+	this->observation_enum=in_observation_enum;
+	this->weights_enum=in_weights_enum;
+	this->datatime=in_datatime;
+	this->timepassedflag=in_timepassedflag;
+
+	this->misfit=0;
+}
+/*}}}*/
+Cflevelsetmisfit::~Cflevelsetmisfit(){/*{{{*/
+	if(this->name)xDelete(this->name);
+	this->misfit=0;
+}
+/*}}}*/
+/*Object virtual function resolutoin: */
+Object* Cflevelsetmisfit::copy() {/*{{{*/
+	Cflevelsetmisfit* mf = new Cflevelsetmisfit(this->name,this->definitionenum, this->model_enum,this->observation_enum,this->weights_enum,this->datatime,this->timepassedflag);
+	mf->misfit=this->misfit;
+	return (Object*) mf;
+}
+/*}}}*/
+void Cflevelsetmisfit::DeepEcho(void){/*{{{*/
+	this->Echo();
+}
+/*}}}*/
+void Cflevelsetmisfit::Echo(void){/*{{{*/
+	_printf_(" Cflevelsetmisfit: " << name << " " << this->definitionenum << "\n");
+	_printf_("    model_enum: " << model_enum << " " << EnumToStringx(model_enum) << "\n");
+	_printf_("    observation_enum: " << observation_enum << " " << EnumToStringx(observation_enum) << "\n");
+	_printf_("    weights_enum: " << weights_enum << " " << EnumToStringx(weights_enum) << "\n");
+	_printf_("    datatime: " << datatime << "\n");
+	_printf_("	  timepassedflag: "<<timepassedflag<<"\n");
+}
+/*}}}*/
+int Cflevelsetmisfit::Id(void){/*{{{*/
+	return -1;
+}
+/*}}}*/
+void Cflevelsetmisfit::Marshall(MarshallHandle* marshallhandle){/*{{{*/
+
+	/*ok, marshall operations: */
+   int object_enum=CflevelsetmisfitEnum;
+   marshallhandle->call(object_enum);
+
+	marshallhandle->call(this->definitionenum);
+	marshallhandle->call(this->model_enum);
+	marshallhandle->call(this->name);
+	marshallhandle->call(this->observation_enum);
+	marshallhandle->call(this->weights_enum);
+	marshallhandle->call(this->datatime);
+	marshallhandle->call(this->timepassedflag);
+	marshallhandle->call(this->misfit);
+} 
+/*}}}*/
+int Cflevelsetmisfit::ObjectEnum(void){/*{{{*/
+	return CflevelsetmisfitEnum;
+}
+/*}}}*/
+/*Definition virtual function resolutoin: */
+int Cflevelsetmisfit::DefinitionEnum(){/*{{{*/
+	return this->definitionenum;
+}
+/*}}}*/
+char* Cflevelsetmisfit::Name(){/*{{{*/
+	char* name2=xNew<char>(strlen(this->name)+1);
+	xMemCpy(name2,this->name,strlen(this->name)+1);
+
+	return name2;
+}
+/*}}}*/
+IssmDouble Cflevelsetmisfit::Response(FemModel* femmodel){/*{{{*/
+	 /*diverse: */
+	 IssmDouble time;
+
+	 /*recover time parameters: */
+	 femmodel->parameters->FindParam(&time,TimeEnum);
+
+	 IssmDouble J=0.;
+	 IssmDouble J_sum=0.;
+
+	 if(datatime<=time && !timepassedflag){
+		 for(Object* & object : femmodel->elements->objects){
+			 Element* element=xDynamicCast<Element*>(object);
+			 J+=this->Cflevelsetmisfit_Calculation(element,model_enum,observation_enum,weights_enum);
+		 }
+
+		 ISSM_MPI_Allreduce ( (void*)&J,(void*)&J_sum,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
+		 ISSM_MPI_Bcast(&J_sum,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+		 J=J_sum;
+
+		 timepassedflag = true;
+		 return J;
+	 }
+	 else return J;
+ }
+	/*}}}*/
+IssmDouble Cflevelsetmisfit::Cflevelsetmisfit_Calculation(Element* element, int model_enum, int observation_enum, int weights_enum){/*{{{*/
+
+	int        domaintype,numcomponents;
+	IssmDouble Jelem=0.;
+	IssmDouble misfit,Jdet;
+	IssmDouble model,obs,weight;
+	IssmDouble modelLevel,obsLevel;
+	IssmDouble* xyz_list = NULL;
+
+	/*Get basal element*/
+	if(!element->IsOnSurface()) return 0.;
+
+	/*If on water, return 0: */
+//	if(!element->IsIceInElement()) return 0.;
+
+	/*Get problem dimension*/
+	element->FindParam(&domaintype,DomainTypeEnum);
+	switch(domaintype){
+		case Domain2DverticalEnum:   numcomponents   = 1; break;
+		case Domain3DEnum:           numcomponents   = 2; break;
+		case Domain2DhorizontalEnum: numcomponents   = 2; break;
+		default: _error_("not supported yet");
+	}
+
+	/*Spawn surface element*/
+	Element* topelement = element->SpawnTopElement();
+
+	/* Get node coordinates*/
+	topelement->GetVerticesCoordinates(&xyz_list);
+
+	/*Retrieve all inputs we will be needing: */
+	DatasetInput *datasetinput = topelement->GetDatasetInput(definitionenum); _assert_(datasetinput);
+	Input        *model_input  = topelement->GetInput(model_enum);            _assert_(model_input);
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=topelement->NewGauss(2);
+	while(gauss->next()){
+
+		/* Get Jacobian determinant: */
+		topelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
+
+		/*Get all parameters at gaussian point*/
+		datasetinput->GetInputValue(&weight,gauss,WeightsLevelsetObservationEnum);
+		model_input->GetInputValue(&model,gauss);
+		datasetinput->GetInputValue(&obs,gauss,LevelsetObservationEnum);
+
+		/*Compute Levelset misfit:
+		 *  J = || H(\phi) - H(\phi_obs)||^2
+		 *                                           */
+//		modelLevel = this->Heaviside(model);
+//		obsLevel = this->Heaviside(obs);
+		modelLevel = model;
+		obsLevel = obs;
+
+		misfit=0.5*(modelLevel-obsLevel)*(modelLevel-obsLevel);
+
+//		if (modelLevel*obsLevel<0.0) {
+		/*Add to cost function*/
+			Jelem+=misfit*weight*Jdet*gauss->weight;
+//		}
+	}
+
+	/*clean up and Return: */
+	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
+	xDelete<IssmDouble>(xyz_list);
+	delete gauss;
+	return Jelem;
+}/*}}}*/
+IssmDouble Cflevelsetmisfit::Heaviside(IssmDouble x){/*{{{*/
+	if (x>0) return 1.;
+	else if (x<0) return -1.;
+	else return 0.;
+}
+	/*}}}*/
Index: /issm/trunk/src/c/classes/Cflevelsetmisfit.h
===================================================================
--- /issm/trunk/src/c/classes/Cflevelsetmisfit.h	(revision 26744)
+++ /issm/trunk/src/c/classes/Cflevelsetmisfit.h	(revision 26744)
@@ -0,0 +1,49 @@
+/*!\file Cflevelsetmisfit.h
+ * \brief: header file for Cflevelsetmisfit object
+ */
+
+#ifndef _CFLEVELSETMISFIT_H_
+#define _CFLEVELSETMISFIT_H_
+
+/*Headers:*/
+#include "./Definition.h"
+#include "./FemModel.h"
+
+IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);
+void  GetVectorFromInputsx( IssmDouble** pvector, int* pvector_size, FemModel* femmodel,int name);
+
+class Cflevelsetmisfit: public Object, public Definition{
+
+	public: 
+
+		int         definitionenum;
+		int         model_enum;
+		char*       name;
+		int         observation_enum;
+		int         weights_enum;
+		IssmDouble	datatime;
+		bool			timepassedflag;
+
+		IssmDouble  misfit; //value carried over in time.
+
+		/*Cflevelsetmisfit constructors, destructors :*/
+		Cflevelsetmisfit();
+		Cflevelsetmisfit(char* in_name, int in_definitionenum, int in_model_enum, int in_observation_enum, int in_weights_enum, IssmDouble in_datatime, bool timepassedflag);
+		~Cflevelsetmisfit();
+
+		/*Object virtual function resolutoin: */
+		Object* copy();
+		void DeepEcho(void);
+		void Echo(void);
+		int Id(void);
+		void Marshall(MarshallHandle* marshallhandle);
+		int ObjectEnum(void);
+
+		/*Definition virtual function resolutoin: */
+		int DefinitionEnum();
+		char* Name();
+		IssmDouble Response(FemModel* femmodel);
+		IssmDouble Cflevelsetmisfit_Calculation(Element* element, int model_enum, int observation_enum, int weights_enum);
+		IssmDouble Heaviside(IssmDouble x);
+};
+#endif  /* _CFLEVELSETMISFIT_H_ */
Index: /issm/trunk/src/c/classes/Cfsurfacelogvel.cpp
===================================================================
--- /issm/trunk/src/c/classes/Cfsurfacelogvel.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Cfsurfacelogvel.cpp	(revision 26744)
@@ -96,5 +96,4 @@
 IssmDouble Cfsurfacelogvel::Response(FemModel* femmodel){/*{{{*/
 
-
 	/*recover time parameters: */
 	IssmDouble time;
@@ -198,5 +197,5 @@
 
 	/*clean up and Return: */
-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
+	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
 	xDelete<IssmDouble>(xyz_list);
 	delete gauss;
Index: /issm/trunk/src/c/classes/Cfsurfacelogvel.h
===================================================================
--- /issm/trunk/src/c/classes/Cfsurfacelogvel.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Cfsurfacelogvel.h	(revision 26744)
@@ -21,12 +21,12 @@
 		IssmDouble	datatime;
 		bool			timepassedflag;
-		
+
 		IssmDouble  misfit; //value carried over in time.
-		
+
 		/*Cfsurfacelogvel constructors, destructors :*/
 		Cfsurfacelogvel();
 		Cfsurfacelogvel(char* in_name, int in_definitionenum, IssmDouble in_datatime, bool timepassedflag);
 		~Cfsurfacelogvel();
-		
+
 		/*Object virtual function resolutoin: */
 		Object* copy();
@@ -36,5 +36,5 @@
 		void Marshall(MarshallHandle* marshallhandle);
 		int ObjectEnum(void);
-		
+
 		/*Definition virtual function resolutoin: */
 		int DefinitionEnum();
Index: /issm/trunk/src/c/classes/Cfsurfacesquare.cpp
===================================================================
--- /issm/trunk/src/c/classes/Cfsurfacesquare.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Cfsurfacesquare.cpp	(revision 26744)
@@ -83,5 +83,17 @@
 /*}}}*/
 void Cfsurfacesquare::Marshall(MarshallHandle* marshallhandle){/*{{{*/
-	_error_("not implemented yet!"); 
+
+	int object_enum=CfsurfacesquareEnum;
+	marshallhandle->call(object_enum);
+
+	marshallhandle->call(this->definitionenum);
+	marshallhandle->call(this->local);
+	marshallhandle->call(this->model_enum);
+	marshallhandle->call(this->name);
+	marshallhandle->call(this->observation_enum);
+	marshallhandle->call(this->weights_enum);
+	marshallhandle->call(this->datatime);
+	marshallhandle->call(this->timepassedflag);
+	marshallhandle->call(this->misfit);
 } 
 /*}}}*/
@@ -187,5 +199,5 @@
 
 	/*clean up and Return: */
-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
+	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
 	xDelete<IssmDouble>(xyz_list);
 	delete gauss;
Index: /issm/trunk/src/c/classes/Cfsurfacesquare.h
===================================================================
--- /issm/trunk/src/c/classes/Cfsurfacesquare.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Cfsurfacesquare.h	(revision 26744)
@@ -22,16 +22,15 @@
 		char*       name;
 		int         observation_enum;
-		char*       timeinterpolation;
 		int         weights_enum;
 		IssmDouble	datatime;
 		bool			timepassedflag;
-		
+
 		IssmDouble  misfit; //value carried over in time.
-		
+
 		/*Cfsurfacesquare constructors, destructors :*/
 		Cfsurfacesquare();
 		Cfsurfacesquare(char* in_name, int in_definitionenum, int in_model_enum, int in_observation_enum, int in_weights_enum, IssmDouble in_datatime, bool timepassedflag);
 		~Cfsurfacesquare();
-		
+
 		/*Object virtual function resolutoin: */
 		Object* copy();
@@ -41,5 +40,5 @@
 		void Marshall(MarshallHandle* marshallhandle);
 		int ObjectEnum(void);
-		
+
 		/*Definition virtual function resolutoin: */
 		int DefinitionEnum();
Index: /issm/trunk/src/c/classes/Constraints/SpcDynamic.cpp
===================================================================
--- /issm/trunk/src/c/classes/Constraints/SpcDynamic.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Constraints/SpcDynamic.cpp	(revision 26744)
@@ -18,10 +18,10 @@
 }
 /*}}}*/
-SpcDynamic::SpcDynamic(int spc_id,int spc_nodeid, int spc_dof,int spc_analysis_type){/*{{{*/
+SpcDynamic::SpcDynamic(int spc_id,int spc_nodeid, int spc_dof,IssmDouble value_in,int spc_analysis_type){/*{{{*/
 
 	id           = spc_id;
 	nodeid        = spc_nodeid;
 	dof           = spc_dof;
-	value         = 0;
+	value         = value_in;
 	analysis_type = spc_analysis_type;
 	isset         = false;
Index: /issm/trunk/src/c/classes/Constraints/SpcDynamic.h
===================================================================
--- /issm/trunk/src/c/classes/Constraints/SpcDynamic.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Constraints/SpcDynamic.h	(revision 26744)
@@ -26,5 +26,5 @@
 		/*SpcDynamic constructors, destructors*/
 		SpcDynamic();
-		SpcDynamic(int id_in,int nodeid, int dof,int analysis_type);
+		SpcDynamic(int id_in,int nodeid, int dof,IssmDouble value_in,int analysis_type);
 		~SpcDynamic();
 
Index: /issm/trunk/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp
===================================================================
--- /issm/trunk/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp	(revision 26744)
@@ -55,4 +55,5 @@
 		bool       control_analysis         = false;
 		void     (*solutioncore)(FemModel*) = NULL;
+		void     (*solutionprecore)(FemModel*) = NULL;
 		bool       nodakotacore             = true;
 
@@ -94,6 +95,7 @@
 		responses=xNewZeroInit<IssmDouble>(numFns);
 
-		/*Hack:*/
-		for(int i=0;i<femmodel_init->nummodels;i++) if(femmodel_init->analysis_type_list[i]==SealevelriseAnalysisEnum) sealevelrise_core_geometry(femmodel_init);
+		/*Launch cores that are not used during the uncertainty quantification: */
+		WrapperPreCorePointerFromSolutionEnum(&solutionprecore,femmodel_init->parameters,solution_type);
+		if(solutionprecore)solutionprecore(femmodel_init);
 
 		/*Make a copy of femmodel, so we start this new evaluation run for this specific sample with a brand 
@@ -122,5 +124,5 @@
 		if(VerboseQmu()) _printf0_("compute dakota responses:\n");
 		femmodel->DakotaResponsesx(responses,responses_descriptors,numresponsedescriptors,numFns);
-		
+
 		/*Output results for this iteration: */
 		if(VerboseQmu()) _printf0_("output results for this iteration: \n");
Index: /issm/trunk/src/c/classes/Dakota/IssmParallelDirectApplicInterface.h
===================================================================
--- /issm/trunk/src/c/classes/Dakota/IssmParallelDirectApplicInterface.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Dakota/IssmParallelDirectApplicInterface.h	(revision 26744)
@@ -29,5 +29,4 @@
 /*}}}*/
 
-
 #if !defined(_WRAPPERS_) && defined(_HAVE_DAKOTA_) && _DAKOTA_MAJOR_ >= 6
 
@@ -37,5 +36,5 @@
 namespace SIM {
 	class IssmParallelDirectApplicInterface: public Dakota::DirectApplicInterface{
-      
+
 		private: 
 			FemModel* femmodel_init;
Index: /issm/trunk/src/c/classes/Elements/Element.cpp
===================================================================
--- /issm/trunk/src/c/classes/Elements/Element.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Elements/Element.cpp	(revision 26744)
@@ -56,7 +56,120 @@
 
 	for(int i=0;i<numnodes;i++){
-		if(nodes[i]->fsize) return true;
+		if(nodes[i]->FSize()) return true;
 	}
 	return false;
+}/*}}}*/
+void       Element::AutoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,int enum_type){/*{{{*/
+
+const int numvertices = this->GetNumberOfVertices();
+   int         basinid;
+   IssmDouble  tspin,beta0_basin,beta1_basin,noisespin_basin;
+   IssmDouble* phi_basin   = xNew<IssmDouble>(arorder);
+   IssmDouble* varspin     = xNewZeroInit<IssmDouble>(numvertices*arorder);
+
+   /*Get Basin ID and Basin coefficients*/
+   if(enum_type==SMBautoregressionEnum)                   this->GetInputValue(&basinid,SmbBasinsIdEnum);
+   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->GetInputValue(&basinid,FrontalForcingsBasinIdEnum);
+   for(int i=0;i<arorder;i++) phi_basin[i] = phi[basinid*arorder+i];
+   beta0_basin   = beta0[basinid];
+   beta1_basin   = beta1[basinid];
+
+   /*Loop over number of spin-up steps for all vertices*/
+   for(int j=0;j<nspin;j++){
+      tspin = starttime-((nspin-j)*tstep_ar);
+      IssmDouble* oldvarspin = xNew<IssmDouble>(numvertices*arorder);
+      for(int i=0;i<numvertices*arorder;i++) oldvarspin[i]=varspin[i];
+
+      for(int v=0;v<numvertices;v++){
+         IssmDouble autoregressionterm = 0.;
+         for(int i=0;i<arorder;i++) autoregressionterm += phi_basin[i]*varspin[v+i*numvertices];
+         varspin[v] = beta0_basin+beta1_basin*(tspin-tinit_ar)+autoregressionterm;
+      }
+
+      /*Adjust older values in varspin*/
+      for(int i=0;i<(arorder-1)*numvertices;i++) varspin[i+numvertices]=oldvarspin[i];
+
+      xDelete<IssmDouble>(oldvarspin);
+   }
+   if(enum_type==SMBautoregressionEnum)                   this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,varspin,numvertices*arorder);
+   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->inputs->SetArrayInput(ThermalforcingValuesAutoregressionEnum,this->lid,varspin,numvertices*arorder);
+
+   /*Cleanup and return*/
+   xDelete<IssmDouble>(varspin);
+   xDelete<IssmDouble>(phi_basin);	
+}/*}}}*/
+void       Element::Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,bool isfieldstochastic,int enum_type){/*{{{*/
+
+   const int numvertices = this->GetNumberOfVertices();
+   int         basinid,M,N,arenum_type,basinenum_type,noiseenum_type,outenum_type;
+   IssmDouble  beta0_basin,beta1_basin,noiseterm;
+   IssmDouble* phi_basin  = xNew<IssmDouble>(arorder);
+   IssmDouble* varlist     = xNew<IssmDouble>(numvertices);
+   IssmDouble* valuesautoregression = NULL;
+   Input*      noiseterm_input      = NULL;
+
+   /*Get field-specific enums*/
+   switch(enum_type){
+      case(SMBautoregressionEnum):
+         arenum_type    = SmbValuesAutoregressionEnum;
+         basinenum_type = SmbBasinsIdEnum;
+         noiseenum_type = SmbAutoregressionNoiseEnum;
+         outenum_type   = SmbMassBalanceEnum;
+         break;
+      case(FrontalForcingsRignotAutoregressionEnum):
+         arenum_type    = ThermalforcingValuesAutoregressionEnum;
+         basinenum_type = FrontalForcingsBasinIdEnum;
+         noiseenum_type = ThermalforcingAutoregressionNoiseEnum;
+         outenum_type   = FrontalForcingsThermalForcingEnum;
+         break;
+   }
+
+   /*Get noise and autoregressive terms*/
+   this->GetInputValue(&basinid,basinenum_type);
+   if(isfieldstochastic){
+      noiseterm_input = this->GetInput(noiseenum_type);
+      Gauss* gauss = this->NewGauss();
+      noiseterm_input->GetInputValue(&noiseterm,gauss);
+      delete gauss;
+   }
+   else noiseterm = 0.0;
+   this->inputs->GetArray(arenum_type,this->lid,&valuesautoregression,&M);
+
+   /*Get basin coefficients*/
+   for(int ii=0;ii<arorder;ii++) phi_basin[ii] = phi[basinid*arorder+ii];
+   beta0_basin   = beta0[basinid];
+   beta1_basin   = beta1[basinid];
+
+	/*If not AR model timestep: take the old values of variable*/
+   if(isstepforar==false){
+      for(int i=0;i<numvertices;i++) varlist[i]=valuesautoregression[i];
+   }
+   /*If AR model timestep: compute variable values on vertices from AR*/
+   else{
+      for(int v=0;v<numvertices;v++){
+
+         /*Compute autoregressive term*/
+         IssmDouble autoregressionterm=0.;
+         for(int ii=0;ii<arorder;ii++) autoregressionterm += phi_basin[ii]*valuesautoregression[v+ii*numvertices];
+
+         /*Stochastic variable value*/
+         varlist[v] = beta0_basin+beta1_basin*telapsed_ar+autoregressionterm+noiseterm;
+      }
+      /*Update autoregression values*/
+      IssmDouble* temparray = xNew<IssmDouble>(numvertices*arorder);
+      /*Assign newest values and shift older values*/
+      for(int i=0;i<numvertices;i++) temparray[i] = varlist[i];
+      for(int i=0;i<(arorder-1)*numvertices;i++) temparray[i+numvertices] = valuesautoregression[i];
+      this->inputs->SetArrayInput(arenum_type,this->lid,temparray,numvertices*arorder);
+      xDelete<IssmDouble>(temparray);
+   }
+
+   /*Add input to element*/
+   this->AddInput(outenum_type,varlist,P1Enum);
+
+   /*Cleanup*/
+   xDelete<IssmDouble>(phi_basin);
+   xDelete<IssmDouble>(varlist);
+   xDelete<IssmDouble>(valuesautoregression);
 }/*}}}*/
 void       Element::ComputeLambdaS(){/*{{{*/
@@ -651,24 +764,20 @@
 	const int NUM_VERTICES = this->GetNumberOfVertices();
 
-	int        i;
-	IssmDouble accuref, runoffref; //reference values at given altitude
-	IssmDouble accualti, runoffalti; //reference altitudes
+	IssmDouble accuref, runoffref;  //reference values at given altitude
 	IssmDouble accugrad, runoffgrad; //gradients from reference altitude
-	IssmDouble rho_water, rho_ice;
-	IssmDouble time;
-
-	IssmDouble*		smb	 = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble*		surf	 = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble*		accu	 = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble*		runoff = xNew<IssmDouble>(NUM_VERTICES);
+
+	IssmDouble smb[MAXVERTICES];
+	IssmDouble surf[MAXVERTICES];
+	IssmDouble accu[MAXVERTICES];
+	IssmDouble runoff[MAXVERTICES];
 
 	/*Get material parameters :*/
-	rho_water=this->FindParam(MaterialsRhoSeawaterEnum);
-	rho_ice=this->FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_water = this->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_ice   = this->FindParam(MaterialsRhoIceEnum);
 
 	/*Recover parameters*/
-	parameters->FindParam(&time,TimeEnum);
-	parameters->FindParam(&accualti,SmbAccualtiEnum);
-	parameters->FindParam(&runoffalti,SmbRunoffaltiEnum);
+	IssmDouble time       = this->FindParam(TimeEnum);
+	IssmDouble accualti   = this->FindParam(SmbAccualtiEnum);
+	IssmDouble runoffalti = this->FindParam(SmbRunoffaltiEnum);
 
 	/*Recover reference values at current time*/
@@ -683,7 +792,7 @@
 	/*Compute the temperature and precipitation*/
 	for(int iv=0;iv<NUM_VERTICES;iv++){
-		accu[iv]=max(0.,(accuref+(surf[iv]-accualti)*accugrad));
-		runoff[iv]=max(0.,(runoffref+(surf[iv]-runoffalti)*runoffgrad));
-		smb[iv]=(accu[iv]-runoff[iv])*rho_ice/rho_water;
+		accu[iv]   = max(0.,(accuref+(surf[iv]-accualti)*accugrad));
+		runoff[iv] = max(0.,(runoffref+(surf[iv]-runoffalti)*runoffgrad));
+		smb[iv]    = (accu[iv]-runoff[iv])*rho_ice/rho_water;
 	}
 
@@ -701,9 +810,4 @@
 	default: _error_("Not implemented yet");
 	}
-	/*clean-up*/
-	xDelete<IssmDouble>(surf);
-	xDelete<IssmDouble>(accu);
-	xDelete<IssmDouble>(runoff);
-	xDelete<IssmDouble>(smb);
 }
 /*}}}*/
@@ -825,4 +929,33 @@
 }
 /*}}}*/
+void       Element::dViscositydBMLHO(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vxbase_input,Input* vybase_input, Input* vxshear_input ,Input* vyshear_input,Input* thickness_input,Input* n_input, IssmDouble zeta){/*{{{*/
+
+	/*Intermediaries*/
+	int materialstype;
+	IssmDouble dmudB;
+	IssmDouble epsilon[5];/* epsilon=[exx,eyy,exy,exy,exz,eyz];    */
+	IssmDouble eps_eff;
+	IssmDouble eps0=1.e-27;
+
+	/* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exz^2 + eyz^2 + exx*eyy */
+   this->StrainRateMLHO(&epsilon[0],xyz_list,gauss,
+				vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input,zeta);
+   eps_eff=sqrt(epsilon[0]*epsilon[0] + epsilon[1]*epsilon[1] + epsilon[2]*epsilon[2]
+				+ epsilon[3]*epsilon[3] + epsilon[4]*epsilon[4] + epsilon[0]*epsilon[1] + eps0*eps0);
+
+	/*Get viscosity*/
+	materialstype=this->material->ObjectEnum();
+	switch(materialstype){
+		case MaticeEnum:
+			material->GetViscosity_B(&dmudB,eps_eff,gauss);
+			break;
+		default: _error_("not supported");
+	}
+
+	/*Assign output pointer*/
+	*pdmudB=dmudB;
+
+}
+/*}}}*/
 void       Element::dViscositydBSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){/*{{{*/
 
@@ -956,5 +1089,5 @@
 	/*First, figure out size of doflist and create it: */
 	int numberofdofs=0;
-	for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
+	for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,GsetEnum);
 
 	/*Allocate output*/
@@ -964,6 +1097,6 @@
 	int count=0;
 	for(int i=0;i<numnodes;i++){
-		nodes[i]->GetDofList(doflist+count,approximation_enum,setenum);
-		count+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
+		nodes[i]->GetDofList(&doflist[count],approximation_enum,setenum);
+		count+=nodes[i]->GetNumberOfDofs(approximation_enum,GsetEnum);
 	}
 
@@ -979,5 +1112,5 @@
 	/*First, figure out size of doflist and create it: */
 	int numberofdofs=0;
-	for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
+	for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
 
 	/*Allocate output*/
@@ -987,6 +1120,7 @@
 	int count=0;
 	for(int i=0;i<numnodes;i++){
+		_assert_(count<numberofdofs);
 		nodes[i]->GetDofListLocal(doflist+count,approximation_enum,setenum);
-		count+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
+		count+=nodes[i]->GetNumberOfDofs(approximation_enum,GsetEnum);
 	}
 
@@ -1293,70 +1427,57 @@
 }
 /*}}}*/
-/* void       Element::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){/\*{{{*\/ */
-
-/* 	/\*Fetch number vertices for this element and allocate arrays*\/ */
-/* 	const int NUM_VERTICES = this->GetNumberOfVertices(); */
-/* 	int*        vertexpidlist = xNew<int>(NUM_VERTICES); */
-/* 	IssmDouble* values        = xNew<IssmDouble>(NUM_VERTICES); */
-
-/* 	/\*Fill in values*\/ */
-/* 	this->GetVerticesPidList(vertexpidlist); */
-/* 	this->GetInputListOnVertices(values,input_enum); */
-/* 	vector->SetValues(NUM_VERTICES,vertexpidlist,values,INS_VAL); */
-
-/* 	/\*Clean up*\/ */
-/* 	xDelete<int>(vertexpidlist); */
-/* 	xDelete<IssmDouble>(values); */
-
-/* } */
-/* /\*}}}*\/ */
 void       Element::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum,int type){/*{{{*/
 
-	/*Fetch number vertices for this element and allocate arrays*/
-	const int NUM_VERTICES = this->GetNumberOfVertices();
-
-	int         numnodes    = this->GetNumberOfNodes();
-	int*        doflist     = NULL;
-	IssmDouble  value;
-	IssmDouble* values      = NULL;
-	Input*     input       = NULL;
-
 	switch(type){
-		case ElementSIdEnum:
-			input=this->GetInput(input_enum); _assert_(input);
+		case ElementSIdEnum:{
+         IssmDouble  value;
+			Input* input=this->GetInput(input_enum); _assert_(input);
 			input->GetInputAverage(&value);
 			vector->SetValue(this->sid,value,INS_VAL);
+                          }
 			break;
-		case VertexPIdEnum:
-			doflist = xNew<int>(NUM_VERTICES);
-			values = xNew<IssmDouble>(NUM_VERTICES);
+		case VertexPIdEnum:{
+         int        doflist[MAXVERTICES];
+         IssmDouble values[MAXVERTICES];
+			const int  NUM_VERTICES = this->GetNumberOfVertices();
 			/*Fill in values*/
-			this->GetVerticesPidList(doflist);
-			this->GetInputListOnVertices(values,input_enum);
+			this->GetVerticesPidList(&doflist[0]);
+			this->GetInputListOnVertices(&values[0],input_enum);
 			vector->SetValues(NUM_VERTICES,doflist,values,INS_VAL);
+                         }
 			break;
-		case VertexSIdEnum:
-			doflist = xNew<int>(NUM_VERTICES);
-			values = xNew<IssmDouble>(NUM_VERTICES);
+		case VertexSIdEnum:{
+         int        doflist[MAXVERTICES];
+         IssmDouble values[MAXVERTICES];
+			const int  NUM_VERTICES = this->GetNumberOfVertices();
 			/*Fill in values*/
 			this->GetVerticesSidList(doflist);
 			this->GetInputListOnVertices(values,input_enum);
 			vector->SetValues(NUM_VERTICES,doflist,values,INS_VAL);
+                         }
 			break;
-		case NodesEnum:
-			doflist = xNew<int>(numnodes);
-			values = xNew<IssmDouble>(numnodes);
+		case NodesEnum:{
+         int         numnodes = this->GetNumberOfNodes();
+         int        *doflist  = xNew<int>(numnodes);
+         IssmDouble *values   = xNew<IssmDouble>(numnodes);
 			/*Fill in values*/
 			this->GetInputListOnNodes(values,input_enum);
 			this->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
 			vector->SetValues(numnodes,doflist,values,INS_VAL);
+         xDelete<int>(doflist);
+         xDelete<IssmDouble>(values);
+                     }
 			break;
-		case NodeSIdEnum:
-			doflist = xNew<int>(numnodes);
-			values = xNew<IssmDouble>(numnodes);
+		case NodeSIdEnum:{
+         int         numnodes = this->GetNumberOfNodes();
+         int        *doflist  = xNew<int>(numnodes);
+         IssmDouble *values   = xNew<IssmDouble>(numnodes);
 			/*Fill in values*/
 			this->GetNodesSidList(doflist);
 			this->GetInputListOnNodes(values,input_enum);
 			vector->SetValues(numnodes,doflist,values,INS_VAL);
+         xDelete<int>(doflist);
+         xDelete<IssmDouble>(values);
+                       }
 			break;
 		default:
@@ -1364,44 +1485,31 @@
 	}
 
-	/*Clean up*/
-	xDelete<int>(doflist);
-	xDelete<IssmDouble>(values);
-
-}
-/*}}}*/
+}/*}}}*/
 void       Element::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum,int type, IssmDouble time){/*{{{*/
 
-	/*Fetch number vertices for this element and allocate arrays*/
-	const int NUM_VERTICES = this->GetNumberOfVertices();
-
-	int         numnodes    = this->GetNumberOfNodes();
-	int*        doflist     = NULL;
-	IssmDouble* values      = NULL;
-
 	switch(type){
-		case VertexPIdEnum:
-			doflist = xNew<int>(NUM_VERTICES);
-			values = xNew<IssmDouble>(NUM_VERTICES);
+		case VertexPIdEnum:{
+			int        doflist[MAXVERTICES];
+			IssmDouble values[MAXVERTICES];
+			const int  NUM_VERTICES = this->GetNumberOfVertices();
 			/*Fill in values*/
 			this->GetVerticesPidList(doflist);
 			this->GetInputListOnVerticesAtTime(values,input_enum,time);
-			vector->SetValues(NUM_VERTICES,doflist,values,INS_VAL);
+			vector->SetValues(NUM_VERTICES,doflist,&values[0],INS_VAL);
+								 }
 			break;
-		case VertexSIdEnum:
-			doflist = xNew<int>(NUM_VERTICES);
-			values = xNew<IssmDouble>(NUM_VERTICES);
+		case VertexSIdEnum:{
+			int        doflist[MAXVERTICES];
+			IssmDouble values[MAXVERTICES];
+			const int  NUM_VERTICES = this->GetNumberOfVertices();
 			/*Fill in values*/
 			this->GetVerticesSidList(doflist);
 			this->GetInputListOnVerticesAtTime(values,input_enum,time);
-			vector->SetValues(NUM_VERTICES,doflist,values,INS_VAL);
+			vector->SetValues(NUM_VERTICES,doflist,&values[0],INS_VAL);
+								 }
 			break;
 		default:
 			_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
 	}
-
-	/*Clean up*/
-	xDelete<int>(doflist);
-	xDelete<IssmDouble>(values);
-
 }
 /*}}}*/
@@ -1449,11 +1557,9 @@
 	/*Create list of x*/
 	const int NUM_VERTICES = this->GetNumberOfVertices();
-
-	IssmDouble* x_list = xNew<IssmDouble>(NUM_VERTICES);
-
+	IssmDouble x_list[MAXVERTICES];
 	for(int i=0;i<NUM_VERTICES;i++) x_list[i]=xyz_list[i*3+0];
-	ValueP1OnGauss(&x,x_list,gauss);
-
-	xDelete<IssmDouble>(x_list);
+
+	/*Get value at gauss point*/
+	ValueP1OnGauss(&x,&x_list[0],gauss);
 	return x;
 }/*}}}*/
@@ -1465,11 +1571,9 @@
 	/*Create list of y*/
 	const int NUM_VERTICES = this->GetNumberOfVertices();
-
-	IssmDouble* y_list      = xNew<IssmDouble>(NUM_VERTICES);
-
+	IssmDouble y_list[MAXVERTICES];
 	for(int i=0;i<NUM_VERTICES;i++) y_list[i]=xyz_list[i*3+1];
-	ValueP1OnGauss(&y,y_list,gauss);
-
-	xDelete<IssmDouble>(y_list);
+
+	/*Get value at gauss point*/
+	ValueP1OnGauss(&y,&y_list[0],gauss);
 	return y;
 }/*}}}*/
@@ -1481,11 +1585,9 @@
 	/*Create list of z*/
 	const int NUM_VERTICES = this->GetNumberOfVertices();
-
-	IssmDouble* z_list      = xNew<IssmDouble>(NUM_VERTICES);
-
+	IssmDouble z_list[MAXVERTICES];
 	for(int i=0;i<NUM_VERTICES;i++) z_list[i]=xyz_list[i*3+2];
-	ValueP1OnGauss(&z,z_list,gauss);
-
-	xDelete<IssmDouble>(z_list);
+
+	/*Get value at gauss point*/
+	ValueP1OnGauss(&z,&z_list[0],gauss);
 	return z;
 }/*}}}*/
@@ -1612,7 +1714,4 @@
 void       Element::InputCreate(IssmDouble* vector,Inputs* inputs,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code){/*{{{*/
 
-	/*Intermediaries*/
-	int i,t;
-
 	/*Branch on type of vector: nodal or elementary: */
 	if(vector_type==1){ //nodal vector
@@ -1620,11 +1719,11 @@
 		const int NUM_VERTICES = this->GetNumberOfVertices();
 
-		int        *vertexids  = xNew<int>(NUM_VERTICES);
-		int        *vertexlids = xNew<int>(NUM_VERTICES);
-		IssmDouble *values     = xNew<IssmDouble>(NUM_VERTICES);
+		int        vertexids[MAXVERTICES];
+		int        vertexlids[MAXVERTICES];
+		IssmDouble values[MAXVERTICES];
 
 		/*Recover vertices ids needed to initialize inputs*/
 		_assert_(iomodel->elements);
-		for(i=0;i<NUM_VERTICES;i++){
+		for(int i=0;i<NUM_VERTICES;i++){
 			vertexids[i] =reCast<int>(iomodel->elements[NUM_VERTICES*this->Sid()+i]); //ids for vertices are in the elements array from Matlab
 			vertexlids[i]=iomodel->my_vertices_lids[vertexids[i]-1];
@@ -1637,5 +1736,5 @@
 		}
 		else if(M==iomodel->numberofvertices){
-			for(i=0;i<NUM_VERTICES;i++) values[i]=vector[vertexids[i]-1];
+			for(int i=0;i<NUM_VERTICES;i++) values[i]=vector[vertexids[i]-1];
 			this->SetElementInput(inputs,NUM_VERTICES,vertexlids,values,vector_enum);
 		}
@@ -1643,12 +1742,12 @@
 			/*create transient input: */
 			IssmDouble* times = xNew<IssmDouble>(N);
-			for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
+			for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
 			inputs->SetTransientInput(vector_enum,times,N);
 			TransientInput* transientinput = inputs->GetTransientInput(vector_enum);
-			for(t=0;t<N;t++){
-				for(i=0;i<NUM_VERTICES;i++) values[i]=vector[N*(vertexids[i]-1)+t];
+			for(int t=0;t<N;t++){
+				for(int i=0;i<NUM_VERTICES;i++) values[i]=vector[N*(vertexids[i]-1)+t];
 				switch(this->ObjectEnum()){
-					case TriaEnum:  transientinput->AddTriaTimeInput( t,NUM_VERTICES,vertexlids,values,P1Enum); break;
-					case PentaEnum: transientinput->AddPentaTimeInput(t,NUM_VERTICES,vertexlids,values,P1Enum); break;
+					case TriaEnum:  transientinput->AddTriaTimeInput( t,NUM_VERTICES,vertexlids,&values[0],P1Enum); break;
+					case PentaEnum: transientinput->AddPentaTimeInput(t,NUM_VERTICES,vertexlids,&values[0],P1Enum); break;
 					default: _error_("Not implemented yet");
 				}
@@ -1659,23 +1758,23 @@
 
 			/*This is a Patch!*/
-			xDelete<IssmDouble>(values);
-			values = xNew<IssmDouble>(N);
-			for(int j=0;j<N;j++) values[j]=vector[this->Sid()*N+j];
+			IssmDouble* evalues = xNew<IssmDouble>(N);
+			for(int j=0;j<N;j++) evalues[j]=vector[this->Sid()*N+j];
 
 			if (N==this->GetNumberOfNodes(P1Enum)){
-				this->SetElementInput(inputs,NUM_VERTICES,vertexlids,values,vector_enum);
+				this->SetElementInput(inputs,NUM_VERTICES,vertexlids,evalues,vector_enum);
 			}
 			else if(N==this->GetNumberOfNodes(P0Enum)){
-				this->SetElementInput(inputs,vector_enum,values[0]);
+				this->SetElementInput(inputs,vector_enum,evalues[0]);
 			}
 			else if(N==this->GetNumberOfNodes(P1xP2Enum)){ _assert_(this->ObjectEnum()==PentaEnum);
-				inputs->SetPentaInput(vector_enum,P1xP2Enum,this->lid,N,values);
+				inputs->SetPentaInput(vector_enum,P1xP2Enum,this->lid,N,evalues);
 			}
 			else if(N==this->GetNumberOfNodes(P1xP3Enum)){ _assert_(this->ObjectEnum()==PentaEnum);
-				inputs->SetPentaInput(vector_enum,P1xP3Enum,this->lid,N,values);
+				inputs->SetPentaInput(vector_enum,P1xP3Enum,this->lid,N,evalues);
 			}
 			else{
 				_error_("Patch interpolation not supported yet");
 			}
+			xDelete<IssmDouble>(evalues);
 
 		}
@@ -1683,8 +1782,4 @@
 			_error_("nodal vector is either numberofvertices or numberofvertices+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
 		}
-
-		xDelete<IssmDouble>(values);
-		xDelete<int>(vertexids);
-		xDelete<int>(vertexlids);
 	}
 	else if(vector_type==2){ //element vector
@@ -1708,8 +1803,8 @@
 			/*create transient input: */
 			IssmDouble* times = xNew<IssmDouble>(N);
-			for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
+			for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
 			inputs->SetTransientInput(vector_enum,times,N);
 			TransientInput* transientinput = inputs->GetTransientInput(vector_enum);
-			for(t=0;t<N;t++){
+			for(int t=0;t<N;t++){
 				value=vector[N*this->Sid()+t];
 				switch(this->ObjectEnum()){
@@ -1721,4 +1816,23 @@
 			xDelete<IssmDouble>(times);
 		}
+		else if(M==1 || M==2){
+			/*create transient input: */
+			IssmDouble* times = xNew<IssmDouble>(N);
+			if(M==1)times[0]=0;
+			if(M==2)for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
+
+			inputs->SetTransientInput(vector_enum,times,N);
+			TransientInput* transientinput = inputs->GetTransientInput(vector_enum);
+
+			for(int t=0;t<N;t++){
+				value=vector[t]; //values are on the first line, times are on the second line
+				switch(this->ObjectEnum()){
+					case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&(this->lid),&value,P0Enum); break;
+					case PentaEnum: transientinput->AddPentaTimeInput(t,1,&(this->lid),&value,P0Enum); break;
+					default: _error_("Not implemented yet");
+				}
+			}
+			xDelete<IssmDouble>(times);
+		}
 		else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
 	}
@@ -1728,5 +1842,5 @@
 		if(M==iomodel->numberofelements){
 			IssmDouble* layers = xNewZeroInit<IssmDouble>(N);
-			for(t=0;t<N;t++) layers[t] = vector[N*this->Sid()+t];
+			for(int t=0;t<N;t++) layers[t] = vector[N*this->Sid()+t];
 			inputs->SetArrayInput(vector_enum,this->lid,layers,N);
 			xDelete<IssmDouble>(layers);
@@ -1735,4 +1849,24 @@
 	}
 	else _error_("Cannot add input for vector type " << vector_type << " (not supported)");
+}
+/*}}}*/
+void       Element::InputCreateP1FromConstant(Inputs* inputs,IoModel* iomodel,IssmDouble value_in,int vector_enum){/*{{{*/
+
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
+	int        vertexids[MAXVERTICES];
+	int        vertexlids[MAXVERTICES];
+	IssmDouble values[MAXVERTICES];
+
+	/*Recover vertices ids needed to initialize inputs*/
+	_assert_(iomodel->elements);
+	for(int i=0;i<NUM_VERTICES;i++){
+		vertexids[i] =reCast<int>(iomodel->elements[NUM_VERTICES*this->Sid()+i]); //ids for vertices are in the elements array from Matlab
+		vertexlids[i]=iomodel->my_vertices_lids[vertexids[i]-1];
+	}
+
+	for(int i=0;i<NUM_VERTICES;i++) values[i]=value_in;
+	this->SetElementInput(inputs,NUM_VERTICES,vertexlids,values,vector_enum);
+
 }
 /*}}}*/
@@ -1850,7 +1984,4 @@
 	 */
 
-	/*Intermediaries*/
-	int i,t;
-
 	/*Branch on type of vector: nodal or elementary: */
 	if(vector_type==1){ //nodal vector
@@ -1858,11 +1989,11 @@
 		const int NUM_VERTICES = this->GetNumberOfVertices();
 
-		int        *vertexids  = xNew<int>(NUM_VERTICES);
-		int        *vertexlids = xNew<int>(NUM_VERTICES);
-		IssmDouble *values     = xNew<IssmDouble>(NUM_VERTICES);
+		int        vertexids[MAXVERTICES];
+		int        vertexlids[MAXVERTICES];
+		IssmDouble values[MAXVERTICES];
 
 		/*Recover vertices ids needed to initialize inputs*/
 		_assert_(iomodel->elements);
-		for(i=0;i<NUM_VERTICES;i++){
+		for(int i=0;i<NUM_VERTICES;i++){
 			vertexids[i] =reCast<int>(iomodel->elements[NUM_VERTICES*this->Sid()+i]); //ids for vertices are in the elements array from Matlab
 			vertexlids[i]=iomodel->my_vertices_lids[vertexids[i]-1];
@@ -1876,5 +2007,5 @@
 		}
 		else if(M==iomodel->numberofvertices){
-			for(i=0;i<NUM_VERTICES;i++) values[i]=vector[vertexids[i]-1];
+			for(int i=0;i<NUM_VERTICES;i++) values[i]=vector[vertexids[i]-1];
 			switch(this->ObjectEnum()){
 				case TriaEnum:  inputs->SetTriaDatasetInput(enum_type,input_id,P1Enum,NUM_VERTICES,vertexlids,values); break;
@@ -1886,8 +2017,8 @@
 			/*create transient input: */
 			IssmDouble* times = xNew<IssmDouble>(N);
-			for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
+			for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
 			TransientInput* transientinput = inputs->SetDatasetTransientInput(enum_type,input_id,times,N);
-			for(t=0;t<N;t++){
-				for(i=0;i<NUM_VERTICES;i++) values[i]=vector[N*(vertexids[i]-1)+t];
+			for(int t=0;t<N;t++){
+				for(int i=0;i<NUM_VERTICES;i++) values[i]=vector[N*(vertexids[i]-1)+t];
 				switch(this->ObjectEnum()){
 					case TriaEnum:  transientinput->AddTriaTimeInput( t,NUM_VERTICES,vertexlids,values,P1Enum); break;
@@ -1901,8 +2032,4 @@
 			_error_("not implemented yet (M="<<M<<")");
 		}
-
-		xDelete<IssmDouble>(values);
-		xDelete<int>(vertexids);
-		xDelete<int>(vertexlids);
 	}
 	else if(vector_type==2){ //element vector
@@ -1983,5 +2110,5 @@
 }
 /*}}}*/
-void       Element::InputUpdateFromConstant(bool constant, int name){/*{{{*/
+void       Element::InputUpdateFromConstant(IssmDouble constant, int name, int type){/*{{{*/
 
 	/*Check that name is an element input*/
@@ -1989,4 +2116,13 @@
 
 	/*update input*/
+	this->SetElementInput(name,constant,type);
+}
+/*}}}*/
+void       Element::InputUpdateFromConstant(bool constant, int name){/*{{{*/
+
+	/*Check that name is an element input*/
+	if(!IsInputEnum(name)) return;
+
+	/*update input*/
 	this->SetBoolInput(this->inputs,name,constant);
 }
@@ -1998,5 +2134,5 @@
 	return this->isonbase;
 }/*}}}*/
-bool       Element::IsFloating(){/*{{{*/
+bool       Element::IsAllFloating(){/*{{{*/
 
 	bool shelf;
@@ -2039,5 +2175,5 @@
 bool       Element::IsIceOnlyInElement(){/*{{{*/
 	Input* input=this->GetInput(MaskIceLevelsetEnum); _assert_(input);
-	return (input->GetInputMax()<0.);
+	return (input->GetInputMax()<=0.);
 }
 /*}}}*/
@@ -2052,7 +2188,12 @@
 }
 /*}}}*/
+bool       Element::IsOceanOnlyInElement(){/*{{{*/
+	Input* input=this->GetInput(MaskOceanLevelsetEnum); _assert_(input);
+	return (input->GetInputMax()<=0.);
+}
+/*}}}*/
 void       Element::Ismip6FloatingiceMeltingRate(){/*{{{*/
 
-	if(!this->IsIceInElement() || !this->IsFloating() || !this->IsOnBase()) return;
+	if(!this->IsIceInElement() || !this->IsAllFloating() || !this->IsOnBase()) return;
 
 	int         basinid,num_basins,M,N;
@@ -2065,5 +2206,5 @@
 	/*Allocate some arrays*/
 	const int numvertices = this->GetNumberOfVertices();
-	IssmDouble* basalmeltrate = xNew<IssmDouble>(numvertices);
+	IssmDouble basalmeltrate[MAXVERTICES];
 
 	/*Get variables*/
@@ -2114,5 +2255,4 @@
 	xDelete<IssmDouble>(mean_tf);
 	xDelete<IssmDouble>(depths);
-	xDelete<IssmDouble>(basalmeltrate);
 
 }/*}}}*/
@@ -2121,9 +2261,9 @@
 	const int NUM_VERTICES = this->GetNumberOfVertices();
 
-	IssmDouble  deepwaterel,upperwaterel,deepwatermelt,upperwatermelt;
-	IssmDouble *base         = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble *values       = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble *perturbation = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble 	time;
+	IssmDouble deepwaterel,upperwaterel,deepwatermelt,upperwatermelt;
+	IssmDouble base[MAXVERTICES];
+	IssmDouble values[MAXVERTICES];
+	IssmDouble perturbation[MAXVERTICES];
+	IssmDouble time;
 
 	parameters->FindParam(&time,TimeEnum);
@@ -2134,6 +2274,6 @@
 	_assert_(upperwaterel>deepwaterel);
 
-	this->GetInputListOnVertices(base,BaseEnum);
-   this->GetInputListOnVertices(perturbation,BasalforcingsPerturbationMeltingRateEnum);
+	this->GetInputListOnVertices(&base[0],BaseEnum);
+   this->GetInputListOnVertices(&perturbation[0],BasalforcingsPerturbationMeltingRateEnum);
 	for(int i=0;i<NUM_VERTICES;i++){
 		if(base[i]>=upperwaterel){
@@ -2152,7 +2292,4 @@
 
 	this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,values,P1Enum);
-	xDelete<IssmDouble>(base);
-   xDelete<IssmDouble>(perturbation);
-	xDelete<IssmDouble>(values);
 
 }/*}}}*/
@@ -2161,14 +2298,14 @@
 	const int NUM_VERTICES = this->GetNumberOfVertices();
 
-	IssmDouble *deepwatermelt = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble *deepwaterel   = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble *upperwaterel  = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble *base          = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble *values        = xNew<IssmDouble>(NUM_VERTICES);
-
-	this->GetInputListOnVertices(base,BaseEnum);
-	this->GetInputListOnVertices(deepwatermelt,BasalforcingsDeepwaterMeltingRateEnum);
-	this->GetInputListOnVertices(deepwaterel,BasalforcingsDeepwaterElevationEnum);
-	this->GetInputListOnVertices(upperwaterel,BasalforcingsUpperwaterElevationEnum);
+	IssmDouble deepwatermelt[MAXVERTICES];
+	IssmDouble deepwaterel[MAXVERTICES];;
+	IssmDouble upperwaterel[MAXVERTICES];
+	IssmDouble base[MAXVERTICES];
+	IssmDouble values[MAXVERTICES];
+
+	this->GetInputListOnVertices(&base[0],BaseEnum);
+	this->GetInputListOnVertices(&deepwatermelt[0],BasalforcingsDeepwaterMeltingRateEnum);
+	this->GetInputListOnVertices(&deepwaterel[0],BasalforcingsDeepwaterElevationEnum);
+	this->GetInputListOnVertices(&upperwaterel[0],BasalforcingsUpperwaterElevationEnum);
 
 	for(int i=0;i<NUM_VERTICES;i++){
@@ -2178,11 +2315,5 @@
 	}
 
-	this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,values,P1Enum);
-	xDelete<IssmDouble>(base);
-	xDelete<IssmDouble>(deepwaterel);
-	xDelete<IssmDouble>(deepwatermelt);
-	xDelete<IssmDouble>(upperwaterel);
-	xDelete<IssmDouble>(values);
-
+	this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,&values[0],P1Enum);
 }/*}}}*/
 void       Element::MantlePlumeGeothermalFlux(){/*{{{*/
@@ -2193,5 +2324,5 @@
 	IssmDouble  crustheat,plumeheat,dt,middleplumedepth,a,e,eprime,A0,lambda,Alambda,dAlambda;
 	IssmDouble  x,y,z,c;
-	IssmDouble* values   = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble  values[MAXVERTICES];
 	IssmDouble *xyz_list = NULL;
 
@@ -2228,7 +2359,6 @@
 	}
 
-	this->AddInput(BasalforcingsGeothermalfluxEnum,values,P1Enum);
+	this->AddInput(BasalforcingsGeothermalfluxEnum,&values[0],P1Enum);
 	xDelete<IssmDouble>(xyz_list);
-	xDelete<IssmDouble>(values);
 
 }/*}}}*/
@@ -2253,14 +2383,13 @@
 
 	const int  NUM_VERTICES = this->GetNumberOfVertices();
-	int        i,migration_style;
+	int        migration_style;
 	IssmDouble bed_hydro,yts;
-	IssmDouble rho_water,rho_ice,density;
-	IssmDouble* melting = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble* phi     = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble* h       = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble* s       = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble* b       = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble* r       = xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble* sl      = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble melting[MAXVERTICES];
+	IssmDouble phi[MAXVERTICES];
+	IssmDouble h[MAXVERTICES];
+	IssmDouble s[MAXVERTICES];
+	IssmDouble b[MAXVERTICES];
+	IssmDouble r[MAXVERTICES];
+	IssmDouble sl[MAXVERTICES];
 
 	/*Recover info at the vertices: */
@@ -2273,10 +2402,10 @@
 	GetInputListOnVertices(&sl[0],SealevelEnum);
 	GetInputListOnVertices(&phi[0],MaskOceanLevelsetEnum);
-	rho_water   = FindParam(MaterialsRhoSeawaterEnum);
-	rho_ice     = FindParam(MaterialsRhoIceEnum);
-	density     = rho_ice/rho_water;
+	IssmDouble rho_water   = FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_ice     = FindParam(MaterialsRhoIceEnum);
+	IssmDouble density     = rho_ice/rho_water;
 
 	/*go through vertices, and update inputs, considering them to be TriaVertex type: */
-	for(i=0;i<NUM_VERTICES;i++){
+	for(int i=0;i<NUM_VERTICES;i++){
 		/* Contact FS*/
 		if(migration_style == ContactEnum){
@@ -2284,6 +2413,8 @@
 			if(phi[i]>=0.) b[i]=r[i];
 		}
-		else if(migration_style == GroundingOnlyEnum && b[i]<r[i]) b[i]=r[i];
-		/*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
+		else if(migration_style == GroundingOnlyEnum && b[i]<r[i]){
+			/*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
+			b[i]=r[i];
+		}
 		else if(phi[i]<=0.){
 			if(b[i]<=r[i]){
@@ -2299,10 +2430,10 @@
 				/*Unground only if the element is connected to the ice shelf*/
 				if(migration_style==AggressiveMigrationEnum || migration_style==SubelementMigrationEnum){
-					s[i]        = (1-density)*h[i]+sl[i];
-					b[i]        = -density*h[i]+sl[i];
+					s[i] = (1.-density)*h[i]+sl[i];
+					b[i] = -density*h[i]+sl[i];
 				}
 				else if(migration_style==SoftMigrationEnum && phi_ungrounding[vertices[i]->Pid()]<0.){
-					s[i]        = (1-density)*h[i]+sl[i];
-					b[i]        = -density*h[i]+sl[i];
+					s[i] = (1.-density)*h[i]+sl[i];
+					b[i] = -density*h[i]+sl[i];
 				}
 				else{
@@ -2314,5 +2445,5 @@
 
 	/*Recalculate phi*/
-	for(i=0;i<NUM_VERTICES;i++){
+	for(int i=0;i<NUM_VERTICES;i++){
 		if(migration_style==SoftMigrationEnum){
 			bed_hydro=-density*h[i]+sl[i];
@@ -2321,5 +2452,7 @@
 			}
 		}
-		else if(migration_style!=ContactEnum) phi[i]=h[i]+(r[i]-sl[i])/density;
+		else if(migration_style!=ContactEnum){
+			phi[i]=h[i]+(r[i]-sl[i])/density;
+		}
 		else{
 			/*do nothing*/
@@ -2332,15 +2465,5 @@
 	this->AddInput(BaseEnum,&b[0],P1Enum);
 
-	/*Delete*/
-	xDelete<IssmDouble>(melting);
-	xDelete<IssmDouble>(phi);
-	xDelete<IssmDouble>(r);
-	xDelete<IssmDouble>(b);
-	xDelete<IssmDouble>(s);
-	xDelete<IssmDouble>(sl);
-	xDelete<IssmDouble>(h);
-
-}
-/*}}}*/
+}/*}}}*/
 void       Element::MismipFloatingiceMeltingRate(){/*{{{*/
 
@@ -2518,5 +2641,5 @@
 void       Element::PicoUpdateBoxid(int* max_boxid_basin_list){/*{{{*/
 
-	if(!this->IsIceInElement() || !this->IsFloating()) return;
+	if(!this->IsIceInElement() || !this->IsAllFloating()) return;
 
 	int        basin_id;
@@ -2559,5 +2682,5 @@
 void       Element::PicoUpdateBox(int loopboxid){/*{{{*/
 
-	if(!this->IsIceInElement() || !this->IsFloating()) return;
+	if(!this->IsIceInElement() || !this->IsAllFloating()) return;
 
 	int boxid;
@@ -2566,5 +2689,4 @@
 
 	const int NUM_VERTICES = this->GetNumberOfVertices();
-
 	int        basinid, maxbox, num_basins, numnodes, M;
 	IssmDouble gamma_T, overturning_coeff, thickness;
@@ -2593,6 +2715,7 @@
 	this->GetInputValue(&basinid,BasalforcingsPicoBasinIdEnum);
 	this->parameters->FindParam(&isplume, BasalforcingsPicoIsplumeEnum);
-	Input *thickness_input    = this->GetInput(ThicknessEnum);                         _assert_(thickness_input);
-	_assert_(basinid<=num_basins);
+	Input *thickness_input = this->GetInput(ThicknessEnum); 
+   _assert_(basinid<=num_basins);
+   _assert_(thickness_input);
 
 	IssmDouble* boxareas = NULL;
@@ -2603,8 +2726,8 @@
 	IssmDouble g1               = area_boxi*gamma_T;
 
-	IssmDouble* basalmeltrates_shelf 				= xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble* potential_pressure_melting_point	= xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble* Tocs 								= xNew<IssmDouble>(NUM_VERTICES);
-	IssmDouble* Socs								= xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble basalmeltrates_shelf[MAXVERTICES];
+	IssmDouble potential_pressure_melting_point[MAXVERTICES];
+	IssmDouble Tocs[MAXVERTICES];
+	IssmDouble Socs[MAXVERTICES];
 
 	/* First box calculations */
@@ -2612,9 +2735,9 @@
 		/* Get box1 parameters and inputs */
 		IssmDouble time, toc_farocean, soc_farocean;
+      IssmDouble overturnings[MAXVERTICES];
 		this->parameters->FindParam(&time,TimeEnum);
 		this->parameters->FindParam(&toc_farocean, basinid, time, BasalforcingsPicoFarOceantemperatureEnum);
 		this->parameters->FindParam(&soc_farocean, basinid, time, BasalforcingsPicoFarOceansalinityEnum);
-		IssmDouble 	s1 				= soc_farocean/(nu*lambda);
-		IssmDouble* overturnings 	= xNew<IssmDouble>(NUM_VERTICES);
+		IssmDouble s1 = soc_farocean/(nu*lambda);
 		Input *overturningC_input = this->GetInput(BasalforcingsPicoOverturningCoeffEnum); _assert_(overturningC_input);
 
@@ -2640,8 +2763,8 @@
 		}
 
-		if(!isplume) this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,basalmeltrates_shelf,P1DGEnum);
-		this->AddInput(BasalforcingsPicoSubShelfOceanTempEnum,Tocs,P1DGEnum);
-		this->AddInput(BasalforcingsPicoSubShelfOceanSalinityEnum,Socs,P1DGEnum);
-		this->AddInput(BasalforcingsPicoSubShelfOceanOverturningEnum,overturnings,P1DGEnum);
+		if(!isplume) this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,&basalmeltrates_shelf[0],P1DGEnum);
+		this->AddInput(BasalforcingsPicoSubShelfOceanTempEnum,&Tocs[0],P1DGEnum);
+		this->AddInput(BasalforcingsPicoSubShelfOceanSalinityEnum,&Socs[0],P1DGEnum);
+		this->AddInput(BasalforcingsPicoSubShelfOceanOverturningEnum,&overturnings[0],P1DGEnum);
 
 		/*Cleanup and return*/
@@ -2693,5 +2816,5 @@
 void       Element::PicoComputeBasalMelt(){/*{{{*/
 
-	if(!this->IsIceInElement() || !this->IsFloating()) return;
+	if(!this->IsIceInElement() || !this->IsAllFloating()) return;
 
 	const int NUM_VERTICES = this->GetNumberOfVertices();
@@ -2716,5 +2839,5 @@
 
 	/*Define arrays*/
-	IssmDouble* basalmeltrates_shelf = xNew<IssmDouble>(NUM_VERTICES); //Basal melt-rate
+	IssmDouble basalmeltrates_shelf[MAXVERTICES];
 
 	/*Polynomial coefficients*/
@@ -2789,9 +2912,8 @@
 
 	/*Save computed melt-rate*/
-	this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,basalmeltrates_shelf,P1DGEnum);
+	this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,&basalmeltrates_shelf[0],P1DGEnum);
 
 	/*Cleanup and return*/
 	delete gauss;
-
 }/*}}}*/
 void       Element::PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm,bool issetpddfac){/*{{{*/
@@ -3281,5 +3403,4 @@
 	}
 
-
 	/*Assign output pointer*/
 
@@ -3342,6 +3463,4 @@
 				case P1Enum:{
 					const int NUM_VERTICES = this->GetNumberOfVertices();
-
-
 
 					this->GetVerticesSidList(&sidlist[0]);
@@ -3372,4 +3491,59 @@
 
 } /*}}}*/
+void       Element::RignotMeltParameterization(){/*{{{*/
+
+	const int numvertices = this->GetNumberOfVertices();
+   IssmDouble A, B, alpha, beta;
+   IssmDouble bed,qsg,qsg_basin,TF,yts;
+   int numbasins,basinid;
+   IssmDouble* basin_icefront_area=NULL;
+
+   /* Coefficients */
+   A    = 3e-4;
+   B    = 0.15;
+   alpha = 0.39;
+   beta = 1.18;
+
+   /*Get inputs*/
+	this->GetInputValue(&basinid,FrontalForcingsBasinIdEnum);
+	Input* bed_input = this->GetInput(BedEnum);                     _assert_(bed_input);
+   Input* qsg_input = this->GetInput(FrontalForcingsSubglacialDischargeEnum);     _assert_(qsg_input);
+   Input* TF_input  = this->GetInput(FrontalForcingsThermalForcingEnum);          _assert_(TF_input);
+
+	this->FindParam(&yts, ConstantsYtsEnum);
+   this->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
+   this->parameters->FindParam(&basin_icefront_area,&numbasins,FrontalForcingsBasinIcefrontAreaEnum);
+   IssmDouble meltrates[numvertices];  
+
+   /* Start looping on the number of vertices: */
+   GaussTria gauss;
+   for(int iv=0;iv<numvertices;iv++){
+      gauss.GaussVertex(iv);
+
+      /* Get variables */
+      bed_input->GetInputValue(&bed,&gauss);
+      qsg_input->GetInputValue(&qsg,&gauss);
+      TF_input->GetInputValue(&TF,&gauss);
+
+      if(basin_icefront_area[basinid]==0.) meltrates[iv]=0.;
+      else{
+         /* change the unit of qsg (m^3/d -> m/d) with ice front area */
+         qsg_basin=qsg/basin_icefront_area[basinid];
+
+         /* calculate melt rates */
+         meltrates[iv]=((A*max(-bed,0.)*pow(max(qsg_basin,0.),alpha)+B)*pow(max(TF,0.),beta))/86400; //[m/s]
+      }
+
+      if(xIsNan<IssmDouble>(meltrates[iv])) _error_("NaN found in vector");
+      if(xIsInf<IssmDouble>(meltrates[iv])) _error_("Inf found in vector");
+   }
+
+   /*Add input*/
+   this->AddInput(CalvingMeltingrateEnum,&meltrates[0],P1Enum);
+
+   /*Cleanup and return*/
+   xDelete<IssmDouble>(basin_icefront_area);
+}
+/*}}}*/
 void       Element::SetBoolInput(Inputs* inputs,int enum_in,bool value){/*{{{*/
 
@@ -3407,5 +3581,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->fsize){
+					if(nodes[i]->FSize()){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -3423,5 +3597,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->ssize){
+					if(nodes[i]->SSize()){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -3619,4 +3793,5 @@
 	IssmDouble dlw=0.0;
 	IssmDouble dsw=0.0;
+	IssmDouble dswdiff=0.0;
 	IssmDouble P=0.0;
 	IssmDouble eAir=0.0;
@@ -3624,6 +3799,12 @@
 	IssmDouble teValue=1.0;
 	IssmDouble aValue=0.0;
+	IssmDouble dulwrfValue=0.0;
+	IssmDouble szaValue=0.0;
+	IssmDouble cotValue=0.0;
+	IssmDouble ccsnowValue=0.0;
+	IssmDouble cciceValue=0.0;
 	IssmDouble dt,time,smb_dt;
 	int        aIdx=0;
+	int        eIdx=0;
 	int        denIdx=0;
 	int        dsnowIdx=0;
@@ -3635,24 +3816,29 @@
 	IssmDouble initMass=0.0;
    IssmDouble sumR=0.0;
-   IssmDouble sumM=0.0;
+	IssmDouble sumF=0.0;
+	IssmDouble sumM=0.0;
 	IssmDouble sumMsurf=0.0;
-   IssmDouble sumEC=0.0;
-   IssmDouble sumP=0.0;
-   IssmDouble sumW=0.0;
-   IssmDouble sumMassAdd=0.0;
+	IssmDouble sumEC=0.0;
+	IssmDouble sumP=0.0;
+	IssmDouble sumRa=0.0;
+	IssmDouble sumW=0.0;
+	IssmDouble sumMassAdd=0.0;
 	IssmDouble fac=0.0;
 	IssmDouble sumMass=0.0;
 	IssmDouble dMass=0.0;
 	IssmDouble accsumR=0.0;
+	IssmDouble accsumF=0.0;
 	IssmDouble accsumM=0.0;
 	IssmDouble accsumSMB=0.0;
 	IssmDouble accsumEC=0.0;
 	IssmDouble accsumP=0.0;
+	IssmDouble accsumRa=0.0;
 	bool isgraingrowth,isalbedo,isshortwave,isthermal,isaccumulation,ismelt,isdensification,isturbulentflux;
-	bool isclimatology=false;
 	bool isconstrainsurfaceT=false;
+	bool isdeltaLWup=false;
 	IssmDouble init_scaling=0.0;
 	IssmDouble thermo_scaling=1.0;
 	IssmDouble adThresh=1023.0;
+	IssmDouble teThresh=10;
 	/*}}}*/
 	/*Output variables:{{{ */
@@ -3671,4 +3857,5 @@
 	IssmDouble* W = NULL;
 	IssmDouble* a = NULL;
+	IssmDouble* adiff = NULL;
 	IssmDouble* swf=NULL;
 	IssmDouble* T = NULL;
@@ -3677,4 +3864,6 @@
 	IssmDouble  Msurf = 0.0;
 	IssmDouble  R = 0.0;
+	IssmDouble  F = 0.0;
+	IssmDouble  Ra = 0.0;
 	IssmDouble  mAdd = 0.0;
 	IssmDouble  dz_add = 0.0;
@@ -3686,4 +3875,5 @@
 	IssmDouble* Wini = NULL;
 	IssmDouble* aini = NULL;
+	IssmDouble* adiffini = NULL;
 	IssmDouble* Tini = NULL;
 	int         m=0;
@@ -3700,4 +3890,5 @@
 	parameters->FindParam(&smb_dt,SmbDtEnum);                     /*time period for the smb solution,  usually smaller than the glaciological dt*/
 	parameters->FindParam(&aIdx,SmbAIdxEnum);
+	parameters->FindParam(&eIdx,SmbEIdxEnum);
 	parameters->FindParam(&denIdx,SmbDenIdxEnum);
 	parameters->FindParam(&swIdx,SmbSwIdxEnum);
@@ -3716,7 +3907,9 @@
 	parameters->FindParam(&isturbulentflux,SmbIsturbulentfluxEnum);
 	parameters->FindParam(&isconstrainsurfaceT,SmbIsconstrainsurfaceTEnum);
+	parameters->FindParam(&isdeltaLWup,SmbIsdeltaLWupEnum);
 	parameters->FindParam(&init_scaling,SmbInitDensityScalingEnum);
 	parameters->FindParam(&thermo_scaling,SmbThermoDeltaTScalingEnum);
 	parameters->FindParam(&adThresh,SmbAdThreshEnum);
+	parameters->FindParam(&teThresh,SmbTeThreshEnum);
 	/*}}}*/
 	/*Retrieve inputs: {{{*/
@@ -3764,4 +3957,5 @@
 		this->inputs->GetArray(SmbWiniEnum,this->lid,&Wini,&m);
 		this->inputs->GetArray(SmbAiniEnum,this->lid,&aini,&m);
+		this->inputs->GetArray(SmbAdiffiniEnum,this->lid,&adiffini,&m);
 		this->inputs->GetArray(SmbTiniEnum,this->lid,&Tini,&m);
 		EC_input = this->GetInput(SmbECiniEnum);  _assert_(EC_input);
@@ -3783,4 +3977,5 @@
 			W = xNew<IssmDouble>(m); for(int i=0;i<m;i++)W[i]=Wini[0];             //set water content to zero [kg m-2]
 			a = xNew<IssmDouble>(m); for(int i=0;i<m;i++)a[i]=aini[0];         //set albedo equal to fresh snow [fraction]
+			adiff = xNew<IssmDouble>(m); for(int i=0;i<m;i++)adiff[i]=adiffini[0];         //set diffusive albedo equal to 1 [fraction]
 			T = xNew<IssmDouble>(m); for(int i=0;i<m;i++)T[i]=Tmean;         //set initial grid cell temperature to the annual mean temperature [K]
 			/*/!\ Default value of T can not be retrived from SMBgemb.m (like other snow properties)
@@ -3801,4 +3996,5 @@
 			W = xNew<IssmDouble>(m);for(int i=0;i<m;i++)W[i]=Wini[i];
 			a = xNew<IssmDouble>(m);for(int i=0;i<m;i++)a[i]=aini[i];
+			adiff = xNew<IssmDouble>(m);for(int i=0;i<m;i++)adiff[i]=adiffini[i];
 			T = xNew<IssmDouble>(m);for(int i=0;i<m;i++)T[i]=Tini[i];
 
@@ -3812,4 +4008,6 @@
 		this->SetElementInput(SmbAccumulatedMeltEnum,0.0);
 		this->SetElementInput(SmbAccumulatedRunoffEnum,0.0);
+		this->SetElementInput(SmbAccumulatedRefreezeEnum,0.0);
+		this->SetElementInput(SmbAccumulatedRainEnum,0.0);
 		this->SetElementInput(SmbAccumulatedPrecipitationEnum,0.0);
 
@@ -3826,4 +4024,5 @@
 		this->inputs->GetArray(SmbWEnum,this->lid,&W,&m);
 		this->inputs->GetArray(SmbAEnum,this->lid,&a,&m);
+		this->inputs->GetArray(SmbAdiffEnum,this->lid,&adiff,&m);
 		this->inputs->GetArray(SmbTEnum,this->lid,&T,&m);
 		EC_input = this->GetInput(SmbECDtEnum);  _assert_(EC_input);
@@ -3839,5 +4038,5 @@
 
 	// initialize cumulative variables
-	sumR = 0; sumM = 0; sumEC = 0; sumP = 0; sumMassAdd = 0; sumMsurf = 0;
+	sumR = 0; sumF=0; sumM = 0; sumEC = 0; sumP = 0; sumMassAdd = 0; sumMsurf = 0; sumRa = 0;
 
 	//before starting loop, realize that the transient core runs this smb_core at time = time +deltaT.
@@ -3852,4 +4051,6 @@
 		Input *sumM_input          = this->GetInput(SmbMeltEnum);  _assert_(sumM_input);
 		Input *sumR_input          = this->GetInput(SmbRunoffEnum);  _assert_(sumR_input);
+		Input *sumF_input          = this->GetInput(SmbRefreezeEnum);  _assert_(sumF_input);
+		Input *sumRa_input         = this->GetInput(SmbRainEnum);  _assert_(sumRa_input);
 		Input *sumP_input          = this->GetInput(SmbPrecipitationEnum);  _assert_(sumP_input);
 		Input *ULW_input           = this->GetInput(SmbMeanULWEnum);  _assert_(ULW_input);
@@ -3880,4 +4081,8 @@
 		sumR_input->GetInputAverage(&sumR);
 		sumR=sumR*dt*rho_ice;
+		sumF_input->GetInputAverage(&sumF);
+		sumF=sumF*dt*rho_ice;
+		sumRa_input->GetInputAverage(&sumRa);
+		sumRa=sumRa*dt*rho_ice;
 		sumP_input->GetInputAverage(&sumP);
 		sumP=sumP*dt*rho_ice;
@@ -3890,4 +4095,5 @@
 	Input *Dlwr_input= this->GetInput(SmbDlwrfEnum,timeinputs); _assert_(Dlwr_input);
 	Input *Dswr_input= this->GetInput(SmbDswrfEnum,timeinputs); _assert_(Dswr_input);
+	Input *Dswrdiff_input= this->GetInput(SmbDswdiffrfEnum,timeinputs); _assert_(Dswrdiff_input);
 	Input *P_input   = this->GetInput(SmbPEnum,timeinputs);     _assert_(P_input);
 	Input *eAir_input= this->GetInput(SmbEAirEnum,timeinputs);  _assert_(eAir_input);
@@ -3895,4 +4101,9 @@
 	Input *teValue_input= this->GetInput(SmbTeValueEnum,timeinputs); _assert_(teValue_input);
 	Input *aValue_input= this->GetInput(SmbAValueEnum,timeinputs); _assert_(aValue_input);
+	Input *dulwrfValue_input= this->GetInput(SmbDulwrfValueEnum,timeinputs); _assert_(dulwrfValue_input);
+	Input *szaValue_input= this->GetInput(SmbSzaValueEnum,timeinputs); _assert_(szaValue_input);
+	Input *cotValue_input= this->GetInput(SmbCotValueEnum,timeinputs); _assert_(cotValue_input);
+	Input *ccsnowValue_input= this->GetInput(SmbCcsnowValueEnum,timeinputs); _assert_(ccsnowValue_input);
+	Input *cciceValue_input= this->GetInput(SmbCciceValueEnum,timeinputs); _assert_(cciceValue_input);
 
 	/*extract daily data:{{{*/
@@ -3901,9 +4112,15 @@
 	Dlwr_input->GetInputValue(&dlw,gauss);   //downward longwave radiation flux [W m-2]
 	Dswr_input->GetInputValue(&dsw,gauss);   //downward shortwave radiation flux [W m-2]
+	Dswrdiff_input->GetInputValue(&dswdiff,gauss);   //downward shortwave diffuse radiation flux [W m-2]
 	P_input->GetInputValue(&P,gauss);        //precipitation [kg m-2]
 	eAir_input->GetInputValue(&eAir,gauss);  //screen level vapor pressure [Pa]
 	pAir_input->GetInputValue(&pAir,gauss);  // screen level air pressure [Pa]
 	teValue_input->GetInputValue(&teValue,gauss);  // Emissivity [0-1]
+	dulwrfValue_input->GetInputValue(&dulwrfValue,gauss);  // LWup perturbation [W m-2]
 	aValue_input->GetInputValue(&aValue,gauss);  // Albedo [0 1]
+	szaValue_input->GetInputValue(&szaValue,gauss);  // Solar Zenith Angle [degree]
+	cotValue_input->GetInputValue(&cotValue,gauss);  // Cloud Optical Thickness
+	ccsnowValue_input->GetInputValue(&ccsnowValue,gauss); //concentration of light absorbing carbon for snow [ppm1]
+	cciceValue_input->GetInputValue(&cciceValue,gauss); //concentration of light absorbing carbon for ice [ppm1]
 	//_printf_("Time: " << t << " Ta: " << Ta << " V: " << V << " dlw: " << dlw << " dsw: " << dsw << " P: " << P << " eAir: " << eAir << " pAir: " << pAir << "\n");
 	/*}}}*/
@@ -3913,8 +4130,8 @@
 
 	/*Snow, firn and ice albedo:*/
-	if(isalbedo)albedo(&a,aIdx,re,dz,d,cldFrac,aIce,aSnow,aValue,adThresh,T,W,P,EC,Msurf,t0wet,t0dry,K,smb_dt,rho_ice,m,this->Sid());
+	if(isalbedo)albedo(&a,&adiff,aIdx,re,dz,d,cldFrac,aIce,aSnow,aValue,adThresh,T,W,P,EC,Msurf,ccsnowValue,cciceValue,szaValue,cotValue,t0wet,t0dry,K,smb_dt,rho_ice,m,this->Sid());
 
 	/*Distribution of absorbed short wave radation with depth:*/
-	if(isshortwave)shortwave(&swf, swIdx, aIdx, dsw, a[0], d, dz, re,rho_ice,m,this->Sid());
+	if(isshortwave)shortwave(&swf, swIdx, aIdx, dsw, dswdiff, a[0], adiff[0], d, dz, re,rho_ice,m,this->Sid());
 
 	/*Calculate net shortwave [W m-2]*/
@@ -3926,5 +4143,5 @@
 	}
 	/*Thermal profile computation:*/
-	if(isthermal)thermo(&EC, &T, &ulw, dz, d, swf, dlw, Ta, V, eAir, pAir, teValue, W[0], smb_dt, m, Vz, Tz, thermo_scaling,rho_ice,this->Sid(),isconstrainsurfaceT);
+	if(isthermal)thermo(&EC, &T, &ulw, re, dz, d, swf, dlw, Ta, V, eAir, pAir, eIdx, teValue, dulwrfValue, teThresh, W[0], smb_dt, m, Vz, Tz, thermo_scaling,rho_ice,this->Sid(),isconstrainsurfaceT,isdeltaLWup);
 
 	/*Change in thickness of top cell due to evaporation/condensation  assuming same density as top cell.
@@ -3933,9 +4150,9 @@
 
 	/*Add snow/rain to top grid cell adjusting cell depth, temperature and density*/
-	if(isaccumulation)accumulation(&T, &dz, &d, &W, &a, &re, &gdn, &gsp, &m, aIdx, dsnowIdx, Tmean, Ta, P, dzMin, aSnow, C, V, Vmean, rho_ice,this->Sid());
+	if(isaccumulation)accumulation(&T, &dz, &d, &W, &a, &adiff, &re, &gdn, &gsp, &Ra, &m, aIdx, dsnowIdx, Tmean, Ta, P, dzMin, aSnow, C, V, Vmean, rho_ice,this->Sid());
 
 	/*Calculate water production, M [kg m-2] resulting from snow/ice temperature exceeding 273.15 deg K
 	 * (> 0 deg C), runoff R [kg m-2] and resulting changes in density and determine wet compaction [m]*/
-	if(ismelt)melt(&M, &Msurf, &R, &mAdd, &dz_add, &T, &d, &dz, &W, &a, &re, &gdn, &gsp, &m, dzMin, zMax, zMin, zTop, zY, rho_ice,this->Sid());
+	if(ismelt)melt(&M, &Msurf, &R, &F, &mAdd, &dz_add, &T, &d, &dz, &W, &a, &adiff, &re, &gdn, &gsp, &m, Ra, dzMin, zMax, zMin, zTop, zY, rho_ice,this->Sid());
 
 	/*Allow non-melt densification and determine compaction [m]*/
@@ -3967,4 +4184,5 @@
 					<< "lwf[" << netLW << "] "
 					<< "a[" << a << "] "
+					<< "adiff[" << adiff << "] "
 					<< "te[" << teValue << "] "
 					<< "\n");
@@ -3981,5 +4199,7 @@
 	sumW = cellsum(W,m);
 	sumP = P +  sumP;
-	sumEC = sumEC + EC;  // evap (-)/cond(+)
+	sumEC = EC + sumEC;  // evap (-)/cond(+)
+	sumRa = Ra + sumRa;
+	sumF = F + sumF;
 
 	/*Calculate total system mass:*/
@@ -4000,5 +4220,6 @@
 	/*Check mass conservation:*/
 	if (dMass != 0.0){
-		_printf_("total system mass not conserved in MB function \n");
+		_printf_("Time: " << setprecision(8) << timeinputs/365.0/24.0/3600.0 << ",total system mass not conserved in MB function \n");
+		_printf_("sumMass: " << sumMass << " sumR: " << sumR << " sumW: " << sumW << " sumP: " << sumP << " sumEC: " << sumEC << " initMass: " << initMass << " sumMassAdd: " << sumMassAdd << " \n");
 	}
 	#endif
@@ -4012,13 +4233,17 @@
    Input *accsumEC_input         = this->GetInput(SmbAccumulatedECEnum);  _assert_(accsumEC_input);
    Input *accsumM_input          = this->GetInput(SmbAccumulatedMeltEnum);  _assert_(accsumM_input);
-   Input *accsumR_input          = this->GetInput(SmbAccumulatedRunoffEnum);  _assert_(accsumR_input);
-   Input *accsumP_input          = this->GetInput(SmbAccumulatedPrecipitationEnum);  _assert_(accsumP_input);
-   Input *accsumSMB_input        = this->GetInput(SmbAccumulatedMassBalanceEnum);  _assert_(accsumP_input);
+	Input *accsumR_input          = this->GetInput(SmbAccumulatedRunoffEnum);  _assert_(accsumR_input);
+	Input *accsumF_input          = this->GetInput(SmbAccumulatedRefreezeEnum);  _assert_(accsumF_input);
+	Input *accsumRa_input         = this->GetInput(SmbAccumulatedRainEnum);  _assert_(accsumRa_input);
+	Input *accsumP_input          = this->GetInput(SmbAccumulatedPrecipitationEnum);  _assert_(accsumP_input);
+	Input *accsumSMB_input        = this->GetInput(SmbAccumulatedMassBalanceEnum);  _assert_(accsumSMB_input);
 
    accsumEC_input->GetInputAverage(&accsumEC);
-   accsumM_input->GetInputAverage(&accsumM);
-   accsumR_input->GetInputAverage(&accsumR);
-   accsumP_input->GetInputAverage(&accsumP);
-   accsumSMB_input->GetInputAverage(&accsumSMB);
+	accsumM_input->GetInputAverage(&accsumM);
+	accsumR_input->GetInputAverage(&accsumR);
+	accsumF_input->GetInputAverage(&accsumF);
+	accsumRa_input->GetInputAverage(&accsumRa);
+	accsumP_input->GetInputAverage(&accsumP);
+	accsumSMB_input->GetInputAverage(&accsumSMB);
 
 	this->SetElementInput(SmbAccumulatedECEnum,accsumEC+EC/rho_ice);
@@ -4026,4 +4251,6 @@
 	this->SetElementInput(SmbAccumulatedMeltEnum,accsumM+M/rho_ice);
 	this->SetElementInput(SmbAccumulatedRunoffEnum,accsumR+R/rho_ice);
+	this->SetElementInput(SmbAccumulatedRefreezeEnum,accsumF+F/rho_ice);
+	this->SetElementInput(SmbAccumulatedRainEnum,accsumRa+Ra/rho_ice);
 	this->SetElementInput(SmbAccumulatedPrecipitationEnum,accsumP+P/rho_ice);
    /*}}}*/
@@ -4038,8 +4265,11 @@
 	this->inputs->SetArrayInput(SmbWEnum,this->lid,W,m);
 	this->inputs->SetArrayInput(SmbAEnum,this->lid,a,m);
+	this->inputs->SetArrayInput(SmbAdiffEnum,this->lid,adiff,m);
 	this->SetElementInput(SmbECEnum,sumEC/dt/rho_ice);
 	this->SetElementInput(SmbMassBalanceEnum,(sumP + sumEC -sumR)/dt/rho_ice);
 	this->SetElementInput(SmbMeltEnum,sumM/dt/rho_ice);
 	this->SetElementInput(SmbRunoffEnum,sumR/dt/rho_ice);
+	this->SetElementInput(SmbRefreezeEnum,sumF/dt/rho_ice);
+	this->SetElementInput(SmbRainEnum,sumRa/dt/rho_ice);
 	this->SetElementInput(SmbPrecipitationEnum,sumP/dt/rho_ice);
 	this->SetElementInput(SmbMeanULWEnum,meanULW);
@@ -4064,4 +4294,5 @@
 	if(W) xDelete<IssmDouble>(W);
 	if(a) xDelete<IssmDouble>(a);
+	if(adiff) xDelete<IssmDouble>(adiff);
 	if(T) xDelete<IssmDouble>(T);
 	if(dzini) xDelete<IssmDouble>(dzini);
@@ -4072,4 +4303,5 @@
 	if(Wini) xDelete<IssmDouble>(Wini);
 	if(aini) xDelete<IssmDouble>(aini);
+	if(adiffini) xDelete<IssmDouble>(adiffini);
 	if(Tini) xDelete<IssmDouble>(Tini);
 	if(swf) xDelete<IssmDouble>(swf);
@@ -4182,4 +4414,49 @@
 
 }/*}}}*/
+void       Element::StrainRateMLHO(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vxbase_input,Input* vybase_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input,IssmDouble zeta){/*{{{*/
+	/*Compute the 2d Blatter/MLHO Strain Rate (5 components) for a given vertical coordinate (zeta):
+	 *
+	 * epsilon=[exx eyy exy exz eyz]
+	 *
+	 * with exz=1/2 du/dz
+	 *      eyz=1/2 dv/dz
+	 *
+	 * the contribution of vz is neglected
+	 *
+	 * zeta = (surface - z)/thickness 
+	 * i.e., zeta=0 <=> ice surface
+	 * i.e., zeta=1 <=> ice base
+	 */
+
+	/*Intermediaries*/
+	IssmDouble dvxb[2];  // [dvx/dx, dvx/dy] at the base
+	IssmDouble dvyb[2];  // [dvy/dx, dvy/dy] at the base
+	IssmDouble dvxsh[2]; // [dvx/dx, dvx/dy] at the surface (only the shear)
+	IssmDouble dvysh[2]; // [dvy/dx, dvy/dy] at the surface (only the shear)
+	IssmDouble vxsh,vysh; // shear vx and shear at the surface
+	IssmDouble thickness,n;
+
+	/*Check that both inputs have been found*/
+	if (!vxbase_input || !vybase_input || !vxshear_input || !vyshear_input || !thickness_input || !n_input){
+		_error_("Input missing. Here are the input pointers we have for vxb: " << vxbase_input << ", vyb: " << vybase_input << ", vxshear: " << vxshear_input << ", vyshear: " << vyshear_input << ", thickness: " << thickness_input << ", n: " << n_input<< "\n");
+	}
+
+	/*Get strain rate assuming that epsilon has been allocated*/
+	vxbase_input->GetInputDerivativeValue(&dvxb[0],xyz_list,gauss);
+	vybase_input->GetInputDerivativeValue(&dvyb[0],xyz_list,gauss);
+	vxshear_input->GetInputDerivativeValue(&dvxsh[0],xyz_list,gauss);
+	vyshear_input->GetInputDerivativeValue(&dvysh[0],xyz_list,gauss);
+	thickness_input->GetInputValue(&thickness,gauss); _assert_(thickness>0);
+   vxshear_input->GetInputValue(&vxsh,gauss);
+   vyshear_input->GetInputValue(&vysh,gauss);
+   n_input->GetInputValue(&n,gauss);
+
+	epsilon[0] = dvxb[0] + dvxsh[0]*( 1 - pow(zeta,n+1) );
+	epsilon[1] = dvyb[1] + dvysh[1]*( 1 - pow(zeta,n+1) );
+	epsilon[2] = 0.5*( dvxb[1] + dvxsh[1]*( 1 - pow(zeta,n+1) ) + dvyb[0] + dvysh[0]*( 1 - pow(zeta,n+1) ) ); 
+	epsilon[3] = 0.5*(vxsh/thickness)*(n+1)*pow(zeta,n);
+	epsilon[4] = 0.5*(vysh/thickness)*(n+1)*pow(zeta,n);
+
+}/*}}}*/
 void       Element::StrainRateSSA(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){/*{{{*/
 
@@ -4232,6 +4509,5 @@
 	/*Fetch number vertices and allocate memory*/
 	const int NUM_VERTICES  = this->GetNumberOfVertices();
-
-	IssmDouble* maxprincipal = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble maxprincipal[MAXVERTICES];
 
 	/*Retrieve all inputs and parameters*/
@@ -4251,5 +4527,5 @@
 	/*loop over vertices: */
 	Gauss* gauss=this->NewGauss();
-	for (int iv=0;iv<NUM_VERTICES;iv++){
+	for(int iv=0;iv<NUM_VERTICES;iv++){
 		gauss->GaussVertex(iv);
 
@@ -4296,8 +4572,7 @@
 
 	/*Create input*/
-	this->AddInput(StressMaxPrincipalEnum,maxprincipal,P1Enum);
+	this->AddInput(StressMaxPrincipalEnum,&maxprincipal[0],P1Enum);
 
 	/*Clean up and return*/
-	xDelete<IssmDouble>(maxprincipal);
 	xDelete<IssmDouble>(xyz_list);
 	delete gauss;
@@ -4374,6 +4649,6 @@
 
 	/*Copy current stiffness matrix*/
-	values=xNew<IssmDouble>(Ke->nrows*Ke->ncols);
-	for(i=0;i<Ke->nrows;i++) for(j=0;j<Ke->ncols;j++) values[i*Ke->ncols+j]=Ke->values[i*Ke->ncols+j];
+	values=xNew<IssmDouble>(Ke->nrows*Ke->nrows);
+	for(i=0;i<Ke->nrows;i++) for(j=0;j<Ke->nrows;j++) values[i*Ke->nrows+j]=Ke->values[i*Ke->nrows+j];
 
 	/*Get Coordinate Systems transform matrix*/
@@ -4382,5 +4657,5 @@
 	/*Transform matrix: R*Ke*R^T */
 	TripleMultiply(transform,numdofs,numdofs,0,
-				values,Ke->nrows,Ke->ncols,0,
+				values,Ke->nrows,Ke->nrows,0,
 				transform,numdofs,numdofs,1,
 				&Ke->values[0],0);
@@ -4550,6 +4825,6 @@
 
 	/*Copy current stiffness matrix*/
-	values=xNew<IssmDouble>(Ke->nrows*Ke->ncols);
-	for(int i=0;i<Ke->nrows*Ke->ncols;i++) values[i]=Ke->values[i];
+	values=xNew<IssmDouble>(Ke->nrows*Ke->nrows);
+	for(int i=0;i<Ke->nrows*Ke->nrows;i++) values[i]=Ke->values[i];
 
 	/*Get Coordinate Systems transform matrix*/
@@ -4558,5 +4833,5 @@
 	/*Transform matrix: R^T*Ke*R */
 	TripleMultiply(transform,numdofs,numdofs,1,
-				values,Ke->nrows,Ke->ncols,0,
+				values,Ke->nrows,Ke->nrows,0,
 				transform,numdofs,numdofs,0,
 				&Ke->values[0],0);
@@ -4575,6 +4850,5 @@
 	/*Fetch number vertices and allocate memory*/
 	const int NUM_VERTICES = this->GetNumberOfVertices();
-
-	IssmDouble* viscousheating = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble viscousheating[MAXVERTICES];
 
 	/*Retrieve all inputs and parameters*/
@@ -4595,8 +4869,7 @@
 
 	/*Create PentaVertex input, which will hold the basal friction:*/
-	this->AddInput(ViscousHeatingEnum,viscousheating,P1Enum);
+	this->AddInput(ViscousHeatingEnum,&viscousheating[0],P1Enum);
 
 	/*Clean up and return*/
-	xDelete<IssmDouble>(viscousheating);
 	xDelete<IssmDouble>(xyz_list);
 	delete gauss;
@@ -4683,6 +4956,6 @@
 	IssmDouble  kappa,kappa_c,kappa_t;  //enthalpy conductivities
 	IssmDouble  Hc,Ht;
-	IssmDouble* PIE   = xNew<IssmDouble>(numvertices);
-	IssmDouble* dHpmp = xNew<IssmDouble>(numvertices);
+	IssmDouble PIE[MAXVERTICES];
+	IssmDouble dHpmp[MAXVERTICES];
 
 	for(int iv=0; iv<numvertices; iv++){
@@ -4720,6 +4993,4 @@
 
 	/*Clean up and return*/
-	xDelete<IssmDouble>(PIE);
-	xDelete<IssmDouble>(dHpmp);
 	return kappa;
 }
Index: /issm/trunk/src/c/classes/Elements/Element.h
===================================================================
--- /issm/trunk/src/c/classes/Elements/Element.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Elements/Element.h	(revision 26744)
@@ -23,4 +23,5 @@
 class Materials;
 class Material;
+class Matlitho;
 class Inputs;
 class Inputs;
@@ -30,6 +31,7 @@
 class DatasetInput;
 class IoModel;
-class SealevelMasks;
+class SealevelGeometry;
 class Gauss;
+class GrdLoads;
 class ElementVector;
 template <class doublematrix> class Matrix;
@@ -37,4 +39,5 @@
 class ElementMatrix;
 class ElementVector;
+class BarystaticContributions;
 /*}}}*/
 
@@ -65,4 +68,6 @@
 		/*bool               AnyActive(void);*/
 		bool               AnyFSet(void);
+		void					 AutoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,int enum_type);
+      void               Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,bool isfieldstochastic,int enum_type);
 		void               ComputeLambdaS(void);
 		void               ComputeNewDamage();
@@ -78,4 +83,5 @@
 		void               dViscositydBHO(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
 		void               dViscositydBSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+		void               dViscositydBMLHO(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vxbase_input,Input* vybase_input, Input* vxshear_input ,Input* vyshear_input,Input* thickness_input,Input* n_input, IssmDouble zeta);
 		void               dViscositydDSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
 		void               Echo();
@@ -129,4 +135,5 @@
 		int                Id();
 		void               InputCreate(IssmDouble* vector,Inputs* inputs,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code);
+		void               InputCreateP1FromConstant(Inputs* inputs,IoModel* iomodel,IssmDouble value,int vector_enum);
 		void               ControlInputCreate(IssmDouble* doublearray,IssmDouble* independents_min,IssmDouble* independents_max,Inputs*inputs,IoModel* iomodel,int M,int N,IssmDouble scale,int input_enum,int id);
 		void					 DatasetInputAdd(int enum_type,IssmDouble* vector,Inputs* inputs,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code,int input_enum);
@@ -134,6 +141,7 @@
 		void               InputUpdateFromConstant(int constant, int name);
 		void               InputUpdateFromConstant(bool constant, int name);
-
-		bool               IsFloating();
+		void               InputUpdateFromConstant(IssmDouble constant, int name, int type);
+
+		bool               IsAllFloating();
 		bool               IsGrounded();
 		bool               IsOnBase();
@@ -142,4 +150,5 @@
 		bool               IsIceOnlyInElement();
 		bool               IsOceanInElement();
+		bool               IsOceanOnlyInElement();
 		bool               IsLandInElement();
 		void               Ismip6FloatingiceMeltingRate();
@@ -160,4 +169,5 @@
 		void               PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm,bool issetpddfac);
 		void               PositiveDegreeDaySicopolis(bool isfirnwarming);
+		void               RignotMeltParameterization();
 		void               ResultInterpolation(int* pinterpolation,int*nodesperelement,int* parray_size, int output_enum);
 		void               ResultToPatch(IssmDouble* values,int nodesperelement,int output_enum);
@@ -175,4 +185,5 @@
 		void               StrainRateHO(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
 		void               StrainRateHO2dvertical(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+		void               StrainRateMLHO(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input,IssmDouble zeta);
 		void               StrainRateSSA(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
 		void               StrainRateSSA1d(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input);
@@ -209,5 +220,4 @@
 		IssmDouble         PureIceEnthalpy(IssmDouble pressure);
 
-
 		/*Virtual functions*/
 		virtual void       AddBasalInput(int input_enum, IssmDouble* values, int interpolation_enum){_error_("not implemented");};
@@ -235,4 +245,6 @@
 		virtual void       ElementResponse(IssmDouble* presponse,int response_enum)=0;
 		virtual void       ElementSizes(IssmDouble* phx,IssmDouble* phy,IssmDouble* phz)=0;
+		virtual void       ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze, Vector<IssmDouble>* vareae, bool spherical=false)=0;
+		virtual void       ElementCoordinates(Vector<IssmDouble>* vlonge,Vector<IssmDouble>* vlate,Vector<IssmDouble>* vareae)=0;
 		virtual int        FiniteElement(void)=0;
 		virtual IssmDouble FloatingArea(bool scaled)=0;
@@ -243,4 +255,9 @@
 		virtual void       GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating)=0;
 		virtual IssmDouble GetGroundedPortion(IssmDouble* xyz_list)=0;
+		virtual void        GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl)=0;
+		virtual void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelsetenum)=0;
+		virtual void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area, int levelset1enum, int levelset2enum)=0;
+		virtual void        GetBarycenterFromLevelset(IssmDouble* platbar, IssmDouble* plongbar,IssmDouble phi,IssmDouble fraction1,IssmDouble fraction2,IssmDouble late, IssmDouble longe, int point1,int istrapeze1, IssmDouble planetradius)=0;
+
 		virtual IssmDouble GetIcefrontArea(){_error_("not implemented");};
 		virtual void       GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum)=0;
@@ -297,4 +314,5 @@
 		virtual IssmDouble Misfit(int modelenum,int observationenum,int weightsenum)=0;
 		virtual IssmDouble MisfitArea(int weightsenum)=0;
+		virtual void	   MovingFrontalVelocity(void){_error_("not implemented yet");};
 		virtual Gauss*     NewGauss(void)=0;
 		virtual Gauss*     NewGauss(int order)=0;
@@ -325,9 +343,10 @@
 		virtual void       PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding)=0;
 		virtual int        PressureInterpolation()=0;
+      virtual void       Recover3DMLHOInput(int targetVel_enum, int numnodes, IssmDouble* vb,  IssmDouble* vsh, IssmDouble* n, IssmDouble* H, IssmDouble* s){_error_("not implemented yet");};
 		virtual void       ReduceMatrices(ElementMatrix* Ke,ElementVector* pe)=0;
 		virtual void       ResetFSBasalBoundaryCondition()=0;
 		virtual void       ResetHooks()=0;
-		virtual void       RignotMeltParameterization(void){_error_("not implemented yet");};
-		virtual void       SetElementInput(int enum_in,IssmDouble values){_error_("not implemented yet");};
+		virtual void       SetElementInput(int enum_in,IssmDouble value){_error_("not implemented yet");};
+		virtual void       SetElementInput(int enum_in,IssmDouble value, int type)=0;
 		virtual void       SetElementInput(Inputs* inputs,int enum_in,IssmDouble values){_error_("not implemented yet");};
 		virtual void       SetElementInput(Inputs* inputs,int numindices,int* indices,IssmDouble* values,int enum_in){_error_("not implemented yet");};
@@ -337,4 +356,5 @@
 	   virtual Element*   SpawnBasalElement(bool depthaverage_materials=false)=0;
 		virtual Element*   SpawnTopElement(void)=0;
+		virtual bool       IsSpawnedElement(void)=0;
 		virtual IssmDouble StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa)=0;
 		virtual void       StabilizationParameterAnisotropic(IssmDouble* tau_parameter_anisotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa)=0;
@@ -364,23 +384,26 @@
 		virtual void       WriteFieldIsovalueSegment(DataSet* segments,int fieldenum,IssmDouble fieldvalue){_error_("not implemented yet");};
 
-		#ifdef _HAVE_GIA_
-		virtual void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y)=0;
-		#endif
 		#ifdef _HAVE_ESA_
 		virtual void          EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast, Vector<IssmDouble>* pX, Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy)=0;
 		virtual void          EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz)=0;
 		#endif
-		#ifdef _HAVE_SEALEVELRISE_
-		virtual void          SetSealevelMasks(SealevelMasks* masks)=0;
+		#ifdef _HAVE_SEALEVELCHANGE_
 		virtual IssmDouble    GetArea3D(void)=0;
 		virtual IssmDouble    GetAreaSpherical(void)=0;
-		virtual IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks)=0;
-		virtual void          SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks)=0;
-		virtual IssmDouble    SealevelriseEustaticIce(IssmDouble* Sgi, SealevelMasks* masks,Vector<IssmDouble>* barystatic_contribution,IssmDouble* partition,IssmDouble oceanarea)=0;
-		virtual IssmDouble    SealevelriseEustaticHydro(IssmDouble* Sgi, SealevelMasks* masks,Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea)=0;
-		virtual void          SealevelriseEustaticBottomPressure(IssmDouble* Sgi, SealevelMasks* masks)=0;
-		virtual void          SealevelriseGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz)=0;
-		virtual void          SealevelriseNonEustatic(IssmDouble* Sgo, IssmDouble* Sg_old,SealevelMasks* mask)=0;
-		virtual void          SealevelriseGeodetic(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks)=0;
+		virtual IssmDouble    GetTriangleAreaSpherical(IssmDouble xyz_list[3][3])=0;
+		virtual void          GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y)=0;
+
+		virtual void       SealevelchangeGeometrySubElementKernel(SealevelGeometry* slgeom)=0;
+		virtual void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom)=0;
+		virtual void       SealevelchangeShift(GrdLoads* loads, IssmDouble offset, SealevelGeometry* slgeom)=0;
+		virtual void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae)=0;
+		virtual void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae)=0;
+		virtual void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae)=0;
+		virtual void       SealevelchangeBarystaticLoads(GrdLoads* loads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom)=0;
+		virtual void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
+		virtual void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom)=0;
+		virtual void       SealevelchangeDeformationConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
+		virtual void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom)=0;
+		virtual void       SealevelchangeUpdateViscousFields()=0;
 		#endif
 
Index: /issm/trunk/src/c/classes/Elements/ElementHook.h
===================================================================
--- /issm/trunk/src/c/classes/Elements/ElementHook.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Elements/ElementHook.h	(revision 26744)
@@ -23,5 +23,5 @@
 		~ElementHook();
 		void Marshall(MarshallHandle* marshallhandle);
-		
+
 		void DeepEcho();
 		void Echo();
Index: /issm/trunk/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/classes/Elements/Penta.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Elements/Penta.cpp	(revision 26744)
@@ -220,4 +220,7 @@
 	/*Call inputs method*/
 	switch(interpolation_enum){
+		case P0Enum:
+			control_input->SetControl(interpolation_enum,1,&this->lid,values,values_min,values_max);
+			break;
 		case P1Enum:
 			control_input->SetControl(interpolation_enum,NUMVERTICES,&vertexlids[0],values,values_min,values_max);
@@ -299,22 +302,22 @@
 
 	/* Start looping on the number of vertices: */
-	GaussPenta* gauss=new GaussPenta();
+	GaussPenta gauss;
 	for(int iv=0;iv<3;iv++){
-		gauss->GaussVertex(iv);
+		gauss.GaussVertex(iv);
 
 		/*Get velocity components and thickness*/
-		B_input->GetInputValue(&B,gauss);
-		n_input->GetInputValue(&n,gauss);
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
-		gr_input->GetInputValue(&groundedice,gauss);
-		bs_input->GetInputValue(&bed,gauss);
-		smax_fl_input->GetInputValue(&sigma_max_floating,gauss);
-		smax_gr_input->GetInputValue(&sigma_max_grounded,gauss);
+		B_input->GetInputValue(&B,&gauss);
+		n_input->GetInputValue(&n,&gauss);
+		vx_input->GetInputValue(&vx,&gauss);
+		vy_input->GetInputValue(&vy,&gauss);
+		gr_input->GetInputValue(&groundedice,&gauss);
+		bs_input->GetInputValue(&bed,&gauss);
+		smax_fl_input->GetInputValue(&sigma_max_floating,&gauss);
+		smax_gr_input->GetInputValue(&sigma_max_grounded,&gauss);
 		vel=sqrt(vx*vx+vy*vy)+1.e-14;
-		sl_input->GetInputValue(&sealevel,gauss);
+		sl_input->GetInputValue(&sealevel,&gauss);
 
 		/*Compute strain rate and viscosity: */
-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
 
 		/*Get Eigen values*/
@@ -359,7 +362,4 @@
 	this->InputExtrude(CalvingCalvingrateEnum,-1);
 	this->InputExtrude(SigmaVMEnum,-1);
-
-	/*Clean up and return*/
-	delete gauss;
 }
 /*}}}*/
@@ -382,15 +382,15 @@
 
 	/* Start looping on the number of vertices: */
-	GaussPenta* gauss=new GaussPenta();
-	for (int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
+	GaussPenta gauss;
+	for(int iv=0;iv<NUMVERTICES;iv++){
+		gauss.GaussVertex(iv);
 
 		/* Get the value we need*/
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
+		vx_input->GetInputValue(&vx,&gauss);
+		vy_input->GetInputValue(&vy,&gauss);
 		vel=vx*vx+vy*vy;
-		strainparallel_input->GetInputValue(&strainparallel,gauss);
-		strainperpendicular_input->GetInputValue(&strainperpendicular,gauss);
-		levermanncoeff_input->GetInputValue(&propcoeff,gauss);
+		strainparallel_input->GetInputValue(&strainparallel,&gauss);
+		strainperpendicular_input->GetInputValue(&strainperpendicular,&gauss);
+		levermanncoeff_input->GetInputValue(&propcoeff,&gauss);
 
 		/*Calving rate proportionnal to the positive product of the strain rate along the ice flow direction and the strain rate perpendicular to the ice flow */
@@ -407,7 +407,4 @@
 	this->AddBasalInput(CalvingrateyEnum,&calvingratey[0],P1DGEnum);
 	this->AddBasalInput(CalvingCalvingrateEnum,&calvingrate[0],P1DGEnum);
-
-	/*Clean up and return*/
-	delete gauss;
 }/*}}}*/
 void       Penta::CalvingFluxLevelset(){/*{{{*/
@@ -761,5 +758,4 @@
 	IssmDouble	tau_yz[NUMVERTICES];
 	IssmDouble	tau_eff[NUMVERTICES];
-	GaussPenta* gauss=NULL;
 
 	/* Get node coordinates and dof list: */
@@ -772,11 +768,11 @@
 
 	/* Start looping on the number of vertices: */
-	gauss=new GaussPenta();
+	GaussPenta gauss;
 	for (int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
+		gauss.GaussVertex(iv);
 
 		/*Compute strain rate viscosity and pressure: */
-		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
-		this->material->ViscosityFS(&viscosity,3,&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
+		this->material->ViscosityFS(&viscosity,3,&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
 
 		/*Compute Stress*/
@@ -802,7 +798,4 @@
 	this->AddInput(DeviatoricStresszzEnum,&tau_zz[0],P1DGEnum);
 	this->AddInput(DeviatoricStresseffectiveEnum,&tau_eff[0],P1DGEnum);
-
-	/*Clean up and return*/
-	delete gauss;
 }
 /*}}}*/
@@ -818,5 +811,4 @@
 	IssmDouble	sigma_xz[NUMVERTICES];
 	IssmDouble	sigma_yz[NUMVERTICES];
-	GaussPenta* gauss=NULL;
 
 	/* Get node coordinates and dof list: */
@@ -830,12 +822,12 @@
 
 	/* Start looping on the number of vertices: */
-	gauss=new GaussPenta();
-	for (int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
+	GaussPenta gauss;
+	for(int iv=0;iv<NUMVERTICES;iv++){
+		gauss.GaussVertex(iv);
 
 		/*Compute strain rate viscosity and pressure: */
-		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
-		this->material->ViscosityFS(&viscosity,3,&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
-		pressure_input->GetInputValue(&pressure,gauss);
+		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
+		this->material->ViscosityFS(&viscosity,3,&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
+		pressure_input->GetInputValue(&pressure,&gauss);
 
 		/*Compute Stress*/
@@ -855,7 +847,4 @@
 	this->AddInput(StressTensoryzEnum,&sigma_yz[0],P1DGEnum);
 	this->AddInput(StressTensorzzEnum,&sigma_zz[0],P1DGEnum);
-
-	/*Clean up and return*/
-	delete gauss;
 }
 /*}}}*/
@@ -952,15 +941,14 @@
 		control_gradient->Serve(NUMVERTICES,&lidlist[0]);
 
-		GaussPenta* gauss=new GaussPenta();
+		GaussPenta gauss;
 		for (int iv=0;iv<NUMVERTICES;iv++){
-			gauss->GaussVertex(iv);
-
-			control_value->GetInputValue(&value,gauss);
-			control_gradient->GetInputValue(&gradient,gauss);
+			gauss.GaussVertex(iv);
+
+			control_value->GetInputValue(&value,&gauss);
+			control_gradient->GetInputValue(&gradient,&gauss);
 
 			values[iv]    = reCast<IssmPDouble>(value)/reCast<IssmPDouble>(connectivity[iv]);
 			gradients[iv] = reCast<IssmPDouble>(gradient)/reCast<IssmPDouble>(connectivity[iv]);
 		}
-		delete gauss;
 
 		vector_control->SetValues(NUMVERTICES,&sidlist[0],&values[0],ADD_VAL);
@@ -1139,11 +1127,11 @@
 
 	/*1. Recover stresses at the base*/
-	GaussPenta* gauss=new GaussPenta();
+	GaussPenta gauss;
 	for (int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
+		gauss.GaussVertex(iv);
 
 		/*Compute strain rate viscosity and pressure: */
-		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
-		this->material->ViscosityFS(&viscosity,3,&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
+		this->material->ViscosityFS(&viscosity,3,&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
 		/*FIXME: this is for Hongju only*/
 		//pressureice[iv]=gravity*rho_ice*(surface[iv]-base[iv]);
@@ -1180,7 +1168,4 @@
 		}
 	}
-
-	/*clean up*/
-	delete gauss;
 }
 /*}}}*/
@@ -1251,4 +1236,84 @@
 	/*return PentaRef field*/
 	return this->element_type;
+}
+/*}}}*/
+void       Penta::GetFractionGeometry2D(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl){/*{{{*/
+
+  /*Compute portion of element that is grounded based on levelset at the 3 lower vertices of the Penta element*/
+   bool               trapezeisnegative=true;
+   int                point;
+   const IssmPDouble  epsilon= 1.e-15;
+   IssmDouble         f1,f2,phi;
+
+   /*Weights*/
+   IssmDouble loadweights_g[NUMVERTICES];
+   IssmDouble total_weight = 0;
+
+   _assert_(!xIsNan<IssmDouble>(gl[0]));
+   _assert_(!xIsNan<IssmDouble>(gl[1]));
+   _assert_(!xIsNan<IssmDouble>(gl[2]));
+
+   /*Be sure that values are not zero*/
+   if(gl[0]==0.) gl[0] = gl[0]+epsilon;
+   if(gl[1]==0.) gl[1] = gl[1]+epsilon;
+   if(gl[2]==0.) gl[2] = gl[2]+epsilon;
+
+   /*Check that not all nodes are positive or negative: */
+   if(gl[0]>0 && gl[1]>0 && gl[2]>0){
+      point = 0;
+      f1    = 1.;
+      f2    = 1.;
+   }
+   else if(gl[0]<0 && gl[1]<0 && gl[2]<0){
+      point = 0;
+      f1    = 0.;
+      f2    = 0.;
+   }
+	else{
+		if(gl[0]*gl[1]*gl[2]<0) trapezeisnegative = false;
+
+		/*Find the similar nodes*/
+		if(gl[0]*gl[1]>0){ 
+			point = 2;
+			f1    = gl[2]/(gl[2]-gl[0]);
+			f2    = gl[2]/(gl[2]-gl[1]);
+		}
+		else if(gl[1]*gl[2]>0){ 
+			point = 0;
+			f1    = gl[0]/(gl[0]-gl[1]);
+			f2    = gl[0]/(gl[0]-gl[2]);
+		}
+		else if(gl[0]*gl[2]>0){ 
+			point = 1;
+			f1    = gl[1]/(gl[1]-gl[2]);
+			f2    = gl[1]/(gl[1]-gl[0]);
+		}
+		else _error_("case not possible");
+	}
+	if(trapezeisnegative) phi = 1.-f1*f2;
+	else                  phi = f1*f2;
+	
+	/*Compute weights*/
+	Gauss* gauss = this->NewGauss(point,f1,f2,1-trapezeisnegative,2);
+
+	total_weight = 0.0;
+	for(int i=0;i<NUMVERTICES2D;i++)weights[i] = 0;
+	while(gauss->next()){
+		GetNodalFunctions(&loadweights_g[0],gauss,P1Enum);
+		for(int i=0;i<NUMVERTICES2D;i++)weights[i] += loadweights_g[i]*gauss->weight;
+		total_weight += gauss->weight;
+	}
+	delete gauss;
+
+	/*Normalizing to phi such that weights provide coefficients for integration over subelement (for averaging:phi*weights)*/
+   if(total_weight>0.) for(int i=0;i<NUMVERTICES2D;i++) weights[i] = weights[i]*phi/total_weight;
+	else for(int i=0;i<NUMVERTICES2D;i++) weights[i] = 0.0;
+	
+	/*Assign output pointers*/
+	*pphi               = phi;
+	*ppoint1            = point;
+	*pfraction1         = f1;
+	*pfraction2         = f2;
+	*ptrapezeisnegative = trapezeisnegative;
 }
 /*}}}*/
@@ -1631,9 +1696,7 @@
 	int index = this->GetNodeIndex(node);
 
-	GaussPenta* gauss=new GaussPenta();
-	gauss->GaussNode(this->element_type,index);
-
-	input->GetInputValue(pvalue,gauss);
-	delete gauss;
+	GaussPenta gauss;
+	gauss.GaussNode(this->element_type,index);
+	input->GetInputValue(pvalue,&gauss);
 }
 /*}}}*/
@@ -1645,9 +1708,7 @@
 	int index = this->GetVertexIndex(vertex);
 
-	GaussPenta* gauss=new GaussPenta();
-	gauss->GaussVertex(index);
-
-	input->GetInputValue(pvalue,gauss);
-	delete gauss;
+	GaussPenta gauss;
+	gauss.GaussVertex(index);
+	input->GetInputValue(pvalue,&gauss);
 }
 /*}}}*/
@@ -1959,5 +2020,4 @@
 	}
 
-
 	/*Some checks in debugging mode*/
 	_assert_(s1>=0 && s1<=1.);
@@ -2074,5 +2134,4 @@
 		_error_("case not possible");
 	}
-
 
 	/*Some checks in debugging mode*/
@@ -2120,22 +2179,57 @@
 	IssmDouble base,height,scalefactor;
 	IssmDouble xyz_list[NUMVERTICES][3];
-
-	if(!IsIceInElement())return 0;
+	IssmDouble lsf[NUMVERTICES];
+
+	if(!IsIceInElement()) return 0;
 
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
 
-	/*First calculate the area of the base (cross section triangle)
-	 * http://en.wikipedia.org/wiki/Pentangle
-	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
-	base = 1./2.*fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
-
-	if(scaled==true){ //scale for area projection correction
-		Input* scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
-		scalefactor_input->GetInputAverage(&scalefactor);
-		base=base*scalefactor;
-	}
-
-	/*Now get the average height*/
-	height = 1./3.*((xyz_list[3][2]-xyz_list[0][2])+(xyz_list[4][2]-xyz_list[1][2])+(xyz_list[5][2]-xyz_list[2][2]));
+	Element::GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
+	/*Deal with partially ice-covered elements*/
+	if(lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0){
+		bool        istrapneg;
+		int         point;
+		IssmDouble  f1,f2,phi;
+		IssmDouble  heights[NUMVERTICES2D];
+		IssmDouble  weights[NUMVERTICES2D];
+		IssmDouble  lsf2d[NUMVERTICES2D];
+		for(int i=0;i<NUMVERTICES2D;i++){
+			heights[i] = xyz_list[i+NUMVERTICES2D][2]-xyz_list[i][2];
+			lsf2d[i]   = lsf[i];
+		}
+		GetFractionGeometry2D(&weights[0],&phi,&point,&f1,&f2,&istrapneg,lsf2d);
+		
+		IssmDouble basetot;
+		height = 0.0;
+		for(int i=0;i<NUMVERTICES2D;i++) height += weights[i]/phi*heights[i];
+		basetot = 1./2.*fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
+		base    = basetot*phi;	
+	
+		/*Account for scaling factor averaged over subelement 2D area*/
+		if(scaled==true){
+			IssmDouble scalefactor_vertices[NUMVERTICES];
+			Element::GetInputListOnVertices(&scalefactor_vertices[0],MeshScaleFactorEnum);
+			/*Compute loop only over lower vertices: i<NUMVERTICES2D*/
+			scalefactor = 0.0;
+			for(int i=0;i<NUMVERTICES2D;i++) scalefactor += weights[i]/phi*scalefactor_vertices[i];
+			base = base*scalefactor;
+		}
+	}
+
+	else{ 
+		/*First calculate the area of the base (cross section triangle)
+		 * http://en.wikipedia.org/wiki/Pentangle
+		 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
+		base = 1./2.*fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
+	
+		if(scaled==true){ //scale for area projection correction
+			Input* scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
+			scalefactor_input->GetInputAverage(&scalefactor);
+			base=base*scalefactor;
+		}
+	
+		/*Now get the average height*/
+		height = 1./3.*((xyz_list[3][2]-xyz_list[0][2])+(xyz_list[4][2]-xyz_list[1][2])+(xyz_list[5][2]-xyz_list[2][2]));
+	}
 
 	/*Return: */
@@ -2150,5 +2244,5 @@
 	IssmDouble xyz_list[NUMVERTICES][3];
 
-	if(!IsIceInElement() || IsFloating() || !IsOnBase())return 0;
+	if(!IsIceInElement() || IsAllFloating() || !IsOnBase())return 0;
 
 	rho_ice=FindParam(MaterialsRhoIceEnum);
@@ -2396,5 +2490,4 @@
 	if(start==+1 && !IsOnSurface()) return;
 
-
 	/*Get original input*/
 	Input* input = this->GetInput(enum_type);
@@ -2747,4 +2840,280 @@
 }
 /*}}}*/
+void	   Penta::MovingFrontalVelocity(void){/*{{{*/
+	if(!this->IsOnBase()) return;
+	int  dim, domaintype, calvinglaw, i;
+	IssmDouble v[3],w[3],c[3],m[3],dlsf[3];
+	IssmDouble norm_dlsf, norm_calving, calvingrate, meltingrate, groundedice;
+	IssmDouble migrationmax, calvinghaf, heaviside, haf_eps;
+	IssmDouble  xyz_list[NUMVERTICES][3];
+	IssmDouble  movingfrontvx[NUMVERTICES];
+	IssmDouble  movingfrontvy[NUMVERTICES];
+	IssmDouble  vel;
+
+	/* Get node coordinates and dof list: */
+	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+
+	Input* vx_input           = NULL;
+	Input* vy_input           = NULL;
+	Input* calvingratex_input = NULL;
+	Input* calvingratey_input = NULL;
+	Input* lsf_slopex_input   = NULL;
+	Input* lsf_slopey_input   = NULL;
+	Input* calvingrate_input  = NULL;
+	Input* meltingrate_input  = NULL;
+	Input* gr_input           = NULL;
+
+	/*Get problem dimension and whether there is moving front or not*/
+	this->FindParam(&domaintype,DomainTypeEnum);
+	this->FindParam(&calvinglaw,CalvingLawEnum);
+
+	switch(domaintype){
+		case Domain2DverticalEnum:   dim = 1; break;
+		case Domain2DhorizontalEnum: dim = 2; break;
+		case Domain3DEnum:           dim = 2; break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+	/*Load velocities*/
+	switch(domaintype){
+		case Domain2DverticalEnum:
+			vx_input=this->GetInput(VxEnum); _assert_(vx_input);
+			break;
+		case Domain2DhorizontalEnum:
+			vx_input=this->GetInput(VxEnum); _assert_(vx_input);
+			vy_input=this->GetInput(VyEnum); _assert_(vy_input);
+			gr_input=this->GetInput(MaskOceanLevelsetEnum); _assert_(gr_input);
+			break;
+		case Domain3DEnum:
+			vx_input=this->GetInput(VxAverageEnum); _assert_(vx_input);
+			vy_input=this->GetInput(VyAverageEnum); _assert_(vy_input);
+			gr_input=this->GetInput(MaskOceanLevelsetEnum); _assert_(gr_input);
+			break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+
+	switch(calvinglaw){
+		case DefaultCalvingEnum:
+		case CalvingVonmisesEnum:
+			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			calvingrate_input = this->GetInput(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
+			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			break;
+		case CalvingLevermannEnum:
+			switch(domaintype){
+				case Domain2DverticalEnum:
+					calvingratex_input=this->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+					break;
+				case Domain2DhorizontalEnum:
+					calvingratex_input=this->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+					calvingratey_input=this->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
+					break;
+				case Domain3DEnum:
+					calvingratex_input=this->GetInput(CalvingratexAverageEnum); _assert_(calvingratex_input);
+					calvingratey_input=this->GetInput(CalvingrateyAverageEnum); _assert_(calvingratey_input);
+					break;
+				default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+			}
+			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			break;
+		case CalvingMinthicknessEnum:
+			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			break;
+		case CalvingHabEnum:
+			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			break;
+		case CalvingCrevasseDepthEnum:
+			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			break;
+		case CalvingDev2Enum:
+			this->FindParam(&calvinghaf,CalvingHeightAboveFloatationEnum);
+			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			calvingrate_input = this->GetInput(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
+			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			break;
+		default:
+			_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
+	}
+
+	/* Start looping on the number of vertices: */
+	GaussPenta gauss;
+	for(int iv=0;iv<NUMVERTICES;iv++){
+		gauss.GaussVertex(iv);
+
+		/* Advection */
+		vx_input->GetInputValue(&v[0],&gauss);
+		vy_input->GetInputValue(&v[1],&gauss);
+		gr_input->GetInputValue(&groundedice,&gauss);
+
+		/*Get calving speed*/
+		switch(calvinglaw){
+			case DefaultCalvingEnum:
+			case CalvingVonmisesEnum:
+				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
+				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
+				calvingrate_input->GetInputValue(&calvingrate,&gauss);
+				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+
+				if(groundedice<0) meltingrate = 0.;
+
+				norm_dlsf=0.;
+				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+				norm_dlsf=sqrt(norm_dlsf);
+
+				if(norm_dlsf>1.e-10)
+				 for(i=0;i<dim;i++){
+					 c[i]=calvingrate*dlsf[i]/norm_dlsf; m[i]=meltingrate*dlsf[i]/norm_dlsf;
+				 }
+				else
+				 for(i=0;i<dim;i++){
+					 c[i]=0.; m[i]=0.;
+				 }
+				break;
+
+			case CalvingLevermannEnum:
+				calvingratex_input->GetInputValue(&c[0],&gauss);
+				if(dim==2) calvingratey_input->GetInputValue(&c[1],&gauss);
+				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+				norm_calving=0.;
+				for(i=0;i<dim;i++) norm_calving+=pow(c[i],2);
+				norm_calving=sqrt(norm_calving)+1.e-14;
+				for(i=0;i<dim;i++) m[i]=meltingrate*c[i]/norm_calving;
+				break;
+
+			case CalvingMinthicknessEnum:
+				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
+				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
+				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+
+				norm_dlsf=0.;
+				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+				norm_dlsf=sqrt(norm_dlsf);
+
+				if(norm_dlsf>1.e-10)
+				 for(i=0;i<dim;i++){
+					 c[i]=0.;
+					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
+				 }
+				else
+				 for(i=0;i<dim;i++){
+					 c[i]=0.;
+					 m[i]=0.;
+				 }
+				break;
+
+			case CalvingHabEnum:
+				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
+				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
+				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+
+				norm_dlsf=0.;
+				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+				norm_dlsf=sqrt(norm_dlsf);
+
+				if(norm_dlsf>1.e-10)
+				 for(i=0;i<dim;i++){
+					 c[i]=0.;
+					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
+				 }
+				else
+				 for(i=0;i<dim;i++){
+					 c[i]=0.;
+					 m[i]=0.;
+				 }
+				break;
+
+			case CalvingCrevasseDepthEnum:
+				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
+				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
+				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+
+				if(groundedice<0) meltingrate = 0.;
+
+				norm_dlsf=0.;
+				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+				norm_dlsf=sqrt(norm_dlsf);
+
+				if(norm_dlsf>1.e-10)
+				 for(i=0;i<dim;i++){
+					 c[i]=0.;
+					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
+				 }
+				else
+				 for(i=0;i<dim;i++){
+					 c[i]=0.;
+					 m[i]=0.;
+				 }
+				break;
+
+			case CalvingDev2Enum:
+				  {
+					lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
+					if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
+					calvingrate_input->GetInputValue(&calvingrate,&gauss);
+					meltingrate_input->GetInputValue(&meltingrate,&gauss);
+					gr_input->GetInputValue(&groundedice,&gauss);
+
+					//idea: no retreat on ice above critical calving height "calvinghaf" . Limit using regularized Heaviside function.
+					vel=sqrt(v[0]*v[0] + v[1]*v[1]);
+					haf_eps=10.;
+					if(groundedice-calvinghaf<=-haf_eps){
+						// ice floats freely below calvinghaf: calve freely
+						// undercutting has no effect:
+						meltingrate=0.;
+					}
+					else if(groundedice-calvinghaf>=haf_eps){
+						// ice is well above calvinghaf -> no calving back, i.e. limit calving rate to ice velocity
+						calvingrate=min(calvingrate,vel);
+						// ice is almost grounded: frontal undercutting has maximum effect (do nothing).
+					}
+					else{ // ice is close to calvinghaf: smooth transition between limitation and free calving.
+						//heaviside: 0 for floating, 1 for grounded
+						heaviside=(groundedice-calvinghaf+haf_eps)/(2.*haf_eps) + sin(M_PI*(groundedice-calvinghaf)/haf_eps)/(2.*M_PI);
+						calvingrate=heaviside*(min(calvingrate,vel)-calvingrate)+calvingrate;
+						meltingrate=heaviside*meltingrate+0.;
+					}
+
+					norm_dlsf=0.;
+					for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+					norm_dlsf=sqrt(norm_dlsf);
+
+					if(norm_dlsf>1.e-10)
+					 for(i=0;i<dim;i++){
+						 c[i]=calvingrate*dlsf[i]/norm_dlsf;
+						 m[i]=meltingrate*dlsf[i]/norm_dlsf;
+					 }
+					else
+					 for(i=0;i<dim;i++){
+						 c[i]=0.;
+						 m[i]=0.;
+					 }
+					break;
+				  }
+
+			default:
+				_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
+		}
+
+		for(i=0;i<dim;i++) w[i]=v[i]-c[i]-m[i];
+
+		movingfrontvx[iv] = w[0];
+		movingfrontvy[iv] = w[1];		
+	}
+
+	/*Add input*/
+	this->AddInput(MovingFrontalVxEnum,&movingfrontvx[0],P1DGEnum);
+	this->AddInput(MovingFrontalVyEnum,&movingfrontvy[0],P1DGEnum);
+
+	this->InputExtrude(MovingFrontalVxEnum,-1);
+	this->InputExtrude(MovingFrontalVyEnum,-1);
+}
+/*}}}*/
 Gauss*     Penta::NewGauss(void){/*{{{*/
 	return new GaussPenta();
@@ -2864,5 +3233,5 @@
 	int found=0;
 	IssmDouble value;
-	GaussPenta* gauss=NULL;
+	GaussPenta gauss;
 
 	/*First, serarch the input: */
@@ -2876,6 +3245,6 @@
 			if(data){
 				/*ok, we are good. retrieve value of input at vertex :*/
-				gauss=new GaussPenta(); gauss->GaussVertex(i);
-				data->GetInputValue(&value,gauss);
+				gauss.GaussVertex(i);
+				data->GetInputValue(&value,&gauss);
 				found=1;
 				break;
@@ -2884,5 +3253,4 @@
 	}
 
-	delete gauss;
 	if(found)*pvalue=value;
 	return found;
@@ -3011,4 +3379,45 @@
 int        Penta::PressureInterpolation(void){/*{{{*/
 	return PentaRef::PressureInterpolation(this->element_type);
+}
+/*}}}*/
+void       Penta::Recover3DMLHOInput(int targetVel_enum, int numnodes, IssmDouble* vb,  IssmDouble* vsh, IssmDouble* n, IssmDouble* H, IssmDouble* s){/*{{{*/
+   /* Recover the velocity acording to v=vb+(1-\zeta^{n+1})vsh, where \zeta=(s-z)/H
+    * The variables vb, vsh, n, H and s are all from the 2D horizontal mesh(Tria), with "numnodes" DOFs
+    * To project to penta the DOFs are doubled in size
+    *
+    */
+   _assert_(this->inputs);
+   if(!IsOnBase()) return;
+   else{
+      if(targetVel_enum==VxEnum || targetVel_enum==VyEnum){
+         IssmDouble vel[NUMVERTICES2D*5];
+         IssmDouble* xyz_list = NULL;
+			IssmDouble zi;
+         Penta* penta = this;
+			numnodes = penta->NumberofNodes(P1xP4Enum);
+         _assert_(NUMVERTICES2D*5-numnodes==0);
+			GaussPenta gauss;
+
+         for(;;){
+            penta->GetVerticesCoordinates(&xyz_list);
+            for(int i=0;i<NUMVERTICES2D;i++) {
+					for (int j=0;j<5;j++){
+						/* Get z-coordinate of the current node */
+						gauss.GaussNode(P1xP4Enum, i+j*NUMVERTICES2D);
+						zi = this->GetZcoord(xyz_list, &gauss);
+	               vel[i+j*NUMVERTICES2D] = vb[i] + vsh[i]*(1.0-pow((s[i]-zi)/H[i], (n[i]+1)));
+					}
+            }
+				xDelete<IssmDouble>(xyz_list);
+
+            /*Add to the bottom side of the element*/
+            penta->AddInput(targetVel_enum,&vel[0],P1xP4Enum);
+            if (penta->IsOnSurface()) break;
+            penta=penta->GetUpperPenta(); _assert_(penta->Id()!=this->id);
+         }
+      }
+      else _error_("not implemented yet");
+   }
+
 }
 /*}}}*/
@@ -3074,4 +3483,5 @@
 	int          numindices;
 	int         *indices = NULL;
+	bool		isNitsche;
 	IssmDouble   slopex,slopey,groundedice;
 	IssmDouble   xz_plane[6];
@@ -3080,4 +3490,6 @@
 	/*For FS only: we want the CS to be tangential to the bedrock*/
 	this->Element::GetInputValue(&approximation,ApproximationEnum);
+	this->FindParam(&isNitsche,FlowequationIsNitscheEnum);
+
 	if(!IsOnBase() || (approximation!=FSApproximationEnum && approximation!=SSAFSApproximationEnum &&  approximation!=HOFSApproximationEnum)) return;
 
@@ -3091,11 +3503,11 @@
 
 	/*Loop over basal nodes and update their CS*/
-	GaussPenta* gauss = new GaussPenta();
+	GaussPenta gauss;
 	for(int i=0;i<numindices;i++){//FIXME
-		gauss->GaussNode(this->VelocityInterpolation(),indices[i]);
-
-		slopex_input->GetInputValue(&slopex,gauss);
-		slopey_input->GetInputValue(&slopey,gauss);
-		groundedicelevelset_input->GetInputValue(&groundedice,gauss);
+		gauss.GaussNode(this->VelocityInterpolation(),indices[i]);
+
+		slopex_input->GetInputValue(&slopex,&gauss);
+		slopey_input->GetInputValue(&slopey,&gauss);
+		groundedicelevelset_input->GetInputValue(&groundedice,&gauss);
 
 		/*New X axis          New Z axis*/
@@ -3104,23 +3516,24 @@
 		xz_plane[2]=slopex;   xz_plane[5]=1.;
 
-		if(groundedice>=0){
-			if(this->nodes[indices[i]]->GetApproximation()==FSvelocityEnum){
-				this->nodes[indices[i]]->DofInSSet(2); //vz
+		if (!isNitsche) {
+			if(groundedice>=0){
+				if(this->nodes[indices[i]]->GetApproximation()==FSvelocityEnum){
+					this->nodes[indices[i]]->DofInSSet(2); //vz
+				}
+				else if(this->nodes[indices[i]]->GetApproximation()==SSAFSApproximationEnum || this->nodes[indices[i]]->GetApproximation()==HOFSApproximationEnum){
+					this->nodes[indices[i]]->DofInSSet(4); //vz
+				}
+				else _error_("Flow equation approximation"<<EnumToStringx(this->nodes[indices[i]]->GetApproximation())<<" not supported yet");
 			}
-			else if(this->nodes[indices[i]]->GetApproximation()==SSAFSApproximationEnum || this->nodes[indices[i]]->GetApproximation()==HOFSApproximationEnum){
-				this->nodes[indices[i]]->DofInSSet(4); //vz
+			else{
+				if(this->nodes[indices[i]]->GetApproximation()==FSvelocityEnum){
+					this->nodes[indices[i]]->DofInFSet(2); //vz
+				}
+				else if(this->nodes[indices[i]]->GetApproximation()==SSAFSApproximationEnum || this->nodes[indices[i]]->GetApproximation()==HOFSApproximationEnum){
+					this->nodes[indices[i]]->DofInFSet(4); //vz
+				}
+				else _error_("Flow equation approximation"<<EnumToStringx(this->nodes[indices[i]]->GetApproximation())<<" not supported yet");
 			}
-			else _error_("Flow equation approximation"<<EnumToStringx(this->nodes[indices[i]]->GetApproximation())<<" not supported yet");
-		}
-		else{
-			if(this->nodes[indices[i]]->GetApproximation()==FSvelocityEnum){
-				this->nodes[indices[i]]->DofInFSet(2); //vz
-			}
-			else if(this->nodes[indices[i]]->GetApproximation()==SSAFSApproximationEnum || this->nodes[indices[i]]->GetApproximation()==HOFSApproximationEnum){
-				this->nodes[indices[i]]->DofInFSet(4); //vz
-			}
-			else _error_("Flow equation approximation"<<EnumToStringx(this->nodes[indices[i]]->GetApproximation())<<" not supported yet");
-		}
-
+		}
 		XZvectorsToCoordinateSystem(&this->nodes[indices[i]]->coord_system[0][0],&xz_plane[0]);
 	}
@@ -3128,5 +3541,4 @@
 	/*cleanup*/
 	xDelete<int>(indices);
-	delete gauss;
 }
 /*}}}*/
@@ -3146,65 +3558,4 @@
 	if(this->hneighbors) this->hneighbors->reset();
 
-}
-/*}}}*/
-void       Penta::RignotMeltParameterization(){/*{{{*/
-
-	if(!this->IsOnBase()) return;
-
-	IssmDouble A, B, alpha, beta;
-	IssmDouble bed,qsg,qsg_basin,TF,yts;
-	int numbasins;
-	IssmDouble basinid[NUMVERTICES];
-	IssmDouble* basin_icefront_area=NULL;
-
-	/* Coefficients */
-	A    = 3e-4;
-	B    = 0.15;
-	alpha = 0.39;
-	beta = 1.18;
-
-	/*Get inputs*/
-	Input* bed_input = this->GetInput(BedEnum);                     _assert_(bed_input);
-	Input* qsg_input = this->GetInput(FrontalForcingsSubglacialDischargeEnum);		 _assert_(qsg_input);
-	Input* TF_input  = this->GetInput(FrontalForcingsThermalForcingEnum);          _assert_(TF_input);
-	Element::GetInputListOnVertices(&basinid[0],FrontalForcingsBasinIdEnum);
-
-	this->FindParam(&yts, ConstantsYtsEnum);
-	this->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
-	this->parameters->FindParam(&basin_icefront_area,&numbasins,FrontalForcingsBasinIcefrontAreaEnum);
-
-	IssmDouble meltrates[NUMVERTICES2D];  //frontal melt-rate
-
-	/* Start looping on the number of vertices: */
-	GaussPenta* gauss=new GaussPenta();
-	for(int iv=0;iv<NUMVERTICES2D;iv++){
-		gauss->GaussVertex(iv);
-
-		/* Get variables */
-		bed_input->GetInputValue(&bed,gauss);
-		qsg_input->GetInputValue(&qsg,gauss);
-		TF_input->GetInputValue(&TF,gauss);
-
-		if(basinid[iv]==0 || basin_icefront_area[reCast<int>(basinid[iv])-1]==0.) meltrates[iv]=0.;
-		else{
-			/* change the unit of qsg (m^3/d -> m/d) with ice front area */
-			qsg_basin=qsg/basin_icefront_area[reCast<int>(basinid[iv])-1];
-
-			/* calculate melt rates */
-			meltrates[iv]=((A*max(-bed,0.)*pow(max(qsg_basin,0.),alpha)+B)*pow(max(TF,0.),beta))/86400; //[m/s]
-		}
-
-		if(xIsNan<IssmDouble>(meltrates[iv])) _error_("NaN found in vector");
-		if(xIsInf<IssmDouble>(meltrates[iv])) _error_("Inf found in vector");
-	}
-
-	/*Add input*/
-	this->AddInput(CalvingMeltingrateEnum,&meltrates[0],P1Enum);
-
-	this->InputExtrude(CalvingMeltingrateEnum,-1);
-
-	/*Cleanup and return*/
-	xDelete<IssmDouble>(basin_icefront_area);
-	delete gauss;
 }
 /*}}}*/
@@ -3368,4 +3719,10 @@
 }
 /*}}}*/
+bool       Penta::IsSpawnedElement(void){/*{{{*/
+
+	/*Penta cannot be collapsed elements*/
+	return false;
+
+}/*}}}*/
 IssmDouble Penta::StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){/*{{{*/
 	/*Compute stabilization parameter*/
@@ -3414,5 +3771,4 @@
 
 	IssmDouble  epsilon[6];
-	GaussPenta* gauss=NULL;
 	IssmDouble  vx,vy,vel;
 	IssmDouble  strainxx;
@@ -3431,15 +3787,15 @@
 
 	/* Start looping on the number of vertices: */
-	gauss=new GaussPenta();
+	GaussPenta gauss;
 	for (int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
+		gauss.GaussVertex(iv);
 
 		/* Get the value we need*/
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
+		vx_input->GetInputValue(&vx,&gauss);
+		vy_input->GetInputValue(&vy,&gauss);
 		vel=vx*vx+vy*vy;
 
 		/*Compute strain rate and viscosity: */
-		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
 		strainxx=epsilon[0];
 		strainyy=epsilon[1];
@@ -3452,7 +3808,4 @@
 	/*Add input*/
 	this->AddInput(StrainRateparallelEnum,&strainparallel[0],P1DGEnum);
-
-	/*Clean up and return*/
-	delete gauss;
 }
 /*}}}*/
@@ -3460,5 +3813,4 @@
 
 	IssmDouble  epsilon[6];
-	GaussPenta* gauss=NULL;
 	IssmDouble  vx,vy,vel;
 	IssmDouble  strainxx;
@@ -3477,15 +3829,15 @@
 
 	/* Start looping on the number of vertices: */
-	gauss=new GaussPenta();
+	GaussPenta gauss;
 	for (int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
+		gauss.GaussVertex(iv);
 
 		/* Get the value we need*/
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
+		vx_input->GetInputValue(&vx,&gauss);
+		vy_input->GetInputValue(&vy,&gauss);
 		vel=vx*vx+vy*vy;
 
 		/*Compute strain rate and viscosity: */
-		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
 		strainxx=epsilon[0];
 		strainyy=epsilon[1];
@@ -3498,7 +3850,4 @@
 	/*Add input*/
 	this->AddInput(StrainRateperpendicularEnum,&strainperpendicular[0],P1DGEnum);
-
-	/*Clean up and return*/
-	delete gauss;
 }
 /*}}}*/
@@ -3695,5 +4044,5 @@
 
 	/*CFL criterion: */
-	IssmDouble dt = C/(maxabsvx/dx+maxabsvy/dy+maxabsvz/dz);
+	IssmDouble dt = C/(maxabsvx/dx+maxabsvy/dy+maxabsvz/dz + 1.e-18);
 
 	return dt;
@@ -3776,5 +4125,4 @@
 		_error_("case not possible");
 	}
-
 
 	/*Some checks in debugging mode*/
@@ -3891,5 +4239,4 @@
 		_error_("case not possible");
 	}
-
 
 	/*Some checks in debugging mode*/
@@ -4035,4 +4382,5 @@
 	IssmDouble base,smb,rho_ice,scalefactor;
 	IssmDouble Total_Smb=0;
+	IssmDouble lsf[NUMVERTICES];
 	IssmDouble xyz_list[NUMVERTICES][3];
 
@@ -4050,14 +4398,45 @@
 
 	/*Now get the average SMB over the element*/
-	Input* smb_input = this->GetInput(SmbMassBalanceEnum); _assert_(smb_input);
-
-	smb_input->GetInputAverage(&smb);
-	if(scaled==true){
-		Input* scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
-		scalefactor_input->GetInputAverage(&scalefactor);// average scalefactor on element
-	}
+	Element::GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
+   if(lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0){
+		/*Partially ice-covered element*/
+		bool mainlyice;
+      int point;
+      IssmDouble* smb_vertices = xNew<IssmDouble>(NUMVERTICES);
+		IssmDouble  weights[NUMVERTICES2D];
+		IssmDouble  lsf2d[NUMVERTICES2D];
+      IssmDouble f1,f2,phi;
+      Element::GetInputListOnVertices(&smb_vertices[0],SmbMassBalanceEnum);
+		for(int i=0;i<NUMVERTICES2D;i++) lsf2d[i] = lsf[i];
+		GetFractionGeometry2D(weights,&phi,&point,&f1,&f2,&mainlyice,lsf2d);
+		smb = 0.0;
+		for(int i=0;i<NUMVERTICES2D;i++) smb += weights[i]*smb_vertices[i];
+
+		if(scaled==true){
+         IssmDouble* scalefactor_vertices   = xNew<IssmDouble>(NUMVERTICES);
+         Element::GetInputListOnVertices(&scalefactor_vertices[0],MeshScaleFactorEnum);
+         /*Compute loop only over lower vertices: i<NUMVERTICES2D*/
+         scalefactor = 0.0;
+         for(int i=0;i<NUMVERTICES2D;i++) scalefactor += weights[i]/phi*scalefactor_vertices[i];
+         xDelete<IssmDouble>(scalefactor_vertices);
+		}
+		else scalefactor = 1.0;
+
+		/*Cleanup*/
+      xDelete<IssmDouble>(smb_vertices);
+	}
+
 	else{
-		scalefactor=1.;
-	}
+		/*Fully ice-covered element*/
+		Input* smb_input = this->GetInput(SmbMassBalanceEnum); _assert_(smb_input);
+		smb_input->GetInputAverage(&smb);
+
+		if(scaled==true){
+			Input* scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
+			scalefactor_input->GetInputAverage(&scalefactor);// average scalefactor on element
+		}
+		else scalefactor=1.0;
+	}
+
 	Total_Smb=rho_ice*base*smb*scalefactor;// smb on element in kg s-1
 
@@ -4501,17 +4880,14 @@
 	Input* onbase = this->GetInput(MeshVertexonbaseEnum); _assert_(onbase);
 
-	GaussPenta* gauss=new GaussPenta();
+	GaussPenta gauss;
 	for(int iv=0;iv<this->NumberofNodes(this->element_type);iv++){
-		gauss->GaussNode(this->element_type,iv);
-		onbase->GetInputValue(&isonbase,gauss);
+		gauss.GaussNode(this->element_type,iv);
+		onbase->GetInputValue(&isonbase,&gauss);
 		if(isonbase==1.){
-			input->GetInputValue(&value,gauss);
+			input->GetInputValue(&value,&gauss);
 			this->nodes[iv]->ApplyConstraint(0,value);
 		}
 	}
-	delete gauss;
-
-}
-/*}}}*/
+}/*}}}*/
 void       Penta::UpdateConstraintsExtrudeFromTop(void){/*{{{*/
 
@@ -4525,11 +4901,10 @@
 	Input* input = this->GetInput(extrusioninput); _assert_(extrusioninput);
 
-	GaussPenta* gauss=new GaussPenta();
+	GaussPenta gauss;
 	for(int i=0;i<3;i++){
-		gauss->GaussNode(P1Enum,indices[i]);
-		input->GetInputValue(&value,gauss);
+		gauss.GaussNode(P1Enum,indices[i]);
+		input->GetInputValue(&value,&gauss);
 		this->nodes[indices[i]]->ApplyConstraint(0,value);
 	}
-	delete gauss;
 
 }
@@ -4607,11 +4982,4 @@
 }
 /*}}}*/
-
-#ifdef _HAVE_GIA_
-void       Penta::GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y){/*{{{*/
-	_error_("GIA deflection not implemented yet!");
-}
-/*}}}*/
-#endif
 
 #ifdef _HAVE_DAKOTA_
@@ -4653,5 +5021,4 @@
 	}
 	else if(type==TransientInputEnum){
-
 
 		IssmDouble* steps=NULL;
@@ -4796,5 +5163,5 @@
 
 					/*build new bed and surface: */
-					if (this->IsFloating()){
+					if (this->IsAllFloating()){
 						/*hydrostatic equilibrium: */
 						IssmDouble rho_ice,rho_water,di;
Index: /issm/trunk/src/c/classes/Elements/Penta.h
===================================================================
--- /issm/trunk/src/c/classes/Elements/Penta.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Elements/Penta.h	(revision 26744)
@@ -19,4 +19,5 @@
 class Node;
 class Material;
+class Matlitho;
 class Tria;
 class ElementMatrix;
@@ -69,4 +70,6 @@
 		void           CreateInputTimeAverage(int transientinput_enum,int averagedinput_enum,IssmDouble start_time,IssmDouble end_time,int averaging_method);
 		void           ElementResponse(IssmDouble* presponse,int response_enum);
+		void           ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,Vector<IssmDouble>* vareae,bool spherical=false){_error_("not implemented yet");};
+		void           ElementCoordinates(Vector<IssmDouble>* vlonge,Vector<IssmDouble>* vlate,Vector<IssmDouble>* vareae){_error_("not implemented yet");};
 		void           ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
 		int            FiniteElement(void);
@@ -76,4 +79,5 @@
 		IssmDouble     GetAreaSpherical(void){_error_("not implemented yet!");};
 		void           GetAreaCoordinates(IssmDouble *area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints);
+		IssmDouble     GetTriangleAreaSpherical(IssmDouble xyz_list[3][3]){_error_("not implemented yet");};
 		Element*       GetBasalElement(void);
 		Penta*         GetBasalPenta(void);
@@ -81,4 +85,9 @@
 		void           GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
 		IssmDouble     GetGroundedPortion(IssmDouble* xyz_list);
+		void           GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl){_error_("not implemented yet");};
+		void           GetFractionGeometry2D(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl);
+		void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelsetenum){_error_("not implemented yet");};
+		void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area, int levelset1enum, int levelset2enum){_error_("not implemented yet");};
+		void        GetBarycenterFromLevelset(IssmDouble* platbar, IssmDouble* plongbar,IssmDouble phi,IssmDouble fraction1,IssmDouble fraction2,IssmDouble late, IssmDouble longe, int point1,int istrapeze1, IssmDouble planetradius){_error_("not implemented yet");};
 		IssmDouble		GetIcefrontArea();
 		void           GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
@@ -129,4 +138,5 @@
 		IssmDouble     Misfit(int modelenum,int observationenum,int weightsenum){_error_("not implemented yet");};
 		IssmDouble     MisfitArea(int weightsenum){_error_("not implemented yet");};
+		void           MovingFrontalVelocity(void);
 		Gauss*         NewGauss(void);
 		Gauss*         NewGauss(int order);
@@ -159,10 +169,12 @@
 		void           PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
 		int            PressureInterpolation();
+      void           Recover3DMLHOInput(int targetVel_enum, int numnodes, IssmDouble* vb,  IssmDouble* vsh, IssmDouble* n, IssmDouble* H, IssmDouble* s);
 		void           ReduceMatrices(ElementMatrix* Ke,ElementVector* pe);
 		void           ResetFSBasalBoundaryCondition(void);
 		void           ResetHooks();
-		void				RignotMeltParameterization();
-		void           SetElementInput(int enum_in,IssmDouble values);
-		void           SetElementInput(Inputs* inputs,int enum_in,IssmDouble values);
+		void           SetElementInput(int enum_in,IssmDouble value);
+		void           SetElementInput(int enum_in,IssmDouble value,int type){_error_("not implemented yet");};
+		void           SetElementInput(Inputs* inputs,int enum_in,IssmDouble value);
+		void           SetElementInput(Inputs* inputs,int enum_in,IssmDouble value,int type){_error_("not implemented yet");};
 		void           SetElementInput(Inputs* inputs,int numindices,int* indices,IssmDouble* values,int enum_in);
 		void           SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset, int M,int N);
@@ -171,4 +183,5 @@
 	   Element*       SpawnBasalElement(bool depthaverage_materials);
 		Element*       SpawnTopElement(void);
+		bool           IsSpawnedElement(void);
 		Tria*	         SpawnTria(int index1,int index2,int index3);
 		IssmDouble     StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa);
@@ -205,21 +218,22 @@
 		#endif
 
-		#ifdef _HAVE_GIA_
-		void           GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y);
-		#endif
 		#ifdef _HAVE_ESA_
 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){_error_("not implemented yet!");};
 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
 		#endif
-		#ifdef _HAVE_SEALEVELRISE_
-		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
-		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
-		void    SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
-		void    SealevelriseGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){_error_("not implemented yet!");};
-		IssmDouble    SealevelriseEustaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
-		IssmDouble    SealevelriseEustaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
-		void    SealevelriseEustaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
-		void    SealevelriseNonEustatic(IssmDouble* Sgo, IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
-		void    SealevelriseGeodetic(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+		#ifdef _HAVE_SEALEVELCHANGE_
+		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+		void       SealevelchangeGeometrySubElementKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads,  SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeShift(GrdLoads* loads,  IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){_error_("not implemented yet");};
+		void       SealevelchangeBarystaticLoads(GrdLoads* loads,  BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeUpdateViscousFields(){_error_("not implemented yet");};
 		#endif
 
Index: /issm/trunk/src/c/classes/Elements/Seg.cpp
===================================================================
--- /issm/trunk/src/c/classes/Elements/Seg.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Elements/Seg.cpp	(revision 26744)
@@ -362,4 +362,13 @@
 	return isicefront;
 }/*}}}*/
+bool       Seg::IsSpawnedElement(void){/*{{{*/
+
+	if(this->iscollapsed!=0){
+		return true;
+	}
+
+	return false;
+
+}/*}}}*/
 void       Seg::JacobianDeterminant(IssmDouble* pJdet,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
 
Index: /issm/trunk/src/c/classes/Elements/Seg.h
===================================================================
--- /issm/trunk/src/c/classes/Elements/Seg.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Elements/Seg.h	(revision 26744)
@@ -17,4 +17,5 @@
 class Node;
 class Material;
+class Matlitho;
 class ElementMatrix;
 class ElementVector;
@@ -53,4 +54,6 @@
 		void        ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum,int control_interp){_error_("not implemented yet");};
 		void        ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");};
+		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,Vector<IssmDouble>* vareae,bool spherical=false){_error_("not implemented yet");};
+		void        ElementCoordinates(Vector<IssmDouble>* vlonge,Vector<IssmDouble>* vlate,Vector<IssmDouble>* vareae){_error_("not implemented yet");};
 		void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){_error_("not implemented yet");};
 		int         FiniteElement(void);
@@ -61,5 +64,9 @@
 		void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating){_error_("not implemented yet");};
 		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list);
-		void		   GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
+		void        GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl){_error_("not implemented yet");};
+		void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelsetenum){_error_("not implemented yet");};
+		void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelset1enum, int levelset2enum){_error_("not implemented yet");};
+		void        GetBarycenterFromLevelset(IssmDouble* platbar, IssmDouble* plongbar,IssmDouble phi,IssmDouble fraction1,IssmDouble fraction2,IssmDouble late, IssmDouble longe, int point1,int istrapeze1, IssmDouble planetradius){_error_("not implemented yet");};
+		void		GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
 		Input*     GetInput(int enumtype);
 		Input*     GetInput(int enumtype,IssmDouble time);
@@ -138,4 +145,6 @@
 	   Element*    SpawnBasalElement(bool depthaverage_materials){_error_("not implemented yet");};
 		Element*    SpawnTopElement(void){_error_("not implemented yet");};
+		bool        IsSpawnedElement(void);
+		void       SetElementInput(int enum_in,IssmDouble value, int type){_error_("not implemented yet");};
 		IssmDouble  StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
 		void        StabilizationParameterAnisotropic(IssmDouble* tau_parameter_anisotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy,  IssmDouble hz, IssmDouble kappa){_error_("not implemented yet");};
@@ -161,22 +170,24 @@
 		IssmDouble     GetArea3D(void){_error_("not implemented yet!");};
 		IssmDouble     GetAreaSpherical(void){_error_("not implemented yet!");};
-
-#ifdef _HAVE_GIA_
-		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
-#endif
+		IssmDouble GetTriangleAreaSpherical(IssmDouble xyz_list[3][3]){_error_("not implemented yet");};
+
 #ifdef _HAVE_ESA_
 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){_error_("not implemented yet!");};
 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
 #endif
-#ifdef _HAVE_SEALEVELRISE_
-		void    SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
-		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
-		void    SealevelriseGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){_error_("not implemented yet!");};
-		IssmDouble    SealevelriseEustaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
-		IssmDouble    SealevelriseEustaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
-		void    SealevelriseEustaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
-		void    SealevelriseNonEustatic(IssmDouble* Sgo,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
-		void    SealevelriseGeodetic(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
-		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+#ifdef _HAVE_SEALEVELCHANGE_
+		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+		void       SealevelchangeGeometrySubElementKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads,  SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeShift(GrdLoads* loads, IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){_error_("not implemented yet");};
+		void       SealevelchangeBarystaticLoads(GrdLoads* loads,  BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeUpdateViscousFields(){_error_("not implemented yet");};
 #endif
 
Index: /issm/trunk/src/c/classes/Elements/Tetra.cpp
===================================================================
--- /issm/trunk/src/c/classes/Elements/Tetra.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Elements/Tetra.cpp	(revision 26744)
@@ -786,4 +786,10 @@
 	this->FaceOnSurfaceIndices(&index1,&index2,&index3);
 	return SpawnTria(index1,index2,index3);
+}/*}}}*/
+bool       Tetra::IsSpawnedElement(void){/*{{{*/
+
+   /*Tetras cannot be collapsed elements*/
+   return false;
+
 }/*}}}*/
 Tria*    Tetra::SpawnTria(int index1,int index2,int index3){/*{{{*/
Index: /issm/trunk/src/c/classes/Elements/Tetra.h
===================================================================
--- /issm/trunk/src/c/classes/Elements/Tetra.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Elements/Tetra.h	(revision 26744)
@@ -17,4 +17,5 @@
 class Node;
 class Material;
+class Matlitho;
 class ElementMatrix;
 class ElementVector;
@@ -52,4 +53,6 @@
 		IssmDouble  DragCoefficientAbsGradient(void){_error_("not implemented yet");};
 		void        ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");};
+		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,Vector<IssmDouble>* vareae,bool spherical=false){_error_("not implemented yet");};
+		void        ElementCoordinates(Vector<IssmDouble>* vlonge,Vector<IssmDouble>* vlate,Vector<IssmDouble>* vareae){_error_("not implemented yet");};
 		void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
 		void        FaceOnBaseIndices(int* pindex1,int* pindex2,int* pindex3);
@@ -61,8 +64,13 @@
 		IssmDouble  GetArea3D(void){_error_("not implemented yet!");};
 		IssmDouble  GetAreaSpherical(void){_error_("not implemented yet!");};
+		IssmDouble  GetTriangleAreaSpherical(IssmDouble xyz_list[3][3]){_error_("not implemented yet");};
 		Element*    GetBasalElement(void){_error_("not implemented yet");};
 		int         GetElementType(void);
 		void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating){_error_("not implemented yet");};
 		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list){_error_("not implemented yet");};
+		void        GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl){_error_("not implemented yet");};
+		void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelsetenum){_error_("not implemented yet");};
+		void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelset1enum, int levelset2enum){_error_("not implemented yet");};
+		void        GetBarycenterFromLevelset(IssmDouble* platbar, IssmDouble* plongbar,IssmDouble phi,IssmDouble fraction1,IssmDouble fraction2,IssmDouble late, IssmDouble longe, int point1,int istrapeze1, IssmDouble planetradius){_error_("not implemented yet");};
 		void		   GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum){_error_("not implemented yet");};
 		Input*     GetInput(int enumtype);
@@ -142,6 +150,9 @@
 		void        SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
 		void        SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
+		void        SetElementInput(Inputs* inputs,int enum_in,IssmDouble value,int type){_error_("not implemented yet");};
+		void        SetElementInput(int enum_in, IssmDouble value, int type){_error_("not implemented yet");};
 	   Element*    SpawnBasalElement(bool depthaverage_materials);
 		Element*    SpawnTopElement(void);
+		bool        IsSpawnedElement(void);
 		Tria*       SpawnTria(int index1,int index2,int index3);
 		IssmDouble  StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
@@ -168,21 +179,22 @@
 		void        ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
 
-#ifdef _HAVE_GIA_
-		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
-#endif
 #ifdef _HAVE_ESA_
 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){_error_("not implemented yet!");};
 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
 #endif
-#ifdef _HAVE_SEALEVELRISE_
-		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
-		void    SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
-		void    SealevelriseGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){_error_("not implemented yet!");};
-		IssmDouble    SealevelriseEustaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
-		IssmDouble    SealevelriseEustaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
-		void    SealevelriseEustaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
-		void    SealevelriseNonEustatic(IssmDouble* Sgo, IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
-		void    SealevelriseGeodetic(IssmDouble* Up ,IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
-		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+#ifdef _HAVE_SEALEVELCHANGE_
+		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+		void       SealevelchangeGeometrySubElementKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads,  SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeShift(GrdLoads* loads,  IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){_error_("not implemented yet");};
+		void       SealevelchangeBarystaticLoads(GrdLoads* loads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+		void       SealevelchangeUpdateViscousFields(){_error_("not implemented yet");};
 #endif
 
Index: /issm/trunk/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/classes/Elements/Tria.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Elements/Tria.cpp	(revision 26744)
@@ -21,5 +21,5 @@
 #include "../Inputs/TransientInput.h"
 #include "../../shared/shared.h"
-#ifdef _HAVE_GIA_
+#ifdef _HAVE_SEALEVELCHANGE_
 #include "../../modules/GiaDeflectionCorex/GiaDeflectionCorex.h"
 #endif
@@ -29,4 +29,5 @@
 #define NUMVERTICES   3
 #define NUMVERTICES1D 2
+//#define ISMICI        1
 
 /*Constructors/destructor/copy*/
@@ -174,4 +175,5 @@
 	switch(domaintype){
 		case Domain2DhorizontalEnum:
+		case Domain3DsurfaceEnum:
 			this->AddInput(input_enum,values,interpolation_enum);
 			break;
@@ -321,5 +323,4 @@
 	IssmDouble  epse_2,groundedice,bed,sealevel;		// added sealevel
 
-
 	/* Get node coordinates and dof list: */
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
@@ -336,25 +337,23 @@
 	Input* sl_input  = this->GetInput(SealevelEnum); _assert_(sl_input);
 
-
-
 	/* Start looping on the number of vertices: */
-	GaussTria* gauss=new GaussTria();
+	GaussTria gauss;
 	for(int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
+		gauss.GaussVertex(iv);
 
 		/*Get velocity components and thickness*/
-		B_input->GetInputValue(&B,gauss);
-		n_input->GetInputValue(&n,gauss);
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
-		gr_input->GetInputValue(&groundedice,gauss);
-		bs_input->GetInputValue(&bed,gauss);
-		smax_fl_input->GetInputValue(&sigma_max_floating,gauss);
-		smax_gr_input->GetInputValue(&sigma_max_grounded,gauss);
+		B_input->GetInputValue(&B,&gauss);
+		n_input->GetInputValue(&n,&gauss);
+		vx_input->GetInputValue(&vx,&gauss);
+		vy_input->GetInputValue(&vy,&gauss);
+		gr_input->GetInputValue(&groundedice,&gauss);
+		bs_input->GetInputValue(&bed,&gauss);
+		smax_fl_input->GetInputValue(&sigma_max_floating,&gauss);
+		smax_gr_input->GetInputValue(&sigma_max_grounded,&gauss);
 		vel=sqrt(vx*vx+vy*vy)+1.e-14;
-		sl_input->GetInputValue(&sealevel,gauss);
+		sl_input->GetInputValue(&sealevel,&gauss);
 
 		/*Compute strain rate and viscosity: */
-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
 
 		/*Get Eigen values*/
@@ -399,7 +398,4 @@
 	this->AddInput(CalvingCalvingrateEnum,&calvingrate[0],P1DGEnum);
 	this->AddInput(SigmaVMEnum,&sigma_vm[0],P1DGEnum);
-
-	/*Clean up and return*/
-	delete gauss;
 }
 /*}}}*/
@@ -407,10 +403,23 @@
 
 	IssmDouble  calvingrate[NUMVERTICES];
-	IssmDouble  vx,vy,vel;
-	IssmDouble  water_height, bed,Ho,thickness,surface;
+	IssmDouble  vx,vy;
+	IssmDouble  water_height, bed,Hab,thickness,surface;
 	IssmDouble  surface_crevasse[NUMVERTICES], basal_crevasse[NUMVERTICES], crevasse_depth[NUMVERTICES], H_surf, H_surfbasal;
-	IssmDouble  B, strainparallel, straineffective,n;
+	IssmDouble  strainparallel, straineffective,B,n;
 	IssmDouble  s_xx,s_xy,s_yy,s1,s2,stmp;
-	int crevasse_opening_stress;
+	int         crevasse_opening_stress;
+
+	/*reset if no ice in element*/
+	if(!this->IsIceInElement()){
+		for(int i=0;i<NUMVERTICES;i++){
+			surface_crevasse[i] = 0.;
+			basal_crevasse[i] = 0.;
+			crevasse_depth[i] = 0.;
+		}
+		this->AddInput(SurfaceCrevasseEnum,&surface_crevasse[0],P1DGEnum);
+		this->AddInput(BasalCrevasseEnum,&basal_crevasse[0],P1DGEnum);
+		this->AddInput(CrevasseDepthEnum,&crevasse_depth[0],P1DGEnum);
+		return;
+	}
 
 	/*retrieve the type of crevasse_opening_stress*/
@@ -437,56 +446,57 @@
 
 	/*Loop over all elements of this partition*/
-	GaussTria* gauss=new GaussTria();
+	GaussTria gauss;
 	for (int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
-
-		H_input->GetInputValue(&thickness,gauss);
-		bed_input->GetInputValue(&bed,gauss);
-		surface_input->GetInputValue(&surface,gauss);
-		strainrateparallel_input->GetInputValue(&strainparallel,gauss);
-		strainrateeffective_input->GetInputValue(&straineffective,gauss);
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
-		waterheight_input->GetInputValue(&water_height,gauss);
-		s_xx_input->GetInputValue(&s_xx,gauss);
-		s_xy_input->GetInputValue(&s_xy,gauss);
-		s_yy_input->GetInputValue(&s_yy,gauss);
-		B_input->GetInputValue(&B,gauss);
-		n_input->GetInputValue(&n,gauss);
-
-		vel=sqrt(vx*vx+vy*vy)+1.e-14;
-
-		s1=(s_xx+s_yy)/2.+sqrt(pow((s_xx-s_yy)/2.,2)+pow(s_xy,2));
-		s2=(s_xx+s_yy)/2.-sqrt(pow((s_xx-s_yy)/2.,2)+pow(s_xy,2));
-		if(fabs(s2)>fabs(s1)){stmp=s2; s2=s1; s1=stmp;}
-
-		Ho = thickness - (rho_seawater/rho_ice) * (-bed);
-		if(Ho<0.)  Ho=0.;
-
-		if(crevasse_opening_stress==0){		/*Otero2010: balance between the tensile deviatoric stress and ice overburden pressure*/
-			surface_crevasse[iv] = B * strainparallel * pow(straineffective, ((1 / n)-1)) / (rho_ice * constant_g);
-			basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice)) * (B * strainparallel * pow(straineffective,((1/n)-1)) / (rho_ice*constant_g) - Ho);
-		}
-		else if(crevasse_opening_stress==1){	 /*Benn2017,Todd2018: maximum principal stress */
-			surface_crevasse[iv] = s1 / (rho_ice*constant_g);
-			basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice))* (s1/ (rho_ice*constant_g)-Ho);
-		}
-
-		/* some constraints */
-		if (surface_crevasse[iv]<0.) {
+		gauss.GaussVertex(iv);
+
+		H_input->GetInputValue(&thickness,&gauss);
+		bed_input->GetInputValue(&bed,&gauss);
+		surface_input->GetInputValue(&surface,&gauss);
+
+		vx_input->GetInputValue(&vx,&gauss);
+		vy_input->GetInputValue(&vy,&gauss);
+		waterheight_input->GetInputValue(&water_height,&gauss);
+		s_xx_input->GetInputValue(&s_xx,&gauss);
+		s_xy_input->GetInputValue(&s_xy,&gauss);
+		s_yy_input->GetInputValue(&s_yy,&gauss);
+
+      /*Get longitudinal or maximum Eigen stress*/
+		if(crevasse_opening_stress==0){
+         /*Otero2010: balance between the tensile deviatoric stress and ice overburden pressure*/
+			strainrateparallel_input->GetInputValue(&strainparallel,&gauss);
+			strainrateeffective_input->GetInputValue(&straineffective,&gauss);
+			B_input->GetInputValue(&B,&gauss);
+			n_input->GetInputValue(&n,&gauss);
+         s1 =  B * strainparallel * pow(straineffective, (1./n)-1);
+		}
+		else if(crevasse_opening_stress==1){
+         /*Benn2017,Todd2018: maximum principal stress */
+			Matrix2x2Eigen(&s1,&s2,NULL,NULL,s_xx,s_xy,s_yy);
+			s1 = max(0.,max(s1,s2));
+		}
+      else{
+         _error_("not supported");
+      }
+
+      /*Surface crevasse: sigma'_xx - rho_i g d + rho_fw g d_w = 0*/
+      surface_crevasse[iv] = 2*s1 / (rho_ice*constant_g) + (rho_freshwater/rho_ice)*water_height;
+		if(surface_crevasse[iv]<0.){
 			surface_crevasse[iv]=0.;
 			water_height = 0.;
 		}
-		if (basal_crevasse[iv]<0.) basal_crevasse[iv]=0.;
-		if (bed>0.) basal_crevasse[iv] = 0.;
-
-		//if (surface_crevasse[iv]<water_height){
-		//	water_height = surface_crevasse[iv];
-		//}
-
-		/* add water in surface crevasse */
-		surface_crevasse[iv] = surface_crevasse[iv] + (rho_freshwater/rho_ice)*water_height; /* surface crevasse + water */
-		crevasse_depth[iv] = surface_crevasse[iv] + (rho_freshwater/rho_ice)*water_height + basal_crevasse[iv]; /* surface crevasse + basal crevasse + water */
-
+
+      /*Basal crevasse: sigma'_xx - rho_i g (H-d) - rho_w g (b+d) = 0*/
+      if(bed>0.){
+         basal_crevasse[iv] = 0.;
+      }
+      else{
+         Hab = thickness - (rho_seawater/rho_ice) * (-bed);
+         if(Hab<0.)  Hab=0.;
+         basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice))* (2*s1/ (rho_ice*constant_g)-Hab);
+         if(basal_crevasse[iv]<0.) basal_crevasse[iv]=0.;
+      }
+
+      /*Total crevasse depth (surface + basal)*/
+		crevasse_depth[iv]   = surface_crevasse[iv] + basal_crevasse[iv];
 	}
 
@@ -494,6 +504,4 @@
 	this->AddInput(BasalCrevasseEnum,&basal_crevasse[0],P1DGEnum);
 	this->AddInput(CrevasseDepthEnum,&crevasse_depth[0],P1DGEnum);
-
-	delete gauss;
 }
 /*}}}*/
@@ -517,16 +525,16 @@
 
 	/* Start looping on the number of vertices: */
-	GaussTria* gauss=new GaussTria();
+	GaussTria gauss;
 	for (int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
+		gauss.GaussVertex(iv);
 
 		/* Get the value we need*/
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
+		vx_input->GetInputValue(&vx,&gauss);
+		vy_input->GetInputValue(&vy,&gauss);
 		vel=vx*vx+vy*vy;
-		strainparallel_input->GetInputValue(&strainparallel,gauss);
-		strainperpendicular_input->GetInputValue(&strainperpendicular,gauss);
-		levermanncoeff_input->GetInputValue(&propcoeff,gauss);
-		bs_input->GetInputValue(&bed,gauss);
+		strainparallel_input->GetInputValue(&strainparallel,&gauss);
+		strainperpendicular_input->GetInputValue(&strainperpendicular,&gauss);
+		levermanncoeff_input->GetInputValue(&propcoeff,&gauss);
+		bs_input->GetInputValue(&bed,&gauss);
 
 		/*Calving rate proportionnal to the positive product of the strain rate along the ice flow direction and the strain rate perpendicular to the ice flow */
@@ -545,7 +553,4 @@
 	this->AddInput(CalvingrateyEnum,&calvingratey[0],P1DGEnum);
 	this->AddInput(CalvingCalvingrateEnum,&calvingrate[0],P1DGEnum);
-
-	/*Clean up and return*/
-	delete gauss;
 }/*}}}*/
 void       Tria::CalvingFluxLevelset(){/*{{{*/
@@ -852,5 +857,4 @@
 	IssmDouble  tau_1[NUMVERTICES];
 	IssmDouble  tau_2[NUMVERTICES];
-	GaussTria*  gauss=NULL;
 	int domaintype,dim=2;
 
@@ -868,19 +872,19 @@
 
 	/* Start looping on the number of vertices: */
-	gauss=new GaussTria();
+	GaussTria gauss;
 	for (int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
+		gauss.GaussVertex(iv);
 
 		/*Compute strain rate and viscosity: */
-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
 		switch(approximation){
 			case SSAApproximationEnum:
-				this->material->ViscositySSA(&viscosity,dim,&xyz_list[0][0],gauss,vx_input,vy_input);
+				this->material->ViscositySSA(&viscosity,dim,&xyz_list[0][0],&gauss,vx_input,vy_input);
 				break;
 			case HOApproximationEnum:
-				this->material->ViscosityHO(&viscosity,dim,&xyz_list[0][0],gauss,vx_input,vy_input);
+				this->material->ViscosityHO(&viscosity,dim,&xyz_list[0][0],&gauss,vx_input,vy_input);
 				break;
 			case FSApproximationEnum:
-				this->material->ViscosityFS(&viscosity,dim,&xyz_list[0][0],gauss,vx_input,vy_input,NULL);
+				this->material->ViscosityFS(&viscosity,dim,&xyz_list[0][0],&gauss,vx_input,vy_input,NULL);
 				break;
 			default:
@@ -908,7 +912,4 @@
 	this->AddInput(DeviatoricStress1Enum,&tau_1[0],P1DGEnum);
 	this->AddInput(DeviatoricStress2Enum,&tau_2[0],P1DGEnum);
-
-	/*Clean up and return*/
-	delete gauss;
 }
 /*}}}*/
@@ -921,5 +922,4 @@
 	IssmDouble  strain_xy[NUMVERTICES];
 	IssmDouble  vorticity_xy[NUMVERTICES];
-	GaussTria*  gauss=NULL;
 
 	/* Get node coordinates and dof list: */
@@ -931,10 +931,10 @@
 
 	/* Start looping on the number of vertices: */
-	gauss=new GaussTria();
+	GaussTria gauss;
 	for (int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
+		gauss.GaussVertex(iv);
 
 		/*Compute strain rate and vorticity rate: */
-		this->StrainRateESA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+		this->StrainRateESA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
 
 		/*Compute Stress*/
@@ -950,7 +950,4 @@
 	this->AddInput(EsaStrainratexyEnum,&strain_xy[0],P1DGEnum);
 	this->AddInput(EsaRotationrateEnum,&vorticity_xy[0],P1DGEnum);
-
-	/*Clean up and return*/
-	delete gauss;
 }
 /*}}}*/
@@ -1026,5 +1023,4 @@
 	IssmDouble	sigma_xz[NUMVERTICES]={0,0,0};
 	IssmDouble	sigma_yz[NUMVERTICES]={0,0,0};
-	GaussTria*  gauss=NULL;
 	int domaintype,dim=2;
 
@@ -1040,12 +1036,12 @@
 
 	/* Start looping on the number of vertices: */
-	gauss=new GaussTria();
+	GaussTria gauss;
 	for (int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
+		gauss.GaussVertex(iv);
 
 		/*Compute strain rate viscosity and pressure: */
-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
-		this->material->ViscositySSA(&viscosity,dim,&xyz_list[0][0],gauss,vx_input,vy_input);
-		pressure_input->GetInputValue(&pressure,gauss);
+		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
+		this->material->ViscositySSA(&viscosity,dim,&xyz_list[0][0],&gauss,vx_input,vy_input);
+		pressure_input->GetInputValue(&pressure,&gauss);
 
 		/*Compute Stress*/
@@ -1062,7 +1058,4 @@
 	this->AddInput(StressTensoryzEnum,&sigma_yz[0],P1DGEnum);
 	this->AddInput(StressTensorzzEnum,&sigma_zz[0],P1DGEnum);
-
-	/*Clean up and return*/
-	delete gauss;
 }
 /*}}}*/
@@ -1176,15 +1169,14 @@
 		control_gradient->Serve(NUMVERTICES,&lidlist[0]);
 
-		GaussTria* gauss=new GaussTria();
+		GaussTria gauss;
 		for (int iv=0;iv<NUMVERTICES;iv++){
-			gauss->GaussVertex(iv);
-
-			control_value->GetInputValue(&value,gauss);
-			control_gradient->GetInputValue(&gradient,gauss);
+			gauss.GaussVertex(iv);
+
+			control_value->GetInputValue(&value,&gauss);
+			control_gradient->GetInputValue(&gradient,&gauss);
 
 			values[iv]    = reCast<IssmPDouble>(value)/reCast<IssmPDouble>(connectivity[iv]);
 			gradients[iv] = reCast<IssmPDouble>(gradient)/reCast<IssmPDouble>(connectivity[iv]);
 		}
-		delete gauss;
 
 		vector_control->SetValues(NUMVERTICES,&sidlist[0],&values[0],ADD_VAL);
@@ -1304,4 +1296,55 @@
 	_printf_("list of vertices on surface: "<<values[0]<<" "<<values[1]<<" "<<values[2]);
 	_error_("Could not find 2 vertices on surface");
+}
+/*}}}*/
+void       Tria::ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze, Vector<IssmDouble>* vareae, bool spherical){/*{{{*/
+
+	/*Look for x,y,z coordinates:*/
+	IssmDouble xyz_list[NUMVERTICES][3];
+	::GetVerticesCoordinates(&xyz_list[0][0],this->vertices,NUMVERTICES);
+
+	/*Find centroid:*/
+	IssmDouble xe=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
+	IssmDouble ye=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
+	IssmDouble ze=(xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2])/3.0;
+
+	if(!spherical){
+		IssmDouble area;
+		vxe->SetValue(this->sid,xe,INS_VAL);
+		vye->SetValue(this->sid,ye,INS_VAL);
+		vze->SetValue(this->sid,ze,INS_VAL);
+		area=this->GetAreaSpherical();
+		vareae->SetValue(this->sid,area,INS_VAL);
+
+		/*in addition, put in in the inputs:*/
+		this->inputs->SetDoubleInput(AreaEnum,this->lid,area);
+	}
+	else _error_("spherical coordinates not supported yet!");
+	return;
+}
+/*}}}*/
+void       Tria::ElementCoordinates(Vector<IssmDouble>* vlonge,Vector<IssmDouble>* vlate,Vector<IssmDouble>* vareae){ /*{{{*/
+
+	IssmDouble planetradius;
+
+	/*Look for x,y,z coordinates:*/
+	IssmDouble xyz_list[NUMVERTICES][3];
+	::GetVerticesCoordinates(&xyz_list[0][0],this->vertices,NUMVERTICES);
+	IssmDouble area,xe,ye,ze,late,longe;
+
+	/*Find centroid:*/
+	xe=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
+	ye=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
+	ze=(xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2])/3.0;
+
+	late= asin(ze/sqrt(pow(xe,2.0)+pow(ye,2.0)+pow(ze,2.0)));
+	longe= atan2(ye,xe);
+	area=this->GetAreaSpherical();
+
+	vlonge->SetValue(this->sid,longe,INS_VAL);
+	vlate->SetValue(this->sid,late,INS_VAL);
+	vareae->SetValue(this->sid,area,INS_VAL);
+
+	return;
 }
 /*}}}*/
@@ -1414,14 +1457,14 @@
 
 	/*1. Recover stresses at the base*/
-	GaussTria* gauss=new GaussTria();
+	GaussTria gauss;
 	for (int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
+		gauss.GaussVertex(iv);
 
 		/*Compute strain rate viscosity and pressure: */
-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
-		this->material->ViscosityFS(&viscosity,2,&xyz_list[0][0],gauss,vx_input,vy_input,NULL);
+		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
+		this->material->ViscosityFS(&viscosity,2,&xyz_list[0][0],&gauss,vx_input,vy_input,NULL);
 		/*FIXME: this is for Hongju only*/
-	//	pressureice[iv]=gravity*rho_ice*(surface[iv]-base[iv]);
-	//	if (pressure[iv]/pressureice[iv]>1) pressure[iv]=pressureice[iv];
+		//	pressureice[iv]=gravity*rho_ice*(surface[iv]-base[iv]);
+		//	if (pressure[iv]/pressureice[iv]>1) pressure[iv]=pressureice[iv];
 
 		/*Compute Stress*/
@@ -1450,7 +1493,4 @@
 		}
 	}
-
-	/*clean up*/
-	delete gauss;
 }
 /*}}}*/
@@ -1536,12 +1576,12 @@
 	/*retrieve coordinates: lat,long,radius */
 	::GetVerticesCoordinates(&llr_list[0][0],vertices,NUMVERTICES,spherical);
-	x1=llr_list[0][0]/180*PI; y1=llr_list[0][1]/180*PI; z1=llr_list[0][2];
-	x2=llr_list[1][0]/180*PI; y2=llr_list[1][1]/180*PI; z2=llr_list[1][2];
-	x3=llr_list[2][0]/180*PI; y3=llr_list[2][1]/180*PI; z3=llr_list[2][2];
+	x1=llr_list[0][0]/180.*M_PI; y1=llr_list[0][1]/180.*M_PI; z1=llr_list[0][2];
+	x2=llr_list[1][0]/180.*M_PI; y2=llr_list[1][1]/180.*M_PI; z2=llr_list[1][2];
+	x3=llr_list[2][0]/180.*M_PI; y3=llr_list[2][1]/180.*M_PI; z3=llr_list[2][2];
 
 	/*compute great circle distance between vertices */
-	arc12=2.*asin(sqrt(pow(sin((x2-x1)/2),2.0)+cos(x1)*cos(x2)*pow(sin((y2-y1)/2),2)));
-	arc23=2.*asin(sqrt(pow(sin((x3-x2)/2),2.0)+cos(x2)*cos(x3)*pow(sin((y3-y2)/2),2)));
-	arc31=2.*asin(sqrt(pow(sin((x1-x3)/2),2.0)+cos(x3)*cos(x1)*pow(sin((y1-y3)/2),2)));
+	arc12=2.*asin(sqrt(pow(sin(0.5*(x2-x1)),2)+cos(x1)*cos(x2)*pow(sin(0.5*(y2-y1)),2)));
+	arc23=2.*asin(sqrt(pow(sin(0.5*(x3-x2)),2)+cos(x2)*cos(x3)*pow(sin(0.5*(y3-y2)),2)));
+	arc31=2.*asin(sqrt(pow(sin(0.5*(x1-x3)),2)+cos(x3)*cos(x1)*pow(sin(0.5*(y1-y3)),2)));
 
 	/*semi parameter */
@@ -1597,5 +1637,5 @@
 }
 /*}}}*/
-void       Tria::GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating){/*{{{*/
+void       Tria::GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* pmainlyfloating){/*{{{*/
 	/*Computeportion of the element that is grounded*/
 
@@ -1648,5 +1688,5 @@
 	*fraction1=f1;
 	*fraction2=f2;
-	*mainlyfloating=floating;
+	*pmainlyfloating=floating;
 }
 /*}}}*/
@@ -1720,4 +1760,592 @@
 }
 /*}}}*/
+void       Tria::GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl){/*{{{*/
+
+	/*Computeportion of the element that is grounded*/
+	bool               trapezeisnegative=true; //default value
+	int                point;
+	const IssmPDouble  epsilon= 1.e-15;
+	IssmDouble         f1,f2,phi;
+
+	/*Weights: */
+	Gauss* gauss=NULL;
+	IssmDouble loadweights_g[NUMVERTICES];
+	IssmDouble total_weight=0;
+
+	_assert_(!xIsNan<IssmDouble>(gl[0]));
+	_assert_(!xIsNan<IssmDouble>(gl[1]));
+	_assert_(!xIsNan<IssmDouble>(gl[2]));
+
+	/*Be sure that values are not zero*/
+	if(gl[0]==0.) gl[0]=gl[0]+epsilon;
+	if(gl[1]==0.) gl[1]=gl[1]+epsilon;
+	if(gl[2]==0.) gl[2]=gl[2]+epsilon;
+
+	/*Check that not all nodes are positive or negative: */
+	if(gl[0]>0 && gl[1]>0 && gl[2]>0){ // All positive
+		point=0;
+		f1=1.;
+		f2=1.;
+	}
+	else if(gl[0]<0 && gl[1]<0 && gl[2]<0){ //All negative
+		point=0;
+		f1=0.;
+		f2=0.;
+	}
+	else{
+		if(gl[0]*gl[1]*gl[2]<0) trapezeisnegative=false; //no matter what configuration, there has to be two positive vertices, which means the trapeze is positive.
+
+		if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+			point=2;
+			f1=gl[2]/(gl[2]-gl[0]);
+			f2=gl[2]/(gl[2]-gl[1]);
+		}
+		else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
+			point=0;
+			f1=gl[0]/(gl[0]-gl[1]);
+			f2=gl[0]/(gl[0]-gl[2]);
+		}
+		else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+			point=1;
+			f1=gl[1]/(gl[1]-gl[2]);
+			f2=gl[1]/(gl[1]-gl[0]);
+		}
+		else _error_("case not possible");
+	}
+	if(trapezeisnegative) phi=1-f1*f2;
+	else phi=f1*f2;
+
+	/*Compute weights:*/
+	gauss = this->NewGauss(point,f1,f2,1-trapezeisnegative,2); //VV correction (16Nov2021)
+
+	total_weight=0;
+	for(int i=0;i<NUMVERTICES;i++)weights[i]=0;
+	while(gauss->next()){
+		TriaRef::GetNodalFunctions(&loadweights_g[0], gauss,P1Enum);
+		for(int i=0;i<NUMVERTICES;i++)weights[i]+=loadweights_g[i]*gauss->weight;
+		total_weight+=gauss->weight;
+	}
+	/*Normalizing to phi such that weights provide coefficients for integration over subelement (for averaging:phi*weights)*/  
+	if(total_weight>0.) for(int i=0;i<NUMVERTICES;i++)weights[i]/=total_weight/phi; 
+	else for(int i=0;i<NUMVERTICES;i++)weights[i]=0;
+
+	/*free ressources:*/
+	delete gauss;
+
+	/*Assign output pointers:*/
+	*pphi=phi;
+	*ppoint1=point;
+	*pfraction1=f1;
+	*pfraction2=f2;
+	*ptrapezeisnegative=trapezeisnegative;
+}
+/*}}}*/
+IssmDouble Tria::GetTriangleAreaSpherical(IssmDouble xyz_list[3][3]){/*{{{*/
+
+	IssmDouble x1,y1,z1,x2,y2,z2,x3,y3,z3;
+	IssmDouble arc12,arc23,arc31,semi_peri,excess;
+	IssmDouble lat1,lat2,lat3;
+	IssmDouble long1,long2,long3;
+	IssmDouble r1,r2,r3;
+
+	/*retrieve x,y,z coordinates: */
+	x1=xyz_list[0][0]; y1=xyz_list[0][1]; z1=xyz_list[0][2];
+	x2=xyz_list[1][0]; y2=xyz_list[1][1]; z2=xyz_list[1][2];
+	x3=xyz_list[2][0]; y3=xyz_list[2][1]; z3=xyz_list[2][2];
+
+	/*Build lat,long, r:*/
+	r1=sqrt(pow(x1,2.0)+pow(y1,2.0)+pow(z1,2.0));
+	r2=sqrt(pow(x2,2.0)+pow(y2,2.0)+pow(z2,2.0));
+	r3=sqrt(pow(x3,2.0)+pow(y3,2.0)+pow(z3,2.0));
+
+	lat1=asin(z1/r1); long1=atan2(y1,x1);
+	lat2=asin(z2/r2); long2=atan2(y2,x2);
+	lat3=asin(z3/r3); long3=atan2(y3,x3);
+
+	/*compute great circle distance between vertices */
+	arc12=2.*asin(sqrt(pow(sin(0.5*(lat2-lat1)),2)+cos(lat1)*cos(lat2)*pow(sin(0.5*(long2-long1)),2)));
+	arc23=2.*asin(sqrt(pow(sin(0.5*(lat3-lat2)),2)+cos(lat2)*cos(lat3)*pow(sin(0.5*(long3-long2)),2)));
+	arc31=2.*asin(sqrt(pow(sin(0.5*(lat1-lat3)),2)+cos(lat3)*cos(lat1)*pow(sin(0.5*(long1-long3)),2)));
+
+	/*semi parameter */
+	semi_peri=(arc12+arc23+arc31)/2;
+
+	/*spherical excess */
+	excess=4.*atan(sqrt(tan(semi_peri/2)*tan((semi_peri-arc12)/2)*tan((semi_peri-arc23)/2)*tan((semi_peri-arc31)/2)));
+
+	/*area = excess*radius^2 */
+	return excess*pow((r1+r2+r3)/3,2);
+}
+/*}}}*/
+void       Tria:: GetBarycenterFromLevelset(IssmDouble* platbar, IssmDouble* plongbar,IssmDouble phi,IssmDouble fraction1,IssmDouble fraction2,IssmDouble late, IssmDouble longe, int point1,int istrapeze1, IssmDouble planetradius){ /*{{{*/
+
+	int i0,i1,i2;
+
+	IssmDouble xyz0[3][3];
+	IssmDouble barycenter[3]={0};
+	IssmDouble centroid[3]={0};
+
+	::GetVerticesCoordinates(&xyz0[0][0],vertices,NUMVERTICES); // initial triangle
+
+	i0=point1;
+	i1=(point1+1)%3;
+	i2=(point1+2)%3;
+
+	//Barycenter of the subelement triangle:
+	for (int i=0;i<3;i++) barycenter[i]=xyz0[i0][i]*(3.0-fraction1-fraction2)/3.0 + fraction1/3.0*xyz0[i1][i] + fraction2/3.0*xyz0[i2][i];
+
+	if (istrapeze1){
+		centroid[0]=planetradius*cos(late*M_PI/180.0) * cos(longe*M_PI/180.0); //x
+		centroid[1]=planetradius*cos(late*M_PI/180.0) * sin(longe*M_PI/180.0);  //y
+		centroid[2]=planetradius*sin(late*M_PI/180.0);					//z
+
+		// centroid_el *area_el= barycenter_triangle * area_triangle + barycenter_trapeze * area_trapeze
+		// and phi_trapeze = area_trapeze/area_el = (1 - area_triangle/area_el)
+		// => barycenter_trapeze = (centroid_el - barycenter_triangle * (1-phi_trapeze) )/phi_trapeze
+		for (int i=0;i<3;i++) barycenter[i] =(centroid[i] -barycenter[i]*(1.0-phi))/phi;
+
+	}
+
+	//recompute planetradius from the barycenter onwards:
+	planetradius=sqrt( pow(barycenter[0],2.0)+ pow(barycenter[1],2.0)+ pow(barycenter[2],2.0));
+
+	*platbar=asin(barycenter[2]/planetradius)*180.0/M_PI;
+	*plongbar=atan2(barycenter[1],barycenter[0])*180.0/M_PI;
+
+} /*}}}*/
+void       Tria::GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelsetenum){ /*{{{*/
+
+	IssmDouble phi;
+	IssmDouble fraction1,fraction2;
+	bool istrapeze1;  
+	bool flip1=false;
+	int  point1;
+	IssmDouble levelset[NUMVERTICES];
+	IssmDouble planetradius;
+
+	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
+
+	//figure out if we are flipping the levelsets: 
+	if(levelsetenum<0){
+		levelsetenum=-levelsetenum;
+		flip1=true;
+	}
+	//figure out area where we have loads
+	Element::GetInputListOnVertices(&levelset[0],levelsetenum);
+	if(flip1)for(int i=0;i<NUMVERTICES;i++)levelset[i]=-levelset[i];
+
+	//compute sea level load weights
+	this->GetFractionGeometry(loadweights,&phi,&point1,&fraction1,&fraction2,&istrapeze1,levelset);
+
+	this->GetBarycenterFromLevelset(platbar,plongbar, phi, fraction1, fraction2, late, longe, point1,istrapeze1,planetradius);
+
+	/*assign output pointers:*/
+	*ploadarea=phi*area;
+
+} /*}}}*/
+void       Tria::GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelset1enum, int levelset2enum){ /*{{{*/
+
+	bool istrapeze1, istrapeze2;
+	IssmDouble phi1,phi2, d,e,f,g,h1,h2;
+	int point1, point2,  i0,i1,i2,j0,j1,j2;
+	IssmDouble weights1[3],weights2[3];
+	IssmDouble levelset1[3];
+	IssmDouble levelset2[3];
+
+	bool flip1=false;
+	bool flip2=false;
+
+	IssmDouble xyz0[3][3];
+	IssmDouble xyz1[3][3]={0};
+	IssmDouble xyz2[3][3]={0};
+	IssmDouble xyz3[3][3]={0};
+	IssmDouble xyz[8][3]={0};
+	IssmDouble w[8][NUMVERTICES]={0};
+	IssmDouble areasub=0;
+	IssmDouble area1=0;
+	IssmDouble area2=0;
+	IssmDouble area3=0;
+
+	int tria0[3]={0,1,2};
+	int tria1[3]={-1};
+	int tria2[3]={-1};
+	int tria3[3]={-1};
+
+	IssmDouble w1[3][3]={0};
+	IssmDouble w2[3][3]={0};
+	IssmDouble w3[3][3]={0};
+
+	IssmDouble barycenter[3]={0};
+	IssmDouble planetradius;
+
+	//figure out if we are flipping the levelsets: 
+	if(levelset1enum<0){
+		levelset1enum=-levelset1enum;
+		flip1=true;
+	}
+	if(levelset2enum<0){
+		levelset2enum=-levelset2enum;
+		flip2=true;
+	}
+
+	//recover levelsets: 
+	Element::GetInputListOnVertices(&levelset1[0],levelset1enum);
+	if(flip1)for(int i=0;i<NUMVERTICES;i++)levelset1[i]=-levelset1[i];
+	Element::GetInputListOnVertices(&levelset2[0],levelset2enum);
+	if(flip2)for(int i=0;i<NUMVERTICES;i++)levelset2[i]=-levelset2[i];
+
+	//We want the fraction of the element where both levelsets are negative.
+	//Early return if either of them is >=0 on all vertices
+	if (levelset1[0]>=0 && levelset1[1]>=0 && levelset1[2]>=0) {
+		for (int i=0;i<NUMVERTICES;i++) loadweights[i]=0.0;
+		*ploadarea= 0.0;
+		*platbar=late; //just default to centroid of triangle
+		*plongbar=longe; 
+		return;
+	}
+	if (levelset2[0]>=0 && levelset2[1]>=0 && levelset2[2]>=0) {
+		for (int i=0;i<NUMVERTICES;i++) loadweights[i]=0.0;
+		*ploadarea= 0.0;
+		*platbar=late; //just default to centroid of triangle
+		*plongbar=longe; 
+		return;
+	}
+
+	//If everyone is negative, no need to calculate any fraction
+	if (levelset1[0]<=0 && levelset1[1]<=0 && levelset1[2]<=0 && levelset2[0]<=0 && levelset2[1]<=0 && levelset2[2]<=0) {
+		for (int i=0;i<NUMVERTICES;i++) loadweights[i]=1.0/NUMVERTICES;
+		*ploadarea= area;
+		*platbar=late;
+		*plongbar=longe;
+		return;
+	}
+
+	/*recover planet radius:*/
+	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
+
+	//If just one levelset is all negative, just take the partitioning of the other, no interaction between them
+	if (levelset1[0]<=0 && levelset1[1]<=0 && levelset1[2]<=0) {
+		this->GetFractionGeometry(loadweights,&phi2,&point2,&f,&g,&istrapeze2,levelset2);
+		this->GetBarycenterFromLevelset(platbar,plongbar, phi2, f, g, late, longe, point2,istrapeze2,planetradius);
+		*ploadarea=area*phi2;
+		return;
+	}
+	if (levelset2[0]<=0 && levelset2[1]<=0 && levelset2[2]<=0) {
+		this->GetFractionGeometry(loadweights,&phi1,&point1,&d,&e,&istrapeze1,levelset1);
+		this->GetBarycenterFromLevelset(platbar,plongbar, phi1, d, e, late, longe, point1,istrapeze1,planetradius);
+		*ploadarea=area*phi1;
+		return;
+	}
+
+	this->GetFractionGeometry(&weights1[0],&phi1,&point1,&d,&e,&istrapeze1,levelset1);
+	this->GetFractionGeometry(&weights2[0],&phi2,&point2,&f,&g,&istrapeze2,levelset2);
+
+	//Early return if levelsets are not independent
+	if (istrapeze1==istrapeze2 && point1==point2 && phi1==phi2){
+		//the two levelsets are redundant: levelset1 = positivescalar * levelset2
+		this->GetBarycenterFromLevelset(platbar,plongbar, phi1, d, e, late, longe, point1,istrapeze1,planetradius);
+		*ploadarea=area*phi1;
+		for (int i=0;i<NUMVERTICES;i++) loadweights[i]=weights1[i];
+		return;
+	}
+	if (istrapeze1!=istrapeze2 && point1==point2 && phi1==(1.0-phi2)){
+		//the two levelsets are incompatible: levelset1 = negativescalar * levelset2
+		*plongbar=longe;
+		*platbar=late;
+		*ploadarea=0.0;
+		for (int i=0;i<NUMVERTICES;i++) loadweights[i]=0.0;
+		return;
+	}
+
+	::GetVerticesCoordinates(&xyz0[0][0],vertices,NUMVERTICES); // initial triangle
+
+	//Let our element be triangle ABC with:
+	i0=point1; //A
+	i1=(point1+1)%3; //B
+	i2=(point1+2)%3; //C
+
+	j0=point2; //Can be A, B or C
+	j1=(point2+1)%3; //anticlockwise point from j0
+	j2=(point2+2)%3; //clockwise point from j0
+
+	/* Below we define the relative fractional lengths of ABC where the zero-level contours of the two level sets intersect with ABC and each other. For example D is the intersection of level set 1 with side AB with fractional length d=[AD]/[AB].
+
+	   levelset1 intersects ABC on D and E:
+	   A------D---B
+	   <--d--->		
+
+	   A-----E----C
+	   <--e-->
+
+	   levelset2 intersects ABC on F and G:
+	   j0---F------j1
+	   <--f->
+
+	   j0-------G--j2
+	   <---g---->
+
+	   levelset1 and 2 intersect on H (when that intersection exists inside the element)
+	   D----H------E
+	   <-h1->
+
+	   F-----H----G
+	   <--h2->
+	*/
+
+	if (point2==i0){
+		h1= g*(d-f)/(d*g-e*f);
+		h2= e/g * h1;
+	}
+        else if (point2==i1){
+		h1=f*(1.0-g-d)/(f*(e-d)-e*g);
+		h2= 1.0-e/f * h1;
+	}
+	else if (point2==i2){
+		h1= (g*(1.0-f-d)+f*d)/(g*(e-d) +f*d); 
+		h2= (d*(f+e-1))/(g*(e-d) +f*d);
+	}
+
+	//interpolant weights of each point. Any field F[0,1,2] provided at the original vertices [0,1,2] will be equal on point k to sum_i (F[i] * w[k][i])
+	w[0][0]=1; //A
+	w[1][1]=1; //B
+	w[2][2]=1; //C
+	w[3][i0]=1.0-d; w[3][i1]=d; //D
+	w[4][i0]=1.0-e; w[4][i2]=e; //E
+	w[5][j0]=1.0-f; w[5][j1]=f; //F
+	w[6][j0]=1.0-g; w[6][j2]=g; //G
+	for (int j=0;j<3;j++) w[7][j]=w[3][j]*(1.0-h1) + w[4][j]*h1; //H: we interpolate the intersection point H between D and E at fraction h1
+
+	for (int k=0;k<8;k++){
+		for (int i=0;i<NUMVERTICES;i++) {
+			for (int j=0;j<3;j++) xyz[k][j]+=xyz0[i][j]*w[k][i];
+		}
+	}
+
+		//point2 can be either i0,i1 or i2. We start the search with i1 and i2 as they have less computational cost in ifs
+		if(point2==i2){ /*{{{*/
+			if (e>1.0-f){ /*{{{*/
+				if (!istrapeze1 && !istrapeze2){
+					tria1[0]=5; tria1[1]= 7; tria1[2]= 4; // FHE
+					area1=h2*(e+f-1.0)*g;
+				}
+				else if (!istrapeze1 && istrapeze2){
+					tria1[0]=i0; tria1[1]= 3; tria1[2]= 5; //ADF
+					area1=d*(1.0-f);
+					tria2[0]=3; tria2[1]= 7; tria2[2]= 5; //DHF
+					area2=d*h1*(e+f-1.0);
+				}
+				else if (istrapeze1 && !istrapeze2){
+					tria1[0]=7; tria1[1]= 6; tria1[2]= 4; //HGE
+					area1=g*(1.0-h2)*(e+f-1.0);
+					tria2[0]=4; tria2[1]= 6; tria2[2]= i2; //EGC
+					area2=g*(1.0-e);
+				}
+				else { //istrapeze1 && istrapeze2
+					tria1[0]=3; tria1[1]= i1; tria1[2]= 6; //DBG
+					area1=(1.0-d)*(1.0-g);
+					tria2[0]=3; tria2[1]= 6; tria2[2]= 7; //DGH
+					area2=g*((1.0-f)*(1.0-h2)+h2*e)+d*(1.0-e-g);
+				}  /*}}}*/
+			}
+			else if (e<=1.0-f){ /*{{{*/
+				if (!istrapeze1 && !istrapeze2){
+				}
+				else if (!istrapeze1 && istrapeze2){
+					tria1[0]=i0; tria1[1]= 3; tria1[2]= 4; //ADE
+					area1=d*e;
+				}
+				else if (istrapeze1 && !istrapeze2){
+					tria1[0]=5; tria1[1]= 6; tria1[2]= i2; //FGC
+					area1=f*g;
+				}
+				else { //istrapeze1 && istrapeze2
+					tria1[0]=3; tria1[1]= i1; tria1[2]= 5; //DBF
+			                area1=(1.0-d)*(1.0-f);
+					tria2[0]=4; tria2[1]= 3; tria2[2]= 5;  //EDF
+			                area2=d*(1.0-e-f);
+					tria3[0]=5; tria3[1]= i1; tria3[2]= 6; //FBG
+			                area3=f*(1.0-g);
+				} /*}}}*/
+			} 
+		}/*}}}*/    
+		else if(point2==i1){ /*{{{*/
+			if (d>1.0-g){ /*{{{*/
+				if (!istrapeze1 && !istrapeze2){
+					tria1[0]=6; tria1[1]= 3; tria1[2]= 7; //GDH
+					area1=(1.0-h2)*(d+g-1.0)*f;
+				}
+				else if (!istrapeze1 && istrapeze2){
+					tria1[0]=i0; tria1[1]= 6; tria1[2]= 4; //AGE
+			                area1=(1.0-g)*e;
+					tria2[0]=6; tria2[1]= 7; tria2[2]= 4; //GHE
+			                area2=e*(1.0-h1)*(g+d-1.0);
+				}
+				else if (istrapeze1 && !istrapeze2){
+					tria1[0]=i1; tria1[1]= 5; tria1[2]= 3; //BFD
+			                area1=(1.0-d)*f;
+					tria2[0]=3; tria2[1]= 5; tria2[2]= 7; //DFH
+					area2=f*h2*(d+g-1.0);
+				}
+				else { //istrapeze1 && istrapeze2
+					tria1[0]=7; tria1[1]= 5; tria1[2]= 4; //HFE
+			                area1=e*((1.0-d)*(1.0-h1)+h1*g)+f*(1.0-g-e);
+					tria2[0]=4; tria2[1]= 5; tria2[2]= i2;//EFC
+			                area2=(1.0-e)*(1.0-f);
+				}  /*}}}*/
+			}
+			else if (d<=1.0-g){ /*{{{*/
+				if (!istrapeze1 && !istrapeze2){
+				}
+				else if (!istrapeze1 && istrapeze2){
+					tria1[0]=i0; tria1[1]= 3; tria1[2]= 4; //ADE
+			                area1=d*e;
+				}
+				else if (istrapeze1 && !istrapeze2){
+					tria1[0]=6; tria1[1]= i1; tria1[2]= 5; //GBF
+			                area1=f*g;
+				}
+				else { //istrapeze1 && istrapeze2
+					tria1[0]=3; tria1[1]= 6; tria1[2]= 4; //DGE
+					area1=e*(1.0-d-g);
+					tria2[0]=6; tria2[1]= i2; tria2[2]= 4; //GCE
+					area2=(1.0-g)*(1.0-e);
+					tria3[0]=6; tria3[1]= 5; tria3[2]= i2; //GFC
+					area3=g*(1.0-f);
+				} /*}}}*/
+			}
+
+		}/*}}}*/
+		else{ /*{{{*/
+			if (d<=f && e>=g){  /*{{{*/
+				if (!istrapeze1 && !istrapeze2){
+					tria1[0]=i0; tria1[1]= 3; tria1[2]= 7; //ADH
+			                area1=h1*d*e;
+					tria2[0]=i0; tria2[1]= 7; tria2[2]= 6; //AHG
+			                area2=(1.0-h2)*f*g;
+				}
+				else if (!istrapeze1 && istrapeze2){
+					tria1[0]=6; tria1[1]= 7; tria1[2]= 4; //GHE
+			                area1=(e-g)*d*(1.0-h1);
+				}
+				else if (istrapeze1 && !istrapeze2){
+					tria1[0]=3; tria1[1]= 5; tria1[2]= 7; //DFH
+					area1=(f-d)*g*h2;
+				}
+				else { //istrapeze1 && istrapeze2
+					tria1[0]=5; tria1[1]= i1; tria1[2]= 7; //FBH
+			                area1=g*h2*(1.0-f);
+					tria2[0]=7; tria2[1]= i1; tria2[2]= i2;//HBC
+			                area2=1.0+d*(h1-e*h1-1.0)+g*h2*(d-1.0);
+					tria3[0]=7; tria3[1]= i2; tria3[2]= 4; //HCE
+			                area3=d*(1.0-h1)*(1.0-e);
+				} /*}}}*/
+			}
+			else if (d>=f && e<=g){ /*{{{*/
+				if (!istrapeze1 && !istrapeze2){
+					tria1[0]=i0; tria1[1]= 5; tria1[2]= 7; //AFH
+			                area1=h2*f*g;
+					tria2[0]=i0; tria2[1]= 7; tria2[2]= 4; //AHE
+			                area2=(1.0-h1)*d*e;
+				}else if (!istrapeze1 && istrapeze2){
+					tria1[0]=5; tria1[1]= 3; tria1[2]= 7; //FDH
+			                area1=(d-f)*e*h1;
+				}else if (istrapeze1 && !istrapeze2){
+					tria1[0]=4; tria1[1]= 7; tria1[2]= 6; //EHG
+			                area1=(g-e)*f*(1.0-h2);
+				}else { //istrapeze1 && istrapeze2
+					tria1[0]=3; tria1[1]= i1; tria1[2]= 7; //DBH
+			                area1=e*h1*(1.0-d);
+					tria2[0]=7; tria2[1]= i1; tria2[2]= 6; //HCG
+			                area2=f*(1.0-h2)*(1.0-g);
+					tria3[0]=6; tria3[1]= i1; tria3[2]= i2; //HBC
+			                area3=1.0+f*(h2-g*h2-1.0)+e*h1*(f-1.0);
+				}  /*}}}*/
+			}
+			else if (d<=f && e<=g){ /*{{{*/
+				if (!istrapeze1 && !istrapeze2){
+					tria1[0]=i0; tria1[1]= 3; tria1[2]= 4;//ADE
+					area1=d*e;
+				}else if (!istrapeze1 && istrapeze2){
+				}else if (istrapeze1 && !istrapeze2){
+					tria1[0]=3; tria1[1]= 5; tria1[2]= 6; //DFG
+			                area1=g*(f-d);
+					tria2[0]=3; tria2[1]= 6; tria2[2]= 4; //DGE
+			                area2=d*(g-e);
+				}else { //istrapeze1 && istrapeze2
+					tria1[0]=5; tria1[1]= i2; tria1[2]= 6; //FCG
+			                area1=f*(1.0-g);
+					tria2[0]=5; tria2[1]= i1; tria2[2]= i2;//FBC
+			                area2=1.0-f;
+				}  /*}}}*/
+			}
+			else if (d>=f && e>=g){ /*{{{*/
+				if (!istrapeze1 && !istrapeze2){
+					tria1[0]=i0; tria1[1]= 5; tria1[2]= 6; //AFG
+			                area1=f*g;
+				}else if (!istrapeze1 && istrapeze2){
+					tria1[0]=5; tria1[1]= 4; tria1[2]= 6; //FEG
+			                area1=f*(e-g);
+					tria2[0]=5; tria2[1]= 3; tria2[2]= 4; //FDE
+			                area2=e*(d-f);
+				}else if (istrapeze1 && !istrapeze2){
+				}else { //istrapeze1 && istrapeze2
+					tria1[0]=3; tria1[1]= i1; tria1[2]= i2; //DBC
+			                area1=1.0-d;
+					tria2[0]=3; tria2[1]= i2; tria2[2]= 4;//DCE
+			                area2=d*(1.0-e);
+				}  /*}}}*/
+			} 
+		} /*}}}*/
+
+	if(tria1[0]>-1){ 
+		for (int i=0;i<NUMVERTICES;i++){
+			for (int j=0;j<3;j++) {
+				xyz1[i][j]=xyz[tria1[i]][j];
+				w1[i][j]=w[tria1[i]][j];
+			}
+		}
+		area1*=area; //dimensionalize the fractional area from [0:1] to [0:area]
+	}
+	if(tria2[0]>-1){ 
+		for (int i=0;i<NUMVERTICES;i++){
+			for (int j=0;j<3;j++) {
+				xyz2[i][j]=xyz[tria2[i]][j];
+				w2[i][j]=w[tria2[i]][j];
+			}
+		}
+		area2*=area;
+	}
+	if(tria3[0]>-1){ 
+		for (int i=0;i<NUMVERTICES;i++){
+			for (int j=0;j<3;j++) {
+				xyz3[i][j]=xyz[tria3[i]][j];
+				w3[i][j]=w[tria3[i]][j];
+			}
+		}
+		area3*=area;
+	}
+
+	areasub=area1+area2+area3;
+
+	if (areasub>0){
+		for (int j=0;j<3;j++){
+			for (int i=0;i<NUMVERTICES;i++) {
+				loadweights[j]=w1[i][j]*area1 + w2[i][j]*area2 + w3[i][j]*area3;
+				barycenter[j]+=xyz1[i][j]*area1+xyz2[i][j]*area2+xyz3[i][j]*area3;
+			}
+			loadweights[j]/=area;
+			barycenter[j]/=areasub *3.0;
+		}
+		*platbar=asin(barycenter[2]/sqrt(pow(barycenter[0],2.0)+pow(barycenter[1],2.0)+pow(barycenter[2],2.0)))*180.0/M_PI;
+		*plongbar=atan2(barycenter[1],barycenter[0])*180.0/M_PI;
+	} 
+	else {
+		for(int j=0;j<3;j++)loadweights[j]=0.0;
+		*platbar=late;
+		*plongbar=longe;
+	}
+	*ploadarea=areasub;
+
+} /*}}}*/
 IssmDouble Tria::GetIcefrontArea(){/*{{{*/
 
@@ -1869,5 +2497,4 @@
 		TriaInput* input = this->inputs->GetTriaInput(inputenum);
 		if(!input) return input;
-
 		this->InputServe(input);
 		return input;
@@ -1977,4 +2604,5 @@
 				input->Serve(numindices,&indices[0]);
 				break;
+			case P1xP4Enum:
 			case P1DGEnum:
 			case P1bubbleEnum:
@@ -2143,4 +2771,5 @@
 
 	/*Assign output pointers*/
+	xDelete<IssmDouble>(timesteps);
 	*pvalues=values;
 	*ptimes=times;
@@ -2155,9 +2784,7 @@
 	int index = this->GetNodeIndex(node);
 
-	GaussTria* gauss=new GaussTria();
-	gauss->GaussNode(this->element_type,index);
-
-	input->GetInputValue(pvalue,gauss);
-	delete gauss;
+	GaussTria gauss;
+	gauss.GaussNode(this->element_type,index);
+	input->GetInputValue(pvalue,&gauss);
 }
 /*}}}*/
@@ -2169,9 +2796,7 @@
 	int index = this->GetVertexIndex(vertex);
 
-	GaussTria* gauss=new GaussTria();
-	gauss->GaussVertex(index);
-
-	input->GetInputValue(pvalue,gauss);
-	delete gauss;
+	GaussTria gauss;
+	gauss.GaussVertex(index);
+	input->GetInputValue(pvalue,&gauss);
 }
 /*}}}*/
@@ -2222,5 +2847,5 @@
 
 	/*Intermediaries*/
-	int i, numiceverts, numnoiceverts;
+	int numiceverts, numnoiceverts;
 	int ind0, ind1, lastindex;
 	int indices_ice[NUMVERTICES],indices_noice[NUMVERTICES];
@@ -2234,5 +2859,5 @@
 	 * Exploit: ice/no-ice parts are connected, so find starting vertex of segment*/
 	lastindex=0;
-	for(i=0;i<NUMVERTICES;i++){ // go backwards along vertices, and check for sign change
+	for(int i=0;i<NUMVERTICES;i++){ // go backwards along vertices, and check for sign change
 		ind0=(NUMVERTICES-i)%NUMVERTICES;
 		ind1=(ind0-1+NUMVERTICES)%NUMVERTICES;
@@ -2248,5 +2873,5 @@
 	numiceverts=0;
 	numnoiceverts=0;
-	for(i=0;i<NUMVERTICES;i++){
+	for(int i=0;i<NUMVERTICES;i++){
 		ind0=(lastindex+i)%NUMVERTICES;
 		if(lsf[i]<=level){
@@ -2260,24 +2885,28 @@
 	}
 	//merge indices
-	for(i=0;i<numiceverts;i++){indices[i]=indices_ice[i];}
-	for(i=0;i<numnoiceverts;i++){indices[numiceverts+i]=indices_noice[i];}
-
-	switch (numiceverts){
+	for(int i=0;i<numiceverts;  i++){
+		indices[i]=indices_ice[i];
+	}
+	for(int i=0;i<numnoiceverts;i++){
+		indices[numiceverts+i]=indices_noice[i];
+	}
+
+	switch(numiceverts){
 		case 0: // no vertex has ice: element is ice free, no intersection
-			for(i=0;i<2;i++)
+			for(int i=0;i<2;i++)
 				fraction[i]=0.;
 			break;
 		case 1: // one vertex has ice:
-			for(i=0;i<2;i++){
+			for(int i=0;i<2;i++){
 				fraction[i]=(level-lsf[indices[0]])/(lsf[indices[numiceverts+i]]-lsf[indices[0]]);
 			}
 			break;
 		case 2: // two vertices have ice: fraction is computed from first ice vertex to last in CCW fashion
-			for(i=0;i<2;i++){
+			for(int i=0;i<2;i++){
 				fraction[i]=(level-lsf[indices[i]])/(lsf[indices[numiceverts]]-lsf[indices[i]]);
 			}
 			break;
 		case NUMVERTICES: // all vertices have ice: return triangle area
-			for(i=0;i<2;i++)
+			for(int i=0;i<2;i++)
 				fraction[i]=1.;
 			break;
@@ -2860,4 +3489,5 @@
 	parameters->FindParam(&domaintype,DomainTypeEnum);
 
+	/*Relict code
 	if(false && IsIcefront()){
 		//Assumption: linear ice thickness profile on element.
@@ -2914,5 +3544,39 @@
 		for(i=0;i<numthk;i++)	Haverage+=H[i];
 		Haverage/=IssmDouble(numthk);
-	}
+	}*/
+
+   IssmDouble lsf[NUMVERTICES];
+	Element::GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
+   /*Deal with partially ice-covered elements*/
+	if(lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0){
+		bool istrapneg;
+      int point;
+      IssmDouble weights[NUMVERTICES];
+      IssmDouble surfaces[NUMVERTICES];
+      IssmDouble bases[NUMVERTICES];
+      IssmDouble Hice[NUMVERTICES];
+      IssmDouble area_basetot,f1,f2,phi;
+      /*Average thickness over subelement*/
+		Element::GetInputListOnVertices(&surfaces[0],SurfaceEnum);
+      Element::GetInputListOnVertices(&bases[0],BaseEnum);
+      GetFractionGeometry(weights,&phi,&point,&f1,&f2,&istrapneg,lsf);
+      for(int i=0;i<NUMVERTICES;i++) Hice[i] = surfaces[i]-bases[i];
+      Haverage = 0.0;
+		/*Use weights[i]/phi to get average thickness over subelement*/
+      for(int i=0;i<NUMVERTICES;i++) Haverage += weights[i]/phi*Hice[i];
+		/*Get back area of ice-covered base*/
+		area_basetot = this->GetArea();
+		area_base    = phi*area_basetot;
+
+		/*Account for scaling factor averaged over subelement*/
+		if(scaled==true){
+			IssmDouble* scalefactor_vertices = xNew<IssmDouble>(NUMVERTICES);
+			Element::GetInputListOnVertices(&scalefactor_vertices[0],MeshScaleFactorEnum);
+			scalefactor = 0.0;
+			for(int i=0;i<NUMVERTICES;i++) scalefactor += weights[i]/phi*scalefactor_vertices[i];
+			area_base = area_base*scalefactor;
+			xDelete<IssmDouble>(scalefactor_vertices);
+		}
+   }
 	else{
 		/*First get back the area of the base*/
@@ -2932,4 +3596,5 @@
 	}
 
+	
 	/*Cleanup & return: */
 	xDelete<int>(indices);
@@ -2952,5 +3617,5 @@
 	IssmDouble xyz_list[NUMVERTICES][3];
 
-	if(!IsIceInElement() || IsFloating())return 0;
+	if(!IsIceInElement() || IsAllFloating())return 0;
 
 	rho_ice=FindParam(MaterialsRhoIceEnum);
@@ -3257,18 +3922,10 @@
 
 	/*intermediary: */
-	IssmDouble* values=NULL;
-	Input*     thickness_input=NULL;
 	IssmDouble  thickness;
-	IssmDouble  weight;
 	IssmDouble  Jdet;
-	IssmDouble  volume;
-	IssmDouble  rho_ice;
 	int         point1;
 	IssmDouble  fraction1,fraction2;
 	bool        mainlynegative=true;
 
-	/*Output:*/
-	volume=0;
-
 	/* Get node coordinates and dof list: */
 	IssmDouble  xyz_list[NUMVERTICES][3];
@@ -3276,11 +3933,11 @@
 
 	/*Retrieve inputs required:*/
-	thickness_input=this->GetInput(ThicknessEnum); _assert_(thickness_input);
+	Input* thickness_input=this->GetInput(ThicknessEnum); _assert_(thickness_input);
 
 	/*Retrieve material parameters: */
-	rho_ice=FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
 
 	/*Retrieve values of the levelset defining the masscon: */
-	values = xNew<IssmDouble>(NUMVERTICES);
+	IssmDouble values[NUMVERTICES];
 	for(int i=0;i<NUMVERTICES;i++){
 		values[i]=levelset[this->vertices[i]->Sid()];
@@ -3288,19 +3945,15 @@
 
 	/*Ok, use the level set values to figure out where we put our gaussian points:*/
-	this->GetLevelsetPositivePart(&point1,&fraction1,&fraction2,&mainlynegative,values);
+	this->GetLevelsetPositivePart(&point1,&fraction1,&fraction2,&mainlynegative,&values[0]);
 	Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,mainlynegative,4);
 
-	volume=0;
-
+	IssmDouble volume=0.;
 	while(gauss->next()){
-
 		this->JacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
 		thickness_input->GetInputValue(&thickness, gauss);
-
 		volume+=thickness*gauss->weight*Jdet;
 	}
 
 	/* clean up and Return: */
-	xDelete<IssmDouble>(values);
 	delete gauss;
 	return rho_ice*volume;
@@ -3324,8 +3977,8 @@
 
 	/*get area coordinates of 0 and 1 locations: */
-	GaussTria* gauss_1=new GaussTria();
-	gauss_1->GaussFromCoords(x1,y1,&xyz_list[0][0]);
-	GaussTria* gauss_2=new GaussTria();
-	gauss_2->GaussFromCoords(x2,y2,&xyz_list[0][0]);
+	GaussTria gauss_1;
+	gauss_1.GaussFromCoords(x1,y1,&xyz_list[0][0]);
+	GaussTria gauss_2;
+	gauss_2.GaussFromCoords(x2,y2,&xyz_list[0][0]);
 
 	/*Get segment length and normal (needs to be properly oriented)*/
@@ -3348,10 +4001,10 @@
 	}
 
-	thickness_input->GetInputValue(&h1, gauss_1);
-	thickness_input->GetInputValue(&h2, gauss_2);
-	vx_input->GetInputValue(&vx1,gauss_1);
-	vx_input->GetInputValue(&vx2,gauss_2);
-	vy_input->GetInputValue(&vy1,gauss_1);
-	vy_input->GetInputValue(&vy2,gauss_2);
+	thickness_input->GetInputValue(&h1, &gauss_1);
+	thickness_input->GetInputValue(&h2, &gauss_2);
+	vx_input->GetInputValue(&vx1,&gauss_1);
+	vx_input->GetInputValue(&vx2,&gauss_2);
+	vy_input->GetInputValue(&vy1,&gauss_1);
+	vy_input->GetInputValue(&vy2,&gauss_2);
 
 	mass_flux= rho_ice*length*(
@@ -3361,6 +4014,4 @@
 
 	/*clean up and return:*/
-	delete gauss_1;
-	delete gauss_2;
 	return mass_flux;
 }
@@ -3444,4 +4095,327 @@
 }
 /*}}}*/
+void	      Tria::MovingFrontalVelocity(void){/*{{{*/
+
+	int  dim, domaintype, calvinglaw, i;
+	IssmDouble v[3],w[3],c[3],m[3],dlsf[3];
+	IssmDouble norm_dlsf, norm_calving, calvingrate, meltingrate, groundedice;
+	IssmDouble migrationmax, calvinghaf, heaviside, haf_eps;
+	IssmDouble  xyz_list[NUMVERTICES][3];
+	IssmDouble  movingfrontvx[NUMVERTICES];
+	IssmDouble  movingfrontvy[NUMVERTICES];
+	IssmDouble  vel;
+
+	/* Get node coordinates and dof list: */
+	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+
+	Input* vx_input           = NULL;
+	Input* vy_input           = NULL;
+	Input* calvingratex_input = NULL;
+	Input* calvingratey_input = NULL;
+	Input* lsf_slopex_input   = NULL;
+	Input* lsf_slopey_input   = NULL;
+	Input* calvingrate_input  = NULL;
+	Input* meltingrate_input  = NULL;
+	Input* gr_input           = NULL;
+
+	/*Get problem dimension and whether there is moving front or not*/
+	this->FindParam(&domaintype,DomainTypeEnum);
+	this->FindParam(&calvinglaw,CalvingLawEnum);
+
+	switch(domaintype){
+		case Domain2DverticalEnum:   dim = 1; break;
+		case Domain2DhorizontalEnum: dim = 2; break;
+		case Domain3DEnum:           dim = 2; break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+	/*Load velocities*/
+	switch(domaintype){
+		case Domain2DverticalEnum:
+			vx_input=this->GetInput(VxEnum); _assert_(vx_input);
+			break;
+		case Domain2DhorizontalEnum:
+			vx_input=this->GetInput(VxEnum); _assert_(vx_input);
+			vy_input=this->GetInput(VyEnum); _assert_(vy_input);
+			gr_input=this->GetInput(MaskOceanLevelsetEnum); _assert_(gr_input);
+			break;
+		case Domain3DEnum:
+			vx_input=this->GetInput(VxAverageEnum); _assert_(vx_input);
+			vy_input=this->GetInput(VyAverageEnum); _assert_(vy_input);
+			gr_input=this->GetInput(MaskOceanLevelsetEnum); _assert_(gr_input);
+			break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+
+	switch(calvinglaw){
+		case DefaultCalvingEnum:
+		case CalvingVonmisesEnum:
+			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			calvingrate_input = this->GetInput(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
+			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			break;
+		case CalvingLevermannEnum:
+			switch(domaintype){
+				case Domain2DverticalEnum:
+					calvingratex_input=this->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+					break;
+				case Domain2DhorizontalEnum:
+					calvingratex_input=this->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+					calvingratey_input=this->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
+					break;
+				case Domain3DEnum:
+					calvingratex_input=this->GetInput(CalvingratexAverageEnum); _assert_(calvingratex_input);
+					calvingratey_input=this->GetInput(CalvingrateyAverageEnum); _assert_(calvingratey_input);
+					break;
+				default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+			}
+			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			break;
+		case CalvingMinthicknessEnum:
+			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			break;
+		case CalvingHabEnum:
+			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			break;
+		case CalvingCrevasseDepthEnum:
+			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			break;
+		case CalvingDev2Enum:
+			this->FindParam(&calvinghaf,CalvingHeightAboveFloatationEnum);
+			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			calvingrate_input = this->GetInput(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
+			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			break;
+		default:
+			_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
+	}
+
+	/* Start looping on the number of vertices: */
+	GaussTria gauss;
+	for(int iv=0;iv<NUMVERTICES;iv++){
+		gauss.GaussVertex(iv);
+
+		/* Advection */
+		vx_input->GetInputValue(&v[0],&gauss);
+		vy_input->GetInputValue(&v[1],&gauss);
+		gr_input->GetInputValue(&groundedice,&gauss);
+
+		/*Get calving speed*/
+		switch(calvinglaw){
+			case DefaultCalvingEnum:
+			case CalvingVonmisesEnum:
+				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
+				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
+				calvingrate_input->GetInputValue(&calvingrate,&gauss);
+				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+				if(groundedice<0) meltingrate = 0.;
+
+				norm_dlsf=0.;
+				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+				norm_dlsf=sqrt(norm_dlsf);
+
+				if(norm_dlsf>1.e-10)
+				 for(i=0;i<dim;i++){
+					 c[i]=calvingrate*dlsf[i]/norm_dlsf; m[i]=meltingrate*dlsf[i]/norm_dlsf;
+				 }
+				else
+				 for(i=0;i<dim;i++){
+					 c[i]=0.; m[i]=0.;
+				 }
+				break;
+
+			case CalvingLevermannEnum:
+				calvingratex_input->GetInputValue(&c[0],&gauss);
+				if(dim==2) calvingratey_input->GetInputValue(&c[1],&gauss);
+				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+				norm_calving=0.;
+				for(i=0;i<dim;i++) norm_calving+=pow(c[i],2);
+				norm_calving=sqrt(norm_calving)+1.e-14;
+				for(i=0;i<dim;i++) m[i]=meltingrate*c[i]/norm_calving;
+				break;
+
+			case CalvingMinthicknessEnum:
+				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
+				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
+				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+
+				norm_dlsf=0.;
+				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+				norm_dlsf=sqrt(norm_dlsf);
+
+				if(norm_dlsf>1.e-10)
+				 for(i=0;i<dim;i++){
+					 c[i]=0.;
+					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
+				 }
+				else
+				 for(i=0;i<dim;i++){
+					 c[i]=0.;
+					 m[i]=0.;
+				 }
+				break;
+
+			case CalvingHabEnum:
+				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
+				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
+				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+
+				norm_dlsf=0.;
+				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+				norm_dlsf=sqrt(norm_dlsf);
+
+				if(norm_dlsf>1.e-10)
+				 for(i=0;i<dim;i++){
+					 c[i]=0.;
+					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
+				 }
+				else
+				 for(i=0;i<dim;i++){
+					 c[i]=0.;
+					 m[i]=0.;
+				 }
+				break;
+
+			case CalvingCrevasseDepthEnum:
+				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
+				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
+				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+
+				if(groundedice<0) meltingrate = 0.;
+
+				norm_dlsf=0.;
+				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+				norm_dlsf=sqrt(norm_dlsf);
+
+				if(norm_dlsf>1.e-10)
+				 for(i=0;i<dim;i++){
+					 c[i]=0.;
+					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
+				 }
+				else
+				 for(i=0;i<dim;i++){
+					 c[i]=0.;
+					 m[i]=0.;
+				 }
+				break;
+
+			case CalvingDev2Enum:
+				  {
+					lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
+					if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
+					calvingrate_input->GetInputValue(&calvingrate,&gauss);
+					meltingrate_input->GetInputValue(&meltingrate,&gauss);
+					gr_input->GetInputValue(&groundedice,&gauss);
+
+					//idea: no retreat on ice above critical calving height "calvinghaf" . Limit using regularized Heaviside function.
+					vel=sqrt(v[0]*v[0] + v[1]*v[1]);
+					haf_eps=10.;
+					if(groundedice-calvinghaf<=-haf_eps){
+						// ice floats freely below calvinghaf: calve freely
+						// undercutting has no effect:
+						meltingrate=0.;
+					}
+					else if(groundedice-calvinghaf>=haf_eps){
+						// ice is well above calvinghaf -> no calving back, i.e. limit calving rate to ice velocity
+						calvingrate=min(calvingrate,vel);
+						// ice is almost grounded: frontal undercutting has maximum effect (do nothing).
+					}
+					else{ // ice is close to calvinghaf: smooth transition between limitation and free calving.
+						//heaviside: 0 for floating, 1 for grounded
+						heaviside=(groundedice-calvinghaf+haf_eps)/(2.*haf_eps) + sin(PI*(groundedice-calvinghaf)/haf_eps)/(2.*M_PI);
+						calvingrate=heaviside*(min(calvingrate,vel)-calvingrate)+calvingrate;
+						meltingrate=heaviside*meltingrate+0.;
+					}
+
+					norm_dlsf=0.;
+					for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+					norm_dlsf=sqrt(norm_dlsf);
+
+					if(norm_dlsf>1.e-10)
+					 for(i=0;i<dim;i++){
+						 c[i]=calvingrate*dlsf[i]/norm_dlsf;
+						 m[i]=meltingrate*dlsf[i]/norm_dlsf;
+					 }
+					else
+					 for(i=0;i<dim;i++){
+						 c[i]=0.;
+						 m[i]=0.;
+					 }
+					break;
+				  }
+
+			default:
+				_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
+		}
+		for(i=0;i<dim;i++) w[i]=v[i]-c[i]-m[i];
+
+		movingfrontvx[iv] = w[0];
+		movingfrontvy[iv] = w[1];		
+	}
+
+	#ifdef MICI
+	/**************************************  MICI  START ************************************/
+	/*MICI from Crawford et al. 2021:
+	 * Tice = 20C; Bf  ->  I = 3.7e-16; α = 6.9
+	 * Tice = 20C; Bn  ->  I = 5.1e-14; α = 6.0
+	 * Tice = 20C; Bh  ->  I = 3.2e-17; α = 7.2
+	 * Tice = 10C; Bn  ->  I = 6.9e-17; α = 7.3
+	 * Tice = 5C;  Bn  ->  I = 1.9e-16; α = 7.3
+	 */
+	Input* surface_input = this->GetInput(SurfaceEnum); _assert_(surface_input);
+	Input* bed_input     = this->GetInput(BedEnum);     _assert_(bed_input);
+	Input* ls_input      = this->GetInput(MaskIceLevelsetEnum);   _assert_(ls_input);
+	IssmDouble Hc,bed,ls;
+	for(int iv=0;iv<NUMVERTICES;iv++){
+		gauss.GaussVertex(iv);
+
+		surface_input->GetInputValue(&Hc,&gauss);
+		bed_input->GetInputValue(&bed,&gauss);
+		ls_input->GetInputValue(&ls,&gauss);
+
+		/*Do we assume that the calving front does not move?*/
+		//movingfrontvx[iv] = 0.;
+		//movingfrontvy[iv] = 0.;
+
+		//if(Hc>80. && bed<0. && fabs(ls)<100.e3){ //Pollard & De Conto
+		if(Hc>135. && bed<0. && fabs(ls)<100.e3){ // Crawford et all
+
+			lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
+			norm_dlsf=0.;
+			for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+			norm_dlsf=sqrt(norm_dlsf);
+
+			/*use vel direction instead of LSF*/
+			vx_input->GetInputValue(&v[0],&gauss);
+			vy_input->GetInputValue(&v[1],&gauss);
+			vel=sqrt(v[0]*v[0] + v[1]*v[1]);
+			norm_dlsf = max(vel,1.e-10);
+			dlsf[0] = v[0];
+			dlsf[1] = v[1];
+
+			/*5C Bn (worst case scenario)*/
+			IssmDouble I     = 1.9e-16;
+			IssmDouble alpha = 7.3;
+			IssmDouble C = min(2000.,I*pow(Hc,alpha))/(24*3600.); /*convert from m/day to m/s*/
+			//IssmDouble C = (min(max(Hc,80.),100.) - 80.)/20. * 10./(24*3600.); /*Original MICI! convert from m/day to m/s*/
+			movingfrontvx[iv] = -C*dlsf[0]/norm_dlsf;
+			movingfrontvy[iv] = -C*dlsf[1]/norm_dlsf;
+		}
+	}
+	#endif
+	/**************************************  END MICI  *************************************/
+
+	/*Add input*/
+	this->AddInput(MovingFrontalVxEnum,&movingfrontvx[0],P1DGEnum);
+	this->AddInput(MovingFrontalVyEnum,&movingfrontvy[0],P1DGEnum);
+}
+/*}}}*/
 Gauss*     Tria::NewGauss(void){/*{{{*/
 	return new GaussTria();
@@ -3562,5 +4536,5 @@
 	int         found = 0;
 	IssmDouble  value;
-	GaussTria  *gauss = NULL;
+	GaussTria   gauss;
 
 	/*First, serarch the input: */
@@ -3574,6 +4548,6 @@
 			if(data){
 				/*ok, we are good. retrieve value of input at vertex :*/
-				gauss=new GaussTria(); gauss->GaussVertex(i);
-				data->GetInputValue(&value,gauss);
+				gauss.GaussVertex(i);
+				data->GetInputValue(&value,&gauss);
 				found=1;
 				break;
@@ -3581,7 +4555,4 @@
 		}
 	}
-
-	/*clean-up*/
-	delete gauss;
 
 	if(found)*pvalue=value;
@@ -3740,11 +4711,11 @@
 
 	/*Loop over basal nodes and update their CS*/
-	GaussTria* gauss = new GaussTria();
+	GaussTria gauss;
 	for(int i=0;i<this->NumberofNodesVelocity();i++){
 
 		if(vertexonbase[i]==1){
-			gauss->GaussNode(this->VelocityInterpolation(),i);
-			slope_input->GetInputValue(&slope,gauss);
-			groundedicelevelset_input->GetInputValue(&groundedice,gauss);
+			gauss.GaussNode(this->VelocityInterpolation(),i);
+			slope_input->GetInputValue(&slope,&gauss);
+			groundedicelevelset_input->GetInputValue(&groundedice,&gauss);
 			IssmDouble theta = atan(slope);
 
@@ -3767,5 +4738,4 @@
 	/*cleanup*/
 	xDelete<IssmDouble>(vertexonbase);
-	delete gauss;
 }
 /*}}}*/
@@ -3784,61 +4754,4 @@
 	if(this->hneighbors) this->hneighbors->reset();
 
-}
-/*}}}*/
-void       Tria::RignotMeltParameterization(){/*{{{*/
-
-   IssmDouble A, B, alpha, beta;
-	IssmDouble bed,qsg,qsg_basin,TF,yts;
-	int numbasins;
-	IssmDouble basinid[NUMVERTICES];
-	IssmDouble* basin_icefront_area=NULL;
-
-	/* Coefficients */
-	A    = 3e-4;
-	B    = 0.15;
-	alpha = 0.39;
-	beta = 1.18;
-
-	/*Get inputs*/
-	Input* bed_input = this->GetInput(BedEnum);                     _assert_(bed_input);
-	Input* qsg_input = this->GetInput(FrontalForcingsSubglacialDischargeEnum);		 _assert_(qsg_input);
-	Input* TF_input  = this->GetInput(FrontalForcingsThermalForcingEnum);          _assert_(TF_input);
-	Element::GetInputListOnVertices(&basinid[0],FrontalForcingsBasinIdEnum);
-
-	this->FindParam(&yts, ConstantsYtsEnum);
-	this->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
-	this->parameters->FindParam(&basin_icefront_area,&numbasins,FrontalForcingsBasinIcefrontAreaEnum);
-
-	IssmDouble meltrates[NUMVERTICES];  //frontal melt-rate
-
-	/* Start looping on the number of vertices: */
-	GaussTria* gauss=new GaussTria();
-	for(int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
-
-		/* Get variables */
-		bed_input->GetInputValue(&bed,gauss);
-		qsg_input->GetInputValue(&qsg,gauss);
-		TF_input->GetInputValue(&TF,gauss);
-
-		if(basin_icefront_area[reCast<int>(basinid[iv])-1]==0.) meltrates[iv]=0.;
-		else{
-			/* change the unit of qsg (m^3/d -> m/d) with ice front area */
-			qsg_basin=qsg/basin_icefront_area[reCast<int>(basinid[iv])-1];
-
-			/* calculate melt rates */
-			meltrates[iv]=((A*max(-bed,0.)*pow(max(qsg_basin,0.),alpha)+B)*pow(max(TF,0.),beta))/86400; //[m/s]
-		}
-
-		if(xIsNan<IssmDouble>(meltrates[iv])) _error_("NaN found in vector");
-		if(xIsInf<IssmDouble>(meltrates[iv])) _error_("Inf found in vector");
-	}
-
-	/*Add input*/
-	this->AddInput(CalvingMeltingrateEnum,&meltrates[0],P1Enum);
-
-	/*Cleanup and return*/
-	xDelete<IssmDouble>(basin_icefront_area);
-	delete gauss;
 }
 /*}}}*/
@@ -3950,4 +4863,19 @@
 }
 /*}}}*/
+void       Tria::SetElementInput(int enum_in,IssmDouble value,int type){/*{{{*/
+
+	if(type==P0Enum){
+		this->inputs->SetTriaInput(enum_in,P0Enum,this->lid,value);
+	}
+	else if(type==P1Enum){
+		IssmDouble values[3]; 
+		for(int i=0;i<3;i++)values[i]=value;
+		int lidlist[3];
+		this->GetVerticesLidList(&lidlist[0]);
+		this->inputs->SetTriaInput(enum_in,P1Enum,3,&lidlist[0],&values[0]);
+	}
+	else _error_("interpolation type not supported yet");
+}
+/*}}}*/
 void       Tria::SetElementInput(Inputs* inputs,int numindices,int* indices,IssmDouble* values,int enum_in){/*{{{*/
 
@@ -3965,4 +4893,5 @@
 	switch(domaintype){
 		case Domain2DhorizontalEnum:
+		case Domain3DsurfaceEnum:
 			return this;
 		case Domain2DverticalEnum:
@@ -4025,8 +4954,16 @@
 }
 /*}}}*/
+bool       Tria::IsSpawnedElement(void){/*{{{*/
+
+	if(this->iscollapsed!=0){
+		return true;
+	}
+
+	return false;
+
+}/*}}}*/
 void       Tria::StrainRateparallel(){/*{{{*/
 
 	IssmDouble  epsilon[3];
-	GaussTria* gauss=NULL;
 	IssmDouble  vx,vy,vel;
 	IssmDouble  strainxx;
@@ -4044,15 +4981,15 @@
 
 	/* Start looping on the number of vertices: */
-	gauss=new GaussTria();
+	GaussTria gauss;
 	for (int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
+		gauss.GaussVertex(iv);
 
 		/* Get the value we need*/
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
+		vx_input->GetInputValue(&vx,&gauss);
+		vy_input->GetInputValue(&vy,&gauss);
 		vel=vx*vx+vy*vy;
 
 		/*Compute strain rate viscosity and pressure: */
-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
 		strainxx=epsilon[0];
 		strainyy=epsilon[1];
@@ -4065,12 +5002,8 @@
 	/*Add input*/
 	this->AddInput(StrainRateparallelEnum,&strainparallel[0],P1DGEnum);
-
-	/*Clean up and return*/
-	delete gauss;
 }
 /*}}}*/
 void       Tria::StrainRateperpendicular(){/*{{{*/
 
-	GaussTria* gauss=NULL;
 	IssmDouble  epsilon[3];
 	IssmDouble  vx,vy,vel;
@@ -4089,15 +5022,15 @@
 
 	/* Start looping on the number of vertices: */
-	gauss=new GaussTria();
+	GaussTria gauss;
 	for (int iv=0;iv<NUMVERTICES;iv++){
-		gauss->GaussVertex(iv);
+		gauss.GaussVertex(iv);
 
 		/* Get the value we need*/
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
+		vx_input->GetInputValue(&vx,&gauss);
+		vy_input->GetInputValue(&vy,&gauss);
 		vel=vx*vx+vy*vy;
 
 		/*Compute strain rate viscosity and pressure: */
-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
 		strainxx=epsilon[0];
 		strainyy=epsilon[1];
@@ -4110,7 +5043,4 @@
 	/*Add input*/
 	this->AddInput(StrainRateperpendicularEnum,&strainperpendicular[0],P1DGEnum);
-
-	/*Clean up and return*/
-	delete gauss;
 }
 /*}}}*/
@@ -4179,5 +5109,5 @@
 
 	/*CFL criterion: */
-	IssmDouble dt = C/(maxabsvx/dx+maxabsvy/dy);
+	IssmDouble dt = C/(maxabsvx/dx+maxabsvy/dy + 1.e-18);
 
 	return dt;
@@ -4543,4 +5473,5 @@
 	IssmDouble base,smb,rho_ice,scalefactor;
 	IssmDouble Total_Smb=0;
+	IssmDouble lsf[NUMVERTICES];
 	IssmDouble xyz_list[NUMVERTICES][3];
 
@@ -4556,15 +5487,45 @@
 	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
 	base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));	// area of element in m2
-
+	
 	/*Now get the average SMB over the element*/
-	Input* smb_input = this->GetInput(SmbMassBalanceEnum); _assert_(smb_input);
-	smb_input->GetInputAverage(&smb);	// average smb on element in m ice s-1
-	if(scaled==true){
-		Input* scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
-		scalefactor_input->GetInputAverage(&scalefactor);// average scalefactor on element
+	Element::GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
+	if(lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0){
+		/*Partially ice-covered element*/
+		bool mainlyice;
+      int point;
+      IssmDouble* weights       = xNew<IssmDouble>(NUMVERTICES);
+      IssmDouble* smb_vertices  = xNew<IssmDouble>(NUMVERTICES);
+      IssmDouble f1,f2,phi;
+		
+		Element::GetInputListOnVertices(&smb_vertices[0],SmbMassBalanceEnum);
+		GetFractionGeometry(weights,&phi,&point,&f1,&f2,&mainlyice,lsf);
+		smb = 0.0;
+		for(int i=0;i<NUMVERTICES;i++) smb += weights[i]*smb_vertices[i];
+	
+		if(scaled==true){
+         IssmDouble* scalefactor_vertices = xNew<IssmDouble>(NUMVERTICES);
+         Element::GetInputListOnVertices(&scalefactor_vertices[0],MeshScaleFactorEnum);
+         scalefactor = 0.0;
+         for(int i=0;i<NUMVERTICES;i++) scalefactor += weights[i]/phi*scalefactor_vertices[i];
+         xDelete<IssmDouble>(scalefactor_vertices);
+      }
+		else scalefactor = 1.0;
+
+		/*Cleanup*/
+      xDelete<IssmDouble>(weights);
+      xDelete<IssmDouble>(smb_vertices);
 	}
 	else{
-		scalefactor=1.;
-	}
+		/*Fully ice-covered element*/
+		Input* smb_input = this->GetInput(SmbMassBalanceEnum); _assert_(smb_input);
+		smb_input->GetInputAverage(&smb);   // average smb on element in m ice s-1
+
+		if(scaled==true){
+			Input* scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
+			scalefactor_input->GetInputAverage(&scalefactor);// average scalefactor on element
+		}
+		else scalefactor=1.0;
+	}
+	
    Total_Smb=rho_ice*base*smb*scalefactor;	// smb on element in kg s-1
 
@@ -4730,14 +5691,13 @@
 	Input* onbase = this->GetInput(MeshVertexonbaseEnum); _assert_(onbase);
 
-	GaussTria* gauss=new GaussTria();
+	GaussTria gauss;
 	for(int iv=0;iv<this->NumberofNodes(this->element_type);iv++){
-		gauss->GaussNode(this->element_type,iv);
-		onbase->GetInputValue(&isonbase,gauss);
+		gauss.GaussNode(this->element_type,iv);
+		onbase->GetInputValue(&isonbase,&gauss);
 		if(isonbase==1.){
-			input->GetInputValue(&value,gauss);
+			input->GetInputValue(&value,&gauss);
 			this->nodes[iv]->ApplyConstraint(0,value);
 		}
 	}
-	delete gauss;
 
 }
@@ -4754,14 +5714,13 @@
 	Input* onsurf = this->GetInput(MeshVertexonsurfaceEnum); _assert_(onsurf);
 
-	GaussTria* gauss=new GaussTria();
+	GaussTria gauss;
 	for(int iv=0;iv<this->NumberofNodes(this->element_type);iv++){
-		gauss->GaussNode(this->element_type,iv);
-		onsurf->GetInputValue(&isonsurface,gauss);
+		gauss.GaussNode(this->element_type,iv);
+		onsurf->GetInputValue(&isonsurface,&gauss);
 		if(isonsurface==1.){
-			input->GetInputValue(&value,gauss);
+			input->GetInputValue(&value,&gauss);
 			this->nodes[iv]->ApplyConstraint(0,value);
 		}
 	}
-	delete gauss;
 }
 /*}}}*/
@@ -4870,11 +5829,308 @@
 /*}}}*/
 
-#ifdef _HAVE_GIA_
-void       Tria::GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x, IssmDouble* y){/*{{{*/
-
+#ifdef _HAVE_ESA_
+void    Tria::EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){ /*{{{*/
+
+	/*diverse:*/
+	int gsize;
 	IssmDouble xyz_list[NUMVERTICES][3];
+	IssmDouble area;
+	IssmDouble earth_radius = 6371012.0;	// Earth's radius [m]
+	IssmDouble I;		//ice/water loading
+	IssmDouble rho_ice, rho_earth;
+
+	/*precomputed elastic green functions:*/
+	IssmDouble* U_elastic_precomputed = NULL;
+	IssmDouble* H_elastic_precomputed = NULL;
+	int         M, hemi;
+
+	/*computation of Green functions:*/
+	IssmDouble* U_elastic= NULL;
+	IssmDouble* N_elastic= NULL;
+	IssmDouble* E_elastic= NULL;
+	IssmDouble* X_elastic= NULL;
+	IssmDouble* Y_elastic= NULL;
+
+	/*optimization:*/
+	bool store_green_functions=false;
+
+	/*Compute ice thickness change: */
+	Input* deltathickness_input=this->GetInput(DeltaIceThicknessEnum);
+	if (!deltathickness_input)_error_("delta thickness input needed to compute elastic adjustment!");
+	deltathickness_input->GetInputAverage(&I);
+
+	/*early return if we are not on the (ice) loading point: */
+	if(I==0) return;
+
+	/*recover material parameters: */
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	rho_earth=FindParam(MaterialsEarthDensityEnum);
+
+	/*how many dofs are we working with here? */
+	this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
+
+	/*which hemisphere? for north-south, east-west components*/
+	this->parameters->FindParam(&hemi,EsaHemisphereEnum);
+
+	/*compute area of element:*/
+	area=GetArea();
+
+	/*figure out gravity center of our element (Cartesian): */
+	IssmDouble x_element, y_element;
+	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+	x_element=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
+	y_element=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
+
+	/*recover elastic Green's functions for displacement:*/
+	DoubleVecParam* U_parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(EsaUElasticEnum)); _assert_(U_parameter);
+	DoubleVecParam* H_parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(EsaHElasticEnum)); _assert_(H_parameter);
+	U_parameter->GetParameterValueByPointer(&U_elastic_precomputed,&M);
+	H_parameter->GetParameterValueByPointer(&H_elastic_precomputed,&M);
+
+	/*initialize: */
+	U_elastic=xNewZeroInit<IssmDouble>(gsize);
+	N_elastic=xNewZeroInit<IssmDouble>(gsize);
+	E_elastic=xNewZeroInit<IssmDouble>(gsize);
+	X_elastic=xNewZeroInit<IssmDouble>(gsize);
+	Y_elastic=xNewZeroInit<IssmDouble>(gsize);
+
+	int* indices=xNew<int>(gsize);
+	IssmDouble* U_values=xNewZeroInit<IssmDouble>(gsize);
+	IssmDouble* N_values=xNewZeroInit<IssmDouble>(gsize);
+	IssmDouble* E_values=xNewZeroInit<IssmDouble>(gsize);
+	IssmDouble* X_values=xNewZeroInit<IssmDouble>(gsize);
+	IssmDouble* Y_values=xNewZeroInit<IssmDouble>(gsize);
+	IssmDouble dx, dy, dist, alpha, ang, ang2;
+	IssmDouble N_azim, E_azim, X_azim, Y_azim;
+
+	for(int i=0;i<gsize;i++){
+
+		indices[i]=i;
+
+		IssmDouble N_azim=0;
+		IssmDouble E_azim=0;
+
+		/*Compute alpha angle between centroid and current vertex: */
+		dx = x_element - xx[i];		dy = y_element - yy[i];
+		dist = sqrt(pow(dx,2)+pow(dy,2));						// distance between vertex and elemental centroid [m]
+		alpha = dist*360.0/(2*M_PI*earth_radius) * M_PI/180.0;	// [in radians] 360 degree = 2*pi*earth_radius
+
+		/*Compute azimuths, both north and east components: */
+		ang = M_PI/2 - atan2(dy,dx);		// this is bearing angle!
+		Y_azim = cos(ang);
+		X_azim = sin(ang);
+
+		/*Elastic component  (from Eq 17 in Adhikari et al, GMD 2015): */
+		int index=reCast<int,IssmDouble>(alpha/M_PI*(M-1));
+		U_elastic[i] += U_elastic_precomputed[index];
+		Y_elastic[i] += H_elastic_precomputed[index]*Y_azim;
+		X_elastic[i] += H_elastic_precomputed[index]*X_azim;
+
+		/*Add all components to the pUp solution vectors:*/
+		U_values[i]+=3*rho_ice/rho_earth*area/(4*M_PI*pow(earth_radius,2))*I*U_elastic[i];
+		Y_values[i]+=3*rho_ice/rho_earth*area/(4*M_PI*pow(earth_radius,2))*I*Y_elastic[i];
+		X_values[i]+=3*rho_ice/rho_earth*area/(4*M_PI*pow(earth_radius,2))*I*X_elastic[i];
+
+		/*North-south, East-west components */
+		if (hemi == -1) {
+			ang2 = M_PI/2 - atan2(yy[i],xx[i]);
+		}
+		else if (hemi == 1) {
+			ang2 = M_PI/2 - atan2(-yy[i],-xx[i]);
+		}
+		if (hemi != 0){
+			N_azim = Y_azim*cos(ang2) + X_azim*sin(ang2);
+			E_azim = X_azim*cos(ang2) - Y_azim*sin(ang2);
+			N_elastic[i] += H_elastic_precomputed[index]*N_azim;
+			E_elastic[i] += H_elastic_precomputed[index]*E_azim;
+			N_values[i]+=3*rho_ice/rho_earth*area/(4*M_PI*pow(earth_radius,2))*I*N_elastic[i];
+			E_values[i]+=3*rho_ice/rho_earth*area/(4*M_PI*pow(earth_radius,2))*I*E_elastic[i];
+		}
+	}
+
+	pUp->SetValues(gsize,indices,U_values,ADD_VAL);
+	pNorth->SetValues(gsize,indices,N_values,ADD_VAL);
+	pEast->SetValues(gsize,indices,E_values,ADD_VAL);
+	pX->SetValues(gsize,indices,X_values,ADD_VAL);
+	pY->SetValues(gsize,indices,Y_values,ADD_VAL);
+
+	/*free ressources:*/
+	xDelete<int>(indices);
+	xDelete<IssmDouble>(U_values); xDelete<IssmDouble>(N_values); xDelete<IssmDouble>(E_values);
+	xDelete<IssmDouble>(U_elastic); xDelete<IssmDouble>(N_elastic); xDelete<IssmDouble>(E_elastic);
+	xDelete<IssmDouble>(X_values); xDelete<IssmDouble>(Y_values);
+	xDelete<IssmDouble>(X_elastic); xDelete<IssmDouble>(Y_elastic);
+
+	return;
+}
+/*}}}*/
+void    Tria::EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){ /*{{{*/
+
+	/*diverse:*/
+	int gsize;
+	bool spherical=true;
+	IssmDouble llr_list[NUMVERTICES][3];
+	IssmDouble xyz_list[NUMVERTICES][3];
+	IssmDouble area,planetarea;
+	IssmDouble I;		//ice/water loading
+	IssmDouble late,longe,re;
+	IssmDouble lati,longi,ri;
+	IssmDouble rho_ice,rho_earth;
+	IssmDouble minlong=400;
+	IssmDouble maxlong=-20;
+
+	/*precomputed elastic green functions:*/
+	IssmDouble* U_elastic_precomputed = NULL;
+	IssmDouble* H_elastic_precomputed = NULL;
+	int         M;
+
+	/*computation of Green functions:*/
+	IssmDouble* U_elastic= NULL;
+	IssmDouble* N_elastic= NULL;
+	IssmDouble* E_elastic= NULL;
+
+	/*optimization:*/
+	bool store_green_functions=false;
+
+	/*Compute ice thickness change: */
+	Input* deltathickness_input=this->GetInput(DeltaIceThicknessEnum);
+	if (!deltathickness_input)_error_("delta thickness input needed to compute elastic adjustment!");
+	deltathickness_input->GetInputAverage(&I);
+
+	/*early return if we are not on the (ice) loading point: */
+	if(I==0) return;
+
+	/*recover material parameters: */
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	rho_earth=FindParam(MaterialsEarthDensityEnum);
+
+	/*recover earth area: */
+	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
+
+	/*how many dofs are we working with here? */
+	this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
+
+	/*Get area of element: precomputed in the sealevelchange_geometry:*/
+	area=GetAreaSpherical();
+
+	/*element centroid (spherical): */
+	/* Where is the centroid of this element?:{{{*/
+	::GetVerticesCoordinates(&llr_list[0][0],this->vertices,NUMVERTICES,spherical);
+
+	minlong=400; maxlong=-20;
+	for (int i=0;i<NUMVERTICES;i++){
+		llr_list[i][0]=(90-llr_list[i][0]);
+		if(llr_list[i][1]<0)llr_list[i][1]=180+(180+llr_list[i][1]);
+		if(llr_list[i][1]>maxlong)maxlong=llr_list[i][1];
+		if(llr_list[i][1]<minlong)minlong=llr_list[i][1];
+	}
+	if(minlong==0 && maxlong>180){
+		if (llr_list[0][1]==0)llr_list[0][1]=360;
+		if (llr_list[1][1]==0)llr_list[1][1]=360;
+		if (llr_list[2][1]==0)llr_list[2][1]=360;
+	}
+
+	// correction at the north pole: given longitude of the North pole a definition
+	// closer to the other two vertices.
+	if(llr_list[0][0]==0)llr_list[0][1]=(llr_list[1][1]+llr_list[2][1])/2.0;
+	if(llr_list[1][0]==0)llr_list[1][1]=(llr_list[0][1]+llr_list[2][1])/2.0;
+	if(llr_list[2][0]==0)llr_list[2][1]=(llr_list[0][1]+llr_list[1][1])/2.0;
+
+	// correction at the north pole: given longitude of the North pole a definition
+	// closer to the other two vertices.
+	if(llr_list[0][0]==180)llr_list[0][1]=(llr_list[1][1]+llr_list[2][1])/2.0;
+	if(llr_list[1][0]==180)llr_list[1][1]=(llr_list[0][1]+llr_list[2][1])/2.0;
+	if(llr_list[2][0]==180)llr_list[2][1]=(llr_list[0][1]+llr_list[1][1])/2.0;
+
+	late=(llr_list[0][0]+llr_list[1][0]+llr_list[2][0])/3.0;
+	longe=(llr_list[0][1]+llr_list[1][1]+llr_list[2][1])/3.0;
+
+	late=90-late;
+	if(longe>180)longe=longe-360;
+
+	late=late/180.*M_PI;
+	longe=longe/180.*M_PI;
+	/*}}}*/
+
+	/*figure out gravity center of our element (Cartesian): */
+	IssmDouble x_element, y_element, z_element;
+	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+	x_element=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
+	y_element=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
+	z_element=(xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2])/3.0;
+
+	/*recover elastic Green's functions for displacement:*/
+	DoubleVecParam* U_parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(EsaUElasticEnum)); _assert_(U_parameter);
+	DoubleVecParam* H_parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(EsaHElasticEnum)); _assert_(H_parameter);
+	U_parameter->GetParameterValueByPointer(&U_elastic_precomputed,&M);
+	H_parameter->GetParameterValueByPointer(&H_elastic_precomputed,&M);
+
+	/*initialize: */
+	U_elastic=xNewZeroInit<IssmDouble>(gsize);
+	N_elastic=xNewZeroInit<IssmDouble>(gsize);
+	E_elastic=xNewZeroInit<IssmDouble>(gsize);
+
+	int* indices=xNew<int>(gsize);
+	IssmDouble* U_values=xNewZeroInit<IssmDouble>(gsize);
+	IssmDouble* N_values=xNewZeroInit<IssmDouble>(gsize);
+	IssmDouble* E_values=xNewZeroInit<IssmDouble>(gsize);
+	IssmDouble alpha;
+	IssmDouble delPhi,delLambda;
+	IssmDouble dx, dy, dz, x, y, z;
+	IssmDouble N_azim, E_azim;
+
+	for(int i=0;i<gsize;i++){
+
+		indices[i]=i;
+
+		/*Compute alpha angle between centroid and current vertex: */
+		lati=latitude[i]/180.*M_PI; longi=longitude[i]/180.*M_PI;
+
+		delPhi=fabs(lati-late); delLambda=fabs(longi-longe);
+		alpha=2.*asin(sqrt(pow(sin(delPhi/2),2.0)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
+
+		/*Compute azimuths, both north and east components: */
+		x = xx[i]; y = yy[i]; z = zz[i];
+		if(latitude[i]==90){
+			x=1e-12; y=1e-12;
+		}
+		if(latitude[i]==-90){
+			x=1e-12; y=1e-12;
+		}
+		dx = x_element-x; dy = y_element-y; dz = z_element-z;
+		N_azim = (-z*x*dx-z*y*dy+(pow(x,2)+pow(y,2))*dz) /pow((pow(x,2)+pow(y,2))*(pow(x,2)+pow(y,2)+pow(z,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
+		E_azim = (-y*dx+x*dy) /pow((pow(x,2)+pow(y,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
+
+		/*Elastic component  (from Eq 17 in Adhikari et al, GMD 2015): */
+		int index=reCast<int,IssmDouble>(alpha/M_PI*(M-1));
+		U_elastic[i] += U_elastic_precomputed[index];
+		N_elastic[i] += H_elastic_precomputed[index]*N_azim;
+		E_elastic[i] += H_elastic_precomputed[index]*E_azim;
+
+		/*Add all components to the pUp solution vectors:*/
+		U_values[i]+=3*rho_ice/rho_earth*area/planetarea*I*U_elastic[i];
+		N_values[i]+=3*rho_ice/rho_earth*area/planetarea*I*N_elastic[i];
+		E_values[i]+=3*rho_ice/rho_earth*area/planetarea*I*E_elastic[i];
+	}
+	pUp->SetValues(gsize,indices,U_values,ADD_VAL);
+	pNorth->SetValues(gsize,indices,N_values,ADD_VAL);
+	pEast->SetValues(gsize,indices,E_values,ADD_VAL);
+
+	/*free ressources:*/
+	xDelete<int>(indices);
+	xDelete<IssmDouble>(U_values); xDelete<IssmDouble>(N_values); xDelete<IssmDouble>(E_values);
+	xDelete<IssmDouble>(U_elastic); xDelete<IssmDouble>(N_elastic); xDelete<IssmDouble>(E_elastic);
+
+	return;
+}
+/*}}}*/
+#endif
+#ifdef _HAVE_SEALEVELCHANGE_
+void       Tria::GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x, IssmDouble* y){/*{{{*/
+
+	IssmDouble xyz_list[NUMVERTICES][3];
 
 	/*gia solution parameters:*/
-	IssmDouble lithosphere_thickness,mantle_viscosity,ice_mask;
+	IssmDouble ice_mask;
 
 	/*output: */
@@ -4890,8 +6146,8 @@
 	this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
 	this->parameters->FindParam(&yts,ConstantsYtsEnum);
-	
+
 	/*recover gia solution parameters: */
 	int cross_section_shape;
-	this->parameters->FindParam(&cross_section_shape,GiaCrossSectionShapeEnum);
+	this->parameters->FindParam(&cross_section_shape,SolidearthSettingsCrossSectionShapeEnum);
 
 	/*what time is it? :*/
@@ -4900,9 +6156,17 @@
 
 	/*recover material parameters: */
-	IssmDouble lithosphere_shear_modulus = FindParam(MaterialsLithosphereShearModulusEnum);
-	IssmDouble lithosphere_density       = FindParam(MaterialsLithosphereDensityEnum);
-	IssmDouble mantle_shear_modulus      = FindParam(MaterialsMantleShearModulusEnum);
-	IssmDouble mantle_density            = FindParam(MaterialsMantleDensityEnum);
 	IssmDouble rho_ice                   = FindParam(MaterialsRhoIceEnum);
+
+	/*recover mantle and lithosphere material properties:*/
+	int numlayers=litho->numlayers;
+
+	/*lithosphere is the last layer, mantle is the penultimate layer. Watch out, radius represents the layers 
+	 *from center to surface of the Earth:*/
+	IssmDouble lithosphere_thickness = litho->radius[numlayers] - litho->radius[numlayers-1];
+	IssmDouble lithosphere_shear_modulus = litho->lame_mu[numlayers-1];
+	IssmDouble lithosphere_density = litho->density[numlayers-1];
+	IssmDouble mantle_shear_modulus = litho->lame_mu[numlayers-2];
+	IssmDouble mantle_density = litho->density[numlayers-2];
+	IssmDouble mantle_viscosity = litho->viscosity[numlayers-2];
 
 	/*early return if we are NOT on an icy element:*/
@@ -4913,15 +6177,5 @@
 	IssmDouble *times    = NULL;
 	int         numtimes;
-	this->GetInputAveragesUpToCurrentTime(ThicknessEnum,&hes,&times,&numtimes,currenttime);
-
-	/*recover mantle viscosity: */
-	Input* mantle_viscosity_input=this->GetInput(GiaMantleViscosityEnum);
-	if (!mantle_viscosity_input)_error_("mantle viscosity input needed to compute gia deflection!");
-	mantle_viscosity_input->GetInputAverage(&mantle_viscosity);
-
-	/*recover lithosphere thickness: */
-	Input* lithosphere_thickness_input=this->GetInput(GiaLithosphereThicknessEnum);
-	if (!lithosphere_thickness_input)_error_("lithosphere thickness input needed to compute gia deflection!");
-	lithosphere_thickness_input->GetInputAverage(&lithosphere_thickness);
+	this->GetInputAveragesUpToCurrentTime(TransientAccumulatedDeltaIceThicknessEnum,&hes,&times,&numtimes,currenttime);
 
 	/*pull area of this Tria: */
@@ -4929,5 +6183,5 @@
 
 	/*element radius: */
-	IssmDouble re=sqrt(area/PI);
+	IssmDouble re=sqrt(area/M_PI);
 
 	/*figure out gravity center of our element: */
@@ -4977,445 +6231,25 @@
 }
 /*}}}*/
-#endif
-#ifdef _HAVE_ESA_
-void    Tria::EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){ /*{{{*/
-
-	/*diverse:*/
-	int gsize;
-	IssmDouble xyz_list[NUMVERTICES][3];
-	IssmDouble area;
-	IssmDouble earth_radius = 6371012.0;	// Earth's radius [m]
-	IssmDouble I;		//ice/water loading
-	IssmDouble rho_ice, rho_earth;
-
-	/*precomputed elastic green functions:*/
-	IssmDouble* U_elastic_precomputed = NULL;
-	IssmDouble* H_elastic_precomputed = NULL;
-	int         M, hemi;
-
-	/*computation of Green functions:*/
-	IssmDouble* U_elastic= NULL;
-	IssmDouble* N_elastic= NULL;
-	IssmDouble* E_elastic= NULL;
-	IssmDouble* X_elastic= NULL;
-	IssmDouble* Y_elastic= NULL;
-
-	/*optimization:*/
-	bool store_green_functions=false;
-
-	/*Compute ice thickness change: */
-	Input* deltathickness_input=this->GetInput(EsaDeltathicknessEnum);
-	if (!deltathickness_input)_error_("delta thickness input needed to compute elastic adjustment!");
-	deltathickness_input->GetInputAverage(&I);
-
-	/*early return if we are not on the (ice) loading point: */
-	if(I==0) return;
-
-	/*recover material parameters: */
-	rho_ice=FindParam(MaterialsRhoIceEnum);
-	rho_earth=FindParam(MaterialsEarthDensityEnum);
-
-	/*how many dofs are we working with here? */
-	this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
-
-	/*which hemisphere? for north-south, east-west components*/
-	this->parameters->FindParam(&hemi,EsaHemisphereEnum);
-
-	/*compute area of element:*/
-	area=GetArea();
-
-	/*figure out gravity center of our element (Cartesian): */
-	IssmDouble x_element, y_element;
-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
-	x_element=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
-	y_element=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
-
-	/*recover elastic Green's functions for displacement:*/
-	DoubleVecParam* U_parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(EsaUElasticEnum)); _assert_(U_parameter);
-	DoubleVecParam* H_parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(EsaHElasticEnum)); _assert_(H_parameter);
-	U_parameter->GetParameterValueByPointer(&U_elastic_precomputed,&M);
-	H_parameter->GetParameterValueByPointer(&H_elastic_precomputed,&M);
-
-	/*initialize: */
-	U_elastic=xNewZeroInit<IssmDouble>(gsize);
-	N_elastic=xNewZeroInit<IssmDouble>(gsize);
-	E_elastic=xNewZeroInit<IssmDouble>(gsize);
-	X_elastic=xNewZeroInit<IssmDouble>(gsize);
-	Y_elastic=xNewZeroInit<IssmDouble>(gsize);
-
-	int* indices=xNew<int>(gsize);
-	IssmDouble* U_values=xNewZeroInit<IssmDouble>(gsize);
-	IssmDouble* N_values=xNewZeroInit<IssmDouble>(gsize);
-	IssmDouble* E_values=xNewZeroInit<IssmDouble>(gsize);
-	IssmDouble* X_values=xNewZeroInit<IssmDouble>(gsize);
-	IssmDouble* Y_values=xNewZeroInit<IssmDouble>(gsize);
-	IssmDouble dx, dy, dist, alpha, ang, ang2;
-	IssmDouble N_azim, E_azim, X_azim, Y_azim;
-
-	for(int i=0;i<gsize;i++){
-
-		indices[i]=i;
-
-		IssmDouble N_azim=0;
-		IssmDouble E_azim=0;
-
-		/*Compute alpha angle between centroid and current vertex: */
-		dx = x_element - xx[i];		dy = y_element - yy[i];
-		dist = sqrt(pow(dx,2)+pow(dy,2));						// distance between vertex and elemental centroid [m]
-		alpha = dist*360.0/(2*PI*earth_radius) * PI/180.0;	// [in radians] 360 degree = 2*pi*earth_radius
-
-		/*Compute azimuths, both north and east components: */
-		ang = PI/2 - atan2(dy,dx);		// this is bearing angle!
-		Y_azim = cos(ang);
-		X_azim = sin(ang);
-
-		/*Elastic component  (from Eq 17 in Adhikari et al, GMD 2015): */
-		int index=reCast<int,IssmDouble>(alpha/PI*(M-1));
-		U_elastic[i] += U_elastic_precomputed[index];
-		Y_elastic[i] += H_elastic_precomputed[index]*Y_azim;
-		X_elastic[i] += H_elastic_precomputed[index]*X_azim;
-
-		/*Add all components to the pUp solution vectors:*/
-		U_values[i]+=3*rho_ice/rho_earth*area/(4*PI*pow(earth_radius,2))*I*U_elastic[i];
-		Y_values[i]+=3*rho_ice/rho_earth*area/(4*PI*pow(earth_radius,2))*I*Y_elastic[i];
-		X_values[i]+=3*rho_ice/rho_earth*area/(4*PI*pow(earth_radius,2))*I*X_elastic[i];
-
-		/*North-south, East-west components */
-		if (hemi == -1) {
-			ang2 = PI/2 - atan2(yy[i],xx[i]);
-		}
-		else if (hemi == 1) {
-			ang2 = PI/2 - atan2(-yy[i],-xx[i]);
-		}
-		if (hemi != 0){
-			N_azim = Y_azim*cos(ang2) + X_azim*sin(ang2);
-			E_azim = X_azim*cos(ang2) - Y_azim*sin(ang2);
-			N_elastic[i] += H_elastic_precomputed[index]*N_azim;
-			E_elastic[i] += H_elastic_precomputed[index]*E_azim;
-			N_values[i]+=3*rho_ice/rho_earth*area/(4*PI*pow(earth_radius,2))*I*N_elastic[i];
-			E_values[i]+=3*rho_ice/rho_earth*area/(4*PI*pow(earth_radius,2))*I*E_elastic[i];
-		}
-	}
-
-	pUp->SetValues(gsize,indices,U_values,ADD_VAL);
-	pNorth->SetValues(gsize,indices,N_values,ADD_VAL);
-	pEast->SetValues(gsize,indices,E_values,ADD_VAL);
-	pX->SetValues(gsize,indices,X_values,ADD_VAL);
-	pY->SetValues(gsize,indices,Y_values,ADD_VAL);
-
-	/*free ressources:*/
-	xDelete<int>(indices);
-	xDelete<IssmDouble>(U_values); xDelete<IssmDouble>(N_values); xDelete<IssmDouble>(E_values);
-	xDelete<IssmDouble>(U_elastic); xDelete<IssmDouble>(N_elastic); xDelete<IssmDouble>(E_elastic);
-	xDelete<IssmDouble>(X_values); xDelete<IssmDouble>(Y_values);
-	xDelete<IssmDouble>(X_elastic); xDelete<IssmDouble>(Y_elastic);
-
-	return;
-}
-/*}}}*/
-void    Tria::EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){ /*{{{*/
-
-	/*diverse:*/
-	int gsize;
-	bool spherical=true;
-	IssmDouble llr_list[NUMVERTICES][3];
-	IssmDouble xyz_list[NUMVERTICES][3];
-	IssmDouble area,planetarea;
-	IssmDouble I;		//ice/water loading
-	IssmDouble late,longe,re;
-	IssmDouble lati,longi,ri;
-	IssmDouble rho_ice,rho_earth;
-	IssmDouble minlong=400;
-	IssmDouble maxlong=-20;
-
-	/*precomputed elastic green functions:*/
-	IssmDouble* U_elastic_precomputed = NULL;
-	IssmDouble* H_elastic_precomputed = NULL;
-	int         M;
-
-	/*computation of Green functions:*/
-	IssmDouble* U_elastic= NULL;
-	IssmDouble* N_elastic= NULL;
-	IssmDouble* E_elastic= NULL;
-
-	/*optimization:*/
-	bool store_green_functions=false;
-
-	/*Compute ice thickness change: */
-	Input* deltathickness_input=this->GetInput(EsaDeltathicknessEnum);
-	if (!deltathickness_input)_error_("delta thickness input needed to compute elastic adjustment!");
-	deltathickness_input->GetInputAverage(&I);
-
-	/*early return if we are not on the (ice) loading point: */
-	if(I==0) return;
-
-	/*recover material parameters: */
-	rho_ice=FindParam(MaterialsRhoIceEnum);
-	rho_earth=FindParam(MaterialsEarthDensityEnum);
-
-	/*recover earth area: */
-	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
-
-	/*how many dofs are we working with here? */
-	this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
-
-	/*Get area of element: precomputed in the sealevelrise_core_geometry:*/
-	area=GetAreaSpherical();
-
-	/*element centroid (spherical): */
-	/* Where is the centroid of this element?:{{{*/
-	::GetVerticesCoordinates(&llr_list[0][0],this->vertices,NUMVERTICES,spherical);
-
-	minlong=400; maxlong=-20;
-	for (int i=0;i<NUMVERTICES;i++){
-		llr_list[i][0]=(90-llr_list[i][0]);
-		if(llr_list[i][1]<0)llr_list[i][1]=180+(180+llr_list[i][1]);
-		if(llr_list[i][1]>maxlong)maxlong=llr_list[i][1];
-		if(llr_list[i][1]<minlong)minlong=llr_list[i][1];
-	}
-	if(minlong==0 && maxlong>180){
-		if (llr_list[0][1]==0)llr_list[0][1]=360;
-		if (llr_list[1][1]==0)llr_list[1][1]=360;
-		if (llr_list[2][1]==0)llr_list[2][1]=360;
-	}
-
-	// correction at the north pole: given longitude of the North pole a definition
-	// closer to the other two vertices.
-	if(llr_list[0][0]==0)llr_list[0][1]=(llr_list[1][1]+llr_list[2][1])/2.0;
-	if(llr_list[1][0]==0)llr_list[1][1]=(llr_list[0][1]+llr_list[2][1])/2.0;
-	if(llr_list[2][0]==0)llr_list[2][1]=(llr_list[0][1]+llr_list[1][1])/2.0;
-
-	// correction at the north pole: given longitude of the North pole a definition
-	// closer to the other two vertices.
-	if(llr_list[0][0]==180)llr_list[0][1]=(llr_list[1][1]+llr_list[2][1])/2.0;
-	if(llr_list[1][0]==180)llr_list[1][1]=(llr_list[0][1]+llr_list[2][1])/2.0;
-	if(llr_list[2][0]==180)llr_list[2][1]=(llr_list[0][1]+llr_list[1][1])/2.0;
-
-	late=(llr_list[0][0]+llr_list[1][0]+llr_list[2][0])/3.0;
-	longe=(llr_list[0][1]+llr_list[1][1]+llr_list[2][1])/3.0;
-
-	late=90-late;
-	if(longe>180)longe=longe-360;
-
-	late=late/180*PI;
-	longe=longe/180*PI;
-	/*}}}*/
-
-	/*figure out gravity center of our element (Cartesian): */
-	IssmDouble x_element, y_element, z_element;
-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
-	x_element=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
-	y_element=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
-	z_element=(xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2])/3.0;
-
-	/*recover elastic Green's functions for displacement:*/
-	DoubleVecParam* U_parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(EsaUElasticEnum)); _assert_(U_parameter);
-	DoubleVecParam* H_parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(EsaHElasticEnum)); _assert_(H_parameter);
-	U_parameter->GetParameterValueByPointer(&U_elastic_precomputed,&M);
-	H_parameter->GetParameterValueByPointer(&H_elastic_precomputed,&M);
-
-	/*initialize: */
-	U_elastic=xNewZeroInit<IssmDouble>(gsize);
-	N_elastic=xNewZeroInit<IssmDouble>(gsize);
-	E_elastic=xNewZeroInit<IssmDouble>(gsize);
-
-	int* indices=xNew<int>(gsize);
-	IssmDouble* U_values=xNewZeroInit<IssmDouble>(gsize);
-	IssmDouble* N_values=xNewZeroInit<IssmDouble>(gsize);
-	IssmDouble* E_values=xNewZeroInit<IssmDouble>(gsize);
-	IssmDouble alpha;
-	IssmDouble delPhi,delLambda;
-	IssmDouble dx, dy, dz, x, y, z;
-	IssmDouble N_azim, E_azim;
-
-	for(int i=0;i<gsize;i++){
-
-		indices[i]=i;
-
-		/*Compute alpha angle between centroid and current vertex: */
-		lati=latitude[i]/180*PI; longi=longitude[i]/180*PI;
-
-		delPhi=fabs(lati-late); delLambda=fabs(longi-longe);
-		alpha=2.*asin(sqrt(pow(sin(delPhi/2),2.0)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
-
-		/*Compute azimuths, both north and east components: */
-		x = xx[i]; y = yy[i]; z = zz[i];
-		if(latitude[i]==90){
-			x=1e-12; y=1e-12;
-		}
-		if(latitude[i]==-90){
-			x=1e-12; y=1e-12;
-		}
-		dx = x_element-x; dy = y_element-y; dz = z_element-z;
-		N_azim = (-z*x*dx-z*y*dy+(pow(x,2)+pow(y,2))*dz) /pow((pow(x,2)+pow(y,2))*(pow(x,2)+pow(y,2)+pow(z,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
-		E_azim = (-y*dx+x*dy) /pow((pow(x,2)+pow(y,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
-
-		/*Elastic component  (from Eq 17 in Adhikari et al, GMD 2015): */
-		int index=reCast<int,IssmDouble>(alpha/PI*(M-1));
-		U_elastic[i] += U_elastic_precomputed[index];
-		N_elastic[i] += H_elastic_precomputed[index]*N_azim;
-		E_elastic[i] += H_elastic_precomputed[index]*E_azim;
-
-		/*Add all components to the pUp solution vectors:*/
-		U_values[i]+=3*rho_ice/rho_earth*area/planetarea*I*U_elastic[i];
-		N_values[i]+=3*rho_ice/rho_earth*area/planetarea*I*N_elastic[i];
-		E_values[i]+=3*rho_ice/rho_earth*area/planetarea*I*E_elastic[i];
-	}
-	pUp->SetValues(gsize,indices,U_values,ADD_VAL);
-	pNorth->SetValues(gsize,indices,N_values,ADD_VAL);
-	pEast->SetValues(gsize,indices,E_values,ADD_VAL);
-
-	/*free ressources:*/
-	xDelete<int>(indices);
-	xDelete<IssmDouble>(U_values); xDelete<IssmDouble>(N_values); xDelete<IssmDouble>(E_values);
-	xDelete<IssmDouble>(U_elastic); xDelete<IssmDouble>(N_elastic); xDelete<IssmDouble>(E_elastic);
-
-	return;
-}
-/*}}}*/
-#endif
-#ifdef _HAVE_SEALEVELRISE_
-IssmDouble Tria::OceanAverage(IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/
-
-	if(masks->isoceanin[this->lid]){
-
-		IssmDouble area;
-
-		/*Get area of element:*/
-		this->Element::GetInputValue(&area,AreaEnum);
-
-		/*Average Sg over vertices:*/
-		IssmDouble Sg_avg=0; for(int i=0;i<NUMVERTICES;i++) Sg_avg+=Sg[this->vertices[i]->Sid()]/NUMVERTICES;
-
-		/*return: */
-		return area*Sg_avg;
-	}
-	else return 0;
-
-}
-/*}}}*/
-void	Tria::SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){/*{{{*/
-	/*early return if we are not on an ice cap OR ocean:*/
-	if(!masks->isiceonly[this->lid] && !masks->isoceanin[this->lid]){
-		dI_list[0] = 0.0; // this is important!!!
-		dI_list[1] = 0.0; // this is important!!!
-		dI_list[2] = 0.0; // this is important!!!
-		return;
-	}
-
-	/*Compute area of element:*/
-	IssmDouble area,planetarea;
-	this->Element::GetInputValue(&area,AreaEnum);
-
-	/*recover earth area: */
-	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
-
-	/*Compute lat,long,radius of elemental centroid: */
-	bool spherical=true;
-	IssmDouble llr_list[NUMVERTICES][3];
-	IssmDouble late,longe,re;
-	/* Where is the centroid of this element?:{{{*/
-	::GetVerticesCoordinates(&llr_list[0][0],this->vertices,NUMVERTICES,spherical);
-
-	IssmDouble minlong=400;
-	IssmDouble maxlong=-20;
-	for (int i=0;i<NUMVERTICES;i++){
-		llr_list[i][0]=(90-llr_list[i][0]);
-		if(llr_list[i][1]<0)llr_list[i][1]=180+(180+llr_list[i][1]);
-		if(llr_list[i][1]>maxlong)maxlong=llr_list[i][1];
-		if(llr_list[i][1]<minlong)minlong=llr_list[i][1];
-	}
-	if(minlong==0 && maxlong>180){
-		if (llr_list[0][1]==0)llr_list[0][1]=360;
-		if (llr_list[1][1]==0)llr_list[1][1]=360;
-		if (llr_list[2][1]==0)llr_list[2][1]=360;
-	}
-
-	// correction at the north pole
-	if(llr_list[0][0]==0)llr_list[0][1]=(llr_list[1][1]+llr_list[2][1])/2.0;
-	if(llr_list[1][0]==0)llr_list[1][1]=(llr_list[0][1]+llr_list[2][1])/2.0;
-	if(llr_list[2][0]==0)llr_list[2][1]=(llr_list[0][1]+llr_list[1][1])/2.0;
-
-	//correction at the south pole
-	if(llr_list[0][0]==180)llr_list[0][1]=(llr_list[1][1]+llr_list[2][1])/2.0;
-	if(llr_list[1][0]==180)llr_list[1][1]=(llr_list[0][1]+llr_list[2][1])/2.0;
-	if(llr_list[2][0]==180)llr_list[2][1]=(llr_list[0][1]+llr_list[1][1])/2.0;
-
-	late=(llr_list[0][0]+llr_list[1][0]+llr_list[2][0])/3.0;
-	longe=(llr_list[0][1]+llr_list[1][1]+llr_list[2][1])/3.0;
-
-	late=90-late;
-	if(longe>180)longe=(longe-180)-180;
-
-	late=late/180*PI;
-	longe=longe/180*PI;
-	/*}}}*/
-	re=(llr_list[0][2]+llr_list[1][2]+llr_list[2][2])/3.0;
-
-	if(masks->isoceanin[this->lid]){
-		IssmDouble rho_water, S;
-
-		/*recover material parameters: */
-		rho_water=FindParam(MaterialsRhoSeawaterEnum);
-
-		/*From Sg_old, recover water sea level rise:*/
-		S=0; for(int i=0;i<NUMVERTICES;i++) S+=Sg_old[this->vertices[i]->Sid()]/NUMVERTICES;
-
-		/* Perturbation terms for moment of inertia (moi_list):
-		 * computed analytically (see Wu & Peltier, eqs 10 & 32)
-		 * also consistent with my GMD formulation!
-		 * ALL in geographic coordinates
-		 * */
-		dI_list[0] = -4*PI*(rho_water*S*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
-		dI_list[1] = -4*PI*(rho_water*S*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
-		dI_list[2] = +4*PI*(rho_water*S*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
-	}
-	else if(masks->isiceonly[this->lid]){
-		IssmDouble rho_ice, I;
-
-		/*recover material parameters: */
-		rho_ice=FindParam(MaterialsRhoIceEnum);
-
-		/*Compute ice thickness change: */
-		Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessChangeEnum);
-		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!");
-		deltathickness_input->GetInputAverage(&I);
-
-		dI_list[0] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
-		dI_list[1] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
-		dI_list[2] = +4*PI*(rho_ice*I*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
-	}
-
-	return;
-}/*}}}*/
-void    Tria::SetSealevelMasks(SealevelMasks* masks){ /*{{{*/
-
-	masks->isiceonly[this->lid]=this->IsIceOnlyInElement();
-	masks->isoceanin[this->lid]=this->IsOceanInElement();
-
-	/*are we fully floating:*/
-	Input* gr_input=this->GetInput(MaskOceanLevelsetEnum); _assert_(gr_input);
-	if (gr_input->GetInputMax()<=0)masks->isfullyfloating[this->lid]=true;
-	else masks->isfullyfloating[this->lid]=false;
-
-	/*are we not fully grounded: */
-	if ((gr_input->GetInputMin())<0) masks->notfullygrounded[this->lid]=true;
-	else masks->notfullygrounded[this->lid]=false;
-
-}
-/*}}}*/
-void    Tria::SealevelriseGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){ /*{{{*/
-	/*diverse:*/
-	int gsize;
-	bool spherical=true;
-	IssmDouble llr_list[NUMVERTICES][3];
-	IssmDouble xyz_list[NUMVERTICES][3];
+void       Tria::SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){ /*{{{*/
+
+	/*Declarations:{{{*/
+	int nel;
 	IssmDouble area,planetarea,planetradius;
+	IssmDouble constant,ratioe;
 	IssmDouble I;  //change in ice thickness or water level(Farrel and Clarke, Equ. 4)
 	IssmDouble rho_earth;
-	IssmDouble late,longe,re;
-	IssmDouble lati,longi,ri;
-	IssmDouble constant;
-	IssmDouble x_element,y_element,z_element,x,y,z,dx,dy,dz,N_azim,E_azim;
+	IssmDouble NewtonG;
+	IssmDouble g;
+	IssmDouble lati,longi;
+	IssmDouble latitude[NUMVERTICES];
+	IssmDouble longitude[NUMVERTICES];
+	IssmDouble x,y,z,dx,dy,dz,N_azim,E_azim;
+	IssmDouble xyz_list[NUMVERTICES][3];
+
+	/*viscous stacks:*/
+	IssmDouble* viscousRSL = NULL;
+	IssmDouble* viscousU = NULL;
+	IssmDouble* viscousN = NULL;
+	IssmDouble* viscousE = NULL;
 
 	#ifdef _HAVE_RESTRICT_
@@ -5424,9 +6258,8 @@
 	IssmDouble* __restrict__ GN=NULL;
 	IssmDouble* __restrict__ GE=NULL;
-	IssmDouble* __restrict__ G_elastic_precomputed=NULL;
-	IssmDouble* __restrict__ G_rigid_precomputed=NULL;
-	IssmDouble* __restrict__ U_elastic_precomputed=NULL;
-	IssmDouble* __restrict__ H_elastic_precomputed=NULL;
-	IssmDouble* __restrict__ indices=NULL;
+	IssmDouble* __restrict__ G_viscoelastic_precomputed=NULL;
+	IssmDouble* __restrict__ G_gravi_precomputed=NULL;
+	IssmDouble* __restrict__ U_viscoelastic_precomputed=NULL;
+	IssmDouble* __restrict__ H_viscoelastic_precomputed=NULL;
 	#else
 	IssmDouble* G=NULL;
@@ -5434,133 +6267,296 @@
 	IssmDouble* GN=NULL;
 	IssmDouble* GE=NULL;
-	IssmDouble* G_elastic_precomputed=NULL;
-	IssmDouble* G_rigid_precomputed=NULL;
-	IssmDouble* U_elastic_precomputed=NULL;
-	IssmDouble* H_elastic_precomputed=NULL;
-	IssmDouble* indices=NULL;
+	IssmDouble* G_viscoelastic_precomputed=NULL;
+	IssmDouble* G_gravi_precomputed=NULL;
+	IssmDouble* U_viscoelastic_precomputed=NULL;
+	IssmDouble* H_viscoelastic_precomputed=NULL;
 	#endif
 
-	/*elastic green function:*/
+	/*viscoelastic green function:*/
 	int index;
-	int         M;
+	int M;
+	IssmDouble doubleindex,lincoef;
 
 	/*Computational flags:*/
-	bool computerigid = false;
+	bool computeselfattraction = false;
 	bool computeelastic = false;
+	bool computerotation = false;
+	bool computeviscous = false;
 	int  horiz;
-
-	/*recover parameters: */
+	bool istime=true;
+	IssmDouble timeacc=0.;
+	IssmDouble start_time,final_time;
+	int  nt,precomputednt;
+	int grd, grdmodel;
+
+	/*Rotational:*/
+	IssmDouble* tide_love_h  = NULL;
+	IssmDouble* tide_love_k  = NULL;
+	IssmDouble* tide_love_l  = NULL;
+	IssmDouble  moi_e, moi_p, omega;
+	IssmDouble  Grotm1[3],GUrotm1[3],GNrotm1[3],GErotm1[3];
+	IssmDouble  Grotm2[3],GUrotm2[3],GNrotm2[3],GErotm2[3];
+	IssmDouble  Grotm3[3],GUrotm3[3],GNrotm3[3],GErotm3[3];
+	IssmDouble  Y21cos     , Y21sin     , Y20;
+	IssmDouble dY21cos_dlat,dY21sin_dlat,dY20_dlat;
+	IssmDouble dY21cos_dlon,dY21sin_dlon;
+	IssmDouble LoveRotRSL,LoveRotU,LoveRothoriz;
+	IssmDouble polenudge;
+	/*}}}*/
+
+	/*Recover parameters:{{{ */
 	rho_earth=FindParam(MaterialsEarthDensityEnum);
-	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+	this->parameters->FindParam(&computeselfattraction,SolidearthSettingsSelfAttractionEnum);
 	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
-	this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
+	this->parameters->FindParam(&computerotation,SolidearthSettingsRotationEnum);
+	this->parameters->FindParam(&computeviscous,SolidearthSettingsViscousEnum);
+	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
 	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
 	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
+	this->parameters->FindParam(&NewtonG,ConstantsNewtonGravityEnum);
 	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
-
-	/*compute area and add to inputs:*/
-	area=GetAreaSpherical();
-	this->inputs->SetDoubleInput(AreaEnum,this->lid,area);
-	this->AddInput(SealevelAreaEnum,&area,P0Enum);
-	if(!computerigid)return;
-
-	/*recover precomputed green function kernels:*/
-	DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGRigidEnum)); _assert_(parameter);
-	parameter->GetParameterValueByPointer((IssmDouble**)&G_rigid_precomputed,&M);
-
-	/*allocate indices:*/
-	indices=xNew<IssmDouble>(gsize);
-	G=xNewZeroInit<IssmDouble>(gsize);
+	this->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
+	this->parameters->FindParam(&grdmodel,GrdModelEnum);
+
+	/*early return:*/
+	if (!grd || grdmodel!=ElasticEnum) return; //Love numbers won't be found in this case, return before loading them
+	if(!computeselfattraction)return;
+
+	if(computerotation){
+		parameters->FindParam(&tide_love_h,NULL,NULL,TidalLoveHEnum);
+		parameters->FindParam(&tide_love_k,NULL,NULL,TidalLoveKEnum);
+		parameters->FindParam(&tide_love_l,NULL,NULL,TidalLoveLEnum);
+		parameters->FindParam(&moi_e,RotationalEquatorialMoiEnum);
+		parameters->FindParam(&moi_p,RotationalPolarMoiEnum);
+		parameters->FindParam(&omega,RotationalAngularVelocityEnum);
+	}
+	/*}}}*/
+
+	/*Recover precomputed green function kernels:{{{*/
+	DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGSelfAttractionEnum)); _assert_(parameter);
+	parameter->GetParameterValueByPointer((IssmDouble**)&G_gravi_precomputed,&M);
 
 	if(computeelastic){
-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGElasticEnum)); _assert_(parameter);
-		parameter->GetParameterValueByPointer((IssmDouble**)&G_elastic_precomputed,&M);
-
-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseHElasticEnum)); _assert_(parameter);
-		parameter->GetParameterValueByPointer((IssmDouble**)&H_elastic_precomputed,&M);
-
-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseUElasticEnum)); _assert_(parameter);
-		parameter->GetParameterValueByPointer((IssmDouble**)&U_elastic_precomputed,&M);
-
-		GU=xNewZeroInit<IssmDouble>(gsize);
+		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGViscoElasticEnum)); _assert_(parameter);
+		parameter->GetParameterValueByPointer((IssmDouble**)&G_viscoelastic_precomputed,NULL);
+
+		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeUViscoElasticEnum)); _assert_(parameter);
+		parameter->GetParameterValueByPointer((IssmDouble**)&U_viscoelastic_precomputed,NULL);
+
 		if(horiz){
-			GN=xNewZeroInit<IssmDouble>(gsize);
-			GE=xNewZeroInit<IssmDouble>(gsize);
-		}
-	}
-
-	/* Where is the centroid of this element:*/
-
-	/*retrieve coordinates: */
+			parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeHViscoElasticEnum)); _assert_(parameter);
+			parameter->GetParameterValueByPointer((IssmDouble**)&H_viscoelastic_precomputed,NULL);
+		}
+	}
+	/*}}}*/
+	/*Compute lat long of all vertices in the element:{{{*/
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
-
-	/*figure out gravity center of our element (Cartesian): */
-	x_element=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
-	y_element=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
-	z_element=(xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2])/3.0;
-
-	/*compute gravity center in lat,long: */
-	late= asin(z_element/planetradius);
-	longe = atan2(y_element,x_element);
-
-	constant=3/rho_earth*area/planetarea;
-
-	for(int i=0;i<gsize;i++){
-		IssmDouble alpha;
-		IssmDouble delPhi,delLambda;
-
-		/*Compute alpha angle between centroid and current vertex and index into precomputed tables: */
-		lati=latitude[i]/180*PI; longi=longitude[i]/180*PI;
-		delPhi=fabs(lati-late); delLambda=fabs(longi-longe); if (delLambda>PI)delLambda=2*PI-delLambda;
-		alpha=2.*asin(sqrt(pow(sin(delPhi/2),2)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
-		indices[i]=alpha/PI*reCast<IssmDouble,int>(M-1);
-		index=reCast<int,IssmDouble>(indices[i]);
-
-		/*Rigid earth gravitational perturbation: */
-		G[i]+=G_rigid_precomputed[index];
-		
-		if(computeelastic){
-			G[i]+=G_elastic_precomputed[index];
-		}
-		G[i]=G[i]*constant;
-
-		/*Elastic components:*/
-		if(computeelastic){
-			GU[i] =  constant * U_elastic_precomputed[index];
+	for(int i=0;i<NUMVERTICES;i++){
+		latitude[i]= asin(xyz_list[i][2]/planetradius);
+		if((xyz_list[i][2]/planetradius)==1.0)latitude[i]=M_PI/2;
+		longitude[i]= atan2(xyz_list[i][1],xyz_list[i][0]);
+	}
+	/*}}}*/
+	/*Compute green functions:{{{ */
+	if(computeviscous){
+		this->parameters->FindParam(&istime,LoveIsTimeEnum);
+		if(!istime)_error_("Frequency love numbers not supported yet!");
+		this->parameters->FindParam(&timeacc,SolidearthSettingsTimeAccEnum);
+		this->parameters->FindParam(&start_time,TimesteppingStartTimeEnum);
+		this->parameters->FindParam(&final_time,TimesteppingFinalTimeEnum);
+		nt=reCast<int,IssmDouble>((final_time-start_time)/timeacc)+1;
+	}
+	else{
+		nt=1; //in elastic, or if we run only selfattraction, we need only one step
+	}
+
+	constant=3/rho_earth/planetarea;
+
+	G=xNewZeroInit<IssmDouble>(3*nel*nt);
+	if(computeelastic){
+		GU=xNewZeroInit<IssmDouble>(3*nel*nt);
+		if(horiz){
+			GN=xNewZeroInit<IssmDouble>(3*nel*nt);
+			GE=xNewZeroInit<IssmDouble>(3*nel*nt);
+		}
+	}
+
+	for(int e=0;e<nel;e++){
+		ratioe=constant*areae[e];
+		for (int i=0;i<3;i++){
+			IssmDouble alpha;
+			IssmDouble delPhi,delLambda;
+			/*recover info for this element and vertex:*/
+			IssmDouble late= asin(zze[e]/sqrt( pow(xxe[e],2.0)+ pow(yye[e],2.0)+ pow(zze[e],2.0)));
+			IssmDouble longe= atan2(yye[e],xxe[e]);
+
+			lati=latitude[i];
+			longi=longitude[i];
+
+			/*Compute alpha angle between centroid and current vertex and index into precomputed tables: */
+			delPhi=fabs(lati-late); delLambda=fabs(longi-longe); if (delLambda>M_PI)delLambda=2*M_PI-delLambda;
+			alpha=2.*asin(sqrt(pow(sin(delPhi/2),2)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
+			doubleindex=alpha/M_PI*reCast<IssmDouble,int>(M-1); //maps 0<alpha<PI on [0:M-1]
+			index=reCast<int,IssmDouble>(doubleindex); //truncates doubleindex to integer part
+			_assert_(index>=0 && index<M);
+
+			lincoef=doubleindex-index; //where between index and index+1 is alpha
+			if (index==M-1){ //avoids out of bound case
+				index-=1;
+				lincoef=1;
+			}
+
 			if(horiz){
 				/*Compute azimuths, both north and east components: */
-				x = xx[i]; y = yy[i]; z = zz[i];
-				if(latitude[i]==90){
+				x = xyz_list[i][0]; y = xyz_list[i][1]; z = xyz_list[i][2];
+				if(lati==M_PI/2){
 					x=1e-12; y=1e-12;
 				}
-				if(latitude[i]==-90){
+				if(lati==-M_PI/2){
 					x=1e-12; y=1e-12;
 				}
-				dx = x_element-x; dy = y_element-y; dz = z_element-z;
+				dx = xxe[e]-x; dy = yye[e]-y; dz = zze[e]-z;
 				N_azim = (-z*x*dx-z*y*dy+(pow(x,2)+pow(y,2))*dz) /pow((pow(x,2)+pow(y,2))*(pow(x,2)+pow(y,2)+pow(z,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
 				E_azim = (-y*dx+x*dy) /pow((pow(x,2)+pow(y,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
-
-				GN[i] = constant*H_elastic_precomputed[index]*N_azim;
-				GE[i] = constant*H_elastic_precomputed[index]*E_azim;
-			}
-		}
-	}
+			}
+
+			for(int t=0;t<nt;t++){
+				int timeindex=i*nel*nt+e*nt+t; 
+
+				/*Rigid earth gravitational perturbation: */
+				G[timeindex]+=G_gravi_precomputed[index+0]*(1.-lincoef) 
+					     +G_gravi_precomputed[index+1]*lincoef; //linear interpolation
+
+				/*Find a way to interpolate precomputed Gkernels to our solution time stepping:*/
+				if(computeelastic){
+					G[timeindex]+=G_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
+						     +G_viscoelastic_precomputed[(index+1)*nt+t]*lincoef; //linear interpolation
+				}
+				G[timeindex]=G[timeindex]*ratioe;
+
+				/*Elastic components:*/
+				if(computeelastic){
+					GU[timeindex] =  ratioe *(U_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
+								 +U_viscoelastic_precomputed[(index+1)*nt+t]*lincoef);
+					if(horiz){
+						GN[timeindex] = N_azim*ratioe *(H_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
+								 	       +H_viscoelastic_precomputed[(index+1)*nt+t]*lincoef);
+						GE[timeindex] = E_azim*ratioe *(H_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
+								 	       +H_viscoelastic_precomputed[(index+1)*nt+t]*lincoef);
+					}
+				}
+			} //for(int t=0;t<nt;t++)
+		} //for (int i=0;i<3;i++)
+	} //for(int e=0;e<nel;e++)
 
 	/*Add in inputs:*/
-	this->inputs->SetArrayInput(SealevelriseIndicesEnum,this->lid,indices,gsize);
-	this->inputs->SetArrayInput(SealevelriseGEnum,this->lid,G,gsize);
+	this->inputs->SetArrayInput(SealevelchangeGEnum,this->lid,G,nel*3*nt);
 	if(computeelastic){
-		this->inputs->SetArrayInput(SealevelriseGUEnum,this->lid,GU,gsize);
+		this->inputs->SetArrayInput(SealevelchangeGUEnum,this->lid,GU,nel*3*nt);
 		if(horiz){
-			this->inputs->SetArrayInput(SealevelriseGNEnum,this->lid,GN,gsize);
-			this->inputs->SetArrayInput(SealevelriseGEEnum,this->lid,GE,gsize);
-		}
-	}
-	this->inputs->SetDoubleInput(AreaEnum,this->lid,area); 
-	this->AddInput(SealevelAreaEnum,&area,P0Enum);
-
-	/*Free allocations:*/
+			this->inputs->SetArrayInput(SealevelchangeGNEnum,this->lid,GN,nel*3*nt);
+			this->inputs->SetArrayInput(SealevelchangeGEEnum,this->lid,GE,nel*3*nt);
+		}
+	}
+	/*}}}*/
+	/*Compute rotation kernel:{{{*/
+	if(computerotation){
+
+		/*What is the gravity at planet's surface: */
+		g=4.0/3.0*M_PI*rho_earth*NewtonG*planetradius;
+
+		//Amplitude of the rotational feedback
+		LoveRotRSL=((1.0+tide_love_k[2]-tide_love_h[2])/g)*pow(omega*planetradius,2.0);
+		LoveRotU=(tide_love_h[2]/g)*pow(omega*planetradius,2.0);
+		LoveRothoriz=(tide_love_l[2]/g)*pow(omega*planetradius,2.0);
+
+		for(int i=0;i<3;i++){
+
+			//Avoid singularity of the poles
+			if (latitude[i]==M_PI/2.){
+				//North pole: nudge south
+				polenudge=-1.e-12;
+			}
+			else if (latitude[i]==-M_PI/2.){
+				//South pole: nudge north
+				polenudge=1.e-12;
+			}
+			else {
+				polenudge=0.0;
+			}
+
+			lati=latitude[i]+polenudge;
+			longi=longitude[i];
+
+			//Spherical harmonic functions of degree 2
+			Y21cos= -0.5*sin(2.*lati)*cos(longi);
+			Y21sin= -0.5*sin(2.*lati)*sin(longi);
+			Y20   = -(1.0/6.0 - 0.5*cos(2.0*lati));
+
+			Grotm1[i]= LoveRotRSL*Y21cos;
+			Grotm2[i]= LoveRotRSL*Y21sin;
+			Grotm3[i]= LoveRotRSL*Y20;
+
+			if (computeelastic){
+				GUrotm1[i]= LoveRotU*Y21cos;
+				GUrotm2[i]= LoveRotU*Y21sin;
+				GUrotm3[i]= LoveRotU*Y20;
+				if (horiz){
+				//bed_N = Love_l * d(Y)/dlat ;
+				dY21cos_dlat=-cos(2.*lati)*cos(longi);
+				dY21sin_dlat=-cos(2.*lati)*sin(longi);
+				dY20_dlat=   -sin(2.*lati);
+				GNrotm1[i]= LoveRothoriz*dY21cos_dlat;
+				GNrotm2[i]= LoveRothoriz*dY21sin_dlat;
+				GNrotm3[i]= LoveRothoriz*dY20_dlat;
+
+				//bed_E = Love_l * 1/cos(lat) * d(Y)/dlon ;
+				dY21cos_dlon=-Y21sin/cos(lati);
+				dY21sin_dlon=Y21cos/cos(lati);
+				//dY20_dlon=0.;
+
+				GErotm1[i]= LoveRothoriz*dY21cos_dlon;
+				GErotm2[i]= LoveRothoriz*dY21sin_dlon;
+				GErotm3[i]= 0.0;
+				}
+			}
+		}
+		this->AddInput(SealevelGrotm1Enum,&Grotm1[0],P1Enum);
+		this->AddInput(SealevelGrotm2Enum,&Grotm2[0],P1Enum);
+		this->AddInput(SealevelGrotm3Enum,&Grotm3[0],P1Enum);
+		if (computeelastic){
+			this->AddInput(SealevelGUrotm1Enum,&GUrotm1[0],P1Enum);
+			this->AddInput(SealevelGUrotm2Enum,&GUrotm2[0],P1Enum);
+			this->AddInput(SealevelGUrotm3Enum,&GUrotm3[0],P1Enum);
+			if(horiz){
+				this->AddInput(SealevelGNrotm1Enum,&GNrotm1[0],P1Enum);
+				this->AddInput(SealevelGNrotm2Enum,&GNrotm2[0],P1Enum);
+				this->AddInput(SealevelGNrotm3Enum,&GNrotm3[0],P1Enum);
+				this->AddInput(SealevelGErotm1Enum,&GErotm1[0],P1Enum);
+				this->AddInput(SealevelGErotm2Enum,&GErotm2[0],P1Enum);
+				this->AddInput(SealevelGErotm3Enum,&GErotm3[0],P1Enum);
+			}
+		}
+	}
+	/*}}}*/
+	/*Initialize viscous stacks: {{{*/
+	if(computeviscous){
+		viscousRSL=xNewZeroInit<IssmDouble>(3*nt);
+		viscousU=xNewZeroInit<IssmDouble>(3*nt);
+
+		this->inputs->SetArrayInput(SealevelchangeViscousRSLEnum,this->lid,viscousRSL,3*nt);
+		this->inputs->SetArrayInput(SealevelchangeViscousUEnum,this->lid,viscousU,3*nt);
+		this->parameters->SetParam(0,SealevelchangeViscousIndexEnum);
+		if(horiz){
+			viscousN=xNewZeroInit<IssmDouble>(3*nt);
+			viscousE=xNewZeroInit<IssmDouble>(3*nt);
+			this->inputs->SetArrayInput(SealevelchangeViscousNEnum,this->lid,viscousRSL,3*nt);
+			this->inputs->SetArrayInput(SealevelchangeViscousEEnum,this->lid,viscousU,3*nt);
+		}
+	}
+	/*}}}*/
+
+	/*Free allocations:{{{*/
 	#ifdef _HAVE_RESTRICT_
-	delete indices;
 	delete G;
 	if(computeelastic){
@@ -5572,5 +6568,4 @@
 	}
 	#else
-	xDelete(indices);
 	xDelete(G);
 	if(computeelastic){
@@ -5582,398 +6577,1147 @@
 	}
 	#endif
-
+	/*}}}*/
 	return;
-}
-/*}}}*/
-IssmDouble Tria::SealevelriseEustaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){ /*{{{*/
-
-	/*diverse:*/
-	int gsize;
+
+}
+/*}}}*/
+void       Tria::SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){ /*{{{*/
+
+	/* Classic buildup of load weights, centroids and areas *for elements which are fully inside a mask. 
+	 * At the same time, we'll tag the elements that are fractionally only inside a mask*/
+
+	IssmDouble loadweights[3]={0};
 	IssmDouble area;
-	IssmDouble phi=1.0; //WARNING: do not touch this, default is entire elemnt contributes eustatic
-	IssmDouble I;  //change in ice thickness or water level(Farrel and Clarke, Equ. 4)
-	bool notfullygrounded=false;
-	bool scaleoceanarea= false;
-	bool computerigid= false;
-	int  glfraction=1;
-
-	/*output: */
-	IssmDouble bslrice=0;
-
-	/*elastic green function:*/
-	IssmDouble* G=NULL;
-
-	/*ice properties: */
-	IssmDouble rho_ice,rho_water;
+	IssmDouble loadweightsocean[3]; //to keep memory of these loads, no need to recompute for bottom pressure.
+	IssmDouble xyz_list[NUMVERTICES][3];
+	IssmDouble planetradius;
+	IssmDouble late,longe;
+
+	/*flags:*/
+	bool isocean=false;
+	bool isoceanonly=false;
+	bool isice=false;
+	bool isiceonly=false;
+	bool  computeice=false;
+	bool  computebp=false;
+	bool  computehydro=false;
 
 	/*constants:*/
 	IssmDouble constant=0;
 
-	/*early return if we are not on an ice cap:*/
-	if(!masks->isiceonly[this->lid]){
+	/*recover parameters:*/
+	this->parameters->FindParam(&computeice,TransientIsmasstransportEnum);
+	this->parameters->FindParam(&computebp,TransientIsoceantransportEnum);
+	this->parameters->FindParam(&computehydro,TransientIshydrologyEnum);
+	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
+
+	/*get vertex information:*/
+	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+
+	/*answer mask questions:*/
+	isiceonly=this->IsIceOnlyInElement();
+	isice=this->IsIceInElement();
+	isoceanonly=this->IsOceanOnlyInElement();
+	isocean=this->IsOceanInElement();
+	slgeom->isoceanin[this->lid]=isocean; //keep track for later.
+	area=areae[this->sid];
+
+	/*Compute element ids, used to speed up computations in convolution phase:{{{*/
+	for(int i=0;i<NUMVERTICES;i++){
+		slgeom->lids[this->vertices[i]->lid]=this->lid;
+	}
+	/*}}}*/
+
+	/*set barycentre for all elements, to be updated for fractional loads in the next routine: */
+	//late= asin(zze[this->sid]/planetradius)*180.0/M_PI;
+	late= asin(zze[this->sid]/sqrt( pow(xxe[this->sid],2.0)+ pow(yye[this->sid],2.0)+ pow(zze[this->sid],2.0)))*180.0/M_PI;
+	longe= atan2(yye[this->sid],xxe[this->sid])*180.0/M_PI;
+	slgeom->longe[this->lid]=longe;
+	slgeom->late[this->lid]=late;
+
+	/*compute areas and load weights for ocean and flag elements only partially in the ocean:*/
+	if(isoceanonly){ 
+		slgeom->LoadArea[SLGEOM_OCEAN][this->lid]=area;
+		for(int i=0;i<NUMVERTICES;i++) slgeom->LoadWeigths[SLGEOM_OCEAN][i][this->lid]=1.0/3.0;
+
+		#ifdef _ISSM_DEBUG_ /*{{{*/
+		/*Inform mask: */
+		constant=1.0;
+		for(int i=0;i<NUMVERTICES;i++) loadweightsocean[i]=1.0/3.0;
+		this->AddInput(SealevelBarystaticOceanMaskEnum,&constant,P0Enum); 
+		this->AddInput(SealevelBarystaticOceanWeightsEnum,loadweightsocean,P1DGEnum);
+		this->AddInput(SealevelBarystaticOceanAreaEnum,&area,P0Enum);
+		#endif /*}}}*/
+	}
+	else if(!isocean){
+		slgeom->LoadArea[SLGEOM_OCEAN][this->lid]=0;
+		for(int i=0;i<NUMVERTICES;i++) slgeom->LoadWeigths[SLGEOM_OCEAN][i][this->lid]=0.0;
+		#ifdef _ISSM_DEBUG_ /*{{{*/
+		/*Inform mask: */
+		constant=0.0;
+		for(int i=0;i<NUMVERTICES;i++) loadweightsocean[i]=0.0;
+		this->AddInput(SealevelBarystaticOceanMaskEnum,&constant,P0Enum); 
+		this->AddInput(SealevelBarystaticOceanWeightsEnum,loadweightsocean,P1DGEnum);
+		this->AddInput(SealevelBarystaticOceanAreaEnum,&constant,P0Enum);
+		#endif /*}}}*/
+	}
+	else{
+		slgeom->issubelement[SLGEOM_OCEAN][this->lid]=true;
+		slgeom->nsubel[SLGEOM_OCEAN]++;
+	}
+
+	/*early return if we are not on an ice sheet , and we are not requesting 
+	 *hydrology or bottom pressure loads :*/
+	if(!computebp && !computehydro){
+		if(!isice  || isoceanonly) {
+			#ifdef _ISSM_DEBUG_
+			constant=0; 
+			this->AddInput(SealevelBarystaticIceMaskEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticIceAreaEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticIceWeightsEnum,loadweights,P1DGEnum);
+			this->AddInput(SealevelBarystaticHydroMaskEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticHydroWeightsEnum,loadweights,P1DGEnum);
+			this->AddInput(SealevelBarystaticHydroAreaEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticBpMaskEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticBpWeightsEnum,loadweights,P1DGEnum);
+			this->AddInput(SealevelBarystaticBpAreaEnum,&constant,P0Enum);
+			#endif
+			for(int i=0;i<NUMVERTICES;i++){
+				slgeom->LoadWeigths[SLGEOM_ICE][i][this->lid]=0;
+				slgeom->LoadWeigths[SLGEOM_WATER][i][this->lid]=0;
+			}
+			slgeom->LoadArea[SLGEOM_ICE][this->lid]=0;
+			slgeom->LoadArea[SLGEOM_WATER][this->lid]=0;
+			return;
+		}
+	}
+
+	/*early return if we are fully floating and we are not doing bottom pressure loads:*/
+	if(!computebp){
+		if (isoceanonly){
+			#ifdef _ISSM_DEBUG_
+			constant=0;
+			this->AddInput(SealevelBarystaticIceMaskEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticIceWeightsEnum,loadweights,P1DGEnum);
+			this->AddInput(SealevelBarystaticIceAreaEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticHydroMaskEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticHydroWeightsEnum,loadweights,P1DGEnum);
+			this->AddInput(SealevelBarystaticHydroAreaEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticBpMaskEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticBpWeightsEnum,loadweights,P1DGEnum);
+			this->AddInput(SealevelBarystaticBpAreaEnum,&constant,P0Enum);
+			#endif
+			for(int i=0;i<NUMVERTICES;i++){
+				slgeom->LoadWeigths[SLGEOM_ICE][i][this->lid]=0;
+				slgeom->LoadWeigths[SLGEOM_WATER][i][this->lid]=0;
+			}
+			slgeom->LoadArea[SLGEOM_ICE][this->lid]=0;
+			slgeom->LoadArea[SLGEOM_WATER][this->lid]=0;
+			return;
+		}
+	}
+
+	/*early return if we are not on the ocean and we are not doing ice mass transport of 
+	 * hydrology:*/
+	if(!computeice  && !computehydro){
+		if(!isocean){
+			#ifdef _ISSM_DEBUG_
+			constant=0;
+			this->AddInput(SealevelBarystaticIceMaskEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticIceWeightsEnum,loadweights,P1DGEnum);
+			this->AddInput(SealevelBarystaticIceAreaEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticHydroMaskEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticHydroWeightsEnum,loadweights,P1DGEnum);
+			this->AddInput(SealevelBarystaticHydroAreaEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticBpMaskEnum,&constant,P0Enum);
+			this->AddInput(SealevelBarystaticBpWeightsEnum,loadweights,P1DGEnum);
+			this->AddInput(SealevelBarystaticBpAreaEnum,&constant,P0Enum);
+			#endif
+			for(int i=0;i<NUMVERTICES;i++){
+				slgeom->LoadWeigths[SLGEOM_ICE][i][this->lid]=0;
+				slgeom->LoadWeigths[SLGEOM_WATER][i][this->lid]=0;
+			}
+			slgeom->LoadArea[SLGEOM_ICE][this->lid]=0;
+			slgeom->LoadArea[SLGEOM_WATER][this->lid]=0;
+			return;
+		}
+	}
+
+	/*Deal with ice loads if we are on grounded ice:*/
+	if(isice && !isoceanonly && computeice){
+		if(isiceonly && !isocean){
+			slgeom->LoadArea[SLGEOM_ICE][this->lid]=area;
+			for(int i=0;i<NUMVERTICES;i++) slgeom->LoadWeigths[SLGEOM_ICE][i][this->lid]=1.0/3.0;
+
+			#ifdef _ISSM_DEBUG_ /*{{{*/
+			/*Inform mask: */
+			constant=1.0;
+			for(int i=0;i<NUMVERTICES;i++) loadweights[i]=1.0/3.0;
+			this->AddInput(SealevelBarystaticIceMaskEnum,&constant,P0Enum); 
+			this->AddInput(SealevelBarystaticIceWeightsEnum,loadweights,P1DGEnum);
+			this->AddInput(SealevelBarystaticIceAreaEnum,&area,P0Enum);
+			#endif /*}}}*/
+		}
+		else{
+			slgeom->issubelement[SLGEOM_ICE][this->lid]=true;
+			slgeom->nsubel[SLGEOM_ICE]++;
+		}
+	} 
+
+	/*Deal with water loads if we are on ground:*/
+	if(!isoceanonly && computehydro){
+
+		if(!isocean){
+			slgeom->LoadArea[SLGEOM_WATER][this->lid]=area;
+			for(int i=0;i<NUMVERTICES;i++) slgeom->LoadWeigths[SLGEOM_WATER][i][this->lid]=1.0/3.0;
+
+			#ifdef _ISSM_DEBUG_ /*{{{*/
+			/*Inform mask: */
+			constant=1.0;
+			for(int i=0;i<NUMVERTICES;i++) loadweights[i]=1.0/3.0;
+			this->AddInput(SealevelBarystaticHydroMaskEnum,&constant,P0Enum); 
+			this->AddInput(SealevelBarystaticHydroWeightsEnum,loadweights,P1DGEnum);
+			this->AddInput(SealevelBarystaticHydroAreaEnum,&area,P0Enum);
+			#endif /*}}}*/
+		}
+		else{
+			slgeom->issubelement[SLGEOM_WATER][this->lid]=true;
+			slgeom->nsubel[SLGEOM_WATER]++;
+		}
+	}
+
+}
+/*}}}*/
+void       Tria::SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){ /*{{{*/
+
+	/* Classic buildup of load weights, centroids and areas *for elements which are fully inside a mask. 
+	 * At the same time, we'll tag the elements that are fractionally only inside a mask*/
+
+	IssmDouble loadweights[3]={0};
+	IssmDouble area,loadarea;
+	IssmDouble loadareaocean;
+	IssmDouble loadweightsocean[3]; //to keep memory of these loads, no need to recompute for bottom pressure.
+	IssmDouble xyz_list[NUMVERTICES][3];
+	IssmDouble latbar=slgeom->late[this->lid];
+	IssmDouble longbar=slgeom->longe[this->lid];
+	IssmDouble constant;
+	IssmDouble nanconstant=NAN;
+
+	/*get vertex and area information:*/
+	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+	area=areae[this->sid];
+
+	#ifdef _ISSM_DEBUG_
+	this->AddInput(SealevelBarystaticIceLatbarEnum,&latbar,P0Enum); 
+	this->AddInput(SealevelBarystaticIceLongbarEnum,&longbar,P0Enum); 
+	this->AddInput(SealevelBarystaticHydroLatbarEnum,&latbar,P0Enum); 
+	this->AddInput(SealevelBarystaticHydroLongbarEnum,&longbar,P0Enum); 
+	this->AddInput(SealevelBarystaticOceanLatbarEnum,&latbar,P0Enum); 
+	this->AddInput(SealevelBarystaticOceanLongbarEnum,&longbar,P0Enum); 
+	#endif
+
+	if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
+		int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
+
+		this->GetNodalWeightsAndAreaAndCentroidsFromLeveset(&loadweightsocean[0],&loadareaocean,&latbar, &longbar, slgeom->late[this->lid], slgeom->longe[this->lid], area, MaskOceanLevelsetEnum);
+		slgeom->LoadArea[SLGEOM_OCEAN][this->lid]=loadareaocean;
+		slgeom->vareae_subel[SLGEOM_OCEAN]->SetValue(intj,loadareaocean,INS_VAL);
+		slgeom->vlatbarycentre[SLGEOM_OCEAN]->SetValue(intj,latbar,INS_VAL);
+		slgeom->vlongbarycentre[SLGEOM_OCEAN]->SetValue(intj,longbar,INS_VAL);
+
+		for(int i=0;i<NUMVERTICES;i++) slgeom->LoadWeigths[SLGEOM_OCEAN][i][this->lid]=loadweightsocean[i];
+		#ifdef _ISSM_DEBUG_ /*{{{*/
+		/*Inform mask: */
+		constant=loadareaocean/area;
+		this->AddInput(SealevelBarystaticOceanMaskEnum,&constant,P0Enum); 
+		this->AddInput(SealevelBarystaticOceanWeightsEnum,loadweightsocean,P1DGEnum);
+		this->AddInput(SealevelBarystaticOceanAreaEnum,&loadareaocean,P0Enum);
+
+		this->AddInput(SealevelBarystaticOceanLatbarEnum,&latbar,P0Enum); 
+		this->AddInput(SealevelBarystaticOceanLongbarEnum,&longbar,P0Enum); 
+		#endif /*}}}*/
+	}
+	if(slgeom->issubelement[SLGEOM_ICE][this->lid]){
+		int intj=slgeom->subelementmapping[SLGEOM_ICE][this->lid];
+
+		this->GetNodalWeightsAndAreaAndCentroidsFromLeveset(&loadweights[0],&loadarea,&latbar, &longbar, slgeom->late[this->lid], slgeom->longe[this->lid], area, -MaskOceanLevelsetEnum,MaskIceLevelsetEnum);
+
+		slgeom->LoadArea[SLGEOM_ICE][this->lid]=loadarea;
+		slgeom->vareae_subel[SLGEOM_ICE]->SetValue(intj,loadarea,INS_VAL);
+		slgeom->vlatbarycentre[SLGEOM_ICE]->SetValue(intj,latbar,INS_VAL);
+		slgeom->vlongbarycentre[SLGEOM_ICE]->SetValue(intj,longbar,INS_VAL);
+
+		for(int i=0;i<NUMVERTICES;i++)slgeom->LoadWeigths[SLGEOM_ICE][i][this->lid]=loadweights[i];
+
 		#ifdef _ISSM_DEBUG_
-		constant=0; this->AddInput(SealevelEustaticMaskEnum,&constant,P0Enum);
+		/*Inform mask: */
+		constant=loadarea/area; 
+		this->AddInput(SealevelBarystaticIceMaskEnum,&constant,P0Enum);
+		this->AddInput(SealevelBarystaticIceWeightsEnum,loadweights,P1DGEnum);
+		this->AddInput(SealevelBarystaticIceAreaEnum,&loadarea,P0Enum);
+
+		this->AddInput(SealevelBarystaticIceLatbarEnum,&latbar,P0Enum); 
+		this->AddInput(SealevelBarystaticIceLongbarEnum,&longbar,P0Enum); 
+
 		#endif
-		bslrice=0;
-		return bslrice;
-	}
-
-	/*early return if we are fully floating:*/
-	if (masks->isfullyfloating[this->lid]){
-		constant=0;
+	}
+	if(slgeom->issubelement[SLGEOM_WATER][this->lid]){
+		int intj=slgeom->subelementmapping[SLGEOM_WATER][this->lid];
+
+		this->GetNodalWeightsAndAreaAndCentroidsFromLeveset(&loadweights[0],&loadarea,&latbar, &longbar, slgeom->late[this->lid], slgeom->longe[this->lid], area, -MaskOceanLevelsetEnum);
+
+		slgeom->LoadArea[SLGEOM_WATER][this->lid]=loadarea;
+		slgeom->vareae_subel[SLGEOM_WATER]->SetValue(intj,loadarea,INS_VAL);
+		slgeom->vlatbarycentre[SLGEOM_WATER]->SetValue(intj,latbar,INS_VAL);
+		slgeom->vlongbarycentre[SLGEOM_WATER]->SetValue(intj,longbar,INS_VAL);
+
+		for(int i=0;i<NUMVERTICES;i++)slgeom->LoadWeigths[SLGEOM_WATER][i][this->lid]=loadweights[i];
+
 		#ifdef _ISSM_DEBUG_
-		this->AddInput(SealevelEustaticMaskEnum,&constant,P0Enum);
+		/*Inform mask: */
+		constant=loadarea/area; 
+		this->AddInput(SealevelBarystaticHydroMaskEnum,&constant,P0Enum);
+		this->AddInput(SealevelBarystaticHydroWeightsEnum,loadweights,P1DGEnum);
+		this->AddInput(SealevelBarystaticHydroAreaEnum,&loadarea,P0Enum);
+
+		this->AddInput(SealevelBarystaticHydroLatbarEnum,&latbar,P0Enum); 
+		this->AddInput(SealevelBarystaticHydroLongbarEnum,&longbar,P0Enum); 
+
 		#endif
-		bslrice=0;
-		return bslrice;
-	}
-
-	/*If we are here, we are on ice that is fully grounded or half-way to floating:*/
-	if (masks->notfullygrounded[this->lid]) notfullygrounded=true; //used later on.
-
-	/*Inform mask: */
-	constant=1;
-	#ifdef _ISSM_DEBUG_
-	this->AddInput(SealevelEustaticMaskEnum,&constant,P0Enum);
+	}
+
+}
+/*}}}*/
+void       Tria::SealevelchangeGeometrySubElementKernel(SealevelGeometry* slgeom){ /*{{{*/
+
+	/*Declarations:{{{*/
+	int nel;
+	IssmDouble planetarea,planetradius;
+	IssmDouble constant,ratioe;
+	IssmDouble rho_earth;
+	IssmDouble lati,longi;
+	IssmDouble latitude[NUMVERTICES];
+	IssmDouble longitude[NUMVERTICES];
+	IssmDouble x,y,z,dx,dy,dz,N_azim,E_azim;
+	IssmDouble xyz_list[NUMVERTICES][3];
+
+	#ifdef _HAVE_RESTRICT_
+	IssmDouble* __restrict__ G_viscoelastic_precomputed=NULL;
+	IssmDouble* __restrict__ G_gravi_precomputed=NULL;
+	IssmDouble* __restrict__ U_viscoelastic_precomputed=NULL;
+	IssmDouble* __restrict__ H_viscoelastic_precomputed=NULL;
+	IssmDouble** __restrict__ Gsubel=NULL;
+	IssmDouble** __restrict__ GUsubel=NULL;
+	IssmDouble** __restrict__ GNsubel=NULL;
+	IssmDouble** __restrict__ GEsubel=NULL;
+
+	#else
+	IssmDouble* G_viscoelastic_precomputed=NULL;
+	IssmDouble* G_gravi_precomputed=NULL;
+	IssmDouble* U_viscoelastic_precomputed=NULL;
+	IssmDouble* H_viscoelastic_precomputed=NULL;
+	IssmDouble** Gsubel=NULL;
+	IssmDouble** GUsubel=NULL;
+	IssmDouble** GNsubel=NULL;
+	IssmDouble** GEsubel=NULL;
 	#endif
 
+	/*viscoelastic green function:*/
+	int index;
+	int M;
+	IssmDouble doubleindex,lincoef;
+
+	/*Computational flags:*/
+	bool computeselfattraction = false;
+	bool computeelastic = false;
+	bool computeviscous = false;
+	int  horiz;
+	int grd, grdmodel;
+
+	bool istime=true;
+	IssmDouble timeacc=0;
+	IssmDouble start_time,final_time;
+	int  nt,precomputednt;
+
+	/*}}}*/
+	/*Recover parameters:{{{ */
+	rho_earth=FindParam(MaterialsEarthDensityEnum);
+	this->parameters->FindParam(&computeselfattraction,SolidearthSettingsSelfAttractionEnum);
+	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
+	this->parameters->FindParam(&computeviscous,SolidearthSettingsViscousEnum);
+	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
+	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
+	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+	this->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
+	this->parameters->FindParam(&grdmodel,GrdModelEnum);
+	/*}}}*/
+
+	/*early return:*/
+	if (!grd || grdmodel!=ElasticEnum) return; //Love numbers won't be found in this case, return before loading them
+	if(!computeselfattraction)return;
+
+	/*Recover precomputed green function kernels:{{{*/
+	DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGSelfAttractionEnum)); _assert_(parameter);
+	parameter->GetParameterValueByPointer((IssmDouble**)&G_gravi_precomputed,&M);
+
+	if(computeelastic){
+		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGViscoElasticEnum)); _assert_(parameter);
+		parameter->GetParameterValueByPointer((IssmDouble**)&G_viscoelastic_precomputed,NULL);
+
+		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeUViscoElasticEnum)); _assert_(parameter);
+		parameter->GetParameterValueByPointer((IssmDouble**)&U_viscoelastic_precomputed,NULL);
+
+		if(horiz){
+			parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeHViscoElasticEnum)); _assert_(parameter);
+			parameter->GetParameterValueByPointer((IssmDouble**)&H_viscoelastic_precomputed,NULL);
+
+		}
+	}
+	/*}}}*/
+	/*Compute lat long of all vertices in the element:{{{*/
+	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+	for(int i=0;i<NUMVERTICES;i++){
+		latitude[i]= asin(xyz_list[i][2]/planetradius);
+		longitude[i]= atan2(xyz_list[i][1],xyz_list[i][0]);
+	}
+	/*}}}*/
+	/*Compute green functions:{{{ */
+	constant=3/rho_earth/planetarea;
+
+	if(computeviscous){
+		this->parameters->FindParam(&istime,LoveIsTimeEnum);
+		if(!istime)_error_("Frequency love numbers not supported yet!");
+		this->parameters->FindParam(&timeacc,SolidearthSettingsTimeAccEnum);
+		this->parameters->FindParam(&start_time,TimesteppingStartTimeEnum);
+		this->parameters->FindParam(&final_time,TimesteppingFinalTimeEnum);
+		nt=reCast<int,IssmDouble>((final_time-start_time)/timeacc)+1;
+	}
+	else{
+		nt=1; //in elastic, or if we run only selfattraction, we need only one step
+	}
+	Gsubel=xNew<IssmDouble*>(SLGEOM_NUMLOADS);
+	if(computeelastic){
+		GUsubel=xNew<IssmDouble*>(SLGEOM_NUMLOADS);
+		if(horiz){
+			GNsubel=xNew<IssmDouble*>(SLGEOM_NUMLOADS);
+			GEsubel=xNew<IssmDouble*>(SLGEOM_NUMLOADS);
+		}
+	}
+
+	//Allocate: 
+	for(int l=0;l<SLGEOM_NUMLOADS;l++){
+		int nbar=slgeom->nbar[l];
+		Gsubel[l]=xNewZeroInit<IssmDouble>(3*nbar*nt);
+		if(computeelastic){
+			GUsubel[l]=xNewZeroInit<IssmDouble>(3*nbar*nt);
+			if(horiz){
+				GNsubel[l]=xNewZeroInit<IssmDouble>(3*nbar*nt);
+				GEsubel[l]=xNewZeroInit<IssmDouble>(3*nbar*nt);
+			}
+		}
+
+		for(int e=0;e<nbar;e++){
+			ratioe=constant*slgeom->area_subel[l][e];
+			for (int i=0;i<3;i++){
+				IssmDouble alpha;
+				IssmDouble delPhi,delLambda;
+				/*recover info for this element and vertex:*/
+				IssmDouble late= slgeom->latbarycentre[l][e]; 
+				IssmDouble longe= slgeom->longbarycentre[l][e]; 
+				late=late/180*M_PI;
+				longe=longe/180*M_PI;
+
+				lati=latitude[i];
+				longi=longitude[i];
+
+				if(horiz){
+					/*Compute azimuths, both north and east components: */
+					x = xyz_list[i][0]; y = xyz_list[i][1]; z = xyz_list[i][2];
+					if(lati==90){
+						x=1e-12; y=1e-12;
+					}
+					if(lati==-90){
+						x=1e-12; y=1e-12;
+					}
+					IssmDouble xbar=planetradius*cos(late)*cos(longe);
+					IssmDouble ybar=planetradius*cos(late)*sin(longe);
+					IssmDouble zbar=planetradius*sin(late);
+
+					dx = xbar-x; dy = ybar-y; dz = zbar-z;
+					N_azim = (-z*x*dx-z*y*dy+(pow(x,2)+pow(y,2))*dz) /pow((pow(x,2)+pow(y,2))*(pow(x,2)+pow(y,2)+pow(z,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
+					E_azim = (-y*dx+x*dy) /pow((pow(x,2)+pow(y,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
+				}
+
+				/*Compute alpha angle between centroid and current vertex and index into precomputed tables: */
+				delPhi=fabs(lati-late); delLambda=fabs(longi-longe); if (delLambda>M_PI)delLambda=2*M_PI-delLambda;
+				alpha=2.*asin(sqrt(pow(sin(delPhi/2.0),2.0)+cos(lati)*cos(late)*pow(sin(delLambda/2.0),2.0)));
+				doubleindex=alpha/M_PI*reCast<IssmDouble,int>(M-1); //maps 0<alpha<PI on [0:M-1]
+				index=reCast<int,IssmDouble>(doubleindex); //truncates doubleindex to integer part
+
+				lincoef=doubleindex-index; //where between index and index+1 is alpha
+				if (index==M-1){ //avoids out of bound case
+					index-=1;
+					lincoef=1;
+				}
+
+				for(int t=0;t<nt;t++){
+					int timeindex=i*nbar*nt+e*nt+t; 
+
+					/*Rigid earth gravitational perturbation: */
+					Gsubel[l][timeindex]+=G_gravi_precomputed[index+0]*(1.-lincoef) 
+					    		     +G_gravi_precomputed[index+1]*lincoef; //linear interpolation
+
+					if(computeelastic){
+						Gsubel[l][timeindex]+=G_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
+								     +G_viscoelastic_precomputed[(index+1)*nt+t]*lincoef; //linear interpolation
+					}
+					Gsubel[l][timeindex]*=ratioe;
+
+					/*Elastic components:*/
+					if(computeelastic){
+						GUsubel[l][timeindex] =  ratioe *(U_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
+										 +U_viscoelastic_precomputed[(index+1)*nt+t]*lincoef);
+						if(horiz){
+							GNsubel[l][timeindex] = N_azim*ratioe *(H_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
+								 			      +H_viscoelastic_precomputed[(index+1)*nt+t]*lincoef);
+							GEsubel[l][timeindex] = E_azim*ratioe *(H_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
+								 			      +H_viscoelastic_precomputed[(index+1)*nt+t]*lincoef);
+						}
+					}
+				}
+			}
+		}
+	}
+
+	/*Save all these arrayins for each element:*/
+	for (int l=0;l<SLGEOM_NUMLOADS;l++){
+		this->inputs->SetArrayInput(slgeom->GEnum(l),this->lid,Gsubel[l],slgeom->nbar[l]*3*nt);
+		if(computeelastic){
+			this->inputs->SetArrayInput(slgeom->GUEnum(l),this->lid,GUsubel[l],slgeom->nbar[l]*3*nt);
+			if(horiz){
+				this->inputs->SetArrayInput(slgeom->GNEnum(l),this->lid,GNsubel[l],slgeom->nbar[l]*3*nt);
+				this->inputs->SetArrayInput(slgeom->GEEnum(l),this->lid,GEsubel[l],slgeom->nbar[l]*3*nt);
+			}
+		}
+	}
+	/*}}}*/
+	/*Free memory:{{{*/
+	for (int l=0;l<SLGEOM_NUMLOADS;l++){
+		xDelete<IssmDouble>(Gsubel[l]);
+		if(computeelastic){
+			xDelete<IssmDouble>(GUsubel[l]);
+			if(horiz){
+				xDelete<IssmDouble>(GNsubel[l]);
+				xDelete<IssmDouble>(GEsubel[l]);
+			}
+		}
+	}
+	xDelete<IssmDouble*>(Gsubel);
+	if(computeelastic){
+		xDelete<IssmDouble*>(GUsubel);
+		if(horiz){
+			xDelete<IssmDouble*>(GNsubel); 
+			xDelete<IssmDouble*>(GEsubel);
+		}
+	}
+	/*}}}*/
+	return;
+
+}
+/*}}}*/
+void       Tria::SealevelchangeUpdateViscousFields(){ /*{{{*/
+
+	/*Inputs:*/
+	IssmDouble* viscousRSL=NULL;
+	IssmDouble* viscousU=NULL;
+	IssmDouble* viscousN=NULL;
+	IssmDouble* viscousE=NULL;
+	IssmDouble* viscoustimes=NULL;
+	int         viscousnumsteps;
+	int         viscousindex=0; 
+	int         newindex=0; 
+	int         dummy;
+	bool        viscous=false;
+	IssmDouble  currenttime;
+	IssmDouble  lincoeff=0;
+	int horiz;
+
+	this->parameters->FindParam(&viscous,SolidearthSettingsViscousEnum);
+
+	if(viscous){
+		this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+
+		this->parameters->FindParam(&viscousnumsteps,SealevelchangeViscousNumStepsEnum);
+		this->parameters->FindParam(&viscoustimes,NULL,SealevelchangeViscousTimesEnum);
+		this->parameters->FindParam(&viscousindex,SealevelchangeViscousIndexEnum);
+		this->parameters->FindParam(&currenttime,TimeEnum);
+
+		this->inputs->GetArrayPtr(SealevelchangeViscousRSLEnum,this->lid,&viscousRSL,&dummy);
+		this->inputs->GetArrayPtr(SealevelchangeViscousUEnum,this->lid,&viscousU,&dummy);
+		if(horiz){
+			this->inputs->GetArrayPtr(SealevelchangeViscousNEnum,this->lid,&viscousN,&dummy);
+			this->inputs->GetArrayPtr(SealevelchangeViscousEEnum,this->lid,&viscousE,&dummy);
+		}
+
+		bool foundtime=false;
+		int offset=1;
+		lincoeff=0;
+		newindex=viscousnumsteps-2;
+
+		for(int t=viscousindex;t<viscousnumsteps;t++){
+			if (viscoustimes[t]>currenttime){
+				newindex=t-1;
+				lincoeff=(currenttime-viscoustimes[newindex])/(viscoustimes[t]-viscoustimes[newindex]);
+				foundtime=true;
+				offset=0;
+				break;
+			}
+		}
+
+		if(!foundtime) lincoeff=1;
+		viscoustimes[newindex]=currenttime;
+		for(int i=0;i<NUMVERTICES;i++){
+			viscousRSL[i*viscousnumsteps+newindex+offset]=(1-lincoeff)*viscousRSL[i*viscousnumsteps+newindex]+lincoeff*viscousRSL[i*viscousnumsteps+newindex+1];
+			viscousU[i*viscousnumsteps+newindex+offset]=(1-lincoeff)*viscousU[i*viscousnumsteps+newindex]+lincoeff*viscousU[i*viscousnumsteps+newindex+1];
+			if(horiz){
+				viscousN[i*viscousnumsteps+newindex+offset]=(1-lincoeff)*viscousN[i*viscousnumsteps+newindex]+lincoeff*viscousN[i*viscousnumsteps+newindex+1];
+				viscousE[i*viscousnumsteps+newindex+offset]=(1-lincoeff)*viscousE[i*viscousnumsteps+newindex]+lincoeff*viscousE[i*viscousnumsteps+newindex+1];
+			}
+		}
+		viscousindex=newindex+offset;
+
+		this->parameters->SetParam(viscousindex,SealevelchangeViscousIndexEnum);
+		this->parameters->SetParam(viscoustimes,viscousnumsteps,SealevelchangeViscousTimesEnum);
+
+		/*free allocations:*/
+		xDelete<IssmDouble>(viscoustimes);
+	}
+
+}
+/*}}}*/
+void       Tria::SealevelchangeBarystaticLoads(GrdLoads* loads,  BarystaticContributions* barycontrib, SealevelGeometry* slgeom){ /*{{{*/
+
+	/*Inputs:*/
+	IssmDouble I[NUMVERTICES]; 
+	IssmDouble W[NUMVERTICES];
+	IssmDouble BP[NUMVERTICES];
+
+	/*output: */
+	IssmDouble bslcice=0;
+	IssmDouble bslchydro=0;
+	IssmDouble bslcbp=0;
+	IssmDouble BPavg=0;
+	IssmDouble Iavg=0;
+	IssmDouble Wavg=0;
+
+	/*ice properties: */
+	IssmDouble rho_ice,rho_water,rho_freshwater;
+
 	/*recover some parameters:*/
-	rho_ice=FindParam(MaterialsRhoIceEnum);
-	rho_water=FindParam(MaterialsRhoSeawaterEnum);
-	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
-	this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
-	this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum);
-
-	/*retrieve precomputed G:*/
-	if(computerigid)this->inputs->GetArrayPtr(SealevelriseGEnum,this->lid,&G,&gsize);
-
-	/*Get area of element: precomputed in the sealevelrise_core_geometry:*/
+	this->parameters->FindParam(&rho_ice,MaterialsRhoIceEnum);
+	this->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
+	this->parameters->FindParam(&rho_freshwater,MaterialsRhoFreshwaterEnum);
+
+	/*Retrieve inputs:*/
+	Element::GetInputListOnVertices(&I[0],DeltaIceThicknessEnum);
+	Element::GetInputListOnVertices(&W[0],DeltaTwsEnum);
+	Element::GetInputListOnVertices(&BP[0],DeltaBottomPressureEnum);
+
+	for(int i=0;i<NUMVERTICES;i++){
+		Iavg+=I[i]*slgeom->LoadWeigths[SLGEOM_ICE][i][this->lid];
+		Wavg+=W[i]*slgeom->LoadWeigths[SLGEOM_WATER][i][this->lid];
+		BPavg+=BP[i]*slgeom->LoadWeigths[SLGEOM_OCEAN][i][this->lid];
+	}
+
+	/*convert from m to kg/m^2:*/
+	Iavg*=rho_ice;
+	Wavg*=rho_freshwater;
+	BPavg*=rho_water;
+
+	#ifdef _ISSM_DEBUG_ 
+	this->AddInput(SealevelBarystaticIceLoadEnum,&Iavg,P0Enum);
+	this->AddInput(SealevelBarystaticHydroLoadEnum,&Wavg,P0Enum);
+	this->AddInput(SealevelBarystaticBpLoadEnum,&BPavg,P0Enum);
+	#endif
+
+	/*Compute barystatic component in kg:*/
+	bslcice =   -slgeom->LoadArea[SLGEOM_ICE][this->lid]*Iavg;
+	bslchydro = -slgeom->LoadArea[SLGEOM_WATER][this->lid]*Wavg;
+	bslcbp =    -slgeom->LoadArea[SLGEOM_OCEAN][this->lid]*BPavg;
+
+	_assert_(!xIsNan<IssmDouble>(bslcice));
+	_assert_(!xIsNan<IssmDouble>(bslchydro));
+	_assert_(!xIsNan<IssmDouble>(bslcbp));
+
+	/*Plug values into subelement load vector:*/
+	if(slgeom->issubelement[SLGEOM_ICE][this->lid]){
+		int intj=slgeom->subelementmapping[SLGEOM_ICE][this->lid];
+		loads->vsubloads[SLGEOM_ICE]->SetValue(intj,Iavg,INS_VAL);
+		Iavg=0; //avoid double counting centroid loads and subelement loads!
+	}
+	if(slgeom->issubelement[SLGEOM_WATER][this->lid]){
+		int intj=slgeom->subelementmapping[SLGEOM_WATER][this->lid];
+		loads->vsubloads[SLGEOM_WATER]->SetValue(intj,Wavg,INS_VAL);
+		Wavg=0;
+	}
+	if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
+		int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
+		loads->vsubloads[SLGEOM_OCEAN]->SetValue(intj,BPavg,INS_VAL); 
+		BPavg=0;
+	}
+	/*Plug remaining values into centroi load vector:*/
+	loads->vloads->SetValue(this->sid,Iavg+Wavg+BPavg,INS_VAL);
+
+	/*Keep track of barystatic contributions:*/
+	barycontrib->Set(this->Sid(),bslcice,bslchydro,bslcbp);
+
+}
+/*}}}*/
+void       Tria::SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* polarmotionvector,SealevelGeometry* slgeom){ /*{{{*/
+
+	/*sal green function:*/
+	IssmDouble* G=NULL;
+	IssmDouble* Gsub[SLGEOM_NUMLOADS];
+	bool computefuture=false;
+
+	bool sal = false;
+	bool viscous = false;
+	bool rotation= false;
+	bool percpu= false;
+	int  size;
+	int  nel,nbar;
+	IssmDouble Grotm1[3];
+	IssmDouble Grotm2[3];
+	IssmDouble Grotm3[3];
+
+	this->parameters->FindParam(&sal,SolidearthSettingsSelfAttractionEnum);
+	this->parameters->FindParam(&viscous,SolidearthSettingsViscousEnum);
+	this->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
+	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+
+	if(sal){
+		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
+		this->inputs->GetArrayPtr(SealevelchangeGsubelIceEnum,this->lid,&Gsub[SLGEOM_ICE],&size);
+		this->inputs->GetArrayPtr(SealevelchangeGsubelHydroEnum,this->lid,&Gsub[SLGEOM_WATER],&size);
+		this->inputs->GetArrayPtr(SealevelchangeGsubelOceanEnum,this->lid,&Gsub[SLGEOM_OCEAN],&size);
+
+		this->SealevelchangeGxL(sealevelpercpu, G, Gsub, loads, slgeom, nel,percpu=true,SealevelchangeViscousRSLEnum,computefuture=false);
+	}
+
+	if(rotation){
+		Element::GetInputListOnVertices(&Grotm1[0],SealevelGrotm1Enum);
+		Element::GetInputListOnVertices(&Grotm2[0],SealevelGrotm2Enum);
+		Element::GetInputListOnVertices(&Grotm3[0],SealevelGrotm3Enum);
+
+		for(int i=0;i<NUMVERTICES;i++){
+			if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+				sealevelpercpu[this->vertices[i]->lid]+=Grotm1[i]*polarmotionvector[0]+Grotm2[i]*polarmotionvector[1]+Grotm3[i]*polarmotionvector[2];
+			}
+		}
+	}
+	return;
+} /*}}}*/
+void       Tria::SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){ /*{{{*/
+
+	/*sal green function:*/
+	IssmDouble oceanaverage=0;
+	IssmDouble oceanarea=0;
+	IssmDouble rho_water;
+
+	this->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
+
+	/*retrieve ocean average and area:*/
+	for(int i=0;i<NUMVERTICES;i++){
+		oceanaverage+=sealevelpercpu[this->vertices[i]->lid]*slgeom->LoadWeigths[SLGEOM_OCEAN][i][this->lid];
+	}
+	#ifdef _ISSM_DEBUG_ 
+	this->AddInput(SealevelBarystaticOceanLoadEnum,&oceanaverage,P0Enum);
+	#endif
+	oceanarea=slgeom->LoadArea[SLGEOM_OCEAN][this->lid];
+
+	/*add ocean average in the global sealevelloads vector:*/
+	if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
+		int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
+		loads->vsubsealevelloads->SetValue(intj,oceanaverage*rho_water,INS_VAL);
+		loads->vsealevelloads->SetValue(this->sid,0.,INS_VAL);
+	}
+	else loads->vsealevelloads->SetValue(this->sid,oceanaverage*rho_water,INS_VAL);
+
+	/*add ocean area into a global oceanareas vector:*/
+	if(!loads->sealevelloads){
+		oceanareas->SetValue(this->sid,oceanarea,INS_VAL);
+		if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
+			int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
+			subelementoceanareas->SetValue(intj,oceanarea,INS_VAL);
+		}
+	}
+
+	return;
+} /*}}}*/
+void       Tria::SealevelchangeDeformationConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* polarmotionvector,SealevelGeometry* slgeom){ /*{{{*/
+
+	IssmDouble SealevelGrd[3]={0,0,0};
+	IssmDouble RSLGrd[3]={0,0,0};
+	IssmDouble UGrd[3]={0,0,0};
+	IssmDouble NGrd[3]={0,0,0};
+	IssmDouble EGrd[3]={0,0,0};
+	int nel,nbar;
+	bool sal = false;
+	IssmDouble* G=NULL;
+	IssmDouble* GU=NULL;
+	IssmDouble* GE=NULL;
+	IssmDouble* GN=NULL;
+	IssmDouble* Gsub[SLGEOM_NUMLOADS];
+	IssmDouble* GUsub[SLGEOM_NUMLOADS];
+	IssmDouble* GNsub[SLGEOM_NUMLOADS];
+	IssmDouble* GEsub[SLGEOM_NUMLOADS];
+	bool computefuture=false;
+
+	int horiz;
+	int size;
+	IssmDouble Grotm1[3];
+	IssmDouble Grotm2[3];
+	IssmDouble Grotm3[3];
+	IssmDouble GUrotm1[3];
+	IssmDouble GUrotm2[3];
+	IssmDouble GUrotm3[3];
+	IssmDouble GNrotm1[3];
+	IssmDouble GNrotm2[3];
+	IssmDouble GNrotm3[3];
+	IssmDouble GErotm1[3];
+	IssmDouble GErotm2[3];
+	IssmDouble GErotm3[3];
+	bool rotation= false;
+	bool elastic=false;
+	bool percpu=false;
+	bool planethasocean=false;
+
+	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+	this->parameters->FindParam(&sal,SolidearthSettingsSelfAttractionEnum);
+	this->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
+	this->parameters->FindParam(&elastic,SolidearthSettingsElasticEnum);
+	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+	this->parameters->FindParam(&planethasocean,SolidearthSettingsGrdOceanEnum);
+
+	if(sal){
+
+		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
+		this->inputs->GetArrayPtr(SealevelchangeGsubelIceEnum,this->lid,&Gsub[SLGEOM_ICE],&size);
+		this->inputs->GetArrayPtr(SealevelchangeGsubelHydroEnum,this->lid,&Gsub[SLGEOM_WATER],&size);
+		this->inputs->GetArrayPtr(SealevelchangeGsubelOceanEnum,this->lid,&Gsub[SLGEOM_OCEAN],&size);
+
+		if(elastic){
+			this->inputs->GetArrayPtr(SealevelchangeGUEnum,this->lid,&GU,&size);
+			this->inputs->GetArrayPtr(SealevelchangeGUsubelIceEnum,this->lid,&GUsub[SLGEOM_ICE],&size);
+			this->inputs->GetArrayPtr(SealevelchangeGUsubelHydroEnum,this->lid,&GUsub[SLGEOM_WATER],&size);
+			this->inputs->GetArrayPtr(SealevelchangeGUsubelOceanEnum,this->lid,&GUsub[SLGEOM_OCEAN],&size);
+			if(horiz){
+				this->inputs->GetArrayPtr(SealevelchangeGNEnum,this->lid,&GN,&size);
+				this->inputs->GetArrayPtr(SealevelchangeGNsubelIceEnum,this->lid,&GNsub[SLGEOM_ICE],&size);
+				this->inputs->GetArrayPtr(SealevelchangeGNsubelHydroEnum,this->lid,&GNsub[SLGEOM_WATER],&size);
+				this->inputs->GetArrayPtr(SealevelchangeGNsubelOceanEnum,this->lid,&GNsub[SLGEOM_OCEAN],&size);
+
+				this->inputs->GetArrayPtr(SealevelchangeGEEnum,this->lid,&GE,&size);
+				this->inputs->GetArrayPtr(SealevelchangeGEsubelIceEnum,this->lid,&GEsub[SLGEOM_ICE],&size);
+				this->inputs->GetArrayPtr(SealevelchangeGEsubelHydroEnum,this->lid,&GEsub[SLGEOM_WATER],&size);
+				this->inputs->GetArrayPtr(SealevelchangeGEsubelOceanEnum,this->lid,&GEsub[SLGEOM_OCEAN],&size);
+			}
+		}
+		this->SealevelchangeGxL(&RSLGrd[0],G, Gsub, loads, slgeom, nel,percpu=false,SealevelchangeViscousRSLEnum,computefuture=true);
+
+		if(elastic){
+			this->SealevelchangeGxL(&UGrd[0],GU, GUsub, loads, slgeom, nel,percpu=false,SealevelchangeViscousUEnum,computefuture=true);
+			if(horiz ){
+				this->SealevelchangeGxL(&NGrd[0],GN, GNsub, loads, slgeom, nel,percpu=false,SealevelchangeViscousNEnum,computefuture=true);
+				this->SealevelchangeGxL(&EGrd[0],GE, GEsub, loads, slgeom, nel,percpu=false,SealevelchangeViscousEEnum,computefuture=true);
+			}
+		}
+	}
+
+	if(rotation){
+		Element::GetInputListOnVertices(&Grotm1[0],SealevelGrotm1Enum);
+		Element::GetInputListOnVertices(&Grotm2[0],SealevelGrotm2Enum);
+		Element::GetInputListOnVertices(&Grotm3[0],SealevelGrotm3Enum);
+
+		for(int i=0;i<NUMVERTICES;i++){
+			if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+				RSLGrd[i]+=Grotm1[i]*polarmotionvector[0]+Grotm2[i]*polarmotionvector[1]+Grotm3[i]*polarmotionvector[2];
+			}
+		}
+
+		if (elastic){
+			Element::GetInputListOnVertices(&GUrotm1[0],SealevelGUrotm1Enum);
+			Element::GetInputListOnVertices(&GUrotm2[0],SealevelGUrotm2Enum);
+			Element::GetInputListOnVertices(&GUrotm3[0],SealevelGUrotm3Enum);
+
+			for(int i=0;i<NUMVERTICES;i++){
+				if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+					UGrd[i]+=GUrotm1[i]*polarmotionvector[0]+GUrotm2[i]*polarmotionvector[1]+GUrotm3[i]*polarmotionvector[2];
+				}
+			}
+			if (horiz){
+				Element::GetInputListOnVertices(&GNrotm1[0],SealevelGNrotm1Enum);
+				Element::GetInputListOnVertices(&GNrotm2[0],SealevelGNrotm2Enum);
+				Element::GetInputListOnVertices(&GNrotm3[0],SealevelGNrotm3Enum);
+				Element::GetInputListOnVertices(&GErotm1[0],SealevelGErotm1Enum);
+				Element::GetInputListOnVertices(&GErotm2[0],SealevelGErotm2Enum);
+				Element::GetInputListOnVertices(&GErotm3[0],SealevelGErotm3Enum);
+
+				for(int i=0;i<NUMVERTICES;i++){
+					if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+						NGrd[i]+=GNrotm1[i]*polarmotionvector[0]+GNrotm2[i]*polarmotionvector[1]+GNrotm3[i]*polarmotionvector[2];
+						EGrd[i]+=GErotm1[i]*polarmotionvector[0]+GErotm2[i]*polarmotionvector[1]+GErotm3[i]*polarmotionvector[2];
+					}
+				}
+			}
+		}
+	}
+
+	if (planethasocean){ //We must also output the RSL on vertices to compute the ocean mass conservation
+		for(int i=0;i<NUMVERTICES;i++){
+			if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+				sealevelpercpu[this->vertices[i]->lid]=RSLGrd[i];
+			}
+		}
+	}
+
+	/*Create geoid: */
+	for(int i=0;i<NUMVERTICES;i++)SealevelGrd[i]=UGrd[i]+RSLGrd[i];
+
+	/*Create inputs*/
+	this->AddInput(SealevelGRDEnum,SealevelGrd,P1Enum);
+	this->AddInput(BedGRDEnum,UGrd,P1Enum);
+	if(horiz){
+		this->AddInput(BedNorthGRDEnum,NGrd,P1Enum);
+		this->AddInput(BedEastGRDEnum,EGrd,P1Enum);
+	}
+
+} /*}}}*/
+void       Tria::SealevelchangeGxL(IssmDouble* grdfieldout, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel, bool percpu, int viscousenum, bool computefuture) { /*{{{*/
+
+	IssmDouble* grdfield=NULL;
+	int i,e,l,t,nbar;
+	bool computeviscous=false;
+	IssmDouble* viscousfield=NULL;
+	int nt=1; //important
+	int viscousindex=0; //important
+	int viscousnumsteps=1; //important
+
+	this->parameters->FindParam(&computeviscous,SolidearthSettingsViscousEnum);
+	if(computeviscous){
+		this->parameters->FindParam(&viscousnumsteps,SealevelchangeViscousNumStepsEnum);
+		if(computefuture) nt=viscousnumsteps;
+		else nt=1;
+
+		//allocate
+		grdfield=xNewZeroInit<IssmDouble>(3*nt);
+	}
+	else grdfield=xNewZeroInit<IssmDouble>(3*nt);
+
+	if(loads->sealevelloads){
+
+		for(i=0;i<NUMVERTICES;i++) {
+			if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+			for (e=0;e<nel;e++){
+				for(t=0;t<nt;t++){
+					int index=i*nel*viscousnumsteps+e*viscousnumsteps+t;
+					grdfield[i*nt+t]+=G[index]*(loads->sealevelloads[e]+loads->loads[e]);
+				}
+			}
+			for(l=0;l<SLGEOM_NUMLOADS;l++){
+				nbar=slgeom->nbar[l];
+				for (e=0;e<nbar;e++){
+					for(t=0;t<nt;t++){
+						int index=i*nbar*viscousnumsteps+e*viscousnumsteps+t;
+						grdfield[i*nt+t]+=Gsub[l][index]*(loads->subloads[l][e]);
+					}
+				}
+				if(l==SLGEOM_OCEAN){
+					for (e=0;e<nbar;e++){
+						for(t=0;t<nt;t++){
+							int index=i*nbar*viscousnumsteps+e*viscousnumsteps+t;
+							grdfield[i*nt+t]+=Gsub[l][index]*(loads->subsealevelloads[e]);
+						}
+					}
+				}
+			}
+		}
+	}
+	else{  //this is the initial convolution where only loads are provided
+
+		for(i=0;i<NUMVERTICES;i++) {
+			if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+			for (e=0;e<nel;e++){
+				for(t=0;t<nt;t++){
+					int index=i*nel*viscousnumsteps+e*viscousnumsteps+t;
+					grdfield[i*nt+t]+=G[index]*(loads->loads[e]);
+				}
+			}
+			for(l=0;l<SLGEOM_NUMLOADS;l++){
+				nbar=slgeom->nbar[l];
+				for (e=0;e<nbar;e++){
+					for(t=0;t<nt;t++){
+						int index=i*nbar*viscousnumsteps+e*viscousnumsteps+t;
+						grdfield[i*nt+t]+=Gsub[l][index]*(loads->subloads[l][e]);
+					}
+				}
+			}
+		}
+	}
+
+	if(computeviscous){
+		IssmDouble* grdfieldinterp=NULL;
+		IssmDouble* viscoustimes=NULL;
+		IssmDouble  final_time;
+		IssmDouble  lincoeff;
+		IssmDouble  timeacc;
+
+		this->parameters->FindParam(&viscousindex,SealevelchangeViscousIndexEnum);
+		this->parameters->FindParam(&viscoustimes,NULL,SealevelchangeViscousTimesEnum);
+		this->parameters->FindParam(&final_time,TimesteppingFinalTimeEnum);
+		this->parameters->FindParam(&timeacc,SolidearthSettingsTimeAccEnum);
+		this->inputs->GetArrayPtr(viscousenum,this->lid,&viscousfield,NULL);
+		if(computefuture){
+			grdfieldinterp=xNew<IssmDouble>(3*nt); 
+			if(viscoustimes[viscousindex]<final_time){
+				lincoeff=(viscoustimes[viscousindex+1]-viscoustimes[viscousindex])/timeacc;
+				for(int t=viscousindex;t<nt;t++){
+					if(t==viscousindex){
+						for(int i=0;i<NUMVERTICES;i++){
+							if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+							grdfieldinterp[i*nt+t]=  grdfield[i*nt+0];
+						}
+					}
+					else{
+						for(int i=0;i<NUMVERTICES;i++){
+							if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+							grdfieldinterp[i*nt+t]=  (1-lincoeff)*grdfield[i*nt+(t-viscousindex-1)]+lincoeff*grdfield[i*nt+(t-viscousindex)];
+						}
+					}
+				}
+			}
+		}
+
+		/*update grdfield at present time using viscous stack at present time: */
+		for(int i=0;i<NUMVERTICES;i++){
+			if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+			grdfield[i*nt+0]+=viscousfield[i*viscousnumsteps+viscousindex]; 
+		}
+
+		if(computefuture){ /*update viscous stack with future deformation from present load: */
+
+			for(int t=nt-1;t>=viscousindex;t--){
+				for(int i=0;i<NUMVERTICES;i++){
+					if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+					//offset viscousfield to remove all deformation that has already been added
+					viscousfield[i*viscousnumsteps+t]+=grdfieldinterp[i*nt+t]-grdfieldinterp[i*nt+viscousindex]-viscousfield[i*viscousnumsteps+viscousindex];
+				}
+			}
+			/*Re-add viscous stack now that we updated:*/
+			this->inputs->SetArrayInput(viscousenum,this->lid,viscousfield,3*viscousnumsteps);
+		}
+
+		/*Free allocatoins:*/
+		xDelete<IssmDouble>(viscoustimes);
+	}
+
+	/*store values computed on vertices, but don't repeat the computation if another element already computed it!:*/
+	if(percpu){
+		for(i=0;i<NUMVERTICES;i++){
+			if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+				grdfieldout[this->vertices[i]->lid]=grdfield[i*nt+0];
+			}
+		}
+	}
+	else{
+		for(i=0;i<NUMVERTICES;i++) grdfieldout[i]=grdfield[i*nt+0];
+	}
+
+} /*}}}*/
+void       Tria::SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){/*{{{*/
+
+	IssmDouble S=0;
+
+	/*Compute area of element:*/
+	IssmDouble area,planetarea,re;
+	IssmDouble late,longe;
 	this->Element::GetInputValue(&area,AreaEnum);
 
-	/*Compute fraction of the element that is grounded: */
-	if(notfullygrounded){
-		IssmDouble xyz_list[NUMVERTICES][3];
-		::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
-
-		phi=this->GetGroundedPortion(&xyz_list[0][0]); //watch out, this only works because of the Thales theorem! We are in 3D, but this routine is inherently for 2D trias
-		if(glfraction==0)phi=1;
-		#ifdef _ISSM_DEBUG_
-		this->AddInput(SealevelEustaticMaskEnum,&phi,P0Enum);
-		#endif
-	}
-	else phi=1.0;
-
-	/*Retrieve ice thickness at vertices: */
-	Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessChangeEnum);
-	if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!");
-
-	/*/Average ice thickness over grounded area of the element only: {{{*/
-	if(!notfullygrounded)deltathickness_input->GetInputAverage(&I);
-	else{
-		IssmDouble total_weight=0;
-		bool mainlyfloating = true;
-		int         point1;
-		IssmDouble  fraction1,fraction2;
-
-		/*Recover portion of element that is grounded*/
-		this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
-		Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,mainlyfloating,2);
-
-		/* Start  looping on the number of gaussian points and average over these gaussian points: */
-		total_weight=0;
-		I=0;
-		while(gauss->next()){
-			IssmDouble Ig=0;
-			deltathickness_input->GetInputValue(&Ig,gauss);
-			I+=Ig*gauss->weight;
-			total_weight+=gauss->weight;
-		}
-		I=I/total_weight;
-		delete gauss;
-	}
-	/*}}}*/
-
-	/*Compute barystatic contribution:*/
-	_assert_(oceanarea>0.);
-	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
-	bslrice = rho_ice*area*phi*I/(oceanarea*rho_water);
-	_assert_(!xIsNan<IssmDouble>(bslrice));
-
-	if(computerigid){
-		/*convert from m to kg/m^2:*/
-		I=I*rho_ice*phi;
-
-		/*convolve:*/
-		for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*I;
-	}
-
-	/*Plug bslrice into barystatic contribution vector:*/
-	if(barystatic_contribution){
-		id=reCast<int>(partition[this->Sid()])+1;
-		barystatic_contribution->SetValue(id,bslrice,ADD_VAL);
-	}
-	/*return :*/
-	return bslrice;
-}
-/*}}}*/
-IssmDouble Tria::SealevelriseEustaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){ /*{{{*/
-
-	/*diverse:*/
-	int gsize;
-	IssmDouble area;
-	IssmDouble phi=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
-	IssmDouble W;  //change in water height thickness (Farrel and Clarke, Equ. 4)
-	bool notfullygrounded=false;
-	bool scaleoceanarea= false;
-	bool computeelastic= false;
-
-	/*elastic green function:*/
-	IssmDouble* G=NULL;
-
-	/*ice properties: */
-	IssmDouble rho_water;
-	IssmDouble rho_freshwater;
-
-	/*output:*/
-	IssmDouble bslrhydro = 0;
-
-	/*early return if we are on an ice cap. Nop, we may have hydro
-	 * and ice on the same masscon:*/
-	/*if(masks->isiceonly[this->lid]){ 
-		bslrhydro=0;
-		return bslrhydro; 
-	}*/
-
-	/*early return if we are fully floating:*/
-	if (masks->isfullyfloating[this->lid]){ 
-		bslrhydro=0;
-		return bslrhydro; 
-	}
-
-	/*If we are here, we are on earth, not on ice: */
-
 	/*recover parameters: */
-	rho_water=FindParam(MaterialsRhoSeawaterEnum);
-	rho_freshwater=FindParam(MaterialsRhoFreshwaterEnum);
-	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
-	this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
-
-	/*retrieve precomputed G:*/
-	if(computeelastic)this->inputs->GetArrayPtr(SealevelriseGEnum,this->lid,&G,&gsize);
-
-	/*Get area of element: precomputed in the sealevelrise_core_geometry:*/
-	this->Element::GetInputValue(&area,AreaEnum);
-
-	/*Retrieve water height at vertices: */
-	Input* deltathickness_input=this->GetInput(SurfaceloadWaterHeightChangeEnum);
-	if (!deltathickness_input)_error_("SurfaceloadWaterHeightChangeEnum input needed to compute sea level rise!");
-	deltathickness_input->GetInputAverage(&W);
-
-	/*Compute barystatic component:*/
-	_assert_(oceanarea>0.);
-	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
-	bslrhydro = rho_freshwater*area*phi*W/(oceanarea*rho_water);
-	_assert_(!xIsNan<IssmDouble>(bslrhydro));
-
-	if(computeelastic){
-		/*convert from m to kg/m^2:*/
-		W=W*rho_freshwater*phi;
-
-		/*convolve:*/
-		for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*W;
-	}
-
-	/*Plug bslrice into barystatic contribution vector:*/
-	if(barystatic_contribution){
-		id=reCast<int>(partition[this->Sid()])+1;
-		barystatic_contribution->SetValue(id,bslrhydro,ADD_VAL);
-	}
-	/*output:*/
-	return bslrhydro;
-}
-/*}}}*/
-void    Tria::SealevelriseEustaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){ /*{{{*/
-
-	/*diverse:*/
-	int gsize;
-	IssmDouble area;
-	IssmDouble BP;  //change in bottom pressure (Farrel and Clarke, Equ. 4)
-	IssmDouble constant;
-	bool computeelastic= false;
-
-	/*elastic green function:*/
-	IssmDouble* G=NULL;
-
-	/*water properties: */
-	IssmDouble rho_water;
-
-	/*exit now?:*/
-	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
-	if(!computeelastic)return;
-
-	/*we are here to compute fingerprints originating fromn bottom pressure changes:*/
-	if(!masks->isoceanin[this->lid])return;
-
-	/*Inform mask: */
-	#ifdef _ISSM_DEBUG_
-	constant=1; this->AddInput(SealevelEustaticMaskEnum,&constant,P0Enum);
-	#endif
-
-	/*recover material parameters: */
-	rho_water=FindParam(MaterialsRhoSeawaterEnum);
-
-	/*retrieve precomputed G:*/
-	this->inputs->GetArrayPtr(SealevelriseGEnum,this->lid,&G,&gsize);
-
-	/*Get area of element: precomputed in the sealevelrise_core_geometry:*/
-	this->Element::GetInputValue(&area,AreaEnum);
-
-	/*Retrieve bottom pressure change and average over the element: */
-	Input* bottompressure_change_input=this->GetInput(DslSeaWaterPressureChangeAtSeaFloorEnum);
-	if (!bottompressure_change_input)_error_("bottom pressure input needed to compute sea level rise fingerprint!");
-	bottompressure_change_input->GetInputAverage(&BP);
-
-	/*convert from m to kg/m^2:*/
-	BP=BP*rho_water;
-
-	/*convolve:*/
-	for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*BP;
-
+	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
+	this->parameters->FindParam(&re,SolidearthPlanetRadiusEnum);
+	late=slgeom->late[this->lid]/180*M_PI;
+	longe=slgeom->longe[this->lid]/180*M_PI;
+
+	/*recover total load: */
+	if(loads->loads) S+=loads->loads[this->Sid()];
+	if(loads->sealevelloads) S+=loads->sealevelloads[this->Sid()];
+
+	/* Perturbation terms for moment of inertia (moi_list):
+	 * computed analytically (see Wu & Peltier, eqs 10 & 32)
+	 * also consistent with my GMD formulation!
+	 * ALL in geographic coordinates
+	 * */
+	dI_list[0] = -4*M_PI*(S*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
+	dI_list[1] = -4*M_PI*(S*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
+	dI_list[2] = +4*M_PI*(S*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
 	return;
-}
-/*}}}*/
-void    Tria::SealevelriseNonEustatic(IssmDouble* Sgo,IssmDouble* Sg_old, SealevelMasks* masks){ /*{{{*/
-
-	/*diverse:*/
-	int gsize,dummy;
-	IssmDouble S;  //change in water water level(Farrel and Clarke, Equ. 4)
-	IssmDouble constant=0;
-	IssmDouble rho_water;
-	IssmDouble* G=NULL;
-	int  bp_compute_fingerprints= 0;
-
-	/*retrieve parameters:*/
-	this->parameters->FindParam(&bp_compute_fingerprints,DslComputeFingerprintsEnum);
-	rho_water=FindParam(MaterialsRhoSeawaterEnum);
-
-	/*early return if we are not on the ocean:*/
-	if (!masks->isoceanin[this->lid]){
-		constant=0;
-		#ifdef _ISSM_DEBUG_
-		this->AddInput(SealevelEustaticOceanMaskEnum,&constant,P0Enum);
-		#endif
-		return;
-	}
-	constant=1;
-	#ifdef _ISSM_DEBUG_
-	this->AddInput(SealevelEustaticOceanMaskEnum,&constant,P0Enum);
-	#endif
-
-	/*how many dofs are we working with here? */
-	this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
-
-	/*retrieve precomputed G:*/
-	this->inputs->GetArrayPtr(SealevelriseGEnum,this->lid,&G,&dummy); _assert_(dummy==gsize);
-
-	/*From Sg_old, recover water sea level rise:*/
-	S=0; for(int i=0;i<NUMVERTICES;i++) S+=Sg_old[this->vertices[i]->Sid()]/NUMVERTICES;
-
-	/*convert to kg/m^2: */
-	S=S*rho_water;
-
-	for(int i=0;i<gsize;i++) Sgo[i]+=G[i]*S;
+}/*}}}*/
+void       Tria::SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* grdloads,  SealevelGeometry* slgeom){/*{{{*/
+
+	IssmDouble  SA=0;
+	IssmDouble* loads=NULL;
+	IssmDouble* sealevelloads=NULL;
+	IssmDouble  late,longe,re;
+	int         intj;
+	IssmDouble  area;
+	IssmDouble  planetarea;
+
+	/*recover parameters: */
+	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
+	this->parameters->FindParam(&re,SolidearthPlanetRadiusEnum);
+
+	/*Initalize:*/
+	for(int i=0;i<3;i++)dI_list[i]=0;
+
+	/*Go through our loads:*/
+	for(int i=0;i<SLGEOM_NUMLOADS;i++){
+		if(slgeom->issubelement[i][this->lid]){
+			loads=grdloads->subloads[i];
+			if(i==SLGEOM_OCEAN) sealevelloads=grdloads->subsealevelloads;
+			intj=slgeom->subelementmapping[i][this->lid];
+			late=slgeom->latbarycentre[i][intj]/180*M_PI;
+			longe=slgeom->longbarycentre[i][intj]/180*M_PI;
+			area=slgeom->area_subel[i][intj];
+
+			/*recover total load: */
+			if(loads) SA+=loads[intj]*area;
+			if(sealevelloads) SA+=sealevelloads[intj]*area;
+		}
+	}
+
+	/* Perturbation terms for moment of inertia (moi_list):
+	 * computed analytically (see Wu & Peltier, eqs 10 & 32)
+	 * also consistent with my GMD formulation!
+	 * ALL in geographic coordinates
+	 * */
+	dI_list[0] += -4*M_PI*(SA)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
+	dI_list[1] += -4*M_PI*(SA)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
+	dI_list[2] += +4*M_PI*(SA)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
 
 	return;
-}
-/*}}}*/
-void    Tria::SealevelriseGeodetic(IssmDouble* Up, IssmDouble* North ,IssmDouble* East,IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/
-
-	/*diverse:*/
-	int gsize;
-	IssmDouble I, S, BP;		//change in relative ice thickness and sea level
-	IssmDouble rho_ice,rho_water;
-	int horiz;
-	int  bp_compute_fingerprints= 0;
-
-	/*precomputed elastic green functions:*/
-	IssmDouble* GU=NULL;
-	IssmDouble* GN=NULL;
-	IssmDouble* GE=NULL;
-
-	/*computational flags:*/
-	bool computeelastic= false;
-
-	/*early return if we are not on the ocean or on an ice cap:*/
-	if(!masks->isiceonly[this->lid] && !masks->isoceanin[this->lid]) return;
-
-	/*recover parameters:*/
-	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
-	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
-	this->parameters->FindParam(&bp_compute_fingerprints,DslComputeFingerprintsEnum);
-
-	/*early return if elastic not requested:*/
-	if(!computeelastic) return;
-
-	/*recover material parameters: */
-	rho_ice=FindParam(MaterialsRhoIceEnum);
-	rho_water=FindParam(MaterialsRhoSeawaterEnum);
-
-	/*recover elastic Green's functions for displacement:*/
-	this->inputs->GetArrayPtr(SealevelriseGUEnum,this->lid,&GU,&gsize);
-	if(horiz){
-		this->inputs->GetArrayPtr(SealevelriseGEEnum,this->lid,&GE,&gsize);
-		this->inputs->GetArrayPtr(SealevelriseGNEnum,this->lid,&GN,&gsize);
-	}
-
-
-	if(masks->isoceanin[this->lid]){
-		/*From Sg, recover water sea level rise:*/
-		S=0; for(int i=0;i<NUMVERTICES;i++) S+=Sg[this->vertices[i]->Sid()]/NUMVERTICES;
-
-		/*convert to kg/m^2:*/
-		S=rho_water*S;
-		
-		/*If bottom pressures are available, retrieve them to load the bedrock:*/
-		if(bp_compute_fingerprints){
-			Input* bottompressure_change_input=this->GetInput(DslSeaWaterPressureChangeAtSeaFloorEnum);
-			if (!bottompressure_change_input)_error_("bottom pressure input needed to compute sea level rise fingerprint!");
-			bottompressure_change_input->GetInputAverage(&BP);
-
-			/*convert from m to kg/m^2:*/
-			BP=BP*rho_water;
-
-			S+=BP;
-		}
-
-		for(int i=0;i<gsize;i++){
-			Up[i]+=S*GU[i];
-			if(horiz){
-				North[i]+=S*GN[i];
-				East[i]+=S*GE[i];
-			}
-		}
-	}
-	else if (masks->isiceonly[this->lid]){
-
-		/*Compute ice thickness change: */
-		Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessChangeEnum);
-		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!");
-		deltathickness_input->GetInputAverage(&I);
-
-		/*convert to kg/m^2*/
-		I=I*rho_ice;
-
-		for(int i=0;i<gsize;i++){
-			Up[i]+=I*GU[i];
-			if(horiz){
-				North[i]+=I*GN[i];
-				East[i]+=I*GE[i];
-			}
-		}
-	}
-
-	return;
-}
-/*}}}*/
+}/*}}}*/
+void       Tria::SealevelchangeShift(GrdLoads* loads,  IssmDouble offset, SealevelGeometry* slgeom){ /*{{{*/
+
+	if(slgeom->isoceanin[this->lid]){
+		if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
+			int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
+			loads->vsubsealevelloads->SetValue(intj,offset,ADD_VAL);
+		}
+		else loads->vsealevelloads->SetValue(this->sid,offset,ADD_VAL);
+	}
+
+} /*}}}*/
 #endif
 
@@ -5983,5 +7727,5 @@
 	int interp;
 	int type;
-	
+
 	/*Branch according to whether we have a transient or not input: */
 	type=this->inputs->GetInputObjectEnum(name);
@@ -5992,5 +7736,5 @@
 		this->InputServe(triainput);
 		interp=triainput->GetInterpolation();
-		
+
 		if (interp==P0Enum){
 			/*Update the value if this element belongs to the partition: */
@@ -6149,5 +7893,5 @@
 
 					/*build new bed and surface: */
-					if (this->IsFloating()){
+					if (this->IsAllFloating()){
 						/*hydrostatic equilibrium: */
 						IssmDouble rho_ice,rho_water,di;
Index: /issm/trunk/src/c/classes/Elements/Tria.h
===================================================================
--- /issm/trunk/src/c/classes/Elements/Tria.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Elements/Tria.h	(revision 26744)
@@ -17,4 +17,5 @@
 class Node;
 class Material;
+class Matlitho;
 class Seg;
 class ElementMatrix;
@@ -69,4 +70,6 @@
 		void        ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum,int control_interp);
 		void        CreateDistanceInputFromSegmentlist(IssmDouble* distances,int distanceenum);
+		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze, Vector<IssmDouble>* vareae, bool spherical=false);
+		void        ElementCoordinates(Vector<IssmDouble>* vlonge,Vector<IssmDouble>* vlate,Vector<IssmDouble>* vareae);
 		int         EdgeOnBaseIndex();
 		void        EdgeOnBaseIndices(int* pindex1,int* pindex);
@@ -82,4 +85,9 @@
 		void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
 		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list);
+		void        GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl);
+		void        GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelsetenum);
+		void        GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area, int levelset1enum, int levelset2enum);
+		void        GetBarycenterFromLevelset(IssmDouble* platbar, IssmDouble* plongbar,IssmDouble phi,IssmDouble fraction1,IssmDouble fraction2,IssmDouble late, IssmDouble longe, int point1,int istrapeze1, IssmDouble planetradius);
+		IssmDouble  GetTriangleAreaSpherical(IssmDouble xyz_list[3][3]);
 		IssmDouble  GetIcefrontArea();
 		void	      GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
@@ -124,7 +132,7 @@
 		void        ResetHooks();
 		void        ResetLevelsetFromSegmentlist(IssmDouble* segments,int numsegments);
-		void        RignotMeltParameterization();
-		void        SetElementInput(int enum_in,IssmDouble values);
-		void        SetElementInput(Inputs* inputs,int enum_in,IssmDouble values);
+		void        SetElementInput(int enum_in,IssmDouble value);
+		void        SetElementInput(int enum_in,IssmDouble value,int type);
+		void        SetElementInput(Inputs* inputs,int enum_in,IssmDouble value);
 		void        SetElementInput(Inputs* inputs,int numindices,int* indices,IssmDouble* values,int enum_in);
 		void        SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset,int M,int N);
@@ -132,4 +140,5 @@
 	   Element*    SpawnBasalElement(bool depthaverage_materials);
 		Element*    SpawnTopElement(void);
+		bool        IsSpawnedElement(void);
 		void			StrainRateparallel();
 		void			StrainRateperpendicular();
@@ -153,21 +162,22 @@
 		void			WriteFieldIsovalueSegment(DataSet* segments,int fieldenum,IssmDouble fieldvalue);
 
-		#ifdef _HAVE_GIA_
-		void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y);
-		#endif
 		#ifdef _HAVE_ESA_
 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,  Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy);
 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz);
 		#endif
-		#ifdef _HAVE_SEALEVELRISE_
-		IssmDouble OceanAverage(IssmDouble* Sg, SealevelMasks* masks);
-		void    SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old,SealevelMasks* masks);
-		void    SetSealevelMasks(SealevelMasks* masks);
-		void    SealevelriseGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz);
-		IssmDouble    SealevelriseEustaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea);
-		IssmDouble    SealevelriseEustaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea);
-		void    SealevelriseEustaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks);
-		void    SealevelriseNonEustatic(IssmDouble* Sgo,IssmDouble* Sg_old,SealevelMasks* masks);
-		void    SealevelriseGeodetic(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks);
+		#ifdef _HAVE_SEALEVELCHANGE_
+		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y);
+		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae);
+		void       SealevelchangeGeometrySubElementKernel(SealevelGeometry* slgeom);
+		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae);
+		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae);
+		void       SealevelchangeBarystaticLoads(GrdLoads* loads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom);
+		void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom);
+		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom);
+		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom);
+		void       SealevelchangeShift(GrdLoads* loads,  IssmDouble offset, SealevelGeometry* slgeom);
+		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads,  SealevelGeometry* slgeom);
+		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom);
+		void       SealevelchangeUpdateViscousFields();
 		#endif
 		/*}}}*/
@@ -202,11 +212,12 @@
 		void           JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss);
 		IssmDouble     MinEdgeLength(IssmDouble* xyz_list){_error_("not implemented yet");};
+		void	       MovingFrontalVelocity(void);
 		Gauss*         NewGauss(void);
 		Gauss*         NewGauss(int order);
-      Gauss*         NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order);
-      Gauss*         NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order);
-      Gauss*         NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,int order);
-      Gauss*         NewGauss(IssmDouble fraction1,IssmDouble fraction2,int order);
-      Gauss*         NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert);
+        Gauss*         NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order);
+        Gauss*         NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order);
+        Gauss*         NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,int order);
+        Gauss*         NewGauss(IssmDouble fraction1,IssmDouble fraction2,int order);
+        Gauss*         NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert);
 		Gauss*         NewGaussBase(int order);
 		Gauss*         NewGaussLine(int vertex1,int vertex2,int order){_error_("not implemented yet");};
@@ -227,9 +238,10 @@
 		void           SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
 		void           InputServe(Input* input_in);
-		Seg*	         SpawnSeg(int index1,int index2);
+		Seg*	       SpawnSeg(int index1,int index2);
 		IssmDouble     StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
 		void           StabilizationParameterAnisotropic(IssmDouble* tau_parameter_ansiotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa){_error_("not implemented yet");};
 		void           UpdateConstraintsExtrudeFromBase(void);
 		void           UpdateConstraintsExtrudeFromTop(void);
+		void           SealevelchangeGxL(IssmDouble* sealevel, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel, bool percpu,int stackenum,bool computefuture);
 		/*}}}*/
 
Index: /issm/trunk/src/c/classes/Elements/TriaRef.cpp
===================================================================
--- /issm/trunk/src/c/classes/Elements/TriaRef.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Elements/TriaRef.cpp	(revision 26744)
@@ -236,5 +236,5 @@
 	IssmDouble y2 = xyz_list[3*1+1];
 
-	*Jdet = .5*sqrt(pow(x2-x1,2) + pow(y2-y1,2));
+	*Jdet = .5*sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
 	if(*Jdet<0) _error_("negative jacobian determinant!");
 
Index: /issm/trunk/src/c/classes/ExternalResults/GenericExternalResult.h
===================================================================
--- /issm/trunk/src/c/classes/ExternalResults/GenericExternalResult.h	(revision 26743)
+++ /issm/trunk/src/c/classes/ExternalResults/GenericExternalResult.h	(revision 26744)
@@ -606,5 +606,4 @@
 template <> inline void GenericExternalResult<IssmPDouble*>::Transpose(void){/*{{{*/
 
-
 	/*Perform transpose only if we have a matrix*/
 	if(M>1 && N>1){
@@ -624,6 +623,4 @@
 	this->M = temp2;
 
-
-
 } /*}}}*/
 
@@ -679,4 +676,73 @@
 #endif
 
+	/*Specific instantiations for IssmComplex*: */
+template <> inline GenericExternalResult<IssmComplex*>::GenericExternalResult(int in_id, int in_enum_type,IssmComplex* in_values, int in_M,int in_N,int in_step,IssmDouble in_time){/*{{{*/
+
+	id = in_id;
+	M  = in_M;
+	N  = in_N;
+
+	EnumToStringx(&this->result_name,in_enum_type);
+
+	step = in_step;
+	time = in_time;
+
+	/*Copy result in values*/
+	if(M*N){
+		value=xNew<IssmComplex>(M*N);
+		xMemCpy<IssmComplex>(value,in_values,M*N);
+	}
+	else value=NULL;
+}
+/*}}}*/
+template <> inline void GenericExternalResult<IssmComplex*>::WriteData(FILE* fid,bool io_gather){ /*{{{*/
+
+	int     my_rank;
+	int     type;
+	int     rows,cols;
+	char   *name    = NULL;
+	IssmPDouble passiveDouble;
+	IssmDouble* reals=NULL;
+	IssmDouble* imags=NULL;
+
+	/*recover my_rank:*/
+	my_rank=IssmComm::GetRank();
+
+	if(io_gather){
+		/*we are gathering the data on cpu 0, don't write on other cpus: */
+		if(my_rank) return;
+	}
+
+	/*First write enum: */
+	int length=(strlen(this->result_name)+1)*sizeof(char);
+	fwrite(&length,sizeof(int),1,fid);
+	fwrite(this->result_name,length,1,fid);
+
+	/*Now write time and step: */
+	passiveDouble=reCast<IssmPDouble>(time);
+	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
+	fwrite(&step,sizeof(int),1,fid);
+
+	/*writing a IssmComplex array, type is 3:*/
+	type=5;
+	fwrite(&type,sizeof(int),1,fid);
+	rows=this->M;
+	fwrite(&rows,sizeof(int),1,fid);
+	cols=this->N;
+	fwrite(&cols,sizeof(int),1,fid);
+
+	/*write complex array into two real arrays:*/
+	reals=xNew<IssmDouble>(cols*rows);
+	imags=xNew<IssmDouble>(cols*rows);
+	for(int i=0;i<cols*rows;i++){
+		reals[i]=value[i].real();
+		imags[i]=value[i].imag();
+	}
+	fwrite(reals,cols*rows*sizeof(IssmComplex),1,fid);
+	fwrite(imags,cols*rows*sizeof(IssmComplex),1,fid);
+
+}
+/*}}}*/
+
 	/*Specifics instantiations for Vector*/
 	template <> inline GenericExternalResult<Vector<IssmPDouble>*>::GenericExternalResult(int in_id, int in_enum_type,Vector<IssmPDouble>* in_values, int in_M,int in_N,int in_step,IssmDouble in_time){/*{{{*/
Index: /issm/trunk/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk/src/c/classes/FemModel.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/FemModel.cpp	(revision 26744)
@@ -14,4 +14,5 @@
 #include "../shared/io/io.h"
 #include "./classes.h"
+#include "./Inputs/TriaInput.h"
 #include "./modules/modules.h"
 #include "../shared/Enum/Enum.h"
@@ -243,5 +244,4 @@
 	_error_("Could not find index of analysis " << EnumToStringx(analysis_enum) << " in list of FemModel analyses");
 
-
 }/*}}}*/
 void FemModel::CheckPoint(void){/*{{{*/
@@ -821,8 +821,4 @@
 			break;
 
-		case GiaSolutionEnum:
-			analyses_temp[numanalyses++]=GiaAnalysisEnum;
-			break;
-
 		case LoveSolutionEnum:
 			analyses_temp[numanalyses++]=LoveAnalysisEnum;
@@ -833,7 +829,6 @@
 			break;
 
-		case SealevelriseSolutionEnum:
-			analyses_temp[numanalyses++]=SealevelriseAnalysisEnum;
-			analyses_temp[numanalyses++]=GiaAnalysisEnum;
+		case SamplingSolutionEnum:
+			analyses_temp[numanalyses++]=SamplingAnalysisEnum;
 			break;
 
@@ -848,8 +843,9 @@
 		case TransientSolutionEnum:{
 			/*We have multiple analyses here, process one by one*/
-			bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isgroundingline,isstressbalance,ismovingfront,ishydrology,isdamage,issmb,isslr,isesa,isgia;
+			bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isoceantransport,isgroundingline,isstressbalance,ismovingfront,ishydrology,isdamage,issmb,isslc,isesa,issampling;
 			iomodel->FindConstant(&isthermal,"md.transient.isthermal");
 			iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront");
 			iomodel->FindConstant(&ismasstransport,"md.transient.ismasstransport");
+			iomodel->FindConstant(&isoceantransport,"md.transient.isoceantransport");
 			iomodel->FindConstant(&isstressbalance,"md.transient.isstressbalance");
 			iomodel->FindConstant(&isgroundingline,"md.transient.isgroundingline");
@@ -857,9 +853,9 @@
 			iomodel->FindConstant(&ishydrology,"md.transient.ishydrology");
 			iomodel->FindConstant(&issmb,"md.transient.issmb");
-			iomodel->FindConstant(&isslr,"md.transient.isslr");
+			iomodel->FindConstant(&isslc,"md.transient.isslc");
 			iomodel->FindConstant(&isesa,"md.transient.isesa");
-			iomodel->FindConstant(&isgia,"md.transient.isgia");
-         int* analyses_iter     = NULL;
-         int  num_analyses_iter = 0;
+			iomodel->FindConstant(&issampling,"md.transient.issampling");
+      int* analyses_iter     = NULL;
+      int  num_analyses_iter = 0;
 			if(isstressbalance){
 				SolutionAnalysesList(&analyses_iter,&num_analyses_iter,iomodel,StressbalanceSolutionEnum);
@@ -897,13 +893,15 @@
 				analyses_temp[numanalyses++]=DamageEvolutionAnalysisEnum;
 			}
-			if(isslr){
-				analyses_temp[numanalyses++]=GiaAnalysisEnum;
-				analyses_temp[numanalyses++]=SealevelriseAnalysisEnum;
+			if(isoceantransport){
+				analyses_temp[numanalyses++]=OceantransportAnalysisEnum;
+			}
+			if(isslc){
+				analyses_temp[numanalyses++]=SealevelchangeAnalysisEnum;
 			}
 			if(isesa){
 				analyses_temp[numanalyses++]=EsaAnalysisEnum;
 			}
-			if(isgia){
-				analyses_temp[numanalyses++]=GiaAnalysisEnum;
+			if(issampling){
+				analyses_temp[numanalyses++]=SamplingAnalysisEnum;
 			}
 
@@ -986,5 +984,4 @@
 		if(profiler->Used(SMBCORE)) _printf0_("   "<<setw(40)<<left<<"SMB core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(SMBCORE) << " sec\n");
 		if(profiler->Used(GROUNDINGLINECORE)) _printf0_("   "<<setw(40)<<left<<"Groundingline migration core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(GROUNDINGLINECORE) << " sec\n");
-		if(profiler->Used(GIACORE)) _printf0_("   "<<setw(40)<<left<<"GIA core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(GIACORE) << " sec\n");
 		if(profiler->Used(ESACORE)) _printf0_("   "<<setw(40)<<left<<"ESA core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(ESACORE) << " sec\n");
 		if(profiler->Used(SLRCORE)) _printf0_("   "<<setw(40)<<left<<"SLR core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(SLRCORE) << " sec\n");
@@ -1177,5 +1174,5 @@
 		Element* basalelement = element->SpawnBasalElement();
 		basalelement->WriteFieldIsovalueSegment(segments,fieldenum,fieldvalue);
-		if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	}
 
@@ -1605,34 +1602,27 @@
 void FemModel::IcefrontAreax(){/*{{{*/
 
-	int numvertices      = 6;
-	int numbasins;
-	IssmDouble* BasinId   = xNew<IssmDouble>(numvertices);
+	int numbasins,BasinId;
 	this->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
-	IssmDouble* basin_icefront_area           = xNewZeroInit<IssmDouble>(numbasins);
-
-	for(int basin=1;basin<numbasins+1;basin++){
+	IssmDouble* basin_icefront_area = xNewZeroInit<IssmDouble>(numbasins);
+
+	for(int basin=0;basin<numbasins;basin++){
 		IssmDouble local_icefront_area = 0;
 		IssmDouble total_icefront_area;
 
+		/*Add contribution of each element to icefront area of the basin*/
 		for(Object* & object : this->elements->objects){
 			Element* element= xDynamicCast<Element*>(object);
-			element->GetInputListOnVertices(BasinId,FrontalForcingsBasinIdEnum);
-			for(int j=0;j<numvertices;j++){
-				if(BasinId[j]==basin){
-					local_icefront_area+=element->GetIcefrontArea();
-					break;
-				}
-			}
+			element->GetInputValue(&BasinId,FrontalForcingsBasinIdEnum);
+			if(BasinId==basin) local_icefront_area+=element->GetIcefrontArea();
 		}
 		ISSM_MPI_Reduce(&local_icefront_area,&total_icefront_area,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm());
 		ISSM_MPI_Bcast(&total_icefront_area,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
 
-		basin_icefront_area[basin-1]=total_icefront_area;
-	}
-
+		basin_icefront_area[basin]=total_icefront_area;
+	}
+	
 	this->parameters->AddObject(new DoubleVecParam(FrontalForcingsBasinIcefrontAreaEnum,basin_icefront_area,numbasins));
 
 	xDelete<IssmDouble>(basin_icefront_area);
-	xDelete<IssmDouble>(BasinId);
 }/*}}}*/
 void FemModel::IcefrontMassFluxx(IssmDouble* pM, bool scaled){/*{{{*/
@@ -2112,4 +2102,9 @@
 
 }/*}}}*/
+void FemModel::MmeToInputFromId(int id, int rootenum, int interpolationenum){ /*{{{*/
+
+	MmeToInputFromIdx(this->inputs,this->elements,id,rootenum,interpolationenum);
+
+}	//}}}
 void FemModel::OmegaAbsGradientx( IssmDouble* pJ){/*{{{*/
 
@@ -2304,5 +2299,11 @@
 
 			#if defined(_HAVE_CODIPACK_)
+			#if _CODIPACK_MAJOR_==2
+			auto& tape_codi = IssmDouble::getTape();
+			#elif _CODIPACK_MAJOR_==1
 			auto& tape_codi = IssmDouble::getGlobalTape();
+			#else
+			#error "_CODIPACK_MAJOR_ not supported"
+			#endif
 			#endif
 
@@ -2316,5 +2317,11 @@
 						tape_codi.registerOutput(output_value);
 						dependents[i] = output_value.getValue();
+						#if _CODIPACK_MAJOR_==2
+						codi_global.output_indices.push_back(output_value.getIdentifier());
+						#elif _CODIPACK_MAJOR_==1
 						codi_global.output_indices.push_back(output_value.getGradientData());
+						#else
+						#error "_CODIPACK_MAJOR_ not supported"
+						#endif
 					#else
 						output_value>>=dependents[i];
@@ -2352,5 +2359,4 @@
 	if(numonnodes) parameters->FindParam(&resultsonnodes,&numonnodes,SettingsResultsOnNodesEnum);
 
-
 	/*Go through all requested output*/
 	for(int i=0;i<numoutputs;i++){
@@ -2358,5 +2364,4 @@
 		output_enum   = StringToEnumx(output_string,false);
 		isvec         = false;
-
 
 		/*If string is not an enum, it is defined in output definitions*/
@@ -2478,5 +2483,4 @@
 					}
 					break;
-
 
 				   /*Default is always Vector */
@@ -3655,5 +3659,4 @@
 	}
 
-
 	/*Cleanup*/
 	xDelete<IssmDouble>(P0inputs);
@@ -4667,15 +4670,4 @@
 /*}}}*/
 #endif
-#ifdef _HAVE_GIA_
-void FemModel::Deflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, IssmDouble* x, IssmDouble* y){ /*{{{*/
-
-	/*Go through elements, and add contribution from each element to the deflection vector wg:*/
-	for(Object* & object : this->elements->objects){
-		Element* element = xDynamicCast<Element*>(object);
-		element->GiaDeflection(wg,dwgdt, x,y);
-	}
-}
-/*}}}*/
-#endif
 #ifdef _HAVE_ESA_
 void FemModel::EsaGeodetic2D(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pX, Vector<IssmDouble>* pY, IssmDouble* xx, IssmDouble* yy){/*{{{*/
@@ -4753,341 +4745,4 @@
 	xDelete<IssmDouble>(yy);
 	xDelete<IssmDouble>(zz);
-}
-/*}}}*/
-#endif
-#ifdef _HAVE_SEALEVELRISE_
-void FemModel::SealevelriseEustatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslr,IssmDouble* pbslrice, IssmDouble* pbslrhydro, IssmDouble** pbslrice_partition,IssmDouble** pbslrhydro_partition,SealevelMasks* masks) { /*{{{*/
-
-	/*serialized vectors:*/
-	IssmDouble  bslrice       = 0.;
-	IssmDouble  bslrice_cpu   = 0.;
-	IssmDouble  bslrhydro       = 0.;
-	IssmDouble  bslrhydro_cpu   = 0.;
-	IssmDouble  area      = 0.;
-	IssmDouble  oceanarea      = 0.;
-	IssmDouble  oceanarea_cpu  = 0.;
-	int bp_compute_fingerprints= 0;
-
-	Vector<IssmDouble>* bslrice_partition=NULL;
-	IssmDouble* bslrice_partition_serial=NULL;
-	IssmDouble* partitionice=NULL;
-	int npartice,nel; 
-
-	Vector<IssmDouble>* bslrhydro_partition=NULL;
-	IssmDouble* bslrhydro_partition_serial=NULL;
-	IssmDouble* partitionhydro=NULL;
-	int nparthydro; 
-		
-
-   /*Initialize temporary vector that will be used to sum eustatic components
-    * on all local elements, prior to assembly:*/
-	int gsize = this->nodes->NumberOfDofs(GsetEnum);
-	IssmDouble* RSLgi=xNewZeroInit<IssmDouble>(gsize);
-	int* indices=xNew<int>(gsize);
-   for(int i=0;i<gsize;i++) indices[i]=i;
-
-	/*First, figure out the area of the ocean, which is needed to compute the eustatic component: */
-	int i = -1;
-	for(Object* & object : this->elements->objects){
-		i +=1;
-		Element* element = xDynamicCast<Element*>(object);
-		element->GetInputValue(&area,AreaEnum);
-		if (masks->isoceanin[i]) oceanarea_cpu += area;
-	}
-	ISSM_MPI_Reduce (&oceanarea_cpu,&oceanarea,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
-	ISSM_MPI_Bcast(&oceanarea,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
-	_assert_(oceanarea>0.);
-
-	/*Initialize partition vectors to retrieve barystatic contributions: */
-	this->parameters->FindParam(&npartice,SolidearthNpartIceEnum);
-	if(npartice){
-		this->parameters->FindParam(&partitionice,&nel,NULL,SolidearthPartitionIceEnum);
-		bslrice_partition= new Vector<IssmDouble>(npartice);
-	}
-
-	this->parameters->FindParam(&nparthydro,SolidearthNpartHydroEnum);
-	if(nparthydro){
-		this->parameters->FindParam(&partitionhydro,&nel,NULL,SolidearthPartitionHydroEnum);
-		bslrhydro_partition= new Vector<IssmDouble>(nparthydro);
-	}
-
-
-	/*Call the sea level rise core for ice : */
-	bslrice_cpu=0;
-	for(Object* & object : this->elements->objects){
-		Element* element = xDynamicCast<Element*>(object);
-		bslrice_cpu+=element->SealevelriseEustaticIce(RSLgi,masks, bslrice_partition,partitionice,oceanarea);
-	}
-
-	/*Call the sea level rise core for hydro: */
-	bslrhydro_cpu=0;
-	for(int i=0;i<elements->Size();i++){
-		Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
-		bslrhydro_cpu+=element->SealevelriseEustaticHydro(RSLgi,masks, bslrhydro_partition,partitionhydro,oceanarea);
-	}
-
-	/*Call the sea level rise core for bottom pressures: */
-	this->parameters->FindParam(&bp_compute_fingerprints,DslComputeFingerprintsEnum);
-	if(bp_compute_fingerprints){
-		for(int i=0;i<elements->Size();i++){
-			Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
-			element->SealevelriseEustaticBottomPressure(RSLgi,masks);
-		}
-	}
-
-	/*Plug values once and assemble: */
-	pRSLgi->SetValues(gsize,indices,RSLgi,ADD_VAL);
-	pRSLgi->Assemble();
-
-	/*Sum all eustatic components from all cpus:*/
-	ISSM_MPI_Reduce (&bslrice_cpu,&bslrice,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
-	ISSM_MPI_Bcast(&bslrice,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
-	_assert_(!xIsNan<IssmDouble>(bslrice));
-
-	ISSM_MPI_Reduce (&bslrhydro_cpu,&bslrhydro,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
-	ISSM_MPI_Bcast(&bslrhydro,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
-	_assert_(!xIsNan<IssmDouble>(bslrhydro));
-
-	/*Take care of partition vectors:*/
-	if(bslrice_partition){
-		bslrice_partition->Assemble();
-		bslrice_partition_serial=bslrice_partition->ToMPISerial();
-	}
-	if(bslrhydro_partition){
-		bslrhydro_partition->Assemble();
-		bslrhydro_partition_serial=bslrhydro_partition->ToMPISerial();
-	}
-
-
-	/*Free ressources:*/
-	xDelete<int>(indices);
-	xDelete<IssmDouble>(RSLgi);
-	if(bslrhydro_partition)delete bslrhydro_partition;
-	if(bslrice_partition)delete bslrice_partition;
-	if(partitionhydro)xDelete<IssmDouble>(partitionhydro);
-	if(partitionice)xDelete<IssmDouble>(partitionice);
-
-	/*Assign output pointers:*/
-	*poceanarea = oceanarea;
-	*pbslrice  = bslrice;
-	*pbslrhydro  = bslrhydro;
-	*pbslr=bslrhydro+bslrice;
-	*pbslrice_partition=bslrice_partition_serial;
-	*pbslrhydro_partition=bslrhydro_partition_serial;
-
-}
-/*}}}*/
-void FemModel::SealevelriseNonEustatic(Vector<IssmDouble>* pRSLgo, Vector<IssmDouble>* pRSLg_old,  SealevelMasks* masks, bool verboseconvolution){/*{{{*/
-
-	/*serialized vectors:*/
-	IssmDouble* RSLg_old=NULL;
-
-	IssmDouble* RSLgo  = NULL;
-	int* indices = NULL;
-	int         gsize;
-
-	bool computerigid = true;
-	bool computeelastic= true;
-
-	/*recover computational flags: */
-	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
-
-	/*Initialize temporary vector that will be used to sum eustatic components on all local elements, prior
-	 * to assembly:*/
-	gsize = this->nodes->NumberOfDofs(GsetEnum);
-	RSLgo=xNewZeroInit<IssmDouble>(gsize);
-	indices=xNew<int>(gsize); for (int i=0;i<gsize;i++)indices[i]=i;
-
-	/*Serialize vectors from previous iteration:*/
-	RSLg_old=pRSLg_old->ToMPISerial();
-
-	/*Call the sea level rise non-eustatic core only if required: */
-	if(computerigid){
-		for(Object* & object : this->elements->objects){
-			Element* element = xDynamicCast<Element*>(object);
-			element->SealevelriseNonEustatic(RSLgo,RSLg_old,masks);
-		}
-	}
-	pRSLgo->SetValues(gsize,indices,RSLgo,ADD_VAL);
-	pRSLgo->Assemble();
-
-	/*Free ressources:*/
-	xDelete<int>(indices);
-	xDelete<IssmDouble>(RSLgo);
-	xDelete<IssmDouble>(RSLg_old);
-
-}
-/*}}}*/
-void FemModel::SealevelriseRotationalFeedback(Vector<IssmDouble>* pRSLgo_rot, Vector<IssmDouble>* pRSLg_old, IssmDouble* pIxz, IssmDouble* pIyz, IssmDouble* pIzz,  SealevelMasks* masks){/*{{{*/
-
-	/*serialized vectors:*/
-	bool spherical=true;
-	IssmDouble* RSLg_old=NULL;
-	IssmDouble*	tide_love_h  = NULL;
-	IssmDouble*	tide_love_k  = NULL;
-	IssmDouble*	load_love_k  = NULL;
-	IssmDouble  tide_love_k2secular;
-	IssmDouble  moi_e, moi_p, omega, g;
-	IssmDouble	m1, m2, m3;
-	IssmDouble	lati, longi, radi, value;
-	IssmDouble          *latitude    = NULL;
-	IssmDouble          *longitude    = NULL;
-	IssmDouble          *radius    = NULL;
-
-	/*Serialize vectors from previous iteration:*/
-	RSLg_old=pRSLg_old->ToMPISerial();
-
-	IssmDouble moi_list[3]={0,0,0};
-	IssmDouble moi_list_cpu[3]={0,0,0};
-	for(Object* & object : this->elements->objects){
-		Element* element = xDynamicCast<Element*>(object);
-		element->SealevelriseMomentOfInertia(&moi_list[0],RSLg_old,masks );
-		moi_list_cpu[0] += moi_list[0];
-		moi_list_cpu[1] += moi_list[1];
-		moi_list_cpu[2] += moi_list[2];
-	}
-	ISSM_MPI_Reduce (&moi_list_cpu[0],&moi_list[0],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
-	ISSM_MPI_Bcast(&moi_list[0],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
-	//
-	ISSM_MPI_Reduce (&moi_list_cpu[1],&moi_list[1],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
-	ISSM_MPI_Bcast(&moi_list[1],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
-	//
-	ISSM_MPI_Reduce (&moi_list_cpu[2],&moi_list[2],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
-	ISSM_MPI_Bcast(&moi_list[2],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
-
-	/*pull out some useful parameters: */
-	parameters->FindParam(&load_love_k,NULL,NULL,LoadLoveKEnum);
-	parameters->FindParam(&tide_love_h,NULL,NULL,TidalLoveHEnum);
-	parameters->FindParam(&tide_love_k,NULL,NULL,TidalLoveKEnum);
-	parameters->FindParam(&tide_love_k2secular,TidalLoveK2SecularEnum);
-	parameters->FindParam(&moi_e,RotationalEquatorialMoiEnum);
-	parameters->FindParam(&moi_p,RotationalPolarMoiEnum);
-	parameters->FindParam(&omega,RotationalAngularVelocityEnum);
-
-	/*compute perturbation terms for angular velocity vector: */
-	m1 = 1/(1-tide_love_k[2]/tide_love_k2secular) * (1+load_love_k[2])/(moi_p-moi_e) * moi_list[0];
-	m2 = 1/(1-tide_love_k[2]/tide_love_k2secular) * (1+load_love_k[2])/(moi_p-moi_e) * moi_list[1];
-	m3 = -(1+load_love_k[2])/moi_p * moi_list[2];	// term associated with fluid number (3-order-of-magnitude smaller) is negelected
-
-	/*recover lat,long and radius vectors from vertices: */
-	VertexCoordinatesx(&latitude,&longitude,&radius,this->vertices,spherical);
-
-	/* Green's function (1+k_2-h_2/g): checked against Glenn Milne's thesis Chapter 3 (eqs: 3.3-4, 3.10-11)
-	 * Perturbation terms for angular velocity vector (m1, m2, m3): checked against Mitrovica (2005 Appendix) & Jensen et al (2013 Appendix A3)
-	 * Sea level rotational feedback: checked against GMD eqs 8-9 (only first order terms, i.e., degree 2 order 0 & 1 considered)
-	 * all DONE in Geographic coordinates: theta \in [-90,90], lambda \in [-180 180]
-	 */
-	for(Object* & object : vertices->objects){
-		Vertex* vertex=xDynamicCast<Vertex*>(object);
-		int sid=vertex->Sid();
-
-		lati=latitude[sid]/180*PI;
-		longi=longitude[sid]/180*PI;
-		radi=radius[sid];
-
-		/*only first order terms are considered now: */
-		value=((1.0+tide_love_k[2]-tide_love_h[2])/9.81)*pow(omega*radi,2.0)*
-						(-m3/6.0 + 0.5*m3*cos(2.0*lati) - 0.5*sin(2.*lati)*(m1*cos(longi)+m2*sin(longi)));
-
-		pRSLgo_rot->SetValue(sid,value,INS_VAL); //INS_VAL ensures that you don't add several times
-	}
-
-	/*Assemble mesh velocity*/
-	pRSLgo_rot->Assemble();
-
-	/*Assign output pointers:*/
-	if(pIxz)*pIxz=moi_list[0];
-	if(pIyz)*pIyz=moi_list[1];
-	if(pIzz)*pIzz=moi_list[2];
-	xDelete<IssmDouble>(latitude);
-	xDelete<IssmDouble>(longitude);
-	xDelete<IssmDouble>(tide_love_h);
-	xDelete<IssmDouble>(tide_love_k);
-	xDelete<IssmDouble>(load_love_k);
-
-	xDelete<IssmDouble>(radius);
-
-	/*Free ressources:*/
-	xDelete<IssmDouble>(RSLg_old);
-
-}
-/*}}}*/
-void FemModel::SealevelriseElastic(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pRSLg, SealevelMasks* masks){/*{{{*/
-
-	/*serialized vectors:*/
-	IssmDouble* RSLg=NULL;
-
-	IssmDouble* Up  = NULL;
-	IssmDouble* North  = NULL;
-	IssmDouble* East  = NULL;
-	int* indices = NULL;
-	int  gsize;
-	int  horiz;
-
-	/*retrieve parameters:*/
-	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
-
-	/*Serialize vectors from previous iteration:*/
-	RSLg=pRSLg->ToMPISerial();
-
-	/*Initialize temporary vector that will be used to sum eustatic components on all local elements, prior
-	 * to assembly:*/
-	gsize = this->nodes->NumberOfDofs(GsetEnum);
-	Up=xNewZeroInit<IssmDouble>(gsize);
-	if(horiz){
-		North=xNewZeroInit<IssmDouble>(gsize);
-		East=xNewZeroInit<IssmDouble>(gsize);
-	}
-	indices=xNew<int>(gsize); for (int i=0;i<gsize;i++)indices[i]=i;
-
-	/*Call the sea level rise core: */
-	for(Object* & object : this->elements->objects){
-		Element* element = xDynamicCast<Element*>(object);
-		element->SealevelriseGeodetic(Up,North,East,RSLg,masks);
-	}
-
-	pUp->SetValues(gsize,indices,Up,ADD_VAL);
-	pUp->Assemble();
-	if (horiz){
-		pNorth->SetValues(gsize,indices,North,ADD_VAL);
-		pNorth->Assemble();
-		pEast->SetValues(gsize,indices,East,ADD_VAL);
-		pEast->Assemble();
-	}
-
-	/*Free ressources:*/
-	xDelete<IssmDouble>(Up);
-	if(horiz){
-		xDelete<IssmDouble>(North);
-		xDelete<IssmDouble>(East);
-	}
-	xDelete<int>(indices);
-	xDelete<IssmDouble>(RSLg);
-}
-/*}}}*/
-IssmDouble FemModel::SealevelriseOceanAverage(Vector<IssmDouble>* RSLg,SealevelMasks* masks, IssmDouble oceanarea) { /*{{{*/
-
-	IssmDouble* RSLg_serial=NULL;
-	IssmDouble  oceanvalue,oceanvalue_cpu;
-
-	/*Serialize vectors from previous iteration:*/
-	RSLg_serial=RSLg->ToMPISerial();
-
-	/*Initialize:*/
-	oceanvalue_cpu=0;
-
-	/*Go through elements, and add contribution from each element and divide by overall ocean area:*/
-	for(Object* & object : this->elements->objects){
-		Element* element = xDynamicCast<Element*>(object);
-		oceanvalue_cpu += element->OceanAverage(RSLg_serial,masks);
-	}
-
-	ISSM_MPI_Reduce (&oceanvalue_cpu,&oceanvalue,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
-	ISSM_MPI_Bcast(&oceanvalue,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
-
-	/*Free ressources:*/
-	xDelete<IssmDouble>(RSLg_serial);
-
-	return oceanvalue/oceanarea;
 }
 /*}}}*/
@@ -5157,5 +4812,4 @@
 	serial_active=active->ToMPISerial();
 	delete active;
-
 
 	/*Update node activation accordingly*/
@@ -5193,8 +4847,5 @@
 		}
 		xDelete<IssmDouble>(base);
-		if(domaintype!=Domain2DhorizontalEnum){
-			basalelement->DeleteMaterials();
-			delete basalelement;
-		}
+		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	}
 	xDelete<IssmDouble>(serial_active);
@@ -5795,5 +5446,4 @@
 	bool refine;
 
-
 	/*Fill variables*/
 	switch(errorestimator_type){
@@ -5883,5 +5533,4 @@
 
 	//itapopo esse metodo pode ser deletado
-
 
 	/*Here, "zero level set" means grounding line or ice front, depending on the level set type*/
Index: /issm/trunk/src/c/classes/FemModel.h
===================================================================
--- /issm/trunk/src/c/classes/FemModel.h	(revision 26743)
+++ /issm/trunk/src/c/classes/FemModel.h	(revision 26744)
@@ -130,4 +130,5 @@
 		void MinVyx(IssmDouble* presponse);
 		void MinVzx(IssmDouble* presponse);
+		void MmeToInputFromId(int id, int rootenum, int interpolationenum);
 		void DistanceToFieldValue(int fieldenum,IssmDouble fieldvalue,int distanceenum);
 		void ResetLevelset();
@@ -158,17 +159,7 @@
 		void ThicknessAbsGradientx( IssmDouble* pJ);
 		void ThicknessPositivex(IssmDouble* pJ);
-		#ifdef _HAVE_GIA_
-		void Deflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, IssmDouble* x, IssmDouble* y);
-		#endif
 		#ifdef _HAVE_ESA_
 		void EsaGeodetic2D(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pX, Vector<IssmDouble>* pY, IssmDouble* xx, IssmDouble* yy);
 		void EsaGeodetic3D(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, IssmDouble* latitude, IssmDouble* longitude, IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz);
-		#endif
-		#ifdef _HAVE_SEALEVELRISE_
-		void SealevelriseEustatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslr,IssmDouble* pbslrice, IssmDouble* pbslrhydro, IssmDouble** pbslrice_partition,IssmDouble** pbslrhydro_partition, SealevelMasks* masks); 
-		void SealevelriseNonEustatic(Vector<IssmDouble>* pSgo, Vector<IssmDouble>* pSg_old,  SealevelMasks* masks,bool verboseconvolution);
-		void SealevelriseRotationalFeedback(Vector<IssmDouble>* pRSLgo_rot, Vector<IssmDouble>* pRSLg_old, IssmDouble* pIxz, IssmDouble* pIyz, IssmDouble* pIzz, SealevelMasks* masks);
-		void SealevelriseElastic(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pSg_old, SealevelMasks* masks);
-		IssmDouble SealevelriseOceanAverage(Vector<IssmDouble>* Sg,SealevelMasks* masks, IssmDouble oceanarea);
 		#endif
 		void HydrologyEPLupdateDomainx(IssmDouble* pEplcount);
Index: /issm/trunk/src/c/classes/GrdLoads.cpp
===================================================================
--- /issm/trunk/src/c/classes/GrdLoads.cpp	(revision 26744)
+++ /issm/trunk/src/c/classes/GrdLoads.cpp	(revision 26744)
@@ -0,0 +1,69 @@
+/*
+ * \file GrdLoads.cpp
+ * \brief: Implementation of GrdLoads class
+ */
+
+/*Headers: {{{*/
+#ifdef HAVE_CONFIG_H
+	#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "./GrdLoads.h"
+#include "./SealevelGeometry.h"
+using namespace std;
+/*}}}*/
+
+/*Object constructors and destructor*/
+GrdLoads::GrdLoads(int nel,SealevelGeometry* slgeom){ /*{{{*/
+
+	vloads=new Vector<IssmDouble>(nel);
+	for (int i=0;i<SLGEOM_NUMLOADS;i++) vsubloads[i]=new Vector<IssmDouble>(slgeom->nbar[i]);
+
+	vsealevelloads=new Vector<IssmDouble>(nel);
+	vsealevelloads->Set(0);vsealevelloads->Assemble();
+
+	vsubsealevelloads=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
+
+}; /*}}}*/
+GrdLoads::~GrdLoads(){ /*{{{*/
+
+	delete vloads;
+	xDelete<IssmDouble>(loads);
+	for(int i=0;i<SLGEOM_NUMLOADS;i++){
+		delete vsubloads[i];
+		xDelete<IssmDouble>(subloads[i]);
+	}
+	delete vsealevelloads;
+	xDelete<IssmDouble>(sealevelloads);
+	delete vsubsealevelloads;
+	xDelete<IssmDouble>(subsealevelloads);
+}; /*}}}*/
+
+void GrdLoads::BroadcastLoads(void){ /*{{{*/
+
+	/*Initialize barycentre vectors, now that we know their size: */
+	vloads->Assemble();
+	for (int i=0;i<SLGEOM_NUMLOADS;i++){
+		vsubloads[i]->Assemble();
+	}
+
+	loads=vloads->ToMPISerial();
+	for (int i=0;i<SLGEOM_NUMLOADS;i++){
+		subloads[i]=vsubloads[i]->ToMPISerial();
+	}
+
+} /*}}}*/
+void GrdLoads::AssembleSealevelLoads(void){ /*{{{*/
+
+	vsealevelloads->Assemble();
+	vsubsealevelloads->Assemble();
+
+} /*}}}*/
+void GrdLoads::BroadcastSealevelLoads(void){ /*{{{*/
+
+	sealevelloads=vsealevelloads->ToMPISerial();
+	subsealevelloads=vsubsealevelloads->ToMPISerial();
+
+} /*}}}*/
Index: /issm/trunk/src/c/classes/GrdLoads.h
===================================================================
--- /issm/trunk/src/c/classes/GrdLoads.h	(revision 26744)
+++ /issm/trunk/src/c/classes/GrdLoads.h	(revision 26744)
@@ -0,0 +1,32 @@
+/*!\file GrdLoads.h
+ * \brief: header file for GrdLoads
+ */
+
+#ifndef _SEALEVELGRDLOADS_H_
+#define _SEALEVELGRDLOADS_H_
+
+/*Headers:*/
+#include "./SealevelGeometry.h"
+#include "../toolkits/toolkits.h"
+
+class GrdLoads{ 
+
+	public: 
+
+		Vector<IssmDouble>* vloads=NULL;
+		IssmDouble*         loads=NULL;
+		Vector<IssmDouble>* vsubloads[SLGEOM_NUMLOADS];
+		IssmDouble*         subloads[SLGEOM_NUMLOADS];
+		Vector<IssmDouble>* vsealevelloads=NULL;
+		IssmDouble*         sealevelloads=NULL;
+		Vector<IssmDouble>* vsubsealevelloads=NULL;
+		IssmDouble*         subsealevelloads=NULL;
+
+		GrdLoads(int nel, SealevelGeometry* slgeom);
+		~GrdLoads();
+
+		void AssembleSealevelLoads(void);
+		void BroadcastLoads(void);
+		void BroadcastSealevelLoads(void);
+};
+#endif  /* _SEALEVELGRDLOADS_H_ */
Index: /issm/trunk/src/c/classes/Inputs/ControlInput.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/ControlInput.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Inputs/ControlInput.cpp	(revision 26744)
@@ -223,5 +223,4 @@
 	//}
 
-
 	//NEW??
 	//this->gradient->SetInput(interp,numindices,indices,values_in);
@@ -282,5 +281,5 @@
 	else{
 		int* temp = xNew<int>(3);
-		_error_("not supported");
+		_error_("Gradient is of type "<<EnumToStringx(this->gradient->ObjectEnum()) <<", which is not supported yet");
 	}
 
Index: /issm/trunk/src/c/classes/Inputs/DatasetInput.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/DatasetInput.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Inputs/DatasetInput.cpp	(revision 26744)
@@ -90,7 +90,50 @@
 	marshallhandle->call(this->numberofvertices_local);
 	marshallhandle->call(this->ids,numids);
-	//if (marshallhandle->OperationNumber() == MARSHALLING_LOAD) inputs = new Inputs();
-	//inputs->Marshall(marshallhandle);
-	_error_("not implemented");
+
+	/*Allocate memory if need be*/
+	int N = this->numids; _assert_(N>=0 && N<1e6);
+	if(marshallhandle->OperationNumber() == MARSHALLING_LOAD){
+		if(N){
+			this->inputs = xNew<Input*>(N);
+			for(int i=0;i<N;i++) this->inputs[i] = NULL;
+		}
+		else{
+			this->inputs = NULL;
+		}
+	}
+
+	/*Marshall!*/
+	if(marshallhandle->OperationNumber()!=MARSHALLING_LOAD){
+		for(int i=0;i<N;i++){
+			_assert_(this->inputs[i]);
+			object_enum = this->inputs[i]->ObjectEnum();
+			marshallhandle->call(object_enum);
+			this->inputs[i]->Marshall(marshallhandle);
+		}
+	}
+	else{
+		for(int i=0;i<N;i++){
+			marshallhandle->call(object_enum);
+
+			if(object_enum==TriaInputEnum){
+				TriaInput* triainput2=new TriaInput();
+				triainput2->Marshall(marshallhandle);
+				this->inputs[i]=triainput2;
+			}
+			else if(object_enum==PentaInputEnum){
+				PentaInput* pentainput2=new PentaInput();
+				pentainput2->Marshall(marshallhandle);
+				this->inputs[i]=pentainput2;
+			}
+			else if(object_enum==TransientInputEnum){
+				TransientInput* transinput2=new TransientInput();
+				transinput2->Marshall(marshallhandle);
+				this->inputs[i]=transinput2;
+			}
+			else{
+				_error_("input "<<EnumToStringx(object_enum)<<" not supported");
+			}
+		}
+	}
 
 }
Index: /issm/trunk/src/c/classes/Inputs/DatasetInput.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/DatasetInput.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Inputs/DatasetInput.h	(revision 26744)
@@ -20,5 +20,5 @@
 		int             numberofelements_local;
 		int             numberofvertices_local;
-		
+
 	public:
 		int GetNumIds() const {return this->numids;};
Index: /issm/trunk/src/c/classes/Inputs/Input.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/Input.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Inputs/Input.h	(revision 26744)
@@ -44,4 +44,5 @@
 
 		virtual void   AXPY(Input* xinput,IssmDouble scalar){_error_("Not implemented yet");};
+		virtual void   Shift(IssmDouble scalar){_error_("Not implemented yet");};
 		virtual void   PointWiseMult(Input* xinput){_error_("Not implemented yet");};
 		virtual void   Pow(IssmDouble scale_factor){_error_("Not implemented yet");};
Index: /issm/trunk/src/c/classes/Inputs/Inputs.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/Inputs.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Inputs/Inputs.cpp	(revision 26744)
@@ -76,4 +76,17 @@
 		if(this->inputs[i]) _printf_(setw(25)<<EnumToStringx(i+InputsSTARTEnum+1)<<": set as "<<EnumToStringx(this->inputs[i]->ObjectEnum())<<"\n");
 	}
+	return;
+}
+/*}}}*/
+void Inputs::DeepEcho(int enum_in){/*{{{*/
+	int index= EnumToIndex(enum_in);
+	if(this->inputs[index])this->inputs[index]->DeepEcho();
+	return;
+}
+/*}}}*/
+void Inputs::Echo(int enum_in){/*{{{*/
+	_printf_("Inputs Echo:\n");
+	int index= EnumToIndex(enum_in);
+	if(this->inputs[index])this->inputs[index]->Echo();
 	return;
 }
@@ -144,4 +157,14 @@
 				this->inputs[index]=input;
 			}
+			else if(object_enum==TransientInputEnum){
+				TransientInput* input=new TransientInput();
+				input->Marshall(marshallhandle);
+				this->inputs[index]=input;
+			}
+			else if(object_enum==DatasetInputEnum){
+				DatasetInput* input=new DatasetInput();
+				input->Marshall(marshallhandle);
+				this->inputs[index]=input;
+			}
 			else{
 				_error_("input "<<EnumToStringx(object_enum)<<" not supported");
@@ -232,4 +255,57 @@
 	/*Add copy*/
 	this->inputs[index_new] = copy;
+}
+/*}}}*/
+void Inputs::ZAXPY(IssmDouble alpha, int xenum, int yenum, int zenum){/*{{{*/
+
+	_assert_(this);
+
+	/*Get indices from enums*/
+	int index_x = EnumToIndex(xenum);
+	int index_y = EnumToIndex(yenum);
+	int index_z = EnumToIndex(zenum);
+
+	/*Delete output if it already exists*/
+	if(this->inputs[index_z]) delete this->inputs[index_z];
+
+	/*Make sure that old one exists*/
+	if(!this->inputs[index_x]) _error_("Input "<<EnumToStringx(xenum)<<" not found");
+	if(!this->inputs[index_y]) _error_("Input "<<EnumToStringx(yenum)<<" not found");
+
+	/*Make a copy*/
+	this->inputs[index_z]=this->inputs[index_y]->copy();
+
+	/*AXPY: */
+	this->inputs[index_z]->AXPY(this->inputs[index_x],alpha);
+}
+/*}}}*/
+void Inputs::AXPY(IssmDouble alpha, int xenum, int yenum ){/*{{{*/
+
+	_assert_(this);
+
+	/*Get indices from enums*/
+	int index_x = EnumToIndex(xenum);
+	int index_y = EnumToIndex(yenum);
+
+	/*Make sure that old one exists*/
+	if(!this->inputs[index_x]) _error_("Input "<<EnumToStringx(xenum)<<" not found");
+	if(!this->inputs[index_y]) _error_("Input "<<EnumToStringx(yenum)<<" not found");
+
+	/*AXPY: */
+	this->inputs[index_y]->AXPY(this->inputs[index_x],alpha);
+}
+/*}}}*/
+void     Inputs::Shift(int xenum, IssmDouble alpha){/*{{{*/
+
+	_assert_(this);
+
+	/*Get indices from enums*/
+	int index_x = EnumToIndex(xenum);
+
+	/*Make sure that x exists*/
+	if(!this->inputs[index_x]) _error_("Input "<<EnumToStringx(xenum)<<" not found");
+
+	/*Shift: */
+	this->inputs[index_x]->Shift(alpha);
 }
 /*}}}*/
Index: /issm/trunk/src/c/classes/Inputs/Inputs.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/Inputs.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Inputs/Inputs.h	(revision 26744)
@@ -46,6 +46,11 @@
 		int      DeleteInput(int enum_type);
 		void     DuplicateInput(int original_enum,int new_enum);
+		void     ZAXPY(IssmDouble alpha, int xenum, int yenum, int zenum);
+		void     AXPY(IssmDouble alpha, int xenum, int yenum);
+		void     Shift(int inputenum, IssmDouble alpha);
 		void     DeepEcho(void);
+		void     DeepEcho(int enum_in);
 		void     Echo(void);
+		void     Echo(int enum_in);
 		bool     Exist(int enum_type);
 		void     GetInputsInterpolations(int* pnuminputs,int** pinterpolations,int** penum);
Index: /issm/trunk/src/c/classes/Inputs/PentaInput.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/PentaInput.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Inputs/PentaInput.cpp	(revision 26744)
@@ -177,4 +177,13 @@
 		}
 	}
+	else if(interp_in==P0Enum && this->interpolation==P0Enum){
+		_assert_(this->N==1);
+		for(int i=0;i<numindices;i++){
+			int row = indices[i];
+			_assert_(row>=0);
+			_assert_(row<this->M);
+			this->values[row] = values_in[i];
+		}
+	}
 	else if(this->interpolation!=P1Enum && interp_in==P1Enum){
 		this->Reset(interp_in);
Index: /issm/trunk/src/c/classes/Inputs/TransientInput.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/TransientInput.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Inputs/TransientInput.cpp	(revision 26744)
@@ -94,11 +94,25 @@
 void TransientInput::DeepEcho(void){/*{{{*/
 
-	int i;
-
 	_printf_("TransientInput:\n");
 	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
 	_printf_("   numtimesteps: " << this->numtimesteps << "\n");
 	_printf_("---inputs: \n");
-	for(i=0;i<this->numtimesteps;i++){
+	for(int i=0;i<this->numtimesteps;i++){
+		_printf_("   time: " << this->timesteps[i]<<"  ");
+		if(this->inputs[i]) this->inputs[i]->DeepEcho();
+		else                _printf_(" NOT SET! \n");
+	}
+}
+/*}}}*/
+void TransientInput::Configure(Parameters* params){/*{{{*/
+	this->parameters=params;
+}
+/*}}}*/
+void TransientInput::Echo(void){/*{{{*/
+	_printf_("TransientInput:\n");
+	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
+	_printf_("   numtimesteps: " << this->numtimesteps << "\n");
+	_printf_("---inputs: \n");
+	for(int i=0;i<this->numtimesteps;i++){
 		_printf_("   time: " << this->timesteps[i]<<"  ");
 		if(this->inputs[i]) this->inputs[i]->Echo();
@@ -107,29 +121,58 @@
 }
 /*}}}*/
-void TransientInput::Configure(Parameters* params){/*{{{*/
-	this->parameters=params;
-}
-/*}}}*/
-void TransientInput::Echo(void){/*{{{*/
-	this->DeepEcho();
-}
-/*}}}*/
 int  TransientInput::Id(void){ return -1; }/*{{{*/
 /*}}}*/
 void TransientInput::Marshall(MarshallHandle* marshallhandle){ /*{{{*/
-
-	if (marshallhandle->OperationNumber() == MARSHALLING_LOAD){
-		_error_("not implmented");
-		//inputs = new Inputs();
-	}
 
 	int object_enum = TransientInputEnum;
    marshallhandle->call(object_enum);
 
+	marshallhandle->call(this->numberofelements_local);
+	marshallhandle->call(this->numberofvertices_local);
 	marshallhandle->call(this->enum_type);
 	marshallhandle->call(this->numtimesteps);
 	marshallhandle->call(this->timesteps,numtimesteps);
-	//inputs->Marshall(marshallhandle);
-	_error_("not implemented");
+
+	/*Allocate memory if need be*/
+	if(marshallhandle->OperationNumber() == MARSHALLING_LOAD){
+		int N = this->numtimesteps; _assert_(N>=0 && N<1e6);
+		if(N){
+			this->inputs = xNew<Input*>(N);
+			for(int i=0;i<N;i++) this->inputs[i] = NULL;
+		}
+		else{
+			this->inputs = NULL;
+		}
+	}
+
+	/*Marshall!*/
+	if(marshallhandle->OperationNumber()!=MARSHALLING_LOAD){
+		for(int i=0;i<this->numtimesteps;i++){
+			_assert_(this->inputs[i]);
+			object_enum = this->inputs[i]->ObjectEnum();
+			marshallhandle->call(object_enum);
+			this->inputs[i]->Marshall(marshallhandle);
+		}
+	}
+	else{
+		for(int i=0;i<this->numtimesteps;i++){
+			marshallhandle->call(object_enum);
+
+			if(object_enum==TriaInputEnum){
+				TriaInput* triainput2=new TriaInput();
+				triainput2->Marshall(marshallhandle);
+				this->inputs[i]=triainput2;
+			}
+			else if(object_enum==PentaInputEnum){
+				PentaInput* pentainput2=new PentaInput();
+				pentainput2->Marshall(marshallhandle);
+				this->inputs[i]=pentainput2;
+			}
+			else{
+				_error_("input "<<EnumToStringx(object_enum)<<" not supported");
+			}
+		}
+	}
+
 }
 /*}}}*/
@@ -348,5 +391,4 @@
 PentaInput* TransientInput::GetPentaInput(int offset){/*{{{*/
 
-
 	/*Check offset*/
 	if(offset<0 || offset>this->numtimesteps-1){
@@ -379,6 +421,40 @@
 
 	/*First, recover current time from parameters: */
-	bool linear_interp;
-	this->parameters->FindParam(&linear_interp,TimesteppingInterpForcingsEnum);
+	bool linear_interp,cycle;
+	IssmDouble dt;
+	this->parameters->FindParam(&linear_interp,TimesteppingInterpForcingEnum);
+	this->parameters->FindParam(&cycle,TimesteppingCycleForcingEnum);
+	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);          /*transient core time step*/
+
+	/*Change input time if we cycle through the forcing*/
+	IssmDouble time0 = this->timesteps[0];
+	IssmDouble time1 = this->timesteps[this->numtimesteps - 1];
+
+	/*We need the end time to be the last timestep that would be taken*/
+	/* i.e., the case where GEMB has time stamps (finer timestep) after the last timestep */
+	IssmDouble nsteps = reCast<int,IssmDouble>(time1/dt);
+	if (reCast<IssmDouble>(nsteps)<time1/dt) nsteps=nsteps+1;
+	time1 = nsteps*dt;
+
+	if(cycle){
+
+		/*See by how many intervals we have to offset time*/
+		IssmDouble deltat = time1-time0;
+
+		//int num_intervals = floor((time-time0)/deltat); //Cannot do that because of AD!
+		int num_intervals = reCast<int,IssmDouble>(fabs(time-time0)/deltat);
+
+		/*Uncomment following line if you would like to apply a cycle BEFORE the time series starts*/
+		if(time<time0) num_intervals = -num_intervals-1;
+
+		if(fabs(time-time0)/deltat == reCast<IssmDouble>(num_intervals)){
+			/*Hack to make sure we always cover the last value of the series (discussion with Nicole)*/
+			time = time1;
+		}
+		else{
+			/*Now offset time so that we do the right interpolation below*/
+			time = time - num_intervals*deltat;
+		}
+	}
 
 	/*Figure step out*/
@@ -440,5 +516,4 @@
 		this->current_input->AXPY(input2,alpha2);
 	}
-
 }/*}}}*/
 void TransientInput::SetAverageAsCurrentTimeInput(IssmDouble start_time,IssmDouble end_time, int averaging_method){/*{{{*/
Index: /issm/trunk/src/c/classes/Inputs/TransientInput.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/TransientInput.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Inputs/TransientInput.h	(revision 26744)
@@ -18,12 +18,12 @@
 
 	public:
-		int         enum_type;
-		int         numtimesteps;
-		Input**    inputs;
-		IssmDouble *timesteps;
-		Parameters *parameters;     //to find current time.
+		int          enum_type;
+		int          numtimesteps;
+		Input      **inputs;
+		IssmDouble  *timesteps;
+		Parameters  *parameters;      //to find current time.
 
-		IssmDouble  current_step;
-		Input*     current_input;
+		IssmDouble   current_step;
+		Input       *current_input;
 
 		/*TransientInput constructors, destructors: {{{*/
Index: /issm/trunk/src/c/classes/Inputs/TriaInput.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/TriaInput.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Inputs/TriaInput.cpp	(revision 26744)
@@ -384,4 +384,11 @@
 }
 /*}}}*/
+void TriaInput::Shift(IssmDouble alpha){/*{{{*/
+
+	/*Carry out the shift operation:*/
+	for(int i=0;i<this->M*this->N;i++) this->values[i] +=alpha;
+	for(int i=0;i<TriaRef::NumberofNodes(this->interpolation);i++) this->element_values[i] += alpha;
+}
+/*}}}*/
 void TriaInput::PointWiseMult(Input* xinput){/*{{{*/
 
Index: /issm/trunk/src/c/classes/Inputs/TriaInput.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/TriaInput.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Inputs/TriaInput.h	(revision 26744)
@@ -40,4 +40,5 @@
 		void Pow(IssmDouble scalar);
 		void AXPY(Input* xinput,IssmDouble scalar);
+		void Shift(IssmDouble scalar);
 		void PointWiseMult(Input* xinput);
 		void Serve(int numindices,int* indices);
Index: /issm/trunk/src/c/classes/IoModel.cpp
===================================================================
--- /issm/trunk/src/c/classes/IoModel.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/IoModel.cpp	(revision 26744)
@@ -449,4 +449,16 @@
 }
 /*}}}*/
+void  IoModel::ConstantToInput(Inputs* inputs,Elements* elements,IssmDouble value, int vector_enum,int type){/*{{{*/
+
+	if (type==P1Enum){
+		for(Object* & object : elements->objects){
+			Element* element=xDynamicCast<Element*>(object);
+			element->InputCreateP1FromConstant(inputs,this,value,vector_enum);
+		}
+	}
+	else _error_("not supported yet!");
+	return;
+}
+/*}}}*/
 void  IoModel::DeclareIndependents(bool trace,IssmPDouble* X){/*{{{*/
 
@@ -600,9 +612,9 @@
 				record_name=xNew<char>(record_name_size+1);
 				record_name[record_name_size]='\0';
-				
+
 				/*Read record_name: */
 				if(fread(record_name,record_name_size*sizeof(char),1,fid)!=0){};
-				
-				_error_("error while looking in binary file. String " << record_name << " a string of size "<<record_name_size);
+
+				_error_("error while looking in binary file. String \"" << record_name << "\" is a string of size "<<record_name_size);
 			}
 
@@ -656,4 +668,5 @@
 					if(strcmp(record_name,"md.timestepping.type")==0) integer = IoCodeToEnumTimestepping(integer);
 					if(strcmp(record_name,"md.amr.type")==0) integer = IoCodeToEnumAmr(integer);
+					if(strcmp(record_name,"md.solidearth.settings.grdmodel")==0) integer = IoCodeToEnumGrd(integer);
 
 					/*Broadcast to other cpus*/
@@ -683,4 +696,7 @@
 							/*create DoubleParam: */
 							this->AddConstant(new IoConstant(scalar,record_name));
+						}
+						else{
+							if(fread(&pscalar,sizeof(IssmPDouble),1,this->fid)!=1) _error_("could not read scalar ");
 						}
 					  }
@@ -1822,8 +1838,4 @@
 				matrix=array[i];
 
-				//recover time vector: 
-				times=xNew<IssmDouble>(N);
-				for(int t=0;t<N;t++) times[t] = matrix[(M-1)*N+t];
-
 				//initialize transient input dataset:
 				TransientInput* transientinput=inputs->SetDatasetTransientInput(input_enum,i, times,N);
@@ -1837,5 +1849,4 @@
 					int        *vertexlids = xNew<int>(numvertices);
 					int        *vertexsids = xNew<int>(numvertices);
-
 
 					/*Recover vertices ids needed to initialize inputs*/
@@ -1847,4 +1858,9 @@
 
 					if(M==this->numberofvertices || M==(this->numberofvertices+1)){
+
+						//recover time vector: 
+						times=xNew<IssmDouble>(N);
+						if(M==this->numberofvertices) times[0] = matrix[M-1];
+						if(M==this->numberofvertices+1) for(int t=0;t<N;t++) times[t] = matrix[(M-1)*N+t];
 
 						IssmDouble* values=xNew<IssmDouble>(numvertices);
@@ -1865,8 +1881,12 @@
 						IssmDouble value;
 
+						//recover time vector: 
+						times=xNew<IssmDouble>(N);
+						if(M==this->numberofelements) times[0] = matrix[M-1];
+						if(M==this->numberofelements+1) for(int t=0;t<N;t++) times[t] = matrix[(M-1)*N+t];
+
 						for(int t=0;t<N;t++){ 
 
 							value=matrix[N*element->Sid()+t];
-							//if(element->Sid()==188 && t==0)_printf_("value: " << value << "\n");
 							switch(element->ObjectEnum()){
 								case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&element->lid,&value,P0Enum); break;
@@ -1876,6 +1896,25 @@
 						}
 					}
+					else if(M==2 || M==1){
+						IssmDouble value;
+
+						//recover time vector: 
+						times=xNew<IssmDouble>(N);
+						if(M==1) times[0] = 0;
+						if(M==2) for(int t=0;t<N;t++) times[t] = matrix[(M-1)*N+t];
+
+						for(int t=0;t<N;t++){ 
+
+							value=matrix[t];
+							switch(element->ObjectEnum()){
+								case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&element->lid,&value,P0Enum); break;
+								case PentaEnum:  transientinput->AddPentaTimeInput( t,1,&element->lid,&value,P0Enum); break;
+								default: _error_("Not implemented yet");
+							}
+						}
+
+					}
 					else _error_("FetchDataToInput error message: row size of MatArray elements should be either numberofelements (+1) or numberofvertices (+1)");
-					
+
 					xDelete<int>(vertexlids);
 					xDelete<int>(vertexsids);
@@ -2024,7 +2063,16 @@
 				scalar=pscalar;
 			}
+			#if _CODIPACK_MAJOR_==2
+			auto& tape_codi = IssmDouble::getTape();
+			tape_codi.registerInput(scalar);
+			codi_global.input_indices.push_back(scalar.getIdentifier());
+			#elif _CODIPACK_MAJOR_==1
 			auto& tape_codi = IssmDouble::getGlobalTape();
 			tape_codi.registerInput(scalar);
 			codi_global.input_indices.push_back(scalar.getGradientData());
+			#else
+			#error "_CODIPACK_MAJOR_ not supported"
+			#endif
+
 		#else
 			if(X){
@@ -2097,10 +2145,24 @@
 			#if defined(_HAVE_CODIPACK_)
 				// FIXME codi here we just assign instead of using "operator <<="
+				#if _CODIPACK_MAJOR_==2
+				auto& tape_codi = IssmDouble::getTape();
+				#elif _CODIPACK_MAJOR_==1
 				auto& tape_codi = IssmDouble::getGlobalTape();
+				#else
+				#error "_CODIPACK_MAJOR_ not supported"
+				#endif
+
 				if(X){
 					for (int i=0;i<M*N;i++) {
 						matrix[i]=X[Xcount+i];
 						tape_codi.registerInput(matrix[i]);
+						#if _CODIPACK_MAJOR_==2
+						codi_global.input_indices.push_back(matrix[i].getIdentifier());
+						#elif _CODIPACK_MAJOR_==1
 						codi_global.input_indices.push_back(matrix[i].getGradientData());
+						#else
+						#error "_CODIPACK_MAJOR_ not supported"
+						#endif
+
 					}
 				}
@@ -2109,5 +2171,11 @@
 						matrix[i]=buffer[i];
 						tape_codi.registerInput(matrix[i]);
+						#if _CODIPACK_MAJOR_==2
+						codi_global.input_indices.push_back(matrix[i].getIdentifier());
+						#elif _CODIPACK_MAJOR_==1
 						codi_global.input_indices.push_back(matrix[i].getGradientData());
+						#else
+						#error "_CODIPACK_MAJOR_ not supported"
+						#endif
 					}
 				}
@@ -2922,5 +2990,12 @@
 		 * -> These parameters are not read for the CoDiPack ISSM version!
 		 */
+		#if _CODIPACK_MAJOR_==2
+		auto& tape_codi = IssmDouble::getTape();
+		#elif _CODIPACK_MAJOR_==1
 		auto& tape_codi = IssmDouble::getGlobalTape();
+		#else
+		#error "_CODIPACK_MAJOR_ not supported"
+		#endif
+
 		tape_codi.setActive();
 		#if _AD_TAPE_ALLOC_
@@ -2935,5 +3010,5 @@
 		/*
 		std::stringstream out_s;
-		IssmDouble::getGlobalTape().printStatistics(out_s);
+		IssmDouble::getTape().printStatistics(out_s);
 		_printf0_("StartTrace::Tape Statistics	   : TapeAlloc count=[" << codi_allocn << "]\n" << out_s.str());
 		*/
Index: /issm/trunk/src/c/classes/IoModel.h
===================================================================
--- /issm/trunk/src/c/classes/IoModel.h	(revision 26743)
+++ /issm/trunk/src/c/classes/IoModel.h	(revision 26744)
@@ -123,4 +123,5 @@
 		void        CheckFile(void);
 		Param      *CopyConstantObject(const char* constant_name,int param_enum);
+		void        ConstantToInput(Inputs* inputs,Elements* elements,IssmDouble value, int vector_enum,int type);
 		IssmDouble *Data(const char* data_name);
 		void        DeclareIndependents(bool trace,IssmPDouble* X);
Index: /issm/trunk/src/c/classes/Loads/Channel.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Channel.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Loads/Channel.cpp	(revision 26744)
@@ -320,5 +320,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->fsize){
+					if(nodes[i]->FSize()){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -336,5 +336,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->ssize){
+					if(nodes[i]->SSize()){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
Index: /issm/trunk/src/c/classes/Loads/Friction.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Friction.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Loads/Friction.cpp	(revision 26744)
@@ -18,14 +18,51 @@
 Friction::Friction(){/*{{{*/
 	this->element=NULL;
-	this->dim=0;
 	this->law=0;
-
+	this->apply_dim = 1.;
+	this->domaintype=-1;
+	this->vx_input=NULL;
+	this->vy_input=NULL;
+	this->vz_input=NULL;
 }
 /*}}}*/
-Friction::Friction(Element* element_in,int dim_in){/*{{{*/
-
+Friction::Friction(Element* element_in){/*{{{*/
+	/* Determine the dimension according to the domain type automatically. 
+	 * There are exceptions, e.g. HO, which needs the user to specify the dimension used in Friciton.*/
 	this->element=element_in;
-	this->dim=dim_in;
+
+	/* Load necessary parameters */
 	element_in->FindParam(&this->law,FrictionLawEnum);
+	element_in->FindParam(&this->domaintype,DomainTypeEnum);
+
+	/* Load VxBase and VyBase for this special case */
+	switch(this->domaintype){
+		case Domain2DhorizontalEnum: 
+			this->apply_dim = 2.;
+			this->vx_input = element_in->GetInput(VxBaseEnum);			_assert_(this->vx_input); 
+			this->vy_input = element_in->GetInput(VyBaseEnum);			_assert_(this->vy_input);
+			this->vz_input = NULL;
+			break;
+      case Domain2DverticalEnum:
+			this->apply_dim = 2.;
+			this->vx_input = element_in->GetInput(VxEnum);				_assert_(this->vx_input);
+			this->vy_input = element_in->GetInput(VyEnum);				_assert_(this->vy_input);
+			this->vz_input = NULL;
+			break;
+      case Domain3DEnum:           
+			this->apply_dim = 3.;
+			this->vx_input = element_in->GetInput(VxEnum);				_assert_(this->vx_input);
+			this->vy_input = element_in->GetInput(VyEnum);				_assert_(this->vy_input);
+			this->vz_input = element_in->GetInput(VzEnum);				_assert_(this->vz_input);
+			break;
+      default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+}
+/*}}}*/
+Friction::Friction(Element* element_in,int dim) : Friction(element_in) {/*{{{*/
+	this->apply_dim = reCast<IssmDouble>(dim);
+}
+/*}}}*/
+Friction::Friction(Element* element_in,IssmDouble dim) : Friction(element_in) {/*{{{*/
+	this->apply_dim = dim;
 }
 /*}}}*/
@@ -34,8 +71,9 @@
 /*}}}*/
 
+
 /*methods: */
 void Friction::Echo(void){/*{{{*/
 	_printf_("Friction:\n");
-	_printf_("   dim: " << this->dim<< "\n");
+	_printf_("   Domain type: " << this->domaintype<< "\n");
 }
 /*}}}*/
@@ -61,5 +99,4 @@
 			_error_("not supported");
 	}
-
 
 	/*Checks*/
@@ -160,7 +197,13 @@
 	IssmDouble vmag = VelMag(gauss);
 
-	/*Check to prevent dividing by zero if vmag==0*/
-	if(vmag==0. && (s-1.)<0.) alpha_complement=0.;
-	else alpha_complement=pow(Neff,r)*pow(vmag,(s-1));
+	if(s==1.){
+		/*This is to make AD happy and avoid 0^0*/
+		alpha_complement=pow(Neff,r);
+	}
+	else{
+		/*Check to prevent dividing by zero if vmag==0*/
+		if(vmag==0. && (s-1.)<0.) alpha_complement=0.;
+		else alpha_complement=pow(Neff,r)*pow(vmag,(s-1.));
+	}
 
 	/*Assign output pointers:*/
@@ -219,5 +262,5 @@
 	if(vmag==0. && (1./m-1.)<0.) alpha_complement=0.;
 	else alpha_complement= pow(vmag, 1.0/m-1.);
-	
+
 	/*Assign output pointers:*/
 	*palpha_complement=alpha_complement;
@@ -261,4 +304,7 @@
 		case 12:
 			GetAlpha2Tsai(palpha2,gauss);
+			break;
+		case 13:
+			GetAlpha2Coulomb2(palpha2,gauss);
 			break;
 	  default:
@@ -304,10 +350,12 @@
 	IssmDouble vmag = VelMag(gauss);
 
-	/*Check to prevent dividing by zero if vmag==0*/
-	if(vmag==0. && (s-1.)<0.){
-		alpha2=0.;
+	if(s==1.){
+		/*This is to make AD happy and avoid 0^0*/
+		alpha2=drag_coefficient*drag_coefficient*pow(Neff,r);
 	}
 	else{
-		alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+		/*Check to prevent dividing by zero if vmag==0*/
+		if(vmag==0. && (s-1.)<0.) alpha2=0.;
+		else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
 	}
 
@@ -461,5 +509,4 @@
 	deltaT = T-Tpmp;
 
-
 	/*Compute gamma*/
 	element->parameters->FindParam(&time,TimeEnum);
@@ -498,10 +545,31 @@
 
 	/*Get effective pressure and basal velocity*/
-	IssmDouble Neff = EffectivePressure(gauss);
 	IssmDouble vmag = VelMag(gauss);
 
+	bool ispwStochastic;
+	IssmDouble Neff;
+	element->parameters->FindParam(&ispwStochastic,StochasticForcingIsWaterPressureEnum);
+	if(ispwStochastic){
+		/*Retrieve stochastic water pressure and compute ice pressure*/
+		IssmDouble p_ice,p_water,Neff_limit;
+		element->GetInputValue(&p_water,gauss,FrictionWaterPressureEnum);
+		element->parameters->FindParam(&Neff_limit,FrictionEffectivePressureLimitEnum);
+		p_ice = IcePressure(gauss);
+		Neff  = max(Neff_limit*p_ice, p_ice - p_water);
+	}	
+	else{
+		/*Compute effective pressure directly*/
+		Neff = EffectivePressure(gauss);
+	}
+
 	/*Check to prevent dividing by zero if vmag==0*/
-	if(vmag==0. && (s-1.)<0.) alpha2=0.;
-	else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+	if(s==1.){
+		/*This is to make AD happy and avoid 0^0*/
+		alpha2=drag_coefficient*drag_coefficient*pow(Neff,r);
+	}
+	else{
+		if(vmag==0. && (s-1.)<0.) alpha2=0.;
+		else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+	}
 
 	/*Assign output pointers:*/
@@ -547,7 +615,13 @@
 	IssmDouble vmag = VelMag(gauss);
 
-	/*Check to prevent dividing by zero if vmag==0*/
-	if(vmag==0. && (s-1.)<0.) alpha2=0.;
-	else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+	if(s==1.){
+		/*This is to make AD happy and avoid 0^0*/
+		alpha2=drag_coefficient*drag_coefficient*pow(Neff,r);
+	}
+	else{
+		/*Check to prevent dividing by zero if vmag==0*/
+		if(vmag==0. && (s-1.)<0.) alpha2=0.;
+		else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+	}
 
 	/*Assign output pointers:*/
@@ -695,5 +769,5 @@
 
 	/*Compute alpha^2*/
-	if(ub<1e-10){
+	if((ub<1e-10) ||(N==0.0)){
 		alpha2 = 0.;
 	}
@@ -735,4 +809,36 @@
 
 		alpha2 = alpha2/ub;
+	}
+
+	/*Assign output pointers:*/
+	*palpha2=alpha2;
+}/*}}}*/
+void Friction::GetAlpha2Coulomb2(IssmDouble* palpha2, Gauss* gauss){/*{{{*/
+
+	/*This routine calculates the basal friction coefficient
+	 *
+	 *               C^2 |u_b|^(m-1) * (.5*N)
+	 * alpha2= ___________________________________
+	 *          (C^(2/m) |u_b| + (0.5*N)^(1/m) )^m
+	 *
+	 * */
+
+	/*diverse: */
+	IssmDouble  C,m,alpha2;
+
+	/*Recover parameters: */
+	element->GetInputValue(&C,gauss,FrictionCEnum);
+	element->GetInputValue(&m,gauss,FrictionMEnum);
+
+	/*Get effective pressure and velocity magnitude*/
+	IssmDouble N  = EffectivePressure(gauss);
+	IssmDouble ub = VelMag(gauss);
+
+	/*Compute alpha^2*/
+	if(ub<1e-10){
+		alpha2 = 0.;
+	}
+	else{
+		alpha2= (pow(C,2)*pow(ub,m-1.)*(0.5*N)) / pow(pow(C,2./m)*ub + pow(0.5*N,1./m),m);
 	}
 
@@ -754,14 +860,14 @@
 	element->parameters->FindParam(&Neff_limit,FrictionEffectivePressureLimitEnum);
 
+	/*Compute ice pressure*/
+	p_ice = IcePressure(gauss);
+
 	/*From base and thickness, compute effective pressure when drag is viscous, or get Neff from forcing:*/
 	switch(coupled_flag){
 		case 0:{
-			element->GetInputValue(&thickness, gauss,ThicknessEnum);
 			element->GetInputValue(&base, gauss,BaseEnum);
 			element->GetInputValue(&sealevel, gauss,SealevelEnum);
 			IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
-			IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
 			IssmDouble gravity   = element->FindParam(ConstantsGEnum);
-			p_ice   = gravity*rho_ice*thickness;
 			p_water = rho_water*gravity*(sealevel-base);
 			Neff = p_ice - p_water;
@@ -769,8 +875,4 @@
 			break;
 		case 1:{
-			element->GetInputValue(&thickness, gauss,ThicknessEnum);
-			IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
-			IssmDouble gravity   = element->FindParam(ConstantsGEnum);
-			p_ice   = gravity*rho_ice*thickness;
 			p_water = 0.;
 			Neff = p_ice - p_water;
@@ -778,11 +880,8 @@
 			break;
 		case 2:{
-			element->GetInputValue(&thickness, gauss,ThicknessEnum);
 			element->GetInputValue(&base, gauss,BaseEnum);
 			element->GetInputValue(&sealevel, gauss,SealevelEnum);
 			IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
-			IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
 			IssmDouble gravity   = element->FindParam(ConstantsGEnum);
-			p_ice   = gravity*rho_ice*thickness;
 			p_water = max(0.,rho_water*gravity*(sealevel-base));
 			Neff = p_ice - p_water;
@@ -791,16 +890,8 @@
 		case 3:{
 			element->GetInputValue(&Neff,gauss,FrictionEffectivePressureEnum);
-			element->GetInputValue(&thickness, gauss,ThicknessEnum);
-			IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
-			IssmDouble gravity   = element->FindParam(ConstantsGEnum);
-			p_ice   = gravity*rho_ice*thickness;
 		}
 			break;
 		case 4:{
 			element->GetInputValue(&Neff,gauss,EffectivePressureEnum);
-			element->GetInputValue(&thickness, gauss,ThicknessEnum);
-			IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
-			IssmDouble gravity   = element->FindParam(ConstantsGEnum);
-			p_ice   = gravity*rho_ice*thickness;
 		}
 			break;
@@ -816,32 +907,111 @@
 
 }/*}}}*/
+IssmDouble Friction::IcePressure(Gauss* gauss){/*{{{*/
+	/*Get ice pressure*/
+
+	IssmDouble  thickness,p_ice;
+	/*Recover Inputs and Parameters*/
+	element->GetInputValue(&thickness, gauss,ThicknessEnum);
+	IssmDouble rho_ice = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity = element->FindParam(ConstantsGEnum);
+
+	/*Compute*/
+	p_ice = gravity*rho_ice*thickness;
+
+	/*Return ice pressure*/
+	return p_ice;
+
+}/*}}}*/
+IssmDouble Friction::SubglacialWaterPressure(Gauss* gauss){/*{{{*/
+	/*Get water pressure as a function of  flag */
+
+	int         coupled_flag;
+	IssmDouble  base,sealevel,p_water;
+
+	/*Recover parameters: */
+	element->parameters->FindParam(&coupled_flag,FrictionCouplingEnum);
+
+	switch(coupled_flag){
+		case 0:{
+			element->GetInputValue(&base, gauss,BaseEnum);
+			element->GetInputValue(&sealevel, gauss,SealevelEnum);
+			IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+			IssmDouble gravity   = element->FindParam(ConstantsGEnum);
+			p_water = rho_water*gravity*(sealevel-base);
+		}
+			break;
+		case 1:{
+			p_water = 0.;
+		}
+			break;
+		case 2:{
+			element->GetInputValue(&base, gauss,BaseEnum);
+			element->GetInputValue(&sealevel, gauss,SealevelEnum);
+			IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+			IssmDouble gravity   = element->FindParam(ConstantsGEnum);
+			p_water = max(0.,rho_water*gravity*(sealevel-base));
+		}
+			break;
+		case 3:{
+			_error_("water pressure not computed for coupling==3 in friction law");
+		}
+			break;
+		case 4:{
+			_error_("water pressure not computed for coupling==4 in friction law");
+		}
+			break;
+		default:
+			_error_("not supported");
+	}
+
+	/*Return water pressure*/
+	return p_water;
+
+}/*}}}*/
 IssmDouble Friction::VelMag(Gauss* gauss){/*{{{*/
-	/*Get effective pressure as a function of  flag */
-
+	/*Get the velocity magnitude as a function of flag */
 
 	/*diverse*/
 	IssmDouble vx,vy,vz,vmag;
 
-	switch(dim){
-		case 1:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			vmag=sqrt(vx*vx);
-			break;
-		case 2:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			vmag=sqrt(vx*vx+vy*vy);
-			break;
-		case 3:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			element->GetInputValue(&vz,gauss,VzEnum);
-			vmag=sqrt(vx*vx+vy*vy+vz*vz);
-			break;
-		default:
-			_error_("not supported");
-	}
-
+	this->vx_input->GetInputValue(&vx, gauss);
+	this->vy_input->GetInputValue(&vy, gauss);
+
+	if ((this->vz_input == NULL) || (this->apply_dim<3.)) vz = 0.0;
+	else this->vz_input->GetInputValue(&vz, gauss);
+
+	if (this->apply_dim<2.) vy = 0.0;
+
+	vmag = sqrt(vx*vx+vy*vy+vz*vz);
 	return vmag;
-
-}/*}}}*/
+}/*}}}*/
+void Friction::GetBasalSlidingSpeeds(IssmDouble* pvx, Gauss* gauss){/*{{{*/
+
+	this->vx_input->GetInputValue(pvx, gauss);
+	/*Checks*/
+	_assert_(!xIsNan<IssmDouble>(*pvx));
+	_assert_(!xIsInf<IssmDouble>(*pvx));
+}/*}}}*/
+void Friction::GetBasalSlidingSpeeds(IssmDouble* pvx, IssmDouble* pvy, Gauss* gauss){/*{{{*/
+
+	this->vx_input->GetInputValue(pvx, gauss);
+	this->vy_input->GetInputValue(pvy, gauss);
+	/*Checks*/
+	_assert_(!xIsNan<IssmDouble>(*pvx));
+	_assert_(!xIsInf<IssmDouble>(*pvx));
+	_assert_(!xIsNan<IssmDouble>(*pvy));
+	_assert_(!xIsInf<IssmDouble>(*pvy));
+}/*}}}*/
+void Friction::GetBasalSlidingSpeeds(IssmDouble* pvx, IssmDouble* pvy, IssmDouble* pvz, Gauss* gauss){/*{{{*/
+
+	this->vx_input->GetInputValue(pvx, gauss);
+	this->vy_input->GetInputValue(pvy, gauss);
+	this->vz_input->GetInputValue(pvz, gauss);
+	/*Checks*/
+	_assert_(!xIsNan<IssmDouble>(*pvx));
+	_assert_(!xIsInf<IssmDouble>(*pvx));
+	_assert_(!xIsNan<IssmDouble>(*pvy));
+	_assert_(!xIsInf<IssmDouble>(*pvy));
+	_assert_(!xIsNan<IssmDouble>(*pvz));
+	_assert_(!xIsInf<IssmDouble>(*pvz));
+}/*}}}*/
Index: /issm/trunk/src/c/classes/Loads/Friction.h
===================================================================
--- /issm/trunk/src/c/classes/Loads/Friction.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Loads/Friction.h	(revision 26744)
@@ -14,11 +14,17 @@
 
 	public:
-		Element* element;
-		int      dim;
-		int      law;
+		Element    *element;
+		int         law;
+		int         domaintype;
+		IssmDouble  apply_dim;
+		Input      *vx_input;
+		Input      *vy_input;
+		Input      *vz_input;
 
 		/*methods: */
 		Friction();
-		Friction(Element* element_in,int dim_in);
+		Friction(Element* element_in);
+		Friction(Element* element_in, int dim);
+		Friction(Element* element_in, IssmDouble dim);
 		~Friction();
 
@@ -32,4 +38,5 @@
 		void  GetAlpha2(IssmDouble* palpha2,Gauss* gauss);
 		void  GetAlpha2Coulomb(IssmDouble* palpha2,Gauss* gauss);
+		void  GetAlpha2Coulomb2(IssmDouble* palpha2,Gauss* gauss);
 		void  GetAlpha2Hydro(IssmDouble* palpha2,Gauss* gauss);
 		void  GetAlpha2Josh(IssmDouble* palpha2,Gauss* gauss);
@@ -45,5 +52,10 @@
 
 		IssmDouble EffectivePressure(Gauss* gauss);
+		IssmDouble IcePressure(Gauss* gauss);
+		IssmDouble SubglacialWaterPressure(Gauss* gauss);
 		IssmDouble VelMag(Gauss* gauss);
+		void GetBasalSlidingSpeeds(IssmDouble* pvx, Gauss* gauss);
+		void GetBasalSlidingSpeeds(IssmDouble* pvx, IssmDouble* pvy, Gauss* gauss);
+		void GetBasalSlidingSpeeds(IssmDouble* pvx, IssmDouble* pvy, IssmDouble* pvz, Gauss* gauss);
 };
 
Index: /issm/trunk/src/c/classes/Loads/Moulin.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Moulin.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Loads/Moulin.cpp	(revision 26744)
@@ -291,5 +291,5 @@
 		switch(set2_enum){
 			case FsetEnum:
-				if(node->fsize){
+				if(node->FSize()){
 					if(this->node->IsClone())
 					 o_nz += 1;
@@ -307,5 +307,5 @@
 				break;
 			case SsetEnum:
-				if(node->ssize){
+				if(node->SSize()){
 					if(this->node->IsClone())
 					 o_nz += 1;
Index: /issm/trunk/src/c/classes/Loads/Neumannflux.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Neumannflux.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Loads/Neumannflux.cpp	(revision 26744)
@@ -306,5 +306,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->fsize){
+					if(nodes[i]->FSize()){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -322,5 +322,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->ssize){
+					if(nodes[i]->SSize()){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -354,5 +354,5 @@
 	Tria*  tria=(Tria*)element;
 	_assert_(tria->FiniteElement()==P1Enum); 
-	if(!tria->IsIceInElement() || tria->IsFloating()) return NULL;
+	if(!tria->IsIceInElement() || tria->IsAllFloating()) return NULL;
 
 	/*Initialize Element vector and other vectors*/
@@ -396,5 +396,5 @@
 	Tria*  tria=(Tria*)element;
 	_assert_(tria->FiniteElement()==P1Enum); 
-	if(!tria->IsIceInElement() || tria->IsFloating()) return NULL;
+	if(!tria->IsIceInElement() || tria->IsAllFloating()) return NULL;
 
 	/*Initialize Element vector and other vectors*/
Index: /issm/trunk/src/c/classes/Loads/Numericalflux.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Numericalflux.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Loads/Numericalflux.cpp	(revision 26744)
@@ -430,5 +430,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->fsize){
+					if(nodes[i]->FSize()){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -446,5 +446,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->ssize){
+					if(nodes[i]->SSize()){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
Index: /issm/trunk/src/c/classes/Loads/Pengrid.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Pengrid.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Loads/Pengrid.cpp	(revision 26744)
@@ -294,5 +294,5 @@
 		switch(set2_enum){
 			case FsetEnum:
-				if(node->fsize){
+				if(node->FSize()){
 					if(this->node->IsClone())
 					 o_nz += 1;
@@ -310,5 +310,5 @@
 				break;
 			case SsetEnum:
-				if(node->ssize){
+				if(node->SSize()){
 					if(this->node->IsClone())
 					 o_nz += 1;
Index: /issm/trunk/src/c/classes/Loads/Penpair.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Penpair.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Loads/Penpair.cpp	(revision 26744)
@@ -235,5 +235,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->fsize){
+					if(nodes[i]->FSize()){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -251,5 +251,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->ssize){
+					if(nodes[i]->SSize()){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -355,4 +355,14 @@
 				default: _error_("Approximation "<<EnumToStringx(approximation1)<<" not supported yet");
 			}
+		case MLHOApproximationEnum:
+			switch(approximation1){
+				case MLHOApproximationEnum:   return PenaltyCreateKMatrixStressbalanceSSAHO(kmax); 
+				default: _error_("Approximation "<<EnumToStringx(approximation1)<<" not supported yet");
+			}
+		case L1L2ApproximationEnum:
+			switch(approximation1){
+				case L1L2ApproximationEnum:   return PenaltyCreateKMatrixStressbalanceSSAHO(kmax); 
+				default: _error_("Approximation "<<EnumToStringx(approximation1)<<" not supported yet");
+			}
 		case FSvelocityEnum:
 			switch(approximation1){
Index: /issm/trunk/src/c/classes/Loads/Riftfront.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Riftfront.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Loads/Riftfront.cpp	(revision 26744)
@@ -392,5 +392,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->fsize){
+					if(nodes[i]->FSize()){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -408,5 +408,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->ssize){
+					if(nodes[i]->SSize()){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
Index: /issm/trunk/src/c/classes/Masscon.h
===================================================================
--- /issm/trunk/src/c/classes/Masscon.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Masscon.h	(revision 26744)
@@ -24,5 +24,5 @@
 		IssmDouble* levelset;
 		int         M;
-		
+
 		/*Masscon constructors, destructors :*/
 		Masscon(){/*{{{*/
@@ -101,5 +101,4 @@
 			 IssmDouble all_mass_t=0.;
 
-
 			 for(i=0;i<femmodel->elements->Size();i++){
 				 Element* element=(Element*)femmodel->elements->GetObjectByOffset(i);
@@ -109,5 +108,5 @@
 			 ISSM_MPI_Allreduce ( (void*)&mass_t,(void*)&all_mass_t,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
 			 mass_t=all_mass_t;
-			 
+
 			 return mass_t;
 		 }
Index: /issm/trunk/src/c/classes/Massconaxpby.h
===================================================================
--- /issm/trunk/src/c/classes/Massconaxpby.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Massconaxpby.h	(revision 26744)
@@ -26,5 +26,5 @@
 		IssmDouble  alpha;
 		IssmDouble  beta;
-		
+
 		/*Massconaxpby constructors, destructors :*/
 		Massconaxpby(){/*{{{*/
@@ -47,5 +47,5 @@
 			this->namex   = xNew<char>(strlen(in_namex)+1);
 			xMemCpy<char>(this->namex,in_namex,strlen(in_namex)+1);
-			
+
 			this->namey   = xNew<char>(strlen(in_namey)+1);
 			xMemCpy<char>(this->namey,in_namey,strlen(in_namey)+1);
Index: /issm/trunk/src/c/classes/Massfluxatgate.h
===================================================================
--- /issm/trunk/src/c/classes/Massfluxatgate.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Massfluxatgate.h	(revision 26744)
@@ -32,11 +32,15 @@
 		Massfluxatgate(){/*{{{*/
 			this->definitionenum        = -1;
-			this->name        = 0;
+			this->name        = NULL;
 			this->numsegments = 0;
-			this->segments    = 0;
+			this->elements    = NULL;
+			this->x1				= NULL;
+			this->x2				= NULL;
+			this->y1				= NULL;
+			this->y2				= NULL;
 		}
 		/*}}}*/
 		Massfluxatgate(char* in_name, int in_definitionenum, int in_numsegments, doubletype* in_segments) {/*{{{*/
-			
+
 			int i;
 
@@ -79,5 +83,5 @@
 				this->y2=xNew<doubletype>(this->numsegments); xMemCpy<doubletype>(this->y2,in_y2,this->numsegments);
 				this->elements=xNew<int>(this->numsegments); xMemCpy<int>(this->elements,in_elements,this->numsegments);
-				
+
 			}
 		}
Index: /issm/trunk/src/c/classes/Materials/Material.h
===================================================================
--- /issm/trunk/src/c/classes/Materials/Material.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Materials/Material.h	(revision 26744)
@@ -51,4 +51,6 @@
 		virtual void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input)=0;
 		virtual void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input)=0;
+		virtual void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input)=0;
+		virtual void       ViscosityMLHOAdjoint(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input)=0;
 		virtual void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf)=0;
 		virtual void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input)=0;
Index: /issm/trunk/src/c/classes/Materials/Matestar.cpp
===================================================================
--- /issm/trunk/src/c/classes/Materials/Matestar.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Materials/Matestar.cpp	(revision 26744)
@@ -567,4 +567,10 @@
 	*pviscosity=GetViscosityGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],eps_eff,isdepthaveraged,gauss);
 }/*}}}*/
+void  Matestar::ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input){/*{{{*/
+	_error_("not implemented yet");
+}/*}}}*/
+void  Matestar::ViscosityMLHOAdjoint(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input){/*{{{*/
+	_error_("not implemented yet");
+}/*}}}*/
 void  Matestar::ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surface_input){/*{{{*/
 	_error_("not implemented yet");
Index: /issm/trunk/src/c/classes/Materials/Matestar.h
===================================================================
--- /issm/trunk/src/c/classes/Materials/Matestar.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Materials/Matestar.h	(revision 26744)
@@ -28,5 +28,4 @@
 		Hook    *helement;
 		Element *element;
-		int      rheology_law;
 
 	public:
@@ -77,4 +76,6 @@
 		void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
 		void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input);
+		void       ViscosityMLHOAdjoint(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input);
 		void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf);
 		void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
Index: /issm/trunk/src/c/classes/Materials/Matice.cpp
===================================================================
--- /issm/trunk/src/c/classes/Materials/Matice.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Materials/Matice.cpp	(revision 26744)
@@ -292,10 +292,10 @@
 }
 /*}}}*/
-bool Matice::IsDamage(){/*{{{*/
+bool       Matice::IsDamage(){/*{{{*/
 
 	return this->isdamaged;
 }
 /*}}}*/
-bool Matice::IsEnhanced(){/*{{{*/
+bool       Matice::IsEnhanced(){/*{{{*/
 
 	return this->isenhanced;
@@ -736,4 +736,133 @@
 	*pviscosity=viscosity;
 }/*}}}*/
+void  Matice::ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vxbase_input,Input* vybase_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input){/*{{{*/
+
+	/*Intermediaries*/
+	IssmDouble epsilon[5];	/* epsilon=[exx,eyy,exy,exz,eyz]; */
+	IssmDouble epsilon_eff;
+	IssmDouble zeta,H,n;
+	IssmDouble f[4],F[4];
+	IssmDouble mubar[4];
+	IssmDouble mu;
+	int order=5; 
+
+	for(int i=0;i<4;++i) mubar[i]=0;
+
+	GaussSeg* gauss_seg=new GaussSeg(order);
+	//IssmDouble eps_eff_averaged=0;
+	while(gauss_seg->next()){
+
+		/*Compute zeta for gauss_seg point (0=surface, 1=base)*/
+		zeta=0.5*(gauss_seg->coord1+1);	
+
+		/* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exz^2 + eyz^2 + exx*eyy (for a given zeta)*/
+		element->StrainRateMLHO(&epsilon[0],xyz_list,gauss,
+						vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input,zeta);
+		epsilon_eff=sqrt(epsilon[0]*epsilon[0] + epsilon[1]*epsilon[1] + epsilon[2]*epsilon[2] 
+						  +  epsilon[3]*epsilon[3] + epsilon[4]*epsilon[4] + epsilon[0]*epsilon[1]);
+
+		/*Get viscosity at zeta */
+//?? need to use Bar for the current inversion
+//    this->GetViscosity(&mu,epsilon_eff,gauss);
+		this->GetViscosityBar(&mu, epsilon_eff,gauss);
+		thickness_input->GetInputValue(&H, gauss);
+      n_input->GetInputValue(&n,gauss);
+
+		/*Compute fi and Fi at zeta*/
+		f[0]=1;
+		f[1]=(1-pow(zeta,n+1));
+		f[2]=(1-pow(zeta,n+1))*(1-pow(zeta,n+1));
+		f[3]=((n+1)/H)*pow(zeta,n) * ((n+1)/H)*pow(zeta,n);
+
+		F[0]=H;
+		F[1]=H*(n+1)/(n+2);
+		F[2]=2*H*(n+1)*(n+1)/( (2*n+3)*(n+2) );
+		F[3]=(n+1)*(n+1)/( H*(2*n+1) );
+
+		/*Sum the viscosity*/
+		mubar[0]+=(H/(2*F[0]))*gauss_seg->weight*mu*f[0];
+		mubar[1]+=(H/(2*F[1]))*gauss_seg->weight*mu*f[1];
+		mubar[2]+=(H/(2*F[2]))*gauss_seg->weight*mu*f[2];
+		mubar[3]+=(H/(2*F[3]))*gauss_seg->weight*mu*f[3];
+
+	}//while
+
+	/*Assign output pointer*/
+	pviscosity[0]=mubar[0];
+	pviscosity[1]=mubar[1];
+	pviscosity[2]=mubar[2];
+	pviscosity[3]=mubar[3];
+
+	/*Clean up*/
+	delete gauss_seg;
+}/*}}}*/
+void  Matice::ViscosityMLHOAdjoint(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vxbase_input,Input* vybase_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input){/*{{{*/
+
+	/* To compute the additional 5 terms in the viscosity appear in the adjoint equation*/
+	/*Intermediaries*/
+	IssmDouble epsilon[5];	/* epsilon=[exx,eyy,exy,exz,eyz]; */
+	IssmDouble epsilon_eff;
+	IssmDouble zeta,H,n;
+	IssmDouble f[9],F[9];
+	IssmDouble mubar[9];
+	IssmDouble mu;
+	int order=10; 
+
+	for(int i=0;i<9;++i) mubar[i]=0;
+
+	GaussSeg* gauss_seg=new GaussSeg(order);
+	//IssmDouble eps_eff_averaged=0;
+	while(gauss_seg->next()){
+		
+		/*Compute zeta for gauss_seg point (0=surface, 1=base)*/
+		zeta=0.5*(gauss_seg->coord1+1);	
+
+		/* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exz^2 + eyz^2 + exx*eyy (for a given zeta)*/
+		element->StrainRateMLHO(&epsilon[0],xyz_list,gauss,
+						vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input,zeta);
+		epsilon_eff=sqrt(epsilon[0]*epsilon[0] + epsilon[1]*epsilon[1] + epsilon[2]*epsilon[2] 
+						  +  epsilon[3]*epsilon[3] + epsilon[4]*epsilon[4] + epsilon[0]*epsilon[1]);
+
+		this->GetViscosity(&mu,epsilon_eff,gauss);
+		/*the adjoint viscosity with zeta dependent term*/
+		mu = mu /epsilon_eff/epsilon_eff;
+
+		thickness_input->GetInputValue(&H, gauss);
+      n_input->GetInputValue(&n,gauss);
+
+		/*Compute fi and Fi at zeta*/
+		f[0]=1;
+		f[1]=(1-pow(zeta,n+1));
+		f[2]=(1-pow(zeta,n+1))*(1-pow(zeta,n+1));
+		f[3]=pow(zeta,2*n); // NOTE: this is different from the forward formulation
+		f[4]=(1-pow(zeta,n+1))*(1-pow(zeta,n+1))*(1-pow(zeta,n+1));
+		f[5]=(1-pow(zeta,n+1))*(1-pow(zeta,n+1))*(1-pow(zeta,n+1))*(1-pow(zeta,n+1));
+		f[6]=(1-pow(zeta,n+1))*pow(zeta,2*n);
+		f[7]=(1-pow(zeta,n+1))*(1-pow(zeta,n+1))*pow(zeta,2*n);
+		f[8]=pow(zeta,4*n);
+
+	
+		F[0]=H;
+		F[1]=H*(n+1)/(n+2);
+		F[2]=2*H*(n+1)*(n+1)/( (2*n+3)*(n+2) );
+		F[3]=H/(2*n+1);
+		F[4]=6*H*(n+1)*(n+1)*(n+1)/( (n+2)*(2*n+3)*(3*n+4) );
+		F[5]=24*H*(n+1)*(n+1)*(n+1)*(n+1)/( (n+2)*(2*n+3)*(3*n+4)*(4*n+5) );
+		F[6]=H*(n+1)/( (2*n+1)*(3*n+2) );
+		F[7]=2*H*(n+1)*(n+1)/( (2*n+1)*(3*n+2)*(4*n+3) );
+		F[8]=H/(4*n+1);
+
+		/*Sum the viscosity*/
+		for(int i=0;i<9;i++) {
+			mubar[i]+=(H/2)*gauss_seg->weight*mu*f[i];
+		}
+	}//while
+
+	/*Assign output pointer*/
+	for(int i=0;i<9;i++) pviscosity[i]=mubar[i];
+
+	/*Clean up*/
+	delete gauss_seg;
+}/*}}}*/
 void  Matice::ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surface_input){/*{{{*/
 	/*Compute the L1L2 viscosity
Index: /issm/trunk/src/c/classes/Materials/Matice.h
===================================================================
--- /issm/trunk/src/c/classes/Materials/Matice.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Materials/Matice.h	(revision 26744)
@@ -28,5 +28,4 @@
 		bool     isdamaged;
 		bool     isenhanced;
-		int      rheology_law;
 		Hook    *helement;
 		Element *element;
@@ -79,4 +78,6 @@
 		void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
 		void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input);
+		void       ViscosityMLHOAdjoint(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input);
 		void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf);
 		void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
Index: /issm/trunk/src/c/classes/Materials/Matlitho.cpp
===================================================================
--- /issm/trunk/src/c/classes/Materials/Matlitho.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Materials/Matlitho.cpp	(revision 26744)
@@ -21,6 +21,10 @@
 	this->burgers_viscosity=NULL;
 	this->burgers_mu=NULL;
+	this->ebm_alpha=NULL;
+	this->ebm_delta=NULL;	
+	this->ebm_taul=NULL;
+	this->ebm_tauh=NULL;
 	this->density=NULL;
-	this->isburgers=NULL;
+	this->rheologymodel=NULL;
 	this->issolid=NULL;
 	return;
@@ -29,5 +33,5 @@
 Matlitho::Matlitho(int matlitho_mid, IoModel* iomodel){/*{{{*/
 
-	IssmDouble* isburgersd=NULL;
+	IssmDouble* rheologymodeld=NULL;
 	IssmDouble* issolidd=NULL;
 
@@ -53,17 +57,29 @@
 	xMemCpy<IssmDouble>(this->burgers_mu, iomodel->Data("md.materials.burgers_mu"),this->numlayers);
 
+	this->ebm_alpha=xNew<IssmDouble>(this->numlayers);
+	xMemCpy<IssmDouble>(this->ebm_alpha, iomodel->Data("md.materials.ebm_alpha"),this->numlayers);
+
+	this->ebm_delta=xNew<IssmDouble>(this->numlayers);
+	xMemCpy<IssmDouble>(this->ebm_delta, iomodel->Data("md.materials.ebm_delta"),this->numlayers);
+
+	this->ebm_taul=xNew<IssmDouble>(this->numlayers);
+	xMemCpy<IssmDouble>(this->ebm_taul, iomodel->Data("md.materials.ebm_taul"),this->numlayers);
+
+	this->ebm_tauh=xNew<IssmDouble>(this->numlayers);
+	xMemCpy<IssmDouble>(this->ebm_tauh, iomodel->Data("md.materials.ebm_tauh"),this->numlayers);
+
 	this->density=xNew<IssmDouble>(this->numlayers);
 	xMemCpy<IssmDouble>(this->density, iomodel->Data("md.materials.density"),this->numlayers);
 
-	this->isburgers=xNew<IssmDouble>(this->numlayers);
-	xMemCpy<IssmDouble>(this->isburgers, iomodel->Data("md.materials.isburgers"),this->numlayers);
+	this->rheologymodel=xNew<IssmDouble>(this->numlayers);
+	xMemCpy<IssmDouble>(this->rheologymodel, iomodel->Data("md.materials.rheologymodel"),this->numlayers);
 
 	this->issolid=xNew<IssmDouble>(this->numlayers);
 	xMemCpy<IssmDouble>(this->issolid, iomodel->Data("md.materials.issolid"),this->numlayers);
 
-	/*isburgersd= xNew<IssmDouble>(this->numlayers);
-	this->isburgers=xNew<bool>(this->numlayers);
-	xMemCpy<IssmDouble>(isburgersd, iomodel->Data("md.materials.isburgers"),this->numlayers);
-	for (int i=0;i<this->numlayers;i++)this->isburgers[i]=reCast<bool,IssmDouble>(isburgersd[i]);
+	/*rheologymodeld= xNew<IssmDouble>(this->numlayers);
+	this->rheologymodel=xNew<bool>(this->numlayers);
+	xMemCpy<IssmDouble>(rheologymodeld, iomodel->Data("md.materials.rheologymodel"),this->numlayers);
+	for (int i=0;i<this->numlayers;i++)this->rheologymodel[i]=reCast<bool,IssmDouble>(rheologymodeld[i]);
 
 	issolidd= xNew<IssmDouble>(this->numlayers);
@@ -73,5 +89,5 @@
 
 	/*free ressources: */
-	xDelete<IssmDouble>(isburgersd);
+	xDelete<IssmDouble>(rheologymodeld);
 	xDelete<IssmDouble>(issolidd);
 }
@@ -85,6 +101,10 @@
 	xDelete<IssmDouble>(burgers_viscosity);
 	xDelete<IssmDouble>(burgers_mu);
+	xDelete<IssmDouble>(ebm_alpha);
+	xDelete<IssmDouble>(ebm_delta);
+	xDelete<IssmDouble>(ebm_taul);
+	xDelete<IssmDouble>(ebm_tauh);
 	xDelete<IssmDouble>(density);
-	xDelete<IssmDouble>(isburgers);
+	xDelete<IssmDouble>(rheologymodel);
 	xDelete<IssmDouble>(issolid);
 
@@ -116,8 +136,12 @@
 		matlitho->burgers_viscosity=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->burgers_viscosity, this->burgers_viscosity,this->numlayers);
 		matlitho->burgers_mu=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->burgers_mu, this->burgers_mu,this->numlayers);
+		matlitho->ebm_alpha=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->ebm_alpha, this->ebm_alpha,this->numlayers);
+		matlitho->ebm_delta=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->ebm_delta, this->ebm_delta,this->numlayers);
+		matlitho->ebm_taul=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->ebm_taul, this->ebm_taul,this->numlayers);
+		matlitho->ebm_tauh=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->ebm_tauh, this->ebm_tauh,this->numlayers);
 		matlitho->density=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->density, this->density,this->numlayers);
-		matlitho->isburgers=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->isburgers, this->isburgers,this->numlayers);
+		matlitho->rheologymodel=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->rheologymodel, this->rheologymodel,this->numlayers);
 		matlitho->issolid=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->issolid, this->issolid,this->numlayers);
-		/*matlitho->isburgers=xNew<bool>(this->numlayers); for(int i=0;i<this->numlayers;i++)matlitho->isburgers[i]=this->isburgers[i]; 
+		/*matlitho->rheologymodel=xNew<bool>(this->numlayers); for(int i=0;i<this->numlayers;i++)matlitho->rheologymodel[i]=this->rheologymodel[i]; 
 		matlitho->issolid=xNew<bool>(this->numlayers); for(int i=0;i<this->numlayers;i++)matlitho->issolid[i]=this->issolid[i];*/ 
 	}
@@ -136,7 +160,7 @@
 	_printf_("   mid: " << mid << "\n");
 	_printf_("   numlayers: " << numlayers << "\n");
-	_printf_("layer radius viscosity lame_lambda lame_mu burgers_viscosity burgers_mu density isburgers issolid\n");
+	_printf_("layer radius viscosity lame_lambda lame_mu burgers_viscosity burgers_mu ebm_alpha ebm_delta ebm_taul ebm_tauh density rheologymodel issolid\n");
 	for (int i=0;i<numlayers;i++){
-		_printf_(i << " " << radius[i] << " " << viscosity[i] << " " << lame_lambda[i] << " " << lame_mu[i] << " " << burgers_viscosity[i] << " " << burgers_mu[i] << " " << density[i] << " " << isburgers[i] << " " << issolid[i]);
+		_printf_(i << " " << radius[i] << " " << viscosity[i] << " " << lame_lambda[i] << " " << lame_mu[i] << " " << burgers_viscosity[i] << " " << burgers_mu[i] << " " << ebm_alpha[i] << " " << ebm_delta[i] << " " << ebm_taul[i] << " " << ebm_tauh[i] << " " << density[i] << " " << rheologymodel[i] << " " << issolid[i]);
 	}
 	return;
@@ -158,6 +182,10 @@
 		marshallhandle->call(this->burgers_viscosity,numlayers);
 		marshallhandle->call(this->burgers_mu,numlayers);
+		marshallhandle->call(this->ebm_alpha,numlayers);
+		marshallhandle->call(this->ebm_delta,numlayers);
+		marshallhandle->call(this->ebm_taul,numlayers);
+		marshallhandle->call(this->ebm_tauh,numlayers);
 		marshallhandle->call(this->density,numlayers);
-		marshallhandle->call(this->isburgers,numlayers);
+		marshallhandle->call(this->rheologymodel,numlayers);
 		marshallhandle->call(this->issolid,numlayers);
 	}
@@ -169,6 +197,10 @@
 		burgers_viscosity = NULL;
 		burgers_mu        = NULL;
+		ebm_alpha         = NULL;
+		ebm_delta         = NULL;
+		ebm_taul          = NULL;
+		ebm_tauh          = NULL;
 		density           = NULL;
-		isburgers         = NULL;
+		rheologymodel     = NULL;
 		issolid           = NULL;
 	}
Index: /issm/trunk/src/c/classes/Materials/Matlitho.h
===================================================================
--- /issm/trunk/src/c/classes/Materials/Matlitho.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Materials/Matlitho.h	(revision 26744)
@@ -23,6 +23,10 @@
 		IssmDouble*  burgers_viscosity;
 		IssmDouble*  burgers_mu;
+		IssmDouble*  ebm_alpha;
+		IssmDouble*  ebm_delta;
+		IssmDouble*  ebm_taul;
+		IssmDouble*  ebm_tauh;
 		IssmDouble*  density;
-		IssmDouble*  isburgers;
+		IssmDouble*  rheologymodel;
 		IssmDouble*  issolid;
 
@@ -68,4 +72,6 @@
 		void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not supported");};
 		void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not supported");};
+		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input){_error_("not supported");};
+		void       ViscosityMLHOAdjoint(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input){_error_("not supported");};
 		void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf){_error_("not supported");};
 		void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not supported");};
Index: /issm/trunk/src/c/classes/Misfit.h
===================================================================
--- /issm/trunk/src/c/classes/Misfit.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Misfit.h	(revision 26744)
@@ -24,13 +24,13 @@
 		char*       timeinterpolation;
 		int         weights_enum;
-		
+
 		int         lock; // if lock is on, we just return the value stored in "misfit".  this is used so we don't compute misfit past the final_time
 		IssmDouble  misfit; //value carried over in time.
-		
+
 		/*Misfit constructors, destructors :*/
 		Misfit();
 		Misfit(char* in_name, int in_definitionenum, int in_model_enum, int in_observation_enum, char* in_timeinterpolation, int in_local, int in_weights_enum);
 		~Misfit();
-		
+
 		/*Object virtual function resolutoin: */
 		Object* copy();
@@ -40,5 +40,5 @@
 		void Marshall(MarshallHandle* marshallhandle);
 		int ObjectEnum(void);
-		
+
 		/*Definition virtual function resolutoin: */
 		int DefinitionEnum();
Index: /issm/trunk/src/c/classes/Node.cpp
===================================================================
--- /issm/trunk/src/c/classes/Node.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Node.cpp	(revision 26744)
@@ -20,6 +20,4 @@
 	this->approximation  = 0;
 	this->gsize          = -1;
-	this->fsize          = -1;
-	this->ssize          = -1;
 	this->clone          = false;
 	this->active         = true;
@@ -68,11 +66,9 @@
 		this->svalues        = xNew<IssmDouble>(this->gsize);
 		this->gdoflist       = xNew<int>(this->gsize);
-		this->gdoflist_local = xNewZeroInit<int>(this->gsize);
-		this->fsize          = -1;
-		this->ssize          = -1;
-		this->fdoflist       = NULL;
-		this->sdoflist       = NULL;
-		this->fdoflist_local = NULL;
-		this->sdoflist_local = NULL;
+		this->gdoflist_local = xNew<int>(this->gsize);
+		this->fdoflist       = xNew<int>(this->gsize);
+		this->sdoflist       = xNew<int>(this->gsize);
+		this->fdoflist_local = xNew<int>(this->gsize);
+		this->sdoflist_local = xNew<int>(this->gsize);
 	}
 	else{
@@ -82,6 +78,4 @@
 		this->gdoflist       = NULL;
 		this->gdoflist_local = NULL;
-		this->fsize          = -1;
-		this->ssize          = -1;
 		this->fdoflist       = NULL;
 		this->sdoflist       = NULL;
@@ -96,4 +90,9 @@
 		this->svalues[i]  = 0.;
 		this->gdoflist[i] = -1;
+		this->fdoflist[i] = -1;
+		this->sdoflist[i] = -1;
+		this->gdoflist_local[i] = -1;
+		this->fdoflist_local[i] = -1;
+		this->sdoflist_local[i] = -1;
 	}
 
@@ -210,6 +209,4 @@
 	output->indexingupdate = this->indexingupdate;
 	output->gsize  = this->gsize;
-	output->fsize  = this->fsize;
-	output->ssize  = this->ssize;
 	output->clone  = this->clone;
 	output->active = this->active;
@@ -222,12 +219,8 @@
 		output->gdoflist=xNew<int>(output->gsize);
 		output->gdoflist_local=xNew<int>(output->gsize);
-	}
-	if(output->fsize>0){
-		output->fdoflist=xNew<int>(output->fsize);
-		output->fdoflist_local=xNew<int>(output->fsize);
-	}
-	if(output->ssize>0){
-		output->sdoflist=xNew<int>(output->ssize);
-		output->sdoflist_local=xNew<int>(output->ssize);
+		output->fdoflist=xNew<int>(output->gsize);
+		output->fdoflist_local=xNew<int>(output->gsize);
+		output->sdoflist=xNew<int>(output->gsize);
+		output->sdoflist_local=xNew<int>(output->gsize);
 	}
 
@@ -239,12 +232,8 @@
 		memcpy(output->gdoflist,this->gdoflist,output->gsize*sizeof(int));
 		memcpy(output->gdoflist_local,this->gdoflist_local,output->gsize*sizeof(int));
-	}
-	if(output->fsize>0){
-		memcpy(output->fdoflist,this->fdoflist,output->fsize*sizeof(int));
-		memcpy(output->fdoflist_local,this->fdoflist_local,output->fsize*sizeof(int));
-	}
-	if(output->ssize>0){
-		memcpy(output->sdoflist,this->sdoflist,output->ssize*sizeof(int));
-		memcpy(output->sdoflist_local,this->sdoflist_local,output->ssize*sizeof(int));
+		memcpy(output->fdoflist,this->fdoflist,output->gsize*sizeof(int));
+		memcpy(output->fdoflist_local,this->fdoflist_local,output->gsize*sizeof(int));
+		memcpy(output->sdoflist,this->sdoflist,output->gsize*sizeof(int));
+		memcpy(output->sdoflist_local,this->sdoflist_local,output->gsize*sizeof(int));
 	}
 
@@ -267,6 +256,4 @@
 
 	marshallhandle->call(this->gsize);
-	marshallhandle->call(this->fsize);
-	marshallhandle->call(this->ssize);
 	marshallhandle->call(this->clone);
 	marshallhandle->call(this->active);
@@ -277,9 +264,9 @@
 	marshallhandle->call(this->doftype,gsize);
 	marshallhandle->call(this->gdoflist,gsize);
-	marshallhandle->call(this->fdoflist,fsize);
-	marshallhandle->call(this->sdoflist,ssize);
+	marshallhandle->call(this->fdoflist,gsize);
+	marshallhandle->call(this->sdoflist,gsize);
 	marshallhandle->call(this->gdoflist_local,gsize);
-	marshallhandle->call(this->fdoflist_local,fsize);
-	marshallhandle->call(this->sdoflist_local,ssize);
+	marshallhandle->call(this->fdoflist_local,gsize);
+	marshallhandle->call(this->sdoflist_local,gsize);
 } /*}}}*/
 
@@ -295,6 +282,4 @@
 	_printf_("   indexingupdate: " << indexingupdate << "\n");
 	_printf_("   gsize:  " << gsize << "\n");
-	_printf_("   fsize:  " << fsize << "\n");
-	_printf_("   ssize:  " << ssize << "\n");
 	_printf_("   clone:  " << clone << "\n");
 	_printf_("   active: " << active << "\n");
@@ -306,5 +291,5 @@
 	for(i=0;i<gsize;i++) _printf_((s_set[i]?1:0)<< " ");
 	_printf_("]\n");
-	_printf_("   svalues (" << this->ssize << "): |");
+	_printf_("   svalues: |");
 	for(i=0;i<this->gsize;i++){
 		if(this->s_set[i])_printf_(" " << svalues[i] << " |");
@@ -327,16 +312,16 @@
 	_printf_("\n");
 
-	_printf_("   f_doflist (" << this->fsize << "): |");
-	for(i=0;i<this->fsize;i++) _printf_(" " << fdoflist[i] << " |");
+	_printf_("   f_doflist (" << this->gsize << "): |");
+	for(i=0;i<this->gsize;i++) _printf_(" " << fdoflist[i] << " |");
 	_printf_("\n");
-	_printf_("   f_doflist_local (" << this->fsize << "): |");
-	for(i=0;i<this->fsize;i++) _printf_(" " << fdoflist_local[i] << " |");
+	_printf_("   f_doflist_local (" << this->gsize << "): |");
+	for(i=0;i<this->gsize;i++) _printf_(" " << fdoflist_local[i] << " |");
 	_printf_("\n");
 
-	_printf_("   s_doflist (" << this->ssize << "): |");
-	for(i=0;i<this->ssize;i++) _printf_(" " << sdoflist[i] << " |");
+	_printf_("   s_doflist (" << this->gsize << "): |");
+	for(i=0;i<this->gsize;i++) _printf_(" " << sdoflist[i] << " |");
 	_printf_("\n");
-	_printf_("   s_doflist_local (" << this->ssize << "): |");
-	for(i=0;i<this->ssize;i++) _printf_(" " << sdoflist_local[i] << " |");
+	_printf_("   s_doflist_local (" << this->gsize << "): |");
+	for(i=0;i<this->gsize;i++) _printf_(" " << sdoflist_local[i] << " |");
 	_printf_("\n");
 
@@ -354,6 +339,4 @@
 	_printf_("   indexingupdate: " << indexingupdate << "\n");
 	_printf_("   gsize:  " << gsize << "\n");
-	_printf_("   fsize:  " << fsize << "\n");
-	_printf_("   ssize:  " << ssize << "\n");
 	_printf_("   clone:  " << clone << "\n");
 	_printf_("   active: " << active << "\n");
@@ -386,9 +369,9 @@
 	}
 	else if(setenum==FsetEnum){
-		_assert_(dofindex>=0 && dofindex<fsize);
+		_assert_(dofindex>=0 && dofindex<gsize);
 		return fdoflist[dofindex];
 	}
 	else if(setenum==SsetEnum){
-		_assert_(dofindex>=0 && dofindex<ssize);
+		_assert_(dofindex>=0 && dofindex<gsize);
 		return sdoflist[dofindex];
 	}
@@ -397,226 +380,48 @@
 } /*}}}*/
 void Node::GetDofList(int* outdoflist,int approximation_enum,int setenum){/*{{{*/
+	_assert_(!this->indexingupdate);
 	int i;
-	int count=0;
-	int count2=0;
+
+	int* doflistpointer = NULL;
+	if(setenum==GsetEnum) doflistpointer = gdoflist;
+	else if(setenum==FsetEnum)for(i=0;i<this->gsize;i++) doflistpointer = fdoflist;
+	else if(setenum==SsetEnum)for(i=0;i<this->gsize;i++) doflistpointer = sdoflist;
+	else _error_("not supported");
+
+	if(approximation_enum==NoneApproximationEnum){
+		for(i=0;i<this->gsize;i++) outdoflist[i]=doflistpointer[i];
+	}
+	else{
+		if(doftype){
+			int count = 0;
+			for(i=0;i<this->gsize;i++){
+				if(doftype[i]==approximation_enum) outdoflist[count++]=doflistpointer[i];
+			}
+		}
+		else for(i=0;i<this->gsize;i++) outdoflist[i]=doflistpointer[i];
+	}
+}/*}}}*/
+void Node::GetDofListLocal(int* outdoflist,int approximation_enum,int setenum){/*{{{*/
 
 	_assert_(!this->indexingupdate);
+	int i;
+
+	int* doflistpointer = NULL;
+	if(setenum==GsetEnum) doflistpointer = gdoflist_local;
+	else if(setenum==FsetEnum)for(i=0;i<this->gsize;i++) doflistpointer = fdoflist_local;
+	else if(setenum==SsetEnum)for(i=0;i<this->gsize;i++) doflistpointer = sdoflist_local;
+	else _error_("not supported");
 
 	if(approximation_enum==NoneApproximationEnum){
-		if(setenum==GsetEnum)for(i=0;i<this->gsize;i++) outdoflist[i]=gdoflist[i];
-		if(setenum==FsetEnum)for(i=0;i<this->fsize;i++) outdoflist[i]=fdoflist[i];
-		if(setenum==SsetEnum)for(i=0;i<this->ssize;i++) outdoflist[i]=sdoflist[i];
+		for(i=0;i<this->gsize;i++) outdoflist[i]=doflistpointer[i];
 	}
 	else{
-
-		if(setenum==GsetEnum){
-			if(doftype){
-				count=0;
-				for(i=0;i<this->gsize;i++){
-					if(doftype[i]==approximation_enum){
-						outdoflist[count]=gdoflist[i];
-						count++;
-					}
-				}
-				_assert_(count); //at least one dof should be the approximation requested
-			}
-			else for(i=0;i<this->gsize;i++) outdoflist[i]=gdoflist[i];
-		}
-		else if(setenum==FsetEnum){
-			if(doftype){
-				count=0;
-				count2=0;
-				for(i=0;i<this->gsize;i++){
-					if(f_set[i]){
-						if(doftype[i]==approximation_enum){
-							outdoflist[count]=fdoflist[count2];
-							count++;
-						}
-						count2++;
-					}
-				}
-			}
-			else for(i=0;i<this->fsize;i++) outdoflist[i]=fdoflist[i];
-		}
-		else if(setenum==SsetEnum){
-			if(doftype){
-				count=0;
-				count2=0;
-				for(i=0;i<this->gsize;i++){
-					if(s_set[i]){
-						if(doftype[i]==approximation_enum){
-							outdoflist[count]=sdoflist[count2];
-							count++;
-						}
-						count2++;
-					}
-				}
-			}
-			else for(i=0;i<this->ssize;i++) outdoflist[i]=sdoflist[i];
-		}
-		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
-	}
-}
-/*}}}*/
-void Node::GetDofListLocal(int* outdoflist,int approximation_enum,int setenum){/*{{{*/
-	int i;
-	int count=0;
-	int count2=0;
-
-	_assert_(!this->indexingupdate);
-
-	if(approximation_enum==NoneApproximationEnum){
-		if(setenum==GsetEnum)for(i=0;i<this->gsize;i++) outdoflist[i]=gdoflist_local[i];
-		if(setenum==FsetEnum)for(i=0;i<this->fsize;i++) outdoflist[i]=fdoflist_local[i];
-		if(setenum==SsetEnum)for(i=0;i<this->ssize;i++) outdoflist[i]=sdoflist_local[i];
-	}
-	else{
-
-		if(setenum==GsetEnum){
-			if(doftype){
-				count=0;
-				for(i=0;i<this->gsize;i++){
-					if(doftype[i]==approximation_enum){
-						outdoflist[count]=gdoflist_local[i];
-						count++;
-					}
-				}
-				_assert_(count); //at least one dof should be the approximation requested
-			}
-			else for(i=0;i<this->gsize;i++) outdoflist[i]=gdoflist_local[i];
-		}
-		else if(setenum==FsetEnum){
-			if(doftype){
-				count=0;
-				count2=0;
-				for(i=0;i<this->gsize;i++){
-					if(f_set[i]){
-						if(doftype[i]==approximation_enum){
-							outdoflist[count]=fdoflist_local[count2];
-							count++;
-						}
-						count2++;
-					}
-				}
-			}
-			else for(i=0;i<this->fsize;i++) outdoflist[i]=fdoflist_local[i];
-		}
-		else if(setenum==SsetEnum){
-			if(doftype){
-				count=0;
-				count2=0;
-				for(i=0;i<this->gsize;i++){
-					if(s_set[i]){
-						if(doftype[i]==approximation_enum){
-							outdoflist[count]=sdoflist_local[count2];
-							count++;
-						}
-						count2++;
-					}
-				}
-			}
-			else for(i=0;i<this->ssize;i++) outdoflist[i]=sdoflist_local[i];
-		}
-		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
-	}
-}
-/*}}}*/
-void Node::GetLocalDofList(int* outdoflist,int approximation_enum,int setenum){/*{{{*/
-	int i;
-	int count=0;
-	int count2=0;
-
-	_assert_(!this->indexingupdate);
-
-	if(approximation_enum==NoneApproximationEnum){
-		if(setenum==GsetEnum)for(i=0;i<this->gsize;i++) outdoflist[i]=i;
-		else if(setenum==FsetEnum){
-			count=0;
+		if(doftype){
+			int count =0;
 			for(i=0;i<this->gsize;i++){
-				if(f_set[i]){
-					outdoflist[count]=i;
-					count++;
-				}
-			}
-		}
-		else if(setenum==SsetEnum){
-			count=0;
-			for(i=0;i<this->gsize;i++){
-				if(s_set[i]){
-					outdoflist[count]=i;
-					count++;
-				}
-			}
-		}
-		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
-	}
-	else{
-
-		if(setenum==GsetEnum){
-			if(doftype){
-				count=0;
-				for(i=0;i<this->gsize;i++){
-					if(doftype[i]==approximation_enum){
-						outdoflist[count]=count;
-						count++;
-					}
-				}
-				_assert_(count);
-			}
-			else for(i=0;i<this->gsize;i++) outdoflist[i]=i;
-		}
-		else if(setenum==FsetEnum){
-
-			if(doftype){
-				count=0;
-				count2=0;
-				for(i=0;i<this->gsize;i++){
-					if(doftype[i]==approximation_enum){
-						if(f_set[i]){
-							outdoflist[count]=count2;
-							count++;
-						}
-						count2++;
-					}
-				}
-				_assert_(count2);
-			}
-			else{
-
-				count=0;
-				for(i=0;i<this->gsize;i++){
-					if(f_set[i]){
-						outdoflist[count]=i;
-						count++;
-					}
-				}
-			}
-		}
-		else if(setenum==SsetEnum){
-			if(doftype){
-				count=0;
-				count2=0;
-				for(i=0;i<this->gsize;i++){
-					if(doftype[i]==approximation_enum){
-						if(s_set[i]){
-							outdoflist[count]=count2;
-							count++;
-						}
-						count2++;
-					}
-				}
-				_assert_(count2);
-			}
-			else{
-				count=0;
-				for(i=0;i<this->gsize;i++){
-					if(s_set[i]){
-						outdoflist[count]=i;
-						count++;
-					}
-				}
-			}
-		}
-		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+				if(doftype[i]==approximation_enum) outdoflist[count++]=doflistpointer[i];
+			}
+		}
+		else for(i=0;i<this->gsize;i++) outdoflist[i]=doflistpointer[i];
 	}
 }
@@ -660,29 +465,10 @@
 void Node::CreateNodalConstraints(Vector<IssmDouble>* ys){/*{{{*/
 
-	int i;
-	IssmDouble* values=NULL;
-	int count;
-
-	/*Recover values for s set and plug them in constraints vector: */
-	if(this->ssize){
-		values=xNew<IssmDouble>(this->ssize);
-		count=0;
-		for(i=0;i<this->gsize;i++){
-			if(this->s_set[i]){
-				values[count]=this->svalues[i];
-				_assert_(!xIsNan<IssmDouble>(values[count]));
-				count++;
-			}
-		}
-
+	if(this->SSize()){
 		/*Add values into constraint vector: */
-		ys->SetValues(this->ssize,this->sdoflist,values,INS_VAL);
-	}
-
-	/*Free ressources:*/
-	xDelete<IssmDouble>(values);
-
-}
-/*}}}*/
+		ys->SetValues(this->gsize,this->sdoflist,this->svalues,INS_VAL);
+	}
+
+}/*}}}*/
 void Node::Deactivate(void){/*{{{*/
 
@@ -705,9 +491,9 @@
 	_assert_(this->active);
 
-	if(this->f_set[dof] == 0){
+	if(!this->f_set[dof]){
 		if(this->freeze) _error_("Cannot change dof of frozen node");
 		this->indexingupdate = true;
-		this->f_set[dof]=1; 
-		this->s_set[dof]=0;
+		this->f_set[dof]=true; 
+		this->s_set[dof]=false;
 	}
 }
@@ -719,9 +505,9 @@
 	_assert_(dof<this->gsize);
 
-	if(this->f_set[dof] == 1){
+	if(this->f_set[dof]){
 		//if(this->freeze) _error_("Cannot change dof of frozen node");
 		this->indexingupdate = true;
-		this->f_set[dof]=0; //n splits into f (for which we solve) and s (single point constraints)
-		this->s_set[dof]=1;
+		this->f_set[dof]=false; //n splits into f (for which we solve) and s (single point constraints)
+		this->s_set[dof]=true;
 	}
 }
@@ -755,6 +541,6 @@
 	if(approximation_enum==NoneApproximationEnum){
 		if      (setenum==GsetEnum) numdofs=this->gsize;
-		else if (setenum==FsetEnum) numdofs=this->fsize;
-		else if (setenum==SsetEnum) numdofs=this->ssize;
+		else if (setenum==FsetEnum) numdofs=this->FSize();
+		else if (setenum==SsetEnum) numdofs=this->SSize();
 		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 	}
@@ -776,5 +562,5 @@
 				}
 			}
-			else numdofs=this->fsize;
+			else numdofs=this->FSize();
 		}
 		else if (setenum==SsetEnum){
@@ -785,5 +571,5 @@
 				}
 			}
-			else numdofs=this->ssize;
+			else numdofs=this->SSize();
 		}
 		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
@@ -800,21 +586,12 @@
 /*}}}*/
 bool Node::IsActive(void){/*{{{*/
-
 	return active;
-
-}
-/*}}}*/
+}/*}}}*/
 int  Node::IsClone(){/*{{{*/
-
 	return clone;
-
-}
-/*}}}*/
+}/*}}}*/
 void Node::ReindexingDone(void){/*{{{*/
-
 	this->indexingupdate = false;
-
-}
-/*}}}*/
+}/*}}}*/
 void Node::RelaxConstraint(int dof){/*{{{*/
 
@@ -837,7 +614,11 @@
 	if(this->IsClone()) return;
 
-	if(this->fsize){
-		int*        indices = xNew<int>(this->fsize);
-		IssmDouble* values  = xNew<IssmDouble>(this->fsize);
+	/*Get F size and S size*/
+	int fsize = this->FSize();
+	int ssize = this->SSize();
+
+	if(fsize){
+		int*        indices = xNew<int>(fsize);
+		IssmDouble* values  = xNew<IssmDouble>(fsize);
 
 		int count = 0;
@@ -845,19 +626,19 @@
 			if(this->f_set[i]){
 				_assert_(local_uf);
-				_assert_(this->fdoflist[count]==indices_uf[this->fdoflist_local[count]]);
-
-				values[count] =local_uf[this->fdoflist_local[count]];
+				_assert_(this->fdoflist[i]==indices_uf[this->fdoflist_local[i]]);
+
+				values[count] =local_uf[this->fdoflist_local[i]];
 				indices[count]=this->gdoflist[i];
 				count++;
 			}
 		}
-		ug->SetValues(this->fsize,indices,values,INS_VAL);
+		ug->SetValues(fsize,indices,values,INS_VAL);
 
 		xDelete<IssmDouble>(values);
 		xDelete<int>(indices);
 	}
-	if(this->ssize){
-		int*        indices = xNew<int>(this->ssize);
-		IssmDouble* values  = xNew<IssmDouble>(this->ssize);
+	if(ssize){
+		int*        indices = xNew<int>(ssize);
+		IssmDouble* values  = xNew<IssmDouble>(ssize);
 
 		int count = 0;
@@ -865,13 +646,13 @@
 			if(this->s_set[i]){
 				_assert_(local_ys);
-				_assert_(this->sdoflist[count]==indices_ys[this->sdoflist_local[count]]);
-
-				values[count] =local_ys[this->sdoflist_local[count]];
+				_assert_(this->sdoflist[i]==indices_ys[this->sdoflist_local[i]]);
+
+				values[count] =local_ys[this->sdoflist_local[i]];
 				indices[count]=this->gdoflist[i];
 				count++;
 			}
 		}
-		ug->SetValues(this->ssize,indices,values,INS_VAL);
-		
+		ug->SetValues(ssize,indices,values,INS_VAL);
+
 		xDelete<IssmDouble>(values);
 		xDelete<int>(indices);
@@ -881,11 +662,13 @@
 void Node::VecReduce(Vector<IssmDouble>* uf, IssmDouble* local_ug,int* indices_ug){/*{{{*/
 
-
 	/*Only perform operation if not clone*/
 	if(this->IsClone()) return;
 
-	if(this->fsize){
-		int*        indices = xNew<int>(this->fsize);
-		IssmDouble* values  = xNew<IssmDouble>(this->fsize);
+	/*Get F size*/
+	int fsize = this->FSize();
+
+	if(fsize){
+		int*        indices = xNew<int>(fsize);
+		IssmDouble* values  = xNew<IssmDouble>(fsize);
 
 		int count = 0;
@@ -894,11 +677,13 @@
 				_assert_(local_ug);
 				_assert_(this->gdoflist[i]==indices_ug[this->gdoflist_local[i]]);
+				_assert_(this->fdoflist[i]>=0);
 
 				values[count] =local_ug[this->gdoflist_local[i]];
-				indices[count]=this->fdoflist[count];
+				indices[count]=this->fdoflist[i];
 				count++;
 			}
 		}
-		uf->SetValues(this->fsize,indices,values,INS_VAL);
+		_assert_(count==fsize);
+		uf->SetValues(fsize,indices,values,INS_VAL);
 
 		xDelete<IssmDouble>(values);
@@ -909,42 +694,4 @@
 
 /* indexing routines:*/
-void Node::AllocateDofLists(int setenum){/*{{{*/
-
-	/*Initialize: */
-	int size=0;
-
-	if(setenum==FsetEnum){
-		for(int i=0;i<this->gsize;i++) if(f_set[i])size++;
-		this->fsize=size;
-		xDelete<int>(this->fdoflist);
-		xDelete<int>(this->fdoflist_local);
-
-		if(this->fsize){
-			this->fdoflist=xNew<int>(size);
-			this->fdoflist_local=xNew<int>(size);
-		}
-		else{
-			this->fdoflist=NULL;
-			this->fdoflist_local=NULL;
-		}
-	}
-	else if(setenum==SsetEnum){
-		for(int i=0;i<this->gsize;i++) if(s_set[i])size++;
-		this->ssize=size;
-		xDelete<int>(this->sdoflist);
-		xDelete<int>(this->sdoflist_local);
-
-		if(this->ssize){
-			this->sdoflist=xNew<int>(size);
-			this->sdoflist_local=xNew<int>(size);
-		}
-		else{
-			this->sdoflist=NULL;
-			this->sdoflist_local=NULL;
-		}
-	}
-	/*TODO, we should never be here for GSET! add an assert and track down whether this happens*/
-}
-/*}}}*/
 void Node::DistributeLocalDofs(int* pdofcount,int setenum){/*{{{*/
 
@@ -955,16 +702,17 @@
 	if(setenum==GsetEnum){
 		_assert_(this->gsize==0 || this->gdoflist_local);
-		for(int i=0;i<this->gsize;i++) gdoflist_local[i]=dofcount+i;
-		dofcount+=this->gsize;
+		for(int i=0;i<this->gsize;i++) gdoflist_local[i]=dofcount++;
 	}
 	else if(setenum==FsetEnum){
-		_assert_(this->fsize==0 || this->fdoflist_local);
-		for(int i=0;i<this->fsize;i++) fdoflist_local[i]=dofcount+i;
-		dofcount+=this->fsize;
+		for(int i=0;i<this->gsize;i++){
+			if(this->f_set[i]) fdoflist_local[i]=dofcount++;
+			else               fdoflist_local[i]=-1;
+		}
 	}
 	else if(setenum==SsetEnum){
-		_assert_(this->ssize==0 || this->sdoflist_local);
-		for(int i=0;i<this->ssize;i++) sdoflist_local[i]=dofcount+i;
-		dofcount+=this->ssize;
+		for(int i=0;i<this->gsize;i++){
+			if(this->s_set[i]) sdoflist_local[i]=dofcount++;
+			else               sdoflist_local[i]=-1;
+		}
 	}
 	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
@@ -972,6 +720,5 @@
 	/*Assign output pointers: */
 	*pdofcount=dofcount;
-}
-/*}}}*/
+}/*}}}*/
 void Node::DistributeGlobalDofsMasters(int dofcount,int setenum){/*{{{*/
 
@@ -985,10 +732,14 @@
 	}
 	else if(setenum==FsetEnum){
-		_assert_(this->fsize==0 || this->fdoflist);
-		for(int i=0;i<this->fsize;i++) this->fdoflist[i]=this->fdoflist_local[i]+dofcount;
+		for(int i=0;i<this->gsize;i++){
+			if(this->f_set[i]) fdoflist[i]=this->fdoflist_local[i]+dofcount;
+			else               fdoflist[i]=-1;
+		}
 	}
 	else if(setenum==SsetEnum){
-		_assert_(this->ssize==0 || this->sdoflist);
-		for(int i=0;i<this->ssize;i++) this->sdoflist[i]=this->sdoflist_local[i]+dofcount;
+		for(int i=0;i<this->gsize;i++){
+			if(this->s_set[i]) sdoflist[i]=this->sdoflist_local[i]+dofcount;
+			else               sdoflist[i]=-1;
+		}
 	}
 	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
@@ -1005,8 +756,8 @@
 			break;
 		case FsetEnum:
-			for(int j=0;j<this->fsize;j++) truedofs[j]=fdoflist[j];
+			for(int j=0;j<this->gsize;j++) truedofs[j]=fdoflist[j];
 			break;
 		case SsetEnum:
-			for(int j=0;j<this->ssize;j++) truedofs[j]=sdoflist[j];
+			for(int j=0;j<this->gsize;j++) truedofs[j]=sdoflist[j];
 			break;
 		default:
@@ -1027,8 +778,8 @@
 			break;
 		case FsetEnum:
-			for(int j=0;j<this->fsize;j++) fdoflist[j]=alltruedofs[j];
+			for(int j=0;j<this->gsize;j++) fdoflist[j]=alltruedofs[j];
 			break;
 		case SsetEnum:
-			for(int j=0;j<this->ssize;j++) sdoflist[j]=alltruedofs[j];
+			for(int j=0;j<this->gsize;j++) sdoflist[j]=alltruedofs[j];
 			break;
 		default:
@@ -1037,10 +788,27 @@
 }
 /*}}}*/
+int  Node::FSize(void){/*{{{*/
+
+	_assert_(this!=NULL && this->gdoflist);
+
+	int fsize = 0;
+	for(int i=0;i<this->gsize;i++) if(this->f_set[i]) fsize++;
+	return fsize;
+}
+/*}}}*/
+int  Node::SSize(void){/*{{{*/
+
+	_assert_(this!=NULL && this->s_set);
+
+	int ssize = 0;
+	for(int i=0;i<this->gsize;i++) if(this->s_set[i]) ssize++;
+	return ssize;
+}
+/*}}}*/
 
 /*Methods inherent to Node: */
 int* GetGlobalDofList(Node** nodes,int numnodes,int setenum,int approximation){/*{{{*/
 
-	int  i,numdof,count;
-	int* ndof_list=NULL;
+	/*output*/
 	int *doflist = NULL;
 
@@ -1048,10 +816,10 @@
 
 		/*Allocate:*/
-		ndof_list=xNew<int>(numnodes);
+		int* ndof_list=xNew<int>(numnodes);
 
 		/*First, figure out size of doflist: */
-		numdof=0;
-		for(i=0;i<numnodes;i++){
-			ndof_list[i]=nodes[i]->GetNumberOfDofs(approximation,setenum);
+		int numdof=0;
+		for(int i=0;i<numnodes;i++){
+			ndof_list[i]=nodes[i]->GetNumberOfDofs(approximation,GsetEnum);
 			numdof+=ndof_list[i];
 		}
@@ -1062,6 +830,6 @@
 
 			/*Populate: */
-			count=0;
-			for(i=0;i<numnodes;i++){
+			int count=0;
+			for(int i=0;i<numnodes;i++){
 				nodes[i]->GetDofList(&doflist[count],approximation,setenum);
 				count+=ndof_list[i];
@@ -1069,65 +837,9 @@
 		}
 		else doflist=NULL;
-	}
-	/*Free ressources:*/
-	xDelete<int>(ndof_list);
-
-	return doflist;
-}
-/*}}}*/
-int* GetLocalDofList(Node** nodes,int numnodes,int setenum,int approximation){ /*{{{*/
-
-	int  i,j,count,numdof,numgdof;
-	int* ndof_list=NULL;
-	int* ngdof_list_cumulative=NULL;
-	int *doflist = NULL;
-
-	if(numnodes){
-		/*allocate: */
-		ndof_list=xNew<int>(numnodes);
-		ngdof_list_cumulative=xNew<int>(numnodes);
-
-		/*Get number of dofs per node, and total for this given set*/
-		numdof=0;
-		numgdof=0;
-		for(i=0;i<numnodes;i++){
-
-			/*Cumulative list= number of dofs before node i*/
-			ngdof_list_cumulative[i]=numgdof;
-
-			/*Number of dofs for node i for given set and for the g set*/
-			ndof_list[i]=nodes[i]->GetNumberOfDofs(approximation,setenum);
-			numgdof    +=nodes[i]->GetNumberOfDofs(approximation,GsetEnum);
-			numdof     +=ndof_list[i];
-		}
-
-		if(numdof){
-			/*Allocate: */
-			doflist=xNew<int>(numdof);
-
-			/*Populate: */
-			count=0;
-			for(i=0;i<numnodes;i++){
-				nodes[i]->GetLocalDofList(&doflist[count],approximation,setenum);
-				count+=ndof_list[i];
-			}
-
-			/*We now have something like: [0 1 0 2 1 2]. Offset by gsize, to get something like: [0 1 2 4 6 7]:*/
-			count=0;
-			for(i=0;i<numnodes;i++){
-				for(j=0;j<ndof_list[i];j++){
-					doflist[count+j]+=ngdof_list_cumulative[i];
-				}
-				count+=ndof_list[i];
-			}
-		}
-		else doflist=NULL;
-	}
-
-	/*Free ressources:*/
-	xDelete<int>(ndof_list);
-	xDelete<int>(ngdof_list_cumulative);
-
-	/*CLean-up and return*/
+
+		/*Free ressources:*/
+		xDelete<int>(ndof_list);
+	}
+
 	return doflist;
 }
Index: /issm/trunk/src/c/classes/Node.h
===================================================================
--- /issm/trunk/src/c/classes/Node.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Node.h	(revision 26744)
@@ -43,6 +43,4 @@
 		/*sizes: */
 		int gsize;   //number of dofs for a node
-		int fsize;   //number of dofs solver for
-		int ssize;   //number of constrained dofs
 
 		/*Activation*/
@@ -56,5 +54,5 @@
 
 		/*types of dofs: */
-		int        *doftype;   //approximation type of the dofs (used only for coupling), size g_size
+		int  *doftype;   //approximation type of the dofs (used only for coupling), size g_size
 
 		/*list of degrees of freedom: */
@@ -80,5 +78,4 @@
 
 		/*Node numerical routines*/
-		void  AllocateDofLists(int setenum);
 		void  Activate(void);
 		void  ApplyConstraint(int dof,IssmDouble value);
@@ -94,11 +91,8 @@
 		void  GetDofList(int* poutdoflist,int approximation_enum,int setenum);
 		void  GetDofListLocal(int* poutdoflist,int approximation_enum,int setenum);
-		void  GetLocalDofList(int* poutdoflist,int approximation_enum,int setenum);
 		int   GetNumberOfDofs(int approximation_enum,int setenum);
 		void  HardDeactivate(void);
 		bool  IsActive(void);
 		int   IsClone();
-		int   IsFloating();
-		int   IsGrounded();
 		int   Lid(void); 
 		void  DistributeGlobalDofsMasters(int dofcount,int setenum);
@@ -114,9 +108,10 @@
 		void  VecReduce(Vector<IssmDouble>* uf, IssmDouble* local_ug,int* indices_ug);
 		void  SetApproximation(int in_approximation);
+		int   SSize();
+		int   FSize();
 };
 
 /*Methods inherent to Node: */
 int* GetGlobalDofList(Node** nodes,int numnodes,int setenum,int approximation);
-int* GetLocalDofList(Node** nodes,int numnodes,int setenum,int approximation);
 int  GetNumberOfDofs(Node** nodes,int numnodes,int setenum,int approximation);
 
Index: /issm/trunk/src/c/classes/Nodes.cpp
===================================================================
--- /issm/trunk/src/c/classes/Nodes.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Nodes.cpp	(revision 26744)
@@ -147,10 +147,4 @@
 	int num_procs = IssmComm::GetSize();
 
-	/*First, allocate dof lists based on fset and sset*/
-	for(Object* & object : this->objects){
-      Node* node = xDynamicCast<Node*>(object);
-		node->AllocateDofLists(setenum);
-	}
-
 	/*Now, Build local dofs for masters first*/
 	int  dofcount=0;
@@ -187,5 +181,5 @@
 	 * object that is not a clone, tell them to show their dofs, so that later on, they can get picked
 	 * up by their clones: */
-	int  maxdofspernode = this->MaxNumDofs(setenum);
+	int  maxdofspernode = this->MaxNumDofs(GsetEnum);
 	int* truedofs       = xNewZeroInit<int>(this->Size()*maxdofspernode); //only one alloc
 	for(int rank=0;rank<num_procs;rank++){
Index: /issm/trunk/src/c/classes/Numberedcostfunction.h
===================================================================
--- /issm/trunk/src/c/classes/Numberedcostfunction.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Numberedcostfunction.h	(revision 26744)
@@ -9,5 +9,4 @@
 #include "./Definition.h"
 #include "./FemModel.h"
-
 
 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);
Index: /issm/trunk/src/c/classes/Options/Option.h
===================================================================
--- /issm/trunk/src/c/classes/Options/Option.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Options/Option.h	(revision 26744)
@@ -28,5 +28,4 @@
 		int           ObjectEnum(){return OptionEnum;};
 
-
 		/*virtual functions: */
 		virtual char* Name()=0;
Index: /issm/trunk/src/c/classes/Params/TransientArrayParam.cpp
===================================================================
--- /issm/trunk/src/c/classes/Params/TransientArrayParam.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Params/TransientArrayParam.cpp	(revision 26744)
@@ -20,5 +20,5 @@
 }
 /*}}}*/
-TransientArrayParam::TransientArrayParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,int in_N,int in_M){/*{{{*/
+TransientArrayParam::TransientArrayParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,bool cycle_in,int in_N,int in_M){/*{{{*/
 
 	_assert_(in_values && in_time);
@@ -28,10 +28,11 @@
 	this->N=in_N; //Number of timesteps
 	this->interpolation=interpolation_on;
+	this->cycle=cycle_in;
 
 	this->values=xNew<IssmDouble>(M*N);
-	xMemCpy<IssmDouble>(values,in_values,M*N);
+	xMemCpy<IssmDouble>(this->values,in_values,M*N);
 
 	this->timesteps=xNew<IssmDouble>(N);
-	xMemCpy<IssmDouble>(timesteps,in_time,N);
+	xMemCpy<IssmDouble>(this->timesteps,in_time,N);
 }
 /*}}}*/
@@ -44,5 +45,5 @@
 Param* TransientArrayParam::copy() {/*{{{*/
 
-	return new TransientArrayParam(this->enum_type,this->values,this->timesteps,this->interpolation,this->M,this->N);
+	return new TransientArrayParam(this->enum_type,this->values,this->timesteps,this->interpolation,this->cycle,this->M,this->N);
 
 }
@@ -80,4 +81,5 @@
 	marshallhandle->call(this->enum_type);
 	marshallhandle->call(this->interpolation);
+	marshallhandle->call(this->cycle);
 	marshallhandle->call(this->M);
 	marshallhandle->call(this->N);
@@ -102,4 +104,6 @@
 	bool       found;
 	_assert_(row>=0 && row<this->M); 
+
+	if(this->cycle) _error_("not implemented yet");
 
 	/*Ok, we have the time and row, go through the timesteps, and figure out which interval we 
@@ -129,5 +133,5 @@
 					IssmDouble deltat = this->timesteps[i+1]-this->timesteps[i];
 					IssmDouble alpha  = (time-this->timesteps[i])/deltat;
-					if(interpolation==true) output=(1.0-alpha)*this->values[row*this->N+i] + alpha*this->values[row*this->N+i+1];
+					if(this->interpolation==true) output=(1.0-alpha)*this->values[row*this->N+i] + alpha*this->values[row*this->N+i+1];
 					else output=this->values[row*this->N+i];
 					found=true;
Index: /issm/trunk/src/c/classes/Params/TransientArrayParam.h
===================================================================
--- /issm/trunk/src/c/classes/Params/TransientArrayParam.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Params/TransientArrayParam.h	(revision 26744)
@@ -25,4 +25,5 @@
 		int         M;
 		bool        interpolation;
+		bool        cycle;
 		IssmDouble *values;
 		IssmDouble *timesteps;
@@ -31,5 +32,5 @@
 		/*TransientArrayParam constructors, destructors: {{{*/
 		TransientArrayParam();
-		TransientArrayParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,int in_N,int in_M);
+		TransientArrayParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,bool cycle_in,int in_N,int in_M);
 		~TransientArrayParam();
 		/*}}}*/
Index: /issm/trunk/src/c/classes/Params/TransientParam.cpp
===================================================================
--- /issm/trunk/src/c/classes/Params/TransientParam.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Params/TransientParam.cpp	(revision 26744)
@@ -20,17 +20,18 @@
 }
 /*}}}*/
-TransientParam::TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,int in_N){/*{{{*/
+TransientParam::TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,bool cycle_in,int in_N){/*{{{*/
 
 	_assert_(in_values && in_time);
 
-	enum_type=in_enum_type;
-	N=in_N;
-	interpolation=interpolation_on;
+	this->enum_type=in_enum_type;
+	this->N=in_N;
+	this->interpolation=interpolation_on;
+	this->cycle=cycle_in;
 
-	values=xNew<IssmDouble>(N);
-	xMemCpy<IssmDouble>(values,in_values,N);
+	this->values=xNew<IssmDouble>(N);
+	xMemCpy<IssmDouble>(this->values,in_values,N);
 
-	timesteps=xNew<IssmDouble>(N);
-	xMemCpy<IssmDouble>(timesteps,in_time,N);
+	this->timesteps=xNew<IssmDouble>(N);
+	xMemCpy<IssmDouble>(this->timesteps,in_time,N);
 }
 /*}}}*/
@@ -44,5 +45,5 @@
 Param* TransientParam::copy() {/*{{{*/
 
-	return new TransientParam(this->enum_type,this->values,this->timesteps,this->interpolation,this->N);
+	return new TransientParam(this->enum_type,this->values,this->timesteps,this->interpolation,this->cycle,this->N);
 
 }
@@ -75,4 +76,5 @@
 	marshallhandle->call(this->enum_type);
 	marshallhandle->call(this->interpolation);
+	marshallhandle->call(this->cycle);
 	marshallhandle->call(this->N);
 	if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
@@ -97,4 +99,6 @@
 	IssmDouble output;
 	bool   found;
+
+	if(this->cycle) _error_("not implemented yet!");
 
 	/*Ok, we have the time, go through the timesteps, and figure out which interval we 
@@ -124,5 +128,5 @@
 					IssmDouble deltat=this->timesteps[i+1]-this->timesteps[i];
 					IssmDouble alpha=(time-this->timesteps[i])/deltat;
-					if(interpolation==true) output=(1.0-alpha)*this->values[i] + alpha*this->values[i+1];
+					if(this->interpolation==true) output=(1.0-alpha)*this->values[i] + alpha*this->values[i+1];
 					else output=this->values[i];
 					found=true;
Index: /issm/trunk/src/c/classes/Params/TransientParam.h
===================================================================
--- /issm/trunk/src/c/classes/Params/TransientParam.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Params/TransientParam.h	(revision 26744)
@@ -24,4 +24,5 @@
 		int         N;
 		bool        interpolation;
+		bool        cycle;
 		IssmDouble *values;
 		IssmDouble *timesteps;
@@ -30,5 +31,5 @@
 		/*TransientParam constructors, destructors: {{{*/
 		TransientParam();
-		TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,int in_N);
+		TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_in,bool cycle_in,int in_N);
 		~TransientParam();
 		/*}}}*/
Index: /issm/trunk/src/c/classes/Profiler.h
===================================================================
--- /issm/trunk/src/c/classes/Profiler.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Profiler.h	(revision 26744)
@@ -22,19 +22,19 @@
 #define MOVINGFRONTCORE		9 /*Profiling MOVINGFRONT */
 #define MASSTRANSPORTCORE	10 /*Profiling MASSTRANSPORT */
-#define SMBCORE				11 /*Profiling SMB */
-#define GROUNDINGLINECORE	12 /*Profiling GROUDINGLINE MIGRATION */
-#define GIACORE				13 /*Profiling GIA */
+#define OCEANTRANSPORTCORE	11 /*Profiling OCEANTRANSPORT */
+#define SMBCORE				12 /*Profiling SMB */
+#define GROUNDINGLINECORE	13 /*Profiling GROUDINGLINE MIGRATION */
 #define ESACORE				14 /*Profiling ESA */
 #define SLRCORE				15 /*Profiling SLR */
-#define MPISERIAL				16 /*Profiling MPISerial */
-#define SEDLOOP				17 /*Profiling MPISerial */
-#define SEDMatrix				18 /*Profiling MPISerial */
-#define SEDUpdate				19 /*Profiling MPISerial */
-#define EPLLOOP				20 /*Profiling MPISerial */
-#define EPLMasking			21 /*Profiling MPISerial */
-#define EPLMatrices			22 /*Profiling MPISerial */
-#define EPLUpdate				23 /*Profiling MPISerial */
-#define MAXPROFSIZE			24 /*Used to initialize static arrays*/
-
+#define SAMPLINGCORE	16 /*Profiling SAMPLING */
+#define MPISERIAL				17 /*Profiling MPISerial */
+#define SEDLOOP				18 /*Profiling MPISerial */
+#define SEDMatrix				19 /*Profiling MPISerial */
+#define SEDUpdate				20 /*Profiling MPISerial */
+#define EPLLOOP				21 /*Profiling MPISerial */
+#define EPLMasking			22 /*Profiling MPISerial */
+#define EPLMatrices			23 /*Profiling MPISerial */
+#define EPLUpdate				24 /*Profiling MPISerial */
+#define MAXPROFSIZE			25 /*Used to initialize static arrays*/
 
 class Profiler: public Object{
Index: /issm/trunk/src/c/classes/Radar.h
===================================================================
--- /issm/trunk/src/c/classes/Radar.h	(revision 26743)
+++ /issm/trunk/src/c/classes/Radar.h	(revision 26744)
@@ -18,10 +18,10 @@
 		char* name;
 		int	definitionenum;
-		
+
 		/*Radar constructors, destructors :*/
 		Radar();
 		Radar(char* in_name, int in_definitionenum);
 		~Radar();
-		
+
 		/*Object virtual function resolutoin: */
 		Object* copy();
@@ -31,5 +31,5 @@
 		void Marshall(MarshallHandle* marshallhandle);
 		int ObjectEnum(void);
-		
+
 		/*Definition virtual function resolutoin: */
 		int DefinitionEnum();
Index: /issm/trunk/src/c/classes/SealevelGeometry.cpp
===================================================================
--- /issm/trunk/src/c/classes/SealevelGeometry.cpp	(revision 26744)
+++ /issm/trunk/src/c/classes/SealevelGeometry.cpp	(revision 26744)
@@ -0,0 +1,156 @@
+/*
+ * \file SealevelGeometry.cpp
+ * \brief: Implementation of SealevelGeometry class
+ */
+
+/*Headers: {{{*/
+#ifdef HAVE_CONFIG_H
+	#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "./SealevelGeometry.h"
+
+using namespace std;
+/*}}}*/
+
+/*Object constructors and destructor*/
+SealevelGeometry::SealevelGeometry(int localnelin,int localnodsin){ /*{{{*/
+	localnel=localnelin;
+	for(int i=0;i<SLGEOM_NUMLOADS;i++){
+		for (int j=0;j<SLMAXVERTICES;j++){
+			LoadWeigths[i][j]=xNewZeroInit<IssmDouble>(localnel);
+		}
+		vlatbarycentre[i]=NULL; //we don't know yet 
+		vlongbarycentre[i]=NULL;
+		vareae_subel[i]=NULL;
+		latbarycentre[i]=NULL; //we don't know yet 
+		longbarycentre[i]=NULL;
+		area_subel[i]=NULL;
+
+		LoadArea[i]=xNewZeroInit<IssmDouble>(localnel);
+		issubelement[i]=xNewZeroInit<bool>(localnel);
+		subelementmapping[i]=NULL;
+		nsubel[i]=0;
+		nbar[i]=0;
+	}
+	late=xNew<IssmDouble>(localnel);
+	longe=xNew<IssmDouble>(localnel);
+	isoceanin=xNew<bool>(localnel);
+	lids=xNew<int>(localnodsin);
+
+}; /*}}}*/
+SealevelGeometry::~SealevelGeometry(){ /*{{{*/
+	for(int i=0;i<SLGEOM_NUMLOADS;i++){
+		for (int j=0;j<SLMAXVERTICES;j++){
+			xDelete<IssmDouble>(LoadWeigths[i][j]);
+		}
+		xDelete<IssmDouble>(LoadArea[i]);
+		xDelete<bool>(issubelement[i]);
+		xDelete<int>(subelementmapping[i]);
+		delete  vlatbarycentre[i];
+		delete  vlongbarycentre[i];
+		delete  vareae_subel[i];
+		xDelete<IssmDouble>(latbarycentre[i]);
+		xDelete<IssmDouble>(longbarycentre[i]);
+		xDelete<IssmDouble>(area_subel[i]);
+	}
+	xDelete<IssmDouble>(late);
+	xDelete<IssmDouble>(longe);
+	xDelete<bool>(isoceanin);
+	xDelete<int>(lids);
+}; /*}}}*/
+
+void SealevelGeometry::InitializeMappingsAndBarycentres(void){ /*{{{*/
+
+	int dummy;
+	bool fromlocalsize=true;
+	int lower_row;
+
+	for (int i=0;i<SLGEOM_NUMLOADS;i++){
+		subelementmapping[i]=xNew<int>(localnel);
+		GetOwnershipBoundariesFromRange(&lower_row,&dummy,nsubel[i],IssmComm::GetComm());
+
+		int count=0;
+		for (int j=0;j<localnel;j++){
+			if(issubelement[i][j]){
+				subelementmapping[i][j]=lower_row+count;
+				count++;
+			}
+		}
+	}
+
+	/*Initialize barycentre vectors, now that we know their size: */
+	for (int i=0;i<SLGEOM_NUMLOADS;i++){
+		vlatbarycentre[i]=new Vector<IssmDouble>(nsubel[i],fromlocalsize);
+		vlongbarycentre[i]=new Vector<IssmDouble>(nsubel[i],fromlocalsize);
+		vareae_subel[i]=new Vector<IssmDouble>(nsubel[i],fromlocalsize);
+		vlatbarycentre[i]->GetSize(&nbar[i]);
+	}
+
+} /*}}}*/
+void SealevelGeometry::Assemble(void){ /*{{{*/
+
+	/*Initialize barycentre vectors, now that we know their size: */
+	for (int i=0;i<SLGEOM_NUMLOADS;i++){
+		vlatbarycentre[i]->Assemble();
+		vlongbarycentre[i]->Assemble();
+		vareae_subel[i]->Assemble();
+
+		latbarycentre[i]=vlatbarycentre[i]->ToMPISerial();
+		longbarycentre[i]=vlongbarycentre[i]->ToMPISerial();
+		area_subel[i]=vareae_subel[i]->ToMPISerial();
+	}
+
+	/*Also, we'll need the barycentre associated areas:*/
+
+} /*}}}*/
+int SealevelGeometry::GEnum(int l){ /*{{{*/
+
+	int output = -1;
+	switch(l){
+		case SLGEOM_OCEAN: output=SealevelchangeGsubelOceanEnum; break;
+		case SLGEOM_ICE:   output=SealevelchangeGsubelIceEnum;   break;
+		case SLGEOM_WATER: output=SealevelchangeGsubelHydroEnum; break;
+		default: _error_("not supported");
+	}
+	return output;
+
+} /*}}}*/
+int SealevelGeometry::GUEnum(int l){ /*{{{*/
+
+	int output = -1;
+	switch(l){
+		case SLGEOM_OCEAN: output=SealevelchangeGUsubelOceanEnum; break;
+		case SLGEOM_ICE:   output=SealevelchangeGUsubelIceEnum;   break;
+		case SLGEOM_WATER: output=SealevelchangeGUsubelHydroEnum; break;
+		default: _error_("not supported");
+	}
+	return output;
+
+} /*}}}*/
+int SealevelGeometry::GNEnum(int l){ /*{{{*/
+
+	int output = -1;
+	switch(l){
+		case SLGEOM_OCEAN: output=SealevelchangeGNsubelOceanEnum; break;
+		case SLGEOM_ICE:   output=SealevelchangeGNsubelIceEnum;   break;
+		case SLGEOM_WATER: output=SealevelchangeGNsubelHydroEnum; break;
+		default: _error_("not supported");
+	}
+
+	return output;
+} /*}}}*/
+int SealevelGeometry::GEEnum(int l){ /*{{{*/
+
+	int output = -1;
+	switch(l){
+		case SLGEOM_OCEAN: output=SealevelchangeGEsubelOceanEnum; break;
+		case SLGEOM_ICE:   output=SealevelchangeGEsubelIceEnum;   break;
+		case SLGEOM_WATER: output=SealevelchangeGEsubelHydroEnum; break;
+		default: _error_("not supported");
+	}
+	return output;
+
+} /*}}}*/
Index: /issm/trunk/src/c/classes/SealevelGeometry.h
===================================================================
--- /issm/trunk/src/c/classes/SealevelGeometry.h	(revision 26744)
+++ /issm/trunk/src/c/classes/SealevelGeometry.h	(revision 26744)
@@ -0,0 +1,48 @@
+/*!\file SealevelGeometry.h
+ * \brief: header file for SealevelMask geometry
+ */
+
+#ifndef _SEALEVELGEOMETRY_H_
+#define _SEALEVELGEOMETRY_H_
+
+/*Headers:*/
+#define SLGEOM_NUMLOADS 3
+#define SLGEOM_OCEAN 0 
+#define SLGEOM_ICE 1 
+#define SLGEOM_WATER 2
+#define SLMAXVERTICES 3
+
+#include "../toolkits/toolkits.h"
+
+class SealevelGeometry{ 
+
+	public: 
+
+		int         localnel;
+		IssmDouble* LoadWeigths[SLGEOM_NUMLOADS][SLMAXVERTICES];
+		IssmDouble* LoadArea[SLGEOM_NUMLOADS];
+		Vector<IssmDouble>* vlatbarycentre[SLGEOM_NUMLOADS];
+		Vector<IssmDouble>* vlongbarycentre[SLGEOM_NUMLOADS];
+		Vector<IssmDouble>* vareae_subel[SLGEOM_NUMLOADS];
+		IssmDouble* latbarycentre[SLGEOM_NUMLOADS];
+		IssmDouble* longbarycentre[SLGEOM_NUMLOADS];
+		IssmDouble* area_subel[SLGEOM_NUMLOADS];
+		IssmDouble* late;
+		IssmDouble* longe;
+		bool* isoceanin;
+		bool*       issubelement[SLGEOM_NUMLOADS]; 
+		int*        subelementmapping[SLGEOM_NUMLOADS];
+		int         nsubel[SLGEOM_NUMLOADS];
+		int         nbar[SLGEOM_NUMLOADS];
+		int*        lids; 
+
+		SealevelGeometry(int localnel,int localnods);
+		~SealevelGeometry();
+		void InitializeMappingsAndBarycentres(void);
+		void Assemble(void);
+		int GEnum(int l);
+		int GUEnum(int l);
+		int GNEnum(int l);
+		int GEEnum(int l);
+};
+#endif  /* _SEALEVELGEOMETRY_H_ */
Index: sm/trunk/src/c/classes/SealevelMasks.h
===================================================================
--- /issm/trunk/src/c/classes/SealevelMasks.h	(revision 26743)
+++ 	(revision )
@@ -1,34 +1,0 @@
-/*!\file SealevelMasks.h
- * \brief: header file for SealevelMask object
- */
-
-#ifndef _SEALEVELMASKS_H_
-#define _SEALEVELMASKS_H_
-
-/*Headers:*/
-
-class SealevelMasks {
-
-	public: 
-
-		bool*       isiceonly;
-		bool*       isfullyfloating;
-		bool*       notfullygrounded;
-		bool*       isoceanin; 
-		
-		/*SealevelMasks constructors, destructors :*/
-		SealevelMasks(int nel){
-			/*allocate fields:*/
-			this->isiceonly=xNew<bool>(nel);
-			this->isfullyfloating=xNew<bool>(nel);
-			this->notfullygrounded=xNew<bool>(nel);
-			this->isoceanin=xNew<bool>(nel);
-		};
-		~SealevelMasks(){
-			xDelete<bool>(this->isiceonly);
-			xDelete<bool>(this->isfullyfloating);
-			xDelete<bool>(this->notfullygrounded);
-			xDelete<bool>(this->isoceanin);
-		};
-};
-#endif  /* _SEALEVELMASKS_H_ */
Index: /issm/trunk/src/c/classes/Vertex.cpp
===================================================================
--- /issm/trunk/src/c/classes/Vertex.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/Vertex.cpp	(revision 26744)
@@ -182,4 +182,5 @@
 	switch(this->domaintype){
 		case Domain2DhorizontalEnum:
+		case Domain3DsurfaceEnum:
 			/*Nothing*/
 			return;
Index: /issm/trunk/src/c/classes/classes.h
===================================================================
--- /issm/trunk/src/c/classes/classes.h	(revision 26743)
+++ /issm/trunk/src/c/classes/classes.h	(revision 26744)
@@ -18,5 +18,7 @@
 #include "./Massfluxatgate.h"
 #include "./Misfit.h"
-#include "./SealevelMasks.h"
+#include "./SealevelGeometry.h"
+#include "./GrdLoads.h"
+#include "./BarystaticContributions.h"
 #include "./Nodalvalue.h"
 #include "./Numberedcostfunction.h"
@@ -24,4 +26,5 @@
 #include "./Cfdragcoeffabsgrad.h"
 #include "./Cfsurfacelogvel.h"
+#include "./Cflevelsetmisfit.h"
 #include "./Masscon.h"
 #include "./Massconaxpby.h"
Index: /issm/trunk/src/c/classes/gauss/GaussTria.cpp
===================================================================
--- /issm/trunk/src/c/classes/gauss/GaussTria.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/gauss/GaussTria.cpp	(revision 26744)
@@ -636,6 +636,13 @@
 } /*}}}*/
 void GaussTria::SynchronizeGaussBase(Gauss* gauss){/*{{{*/
-
-	_error_("not supported");
-}
-/*}}}*/
+	//itapopo check this
+	_assert_(gauss->Enum()==GaussTriaEnum);
+   GaussTria* gauss_tria = xDynamicCast<GaussTria*>(gauss);
+
+   gauss_tria->coord1=this->coord1;
+   gauss_tria->coord2=this->coord2;
+   gauss_tria->coord3=this->coord3;
+   gauss_tria->weight=UNDEF;
+	//_error_("not supported");
+}
+/*}}}*/
Index: /issm/trunk/src/c/classes/kriging/Covertree.h
===================================================================
--- /issm/trunk/src/c/classes/kriging/Covertree.h	(revision 26743)
+++ /issm/trunk/src/c/classes/kriging/Covertree.h	(revision 26744)
@@ -95,5 +95,4 @@
 	bool isValidTree() const;
 
-
 	/**
 	 * Remove point p from the cover tree. If p is not present in the tree,
Index: /issm/trunk/src/c/classes/kriging/ExponentialVariogram.h
===================================================================
--- /issm/trunk/src/c/classes/kriging/ExponentialVariogram.h	(revision 26743)
+++ /issm/trunk/src/c/classes/kriging/ExponentialVariogram.h	(revision 26744)
@@ -29,5 +29,4 @@
 		int   ObjectEnum(){_error_("Not implemented yet");};
 
-
 		/*Variogram functions*/
 		double Covariance(double deltax,double deltay);
Index: /issm/trunk/src/c/classes/kriging/PowerVariogram.h
===================================================================
--- /issm/trunk/src/c/classes/kriging/PowerVariogram.h	(revision 26743)
+++ /issm/trunk/src/c/classes/kriging/PowerVariogram.h	(revision 26744)
@@ -29,5 +29,4 @@
 		int   ObjectEnum(){_error_("Not implemented yet");};
 
-
 		/*Variogram functions*/
 		double Covariance(double deltax,double deltay);
Index: /issm/trunk/src/c/classes/kriging/Quadtree.h
===================================================================
--- /issm/trunk/src/c/classes/kriging/Quadtree.h	(revision 26743)
+++ /issm/trunk/src/c/classes/kriging/Quadtree.h	(revision 26744)
@@ -33,5 +33,4 @@
 				int     ObjectEnum(){_error_("not implemented yet"); };
 
-
 				/*Methods*/
 				int          IsWithinRange(double  x,double y,double range);
Index: /issm/trunk/src/c/classes/kriging/SphericalVariogram.h
===================================================================
--- /issm/trunk/src/c/classes/kriging/SphericalVariogram.h	(revision 26743)
+++ /issm/trunk/src/c/classes/kriging/SphericalVariogram.h	(revision 26744)
@@ -29,5 +29,4 @@
 		int   ObjectEnum(){_error_("Not implemented yet");};
 
-
 		/*Variogram functions*/
 		double Covariance(double deltax,double deltay);
Index: /issm/trunk/src/c/classes/matrix/ElementMatrix.cpp
===================================================================
--- /issm/trunk/src/c/classes/matrix/ElementMatrix.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/matrix/ElementMatrix.cpp	(revision 26744)
@@ -21,22 +21,7 @@
 
 	this->nrows=0;
-	this->ncols=0;
 	this->values=NULL;
-	this->dofsymmetrical=false;
-
-	this->row_fsize=0;
-	this->row_flocaldoflist=NULL;
-	this->row_fglobaldoflist=NULL;
-	this->row_ssize=0;
-	this->row_slocaldoflist=NULL;
-	this->row_sglobaldoflist=NULL;
-
-	this->col_fsize=0;
-	this->col_flocaldoflist=NULL;
-	this->col_fglobaldoflist=NULL;
-	this->col_ssize=0;
-	this->col_slocaldoflist=NULL;
-	this->col_sglobaldoflist=NULL;
-
+	this->fglobaldoflist=NULL;
+	this->sglobaldoflist=NULL;
 }
 /*}}}*/
@@ -52,7 +37,4 @@
 	/*intermediaries*/
 	int i,j,counter;
-	int gsize,fsize,ssize;
-	int* P=NULL;
-	bool found;
 
 	/*If one of the two matrix is NULL, we copy the other one*/
@@ -70,13 +52,12 @@
 
 	/*General Case: Ke1 and Ke2 are not empty*/
-	if(!Ke1->dofsymmetrical || !Ke2->dofsymmetrical) _error_("merging 2 non dofsymmetrical matrices not implemented yet");
 
 	/*Initialize itransformation matrix Ke[P[i]] = Ke2[i]*/
-	P=xNew<int>(Ke2->nrows);
+	int* P=xNew<int>(Ke2->nrows);
 
 	/*1: Get the new numbering of Ke2 and get size of the new matrix*/
-	gsize=Ke1->nrows;
+	int gsize=Ke1->nrows;
 	for(i=0;i<Ke2->nrows;i++){
-		found=false;
+		bool found=false;
 		for(j=0;j<Ke1->nrows;j++){
 			if(Ke2->gglobaldoflist[i]==Ke1->gglobaldoflist[j]){
@@ -91,84 +72,26 @@
 	/*2: Initialize static fields*/
 	this->nrows=gsize;
-	this->ncols=gsize;
-	this->dofsymmetrical=true;
 
 	/*Gset and values*/
 	this->gglobaldoflist=xNew<int>(this->nrows);
-	this->values=xNewZeroInit<IssmDouble>(this->nrows*this->ncols);
+	this->fglobaldoflist=xNew<int>(this->nrows);
+	this->sglobaldoflist=xNew<int>(this->nrows);
+	this->values=xNewZeroInit<IssmDouble>(this->nrows*this->nrows);
 	for(i=0;i<Ke1->nrows;i++){
-		for(j=0;j<Ke1->ncols;j++){
-			this->values[i*this->ncols+j] += Ke1->values[i*Ke1->ncols+j];
+		for(j=0;j<Ke1->nrows;j++){
+			this->values[i*this->nrows+j] += Ke1->values[i*Ke1->nrows+j];
 		}
 		this->gglobaldoflist[i]=Ke1->gglobaldoflist[i];
+		this->fglobaldoflist[i]=Ke1->fglobaldoflist[i];
+		this->sglobaldoflist[i]=Ke1->sglobaldoflist[i];
 	}
 	for(i=0;i<Ke2->nrows;i++){
-		for(j=0;j<Ke2->ncols;j++){
-			this->values[P[i]*this->ncols+P[j]] += Ke2->values[i*Ke2->ncols+j];
+		for(j=0;j<Ke2->nrows;j++){
+			this->values[P[i]*this->nrows+P[j]] += Ke2->values[i*Ke2->nrows+j];
 		}
 		this->gglobaldoflist[P[i]]=Ke2->gglobaldoflist[i];
-	}
-
-	/*Fset*/
-	fsize=Ke1->row_fsize;
-	for(i=0;i<Ke2->row_fsize;i++){
-		if(P[Ke2->row_flocaldoflist[i]] >= Ke1->nrows) fsize++;
-	}
-	this->row_fsize=fsize;
-	if(fsize){
-		this->row_flocaldoflist =xNew<int>(fsize);
-		this->row_fglobaldoflist=xNew<int>(fsize);
-		for(i=0;i<Ke1->row_fsize;i++){
-			this->row_flocaldoflist[i] =Ke1->row_flocaldoflist[i];
-			this->row_fglobaldoflist[i]=Ke1->row_fglobaldoflist[i];
-		}
-		counter=Ke1->row_fsize;
-		for(i=0;i<Ke2->row_fsize;i++){
-			if(P[Ke2->row_flocaldoflist[i]] >= Ke1->nrows){
-				this->row_flocaldoflist[counter] =P[Ke2->row_flocaldoflist[i]];
-				this->row_fglobaldoflist[counter]=Ke2->row_fglobaldoflist[i];
-				counter++;
-			}
-		}
-	}
-	else{
-		this->row_flocaldoflist=NULL;
-		this->row_fglobaldoflist=NULL;
-	}
-
-	/*Sset*/
-	ssize=Ke1->row_ssize;
-	for(i=0;i<Ke2->row_ssize;i++){
-		if(P[Ke2->row_slocaldoflist[i]] >= Ke1->nrows) ssize++;
-	}
-	this->row_ssize=ssize;
-	if(ssize){
-		this->row_slocaldoflist =xNew<int>(ssize);
-		this->row_sglobaldoflist=xNew<int>(ssize);
-		for(i=0;i<Ke1->row_ssize;i++){
-			this->row_slocaldoflist[i] =Ke1->row_slocaldoflist[i];
-			this->row_sglobaldoflist[i]=Ke1->row_sglobaldoflist[i];
-		}
-		counter=Ke1->row_ssize;
-		for(i=0;i<Ke2->row_ssize;i++){
-			if(P[Ke2->row_slocaldoflist[i]] >= Ke1->nrows){
-				this->row_slocaldoflist[counter] =P[Ke2->row_slocaldoflist[i]];
-				this->row_sglobaldoflist[counter]=Ke2->row_sglobaldoflist[i];
-				counter++;
-			}
-		}
-	}
-	else{
-		this->row_slocaldoflist=NULL;
-		this->row_sglobaldoflist=NULL;
-	}
-
-	/*don't do cols, we can pick them up from the rows: */
-	this->col_fsize=0;
-	this->col_flocaldoflist=NULL;
-	this->col_fglobaldoflist=NULL;
-	this->col_ssize=0;
-	this->col_slocaldoflist=NULL;
-	this->col_sglobaldoflist=NULL;
+		this->fglobaldoflist[P[i]]=Ke2->fglobaldoflist[i];
+		this->sglobaldoflist[P[i]]=Ke2->sglobaldoflist[i];
+	}
 
 	/*clean-up*/
@@ -193,29 +116,12 @@
 
 	/*get Matrix size and properties*/
-	this->dofsymmetrical=true;
 	this->nrows=GetNumberOfDofs(nodes,numnodes,GsetEnum,approximation);
-	this->ncols=this->nrows;
 
 	/*fill values with 0: */
-	this->values=xNewZeroInit<IssmDouble>(this->nrows*this->ncols);
-
-	/*g list*/
+	this->values=xNewZeroInit<IssmDouble>(this->nrows*this->nrows);
+
 	this->gglobaldoflist=GetGlobalDofList(nodes,numnodes,GsetEnum,approximation);
-
-	/*get dof lists for f and s set: */
-	this->row_fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
-	this->row_flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
-	this->row_fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
-	this->row_ssize=GetNumberOfDofs(nodes,numnodes,SsetEnum,approximation);
-	this->row_slocaldoflist =GetLocalDofList( nodes,numnodes,SsetEnum,approximation);
-	this->row_sglobaldoflist=GetGlobalDofList(nodes,numnodes,SsetEnum,approximation);
-
-	/*Because this matrix is "dofsymmetrical" don't do cols, we can pick them up from the rows: */
-	this->col_fsize=0;
-	this->col_flocaldoflist=NULL;
-	this->col_fglobaldoflist=NULL;
-	this->col_ssize=0;
-	this->col_slocaldoflist=NULL;
-	this->col_sglobaldoflist=NULL;
+	this->fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
+	this->sglobaldoflist=GetGlobalDofList(nodes,numnodes,SsetEnum,approximation);
 }
 /*}}}*/
@@ -224,12 +130,6 @@
 	xDelete<IssmDouble>(this->values);
 	xDelete<int>(this->gglobaldoflist);
-	xDelete<int>(this->row_flocaldoflist);
-	xDelete<int>(this->row_fglobaldoflist);
-	xDelete<int>(this->row_slocaldoflist);
-	xDelete<int>(this->row_sglobaldoflist);
-	xDelete<int>(this->col_flocaldoflist);
-	xDelete<int>(this->col_fglobaldoflist);
-	xDelete<int>(this->col_slocaldoflist);
-	xDelete<int>(this->col_sglobaldoflist);
+	xDelete<int>(this->fglobaldoflist);
+	xDelete<int>(this->sglobaldoflist);
 }
 /*}}}*/
@@ -246,23 +146,22 @@
 	this->CheckConsistency();
 
-	if(this->dofsymmetrical){
-		/*only use row dofs to add values into global matrices: */
-
-		if(this->row_fsize){
-			/*first, retrieve values that are in the f-set from the g-set values matrix: */
-			localvalues=xNew<IssmDouble>(this->row_fsize);
-			for(int i=0;i<this->row_fsize;i++){
-				localvalues[i] = this->values[this->ncols*this->row_flocaldoflist[i]+ this->row_flocaldoflist[i]];
-			}
-
-			/*add local values into global  matrix, using the fglobaldoflist: */
-			pf->SetValues(this->row_fsize,this->row_fglobaldoflist,localvalues,ADD_VAL);
-
-			/*Free ressources:*/
-			xDelete<IssmDouble>(localvalues);
-		}
-	}
-	else{
-		_error_("non dofsymmetrical matrix AddToGlobal routine not support yet!");
+	/*do we have any component in the F set?*/
+	int fsize = 0;
+	for(int i=0;i<this->nrows;i++){
+		if(this->fglobaldoflist[i]>=0) fsize++;
+	}
+
+	if(fsize){
+		/*first, retrieve values that are in the f-set from the g-set values matrix: */
+		localvalues=xNew<IssmDouble>(this->nrows);
+		for(int i=0;i<this->nrows;i++){
+			localvalues[i] = this->values[this->nrows*i + i];
+		}
+
+		/*add local values into global  matrix, using the fglobaldoflist: */
+		pf->SetValues(fsize,this->fglobaldoflist,localvalues,ADD_VAL);
+
+		/*Free ressources:*/
+		xDelete<IssmDouble>(localvalues);
 	}
 
@@ -270,7 +169,4 @@
 /*}}}*/
 void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/
-
-	int i,j;
-	IssmDouble* localvalues=NULL;
 
 	/*Check that Kff has been alocated in debugging mode*/
@@ -286,48 +182,27 @@
 	this->CheckConsistency();
 
-	if(this->dofsymmetrical){
-		/*only use row dofs to add values into global matrices: */
-
-		if(this->row_fsize){
-			/*first, retrieve values that are in the f-set from the g-set values matrix: */
-			localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize);
-			for(i=0;i<this->row_fsize;i++){
-				for(j=0;j<this->row_fsize;j++){
-					localvalues[this->row_fsize*i+j]=this->values[this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]];
-				}
-			}
-
-			/*add local values into global  matrix, using the fglobaldoflist: */
-			Kff->SetValues(this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,localvalues,ADD_VAL);
-
-			/*Free ressources:*/
-			xDelete<IssmDouble>(localvalues);
-		}
-
-		if((this->row_ssize!=0) && (this->row_fsize!=0)){
-			/*first, retrieve values that are in the f and s-set from the g-set values matrix: */
-			localvalues=xNew<IssmDouble>(this->row_fsize*this->row_ssize);
-			for(i=0;i<this->row_fsize;i++){
-				for(j=0;j<this->row_ssize;j++){
-					localvalues[this->row_ssize*i+j]=this->values[this->ncols*this->row_flocaldoflist[i]+this->row_slocaldoflist[j]];
-				}
-			}
-			/*add local values into global  matrix, using the fglobaldoflist: */
-			Kfs->SetValues(this->row_fsize,this->row_fglobaldoflist,this->row_ssize,this->row_sglobaldoflist,localvalues,ADD_VAL);
-
-			/*Free ressources:*/
-			xDelete<IssmDouble>(localvalues);
-		}
-	}
-	else{
-		_error_("non dofsymmetrical matrix AddToGlobal routine not support yet!");
-	}
-
+	/*do we have any component in the F or S set?*/
+   bool is_fset= false;
+	bool is_sset= false;
+   for(int i=0;i<this->nrows;i++){
+      if(this->fglobaldoflist[i]>=0){
+         is_fset = true;
+      }
+		else{
+			_assert_(this->sglobaldoflist[i]>=0);
+			is_sset = true;
+		}
+   }
+
+	/*only use row dofs to add values into global matrices: */
+	if(is_fset){
+		Kff->SetValues(this->nrows,this->fglobaldoflist,this->nrows,this->fglobaldoflist,this->values,ADD_VAL);
+	}
+	if(is_fset && is_sset){
+		Kfs->SetValues(this->nrows,this->fglobaldoflist,this->nrows,this->sglobaldoflist,this->values,ADD_VAL);
+	}
 }
 /*}}}*/
 void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Jff){/*{{{*/
-
-	int i,j;
-	IssmDouble* localvalues=NULL;
 
 	/*Check that Jff is not NULL*/
@@ -337,27 +212,16 @@
 	this->CheckConsistency();
 
-	if(this->dofsymmetrical){
-		/*only use row dofs to add values into global matrices: */
-
-		if(this->row_fsize){
-			/*first, retrieve values that are in the f-set from the g-set values matrix: */
-			localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize);
-			for(i=0;i<this->row_fsize;i++){
-				for(j=0;j<this->row_fsize;j++){
-					*(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]);
-				}
-			}
-			/*add local values into global  matrix, using the fglobaldoflist: */
-			Jff->SetValues(this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,localvalues,ADD_VAL);
-
-			/*Free ressources:*/
-			xDelete<IssmDouble>(localvalues);
-		}
-
-	}
-	else{
-		_error_("non dofsymmetrical matrix AddToGlobal routine not support yet!");
-	}
-
+	/*do we have any component in the F set?*/
+	bool isfset= false;
+	for(int i=0;i<this->nrows;i++){
+		if(this->fglobaldoflist[i]>=0){
+			isfset = true;
+			break;
+		}
+   }
+
+	if(isfset){
+		Jff->SetValues(this->nrows,this->fglobaldoflist,this->nrows,this->fglobaldoflist,this->values,ADD_VAL);
+	}
 }
 /*}}}*/
@@ -366,8 +230,8 @@
 	#ifdef _ISSM_DEBUG_ 
 	for (int i=0;i<this->nrows;i++){
-		for(int j=0;j<this->ncols;j++){
-			if (xIsNan<IssmDouble>(this->values[i*this->ncols+j])) _error_("NaN found in Element Matrix");
-			if (xIsInf<IssmDouble>(this->values[i*this->ncols+j])) _error_("Inf found in Element Matrix");
-			if (fabs(this->values[i*this->ncols+j])>1.e+50) _error_("Element Matrix values exceeds 1.e+50");
+		for(int j=0;j<this->nrows;j++){
+			if (xIsNan<IssmDouble>(this->values[i*this->nrows+j])) _error_("NaN found in Element Matrix");
+			if (xIsInf<IssmDouble>(this->values[i*this->nrows+j])) _error_("Inf found in Element Matrix");
+			if (fabs(this->values[i*this->nrows+j])>1.e+50) _error_("Element Matrix values exceeds 1.e+50");
 		}
 	}
@@ -380,11 +244,9 @@
 	_printf_("Element Matrix echo:\n");
 	_printf_("   nrows: " << this->nrows << "\n");
-	_printf_("   ncols: " << this->ncols << "\n");
-	_printf_("   dofsymmetrical: " << (dofsymmetrical?"true":"false") << "\n");
 
 	_printf_("   values:\n");
 	for(i=0;i<nrows;i++){
 		_printf_(setw(4) << right << i << ": ");
-		for(j=0;j<ncols;j++) _printf_( " " << setw(11) << setprecision (5) << right << values[i*ncols+j]);
+		for(j=0;j<nrows;j++) _printf_( " " << setw(11) << setprecision (5) << right << values[i*nrows+j]);
 		_printf_("\n");
 	}
@@ -393,29 +255,9 @@
 	if(gglobaldoflist) for(i=0;i<nrows;i++) _printf_(" " << gglobaldoflist[i]); _printf_("\n");
 
-	_printf_("   row_fsize: " << row_fsize << "\n");
-	_printf_("   row_flocaldoflist  (" << row_flocaldoflist << "): ");
-	if(row_flocaldoflist) for(i=0;i<row_fsize;i++) _printf_(" " << row_flocaldoflist[i] ); _printf_(" \n");
-	_printf_("   row_fglobaldoflist  (" << row_fglobaldoflist << "): ");
-	if(row_fglobaldoflist) for(i=0;i<row_fsize;i++)_printf_(" " << row_fglobaldoflist[i]); _printf_(" \n");
-
-	_printf_("   row_ssize: " << row_ssize << "\n");
-	_printf_("   row_slocaldoflist  (" << row_slocaldoflist << "): ");
-	if(row_slocaldoflist) for(i=0;i<row_ssize;i++) _printf_(" " << row_slocaldoflist[i] ); _printf_(" \n");
-	_printf_("   row_sglobaldoflist  (" << row_sglobaldoflist << "): ");
-	if(row_sglobaldoflist) for(i=0;i<row_ssize;i++)_printf_(" " << row_sglobaldoflist[i]); _printf_(" \n");
-
-	if(!dofsymmetrical){
-		_printf_("   col_fsize: " << col_fsize << "\n");
-		_printf_("   col_flocaldoflist  (" << col_flocaldoflist << "): ");
-		if(col_flocaldoflist) for(i=0;i<col_fsize;i++) _printf_(" " << col_flocaldoflist[i] ); _printf_(" \n");
-		_printf_("   col_fglobaldoflist  (" << col_fglobaldoflist << "): ");
-		if(col_fglobaldoflist) for(i=0;i<col_fsize;i++)_printf_(" " << col_fglobaldoflist[i]); _printf_(" \n");
-
-		_printf_("   col_ssize: " << col_ssize << "\n");
-		_printf_("   col_slocaldoflist  (" << col_slocaldoflist << "): ");
-		if(col_slocaldoflist) for(i=0;i<col_ssize;i++) _printf_(" " << col_slocaldoflist[i] ); _printf_(" \n");
-		_printf_("   col_sglobaldoflist  (" << col_sglobaldoflist << "): ");
-		if(col_sglobaldoflist) for(i=0;i<col_ssize;i++)_printf_(" " << col_sglobaldoflist[i]); _printf_(" \n");
-	}
+	_printf_("   fglobaldoflist  (" << fglobaldoflist << "): ");
+	for(i=0;i<nrows;i++)_printf_(" " << fglobaldoflist[i]); _printf_(" \n");
+
+	_printf_("   sglobaldoflist  (" << sglobaldoflist << "): ");
+	for(i=0;i<nrows;i++)_printf_(" " << sglobaldoflist[i]); _printf_(" \n");
 }
 /*}}}*/
@@ -426,71 +268,23 @@
 
 	this->nrows =Ke->nrows;
-	this->ncols =Ke->ncols;
-	this->dofsymmetrical=Ke->dofsymmetrical;
-
-	this->values=xNew<IssmDouble>(this->nrows*this->ncols);
-	xMemCpy<IssmDouble>(this->values,Ke->values,this->nrows*this->ncols);
+
+	this->values=xNew<IssmDouble>(this->nrows*this->nrows);
+	xMemCpy<IssmDouble>(this->values,Ke->values,this->nrows*this->nrows);
 
 	this->gglobaldoflist=xNew<int>(this->nrows);
 	xMemCpy<int>(this->gglobaldoflist,Ke->gglobaldoflist,this->nrows);
-
-	this->row_fsize=Ke->row_fsize;
-	if(this->row_fsize){
-		this->row_flocaldoflist=xNew<int>(this->row_fsize);
-		xMemCpy<int>(this->row_flocaldoflist,Ke->row_flocaldoflist,this->row_fsize);
-		this->row_fglobaldoflist=xNew<int>(this->row_fsize);
-		xMemCpy<int>(this->row_fglobaldoflist,Ke->row_fglobaldoflist,this->row_fsize);
-	}
-	else{
-		this->row_flocaldoflist=NULL;
-		this->row_fglobaldoflist=NULL;
-	}
-
-	this->row_ssize=Ke->row_ssize;
-	if(this->row_ssize){
-		this->row_slocaldoflist=xNew<int>(this->row_ssize);
-		xMemCpy<int>(this->row_slocaldoflist,Ke->row_slocaldoflist,this->row_ssize);
-		this->row_sglobaldoflist=xNew<int>(this->row_ssize);
-		xMemCpy<int>(this->row_sglobaldoflist,Ke->row_sglobaldoflist,this->row_ssize);
-	}
-	else{
-		this->row_slocaldoflist=NULL;
-		this->row_sglobaldoflist=NULL;
-	}
-
-	this->col_fsize=Ke->col_fsize;
-	if(this->col_fsize){
-		this->col_flocaldoflist=xNew<int>(this->col_fsize);
-		xMemCpy<int>(this->col_flocaldoflist,Ke->col_flocaldoflist,this->col_fsize);
-		this->col_fglobaldoflist=xNew<int>(this->col_fsize);
-		xMemCpy<int>(this->col_fglobaldoflist,Ke->col_fglobaldoflist,this->col_fsize);
-	}
-	else{
-		this->col_flocaldoflist=NULL;
-		this->col_fglobaldoflist=NULL;
-	}
-
-	this->col_ssize=Ke->col_ssize;
-	if(this->col_ssize){
-		this->col_slocaldoflist=xNew<int>(this->col_ssize);
-		xMemCpy<int>(this->col_slocaldoflist,Ke->col_slocaldoflist,this->col_ssize);
-		this->col_sglobaldoflist=xNew<int>(this->col_ssize);
-		xMemCpy<int>(this->col_sglobaldoflist,Ke->col_sglobaldoflist,this->col_ssize);
-	}
-	else{
-		this->col_slocaldoflist=NULL;
-		this->col_sglobaldoflist=NULL;
-	}
+	this->fglobaldoflist=xNew<int>(this->nrows);
+	xMemCpy<int>(this->fglobaldoflist,Ke->fglobaldoflist,this->nrows);
+	this->sglobaldoflist=xNew<int>(this->nrows);
+	xMemCpy<int>(this->sglobaldoflist,Ke->sglobaldoflist,this->nrows);
 }
 /*}}}*/
 void ElementMatrix::Lump(void){/*{{{*/
 
-	if(!dofsymmetrical) _error_("not supported yet");
-
 	for(int i=0;i<this->nrows;i++){
-		for(int j=0;j<this->ncols;j++){
+		for(int j=0;j<this->nrows;j++){
 			if(i!=j){
-				this->values[i*this->ncols+i] += this->values[i*this->ncols+j];
-				this->values[i*this->ncols+j]  = 0.;
+				this->values[i*this->nrows+i] += this->values[i*this->nrows+j];
+				this->values[i*this->nrows+j]  = 0.;
 			}
 		}
@@ -505,15 +299,6 @@
 	ElementMatrix* Ke_copy=new ElementMatrix(this);
 
-	/*Update sizes*/
-	this->nrows=Ke_copy->ncols;
-	this->ncols=Ke_copy->nrows;
-
 	/*Transpose values*/
-	for (int i=0;i<this->nrows;i++) for(int j=0;j<this->ncols;j++) this->values[i*this->ncols+j]=Ke_copy->values[j*Ke_copy->ncols+i];
-
-	/*Transpose indices*/
-	if(!dofsymmetrical){
-		_error_("not supported yet");
-	}
+	for (int i=0;i<this->nrows;i++) for(int j=0;j<this->nrows;j++) this->values[i*this->nrows+j]=Ke_copy->values[j*Ke_copy->nrows+i];
 
 	/*Clean up and return*/
@@ -540,5 +325,5 @@
 
 	/*Checks in debugging mode*/
-	_assert_(this->nrows==this->ncols && bsize>0 && bsize<this->ncols && this->values); 
+	_assert_(bsize>0 && bsize<this->nrows && this->values); 
 
 	/*Intermediaries*/
@@ -577,8 +362,8 @@
 	Kbi = xNew<IssmDouble>(bsize*isize);
 	Kbb = xNew<IssmDouble>(bsize*bsize);
-	for(i=0;i<isize;i++) for(j=0;j<isize;j++) Kii[i*isize+j] = this->values[iindices[i]*this->ncols + iindices[j]];
-	for(i=0;i<isize;i++) for(j=0;j<bsize;j++) Kib[i*bsize+j] = this->values[iindices[i]*this->ncols + bindices[j]];
-	for(i=0;i<bsize;i++) for(j=0;j<isize;j++) Kbi[i*isize+j] = this->values[bindices[i]*this->ncols + iindices[j]];
-	for(i=0;i<bsize;i++) for(j=0;j<bsize;j++) Kbb[i*bsize+j] = this->values[bindices[i]*this->ncols + bindices[j]];
+	for(i=0;i<isize;i++) for(j=0;j<isize;j++) Kii[i*isize+j] = this->values[iindices[i]*this->nrows + iindices[j]];
+	for(i=0;i<isize;i++) for(j=0;j<bsize;j++) Kib[i*bsize+j] = this->values[iindices[i]*this->nrows + bindices[j]];
+	for(i=0;i<bsize;i++) for(j=0;j<isize;j++) Kbi[i*isize+j] = this->values[bindices[i]*this->nrows + iindices[j]];
+	for(i=0;i<bsize;i++) for(j=0;j<bsize;j++) Kbb[i*bsize+j] = this->values[bindices[i]*this->nrows + bindices[j]];
 
 	/*Invert Kbb*/
@@ -607,8 +392,8 @@
 
 	/*Update matrix values*/
-	for(i=0;i<this->nrows*this->ncols;i++) this->values[i]=0.;
+	for(i=0;i<this->nrows*this->nrows;i++) this->values[i]=0.;
 	for(i=0;i<isize;i++){
 		for(j=0;j<isize;j++){
-			this->values[iindices[i]*this->ncols + iindices[j]] = Ktemp[i*isize+j];
+			this->values[iindices[i]*this->nrows + iindices[j]] = Ktemp[i*isize+j];
 		}
 	}
Index: /issm/trunk/src/c/classes/matrix/ElementMatrix.h
===================================================================
--- /issm/trunk/src/c/classes/matrix/ElementMatrix.h	(revision 26743)
+++ /issm/trunk/src/c/classes/matrix/ElementMatrix.h	(revision 26744)
@@ -19,33 +19,12 @@
 class ElementMatrix{
 
+	private:
+		int *gglobaldoflist;
+		int *fglobaldoflist;
+		int *sglobaldoflist;
+
 	public:
-
-		int      nrows;
-		int      ncols;
-		bool     dofsymmetrical;
-		IssmDouble*  values;
-
-		//gset
-		int*     gglobaldoflist;
-
-		/*row wise: */
-		//fset
-		int      row_fsize;
-		int*     row_flocaldoflist;
-		int*     row_fglobaldoflist;
-		//sset
-		int      row_ssize;
-		int*     row_slocaldoflist;
-		int*     row_sglobaldoflist;
-
-		/*column wise: */
-		//fset
-		int      col_fsize;
-		int*     col_flocaldoflist;
-		int*     col_fglobaldoflist;
-		//sset
-		int      col_ssize;
-		int*     col_slocaldoflist;
-		int*     col_sglobaldoflist;
+		int         nrows;
+		IssmDouble *values;
 
 		/*ElementMatrix constructors, destructors*/
Index: /issm/trunk/src/c/classes/matrix/ElementVector.cpp
===================================================================
--- /issm/trunk/src/c/classes/matrix/ElementVector.cpp	(revision 26743)
+++ /issm/trunk/src/c/classes/matrix/ElementVector.cpp	(revision 26744)
@@ -22,6 +22,4 @@
 	this->nrows=0;
 	this->values=NULL;
-	this->fsize=0;
-	this->flocaldoflist=NULL;
 	this->fglobaldoflist=NULL;
 
@@ -29,10 +27,4 @@
 /*}}}*/
 ElementVector::ElementVector(ElementVector* pe1, ElementVector* pe2){/*{{{*/
-
-	/*intermediaries*/
-	int i,j,counter;
-	int gsize,fsize;
-	int* P=NULL;
-	bool found;
 
 	/*If one of the two matrix is NULL, we copy the other one*/
@@ -50,11 +42,11 @@
 
 	/*Initialize itransformation matrix pe[P[i]] = pe2[i]*/
-	P=xNew<int>(pe2->nrows);
+	int* P=xNew<int>(pe2->nrows);
 
 	/*1: Get the new numbering of pe2 and get size of the new matrix*/
-	gsize=pe1->nrows;
-	for(i=0;i<pe2->nrows;i++){
-		found=false;
-		for(j=0;j<pe1->nrows;j++){
+	int gsize=pe1->nrows;
+	for(int i=0;i<pe2->nrows;i++){
+		bool found=false;
+		for(int j=0;j<pe1->nrows;j++){
 			if(pe2->gglobaldoflist[i]==pe1->gglobaldoflist[j]){
 				found=true; P[i]=j; break;
@@ -71,39 +63,15 @@
 	/*Gset and values*/
 	this->gglobaldoflist=xNew<int>(this->nrows);
+	this->fglobaldoflist=xNew<int>(this->nrows);
 	this->values=xNewZeroInit<IssmDouble>(this->nrows);
-	for(i=0;i<pe1->nrows;i++){
+	for(int i=0;i<pe1->nrows;i++){
 		this->values[i] += pe1->values[i];
 		this->gglobaldoflist[i]=pe1->gglobaldoflist[i];
-	}
-	for(i=0;i<pe2->nrows;i++){
+		this->fglobaldoflist[i]=pe1->fglobaldoflist[i];
+	}
+	for(int i=0;i<pe2->nrows;i++){
 		this->values[P[i]] += pe2->values[i];
 		this->gglobaldoflist[P[i]]=pe2->gglobaldoflist[i];
-	}
-
-	/*Fset*/
-	fsize=pe1->fsize;
-	for(i=0;i<pe2->fsize;i++){
-		if(P[pe2->flocaldoflist[i]] >= pe1->nrows) fsize++;
-	}
-	this->fsize=fsize;
-	if(fsize){
-		this->flocaldoflist =xNew<int>(fsize);
-		this->fglobaldoflist=xNew<int>(fsize);
-		for(i=0;i<pe1->fsize;i++){
-			this->flocaldoflist[i] =pe1->flocaldoflist[i];
-			this->fglobaldoflist[i]=pe1->fglobaldoflist[i];
-		}
-		counter=pe1->fsize;
-		for(i=0;i<pe2->fsize;i++){
-			if(P[pe2->flocaldoflist[i]] >= pe1->nrows){
-				this->flocaldoflist[counter] =P[pe2->flocaldoflist[i]];
-				this->fglobaldoflist[counter]=pe2->fglobaldoflist[i];
-				counter++;
-			}
-		}
-	}
-	else{
-		this->flocaldoflist=NULL;
-		this->fglobaldoflist=NULL;
+		this->fglobaldoflist[P[i]]=pe2->fglobaldoflist[i];
 	}
 
@@ -134,18 +102,12 @@
 	this->values=xNewZeroInit<IssmDouble>(this->nrows);
 
-	/*g list*/
+	/*dof list*/
 	this->gglobaldoflist=GetGlobalDofList(nodes,numnodes,GsetEnum,approximation);
-
-	/*Get fsize*/
-	this->fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
-	this->flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
 	this->fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
 }
 /*}}}*/
 ElementVector::~ElementVector(){/*{{{*/
-
 	xDelete<IssmDouble>(this->values);
 	xDelete<int>(this->gglobaldoflist);
-	xDelete<int>(this->flocaldoflist);
 	xDelete<int>(this->fglobaldoflist);
 }
@@ -155,21 +117,18 @@
 void ElementVector::AddToGlobal(Vector<IssmDouble>* pf){/*{{{*/
 
-	int i;
-	IssmDouble* localvalues=NULL;
-
 	/*In debugging mode, check consistency (no NaN, and values not too big)*/
 	this->CheckConsistency();
 
-	if(this->fsize){
-		/*first, retrieve values that are in the f-set from the g-set values vector: */
-		localvalues=xNew<IssmDouble>(this->fsize);
-		for(i=0;i<this->fsize;i++){
-			localvalues[i]=this->values[this->flocaldoflist[i]];
-		}
-		/*add local values into global  vector, using the fglobaldoflist: */
-		pf->SetValues(this->fsize,this->fglobaldoflist,localvalues,ADD_VAL);
-
-		/*Free ressources:*/
-		xDelete<IssmDouble>(localvalues);
+	/*do we have any component in the F set?*/
+	bool isfset= false;
+	for(int i=0;i<this->nrows;i++){
+		if(this->fglobaldoflist[i]>=0){
+			isfset = true;
+			break;
+		}
+	}
+
+	if(isfset){
+		pf->SetValues(this->nrows,this->fglobaldoflist,this->values,ADD_VAL);
 	}
 
@@ -194,7 +153,5 @@
 	_printf_("   nrows: " << nrows << "\n");
 	_printf_("   values:\n");
-	for(i=0;i<nrows;i++){
-		_printf_(setw(4) << right << i << ": " << setw(10) << values[i] << "\n");
-	}
+	for(i=0;i<nrows;i++) _printf_(setw(4) << right << i << ": " << setw(10) << values[i] << "\n");
 
 	_printf_("   gglobaldoflist (" << gglobaldoflist << "): ");
@@ -202,10 +159,6 @@
 	_printf_(" \n");
 
-	_printf_("   fsize: " << fsize << "\n");
-	_printf_("   flocaldoflist  (" << flocaldoflist << "): ");
-	if(flocaldoflist) for(i=0;i<fsize;i++) _printf_(" " << flocaldoflist[i] );
-	_printf_(" \n");
 	_printf_("   fglobaldoflist (" << fglobaldoflist << "): ");
-	if(fglobaldoflist) for(i=0;i<fsize;i++) _printf_(" " << fglobaldoflist[i] );
+	if(fglobaldoflist) for(i=0;i<nrows;i++) _printf_(" " << fglobaldoflist[i] );
 	_printf_(" \n");
 }
@@ -223,33 +176,22 @@
 	xMemCpy<int>(this->gglobaldoflist,pe->gglobaldoflist,this->nrows);
 
-	this->fsize=pe->fsize;
-	if(this->fsize){
-		this->flocaldoflist=xNew<int>(this->fsize);
-		xMemCpy<int>(this->flocaldoflist,pe->flocaldoflist,this->fsize);
-		this->fglobaldoflist=xNew<int>(this->fsize);
-		xMemCpy<int>(this->fglobaldoflist,pe->fglobaldoflist,this->fsize);
-	}
-	else{
-		this->flocaldoflist=NULL;
-		this->fglobaldoflist=NULL;
-	}
+	this->fglobaldoflist=xNew<int>(this->nrows);
+	xMemCpy<int>(this->fglobaldoflist,pe->fglobaldoflist,this->nrows);
 }
 /*}}}*/
 void ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){/*{{{*/
 
-	int i;
-	IssmDouble* localvalues=NULL;
-
-	if(this->fsize){
-		/*first, retrieve values that are in the f-set from the g-set values vector: */
-		localvalues=xNew<IssmDouble>(this->fsize);
-		for(i=0;i<this->fsize;i++){
-			localvalues[i]=this->values[this->flocaldoflist[i]];
-		}
+	/*do we have any component in the F set?*/
+	bool isfset= false;
+	for(int i=0;i<this->nrows;i++){
+		if(this->fglobaldoflist[i]>=0){
+			isfset = true;
+			break;
+		}
+	}
+
+	if(isfset){
 		/*add local values into global  vector, using the fglobaldoflist: */
-		pf->SetValues(this->fsize,this->fglobaldoflist,localvalues,INS_VAL);
-
-		/*Free ressources:*/
-		xDelete<IssmDouble>(localvalues);
+		pf->SetValues(this->nrows,this->fglobaldoflist,this->values,INS_VAL);
 	}
 
@@ -258,7 +200,5 @@
 void ElementVector::SetValue(IssmDouble scalar){/*{{{*/
 
-	int i;
-
-	for(i=0;i<this->nrows;i++)this->values[i]=scalar;
+	for(int i=0;i<this->nrows;i++)this->values[i]=scalar;
 
 }
@@ -283,5 +223,5 @@
 	/*Checks in debugging mode*/
 	_assert_(bsize>0 && bsize<this->nrows && this->values && Ke); 
-	_assert_(Ke->nrows==Ke->ncols && this->nrows==Ke->nrows);
+	_assert_(this->nrows==Ke->nrows);
 
 	/*Intermediaries*/
@@ -320,6 +260,6 @@
 	Fb  = xNew<IssmDouble>(bsize);
 	Fi  = xNew<IssmDouble>(isize);
-	for(i=0;i<isize;i++) for(j=0;j<bsize;j++) Kib[i*bsize+j] = Ke->values[iindices[i]*Ke->ncols + bindices[j]];
-	for(i=0;i<bsize;i++) for(j=0;j<bsize;j++) Kbb[i*bsize+j] = Ke->values[bindices[i]*Ke->ncols + bindices[j]];
+	for(i=0;i<isize;i++) for(j=0;j<bsize;j++) Kib[i*bsize+j] = Ke->values[iindices[i]*Ke->nrows + bindices[j]];
+	for(i=0;i<bsize;i++) for(j=0;j<bsize;j++) Kbb[i*bsize+j] = Ke->values[bindices[i]*Ke->nrows + bindices[j]];
 	for(i=0;i<bsize;i++) Fb[i] = this->values[bindices[i]];
 	for(i=0;i<isize;i++) Fi[i] = this->values[iindices[i]];
Index: /issm/trunk/src/c/classes/matrix/ElementVector.h
===================================================================
--- /issm/trunk/src/c/classes/matrix/ElementVector.h	(revision 26743)
+++ /issm/trunk/src/c/classes/matrix/ElementVector.h	(revision 26744)
@@ -20,15 +20,11 @@
 class ElementVector{
 
+	private:
+		int *gglobaldoflist;
+		int *fglobaldoflist;
+
 	public:
 		int         nrows;
-		IssmDouble* values;
-
-		//gset
-		int* gglobaldoflist;
-
-		//fset
-		int  fsize;
-		int* flocaldoflist;
-		int* fglobaldoflist;
+		IssmDouble *values;
 
 		/*ElementVector constructors, destructors*/
Index: /issm/trunk/src/c/cores/CorePointerFromSolutionEnum.cpp
===================================================================
--- /issm/trunk/src/c/cores/CorePointerFromSolutionEnum.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/CorePointerFromSolutionEnum.cpp	(revision 26744)
@@ -1,5 +1,5 @@
 /*!\file:  CorePointerFromSolutionEnum.cpp
  * \brief: return type of analyses, number of analyses and core solution function.
- */ 
+ */
 
 #ifdef HAVE_CONFIG_H
@@ -59,16 +59,9 @@
 			solutioncore=&masstransport_core;
 			break;
-		case SealevelriseSolutionEnum:
-			solutioncore=&sealevelchange_core;
+		case OceantransportSolutionEnum:
+			solutioncore=&oceantransport_core;
 			break;
 		case EsaSolutionEnum:
 			solutioncore=&esa_core;
-			break;
-		case GiaSolutionEnum:
-			#if _HAVE_GIA_
-			solutioncore=&gia_core;
-			#else
-			_error_("ISSM not compiled with Gia capability");
-			#endif
 			break;
 		case DamageEvolutionSolutionEnum:
@@ -82,4 +75,7 @@
 			#endif
 			break;
+		case SamplingSolutionEnum:
+			solutioncore=&sampling_core;
+			break;
 
 		default:
Index: /issm/trunk/src/c/cores/WrapperPreCorePointerFromSolutionEnum.cpp
===================================================================
--- /issm/trunk/src/c/cores/WrapperPreCorePointerFromSolutionEnum.cpp	(revision 26744)
+++ /issm/trunk/src/c/cores/WrapperPreCorePointerFromSolutionEnum.cpp	(revision 26744)
@@ -0,0 +1,34 @@
+/*!\file:  WrapperPreCorePointerFromSolutionEnum.cpp
+ * \brief: return solution core that is carried out once only for Dakota runs.
+ */ 
+
+#ifdef HAVE_CONFIG_H
+	#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+#include "./cores.h"
+#include "../toolkits/toolkits.h"
+#include "../classes/classes.h"
+#include "../shared/shared.h"
+#include "../modules/modules.h"
+#include "../solutionsequences/solutionsequences.h"
+
+void WrapperPreCorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype){
+
+	/*output: */
+	void (*solutioncore)(FemModel*)=NULL;
+
+	switch(solutiontype){
+
+		case TransientSolutionEnum:
+			solutioncore=&transient_precore;
+			break;
+		default:
+			break;
+	}
+
+	/*Assign output pointer:*/
+	*psolutioncore=solutioncore;
+
+}
Index: /issm/trunk/src/c/cores/ad_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/ad_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/ad_core.cpp	(revision 26744)
@@ -326,5 +326,12 @@
 
 			/*First, stop tracing: */
+			#if _CODIPACK_MAJOR_==2
+			auto& tape_codi = IssmDouble::getTape();
+			#elif _CODIPACK_MAJOR_==1
 			auto& tape_codi = IssmDouble::getGlobalTape();
+			#else
+			#error "_CODIPACK_MAJOR_ not supported"
+			#endif
+
 			tape_codi.setPassive();
 
Index: /issm/trunk/src/c/cores/adjointstressbalance_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/adjointstressbalance_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/adjointstressbalance_core.cpp	(revision 26744)
@@ -28,5 +28,5 @@
 	if(VerboseSolution()) _printf0_("   computing velocities\n");
 	femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
-	
+
 	bool is_schur_cg_solver = false;
 	#ifdef _HAVE_PETSC_
Index: /issm/trunk/src/c/cores/balancethickness_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/balancethickness_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/balancethickness_core.cpp	(revision 26744)
@@ -11,5 +11,4 @@
 
 void balancethickness_core(FemModel* femmodel){
-
 
 	/*recover parameters: */
Index: /issm/trunk/src/c/cores/control_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/control_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/control_core.cpp	(revision 26744)
@@ -143,5 +143,5 @@
 	/*Update control input*/
 	SetControlInputsFromVectorx(femmodel,X);
-	
+
 	/*solve forward: */
 	switch(solution_type){
@@ -152,5 +152,5 @@
 		case StressbalanceSolutionEnum:{
 			femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
-			
+
 			bool is_schur_cg_solver = false;
 			#ifdef _HAVE_PETSC_
@@ -159,5 +159,5 @@
 			if(solver_type==FSSolverEnum) is_schur_cg_solver = true;
 			#endif
-			
+
 			if(is_schur_cg_solver){
 			 solutionsequence_schurcg(femmodel);
@@ -249,8 +249,6 @@
 
 	/*Constrain Gradient*/
-	for(int i=0;i<num_controls;i++){
-		for(int j=0;j<numvertices;j++){
-			G[i*numvertices+j] = scalar*G[i*numvertices+j];
-		}
+	for(int i=0;i<nsize;i++){
+		G[i] = scalar*G[i];
 	}
 
Index: /issm/trunk/src/c/cores/controladm1qn3_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/controladm1qn3_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/controladm1qn3_core.cpp	(revision 26744)
@@ -14,4 +14,5 @@
 extern CoDi_global codi_global;
 #include <sstream> // for output of the CoDiPack tape
+#include <fenv.h>
 void transient_ad(FemModel* femmodel);
 #endif
@@ -75,5 +76,12 @@
 		 * -> These parameters are not read for the CoDiPack ISSM version!
 		 */
+		#if _CODIPACK_MAJOR_==2
+		auto& tape_codi = IssmDouble::getTape();
+		#elif _CODIPACK_MAJOR_==1
 		auto& tape_codi = IssmDouble::getGlobalTape();
+		#else
+		#error "_CODIPACK_MAJOR_ not supported"
+		#endif
+
 		tape_codi.setActive();
 		#if _AD_TAPE_ALLOC_
@@ -88,5 +96,5 @@
 		/*
 		std::stringstream out_s;
-		IssmDouble::getGlobalTape().printStatistics(out_s);
+		IssmDouble::getTape().printStatistics(out_s);
 		_printf0_("StartTrace::Tape Statistics	   : TapeAlloc count=[" << codi_allocn << "]\n" << out_s.str());
 		*/
@@ -153,5 +161,11 @@
 		#endif
 		std::stringstream out_s;
+		#if _CODIPACK_MAJOR_==2
+		IssmDouble::getTape().printStatistics(out_s);
+		#elif _CODIPACK_MAJOR_==1
 		IssmDouble::getGlobalTape().printStatistics(out_s);
+		#else
+		#error "_CODIPACK_MAJOR_ not supported"
+		#endif
 		_printf0_("CoDiPack Profiling::Tape Statistics :\n" << out_s.str());
 		#endif
@@ -159,5 +173,14 @@
 
 	#elif defined(_HAVE_CODIPACK_)
+
+	/*Get Tape*/
+	#if _CODIPACK_MAJOR_==2
+	auto& tape_codi = IssmDouble::getTape();
+	#elif _CODIPACK_MAJOR_==1
 	auto& tape_codi = IssmDouble::getGlobalTape();
+	#else
+	#error "_CODIPACK_MAJOR_ not supported"
+	#endif
+
 	tape_codi.setPassive();
 	if(VerboseAutodiff()){
@@ -239,5 +262,14 @@
 	}
 	#elif defined(_HAVE_CODIPACK_)
+
+	/*Get tape*/
+	#if _CODIPACK_MAJOR_==2
+	auto& tape_codi = IssmDouble::getTape();
+	#elif _CODIPACK_MAJOR_==1
 	auto& tape_codi = IssmDouble::getGlobalTape();
+	#else
+	#error "_CODIPACK_MAJOR_ not supported"
+	#endif
+
 	codi_global.input_indices.clear();
 	if(my_rank==0){
@@ -245,5 +277,12 @@
 			aX[i]=X[i];
 			tape_codi.registerInput(aX[i]);
+			#if _CODIPACK_MAJOR_==2
+			codi_global.input_indices.push_back(aX[i].getIdentifier());
+			#elif _CODIPACK_MAJOR_==1
 			codi_global.input_indices.push_back(aX[i].getGradientData());
+			#else
+			#error "_CODIPACK_MAJOR_ not supported"
+			#endif
+
 		}
 	}
@@ -285,5 +324,11 @@
 			tape_codi.registerOutput(output_value);
 			dependents[i] = output_value.getValue();
+			#if _CODIPACK_MAJOR_==2
+			codi_global.output_indices.push_back(output_value.getIdentifier());
+			#elif _CODIPACK_MAJOR_==1
 			codi_global.output_indices.push_back(output_value.getGradientData());
+			#else
+			#error "_CODIPACK_MAJOR_ not supported"
+			#endif
 
 			#elif defined(_HAVE_ADOLC_)
@@ -377,4 +422,6 @@
 			tape_codi.setGradient(codi_global.output_indices[dep_index],1.0);
 		}
+		//feclearexcept(FE_ALL_EXCEPT);
+		//feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
 		tape_codi.evaluate();
 
@@ -446,4 +493,5 @@
 	}
 	Gnorm = sqrt(Gnorm);
+	_assert_(!xIsNan(Gnorm));
 
 	/*Print info*/
@@ -453,4 +501,5 @@
 
 	/*Clean-up and return*/
+	if(solution_type == TransientSolutionEnum) delete femmodel;
 	*Jlisti = (*Jlisti) +1;
 	xDelete<double>(XU);
Index: /issm/trunk/src/c/cores/controlvalidation_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/controlvalidation_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/controlvalidation_core.cpp	(revision 26744)
@@ -50,5 +50,12 @@
 		 * -> These parameters are not read for the CoDiPack ISSM version!
 		 */
+		#if _CODIPACK_MAJOR_==2
+		auto& tape_codi = IssmDouble::getTape();
+		#elif _CODIPACK_MAJOR_==1
 		auto& tape_codi = IssmDouble::getGlobalTape();
+		#else
+		#error "_CODIPACK_MAJOR_ not supported"
+		#endif
+
 		tape_codi.setActive();
 		#if _AD_TAPE_ALLOC_
@@ -63,5 +70,5 @@
 		/*
 		std::stringstream out_s;
-		IssmDouble::getGlobalTape().printStatistics(out_s);
+		IssmDouble::getTape().printStatistics(out_s);
 		_printf0_("StartTrace::Tape Statistics	   : TapeAlloc count=[" << codi_allocn << "]\n" << out_s.str());
 		*/
@@ -127,5 +134,11 @@
 		#endif
 		std::stringstream out_s;
+		#if _CODIPACK_MAJOR_==2
+		IssmDouble::getTape().printStatistics(out_s);
+		#elif _CODIPACK_MAJOR_==1
 		IssmDouble::getGlobalTape().printStatistics(out_s);
+		#else
+		#error "_CODIPACK_MAJOR_ not supported"
+		#endif
 		_printf0_("CoDiPack Profiling::Tape Statistics :\n" << out_s.str());
 		#endif
@@ -133,5 +146,13 @@
 
 	#elif defined(_HAVE_CODIPACK_)
+
+	#if _CODIPACK_MAJOR_==2
+	auto& tape_codi = IssmDouble::getTape();
+	#elif _CODIPACK_MAJOR_==1
 	auto& tape_codi = IssmDouble::getGlobalTape();
+	#else
+	#error "_CODIPACK_MAJOR_ not supported"
+	#endif
+
 	tape_codi.setPassive();
 	if(VerboseAutodiff()){
@@ -188,7 +209,16 @@
 	/*}}}*/
 	#elif defined(_HAVE_CODIPACK_)
+	/*{{{*/
 	simul_starttrace2(femmodel);
 	IssmDouble* aX=xNew<IssmDouble>(n);
+
+	#if _CODIPACK_MAJOR_==2
+	auto& tape_codi = IssmDouble::getTape();
+	#elif _CODIPACK_MAJOR_==1
 	auto& tape_codi = IssmDouble::getGlobalTape();
+	#else
+	#error "_CODIPACK_MAJOR_ not supported"
+	#endif
+
 	codi_global.input_indices.clear();
 	if(my_rank==0){
@@ -196,5 +226,12 @@
 			aX[i]=X0[i];
 			tape_codi.registerInput(aX[i]);
+			#if _CODIPACK_MAJOR_==2
+			codi_global.input_indices.push_back(aX[i].getIdentifier());
+			#elif _CODIPACK_MAJOR_==1
 			codi_global.input_indices.push_back(aX[i].getGradientData());
+			#else
+			#error "_CODIPACK_MAJOR_ not supported"
+			#endif
+
 		}
 	}
@@ -230,5 +267,12 @@
 			tape_codi.registerOutput(output_value);
 			dependents[i] = output_value.getValue();
+			#if _CODIPACK_MAJOR_==2
+			codi_global.output_indices.push_back(output_value.getIdentifier());
+			#elif _CODIPACK_MAJOR_==1
 			codi_global.output_indices.push_back(output_value.getGradientData());
+			#else
+			#error "_CODIPACK_MAJOR_ not supported"
+			#endif
+
 			J+=output_value;
 		}
@@ -252,5 +296,5 @@
 	/*Clear tape*/
 	tape_codi.reset();
-
+/*}}}*/
 	#else
 	/*{{{*/
Index: /issm/trunk/src/c/cores/cores.h
===================================================================
--- /issm/trunk/src/c/cores/cores.h	(revision 26743)
+++ /issm/trunk/src/c/cores/cores.h	(revision 26744)
@@ -1,4 +1,4 @@
 /*
- * cores.h: 
+ * cores.h:
  */
 
@@ -9,5 +9,5 @@
 class FemModel;
 class Parameters;
-class SealevelMasks;
+class SealevelGeometry;
 template <class doubletype> class Matrix;
 template <class doubletype> class Vector;
@@ -35,4 +35,5 @@
 void controlvalidation_core(FemModel* femmodel);
 void masstransport_core(FemModel* femmodel);
+void oceantransport_core(FemModel* femmodel);
 void depthaverage_core(FemModel* femmodel);
 void extrudefrombase_core(FemModel* femmodel);
@@ -44,4 +45,5 @@
 void steadystate_core(FemModel* femmodel);
 void transient_core(FemModel* femmodel);
+void transient_precore(FemModel* femmodel);
 void dakota_core(FemModel* femmodel);
 void ad_core(FemModel* femmodel);
@@ -54,21 +56,21 @@
 void bmb_core(FemModel* femmodel);
 void damage_core(FemModel* femmodel);
+void sampling_core(FemModel* femmodel);
+
+/*sealevel change cores:*/
+#ifdef _HAVE_SEALEVELCHANGE_
 void sealevelchange_core(FemModel* femmodel);
-void grd_core(FemModel* femmodel);
+void sealevelchange_initialgeometry(FemModel* femmodel);
+SealevelGeometry* sealevelchange_geometry(FemModel* femmodel);
+#endif
+void grd_core(FemModel* femmodel,SealevelGeometry* slgeom);
+void solidearthexternal_core(FemModel* femmodel);
 void dynstr_core(FemModel* femmodel);
-void sealevelrise_core_geometry(FemModel* femmodel);
-SealevelMasks* sealevelrise_core_masks(FemModel* femmodel);
-Vector<IssmDouble>* sealevelrise_core_eustatic(FemModel* femmodel,SealevelMasks* mask, IssmDouble* poceanarea);
-Vector<IssmDouble>* sealevelrise_core_noneustatic(FemModel* femmodel,SealevelMasks* masks, Vector<IssmDouble>* RSLg_eustatic,IssmDouble oceanarea);
-void sealevelrise_core_elastic(Vector<IssmDouble>** pU_radial, Vector<IssmDouble>** pU_north,Vector<IssmDouble>** pU_east,FemModel* femmodel,Vector<IssmDouble>* RSLg, SealevelMasks* masks);
-void sealevelrise_core_viscous(Vector<IssmDouble>** pU_gia,Vector<IssmDouble>** pN_gia,FemModel*  femmodel,Vector<IssmDouble>* RSLg);
-void sealevelrise_diagnostics(FemModel* femmodel,Vector<IssmDouble>* RSLg);
-IssmDouble objectivefunction(IssmDouble search_scalar,FemModel* femmodel);
-void GetStericRate(Vector<IssmDouble> ** psteric_rate_g, FemModel* femmodel);
-void GetDynamicRate(Vector<IssmDouble> ** pdynamic_rate_g, FemModel* femmodel);
-void SetBottomPressure(FemModel* femmodel);
+void couplerinput_core(FemModel* femmodel);
+void coupleroutput_core(FemModel* femmodel);
 
 //optimization
 int GradJSearch(IssmDouble* search_vector,FemModel* femmodel,int step);
+IssmDouble objectivefunction(IssmDouble search_scalar,FemModel* femmodel);
 
 //diverse
@@ -77,12 +79,10 @@
 void ResetBoundaryConditions(FemModel* femmodel, int analysis_type);
 void PrintBanner(void);
-void TransferForcing(FemModel* femmodel,int forcingenum);
-void TransferSealevel(FemModel* femmodel,int forcingenum);
 void EarthMassTransport(FemModel* femmodel);
-void slrconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs);
 
 //solution configuration
 void CorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype);
 void WrapperCorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype,bool nodakotacore=false);
+void WrapperPreCorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype);
 void AdjointCorePointerFromSolutionEnum(void (**padjointcore)(FemModel*),int solutiontype);
 
Index: /issm/trunk/src/c/cores/dakota_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/dakota_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/dakota_core.cpp	(revision 26744)
@@ -227,5 +227,5 @@
 	if(VerboseQmu()) _printf0_("outputing results for this core:\n");
 	OutputResultsx(femmodel);
-	
+
 	/*Free ressources:*/
 	DakotaFree(&d_variables,&d_variables_descriptors,&responses_descriptors, d_numvariables, numresponsedescriptors);
Index: /issm/trunk/src/c/cores/depthaverage_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/depthaverage_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/depthaverage_core.cpp	(revision 26744)
@@ -23,5 +23,5 @@
 
 	/*If this is a 2D horizontal domain: no need to do anything, just copy input*/
-	if(domaintype==Domain2DhorizontalEnum){
+	if(domaintype==Domain2DhorizontalEnum || domaintype==Domain3DsurfaceEnum){
 		InputDuplicatex(femmodel,inputenum,input_average_enum);
 		return;
Index: /issm/trunk/src/c/cores/esa_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/esa_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/esa_core.cpp	(revision 26744)
@@ -20,5 +20,6 @@
 	Vector<IssmDouble> *U_x   = NULL; 
 	Vector<IssmDouble> *U_y    = NULL; 
-	bool save_results,isesa,iscoupler;
+	bool save_results,isesa;
+	int iscoupler;
 	int domaintype;
 	int solution_type;
@@ -41,5 +42,5 @@
 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
 	femmodel->parameters->FindParam(&isesa,TransientIsesaEnum);
-	femmodel->parameters->FindParam(&iscoupler,TransientIscouplerEnum);
+	femmodel->parameters->FindParam(&iscoupler,IsSlcCouplingEnum);
 
 	/* recover coordinates of vertices: */
@@ -113,5 +114,5 @@
 		if(numoutputs){for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);}
 	}
-	
+
 	/*End profiler*/
 	femmodel->profiler->Stop(ESACORE);
Index: /issm/trunk/src/c/cores/extrudefrombase_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/extrudefrombase_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/extrudefrombase_core.cpp	(revision 26744)
@@ -21,4 +21,5 @@
 	/*If this is a 2D horizontal domain, return (no need to extrude)*/
 	if(domaintype==Domain2DhorizontalEnum) return;
+	if(domaintype==Domain3DsurfaceEnum) return;
 
 	int inputenum;
Index: /issm/trunk/src/c/cores/extrudefromtop_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/extrudefromtop_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/extrudefromtop_core.cpp	(revision 26744)
@@ -23,4 +23,5 @@
 	/*If this is a 2D horizontal domain, return (no need to extrude)*/
 	if(domaintype==Domain2DhorizontalEnum) return;
+	if(domaintype==Domain3DsurfaceEnum) return;
 
 	/*Special method for Penta, otherwise call solution sequence*/
Index: sm/trunk/src/c/cores/gia_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/gia_core.cpp	(revision 26743)
+++ 	(revision )
@@ -1,94 +1,0 @@
-/*!\file: gia_core.cpp
- * \brief: core of the GIA solution 
- */ 
-
-#include "./cores.h"
-#include "../toolkits/toolkits.h"
-#include "../classes/classes.h"
-#include "../classes/Inputs/TriaInput.h"
-#include "../classes/Inputs/DatasetInput.h"
-#include "../shared/shared.h"
-#include "../modules/modules.h"
-#include "../solutionsequences/solutionsequences.h"
-void gia_core(FemModel* femmodel){
-
-	Vector<IssmDouble> *wg    = NULL;
-	Vector<IssmDouble> *dwdtg = NULL;
-	IssmDouble          *x    = NULL;
-	IssmDouble          *y    = NULL;
-	int nummodels,giamodel;
-	IssmDouble modelid; 
-
-	/*parameters: */
-	bool save_results;
-	int  gsize;
-	
-	/*Start profiler*/
-	femmodel->profiler->Start(GIACORE);
-
-	/*Recover some parameters: */
-	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
-
-	if(VerboseSolution()) _printf0_("   computing GIA\n");
-
-	/*Call on core computations: */
-	femmodel->SetCurrentConfiguration(GiaAnalysisEnum);
-
-	/*Figure out type of gia model:*/
-	femmodel->parameters->FindParam(&giamodel,GiaModelEnum);
-
-	if(giamodel==1){ //GiaIvins
-		/*Figure out size of g-set deflection vector and allocate solution vector: */
-		gsize      = femmodel->nodes->NumberOfDofs(GsetEnum);
-		wg = new Vector<IssmDouble>(gsize);
-		dwdtg = new Vector<IssmDouble>(gsize);
-
-		/*first, recover x and y vectors from vertices: */
-		VertexCoordinatesx(&x,&y,NULL,femmodel->vertices); //no need for z coordinate
-
-		/*call the main module: */
-		femmodel->Deflection(wg,dwdtg,x,y);
-
-		/*assemble vector: */
-		wg->Assemble();
-		dwdtg->Assemble();
-
-		InputUpdateFromVectorx(femmodel,wg,UGiaEnum,VertexSIdEnum);
-		InputUpdateFromVectorx(femmodel,dwdtg,UGiaRateEnum,VertexSIdEnum);
-
-		if(save_results){
-			int outputs[2] = {UGiaEnum,UGiaRateEnum};
-			femmodel->RequestedOutputsx(&femmodel->results,&outputs[0],2);
-		}
-
-		xDelete<IssmDouble>(x);
-		xDelete<IssmDouble>(y);
-	}
-	else if(giamodel==2){ //GiaCaron
-		/*not implemneted yet*/
-	}
-	else if(giamodel==3){ //GiaMme
-		
-		/*Go grab the values for Ngia and Ugia in the offline GiaMme class:*/ 
-		femmodel->parameters->FindParam(&modelid,GiaModelidEnum); 
-		modelid--; //from matlab
-
-		/*find the Ngia and Ugia dataset:*/
-		DatasetInput* dataset_input_ngia=femmodel->inputs->GetDatasetInput(GiaMmeNgiaEnum);
-		DatasetInput* dataset_input_ugia=femmodel->inputs->GetDatasetInput(GiaMmeUgiaEnum);
-		/*Go find the modelid'th input:*/
-		TriaInput* tria_input_ngia=dataset_input_ngia->GetTriaInputByOffset(modelid);
-		TriaInput* tria_input_ugia=dataset_input_ugia->GetTriaInputByOffset(modelid);
-
-		/*Plug into SealevelUGiaRate and SealevelNGiaRate inputs:*/
-		Input* tria_input_copy_ngia=tria_input_ngia->copy();
-		Input* tria_input_copy_ugia=tria_input_ugia->copy();
-		tria_input_copy_ngia->ChangeEnum(NGiaRateEnum);
-		tria_input_copy_ugia->ChangeEnum(UGiaRateEnum);
-		femmodel->inputs->AddInput(tria_input_copy_ngia);
-		femmodel->inputs->AddInput(tria_input_copy_ugia);
-	}
-	
-	/*End profiler*/
-	femmodel->profiler->Stop(GIACORE);
-}
Index: /issm/trunk/src/c/cores/hydrology_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/hydrology_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/hydrology_core.cpp	(revision 26744)
@@ -9,6 +9,7 @@
 #include "../modules/modules.h"
 #include "../solutionsequences/solutionsequences.h"
-
-void hydrology_core(FemModel* femmodel){
+void SolidEarthWaterUpdates(FemModel* femmodel);
+
+void hydrology_core(FemModel* femmodel){ /*{{{*/
 
 	/*Start profiler*/
@@ -43,4 +44,27 @@
 		/*transfer water column thickness to old water column thickness: */
 		InputDuplicatex(femmodel,WatercolumnEnum,WaterColumnOldEnum);
+		/*solid earth considerations:*/
+		SolidEarthWaterUpdates(femmodel);
+
+	}
+	/*Using the Tws based Model*/
+	if (hydrology_model==HydrologyTwsEnum){
+		if(VerboseSolution()) _printf0_("   computing water column\n");
+
+		femmodel->SetCurrentConfiguration(HydrologyTwsAnalysisEnum);
+
+		/*save current tws  before updating:*/
+		InputDuplicatex(femmodel,WatercolumnEnum,WaterColumnOldEnum);
+
+		/*grab tws from the hydrology.spcwatercolumn field input and update 
+		 * the solution with it:*/
+		Vector<IssmDouble>*  ug  = NULL;
+		GetVectorFromInputsx(&ug,femmodel,HydrologyTwsSpcEnum,VertexPIdEnum);
+		InputUpdateFromSolutionx(femmodel,ug); 
+
+		/*solid earth considerations:*/
+		SolidEarthWaterUpdates(femmodel);
+
+		delete ug;
 
 	}
@@ -147,9 +171,28 @@
 	/*Using the SHAKTI model*/
 	else if (hydrology_model==HydrologyshaktiEnum){
+
+		/*Get second derivatives of gap height*/
+		femmodel->SetCurrentConfiguration(L2ProjectionBaseAnalysisEnum);
+		femmodel->parameters->SetParam(HydrologyGapHeightXEnum,InputToL2ProjectEnum);
+		solutionsequence_linear(femmodel);
+		femmodel->parameters->SetParam(HydrologyGapHeightYEnum,InputToL2ProjectEnum);
+		solutionsequence_linear(femmodel);
+		femmodel->parameters->SetParam(HydrologyGapHeightXXEnum,InputToL2ProjectEnum);
+		solutionsequence_linear(femmodel);
+		femmodel->parameters->SetParam(HydrologyGapHeightYYEnum,InputToL2ProjectEnum);
+		solutionsequence_linear(femmodel);
+
+		/*Update Effective pressure*/
+		if(VerboseSolution()) _printf0_("   computing effective pressure\n");
+		HydrologyShaktiAnalysis* analysis = new HydrologyShaktiAnalysis();
+		analysis->UpdateEffectivePressure(femmodel);
+
+		/*Get new head*/
 		femmodel->SetCurrentConfiguration(HydrologyShaktiAnalysisEnum);
 		InputDuplicatex(femmodel,HydrologyHeadEnum,HydrologyHeadOldEnum);
 		solutionsequence_shakti_nonlinear(femmodel);
+
+		/*Update Gap Height*/
 		if(VerboseSolution()) _printf0_("   updating gap height\n");
-		HydrologyShaktiAnalysis* analysis = new HydrologyShaktiAnalysis();
 		analysis->UpdateGapHeight(femmodel);
 		delete analysis;
@@ -202,3 +245,31 @@
 	/*End profiler*/
 	femmodel->profiler->Stop(HYDROLOGYCORE);
-}
+} /*}}}*/
+void SolidEarthWaterUpdates(FemModel* femmodel){ /*{{{*/
+
+	int isgrd;
+	int grdmodel;
+	IssmDouble time;
+	int frequency,count;
+
+	/*retrieve parameters:*/
+	femmodel->parameters->FindParam(&isgrd,SolidearthSettingsGRDEnum);
+	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+	femmodel->parameters->FindParam(&time,TimeEnum);
+	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
+
+	/*early return?:*/
+	if(!isgrd)return;
+
+	/*From old and new thickness, create delta thickness  and accumulate:*/
+	femmodel->inputs->ZAXPY(-1, WaterColumnOldEnum,WatercolumnEnum,DeltaTwsEnum);
+	femmodel->inputs->AXPY(+1, DeltaTwsEnum,AccumulatedDeltaTwsEnum);
+
+	/*compute total water column change between two sea-level solver time steps, ie. every frequency*dt:*/
+	if(count==frequency){
+		femmodel->inputs->ZAXPY(-1, OldAccumulatedDeltaTwsEnum,AccumulatedDeltaTwsEnum,DeltaTwsEnum);
+		femmodel->inputs->DuplicateInput(AccumulatedDeltaTwsEnum,OldAccumulatedDeltaTwsEnum);
+	}
+	return;
+}/*}}}*/
Index: /issm/trunk/src/c/cores/love_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/love_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/love_core.cpp	(revision 26744)
@@ -9,90 +9,1274 @@
 #include "../modules/modules.h"
 #include "../solutionsequences/solutionsequences.h"
-void love_core(FemModel* femmodel){
-
-	Vector<IssmDouble> *wg    = NULL;
-	Vector<IssmDouble> *dwdtg = NULL;
-	IssmDouble          *x    = NULL;
-	IssmDouble          *y    = NULL;
-
-	/*love parameters: */
+#include "petscblaslapack.h"
+
+/*local definitions:*/
+class LoveVariables{  /*{{{*/
+
+	public: 
+		IssmDouble g0; 
+		IssmDouble r0;
+		IssmDouble* EarthMass; 
+		int nyi; 
+		int starting_layer;
+
+		LoveVariables(){  /*{{{*/
+			g0=0;
+			r0=0;
+			EarthMass=NULL;
+			nyi=0;
+			starting_layer=0;
+		} /*}}}*/
+		LoveVariables(IssmDouble* EarthMassin,IssmDouble g0in,IssmDouble r0in,int nyiin,int starting_layerin){  /*{{{*/
+			EarthMass=EarthMassin;
+			g0=g0in;
+			r0=r0in;
+			nyi=nyiin;
+			starting_layer=starting_layerin;
+		} /*}}}*/
+		~LoveVariables(){};
+}; /*}}}*/
+
+/*self contained support routines used by cores below:*/
+template<typename doubletype> doubletype                 angular_frequency(IssmDouble frequency); //pure declaration
+template <> IssmDouble                     angular_frequency<IssmDouble>(IssmDouble frequency){ /*{{{*/
+	return 2.0*PI*frequency;
+} /*}}}*/
+template <> IssmComplex                    angular_frequency<IssmComplex>(IssmDouble frequency){ /*{{{*/
+	IssmComplex value=reCast<IssmComplex>(complex<double>(0,1))*2.0*PI*reCast<IssmComplex>(frequency);
+	return value;
+} /*}}}*/
+template<typename doubletype> void                       allgesv(int* pnyi, int* pnrhs, doubletype* yilocal, int* plda, int* ipiv, doubletype* rhslocal, int* pldb, int* pinfo);
+template <> void                           allgesv<IssmDouble>(int* pnyi, int* pnrhs, IssmDouble* yilocal, int* plda, int* ipiv, IssmDouble* rhslocal, int* pldb, int* pinfo){ /*{{{*/
+	dgesv_(pnyi, pnrhs, yilocal, plda, ipiv, rhslocal, pldb, pinfo);
+} /*}}}*/
+template <> void                           allgesv<IssmComplex>(int* pnyi, int* pnrhs, IssmComplex* yilocal, int* plda, int* ipiv, IssmComplex* rhslocal, int* pldb, int* pinfo){ /*{{{*/
+	_error_("zgesv_ not linked correctly yet! ");
+	//zgesv_(pnyi, pnrhs, yilocal, plda, ipiv, rhslocal, pldb, pinfo);
+} /*}}}*/
+template<typename doubletype> doubletype   factorial(int n){ /*{{{*/
+	doubletype prod=1;
+	for (int i=2;i<n+1;i++) prod*=i;
+	return prod;
+}/*}}}*/
+template<typename doubletype> doubletype   n_C_r(int n, int r){ /*{{{*/ 
+	//n choose r
+	int primes[169] = 
+	{2,    3,    5,    7,   11,   13,   17,   19,   23,   29,  
+		31,   37,   41,   43,   47,   53,   59,   61,   67,   71,  
+		73,   79,   83,   89,   97,  101,  103,  107,  109,  113,  
+		127,  131,  137,  139,  149,  151,  157,  163,  167,  173,  
+		179,  181,  191,  193,  197,  199,  211,  223,  227,  229,  
+		233,  239,  241,  251,  257,  263,  269,  271,  277,  281,  
+		283,  293,  307,  311,  313,  317,  331,  337,  347,  349,  
+		353,  359,  367,  373,  379,  383,  389,  397,  401,  409,  
+		419,  421,  431,  433,  439,  443,  449,  457,  461,  463,  
+		467,  479,  487,  491,  499,  503,  509,  521,  523,  541,  
+		547,  557,  563,  569,  571,  577,  587,  593,  599,  601,  
+		607,  613,  617,  619,  631,  641,  643,  647,  653,  659,  
+		661,  673,  677,  683,  691,  701,  709,  719,  727,  733,  
+		739,  743,  751,  757,  761,  769,  773,  787,  797,  809,  
+		811,  821,  823,  827,  829,  839,  853,  857,  859,  863,  
+		877,  881,  883,  887,  907,  911,  919,  929,  937,  941,  
+		947,  953,  967,  971,  977,  983,  991,  997, 1009};
+	int num, den;
+	num = 1;
+	den = 1;
+
+	for (int i=0;i<r;i++){
+		num = num*(n-i);
+		den = den*(i+1);
+		if (i>0) {
+			// Divide out common prime factors
+			for (int k=0;k<169;k++){ //169 is the length of the prime vector here
+				if ( i % primes[k] == 0) { // modulo
+					num = num/primes[k];
+					den = den/primes[k];
+				}
+			}
+		}
+	}
+
+	doubletype res;        
+	return res = num/den;
+}/*}}}*/
+template<typename doubletype> doubletype*  postwidder_coef(int NTit){ /*{{{*/
+	//Coefficients of the Post-Widder method through Saltzer summation for inverse Laplace transform:
+	//The Mth iteration estimate will be: f(t)_M = sum_{k=1:2*M}(xi_[M,k] * f(s_k))
+	//The method is based on equations (2), (6), (7) in: 
+	//Valko PP, Abate J. Comparison of sequence accelerators for the Gaver method of numerical Laplace transform inversion. Computational Mathematics and Applications. (2004)
+	//Note that the coefficients xi lack the factor s=k*log(2)/t. 
+	//That is because we are computing the heaviside response of the system rather than its impulse response, 
+	//and Laplace_Transform(Heaviside(t).*f(t)) = f(s)/s. So s cancels out in the sum for f(t)_M.
+
+	doubletype* xi=xNewZeroInit<doubletype>(2*NTit*NTit);
+	int indxi;
+	for (int M=1;M<NTit+1;M++){
+		for (int k=1;k<2*M+1;k++){
+			indxi=(M-1)*(2*NTit)+k-1;
+			for (int j=floor((k+1)/2);j<min(k,M)+1;j++){
+				xi[indxi]+=pow(j,M+1.0)/factorial<doubletype>(M)*n_C_r<doubletype>(M,j)*n_C_r<doubletype>(2*j,j)*n_C_r<doubletype>(j,k-j);
+			}
+			xi[indxi]*=pow(-1.0,k+M)/k;
+		}
+	}
+	return xi;
+}/*}}}*/
+template<typename doubletype> void         postwidder_transform(doubletype* Lovet, doubletype* Lovef,int d, int t, int NTit, doubletype* xi, FemModel* femmodel){ /*{{{*/
+	//Computes Lovet for time step t and degree d from the PW coefficients xi and the corresponding 2*NTit frequency samples in Lovef
+
+	int nfreq, indxi, indf;
+	femmodel->parameters->FindParam(&nfreq,LoveNfreqEnum);
+	int nt=nfreq/2/NTit;
+
+	indf=d*nfreq+t*2*NTit;
+	doubletype* LoveM = xNew<doubletype>(NTit);
+
+	for (int M=1;M<NTit+1;M++){
+		LoveM[M-1]=0.0;
+		for (int k=1;k<2*M+1;k++){
+			indxi=(M-1)*(2*NTit)+k-1;
+			LoveM[M-1]+=xi[indxi]*Lovef[indf+k-1];
+		}
+
+		//Make sure we are not getting into numerical instability
+		//Diverging once: ok, we'll give that the benefit of the doubt, it can be an inflexion point in the convergence series
+		//Diverging twice in a row: we are definitely propagating numerical error: revert to the last stable value and exit
+		if (M>3){ 
+			if ( abs(LoveM[M-1]-LoveM[M-2]) > abs(LoveM[M-2]-LoveM[M-3]) &&
+					abs(LoveM[M-2]-LoveM[M-3]) > abs(LoveM[M-3]-LoveM[M-4]) ){
+				Lovet[d*nt+t]=LoveM[M-3];
+				return;
+			}
+		}
+	}
+	Lovet[d*nt+t]=LoveM[NTit-1];
+}/*}}}*/
+template <typename doubletype> void        GetEarthRheology(doubletype* pla, doubletype* pmu, int layer_index, doubletype omega,  Matlitho* matlitho){ /*{{{*/
+
+	//returns lame parameters (material rigity) lambda and mu for the right frequency and layer
+	doubletype mu,la;
+
+	IssmDouble vi=matlitho->viscosity[layer_index];
+	IssmDouble mu0=matlitho->lame_mu[layer_index];
+	IssmDouble la0=matlitho->lame_lambda[layer_index];
+	int rheo=matlitho->rheologymodel[layer_index];
+
+	if (vi!=0 && omega!=0.0){ //take into account viscosity in the rigidity if the material isn't a perfect fluid
+		IssmDouble ka=la0 + 2.0/3.0*mu0; //Bulk modulus
+		if (rheo==2){//EBM
+			IssmDouble alpha=matlitho->ebm_alpha[layer_index];
+			IssmDouble delta=matlitho->ebm_delta[layer_index];
+			IssmDouble taul=matlitho->ebm_taul[layer_index];
+			IssmDouble tauh=matlitho->ebm_tauh[layer_index];
+			IssmDouble hf1,hf2;
+			doubletype U1,U2;
+			IssmDouble* a=xNew<IssmDouble>(2);
+			IssmDouble* b=xNew<IssmDouble>(1);
+
+			a[0]=1.0;a[1]=1.0+alpha/2.0;
+			b[0]=2.0+alpha/2.0;
+			//hf1=HypergeometricFunctionx(a, b, 2, 1, -pow(omega*tauh,2.0), 0, 0, 15);
+			//hf2=HypergeometricFunctionx(a, b, 2, 1, -pow(omega*taul,2.0), 0, 0, 15);
+			//hf1=hypergeometric_pFq({a[0], a[1]}, {b[0]},-pow(omega*tauh,2.0));
+			//hf2=hypergeometric_pFq_({a[0], a[1]}, {b[0]},-pow(omega*taul,2.0));
+			U1=(pow(tauh,alpha)-pow(taul,alpha))/alpha-pow(omega,2.0)/(2.0+alpha)*(pow(tauh,2.0+alpha)*hf1-pow(taul,2.0+alpha)*hf2);
+
+			a[0]=1.0;a[1]=.5+alpha/2.0;
+			b[0]=1.5+alpha/2.0;
+			//hf1=HypergeometricFunctionx(a, b, 2, 1, -pow(omega*tauh,2.0), 0, 0, 15);
+			//hf2=HypergeometricFunctionx(a, b, 2, 1, -pow(omega*taul,2.0), 0, 0, 15);
+			//hf1=hypergeometric_pFq({a[0], a[1]}, {b[0]},-pow(omega*tauh,2.0));
+			//hf2=hypergeometric_pFq({a[0], a[1]}, {b[0]},-pow(omega*taul,2.0));
+			U2=(pow(tauh,1.0+alpha)*hf1-pow(taul,1.0+alpha)*hf2)/(1.0+alpha);
+
+			mu=mu/(1.0+ alpha*delta/(pow(tauh,alpha)-pow(taul,alpha))*(U1 + omega*U2) -mu/vi/omega);
+			la=ka-2.0/3.0*mu;
+
+			xDelete<IssmDouble>(a);
+			xDelete<IssmDouble>(b);
+		} 
+		else if (rheo==1){//Burgers
+			IssmDouble vi2=matlitho->burgers_viscosity[layer_index];
+			IssmDouble mu2=matlitho->burgers_mu[layer_index];
+
+			mu=mu0*omega*(omega+mu2/vi2)/((omega+mu2/vi2)*(omega+mu0/vi)+mu0/vi2*omega);
+			la=ka-2.0/3.0*mu;
+		}
+		else{//Maxwell
+			la = (la0 + mu0*ka/vi/omega)/(1.0 + mu0/vi/omega);
+			mu = mu0/(1.0+mu0/vi/omega);
+		}
+	}
+	else{//Otherwise return the elastic value
+	la=la0;
+	mu=mu0;
+	}
+	*pla=la;
+	*pmu=mu;
+
+} /*}}}*/
+IssmDouble                                 GetGravity(IssmDouble r2, int layer_index, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars){ /*{{{*/
+	//computes gravity at radius r2
+	IssmDouble* EarthMass;
+	IssmDouble g, GG;
+
+	EarthMass=vars->EarthMass;
+	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
+	IssmDouble ro=matlitho->density[layer_index];
+	IssmDouble M=0;
+	IssmDouble r1=0;
+	if (layer_index==0){
+		M=4.0/3.0*PI*ro*pow(r2,3.0);
+	}
+	else{ 
+		r1=matlitho->radius[layer_index];
+		M=EarthMass[layer_index-1]+4.0/3.0*PI*ro*(pow(r2,3.0)-pow(r1,3.0));
+	}
+	return	g= GG*M/pow(r2,2.0);
+}/*}}}*/
+template <typename doubletype> void        fill_yi_prefactor(doubletype* yi_prefactor, int* pdeg, doubletype* pomega, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars){ /*{{{*/
+	//precalculates partial derivative factors for function yi_derivatives
+	IssmDouble ra=matlitho->radius[matlitho->numlayers];
+	IssmDouble  g0,r0,mu0, GG;
+	int nstep,nindex, starting_layer;
+
+	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
+	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
+	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
+
+	g0=vars->g0;
+	r0=vars->r0;
+	starting_layer=vars->starting_layer;
+
+	doubletype frh,frhg0,fgr0,fgr,fn,rm0,rlm,flm;
+	IssmDouble xmin,xmax,x,dr;
+	IssmDouble g,ro, issolid;
+
+	if (pomega) { //frequency and degree dependent terms /*{{{*/
+		doubletype la,mu;
+		doubletype f[12];
+		int deg=*pdeg;
+		doubletype omega=*pomega;	
+		fn=deg*(deg+1.0);
+
+		for (int layer_index=starting_layer;layer_index<matlitho->numlayers;layer_index++){
+
+			ro=matlitho->density[layer_index];
+			issolid=matlitho->issolid[layer_index];
+			if(issolid==1){
+				GetEarthRheology<doubletype>(&la, &mu,layer_index,omega,matlitho);   
+
+				/*_______Expressions*/
+				flm=(la+2.0*mu);
+				rlm=(3.0*la+2.0*mu)/(la+2.0*mu);
+				rm0=mu/mu0;
+				frh=ro*ra/mu0;
+
+				f[0]=(-2.0*la/flm);
+				f[1]=mu0/flm;
+				f[2]=(la*fn/flm);
+				f[3]=rm0*rlm;
+				f[4]=ro*pow(omega,2.0)*ra/mu0;
+				f[5]=(-4.0*mu/flm);
+				f[6]=fn*frh;
+				f[7]=-(2.0*rm0*rlm)*fn;
+				f[8]=1.0/rm0;
+				f[9]=-2.0*rm0*rlm;
+				f[10]=-la/flm;
+				f[11]=2.0*rm0*(la*(2.0*fn-1.0)+2.0*mu*(fn-1.0))/flm;
+
+				xmin=matlitho->radius[layer_index]/ra;
+				xmax=(matlitho->radius[layer_index+1])/ra;
+				dr = (xmax -xmin)/nstep;
+				x=xmin;
+				for (int n=0;n<nstep;n++){
+					g=GetGravity(x*ra,layer_index,femmodel,matlitho,vars);
+
+					nindex=layer_index*nstep*36+n*36;
+					yi_prefactor[nindex+ 0*6+0]= f[0]/x;                      // in dy[0*6+0]
+					yi_prefactor[nindex+ 0*6+1]= f[1];                        // in dy[0*6+1]
+					yi_prefactor[nindex+ 0*6+2]= f[2]/x;                      // in dy[0*6+2]
+					yi_prefactor[nindex+ 1*6+0]= 4.0*(-frh*g+f[3]/x)/x + f[4];// in dy[1*6+0]
+					yi_prefactor[nindex+ 1*6+1]= f[5]/x;                      // in dy[1*6+1]
+					yi_prefactor[nindex+ 1*6+2]= (f[6]*g+f[7]/x)/x;           // in dy[1*6+2]
+					yi_prefactor[nindex+ 2*6+3]= f[8];                        // in dy[2*6+3]
+					yi_prefactor[nindex+ 3*6+0]= (frh*g+f[9]/x)/x;            // in dy[3*6+0]
+					yi_prefactor[nindex+ 3*6+1]= f[10]/x;                     // in dy[3*6+1]
+					yi_prefactor[nindex+ 3*6+2]= f[11]/(x*x) + f[4];          // in dy[3*6+2]
+					x=x+dr;
+				}
+			}
+		}
+		/*}}}*/
+	} else if (pdeg) { // degree dependent terms /*{{{*/
+		int deg=*pdeg;
+		fn=(deg*(deg+1.0));
+
+		for (int layer_index=starting_layer;layer_index<matlitho->numlayers;layer_index++){
+			ro=matlitho->density[layer_index];
+			issolid=matlitho->issolid[layer_index];
+
+			/*_______Expressions*/
+			fgr=4.0*PI*GG*ro*ra;
+
+			xmin=matlitho->radius[layer_index]/ra;
+			xmax=(matlitho->radius[layer_index+1])/ra;
+			dr = (xmax -xmin)/nstep;
+			x=xmin;
+			for (int n=0;n<nstep;n++){
+				nindex=layer_index*nstep*36+n*36;
+				g=GetGravity(x*ra,layer_index,femmodel,matlitho,vars);
+
+				if(issolid==1){
+					yi_prefactor[nindex+ 1*6+3]= fn/x;                  // in dy[1*6+3]
+					yi_prefactor[nindex+ 5*6+2]= -(fgr/g0*fn)/x;        // in dy[5*6+2]
+					yi_prefactor[nindex+ 5*6+4]= fn/(x*x);		     // in dy[5*6+4]
+				} else {
+					yi_prefactor[nindex+ 1*6+0]= (-4.0*(fgr/g)+fn/x)/x; // in dy[1*6+0] liquid layer
+				}
+				x=x+dr;
+			}
+		}
+		/*}}}*/
+	} else { // static terms /*{{{*/
+		for (int layer_index=starting_layer;layer_index<matlitho->numlayers;layer_index++){
+			ro=matlitho->density[layer_index];
+			issolid=matlitho->issolid[layer_index];
+
+			/*_______Expressions*/
+			frhg0=ro*g0*ra/mu0;
+			fgr=4.0*PI*GG*ro*ra;
+
+			xmin=matlitho->radius[layer_index]/ra;
+			xmax=(matlitho->radius[layer_index+1])/ra;
+			dr = (xmax -xmin)/nstep;
+			x=xmin;
+			for (int n=0;n<nstep;n++){
+				g=GetGravity(x*ra,layer_index,femmodel,matlitho,vars);
+				nindex=layer_index*nstep*36+n*36;
+				if(issolid==1){
+					yi_prefactor[nindex+ 1*6+5]= -frhg0;       // in dy[1*6+5]
+					yi_prefactor[nindex+ 2*6+0]= -1.0/x;       // in dy[2*6+0]
+					yi_prefactor[nindex+ 2*6+2]= 1.0/x;        // in dy[2*6+2]
+					yi_prefactor[nindex+ 3*6+3]= -3.0/x;       // in dy[3*6+3]
+					yi_prefactor[nindex+ 3*6+4]= -frhg0/x;     // in dy[3*6+4]
+					yi_prefactor[nindex+ 4*6+0]= fgr/g0;       // in dy[4*6+0]
+					yi_prefactor[nindex+ 4*6+5]= 1.0;          // in dy[4*6+5]
+					yi_prefactor[nindex+ 5*6+5]= -2.0/x;       // in dy[5*6+5]
+				} else {
+					yi_prefactor[nindex+ 0*6+0]= fgr/g;        // in dy[0*6+0] liquid layer
+					yi_prefactor[nindex+ 0*6+1]= 1.0;          // in dy[0*6+1] liquid layer
+					yi_prefactor[nindex+ 1*6+1]= -2.0/x-fgr/g; // in dy[1*6+1] liquid layer
+				}
+				x=x+dr;
+			}
+		}
+		/*}}}*/
+	}
+}/*}}}*/
+template <typename doubletype> void        yi_derivatives(doubletype* dydx, doubletype* y, int layer_index, int n, doubletype* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+	//computes yi derivatives at r=radius[layer_index]+ n/nstep*(radius[layer_index+1]-radius[layer_index])
+
+	IssmDouble issolid=matlitho->issolid[layer_index];
+	int iy,id,ny, nindex, nstep;
+	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
+
+	/*{{{*/ /* For reference:
+			   flm=(la+2.0*mu);
+			   rlm=(3.0*la+2.0*mu)/(la+2.0*mu);
+			   rm0=mu/mu0;
+			   rg0=g/g0;
+			   frh=ro*g*ra/mu0;
+			   fgr=4.0*PI*GG*ro*ra/g0;
+			   fn=(deg*(deg+1.0));
+
+			   if(issolid==1){
+			   ny = 6;
+
+			   dy[0*6+0]= (-2.0*la/flm)/x;
+			   dy[0*6+1]= mu0/flm;
+			   dy[0*6+2]= (la*fn/flm)/x;
+			   dy[0*6+3]= 0.0;
+			   dy[0*6+4]= 0.0;
+			   dy[0*6+5]= 0.0;
+
+			   dy[1*6+0]=  4.0*(-frh+rm0*rlm/x)/x + ro*pow(omega,2.0)*ra/mu0;
+			   dy[1*6+1]=(-4.0*mu/flm)/x;
+			   dy[1*6+2]= fn*(frh-2.0*rm0*rlm/x)/x;
+			   dy[1*6+3]= fn/x;
+			   dy[1*6+4]= 0.0;
+			   dy[1*6+5]= -frh/rg0;
+
+			   dy[2*6+0]= -1.0/x;
+			   dy[2*6+1]= 0.0;
+			   dy[2*6+2]= 1.0/x;
+			   dy[2*6+3]= 1/rm0;
+			   dy[2*6+4]= 0.0;
+			   dy[2*6+5]= 0.0;
+
+			   dy[3*6+0]= (frh-2.0*rm0*rlm/x)/x;
+			   dy[3*6+1]= ( -la/flm)/x;
+			   dy[3*6+2]= (2.0*rm0*(la*(2.0*fn-1.0)+2.0*mu*(fn-1.0))/flm)/(x*x) + ro*pow(omega,2.0)*ra/mu0;
+			   dy[3*6+3]= -3.0/x;
+			   dy[3*6+4]= -(frh/rg0)/x;
+			   dy[3*6+5]= 0.0;
+
+			   dy[4*6+0]= fgr;
+			   dy[4*6+1]= 0.0;
+			   dy[4*6+2]= 0.0;
+			   dy[4*6+3]= 0.0;
+			   dy[4*6+4]= 0.0;
+			   dy[4*6+5]= 1.0;
+
+			   dy[5*6+0]= 0.0;
+			   dy[5*6+1]= 0.0;
+			   dy[5*6+2]= -(fgr*fn)/x;
+			   dy[5*6+3]= 0.0;
+			   dy[5*6+4]= fn/(x*x);
+			   dy[5*6+5]= -2.0/x;
+
+			   } else {
+			   ny = 2;
+
+			   dy[0*6+0]= fgr/rg0;
+			   dy[0*6+1]= 1.0;
+			   dy[1*6+0]= (-4.0*(fgr/rg0)+fn/x)/x;
+			   dy[1*6+1]= -2.0/x-fgr/rg0;
+			   }
+	*/ /*}}}*/
+
+	if(issolid==1){
+		ny = 6;
+	} else {
+		ny = 2;
+	}
+
+	for (id=0;id<ny;id++){
+		dydx[id]=0.0;
+		for (iy=0;iy<ny;iy++){
+			nindex=layer_index*nstep*36+n*36;
+			dydx[id]+=yi_prefactor[nindex+id*6+iy]*y[iy];
+		}
+	}
+	return;
+}/*}}}*/
+template <typename doubletype> void        propagate_yi_euler(doubletype* y, IssmDouble xmin, IssmDouble xmax, int layer_index, doubletype* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+	//yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer?
+	//euler method
+	int nstep;
+	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum); 
+
+	doubletype* dydx=xNewZeroInit<doubletype>(6);
+	IssmDouble dr = (xmax -xmin)/nstep;
+	IssmDouble x=xmin;
+	for(int i = 0;i<nstep;i++){
+		yi_derivatives<doubletype>(dydx,y,layer_index, i,yi_prefactor,femmodel,matlitho);
+		for (int j=0;j<6;j++){
+			y[j]+=dydx[j]*dr;
+		}
+		x = x + dr;
+	}
+	xDelete<doubletype>(dydx);
+}/*}}}*/
+template <typename doubletype> void        propagate_yi_RK2(doubletype* y, IssmDouble xmin, IssmDouble xmax, int layer_index, doubletype* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+	//yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer?
+	//Implements Runge-Kutta 2nd order (midpoint method)
+	int nstep;
+	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum); 
+
+	doubletype k1[6]={0};
+	doubletype k2[6]={0};
+	doubletype k3[6]={0};
+	doubletype k4[6]={0};
+	doubletype y1[6]={0};
+	doubletype y2[6]={0};
+	doubletype y3[6]={0};
+
+	IssmDouble dr = (xmax -xmin)/nstep;
+	IssmDouble x=xmin;
+
+	for(int i = 0;i<nstep/2;i++){
+		yi_derivatives<doubletype>(k1,y,layer_index, 2*i,yi_prefactor,femmodel,matlitho);
+		for (int j=0;j<6;j++) {y1[j]=y[j]+k1[j]*dr;}
+		yi_derivatives<doubletype>(k2,y1,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);		
+
+		for (int j=0;j<6;j++){
+			y[j]+=k2[j]*2.0*dr;
+		}
+		x = x + 2.0*dr;
+	}
+}/*}}}*/
+template <typename doubletype> void        propagate_yi_RK4(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+	//yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer?
+	//Implements Runge-Kutta 4th order
+	int nstep;
+	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum); 
+
+	IssmDouble* k1=xNewZeroInit<IssmDouble>(6);
+	IssmDouble* k2=xNewZeroInit<IssmDouble>(6);
+	IssmDouble* k3=xNewZeroInit<IssmDouble>(6);
+	IssmDouble* k4=xNewZeroInit<IssmDouble>(6);
+	IssmDouble* y1=xNewZeroInit<IssmDouble>(6);
+	IssmDouble* y2=xNewZeroInit<IssmDouble>(6);
+	IssmDouble* y3=xNewZeroInit<IssmDouble>(6);
+
+	IssmDouble dr = (xmax -xmin)/nstep;
+	IssmDouble x=xmin;
+	for(int i = 0;i<nstep/2-1;i++){
+		yi_derivatives<doubletype>(k1,y,layer_index, 2*i,yi_prefactor,femmodel,matlitho);
+		for (int j=0;j<6;j++) {y1[j]=y[j]+k1[j]*dr;}
+		yi_derivatives<doubletype>(k2,y1,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
+		for (int j=0;j<6;j++) {y2[j]=y[j]+k2[j]*dr;}
+		yi_derivatives<doubletype>(k3,y2,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
+		for (int j=0;j<6;j++) {y3[j]=y[j]+k3[j]*2.0*dr;}
+		yi_derivatives<doubletype>(k4,y3,layer_index, 2*i+2,yi_prefactor,femmodel,matlitho);		
+
+		for (int j=0;j<6;j++){
+			y[j]+=(k1[j]+2.0*k2[j]+2.0*k3[j]+k4[j])/3.0*dr;		
+		}
+		x = x + 2.0*dr;
+	}
+
+	//Last step: we don't know the derivative at xmax, so we will assume the values at xmax-dr
+	int i=nstep/2;
+	yi_derivatives<doubletype>(k1,y,layer_index, 2*i,yi_prefactor,femmodel,matlitho);
+	for (int j=0;j<6;j++) {y1[j]=y[j]+k1[j]*dr;}
+	yi_derivatives<doubletype>(k2,y1,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
+	for (int j=0;j<6;j++) {y2[j]=y[j]+k2[j]*dr;}
+	yi_derivatives<doubletype>(k3,y2,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
+	for (int j=0;j<6;j++) {y3[j]=y[j]+k3[j]*2.0*dr;}
+	yi_derivatives<doubletype>(k4,y3,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);		
+
+	for (int j=0;j<6;j++){
+		y[j]+=(k1[j]+2.0*k2[j]+2.0*k3[j]+k4[j])/3.0*dr;		
+	}
+
+	x = x + 2.0*dr;
+
+	xDelete<IssmDouble>(k1);
+	xDelete<IssmDouble>(k2);
+	xDelete<IssmDouble>(k3);
+	xDelete<IssmDouble>(k4);
+	xDelete<IssmDouble>(y1);
+	xDelete<IssmDouble>(y2);
+	xDelete<IssmDouble>(y3);
+}/*}}}*/
+template <typename doubletype> void        Innersphere_boundaryconditions(doubletype* yi, int layer_index, int deg, doubletype omega, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars){ /*{{{*/
+	//fills the boundary conditions at the bottom of layer[layer_index] in yi[0:2][0:5]
+
+	IssmDouble r = matlitho->radius[layer_index];
+	IssmDouble ra=matlitho->radius[matlitho->numlayers];
+	IssmDouble  g0,r0,mu0, GG;
+	int nyi;
+
+	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
+	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
+
+	g0=vars->g0;
+	r0=vars->r0;
+	nyi=vars->nyi;
+
+	IssmDouble ro=matlitho->density[layer_index];
+	IssmDouble issolid=matlitho->issolid[layer_index];
+	IssmDouble g=GetGravity(r,layer_index,femmodel,matlitho,vars);
+	doubletype la,mu;
+
+	if (layer_index==0){
+		// radius[0] cannot be 0 for numerical reasons, but below our first interface at radius[0] would in reality be the same material as in the first layer
+		GetEarthRheology<doubletype>(&la, &mu,layer_index,omega,matlitho);   
+	} else {
+		GetEarthRheology<doubletype>(&la, &mu,layer_index-1,omega,matlitho);   
+	}    
+
+	IssmDouble cst = 4.0*PI*GG*ro;
+	IssmDouble r2=pow(r,2.0);
+
+	yi[0+nyi*0]=1.0*r/ra;
+	yi[0+nyi*1]=1.0/(r*ra);
+	yi[0+nyi*2]=0.0;
+
+	yi[1+nyi*0]=(2.0*mu*(deg-1.0-3.0/deg) + cst/3.0*ro*r2)/mu0;
+	yi[1+nyi*1]=(2.0*mu*(deg-1.0)/r2 + cst/3.0*ro)/mu0;
+	yi[1+nyi*2]=-ro/mu0;
+
+	yi[2+nyi*0]=(deg+3.0)/(deg*(deg+1.0))*r/ra;
+	yi[2+nyi*1]=1.0/(deg*r*ra);
+	yi[2+nyi*2]=0.0;
+
+	yi[3+nyi*0]=2.0*mu*(deg+2.0)/((deg+1.0)*mu0);
+	yi[3+nyi*1]=2.0*mu*(deg-1.0)/(deg*r2*mu0);
+	yi[3+nyi*2]=0.0;
+
+	yi[4+nyi*0]=0.0;
+	yi[4+nyi*1]=0.0;
+	yi[4+nyi*2]=1.0/(g0*ra);
+
+	yi[5+nyi*0]=-cst*r/g0;
+	yi[5+nyi*1]=-cst/(r*g0);
+	yi[5+nyi*2]=deg/(r*g0);
+
+}/*}}}*/
+template <typename doubletype> void        build_yi_system(doubletype* yi, int deg, doubletype omega, doubletype* yi_prefactor, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars) { /*{{{*/
+
+	IssmDouble  g0,r0,mu0,x,ro1, GG;
+	int nyi,starting_layer, nstep;
+
+	g0=vars->g0;
+	r0=vars->r0;
+	nyi=vars->nyi;
+	starting_layer=vars->starting_layer;
+
+	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
+	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
+	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
+
+	IssmDouble xmin,xmax,one,ro,g;
+	IssmDouble ra=matlitho->radius[matlitho->numlayers];
+
+	for (int i=0;i<6*(matlitho->numlayers+1);i++){
+		for(int j=0;j<6*(matlitho->numlayers+1);j++){
+			yi[i+6*(matlitho->numlayers+1)*j]=0.0;
+		}
+	}
+
+	int ny,is,ii,jj;
+	doubletype ystart[6];
+	for (int k=0;k<6;k++) ystart[k]=0.0;		
+
+	int ici = 0;   // Index of current interface 
+	for (int i = starting_layer; i<matlitho->numlayers;i++){ 
+
+		xmin=matlitho->radius[i]/ra;
+		xmax=(matlitho->radius[i+1])/ra;
+
+		if (matlitho->issolid[i]){
+			ny = 6;
+			is = 0;
+			one= 1.0;
+		} else {	
+			ny = 2;
+			is = 4;
+			one= -1.0;
+		}
+
+		for (int j = 0;j<ny;j++){
+			for (int k=0;k<6;k++){ystart[k]=0.0;}
+			ystart[j]= 1.0;
+
+			// Numerical Integration 
+			//propagate_yi_euler(&ystart[0], xmin, xmax, i, yi_prefactor,femmodel, matlitho);
+			propagate_yi_RK2<doubletype>(&ystart[0], xmin, xmax, i, yi_prefactor,femmodel, matlitho);
+			//propagate_yi_RK4(&ystart[0], xmin, xmax, i, yi_prefactor,femmodel, matlitho);
+			// Boundary Condition matrix - propagation part 
+			ii = 6*(ici+1)+is;
+			jj = 6*(ici+1)+j+is-3;
+			for (int kk=0;kk<ny;kk++){
+				yi[(ii+kk)+nyi*jj] = ystart[kk]*one;
+			}
+		}
+
+		// Boundary Condition matrix - solid regions
+		if (matlitho->issolid[i]){
+			one = -1.0;
+			if (i>0) if (!matlitho->issolid[i-1]) one = 1.0;
+			for (int j=0;j<6;j++){
+				yi[(j+6*ici)+ nyi*(j+6*ici+3)] = one;
+			}
+		} else { // Boundary Condition matrix - liquid regions
+			ro1=matlitho->density[i];
+			g=GetGravity(matlitho->radius[i], i, femmodel,matlitho,vars);
+			ii = 6*ici;
+			yi[ii+nyi*(ii+3)] = -1.0;
+			yi[ii+nyi*(ii+4+3)] = -g0/g;
+			yi[(ii+1)+nyi*(ii+3)]=-ro1*g*ra/mu0;
+			yi[(ii+2)+nyi*(ii+1+3)]=-1.0;
+			yi[(ii+5)+nyi*(ii+3)]= 4.0*PI*GG*ro1*ra/g0;
+			yi[(ii+4)+nyi*(ii+4+3)]=-1.0;
+			yi[(ii+5)+nyi*(ii+5+3)]=-1.0;
+			g=GetGravity(matlitho->radius[i+1], i,femmodel,matlitho,vars);
+			ii = 6*(ici+1);
+			yi[ii+nyi*(ii-1)]=-1.0;
+			yi[ii+nyi*(ii+1)]=yi[(ii+4)+nyi*(ii+1)]*g0/g; // yi(17,14) solution integration 1 of z5 CMB
+			yi[ii+nyi*(ii+2)]=yi[(ii+4)+nyi*(ii+2)]*g0/g; // yi(17,15) solution integration 2 of z5 CMB
+			// yi(13,..) y1 CMB
+			yi[(ii+1)+nyi*(ii-1)]=-ro1*g*ra/mu0;
+			yi[(ii+2)+nyi*(ii)]=-1.0;
+			yi[(ii+5)+nyi*(ii-1)]= 4.0*PI*GG*ro1*ra/g0;
+		}	
+		ici = ici+1;
+	}
+
+	//-- Internal sphere: integration starts here rather than r=0 for numerical reasons
+	Innersphere_boundaryconditions<doubletype>(yi, starting_layer, deg, omega, femmodel, matlitho,vars);
+
+	//-- Surface conditions
+	yi[(nyi-6)+nyi*(nyi-3)]=-1.0;
+	yi[(nyi-4)+nyi*(nyi-2)]=-1.0;
+	yi[(nyi-2)+nyi*(nyi-1)]=-1.0;
+	yi[(nyi-1)+nyi*(nyi-1)]=deg+1.0;
+
+	//-- Degree 1 special case
+	if(deg==1){
+		for (int i=0;i<nyi;i++){
+			yi[(nyi-1)+nyi*i]=0.0;
+		}
+		yi[(nyi-1)+nyi*(nyi-1)]=1.0;
+	}
+
+}/*}}}*/
+template <typename doubletype> void        yi_boundary_conditions(doubletype* yi_righthandside, int deg, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars){ /*{{{*/
+
+	IssmDouble  g0,r0,mu0,ra,rb,rc;
+	int nyi, forcing_type,icb,cmb,starting_layer;
+	IssmDouble* EarthMass;
+
+	g0=vars->g0;
+	r0=vars->r0;
+	nyi=vars->nyi;
+	starting_layer=vars->starting_layer;
+	EarthMass=vars->EarthMass;
+
+	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
+	femmodel->parameters->FindParam(&forcing_type,LoveForcingTypeEnum);
+	femmodel->parameters->FindParam(&icb,LoveInnerCoreBoundaryEnum);
+	femmodel->parameters->FindParam(&cmb,LoveCoreMantleBoundaryEnum);
+
+	// In Case of a Inner Core - Outer Core - Mantle planet and Boundary conditions on these 3 interfaces
+	ra=matlitho->radius[matlitho->numlayers];	
+	rb=0;
+	rc=0;
+	if (forcing_type<=4){
+		rc=matlitho->radius[icb];
+	} 
+	else if (forcing_type<=8){
+		rb=matlitho->radius[cmb];
+	}
+
+	IssmDouble ro_mean=EarthMass[matlitho->numlayers-1]/(4.0/3.0*PI*pow(ra,3.0));
+
+	for (int i=0;i<(matlitho->numlayers+1)*6;i++) yi_righthandside[i]=0.0;
+
+	switch (forcing_type) {
+
+		//-- forcings at the Inner Core Boundary
+		case 1:	//'ICB --Volumetric Potential'
+			yi_righthandside[6*icb+5]=(deg)/(rc*g0);
+			yi_righthandside[6*icb+4]=1.0/(ra*g0);
+			break;
+		case 2: //'ICB --Pressure'
+			yi_righthandside[6*icb+1]=-ro_mean/mu0;
+			break;
+		case 3://'ICB --Loading'
+			yi_righthandside[6*icb+1]=-ro_mean*(2.0*deg+1.0)/(3.0*mu0)*ra/rc;
+			yi_righthandside[6*icb+5]= (2.0*deg+1.0)/(rc*g0);
+			break;
+		case 4://'ICB --Tangential Traction'
+			yi_righthandside[6*icb+3]= ro_mean/mu0;
+			break;
+
+			//--forcings at the Core Mantle Boundary
+		case 5://'CMB --Volumetric Potential'
+			yi_righthandside[6*cmb+1]=-ro_mean/mu0*ra/rb;
+			yi_righthandside[6*cmb+5]= (2.0*deg+1.0)/(rb*g0);
+			break;
+		case 6://'CMB --Pressure'
+			yi_righthandside[6*cmb+1]=-ro_mean/mu0;
+			break;
+		case 7://'CMB --Loading'
+			yi_righthandside[6*cmb+1]=-ro_mean*(2.0*deg+1.0)/(3.0*mu0)*ra/rb;
+			yi_righthandside[6*cmb+5]= (2.0*deg+1.0)/(rb*g0);
+			break;
+		case 8://'CMB --Tangential Traction'
+			yi_righthandside[6*cmb+3]=-ro_mean/mu0;
+			break;
+
+			//--forcings at the surface
+		case 9://'SURF--Volumetric Potential'
+			if (deg>1) yi_righthandside[nyi-1]=(2.0*deg+1.0)/(ra*g0);
+			break;
+		case 10://'SURF--Pressure'
+			yi_righthandside[nyi-5]=-ro_mean/mu0;
+			break;
+		case 11://'SURF--Loading'
+			yi_righthandside[nyi-5]=-ro_mean*(2.0*deg+1.0)/(3.0*mu0);
+			if (deg>1) yi_righthandside[nyi-1]= (2.0*deg+1.0)/(ra*g0);
+			break;
+		case 12://'SURF--Tangential Traction'
+			yi_righthandside[nyi-3]= ro_mean/mu0;
+			break;
+		default:
+			_error_("love core error: forcing_type not supported yet");
+	}
+}/*}}}*/
+template <typename doubletype> void        solve_yi_system(doubletype* loveh, doubletype* lovel, doubletype* lovek, int deg, doubletype omega, doubletype* yi, doubletype* rhs, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars){ /*{{{*/
+
+	IssmDouble  g0,r0,mu0,loveratio,underflow_tol;
+	IssmDouble* frequencies;
+	int nyi,starting_layer, dummy;
+	bool allow_layer_deletion;
+	IssmDouble* EarthMass=NULL;
+
+	g0=vars->g0;
+	r0=vars->r0;
+	nyi=vars->nyi;
+	starting_layer=vars->starting_layer;
+	EarthMass=vars->EarthMass;
+
+	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
+	femmodel->parameters->FindParam(&allow_layer_deletion,LoveAllowLayerDeletionEnum);
+	femmodel->parameters->FindParam(&underflow_tol,LoveUnderflowTolEnum);
+	femmodel->parameters->FindParam(&frequencies,&dummy,LoveFrequenciesEnum);
+	IssmDouble ra=matlitho->radius[matlitho->numlayers];
+	bool exit=false;
+	int lda,ldb;
+
+	for(;!exit;){ //cycles of: attempt to solve the yi system, then delete a layer if necessary
+		lda=nyi;
+		ldb=nyi;
+		doubletype*  yilocal=xNew<doubletype>(nyi*nyi); // we will need to redeclare these inside here as nyi changes
+		doubletype*  rhslocal=xNew<doubletype>(nyi);
+
+		//we need to do a local copy of yi,rhs to send them to LAPACK with the appropriate size and to keep the original matrices in case layers are deleted and we need to try again
+		for (int i=0;i<nyi;i++){ 
+			rhslocal[i]=rhs[i];
+			for (int j=0;j<nyi;j++){
+				yilocal[i+j*nyi]=yi[i+j*nyi];
+			}
+		}
+		//-- Resolution
+		int* ipiv=xNewZeroInit<int>(nyi); //pivot index vector
+		int info = 0;// error checker
+		int nrhs=1; // number of right hand size columns
+
+		allgesv<doubletype>(&nyi, &nrhs, yilocal, &lda, ipiv, rhslocal, &ldb, &info);
+
+		xDelete<int>(ipiv);
+
+		if(VerboseModule() && info!=0){ 
+			_printf0_("love core warning in DGESV : LAPACK linear equation solver couldn't resolve the system");
+			_printf_("i j yi[i+nyi*j] rhs[i]");
+			for (int i=0;i<nyi;i++){
+				for (int j=0;j<nyi;j++){
+					_printf_(i<<" "<<j<<" "<<yi[i+nyi*j]<<" "<<rhs[i]<<"\n");
+				}
+			}
+		}
+
+		*loveh = rhslocal[nyi-3]*ra*g0;
+		*lovel = rhslocal[nyi-2]*ra*g0;
+		*lovek = rhslocal[nyi-1]*ra*g0;
+
+		doubletype loveh1 = rhslocal[3];
+		doubletype lovel1 = rhslocal[5];
+		doubletype lovek1 = rhslocal[7] - pow(matlitho->radius[starting_layer]/ra,deg)/(g0*ra);
+
+		doubletype loveh1s = rhslocal[nyi-3];
+		doubletype lovel1s = rhslocal[nyi-2];
+		doubletype lovek1s = rhslocal[nyi-1] - 1.0/(g0*ra);
+
+		loveratio = abs(loveh1/loveh1s); //ratio of center to surface love numbers, determines if we should remove layers
+		if (abs(lovel1/lovel1s) < loveratio) loveratio = abs(lovel1/lovel1s); 
+		if (abs(lovek1/lovek1s) < loveratio) loveratio = abs(lovek1/lovek1s);
+
+		if (!allow_layer_deletion || nyi<=12 || omega!=angular_frequency<doubletype>(frequencies[0])){ 
+			goto save_results;
+			/*We are not allowed to delete layers, or there is only one layer left. We also don't want to delete 
+			  layers in the middle of a loop on frequencies, as that can lead to a jump that would compromise the 
+			  inverse laplace transform.*/
+		}
+
+		if (loveratio<=underflow_tol || xIsNan(loveratio) || xIsInf(loveratio)){//We need to delete a layer and try again if the ratio between deepest love number to surface love number is too low (risk of underflow) or garbage
+			if(VerboseSolution()){
+				_printf_("\n   Degree: " << deg <<", surface/Depth Love number ratio small: "<<loveratio<<"\n");
+				_printf_("    Changing the interface where the integration starts\n");
+				_printf_("    New start interface: r="<< matlitho->radius[starting_layer+1] <<"m\n\n");
+			}
+			nyi-=6;
+			starting_layer+=1;
+			vars->nyi=nyi;
+			vars->starting_layer=starting_layer;
+
+			for (int i=0;i<nyi;i++){//shift everything down by 1 layer
+				rhs[i]=rhs[i+6];
+				for (int j=0;j<nyi;j++){
+					yi[j+i*nyi]=yi[j+6+(i+6)*(nyi+6)];
+				}
+			}
+
+			Innersphere_boundaryconditions<doubletype>(yi, starting_layer, deg, omega, femmodel, matlitho,vars); //we move the first interface to the new starting layer. yi[0:2,0:5] will be different
+		} else { //we are ready to save the outputs and break the main loop
+
+save_results:
+			for (int i=0;i<nyi;i++){
+				rhs[i]=rhslocal[i];
+				for (int j=0;j<nyi;j++){
+					yi[j+i*nyi]=yilocal[j+i*nyi];
+				}
+			}
+
+			//make sure we can't output numbers from deleted layers
+			for (int i=nyi;i<(matlitho->numlayers+1)*6;i++){ 
+				rhs[i]=0.0;
+				for (int j=0;j<(matlitho->numlayers+1)*6;j++){
+					yi[j+i*(matlitho->numlayers+1)*6]=0.0;
+				}
+			}
+			for (int i=0;i<nyi;i++){
+				for (int j=nyi;j<(matlitho->numlayers+1)*6;j++){
+					yi[j+i*(matlitho->numlayers+1)*6]=0.0;
+				}
+			}
+
+			exit = true;
+		}
+		xDelete<doubletype>(yilocal);
+		xDelete<doubletype>(rhslocal);
+	}
+	xDelete<IssmDouble>(frequencies);	
+
+}/*}}}*/
+template <typename doubletype> void        love_freq_to_temporal(doubletype* LoveHt,doubletype* LoveLt,doubletype* LoveKt,doubletype* LoveHf,doubletype* LoveLf,doubletype* LoveKf, FemModel* femmodel){ /*{{{*/
+	//Transforms all frequency-dependent love numbers into time-dependent love numbers
+	int nfreq,sh_nmax,sh_nmin,indxi,indf, NTit;
+
+	femmodel->parameters->FindParam(&nfreq,LoveNfreqEnum);
+	femmodel->parameters->FindParam(&sh_nmax,LoveShNmaxEnum);
+	femmodel->parameters->FindParam(&sh_nmin,LoveShNminEnum);
+	femmodel->parameters->FindParam(&NTit,LoveNTemporalIterationsEnum);
+
+	int nt=nfreq/2/NTit;
+	doubletype* xi=postwidder_coef<doubletype>(NTit);
+
+	for (int d=sh_nmin;d<sh_nmax+1;d++){
+		for (int t=0;t<nt;t++){
+			postwidder_transform<doubletype>(LoveHt,LoveHf,d,t,NTit,xi,femmodel);
+			postwidder_transform<doubletype>(LoveLt,LoveLf,d,t,NTit,xi,femmodel);
+			postwidder_transform<doubletype>(LoveKt,LoveKf,d,t,NTit,xi,femmodel);
+		}
+	}
+	xDelete<doubletype>(xi);
+}/*}}}*/
+
+/*templated cores:*/
+LoveVariables*                             love_init(FemModel* femmodel, Matlitho* matlitho){/*{{{*/
+
+	/*initialize Planet_Mass(r) for efficient computation of gravity, value of surface gravity and inital size of the yi equation system*/
+
+	bool        verbosemod = (int)VerboseModule();
+	int         numlayers  = matlitho->numlayers;
+	IssmDouble* r          = matlitho->radius;
+	IssmDouble  r1,r2,ro, GG;
+
+	/*outputs:*/
+	IssmDouble* EarthMass=NULL;
+	IssmDouble  g0,r0;
+	int         nyi,starting_layer;
+
+	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
+	EarthMass=xNewZeroInit<IssmDouble>(numlayers+1);
+
+	for (int i=0;i<numlayers;i++){
+		r2 = r[i+1];
+		ro = matlitho->density[i];
+		if (i==0){
+			EarthMass[i] = ro*pow(r2,3.0)*4.0*PI/3.0;
+		}else{
+			r1=r[i];
+			EarthMass[i] = EarthMass[i-1] + ro*(pow(r2,3.0)-pow(r1,3.0))*4.0*PI/3.0;;
+		}
+	}
+
+	g0=EarthMass[numlayers-1]*GG/pow(r[numlayers],2.0);
+	r0=r[numlayers];
+	nyi=6*(numlayers+1);
+	starting_layer=0;
+
+	return new LoveVariables(EarthMass,g0,r0,nyi,starting_layer);
+
+} /*}}}*/
+template <typename doubletype> void        love_core_template(FemModel* femmodel){ /*{{{*/
+
+	Matlitho*   matlitho=NULL;
+	int         nfreq,nyi,starting_layer,nstep,forcing_type,dummy;
+	int         sh_nmin,sh_nmax,kernel_index,deleted_layer_offset;
+	bool        allow_layer_deletion,love_kernels, istemporal;
+	bool        verbosemod = (int)VerboseModule();
+	IssmDouble  mu0, underflow_tol;
 	IssmDouble *frequencies = NULL;
-	int         nfreq,dummy;
-	int         sh_nmin,sh_nmax;
-	IssmDouble  g0,r0,mu0;
-	bool        allow_layer_deletion;
-	bool        love_kernels;
-	int         forcing_type;
-	bool        verbosemod = (int)VerboseModule();
-
-	/*parameters: */
-	bool save_results;
+	bool        save_results;
+	bool        complex_computation;
+
+	doubletype  omega;
+	doubletype  lovek, loveh, lovel, loveratio;
+
+	doubletype*  LoveKf = NULL;
+	doubletype*  LoveHf = NULL;
+	doubletype*  LoveLf = NULL;
+
+	doubletype*  LoveKernels= NULL;
+	LoveVariables* vars=NULL;
+	doubletype* yi_prefactor=NULL;
+	doubletype* yi_righthandside=NULL;
+	doubletype* yi=NULL;
 
 	if(VerboseSolution()) _printf0_("   computing LOVE numbers\n");
 
-	/*Recover some parameters: */
+	/*recover materials parameters: there is only one Matlitho, chase it down the hard way:*/
+	for (Object* & object: femmodel->materials->objects){
+		Material* material=xDynamicCast<Material*>(object);
+		if(material->ObjectEnum()==MatlithoEnum){
+			matlitho=xDynamicCast<Matlitho*>(material);
+			break;
+		}
+	}
+	_assert_(matlitho);
+
+	/*recover parameters: */
 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
-
-	/*recover love number parameters: */
 	femmodel->parameters->FindParam(&nfreq,LoveNfreqEnum);
 	femmodel->parameters->FindParam(&frequencies,&dummy,LoveFrequenciesEnum); _assert_(nfreq==dummy);
 	femmodel->parameters->FindParam(&sh_nmax,LoveShNmaxEnum);
 	femmodel->parameters->FindParam(&sh_nmin,LoveShNminEnum);
-	femmodel->parameters->FindParam(&g0,LoveG0Enum);
-	femmodel->parameters->FindParam(&r0,LoveR0Enum);
 	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
 	femmodel->parameters->FindParam(&allow_layer_deletion,LoveAllowLayerDeletionEnum);
 	femmodel->parameters->FindParam(&love_kernels,LoveKernelsEnum);
 	femmodel->parameters->FindParam(&forcing_type,LoveForcingTypeEnum);
-
-	/*recover materials parameters: there is only one Matlitho, chase it down the hard way:*/
-	Matlitho* matlitho=NULL;
-	for (Object* & object: femmodel->materials->objects){
-		Material* material=xDynamicCast<Material*>(object);
-		if (material->ObjectEnum()==MatlithoEnum)matlitho=xDynamicCast<Matlitho*>(material);
-	}
-	_assert_(matlitho);
+	femmodel->parameters->FindParam(&istemporal,LoveIsTemporalEnum);
+	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
+	femmodel->parameters->FindParam(&complex_computation,LoveComplexComputationEnum);
 
 	/*Initialize three love matrices: geoid, vertical and horizontal displacement (real and imaginary parts) */
-	IssmDouble*  LoveKr = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
-	IssmDouble*  LoveHr = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
-	IssmDouble*  LoveLr = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
-	IssmDouble*  LoveKi = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
-	IssmDouble*  LoveHi = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
-	IssmDouble*  LoveLi = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+	LoveKf = xNewZeroInit<doubletype>(nfreq*(sh_nmax+1));
+	LoveHf = xNewZeroInit<doubletype>(nfreq*(sh_nmax+1));
+	LoveLf = xNewZeroInit<doubletype>(nfreq*(sh_nmax+1));
 
 	/*Initialize love kernels (real and imaginary parts): */
-	IssmDouble*  LoveKernelsReal = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1)*(matlitho->numlayers+1)*6);
-	IssmDouble*  LoveKernelsImag = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1)*(matlitho->numlayers+1)*6);
+	LoveKernels= xNewZeroInit<doubletype>(nfreq*(sh_nmax+1)*(matlitho->numlayers+1)*6);
+
+	vars=love_init(femmodel,matlitho);
+
+	yi_prefactor=xNewZeroInit<doubletype>(6*6*nstep*matlitho->numlayers);
+	yi_righthandside=xNewZeroInit<doubletype>(vars->nyi);
+	yi=xNewZeroInit<doubletype>(vars->nyi*vars->nyi);
+
+	//precalculate yi coefficients that do not depend on degree or frequency
+	fill_yi_prefactor<doubletype>(yi_prefactor, NULL, NULL,femmodel, matlitho,vars); 
+	for(int deg=sh_nmin;deg<sh_nmax+1;deg++){
+
+		//precalculate yi coefficients that depend on degree but not frequency
+		fill_yi_prefactor<doubletype>(yi_prefactor, &deg, NULL,femmodel, matlitho,vars); 
+
+		for (int fr=0;fr<nfreq;fr++){
+			omega=angular_frequency<doubletype>(frequencies[fr]);
+
+			//precalculate yi coefficients that depend on degree and frequency
+			fill_yi_prefactor<doubletype>(yi_prefactor, &deg,&omega,femmodel, matlitho,vars); 
+
+			yi_boundary_conditions<doubletype>(yi_righthandside,deg,femmodel,matlitho,vars); 
+
+			build_yi_system<doubletype>(yi,deg,omega,yi_prefactor,femmodel,matlitho,vars);
+
+			solve_yi_system<doubletype>(&loveh,&lovel,&lovek, deg, omega, yi, yi_righthandside,femmodel, matlitho,vars);
+
+			LoveHf[deg*nfreq+fr]=loveh;
+			LoveKf[deg*nfreq+fr]=lovek-1.0;
+			LoveLf[deg*nfreq+fr]=lovel;
+
+			deleted_layer_offset=(matlitho->numlayers+1)*6-vars->nyi;// =6 per deleted layer
+			kernel_index=deg*nfreq*(matlitho->numlayers+1)*6 + fr*(matlitho->numlayers+1)*6 + deleted_layer_offset;
+			for (int i=0;i<vars->nyi;i++){
+				LoveKernels[kernel_index+i]=yi_righthandside[i];
+			}
+		}
+	}
+
+	xDelete<doubletype>(yi);
+	xDelete<doubletype>(yi_righthandside);
+
+	//Temporal love numbers
+	if (istemporal && !complex_computation){
+
+		IssmDouble*  LoveHtDouble=NULL;
+		IssmDouble*  LoveKtDouble=NULL;
+		IssmDouble*  LoveLtDouble=NULL;
+		doubletype*  LoveHt=NULL;
+		doubletype*  LoveLt=NULL;
+		doubletype*  LoveKt=NULL;
+
+		int NTit;
+		femmodel->parameters->FindParam(&NTit,LoveNTemporalIterationsEnum);
+		int nt = nfreq/2/NTit;
+
+		LoveHt=xNewZeroInit<doubletype>((sh_nmax+1)*nt);
+		LoveLt=xNewZeroInit<doubletype>((sh_nmax+1)*nt);
+		LoveKt=xNewZeroInit<doubletype>((sh_nmax+1)*nt);
+
+		love_freq_to_temporal<doubletype>(LoveHt,LoveLt,LoveKt,LoveHf,LoveLf,LoveKf,femmodel);
+
+		/*Downcast and add into parameters:*/
+		LoveHtDouble=xNew<IssmDouble>((sh_nmax+1)*nt);
+		LoveLtDouble=xNew<IssmDouble>((sh_nmax+1)*nt);
+		LoveKtDouble=xNew<IssmDouble>((sh_nmax+1)*nt);
+		for(int i=0;i<(sh_nmax+1)*nt;i++){
+			LoveHtDouble[i]=std::real(LoveHt[i]);
+			LoveLtDouble[i]=std::real(LoveLt[i]);
+			LoveKtDouble[i]=std::real(LoveKt[i]);
+		}
+		if(forcing_type==9){ //tidal loading
+			femmodel->parameters->AddObject(new DoubleMatParam(TidalLoveHEnum,LoveHtDouble,(sh_nmax+1)*nt,1));
+			femmodel->parameters->AddObject(new DoubleMatParam(TidalLoveKEnum,LoveKtDouble,(sh_nmax+1)*nt,1));
+			femmodel->parameters->AddObject(new DoubleMatParam(TidalLoveLEnum,LoveLtDouble,(sh_nmax+1)*nt,1));
+		}
+		else if(forcing_type==11){ //surface loading
+			femmodel->parameters->AddObject(new DoubleMatParam(LoadLoveHEnum,LoveHtDouble,(sh_nmax+1)*nt,1));
+			femmodel->parameters->AddObject(new DoubleMatParam(LoadLoveKEnum,LoveKtDouble,(sh_nmax+1)*nt,1));
+			femmodel->parameters->AddObject(new DoubleMatParam(LoadLoveLEnum,LoveLtDouble,(sh_nmax+1)*nt,1));
+		}
+		xDelete<IssmDouble>(LoveHtDouble);
+		xDelete<IssmDouble>(LoveKtDouble);
+		xDelete<IssmDouble>(LoveLtDouble);
+
+		/*Add into external results, no need to downcast, we can handle complexes/quad precision: */
+		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveKrEnum,LoveKt,sh_nmax+1,nt,0,0));
+		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveHrEnum,LoveHt,sh_nmax+1,nt,0,0));
+		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveLrEnum,LoveLt,sh_nmax+1,nt,0,0));
+
+		xDelete<doubletype>(LoveHt);
+		xDelete<doubletype>(LoveLt);
+		xDelete<doubletype>(LoveKt);
+	}
+	else{
+
+		IssmDouble*  LoveHfDouble=NULL;
+		IssmDouble*  LoveKfDouble=NULL;
+		IssmDouble*  LoveLfDouble=NULL;
+
+		/*Add into parameters:*/
+		LoveHfDouble=xNew<IssmDouble>((sh_nmax+1)*nfreq);
+		LoveLfDouble=xNew<IssmDouble>((sh_nmax+1)*nfreq);
+		LoveKfDouble=xNew<IssmDouble>((sh_nmax+1)*nfreq);
+		for(int i=0;i<(sh_nmax+1)*nfreq;i++){
+			LoveHfDouble[i]=std::real(LoveHf[i]);
+			LoveLfDouble[i]=std::real(LoveLf[i]);
+			LoveKfDouble[i]=std::real(LoveKf[i]);
+		}
+		if(forcing_type==9){ //tidal loading
+			femmodel->parameters->AddObject(new DoubleMatParam(TidalLoveHEnum,LoveHfDouble,(sh_nmax+1)*nfreq,1));
+			femmodel->parameters->AddObject(new DoubleMatParam(TidalLoveKEnum,LoveKfDouble,(sh_nmax+1)*nfreq,1));
+			femmodel->parameters->AddObject(new DoubleMatParam(TidalLoveLEnum,LoveLfDouble,(sh_nmax+1)*nfreq,1));
+		}
+		else if(forcing_type==11){ //surface loading
+			femmodel->parameters->AddObject(new DoubleMatParam(LoadLoveHEnum,LoveHfDouble,(sh_nmax+1)*nfreq,1));
+			femmodel->parameters->AddObject(new DoubleMatParam(LoadLoveKEnum,LoveKfDouble,(sh_nmax+1)*nfreq,1));
+			femmodel->parameters->AddObject(new DoubleMatParam(LoadLoveLEnum,LoveLfDouble,(sh_nmax+1)*nfreq,1));
+		}
+		xDelete<IssmDouble>(LoveHfDouble);
+		xDelete<IssmDouble>(LoveKfDouble);
+		xDelete<IssmDouble>(LoveLfDouble);
+	}
+
+	/*Add into external results:*/
+	femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveKiEnum,LoveKf,sh_nmax+1,nfreq,0,0));
+	femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveHiEnum,LoveHf,sh_nmax+1,nfreq,0,0));
+	femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveLiEnum,LoveLf,sh_nmax+1,nfreq,0,0));
+
+	/*Only when love_kernels is on*/
+	if (love_kernels==1) {
+		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveKernelsEnum,LoveKernels,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
+	}
+
+	/*Free resources:*/
+	xDelete<IssmDouble>(frequencies);
+	xDelete<doubletype>(LoveKf);
+	xDelete<doubletype>(LoveHf);
+	xDelete<doubletype>(LoveLf);
+	xDelete<doubletype>(LoveKernels);
+
+	/* Legacy for fortran core, to be removed after complete validation */
+
+	//IssmDouble g0,r0;
+	//femmodel->parameters->FindParam(&g0,LoveG0Enum);
+	//femmodel->parameters->FindParam(&r0,LoveR0Enum);
+	//IssmDouble* LoveKr = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+	//IssmDouble* LoveHr = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+	//IssmDouble* LoveLr = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+	//IssmDouble* LoveKi = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+	//IssmDouble* LoveHi = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+	//IssmDouble* LoveLi = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+
+	/*Initialize love kernels (real and imaginary parts): */
+	//IssmDouble* LoveKernelsr= xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1)*(matlitho->numlayers+1)*6);
+	//IssmDouble* LoveKernelsi= xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1)*(matlitho->numlayers+1)*6);
 
 	/*call the main module: */
-	FourierLoveCorex(LoveKr,LoveKi,LoveHr,LoveHi,LoveLr,LoveLi,LoveKernelsReal,LoveKernelsImag,  //output
-			nfreq,frequencies,sh_nmax,sh_nmin,g0,r0,mu0,allow_layer_deletion,forcing_type,verbosemod, //parameter inputs
-			matlitho->numlayers, matlitho->radius, matlitho->viscosity, matlitho->lame_lambda, matlitho->lame_mu,
-			matlitho->burgers_viscosity, matlitho->burgers_mu, matlitho->density, matlitho->isburgers, matlitho->issolid //matlitho inputs
-			);
+	//if (false){
+	//FourierLoveCorex(LoveKr,LoveKi,LoveHr,LoveHr,LoveLr,LoveLi,LoveKernelsr,LoveKernelsi,  //output
+	//		nfreq,frequencies,sh_nmax,sh_nmin,g0,r0,mu0,allow_layer_deletion,forcing_type,verbosemod, //parameter inputs
+	//		matlitho->numlayers, matlitho->radius, matlitho->viscosity, matlitho->lame_lambda, matlitho->lame_mu,
+	//		matlitho->burgers_viscosity, matlitho->burgers_mu, matlitho->density, matlitho->rheologymodel, matlitho->issolid //matlitho inputs
+	//		);
+
+	/*Only when love_kernels is on*/
+	//if (love_kernels==1) {
+		//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsEnum,LoveKernelsr,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
+		//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsImagEnum,LoveKernelsImag,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
+	//}
 
 	/*Add love matrices to results:*/
-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKrEnum,LoveKr,sh_nmax+1,nfreq,0,0));
-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHrEnum,LoveHr,sh_nmax+1,nfreq,0,0));
-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLrEnum,LoveLr,sh_nmax+1,nfreq,0,0));
-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKiEnum,LoveKi,sh_nmax+1,nfreq,0,0));
-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHiEnum,LoveHi,sh_nmax+1,nfreq,0,0));
-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLiEnum,LoveLi,sh_nmax+1,nfreq,0,0));
-	/*Only when love_kernels is set unity*/
-	if (love_kernels==1) {
-		femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsRealEnum,LoveKernelsReal,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
-		femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsImagEnum,LoveKernelsImag,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
-	}
-
-	/*Free ressources:*/
-	xDelete<IssmDouble>(frequencies);
-	xDelete<IssmDouble>(LoveKr);
-	xDelete<IssmDouble>(LoveHr);
-	xDelete<IssmDouble>(LoveLr);
-	xDelete<IssmDouble>(LoveKi);
-	xDelete<IssmDouble>(LoveHi);
-	xDelete<IssmDouble>(LoveLi);
-	xDelete<IssmDouble>(LoveKernelsReal);
-	xDelete<IssmDouble>(LoveKernelsImag);
-}
+	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKrEnum,LoveKr,sh_nmax+1,nfreq,0,0));
+	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHrEnum,LoveHr,sh_nmax+1,nfreq,0,0));
+	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLrEnum,LoveLr,sh_nmax+1,nfreq,0,0));
+	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKiEnum,LoveKi,sh_nmax+1,nfreq,0,0));
+	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHiEnum,LoveHi,sh_nmax+1,nfreq,0,0));
+	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLiEnum,LoveLi,sh_nmax+1,nfreq,0,0));
+
+	//xDelete<IssmDouble>(LoveKr);
+	//xDelete<IssmDouble>(LoveHr);
+	//xDelete<IssmDouble>(LoveLr);
+	//xDelete<IssmDouble>(LoveKernelsr);
+	//xDelete<IssmDouble>(LoveKi);
+	//xDelete<IssmDouble>(LoveHi);
+	//xDelete<IssmDouble>(LoveLi);
+	//xDelete<IssmDouble>(LoveKernelsi);
+
+} /*}}}*/
+
+/*cores and template instantiations:*/
+/*template instantiations :{{{*/
+template void love_core_template<IssmDouble>(FemModel* femmodel);
+template void love_core_template<IssmComplex>(FemModel* femmodel);
+template void        fill_yi_prefactor<IssmDouble>(IssmDouble* yi_prefactor, int* pdeg, IssmDouble* pomega, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars);
+template void        fill_yi_prefactor<IssmComplex>(IssmComplex* yi_prefactor, int* pdeg, IssmComplex* pomega, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars);
+template void        GetEarthRheology<IssmDouble>(IssmDouble* pla, IssmDouble* pmu, int layer_index, IssmDouble omega,  Matlitho* matlitho);
+template void        GetEarthRheology<IssmComplex>(IssmComplex* pla, IssmComplex* pmu, int layer_index, IssmComplex omega,  Matlitho* matlitho);
+template void        yi_boundary_conditions<IssmDouble>(IssmDouble* yi_righthandside, int deg, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars);
+template void        yi_boundary_conditions<IssmComplex>(IssmComplex* yi_righthandside, int deg, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars);
+template void        yi_derivatives<IssmDouble>(IssmDouble* dydx, IssmDouble* y, int layer_index, int n, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
+template void        yi_derivatives<IssmComplex>(IssmComplex* dydx, IssmComplex* y, int layer_index, int n, IssmComplex* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
+template void        propagate_yi_RK2<IssmDouble>(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
+template void        propagate_yi_RK2<IssmComplex>(IssmComplex* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmComplex* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
+template void        propagate_yi_euler<IssmDouble>(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
+template void        propagate_yi_euler<IssmComplex>(IssmComplex* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmComplex* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
+template void        Innersphere_boundaryconditions<IssmDouble>(IssmDouble* yi, int layer_index, int deg, IssmDouble omega, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars);
+template void        Innersphere_boundaryconditions<IssmComplex>(IssmComplex* yi, int layer_index, int deg, IssmComplex omega, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars);
+template void        build_yi_system<IssmDouble>(IssmDouble* yi, int deg, IssmDouble omega, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars);
+template void        build_yi_system<IssmComplex>(IssmComplex* yi, int deg, IssmComplex omega, IssmComplex* yi_prefactor, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars);
+template void        solve_yi_system<IssmDouble>(IssmDouble* loveh, IssmDouble* lovel, IssmDouble* lovek, int deg, IssmDouble omega, IssmDouble* yi, IssmDouble* rhs, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars);
+template void        solve_yi_system<IssmComplex>(IssmComplex* loveh, IssmComplex* lovel, IssmComplex* lovek, int deg, IssmComplex omega, IssmComplex* yi, IssmComplex* rhs, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars);
+template IssmDouble  factorial<IssmDouble>(int n);
+template IssmDouble* postwidder_coef<IssmDouble>(int NTit);
+template IssmDouble  n_C_r<IssmDouble>(int n, int r);
+template void         postwidder_transform<IssmDouble>(IssmDouble* Lovet, IssmDouble* Lovef,int d, int t, int NTit, IssmDouble* xi, FemModel* femmodel);
+
+/*}}}*/
+void           love_core(FemModel* femmodel){ /*{{{*/
+
+	bool        complex_computation;
+
+	femmodel->parameters->FindParam(&complex_computation,LoveComplexComputationEnum);
+
+	if(complex_computation) love_core_template<IssmComplex>(femmodel);
+	else                    love_core_template<IssmDouble>(femmodel);
+
+} /*}}}*/
Index: /issm/trunk/src/c/cores/masstransport_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/masstransport_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/masstransport_core.cpp	(revision 26744)
@@ -9,6 +9,7 @@
 #include "../modules/modules.h"
 #include "../solutionsequences/solutionsequences.h"
-
-void masstransport_core(FemModel* femmodel){
+#include "../classes/Inputs/TransientInput.h"
+void SolidEarthIceUpdates(FemModel* femmodel);
+void masstransport_core(FemModel* femmodel){ /*{{{*/
 
 	/*Start profiler*/
@@ -64,5 +65,4 @@
 		InputDuplicatex(femmodel,BaseEnum,BaseOldEnum);
 		InputDuplicatex(femmodel,SurfaceEnum,SurfaceOldEnum);
-		InputDuplicatex(femmodel,SealevelriseCumDeltathicknessEnum,SealevelriseCumDeltathicknessOldEnum);
 		if(stabilization==4){
 			solutionsequence_fct(femmodel);
@@ -76,4 +76,6 @@
 			//}
 		}
+		SolidEarthIceUpdates(femmodel);
+
 		femmodel->parameters->SetParam(ThicknessEnum,InputToExtrudeEnum);
 		extrudefrombase_core(femmodel);
@@ -82,4 +84,5 @@
 		femmodel->parameters->SetParam(SurfaceEnum,InputToExtrudeEnum);
 		extrudefrombase_core(femmodel);
+
 	}
 
@@ -95,3 +98,62 @@
 	/*profiler*/
 	femmodel->profiler->Stop(MASSTRANSPORTCORE);
-}
+} /*}}}*/
+void SolidEarthIceUpdates(FemModel* femmodel){ /*{{{*/
+
+	int isgrd;
+	int grdmodel;
+	IssmDouble time;
+	int frequency,count;
+
+	/*retrieve parameters:*/
+	femmodel->parameters->FindParam(&isgrd,SolidearthSettingsGRDEnum);
+	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+	femmodel->parameters->FindParam(&time,TimeEnum);
+	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
+
+	/*early return?:*/
+	if(!isgrd)return;
+
+	/*From old and new thickness, create delta thickness  and accumulate:*/
+	femmodel->inputs->ZAXPY(-1, ThicknessOldEnum,ThicknessEnum,DeltaIceThicknessEnum);
+	femmodel->inputs->AXPY(+1, DeltaIceThicknessEnum,AccumulatedDeltaIceThicknessEnum);
+
+	/*for Ivins deformation model, keep history of ice thickness changes inside TransientAccumulatedDeltaIceThicknessEnum:*/
+	if(grdmodel==IvinsEnum){
+
+		TransientInput* transientinput = femmodel->inputs->GetTransientInput(TransientAccumulatedDeltaIceThicknessEnum);
+
+		for(Object* & object : femmodel->elements->objects){
+			int *vertexlids = NULL;
+			int *vertexsids= NULL;
+			Element*   element=xDynamicCast<Element*>(object);
+			const int numvertices = element->GetNumberOfVertices();
+			IssmDouble* cumdeltathickness=NULL;
+
+			/*Get values and lid list and recover vertices ids needed to initialize inputs*/
+			vertexlids      = xNew<int>(numvertices);
+			vertexsids      = xNew<int>(numvertices);
+			cumdeltathickness=xNew<IssmDouble>(numvertices);
+			element->GetVerticesLidList(&vertexlids[0]);
+			element->GetVerticesSidList(&vertexsids[0]);
+			element->GetInputListOnVertices(&cumdeltathickness[0],AccumulatedDeltaIceThicknessEnum);
+
+			/*Add the current time cumdeltathickness to the existing time series: */
+			switch(element->ObjectEnum()){
+				case TriaEnum:  transientinput->AddTriaTimeInput( time,numvertices,vertexlids,cumdeltathickness,P1Enum); break;
+				default: _error_("Not implemented yet");
+			}
+			xDelete<int>(vertexlids);
+			xDelete<int>(vertexsids);
+			xDelete<IssmDouble>(cumdeltathickness);
+		}
+	}	
+
+	/*compute total ice thickness change between two sea-level solver time steps, ie. every frequency*dt:*/
+	if(count==frequency){
+		femmodel->inputs->ZAXPY(-1, OldAccumulatedDeltaIceThicknessEnum,AccumulatedDeltaIceThicknessEnum,DeltaIceThicknessEnum);
+		femmodel->inputs->DuplicateInput(AccumulatedDeltaIceThicknessEnum,OldAccumulatedDeltaIceThicknessEnum);
+	}
+	return;
+}/*}}}*/
Index: /issm/trunk/src/c/cores/movingfront_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/movingfront_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/movingfront_core.cpp	(revision 26744)
@@ -11,5 +11,5 @@
 
 void movingfront_core(FemModel* femmodel){
-	
+
 	/*Start profiler*/
 	femmodel->profiler->Start(MOVINGFRONTCORE);
@@ -47,5 +47,4 @@
 		}
 	}
-
 
 	/* start the work from here */
@@ -111,4 +110,6 @@
 	}
 
+	/* Calculate the frontal velocity for levelset function */
+	MovingFrontalVelx(femmodel);
 
 	/* solve level set equation */
@@ -132,10 +133,4 @@
 	GetMaskOfIceVerticesLSMx(femmodel);
 
-	/* add computation domain mask to outputs */
-	if(save_results){
-		int outputs[1] = {IceMaskNodeActivationEnum};
-		femmodel->RequestedOutputsx(&femmodel->results,&outputs[0],1);
-	}
-	
 	/*End profiler*/
 	femmodel->profiler->Stop(MOVINGFRONTCORE);
Index: /issm/trunk/src/c/cores/oceantransport_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/oceantransport_core.cpp	(revision 26744)
+++ /issm/trunk/src/c/cores/oceantransport_core.cpp	(revision 26744)
@@ -0,0 +1,89 @@
+/*!\file: oceantransport_core.cpp
+ * \brief: core of the oceantransport solution 
+ */ 
+
+#include "./cores.h"
+#include "../toolkits/toolkits.h"
+#include "../classes/classes.h"
+#include "../shared/shared.h"
+#include "../modules/modules.h"
+#include "../solutionsequences/solutionsequences.h"
+
+void SolidEarthOceanUpdates(FemModel* femmodel);
+void oceantransport_core(FemModel* femmodel){ /*{{{*/
+
+	/*Start profiler*/
+	femmodel->profiler->Start(OCEANTRANSPORTCORE);
+
+	/*parameters: */
+	int    numoutputs;
+	bool   save_results;
+	bool   dakota_analysis;
+	int    solution_type;
+	Vector<IssmDouble>*  ug  = NULL;
+
+	/*activate configuration*/
+	femmodel->SetCurrentConfiguration(OceantransportAnalysisEnum);
+
+	/*recover parameters: */
+	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+
+	if(VerboseSolution()) _printf0_("   computing ocean mass transport\n");
+
+	femmodel->SetCurrentConfiguration(OceantransportAnalysisEnum);
+
+	/*save current bottom pressures before updating:*/
+	InputDuplicatex(femmodel,BottomPressureEnum,BottomPressureOldEnum);
+	InputDuplicatex(femmodel,DslEnum,DslOldEnum);
+	InputDuplicatex(femmodel,StrEnum,StrOldEnum);
+
+	/*grab bottom pressures, dsl and str from OceantransportSpcbottompressure, OceantransportSpcdslEnum 
+	 * and OceantransportSpcstrEnum  inputs in each element, assemble into a vector and feed to 
+	 * InputUpdateFromSolutionx which will deal with accumulating such inputs:*/
+	GetSolutionFromInputsx(&ug,femmodel); 
+	InputUpdateFromSolutionx(femmodel,ug); 
+
+	SolidEarthOceanUpdates(femmodel);
+
+	if(solution_type==OceantransportSolutionEnum)femmodel->RequestedDependentsx();
+
+	/*profiler*/
+	femmodel->profiler->Stop(OCEANTRANSPORTCORE);
+
+	/*free ressources:*/
+	delete ug;
+
+} /*}}}*/
+void SolidEarthOceanUpdates(FemModel* femmodel){ /*{{{*/
+
+	int isgrd;
+	int grdmodel;
+	IssmDouble time;
+	int frequency,count;
+
+	/*retrieve parameters:*/
+	femmodel->parameters->FindParam(&isgrd,SolidearthSettingsGRDEnum);
+	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+	femmodel->parameters->FindParam(&time,TimeEnum);
+	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
+
+	/*early return?:*/
+	if(!isgrd)return;
+
+	/* From old and new bottom pressures, create delta bottom pressure, delta dsl and delta str. 
+	 * Accumulate delta bottom pressure: */
+	femmodel->inputs->ZAXPY(-1, BottomPressureOldEnum,BottomPressureEnum,DeltaBottomPressureEnum);
+	femmodel->inputs->AXPY(+1, DeltaBottomPressureEnum,AccumulatedDeltaBottomPressureEnum);
+
+	femmodel->inputs->ZAXPY(-1, DslOldEnum,DslEnum,DeltaDslEnum);
+	femmodel->inputs->ZAXPY(-1, StrOldEnum,StrEnum,DeltaStrEnum);
+
+	/* Compute total bottom pressure change between two sea-level solver time steps, ie. every frequency*dt. */
+	if(count==frequency){
+		femmodel->inputs->ZAXPY(-1, OldAccumulatedDeltaBottomPressureEnum,AccumulatedDeltaBottomPressureEnum,DeltaBottomPressureEnum);
+		femmodel->inputs->DuplicateInput(AccumulatedDeltaBottomPressureEnum,OldAccumulatedDeltaBottomPressureEnum);
+	}
+	return;
+}/*}}}*/
Index: /issm/trunk/src/c/cores/sampling_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/sampling_core.cpp	(revision 26744)
+++ /issm/trunk/src/c/cores/sampling_core.cpp	(revision 26744)
@@ -0,0 +1,48 @@
+/*!\file: sampling_core.cpp
+ * \brief: core of the sampling solution
+ */
+
+#include "../classes/classes.h"
+#include "../solutionsequences/solutionsequences.h"
+
+void sampling_core(FemModel* femmodel){
+
+	/*Start profiler*/
+	femmodel->profiler->Start(SAMPLINGCORE);
+
+	/*parameters: */
+	int    numoutputs;
+	bool   save_results;
+	int    solution_type;
+	char** requested_outputs = NULL;
+
+	/*activate configuration*/
+	femmodel->SetCurrentConfiguration(SamplingAnalysisEnum);
+
+	/*recover parameters: */
+	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+	femmodel->parameters->FindParam(&numoutputs,SamplingNumRequestedOutputsEnum);
+	if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,SamplingRequestedOutputsEnum);
+
+	if(VerboseSolution()) _printf0_("   Generating random samples\n");
+
+	/*Generate random sample*/
+	if(VerboseSolution()) _printf0_("   call computational core\n");
+	femmodel->SetCurrentConfiguration(SamplingAnalysisEnum);
+	solutionsequence_sampling(femmodel);
+
+	if(save_results){
+		if(VerboseSolution()) _printf0_("   saving results\n");
+		int outputs = SampleEnum;
+		femmodel->RequestedOutputsx(&femmodel->results,&outputs,1);
+	}
+
+	if(solution_type==SamplingSolutionEnum)femmodel->RequestedDependentsx();
+
+	/*Free ressources:*/
+	if(numoutputs){for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);}
+
+	/*profiler*/
+	femmodel->profiler->Stop(SAMPLINGCORE);
+}
Index: /issm/trunk/src/c/cores/sealevelchange_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/sealevelchange_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/sealevelchange_core.cpp	(revision 26744)
@@ -2,4 +2,10 @@
  * \brief: core of the sea-level change solution 
  */ 
+
+#ifdef HAVE_CONFIG_H
+	#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
 
 #include "./cores.h"
@@ -13,7 +19,19 @@
 #include "../solutionsequences/solutionsequences.h"
 
+/*support routines local definitions:{{{*/
+void TransferForcing(FemModel* femmodel,int forcingenum);
+void TransferSealevel(FemModel* femmodel,int forcingenum);
+bool slcconvergence(Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs);
+IssmDouble  SealevelloadsOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble totaloceanarea);
+void PolarMotion(IssmDouble* m, FemModel* femmodel,GrdLoads* loads, SealevelGeometry* slgeom);
+void ConserveOceanMass(FemModel* femmodel,GrdLoads* loads, IssmDouble offset, SealevelGeometry* slgeom);
+void ivins_deformation_core(FemModel* femmodel);
+IssmDouble* CombineLoads(IssmDouble* load,IssmDouble* subload,FemModel* femmodel, SealevelGeometry* slgeom,int loadtype,int nel);
+/*}}}*/
 
 /*main cores:*/
-void sealevelchange_core(FemModel* femmodel){ /*{{{*/
+void              sealevelchange_core(FemModel* femmodel){ /*{{{*/
+
+	SealevelGeometry* slgeom=NULL;
 
 	/*Start profiler*/
@@ -22,47 +40,31 @@
 	/*Parameters, variables:*/
 	bool save_results;
-	bool isslr=0;
-	bool isgia=0;
-	int  grd=0;
-	int solution_type;
 
 	/*Retrieve parameters:*/
-	femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
-	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
-	femmodel->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
-
-	/*in case we are running SealevelriseSolutionEnum, then bypass transient settings:*/
-	if(solution_type==SealevelriseSolutionEnum){
-		isslr=1;
-		isgia=1;
-	}
-
-	/*Should we be here?:*/
-	if(!isslr)return;
 
 	/*Verbose: */
-	if(VerboseSolution()) _printf0_("   computing sea level rise\n");
-
-	/*Run gia core: */
-	if(isgia){
-		#ifdef _HAVE_GIA_
-		gia_core(femmodel);
-		#else
-		_error_("ISSM was not compiled with gia capabilities. Exiting");
-		#endif
-	}
+	if(VerboseSolution()) _printf0_("   computing sea level change\n");
 
 	/*set SLR configuration: */
-	femmodel->SetCurrentConfiguration(SealevelriseAnalysisEnum);
+	femmodel->SetCurrentConfiguration(SealevelchangeAnalysisEnum);
 
 	/*run geometry core: */
-	sealevelrise_core_geometry(femmodel);
+	slgeom=sealevelchange_geometry(femmodel);
+
+	/*any external forcings?:*/
+	solidearthexternal_core(femmodel);
+
+	/*Run coupler input transfer:*/
+	couplerinput_core(femmodel);
 
 	/*Run geodetic:*/
-	if(grd)grd_core(femmodel);
+	grd_core(femmodel,slgeom);
 
 	/*Run steric core for sure:*/
 	dynstr_core(femmodel);
+
+	/*Run coupler output transfer: */
+	coupleroutput_core(femmodel);
 
 	/*Save results: */
@@ -71,64 +73,101 @@
 		char **requested_outputs = NULL;
 		if(VerboseSolution()) _printf0_("   saving results\n");
-		femmodel->parameters->FindParam(&requested_outputs,&numoutputs,SealevelriseRequestedOutputsEnum);
+		femmodel->parameters->FindParam(&requested_outputs,&numoutputs,SealevelchangeRequestedOutputsEnum);
 		femmodel->RequestedOutputsx(&femmodel->results,requested_outputs,numoutputs);
 		if(numoutputs){for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);}
 	}
 
-	/*requested dependents: */
-	if(solution_type==SealevelriseSolutionEnum)femmodel->RequestedDependentsx();
-	
 	/*End profiler*/
 	femmodel->profiler->Stop(SLRCORE);
 }
 /*}}}*/
-void grd_core(FemModel* femmodel){ /*{{{*/
-
-	/*Gravity rotation deformation core GRD: */
+void              solidearthexternal_core(FemModel* femmodel){ /*{{{*/
 
 	/*variables:*/
-	Vector<IssmDouble> *RSLg    = NULL;
-	Vector<IssmDouble> *BPg    = NULL;
-	Vector<IssmDouble> *RSLg_rate    = NULL;
-	Vector<IssmDouble> *RSLg_eustatic  = NULL; 
-	Vector<IssmDouble> *U_esa  = NULL; 
-	Vector<IssmDouble> *U_esa_rate  = NULL; 
-	Vector<IssmDouble> *N_esa  = NULL; 
-	Vector<IssmDouble> *N_esa_rate  = NULL; 
-	Vector<IssmDouble> *U_north_esa   = NULL; 
-	Vector<IssmDouble> *U_east_esa    = NULL; 
-	Vector<IssmDouble> *N_gia= NULL; 
-	Vector<IssmDouble> *U_gia= NULL; 
-	Vector<IssmDouble> *N_gia_rate= NULL; 
-	Vector<IssmDouble> *U_gia_rate= NULL; 
-	SealevelMasks* masks=NULL;
-
-	/*parameters:*/
-	bool iscoupler;
-	int  solution_type;
-	int  modelid,earthid;
-	bool istransientmasstransport;
-	int  frequency,count;
-	int  horiz;
-	IssmDouble dt;
-	IssmDouble oceanarea;
-	int        bp_compute_fingerprints=0;
-
-	
-	/*Verbose: */
-	if(VerboseSolution()) _printf0_("	  computing GRD sea level patterns\n");
-
-	/*retrieve more parameters:*/
-	femmodel->parameters->FindParam(&iscoupler,TransientIscouplerEnum);
-	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
-	femmodel->parameters->FindParam(&count,SealevelriseRunCountEnum);
+	Vector<IssmDouble> *bedrock  = NULL; 
+	Vector<IssmDouble> *bedrock_rate = NULL;
+	Vector<IssmDouble> *bedrockeast  = NULL; 
+	Vector<IssmDouble> *bedrockeast_rate = NULL;
+	Vector<IssmDouble> *bedrocknorth  = NULL; 
+	Vector<IssmDouble> *bedrocknorth_rate = NULL;
+	Vector<IssmDouble> *geoid= NULL; 
+	Vector<IssmDouble> *geoid_rate= NULL; 
+	int horiz=0;
+	int modelid=-1;
+	int  isexternal=0;
+
+	/*parameters: */
+	IssmDouble          dt;
+
+	/*Retrieve parameters:*/
 	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
 	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
-	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
-
-	if(iscoupler){
+	femmodel->parameters->FindParam(&isexternal,SolidearthIsExternalEnum); 
+
+	/*Early return:*/
+	if (!isexternal)return;
+
+	/*Verbose: */
+	if(VerboseSolution()) _printf0_("	  computing external solid earth contributions\n");
+
+	/*Retrieve geoid viscous and elastic rates, bedrock uplift viscous and elastic rates + steric rate, as vectors:*/
+	GetVectorFromInputsx(&bedrock,femmodel,BedEnum,VertexSIdEnum);
+	GetVectorFromInputsx(&geoid,femmodel,SealevelEnum,VertexSIdEnum); //In ISSM, Sealevel is absolute.
+	if(horiz){
+		GetVectorFromInputsx(&bedrockeast,femmodel,BedEastEnum,VertexSIdEnum);
+		GetVectorFromInputsx(&bedrocknorth,femmodel,BedNorthEnum,VertexSIdEnum);
+	}
+
+	GetVectorFromInputsx(&geoid_rate,femmodel,SolidearthExternalGeoidRateEnum,VertexSIdEnum);
+	GetVectorFromInputsx(&bedrock_rate,femmodel,SolidearthExternalDisplacementUpRateEnum,VertexSIdEnum);
+	if(horiz){
+		GetVectorFromInputsx(&bedrockeast_rate,femmodel,SolidearthExternalDisplacementEastRateEnum,VertexSIdEnum);
+		GetVectorFromInputsx(&bedrocknorth_rate,femmodel,SolidearthExternalDisplacementNorthRateEnum,VertexSIdEnum);
+	}
+
+	/*compute: sea level change = initial sea level + (N_gia_rate+N_esa_rate)  * dt + steric_rate + dynamic_rate dt*/
+	geoid->AXPY(geoid_rate,dt);
+	bedrock->AXPY(bedrock_rate,dt);
+	if(horiz){
+		bedrockeast->AXPY(bedrockeast_rate,dt);
+		bedrocknorth->AXPY(bedrocknorth_rate,dt);
+	}
+
+	/*update element inputs:*/
+	InputUpdateFromVectorx(femmodel,bedrock,BedEnum,VertexSIdEnum);	
+	InputUpdateFromVectorx(femmodel,geoid,SealevelEnum,VertexSIdEnum);	
+	if(horiz){
+		InputUpdateFromVectorx(femmodel,bedrockeast,BedEastEnum,VertexSIdEnum);	
+		InputUpdateFromVectorx(femmodel,bedrocknorth,BedNorthEnum,VertexSIdEnum);	
+	}
+
+	/*Free ressources:*/	
+	delete bedrock; delete bedrock_rate;
+	delete geoid; delete geoid_rate;
+	if(horiz){
+		delete bedrockeast; delete bedrockeast_rate;
+		delete bedrocknorth; delete bedrocknorth_rate;
+	}
+}
+/*}}}*/
+void              couplerinput_core(FemModel* femmodel){  /*{{{*/
+
+	/*Be very careful here, everything is well thought through, do not remove 
+	 * without taking big risks:*/
+
+	/*parameters:*/
+	int  iscoupling;
+	int  modelid,earthid;
+	int  count,frequency;
+	int  horiz;
+
+	/*retrieve more parameters:*/
+	femmodel->parameters->FindParam(&iscoupling,IsSlcCouplingEnum);
+	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
+
+	if(iscoupling){
 		femmodel->parameters->FindParam(&modelid,ModelIdEnum);
 		femmodel->parameters->FindParam(&earthid,EarthIdEnum);
-		femmodel->parameters->FindParam(&istransientmasstransport,TransientIsmasstransportEnum);
 	}
 	else{
@@ -136,706 +175,665 @@
 		 * so make sure we are identified as being the Earth.:*/
 		modelid=1; earthid=1; 
-		/* in addition, if we are running solution_type SealevelriseSolutionEnum, make sure we 
-		 * run, irresepective of the time settings:*/
-		count=frequency;
-	}
-
-	/*If we are running in coupled mode, the Earth model needs to run its own mass transport (if 
-	 * not already done by the mass trasnport module. For ice caps, they rely on the transient mass 
-	 * transport module exclusively:*/
-	if(iscoupler) if(modelid==earthid) if(!istransientmasstransport) EarthMassTransport(femmodel);
-
-	/*increment counter, or call solution core if count==frequency:*/
+	}
+
+	/*if we are carrying loads but are not yet computing grd core, accumulate them and skip 
+	 * the rest: */
 	if (count<frequency){
-		count++; femmodel->parameters->SetParam(count,SealevelriseRunCountEnum); 
+		count++; 
+		femmodel->parameters->SetParam(count,SealevelchangeRunCountEnum); 
 		return;
 	}
 
-	/*call sea-level rise sub cores:*/
-	if(iscoupler){
-		/*transfer cumulated deltathickness forcing from ice caps to earth model: */
-		TransferForcing(femmodel,SealevelriseCumDeltathicknessEnum);
-
-		/*we have accumulated thicknesses, dump them in deltathcikness: */
-		if(modelid==earthid)InputDuplicatex(femmodel,SealevelriseCumDeltathicknessEnum,SurfaceloadIceThicknessChangeEnum);
-	}
-
-	/*run cores:*/
-	if(modelid==earthid){
-
-		/*call masks core: */
-		masks=sealevelrise_core_masks(femmodel);
-
-		/*set bottom pressures:*/
-		SetBottomPressure(femmodel);
-
-
-		/*call eustatic core  (generalized eustatic - Farrel and Clark, Eq 4, 1st, 3rd and 4rd terms on the RHS) */
-		RSLg_eustatic=sealevelrise_core_eustatic(femmodel,masks,&oceanarea); 
-
-		/*call non-eustatic core (ocean loading tems  - 2nd and 5th terms on the RHS of Farrel and Clark) */
-		RSLg=sealevelrise_core_noneustatic(femmodel,masks,RSLg_eustatic,oceanarea); 
-
-		/*compute other elastic signatures, such as components of 3-D crustal motion: */
-		sealevelrise_core_elastic(&U_esa,&U_north_esa,&U_east_esa,femmodel,RSLg,masks);
-
-		/*compute viscosus (GIA) signatures:*/
-		sealevelrise_core_viscous(&U_gia,&N_gia,femmodel,RSLg);
-
-		/*compute sea-level rise (low-order spherical harmonics coefficients) diagnostics:*/
-		sealevelrise_diagnostics(femmodel,RSLg);
-
-		/*recover N_esa  = U_esa + RSLg:*/
-		N_esa=U_esa->Duplicate(); U_esa->Copy(N_esa); N_esa->AXPY(RSLg,1);
-
-		/*transform these values into rates (as we only run this once each frequency turn:*/
-		N_esa_rate=N_esa->Duplicate(); N_esa->Copy(N_esa_rate); N_esa_rate->Scale(1/(dt*frequency));
-		U_esa_rate=U_esa->Duplicate(); U_esa->Copy(U_esa_rate); U_esa_rate->Scale(1/(dt*frequency));
-		N_gia_rate=N_gia->Duplicate(); N_gia->Copy(N_gia_rate); N_gia_rate->Scale(1/(dt*frequency));
-		U_gia_rate=U_gia->Duplicate(); U_gia->Copy(U_gia_rate); U_gia_rate->Scale(1/(dt*frequency));
-		RSLg_rate=RSLg->Duplicate(); RSLg->Copy(RSLg_rate); RSLg_rate->Scale(1/(dt*frequency));
-
-		/*get some results into elements:{{{*/
-		InputUpdateFromVectorx(femmodel,U_esa_rate,SealevelUEsaRateEnum,VertexSIdEnum); 
-		InputUpdateFromVectorx(femmodel,N_esa_rate,SealevelNEsaRateEnum,VertexSIdEnum); 
-		InputUpdateFromVectorx(femmodel,U_gia_rate,UGiaRateEnum,VertexSIdEnum);
-		InputUpdateFromVectorx(femmodel,N_gia_rate,NGiaRateEnum,VertexSIdEnum); 
-		InputUpdateFromVectorx(femmodel,RSLg_rate,SealevelRSLRateEnum,VertexSIdEnum); 
-		InputUpdateFromVectorx(femmodel,U_esa,SealevelUEsaEnum,VertexSIdEnum); 
-		InputUpdateFromVectorx(femmodel,N_esa,SealevelNEsaEnum,VertexSIdEnum); 
-		InputUpdateFromVectorx(femmodel,U_gia,UGiaEnum,VertexSIdEnum); 
-		InputUpdateFromVectorx(femmodel,N_gia,NGiaEnum,VertexSIdEnum); 
-		InputUpdateFromVectorx(femmodel,RSLg,SealevelRSLEnum,VertexSIdEnum); 
-		InputUpdateFromVectorx(femmodel,RSLg_eustatic,SealevelRSLEustaticEnum,VertexSIdEnum); 
-
-		if (horiz){
-			InputUpdateFromVectorx(femmodel,U_north_esa,SealevelUNorthEsaEnum,VertexSIdEnum);	// north motion 
-			InputUpdateFromVectorx(femmodel,U_east_esa,SealevelUEastEsaEnum,VertexSIdEnum);		// east motion 
-		} /*}}}*/
-	}
-
-	if(iscoupler){
-		/*transfer sea level back to ice caps:*/
-		TransferSealevel(femmodel,SealevelNEsaRateEnum);
-		TransferSealevel(femmodel,NGiaRateEnum);
-		TransferSealevel(femmodel,SealevelUEsaRateEnum);
-		TransferSealevel(femmodel,UGiaRateEnum);
-
-		//reset cumdeltathickness  to 0: 
-		InputUpdateFromConstantx(femmodel->inputs,femmodel->elements,0.,SealevelriseCumDeltathicknessEnum);
-	}
-
-	/*reset counter to 1:*/
-	femmodel->parameters->SetParam(1,SealevelriseRunCountEnum); //reset counter.
-
-	/*free ressources:{{{*/
-	delete RSLg;
-	delete RSLg_rate;
-	delete RSLg_eustatic;
-	delete U_esa;
-	delete U_esa_rate;
-	delete N_esa;
-	delete N_esa_rate;
-	delete BPg;
-
-	if(horiz){
-		delete U_north_esa;
-		delete U_east_esa;
-	}
-	delete N_gia;
-	delete U_gia;
-	delete N_gia_rate;
-	delete U_gia_rate;
-	//delete masks;
+	/*Basins are supposed to accumulate loads and hand them over to the Earth
+	  for slr computations every "frequency" time steps. If we are here, we
+	  have reached the "frequency"'th time step, and we are going to pick up
+	  the old loads, the current loads, and send them to the Earth for slr
+	  computations.  So the Earth is never supposed to compute loads. Except,
+	  when we are running the Earth as a giant basin (ex: running a
+	  Peltier-style GIA model, or running a "Snow Ball" Earth) which only
+	  happens when we are not coupled, at which point we are sending these
+	  loads to ourselves (hence the convoluted condition).
+	  */
+
+	/*transer loads from basins to Earth for grd core computations. :*/
+	if(iscoupling){
+
+		/*transfer ice thickness change load from basins to earth: */
+		TransferForcing(femmodel,DeltaIceThicknessEnum);
+		TransferForcing(femmodel,DeltaBottomPressureEnum);
+		TransferForcing(femmodel,DeltaTwsEnum);
+
+		/*transfer external forcings back to Earth:*/
+		TransferSealevel(femmodel,BedEnum);
+		TransferSealevel(femmodel,SealevelEnum);
+		if(horiz){
+			TransferSealevel(femmodel,BedEastEnum);
+			TransferSealevel(femmodel,BedNorthEnum);
+		}
+	}
+
+}; /*}}}*/
+void              grd_core(FemModel* femmodel, SealevelGeometry* slgeom) { /*{{{*/
+
+	/*variables:{{{*/
+	int nel;
+	BarystaticContributions* barycontrib=NULL;
+	GenericParam<BarystaticContributions*>* barycontribparam=NULL;
+	IssmDouble polarmotionvector[3]={0};
+
+	GrdLoads*              loads=NULL;
+	Vector<IssmDouble>*    oldsealevelloads=NULL;
+	Vector<IssmDouble>*    oceanareas=NULL;
+	IssmDouble             totaloceanarea;
+	Vector<IssmDouble>*    subelementoceanareas=NULL;
+	IssmDouble             oceanaverage;
+	bool                   scaleoceanarea=false;
+	IssmDouble             rho_water;
+
+	IssmDouble           eps_rel;
+	IssmDouble           eps_abs;
+	int                  max_nonlinear_iterations;
+	int                  iterations=0;
+	int                  step;
+	IssmDouble           time; 
+
+	int  modelid,earthid;
+	int  horiz;
+	int  count,frequency,iscoupling;
+	int  grd=0;
+	int  grdmodel; 
+	int  sealevelloading=0;
+	bool viscous=false;
+	bool rotation=false;
+	bool planethasocean=false;
+	IssmDouble*           sealevelpercpu=NULL;
+
 	/*}}}*/
 
-} 
-/*}}}*/
-void dynstr_core(FemModel* femmodel){ /*{{{*/
-
-	/*variables:*/
-	Vector<IssmDouble> *bedrock  = NULL; 
-	Vector<IssmDouble> *SL  = NULL; 
-	Vector<IssmDouble> *steric_rate_g  = NULL; 
-	Vector<IssmDouble> *dynamic_rate_g = NULL;
-	Vector<IssmDouble> *U_esa_rate= NULL;
-	Vector<IssmDouble> *N_esa_rate= NULL;
-	Vector<IssmDouble> *U_gia_rate= NULL;
-	Vector<IssmDouble> *N_gia_rate= NULL;
-
-	/*parameters: */
-	bool isslr=0;
-	int  solution_type;
-	IssmDouble          dt;
-	int  grd=0;
-	int  step;
-	IssmDouble time;
-	IssmDouble cumgmtslr=0;
-	IssmDouble cumbslr=0;
-	IssmDouble cumgmslr=0;
-	IssmDouble gmtslr=0;
-
-	/*Retrieve parameters:*/
-	femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
-	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
-	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
-	femmodel->parameters->FindParam(&grd,SolidearthSettingsGRDEnum);
-	femmodel->parameters->FindParam(&cumgmtslr,CumGmtslrEnum); 
-	femmodel->parameters->FindParam(&cumbslr,CumBslrEnum); 
+	/*Verbose: */
+	if(VerboseSolution()) _printf0_("	  computing GRD patterns\n");
+
+	/*retrieve parameters:{{{*/
+	femmodel->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
+	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
 	femmodel->parameters->FindParam(&step,StepEnum);
 	femmodel->parameters->FindParam(&time,TimeEnum);
-
-	/*in case we are running SealevelriseSolutionEnum, then bypass transient settings:*/
-	if(solution_type==SealevelriseSolutionEnum)isslr=1;
-
-	/*Should we be here?:*/
-	if(!isslr)return;
-
-	/*Verbose: */
-	if(VerboseSolution()) _printf0_("	  computing steric sea level rise\n");
-
-	/*Retrieve geoid viscous and elastic rates, bedrock uplift viscous and elastic rates + steric rate, as vectors:*/
-	GetVectorFromInputsx(&bedrock,femmodel,BedEnum,VertexSIdEnum);
-	GetVectorFromInputsx(&SL,femmodel,SealevelEnum,VertexSIdEnum);
-	GetStericRate(&steric_rate_g,femmodel);
-	GetDynamicRate(&dynamic_rate_g,femmodel);
-	if(grd){
-		GetVectorFromInputsx(&U_esa_rate,femmodel,SealevelUEsaRateEnum,VertexSIdEnum);
-		GetVectorFromInputsx(&U_gia_rate,femmodel,UGiaRateEnum,VertexSIdEnum);
-		GetVectorFromInputsx(&N_esa_rate,femmodel,SealevelNEsaRateEnum,VertexSIdEnum);
-		GetVectorFromInputsx(&N_gia_rate,femmodel,NGiaRateEnum,VertexSIdEnum);
-	}
-
-	/*Save steric rate, and cumulate it through time, cumulate with barystatic sea level rise, and cumulate through time:*/
-	gmtslr=steric_rate_g->Max()*dt;
-	cumgmtslr+=gmtslr;
-	cumgmslr=cumbslr+cumgmtslr;
-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,GmtslrEnum,gmtslr,step,time));
-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumGmtslrEnum,cumgmtslr,step,time));
-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumGmslrEnum,cumgmslr,step,time));
-	femmodel->parameters->SetParam(cumgmtslr,CumGmtslrEnum);
-
-	/*compute: sea level change = initial sea level + (N_gia_rate+N_esa_rate)  * dt + steric_rate + dynamic_rate dt*/
-	if(grd){
-		SL->AXPY(N_gia_rate,dt);
-		SL->AXPY(N_esa_rate,dt);
-	}
-	SL->AXPY(steric_rate_g,dt);
-	SL->AXPY(dynamic_rate_g,dt);
-
-	/*compute new bedrock position: */
-	if(grd){
-		bedrock->AXPY(U_esa_rate,dt);
-		bedrock->AXPY(U_gia_rate,dt);
-	}
-
-	/*update element inputs:*/
-	InputUpdateFromVectorx(femmodel,bedrock,BedEnum,VertexSIdEnum);	
-	InputUpdateFromVectorx(femmodel,SL,SealevelEnum,VertexSIdEnum);	
-
-	/*Free ressources:*/	
-	delete bedrock;
-	delete SL;
-	delete steric_rate_g;
-	delete dynamic_rate_g;
-	if(grd){
-		delete U_esa_rate;
-		delete U_gia_rate;
-		delete N_esa_rate;
-		delete N_gia_rate;
-	}
+	femmodel->parameters->FindParam(&sealevelloading,SolidearthSettingsSealevelLoadingEnum);
+	femmodel->parameters->FindParam(&max_nonlinear_iterations,SolidearthSettingsMaxiterEnum);
+	femmodel->parameters->FindParam(&viscous,SolidearthSettingsViscousEnum);
+	femmodel->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
+	femmodel->parameters->FindParam(&planethasocean,SolidearthSettingsGrdOceanEnum);
+	/*}}}*/
+
+	/*only run if grd was requested, if we are the earth, and we have reached
+	 * the necessary number of time steps dictated by :*/
+	if(!grd)            return;
+	if(count!=frequency)return;
+	femmodel->parameters->FindParam(&iscoupling,IsSlcCouplingEnum);
+	if(iscoupling){
+		femmodel->parameters->FindParam(&modelid,ModelIdEnum);
+		femmodel->parameters->FindParam(&earthid,EarthIdEnum);
+		if(modelid!=earthid)return;
+	}
+	/*branch directly to Ivins deformation core if requested:*/
+	if(grdmodel==IvinsEnum){
+		ivins_deformation_core(femmodel);
+		return;
+	}
+
+	/*retrieve parameters: {{{*/ 
+	femmodel->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
+	barycontribparam = xDynamicCast<GenericParam<BarystaticContributions*>*>(femmodel->parameters->FindParamObject(BarystaticContributionsEnum));
+	barycontrib=barycontribparam->GetParameterValue();
+	femmodel->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
+	femmodel->parameters->FindParam(&eps_rel,SolidearthSettingsReltolEnum);
+	femmodel->parameters->FindParam(&eps_abs,SolidearthSettingsAbstolEnum);
+	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+	/*}}}*/
+
+	/*initialize loads and sea level loads:*/
+	femmodel->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+
+	loads=new GrdLoads(nel,slgeom);
+	subelementoceanareas=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
+	oceanareas=new Vector<IssmDouble>(nel);
+	sealevelpercpu=xNewZeroInit<IssmDouble>(femmodel->vertices->Size());
+
+	if(VerboseSolution()) _printf0_("	  starting  GRD convolutions\n");
+
+	/*update viscous RSL:*/
+	for(Object* & object : femmodel->elements->objects){
+		Element* element = xDynamicCast<Element*>(object);
+		element->SealevelchangeUpdateViscousFields();
+	}
+
+	/*buildup loads: */
+	for(Object* & object : femmodel->elements->objects){
+		Element* element = xDynamicCast<Element*>(object);
+		element->SealevelchangeBarystaticLoads(loads, barycontrib,slgeom); 
+	}
+
+	//broadcast loads 
+	loads->BroadcastLoads();
+
+	//compute polar motion:
+	PolarMotion(&polarmotionvector[0],femmodel,loads,slgeom);
+
+	/*skip computation of sea level equation if requested, which means sea level loads should be zeroed */
+	if(!sealevelloading){
+		loads->sealevelloads=xNewZeroInit<IssmDouble>(nel);
+		loads->subsealevelloads=xNewZeroInit<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
+
+		goto deformation;
+	}
+
+	if(VerboseSolution()) _printf0_("	  converging GRD convolutions\n");
+	for(;;){
+
+		oldsealevelloads=loads->vsealevelloads->Duplicate(); loads->vsealevelloads->Copy(oldsealevelloads);
+
+		/*convolve load and sealevel loads on oceans:*/
+		for(Object* & object : femmodel->elements->objects){
+			Element* element = xDynamicCast<Element*>(object);
+			element->SealevelchangeConvolution(sealevelpercpu, loads , polarmotionvector,slgeom);
+		}
+
+		/*retrieve sea level average  and ocean area:*/
+		for(Object* & object : femmodel->elements->objects){
+			Element* element = xDynamicCast<Element*>(object);
+			element->SealevelchangeOceanAverage(loads, oceanareas, subelementoceanareas, sealevelpercpu, slgeom);
+		}
+
+		loads->AssembleSealevelLoads();
+
+		/*compute ocean areas:*/
+		if(!loads->sealevelloads){ //first time in the loop
+			oceanareas->Assemble(); 
+			subelementoceanareas->Assemble();
+			oceanareas->Sum(&totaloceanarea); _assert_(totaloceanarea>0.);
+			if(scaleoceanarea) totaloceanarea=3.619e+14; // use true ocean area, m^2
+		}
+
+		//Conserve ocean mass: 
+		oceanaverage=SealevelloadsOceanAverage(loads, oceanareas,subelementoceanareas, totaloceanarea);
+		ConserveOceanMass(femmodel,loads,barycontrib->Total()/totaloceanarea - oceanaverage,slgeom);
+
+		//broadcast sea level loads 
+		loads->BroadcastSealevelLoads();
+
+		//compute polar motion:
+		PolarMotion(&polarmotionvector[0],femmodel,loads, slgeom);
+
+		//convergence?
+		if(slcconvergence(loads->vsealevelloads,oldsealevelloads,eps_rel,eps_abs))break;
+
+		//early return?
+		if(iterations>=max_nonlinear_iterations)break;
+		iterations++;
+	}
+
+	deformation:
+
+	if(VerboseSolution()) _printf0_("	  deformation GRD convolutions\n");
+
+	/*convolve loads and sea level loads to get the deformation:*/
+	for(Object* & object : femmodel->elements->objects){
+		Element* element = xDynamicCast<Element*>(object);
+		element->SealevelchangeDeformationConvolution(sealevelpercpu, loads, polarmotionvector,slgeom);
+	}
+
+	if(VerboseSolution()) _printf0_("	  updating GRD fields\n");
+
+	if(planethasocean){
+		if (!sealevelloading){ //we haven't done so before, so we need to compute the ocean average and area
+			loads->sealevelloads=NULL; //needed to trigger the calculation of areas
+			/*retrieve sea level average  and ocean area:*/
+			for(Object* & object : femmodel->elements->objects){
+				Element* element = xDynamicCast<Element*>(object);
+				element->SealevelchangeOceanAverage(loads, oceanareas, subelementoceanareas, sealevelpercpu, slgeom);
+			}
+			loads->sealevelloads=xNewZeroInit<IssmDouble>(nel);
+			loads->AssembleSealevelLoads();
+			/*compute ocean areas:*/
+			oceanareas->Assemble(); 
+			subelementoceanareas->Assemble();
+			oceanareas->Sum(&totaloceanarea); _assert_(totaloceanarea>0.);
+			if(scaleoceanarea) totaloceanarea=3.619e+14; // use true ocean area, m^2
+
+			//Conserve ocean mass
+			//Note that here we create sea-level loads but they will not generate GRD as we have already run all the convolutions
+			oceanaverage=SealevelloadsOceanAverage(loads, oceanareas,subelementoceanareas, totaloceanarea);
+			ConserveOceanMass(femmodel,loads,barycontrib->Total()/totaloceanarea - oceanaverage,slgeom);
+		}
+
+		femmodel->inputs->Shift(SealevelGRDEnum,barycontrib->Total()/rho_water/totaloceanarea- oceanaverage/rho_water);
+
+		//cumulate barystatic contributions and save to results: 
+		barycontrib->Cumulate(femmodel->parameters);
+		barycontrib->Save(femmodel->results,femmodel->parameters,totaloceanarea);
+		barycontrib->Reset();
+	}
+
+	if (rotation) {
+		femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,SealevelInertiaTensorXZEnum,polarmotionvector[0],step,time));
+		femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,SealevelInertiaTensorYZEnum,polarmotionvector[1],step,time));
+		femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,SealevelInertiaTensorZZEnum,polarmotionvector[2],step,time));
+	}
+
+	/*Update bedrock motion and geoid:*/
+	femmodel->inputs->AXPY(1,SealevelGRDEnum,SealevelEnum);
+	femmodel->inputs->AXPY(1,BedGRDEnum,BedEnum);
+	if(horiz){
+		femmodel->inputs->AXPY(1,BedEastGRDEnum,BedEastEnum);
+		femmodel->inputs->AXPY(1,BedNorthGRDEnum, BedNorthEnum);
+	}
+
 }
 /*}}}*/
-
-SealevelMasks* sealevelrise_core_masks(FemModel* femmodel) {  /*{{{*/
-
-	if(VerboseSolution()) _printf0_("	  computing sea level masks\n");
-	
-	/*initialize SealevelMasks structure: */
-	SealevelMasks* masks=new SealevelMasks(femmodel->elements->Size());
-
-	/*go through elements and fill the masks: */
+void              dynstr_core(FemModel* femmodel){ /*{{{*/
+
+	/*variables:*/
+	Vector<IssmDouble> *sealevel  = NULL; 
+	Vector<IssmDouble> *deltadsl  = NULL; 
+	Vector<IssmDouble> *deltastr = NULL;
+
+	/*parameters: */
+	int  step;
+	bool isocean=false;
+	IssmDouble time;
+
+	IssmDouble cumgmtslc=0;
+	IssmDouble cumbslc=0;
+	IssmDouble cumgmslc=0;
+	IssmDouble gmtslc=0;
+
+	/*early return if we have no ocean transport:*/
+	femmodel->parameters->FindParam(&isocean,TransientIsoceantransportEnum);
+	if(!isocean)return;
+
+	/*Verbose: */
+	if(VerboseSolution()) _printf0_("	  computing steric and dynamic sea level change\n");
+
+	/*Retrieve sealevel and add steric + dynamic rates:*/
+	GetVectorFromInputsx(&sealevel,femmodel,SealevelEnum,VertexSIdEnum);
+	GetVectorFromInputsx(&deltadsl,femmodel,DeltaDslEnum,VertexSIdEnum);
+	GetVectorFromInputsx(&deltastr,femmodel,DeltaStrEnum,VertexSIdEnum);
+
+	/*compute: sea level change = initial sea level + steric + dynamic*/
+	sealevel->AXPY(deltadsl,1);
+	sealevel->AXPY(deltastr,1);
+
+	/*cumulate thermal steric rate:*/
+	femmodel->parameters->FindParam(&cumgmtslc,CumGmtslcEnum); 
+	femmodel->parameters->FindParam(&cumbslc,CumBslcEnum); 
+
+	gmtslc=deltastr->Norm(NORM_TWO);
+	cumgmtslc+=gmtslc;
+	cumgmslc=cumbslc+cumgmtslc;
+
+	femmodel->parameters->SetParam(cumgmtslc,CumGmtslcEnum);
+	femmodel->parameters->SetParam(cumgmslc,CumGmslcEnum);
+
+	/*Outputs some metrics:*/
+	femmodel->parameters->FindParam(&step,StepEnum);
+	femmodel->parameters->FindParam(&time,TimeEnum);
+
+	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,GmtslcEnum,gmtslc,step,time));
+	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumGmtslcEnum,cumgmtslc,step,time));
+	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumGmslcEnum,cumgmslc,step,time));
+
+	/*update element inputs:*/
+	InputUpdateFromVectorx(femmodel,sealevel,SealevelEnum,VertexSIdEnum);	
+
+	/*Free ressources:*/	
+	delete sealevel;
+	delete deltadsl;
+	delete deltastr;
+}
+/*}}}*/
+void              coupleroutput_core(FemModel* femmodel){  /*{{{*/
+
+	/*parameters:*/
+	int iscoupling;
+	int horiz=0;
+
+	/*retrieve more parameters:*/
+	femmodel->parameters->FindParam(&iscoupling,IsSlcCouplingEnum);
+	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+
+	if(iscoupling){
+		/*transfer sea level back to ice caps:*/
+		TransferSealevel(femmodel,SealevelEnum);
+		TransferSealevel(femmodel,BedEnum);
+		if(horiz){
+			TransferSealevel(femmodel,BedNorthEnum);
+			TransferSealevel(femmodel,BedEastEnum);
+		}
+	}
+}; /*}}}*/
+void              ivins_deformation_core(FemModel* femmodel){ /*{{{*/
+
+	int  gsize;
+	Vector<IssmDouble> *bedup  = NULL; 
+	Vector<IssmDouble> *beduprate= NULL; 
+	IssmDouble          *xx     = NULL;
+	IssmDouble          *yy     = NULL;
+
+	if(VerboseSolution()) _printf0_("	  computing vertical deformation using Ivins model. \n");
+
+	/*find size of vectors:*/
+	gsize      = femmodel->nodes->NumberOfDofs(GsetEnum);
+
+	/*Find the litho material to be used by all the elements:*/
+	Matlitho* matlitho=NULL;
+	for (Object* & object: femmodel->materials->objects){
+		Material* material=xDynamicCast<Material*>(object);
+		if(material->ObjectEnum()==MatlithoEnum){
+			matlitho=xDynamicCast<Matlitho*>(material);
+			break;
+		}
+	}
+
+	/*initialize vectors:*/
+	bedup = new Vector<IssmDouble>(gsize);
+	beduprate = new Vector<IssmDouble>(gsize);
+
+	/*retrieve geometric information: */
+	VertexCoordinatesx(&xx,&yy,NULL,femmodel->vertices); 
+
+	/*Go through elements, and add contribution from each element to the deflection vector wg:*/
+	for(Object* & object : femmodel->elements->objects){
+		Element* element = xDynamicCast<Element*>(object);
+		element->GiaDeflection(bedup,beduprate, matlitho, xx,yy);
+	}
+
+	/*Assemble parallel vector:*/
+	beduprate->Assemble();
+	bedup->Assemble();
+
+	/*Save results:*/
+	InputUpdateFromVectorx(femmodel,bedup,BedGRDEnum,VertexSIdEnum);
+	femmodel->inputs->AXPY(1,BedGRDEnum,BedEnum);
+
+	/*Free ressources: */
+	xDelete<IssmDouble>(xx);
+	xDelete<IssmDouble>(yy);
+	delete beduprate;
+	delete bedup;
+}
+/*}}}*/
+void              sealevelchange_initialgeometry(FemModel* femmodel) {  /*{{{*/
+
+	/*Geometry core where we compute geometrical kernels and weights:*/
+
+	/*parameters: */
+	IssmDouble *xxe    = NULL;
+	IssmDouble *yye    = NULL;
+	IssmDouble *zze    = NULL;
+	IssmDouble* areae  = NULL;
+	int  nel;
+	int  grdmodel=0;
+
+	/*retrieve parameters:*/
+	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+	nel=femmodel->elements->NumberOfElements();
+
+	/*early return?:*/
+	if(grdmodel==IvinsEnum) return;
+
+	/*Verbose: */
+	if(VerboseSolution()) _printf0_("	  computing initial sea level geometrical kernels and weights.\n");
+
+	/*recover x,y,z and areas from elements: */
+	ElementCoordinatesx(&xxe,&yye,&zze,&areae,femmodel->elements);
+
+	/*Run sealevel geometry routine in elements:*/
 	for(Object* & object : femmodel->elements->objects){
 		Element*   element=xDynamicCast<Element*>(object);
-		element->SetSealevelMasks(masks);
-	}
-
-	return masks;
+		element->SealevelchangeGeometryInitial(xxe,yye,zze,areae);
+	}
+
+	femmodel->parameters->AddObject(new DoubleVecParam(XxeEnum,xxe,nel));
+	femmodel->parameters->AddObject(new DoubleVecParam(YyeEnum,yye,nel));
+	femmodel->parameters->AddObject(new DoubleVecParam(ZzeEnum,zze,nel));
+	femmodel->parameters->AddObject(new DoubleVecParam(AreaeEnum,areae,nel));
+
+	#ifdef _ISSM_DEBUG_
+	femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,XxeEnum,xxe,nel,1,1,1));
+	femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,YyeEnum,yye,nel,1,1,1));
+	femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,ZzeEnum,zze,nel,1,1,1));
+	femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,AreaeEnum,areae,nel,1,1,1));
+	#endif
+
+	return;
+
 }/*}}}*/
-void sealevelrise_core_geometry(FemModel* femmodel) {  /*{{{*/
-
-	/*Geometry core where we compute indices into tables pre computed in the SealevelRiseAnalysis: */
+SealevelGeometry* sealevelchange_geometry(FemModel* femmodel) {  /*{{{*/
+
+	/*Geometry core where we compute updates to the Green function kernels and weights, dependent 
+	 * on the evolution of levelsets: */
 
 	/*parameters: */
-	bool spherical=true;
-	IssmDouble *latitude  = NULL;
-	IssmDouble *longitude = NULL;
-	IssmDouble *radius    = NULL;
-	IssmDouble *xx    = NULL;
-	IssmDouble *yy    = NULL;
-	IssmDouble *zz    = NULL;
-	int  horiz;
-	bool geometrydone = false;
-
-		
+	IssmDouble *xxe    = NULL;
+	IssmDouble *yye    = NULL;
+	IssmDouble *zze    = NULL;
+	IssmDouble* areae  = NULL;
+
+	int nel;
+	int  grdmodel=0;
+	SealevelGeometry* slgeom=NULL;
+
+	/*early return?:*/
+	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+	if(grdmodel==IvinsEnum) return NULL;
+
 	/*retrieve parameters:*/
-	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
-	femmodel->parameters->FindParam(&geometrydone,SealevelriseGeometryDoneEnum);
-
-	if(geometrydone){
-		if(VerboseSolution()) _printf0_("	  geometrical offsets have already been computed, skipping \n");
-		return; //don't need to run this again.
-	}
+	femmodel->parameters->FindParam(&xxe,&nel,XxeEnum);
+	femmodel->parameters->FindParam(&yye,&nel,YyeEnum);
+	femmodel->parameters->FindParam(&zze,&nel,ZzeEnum);
+	femmodel->parameters->FindParam(&areae,&nel,AreaeEnum);
+
+	/*initialize SealevelloadMasks structure: */
+	slgeom=new SealevelGeometry(femmodel->elements->Size(),femmodel->vertices->Size());
 
 	/*Verbose: */
-	if(VerboseSolution()) _printf0_("	  computing geometrical offsets into precomputed Green tables \n");
-
-	/*first, recover lat,long and radius vectors from vertices: */
-	VertexCoordinatesx(&latitude,&longitude,&radius,femmodel->vertices,spherical); 
-	if(horiz) VertexCoordinatesx(&xx,&yy,&zz,femmodel->vertices); 
-
-
-	/*Run sealevelrise geometry routine in elements:*/
+	if(VerboseSolution()) _printf0_("	  computing sea level geometrical kernel and weight updates.\n");
+
+	/*Run sealevel geometry routine for elements with full loading:*/
 	for(Object* & object : femmodel->elements->objects){
 		Element*   element=xDynamicCast<Element*>(object);
-		element->SealevelriseGeometry(latitude,longitude,radius,xx,yy,zz);
-	}
-
-	/*Free ressources:*/
-	if(horiz){
-		xDelete<IssmDouble>(xx);
-		xDelete<IssmDouble>(yy);
-		xDelete<IssmDouble>(zz);
-	}
-	xDelete<IssmDouble>(latitude);
-	xDelete<IssmDouble>(longitude);
-	xDelete<IssmDouble>(radius);
-
-	/*Record the fact that we ran this module already: */
-	femmodel->parameters->SetParam(true,SealevelriseGeometryDoneEnum); 
-
+		element->SealevelchangeGeometryCentroidLoads(slgeom,xxe,yye,zze,areae);
+	}
+
+	/*Initialize fractional loading mapping: */
+	slgeom->InitializeMappingsAndBarycentres();
+
+	/*Run sealevel geometry routine for elements with fractional loading:*/
+	for(Object* & object : femmodel->elements->objects){
+		Element*   element=xDynamicCast<Element*>(object);
+		element->SealevelchangeGeometrySubElementLoads(slgeom,areae);
+	}
+
+	/*Assemble barycentres of fraction loading elements:*/
+	slgeom->Assemble();
+
+	/*Create fractional green function kernels: */
+	for(Object* & object : femmodel->elements->objects){
+		Element*   element=xDynamicCast<Element*>(object);
+		element->SealevelchangeGeometrySubElementKernel(slgeom);
+	}
+
+	femmodel->parameters->AddObject(new DoubleVecParam(XxeEnum,xxe,nel));
+	femmodel->parameters->AddObject(new DoubleVecParam(YyeEnum,yye,nel));
+	femmodel->parameters->AddObject(new DoubleVecParam(ZzeEnum,zze,nel));
+	femmodel->parameters->AddObject(new DoubleVecParam(AreaeEnum,areae,nel));
+
+	return slgeom;
 
 }/*}}}*/
-Vector<IssmDouble>* sealevelrise_core_eustatic(FemModel* femmodel,SealevelMasks* masks, IssmDouble* poceanarea){ /*{{{*/
-
-	/*Eustatic core of the SLR solution (terms that are constant with respect to sea-level)*/
-
-	Vector<IssmDouble> *RSLgi    = NULL;
-	IssmDouble          RSLgi_oceanaverage   = 0;
-
-	/*parameters: */
-	int  gsize;
-	IssmDouble oceanarea;
-	int        step;
-	IssmDouble time;
-
-	/*barystatic contribution:*/
-	IssmDouble bslr;
-	IssmDouble bslrice;
-	IssmDouble* bslrice_partition=NULL;
-	IssmDouble bslrhydro;
-	IssmDouble* bslrhydro_partition=NULL;
-	IssmDouble cumbslr;
-	IssmDouble cumbslrice;
-	IssmDouble cumbslrhydro;
-	IssmDouble* cumbslrice_partition=NULL;
-	int npartice;
-	IssmDouble* cumbslrhydro_partition=NULL;
-	int nparthydro;
-	
-	if(VerboseSolution()) _printf0_("	  computing bslr components on ice\n");
-
-	/*Figure out size of g-set deflection vector and allocate solution vector: */
-	gsize = femmodel->nodes->NumberOfDofs(GsetEnum);
-
-	/*some parameters:*/
-	femmodel->parameters->FindParam(&step,StepEnum);
-	femmodel->parameters->FindParam(&time,TimeEnum);
-	femmodel->parameters->FindParam(&cumbslr,CumBslrEnum);
-	femmodel->parameters->FindParam(&cumbslrice,CumBslrIceEnum);
-	femmodel->parameters->FindParam(&cumbslrhydro,CumBslrHydroEnum);
-	femmodel->parameters->FindParam(&npartice,SolidearthNpartIceEnum);
-	femmodel->parameters->FindParam(&nparthydro,SolidearthNpartHydroEnum);
-	if(npartice) femmodel->parameters->FindParam(&cumbslrice_partition,&npartice,NULL,CumBslrIcePartitionEnum);
-	if(nparthydro) femmodel->parameters->FindParam(&cumbslrhydro_partition,&nparthydro,NULL,CumBslrHydroPartitionEnum);
-
-	/*Initialize:*/
-	RSLgi = new Vector<IssmDouble>(gsize);
-
-	/*call the bslr main module: */
-	femmodel->SealevelriseEustatic(RSLgi,&oceanarea,&bslr, &bslrice, &bslrhydro, &bslrice_partition, &bslrhydro_partition,masks); //this computes 
-
-	/*we need to average RSLgi over the ocean: RHS term  4 in Eq.4 of Farrel and clarke. Only the elements can do that: */
-	RSLgi_oceanaverage=femmodel->SealevelriseOceanAverage(RSLgi,masks, oceanarea);
-
-	/*RSLg is the sum of the pure bslr component (term 3) and the contribution from the perturbation to the graviation potential due to the 
-	 * presence of ice (terms 1 and 4 in Eq.4 of Farrel and Clarke):*/
-	RSLgi->Shift(-bslr-RSLgi_oceanaverage);
-
-	/*save bslr and cumulated bslr value for results:{{{ */
-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,BslrEnum,-bslr,step,time));
-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,BslrIceEnum,-bslrice,step,time));
-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,BslrHydroEnum,-bslrhydro,step,time));
-
-	//cumulative barystatic contribution: 
-	cumbslr=cumbslr-bslr;
-	cumbslrice=cumbslrice-bslrice;
-	cumbslrhydro=cumbslrhydro-bslrhydro;
-
-	femmodel->parameters->SetParam(cumbslr,CumBslrEnum);
-	femmodel->parameters->SetParam(cumbslrice,CumBslrIceEnum);
-	femmodel->parameters->SetParam(cumbslrhydro,CumBslrHydroEnum);
-
-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumBslrEnum,cumbslr,step,time));
-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumBslrIceEnum,cumbslrice,step,time));
-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumBslrHydroEnum,cumbslrhydro,step,time));
-
-	//cumulative barystatic contributions by partition:
-	if(npartice){
-		for(int i=0;i<npartice;i++) cumbslrice_partition[i] -= bslrice_partition[i];
-		femmodel->parameters->SetParam(cumbslrice_partition,npartice,1,CumBslrIcePartitionEnum);
-		femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,CumBslrIcePartitionEnum,cumbslrice_partition,npartice,1,step,time));
-	}
-
-	if(nparthydro){
-		for(int i=0;i<nparthydro;i++) cumbslrhydro_partition[i] -= bslrhydro_partition[i];
-		femmodel->parameters->SetParam(cumbslrhydro_partition,nparthydro,1,CumBslrHydroPartitionEnum);
-		femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,CumBslrHydroPartitionEnum,cumbslrhydro_partition,nparthydro,1,step,time));
-	}
-	/*}}}*/
-	
-	/*Assign output pointers and return: */
-	*poceanarea=oceanarea;
-	return RSLgi;
-}/*}}}*/
-Vector<IssmDouble>* sealevelrise_core_noneustatic(FemModel* femmodel, SealevelMasks* masks, Vector<IssmDouble>* RSLg_eustatic,IssmDouble oceanarea){ /*{{{*/
-
-	/*sealevelrise_core_noneustatic.cpp //this computes the contributions from Eq.4 of Farrel and Clarke, rhs terms 2 and 5.
-	  non eustatic core of the SLR solution */
-
-	Vector<IssmDouble> *RSLg    = NULL;
-	Vector<IssmDouble> *RSLg_old    = NULL;
-
-	Vector<IssmDouble> *RSLgo    = NULL; //ocean convolution of the perturbation to gravity potential.
-	Vector<IssmDouble> *RSLgo_rot= NULL; // rotational feedback 
-	IssmDouble          RSLgo_oceanaverage = 0;  //average of RSLgo over the ocean.
-
-	/*parameters: */
-	int count;
-	bool save_results;
-	int  gsize;
+
+/*subroutines:*/
+bool slcconvergence(Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs){ /*{{{*/
+
 	bool converged=true;
-	bool rotation=true;
-	bool verboseconvolution=true;
-	int max_nonlinear_iterations;
-	IssmDouble           eps_rel;
-	IssmDouble           eps_abs;
-	IssmDouble			Ixz, Iyz, Izz; 
-	
-	if(VerboseSolution()) _printf0_("	  converging on ocean components\n");
-
-	/*Recover some parameters: */
-	femmodel->parameters->FindParam(&max_nonlinear_iterations,SolidearthSettingsMaxiterEnum);
-	femmodel->parameters->FindParam(&eps_rel,SolidearthSettingsReltolEnum);
-	femmodel->parameters->FindParam(&eps_abs,SolidearthSettingsAbstolEnum);
-
-	/*computational flag: */
+	IssmDouble ndS,nS; 
+	Vector<IssmDouble> *dRSLg    = NULL;
+
+	//compute norm(du) and norm(u) if requested
+	dRSLg=RSLg_old->Duplicate(); RSLg_old->Copy(dRSLg); dRSLg->AYPX(RSLg,-1.0);
+	ndS=dRSLg->Norm(NORM_TWO); 
+
+	if (xIsNan<IssmDouble>(ndS)){
+		_error_("convergence criterion is NaN (RSL_old=" << RSLg_old->Norm(NORM_TWO) << " RSL=" << RSLg->Norm(NORM_TWO) << ")");
+	}
+
+	if(!xIsNan<IssmDouble>(eps_rel)){
+		nS=RSLg_old->Norm(NORM_TWO);
+		if (xIsNan<IssmDouble>(nS)) _error_("convergence criterion is NaN! (check the initial RSL)");
+	}
+
+	//clean up
+	delete dRSLg;
+
+	//print
+	if(!xIsNan<IssmDouble>(eps_rel)){
+		if((ndS/nS)<eps_rel){
+			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)/norm(S)" << ndS/nS*100 << " < " << eps_rel*100 << " %\n");
+		}
+		else{ 
+			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)/norm(S)" << ndS/nS*100 << " > " << eps_rel*100 << " %\n");
+			converged=false;
+		}
+	}
+	if(!xIsNan<IssmDouble>(eps_abs)){
+		if(ndS<eps_abs){
+			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)" << ndS << " < " << eps_abs << " \n");
+		}
+		else{ 
+			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)" << ndS << " > " << eps_abs << " \n");
+			converged=false;
+		}
+	}
+
+	/*assign output*/
+	return converged;
+
+} /*}}}*/
+IssmDouble  SealevelloadsOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* suboceanareas, IssmDouble totaloceanarea){ /*{{{*/
+
+	IssmDouble sealevelloadsaverage;	
+	IssmDouble subsealevelloadsaverage;	
+
+	Vector<IssmDouble>* vsealevelloadsvolume=loads->vsealevelloads->Duplicate();
+	Vector<IssmDouble>* vsubsealevelloadsvolume=loads->vsubsealevelloads->Duplicate();
+
+	vsealevelloadsvolume->PointwiseMult(loads->vsealevelloads,oceanareas);
+	vsubsealevelloadsvolume->PointwiseMult(loads->vsubsealevelloads,suboceanareas);
+
+	vsealevelloadsvolume->Sum(&sealevelloadsaverage);
+	vsubsealevelloadsvolume->Sum(&subsealevelloadsaverage);
+	delete vsealevelloadsvolume; 
+	delete vsubsealevelloadsvolume; 
+
+	return (sealevelloadsaverage+subsealevelloadsaverage)/totaloceanarea;
+} /*}}}*/
+void PolarMotion(IssmDouble* polarmotionvector, FemModel* femmodel,GrdLoads* loads, SealevelGeometry* slgeom){ /*{{{*/
+
+	IssmDouble  moi_list[3]={0,0,0};
+	IssmDouble  moi_list_sub[3]={0,0,0};
+	IssmDouble  moi_list_cpu[3]={0,0,0};
+	IssmDouble*	tide_love_h  = NULL;
+	IssmDouble*	tide_love_k  = NULL;
+	IssmDouble*	load_love_k  = NULL;
+	IssmDouble  tide_love_k2secular;
+	IssmDouble  moi_e, moi_p;
+	IssmDouble	m1, m2, m3;
+	bool rotation=false;
+
+	/*early return?:*/
 	femmodel->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
-
-	/*Figure out size of g-set deflection vector and allocate solution vector: */
-	gsize = femmodel->nodes->NumberOfDofs(GsetEnum);
-
-	/*Initialize:*/
-	RSLg = new Vector<IssmDouble>(gsize);
-	RSLg->Assemble();
-	RSLg_eustatic->Copy(RSLg);  //first initialize RSLg with the eustatic component computed in sealevelrise_core_eustatic.
-
-	RSLg_old = new Vector<IssmDouble>(gsize);
-	RSLg_old->Assemble();
-
-	count=1;
-	converged=false;
-
-	/*Start loop: */
-	for(;;){
-
-		//save pointer to old sea level rise
-		delete RSLg_old; RSLg_old=RSLg; 
-
-		/*Initialize solution vector: */
-		RSLg  = new Vector<IssmDouble>(gsize); RSLg->Assemble();
-		RSLgo = new Vector<IssmDouble>(gsize); RSLgo->Assemble();
-
-		/*call the non eustatic module: */
-		femmodel->SealevelriseNonEustatic(RSLgo, RSLg_old,  masks, verboseconvolution);
-
-		/*assemble solution vector: */
-		RSLgo->Assemble(); 
-
-		if(rotation){
-
-			/*call rotational feedback  module: */
-			RSLgo_rot = new Vector<IssmDouble>(gsize); RSLgo_rot->Assemble();
-			femmodel->SealevelriseRotationalFeedback(RSLgo_rot,RSLg_old,&Ixz,&Iyz,&Izz, masks); 
-			RSLgo_rot->Assemble(); 
-
-			/*save changes in inertia tensor as results: */
-			femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,SealevelInertiaTensorXZEnum,Ixz));
-			femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,SealevelInertiaTensorYZEnum,Iyz));
-			femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,SealevelInertiaTensorZZEnum,Izz));
-
-			RSLgo->AXPY(RSLgo_rot,1); 
-		}
-
-		/*we need to average RSLgo over the ocean: RHS term  5 in Eq.4 of Farrel and clarke. Only the elements can do that: */
-		RSLgo_oceanaverage=femmodel->SealevelriseOceanAverage(RSLgo,masks, oceanarea);
-
-		/*RSLg is the sum of the eustatic term, and the ocean terms: */
-		RSLg_eustatic->Copy(RSLg); RSLg->AXPY(RSLgo,1); 
-		RSLg->Shift(-RSLgo_oceanaverage);
-
-		/*convergence criterion:*/
-		slrconvergence(&converged,RSLg,RSLg_old,eps_rel,eps_abs);
-		
-	
-		/*free ressources: */
-		delete RSLgo;
-		delete RSLgo_rot;
-
-		/*Increase count: */
-		count++;
-		if(converged==true){
-			break;
-		}
-		if(count>=max_nonlinear_iterations){
-			_printf0_("   maximum number of nonlinear iterations (" << max_nonlinear_iterations << ") exceeded\n"); 
-			converged=true;
-			break;
-		}	
-
-		/*some minor verbosing adjustment:*/
-		if(count>1)verboseconvolution=false;
-
-	}
-	if(VerboseConvergence()) _printf0_("\n              total number of iterations: " << count-1 << "\n");
-	
-	
-	delete RSLg_old;
-
-	return RSLg;
+	if(!rotation)return;
+
+	/*retrieve parameters: */
+	femmodel->parameters->FindParam(&load_love_k,NULL,NULL,LoadLoveKEnum);
+	femmodel->parameters->FindParam(&tide_love_h,NULL,NULL,TidalLoveHEnum);
+	femmodel->parameters->FindParam(&tide_love_k,NULL,NULL,TidalLoveKEnum);
+	femmodel->parameters->FindParam(&tide_love_k2secular,TidalLoveK2SecularEnum);
+	femmodel->parameters->FindParam(&moi_e,RotationalEquatorialMoiEnum);
+	femmodel->parameters->FindParam(&moi_p,RotationalPolarMoiEnum);
+
+	for(Object* & object : femmodel->elements->objects){
+		Element* element = xDynamicCast<Element*>(object);
+
+		element->SealevelchangeMomentOfInertiaCentroid(&moi_list[0],loads,slgeom);
+		element->SealevelchangeMomentOfInertiaSubElement(&moi_list_sub[0],loads, slgeom);
+
+		moi_list_cpu[0] += moi_list[0]+moi_list_sub[0];
+		moi_list_cpu[1] += moi_list[1]+moi_list_sub[1];
+		moi_list_cpu[2] += moi_list[2]+moi_list_sub[2];
+	}
+
+	for (int i=0;i<3;i++) moi_list[i]=0;
+
+	ISSM_MPI_Reduce (&moi_list_cpu[0],&moi_list[0],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+	ISSM_MPI_Bcast(&moi_list[0],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+
+	ISSM_MPI_Reduce (&moi_list_cpu[1],&moi_list[1],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+	ISSM_MPI_Bcast(&moi_list[1],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+
+	ISSM_MPI_Reduce (&moi_list_cpu[2],&moi_list[2],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+	ISSM_MPI_Bcast(&moi_list[2],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+
+	/*compute perturbation terms for angular velocity vector: */
+	m1 = 1/(1-tide_love_k[2]/tide_love_k2secular) * (1+load_love_k[2])/(moi_p-moi_e) * moi_list[0];
+	m2 = 1/(1-tide_love_k[2]/tide_love_k2secular) * (1+load_love_k[2])/(moi_p-moi_e) * moi_list[1];
+	m3 = -(1+load_love_k[2])/moi_p * moi_list[2];	// term associated with fluid number (3-order-of-magnitude smaller) is negelected
+
+	/*Assign output pointers:*/
+	polarmotionvector[0]=m1;
+	polarmotionvector[1]=m2;
+	polarmotionvector[2]=m3;
 } /*}}}*/
-void sealevelrise_core_elastic(Vector<IssmDouble>** pU_esa, Vector<IssmDouble>** pU_north_esa,Vector<IssmDouble>** pU_east_esa,FemModel* femmodel,Vector<IssmDouble>* RSLg, SealevelMasks* masks){ /*{{{*/
-
-	Vector<IssmDouble> *U_esa  = NULL; 
-	Vector<IssmDouble> *U_north_esa   = NULL; 
-	Vector<IssmDouble> *U_east_esa    = NULL; 
-
-	/*parameters: */
-	int  gsize;
-	bool spherical=true;
-
-	IssmDouble          *latitude   = NULL;
-	IssmDouble          *longitude  = NULL;
-	IssmDouble          *radius     = NULL;
-	IssmDouble          *xx     = NULL;
-	IssmDouble          *yy     = NULL;
-	IssmDouble          *zz     = NULL;
-	int  horiz;
-	
-	if(VerboseSolution()) _printf0_("	  computing vertical and horizontal geodetic signatures\n");
-
-	/*retrieve some parameters:*/
-	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
-
-	/*find size of vectors:*/
-	gsize      = femmodel->nodes->NumberOfDofs(GsetEnum);
-
-	/*intialize vectors:*/
-	U_esa = new Vector<IssmDouble>(gsize);
-	if (horiz){
-		U_north_esa = new Vector<IssmDouble>(gsize);
-		U_east_esa = new Vector<IssmDouble>(gsize);
-	}
-
-	/*retrieve geometric information: */
-	VertexCoordinatesx(&latitude,&longitude,&radius,femmodel->vertices,spherical); 
-	VertexCoordinatesx(&xx,&yy,&zz,femmodel->vertices); 
-
-	/*call the elastic main modlule:*/ 
-	femmodel->SealevelriseElastic(U_esa,U_north_esa,U_east_esa,RSLg, masks);
-
-	/*Assign output pointers:*/
-	*pU_esa=U_esa;
-	if(horiz){
-		*pU_east_esa=U_east_esa;
-		*pU_north_esa=U_north_esa;
-	}
-
-	/*Free ressources: */
-	xDelete<IssmDouble>(longitude);
-	xDelete<IssmDouble>(latitude);
-	xDelete<IssmDouble>(xx);
-	xDelete<IssmDouble>(yy);
-	xDelete<IssmDouble>(zz);
-	xDelete<IssmDouble>(radius);
-}
-/*}}}*/
-void sealevelrise_core_viscous(Vector<IssmDouble>** pU_gia, Vector<IssmDouble>** pN_gia,FemModel* femmodel,Vector<IssmDouble>* RSLg){ /*{{{*/
-
-	/*variables:*/
-	Vector<IssmDouble> *U_gia  = NULL; 
-	Vector<IssmDouble> *N_gia  = NULL; 
-
-	/*parameters:*/
-	int					frequency;
-	IssmDouble          dt;
-	
-	if(VerboseSolution()) _printf0_("	  computing viscous components\n");
-
-	/*retrieve some parameters:*/
-	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
-	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
-
-	/*recover GIA rates:*/
-	GetVectorFromInputsx(&U_gia,femmodel,UGiaRateEnum,VertexSIdEnum);
-	GetVectorFromInputsx(&N_gia,femmodel,NGiaRateEnum,VertexSIdEnum);
-
-	/*we just loaded rates, that's not what's being asked, scale by time:*/ 
-	U_gia->Scale(frequency*dt);
-	N_gia->Scale(frequency*dt);
-
-	/*Assign output pointers:*/
-	*pU_gia=U_gia;
-	*pN_gia=N_gia;
-
-}
-/*}}}*/
-void sealevelrise_diagnostics(FemModel* femmodel,Vector<IssmDouble>* RSLg){ /*{{{*/
-
-	/*compute spherical harmonics deg 1 and deg 2 coefficeints:*/
-
-}
-/*}}}*/
-void GetDynamicRate(Vector<IssmDouble> ** pdynamic_rate_g, FemModel* femmodel){ /*{{{*/
-
-	int dslmodel=-1;
-	IssmDouble time;
-
-	/*variables:*/
-	Vector<IssmDouble> *dynamic_rate_g  = NULL; 
-
-	/*Update steric rates before retrieving them on Vertex SID set:*/
-	femmodel->parameters->FindParam(&dslmodel,DslModelEnum);
-	femmodel->parameters->FindParam(&time,TimeEnum);
-	if(dslmodel==1){
-		TransientInput* transient_input  = femmodel->inputs->GetTransientInput(DslSeaSurfaceHeightChangeAboveGeoidEnum);
-		TriaInput* tria_input=transient_input->GetTriaInput(time);
-		Input* tria_input_copy=tria_input->copy();
-		tria_input_copy->ChangeEnum(DslDynamicRateEnum);
-		femmodel->inputs->AddInput(tria_input_copy);
-	}
-	else if(dslmodel==2){
-	
-		IssmDouble modelid;
-		
-		/*Recover modelid:*/
-		femmodel->parameters->FindParam(&modelid,DslModelidEnum);
-		modelid--; //from matlab. 
-		
-		/*find the DslSeaSurfaceHeightChangeAboveGeoidEnum dataset of transient inputs:*/
-		DatasetInput* dataset_input=femmodel->inputs->GetDatasetInput(DslSeaSurfaceHeightChangeAboveGeoidEnum);
-		
-		/*Go find the modelid'th transient input:*/
-		TriaInput* tria_input=dataset_input->GetTriaInputByOffset(reCast<int, IssmDouble>(modelid));
-		
-		/*Plug into DslDynamicRate input: */
-		Input* tria_input_copy=tria_input->copy();
-		tria_input_copy->ChangeEnum(DslDynamicRateEnum);
-		femmodel->inputs->AddInput(tria_input_copy);
-	}
-	else _error_("not implemented yet");
-
-	GetVectorFromInputsx(&dynamic_rate_g,femmodel,DslDynamicRateEnum,VertexSIdEnum);
-	*pdynamic_rate_g=dynamic_rate_g;
-}
-/*}}}*/
-void GetStericRate(Vector<IssmDouble> ** psteric_rate_g, FemModel* femmodel){ /*{{{*/
-
-	int dslmodel=-1;
-	IssmDouble time;
-
-	/*variables:*/
-	Vector<IssmDouble> *steric_rate_g  = NULL; 
-
-	/*Update steric rates before retrieving them on Vertex SID set:*/
-	femmodel->parameters->FindParam(&dslmodel,DslModelEnum);
-	femmodel->parameters->FindParam(&time,TimeEnum);
-	if(dslmodel==1){
-		TransientInput* transient_input  = femmodel->inputs->GetTransientInput(DslGlobalAverageThermostericSeaLevelChangeEnum);
-		TriaInput* tria_input=transient_input->GetTriaInput(time);
-		Input* tria_input_copy=tria_input->copy();
-		tria_input_copy->ChangeEnum(DslStericRateEnum);
-		femmodel->inputs->AddInput(tria_input_copy);
-	}
-	else if (dslmodel==2){
-		IssmDouble modelid;
-		
-		/*Recover modelid:*/
-		femmodel->parameters->FindParam(&modelid,DslModelidEnum);
-		
-		modelid--; //from matlab. 
-		
-		/*find the DslGlobalAverageThermostericSeaLevelChangeEnum dataset of transient inputs:*/
-		DatasetInput* dataset_input=femmodel->inputs->GetDatasetInput(DslGlobalAverageThermostericSeaLevelChangeEnum);
-		
-		/*Go find the modelid'th transient input:*/
-		TriaInput* tria_input=dataset_input->GetTriaInputByOffset(reCast<int, IssmDouble>(modelid));
-		
-		/*Plug into DslStericRate input: */
-		Input* tria_input_copy=tria_input->copy();
-		tria_input_copy->ChangeEnum(DslStericRateEnum);
-		femmodel->inputs->AddInput(tria_input_copy);
-	}
-	else _error_("not implemented yet");
-
-	GetVectorFromInputsx(&steric_rate_g,femmodel,DslStericRateEnum,VertexSIdEnum);
-	*psteric_rate_g=steric_rate_g;
-}
-/*}}}*/
-void SetBottomPressure(FemModel* femmodel){ /*{{{*/
-
-	int dslmodel=-1;
-	int type;
-
-	/*If we are running a dsl mme model, we need to update the bottom pressure first: */
-	femmodel->parameters->FindParam(&dslmodel,DslModelEnum);
-	if(dslmodel==2){
-	
-		IssmDouble modelid;
-		/*figure out the type of DslSeaWaterPressureChangeAtSeaFloor input:*/
-		type=femmodel->inputs->GetInputObjectEnum(DslSeaWaterPressureChangeAtSeaFloorEnum);
-
-		if(type==DatasetInputEnum){
-		
-			/*find the DslSeaWaterPressureChangeAtSeaFloor dataset of transient inputs:*/
-			DatasetInput* dataset_input=femmodel->inputs->GetDatasetInput(DslSeaWaterPressureChangeAtSeaFloorEnum);
-		
-			/*Recover modelid:*/
-			femmodel->parameters->FindParam(&modelid,DslModelidEnum);
-			modelid--; //from matlab. 
-		
-			/*Go find the modelid'th transient input:*/
-			TransientInput* transient_input=dataset_input->GetTransientInputByOffset(reCast<int, IssmDouble>(modelid));
-
-			/*Plug into DslSeaWaterPressureChangeAtSeaFloor input: */
-			Input* transient_input_copy=transient_input->copy();
-			transient_input_copy->ChangeEnum(DslSeaWaterPressureChangeAtSeaFloorEnum);
-			femmodel->inputs->AddInput(transient_input_copy);
-		}
-	}
-}
-/*}}}*/
-
-/*support routines:*/
+void        ConserveOceanMass(FemModel* femmodel,GrdLoads* loads, IssmDouble offset, SealevelGeometry* slgeom){ /*{{{*/
+
+	/*Shift sealevel loads by ocean average, only on ocean! :*/
+	for(Object* & object : femmodel->elements->objects){
+		Element* element = xDynamicCast<Element*>(object);
+		element->SealevelchangeShift(loads, offset,slgeom);
+	}
+	loads->AssembleSealevelLoads();
+
+} /*}}}*/
+IssmDouble* CombineLoads(IssmDouble* load,IssmDouble* subload,FemModel* femmodel, SealevelGeometry* slgeom,int loadtype,int nel){ /*{{{*/
+
+	int* indices=xNew<int>(nel);
+	for(int i=0;i<nel;i++)indices[i]=i;
+
+	Vector<IssmDouble>* vloadcopy=new Vector<IssmDouble>(nel);
+	IssmDouble* loadcopy=xNew<IssmDouble>(nel);
+
+	vloadcopy->SetValues(nel,indices,load,INS_VAL);
+	vloadcopy->Assemble();
+
+	if(subload){
+		for (int i=0;i<femmodel->elements->Size();i++){
+			if (slgeom->issubelement[loadtype][i]){
+				int se= slgeom->subelementmapping[loadtype][i];
+				IssmDouble subloadi=subload[se];
+				Element* element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i));
+				vloadcopy->SetValue(element->Sid(),subloadi,ADD_VAL);
+			}
+		}
+	}
+	vloadcopy->Assemble();
+	loadcopy=vloadcopy->ToMPISerial();
+
+	return loadcopy;
+
+} /*}}}*/
+
+/*Coupling routines:*/
 void TransferForcing(FemModel* femmodel,int forcingenum){ /*{{{*/
 
@@ -852,4 +850,5 @@
 	int*         transitions_n=NULL;
 	int          nv;
+	int          existforcing=0;         
 
 	/*communicators:*/
@@ -882,5 +881,6 @@
 	if(modelid!=earthid){
 		nv=femmodel->vertices->NumberOfVertices();
-		GetVectorFromInputsx(&forcing,femmodel,forcingenum,VertexSIdEnum);
+		existforcing=reCast<int>(femmodel->inputs->Exist(forcingenum));
+		if(existforcing)GetVectorFromInputsx(&forcing,femmodel,forcingenum,VertexSIdEnum);
 	}
 
@@ -891,13 +891,22 @@
 			nvs=xNew<int>(nummodels-1);
 			for(int i=0;i<earthid;i++){
-				ISSM_MPI_Recv(nvs+i, 1, ISSM_MPI_INT, 0,i, fromcomms[i], &status);
-				forcings[i]=xNew<IssmDouble>(nvs[i]);
-				ISSM_MPI_Recv(forcings[i], nvs[i], ISSM_MPI_DOUBLE, 0,i, fromcomms[i], &status);
+				ISSM_MPI_Recv(&existforcing, 1, ISSM_MPI_INT, 0,i, fromcomms[i], &status);
+				if(existforcing){
+					ISSM_MPI_Recv(nvs+i, 1, ISSM_MPI_INT, 0,i, fromcomms[i], &status);
+					forcings[i]=xNew<IssmDouble>(nvs[i]);
+					ISSM_MPI_Recv(forcings[i], nvs[i], ISSM_MPI_DOUBLE, 0,i, fromcomms[i], &status);
+				}
+				else{
+					forcings[i]=NULL;
+				}
 			}
 
 		}
 		else{
-			ISSM_MPI_Send(&nv, 1, ISSM_MPI_INT, 0, modelid, tocomm);
-			ISSM_MPI_Send(forcing, nv, ISSM_MPI_DOUBLE, 0, modelid, tocomm);
+			ISSM_MPI_Send(&existforcing, 1, ISSM_MPI_INT, 0, modelid, tocomm);
+			if(existforcing){
+				ISSM_MPI_Send(&nv, 1, ISSM_MPI_INT, 0, modelid, tocomm);
+				ISSM_MPI_Send(forcing, nv, ISSM_MPI_DOUBLE, 0, modelid, tocomm);
+			}
 		}
 	}
@@ -913,5 +922,5 @@
 
 		/*Retrieve transition vectors, used to plug from each ice cap into the global forcing:*/
-		femmodel->parameters->FindParam(&transitions,&ntransitions,&transitions_m,&transitions_n,SealevelriseTransitionsEnum);
+		femmodel->parameters->FindParam(&transitions,&ntransitions,&transitions_m,&transitions_n,SealevelchangeTransitionsEnum);
 
 		if(ntransitions!=earthid)_error_("TransferForcing error message: number of transition vectors is not equal to the number of icecaps!");
@@ -922,14 +931,16 @@
 
 				IssmDouble* forcingfromcap= forcings[i]; //careful, this only exists on rank 0 of the earth model!
-				IssmDouble* transition=transitions[i];
-				int         M=transitions_m[i];
-
-				/*build index to plug values: */
-				int*        index=xNew<int>(M); for(int i=0;i<M;i++)index[i]=reCast<int>(transition[i])-1; //matlab indexing!
-
-				/*We are going to plug this vector into the earth model, at the right vertices corresponding to this particular 
-				 * ice cap: */
-				forcingglobal->SetValues(M,index,forcingfromcap,ADD_VAL);
-				xDelete<int>(index);
+				if(forcingfromcap){
+					IssmDouble* transition=transitions[i];
+					int         M=transitions_m[i];
+
+					/*build index to plug values: */
+					int*        index=xNew<int>(M); for(int i=0;i<M;i++)index[i]=reCast<int>(transition[i])-1; //matlab indexing!
+
+					/*We are going to plug this vector into the earth model, at the right vertices corresponding to this particular 
+					 * ice cap: */
+					forcingglobal->SetValues(M,index,forcingfromcap,ADD_VAL);
+					xDelete<int>(index);
+				}
 			}
 		}
@@ -946,5 +957,6 @@
 	if(forcings){
 		for(int i=0;i<nummodels-1;i++){
-			IssmDouble* temp=forcings[i]; xDelete<IssmDouble>(temp);
+			IssmDouble* temp=forcings[i]; 
+			if(temp)xDelete<IssmDouble>(temp);
 		}
 		xDelete<IssmDouble*>(forcings);
@@ -1019,7 +1031,7 @@
 
 			/*Retrieve transition vectors, used to figure out global forcing contribution to each ice cap's own elements: */
-			femmodel->parameters->FindParam(&transitions,&ntransitions,&transitions_m,&transitions_n,SealevelriseTransitionsEnum);
-
-			if(ntransitions!=earthid)_error_("TransferSeaLevel error message: number of transition vectors is not equal to the number of icecaps!");
+			femmodel->parameters->FindParam(&transitions,&ntransitions,&transitions_m,&transitions_n,SealevelchangeTransitionsEnum);
+
+			if(ntransitions!=earthid)_error_("TransferSealevel error message: number of transition vectors is not equal to the number of icecaps!");
 
 			for(int i=0;i<earthid;i++){
@@ -1069,94 +1081,2 @@
 
 } /*}}}*/
-void EarthMassTransport(FemModel* femmodel){ /*{{{*/
-
-	IssmDouble time,dt;
-	Vector<IssmDouble> *oldthickness    = NULL;
-	Vector<IssmDouble> *newthickness    = NULL;
-	Vector<IssmDouble> *deltathickness    = NULL;
-	Vector<IssmDouble> *cumdeltathickness    = NULL;
-	int nv;
-
-	if(VerboseSolution()) _printf0_("              computing earth mass transport\n");
-
-	/*This module has to be recoded! We do not grab spc thicknesses from an earth model 
-	 * anymore! Thicknesses come from a mass transport module applied to each basin! 
-	 * Commeting out for now:*/
-	_error_("EarthMassTransport error message: not supported anymore!");
-
-	/*This mass transport module for the Earth is because we might have thickness variations as spcs 
-	 * specified in the md.slr class, outside of what we will get from the icecaps. That's why we get t
-	 * the thickness variations from SealevelriseSpcthicknessEnum.*/
-
-	/*No mass transport module was called, so we are just going to retrieve the geometry thickness 
-	 * at this time step, at prior time step, and plug the difference as deltathickness: */
-	/*femmodel->parameters->FindParam(&time,TimeEnum);
-	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
-	nv=femmodel->vertices->NumberOfVertices();
-
-	GetVectorFromInputsx(&newthickness,femmodel,SealevelriseSpcthicknessEnum,VertexSIdEnum);
-	GetVectorFromInputsx(&oldthickness,femmodel,SealevelriseSpcthicknessEnum,VertexSIdEnum,time-dt);*/
-
-	/*compute deltathickness: */
-	/*deltathickness = new Vector<IssmDouble>(nv); 
-	newthickness->Copy(deltathickness); deltathickness->AXPY(oldthickness,-1); */
-
-	/*plug into elements:*/
-//	InputUpdateFromVectorx(femmodel,deltathickness,SurfaceloadIceThicknessChangeEnum,VertexSIdEnum);
-
-	/*add to cumulated delta thickness: */
-	/*GetVectorFromInputsx(&cumdeltathickness,femmodel,SealevelriseCumDeltathicknessEnum,VertexSIdEnum);
-	cumdeltathickness->AXPY(deltathickness,1); 
-	InputUpdateFromVectorx(femmodel,cumdeltathickness,SealevelriseCumDeltathicknessEnum,VertexSIdEnum);*/
-
-	/*free ressources:*/
-	/*delete oldthickness;
-	delete newthickness;
-	delete deltathickness;
-	delete cumdeltathickness;*/
-
-} /*}}}*/
-void slrconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs){ /*{{{*/
-
-	bool converged=true;
-	IssmDouble ndS,nS; 
-	Vector<IssmDouble> *dRSLg    = NULL;
-
-	//compute norm(du) and norm(u) if requested
-	dRSLg=RSLg_old->Duplicate(); RSLg_old->Copy(dRSLg); dRSLg->AYPX(RSLg,-1.0);
-	ndS=dRSLg->Norm(NORM_TWO); 
-
-	if (xIsNan<IssmDouble>(ndS)) _error_("convergence criterion is NaN!");
-
-	if(!xIsNan<IssmDouble>(eps_rel)){
-		nS=RSLg_old->Norm(NORM_TWO);
-		if (xIsNan<IssmDouble>(nS)) _error_("convergence criterion is NaN!");
-	}
-
-	//clean up
-	delete dRSLg;
-
-	//print
-	if(!xIsNan<IssmDouble>(eps_rel)){
-		if((ndS/nS)<eps_rel){
-			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)/norm(S)" << ndS/nS*100 << " < " << eps_rel*100 << " %\n");
-		}
-		else{ 
-			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)/norm(S)" << ndS/nS*100 << " > " << eps_rel*100 << " %\n");
-			converged=false;
-		}
-	}
-	if(!xIsNan<IssmDouble>(eps_abs)){
-		if(ndS<eps_abs){
-			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)" << ndS << " < " << eps_abs << " \n");
-		}
-		else{ 
-			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)" << ndS << " > " << eps_abs << " \n");
-			converged=false;
-		}
-	}
-
-	/*assign output*/
-	*pconverged=converged;
-
-} /*}}}*/
Index: /issm/trunk/src/c/cores/stressbalance_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/stressbalance_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/stressbalance_core.cpp	(revision 26744)
@@ -19,5 +19,5 @@
 	bool       dakota_analysis,control_analysis;
 	int        domaintype;
-	bool       isSIA,isSSA,isL1L2,isHO,isFS,isNitsche;
+	bool       isSIA,isSSA,isL1L2,isMLHO,isHO,isFS,isNitsche;
 	bool       save_results;
 	int        solution_type;
@@ -31,4 +31,5 @@
 	femmodel->parameters->FindParam(&isSSA,FlowequationIsSSAEnum);
 	femmodel->parameters->FindParam(&isL1L2,FlowequationIsL1L2Enum);
+	femmodel->parameters->FindParam(&isMLHO,FlowequationIsMLHOEnum);
 	femmodel->parameters->FindParam(&isHO,FlowequationIsHOEnum);
 	femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum);
@@ -47,7 +48,5 @@
 		bedslope_core(femmodel);
 		femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
-		if (!isNitsche) {
-			ResetFSBasalBoundaryConditionx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
-		}
+		ResetFSBasalBoundaryConditionx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
 
 		/*We need basal melt rates for the shelf dampening*/
@@ -76,5 +75,5 @@
 
 	/*Compute stressbalance for SSA L1L2 HO and FS*/
-	if(isSSA || isL1L2 || isHO || isFS){
+	if(isSSA || isL1L2 || isMLHO || isHO || isFS){
 		analysis = new StressbalanceAnalysis();
 		analysis->Core(femmodel);
@@ -83,5 +82,5 @@
 
 	/*Compute vertical velocities*/
-	if (domaintype==Domain3DEnum && (isSIA || isSSA || isL1L2 || isHO)){
+	if (domaintype==Domain3DEnum && (isSIA || isSSA || isL1L2 || isMLHO || isHO)){
 
 		/*We need basal melt rates for vertical velocity*/
Index: /issm/trunk/src/c/cores/transient_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/transient_core.cpp	(revision 26743)
+++ /issm/trunk/src/c/cores/transient_core.cpp	(revision 26744)
@@ -24,8 +24,8 @@
 	/*parameters: */
 	IssmDouble finaltime,dt,yts;
-	bool       isoceancoupling,iscontrol,isautodiff,isslr;
+	bool       iscontrol,isautodiff;
 	int        timestepping;
 	int        output_frequency,checkpoint_frequency;
-	int        amr_frequency,amr_restart;
+	int        amr_frequency;
 	char     **requested_outputs = NULL;
 
@@ -45,22 +45,10 @@
 	femmodel->parameters->FindParam(&output_frequency,SettingsOutputFrequencyEnum);
 	femmodel->parameters->FindParam(&timestepping,TimesteppingTypeEnum);
-	femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
-	femmodel->parameters->FindParam(&isoceancoupling,TransientIsoceancouplingEnum);
 	femmodel->parameters->FindParam(&amr_frequency,TransientAmrFrequencyEnum);
 	femmodel->parameters->FindParam(&iscontrol,InversionIscontrolEnum);
 	femmodel->parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);
 
-	#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
-	if(amr_frequency){
-		femmodel->parameters->FindParam(&amr_restart,AmrRestartEnum);
-		if(amr_restart) femmodel->ReMesh();
-	}
-	#endif
-
-	#if defined(_HAVE_OCEAN_ )
-	if(isoceancoupling) OceanExchangeDatax(femmodel,true);
-	#endif
-
-	if(isslr) sealevelrise_core_geometry(femmodel);
+	/*call modules that are not dependent on time stepping:*/
+	transient_precore(femmodel);
 
 	while(time < finaltime - (yts*DBL_EPSILON)){ //make sure we run up to finaltime.
@@ -138,6 +126,6 @@
 
 	/*parameters: */
-	bool isstressbalance,ismasstransport,issmb,isthermal,isgroundingline,isgia,isesa;
-	bool isslr,ismovingfront,isdamageevolution,ishydrology,isoceancoupling,save_results;
+	bool isstressbalance,ismasstransport,isoceantransport,issmb,isthermal,isgroundingline,isesa,issampling;;
+	bool isslc,ismovingfront,isdamageevolution,ishydrology,isoceancoupling,isstochasticforcing,save_results;
 	int  step,sb_coupling_frequency;
 	int  domaintype,numoutputs;
@@ -150,9 +138,9 @@
 	femmodel->parameters->FindParam(&isstressbalance,TransientIsstressbalanceEnum);
 	femmodel->parameters->FindParam(&ismasstransport,TransientIsmasstransportEnum);
+	femmodel->parameters->FindParam(&isoceantransport,TransientIsoceantransportEnum);
 	femmodel->parameters->FindParam(&issmb,TransientIssmbEnum);
 	femmodel->parameters->FindParam(&isthermal,TransientIsthermalEnum);
-	femmodel->parameters->FindParam(&isgia,TransientIsgiaEnum);
 	femmodel->parameters->FindParam(&isesa,TransientIsesaEnum);
-	femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
+	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
 	femmodel->parameters->FindParam(&isgroundingline,TransientIsgroundinglineEnum);
 	femmodel->parameters->FindParam(&ismovingfront,TransientIsmovingfrontEnum);
@@ -160,9 +148,15 @@
 	femmodel->parameters->FindParam(&isdamageevolution,TransientIsdamageevolutionEnum);
 	femmodel->parameters->FindParam(&ishydrology,TransientIshydrologyEnum);
+	femmodel->parameters->FindParam(&issampling,TransientIssamplingEnum);
 	femmodel->parameters->FindParam(&numoutputs,TransientNumRequestedOutputsEnum);
+	femmodel->parameters->FindParam(&isstochasticforcing,StochasticForcingIsStochasticForcingEnum);	
 
 	#if defined(_HAVE_OCEAN_ )
 	if(isoceancoupling) OceanExchangeDatax(femmodel,false);
 	#endif
+
+	if(isstochasticforcing){
+		StochasticForcingx(femmodel);
+	}
 
 	if(isthermal && domaintype==Domain3DEnum){
@@ -194,8 +188,5 @@
 
 	if(ishydrology){
-		int hydrology_model;
 		hydrology_core(femmodel);
-		femmodel->parameters->FindParam(&hydrology_model,HydrologyModelEnum);
-		if(hydrology_model!=HydrologydcEnum && issmb) smb_core(femmodel);
 	}
 
@@ -220,23 +211,28 @@
 	}
 
+	if(isoceantransport){
+		oceantransport_core(femmodel);
+	}
+
 	if(isgroundingline){
 		groundingline_core(femmodel);
 	}
 
-	if(isgia){
-		#ifdef _HAVE_GIA_
-		gia_core(femmodel);
-		#else
-		_error_("ISSM was not compiled with gia capabilities. Exiting");
-		#endif
-	}
-
 	/*esa: */
 	if(isesa) esa_core(femmodel);
 
-	/*Sea level rise: */
-	if(isslr){
-		if(VerboseSolution()) _printf0_("   computing sea level rise\n");
+	/*Sea level change: */
+	if(isslc){
+		#ifdef _HAVE_SEALEVELCHANGE_
 		sealevelchange_core(femmodel);
+		#else
+		_error_("Compiled with SeaLevelChange capability");
+		#endif
+	}
+
+	/*Sampling: */
+	if(issampling){
+		if(VerboseSolution()) _printf0_("   computing Gaussian random field\n");
+		sampling_core(femmodel);
 	}
 
@@ -253,4 +249,28 @@
 	}
 }/*}}}*/
+void transient_precore(FemModel* femmodel){/*{{{*/
+
+	bool       isoceancoupling,isslc;
+	int        amr_frequency,amr_restart;
+
+	femmodel->parameters->FindParam(&isoceancoupling,TransientIsoceancouplingEnum);
+	femmodel->parameters->FindParam(&amr_frequency,TransientAmrFrequencyEnum);
+	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
+
+	#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
+	if(amr_frequency){
+		femmodel->parameters->FindParam(&amr_restart,AmrRestartEnum);
+		if(amr_restart) femmodel->ReMesh();
+	}
+	#endif
+
+	#if defined(_HAVE_OCEAN_ )
+	if(isoceancoupling) OceanExchangeDatax(femmodel,true);
+	#endif
+
+	#if defined(_HAVE_SEALEVELCHANGE_)
+	if(isslc) sealevelchange_initialgeometry(femmodel);
+	#endif
+}/*}}}*/
 
 #ifdef _HAVE_CODIPACK_
@@ -260,5 +280,5 @@
 	IssmDouble output_value;
 	IssmDouble finaltime,dt,yts,time;
-	bool       isoceancoupling,isslr;
+	bool       isoceancoupling;
 	int        step,timestepping;
 	int        checkpoint_frequency;
@@ -273,7 +293,5 @@
 	femmodel->parameters->FindParam(&yts,ConstantsYtsEnum);
 	femmodel->parameters->FindParam(&timestepping,TimesteppingTypeEnum);
-	femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
 	femmodel->parameters->FindParam(&checkpoint_frequency,SettingsCheckpointFrequencyEnum); _assert_(checkpoint_frequency>0);
-	if(isslr) sealevelrise_core_geometry(femmodel);
 
 	std::vector<IssmDouble> time_all;
@@ -361,5 +379,11 @@
 
 	/*Start tracing*/
+	#if _CODIPACK_MAJOR_==2
+	auto& tape_codi = IssmDouble::getTape();
+	#elif _CODIPACK_MAJOR_==1
 	auto& tape_codi = IssmDouble::getGlobalTape();
+	#else
+	#error "_CODIPACK_MAJOR_ not supported"
+	#endif
 	tape_codi.setActive();
 
Index: /issm/trunk/src/c/datastructures/DataSet.cpp
===================================================================
--- /issm/trunk/src/c/datastructures/DataSet.cpp	(revision 26743)
+++ /issm/trunk/src/c/datastructures/DataSet.cpp	(revision 26744)
@@ -251,4 +251,19 @@
 				this->AddObject(res);
 			}
+			else if(obj_enum==CflevelsetmisfitEnum){
+				Cflevelsetmisfit* Cflevelset=new Cflevelsetmisfit();
+				Cflevelset->Marshall(marshallhandle);
+				this->AddObject(Cflevelset);
+			}
+			else if(obj_enum==CfsurfacesquareEnum){
+				Cfsurfacesquare* cfsurf=new Cfsurfacesquare();
+				cfsurf->Marshall(marshallhandle);
+				this->AddObject(cfsurf);
+			}
+			else if(obj_enum==MassfluxatgateEnum){
+				Massfluxatgate<IssmDouble>* massfluxgate=new Massfluxatgate<IssmDouble>();
+				massfluxgate->Marshall(marshallhandle);
+				this->AddObject(massfluxgate);
+			}
 			else _error_("could not recognize enum type: " << obj_enum << ": " << EnumToStringx(obj_enum) ); 
 		}
Index: /issm/trunk/src/c/main/esmfbinders.cpp
===================================================================
--- /issm/trunk/src/c/main/esmfbinders.cpp	(revision 26743)
+++ /issm/trunk/src/c/main/esmfbinders.cpp	(revision 26744)
@@ -115,5 +115,5 @@
 						Input* surface_input = element->GetInput(SurfaceEnum); _assert_(surface_input);
 						surface_input->GetInputAverage(&surface);
-			
+
 						*(issmoutputs+f*numberofelements+i) = surface;
 
@@ -153,4 +153,8 @@
 	} /*}}}*/
 
+	/*TODO: we need 2 initialize routines, the second one will be empty for now
+	 * In: ESMF config, ESMF Field bundle
+	 */
+
 	/*FISOC*/
 	void InitializeISSM_FISOC(int argc, char** argv,ISSM_MPI_Comm comm_init){ /*{{{*/
@@ -165,5 +169,5 @@
 		/*Initialize ESMC Mesh*/
 		int pdim;        /*parametric dimension is the same as the domain dimensions */
-		int sdim = 3;    /*coordinates of each vertex is always 2  (just x,y for now) */
+		int sdim = 2;    /*coordinates of each vertex is always 2  (just x,y for now) */
 		ESMC_CoordSys_Flag coordsys = ESMC_COORDSYS_CART; /*Cartesian coordinate system by default */
 		femmodel->parameters->FindParam(&pdim,DomainDimensionEnum);
@@ -171,9 +175,7 @@
 		if(rc!=ESMF_SUCCESS) _error_("could not create EMSC_Mesh");
 
-		/*How to install ESMG with lib/libesmf.so
-		 * do indices need to be 1 based?
-		 * ESMF installation, how can we get everything in /lib
+		/*
 		 * What do we do with vertices at the boundary, declare twice?
-		 * Do we need a restart file or save femmodel somewhere?*/
+		 * */
 
 		/*Add nodes (which are ISSM Vertices)*/
@@ -182,5 +184,5 @@
 		int        *nodeOwner = xNew<int>(numnodes);
 		IssmDouble *nodeCoord = xNew<IssmDouble>(sdim*numnodes);
-		for (int i=0;i<femmodel->elements->Size();i++){
+		for (int i=0;i<femmodel->vertices->Size();i++){
 			Vertex* vertex = xDynamicCast<Vertex*>(femmodel->vertices->GetObjectByOffset(i));
 			nodeId[i]           = vertex->Sid()+1;
@@ -213,11 +215,4 @@
 		xDelete<int>(elemConn);
 
-		/*DO we need to create fields here? https://earthsystemmodeling.org/docs/nightly/develop/ESMC_crefdoc/node5.html#SECTION05024400000000000000*/
-		//ESMC_InterArrayInt *gridToFieldMap,       // in
-		//ESMC_InterArrayInt *ungriddedLBound,      // in
-		//ESMC_InterArrayInt *ungriddedUBound,      // in
-		//ESMC_Field esmf_shelfbase = ESMC_FieldCreateMeshTypeKind(mesh,ESMC_TYPEKIND_R8,???,gridToFieldMap,ungriddedLBound,ungriddedUBound,"ShelfTopography",&rc);
-		if(rc!=ESMF_SUCCESS) _error_("could not create EMSC_Field");
-
 		/*Create restart file for later */
 		femmodel->Restart();
Index: /issm/trunk/src/c/main/issm.cpp
===================================================================
--- /issm/trunk/src/c/main/issm.cpp	(revision 26743)
+++ /issm/trunk/src/c/main/issm.cpp	(revision 26744)
@@ -15,4 +15,7 @@
 	/*Initialize femmodel from arguments provided command line: */
 	FemModel *femmodel = new FemModel(argc,argv,comm_init);
+
+	/*Need to know we are firing up from ISSM main, not a coupler driver like issm_slcp or issm_ocean:*/
+	femmodel->parameters->AddObject(new IntParam(IsSlcCouplingEnum,0));
 
 	/*Solve: */
Index: /issm/trunk/src/c/main/issm_slc.cpp
===================================================================
--- /issm/trunk/src/c/main/issm_slc.cpp	(revision 26744)
+++ /issm/trunk/src/c/main/issm_slc.cpp	(revision 26744)
@@ -0,0 +1,136 @@
+/*!\file:  issm_slc.cpp
+ * \brief: ISSM SLR main program. 
+ */ 
+
+#include "./issm.h"
+#include <stdlib.h>
+
+int main(int argc,char **argv){
+
+	/*diverse:*/
+	int    nummodels;
+	int*   commsizes=NULL;
+	int*   rankzeros=NULL;
+	char** dirnames=NULL;
+	char** modelnames=NULL;
+	int    modelid; 
+	int    earthid; 
+	int    my_rank;
+	int    count=0;
+	ISSM_MPI_Comm worldcomm;
+	ISSM_MPI_Comm modelcomm;
+	ISSM_MPI_Comm toearthcomm;
+	ISSM_MPI_Comm* fromicecomms=NULL;
+
+	/*Initialize exception trapping: */
+	ExceptionTrapBegin();
+
+	/*Initialize environment (MPI, PETSC, MUMPS, etc ...)*/
+	worldcomm=EnvironmentInit(argc,argv);
+
+	/*What is my rank?:*/
+	ISSM_MPI_Comm_rank(worldcomm,&my_rank);
+
+	/*How many models are we going to run (along with description and number of dedicated cores):{{{*/
+	nummodels=(int) strtol(argv[4], (char **)NULL, 10);
+	commsizes=xNew<int>(nummodels);
+	dirnames=xNew<char*>(nummodels);
+	modelnames=xNew<char*>(nummodels);
+	rankzeros=xNew<int>(nummodels);
+	for(int i=0;i<nummodels;i++){
+		char* string=NULL;
+
+		string=xNew<char>(strlen(argv[5+3*i])+1);
+		xMemCpy<char>(string,argv[5+3*i],strlen(argv[5+3*i])+1);
+		dirnames[i]=string;
+
+		string=xNew<char>(strlen(argv[5+3*i+1])+1);
+		xMemCpy<char>(string,argv[5+3*i+1],strlen(argv[5+3*i+1])+1);
+		modelnames[i]=string;
+
+		commsizes[i]=(int) strtol(argv[5+3*i+2], (char **)NULL, 10);
+	}
+
+	/*Figure out which model each cpu will belong to: */
+	count=0;
+	for(int i=0;i<nummodels;i++){
+		if(my_rank>=count && my_rank<(count+commsizes[i])){
+			modelid=i;
+			break;
+		}
+		count+=commsizes[i];
+	} 
+	/*Buil array of who is rank 0 of their own group:*/
+	count=0;
+	for(int i=0;i<nummodels;i++){
+		rankzeros[i]=count;
+		count+=commsizes[i];
+	}
+	/*}}}*/
+
+	/*Split world into sub-communicators for each and every model:*/
+	ISSM_MPI_Comm_split(worldcomm,modelid, my_rank, &modelcomm);
+
+	/*Build inter communicators:*/
+	earthid=nummodels-1; //last model to be provided in the argument list if the earth model.
+	if(modelid==earthid){
+		fromicecomms=xNew<ISSM_MPI_Comm>(nummodels-1);
+		for(int i=0;i<earthid;i++){
+			ISSM_MPI_Intercomm_create( modelcomm, 0, worldcomm, rankzeros[i], i, fromicecomms+i); //communicate from local erth comm 9rank 0) to ice comm (rank 0) using modelid tag.
+		}
+	}
+	else{
+		ISSM_MPI_Intercomm_create( modelcomm, 0, worldcomm, rankzeros[earthid], modelid, &toearthcomm); //communicate from local ice comm (rank 0) to earth comm (rank 0) using modelid tag.
+	}
+
+	/*Supply specific argc and argv for each sub-communicator (corresponding to each  model specificatiions):{{{*/
+	char** arguments=xNew<char*>(4);
+	arguments[0]=xNew<char>(strlen(argv[0])+1); xMemCpy<char>(arguments[0],argv[0],strlen(argv[0])+1); //executable name
+	arguments[1]=xNew<char>(strlen(argv[1])+1); xMemCpy<char>(arguments[1],argv[1],strlen(argv[1])+1); //solution name
+	arguments[2]=xNew<char>(strlen(argv[5+3*modelid])+1); xMemCpy<char>(arguments[2],argv[5+3*modelid],strlen(argv[5+3*modelid])+1); //directory name
+	arguments[3]=xNew<char>(strlen(argv[5+3*modelid+1])+1); xMemCpy<char>(arguments[3],argv[5+3*modelid+1],strlen(argv[5+3*modelid+1])+1); //model name
+	/*}}}*/
+
+	/*Initialize femmodel from arguments provided command line: */
+	FemModel *femmodel = new FemModel(4,arguments,modelcomm);
+
+	/*Now that the models are initialized, keep communicator information in the parameters datasets of each model: */
+	femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm>(worldcomm,WorldCommEnum));
+	femmodel->parameters->AddObject(new IntParam(NumModelsEnum,nummodels));
+	femmodel->parameters->AddObject(new IntParam(ModelIdEnum,modelid));
+	femmodel->parameters->AddObject(new IntParam(EarthIdEnum,earthid));
+	femmodel->parameters->AddObject(new IntParam(IsSlcCouplingEnum,1));
+	if(modelid==earthid) femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm*>(fromicecomms,IcecapToEarthCommEnum));
+	else femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm>(toearthcomm,IcecapToEarthCommEnum));
+
+	/*Solve: */
+	femmodel->Solve();
+
+	/*Output results: */
+	OutputResultsx(femmodel);
+
+	/*Wrap up: */
+	femmodel->CleanUp();
+
+	/*Delete Model: */
+	delete femmodel;
+
+	/*Finalize environment:*/
+	EnvironmentFinalize();
+
+	/*Finalize exception trapping: */
+	ExceptionTrapEnd();
+
+	/*Free ressources:*/
+	xDelete<int>(commsizes);
+	for(int i=0;i<nummodels;i++){
+		char* string=NULL;
+		string=dirnames[i]; xDelete<char>(string);
+		string=modelnames[i]; xDelete<char>(string);
+	}
+	xDelete<char*>(dirnames);
+	xDelete<char*>(modelnames);
+
+	/*Return unix success: */
+	return 0; 
+}
Index: sm/trunk/src/c/main/issm_slr.cpp
===================================================================
--- /issm/trunk/src/c/main/issm_slr.cpp	(revision 26743)
+++ 	(revision )
@@ -1,135 +1,0 @@
-/*!\file:  issm_slr.cpp
- * \brief: ISSM SLR main program. 
- */ 
-
-#include "./issm.h"
-#include <stdlib.h>
-
-int main(int argc,char **argv){
-
-	/*diverse:*/
-	int    nummodels;
-	int*   commsizes=NULL;
-	int*   rankzeros=NULL;
-	char** dirnames=NULL;
-	char** modelnames=NULL;
-	int    modelid; 
-	int    earthid; 
-	int    my_rank;
-	int    count=0;
-	ISSM_MPI_Comm worldcomm;
-	ISSM_MPI_Comm modelcomm;
-	ISSM_MPI_Comm toearthcomm;
-	ISSM_MPI_Comm* fromicecomms=NULL;
-
-	/*Initialize exception trapping: */
-	ExceptionTrapBegin();
-
-	/*Initialize environment (MPI, PETSC, MUMPS, etc ...)*/
-	worldcomm=EnvironmentInit(argc,argv);
-
-	/*What is my rank?:*/
-	ISSM_MPI_Comm_rank(worldcomm,&my_rank);
-
-	/*How many models are we going to run (along with description and number of dedicated cores):{{{*/
-	nummodels=(int) strtol(argv[4], (char **)NULL, 10);
-	commsizes=xNew<int>(nummodels);
-	dirnames=xNew<char*>(nummodels);
-	modelnames=xNew<char*>(nummodels);
-	rankzeros=xNew<int>(nummodels);
-	for(int i=0;i<nummodels;i++){
-		char* string=NULL;
-
-		string=xNew<char>(strlen(argv[5+3*i])+1);
-		xMemCpy<char>(string,argv[5+3*i],strlen(argv[5+3*i])+1);
-		dirnames[i]=string;
-
-		string=xNew<char>(strlen(argv[5+3*i+1])+1);
-		xMemCpy<char>(string,argv[5+3*i+1],strlen(argv[5+3*i+1])+1);
-		modelnames[i]=string;
-
-		commsizes[i]=(int) strtol(argv[5+3*i+2], (char **)NULL, 10);
-	}
-
-	/*Figure out which model each cpu will belong to: */
-	count=0;
-	for(int i=0;i<nummodels;i++){
-		if(my_rank>=count && my_rank<(count+commsizes[i])){
-			modelid=i;
-			break;
-		}
-		count+=commsizes[i];
-	} 
-	/*Buil array of who is rank 0 of their own group:*/
-	count=0;
-	for(int i=0;i<nummodels;i++){
-		rankzeros[i]=count;
-		count+=commsizes[i];
-	}
-	/*}}}*/
-
-	/*Split world into sub-communicators for each and every model:*/
-	ISSM_MPI_Comm_split(worldcomm,modelid, my_rank, &modelcomm);
-
-	/*Build inter communicators:*/
-	earthid=nummodels-1; //last model to be provided in the argument list if the earth model.
-	if(modelid==earthid){
-		fromicecomms=xNew<ISSM_MPI_Comm>(nummodels-1);
-		for(int i=0;i<earthid;i++){
-			ISSM_MPI_Intercomm_create( modelcomm, 0, worldcomm, rankzeros[i], i, fromicecomms+i); //communicate from local erth comm 9rank 0) to ice comm (rank 0) using modelid tag.
-		}
-	}
-	else{
-		ISSM_MPI_Intercomm_create( modelcomm, 0, worldcomm, rankzeros[earthid], modelid, &toearthcomm); //communicate from local ice comm (rank 0) to earth comm (rank 0) using modelid tag.
-	}
-
-	/*Supply specific argc and argv for each sub-communicator (corresponding to each  model specificatiions):{{{*/
-	char** arguments=xNew<char*>(4);
-	arguments[0]=xNew<char>(strlen(argv[0])+1); xMemCpy<char>(arguments[0],argv[0],strlen(argv[0])+1); //executable name
-	arguments[1]=xNew<char>(strlen(argv[1])+1); xMemCpy<char>(arguments[1],argv[1],strlen(argv[1])+1); //solution name
-	arguments[2]=xNew<char>(strlen(argv[5+3*modelid])+1); xMemCpy<char>(arguments[2],argv[5+3*modelid],strlen(argv[5+3*modelid])+1); //directory name
-	arguments[3]=xNew<char>(strlen(argv[5+3*modelid+1])+1); xMemCpy<char>(arguments[3],argv[5+3*modelid+1],strlen(argv[5+3*modelid+1])+1); //model name
-	/*}}}*/
-
-	/*Initialize femmodel from arguments provided command line: */
-	FemModel *femmodel = new FemModel(4,arguments,modelcomm);
-
-	/*Now that the models are initialized, keep communicator information in the parameters datasets of each model: */
-	femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm>(worldcomm,WorldCommEnum));
-	femmodel->parameters->AddObject(new IntParam(NumModelsEnum,nummodels));
-	femmodel->parameters->AddObject(new IntParam(ModelIdEnum,modelid));
-	femmodel->parameters->AddObject(new IntParam(EarthIdEnum,earthid));
-	if(modelid==earthid) femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm*>(fromicecomms,IcecapToEarthCommEnum));
-	else femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm>(toearthcomm,IcecapToEarthCommEnum));
-
-	/*Solve: */
-	femmodel->Solve();
-
-	/*Output results: */
-	OutputResultsx(femmodel);
-
-	/*Wrap up: */
-	femmodel->CleanUp();
-
-	/*Delete Model: */
-	delete femmodel;
-
-	/*Finalize environment:*/
-	EnvironmentFinalize();
-
-	/*Finalize exception trapping: */
-	ExceptionTrapEnd();
-
-	/*Free ressources:*/
-	xDelete<int>(commsizes);
-	for(int i=0;i<nummodels;i++){
-		char* string=NULL;
-		string=dirnames[i]; xDelete<char>(string);
-		string=modelnames[i]; xDelete<char>(string);
-	}
-	xDelete<char*>(dirnames);
-	xDelete<char*>(modelnames);
-
-	/*Return unix success: */
-	return 0; 
-}
Index: /issm/trunk/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp
===================================================================
--- /issm/trunk/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp	(revision 26744)
@@ -256,5 +256,6 @@
 			int   lid = node->Lid();
 			if(!node->IsClone()){
-				for(j=0;j<node->fsize;j++){
+				int node_fsize = node->FSize();
+				for(j=0;j<node_fsize;j++){
 					_assert_(count<m);
 					d_nnz[count]=numberofdofspernode*(d_connectivity[lid] + reCast<int>(serial_connectivity_clone[lid]));
Index: /issm/trunk/src/c/modules/Calvingx/Calvingx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Calvingx/Calvingx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/Calvingx/Calvingx.cpp	(revision 26744)
@@ -39,2 +39,6 @@
 	}
 }
+
+void MovingFrontalVelx(FemModel* femmodel){
+	femmodel->ElementOperationx(&Element::MovingFrontalVelocity);
+}
Index: /issm/trunk/src/c/modules/Calvingx/Calvingx.h
===================================================================
--- /issm/trunk/src/c/modules/Calvingx/Calvingx.h	(revision 26743)
+++ /issm/trunk/src/c/modules/Calvingx/Calvingx.h	(revision 26744)
@@ -7,4 +7,5 @@
 /* local prototypes: */
 void Calvingx(FemModel* femmodel);
+void MovingFrontalVelx(FemModel* femmodel);
 
 #endif
Index: /issm/trunk/src/c/modules/Chacox/chaco_seconds.cpp
===================================================================
--- /issm/trunk/src/c/modules/Chacox/chaco_seconds.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/Chacox/chaco_seconds.cpp	(revision 26744)
@@ -1,5 +1,5 @@
 /*This is needed, because the chaco library defines a "C" function seconds that conflicts with the Metis version.: */
 
-#ifdef _INTEL_WIN_
+#if defined(_INTEL_WIN_) || defined(_MSYS2_)
 #include   <time.h>
 #else
Index: /issm/trunk/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp	(revision 26744)
@@ -10,8 +10,4 @@
 
 int	ConfigureObjectsx( Elements* elements, Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters,Inputs* inputs){
-
-	/*Get analysis type: */
-	int configuration_type;
-	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 
 	if(VerboseMProcessor()) _printf0_("      Configuring elements...\n");
Index: /issm/trunk/src/c/modules/ConstraintsStatex/ConstraintsStateLocal.h
===================================================================
--- /issm/trunk/src/c/modules/ConstraintsStatex/ConstraintsStateLocal.h	(revision 26743)
+++ /issm/trunk/src/c/modules/ConstraintsStatex/ConstraintsStateLocal.h	(revision 26744)
@@ -5,5 +5,4 @@
 #ifndef _CONSTRAINTSSTATELOCAL_H
 #define _CONSTRAINTSSTATELOCAL_H
-
 
 #ifdef HAVE_CONFIG_H
Index: /issm/trunk/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp
===================================================================
--- /issm/trunk/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp	(revision 26744)
@@ -7,12 +7,31 @@
 #include "../../shared/shared.h"
 #include "../../toolkits/toolkits.h"
-#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-#include <proj_api.h>
+#include <proj.h>
 
 void CoordinateSystemTransformx(double** px_dest,double** py_dest,double* x_src,double* y_src,int size,const char* str_src,const char* str_dst){
 
-#if !defined(_HAVE_PROJ_)
-	_error_("proj not installed");
-#else
+/*
+NOTE:
+- Compilation of this module is fenced in Makefile.am, so we do not have to 
+check again if _HAVE_PROJ_ is defined
+*/
+#if defined(PROJ_VERSION_MAJOR) && PROJ_VERSION_MAJOR >= 6
+	/*
+	Converts an array of longitude (x_src) and array of latitude (y_src) in the 
+	projection described by str_src to the projection described by str_dest.
+
+	NOTE:
+	- API types and calls have been migrated from PROJ 4 to PROJ 6. See SVN 
+	revision history for changes.
+
+	Sources:
+	- https://proj.org/development/migration.html
+	- https://www.gaia-gis.it/fossil/libspatialite/wiki?name=PROJ.6
+
+	TODO:
+	- Because transformations are done in place, we could save memory and time 
+	by simply passing in x_src and y_src and removing the px_dest and py_dest 
+	parameters entirely?
+	*/
 
 	/*Allocate output and initialize values as src*/
@@ -20,4 +39,5 @@
 	double* x_dest = xNew<double>(size);
 	double* y_dest = xNew<double>(size);
+
 	for(int i=0;i<size;i++){
 		x_dest[i] = x_src[i];
@@ -25,17 +45,31 @@
 	}
 
-	/*Create proj.4 projection objects for src and dst*/
-	projPJ pj_src  = pj_init_plus(str_src);
-	projPJ pj_dst  = pj_init_plus(str_dst);
-	if(!pj_src) _error_("Failed to initialize PROJ with source projection \""    <<str_src<<"\"\n");
-	if(!pj_dst) _error_("Failed to initialize PROJ with destination projection\""<<str_dst<<"\"\n");
+	PJ *P;
+	size_t sx = sizeof(double);
+	size_t sy = sizeof(double);
+	size_t nx = size;
+	size_t ny = size;
 
-	/*Perform transformation*/
-	int p = pj_transform(pj_src,pj_dst,size,1,x_dest,y_dest,NULL);
-	if(p!=0) _error_("Reprojection failed, PROJ error code: "<<p<<"\n");
+	P = proj_create_crs_to_crs(PJ_DEFAULT_CTX,str_src,str_dst,NULL);
+
+	if ( 0 == P ) {
+		proj_destroy(P);
+		_error_("failed to initialize CRS transformation object");
+	}
+
+	int p = proj_trans_generic(P, PJ_FWD, x_dest, sx, nx, y_dest, sy, ny, 0, 0, 0, 0, 0, 0);
+
+	if ( 0 == p ){
+		proj_destroy(P);
+		_error_("no successful transformations");
+	}
+
+	proj_destroy(P);
 
 	/*Output : */
 	*px_dest=x_dest;
 	*py_dest=y_dest;
+#else
+	_error_("PROJ version >= 6 required");
 #endif
 }
Index: /issm/trunk/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp
===================================================================
--- /issm/trunk/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp	(revision 26744)
@@ -93,5 +93,5 @@
 
 	/*clean up and Return: */
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	xDelete<IssmDouble>(xyz_list);
 	delete gauss;
Index: /issm/trunk/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp
===================================================================
--- /issm/trunk/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp	(revision 26744)
+++ /issm/trunk/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp	(revision 26744)
@@ -0,0 +1,94 @@
+/*!\file ElementCoordinatesx
+ * \brief: compute a vector xe,ye and ze of element centroid coordinates by
+ * marching through all our elements.
+ */
+
+#include "./ElementCoordinatesx.h"
+
+#include "../../shared/shared.h"
+#include "../../toolkits/toolkits.h"
+
+void ElementCoordinatesx( IssmDouble** pxe, IssmDouble** pye, IssmDouble** pze, IssmDouble** pareae, Elements* elements,bool spherical) { /*{{{*/
+
+	/*figure out how many vertices we have: */
+	int numberofelements=elements->NumberOfElements();
+
+	Vector<IssmDouble>* vxe=new Vector<IssmDouble>(numberofelements);
+	Vector<IssmDouble>* vye=new Vector<IssmDouble>(numberofelements);
+	Vector<IssmDouble>* vze=new Vector<IssmDouble>(numberofelements);
+	Vector<IssmDouble>* vareae=new Vector<IssmDouble>(numberofelements);
+
+	/*march through our elements: */
+	for(Object* & object : elements->objects){
+		Element* element=(Element*)object;
+		element->ElementCoordinates(vxe,vye,vze,vareae,spherical);
+	}
+
+	/*Assemble*/
+	vxe->Assemble();
+	vye->Assemble();
+	vze->Assemble();
+	vareae->Assemble();
+
+	/*serialize: */
+	IssmDouble* xe=vxe->ToMPISerial();
+	IssmDouble* ye=vye->ToMPISerial();
+	IssmDouble* ze=vze->ToMPISerial();
+	IssmDouble* areae=vareae->ToMPISerial();
+
+	/*Free ressources: */
+	delete vxe;
+	delete vye;
+	delete vze;
+	delete vareae;
+
+	/*output: */
+	if(pxe) *pxe=xe;
+	else xDelete<IssmDouble>(xe);
+	if(pye) *pye=ye;
+	else xDelete<IssmDouble>(ye);
+	if(pze) *pze=ze;
+	else xDelete<IssmDouble>(ze);
+	if(pareae) *pareae=areae;
+	else xDelete<IssmDouble>(areae);
+
+} /*}}}*/
+void ElementCoordinatesx( IssmDouble** plonge, IssmDouble** plate, IssmDouble** pareae, Elements* elements) { /*{{{*/
+
+	/*figure out how many vertices we have: */
+	int numberofelements=elements->NumberOfElements();
+
+	Vector<IssmDouble>* vlonge=new Vector<IssmDouble>(numberofelements);
+	Vector<IssmDouble>* vlate=new Vector<IssmDouble>(numberofelements);
+	Vector<IssmDouble>* vareae=new Vector<IssmDouble>(numberofelements);
+
+	/*march through our elements: */
+	for(Object* & object : elements->objects){
+		Element* element=(Element*)object;
+		element->ElementCoordinates(vlonge,vlate,vareae);
+	}
+
+	/*Assemble*/
+	vlonge->Assemble();
+	vlate->Assemble();
+	vareae->Assemble();
+
+	/*serialize: */
+	IssmDouble* longe=vlonge->ToMPISerial();
+	IssmDouble* late=vlate->ToMPISerial();
+	IssmDouble* areae=vareae->ToMPISerial();
+
+	/*Free ressources: */
+	delete vlonge;
+	delete vlate;
+	delete vareae;
+
+	/*output: */
+	if(plonge) *plonge=longe;
+	else xDelete<IssmDouble>(longe);
+	if(plate) *plate=late;
+	else xDelete<IssmDouble>(late);
+	if(pareae) *pareae=areae;
+	else xDelete<IssmDouble>(areae);
+
+} /*}}}*/
Index: /issm/trunk/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h
===================================================================
--- /issm/trunk/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h	(revision 26744)
+++ /issm/trunk/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h	(revision 26744)
@@ -0,0 +1,13 @@
+/*!\file:  ElementCoordinatesx.h
+ */ 
+
+#ifndef _ELEMENT_COORDINATESX_H
+#define _ELEMENT_COORDINATESX_H
+
+#include "../../classes/classes.h"
+
+/* local prototypes: */
+void ElementCoordinatesx( IssmDouble** pxe, IssmDouble** pye, IssmDouble** pze,IssmDouble** pareae, Elements* elements,bool spherical=false);
+void ElementCoordinatesx( IssmDouble** plonge, IssmDouble** plate, IssmDouble** pareae, Elements* elements);
+
+#endif  /* _ELEMENT_COORDINATESX_H */
Index: /issm/trunk/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp
===================================================================
--- /issm/trunk/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp	(revision 26744)
@@ -57,5 +57,5 @@
 	for(Object* & object : femmodel->elements->objects){
 		Element* element=xDynamicCast<Element*>(object);
-		if(!element->IsIceInElement() || !element->IsFloating()) continue;
+		if(!element->IsIceInElement() || !element->IsAllFloating()) continue;
 		numvertices = element->GetNumberOfVertices();
 		distances=xNew<IssmDouble>(numvertices);
@@ -116,10 +116,12 @@
 		if(!element->IsOnBase()) continue;
 		Element* basalelement = element->SpawnBasalElement();
-		if(!basalelement->IsIceInElement() || !basalelement->IsFloating()) continue;
+		if(!basalelement->IsIceInElement() || !basalelement->IsAllFloating()){
+			if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+			continue;
+		}
 		basalelement->GetInputValue(&boxid,BasalforcingsPicoBoxIdEnum);
 		basalelement->GetInputValue(&basinid,BasalforcingsPicoBasinIdEnum);
 		boxareas[basinid*maxbox+boxid]+=basalelement->GetHorizontalSurfaceArea();
-		basalelement->FindParam(&domaintype,DomainTypeEnum);
-		if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	}
 
@@ -162,10 +164,13 @@
 	for(Object* & object : femmodel->elements->objects){
 		Element* element=xDynamicCast<Element*>(object);
+
+		/*Check whether we should continue*/
 		if(!element->IsOnBase()) continue;
+		if(!element->IsIceInElement() || !element->IsAllFloating()) continue;
+		int el_boxid;
+		element->GetInputValue(&el_boxid,BasalforcingsPicoBoxIdEnum);
+		if(el_boxid!=boxid) continue;
+
 		Element* basalelement = element->SpawnBasalElement();
-		if(!basalelement->IsIceInElement() || !basalelement->IsFloating()) continue;
-		int el_boxid;
-		basalelement->GetInputValue(&el_boxid,BasalforcingsPicoBoxIdEnum);
-		if(el_boxid!=boxid) continue;
 
 		Input* tocs_input=basalelement->GetInput(BasalforcingsPicoSubShelfOceanTempEnum); _assert_(tocs_input); 
@@ -180,6 +185,6 @@
 		toc_weighted_avg[basinid]+=toc*area;
 		soc_weighted_avg[basinid]+=soc*area;
-		basalelement->FindParam(&domaintype,DomainTypeEnum);
-		if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+
+		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	}
 
@@ -203,11 +208,13 @@
 		for(Object* & object : femmodel->elements->objects){
 			Element* element=xDynamicCast<Element*>(object);
+
+			/*Check whether we should continue or not*/
 			if(!element->IsOnBase()) continue;
+			if(!element->IsIceInElement() || !element->IsAllFloating()) continue;
+			int el_boxid;
+			element->GetInputValue(&el_boxid,BasalforcingsPicoBoxIdEnum);
+			if(el_boxid!=boxid) continue;
+
 			Element* basalelement = element->SpawnBasalElement();
-			if(!basalelement->IsIceInElement() || !basalelement->IsFloating()) continue;
-			int el_boxid;
-			basalelement->GetInputValue(&el_boxid,BasalforcingsPicoBoxIdEnum);
-			if(el_boxid!=boxid) continue;
-
 	     	Input* overturnings_input=basalelement->GetInput(BasalforcingsPicoSubShelfOceanOverturningEnum); _assert_(overturnings_input);
 
@@ -219,5 +226,6 @@
 			overturning_weighted_avg[basinid]+=overturning*area;
 			basalelement->FindParam(&domaintype,DomainTypeEnum);
-			if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+
+			if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 		}
 
Index: /issm/trunk/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp
===================================================================
--- /issm/trunk/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp	(revision 26744)
@@ -101,5 +101,5 @@
 
 		/*Set melt to 0 if non floating*/
-		if(!element->IsIceInElement() || !element->IsFloating() || !element->IsOnBase()){
+		if(!element->IsIceInElement() || !element->IsAllFloating() || !element->IsOnBase()){
 			IssmDouble* values = xNewZeroInit<IssmDouble>(numvertices);
 			element->AddInput(BasalforcingsFloatingiceMeltingRateEnum,values,P1DGEnum);
@@ -159,5 +159,5 @@
 		for(Object* & object : femmodel->elements->objects){
 			Element* element = xDynamicCast<Element*>(object);
-			if(!element->IsOnBase() || !element->IsIceInElement() || !element->IsFloating()) continue;
+			if(!element->IsOnBase() || !element->IsIceInElement() || !element->IsAllFloating()) continue;
 			/*Spawn basal element if on base to compute element area*/
 			Element* basalelement = element->SpawnBasalElement();
@@ -172,5 +172,5 @@
 			/*Delete spawned element if we are in 3D*/
 			basalelement->FindParam(&domaintype,DomainTypeEnum);
-			if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+			if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 		}
 
Index: /issm/trunk/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 26744)
@@ -6,15 +6,19 @@
 #include "../../shared/shared.h"
 #include "../../toolkits/toolkits.h"
+#include "../../shared/Random/random.h"
 
-void FrontalForcingsx(FemModel* femmodel){
+void FrontalForcingsx(FemModel* femmodel){/*{{{*/
 
 	/*Recover melt_parameterization*/
 	int melt_parameterization;
 	femmodel->parameters->FindParam(&melt_parameterization,FrontalForcingsParamEnum);
-	
+
 	/*Calculate melting rate*/
 	switch(melt_parameterization){
 		case FrontalForcingsDefaultEnum:
 			break;
+		case FrontalForcingsRignotAutoregressionEnum:
+			Thermalforcingautoregressionx(femmodel);
+			/*Do not break here, call IcefrontAreax(),RignotMeltParameterizationx()*/
 		case FrontalForcingsRignotEnum:
 			femmodel->IcefrontAreax();
@@ -24,3 +28,93 @@
 			_error_("Frontal forcings "<<EnumToStringx(melt_parameterization)<<" not supported yet");
 	}
-}
+}/*}}}*/
+void ThermalforcingautoregressionInitx(FemModel* femmodel){/*{{{*/
+
+   /*Initialization step of Thermalforcingautoregressionx*/
+   int M,N,Nphi,arorder,numbasins,my_rank;
+   IssmDouble starttime,tstep_ar,tinit_ar;
+   femmodel->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
+   femmodel->parameters->FindParam(&arorder,FrontalForcingsAutoregressiveOrderEnum);
+   IssmDouble* beta0    = NULL;
+   IssmDouble* beta1    = NULL;
+   IssmDouble* phi      = NULL;
+   femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+   femmodel->parameters->FindParam(&tstep_ar,FrontalForcingsAutoregressionTimestepEnum);
+   femmodel->parameters->FindParam(&tinit_ar,FrontalForcingsAutoregressionInitialTimeEnum);
+   femmodel->parameters->FindParam(&beta0,&M,FrontalForcingsBeta0Enum);    _assert_(M==numbasins);
+   femmodel->parameters->FindParam(&beta1,&M,FrontalForcingsBeta1Enum);    _assert_(M==numbasins);
+   femmodel->parameters->FindParam(&phi,&M,&Nphi,FrontalForcingsPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+
+   /*AR model spin-up with 0 noise to initialize ThermalforcingValuesAutoregressionEnum*/
+	int nspin{2*arorder+5};
+   for(Object* &object:femmodel->elements->objects){
+      Element* element      = xDynamicCast<Element*>(object); //generate element object
+      element->AutoregressionInit(numbasins,arorder,nspin,starttime,tstep_ar,tinit_ar,beta0,beta1,phi,FrontalForcingsRignotAutoregressionEnum);
+   }
+
+   /*Cleanup*/
+   xDelete<IssmDouble>(beta0);
+   xDelete<IssmDouble>(beta1);
+   xDelete<IssmDouble>(phi);
+}/*}}}*/
+void Thermalforcingautoregressionx(FemModel* femmodel){/*{{{*/
+
+   /*Get time parameters*/
+   IssmDouble time,dt,starttime,tstep_ar;
+   femmodel->parameters->FindParam(&time,TimeEnum);
+   femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+   femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+   femmodel->parameters->FindParam(&tstep_ar,FrontalForcingsAutoregressionTimestepEnum);
+
+   /*Initialize module at first time step*/
+   if(time<=starttime+dt){ThermalforcingautoregressionInitx(femmodel);}
+   /*Determine if this is a time step for the AR model*/
+   bool isstepforar = false;
+
+   #ifndef _HAVE_AD_
+   if((fmod(time,tstep_ar)<fmod((time-dt),tstep_ar)) || (time<=starttime+dt) || tstep_ar==dt) isstepforar = true;
+   #else
+   _error_("not implemented yet");
+   #endif
+
+   /*Load parameters*/
+	bool isstochastic;
+   bool istfstochastic = false;
+	int M,N,Nphi,arorder,numbasins,my_rank;
+   femmodel->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
+   femmodel->parameters->FindParam(&arorder,FrontalForcingsAutoregressiveOrderEnum);
+   IssmDouble tinit_ar;
+   IssmDouble* beta0      = NULL;
+   IssmDouble* beta1      = NULL;
+   IssmDouble* phi        = NULL;
+
+	femmodel->parameters->FindParam(&tinit_ar,FrontalForcingsAutoregressionInitialTimeEnum);
+   femmodel->parameters->FindParam(&beta0,&M,FrontalForcingsBeta0Enum);    _assert_(M==numbasins);
+   femmodel->parameters->FindParam(&beta1,&M,FrontalForcingsBeta1Enum);    _assert_(M==numbasins);
+   femmodel->parameters->FindParam(&phi,&M,&Nphi,FrontalForcingsPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+
+	femmodel->parameters->FindParam(&isstochastic,StochasticForcingIsStochasticForcingEnum);
+	if(isstochastic){
+		int  numstochasticfields;
+		int* stochasticfields;
+		femmodel->parameters->FindParam(&numstochasticfields,StochasticForcingNumFieldsEnum);
+		femmodel->parameters->FindParam(&stochasticfields,&N,StochasticForcingFieldsEnum); _assert_(N==numstochasticfields);
+		for(int i=0;i<numstochasticfields;i++){
+			if(stochasticfields[i]==FrontalForcingsRignotAutoregressionEnum) istfstochastic = true;
+		}
+		xDelete<int>(stochasticfields);
+	}
+   /*Time elapsed with respect to AR model initial time*/
+   IssmDouble telapsed_ar = time-tinit_ar;
+
+   /*Loop over each element to compute Thermal Forcing at vertices*/
+   for(Object* &object:femmodel->elements->objects){
+      Element* element = xDynamicCast<Element*>(object);
+      element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,istfstochastic,FrontalForcingsRignotAutoregressionEnum);
+   }
+
+   /*Cleanup*/
+   xDelete<IssmDouble>(beta0);
+   xDelete<IssmDouble>(beta1);
+   xDelete<IssmDouble>(phi);
+}/*}}}*/
Index: /issm/trunk/src/c/modules/FrontalForcingsx/FrontalForcingsx.h
===================================================================
--- /issm/trunk/src/c/modules/FrontalForcingsx/FrontalForcingsx.h	(revision 26743)
+++ /issm/trunk/src/c/modules/FrontalForcingsx/FrontalForcingsx.h	(revision 26744)
@@ -7,4 +7,6 @@
 /* local prototypes: */
 void FrontalForcingsx(FemModel* femmodel);
+void ThermalforcingautoregressionInitx(FemModel* femmodel);
+void Thermalforcingautoregressionx(FemModel* femmodel);
 
 #endif
Index: /issm/trunk/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h
===================================================================
--- /issm/trunk/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h	(revision 26743)
+++ /issm/trunk/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h	(revision 26744)
@@ -15,4 +15,3 @@
 void  GetVectorFromInputsx(IssmDouble** pvector,int* pvector_size, FemModel* femmodel,int name);
 
-
 #endif  /* _GETVECTORFROMINPUTSXX_H */
Index: /issm/trunk/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp
===================================================================
--- /issm/trunk/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp	(revision 26744)
@@ -44,110 +44,55 @@
 void GiaDeflectionCorex( IssmDouble* pwi, IssmDouble* pdwidt, GiaDeflectionCoreArgs* arguments){
 
-	/*intermediary: */
-	int i;
-
-	/*output: */
-	IssmDouble wi=0;
-	IssmDouble dwidt=0;
-
-	/*inputs: {{{*/
-	/*constant: */
-	int idisk=1; // disk #
-	IssmDouble yts;
-
-	/*coming from the model structure, runtime configurable:*/
-	/*gia solution parameters: */
-	int iedge=0; 
-
-	/*gia inputs: */
-	IssmDouble ri; //radial distance from center of disk to vertex  i
-	IssmDouble re; //radius of disk
-	IssmDouble* hes; //loading history (in ice thickness)
-	IssmDouble* times; //loading history times
-	int numtimes; //loading history length
-	IssmDouble currenttime;
-	int Ntime; // number of times with load history 
-	int Ntimm; // Ntime-1 : for slope/y-cept of load segments 
-	int Ntimp; // Ntime+1 : for evaluation time  
-	IssmDouble* blockt_time=NULL;
-	IssmDouble* blockt_bi=NULL;
-	IssmDouble* blockt_dmi=NULL;
-	IssmDouble* blocky_zhload=NULL;
-
-	/*gia material parameters: */
-	IssmDouble lithosphere_shear_modulus;
-	IssmDouble lithosphere_density;
-	IssmDouble mantle_shear_modulus;
-	IssmDouble mantle_viscosity;
-	IssmDouble mantle_density;
-	IssmDouble lithosphere_thickness;
-
-	/*ice properties: */
-	IssmDouble rho_ice;
-
-	/*some debug info: */
-	int disk_id;
-
-/*}}}*/
-
 	/*Recover material parameters and loading history: see GiaDeflectionCoreArgs for more details {{{*/
-	ri                        = arguments->ri;
-	re                        = arguments->re;
-	hes                       = arguments->hes;
-	times                     = arguments->times;
-	numtimes                  = arguments->numtimes;
-	currenttime               = arguments->currenttime;
-	lithosphere_shear_modulus = arguments->lithosphere_shear_modulus;
-	lithosphere_density       = arguments->lithosphere_density;
-	mantle_shear_modulus      = arguments->mantle_shear_modulus;
-	mantle_viscosity          = arguments->mantle_viscosity;
-	mantle_density            = arguments->mantle_density;
-	lithosphere_thickness     = arguments->lithosphere_thickness;
-	rho_ice                   = arguments->rho_ice;
-	disk_id                   = arguments->idisk;
-	iedge                     = arguments->iedge;
-	yts                       = arguments->yts;
+	IssmDouble  ri                        = arguments->ri;                        //radial distance from center of disk to vertex i
+	IssmDouble  re                        = arguments->re;                        //radius of disk
+	IssmDouble *hes                       = arguments->hes;                       //loading history (in ice thickness)
+	IssmDouble *times                     = arguments->times;                     //loading history times
+	int         numtimes                  = arguments->numtimes;                  //loading history length
+	IssmDouble  currenttime               = arguments->currenttime;
+	IssmDouble  lithosphere_shear_modulus = arguments->lithosphere_shear_modulus;
+	IssmDouble  lithosphere_density       = arguments->lithosphere_density;
+	IssmDouble  mantle_shear_modulus      = arguments->mantle_shear_modulus;
+	IssmDouble  mantle_viscosity          = arguments->mantle_viscosity;
+	IssmDouble  mantle_density            = arguments->mantle_density;
+	IssmDouble  lithosphere_thickness     = arguments->lithosphere_thickness;
+	IssmDouble  rho_ice                   = arguments->rho_ice;
+	int         disk_id                   = arguments->idisk;
+	int         iedge                     = arguments->iedge;
+	IssmDouble  yts                       = arguments->yts;
 
 	/*}}}*/
 
 	/*Modify inputs to match naruse code: */
-	Ntime=numtimes;
-	Ntimm=Ntime-1;
-	Ntimp=Ntime+1;
+	int Ntime=numtimes; // number of times with load history
+	int Ntimm=Ntime-1; // Ntime-1 : for slope/y-cept of load segments
+	int Ntimp=Ntime+1; // Ntime+1 : for evaluation time
 
 	/*Prepare block inputs for fortran distme and what0 routines of the naruse code: {{{*/
 	/*Now, let's set pset from the data that we got in input to GiaDeflectionCorex: */
-	blockp_.pset[0]=lithosphere_thickness;
-	blockp_.pset[1]=mantle_viscosity;
-	blockp_.pset[2]=lithosphere_shear_modulus;
-	blockp_.pset[3]=mantle_shear_modulus;
-	blockp_.pset[4]=lithosphere_density;
-	blockp_.pset[5]=mantle_density;
-	blockp_.pset[6]=re;
-	blocko_.rhoi=rho_ice; 
+	blockp_.pset[0]=reCast<IssmPDouble>(lithosphere_thickness);
+	blockp_.pset[1]=reCast<IssmPDouble>(mantle_viscosity);
+	blockp_.pset[2]=reCast<IssmPDouble>(lithosphere_shear_modulus);
+	blockp_.pset[3]=reCast<IssmPDouble>(mantle_shear_modulus);
+	blockp_.pset[4]=reCast<IssmPDouble>(lithosphere_density);
+	blockp_.pset[5]=reCast<IssmPDouble>(mantle_density);
+	blockp_.pset[6]=reCast<IssmPDouble>(re);
+	blocko_.rhoi=reCast<IssmPDouble>(rho_ice); 
+   blockrad_.distrad=reCast<IssmPDouble>(ri)/1000.0; // in km
 
 	/*loading history: */
-	blocky_zhload=xNew<IssmDouble>(Ntime);
-	for(i=0;i<Ntime;i++){
-	blocky_zhload[i]=hes[i];
+	IssmPDouble* blocky_zhload=xNew<IssmPDouble>(Ntime);
+	for(int i=0;i<Ntime;i++) blocky_zhload[i]=reCast<IssmPDouble>(hes[i]);
+
+	/*times in kyr: */
+	IssmPDouble* blockt_time=xNew<IssmPDouble>(Ntimp);
+	for(int i=0;i<Ntimp;i++){
+		blockt_time[i]=times[i]/1000.0/yts; 
+		if(i==numtimes-1) blockt_time[i]=reCast<IssmPDouble>(times[numtimes-1])/1000.0/yts; // final loading time, same as evaluation time
+		if(i==numtimes)   blockt_time[i]=reCast<IssmPDouble>(times[numtimes-1])/1000.0/yts;   // evaluation time
 	}
 
-	/*times in kyr: */
-	blockt_time=xNew<IssmDouble>(Ntimp);
-	for (i=0;i<Ntimp;i++){
-		blockt_time[i]=times[i]/1000.0/yts; 
-		if(i==numtimes-1)blockt_time[i]=times[numtimes-1]/1000.0/yts; // final loading time, same as evaluation time
-		if(i==numtimes)blockt_time[i]=times[numtimes-1]/1000.0/yts;   // evaluation time
-	}
-
-	/*bi: */
-	blockt_bi=xNew<IssmDouble>(Ntimm);
-
-	/*dmi: */
-	blockt_dmi=xNew<IssmDouble>(Ntimm);
-
-	/*radial distance of i-th element: */
-	blockrad_.distrad=ri/1000.0; // in km
-	/*}}}*/
+	IssmPDouble* blockt_bi=xNew<IssmPDouble>(Ntimm);
+	IssmPDouble* blockt_dmi=xNew<IssmPDouble>(Ntimm);
 
 	/*Call distme driver: */
@@ -158,14 +103,12 @@
 
 	/*output solution: */
-	wi = blocks_.aswokm_w;
-	dwidt = blocks_.aswokm_dwdt;
-	*pwi=wi;
-	*pdwidt=dwidt;
+	*pwi=reCast<IssmDouble>(blocks_.aswokm_w);
+	*pdwidt=reCast<IssmDouble>(blocks_.aswokm_dwdt);
 
 	/*Free ressources: */
-	xDelete<IssmDouble>(blockt_time);
-	xDelete<IssmDouble>(blockt_bi);
-	xDelete<IssmDouble>(blockt_dmi);
-	xDelete<IssmDouble>(blocky_zhload);
+	xDelete<IssmPDouble>(blockt_time);
+	xDelete<IssmPDouble>(blockt_bi);
+	xDelete<IssmPDouble>(blockt_dmi);
+	xDelete<IssmPDouble>(blocky_zhload);
 
 }
Index: /issm/trunk/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp
===================================================================
--- /issm/trunk/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp	(revision 26744)
@@ -27,4 +27,5 @@
 	}
 }
+
 void InputUpdateFromConstantx(FemModel* femmodel,IssmDouble constant, int name){
 
@@ -60,4 +61,26 @@
 	}
 }
+
+void InputUpdateFromConstantx(Inputs* inputs,Elements* elements,IssmDouble constant, int name,int type){
+
+	if(type==P0Enum) InputUpdateFromConstantx(inputs, elements, constant,name);
+	else if(type==P1Enum){
+
+		if(VerboseModule()) _printf0_("   Input updates from constant (P1 version)\n");
+
+		/*Elements and loads drive the update: */
+		if(IsInputEnum(name)){
+			for(Object* & object : elements->objects){
+				Element* element = xDynamicCast<Element*>(object);
+				element->InputUpdateFromConstant(constant,name,P1Enum);
+			}
+		}
+		else{
+			_error_("not supported yet");
+		}
+	}
+	else _error_("InputUpdateFromConstantx error message: type not supported yet!");
+
+}
 void InputUpdateFromConstantx(Inputs* inputs,Elements* elements,bool constant, int name){
 
Index: /issm/trunk/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.h
===================================================================
--- /issm/trunk/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.h	(revision 26743)
+++ /issm/trunk/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.h	(revision 26744)
@@ -17,4 +17,5 @@
 #endif
 void InputUpdateFromConstantx(Inputs* inputs,Elements* elements,IssmDouble constant,int name);
+void InputUpdateFromConstantx(Inputs* inputs,Elements* elements,IssmDouble constant,int name, int type);
 void InputUpdateFromConstantx(Inputs* inputs,Elements* elements,bool       constant,int name);
 
Index: /issm/trunk/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
===================================================================
--- /issm/trunk/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 26744)
@@ -38,5 +38,4 @@
 	femmodel->parameters->FindParam(&variable_partitions_nt,NULL,NULL,QmuVariablePartitionsNtEnum);
 
-
 	/*Go through all dakota descriptors, ex: "rho_ice","thermal_conductivity","thickness1","thickness2", etc ..., and
 	 * for each descriptor, take the variable value and plug it into the inputs (more or less :)):
@@ -50,5 +49,4 @@
 		descriptor=variables_descriptors[i];
 
-
 		/*From descriptor, figure out if the variable is scaled, indexed, distributed or just a simple variable: */
 		if (strncmp(descriptor,"scaled_",7)==0){
@@ -160,5 +158,5 @@
 
 	/*Here, we put all the code that cannot be handled any other place: */
-	if (strncmp(root,"SurfaceloadModelid",18)==0){
+	if (strncmp(root,"SurfaceloadModelid",18)==0){ //surface load in solid earth class {{{
 
 		if(VerboseQmu()){
@@ -168,7 +166,6 @@
 		}
 
-
-		if (femmodel->inputs->GetInputObjectEnum(SurfaceloadIceThicknessChangeEnum)==DatasetInputEnum)
-			MmeToInput(femmodel,distributed_values,variable_partition,npart,SurfaceloadIceThicknessChangeEnum, P0Enum);
+		if (femmodel->inputs->GetInputObjectEnum(MasstransportSpcthicknessEnum)==DatasetInputEnum)
+			MmeToInput(femmodel,distributed_values,variable_partition,npart,MasstransportSpcthicknessEnum, P0Enum);
 
 		if (femmodel->inputs->GetInputObjectEnum(MaskIceLevelsetEnum)==DatasetInputEnum)
@@ -178,5 +175,29 @@
 			MmeToInput(femmodel,distributed_values,variable_partition,npart,MaskOceanLevelsetEnum, P1Enum);
 
-	}
+	} /*}}}*/
+	if (strncmp(root,"SolidearthExternalModelid",18)==0){ //external solid earth solution in solid earth class {{{
+
+		if(VerboseQmu()){
+			_printf0_("      SolidearthExternalModelid MME, with ids: ");
+			for (int i=0;i<npart;i++)_printf0_((int)distributed_values[i] << " ");
+			_printf0_("\n");
+		}
+
+		if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalDisplacementEastRateEnum)==DatasetInputEnum)
+			MmeToInput(femmodel,distributed_values,variable_partition,npart,SolidearthExternalDisplacementEastRateEnum, P1Enum);
+
+		if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalDisplacementUpRateEnum)==DatasetInputEnum)
+			MmeToInput(femmodel,distributed_values,variable_partition,npart,SolidearthExternalDisplacementUpRateEnum, P1Enum);
+
+		if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalDisplacementNorthRateEnum)==DatasetInputEnum)
+			MmeToInput(femmodel,distributed_values,variable_partition,npart,SolidearthExternalDisplacementNorthRateEnum, P1Enum);
+
+		if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalGeoidRateEnum)==DatasetInputEnum)
+			MmeToInput(femmodel,distributed_values,variable_partition,npart,SolidearthExternalGeoidRateEnum, P1Enum);
+
+		//if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalBarystaticSeaLevelRateEnum)==DatasetInputEnum)
+		//	MmeToInput(femmodel,distributed_values,variable_partition,npart,SolidearthExternalBarystaticSeaLevelRateEnum, P1Enum);
+	} /*}}}*/
+
 	else _error_("InputUpdateSpecialtyCode error message: " << root << " not supported yet!");
 
@@ -235,5 +256,5 @@
 	}
 
-	/*wipe out existing SurfaceloadIceThicknessChangeEnum dataset:*/
+	/*wipe out existing SurfaceloadIceThicknessRateEnum dataset:*/
 	femmodel->inputs->ChangeEnum(DummyEnum,rootenum);
 
@@ -263,4 +284,3 @@
 	}
 
-
 } /*}}}*/
Index: /issm/trunk/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h
===================================================================
--- /issm/trunk/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h	(revision 26743)
+++ /issm/trunk/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h	(revision 26744)
@@ -13,4 +13,3 @@
 void InputScaleFromDakotax(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* partition, int npart, int nt, int name);
 
-
 #endif  /* _INPUTUPDATEFROMDAKOTAXX_H */
Index: /issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h
===================================================================
--- /issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h	(revision 26743)
+++ /issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h	(revision 26744)
@@ -9,5 +9,5 @@
 
 int InterpFromMeshToMesh2dx(double** pdata_interp,int* index_data,double* x_data,double* y_data,int nods_data,int nels_data,
-			double* data,int M_data,int N_data,double* x_interp,double* y_interp,int N_interp,Options* options);
+			double* data,int M_data,int N_data,double* x_interp,double* y_interp,int N_interp,Options* options=NULL);
 
 #endif
Index: /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 26744)
@@ -666,5 +666,5 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,analysis_type));
+							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,spcdata[i],analysis_type));
 							count++;
 						}
@@ -676,19 +676,16 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,analysis_type));
-							count++;
-						}
-					}
-				}
-				for(i=0;i<iomodel->numberofedges;i++){
-					if(iomodel->edges[i*3+2]==2){
-						if(iomodel->my_edges[i]){
-							v1 = iomodel->edges[3*i+0]-1;
-							v2 = iomodel->edges[3*i+1]-1;
-							if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
-								constraints->AddObject(new SpcDynamic(count+1,iomodel->numberofvertices+i+1,
-												dof,analysis_type));
-								count++;
-							}
+							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,spcdata[i],analysis_type));
+							count++;
+						}
+					}
+				}
+				for(i=0;i<iomodel->numberofverticaledges;i++){
+					if(iomodel->my_vedges[i]){
+						v1 = iomodel->verticaledges[2*i+0]-1;
+						v2 = iomodel->verticaledges[2*i+1]-1;
+						if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
+							constraints->AddObject(new SpcDynamic(count+1,iomodel->numberofvertices+i+1,dof,(spcdata[v1]+spcdata[v2])/2.,analysis_type));
+							count++;
 						}
 					}
@@ -699,19 +696,19 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,analysis_type));
-							count++;
-						}
-					}
-				}
-				for(i=0;i<iomodel->numberofedges;i++){
-					if(iomodel->edges[i*3+2]==2){
-						if(iomodel->my_edges[i]){
-							v1 = iomodel->edges[3*i+0]-1;
-							v2 = iomodel->edges[3*i+1]-1;
-							if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
-								constraints->AddObject(new SpcDynamic(count+1,iomodel->numberofvertices+2*i+1,dof,analysis_type));
-								constraints->AddObject(new SpcDynamic(count+2,iomodel->numberofvertices+2*i+2,dof,analysis_type));
-								count=count+2;
-							}
+							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,spcdata[i],analysis_type));
+							count++;
+						}
+					}
+				}
+				for(i=0;i<iomodel->numberofverticaledges;i++){
+					if(iomodel->my_vedges[i]){
+						v1 = iomodel->verticaledges[2*i+0]-1;
+						v2 = iomodel->verticaledges[2*i+1]-1;
+						if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
+							constraints->AddObject(new SpcDynamic(count+1,iomodel->numberofvertices+2*i+1,
+											dof,2./3.*spcdata[v1]+1./3.*spcdata[v2],analysis_type));
+							constraints->AddObject(new SpcDynamic(count+2,iomodel->numberofvertices+2*i+2,
+											dof,1./3.*spcdata[v1]+2./3.*spcdata[v2],analysis_type));
+							count=count+2;
 						}
 					}
Index: /issm/trunk/src/c/modules/MeshPartitionx/MeshPartitionx.h
===================================================================
--- /issm/trunk/src/c/modules/MeshPartitionx/MeshPartitionx.h	(revision 26743)
+++ /issm/trunk/src/c/modules/MeshPartitionx/MeshPartitionx.h	(revision 26744)
@@ -25,5 +25,4 @@
 	int* index2d=NULL;
 	int  count=0;
-
 
 	switch(meshelementtype){
Index: /issm/trunk/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp
===================================================================
--- /issm/trunk/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp	(revision 26744)
+++ /issm/trunk/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp	(revision 26744)
@@ -0,0 +1,70 @@
+/*!\file MmeToInputFromId
+ * \brief: compute damage
+ */
+#ifdef HAVE_CONFIG_H
+	#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "../../shared/shared.h"
+#include "../../toolkits/toolkits.h"
+#include "../../classes/classes.h"
+#include "../../classes/Inputs/DatasetInput.h"
+#include "../../classes/Inputs/TransientInput.h"
+#include "../../classes/Inputs/TriaInput.h"
+#include "./MmeToInputFromIdx.h"
+
+void MmeToInputFromIdx(Inputs* inputs, Elements* elements, int id, int rootenum, int interpolationenum){
+
+	TransientInput* transientinput  = NULL;
+	TransientInput* transientinput2 = NULL;
+	Tria* element                    = NULL;
+	IssmDouble value;
+	IssmDouble* values               = NULL;
+	IssmDouble* times                = NULL;
+	int N;
+
+	/*find thickness dataset: */
+	DatasetInput* datasetinput = inputs->GetDatasetInput(rootenum);
+
+	/*Initialize new transient input: */
+	transientinput = datasetinput->GetTransientInputByOffset(0); _assert_(transientinput);
+	transientinput->GetAllTimes(&times,&N);
+	inputs->SetTransientInput(DummyEnum,times,N);
+	transientinput2 = inputs->GetTransientInput(DummyEnum);
+
+	for(Object* & object : elements->objects){
+		Tria*   element=xDynamicCast<Tria*>(object);
+
+		/*recover the right field from the mme: */
+		transientinput = datasetinput->GetTransientInputByOffset(id); _assert_(transientinput);
+
+		/*copy values from the transientinput to the final transientinput2: */
+		for (int j=0;j<N;j++){
+			TriaInput* tria_input=transientinput->GetTriaInput(j);
+			element->InputServe(tria_input);
+			if(interpolationenum==P0Enum){
+				value=tria_input->element_values[0];
+				transientinput2->AddTriaTimeInput( j,1,&(element->lid),&value,P0Enum);
+			}
+			else if(interpolationenum==P1Enum){
+
+				/*Get values and lid list*/
+				const int   numvertices     = element->GetNumberOfVertices();
+				int        *vertexlids      = xNew<int>(numvertices);
+				int        *vertexsids      = xNew<int>(numvertices);
+
+				/*Recover vertices ids needed to initialize inputs*/
+				element->GetVerticesLidList(&vertexlids[0]);
+				element->GetVerticesSidList(&vertexsids[0]);
+				values=tria_input->element_values;
+				transientinput2->AddTriaTimeInput( j,numvertices,vertexlids,values,P1Enum);
+			}
+		}
+	}
+
+	/*wipe out existing SurfaceloadIceThicknessChangeEnum dataset:*/
+	inputs->ChangeEnum(DummyEnum,rootenum);
+
+}
Index: /issm/trunk/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.h
===================================================================
--- /issm/trunk/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.h	(revision 26744)
+++ /issm/trunk/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.h	(revision 26744)
@@ -0,0 +1,11 @@
+#ifndef _MMETOINPUTFROMIDX_H
+#define _MMETOINPUTFROMIDX_H
+
+class Inputs; 
+class Elements; 
+class Parameters;
+
+/* local prototypes: */
+void  MmeToInputFromIdx(Inputs* inputs, Elements* elements, int id, int rootenum, int interpolationenum);
+
+#endif
Index: /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 26744)
@@ -289,5 +289,4 @@
 			N_all[i] = N;
 
-
 			for(Object* & object : elements->objects){
 				Element* element=xDynamicCast<Element*>(object);
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 26744)
@@ -179,28 +179,29 @@
 
 			//go through list of materials, and create them: 
-			for(int i=0;i<nnat;i++){ 
-				switch(IoCodeToEnumNature(nature[i])){ //{{{
-					case MaticeEnum:
-						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
-						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_n",MaterialsRheologyNEnum);
-						for (i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matice(i+1,i,iomodel));
-						switch(iomodel->domaindim){
-							case 2:
-								inputs->DuplicateInput(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
-								break;
-							case 3:
-								break;
-							default:
-								_error_("Mesh not supported yet");
+			for(int nat=0;nat<nnat;nat++){
+				switch(IoCodeToEnumNature(nature[nat])){ 
+					case MaticeEnum:{ /*{{{*/
+							iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
+							iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_n",MaterialsRheologyNEnum);
+							for (int k=0;k<iomodel->numberofelements;k++) if(iomodel->my_elements[k]) materials->AddObject(new Matice(k+1,k,MaticeEnum));
+							switch(iomodel->domaindim){
+								case 2:
+									inputs->DuplicateInput(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
+									break;
+								case 3:
+									break;
+								default:
+									_error_("Mesh not supported yet");
+							}
+						} /*}}}*/
+						break;
+					case MatlithoEnum: { /*{{{*/
+							iomodel->FetchData(13,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.ebm_alpha","md.materials.ebm_delta","md.materials.ebm_taul","md.materials.ebm_tauh","md.materials.rheologymodel","md.materials.issolid","md.materials.density");
+							materials->AddObject(new Matlitho(iomodel->numberofelements+1,iomodel));
+							iomodel->DeleteData(13,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.ebm_alpha","md.materials.ebm_delta","md.materials.ebm_taul","md.materials.ebm_tauh","md.materials.rheologymodel","md.materials.issolid","md.materials.density");
 						}
+						/*}}}*/
 						break;
-					case MatlithoEnum:
-						iomodel->FetchData(9,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.isburgers","md.materials.issolid","md.materials.density");
-						materials->AddObject(new Matlitho(materials->Size()+1,iomodel));
-						iomodel->DeleteData(9,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.isburgers","md.materials.issolid","md.materials.density");
-						break;
-
-					case MathydroEnum:
-						{
+					case MathydroEnum: {/*{{{*/
 							/*If we don't have any materials pointed to by elements (meaning, if we are running only litho or hydro), 
 							 * then we need to zero out the hmaterial pointers inside the elements dataset so that it won't error out 
@@ -208,8 +209,8 @@
 							bool isice=false;
 							for (int j=0;j<nnat;j++){
-								if((IoCodeToEnumNature(nature[i])==MaticeEnum)||
-										(IoCodeToEnumNature(nature[i])==MatenhancediceEnum)||
-										(IoCodeToEnumNature(nature[i])==MatestarEnum)||
-										(IoCodeToEnumNature(nature[i])==MatdamageiceEnum)){
+								if((IoCodeToEnumNature(nature[j])==MaticeEnum)||
+										(IoCodeToEnumNature(nature[j])==MatenhancediceEnum)||
+										(IoCodeToEnumNature(nature[j])==MatestarEnum)||
+										(IoCodeToEnumNature(nature[j])==MatdamageiceEnum)){
 									isice=true; break; }
 							}
@@ -230,12 +231,11 @@
 								}
 							}
-						}
+						} /*}}}*/
 						break;
-
-					case MatenhancediceEnum:
+					case MatenhancediceEnum: /*{{{*/
 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_n",MaterialsRheologyNEnum);
 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_E",MaterialsRheologyEEnum);
-						for (i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matice(i+1,i,iomodel));
+						for(int j=0;j<iomodel->numberofelements;j++) if(iomodel->my_elements[j]) materials->AddObject(new Matice(j+1,j,MatenhancediceEnum));
 						switch(iomodel->domaindim){
 							case 2:
@@ -248,10 +248,11 @@
 								_error_("Mesh not supported yet");
 						}
+						/*}}}*/
 						break;
-					case MatdamageiceEnum:
+					case MatdamageiceEnum: /*{{{*/
 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_n",MaterialsRheologyNEnum);
 						iomodel->FetchDataToInput(inputs,elements,"md.damage.D",DamageDEnum);
-						for (i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matice(i+1,i,iomodel));
+						for (int j=0;j<iomodel->numberofelements;j++) if(iomodel->my_elements[j]) materials->AddObject(new Matice(j+1,j,MatdamageiceEnum));
 						switch(iomodel->domaindim){
 							case 2:
@@ -264,10 +265,11 @@
 								_error_("Mesh not supported yet");
 						}
+						/*}}}*/
 						break;
-					case MatestarEnum:
+					case MatestarEnum: /*{{{*/
 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_Ec",MaterialsRheologyEcEnum);
 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_Es",MaterialsRheologyEsEnum);
-						for(i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matestar(i+1,i,iomodel));
+						for(int j=0;j<iomodel->numberofelements;j++) if(iomodel->my_elements[j]) materials->AddObject(new Matestar(j+1,j,iomodel));
 						switch(iomodel->domaindim){
 							case 2:
@@ -280,11 +282,11 @@
 							default:
 								_error_("Mesh not supported yet");
-						}
+						} 
+						/*}}}*/
+						break; 
+					default:
+						_error_("Materials nature type "<<EnumToStringx(IoCodeToEnumNature(nature[nat]))<<" not supported");
 						break;
-
-					default:
-						_error_("Materials nature type "<<EnumToStringx(IoCodeToEnumNature(nature[i]))<<" not supported");
-
-				} //}}}
+				}
 			}
 			//Free ressources:
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp	(revision 26744)
@@ -170,5 +170,5 @@
 				int*         cfsurfacesquare_weights_N_s				= NULL;
 				char**       cfsurfacesquare_weights_string_s		= NULL;
-				int*	 cfsurfacesquare_datatime_s				= NULL;
+				IssmDouble*	 cfsurfacesquare_datatime_s				= NULL;
 
 				/*Fetch name, model_string, observation, observation_string, etc ... (see src/m/classes/cfsurfacesquare.m): */
@@ -241,5 +241,5 @@
 				xDelete<int>(cfsurfacesquare_weights_N_s);
 				xDelete<char*>(cfsurfacesquare_weights_string_s);
-				xDelete<int>(cfsurfacesquare_datatime_s);
+				xDelete<IssmDouble>(cfsurfacesquare_datatime_s);
 				/*}}}*/
 			}
@@ -323,5 +323,5 @@
 				int*         cfsurfacelogvel_weights_N				= NULL;
 				char**       cfsurfacelogvel_weightstring		= NULL;
-				int*				cfsurfacelogvel_datatime				= NULL;
+				IssmDouble*  cfsurfacelogvel_datatime				= NULL;
 
 				/*Fetch name, modeltring, observation, observationtring, etc ... (see src/m/classes/cfsurfacelogvel.m): */
@@ -399,5 +399,92 @@
 				xDelete<int>(cfsurfacelogvel_weights_N);
 				xDelete<char*>(cfsurfacelogvel_weightstring);
-				xDelete<int>(cfsurfacelogvel_datatime);
+				xDelete<IssmDouble>(cfsurfacelogvel_datatime);
+				/*}}}*/
+			}
+			else if (output_definition_enums[i]==CflevelsetmisfitEnum){
+				/*Deal with cflevelsetmisfit: {{{*/
+
+				/*cflevelsetmisfit variables: */
+				int          num_cflevelsetmisfits;
+				char**       cflevelsetmisfit_name_s						= NULL;    
+				char**		 cflevelsetmisfit_definitionstring_s		= NULL;    
+				char**       cflevelsetmisfit_model_string_s			= NULL;
+				IssmDouble** cflevelsetmisfit_observation_s			= NULL;
+				char**		 cflevelsetmisfit_observation_string_s	= NULL;
+				int*         cflevelsetmisfit_observation_M_s			= NULL;
+				int*         cflevelsetmisfit_observation_N_s			= NULL;
+				IssmDouble** cflevelsetmisfit_weights_s					= NULL;
+				int*         cflevelsetmisfit_weights_M_s				= NULL;
+				int*         cflevelsetmisfit_weights_N_s				= NULL;
+				char**       cflevelsetmisfit_weights_string_s		= NULL;
+				IssmDouble*	 cflevelsetmisfit_datatime_s				= NULL;
+
+				/*Fetch name, model_string, observation, observation_string, etc ... (see src/m/classes/cflevelsetmisfit.m): */
+				iomodel->FetchMultipleData(&cflevelsetmisfit_name_s,&num_cflevelsetmisfits,                                                        "md.cflevelsetmisfit.name");
+				iomodel->FetchMultipleData(&cflevelsetmisfit_definitionstring_s,&num_cflevelsetmisfits,                                            "md.cflevelsetmisfit.definitionstring");
+				iomodel->FetchMultipleData(&cflevelsetmisfit_model_string_s,&num_cflevelsetmisfits,                                                "md.cflevelsetmisfit.model_string");
+				iomodel->FetchMultipleData(&cflevelsetmisfit_observation_s,&cflevelsetmisfit_observation_M_s,&cflevelsetmisfit_observation_N_s,&num_cflevelsetmisfits, "md.cflevelsetmisfit.observation");
+				iomodel->FetchMultipleData(&cflevelsetmisfit_observation_string_s,&num_cflevelsetmisfits,                                          "md.cflevelsetmisfit.observation_string");
+				iomodel->FetchMultipleData(&cflevelsetmisfit_weights_s,&cflevelsetmisfit_weights_M_s,&cflevelsetmisfit_weights_N_s,&num_cflevelsetmisfits,             "md.cflevelsetmisfit.weights");
+				iomodel->FetchMultipleData(&cflevelsetmisfit_weights_string_s,&num_cflevelsetmisfits,                                              "md.cflevelsetmisfit.weights_string");
+				iomodel->FetchMultipleData(&cflevelsetmisfit_datatime_s,&num_cflevelsetmisfits,																	 "md.cflevelsetmisfit.datatime");
+
+				for(j=0;j<num_cflevelsetmisfits;j++){
+					int obs_vector_type=0;
+					if ((cflevelsetmisfit_observation_M_s[j]==iomodel->numberofvertices) || (cflevelsetmisfit_observation_M_s[j]==iomodel->numberofvertices+1)){
+						obs_vector_type=1;
+					}
+					else if ((cflevelsetmisfit_observation_M_s[j]==iomodel->numberofelements) || (cflevelsetmisfit_observation_M_s[j]==iomodel->numberofelements+1)){
+						obs_vector_type=2;
+					}
+					else
+					 _error_("cflevelsetmisfit observation size not supported yet");
+
+					int weight_vector_type=0;
+					if ((cflevelsetmisfit_weights_M_s[j]==iomodel->numberofvertices) || (cflevelsetmisfit_weights_M_s[j]==iomodel->numberofvertices+1)){
+						weight_vector_type=1;
+					}
+					else if ((cflevelsetmisfit_weights_M_s[j]==iomodel->numberofelements) || (cflevelsetmisfit_weights_M_s[j]==iomodel->numberofelements+1)){
+						weight_vector_type=2;
+					}
+					else
+					 _error_("cflevelsetmisfit weight size not supported yet");
+
+					/*First create a cflevelsetmisfit object for that specific string (cflevelsetmisfit_model_string_s[j]):*/
+					output_definitions->AddObject(new Cflevelsetmisfit(cflevelsetmisfit_name_s[j],StringToEnumx(cflevelsetmisfit_definitionstring_s[j]),StringToEnumx(cflevelsetmisfit_model_string_s[j]),StringToEnumx(cflevelsetmisfit_observation_string_s[j]),StringToEnumx(cflevelsetmisfit_weights_string_s[j]),cflevelsetmisfit_datatime_s[j],false));
+
+					/*Now, for this particular cflevelsetmisfit object, make sure we plug into the elements: the observation, and the weights.*/
+					for(Object* & object : elements->objects){
+						Element* element=xDynamicCast<Element*>(object);
+						element->DatasetInputAdd(StringToEnumx(cflevelsetmisfit_definitionstring_s[j]),cflevelsetmisfit_observation_s[j],inputs,iomodel,cflevelsetmisfit_observation_M_s[j],cflevelsetmisfit_observation_N_s[j],obs_vector_type,StringToEnumx(cflevelsetmisfit_observation_string_s[j]),7,LevelsetObservationEnum);
+						element->DatasetInputAdd(StringToEnumx(cflevelsetmisfit_definitionstring_s[j]),cflevelsetmisfit_weights_s[j],inputs,iomodel,cflevelsetmisfit_weights_M_s[j],cflevelsetmisfit_weights_N_s[j],weight_vector_type,StringToEnumx(cflevelsetmisfit_weights_string_s[j]),7,WeightsLevelsetObservationEnum);
+					}
+				}
+
+				  /*Free ressources:*/
+				for(j=0;j<num_cflevelsetmisfits;j++){
+					char* string=NULL;
+					IssmDouble* matrix = NULL;
+
+					string = cflevelsetmisfit_definitionstring_s[j];		xDelete<char>(string);
+					string = cflevelsetmisfit_observation_string_s[j];	xDelete<char>(string);
+					string = cflevelsetmisfit_model_string_s[j];			xDelete<char>(string);
+					string = cflevelsetmisfit_weights_string_s[j];		xDelete<char>(string);
+					string = cflevelsetmisfit_name_s[j];    xDelete<char>(string);
+					matrix = cflevelsetmisfit_observation_s[j]; xDelete<IssmDouble>(matrix);
+					matrix = cflevelsetmisfit_weights_s[j]; xDelete<IssmDouble>(matrix);
+				}
+				xDelete<char*>(cflevelsetmisfit_name_s);
+				xDelete<char*>(cflevelsetmisfit_model_string_s);
+				xDelete<char*>(cflevelsetmisfit_definitionstring_s);
+				xDelete<IssmDouble*>(cflevelsetmisfit_observation_s);
+				xDelete<char*>(cflevelsetmisfit_observation_string_s);
+				xDelete<int>(cflevelsetmisfit_observation_M_s);
+				xDelete<int>(cflevelsetmisfit_observation_N_s);
+				xDelete<IssmDouble*>(cflevelsetmisfit_weights_s);
+				xDelete<int>(cflevelsetmisfit_weights_M_s);
+				xDelete<int>(cflevelsetmisfit_weights_N_s);
+				xDelete<char*>(cflevelsetmisfit_weights_string_s);
+				xDelete<IssmDouble>(cflevelsetmisfit_datatime_s);
 				/*}}}*/
 			}
@@ -630,5 +717,5 @@
 				xDelete<int>(cost_functions_weights_N);
 				xDelete<IssmDouble*>(cost_functions_weights);
-			
+
 			/*}}}*/
 			}
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26744)
@@ -30,5 +30,5 @@
 	bool         autodiff_mass_flux_present = false;
 	bool         mass_flux_present          = false;
-	bool         interp;
+	bool         interp,cycle;
 	IssmDouble **array                      = NULL;
 	int         *mdims_array                = NULL;
@@ -55,4 +55,5 @@
 	parameters->AddObject(iomodel->CopyConstantObject("md.settings.waitonlock",SettingsWaitonlockEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.mesh.numberofvertices",MeshNumberofverticesEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.mesh.numberofelements",MeshNumberofelementsEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.settings.io_gather",SettingsIoGatherEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.settings.solver_residue_threshold",SettingsSolverResidueThresholdEnum));
@@ -63,5 +64,8 @@
 	parameters->AddObject(iomodel->CopyConstantObject("md.calving.law",CalvingLawEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.parameterization",FrontalForcingsParamEnum));
-	parameters->AddObject(new IntParam(SealevelriseRunCountEnum,1));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.isgrd",SolidearthSettingsGRDEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.grdmodel",GrdModelEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.runfrequency",SolidearthSettingsRunFrequencyEnum));
+	parameters->AddObject(new IntParam(SealevelchangeRunCountEnum,1));
 
 	  {/*This is specific to ice...*/
@@ -74,16 +78,17 @@
 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isstressbalance",TransientIsstressbalanceEnum));
 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.ismasstransport",TransientIsmasstransportEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isoceantransport",TransientIsoceantransportEnum));
 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.issmb",TransientIssmbEnum));
 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isthermal",TransientIsthermalEnum));
 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isgroundingline",TransientIsgroundinglineEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isgia",TransientIsgiaEnum));
 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isesa",TransientIsesaEnum));
 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isdamageevolution",TransientIsdamageevolutionEnum));
 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.ishydrology",TransientIshydrologyEnum));
 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.ismovingfront",TransientIsmovingfrontEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isslr",TransientIsslrEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.transient.iscoupler",TransientIscouplerEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isslc",TransientIsslcEnum));
 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isoceancoupling",TransientIsoceancouplingEnum));
 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.amr_frequency",TransientAmrFrequencyEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.transient.issampling",TransientIssamplingEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.isstochasticforcing",StochasticForcingIsStochasticForcingEnum));
 
 		/*For stress balance only*/
@@ -155,5 +160,6 @@
 			break;
 		case LinearFloatingMeltRateEnum:
-			iomodel->FindConstant(&interp,"md.timestepping.interp_forcings");
+			iomodel->FindConstant(&interp,"md.timestepping.interp_forcing");
+			iomodel->FindConstant(&cycle,"md.timestepping.cycle_forcing");
 			iomodel->FetchData(&transparam,&N,&M,"md.basalforcings.deepwater_melting_rate");
 			if(N==1){
@@ -163,5 +169,5 @@
 			else{
 				_assert_(N==2);
-				parameters->AddObject(new TransientParam(BasalforcingsDeepwaterMeltingRateEnum,&transparam[0],&transparam[M],interp,M));
+				parameters->AddObject(new TransientParam(BasalforcingsDeepwaterMeltingRateEnum,&transparam[0],&transparam[M],interp,cycle,M));
 			}
 			xDelete<IssmDouble>(transparam);
@@ -173,5 +179,5 @@
 			else{
 				_assert_(N==2);
-				parameters->AddObject(new TransientParam(BasalforcingsUpperwaterMeltingRateEnum,&transparam[0],&transparam[M],interp,M));
+				parameters->AddObject(new TransientParam(BasalforcingsUpperwaterMeltingRateEnum,&transparam[0],&transparam[M],interp,cycle,M));
 			}
 			xDelete<IssmDouble>(transparam);
@@ -183,5 +189,5 @@
 			else{
 				_assert_(N==2);
-				parameters->AddObject(new TransientParam(BasalforcingsDeepwaterElevationEnum,&transparam[0],&transparam[M],interp,M));
+				parameters->AddObject(new TransientParam(BasalforcingsDeepwaterElevationEnum,&transparam[0],&transparam[M],interp,cycle,M));
 			}
 			xDelete<IssmDouble>(transparam);
@@ -193,5 +199,5 @@
 			else{
 				_assert_(N==2);
-				parameters->AddObject(new TransientParam(BasalforcingsUpperwaterElevationEnum,&transparam[0],&transparam[M],interp,M));
+				parameters->AddObject(new TransientParam(BasalforcingsUpperwaterElevationEnum,&transparam[0],&transparam[M],interp,cycle,M));
 			}
 			xDelete<IssmDouble>(transparam);
@@ -219,5 +225,6 @@
 			break;
 		case BasalforcingsPicoEnum:
-			iomodel->FindConstant(&interp,"md.timestepping.interp_forcings");
+			iomodel->FindConstant(&interp,"md.timestepping.interp_forcing");
+			iomodel->FindConstant(&cycle,"md.timestepping.cycle_forcing");
 			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.num_basins",BasalforcingsPicoNumBasinsEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.maxboxcount",BasalforcingsPicoMaxboxcountEnum));
@@ -226,9 +233,9 @@
 			iomodel->FetchData(&transparam,&M,&N,"md.basalforcings.farocean_temperature");
 			_assert_(M>=1 && N>=1);
-			parameters->AddObject(new TransientArrayParam(BasalforcingsPicoFarOceantemperatureEnum,transparam,&transparam[N*(M-1)],interp,N,M));
+			parameters->AddObject(new TransientArrayParam(BasalforcingsPicoFarOceantemperatureEnum,transparam,&transparam[N*(M-1)],interp,cycle,N,M));
 			xDelete<IssmDouble>(transparam);
 			iomodel->FetchData(&transparam,&M,&N,"md.basalforcings.farocean_salinity");
 			_assert_(M>=1 && N>=1);
-			parameters->AddObject(new TransientArrayParam(BasalforcingsPicoFarOceansalinityEnum,transparam,&transparam[N*(M-1)],interp,N,M));
+			parameters->AddObject(new TransientArrayParam(BasalforcingsPicoFarOceansalinityEnum,transparam,&transparam[N*(M-1)],interp,cycle,N,M));
 			xDelete<IssmDouble>(transparam);
 			break;
@@ -261,5 +268,6 @@
 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.final_time",TimesteppingFinalTimeEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.time_step",TimesteppingTimeStepEnum));
-			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.interp_forcings",TimesteppingInterpForcingsEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.interp_forcing",TimesteppingInterpForcingEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.cycle_forcing",TimesteppingCycleForcingEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.coupling_time",TimesteppingCouplingTimeEnum));
 			break;
@@ -270,5 +278,6 @@
 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.time_step_max",TimesteppingTimeStepMaxEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.cfl_coefficient",TimesteppingCflCoefficientEnum));
-			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.interp_forcings",TimesteppingInterpForcingsEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.interp_forcing",TimesteppingInterpForcingEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.cycle_forcing",TimesteppingCycleForcingEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.coupling_time",TimesteppingCouplingTimeEnum));
 			break;
@@ -323,4 +332,5 @@
 			parameters->AddObject(iomodel->CopyConstantObject("md.materials.thermal_exchange_velocity",MaterialsThermalExchangeVelocityEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.constants.g",ConstantsGEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.constants.gravitational_constant",ConstantsNewtonGravityEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.materials.rheology_law",MaterialsRheologyLawEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.materials.earth_density",MaterialsEarthDensityEnum));
@@ -355,16 +365,15 @@
 						parameters->AddObject(iomodel->CopyConstantObject("md.constants.g",ConstantsGEnum));
 						parameters->AddObject(iomodel->CopyConstantObject("md.materials.rheology_law",MaterialsRheologyLawEnum));
-
-						/*slr:*/
-						parameters->AddObject(iomodel->CopyConstantObject("md.materials.earth_density",MaterialsEarthDensityEnum));
+						/*slc:*/
 						break;
 					case MathydroEnum:
 						parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_ice",MaterialsRhoIceEnum));
 						parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_water",MaterialsRhoSeawaterEnum));
-						parameters->AddObject(iomodel->CopyConstantObject("md.materials.earth_density",MaterialsEarthDensityEnum));
 						parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_freshwater",MaterialsRhoFreshwaterEnum));
 						break;
 				}
 			}
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.earth_density",MaterialsEarthDensityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.constants.gravitational_constant",ConstantsNewtonGravityEnum));
 			/*Free rssources:*/
 			xDelete<int>(nature);
@@ -388,4 +397,20 @@
 			/*Nothing to add*/
 			break;
+		case SMBautoregressionEnum:
+         /*Add parameters that are not in standard nbvertices format*/
+         parameters->AddObject(iomodel->CopyConstantObject("md.smb.num_basins",SmbNumBasinsEnum));
+         parameters->AddObject(iomodel->CopyConstantObject("md.smb.ar_order",SmbAutoregressiveOrderEnum));
+         parameters->AddObject(iomodel->CopyConstantObject("md.smb.ar_initialtime",SmbAutoregressionInitialTimeEnum));
+         parameters->AddObject(iomodel->CopyConstantObject("md.smb.ar_timestep",SmbAutoregressionTimestepEnum));
+         iomodel->FetchData(&transparam,&M,&N,"md.smb.beta0");
+         parameters->AddObject(new DoubleVecParam(SmbBeta0Enum,transparam,N));
+         xDelete<IssmDouble>(transparam);
+         iomodel->FetchData(&transparam,&M,&N,"md.smb.beta1");
+         parameters->AddObject(new DoubleVecParam(SmbBeta1Enum,transparam,N));
+         xDelete<IssmDouble>(transparam);
+         iomodel->FetchData(&transparam,&M,&N,"md.smb.phi");
+         parameters->AddObject(new DoubleMatParam(SmbPhiEnum,transparam,M,N));
+         xDelete<IssmDouble>(transparam);
+         break;
 		case SMBgembEnum:
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.aIce",SmbAIceEnum));
@@ -473,4 +498,32 @@
 		iomodel->DeleteData(&requestedoutputs,numoutputs,"md.damage.requested_outputs");
 	}
+
+	bool isstochasticforcing;
+   parameters->FindParam(&isstochasticforcing,StochasticForcingIsStochasticForcingEnum);
+	/*Stochastic Effective Pressure false by default*/
+	parameters->AddObject(new BoolParam(StochasticForcingIsWaterPressureEnum,false));
+   if(isstochasticforcing){
+      int num_fields,stochastic_dim;
+      char** fields;
+      parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.num_fields",StochasticForcingNumFieldsEnum));
+      parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.defaultdimension",StochasticForcingDefaultDimensionEnum));
+      iomodel->FindConstant(&fields,&num_fields,"md.stochasticforcing.fields");
+      if(num_fields<1) _error_("no stochasticforcing fields found");
+      int* stochasticforcing_enums = xNew<int>(num_fields);
+      for(int i=0;i<num_fields;i++){
+         stochasticforcing_enums[i] = StringToEnumx(fields[i]);
+         xDelete<char>(fields[i]);
+      }
+      xDelete<char*>(fields);
+      parameters->AddObject(new IntVecParam(StochasticForcingFieldsEnum,stochasticforcing_enums,num_fields));
+      xDelete<int>(stochasticforcing_enums);
+      parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.randomflag",StochasticForcingRandomflagEnum));
+      iomodel->FetchData(&transparam,&M,&N,"md.stochasticforcing.dimensions");
+      parameters->AddObject(new IntVecParam(StochasticForcingDimensionsEnum,transparam,N));
+      xDelete<IssmDouble>(transparam);
+      iomodel->FetchData(&transparam,&M,&N,"md.stochasticforcing.covariance");
+      parameters->AddObject(new DoubleMatParam(StochasticForcingCovarianceEnum,transparam,M,N));
+      xDelete<IssmDouble>(transparam);
+   }
 
 	/*Deal with mass flux segments: {{{*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 26744)
@@ -111,9 +111,14 @@
 
 	/*Start figuring out, out of the partition, which elements belong to this cpu: */
+	bool check = false;
 	for(int i=0;i<iomodel->numberofelements;i++){
 
 		/*!All elements have been partitioned above, only deal with elements for this cpu: */
-		if(my_rank==epart[i]) my_elements[i]=true;
+		if(my_rank==epart[i]){
+			my_elements[i]=true;
+			check = true;
+		}
 	}
+	if(!check) _error_("partition "<<my_rank<<" does not have any element! Try reducing md.cluster.np");
 
 	/*Assign pointers to iomodel*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 26744)
@@ -36,5 +36,5 @@
 
 	/*Partition Elements and Nodes*/
-	ElementsAndVerticesPartitioning(iomodel);
+	if (iomodel->numberofelements > 0) ElementsAndVerticesPartitioning(iomodel);
 
 	/*Create elements, vertices and materials, independent of analysis_enum: */
Index: /issm/trunk/src/c/modules/OceanExchangeDatax/OceanExchangeDatax.cpp
===================================================================
--- /issm/trunk/src/c/modules/OceanExchangeDatax/OceanExchangeDatax.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/OceanExchangeDatax/OceanExchangeDatax.cpp	(revision 26744)
@@ -60,8 +60,8 @@
 		femmodel->parameters->SetParam(oceangridnxsize,OceanGridNxEnum);
 		femmodel->parameters->SetParam(oceangridnysize,OceanGridNyEnum);
+		oceangridx=xNew<IssmDouble>(ngrids_ocean);
+		oceangridy=xNew<IssmDouble>(ngrids_ocean);
 		if(my_rank==0){
-			oceangridx = xNew<IssmDouble>(ngrids_ocean);
 			ISSM_MPI_Recv(oceangridx,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001005,tomitgcmcomm,&status);
-			oceangridy = xNew<IssmDouble>(ngrids_ocean);
 			ISSM_MPI_Recv(oceangridy,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001006,tomitgcmcomm,&status);
 
@@ -70,8 +70,5 @@
 			ISSM_MPI_Recv(&oceantime,1,ISSM_MPI_DOUBLE,0,10001002,tomitgcmcomm,&status);
 		}
-		if(my_rank!=0){
-			oceangridx=xNew<IssmDouble>(ngrids_ocean);
-			oceangridy=xNew<IssmDouble>(ngrids_ocean);
-		}
+		
 		ISSM_MPI_Bcast(oceangridx,ngrids_ocean,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
 		ISSM_MPI_Bcast(oceangridy,ngrids_ocean,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
Index: /issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp	(revision 26744)
@@ -24,5 +24,4 @@
 	int         solutiontype;
 	char*       solutiontypestring      = NULL;
-
 
 	/*recover my_rank:*/
@@ -71,5 +70,5 @@
 				char* root=NULL;
 				char* modelname=NULL;
-				
+
 				femmodel->parameters->FindParam(&currEvalId,QmuCurrEvalIdEnum);
 				femmodel->parameters->FindParam(&statistics,QmuStatisticsEnum);
Index: /issm/trunk/src/c/modules/QmuStatisticsx/QmuStatisticsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/QmuStatisticsx/QmuStatisticsx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/QmuStatisticsx/QmuStatisticsx.cpp	(revision 26744)
@@ -20,5 +20,5 @@
 	IssmDouble* dmatfield = NULL; 
 	int*        imatfield = NULL; 
-			
+
 	//type of the returned field: 
 	int type;
@@ -109,5 +109,5 @@
 	int range,lower_row,upper_row;
 	int nfilesperdirectory;
-	
+
 	/*intermediary:*/
 	IssmDouble* doublemat=NULL;
@@ -237,5 +237,5 @@
 			char* field=fields[f];
 			meanxtype[f]=readdata(&doublemat, &doublematsize, &scalar, fid,field,steps[0]);
-			
+
 			if(meanxtype[f]==1){
 				meanxsize[f]=1;
@@ -246,5 +246,5 @@
 					timemean+=scalar/nsteps;
 				}
-					
+
 				/*Figure out max and min of time means: */
 				if(i==(lower_row+1)){
@@ -334,5 +334,5 @@
 				IssmDouble*  allmax=xNew<IssmDouble>(size);
 				IssmDouble*  allmin=xNew<IssmDouble>(size);
-				
+
 				ISSM_MPI_Allreduce(maxx,allmax,size,ISSM_MPI_PDOUBLE,ISSM_MPI_MAX,IssmComm::GetComm());
 				ISSM_MPI_Allreduce(minx,allmin,size,ISSM_MPI_PDOUBLE,ISSM_MPI_MIN,IssmComm::GetComm());
@@ -344,5 +344,5 @@
 		} /*}}}*/
 	}
-	
+
 	/*Now do the same for the time mean fields:*/
 	for (int f=0;f<nfields;f++){
@@ -377,5 +377,4 @@
 			ISSM_MPI_Allreduce(minx,allmin,size,ISSM_MPI_PDOUBLE,ISSM_MPI_MIN,IssmComm::GetComm());
 
-			
 			/*Store for later use in histogram computation:*/
 			maxmeans[f]=allmax;
@@ -488,5 +487,5 @@
 			char* field=fields[f];
 			meanxtype[f]=readdata(&doublemat, &doublematsize, &scalar, fid,field,steps[0]);
-			
+
 			if(meanxtype[f]==1){
 				IssmDouble timemean=0;
@@ -496,5 +495,5 @@
 					timemean+=scalar/nsteps;
 				}
-					
+
 				/*Figure out max and min of time means: */
 				if(i==(lower_row+1)){
@@ -531,5 +530,5 @@
 					IssmDouble* ma=maxmeans[f];
 					IssmDouble* mi=minmeans[f];
-					
+
 					for (int k=0;k<doublematsize;k++){
 						IssmDouble scalar=timemean[k];
@@ -541,9 +540,9 @@
 				}
 				else{
-					
+
 					IssmDouble* localhistogram=timehistogram[f];
 					IssmDouble* ma=maxmeans[f];
 					IssmDouble* mi=minmeans[f];
-					
+
 					for (int k=0;k<doublematsize;k++){
 						IssmDouble scalar=timemean[k];
@@ -600,5 +599,5 @@
 				IssmDouble* histo=histogram[counter];
 				IssmDouble* allhisto=xNew<IssmDouble>(size*nbins);
-				
+
 				ISSM_MPI_Allreduce(histo,allhisto,size*nbins,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
 				xDelete<IssmDouble>(histo);
@@ -620,5 +619,5 @@
 	}
 	_printf0_("Start aggregating time mean histogram:\n");
-	
+
 	/*Now do the same for the time mean fields:*/
 	for (int f=0;f<nfields;f++){
@@ -684,5 +683,5 @@
 	int range,lower_row,upper_row;
 	int nfilesperdirectory;
-	
+
 	/*intermediary:*/
 	IssmDouble* doublemat=NULL;
@@ -806,5 +805,5 @@
 			}
 		}
-		
+
 		/*Deal with time mean: */
 		for (int f=0;f<nfields;f++){
@@ -917,5 +916,5 @@
 				IssmDouble*  sumx=xNew<IssmDouble>(size);
 				IssmDouble*  sumx2=xNew<IssmDouble>(size);
-				
+
 				ISSM_MPI_Reduce(x,sumx,size,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm());
 				ISSM_MPI_Reduce(x2,sumx2,size,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm());
@@ -980,5 +979,5 @@
 			IssmDouble*  sumx=xNew<IssmDouble>(size);
 			IssmDouble*  sumx2=xNew<IssmDouble>(size);
-				
+
 			ISSM_MPI_Reduce(x,sumx,size,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm());
 			ISSM_MPI_Reduce(x2,sumx2,size,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm());
@@ -1021,5 +1020,5 @@
 	int* indices=NULL;
 	int  nindices;
-	
+
 	/*intermediary:*/
 	IssmDouble* doublemat=NULL;
@@ -1143,5 +1142,5 @@
 				if(my_rank==0){
 					char fieldname[1000];
-					
+
 					sprintf(fieldname,"%s%s",fields[f],"Samples");
 					results->AddResult(new GenericExternalResult<IssmPDouble*>(results->Size()+1,fieldname,allx,nsamples,1,j+1,0));
@@ -1152,7 +1151,7 @@
 				x=xs[counter];
 				allx=xNew<IssmDouble>(nsamples*nindices);
-				
+
 				MPI_Gather(x, range*nindices, ISSM_MPI_PDOUBLE,allx, range*nindices, ISSM_MPI_PDOUBLE, 0, IssmComm::GetComm());
-				
+
 				/*add to results:*/
 				if(my_rank==0){
@@ -1183,5 +1182,5 @@
 
 	FemModel* femmodel=new FemModel();
-	
+
 	/*Some parameters that will allow us to use the OutputResultsx module:*/
 	parameters->AddObject(new BoolParam(QmuIsdakotaEnum,false));
@@ -1327,8 +1326,8 @@
 		results   = new Results();
 		parameters=new Parameters();
-		
+
 		//solution type: 
 		parameters->AddObject(new IntParam(SolutionTypeEnum,StatisticsSolutionEnum));
-	
+
 		//root  directory
 		directory=xNew<char>(strlen(argv[2])+1);
@@ -1359,5 +1358,4 @@
 		ISSM_MPI_Comm_split(ISSM_MPI_COMM_WORLD,color, my_rank, &statcomm);
 
-
 		iomodel->FindConstant(&numstatistics,"md.qmu.statistics.numstatistics");
 		for (int i=1;i<=numstatistics;i++){
@@ -1367,5 +1365,5 @@
 			int   nsamples;
 			_printf0_("Dealing with qmu statistical computation #" << i << "\n");
-		
+
 			sprintf(string,"md.qmu.statistics.method(%i).name",i);
 			iomodel->FindConstant(&name,string);
@@ -1391,5 +1389,5 @@
 				iomodel->FetchData(&indices,&dummy,&nindices,string);
 				parameters->AddObject(new IntVecParam(IndicesEnum,indices,nindices));
-		
+
 				ComputeSampleSeries(parameters,results,color,statcomm);
 			}
@@ -1410,5 +1408,5 @@
 	/*output results:*/
 	OutputStatistics(parameters,results,color,statcomm);
-	
+
 	/*all meet here: */
 	ISSM_MPI_Barrier(ISSM_MPI_COMM_WORLD); _printf0_("Output file.\n");
Index: /issm/trunk/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp
===================================================================
--- /issm/trunk/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp	(revision 26744)
@@ -79,5 +79,5 @@
 
 	/*clean up and Return: */
-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
 	xDelete<IssmDouble>(xyz_list);
 	delete gauss;
Index: /issm/trunk/src/c/modules/SetActiveNodesLSMx/SetActiveNodesLSMx.cpp
===================================================================
--- /issm/trunk/src/c/modules/SetActiveNodesLSMx/SetActiveNodesLSMx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/SetActiveNodesLSMx/SetActiveNodesLSMx.cpp	(revision 26744)
@@ -63,5 +63,7 @@
 	int numvertices=femmodel->vertices->NumberOfVertices();
 	if(numvertices==0)  return;
-	Vector<IssmDouble>* vec_mask_ice=new Vector<IssmDouble>(numvertices);
+
+	int numvert_local = femmodel->vertices->NumberOfVerticesLocal();
+	Vector<IssmDouble>* vec_mask_ice=new Vector<IssmDouble>(numvert_local,numvertices);
 
 	/*Fill vector with values: */
@@ -71,5 +73,5 @@
 			int nbv = element->GetNumberOfVertices();
 			for(int iv=0;iv<nbv;iv++){
-				vec_mask_ice->SetValue(element->vertices[iv]->Sid(),1.,INS_VAL);
+				vec_mask_ice->SetValue(element->vertices[iv]->Pid(),1.,INS_VAL);
 			}
 		}
@@ -78,5 +80,5 @@
 	/*Assemble vector and serialize */
 	vec_mask_ice->Assemble();
-	InputUpdateFromVectorx(femmodel,vec_mask_ice,IceMaskNodeActivationEnum,VertexSIdEnum);
+	InputUpdateFromVectorx(femmodel,vec_mask_ice,IceMaskNodeActivationEnum,VertexPIdEnum);
 	delete vec_mask_ice;
 }/*}}}*/
Index: /issm/trunk/src/c/modules/StochasticForcingx/StochasticForcingx.cpp
===================================================================
--- /issm/trunk/src/c/modules/StochasticForcingx/StochasticForcingx.cpp	(revision 26744)
+++ /issm/trunk/src/c/modules/StochasticForcingx/StochasticForcingx.cpp	(revision 26744)
@@ -0,0 +1,203 @@
+/*!\file StochasticForcingx
+ * \brief: compute noise terms for the StochasticForcing fields
+ */
+
+#include "./StochasticForcingx.h"
+#include "../../classes/Loads/Friction.h"
+#include "../../shared/shared.h"
+#include "../../toolkits/toolkits.h"
+#include "../../shared/Random/random.h"
+
+void StochasticForcingx(FemModel* femmodel){/*{{{*/
+
+
+	//VV testing (12Nov)
+	/*
+	IssmDouble timeVV,dtVV,starttimeVV;
+	femmodel->parameters->FindParam(&timeVV,TimeEnum);
+   femmodel->parameters->FindParam(&dtVV,TimesteppingTimeStepEnum);
+   femmodel->parameters->FindParam(&starttimeVV,TimesteppingStartTimeEnum);
+	IssmDouble valMean = 0;
+	IssmDouble valSdev = 0.5;
+	int seed;
+	//seed = reCast<int,IssmDouble>((timeVV-starttimeVV)/dtVV);
+	seed = -1;
+	IssmDouble rdmVV;
+	univariateNormal_test0(&rdmVV,valMean,valSdev,seed);
+	_printf_("VV rdmVV: "<<rdmVV<<'\n');
+	*/
+
+   /*Retrieve parameters*/
+   bool randomflag;
+   int M,N,numfields,my_rank;
+   int* fields            = NULL;
+   int* dimensions        = NULL;
+   IssmDouble* covariance = NULL;
+   femmodel->parameters->FindParam(&randomflag,StochasticForcingRandomflagEnum);
+   femmodel->parameters->FindParam(&numfields,StochasticForcingNumFieldsEnum);
+   femmodel->parameters->FindParam(&fields,&N,StochasticForcingFieldsEnum);    _assert_(N==numfields);
+   femmodel->parameters->FindParam(&dimensions,&N,StochasticForcingDimensionsEnum);    _assert_(N==numfields);
+   int dimtot=0;
+   for(int i=0;i<numfields;i++) dimtot = dimtot+dimensions[i];
+   femmodel->parameters->FindParam(&covariance,&M,&N,StochasticForcingCovarianceEnum); _assert_(M==dimtot); _assert_(N==dimtot);
+
+   /*Compute noise terms*/
+   IssmDouble* noiseterms = xNew<IssmDouble>(dimtot);
+   my_rank=IssmComm::GetRank();
+   if(my_rank==0){
+      int fixedseed;
+      IssmDouble time,dt,starttime;
+      femmodel->parameters->FindParam(&time,TimeEnum);
+      femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+      femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+		/*Determine whether random seed is fixed to time step (randomflag==false) or random seed truly random (randomflag==true)*/
+      if(randomflag) fixedseed=-1;
+      else fixedseed = reCast<int,IssmDouble>((time-starttime)/dt);
+		/*multivariateNormal needs to be passed a NULL pointer to avoid memory leak issues*/
+      IssmDouble* temparray = NULL;
+      multivariateNormal(&temparray,dimtot,0.0,covariance,fixedseed);
+      for(int i=0;i<dimtot;i++) noiseterms[i]=temparray[i];
+      xDelete<IssmDouble>(temparray);
+   }
+   ISSM_MPI_Bcast(noiseterms,dimtot,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+   
+	int i=0;
+   for(int j=0;j<numfields;j++){
+      int dimenum_type,noiseenum_type;
+      IssmDouble* noisefield = xNew<IssmDouble>(dimensions[j]);
+      for(int k=0;k<dimensions[j];k++){
+         noisefield[k]=noiseterms[i+k];
+      }
+     
+		int dimensionid;
+
+		/*Deal with the autoregressive models*/
+		if(fields[j]==SMBautoregressionEnum || fields[j]==FrontalForcingsRignotAutoregressionEnum){
+			switch(fields[j]){
+				case SMBautoregressionEnum:
+					dimenum_type   = SmbBasinsIdEnum;
+					noiseenum_type = SmbAutoregressionNoiseEnum;
+					break;
+				case FrontalForcingsRignotAutoregressionEnum:
+					dimenum_type   = FrontalForcingsBasinIdEnum;
+					noiseenum_type = ThermalforcingAutoregressionNoiseEnum;
+					break;
+			}
+			for(Object* &object:femmodel->elements->objects){
+            Element* element = xDynamicCast<Element*>(object);
+            int numvertices  = element->GetNumberOfVertices();
+            IssmDouble* noise_element = xNew<IssmDouble>(numvertices);
+            element->GetInputValue(&dimensionid,dimenum_type);
+            for(int i=0;i<numvertices;i++) noise_element[i] = noisefield[dimensionid];
+            element->AddInput(noiseenum_type,noise_element,P0Enum);
+            xDelete<IssmDouble>(noise_element);
+			}
+		}
+		else{
+			switch(fields[j]){
+				case SMBautoregressionEnum:
+				case FrontalForcingsRignotAutoregressionEnum:
+					/*Already done above*/
+					break;
+				case DefaultCalvingEnum:
+					/*Delete CalvingCalvingrateEnum at previous time step (required if it is transient)*/
+					femmodel->inputs->DeleteInput(CalvingCalvingrateEnum);
+					for(Object* &object:femmodel->elements->objects){
+						Element* element = xDynamicCast<Element*>(object);
+						int numvertices  = element->GetNumberOfVertices();
+						IssmDouble baselinecalvingrate;
+						IssmDouble calvingrate_tot[numvertices];
+						Input* baselinecalvingrate_input  = NULL;
+						baselinecalvingrate_input = element->GetInput(BaselineCalvingCalvingrateEnum); _assert_(baselinecalvingrate_input);
+						element->GetInputValue(&dimensionid,StochasticForcingDefaultIdEnum);
+						Gauss* gauss = element->NewGauss();
+						for(int i=0;i<numvertices;i++){
+							gauss->GaussVertex(i);
+							baselinecalvingrate_input->GetInputValue(&baselinecalvingrate,gauss);
+							calvingrate_tot[i] = max(0.0,baselinecalvingrate+noisefield[dimensionid]);
+						}
+						element->AddInput(CalvingCalvingrateEnum,&calvingrate_tot[0],P1DGEnum);
+						delete gauss;
+					}
+					break;
+				case FloatingMeltRateEnum:
+					/*Delete BasalforcingsFloatingiceMeltingRateEnum at previous time step (required if it is transient)*/
+					femmodel->inputs->DeleteInput(BasalforcingsFloatingiceMeltingRateEnum);
+					for(Object* &object:femmodel->elements->objects){
+						Element* element = xDynamicCast<Element*>(object);
+						int numvertices  = element->GetNumberOfVertices();
+						IssmDouble baselinefloatingicemeltrate;
+						IssmDouble floatingicemeltrate_tot[numvertices];
+						Input* baselinefloatingicemeltrate_input  = NULL;
+						baselinefloatingicemeltrate_input = element->GetInput(BaselineBasalforcingsFloatingiceMeltingRateEnum); _assert_(baselinefloatingicemeltrate_input);
+						element->GetInputValue(&dimensionid,StochasticForcingDefaultIdEnum);
+						Gauss* gauss = element->NewGauss();
+						for(int i=0;i<numvertices;i++){
+							gauss->GaussVertex(i);
+							baselinefloatingicemeltrate_input->GetInputValue(&baselinefloatingicemeltrate,gauss);
+							floatingicemeltrate_tot[i] = max(0.0,baselinefloatingicemeltrate+noisefield[dimensionid]);
+						}
+						element->AddInput(BasalforcingsFloatingiceMeltingRateEnum,&floatingicemeltrate_tot[0],P1DGEnum);
+						delete gauss;
+					}
+					break;
+				//VV working(29Nov2021)
+				case FrictionWaterPressureEnum:
+					/*Specify that WaterPressure is stochastic*/ 
+					femmodel->parameters->SetParam(true,StochasticForcingIsWaterPressureEnum);
+					for(Object* &object:femmodel->elements->objects){
+                  Element* element = xDynamicCast<Element*>(object);
+                  int numvertices  = element->GetNumberOfVertices();
+                  IssmDouble p_water_deterministic[numvertices];
+                  IssmDouble p_water[numvertices];
+						element->GetInputValue(&dimensionid,StochasticForcingDefaultIdEnum);
+						Gauss* gauss=element->NewGauss();
+						Friction* friction = new Friction(element);
+						for(int i=0;i<numvertices;i++){
+							gauss->GaussVertex(i);
+							p_water_deterministic[i] = friction->SubglacialWaterPressure(gauss);
+							p_water[i]               = p_water_deterministic[i] + noisefield[dimensionid]; //make sure positive (29Nov2021)
+							p_water[i]               = max(0.0,p_water[i]);
+						}
+						element->AddInput(FrictionWaterPressureEnum,p_water,P1DGEnum);
+						delete gauss;
+						delete friction;
+					}
+					break;
+
+				/*
+				case FrictionEffectivePressureEnum:
+					femmodel->parameters->SetParam(true,StochasticForcingIsEffectivePressureEnum);
+					for(Object* &object:femmodel->elements->objects){
+                  Element* element = xDynamicCast<Element*>(object);
+                  int numvertices  = element->GetNumberOfVertices();
+                  IssmDouble Neff[numvertices];
+						element->GetInputValue(&dimensionid,StochasticForcingDefaultIdEnum);
+						Gauss* gauss=element->NewGauss();
+						Friction* friction = new Friction(element);
+						for(int i=0;i<numvertices;i++){
+							gauss->GaussVertex(i);
+							Neff[i] = friction->EffectivePressure(gauss);
+							Neff[i] = Neff[i]+noisefield[dimensionid];
+						}
+						element->AddInput(FrictionEffectivePressureEnum,Neff,P1DGEnum);
+						delete gauss;
+						delete friction;
+					}
+					break;
+				*/
+
+				default:
+					_error_("Field "<<EnumToStringx(fields[j])<<" does not support stochasticity yet.");
+			}
+		}
+		i=i+dimensions[j];
+      xDelete<IssmDouble>(noisefield);
+   }
+
+	/*Cleanup*/
+   xDelete<int>(fields);
+   xDelete<int>(dimensions);
+   xDelete<IssmDouble>(covariance);
+   xDelete<IssmDouble>(noiseterms);
+}/*}}}*/
Index: /issm/trunk/src/c/modules/StochasticForcingx/StochasticForcingx.h
===================================================================
--- /issm/trunk/src/c/modules/StochasticForcingx/StochasticForcingx.h	(revision 26744)
+++ /issm/trunk/src/c/modules/StochasticForcingx/StochasticForcingx.h	(revision 26744)
@@ -0,0 +1,10 @@
+#ifndef _STOCHASTICFORCINGX_H
+#define _STOCHASTICFORCINGX_H
+
+#include "../../classes/classes.h"
+#include "../../analyses/analyses.h"
+
+/* local prototypes: */
+void StochasticForcingx(FemModel* femmodel);
+
+#endif
Index: /issm/trunk/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp
===================================================================
--- /issm/trunk/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp	(revision 26744)
@@ -61,11 +61,23 @@
 	/*Retrieve all inputs we will be needing: */
 	DatasetInput* weights_input=topelement->GetDatasetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
-	Input* vx_input     =topelement->GetInput(VxEnum);                                 _assert_(vx_input);
-	Input* vxobs_input  =topelement->GetInput(InversionVxObsEnum);                     _assert_(vxobs_input);
+	Input* vx_input     = NULL;
+	Input* vxobs_input  = topelement->GetInput(InversionVxObsEnum);	_assert_(vxobs_input);
 	Input* vy_input     = NULL;
 	Input* vyobs_input  = NULL;
-	if(numcomponents==2){
-		vy_input    =topelement->GetInput(VyEnum);              _assert_(vy_input);
-		vyobs_input =topelement->GetInput(InversionVyObsEnum);  _assert_(vyobs_input);
+
+	/*Read SurfaceEnum from 2D models:SSA, L1L2, MLHO*/
+	if (domaintype == Domain2DhorizontalEnum) {
+		vx_input = topelement->GetInput(VxSurfaceEnum);					_assert_(vx_input);
+		if(numcomponents==2){
+			vy_input    =topelement->GetInput(VySurfaceEnum);        _assert_(vy_input);
+			vyobs_input =topelement->GetInput(InversionVyObsEnum);	_assert_(vyobs_input);
+		}
+	}
+	else {
+		vx_input = topelement->GetInput(VxEnum);							_assert_(vx_input);
+		if(numcomponents==2){
+			vy_input    =topelement->GetInput(VyEnum);					_assert_(vy_input);
+			vyobs_input =topelement->GetInput(InversionVyObsEnum);	_assert_(vyobs_input);
+		}
 	}
 
@@ -101,5 +113,5 @@
 
 	/*clean up and Return: */
-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
+	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
 	xDelete<IssmDouble>(xyz_list);
 	delete gauss;
Index: /issm/trunk/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp
===================================================================
--- /issm/trunk/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp	(revision 26744)
@@ -69,12 +69,24 @@
 	DatasetInput* weights_input=topelement->GetDatasetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
 	Input* S_input      = topelement->GetInput(SurfaceAreaEnum);     _assert_(S_input);
-	Input* vx_input     = topelement->GetInput(VxEnum);              _assert_(vx_input);
-	Input* vxobs_input  = topelement->GetInput(InversionVxObsEnum);  _assert_(vxobs_input);
-	Input* vy_input     = NULL;
-	Input* vyobs_input  = NULL;
-	if(numcomponents==2){
-		vy_input    =topelement->GetInput(VyEnum);              _assert_(vy_input);
-		vyobs_input =topelement->GetInput(InversionVyObsEnum);  _assert_(vyobs_input);
+   Input* vx_input     = NULL;
+   Input* vxobs_input  = topelement->GetInput(InversionVxObsEnum); _assert_(vxobs_input);
+   Input* vy_input     = NULL;
+   Input* vyobs_input  = NULL;
+
+   /*Read SurfaceEnum from 2D models:SSA, L1L2, MLHO*/
+   if (domaintype == Domain2DhorizontalEnum) {
+      vx_input = topelement->GetInput(VxSurfaceEnum);             _assert_(vx_input);
+      if(numcomponents==2){
+         vy_input    =topelement->GetInput(VySurfaceEnum);        _assert_(vy_input);
+         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
+      }
 	}
+   else {
+      vx_input = topelement->GetInput(VxEnum);                    _assert_(vx_input);
+      if(numcomponents==2){
+         vy_input    =topelement->GetInput(VyEnum);               _assert_(vy_input);
+         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
+      }
+   }
 
 	/* Start  looping on the number of gaussian points: */
@@ -113,5 +125,5 @@
 
 	/*clean up and Return: */
-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
+	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
 	xDelete<IssmDouble>(xyz_list);
 	delete gauss;
Index: /issm/trunk/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp
===================================================================
--- /issm/trunk/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp	(revision 26744)
@@ -63,12 +63,24 @@
 	/*Retrieve all inputs we will be needing: */
 	DatasetInput* weights_input=topelement->GetDatasetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
-	Input* vx_input     =topelement->GetInput(VxEnum);                                 _assert_(vx_input);
-	Input* vxobs_input  =topelement->GetInput(InversionVxObsEnum);                     _assert_(vxobs_input);
-	Input* vy_input     = NULL;
-	Input* vyobs_input  = NULL;
-	if(numcomponents==2){
-		vy_input    =topelement->GetInput(VyEnum);              _assert_(vy_input);
-		vyobs_input =topelement->GetInput(InversionVyObsEnum);  _assert_(vyobs_input);
+   Input* vx_input     = NULL;
+   Input* vxobs_input  = topelement->GetInput(InversionVxObsEnum);   _assert_(vxobs_input);
+   Input* vy_input     = NULL;
+   Input* vyobs_input  = NULL;
+
+   /*Read SurfaceEnum from 2D models:SSA, L1L2, MLHO*/
+   if (domaintype == Domain2DhorizontalEnum) {
+      vx_input = topelement->GetInput(VxSurfaceEnum);             _assert_(vx_input);
+      if(numcomponents==2){
+         vy_input    =topelement->GetInput(VySurfaceEnum);        _assert_(vy_input);
+         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
+      }
 	}
+   else {
+      vx_input = topelement->GetInput(VxEnum);                    _assert_(vx_input);
+      if(numcomponents==2){
+         vy_input    =topelement->GetInput(VyEnum);               _assert_(vy_input);
+         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
+      }
+   }
 
 	/* Start  looping on the number of gaussian points: */
@@ -110,5 +122,5 @@
 
 	/*clean up and Return: */
-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
+	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
 	xDelete<IssmDouble>(xyz_list);
 	delete gauss;
Index: /issm/trunk/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp
===================================================================
--- /issm/trunk/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp	(revision 26744)
@@ -63,12 +63,24 @@
 	/*Retrieve all inputs we will be needing: */
 	DatasetInput* weights_input=topelement->GetDatasetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
-	Input* vx_input     =topelement->GetInput(VxEnum);                                 _assert_(vx_input);
-	Input* vxobs_input  =topelement->GetInput(InversionVxObsEnum);                     _assert_(vxobs_input);
-	Input* vy_input     = NULL;
-	Input* vyobs_input  = NULL;
-	if(numcomponents==2){
-		vy_input    =topelement->GetInput(VyEnum);              _assert_(vy_input);
-		vyobs_input =topelement->GetInput(InversionVyObsEnum);  _assert_(vyobs_input);
+   Input* vx_input     = NULL;
+   Input* vxobs_input  = topelement->GetInput(InversionVxObsEnum);   _assert_(vxobs_input);
+   Input* vy_input     = NULL;
+   Input* vyobs_input  = NULL;
+
+   /*Read SurfaceEnum from 2D models:SSA, L1L2, MLHO*/
+   if (domaintype == Domain2DhorizontalEnum) {
+      vx_input = topelement->GetInput(VxSurfaceEnum);             _assert_(vx_input);
+      if(numcomponents==2){
+         vy_input    =topelement->GetInput(VySurfaceEnum);        _assert_(vy_input);
+         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
+      }
 	}
+   else {
+      vx_input = topelement->GetInput(VxEnum);                    _assert_(vx_input);
+      if(numcomponents==2){
+         vy_input    =topelement->GetInput(VyEnum);               _assert_(vy_input);
+         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
+      }
+   }
 
 	/* Start  looping on the number of gaussian points: */
@@ -110,5 +122,5 @@
 
 	/*clean up and Return: */
-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
+	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
 	xDelete<IssmDouble>(xyz_list);
 	delete gauss;
Index: /issm/trunk/src/c/modules/SurfaceMassBalancex/Gembx.cpp
===================================================================
--- /issm/trunk/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 26744)
@@ -39,13 +39,11 @@
 	IssmDouble t,smb_dt;
    IssmDouble delta;
-	bool       isclimatology=false;
 	bool       linear_interp=true;
 
-	femmodel->parameters->FindParam(&linear_interp,TimesteppingInterpForcingsEnum); /*is interpolation requested*/
+	femmodel->parameters->FindParam(&linear_interp,TimesteppingInterpForcingEnum); /*is interpolation requested*/
 	femmodel->parameters->FindParam(&time,TimeEnum);                        /*transient core time at which we run the smb core*/
    femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);          /*transient core time step*/
 	femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
    femmodel->parameters->FindParam(&smb_dt,SmbDtEnum);                     /*time period for the smb solution,  usually smaller than the glaciological dt*/
-	femmodel->parameters->FindParam(&isclimatology,SmbIsclimatologyEnum);
 
 	//before starting loop, realize that the transient core runs this smb_core at time = time +deltaT.
@@ -63,18 +61,4 @@
 
 			timeclim=time;
-			if (isclimatology){
-				//If this is a climatology, we need to repeat the forcing after the final time
-				TransientInput* Ta_input_tr  = element->inputs->GetTransientInput(SmbTaEnum);    _assert_(Ta_input_tr);
-
-				/*Get temperature climatology value*/
-				int offsetend = Ta_input_tr->GetTimeInputOffset(finaltime);
-				IssmDouble time0     = Ta_input_tr->GetTimeByOffset(-1);
-				IssmDouble timeend   = Ta_input_tr->GetTimeByOffset(offsetend);
-				timeend   = ceil(timeend/dt)*dt;
-				if (time>time0 & timeend>time0){
-					delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
-					timeclim=time0+delta;
-				}
-			}
 			if (linear_interp) timeinputs = t-time+timeclim;
 			else timeinputs = t-time+timeclim+smb_dt/2;
@@ -197,4 +181,80 @@
 
 } /*}}}*/
+IssmDouble gardnerAlb(IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble dPHC, int m){ /*{{{*/
+	//gardnerAlb(S1, c1, SZA, t, z1, S2, c2)
+	//This is an implementation of the snow and ice broadband albedo
+	//  parameterization developed by Alex Gardner.
+	//Created By: Alex S. Gardner, Jet Propulsion Laboratory [alex.s.gardner@jpl.nasa.gov]
+	//  Last Modified: June, 2014
+	//Full Reference: Gardner, A. S., and Sharp, M. J.: A review of snow and
+	//  ice albedo and the development of a new physically based broadband albedo
+	//  parameterization, J. Geophys. Res., 115, F01009, 10.1029/2009jf001444,
+	//  2010.
+
+	//INPUTS
+	// ONE LAYER
+	//  - S1    : specific surface area of the snow or ice [cm^2 g-1]
+	//  - c1    : concentration of light absorbing carbon  [ppm1]
+	//  - SZA   : solar zenith angle of the incident radiation [deg]
+	//  - t     : cloud optical thickness
+	// TWO LAYER
+	//  - z1    : depth of snow suface layer [mm w.e.]
+	//  - S2    : specific surface area of bottom ice layer [cm^2 g-1]
+	//  - c2    : concentration of light absorbing carbon of bottom ice
+	//             layer [ppm1]
+	IssmDouble c1=clabSnow;
+	IssmDouble c2=clabIce;
+	IssmDouble t=COT;
+	IssmDouble a=0.0;
+
+	//Single layer albedo parameterization
+	//convert effective radius to specific surface area [cm2 g-1]
+	IssmDouble S1 = 3.0 / (0.091 * re[0]);
+
+	//effective solar zenith angle
+	IssmDouble x = min(pow(t/(3*cos(Pi*SZA/180.0)),0.5), 1.0);
+	IssmDouble u = 0.64*x + (1-x)*cos(Pi*SZA/180.0);
+
+	// pure snow albedo
+	IssmDouble as = 1.48 - pow(S1,-0.07);
+
+	//change in pure snow albedo due to soot loading
+	IssmDouble dac = max(0.04 - as, pow(-c1,0.55)/(0.16 + 0.6*pow(S1,0.5) + (1.8*pow(c1,0.6))*pow(S1,-0.25)));
+
+	//Two layer albedo parameterization
+	//  do two layer calculation if there is more than 1 layer
+	IssmDouble z1=0.0;
+	int lice=0;
+	for(int l=0;(l<m & d[l]<dPHC-Dtol);l++){
+		z1=z1+dz[l]*d[l]; //mm
+		lice=l+1;
+	}
+	if (m>0 & lice<m & z1 > Dtol){
+		// determine albedo values for bottom layer
+		IssmDouble S2 = 3.0 / (0.091 * re[lice]);
+
+		// pure snow albedo
+		IssmDouble as2 = 1.48 - pow(S2,-0.07);
+
+		// change in pure snow albedo due to soot loading
+		IssmDouble dac2 = max(0.04 - as2, pow(-c2,0.55)/(0.16 + 0.6*pow(S1,0.5) + (1.8*pow(c2,0.6))*pow(S2,-0.25)));
+
+		// determine the effective change due to finite depth and soot loading
+		IssmDouble A = min(1.0, (2.1 * pow(z1,1.35*(1-as) - 0.1*c1 - 0.13)));
+
+		dac =  (as2 + dac2 - as) + A*((as + dac) - (as2 + dac2));
+	}
+
+	// change in albedo due to solar zenith angle
+	IssmDouble dasz = 0.53*as*(1 - (as + dac))*pow(1 - u,1.2);
+
+	// change in albedo due to cloud (apart from change in diffuse fraction)
+	IssmDouble dat = (0.1*t*pow(as + dac,1.3)) / (pow(1 + 1.5*t,as));
+
+	// Broadband albedo
+	a = as + dac + dasz + dat;
+
+	return a;
+}   /*}}}*/
 void grainGrowth(IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, IssmDouble* T,IssmDouble* dz,IssmDouble* d, IssmDouble* W,IssmDouble smb_dt,int m,int aIdx,int sid){ /*{{{*/
 
@@ -333,8 +393,8 @@
 			}
 			// dendricity and sphericity can not be > 1 or < 0
-         if (gdn[i]<0.0+Gdntol)gdn[i]=0.0;
-         if (gsp[i]<0.0+Gdntol)gsp[i]=0.0;
-         if (gdn[i]>1.0-Gdntol)gdn[i]=1.0;
-         if (gsp[i]>1.0-Gdntol)gsp[i]=1.0;
+         if (gdn[i]<=0.0+Gdntol)gdn[i]=0.0;
+         if (gsp[i]<=0.0+Gdntol)gsp[i]=0.0;
+         if (gdn[i]>=1.0-Gdntol)gdn[i]=1.0;
+         if (gsp[i]>=1.0-Gdntol)gsp[i]=1.0;
 
          // determine new grain size (mm)
@@ -344,7 +404,4 @@
 		else{
 
-			//When the state of "faceted crystals" (gsp==0) is fully reached,
-			// snow evolves towards depth hoar if the gradient is
-			// higher than 15 degC m-1 (Brun et al., 1992)
 			//When wet-snow grains (class 6) are submitted to a
 			// temperature gradient higher than 5 degC m-1, their sphericity
@@ -352,15 +409,26 @@
 			// reaches 0, their size increases according to the functions
 			// determined by Marbouty. (Brun et al., 1992)
-			if(gsp[i]>0.0+Gdntol && gsp[i]<1.0-Gdntol && (dT[i]>15.0+Ttol || (dT[i]>5.0+Ttol && W[i]>0.0+Wtol)) ){
-				//determine coefficients
-				IssmDouble C = (-2e8 * exp(-6e3 / T[i]) * dt) * pow(dT[i],.4);
-				gsp[i] +=C;
-				if (gsp[i]<0.0+Gdntol)gsp[i]=0.0;
-				//determine new grain size (mm)
-				gsz[i] = 0.35 + (0.5-gsp[i])*0.1;
-			}
+			if(gsp[i]>0.0+Gdntol && gsp[i]<1.0-Gdntol){
+
+				IssmDouble F = 0.0;
+
+				if (dT[i]>5.0+Ttol){
+					F = (-2e8 * exp(-6e3 / T[i]) * dt) * pow(dT[i],.4);
+				}
+				else if (W[i]>0.0+Wtol){
+					F = (1.0/16.0) * pow(lwc[i],3.0) * dt;
+				}
+				else{
+					F = 1e9 * exp(-6e3 / T[i]) * dt;
+				}
+				gsp[i] +=F;
+
+			}
+			if (gsp[i]<=0.0+Gdntol)gsp[i]=0.0;
+			if (gsp[i]>=1.0-Gdntol)gsp[i]=1.0;
+
 			/*Dry snow metamorphism (Marbouty, 1980) grouped model coefficents
 			 *from Marbouty, 1980: Figure 9*/
-			else if(W[i]<=0.0+Wtol || (gsp[i]<=0.0+Gdntol && dT[i]>15.0+Ttol) || (gsp[i]<=0.0+Gdntol && dT[i]>5.0+Ttol && W[i]>0.0+Wtol)){
+			if(W[i]<=0.0+Wtol || (gsp[i]<=0.0+Gdntol && dT[i]>5.0+Ttol)){
 				//_printf_("Nondendritic snow metamorphism\n");
 				Q = Marbouty(T[i],d[i],dT[i]);
@@ -402,5 +470,5 @@
 
 }  /*}}}*/
-void albedo(IssmDouble** pa, int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* TK, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m,int sid) { /*{{{*/
+void albedo(IssmDouble** pa, IssmDouble** padiff, int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* TK, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m,int sid) { /*{{{*/
 
 	//// Calculates Snow, firn and ice albedo as a function of:
@@ -424,6 +492,12 @@
 	// Methods 1 & 2
 	//   re      = surface effective grain radius [mm]
-
-	// Methods 3
+	// Method 1, optional
+	//  clabSnow = concentration of light absorbing carbon  [ppm1], default 0
+	//  SZA      = solar zenith angle of the incident radiation [deg], default 0
+	//  COT      = cloud optical thickness, default 0
+	//  For TWO LAYER
+	//  clabIce  = concentration of light absorbing carbon of first ice layer [ppm1], default 0
+
+	// Method 3
 	//   d       = snow surface density [kg m-3]
 	//   n       = cloud amount
@@ -431,5 +505,5 @@
 	//   aSnow   = albedo of fresh snow
 
-	// Methods 4
+	// Method 4
 	//   aIce    = albedo of ice
 	//   aSnow   = albedo of fresh snow
@@ -457,4 +531,5 @@
 	/*output: */
 	IssmDouble* a=NULL;
+	IssmDouble* adiff=NULL;
 
 	if(VerboseSmb() && sid==0 && IssmComm::GetRank()==0)_printf0_("   albedo module\n");
@@ -462,4 +537,5 @@
 	/*Recover pointers: */
 	a=*pa;
+	adiff=*padiff;
 
 	//some constants:
@@ -476,10 +552,7 @@
 		if(aIdx==1){ 
 			//function of effective grain radius
-
-			//convert effective radius to specific surface area [cm2 g-1]
-			IssmDouble S = 3.0 / (0.091 * re[0]);
-
-			//determine broadband albedo
-			a[0]= 1.48 - pow(S,-0.07);
+			// clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, int m
+			a[0]=gardnerAlb(re, dz, d, clabSnow, clabIce, SZA, COT, dPHC, m);
+			adiff[0]=gardnerAlb(re, dz, d, clabSnow, clabIce, 50, COT, dPHC, m);
 		}
 		else if(aIdx==2){
@@ -572,5 +645,5 @@
 		//If we do not have fresh snow
 		if (aIdx<3 && aIdx>0 && (adThresh - d[0])>=Dtol){
-			// In a layer < 10cm, account for mix of ice and snow,
+			// In a snow layer < 10cm, account for mix of ice and snow,
 			// after P. Alexander et al., 2014
 			IssmDouble depthsnow=0.0;
@@ -618,7 +691,8 @@
 	/*Assign output pointers:*/
 	*pa=a;
+	*padiff=adiff;
 
 }  /*}}}*/
-void thermo(IssmDouble* pEC, IssmDouble** pT, IssmDouble* pulwrf, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlwrf, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT) { /*{{{*/
+void thermo(IssmDouble* pEC, IssmDouble** pT, IssmDouble* pulwrf, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlwrf, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble eIdx, IssmDouble teValue, IssmDouble dulwrfValue, IssmDouble teThresh, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT, bool isdeltaLWup) { /*{{{*/
 
 	/* ENGLACIAL THERMODYNAMICS*/
@@ -936,7 +1010,12 @@
 
 		// upward longwave contribution
-		//ulw = - (SB * pow(Ts,4.0)* teValue) * dt; // - deltatest here
-		IssmDouble deltatest=0;
-		ulw = - (SB * pow(Ts,4.0)* teValue - deltatest) * dt; // - deltatest here
+		IssmDouble deltaULW=0.0;
+		IssmDouble emissivity=1.0;
+		//If user wants to set a upward long wave bias
+		if(isdeltaLWup) deltaULW = dulwrfValue;
+		//If user wants to directly set emissivity, or grain radius is larger than the
+		// threshold, or eIdx is 2 and we have wet snow or ice, use prescribed emissivity
+		if(eIdx==0 || (teThresh - re[0])<Gdntol || (eIdx==2 && z0>0.001)) emissivity = teValue;
+		ulw = - (SB * pow(Ts,4.0)* emissivity + deltaULW) * dt; 
 		ulwrf = ulwrf - ulw/dt0;
 
@@ -998,5 +1077,5 @@
 
 }  /*}}}*/
-void shortwave(IssmDouble** pswf, int swIdx, int aIdx, IssmDouble dsw, IssmDouble as, IssmDouble* d, IssmDouble* dz, IssmDouble* re, IssmDouble dIce, int m, int sid){ /*{{{*/
+void shortwave(IssmDouble** pswf, int swIdx, int aIdx, IssmDouble dsw, IssmDouble dswdiff, IssmDouble as, IssmDouble asdiff, IssmDouble* d, IssmDouble* dz, IssmDouble* re, IssmDouble dIce, int m, int sid){ /*{{{*/
 
 	// DISTRIBUTES ABSORBED SHORTWAVE RADIATION WITHIN SNOW/ICE
@@ -1005,5 +1084,5 @@
 
 	// swIdx = 1 : absorbed SW is distributed with depth as a function of:
-	//   default   : snow density (taken from Bassford, 2004)
+	//   default   : snow density (taken from Bassford, 2002)
 	//   if aIdx=2 : grain size in 3 spectral bands (Brun et al., 1992)
 
@@ -1012,5 +1091,7 @@
 	//   aIdx    = method for calculating albedo (1-4)
 	//   dsw     = downward shortwave radiative flux [w m-2]
+	//   dswdiff  = downward shortwave diffuse radiative flux [w m-2]
 	//   as      = surface albedo
+	//   asdiff  = surface albedo for diffuse radiation
 	//   d       = grid cell density [kg m-3]
 	//   dz      = grid cell depth [m]
@@ -1033,5 +1114,10 @@
 
 		// calculate surface shortwave radiation fluxes [W m-2]
-		swf[0] = (1.0 - as) * dsw;
+		if (aIdx == 1){
+			swf[0] = (1.0 - as) * max(0.0,(dsw - dswdiff)) +  (1.0 - asdiff) * dswdiff;
+		}
+		else{
+			swf[0] = (1.0 - as) * dsw;
+		}
 	}
 	else{ // sw radation is absorbed at depth within the glacier
@@ -1080,5 +1166,5 @@
 			swfS[2] = (sF[2] * dsw) * (1.0 - a2);
 
-			// absorption coeficient for spectral range:
+			// absorption coefficient for spectral range:
 			h =xNew<IssmDouble>(m);
 			B1 =xNew<IssmDouble>(m);
@@ -1197,5 +1283,5 @@
 
 } /*}}}*/ 
-void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble T_air, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid){ /*{{{*/
+void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, IssmDouble* pRa, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble T_air, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid){ /*{{{*/
 
 	// Adds precipitation and deposition to the model grid
@@ -1213,8 +1299,9 @@
 	   dz = topgrid cell length [m]
 	   d = density of top grid gell [kg m-3]
-	   P = precipitation [mm w.e.] or [kg m-3]
-	   re = effective grain radius [mm]
-	   gdn = grain dentricity
-	   gsp = grain sphericity*/
+		P = precipitation [mm w.e.] or [kg m-3]
+		Ra = rainfall [mm w.e.] or [kg m-3]
+		re = effective grain radius [mm]
+		gdn = grain dentricity
+		gsp = grain sphericity*/
 
 	// MAIN FUNCTION
@@ -1238,7 +1325,9 @@
 	IssmDouble* W=NULL;
 	IssmDouble* a=NULL;
+	IssmDouble* adiff=NULL;
 	IssmDouble* re=NULL;
 	IssmDouble* gdn=NULL;
 	IssmDouble* gsp=NULL;
+	IssmDouble  ra=0.0;
 	int         m=0;
 
@@ -1251,8 +1340,10 @@
 	W=*pW;
 	a=*pa;
+	adiff=*padiff;
 	re=*pre;
 	gdn=*pgdn;
 	gsp=*pgsp;
 	m=*pm;
+	ra=*pRa;
 
 	//Density of fresh snow [kg m-3]
@@ -1266,5 +1357,5 @@
 			break;
 
-		case 2: // Density of Greenland snow, Fausto et al., 2008
+		case 2: // Density of Greenland snow, Fausto et al., 2018
 			dSnow = 315;
 			break;
@@ -1309,4 +1400,5 @@
 				newcell(&W,0.0,top,m); //new cell W
 				newcell(&a,aSnow,top,m); //new cell a
+				newcell(&adiff,aSnow,top,m); //new cell a
 				newcell(&re,refall,top,m); //new cell grain size
 				newcell(&gdn,dfall,top,m); //new cell grain dendricity
@@ -1355,4 +1447,6 @@
 				dz[0] = mass / d[0];    // dz is adjusted to conserve mass
 			}
+
+			ra=P;
 		}
 
@@ -1377,10 +1471,12 @@
 	*pW=W;
 	*pa=a;
+	*padiff=adiff;
 	*pre=re;
 	*pgdn=gdn;
 	*pgsp=gsp;
 	*pm=m;
+	*pRa=ra;
 } /*}}}*/
-void melt(IssmDouble* pM, IssmDouble* pMs, IssmDouble* pR, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble zY, IssmDouble dIce, int sid){ /*{{{*/
+void melt(IssmDouble* pM, IssmDouble* pMs, IssmDouble* pR, IssmDouble* pF, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble Ra, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble zY, IssmDouble dIce, int sid){ /*{{{*/
 
 	//// MELT ROUTINE
@@ -1403,5 +1499,5 @@
 	IssmDouble* EW=NULL;
 	IssmDouble* M=NULL;
-	int*       D=NULL;
+	int*        D=NULL;
 
 	IssmDouble sumM=0.0;
@@ -1424,4 +1520,5 @@
 	IssmDouble W_bot=0.0;
 	IssmDouble a_bot=0.0;
+	IssmDouble adiff_bot=0.0;
 	IssmDouble re_bot=0.0;
 	IssmDouble gdn_bot=0.0;
@@ -1446,6 +1543,7 @@
 	IssmDouble  surplusE = 0.0;
 	IssmDouble  surplusT = 0.0;
-	IssmDouble dz_add = 0.0;
+	IssmDouble  dz_add = 0.0;
 	IssmDouble  Rsum = 0.0;
+	IssmDouble  Fsum = 0.0;
 	IssmDouble* T=*pT;
 	IssmDouble* d=*pd;
@@ -1453,4 +1551,5 @@
 	IssmDouble* W=*pW;
 	IssmDouble* a=*pa;
+	IssmDouble* adiff=*padiff;
 	IssmDouble* re=*pre;
 	IssmDouble* gdn=*pgdn;
@@ -1478,4 +1577,5 @@
 	// initialize melt and runoff scalars
 	Rsum = 0.0;       // runoff [kg]
+	Fsum = 0.0;       // refreeze [kg]
 	sumM = 0.0;       // total melt [kg]
 	mAdd = 0.0;       // mass added/removed to/from base of model [kg]
@@ -1523,4 +1623,13 @@
 
 	//// MELT, PERCOLATION AND REFREEZE
+
+	// initialize refreeze, runoff, flxDn and dW vectors [kg]
+	IssmDouble* F = xNewZeroInit<IssmDouble>(n);
+
+	// Add previous refreeze to F and reset dW
+	for(int i=0;i<n;i++){
+		F[i]=F[i]+dW[i];
+		dW[i] = 0.0;
+	}
 
 	// run melt algorithm if there is melt water or excess pore water
@@ -1573,5 +1682,5 @@
 		}
 		Msurf = M[0];
-		sumM = cellsum(M,n);                                                       // total melt [kg]
+		sumM = max(0.0,cellsum(M,n)-Ra);  // total melt [kg] minus the liquid rain that had been added
 
 		// calculate maximum refreeze amount, maxF [kg]
@@ -1579,8 +1688,6 @@
 
 		// initialize refreeze, runoff, flxDn and dW vectors [kg]
- 		IssmDouble* F = xNewZeroInit<IssmDouble>(n);
 		IssmDouble* R = xNewZeroInit<IssmDouble>(n);
 
-		for(int i=0;i<n;i++)dW[i] = 0.0;
 		flxDn=xNewZeroInit<IssmDouble>(n+1);
 
@@ -1595,4 +1702,5 @@
 
 		IssmDouble depthice=0.0;
+		int Xi=0;
 		//// meltwater percolation
 		for(int i=0;i<n;i++){
@@ -1620,5 +1728,4 @@
 				dW[i] = max(min(inM, Wi - W[i]),-1*W[i]);            // change in pore water
 				R[i] = max(0.0, inM - dW[i]);             // runoff
-				F[i] = 0.0;
 			}
 			// check if no energy to refreeze meltwater
@@ -1633,5 +1740,4 @@
 				flxDn[i+1] = max(0.0, inM - dW[i]);         // meltwater out
 				R[i] = 0.0;
-				F[i] = 0.0;                               // no freeze 
 			}
 			// some or all meltwater refreezes
@@ -1649,8 +1755,5 @@
 				//-----------------------pore water-----------------------------
 				Wi = (dIce-d[i])* Swi * dz_0;            // irreducible water 
-				dW[i] = min(inM - F1, Wi-W[i]);         // change in pore water
-				if (dW[i] < 0.0-Wtol && -1*dW[i]> W[i]-Wtol ){
-					dW[i]= -1*W[i];
-				}
+				dW[i] = max(min(inM - F1, Wi-W[i]),-1*W[i]);         // change in pore water
 				IssmDouble F2 = 0.0;                                 
 
@@ -1661,10 +1764,9 @@
 					m[i] = m[i] + F2;                   // mass after refreeze
 					d[i] = m[i]/dz_0;
-					dW[i] = dW[i] - F2;
 				}
 
-				F[i] = F1 + F2;
-
-				flxDn[i+1] = inM - F1 - dW[i];     // meltwater out        
+				F[i] = F[i] + F1 + F2;
+
+				flxDn[i+1] = max(0.0,inM - F1 - dW[i]);     // meltwater out        
 				if (m[i]>Wtol){
 					T[i] = T[i] + ((F1+F2)*(LF+(CtoK - T[i])*CI)/(m[i]*CI));// change in temperature
@@ -1680,4 +1782,5 @@
 				}
 			}
+			Xi=Xi+1;
 		}
 
@@ -1690,5 +1793,5 @@
 
 		//calculate Rsum:
-		Rsum=cellsum(R,n) + flxDn[n];
+		Rsum=cellsum(R,n) + flxDn[Xi];
 
 		// delete all cells with zero mass
@@ -1703,4 +1806,5 @@
 		celldelete(&T,n,D,D_size);
 		celldelete(&a,n,D,D_size);
+		celldelete(&adiff,n,D,D_size);
 		celldelete(&re,n,D,D_size);
 		celldelete(&gdn,n,D,D_size);
@@ -1715,7 +1819,12 @@
 
 		/*Free resources:*/
-		xDelete<IssmDouble>(F);
 		xDelete<IssmDouble>(R);
 	}
+
+	//calculate Fsum:
+	Fsum=cellsum(F,n);
+
+	/*Free resources:*/
+	xDelete<IssmDouble>(F);
 
 	//Merging of cells as they are burried under snow.
@@ -1765,4 +1874,5 @@
 			T[X1] = (T[X2]*m[X2] + T[X1]*m[X1]) / m_new;
 			a[X1] = (a[X2]*m[X2] + a[X1]*m[X1]) / m_new;
+			adiff[X1] = (adiff[X2]*m[X2] + adiff[X1]*m[X1]) / m_new;
 			re[X1] = (re[X2]*m[X2] + re[X1]*m[X1]) / m_new;
 			gdn[X1] = (gdn[X2]*m[X2] + gdn[X1]*m[X1]) / m_new;
@@ -1791,4 +1901,5 @@
 	celldelete(&T,n,D,D_size);
 	celldelete(&a,n,D,D_size);
+	celldelete(&adiff,n,D,D_size);
 	celldelete(&re,n,D,D_size);
 	celldelete(&gdn,n,D,D_size);
@@ -1828,4 +1939,5 @@
 			cellsplit(&d, n, j,1.0);
 			cellsplit(&a, n, j,1.0);
+			cellsplit(&adiff, n, j,1.0);
 			cellsplit(&EI, n, j,.5);
 			cellsplit(&EW, n, j,.5);
@@ -1856,4 +1968,5 @@
 		d_bot=d[n-1];
 		a_bot=a[n-1];
+		adiff_bot=adiff[n-1];
 		re_bot=re[n-1];
 		gdn_bot=gdn[n-1];
@@ -1870,4 +1983,5 @@
 		newcell(&d,d_bot,top,n);
 		newcell(&a,a_bot,top,n);
+		newcell(&adiff,adiff_bot,top,n);
 		newcell(&re,re_bot,top,n);
 		newcell(&gdn,gdn_bot,top,n);
@@ -1895,4 +2009,5 @@
 		celldelete(&d,n,D,D_size);
 		celldelete(&a,n,D,D_size);
+		celldelete(&adiff,n,D,D_size);
 		celldelete(&re,n,D,D_size);
 		celldelete(&gdn,n,D,D_size);
@@ -1946,4 +2061,5 @@
 	*pM=sumM;
 	*pR=Rsum;
+	*pF=Fsum;
 	*pmAdd=mAdd;
 	*pdz_add=dz_add;
@@ -1954,4 +2070,5 @@
 	*pW=W;
 	*pa=a;
+	*padiff=adiff;
 	*pre=re;
 	*pgdn=gdn;
@@ -2090,6 +2207,9 @@
 					if (fabs(adThresh - 820) < Dtol){
 						// ERA5 new aIdx=1, swIdx=0, MODIS 820
-						M0 = max(1.8230 - (0.1645 * log(C)),0.25);
-						M1 = max(2.5134 - (0.3244 * log(C)),0.25);
+						//M0 = max(1.8230 - (0.1645 * log(C)),0.25);
+						//M1 = max(2.5134 - (0.3244 * log(C)),0.25);
+						// ERA5 new aIdx=1, swIdx=0, MODIS 820, p90 new (ERA5, 40 and e97)
+						M0 = max(1.3045 - (0.0988 * log(C)),0.25);
+						M1 = max(1.3694 - (0.1354 * log(C)),0.25);
 					}
 					else{
@@ -2134,6 +2254,9 @@
 					if (fabs(adThresh - 820) < Dtol){
 						// ERA5 new aIdx=1, swIdx=0, MODIS 820
-						M0 = max(1.4174 - (0.1037 * log(C)),0.25);
-						M1 = max(2.2010 - (0.2460 * log(C)),0.25);
+						//M0 = max(1.4174 - (0.1037 * log(C)),0.25);
+						//M1 = max(2.2010 - (0.2460 * log(C)),0.25);
+						// ERA5 new aIdx=1, swIdx=0, MODIS 820, p90 new (ERA5 lwt, 40 and e97)
+						M0 = max(1.2138 - (0.1057 * log(C)),0.25);
+						M1 = max(1.4946 - (0.1607 * log(C)),0.25);
 					}
 					else{
Index: /issm/trunk/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
===================================================================
--- /issm/trunk/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26744)
@@ -3,4 +3,5 @@
  */
 
+#include <config.h>
 #include "./SurfaceMassBalancex.h"
 #include "../../shared/shared.h"
@@ -8,4 +9,5 @@
 #include "../modules.h"
 #include "../../classes/Inputs/TransientInput.h"
+#include "../../shared/Random/random.h"
 
 void SmbForcingx(FemModel* femmodel){/*{{{*/
@@ -14,56 +16,4 @@
 	//    INPUT parameters: ni: working size of arrays
 	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
-	bool isclimatology;
-	femmodel->parameters->FindParam(&isclimatology,SmbIsclimatologyEnum);
-
-	if (isclimatology){
-
-		/*Get time parameters*/
-		IssmDouble time,dt,starttime,finaltime;
-		femmodel->parameters->FindParam(&time,TimeEnum);
-		femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
-		femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
-		femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
-
-		if(time<=starttime+dt){
-			/*FIXME: this is wrong, should be done at the ElementUpdate step of analysis, not here!*/
-			InputDuplicatex(femmodel,SmbMassBalanceEnum,SmbMassBalanceClimateEnum);
-			femmodel->inputs->DeleteInput(SmbMassBalanceEnum);
-		}
-
-		/*If this is a climatology, we need to repeat the forcing after the final time*/
-		TransientInput* smb_input=femmodel->inputs->GetTransientInput(SmbMassBalanceClimateEnum); _assert_(smb_input);
-
-		/*Get accumulation climatology value*/
-		int offsetend = smb_input->GetTimeInputOffset(finaltime);
-		IssmDouble time0     = smb_input->GetTimeByOffset(-1);
-		IssmDouble timeend   = smb_input->GetTimeByOffset(offsetend);
-
-		_assert_(timeend>time0);
-		IssmDouble timeclim  = time;
-
-		if(time>time0 && timeend>time0){
-			IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
-			if(delta==0.){
-				timeclim=timeend;
-			}
-			else{
-				timeclim=time0+delta;
-			}
-		}
-
-		/*Loop over all the elements of this partition*/
-		for(Object* & object : femmodel->elements->objects){
-			Element* element=xDynamicCast<Element*>(object);
-
-			int         numvertices = element->GetNumberOfVertices();
-			IssmDouble* smb         = xNew<IssmDouble>(numvertices);
-			element->GetInputListOnVerticesAtTime(smb,SmbMassBalanceClimateEnum,timeclim);
-
-			/*Add input to element and Free memory*/
-			element->AddInput(SmbMassBalanceEnum,smb,P1Enum);
-			xDelete<IssmDouble>(smb);
-		}
-	}
 
 }/*}}}*/
@@ -196,4 +146,93 @@
 	}
 
+}/*}}}*/
+void SmbautoregressionInitx(FemModel* femmodel){/*{{{*/
+	
+	/*Initialization step of Smbautoregressionx*/
+	int M,N,Nphi,arorder,numbasins,my_rank;
+	IssmDouble starttime,tstep_ar,tinit_ar;
+	femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
+	femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
+	IssmDouble* beta0    = NULL; 
+	IssmDouble* beta1    = NULL;
+	IssmDouble* phi      = NULL;
+	femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+   femmodel->parameters->FindParam(&tstep_ar,SmbAutoregressionTimestepEnum);
+	femmodel->parameters->FindParam(&tinit_ar,SmbAutoregressionInitialTimeEnum);
+	femmodel->parameters->FindParam(&beta0,&M,SmbBeta0Enum);    _assert_(M==numbasins);
+	femmodel->parameters->FindParam(&beta1,&M,SmbBeta1Enum);    _assert_(M==numbasins);
+	femmodel->parameters->FindParam(&phi,&M,&Nphi,SmbPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+	
+	/*AR model spin-up with 0 noise to initialize SmbValuesAutoregressionEnum*/
+	int nspin{2*arorder+5};
+	for(Object* &object:femmodel->elements->objects){
+      Element* element      = xDynamicCast<Element*>(object); //generate element object
+		element->AutoregressionInit(numbasins,arorder,nspin,starttime,tstep_ar,tinit_ar,beta0,beta1,phi,SMBautoregressionEnum);
+	}
+	/*Cleanup*/
+	xDelete<IssmDouble>(beta0);
+	xDelete<IssmDouble>(beta1);
+	xDelete<IssmDouble>(phi);
+}/*}}}*/
+void Smbautoregressionx(FemModel* femmodel){/*{{{*/
+
+   /*Get time parameters*/
+   IssmDouble time,dt,starttime,tstep_ar;
+   femmodel->parameters->FindParam(&time,TimeEnum);
+   femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+   femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+   femmodel->parameters->FindParam(&tstep_ar,SmbAutoregressionTimestepEnum);
+
+   /*Initialize module at first time step*/
+   if(time<=starttime+dt){SmbautoregressionInitx(femmodel);}
+   /*Determine if this is a time step for the AR model*/
+   bool isstepforar = false;
+
+   #ifndef _HAVE_AD_
+   if((fmod(time,tstep_ar)<fmod((time-dt),tstep_ar)) || (time<=starttime+dt) || tstep_ar==dt) isstepforar = true;
+   #else
+   _error_("not implemented yet");
+   #endif
+
+   /*Load parameters*/
+   bool isstochastic;
+   bool issmbstochastic = false;
+   int M,N,Nphi,arorder,numbasins,my_rank;
+   femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
+   femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
+   IssmDouble tinit_ar;
+   IssmDouble* beta0      = NULL; 
+   IssmDouble* beta1      = NULL;
+   IssmDouble* phi        = NULL;
+
+   femmodel->parameters->FindParam(&tinit_ar,SmbAutoregressionInitialTimeEnum);
+   femmodel->parameters->FindParam(&beta0,&M,SmbBeta0Enum);    _assert_(M==numbasins);
+   femmodel->parameters->FindParam(&beta1,&M,SmbBeta1Enum);    _assert_(M==numbasins);
+   femmodel->parameters->FindParam(&phi,&M,&Nphi,SmbPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+
+   femmodel->parameters->FindParam(&isstochastic,StochasticForcingIsStochasticForcingEnum);
+   if(isstochastic){
+      int  numstochasticfields;
+      int* stochasticfields;
+      femmodel->parameters->FindParam(&numstochasticfields,StochasticForcingNumFieldsEnum);
+      femmodel->parameters->FindParam(&stochasticfields,&N,StochasticForcingFieldsEnum); _assert_(N==numstochasticfields);
+      for(int i=0;i<numstochasticfields;i++){
+         if(stochasticfields[i]==SMBautoregressionEnum) issmbstochastic = true;
+      }
+      xDelete<int>(stochasticfields);
+   }
+   /*Time elapsed with respect to AR model initial time*/
+   IssmDouble telapsed_ar = time-tinit_ar;
+
+   /*Loop over each element to compute SMB at vertices*/
+   for(Object* &object:femmodel->elements->objects){
+      Element* element = xDynamicCast<Element*>(object);
+      element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,issmbstochastic,SMBautoregressionEnum);
+   }
+
+   /*Cleanup*/
+   xDelete<IssmDouble>(beta0);
+   xDelete<IssmDouble>(beta1);
+   xDelete<IssmDouble>(phi);
 }/*}}}*/
 void Delta18oParameterizationx(FemModel* femmodel){/*{{{*/
@@ -410,6 +449,4 @@
 	//    surface runoff (m/yr water equivalent): runoff
 	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
-	bool isclimatology;
-	femmodel->parameters->FindParam(&isclimatology,SmbIsclimatologyEnum);
 
 	/*Loop over all the elements of this partition*/
@@ -425,67 +462,7 @@
 
 		/*Recover Smb Components*/
-		if(isclimatology){
-
-			int offsetend;
-			IssmDouble time0,timeend,timeclim;
-			IssmDouble time,starttime,finaltime;
-
-			/*Get time parameters*/
-			femmodel->parameters->FindParam(&time,TimeEnum);
-			femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
-			femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
-
-			//If this is a climatology, we need to repeat the forcing after the final time
-			TransientInput* acc_input    = element->inputs->GetTransientInput(SmbAccumulationEnum); _assert_(acc_input);
-			TransientInput* evap_input   = element->inputs->GetTransientInput(SmbEvaporationEnum);  _assert_(evap_input);
-			TransientInput* runoff_input = element->inputs->GetTransientInput(SmbRunoffEnum);       _assert_(runoff_input);
-
-			//Get accumulation climatology value
-			offsetend = acc_input->GetTimeInputOffset(finaltime);
-			time0     = acc_input->GetTimeByOffset(-1);
-			timeend   = acc_input->GetTimeByOffset(offsetend);
-			timeclim  = time;
-			if(time>time0 & timeend>time0){
-				IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
-				if(delta==0.)
-				 timeclim=timeend;
-				else
-				 timeclim=time0+delta;
-			}
-			element->GetInputListOnVerticesAtTime(acc,SmbAccumulationEnum,timeclim);
-
-			//Get evaporation climatology value
-			offsetend = evap_input->GetTimeInputOffset(finaltime);
-			time0     = evap_input->GetTimeByOffset(-1);
-			timeend   = evap_input->GetTimeByOffset(offsetend);
-			timeclim  = time;
-			if(time>time0 & timeend>time0){
-				IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
-				if(delta==0.)
-				 timeclim=timeend;
-				else
-				 timeclim=time0+delta;
-			}
-			element->GetInputListOnVerticesAtTime(evap,SmbEvaporationEnum,timeclim);
-
-			//Get runoff climatology value
-			offsetend = runoff_input->GetTimeInputOffset(finaltime);
-			time0     = runoff_input->GetTimeByOffset(-1);
-			timeend   = runoff_input->GetTimeByOffset(offsetend);
-			timeclim  = time;
-			if(time>time0 & timeend>time0){
-				IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
-				if(delta==0.)
-				 timeclim=timeend;
-				else
-				 timeclim=time0+delta;
-			}
-			element->GetInputListOnVerticesAtTime(runoff,SmbRunoffEnum,timeclim);
-		}
-		else{
-			element->GetInputListOnVertices(acc,SmbAccumulationEnum);
-			element->GetInputListOnVertices(evap,SmbEvaporationEnum);
-			element->GetInputListOnVertices(runoff,SmbRunoffEnum);
-		}
+		element->GetInputListOnVertices(acc,SmbAccumulationEnum);
+		element->GetInputListOnVertices(evap,SmbEvaporationEnum);
+		element->GetInputListOnVertices(runoff,SmbRunoffEnum);
 
 		// loop over all vertices
@@ -510,6 +487,4 @@
 	//    refreeze of surface melt (m/yr water equivalent): refreeze
 	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
-	bool isclimatology;
-	femmodel->parameters->FindParam(&isclimatology,SmbIsclimatologyEnum);
 
 	/*Loop over all the elements of this partition*/
@@ -526,82 +501,8 @@
 
 		/*Recover Smb Components*/
-		if (isclimatology){
-
-			int offsetend;
-			IssmDouble time0,timeend,timeclim;
-			IssmDouble time,starttime,finaltime;
-			femmodel->parameters->FindParam(&time,TimeEnum);
-			femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
-			femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
-
-
-			//If this is a climatology, we need to repeat the forcing after the final time
-			TransientInput* acc_input      = element->inputs->GetTransientInput(SmbAccumulationEnum); _assert_(acc_input);
-			TransientInput* evap_input     = element->inputs->GetTransientInput(SmbEvaporationEnum);  _assert_(evap_input);
-			TransientInput* melt_input     = element->inputs->GetTransientInput(SmbMeltEnum);         _assert_(melt_input);
-			TransientInput* refreeze_input = element->inputs->GetTransientInput(SmbRefreezeEnum);     _assert_(refreeze_input);
-
-			//Get accumulation climatology value
-			offsetend = acc_input->GetTimeInputOffset(finaltime);
-			time0     = acc_input->GetTimeByOffset(-1);
-			timeend   = acc_input->GetTimeByOffset(offsetend);
-			timeclim  = time;
-			if(time>time0 & timeend>time0){
-				IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
-				if(delta==0.)
-				 timeclim=timeend;
-				else
-				 timeclim=time0+delta;
-			}
-			element->GetInputListOnVerticesAtTime(acc,SmbAccumulationEnum,timeclim);
-
-			//Get evaporation climatology value
-			offsetend = evap_input->GetTimeInputOffset(finaltime);
-			time0     = evap_input->GetTimeByOffset(-1);
-			timeend   = evap_input->GetTimeByOffset(offsetend);
-			timeclim  = time;
-			if(time>time0 & timeend>time0){
-				IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
-				if(delta==0.)
-				 timeclim=timeend;
-				else
-				 timeclim=time0+delta;
-			}
-			element->GetInputListOnVerticesAtTime(evap,SmbEvaporationEnum,timeclim);
-
-			//Get melt climatology value
-			offsetend = melt_input->GetTimeInputOffset(finaltime);
-			time0     = melt_input->GetTimeByOffset(-1);
-			timeend   = melt_input->GetTimeByOffset(offsetend);
-			timeclim  = time;
-			if(time>time0 & timeend>time0){
-				IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
-				if(delta==0.)
-				 timeclim=timeend;
-				else
-				 timeclim=time0+delta;
-			}
-			element->GetInputListOnVerticesAtTime(melt,SmbMeltEnum,timeclim);
-
-			//Get refreeze climatology value
-			offsetend = refreeze_input->GetTimeInputOffset(finaltime);
-			time0     = refreeze_input->GetTimeByOffset(-1);
-			timeend   = refreeze_input->GetTimeByOffset(offsetend);
-			timeclim  = time;
-			if(time>time0 & timeend>time0){
-				IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
-				if(delta==0.)
-				 timeclim=timeend;
-				else
-				 timeclim=time0+delta;
-			}
-			element->GetInputListOnVerticesAtTime(refreeze,SmbRefreezeEnum,timeclim);
-		}
-		else{
-			element->GetInputListOnVertices(acc,SmbAccumulationEnum);
-			element->GetInputListOnVertices(evap,SmbEvaporationEnum);
-			element->GetInputListOnVertices(melt,SmbMeltEnum);
-			element->GetInputListOnVertices(refreeze,SmbRefreezeEnum);
-		}
+		element->GetInputListOnVertices(acc,SmbAccumulationEnum);
+		element->GetInputListOnVertices(evap,SmbEvaporationEnum);
+		element->GetInputListOnVertices(melt,SmbMeltEnum);
+		element->GetInputListOnVertices(refreeze,SmbRefreezeEnum);
 
 		// loop over all vertices
Index: /issm/trunk/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h
===================================================================
--- /issm/trunk/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 26743)
+++ /issm/trunk/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 26744)
@@ -13,4 +13,6 @@
 void SmbGradientsx(FemModel* femmodel);
 void SmbGradientsElax(FemModel* femmodel);
+void SmbautoregressionInitx(FemModel* femmodel);
+void Smbautoregressionx(FemModel* femmodel);
 void Delta18oParameterizationx(FemModel* femmodel);
 void MungsmtpParameterizationx(FemModel* femmodel);
@@ -28,10 +30,11 @@
 void       GembgridInitialize(IssmDouble** pdz, int* psize, IssmDouble zTop, IssmDouble dzTop, IssmDouble zMax, IssmDouble zY);
 IssmDouble Marbouty(IssmDouble T, IssmDouble d, IssmDouble dT);
+IssmDouble gardnerAlb(IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble dPHC, int m);
 void grainGrowth(IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, IssmDouble* T,IssmDouble* dz,IssmDouble* d, IssmDouble* W,IssmDouble smb_dt,int m,int aIdx, int sid);
-void albedo(IssmDouble** a,int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* T, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m, int sid);
-void shortwave(IssmDouble** pswf, int swIdx, int aIdx, IssmDouble dsw, IssmDouble as, IssmDouble* d, IssmDouble* dz, IssmDouble* re, IssmDouble dIce, int m, int sid);
-void thermo(IssmDouble* pEC, IssmDouble** T, IssmDouble* pulwrf, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlw, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT);
-void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble Ta, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid);
-void melt(IssmDouble* pM, IssmDouble* pMs, IssmDouble* pR, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble zY, IssmDouble dIce, int sid);
+void albedo(IssmDouble** a, IssmDouble** adiff, int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* T, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m, int sid);
+void shortwave(IssmDouble** pswf, int swIdx, int aIdx, IssmDouble dsw, IssmDouble dswdiff, IssmDouble as, IssmDouble asdiff, IssmDouble* d, IssmDouble* dz, IssmDouble* re, IssmDouble dIce, int m, int sid);
+void thermo(IssmDouble* pEC, IssmDouble** T, IssmDouble* pulwrf, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlw, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble eIdx, IssmDouble teValue, IssmDouble dulwrfValue, IssmDouble teThresh, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT, bool isdeltaLWup);
+void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, IssmDouble* pRa, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble Ta, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid);
+void melt(IssmDouble* pM, IssmDouble* pMs, IssmDouble* pR, IssmDouble* pF, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble Ra, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble zY, IssmDouble dIce, int sid);
 void densification(IssmDouble** pd,IssmDouble** pdz, IssmDouble* T, IssmDouble* re, int denIdx, int aIdx, int swIdx, IssmDouble adThresh, IssmDouble C, IssmDouble dt, IssmDouble Tmean, IssmDouble dIce, int m, int sid);
 void turbulentFlux(IssmDouble* pshf, IssmDouble* plhf, IssmDouble* pEC, IssmDouble Ta, IssmDouble Ts, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble ds, IssmDouble Ws, IssmDouble Vz, IssmDouble Tz, IssmDouble dIce, int sid);
Index: /issm/trunk/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp
===================================================================
--- /issm/trunk/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp	(revision 26743)
+++ /issm/trunk/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp	(revision 26744)
@@ -63,12 +63,24 @@
 	/*Retrieve all inputs we will be needing: */
 	DatasetInput* weights_input=topelement->GetDatasetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
-	Input* vx_input     =topelement->GetInput(VxEnum);                                 _assert_(vx_input);
-	Input* vxobs_input  =topelement->GetInput(InversionVxObsEnum);                     _assert_(vxobs_input);
-	Input* vy_input     = NULL;
-	Input* vyobs_input  = NULL;
-	if(numcomponents==2){
-		vy_input    =topelement->GetInput(VyEnum);              _assert_(vy_input);
-		vyobs_input =topelement->GetInput(InversionVyObsEnum);  _assert_(vyobs_input);
+   Input* vx_input     = NULL;
+   Input* vxobs_input  = topelement->GetInput(InversionVxObsEnum);   _assert_(vxobs_input);
+   Input* vy_input     = NULL;
+   Input* vyobs_input  = NULL;
+
+   /*Read SurfaceEnum from 2D models:SSA, L1L2, MLHO*/
+   if (domaintype == Domain2DhorizontalEnum) {
+      vx_input = topelement->GetInput(VxSurfaceEnum);             _assert_(vx_input);
+      if(numcomponents==2){
+         vy_input    =topelement->GetInput(VySurfaceEnum);        _assert_(vy_input);
+         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
+      }
 	}
+   else {
+      vx_input = topelement->GetInput(VxEnum);                    _assert_(vx_input);
+      if(numcomponents==2){
+         vy_input    =topelement->GetInput(VyEnum);               _assert_(vy_input);
+         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
+      }
+   }
 
 	/* Start  looping on the number of gaussian points: */
@@ -111,5 +123,5 @@
 
 	/*clean up and Return: */
-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
+	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
 	xDelete<IssmDouble>(xyz_list);
 	delete gauss;
Index: /issm/trunk/src/c/modules/modules.h
===================================================================
--- /issm/trunk/src/c/modules/modules.h	(revision 26743)
+++ /issm/trunk/src/c/modules/modules.h	(revision 26744)
@@ -72,4 +72,5 @@
 #include "./SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h"
 #include "./ModelProcessorx/ModelProcessorx.h"
+#include "./MmeToInputFromIdx/MmeToInputFromIdx.h"
 #include "./ParseToolkitsOptionsx/ParseToolkitsOptionsx.h"
 #include "./NodalValuex/NodalValuex.h"
@@ -90,4 +91,5 @@
 #include "./Scotchx/Scotchx.h"
 #include "./Shp2Kmlx/Shp2Kmlx.h"
+#include "./StochasticForcingx/StochasticForcingx.h"
 #include "./SurfaceMassBalancex/SurfaceMassBalancex.h"
 #include "./Solverx/Solverx.h"
@@ -102,4 +104,5 @@
 #include "./UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h"
 #include "./VertexCoordinatesx/VertexCoordinatesx.h"
+#include "./ElementCoordinatesx/ElementCoordinatesx.h"
 
 #ifdef _HAVE_OCEAN_
Index: /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalance.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 26743)
+++ /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 26744)
@@ -166,6 +166,6 @@
     smf=icefac*0.001;
   }
-  snwmf=0.95*snwmf;
-  smf=0.95*smf;
+  //snwmf=0.95*snwmf;
+  //smf=0.95*smf;
 
   /*****  compute PDD ablation and refreezing *****/
Index: /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 26743)
+++ /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 26744)
@@ -32,5 +32,5 @@
   IssmDouble Pmax = 0.6;
   IssmDouble inv_twelve=1./12.; 
-  
+
   sconv=(rho_water/rho_ice);		//rhow_rain/rhoi
 
@@ -91,5 +91,5 @@
 	 IssmDouble coeff5=3.8e-05;		// polynomial
 	 IssmDouble coeff6=6.0e-07;		// fit
-   
+
 	 if(tstar>=temp_rain)
 	  frac_solid = 0.0;
@@ -100,5 +100,5 @@
 					 +tstar*(coeff3+tstar*(coeff4+tstar*(coeff5+tstar*coeff6))));
 	 }
-	 
+
 	 snowfall=snowfall+precip_star*frac_solid*inv_twelve;
   } 
@@ -108,5 +108,5 @@
   if(snowfall<0.0) snowfall=0.0;   // correction of
   if(rainfall<0.0) rainfall=0.0;   // negative values
-   
+
   if(rainfall<=(Pmax*snowfall)){
 	  if((rainfall+beta1*pdd)<=(Pmax*snowfall)) {
@@ -126,5 +126,5 @@
 	  runoff     = smelt+rainfall-Pmax*snowfall;
   }
-   
+
   saccu = precip;	
 
Index: /issm/trunk/src/c/shared/Enum/Enum.vim
===================================================================
--- /issm/trunk/src/c/shared/Enum/Enum.vim	(revision 26743)
+++ /issm/trunk/src/c/shared/Enum/Enum.vim	(revision 26744)
@@ -63,4 +63,5 @@
 syn keyword cConstant AutodiffXpEnum
 syn keyword cConstant BalancethicknessStabilizationEnum
+syn keyword cConstant BarystaticContributionsEnum
 syn keyword cConstant BasalforcingsBottomplumedepthEnum
 syn keyword cConstant BasalforcingsCrustthicknessEnum
@@ -100,4 +101,5 @@
 syn keyword cConstant BasalforcingsUpperwaterMeltingRateEnum
 syn keyword cConstant CalvingCrevasseDepthEnum
+syn keyword cConstant CalvingCrevasseThresholdEnum
 syn keyword cConstant CalvingHeightAboveFloatationEnum
 syn keyword cConstant CalvingLawEnum
@@ -105,4 +107,5 @@
 syn keyword cConstant ConfigurationTypeEnum
 syn keyword cConstant ConstantsGEnum
+syn keyword cConstant ConstantsNewtonGravityEnum
 syn keyword cConstant ConstantsReferencetemperatureEnum
 syn keyword cConstant ConstantsYtsEnum
@@ -110,11 +113,13 @@
 syn keyword cConstant ControlInputSizeNEnum
 syn keyword cConstant ControlInputInterpolationEnum
-syn keyword cConstant CumBslrEnum
-syn keyword cConstant CumBslrIceEnum
-syn keyword cConstant CumBslrHydroEnum
-syn keyword cConstant CumBslrIcePartitionEnum
-syn keyword cConstant CumBslrHydroPartitionEnum
-syn keyword cConstant CumGmtslrEnum
-syn keyword cConstant CumGmslrEnum
+syn keyword cConstant CumBslcEnum
+syn keyword cConstant CumBslcIceEnum
+syn keyword cConstant CumBslcHydroEnum
+syn keyword cConstant CumBslcOceanEnum
+syn keyword cConstant CumBslcIcePartitionEnum
+syn keyword cConstant CumBslcHydroPartitionEnum
+syn keyword cConstant CumBslcOceanPartitionEnum
+syn keyword cConstant CumGmtslcEnum
+syn keyword cConstant CumGmslcEnum
 syn keyword cConstant DamageC1Enum
 syn keyword cConstant DamageC2Enum
@@ -138,6 +143,11 @@
 syn keyword cConstant DslModelidEnum
 syn keyword cConstant DslNummodelsEnum
-syn keyword cConstant DslComputeFingerprintsEnum
+syn keyword cConstant SolidearthIsExternalEnum
+syn keyword cConstant SolidearthExternalNatureEnum
+syn keyword cConstant SolidearthExternalModelidEnum
+syn keyword cConstant SolidearthExternalNummodelsEnum
+syn keyword cConstant SolidearthSettingsComputeBpGrdEnum
 syn keyword cConstant EarthIdEnum
+syn keyword cConstant ElasticEnum
 syn keyword cConstant EplZigZagCounterEnum
 syn keyword cConstant EsaHElasticEnum
@@ -167,10 +177,13 @@
 syn keyword cConstant FrictionVoidRatioEnum
 syn keyword cConstant FrontalForcingsBasinIcefrontAreaEnum
+syn keyword cConstant FrontalForcingsAutoregressionInitialTimeEnum
+syn keyword cConstant FrontalForcingsAutoregressionTimestepEnum
+syn keyword cConstant FrontalForcingsAutoregressiveOrderEnum
+syn keyword cConstant FrontalForcingsBeta0Enum
+syn keyword cConstant FrontalForcingsBeta1Enum
 syn keyword cConstant FrontalForcingsNumberofBasinsEnum
 syn keyword cConstant FrontalForcingsParamEnum
-syn keyword cConstant GiaModelEnum
-syn keyword cConstant GiaModelidEnum
-syn keyword cConstant GiaNummodelsEnum
-syn keyword cConstant GiaCrossSectionShapeEnum
+syn keyword cConstant FrontalForcingsPhiEnum
+syn keyword cConstant GrdModelEnum
 syn keyword cConstant GroundinglineFrictionInterpolationEnum
 syn keyword cConstant GroundinglineMeltInterpolationEnum
@@ -243,4 +256,6 @@
 syn keyword cConstant InversionStepThresholdEnum
 syn keyword cConstant InversionTypeEnum
+syn keyword cConstant IvinsEnum
+syn keyword cConstant IsSlcCouplingEnum
 syn keyword cConstant LevelsetKillIcebergsEnum
 syn keyword cConstant LevelsetReinitFrequencyEnum
@@ -248,13 +263,24 @@
 syn keyword cConstant LockFileNameEnum
 syn keyword cConstant LoveAllowLayerDeletionEnum
+syn keyword cConstant LoveCoreMantleBoundaryEnum
+syn keyword cConstant LoveEarthMassEnum
 syn keyword cConstant LoveForcingTypeEnum
 syn keyword cConstant LoveFrequenciesEnum
+syn keyword cConstant LoveIsTemporalEnum
 syn keyword cConstant LoveG0Enum
+syn keyword cConstant LoveGravitationalConstantEnum
+syn keyword cConstant LoveInnerCoreBoundaryEnum
+syn keyword cConstant LoveComplexComputationEnum
+syn keyword cConstant LoveIntStepsPerLayerEnum
 syn keyword cConstant LoveKernelsEnum
 syn keyword cConstant LoveMu0Enum
 syn keyword cConstant LoveNfreqEnum
+syn keyword cConstant LoveNTemporalIterationsEnum
+syn keyword cConstant LoveNYiEquationsEnum
 syn keyword cConstant LoveR0Enum
 syn keyword cConstant LoveShNmaxEnum
 syn keyword cConstant LoveShNminEnum
+syn keyword cConstant LoveStartingLayerEnum
+syn keyword cConstant LoveUnderflowTolEnum
 syn keyword cConstant MassFluxSegmentsEnum
 syn keyword cConstant MassFluxSegmentsPresentEnum
@@ -271,8 +297,4 @@
 syn keyword cConstant MaterialsHeatcapacityEnum
 syn keyword cConstant MaterialsLatentheatEnum
-syn keyword cConstant MaterialsLithosphereDensityEnum
-syn keyword cConstant MaterialsLithosphereShearModulusEnum
-syn keyword cConstant MaterialsMantleDensityEnum
-syn keyword cConstant MaterialsMantleShearModulusEnum
 syn keyword cConstant MaterialsMeltingpointEnum
 syn keyword cConstant MaterialsMixedLayerCapacityEnum
@@ -290,4 +312,5 @@
 syn keyword cConstant MeshNumberoflayersEnum
 syn keyword cConstant MeshNumberofverticesEnum
+syn keyword cConstant MeshNumberofelementsEnum
 syn keyword cConstant MigrationMaxEnum
 syn keyword cConstant ModelIdEnum
@@ -328,15 +351,29 @@
 syn keyword cConstant RootPathEnum
 syn keyword cConstant ModelnameEnum
+syn keyword cConstant SamplingAlphaEnum
+syn keyword cConstant SamplingPhiEnum
+syn keyword cConstant SamplingNumRequestedOutputsEnum
+syn keyword cConstant SamplingRequestedOutputsEnum
+syn keyword cConstant SamplingRobinEnum
+syn keyword cConstant SamplingSeedEnum
+syn keyword cConstant SamplingTauEnum
 syn keyword cConstant SaveResultsEnum
 syn keyword cConstant SolidearthPartitionIceEnum
 syn keyword cConstant SolidearthPartitionHydroEnum
+syn keyword cConstant SolidearthPartitionOceanEnum
 syn keyword cConstant SolidearthNpartIceEnum
+syn keyword cConstant SolidearthNpartOceanEnum
 syn keyword cConstant SolidearthNpartHydroEnum
 syn keyword cConstant SolidearthPlanetRadiusEnum
 syn keyword cConstant SolidearthPlanetAreaEnum
 syn keyword cConstant SolidearthSettingsAbstolEnum
+syn keyword cConstant SolidearthSettingsCrossSectionShapeEnum
 syn keyword cConstant RotationalAngularVelocityEnum
 syn keyword cConstant SolidearthSettingsElasticEnum
-syn keyword cConstant SealevelriseGeometryDoneEnum
+syn keyword cConstant SolidearthSettingsViscousEnum
+syn keyword cConstant SealevelchangeGeometryDoneEnum
+syn keyword cConstant SealevelchangeViscousNumStepsEnum
+syn keyword cConstant SealevelchangeViscousTimesEnum
+syn keyword cConstant SealevelchangeViscousIndexEnum
 syn keyword cConstant RotationalEquatorialMoiEnum
 syn keyword cConstant TidalLoveHEnum
@@ -347,22 +384,35 @@
 syn keyword cConstant LoadLoveKEnum
 syn keyword cConstant LoadLoveLEnum
-syn keyword cConstant SealevelriseGRigidEnum
-syn keyword cConstant SealevelriseGElasticEnum
-syn keyword cConstant SolidearthSettingsComputesealevelchangeEnum
+syn keyword cConstant LoveTimeFreqEnum
+syn keyword cConstant LoveIsTimeEnum
+syn keyword cConstant SealevelchangeGSelfAttractionEnum
+syn keyword cConstant SealevelchangeGViscoElasticEnum
+syn keyword cConstant SolidearthSettingsSealevelLoadingEnum
 syn keyword cConstant SolidearthSettingsGRDEnum
-syn keyword cConstant SolidearthSettingsGlfractionEnum
 syn keyword cConstant SolidearthSettingsRunFrequencyEnum
-syn keyword cConstant SealevelriseHElasticEnum
+syn keyword cConstant SolidearthSettingsTimeAccEnum
+syn keyword cConstant SealevelchangeHViscoElasticEnum
 syn keyword cConstant SolidearthSettingsHorizEnum
 syn keyword cConstant SolidearthSettingsMaxiterEnum
+syn keyword cConstant SolidearthSettingsGrdOceanEnum
 syn keyword cConstant SolidearthSettingsOceanAreaScalingEnum
+syn keyword cConstant StochasticForcingCovarianceEnum
+syn keyword cConstant StochasticForcingDefaultDimensionEnum
+syn keyword cConstant StochasticForcingDimensionsEnum
+syn keyword cConstant StochasticForcingFieldsEnum
+syn keyword cConstant StochasticForcingIsEffectivePressureEnum
+syn keyword cConstant StochasticForcingIsStochasticForcingEnum
+syn keyword cConstant StochasticForcingIsWaterPressureEnum
+syn keyword cConstant StochasticForcingNumFieldsEnum
+syn keyword cConstant StochasticForcingRandomflagEnum
 syn keyword cConstant RotationalPolarMoiEnum
 syn keyword cConstant SolidearthSettingsReltolEnum
-syn keyword cConstant SealevelriseRequestedOutputsEnum
-syn keyword cConstant SolidearthSettingsRigidEnum
+syn keyword cConstant SealevelchangeRequestedOutputsEnum
+syn keyword cConstant SolidearthSettingsSelfAttractionEnum
 syn keyword cConstant SolidearthSettingsRotationEnum
-syn keyword cConstant SealevelriseRunCountEnum
-syn keyword cConstant SealevelriseTransitionsEnum
-syn keyword cConstant SealevelriseUElasticEnum
+syn keyword cConstant SolidearthSettingsMaxSHCoeffEnum
+syn keyword cConstant SealevelchangeRunCountEnum
+syn keyword cConstant SealevelchangeTransitionsEnum
+syn keyword cConstant SealevelchangeUViscoElasticEnum
 syn keyword cConstant SettingsIoGatherEnum
 syn keyword cConstant SettingsNumResultsOnNodesEnum
@@ -380,5 +430,10 @@
 syn keyword cConstant SmbAccurefEnum
 syn keyword cConstant SmbAdThreshEnum
+syn keyword cConstant SmbAutoregressionInitialTimeEnum
+syn keyword cConstant SmbAutoregressionTimestepEnum
+syn keyword cConstant SmbAutoregressiveOrderEnum
 syn keyword cConstant SmbAveragingEnum
+syn keyword cConstant SmbBeta0Enum
+syn keyword cConstant SmbBeta1Enum
 syn keyword cConstant SmbDesfacEnum
 syn keyword cConstant SmbDpermilEnum
@@ -390,13 +445,14 @@
 syn keyword cConstant SmbDtEnum
 syn keyword cConstant SmbEnum
+syn keyword cConstant SmbEIdxEnum
 syn keyword cConstant SmbFEnum
 syn keyword cConstant SmbInitDensityScalingEnum
 syn keyword cConstant SmbIsaccumulationEnum
 syn keyword cConstant SmbIsalbedoEnum
-syn keyword cConstant SmbIsclimatologyEnum
 syn keyword cConstant SmbIsconstrainsurfaceTEnum
 syn keyword cConstant SmbIsd18opdEnum
 syn keyword cConstant SmbIsdelta18oEnum
 syn keyword cConstant SmbIsdensificationEnum
+syn keyword cConstant SmbIsdeltaLWupEnum
 syn keyword cConstant SmbIsfirnwarmingEnum
 syn keyword cConstant SmbIsgraingrowthEnum
@@ -410,6 +466,8 @@
 syn keyword cConstant SmbIsturbulentfluxEnum
 syn keyword cConstant SmbKEnum
+syn keyword cConstant SmbNumBasinsEnum
 syn keyword cConstant SmbNumRequestedOutputsEnum
 syn keyword cConstant SmbPfacEnum
+syn keyword cConstant SmbPhiEnum
 syn keyword cConstant SmbRdlEnum
 syn keyword cConstant SmbRequestedOutputsEnum
@@ -424,4 +482,5 @@
 syn keyword cConstant SmbT0dryEnum
 syn keyword cConstant SmbT0wetEnum
+syn keyword cConstant SmbTeThreshEnum
 syn keyword cConstant SmbTdiffEnum
 syn keyword cConstant SmbThermoDeltaTScalingEnum
@@ -463,5 +522,6 @@
 syn keyword cConstant TimesteppingCouplingTimeEnum
 syn keyword cConstant TimesteppingFinalTimeEnum
-syn keyword cConstant TimesteppingInterpForcingsEnum
+syn keyword cConstant TimesteppingInterpForcingEnum
+syn keyword cConstant TimesteppingCycleForcingEnum
 syn keyword cConstant TimesteppingStartTimeEnum
 syn keyword cConstant TimesteppingTimeStepEnum
@@ -475,5 +535,4 @@
 syn keyword cConstant ToolkitsTypesEnum
 syn keyword cConstant TransientAmrFrequencyEnum
-syn keyword cConstant TransientIscouplerEnum
 syn keyword cConstant TransientIsdamageevolutionEnum
 syn keyword cConstant TransientIsesaEnum
@@ -482,7 +541,9 @@
 syn keyword cConstant TransientIshydrologyEnum
 syn keyword cConstant TransientIsmasstransportEnum
+syn keyword cConstant TransientIsoceantransportEnum
 syn keyword cConstant TransientIsmovingfrontEnum
 syn keyword cConstant TransientIsoceancouplingEnum
-syn keyword cConstant TransientIsslrEnum
+syn keyword cConstant TransientIssamplingEnum
+syn keyword cConstant TransientIsslcEnum
 syn keyword cConstant TransientIssmbEnum
 syn keyword cConstant TransientIsstressbalanceEnum
@@ -491,11 +552,22 @@
 syn keyword cConstant TransientRequestedOutputsEnum
 syn keyword cConstant VelocityEnum
+syn keyword cConstant XxeEnum
+syn keyword cConstant YyeEnum
+syn keyword cConstant ZzeEnum
+syn keyword cConstant AreaeEnum
 syn keyword cConstant WorldCommEnum
 syn keyword cConstant ParametersENDEnum
 syn keyword cConstant InputsSTARTEnum
+syn keyword cConstant AccumulatedDeltaBottomPressureEnum
+syn keyword cConstant AccumulatedDeltaIceThicknessEnum
+syn keyword cConstant AccumulatedDeltaTwsEnum
 syn keyword cConstant AdjointEnum
 syn keyword cConstant AdjointpEnum
 syn keyword cConstant AdjointxEnum
+syn keyword cConstant AdjointxBaseEnum
+syn keyword cConstant AdjointxShearEnum
 syn keyword cConstant AdjointyEnum
+syn keyword cConstant AdjointyBaseEnum
+syn keyword cConstant AdjointyShearEnum
 syn keyword cConstant AdjointzEnum
 syn keyword cConstant AirEnum
@@ -531,7 +603,17 @@
 syn keyword cConstant BaseSlopeXEnum
 syn keyword cConstant BaseSlopeYEnum
+syn keyword cConstant BaselineBasalforcingsFloatingiceMeltingRateEnum
+syn keyword cConstant BaselineCalvingCalvingrateEnum
+syn keyword cConstant BaselineFrictionEffectivePressureEnum
 syn keyword cConstant BedEnum
+syn keyword cConstant BedGRDEnum
+syn keyword cConstant BedEastEnum
+syn keyword cConstant BedEastGRDEnum
+syn keyword cConstant BedNorthEnum
+syn keyword cConstant BedNorthGRDEnum
 syn keyword cConstant BedSlopeXEnum
 syn keyword cConstant BedSlopeYEnum
+syn keyword cConstant BottomPressureEnum
+syn keyword cConstant BottomPressureOldEnum
 syn keyword cConstant CalvingCalvingrateEnum
 syn keyword cConstant CalvingHabFractionEnum
@@ -555,4 +637,13 @@
 syn keyword cConstant DegreeOfChannelizationEnum
 syn keyword cConstant DepthBelowSurfaceEnum
+syn keyword cConstant DeltaIceThicknessEnum
+syn keyword cConstant DeltaTwsEnum
+syn keyword cConstant DeltaBottomPressureEnum
+syn keyword cConstant DeltaDslEnum
+syn keyword cConstant DslOldEnum
+syn keyword cConstant DslEnum
+syn keyword cConstant DeltaStrEnum
+syn keyword cConstant StrOldEnum
+syn keyword cConstant StrEnum
 syn keyword cConstant DeviatoricStresseffectiveEnum
 syn keyword cConstant DeviatoricStressxxEnum
@@ -572,11 +663,4 @@
 syn keyword cConstant DrivingStressXEnum
 syn keyword cConstant DrivingStressYEnum
-syn keyword cConstant DslGlobalAverageThermostericSeaLevelChangeEnum
-syn keyword cConstant DslSeaSurfaceHeightChangeAboveGeoidEnum
-syn keyword cConstant DslSeaWaterPressureChangeAtSeaFloorEnum
-syn keyword cConstant DslStericRateEnum
-syn keyword cConstant DslDynamicRateEnum
-syn keyword cConstant GiaMmeNgiaEnum
-syn keyword cConstant GiaMmeUgiaEnum
 syn keyword cConstant DummyEnum
 syn keyword cConstant EffectivePressureEnum
@@ -591,5 +675,4 @@
 syn keyword cConstant EplHeadSubstepEnum
 syn keyword cConstant EplHeadTransientEnum
-syn keyword cConstant EsaDeltathicknessEnum
 syn keyword cConstant EsaEmotionEnum
 syn keyword cConstant EsaNmotionEnum
@@ -621,6 +704,4 @@
 syn keyword cConstant FrontalForcingsThermalForcingEnum
 syn keyword cConstant GeometryHydrostaticRatioEnum
-syn keyword cConstant GiaLithosphereThicknessEnum
-syn keyword cConstant GiaMantleViscosityEnum
 syn keyword cConstant NGiaEnum
 syn keyword cConstant NGiaRateEnum
@@ -647,4 +728,8 @@
 syn keyword cConstant HydrologyEnglacialInputEnum
 syn keyword cConstant HydrologyGapHeightEnum
+syn keyword cConstant HydrologyGapHeightXEnum
+syn keyword cConstant HydrologyGapHeightXXEnum
+syn keyword cConstant HydrologyGapHeightYEnum
+syn keyword cConstant HydrologyGapHeightYYEnum
 syn keyword cConstant HydrologyHeadEnum
 syn keyword cConstant HydrologyHeadOldEnum
@@ -655,4 +740,7 @@
 syn keyword cConstant HydrologySheetThicknessEnum
 syn keyword cConstant HydrologySheetThicknessOldEnum
+syn keyword cConstant HydrologyTwsEnum
+syn keyword cConstant HydrologyTwsSpcEnum
+syn keyword cConstant HydrologyTwsAnalysisEnum
 syn keyword cConstant HydrologyWatercolumnMaxEnum
 syn keyword cConstant HydrologyWaterVxEnum
@@ -669,4 +757,5 @@
 syn keyword cConstant LevelsetfunctionSlopeXEnum
 syn keyword cConstant LevelsetfunctionSlopeYEnum
+syn keyword cConstant LevelsetObservationEnum
 syn keyword cConstant LoadingforceXEnum
 syn keyword cConstant LoadingforceYEnum
@@ -674,4 +763,5 @@
 syn keyword cConstant MaskOceanLevelsetEnum
 syn keyword cConstant MaskIceLevelsetEnum
+syn keyword cConstant MaskIceRefLevelsetEnum
 syn keyword cConstant MasstransportSpcthicknessEnum
 syn keyword cConstant MaterialsRheologyBEnum
@@ -689,8 +779,13 @@
 syn keyword cConstant MeshVertexonsurfaceEnum
 syn keyword cConstant MisfitEnum
+syn keyword cConstant MovingFrontalVxEnum
+syn keyword cConstant MovingFrontalVyEnum
 syn keyword cConstant NeumannfluxEnum
 syn keyword cConstant NewDamageEnum
 syn keyword cConstant NodeEnum
 syn keyword cConstant OmegaAbsGradientEnum
+syn keyword cConstant OceantransportSpcbottompressureEnum
+syn keyword cConstant OceantransportSpcstrEnum
+syn keyword cConstant OceantransportSpcdslEnum
 syn keyword cConstant P0Enum
 syn keyword cConstant P1Enum
@@ -707,32 +802,80 @@
 syn keyword cConstant RheologyBInitialguessMisfitEnum
 syn keyword cConstant RheologyBbarAbsGradientEnum
+syn keyword cConstant SampleEnum
+syn keyword cConstant SamplingBetaEnum
+syn keyword cConstant SamplingKappaEnum
 syn keyword cConstant SealevelEnum
-syn keyword cConstant SealevelEustaticMaskEnum
-syn keyword cConstant SealevelEustaticOceanMaskEnum
+syn keyword cConstant SealevelGRDEnum
+syn keyword cConstant SealevelBarystaticMaskEnum
+syn keyword cConstant SealevelBarystaticIceMaskEnum
+syn keyword cConstant SealevelBarystaticIceWeightsEnum
+syn keyword cConstant SealevelBarystaticIceAreaEnum
+syn keyword cConstant SealevelBarystaticIceLatbarEnum
+syn keyword cConstant SealevelBarystaticIceLongbarEnum
+syn keyword cConstant SealevelBarystaticIceLoadEnum
+syn keyword cConstant SealevelBarystaticHydroMaskEnum
+syn keyword cConstant SealevelBarystaticHydroWeightsEnum
+syn keyword cConstant SealevelBarystaticHydroAreaEnum
+syn keyword cConstant SealevelBarystaticHydroLatbarEnum
+syn keyword cConstant SealevelBarystaticHydroLongbarEnum
+syn keyword cConstant SealevelBarystaticHydroLoadEnum
+syn keyword cConstant SealevelBarystaticBpMaskEnum
+syn keyword cConstant SealevelBarystaticBpWeightsEnum
+syn keyword cConstant SealevelBarystaticBpAreaEnum
+syn keyword cConstant SealevelBarystaticBpLoadEnum
+syn keyword cConstant SealevelBarystaticOceanMaskEnum
+syn keyword cConstant SealevelBarystaticOceanWeightsEnum
+syn keyword cConstant SealevelBarystaticOceanAreaEnum
+syn keyword cConstant SealevelBarystaticOceanLatbarEnum
+syn keyword cConstant SealevelBarystaticOceanLongbarEnum
+syn keyword cConstant SealevelBarystaticOceanLoadEnum
 syn keyword cConstant SealevelNEsaEnum
 syn keyword cConstant SealevelNEsaRateEnum
 syn keyword cConstant SealevelRSLEnum
-syn keyword cConstant BslrEnum
-syn keyword cConstant BslrIceEnum
-syn keyword cConstant BslrHydroEnum
-syn keyword cConstant BslrRateEnum
-syn keyword cConstant GmtslrEnum
-syn keyword cConstant SealevelRSLEustaticEnum
-syn keyword cConstant SealevelRSLEustaticRateEnum
+syn keyword cConstant BslcEnum
+syn keyword cConstant BslcIceEnum
+syn keyword cConstant BslcHydroEnum
+syn keyword cConstant BslcOceanEnum
+syn keyword cConstant BslcRateEnum
+syn keyword cConstant GmtslcEnum
+syn keyword cConstant SealevelGrotm1Enum
+syn keyword cConstant SealevelGrotm2Enum
+syn keyword cConstant SealevelGrotm3Enum
+syn keyword cConstant SealevelGUrotm1Enum
+syn keyword cConstant SealevelGUrotm2Enum
+syn keyword cConstant SealevelGUrotm3Enum
+syn keyword cConstant SealevelGNrotm1Enum
+syn keyword cConstant SealevelGNrotm2Enum
+syn keyword cConstant SealevelGNrotm3Enum
+syn keyword cConstant SealevelGErotm1Enum
+syn keyword cConstant SealevelGErotm2Enum
+syn keyword cConstant SealevelGErotm3Enum
+syn keyword cConstant SealevelRSLBarystaticEnum
 syn keyword cConstant SealevelRSLRateEnum
+syn keyword cConstant SealevelUGrdEnum
+syn keyword cConstant SealevelNGrdEnum
 syn keyword cConstant SealevelUEastEsaEnum
-syn keyword cConstant SealevelUEsaEnum
-syn keyword cConstant SealevelUEsaRateEnum
 syn keyword cConstant SealevelUNorthEsaEnum
-syn keyword cConstant SealevelriseCumDeltathicknessEnum
-syn keyword cConstant SealevelriseCumDeltathicknessOldEnum
-syn keyword cConstant SurfaceloadOtherEnum
-syn keyword cConstant SurfaceloadIceThicknessChangeEnum
-syn keyword cConstant SurfaceloadWaterHeightChangeEnum
-syn keyword cConstant SealevelriseIndicesEnum
-syn keyword cConstant SealevelriseGEnum
-syn keyword cConstant SealevelriseGUEnum
-syn keyword cConstant SealevelriseGEEnum
-syn keyword cConstant SealevelriseGNEnum
+syn keyword cConstant SealevelchangeIndicesEnum
+syn keyword cConstant SealevelchangeGEnum
+syn keyword cConstant SealevelchangeGUEnum
+syn keyword cConstant SealevelchangeGEEnum
+syn keyword cConstant SealevelchangeGNEnum
+syn keyword cConstant SealevelchangeGsubelOceanEnum
+syn keyword cConstant SealevelchangeGUsubelOceanEnum
+syn keyword cConstant SealevelchangeGEsubelOceanEnum
+syn keyword cConstant SealevelchangeGNsubelOceanEnum
+syn keyword cConstant SealevelchangeGsubelIceEnum
+syn keyword cConstant SealevelchangeGUsubelIceEnum
+syn keyword cConstant SealevelchangeGEsubelIceEnum
+syn keyword cConstant SealevelchangeGNsubelIceEnum
+syn keyword cConstant SealevelchangeGsubelHydroEnum
+syn keyword cConstant SealevelchangeGUsubelHydroEnum
+syn keyword cConstant SealevelchangeGEsubelHydroEnum
+syn keyword cConstant SealevelchangeGNsubelHydroEnum
+syn keyword cConstant SealevelchangeViscousRSLEnum
+syn keyword cConstant SealevelchangeViscousUEnum
+syn keyword cConstant SealevelchangeViscousNEnum
+syn keyword cConstant SealevelchangeViscousEEnum
 syn keyword cConstant SedimentHeadEnum
 syn keyword cConstant SedimentHeadOldEnum
@@ -747,9 +890,15 @@
 syn keyword cConstant SmbAccumulatedMeltEnum
 syn keyword cConstant SmbAccumulatedPrecipitationEnum
+syn keyword cConstant SmbAccumulatedRainEnum
+syn keyword cConstant SmbAccumulatedRefreezeEnum
 syn keyword cConstant SmbAccumulatedRunoffEnum
 syn keyword cConstant SmbAEnum
+syn keyword cConstant SmbAdiffEnum
 syn keyword cConstant SmbAValueEnum
 syn keyword cConstant SmbAccumulationEnum
+syn keyword cConstant SmbAdiffiniEnum
 syn keyword cConstant SmbAiniEnum
+syn keyword cConstant SmbAutoregressionNoiseEnum
+syn keyword cConstant SmbBasinsIdEnum
 syn keyword cConstant SmbBMaxEnum
 syn keyword cConstant SmbBMinEnum
@@ -757,4 +906,7 @@
 syn keyword cConstant SmbBPosEnum
 syn keyword cConstant SmbCEnum
+syn keyword cConstant SmbCcsnowValueEnum
+syn keyword cConstant SmbCciceValueEnum
+syn keyword cConstant SmbCotValueEnum
 syn keyword cConstant SmbDEnum
 syn keyword cConstant SmbDailyairdensityEnum
@@ -769,5 +921,7 @@
 syn keyword cConstant SmbDiniEnum
 syn keyword cConstant SmbDlwrfEnum
+syn keyword cConstant SmbDulwrfValueEnum
 syn keyword cConstant SmbDswrfEnum
+syn keyword cConstant SmbDswdiffrfEnum
 syn keyword cConstant SmbDzAddEnum
 syn keyword cConstant SmbDzEnum
@@ -789,5 +943,4 @@
 syn keyword cConstant SmbIsInitializedEnum
 syn keyword cConstant SmbMAddEnum
-syn keyword cConstant SmbMassBalanceClimateEnum
 syn keyword cConstant SmbMassBalanceEnum
 syn keyword cConstant SmbMassBalanceSubstepEnum
@@ -810,4 +963,5 @@
 syn keyword cConstant SmbPrecipitationsPresentdayEnum
 syn keyword cConstant SmbPrecipitationsReconstructedEnum
+syn keyword cConstant SmbRainEnum
 syn keyword cConstant SmbReEnum
 syn keyword cConstant SmbRefreezeEnum
@@ -822,4 +976,5 @@
 syn keyword cConstant SmbSmbCorrEnum
 syn keyword cConstant SmbSmbrefEnum
+syn keyword cConstant SmbSzaValueEnum
 syn keyword cConstant SmbTEnum
 syn keyword cConstant SmbTaEnum
@@ -832,4 +987,5 @@
 syn keyword cConstant SmbTmeanEnum
 syn keyword cConstant SmbTzEnum
+syn keyword cConstant SmbValuesAutoregressionEnum
 syn keyword cConstant SmbVEnum
 syn keyword cConstant SmbVmeanEnum
@@ -842,4 +998,9 @@
 syn keyword cConstant SmbZTopEnum
 syn keyword cConstant SmbZYEnum
+syn keyword cConstant SolidearthExternalDisplacementEastRateEnum
+syn keyword cConstant SolidearthExternalDisplacementNorthRateEnum
+syn keyword cConstant SolidearthExternalDisplacementUpRateEnum
+syn keyword cConstant SolidearthExternalGeoidRateEnum
+syn keyword cConstant StochasticForcingDefaultIdEnum
 syn keyword cConstant StrainRateeffectiveEnum
 syn keyword cConstant StrainRateparallelEnum
@@ -877,4 +1038,6 @@
 syn keyword cConstant TemperaturePicardEnum
 syn keyword cConstant TemperatureSEMICEnum
+syn keyword cConstant ThermalforcingAutoregressionNoiseEnum
+syn keyword cConstant ThermalforcingValuesAutoregressionEnum
 syn keyword cConstant ThermalSpctemperatureEnum
 syn keyword cConstant ThicknessAbsGradientEnum
@@ -886,13 +1049,20 @@
 syn keyword cConstant ThicknessPositiveEnum
 syn keyword cConstant ThicknessResidualEnum
+syn keyword cConstant TransientAccumulatedDeltaIceThicknessEnum
 syn keyword cConstant VelEnum
 syn keyword cConstant VxAverageEnum
+syn keyword cConstant VxBaseEnum
 syn keyword cConstant VxEnum
 syn keyword cConstant VxMeshEnum
 syn keyword cConstant VxObsEnum
+syn keyword cConstant VxShearEnum
+syn keyword cConstant VxSurfaceEnum
 syn keyword cConstant VyAverageEnum
+syn keyword cConstant VyBaseEnum
 syn keyword cConstant VyEnum
 syn keyword cConstant VyMeshEnum
 syn keyword cConstant VyObsEnum
+syn keyword cConstant VyShearEnum
+syn keyword cConstant VySurfaceEnum
 syn keyword cConstant VzEnum
 syn keyword cConstant VzFSEnum
@@ -906,5 +1076,11 @@
 syn keyword cConstant WaterfractionEnum
 syn keyword cConstant WaterheightEnum
+syn keyword cConstant FrictionWaterPressureEnum
+syn keyword cConstant FrictionWaterPressureNoiseEnum
+syn keyword cConstant WeightsLevelsetObservationEnum
 syn keyword cConstant WeightsSurfaceObservationEnum
+syn keyword cConstant OldAccumulatedDeltaBottomPressureEnum
+syn keyword cConstant OldAccumulatedDeltaIceThicknessEnum
+syn keyword cConstant OldAccumulatedDeltaTwsEnum
 syn keyword cConstant Outputdefinition1Enum
 syn keyword cConstant Outputdefinition10Enum
@@ -1046,4 +1222,5 @@
 syn keyword cConstant CfsurfacelogvelEnum
 syn keyword cConstant CfsurfacesquareEnum
+syn keyword cConstant CflevelsetmisfitEnum
 syn keyword cConstant ChannelEnum
 syn keyword cConstant ChannelAreaEnum
@@ -1111,4 +1288,5 @@
 syn keyword cConstant FrontalForcingsDefaultEnum
 syn keyword cConstant FrontalForcingsRignotEnum
+syn keyword cConstant FrontalForcingsRignotAutoregressionEnum
 syn keyword cConstant FsetEnum
 syn keyword cConstant FullMeltOnPartiallyFloatingEnum
@@ -1121,6 +1299,4 @@
 syn keyword cConstant GenericParamEnum
 syn keyword cConstant GenericExternalResultEnum
-syn keyword cConstant GiaAnalysisEnum
-syn keyword cConstant GiaSolutionEnum
 syn keyword cConstant Gradient1Enum
 syn keyword cConstant Gradient2Enum
@@ -1242,4 +1418,6 @@
 syn keyword cConstant NyeH2OEnum
 syn keyword cConstant NumericalfluxEnum
+syn keyword cConstant OceantransportAnalysisEnum
+syn keyword cConstant OceantransportSolutionEnum
 syn keyword cConstant OldGradientEnum
 syn keyword cConstant OneLayerP4zEnum
@@ -1276,5 +1454,8 @@
 syn keyword cConstant RecoveryAnalysisEnum
 syn keyword cConstant RiftfrontEnum
+syn keyword cConstant SamplingAnalysisEnum
+syn keyword cConstant SamplingSolutionEnum
 syn keyword cConstant SIAApproximationEnum
+syn keyword cConstant SMBautoregressionEnum
 syn keyword cConstant SMBcomponentsEnum
 syn keyword cConstant SMBd18opddEnum
@@ -1299,8 +1480,8 @@
 syn keyword cConstant SealevelInertiaTensorYZEnum
 syn keyword cConstant SealevelInertiaTensorZZEnum
+syn keyword cConstant SealevelchangePolarMotionEnum
 syn keyword cConstant SealevelNmotionEnum
 syn keyword cConstant SealevelUmotionEnum
-syn keyword cConstant SealevelriseAnalysisEnum
-syn keyword cConstant SealevelriseSolutionEnum
+syn keyword cConstant SealevelchangeAnalysisEnum
 syn keyword cConstant SegEnum
 syn keyword cConstant SegInputEnum
@@ -1391,10 +1572,13 @@
 syn keyword cType AmrNeopz
 syn keyword cType ArrayInput
+syn keyword cType BarystaticContributions
 syn keyword cType BoolInput
 syn keyword cType BoolParam
 syn keyword cType Cfdragcoeffabsgrad
+syn keyword cType Cflevelsetmisfit
 syn keyword cType Cfsurfacelogvel
 syn keyword cType Cfsurfacesquare
 syn keyword cType Channel
+syn keyword cType classes
 syn keyword cType Constraint
 syn keyword cType Constraints
@@ -1403,6 +1587,6 @@
 syn keyword cType ControlInput
 syn keyword cType Covertree
+syn keyword cType DatasetInput
 syn keyword cType DataSetParam
-syn keyword cType DatasetInput
 syn keyword cType Definition
 syn keyword cType DependentObject
@@ -1417,6 +1601,6 @@
 syn keyword cType ElementInput
 syn keyword cType ElementMatrix
+syn keyword cType Elements
 syn keyword cType ElementVector
-syn keyword cType Elements
 syn keyword cType ExponentialVariogram
 syn keyword cType ExternalResult
@@ -1425,13 +1609,15 @@
 syn keyword cType Friction
 syn keyword cType Gauss
+syn keyword cType GaussianVariogram
+syn keyword cType gaussobjects
 syn keyword cType GaussPenta
 syn keyword cType GaussSeg
 syn keyword cType GaussTetra
 syn keyword cType GaussTria
-syn keyword cType GaussianVariogram
 syn keyword cType GenericExternalResult
 syn keyword cType GenericOption
 syn keyword cType GenericParam
 syn keyword cType GiaDeflectionCoreArgs
+syn keyword cType GrdLoads
 syn keyword cType Hook
 syn keyword cType Input
@@ -1444,4 +1630,5 @@
 syn keyword cType IssmDirectApplicInterface
 syn keyword cType IssmParallelDirectApplicInterface
+syn keyword cType krigingobjects
 syn keyword cType Load
 syn keyword cType Loads
@@ -1454,4 +1641,5 @@
 syn keyword cType Matice
 syn keyword cType Matlitho
+syn keyword cType matrixobjects
 syn keyword cType MatrixParam
 syn keyword cType Misfit
@@ -1466,6 +1654,6 @@
 syn keyword cType Observations
 syn keyword cType Option
+syn keyword cType Options
 syn keyword cType OptionUtilities
-syn keyword cType Options
 syn keyword cType Param
 syn keyword cType Parameters
@@ -1481,11 +1669,11 @@
 syn keyword cType Regionaloutput
 syn keyword cType Results
+syn keyword cType Riftfront
 syn keyword cType RiftStruct
-syn keyword cType Riftfront
-syn keyword cType SealevelMasks
+syn keyword cType SealevelGeometry
 syn keyword cType Seg
 syn keyword cType SegInput
+syn keyword cType Segment
 syn keyword cType SegRef
-syn keyword cType Segment
 syn keyword cType SpcDynamic
 syn keyword cType SpcStatic
@@ -1506,8 +1694,4 @@
 syn keyword cType Vertex
 syn keyword cType Vertices
-syn keyword cType classes
-syn keyword cType gaussobjects
-syn keyword cType krigingobjects
-syn keyword cType matrixobjects
 syn keyword cType AdjointBalancethickness2Analysis
 syn keyword cType AdjointBalancethicknessAnalysis
@@ -1529,5 +1713,4 @@
 syn keyword cType FreeSurfaceTopAnalysis
 syn keyword cType GLheightadvectionAnalysis
-syn keyword cType GiaAnalysis
 syn keyword cType HydrologyDCEfficientAnalysis
 syn keyword cType HydrologyDCInefficientAnalysis
@@ -1536,4 +1719,5 @@
 syn keyword cType HydrologyShaktiAnalysis
 syn keyword cType HydrologyShreveAnalysis
+syn keyword cType HydrologyTwsAnalysis
 syn keyword cType L2ProjectionBaseAnalysis
 syn keyword cType L2ProjectionEPLAnalysis
@@ -1542,5 +1726,7 @@
 syn keyword cType MasstransportAnalysis
 syn keyword cType MeltingAnalysis
-syn keyword cType SealevelriseAnalysis
+syn keyword cType OceantransportAnalysis
+syn keyword cType SamplingAnalysis
+syn keyword cType SealevelchangeAnalysis
 syn keyword cType SmbAnalysis
 syn keyword cType SmoothAnalysis
Index: /issm/trunk/src/c/shared/Enum/EnumDefinitions.h
===================================================================
--- /issm/trunk/src/c/shared/Enum/EnumDefinitions.h	(revision 26743)
+++ /issm/trunk/src/c/shared/Enum/EnumDefinitions.h	(revision 26744)
@@ -57,4 +57,5 @@
 	AutodiffXpEnum,
 	BalancethicknessStabilizationEnum,
+	BarystaticContributionsEnum,
 	BasalforcingsBottomplumedepthEnum,
 	BasalforcingsCrustthicknessEnum,
@@ -94,4 +95,5 @@
 	BasalforcingsUpperwaterMeltingRateEnum,
 	CalvingCrevasseDepthEnum,
+	CalvingCrevasseThresholdEnum,
 	CalvingHeightAboveFloatationEnum,
 	CalvingLawEnum,
@@ -99,4 +101,5 @@
 	ConfigurationTypeEnum,
 	ConstantsGEnum,
+	ConstantsNewtonGravityEnum,
 	ConstantsReferencetemperatureEnum,
 	ConstantsYtsEnum,
@@ -104,11 +107,13 @@
 	ControlInputSizeNEnum,
 	ControlInputInterpolationEnum,
-	CumBslrEnum,
-	CumBslrIceEnum,
-	CumBslrHydroEnum,
-	CumBslrIcePartitionEnum,
-	CumBslrHydroPartitionEnum,
-	CumGmtslrEnum,
-	CumGmslrEnum,
+	CumBslcEnum,
+	CumBslcIceEnum,
+	CumBslcHydroEnum,
+	CumBslcOceanEnum,
+	CumBslcIcePartitionEnum,
+	CumBslcHydroPartitionEnum,
+	CumBslcOceanPartitionEnum,
+	CumGmtslcEnum,
+	CumGmslcEnum,
 	DamageC1Enum,
 	DamageC2Enum,
@@ -132,6 +137,11 @@
 	DslModelidEnum,
 	DslNummodelsEnum,
-	DslComputeFingerprintsEnum,
+	SolidearthIsExternalEnum,
+	SolidearthExternalNatureEnum,
+	SolidearthExternalModelidEnum,
+	SolidearthExternalNummodelsEnum,
+	SolidearthSettingsComputeBpGrdEnum,
 	EarthIdEnum,
+	ElasticEnum,
 	EplZigZagCounterEnum,
 	EsaHElasticEnum,
@@ -161,10 +171,13 @@
 	FrictionVoidRatioEnum,
 	FrontalForcingsBasinIcefrontAreaEnum,
+	FrontalForcingsAutoregressionInitialTimeEnum,
+   FrontalForcingsAutoregressionTimestepEnum,
+   FrontalForcingsAutoregressiveOrderEnum,
+	FrontalForcingsBeta0Enum,
+   FrontalForcingsBeta1Enum,
 	FrontalForcingsNumberofBasinsEnum,
 	FrontalForcingsParamEnum,
-	GiaModelEnum,
-	GiaModelidEnum,
-	GiaNummodelsEnum,
-	GiaCrossSectionShapeEnum,
+   FrontalForcingsPhiEnum,
+	GrdModelEnum,
 	GroundinglineFrictionInterpolationEnum,
 	GroundinglineMeltInterpolationEnum,
@@ -237,4 +250,6 @@
 	InversionStepThresholdEnum,
 	InversionTypeEnum,
+	IvinsEnum,
+	IsSlcCouplingEnum,
 	LevelsetKillIcebergsEnum,
 	LevelsetReinitFrequencyEnum,
@@ -242,13 +257,24 @@
 	LockFileNameEnum,
 	LoveAllowLayerDeletionEnum,
+	LoveCoreMantleBoundaryEnum,
+	LoveEarthMassEnum,
 	LoveForcingTypeEnum,
 	LoveFrequenciesEnum,
+	LoveIsTemporalEnum,
 	LoveG0Enum,
+	LoveGravitationalConstantEnum,
+	LoveInnerCoreBoundaryEnum,
+	LoveComplexComputationEnum,
+	LoveIntStepsPerLayerEnum,
 	LoveKernelsEnum,
 	LoveMu0Enum,
 	LoveNfreqEnum,
+	LoveNTemporalIterationsEnum,
+	LoveNYiEquationsEnum,
 	LoveR0Enum,
 	LoveShNmaxEnum,
 	LoveShNminEnum,
+	LoveStartingLayerEnum,
+	LoveUnderflowTolEnum,
 	MassFluxSegmentsEnum,
 	MassFluxSegmentsPresentEnum,
@@ -265,8 +291,4 @@
 	MaterialsHeatcapacityEnum,
 	MaterialsLatentheatEnum,
-	MaterialsLithosphereDensityEnum,
-	MaterialsLithosphereShearModulusEnum,
-	MaterialsMantleDensityEnum,
-	MaterialsMantleShearModulusEnum,
 	MaterialsMeltingpointEnum,
 	MaterialsMixedLayerCapacityEnum,
@@ -284,4 +306,5 @@
 	MeshNumberoflayersEnum,
 	MeshNumberofverticesEnum,
+	MeshNumberofelementsEnum,
 	MigrationMaxEnum,
 	ModelIdEnum,
@@ -322,15 +345,29 @@
 	RootPathEnum,
 	ModelnameEnum,
+	SamplingAlphaEnum,
+	SamplingPhiEnum,
+	SamplingNumRequestedOutputsEnum,
+	SamplingRequestedOutputsEnum,
+	SamplingRobinEnum,
+	SamplingSeedEnum,
+	SamplingTauEnum,
 	SaveResultsEnum,
 	SolidearthPartitionIceEnum,
 	SolidearthPartitionHydroEnum,
+	SolidearthPartitionOceanEnum,
 	SolidearthNpartIceEnum,
+	SolidearthNpartOceanEnum,
 	SolidearthNpartHydroEnum,
 	SolidearthPlanetRadiusEnum,
 	SolidearthPlanetAreaEnum,
 	SolidearthSettingsAbstolEnum,
+	SolidearthSettingsCrossSectionShapeEnum,
 	RotationalAngularVelocityEnum,
 	SolidearthSettingsElasticEnum,
-	SealevelriseGeometryDoneEnum,
+	SolidearthSettingsViscousEnum,
+	SealevelchangeGeometryDoneEnum,
+	SealevelchangeViscousNumStepsEnum,
+	SealevelchangeViscousTimesEnum,
+	SealevelchangeViscousIndexEnum,
 	RotationalEquatorialMoiEnum,
 	TidalLoveHEnum,
@@ -341,22 +378,35 @@
 	LoadLoveKEnum,
 	LoadLoveLEnum,
-	SealevelriseGRigidEnum,
-	SealevelriseGElasticEnum,
-	SolidearthSettingsComputesealevelchangeEnum,
+	LoveTimeFreqEnum,
+	LoveIsTimeEnum,
+	SealevelchangeGSelfAttractionEnum,
+	SealevelchangeGViscoElasticEnum,
+	SolidearthSettingsSealevelLoadingEnum,
 	SolidearthSettingsGRDEnum,
-	SolidearthSettingsGlfractionEnum,
 	SolidearthSettingsRunFrequencyEnum,
-	SealevelriseHElasticEnum,
+	SolidearthSettingsTimeAccEnum,
+	SealevelchangeHViscoElasticEnum,
 	SolidearthSettingsHorizEnum,
 	SolidearthSettingsMaxiterEnum,
+	SolidearthSettingsGrdOceanEnum,
 	SolidearthSettingsOceanAreaScalingEnum,
+	StochasticForcingCovarianceEnum,
+	StochasticForcingDefaultDimensionEnum,
+	StochasticForcingDimensionsEnum,
+	StochasticForcingFieldsEnum,
+	StochasticForcingIsEffectivePressureEnum,
+	StochasticForcingIsStochasticForcingEnum,
+	StochasticForcingIsWaterPressureEnum,
+	StochasticForcingNumFieldsEnum,
+	StochasticForcingRandomflagEnum,
 	RotationalPolarMoiEnum,
 	SolidearthSettingsReltolEnum,
-	SealevelriseRequestedOutputsEnum,
-	SolidearthSettingsRigidEnum,
+	SealevelchangeRequestedOutputsEnum,
+	SolidearthSettingsSelfAttractionEnum,
 	SolidearthSettingsRotationEnum,
-	SealevelriseRunCountEnum,
-	SealevelriseTransitionsEnum,
-	SealevelriseUElasticEnum,
+	SolidearthSettingsMaxSHCoeffEnum,
+	SealevelchangeRunCountEnum,
+	SealevelchangeTransitionsEnum,
+	SealevelchangeUViscoElasticEnum,
 	SettingsIoGatherEnum,
 	SettingsNumResultsOnNodesEnum,
@@ -374,5 +424,10 @@
 	SmbAccurefEnum,
 	SmbAdThreshEnum,
+	SmbAutoregressionInitialTimeEnum,
+	SmbAutoregressionTimestepEnum,
+   SmbAutoregressiveOrderEnum,
 	SmbAveragingEnum,
+	SmbBeta0Enum,
+   SmbBeta1Enum,
 	SmbDesfacEnum,
 	SmbDpermilEnum,
@@ -384,13 +439,14 @@
 	SmbDtEnum,
 	SmbEnum,
+	SmbEIdxEnum,
 	SmbFEnum,
 	SmbInitDensityScalingEnum,
 	SmbIsaccumulationEnum,
 	SmbIsalbedoEnum,
-	SmbIsclimatologyEnum,
 	SmbIsconstrainsurfaceTEnum,
 	SmbIsd18opdEnum,
 	SmbIsdelta18oEnum,
 	SmbIsdensificationEnum,
+	SmbIsdeltaLWupEnum,
 	SmbIsfirnwarmingEnum,
 	SmbIsgraingrowthEnum,
@@ -404,6 +460,8 @@
 	SmbIsturbulentfluxEnum,
 	SmbKEnum,
+	SmbNumBasinsEnum,
 	SmbNumRequestedOutputsEnum,
 	SmbPfacEnum,
+	SmbPhiEnum,
 	SmbRdlEnum,
 	SmbRequestedOutputsEnum,
@@ -418,4 +476,5 @@
 	SmbT0dryEnum,
 	SmbT0wetEnum,
+	SmbTeThreshEnum,
 	SmbTdiffEnum,
 	SmbThermoDeltaTScalingEnum,
@@ -457,5 +516,6 @@
 	TimesteppingCouplingTimeEnum,
 	TimesteppingFinalTimeEnum,
-	TimesteppingInterpForcingsEnum,
+	TimesteppingInterpForcingEnum,
+	TimesteppingCycleForcingEnum,
 	TimesteppingStartTimeEnum,
 	TimesteppingTimeStepEnum,
@@ -469,5 +529,4 @@
 	ToolkitsTypesEnum,
 	TransientAmrFrequencyEnum,
-	TransientIscouplerEnum,
 	TransientIsdamageevolutionEnum,
 	TransientIsesaEnum,
@@ -475,8 +534,10 @@
 	TransientIsgroundinglineEnum,
 	TransientIshydrologyEnum,
-	TransientIsmasstransportEnum,
+	TransientIsmasstransportEnum, 
+	TransientIsoceantransportEnum,
 	TransientIsmovingfrontEnum,
 	TransientIsoceancouplingEnum,
-	TransientIsslrEnum,
+	TransientIssamplingEnum,
+	TransientIsslcEnum,
 	TransientIssmbEnum,
 	TransientIsstressbalanceEnum,
@@ -485,4 +546,8 @@
 	TransientRequestedOutputsEnum,
 	VelocityEnum,
+	XxeEnum,
+	YyeEnum,
+	ZzeEnum,
+	AreaeEnum,
 	WorldCommEnum,
 	/*}}}*/
@@ -490,8 +555,15 @@
 	InputsSTARTEnum,
 	/*Inputs{{{*/
+	AccumulatedDeltaBottomPressureEnum,
+	AccumulatedDeltaIceThicknessEnum,
+	AccumulatedDeltaTwsEnum,
 	AdjointEnum,
 	AdjointpEnum,
 	AdjointxEnum,
+	AdjointxBaseEnum,
+	AdjointxShearEnum,
 	AdjointyEnum,
+	AdjointyBaseEnum,
+	AdjointyShearEnum,
 	AdjointzEnum,
 	AirEnum,
@@ -527,7 +599,17 @@
 	BaseSlopeXEnum,
 	BaseSlopeYEnum,
+	BaselineBasalforcingsFloatingiceMeltingRateEnum,
+	BaselineCalvingCalvingrateEnum,
+	BaselineFrictionEffectivePressureEnum,
 	BedEnum,
+	BedGRDEnum,
+	BedEastEnum,
+	BedEastGRDEnum,
+	BedNorthEnum,
+	BedNorthGRDEnum,
 	BedSlopeXEnum,
 	BedSlopeYEnum,
+	BottomPressureEnum,
+	BottomPressureOldEnum,
 	CalvingCalvingrateEnum,
 	CalvingHabFractionEnum,
@@ -551,4 +633,13 @@
 	DegreeOfChannelizationEnum,
 	DepthBelowSurfaceEnum,
+	DeltaIceThicknessEnum,
+	DeltaTwsEnum,
+	DeltaBottomPressureEnum,
+	DeltaDslEnum,
+	DslOldEnum,
+	DslEnum,
+	DeltaStrEnum,
+	StrOldEnum,
+	StrEnum,
 	DeviatoricStresseffectiveEnum,
 	DeviatoricStressxxEnum,
@@ -568,11 +659,4 @@
 	DrivingStressXEnum,
 	DrivingStressYEnum,
-	DslGlobalAverageThermostericSeaLevelChangeEnum,
-	DslSeaSurfaceHeightChangeAboveGeoidEnum,
-	DslSeaWaterPressureChangeAtSeaFloorEnum,
-	DslStericRateEnum,
-	DslDynamicRateEnum,
-	GiaMmeNgiaEnum,
-	GiaMmeUgiaEnum,
 	DummyEnum,
    EffectivePressureEnum,
@@ -587,5 +671,4 @@
 	EplHeadSubstepEnum,
    EplHeadTransientEnum,
-	EsaDeltathicknessEnum,
 	EsaEmotionEnum,
 	EsaNmotionEnum,
@@ -617,6 +700,4 @@
 	FrontalForcingsThermalForcingEnum,
 	GeometryHydrostaticRatioEnum,
-	GiaLithosphereThicknessEnum,
-	GiaMantleViscosityEnum,
 	NGiaEnum,
 	NGiaRateEnum,
@@ -643,4 +724,8 @@
    HydrologyEnglacialInputEnum,
 	HydrologyGapHeightEnum,
+	HydrologyGapHeightXEnum,
+	HydrologyGapHeightXXEnum,
+	HydrologyGapHeightYEnum,
+	HydrologyGapHeightYYEnum,
 	HydrologyHeadEnum,
 	HydrologyHeadOldEnum,
@@ -651,4 +736,7 @@
 	HydrologySheetThicknessEnum,
 	HydrologySheetThicknessOldEnum,
+	HydrologyTwsEnum,
+	HydrologyTwsSpcEnum,
+	HydrologyTwsAnalysisEnum,
 	HydrologyWatercolumnMaxEnum,
 	HydrologyWaterVxEnum,
@@ -665,4 +753,5 @@
 	LevelsetfunctionSlopeXEnum,
 	LevelsetfunctionSlopeYEnum,
+	LevelsetObservationEnum,
 	LoadingforceXEnum,
 	LoadingforceYEnum,
@@ -670,4 +759,5 @@
 	MaskOceanLevelsetEnum,
 	MaskIceLevelsetEnum,
+	MaskIceRefLevelsetEnum,
 	MasstransportSpcthicknessEnum,
 	MaterialsRheologyBEnum,
@@ -685,8 +775,13 @@
 	MeshVertexonsurfaceEnum,
 	MisfitEnum,
+	MovingFrontalVxEnum,
+	MovingFrontalVyEnum,
 	NeumannfluxEnum,
 	NewDamageEnum,
 	NodeEnum,
 	OmegaAbsGradientEnum,
+	OceantransportSpcbottompressureEnum,
+	OceantransportSpcstrEnum,
+	OceantransportSpcdslEnum,
 	P0Enum,
 	P1Enum,
@@ -703,32 +798,80 @@
 	RheologyBInitialguessMisfitEnum,
 	RheologyBbarAbsGradientEnum,
+	SampleEnum,
+	SamplingBetaEnum,
+	SamplingKappaEnum,
 	SealevelEnum,
-	SealevelEustaticMaskEnum,
-	SealevelEustaticOceanMaskEnum,
+	SealevelGRDEnum,
+	SealevelBarystaticMaskEnum,
+	SealevelBarystaticIceMaskEnum,
+	SealevelBarystaticIceWeightsEnum,
+	SealevelBarystaticIceAreaEnum,
+	SealevelBarystaticIceLatbarEnum,
+	SealevelBarystaticIceLongbarEnum,
+	SealevelBarystaticIceLoadEnum,
+	SealevelBarystaticHydroMaskEnum,
+	SealevelBarystaticHydroWeightsEnum,
+	SealevelBarystaticHydroAreaEnum,
+	SealevelBarystaticHydroLatbarEnum,
+	SealevelBarystaticHydroLongbarEnum,
+	SealevelBarystaticHydroLoadEnum,
+	SealevelBarystaticBpMaskEnum,
+	SealevelBarystaticBpWeightsEnum,
+	SealevelBarystaticBpAreaEnum,
+	SealevelBarystaticBpLoadEnum,
+	SealevelBarystaticOceanMaskEnum,
+	SealevelBarystaticOceanWeightsEnum,
+	SealevelBarystaticOceanAreaEnum,
+	SealevelBarystaticOceanLatbarEnum,
+	SealevelBarystaticOceanLongbarEnum,
+	SealevelBarystaticOceanLoadEnum,
 	SealevelNEsaEnum,
 	SealevelNEsaRateEnum,
 	SealevelRSLEnum,
-	BslrEnum,
-	BslrIceEnum,
-	BslrHydroEnum,
-	BslrRateEnum,
-	GmtslrEnum,
-	SealevelRSLEustaticEnum,
-	SealevelRSLEustaticRateEnum,
+	BslcEnum,
+	BslcIceEnum,
+	BslcHydroEnum,
+	BslcOceanEnum,
+	BslcRateEnum,
+	GmtslcEnum,
+	SealevelGrotm1Enum,
+	SealevelGrotm2Enum,
+	SealevelGrotm3Enum,
+	SealevelGUrotm1Enum,
+	SealevelGUrotm2Enum,
+	SealevelGUrotm3Enum,
+	SealevelGNrotm1Enum,
+	SealevelGNrotm2Enum,
+	SealevelGNrotm3Enum,
+	SealevelGErotm1Enum,
+	SealevelGErotm2Enum,
+	SealevelGErotm3Enum,
+	SealevelRSLBarystaticEnum,
 	SealevelRSLRateEnum,
+	SealevelUGrdEnum,
+	SealevelNGrdEnum,
 	SealevelUEastEsaEnum,
-	SealevelUEsaEnum,
-	SealevelUEsaRateEnum,
 	SealevelUNorthEsaEnum,
-	SealevelriseCumDeltathicknessEnum,
-	SealevelriseCumDeltathicknessOldEnum,
-	SurfaceloadOtherEnum,
-	SurfaceloadIceThicknessChangeEnum,
-	SurfaceloadWaterHeightChangeEnum,
-	SealevelriseIndicesEnum,
-	SealevelriseGEnum,
-	SealevelriseGUEnum,
-	SealevelriseGEEnum,
-	SealevelriseGNEnum,
+	SealevelchangeIndicesEnum,
+	SealevelchangeGEnum,
+	SealevelchangeGUEnum,
+	SealevelchangeGEEnum,
+	SealevelchangeGNEnum,
+	SealevelchangeGsubelOceanEnum,
+	SealevelchangeGUsubelOceanEnum,
+	SealevelchangeGEsubelOceanEnum,
+	SealevelchangeGNsubelOceanEnum,
+	SealevelchangeGsubelIceEnum,
+	SealevelchangeGUsubelIceEnum,
+	SealevelchangeGEsubelIceEnum,
+	SealevelchangeGNsubelIceEnum,
+	SealevelchangeGsubelHydroEnum,
+	SealevelchangeGUsubelHydroEnum,
+	SealevelchangeGEsubelHydroEnum,
+	SealevelchangeGNsubelHydroEnum,
+	SealevelchangeViscousRSLEnum,
+	SealevelchangeViscousUEnum,
+	SealevelchangeViscousNEnum,
+	SealevelchangeViscousEEnum,
 	SedimentHeadEnum,
 	SedimentHeadOldEnum,
@@ -743,9 +886,15 @@
 	SmbAccumulatedMeltEnum,
 	SmbAccumulatedPrecipitationEnum,
+	SmbAccumulatedRainEnum,
+	SmbAccumulatedRefreezeEnum,
 	SmbAccumulatedRunoffEnum,
 	SmbAEnum,
+	SmbAdiffEnum,
 	SmbAValueEnum,
 	SmbAccumulationEnum,
+	SmbAdiffiniEnum,
 	SmbAiniEnum,
+   SmbAutoregressionNoiseEnum,
+	SmbBasinsIdEnum,
 	SmbBMaxEnum,
 	SmbBMinEnum,
@@ -753,4 +902,7 @@
 	SmbBPosEnum,
 	SmbCEnum,
+	SmbCcsnowValueEnum,
+	SmbCciceValueEnum,
+	SmbCotValueEnum,
 	SmbDEnum,
 	SmbDailyairdensityEnum,
@@ -765,5 +917,7 @@
 	SmbDiniEnum,
 	SmbDlwrfEnum,
+	SmbDulwrfValueEnum,
 	SmbDswrfEnum,
+	SmbDswdiffrfEnum,
 	SmbDzAddEnum,
 	SmbDzEnum,
@@ -785,5 +939,4 @@
 	SmbIsInitializedEnum,
 	SmbMAddEnum,
-	SmbMassBalanceClimateEnum,
 	SmbMassBalanceEnum,
    SmbMassBalanceSubstepEnum,
@@ -807,4 +960,5 @@
 	SmbPrecipitationsPresentdayEnum,
 	SmbPrecipitationsReconstructedEnum,
+	SmbRainEnum,
 	SmbReEnum,
 	SmbRefreezeEnum,
@@ -819,4 +973,5 @@
 	SmbSmbCorrEnum,
 	SmbSmbrefEnum,
+	SmbSzaValueEnum,
 	SmbTEnum,
 	SmbTaEnum,
@@ -829,4 +984,5 @@
 	SmbTmeanEnum,
 	SmbTzEnum,
+	SmbValuesAutoregressionEnum,
 	SmbVEnum,
 	SmbVmeanEnum,
@@ -839,4 +995,9 @@
 	SmbZTopEnum,
 	SmbZYEnum,
+	SolidearthExternalDisplacementEastRateEnum,
+	SolidearthExternalDisplacementNorthRateEnum,
+	SolidearthExternalDisplacementUpRateEnum,
+	SolidearthExternalGeoidRateEnum,
+	StochasticForcingDefaultIdEnum,
 	StrainRateeffectiveEnum,
 	StrainRateparallelEnum,
@@ -874,4 +1035,6 @@
 	TemperaturePicardEnum,
 	TemperatureSEMICEnum,
+   ThermalforcingAutoregressionNoiseEnum,
+	ThermalforcingValuesAutoregressionEnum,	
 	ThermalSpctemperatureEnum,
 	ThicknessAbsGradientEnum,
@@ -883,13 +1046,20 @@
 	ThicknessPositiveEnum,
 	ThicknessResidualEnum,
+	TransientAccumulatedDeltaIceThicknessEnum,
 	VelEnum,
 	VxAverageEnum,
+	VxBaseEnum,
 	VxEnum,
 	VxMeshEnum,
 	VxObsEnum,
+	VxShearEnum,
+	VxSurfaceEnum,
 	VyAverageEnum,
+	VyBaseEnum,
 	VyEnum,
 	VyMeshEnum,
 	VyObsEnum,
+	VyShearEnum,
+	VySurfaceEnum,
 	VzEnum,
 	VzFSEnum,
@@ -903,5 +1073,11 @@
 	WaterfractionEnum,
 	WaterheightEnum,
+	FrictionWaterPressureEnum,
+	FrictionWaterPressureNoiseEnum,
+	WeightsLevelsetObservationEnum,
 	WeightsSurfaceObservationEnum,
+	OldAccumulatedDeltaBottomPressureEnum,
+	OldAccumulatedDeltaIceThicknessEnum,
+	OldAccumulatedDeltaTwsEnum,
 	Outputdefinition1Enum,
 	Outputdefinition10Enum,
@@ -1045,4 +1221,5 @@
 	CfsurfacelogvelEnum,
 	CfsurfacesquareEnum,
+	CflevelsetmisfitEnum,
 	ChannelEnum,
 	ChannelAreaEnum,
@@ -1110,4 +1287,5 @@
 	FrontalForcingsDefaultEnum,
 	FrontalForcingsRignotEnum,
+	FrontalForcingsRignotAutoregressionEnum,
 	FsetEnum,
 	FullMeltOnPartiallyFloatingEnum,
@@ -1120,6 +1298,4 @@
 	GenericParamEnum,
 	GenericExternalResultEnum,
-	GiaAnalysisEnum,
-	GiaSolutionEnum,
 	Gradient1Enum,
 	Gradient2Enum,
@@ -1241,4 +1417,6 @@
 	NyeH2OEnum,
 	NumericalfluxEnum,
+	OceantransportAnalysisEnum,
+	OceantransportSolutionEnum,
 	OldGradientEnum,
 	OneLayerP4zEnum,
@@ -1275,5 +1453,8 @@
 	RecoveryAnalysisEnum,
 	RiftfrontEnum,
+	SamplingAnalysisEnum,
+	SamplingSolutionEnum,
 	SIAApproximationEnum,
+	SMBautoregressionEnum,
 	SMBcomponentsEnum,
 	SMBd18opddEnum,
@@ -1298,8 +1479,8 @@
 	SealevelInertiaTensorYZEnum,
 	SealevelInertiaTensorZZEnum,
+	SealevelchangePolarMotionEnum,
 	SealevelNmotionEnum,
 	SealevelUmotionEnum,
-	SealevelriseAnalysisEnum,
-	SealevelriseSolutionEnum,
+	SealevelchangeAnalysisEnum,
 	SegEnum,
 	SegInputEnum,
Index: /issm/trunk/src/c/shared/Enum/EnumToStringx.cpp
===================================================================
--- /issm/trunk/src/c/shared/Enum/EnumToStringx.cpp	(revision 26743)
+++ /issm/trunk/src/c/shared/Enum/EnumToStringx.cpp	(revision 26744)
@@ -65,4 +65,5 @@
 		case AutodiffXpEnum : return "AutodiffXp";
 		case BalancethicknessStabilizationEnum : return "BalancethicknessStabilization";
+		case BarystaticContributionsEnum : return "BarystaticContributions";
 		case BasalforcingsBottomplumedepthEnum : return "BasalforcingsBottomplumedepth";
 		case BasalforcingsCrustthicknessEnum : return "BasalforcingsCrustthickness";
@@ -102,4 +103,5 @@
 		case BasalforcingsUpperwaterMeltingRateEnum : return "BasalforcingsUpperwaterMeltingRate";
 		case CalvingCrevasseDepthEnum : return "CalvingCrevasseDepth";
+		case CalvingCrevasseThresholdEnum : return "CalvingCrevasseThreshold";
 		case CalvingHeightAboveFloatationEnum : return "CalvingHeightAboveFloatation";
 		case CalvingLawEnum : return "CalvingLaw";
@@ -107,4 +109,5 @@
 		case ConfigurationTypeEnum : return "ConfigurationType";
 		case ConstantsGEnum : return "ConstantsG";
+		case ConstantsNewtonGravityEnum : return "ConstantsNewtonGravity";
 		case ConstantsReferencetemperatureEnum : return "ConstantsReferencetemperature";
 		case ConstantsYtsEnum : return "ConstantsYts";
@@ -112,11 +115,13 @@
 		case ControlInputSizeNEnum : return "ControlInputSizeN";
 		case ControlInputInterpolationEnum : return "ControlInputInterpolation";
-		case CumBslrEnum : return "CumBslr";
-		case CumBslrIceEnum : return "CumBslrIce";
-		case CumBslrHydroEnum : return "CumBslrHydro";
-		case CumBslrIcePartitionEnum : return "CumBslrIcePartition";
-		case CumBslrHydroPartitionEnum : return "CumBslrHydroPartition";
-		case CumGmtslrEnum : return "CumGmtslr";
-		case CumGmslrEnum : return "CumGmslr";
+		case CumBslcEnum : return "CumBslc";
+		case CumBslcIceEnum : return "CumBslcIce";
+		case CumBslcHydroEnum : return "CumBslcHydro";
+		case CumBslcOceanEnum : return "CumBslcOcean";
+		case CumBslcIcePartitionEnum : return "CumBslcIcePartition";
+		case CumBslcHydroPartitionEnum : return "CumBslcHydroPartition";
+		case CumBslcOceanPartitionEnum : return "CumBslcOceanPartition";
+		case CumGmtslcEnum : return "CumGmtslc";
+		case CumGmslcEnum : return "CumGmslc";
 		case DamageC1Enum : return "DamageC1";
 		case DamageC2Enum : return "DamageC2";
@@ -140,6 +145,11 @@
 		case DslModelidEnum : return "DslModelid";
 		case DslNummodelsEnum : return "DslNummodels";
-		case DslComputeFingerprintsEnum : return "DslComputeFingerprints";
+		case SolidearthIsExternalEnum : return "SolidearthIsExternal";
+		case SolidearthExternalNatureEnum : return "SolidearthExternalNature";
+		case SolidearthExternalModelidEnum : return "SolidearthExternalModelid";
+		case SolidearthExternalNummodelsEnum : return "SolidearthExternalNummodels";
+		case SolidearthSettingsComputeBpGrdEnum : return "SolidearthSettingsComputeBpGrd";
 		case EarthIdEnum : return "EarthId";
+		case ElasticEnum : return "Elastic";
 		case EplZigZagCounterEnum : return "EplZigZagCounter";
 		case EsaHElasticEnum : return "EsaHElastic";
@@ -169,10 +179,13 @@
 		case FrictionVoidRatioEnum : return "FrictionVoidRatio";
 		case FrontalForcingsBasinIcefrontAreaEnum : return "FrontalForcingsBasinIcefrontArea";
+		case FrontalForcingsAutoregressionInitialTimeEnum : return "FrontalForcingsAutoregressionInitialTime";
+		case FrontalForcingsAutoregressionTimestepEnum : return "FrontalForcingsAutoregressionTimestep";
+		case FrontalForcingsAutoregressiveOrderEnum : return "FrontalForcingsAutoregressiveOrder";
+		case FrontalForcingsBeta0Enum : return "FrontalForcingsBeta0";
+		case FrontalForcingsBeta1Enum : return "FrontalForcingsBeta1";
 		case FrontalForcingsNumberofBasinsEnum : return "FrontalForcingsNumberofBasins";
 		case FrontalForcingsParamEnum : return "FrontalForcingsParam";
-		case GiaModelEnum : return "GiaModel";
-		case GiaModelidEnum : return "GiaModelid";
-		case GiaNummodelsEnum : return "GiaNummodels";
-		case GiaCrossSectionShapeEnum : return "GiaCrossSectionShape";
+		case FrontalForcingsPhiEnum : return "FrontalForcingsPhi";
+		case GrdModelEnum : return "GrdModel";
 		case GroundinglineFrictionInterpolationEnum : return "GroundinglineFrictionInterpolation";
 		case GroundinglineMeltInterpolationEnum : return "GroundinglineMeltInterpolation";
@@ -245,4 +258,6 @@
 		case InversionStepThresholdEnum : return "InversionStepThreshold";
 		case InversionTypeEnum : return "InversionType";
+		case IvinsEnum : return "Ivins";
+		case IsSlcCouplingEnum : return "IsSlcCoupling";
 		case LevelsetKillIcebergsEnum : return "LevelsetKillIcebergs";
 		case LevelsetReinitFrequencyEnum : return "LevelsetReinitFrequency";
@@ -250,13 +265,24 @@
 		case LockFileNameEnum : return "LockFileName";
 		case LoveAllowLayerDeletionEnum : return "LoveAllowLayerDeletion";
+		case LoveCoreMantleBoundaryEnum : return "LoveCoreMantleBoundary";
+		case LoveEarthMassEnum : return "LoveEarthMass";
 		case LoveForcingTypeEnum : return "LoveForcingType";
 		case LoveFrequenciesEnum : return "LoveFrequencies";
+		case LoveIsTemporalEnum : return "LoveIsTemporal";
 		case LoveG0Enum : return "LoveG0";
+		case LoveGravitationalConstantEnum : return "LoveGravitationalConstant";
+		case LoveInnerCoreBoundaryEnum : return "LoveInnerCoreBoundary";
+		case LoveComplexComputationEnum : return "LoveComplexComputation";
+		case LoveIntStepsPerLayerEnum : return "LoveIntStepsPerLayer";
 		case LoveKernelsEnum : return "LoveKernels";
 		case LoveMu0Enum : return "LoveMu0";
 		case LoveNfreqEnum : return "LoveNfreq";
+		case LoveNTemporalIterationsEnum : return "LoveNTemporalIterations";
+		case LoveNYiEquationsEnum : return "LoveNYiEquations";
 		case LoveR0Enum : return "LoveR0";
 		case LoveShNmaxEnum : return "LoveShNmax";
 		case LoveShNminEnum : return "LoveShNmin";
+		case LoveStartingLayerEnum : return "LoveStartingLayer";
+		case LoveUnderflowTolEnum : return "LoveUnderflowTol";
 		case MassFluxSegmentsEnum : return "MassFluxSegments";
 		case MassFluxSegmentsPresentEnum : return "MassFluxSegmentsPresent";
@@ -273,8 +299,4 @@
 		case MaterialsHeatcapacityEnum : return "MaterialsHeatcapacity";
 		case MaterialsLatentheatEnum : return "MaterialsLatentheat";
-		case MaterialsLithosphereDensityEnum : return "MaterialsLithosphereDensity";
-		case MaterialsLithosphereShearModulusEnum : return "MaterialsLithosphereShearModulus";
-		case MaterialsMantleDensityEnum : return "MaterialsMantleDensity";
-		case MaterialsMantleShearModulusEnum : return "MaterialsMantleShearModulus";
 		case MaterialsMeltingpointEnum : return "MaterialsMeltingpoint";
 		case MaterialsMixedLayerCapacityEnum : return "MaterialsMixedLayerCapacity";
@@ -292,4 +314,5 @@
 		case MeshNumberoflayersEnum : return "MeshNumberoflayers";
 		case MeshNumberofverticesEnum : return "MeshNumberofvertices";
+		case MeshNumberofelementsEnum : return "MeshNumberofelements";
 		case MigrationMaxEnum : return "MigrationMax";
 		case ModelIdEnum : return "ModelId";
@@ -330,15 +353,29 @@
 		case RootPathEnum : return "RootPath";
 		case ModelnameEnum : return "Modelname";
+		case SamplingAlphaEnum : return "SamplingAlpha";
+		case SamplingPhiEnum : return "SamplingPhi";
+		case SamplingNumRequestedOutputsEnum : return "SamplingNumRequestedOutputs";
+		case SamplingRequestedOutputsEnum : return "SamplingRequestedOutputs";
+		case SamplingRobinEnum : return "SamplingRobin";
+		case SamplingSeedEnum : return "SamplingSeed";
+		case SamplingTauEnum : return "SamplingTau";
 		case SaveResultsEnum : return "SaveResults";
 		case SolidearthPartitionIceEnum : return "SolidearthPartitionIce";
 		case SolidearthPartitionHydroEnum : return "SolidearthPartitionHydro";
+		case SolidearthPartitionOceanEnum : return "SolidearthPartitionOcean";
 		case SolidearthNpartIceEnum : return "SolidearthNpartIce";
+		case SolidearthNpartOceanEnum : return "SolidearthNpartOcean";
 		case SolidearthNpartHydroEnum : return "SolidearthNpartHydro";
 		case SolidearthPlanetRadiusEnum : return "SolidearthPlanetRadius";
 		case SolidearthPlanetAreaEnum : return "SolidearthPlanetArea";
 		case SolidearthSettingsAbstolEnum : return "SolidearthSettingsAbstol";
+		case SolidearthSettingsCrossSectionShapeEnum : return "SolidearthSettingsCrossSectionShape";
 		case RotationalAngularVelocityEnum : return "RotationalAngularVelocity";
 		case SolidearthSettingsElasticEnum : return "SolidearthSettingsElastic";
-		case SealevelriseGeometryDoneEnum : return "SealevelriseGeometryDone";
+		case SolidearthSettingsViscousEnum : return "SolidearthSettingsViscous";
+		case SealevelchangeGeometryDoneEnum : return "SealevelchangeGeometryDone";
+		case SealevelchangeViscousNumStepsEnum : return "SealevelchangeViscousNumSteps";
+		case SealevelchangeViscousTimesEnum : return "SealevelchangeViscousTimes";
+		case SealevelchangeViscousIndexEnum : return "SealevelchangeViscousIndex";
 		case RotationalEquatorialMoiEnum : return "RotationalEquatorialMoi";
 		case TidalLoveHEnum : return "TidalLoveH";
@@ -349,22 +386,35 @@
 		case LoadLoveKEnum : return "LoadLoveK";
 		case LoadLoveLEnum : return "LoadLoveL";
-		case SealevelriseGRigidEnum : return "SealevelriseGRigid";
-		case SealevelriseGElasticEnum : return "SealevelriseGElastic";
-		case SolidearthSettingsComputesealevelchangeEnum : return "SolidearthSettingsComputesealevelchange";
+		case LoveTimeFreqEnum : return "LoveTimeFreq";
+		case LoveIsTimeEnum : return "LoveIsTime";
+		case SealevelchangeGSelfAttractionEnum : return "SealevelchangeGSelfAttraction";
+		case SealevelchangeGViscoElasticEnum : return "SealevelchangeGViscoElastic";
+		case SolidearthSettingsSealevelLoadingEnum : return "SolidearthSettingsSealevelLoading";
 		case SolidearthSettingsGRDEnum : return "SolidearthSettingsGRD";
-		case SolidearthSettingsGlfractionEnum : return "SolidearthSettingsGlfraction";
 		case SolidearthSettingsRunFrequencyEnum : return "SolidearthSettingsRunFrequency";
-		case SealevelriseHElasticEnum : return "SealevelriseHElastic";
+		case SolidearthSettingsTimeAccEnum : return "SolidearthSettingsTimeAcc";
+		case SealevelchangeHViscoElasticEnum : return "SealevelchangeHViscoElastic";
 		case SolidearthSettingsHorizEnum : return "SolidearthSettingsHoriz";
 		case SolidearthSettingsMaxiterEnum : return "SolidearthSettingsMaxiter";
+		case SolidearthSettingsGrdOceanEnum : return "SolidearthSettingsGrdOcean";
 		case SolidearthSettingsOceanAreaScalingEnum : return "SolidearthSettingsOceanAreaScaling";
+		case StochasticForcingCovarianceEnum : return "StochasticForcingCovariance";
+		case StochasticForcingDefaultDimensionEnum : return "StochasticForcingDefaultDimension";
+		case StochasticForcingDimensionsEnum : return "StochasticForcingDimensions";
+		case StochasticForcingFieldsEnum : return "StochasticForcingFields";
+		case StochasticForcingIsEffectivePressureEnum : return "StochasticForcingIsEffectivePressure";
+		case StochasticForcingIsStochasticForcingEnum : return "StochasticForcingIsStochasticForcing";
+		case StochasticForcingIsWaterPressureEnum : return "StochasticForcingIsWaterPressure";
+		case StochasticForcingNumFieldsEnum : return "StochasticForcingNumFields";
+		case StochasticForcingRandomflagEnum : return "StochasticForcingRandomflag";
 		case RotationalPolarMoiEnum : return "RotationalPolarMoi";
 		case SolidearthSettingsReltolEnum : return "SolidearthSettingsReltol";
-		case SealevelriseRequestedOutputsEnum : return "SealevelriseRequestedOutputs";
-		case SolidearthSettingsRigidEnum : return "SolidearthSettingsRigid";
+		case SealevelchangeRequestedOutputsEnum : return "SealevelchangeRequestedOutputs";
+		case SolidearthSettingsSelfAttractionEnum : return "SolidearthSettingsSelfAttraction";
 		case SolidearthSettingsRotationEnum : return "SolidearthSettingsRotation";
-		case SealevelriseRunCountEnum : return "SealevelriseRunCount";
-		case SealevelriseTransitionsEnum : return "SealevelriseTransitions";
-		case SealevelriseUElasticEnum : return "SealevelriseUElastic";
+		case SolidearthSettingsMaxSHCoeffEnum : return "SolidearthSettingsMaxSHCoeff";
+		case SealevelchangeRunCountEnum : return "SealevelchangeRunCount";
+		case SealevelchangeTransitionsEnum : return "SealevelchangeTransitions";
+		case SealevelchangeUViscoElasticEnum : return "SealevelchangeUViscoElastic";
 		case SettingsIoGatherEnum : return "SettingsIoGather";
 		case SettingsNumResultsOnNodesEnum : return "SettingsNumResultsOnNodes";
@@ -382,5 +432,10 @@
 		case SmbAccurefEnum : return "SmbAccuref";
 		case SmbAdThreshEnum : return "SmbAdThresh";
+		case SmbAutoregressionInitialTimeEnum : return "SmbAutoregressionInitialTime";
+		case SmbAutoregressionTimestepEnum : return "SmbAutoregressionTimestep";
+		case SmbAutoregressiveOrderEnum : return "SmbAutoregressiveOrder";
 		case SmbAveragingEnum : return "SmbAveraging";
+		case SmbBeta0Enum : return "SmbBeta0";
+		case SmbBeta1Enum : return "SmbBeta1";
 		case SmbDesfacEnum : return "SmbDesfac";
 		case SmbDpermilEnum : return "SmbDpermil";
@@ -392,13 +447,14 @@
 		case SmbDtEnum : return "SmbDt";
 		case SmbEnum : return "Smb";
+		case SmbEIdxEnum : return "SmbEIdx";
 		case SmbFEnum : return "SmbF";
 		case SmbInitDensityScalingEnum : return "SmbInitDensityScaling";
 		case SmbIsaccumulationEnum : return "SmbIsaccumulation";
 		case SmbIsalbedoEnum : return "SmbIsalbedo";
-		case SmbIsclimatologyEnum : return "SmbIsclimatology";
 		case SmbIsconstrainsurfaceTEnum : return "SmbIsconstrainsurfaceT";
 		case SmbIsd18opdEnum : return "SmbIsd18opd";
 		case SmbIsdelta18oEnum : return "SmbIsdelta18o";
 		case SmbIsdensificationEnum : return "SmbIsdensification";
+		case SmbIsdeltaLWupEnum : return "SmbIsdeltaLWup";
 		case SmbIsfirnwarmingEnum : return "SmbIsfirnwarming";
 		case SmbIsgraingrowthEnum : return "SmbIsgraingrowth";
@@ -412,6 +468,8 @@
 		case SmbIsturbulentfluxEnum : return "SmbIsturbulentflux";
 		case SmbKEnum : return "SmbK";
+		case SmbNumBasinsEnum : return "SmbNumBasins";
 		case SmbNumRequestedOutputsEnum : return "SmbNumRequestedOutputs";
 		case SmbPfacEnum : return "SmbPfac";
+		case SmbPhiEnum : return "SmbPhi";
 		case SmbRdlEnum : return "SmbRdl";
 		case SmbRequestedOutputsEnum : return "SmbRequestedOutputs";
@@ -426,4 +484,5 @@
 		case SmbT0dryEnum : return "SmbT0dry";
 		case SmbT0wetEnum : return "SmbT0wet";
+		case SmbTeThreshEnum : return "SmbTeThresh";
 		case SmbTdiffEnum : return "SmbTdiff";
 		case SmbThermoDeltaTScalingEnum : return "SmbThermoDeltaTScaling";
@@ -465,5 +524,6 @@
 		case TimesteppingCouplingTimeEnum : return "TimesteppingCouplingTime";
 		case TimesteppingFinalTimeEnum : return "TimesteppingFinalTime";
-		case TimesteppingInterpForcingsEnum : return "TimesteppingInterpForcings";
+		case TimesteppingInterpForcingEnum : return "TimesteppingInterpForcing";
+		case TimesteppingCycleForcingEnum : return "TimesteppingCycleForcing";
 		case TimesteppingStartTimeEnum : return "TimesteppingStartTime";
 		case TimesteppingTimeStepEnum : return "TimesteppingTimeStep";
@@ -477,5 +537,4 @@
 		case ToolkitsTypesEnum : return "ToolkitsTypes";
 		case TransientAmrFrequencyEnum : return "TransientAmrFrequency";
-		case TransientIscouplerEnum : return "TransientIscoupler";
 		case TransientIsdamageevolutionEnum : return "TransientIsdamageevolution";
 		case TransientIsesaEnum : return "TransientIsesa";
@@ -484,7 +543,9 @@
 		case TransientIshydrologyEnum : return "TransientIshydrology";
 		case TransientIsmasstransportEnum : return "TransientIsmasstransport";
+		case TransientIsoceantransportEnum : return "TransientIsoceantransport";
 		case TransientIsmovingfrontEnum : return "TransientIsmovingfront";
 		case TransientIsoceancouplingEnum : return "TransientIsoceancoupling";
-		case TransientIsslrEnum : return "TransientIsslr";
+		case TransientIssamplingEnum : return "TransientIssampling";
+		case TransientIsslcEnum : return "TransientIsslc";
 		case TransientIssmbEnum : return "TransientIssmb";
 		case TransientIsstressbalanceEnum : return "TransientIsstressbalance";
@@ -493,11 +554,22 @@
 		case TransientRequestedOutputsEnum : return "TransientRequestedOutputs";
 		case VelocityEnum : return "Velocity";
+		case XxeEnum : return "Xxe";
+		case YyeEnum : return "Yye";
+		case ZzeEnum : return "Zze";
+		case AreaeEnum : return "Areae";
 		case WorldCommEnum : return "WorldComm";
 		case ParametersENDEnum : return "ParametersEND";
 		case InputsSTARTEnum : return "InputsSTART";
+		case AccumulatedDeltaBottomPressureEnum : return "AccumulatedDeltaBottomPressure";
+		case AccumulatedDeltaIceThicknessEnum : return "AccumulatedDeltaIceThickness";
+		case AccumulatedDeltaTwsEnum : return "AccumulatedDeltaTws";
 		case AdjointEnum : return "Adjoint";
 		case AdjointpEnum : return "Adjointp";
 		case AdjointxEnum : return "Adjointx";
+		case AdjointxBaseEnum : return "AdjointxBase";
+		case AdjointxShearEnum : return "AdjointxShear";
 		case AdjointyEnum : return "Adjointy";
+		case AdjointyBaseEnum : return "AdjointyBase";
+		case AdjointyShearEnum : return "AdjointyShear";
 		case AdjointzEnum : return "Adjointz";
 		case AirEnum : return "Air";
@@ -533,7 +605,17 @@
 		case BaseSlopeXEnum : return "BaseSlopeX";
 		case BaseSlopeYEnum : return "BaseSlopeY";
+		case BaselineBasalforcingsFloatingiceMeltingRateEnum : return "BaselineBasalforcingsFloatingiceMeltingRate";
+		case BaselineCalvingCalvingrateEnum : return "BaselineCalvingCalvingrate";
+		case BaselineFrictionEffectivePressureEnum : return "BaselineFrictionEffectivePressure";
 		case BedEnum : return "Bed";
+		case BedGRDEnum : return "BedGRD";
+		case BedEastEnum : return "BedEast";
+		case BedEastGRDEnum : return "BedEastGRD";
+		case BedNorthEnum : return "BedNorth";
+		case BedNorthGRDEnum : return "BedNorthGRD";
 		case BedSlopeXEnum : return "BedSlopeX";
 		case BedSlopeYEnum : return "BedSlopeY";
+		case BottomPressureEnum : return "BottomPressure";
+		case BottomPressureOldEnum : return "BottomPressureOld";
 		case CalvingCalvingrateEnum : return "CalvingCalvingrate";
 		case CalvingHabFractionEnum : return "CalvingHabFraction";
@@ -557,4 +639,13 @@
 		case DegreeOfChannelizationEnum : return "DegreeOfChannelization";
 		case DepthBelowSurfaceEnum : return "DepthBelowSurface";
+		case DeltaIceThicknessEnum : return "DeltaIceThickness";
+		case DeltaTwsEnum : return "DeltaTws";
+		case DeltaBottomPressureEnum : return "DeltaBottomPressure";
+		case DeltaDslEnum : return "DeltaDsl";
+		case DslOldEnum : return "DslOld";
+		case DslEnum : return "Dsl";
+		case DeltaStrEnum : return "DeltaStr";
+		case StrOldEnum : return "StrOld";
+		case StrEnum : return "Str";
 		case DeviatoricStresseffectiveEnum : return "DeviatoricStresseffective";
 		case DeviatoricStressxxEnum : return "DeviatoricStressxx";
@@ -574,11 +665,4 @@
 		case DrivingStressXEnum : return "DrivingStressX";
 		case DrivingStressYEnum : return "DrivingStressY";
-		case DslGlobalAverageThermostericSeaLevelChangeEnum : return "DslGlobalAverageThermostericSeaLevelChange";
-		case DslSeaSurfaceHeightChangeAboveGeoidEnum : return "DslSeaSurfaceHeightChangeAboveGeoid";
-		case DslSeaWaterPressureChangeAtSeaFloorEnum : return "DslSeaWaterPressureChangeAtSeaFloor";
-		case DslStericRateEnum : return "DslStericRate";
-		case DslDynamicRateEnum : return "DslDynamicRate";
-		case GiaMmeNgiaEnum : return "GiaMmeNgia";
-		case GiaMmeUgiaEnum : return "GiaMmeUgia";
 		case DummyEnum : return "Dummy";
 		case EffectivePressureEnum : return "EffectivePressure";
@@ -593,5 +677,4 @@
 		case EplHeadSubstepEnum : return "EplHeadSubstep";
 		case EplHeadTransientEnum : return "EplHeadTransient";
-		case EsaDeltathicknessEnum : return "EsaDeltathickness";
 		case EsaEmotionEnum : return "EsaEmotion";
 		case EsaNmotionEnum : return "EsaNmotion";
@@ -623,6 +706,4 @@
 		case FrontalForcingsThermalForcingEnum : return "FrontalForcingsThermalForcing";
 		case GeometryHydrostaticRatioEnum : return "GeometryHydrostaticRatio";
-		case GiaLithosphereThicknessEnum : return "GiaLithosphereThickness";
-		case GiaMantleViscosityEnum : return "GiaMantleViscosity";
 		case NGiaEnum : return "NGia";
 		case NGiaRateEnum : return "NGiaRate";
@@ -649,4 +730,8 @@
 		case HydrologyEnglacialInputEnum : return "HydrologyEnglacialInput";
 		case HydrologyGapHeightEnum : return "HydrologyGapHeight";
+		case HydrologyGapHeightXEnum : return "HydrologyGapHeightX";
+		case HydrologyGapHeightXXEnum : return "HydrologyGapHeightXX";
+		case HydrologyGapHeightYEnum : return "HydrologyGapHeightY";
+		case HydrologyGapHeightYYEnum : return "HydrologyGapHeightYY";
 		case HydrologyHeadEnum : return "HydrologyHead";
 		case HydrologyHeadOldEnum : return "HydrologyHeadOld";
@@ -657,4 +742,7 @@
 		case HydrologySheetThicknessEnum : return "HydrologySheetThickness";
 		case HydrologySheetThicknessOldEnum : return "HydrologySheetThicknessOld";
+		case HydrologyTwsEnum : return "HydrologyTws";
+		case HydrologyTwsSpcEnum : return "HydrologyTwsSpc";
+		case HydrologyTwsAnalysisEnum : return "HydrologyTwsAnalysis";
 		case HydrologyWatercolumnMaxEnum : return "HydrologyWatercolumnMax";
 		case HydrologyWaterVxEnum : return "HydrologyWaterVx";
@@ -671,4 +759,5 @@
 		case LevelsetfunctionSlopeXEnum : return "LevelsetfunctionSlopeX";
 		case LevelsetfunctionSlopeYEnum : return "LevelsetfunctionSlopeY";
+		case LevelsetObservationEnum : return "LevelsetObservation";
 		case LoadingforceXEnum : return "LoadingforceX";
 		case LoadingforceYEnum : return "LoadingforceY";
@@ -676,4 +765,5 @@
 		case MaskOceanLevelsetEnum : return "MaskOceanLevelset";
 		case MaskIceLevelsetEnum : return "MaskIceLevelset";
+		case MaskIceRefLevelsetEnum : return "MaskIceRefLevelset";
 		case MasstransportSpcthicknessEnum : return "MasstransportSpcthickness";
 		case MaterialsRheologyBEnum : return "MaterialsRheologyB";
@@ -691,8 +781,13 @@
 		case MeshVertexonsurfaceEnum : return "MeshVertexonsurface";
 		case MisfitEnum : return "Misfit";
+		case MovingFrontalVxEnum : return "MovingFrontalVx";
+		case MovingFrontalVyEnum : return "MovingFrontalVy";
 		case NeumannfluxEnum : return "Neumannflux";
 		case NewDamageEnum : return "NewDamage";
 		case NodeEnum : return "Node";
 		case OmegaAbsGradientEnum : return "OmegaAbsGradient";
+		case OceantransportSpcbottompressureEnum : return "OceantransportSpcbottompressure";
+		case OceantransportSpcstrEnum : return "OceantransportSpcstr";
+		case OceantransportSpcdslEnum : return "OceantransportSpcdsl";
 		case P0Enum : return "P0";
 		case P1Enum : return "P1";
@@ -709,32 +804,80 @@
 		case RheologyBInitialguessMisfitEnum : return "RheologyBInitialguessMisfit";
 		case RheologyBbarAbsGradientEnum : return "RheologyBbarAbsGradient";
+		case SampleEnum : return "Sample";
+		case SamplingBetaEnum : return "SamplingBeta";
+		case SamplingKappaEnum : return "SamplingKappa";
 		case SealevelEnum : return "Sealevel";
-		case SealevelEustaticMaskEnum : return "SealevelEustaticMask";
-		case SealevelEustaticOceanMaskEnum : return "SealevelEustaticOceanMask";
+		case SealevelGRDEnum : return "SealevelGRD";
+		case SealevelBarystaticMaskEnum : return "SealevelBarystaticMask";
+		case SealevelBarystaticIceMaskEnum : return "SealevelBarystaticIceMask";
+		case SealevelBarystaticIceWeightsEnum : return "SealevelBarystaticIceWeights";
+		case SealevelBarystaticIceAreaEnum : return "SealevelBarystaticIceArea";
+		case SealevelBarystaticIceLatbarEnum : return "SealevelBarystaticIceLatbar";
+		case SealevelBarystaticIceLongbarEnum : return "SealevelBarystaticIceLongbar";
+		case SealevelBarystaticIceLoadEnum : return "SealevelBarystaticIceLoad";
+		case SealevelBarystaticHydroMaskEnum : return "SealevelBarystaticHydroMask";
+		case SealevelBarystaticHydroWeightsEnum : return "SealevelBarystaticHydroWeights";
+		case SealevelBarystaticHydroAreaEnum : return "SealevelBarystaticHydroArea";
+		case SealevelBarystaticHydroLatbarEnum : return "SealevelBarystaticHydroLatbar";
+		case SealevelBarystaticHydroLongbarEnum : return "SealevelBarystaticHydroLongbar";
+		case SealevelBarystaticHydroLoadEnum : return "SealevelBarystaticHydroLoad";
+		case SealevelBarystaticBpMaskEnum : return "SealevelBarystaticBpMask";
+		case SealevelBarystaticBpWeightsEnum : return "SealevelBarystaticBpWeights";
+		case SealevelBarystaticBpAreaEnum : return "SealevelBarystaticBpArea";
+		case SealevelBarystaticBpLoadEnum : return "SealevelBarystaticBpLoad";
+		case SealevelBarystaticOceanMaskEnum : return "SealevelBarystaticOceanMask";
+		case SealevelBarystaticOceanWeightsEnum : return "SealevelBarystaticOceanWeights";
+		case SealevelBarystaticOceanAreaEnum : return "SealevelBarystaticOceanArea";
+		case SealevelBarystaticOceanLatbarEnum : return "SealevelBarystaticOceanLatbar";
+		case SealevelBarystaticOceanLongbarEnum : return "SealevelBarystaticOceanLongbar";
+		case SealevelBarystaticOceanLoadEnum : return "SealevelBarystaticOceanLoad";
 		case SealevelNEsaEnum : return "SealevelNEsa";
 		case SealevelNEsaRateEnum : return "SealevelNEsaRate";
 		case SealevelRSLEnum : return "SealevelRSL";
-		case BslrEnum : return "Bslr";
-		case BslrIceEnum : return "BslrIce";
-		case BslrHydroEnum : return "BslrHydro";
-		case BslrRateEnum : return "BslrRate";
-		case GmtslrEnum : return "Gmtslr";
-		case SealevelRSLEustaticEnum : return "SealevelRSLEustatic";
-		case SealevelRSLEustaticRateEnum : return "SealevelRSLEustaticRate";
+		case BslcEnum : return "Bslc";
+		case BslcIceEnum : return "BslcIce";
+		case BslcHydroEnum : return "BslcHydro";
+		case BslcOceanEnum : return "BslcOcean";
+		case BslcRateEnum : return "BslcRate";
+		case GmtslcEnum : return "Gmtslc";
+		case SealevelGrotm1Enum : return "SealevelGrotm1";
+		case SealevelGrotm2Enum : return "SealevelGrotm2";
+		case SealevelGrotm3Enum : return "SealevelGrotm3";
+		case SealevelGUrotm1Enum : return "SealevelGUrotm1";
+		case SealevelGUrotm2Enum : return "SealevelGUrotm2";
+		case SealevelGUrotm3Enum : return "SealevelGUrotm3";
+		case SealevelGNrotm1Enum : return "SealevelGNrotm1";
+		case SealevelGNrotm2Enum : return "SealevelGNrotm2";
+		case SealevelGNrotm3Enum : return "SealevelGNrotm3";
+		case SealevelGErotm1Enum : return "SealevelGErotm1";
+		case SealevelGErotm2Enum : return "SealevelGErotm2";
+		case SealevelGErotm3Enum : return "SealevelGErotm3";
+		case SealevelRSLBarystaticEnum : return "SealevelRSLBarystatic";
 		case SealevelRSLRateEnum : return "SealevelRSLRate";
+		case SealevelUGrdEnum : return "SealevelUGrd";
+		case SealevelNGrdEnum : return "SealevelNGrd";
 		case SealevelUEastEsaEnum : return "SealevelUEastEsa";
-		case SealevelUEsaEnum : return "SealevelUEsa";
-		case SealevelUEsaRateEnum : return "SealevelUEsaRate";
 		case SealevelUNorthEsaEnum : return "SealevelUNorthEsa";
-		case SealevelriseCumDeltathicknessEnum : return "SealevelriseCumDeltathickness";
-		case SealevelriseCumDeltathicknessOldEnum : return "SealevelriseCumDeltathicknessOld";
-		case SurfaceloadOtherEnum : return "SurfaceloadOther";
-		case SurfaceloadIceThicknessChangeEnum : return "SurfaceloadIceThicknessChange";
-		case SurfaceloadWaterHeightChangeEnum : return "SurfaceloadWaterHeightChange";
-		case SealevelriseIndicesEnum : return "SealevelriseIndices";
-		case SealevelriseGEnum : return "SealevelriseG";
-		case SealevelriseGUEnum : return "SealevelriseGU";
-		case SealevelriseGEEnum : return "SealevelriseGE";
-		case SealevelriseGNEnum : return "SealevelriseGN";
+		case SealevelchangeIndicesEnum : return "SealevelchangeIndices";
+		case SealevelchangeGEnum : return "SealevelchangeG";
+		case SealevelchangeGUEnum : return "SealevelchangeGU";
+		case SealevelchangeGEEnum : return "SealevelchangeGE";
+		case SealevelchangeGNEnum : return "SealevelchangeGN";
+		case SealevelchangeGsubelOceanEnum : return "SealevelchangeGsubelOcean";
+		case SealevelchangeGUsubelOceanEnum : return "SealevelchangeGUsubelOcean";
+		case SealevelchangeGEsubelOceanEnum : return "SealevelchangeGEsubelOcean";
+		case SealevelchangeGNsubelOceanEnum : return "SealevelchangeGNsubelOcean";
+		case SealevelchangeGsubelIceEnum : return "SealevelchangeGsubelIce";
+		case SealevelchangeGUsubelIceEnum : return "SealevelchangeGUsubelIce";
+		case SealevelchangeGEsubelIceEnum : return "SealevelchangeGEsubelIce";
+		case SealevelchangeGNsubelIceEnum : return "SealevelchangeGNsubelIce";
+		case SealevelchangeGsubelHydroEnum : return "SealevelchangeGsubelHydro";
+		case SealevelchangeGUsubelHydroEnum : return "SealevelchangeGUsubelHydro";
+		case SealevelchangeGEsubelHydroEnum : return "SealevelchangeGEsubelHydro";
+		case SealevelchangeGNsubelHydroEnum : return "SealevelchangeGNsubelHydro";
+		case SealevelchangeViscousRSLEnum : return "SealevelchangeViscousRSL";
+		case SealevelchangeViscousUEnum : return "SealevelchangeViscousU";
+		case SealevelchangeViscousNEnum : return "SealevelchangeViscousN";
+		case SealevelchangeViscousEEnum : return "SealevelchangeViscousE";
 		case SedimentHeadEnum : return "SedimentHead";
 		case SedimentHeadOldEnum : return "SedimentHeadOld";
@@ -749,9 +892,15 @@
 		case SmbAccumulatedMeltEnum : return "SmbAccumulatedMelt";
 		case SmbAccumulatedPrecipitationEnum : return "SmbAccumulatedPrecipitation";
+		case SmbAccumulatedRainEnum : return "SmbAccumulatedRain";
+		case SmbAccumulatedRefreezeEnum : return "SmbAccumulatedRefreeze";
 		case SmbAccumulatedRunoffEnum : return "SmbAccumulatedRunoff";
 		case SmbAEnum : return "SmbA";
+		case SmbAdiffEnum : return "SmbAdiff";
 		case SmbAValueEnum : return "SmbAValue";
 		case SmbAccumulationEnum : return "SmbAccumulation";
+		case SmbAdiffiniEnum : return "SmbAdiffini";
 		case SmbAiniEnum : return "SmbAini";
+		case SmbAutoregressionNoiseEnum : return "SmbAutoregressionNoise";
+		case SmbBasinsIdEnum : return "SmbBasinsId";
 		case SmbBMaxEnum : return "SmbBMax";
 		case SmbBMinEnum : return "SmbBMin";
@@ -759,4 +908,7 @@
 		case SmbBPosEnum : return "SmbBPos";
 		case SmbCEnum : return "SmbC";
+		case SmbCcsnowValueEnum : return "SmbCcsnowValue";
+		case SmbCciceValueEnum : return "SmbCciceValue";
+		case SmbCotValueEnum : return "SmbCotValue";
 		case SmbDEnum : return "SmbD";
 		case SmbDailyairdensityEnum : return "SmbDailyairdensity";
@@ -771,5 +923,7 @@
 		case SmbDiniEnum : return "SmbDini";
 		case SmbDlwrfEnum : return "SmbDlwrf";
+		case SmbDulwrfValueEnum : return "SmbDulwrfValue";
 		case SmbDswrfEnum : return "SmbDswrf";
+		case SmbDswdiffrfEnum : return "SmbDswdiffrf";
 		case SmbDzAddEnum : return "SmbDzAdd";
 		case SmbDzEnum : return "SmbDz";
@@ -791,5 +945,4 @@
 		case SmbIsInitializedEnum : return "SmbIsInitialized";
 		case SmbMAddEnum : return "SmbMAdd";
-		case SmbMassBalanceClimateEnum : return "SmbMassBalanceClimate";
 		case SmbMassBalanceEnum : return "SmbMassBalance";
 		case SmbMassBalanceSubstepEnum : return "SmbMassBalanceSubstep";
@@ -812,4 +965,5 @@
 		case SmbPrecipitationsPresentdayEnum : return "SmbPrecipitationsPresentday";
 		case SmbPrecipitationsReconstructedEnum : return "SmbPrecipitationsReconstructed";
+		case SmbRainEnum : return "SmbRain";
 		case SmbReEnum : return "SmbRe";
 		case SmbRefreezeEnum : return "SmbRefreeze";
@@ -824,4 +978,5 @@
 		case SmbSmbCorrEnum : return "SmbSmbCorr";
 		case SmbSmbrefEnum : return "SmbSmbref";
+		case SmbSzaValueEnum : return "SmbSzaValue";
 		case SmbTEnum : return "SmbT";
 		case SmbTaEnum : return "SmbTa";
@@ -834,4 +989,5 @@
 		case SmbTmeanEnum : return "SmbTmean";
 		case SmbTzEnum : return "SmbTz";
+		case SmbValuesAutoregressionEnum : return "SmbValuesAutoregression";
 		case SmbVEnum : return "SmbV";
 		case SmbVmeanEnum : return "SmbVmean";
@@ -844,4 +1000,9 @@
 		case SmbZTopEnum : return "SmbZTop";
 		case SmbZYEnum : return "SmbZY";
+		case SolidearthExternalDisplacementEastRateEnum : return "SolidearthExternalDisplacementEastRate";
+		case SolidearthExternalDisplacementNorthRateEnum : return "SolidearthExternalDisplacementNorthRate";
+		case SolidearthExternalDisplacementUpRateEnum : return "SolidearthExternalDisplacementUpRate";
+		case SolidearthExternalGeoidRateEnum : return "SolidearthExternalGeoidRate";
+		case StochasticForcingDefaultIdEnum : return "StochasticForcingDefaultId";
 		case StrainRateeffectiveEnum : return "StrainRateeffective";
 		case StrainRateparallelEnum : return "StrainRateparallel";
@@ -879,4 +1040,6 @@
 		case TemperaturePicardEnum : return "TemperaturePicard";
 		case TemperatureSEMICEnum : return "TemperatureSEMIC";
+		case ThermalforcingAutoregressionNoiseEnum : return "ThermalforcingAutoregressionNoise";
+		case ThermalforcingValuesAutoregressionEnum : return "ThermalforcingValuesAutoregression";
 		case ThermalSpctemperatureEnum : return "ThermalSpctemperature";
 		case ThicknessAbsGradientEnum : return "ThicknessAbsGradient";
@@ -888,13 +1051,20 @@
 		case ThicknessPositiveEnum : return "ThicknessPositive";
 		case ThicknessResidualEnum : return "ThicknessResidual";
+		case TransientAccumulatedDeltaIceThicknessEnum : return "TransientAccumulatedDeltaIceThickness";
 		case VelEnum : return "Vel";
 		case VxAverageEnum : return "VxAverage";
+		case VxBaseEnum : return "VxBase";
 		case VxEnum : return "Vx";
 		case VxMeshEnum : return "VxMesh";
 		case VxObsEnum : return "VxObs";
+		case VxShearEnum : return "VxShear";
+		case VxSurfaceEnum : return "VxSurface";
 		case VyAverageEnum : return "VyAverage";
+		case VyBaseEnum : return "VyBase";
 		case VyEnum : return "Vy";
 		case VyMeshEnum : return "VyMesh";
 		case VyObsEnum : return "VyObs";
+		case VyShearEnum : return "VyShear";
+		case VySurfaceEnum : return "VySurface";
 		case VzEnum : return "Vz";
 		case VzFSEnum : return "VzFS";
@@ -908,5 +1078,11 @@
 		case WaterfractionEnum : return "Waterfraction";
 		case WaterheightEnum : return "Waterheight";
+		case FrictionWaterPressureEnum : return "FrictionWaterPressure";
+		case FrictionWaterPressureNoiseEnum : return "FrictionWaterPressureNoise";
+		case WeightsLevelsetObservationEnum : return "WeightsLevelsetObservation";
 		case WeightsSurfaceObservationEnum : return "WeightsSurfaceObservation";
+		case OldAccumulatedDeltaBottomPressureEnum : return "OldAccumulatedDeltaBottomPressure";
+		case OldAccumulatedDeltaIceThicknessEnum : return "OldAccumulatedDeltaIceThickness";
+		case OldAccumulatedDeltaTwsEnum : return "OldAccumulatedDeltaTws";
 		case Outputdefinition1Enum : return "Outputdefinition1";
 		case Outputdefinition10Enum : return "Outputdefinition10";
@@ -1048,4 +1224,5 @@
 		case CfsurfacelogvelEnum : return "Cfsurfacelogvel";
 		case CfsurfacesquareEnum : return "Cfsurfacesquare";
+		case CflevelsetmisfitEnum : return "Cflevelsetmisfit";
 		case ChannelEnum : return "Channel";
 		case ChannelAreaEnum : return "ChannelArea";
@@ -1113,4 +1290,5 @@
 		case FrontalForcingsDefaultEnum : return "FrontalForcingsDefault";
 		case FrontalForcingsRignotEnum : return "FrontalForcingsRignot";
+		case FrontalForcingsRignotAutoregressionEnum : return "FrontalForcingsRignotAutoregression";
 		case FsetEnum : return "Fset";
 		case FullMeltOnPartiallyFloatingEnum : return "FullMeltOnPartiallyFloating";
@@ -1123,6 +1301,4 @@
 		case GenericParamEnum : return "GenericParam";
 		case GenericExternalResultEnum : return "GenericExternalResult";
-		case GiaAnalysisEnum : return "GiaAnalysis";
-		case GiaSolutionEnum : return "GiaSolution";
 		case Gradient1Enum : return "Gradient1";
 		case Gradient2Enum : return "Gradient2";
@@ -1244,4 +1420,6 @@
 		case NyeH2OEnum : return "NyeH2O";
 		case NumericalfluxEnum : return "Numericalflux";
+		case OceantransportAnalysisEnum : return "OceantransportAnalysis";
+		case OceantransportSolutionEnum : return "OceantransportSolution";
 		case OldGradientEnum : return "OldGradient";
 		case OneLayerP4zEnum : return "OneLayerP4z";
@@ -1278,5 +1456,8 @@
 		case RecoveryAnalysisEnum : return "RecoveryAnalysis";
 		case RiftfrontEnum : return "Riftfront";
+		case SamplingAnalysisEnum : return "SamplingAnalysis";
+		case SamplingSolutionEnum : return "SamplingSolution";
 		case SIAApproximationEnum : return "SIAApproximation";
+		case SMBautoregressionEnum : return "SMBautoregression";
 		case SMBcomponentsEnum : return "SMBcomponents";
 		case SMBd18opddEnum : return "SMBd18opdd";
@@ -1301,8 +1482,8 @@
 		case SealevelInertiaTensorYZEnum : return "SealevelInertiaTensorYZ";
 		case SealevelInertiaTensorZZEnum : return "SealevelInertiaTensorZZ";
+		case SealevelchangePolarMotionEnum : return "SealevelchangePolarMotion";
 		case SealevelNmotionEnum : return "SealevelNmotion";
 		case SealevelUmotionEnum : return "SealevelUmotion";
-		case SealevelriseAnalysisEnum : return "SealevelriseAnalysis";
-		case SealevelriseSolutionEnum : return "SealevelriseSolution";
+		case SealevelchangeAnalysisEnum : return "SealevelchangeAnalysis";
 		case SegEnum : return "Seg";
 		case SegInputEnum : return "SegInput";
Index: /issm/trunk/src/c/shared/Enum/Enumjl.vim
===================================================================
--- /issm/trunk/src/c/shared/Enum/Enumjl.vim	(revision 26744)
+++ /issm/trunk/src/c/shared/Enum/Enumjl.vim	(revision 26744)
@@ -0,0 +1,1561 @@
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" ISSM specific julia syntax highlighting
+"
+"   WARNING: DO NOT MODIFY THIS FILE
+"            this file has been automatically generated by Synchronize.sh
+"            Please read README for more information
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+"ISSM Enums
+syn keyword juliaConstC ParametersSTARTEnum
+syn keyword juliaConstC AdolcParamEnum
+syn keyword juliaConstC AmrDeviatoricErrorGroupThresholdEnum
+syn keyword juliaConstC AmrDeviatoricErrorMaximumEnum
+syn keyword juliaConstC AmrDeviatoricErrorResolutionEnum
+syn keyword juliaConstC AmrDeviatoricErrorThresholdEnum
+syn keyword juliaConstC AmrErrEnum
+syn keyword juliaConstC AmrFieldEnum
+syn keyword juliaConstC AmrGradationEnum
+syn keyword juliaConstC AmrGroundingLineDistanceEnum
+syn keyword juliaConstC AmrGroundingLineResolutionEnum
+syn keyword juliaConstC AmrHmaxEnum
+syn keyword juliaConstC AmrHminEnum
+syn keyword juliaConstC AmrIceFrontDistanceEnum
+syn keyword juliaConstC AmrIceFrontResolutionEnum
+syn keyword juliaConstC AmrKeepMetricEnum
+syn keyword juliaConstC AmrLagEnum
+syn keyword juliaConstC AmrLevelMaxEnum
+syn keyword juliaConstC AmrRestartEnum
+syn keyword juliaConstC AmrThicknessErrorGroupThresholdEnum
+syn keyword juliaConstC AmrThicknessErrorMaximumEnum
+syn keyword juliaConstC AmrThicknessErrorResolutionEnum
+syn keyword juliaConstC AmrThicknessErrorThresholdEnum
+syn keyword juliaConstC AmrTypeEnum
+syn keyword juliaConstC AnalysisCounterEnum
+syn keyword juliaConstC AnalysisTypeEnum
+syn keyword juliaConstC AugmentedLagrangianREnum
+syn keyword juliaConstC AugmentedLagrangianRholambdaEnum
+syn keyword juliaConstC AugmentedLagrangianRhopEnum
+syn keyword juliaConstC AugmentedLagrangianRlambdaEnum
+syn keyword juliaConstC AugmentedLagrangianThetaEnum
+syn keyword juliaConstC AutodiffCbufsizeEnum
+syn keyword juliaConstC AutodiffDependentObjectsEnum
+syn keyword juliaConstC AutodiffDriverEnum
+syn keyword juliaConstC AutodiffFosForwardIndexEnum
+syn keyword juliaConstC AutodiffFosReverseIndexEnum
+syn keyword juliaConstC AutodiffFovForwardIndicesEnum
+syn keyword juliaConstC AutodiffGcTriggerMaxSizeEnum
+syn keyword juliaConstC AutodiffGcTriggerRatioEnum
+syn keyword juliaConstC AutodiffIsautodiffEnum
+syn keyword juliaConstC AutodiffLbufsizeEnum
+syn keyword juliaConstC AutodiffNumDependentsEnum
+syn keyword juliaConstC AutodiffNumIndependentsEnum
+syn keyword juliaConstC AutodiffObufsizeEnum
+syn keyword juliaConstC AutodiffTapeAllocEnum
+syn keyword juliaConstC AutodiffTbufsizeEnum
+syn keyword juliaConstC AutodiffXpEnum
+syn keyword juliaConstC BalancethicknessStabilizationEnum
+syn keyword juliaConstC BarystaticContributionsEnum
+syn keyword juliaConstC BasalforcingsBottomplumedepthEnum
+syn keyword juliaConstC BasalforcingsCrustthicknessEnum
+syn keyword juliaConstC BasalforcingsDeepwaterElevationEnum
+syn keyword juliaConstC BasalforcingsDeepwaterMeltingRateEnum
+syn keyword juliaConstC BasalforcingsDtbgEnum
+syn keyword juliaConstC BasalforcingsEnum
+syn keyword juliaConstC BasalforcingsIsmip6AverageTfEnum
+syn keyword juliaConstC BasalforcingsIsmip6BasinAreaEnum
+syn keyword juliaConstC BasalforcingsIsmip6DeltaTEnum
+syn keyword juliaConstC BasalforcingsIsmip6Gamma0Enum
+syn keyword juliaConstC BasalforcingsIsmip6IsLocalEnum
+syn keyword juliaConstC BasalforcingsIsmip6NumBasinsEnum
+syn keyword juliaConstC BasalforcingsIsmip6TfDepthsEnum
+syn keyword juliaConstC BasalforcingsLowercrustheatEnum
+syn keyword juliaConstC BasalforcingsMantleconductivityEnum
+syn keyword juliaConstC BasalforcingsNusseltEnum
+syn keyword juliaConstC BasalforcingsPicoAverageOverturningEnum
+syn keyword juliaConstC BasalforcingsPicoAverageSalinityEnum
+syn keyword juliaConstC BasalforcingsPicoAverageTemperatureEnum
+syn keyword juliaConstC BasalforcingsPicoBoxAreaEnum
+syn keyword juliaConstC BasalforcingsPicoFarOceansalinityEnum
+syn keyword juliaConstC BasalforcingsPicoFarOceantemperatureEnum
+syn keyword juliaConstC BasalforcingsPicoGammaTEnum
+syn keyword juliaConstC BasalforcingsPicoIsplumeEnum
+syn keyword juliaConstC BasalforcingsPicoMaxboxcountEnum
+syn keyword juliaConstC BasalforcingsPicoNumBasinsEnum
+syn keyword juliaConstC BasalforcingsPlumeradiusEnum
+syn keyword juliaConstC BasalforcingsPlumexEnum
+syn keyword juliaConstC BasalforcingsPlumeyEnum
+syn keyword juliaConstC BasalforcingsThresholdThicknessEnum
+syn keyword juliaConstC BasalforcingsTopplumedepthEnum
+syn keyword juliaConstC BasalforcingsUppercrustheatEnum
+syn keyword juliaConstC BasalforcingsUppercrustthicknessEnum
+syn keyword juliaConstC BasalforcingsUpperdepthMeltEnum
+syn keyword juliaConstC BasalforcingsUpperwaterElevationEnum
+syn keyword juliaConstC BasalforcingsUpperwaterMeltingRateEnum
+syn keyword juliaConstC CalvingCrevasseDepthEnum
+syn keyword juliaConstC CalvingCrevasseThresholdEnum
+syn keyword juliaConstC CalvingHeightAboveFloatationEnum
+syn keyword juliaConstC CalvingLawEnum
+syn keyword juliaConstC CalvingMinthicknessEnum
+syn keyword juliaConstC ConfigurationTypeEnum
+syn keyword juliaConstC ConstantsGEnum
+syn keyword juliaConstC ConstantsNewtonGravityEnum
+syn keyword juliaConstC ConstantsReferencetemperatureEnum
+syn keyword juliaConstC ConstantsYtsEnum
+syn keyword juliaConstC ControlInputSizeMEnum
+syn keyword juliaConstC ControlInputSizeNEnum
+syn keyword juliaConstC ControlInputInterpolationEnum
+syn keyword juliaConstC CumBslcEnum
+syn keyword juliaConstC CumBslcIceEnum
+syn keyword juliaConstC CumBslcHydroEnum
+syn keyword juliaConstC CumBslcOceanEnum
+syn keyword juliaConstC CumBslcIcePartitionEnum
+syn keyword juliaConstC CumBslcHydroPartitionEnum
+syn keyword juliaConstC CumBslcOceanPartitionEnum
+syn keyword juliaConstC CumGmtslcEnum
+syn keyword juliaConstC CumGmslcEnum
+syn keyword juliaConstC DamageC1Enum
+syn keyword juliaConstC DamageC2Enum
+syn keyword juliaConstC DamageC3Enum
+syn keyword juliaConstC DamageC4Enum
+syn keyword juliaConstC DamageEnum
+syn keyword juliaConstC DamageEquivStressEnum
+syn keyword juliaConstC DamageEvolutionNumRequestedOutputsEnum
+syn keyword juliaConstC DamageEvolutionRequestedOutputsEnum
+syn keyword juliaConstC DamageHealingEnum
+syn keyword juliaConstC DamageKappaEnum
+syn keyword juliaConstC DamageLawEnum
+syn keyword juliaConstC DamageMaxDamageEnum
+syn keyword juliaConstC DamageStabilizationEnum
+syn keyword juliaConstC DamageStressThresholdEnum
+syn keyword juliaConstC DamageStressUBoundEnum
+syn keyword juliaConstC DebugProfilingEnum
+syn keyword juliaConstC DomainDimensionEnum
+syn keyword juliaConstC DomainTypeEnum
+syn keyword juliaConstC DslModelEnum
+syn keyword juliaConstC DslModelidEnum
+syn keyword juliaConstC DslNummodelsEnum
+syn keyword juliaConstC SolidearthIsExternalEnum
+syn keyword juliaConstC SolidearthExternalNatureEnum
+syn keyword juliaConstC SolidearthExternalModelidEnum
+syn keyword juliaConstC SolidearthExternalNummodelsEnum
+syn keyword juliaConstC SolidearthSettingsComputeBpGrdEnum
+syn keyword juliaConstC EarthIdEnum
+syn keyword juliaConstC ElasticEnum
+syn keyword juliaConstC EplZigZagCounterEnum
+syn keyword juliaConstC EsaHElasticEnum
+syn keyword juliaConstC EsaHemisphereEnum
+syn keyword juliaConstC EsaRequestedOutputsEnum
+syn keyword juliaConstC EsaUElasticEnum
+syn keyword juliaConstC ExtrapolationVariableEnum
+syn keyword juliaConstC FemModelCommEnum
+syn keyword juliaConstC FieldsEnum
+syn keyword juliaConstC FlowequationFeFSEnum
+syn keyword juliaConstC FlowequationIsFSEnum
+syn keyword juliaConstC FlowequationIsHOEnum
+syn keyword juliaConstC FlowequationIsL1L2Enum
+syn keyword juliaConstC FlowequationIsMLHOEnum
+syn keyword juliaConstC FlowequationIsSIAEnum
+syn keyword juliaConstC FlowequationIsSSAEnum
+syn keyword juliaConstC FlowequationIsNitscheEnum
+syn keyword juliaConstC FeFSNitscheGammaEnum
+syn keyword juliaConstC FrictionCouplingEnum
+syn keyword juliaConstC FrictionDeltaEnum
+syn keyword juliaConstC FrictionEffectivePressureLimitEnum
+syn keyword juliaConstC FrictionFEnum
+syn keyword juliaConstC FrictionGammaEnum
+syn keyword juliaConstC FrictionLawEnum
+syn keyword juliaConstC FrictionPseudoplasticityExponentEnum
+syn keyword juliaConstC FrictionThresholdSpeedEnum
+syn keyword juliaConstC FrictionVoidRatioEnum
+syn keyword juliaConstC FrontalForcingsBasinIcefrontAreaEnum
+syn keyword juliaConstC FrontalForcingsAutoregressionInitialTimeEnum
+syn keyword juliaConstC FrontalForcingsAutoregressionTimestepEnum
+syn keyword juliaConstC FrontalForcingsAutoregressiveOrderEnum
+syn keyword juliaConstC FrontalForcingsBeta0Enum
+syn keyword juliaConstC FrontalForcingsBeta1Enum
+syn keyword juliaConstC FrontalForcingsNumberofBasinsEnum
+syn keyword juliaConstC FrontalForcingsParamEnum
+syn keyword juliaConstC FrontalForcingsPhiEnum
+syn keyword juliaConstC GrdModelEnum
+syn keyword juliaConstC GroundinglineFrictionInterpolationEnum
+syn keyword juliaConstC GroundinglineMeltInterpolationEnum
+syn keyword juliaConstC GroundinglineMigrationEnum
+syn keyword juliaConstC HydrologyAveragingEnum
+syn keyword juliaConstC HydrologyCavitySpacingEnum
+syn keyword juliaConstC HydrologyChannelConductivityEnum
+syn keyword juliaConstC HydrologyChannelSheetWidthEnum
+syn keyword juliaConstC HydrologyEnglacialVoidRatioEnum
+syn keyword juliaConstC HydrologyIschannelsEnum
+syn keyword juliaConstC HydrologyMeltFlagEnum
+syn keyword juliaConstC HydrologyModelEnum
+syn keyword juliaConstC HydrologyNumRequestedOutputsEnum
+syn keyword juliaConstC HydrologyPressureMeltCoefficientEnum
+syn keyword juliaConstC HydrologyRelaxationEnum
+syn keyword juliaConstC HydrologyRequestedOutputsEnum
+syn keyword juliaConstC HydrologySedimentKmaxEnum
+syn keyword juliaConstC HydrologyStepsPerStepEnum
+syn keyword juliaConstC HydrologyStorageEnum
+syn keyword juliaConstC HydrologydcEplColapseThicknessEnum
+syn keyword juliaConstC HydrologydcEplConductivityEnum
+syn keyword juliaConstC HydrologydcEplInitialThicknessEnum
+syn keyword juliaConstC HydrologydcEplLayerCompressibilityEnum
+syn keyword juliaConstC HydrologydcEplMaxThicknessEnum
+syn keyword juliaConstC HydrologydcEplPoreWaterMassEnum
+syn keyword juliaConstC HydrologydcEplThickCompEnum
+syn keyword juliaConstC HydrologydcEplflipLockEnum
+syn keyword juliaConstC HydrologydcIsefficientlayerEnum
+syn keyword juliaConstC HydrologydcLeakageFactorEnum
+syn keyword juliaConstC HydrologydcMaxIterEnum
+syn keyword juliaConstC HydrologydcPenaltyFactorEnum
+syn keyword juliaConstC HydrologydcPenaltyLockEnum
+syn keyword juliaConstC HydrologydcRelTolEnum
+syn keyword juliaConstC HydrologydcSedimentlimitEnum
+syn keyword juliaConstC HydrologydcSedimentlimitFlagEnum
+syn keyword juliaConstC HydrologydcSedimentLayerCompressibilityEnum
+syn keyword juliaConstC HydrologydcSedimentPoreWaterMassEnum
+syn keyword juliaConstC HydrologydcSedimentPorosityEnum
+syn keyword juliaConstC HydrologydcSedimentThicknessEnum
+syn keyword juliaConstC HydrologydcTransferFlagEnum
+syn keyword juliaConstC HydrologydcUnconfinedFlagEnum
+syn keyword juliaConstC HydrologyshreveStabilizationEnum
+syn keyword juliaConstC IcecapToEarthCommEnum
+syn keyword juliaConstC IndexEnum
+syn keyword juliaConstC InputFileNameEnum
+syn keyword juliaConstC DirectoryNameEnum
+syn keyword juliaConstC IndicesEnum
+syn keyword juliaConstC InputToDepthaverageInEnum
+syn keyword juliaConstC InputToDepthaverageOutEnum
+syn keyword juliaConstC InputToExtrudeEnum
+syn keyword juliaConstC InputToL2ProjectEnum
+syn keyword juliaConstC InputToSmoothEnum
+syn keyword juliaConstC InversionAlgorithmEnum
+syn keyword juliaConstC InversionControlParametersEnum
+syn keyword juliaConstC InversionControlScalingFactorsEnum
+syn keyword juliaConstC InversionCostFunctionsEnum
+syn keyword juliaConstC InversionDxminEnum
+syn keyword juliaConstC InversionGatolEnum
+syn keyword juliaConstC InversionGradientScalingEnum
+syn keyword juliaConstC InversionGrtolEnum
+syn keyword juliaConstC InversionGttolEnum
+syn keyword juliaConstC InversionIncompleteAdjointEnum
+syn keyword juliaConstC InversionIscontrolEnum
+syn keyword juliaConstC InversionMaxiterEnum
+syn keyword juliaConstC InversionMaxiterPerStepEnum
+syn keyword juliaConstC InversionMaxstepsEnum
+syn keyword juliaConstC InversionNstepsEnum
+syn keyword juliaConstC InversionNumControlParametersEnum
+syn keyword juliaConstC InversionNumCostFunctionsEnum
+syn keyword juliaConstC InversionStepThresholdEnum
+syn keyword juliaConstC InversionTypeEnum
+syn keyword juliaConstC IvinsEnum
+syn keyword juliaConstC IsSlcCouplingEnum
+syn keyword juliaConstC LevelsetKillIcebergsEnum
+syn keyword juliaConstC LevelsetReinitFrequencyEnum
+syn keyword juliaConstC LevelsetStabilizationEnum
+syn keyword juliaConstC LockFileNameEnum
+syn keyword juliaConstC LoveAllowLayerDeletionEnum
+syn keyword juliaConstC LoveCoreMantleBoundaryEnum
+syn keyword juliaConstC LoveEarthMassEnum
+syn keyword juliaConstC LoveForcingTypeEnum
+syn keyword juliaConstC LoveFrequenciesEnum
+syn keyword juliaConstC LoveIsTemporalEnum
+syn keyword juliaConstC LoveG0Enum
+syn keyword juliaConstC LoveGravitationalConstantEnum
+syn keyword juliaConstC LoveInnerCoreBoundaryEnum
+syn keyword juliaConstC LoveComplexComputationEnum
+syn keyword juliaConstC LoveIntStepsPerLayerEnum
+syn keyword juliaConstC LoveKernelsEnum
+syn keyword juliaConstC LoveMu0Enum
+syn keyword juliaConstC LoveNfreqEnum
+syn keyword juliaConstC LoveNTemporalIterationsEnum
+syn keyword juliaConstC LoveNYiEquationsEnum
+syn keyword juliaConstC LoveR0Enum
+syn keyword juliaConstC LoveShNmaxEnum
+syn keyword juliaConstC LoveShNminEnum
+syn keyword juliaConstC LoveStartingLayerEnum
+syn keyword juliaConstC LoveUnderflowTolEnum
+syn keyword juliaConstC MassFluxSegmentsEnum
+syn keyword juliaConstC MassFluxSegmentsPresentEnum
+syn keyword juliaConstC MasstransportHydrostaticAdjustmentEnum
+syn keyword juliaConstC MasstransportIsfreesurfaceEnum
+syn keyword juliaConstC MasstransportMinThicknessEnum
+syn keyword juliaConstC MasstransportNumRequestedOutputsEnum
+syn keyword juliaConstC MasstransportPenaltyFactorEnum
+syn keyword juliaConstC MasstransportRequestedOutputsEnum
+syn keyword juliaConstC MasstransportStabilizationEnum
+syn keyword juliaConstC MaterialsBetaEnum
+syn keyword juliaConstC MaterialsEarthDensityEnum
+syn keyword juliaConstC MaterialsEffectiveconductivityAveragingEnum
+syn keyword juliaConstC MaterialsHeatcapacityEnum
+syn keyword juliaConstC MaterialsLatentheatEnum
+syn keyword juliaConstC MaterialsMeltingpointEnum
+syn keyword juliaConstC MaterialsMixedLayerCapacityEnum
+syn keyword juliaConstC MaterialsMuWaterEnum
+syn keyword juliaConstC MaterialsRheologyLawEnum
+syn keyword juliaConstC MaterialsRhoFreshwaterEnum
+syn keyword juliaConstC MaterialsRhoIceEnum
+syn keyword juliaConstC MaterialsRhoSeawaterEnum
+syn keyword juliaConstC MaterialsTemperateiceconductivityEnum
+syn keyword juliaConstC MaterialsThermalExchangeVelocityEnum
+syn keyword juliaConstC MaterialsThermalconductivityEnum
+syn keyword juliaConstC MeltingOffsetEnum
+syn keyword juliaConstC MeshAverageVertexConnectivityEnum
+syn keyword juliaConstC MeshElementtypeEnum
+syn keyword juliaConstC MeshNumberoflayersEnum
+syn keyword juliaConstC MeshNumberofverticesEnum
+syn keyword juliaConstC MeshNumberofelementsEnum
+syn keyword juliaConstC MigrationMaxEnum
+syn keyword juliaConstC ModelIdEnum
+syn keyword juliaConstC NbinsEnum
+syn keyword juliaConstC NodesEnum
+syn keyword juliaConstC NumModelsEnum
+syn keyword juliaConstC OceanGridNxEnum
+syn keyword juliaConstC OceanGridNyEnum
+syn keyword juliaConstC OceanGridXEnum
+syn keyword juliaConstC OceanGridYEnum
+syn keyword juliaConstC OutputBufferPointerEnum
+syn keyword juliaConstC OutputBufferSizePointerEnum
+syn keyword juliaConstC OutputFileNameEnum
+syn keyword juliaConstC OutputFilePointerEnum
+syn keyword juliaConstC OutputdefinitionEnum
+syn keyword juliaConstC QmuErrNameEnum
+syn keyword juliaConstC QmuInNameEnum
+syn keyword juliaConstC QmuIsdakotaEnum
+syn keyword juliaConstC QmuOutNameEnum
+syn keyword juliaConstC QmuOutputEnum
+syn keyword juliaConstC QmuCurrEvalIdEnum
+syn keyword juliaConstC QmuNsampleEnum
+syn keyword juliaConstC QmuResponsedescriptorsEnum
+syn keyword juliaConstC QmuVariableDescriptorsEnum
+syn keyword juliaConstC QmuVariablePartitionsEnum
+syn keyword juliaConstC QmuVariablePartitionsNpartEnum
+syn keyword juliaConstC QmuVariablePartitionsNtEnum
+syn keyword juliaConstC QmuResponsePartitionsEnum
+syn keyword juliaConstC QmuResponsePartitionsNpartEnum
+syn keyword juliaConstC QmuStatisticsEnum
+syn keyword juliaConstC QmuNumstatisticsEnum
+syn keyword juliaConstC QmuNdirectoriesEnum
+syn keyword juliaConstC QmuNfilesPerDirectoryEnum
+syn keyword juliaConstC QmuStatisticsMethodEnum
+syn keyword juliaConstC QmuMethodsEnum
+syn keyword juliaConstC RestartFileNameEnum
+syn keyword juliaConstC ResultsEnum
+syn keyword juliaConstC RootPathEnum
+syn keyword juliaConstC ModelnameEnum
+syn keyword juliaConstC SamplingAlphaEnum
+syn keyword juliaConstC SamplingPhiEnum
+syn keyword juliaConstC SamplingNumRequestedOutputsEnum
+syn keyword juliaConstC SamplingRequestedOutputsEnum
+syn keyword juliaConstC SamplingRobinEnum
+syn keyword juliaConstC SamplingSeedEnum
+syn keyword juliaConstC SamplingTauEnum
+syn keyword juliaConstC SaveResultsEnum
+syn keyword juliaConstC SolidearthPartitionIceEnum
+syn keyword juliaConstC SolidearthPartitionHydroEnum
+syn keyword juliaConstC SolidearthPartitionOceanEnum
+syn keyword juliaConstC SolidearthNpartIceEnum
+syn keyword juliaConstC SolidearthNpartOceanEnum
+syn keyword juliaConstC SolidearthNpartHydroEnum
+syn keyword juliaConstC SolidearthPlanetRadiusEnum
+syn keyword juliaConstC SolidearthPlanetAreaEnum
+syn keyword juliaConstC SolidearthSettingsAbstolEnum
+syn keyword juliaConstC SolidearthSettingsCrossSectionShapeEnum
+syn keyword juliaConstC RotationalAngularVelocityEnum
+syn keyword juliaConstC SolidearthSettingsElasticEnum
+syn keyword juliaConstC SolidearthSettingsViscousEnum
+syn keyword juliaConstC SealevelchangeGeometryDoneEnum
+syn keyword juliaConstC SealevelchangeViscousNumStepsEnum
+syn keyword juliaConstC SealevelchangeViscousTimesEnum
+syn keyword juliaConstC SealevelchangeViscousIndexEnum
+syn keyword juliaConstC RotationalEquatorialMoiEnum
+syn keyword juliaConstC TidalLoveHEnum
+syn keyword juliaConstC TidalLoveKEnum
+syn keyword juliaConstC TidalLoveLEnum
+syn keyword juliaConstC TidalLoveK2SecularEnum
+syn keyword juliaConstC LoadLoveHEnum
+syn keyword juliaConstC LoadLoveKEnum
+syn keyword juliaConstC LoadLoveLEnum
+syn keyword juliaConstC LoveTimeFreqEnum
+syn keyword juliaConstC LoveIsTimeEnum
+syn keyword juliaConstC SealevelchangeGSelfAttractionEnum
+syn keyword juliaConstC SealevelchangeGViscoElasticEnum
+syn keyword juliaConstC SolidearthSettingsSealevelLoadingEnum
+syn keyword juliaConstC SolidearthSettingsGRDEnum
+syn keyword juliaConstC SolidearthSettingsRunFrequencyEnum
+syn keyword juliaConstC SolidearthSettingsTimeAccEnum
+syn keyword juliaConstC SealevelchangeHViscoElasticEnum
+syn keyword juliaConstC SolidearthSettingsHorizEnum
+syn keyword juliaConstC SolidearthSettingsMaxiterEnum
+syn keyword juliaConstC SolidearthSettingsGrdOceanEnum
+syn keyword juliaConstC SolidearthSettingsOceanAreaScalingEnum
+syn keyword juliaConstC StochasticForcingCovarianceEnum
+syn keyword juliaConstC StochasticForcingDefaultDimensionEnum
+syn keyword juliaConstC StochasticForcingDimensionsEnum
+syn keyword juliaConstC StochasticForcingFieldsEnum
+syn keyword juliaConstC StochasticForcingIsEffectivePressureEnum
+syn keyword juliaConstC StochasticForcingIsStochasticForcingEnum
+syn keyword juliaConstC StochasticForcingIsWaterPressureEnum
+syn keyword juliaConstC StochasticForcingNumFieldsEnum
+syn keyword juliaConstC StochasticForcingRandomflagEnum
+syn keyword juliaConstC RotationalPolarMoiEnum
+syn keyword juliaConstC SolidearthSettingsReltolEnum
+syn keyword juliaConstC SealevelchangeRequestedOutputsEnum
+syn keyword juliaConstC SolidearthSettingsSelfAttractionEnum
+syn keyword juliaConstC SolidearthSettingsRotationEnum
+syn keyword juliaConstC SolidearthSettingsMaxSHCoeffEnum
+syn keyword juliaConstC SealevelchangeRunCountEnum
+syn keyword juliaConstC SealevelchangeTransitionsEnum
+syn keyword juliaConstC SealevelchangeUViscoElasticEnum
+syn keyword juliaConstC SettingsIoGatherEnum
+syn keyword juliaConstC SettingsNumResultsOnNodesEnum
+syn keyword juliaConstC SettingsOutputFrequencyEnum
+syn keyword juliaConstC SettingsCheckpointFrequencyEnum
+syn keyword juliaConstC SettingsResultsOnNodesEnum
+syn keyword juliaConstC SettingsSbCouplingFrequencyEnum
+syn keyword juliaConstC SettingsSolverResidueThresholdEnum
+syn keyword juliaConstC SettingsWaitonlockEnum
+syn keyword juliaConstC SmbAIceEnum
+syn keyword juliaConstC SmbAIdxEnum
+syn keyword juliaConstC SmbASnowEnum
+syn keyword juliaConstC SmbAccualtiEnum
+syn keyword juliaConstC SmbAccugradEnum
+syn keyword juliaConstC SmbAccurefEnum
+syn keyword juliaConstC SmbAdThreshEnum
+syn keyword juliaConstC SmbAutoregressionInitialTimeEnum
+syn keyword juliaConstC SmbAutoregressionTimestepEnum
+syn keyword juliaConstC SmbAutoregressiveOrderEnum
+syn keyword juliaConstC SmbAveragingEnum
+syn keyword juliaConstC SmbBeta0Enum
+syn keyword juliaConstC SmbBeta1Enum
+syn keyword juliaConstC SmbDesfacEnum
+syn keyword juliaConstC SmbDpermilEnum
+syn keyword juliaConstC SmbDsnowIdxEnum
+syn keyword juliaConstC SmbCldFracEnum
+syn keyword juliaConstC SmbDelta18oEnum
+syn keyword juliaConstC SmbDelta18oSurfaceEnum
+syn keyword juliaConstC SmbDenIdxEnum
+syn keyword juliaConstC SmbDtEnum
+syn keyword juliaConstC SmbEnum
+syn keyword juliaConstC SmbEIdxEnum
+syn keyword juliaConstC SmbFEnum
+syn keyword juliaConstC SmbInitDensityScalingEnum
+syn keyword juliaConstC SmbIsaccumulationEnum
+syn keyword juliaConstC SmbIsalbedoEnum
+syn keyword juliaConstC SmbIsconstrainsurfaceTEnum
+syn keyword juliaConstC SmbIsd18opdEnum
+syn keyword juliaConstC SmbIsdelta18oEnum
+syn keyword juliaConstC SmbIsdensificationEnum
+syn keyword juliaConstC SmbIsdeltaLWupEnum
+syn keyword juliaConstC SmbIsfirnwarmingEnum
+syn keyword juliaConstC SmbIsgraingrowthEnum
+syn keyword juliaConstC SmbIsmeltEnum
+syn keyword juliaConstC SmbIsmungsmEnum
+syn keyword juliaConstC SmbIsprecipscaledEnum
+syn keyword juliaConstC SmbIssetpddfacEnum
+syn keyword juliaConstC SmbIsshortwaveEnum
+syn keyword juliaConstC SmbIstemperaturescaledEnum
+syn keyword juliaConstC SmbIsthermalEnum
+syn keyword juliaConstC SmbIsturbulentfluxEnum
+syn keyword juliaConstC SmbKEnum
+syn keyword juliaConstC SmbNumBasinsEnum
+syn keyword juliaConstC SmbNumRequestedOutputsEnum
+syn keyword juliaConstC SmbPfacEnum
+syn keyword juliaConstC SmbPhiEnum
+syn keyword juliaConstC SmbRdlEnum
+syn keyword juliaConstC SmbRequestedOutputsEnum
+syn keyword juliaConstC SmbRlapsEnum
+syn keyword juliaConstC SmbRlapslgmEnum
+syn keyword juliaConstC SmbRunoffaltiEnum
+syn keyword juliaConstC SmbRunoffgradEnum
+syn keyword juliaConstC SmbRunoffrefEnum
+syn keyword juliaConstC SmbSealevEnum
+syn keyword juliaConstC SmbStepsPerStepEnum
+syn keyword juliaConstC SmbSwIdxEnum
+syn keyword juliaConstC SmbT0dryEnum
+syn keyword juliaConstC SmbT0wetEnum
+syn keyword juliaConstC SmbTeThreshEnum
+syn keyword juliaConstC SmbTdiffEnum
+syn keyword juliaConstC SmbThermoDeltaTScalingEnum
+syn keyword juliaConstC SmbTemperaturesReconstructedYearsEnum
+syn keyword juliaConstC SmbPrecipitationsReconstructedYearsEnum
+syn keyword juliaConstC SmoothThicknessMultiplierEnum
+syn keyword juliaConstC SolutionTypeEnum
+syn keyword juliaConstC SteadystateMaxiterEnum
+syn keyword juliaConstC SteadystateNumRequestedOutputsEnum
+syn keyword juliaConstC SteadystateReltolEnum
+syn keyword juliaConstC SteadystateRequestedOutputsEnum
+syn keyword juliaConstC StepEnum
+syn keyword juliaConstC StepsEnum
+syn keyword juliaConstC StressbalanceAbstolEnum
+syn keyword juliaConstC StressbalanceFSreconditioningEnum
+syn keyword juliaConstC StressbalanceIsnewtonEnum
+syn keyword juliaConstC StressbalanceMaxiterEnum
+syn keyword juliaConstC StressbalanceNumRequestedOutputsEnum
+syn keyword juliaConstC StressbalancePenaltyFactorEnum
+syn keyword juliaConstC StressbalanceReltolEnum
+syn keyword juliaConstC StressbalanceRequestedOutputsEnum
+syn keyword juliaConstC StressbalanceRestolEnum
+syn keyword juliaConstC StressbalanceRiftPenaltyThresholdEnum
+syn keyword juliaConstC StressbalanceShelfDampeningEnum
+syn keyword juliaConstC ThermalIsdrainicecolumnEnum
+syn keyword juliaConstC ThermalIsdynamicbasalspcEnum
+syn keyword juliaConstC ThermalIsenthalpyEnum
+syn keyword juliaConstC ThermalMaxiterEnum
+syn keyword juliaConstC ThermalNumRequestedOutputsEnum
+syn keyword juliaConstC ThermalPenaltyFactorEnum
+syn keyword juliaConstC ThermalPenaltyLockEnum
+syn keyword juliaConstC ThermalPenaltyThresholdEnum
+syn keyword juliaConstC ThermalReltolEnum
+syn keyword juliaConstC ThermalRequestedOutputsEnum
+syn keyword juliaConstC ThermalStabilizationEnum
+syn keyword juliaConstC ThermalWatercolumnUpperlimitEnum
+syn keyword juliaConstC TimeEnum
+syn keyword juliaConstC TimesteppingCflCoefficientEnum
+syn keyword juliaConstC TimesteppingCouplingTimeEnum
+syn keyword juliaConstC TimesteppingFinalTimeEnum
+syn keyword juliaConstC TimesteppingInterpForcingEnum
+syn keyword juliaConstC TimesteppingCycleForcingEnum
+syn keyword juliaConstC TimesteppingStartTimeEnum
+syn keyword juliaConstC TimesteppingTimeStepEnum
+syn keyword juliaConstC TimesteppingTimeStepMaxEnum
+syn keyword juliaConstC TimesteppingTimeStepMinEnum
+syn keyword juliaConstC TimesteppingTypeEnum
+syn keyword juliaConstC ToMITgcmCommEnum
+syn keyword juliaConstC ToolkitsFileNameEnum
+syn keyword juliaConstC ToolkitsOptionsAnalysesEnum
+syn keyword juliaConstC ToolkitsOptionsStringsEnum
+syn keyword juliaConstC ToolkitsTypesEnum
+syn keyword juliaConstC TransientAmrFrequencyEnum
+syn keyword juliaConstC TransientIsdamageevolutionEnum
+syn keyword juliaConstC TransientIsesaEnum
+syn keyword juliaConstC TransientIsgiaEnum
+syn keyword juliaConstC TransientIsgroundinglineEnum
+syn keyword juliaConstC TransientIshydrologyEnum
+syn keyword juliaConstC TransientIsmasstransportEnum
+syn keyword juliaConstC TransientIsoceantransportEnum
+syn keyword juliaConstC TransientIsmovingfrontEnum
+syn keyword juliaConstC TransientIsoceancouplingEnum
+syn keyword juliaConstC TransientIssamplingEnum
+syn keyword juliaConstC TransientIsslcEnum
+syn keyword juliaConstC TransientIssmbEnum
+syn keyword juliaConstC TransientIsstressbalanceEnum
+syn keyword juliaConstC TransientIsthermalEnum
+syn keyword juliaConstC TransientNumRequestedOutputsEnum
+syn keyword juliaConstC TransientRequestedOutputsEnum
+syn keyword juliaConstC VelocityEnum
+syn keyword juliaConstC XxeEnum
+syn keyword juliaConstC YyeEnum
+syn keyword juliaConstC ZzeEnum
+syn keyword juliaConstC AreaeEnum
+syn keyword juliaConstC WorldCommEnum
+syn keyword juliaConstC ParametersENDEnum
+syn keyword juliaConstC InputsSTARTEnum
+syn keyword juliaConstC AccumulatedDeltaBottomPressureEnum
+syn keyword juliaConstC AccumulatedDeltaIceThicknessEnum
+syn keyword juliaConstC AccumulatedDeltaTwsEnum
+syn keyword juliaConstC AdjointEnum
+syn keyword juliaConstC AdjointpEnum
+syn keyword juliaConstC AdjointxEnum
+syn keyword juliaConstC AdjointxBaseEnum
+syn keyword juliaConstC AdjointxShearEnum
+syn keyword juliaConstC AdjointyEnum
+syn keyword juliaConstC AdjointyBaseEnum
+syn keyword juliaConstC AdjointyShearEnum
+syn keyword juliaConstC AdjointzEnum
+syn keyword juliaConstC AirEnum
+syn keyword juliaConstC ApproximationEnum
+syn keyword juliaConstC BalancethicknessMisfitEnum
+syn keyword juliaConstC BalancethicknessOmega0Enum
+syn keyword juliaConstC BalancethicknessOmegaEnum
+syn keyword juliaConstC BalancethicknessSpcthicknessEnum
+syn keyword juliaConstC BalancethicknessThickeningRateEnum
+syn keyword juliaConstC BasalCrevasseEnum
+syn keyword juliaConstC BasalforcingsFloatingiceMeltingRateEnum
+syn keyword juliaConstC BasalforcingsGeothermalfluxEnum
+syn keyword juliaConstC BasalforcingsGroundediceMeltingRateEnum
+syn keyword juliaConstC BasalforcingsPerturbationMeltingRateEnum
+syn keyword juliaConstC BasalforcingsIsmip6BasinIdEnum
+syn keyword juliaConstC BasalforcingsIsmip6TfEnum
+syn keyword juliaConstC BasalforcingsIsmip6TfShelfEnum
+syn keyword juliaConstC BasalforcingsIsmip6MeltAnomalyEnum
+syn keyword juliaConstC BasalforcingsMeltrateFactorEnum
+syn keyword juliaConstC BasalforcingsOceanSalinityEnum
+syn keyword juliaConstC BasalforcingsOceanTempEnum
+syn keyword juliaConstC BasalforcingsPicoBasinIdEnum
+syn keyword juliaConstC BasalforcingsPicoBoxIdEnum
+syn keyword juliaConstC BasalforcingsPicoOverturningCoeffEnum
+syn keyword juliaConstC BasalforcingsPicoSubShelfOceanOverturningEnum
+syn keyword juliaConstC BasalforcingsPicoSubShelfOceanSalinityEnum
+syn keyword juliaConstC BasalforcingsPicoSubShelfOceanTempEnum
+syn keyword juliaConstC BasalStressxEnum
+syn keyword juliaConstC BasalStressyEnum
+syn keyword juliaConstC BasalStressEnum
+syn keyword juliaConstC BaseEnum
+syn keyword juliaConstC BaseOldEnum
+syn keyword juliaConstC BaseSlopeXEnum
+syn keyword juliaConstC BaseSlopeYEnum
+syn keyword juliaConstC BaselineBasalforcingsFloatingiceMeltingRateEnum
+syn keyword juliaConstC BaselineCalvingCalvingrateEnum
+syn keyword juliaConstC BaselineFrictionEffectivePressureEnum
+syn keyword juliaConstC BedEnum
+syn keyword juliaConstC BedGRDEnum
+syn keyword juliaConstC BedEastEnum
+syn keyword juliaConstC BedEastGRDEnum
+syn keyword juliaConstC BedNorthEnum
+syn keyword juliaConstC BedNorthGRDEnum
+syn keyword juliaConstC BedSlopeXEnum
+syn keyword juliaConstC BedSlopeYEnum
+syn keyword juliaConstC BottomPressureEnum
+syn keyword juliaConstC BottomPressureOldEnum
+syn keyword juliaConstC CalvingCalvingrateEnum
+syn keyword juliaConstC CalvingHabFractionEnum
+syn keyword juliaConstC CalvingMeltingrateEnum
+syn keyword juliaConstC CalvingStressThresholdFloatingiceEnum
+syn keyword juliaConstC CalvingStressThresholdGroundediceEnum
+syn keyword juliaConstC CalvinglevermannCoeffEnum
+syn keyword juliaConstC CalvingratexAverageEnum
+syn keyword juliaConstC CalvingratexEnum
+syn keyword juliaConstC CalvingrateyAverageEnum
+syn keyword juliaConstC CalvingrateyEnum
+syn keyword juliaConstC CalvingFluxLevelsetEnum
+syn keyword juliaConstC CalvingMeltingFluxLevelsetEnum
+syn keyword juliaConstC ConvergedEnum
+syn keyword juliaConstC CrevasseDepthEnum
+syn keyword juliaConstC DamageDEnum
+syn keyword juliaConstC DamageDOldEnum
+syn keyword juliaConstC DamageDbarEnum
+syn keyword juliaConstC DamageDbarOldEnum
+syn keyword juliaConstC DamageFEnum
+syn keyword juliaConstC DegreeOfChannelizationEnum
+syn keyword juliaConstC DepthBelowSurfaceEnum
+syn keyword juliaConstC DeltaIceThicknessEnum
+syn keyword juliaConstC DeltaTwsEnum
+syn keyword juliaConstC DeltaBottomPressureEnum
+syn keyword juliaConstC DeltaDslEnum
+syn keyword juliaConstC DslOldEnum
+syn keyword juliaConstC DslEnum
+syn keyword juliaConstC DeltaStrEnum
+syn keyword juliaConstC StrOldEnum
+syn keyword juliaConstC StrEnum
+syn keyword juliaConstC DeviatoricStresseffectiveEnum
+syn keyword juliaConstC DeviatoricStressxxEnum
+syn keyword juliaConstC DeviatoricStressxyEnum
+syn keyword juliaConstC DeviatoricStressxzEnum
+syn keyword juliaConstC DeviatoricStressyyEnum
+syn keyword juliaConstC DeviatoricStressyzEnum
+syn keyword juliaConstC DeviatoricStresszzEnum
+syn keyword juliaConstC DeviatoricStress1Enum
+syn keyword juliaConstC DeviatoricStress2Enum
+syn keyword juliaConstC DistanceToCalvingfrontEnum
+syn keyword juliaConstC DistanceToGroundinglineEnum
+syn keyword juliaConstC Domain2DhorizontalEnum
+syn keyword juliaConstC Domain2DverticalEnum
+syn keyword juliaConstC Domain3DEnum
+syn keyword juliaConstC DragCoefficientAbsGradientEnum
+syn keyword juliaConstC DrivingStressXEnum
+syn keyword juliaConstC DrivingStressYEnum
+syn keyword juliaConstC DummyEnum
+syn keyword juliaConstC EffectivePressureEnum
+syn keyword juliaConstC EffectivePressureSubstepEnum
+syn keyword juliaConstC EffectivePressureTransientEnum
+syn keyword juliaConstC EnthalpyEnum
+syn keyword juliaConstC EnthalpyPicardEnum
+syn keyword juliaConstC EplHeadEnum
+syn keyword juliaConstC EplHeadOldEnum
+syn keyword juliaConstC EplHeadSlopeXEnum
+syn keyword juliaConstC EplHeadSlopeYEnum
+syn keyword juliaConstC EplHeadSubstepEnum
+syn keyword juliaConstC EplHeadTransientEnum
+syn keyword juliaConstC EsaEmotionEnum
+syn keyword juliaConstC EsaNmotionEnum
+syn keyword juliaConstC EsaRotationrateEnum
+syn keyword juliaConstC EsaStrainratexxEnum
+syn keyword juliaConstC EsaStrainratexyEnum
+syn keyword juliaConstC EsaStrainrateyyEnum
+syn keyword juliaConstC EsaUmotionEnum
+syn keyword juliaConstC EsaXmotionEnum
+syn keyword juliaConstC EsaYmotionEnum
+syn keyword juliaConstC EtaDiffEnum
+syn keyword juliaConstC FlowequationBorderFSEnum
+syn keyword juliaConstC FrictionAsEnum
+syn keyword juliaConstC FrictionCEnum
+syn keyword juliaConstC FrictionCmaxEnum
+syn keyword juliaConstC FrictionCoefficientEnum
+syn keyword juliaConstC FrictionCoefficientcoulombEnum
+syn keyword juliaConstC FrictionEffectivePressureEnum
+syn keyword juliaConstC FrictionMEnum
+syn keyword juliaConstC FrictionPEnum
+syn keyword juliaConstC FrictionPressureAdjustedTemperatureEnum
+syn keyword juliaConstC FrictionQEnum
+syn keyword juliaConstC FrictionSedimentCompressibilityCoefficientEnum
+syn keyword juliaConstC FrictionTillFrictionAngleEnum
+syn keyword juliaConstC FrictionWaterLayerEnum
+syn keyword juliaConstC FrictionfEnum
+syn keyword juliaConstC FrontalForcingsBasinIdEnum
+syn keyword juliaConstC FrontalForcingsSubglacialDischargeEnum
+syn keyword juliaConstC FrontalForcingsThermalForcingEnum
+syn keyword juliaConstC GeometryHydrostaticRatioEnum
+syn keyword juliaConstC NGiaEnum
+syn keyword juliaConstC NGiaRateEnum
+syn keyword juliaConstC UGiaEnum
+syn keyword juliaConstC UGiaRateEnum
+syn keyword juliaConstC GradientEnum
+syn keyword juliaConstC GroundinglineHeightEnum
+syn keyword juliaConstC HydraulicPotentialEnum
+syn keyword juliaConstC HydraulicPotentialOldEnum
+syn keyword juliaConstC HydrologyBasalFluxEnum
+syn keyword juliaConstC HydrologyBumpHeightEnum
+syn keyword juliaConstC HydrologyBumpSpacingEnum
+syn keyword juliaConstC HydrologydcBasalMoulinInputEnum
+syn keyword juliaConstC HydrologydcEplThicknessEnum
+syn keyword juliaConstC HydrologydcEplThicknessOldEnum
+syn keyword juliaConstC HydrologydcEplThicknessSubstepEnum
+syn keyword juliaConstC HydrologydcEplThicknessTransientEnum
+syn keyword juliaConstC HydrologydcMaskEplactiveEltEnum
+syn keyword juliaConstC HydrologydcMaskEplactiveNodeEnum
+syn keyword juliaConstC HydrologydcMaskThawedEltEnum
+syn keyword juliaConstC HydrologydcMaskThawedNodeEnum
+syn keyword juliaConstC HydrologydcSedimentTransmitivityEnum
+syn keyword juliaConstC HydrologyDrainageRateEnum
+syn keyword juliaConstC HydrologyEnglacialInputEnum
+syn keyword juliaConstC HydrologyGapHeightEnum
+syn keyword juliaConstC HydrologyGapHeightXEnum
+syn keyword juliaConstC HydrologyGapHeightXXEnum
+syn keyword juliaConstC HydrologyGapHeightYEnum
+syn keyword juliaConstC HydrologyGapHeightYYEnum
+syn keyword juliaConstC HydrologyHeadEnum
+syn keyword juliaConstC HydrologyHeadOldEnum
+syn keyword juliaConstC HydrologyMoulinInputEnum
+syn keyword juliaConstC HydrologyNeumannfluxEnum
+syn keyword juliaConstC HydrologyReynoldsEnum
+syn keyword juliaConstC HydrologySheetConductivityEnum
+syn keyword juliaConstC HydrologySheetThicknessEnum
+syn keyword juliaConstC HydrologySheetThicknessOldEnum
+syn keyword juliaConstC HydrologyTwsEnum
+syn keyword juliaConstC HydrologyTwsSpcEnum
+syn keyword juliaConstC HydrologyTwsAnalysisEnum
+syn keyword juliaConstC HydrologyWatercolumnMaxEnum
+syn keyword juliaConstC HydrologyWaterVxEnum
+syn keyword juliaConstC HydrologyWaterVyEnum
+syn keyword juliaConstC IceEnum
+syn keyword juliaConstC IceMaskNodeActivationEnum
+syn keyword juliaConstC InputEnum
+syn keyword juliaConstC InversionCostFunctionsCoefficientsEnum
+syn keyword juliaConstC InversionSurfaceObsEnum
+syn keyword juliaConstC InversionThicknessObsEnum
+syn keyword juliaConstC InversionVelObsEnum
+syn keyword juliaConstC InversionVxObsEnum
+syn keyword juliaConstC InversionVyObsEnum
+syn keyword juliaConstC LevelsetfunctionSlopeXEnum
+syn keyword juliaConstC LevelsetfunctionSlopeYEnum
+syn keyword juliaConstC LevelsetObservationEnum
+syn keyword juliaConstC LoadingforceXEnum
+syn keyword juliaConstC LoadingforceYEnum
+syn keyword juliaConstC LoadingforceZEnum
+syn keyword juliaConstC MaskOceanLevelsetEnum
+syn keyword juliaConstC MaskIceLevelsetEnum
+syn keyword juliaConstC MaskIceRefLevelsetEnum
+syn keyword juliaConstC MasstransportSpcthicknessEnum
+syn keyword juliaConstC MaterialsRheologyBEnum
+syn keyword juliaConstC MaterialsRheologyBbarEnum
+syn keyword juliaConstC MaterialsRheologyEEnum
+syn keyword juliaConstC MaterialsRheologyEbarEnum
+syn keyword juliaConstC MaterialsRheologyEcEnum
+syn keyword juliaConstC MaterialsRheologyEcbarEnum
+syn keyword juliaConstC MaterialsRheologyEsEnum
+syn keyword juliaConstC MaterialsRheologyEsbarEnum
+syn keyword juliaConstC MaterialsRheologyNEnum
+syn keyword juliaConstC MeshScaleFactorEnum
+syn keyword juliaConstC MeshVertexonbaseEnum
+syn keyword juliaConstC MeshVertexonboundaryEnum
+syn keyword juliaConstC MeshVertexonsurfaceEnum
+syn keyword juliaConstC MisfitEnum
+syn keyword juliaConstC MovingFrontalVxEnum
+syn keyword juliaConstC MovingFrontalVyEnum
+syn keyword juliaConstC NeumannfluxEnum
+syn keyword juliaConstC NewDamageEnum
+syn keyword juliaConstC NodeEnum
+syn keyword juliaConstC OmegaAbsGradientEnum
+syn keyword juliaConstC OceantransportSpcbottompressureEnum
+syn keyword juliaConstC OceantransportSpcstrEnum
+syn keyword juliaConstC OceantransportSpcdslEnum
+syn keyword juliaConstC P0Enum
+syn keyword juliaConstC P1Enum
+syn keyword juliaConstC PartitioningEnum
+syn keyword juliaConstC PressureEnum
+syn keyword juliaConstC RadarEnum
+syn keyword juliaConstC RadarAttenuationMacGregorEnum
+syn keyword juliaConstC RadarAttenuationWolffEnum
+syn keyword juliaConstC RadarIcePeriodEnum
+syn keyword juliaConstC RadarPowerMacGregorEnum
+syn keyword juliaConstC RadarPowerWolffEnum
+syn keyword juliaConstC RheologyBAbsGradientEnum
+syn keyword juliaConstC RheologyBInitialguessEnum
+syn keyword juliaConstC RheologyBInitialguessMisfitEnum
+syn keyword juliaConstC RheologyBbarAbsGradientEnum
+syn keyword juliaConstC SampleEnum
+syn keyword juliaConstC SamplingBetaEnum
+syn keyword juliaConstC SamplingKappaEnum
+syn keyword juliaConstC SealevelEnum
+syn keyword juliaConstC SealevelGRDEnum
+syn keyword juliaConstC SealevelBarystaticMaskEnum
+syn keyword juliaConstC SealevelBarystaticIceMaskEnum
+syn keyword juliaConstC SealevelBarystaticIceWeightsEnum
+syn keyword juliaConstC SealevelBarystaticIceAreaEnum
+syn keyword juliaConstC SealevelBarystaticIceLatbarEnum
+syn keyword juliaConstC SealevelBarystaticIceLongbarEnum
+syn keyword juliaConstC SealevelBarystaticIceLoadEnum
+syn keyword juliaConstC SealevelBarystaticHydroMaskEnum
+syn keyword juliaConstC SealevelBarystaticHydroWeightsEnum
+syn keyword juliaConstC SealevelBarystaticHydroAreaEnum
+syn keyword juliaConstC SealevelBarystaticHydroLatbarEnum
+syn keyword juliaConstC SealevelBarystaticHydroLongbarEnum
+syn keyword juliaConstC SealevelBarystaticHydroLoadEnum
+syn keyword juliaConstC SealevelBarystaticBpMaskEnum
+syn keyword juliaConstC SealevelBarystaticBpWeightsEnum
+syn keyword juliaConstC SealevelBarystaticBpAreaEnum
+syn keyword juliaConstC SealevelBarystaticBpLoadEnum
+syn keyword juliaConstC SealevelBarystaticOceanMaskEnum
+syn keyword juliaConstC SealevelBarystaticOceanWeightsEnum
+syn keyword juliaConstC SealevelBarystaticOceanAreaEnum
+syn keyword juliaConstC SealevelBarystaticOceanLatbarEnum
+syn keyword juliaConstC SealevelBarystaticOceanLongbarEnum
+syn keyword juliaConstC SealevelBarystaticOceanLoadEnum
+syn keyword juliaConstC SealevelNEsaEnum
+syn keyword juliaConstC SealevelNEsaRateEnum
+syn keyword juliaConstC SealevelRSLEnum
+syn keyword juliaConstC BslcEnum
+syn keyword juliaConstC BslcIceEnum
+syn keyword juliaConstC BslcHydroEnum
+syn keyword juliaConstC BslcOceanEnum
+syn keyword juliaConstC BslcRateEnum
+syn keyword juliaConstC GmtslcEnum
+syn keyword juliaConstC SealevelGrotm1Enum
+syn keyword juliaConstC SealevelGrotm2Enum
+syn keyword juliaConstC SealevelGrotm3Enum
+syn keyword juliaConstC SealevelGUrotm1Enum
+syn keyword juliaConstC SealevelGUrotm2Enum
+syn keyword juliaConstC SealevelGUrotm3Enum
+syn keyword juliaConstC SealevelGNrotm1Enum
+syn keyword juliaConstC SealevelGNrotm2Enum
+syn keyword juliaConstC SealevelGNrotm3Enum
+syn keyword juliaConstC SealevelGErotm1Enum
+syn keyword juliaConstC SealevelGErotm2Enum
+syn keyword juliaConstC SealevelGErotm3Enum
+syn keyword juliaConstC SealevelRSLBarystaticEnum
+syn keyword juliaConstC SealevelRSLRateEnum
+syn keyword juliaConstC SealevelUGrdEnum
+syn keyword juliaConstC SealevelNGrdEnum
+syn keyword juliaConstC SealevelUEastEsaEnum
+syn keyword juliaConstC SealevelUNorthEsaEnum
+syn keyword juliaConstC SealevelchangeIndicesEnum
+syn keyword juliaConstC SealevelchangeGEnum
+syn keyword juliaConstC SealevelchangeGUEnum
+syn keyword juliaConstC SealevelchangeGEEnum
+syn keyword juliaConstC SealevelchangeGNEnum
+syn keyword juliaConstC SealevelchangeGsubelOceanEnum
+syn keyword juliaConstC SealevelchangeGUsubelOceanEnum
+syn keyword juliaConstC SealevelchangeGEsubelOceanEnum
+syn keyword juliaConstC SealevelchangeGNsubelOceanEnum
+syn keyword juliaConstC SealevelchangeGsubelIceEnum
+syn keyword juliaConstC SealevelchangeGUsubelIceEnum
+syn keyword juliaConstC SealevelchangeGEsubelIceEnum
+syn keyword juliaConstC SealevelchangeGNsubelIceEnum
+syn keyword juliaConstC SealevelchangeGsubelHydroEnum
+syn keyword juliaConstC SealevelchangeGUsubelHydroEnum
+syn keyword juliaConstC SealevelchangeGEsubelHydroEnum
+syn keyword juliaConstC SealevelchangeGNsubelHydroEnum
+syn keyword juliaConstC SealevelchangeViscousRSLEnum
+syn keyword juliaConstC SealevelchangeViscousUEnum
+syn keyword juliaConstC SealevelchangeViscousNEnum
+syn keyword juliaConstC SealevelchangeViscousEEnum
+syn keyword juliaConstC SedimentHeadEnum
+syn keyword juliaConstC SedimentHeadOldEnum
+syn keyword juliaConstC SedimentHeadSubstepEnum
+syn keyword juliaConstC SedimentHeadTransientEnum
+syn keyword juliaConstC SedimentHeadResidualEnum
+syn keyword juliaConstC SedimentHeadStackedEnum
+syn keyword juliaConstC SigmaNNEnum
+syn keyword juliaConstC SigmaVMEnum
+syn keyword juliaConstC SmbAccumulatedECEnum
+syn keyword juliaConstC SmbAccumulatedMassBalanceEnum
+syn keyword juliaConstC SmbAccumulatedMeltEnum
+syn keyword juliaConstC SmbAccumulatedPrecipitationEnum
+syn keyword juliaConstC SmbAccumulatedRainEnum
+syn keyword juliaConstC SmbAccumulatedRefreezeEnum
+syn keyword juliaConstC SmbAccumulatedRunoffEnum
+syn keyword juliaConstC SmbAEnum
+syn keyword juliaConstC SmbAdiffEnum
+syn keyword juliaConstC SmbAValueEnum
+syn keyword juliaConstC SmbAccumulationEnum
+syn keyword juliaConstC SmbAdiffiniEnum
+syn keyword juliaConstC SmbAiniEnum
+syn keyword juliaConstC SmbAutoregressionNoiseEnum
+syn keyword juliaConstC SmbBasinsIdEnum
+syn keyword juliaConstC SmbBMaxEnum
+syn keyword juliaConstC SmbBMinEnum
+syn keyword juliaConstC SmbBNegEnum
+syn keyword juliaConstC SmbBPosEnum
+syn keyword juliaConstC SmbCEnum
+syn keyword juliaConstC SmbCcsnowValueEnum
+syn keyword juliaConstC SmbCciceValueEnum
+syn keyword juliaConstC SmbCotValueEnum
+syn keyword juliaConstC SmbDEnum
+syn keyword juliaConstC SmbDailyairdensityEnum
+syn keyword juliaConstC SmbDailyairhumidityEnum
+syn keyword juliaConstC SmbDailydlradiationEnum
+syn keyword juliaConstC SmbDailydsradiationEnum
+syn keyword juliaConstC SmbDailypressureEnum
+syn keyword juliaConstC SmbDailyrainfallEnum
+syn keyword juliaConstC SmbDailysnowfallEnum
+syn keyword juliaConstC SmbDailytemperatureEnum
+syn keyword juliaConstC SmbDailywindspeedEnum
+syn keyword juliaConstC SmbDiniEnum
+syn keyword juliaConstC SmbDlwrfEnum
+syn keyword juliaConstC SmbDulwrfValueEnum
+syn keyword juliaConstC SmbDswrfEnum
+syn keyword juliaConstC SmbDswdiffrfEnum
+syn keyword juliaConstC SmbDzAddEnum
+syn keyword juliaConstC SmbDzEnum
+syn keyword juliaConstC SmbDzMinEnum
+syn keyword juliaConstC SmbDzTopEnum
+syn keyword juliaConstC SmbDziniEnum
+syn keyword juliaConstC SmbEAirEnum
+syn keyword juliaConstC SmbECEnum
+syn keyword juliaConstC SmbECDtEnum
+syn keyword juliaConstC SmbECiniEnum
+syn keyword juliaConstC SmbElaEnum
+syn keyword juliaConstC SmbEvaporationEnum
+syn keyword juliaConstC SmbFACEnum
+syn keyword juliaConstC SmbGdnEnum
+syn keyword juliaConstC SmbGdniniEnum
+syn keyword juliaConstC SmbGspEnum
+syn keyword juliaConstC SmbGspiniEnum
+syn keyword juliaConstC SmbHrefEnum
+syn keyword juliaConstC SmbIsInitializedEnum
+syn keyword juliaConstC SmbMAddEnum
+syn keyword juliaConstC SmbMassBalanceEnum
+syn keyword juliaConstC SmbMassBalanceSubstepEnum
+syn keyword juliaConstC SmbMassBalanceTransientEnum
+syn keyword juliaConstC SmbMeanLHFEnum
+syn keyword juliaConstC SmbMeanSHFEnum
+syn keyword juliaConstC SmbMeanULWEnum
+syn keyword juliaConstC SmbMeltEnum
+syn keyword juliaConstC SmbMonthlytemperaturesEnum
+syn keyword juliaConstC SmbMSurfEnum
+syn keyword juliaConstC SmbNetLWEnum
+syn keyword juliaConstC SmbNetSWEnum
+syn keyword juliaConstC SmbPAirEnum
+syn keyword juliaConstC SmbPEnum
+syn keyword juliaConstC SmbPddfacIceEnum
+syn keyword juliaConstC SmbPddfacSnowEnum
+syn keyword juliaConstC SmbPrecipitationEnum
+syn keyword juliaConstC SmbPrecipitationsAnomalyEnum
+syn keyword juliaConstC SmbPrecipitationsLgmEnum
+syn keyword juliaConstC SmbPrecipitationsPresentdayEnum
+syn keyword juliaConstC SmbPrecipitationsReconstructedEnum
+syn keyword juliaConstC SmbRainEnum
+syn keyword juliaConstC SmbReEnum
+syn keyword juliaConstC SmbRefreezeEnum
+syn keyword juliaConstC SmbReiniEnum
+syn keyword juliaConstC SmbRunoffEnum
+syn keyword juliaConstC SmbRunoffSubstepEnum
+syn keyword juliaConstC SmbRunoffTransientEnum
+syn keyword juliaConstC SmbS0gcmEnum
+syn keyword juliaConstC SmbS0pEnum
+syn keyword juliaConstC SmbS0tEnum
+syn keyword juliaConstC SmbSizeiniEnum
+syn keyword juliaConstC SmbSmbCorrEnum
+syn keyword juliaConstC SmbSmbrefEnum
+syn keyword juliaConstC SmbSzaValueEnum
+syn keyword juliaConstC SmbTEnum
+syn keyword juliaConstC SmbTaEnum
+syn keyword juliaConstC SmbTeValueEnum
+syn keyword juliaConstC SmbTemperaturesAnomalyEnum
+syn keyword juliaConstC SmbTemperaturesLgmEnum
+syn keyword juliaConstC SmbTemperaturesPresentdayEnum
+syn keyword juliaConstC SmbTemperaturesReconstructedEnum
+syn keyword juliaConstC SmbTiniEnum
+syn keyword juliaConstC SmbTmeanEnum
+syn keyword juliaConstC SmbTzEnum
+syn keyword juliaConstC SmbValuesAutoregressionEnum
+syn keyword juliaConstC SmbVEnum
+syn keyword juliaConstC SmbVmeanEnum
+syn keyword juliaConstC SmbVzEnum
+syn keyword juliaConstC SmbWEnum
+syn keyword juliaConstC SmbWAddEnum
+syn keyword juliaConstC SmbWiniEnum
+syn keyword juliaConstC SmbZMaxEnum
+syn keyword juliaConstC SmbZMinEnum
+syn keyword juliaConstC SmbZTopEnum
+syn keyword juliaConstC SmbZYEnum
+syn keyword juliaConstC SolidearthExternalDisplacementEastRateEnum
+syn keyword juliaConstC SolidearthExternalDisplacementNorthRateEnum
+syn keyword juliaConstC SolidearthExternalDisplacementUpRateEnum
+syn keyword juliaConstC SolidearthExternalGeoidRateEnum
+syn keyword juliaConstC StochasticForcingDefaultIdEnum
+syn keyword juliaConstC StrainRateeffectiveEnum
+syn keyword juliaConstC StrainRateparallelEnum
+syn keyword juliaConstC StrainRateperpendicularEnum
+syn keyword juliaConstC StrainRatexxEnum
+syn keyword juliaConstC StrainRatexyEnum
+syn keyword juliaConstC StrainRatexzEnum
+syn keyword juliaConstC StrainRateyyEnum
+syn keyword juliaConstC StrainRateyzEnum
+syn keyword juliaConstC StrainRatezzEnum
+syn keyword juliaConstC StressMaxPrincipalEnum
+syn keyword juliaConstC StressTensorxxEnum
+syn keyword juliaConstC StressTensorxyEnum
+syn keyword juliaConstC StressTensorxzEnum
+syn keyword juliaConstC StressTensoryyEnum
+syn keyword juliaConstC StressTensoryzEnum
+syn keyword juliaConstC StressTensorzzEnum
+syn keyword juliaConstC SurfaceAbsMisfitEnum
+syn keyword juliaConstC SurfaceAbsVelMisfitEnum
+syn keyword juliaConstC AreaEnum
+syn keyword juliaConstC SealevelAreaEnum
+syn keyword juliaConstC SurfaceAreaEnum
+syn keyword juliaConstC SurfaceAverageVelMisfitEnum
+syn keyword juliaConstC SurfaceCrevasseEnum
+syn keyword juliaConstC SurfaceEnum
+syn keyword juliaConstC SurfaceOldEnum
+syn keyword juliaConstC SurfaceLogVelMisfitEnum
+syn keyword juliaConstC SurfaceLogVxVyMisfitEnum
+syn keyword juliaConstC SurfaceObservationEnum
+syn keyword juliaConstC SurfaceRelVelMisfitEnum
+syn keyword juliaConstC SurfaceSlopeXEnum
+syn keyword juliaConstC SurfaceSlopeYEnum
+syn keyword juliaConstC TemperatureEnum
+syn keyword juliaConstC TemperaturePDDEnum
+syn keyword juliaConstC TemperaturePicardEnum
+syn keyword juliaConstC TemperatureSEMICEnum
+syn keyword juliaConstC ThermalforcingAutoregressionNoiseEnum
+syn keyword juliaConstC ThermalforcingValuesAutoregressionEnum
+syn keyword juliaConstC ThermalSpctemperatureEnum
+syn keyword juliaConstC ThicknessAbsGradientEnum
+syn keyword juliaConstC ThicknessAbsMisfitEnum
+syn keyword juliaConstC ThicknessAcrossGradientEnum
+syn keyword juliaConstC ThicknessAlongGradientEnum
+syn keyword juliaConstC ThicknessEnum
+syn keyword juliaConstC ThicknessOldEnum
+syn keyword juliaConstC ThicknessPositiveEnum
+syn keyword juliaConstC ThicknessResidualEnum
+syn keyword juliaConstC TransientAccumulatedDeltaIceThicknessEnum
+syn keyword juliaConstC VelEnum
+syn keyword juliaConstC VxAverageEnum
+syn keyword juliaConstC VxBaseEnum
+syn keyword juliaConstC VxEnum
+syn keyword juliaConstC VxMeshEnum
+syn keyword juliaConstC VxObsEnum
+syn keyword juliaConstC VxShearEnum
+syn keyword juliaConstC VxSurfaceEnum
+syn keyword juliaConstC VyAverageEnum
+syn keyword juliaConstC VyBaseEnum
+syn keyword juliaConstC VyEnum
+syn keyword juliaConstC VyMeshEnum
+syn keyword juliaConstC VyObsEnum
+syn keyword juliaConstC VyShearEnum
+syn keyword juliaConstC VySurfaceEnum
+syn keyword juliaConstC VzEnum
+syn keyword juliaConstC VzFSEnum
+syn keyword juliaConstC VzHOEnum
+syn keyword juliaConstC VzMeshEnum
+syn keyword juliaConstC VzSSAEnum
+syn keyword juliaConstC WaterColumnOldEnum
+syn keyword juliaConstC WatercolumnEnum
+syn keyword juliaConstC WaterfractionDrainageEnum
+syn keyword juliaConstC WaterfractionDrainageIntegratedEnum
+syn keyword juliaConstC WaterfractionEnum
+syn keyword juliaConstC WaterheightEnum
+syn keyword juliaConstC FrictionWaterPressureEnum
+syn keyword juliaConstC FrictionWaterPressureNoiseEnum
+syn keyword juliaConstC WeightsLevelsetObservationEnum
+syn keyword juliaConstC WeightsSurfaceObservationEnum
+syn keyword juliaConstC OldAccumulatedDeltaBottomPressureEnum
+syn keyword juliaConstC OldAccumulatedDeltaIceThicknessEnum
+syn keyword juliaConstC OldAccumulatedDeltaTwsEnum
+syn keyword juliaConstC Outputdefinition1Enum
+syn keyword juliaConstC Outputdefinition10Enum
+syn keyword juliaConstC Outputdefinition11Enum
+syn keyword juliaConstC Outputdefinition12Enum
+syn keyword juliaConstC Outputdefinition13Enum
+syn keyword juliaConstC Outputdefinition14Enum
+syn keyword juliaConstC Outputdefinition15Enum
+syn keyword juliaConstC Outputdefinition16Enum
+syn keyword juliaConstC Outputdefinition17Enum
+syn keyword juliaConstC Outputdefinition18Enum
+syn keyword juliaConstC Outputdefinition19Enum
+syn keyword juliaConstC Outputdefinition20Enum
+syn keyword juliaConstC Outputdefinition21Enum
+syn keyword juliaConstC Outputdefinition22Enum
+syn keyword juliaConstC Outputdefinition23Enum
+syn keyword juliaConstC Outputdefinition24Enum
+syn keyword juliaConstC Outputdefinition25Enum
+syn keyword juliaConstC Outputdefinition26Enum
+syn keyword juliaConstC Outputdefinition27Enum
+syn keyword juliaConstC Outputdefinition28Enum
+syn keyword juliaConstC Outputdefinition29Enum
+syn keyword juliaConstC Outputdefinition2Enum
+syn keyword juliaConstC Outputdefinition30Enum
+syn keyword juliaConstC Outputdefinition31Enum
+syn keyword juliaConstC Outputdefinition32Enum
+syn keyword juliaConstC Outputdefinition33Enum
+syn keyword juliaConstC Outputdefinition34Enum
+syn keyword juliaConstC Outputdefinition35Enum
+syn keyword juliaConstC Outputdefinition36Enum
+syn keyword juliaConstC Outputdefinition37Enum
+syn keyword juliaConstC Outputdefinition38Enum
+syn keyword juliaConstC Outputdefinition39Enum
+syn keyword juliaConstC Outputdefinition3Enum
+syn keyword juliaConstC Outputdefinition40Enum
+syn keyword juliaConstC Outputdefinition41Enum
+syn keyword juliaConstC Outputdefinition42Enum
+syn keyword juliaConstC Outputdefinition43Enum
+syn keyword juliaConstC Outputdefinition44Enum
+syn keyword juliaConstC Outputdefinition45Enum
+syn keyword juliaConstC Outputdefinition46Enum
+syn keyword juliaConstC Outputdefinition47Enum
+syn keyword juliaConstC Outputdefinition48Enum
+syn keyword juliaConstC Outputdefinition49Enum
+syn keyword juliaConstC Outputdefinition4Enum
+syn keyword juliaConstC Outputdefinition50Enum
+syn keyword juliaConstC Outputdefinition51Enum
+syn keyword juliaConstC Outputdefinition52Enum
+syn keyword juliaConstC Outputdefinition53Enum
+syn keyword juliaConstC Outputdefinition54Enum
+syn keyword juliaConstC Outputdefinition55Enum
+syn keyword juliaConstC Outputdefinition56Enum
+syn keyword juliaConstC Outputdefinition57Enum
+syn keyword juliaConstC Outputdefinition58Enum
+syn keyword juliaConstC Outputdefinition59Enum
+syn keyword juliaConstC Outputdefinition5Enum
+syn keyword juliaConstC Outputdefinition60Enum
+syn keyword juliaConstC Outputdefinition61Enum
+syn keyword juliaConstC Outputdefinition62Enum
+syn keyword juliaConstC Outputdefinition63Enum
+syn keyword juliaConstC Outputdefinition64Enum
+syn keyword juliaConstC Outputdefinition65Enum
+syn keyword juliaConstC Outputdefinition66Enum
+syn keyword juliaConstC Outputdefinition67Enum
+syn keyword juliaConstC Outputdefinition68Enum
+syn keyword juliaConstC Outputdefinition69Enum
+syn keyword juliaConstC Outputdefinition6Enum
+syn keyword juliaConstC Outputdefinition70Enum
+syn keyword juliaConstC Outputdefinition71Enum
+syn keyword juliaConstC Outputdefinition72Enum
+syn keyword juliaConstC Outputdefinition73Enum
+syn keyword juliaConstC Outputdefinition74Enum
+syn keyword juliaConstC Outputdefinition75Enum
+syn keyword juliaConstC Outputdefinition76Enum
+syn keyword juliaConstC Outputdefinition77Enum
+syn keyword juliaConstC Outputdefinition78Enum
+syn keyword juliaConstC Outputdefinition79Enum
+syn keyword juliaConstC Outputdefinition7Enum
+syn keyword juliaConstC Outputdefinition80Enum
+syn keyword juliaConstC Outputdefinition81Enum
+syn keyword juliaConstC Outputdefinition82Enum
+syn keyword juliaConstC Outputdefinition83Enum
+syn keyword juliaConstC Outputdefinition84Enum
+syn keyword juliaConstC Outputdefinition85Enum
+syn keyword juliaConstC Outputdefinition86Enum
+syn keyword juliaConstC Outputdefinition87Enum
+syn keyword juliaConstC Outputdefinition88Enum
+syn keyword juliaConstC Outputdefinition89Enum
+syn keyword juliaConstC Outputdefinition8Enum
+syn keyword juliaConstC Outputdefinition90Enum
+syn keyword juliaConstC Outputdefinition91Enum
+syn keyword juliaConstC Outputdefinition92Enum
+syn keyword juliaConstC Outputdefinition93Enum
+syn keyword juliaConstC Outputdefinition94Enum
+syn keyword juliaConstC Outputdefinition95Enum
+syn keyword juliaConstC Outputdefinition96Enum
+syn keyword juliaConstC Outputdefinition97Enum
+syn keyword juliaConstC Outputdefinition98Enum
+syn keyword juliaConstC Outputdefinition99Enum
+syn keyword juliaConstC Outputdefinition9Enum
+syn keyword juliaConstC Outputdefinition100Enum
+syn keyword juliaConstC InputsENDEnum
+syn keyword juliaConstC AbsoluteEnum
+syn keyword juliaConstC AdaptiveTimesteppingEnum
+syn keyword juliaConstC AdjointBalancethickness2AnalysisEnum
+syn keyword juliaConstC AdjointBalancethicknessAnalysisEnum
+syn keyword juliaConstC AdjointHorizAnalysisEnum
+syn keyword juliaConstC AggressiveMigrationEnum
+syn keyword juliaConstC AmrBamgEnum
+syn keyword juliaConstC AmrNeopzEnum
+syn keyword juliaConstC AndroidFrictionCoefficientEnum
+syn keyword juliaConstC ArrheniusEnum
+syn keyword juliaConstC AutodiffJacobianEnum
+syn keyword juliaConstC Balancethickness2AnalysisEnum
+syn keyword juliaConstC Balancethickness2SolutionEnum
+syn keyword juliaConstC BalancethicknessAnalysisEnum
+syn keyword juliaConstC BalancethicknessApparentMassbalanceEnum
+syn keyword juliaConstC BalancethicknessSoftAnalysisEnum
+syn keyword juliaConstC BalancethicknessSoftSolutionEnum
+syn keyword juliaConstC BalancethicknessSolutionEnum
+syn keyword juliaConstC BalancevelocityAnalysisEnum
+syn keyword juliaConstC BalancevelocitySolutionEnum
+syn keyword juliaConstC BasalforcingsIsmip6Enum
+syn keyword juliaConstC BasalforcingsPicoEnum
+syn keyword juliaConstC BeckmannGoosseFloatingMeltRateEnum
+syn keyword juliaConstC BedSlopeSolutionEnum
+syn keyword juliaConstC BoolExternalResultEnum
+syn keyword juliaConstC BoolInputEnum
+syn keyword juliaConstC IntInputEnum
+syn keyword juliaConstC DoubleInputEnum
+syn keyword juliaConstC BoolParamEnum
+syn keyword juliaConstC BoundaryEnum
+syn keyword juliaConstC BuddJackaEnum
+syn keyword juliaConstC CalvingDev2Enum
+syn keyword juliaConstC CalvingHabEnum
+syn keyword juliaConstC CalvingLevermannEnum
+syn keyword juliaConstC CalvingVonmisesEnum
+syn keyword juliaConstC CfdragcoeffabsgradEnum
+syn keyword juliaConstC CfsurfacelogvelEnum
+syn keyword juliaConstC CfsurfacesquareEnum
+syn keyword juliaConstC CflevelsetmisfitEnum
+syn keyword juliaConstC ChannelEnum
+syn keyword juliaConstC ChannelAreaEnum
+syn keyword juliaConstC ChannelAreaOldEnum
+syn keyword juliaConstC ChannelDischargeEnum
+syn keyword juliaConstC ClosedEnum
+syn keyword juliaConstC ColinearEnum
+syn keyword juliaConstC ConstraintsEnum
+syn keyword juliaConstC ContactEnum
+syn keyword juliaConstC ContourEnum
+syn keyword juliaConstC ContoursEnum
+syn keyword juliaConstC ControlInputEnum
+syn keyword juliaConstC ControlInputGradEnum
+syn keyword juliaConstC ControlInputMaxsEnum
+syn keyword juliaConstC ControlInputMinsEnum
+syn keyword juliaConstC ControlInputValuesEnum
+syn keyword juliaConstC CrouzeixRaviartEnum
+syn keyword juliaConstC CuffeyEnum
+syn keyword juliaConstC CuffeyTemperateEnum
+syn keyword juliaConstC DamageEvolutionAnalysisEnum
+syn keyword juliaConstC DamageEvolutionSolutionEnum
+syn keyword juliaConstC DataSetEnum
+syn keyword juliaConstC DataSetParamEnum
+syn keyword juliaConstC DatasetInputEnum
+syn keyword juliaConstC DefaultAnalysisEnum
+syn keyword juliaConstC DefaultCalvingEnum
+syn keyword juliaConstC DenseEnum
+syn keyword juliaConstC DependentObjectEnum
+syn keyword juliaConstC DepthAverageAnalysisEnum
+syn keyword juliaConstC DeviatoricStressErrorEstimatorEnum
+syn keyword juliaConstC DivergenceEnum
+syn keyword juliaConstC Domain3DsurfaceEnum
+syn keyword juliaConstC DoubleArrayInputEnum
+syn keyword juliaConstC ArrayInputEnum
+syn keyword juliaConstC DoubleExternalResultEnum
+syn keyword juliaConstC DoubleMatArrayParamEnum
+syn keyword juliaConstC DoubleMatExternalResultEnum
+syn keyword juliaConstC DoubleMatParamEnum
+syn keyword juliaConstC DoubleParamEnum
+syn keyword juliaConstC DoubleVecParamEnum
+syn keyword juliaConstC ElementEnum
+syn keyword juliaConstC ElementHookEnum
+syn keyword juliaConstC ElementSIdEnum
+syn keyword juliaConstC EnthalpyAnalysisEnum
+syn keyword juliaConstC EsaAnalysisEnum
+syn keyword juliaConstC EsaSolutionEnum
+syn keyword juliaConstC EsaTransitionsEnum
+syn keyword juliaConstC ExternalResultEnum
+syn keyword juliaConstC ExtrapolationAnalysisEnum
+syn keyword juliaConstC ExtrudeFromBaseAnalysisEnum
+syn keyword juliaConstC ExtrudeFromTopAnalysisEnum
+syn keyword juliaConstC FSApproximationEnum
+syn keyword juliaConstC FSSolverEnum
+syn keyword juliaConstC FSpressureEnum
+syn keyword juliaConstC FSvelocityEnum
+syn keyword juliaConstC FemModelEnum
+syn keyword juliaConstC FileParamEnum
+syn keyword juliaConstC FixedTimesteppingEnum
+syn keyword juliaConstC FloatingAreaEnum
+syn keyword juliaConstC FloatingAreaScaledEnum
+syn keyword juliaConstC FloatingMeltRateEnum
+syn keyword juliaConstC FreeEnum
+syn keyword juliaConstC FreeSurfaceBaseAnalysisEnum
+syn keyword juliaConstC FreeSurfaceTopAnalysisEnum
+syn keyword juliaConstC FrontalForcingsDefaultEnum
+syn keyword juliaConstC FrontalForcingsRignotEnum
+syn keyword juliaConstC FrontalForcingsRignotAutoregressionEnum
+syn keyword juliaConstC FsetEnum
+syn keyword juliaConstC FullMeltOnPartiallyFloatingEnum
+syn keyword juliaConstC GLheightadvectionAnalysisEnum
+syn keyword juliaConstC GaussPentaEnum
+syn keyword juliaConstC GaussSegEnum
+syn keyword juliaConstC GaussTetraEnum
+syn keyword juliaConstC GaussTriaEnum
+syn keyword juliaConstC GenericOptionEnum
+syn keyword juliaConstC GenericParamEnum
+syn keyword juliaConstC GenericExternalResultEnum
+syn keyword juliaConstC Gradient1Enum
+syn keyword juliaConstC Gradient2Enum
+syn keyword juliaConstC Gradient3Enum
+syn keyword juliaConstC Gradient4Enum
+syn keyword juliaConstC GroundedAreaEnum
+syn keyword juliaConstC GroundedAreaScaledEnum
+syn keyword juliaConstC GroundingOnlyEnum
+syn keyword juliaConstC GroundinglineMassFluxEnum
+syn keyword juliaConstC GsetEnum
+syn keyword juliaConstC GslEnum
+syn keyword juliaConstC HOApproximationEnum
+syn keyword juliaConstC HOFSApproximationEnum
+syn keyword juliaConstC HookEnum
+syn keyword juliaConstC HydrologyDCEfficientAnalysisEnum
+syn keyword juliaConstC HydrologyDCInefficientAnalysisEnum
+syn keyword juliaConstC HydrologyGlaDSAnalysisEnum
+syn keyword juliaConstC HydrologyGlaDSEnum
+syn keyword juliaConstC HydrologyPismAnalysisEnum
+syn keyword juliaConstC HydrologyShaktiAnalysisEnum
+syn keyword juliaConstC HydrologyShreveAnalysisEnum
+syn keyword juliaConstC HydrologySolutionEnum
+syn keyword juliaConstC HydrologydcEnum
+syn keyword juliaConstC HydrologypismEnum
+syn keyword juliaConstC HydrologyshaktiEnum
+syn keyword juliaConstC HydrologyshreveEnum
+syn keyword juliaConstC IceMassEnum
+syn keyword juliaConstC IceMassScaledEnum
+syn keyword juliaConstC IceVolumeAboveFloatationEnum
+syn keyword juliaConstC IceVolumeAboveFloatationScaledEnum
+syn keyword juliaConstC IceVolumeEnum
+syn keyword juliaConstC IceVolumeScaledEnum
+syn keyword juliaConstC IcefrontMassFluxEnum
+syn keyword juliaConstC IcefrontMassFluxLevelsetEnum
+syn keyword juliaConstC IncrementalEnum
+syn keyword juliaConstC IndexedEnum
+syn keyword juliaConstC IntExternalResultEnum
+syn keyword juliaConstC ElementInputEnum
+syn keyword juliaConstC IntMatExternalResultEnum
+syn keyword juliaConstC IntMatParamEnum
+syn keyword juliaConstC IntParamEnum
+syn keyword juliaConstC IntVecParamEnum
+syn keyword juliaConstC InputsEnum
+syn keyword juliaConstC InternalEnum
+syn keyword juliaConstC IntersectEnum
+syn keyword juliaConstC InversionVzObsEnum
+syn keyword juliaConstC JEnum
+syn keyword juliaConstC L1L2ApproximationEnum
+syn keyword juliaConstC MLHOApproximationEnum
+syn keyword juliaConstC L2ProjectionBaseAnalysisEnum
+syn keyword juliaConstC L2ProjectionEPLAnalysisEnum
+syn keyword juliaConstC LACrouzeixRaviartEnum
+syn keyword juliaConstC LATaylorHoodEnum
+syn keyword juliaConstC LambdaSEnum
+syn keyword juliaConstC LevelsetAnalysisEnum
+syn keyword juliaConstC LevelsetfunctionPicardEnum
+syn keyword juliaConstC LinearFloatingMeltRateEnum
+syn keyword juliaConstC LliboutryDuvalEnum
+syn keyword juliaConstC LoadsEnum
+syn keyword juliaConstC LoveAnalysisEnum
+syn keyword juliaConstC LoveHiEnum
+syn keyword juliaConstC LoveHrEnum
+syn keyword juliaConstC LoveKernelsImagEnum
+syn keyword juliaConstC LoveKernelsRealEnum
+syn keyword juliaConstC LoveKiEnum
+syn keyword juliaConstC LoveKrEnum
+syn keyword juliaConstC LoveLiEnum
+syn keyword juliaConstC LoveLrEnum
+syn keyword juliaConstC LoveSolutionEnum
+syn keyword juliaConstC MINIEnum
+syn keyword juliaConstC MINIcondensedEnum
+syn keyword juliaConstC MantlePlumeGeothermalFluxEnum
+syn keyword juliaConstC MassFluxEnum
+syn keyword juliaConstC MassconEnum
+syn keyword juliaConstC MassconaxpbyEnum
+syn keyword juliaConstC MassfluxatgateEnum
+syn keyword juliaConstC MasstransportAnalysisEnum
+syn keyword juliaConstC MasstransportSolutionEnum
+syn keyword juliaConstC MatdamageiceEnum
+syn keyword juliaConstC MatenhancediceEnum
+syn keyword juliaConstC MaterialsEnum
+syn keyword juliaConstC MatestarEnum
+syn keyword juliaConstC MaticeEnum
+syn keyword juliaConstC MatlithoEnum
+syn keyword juliaConstC MathydroEnum
+syn keyword juliaConstC MatrixParamEnum
+syn keyword juliaConstC MaxAbsVxEnum
+syn keyword juliaConstC MaxAbsVyEnum
+syn keyword juliaConstC MaxAbsVzEnum
+syn keyword juliaConstC MaxDivergenceEnum
+syn keyword juliaConstC MaxVelEnum
+syn keyword juliaConstC MaxVxEnum
+syn keyword juliaConstC MaxVyEnum
+syn keyword juliaConstC MaxVzEnum
+syn keyword juliaConstC MelangeEnum
+syn keyword juliaConstC MeltingAnalysisEnum
+syn keyword juliaConstC MeshElementsEnum
+syn keyword juliaConstC MeshXEnum
+syn keyword juliaConstC MeshYEnum
+syn keyword juliaConstC MinVelEnum
+syn keyword juliaConstC MinVxEnum
+syn keyword juliaConstC MinVyEnum
+syn keyword juliaConstC MinVzEnum
+syn keyword juliaConstC MismipFloatingMeltRateEnum
+syn keyword juliaConstC MoulinEnum
+syn keyword juliaConstC MpiDenseEnum
+syn keyword juliaConstC MpiEnum
+syn keyword juliaConstC MpiSparseEnum
+syn keyword juliaConstC MumpsEnum
+syn keyword juliaConstC NoFrictionOnPartiallyFloatingEnum
+syn keyword juliaConstC NoMeltOnPartiallyFloatingEnum
+syn keyword juliaConstC NodalEnum
+syn keyword juliaConstC NodalvalueEnum
+syn keyword juliaConstC NodeSIdEnum
+syn keyword juliaConstC NoneApproximationEnum
+syn keyword juliaConstC NoneEnum
+syn keyword juliaConstC NumberedcostfunctionEnum
+syn keyword juliaConstC NyeCO2Enum
+syn keyword juliaConstC NyeH2OEnum
+syn keyword juliaConstC NumericalfluxEnum
+syn keyword juliaConstC OceantransportAnalysisEnum
+syn keyword juliaConstC OceantransportSolutionEnum
+syn keyword juliaConstC OldGradientEnum
+syn keyword juliaConstC OneLayerP4zEnum
+syn keyword juliaConstC OpenEnum
+syn keyword juliaConstC OptionEnum
+syn keyword juliaConstC ParamEnum
+syn keyword juliaConstC ParametersEnum
+syn keyword juliaConstC P0ArrayEnum
+syn keyword juliaConstC P0DGEnum
+syn keyword juliaConstC P1DGEnum
+syn keyword juliaConstC P1P1Enum
+syn keyword juliaConstC P1P1GLSEnum
+syn keyword juliaConstC P1bubbleEnum
+syn keyword juliaConstC P1bubblecondensedEnum
+syn keyword juliaConstC P1xP2Enum
+syn keyword juliaConstC P1xP3Enum
+syn keyword juliaConstC P1xP4Enum
+syn keyword juliaConstC P2Enum
+syn keyword juliaConstC P2bubbleEnum
+syn keyword juliaConstC P2bubblecondensedEnum
+syn keyword juliaConstC P2xP1Enum
+syn keyword juliaConstC P2xP4Enum
+syn keyword juliaConstC PatersonEnum
+syn keyword juliaConstC PengridEnum
+syn keyword juliaConstC PenpairEnum
+syn keyword juliaConstC PentaEnum
+syn keyword juliaConstC PentaInputEnum
+syn keyword juliaConstC ProfilerEnum
+syn keyword juliaConstC ProfilingCurrentFlopsEnum
+syn keyword juliaConstC ProfilingCurrentMemEnum
+syn keyword juliaConstC ProfilingSolutionTimeEnum
+syn keyword juliaConstC RegionaloutputEnum
+syn keyword juliaConstC RegularEnum
+syn keyword juliaConstC RecoveryAnalysisEnum
+syn keyword juliaConstC RiftfrontEnum
+syn keyword juliaConstC SamplingAnalysisEnum
+syn keyword juliaConstC SamplingSolutionEnum
+syn keyword juliaConstC SIAApproximationEnum
+syn keyword juliaConstC SMBautoregressionEnum
+syn keyword juliaConstC SMBcomponentsEnum
+syn keyword juliaConstC SMBd18opddEnum
+syn keyword juliaConstC SMBforcingEnum
+syn keyword juliaConstC SMBgcmEnum
+syn keyword juliaConstC SMBgembEnum
+syn keyword juliaConstC SMBgradientsEnum
+syn keyword juliaConstC SMBgradientscomponentsEnum
+syn keyword juliaConstC SMBgradientselaEnum
+syn keyword juliaConstC SMBhenningEnum
+syn keyword juliaConstC SMBmeltcomponentsEnum
+syn keyword juliaConstC SMBpddEnum
+syn keyword juliaConstC SMBpddSicopolisEnum
+syn keyword juliaConstC SMBsemicEnum
+syn keyword juliaConstC SSAApproximationEnum
+syn keyword juliaConstC SSAFSApproximationEnum
+syn keyword juliaConstC SSAHOApproximationEnum
+syn keyword juliaConstC ScaledEnum
+syn keyword juliaConstC SealevelAbsoluteEnum
+syn keyword juliaConstC SealevelEmotionEnum
+syn keyword juliaConstC SealevelInertiaTensorXZEnum
+syn keyword juliaConstC SealevelInertiaTensorYZEnum
+syn keyword juliaConstC SealevelInertiaTensorZZEnum
+syn keyword juliaConstC SealevelchangePolarMotionEnum
+syn keyword juliaConstC SealevelNmotionEnum
+syn keyword juliaConstC SealevelUmotionEnum
+syn keyword juliaConstC SealevelchangeAnalysisEnum
+syn keyword juliaConstC SegEnum
+syn keyword juliaConstC SegInputEnum
+syn keyword juliaConstC SegmentEnum
+syn keyword juliaConstC SegmentRiftfrontEnum
+syn keyword juliaConstC SeparateEnum
+syn keyword juliaConstC SeqEnum
+syn keyword juliaConstC SmbAnalysisEnum
+syn keyword juliaConstC SmbSolutionEnum
+syn keyword juliaConstC SmoothAnalysisEnum
+syn keyword juliaConstC SoftMigrationEnum
+syn keyword juliaConstC SpatialLinearFloatingMeltRateEnum
+syn keyword juliaConstC SpcDynamicEnum
+syn keyword juliaConstC SpcStaticEnum
+syn keyword juliaConstC SpcTransientEnum
+syn keyword juliaConstC SsetEnum
+syn keyword juliaConstC StatisticsSolutionEnum
+syn keyword juliaConstC SteadystateSolutionEnum
+syn keyword juliaConstC StressIntensityFactorEnum
+syn keyword juliaConstC StressbalanceAnalysisEnum
+syn keyword juliaConstC StressbalanceConvergenceNumStepsEnum
+syn keyword juliaConstC StressbalanceSIAAnalysisEnum
+syn keyword juliaConstC StressbalanceSolutionEnum
+syn keyword juliaConstC StressbalanceVerticalAnalysisEnum
+syn keyword juliaConstC StringArrayParamEnum
+syn keyword juliaConstC StringExternalResultEnum
+syn keyword juliaConstC StringParamEnum
+syn keyword juliaConstC SubelementFriction1Enum
+syn keyword juliaConstC SubelementFriction2Enum
+syn keyword juliaConstC SubelementMelt1Enum
+syn keyword juliaConstC SubelementMelt2Enum
+syn keyword juliaConstC SubelementMigrationEnum
+syn keyword juliaConstC SurfaceSlopeSolutionEnum
+syn keyword juliaConstC TaylorHoodEnum
+syn keyword juliaConstC TetraEnum
+syn keyword juliaConstC TetraInputEnum
+syn keyword juliaConstC ThermalAnalysisEnum
+syn keyword juliaConstC ThermalSolutionEnum
+syn keyword juliaConstC ThicknessErrorEstimatorEnum
+syn keyword juliaConstC TotalCalvingFluxLevelsetEnum
+syn keyword juliaConstC TotalCalvingMeltingFluxLevelsetEnum
+syn keyword juliaConstC TotalFloatingBmbEnum
+syn keyword juliaConstC TotalFloatingBmbScaledEnum
+syn keyword juliaConstC TotalGroundedBmbEnum
+syn keyword juliaConstC TotalGroundedBmbScaledEnum
+syn keyword juliaConstC TotalSmbEnum
+syn keyword juliaConstC TotalSmbScaledEnum
+syn keyword juliaConstC TransientArrayParamEnum
+syn keyword juliaConstC TransientInputEnum
+syn keyword juliaConstC TransientParamEnum
+syn keyword juliaConstC TransientSolutionEnum
+syn keyword juliaConstC TriaEnum
+syn keyword juliaConstC TriaInputEnum
+syn keyword juliaConstC UzawaPressureAnalysisEnum
+syn keyword juliaConstC VectorParamEnum
+syn keyword juliaConstC VertexEnum
+syn keyword juliaConstC VertexLIdEnum
+syn keyword juliaConstC VertexPIdEnum
+syn keyword juliaConstC VertexSIdEnum
+syn keyword juliaConstC VerticesEnum
+syn keyword juliaConstC ViscousHeatingEnum
+syn keyword juliaConstC WaterEnum
+syn keyword juliaConstC XTaylorHoodEnum
+syn keyword juliaConstC XYEnum
+syn keyword juliaConstC XYZEnum
+syn keyword juliaConstC BalancethicknessD0Enum
+syn keyword juliaConstC BalancethicknessDiffusionCoefficientEnum
+syn keyword juliaConstC BilinearInterpEnum
+syn keyword juliaConstC CalvingdevCoeffEnum
+syn keyword juliaConstC DeviatoricStressEnum
+syn keyword juliaConstC EtaAbsGradientEnum
+syn keyword juliaConstC MeshZEnum
+syn keyword juliaConstC NearestInterpEnum
+syn keyword juliaConstC OutputdefinitionListEnum
+syn keyword juliaConstC SealevelObsEnum
+syn keyword juliaConstC SealevelWeightsEnum
+syn keyword juliaConstC StrainRateEnum
+syn keyword juliaConstC StressTensorEnum
+syn keyword juliaConstC StressbalanceViscosityOvershootEnum
+syn keyword juliaConstC SubelementMigration4Enum
+syn keyword juliaConstC TimesteppingTimeAdaptEnum
+syn keyword juliaConstC TriangleInterpEnum
+syn keyword juliaConstC MaximumNumberOfDefinitionsEnum
+"ISSM Enums end
Index: /issm/trunk/src/c/shared/Enum/StringToEnumx.cpp
===================================================================
--- /issm/trunk/src/c/shared/Enum/StringToEnumx.cpp	(revision 26743)
+++ /issm/trunk/src/c/shared/Enum/StringToEnumx.cpp	(revision 26744)
@@ -65,4 +65,5 @@
 	      else if (strcmp(name,"AutodiffXp")==0) return AutodiffXpEnum;
 	      else if (strcmp(name,"BalancethicknessStabilization")==0) return BalancethicknessStabilizationEnum;
+	      else if (strcmp(name,"BarystaticContributions")==0) return BarystaticContributionsEnum;
 	      else if (strcmp(name,"BasalforcingsBottomplumedepth")==0) return BasalforcingsBottomplumedepthEnum;
 	      else if (strcmp(name,"BasalforcingsCrustthickness")==0) return BasalforcingsCrustthicknessEnum;
@@ -102,4 +103,5 @@
 	      else if (strcmp(name,"BasalforcingsUpperwaterMeltingRate")==0) return BasalforcingsUpperwaterMeltingRateEnum;
 	      else if (strcmp(name,"CalvingCrevasseDepth")==0) return CalvingCrevasseDepthEnum;
+	      else if (strcmp(name,"CalvingCrevasseThreshold")==0) return CalvingCrevasseThresholdEnum;
 	      else if (strcmp(name,"CalvingHeightAboveFloatation")==0) return CalvingHeightAboveFloatationEnum;
 	      else if (strcmp(name,"CalvingLaw")==0) return CalvingLawEnum;
@@ -107,4 +109,5 @@
 	      else if (strcmp(name,"ConfigurationType")==0) return ConfigurationTypeEnum;
 	      else if (strcmp(name,"ConstantsG")==0) return ConstantsGEnum;
+	      else if (strcmp(name,"ConstantsNewtonGravity")==0) return ConstantsNewtonGravityEnum;
 	      else if (strcmp(name,"ConstantsReferencetemperature")==0) return ConstantsReferencetemperatureEnum;
 	      else if (strcmp(name,"ConstantsYts")==0) return ConstantsYtsEnum;
@@ -112,11 +115,13 @@
 	      else if (strcmp(name,"ControlInputSizeN")==0) return ControlInputSizeNEnum;
 	      else if (strcmp(name,"ControlInputInterpolation")==0) return ControlInputInterpolationEnum;
-	      else if (strcmp(name,"CumBslr")==0) return CumBslrEnum;
-	      else if (strcmp(name,"CumBslrIce")==0) return CumBslrIceEnum;
-	      else if (strcmp(name,"CumBslrHydro")==0) return CumBslrHydroEnum;
-	      else if (strcmp(name,"CumBslrIcePartition")==0) return CumBslrIcePartitionEnum;
-	      else if (strcmp(name,"CumBslrHydroPartition")==0) return CumBslrHydroPartitionEnum;
-	      else if (strcmp(name,"CumGmtslr")==0) return CumGmtslrEnum;
-	      else if (strcmp(name,"CumGmslr")==0) return CumGmslrEnum;
+	      else if (strcmp(name,"CumBslc")==0) return CumBslcEnum;
+	      else if (strcmp(name,"CumBslcIce")==0) return CumBslcIceEnum;
+	      else if (strcmp(name,"CumBslcHydro")==0) return CumBslcHydroEnum;
+	      else if (strcmp(name,"CumBslcOcean")==0) return CumBslcOceanEnum;
+	      else if (strcmp(name,"CumBslcIcePartition")==0) return CumBslcIcePartitionEnum;
+	      else if (strcmp(name,"CumBslcHydroPartition")==0) return CumBslcHydroPartitionEnum;
+	      else if (strcmp(name,"CumBslcOceanPartition")==0) return CumBslcOceanPartitionEnum;
+	      else if (strcmp(name,"CumGmtslc")==0) return CumGmtslcEnum;
+	      else if (strcmp(name,"CumGmslc")==0) return CumGmslcEnum;
 	      else if (strcmp(name,"DamageC1")==0) return DamageC1Enum;
 	      else if (strcmp(name,"DamageC2")==0) return DamageC2Enum;
@@ -132,17 +137,22 @@
 	      else if (strcmp(name,"DamageMaxDamage")==0) return DamageMaxDamageEnum;
 	      else if (strcmp(name,"DamageStabilization")==0) return DamageStabilizationEnum;
-	      else if (strcmp(name,"DamageStressThreshold")==0) return DamageStressThresholdEnum;
+         else stage=2;
+   }
+   if(stage==2){
+	      if (strcmp(name,"DamageStressThreshold")==0) return DamageStressThresholdEnum;
 	      else if (strcmp(name,"DamageStressUBound")==0) return DamageStressUBoundEnum;
 	      else if (strcmp(name,"DebugProfiling")==0) return DebugProfilingEnum;
 	      else if (strcmp(name,"DomainDimension")==0) return DomainDimensionEnum;
 	      else if (strcmp(name,"DomainType")==0) return DomainTypeEnum;
-         else stage=2;
-   }
-   if(stage==2){
-	      if (strcmp(name,"DslModel")==0) return DslModelEnum;
+	      else if (strcmp(name,"DslModel")==0) return DslModelEnum;
 	      else if (strcmp(name,"DslModelid")==0) return DslModelidEnum;
 	      else if (strcmp(name,"DslNummodels")==0) return DslNummodelsEnum;
-	      else if (strcmp(name,"DslComputeFingerprints")==0) return DslComputeFingerprintsEnum;
+	      else if (strcmp(name,"SolidearthIsExternal")==0) return SolidearthIsExternalEnum;
+	      else if (strcmp(name,"SolidearthExternalNature")==0) return SolidearthExternalNatureEnum;
+	      else if (strcmp(name,"SolidearthExternalModelid")==0) return SolidearthExternalModelidEnum;
+	      else if (strcmp(name,"SolidearthExternalNummodels")==0) return SolidearthExternalNummodelsEnum;
+	      else if (strcmp(name,"SolidearthSettingsComputeBpGrd")==0) return SolidearthSettingsComputeBpGrdEnum;
 	      else if (strcmp(name,"EarthId")==0) return EarthIdEnum;
+	      else if (strcmp(name,"Elastic")==0) return ElasticEnum;
 	      else if (strcmp(name,"EplZigZagCounter")==0) return EplZigZagCounterEnum;
 	      else if (strcmp(name,"EsaHElastic")==0) return EsaHElasticEnum;
@@ -172,10 +182,13 @@
 	      else if (strcmp(name,"FrictionVoidRatio")==0) return FrictionVoidRatioEnum;
 	      else if (strcmp(name,"FrontalForcingsBasinIcefrontArea")==0) return FrontalForcingsBasinIcefrontAreaEnum;
+	      else if (strcmp(name,"FrontalForcingsAutoregressionInitialTime")==0) return FrontalForcingsAutoregressionInitialTimeEnum;
+	      else if (strcmp(name,"FrontalForcingsAutoregressionTimestep")==0) return FrontalForcingsAutoregressionTimestepEnum;
+	      else if (strcmp(name,"FrontalForcingsAutoregressiveOrder")==0) return FrontalForcingsAutoregressiveOrderEnum;
+	      else if (strcmp(name,"FrontalForcingsBeta0")==0) return FrontalForcingsBeta0Enum;
+	      else if (strcmp(name,"FrontalForcingsBeta1")==0) return FrontalForcingsBeta1Enum;
 	      else if (strcmp(name,"FrontalForcingsNumberofBasins")==0) return FrontalForcingsNumberofBasinsEnum;
 	      else if (strcmp(name,"FrontalForcingsParam")==0) return FrontalForcingsParamEnum;
-	      else if (strcmp(name,"GiaModel")==0) return GiaModelEnum;
-	      else if (strcmp(name,"GiaModelid")==0) return GiaModelidEnum;
-	      else if (strcmp(name,"GiaNummodels")==0) return GiaNummodelsEnum;
-	      else if (strcmp(name,"GiaCrossSectionShape")==0) return GiaCrossSectionShapeEnum;
+	      else if (strcmp(name,"FrontalForcingsPhi")==0) return FrontalForcingsPhiEnum;
+	      else if (strcmp(name,"GrdModel")==0) return GrdModelEnum;
 	      else if (strcmp(name,"GroundinglineFrictionInterpolation")==0) return GroundinglineFrictionInterpolationEnum;
 	      else if (strcmp(name,"GroundinglineMeltInterpolation")==0) return GroundinglineMeltInterpolationEnum;
@@ -247,5 +260,10 @@
 	      else if (strcmp(name,"InversionNumCostFunctions")==0) return InversionNumCostFunctionsEnum;
 	      else if (strcmp(name,"InversionStepThreshold")==0) return InversionStepThresholdEnum;
-	      else if (strcmp(name,"InversionType")==0) return InversionTypeEnum;
+         else stage=3;
+   }
+   if(stage==3){
+	      if (strcmp(name,"InversionType")==0) return InversionTypeEnum;
+	      else if (strcmp(name,"Ivins")==0) return IvinsEnum;
+	      else if (strcmp(name,"IsSlcCoupling")==0) return IsSlcCouplingEnum;
 	      else if (strcmp(name,"LevelsetKillIcebergs")==0) return LevelsetKillIcebergsEnum;
 	      else if (strcmp(name,"LevelsetReinitFrequency")==0) return LevelsetReinitFrequencyEnum;
@@ -253,16 +271,24 @@
 	      else if (strcmp(name,"LockFileName")==0) return LockFileNameEnum;
 	      else if (strcmp(name,"LoveAllowLayerDeletion")==0) return LoveAllowLayerDeletionEnum;
+	      else if (strcmp(name,"LoveCoreMantleBoundary")==0) return LoveCoreMantleBoundaryEnum;
+	      else if (strcmp(name,"LoveEarthMass")==0) return LoveEarthMassEnum;
 	      else if (strcmp(name,"LoveForcingType")==0) return LoveForcingTypeEnum;
 	      else if (strcmp(name,"LoveFrequencies")==0) return LoveFrequenciesEnum;
+	      else if (strcmp(name,"LoveIsTemporal")==0) return LoveIsTemporalEnum;
 	      else if (strcmp(name,"LoveG0")==0) return LoveG0Enum;
+	      else if (strcmp(name,"LoveGravitationalConstant")==0) return LoveGravitationalConstantEnum;
+	      else if (strcmp(name,"LoveInnerCoreBoundary")==0) return LoveInnerCoreBoundaryEnum;
+	      else if (strcmp(name,"LoveComplexComputation")==0) return LoveComplexComputationEnum;
+	      else if (strcmp(name,"LoveIntStepsPerLayer")==0) return LoveIntStepsPerLayerEnum;
 	      else if (strcmp(name,"LoveKernels")==0) return LoveKernelsEnum;
 	      else if (strcmp(name,"LoveMu0")==0) return LoveMu0Enum;
 	      else if (strcmp(name,"LoveNfreq")==0) return LoveNfreqEnum;
+	      else if (strcmp(name,"LoveNTemporalIterations")==0) return LoveNTemporalIterationsEnum;
+	      else if (strcmp(name,"LoveNYiEquations")==0) return LoveNYiEquationsEnum;
 	      else if (strcmp(name,"LoveR0")==0) return LoveR0Enum;
-         else stage=3;
-   }
-   if(stage==3){
-	      if (strcmp(name,"LoveShNmax")==0) return LoveShNmaxEnum;
+	      else if (strcmp(name,"LoveShNmax")==0) return LoveShNmaxEnum;
 	      else if (strcmp(name,"LoveShNmin")==0) return LoveShNminEnum;
+	      else if (strcmp(name,"LoveStartingLayer")==0) return LoveStartingLayerEnum;
+	      else if (strcmp(name,"LoveUnderflowTol")==0) return LoveUnderflowTolEnum;
 	      else if (strcmp(name,"MassFluxSegments")==0) return MassFluxSegmentsEnum;
 	      else if (strcmp(name,"MassFluxSegmentsPresent")==0) return MassFluxSegmentsPresentEnum;
@@ -279,8 +305,4 @@
 	      else if (strcmp(name,"MaterialsHeatcapacity")==0) return MaterialsHeatcapacityEnum;
 	      else if (strcmp(name,"MaterialsLatentheat")==0) return MaterialsLatentheatEnum;
-	      else if (strcmp(name,"MaterialsLithosphereDensity")==0) return MaterialsLithosphereDensityEnum;
-	      else if (strcmp(name,"MaterialsLithosphereShearModulus")==0) return MaterialsLithosphereShearModulusEnum;
-	      else if (strcmp(name,"MaterialsMantleDensity")==0) return MaterialsMantleDensityEnum;
-	      else if (strcmp(name,"MaterialsMantleShearModulus")==0) return MaterialsMantleShearModulusEnum;
 	      else if (strcmp(name,"MaterialsMeltingpoint")==0) return MaterialsMeltingpointEnum;
 	      else if (strcmp(name,"MaterialsMixedLayerCapacity")==0) return MaterialsMixedLayerCapacityEnum;
@@ -298,4 +320,5 @@
 	      else if (strcmp(name,"MeshNumberoflayers")==0) return MeshNumberoflayersEnum;
 	      else if (strcmp(name,"MeshNumberofvertices")==0) return MeshNumberofverticesEnum;
+	      else if (strcmp(name,"MeshNumberofelements")==0) return MeshNumberofelementsEnum;
 	      else if (strcmp(name,"MigrationMax")==0) return MigrationMaxEnum;
 	      else if (strcmp(name,"ModelId")==0) return ModelIdEnum;
@@ -336,15 +359,32 @@
 	      else if (strcmp(name,"RootPath")==0) return RootPathEnum;
 	      else if (strcmp(name,"Modelname")==0) return ModelnameEnum;
+	      else if (strcmp(name,"SamplingAlpha")==0) return SamplingAlphaEnum;
+	      else if (strcmp(name,"SamplingPhi")==0) return SamplingPhiEnum;
+	      else if (strcmp(name,"SamplingNumRequestedOutputs")==0) return SamplingNumRequestedOutputsEnum;
+	      else if (strcmp(name,"SamplingRequestedOutputs")==0) return SamplingRequestedOutputsEnum;
+	      else if (strcmp(name,"SamplingRobin")==0) return SamplingRobinEnum;
+	      else if (strcmp(name,"SamplingSeed")==0) return SamplingSeedEnum;
+	      else if (strcmp(name,"SamplingTau")==0) return SamplingTauEnum;
 	      else if (strcmp(name,"SaveResults")==0) return SaveResultsEnum;
 	      else if (strcmp(name,"SolidearthPartitionIce")==0) return SolidearthPartitionIceEnum;
 	      else if (strcmp(name,"SolidearthPartitionHydro")==0) return SolidearthPartitionHydroEnum;
+	      else if (strcmp(name,"SolidearthPartitionOcean")==0) return SolidearthPartitionOceanEnum;
 	      else if (strcmp(name,"SolidearthNpartIce")==0) return SolidearthNpartIceEnum;
+	      else if (strcmp(name,"SolidearthNpartOcean")==0) return SolidearthNpartOceanEnum;
 	      else if (strcmp(name,"SolidearthNpartHydro")==0) return SolidearthNpartHydroEnum;
 	      else if (strcmp(name,"SolidearthPlanetRadius")==0) return SolidearthPlanetRadiusEnum;
 	      else if (strcmp(name,"SolidearthPlanetArea")==0) return SolidearthPlanetAreaEnum;
 	      else if (strcmp(name,"SolidearthSettingsAbstol")==0) return SolidearthSettingsAbstolEnum;
+	      else if (strcmp(name,"SolidearthSettingsCrossSectionShape")==0) return SolidearthSettingsCrossSectionShapeEnum;
 	      else if (strcmp(name,"RotationalAngularVelocity")==0) return RotationalAngularVelocityEnum;
 	      else if (strcmp(name,"SolidearthSettingsElastic")==0) return SolidearthSettingsElasticEnum;
-	      else if (strcmp(name,"SealevelriseGeometryDone")==0) return SealevelriseGeometryDoneEnum;
+	      else if (strcmp(name,"SolidearthSettingsViscous")==0) return SolidearthSettingsViscousEnum;
+	      else if (strcmp(name,"SealevelchangeGeometryDone")==0) return SealevelchangeGeometryDoneEnum;
+	      else if (strcmp(name,"SealevelchangeViscousNumSteps")==0) return SealevelchangeViscousNumStepsEnum;
+	      else if (strcmp(name,"SealevelchangeViscousTimes")==0) return SealevelchangeViscousTimesEnum;
+         else stage=4;
+   }
+   if(stage==4){
+	      if (strcmp(name,"SealevelchangeViscousIndex")==0) return SealevelchangeViscousIndexEnum;
 	      else if (strcmp(name,"RotationalEquatorialMoi")==0) return RotationalEquatorialMoiEnum;
 	      else if (strcmp(name,"TidalLoveH")==0) return TidalLoveHEnum;
@@ -355,22 +395,35 @@
 	      else if (strcmp(name,"LoadLoveK")==0) return LoadLoveKEnum;
 	      else if (strcmp(name,"LoadLoveL")==0) return LoadLoveLEnum;
-	      else if (strcmp(name,"SealevelriseGRigid")==0) return SealevelriseGRigidEnum;
-	      else if (strcmp(name,"SealevelriseGElastic")==0) return SealevelriseGElasticEnum;
-	      else if (strcmp(name,"SolidearthSettingsComputesealevelchange")==0) return SolidearthSettingsComputesealevelchangeEnum;
+	      else if (strcmp(name,"LoveTimeFreq")==0) return LoveTimeFreqEnum;
+	      else if (strcmp(name,"LoveIsTime")==0) return LoveIsTimeEnum;
+	      else if (strcmp(name,"SealevelchangeGSelfAttraction")==0) return SealevelchangeGSelfAttractionEnum;
+	      else if (strcmp(name,"SealevelchangeGViscoElastic")==0) return SealevelchangeGViscoElasticEnum;
+	      else if (strcmp(name,"SolidearthSettingsSealevelLoading")==0) return SolidearthSettingsSealevelLoadingEnum;
 	      else if (strcmp(name,"SolidearthSettingsGRD")==0) return SolidearthSettingsGRDEnum;
-	      else if (strcmp(name,"SolidearthSettingsGlfraction")==0) return SolidearthSettingsGlfractionEnum;
 	      else if (strcmp(name,"SolidearthSettingsRunFrequency")==0) return SolidearthSettingsRunFrequencyEnum;
-	      else if (strcmp(name,"SealevelriseHElastic")==0) return SealevelriseHElasticEnum;
+	      else if (strcmp(name,"SolidearthSettingsTimeAcc")==0) return SolidearthSettingsTimeAccEnum;
+	      else if (strcmp(name,"SealevelchangeHViscoElastic")==0) return SealevelchangeHViscoElasticEnum;
 	      else if (strcmp(name,"SolidearthSettingsHoriz")==0) return SolidearthSettingsHorizEnum;
 	      else if (strcmp(name,"SolidearthSettingsMaxiter")==0) return SolidearthSettingsMaxiterEnum;
+	      else if (strcmp(name,"SolidearthSettingsGrdOcean")==0) return SolidearthSettingsGrdOceanEnum;
 	      else if (strcmp(name,"SolidearthSettingsOceanAreaScaling")==0) return SolidearthSettingsOceanAreaScalingEnum;
+	      else if (strcmp(name,"StochasticForcingCovariance")==0) return StochasticForcingCovarianceEnum;
+	      else if (strcmp(name,"StochasticForcingDefaultDimension")==0) return StochasticForcingDefaultDimensionEnum;
+	      else if (strcmp(name,"StochasticForcingDimensions")==0) return StochasticForcingDimensionsEnum;
+	      else if (strcmp(name,"StochasticForcingFields")==0) return StochasticForcingFieldsEnum;
+	      else if (strcmp(name,"StochasticForcingIsEffectivePressure")==0) return StochasticForcingIsEffectivePressureEnum;
+	      else if (strcmp(name,"StochasticForcingIsStochasticForcing")==0) return StochasticForcingIsStochasticForcingEnum;
+	      else if (strcmp(name,"StochasticForcingIsWaterPressure")==0) return StochasticForcingIsWaterPressureEnum;
+	      else if (strcmp(name,"StochasticForcingNumFields")==0) return StochasticForcingNumFieldsEnum;
+	      else if (strcmp(name,"StochasticForcingRandomflag")==0) return StochasticForcingRandomflagEnum;
 	      else if (strcmp(name,"RotationalPolarMoi")==0) return RotationalPolarMoiEnum;
 	      else if (strcmp(name,"SolidearthSettingsReltol")==0) return SolidearthSettingsReltolEnum;
-	      else if (strcmp(name,"SealevelriseRequestedOutputs")==0) return SealevelriseRequestedOutputsEnum;
-	      else if (strcmp(name,"SolidearthSettingsRigid")==0) return SolidearthSettingsRigidEnum;
+	      else if (strcmp(name,"SealevelchangeRequestedOutputs")==0) return SealevelchangeRequestedOutputsEnum;
+	      else if (strcmp(name,"SolidearthSettingsSelfAttraction")==0) return SolidearthSettingsSelfAttractionEnum;
 	      else if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
-	      else if (strcmp(name,"SealevelriseRunCount")==0) return SealevelriseRunCountEnum;
-	      else if (strcmp(name,"SealevelriseTransitions")==0) return SealevelriseTransitionsEnum;
-	      else if (strcmp(name,"SealevelriseUElastic")==0) return SealevelriseUElasticEnum;
+	      else if (strcmp(name,"SolidearthSettingsMaxSHCoeff")==0) return SolidearthSettingsMaxSHCoeffEnum;
+	      else if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
+	      else if (strcmp(name,"SealevelchangeTransitions")==0) return SealevelchangeTransitionsEnum;
+	      else if (strcmp(name,"SealevelchangeUViscoElastic")==0) return SealevelchangeUViscoElasticEnum;
 	      else if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
 	      else if (strcmp(name,"SettingsNumResultsOnNodes")==0) return SettingsNumResultsOnNodesEnum;
@@ -383,13 +436,15 @@
 	      else if (strcmp(name,"SmbAIce")==0) return SmbAIceEnum;
 	      else if (strcmp(name,"SmbAIdx")==0) return SmbAIdxEnum;
-         else stage=4;
-   }
-   if(stage==4){
-	      if (strcmp(name,"SmbASnow")==0) return SmbASnowEnum;
+	      else if (strcmp(name,"SmbASnow")==0) return SmbASnowEnum;
 	      else if (strcmp(name,"SmbAccualti")==0) return SmbAccualtiEnum;
 	      else if (strcmp(name,"SmbAccugrad")==0) return SmbAccugradEnum;
 	      else if (strcmp(name,"SmbAccuref")==0) return SmbAccurefEnum;
 	      else if (strcmp(name,"SmbAdThresh")==0) return SmbAdThreshEnum;
+	      else if (strcmp(name,"SmbAutoregressionInitialTime")==0) return SmbAutoregressionInitialTimeEnum;
+	      else if (strcmp(name,"SmbAutoregressionTimestep")==0) return SmbAutoregressionTimestepEnum;
+	      else if (strcmp(name,"SmbAutoregressiveOrder")==0) return SmbAutoregressiveOrderEnum;
 	      else if (strcmp(name,"SmbAveraging")==0) return SmbAveragingEnum;
+	      else if (strcmp(name,"SmbBeta0")==0) return SmbBeta0Enum;
+	      else if (strcmp(name,"SmbBeta1")==0) return SmbBeta1Enum;
 	      else if (strcmp(name,"SmbDesfac")==0) return SmbDesfacEnum;
 	      else if (strcmp(name,"SmbDpermil")==0) return SmbDpermilEnum;
@@ -401,13 +456,14 @@
 	      else if (strcmp(name,"SmbDt")==0) return SmbDtEnum;
 	      else if (strcmp(name,"Smb")==0) return SmbEnum;
+	      else if (strcmp(name,"SmbEIdx")==0) return SmbEIdxEnum;
 	      else if (strcmp(name,"SmbF")==0) return SmbFEnum;
 	      else if (strcmp(name,"SmbInitDensityScaling")==0) return SmbInitDensityScalingEnum;
 	      else if (strcmp(name,"SmbIsaccumulation")==0) return SmbIsaccumulationEnum;
 	      else if (strcmp(name,"SmbIsalbedo")==0) return SmbIsalbedoEnum;
-	      else if (strcmp(name,"SmbIsclimatology")==0) return SmbIsclimatologyEnum;
 	      else if (strcmp(name,"SmbIsconstrainsurfaceT")==0) return SmbIsconstrainsurfaceTEnum;
 	      else if (strcmp(name,"SmbIsd18opd")==0) return SmbIsd18opdEnum;
 	      else if (strcmp(name,"SmbIsdelta18o")==0) return SmbIsdelta18oEnum;
 	      else if (strcmp(name,"SmbIsdensification")==0) return SmbIsdensificationEnum;
+	      else if (strcmp(name,"SmbIsdeltaLWup")==0) return SmbIsdeltaLWupEnum;
 	      else if (strcmp(name,"SmbIsfirnwarming")==0) return SmbIsfirnwarmingEnum;
 	      else if (strcmp(name,"SmbIsgraingrowth")==0) return SmbIsgraingrowthEnum;
@@ -421,6 +477,8 @@
 	      else if (strcmp(name,"SmbIsturbulentflux")==0) return SmbIsturbulentfluxEnum;
 	      else if (strcmp(name,"SmbK")==0) return SmbKEnum;
+	      else if (strcmp(name,"SmbNumBasins")==0) return SmbNumBasinsEnum;
 	      else if (strcmp(name,"SmbNumRequestedOutputs")==0) return SmbNumRequestedOutputsEnum;
 	      else if (strcmp(name,"SmbPfac")==0) return SmbPfacEnum;
+	      else if (strcmp(name,"SmbPhi")==0) return SmbPhiEnum;
 	      else if (strcmp(name,"SmbRdl")==0) return SmbRdlEnum;
 	      else if (strcmp(name,"SmbRequestedOutputs")==0) return SmbRequestedOutputsEnum;
@@ -435,4 +493,5 @@
 	      else if (strcmp(name,"SmbT0dry")==0) return SmbT0dryEnum;
 	      else if (strcmp(name,"SmbT0wet")==0) return SmbT0wetEnum;
+	      else if (strcmp(name,"SmbTeThresh")==0) return SmbTeThreshEnum;
 	      else if (strcmp(name,"SmbTdiff")==0) return SmbTdiffEnum;
 	      else if (strcmp(name,"SmbThermoDeltaTScaling")==0) return SmbThermoDeltaTScalingEnum;
@@ -447,5 +506,8 @@
 	      else if (strcmp(name,"Step")==0) return StepEnum;
 	      else if (strcmp(name,"Steps")==0) return StepsEnum;
-	      else if (strcmp(name,"StressbalanceAbstol")==0) return StressbalanceAbstolEnum;
+         else stage=5;
+   }
+   if(stage==5){
+	      if (strcmp(name,"StressbalanceAbstol")==0) return StressbalanceAbstolEnum;
 	      else if (strcmp(name,"StressbalanceFSreconditioning")==0) return StressbalanceFSreconditioningEnum;
 	      else if (strcmp(name,"StressbalanceIsnewton")==0) return StressbalanceIsnewtonEnum;
@@ -474,5 +536,6 @@
 	      else if (strcmp(name,"TimesteppingCouplingTime")==0) return TimesteppingCouplingTimeEnum;
 	      else if (strcmp(name,"TimesteppingFinalTime")==0) return TimesteppingFinalTimeEnum;
-	      else if (strcmp(name,"TimesteppingInterpForcings")==0) return TimesteppingInterpForcingsEnum;
+	      else if (strcmp(name,"TimesteppingInterpForcing")==0) return TimesteppingInterpForcingEnum;
+	      else if (strcmp(name,"TimesteppingCycleForcing")==0) return TimesteppingCycleForcingEnum;
 	      else if (strcmp(name,"TimesteppingStartTime")==0) return TimesteppingStartTimeEnum;
 	      else if (strcmp(name,"TimesteppingTimeStep")==0) return TimesteppingTimeStepEnum;
@@ -486,5 +549,4 @@
 	      else if (strcmp(name,"ToolkitsTypes")==0) return ToolkitsTypesEnum;
 	      else if (strcmp(name,"TransientAmrFrequency")==0) return TransientAmrFrequencyEnum;
-	      else if (strcmp(name,"TransientIscoupler")==0) return TransientIscouplerEnum;
 	      else if (strcmp(name,"TransientIsdamageevolution")==0) return TransientIsdamageevolutionEnum;
 	      else if (strcmp(name,"TransientIsesa")==0) return TransientIsesaEnum;
@@ -493,7 +555,9 @@
 	      else if (strcmp(name,"TransientIshydrology")==0) return TransientIshydrologyEnum;
 	      else if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
+	      else if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
 	      else if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
 	      else if (strcmp(name,"TransientIsoceancoupling")==0) return TransientIsoceancouplingEnum;
-	      else if (strcmp(name,"TransientIsslr")==0) return TransientIsslrEnum;
+	      else if (strcmp(name,"TransientIssampling")==0) return TransientIssamplingEnum;
+	      else if (strcmp(name,"TransientIsslc")==0) return TransientIsslcEnum;
 	      else if (strcmp(name,"TransientIssmb")==0) return TransientIssmbEnum;
 	      else if (strcmp(name,"TransientIsstressbalance")==0) return TransientIsstressbalanceEnum;
@@ -502,14 +566,22 @@
 	      else if (strcmp(name,"TransientRequestedOutputs")==0) return TransientRequestedOutputsEnum;
 	      else if (strcmp(name,"Velocity")==0) return VelocityEnum;
+	      else if (strcmp(name,"Xxe")==0) return XxeEnum;
+	      else if (strcmp(name,"Yye")==0) return YyeEnum;
+	      else if (strcmp(name,"Zze")==0) return ZzeEnum;
+	      else if (strcmp(name,"Areae")==0) return AreaeEnum;
 	      else if (strcmp(name,"WorldComm")==0) return WorldCommEnum;
 	      else if (strcmp(name,"ParametersEND")==0) return ParametersENDEnum;
 	      else if (strcmp(name,"InputsSTART")==0) return InputsSTARTEnum;
+	      else if (strcmp(name,"AccumulatedDeltaBottomPressure")==0) return AccumulatedDeltaBottomPressureEnum;
+	      else if (strcmp(name,"AccumulatedDeltaIceThickness")==0) return AccumulatedDeltaIceThicknessEnum;
+	      else if (strcmp(name,"AccumulatedDeltaTws")==0) return AccumulatedDeltaTwsEnum;
 	      else if (strcmp(name,"Adjoint")==0) return AdjointEnum;
-         else stage=5;
-   }
-   if(stage==5){
-	      if (strcmp(name,"Adjointp")==0) return AdjointpEnum;
+	      else if (strcmp(name,"Adjointp")==0) return AdjointpEnum;
 	      else if (strcmp(name,"Adjointx")==0) return AdjointxEnum;
+	      else if (strcmp(name,"AdjointxBase")==0) return AdjointxBaseEnum;
+	      else if (strcmp(name,"AdjointxShear")==0) return AdjointxShearEnum;
 	      else if (strcmp(name,"Adjointy")==0) return AdjointyEnum;
+	      else if (strcmp(name,"AdjointyBase")==0) return AdjointyBaseEnum;
+	      else if (strcmp(name,"AdjointyShear")==0) return AdjointyShearEnum;
 	      else if (strcmp(name,"Adjointz")==0) return AdjointzEnum;
 	      else if (strcmp(name,"Air")==0) return AirEnum;
@@ -545,7 +617,20 @@
 	      else if (strcmp(name,"BaseSlopeX")==0) return BaseSlopeXEnum;
 	      else if (strcmp(name,"BaseSlopeY")==0) return BaseSlopeYEnum;
+	      else if (strcmp(name,"BaselineBasalforcingsFloatingiceMeltingRate")==0) return BaselineBasalforcingsFloatingiceMeltingRateEnum;
+	      else if (strcmp(name,"BaselineCalvingCalvingrate")==0) return BaselineCalvingCalvingrateEnum;
+	      else if (strcmp(name,"BaselineFrictionEffectivePressure")==0) return BaselineFrictionEffectivePressureEnum;
 	      else if (strcmp(name,"Bed")==0) return BedEnum;
+	      else if (strcmp(name,"BedGRD")==0) return BedGRDEnum;
+	      else if (strcmp(name,"BedEast")==0) return BedEastEnum;
+	      else if (strcmp(name,"BedEastGRD")==0) return BedEastGRDEnum;
+	      else if (strcmp(name,"BedNorth")==0) return BedNorthEnum;
+	      else if (strcmp(name,"BedNorthGRD")==0) return BedNorthGRDEnum;
 	      else if (strcmp(name,"BedSlopeX")==0) return BedSlopeXEnum;
 	      else if (strcmp(name,"BedSlopeY")==0) return BedSlopeYEnum;
+	      else if (strcmp(name,"BottomPressure")==0) return BottomPressureEnum;
+         else stage=6;
+   }
+   if(stage==6){
+	      if (strcmp(name,"BottomPressureOld")==0) return BottomPressureOldEnum;
 	      else if (strcmp(name,"CalvingCalvingrate")==0) return CalvingCalvingrateEnum;
 	      else if (strcmp(name,"CalvingHabFraction")==0) return CalvingHabFractionEnum;
@@ -569,4 +654,13 @@
 	      else if (strcmp(name,"DegreeOfChannelization")==0) return DegreeOfChannelizationEnum;
 	      else if (strcmp(name,"DepthBelowSurface")==0) return DepthBelowSurfaceEnum;
+	      else if (strcmp(name,"DeltaIceThickness")==0) return DeltaIceThicknessEnum;
+	      else if (strcmp(name,"DeltaTws")==0) return DeltaTwsEnum;
+	      else if (strcmp(name,"DeltaBottomPressure")==0) return DeltaBottomPressureEnum;
+	      else if (strcmp(name,"DeltaDsl")==0) return DeltaDslEnum;
+	      else if (strcmp(name,"DslOld")==0) return DslOldEnum;
+	      else if (strcmp(name,"Dsl")==0) return DslEnum;
+	      else if (strcmp(name,"DeltaStr")==0) return DeltaStrEnum;
+	      else if (strcmp(name,"StrOld")==0) return StrOldEnum;
+	      else if (strcmp(name,"Str")==0) return StrEnum;
 	      else if (strcmp(name,"DeviatoricStresseffective")==0) return DeviatoricStresseffectiveEnum;
 	      else if (strcmp(name,"DeviatoricStressxx")==0) return DeviatoricStressxxEnum;
@@ -586,11 +680,4 @@
 	      else if (strcmp(name,"DrivingStressX")==0) return DrivingStressXEnum;
 	      else if (strcmp(name,"DrivingStressY")==0) return DrivingStressYEnum;
-	      else if (strcmp(name,"DslGlobalAverageThermostericSeaLevelChange")==0) return DslGlobalAverageThermostericSeaLevelChangeEnum;
-	      else if (strcmp(name,"DslSeaSurfaceHeightChangeAboveGeoid")==0) return DslSeaSurfaceHeightChangeAboveGeoidEnum;
-	      else if (strcmp(name,"DslSeaWaterPressureChangeAtSeaFloor")==0) return DslSeaWaterPressureChangeAtSeaFloorEnum;
-	      else if (strcmp(name,"DslStericRate")==0) return DslStericRateEnum;
-	      else if (strcmp(name,"DslDynamicRate")==0) return DslDynamicRateEnum;
-	      else if (strcmp(name,"GiaMmeNgia")==0) return GiaMmeNgiaEnum;
-	      else if (strcmp(name,"GiaMmeUgia")==0) return GiaMmeUgiaEnum;
 	      else if (strcmp(name,"Dummy")==0) return DummyEnum;
 	      else if (strcmp(name,"EffectivePressure")==0) return EffectivePressureEnum;
@@ -605,5 +692,4 @@
 	      else if (strcmp(name,"EplHeadSubstep")==0) return EplHeadSubstepEnum;
 	      else if (strcmp(name,"EplHeadTransient")==0) return EplHeadTransientEnum;
-	      else if (strcmp(name,"EsaDeltathickness")==0) return EsaDeltathicknessEnum;
 	      else if (strcmp(name,"EsaEmotion")==0) return EsaEmotionEnum;
 	      else if (strcmp(name,"EsaNmotion")==0) return EsaNmotionEnum;
@@ -629,8 +715,5 @@
 	      else if (strcmp(name,"FrictionSedimentCompressibilityCoefficient")==0) return FrictionSedimentCompressibilityCoefficientEnum;
 	      else if (strcmp(name,"FrictionTillFrictionAngle")==0) return FrictionTillFrictionAngleEnum;
-         else stage=6;
-   }
-   if(stage==6){
-	      if (strcmp(name,"FrictionWaterLayer")==0) return FrictionWaterLayerEnum;
+	      else if (strcmp(name,"FrictionWaterLayer")==0) return FrictionWaterLayerEnum;
 	      else if (strcmp(name,"Frictionf")==0) return FrictionfEnum;
 	      else if (strcmp(name,"FrontalForcingsBasinId")==0) return FrontalForcingsBasinIdEnum;
@@ -638,6 +721,4 @@
 	      else if (strcmp(name,"FrontalForcingsThermalForcing")==0) return FrontalForcingsThermalForcingEnum;
 	      else if (strcmp(name,"GeometryHydrostaticRatio")==0) return GeometryHydrostaticRatioEnum;
-	      else if (strcmp(name,"GiaLithosphereThickness")==0) return GiaLithosphereThicknessEnum;
-	      else if (strcmp(name,"GiaMantleViscosity")==0) return GiaMantleViscosityEnum;
 	      else if (strcmp(name,"NGia")==0) return NGiaEnum;
 	      else if (strcmp(name,"NGiaRate")==0) return NGiaRateEnum;
@@ -664,12 +745,22 @@
 	      else if (strcmp(name,"HydrologyEnglacialInput")==0) return HydrologyEnglacialInputEnum;
 	      else if (strcmp(name,"HydrologyGapHeight")==0) return HydrologyGapHeightEnum;
+	      else if (strcmp(name,"HydrologyGapHeightX")==0) return HydrologyGapHeightXEnum;
+	      else if (strcmp(name,"HydrologyGapHeightXX")==0) return HydrologyGapHeightXXEnum;
+	      else if (strcmp(name,"HydrologyGapHeightY")==0) return HydrologyGapHeightYEnum;
+	      else if (strcmp(name,"HydrologyGapHeightYY")==0) return HydrologyGapHeightYYEnum;
 	      else if (strcmp(name,"HydrologyHead")==0) return HydrologyHeadEnum;
 	      else if (strcmp(name,"HydrologyHeadOld")==0) return HydrologyHeadOldEnum;
 	      else if (strcmp(name,"HydrologyMoulinInput")==0) return HydrologyMoulinInputEnum;
-	      else if (strcmp(name,"HydrologyNeumannflux")==0) return HydrologyNeumannfluxEnum;
+         else stage=7;
+   }
+   if(stage==7){
+	      if (strcmp(name,"HydrologyNeumannflux")==0) return HydrologyNeumannfluxEnum;
 	      else if (strcmp(name,"HydrologyReynolds")==0) return HydrologyReynoldsEnum;
 	      else if (strcmp(name,"HydrologySheetConductivity")==0) return HydrologySheetConductivityEnum;
 	      else if (strcmp(name,"HydrologySheetThickness")==0) return HydrologySheetThicknessEnum;
 	      else if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum;
+	      else if (strcmp(name,"HydrologyTws")==0) return HydrologyTwsEnum;
+	      else if (strcmp(name,"HydrologyTwsSpc")==0) return HydrologyTwsSpcEnum;
+	      else if (strcmp(name,"HydrologyTwsAnalysis")==0) return HydrologyTwsAnalysisEnum;
 	      else if (strcmp(name,"HydrologyWatercolumnMax")==0) return HydrologyWatercolumnMaxEnum;
 	      else if (strcmp(name,"HydrologyWaterVx")==0) return HydrologyWaterVxEnum;
@@ -686,4 +777,5 @@
 	      else if (strcmp(name,"LevelsetfunctionSlopeX")==0) return LevelsetfunctionSlopeXEnum;
 	      else if (strcmp(name,"LevelsetfunctionSlopeY")==0) return LevelsetfunctionSlopeYEnum;
+	      else if (strcmp(name,"LevelsetObservation")==0) return LevelsetObservationEnum;
 	      else if (strcmp(name,"LoadingforceX")==0) return LoadingforceXEnum;
 	      else if (strcmp(name,"LoadingforceY")==0) return LoadingforceYEnum;
@@ -691,4 +783,5 @@
 	      else if (strcmp(name,"MaskOceanLevelset")==0) return MaskOceanLevelsetEnum;
 	      else if (strcmp(name,"MaskIceLevelset")==0) return MaskIceLevelsetEnum;
+	      else if (strcmp(name,"MaskIceRefLevelset")==0) return MaskIceRefLevelsetEnum;
 	      else if (strcmp(name,"MasstransportSpcthickness")==0) return MasstransportSpcthicknessEnum;
 	      else if (strcmp(name,"MaterialsRheologyB")==0) return MaterialsRheologyBEnum;
@@ -706,8 +799,13 @@
 	      else if (strcmp(name,"MeshVertexonsurface")==0) return MeshVertexonsurfaceEnum;
 	      else if (strcmp(name,"Misfit")==0) return MisfitEnum;
+	      else if (strcmp(name,"MovingFrontalVx")==0) return MovingFrontalVxEnum;
+	      else if (strcmp(name,"MovingFrontalVy")==0) return MovingFrontalVyEnum;
 	      else if (strcmp(name,"Neumannflux")==0) return NeumannfluxEnum;
 	      else if (strcmp(name,"NewDamage")==0) return NewDamageEnum;
 	      else if (strcmp(name,"Node")==0) return NodeEnum;
 	      else if (strcmp(name,"OmegaAbsGradient")==0) return OmegaAbsGradientEnum;
+	      else if (strcmp(name,"OceantransportSpcbottompressure")==0) return OceantransportSpcbottompressureEnum;
+	      else if (strcmp(name,"OceantransportSpcstr")==0) return OceantransportSpcstrEnum;
+	      else if (strcmp(name,"OceantransportSpcdsl")==0) return OceantransportSpcdslEnum;
 	      else if (strcmp(name,"P0")==0) return P0Enum;
 	      else if (strcmp(name,"P1")==0) return P1Enum;
@@ -724,36 +822,84 @@
 	      else if (strcmp(name,"RheologyBInitialguessMisfit")==0) return RheologyBInitialguessMisfitEnum;
 	      else if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
+	      else if (strcmp(name,"Sample")==0) return SampleEnum;
+	      else if (strcmp(name,"SamplingBeta")==0) return SamplingBetaEnum;
+	      else if (strcmp(name,"SamplingKappa")==0) return SamplingKappaEnum;
 	      else if (strcmp(name,"Sealevel")==0) return SealevelEnum;
-	      else if (strcmp(name,"SealevelEustaticMask")==0) return SealevelEustaticMaskEnum;
-	      else if (strcmp(name,"SealevelEustaticOceanMask")==0) return SealevelEustaticOceanMaskEnum;
+	      else if (strcmp(name,"SealevelGRD")==0) return SealevelGRDEnum;
+	      else if (strcmp(name,"SealevelBarystaticMask")==0) return SealevelBarystaticMaskEnum;
+	      else if (strcmp(name,"SealevelBarystaticIceMask")==0) return SealevelBarystaticIceMaskEnum;
+	      else if (strcmp(name,"SealevelBarystaticIceWeights")==0) return SealevelBarystaticIceWeightsEnum;
+	      else if (strcmp(name,"SealevelBarystaticIceArea")==0) return SealevelBarystaticIceAreaEnum;
+	      else if (strcmp(name,"SealevelBarystaticIceLatbar")==0) return SealevelBarystaticIceLatbarEnum;
+	      else if (strcmp(name,"SealevelBarystaticIceLongbar")==0) return SealevelBarystaticIceLongbarEnum;
+	      else if (strcmp(name,"SealevelBarystaticIceLoad")==0) return SealevelBarystaticIceLoadEnum;
+	      else if (strcmp(name,"SealevelBarystaticHydroMask")==0) return SealevelBarystaticHydroMaskEnum;
+	      else if (strcmp(name,"SealevelBarystaticHydroWeights")==0) return SealevelBarystaticHydroWeightsEnum;
+	      else if (strcmp(name,"SealevelBarystaticHydroArea")==0) return SealevelBarystaticHydroAreaEnum;
+	      else if (strcmp(name,"SealevelBarystaticHydroLatbar")==0) return SealevelBarystaticHydroLatbarEnum;
+	      else if (strcmp(name,"SealevelBarystaticHydroLongbar")==0) return SealevelBarystaticHydroLongbarEnum;
+	      else if (strcmp(name,"SealevelBarystaticHydroLoad")==0) return SealevelBarystaticHydroLoadEnum;
+	      else if (strcmp(name,"SealevelBarystaticBpMask")==0) return SealevelBarystaticBpMaskEnum;
+	      else if (strcmp(name,"SealevelBarystaticBpWeights")==0) return SealevelBarystaticBpWeightsEnum;
+	      else if (strcmp(name,"SealevelBarystaticBpArea")==0) return SealevelBarystaticBpAreaEnum;
+	      else if (strcmp(name,"SealevelBarystaticBpLoad")==0) return SealevelBarystaticBpLoadEnum;
+	      else if (strcmp(name,"SealevelBarystaticOceanMask")==0) return SealevelBarystaticOceanMaskEnum;
+	      else if (strcmp(name,"SealevelBarystaticOceanWeights")==0) return SealevelBarystaticOceanWeightsEnum;
+	      else if (strcmp(name,"SealevelBarystaticOceanArea")==0) return SealevelBarystaticOceanAreaEnum;
+	      else if (strcmp(name,"SealevelBarystaticOceanLatbar")==0) return SealevelBarystaticOceanLatbarEnum;
+	      else if (strcmp(name,"SealevelBarystaticOceanLongbar")==0) return SealevelBarystaticOceanLongbarEnum;
+	      else if (strcmp(name,"SealevelBarystaticOceanLoad")==0) return SealevelBarystaticOceanLoadEnum;
 	      else if (strcmp(name,"SealevelNEsa")==0) return SealevelNEsaEnum;
 	      else if (strcmp(name,"SealevelNEsaRate")==0) return SealevelNEsaRateEnum;
 	      else if (strcmp(name,"SealevelRSL")==0) return SealevelRSLEnum;
-	      else if (strcmp(name,"Bslr")==0) return BslrEnum;
-	      else if (strcmp(name,"BslrIce")==0) return BslrIceEnum;
-	      else if (strcmp(name,"BslrHydro")==0) return BslrHydroEnum;
-	      else if (strcmp(name,"BslrRate")==0) return BslrRateEnum;
-	      else if (strcmp(name,"Gmtslr")==0) return GmtslrEnum;
-	      else if (strcmp(name,"SealevelRSLEustatic")==0) return SealevelRSLEustaticEnum;
-	      else if (strcmp(name,"SealevelRSLEustaticRate")==0) return SealevelRSLEustaticRateEnum;
+	      else if (strcmp(name,"Bslc")==0) return BslcEnum;
+	      else if (strcmp(name,"BslcIce")==0) return BslcIceEnum;
+	      else if (strcmp(name,"BslcHydro")==0) return BslcHydroEnum;
+	      else if (strcmp(name,"BslcOcean")==0) return BslcOceanEnum;
+	      else if (strcmp(name,"BslcRate")==0) return BslcRateEnum;
+	      else if (strcmp(name,"Gmtslc")==0) return GmtslcEnum;
+	      else if (strcmp(name,"SealevelGrotm1")==0) return SealevelGrotm1Enum;
+	      else if (strcmp(name,"SealevelGrotm2")==0) return SealevelGrotm2Enum;
+	      else if (strcmp(name,"SealevelGrotm3")==0) return SealevelGrotm3Enum;
+	      else if (strcmp(name,"SealevelGUrotm1")==0) return SealevelGUrotm1Enum;
+	      else if (strcmp(name,"SealevelGUrotm2")==0) return SealevelGUrotm2Enum;
+	      else if (strcmp(name,"SealevelGUrotm3")==0) return SealevelGUrotm3Enum;
+	      else if (strcmp(name,"SealevelGNrotm1")==0) return SealevelGNrotm1Enum;
+	      else if (strcmp(name,"SealevelGNrotm2")==0) return SealevelGNrotm2Enum;
+	      else if (strcmp(name,"SealevelGNrotm3")==0) return SealevelGNrotm3Enum;
+	      else if (strcmp(name,"SealevelGErotm1")==0) return SealevelGErotm1Enum;
+	      else if (strcmp(name,"SealevelGErotm2")==0) return SealevelGErotm2Enum;
+	      else if (strcmp(name,"SealevelGErotm3")==0) return SealevelGErotm3Enum;
+	      else if (strcmp(name,"SealevelRSLBarystatic")==0) return SealevelRSLBarystaticEnum;
 	      else if (strcmp(name,"SealevelRSLRate")==0) return SealevelRSLRateEnum;
-	      else if (strcmp(name,"SealevelUEastEsa")==0) return SealevelUEastEsaEnum;
-	      else if (strcmp(name,"SealevelUEsa")==0) return SealevelUEsaEnum;
-	      else if (strcmp(name,"SealevelUEsaRate")==0) return SealevelUEsaRateEnum;
+	      else if (strcmp(name,"SealevelUGrd")==0) return SealevelUGrdEnum;
+	      else if (strcmp(name,"SealevelNGrd")==0) return SealevelNGrdEnum;
+         else stage=8;
+   }
+   if(stage==8){
+	      if (strcmp(name,"SealevelUEastEsa")==0) return SealevelUEastEsaEnum;
 	      else if (strcmp(name,"SealevelUNorthEsa")==0) return SealevelUNorthEsaEnum;
-	      else if (strcmp(name,"SealevelriseCumDeltathickness")==0) return SealevelriseCumDeltathicknessEnum;
-	      else if (strcmp(name,"SealevelriseCumDeltathicknessOld")==0) return SealevelriseCumDeltathicknessOldEnum;
-	      else if (strcmp(name,"SurfaceloadOther")==0) return SurfaceloadOtherEnum;
-	      else if (strcmp(name,"SurfaceloadIceThicknessChange")==0) return SurfaceloadIceThicknessChangeEnum;
-	      else if (strcmp(name,"SurfaceloadWaterHeightChange")==0) return SurfaceloadWaterHeightChangeEnum;
-	      else if (strcmp(name,"SealevelriseIndices")==0) return SealevelriseIndicesEnum;
-	      else if (strcmp(name,"SealevelriseG")==0) return SealevelriseGEnum;
-	      else if (strcmp(name,"SealevelriseGU")==0) return SealevelriseGUEnum;
-	      else if (strcmp(name,"SealevelriseGE")==0) return SealevelriseGEEnum;
-	      else if (strcmp(name,"SealevelriseGN")==0) return SealevelriseGNEnum;
-         else stage=7;
-   }
-   if(stage==7){
-	      if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
+	      else if (strcmp(name,"SealevelchangeIndices")==0) return SealevelchangeIndicesEnum;
+	      else if (strcmp(name,"SealevelchangeG")==0) return SealevelchangeGEnum;
+	      else if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
+	      else if (strcmp(name,"SealevelchangeGE")==0) return SealevelchangeGEEnum;
+	      else if (strcmp(name,"SealevelchangeGN")==0) return SealevelchangeGNEnum;
+	      else if (strcmp(name,"SealevelchangeGsubelOcean")==0) return SealevelchangeGsubelOceanEnum;
+	      else if (strcmp(name,"SealevelchangeGUsubelOcean")==0) return SealevelchangeGUsubelOceanEnum;
+	      else if (strcmp(name,"SealevelchangeGEsubelOcean")==0) return SealevelchangeGEsubelOceanEnum;
+	      else if (strcmp(name,"SealevelchangeGNsubelOcean")==0) return SealevelchangeGNsubelOceanEnum;
+	      else if (strcmp(name,"SealevelchangeGsubelIce")==0) return SealevelchangeGsubelIceEnum;
+	      else if (strcmp(name,"SealevelchangeGUsubelIce")==0) return SealevelchangeGUsubelIceEnum;
+	      else if (strcmp(name,"SealevelchangeGEsubelIce")==0) return SealevelchangeGEsubelIceEnum;
+	      else if (strcmp(name,"SealevelchangeGNsubelIce")==0) return SealevelchangeGNsubelIceEnum;
+	      else if (strcmp(name,"SealevelchangeGsubelHydro")==0) return SealevelchangeGsubelHydroEnum;
+	      else if (strcmp(name,"SealevelchangeGUsubelHydro")==0) return SealevelchangeGUsubelHydroEnum;
+	      else if (strcmp(name,"SealevelchangeGEsubelHydro")==0) return SealevelchangeGEsubelHydroEnum;
+	      else if (strcmp(name,"SealevelchangeGNsubelHydro")==0) return SealevelchangeGNsubelHydroEnum;
+	      else if (strcmp(name,"SealevelchangeViscousRSL")==0) return SealevelchangeViscousRSLEnum;
+	      else if (strcmp(name,"SealevelchangeViscousU")==0) return SealevelchangeViscousUEnum;
+	      else if (strcmp(name,"SealevelchangeViscousN")==0) return SealevelchangeViscousNEnum;
+	      else if (strcmp(name,"SealevelchangeViscousE")==0) return SealevelchangeViscousEEnum;
+	      else if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
 	      else if (strcmp(name,"SedimentHeadOld")==0) return SedimentHeadOldEnum;
 	      else if (strcmp(name,"SedimentHeadSubstep")==0) return SedimentHeadSubstepEnum;
@@ -767,9 +913,15 @@
 	      else if (strcmp(name,"SmbAccumulatedMelt")==0) return SmbAccumulatedMeltEnum;
 	      else if (strcmp(name,"SmbAccumulatedPrecipitation")==0) return SmbAccumulatedPrecipitationEnum;
+	      else if (strcmp(name,"SmbAccumulatedRain")==0) return SmbAccumulatedRainEnum;
+	      else if (strcmp(name,"SmbAccumulatedRefreeze")==0) return SmbAccumulatedRefreezeEnum;
 	      else if (strcmp(name,"SmbAccumulatedRunoff")==0) return SmbAccumulatedRunoffEnum;
 	      else if (strcmp(name,"SmbA")==0) return SmbAEnum;
+	      else if (strcmp(name,"SmbAdiff")==0) return SmbAdiffEnum;
 	      else if (strcmp(name,"SmbAValue")==0) return SmbAValueEnum;
 	      else if (strcmp(name,"SmbAccumulation")==0) return SmbAccumulationEnum;
+	      else if (strcmp(name,"SmbAdiffini")==0) return SmbAdiffiniEnum;
 	      else if (strcmp(name,"SmbAini")==0) return SmbAiniEnum;
+	      else if (strcmp(name,"SmbAutoregressionNoise")==0) return SmbAutoregressionNoiseEnum;
+	      else if (strcmp(name,"SmbBasinsId")==0) return SmbBasinsIdEnum;
 	      else if (strcmp(name,"SmbBMax")==0) return SmbBMaxEnum;
 	      else if (strcmp(name,"SmbBMin")==0) return SmbBMinEnum;
@@ -777,4 +929,7 @@
 	      else if (strcmp(name,"SmbBPos")==0) return SmbBPosEnum;
 	      else if (strcmp(name,"SmbC")==0) return SmbCEnum;
+	      else if (strcmp(name,"SmbCcsnowValue")==0) return SmbCcsnowValueEnum;
+	      else if (strcmp(name,"SmbCciceValue")==0) return SmbCciceValueEnum;
+	      else if (strcmp(name,"SmbCotValue")==0) return SmbCotValueEnum;
 	      else if (strcmp(name,"SmbD")==0) return SmbDEnum;
 	      else if (strcmp(name,"SmbDailyairdensity")==0) return SmbDailyairdensityEnum;
@@ -789,5 +944,7 @@
 	      else if (strcmp(name,"SmbDini")==0) return SmbDiniEnum;
 	      else if (strcmp(name,"SmbDlwrf")==0) return SmbDlwrfEnum;
+	      else if (strcmp(name,"SmbDulwrfValue")==0) return SmbDulwrfValueEnum;
 	      else if (strcmp(name,"SmbDswrf")==0) return SmbDswrfEnum;
+	      else if (strcmp(name,"SmbDswdiffrf")==0) return SmbDswdiffrfEnum;
 	      else if (strcmp(name,"SmbDzAdd")==0) return SmbDzAddEnum;
 	      else if (strcmp(name,"SmbDz")==0) return SmbDzEnum;
@@ -809,5 +966,4 @@
 	      else if (strcmp(name,"SmbIsInitialized")==0) return SmbIsInitializedEnum;
 	      else if (strcmp(name,"SmbMAdd")==0) return SmbMAddEnum;
-	      else if (strcmp(name,"SmbMassBalanceClimate")==0) return SmbMassBalanceClimateEnum;
 	      else if (strcmp(name,"SmbMassBalance")==0) return SmbMassBalanceEnum;
 	      else if (strcmp(name,"SmbMassBalanceSubstep")==0) return SmbMassBalanceSubstepEnum;
@@ -830,4 +986,5 @@
 	      else if (strcmp(name,"SmbPrecipitationsPresentday")==0) return SmbPrecipitationsPresentdayEnum;
 	      else if (strcmp(name,"SmbPrecipitationsReconstructed")==0) return SmbPrecipitationsReconstructedEnum;
+	      else if (strcmp(name,"SmbRain")==0) return SmbRainEnum;
 	      else if (strcmp(name,"SmbRe")==0) return SmbReEnum;
 	      else if (strcmp(name,"SmbRefreeze")==0) return SmbRefreezeEnum;
@@ -841,5 +998,9 @@
 	      else if (strcmp(name,"SmbSizeini")==0) return SmbSizeiniEnum;
 	      else if (strcmp(name,"SmbSmbCorr")==0) return SmbSmbCorrEnum;
-	      else if (strcmp(name,"SmbSmbref")==0) return SmbSmbrefEnum;
+         else stage=9;
+   }
+   if(stage==9){
+	      if (strcmp(name,"SmbSmbref")==0) return SmbSmbrefEnum;
+	      else if (strcmp(name,"SmbSzaValue")==0) return SmbSzaValueEnum;
 	      else if (strcmp(name,"SmbT")==0) return SmbTEnum;
 	      else if (strcmp(name,"SmbTa")==0) return SmbTaEnum;
@@ -852,4 +1013,5 @@
 	      else if (strcmp(name,"SmbTmean")==0) return SmbTmeanEnum;
 	      else if (strcmp(name,"SmbTz")==0) return SmbTzEnum;
+	      else if (strcmp(name,"SmbValuesAutoregression")==0) return SmbValuesAutoregressionEnum;
 	      else if (strcmp(name,"SmbV")==0) return SmbVEnum;
 	      else if (strcmp(name,"SmbVmean")==0) return SmbVmeanEnum;
@@ -862,4 +1024,9 @@
 	      else if (strcmp(name,"SmbZTop")==0) return SmbZTopEnum;
 	      else if (strcmp(name,"SmbZY")==0) return SmbZYEnum;
+	      else if (strcmp(name,"SolidearthExternalDisplacementEastRate")==0) return SolidearthExternalDisplacementEastRateEnum;
+	      else if (strcmp(name,"SolidearthExternalDisplacementNorthRate")==0) return SolidearthExternalDisplacementNorthRateEnum;
+	      else if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
+	      else if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
+	      else if (strcmp(name,"StochasticForcingDefaultId")==0) return StochasticForcingDefaultIdEnum;
 	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
 	      else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
@@ -875,8 +1042,5 @@
 	      else if (strcmp(name,"StressTensorxy")==0) return StressTensorxyEnum;
 	      else if (strcmp(name,"StressTensorxz")==0) return StressTensorxzEnum;
-         else stage=8;
-   }
-   if(stage==8){
-	      if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
+	      else if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
 	      else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
 	      else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
@@ -900,4 +1064,6 @@
 	      else if (strcmp(name,"TemperaturePicard")==0) return TemperaturePicardEnum;
 	      else if (strcmp(name,"TemperatureSEMIC")==0) return TemperatureSEMICEnum;
+	      else if (strcmp(name,"ThermalforcingAutoregressionNoise")==0) return ThermalforcingAutoregressionNoiseEnum;
+	      else if (strcmp(name,"ThermalforcingValuesAutoregression")==0) return ThermalforcingValuesAutoregressionEnum;
 	      else if (strcmp(name,"ThermalSpctemperature")==0) return ThermalSpctemperatureEnum;
 	      else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
@@ -909,13 +1075,20 @@
 	      else if (strcmp(name,"ThicknessPositive")==0) return ThicknessPositiveEnum;
 	      else if (strcmp(name,"ThicknessResidual")==0) return ThicknessResidualEnum;
+	      else if (strcmp(name,"TransientAccumulatedDeltaIceThickness")==0) return TransientAccumulatedDeltaIceThicknessEnum;
 	      else if (strcmp(name,"Vel")==0) return VelEnum;
 	      else if (strcmp(name,"VxAverage")==0) return VxAverageEnum;
+	      else if (strcmp(name,"VxBase")==0) return VxBaseEnum;
 	      else if (strcmp(name,"Vx")==0) return VxEnum;
 	      else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
 	      else if (strcmp(name,"VxObs")==0) return VxObsEnum;
+	      else if (strcmp(name,"VxShear")==0) return VxShearEnum;
+	      else if (strcmp(name,"VxSurface")==0) return VxSurfaceEnum;
 	      else if (strcmp(name,"VyAverage")==0) return VyAverageEnum;
+	      else if (strcmp(name,"VyBase")==0) return VyBaseEnum;
 	      else if (strcmp(name,"Vy")==0) return VyEnum;
 	      else if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
 	      else if (strcmp(name,"VyObs")==0) return VyObsEnum;
+	      else if (strcmp(name,"VyShear")==0) return VyShearEnum;
+	      else if (strcmp(name,"VySurface")==0) return VySurfaceEnum;
 	      else if (strcmp(name,"Vz")==0) return VzEnum;
 	      else if (strcmp(name,"VzFS")==0) return VzFSEnum;
@@ -929,5 +1102,11 @@
 	      else if (strcmp(name,"Waterfraction")==0) return WaterfractionEnum;
 	      else if (strcmp(name,"Waterheight")==0) return WaterheightEnum;
+	      else if (strcmp(name,"FrictionWaterPressure")==0) return FrictionWaterPressureEnum;
+	      else if (strcmp(name,"FrictionWaterPressureNoise")==0) return FrictionWaterPressureNoiseEnum;
+	      else if (strcmp(name,"WeightsLevelsetObservation")==0) return WeightsLevelsetObservationEnum;
 	      else if (strcmp(name,"WeightsSurfaceObservation")==0) return WeightsSurfaceObservationEnum;
+	      else if (strcmp(name,"OldAccumulatedDeltaBottomPressure")==0) return OldAccumulatedDeltaBottomPressureEnum;
+	      else if (strcmp(name,"OldAccumulatedDeltaIceThickness")==0) return OldAccumulatedDeltaIceThicknessEnum;
+	      else if (strcmp(name,"OldAccumulatedDeltaTws")==0) return OldAccumulatedDeltaTwsEnum;
 	      else if (strcmp(name,"Outputdefinition1")==0) return Outputdefinition1Enum;
 	      else if (strcmp(name,"Outputdefinition10")==0) return Outputdefinition10Enum;
@@ -942,5 +1121,8 @@
 	      else if (strcmp(name,"Outputdefinition19")==0) return Outputdefinition19Enum;
 	      else if (strcmp(name,"Outputdefinition20")==0) return Outputdefinition20Enum;
-	      else if (strcmp(name,"Outputdefinition21")==0) return Outputdefinition21Enum;
+         else stage=10;
+   }
+   if(stage==10){
+	      if (strcmp(name,"Outputdefinition21")==0) return Outputdefinition21Enum;
 	      else if (strcmp(name,"Outputdefinition22")==0) return Outputdefinition22Enum;
 	      else if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
@@ -998,8 +1180,5 @@
 	      else if (strcmp(name,"Outputdefinition70")==0) return Outputdefinition70Enum;
 	      else if (strcmp(name,"Outputdefinition71")==0) return Outputdefinition71Enum;
-         else stage=9;
-   }
-   if(stage==9){
-	      if (strcmp(name,"Outputdefinition72")==0) return Outputdefinition72Enum;
+	      else if (strcmp(name,"Outputdefinition72")==0) return Outputdefinition72Enum;
 	      else if (strcmp(name,"Outputdefinition73")==0) return Outputdefinition73Enum;
 	      else if (strcmp(name,"Outputdefinition74")==0) return Outputdefinition74Enum;
@@ -1065,5 +1244,8 @@
 	      else if (strcmp(name,"Boundary")==0) return BoundaryEnum;
 	      else if (strcmp(name,"BuddJacka")==0) return BuddJackaEnum;
-	      else if (strcmp(name,"CalvingDev2")==0) return CalvingDev2Enum;
+         else stage=11;
+   }
+   if(stage==11){
+	      if (strcmp(name,"CalvingDev2")==0) return CalvingDev2Enum;
 	      else if (strcmp(name,"CalvingHab")==0) return CalvingHabEnum;
 	      else if (strcmp(name,"CalvingLevermann")==0) return CalvingLevermannEnum;
@@ -1072,4 +1254,5 @@
 	      else if (strcmp(name,"Cfsurfacelogvel")==0) return CfsurfacelogvelEnum;
 	      else if (strcmp(name,"Cfsurfacesquare")==0) return CfsurfacesquareEnum;
+	      else if (strcmp(name,"Cflevelsetmisfit")==0) return CflevelsetmisfitEnum;
 	      else if (strcmp(name,"Channel")==0) return ChannelEnum;
 	      else if (strcmp(name,"ChannelArea")==0) return ChannelAreaEnum;
@@ -1121,8 +1304,5 @@
 	      else if (strcmp(name,"ExtrapolationAnalysis")==0) return ExtrapolationAnalysisEnum;
 	      else if (strcmp(name,"ExtrudeFromBaseAnalysis")==0) return ExtrudeFromBaseAnalysisEnum;
-         else stage=10;
-   }
-   if(stage==10){
-	      if (strcmp(name,"ExtrudeFromTopAnalysis")==0) return ExtrudeFromTopAnalysisEnum;
+	      else if (strcmp(name,"ExtrudeFromTopAnalysis")==0) return ExtrudeFromTopAnalysisEnum;
 	      else if (strcmp(name,"FSApproximation")==0) return FSApproximationEnum;
 	      else if (strcmp(name,"FSSolver")==0) return FSSolverEnum;
@@ -1140,4 +1320,5 @@
 	      else if (strcmp(name,"FrontalForcingsDefault")==0) return FrontalForcingsDefaultEnum;
 	      else if (strcmp(name,"FrontalForcingsRignot")==0) return FrontalForcingsRignotEnum;
+	      else if (strcmp(name,"FrontalForcingsRignotAutoregression")==0) return FrontalForcingsRignotAutoregressionEnum;
 	      else if (strcmp(name,"Fset")==0) return FsetEnum;
 	      else if (strcmp(name,"FullMeltOnPartiallyFloating")==0) return FullMeltOnPartiallyFloatingEnum;
@@ -1150,6 +1331,4 @@
 	      else if (strcmp(name,"GenericParam")==0) return GenericParamEnum;
 	      else if (strcmp(name,"GenericExternalResult")==0) return GenericExternalResultEnum;
-	      else if (strcmp(name,"GiaAnalysis")==0) return GiaAnalysisEnum;
-	      else if (strcmp(name,"GiaSolution")==0) return GiaSolutionEnum;
 	      else if (strcmp(name,"Gradient1")==0) return Gradient1Enum;
 	      else if (strcmp(name,"Gradient2")==0) return Gradient2Enum;
@@ -1188,5 +1367,8 @@
 	      else if (strcmp(name,"Indexed")==0) return IndexedEnum;
 	      else if (strcmp(name,"IntExternalResult")==0) return IntExternalResultEnum;
-	      else if (strcmp(name,"ElementInput")==0) return ElementInputEnum;
+         else stage=12;
+   }
+   if(stage==12){
+	      if (strcmp(name,"ElementInput")==0) return ElementInputEnum;
 	      else if (strcmp(name,"IntMatExternalResult")==0) return IntMatExternalResultEnum;
 	      else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
@@ -1244,8 +1426,5 @@
 	      else if (strcmp(name,"MaxVx")==0) return MaxVxEnum;
 	      else if (strcmp(name,"MaxVy")==0) return MaxVyEnum;
-         else stage=11;
-   }
-   if(stage==11){
-	      if (strcmp(name,"MaxVz")==0) return MaxVzEnum;
+	      else if (strcmp(name,"MaxVz")==0) return MaxVzEnum;
 	      else if (strcmp(name,"Melange")==0) return MelangeEnum;
 	      else if (strcmp(name,"MeltingAnalysis")==0) return MeltingAnalysisEnum;
@@ -1274,4 +1453,6 @@
 	      else if (strcmp(name,"NyeH2O")==0) return NyeH2OEnum;
 	      else if (strcmp(name,"Numericalflux")==0) return NumericalfluxEnum;
+	      else if (strcmp(name,"OceantransportAnalysis")==0) return OceantransportAnalysisEnum;
+	      else if (strcmp(name,"OceantransportSolution")==0) return OceantransportSolutionEnum;
 	      else if (strcmp(name,"OldGradient")==0) return OldGradientEnum;
 	      else if (strcmp(name,"OneLayerP4z")==0) return OneLayerP4zEnum;
@@ -1308,5 +1489,11 @@
 	      else if (strcmp(name,"RecoveryAnalysis")==0) return RecoveryAnalysisEnum;
 	      else if (strcmp(name,"Riftfront")==0) return RiftfrontEnum;
+	      else if (strcmp(name,"SamplingAnalysis")==0) return SamplingAnalysisEnum;
+         else stage=13;
+   }
+   if(stage==13){
+	      if (strcmp(name,"SamplingSolution")==0) return SamplingSolutionEnum;
 	      else if (strcmp(name,"SIAApproximation")==0) return SIAApproximationEnum;
+	      else if (strcmp(name,"SMBautoregression")==0) return SMBautoregressionEnum;
 	      else if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
 	      else if (strcmp(name,"SMBd18opdd")==0) return SMBd18opddEnum;
@@ -1331,8 +1518,8 @@
 	      else if (strcmp(name,"SealevelInertiaTensorYZ")==0) return SealevelInertiaTensorYZEnum;
 	      else if (strcmp(name,"SealevelInertiaTensorZZ")==0) return SealevelInertiaTensorZZEnum;
+	      else if (strcmp(name,"SealevelchangePolarMotion")==0) return SealevelchangePolarMotionEnum;
 	      else if (strcmp(name,"SealevelNmotion")==0) return SealevelNmotionEnum;
 	      else if (strcmp(name,"SealevelUmotion")==0) return SealevelUmotionEnum;
-	      else if (strcmp(name,"SealevelriseAnalysis")==0) return SealevelriseAnalysisEnum;
-	      else if (strcmp(name,"SealevelriseSolution")==0) return SealevelriseSolutionEnum;
+	      else if (strcmp(name,"SealevelchangeAnalysis")==0) return SealevelchangeAnalysisEnum;
 	      else if (strcmp(name,"Seg")==0) return SegEnum;
 	      else if (strcmp(name,"SegInput")==0) return SegInputEnum;
@@ -1367,8 +1554,5 @@
 	      else if (strcmp(name,"SubelementMigration")==0) return SubelementMigrationEnum;
 	      else if (strcmp(name,"SurfaceSlopeSolution")==0) return SurfaceSlopeSolutionEnum;
-         else stage=12;
-   }
-   if(stage==12){
-	      if (strcmp(name,"TaylorHood")==0) return TaylorHoodEnum;
+	      else if (strcmp(name,"TaylorHood")==0) return TaylorHoodEnum;
 	      else if (strcmp(name,"Tetra")==0) return TetraEnum;
 	      else if (strcmp(name,"TetraInput")==0) return TetraInputEnum;
@@ -1420,5 +1604,5 @@
 	      else if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum;
 	      else if (strcmp(name,"MaximumNumberOfDefinitions")==0) return MaximumNumberOfDefinitionsEnum;
-         else stage=13;
+         else stage=14;
    }
 	/*If we reach this point, the string provided has not been found*/
Index: /issm/trunk/src/c/shared/Enum/Synchronize.sh
===================================================================
--- /issm/trunk/src/c/shared/Enum/Synchronize.sh	(revision 26743)
+++ /issm/trunk/src/c/shared/Enum/Synchronize.sh	(revision 26744)
@@ -39,5 +39,5 @@
 #core
 cat temp | grep [a-zA-Z0-9]Analysis | \
-	grep -v DefaultAnalysis | grep -v FlaimAnalysis | grep -v SurfaceSlopeAnalysis | grep -v BedSlopeAnalysis | \
+	grep -v DefaultAnalysis | grep -v RecoveryAnalysis | grep -v FlaimAnalysis | grep -v SurfaceSlopeAnalysis | grep -v BedSlopeAnalysis | \
 	awk '{print "\t\t#ifdef _HAVE_"toupper(substr($1,1,length($1)-12))"_\n\t\t" "case " $1" : return new " substr($1,1,length($1)-4) "();\n\t\t#endif"}' \
 		>> $ISSM_DIR/src/c/analyses/EnumToAnalysis.cpp
@@ -229,4 +229,22 @@
 echo "\"ISSM objects end" >> $ISSM_DIR/src/c/shared/Enum/Enum.vim
 #}}}
+#Build Enumjl.vim{{{
+#Header
+cat <<END > $ISSM_DIR/src/c/shared/Enum/Enumjl.vim
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" ISSM specific julia syntax highlighting
+"
+"   WARNING: DO NOT MODIFY THIS FILE
+"            this file has been automatically generated by Synchronize.sh
+"            Please read README for more information
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+"ISSM Enums
+END
+cat temp |  awk '{print "syn keyword juliaConstC " $1}' >> $ISSM_DIR/src/c/shared/Enum/Enumjl.vim
+cat <<END >> $ISSM_DIR/src/c/shared/Enum/Enumjl.vim
+"ISSM Enums end
+END
+#}}}
 
 #clean up{{{
Index: /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp
===================================================================
--- /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp	(revision 26743)
+++ /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp	(revision 26744)
@@ -673,2 +673,20 @@
 
 } /*}}}*/
+void CholeskyRealPositiveDefinite(IssmDouble* Lchol, IssmDouble* A, int ndim) { /*{{{*/
+   /*CholeskyRealPositiveDefinite   computes lower triangular matrix of the Cholesky decomposition of A
+   Follows the Cholesky–Banachiewicz algorithm
+   Lchol should point to an IssmDouble* of same dimensions as A*/
+
+	/*ensure zero-initialization*/
+	for(int i=0;i<(ndim*ndim);i++) Lchol[i]=0;;
+
+	for(int i=0;i<ndim;i++){
+		for(int j=0;j<=i;j++){
+			IssmDouble sum=0.;
+			for(int k=0;k<j;k++) sum += Lchol[i*ndim+k]*Lchol[j*ndim+k];
+			
+			if(i==j) Lchol[i*ndim+j] = sqrt(A[i*ndim+j]-sum);
+			else Lchol[i*ndim+j]     = 1./Lchol[j*ndim+j] * (A[i*ndim+j]-sum);
+		}
+	}
+} /*}}}*/
Index: /issm/trunk/src/c/shared/Matrix/matrix.h
===================================================================
--- /issm/trunk/src/c/shared/Matrix/matrix.h	(revision 26743)
+++ /issm/trunk/src/c/shared/Matrix/matrix.h	(revision 26744)
@@ -25,5 +25,5 @@
 void Matrix4x4Determinant(IssmDouble* Adet,IssmDouble* A);
 void Matrix4x4Solve(IssmDouble* X,IssmDouble* A,IssmDouble* B);
- 
+
 void newcell(IssmDouble** pcell, IssmDouble newvalue, bool top, int m);
 IssmDouble  cellsum(IssmDouble* cell, int m);
@@ -31,3 +31,4 @@
 void cellsplit(IssmDouble** pcell, int m, int i,IssmDouble scale);
 void cellecho(int numcells, int m, ...);
+void CholeskyRealPositiveDefinite(IssmDouble* Lchol, IssmDouble* A, int ndim);
 #endif //ifndef _MATRIXUTILS_H_
Index: /issm/trunk/src/c/shared/MemOps/MemOps.h
===================================================================
--- /issm/trunk/src/c/shared/MemOps/MemOps.h	(revision 26743)
+++ /issm/trunk/src/c/shared/MemOps/MemOps.h	(revision 26744)
@@ -7,4 +7,5 @@
 
 #include <cassert>
+#include <cstring> /*for memcpy*/
 
 /* memory management of types T with non-trivial constructors require C++ style memory management*/
@@ -68,6 +69,5 @@
   T* aT_p=xNew<T>(size);
 #endif
-  for (unsigned int i=0; i<size;++i) 
-    aT_p[i]=(T)0;
+  for(unsigned int i=0; i<size;++i) aT_p[i]=(T)0;
   return aT_p;
 #else
@@ -80,6 +80,5 @@
 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
   T** aT_pp=xNew<T>(dim1,dim2);
-  for (unsigned int i=0; i<dim1*dim2;++i)
-    (*aT_pp)[i]=(T)0;
+  for (unsigned int i=0; i<dim1*dim2;++i) (*aT_pp)[i]=(T)0;
   return aT_pp;
 #else
@@ -152,6 +151,9 @@
 template <class T>  T* xMemCpy(T* dest, const T* src, unsigned int size) {/*{{{*/
   assert(dest); assert(src);
-  for (int i=0; i<size;++i) 
-    dest[i]=src[i];
+  #if defined(_HAVE_ADOLC_)
+  for (int i=0; i<size;++i) dest[i]=src[i];
+  #else
+  memcpy(dest,src,size*sizeof(T));
+  #endif
   return dest;
 };
Index: /issm/trunk/src/c/shared/Numerics/types.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/types.h	(revision 26743)
+++ /issm/trunk/src/c/shared/Numerics/types.h	(revision 26744)
@@ -13,4 +13,5 @@
 
 #include <stdio.h>
+#include <complex>
 
 /*here are our abstracted types: inspired on petsc */
@@ -24,17 +25,24 @@
 /*ADOLC typedefs*/
 #include "adolc/adolc.h"
-typedef adouble IssmDouble; /*for active variables*/
-typedef double  IssmPDouble; /*for passive variables*/
+typedef adouble              IssmDouble;  /*for active variables*/
+//typedef acomplex             IssmComplex; /*for active variables*/ /*FIXME!*/
+typedef std::complex<double> IssmComplex; /*for active variables*/ /*FIXME!*/
+typedef double               IssmPDouble; /*for passive variables*/
+typedef std::complex<double> IssmPComplex;/*for passive variables*/
 
 #elif defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_)
 /*CoDiPack typedefs*/
 #include <codi.hpp>
-typedef codi::RealReverse IssmDouble;
-typedef double            IssmPDouble;
+typedef codi::RealReverse               IssmDouble;
+typedef std::complex<codi::RealReverse> IssmComplex;
+typedef double                          IssmPDouble;
+typedef IssmComplex                     IssmPComplex;
 
+#else 
 /*Non-AD typedefs*/
-#else 
-typedef double     IssmDouble; 
-typedef IssmDouble IssmPDouble;
+typedef double               IssmDouble; 
+typedef std::complex<double> IssmComplex; 
+typedef IssmDouble           IssmPDouble;
+typedef IssmComplex          IssmPComplex;
 #endif
 
Index: /issm/trunk/src/c/shared/Random/random.cpp
===================================================================
--- /issm/trunk/src/c/shared/Random/random.cpp	(revision 26744)
+++ /issm/trunk/src/c/shared/Random/random.cpp	(revision 26744)
@@ -0,0 +1,99 @@
+/*!\file: random
+ * \brief random number generating functions
+ */ 
+
+/*Headers*/
+/*{{{*/
+#include <stdio.h>
+#include <sys/types.h>
+#include <math.h>
+#include <float.h>    /*  DBL_EPSILON  */
+#include <cstdarg>
+#include <iostream>
+
+#include "../Matrix/matrix.h"
+#include "../Exceptions/exceptions.h"
+#include "../MemOps/MemOps.h"
+#include "../io/io.h"
+#include "./randomgenerator.h"
+/*}}}*/
+
+void univariateNormal(IssmPDouble* prand, IssmPDouble mean, IssmPDouble sdev, int seed=-1) { /*{{{*/
+
+	/*Seed the pseudo-random number generator*/
+	rnd::linear_congruential_engine randomengine;
+	randomengine.seed(seed);
+	/*Normal distribution*/
+	rnd::normal_distribution distriNormal(mean,sdev);
+	/*Assign output pointer and cleanup*/
+	*prand = distriNormal.generator(randomengine);
+	randomengine.free_resources();
+} /*}}}*/
+void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix, int seed=-1) { /*{{{*/
+   
+	IssmPDouble* sampleStandardNormal    = xNew<IssmPDouble>(dim);
+   IssmDouble* sampleMultivariateNormal = xNew<IssmDouble>(dim);
+   IssmDouble* Lchol                    = xNewZeroInit<IssmDouble>(dim*dim);
+
+	/*True randomness if seed<0, otherwise random seed is fixed at seed*/
+	/*Seed the pseudo-random number generator, repeatedly calling univariateNormal does not ensure randomness*/
+	rnd::linear_congruential_engine randomengine;
+	randomengine.seed(seed);
+	/*Normal distribution*/
+	rnd::normal_distribution distriNormal(0.0,1.0);
+	for(int i=0;i<dim;i++){
+		sampleStandardNormal[i] = distriNormal.generator(randomengine);
+	}
+
+	/*Cholsesky decomposition of the covariance matrix*/
+	CholeskyRealPositiveDefinite(Lchol,covariancematrix,dim);
+   
+	/*Matrix by vector multiplication*/
+	for(int i=0;i<dim;i++){ 
+      /*Entry-by-entry multiplication along matrix row*/
+      IssmDouble sum=0.;
+      for(int j=0;j<dim;j++) sum += sampleStandardNormal[j]*Lchol[i*dim+j]; 
+      sampleMultivariateNormal[i] = mean+sum;
+   }
+
+   /*Assign output pointer and cleanup*/
+   *prand = sampleMultivariateNormal;
+   xDelete<IssmPDouble>(sampleStandardNormal);
+   xDelete<IssmDouble>(Lchol);
+	randomengine.free_resources();
+} /*}}}*/
+void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix, int seed=-1) { /*{{{*/
+	
+	IssmPDouble* sampleStandardNormal    = xNew<IssmPDouble>(dim);
+	IssmDouble* sampleMultivariateNormal = xNew<IssmDouble>(dim);
+	IssmDouble* Lchol                    = xNewZeroInit<IssmDouble>(dim*dim);
+	
+	/*True randomness if seed<0, otherwise random seed is fixed at seed*/
+	/*Seed the pseudo-random number generator, repeatedly calling univariateNormal does not ensure randomness*/
+	rnd::linear_congruential_engine randomengine;
+	randomengine.seed(seed);
+	/*Normal distribution*/
+	rnd::normal_distribution distriNormal(0.0,1.0);
+	for(int i=0;i<dim;i++){
+		sampleStandardNormal[i] = distriNormal.generator(randomengine);
+	}
+
+	/*Cholsesky decomposition of the covariance matrix*/
+	CholeskyRealPositiveDefinite(Lchol,covariancematrix,dim);
+
+	/*Matrix by vector multiplication*/
+	for(int i=0;i<dim;i++){
+		IssmDouble sum = 0.;
+      for(int j=0;j<dim;j++) sum += sampleStandardNormal[j]*Lchol[i*dim+j]; 
+      sampleMultivariateNormal[i] = mean[i]+sum;
+	}
+   
+	/*Assign output pointer and cleanup*/
+	*prand = sampleMultivariateNormal;
+	xDelete<IssmPDouble>(sampleStandardNormal);
+	xDelete<IssmDouble>(Lchol);
+	randomengine.free_resources();
+} /*}}}*/
+
+
+
Index: /issm/trunk/src/c/shared/Random/random.h
===================================================================
--- /issm/trunk/src/c/shared/Random/random.h	(revision 26744)
+++ /issm/trunk/src/c/shared/Random/random.h	(revision 26744)
@@ -0,0 +1,12 @@
+/*!\file: random.h
+ * \brief prototypes for random.h
+ */ 
+
+#ifndef _RANDOM_H_
+#define _RANDOM_H_
+
+void univariateNormal(IssmDouble* prand, IssmDouble mean, IssmDouble sdev, int seed=-1);
+void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix, int seed=-1);
+void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix, int seed=-1);
+
+#endif //ifndef _RANDOM_H_
Index: /issm/trunk/src/c/shared/Random/randomgenerator.cpp
===================================================================
--- /issm/trunk/src/c/shared/Random/randomgenerator.cpp	(revision 26744)
+++ /issm/trunk/src/c/shared/Random/randomgenerator.cpp	(revision 26744)
@@ -0,0 +1,222 @@
+/*!\file: randomgenerator
+ * \brief random number generating functions
+ */
+
+#include <iostream>
+#include "./randomgenerator.h"
+#include <cmath>
+#include <chrono>
+
+#undef M_PI
+#define M_PI 3.141592653589793238462643
+
+namespace rnd{
+
+  /* Linear congruential engine */
+
+  linear_congruential_engine::linear_congruential_engine(){/*{{{*/
+
+      pseed = new unsigned int;
+			*pseed = std::chrono::steady_clock::now().time_since_epoch()/std::chrono::milliseconds(1);
+      a = 1103515245;		       // BSD Formula
+      c = 12345;					     // BSD Formula
+      m = 2147483648;			     // BSD Formula
+			return;
+	}/*}}}*/
+
+  linear_congruential_engine::linear_congruential_engine(unsigned int _a, unsigned int _b, unsigned int _m){/*{{{*/
+
+      pseed = new unsigned int;
+			*pseed = std::chrono::steady_clock::now().time_since_epoch()/std::chrono::milliseconds(1);
+      a = _a;
+      c = _b;
+      m = _m;
+			return;
+	}/*}}}*/
+
+	linear_congruential_engine::~linear_congruential_engine(){}
+
+  unsigned int linear_congruential_engine::get_m() { return m; }
+
+  void linear_congruential_engine::seed( int s ) {
+      if(s<0)
+        *pseed = std::chrono::steady_clock::now().time_since_epoch()/std::chrono::milliseconds(1);
+      else
+        *pseed = (unsigned) s;
+  }
+
+  unsigned int linear_congruential_engine::generator(){
+    *pseed = ( a * *pseed + c ) % m ;
+    return *pseed;
+  }
+
+  void linear_congruential_engine::free_resources(){
+	  delete pseed;
+	  return;
+  }
+
+  /* Uniform distribution */
+
+	uniform_distribution::uniform_distribution(){/*{{{*/
+			a = 0.0;
+			b = 1.0;
+			return;
+	}
+	/*}}}*/
+
+	uniform_distribution::uniform_distribution(double _a,double _b){/*{{{*/
+			a = _a;
+			b = _b;
+			return;
+	}
+	/*}}}*/
+
+	uniform_distribution::~uniform_distribution(){}
+
+	double uniform_distribution::generator(rnd::linear_congruential_engine random_engine) {
+			return (b-a)*(double) random_engine.generator()/ random_engine.get_m() + a;
+	}
+
+  /* Normal distribution */
+
+	normal_distribution::normal_distribution(){/*{{{*/
+			mean   = 0;
+			sdev  = 1.0;
+			return;
+	}
+	/*}}}*/
+
+	normal_distribution::normal_distribution(double m,double s){/*{{{*/
+			mean   = m;
+			sdev  = s;
+			return;
+	}
+	/*}}}*/
+
+	normal_distribution::~normal_distribution(){}
+
+	double normal_distribution::generator(rnd::linear_congruential_engine random_engine){/*{{{*/
+
+			rnd::uniform_distribution	distribution;
+
+			double u1 = distribution.generator(random_engine);
+			double u2 = distribution.generator(random_engine);
+
+			double R = sqrt(-2*log(u1));
+			double theta = 2*M_PI*u2;
+
+			return mean + sdev * (R*cos(theta));
+
+	}
+	/*}}}*/
+
+  /* Log-Normal distribution */
+
+  lognormal_distribution::lognormal_distribution(){/*{{{*/
+      logmean   = 0;
+      logsdev  = 1.0;
+      return;
+  }
+  /*}}}*/
+
+  lognormal_distribution::lognormal_distribution(double m,double s){/*{{{*/
+      logmean   = m;
+      logsdev  = s;
+      return;
+  }
+  /*}}}*/
+
+  lognormal_distribution::~lognormal_distribution(){}
+
+  double lognormal_distribution::generator(rnd::linear_congruential_engine random_engine){/*{{{*/
+
+      rnd::normal_distribution	distribution(logmean,logsdev);
+
+      return exp(distribution.generator(random_engine));
+
+  }
+  /*}}}*/
+
+  /* Chi-squared distribution */
+
+  chi_squared_distribution::chi_squared_distribution(){/*{{{*/
+      k  = 1;
+      return;
+  }
+  /*}}}*/
+
+  chi_squared_distribution::chi_squared_distribution(unsigned int dof){/*{{{*/
+      k   = dof;
+      return;
+  }
+  /*}}}*/
+
+  chi_squared_distribution::~chi_squared_distribution(){}
+
+  double chi_squared_distribution::generator(rnd::linear_congruential_engine random_engine){/*{{{*/
+
+      rnd::normal_distribution	distribution;
+
+      double rand = 0;
+
+      for(int i=0;i<k;i++)
+        rand = rand + pow(distribution.generator(random_engine),2);
+
+      return rand;
+
+  }
+  /*}}}*/
+
+
+  /* Exponential distribution */
+
+  exponential_distribution::exponential_distribution(){/*{{{*/
+      lambda  = 1.0;
+      return;
+  }
+  /*}}}*/
+
+  exponential_distribution::exponential_distribution(double scale){/*{{{*/
+      lambda   = scale;
+      return;
+  }
+  /*}}}*/
+
+  exponential_distribution::~exponential_distribution(){}
+
+  double exponential_distribution::generator(rnd::linear_congruential_engine random_engine){/*{{{*/
+
+      rnd::uniform_distribution	distribution;
+
+      return -1.0/lambda*log(1.0-distribution.generator(random_engine));
+
+  }
+  /*}}}*/
+
+  /* Student-t distribution */
+
+  student_t_distribution::student_t_distribution(){/*{{{*/
+      k  = 1;
+      return;
+  }
+  /*}}}*/
+
+  student_t_distribution::student_t_distribution(unsigned int dof){/*{{{*/
+      k   = dof;
+      return;
+  }
+  /*}}}*/
+
+  student_t_distribution::~student_t_distribution(){}
+
+  double student_t_distribution::generator(rnd::linear_congruential_engine random_engine){/*{{{*/
+
+      rnd::normal_distribution	normal_distribution;
+      rnd::chi_squared_distribution	chi_squared_distribution(k);
+
+      return normal_distribution.generator(random_engine)/sqrt(chi_squared_distribution.generator(random_engine)/k);
+
+  }
+  /*}}}*/
+
+}
Index: /issm/trunk/src/c/shared/Random/randomgenerator.h
===================================================================
--- /issm/trunk/src/c/shared/Random/randomgenerator.h	(revision 26744)
+++ /issm/trunk/src/c/shared/Random/randomgenerator.h	(revision 26744)
@@ -0,0 +1,142 @@
+/*!\file: randomgenerator.h
+ * \brief prototypes for randomgenerator.h
+ */
+
+#ifndef _RANDOMGENERATOR_H_
+#define _RANDOMGENERATOR_H_
+
+#undef M_PI
+#define M_PI 3.141592653589793238462643
+
+namespace rnd{
+
+  class linear_congruential_engine
+  {
+    private:
+      unsigned int a;
+      unsigned int c;
+      unsigned int m;
+      unsigned int *pseed;
+
+    public:
+
+      /*constructors, destructors: */
+      linear_congruential_engine();
+      linear_congruential_engine(unsigned int _a, unsigned int _b, unsigned int _m);
+      ~linear_congruential_engine();
+
+      unsigned int get_m();
+      void seed( int s );
+      unsigned int generator();
+		void free_resources();
+  };
+
+  class uniform_distribution
+  {
+
+    private:
+      double a;  // lower bound of range
+      double b;  // upper bound of range
+
+    public:
+
+      /*constructors, destructors: */
+      uniform_distribution();
+      uniform_distribution(double _a,double _b);
+      ~uniform_distribution();
+
+      double generator(rnd::linear_congruential_engine random_engine);
+
+  };
+
+  class normal_distribution
+  {
+
+    private:
+      double mean;
+      double sdev;
+
+    public:
+
+      /*constructors, destructors: */
+      normal_distribution();
+      normal_distribution(double m,double s);
+      ~normal_distribution();
+
+      double generator(rnd::linear_congruential_engine random_engine);
+
+  };
+
+  class lognormal_distribution
+  {
+
+    private:
+      double logmean;
+      double logsdev;
+
+    public:
+
+      /*constructors, destructors: */
+      lognormal_distribution();
+      lognormal_distribution(double m,double s);
+      ~lognormal_distribution();
+
+      double generator(rnd::linear_congruential_engine random_engine);
+
+  };
+
+  class chi_squared_distribution
+  {
+
+    private:
+      unsigned int k;
+
+    public:
+
+      /*constructors, destructors: */
+      chi_squared_distribution();
+      chi_squared_distribution(unsigned int k);
+      ~chi_squared_distribution();
+
+      double generator(rnd::linear_congruential_engine random_engine);
+
+  };
+
+  class exponential_distribution
+  {
+
+    private:
+      double lambda;
+
+    public:
+
+      /*constructors, destructors: */
+      exponential_distribution();
+      exponential_distribution(double scale);
+      ~exponential_distribution();
+
+      double generator(rnd::linear_congruential_engine random_engine);
+
+  };
+
+  class student_t_distribution
+  {
+
+    private:
+      unsigned int k;
+
+    public:
+
+      /*constructors, destructors: */
+      student_t_distribution();
+      student_t_distribution(unsigned int k);
+      ~student_t_distribution();
+
+      double generator(rnd::linear_congruential_engine random_engine);
+
+  };
+
+
+}
+
+#endif //* _RANDOMGENERATOR_H_ */
Index: /issm/trunk/src/c/shared/io/Comm/IssmComm.cpp
===================================================================
--- /issm/trunk/src/c/shared/io/Comm/IssmComm.cpp	(revision 26743)
+++ /issm/trunk/src/c/shared/io/Comm/IssmComm.cpp	(revision 26744)
@@ -12,4 +12,9 @@
 #include "../../Numerics/types.h"
 #include "../../Exceptions/exceptions.h"
+
+#ifdef _DO_NOT_LOAD_GLOBALS_
+ISSM_MPI_Comm	IssmComm::comm;
+bool			IssmComm::parallel;
+#endif
 
 void IssmComm::SetComm(ISSM_MPI_Comm incomm){ /*{{{*/
Index: /issm/trunk/src/c/shared/io/Marshalling/IoCodeConversions.cpp
===================================================================
--- /issm/trunk/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 26743)
+++ /issm/trunk/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 26744)
@@ -121,4 +121,9 @@
 		const char* field = "md.friction.coefficient";
 		input_enum        = FrictionCoefficientEnum;
+		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+	}
+	else if(strcmp(string_in,"FrictionC")==0 || strcmp(string_in,"md.friction.C")==0){
+		const char* field = "md.friction.C";
+		input_enum        = FrictionCEnum;
 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
 	}
@@ -163,7 +168,7 @@
 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
 	}
-	else if(strcmp(string_in,"SurfaceloadIceThicknessChange")==0){
-		const char* field = "md.solidearth.surfaceload.icethicknesschange";
-		input_enum        = SurfaceloadIceThicknessChangeEnum;
+	else if(strcmp(string_in,"IceLoad")==0){
+		const char* field = "md.masstransport.spcthickness";
+		input_enum        = MasstransportSpcthicknessEnum;
 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
 	}
@@ -173,12 +178,22 @@
 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
 	}
-	else if(strcmp(string_in,"DslGlobalAverageThermostericSeaLevelChange")==0){
-		const char* field = "md.dsl.global_average_thermosteric_sea_level_change";
-		input_enum        = DslGlobalAverageThermostericSeaLevelChangeEnum;
-		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
-	}
-	else if(strcmp(string_in,"SurfaceloadWaterHeightChange")==0){
-		const char* field = "md.solidearth.surfaceload.waterheightchange";
-		input_enum        = SurfaceloadWaterHeightChangeEnum;
+	else if(strcmp(string_in,"DslGlobalAverageThermostericSeaLevel")==0){
+		const char* field = "md.dsl.global_average_thermosteric_sea_level";
+		input_enum        = OceantransportSpcstrEnum;
+		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+	}
+	else if(strcmp(string_in,"DslSeaWaterPressureAtSeaFloor")==0){
+		const char* field = "md.dsl.sea_water_pressure_at_sea_floor";
+		input_enum        = OceantransportSpcbottompressureEnum;
+		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+	}
+	else if(strcmp(string_in,"DslSeaSurfaceHeightAboveGeoid")==0){
+		const char* field = "md.dsl.sea_surface_height_above_geoid";
+		input_enum        = OceantransportSpcdslEnum;
+		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+	}
+	else if(strcmp(string_in,"TwsLoad")==0){
+		const char* field = "md.hydrology.spcwatercolumn";
+		input_enum        = HydrologyTwsSpcEnum;
 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
 	}
@@ -226,4 +241,5 @@
 		case 11: return SMBgradientscomponentsEnum;
 		case 12: return SMBsemicEnum;	
+		case 55: return SMBautoregressionEnum;
 		default: _error_("Marshalled SMB code \""<<enum_in<<"\" not supported yet");
 	}
@@ -258,4 +274,5 @@
 		case 1: return FrontalForcingsDefaultEnum;
 		case 2: return FrontalForcingsRignotEnum;
+		case 55: return FrontalForcingsRignotAutoregressionEnum;
 		default: _error_("Marshalled Frontalforcings code \""<<enum_in<<"\" not supported yet");
 	}
@@ -268,4 +285,5 @@
 		case 4: return HydrologypismEnum;
 		case 5: return HydrologyGlaDSEnum;
+		case 6: return HydrologyTwsEnum;
 		default: _error_("Marshalled hydrology code \""<<enum_in<<"\" not supported yet");
 	}
@@ -307,4 +325,12 @@
 		case 2: return AmrNeopzEnum;
 		default: _error_("Marshalled AMR code \""<<enum_in<<"\" not supported yet");
+	}
+}/*}}}*/
+int IoCodeToEnumGrd(int enum_in){/*{{{*/
+	switch(enum_in){
+		case 0: return NoneEnum;
+		case 1: return ElasticEnum;
+		case 2: return IvinsEnum;
+		default: _error_("Marshalled GRD code \""<<enum_in<<"\" not supported yet");
 	}
 }/*}}}*/
Index: /issm/trunk/src/c/shared/io/Marshalling/IoCodeConversions.h
===================================================================
--- /issm/trunk/src/c/shared/io/Marshalling/IoCodeConversions.h	(revision 26743)
+++ /issm/trunk/src/c/shared/io/Marshalling/IoCodeConversions.h	(revision 26744)
@@ -13,4 +13,5 @@
 int IoCodeToEnumTimestepping(int enum_in);
 int IoCodeToEnumAmr(int enum_in);
+int IoCodeToEnumGrd(int enum_in);
 
 int IoCodeToEnumVertexEquation(int enum_in);
Index: /issm/trunk/src/c/shared/io/Marshalling/Marshalling.cpp
===================================================================
--- /issm/trunk/src/c/shared/io/Marshalling/Marshalling.cpp	(revision 26743)
+++ /issm/trunk/src/c/shared/io/Marshalling/Marshalling.cpp	(revision 26744)
@@ -10,4 +10,5 @@
 
 #include "./Marshalling.h"
+#include "../../Numerics/isnan.h"
 
 WriteCheckpointFunctor::WriteCheckpointFunctor(char** pmarshalled_data_in) : MarshallHandle(MARSHALLING_WRITE){/*{{{*/
@@ -75,5 +76,12 @@
 	this->identifiers  = identifiers_in;
 	this->size_max         = size_max_in;
+	#if _CODIPACK_MAJOR_==2
+	this->tape_codi    = &(IssmDouble::getTape());
+	#elif _CODIPACK_MAJOR_==1
 	this->tape_codi    = &(IssmDouble::getGlobalTape());
+	#else
+	#error "_CODIPACK_MAJOR_ not supported"
+	#endif
+
 }/*}}}*/
 void RegisterInputFunctor::Echo(void){/*{{{*/
@@ -83,6 +91,14 @@
 void RegisterInputFunctor::call(IssmDouble & value){/*{{{*/
 	_assert_(this->double_count<size_max);
+	_assert_(!xIsNan<IssmDouble>(value));
 	this->tape_codi->registerInput(value);
+	#if _CODIPACK_MAJOR_==2
+	this->identifiers[this->double_count] = value.getIdentifier();
+	#elif _CODIPACK_MAJOR_==1
 	this->identifiers[this->double_count] = value.getGradientData();
+	#else
+	#error "_CODIPACK_MAJOR_ not supported"
+	#endif
+
 	this->double_count++;
 }/*}}}*/
@@ -91,6 +107,14 @@
 		for(int i=0;i<size;i++){
 			_assert_(this->double_count<size_max);
+			_assert_(!xIsNan<IssmDouble>(value[i]));
 			this->tape_codi->registerInput(value[i]);
+			#if _CODIPACK_MAJOR_==2
+			this->identifiers[this->double_count] = value[i].getIdentifier();
+			#elif _CODIPACK_MAJOR_==1
 			this->identifiers[this->double_count] = value[i].getGradientData();
+			#else
+			#error "_CODIPACK_MAJOR_ not supported"
+			#endif
+
 			this->double_count++;
 		}
@@ -100,5 +124,11 @@
 RegisterOutputFunctor::RegisterOutputFunctor(void) : MarshallHandle(AD_REGISTEROUTPUT){/*{{{*/
 	this->double_count = 0;
+	#if _CODIPACK_MAJOR_==2
+	this->tape_codi    = &(IssmDouble::getTape());
+	#elif _CODIPACK_MAJOR_==1
 	this->tape_codi    = &(IssmDouble::getGlobalTape());
+	#else
+	#error "_CODIPACK_MAJOR_ not supported"
+	#endif
 }/*}}}*/
 void RegisterOutputFunctor::Echo(void){/*{{{*/
@@ -107,4 +137,5 @@
 }/*}}}*/
 void RegisterOutputFunctor::call(IssmDouble & value){/*{{{*/
+	_assert_(!xIsNan<IssmDouble>(value));
 	this->tape_codi->registerOutput(value);
 	this->double_count++;
@@ -113,4 +144,5 @@
 	if(value){
 		for(int i=0;i<size;i++){
+			_assert_(!xIsNan<IssmDouble>(value[i]));
 			this->tape_codi->registerOutput(value[i]);
 			this->double_count++;
@@ -121,7 +153,13 @@
 SetAdjointFunctor::SetAdjointFunctor(double* adjoint_in,int size_max_in) : MarshallHandle(AD_SETADJOINT){/*{{{*/
 	this->double_count = 0;
-	this->tape_codi    = &(IssmDouble::getGlobalTape());
 	this->adjoint      = adjoint_in;
 	this->size_max     = size_max_in;
+	#if _CODIPACK_MAJOR_==2
+	this->tape_codi    = &(IssmDouble::getTape());
+	#elif _CODIPACK_MAJOR_==1
+	this->tape_codi    = &(IssmDouble::getGlobalTape());
+	#else
+	#error "_CODIPACK_MAJOR_ not supported"
+	#endif
 }/*}}}*/
 void SetAdjointFunctor::Echo(void){/*{{{*/
@@ -131,4 +169,5 @@
 void SetAdjointFunctor::call(IssmDouble & value){/*{{{*/
 	_assert_(this->double_count<size_max);
+	_assert_(!xIsNan<IssmDouble>(this->adjoint[this->double_count]));
 	value.gradient() = this->adjoint[this->double_count];
 	this->double_count++;
@@ -138,4 +177,5 @@
 		for(int i=0;i<size;i++){
 			_assert_(this->double_count<size_max);
+			_assert_(!xIsNan<IssmDouble>(this->adjoint[this->double_count]));
 			value[i].gradient() = this->adjoint[this->double_count];
 			this->double_count++;
Index: /issm/trunk/src/c/shared/io/Marshalling/Marshalling.h
===================================================================
--- /issm/trunk/src/c/shared/io/Marshalling/Marshalling.h	(revision 26743)
+++ /issm/trunk/src/c/shared/io/Marshalling/Marshalling.h	(revision 26744)
@@ -108,4 +108,11 @@
 };/*}}}*/
 #if defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_)
+#if _CODIPACK_MAJOR_==2
+using Tape = typename IssmDouble::Tape;
+#elif _CODIPACK_MAJOR_==1
+using Tape = typename IssmDouble::TapeType;
+#else
+#error "_CODIPACK_MAJOR_ not supported"
+#endif
 class CountDoublesFunctor:    public MarshallHandle{ /*{{{*/
 
@@ -128,5 +135,5 @@
 		int *identifiers;
 		int  size_max;
-		IssmDouble::TapeType *tape_codi;
+		Tape *tape_codi;
 
 	public:
@@ -142,5 +149,5 @@
 	private:
 		int   double_count;
-		IssmDouble::TapeType* tape_codi;
+		Tape *tape_codi;
 
 	public:
@@ -155,8 +162,8 @@
 
 	private:
-		int                   double_count;
-		int                   size_max;
-		IssmDouble::TapeType* tape_codi;
-		double*               adjoint;
+		int     double_count;
+		int     size_max;
+		Tape   *tape_codi;
+		double *adjoint;
 
 	public:
Index: /issm/trunk/src/c/shared/io/Print/PrintfFunction.cpp
===================================================================
--- /issm/trunk/src/c/shared/io/Print/PrintfFunction.cpp	(revision 26743)
+++ /issm/trunk/src/c/shared/io/Print/PrintfFunction.cpp	(revision 26744)
@@ -32,4 +32,6 @@
 		#ifdef _HAVE_ANDROID_JNI_
 		__android_log_print(ANDROID_LOG_INFO, "Native",message.c_str());
+		#elif _IS_MSYS2_
+		printf("%s",message.c_str());
 		#else
 		ApiPrintf(message.c_str());
@@ -42,4 +44,6 @@
 	#ifdef _HAVE_ANDROID_JNI_
 	__android_log_print(ANDROID_LOG_INFO, "Native",message.c_str());
+	#elif _IS_MSYS2_
+	printf("%s",message.c_str());
 	#else
 	ApiPrintf(message.c_str());
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_fct.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_fct.cpp	(revision 26743)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_fct.cpp	(revision 26744)
@@ -418,4 +418,5 @@
 			danalysis->MassMatrix(&Mc,femmodel);
 			danalysis->FctKMatrix(&K,NULL,femmodel);
+			danalysis->FctPVector(&p,femmodel);
 			break;
 		default: _error_("analysis type " << EnumToStringx(analysis_type) << " not supported for FCT\n");
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_nonlinear.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_nonlinear.cpp	(revision 26743)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_nonlinear.cpp	(revision 26744)
@@ -76,5 +76,5 @@
 		Solverx(&uf, Kff, pf, old_uf, df, femmodel->parameters);
 		femmodel->profiler->Stop(SOLVER);
-	
+
 		Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters);delete ys;
 
@@ -98,5 +98,5 @@
 			}
 		}
-		
+
 		/*Increase count: */
 		count++;
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_sampling.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26744)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26744)
@@ -0,0 +1,148 @@
+/*!\file: solutionsequence_sampling.cpp
+ * \brief: numerical core of linear solutions
+ */
+
+#include "../toolkits/toolkits.h"
+#include "../classes/classes.h"
+#include "../shared/shared.h"
+#include "../modules/modules.h"
+#include "../analyses/analyses.h"
+#include "../shared/Random/randomgenerator.h"
+//#include <random>
+
+void GaussianVector(Vector<IssmDouble>* ppf,int seed){/*{{{*/
+
+
+	/*Intermediaries*/
+	double      rdnumber;
+
+	/*Define seed*/
+	rnd::linear_congruential_engine random_engine;
+	if(seed>=0)
+	{
+		int my_rank;
+		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+	}
+	random_engine.seed(seed);
+
+	/* Define univariate distribution */
+
+	rnd::normal_distribution distribution(0.0,1.0);
+
+	int        *local_indices = NULL;
+	IssmDouble *local_vector = NULL;
+	ppf->GetLocalVector(&local_vector,&local_indices);
+
+  int M;
+	ppf->GetLocalSize(&M);
+	for(int i=0;i<M;i++){
+		rdnumber = distribution.generator(random_engine);
+		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+	}
+	ppf->Assemble();
+
+}/*}}}*/
+void solutionsequence_sampling(FemModel* femmodel){
+
+	/*intermediary: */
+  Matrix<IssmDouble>*  Kff = NULL;
+	Matrix<IssmDouble>*  Kfs = NULL;
+  Vector<IssmDouble>*  ug  = NULL;
+  Vector<IssmDouble>*  uf  = NULL;
+  Vector<IssmDouble>*  old_uf  = NULL;     // previous solution vector (for transient)
+  Vector<IssmDouble>*  pf  = NULL;
+  Vector<IssmDouble>*  df  = NULL;
+  Vector<IssmDouble>*  ys=NULL;
+
+  SamplingAnalysis*    analysis = NULL;
+
+  Vector<IssmDouble>*  Ml = NULL;      // diagonal lumped mass matrix
+  Vector<IssmDouble>*  Mscale = NULL;  // square root of diagonal lumped factor matrix
+
+  /*parameters:*/
+  int solution_type, alpha, step, seed, nsize;
+  IssmDouble phi, tau;
+
+  /*Recover parameters: */
+  femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+  femmodel->parameters->FindParam(&seed,SamplingSeedEnum);
+  femmodel->parameters->FindParam(&alpha,SamplingAlphaEnum);
+  femmodel->parameters->FindParam(&tau,SamplingTauEnum);
+
+  /*Recover parameters for transient simulation: */
+  if(solution_type==TransientSolutionEnum)
+  {
+    femmodel->parameters->FindParam(&step,StepEnum);
+    femmodel->parameters->FindParam(&phi,SamplingPhiEnum);
+		if(seed>=0) seed = seed + 13923272*step; // change default seed for transient simulations (by considering an arbitrary shif based on the step number)
+
+    GetSolutionFromInputsx(&ug,femmodel);
+    Reducevectorgtofx(&uf, ug, femmodel->nodes,femmodel->parameters);
+    old_uf=uf->Duplicate();
+  }
+
+  /*CreateAnalysis*/
+
+  analysis = new SamplingAnalysis();
+
+  analysis->LumpedMassMatrix(&Ml,femmodel); //Create lumped mass matrix
+
+  if(alpha%2!=0)  analysis->LumpedKMatrix(&Mscale,femmodel);   /* Compute square root of lump mass matrix (for alpha even) or stiffness matrix (for alpha odd) */
+  else{
+    Mscale=Ml->Duplicate();
+    Ml->Copy(Mscale);
+  }
+  Mscale->Pow(0.5);
+
+  femmodel->UpdateConstraintsx();
+  SystemMatricesx(&Kff, &Kfs, &pf, &df, NULL,femmodel);
+  CreateNodalConstraintsx(&ys,femmodel->nodes);
+  Reduceloadx(pf, Kfs, ys);
+  delete Kfs;
+
+  /*Copy old solution for transient run */
+  if(solution_type==TransientSolutionEnum) uf->Copy(old_uf);
+
+  /* Generate random RHS */
+  GaussianVector(pf,seed);
+
+  /* Multiply random RHS by square root of mass matrix (for alpha even) or stiffness matrix (for alpha odd) */
+  pf->PointwiseMult(pf,Mscale);
+
+  /*Go solve SPDE */
+  femmodel->profiler->Start(SOLVER);
+  Solverx(&uf, Kff, pf, NULL, df, femmodel->parameters);
+  femmodel->profiler->Stop(SOLVER);
+
+  /* Iterate to compute a realization for alpha>2 */
+  for(int i=3;i<=alpha;i+=2){
+
+    /*Create RHS */
+    uf->Copy(pf);
+    pf->PointwiseMult(pf,Ml);
+
+    /*Go solve SPDE */
+    femmodel->profiler->Start(SOLVER);
+    Solverx(&uf, Kff, pf, NULL, df, femmodel->parameters);
+    femmodel->profiler->Stop(SOLVER);
+
+  }
+
+  /* Divide results by tau */
+  uf->Scale(1.0/tau);
+
+  /* Update solution x_{t+1} = phi x_{t} + noise for transient */
+  if(solution_type==TransientSolutionEnum) uf->AXPY(old_uf,phi);
+
+  /* Update input */
+  Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters);
+  InputUpdateFromSolutionx(femmodel,ug);
+
+  /*clean-up*/
+  delete Kff; delete pf; delete df; delete uf; delete ys; delete old_uf;
+  delete Ml; delete Mscale;
+  delete analysis;
+  delete ug;
+
+}
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_schurcg.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_schurcg.cpp	(revision 26743)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_schurcg.cpp	(revision 26744)
@@ -33,5 +33,4 @@
 	IssmPDouble				t1,t2;					/* Time measurement for bottleneck analysis */
 
-	
 	double tmp1,tmp2,tmp3;
 	int tmpi;
@@ -39,6 +38,4 @@
 
 	int noIt;
-
-
 
 	int precond = 0;
@@ -49,5 +46,4 @@
 	PetscBool flag,flg;
 	#endif
-
 
 	char ksp_type[50];
@@ -71,5 +67,4 @@
 	#endif
 
-	
 	if(precond){
 		_printf0_("Running WITH preconditioner\n");
@@ -78,8 +73,7 @@
 	}
 
-
 	/*Initialize output*/
 	Vector<IssmDouble>* out_uf=new Vector<IssmDouble>(uf0);
-	
+
 	/* Extract block matrices from the saddle point matrix */
 	/* [ A   B ] = Kff
@@ -97,5 +91,5 @@
 	MatGetSubMatrix(Kff,isp,isv,MAT_INITIAL_MATRIX,&BT);
 	#endif
-	
+
 	/* Extract preconditioner matrix on the pressure space*/
 	#if PETSC_VERSION_GT(3,8,0)
@@ -105,5 +99,4 @@
 	#endif
 
-
 	/* Get number of velocity / pressure nodes */
 	MatGetSize(B,&nu,&np);
@@ -117,5 +110,4 @@
 	VecGetSubVector(out_uf->pvector->vector,isv,&uold);
 	VecGetSubVector(out_uf->pvector->vector,isp,&p);
-
 
 	/* Set up intermediaries */
@@ -133,5 +125,5 @@
 	VecDuplicate(p,&wnew);VecSet(wnew,0.0);
 	VecDuplicate(uold,&chi);VecSet(chi,0.0);
-	
+
 	/* Get global RHS (for each block sub-problem respectively)*/
 	VecGetSubVector(pf,isv,&f1);
@@ -143,5 +135,5 @@
 	/* a(u0,v) = f1(v)-b(p0,v)  i.e.  Au0 = F1-Bp0 */
 	/* u0 = u_DIR on \Gamma_DIR */
-	
+
 	/* Create KSP context */
 	KSPCreate(IssmComm::GetComm(),&kspu);
@@ -174,13 +166,11 @@
 		_error_("Suggested KSP method not implemented yet!\n");
 	}
-	
+
 	KSPSetInitialGuessNonzero(kspu,PETSC_TRUE);
-	
+
 	/*Strong rel. residual tolerance needed when solving for the velocity update. 
 	 * This is because ISSM uses the dimensional equations, so the initial guess chi = 0
 	 * results in a very high initial residual (~ 1e19)*/
 	KSPSetTolerances(kspu,ELLTOL,PETSC_DEFAULT,PETSC_DEFAULT,maxiter); //maxiter
-
-
 
 	KSPGetPC(kspu,&pcu);
@@ -210,5 +200,4 @@
 	KSPSetUp(kspu);
 
-	
 	/* Create RHS */
 	/* RHS = F1-B * pold */
@@ -227,7 +216,5 @@
 		VecNorm(resu,NORM_2,&tmp5);
 
-
-	}
-
+	}
 
 	/* Go solve Au0 = F1-Bp0*/
@@ -235,9 +222,7 @@
 	KSPGetIterationNumber(kspu,&noIt);
 
-
-
 	if (VerboseConvergence())
 	{
-	
+
 	KSPGetIterationNumber(kspu,&tmpi);
 	VecScale(rhsu,-1.);MatMultAdd(A,uold,rhsu,tmpu);VecScale(rhsu,-1.);
@@ -249,17 +234,13 @@
 	}
 
-
-
 	/* Set up u_new */
 	VecDuplicate(uold,&unew);VecCopy(uold,unew);
 	VecAssemblyBegin(unew);VecAssemblyEnd(unew);
 
-
-
 	/* ------------------------------------------------------------- */
 
 	/*Get initial residual*/
 	/*(1/mu(x) * g0, q) = b(q,u0) - (f2,q)  i.e.  IP * g0 = BT * u0 - F2*/
-	
+
 	/* Create KSP context */
 	KSPCreate(IssmComm::GetComm(),&kspip);
@@ -269,15 +250,13 @@
 	KSPSetOperators(kspip,IP,IP,DIFFERENT_NONZERO_PATTERN);
 	#endif
-	
+
 	/* Create RHS */
 	/* RHS = BT * uold - F2 */
 	VecScale(uold,-1.);MatMultAdd(BT,uold,f2,rhsp);VecScale(uold,-1.);
 
-
 	/* Set KSP & PC options */
 	KSPSetType(kspip,KSPGMRES);
 	KSPSetInitialGuessNonzero(kspip,PETSC_TRUE);
-	
-	
+
 	KSPGetPC(kspip,&pcp);
 	PCSetType(pcp,PCJACOBI);
@@ -294,14 +273,10 @@
 	}
 
-
-
 	/* Go solve */
 	KSPSolve(kspip,rhsp,gold);
 
-
-
 	if (VerboseConvergence())
 	{
-	
+
 	KSPGetResidualNorm(kspip,&tmp1);
 	VecScale(rhsp,-1.);MatMultAdd(IP,gold,rhsp,tmpp);VecScale(rhsp,-1.);
@@ -311,5 +286,4 @@
 	_printf0_("||IP*g00 - rhsp||_euc: " << tmp4 <<"\n||Jac(-1)*(IP*g00-rhsp)||_euc: " << tmp5 << "\n||IP*gn0-rhsp||_euc: " << tmp2<< "\n||Jac(-1)*(IP*gn0-rhsp)||_euc: " << tmp1 << "\nIteration number: "<<tmpi<<"\n"); 	
 	}
-
 
 	/*Initial residual*/
@@ -318,5 +292,4 @@
 	_printf0_("inner product norm g0: "<<initRnorm<<"\n");
 
-
 	/*Iterate only if inital residual large enough*/
 	if(initRnorm > 1e-5)
@@ -326,5 +299,4 @@
 	VecDuplicate(gold,&gnew);VecCopy(gold,gnew);
 	VecAssemblyBegin(gnew);VecAssemblyEnd(gnew);
-
 
 	/* ------------------------------------------------------------ */
@@ -334,5 +306,4 @@
 	VecDuplicate(gold,&wold);VecCopy(gold,wold);
 	VecAssemblyBegin(wold);VecAssemblyEnd(wold);
-
 
 	/* Count number of iterations */
@@ -351,11 +322,10 @@
 		VecScale(wold,1.);MatMult(B,wold,rhsu);VecScale(wold,1.);
 		VecSet(chi,0.0);
-	
-		
+
 		if(VerboseConvergence())
 		{
 		VecScale(rhsu,-1.);MatMultAdd(A,chi,rhsu,tmpu);VecScale(rhsu,-1.);
 		VecNorm(tmpu,NORM_2,&tmp4);
-			
+
 		KSPInitialResidual(kspu,chi,tmpu,tmpu2,resu,rhsu);
 		VecNorm(resu,NORM_2,&tmp5);
@@ -363,26 +333,19 @@
 		}
 
-		
 			KSPSolve(kspu,rhsu,chi);
-		
-	
-		
-		
+
 		if (VerboseConvergence())
 		{
 		VecNorm(chi,NORM_2,&tmp1);
 		KSPGetResidualNorm(kspu,&tmp2);
-	
+
 		VecScale(rhsu,-1.);MatMultAdd(A,chi,rhsu,tmpu);VecScale(rhsu,-1.);
 		VecNorm(tmpu,NORM_2,&tmp3);
-		
-		
+
 		KSPGetIterationNumber(kspu,&tmpi);
 		_printf0_("||chi_nk||_euc: "<< tmp1 << "\n||A*chi_0k - rhsu||_euc: "<<tmp4<< "\n||P(-1)*(A*chi_0k-rhsu)||_euc: " << tmp5 << "\n||A*chi_nk - rhsu||_euc: "<< tmp3 <<"\n||P(-1)*(A*chi_nk - rhsu)||_euc: " << tmp2 <<"\nIteration Number: " << tmpi <<"\n");
 		}
 
-
 		/* ---------------------------------------------------------- */
-
 
 		/*Set step size*/
@@ -390,17 +353,14 @@
 		MatMult(IP,gold,tmpp);
 		VecDot(tmpp,wold,&rho);
-		
+
 		MatMult(BT,chi,tmpp);
 		VecDot(tmpp,wold,&tmpScalar);
 		rho = rho/tmpScalar;
 
-
 		/* ---------------------------------------------------------- */
-
 
 		/*Pressure update*/
 		/*p(m+1) = pm + rhom * wm*/
 		VecAXPY(p,-1.*rho,wold);
-
 
 		/*Velocity update*/
@@ -408,5 +368,4 @@
 		VecWAXPY(unew,rho,chi,uold);
 		VecNorm(unew,NORM_2,&tmpScalar);
-
 
 		if (VerboseConvergence())
@@ -421,6 +380,4 @@
 		_printf0_("Incompressibility norm: " << tmp7 <<"\n");
 		}
-
-
 
 		/* ---------------------------------------------------------- */
@@ -432,11 +389,9 @@
 		VecWAXPY(rhsp,-1.*rho,tmpp,tmpp2);
 		KSPSolve(kspip,rhsp,gnew);
-		
-
 
 		/* ---------------------------------------------------------- */
 
 		MatMult(IP,gnew,tmpp);
-		
+
 		VecDot(tmpp,gnew,&gamma);
 		rnorm = sqrt(gamma);
@@ -454,5 +409,5 @@
 			_printf0_("L2-Norm g: "<< rnorm << "\n");
 		}
-	
+
 		/*Break prematurely if solver doesn't reach desired tolerance in reasonable time frame*/
 		if(count > 10./TOL)   
@@ -461,8 +416,6 @@
 		 break;
 		}
-	
 
 		/* ---------------------------------------------------------- */
-
 
 		/*Directional update*/
@@ -475,5 +428,5 @@
 		/* Assign new to old iterates */
 		VecCopy(wnew,wold);VecCopy(gnew,gold);VecCopy(unew,uold);
-		
+
 		count++;
 	}
@@ -487,10 +440,9 @@
 	*puf=out_uf;
 
-
 	/* Cleanup */
 	KSPDestroy(&kspu);KSPDestroy(&kspip);
 
 	MatDestroy(&A);MatDestroy(&B);MatDestroy(&BT);MatDestroy(&IP);
-	
+
 	VecDestroy(&p);VecDestroy(&uold);VecDestroy(&unew);VecDestroy(&rhsu);VecDestroy(&rhsp);
 	VecDestroy(&gold);VecDestroy(&gnew);VecDestroy(&wold);VecDestroy(&wnew);VecDestroy(&chi);
@@ -522,5 +474,4 @@
 	double rnorm1, rnorm2;
 
-
 	if(VerboseModule()) _printf0_("   checking convergence\n");
 
@@ -548,5 +499,5 @@
 	MatGetSubMatrix(Kff->pmatrix->matrix,isp,isv,MAT_INITIAL_MATRIX,&BT);
 	#endif
-	
+
 		/*no. of free nodes in velocity/pressure space*/
 		MatGetSize(B,&n_u,&n_p);
@@ -560,5 +511,4 @@
 		VecGetSubVector(uf->pvector->vector,isv,&u);
 		VecGetSubVector(uf->pvector->vector,isp,&p);
-		
 
 		/*Extract values of the RHS corresponding to the first/second block*/
@@ -573,13 +523,11 @@
 		VecDuplicate(p,&res2);VecSet(res2,1.0);
 
-
 	/*Display solver caracteristics*/
 	if (VerboseConvergence()){
-		
+
 		/*Calculate res1 = A*u + B*p - f1*/
 		VecScale(f1,-1.);MatMultAdd(A,u,f1,tmp);MatMultAdd(B,p,tmp,res1);VecScale(f1,-1.);
 		/*Calculate res2 = B^T * u - f2*/
 		VecScale(f2,-1.);MatMultAdd(BT,u,f2,res2);VecScale(f2,-1.);
-
 
 		/*compute norm(res1), norm(res2), norm(F) and residue*/
@@ -597,9 +545,8 @@
 	VecRestoreSubVector(uf->pvector->vector,isv,&u);
 	VecRestoreSubVector(uf->pvector->vector,isp,&p);
-	
+
 	/*Extract values corresponding to velocity/pressure on the old solution*/
 	VecGetSubVector(old_uf->pvector->vector,isv,&uold);
 	VecGetSubVector(old_uf->pvector->vector,isp,&pold);
-		
 
 	/*Force equilibrium (Mandatory)*/
@@ -609,5 +556,5 @@
 	/*Calculate res2 = B^T * uold - f2*/
 	VecScale(f2,-1.);MatMultAdd(BT,uold,f2,res2);VecScale(f2,-1.);
-	
+
 	/*compute norm(res1), norm(res2), norm(F) and residue*/
 	VecNorm(res1,NORM_2,&rnorm1);VecNorm(res2,NORM_2,&rnorm2);
@@ -626,6 +573,4 @@
 	VecRestoreSubVector(old_uf->pvector->vector,isv,&uold);
 	VecRestoreSubVector(old_uf->pvector->vector,isp,&pold);
-	
-
 
 	//print
@@ -721,5 +666,5 @@
 	int  count=0;
 	bool converged=false;
-	
+
 	/*Start non-linear iteration using input velocity: */
 	GetSolutionFromInputsx(&ug,femmodel);
@@ -729,5 +674,5 @@
 	InputUpdateFromConstantx(femmodel,converged,ConvergedEnum);
 	InputUpdateFromSolutionx(femmodel,ug);
-	
+
 	for(;;){
 
@@ -747,7 +692,7 @@
 		PetscOptionsGetInt(NULL,PETSC_NULL,"-schur_pc",&precond,NULL);
 		#endif
-	
+
 		StressbalanceAnalysis* analysis = new StressbalanceAnalysis();	
-	
+
 		/* Construct Schur preconditioner matrix or mass matrix depending on input */
 		if(precond)
@@ -760,5 +705,5 @@
 			}
 		}else{
-			
+
 			for(Object* & object : femmodel->elements->objects){
 				Element* element2=xDynamicCast<Element*>(object);
@@ -769,7 +714,6 @@
 		}
 
-	   		
 		delete analysis;
-	
+
 		/*Obtain index sets for velocity and pressure components */
 		IS isv = NULL;
@@ -785,9 +729,7 @@
 		Kff->Assemble();
 
-	
 		/*Solve*/
 		femmodel->profiler->Start(SOLVER);
 		_assert_(Kff->type==PetscMatType); 
-
 
 		SchurCGSolver(&uf,
Index: /issm/trunk/src/c/solutionsequences/solutionsequences.h
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequences.h	(revision 26743)
+++ /issm/trunk/src/c/solutionsequences/solutionsequences.h	(revision 26744)
@@ -1,4 +1,4 @@
 /*
- * solutionsequences.h: 
+ * solutionsequences.h:
  */
 
@@ -25,4 +25,5 @@
 void solutionsequence_adjoint_linear(FemModel* femmodel);
 void solutionsequence_schurcg(FemModel* femmodel);
+void solutionsequence_sampling(FemModel* femmodel);
 
 /*convergence*/
Index: /issm/trunk/src/c/toolkits/ToolkitOptions.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/ToolkitOptions.cpp	(revision 26743)
+++ /issm/trunk/src/c/toolkits/ToolkitOptions.cpp	(revision 26744)
@@ -8,4 +8,9 @@
 #include "../shared/Exceptions/exceptions.h"
 #include "../shared/MemOps/MemOps.h"
+
+#ifdef _DO_NOT_LOAD_GLOBALS_
+char* ToolkitOptions::toolkittype;
+char* ToolkitOptions::toolkitoptions;
+#endif
 
 void  ToolkitOptions::Init(const char* toolkit_in,const char* options){ /*{{{*/
Index: /issm/trunk/src/c/toolkits/codipack/CoDiPackCommon.hpp
===================================================================
--- /issm/trunk/src/c/toolkits/codipack/CoDiPackCommon.hpp	(revision 26743)
+++ /issm/trunk/src/c/toolkits/codipack/CoDiPackCommon.hpp	(revision 26744)
@@ -35,5 +35,11 @@
 inline void getVectorGradData(const Real* vec, Data* dataVec, int n) {
   for(int i = 0; i < n; ++i) {
-    dataVec[i]=vec[i].getGradientData();
+	 #if _CODIPACK_MAJOR_==2
+    dataVec[i]=vec[i].getIdentifier();
+	 #elif _CODIPACK_MAJOR_==1
+	 dataVec[i]=vec[i].getGradientData();
+	 #else
+	 #error "_CODIPACK_MAJOR_ not supported"
+	 #endif
   }
 }
@@ -43,5 +49,11 @@
   for(int i = 0; i < n; ++i) {
     pasVec[i]=vec[i].getValue();
-    dataVec[i]=vec[i].getGradientData();
+	 #if _CODIPACK_MAJOR_==2
+    dataVec[i]=vec[i].getIdentifier();
+	 #elif _CODIPACK_MAJOR_==1
+	 dataVec[i]=vec[i].getGradientData();
+	 #else
+	 #error "_CODIPACK_MAJOR_ not supported"
+	 #endif
   }
 }
@@ -50,14 +62,32 @@
 inline void getPrimalAndGradData(const Real& value, Passive& pas, Data& data) {
   pas=value.getValue();
+  #if _CODIPACK_MAJOR_==2
+  data=value.getIdentifier();
+  #elif _CODIPACK_MAJOR_==1
   data=value.getGradientData();
+  #else
+  #error "_CODIPACK_MAJOR_ not supported"
+  #endif
 }
 
 template<typename Real, typename Data>
 inline void registerVector(Real* vec, Data* dataVec, int n) {
-  typename Real::TapeType& tape = Real::getGlobalTape();
+	#if _CODIPACK_MAJOR_==2
+	typename Real::Tape& tape = Real::getTape();
+	#elif _CODIPACK_MAJOR_==1
+	typename Real::TapeType& tape = Real::getGlobalTape();
+	#else
+	#error "_CODIPACK_MAJOR_ not supported"
+	#endif
 
   for(int i = 0; i < n; ++i) {
     tape.registerInput(vec[i]);
-    dataVec[i]=vec[i].getGradientData();
+	 #if _CODIPACK_MAJOR_==2
+    dataVec[i]=vec[i].getIdentifier();
+	 #elif _CODIPACK_MAJOR_==1
+	 dataVec[i]=vec[i].getGradientData();
+	 #else
+	 #error "_CODIPACK_MAJOR_ not supported"
+	 #endif
   }
 }
Index: /issm/trunk/src/c/toolkits/codipack/ampi_interface.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/codipack/ampi_interface.cpp	(revision 26743)
+++ /issm/trunk/src/c/toolkits/codipack/ampi_interface.cpp	(revision 26744)
@@ -12,3 +12,2 @@
 #error "Cannot compile without MeDiPack and AdjointMpi"
 #endif
-
Index: /issm/trunk/src/c/toolkits/gsl/DenseGslSolve.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/gsl/DenseGslSolve.cpp	(revision 26743)
+++ /issm/trunk/src/c/toolkits/gsl/DenseGslSolve.cpp	(revision 26744)
@@ -254,16 +254,17 @@
 
 #ifdef _HAVE_CODIPACK_
-void SolverxSeq_codi_b(void* tape_in,void* data_in,void* ra) {/*{{{*/
+#if _CODIPACK_MAJOR_==2
+using Tape = typename IssmDouble::Tape;
+using AccessInterface = codi::VectorAccessInterface<typename Tape::Real, typename Tape::Identifier>;
+void SolverxSeq_codi_b(Tape* tape,void* data_in, AccessInterface* ra) {/*{{{*/
 
 	/*recast data_in and tape*/
-	codi::DataStore* data = (codi::DataStore*)data_in;
-	//IssmDouble::TapeType& tape = (IssmDouble::TapeType&)tape_in;
-	IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
+	codi::ExternalFunctionUserData* data = (codi::ExternalFunctionUserData*)data_in;
 
   IssmDouble::Real* valueATrans;
-  IssmDouble::GradientData* indexATrans;
-  IssmDouble::GradientData* indexB;
+  IssmDouble::Identifier* indexATrans;
+  IssmDouble::Identifier* indexB;
   IssmDouble::Real* valueX;
-  IssmDouble::GradientData* indexX;
+  IssmDouble::Identifier* indexX;
   int n;
 
@@ -275,17 +276,16 @@
   data->getData(n);
 
-
   // create the adjoint vector for x and reset the adjoint values on the tape
-  IssmDouble::GradientValue* adjX = xNew<IssmDouble::GradientValue>(n);
-  getVectorAdjoint(tape, indexX, adjX, n);
-
-  IssmDouble::GradientValue* sol  = xNew<IssmDouble::GradientValue>(n);
+  IssmDouble::Gradient* adjX = xNew<IssmDouble::Gradient>(n);
+  getVectorAdjoint(*tape, indexX, adjX, n);
+
+  IssmDouble::Gradient* sol  = xNew<IssmDouble::Gradient>(n);
   SolverxSeq(sol, valueATrans, adjX, n);
 
-  updateVectorAdjoint(tape, indexB, sol, n);
+  updateVectorAdjoint(*tape, indexB, sol, n);
   for(int i=0; i<n; ++i) {
     for (int j=0; j<n; ++j) {
       // we access the transposed matrix here because we stored the indices in a transposed way
-      updateAdjoint(tape, indexATrans[i*n+j], -sol[j]*valueX[i]);
+      updateAdjoint(*tape, indexATrans[i*n+j], -sol[j]*valueX[i]);
     }
   }
@@ -295,14 +295,14 @@
 }
 /*}}}*/
-void SolverxSeq_codi_delete(void* tape_in,void* data_in) {/*{{{*/
+void SolverxSeq_codi_delete(Tape* tape,void* data_in) {/*{{{*/
 
 	/*recast data_in*/
-	codi::DataStore* data = (codi::DataStore*)data_in;
+	codi::ExternalFunctionUserData* data = (codi::ExternalFunctionUserData*)data_in;
 
   IssmDouble::Real* valueATrans;
-  IssmDouble::GradientData* indexATrans;
-  IssmDouble::GradientData* indexB;
+  IssmDouble::Identifier* indexATrans;
+  IssmDouble::Identifier* indexB;
   IssmDouble::Real* valueX;
-  IssmDouble::GradientData* indexX;
+  IssmDouble::Identifier* indexX;
   int n;
 
@@ -319,18 +319,18 @@
   xDelete(valueX);
   xDelete(indexX);
- 
+
   delete data;
 }
 /*}}}*/
 void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters){/*{{{*/
-  IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
-  codi::DataStore* dataHandler = NULL;
+  IssmDouble::Tape& tape = IssmDouble::getTape();
+  codi::ExternalFunctionUserData* dataHandler = NULL;
 
   if(tape.isActive()) {
-    dataHandler = new codi::DataStore();
+    dataHandler = new codi::ExternalFunctionUserData();
 
     // create the index vector and the double data for A and B
     IssmDouble::Real* valueATrans = xNew<IssmDouble::Real>(n*n);
-    IssmDouble::GradientData* indexATrans = xNew<IssmDouble::GradientData>(n*n);
+    IssmDouble::Identifier* indexATrans = xNew<IssmDouble::Identifier>(n*n);
 
     // read the data for matrix in a transposed fashion
@@ -342,5 +342,5 @@
 
     // read the data from B (primal values are not required vor B
-    IssmDouble::GradientData* indexB = xNew<IssmDouble::GradientData>(n);
+    IssmDouble::Identifier* indexB = xNew<IssmDouble::Identifier>(n);
     getVectorGradData(B, indexB, n);
 
@@ -366,5 +366,5 @@
   if(tape.isActive()) {
     // create the index vector X and register x as active variables
-    IssmDouble::GradientData* indexX = xNew<IssmDouble::GradientData>(n);
+    IssmDouble::Identifier* indexX = xNew<IssmDouble::Identifier>(n);
     registerVector(X, indexX, n);
 
@@ -375,5 +375,5 @@
     dataHandler->addData(n);
 
-    tape.pushExternalFunctionHandle(&SolverxSeq_codi_b, dataHandler, &SolverxSeq_codi_delete);
+	 tape.pushExternalFunction(codi::ExternalFunction<Tape>::create(&SolverxSeq_codi_b,(void*)dataHandler, &SolverxSeq_codi_delete));
   }
   else{
@@ -386,4 +386,140 @@
 }
 /*}}}*/
+#elif _CODIPACK_MAJOR_==1
+void SolverxSeq_codi_b(void* tape_in,void* data_in,void* ra) {/*{{{*/
+
+	/*recast data_in and tape*/
+	codi::DataStore* data = (codi::DataStore*)data_in;
+	//IssmDouble::TapeType& tape = (IssmDouble::TapeType&)tape_in;
+	IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
+
+	IssmDouble::Real* valueATrans;
+	IssmDouble::GradientData* indexATrans;
+	IssmDouble::GradientData* indexB;
+	IssmDouble::Real* valueX;
+	IssmDouble::GradientData* indexX;
+	int n;
+
+	data->getData(valueATrans);
+	data->getData(indexATrans);
+	data->getData(indexB);
+	data->getData(valueX);
+	data->getData(indexX);
+	data->getData(n);
+
+
+	// create the adjoint vector for x and reset the adjoint values on the tape
+	IssmDouble::GradientValue* adjX = xNew<IssmDouble::GradientValue>(n);
+	getVectorAdjoint(tape, indexX, adjX, n);
+
+	IssmDouble::GradientValue* sol  = xNew<IssmDouble::GradientValue>(n);
+	SolverxSeq(sol, valueATrans, adjX, n);
+
+	updateVectorAdjoint(tape, indexB, sol, n);
+	for(int i=0; i<n; ++i) {
+		for (int j=0; j<n; ++j) {
+			// we access the transposed matrix here because we stored the indices in a transposed way
+			updateAdjoint(tape, indexATrans[i*n+j], -sol[j]*valueX[i]);
+		}
+	}
+
+	xDelete(sol);
+	xDelete(adjX);
+}
+/*}}}*/
+void SolverxSeq_codi_delete(void* tape_in,void* data_in) {/*{{{*/
+
+	/*recast data_in*/
+	codi::DataStore* data = (codi::DataStore*)data_in;
+
+	IssmDouble::Real* valueATrans;
+	IssmDouble::GradientData* indexATrans;
+	IssmDouble::GradientData* indexB;
+	IssmDouble::Real* valueX;
+	IssmDouble::GradientData* indexX;
+	int n;
+
+	data->getData(valueATrans);
+	data->getData(indexATrans);
+	data->getData(indexB);
+	data->getData(valueX);
+	data->getData(indexX);
+	data->getData(n);
+
+	xDelete(valueATrans);
+	xDelete(indexATrans);
+	xDelete(indexB);
+	xDelete(valueX);
+	xDelete(indexX);
+
+	delete data;
+}
+/*}}}*/
+void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters){/*{{{*/
+	IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
+	codi::DataStore* dataHandler = NULL;
+
+	if(tape.isActive()) {
+		dataHandler = new codi::DataStore();
+
+		// create the index vector and the double data for A and B
+		IssmDouble::Real* valueATrans = xNew<IssmDouble::Real>(n*n);
+		IssmDouble::GradientData* indexATrans = xNew<IssmDouble::GradientData>(n*n);
+
+		// read the data for matrix in a transposed fashion
+		for (int i=0; i<n; ++i) {
+			for (int j=0; j<n; ++j) {
+				getPrimalAndGradData(A[i*n+j], valueATrans[j*n+i], indexATrans[j*n+i]);
+			}
+		}
+
+		// read the data from B (primal values are not required vor B
+		IssmDouble::GradientData* indexB = xNew<IssmDouble::GradientData>(n);
+		getVectorGradData(B, indexB, n);
+
+		dataHandler->addData(valueATrans);
+		dataHandler->addData(indexATrans);
+		dataHandler->addData(indexB);
+	}
+
+	// unpack the primal values from the matrix and the vector
+	IssmDouble::Real* valueA = xNew<IssmDouble::Real>(n*n);
+	IssmDouble::Real* valueB = xNew<IssmDouble::Real>(n);
+	// read the data from A and B
+	getVectorPrimal(A, valueA, n*n);
+	getVectorPrimal(B, valueB, n);
+
+	// create the placeholder for X and solve the system
+	IssmDouble::Real* valueX = xNew<IssmDouble::Real>(n);
+	SolverxSeq(valueX, valueA, valueB, n);
+
+	// pack the values into x
+	setVectorPrimal(X, valueX, n);
+
+	if(tape.isActive()) {
+		// create the index vector X and register x as active variables
+		IssmDouble::GradientData* indexX = xNew<IssmDouble::GradientData>(n);
+		registerVector(X, indexX, n);
+
+		dataHandler->addData(valueX);
+		dataHandler->addData(indexX);
+
+		// store other arguments
+		dataHandler->addData(n);
+
+		tape.pushExternalFunctionHandle(&SolverxSeq_codi_b, dataHandler, &SolverxSeq_codi_delete);
+	}
+	else{
+		// if the tape is active valueX is stored in the dataHandler and deleted in the reverse sweep
+		xDelete(valueX);
+	}
+
+	xDelete(valueB);
+	xDelete(valueA);
+}
+/*}}}*/
+#else
+#error "_CODIPACK_MAJOR_ not supported"
+#endif
 void DenseGslSolve(/*output*/ IssmDouble** px,/*stiffness matrix:*/ IssmDouble* Kff, int Kff_M, int Kff_N, /*right hand side load vector: */ IssmDouble* pf, int pf_M, Parameters* parameters){ /*{{{*/
 
@@ -401,3 +537,4 @@
 }
 /*}}}*/
-#endif
+
+#endif
Index: /issm/trunk/src/c/toolkits/issm/Bucket.h
===================================================================
--- /issm/trunk/src/c/toolkits/issm/Bucket.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/issm/Bucket.h	(revision 26744)
@@ -34,37 +34,78 @@
 			this->Initialize();
 		} /*}}}*/
-		Bucket(int min,int* idxmin,int nin,int* idxnin,doubletype* valuesin,InsMode modein){ /*{{{*/
+		Bucket(int m_in,int* idxm_in,int n_in,int* idxn_in,doubletype* values_in,InsMode mode_in){ /*{{{*/
 
 			this->Initialize();
 
+			/*Check whether we have negative indices?*/
+			int m_numneg = 0;
+			int n_numneg = 0;
+			for(int i=0;i<m_in;i++) if(idxm_in[i]<0) m_numneg++;
+			for(int i=0;i<n_in;i++) if(idxn_in[i]<0) n_numneg++;
+
 			this->type=MATRIX_BUCKET;
-			this->m=min;
-			this->n=nin;
-			this->mode=modein;
+			this->m=m_in-m_numneg;
+			this->n=n_in-n_numneg;
+			this->mode=mode_in;
+			if(this->m*this->n){
+				this->idxm=xNew<int>(this->m); 
+				this->idxn=xNew<int>(this->n); 
+				this->values=xNew<doubletype>(this->n*this->m);
+
+				if(m_numneg==0 && n_numneg==0){
+					xMemCpy(this->values,values_in,this->n*this->m);
+					xMemCpy(this->idxm,idxm_in,this->m);
+					xMemCpy(this->idxn,idxn_in,this->n);
+				}
+				else{
+					int count;
+					count =0; for(int i=0;i<m_in;i++) if(idxm_in[i]>=0) this->idxm[count++] = idxm_in[i];
+					count =0; for(int i=0;i<n_in;i++) if(idxn_in[i]>=0) this->idxn[count++] = idxn_in[i];
+					count = 0;
+					for(int i=0;i<m_in;i++){
+						if(idxm_in[i]>=0){
+							for(int j=0;j<n_in;j++){
+								if(idxn_in[j]>=0){
+									this->values[count++] = values_in[i*n_in+j];
+								}
+							}
+						}
+					}
+				}
+			}
+			else{
+				/*Set both as 0 to save time*/
+				this->m = 0;
+				this->n = 0;
+			}
+		} /*}}}*/
+		Bucket(int m_in,int* idxm_in,doubletype* values_in,InsMode mode_in){ /*{{{*/ 
+			this->Initialize();
+
+			/*Check whether we have negative indices?*/
+			int numneg = 0;
+			for(int i=0;i<m_in;i++) if(idxm_in[i]<0) numneg++;
+
+			this->type=VECTOR_BUCKET; 
+			this->m=m_in-numneg;
+			this->mode=mode_in;
 			if(this->m){
-				this->idxm=xNew<int>(this->m); 
-				xMemCpy(this->idxm,idxmin,this->m);
-			}
-			if(this->n){
-				this->idxn=xNew<int>(this->n); 
-				xMemCpy(this->idxn,idxnin,this->n);
-			}
-			if(this->m*this->n){
-				this->values=xNew<doubletype>(this->n*this->m);
-				xMemCpy(this->values,valuesin,this->n*this->m);
-			}
-		} /*}}}*/
-		Bucket(int min,int* idxmin,doubletype* valuesin,InsMode modein){ /*{{{*/ 
-			this->Initialize();
-
-			this->type=VECTOR_BUCKET; 
-			this->m=min;
-			this->mode=modein;
-			if(this->m){
-				this->idxm=xNew<int>(this->m); 
-				xMemCpy(this->idxm,idxmin,this->m);
-
+				this->idxm=xNew<int>(this->m);
 				this->values=xNew<doubletype>(this->m);
-				xMemCpy(this->values,valuesin,this->m);
+
+				if(numneg==0){
+					xMemCpy(this->idxm,idxm_in,this->m);
+					xMemCpy(this->values,values_in,this->m);
+				}
+				else{
+					int count = 0;
+					for(int i=0;i<m_in;i++){
+						if(idxm_in[i]>=0){
+							this->idxm[count]   = idxm_in[i];
+							this->values[count] = values_in[i];
+							count++;
+						}
+					}
+				}
 			}
 		} /*}}}*/
@@ -88,5 +129,5 @@
 		/*object virtual functions definitions:*/
 		void    Echo(){ /*{{{*/
-			_printf_("Bucket echo (cpu #: "<<IssmComm::GetRank()<<")\n");
+			_printf_("Bucket echo (cpu #"<<IssmComm::GetRank()<<")\n");
 			_printf_("bucket type: " << type << "\n");
 			_printf_("num rows: "<<this->m<<" num cols: "<<this->n << "\n");
@@ -95,5 +136,5 @@
 			int i,j;
 
-			_printf_("Bucket echo (cpu #: "<<IssmComm::GetRank()<<")\n");
+			_printf_("Bucket echo (cpu #"<<IssmComm::GetRank()<<")\n");
 			_printf_("bucket type: " << type << "\n");
 			_printf_("num rows: "<<this->m<<" num cols: "<<this->n << "\n");
Index: /issm/trunk/src/c/toolkits/issm/IssmAbsVec.h
===================================================================
--- /issm/trunk/src/c/toolkits/issm/IssmAbsVec.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/issm/IssmAbsVec.h	(revision 26744)
@@ -52,4 +52,5 @@
 		virtual void PointwiseMult(IssmAbsVec* x,IssmAbsVec* y)=0;
 		virtual void Pow(doubletype scale_factor)=0;
+		virtual void Sum(doubletype* pvalue)=0;
 };
 
Index: /issm/trunk/src/c/toolkits/issm/IssmDenseMat.h
===================================================================
--- /issm/trunk/src/c/toolkits/issm/IssmDenseMat.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/issm/IssmDenseMat.h	(revision 26744)
@@ -161,4 +161,6 @@
 					break;
 			}
+
+			return 0.;
 		}
 		/*}}}*/
@@ -230,8 +232,20 @@
 			switch(mode){
 				case ADD_VAL:
-					for(i=0;i<m;i++) for(j=0;j<n;j++) this->matrix[N*idxm[i]+idxn[j]]+=values[n*i+j];
+					for(i=0;i<m;i++){
+						if(idxm[i]<0) continue;
+						for(j=0;j<n;j++){
+							if(idxn[j]<0) continue;
+							this->matrix[N*idxm[i]+idxn[j]]+=values[n*i+j];
+						}
+					}
 					break;
 				case INS_VAL:
-					for(i=0;i<m;i++) for(j=0;j<n;j++) this->matrix[N*idxm[i]+idxn[j]]=values[n*i+j];
+					for(i=0;i<m;i++){
+						if(idxm[i]<0) continue;
+						for(j=0;j<n;j++){
+							if(idxn[j]<0) continue;
+							this->matrix[N*idxm[i]+idxn[j]]=values[n*i+j];
+						}
+					}
 					break;
 				default:
Index: /issm/trunk/src/c/toolkits/issm/IssmMpiDenseMat.h
===================================================================
--- /issm/trunk/src/c/toolkits/issm/IssmMpiDenseMat.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/issm/IssmMpiDenseMat.h	(revision 26744)
@@ -339,4 +339,6 @@
 					break;
 			}
+
+			return 0.;
 		}
 		/*}}}*/
Index: /issm/trunk/src/c/toolkits/issm/IssmMpiSparseMat.h
===================================================================
--- /issm/trunk/src/c/toolkits/issm/IssmMpiSparseMat.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/issm/IssmMpiSparseMat.h	(revision 26744)
@@ -90,5 +90,5 @@
 		/*}}}*/
 		void Init(int Min,int Nin){/*{{{*/
-			
+
 			this->buckets=new DataSet();
 
@@ -288,5 +288,5 @@
 				}
 			}
-					
+
 			/*Plug into matrix: */
 			for(int i=0;i<this->m;i++) this->matrix[i]->SetValues(numvalues_perrow[i],cols_perrow[i],values_perrow[i],mods_perrow[i]);
@@ -362,4 +362,6 @@
 					break;
 			}
+
+			return 0.;
 		}
 		/*}}}*/
Index: /issm/trunk/src/c/toolkits/issm/IssmMpiVec.h
===================================================================
--- /issm/trunk/src/c/toolkits/issm/IssmMpiVec.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/issm/IssmMpiVec.h	(revision 26744)
@@ -444,5 +444,4 @@
 			comm=IssmComm::GetComm();
 			num_procs=IssmComm::GetSize();
-
 
 			/*Allocate: */
@@ -528,4 +527,5 @@
 					break;
 			}
+			return 0.;
 		}
 		/*}}}*/
@@ -592,4 +592,8 @@
 			for(i=0;i<this->M;i++)this->vector[i]=pow(this->vector[i],scale_factor);
 
+		}
+		/*}}}*/
+		void Sum(doubletype* pvalue){/*{{{*/
+			_error_("not support yet!");
 		}
 		/*}}}*/
Index: /issm/trunk/src/c/toolkits/issm/IssmSeqVec.h
===================================================================
--- /issm/trunk/src/c/toolkits/issm/IssmSeqVec.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/issm/IssmSeqVec.h	(revision 26744)
@@ -101,8 +101,8 @@
 			switch(mode){
 				case ADD_VAL:
-					for(i=0;i<ssize;i++) this->vector[list[i]]+=values[i];
+					for(i=0;i<ssize;i++) if(list[i]>=0) this->vector[list[i]]+=values[i];
 					break;
 				case INS_VAL:
-					for(i=0;i<ssize;i++) this->vector[list[i]]=values[i];
+					for(i=0;i<ssize;i++) if(list[i]>=0) this->vector[list[i]]=values[i];
 					break;
 				default:
@@ -113,5 +113,7 @@
 		}
 		/*}}}*/
-		void SetValue(int dof, doubletype value, InsMode mode){/*{{{*/
+		void SetValue(int dof, doubletype value,InsMode mode){/*{{{*/
+
+			_assert_(dof>=0);
 
 			switch(mode){
@@ -263,4 +265,6 @@
 					break;
 			}
+
+			return 0.;
 		}
 		/*}}}*/
@@ -324,4 +328,12 @@
 		}
 		/*}}}*/
+		void Sum(doubletype* pvalue){/*{{{*/
+
+			doubletype value=0;
+			int i;
+			for(i=0;i<this->M;i++)value+=this->vector[i];
+			*pvalue=value;
+		}
+		/*}}}*/
 
 };
Index: /issm/trunk/src/c/toolkits/issm/IssmVec.h
===================================================================
--- /issm/trunk/src/c/toolkits/issm/IssmVec.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/issm/IssmVec.h	(revision 26744)
@@ -220,4 +220,8 @@
 		}
 		/*}}}*/
+		void Sum(doubletype*  pvalue){/*{{{*/
+			vector->Sum(pvalue);
+		}
+		/*}}}*/
 };
 
Index: /issm/trunk/src/c/toolkits/issm/SparseRow.h
===================================================================
--- /issm/trunk/src/c/toolkits/issm/SparseRow.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/issm/SparseRow.h	(revision 26744)
@@ -19,5 +19,5 @@
 		int*        indices;
 		doubletype* values;
-		
+
 		/*SparseRow constructors, destructors*/
 		SparseRow(){ /*{{{*/
@@ -28,5 +28,5 @@
 		} /*}}}*/
 		SparseRow(int in_M){/*{{{*/
-			
+
 			M=in_M;
 			ncols=0;
@@ -87,5 +87,5 @@
 			indices=xNew<int>(ncols); _assert_(indices);
 			values=xNewZeroInit<doubletype>(ncols);  _assert_(values);
-			
+
 			count=0;
 			for(i=0;i<numvalues;i++){
@@ -96,5 +96,5 @@
 				}
 			}
-		
+
 			if(count!=ncols)_error_("counter problem during set values operations");
 		} /*}}}*/
@@ -132,5 +132,5 @@
 				mult+=values[i]*X[indices[i]];
 			}
-			
+
 			return mult;
 		}
Index: /issm/trunk/src/c/toolkits/mpi/issmmpi.h
===================================================================
--- /issm/trunk/src/c/toolkits/mpi/issmmpi.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/mpi/issmmpi.h	(revision 26744)
@@ -31,7 +31,19 @@
 			//#define AMPI_ADOUBLE TOOL::MPI_TYPE
 			//
+			//#include <codi/externals/codiMpiTypes.hpp>
+			//using MpiTypes = CoDiMpiTypes<IssmDouble>;
 			/*New implementation*/
+			#if _CODIPACK_MAJOR_==2
+			#include <codi/tools/mpi/codiMpiTypes.hpp>
+			using MpiTypes = codi::CoDiMpiTypes<IssmDouble>;
+
+			#elif _CODIPACK_MAJOR_==1
 			#include <codi/externals/codiMpiTypes.hpp>
 			using MpiTypes = CoDiMpiTypes<IssmDouble>;
+
+			#else
+			#error "_CODIPACK_MAJOR_ not supported"
+			#endif
+
 			extern MpiTypes* mpiTypes;
 			#define AMPI_ADOUBLE mpiTypes->MPI_TYPE
Index: /issm/trunk/src/c/toolkits/mumps/MumpsSolve.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 26743)
+++ /issm/trunk/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 26744)
@@ -485,19 +485,19 @@
 
 #ifdef _HAVE_CODIPACK_
-void MumpsSolve_codi_b(void* tape_in,void* data_in,void* ra) {/*{{{*/
+#if _CODIPACK_MAJOR_==2
+using Tape = typename IssmDouble::Tape;
+using AccessInterface = codi::VectorAccessInterface<typename Tape::Real, typename Tape::Identifier>;
+void MumpsSolve_codi_b(Tape* tape, void* data_in, AccessInterface* ra) {/*{{{*/
 
 	/*recast data_in and tape*/
-  codi::DataStore* data = (codi::DataStore*)data_in;
-  //IssmDouble::TapeType& tape = (IssmDouble::TapeType&)tape_in;
-  IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
-
+  codi::ExternalFunctionUserData* data = (codi::ExternalFunctionUserData*)data_in;
 
   IssmDouble::Real* valueATrans;
-  IssmDouble::GradientData* indexATrans;
+  IssmDouble::Identifier* indexATrans;
   int* irnATrans;
   int* jcnATrans;
-  IssmDouble::GradientData* indexB;
+  IssmDouble::Identifier* indexB;
   IssmDouble::Real* valueX;
-  IssmDouble::GradientData* indexX;
+  IssmDouble::Identifier* indexX;
   int n;
   int nnz;
@@ -518,11 +518,11 @@
 
   // create the adjoint vector for x and reset the adjoint values on the tape
-  IssmDouble::GradientValue* adjX = xNew<IssmDouble::GradientValue>(n);
-  getVectorAdjoint(tape, indexX, adjX, n);
+  IssmDouble::Gradient* adjX = xNew<IssmDouble::Gradient>(n);
+  getVectorAdjoint(*tape, indexX, adjX, n);
 
   MumpsSolve(n, nnz, local_nnz, irnATrans, jcnATrans, valueATrans, adjX, parameters);
   // adjX contains now the solution
 
-  updateVectorAdjoint(tape, indexB, adjX, n);
+  updateVectorAdjoint(*tape, indexB, adjX, n);
 
   // bcast dp_y (the solution of the forward system)
@@ -534,5 +534,5 @@
     // we access the transposed matrix here because we stored the indices in a transposed way
     // -1 is substracted because jcn and irn are stored with fortran indexing
-    updateAdjoint(tape, indexATrans[i], -adjX[jcnATrans[i]-1]*valueX[irnATrans[i]-1]);
+    updateAdjoint(*tape, indexATrans[i], -adjX[jcnATrans[i]-1]*valueX[irnATrans[i]-1]);
   }
 
@@ -540,16 +540,16 @@
 }
 /*}}}*/
-void MumpsSolve_codi_delete(void* tape_in,void* data_in) {/*{{{*/
+void MumpsSolve_codi_delete(Tape* tape,void* data_in) {/*{{{*/
 
 	/*recast data_in*/
-	codi::DataStore* data = (codi::DataStore*)data_in;
+	codi::ExternalFunctionUserData* data = (codi::ExternalFunctionUserData*)data_in;
 
   IssmDouble::Real* valueATrans;
-  IssmDouble::GradientData* indexATrans;
+  IssmDouble::Identifier* indexATrans;
   int* irnATrans;
   int* jcnATrans;
-  IssmDouble::GradientData* indexB;
+  IssmDouble::Identifier* indexB;
   IssmDouble::Real* valueX;
-  IssmDouble::GradientData* indexX;
+  IssmDouble::Identifier* indexX;
   int n;
   int nnz;
@@ -581,13 +581,13 @@
 /*}}}*/
 void MumpsSolve(int n,int nnz,int local_nnz,int* irn_loc,int* jcn_loc,IssmDouble *a_loc,IssmDouble *rhs,Parameters* parameters){/*{{{*/
-  IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
-  codi::DataStore* dataHandler = NULL;
+  IssmDouble::Tape& tape = IssmDouble::getTape();
+  codi::ExternalFunctionUserData* dataHandler = NULL;
 
   if(tape.isActive()) {
-    dataHandler = new codi::DataStore();
+    dataHandler = new codi::ExternalFunctionUserData();
 
     // create the index and double vector for the matrix
     IssmDouble::Real* valueATrans = xNew<IssmDouble::Real>(local_nnz);
-    IssmDouble::GradientData* indexATrans = xNew<IssmDouble::GradientData>(local_nnz);
+    IssmDouble::Identifier* indexATrans = xNew<IssmDouble::Identifier>(local_nnz);
     int* irnATrans = xNew<int>(local_nnz);
     int* jcnATrans = xNew<int>(local_nnz);
@@ -601,5 +601,5 @@
 
     // create the index vector for a (primal values are not needed for a)
-    IssmDouble::GradientData* indexB = xNew<IssmDouble::GradientData>(n);
+    IssmDouble::Identifier* indexB = xNew<IssmDouble::Identifier>(n);
     getVectorGradData(rhs, indexB, n);
 
@@ -626,5 +626,5 @@
   if(tape.isActive()) {
     // create the index vector X and register x as active variables
-    IssmDouble::GradientData* indexX = xNew<IssmDouble::GradientData>(n);
+    IssmDouble::Identifier* indexX = xNew<IssmDouble::Identifier>(n);
     registerVector(rhs, indexX, n);
 
@@ -638,6 +638,5 @@
     dataHandler->addData(parameters); // we assume here that parameters is still intact when the reverse run is called
 
-	 //tape.pushExternalFunction(&MumpsSolve_codi_b, dataHandler, &MumpsSolve_codi_delete);
-    tape.pushExternalFunctionHandle(&MumpsSolve_codi_b,(void*)dataHandler, &MumpsSolve_codi_delete);
+	 tape.pushExternalFunction(codi::ExternalFunction<Tape>::create(&MumpsSolve_codi_b,(void*)dataHandler, &MumpsSolve_codi_delete));
   }
   else{
@@ -649,3 +648,171 @@
 }
 /*}}}*/
-#endif
+#elif _CODIPACK_MAJOR_==1
+void MumpsSolve_codi_b(void* tape_in,void* data_in,void* ra) {/*{{{*/
+
+	/*recast data_in and tape*/
+	codi::DataStore* data = (codi::DataStore*)data_in;
+	//IssmDouble::TapeType& tape = (IssmDouble::TapeType&)tape_in;
+	IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
+
+
+	IssmDouble::Real* valueATrans;
+	IssmDouble::GradientData* indexATrans;
+	int* irnATrans;
+	int* jcnATrans;
+	IssmDouble::GradientData* indexB;
+	IssmDouble::Real* valueX;
+	IssmDouble::GradientData* indexX;
+	int n;
+	int nnz;
+	int local_nnz;
+	Parameters* parameters;
+
+	data->getData(valueATrans);
+	data->getData(indexATrans);
+	data->getData(irnATrans);
+	data->getData(jcnATrans);
+	data->getData(indexB);
+	data->getData(valueX);
+	data->getData(indexX);
+	data->getData(n);
+	data->getData(nnz);
+	data->getData(local_nnz);
+	data->getData(parameters);
+
+	// create the adjoint vector for x and reset the adjoint values on the tape
+	IssmDouble::GradientValue* adjX = xNew<IssmDouble::GradientValue>(n);
+	getVectorAdjoint(tape, indexX, adjX, n);
+
+	MumpsSolve(n, nnz, local_nnz, irnATrans, jcnATrans, valueATrans, adjX, parameters);
+	// adjX contains now the solution
+
+	updateVectorAdjoint(tape, indexB, adjX, n);
+
+	// bcast dp_y (the solution of the forward system)
+	ISSM_MPI_Bcast(valueX,n,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
+	// bcast the adjoint of the right-hand-side, i.e. this solution
+	ISSM_MPI_Bcast(adjX,n,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
+
+	for(int i=0; i<local_nnz; ++i) {
+		// we access the transposed matrix here because we stored the indices in a transposed way
+		// -1 is substracted because jcn and irn are stored with fortran indexing
+		updateAdjoint(tape, indexATrans[i], -adjX[jcnATrans[i]-1]*valueX[irnATrans[i]-1]);
+	}
+
+	xDelete(adjX);
+}
+/*}}}*/
+void MumpsSolve_codi_delete(void* tape_in,void* data_in) {/*{{{*/
+
+	/*recast data_in*/
+	codi::DataStore* data = (codi::DataStore*)data_in;
+
+	IssmDouble::Real* valueATrans;
+	IssmDouble::GradientData* indexATrans;
+	int* irnATrans;
+	int* jcnATrans;
+	IssmDouble::GradientData* indexB;
+	IssmDouble::Real* valueX;
+	IssmDouble::GradientData* indexX;
+	int n;
+	int nnz;
+	int local_nnz;
+	Parameters* parameters;
+
+	data->getData(valueATrans);
+	data->getData(indexATrans);
+	data->getData(irnATrans);
+	data->getData(jcnATrans);
+	data->getData(indexB);
+	data->getData(valueX);
+	data->getData(indexX);
+	data->getData(n);
+	data->getData(nnz);
+	data->getData(local_nnz);
+	data->getData(parameters);
+
+	xDelete(valueATrans);
+	xDelete(indexATrans);
+	xDelete(irnATrans);
+	xDelete(jcnATrans);
+	xDelete(indexB);
+	xDelete(valueX);
+	xDelete(indexX);
+
+	delete data;
+}
+/*}}}*/
+void MumpsSolve(int n,int nnz,int local_nnz,int* irn_loc,int* jcn_loc,IssmDouble *a_loc,IssmDouble *rhs,Parameters* parameters){/*{{{*/
+	IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
+	codi::DataStore* dataHandler = NULL;
+
+	if(tape.isActive()) {
+		dataHandler = new codi::DataStore();
+
+		// create the index and double vector for the matrix
+		IssmDouble::Real* valueATrans = xNew<IssmDouble::Real>(local_nnz);
+		IssmDouble::GradientData* indexATrans = xNew<IssmDouble::GradientData>(local_nnz);
+		int* irnATrans = xNew<int>(local_nnz);
+		int* jcnATrans = xNew<int>(local_nnz);
+
+		// read the data for the matrix A in a transposed fashion
+		for (int i=0; i<local_nnz; ++i) {
+			getPrimalAndGradData(a_loc[i], valueATrans[i], indexATrans[i]);
+			irnATrans[i]=jcn_loc[i];  // transposed store
+			jcnATrans[i]=irn_loc[i];  // transposed store
+		}
+
+		// create the index vector for a (primal values are not needed for a)
+		IssmDouble::GradientData* indexB = xNew<IssmDouble::GradientData>(n);
+		getVectorGradData(rhs, indexB, n);
+
+		dataHandler->addData(valueATrans);
+		dataHandler->addData(indexATrans);
+		dataHandler->addData(irnATrans);
+		dataHandler->addData(jcnATrans);
+		dataHandler->addData(indexB);
+	}
+
+	// unpack the primal values from the matrix and the vector
+	IssmDouble::Real* valueA = xNew<IssmDouble::Real>(local_nnz);
+	IssmDouble::Real* valueB = xNew<IssmDouble::Real>(n);
+	// read the data from A and B
+	getVectorPrimal(a_loc, valueA, local_nnz);
+	getVectorPrimal(rhs, valueB, n);
+
+	MumpsSolve(n, nnz, local_nnz, irn_loc, jcn_loc, valueA, valueB, parameters);
+	// valueB contains now the solution
+
+	// pack the values into rhs
+	setVectorPrimal(rhs, valueB, n);
+
+	if(tape.isActive()) {
+		// create the index vector X and register x as active variables
+		IssmDouble::GradientData* indexX = xNew<IssmDouble::GradientData>(n);
+		registerVector(rhs, indexX, n);
+
+		dataHandler->addData(valueB); // contains the values from x
+		dataHandler->addData(indexX);
+
+		// store other arguments
+		dataHandler->addData(n);
+		dataHandler->addData(nnz);
+		dataHandler->addData(local_nnz);
+		dataHandler->addData(parameters); // we assume here that parameters is still intact when the reverse run is called
+
+		//tape.pushExternalFunction(&MumpsSolve_codi_b, dataHandler, &MumpsSolve_codi_delete);
+		tape.pushExternalFunctionHandle(&MumpsSolve_codi_b,(void*)dataHandler, &MumpsSolve_codi_delete);
+	}
+	else{
+		// if the tape is active valueB is stored in the dataHandler and deleted in the reverse sweep
+		xDelete(valueB);
+	}
+
+	xDelete(valueA);
+}
+/*}}}*/
+#else
+#error "_CODIPACK_MAJOR_ not supported"
+#endif
+#endif
Index: /issm/trunk/src/c/toolkits/objects/Matrix.h
===================================================================
--- /issm/trunk/src/c/toolkits/objects/Matrix.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/objects/Matrix.h	(revision 26744)
@@ -266,5 +266,5 @@
 		}
 		/*}}}*/
-		doubletype* ToSerial(void){/*{{{*/
+		doubletype* ToMPISerial0(void){/*{{{*/
 
 			doubletype* output=NULL;
@@ -272,9 +272,9 @@
 			if(type==PetscMatType){
 				#ifdef _HAVE_PETSC_
-				output=this->pmatrix->ToSerial();
-				#endif
-			}
-			else{
-				output=this->imatrix->ToSerial();
+				output=this->pmatrix->ToMPISerial0();
+				#endif
+			}
+			else{
+				output=this->imatrix->ToMPISerial0();
 			}
 
@@ -282,4 +282,20 @@
 		}
 		/*}}}*/
+		doubletype* ToMPISerial(void){/*{{{*/
+
+			doubletype* output=NULL;
+
+			if(type==PetscMatType){
+				#ifdef _HAVE_PETSC_
+				output=this->pmatrix->ToMPISerial();
+				#endif
+			}
+			else{
+				_error_("not implemented yet!");
+			}
+
+			return output;
+		}
+		/*}}}*/
 		void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){/*{{{*/
 
@@ -307,8 +323,6 @@
 		}
 		/*}}}*/
-		/*
-		* sets all values to 0 but keeps the structure of a sparse matrix
-		*/
 		void SetZero(void) {/*{{{*/
+			// sets all values to 0 but keeps the structure of a sparse matrix
 			if(type==PetscMatType){
 				#ifdef _HAVE_PETSC_
Index: /issm/trunk/src/c/toolkits/objects/Vector.h
===================================================================
--- /issm/trunk/src/c/toolkits/objects/Vector.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/objects/Vector.h	(revision 26744)
@@ -406,4 +406,15 @@
 		}
 		/*}}}*/
-};
+void Sum(doubletype* pvalue){ /*{{{*/
+	_assert_(this);/*{{{*/
+
+	if(type==PetscVecType){
+		#ifdef _HAVE_PETSC_
+		this->pvector->Sum(pvalue);
+		#endif
+	}
+	else this->ivector->Sum(pvalue);
+}
+/*}}}*/
+}; /*}}}*/
 #endif //#ifndef _VECTOR_H_
Index: /issm/trunk/src/c/toolkits/petsc/objects/PetscMat.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 26743)
+++ /issm/trunk/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 26744)
@@ -171,9 +171,16 @@
 }
 /*}}}*/
-IssmDouble* PetscMat::ToSerial(void){/*{{{*/
+IssmDouble* PetscMat::ToMPISerial(void){/*{{{*/
 
 	 IssmDouble* output=NULL;
-
-	 MatToSerial(&output,this->matrix,IssmComm::GetComm());
+	 MatToMPISerial(&output,this->matrix,IssmComm::GetComm(),true);
+	 return output;
+
+}
+/*}}}*/
+IssmDouble* PetscMat::ToMPISerial0(void){/*{{{*/
+
+	 IssmDouble* output=NULL;
+	 MatToMPISerial(&output,this->matrix,IssmComm::GetComm(),false);
 	 return output;
 
Index: /issm/trunk/src/c/toolkits/petsc/objects/PetscMat.h
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/objects/PetscMat.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/petsc/objects/PetscMat.h	(revision 26744)
@@ -49,5 +49,6 @@
 		void MatMult(PetscVec* X,PetscVec* AX);
 		PetscMat* Duplicate(void);
-		IssmDouble* ToSerial(void);
+		IssmDouble* ToMPISerial(void);
+		IssmDouble* ToMPISerial0(void);
 		void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode);
 		void Convert(MatrixType type);
Index: /issm/trunk/src/c/toolkits/petsc/objects/PetscVec.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 26743)
+++ /issm/trunk/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 26744)
@@ -37,4 +37,5 @@
 	VecSetSizes(this->vector,m,M);
 	VecSetFromOptions(this->vector);
+	VecSetOption(this->vector,VEC_IGNORE_NEGATIVE_INDICES,PETSC_TRUE);
 	VecSet(this->vector,0.0);
 
@@ -249,4 +250,11 @@
 }
 /*}}}*/
+void PetscVec::Sum(IssmDouble* pvalue){/*{{{*/
+
+	_assert_(this->vector);
+	VecSum(this->vector,pvalue);
+
+}
+/*}}}*/
 IssmDouble PetscVec::Dot(PetscVec* input){/*{{{*/
 
Index: /issm/trunk/src/c/toolkits/petsc/objects/PetscVec.h
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/objects/PetscVec.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/petsc/objects/PetscVec.h	(revision 26744)
@@ -58,4 +58,5 @@
 		void        Scale(IssmDouble scale_factor);
 		void        Pow(IssmDouble scale_factor);
+		void        Sum(IssmDouble* pvalue);
 		void        PointwiseDivide(PetscVec* x,PetscVec* y);
 		void        PointwiseMult(PetscVec* x,PetscVec* y);
Index: /issm/trunk/src/c/toolkits/petsc/patches/MatToMPISerial.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/MatToMPISerial.cpp	(revision 26744)
+++ /issm/trunk/src/c/toolkits/petsc/patches/MatToMPISerial.cpp	(revision 26744)
@@ -0,0 +1,96 @@
+/*!\file MatToMPISerial.cpp
+ * \brief gather a Petsc Mat matrix onto all cpus
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "../petscincludes.h"
+#include "../../../shared/shared.h"
+
+void MatToMPISerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm,bool broadcast){
+
+	int i;
+	int my_rank;
+	int num_procs;
+
+	/*Petsc variables*/
+	PetscInt lower_row,upper_row; 
+	int range;
+	int M,N; //size of matrix
+	ISSM_MPI_Status status;
+	int* idxm=NULL;
+	int* idxn=NULL; 
+	double* local_matrix=NULL; /*matrix local to each node used for temporary holding matrix values*/
+	int buffer[3];
+
+	/*recover my_rank and num_procs:*/
+	ISSM_MPI_Comm_size(comm,&num_procs);
+	ISSM_MPI_Comm_rank(comm,&my_rank);
+
+	/*Output*/
+	double* outmatrix=NULL;
+
+	/*get matrix size: */
+	MatGetSize(matrix,&M,&N);
+
+	/*partition: */
+	MatGetOwnershipRange(matrix,&lower_row,&upper_row);    
+	upper_row--; 
+	range=upper_row-lower_row+1;
+
+	/*Local and global allocation*/
+	if(broadcast || my_rank==0){ 
+		outmatrix=xNew<double>(M*N);
+	}
+
+	if (range){
+		local_matrix=xNew<double>(N*range);
+		idxm=xNew<int>(range);  
+		idxn=xNew<int>(N);  
+
+		for (i=0;i<N;i++){
+			*(idxn+i)=i;
+		}
+		for (i=0;i<range;i++){
+			*(idxm+i)=lower_row+i;
+		}
+
+		MatGetValues(matrix,range,idxm,N,idxn,local_matrix);     
+	}
+
+	/*Now each node holds its local_matrix containing range rows. 
+	 * We send these rows to the matrix on node 0*/
+
+	for (i=1;i<num_procs;i++){
+		if (my_rank==i){ 
+			buffer[0]=my_rank;
+			buffer[1]=lower_row;
+			buffer[2]=range;
+			ISSM_MPI_Send(buffer,3,ISSM_MPI_INT,0,1,comm);   
+			if (range)ISSM_MPI_Send(local_matrix,N*range,ISSM_MPI_PDOUBLE,0,1,comm); 
+		}
+		if (my_rank==0){
+			ISSM_MPI_Recv(buffer,3,ISSM_MPI_INT,i,1,comm,&status); 
+			if (buffer[2])ISSM_MPI_Recv(outmatrix+(buffer[1]*N),N*buffer[2],ISSM_MPI_PDOUBLE,i,1,comm,&status);
+		}
+	} 
+	if (my_rank==0){ 
+		//Still have the local_matrix on node 0 to take care of.
+		if (range) memcpy(outmatrix,local_matrix,N*range*sizeof(double));
+	} 
+
+	if(broadcast){
+		/*Broadcast:*/
+		ISSM_MPI_Bcast(outmatrix,M*N,ISSM_MPI_PDOUBLE,0,comm);
+	}
+
+	/*Assign output pointer: */
+	xDelete<int>(idxm);
+	xDelete<int>(idxn);
+	xDelete<double>(local_matrix);
+	*poutmatrix=outmatrix;
+}
Index: sm/trunk/src/c/toolkits/petsc/patches/MatToSerial.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/MatToSerial.cpp	(revision 26743)
+++ 	(revision )
@@ -1,89 +1,0 @@
-/*!\file MatToSerial.cpp
- * \brief gather a Petsc Mat matrix onto cpu 0
- */
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "../petscincludes.h"
-#include "../../../shared/shared.h"
-
-void MatToSerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm){
-
-	int i;
-	int my_rank;
-	int num_procs;
-
-	/*Petsc variables*/
-	PetscInt lower_row,upper_row; 
-	int range;
-	int M,N; //size of matrix
-	ISSM_MPI_Status status;
-	int* idxm=NULL;
-	int* idxn=NULL; 
-	double* local_matrix=NULL; /*matrix local to each node used for temporary holding matrix values*/
-	int buffer[3];
-
-	/*recover my_rank and num_procs:*/
-	ISSM_MPI_Comm_size(comm,&num_procs);
-	ISSM_MPI_Comm_rank(comm,&my_rank);
-
-	/*Output*/
-	double* outmatrix=NULL;
-
-	/*get matrix size: */
-	MatGetSize(matrix,&M,&N);
-
-	/*partition: */
-	MatGetOwnershipRange(matrix,&lower_row,&upper_row);    
-	upper_row--; 
-	range=upper_row-lower_row+1;
-
-	/*Local and global allocation*/
-	if (my_rank==0)outmatrix=xNew<double>(M*N);
-
-	if (range){
-		local_matrix=xNew<double>(N*range);
-		idxm=xNew<int>(range);  
-		idxn=xNew<int>(N);  
-
-		for (i=0;i<N;i++){
-			*(idxn+i)=i;
-		}
-		for (i=0;i<range;i++){
-			*(idxm+i)=lower_row+i;
-		}
-
-		MatGetValues(matrix,range,idxm,N,idxn,local_matrix);     
-	}
-
-	/*Now each node holds its local_matrix containing range rows. 
-	 * We send these rows to the matrix on node 0*/
-
-	for (i=1;i<num_procs;i++){
-		if (my_rank==i){ 
-			buffer[0]=my_rank;
-			buffer[1]=lower_row;
-			buffer[2]=range;
-			ISSM_MPI_Send(buffer,3,ISSM_MPI_INT,0,1,comm);   
-			if (range)ISSM_MPI_Send(local_matrix,N*range,ISSM_MPI_PDOUBLE,0,1,comm); 
-		}
-		if (my_rank==0){
-			ISSM_MPI_Recv(buffer,3,ISSM_MPI_INT,i,1,comm,&status); 
-			if (buffer[2])ISSM_MPI_Recv(outmatrix+(buffer[1]*N),N*buffer[2],ISSM_MPI_PDOUBLE,i,1,comm,&status);
-		}
-	} 
-	if (my_rank==0){ 
-		//Still have the local_matrix on node 0 to take care of.
-		memcpy(outmatrix,local_matrix,N*range*sizeof(double));
-	} 
-
-	/*Assign output pointer: */
-	*poutmatrix=outmatrix;
-	xDelete<int>(idxm);
-	xDelete<int>(idxn);
-	xDelete<double>(local_matrix);
-}
Index: /issm/trunk/src/c/toolkits/petsc/patches/NewMat.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/NewMat.cpp	(revision 26743)
+++ /issm/trunk/src/c/toolkits/petsc/patches/NewMat.cpp	(revision 26744)
@@ -111,4 +111,5 @@
 	MatSetSizes(outmatrix,m,n,M,N);
 	MatSetFromOptions(outmatrix);
+	MatSetOption(outmatrix,MAT_IGNORE_ZERO_ENTRIES,PETSC_TRUE);
 
 	/*preallocation  according to type: */
Index: /issm/trunk/src/c/toolkits/petsc/patches/NewVec.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/NewVec.cpp	(revision 26743)
+++ /issm/trunk/src/c/toolkits/petsc/patches/NewVec.cpp	(revision 26744)
@@ -35,4 +35,5 @@
 	VecSetSizes(vector,local_size,PETSC_DECIDE); 
 	VecSetFromOptions(vector); 
+	VecSetOption(vector,VEC_IGNORE_NEGATIVE_INDICES,PETSC_TRUE);
 
 	return vector;
Index: /issm/trunk/src/c/toolkits/petsc/patches/VecToMPISerial.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/VecToMPISerial.cpp	(revision 26743)
+++ /issm/trunk/src/c/toolkits/petsc/patches/VecToMPISerial.cpp	(revision 26744)
@@ -82,5 +82,5 @@
 	if (my_rank==0){ 
 		//Still have the local_vector on node 0 to take care of.
-		if (range)memcpy(gathered_vector+lower_row,local_vector,range*sizeof(double));
+		if (range) memcpy(gathered_vector+lower_row,local_vector,range*sizeof(double));
 	}
 
Index: /issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h	(revision 26743)
+++ /issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h	(revision 26744)
@@ -27,9 +27,8 @@
 void VecFree(Vec* pvec);
 void KSPFree(KSP* pksp);
-int MatPartition(Mat* poutmatrix,Mat matrixA,double* row_partition_vector,int row_partition_vector_size ,
-		double* col_partition_vector,int col_partition_vector_size);
+int MatPartition(Mat* poutmatrix,Mat matrixA,double* row_partition_vector,int row_partition_vector_size, double* col_partition_vector,int col_partition_vector_size);
 void PetscOptionsDetermineSolverType(int* psolver_type);
 void MatMultPatch(Mat A,Vec X, Vec AX,ISSM_MPI_Comm comm);
-void MatToSerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm);
+void MatToMPISerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm,bool broadcast=true);
 Vec  SerialToVec(double* vector,int vector_size);
 InsertMode ISSMToPetscInsertMode(InsMode mode);
Index: /issm/trunk/src/jl/core/analyses/analysis.jl
===================================================================
--- /issm/trunk/src/jl/core/analyses/analysis.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/analyses/analysis.jl	(revision 26744)
@@ -0,0 +1,2 @@
+#Analysis class definitions
+abstract type Analysis end
Index: /issm/trunk/src/jl/core/analyses/masstransportanalysis.jl
===================================================================
--- /issm/trunk/src/jl/core/analyses/masstransportanalysis.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/analyses/masstransportanalysis.jl	(revision 26744)
@@ -0,0 +1,275 @@
+#MasstransportAnalysis class definition
+struct MasstransportAnalysis <: Analysis#{{{
+end #}}}
+
+#Model Processing
+function CreateConstraints(analysis::MasstransportAnalysis,constraints::Vector{Constraint},md::model) #{{{
+
+	#load constraints from model
+	spcthickness = md.masstransport.spcthickness
+
+	count = 1
+	for i in 1:md.mesh.numberofvertices
+		if ~isnan(spcthickness[i])
+			push!(constraints,Constraint(count,i,1,spcthickness[i]))
+			count+=1
+		end
+	end
+
+end#}}}
+function CreateNodes(analysis::MasstransportAnalysis,nodes::Vector{Node},md::model) #{{{
+
+	numdof = 1
+	for i in 1:md.mesh.numberofvertices
+		push!(nodes,Node(i,i,true,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
+	end
+end#}}}
+function UpdateElements(analysis::MasstransportAnalysis,elements::Vector{Tria}, inputs::Inputs, md::model) #{{{
+
+	#Provide node indices to element
+	for i in 1:md.mesh.numberofelements
+		Update(elements[i],inputs,i,md,P1Enum)
+	end
+
+	#Add necessary inputs to perform this analysis
+	FetchDataToInput(md,inputs,elements,md.geometry.thickness,ThicknessEnum)
+	FetchDataToInput(md,inputs,elements,md.geometry.surface,SurfaceEnum)
+	FetchDataToInput(md,inputs,elements,md.geometry.base,BaseEnum)
+	FetchDataToInput(md,inputs,elements,md.geometry.bed,BedEnum)
+	FetchDataToInput(md,inputs,elements,md.basalforcings.groundedice_melting_rate./md.constants.yts,BasalforcingsGroundediceMeltingRateEnum)
+	FetchDataToInput(md,inputs,elements,md.basalforcings.floatingice_melting_rate./md.constants.yts,BasalforcingsFloatingiceMeltingRateEnum)
+	FetchDataToInput(md,inputs,elements,md.smb.mass_balance./md.constants.yts,SmbMassBalanceEnum)
+	FetchDataToInput(md,inputs,elements,md.mask.ice_levelset, MaskIceLevelsetEnum)
+	FetchDataToInput(md,inputs,elements,md.mask.ocean_levelset, MaskOceanLevelsetEnum)
+	FetchDataToInput(md,inputs,elements,md.initialization.vx./md.constants.yts,VxEnum)
+	FetchDataToInput(md,inputs,elements,md.initialization.vy./md.constants.yts,VyEnum)
+
+end#}}}
+function UpdateParameters(analysis::MasstransportAnalysis,parameters::Parameters,md::model) #{{{
+
+	AddParam(parameters, md.masstransport.min_thickness, MasstransportMinThicknessEnum)
+	AddParam(parameters, md.masstransport.stabilization, MasstransportStabilizationEnum)
+
+end#}}}
+
+#Finite Element Analysis
+function Core(analysis::MasstransportAnalysis,femmodel::FemModel)# {{{
+
+	println("   computing mass transport")
+	SetCurrentConfiguration!(femmodel, analysis)
+
+	InputDuplicatex(femmodel, ThicknessEnum, ThicknessOldEnum)
+	InputDuplicatex(femmodel, BaseEnum, BaseOldEnum)
+	InputDuplicatex(femmodel, SurfaceEnum, SurfaceOldEnum)
+
+	solutionsequence_linear(femmodel,analysis)
+
+	#Save output
+	RequestedOutputsx(femmodel, [ThicknessEnum, SurfaceEnum, BaseEnum])
+
+end #}}}
+function CreateKMatrix(analysis::MasstransportAnalysis,element::Tria)# {{{
+
+	#Return if there is no ice in this element
+	if(!IsIceInElement(element)) return end
+
+	#Internmediaries
+	numnodes = 3
+	
+	#Initialize Element matrix and basis function derivatives
+	Ke = ElementMatrix(element.nodes)
+	dbasis = Matrix{Float64}(undef,numnodes,2)
+	basis  = Vector{Float64}(undef,numnodes)
+
+	#Retrieve all inputs and parameters
+	xyz_list = GetVerticesCoordinates(element.vertices)
+	vx_input      = GetInput(element, VxEnum)
+	vy_input      = GetInput(element, VyEnum)
+	dt            = FindParam(element, TimesteppingTimeStepEnum)
+	stabilization = FindParam(element, MasstransportStabilizationEnum)
+
+	h = CharacteristicLength(element)
+
+	#Start integrating
+	gauss = GaussTria(2)
+	for ig in 1:gauss.numgauss
+
+		Jdet = JacobianDeterminant(xyz_list, gauss)
+		NodalFunctionsDerivatives(element, dbasis, xyz_list, gauss)
+		NodalFunctions(element, basis, gauss, ig, P1Enum)
+
+      #Transient term
+		for i in 1:numnodes
+			for j in 1:numnodes
+				Ke.values[i ,j] += gauss.weights[ig]*Jdet*basis[i]*basis[j]
+			end
+		end
+
+      #Advection term
+		vx  = GetInputValue(vx_input, gauss, ig)
+      vy  = GetInputValue(vy_input, gauss, ig)
+		dvx = GetInputDerivativeValue(vx_input, xyz_list, gauss, ig)
+      dvy = GetInputDerivativeValue(vy_input, xyz_list, gauss, ig)
+      for i in 1:numnodes
+         for j in 1:numnodes
+            #\phi_i \phi_j \nabla\cdot v
+            Ke.values[i ,j] += dt*gauss.weights[ig]*Jdet*basis[i]*basis[j]*(dvx[1] + dvy[2])
+            #\phi_i v\cdot\nabla\phi_j
+            Ke.values[i ,j] += dt*gauss.weights[ig]*Jdet*basis[i]*(vx*dbasis[j,1] + vy*dbasis[j,2])
+         end
+      end
+
+		#Stabilization
+		if(stabilization==0)
+			#do nothing
+		elseif (stabilization==1)
+			vx = GetInputAverageValue(vx_input)
+			vy = GetInputAverageValue(vy_input)
+			D  = dt*gauss.weights[ig]*Jdet*[h/2*abs(vx) 0; 0 h/2*abs(vy)]
+			for i in 1:numnodes; for j in 1:numnodes
+					Ke.values[i ,j] += (dbasis[i,1]*(D[1,1]*dbasis[j,1] + D[1,2]*dbasis[j,2]) +
+											  dbasis[i,2]*(D[2,1]*dbasis[j,1] + D[2,2]*dbasis[j,2]))
+			end end
+		else
+			error("Stabilization ",stabilization, " not supported yet")
+		end
+	end
+
+	return Ke
+end #}}}
+function CreatePVector(analysis::MasstransportAnalysis,element::Tria)# {{{
+
+	#Return if there is no ice in this element
+	if(!IsIceInElement(element)) return end
+
+	#Internmediaries
+	numnodes = 3
+
+	#Initialize Element vectro and basis functions
+	pe = ElementVector(element.nodes)
+	basis = Vector{Float64}(undef,numnodes)
+
+	#Retrieve all inputs and parameters
+	xyz_list = GetVerticesCoordinates(element.vertices)
+	H_input         = GetInput(element, ThicknessEnum)
+	gmb_input       = GetInput(element, BasalforcingsGroundediceMeltingRateEnum)
+	fmb_input       = GetInput(element, BasalforcingsFloatingiceMeltingRateEnum)
+   smb_input       = GetInput(element, SmbMassBalanceEnum)
+	olevelset_input = GetInput(element, MaskOceanLevelsetEnum)
+	dt            = FindParam(element, TimesteppingTimeStepEnum)
+	stabilization = FindParam(element, MasstransportStabilizationEnum)
+
+   #How much is actually grounded?
+	phi=GetGroundedPortion(element, xyz_list)
+
+	#Start integrating
+	gauss = GaussTria(3)
+	for ig in 1:gauss.numgauss
+
+		Jdet = JacobianDeterminant(xyz_list, gauss)
+		NodalFunctions(element, basis, gauss, ig, P1Enum)
+
+		smb = GetInputValue(smb_input, gauss, ig)
+      H   = GetInputValue(H_input, gauss, ig)
+
+      #Only apply melt on fully floating cells
+      if(phi<0.00000001)
+         mb = GetInputValue(fmb_input, gauss, ig)
+      else
+         mb = GetInputValue(gmb_input, gauss, ig)
+      end
+
+		for i in 1:numnodes
+         pe.values[i] += gauss.weights[ig]*Jdet*(H + dt*(smb - mb))*basis[i]
+		end
+	end
+
+	return pe
+end #}}}
+function GetSolutionFromInputs(analysis::MasstransportAnalysis,ug::IssmVector,element::Tria) #{{{
+
+	#Get dofs for this finite element
+	doflist = GetDofList(element,GsetEnum)
+	@assert length(doflist)==3
+
+	#Fetch inputs
+	thickness_input = GetInput(element, ThicknessEnum)
+
+	#Loop over each node and enter solution in ug
+	count = 0
+	gauss=GaussTria(P1Enum)
+	for i in 1:gauss.numgauss
+		thickness = GetInputValue(thickness_input, gauss, i)
+
+		count += 1
+		ug.vector[doflist[count]] = thickness
+	end
+
+	#Make sure we reached all the values
+	@assert count==length(doflist)
+
+end#}}}
+function InputUpdateFromSolution(analysis::MasstransportAnalysis,ug::Vector{Float64},element::Tria) #{{{
+
+	#Get dofs for this finite element
+	doflist = GetDofList(element,GsetEnum)
+
+	#Get solution vector for this element
+	numdof   = 3
+	values = Vector{Float64}(undef,numdof)
+	for i in 1:numdof values[i]=ug[doflist[i]] end
+
+	#Get some parameters
+	rho_water = FindParam(element, MaterialsRhoSeawaterEnum)
+	rho_ice   = FindParam(element, MaterialsRhoIceEnum)
+	H_min     = FindParam(element, MasstransportMinThicknessEnum)
+
+	#Now split solution vector into x and y components
+	numnodes = 3
+	thickness  = Vector{Float64}(undef,numnodes)
+	for i in 1:numnodes 
+		thickness[i]=values[i] 
+		@assert isfinite(thickness[i])
+
+		#Enforce minimum thickness
+		if(thickness[i]<H_min)
+			thickness[i] = H_min
+		end
+	end
+	AddInput(element, ThicknessEnum,  thickness,  P1Enum)
+
+	#Update bed and surface accordingly
+	newthickness = Vector{Float64}(undef,3)
+	oldthickness = Vector{Float64}(undef,3)
+	oldbase      = Vector{Float64}(undef,3)
+	oldsurface   = Vector{Float64}(undef,3)
+	phi          = Vector{Float64}(undef,3)
+	bed          = Vector{Float64}(undef,3)
+	GetInputListOnVertices!(element, newthickness, ThicknessEnum)
+   GetInputListOnVertices!(element, oldthickness, ThicknessOldEnum)
+   GetInputListOnVertices!(element, oldbase, BaseOldEnum)
+   GetInputListOnVertices!(element, oldsurface, SurfaceOldEnum)
+   GetInputListOnVertices!(element, phi, MaskOceanLevelsetEnum)
+	GetInputListOnVertices!(element, bed, BedEnum)
+   sealevel = zeros(3)
+	newsurface = Vector{Float64}(undef,3)
+	newbase    = Vector{Float64}(undef,3)
+
+   for i in 1:3
+      if(phi[i]>0.)
+         #this is grounded ice: just add thickness to base.
+         newsurface[i] = bed[i]+newthickness[i] #surface = bed + newthickness
+         newbase[i]    = bed[i]                 #new base at new bed
+      else
+         #this is an ice shelf: hydrostatic equilibrium
+         newsurface[i] = newthickness[i]*(1-rho_ice/rho_water) + sealevel[i]
+         newbase[i]    = newthickness[i]*(-rho_ice/rho_water)  + sealevel[i]
+      end
+   end
+
+	AddInput(element, SurfaceEnum, newsurface, P1Enum)
+	AddInput(element, BaseEnum,    newbase,    P1Enum)
+end#}}}
+function UpdateConstraints(analysis::MasstransportAnalysis, femmodel::FemModel) #{{{
+	SetActiveNodesLSMx(femmodel)
+end#}}}
Index: /issm/trunk/src/jl/core/analyses/stressbalanceanalysis.jl
===================================================================
--- /issm/trunk/src/jl/core/analyses/stressbalanceanalysis.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/analyses/stressbalanceanalysis.jl	(revision 26744)
@@ -0,0 +1,279 @@
+#StressbalanceAnalysis class definition
+struct StressbalanceAnalysis <: Analysis#{{{
+end #}}}
+
+#Model Processing
+function CreateConstraints(analysis::StressbalanceAnalysis,constraints::Vector{Constraint},md::model) #{{{
+
+	#load constraints from model
+	spcvx = md.stressbalance.spcvx
+	spcvy = md.stressbalance.spcvy
+
+	count = 1
+	for i in 1:md.mesh.numberofvertices
+		if ~isnan(spcvx[i])
+			push!(constraints,Constraint(count,i,1,spcvx[i]/md.constants.yts))
+			count+=1
+		end
+		if ~isnan(spcvy[i])
+			push!(constraints,Constraint(count,i,2,spcvy[i]/md.constants.yts))
+			count+=1
+		end
+	end
+
+end#}}}
+function CreateNodes(analysis::StressbalanceAnalysis,nodes::Vector{Node},md::model) #{{{
+
+	numdof = 2
+	for i in 1:md.mesh.numberofvertices
+		push!(nodes,Node(i,i,true,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
+	end
+end#}}}
+function UpdateElements(analysis::StressbalanceAnalysis,elements::Vector{Tria}, inputs::Inputs, md::model) #{{{
+
+	#Provide node indices to element
+	for i in 1:md.mesh.numberofelements
+		Update(elements[i],inputs,i,md,P1Enum)
+	end
+
+	#Add necessary inputs to perform this analysis
+	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
+	FetchDataToInput(md,inputs,elements,md.geometry.thickness,ThicknessEnum)
+	FetchDataToInput(md,inputs,elements,md.geometry.surface,SurfaceEnum)
+	FetchDataToInput(md,inputs,elements,md.geometry.base,BaseEnum)
+	FetchDataToInput(md,inputs,elements,md.initialization.vx./md.constants.yts,VxEnum)
+	FetchDataToInput(md,inputs,elements,md.initialization.vy./md.constants.yts,VyEnum)
+	FetchDataToInput(md,inputs,elements,md.mask.ice_levelset, MaskIceLevelsetEnum)
+	FetchDataToInput(md,inputs,elements,md.mask.ocean_levelset, MaskOceanLevelsetEnum)
+
+	#Deal with friction
+	if typeof(md.friction)==BuddFriction
+		FetchDataToInput(md,inputs,elements,md.friction.coefficient,FrictionCoefficientEnum)
+	else
+		error("Friction ", typeof(md.friction), " not supported yet")
+	end
+
+end#}}}
+function UpdateParameters(analysis::StressbalanceAnalysis,parameters::Parameters,md::model) #{{{
+	AddParam(parameters,md.stressbalance.restol,StressbalanceRestolEnum)
+	AddParam(parameters,md.stressbalance.reltol,StressbalanceReltolEnum)
+	AddParam(parameters,md.stressbalance.abstol,StressbalanceAbstolEnum)
+	AddParam(parameters,md.stressbalance.maxiter,StressbalanceMaxiterEnum)
+
+	#Deal with friction
+	if typeof(md.friction)==BuddFriction
+		AddParam(parameters, 1, FrictionLawEnum)
+	else
+		error("Friction ", typeof(md.friction), " not supported yet")
+	end
+end#}}}
+
+#Finite Element Analysis
+function Core(analysis::StressbalanceAnalysis,femmodel::FemModel)# {{{
+
+	#Set current analysis to Stressnalance
+	SetCurrentConfiguration!(femmodel, analysis)
+
+	#Fetch parameters relevant to solution sequence
+	maxiter = FindParam(femmodel.parameters,StressbalanceMaxiterEnum)
+	restol  = FindParam(femmodel.parameters,StressbalanceRestolEnum)
+	reltol  = FindParam(femmodel.parameters,StressbalanceReltolEnum)
+	abstol  = FindParam(femmodel.parameters,StressbalanceAbstolEnum)
+
+	#Call solution sequence to compute new speeds
+	println("   computing stress balance");
+	solutionsequence_nonlinear(femmodel,analysis,maxiter,restol,reltol,abstol)
+
+	#Save output
+	RequestedOutputsx(femmodel, [VxEnum,VyEnum,VelEnum])
+
+end #}}}
+function CreateKMatrix(analysis::StressbalanceAnalysis,element::Tria)# {{{
+
+	if(!IsIceInElement(element)) return end
+
+	#Internmediaries
+	numnodes = 3
+	
+	#Initialize Element matrix and basis function derivatives
+	Ke = ElementMatrix(element.nodes)
+	dbasis = Matrix{Float64}(undef,numnodes,2)
+
+	#Retrieve all inputs and parameters
+	xyz_list = GetVerticesCoordinates(element.vertices)
+	H_input  = GetInput(element, ThicknessEnum)
+
+	#Prepare material object
+	material = Matice(element)
+	
+	#Start integrating
+	gauss = GaussTria(2)
+	for ig in 1:gauss.numgauss
+
+		Jdet = JacobianDeterminant(xyz_list, gauss)
+		NodalFunctionsDerivatives(element,dbasis,xyz_list,gauss)
+
+		H  = GetInputValue(H_input, gauss, ig)
+		mu = ViscositySSA(material, xyz_list, gauss, ig)
+
+		for i in 1:numnodes
+			for j in 1:numnodes
+				Ke.values[2*i-1,2*j-1] += gauss.weights[ig]*Jdet*mu*H*(4*dbasis[j,1]*dbasis[i,1] + dbasis[j,2]*dbasis[i,2])
+				Ke.values[2*i-1,2*j  ] += gauss.weights[ig]*Jdet*mu*H*(2*dbasis[j,2]*dbasis[i,1] + dbasis[j,1]*dbasis[i,2])
+				Ke.values[2*i  ,2*j-1] += gauss.weights[ig]*Jdet*mu*H*(2*dbasis[j,1]*dbasis[i,2] + dbasis[j,2]*dbasis[i,1])
+				Ke.values[2*i  ,2*j  ] += gauss.weights[ig]*Jdet*mu*H*(4*dbasis[j,2]*dbasis[i,2] + dbasis[j,1]*dbasis[i,1])
+			end
+		end
+	end
+
+	#Add basal friction
+	phi=GetGroundedPortion(element, xyz_list)
+
+	if(phi>0)
+		basis = Vector{Float64}(undef,numnodes)
+		friction = CoreFriction(element)
+
+		#Start integrating
+		gauss = GaussTria(2)
+		for ig in 1:gauss.numgauss
+
+			Jdet = JacobianDeterminant(xyz_list, gauss)
+			NodalFunctions(element, basis, gauss, ig, P1Enum)
+
+			alpha2 = Alpha2(friction, gauss, ig)
+
+			for i in 1:numnodes
+				for j in 1:numnodes
+					Ke.values[2*i-1,2*j-1] += gauss.weights[ig]*Jdet*phi*alpha2*basis[i]*basis[j]
+					Ke.values[2*i  ,2*j  ] += gauss.weights[ig]*Jdet*phi*alpha2*basis[i]*basis[j]
+				end
+			end
+		end
+	end
+
+	return Ke
+end #}}}
+function CreatePVector(analysis::StressbalanceAnalysis,element::Tria)# {{{
+
+	if(!IsIceInElement(element)) return end
+
+	#Internmediaries
+	numnodes = 3
+
+	#Initialize Element vectro and basis functions
+	pe = ElementVector(element.nodes)
+	basis = Vector{Float64}(undef,numnodes)
+
+	#Retrieve all inputs and parameters
+	xyz_list = GetVerticesCoordinates(element.vertices)
+	H_input  = GetInput(element, ThicknessEnum)
+	s_input  = GetInput(element, SurfaceEnum)
+	rho_ice  = FindParam(element, MaterialsRhoIceEnum)
+	g        = FindParam(element, ConstantsGEnum)
+
+	#Start integrating
+	gauss = GaussTria(2)
+	for ig in 1:gauss.numgauss
+
+		Jdet = JacobianDeterminant(xyz_list, gauss)
+		NodalFunctions(element, basis, gauss, ig, P1Enum)
+
+		H  = GetInputValue(H_input, gauss, ig)
+		ds = GetInputDerivativeValue(s_input, xyz_list, gauss, ig)
+
+		for i in 1:numnodes
+			pe.values[2*i-1] += -gauss.weights[ig]*Jdet*rho_ice*g*H*ds[1]*basis[i]
+			pe.values[2*i  ] += -gauss.weights[ig]*Jdet*rho_ice*g*H*ds[2]*basis[i]
+		end
+	end
+
+	if(IsIcefront(element))
+
+		#Get additional parameters and inputs
+		b_input   = GetInput(element, BaseEnum)
+		rho_water = FindParam(element, MaterialsRhoSeawaterEnum)
+
+		#Get normal and ice front coordinates
+		xyz_list_front = Matrix{Float64}(undef,2,3)
+		GetIcefrontCoordinates!(element, xyz_list_front, xyz_list, MaskIceLevelsetEnum)
+		nx, ny = NormalSection(element, xyz_list_front)
+
+		gauss = GaussTria(element, xyz_list, xyz_list_front, 3)
+		for ig in 1:gauss.numgauss
+
+			Jdet = JacobianDeterminantSurface(xyz_list_front, gauss)
+			NodalFunctions(element, basis, gauss, ig, P1Enum)
+
+			H  = GetInputValue(H_input, gauss, ig)
+			b  = GetInputValue(b_input, gauss, ig)
+			sl = 0
+
+			term = 0.5*g*rho_ice*H^2 + 0.5*g*rho_water*(min(0, H+b-sl)^2 - min(0, b-sl)^2)
+
+			for i in 1:numnodes
+				pe.values[2*i-1] += gauss.weights[ig]*Jdet*term*nx*basis[i]
+				pe.values[2*i  ] += gauss.weights[ig]*Jdet*term*ny*basis[i]
+			end
+		end
+	end
+
+	return pe
+end #}}}
+function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::IssmVector,element::Tria) #{{{
+
+	#Get dofs for this finite element
+	doflist = GetDofList(element,GsetEnum)
+	@assert length(doflist)==6
+
+	#Fetch inputs
+	vx_input = GetInput(element, VxEnum)
+	vy_input = GetInput(element, VyEnum)
+
+	#Loop over each node and enter solution in ug
+	count = 0
+	gauss=GaussTria(P1Enum)
+	for i in 1:gauss.numgauss
+		vx = GetInputValue(vx_input, gauss, i)
+		vy = GetInputValue(vy_input, gauss, i)
+
+		count += 1
+		ug.vector[doflist[count]] = vx
+		count += 1
+		ug.vector[doflist[count]] = vy
+	end
+
+	#Make sure we reached all the values
+	@assert count==length(doflist)
+
+end#}}}
+function InputUpdateFromSolution(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
+
+	#Get dofs for this finite element
+	doflist = GetDofList(element,GsetEnum)
+
+	#Get solution vector for this element
+	numdof   = 3*2
+	values = Vector{Float64}(undef,numdof)
+	for i in 1:numdof values[i]=ug[doflist[i]] end
+
+	#Now split solution vector into x and y components
+	numnodes = 3
+	vx  = Vector{Float64}(undef,numnodes)
+	vy  = Vector{Float64}(undef,numnodes)
+	vel = Vector{Float64}(undef,numnodes)
+	for i in 1:numnodes 
+		vx[i]=values[2*i-1] 
+		vy[i]=values[2*i] 
+		@assert isfinite(vx[i])
+		@assert isfinite(vy[i])
+
+		vel[i] =sqrt(vx[i]^2 + vy[i]^2)
+	end
+
+	AddInput(element, VxEnum,  vx,  P1Enum)
+	AddInput(element, VyEnum,  vy,  P1Enum)
+	AddInput(element, VelEnum, vel, P1Enum)
+end#}}}
+function UpdateConstraints(analysis::StressbalanceAnalysis, femmodel::FemModel) #{{{
+	SetActiveNodesLSMx(femmodel)
+end#}}}
Index: /issm/trunk/src/jl/core/analyses/transientanalysis.jl
===================================================================
--- /issm/trunk/src/jl/core/analyses/transientanalysis.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/analyses/transientanalysis.jl	(revision 26744)
@@ -0,0 +1,40 @@
+#TransientAnalysis class definition
+struct TransientAnalysis <: Analysis#{{{
+end #}}}
+
+function UpdateParameters(analysis::TransientAnalysis,parameters::Parameters,md::model) #{{{
+
+	AddParam(parameters, md.constants.yts, ConstantsYtsEnum)
+	AddParam(parameters, md.timestepping.start_time*md.constants.yts, TimeEnum)
+	AddParam(parameters, md.timestepping.final_time*md.constants.yts, TimesteppingFinalTimeEnum)
+	AddParam(parameters, md.timestepping.time_step*md.constants.yts,  TimesteppingTimeStepEnum)
+	AddParam(parameters, md.transient.isstressbalance, TransientIsstressbalanceEnum)
+	AddParam(parameters, md.transient.ismasstransport, TransientIsmasstransportEnum)
+
+end#}}}
+function Core(analysis::TransientAnalysis,femmodel::FemModel)# {{{
+
+	step      = FindParam(femmodel.parameters, StepEnum)
+	time      = FindParam(femmodel.parameters, TimeEnum)
+	finaltime = FindParam(femmodel.parameters, TimesteppingFinalTimeEnum)
+	yts       = FindParam(femmodel.parameters, ConstantsYtsEnum)
+	dt        = FindParam(femmodel.parameters, TimesteppingTimeStepEnum)
+
+	isstressbalance = FindParam(femmodel.parameters, TransientIsstressbalanceEnum)
+   ismasstransport = FindParam(femmodel.parameters, TransientIsmasstransportEnum)
+
+   while(time < finaltime - (yts*eps(Float64))) #make sure we run up to finaltime.
+
+		time+=dt
+		AddParam(femmodel.parameters, time, TimeEnum)
+		AddParam(femmodel.parameters, step, StepEnum)
+		println("iteration ", step, "/", Int(ceil((finaltime-time)/dt))+step," time [yr]: ", time/yts, " (time step: ",  dt/yts, " [yr])")
+
+      if(isstressbalance) Core(StressbalanceAnalysis(), femmodel) end
+      if(ismasstransport) Core(MasstransportAnalysis(), femmodel) end
+		MigrateGroundinglinex(femmodel)
+
+		step+=1
+   end
+
+end #}}}
Index: /issm/trunk/src/jl/core/constraints.jl
===================================================================
--- /issm/trunk/src/jl/core/constraints.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/constraints.jl	(revision 26744)
@@ -0,0 +1,18 @@
+#Constraint class definition
+struct Constraint #{{{
+	id::Int64
+	nodeid::Int64
+	dof::Int8
+	value::Float64
+end# }}}
+
+#Constraint functions
+function ConstrainNode(constraint::Constraint,nodes::Vector{Node},parameters::Parameters) #{{{
+
+	#Chase through nodes and find the node to which this SpcStatic apply
+	node = nodes[constraint.nodeid]
+
+	#Apply Constraint
+	ApplyConstraint(node, constraint.dof, constraint.value)
+
+end# }}}
Index: /issm/trunk/src/jl/core/elementmatrix.jl
===================================================================
--- /issm/trunk/src/jl/core/elementmatrix.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/elementmatrix.jl	(revision 26744)
@@ -0,0 +1,117 @@
+mutable struct ElementMatrix#{{{
+	nrows::Int64
+	gglobaldoflist::Vector{Int64}
+	fglobaldoflist::Vector{Int64}
+	sglobaldoflist::Vector{Int64}
+	values::Matrix{Float64}
+end #}}}
+function ElementMatrix(nodes::Vector{Node})#{{{
+
+	#Get matrix size
+	nrows = NumberOfDofs(nodes,GsetEnum)
+
+	#Initialize element matrix with zeros
+	values = zeros(nrows,nrows)
+
+	#Get dof lists
+	gglobaldoflist=GetGlobalDofList(nodes,nrows,GsetEnum)
+	fglobaldoflist=GetGlobalDofList(nodes,nrows,FsetEnum)
+	sglobaldoflist=GetGlobalDofList(nodes,nrows,SsetEnum)
+
+	return ElementMatrix(nrows,gglobaldoflist,fglobaldoflist,sglobaldoflist,values)
+end#}}}
+function Base.show(io::IO, this::ElementMatrix)# {{{
+
+	println(io,"ElementMatrix:")
+	println(io,"   nrows: ",this.nrows)
+	println(io,"   gglobaldoflist: ",this.gglobaldoflist)
+	println(io,"   fglobaldoflist: ",this.fglobaldoflist)
+	println(io,"   sglobaldoflist: ",this.sglobaldoflist)
+	print(io,"   values: ")
+	display(this.values)
+end# }}}
+function AddToGlobal!(Ke::ElementMatrix,Kff::IssmMatrix,Kfs::IssmMatrix)#{{{
+
+	#First check that the element matrix looks alright
+	CheckConsistency(Ke)
+
+	#See if we need to do anything
+	is_fset = false
+	is_sset = false
+	for i in 1:Ke.nrows
+		if(Ke.fglobaldoflist[i]>0) is_fset = true end
+		if(Ke.sglobaldoflist[i]>0) is_sset = true end
+	end
+
+	if is_fset
+		AddValues!(Kff,Ke.nrows,Ke.fglobaldoflist,Ke.nrows,Ke.fglobaldoflist,Ke.values)
+	end
+	if is_sset
+		AddValues!(Kfs,Ke.nrows,Ke.fglobaldoflist,Ke.nrows,Ke.sglobaldoflist,Ke.values)
+	end
+
+end#}}}
+function CheckConsistency(Ke::ElementMatrix)#{{{
+
+	for i in 1:Ke.nrows
+		for j in 1:Ke.nrows
+			if(isnan(Ke.values[i,j])) error("NaN found in Element Matrix") end
+			if(isinf(Ke.values[i,j])) error("Inf found in Element Matrix") end
+			if(abs(Ke.values[i,j])>1.e+50) error("Element Matrix values exceeds 1.e+50") end
+		end
+	end
+end#}}}
+
+mutable struct ElementVector#{{{
+	nrows::Int64
+	fglobaldoflist::Vector{Int64}
+	values::Vector{Float64}
+end #}}}
+function ElementVector(nodes::Vector{Node})#{{{
+
+	#Get matrix size
+	nrows = NumberOfDofs(nodes,GsetEnum)
+
+	#Initialize element matrix with zeros
+	values = zeros(nrows)
+
+	#Get dof list
+	fglobaldoflist=GetGlobalDofList(nodes,nrows,FsetEnum)
+
+	return ElementVector(nrows,fglobaldoflist,values)
+end#}}}
+function Base.show(io::IO, this::ElementVector)# {{{
+
+	println(io,"ElementVector:")
+	println(io,"   nrows: ",this.nrows)
+	println(io,"   fglobaldoflist: ",this.fglobaldoflist)
+	print(io,"   values: ")
+	display(this.values)
+end# }}}
+function AddToGlobal!(pe::ElementVector,pf::IssmVector)#{{{
+
+	#First check that the element matrix looks alright
+	CheckConsistency(pe)
+
+	#See if we need to do anything
+	is_fset = false
+	for i in 1:pe.nrows
+		if(pe.fglobaldoflist[i]>0)
+			is_fset = true 
+			break
+		end
+	end
+
+	if is_fset
+		AddValues!(pf,pe.nrows,pe.fglobaldoflist,pe.values)
+	end
+
+end#}}}
+function CheckConsistency(pe::ElementVector)#{{{
+
+	for i in 1:pe.nrows
+		if(isnan(pe.values[i])) error("NaN found in Element Vector") end
+		if(isinf(pe.values[i])) error("Inf found in Element Vector") end
+		if(abs(pe.values[i])>1.e+50) error("Element Vector values exceeds 1.e+50") end
+	end
+end#}}}
Index: /issm/trunk/src/jl/core/elements.jl
===================================================================
--- /issm/trunk/src/jl/core/elements.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/elements.jl	(revision 26744)
@@ -0,0 +1,489 @@
+#Tria class definition
+mutable struct Tria #{{{
+	sid::Int64
+	pid::Int64
+
+	#vertexids::Int64[3]
+	#vertices::Vertex[3]
+	vertexids::Vector{Int64}
+	vertices::Vector{Vertex}
+
+	nodes::Vector{Node}
+	nodes_list::Vector{Vector{Node}}
+	nodes_ids_list::Vector{Vector{Int64}}
+
+	parameters::Parameters
+	inputs::Inputs
+end# }}}
+function Tria(sid::Int64, pid::Int64, vertexids::Vector{Int64}) #{{{
+
+	#This is the default constructor, at this point we don't have much information
+	tempparams   = Parameters(Dict{IssmEnum,Parameter}())
+	tempinputs   = Inputs(-1,-1,Dict{IssmEnum,Input}())
+	return Tria(sid, pid,
+					vertexids, Vector{Vertex}(undef,3),
+					Vector{Node}(undef,0), Vector{Vector{Node}}(undef,0), Vector{Vector{Int64}}(undef,0),
+					tempparams, tempinputs)
+
+end #}}}
+
+#Element functions
+function InputCreate(element::Tria,inputs::Inputs,data::Vector{Float64},enum::IssmEnum) #{{{
+	if size(data,1)==inputs.numberofelements
+		SetTriaInput(inputs,enum,P0Enum,element.sid,data[element.sid])
+	elseif size(data,1)==inputs.numberofvertices
+		SetTriaInput(inputs,enum,P1Enum,element.vertexids,data[element.vertexids])
+	else
+		error("size ",size(data,1)," not supported yet");
+	end
+end #}}}
+function AddInput(element::Tria,inputenum::IssmEnum,data::Vector{Float64},interpolation::IssmEnum) #{{{
+	if interpolation==P1Enum
+		@assert length(data)==3
+		SetTriaInput(element.inputs,inputenum,P1Enum,element.vertexids,data)
+	else
+		error("interpolation ", interpolation, " not supported yet");
+	end
+end #}}}
+function InputUpdateFromVector(element::Tria, vector::Vector{Float64}, enum::IssmEnum, layout::IssmEnum) #{{{
+
+	lidlist = element.vertexids
+	data = Vector{Float64}(undef, 3)
+
+	if(layout==VertexSIdEnum)
+		for i in 1:3
+			data[i] = vector[element.vertices[i].sid]
+			@assert isfinite(data[i])
+		end
+		SetTriaInput(element.inputs, enum, P1Enum, lidlist, data)
+	else
+		error("layout ", layout, " not supported yet");
+	end
+end #}}}
+function Update(element::Tria, inputs::Inputs, index::Int64, md::model, finiteelement::IssmEnum) #{{{
+
+	if finiteelement==P1Enum
+		numnodes = 3
+		nodeids    = Vector{Int64}(undef,numnodes)
+		nodeids[1] = md.mesh.elements[index,1]
+		nodeids[2] = md.mesh.elements[index,2]
+		nodeids[3] = md.mesh.elements[index,3]
+
+		push!(element.nodes_ids_list, nodeids)
+		push!(element.nodes_list, Vector{Node}(undef, numnodes))
+	else
+		error("not supported yet")
+	end
+end #}}}
+function Configure(element::Tria,nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs,index::Int64) # {{{
+
+   #Configure vertices
+   for i in 1:3
+		element.vertices[i] = vertices[element.vertexids[i]]
+   end
+
+	#Configure nodes (assuming P1 finite elements)
+	nodes_list     = element.nodes_list[index]
+	nodes_ids_list = element.nodes_ids_list[index]
+	for i in 1:3
+		nodes_list[i] = nodes[nodes_ids_list[i]]
+	end
+
+	#Point to real datasets
+	element.nodes      = element.nodes_list[index]
+	element.parameters = parameters
+	element.inputs     = inputs
+	
+end # }}}
+function GetDofList(element::Tria,setenum::IssmEnum) # {{{
+
+	#Define number of nodes
+	numnodes = 3
+
+	#Determine size of doflist
+	numdofs = 0
+	for i in 1:numnodes
+		numdofs += GetNumberOfDofs(element.nodes[i],GsetEnum)
+	end
+
+	#Allocate doflist vector
+	doflist = Vector{Int64}(undef,numdofs)
+
+	#enter dofs in doflist vector
+	count = 0
+	for i in 1:numnodes
+		count = GetDofList(element.nodes[i],doflist,count,GsetEnum)
+	end
+
+	return doflist
+end # }}}
+function GetInput(element::Tria,enum::IssmEnum) # {{{
+
+	input = GetInput(element.inputs,enum)
+	InputServe!(element,input)
+	return input
+
+end # }}}
+function GetInputListOnNodes!(element::Tria, vector::Vector{Float64}, enum::IssmEnum) # {{{
+
+	#Get Input first 
+	input = GetInput(element, enum)
+
+	#Get value at each vertex (i.e. P1 Nodes)
+	gauss=GaussTria(P1Enum)
+	for i in 1:gauss.numgauss
+		vector[i] = GetInputValue(input, gauss, i)
+	end
+
+end # }}}
+function GetInputListOnVertices!(element::Tria, vector::Vector{Float64}, enum::IssmEnum) # {{{
+
+	#Get Input first 
+	input = GetInput(element, enum)
+
+	#Get value at each vertex (i.e. P1 Nodes)
+	gauss=GaussTria(P1Enum)
+	for i in 1:gauss.numgauss
+		vector[i] = GetInputValue(input, gauss, i)
+	end
+
+end # }}}
+function FindParam(element::Tria,enum::IssmEnum) # {{{
+
+	return FindParam(element.parameters, enum)
+
+end # }}}
+function InputServe!(element::Tria,input::ElementInput) # {{{
+
+	if input.interp==P0Enum
+		input.element_values[1] = input.values[element.sid]
+	elseif input.interp==P1Enum
+		for i in 1:3
+			input.element_values[i] = input.values[element.vertices[i].sid]
+		end
+	else
+		error("interpolation ",input.interp," not supported yet")
+	end
+
+end # }}}
+function GetGroundedPortion(element::Tria, xyz_list::Matrix{Float64}) #{{{
+
+	level = Vector{Float64}(undef,3)
+	GetInputListOnVertices!(element, level, MaskOceanLevelsetEnum)
+
+	#Be sure that values are not zero
+	epsilon = 1.e-15
+	for i in 1:3
+		if(level[i]==0.) level[i]=level[i]+epsilon end
+	end
+
+	if level[1]>0 && level[2]>0 && level[3]>0
+      #Completely grounded
+		phi = 1.0
+   elseif level[1]<0 && level[2]<0 && level[3]<0
+      #Completely floating
+      phi = 0.0
+   else
+		#Partially floating,
+		if(level[1]*level[2]>0) #Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+			s1=level[3]/(level[3]-level[2]);
+			s2=level[3]/(level[3]-level[1]);
+		elseif(level[2]*level[3]>0) #Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
+			s1=level[1]/(level[1]-level[2]);
+			s2=level[1]/(level[1]-level[3]);
+		elseif(level[1]*level[3]>0) #Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+			s1=level[2]/(level[2]-level[1]);
+			s2=level[2]/(level[2]-level[3]);
+		else
+			error("not supposed to be here...")
+		end
+
+		if(level[1]*level[2]*level[3]>0)
+			phi = s1*s2
+		else
+			phi = (1-s1*s2)
+		end
+	end
+
+	return phi
+end#}}}
+function IsIcefront(element::Tria) #{{{
+
+	level = Vector{Float64}(undef,3)
+	GetInputListOnVertices!(element, level, MaskIceLevelsetEnum)
+
+	nbice = 0
+	for i in 1:3
+		if(level[i]<0.) nbice+=1 end
+	end
+
+	if(nbice==1)
+		return true
+	else
+		return false
+	end
+end#}}}
+function IsIceInElement(element::Tria) #{{{
+	#We consider that an element has ice if at least one of its nodes has a negative level set
+
+	input=GetInput(element, MaskIceLevelsetEnum)
+
+	if GetInputMin(input)<0
+		return true
+	else
+		return false
+	end
+
+end#}}}
+function GetIcefrontCoordinates!(element::Tria, xyz_front::Matrix{Float64}, xyz_list::Matrix{Float64}, levelsetenum::IssmEnum) #{{{
+
+	#Intermediaries
+	level        = Vector{Float64}(undef,3)
+	indicesfront = Vector{Int64}(undef,3)
+
+	#Recover value of levelset for all vertices
+	GetInputListOnVertices!(element, level, levelsetenum)
+
+	#Get nodes where there is no ice
+	num_frontnodes = 0
+	for i in 1:3
+		if(level[i]>=0.)
+			num_frontnodes += 1
+			indicesfront[num_frontnodes] = i
+		end
+	end
+	@assert num_frontnodes==2
+
+	#Arrange order of frontnodes such that they are oriented counterclockwise
+	NUMVERTICES = 3
+	if((NUMVERTICES+indicesfront[1]-indicesfront[2])%NUMVERTICES != NUMVERTICES-1)
+		index=indicesfront[1]
+		indicesfront[1]=indicesfront[2]
+		indicesfront[2]=index
+	end
+
+	#Return nodes
+	xyz_front[1,:]=xyz_list[indicesfront[1],:]
+	xyz_front[2,:]=xyz_list[indicesfront[2],:]
+
+end#}}}
+function GetArea(element::Tria)#{{{
+
+	#Get xyz list
+	xyz_list = GetVerticesCoordinates(element.vertices)
+	x1 = xyz_list[1,1]; y1 = xyz_list[1,2]
+	x2 = xyz_list[2,1]; y2 = xyz_list[2,2]
+	x3 = xyz_list[3,1]; y3 = xyz_list[3,2]
+
+	@assert x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1>0
+	return (x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1)/2
+end#}}}
+function NormalSection(element::Tria, xyz_front::Matrix{Float64}) #{{{
+
+	#Build output pointing vector
+	nx =  xyz_front[2,2] - xyz_front[1,2]
+	ny = -xyz_front[2,1] + xyz_front[1,1]
+
+	#normalize
+	norm = sqrt(nx^2 + ny^2)
+	nx = nx/norm
+	ny = ny/norm
+
+	return nx, ny
+end#}}}
+function CharacteristicLength(element::Tria) #{{{
+
+	return sqrt(2*GetArea(element))
+end#}}}
+function MigrateGroundingLine(element::Tria) #{{{
+
+	h = Vector{Float64}(undef,3)
+	s = Vector{Float64}(undef,3)
+	b = Vector{Float64}(undef,3)
+	r = Vector{Float64}(undef,3)
+	phi = Vector{Float64}(undef,3)
+	sl = zeros(3)
+	GetInputListOnVertices!(element, h, ThicknessEnum)
+	GetInputListOnVertices!(element, s, SurfaceEnum)
+	GetInputListOnVertices!(element, b, BaseEnum)
+	GetInputListOnVertices!(element, r, BedEnum)
+	#GetInputListOnVertices(element, sl, SealevelEnum)
+	GetInputListOnVertices!(element, phi, MaskOceanLevelsetEnum)
+
+
+	rho_water   = FindParam(element, MaterialsRhoSeawaterEnum)
+	rho_ice     = FindParam(element, MaterialsRhoIceEnum)
+	density     = rho_ice/rho_water
+
+	for i in 1:3
+
+		if(phi[i]<=0)
+			#reground if base is below bed
+			if(b[i]<=r[i])
+				b[i] = r[i]
+				s[i] = b[i]+h[i]
+			end
+		else
+			bed_hydro=-density*h[i]+sl[i];
+			if (bed_hydro>r[i])
+				#Unground only if the element is connected to the ice shelf
+				s[i] = (1-density)*h[i]+sl[i]
+				b[i] = -density*h[i]+sl[i]
+			end
+		end
+
+		#recalculate phi
+		phi[i]=h[i]+(r[i]-sl[i])/density
+	end
+
+	#Update inputs
+	AddInput(element,MaskOceanLevelsetEnum,phi,P1Enum)
+	AddInput(element,SurfaceEnum,s,P1Enum)
+	AddInput(element,BaseEnum,b,P1Enum)
+
+end#}}}
+
+#Finite Element stuff
+function JacobianDeterminant(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
+
+	#Get Jacobian Matrix
+	J = Jacobian(xyz_list)
+
+	#Get its determinant
+	Jdet = Matrix2x2Determinant(J)
+
+	#check and return
+	if(Jdet<0) error("negative Jacobian Determinant") end
+	return Jdet
+
+end#}}}
+function JacobianDeterminantSurface(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
+
+	x1 = xyz_list[1,1]; y1 = xyz_list[1,2]
+	x2 = xyz_list[2,1]; y2 = xyz_list[2,2]
+	Jdet = .5*sqrt((x2-x1)^2 + (y2-y1)^2)
+
+	#check and return
+	if(Jdet<0) error("negative Jacobian Determinant") end
+	return Jdet
+
+end#}}}
+function Jacobian(xyz_list::Matrix{Float64}) #{{{
+
+	J = Matrix{Float64}(undef,2,2)
+
+	x1 = xyz_list[1,1]
+	y1 = xyz_list[1,2]
+	x2 = xyz_list[2,1]
+	y2 = xyz_list[2,2]
+	x3 = xyz_list[3,1]
+	y3 = xyz_list[3,2]
+
+	J[1,1] = .5*(x2-x1)
+	J[1,2] = .5*(y2-y1)
+	J[2,1] = sqrt(3)/6*(2*x3 -x1 -x2)
+	J[2,2] = sqrt(3)/6*(2*y3 -y1 -y2)
+
+	return J
+end#}}}
+function JacobianInvert(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
+
+	#Get Jacobian matrix
+	J = Jacobian(xyz_list)
+
+	#Get its determinant
+	Jinv = Matrix2x2Invert(J)
+
+	return Jinv
+end#}}}
+function NodalFunctions(element::Tria,basis::Vector{Float64}, gauss::GaussTria, ig::Int64, finiteelement::IssmEnum) #{{{
+
+	if(finiteelement==P0Enum)
+		#Nodal function 1
+		basis[1]= 1
+	elseif(finiteelement==P1Enum)
+		basis[1] = gauss.coords1[ig]
+		basis[2] = gauss.coords2[ig]
+		basis[3] = gauss.coords3[ig]
+	else
+		error("Element type ",finiteelement," not supported yet")
+	end
+
+
+end#}}}
+function NodalFunctionsDerivatives(element::Tria,dbasis::Matrix{Float64},xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
+
+	#Get nodal function derivatives in reference element
+	dbasis_ref = Matrix{Float64}(undef,3,2)
+	NodalFunctionsDerivativesReferenceTria(dbasis_ref,gauss,P1Enum)
+
+	#Get invert of the Jacobian
+	Jinv = JacobianInvert(xyz_list,gauss)
+
+	#Build dbasis:
+	#[ dNi/dx ] = Jinv * [dNhat_i/dr]
+	#[ dNi/dy ] =        [dNhat_i/ds]
+	for i in 1:3
+		dbasis[i,1] = Jinv[1,1]*dbasis_ref[i,1]+Jinv[1,2]*dbasis_ref[i,2]
+		dbasis[i,2] = Jinv[2,1]*dbasis_ref[i,1]+Jinv[2,2]*dbasis_ref[i,2]
+	end
+
+end#}}}
+function NodalFunctionsDerivativesReferenceTria(dbasis::Matrix{Float64}, gauss::GaussTria, finiteelement::IssmEnum) #{{{
+
+	if(finiteelement==P0Enum)
+		#Nodal function 1
+		dbasis[1,1]= 0
+		dbasis[1,2]= 0
+
+	elseif(finiteelement==P1Enum)
+		#Nodal function 1
+		dbasis[1,1]= -.5
+		dbasis[1,2]= -sqrt(3)/6
+		#Nodal function 2
+		dbasis[2,1]= .5
+		dbasis[2,2]= -sqrt(3)/6
+		#Nodal function 3
+		dbasis[3,1]= 0
+		dbasis[3,2]= sqrt(3)/3
+	else
+		error("Element type ",finiteelement," not supported yet")
+	end
+end#}}}
+function NumberofNodesTria(finiteelement) #{{{
+
+	if    (finiteelement==P0Enum) return 0
+	elseif(finiteelement==P1Enum) return 3
+	else
+		error("Element type ",finiteelement," not supported yet")
+	end
+end#}}}
+function GaussTria(element::Tria, xyz_list::Matrix{Float64}, xyz_list_front::Matrix{Float64}, order::Int64) #{{{
+
+	area_coordinates = Matrix{Float64}(undef,2,3)
+	GetAreaCoordinates!(element, area_coordinates, xyz_list_front, xyz_list)
+
+	return GaussTria(area_coordinates, order)
+end# }}}
+function GetAreaCoordinates!(element::Tria, area_coordinates::Matrix{Float64}, xyz_zero::Matrix{Float64}, xyz_list::Matrix{Float64})#{{{
+
+	numpoints = size(area_coordinates,1)
+	area = GetArea(element)
+
+	#Copy original xyz_list
+	xyz_bis=copy(xyz_list)
+	for i in 1:numpoints
+		for j in 1:3
+
+			#Change appropriate line
+			xyz_bis[j,:] = xyz_zero[i,:]
+
+			#Compute area fraction
+			area_portion=abs(xyz_bis[2,1]*xyz_bis[3,2] - xyz_bis[2,2]*xyz_bis[3,1] + xyz_bis[1,1]*xyz_bis[2,2] - xyz_bis[1,2]*xyz_bis[2,1] + xyz_bis[3,1]*xyz_bis[1,2] - xyz_bis[3,2]*xyz_bis[1,1])/2
+			area_coordinates[i,j] = area_portion/area
+
+			#reinitialize xyz_list
+			xyz_bis[j,:] = xyz_list[j,:]
+		end
+	end
+end #}}}
Index: /issm/trunk/src/jl/core/femmodel.jl
===================================================================
--- /issm/trunk/src/jl/core/femmodel.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/femmodel.jl	(revision 26744)
@@ -0,0 +1,40 @@
+#femmodel class definition
+mutable struct FemModel #{{{
+	analyses::Vector{Analysis}
+	elements::Vector{Tria}
+	vertices::Vector{Vertex}
+
+	nodes::Vector{Node}
+	nodes_list::Vector{Vector{Node}}
+
+	parameters::Parameters
+	inputs::Inputs
+
+	constraints::Vector{Constraint}
+	constraints_list::Vector{Vector{Constraint}}
+
+	#loads::Vector{Loads}
+
+	results::Vector{Result}
+end#}}}
+
+#femmodel functions
+function SetCurrentConfiguration!(femmodel::FemModel, analysis::Analysis) #{{{
+
+	#Find the index of this analysis
+	index = -1
+	for i in 1:length(femmodel.analyses)
+		if(typeof(femmodel.analyses[i]) == typeof(analysis)) index = i end
+	end
+	if(index<1) error("Could not find analysis ",analysis, " in femmodel") end
+
+	#Plug right nodes onto element
+	for i in 1:length(femmodel.elements)
+		femmodel.elements[i].nodes = femmodel.elements[i].nodes_list[index]
+	end
+
+	#Plug in nodes and other datasets
+	femmodel.nodes       = femmodel.nodes_list[index]
+	femmodel.constraints = femmodel.constraints_list[index]
+
+end#}}}
Index: /issm/trunk/src/jl/core/friction.jl
===================================================================
--- /issm/trunk/src/jl/core/friction.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/friction.jl	(revision 26744)
@@ -0,0 +1,43 @@
+#Friction class definition
+
+abstract type CoreFriction end
+struct CoreBuddFriction#{{{
+	H_input::ElementInput
+	b_input::ElementInput
+	c_input::ElementInput
+	rho_ice::Float64
+	rho_water::Float64
+	g::Float64
+end# }}}
+function CoreFriction(element::Tria) #{{{
+
+	frictionlaw = FindParam(element, FrictionLawEnum)
+
+	if frictionlaw==1
+		H_input  = GetInput(element, ThicknessEnum)
+		b_input  = GetInput(element, BaseEnum)
+		c_input  = GetInput(element, FrictionCoefficientEnum)
+
+		rho_ice   = FindParam(element, MaterialsRhoIceEnum)
+		rho_water = FindParam(element, MaterialsRhoSeawaterEnum)
+		g         = FindParam(element, ConstantsGEnum)
+
+		return CoreBuddFriction(H_input, b_input, c_input, rho_ice, rho_water, g)
+	else
+		error("Friction ",typeof(md.friction)," not supported yet")
+	end
+end#}}}
+
+#vertices functions
+function Alpha2(friction::CoreBuddFriction, gauss::GaussTria, i::Int64) #{{{
+
+	#Get effective pressure
+	H = GetInputValue(friction.H_input, gauss, i)
+	b = GetInputValue(friction.b_input, gauss, i)
+	c = GetInputValue(friction.c_input, gauss, i)
+	N = friction.rho_ice*friction.g*H + friction.rho_water*friction.g*b
+
+	if(N<0) N=0 end
+
+	return c^2*N
+end #}}}
Index: /issm/trunk/src/jl/core/gauss.jl
===================================================================
--- /issm/trunk/src/jl/core/gauss.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/gauss.jl	(revision 26744)
@@ -0,0 +1,113 @@
+#Gauss class definition
+struct GaussTria #{{{
+	numgauss::Int64
+	weights::Vector{Float64}
+	coords1::Vector{Float64}
+	coords2::Vector{Float64}
+	coords3::Vector{Float64}
+end #}}}
+function Base.show(io::IO, this::GaussTria)# {{{
+
+	println(io,"GaussTria:")
+	println(io,"   numgauss: ",this.numgauss)
+	println(io,"   weights:  ",this.weights)
+	println(io,"   coords1:  ",this.coords1)
+	println(io,"   coords2:  ",this.coords2)
+	println(io,"   coords3:  ",this.coords3)
+end# }}}
+
+#Gauss constructor
+function GaussTria(order::Int64) #{{{
+
+	#=Gauss quadrature points for the triangle.
+	Higher-order points from D.A. Dunavant, "High Degree Efficient
+	Symmetrical Gaussian Quadrature Rules for the Triangle", IJNME,
+	Vol. 21, pp. 1129-1148 (1985), as transcribed for Probe rules3.=#
+
+	if(order==1)
+		npoints = 1
+		weights = [1.732050807568877]
+		coords1 = [0.333333333333333]
+		coords2 = [0.333333333333333]
+		coords3 = [0.333333333333333]
+	elseif(order==2)
+		npoints = 3
+		weights = [0.577350269189625; 0.577350269189625; 0.577350269189625]
+		coords1 = [0.666666666666667; 0.166666666666667; 0.166666666666667]
+		coords2 = [0.166666666666667; 0.666666666666667; 0.166666666666667]
+		coords3 = [0.166666666666667; 0.166666666666667; 0.666666666666667]
+	elseif(order==3)
+		npoints = 4
+		weights = [-0.974278579257493; 0.902109795608790; 0.902109795608790; 0.902109795608790]
+		coords1 = [ 0.333333333333333; 0.600000000000000; 0.200000000000000; 0.200000000000000]
+		coords2 = [ 0.333333333333333; 0.200000000000000; 0.600000000000000; 0.200000000000000]
+		coords3 = [ 0.333333333333333; 0.200000000000000; 0.200000000000000; 0.600000000000000]
+	else
+		error("order ",order," not supported yet");
+	end
+
+	return GaussTria(npoints,weights,coords1,coords2,coords3)
+end# }}}
+function GaussTria(finiteelement::IssmEnum) #{{{
+
+	if(finiteelement==P0Enum)
+		npoints = 1
+		weights = [1.]
+		coords1 = [0.333333333333333]
+		coords2 = [0.333333333333333]
+		coords3 = [0.333333333333333]
+	elseif(finiteelement==P1Enum)
+			npoints = 3
+			weights = 0.333333333333333*ones(3)
+			coords1 = [1.; 0.; 0.]
+			coords2 = [0.; 1.; 0.]
+			coords3 = [0.; 0.; 1.]
+	else
+		error("finite element ", finiteelement," not supported yet");
+	end
+
+	return GaussTria(npoints,weights,coords1,coords2,coords3)
+end# }}}
+function GaussTria(area_coordinates::Matrix{Float64}, order::Int64) #{{{
+	#=Gauss-Legendre quadrature points.
+
+	The recurrence coefficients for Legendre polynomials on (-1,1)
+	are defined (from the ORTHPOL subroutine RECUR with ipoly=1) as:
+
+	alpha(i)=0.
+	beta (i)=1./(4.-1./(i-1)^2))
+
+	For degree p, the required number of Gauss-Legendre points is
+	n>=(p+1)/2.=#
+
+	if(order==1)
+		npoint  = 1
+		weights = [2.000000000000000]
+		coords  = [0.000000000000000]
+	elseif(order==2)
+		npoints = 2
+		weights = [1.000000000000000, 1.000000000000000]
+		coords  = [-0.577350269189626, 0.577350269189626]
+	elseif(order==3)
+		npoints = 3
+		weights = [0.555555555555556, 0.888888888888889, 0.555555555555556]
+		coords  = [-0.774596669241483, 0.000000000000000, 0.774596669241483]
+	elseif(order==4)
+		npoints = 4
+		weights = [0.347854845137454, 0.652145154862546, 0.652145154862546, 0.347854845137454]
+		coords  = [-0.861136311594053,-0.339981043584856, 0.339981043584856, 0.861136311594053]
+	else
+      error("order ",order," not supported yet");
+	end
+
+   coords1  = Vector{Float64}(undef,npoints)
+   coords2  = Vector{Float64}(undef,npoints)
+   coords3  = Vector{Float64}(undef,npoints)
+   for i in 1:npoints
+      coords1[i]  = 0.5*(area_coordinates[1,1]+area_coordinates[2,1]) + 0.5*coords[i]*(area_coordinates[2,1]-area_coordinates[1,1]);
+      coords2[i]  = 0.5*(area_coordinates[1,2]+area_coordinates[2,2]) + 0.5*coords[i]*(area_coordinates[2,2]-area_coordinates[1,2]);
+      coords3[i]  = 0.5*(area_coordinates[1,3]+area_coordinates[2,3]) + 0.5*coords[i]*(area_coordinates[2,3]-area_coordinates[1,3]);
+   end
+
+	return GaussTria(npoints, weights, coords1, coords2, coords3)
+end# }}}
Index: /issm/trunk/src/jl/core/inputs.jl
===================================================================
--- /issm/trunk/src/jl/core/inputs.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/inputs.jl	(revision 26744)
@@ -0,0 +1,167 @@
+#Input class definition
+abstract type Input end
+struct BoolInput <: Input#{{{
+	enum::IssmEnum
+	values::Matrix{Bool}
+end# }}}
+struct IntInput <: Input#{{{
+	enum::IssmEnum
+	values::Matrix{Int64}
+end# }}}
+struct ElementInput <: Input#{{{
+	enum::IssmEnum
+	interp::IssmEnum
+	values::Vector{Float64}
+	element_values::Vector{Float64}
+end# }}}
+
+#Inputs dataset definition
+mutable struct Inputs #{{{
+	numberofelements::Int64
+	numberofvertices::Int64
+	lookup::Dict{IssmEnum,Input}
+end# }}}
+
+#Inputs functions
+function GetInput(inputs::Inputs,enum::IssmEnum) #{{{
+
+	#Does this input exist
+	if !haskey(inputs.lookup,enum)
+		error("Input ",enum," not found")
+	end
+
+	#return input
+	return inputs.lookup[enum]
+
+end#}}}
+function SetInput(inputs::Inputs,enum::IssmEnum,index::Int64,value::Bool) #{{{
+
+	#Does this input exist
+	if !haskey(inputs.lookup,enum)
+		#it does not exist yet, we need to create it...
+		@assert inputs.numberofelements > 0
+		input = BoolInput(enum,zeros(Bool,inputs.numberofelements))
+		inputs.lookup[enum] = BoolInput(enum,zeros(Bool,inputs.numberofelements))
+	end
+
+	#Get this input and check type
+	input = inputs.lookup[enum]
+	if typeof(input)!=BoolInput error("not consistent") end
+
+	#set value
+	@assert index>0 && index<=inputs.numberofelements
+	input.values[index] = value
+end#}}}
+function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,index::Int64,value::Float64) #{{{
+
+	#Does this input exist
+	if !haskey(inputs.lookup,enum)
+		#it does not exist yet, we need to create it...
+		@assert inputs.numberofelements > 0
+		if interp==P0Enum
+			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofelements),Vector{Float64}(undef,1))
+		elseif interp==P1Enum
+			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices),Vector{Float64}(undef,3))
+		else
+			error("not supported yet")
+		end
+	end
+
+	#Get this input and check type
+	input = inputs.lookup[enum]
+	if typeof(input)!=ElementInput error("input type not consistent") end
+	if interp!=input.interp        error("input interpolations not consistent") end
+
+	#set value
+	input.values[index] = value
+end#}}}
+function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,indices::Vector{Int64},values::Vector{Float64}) #{{{
+
+	#Does this input exist
+	if !haskey(inputs.lookup,enum)
+		#it does not exist yet, we need to create it...
+		@assert inputs.numberofvertices>0
+		if interp==P1Enum
+			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices),Vector{Float64}(undef,3))
+		else
+			error("not supported yet")
+		end
+	end
+
+	#Get this input and check type
+	input = inputs.lookup[enum]
+	if typeof(input)!=ElementInput error("input type not consistent") end
+	if interp!=input.interp        error("input interpolations not consistent") end
+
+	#set value
+	input.values[indices] = values
+end#}}}
+function GetInputAverageValue(input::ElementInput) #{{{
+
+	numnodes = NumberofNodesTria(input.interp)
+	value = 0.0
+
+	for i in 1:numnodes
+		value+=input.element_values[i]
+	end
+
+	return value/numnodes
+
+end#}}}
+function GetInputMin(input::ElementInput) #{{{
+
+	return minimum(input.element_values)
+
+end#}}}
+function GetInputValue(input::ElementInput,gauss::GaussTria,i::Int64) #{{{
+
+	if input.interp==P0Enum
+		return input.element_values[1]
+	elseif input.interp==P1Enum
+		value = input.element_values[1]*gauss.coords1[i] +  input.element_values[2]*gauss.coords2[i] +  input.element_values[3]*gauss.coords3[i]
+	else
+		error("not implemented yet")
+	end
+
+	return value
+
+end#}}}
+function GetInputDerivativeValue(input::ElementInput,xyz_list::Matrix{Float64},gauss::GaussTria,i::Int64) #{{{
+
+	#Get nodal function derivatives in reference element
+	numnodes = NumberofNodesTria(input.interp)
+	dbasis_ref = Matrix{Float64}(undef,numnodes,2)
+	NodalFunctionsDerivativesReferenceTria(dbasis_ref,gauss,input.interp)
+
+	#Get invert of the Jacobian
+	Jinv = JacobianInvert(xyz_list,gauss)
+
+	#Build dbasis:
+	#[ dNi/dx ] = Jinv * [dNhat_i/dr]
+	#[ dNi/dy ] =        [dNhat_i/ds]
+	dbasis = Matrix{Float64}(undef,numnodes,2)
+	for i in 1:3
+		dbasis[i,1] = Jinv[1,1]*dbasis_ref[i,1]+Jinv[1,2]*dbasis_ref[i,2]
+		dbasis[i,2] = Jinv[2,1]*dbasis_ref[i,1]+Jinv[2,2]*dbasis_ref[i,2]
+	end
+
+	#Get derivatives: dp/dx dp/dy
+	dp = [0.0;0.0]
+	for i in 1:3
+		dp[1] += dbasis[i,1]*input.element_values[i]
+		dp[2] += dbasis[i,2]*input.element_values[i]
+	end
+
+	return dp
+
+end#}}}
+function DuplicateInput(inputs::Inputs, old::IssmEnum, new::IssmEnum)#{{{
+
+	#Fetch input that needs to be copied
+	oldinput = inputs.lookup[old]
+
+	if typeof(oldinput)==ElementInput
+		inputs.lookup[new] = ElementInput(new, oldinput.interp, copy(oldinput.values), copy(oldinput.element_values))
+	end
+
+end#}}}
Index: /issm/trunk/src/jl/core/issmenums.jl
===================================================================
--- /issm/trunk/src/jl/core/issmenums.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/issmenums.jl	(revision 26744)
@@ -0,0 +1,3111 @@
+#   WARNING: DO NOT MODIFY THIS FILE
+#            this file has been automatically generated by Synchronize.sh
+#            Please read README for more information
+
+@enum IssmEnum begin
+	ParametersSTARTEnum
+	AdolcParamEnum
+	AmrDeviatoricErrorGroupThresholdEnum
+	AmrDeviatoricErrorMaximumEnum
+	AmrDeviatoricErrorResolutionEnum
+	AmrDeviatoricErrorThresholdEnum
+	AmrErrEnum
+	AmrFieldEnum
+	AmrGradationEnum
+	AmrGroundingLineDistanceEnum
+	AmrGroundingLineResolutionEnum
+	AmrHmaxEnum
+	AmrHminEnum
+	AmrIceFrontDistanceEnum
+	AmrIceFrontResolutionEnum
+	AmrKeepMetricEnum
+	AmrLagEnum
+	AmrLevelMaxEnum
+	AmrRestartEnum
+	AmrThicknessErrorGroupThresholdEnum
+	AmrThicknessErrorMaximumEnum
+	AmrThicknessErrorResolutionEnum
+	AmrThicknessErrorThresholdEnum
+	AmrTypeEnum
+	AnalysisCounterEnum
+	AnalysisTypeEnum
+	AugmentedLagrangianREnum
+	AugmentedLagrangianRholambdaEnum
+	AugmentedLagrangianRhopEnum
+	AugmentedLagrangianRlambdaEnum
+	AugmentedLagrangianThetaEnum
+	AutodiffCbufsizeEnum
+	AutodiffDependentObjectsEnum
+	AutodiffDriverEnum
+	AutodiffFosForwardIndexEnum
+	AutodiffFosReverseIndexEnum
+	AutodiffFovForwardIndicesEnum
+	AutodiffGcTriggerMaxSizeEnum
+	AutodiffGcTriggerRatioEnum
+	AutodiffIsautodiffEnum
+	AutodiffLbufsizeEnum
+	AutodiffNumDependentsEnum
+	AutodiffNumIndependentsEnum
+	AutodiffObufsizeEnum
+	AutodiffTapeAllocEnum
+	AutodiffTbufsizeEnum
+	AutodiffXpEnum
+	BalancethicknessStabilizationEnum
+	BarystaticContributionsEnum
+	BasalforcingsBottomplumedepthEnum
+	BasalforcingsCrustthicknessEnum
+	BasalforcingsDeepwaterElevationEnum
+	BasalforcingsDeepwaterMeltingRateEnum
+	BasalforcingsDtbgEnum
+	BasalforcingsEnum
+	BasalforcingsIsmip6AverageTfEnum
+	BasalforcingsIsmip6BasinAreaEnum
+	BasalforcingsIsmip6DeltaTEnum
+	BasalforcingsIsmip6Gamma0Enum
+	BasalforcingsIsmip6IsLocalEnum
+	BasalforcingsIsmip6NumBasinsEnum
+	BasalforcingsIsmip6TfDepthsEnum
+	BasalforcingsLowercrustheatEnum
+	BasalforcingsMantleconductivityEnum
+	BasalforcingsNusseltEnum
+	BasalforcingsPicoAverageOverturningEnum
+	BasalforcingsPicoAverageSalinityEnum
+	BasalforcingsPicoAverageTemperatureEnum
+	BasalforcingsPicoBoxAreaEnum
+	BasalforcingsPicoFarOceansalinityEnum
+	BasalforcingsPicoFarOceantemperatureEnum
+	BasalforcingsPicoGammaTEnum
+	BasalforcingsPicoIsplumeEnum
+	BasalforcingsPicoMaxboxcountEnum
+	BasalforcingsPicoNumBasinsEnum
+	BasalforcingsPlumeradiusEnum
+	BasalforcingsPlumexEnum
+	BasalforcingsPlumeyEnum
+	BasalforcingsThresholdThicknessEnum
+	BasalforcingsTopplumedepthEnum
+	BasalforcingsUppercrustheatEnum
+	BasalforcingsUppercrustthicknessEnum
+	BasalforcingsUpperdepthMeltEnum
+	BasalforcingsUpperwaterElevationEnum
+	BasalforcingsUpperwaterMeltingRateEnum
+	CalvingCrevasseDepthEnum
+	CalvingCrevasseThresholdEnum
+	CalvingHeightAboveFloatationEnum
+	CalvingLawEnum
+	CalvingMinthicknessEnum
+	ConfigurationTypeEnum
+	ConstantsGEnum
+	ConstantsNewtonGravityEnum
+	ConstantsReferencetemperatureEnum
+	ConstantsYtsEnum
+	ControlInputSizeMEnum
+	ControlInputSizeNEnum
+	ControlInputInterpolationEnum
+	CumBslcEnum
+	CumBslcIceEnum
+	CumBslcHydroEnum
+	CumBslcOceanEnum
+	CumBslcIcePartitionEnum
+	CumBslcHydroPartitionEnum
+	CumBslcOceanPartitionEnum
+	CumGmtslcEnum
+	CumGmslcEnum
+	DamageC1Enum
+	DamageC2Enum
+	DamageC3Enum
+	DamageC4Enum
+	DamageEnum
+	DamageEquivStressEnum
+	DamageEvolutionNumRequestedOutputsEnum
+	DamageEvolutionRequestedOutputsEnum
+	DamageHealingEnum
+	DamageKappaEnum
+	DamageLawEnum
+	DamageMaxDamageEnum
+	DamageStabilizationEnum
+	DamageStressThresholdEnum
+	DamageStressUBoundEnum
+	DebugProfilingEnum
+	DomainDimensionEnum
+	DomainTypeEnum
+	DslModelEnum
+	DslModelidEnum
+	DslNummodelsEnum
+	SolidearthIsExternalEnum
+	SolidearthExternalNatureEnum
+	SolidearthExternalModelidEnum
+	SolidearthExternalNummodelsEnum
+	SolidearthSettingsComputeBpGrdEnum
+	EarthIdEnum
+	ElasticEnum
+	EplZigZagCounterEnum
+	EsaHElasticEnum
+	EsaHemisphereEnum
+	EsaRequestedOutputsEnum
+	EsaUElasticEnum
+	ExtrapolationVariableEnum
+	FemModelCommEnum
+	FieldsEnum
+	FlowequationFeFSEnum
+	FlowequationIsFSEnum
+	FlowequationIsHOEnum
+	FlowequationIsL1L2Enum
+	FlowequationIsMLHOEnum
+	FlowequationIsSIAEnum
+	FlowequationIsSSAEnum
+	FlowequationIsNitscheEnum
+	FeFSNitscheGammaEnum
+	FrictionCouplingEnum
+	FrictionDeltaEnum
+	FrictionEffectivePressureLimitEnum
+	FrictionFEnum
+	FrictionGammaEnum
+	FrictionLawEnum
+	FrictionPseudoplasticityExponentEnum
+	FrictionThresholdSpeedEnum
+	FrictionVoidRatioEnum
+	FrontalForcingsBasinIcefrontAreaEnum
+	FrontalForcingsAutoregressionInitialTimeEnum
+	FrontalForcingsAutoregressionTimestepEnum
+	FrontalForcingsAutoregressiveOrderEnum
+	FrontalForcingsBeta0Enum
+	FrontalForcingsBeta1Enum
+	FrontalForcingsNumberofBasinsEnum
+	FrontalForcingsParamEnum
+	FrontalForcingsPhiEnum
+	GrdModelEnum
+	GroundinglineFrictionInterpolationEnum
+	GroundinglineMeltInterpolationEnum
+	GroundinglineMigrationEnum
+	HydrologyAveragingEnum
+	HydrologyCavitySpacingEnum
+	HydrologyChannelConductivityEnum
+	HydrologyChannelSheetWidthEnum
+	HydrologyEnglacialVoidRatioEnum
+	HydrologyIschannelsEnum
+	HydrologyMeltFlagEnum
+	HydrologyModelEnum
+	HydrologyNumRequestedOutputsEnum
+	HydrologyPressureMeltCoefficientEnum
+	HydrologyRelaxationEnum
+	HydrologyRequestedOutputsEnum
+	HydrologySedimentKmaxEnum
+	HydrologyStepsPerStepEnum
+	HydrologyStorageEnum
+	HydrologydcEplColapseThicknessEnum
+	HydrologydcEplConductivityEnum
+	HydrologydcEplInitialThicknessEnum
+	HydrologydcEplLayerCompressibilityEnum
+	HydrologydcEplMaxThicknessEnum
+	HydrologydcEplPoreWaterMassEnum
+	HydrologydcEplThickCompEnum
+	HydrologydcEplflipLockEnum
+	HydrologydcIsefficientlayerEnum
+	HydrologydcLeakageFactorEnum
+	HydrologydcMaxIterEnum
+	HydrologydcPenaltyFactorEnum
+	HydrologydcPenaltyLockEnum
+	HydrologydcRelTolEnum
+	HydrologydcSedimentlimitEnum
+	HydrologydcSedimentlimitFlagEnum
+	HydrologydcSedimentLayerCompressibilityEnum
+	HydrologydcSedimentPoreWaterMassEnum
+	HydrologydcSedimentPorosityEnum
+	HydrologydcSedimentThicknessEnum
+	HydrologydcTransferFlagEnum
+	HydrologydcUnconfinedFlagEnum
+	HydrologyshreveStabilizationEnum
+	IcecapToEarthCommEnum
+	IndexEnum
+	InputFileNameEnum
+	DirectoryNameEnum
+	IndicesEnum
+	InputToDepthaverageInEnum
+	InputToDepthaverageOutEnum
+	InputToExtrudeEnum
+	InputToL2ProjectEnum
+	InputToSmoothEnum
+	InversionAlgorithmEnum
+	InversionControlParametersEnum
+	InversionControlScalingFactorsEnum
+	InversionCostFunctionsEnum
+	InversionDxminEnum
+	InversionGatolEnum
+	InversionGradientScalingEnum
+	InversionGrtolEnum
+	InversionGttolEnum
+	InversionIncompleteAdjointEnum
+	InversionIscontrolEnum
+	InversionMaxiterEnum
+	InversionMaxiterPerStepEnum
+	InversionMaxstepsEnum
+	InversionNstepsEnum
+	InversionNumControlParametersEnum
+	InversionNumCostFunctionsEnum
+	InversionStepThresholdEnum
+	InversionTypeEnum
+	IvinsEnum
+	IsSlcCouplingEnum
+	LevelsetKillIcebergsEnum
+	LevelsetReinitFrequencyEnum
+	LevelsetStabilizationEnum
+	LockFileNameEnum
+	LoveAllowLayerDeletionEnum
+	LoveCoreMantleBoundaryEnum
+	LoveEarthMassEnum
+	LoveForcingTypeEnum
+	LoveFrequenciesEnum
+	LoveIsTemporalEnum
+	LoveG0Enum
+	LoveGravitationalConstantEnum
+	LoveInnerCoreBoundaryEnum
+	LoveComplexComputationEnum
+	LoveIntStepsPerLayerEnum
+	LoveKernelsEnum
+	LoveMu0Enum
+	LoveNfreqEnum
+	LoveNTemporalIterationsEnum
+	LoveNYiEquationsEnum
+	LoveR0Enum
+	LoveShNmaxEnum
+	LoveShNminEnum
+	LoveStartingLayerEnum
+	LoveUnderflowTolEnum
+	MassFluxSegmentsEnum
+	MassFluxSegmentsPresentEnum
+	MasstransportHydrostaticAdjustmentEnum
+	MasstransportIsfreesurfaceEnum
+	MasstransportMinThicknessEnum
+	MasstransportNumRequestedOutputsEnum
+	MasstransportPenaltyFactorEnum
+	MasstransportRequestedOutputsEnum
+	MasstransportStabilizationEnum
+	MaterialsBetaEnum
+	MaterialsEarthDensityEnum
+	MaterialsEffectiveconductivityAveragingEnum
+	MaterialsHeatcapacityEnum
+	MaterialsLatentheatEnum
+	MaterialsMeltingpointEnum
+	MaterialsMixedLayerCapacityEnum
+	MaterialsMuWaterEnum
+	MaterialsRheologyLawEnum
+	MaterialsRhoFreshwaterEnum
+	MaterialsRhoIceEnum
+	MaterialsRhoSeawaterEnum
+	MaterialsTemperateiceconductivityEnum
+	MaterialsThermalExchangeVelocityEnum
+	MaterialsThermalconductivityEnum
+	MeltingOffsetEnum
+	MeshAverageVertexConnectivityEnum
+	MeshElementtypeEnum
+	MeshNumberoflayersEnum
+	MeshNumberofverticesEnum
+	MeshNumberofelementsEnum
+	MigrationMaxEnum
+	ModelIdEnum
+	NbinsEnum
+	NodesEnum
+	NumModelsEnum
+	OceanGridNxEnum
+	OceanGridNyEnum
+	OceanGridXEnum
+	OceanGridYEnum
+	OutputBufferPointerEnum
+	OutputBufferSizePointerEnum
+	OutputFileNameEnum
+	OutputFilePointerEnum
+	OutputdefinitionEnum
+	QmuErrNameEnum
+	QmuInNameEnum
+	QmuIsdakotaEnum
+	QmuOutNameEnum
+	QmuOutputEnum
+	QmuCurrEvalIdEnum
+	QmuNsampleEnum
+	QmuResponsedescriptorsEnum
+	QmuVariableDescriptorsEnum
+	QmuVariablePartitionsEnum
+	QmuVariablePartitionsNpartEnum
+	QmuVariablePartitionsNtEnum
+	QmuResponsePartitionsEnum
+	QmuResponsePartitionsNpartEnum
+	QmuStatisticsEnum
+	QmuNumstatisticsEnum
+	QmuNdirectoriesEnum
+	QmuNfilesPerDirectoryEnum
+	QmuStatisticsMethodEnum
+	QmuMethodsEnum
+	RestartFileNameEnum
+	ResultsEnum
+	RootPathEnum
+	ModelnameEnum
+	SamplingAlphaEnum
+	SamplingPhiEnum
+	SamplingNumRequestedOutputsEnum
+	SamplingRequestedOutputsEnum
+	SamplingRobinEnum
+	SamplingSeedEnum
+	SamplingTauEnum
+	SaveResultsEnum
+	SolidearthPartitionIceEnum
+	SolidearthPartitionHydroEnum
+	SolidearthPartitionOceanEnum
+	SolidearthNpartIceEnum
+	SolidearthNpartOceanEnum
+	SolidearthNpartHydroEnum
+	SolidearthPlanetRadiusEnum
+	SolidearthPlanetAreaEnum
+	SolidearthSettingsAbstolEnum
+	SolidearthSettingsCrossSectionShapeEnum
+	RotationalAngularVelocityEnum
+	SolidearthSettingsElasticEnum
+	SolidearthSettingsViscousEnum
+	SealevelchangeGeometryDoneEnum
+	SealevelchangeViscousNumStepsEnum
+	SealevelchangeViscousTimesEnum
+	SealevelchangeViscousIndexEnum
+	RotationalEquatorialMoiEnum
+	TidalLoveHEnum
+	TidalLoveKEnum
+	TidalLoveLEnum
+	TidalLoveK2SecularEnum
+	LoadLoveHEnum
+	LoadLoveKEnum
+	LoadLoveLEnum
+	LoveTimeFreqEnum
+	LoveIsTimeEnum
+	SealevelchangeGSelfAttractionEnum
+	SealevelchangeGViscoElasticEnum
+	SolidearthSettingsSealevelLoadingEnum
+	SolidearthSettingsGRDEnum
+	SolidearthSettingsRunFrequencyEnum
+	SolidearthSettingsTimeAccEnum
+	SealevelchangeHViscoElasticEnum
+	SolidearthSettingsHorizEnum
+	SolidearthSettingsMaxiterEnum
+	SolidearthSettingsGrdOceanEnum
+	SolidearthSettingsOceanAreaScalingEnum
+	StochasticForcingCovarianceEnum
+	StochasticForcingDefaultDimensionEnum
+	StochasticForcingDimensionsEnum
+	StochasticForcingFieldsEnum
+	StochasticForcingIsEffectivePressureEnum
+	StochasticForcingIsStochasticForcingEnum
+	StochasticForcingIsWaterPressureEnum
+	StochasticForcingNumFieldsEnum
+	StochasticForcingRandomflagEnum
+	RotationalPolarMoiEnum
+	SolidearthSettingsReltolEnum
+	SealevelchangeRequestedOutputsEnum
+	SolidearthSettingsSelfAttractionEnum
+	SolidearthSettingsRotationEnum
+	SolidearthSettingsMaxSHCoeffEnum
+	SealevelchangeRunCountEnum
+	SealevelchangeTransitionsEnum
+	SealevelchangeUViscoElasticEnum
+	SettingsIoGatherEnum
+	SettingsNumResultsOnNodesEnum
+	SettingsOutputFrequencyEnum
+	SettingsCheckpointFrequencyEnum
+	SettingsResultsOnNodesEnum
+	SettingsSbCouplingFrequencyEnum
+	SettingsSolverResidueThresholdEnum
+	SettingsWaitonlockEnum
+	SmbAIceEnum
+	SmbAIdxEnum
+	SmbASnowEnum
+	SmbAccualtiEnum
+	SmbAccugradEnum
+	SmbAccurefEnum
+	SmbAdThreshEnum
+	SmbAutoregressionInitialTimeEnum
+	SmbAutoregressionTimestepEnum
+	SmbAutoregressiveOrderEnum
+	SmbAveragingEnum
+	SmbBeta0Enum
+	SmbBeta1Enum
+	SmbDesfacEnum
+	SmbDpermilEnum
+	SmbDsnowIdxEnum
+	SmbCldFracEnum
+	SmbDelta18oEnum
+	SmbDelta18oSurfaceEnum
+	SmbDenIdxEnum
+	SmbDtEnum
+	SmbEnum
+	SmbEIdxEnum
+	SmbFEnum
+	SmbInitDensityScalingEnum
+	SmbIsaccumulationEnum
+	SmbIsalbedoEnum
+	SmbIsconstrainsurfaceTEnum
+	SmbIsd18opdEnum
+	SmbIsdelta18oEnum
+	SmbIsdensificationEnum
+	SmbIsdeltaLWupEnum
+	SmbIsfirnwarmingEnum
+	SmbIsgraingrowthEnum
+	SmbIsmeltEnum
+	SmbIsmungsmEnum
+	SmbIsprecipscaledEnum
+	SmbIssetpddfacEnum
+	SmbIsshortwaveEnum
+	SmbIstemperaturescaledEnum
+	SmbIsthermalEnum
+	SmbIsturbulentfluxEnum
+	SmbKEnum
+	SmbNumBasinsEnum
+	SmbNumRequestedOutputsEnum
+	SmbPfacEnum
+	SmbPhiEnum
+	SmbRdlEnum
+	SmbRequestedOutputsEnum
+	SmbRlapsEnum
+	SmbRlapslgmEnum
+	SmbRunoffaltiEnum
+	SmbRunoffgradEnum
+	SmbRunoffrefEnum
+	SmbSealevEnum
+	SmbStepsPerStepEnum
+	SmbSwIdxEnum
+	SmbT0dryEnum
+	SmbT0wetEnum
+	SmbTeThreshEnum
+	SmbTdiffEnum
+	SmbThermoDeltaTScalingEnum
+	SmbTemperaturesReconstructedYearsEnum
+	SmbPrecipitationsReconstructedYearsEnum
+	SmoothThicknessMultiplierEnum
+	SolutionTypeEnum
+	SteadystateMaxiterEnum
+	SteadystateNumRequestedOutputsEnum
+	SteadystateReltolEnum
+	SteadystateRequestedOutputsEnum
+	StepEnum
+	StepsEnum
+	StressbalanceAbstolEnum
+	StressbalanceFSreconditioningEnum
+	StressbalanceIsnewtonEnum
+	StressbalanceMaxiterEnum
+	StressbalanceNumRequestedOutputsEnum
+	StressbalancePenaltyFactorEnum
+	StressbalanceReltolEnum
+	StressbalanceRequestedOutputsEnum
+	StressbalanceRestolEnum
+	StressbalanceRiftPenaltyThresholdEnum
+	StressbalanceShelfDampeningEnum
+	ThermalIsdrainicecolumnEnum
+	ThermalIsdynamicbasalspcEnum
+	ThermalIsenthalpyEnum
+	ThermalMaxiterEnum
+	ThermalNumRequestedOutputsEnum
+	ThermalPenaltyFactorEnum
+	ThermalPenaltyLockEnum
+	ThermalPenaltyThresholdEnum
+	ThermalReltolEnum
+	ThermalRequestedOutputsEnum
+	ThermalStabilizationEnum
+	ThermalWatercolumnUpperlimitEnum
+	TimeEnum
+	TimesteppingCflCoefficientEnum
+	TimesteppingCouplingTimeEnum
+	TimesteppingFinalTimeEnum
+	TimesteppingInterpForcingEnum
+	TimesteppingCycleForcingEnum
+	TimesteppingStartTimeEnum
+	TimesteppingTimeStepEnum
+	TimesteppingTimeStepMaxEnum
+	TimesteppingTimeStepMinEnum
+	TimesteppingTypeEnum
+	ToMITgcmCommEnum
+	ToolkitsFileNameEnum
+	ToolkitsOptionsAnalysesEnum
+	ToolkitsOptionsStringsEnum
+	ToolkitsTypesEnum
+	TransientAmrFrequencyEnum
+	TransientIsdamageevolutionEnum
+	TransientIsesaEnum
+	TransientIsgiaEnum
+	TransientIsgroundinglineEnum
+	TransientIshydrologyEnum
+	TransientIsmasstransportEnum
+	TransientIsoceantransportEnum
+	TransientIsmovingfrontEnum
+	TransientIsoceancouplingEnum
+	TransientIssamplingEnum
+	TransientIsslcEnum
+	TransientIssmbEnum
+	TransientIsstressbalanceEnum
+	TransientIsthermalEnum
+	TransientNumRequestedOutputsEnum
+	TransientRequestedOutputsEnum
+	VelocityEnum
+	XxeEnum
+	YyeEnum
+	ZzeEnum
+	AreaeEnum
+	WorldCommEnum
+	ParametersENDEnum
+	InputsSTARTEnum
+	AccumulatedDeltaBottomPressureEnum
+	AccumulatedDeltaIceThicknessEnum
+	AccumulatedDeltaTwsEnum
+	AdjointEnum
+	AdjointpEnum
+	AdjointxEnum
+	AdjointxBaseEnum
+	AdjointxShearEnum
+	AdjointyEnum
+	AdjointyBaseEnum
+	AdjointyShearEnum
+	AdjointzEnum
+	AirEnum
+	ApproximationEnum
+	BalancethicknessMisfitEnum
+	BalancethicknessOmega0Enum
+	BalancethicknessOmegaEnum
+	BalancethicknessSpcthicknessEnum
+	BalancethicknessThickeningRateEnum
+	BasalCrevasseEnum
+	BasalforcingsFloatingiceMeltingRateEnum
+	BasalforcingsGeothermalfluxEnum
+	BasalforcingsGroundediceMeltingRateEnum
+	BasalforcingsPerturbationMeltingRateEnum
+	BasalforcingsIsmip6BasinIdEnum
+	BasalforcingsIsmip6TfEnum
+	BasalforcingsIsmip6TfShelfEnum
+	BasalforcingsIsmip6MeltAnomalyEnum
+	BasalforcingsMeltrateFactorEnum
+	BasalforcingsOceanSalinityEnum
+	BasalforcingsOceanTempEnum
+	BasalforcingsPicoBasinIdEnum
+	BasalforcingsPicoBoxIdEnum
+	BasalforcingsPicoOverturningCoeffEnum
+	BasalforcingsPicoSubShelfOceanOverturningEnum
+	BasalforcingsPicoSubShelfOceanSalinityEnum
+	BasalforcingsPicoSubShelfOceanTempEnum
+	BasalStressxEnum
+	BasalStressyEnum
+	BasalStressEnum
+	BaseEnum
+	BaseOldEnum
+	BaseSlopeXEnum
+	BaseSlopeYEnum
+	BaselineBasalforcingsFloatingiceMeltingRateEnum
+	BaselineCalvingCalvingrateEnum
+	BaselineFrictionEffectivePressureEnum
+	BedEnum
+	BedGRDEnum
+	BedEastEnum
+	BedEastGRDEnum
+	BedNorthEnum
+	BedNorthGRDEnum
+	BedSlopeXEnum
+	BedSlopeYEnum
+	BottomPressureEnum
+	BottomPressureOldEnum
+	CalvingCalvingrateEnum
+	CalvingHabFractionEnum
+	CalvingMeltingrateEnum
+	CalvingStressThresholdFloatingiceEnum
+	CalvingStressThresholdGroundediceEnum
+	CalvinglevermannCoeffEnum
+	CalvingratexAverageEnum
+	CalvingratexEnum
+	CalvingrateyAverageEnum
+	CalvingrateyEnum
+	CalvingFluxLevelsetEnum
+	CalvingMeltingFluxLevelsetEnum
+	ConvergedEnum
+	CrevasseDepthEnum
+	DamageDEnum
+	DamageDOldEnum
+	DamageDbarEnum
+	DamageDbarOldEnum
+	DamageFEnum
+	DegreeOfChannelizationEnum
+	DepthBelowSurfaceEnum
+	DeltaIceThicknessEnum
+	DeltaTwsEnum
+	DeltaBottomPressureEnum
+	DeltaDslEnum
+	DslOldEnum
+	DslEnum
+	DeltaStrEnum
+	StrOldEnum
+	StrEnum
+	DeviatoricStresseffectiveEnum
+	DeviatoricStressxxEnum
+	DeviatoricStressxyEnum
+	DeviatoricStressxzEnum
+	DeviatoricStressyyEnum
+	DeviatoricStressyzEnum
+	DeviatoricStresszzEnum
+	DeviatoricStress1Enum
+	DeviatoricStress2Enum
+	DistanceToCalvingfrontEnum
+	DistanceToGroundinglineEnum
+	Domain2DhorizontalEnum
+	Domain2DverticalEnum
+	Domain3DEnum
+	DragCoefficientAbsGradientEnum
+	DrivingStressXEnum
+	DrivingStressYEnum
+	DummyEnum
+	EffectivePressureEnum
+	EffectivePressureSubstepEnum
+	EffectivePressureTransientEnum
+	EnthalpyEnum
+	EnthalpyPicardEnum
+	EplHeadEnum
+	EplHeadOldEnum
+	EplHeadSlopeXEnum
+	EplHeadSlopeYEnum
+	EplHeadSubstepEnum
+	EplHeadTransientEnum
+	EsaEmotionEnum
+	EsaNmotionEnum
+	EsaRotationrateEnum
+	EsaStrainratexxEnum
+	EsaStrainratexyEnum
+	EsaStrainrateyyEnum
+	EsaUmotionEnum
+	EsaXmotionEnum
+	EsaYmotionEnum
+	EtaDiffEnum
+	FlowequationBorderFSEnum
+	FrictionAsEnum
+	FrictionCEnum
+	FrictionCmaxEnum
+	FrictionCoefficientEnum
+	FrictionCoefficientcoulombEnum
+	FrictionEffectivePressureEnum
+	FrictionMEnum
+	FrictionPEnum
+	FrictionPressureAdjustedTemperatureEnum
+	FrictionQEnum
+	FrictionSedimentCompressibilityCoefficientEnum
+	FrictionTillFrictionAngleEnum
+	FrictionWaterLayerEnum
+	FrictionfEnum
+	FrontalForcingsBasinIdEnum
+	FrontalForcingsSubglacialDischargeEnum
+	FrontalForcingsThermalForcingEnum
+	GeometryHydrostaticRatioEnum
+	NGiaEnum
+	NGiaRateEnum
+	UGiaEnum
+	UGiaRateEnum
+	GradientEnum
+	GroundinglineHeightEnum
+	HydraulicPotentialEnum
+	HydraulicPotentialOldEnum
+	HydrologyBasalFluxEnum
+	HydrologyBumpHeightEnum
+	HydrologyBumpSpacingEnum
+	HydrologydcBasalMoulinInputEnum
+	HydrologydcEplThicknessEnum
+	HydrologydcEplThicknessOldEnum
+	HydrologydcEplThicknessSubstepEnum
+	HydrologydcEplThicknessTransientEnum
+	HydrologydcMaskEplactiveEltEnum
+	HydrologydcMaskEplactiveNodeEnum
+	HydrologydcMaskThawedEltEnum
+	HydrologydcMaskThawedNodeEnum
+	HydrologydcSedimentTransmitivityEnum
+	HydrologyDrainageRateEnum
+	HydrologyEnglacialInputEnum
+	HydrologyGapHeightEnum
+	HydrologyGapHeightXEnum
+	HydrologyGapHeightXXEnum
+	HydrologyGapHeightYEnum
+	HydrologyGapHeightYYEnum
+	HydrologyHeadEnum
+	HydrologyHeadOldEnum
+	HydrologyMoulinInputEnum
+	HydrologyNeumannfluxEnum
+	HydrologyReynoldsEnum
+	HydrologySheetConductivityEnum
+	HydrologySheetThicknessEnum
+	HydrologySheetThicknessOldEnum
+	HydrologyTwsEnum
+	HydrologyTwsSpcEnum
+	HydrologyTwsAnalysisEnum
+	HydrologyWatercolumnMaxEnum
+	HydrologyWaterVxEnum
+	HydrologyWaterVyEnum
+	IceEnum
+	IceMaskNodeActivationEnum
+	InputEnum
+	InversionCostFunctionsCoefficientsEnum
+	InversionSurfaceObsEnum
+	InversionThicknessObsEnum
+	InversionVelObsEnum
+	InversionVxObsEnum
+	InversionVyObsEnum
+	LevelsetfunctionSlopeXEnum
+	LevelsetfunctionSlopeYEnum
+	LevelsetObservationEnum
+	LoadingforceXEnum
+	LoadingforceYEnum
+	LoadingforceZEnum
+	MaskOceanLevelsetEnum
+	MaskIceLevelsetEnum
+	MaskIceRefLevelsetEnum
+	MasstransportSpcthicknessEnum
+	MaterialsRheologyBEnum
+	MaterialsRheologyBbarEnum
+	MaterialsRheologyEEnum
+	MaterialsRheologyEbarEnum
+	MaterialsRheologyEcEnum
+	MaterialsRheologyEcbarEnum
+	MaterialsRheologyEsEnum
+	MaterialsRheologyEsbarEnum
+	MaterialsRheologyNEnum
+	MeshScaleFactorEnum
+	MeshVertexonbaseEnum
+	MeshVertexonboundaryEnum
+	MeshVertexonsurfaceEnum
+	MisfitEnum
+	MovingFrontalVxEnum
+	MovingFrontalVyEnum
+	NeumannfluxEnum
+	NewDamageEnum
+	NodeEnum
+	OmegaAbsGradientEnum
+	OceantransportSpcbottompressureEnum
+	OceantransportSpcstrEnum
+	OceantransportSpcdslEnum
+	P0Enum
+	P1Enum
+	PartitioningEnum
+	PressureEnum
+	RadarEnum
+	RadarAttenuationMacGregorEnum
+	RadarAttenuationWolffEnum
+	RadarIcePeriodEnum
+	RadarPowerMacGregorEnum
+	RadarPowerWolffEnum
+	RheologyBAbsGradientEnum
+	RheologyBInitialguessEnum
+	RheologyBInitialguessMisfitEnum
+	RheologyBbarAbsGradientEnum
+	SampleEnum
+	SamplingBetaEnum
+	SamplingKappaEnum
+	SealevelEnum
+	SealevelGRDEnum
+	SealevelBarystaticMaskEnum
+	SealevelBarystaticIceMaskEnum
+	SealevelBarystaticIceWeightsEnum
+	SealevelBarystaticIceAreaEnum
+	SealevelBarystaticIceLatbarEnum
+	SealevelBarystaticIceLongbarEnum
+	SealevelBarystaticIceLoadEnum
+	SealevelBarystaticHydroMaskEnum
+	SealevelBarystaticHydroWeightsEnum
+	SealevelBarystaticHydroAreaEnum
+	SealevelBarystaticHydroLatbarEnum
+	SealevelBarystaticHydroLongbarEnum
+	SealevelBarystaticHydroLoadEnum
+	SealevelBarystaticBpMaskEnum
+	SealevelBarystaticBpWeightsEnum
+	SealevelBarystaticBpAreaEnum
+	SealevelBarystaticBpLoadEnum
+	SealevelBarystaticOceanMaskEnum
+	SealevelBarystaticOceanWeightsEnum
+	SealevelBarystaticOceanAreaEnum
+	SealevelBarystaticOceanLatbarEnum
+	SealevelBarystaticOceanLongbarEnum
+	SealevelBarystaticOceanLoadEnum
+	SealevelNEsaEnum
+	SealevelNEsaRateEnum
+	SealevelRSLEnum
+	BslcEnum
+	BslcIceEnum
+	BslcHydroEnum
+	BslcOceanEnum
+	BslcRateEnum
+	GmtslcEnum
+	SealevelGrotm1Enum
+	SealevelGrotm2Enum
+	SealevelGrotm3Enum
+	SealevelGUrotm1Enum
+	SealevelGUrotm2Enum
+	SealevelGUrotm3Enum
+	SealevelGNrotm1Enum
+	SealevelGNrotm2Enum
+	SealevelGNrotm3Enum
+	SealevelGErotm1Enum
+	SealevelGErotm2Enum
+	SealevelGErotm3Enum
+	SealevelRSLBarystaticEnum
+	SealevelRSLRateEnum
+	SealevelUGrdEnum
+	SealevelNGrdEnum
+	SealevelUEastEsaEnum
+	SealevelUNorthEsaEnum
+	SealevelchangeIndicesEnum
+	SealevelchangeGEnum
+	SealevelchangeGUEnum
+	SealevelchangeGEEnum
+	SealevelchangeGNEnum
+	SealevelchangeGsubelOceanEnum
+	SealevelchangeGUsubelOceanEnum
+	SealevelchangeGEsubelOceanEnum
+	SealevelchangeGNsubelOceanEnum
+	SealevelchangeGsubelIceEnum
+	SealevelchangeGUsubelIceEnum
+	SealevelchangeGEsubelIceEnum
+	SealevelchangeGNsubelIceEnum
+	SealevelchangeGsubelHydroEnum
+	SealevelchangeGUsubelHydroEnum
+	SealevelchangeGEsubelHydroEnum
+	SealevelchangeGNsubelHydroEnum
+	SealevelchangeViscousRSLEnum
+	SealevelchangeViscousUEnum
+	SealevelchangeViscousNEnum
+	SealevelchangeViscousEEnum
+	SedimentHeadEnum
+	SedimentHeadOldEnum
+	SedimentHeadSubstepEnum
+	SedimentHeadTransientEnum
+	SedimentHeadResidualEnum
+	SedimentHeadStackedEnum
+	SigmaNNEnum
+	SigmaVMEnum
+	SmbAccumulatedECEnum
+	SmbAccumulatedMassBalanceEnum
+	SmbAccumulatedMeltEnum
+	SmbAccumulatedPrecipitationEnum
+	SmbAccumulatedRainEnum
+	SmbAccumulatedRefreezeEnum
+	SmbAccumulatedRunoffEnum
+	SmbAEnum
+	SmbAdiffEnum
+	SmbAValueEnum
+	SmbAccumulationEnum
+	SmbAdiffiniEnum
+	SmbAiniEnum
+	SmbAutoregressionNoiseEnum
+	SmbBasinsIdEnum
+	SmbBMaxEnum
+	SmbBMinEnum
+	SmbBNegEnum
+	SmbBPosEnum
+	SmbCEnum
+	SmbCcsnowValueEnum
+	SmbCciceValueEnum
+	SmbCotValueEnum
+	SmbDEnum
+	SmbDailyairdensityEnum
+	SmbDailyairhumidityEnum
+	SmbDailydlradiationEnum
+	SmbDailydsradiationEnum
+	SmbDailypressureEnum
+	SmbDailyrainfallEnum
+	SmbDailysnowfallEnum
+	SmbDailytemperatureEnum
+	SmbDailywindspeedEnum
+	SmbDiniEnum
+	SmbDlwrfEnum
+	SmbDulwrfValueEnum
+	SmbDswrfEnum
+	SmbDswdiffrfEnum
+	SmbDzAddEnum
+	SmbDzEnum
+	SmbDzMinEnum
+	SmbDzTopEnum
+	SmbDziniEnum
+	SmbEAirEnum
+	SmbECEnum
+	SmbECDtEnum
+	SmbECiniEnum
+	SmbElaEnum
+	SmbEvaporationEnum
+	SmbFACEnum
+	SmbGdnEnum
+	SmbGdniniEnum
+	SmbGspEnum
+	SmbGspiniEnum
+	SmbHrefEnum
+	SmbIsInitializedEnum
+	SmbMAddEnum
+	SmbMassBalanceEnum
+	SmbMassBalanceSubstepEnum
+	SmbMassBalanceTransientEnum
+	SmbMeanLHFEnum
+	SmbMeanSHFEnum
+	SmbMeanULWEnum
+	SmbMeltEnum
+	SmbMonthlytemperaturesEnum
+	SmbMSurfEnum
+	SmbNetLWEnum
+	SmbNetSWEnum
+	SmbPAirEnum
+	SmbPEnum
+	SmbPddfacIceEnum
+	SmbPddfacSnowEnum
+	SmbPrecipitationEnum
+	SmbPrecipitationsAnomalyEnum
+	SmbPrecipitationsLgmEnum
+	SmbPrecipitationsPresentdayEnum
+	SmbPrecipitationsReconstructedEnum
+	SmbRainEnum
+	SmbReEnum
+	SmbRefreezeEnum
+	SmbReiniEnum
+	SmbRunoffEnum
+	SmbRunoffSubstepEnum
+	SmbRunoffTransientEnum
+	SmbS0gcmEnum
+	SmbS0pEnum
+	SmbS0tEnum
+	SmbSizeiniEnum
+	SmbSmbCorrEnum
+	SmbSmbrefEnum
+	SmbSzaValueEnum
+	SmbTEnum
+	SmbTaEnum
+	SmbTeValueEnum
+	SmbTemperaturesAnomalyEnum
+	SmbTemperaturesLgmEnum
+	SmbTemperaturesPresentdayEnum
+	SmbTemperaturesReconstructedEnum
+	SmbTiniEnum
+	SmbTmeanEnum
+	SmbTzEnum
+	SmbValuesAutoregressionEnum
+	SmbVEnum
+	SmbVmeanEnum
+	SmbVzEnum
+	SmbWEnum
+	SmbWAddEnum
+	SmbWiniEnum
+	SmbZMaxEnum
+	SmbZMinEnum
+	SmbZTopEnum
+	SmbZYEnum
+	SolidearthExternalDisplacementEastRateEnum
+	SolidearthExternalDisplacementNorthRateEnum
+	SolidearthExternalDisplacementUpRateEnum
+	SolidearthExternalGeoidRateEnum
+	StochasticForcingDefaultIdEnum
+	StrainRateeffectiveEnum
+	StrainRateparallelEnum
+	StrainRateperpendicularEnum
+	StrainRatexxEnum
+	StrainRatexyEnum
+	StrainRatexzEnum
+	StrainRateyyEnum
+	StrainRateyzEnum
+	StrainRatezzEnum
+	StressMaxPrincipalEnum
+	StressTensorxxEnum
+	StressTensorxyEnum
+	StressTensorxzEnum
+	StressTensoryyEnum
+	StressTensoryzEnum
+	StressTensorzzEnum
+	SurfaceAbsMisfitEnum
+	SurfaceAbsVelMisfitEnum
+	AreaEnum
+	SealevelAreaEnum
+	SurfaceAreaEnum
+	SurfaceAverageVelMisfitEnum
+	SurfaceCrevasseEnum
+	SurfaceEnum
+	SurfaceOldEnum
+	SurfaceLogVelMisfitEnum
+	SurfaceLogVxVyMisfitEnum
+	SurfaceObservationEnum
+	SurfaceRelVelMisfitEnum
+	SurfaceSlopeXEnum
+	SurfaceSlopeYEnum
+	TemperatureEnum
+	TemperaturePDDEnum
+	TemperaturePicardEnum
+	TemperatureSEMICEnum
+	ThermalforcingAutoregressionNoiseEnum
+	ThermalforcingValuesAutoregressionEnum
+	ThermalSpctemperatureEnum
+	ThicknessAbsGradientEnum
+	ThicknessAbsMisfitEnum
+	ThicknessAcrossGradientEnum
+	ThicknessAlongGradientEnum
+	ThicknessEnum
+	ThicknessOldEnum
+	ThicknessPositiveEnum
+	ThicknessResidualEnum
+	TransientAccumulatedDeltaIceThicknessEnum
+	VelEnum
+	VxAverageEnum
+	VxBaseEnum
+	VxEnum
+	VxMeshEnum
+	VxObsEnum
+	VxShearEnum
+	VxSurfaceEnum
+	VyAverageEnum
+	VyBaseEnum
+	VyEnum
+	VyMeshEnum
+	VyObsEnum
+	VyShearEnum
+	VySurfaceEnum
+	VzEnum
+	VzFSEnum
+	VzHOEnum
+	VzMeshEnum
+	VzSSAEnum
+	WaterColumnOldEnum
+	WatercolumnEnum
+	WaterfractionDrainageEnum
+	WaterfractionDrainageIntegratedEnum
+	WaterfractionEnum
+	WaterheightEnum
+	FrictionWaterPressureEnum
+	FrictionWaterPressureNoiseEnum
+	WeightsLevelsetObservationEnum
+	WeightsSurfaceObservationEnum
+	OldAccumulatedDeltaBottomPressureEnum
+	OldAccumulatedDeltaIceThicknessEnum
+	OldAccumulatedDeltaTwsEnum
+	Outputdefinition1Enum
+	Outputdefinition10Enum
+	Outputdefinition11Enum
+	Outputdefinition12Enum
+	Outputdefinition13Enum
+	Outputdefinition14Enum
+	Outputdefinition15Enum
+	Outputdefinition16Enum
+	Outputdefinition17Enum
+	Outputdefinition18Enum
+	Outputdefinition19Enum
+	Outputdefinition20Enum
+	Outputdefinition21Enum
+	Outputdefinition22Enum
+	Outputdefinition23Enum
+	Outputdefinition24Enum
+	Outputdefinition25Enum
+	Outputdefinition26Enum
+	Outputdefinition27Enum
+	Outputdefinition28Enum
+	Outputdefinition29Enum
+	Outputdefinition2Enum
+	Outputdefinition30Enum
+	Outputdefinition31Enum
+	Outputdefinition32Enum
+	Outputdefinition33Enum
+	Outputdefinition34Enum
+	Outputdefinition35Enum
+	Outputdefinition36Enum
+	Outputdefinition37Enum
+	Outputdefinition38Enum
+	Outputdefinition39Enum
+	Outputdefinition3Enum
+	Outputdefinition40Enum
+	Outputdefinition41Enum
+	Outputdefinition42Enum
+	Outputdefinition43Enum
+	Outputdefinition44Enum
+	Outputdefinition45Enum
+	Outputdefinition46Enum
+	Outputdefinition47Enum
+	Outputdefinition48Enum
+	Outputdefinition49Enum
+	Outputdefinition4Enum
+	Outputdefinition50Enum
+	Outputdefinition51Enum
+	Outputdefinition52Enum
+	Outputdefinition53Enum
+	Outputdefinition54Enum
+	Outputdefinition55Enum
+	Outputdefinition56Enum
+	Outputdefinition57Enum
+	Outputdefinition58Enum
+	Outputdefinition59Enum
+	Outputdefinition5Enum
+	Outputdefinition60Enum
+	Outputdefinition61Enum
+	Outputdefinition62Enum
+	Outputdefinition63Enum
+	Outputdefinition64Enum
+	Outputdefinition65Enum
+	Outputdefinition66Enum
+	Outputdefinition67Enum
+	Outputdefinition68Enum
+	Outputdefinition69Enum
+	Outputdefinition6Enum
+	Outputdefinition70Enum
+	Outputdefinition71Enum
+	Outputdefinition72Enum
+	Outputdefinition73Enum
+	Outputdefinition74Enum
+	Outputdefinition75Enum
+	Outputdefinition76Enum
+	Outputdefinition77Enum
+	Outputdefinition78Enum
+	Outputdefinition79Enum
+	Outputdefinition7Enum
+	Outputdefinition80Enum
+	Outputdefinition81Enum
+	Outputdefinition82Enum
+	Outputdefinition83Enum
+	Outputdefinition84Enum
+	Outputdefinition85Enum
+	Outputdefinition86Enum
+	Outputdefinition87Enum
+	Outputdefinition88Enum
+	Outputdefinition89Enum
+	Outputdefinition8Enum
+	Outputdefinition90Enum
+	Outputdefinition91Enum
+	Outputdefinition92Enum
+	Outputdefinition93Enum
+	Outputdefinition94Enum
+	Outputdefinition95Enum
+	Outputdefinition96Enum
+	Outputdefinition97Enum
+	Outputdefinition98Enum
+	Outputdefinition99Enum
+	Outputdefinition9Enum
+	Outputdefinition100Enum
+	InputsENDEnum
+	AbsoluteEnum
+	AdaptiveTimesteppingEnum
+	AdjointBalancethickness2AnalysisEnum
+	AdjointBalancethicknessAnalysisEnum
+	AdjointHorizAnalysisEnum
+	AggressiveMigrationEnum
+	AmrBamgEnum
+	AmrNeopzEnum
+	AndroidFrictionCoefficientEnum
+	ArrheniusEnum
+	AutodiffJacobianEnum
+	Balancethickness2AnalysisEnum
+	Balancethickness2SolutionEnum
+	BalancethicknessAnalysisEnum
+	BalancethicknessApparentMassbalanceEnum
+	BalancethicknessSoftAnalysisEnum
+	BalancethicknessSoftSolutionEnum
+	BalancethicknessSolutionEnum
+	BalancevelocityAnalysisEnum
+	BalancevelocitySolutionEnum
+	BasalforcingsIsmip6Enum
+	BasalforcingsPicoEnum
+	BeckmannGoosseFloatingMeltRateEnum
+	BedSlopeSolutionEnum
+	BoolExternalResultEnum
+	BoolInputEnum
+	IntInputEnum
+	DoubleInputEnum
+	BoolParamEnum
+	BoundaryEnum
+	BuddJackaEnum
+	CalvingDev2Enum
+	CalvingHabEnum
+	CalvingLevermannEnum
+	CalvingVonmisesEnum
+	CfdragcoeffabsgradEnum
+	CfsurfacelogvelEnum
+	CfsurfacesquareEnum
+	CflevelsetmisfitEnum
+	ChannelEnum
+	ChannelAreaEnum
+	ChannelAreaOldEnum
+	ChannelDischargeEnum
+	ClosedEnum
+	ColinearEnum
+	ConstraintsEnum
+	ContactEnum
+	ContourEnum
+	ContoursEnum
+	ControlInputEnum
+	ControlInputGradEnum
+	ControlInputMaxsEnum
+	ControlInputMinsEnum
+	ControlInputValuesEnum
+	CrouzeixRaviartEnum
+	CuffeyEnum
+	CuffeyTemperateEnum
+	DamageEvolutionAnalysisEnum
+	DamageEvolutionSolutionEnum
+	DataSetEnum
+	DataSetParamEnum
+	DatasetInputEnum
+	DefaultAnalysisEnum
+	DefaultCalvingEnum
+	DenseEnum
+	DependentObjectEnum
+	DepthAverageAnalysisEnum
+	DeviatoricStressErrorEstimatorEnum
+	DivergenceEnum
+	Domain3DsurfaceEnum
+	DoubleArrayInputEnum
+	ArrayInputEnum
+	DoubleExternalResultEnum
+	DoubleMatArrayParamEnum
+	DoubleMatExternalResultEnum
+	DoubleMatParamEnum
+	DoubleParamEnum
+	DoubleVecParamEnum
+	ElementEnum
+	ElementHookEnum
+	ElementSIdEnum
+	EnthalpyAnalysisEnum
+	EsaAnalysisEnum
+	EsaSolutionEnum
+	EsaTransitionsEnum
+	ExternalResultEnum
+	ExtrapolationAnalysisEnum
+	ExtrudeFromBaseAnalysisEnum
+	ExtrudeFromTopAnalysisEnum
+	FSApproximationEnum
+	FSSolverEnum
+	FSpressureEnum
+	FSvelocityEnum
+	FemModelEnum
+	FileParamEnum
+	FixedTimesteppingEnum
+	FloatingAreaEnum
+	FloatingAreaScaledEnum
+	FloatingMeltRateEnum
+	FreeEnum
+	FreeSurfaceBaseAnalysisEnum
+	FreeSurfaceTopAnalysisEnum
+	FrontalForcingsDefaultEnum
+	FrontalForcingsRignotEnum
+	FrontalForcingsRignotAutoregressionEnum
+	FsetEnum
+	FullMeltOnPartiallyFloatingEnum
+	GLheightadvectionAnalysisEnum
+	GaussPentaEnum
+	GaussSegEnum
+	GaussTetraEnum
+	GaussTriaEnum
+	GenericOptionEnum
+	GenericParamEnum
+	GenericExternalResultEnum
+	Gradient1Enum
+	Gradient2Enum
+	Gradient3Enum
+	Gradient4Enum
+	GroundedAreaEnum
+	GroundedAreaScaledEnum
+	GroundingOnlyEnum
+	GroundinglineMassFluxEnum
+	GsetEnum
+	GslEnum
+	HOApproximationEnum
+	HOFSApproximationEnum
+	HookEnum
+	HydrologyDCEfficientAnalysisEnum
+	HydrologyDCInefficientAnalysisEnum
+	HydrologyGlaDSAnalysisEnum
+	HydrologyGlaDSEnum
+	HydrologyPismAnalysisEnum
+	HydrologyShaktiAnalysisEnum
+	HydrologyShreveAnalysisEnum
+	HydrologySolutionEnum
+	HydrologydcEnum
+	HydrologypismEnum
+	HydrologyshaktiEnum
+	HydrologyshreveEnum
+	IceMassEnum
+	IceMassScaledEnum
+	IceVolumeAboveFloatationEnum
+	IceVolumeAboveFloatationScaledEnum
+	IceVolumeEnum
+	IceVolumeScaledEnum
+	IcefrontMassFluxEnum
+	IcefrontMassFluxLevelsetEnum
+	IncrementalEnum
+	IndexedEnum
+	IntExternalResultEnum
+	ElementInputEnum
+	IntMatExternalResultEnum
+	IntMatParamEnum
+	IntParamEnum
+	IntVecParamEnum
+	InputsEnum
+	InternalEnum
+	IntersectEnum
+	InversionVzObsEnum
+	JEnum
+	L1L2ApproximationEnum
+	MLHOApproximationEnum
+	L2ProjectionBaseAnalysisEnum
+	L2ProjectionEPLAnalysisEnum
+	LACrouzeixRaviartEnum
+	LATaylorHoodEnum
+	LambdaSEnum
+	LevelsetAnalysisEnum
+	LevelsetfunctionPicardEnum
+	LinearFloatingMeltRateEnum
+	LliboutryDuvalEnum
+	LoadsEnum
+	LoveAnalysisEnum
+	LoveHiEnum
+	LoveHrEnum
+	LoveKernelsImagEnum
+	LoveKernelsRealEnum
+	LoveKiEnum
+	LoveKrEnum
+	LoveLiEnum
+	LoveLrEnum
+	LoveSolutionEnum
+	MINIEnum
+	MINIcondensedEnum
+	MantlePlumeGeothermalFluxEnum
+	MassFluxEnum
+	MassconEnum
+	MassconaxpbyEnum
+	MassfluxatgateEnum
+	MasstransportAnalysisEnum
+	MasstransportSolutionEnum
+	MatdamageiceEnum
+	MatenhancediceEnum
+	MaterialsEnum
+	MatestarEnum
+	MaticeEnum
+	MatlithoEnum
+	MathydroEnum
+	MatrixParamEnum
+	MaxAbsVxEnum
+	MaxAbsVyEnum
+	MaxAbsVzEnum
+	MaxDivergenceEnum
+	MaxVelEnum
+	MaxVxEnum
+	MaxVyEnum
+	MaxVzEnum
+	MelangeEnum
+	MeltingAnalysisEnum
+	MeshElementsEnum
+	MeshXEnum
+	MeshYEnum
+	MinVelEnum
+	MinVxEnum
+	MinVyEnum
+	MinVzEnum
+	MismipFloatingMeltRateEnum
+	MoulinEnum
+	MpiDenseEnum
+	MpiEnum
+	MpiSparseEnum
+	MumpsEnum
+	NoFrictionOnPartiallyFloatingEnum
+	NoMeltOnPartiallyFloatingEnum
+	NodalEnum
+	NodalvalueEnum
+	NodeSIdEnum
+	NoneApproximationEnum
+	NoneEnum
+	NumberedcostfunctionEnum
+	NyeCO2Enum
+	NyeH2OEnum
+	NumericalfluxEnum
+	OceantransportAnalysisEnum
+	OceantransportSolutionEnum
+	OldGradientEnum
+	OneLayerP4zEnum
+	OpenEnum
+	OptionEnum
+	ParamEnum
+	ParametersEnum
+	P0ArrayEnum
+	P0DGEnum
+	P1DGEnum
+	P1P1Enum
+	P1P1GLSEnum
+	P1bubbleEnum
+	P1bubblecondensedEnum
+	P1xP2Enum
+	P1xP3Enum
+	P1xP4Enum
+	P2Enum
+	P2bubbleEnum
+	P2bubblecondensedEnum
+	P2xP1Enum
+	P2xP4Enum
+	PatersonEnum
+	PengridEnum
+	PenpairEnum
+	PentaEnum
+	PentaInputEnum
+	ProfilerEnum
+	ProfilingCurrentFlopsEnum
+	ProfilingCurrentMemEnum
+	ProfilingSolutionTimeEnum
+	RegionaloutputEnum
+	RegularEnum
+	RecoveryAnalysisEnum
+	RiftfrontEnum
+	SamplingAnalysisEnum
+	SamplingSolutionEnum
+	SIAApproximationEnum
+	SMBautoregressionEnum
+	SMBcomponentsEnum
+	SMBd18opddEnum
+	SMBforcingEnum
+	SMBgcmEnum
+	SMBgembEnum
+	SMBgradientsEnum
+	SMBgradientscomponentsEnum
+	SMBgradientselaEnum
+	SMBhenningEnum
+	SMBmeltcomponentsEnum
+	SMBpddEnum
+	SMBpddSicopolisEnum
+	SMBsemicEnum
+	SSAApproximationEnum
+	SSAFSApproximationEnum
+	SSAHOApproximationEnum
+	ScaledEnum
+	SealevelAbsoluteEnum
+	SealevelEmotionEnum
+	SealevelInertiaTensorXZEnum
+	SealevelInertiaTensorYZEnum
+	SealevelInertiaTensorZZEnum
+	SealevelchangePolarMotionEnum
+	SealevelNmotionEnum
+	SealevelUmotionEnum
+	SealevelchangeAnalysisEnum
+	SegEnum
+	SegInputEnum
+	SegmentEnum
+	SegmentRiftfrontEnum
+	SeparateEnum
+	SeqEnum
+	SmbAnalysisEnum
+	SmbSolutionEnum
+	SmoothAnalysisEnum
+	SoftMigrationEnum
+	SpatialLinearFloatingMeltRateEnum
+	SpcDynamicEnum
+	SpcStaticEnum
+	SpcTransientEnum
+	SsetEnum
+	StatisticsSolutionEnum
+	SteadystateSolutionEnum
+	StressIntensityFactorEnum
+	StressbalanceAnalysisEnum
+	StressbalanceConvergenceNumStepsEnum
+	StressbalanceSIAAnalysisEnum
+	StressbalanceSolutionEnum
+	StressbalanceVerticalAnalysisEnum
+	StringArrayParamEnum
+	StringExternalResultEnum
+	StringParamEnum
+	SubelementFriction1Enum
+	SubelementFriction2Enum
+	SubelementMelt1Enum
+	SubelementMelt2Enum
+	SubelementMigrationEnum
+	SurfaceSlopeSolutionEnum
+	TaylorHoodEnum
+	TetraEnum
+	TetraInputEnum
+	ThermalAnalysisEnum
+	ThermalSolutionEnum
+	ThicknessErrorEstimatorEnum
+	TotalCalvingFluxLevelsetEnum
+	TotalCalvingMeltingFluxLevelsetEnum
+	TotalFloatingBmbEnum
+	TotalFloatingBmbScaledEnum
+	TotalGroundedBmbEnum
+	TotalGroundedBmbScaledEnum
+	TotalSmbEnum
+	TotalSmbScaledEnum
+	TransientArrayParamEnum
+	TransientInputEnum
+	TransientParamEnum
+	TransientSolutionEnum
+	TriaEnum
+	TriaInputEnum
+	UzawaPressureAnalysisEnum
+	VectorParamEnum
+	VertexEnum
+	VertexLIdEnum
+	VertexPIdEnum
+	VertexSIdEnum
+	VerticesEnum
+	ViscousHeatingEnum
+	WaterEnum
+	XTaylorHoodEnum
+	XYEnum
+	XYZEnum
+	BalancethicknessD0Enum
+	BalancethicknessDiffusionCoefficientEnum
+	BilinearInterpEnum
+	CalvingdevCoeffEnum
+	DeviatoricStressEnum
+	EtaAbsGradientEnum
+	MeshZEnum
+	NearestInterpEnum
+	OutputdefinitionListEnum
+	SealevelObsEnum
+	SealevelWeightsEnum
+	StrainRateEnum
+	StressTensorEnum
+	StressbalanceViscosityOvershootEnum
+	SubelementMigration4Enum
+	TimesteppingTimeAdaptEnum
+	TriangleInterpEnum
+	MaximumNumberOfDefinitionsEnum
+end
+
+function EnumToString(enum::IssmEnum)
+	if(enum==ParametersSTARTEnum) return "ParametersSTART" end
+	if(enum==AdolcParamEnum) return "AdolcParam" end
+	if(enum==AmrDeviatoricErrorGroupThresholdEnum) return "AmrDeviatoricErrorGroupThreshold" end
+	if(enum==AmrDeviatoricErrorMaximumEnum) return "AmrDeviatoricErrorMaximum" end
+	if(enum==AmrDeviatoricErrorResolutionEnum) return "AmrDeviatoricErrorResolution" end
+	if(enum==AmrDeviatoricErrorThresholdEnum) return "AmrDeviatoricErrorThreshold" end
+	if(enum==AmrErrEnum) return "AmrErr" end
+	if(enum==AmrFieldEnum) return "AmrField" end
+	if(enum==AmrGradationEnum) return "AmrGradation" end
+	if(enum==AmrGroundingLineDistanceEnum) return "AmrGroundingLineDistance" end
+	if(enum==AmrGroundingLineResolutionEnum) return "AmrGroundingLineResolution" end
+	if(enum==AmrHmaxEnum) return "AmrHmax" end
+	if(enum==AmrHminEnum) return "AmrHmin" end
+	if(enum==AmrIceFrontDistanceEnum) return "AmrIceFrontDistance" end
+	if(enum==AmrIceFrontResolutionEnum) return "AmrIceFrontResolution" end
+	if(enum==AmrKeepMetricEnum) return "AmrKeepMetric" end
+	if(enum==AmrLagEnum) return "AmrLag" end
+	if(enum==AmrLevelMaxEnum) return "AmrLevelMax" end
+	if(enum==AmrRestartEnum) return "AmrRestart" end
+	if(enum==AmrThicknessErrorGroupThresholdEnum) return "AmrThicknessErrorGroupThreshold" end
+	if(enum==AmrThicknessErrorMaximumEnum) return "AmrThicknessErrorMaximum" end
+	if(enum==AmrThicknessErrorResolutionEnum) return "AmrThicknessErrorResolution" end
+	if(enum==AmrThicknessErrorThresholdEnum) return "AmrThicknessErrorThreshold" end
+	if(enum==AmrTypeEnum) return "AmrType" end
+	if(enum==AnalysisCounterEnum) return "AnalysisCounter" end
+	if(enum==AnalysisTypeEnum) return "AnalysisType" end
+	if(enum==AugmentedLagrangianREnum) return "AugmentedLagrangianR" end
+	if(enum==AugmentedLagrangianRholambdaEnum) return "AugmentedLagrangianRholambda" end
+	if(enum==AugmentedLagrangianRhopEnum) return "AugmentedLagrangianRhop" end
+	if(enum==AugmentedLagrangianRlambdaEnum) return "AugmentedLagrangianRlambda" end
+	if(enum==AugmentedLagrangianThetaEnum) return "AugmentedLagrangianTheta" end
+	if(enum==AutodiffCbufsizeEnum) return "AutodiffCbufsize" end
+	if(enum==AutodiffDependentObjectsEnum) return "AutodiffDependentObjects" end
+	if(enum==AutodiffDriverEnum) return "AutodiffDriver" end
+	if(enum==AutodiffFosForwardIndexEnum) return "AutodiffFosForwardIndex" end
+	if(enum==AutodiffFosReverseIndexEnum) return "AutodiffFosReverseIndex" end
+	if(enum==AutodiffFovForwardIndicesEnum) return "AutodiffFovForwardIndices" end
+	if(enum==AutodiffGcTriggerMaxSizeEnum) return "AutodiffGcTriggerMaxSize" end
+	if(enum==AutodiffGcTriggerRatioEnum) return "AutodiffGcTriggerRatio" end
+	if(enum==AutodiffIsautodiffEnum) return "AutodiffIsautodiff" end
+	if(enum==AutodiffLbufsizeEnum) return "AutodiffLbufsize" end
+	if(enum==AutodiffNumDependentsEnum) return "AutodiffNumDependents" end
+	if(enum==AutodiffNumIndependentsEnum) return "AutodiffNumIndependents" end
+	if(enum==AutodiffObufsizeEnum) return "AutodiffObufsize" end
+	if(enum==AutodiffTapeAllocEnum) return "AutodiffTapeAlloc" end
+	if(enum==AutodiffTbufsizeEnum) return "AutodiffTbufsize" end
+	if(enum==AutodiffXpEnum) return "AutodiffXp" end
+	if(enum==BalancethicknessStabilizationEnum) return "BalancethicknessStabilization" end
+	if(enum==BarystaticContributionsEnum) return "BarystaticContributions" end
+	if(enum==BasalforcingsBottomplumedepthEnum) return "BasalforcingsBottomplumedepth" end
+	if(enum==BasalforcingsCrustthicknessEnum) return "BasalforcingsCrustthickness" end
+	if(enum==BasalforcingsDeepwaterElevationEnum) return "BasalforcingsDeepwaterElevation" end
+	if(enum==BasalforcingsDeepwaterMeltingRateEnum) return "BasalforcingsDeepwaterMeltingRate" end
+	if(enum==BasalforcingsDtbgEnum) return "BasalforcingsDtbg" end
+	if(enum==BasalforcingsEnum) return "Basalforcings" end
+	if(enum==BasalforcingsIsmip6AverageTfEnum) return "BasalforcingsIsmip6AverageTf" end
+	if(enum==BasalforcingsIsmip6BasinAreaEnum) return "BasalforcingsIsmip6BasinArea" end
+	if(enum==BasalforcingsIsmip6DeltaTEnum) return "BasalforcingsIsmip6DeltaT" end
+	if(enum==BasalforcingsIsmip6Gamma0Enum) return "BasalforcingsIsmip6Gamma0" end
+	if(enum==BasalforcingsIsmip6IsLocalEnum) return "BasalforcingsIsmip6IsLocal" end
+	if(enum==BasalforcingsIsmip6NumBasinsEnum) return "BasalforcingsIsmip6NumBasins" end
+	if(enum==BasalforcingsIsmip6TfDepthsEnum) return "BasalforcingsIsmip6TfDepths" end
+	if(enum==BasalforcingsLowercrustheatEnum) return "BasalforcingsLowercrustheat" end
+	if(enum==BasalforcingsMantleconductivityEnum) return "BasalforcingsMantleconductivity" end
+	if(enum==BasalforcingsNusseltEnum) return "BasalforcingsNusselt" end
+	if(enum==BasalforcingsPicoAverageOverturningEnum) return "BasalforcingsPicoAverageOverturning" end
+	if(enum==BasalforcingsPicoAverageSalinityEnum) return "BasalforcingsPicoAverageSalinity" end
+	if(enum==BasalforcingsPicoAverageTemperatureEnum) return "BasalforcingsPicoAverageTemperature" end
+	if(enum==BasalforcingsPicoBoxAreaEnum) return "BasalforcingsPicoBoxArea" end
+	if(enum==BasalforcingsPicoFarOceansalinityEnum) return "BasalforcingsPicoFarOceansalinity" end
+	if(enum==BasalforcingsPicoFarOceantemperatureEnum) return "BasalforcingsPicoFarOceantemperature" end
+	if(enum==BasalforcingsPicoGammaTEnum) return "BasalforcingsPicoGammaT" end
+	if(enum==BasalforcingsPicoIsplumeEnum) return "BasalforcingsPicoIsplume" end
+	if(enum==BasalforcingsPicoMaxboxcountEnum) return "BasalforcingsPicoMaxboxcount" end
+	if(enum==BasalforcingsPicoNumBasinsEnum) return "BasalforcingsPicoNumBasins" end
+	if(enum==BasalforcingsPlumeradiusEnum) return "BasalforcingsPlumeradius" end
+	if(enum==BasalforcingsPlumexEnum) return "BasalforcingsPlumex" end
+	if(enum==BasalforcingsPlumeyEnum) return "BasalforcingsPlumey" end
+	if(enum==BasalforcingsThresholdThicknessEnum) return "BasalforcingsThresholdThickness" end
+	if(enum==BasalforcingsTopplumedepthEnum) return "BasalforcingsTopplumedepth" end
+	if(enum==BasalforcingsUppercrustheatEnum) return "BasalforcingsUppercrustheat" end
+	if(enum==BasalforcingsUppercrustthicknessEnum) return "BasalforcingsUppercrustthickness" end
+	if(enum==BasalforcingsUpperdepthMeltEnum) return "BasalforcingsUpperdepthMelt" end
+	if(enum==BasalforcingsUpperwaterElevationEnum) return "BasalforcingsUpperwaterElevation" end
+	if(enum==BasalforcingsUpperwaterMeltingRateEnum) return "BasalforcingsUpperwaterMeltingRate" end
+	if(enum==CalvingCrevasseDepthEnum) return "CalvingCrevasseDepth" end
+	if(enum==CalvingCrevasseThresholdEnum) return "CalvingCrevasseThreshold" end
+	if(enum==CalvingHeightAboveFloatationEnum) return "CalvingHeightAboveFloatation" end
+	if(enum==CalvingLawEnum) return "CalvingLaw" end
+	if(enum==CalvingMinthicknessEnum) return "CalvingMinthickness" end
+	if(enum==ConfigurationTypeEnum) return "ConfigurationType" end
+	if(enum==ConstantsGEnum) return "ConstantsG" end
+	if(enum==ConstantsNewtonGravityEnum) return "ConstantsNewtonGravity" end
+	if(enum==ConstantsReferencetemperatureEnum) return "ConstantsReferencetemperature" end
+	if(enum==ConstantsYtsEnum) return "ConstantsYts" end
+	if(enum==ControlInputSizeMEnum) return "ControlInputSizeM" end
+	if(enum==ControlInputSizeNEnum) return "ControlInputSizeN" end
+	if(enum==ControlInputInterpolationEnum) return "ControlInputInterpolation" end
+	if(enum==CumBslcEnum) return "CumBslc" end
+	if(enum==CumBslcIceEnum) return "CumBslcIce" end
+	if(enum==CumBslcHydroEnum) return "CumBslcHydro" end
+	if(enum==CumBslcOceanEnum) return "CumBslcOcean" end
+	if(enum==CumBslcIcePartitionEnum) return "CumBslcIcePartition" end
+	if(enum==CumBslcHydroPartitionEnum) return "CumBslcHydroPartition" end
+	if(enum==CumBslcOceanPartitionEnum) return "CumBslcOceanPartition" end
+	if(enum==CumGmtslcEnum) return "CumGmtslc" end
+	if(enum==CumGmslcEnum) return "CumGmslc" end
+	if(enum==DamageC1Enum) return "DamageC1" end
+	if(enum==DamageC2Enum) return "DamageC2" end
+	if(enum==DamageC3Enum) return "DamageC3" end
+	if(enum==DamageC4Enum) return "DamageC4" end
+	if(enum==DamageEnum) return "Damage" end
+	if(enum==DamageEquivStressEnum) return "DamageEquivStress" end
+	if(enum==DamageEvolutionNumRequestedOutputsEnum) return "DamageEvolutionNumRequestedOutputs" end
+	if(enum==DamageEvolutionRequestedOutputsEnum) return "DamageEvolutionRequestedOutputs" end
+	if(enum==DamageHealingEnum) return "DamageHealing" end
+	if(enum==DamageKappaEnum) return "DamageKappa" end
+	if(enum==DamageLawEnum) return "DamageLaw" end
+	if(enum==DamageMaxDamageEnum) return "DamageMaxDamage" end
+	if(enum==DamageStabilizationEnum) return "DamageStabilization" end
+	if(enum==DamageStressThresholdEnum) return "DamageStressThreshold" end
+	if(enum==DamageStressUBoundEnum) return "DamageStressUBound" end
+	if(enum==DebugProfilingEnum) return "DebugProfiling" end
+	if(enum==DomainDimensionEnum) return "DomainDimension" end
+	if(enum==DomainTypeEnum) return "DomainType" end
+	if(enum==DslModelEnum) return "DslModel" end
+	if(enum==DslModelidEnum) return "DslModelid" end
+	if(enum==DslNummodelsEnum) return "DslNummodels" end
+	if(enum==SolidearthIsExternalEnum) return "SolidearthIsExternal" end
+	if(enum==SolidearthExternalNatureEnum) return "SolidearthExternalNature" end
+	if(enum==SolidearthExternalModelidEnum) return "SolidearthExternalModelid" end
+	if(enum==SolidearthExternalNummodelsEnum) return "SolidearthExternalNummodels" end
+	if(enum==SolidearthSettingsComputeBpGrdEnum) return "SolidearthSettingsComputeBpGrd" end
+	if(enum==EarthIdEnum) return "EarthId" end
+	if(enum==ElasticEnum) return "Elastic" end
+	if(enum==EplZigZagCounterEnum) return "EplZigZagCounter" end
+	if(enum==EsaHElasticEnum) return "EsaHElastic" end
+	if(enum==EsaHemisphereEnum) return "EsaHemisphere" end
+	if(enum==EsaRequestedOutputsEnum) return "EsaRequestedOutputs" end
+	if(enum==EsaUElasticEnum) return "EsaUElastic" end
+	if(enum==ExtrapolationVariableEnum) return "ExtrapolationVariable" end
+	if(enum==FemModelCommEnum) return "FemModelComm" end
+	if(enum==FieldsEnum) return "Fields" end
+	if(enum==FlowequationFeFSEnum) return "FlowequationFeFS" end
+	if(enum==FlowequationIsFSEnum) return "FlowequationIsFS" end
+	if(enum==FlowequationIsHOEnum) return "FlowequationIsHO" end
+	if(enum==FlowequationIsL1L2Enum) return "FlowequationIsL1L2" end
+	if(enum==FlowequationIsMLHOEnum) return "FlowequationIsMLHO" end
+	if(enum==FlowequationIsSIAEnum) return "FlowequationIsSIA" end
+	if(enum==FlowequationIsSSAEnum) return "FlowequationIsSSA" end
+	if(enum==FlowequationIsNitscheEnum) return "FlowequationIsNitsche" end
+	if(enum==FeFSNitscheGammaEnum) return "FeFSNitscheGamma" end
+	if(enum==FrictionCouplingEnum) return "FrictionCoupling" end
+	if(enum==FrictionDeltaEnum) return "FrictionDelta" end
+	if(enum==FrictionEffectivePressureLimitEnum) return "FrictionEffectivePressureLimit" end
+	if(enum==FrictionFEnum) return "FrictionF" end
+	if(enum==FrictionGammaEnum) return "FrictionGamma" end
+	if(enum==FrictionLawEnum) return "FrictionLaw" end
+	if(enum==FrictionPseudoplasticityExponentEnum) return "FrictionPseudoplasticityExponent" end
+	if(enum==FrictionThresholdSpeedEnum) return "FrictionThresholdSpeed" end
+	if(enum==FrictionVoidRatioEnum) return "FrictionVoidRatio" end
+	if(enum==FrontalForcingsBasinIcefrontAreaEnum) return "FrontalForcingsBasinIcefrontArea" end
+	if(enum==FrontalForcingsAutoregressionInitialTimeEnum) return "FrontalForcingsAutoregressionInitialTime" end
+	if(enum==FrontalForcingsAutoregressionTimestepEnum) return "FrontalForcingsAutoregressionTimestep" end
+	if(enum==FrontalForcingsAutoregressiveOrderEnum) return "FrontalForcingsAutoregressiveOrder" end
+	if(enum==FrontalForcingsBeta0Enum) return "FrontalForcingsBeta0" end
+	if(enum==FrontalForcingsBeta1Enum) return "FrontalForcingsBeta1" end
+	if(enum==FrontalForcingsNumberofBasinsEnum) return "FrontalForcingsNumberofBasins" end
+	if(enum==FrontalForcingsParamEnum) return "FrontalForcingsParam" end
+	if(enum==FrontalForcingsPhiEnum) return "FrontalForcingsPhi" end
+	if(enum==GrdModelEnum) return "GrdModel" end
+	if(enum==GroundinglineFrictionInterpolationEnum) return "GroundinglineFrictionInterpolation" end
+	if(enum==GroundinglineMeltInterpolationEnum) return "GroundinglineMeltInterpolation" end
+	if(enum==GroundinglineMigrationEnum) return "GroundinglineMigration" end
+	if(enum==HydrologyAveragingEnum) return "HydrologyAveraging" end
+	if(enum==HydrologyCavitySpacingEnum) return "HydrologyCavitySpacing" end
+	if(enum==HydrologyChannelConductivityEnum) return "HydrologyChannelConductivity" end
+	if(enum==HydrologyChannelSheetWidthEnum) return "HydrologyChannelSheetWidth" end
+	if(enum==HydrologyEnglacialVoidRatioEnum) return "HydrologyEnglacialVoidRatio" end
+	if(enum==HydrologyIschannelsEnum) return "HydrologyIschannels" end
+	if(enum==HydrologyMeltFlagEnum) return "HydrologyMeltFlag" end
+	if(enum==HydrologyModelEnum) return "HydrologyModel" end
+	if(enum==HydrologyNumRequestedOutputsEnum) return "HydrologyNumRequestedOutputs" end
+	if(enum==HydrologyPressureMeltCoefficientEnum) return "HydrologyPressureMeltCoefficient" end
+	if(enum==HydrologyRelaxationEnum) return "HydrologyRelaxation" end
+	if(enum==HydrologyRequestedOutputsEnum) return "HydrologyRequestedOutputs" end
+	if(enum==HydrologySedimentKmaxEnum) return "HydrologySedimentKmax" end
+	if(enum==HydrologyStepsPerStepEnum) return "HydrologyStepsPerStep" end
+	if(enum==HydrologyStorageEnum) return "HydrologyStorage" end
+	if(enum==HydrologydcEplColapseThicknessEnum) return "HydrologydcEplColapseThickness" end
+	if(enum==HydrologydcEplConductivityEnum) return "HydrologydcEplConductivity" end
+	if(enum==HydrologydcEplInitialThicknessEnum) return "HydrologydcEplInitialThickness" end
+	if(enum==HydrologydcEplLayerCompressibilityEnum) return "HydrologydcEplLayerCompressibility" end
+	if(enum==HydrologydcEplMaxThicknessEnum) return "HydrologydcEplMaxThickness" end
+	if(enum==HydrologydcEplPoreWaterMassEnum) return "HydrologydcEplPoreWaterMass" end
+	if(enum==HydrologydcEplThickCompEnum) return "HydrologydcEplThickComp" end
+	if(enum==HydrologydcEplflipLockEnum) return "HydrologydcEplflipLock" end
+	if(enum==HydrologydcIsefficientlayerEnum) return "HydrologydcIsefficientlayer" end
+	if(enum==HydrologydcLeakageFactorEnum) return "HydrologydcLeakageFactor" end
+	if(enum==HydrologydcMaxIterEnum) return "HydrologydcMaxIter" end
+	if(enum==HydrologydcPenaltyFactorEnum) return "HydrologydcPenaltyFactor" end
+	if(enum==HydrologydcPenaltyLockEnum) return "HydrologydcPenaltyLock" end
+	if(enum==HydrologydcRelTolEnum) return "HydrologydcRelTol" end
+	if(enum==HydrologydcSedimentlimitEnum) return "HydrologydcSedimentlimit" end
+	if(enum==HydrologydcSedimentlimitFlagEnum) return "HydrologydcSedimentlimitFlag" end
+	if(enum==HydrologydcSedimentLayerCompressibilityEnum) return "HydrologydcSedimentLayerCompressibility" end
+	if(enum==HydrologydcSedimentPoreWaterMassEnum) return "HydrologydcSedimentPoreWaterMass" end
+	if(enum==HydrologydcSedimentPorosityEnum) return "HydrologydcSedimentPorosity" end
+	if(enum==HydrologydcSedimentThicknessEnum) return "HydrologydcSedimentThickness" end
+	if(enum==HydrologydcTransferFlagEnum) return "HydrologydcTransferFlag" end
+	if(enum==HydrologydcUnconfinedFlagEnum) return "HydrologydcUnconfinedFlag" end
+	if(enum==HydrologyshreveStabilizationEnum) return "HydrologyshreveStabilization" end
+	if(enum==IcecapToEarthCommEnum) return "IcecapToEarthComm" end
+	if(enum==IndexEnum) return "Index" end
+	if(enum==InputFileNameEnum) return "InputFileName" end
+	if(enum==DirectoryNameEnum) return "DirectoryName" end
+	if(enum==IndicesEnum) return "Indices" end
+	if(enum==InputToDepthaverageInEnum) return "InputToDepthaverageIn" end
+	if(enum==InputToDepthaverageOutEnum) return "InputToDepthaverageOut" end
+	if(enum==InputToExtrudeEnum) return "InputToExtrude" end
+	if(enum==InputToL2ProjectEnum) return "InputToL2Project" end
+	if(enum==InputToSmoothEnum) return "InputToSmooth" end
+	if(enum==InversionAlgorithmEnum) return "InversionAlgorithm" end
+	if(enum==InversionControlParametersEnum) return "InversionControlParameters" end
+	if(enum==InversionControlScalingFactorsEnum) return "InversionControlScalingFactors" end
+	if(enum==InversionCostFunctionsEnum) return "InversionCostFunctions" end
+	if(enum==InversionDxminEnum) return "InversionDxmin" end
+	if(enum==InversionGatolEnum) return "InversionGatol" end
+	if(enum==InversionGradientScalingEnum) return "InversionGradientScaling" end
+	if(enum==InversionGrtolEnum) return "InversionGrtol" end
+	if(enum==InversionGttolEnum) return "InversionGttol" end
+	if(enum==InversionIncompleteAdjointEnum) return "InversionIncompleteAdjoint" end
+	if(enum==InversionIscontrolEnum) return "InversionIscontrol" end
+	if(enum==InversionMaxiterEnum) return "InversionMaxiter" end
+	if(enum==InversionMaxiterPerStepEnum) return "InversionMaxiterPerStep" end
+	if(enum==InversionMaxstepsEnum) return "InversionMaxsteps" end
+	if(enum==InversionNstepsEnum) return "InversionNsteps" end
+	if(enum==InversionNumControlParametersEnum) return "InversionNumControlParameters" end
+	if(enum==InversionNumCostFunctionsEnum) return "InversionNumCostFunctions" end
+	if(enum==InversionStepThresholdEnum) return "InversionStepThreshold" end
+	if(enum==InversionTypeEnum) return "InversionType" end
+	if(enum==IvinsEnum) return "Ivins" end
+	if(enum==IsSlcCouplingEnum) return "IsSlcCoupling" end
+	if(enum==LevelsetKillIcebergsEnum) return "LevelsetKillIcebergs" end
+	if(enum==LevelsetReinitFrequencyEnum) return "LevelsetReinitFrequency" end
+	if(enum==LevelsetStabilizationEnum) return "LevelsetStabilization" end
+	if(enum==LockFileNameEnum) return "LockFileName" end
+	if(enum==LoveAllowLayerDeletionEnum) return "LoveAllowLayerDeletion" end
+	if(enum==LoveCoreMantleBoundaryEnum) return "LoveCoreMantleBoundary" end
+	if(enum==LoveEarthMassEnum) return "LoveEarthMass" end
+	if(enum==LoveForcingTypeEnum) return "LoveForcingType" end
+	if(enum==LoveFrequenciesEnum) return "LoveFrequencies" end
+	if(enum==LoveIsTemporalEnum) return "LoveIsTemporal" end
+	if(enum==LoveG0Enum) return "LoveG0" end
+	if(enum==LoveGravitationalConstantEnum) return "LoveGravitationalConstant" end
+	if(enum==LoveInnerCoreBoundaryEnum) return "LoveInnerCoreBoundary" end
+	if(enum==LoveComplexComputationEnum) return "LoveComplexComputation" end
+	if(enum==LoveIntStepsPerLayerEnum) return "LoveIntStepsPerLayer" end
+	if(enum==LoveKernelsEnum) return "LoveKernels" end
+	if(enum==LoveMu0Enum) return "LoveMu0" end
+	if(enum==LoveNfreqEnum) return "LoveNfreq" end
+	if(enum==LoveNTemporalIterationsEnum) return "LoveNTemporalIterations" end
+	if(enum==LoveNYiEquationsEnum) return "LoveNYiEquations" end
+	if(enum==LoveR0Enum) return "LoveR0" end
+	if(enum==LoveShNmaxEnum) return "LoveShNmax" end
+	if(enum==LoveShNminEnum) return "LoveShNmin" end
+	if(enum==LoveStartingLayerEnum) return "LoveStartingLayer" end
+	if(enum==LoveUnderflowTolEnum) return "LoveUnderflowTol" end
+	if(enum==MassFluxSegmentsEnum) return "MassFluxSegments" end
+	if(enum==MassFluxSegmentsPresentEnum) return "MassFluxSegmentsPresent" end
+	if(enum==MasstransportHydrostaticAdjustmentEnum) return "MasstransportHydrostaticAdjustment" end
+	if(enum==MasstransportIsfreesurfaceEnum) return "MasstransportIsfreesurface" end
+	if(enum==MasstransportMinThicknessEnum) return "MasstransportMinThickness" end
+	if(enum==MasstransportNumRequestedOutputsEnum) return "MasstransportNumRequestedOutputs" end
+	if(enum==MasstransportPenaltyFactorEnum) return "MasstransportPenaltyFactor" end
+	if(enum==MasstransportRequestedOutputsEnum) return "MasstransportRequestedOutputs" end
+	if(enum==MasstransportStabilizationEnum) return "MasstransportStabilization" end
+	if(enum==MaterialsBetaEnum) return "MaterialsBeta" end
+	if(enum==MaterialsEarthDensityEnum) return "MaterialsEarthDensity" end
+	if(enum==MaterialsEffectiveconductivityAveragingEnum) return "MaterialsEffectiveconductivityAveraging" end
+	if(enum==MaterialsHeatcapacityEnum) return "MaterialsHeatcapacity" end
+	if(enum==MaterialsLatentheatEnum) return "MaterialsLatentheat" end
+	if(enum==MaterialsMeltingpointEnum) return "MaterialsMeltingpoint" end
+	if(enum==MaterialsMixedLayerCapacityEnum) return "MaterialsMixedLayerCapacity" end
+	if(enum==MaterialsMuWaterEnum) return "MaterialsMuWater" end
+	if(enum==MaterialsRheologyLawEnum) return "MaterialsRheologyLaw" end
+	if(enum==MaterialsRhoFreshwaterEnum) return "MaterialsRhoFreshwater" end
+	if(enum==MaterialsRhoIceEnum) return "MaterialsRhoIce" end
+	if(enum==MaterialsRhoSeawaterEnum) return "MaterialsRhoSeawater" end
+	if(enum==MaterialsTemperateiceconductivityEnum) return "MaterialsTemperateiceconductivity" end
+	if(enum==MaterialsThermalExchangeVelocityEnum) return "MaterialsThermalExchangeVelocity" end
+	if(enum==MaterialsThermalconductivityEnum) return "MaterialsThermalconductivity" end
+	if(enum==MeltingOffsetEnum) return "MeltingOffset" end
+	if(enum==MeshAverageVertexConnectivityEnum) return "MeshAverageVertexConnectivity" end
+	if(enum==MeshElementtypeEnum) return "MeshElementtype" end
+	if(enum==MeshNumberoflayersEnum) return "MeshNumberoflayers" end
+	if(enum==MeshNumberofverticesEnum) return "MeshNumberofvertices" end
+	if(enum==MeshNumberofelementsEnum) return "MeshNumberofelements" end
+	if(enum==MigrationMaxEnum) return "MigrationMax" end
+	if(enum==ModelIdEnum) return "ModelId" end
+	if(enum==NbinsEnum) return "Nbins" end
+	if(enum==NodesEnum) return "Nodes" end
+	if(enum==NumModelsEnum) return "NumModels" end
+	if(enum==OceanGridNxEnum) return "OceanGridNx" end
+	if(enum==OceanGridNyEnum) return "OceanGridNy" end
+	if(enum==OceanGridXEnum) return "OceanGridX" end
+	if(enum==OceanGridYEnum) return "OceanGridY" end
+	if(enum==OutputBufferPointerEnum) return "OutputBufferPointer" end
+	if(enum==OutputBufferSizePointerEnum) return "OutputBufferSizePointer" end
+	if(enum==OutputFileNameEnum) return "OutputFileName" end
+	if(enum==OutputFilePointerEnum) return "OutputFilePointer" end
+	if(enum==OutputdefinitionEnum) return "Outputdefinition" end
+	if(enum==QmuErrNameEnum) return "QmuErrName" end
+	if(enum==QmuInNameEnum) return "QmuInName" end
+	if(enum==QmuIsdakotaEnum) return "QmuIsdakota" end
+	if(enum==QmuOutNameEnum) return "QmuOutName" end
+	if(enum==QmuOutputEnum) return "QmuOutput" end
+	if(enum==QmuCurrEvalIdEnum) return "QmuCurrEvalId" end
+	if(enum==QmuNsampleEnum) return "QmuNsample" end
+	if(enum==QmuResponsedescriptorsEnum) return "QmuResponsedescriptors" end
+	if(enum==QmuVariableDescriptorsEnum) return "QmuVariableDescriptors" end
+	if(enum==QmuVariablePartitionsEnum) return "QmuVariablePartitions" end
+	if(enum==QmuVariablePartitionsNpartEnum) return "QmuVariablePartitionsNpart" end
+	if(enum==QmuVariablePartitionsNtEnum) return "QmuVariablePartitionsNt" end
+	if(enum==QmuResponsePartitionsEnum) return "QmuResponsePartitions" end
+	if(enum==QmuResponsePartitionsNpartEnum) return "QmuResponsePartitionsNpart" end
+	if(enum==QmuStatisticsEnum) return "QmuStatistics" end
+	if(enum==QmuNumstatisticsEnum) return "QmuNumstatistics" end
+	if(enum==QmuNdirectoriesEnum) return "QmuNdirectories" end
+	if(enum==QmuNfilesPerDirectoryEnum) return "QmuNfilesPerDirectory" end
+	if(enum==QmuStatisticsMethodEnum) return "QmuStatisticsMethod" end
+	if(enum==QmuMethodsEnum) return "QmuMethods" end
+	if(enum==RestartFileNameEnum) return "RestartFileName" end
+	if(enum==ResultsEnum) return "Results" end
+	if(enum==RootPathEnum) return "RootPath" end
+	if(enum==ModelnameEnum) return "Modelname" end
+	if(enum==SamplingAlphaEnum) return "SamplingAlpha" end
+	if(enum==SamplingPhiEnum) return "SamplingPhi" end
+	if(enum==SamplingNumRequestedOutputsEnum) return "SamplingNumRequestedOutputs" end
+	if(enum==SamplingRequestedOutputsEnum) return "SamplingRequestedOutputs" end
+	if(enum==SamplingRobinEnum) return "SamplingRobin" end
+	if(enum==SamplingSeedEnum) return "SamplingSeed" end
+	if(enum==SamplingTauEnum) return "SamplingTau" end
+	if(enum==SaveResultsEnum) return "SaveResults" end
+	if(enum==SolidearthPartitionIceEnum) return "SolidearthPartitionIce" end
+	if(enum==SolidearthPartitionHydroEnum) return "SolidearthPartitionHydro" end
+	if(enum==SolidearthPartitionOceanEnum) return "SolidearthPartitionOcean" end
+	if(enum==SolidearthNpartIceEnum) return "SolidearthNpartIce" end
+	if(enum==SolidearthNpartOceanEnum) return "SolidearthNpartOcean" end
+	if(enum==SolidearthNpartHydroEnum) return "SolidearthNpartHydro" end
+	if(enum==SolidearthPlanetRadiusEnum) return "SolidearthPlanetRadius" end
+	if(enum==SolidearthPlanetAreaEnum) return "SolidearthPlanetArea" end
+	if(enum==SolidearthSettingsAbstolEnum) return "SolidearthSettingsAbstol" end
+	if(enum==SolidearthSettingsCrossSectionShapeEnum) return "SolidearthSettingsCrossSectionShape" end
+	if(enum==RotationalAngularVelocityEnum) return "RotationalAngularVelocity" end
+	if(enum==SolidearthSettingsElasticEnum) return "SolidearthSettingsElastic" end
+	if(enum==SolidearthSettingsViscousEnum) return "SolidearthSettingsViscous" end
+	if(enum==SealevelchangeGeometryDoneEnum) return "SealevelchangeGeometryDone" end
+	if(enum==SealevelchangeViscousNumStepsEnum) return "SealevelchangeViscousNumSteps" end
+	if(enum==SealevelchangeViscousTimesEnum) return "SealevelchangeViscousTimes" end
+	if(enum==SealevelchangeViscousIndexEnum) return "SealevelchangeViscousIndex" end
+	if(enum==RotationalEquatorialMoiEnum) return "RotationalEquatorialMoi" end
+	if(enum==TidalLoveHEnum) return "TidalLoveH" end
+	if(enum==TidalLoveKEnum) return "TidalLoveK" end
+	if(enum==TidalLoveLEnum) return "TidalLoveL" end
+	if(enum==TidalLoveK2SecularEnum) return "TidalLoveK2Secular" end
+	if(enum==LoadLoveHEnum) return "LoadLoveH" end
+	if(enum==LoadLoveKEnum) return "LoadLoveK" end
+	if(enum==LoadLoveLEnum) return "LoadLoveL" end
+	if(enum==LoveTimeFreqEnum) return "LoveTimeFreq" end
+	if(enum==LoveIsTimeEnum) return "LoveIsTime" end
+	if(enum==SealevelchangeGSelfAttractionEnum) return "SealevelchangeGSelfAttraction" end
+	if(enum==SealevelchangeGViscoElasticEnum) return "SealevelchangeGViscoElastic" end
+	if(enum==SolidearthSettingsSealevelLoadingEnum) return "SolidearthSettingsSealevelLoading" end
+	if(enum==SolidearthSettingsGRDEnum) return "SolidearthSettingsGRD" end
+	if(enum==SolidearthSettingsRunFrequencyEnum) return "SolidearthSettingsRunFrequency" end
+	if(enum==SolidearthSettingsTimeAccEnum) return "SolidearthSettingsTimeAcc" end
+	if(enum==SealevelchangeHViscoElasticEnum) return "SealevelchangeHViscoElastic" end
+	if(enum==SolidearthSettingsHorizEnum) return "SolidearthSettingsHoriz" end
+	if(enum==SolidearthSettingsMaxiterEnum) return "SolidearthSettingsMaxiter" end
+	if(enum==SolidearthSettingsGrdOceanEnum) return "SolidearthSettingsGrdOcean" end
+	if(enum==SolidearthSettingsOceanAreaScalingEnum) return "SolidearthSettingsOceanAreaScaling" end
+	if(enum==StochasticForcingCovarianceEnum) return "StochasticForcingCovariance" end
+	if(enum==StochasticForcingDefaultDimensionEnum) return "StochasticForcingDefaultDimension" end
+	if(enum==StochasticForcingDimensionsEnum) return "StochasticForcingDimensions" end
+	if(enum==StochasticForcingFieldsEnum) return "StochasticForcingFields" end
+	if(enum==StochasticForcingIsEffectivePressureEnum) return "StochasticForcingIsEffectivePressure" end
+	if(enum==StochasticForcingIsStochasticForcingEnum) return "StochasticForcingIsStochasticForcing" end
+	if(enum==StochasticForcingIsWaterPressureEnum) return "StochasticForcingIsWaterPressure" end
+	if(enum==StochasticForcingNumFieldsEnum) return "StochasticForcingNumFields" end
+	if(enum==StochasticForcingRandomflagEnum) return "StochasticForcingRandomflag" end
+	if(enum==RotationalPolarMoiEnum) return "RotationalPolarMoi" end
+	if(enum==SolidearthSettingsReltolEnum) return "SolidearthSettingsReltol" end
+	if(enum==SealevelchangeRequestedOutputsEnum) return "SealevelchangeRequestedOutputs" end
+	if(enum==SolidearthSettingsSelfAttractionEnum) return "SolidearthSettingsSelfAttraction" end
+	if(enum==SolidearthSettingsRotationEnum) return "SolidearthSettingsRotation" end
+	if(enum==SolidearthSettingsMaxSHCoeffEnum) return "SolidearthSettingsMaxSHCoeff" end
+	if(enum==SealevelchangeRunCountEnum) return "SealevelchangeRunCount" end
+	if(enum==SealevelchangeTransitionsEnum) return "SealevelchangeTransitions" end
+	if(enum==SealevelchangeUViscoElasticEnum) return "SealevelchangeUViscoElastic" end
+	if(enum==SettingsIoGatherEnum) return "SettingsIoGather" end
+	if(enum==SettingsNumResultsOnNodesEnum) return "SettingsNumResultsOnNodes" end
+	if(enum==SettingsOutputFrequencyEnum) return "SettingsOutputFrequency" end
+	if(enum==SettingsCheckpointFrequencyEnum) return "SettingsCheckpointFrequency" end
+	if(enum==SettingsResultsOnNodesEnum) return "SettingsResultsOnNodes" end
+	if(enum==SettingsSbCouplingFrequencyEnum) return "SettingsSbCouplingFrequency" end
+	if(enum==SettingsSolverResidueThresholdEnum) return "SettingsSolverResidueThreshold" end
+	if(enum==SettingsWaitonlockEnum) return "SettingsWaitonlock" end
+	if(enum==SmbAIceEnum) return "SmbAIce" end
+	if(enum==SmbAIdxEnum) return "SmbAIdx" end
+	if(enum==SmbASnowEnum) return "SmbASnow" end
+	if(enum==SmbAccualtiEnum) return "SmbAccualti" end
+	if(enum==SmbAccugradEnum) return "SmbAccugrad" end
+	if(enum==SmbAccurefEnum) return "SmbAccuref" end
+	if(enum==SmbAdThreshEnum) return "SmbAdThresh" end
+	if(enum==SmbAutoregressionInitialTimeEnum) return "SmbAutoregressionInitialTime" end
+	if(enum==SmbAutoregressionTimestepEnum) return "SmbAutoregressionTimestep" end
+	if(enum==SmbAutoregressiveOrderEnum) return "SmbAutoregressiveOrder" end
+	if(enum==SmbAveragingEnum) return "SmbAveraging" end
+	if(enum==SmbBeta0Enum) return "SmbBeta0" end
+	if(enum==SmbBeta1Enum) return "SmbBeta1" end
+	if(enum==SmbDesfacEnum) return "SmbDesfac" end
+	if(enum==SmbDpermilEnum) return "SmbDpermil" end
+	if(enum==SmbDsnowIdxEnum) return "SmbDsnowIdx" end
+	if(enum==SmbCldFracEnum) return "SmbCldFrac" end
+	if(enum==SmbDelta18oEnum) return "SmbDelta18o" end
+	if(enum==SmbDelta18oSurfaceEnum) return "SmbDelta18oSurface" end
+	if(enum==SmbDenIdxEnum) return "SmbDenIdx" end
+	if(enum==SmbDtEnum) return "SmbDt" end
+	if(enum==SmbEnum) return "Smb" end
+	if(enum==SmbEIdxEnum) return "SmbEIdx" end
+	if(enum==SmbFEnum) return "SmbF" end
+	if(enum==SmbInitDensityScalingEnum) return "SmbInitDensityScaling" end
+	if(enum==SmbIsaccumulationEnum) return "SmbIsaccumulation" end
+	if(enum==SmbIsalbedoEnum) return "SmbIsalbedo" end
+	if(enum==SmbIsconstrainsurfaceTEnum) return "SmbIsconstrainsurfaceT" end
+	if(enum==SmbIsd18opdEnum) return "SmbIsd18opd" end
+	if(enum==SmbIsdelta18oEnum) return "SmbIsdelta18o" end
+	if(enum==SmbIsdensificationEnum) return "SmbIsdensification" end
+	if(enum==SmbIsdeltaLWupEnum) return "SmbIsdeltaLWup" end
+	if(enum==SmbIsfirnwarmingEnum) return "SmbIsfirnwarming" end
+	if(enum==SmbIsgraingrowthEnum) return "SmbIsgraingrowth" end
+	if(enum==SmbIsmeltEnum) return "SmbIsmelt" end
+	if(enum==SmbIsmungsmEnum) return "SmbIsmungsm" end
+	if(enum==SmbIsprecipscaledEnum) return "SmbIsprecipscaled" end
+	if(enum==SmbIssetpddfacEnum) return "SmbIssetpddfac" end
+	if(enum==SmbIsshortwaveEnum) return "SmbIsshortwave" end
+	if(enum==SmbIstemperaturescaledEnum) return "SmbIstemperaturescaled" end
+	if(enum==SmbIsthermalEnum) return "SmbIsthermal" end
+	if(enum==SmbIsturbulentfluxEnum) return "SmbIsturbulentflux" end
+	if(enum==SmbKEnum) return "SmbK" end
+	if(enum==SmbNumBasinsEnum) return "SmbNumBasins" end
+	if(enum==SmbNumRequestedOutputsEnum) return "SmbNumRequestedOutputs" end
+	if(enum==SmbPfacEnum) return "SmbPfac" end
+	if(enum==SmbPhiEnum) return "SmbPhi" end
+	if(enum==SmbRdlEnum) return "SmbRdl" end
+	if(enum==SmbRequestedOutputsEnum) return "SmbRequestedOutputs" end
+	if(enum==SmbRlapsEnum) return "SmbRlaps" end
+	if(enum==SmbRlapslgmEnum) return "SmbRlapslgm" end
+	if(enum==SmbRunoffaltiEnum) return "SmbRunoffalti" end
+	if(enum==SmbRunoffgradEnum) return "SmbRunoffgrad" end
+	if(enum==SmbRunoffrefEnum) return "SmbRunoffref" end
+	if(enum==SmbSealevEnum) return "SmbSealev" end
+	if(enum==SmbStepsPerStepEnum) return "SmbStepsPerStep" end
+	if(enum==SmbSwIdxEnum) return "SmbSwIdx" end
+	if(enum==SmbT0dryEnum) return "SmbT0dry" end
+	if(enum==SmbT0wetEnum) return "SmbT0wet" end
+	if(enum==SmbTeThreshEnum) return "SmbTeThresh" end
+	if(enum==SmbTdiffEnum) return "SmbTdiff" end
+	if(enum==SmbThermoDeltaTScalingEnum) return "SmbThermoDeltaTScaling" end
+	if(enum==SmbTemperaturesReconstructedYearsEnum) return "SmbTemperaturesReconstructedYears" end
+	if(enum==SmbPrecipitationsReconstructedYearsEnum) return "SmbPrecipitationsReconstructedYears" end
+	if(enum==SmoothThicknessMultiplierEnum) return "SmoothThicknessMultiplier" end
+	if(enum==SolutionTypeEnum) return "SolutionType" end
+	if(enum==SteadystateMaxiterEnum) return "SteadystateMaxiter" end
+	if(enum==SteadystateNumRequestedOutputsEnum) return "SteadystateNumRequestedOutputs" end
+	if(enum==SteadystateReltolEnum) return "SteadystateReltol" end
+	if(enum==SteadystateRequestedOutputsEnum) return "SteadystateRequestedOutputs" end
+	if(enum==StepEnum) return "Step" end
+	if(enum==StepsEnum) return "Steps" end
+	if(enum==StressbalanceAbstolEnum) return "StressbalanceAbstol" end
+	if(enum==StressbalanceFSreconditioningEnum) return "StressbalanceFSreconditioning" end
+	if(enum==StressbalanceIsnewtonEnum) return "StressbalanceIsnewton" end
+	if(enum==StressbalanceMaxiterEnum) return "StressbalanceMaxiter" end
+	if(enum==StressbalanceNumRequestedOutputsEnum) return "StressbalanceNumRequestedOutputs" end
+	if(enum==StressbalancePenaltyFactorEnum) return "StressbalancePenaltyFactor" end
+	if(enum==StressbalanceReltolEnum) return "StressbalanceReltol" end
+	if(enum==StressbalanceRequestedOutputsEnum) return "StressbalanceRequestedOutputs" end
+	if(enum==StressbalanceRestolEnum) return "StressbalanceRestol" end
+	if(enum==StressbalanceRiftPenaltyThresholdEnum) return "StressbalanceRiftPenaltyThreshold" end
+	if(enum==StressbalanceShelfDampeningEnum) return "StressbalanceShelfDampening" end
+	if(enum==ThermalIsdrainicecolumnEnum) return "ThermalIsdrainicecolumn" end
+	if(enum==ThermalIsdynamicbasalspcEnum) return "ThermalIsdynamicbasalspc" end
+	if(enum==ThermalIsenthalpyEnum) return "ThermalIsenthalpy" end
+	if(enum==ThermalMaxiterEnum) return "ThermalMaxiter" end
+	if(enum==ThermalNumRequestedOutputsEnum) return "ThermalNumRequestedOutputs" end
+	if(enum==ThermalPenaltyFactorEnum) return "ThermalPenaltyFactor" end
+	if(enum==ThermalPenaltyLockEnum) return "ThermalPenaltyLock" end
+	if(enum==ThermalPenaltyThresholdEnum) return "ThermalPenaltyThreshold" end
+	if(enum==ThermalReltolEnum) return "ThermalReltol" end
+	if(enum==ThermalRequestedOutputsEnum) return "ThermalRequestedOutputs" end
+	if(enum==ThermalStabilizationEnum) return "ThermalStabilization" end
+	if(enum==ThermalWatercolumnUpperlimitEnum) return "ThermalWatercolumnUpperlimit" end
+	if(enum==TimeEnum) return "Time" end
+	if(enum==TimesteppingCflCoefficientEnum) return "TimesteppingCflCoefficient" end
+	if(enum==TimesteppingCouplingTimeEnum) return "TimesteppingCouplingTime" end
+	if(enum==TimesteppingFinalTimeEnum) return "TimesteppingFinalTime" end
+	if(enum==TimesteppingInterpForcingEnum) return "TimesteppingInterpForcing" end
+	if(enum==TimesteppingCycleForcingEnum) return "TimesteppingCycleForcing" end
+	if(enum==TimesteppingStartTimeEnum) return "TimesteppingStartTime" end
+	if(enum==TimesteppingTimeStepEnum) return "TimesteppingTimeStep" end
+	if(enum==TimesteppingTimeStepMaxEnum) return "TimesteppingTimeStepMax" end
+	if(enum==TimesteppingTimeStepMinEnum) return "TimesteppingTimeStepMin" end
+	if(enum==TimesteppingTypeEnum) return "TimesteppingType" end
+	if(enum==ToMITgcmCommEnum) return "ToMITgcmComm" end
+	if(enum==ToolkitsFileNameEnum) return "ToolkitsFileName" end
+	if(enum==ToolkitsOptionsAnalysesEnum) return "ToolkitsOptionsAnalyses" end
+	if(enum==ToolkitsOptionsStringsEnum) return "ToolkitsOptionsStrings" end
+	if(enum==ToolkitsTypesEnum) return "ToolkitsTypes" end
+	if(enum==TransientAmrFrequencyEnum) return "TransientAmrFrequency" end
+	if(enum==TransientIsdamageevolutionEnum) return "TransientIsdamageevolution" end
+	if(enum==TransientIsesaEnum) return "TransientIsesa" end
+	if(enum==TransientIsgiaEnum) return "TransientIsgia" end
+	if(enum==TransientIsgroundinglineEnum) return "TransientIsgroundingline" end
+	if(enum==TransientIshydrologyEnum) return "TransientIshydrology" end
+	if(enum==TransientIsmasstransportEnum) return "TransientIsmasstransport" end
+	if(enum==TransientIsoceantransportEnum) return "TransientIsoceantransport" end
+	if(enum==TransientIsmovingfrontEnum) return "TransientIsmovingfront" end
+	if(enum==TransientIsoceancouplingEnum) return "TransientIsoceancoupling" end
+	if(enum==TransientIssamplingEnum) return "TransientIssampling" end
+	if(enum==TransientIsslcEnum) return "TransientIsslc" end
+	if(enum==TransientIssmbEnum) return "TransientIssmb" end
+	if(enum==TransientIsstressbalanceEnum) return "TransientIsstressbalance" end
+	if(enum==TransientIsthermalEnum) return "TransientIsthermal" end
+	if(enum==TransientNumRequestedOutputsEnum) return "TransientNumRequestedOutputs" end
+	if(enum==TransientRequestedOutputsEnum) return "TransientRequestedOutputs" end
+	if(enum==VelocityEnum) return "Velocity" end
+	if(enum==XxeEnum) return "Xxe" end
+	if(enum==YyeEnum) return "Yye" end
+	if(enum==ZzeEnum) return "Zze" end
+	if(enum==AreaeEnum) return "Areae" end
+	if(enum==WorldCommEnum) return "WorldComm" end
+	if(enum==ParametersENDEnum) return "ParametersEND" end
+	if(enum==InputsSTARTEnum) return "InputsSTART" end
+	if(enum==AccumulatedDeltaBottomPressureEnum) return "AccumulatedDeltaBottomPressure" end
+	if(enum==AccumulatedDeltaIceThicknessEnum) return "AccumulatedDeltaIceThickness" end
+	if(enum==AccumulatedDeltaTwsEnum) return "AccumulatedDeltaTws" end
+	if(enum==AdjointEnum) return "Adjoint" end
+	if(enum==AdjointpEnum) return "Adjointp" end
+	if(enum==AdjointxEnum) return "Adjointx" end
+	if(enum==AdjointxBaseEnum) return "AdjointxBase" end
+	if(enum==AdjointxShearEnum) return "AdjointxShear" end
+	if(enum==AdjointyEnum) return "Adjointy" end
+	if(enum==AdjointyBaseEnum) return "AdjointyBase" end
+	if(enum==AdjointyShearEnum) return "AdjointyShear" end
+	if(enum==AdjointzEnum) return "Adjointz" end
+	if(enum==AirEnum) return "Air" end
+	if(enum==ApproximationEnum) return "Approximation" end
+	if(enum==BalancethicknessMisfitEnum) return "BalancethicknessMisfit" end
+	if(enum==BalancethicknessOmega0Enum) return "BalancethicknessOmega0" end
+	if(enum==BalancethicknessOmegaEnum) return "BalancethicknessOmega" end
+	if(enum==BalancethicknessSpcthicknessEnum) return "BalancethicknessSpcthickness" end
+	if(enum==BalancethicknessThickeningRateEnum) return "BalancethicknessThickeningRate" end
+	if(enum==BasalCrevasseEnum) return "BasalCrevasse" end
+	if(enum==BasalforcingsFloatingiceMeltingRateEnum) return "BasalforcingsFloatingiceMeltingRate" end
+	if(enum==BasalforcingsGeothermalfluxEnum) return "BasalforcingsGeothermalflux" end
+	if(enum==BasalforcingsGroundediceMeltingRateEnum) return "BasalforcingsGroundediceMeltingRate" end
+	if(enum==BasalforcingsPerturbationMeltingRateEnum) return "BasalforcingsPerturbationMeltingRate" end
+	if(enum==BasalforcingsIsmip6BasinIdEnum) return "BasalforcingsIsmip6BasinId" end
+	if(enum==BasalforcingsIsmip6TfEnum) return "BasalforcingsIsmip6Tf" end
+	if(enum==BasalforcingsIsmip6TfShelfEnum) return "BasalforcingsIsmip6TfShelf" end
+	if(enum==BasalforcingsIsmip6MeltAnomalyEnum) return "BasalforcingsIsmip6MeltAnomaly" end
+	if(enum==BasalforcingsMeltrateFactorEnum) return "BasalforcingsMeltrateFactor" end
+	if(enum==BasalforcingsOceanSalinityEnum) return "BasalforcingsOceanSalinity" end
+	if(enum==BasalforcingsOceanTempEnum) return "BasalforcingsOceanTemp" end
+	if(enum==BasalforcingsPicoBasinIdEnum) return "BasalforcingsPicoBasinId" end
+	if(enum==BasalforcingsPicoBoxIdEnum) return "BasalforcingsPicoBoxId" end
+	if(enum==BasalforcingsPicoOverturningCoeffEnum) return "BasalforcingsPicoOverturningCoeff" end
+	if(enum==BasalforcingsPicoSubShelfOceanOverturningEnum) return "BasalforcingsPicoSubShelfOceanOverturning" end
+	if(enum==BasalforcingsPicoSubShelfOceanSalinityEnum) return "BasalforcingsPicoSubShelfOceanSalinity" end
+	if(enum==BasalforcingsPicoSubShelfOceanTempEnum) return "BasalforcingsPicoSubShelfOceanTemp" end
+	if(enum==BasalStressxEnum) return "BasalStressx" end
+	if(enum==BasalStressyEnum) return "BasalStressy" end
+	if(enum==BasalStressEnum) return "BasalStress" end
+	if(enum==BaseEnum) return "Base" end
+	if(enum==BaseOldEnum) return "BaseOld" end
+	if(enum==BaseSlopeXEnum) return "BaseSlopeX" end
+	if(enum==BaseSlopeYEnum) return "BaseSlopeY" end
+	if(enum==BaselineBasalforcingsFloatingiceMeltingRateEnum) return "BaselineBasalforcingsFloatingiceMeltingRate" end
+	if(enum==BaselineCalvingCalvingrateEnum) return "BaselineCalvingCalvingrate" end
+	if(enum==BaselineFrictionEffectivePressureEnum) return "BaselineFrictionEffectivePressure" end
+	if(enum==BedEnum) return "Bed" end
+	if(enum==BedGRDEnum) return "BedGRD" end
+	if(enum==BedEastEnum) return "BedEast" end
+	if(enum==BedEastGRDEnum) return "BedEastGRD" end
+	if(enum==BedNorthEnum) return "BedNorth" end
+	if(enum==BedNorthGRDEnum) return "BedNorthGRD" end
+	if(enum==BedSlopeXEnum) return "BedSlopeX" end
+	if(enum==BedSlopeYEnum) return "BedSlopeY" end
+	if(enum==BottomPressureEnum) return "BottomPressure" end
+	if(enum==BottomPressureOldEnum) return "BottomPressureOld" end
+	if(enum==CalvingCalvingrateEnum) return "CalvingCalvingrate" end
+	if(enum==CalvingHabFractionEnum) return "CalvingHabFraction" end
+	if(enum==CalvingMeltingrateEnum) return "CalvingMeltingrate" end
+	if(enum==CalvingStressThresholdFloatingiceEnum) return "CalvingStressThresholdFloatingice" end
+	if(enum==CalvingStressThresholdGroundediceEnum) return "CalvingStressThresholdGroundedice" end
+	if(enum==CalvinglevermannCoeffEnum) return "CalvinglevermannCoeff" end
+	if(enum==CalvingratexAverageEnum) return "CalvingratexAverage" end
+	if(enum==CalvingratexEnum) return "Calvingratex" end
+	if(enum==CalvingrateyAverageEnum) return "CalvingrateyAverage" end
+	if(enum==CalvingrateyEnum) return "Calvingratey" end
+	if(enum==CalvingFluxLevelsetEnum) return "CalvingFluxLevelset" end
+	if(enum==CalvingMeltingFluxLevelsetEnum) return "CalvingMeltingFluxLevelset" end
+	if(enum==ConvergedEnum) return "Converged" end
+	if(enum==CrevasseDepthEnum) return "CrevasseDepth" end
+	if(enum==DamageDEnum) return "DamageD" end
+	if(enum==DamageDOldEnum) return "DamageDOld" end
+	if(enum==DamageDbarEnum) return "DamageDbar" end
+	if(enum==DamageDbarOldEnum) return "DamageDbarOld" end
+	if(enum==DamageFEnum) return "DamageF" end
+	if(enum==DegreeOfChannelizationEnum) return "DegreeOfChannelization" end
+	if(enum==DepthBelowSurfaceEnum) return "DepthBelowSurface" end
+	if(enum==DeltaIceThicknessEnum) return "DeltaIceThickness" end
+	if(enum==DeltaTwsEnum) return "DeltaTws" end
+	if(enum==DeltaBottomPressureEnum) return "DeltaBottomPressure" end
+	if(enum==DeltaDslEnum) return "DeltaDsl" end
+	if(enum==DslOldEnum) return "DslOld" end
+	if(enum==DslEnum) return "Dsl" end
+	if(enum==DeltaStrEnum) return "DeltaStr" end
+	if(enum==StrOldEnum) return "StrOld" end
+	if(enum==StrEnum) return "Str" end
+	if(enum==DeviatoricStresseffectiveEnum) return "DeviatoricStresseffective" end
+	if(enum==DeviatoricStressxxEnum) return "DeviatoricStressxx" end
+	if(enum==DeviatoricStressxyEnum) return "DeviatoricStressxy" end
+	if(enum==DeviatoricStressxzEnum) return "DeviatoricStressxz" end
+	if(enum==DeviatoricStressyyEnum) return "DeviatoricStressyy" end
+	if(enum==DeviatoricStressyzEnum) return "DeviatoricStressyz" end
+	if(enum==DeviatoricStresszzEnum) return "DeviatoricStresszz" end
+	if(enum==DeviatoricStress1Enum) return "DeviatoricStress1" end
+	if(enum==DeviatoricStress2Enum) return "DeviatoricStress2" end
+	if(enum==DistanceToCalvingfrontEnum) return "DistanceToCalvingfront" end
+	if(enum==DistanceToGroundinglineEnum) return "DistanceToGroundingline" end
+	if(enum==Domain2DhorizontalEnum) return "Domain2Dhorizontal" end
+	if(enum==Domain2DverticalEnum) return "Domain2Dvertical" end
+	if(enum==Domain3DEnum) return "Domain3D" end
+	if(enum==DragCoefficientAbsGradientEnum) return "DragCoefficientAbsGradient" end
+	if(enum==DrivingStressXEnum) return "DrivingStressX" end
+	if(enum==DrivingStressYEnum) return "DrivingStressY" end
+	if(enum==DummyEnum) return "Dummy" end
+	if(enum==EffectivePressureEnum) return "EffectivePressure" end
+	if(enum==EffectivePressureSubstepEnum) return "EffectivePressureSubstep" end
+	if(enum==EffectivePressureTransientEnum) return "EffectivePressureTransient" end
+	if(enum==EnthalpyEnum) return "Enthalpy" end
+	if(enum==EnthalpyPicardEnum) return "EnthalpyPicard" end
+	if(enum==EplHeadEnum) return "EplHead" end
+	if(enum==EplHeadOldEnum) return "EplHeadOld" end
+	if(enum==EplHeadSlopeXEnum) return "EplHeadSlopeX" end
+	if(enum==EplHeadSlopeYEnum) return "EplHeadSlopeY" end
+	if(enum==EplHeadSubstepEnum) return "EplHeadSubstep" end
+	if(enum==EplHeadTransientEnum) return "EplHeadTransient" end
+	if(enum==EsaEmotionEnum) return "EsaEmotion" end
+	if(enum==EsaNmotionEnum) return "EsaNmotion" end
+	if(enum==EsaRotationrateEnum) return "EsaRotationrate" end
+	if(enum==EsaStrainratexxEnum) return "EsaStrainratexx" end
+	if(enum==EsaStrainratexyEnum) return "EsaStrainratexy" end
+	if(enum==EsaStrainrateyyEnum) return "EsaStrainrateyy" end
+	if(enum==EsaUmotionEnum) return "EsaUmotion" end
+	if(enum==EsaXmotionEnum) return "EsaXmotion" end
+	if(enum==EsaYmotionEnum) return "EsaYmotion" end
+	if(enum==EtaDiffEnum) return "EtaDiff" end
+	if(enum==FlowequationBorderFSEnum) return "FlowequationBorderFS" end
+	if(enum==FrictionAsEnum) return "FrictionAs" end
+	if(enum==FrictionCEnum) return "FrictionC" end
+	if(enum==FrictionCmaxEnum) return "FrictionCmax" end
+	if(enum==FrictionCoefficientEnum) return "FrictionCoefficient" end
+	if(enum==FrictionCoefficientcoulombEnum) return "FrictionCoefficientcoulomb" end
+	if(enum==FrictionEffectivePressureEnum) return "FrictionEffectivePressure" end
+	if(enum==FrictionMEnum) return "FrictionM" end
+	if(enum==FrictionPEnum) return "FrictionP" end
+	if(enum==FrictionPressureAdjustedTemperatureEnum) return "FrictionPressureAdjustedTemperature" end
+	if(enum==FrictionQEnum) return "FrictionQ" end
+	if(enum==FrictionSedimentCompressibilityCoefficientEnum) return "FrictionSedimentCompressibilityCoefficient" end
+	if(enum==FrictionTillFrictionAngleEnum) return "FrictionTillFrictionAngle" end
+	if(enum==FrictionWaterLayerEnum) return "FrictionWaterLayer" end
+	if(enum==FrictionfEnum) return "Frictionf" end
+	if(enum==FrontalForcingsBasinIdEnum) return "FrontalForcingsBasinId" end
+	if(enum==FrontalForcingsSubglacialDischargeEnum) return "FrontalForcingsSubglacialDischarge" end
+	if(enum==FrontalForcingsThermalForcingEnum) return "FrontalForcingsThermalForcing" end
+	if(enum==GeometryHydrostaticRatioEnum) return "GeometryHydrostaticRatio" end
+	if(enum==NGiaEnum) return "NGia" end
+	if(enum==NGiaRateEnum) return "NGiaRate" end
+	if(enum==UGiaEnum) return "UGia" end
+	if(enum==UGiaRateEnum) return "UGiaRate" end
+	if(enum==GradientEnum) return "Gradient" end
+	if(enum==GroundinglineHeightEnum) return "GroundinglineHeight" end
+	if(enum==HydraulicPotentialEnum) return "HydraulicPotential" end
+	if(enum==HydraulicPotentialOldEnum) return "HydraulicPotentialOld" end
+	if(enum==HydrologyBasalFluxEnum) return "HydrologyBasalFlux" end
+	if(enum==HydrologyBumpHeightEnum) return "HydrologyBumpHeight" end
+	if(enum==HydrologyBumpSpacingEnum) return "HydrologyBumpSpacing" end
+	if(enum==HydrologydcBasalMoulinInputEnum) return "HydrologydcBasalMoulinInput" end
+	if(enum==HydrologydcEplThicknessEnum) return "HydrologydcEplThickness" end
+	if(enum==HydrologydcEplThicknessOldEnum) return "HydrologydcEplThicknessOld" end
+	if(enum==HydrologydcEplThicknessSubstepEnum) return "HydrologydcEplThicknessSubstep" end
+	if(enum==HydrologydcEplThicknessTransientEnum) return "HydrologydcEplThicknessTransient" end
+	if(enum==HydrologydcMaskEplactiveEltEnum) return "HydrologydcMaskEplactiveElt" end
+	if(enum==HydrologydcMaskEplactiveNodeEnum) return "HydrologydcMaskEplactiveNode" end
+	if(enum==HydrologydcMaskThawedEltEnum) return "HydrologydcMaskThawedElt" end
+	if(enum==HydrologydcMaskThawedNodeEnum) return "HydrologydcMaskThawedNode" end
+	if(enum==HydrologydcSedimentTransmitivityEnum) return "HydrologydcSedimentTransmitivity" end
+	if(enum==HydrologyDrainageRateEnum) return "HydrologyDrainageRate" end
+	if(enum==HydrologyEnglacialInputEnum) return "HydrologyEnglacialInput" end
+	if(enum==HydrologyGapHeightEnum) return "HydrologyGapHeight" end
+	if(enum==HydrologyGapHeightXEnum) return "HydrologyGapHeightX" end
+	if(enum==HydrologyGapHeightXXEnum) return "HydrologyGapHeightXX" end
+	if(enum==HydrologyGapHeightYEnum) return "HydrologyGapHeightY" end
+	if(enum==HydrologyGapHeightYYEnum) return "HydrologyGapHeightYY" end
+	if(enum==HydrologyHeadEnum) return "HydrologyHead" end
+	if(enum==HydrologyHeadOldEnum) return "HydrologyHeadOld" end
+	if(enum==HydrologyMoulinInputEnum) return "HydrologyMoulinInput" end
+	if(enum==HydrologyNeumannfluxEnum) return "HydrologyNeumannflux" end
+	if(enum==HydrologyReynoldsEnum) return "HydrologyReynolds" end
+	if(enum==HydrologySheetConductivityEnum) return "HydrologySheetConductivity" end
+	if(enum==HydrologySheetThicknessEnum) return "HydrologySheetThickness" end
+	if(enum==HydrologySheetThicknessOldEnum) return "HydrologySheetThicknessOld" end
+	if(enum==HydrologyTwsEnum) return "HydrologyTws" end
+	if(enum==HydrologyTwsSpcEnum) return "HydrologyTwsSpc" end
+	if(enum==HydrologyTwsAnalysisEnum) return "HydrologyTwsAnalysis" end
+	if(enum==HydrologyWatercolumnMaxEnum) return "HydrologyWatercolumnMax" end
+	if(enum==HydrologyWaterVxEnum) return "HydrologyWaterVx" end
+	if(enum==HydrologyWaterVyEnum) return "HydrologyWaterVy" end
+	if(enum==IceEnum) return "Ice" end
+	if(enum==IceMaskNodeActivationEnum) return "IceMaskNodeActivation" end
+	if(enum==InputEnum) return "Input" end
+	if(enum==InversionCostFunctionsCoefficientsEnum) return "InversionCostFunctionsCoefficients" end
+	if(enum==InversionSurfaceObsEnum) return "InversionSurfaceObs" end
+	if(enum==InversionThicknessObsEnum) return "InversionThicknessObs" end
+	if(enum==InversionVelObsEnum) return "InversionVelObs" end
+	if(enum==InversionVxObsEnum) return "InversionVxObs" end
+	if(enum==InversionVyObsEnum) return "InversionVyObs" end
+	if(enum==LevelsetfunctionSlopeXEnum) return "LevelsetfunctionSlopeX" end
+	if(enum==LevelsetfunctionSlopeYEnum) return "LevelsetfunctionSlopeY" end
+	if(enum==LevelsetObservationEnum) return "LevelsetObservation" end
+	if(enum==LoadingforceXEnum) return "LoadingforceX" end
+	if(enum==LoadingforceYEnum) return "LoadingforceY" end
+	if(enum==LoadingforceZEnum) return "LoadingforceZ" end
+	if(enum==MaskOceanLevelsetEnum) return "MaskOceanLevelset" end
+	if(enum==MaskIceLevelsetEnum) return "MaskIceLevelset" end
+	if(enum==MaskIceRefLevelsetEnum) return "MaskIceRefLevelset" end
+	if(enum==MasstransportSpcthicknessEnum) return "MasstransportSpcthickness" end
+	if(enum==MaterialsRheologyBEnum) return "MaterialsRheologyB" end
+	if(enum==MaterialsRheologyBbarEnum) return "MaterialsRheologyBbar" end
+	if(enum==MaterialsRheologyEEnum) return "MaterialsRheologyE" end
+	if(enum==MaterialsRheologyEbarEnum) return "MaterialsRheologyEbar" end
+	if(enum==MaterialsRheologyEcEnum) return "MaterialsRheologyEc" end
+	if(enum==MaterialsRheologyEcbarEnum) return "MaterialsRheologyEcbar" end
+	if(enum==MaterialsRheologyEsEnum) return "MaterialsRheologyEs" end
+	if(enum==MaterialsRheologyEsbarEnum) return "MaterialsRheologyEsbar" end
+	if(enum==MaterialsRheologyNEnum) return "MaterialsRheologyN" end
+	if(enum==MeshScaleFactorEnum) return "MeshScaleFactor" end
+	if(enum==MeshVertexonbaseEnum) return "MeshVertexonbase" end
+	if(enum==MeshVertexonboundaryEnum) return "MeshVertexonboundary" end
+	if(enum==MeshVertexonsurfaceEnum) return "MeshVertexonsurface" end
+	if(enum==MisfitEnum) return "Misfit" end
+	if(enum==MovingFrontalVxEnum) return "MovingFrontalVx" end
+	if(enum==MovingFrontalVyEnum) return "MovingFrontalVy" end
+	if(enum==NeumannfluxEnum) return "Neumannflux" end
+	if(enum==NewDamageEnum) return "NewDamage" end
+	if(enum==NodeEnum) return "Node" end
+	if(enum==OmegaAbsGradientEnum) return "OmegaAbsGradient" end
+	if(enum==OceantransportSpcbottompressureEnum) return "OceantransportSpcbottompressure" end
+	if(enum==OceantransportSpcstrEnum) return "OceantransportSpcstr" end
+	if(enum==OceantransportSpcdslEnum) return "OceantransportSpcdsl" end
+	if(enum==P0Enum) return "P0" end
+	if(enum==P1Enum) return "P1" end
+	if(enum==PartitioningEnum) return "Partitioning" end
+	if(enum==PressureEnum) return "Pressure" end
+	if(enum==RadarEnum) return "Radar" end
+	if(enum==RadarAttenuationMacGregorEnum) return "RadarAttenuationMacGregor" end
+	if(enum==RadarAttenuationWolffEnum) return "RadarAttenuationWolff" end
+	if(enum==RadarIcePeriodEnum) return "RadarIcePeriod" end
+	if(enum==RadarPowerMacGregorEnum) return "RadarPowerMacGregor" end
+	if(enum==RadarPowerWolffEnum) return "RadarPowerWolff" end
+	if(enum==RheologyBAbsGradientEnum) return "RheologyBAbsGradient" end
+	if(enum==RheologyBInitialguessEnum) return "RheologyBInitialguess" end
+	if(enum==RheologyBInitialguessMisfitEnum) return "RheologyBInitialguessMisfit" end
+	if(enum==RheologyBbarAbsGradientEnum) return "RheologyBbarAbsGradient" end
+	if(enum==SampleEnum) return "Sample" end
+	if(enum==SamplingBetaEnum) return "SamplingBeta" end
+	if(enum==SamplingKappaEnum) return "SamplingKappa" end
+	if(enum==SealevelEnum) return "Sealevel" end
+	if(enum==SealevelGRDEnum) return "SealevelGRD" end
+	if(enum==SealevelBarystaticMaskEnum) return "SealevelBarystaticMask" end
+	if(enum==SealevelBarystaticIceMaskEnum) return "SealevelBarystaticIceMask" end
+	if(enum==SealevelBarystaticIceWeightsEnum) return "SealevelBarystaticIceWeights" end
+	if(enum==SealevelBarystaticIceAreaEnum) return "SealevelBarystaticIceArea" end
+	if(enum==SealevelBarystaticIceLatbarEnum) return "SealevelBarystaticIceLatbar" end
+	if(enum==SealevelBarystaticIceLongbarEnum) return "SealevelBarystaticIceLongbar" end
+	if(enum==SealevelBarystaticIceLoadEnum) return "SealevelBarystaticIceLoad" end
+	if(enum==SealevelBarystaticHydroMaskEnum) return "SealevelBarystaticHydroMask" end
+	if(enum==SealevelBarystaticHydroWeightsEnum) return "SealevelBarystaticHydroWeights" end
+	if(enum==SealevelBarystaticHydroAreaEnum) return "SealevelBarystaticHydroArea" end
+	if(enum==SealevelBarystaticHydroLatbarEnum) return "SealevelBarystaticHydroLatbar" end
+	if(enum==SealevelBarystaticHydroLongbarEnum) return "SealevelBarystaticHydroLongbar" end
+	if(enum==SealevelBarystaticHydroLoadEnum) return "SealevelBarystaticHydroLoad" end
+	if(enum==SealevelBarystaticBpMaskEnum) return "SealevelBarystaticBpMask" end
+	if(enum==SealevelBarystaticBpWeightsEnum) return "SealevelBarystaticBpWeights" end
+	if(enum==SealevelBarystaticBpAreaEnum) return "SealevelBarystaticBpArea" end
+	if(enum==SealevelBarystaticBpLoadEnum) return "SealevelBarystaticBpLoad" end
+	if(enum==SealevelBarystaticOceanMaskEnum) return "SealevelBarystaticOceanMask" end
+	if(enum==SealevelBarystaticOceanWeightsEnum) return "SealevelBarystaticOceanWeights" end
+	if(enum==SealevelBarystaticOceanAreaEnum) return "SealevelBarystaticOceanArea" end
+	if(enum==SealevelBarystaticOceanLatbarEnum) return "SealevelBarystaticOceanLatbar" end
+	if(enum==SealevelBarystaticOceanLongbarEnum) return "SealevelBarystaticOceanLongbar" end
+	if(enum==SealevelBarystaticOceanLoadEnum) return "SealevelBarystaticOceanLoad" end
+	if(enum==SealevelNEsaEnum) return "SealevelNEsa" end
+	if(enum==SealevelNEsaRateEnum) return "SealevelNEsaRate" end
+	if(enum==SealevelRSLEnum) return "SealevelRSL" end
+	if(enum==BslcEnum) return "Bslc" end
+	if(enum==BslcIceEnum) return "BslcIce" end
+	if(enum==BslcHydroEnum) return "BslcHydro" end
+	if(enum==BslcOceanEnum) return "BslcOcean" end
+	if(enum==BslcRateEnum) return "BslcRate" end
+	if(enum==GmtslcEnum) return "Gmtslc" end
+	if(enum==SealevelGrotm1Enum) return "SealevelGrotm1" end
+	if(enum==SealevelGrotm2Enum) return "SealevelGrotm2" end
+	if(enum==SealevelGrotm3Enum) return "SealevelGrotm3" end
+	if(enum==SealevelGUrotm1Enum) return "SealevelGUrotm1" end
+	if(enum==SealevelGUrotm2Enum) return "SealevelGUrotm2" end
+	if(enum==SealevelGUrotm3Enum) return "SealevelGUrotm3" end
+	if(enum==SealevelGNrotm1Enum) return "SealevelGNrotm1" end
+	if(enum==SealevelGNrotm2Enum) return "SealevelGNrotm2" end
+	if(enum==SealevelGNrotm3Enum) return "SealevelGNrotm3" end
+	if(enum==SealevelGErotm1Enum) return "SealevelGErotm1" end
+	if(enum==SealevelGErotm2Enum) return "SealevelGErotm2" end
+	if(enum==SealevelGErotm3Enum) return "SealevelGErotm3" end
+	if(enum==SealevelRSLBarystaticEnum) return "SealevelRSLBarystatic" end
+	if(enum==SealevelRSLRateEnum) return "SealevelRSLRate" end
+	if(enum==SealevelUGrdEnum) return "SealevelUGrd" end
+	if(enum==SealevelNGrdEnum) return "SealevelNGrd" end
+	if(enum==SealevelUEastEsaEnum) return "SealevelUEastEsa" end
+	if(enum==SealevelUNorthEsaEnum) return "SealevelUNorthEsa" end
+	if(enum==SealevelchangeIndicesEnum) return "SealevelchangeIndices" end
+	if(enum==SealevelchangeGEnum) return "SealevelchangeG" end
+	if(enum==SealevelchangeGUEnum) return "SealevelchangeGU" end
+	if(enum==SealevelchangeGEEnum) return "SealevelchangeGE" end
+	if(enum==SealevelchangeGNEnum) return "SealevelchangeGN" end
+	if(enum==SealevelchangeGsubelOceanEnum) return "SealevelchangeGsubelOcean" end
+	if(enum==SealevelchangeGUsubelOceanEnum) return "SealevelchangeGUsubelOcean" end
+	if(enum==SealevelchangeGEsubelOceanEnum) return "SealevelchangeGEsubelOcean" end
+	if(enum==SealevelchangeGNsubelOceanEnum) return "SealevelchangeGNsubelOcean" end
+	if(enum==SealevelchangeGsubelIceEnum) return "SealevelchangeGsubelIce" end
+	if(enum==SealevelchangeGUsubelIceEnum) return "SealevelchangeGUsubelIce" end
+	if(enum==SealevelchangeGEsubelIceEnum) return "SealevelchangeGEsubelIce" end
+	if(enum==SealevelchangeGNsubelIceEnum) return "SealevelchangeGNsubelIce" end
+	if(enum==SealevelchangeGsubelHydroEnum) return "SealevelchangeGsubelHydro" end
+	if(enum==SealevelchangeGUsubelHydroEnum) return "SealevelchangeGUsubelHydro" end
+	if(enum==SealevelchangeGEsubelHydroEnum) return "SealevelchangeGEsubelHydro" end
+	if(enum==SealevelchangeGNsubelHydroEnum) return "SealevelchangeGNsubelHydro" end
+	if(enum==SealevelchangeViscousRSLEnum) return "SealevelchangeViscousRSL" end
+	if(enum==SealevelchangeViscousUEnum) return "SealevelchangeViscousU" end
+	if(enum==SealevelchangeViscousNEnum) return "SealevelchangeViscousN" end
+	if(enum==SealevelchangeViscousEEnum) return "SealevelchangeViscousE" end
+	if(enum==SedimentHeadEnum) return "SedimentHead" end
+	if(enum==SedimentHeadOldEnum) return "SedimentHeadOld" end
+	if(enum==SedimentHeadSubstepEnum) return "SedimentHeadSubstep" end
+	if(enum==SedimentHeadTransientEnum) return "SedimentHeadTransient" end
+	if(enum==SedimentHeadResidualEnum) return "SedimentHeadResidual" end
+	if(enum==SedimentHeadStackedEnum) return "SedimentHeadStacked" end
+	if(enum==SigmaNNEnum) return "SigmaNN" end
+	if(enum==SigmaVMEnum) return "SigmaVM" end
+	if(enum==SmbAccumulatedECEnum) return "SmbAccumulatedEC" end
+	if(enum==SmbAccumulatedMassBalanceEnum) return "SmbAccumulatedMassBalance" end
+	if(enum==SmbAccumulatedMeltEnum) return "SmbAccumulatedMelt" end
+	if(enum==SmbAccumulatedPrecipitationEnum) return "SmbAccumulatedPrecipitation" end
+	if(enum==SmbAccumulatedRainEnum) return "SmbAccumulatedRain" end
+	if(enum==SmbAccumulatedRefreezeEnum) return "SmbAccumulatedRefreeze" end
+	if(enum==SmbAccumulatedRunoffEnum) return "SmbAccumulatedRunoff" end
+	if(enum==SmbAEnum) return "SmbA" end
+	if(enum==SmbAdiffEnum) return "SmbAdiff" end
+	if(enum==SmbAValueEnum) return "SmbAValue" end
+	if(enum==SmbAccumulationEnum) return "SmbAccumulation" end
+	if(enum==SmbAdiffiniEnum) return "SmbAdiffini" end
+	if(enum==SmbAiniEnum) return "SmbAini" end
+	if(enum==SmbAutoregressionNoiseEnum) return "SmbAutoregressionNoise" end
+	if(enum==SmbBasinsIdEnum) return "SmbBasinsId" end
+	if(enum==SmbBMaxEnum) return "SmbBMax" end
+	if(enum==SmbBMinEnum) return "SmbBMin" end
+	if(enum==SmbBNegEnum) return "SmbBNeg" end
+	if(enum==SmbBPosEnum) return "SmbBPos" end
+	if(enum==SmbCEnum) return "SmbC" end
+	if(enum==SmbCcsnowValueEnum) return "SmbCcsnowValue" end
+	if(enum==SmbCciceValueEnum) return "SmbCciceValue" end
+	if(enum==SmbCotValueEnum) return "SmbCotValue" end
+	if(enum==SmbDEnum) return "SmbD" end
+	if(enum==SmbDailyairdensityEnum) return "SmbDailyairdensity" end
+	if(enum==SmbDailyairhumidityEnum) return "SmbDailyairhumidity" end
+	if(enum==SmbDailydlradiationEnum) return "SmbDailydlradiation" end
+	if(enum==SmbDailydsradiationEnum) return "SmbDailydsradiation" end
+	if(enum==SmbDailypressureEnum) return "SmbDailypressure" end
+	if(enum==SmbDailyrainfallEnum) return "SmbDailyrainfall" end
+	if(enum==SmbDailysnowfallEnum) return "SmbDailysnowfall" end
+	if(enum==SmbDailytemperatureEnum) return "SmbDailytemperature" end
+	if(enum==SmbDailywindspeedEnum) return "SmbDailywindspeed" end
+	if(enum==SmbDiniEnum) return "SmbDini" end
+	if(enum==SmbDlwrfEnum) return "SmbDlwrf" end
+	if(enum==SmbDulwrfValueEnum) return "SmbDulwrfValue" end
+	if(enum==SmbDswrfEnum) return "SmbDswrf" end
+	if(enum==SmbDswdiffrfEnum) return "SmbDswdiffrf" end
+	if(enum==SmbDzAddEnum) return "SmbDzAdd" end
+	if(enum==SmbDzEnum) return "SmbDz" end
+	if(enum==SmbDzMinEnum) return "SmbDzMin" end
+	if(enum==SmbDzTopEnum) return "SmbDzTop" end
+	if(enum==SmbDziniEnum) return "SmbDzini" end
+	if(enum==SmbEAirEnum) return "SmbEAir" end
+	if(enum==SmbECEnum) return "SmbEC" end
+	if(enum==SmbECDtEnum) return "SmbECDt" end
+	if(enum==SmbECiniEnum) return "SmbECini" end
+	if(enum==SmbElaEnum) return "SmbEla" end
+	if(enum==SmbEvaporationEnum) return "SmbEvaporation" end
+	if(enum==SmbFACEnum) return "SmbFAC" end
+	if(enum==SmbGdnEnum) return "SmbGdn" end
+	if(enum==SmbGdniniEnum) return "SmbGdnini" end
+	if(enum==SmbGspEnum) return "SmbGsp" end
+	if(enum==SmbGspiniEnum) return "SmbGspini" end
+	if(enum==SmbHrefEnum) return "SmbHref" end
+	if(enum==SmbIsInitializedEnum) return "SmbIsInitialized" end
+	if(enum==SmbMAddEnum) return "SmbMAdd" end
+	if(enum==SmbMassBalanceEnum) return "SmbMassBalance" end
+	if(enum==SmbMassBalanceSubstepEnum) return "SmbMassBalanceSubstep" end
+	if(enum==SmbMassBalanceTransientEnum) return "SmbMassBalanceTransient" end
+	if(enum==SmbMeanLHFEnum) return "SmbMeanLHF" end
+	if(enum==SmbMeanSHFEnum) return "SmbMeanSHF" end
+	if(enum==SmbMeanULWEnum) return "SmbMeanULW" end
+	if(enum==SmbMeltEnum) return "SmbMelt" end
+	if(enum==SmbMonthlytemperaturesEnum) return "SmbMonthlytemperatures" end
+	if(enum==SmbMSurfEnum) return "SmbMSurf" end
+	if(enum==SmbNetLWEnum) return "SmbNetLW" end
+	if(enum==SmbNetSWEnum) return "SmbNetSW" end
+	if(enum==SmbPAirEnum) return "SmbPAir" end
+	if(enum==SmbPEnum) return "SmbP" end
+	if(enum==SmbPddfacIceEnum) return "SmbPddfacIce" end
+	if(enum==SmbPddfacSnowEnum) return "SmbPddfacSnow" end
+	if(enum==SmbPrecipitationEnum) return "SmbPrecipitation" end
+	if(enum==SmbPrecipitationsAnomalyEnum) return "SmbPrecipitationsAnomaly" end
+	if(enum==SmbPrecipitationsLgmEnum) return "SmbPrecipitationsLgm" end
+	if(enum==SmbPrecipitationsPresentdayEnum) return "SmbPrecipitationsPresentday" end
+	if(enum==SmbPrecipitationsReconstructedEnum) return "SmbPrecipitationsReconstructed" end
+	if(enum==SmbRainEnum) return "SmbRain" end
+	if(enum==SmbReEnum) return "SmbRe" end
+	if(enum==SmbRefreezeEnum) return "SmbRefreeze" end
+	if(enum==SmbReiniEnum) return "SmbReini" end
+	if(enum==SmbRunoffEnum) return "SmbRunoff" end
+	if(enum==SmbRunoffSubstepEnum) return "SmbRunoffSubstep" end
+	if(enum==SmbRunoffTransientEnum) return "SmbRunoffTransient" end
+	if(enum==SmbS0gcmEnum) return "SmbS0gcm" end
+	if(enum==SmbS0pEnum) return "SmbS0p" end
+	if(enum==SmbS0tEnum) return "SmbS0t" end
+	if(enum==SmbSizeiniEnum) return "SmbSizeini" end
+	if(enum==SmbSmbCorrEnum) return "SmbSmbCorr" end
+	if(enum==SmbSmbrefEnum) return "SmbSmbref" end
+	if(enum==SmbSzaValueEnum) return "SmbSzaValue" end
+	if(enum==SmbTEnum) return "SmbT" end
+	if(enum==SmbTaEnum) return "SmbTa" end
+	if(enum==SmbTeValueEnum) return "SmbTeValue" end
+	if(enum==SmbTemperaturesAnomalyEnum) return "SmbTemperaturesAnomaly" end
+	if(enum==SmbTemperaturesLgmEnum) return "SmbTemperaturesLgm" end
+	if(enum==SmbTemperaturesPresentdayEnum) return "SmbTemperaturesPresentday" end
+	if(enum==SmbTemperaturesReconstructedEnum) return "SmbTemperaturesReconstructed" end
+	if(enum==SmbTiniEnum) return "SmbTini" end
+	if(enum==SmbTmeanEnum) return "SmbTmean" end
+	if(enum==SmbTzEnum) return "SmbTz" end
+	if(enum==SmbValuesAutoregressionEnum) return "SmbValuesAutoregression" end
+	if(enum==SmbVEnum) return "SmbV" end
+	if(enum==SmbVmeanEnum) return "SmbVmean" end
+	if(enum==SmbVzEnum) return "SmbVz" end
+	if(enum==SmbWEnum) return "SmbW" end
+	if(enum==SmbWAddEnum) return "SmbWAdd" end
+	if(enum==SmbWiniEnum) return "SmbWini" end
+	if(enum==SmbZMaxEnum) return "SmbZMax" end
+	if(enum==SmbZMinEnum) return "SmbZMin" end
+	if(enum==SmbZTopEnum) return "SmbZTop" end
+	if(enum==SmbZYEnum) return "SmbZY" end
+	if(enum==SolidearthExternalDisplacementEastRateEnum) return "SolidearthExternalDisplacementEastRate" end
+	if(enum==SolidearthExternalDisplacementNorthRateEnum) return "SolidearthExternalDisplacementNorthRate" end
+	if(enum==SolidearthExternalDisplacementUpRateEnum) return "SolidearthExternalDisplacementUpRate" end
+	if(enum==SolidearthExternalGeoidRateEnum) return "SolidearthExternalGeoidRate" end
+	if(enum==StochasticForcingDefaultIdEnum) return "StochasticForcingDefaultId" end
+	if(enum==StrainRateeffectiveEnum) return "StrainRateeffective" end
+	if(enum==StrainRateparallelEnum) return "StrainRateparallel" end
+	if(enum==StrainRateperpendicularEnum) return "StrainRateperpendicular" end
+	if(enum==StrainRatexxEnum) return "StrainRatexx" end
+	if(enum==StrainRatexyEnum) return "StrainRatexy" end
+	if(enum==StrainRatexzEnum) return "StrainRatexz" end
+	if(enum==StrainRateyyEnum) return "StrainRateyy" end
+	if(enum==StrainRateyzEnum) return "StrainRateyz" end
+	if(enum==StrainRatezzEnum) return "StrainRatezz" end
+	if(enum==StressMaxPrincipalEnum) return "StressMaxPrincipal" end
+	if(enum==StressTensorxxEnum) return "StressTensorxx" end
+	if(enum==StressTensorxyEnum) return "StressTensorxy" end
+	if(enum==StressTensorxzEnum) return "StressTensorxz" end
+	if(enum==StressTensoryyEnum) return "StressTensoryy" end
+	if(enum==StressTensoryzEnum) return "StressTensoryz" end
+	if(enum==StressTensorzzEnum) return "StressTensorzz" end
+	if(enum==SurfaceAbsMisfitEnum) return "SurfaceAbsMisfit" end
+	if(enum==SurfaceAbsVelMisfitEnum) return "SurfaceAbsVelMisfit" end
+	if(enum==AreaEnum) return "Area" end
+	if(enum==SealevelAreaEnum) return "SealevelArea" end
+	if(enum==SurfaceAreaEnum) return "SurfaceArea" end
+	if(enum==SurfaceAverageVelMisfitEnum) return "SurfaceAverageVelMisfit" end
+	if(enum==SurfaceCrevasseEnum) return "SurfaceCrevasse" end
+	if(enum==SurfaceEnum) return "Surface" end
+	if(enum==SurfaceOldEnum) return "SurfaceOld" end
+	if(enum==SurfaceLogVelMisfitEnum) return "SurfaceLogVelMisfit" end
+	if(enum==SurfaceLogVxVyMisfitEnum) return "SurfaceLogVxVyMisfit" end
+	if(enum==SurfaceObservationEnum) return "SurfaceObservation" end
+	if(enum==SurfaceRelVelMisfitEnum) return "SurfaceRelVelMisfit" end
+	if(enum==SurfaceSlopeXEnum) return "SurfaceSlopeX" end
+	if(enum==SurfaceSlopeYEnum) return "SurfaceSlopeY" end
+	if(enum==TemperatureEnum) return "Temperature" end
+	if(enum==TemperaturePDDEnum) return "TemperaturePDD" end
+	if(enum==TemperaturePicardEnum) return "TemperaturePicard" end
+	if(enum==TemperatureSEMICEnum) return "TemperatureSEMIC" end
+	if(enum==ThermalforcingAutoregressionNoiseEnum) return "ThermalforcingAutoregressionNoise" end
+	if(enum==ThermalforcingValuesAutoregressionEnum) return "ThermalforcingValuesAutoregression" end
+	if(enum==ThermalSpctemperatureEnum) return "ThermalSpctemperature" end
+	if(enum==ThicknessAbsGradientEnum) return "ThicknessAbsGradient" end
+	if(enum==ThicknessAbsMisfitEnum) return "ThicknessAbsMisfit" end
+	if(enum==ThicknessAcrossGradientEnum) return "ThicknessAcrossGradient" end
+	if(enum==ThicknessAlongGradientEnum) return "ThicknessAlongGradient" end
+	if(enum==ThicknessEnum) return "Thickness" end
+	if(enum==ThicknessOldEnum) return "ThicknessOld" end
+	if(enum==ThicknessPositiveEnum) return "ThicknessPositive" end
+	if(enum==ThicknessResidualEnum) return "ThicknessResidual" end
+	if(enum==TransientAccumulatedDeltaIceThicknessEnum) return "TransientAccumulatedDeltaIceThickness" end
+	if(enum==VelEnum) return "Vel" end
+	if(enum==VxAverageEnum) return "VxAverage" end
+	if(enum==VxBaseEnum) return "VxBase" end
+	if(enum==VxEnum) return "Vx" end
+	if(enum==VxMeshEnum) return "VxMesh" end
+	if(enum==VxObsEnum) return "VxObs" end
+	if(enum==VxShearEnum) return "VxShear" end
+	if(enum==VxSurfaceEnum) return "VxSurface" end
+	if(enum==VyAverageEnum) return "VyAverage" end
+	if(enum==VyBaseEnum) return "VyBase" end
+	if(enum==VyEnum) return "Vy" end
+	if(enum==VyMeshEnum) return "VyMesh" end
+	if(enum==VyObsEnum) return "VyObs" end
+	if(enum==VyShearEnum) return "VyShear" end
+	if(enum==VySurfaceEnum) return "VySurface" end
+	if(enum==VzEnum) return "Vz" end
+	if(enum==VzFSEnum) return "VzFS" end
+	if(enum==VzHOEnum) return "VzHO" end
+	if(enum==VzMeshEnum) return "VzMesh" end
+	if(enum==VzSSAEnum) return "VzSSA" end
+	if(enum==WaterColumnOldEnum) return "WaterColumnOld" end
+	if(enum==WatercolumnEnum) return "Watercolumn" end
+	if(enum==WaterfractionDrainageEnum) return "WaterfractionDrainage" end
+	if(enum==WaterfractionDrainageIntegratedEnum) return "WaterfractionDrainageIntegrated" end
+	if(enum==WaterfractionEnum) return "Waterfraction" end
+	if(enum==WaterheightEnum) return "Waterheight" end
+	if(enum==FrictionWaterPressureEnum) return "FrictionWaterPressure" end
+	if(enum==FrictionWaterPressureNoiseEnum) return "FrictionWaterPressureNoise" end
+	if(enum==WeightsLevelsetObservationEnum) return "WeightsLevelsetObservation" end
+	if(enum==WeightsSurfaceObservationEnum) return "WeightsSurfaceObservation" end
+	if(enum==OldAccumulatedDeltaBottomPressureEnum) return "OldAccumulatedDeltaBottomPressure" end
+	if(enum==OldAccumulatedDeltaIceThicknessEnum) return "OldAccumulatedDeltaIceThickness" end
+	if(enum==OldAccumulatedDeltaTwsEnum) return "OldAccumulatedDeltaTws" end
+	if(enum==Outputdefinition1Enum) return "Outputdefinition1" end
+	if(enum==Outputdefinition10Enum) return "Outputdefinition10" end
+	if(enum==Outputdefinition11Enum) return "Outputdefinition11" end
+	if(enum==Outputdefinition12Enum) return "Outputdefinition12" end
+	if(enum==Outputdefinition13Enum) return "Outputdefinition13" end
+	if(enum==Outputdefinition14Enum) return "Outputdefinition14" end
+	if(enum==Outputdefinition15Enum) return "Outputdefinition15" end
+	if(enum==Outputdefinition16Enum) return "Outputdefinition16" end
+	if(enum==Outputdefinition17Enum) return "Outputdefinition17" end
+	if(enum==Outputdefinition18Enum) return "Outputdefinition18" end
+	if(enum==Outputdefinition19Enum) return "Outputdefinition19" end
+	if(enum==Outputdefinition20Enum) return "Outputdefinition20" end
+	if(enum==Outputdefinition21Enum) return "Outputdefinition21" end
+	if(enum==Outputdefinition22Enum) return "Outputdefinition22" end
+	if(enum==Outputdefinition23Enum) return "Outputdefinition23" end
+	if(enum==Outputdefinition24Enum) return "Outputdefinition24" end
+	if(enum==Outputdefinition25Enum) return "Outputdefinition25" end
+	if(enum==Outputdefinition26Enum) return "Outputdefinition26" end
+	if(enum==Outputdefinition27Enum) return "Outputdefinition27" end
+	if(enum==Outputdefinition28Enum) return "Outputdefinition28" end
+	if(enum==Outputdefinition29Enum) return "Outputdefinition29" end
+	if(enum==Outputdefinition2Enum) return "Outputdefinition2" end
+	if(enum==Outputdefinition30Enum) return "Outputdefinition30" end
+	if(enum==Outputdefinition31Enum) return "Outputdefinition31" end
+	if(enum==Outputdefinition32Enum) return "Outputdefinition32" end
+	if(enum==Outputdefinition33Enum) return "Outputdefinition33" end
+	if(enum==Outputdefinition34Enum) return "Outputdefinition34" end
+	if(enum==Outputdefinition35Enum) return "Outputdefinition35" end
+	if(enum==Outputdefinition36Enum) return "Outputdefinition36" end
+	if(enum==Outputdefinition37Enum) return "Outputdefinition37" end
+	if(enum==Outputdefinition38Enum) return "Outputdefinition38" end
+	if(enum==Outputdefinition39Enum) return "Outputdefinition39" end
+	if(enum==Outputdefinition3Enum) return "Outputdefinition3" end
+	if(enum==Outputdefinition40Enum) return "Outputdefinition40" end
+	if(enum==Outputdefinition41Enum) return "Outputdefinition41" end
+	if(enum==Outputdefinition42Enum) return "Outputdefinition42" end
+	if(enum==Outputdefinition43Enum) return "Outputdefinition43" end
+	if(enum==Outputdefinition44Enum) return "Outputdefinition44" end
+	if(enum==Outputdefinition45Enum) return "Outputdefinition45" end
+	if(enum==Outputdefinition46Enum) return "Outputdefinition46" end
+	if(enum==Outputdefinition47Enum) return "Outputdefinition47" end
+	if(enum==Outputdefinition48Enum) return "Outputdefinition48" end
+	if(enum==Outputdefinition49Enum) return "Outputdefinition49" end
+	if(enum==Outputdefinition4Enum) return "Outputdefinition4" end
+	if(enum==Outputdefinition50Enum) return "Outputdefinition50" end
+	if(enum==Outputdefinition51Enum) return "Outputdefinition51" end
+	if(enum==Outputdefinition52Enum) return "Outputdefinition52" end
+	if(enum==Outputdefinition53Enum) return "Outputdefinition53" end
+	if(enum==Outputdefinition54Enum) return "Outputdefinition54" end
+	if(enum==Outputdefinition55Enum) return "Outputdefinition55" end
+	if(enum==Outputdefinition56Enum) return "Outputdefinition56" end
+	if(enum==Outputdefinition57Enum) return "Outputdefinition57" end
+	if(enum==Outputdefinition58Enum) return "Outputdefinition58" end
+	if(enum==Outputdefinition59Enum) return "Outputdefinition59" end
+	if(enum==Outputdefinition5Enum) return "Outputdefinition5" end
+	if(enum==Outputdefinition60Enum) return "Outputdefinition60" end
+	if(enum==Outputdefinition61Enum) return "Outputdefinition61" end
+	if(enum==Outputdefinition62Enum) return "Outputdefinition62" end
+	if(enum==Outputdefinition63Enum) return "Outputdefinition63" end
+	if(enum==Outputdefinition64Enum) return "Outputdefinition64" end
+	if(enum==Outputdefinition65Enum) return "Outputdefinition65" end
+	if(enum==Outputdefinition66Enum) return "Outputdefinition66" end
+	if(enum==Outputdefinition67Enum) return "Outputdefinition67" end
+	if(enum==Outputdefinition68Enum) return "Outputdefinition68" end
+	if(enum==Outputdefinition69Enum) return "Outputdefinition69" end
+	if(enum==Outputdefinition6Enum) return "Outputdefinition6" end
+	if(enum==Outputdefinition70Enum) return "Outputdefinition70" end
+	if(enum==Outputdefinition71Enum) return "Outputdefinition71" end
+	if(enum==Outputdefinition72Enum) return "Outputdefinition72" end
+	if(enum==Outputdefinition73Enum) return "Outputdefinition73" end
+	if(enum==Outputdefinition74Enum) return "Outputdefinition74" end
+	if(enum==Outputdefinition75Enum) return "Outputdefinition75" end
+	if(enum==Outputdefinition76Enum) return "Outputdefinition76" end
+	if(enum==Outputdefinition77Enum) return "Outputdefinition77" end
+	if(enum==Outputdefinition78Enum) return "Outputdefinition78" end
+	if(enum==Outputdefinition79Enum) return "Outputdefinition79" end
+	if(enum==Outputdefinition7Enum) return "Outputdefinition7" end
+	if(enum==Outputdefinition80Enum) return "Outputdefinition80" end
+	if(enum==Outputdefinition81Enum) return "Outputdefinition81" end
+	if(enum==Outputdefinition82Enum) return "Outputdefinition82" end
+	if(enum==Outputdefinition83Enum) return "Outputdefinition83" end
+	if(enum==Outputdefinition84Enum) return "Outputdefinition84" end
+	if(enum==Outputdefinition85Enum) return "Outputdefinition85" end
+	if(enum==Outputdefinition86Enum) return "Outputdefinition86" end
+	if(enum==Outputdefinition87Enum) return "Outputdefinition87" end
+	if(enum==Outputdefinition88Enum) return "Outputdefinition88" end
+	if(enum==Outputdefinition89Enum) return "Outputdefinition89" end
+	if(enum==Outputdefinition8Enum) return "Outputdefinition8" end
+	if(enum==Outputdefinition90Enum) return "Outputdefinition90" end
+	if(enum==Outputdefinition91Enum) return "Outputdefinition91" end
+	if(enum==Outputdefinition92Enum) return "Outputdefinition92" end
+	if(enum==Outputdefinition93Enum) return "Outputdefinition93" end
+	if(enum==Outputdefinition94Enum) return "Outputdefinition94" end
+	if(enum==Outputdefinition95Enum) return "Outputdefinition95" end
+	if(enum==Outputdefinition96Enum) return "Outputdefinition96" end
+	if(enum==Outputdefinition97Enum) return "Outputdefinition97" end
+	if(enum==Outputdefinition98Enum) return "Outputdefinition98" end
+	if(enum==Outputdefinition99Enum) return "Outputdefinition99" end
+	if(enum==Outputdefinition9Enum) return "Outputdefinition9" end
+	if(enum==Outputdefinition100Enum) return "Outputdefinition100" end
+	if(enum==InputsENDEnum) return "InputsEND" end
+	if(enum==AbsoluteEnum) return "Absolute" end
+	if(enum==AdaptiveTimesteppingEnum) return "AdaptiveTimestepping" end
+	if(enum==AdjointBalancethickness2AnalysisEnum) return "AdjointBalancethickness2Analysis" end
+	if(enum==AdjointBalancethicknessAnalysisEnum) return "AdjointBalancethicknessAnalysis" end
+	if(enum==AdjointHorizAnalysisEnum) return "AdjointHorizAnalysis" end
+	if(enum==AggressiveMigrationEnum) return "AggressiveMigration" end
+	if(enum==AmrBamgEnum) return "AmrBamg" end
+	if(enum==AmrNeopzEnum) return "AmrNeopz" end
+	if(enum==AndroidFrictionCoefficientEnum) return "AndroidFrictionCoefficient" end
+	if(enum==ArrheniusEnum) return "Arrhenius" end
+	if(enum==AutodiffJacobianEnum) return "AutodiffJacobian" end
+	if(enum==Balancethickness2AnalysisEnum) return "Balancethickness2Analysis" end
+	if(enum==Balancethickness2SolutionEnum) return "Balancethickness2Solution" end
+	if(enum==BalancethicknessAnalysisEnum) return "BalancethicknessAnalysis" end
+	if(enum==BalancethicknessApparentMassbalanceEnum) return "BalancethicknessApparentMassbalance" end
+	if(enum==BalancethicknessSoftAnalysisEnum) return "BalancethicknessSoftAnalysis" end
+	if(enum==BalancethicknessSoftSolutionEnum) return "BalancethicknessSoftSolution" end
+	if(enum==BalancethicknessSolutionEnum) return "BalancethicknessSolution" end
+	if(enum==BalancevelocityAnalysisEnum) return "BalancevelocityAnalysis" end
+	if(enum==BalancevelocitySolutionEnum) return "BalancevelocitySolution" end
+	if(enum==BasalforcingsIsmip6Enum) return "BasalforcingsIsmip6" end
+	if(enum==BasalforcingsPicoEnum) return "BasalforcingsPico" end
+	if(enum==BeckmannGoosseFloatingMeltRateEnum) return "BeckmannGoosseFloatingMeltRate" end
+	if(enum==BedSlopeSolutionEnum) return "BedSlopeSolution" end
+	if(enum==BoolExternalResultEnum) return "BoolExternalResult" end
+	if(enum==BoolInputEnum) return "BoolInput" end
+	if(enum==IntInputEnum) return "IntInput" end
+	if(enum==DoubleInputEnum) return "DoubleInput" end
+	if(enum==BoolParamEnum) return "BoolParam" end
+	if(enum==BoundaryEnum) return "Boundary" end
+	if(enum==BuddJackaEnum) return "BuddJacka" end
+	if(enum==CalvingDev2Enum) return "CalvingDev2" end
+	if(enum==CalvingHabEnum) return "CalvingHab" end
+	if(enum==CalvingLevermannEnum) return "CalvingLevermann" end
+	if(enum==CalvingVonmisesEnum) return "CalvingVonmises" end
+	if(enum==CfdragcoeffabsgradEnum) return "Cfdragcoeffabsgrad" end
+	if(enum==CfsurfacelogvelEnum) return "Cfsurfacelogvel" end
+	if(enum==CfsurfacesquareEnum) return "Cfsurfacesquare" end
+	if(enum==CflevelsetmisfitEnum) return "Cflevelsetmisfit" end
+	if(enum==ChannelEnum) return "Channel" end
+	if(enum==ChannelAreaEnum) return "ChannelArea" end
+	if(enum==ChannelAreaOldEnum) return "ChannelAreaOld" end
+	if(enum==ChannelDischargeEnum) return "ChannelDischarge" end
+	if(enum==ClosedEnum) return "Closed" end
+	if(enum==ColinearEnum) return "Colinear" end
+	if(enum==ConstraintsEnum) return "Constraints" end
+	if(enum==ContactEnum) return "Contact" end
+	if(enum==ContourEnum) return "Contour" end
+	if(enum==ContoursEnum) return "Contours" end
+	if(enum==ControlInputEnum) return "ControlInput" end
+	if(enum==ControlInputGradEnum) return "ControlInputGrad" end
+	if(enum==ControlInputMaxsEnum) return "ControlInputMaxs" end
+	if(enum==ControlInputMinsEnum) return "ControlInputMins" end
+	if(enum==ControlInputValuesEnum) return "ControlInputValues" end
+	if(enum==CrouzeixRaviartEnum) return "CrouzeixRaviart" end
+	if(enum==CuffeyEnum) return "Cuffey" end
+	if(enum==CuffeyTemperateEnum) return "CuffeyTemperate" end
+	if(enum==DamageEvolutionAnalysisEnum) return "DamageEvolutionAnalysis" end
+	if(enum==DamageEvolutionSolutionEnum) return "DamageEvolutionSolution" end
+	if(enum==DataSetEnum) return "DataSet" end
+	if(enum==DataSetParamEnum) return "DataSetParam" end
+	if(enum==DatasetInputEnum) return "DatasetInput" end
+	if(enum==DefaultAnalysisEnum) return "DefaultAnalysis" end
+	if(enum==DefaultCalvingEnum) return "DefaultCalving" end
+	if(enum==DenseEnum) return "Dense" end
+	if(enum==DependentObjectEnum) return "DependentObject" end
+	if(enum==DepthAverageAnalysisEnum) return "DepthAverageAnalysis" end
+	if(enum==DeviatoricStressErrorEstimatorEnum) return "DeviatoricStressErrorEstimator" end
+	if(enum==DivergenceEnum) return "Divergence" end
+	if(enum==Domain3DsurfaceEnum) return "Domain3Dsurface" end
+	if(enum==DoubleArrayInputEnum) return "DoubleArrayInput" end
+	if(enum==ArrayInputEnum) return "ArrayInput" end
+	if(enum==DoubleExternalResultEnum) return "DoubleExternalResult" end
+	if(enum==DoubleMatArrayParamEnum) return "DoubleMatArrayParam" end
+	if(enum==DoubleMatExternalResultEnum) return "DoubleMatExternalResult" end
+	if(enum==DoubleMatParamEnum) return "DoubleMatParam" end
+	if(enum==DoubleParamEnum) return "DoubleParam" end
+	if(enum==DoubleVecParamEnum) return "DoubleVecParam" end
+	if(enum==ElementEnum) return "Element" end
+	if(enum==ElementHookEnum) return "ElementHook" end
+	if(enum==ElementSIdEnum) return "ElementSId" end
+	if(enum==EnthalpyAnalysisEnum) return "EnthalpyAnalysis" end
+	if(enum==EsaAnalysisEnum) return "EsaAnalysis" end
+	if(enum==EsaSolutionEnum) return "EsaSolution" end
+	if(enum==EsaTransitionsEnum) return "EsaTransitions" end
+	if(enum==ExternalResultEnum) return "ExternalResult" end
+	if(enum==ExtrapolationAnalysisEnum) return "ExtrapolationAnalysis" end
+	if(enum==ExtrudeFromBaseAnalysisEnum) return "ExtrudeFromBaseAnalysis" end
+	if(enum==ExtrudeFromTopAnalysisEnum) return "ExtrudeFromTopAnalysis" end
+	if(enum==FSApproximationEnum) return "FSApproximation" end
+	if(enum==FSSolverEnum) return "FSSolver" end
+	if(enum==FSpressureEnum) return "FSpressure" end
+	if(enum==FSvelocityEnum) return "FSvelocity" end
+	if(enum==FemModelEnum) return "FemModel" end
+	if(enum==FileParamEnum) return "FileParam" end
+	if(enum==FixedTimesteppingEnum) return "FixedTimestepping" end
+	if(enum==FloatingAreaEnum) return "FloatingArea" end
+	if(enum==FloatingAreaScaledEnum) return "FloatingAreaScaled" end
+	if(enum==FloatingMeltRateEnum) return "FloatingMeltRate" end
+	if(enum==FreeEnum) return "Free" end
+	if(enum==FreeSurfaceBaseAnalysisEnum) return "FreeSurfaceBaseAnalysis" end
+	if(enum==FreeSurfaceTopAnalysisEnum) return "FreeSurfaceTopAnalysis" end
+	if(enum==FrontalForcingsDefaultEnum) return "FrontalForcingsDefault" end
+	if(enum==FrontalForcingsRignotEnum) return "FrontalForcingsRignot" end
+	if(enum==FrontalForcingsRignotAutoregressionEnum) return "FrontalForcingsRignotAutoregression" end
+	if(enum==FsetEnum) return "Fset" end
+	if(enum==FullMeltOnPartiallyFloatingEnum) return "FullMeltOnPartiallyFloating" end
+	if(enum==GLheightadvectionAnalysisEnum) return "GLheightadvectionAnalysis" end
+	if(enum==GaussPentaEnum) return "GaussPenta" end
+	if(enum==GaussSegEnum) return "GaussSeg" end
+	if(enum==GaussTetraEnum) return "GaussTetra" end
+	if(enum==GaussTriaEnum) return "GaussTria" end
+	if(enum==GenericOptionEnum) return "GenericOption" end
+	if(enum==GenericParamEnum) return "GenericParam" end
+	if(enum==GenericExternalResultEnum) return "GenericExternalResult" end
+	if(enum==Gradient1Enum) return "Gradient1" end
+	if(enum==Gradient2Enum) return "Gradient2" end
+	if(enum==Gradient3Enum) return "Gradient3" end
+	if(enum==Gradient4Enum) return "Gradient4" end
+	if(enum==GroundedAreaEnum) return "GroundedArea" end
+	if(enum==GroundedAreaScaledEnum) return "GroundedAreaScaled" end
+	if(enum==GroundingOnlyEnum) return "GroundingOnly" end
+	if(enum==GroundinglineMassFluxEnum) return "GroundinglineMassFlux" end
+	if(enum==GsetEnum) return "Gset" end
+	if(enum==GslEnum) return "Gsl" end
+	if(enum==HOApproximationEnum) return "HOApproximation" end
+	if(enum==HOFSApproximationEnum) return "HOFSApproximation" end
+	if(enum==HookEnum) return "Hook" end
+	if(enum==HydrologyDCEfficientAnalysisEnum) return "HydrologyDCEfficientAnalysis" end
+	if(enum==HydrologyDCInefficientAnalysisEnum) return "HydrologyDCInefficientAnalysis" end
+	if(enum==HydrologyGlaDSAnalysisEnum) return "HydrologyGlaDSAnalysis" end
+	if(enum==HydrologyGlaDSEnum) return "HydrologyGlaDS" end
+	if(enum==HydrologyPismAnalysisEnum) return "HydrologyPismAnalysis" end
+	if(enum==HydrologyShaktiAnalysisEnum) return "HydrologyShaktiAnalysis" end
+	if(enum==HydrologyShreveAnalysisEnum) return "HydrologyShreveAnalysis" end
+	if(enum==HydrologySolutionEnum) return "HydrologySolution" end
+	if(enum==HydrologydcEnum) return "Hydrologydc" end
+	if(enum==HydrologypismEnum) return "Hydrologypism" end
+	if(enum==HydrologyshaktiEnum) return "Hydrologyshakti" end
+	if(enum==HydrologyshreveEnum) return "Hydrologyshreve" end
+	if(enum==IceMassEnum) return "IceMass" end
+	if(enum==IceMassScaledEnum) return "IceMassScaled" end
+	if(enum==IceVolumeAboveFloatationEnum) return "IceVolumeAboveFloatation" end
+	if(enum==IceVolumeAboveFloatationScaledEnum) return "IceVolumeAboveFloatationScaled" end
+	if(enum==IceVolumeEnum) return "IceVolume" end
+	if(enum==IceVolumeScaledEnum) return "IceVolumeScaled" end
+	if(enum==IcefrontMassFluxEnum) return "IcefrontMassFlux" end
+	if(enum==IcefrontMassFluxLevelsetEnum) return "IcefrontMassFluxLevelset" end
+	if(enum==IncrementalEnum) return "Incremental" end
+	if(enum==IndexedEnum) return "Indexed" end
+	if(enum==IntExternalResultEnum) return "IntExternalResult" end
+	if(enum==ElementInputEnum) return "ElementInput" end
+	if(enum==IntMatExternalResultEnum) return "IntMatExternalResult" end
+	if(enum==IntMatParamEnum) return "IntMatParam" end
+	if(enum==IntParamEnum) return "IntParam" end
+	if(enum==IntVecParamEnum) return "IntVecParam" end
+	if(enum==InputsEnum) return "Inputs" end
+	if(enum==InternalEnum) return "Internal" end
+	if(enum==IntersectEnum) return "Intersect" end
+	if(enum==InversionVzObsEnum) return "InversionVzObs" end
+	if(enum==JEnum) return "J" end
+	if(enum==L1L2ApproximationEnum) return "L1L2Approximation" end
+	if(enum==MLHOApproximationEnum) return "MLHOApproximation" end
+	if(enum==L2ProjectionBaseAnalysisEnum) return "L2ProjectionBaseAnalysis" end
+	if(enum==L2ProjectionEPLAnalysisEnum) return "L2ProjectionEPLAnalysis" end
+	if(enum==LACrouzeixRaviartEnum) return "LACrouzeixRaviart" end
+	if(enum==LATaylorHoodEnum) return "LATaylorHood" end
+	if(enum==LambdaSEnum) return "LambdaS" end
+	if(enum==LevelsetAnalysisEnum) return "LevelsetAnalysis" end
+	if(enum==LevelsetfunctionPicardEnum) return "LevelsetfunctionPicard" end
+	if(enum==LinearFloatingMeltRateEnum) return "LinearFloatingMeltRate" end
+	if(enum==LliboutryDuvalEnum) return "LliboutryDuval" end
+	if(enum==LoadsEnum) return "Loads" end
+	if(enum==LoveAnalysisEnum) return "LoveAnalysis" end
+	if(enum==LoveHiEnum) return "LoveHi" end
+	if(enum==LoveHrEnum) return "LoveHr" end
+	if(enum==LoveKernelsImagEnum) return "LoveKernelsImag" end
+	if(enum==LoveKernelsRealEnum) return "LoveKernelsReal" end
+	if(enum==LoveKiEnum) return "LoveKi" end
+	if(enum==LoveKrEnum) return "LoveKr" end
+	if(enum==LoveLiEnum) return "LoveLi" end
+	if(enum==LoveLrEnum) return "LoveLr" end
+	if(enum==LoveSolutionEnum) return "LoveSolution" end
+	if(enum==MINIEnum) return "MINI" end
+	if(enum==MINIcondensedEnum) return "MINIcondensed" end
+	if(enum==MantlePlumeGeothermalFluxEnum) return "MantlePlumeGeothermalFlux" end
+	if(enum==MassFluxEnum) return "MassFlux" end
+	if(enum==MassconEnum) return "Masscon" end
+	if(enum==MassconaxpbyEnum) return "Massconaxpby" end
+	if(enum==MassfluxatgateEnum) return "Massfluxatgate" end
+	if(enum==MasstransportAnalysisEnum) return "MasstransportAnalysis" end
+	if(enum==MasstransportSolutionEnum) return "MasstransportSolution" end
+	if(enum==MatdamageiceEnum) return "Matdamageice" end
+	if(enum==MatenhancediceEnum) return "Matenhancedice" end
+	if(enum==MaterialsEnum) return "Materials" end
+	if(enum==MatestarEnum) return "Matestar" end
+	if(enum==MaticeEnum) return "Matice" end
+	if(enum==MatlithoEnum) return "Matlitho" end
+	if(enum==MathydroEnum) return "Mathydro" end
+	if(enum==MatrixParamEnum) return "MatrixParam" end
+	if(enum==MaxAbsVxEnum) return "MaxAbsVx" end
+	if(enum==MaxAbsVyEnum) return "MaxAbsVy" end
+	if(enum==MaxAbsVzEnum) return "MaxAbsVz" end
+	if(enum==MaxDivergenceEnum) return "MaxDivergence" end
+	if(enum==MaxVelEnum) return "MaxVel" end
+	if(enum==MaxVxEnum) return "MaxVx" end
+	if(enum==MaxVyEnum) return "MaxVy" end
+	if(enum==MaxVzEnum) return "MaxVz" end
+	if(enum==MelangeEnum) return "Melange" end
+	if(enum==MeltingAnalysisEnum) return "MeltingAnalysis" end
+	if(enum==MeshElementsEnum) return "MeshElements" end
+	if(enum==MeshXEnum) return "MeshX" end
+	if(enum==MeshYEnum) return "MeshY" end
+	if(enum==MinVelEnum) return "MinVel" end
+	if(enum==MinVxEnum) return "MinVx" end
+	if(enum==MinVyEnum) return "MinVy" end
+	if(enum==MinVzEnum) return "MinVz" end
+	if(enum==MismipFloatingMeltRateEnum) return "MismipFloatingMeltRate" end
+	if(enum==MoulinEnum) return "Moulin" end
+	if(enum==MpiDenseEnum) return "MpiDense" end
+	if(enum==MpiEnum) return "Mpi" end
+	if(enum==MpiSparseEnum) return "MpiSparse" end
+	if(enum==MumpsEnum) return "Mumps" end
+	if(enum==NoFrictionOnPartiallyFloatingEnum) return "NoFrictionOnPartiallyFloating" end
+	if(enum==NoMeltOnPartiallyFloatingEnum) return "NoMeltOnPartiallyFloating" end
+	if(enum==NodalEnum) return "Nodal" end
+	if(enum==NodalvalueEnum) return "Nodalvalue" end
+	if(enum==NodeSIdEnum) return "NodeSId" end
+	if(enum==NoneApproximationEnum) return "NoneApproximation" end
+	if(enum==NoneEnum) return "None" end
+	if(enum==NumberedcostfunctionEnum) return "Numberedcostfunction" end
+	if(enum==NyeCO2Enum) return "NyeCO2" end
+	if(enum==NyeH2OEnum) return "NyeH2O" end
+	if(enum==NumericalfluxEnum) return "Numericalflux" end
+	if(enum==OceantransportAnalysisEnum) return "OceantransportAnalysis" end
+	if(enum==OceantransportSolutionEnum) return "OceantransportSolution" end
+	if(enum==OldGradientEnum) return "OldGradient" end
+	if(enum==OneLayerP4zEnum) return "OneLayerP4z" end
+	if(enum==OpenEnum) return "Open" end
+	if(enum==OptionEnum) return "Option" end
+	if(enum==ParamEnum) return "Param" end
+	if(enum==ParametersEnum) return "Parameters" end
+	if(enum==P0ArrayEnum) return "P0Array" end
+	if(enum==P0DGEnum) return "P0DG" end
+	if(enum==P1DGEnum) return "P1DG" end
+	if(enum==P1P1Enum) return "P1P1" end
+	if(enum==P1P1GLSEnum) return "P1P1GLS" end
+	if(enum==P1bubbleEnum) return "P1bubble" end
+	if(enum==P1bubblecondensedEnum) return "P1bubblecondensed" end
+	if(enum==P1xP2Enum) return "P1xP2" end
+	if(enum==P1xP3Enum) return "P1xP3" end
+	if(enum==P1xP4Enum) return "P1xP4" end
+	if(enum==P2Enum) return "P2" end
+	if(enum==P2bubbleEnum) return "P2bubble" end
+	if(enum==P2bubblecondensedEnum) return "P2bubblecondensed" end
+	if(enum==P2xP1Enum) return "P2xP1" end
+	if(enum==P2xP4Enum) return "P2xP4" end
+	if(enum==PatersonEnum) return "Paterson" end
+	if(enum==PengridEnum) return "Pengrid" end
+	if(enum==PenpairEnum) return "Penpair" end
+	if(enum==PentaEnum) return "Penta" end
+	if(enum==PentaInputEnum) return "PentaInput" end
+	if(enum==ProfilerEnum) return "Profiler" end
+	if(enum==ProfilingCurrentFlopsEnum) return "ProfilingCurrentFlops" end
+	if(enum==ProfilingCurrentMemEnum) return "ProfilingCurrentMem" end
+	if(enum==ProfilingSolutionTimeEnum) return "ProfilingSolutionTime" end
+	if(enum==RegionaloutputEnum) return "Regionaloutput" end
+	if(enum==RegularEnum) return "Regular" end
+	if(enum==RecoveryAnalysisEnum) return "RecoveryAnalysis" end
+	if(enum==RiftfrontEnum) return "Riftfront" end
+	if(enum==SamplingAnalysisEnum) return "SamplingAnalysis" end
+	if(enum==SamplingSolutionEnum) return "SamplingSolution" end
+	if(enum==SIAApproximationEnum) return "SIAApproximation" end
+	if(enum==SMBautoregressionEnum) return "SMBautoregression" end
+	if(enum==SMBcomponentsEnum) return "SMBcomponents" end
+	if(enum==SMBd18opddEnum) return "SMBd18opdd" end
+	if(enum==SMBforcingEnum) return "SMBforcing" end
+	if(enum==SMBgcmEnum) return "SMBgcm" end
+	if(enum==SMBgembEnum) return "SMBgemb" end
+	if(enum==SMBgradientsEnum) return "SMBgradients" end
+	if(enum==SMBgradientscomponentsEnum) return "SMBgradientscomponents" end
+	if(enum==SMBgradientselaEnum) return "SMBgradientsela" end
+	if(enum==SMBhenningEnum) return "SMBhenning" end
+	if(enum==SMBmeltcomponentsEnum) return "SMBmeltcomponents" end
+	if(enum==SMBpddEnum) return "SMBpdd" end
+	if(enum==SMBpddSicopolisEnum) return "SMBpddSicopolis" end
+	if(enum==SMBsemicEnum) return "SMBsemic" end
+	if(enum==SSAApproximationEnum) return "SSAApproximation" end
+	if(enum==SSAFSApproximationEnum) return "SSAFSApproximation" end
+	if(enum==SSAHOApproximationEnum) return "SSAHOApproximation" end
+	if(enum==ScaledEnum) return "Scaled" end
+	if(enum==SealevelAbsoluteEnum) return "SealevelAbsolute" end
+	if(enum==SealevelEmotionEnum) return "SealevelEmotion" end
+	if(enum==SealevelInertiaTensorXZEnum) return "SealevelInertiaTensorXZ" end
+	if(enum==SealevelInertiaTensorYZEnum) return "SealevelInertiaTensorYZ" end
+	if(enum==SealevelInertiaTensorZZEnum) return "SealevelInertiaTensorZZ" end
+	if(enum==SealevelchangePolarMotionEnum) return "SealevelchangePolarMotion" end
+	if(enum==SealevelNmotionEnum) return "SealevelNmotion" end
+	if(enum==SealevelUmotionEnum) return "SealevelUmotion" end
+	if(enum==SealevelchangeAnalysisEnum) return "SealevelchangeAnalysis" end
+	if(enum==SegEnum) return "Seg" end
+	if(enum==SegInputEnum) return "SegInput" end
+	if(enum==SegmentEnum) return "Segment" end
+	if(enum==SegmentRiftfrontEnum) return "SegmentRiftfront" end
+	if(enum==SeparateEnum) return "Separate" end
+	if(enum==SeqEnum) return "Seq" end
+	if(enum==SmbAnalysisEnum) return "SmbAnalysis" end
+	if(enum==SmbSolutionEnum) return "SmbSolution" end
+	if(enum==SmoothAnalysisEnum) return "SmoothAnalysis" end
+	if(enum==SoftMigrationEnum) return "SoftMigration" end
+	if(enum==SpatialLinearFloatingMeltRateEnum) return "SpatialLinearFloatingMeltRate" end
+	if(enum==SpcDynamicEnum) return "SpcDynamic" end
+	if(enum==SpcStaticEnum) return "SpcStatic" end
+	if(enum==SpcTransientEnum) return "SpcTransient" end
+	if(enum==SsetEnum) return "Sset" end
+	if(enum==StatisticsSolutionEnum) return "StatisticsSolution" end
+	if(enum==SteadystateSolutionEnum) return "SteadystateSolution" end
+	if(enum==StressIntensityFactorEnum) return "StressIntensityFactor" end
+	if(enum==StressbalanceAnalysisEnum) return "StressbalanceAnalysis" end
+	if(enum==StressbalanceConvergenceNumStepsEnum) return "StressbalanceConvergenceNumSteps" end
+	if(enum==StressbalanceSIAAnalysisEnum) return "StressbalanceSIAAnalysis" end
+	if(enum==StressbalanceSolutionEnum) return "StressbalanceSolution" end
+	if(enum==StressbalanceVerticalAnalysisEnum) return "StressbalanceVerticalAnalysis" end
+	if(enum==StringArrayParamEnum) return "StringArrayParam" end
+	if(enum==StringExternalResultEnum) return "StringExternalResult" end
+	if(enum==StringParamEnum) return "StringParam" end
+	if(enum==SubelementFriction1Enum) return "SubelementFriction1" end
+	if(enum==SubelementFriction2Enum) return "SubelementFriction2" end
+	if(enum==SubelementMelt1Enum) return "SubelementMelt1" end
+	if(enum==SubelementMelt2Enum) return "SubelementMelt2" end
+	if(enum==SubelementMigrationEnum) return "SubelementMigration" end
+	if(enum==SurfaceSlopeSolutionEnum) return "SurfaceSlopeSolution" end
+	if(enum==TaylorHoodEnum) return "TaylorHood" end
+	if(enum==TetraEnum) return "Tetra" end
+	if(enum==TetraInputEnum) return "TetraInput" end
+	if(enum==ThermalAnalysisEnum) return "ThermalAnalysis" end
+	if(enum==ThermalSolutionEnum) return "ThermalSolution" end
+	if(enum==ThicknessErrorEstimatorEnum) return "ThicknessErrorEstimator" end
+	if(enum==TotalCalvingFluxLevelsetEnum) return "TotalCalvingFluxLevelset" end
+	if(enum==TotalCalvingMeltingFluxLevelsetEnum) return "TotalCalvingMeltingFluxLevelset" end
+	if(enum==TotalFloatingBmbEnum) return "TotalFloatingBmb" end
+	if(enum==TotalFloatingBmbScaledEnum) return "TotalFloatingBmbScaled" end
+	if(enum==TotalGroundedBmbEnum) return "TotalGroundedBmb" end
+	if(enum==TotalGroundedBmbScaledEnum) return "TotalGroundedBmbScaled" end
+	if(enum==TotalSmbEnum) return "TotalSmb" end
+	if(enum==TotalSmbScaledEnum) return "TotalSmbScaled" end
+	if(enum==TransientArrayParamEnum) return "TransientArrayParam" end
+	if(enum==TransientInputEnum) return "TransientInput" end
+	if(enum==TransientParamEnum) return "TransientParam" end
+	if(enum==TransientSolutionEnum) return "TransientSolution" end
+	if(enum==TriaEnum) return "Tria" end
+	if(enum==TriaInputEnum) return "TriaInput" end
+	if(enum==UzawaPressureAnalysisEnum) return "UzawaPressureAnalysis" end
+	if(enum==VectorParamEnum) return "VectorParam" end
+	if(enum==VertexEnum) return "Vertex" end
+	if(enum==VertexLIdEnum) return "VertexLId" end
+	if(enum==VertexPIdEnum) return "VertexPId" end
+	if(enum==VertexSIdEnum) return "VertexSId" end
+	if(enum==VerticesEnum) return "Vertices" end
+	if(enum==ViscousHeatingEnum) return "ViscousHeating" end
+	if(enum==WaterEnum) return "Water" end
+	if(enum==XTaylorHoodEnum) return "XTaylorHood" end
+	if(enum==XYEnum) return "XY" end
+	if(enum==XYZEnum) return "XYZ" end
+	if(enum==BalancethicknessD0Enum) return "BalancethicknessD0" end
+	if(enum==BalancethicknessDiffusionCoefficientEnum) return "BalancethicknessDiffusionCoefficient" end
+	if(enum==BilinearInterpEnum) return "BilinearInterp" end
+	if(enum==CalvingdevCoeffEnum) return "CalvingdevCoeff" end
+	if(enum==DeviatoricStressEnum) return "DeviatoricStress" end
+	if(enum==EtaAbsGradientEnum) return "EtaAbsGradient" end
+	if(enum==MeshZEnum) return "MeshZ" end
+	if(enum==NearestInterpEnum) return "NearestInterp" end
+	if(enum==OutputdefinitionListEnum) return "OutputdefinitionList" end
+	if(enum==SealevelObsEnum) return "SealevelObs" end
+	if(enum==SealevelWeightsEnum) return "SealevelWeights" end
+	if(enum==StrainRateEnum) return "StrainRate" end
+	if(enum==StressTensorEnum) return "StressTensor" end
+	if(enum==StressbalanceViscosityOvershootEnum) return "StressbalanceViscosityOvershoot" end
+	if(enum==SubelementMigration4Enum) return "SubelementMigration4" end
+	if(enum==TimesteppingTimeAdaptEnum) return "TimesteppingTimeAdapt" end
+	if(enum==TriangleInterpEnum) return "TriangleInterp" end
+	if(enum==MaximumNumberOfDefinitionsEnum) return "MaximumNumberOfDefinitions" end
+end
Index: /issm/trunk/src/jl/core/matice.jl
===================================================================
--- /issm/trunk/src/jl/core/matice.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/matice.jl	(revision 26744)
@@ -0,0 +1,44 @@
+#Matice class definition
+struct Matice#{{{
+	vx_input::ElementInput
+	vy_input::ElementInput
+	B_input::ElementInput
+	n_input::ElementInput
+end# }}}
+
+function Matice(element::Tria) #{{{
+
+	vx_input  = GetInput(element, VxEnum)
+	vy_input  = GetInput(element, VyEnum)
+	B_input   = GetInput(element, MaterialsRheologyBEnum)
+	n_input   = GetInput(element, MaterialsRheologyNEnum)
+
+	return Matice(vx_input, vy_input, B_input, n_input)
+end#}}}
+
+#vertices functions
+function ViscositySSA(matice::Matice, xyz_list::Matrix{Float64}, gauss::GaussTria, i::Int64) #{{{
+
+	#Get strain rate
+	dvx = GetInputDerivativeValue(matice.vx_input,xyz_list,gauss,i)
+	dvy = GetInputDerivativeValue(matice.vy_input,xyz_list,gauss,i)
+	eps_xx = dvx[1]
+	eps_yy = dvy[2]
+	eps_xy = 0.5*(dvx[2] + dvy[1])
+
+	#In SSA, eps_eff^2 = exx^2 + eyy^2 + exy^2 + exx*eyy
+	eps_eff = sqrt(eps_xx*eps_xx + eps_yy*eps_yy + eps_xy*eps_xy + eps_xx*eps_yy)
+
+	#Get B and n
+	n = GetInputValue(matice.n_input, gauss, i)
+	B = GetInputValue(matice.B_input, gauss, i)
+
+	#Compute viscosity
+	if eps_eff==0.
+		mu = 1.e+14/2
+	else
+		mu = B/(2*eps_eff^((n-1)/n))
+	end
+
+	return mu
+end #}}}
Index: /issm/trunk/src/jl/core/modules.jl
===================================================================
--- /issm/trunk/src/jl/core/modules.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/modules.jl	(revision 26744)
@@ -0,0 +1,388 @@
+#Model Processor and Core I/O
+function FetchDataToInput(md::model,inputs::Inputs,elements::Vector{Tria},data::Vector{Float64},enum::IssmEnum) #{{{
+	for i in 1:length(elements)
+		InputCreate(elements[i],inputs,data,enum)
+	end
+end#}}}
+function ModelProcessor(md::model, solutionstring::String) #{{{
+
+	#Initialize structures
+	elements    = Vector{Tria}(undef,0)
+	vertices    = Vector{Vertex}(undef,0)
+	results     = Vector{Result}(undef,0)
+	parameters  = Parameters(Dict{IssmEnum,Parameter}())
+	inputs      = Inputs(md.mesh.numberofelements, md.mesh.numberofvertices, Dict{IssmEnum,Input}())
+
+	#Create  elements, vertices and materials (independent of the analysis)
+	CreateElements(elements, md)
+	CreateVertices(vertices, md)
+	CreateParameters(parameters, md)
+	CreateInputs(inputs,elements, md)
+	if solutionstring=="TransientSolution"
+		UpdateParameters(TransientAnalysis(), parameters, md)
+	end
+
+	#Now create analysis specific data structure
+	if solutionstring=="StressbalanceSolution"
+		analyses = [StressbalanceAnalysis()]
+	elseif solutionstring=="TransientSolution"
+		analyses = [StressbalanceAnalysis(), MasstransportAnalysis()]
+	else
+		error(solutionstring, " not supported by ModelProcessor")
+	end
+
+	#Initialize analysis specific datasets
+	numanalyses = length(analyses)
+	nodes       = Vector{Vector{Node}}(undef,numanalyses)
+	constraints = Vector{Vector{Constraint}}(undef,numanalyses)
+	for i in 1:numanalyses
+		analysis = analyses[i]
+		println("   creating datasets for analysis ", typeof(analysis))
+		nodes[i]       = Vector{Node}(undef,0)
+		constraints[i] = Vector{Constraint}(undef,0)
+
+		UpdateParameters(analysis, parameters, md)
+		UpdateElements(analysis, elements, inputs, md)
+		CreateNodes(analysis, nodes[i], md)
+		CreateConstraints(analysis, constraints[i], md)
+
+		#Configure objects
+		ConfigureObjectx(elements, nodes[i], vertices, parameters, inputs, i)
+	end
+
+	#Build FemModel
+	femmodel = FemModel(analyses, elements, vertices,
+							  Vector{Node}(undef,0), nodes,
+							  parameters, inputs,
+							  Vector{Constraint}(undef,0), constraints,
+							  results)
+
+	println("      detecting active vertices")
+	GetMaskOfIceVerticesLSMx0(femmodel)
+
+	return femmodel
+
+end# }}}
+function CreateElements(elements::Vector{Tria},md::model) #{{{
+
+	#Make sure elements is currently empty
+	@assert length(elements)==0
+
+
+
+	count = 0
+	for i in 1:md.mesh.numberofelements
+
+		#Assume Linear Elements for now
+		vertexids = md.mesh.elements[i,:]
+		nodeids   = md.mesh.elements[i,:]
+
+		#Call constructor and add to dataset elements
+		push!(elements,Tria(i,count, vertexids))
+	end
+
+end# }}}
+function CreateVertices(vertices::Vector{Vertex},md::model) #{{{
+
+	#Make sure vertices is currently empty
+	@assert length(vertices)==0
+
+	#Get data from md
+	x = md.mesh.x
+	y = md.mesh.y
+
+	count = 0
+	for i in 1:md.mesh.numberofvertices
+		push!(vertices,Vertex(i,x[i],y[i],0.))
+	end
+
+end# }}}
+function CreateParameters(parameters::Parameters,md::model) #{{{
+
+	#Get data from md
+	AddParam(parameters,md.materials.rho_ice,MaterialsRhoIceEnum)
+	AddParam(parameters,md.materials.rho_water,MaterialsRhoSeawaterEnum)
+	AddParam(parameters,md.materials.rho_freshwater,MaterialsRhoFreshwaterEnum)
+	AddParam(parameters,md.constants.g,ConstantsGEnum)
+	
+	#Set step and time, this will be overwritten if we run a transient
+	AddParam(parameters,1,StepEnum)
+	AddParam(parameters,0.0,TimeEnum)
+
+end# }}}
+function CreateInputs(inputs::Inputs,elements::Vector{Tria},md::model) #{{{
+
+	#Only assume we have Matice for now
+	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
+	FetchDataToInput(md,inputs,elements,md.materials.rheology_n,MaterialsRheologyNEnum)
+end# }}}
+function OutputResultsx(femmodel::FemModel, md::model, solution::String)# {{{
+
+
+	if solution=="TransientSolution"
+
+		#Compute maximum number of steps
+		maxstep = 0
+		for i in length(femmodel.results)
+			if(femmodel.results[i].step>maxstep) maxstep = femmodel.results[i].step end
+		end
+
+		#Initialize vector now that we know the size
+		output = Vector{Dict}(undef, maxstep)
+		for i in 1:maxstep; output[i] = Dict() end
+
+		#Insert results in vector
+		for i in 1:length(femmodel.results)
+			result = femmodel.results[i]
+			step   = femmodel.results[i].step
+			(output[step])[EnumToString(result.enum)] = result.value
+		end
+	else
+		output = Dict()
+		for i in length(femmodel.results)
+			result = femmodel.results[i]
+			output[EnumToString(result.enum)] = result.value
+		end
+	end
+
+	md.results[solution] = output
+
+end# }}}
+
+#Other modules
+function ConfigureObjectx(elements::Vector{Tria}, nodes::Vector{Node}, vertices::Vector{Vertex}, parameters::Parameters, inputs::Inputs, analysis::Int64) #{{{
+
+	for i in 1:length(elements)
+		Configure(elements[i], nodes, vertices, parameters, inputs, analysis)
+	end
+
+end# }}}
+function SpcNodesx(nodes::Vector{Node},constraints::Vector{Constraint},parameters::Parameters) #{{{
+
+	for i in 1:length(constraints)
+		ConstrainNode(constraints[i],nodes,parameters)
+	end
+
+end# }}}
+function NodesDofx(nodes::Vector{Node}, parameters::Parameters) #{{{
+
+	#Do we have any nodes?
+	if length(nodes)==0
+		return
+	end
+
+	#Do we really need to update dof indexing
+	if(~RequiresDofReindexing(nodes)) return end
+
+	print("   Renumbering degrees of freedom\n")
+	DistributeDofs(nodes,GsetEnum)
+	DistributeDofs(nodes,FsetEnum)
+	DistributeDofs(nodes,SsetEnum)
+
+end# }}}
+function GetSolutionFromInputsx(analysis::Analysis,femmodel::FemModel) #{{{
+
+	#Get size of vector
+	gsize = NumberOfDofs(femmodel.nodes,GsetEnum)
+
+	#Initialize solution vector
+	ug = IssmVector(gsize)
+
+	#Go through elements and plug in solution
+	for i=1:length(femmodel.elements)
+		GetSolutionFromInputs(analysis,ug,femmodel.elements[i])
+	end
+
+	return ug
+
+end#}}}
+function InputUpdateFromSolutionx(analysis::Analysis,ug::IssmVector,femmodel::FemModel) #{{{
+
+	#Go through elements and plug in solution
+	for i=1:length(femmodel.elements)
+		InputUpdateFromSolution(analysis,ug.vector,femmodel.elements[i])
+	end
+
+	return ug
+
+end#}}}
+function InputUpdateFromVectorx(femmodel::FemModel, vector::Vector{Float64}, enum::IssmEnum, layout::IssmEnum)
+
+	#Go through elements and plug in solution
+	for i=1:length(femmodel.elements)
+		InputUpdateFromVector(femmodel.elements[i], vector, enum, layout)
+	end
+
+end#}}}
+function InputDuplicatex(femmodel::FemModel, oldenum::IssmEnum, newenum::IssmEnum) #{{{
+	DuplicateInput(femmodel.inputs, oldenum, newenum)
+end#}}}
+function Reducevectorgtofx(ug::IssmVector,nodes::Vector{Node}) #{{{
+
+	#Get size of output vector
+	fsize = NumberOfDofs(nodes,FsetEnum)
+
+	#Initialize output vector
+	uf = IssmVector(fsize)
+
+	#Go through elements and plug in solution
+	for i=1:length(nodes)
+		VecReduce(nodes[i],ug.vector,uf)
+	end
+
+	return uf
+
+end#}}}
+function Mergesolutionfromftogx(ug::IssmVector, uf::IssmVector, ys::IssmVector, nodes::Vector{Node}) #{{{
+
+	#Go through elements and plug in solution
+	for i=1:length(nodes)
+		VecMerge(nodes[i],ug,uf.vector,ys.vector)
+	end
+
+	return ug
+
+end#}}}
+function Reduceloadx!(pf::IssmVector, Kfs::IssmMatrix, ys::IssmVector) #{{{
+
+	#Is there anything to do?
+	m, n = GetSize(Kfs)
+
+	if(m*n>0)
+
+		#Allocate Kfs*ys
+		Kfsy_s=IssmVector(m)
+
+		#Perform multiplication
+		MatMult!(Kfs,ys,Kfsy_s)
+
+		#Subtract Kfs*ys from pf
+		AXPY!(pf,-1.0,Kfsy_s)
+
+	end
+end#}}}
+function SystemMatricesx(femmodel::FemModel,analysis::Analysis)# {{{
+
+	#Allocate matrices
+	fsize = NumberOfDofs(femmodel.nodes,FsetEnum)
+	ssize = NumberOfDofs(femmodel.nodes,SsetEnum)
+	Kff = IssmMatrix(fsize,fsize)
+	Kfs = IssmMatrix(fsize,ssize)
+	pf  = IssmVector(fsize)
+
+	#Construct Stiffness matrix and load vector from elements
+	for i in 1:length(femmodel.elements)
+		Ke = CreateKMatrix(analysis,femmodel.elements[i])
+		pe = CreatePVector(analysis,femmodel.elements[i])
+
+		if(!isnothing(Ke)) AddToGlobal!(Ke,Kff,Kfs) end
+		if(!isnothing(pe)) AddToGlobal!(pe,pf) end
+	end
+
+	Assemble!(Kff)
+	Assemble!(Kfs)
+	Assemble!(pf)
+	
+	return Kff, Kfs, pf
+end# }}}
+function CreateNodalConstraintsx(nodes::Vector{Node})# {{{
+
+	#Allocate vector
+	ssize=NumberOfDofs(nodes,SsetEnum)
+	ys=IssmVector(ssize)
+
+	#constraints vector with the constraint values
+	for i in 1:length(nodes)
+		CreateNodalConstraints(nodes[i],ys)
+	end
+
+	return ys
+end# }}}
+function RequestedOutputsx(femmodel::FemModel,outputlist::Vector{IssmEnum})# {{{
+
+	#Get Step and Time from parameters
+	step = FindParam(femmodel.parameters,StepEnum)
+	time = FindParam(femmodel.parameters,TimeEnum)
+	
+	#Now fetch results
+	for i in 1:length(outputlist)
+
+		#See if outputlist[i] is an input
+		if outputlist[i]>InputsSTARTEnum && outputlist[i]<InputsENDEnum
+
+			#Create Result
+			input  = GetInput(femmodel.inputs,outputlist[i])
+			result = Result(outputlist[i], step, time, copy(input.values))
+
+			#Add to femmodel.results dataset
+			push!(femmodel.results, result)
+
+		else
+			println("Output ",outputlist[i]," not supported yet")
+		end
+	end
+end# }}}
+function MigrateGroundinglinex(femmodel::FemModel)# {{{
+
+	for i=1:length(femmodel.elements)
+		MigrateGroundingLine(femmodel.elements[i])
+	end
+
+end# }}}
+function UpdateConstraintsx(femmodel::FemModel, analysis::Analysis)# {{{
+
+	#First, see if the analysis needs to change constraints
+	UpdateConstraints(analysis, femmodel)
+
+	#Second, constraints might be time dependent
+	SpcNodesx(femmodel.nodes, femmodel.constraints, femmodel.parameters)
+
+	#Now, update degrees of freedoms
+	NodesDofx(femmodel.nodes, femmodel.parameters)
+
+end# }}}
+function SetActiveNodesLSMx(femmodel::FemModel) #{{{
+
+	#Check mask of each element to see if element is active
+	numnodes = 3
+	mask = Vector{Float64}(undef, numnodes)
+	for i in 1:length(femmodel.elements)
+		GetInputListOnNodes!(femmodel.elements[i], mask, IceMaskNodeActivationEnum)
+		for j in 1:numnodes
+			node = femmodel.elements[i].nodes[j]
+			if(mask[j]==1.) Activate!(node)
+			else             Deactivate!(node)
+			end
+		end
+
+	end
+end#}}}
+function GetMaskOfIceVerticesLSMx0(femmodel::FemModel) #{{{
+
+	#Initialize vector with number of vertices
+	numvertices=length(femmodel.vertices)
+   if(numvertices==0) return end
+
+	#Initialize vector
+	nbv = 3
+	onesvec      = ones(nbv)
+	vec_mask_ice = IssmVector(numvertices)
+	vertexids    = Vector{Int64}(undef, nbv)
+
+	#Assign values to vector
+	for i in 1:length(femmodel.elements)
+		if (IsIceInElement(femmodel.elements[i]))
+			for j in 1:nbv
+				vertexids[j] = femmodel.elements[i].vertices[j].sid
+			end
+			SetValues!(vec_mask_ice, nbv, vertexids, onesvec)
+		end
+	end
+	Assemble!(vec_mask_ice)
+
+	#Serialize vector
+	vec_mask_ice_serial = ToSerial(vec_mask_ice)
+
+	#Update IceMaskNodeActivationEnum in elements
+	InputUpdateFromVectorx(femmodel, vec_mask_ice_serial, IceMaskNodeActivationEnum, VertexSIdEnum)
+end#}}}
Index: /issm/trunk/src/jl/core/nodes.jl
===================================================================
--- /issm/trunk/src/jl/core/nodes.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/nodes.jl	(revision 26744)
@@ -0,0 +1,267 @@
+#Node class definition
+mutable struct Node #{{{
+	id::Int64
+	sid::Int64
+	indexingupdate::Bool
+	active::Bool
+	gsize::Int64
+	gdoflist::Vector{Int64}
+	fdoflist::Vector{Int64}
+	sdoflist::Vector{Int64}
+	svalues::Vector{Float64}
+end# }}}
+
+#Node functions
+function Base.show(io::IO, this::Node)# {{{
+
+	println(io,"Node:")
+	println(io,"   id:  ",this.id)
+	println(io,"   sid: ",this.sid)
+	println(io,"   indexingupdate: ",this.indexingupdate)
+	println(io,"   gsize: ",this.gsize)
+	println(io,"   gdoflist: ",this.gdoflist)
+	println(io,"   fdoflist: ",this.fdoflist)
+	println(io,"   sdoflist: ",this.sdoflist)
+	println(io,"   svalues: ",this.svalues)
+end# }}}
+function Activate!(node::Node) #{{{
+
+	if(!node.active)
+		node.indexingupdate = true
+		node.active = true
+		for i in 1:node.gsize
+			node.fdoflist[i]  = +1
+			node.sdoflist[i]  = -1
+			node.svalues[i]   = 0.0
+		end
+	end
+
+end# }}}
+function Deactivate!(node::Node) #{{{
+
+	if(node.active)
+		node.indexingupdate = true
+		node.active = false
+		for i in 1:node.gsize
+			node.fdoflist[i]  = -1
+			node.sdoflist[i]  = +1
+			node.svalues[i]   = 0.0
+		end
+	end
+
+end# }}}
+function ApplyConstraint(node::Node,dof::Int8,value::Float64) #{{{
+
+	node.indexingupdate = true
+	node.fdoflist[dof]  = -1
+	node.sdoflist[dof]  = +1
+	node.svalues[dof]   = value
+
+end# }}}
+function CreateNodalConstraints(node::Node,ys::IssmVector) #{{{
+
+	if(SSize(node)>0)
+		SetValues!(ys,node.gsize,node.sdoflist,node.svalues)
+	end
+
+end# }}}
+function DistributeDofs(node::Node,setenum::IssmEnum,dofcount::Int64) #{{{
+
+	if setenum==GsetEnum
+		for i in 1:node.gsize
+			node.gdoflist[i] = dofcount
+			dofcount += 1
+		end
+	elseif setenum==FsetEnum
+		for i in 1:node.gsize
+			if  node.fdoflist[i]!=-1
+				@assert node.sdoflist[i]==-1
+				node.fdoflist[i] = dofcount
+				dofcount += 1
+			end
+		end
+	elseif setenum==SsetEnum
+		for i in 1:node.gsize
+			if  node.sdoflist[i]!=-1
+				@assert node.fdoflist[i]==-1
+				node.sdoflist[i] = dofcount
+				dofcount += 1
+			end
+		end
+	else
+		error("not supported")
+	end
+
+	return dofcount
+end# }}}
+function GetNumberOfDofs(node::Node,setenum::IssmEnum) #{{{
+
+	if setenum==GsetEnum
+		dofcount = node.gsize
+	elseif setenum==FsetEnum
+		dofcount = 0
+		for i=1:node.gsize
+			if  node.fdoflist[i]!=-1
+				dofcount += 1
+			end
+		end
+	elseif setenum==SsetEnum
+		dofcount = 0
+		for i=1:node.gsize
+			if  node.sdoflist[i]!=-1
+				dofcount += 1
+			end
+		end
+	else
+		error("not supported")
+	end
+
+	return dofcount
+
+end# }}}
+function GetDofList(node::Node,doflist::Vector{Int64},count::Int64,setenum::IssmEnum) #{{{
+
+	if setenum==GsetEnum
+		for i in 1:node.gsize
+			count += 1
+			doflist[count] = node.gdoflist[i]
+		end
+	elseif setenum==FsetEnum
+		for i=1:node.gsize
+			#if  node.fdoflist[i]!=-1
+				count += 1
+				doflist[count] = node.fdoflist[i]
+			#end
+		end
+	elseif setenum==SsetEnum
+		for i=1:node.gsize
+			#if  node.sdoflist[i]!=-1
+				count += 1
+				doflist[count] = node.sdoflist[i]
+			#end
+		end
+	else
+		error("not supported")
+	end
+
+	return count
+
+end# }}}
+function GetGlobalDofList(nodes::Vector{Node},ndofs::Int64,setenum::IssmEnum) #{{{
+
+	#Allocate list
+	doflist = Vector{Int64}(undef,ndofs)
+
+	#Assign values 
+	count = 0
+	for i in 1:length(nodes)
+		count = GetDofList(nodes[i],doflist,count,setenum)
+	end
+	@assert count==ndofs
+
+	return doflist
+
+end# }}}
+function VecReduce(node::Node,ug::Vector{Float64},uf::IssmVector) #{{{
+
+	for i=1:node.gsize
+		if node.fdoflist[i]!=-1
+			uf.vector[node.fdoflist[i]] = ug[node.gdoflist[i]]
+		end
+	end
+
+end# }}}
+function VecMerge(node::Node,ug::IssmVector,uf::Vector{Float64},ys::Vector{Float64}) #{{{
+
+	fsize = FSize(node)
+	ssize = SSize(node)
+
+	if fsize>0
+		indices = Vector{Int64}(undef,fsize)
+		values  = Vector{Float64}(undef,fsize)
+
+		count = 1
+		for i=1:node.gsize
+			if node.fdoflist[i]!=-1
+				indices[count] = node.gdoflist[i]
+				values[count]  = uf[node.fdoflist[i]]
+				count += 1
+			end
+		end
+		SetValues!(ug,fsize,indices,values)
+	end
+
+	if ssize>0
+		indices = Vector{Int64}(undef,ssize)
+		values  = Vector{Float64}(undef,ssize)
+
+		count = 1
+		for i=1:node.gsize
+			if node.sdoflist[i]!=-1
+				indices[count] = node.gdoflist[i]
+				values[count]  = ys[node.sdoflist[i]]
+				count += 1
+			end
+		end
+		SetValues!(ug,ssize,indices,values)
+	end
+
+end# }}}
+function SSize(node::Node) #{{{
+
+	ssize = 0
+
+	for i=1:node.gsize
+		if node.sdoflist[i]!=-1
+			ssize+=1
+		end
+	end
+
+	return ssize
+
+end# }}}
+function FSize(node::Node) #{{{
+
+	fsize = 0
+
+	for i=1:node.gsize
+		if node.fdoflist[i]!=-1
+			fsize+=1
+		end
+	end
+
+	return fsize
+
+end# }}}
+
+#Nodes functions
+function RequiresDofReindexing(nodes::Vector{Node}) #{{{
+
+	for i in 1:length(nodes)
+		if nodes[i].indexingupdate
+			return true
+		end
+	end
+
+	return false
+
+end# }}}
+function DistributeDofs(nodes::Vector{Node},setenum::IssmEnum) #{{{
+
+	dofcount = 1
+
+	for i in 1:length(nodes)
+		dofcount = DistributeDofs(nodes[i],setenum,dofcount)
+	end
+
+
+end# }}}
+function NumberOfDofs(nodes::Vector{Node},setenum::IssmEnum) #{{{
+
+	numdofs = 0
+	for i in 1:length(nodes)
+		numdofs += GetNumberOfDofs(nodes[i],setenum)
+	end
+	return numdofs
+
+end# }}}
Index: /issm/trunk/src/jl/core/parameters.jl
===================================================================
--- /issm/trunk/src/jl/core/parameters.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/parameters.jl	(revision 26744)
@@ -0,0 +1,53 @@
+#Parameter class definition
+abstract type Parameter end
+struct DoubleParam <: Parameter #{{{
+	enum::IssmEnum
+	value::Float64
+end# }}}
+struct IntParam <: Parameter #{{{
+	enum::IssmEnum
+	value::Int64
+end# }}}
+struct BoolParam <: Parameter #{{{
+	enum::IssmEnum
+	value::Bool
+end# }}}
+
+#Parameters dataset class definition
+mutable struct Parameters #{{{
+	lookup::Dict{IssmEnum,Parameter}
+end# }}}
+
+#Parameter functions
+function GetParameterValue(param::DoubleParam) #{{{
+	return param.value
+end#}}}
+function GetParameterValue(param::IntParam) #{{{
+	return param.value
+end#}}}
+function GetParameterValue(param::BoolParam) #{{{
+	return param.value
+end#}}}
+
+#Parameters functions
+function AddParam(parameters::Parameters,value::Float64,enum::IssmEnum) #{{{
+
+	parameters.lookup[enum] = DoubleParam(enum,value)
+
+end#}}}
+function AddParam(parameters::Parameters,value::Int64, enum::IssmEnum) #{{{
+
+	parameters.lookup[enum] = IntParam(enum,value)
+
+end#}}}
+function AddParam(parameters::Parameters,value::Bool, enum::IssmEnum) #{{{
+
+	parameters.lookup[enum] = BoolParam(enum,value)
+
+end#}}}
+function FindParam(parameters::Parameters,enum::IssmEnum) #{{{
+
+	param = parameters.lookup[enum]
+	return GetParameterValue(param)
+
+end#}}}
Index: /issm/trunk/src/jl/core/results.jl
===================================================================
--- /issm/trunk/src/jl/core/results.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/results.jl	(revision 26744)
@@ -0,0 +1,6 @@
+mutable struct Result #{{{
+	enum::IssmEnum
+	step::Int64
+	time::Float64
+	value
+end#}}}
Index: /issm/trunk/src/jl/core/solutionsequences.jl
===================================================================
--- /issm/trunk/src/jl/core/solutionsequences.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/solutionsequences.jl	(revision 26744)
@@ -0,0 +1,132 @@
+function solutionsequence_linear(femmodel::FemModel,analysis::Analysis) # {{{
+
+	#First, update constraints in case the levelset has changed
+	UpdateConstraintsx(femmodel, analysis)
+
+	#Get new matrices
+	Kff, Kfs, pf = SystemMatricesx(femmodel,analysis)
+
+	#Enforce constraints
+	ys = CreateNodalConstraintsx(femmodel.nodes)
+	Reduceloadx!(pf, Kfs, ys)
+
+	#Solve!
+	uf = Solverx(Kff, pf)
+
+	#Merge uf with ys and update inputs
+	gsize = NumberOfDofs(femmodel.nodes,GsetEnum)
+	ug = IssmVector(gsize)
+	Mergesolutionfromftogx(ug, uf, ys, femmodel.nodes)
+
+	InputUpdateFromSolutionx(analysis, ug, femmodel)
+
+end# }}}
+function solutionsequence_nonlinear(femmodel::FemModel,analysis::Analysis,maxiter::Int64,restol::Float64,reltol::Float64,abstol::Float64) # {{{
+
+	#First, update constraints in case the levelset has changed
+	UpdateConstraintsx(femmodel, analysis)
+
+	#Initialize number of iterations
+	count = 0
+	converged = false
+
+	#Get existing solution
+	ug = GetSolutionFromInputsx(analysis,femmodel)
+	uf = Reducevectorgtofx(ug,femmodel.nodes)
+
+	#Update once again the solution to make sure that vx and vxold are similar (for next step in transient or steadystate)
+	InputUpdateFromSolutionx(analysis,ug,femmodel)
+
+	#Loop until we reach convergence
+	while(~converged)
+
+		#Get new matrices
+		Kff, Kfs, pf = SystemMatricesx(femmodel,analysis)
+
+		#Enforce constraints
+		ys = CreateNodalConstraintsx(femmodel.nodes)
+		Reduceloadx!(pf, Kfs, ys)
+
+		#Solve!
+		old_uf = uf
+		uf = Solverx(Kff, pf, old_uf)
+
+		#Merge uf with ys
+		Mergesolutionfromftogx(ug, uf, ys, femmodel.nodes)
+
+		#Check for convergence
+		converged = convergence(Kff,pf,uf,old_uf,restol,reltol,abstol)
+		InputUpdateFromSolutionx(analysis,ug,femmodel)
+
+		#Increase count
+		count += 1
+		if(count>=maxiter)
+			println("   maximum number of nonlinear iterations (",maxiter,") exceeded")
+			converged = true
+		end
+	end
+
+	print("\n   total number of iterations: ",  count,  "\n")
+
+end# }}}
+function convergence(Kff::IssmMatrix, pf::IssmVector, uf::IssmVector, old_uf::IssmVector, restol::Float64, reltol::Float64, abstol::Float64)#{{{
+
+	print("   checking convergence\n");
+
+	#If solution vector is empty, return true
+	if(IsEmpty(uf))
+		return true
+	end
+
+	#Convergence criterion #1: force equilibrium (Mandatory)
+	#compute K[n]U[n-1] - F
+	KUold  = Duplicate(uf);    MatMult!(Kff,old_uf,KUold)
+	KUoldF = Duplicate(KUold); VecCopy!(KUold, KUoldF); AXPY!(KUoldF, -1.0, pf)
+	nKUoldF = Norm(KUoldF,2)
+	nF      = Norm(pf,2)
+	res = nKUoldF/nF
+	if ~isfinite(res)
+		println("norm nf = ", nF, " and norm kuold = ",nKUoldF)
+		error("mechanical equilibrium convergence criterion is not finite!")
+	end
+	if(res<restol)
+		print("   mechanical equilibrium convergence criterion ", res*100, " < ", restol*100, " %\n")
+		converged=true
+	else
+		print("   mechanical equilibrium convergence criterion ", res*100, " > ", restol*100, " %\n")
+		converged=false;
+	end
+
+	#Convergence criterion #2: norm(du)/norm(u)
+	if ~isnan(reltol)
+		duf = Duplicate(old_uf); VecCopy!(old_uf,duf); AXPY!(duf, -1.0, uf)
+		ndu = Norm(duf, 2); nu = Norm(old_uf, 2)
+		if ~isfinite(ndu) | ~isfinite(nu) 
+			error("convergence criterion is not finite!")
+		end
+		if((ndu/nu)<reltol)
+			print("   Convergence criterion: norm(du)/norm(u)      ", ndu/nu*100, " < ", reltol*100, " %\n")
+		else
+			print("   Convergence criterion: norm(du)/norm(u)      ", ndu/nu*100, " > ", reltol*100, " %\n")
+			converged=false;
+		end
+	end
+
+	#Convergence criterion #3: max(du)
+	if ~isnan(abstol)
+		duf = Duplicate(old_uf); VecCopy!(old_uf,duf); AXPY!(duf, -1.0, uf)
+		nduinf= Norm(duf, 3)
+		if ~isfinite(nduinf) 
+			error("convergence criterion is not finite!")
+		end
+		if(nduinf<abstol)
+			print("   Convergence criterion: max(du)               ", nduinf, " < ", abstol, "\n")
+		else
+			print("   Convergence criterion: max(du)               ", nduinf, " > ", abstol, "\n")
+			converged=false;
+		end
+	end
+
+	return converged
+
+end#}}}
Index: /issm/trunk/src/jl/core/solve.jl
===================================================================
--- /issm/trunk/src/jl/core/solve.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/solve.jl	(revision 26744)
@@ -0,0 +1,45 @@
+include("../usr/classes.jl")
+include("./issmenums.jl")
+include("./toolkits.jl")
+include("./gauss.jl")
+include("./parameters.jl")
+include("./inputs.jl")
+include("./vertices.jl")
+include("./nodes.jl")
+include("./elements.jl")
+include("./constraints.jl")
+include("./results.jl")
+include("./matice.jl")
+include("./friction.jl")
+include("./analyses/analysis.jl")
+include("./femmodel.jl")
+
+#All analyses
+include("./analyses/stressbalanceanalysis.jl")
+include("./analyses/masstransportanalysis.jl")
+include("./analyses/transientanalysis.jl")
+
+include("./solutionsequences.jl")
+include("./modules.jl")
+include("./elementmatrix.jl")
+include("./utils.jl")
+
+function IssmCore(md::model, solutionstring::String) #{{{
+
+	#Construct FemModel
+	femmodel=ModelProcessor(md, solutionstring)
+
+	#Solve FIXME: to be improved later...
+	if(solutionstring=="StressbalanceSolution")
+		analysis = StressbalanceAnalysis()
+	elseif (solutionstring=="TransientSolution")
+		analysis = TransientAnalysis()
+	else
+		error("not supported")
+	end
+	Core(analysis, femmodel)
+
+	#move results to md
+	OutputResultsx(femmodel, md, solutionstring)
+
+end# }}}
Index: /issm/trunk/src/jl/core/toolkits.jl
===================================================================
--- /issm/trunk/src/jl/core/toolkits.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/toolkits.jl	(revision 26744)
@@ -0,0 +1,150 @@
+
+#Toolkit #1: serial sparse arrays
+using SparseArrays
+
+#Matrix
+mutable struct IssmMatrix #{{{
+	M::Int64
+	N::Int64
+	rows::Vector{Int64}
+	cols::Vector{Int64}
+	vals::Vector{Float64}
+	matrix::SparseMatrixCSC{Float64,Int64}
+end #}}}
+function IssmMatrix(M::Int64,N::Int64)#{{{
+	return IssmMatrix(M, N, Vector{Int64}(undef,0), Vector{Int64}(undef,0), Vector{Float64}(undef,0), spzeros(0,0))
+end#}}}
+function AddValues!(matrix::IssmMatrix,m::Int64,midx::Vector{Int64},n::Int64,nidx::Vector{Int64},values::Matrix{Float64})#{{{
+
+	#This is inefficient now, but it will work
+	for i in 1:m
+		if(midx[i]==-1) continue end
+		for j in 1:n
+			if(nidx[j]==-1) continue end
+			push!(matrix.rows, midx[i])
+			push!(matrix.cols, nidx[j])
+			push!(matrix.vals, values[i,j])
+		end
+	end
+
+end#}}}
+function GetSize(matrix::IssmMatrix)#{{{
+
+	return size(matrix.matrix)
+
+end#}}}
+function Assemble!(matrix::IssmMatrix)#{{{
+
+	matrix.matrix = sparse(matrix.rows, matrix.cols, matrix.vals, matrix.M, matrix.N)
+
+end#}}}
+
+#Vector
+mutable struct IssmVector #{{{
+	vector::Vector{Float64}
+end #}}}
+function IssmVector(M::Int64)#{{{
+	return IssmVector(zeros(M))
+end#}}}
+function GetSize(vector::IssmVector)#{{{
+
+	return length(vector.vector)
+
+end#}}}
+function AddValues!(vector::IssmVector,m::Int64,midx::Vector{Int64},values::Vector{Float64})#{{{
+
+	#This is inefficient now, but it will work
+	for i in 1:m
+		if(midx[i]==-1) continue end
+		vector.vector[midx[i]] += values[i]
+	end
+
+end#}}}
+function SetValues!(vector::IssmVector,m::Int64,midx::Vector{Int64},values::Vector{Float64})#{{{
+
+	#This is inefficient now, but it will work
+	for i in 1:m
+		if(midx[i]==-1) continue end
+		vector.vector[midx[i]] = values[i]
+	end
+
+end#}}}
+function IsEmpty(vector::IssmVector)#{{{
+
+	return GetSize(vector)==0
+
+end#}}}
+function Duplicate(vector::IssmVector)#{{{
+
+	#Copy data structure
+	M=GetSize(vector)
+	return IssmVector(M)
+
+end#}}}
+function VecCopy!(x::IssmVector,y::IssmVector)#{{{
+
+	y.vector = x.vector
+
+end#}}}
+function Assemble!(vector::IssmVector)#{{{
+
+	#Nothing to do for this toolkit
+
+end#}}}
+function ToSerial(vector::IssmVector)#{{{
+
+	return vector.vector
+
+end#}}}
+function Norm(x::IssmVector,type::Int64)#{{{
+
+	norm = 0
+
+	if type==2
+		for i in 1:length(x.vector)
+			norm += x.vector[i]^2
+		end
+		norm = sqrt(norm)
+	elseif type==3
+		#Infinite norm
+		for i in 1:length(x.vector)
+			if(abs(x.vector[i])>norm) norm = abs(x.vector[i]) end
+		end
+	else
+		error("type ",type," not supported yet")
+	end
+
+	return norm
+
+end#}}}
+
+#Operations
+function MatMult!(A::IssmMatrix,x::IssmVector,y::IssmVector) #{{{
+
+	y.vector = A.matrix*x.vector
+
+end#}}}
+function AXPY!(y::IssmVector,alpha::Float64,x::IssmVector) #{{{
+
+	y.vector = alpha*x.vector + y.vector
+
+end#}}}
+function Solverx(A::IssmMatrix, b::IssmVector, xold::IssmVector) #{{{
+
+	#Initialize output
+	#x = IssmVector(GetSize(xold))
+	
+	return Solverx(A, b)
+
+end#}}}
+function Solverx(A::IssmMatrix, b::IssmVector) #{{{
+
+	#Initialize output
+	x = IssmVector(0)
+
+	#Solve linear system
+	x.vector = A.matrix\b.vector
+
+	return x
+
+end#}}}
Index: /issm/trunk/src/jl/core/utils.jl
===================================================================
--- /issm/trunk/src/jl/core/utils.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/utils.jl	(revision 26744)
@@ -0,0 +1,26 @@
+function Matrix2x2Determinant(A::Matrix{Float64}) #{{{
+
+	return  A[1,1]*A[2,2]-A[2,1]*A[1,2]
+
+end#}}}
+function Matrix2x2Invert(A::Matrix{Float64}) #{{{
+
+	#Initialize output
+	Ainv = Matrix{Float64}(undef,2,2)
+
+	#Compute determinant
+	det = Matrix2x2Determinant(A)
+	if(abs(det)<eps(Float64)) error("Determinant smaller than machine epsilon") end
+
+	#Multiplication is faster than divsion, so we multiply by the reciprocal
+	det_reciprocal = 1/det
+
+	#compute invert matrix
+	Ainv[1,1]=   A[2,2]*det_reciprocal # =  d/det
+   Ainv[1,2]= - A[1,2]*det_reciprocal # = -b/det
+   Ainv[2,1]= - A[2,1]*det_reciprocal # = -c/det
+   Ainv[2,2]=   A[1,1]*det_reciprocal # =  a/det
+
+	return  Ainv
+
+end#}}}
Index: /issm/trunk/src/jl/core/vertices.jl
===================================================================
--- /issm/trunk/src/jl/core/vertices.jl	(revision 26744)
+++ /issm/trunk/src/jl/core/vertices.jl	(revision 26744)
@@ -0,0 +1,26 @@
+#Vertex class definition
+mutable struct Vertex#{{{
+	sid::Int64
+	x::Float64
+	y::Float64
+	z::Float64
+end# }}}
+
+#vertices functions
+function GetVerticesCoordinates(vertices::Vector{Vertex}) #{{{
+
+	#Intermediaries
+	nbv = length(vertices)
+
+	#Allocate
+	xyz_list = Matrix{Float64}(undef,nbv,3)
+
+	#Assign value to xyz_list
+	for i in 1:nbv
+		xyz_list[i,1]=vertices[i].x
+		xyz_list[i,2]=vertices[i].y
+		xyz_list[i,3]=vertices[i].z
+	end
+
+	return xyz_list
+end #}}}
Index: /issm/trunk/src/jl/issm.jl
===================================================================
--- /issm/trunk/src/jl/issm.jl	(revision 26744)
+++ /issm/trunk/src/jl/issm.jl	(revision 26744)
@@ -0,0 +1,20 @@
+# Julia version of the Ice-sheet and Sea-level System Model
+#
+# Author: Mathieu Morlighem
+# email:  mathieu.morlighem@dartmouth.edu
+
+module ISSM
+
+include("usr/classes.jl")
+export model
+include("usr/exp.jl")
+export expread, ContourToNodes
+include("usr/utils.jl")
+export archread, solve, issmdir
+include("usr/triangle.jl")
+export triangle
+include("usr/parameterization.jl")
+export setmask, InterpFromMeshToMesh2d
+include("core/solve.jl")
+
+end
Index: /issm/trunk/src/jl/tests/test.jl
===================================================================
--- /issm/trunk/src/jl/tests/test.jl	(revision 26744)
+++ /issm/trunk/src/jl/tests/test.jl	(revision 26744)
@@ -0,0 +1,14 @@
+#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
+include("../issm.jl")
+using .ISSM
+using MAT
+
+#Load model from MATLAB file
+#file = matopen("./Pig.mat")
+file = matopen("/Users/mmorligh/Desktop/issmuci/trunk-jpl/test/NightlyRun/temp.mat")
+mat  = read(file, "md")
+close(file)
+md = model(mat)
+
+#Solve stress balance
+md = solve(md, "Stressbalance")
Index: /issm/trunk/src/jl/tests/test101.jl
===================================================================
--- /issm/trunk/src/jl/tests/test101.jl	(revision 26744)
+++ /issm/trunk/src/jl/tests/test101.jl	(revision 26744)
@@ -0,0 +1,45 @@
+#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
+include("../issm.jl")
+using .ISSM
+
+md = model()
+md = triangle(md,issmdir()*"/test/Exp/Square.exp",50000.)
+md = setmask(md,"all","")
+
+#Geometry
+hmin=300.
+hmax=1000.
+ymin=minimum(md.mesh.y)
+ymax=maximum(md.mesh.y)
+xmin=minimum(md.mesh.x)
+xmax=maximum(md.mesh.x)
+md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
+md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
+md.geometry.surface   = md.geometry.base+md.geometry.thickness
+md.geometry.bed       = md.geometry.base .-10
+
+#Initial velocity
+x     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
+y     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
+vx    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
+vy    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
+index = Int.(archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","index"))
+md.initialization.vx=0 .*InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y,0.0)
+md.initialization.vy=0 .*InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y,0.0)
+
+md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
+md.materials.rheology_n=3*ones(md.mesh.numberofelements)
+md.friction.coefficient=20*ones(md.mesh.numberofvertices)
+
+md.stressbalance.restol=0.05
+md.stressbalance.reltol=0.05
+md.stressbalance.abstol=NaN
+
+#Boundary conditions
+md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
+md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
+pos = findall(md.mesh.vertexonboundary)
+md.stressbalance.spcvx[pos] .= 0.0
+md.stressbalance.spcvy[pos] .= 0.0
+
+md=solve(md,"Stressbalance")
Index: /issm/trunk/src/jl/tests/test201.jl
===================================================================
--- /issm/trunk/src/jl/tests/test201.jl	(revision 26744)
+++ /issm/trunk/src/jl/tests/test201.jl	(revision 26744)
@@ -0,0 +1,51 @@
+#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
+include("../issm.jl")
+using .ISSM
+
+md = model()
+md = triangle(md,issmdir()*"/test/Exp/Square.exp", 50000.)
+md = setmask(md, "all", "")
+
+#Geometry
+hmin=300.
+hmax=1000.
+ymin=minimum(md.mesh.y)
+ymax=maximum(md.mesh.y)
+xmin=minimum(md.mesh.x)
+xmax=maximum(md.mesh.x)
+md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
+md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
+md.geometry.surface   = md.geometry.base+md.geometry.thickness
+md.geometry.bed       = md.geometry.base .-10
+
+#Initial velocity
+x     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
+y     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
+vx    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
+vy    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
+index = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
+md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
+md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
+
+md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
+md.materials.rheology_n=3*ones(md.mesh.numberofelements)
+md.friction.coefficient=20*ones(md.mesh.numberofvertices)
+
+md.stressbalance.restol=0.1
+md.stressbalance.reltol=0.02
+md.stressbalance.abstol=NaN
+
+#Boundary conditions
+nodefront=ContourToNodes(md.mesh.x,md.mesh.y,issmdir()*"/test/Exp/SquareFront.exp",2.0) .& md.mesh.vertexonboundary
+md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
+md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
+pos = findall(md.mesh.vertexonboundary .& .~nodefront)
+md.mask.ice_levelset[findall(nodefront)] .= 0
+
+segmentsfront=md.mask.ice_levelset[md.mesh.segments[:,1:2]]==0
+segments = findall(vec(sum(Int64.(md.mask.ice_levelset[md.mesh.segments[:,1:2]].==0), dims=2)) .!=2)
+pos=md.mesh.segments[segments,1:2]
+md.stressbalance.spcvx[pos] .= 0.0
+md.stressbalance.spcvy[pos] .= 0.0
+
+md=solve(md,"Stressbalance")
Index: /issm/trunk/src/jl/tests/test208.jl
===================================================================
--- /issm/trunk/src/jl/tests/test208.jl	(revision 26744)
+++ /issm/trunk/src/jl/tests/test208.jl	(revision 26744)
@@ -0,0 +1,59 @@
+#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
+include("../issm.jl")
+using .ISSM
+
+md = model()
+md = triangle(md,issmdir()*"/test/Exp/Square.exp", 150000.)
+md = setmask(md, "all", "")
+
+#Geometry
+hmin=300.
+hmax=1000.
+ymin=minimum(md.mesh.y)
+ymax=maximum(md.mesh.y)
+xmin=minimum(md.mesh.x)
+xmax=maximum(md.mesh.x)
+md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
+md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
+md.geometry.surface   = md.geometry.base+md.geometry.thickness
+md.geometry.bed       = md.geometry.base .-10
+
+#Initial velocity
+x     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
+y     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
+vx    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
+vy    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
+index = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
+md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
+md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
+
+md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
+md.materials.rheology_n=3*ones(md.mesh.numberofelements)
+md.friction.coefficient=20*ones(md.mesh.numberofvertices)
+
+md.stressbalance.restol=0.1
+md.stressbalance.reltol=0.02
+md.stressbalance.abstol=NaN
+md.timestepping.start_time = 0.0
+md.timestepping.final_time = 3.0
+md.timestepping.time_step  = 1.0
+
+#Boundary conditions
+nodefront=ContourToNodes(md.mesh.x,md.mesh.y,issmdir()*"/test/Exp/SquareFront.exp",2.0) .& md.mesh.vertexonboundary
+md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
+md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
+pos = findall(md.mesh.vertexonboundary .& .~nodefront)
+md.mask.ice_levelset[findall(nodefront)] .= 0
+
+segmentsfront=md.mask.ice_levelset[md.mesh.segments[:,1:2]]==0
+segments = findall(vec(sum(Int64.(md.mask.ice_levelset[md.mesh.segments[:,1:2]].==0), dims=2)) .!=2)
+pos=md.mesh.segments[segments,1:2]
+md.stressbalance.spcvx[pos] .= 0.0
+md.stressbalance.spcvy[pos] .= 0.0
+
+md.smb.mass_balance = zeros(md.mesh.numberofvertices)
+md.basalforcings.groundedice_melting_rate = zeros(md.mesh.numberofvertices)
+md.basalforcings.floatingice_melting_rate = ones(md.mesh.numberofvertices)
+md.masstransport.spcthickness = NaN*ones(md.mesh.numberofvertices)
+
+md=solve(md,"Transient")
Index: /issm/trunk/src/jl/tests/test301.jl
===================================================================
--- /issm/trunk/src/jl/tests/test301.jl	(revision 26744)
+++ /issm/trunk/src/jl/tests/test301.jl	(revision 26744)
@@ -0,0 +1,45 @@
+#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
+include("../issm.jl")
+using .ISSM
+
+md = model()
+md = triangle(md,issmdir()*"/test/Exp/Square.exp",150000.)
+md = setmask(md,"","")
+
+#Geometry
+hmin=300.
+hmax=1000.
+ymin=minimum(md.mesh.y)
+ymax=maximum(md.mesh.y)
+xmin=minimum(md.mesh.x)
+xmax=maximum(md.mesh.x)
+md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
+md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness .+20
+md.geometry.surface   = md.geometry.base+md.geometry.thickness
+md.geometry.bed       = md.geometry.base
+
+#Initial velocity
+#x     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
+#y     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
+#vx    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
+#vy    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
+#index = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
+md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
+md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
+
+md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
+md.materials.rheology_n=3*ones(md.mesh.numberofelements)
+md.friction.coefficient=20*ones(md.mesh.numberofvertices)
+
+md.stressbalance.restol=0.05
+md.stressbalance.reltol=0.05
+md.stressbalance.abstol=NaN
+
+#Boundary conditions
+md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
+md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
+pos = findall(md.mesh.vertexonboundary)
+md.stressbalance.spcvx[pos] .= 0.0
+md.stressbalance.spcvy[pos] .= 0.0
+
+md=solve(md,"Stressbalance")
Index: /issm/trunk/src/jl/tests/test501.jl
===================================================================
--- /issm/trunk/src/jl/tests/test501.jl	(revision 26744)
+++ /issm/trunk/src/jl/tests/test501.jl	(revision 26744)
@@ -0,0 +1,50 @@
+#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
+include("../issm.jl")
+using .ISSM
+
+md = model()
+md = triangle(md,issmdir()*"/test/Exp/Pig.exp",10000.)
+md = setmask( md,issmdir()*"/test/Exp/PigShelves.exp",issmdir()*"/test/Exp/PigIslands.exp")
+
+#Initial velocity and geometry
+x         = archread(issmdir()*"/test/Data/Pig.arch","x")
+y         = archread(issmdir()*"/test/Data/Pig.arch","y")
+vx_obs    = archread(issmdir()*"/test/Data/Pig.arch","vx_obs")
+vy_obs    = archread(issmdir()*"/test/Data/Pig.arch","vy_obs")
+index     = Int.(archread(issmdir()*"/test/Data/Pig.arch","index"))
+surface   = archread(issmdir()*"/test/Data/Pig.arch","surface")
+thickness = archread(issmdir()*"/test/Data/Pig.arch","thickness")
+bed       = archread(issmdir()*"/test/Data/Pig.arch","bed")
+md.initialization.vx=InterpFromMeshToMesh2d(index, x, y, vx_obs, md.mesh.x, md.mesh.y, 0.0)
+md.initialization.vy=InterpFromMeshToMesh2d(index, x, y, vy_obs, md.mesh.x, md.mesh.y, 0.0)
+md.geometry.surface = InterpFromMeshToMesh2d(index, x, y, surface, md.mesh.x, md.mesh.y, 0.0)
+md.geometry.thickness = InterpFromMeshToMesh2d(index, x, y, thickness, md.mesh.x, md.mesh.y, 0.0)
+md.geometry.base=md.geometry.surface .- md.geometry.thickness
+md.geometry.bed =md.geometry.base
+pos = findall(md.mask.ocean_levelset.<0)
+md.geometry.bed[pos] = InterpFromMeshToMesh2d(index, x, y, bed, md.mesh.x[pos], md.mesh.y[pos])
+
+md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
+md.materials.rheology_n=3*ones(md.mesh.numberofelements)
+md.friction.coefficient=50*ones(md.mesh.numberofvertices)
+
+md.stressbalance.restol=0.05
+md.stressbalance.reltol=1.0
+md.stressbalance.abstol=NaN
+
+#Boundary conditions
+pos = findall(vec(sum(Int64.(md.mask.ocean_levelset[md.mesh.elements].<0), dims=2)) .> 0.0)
+vertexonfloatingice=zeros(md.mesh.numberofvertices)
+vertexonfloatingice[md.mesh.elements[pos,:]] .= 1
+nodefront=(md.mesh.vertexonboundary .& (vertexonfloatingice.>0))
+md.mask.ice_levelset[findall(nodefront)] .= 0
+
+md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
+md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
+segmentsfront=md.mask.ice_levelset[md.mesh.segments[:,1:2]]==0
+segments = findall(vec(sum(Int64.(md.mask.ice_levelset[md.mesh.segments[:,1:2]].==0), dims=2)) .!=2)
+pos=md.mesh.segments[segments,1:2]
+md.stressbalance.spcvx[pos] .= 0.0
+md.stressbalance.spcvy[pos] .= 0.0
+
+md=solve(md,"Stressbalance")
Index: /issm/trunk/src/jl/usr/classes.jl
===================================================================
--- /issm/trunk/src/jl/usr/classes.jl	(revision 26744)
+++ /issm/trunk/src/jl/usr/classes.jl	(revision 26744)
@@ -0,0 +1,305 @@
+using Printf
+
+#Model fields
+#Mesh {{{
+abstract type AbstractMesh end
+mutable struct Mesh2dTriangle <: AbstractMesh
+	numberofvertices::Int64
+	numberofelements::Int64
+	x::Vector{Float64}
+	y::Vector{Float64}
+	elements::Matrix{Int64}
+	segments::Matrix{Int64}
+	vertexonboundary::Vector{Bool}
+end
+function Mesh2dTriangle() #{{{
+	return Mesh2dTriangle( 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef, 0), Matrix{Int64}(undef, 0, 0), Matrix{Int64}(undef, 0, 0), Vector{Bool}(undef,0))
+end# }}}
+function Base.show(io::IO, this::Mesh2dTriangle)# {{{
+	IssmStructDisp(io, this)
+end# }}}
+mutable struct Mesh3dPrism{T} <: AbstractMesh
+	numberofvertices::Int64
+	numberofelements::Int64
+	numberoflayers::Int64
+	x::Vector{Float64}
+	y::Vector{Float64}
+	z::Vector{Float64}
+	elements::Matrix{Int64}
+	segments::Matrix{Int64}
+	vertexonboundary::Vector{Bool}
+end
+function Mesh3dPrism() #{{{
+	return Mesh3dPrism( 0, 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Matrix{Int64}(undef, 0, 0), Matrix{Int64}(undef, 0, 0), Vector{Bool}(undef,0))
+end# }}}
+#}}}
+#Geometry{{{
+mutable struct Geometry
+	surface::Vector{Float64}
+	base::Vector{Float64}
+	thickness::Vector{Float64}
+	bed::Vector{Float64}
+end
+function Geometry() #{{{
+	return Geometry( Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+end# }}}
+function Base.show(io::IO, this::Geometry)# {{{
+	IssmStructDisp(io, this)
+end# }}}
+#}}}
+#Mask {{{
+mutable struct Mask
+	ocean_levelset::Vector{Float64}
+	ice_levelset::Vector{Float64}
+end
+function Mask() #{{{
+	return Mask( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+end# }}}
+function Base.show(io::IO, this::Mask)# {{{
+	IssmStructDisp(io, this)
+end# }}}
+#}}}
+#Initialization{{{
+mutable struct Initialization
+	vx::Vector{Float64}
+	vy::Vector{Float64}
+end
+function Initialization() #{{{
+	return Initialization( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+end# }}}
+function Base.show(io::IO, this::Initialization)# {{{
+	IssmStructDisp(io, this)
+end# }}}
+#}}}
+#Stressbalance {{{
+mutable struct Stressbalance
+	spcvx::Vector{Float64}
+	spcvy::Vector{Float64}
+	restol::Float64
+	reltol::Float64
+	abstol::Float64
+	maxiter::Int64
+end
+function Stressbalance() #{{{
+	return Stressbalance( Vector{Float64}(undef,0), Vector{Float64}(undef,0), 1.e-4, 0.01, 10., 100)
+end# }}}
+function Base.show(io::IO, this::Stressbalance)# {{{
+	IssmStructDisp(io, this)
+end# }}}
+#}}}
+#Constants{{{
+mutable struct Constants
+	g::Float64
+	yts::Float64
+end
+function Constants() #{{{
+	return Constants( 9.81,  365*24*3600.)
+end# }}}
+function Base.show(io::IO, this::Constants)# {{{
+	IssmStructDisp(io, this)
+end# }}}
+# }}}
+#Materials {{{
+mutable struct Materials
+	rho_ice::Float64
+	rho_water::Float64
+	rho_freshwater::Float64
+	mu_water::Float64
+	heatcapacity::Float64
+	latentheat::Float64
+	thermalconductivity::Float64
+	temperateiceconductivity::Float64
+	effectiveconductivity_averaging::Int64
+	meltingpoint::Float64
+	beta::Float64
+	mixed_layer_capacity::Float64
+	thermal_exchange_velocity::Float64
+	rheology_B::Vector{Float64}
+	rheology_n::Vector{Float64}
+	rheology_law::String
+end
+function Materials() #{{{
+	return Materials(917., 1023., 1000., 0.001787, 2093., 3.34*10^5, 2.4, .24, 1, 273.15, 9.8*10^-8, 3974., 1.00*10^-4, Vector{Float64}(undef,0), Vector{Float64}(undef,0), "Cuffey")
+end# }}}
+function Base.show(io::IO, this::Materials)# {{{
+	IssmStructDisp(io, this)
+end# }}}
+# }}}
+#Friction {{{
+abstract type AbstractFriction end
+mutable struct BuddFriction <: AbstractFriction
+	coefficient::Vector{Float64}
+end
+function BuddFriction() #{{{
+	return BuddFriction(Vector{Float64}(undef,0))
+end# }}}
+function Base.show(io::IO, this::BuddFriction)# {{{
+	IssmStructDisp(io, this)
+end# }}}
+mutable struct WeertmanFriction <: AbstractFriction
+	C::Vector{Float64}
+	m::Vector{Float64}
+end
+# }}}
+#Basalforcings {{{
+mutable struct Basalforcings
+	groundedice_melting_rate::Vector{Float64}
+	floatingice_melting_rate::Vector{Float64}
+end
+function Basalforcings() #{{{
+	return Basalforcings( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+end# }}}
+function Base.show(io::IO, this::Basalforcings)# {{{
+	IssmStructDisp(io, this)
+end# }}}
+# }}}
+#Surfaceforcings {{{
+mutable struct SMBforcings
+	mass_balance::Vector{Float64}
+end
+function SMBforcings() #{{{
+	return SMBforcings( Vector{Float64}(undef,0))
+end# }}}
+function Base.show(io::IO, this::SMBforcings)# {{{
+	IssmStructDisp(io, this)
+end# }}}
+# }}}
+#Timestepping{{{
+abstract type AbstractTimestepping end
+mutable struct Timestepping <: AbstractTimestepping
+	start_time::Float64
+	final_time::Float64
+	time_step::Float64
+end
+function Timestepping() #{{{
+	return Timestepping( 0., 0., 0.)
+end# }}}
+function Base.show(io::IO, this::Timestepping)# {{{
+	IssmStructDisp(io, this)
+end# }}}
+# }}}
+#Masstransport {{{
+mutable struct Masstransport
+	spcthickness::Vector{Float64}
+	min_thickness::Float64
+	stabilization::Int64
+end
+function Masstransport() #{{{
+	return Masstransport( Vector{Float64}(undef,0), 10.0, 1)
+end# }}}
+function Base.show(io::IO, this::Masstransport)# {{{
+	IssmStructDisp(io, this)
+end# }}}
+# }}}
+#Transient {{{
+mutable struct Transient
+	issmb::Bool
+	ismasstransport::Bool
+	isstressbalance::Bool
+	isgroundingline::Bool
+	ismovingfront::Bool
+end
+function Transient() #{{{
+	return Transient( true, true, true, true, true)
+end# }}}
+function Base.show(io::IO, this::Transient)# {{{
+	IssmStructDisp(io, this)
+end# }}}
+# }}}
+
+#Model structure
+mutable struct model
+	mesh::AbstractMesh
+	geometry::Geometry
+	mask::Mask
+	materials::Materials
+	initialization::Initialization
+	stressbalance::Stressbalance
+	constants::Constants
+	results::Dict
+	friction::AbstractFriction
+	basalforcings::Basalforcings
+	smb::SMBforcings
+	timestepping::Timestepping
+	masstransport::Masstransport
+	transient::Transient
+end
+function model() #{{{
+	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(),
+					 Initialization(),Stressbalance(), Constants(), Dict(),
+					 BuddFriction(), Basalforcings(), SMBforcings(), Timestepping(),
+					 Masstransport(), Transient())
+end#}}}
+function model(matmd::Dict) #{{{
+
+	#initialize output
+	md = model()
+
+	#Loop over all possible fields
+	for name1 in keys(matmd)
+		if !(Symbol(name1) in fieldnames(model))
+			println("could not recover md.",name1)
+			continue
+		end
+		mdfield  = getfield(md,Symbol(name1))
+		matfield = matmd[name1]
+		for name2 in keys(matfield)
+			if !(Symbol(name2) in fieldnames(typeof(mdfield)))
+				println("could not recover md.",name1,".",name2)
+				continue
+			end
+			value_matlab = matfield[name2]
+			value_julia  = getfield(mdfield, Symbol(name2))
+
+			if typeof(value_matlab)==typeof(value_julia)
+				setfield!(mdfield, Symbol(name2), value_matlab)
+
+			elseif typeof(value_matlab)==Float64 && typeof(value_julia)==Int64
+				setfield!(mdfield, Symbol(name2), Int64(value_matlab))
+
+			elseif typeof(value_matlab)==Float64 && typeof(value_julia)==Bool
+				setfield!(mdfield, Symbol(name2), Bool(value_matlab))
+
+			elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Vector{Float64}
+				if(size(value_matlab,2)!=1) error("only one column expected") end
+				setfield!(mdfield, Symbol(name2), value_matlab[:,1])
+
+			elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Matrix{Int64}
+				matrix = Matrix{Int64}(undef,size(value_matlab))
+				for i in 1:length(value_matlab) matrix[i] = Int64(value_matlab[i]) end
+				setfield!(mdfield, Symbol(name2), matrix)
+
+			elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Vector{Bool}
+				if(size(value_matlab,2)!=1) error("only one column expected") end
+				vector = Vector{Bool}(undef,size(value_matlab,1))
+				for i in 1:length(vector) vector[i] = Bool(value_matlab[i]) end
+				setfield!(mdfield, Symbol(name2), vector)
+
+			else
+				error("Don't know how to convert ",typeof(value_matlab)," to ",typeof(value_julia))
+			end
+		end
+	end
+
+	return md
+end#}}}
+function Base.show(io::IO, md::model)# {{{
+
+	compact = get(io, :compact, false)
+
+	println(io,"Model:")
+	@printf "%19s: %-26s -- %s\n" "mesh" typeof(md.mesh) "mesh properties"
+	@printf "%19s: %-26s -- %s\n" "geometry" typeof(md.geometry) "surface elevation, bedrock topography, ice thickness,..."
+	@printf "%19s: %-26s -- %s\n" "mask" typeof(md.mask) "defines grounded and floating regions"
+	@printf "%19s: %-26s -- %s\n" "materials" typeof(md.materials) "material properties"
+	@printf "%19s: %-26s -- %s\n" "initialization" typeof(md.initialization) "initial state"
+	@printf "%19s: %-26s -- %s\n" "constants" typeof(md.constants) "physical constants"
+	@printf "%19s: %-26s -- %s\n" "friction" typeof(md.friction) "basal friction"
+	@printf "%19s: %-26s -- %s\n" "basalforcings" typeof(md.basalforcings) "basal forcings"
+	@printf "%19s: %-26s -- %s\n" "smb" typeof(md.smb) "surface mass balance"
+	@printf "%19s: %-26s -- %s\n" "timestepping" typeof(md.timestepping) "time stepping for transient simulations"
+	@printf "%19s: %-26s -- %s\n" "stressbalance" typeof(md.stressbalance) "parameters stress balance simulations"
+	@printf "%19s: %-26s -- %s\n" "masstransport" typeof(md.masstransport) "parameters mass transport simulations"
+	@printf "%19s: %-26s -- %s\n" "transient" typeof(md.transient) "parameters for transient simulations"
+
+end# }}}
Index: /issm/trunk/src/jl/usr/exp.jl
===================================================================
--- /issm/trunk/src/jl/usr/exp.jl	(revision 26744)
+++ /issm/trunk/src/jl/usr/exp.jl	(revision 26744)
@@ -0,0 +1,234 @@
+#for exptool, look into this http://juliaplots.org/MakieReferenceImages/gallery//mouse_picking/index.html
+
+#exp object definition, constructor, and disp
+mutable struct ExpStruct #{{{
+	name::String
+	nods::Int32
+	density::Float64
+	x::Vector{Float64}
+   y::Vector{Float64}
+	closed::Bool
+end  #}}}
+function ExpStruct() #{{{
+	return ExpStruct("",0, 0., Vector{Float64}(undef,0), Vector{Float64}(undef,0), false)
+end# }}}
+function Base.show(io::IO, exp::ExpStruct)# {{{
+
+	compact = get(io, :compact, false)
+
+	println(io,"ExpStruct:")
+	for name in fieldnames(typeof(exp))
+		a=getfield(exp,name)
+		print(io,"   $(name) = ")
+		if !isempty(a)
+			if compact && eltype(a)<:Number && length(a)>3
+				println(io, typeof(a), " of size ", size(a))
+			else
+				println(io,a)
+			end
+		else
+			println(io,"empty")
+		end
+	end
+end# }}}
+
+#methods
+#expread {{{
+"""
+	EXPREAD - read a file exp and build a Structure
+
+	This function reads an *.exp* and builds a structure containing the fields x
+	and y corresponding to the coordinates, one for the filename of the exp
+	file, for the density, for the nodes, and a field 'closed' to indicate if the
+	domain is closed.
+
+	Usage:
+		exp=expread(filename)
+
+# Examples:
+```julia-repl
+julia> exp=expread('domainoutline.exp')
+```
+
+# Arguments:
+- filename: the ARGUS file to read
+"""
+function expread(filename::String)
+
+	#initialize output
+	contours = Vector{ExpStruct}(undef, 0)
+
+	#open file
+	f = open(filename, "r") do f
+
+		#initialize some variables
+		nprof = 0
+		line = 1
+
+		while !eof(f)
+
+			#read first line
+			A = readline(f); line += 1
+
+			#if isempty, go to the next line and try again
+			if isempty(A)
+				continue
+			else
+				#initialize new profile
+				nprof += 1 
+				exp = ExpStruct();
+			end
+
+			#extract profile name
+			if A[1:8]!="## Name:"
+				println("line $(line): $(A)")
+				error("Unexpected exp file formatting") 
+			end
+			if length(A)>8
+				exp.name = A[9:end]
+			end
+
+			#read Icon
+			A = readline(f); line += 1
+			if A[1:8]!="## Icon:" error("Unexpected exp file formatting") end
+
+			#read Info
+			A = readline(f); line += 1
+			if A[1:14]!="# Points Count"
+				println("line $(line): $(A)")
+				error("Unexpected exp file formatting") 
+			end
+
+			#Reads number of nods and density
+			A = readline(f); line += 1
+			A = parse.(Float64, split(A))
+			if length(A) != 2 error("Unexpected exp file formatting") end
+			exp.nods = A[1]; exp.density = A[2]
+
+			#Allocate arrays
+			if exp.nods<=0 error("Unexpected exp file formatting") end
+			exp.x = Vector{Float64}(undef,exp.nods)
+			exp.y = Vector{Float64}(undef,exp.nods)
+
+			#Read coordinates
+			A = readline(f); line += 1
+			if A[1:13]!="# X pos Y pos" error("Unexpected exp file formatting") end
+			for i in 1:exp.nods
+				A = readline(f); line += 1
+				A = parse.(Float64, split(A))
+				if length(A) != 2 error("Unexpected exp file formatting") end
+				if any(isnan.(A)) error("NaNs found in coordinate") end
+				exp.x[i] = A[1]; exp.y[i] = A[2]
+			end
+
+			#check if closed
+			if exp.nods>1 && exp.x[1]==exp.x[end] && exp.y[1]==exp.y[end]
+				exp.closed = true
+			else
+				exp.closed = false
+			end
+
+			#add profile to list
+			push!(contours, exp)
+		end
+	end
+
+	return contours
+end# }}}
+#ContourToNodes{{{
+"""
+	ContourToNodes - Flag points that are in contour
+
+   More doc to come later....
+
+	Usage:
+		exp=expread(filename)
+
+# Examples:
+```julia-repl
+julia> exp=expread('domainoutline.exp')
+```
+
+# Arguments:
+- filename: the ARGUS file to read
+"""
+function ContourToNodes(x::Vector{Float64},y::Vector{Float64},filename::String,edgevalue::Float64)
+
+	#Read input file
+	contours = expread(filename)
+
+	#Initialize output
+	nbpts = length(x)
+	flags = zeros(Bool,nbpts)
+
+	#Loop over contours
+	for c in 1:length(contours)
+
+		#Get current contours
+		contour = contours[c]
+		xp      = contour.x
+		yp      = contour.y
+
+		#Check that we are within box
+		xmin = minimum(xp); xmax = maximum(xp)
+		ymin = minimum(yp); ymax = maximum(yp)
+
+		#Loop over all points provided
+		for ii in 1:nbpts
+
+			#If this node is already within one of the contours, do not change it
+			if(flags[ii]) continue end
+
+			#Are we within bounds?
+			if(x[ii]<xmin || x[ii]>xmax || y[ii]<ymin || y[ii]>ymax) continue end
+
+			#we are potentially inside... perform pnpoly test
+			flags[ii] = pnpoly(xp, yp, x[ii], y[ii], edgevalue)
+		end
+	end
+	
+	return flags
+end# }}}
+
+function pnpoly(xp::Vector{Float64},yp::Vector{Float64},x::Float64,y::Float64,edgevalue::Float64) #{{{
+
+	npol = length(xp)
+
+	#Do we need to test for colinearity?
+	if(edgevalue!=2)
+		i = 1
+		j = npol
+		while(i<=npol)
+
+			n1 = (yp[i]-yp[j])^2 + (xp[i]-xp[j])^2
+			n2 = (y-yp[j])^2 + (x-xp[j])^2
+
+			normp=sqrt(n1*n2)
+			scalar=(yp[i]-yp[j])*(y-yp[j])+(xp[i]-xp[j])*(x-xp[j])
+
+			if (scalar == normp)
+				if (n2<=n1)
+					return edgevalue
+				end
+			end
+
+			j =  i
+			i += 1
+		end
+	end
+
+	#second test : point is neither on a vertex, nor on a side, where is it ?
+	i = 1
+	j = npol
+	c = false
+	while(i<=npol)
+		if (((yp[i]<=y && y<yp[j]) || (yp[j]<=y && y<yp[i])) &&
+            (x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i]))
+         c = !c
+		end
+
+		j =  i
+		i += 1
+	end
+	return c
+end# }}}
Index: /issm/trunk/src/jl/usr/parameterization.jl
===================================================================
--- /issm/trunk/src/jl/usr/parameterization.jl	(revision 26744)
+++ /issm/trunk/src/jl/usr/parameterization.jl	(revision 26744)
@@ -0,0 +1,54 @@
+# setmask {{{
+"""
+SETMASK - establish boundaries between grounded and floating ice.
+
+   By default, ice is considered grounded. The contour floatingicename defines nodes 
+   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
+   that are grounded (ie: ice rises, islands, etc ...)
+   All input files are in the Argus format (extension .exp).
+
+   Usage:
+      md=setmask(md,floatingicename,groundedicename)
+
+   Examples:
+      md=setmask(md,'all','');
+      md=setmask(md,'Iceshelves.exp','Islands.exp');
+"""
+function setmask(md::model,floatingicename::String,groundedicename::String)
+
+	elementonfloatingice = FlagElements( md, floatingicename)
+	elementongroundedice = FlagElements( md, groundedicename)
+
+	elementonfloatingice = convert( Array{Float64}, (elementonfloatingice.>0) .&  (elementongroundedice.==0.))
+	elementongroundedice = convert( Array{Float64}, elementonfloatingice.==0.)
+
+	vertexonfloatingice=zeros(md.mesh.numberofvertices)
+	vertexongroundedice=zeros(md.mesh.numberofvertices)
+
+	vertexongroundedice[md.mesh.elements[findall(elementongroundedice.>0),:]] .= 1.
+	vertexonfloatingice[findall(vertexongroundedice.==0.)] .= 1.
+
+	#define levelsets
+	md.mask.ocean_levelset = vertexongroundedice
+	md.mask.ocean_levelset[findall(vertexongroundedice .==0.)] .= -1.
+	md.mask.ice_levelset = -1*ones(md.mesh.numberofvertices)
+
+	return md
+end
+#}}}
+# FlagElements {{{
+function FlagElements(md::model,region::String)
+
+	if isempty(region)
+		flags = zeros(md.mesh.numberofelements)
+	elseif region == "all"
+		flags = ones(md.mesh.numberofelements)
+	else
+		xcenter = md.mesh.x[md.mesh.elements]*[1;1;1]/3
+		ycenter = md.mesh.y[md.mesh.elements]*[1;1;1]/3
+		flags = ContourToNodes(xcenter, ycenter, region, 2.)
+	end
+
+	return flags
+end
+#}}}
Index: /issm/trunk/src/jl/usr/plotmodel.jl
===================================================================
--- /issm/trunk/src/jl/usr/plotmodel.jl	(revision 26744)
+++ /issm/trunk/src/jl/usr/plotmodel.jl	(revision 26744)
@@ -0,0 +1,68 @@
+import ColorSchemes.jet
+using  GLMakie
+using .ISSM
+
+function plotmodel( md::model, data::Vector, showvertices::Bool=false, showfacets::Bool=true)
+
+	vertexcolor  = :black
+	facetcolor   = :blue
+
+	if data isa AbstractVector
+
+		if length(data)==md.mesh.numberofelements
+			# vector of polygons
+			x = md.mesh.x
+			y = md.mesh.y
+			index = md.mesh.elements
+			ps = [Makie.GeometryBasics.Polygon([Point2(x[index[i,1]], y[index[i,1]]), Point2(x[index[i,2]], y[index[i,2]]), Point2(x[index[i,3]], y[index[i,3]])])
+					for i in 1:md.mesh.numberofelements]
+
+			fig, ax, h = Makie.poly(ps, color = data, colormap = jet)
+
+			#Add colorbar
+			Colorbar(fig[1, 2], limits = (minimum(data), maximum(data)), colormap = jet)
+		elseif length(data)==md.mesh.numberofvertices
+			fig, ax, h = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = data, colormap = jet)
+
+			#Add colorbar
+			#Colorbar(fig[1, 2], h, width=25)
+		else
+			error("data of size "*string(length(data))*" not supported yet!")
+		end
+	else
+		# default to single color
+		@assert length(data)==1
+		fig, ax, h = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = data, colormap = jet)
+	end
+
+	if showfacets
+		Makie.wireframe!(ax, h[1][], color=facetcolor)
+	end
+
+	if showvertices
+		Makie.scatter!( [md.mesh.x md.mesh.y], markersize = 4, color = vertexcolor)
+	end
+
+	return fig
+end
+
+function plotmodel(md::model,data::BitVector) #{{{
+
+	println("Converting BitVector to Vector")
+	data2 = Vector{Float64}(undef,size(data))
+	for i in 1:length(data)
+		data2[i] = Float64(data[i])
+	end
+
+	plotmodel(md,data2)
+
+end#}}}
+function plotmodel(md::model,data::String) #{{{
+
+	if(data=="mesh")
+		poly([md.mesh.x md.mesh.y], md.mesh.elements, strokewidth=1, shading=false)
+	else
+		error(data, " plot not supported yet")
+	end
+
+end#}}}
Index: /issm/trunk/src/jl/usr/triangle.jl
===================================================================
--- /issm/trunk/src/jl/usr/triangle.jl	(revision 26744)
+++ /issm/trunk/src/jl/usr/triangle.jl	(revision 26744)
@@ -0,0 +1,178 @@
+
+#Class Triangle's triangulateio
+mutable struct CTriangulateIO #{{{
+
+    pointlist :: Ptr{Cdouble}
+    pointattributelist :: Ptr{Cdouble}
+    pointmarkerlist :: Ptr{Cint}
+    numberofpoints :: Cint
+    numberofpointattributes :: Cint
+
+    trianglelist :: Ptr{Cint}
+    triangleattributelist :: Ptr{Cdouble}
+    trianglearealist :: Ptr{Cdouble}
+    neighborlist :: Ptr{Cint}
+    numberoftriangles :: Cint
+    numberofcorners :: Cint
+    numberoftriangleattributes :: Cint
+
+    segmentlist :: Ptr{Cint}
+    segmentmarkerlist :: Ptr{Cint}
+    numberofsegments :: Cint
+
+    holelist :: Ptr{Cdouble}
+    numberofholes :: Cint
+
+    regionlist :: Ptr{Cdouble}
+    numberofregions :: Cint
+
+    edgelist :: Ptr{Cint}
+    edgemarkerlist :: Ptr{Cint}
+    normlist :: Ptr{Cdouble}
+    numberofedges :: Cint
+ end  #}}}
+function CTriangulateIO() #{{{
+	return CTriangulateIO(C_NULL, C_NULL, C_NULL, 0, 0,
+								 C_NULL, C_NULL, C_NULL, C_NULL, 0, 0, 0,
+								 C_NULL, C_NULL, 0,
+								 C_NULL, 0,
+								 C_NULL, 0,
+								 C_NULL, C_NULL, C_NULL, 0)
+end# }}}
+function Base.show(io::IO, tio::CTriangulateIO)# {{{
+	println(io,"CTriangulateIO(")
+	for name in fieldnames(typeof(tio))
+		a=getfield(tio,name)
+		print(io,"$(name) = ")
+		println(io,a)
+	end
+	println(io,")")
+end# }}}
+
+using Printf #needed for sprintf
+
+"""
+TRIANGLE - create model mesh using the triangle package
+
+	This function creates a model mesh using Triangle and a domain outline, to
+	within a certain resolution
+#Arguments
+ - md is a model tuple
+ - domainname is the name of an Argus domain outline file
+ - resolution:  is a characteristic length for the mesh (same unit as the domain outline unit)
+
+# Usage:
+ - md=triangle(md,domainname,resolution)
+# Examples:
+ - md=triangle(md,'DomainOutline.exp',1000);
+ - md=triangle(md,'DomainOutline.exp','Rifts.exp',1500);
+"""
+function triangle(md::model,domainname::String,resolution::Float64) #{{{
+
+	#read input file
+	contours = expread(domainname)
+	area     = resolution^2
+
+	#Initialize i/o structures
+	ctio_in  = CTriangulateIO();
+	ctio_out = CTriangulateIO();
+	vor_out  = CTriangulateIO();
+
+	#Construct input structure
+	numberofpoints   = 0
+	numberofsegments = 0
+	for i in 1:length(contours)
+		numberofpoints   += contours[i].nods-1
+		numberofsegments += contours[i].nods-1
+	end
+	numberofpointattributes = 1
+
+	pointlist=Array{Cdouble,2}(undef,2,numberofpoints)
+	count = 0
+	for i in 1:length(contours)
+		nods = contours[i].nods
+		pointlist[1,count+1:count+nods-1] = contours[i].x[1:end-1]
+		pointlist[2,count+1:count+nods-1] = contours[i].y[1:end-1]
+		count += (nods-1)
+	end
+	pointattributelist=Array{Cdouble,1}(undef,numberofpoints)
+	pointmarkerlist=Array{Cint,1}(undef,numberofpoints)
+	for i in 1:numberofpoints
+		pointmarkerlist[i]=0
+		pointattributelist[i]=0.
+	end
+
+	counter=0;
+   backcounter=0;
+	segmentlist=Array{Cint,2}(undef,2,numberofsegments)
+	segmentmarkerlist=Array{Cint,1}(undef,numberofsegments)
+	segmentmarkerlist[:].=0
+	for i in 1:length(contours)
+		nods = contours[i].nods
+		segmentlist[1,counter+1:counter+nods-2] = collect(counter+0:counter+nods-3)
+		segmentlist[2,counter+1:counter+nods-2] = collect(counter+1:counter+nods-2)
+		counter+=nods-2
+		#close profile
+		segmentlist[1,counter+1]=counter
+		segmentlist[2,counter+1]=backcounter
+		counter+=1
+		backcounter=counter
+	end
+
+	numberofregions = 0
+	numberofholes = length(contours)-1
+	holelist = Array{Cdouble,2}(undef,2,numberofholes)
+	if numberofholes>0
+		 for i in 2:length(contours)
+			 xA=contours[i].x[1]; xB=contours[i].x[end-1]
+			 yA=contours[i].y[1]; yB=contours[i].y[end-1]
+			 xC=(xA+xB)/2;        yC=(yA+yB)/2;
+			 xD=xC+tan(10. /180. *pi)*(yC-yA);
+			 yD=yC+tan(10. /180. *pi)*(xA-xC);
+			 xE=xC-tan(10. /180. *pi)*(yC-yA);
+			 yE=yC-tan(10. /180. *pi)*(xA-xC);
+			 holelist[1,i-1] = xD
+			 holelist[2,i-1] = yD
+		 end
+	end
+
+	#based on this, prepare input structure
+	ctio_in.numberofpoints = numberofpoints
+	ctio_in.pointlist=pointer(pointlist)
+	ctio_in.numberofpointattributes=numberofpointattributes
+	ctio_in.pointattributelist=pointer(pointattributelist)
+	ctio_in.pointmarkerlist=pointer(pointmarkerlist)
+	ctio_in.numberofsegments=numberofsegments
+	ctio_in.segmentlist=pointer(segmentlist)
+	ctio_in.segmentmarkerlist = pointer(segmentmarkerlist)
+	ctio_in.numberofholes=numberofholes
+	ctio_in.holelist=pointer(holelist)
+	ctio_in.numberofregions=0
+
+	#Call triangle using ISSM's default options
+	triangle_switches = "pQzDq30ia"*@sprintf("%lf",area) #replace V by Q to quiet down the logging
+	#rc=ccall( (:triangulate,"libtriangle"),
+	rc=ccall( (:triangulate,issmdir()*"/externalpackages/triangle/src/libtriangle.dylib"),
+				Cint, ( Cstring, Ref{CTriangulateIO}, Ref{CTriangulateIO}, Ref{CTriangulateIO}),
+				triangle_switches, Ref(ctio_in), Ref(ctio_out), Ref(vor_out))
+
+	#post process output
+	points    = convert(Array{Cdouble,2}, Base.unsafe_wrap(Array, ctio_out.pointlist,    (2,Int(ctio_out.numberofpoints)), own=true))'
+	triangles = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.trianglelist, (3,Int(ctio_out.numberoftriangles)), own=true))' .+1
+	segments  = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.segmentlist,  (2,Int(ctio_out.numberofsegments)), own=true))' .+1
+
+	#assign output
+	md.mesh = Mesh2dTriangle()
+	md.mesh.numberofvertices = ctio_out.numberofpoints
+	md.mesh.numberofelements = ctio_out.numberoftriangles
+	md.mesh.x                = points[:,1]
+	md.mesh.y                = points[:,2]
+	md.mesh.elements         = triangles
+	md.mesh.segments         = segments
+
+	#post processing
+	md.mesh.vertexonboundary = zeros(Bool,md.mesh.numberofvertices)
+	md.mesh.vertexonboundary[md.mesh.segments] .= true
+
+   return md
+end#}}}
Index: /issm/trunk/src/jl/usr/utils.jl
===================================================================
--- /issm/trunk/src/jl/usr/utils.jl	(revision 26744)
+++ /issm/trunk/src/jl/usr/utils.jl	(revision 26744)
@@ -0,0 +1,242 @@
+#utils
+function issmdir() #{{{
+	issmdir = ENV["ISSM_DIR"]
+
+	if isempty(issmdir)
+		error("Could not determine the location of ISSM")
+	else
+		return issmdir
+	end
+end#}}}
+function archread(filename::String,variablename::String) #{{{
+
+	#initialize variables
+	found = false
+
+	#open file
+	output = open(filename, "r") do f
+
+		while !eof(f)
+			reclen  = bswap(read(f, Int32))
+			rectype = bswap(read(f, Int32))
+			if rectype!=1
+				error("Expected variable of type string")
+			else
+				fieldname_length = bswap(read(f, Int32))
+				field_name = String(read(f, fieldname_length))
+			end
+			rec_length = bswap(read(f, Int32))
+			field_type = bswap(read(f, Int32))
+			if field_type==2
+				data = bswap(read(f, Float64))
+			elseif field_type==3
+				rows = bswap(read(f, Int32))
+				cols = bswap(read(f, Int32))
+				data = reinterpret(Float64, read(f, sizeof(Float64)*rows*cols))
+				data .= ntoh.(data)
+				data = reshape(data, (rows,cols))
+				data = collect(data)
+				if cols == 1
+					data = vec(data)
+				end
+			else
+				error("Error: Encountered invalid field type when reading data.")
+			end
+
+			if field_name == variablename
+				found = true
+				return data
+			end
+		end
+	end
+
+	return output
+end# }}}
+function InterpFromMeshToMesh2d(index_data::Array,x_data::Vector,y_data::Vector,data::Vector,xout::Vector,yout::Vector,default::Float64=NaN) #{{{
+
+	#Allocate output
+	nods_out = length(xout)
+	data_out = default*ones(nods_out)
+
+	#Interpolation type
+	data_length = size(data,1)
+	nods_data   = length(x_data)
+	nels_data   = size(index_data,1)
+	if(data_length==nods_data)
+		interpolation_type=1;
+	elseif (data_length==nels_data)
+		interpolation_type=2
+	else
+		error("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!")
+	end
+	xmin = minimum(xout); xmax = maximum(xout)
+	ymin = minimum(yout); ymax = maximum(yout)
+
+	for i in 1:nels_data
+
+		#skip element if no overlap
+		if (minimum(x_data[index_data[i,:]]) > xmax) continue end
+		if (minimum(y_data[index_data[i,:]]) > ymax) continue end
+		if (maximum(x_data[index_data[i,:]]) < xmin) continue end
+		if (maximum(y_data[index_data[i,:]]) < ymin) continue end
+
+		#get area of the current element (Jacobian = 2 * area)*/
+		#area =x2 * y3 - y2*x3 + x1 * y2 - y1 * x2 + x3 * y1 - y3 * x1;
+		area = (x_data[index_data[i,2]]*y_data[index_data[i,3]]-y_data[index_data[i,2]]*x_data[index_data[i,3]] 
+				  +  x_data[index_data[i,1]]*y_data[index_data[i,2]]-y_data[index_data[i,1]]*x_data[index_data[i,2]] 
+				  +  x_data[index_data[i,3]]*y_data[index_data[i,1]]-y_data[index_data[i,3]]*x_data[index_data[i,1]])
+
+		for j in 1:nods_out
+			#Get first area coordinate = det(x-x3  x2-x3 ; y-y3   y2-y3)/area
+			area_1=((xout[j]-x_data[index_data[i,3]])*(y_data[index_data[i,2]]-y_data[index_data[i,3]])
+					 -  (yout[j]-y_data[index_data[i,3]])*(x_data[index_data[i,2]]-x_data[index_data[i,3]]))/area
+			#Get second area coordinate =det(x1-x3  x-x3 ; y1-y3   y-y3)/area
+			area_2=((x_data[index_data[i,1]]-x_data[index_data[i,3]])*(yout[j]-y_data[index_data[i,3]])
+					  - (y_data[index_data[i,1]]-y_data[index_data[i,3]])*(xout[j]-x_data[index_data[i,3]]))/area
+			#Get third area coordinate = 1-area1-area2
+			area_3=1-area_1-area_2
+
+			if (area_1>=0 && area_2>=0 && area_3>=0)
+				if (interpolation_type==1)
+					#nodal interpolation
+					data_out[j]=area_1*data[index_data[i,1]]+area_2*data[index_data[i,2]]+area_3*data[index_data[i,3]];
+				else
+					#element interpolation
+					data_out[j]=data[i];
+				end
+			end
+		end
+	end
+	return data_out
+
+	#OLD STUFF!!! not working...
+	
+	#prepare input arrays
+	nods = Cint(length(x))
+	nels = Cint(size(index,1))
+	nods_interp = Cint(length(xout))
+	Cindex=Array{Cint,1}(undef,length(index))
+	for i in 1:size(index,1)
+		for j in 1:3
+			Cindex[(i-1)*3+j] = Int32(index[i,j])
+		end
+	end
+	Cx    = Array{Cdouble,1}(undef,nods)
+	Cy    = Array{Cdouble,1}(undef,nods)
+	Cdata = Array{Cdouble,1}(undef,nods)
+	for i in 1:nods
+		Cx[i]    = x[i]
+		Cy[i]    = y[i]
+		Cdata[i] = data[i]
+	end
+	Cxout = Array{Cdouble,1}(undef,nods_interp)
+	Cyout = Array{Cdouble,1}(undef,nods_interp)
+	for i in 1:nods_interp
+		Cxout[i] = xout[i]
+		Cyout[i] = yout[i]
+	end
+
+	Cdataout = Vector{Float64}(undef,nods_interp)
+
+	#This is not working....
+	rc=ccall( (:InterpFromMeshToMesh2dx,"libISSMCore"),
+				Cint, (Ptr{Ptr{Cdouble}},Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint),
+				Ref(Ref(Cdataout)), Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels,
+				Ref(Cdata), nods, 1, Ref(Cxout), Ref(Cyout), nods_interp)
+
+	#Process output
+	dataout = Vector{Float64}(undef,nods_interp)
+	for i in 1:nods_interp
+		dataout[i] = Cdataout[i]
+	end
+
+	return dataout
+end #}}}
+function InterpFromMeshToMesh2d2(index_data::Array,x_data::Vector,y_data::Vector,data::Vector,xout::Vector,yout::Vector) #{{{
+
+	#prepare input arrays
+	nods = Cint(length(x_data))
+	nels = Cint(size(index_data,1))
+	nods_interp = Cint(length(xout))
+	Cindex=Array{Cint,1}(undef,length(index_data))
+	for i in 1:size(index_data,1)
+		for j in 1:3
+			Cindex[(i-1)*3+j] = Int32(index_data[i,j])
+		end
+	end
+	Cx    = Array{Cdouble,1}(undef,nods)
+	Cy    = Array{Cdouble,1}(undef,nods)
+	Cdata = Array{Cdouble,1}(undef,nods)
+	for i in 1:nods
+		Cx[i]    = x_data[i]
+		Cy[i]    = y_data[i]
+		Cdata[i] = data[i]
+	end
+	Cxout    = Array{Cdouble,1}(undef,nods_interp)
+	Cyout    = Array{Cdouble,1}(undef,nods_interp)
+	Cdataout = Array{Cdouble,1}(undef,nods_interp)
+	for i in 1:nods_interp
+		Cxout[i] = xout[i]
+		Cyout[i] = yout[i]
+	end
+
+	#This is not working....
+	#rc=ccall( (:InterpFromMeshToMesh2dx,"../bamg/libBamg.so"),
+	#			Cint, (Ptr{Cdouble},Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint),
+	#			Ref(Cdataout), Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels,
+	#			Ref(Cdata), nods, 1, Ref(Cxout), Ref(Cyout), nods_interp)
+	#rc=ccall( (:InterpFromMeshToMesh2dx,"../bamg/libBamg.so"),
+	#			Cint, (Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint),
+	#			Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels)
+	#
+	#
+	dataout = Vector{Float64}(undef,nods_interp)
+	rc=ccall( (:InterpFromMeshToMesh2dx3,"/Users/mmorligh/Desktop/issmuci/trunk-jpl/src/jl/bamg/libBamg.dylib"),
+				Cint, (Ptr{Cdouble}, Cint),
+				dataout, nods_interp)
+
+	#Process output
+	for i in 1:nods_interp
+		dataout[i] = Cdataout[i]
+	end
+
+	return dataout
+end #}}}
+function solve(md::model,solution::String) #{{{
+
+	if solution=="sb" || solution=="Stressbalance"
+		solutionstring = "StressbalanceSolution"
+	elseif solution=="tr" || solution=="Transient"
+			solutionstring = "TransientSolution"
+	else
+		error("solutionstring "*solution*" not supported!");
+	end
+
+	IssmCore(md, solutionstring)
+
+	return md
+end #}}}
+function IssmStructDisp(io::IO, modelfield::Any) # {{{
+	println(io,typeof(modelfield),":")
+	for name in fieldnames(typeof(modelfield))
+		a=getfield(modelfield,name)
+		#print(io,"   $(name) = ")
+		@printf "%19s: " name
+		if isa(a,String)
+			println(io, a)
+		elseif length(a)>1
+			if !isempty(a)
+				println(io, typeof(a), " of size ", size(a))
+			else
+				println(io,"empty")
+			end
+		else
+			println(io, a)
+		end
+	end
+end #}}}
+function meshgrid(x::Vector, y::Vector)
+    X = [i for i in x, j in 1:length(y)]
+    Y = [j for i in 1:length(x), j in y]
+    return X, Y
+end
Index: /issm/trunk/src/m/archive/arch.py
===================================================================
--- /issm/trunk/src/m/archive/arch.py	(revision 26743)
+++ /issm/trunk/src/m/archive/arch.py	(revision 26744)
@@ -6,8 +6,8 @@
 
 def archwrite(filename, *args):  # {{{
-    """
-    ARCHWRITE - Write data to a field, given the file name, field name, and data.
-        Usage:
-            archwrite('archive101.arch', 'variable_name', data)
+    """ARCHWRITE - Write data to a field, given the file name, field name, and data.
+
+    Usage:
+        archwrite('archive101.arch', 'variable_name', data)
     """
 
@@ -45,9 +45,9 @@
 
 def archread(filename, fieldname):  # {{{
-    """
-    ARCHREAD - Given an arch file name, and a field name, find and return the data
-                    associated with that field name.
-        Usage:
-            archread('archive101.arch', 'field_var_1')
+    """ARCHREAD - Given an arch file name, and a field name, find and return 
+    the data associated with that field name.
+
+    Usage:
+        archread('archive101.arch', 'field_var_1')
     """
     try:
@@ -76,9 +76,8 @@
 
 def archdisp(filename):  # {{{
-    """
-    ARCHDISP - Given an arch filename, display the contents of that file
-
-        Usage:
-            archdisp('archive101.arch')
+    """ARCHDISP - Given an arch filename, display the contents of that file
+
+    Usage:
+        archdisp('archive101.arch')
     """
     try:
@@ -97,5 +96,5 @@
         print(('\t\tSize:\t\t{0}'.format(result['size'])))
         print(('\t\tDatatype:\t{0}'.format(result['data_type'])))
-    # go to next result
+        # go to next result
         result = read_field(fid)
     # close file
@@ -106,6 +105,5 @@
 # Helper functions
 def write_field_name(fid, data):  # {{{
-    """
-    Routine to write field name (variable name) to an archive file.
+    """Routine to write field name (variable name) to an archive file.
     """
     # write the length of the record
@@ -125,6 +123,5 @@
 
 def write_scalar(fid, data):  # {{{
-    """
-    Procedure to write a double to an arch file pointed to by fid
+    """Procedure to write a double to an arch file pointed to by fid
     """
     # write length of record
@@ -141,6 +138,5 @@
 
 def write_vector(fid, data):  # {{{
-    """
-    Procedure to write a np.array to an arch file
+    """Procedure to write a np.array to an arch file
     """
     # Make sure our vector is the correct shape.
@@ -161,5 +157,5 @@
     reclen = 4 + 4 + 4 + 8 * sz[0] * sz[1]
     # make sure we can fit data into file
-    if reclen > 2**31:
+    if reclen > pow(2, 31):
         raise ValueError("archwrite error : can not write vector to binary file because it is too large")
     fid.write(struct.pack('>i', reclen))
@@ -176,16 +172,17 @@
 
 def read_field(fid):  # {{{
-    """
-    Procedure to read a field and return a results list with the following attributes:
-    result['field_name']     -> the name of the variable that was just read
-    result['size']             -> size (dimensions) of the variable just read
-    result['data_type']     -> the type of data that was just read
-    result['data']             -> the actual data
+    """Procedure to read a field and return a results list with the following 
+    attributes:
+
+        result['field_name']    -> the name of the variable that was just read
+        result['size']          -> size (dimensions) of the variable just read
+        result['data_type']     -> the type of data that was just read
+        result['data']          -> the actual data
     """
 
     try:
         # first, read the string
-        #first read the size and continue reading
-        struct.unpack('>i', fid.read(struct.calcsize('>i')))[0]  #name length
+        # first read the size and continue reading
+        struct.unpack('>i', fid.read(struct.calcsize('>i')))[0]  # name length
         check_name = struct.unpack('>i', fid.read(struct.calcsize('>i')))[0]
         if check_name != 1:
@@ -194,6 +191,6 @@
         fieldname = struct.unpack('>{}s'.format(namelen), fid.read(namelen))[0]
         # then, read the data
-        #first read the size and continue reading
-        struct.unpack('>i', fid.read(struct.calcsize('>i')))[0]  #data length
+        # first read the size and continue reading
+        struct.unpack('>i', fid.read(struct.calcsize('>i')))[0]  # data length
         data_type = struct.unpack('>i', fid.read(struct.calcsize('>i')))[0]
 
@@ -235,22 +232,19 @@
 
 
-def format_archive_code(format):  # {{{
-    """
-    Given a variable, determine it's type and return
-    an integer value:
-
-    1 : string
-    2 : double (scalar)
-    3 : vector or matrix (of type double)
-
-    """
-    if isinstance(format, str):
+def format_archive_code(var):  # {{{
+    """Given a variable, determine it's type and return an integer value:
+
+        1 : string
+        2 : double (scalar)
+        3 : vector or matrix (of type double)
+    """
+    if isinstance(var, str):
         code = 1
-    elif format.shape[0] == 1 and format.shape[1] == 1:
+    elif var.shape[0] == 1 and var.shape[1] == 1:
         code = 2
-    elif isinstance(format, (list, tuple, np.ndarray)):
+    elif isinstance(var, (list, tuple, np.ndarray)):
         code = 3
     else:
-        raise TypeError("archwrite error: data type '%s' is not valid." % type(format))
+        raise TypeError('archwrite error: data type {} is not valid.'.format(type(var)))
     return code
     # }}}
Index: /issm/trunk/src/m/array/arrayoperations.js
===================================================================
--- /issm/trunk/src/m/array/arrayoperations.js	(revision 26743)
+++ /issm/trunk/src/m/array/arrayoperations.js	(revision 26744)
@@ -54,5 +54,5 @@
 	for (var a = 0; a < arguments.length; a++) {
         arg = arguments[a];
-        if (arg instanceof Array) {
+        if (arg instanceof Array || arg instanceof Float64Array) {
             size = arg.length;
             array = arg;
@@ -64,7 +64,7 @@
 	for (var a = 0; a < arguments.length; a++) {
         arg = arguments[a];
-        if (arg instanceof Array && arg.length != size) {
+        if ((arg instanceof Array || arg instanceof Float64Array) && arg.length != size) {
             throw Error("ArrayAdd error message: arrays provided as arguments are not of the same length!");
-        } else if (!(arg instanceof Array) && typeof arg != 'number') {
+        } else if (!(arg instanceof Array || arg instanceof Float64Array) && typeof arg != 'number') {
             throw Error("ArrayAdd error message: arguments provided are not of the type Array or Number!");
         }
@@ -75,9 +75,9 @@
 		if (a != initial) {
 			arg = arguments[a];
-			if (arg instanceof Array) {
+			if (arg instanceof Array || arg instanceof Float64Array) {
 				for(var i = 0; i < result.length; i++){
 					result[i] += arg[i];
 				}
-			} else if (typeof arg != 'number') {
+			} else if (typeof arg === 'number') {
 				for(var i = 0; i < result.length; i++){
 					result[i] += arg;
@@ -94,5 +94,5 @@
 	for (var a = 0; a < arguments.length; a++) {
         arg = arguments[a];
-        if (arg instanceof Array) {
+        if (arg instanceof Array || arg instanceof Float64Array) {
             size = arg.length;
             array = arg;
@@ -104,7 +104,7 @@
 	for (var a = 0; a < arguments.length; a++) {
         arg = arguments[a];
-        if (arg instanceof Array && arg.length != size) {
+        if ((arg instanceof Array || arg instanceof Float64Array) && arg.length != size) {
             throw Error("ArrayAdd error message: arrays provided as arguments are not of the same length!");
-        } else if (!(arg instanceof Array) && typeof arg != 'number') {
+        } else if (!(arg instanceof Array || arg instanceof Float64Array) && typeof arg != 'number') {
             throw Error("ArrayAdd error message: arguments provided are not of the type Array or Number!");
         }
@@ -115,11 +115,57 @@
 		if (a !== initial) {
 			arg = arguments[a];
-			if (arg instanceof Array) {
+			if (arg instanceof Array || arg instanceof Float64Array) {
 				for(var i = 0; i < result.length; i++){
 					result[i] -= arg[i];
 				}
-			} else if (typeof arg != 'number') {
+			} else if (typeof arg === 'number') {
 				for(var i = 0; i < result.length; i++){
 					result[i] -= arg;
+				}
+			}
+        }
+	}
+	return result;
+} //}}}
+function ArraySubtract2D(){ //{{{
+    //Takes in any number of scalars or arrays, and calculates the subtraction. Scalars are treated as similar length arrays of the scalar.
+    //Determine reference array and size
+    var size, array, arg, initial;
+	for (var a = 0; a < arguments.length; a++) {
+        arg = arguments[a];
+        if (arg instanceof Array || arg instanceof Float64Array) {
+            size = arg.length;
+            array = arg;
+			initial = a;
+            break;
+        }
+    }
+	//check internal consistency of arrays provided!: 
+	for (var a = 0; a < arguments.length; a++) {
+        arg = arguments[a];
+        if ((arg instanceof Array || arg instanceof Float64Array) && arg.length != size) {
+            throw Error("ArrayAdd error message: arrays provided as arguments are not of the same length!");
+        } else if (!(arg instanceof Array || arg instanceof Float64Array) && typeof arg != 'number') {
+            throw Error("ArrayAdd error message: arguments provided are not of the type Array or Number!");
+        }
+	}
+	//calculate the result, using the first argument to initialize:
+	var result = [];
+	for (var a = 0; a < arguments.length; a++) {
+		if (a !== initial) {
+			arg = arguments[a];
+			if (arg instanceof Array || arg instanceof Float64Array) {
+				for(var i = 0; i < array.length; i++){
+					result[i] = [];
+					for(var j = 0; j < array[i].length; j++){
+					    result[i][j] = array[i][j] - arg[i][j];
+					}
+				}
+			} else if (typeof arg === 'number') {
+				for(var i = 0; i < array.length; i++){
+					result[i] = [];
+					for(var j = 0; j < array[i].length; j++){
+					    result[i][j] = array[i][j] - arg;
+					}
 				}
 			}
@@ -134,5 +180,5 @@
 	for (var a = 0; a < arguments.length; a++) {
         arg = arguments[a];
-        if (arg instanceof Array) {
+        if (arg instanceof Array || arg instanceof Float64Array) {
             size = arg.length;
             array = arg;
@@ -144,7 +190,7 @@
 	for (var a = 0; a < arguments.length; a++) {
         arg = arguments[a];
-        if (arg instanceof Array && arg.length != size) {
+        if ((arg instanceof Array || arg instanceof Float64Array) && arg.length != size) {
             throw Error("ArrayAdd error message: arrays provided as arguments are not of the same length!");
-        } else if (!(arg instanceof Array) && typeof arg != 'number') {
+        } else if (!(arg instanceof Array || arg instanceof Float64Array) && typeof arg != 'number') {
             throw Error("ArrayAdd error message: arguments provided are not of the type Array or Number!");
         }
@@ -155,9 +201,9 @@
 		if (a !== initial) {
 			arg = arguments[a];
-			if (arg instanceof Array) {
+			if (arg instanceof Array || arg instanceof Float64Array) {
 				for(var i = 0; i < result.length; i++){
 					result[i] *= arg[i];
 				}
-			} else if (typeof arg != 'number') {
+			} else if (typeof arg === 'number') {
 				for(var i = 0; i < result.length; i++){
 					result[i] *= arg;
@@ -174,5 +220,5 @@
 	for (var a = 0; a < arguments.length; a++) {
         arg = arguments[a];
-        if (arg instanceof Array) {
+        if (arg instanceof Array || arg instanceof Float64Array) {
             size = arg.length;
             array = arg;
@@ -184,7 +230,7 @@
 	for (var a = 0; a < arguments.length; a++) {
         arg = arguments[a];
-        if (arg instanceof Array && arg.length != size) {
+        if ((arg instanceof Array || arg instanceof Float64Array) && arg.length != size) {
             throw Error("ArrayAdd error message: arrays provided as arguments are not of the same length!");
-        } else if (!(arg instanceof Array) && typeof arg != 'number') {
+        } else if (!(arg instanceof Array || arg instanceof Float64Array) && typeof arg != 'number') {
             throw Error("ArrayAdd error message: arguments provided are not of the type Array or Number!");
         }
@@ -195,9 +241,9 @@
 		if (a !== initial) {
 			arg = arguments[a];
-			if (arg instanceof Array) {
+			if (arg instanceof Array || arg instanceof Float64Array) {
 				for(var i = 0; i < result.length; i++){
 					result[i] /= arg[i];
 				}
-			} else if (typeof arg != 'number') {
+			} else if (typeof arg === 'number') {
 				for(var i = 0; i < result.length; i++){
 					result[i] /= arg;
@@ -282,27 +328,4 @@
 
 } //}}}
-function ArrayOr(){ //{{{
-    if (arguments.length<2)throw Error("ArrayOr error message: sum has to be for at least two arrays!");
-
-	//check internal consistency of arrays provided!: 
-	var firstarray=arguments[0];
-	var firstsize=firstarray.length;
-	
-	for(var a=1;a<arguments.length;a++){
-		var array=arguments[a];
-		if(array.length!=firstsize)throw Error("ArrayOr error message: arrays provided as arguments are not of the same length!");
-	}
-
-	//do the or:
-	var or=NewArrayFill(firstsize,0);
-	for(var a=0;a<arguments.length;a++){
-		var array=arguments[a];
-		for(var i=0;i<array.length;i++){
-			or[i] = or[i] | array[i];
-		}
-	}
-	return or;
-
-} //}}}
 function ArrayConcat(a, b) { //{{{
 	// Make sure that both typed arrays are of the same type
@@ -322,22 +345,22 @@
 } //}}}
 function ArrayCol(matrix, cols) { //{{{
-    var column = [];
-    if (cols instanceof Array) {
+    var columns = [];
+    if (cols instanceof Array || cols instanceof Float64Array) {
         for (var i = 0; i < matrix.length; i++){
-            var row = [];
-            for (var j = cols[0]; j <= cols[1]; j++){
-                row.push(matrix[i][j]);
+            var col = [];
+            for (var j = 0; j < cols.length; j++){
+                col.push(matrix[i][cols[j]]);
             }
-            column.push(row); 
+            columns.push(col); 
         }
 
     } else if (typeof cols == 'number') {
         for (var i = 0; i < matrix.length; i++){
-            column.push(matrix[i][cols]);
+            columns.push(matrix[i][cols]);
         }
     } else {
         throw new Error("ArrayCol error: cols must be a single integer or an array with 2 integers!");
     }
-   return column;
+   return columns;
 } //}}}
 function ListToMatrix(list, elementsPerSubArray) { //{{{
@@ -445,16 +468,147 @@
     return 0;
 } //}}}
-function ArrayUnique(arr) { //{{{
-
-	return arr.reverse().filter(function (e, i, arr) {
-		    return arr.indexOf(e, i+1) === -1;
-	}).reverse();
-} //}}}
-function ArraySort(array) { //{{{
-
-	return array.sort(function(a, b) {
-		return a - b;
-	});
-
+function ArrayUnique(arr,rows) { //{{{
+	if (arguments.length == 2){
+		if (rows == 'rows') {
+			//See Matlab unique function and https://stackoverflow.com/a/20339709/1905613
+			let equals = (a, b) => JSON.stringify(a) === JSON.stringify(b);
+			let uniques = [];
+			let indexA = [];
+			let indexC = [];
+			let itemsFound = {};;
+			for(let i = 0, l = arr.length; i < l; i++) {
+				let stringified = JSON.stringify(arr[i]);
+				if (typeof(itemsFound[stringified]) != 'undefined') {
+					indexC.push(itemsFound[stringified]);
+					continue;
+				}
+				uniques.push(arr[i]);
+				indexA.push(i);
+				itemsFound[stringified] = uniques.length-1;
+				indexC.push(itemsFound[stringified]);
+			}
+			//assert arr == uniques[indexC,:];
+			for (let i = 0; i < indexC.length; i++) {
+				if (!equals(arr[i], uniques[indexC[i]])) {
+					throw new Error('bad implementation');	
+				}
+			}
+			//assert uniques == arr[indexA, :];
+			for (let i = 0; i < indexA.length; i++) {
+				if (!equals(uniques[i], arr[indexA[i]])) {
+					throw new Error('bad implementation');	
+				}
+			}
+			let [uniquesSorted, indexInToOut, indexOutToIn] = ArraySortWithIndices(uniques);
+			//indexMapping is the index of the edge in the old array
+			indexCSorted = []; //indexC.length == arr.length
+			//assert uniquesSorted[i,:] = uniques[indexInToOut[i],:]
+			for (let i = 0; i < indexInToOut.length; i++) {
+				if (!equals(uniquesSorted[i], uniques[indexInToOut[i]])) {
+					console.log(i, uniquesSorted[indexInToOut[i]], uniques[i]);
+					throw new Error('bad implementation');	
+				}
+			}
+			//assert uniques[i,:] = uniquesSorted[indexOutToIn[i],:]
+			for (let i = 0; i < indexOutToIn.length; i++) {
+				if (!equals(uniques[i], uniquesSorted[indexOutToIn[i]])) {
+					console.log(i, uniques[indexOutToIn[i]], uniquesSorted[i]);
+					throw new Error('bad implementation');	
+				}
+			}
+			//GOAL: assert arr[i,:] == uniquesSorted[indexCSorted[i], :]
+			//GIVEN: assert arr[i,:] == uniques[indexC[i],:];
+			//GIVEN: assert uniquesSorted[i,:] = uniques[indexInToOut[i],:]
+			//GIVEN: assert uniques[i,:] = uniquesSorted[indexOutToIn[i],:]
+			//assert uniques[indexC[i],:] == uniquesSorted[indexOutToIn[indexC[i]],:]
+			//assert uniquesSorted[indexCSorted[i],:]; == uniquesSorted[indexOutToIn[indexC[i]],:];
+			for (let i = 0; i < arr.length; i++) {
+				indexCSorted[i] = indexOutToIn[indexC[i]];
+			}
+			for (let i = 0; i < indexC.length; i++) {
+				if (!equals(arr[i], uniquesSorted[indexCSorted[i]])) {
+					console.log(i, arr[i], uniquesSorted[indexCSorted[i]]);
+					throw new Error('bad implementation');	
+				}
+			}
+
+			indexASorted = []; //indexA.length == uniques.length
+			//GOAL: uniquesSorted[i, :] == arr[indexASorted[i], :]
+			//GIVEN: assert arr[i,:] == uniques[indexC[i],:];
+			//GIVEN: assert arr[indexA[i],:] == uniques[i,:];
+			//GIVEN: assert uniques[indexInToOut[i],:] == uniquesSorted[i,:]
+			//GIVEN: assert uniques[i,:] = uniquesSorted[indexOutToIn[i],:]
+			//assert uniquesSorted[i,:] == uniques[indexInToOut[i],:]
+			//assert uniques[indexInToOut[i],:] == arr[indexA[indexInToOut[i]],:];
+			//assert indexA[indexInToOut] == indexASorted
+			//indexASorted == indexA[indexMapping[i]]
+			for (let i = 0; i < indexA.length; i++) {
+				indexASorted[i] = indexA[indexInToOut[i]];
+			}
+			//assert uniques == arr[indexA, :];
+			for (let i = 0; i < indexASorted.length; i++) {
+				if (!equals(uniquesSorted[i], arr[indexASorted[i]])) {
+					throw new Error('bad implementation');	
+				}
+			}
+			console.log('Good uniques');
+			return [uniquesSorted, indexASorted, indexCSorted];
+		} else {
+			throw new Error('ArrayUnique non "rows" not supported');	
+		}
+	} else {
+		return arr.reverse().filter(function (e, i, arr) {
+				return arr.indexOf(e, i+1) === -1;
+		}).reverse();
+	}
+} //}}}
+function ArraySortWithIndices(toSort, sortingFunction) { //{{{
+	//returns the sorted and index such that toSort[index[i]] == sorted[i]
+	let toSortCopy = [];
+	for (var i = 0; i < toSort.length; i++) {
+	    toSortCopy[i] = [toSort[i], i];
+	}
+	if (typeof(sortingFunction) == 'undefined') {
+		let numeric2DFunction = function(a, b) {
+			if (a[0][0] == b[0][0]) {
+                return a[0][1] - b[0][1];
+			} else {
+			    return a[0][0] - b[0][0];
+			}
+		};
+		sortingFunction = numeric2DFunction;
+	}
+	toSortCopy.sort(sortingFunction);
+	let indicesInToOut = [];
+	let indicesOutToIn = [];
+	let sorted = [];
+	for (var j = 0; j < toSortCopy.length; j++) {
+	    indicesInToOut[j] = toSortCopy[j][1];
+	    indicesOutToIn[toSortCopy[j][1]] = j;
+	    sorted[j] = toSortCopy[j][0];
+	}
+	return [sorted, indicesInToOut, indicesOutToIn];
+} //}}}
+function ArraySort(array,dim) { //{{{
+	let numericFunction = function(a, b) {
+	    return a - b;
+	};
+	let numeric2DFunction = function(a, b) {
+	    return a[0] - b[0];
+	};
+	if (arguments.length == 2){
+		if (dim == 1) {
+			array.sort(numeric2DFunction);
+		} else if (dim == 2) {
+			for (let i = 0; i < array.length; i++) {
+				array[i].sort(numericFunction);
+			}
+		} else {
+			throw new Error('ArraySort dim > 2 not yet supported')
+		}
+		return array;
+	} else {
+		return array.sort(numericFunction);
+	}
 } //}}}
 function ArrayRange(lower, upper) { //{{{
@@ -515,7 +669,100 @@
 } //}}}
 function ArrayAnd(array1,array2) { //{{{
-
-	var array=array1;
-	for (var i=0;i<array1.length;i++)array[i]=array1[i] & array2[i];
+	var array = new Array(array1.length);
+	for (var i=0;i<array1.length;i++) {
+		array[i]=array1[i] & array2[i];
+	}
+	return array;
+} //}}}
+function ArrayOr(array1,array2) { //{{{
+	var array = new Array(array1.length);
+	for (var i=0;i<array1.length;i++) {
+		array[i]=array1[i] | array2[i];
+	}
+	return array;
+} //}}}
+function ArrayEqual(array1,array2) { //{{{
+	var array = new Array(array1.length);
+
+	if (typeof(array1[0]) == 'number') {
+		if (typeof(array2) == 'number') {
+			for(var i=0;i<array1.length;i++){
+				array[i] = array1[i] == array2;
+			}
+		} else {
+			for(var i=0;i<array1.length;i++){
+				array[i] = array1[i] == array2[i];
+			}
+		}
+	} else { //provide support for 2d arrays
+		if (typeof(array2) == 'number') {
+			for(var i=0;i<array1.length;i++){
+				array[i] = new Array(array1[i].length);
+				for(var j=0;j<array1[i].length;j++){
+					array[i][j] = array1[i][j] == array2;
+				}
+			}
+		} else {
+			for(var i=0;i<array1.length;i++){
+				array[i] = new Array(array1[i].length);
+				for(var j=0;j<array1[i].length;j++){
+					array[i][j] = array1[i][j] == array2[i][j];
+				}
+			}
+		}
+	}
+	return array;
+} //}}}
+function ArrayLessThan(array1,array2) { //{{{
+	var array = new Array(array1.length);
+
+	if (typeof(array2) == 'number') {
+		for(var i=0;i<array1.length;i++){
+			array[i] = array1[i] < array2;
+		}
+	} else {
+		for(var i=0;i<array1.length;i++){
+			array[i] = array1[i] < array2[i];
+		}
+	}
+	return array;
+} //}}}
+function ArrayGreaterThan(array1,array2) { //{{{
+	var array = new Array(array1.length);
+	if (typeof(array2) == 'number') {
+		for(var i=0;i<array1.length;i++){
+			array[i] = array1[i] > array2;
+		}
+	} else {
+		for(var i=0;i<array1.length;i++){
+			array[i] = array1[i] > array2[i];
+		}
+	}
+	return array;
+} //}}}
+function ArrayLessEqualThan(array1,array2) { //{{{
+	var array = new Array(array1.length);
+	if (typeof(array2) == 'number') {
+		for(var i=0;i<array1.length;i++){
+			array[i] = array1[i] <= array2;
+		}
+	} else {
+		for(var i=0;i<array1.length;i++){
+			array[i] = array1[i] <= array2[i];
+		}
+	}
+	return array;
+} //}}}
+function ArrayGreaterEqualThan(array1,array2) { //{{{
+	var array = new Array(array1.length);
+	if (typeof(array2) == 'number') {
+		for(var i=0;i<array1.length;i++){
+			array[i] = array1[i] >= array2;
+		}
+	} else {
+		for(var i=0;i<array1.length;i++){
+			array[i] = array1[i] >= array2[i];
+		}
+	}
 	return array;
 } //}}}
@@ -551,5 +798,5 @@
 	return arr;
 } //}}}
-function NewArrayFillIncrement(size,start,increment) { //{{{
+function NewArrayFillIncrement(start,size,increment) { //{{{
 	var array=new Array(size); 
 
@@ -559,4 +806,10 @@
 
 	return array;
+} //}}}
+function ones(size) { //{{{
+	return NewArrayFill(size,1);
+} //}}}
+function zeros(size) { //{{{
+	return NewArrayFill(size,0);
 } //}}}
 function ArrayFind(array,value) { //{{{
@@ -611,4 +864,30 @@
 	}
 	return indices;
+} //}}}
+function ArrayIndex(array1,array2,value) { //{{{
+	//Change behavior between get (if no value is provided) to set (if value to set is provided)
+	if (arguments.length == 2){
+		let data = []
+		if (typeof(array2[0]) == 'number') {
+			for (let i=0;i<array2.length;i++){
+				data.push(array1[array2[i]]);
+			}
+		} else {
+			//2d index array
+			for (let i=0;i<array2.length;i++){
+				let data2 = [];
+				for (let j=0;j<array2[i].length;j++){
+				    data2.push(array1[array2[i][j]]);
+				}
+				data.push(data2);
+			}
+		}
+		return data;
+	} else {
+		for (var i=0;i<array2.length;i++){
+			array1[array2[i]]=value;
+		}
+		return array1;
+	}
 } //}}}
 function Create2DArray(rows,cols) { //{{{
@@ -644,5 +923,5 @@
 
 	// Handle Array
-	if (obj instanceof Array) {
+	if (obj instanceof Array || arg instanceof Float64Array) {
 		copy = [];
 		for (var i = 0, len = obj.length; i < len; i++) {
Index: /issm/trunk/src/m/boundaryconditions/SetIceSheetBC.m
===================================================================
--- /issm/trunk/src/m/boundaryconditions/SetIceSheetBC.m	(revision 26743)
+++ /issm/trunk/src/m/boundaryconditions/SetIceSheetBC.m	(revision 26744)
@@ -31,5 +31,8 @@
 %Initialize surface and basal forcings
 md.smb = initialize(md.smb,md);
-md.basalforcings   = initialize(md.basalforcings,md);
+md.basalforcings = initialize(md.basalforcings,md);
+
+%Initialize ocean forcings and sealevel
+md.dsl = initialize(md.dsl,md);
 
 %Deal with other boundary conditions
Index: /issm/trunk/src/m/boundaryconditions/SetIceSheetBC.py
===================================================================
--- /issm/trunk/src/m/boundaryconditions/SetIceSheetBC.py	(revision 26743)
+++ /issm/trunk/src/m/boundaryconditions/SetIceSheetBC.py	(revision 26744)
@@ -3,55 +3,57 @@
 
 def SetIceSheetBC(md):
-    """
-    SETICESHEETBC - Create the boundary conditions for stressbalance and thermal models for an IceSheet with no Ice Front
+    """SETICESHEETBC - Create the boundary conditions for stressbalance and thermal models for an IceSheet with no Ice Front
 
-       Usage:
-          md = SetIceSheetBC(md)
+    Usage:
+        md = SetIceSheetBC(md)
 
-       See also: SETICESHELFBC, SETMARINEICESHEETBC
+    See also: SETICESHELFBC, SETMARINEICESHEETBC
     """
 
-    #node on Dirichlet
+    # node on Dirichlet
     pos = np.nonzero(md.mesh.vertexonboundary)
-    md.stressbalance.spcvx = float('nan') * np.ones((md.mesh.numberofvertices))
-    md.stressbalance.spcvy = float('nan') * np.ones((md.mesh.numberofvertices))
-    md.stressbalance.spcvz = float('nan') * np.ones((md.mesh.numberofvertices))
+    md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
+    md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
+    md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
     md.stressbalance.spcvx[pos] = 0
     md.stressbalance.spcvy[pos] = 0
     md.stressbalance.spcvz[pos] = 0
-    md.stressbalance.referential = float('nan') * np.ones((md.mesh.numberofvertices, 6))
+    md.stressbalance.referential = np.nan * np.ones((md.mesh.numberofvertices, 6))
     md.stressbalance.loadingforce = 0 * np.ones((md.mesh.numberofvertices, 3))
 
-    #Dirichlet Values
+    # Dirichlet Values
     if isinstance(md.inversion.vx_obs, np.ndarray) and np.size(md.inversion.vx_obs, axis=0) == md.mesh.numberofvertices and isinstance(md.inversion.vy_obs, np.ndarray) and np.size(md.inversion.vy_obs, axis=0) == md.mesh.numberofvertices:
-        print("      boundary conditions for stressbalance model: spc set as observed velocities")
+        print('      boundary conditions for stressbalance model: spc set as observed velocities')
         md.stressbalance.spcvx[pos] = md.inversion.vx_obs[pos]
         md.stressbalance.spcvy[pos] = md.inversion.vy_obs[pos]
     else:
-        print("      boundary conditions for stressbalance model: spc set as zero")
+        print('      boundary conditions for stressbalance model: spc set as zero')
 
-    #No ice front -> do nothing
+    # No ice front -> do nothing
 
-    #Create zeros basalforcings and smb
+    # Initialize surface and basal forcings
     md.smb.initialize(md)
     md.basalforcings.initialize(md)
 
-    #Deal with other boundary conditions
+    # Initialize ocean forcings and sealevel
+    md.dsl.initialize(md)
+
+    # Deal with other boundary conditions
     if np.all(np.isnan(md.balancethickness.thickening_rate)):
         md.balancethickness.thickening_rate = np.zeros((md.mesh.numberofvertices))
-        print("      no balancethickness.thickening_rate specified: values set as zero")
-    md.masstransport.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices))
-    md.balancethickness.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices))
-    md.damage.spcdamage = float('nan') * np.ones((md.mesh.numberofvertices))
+        print('      no balancethickness.thickening_rate specified: values set as zero')
+    md.masstransport.spcthickness = np.nan * np.ones((md.mesh.numberofvertices))
+    md.balancethickness.spcthickness = np.nan * np.ones((md.mesh.numberofvertices))
+    md.damage.spcdamage = np.nan * np.ones((md.mesh.numberofvertices))
 
     if isinstance(md.initialization.temperature, np.ndarray) and np.size(md.initialization.temperature, axis=0) == md.mesh.numberofvertices:
-        md.thermal.spctemperature = float('nan') * np.ones((md.mesh.numberofvertices))
+        md.thermal.spctemperature = np.nan * np.ones((md.mesh.numberofvertices))
         if hasattr(md.mesh, 'vertexonsurface'):
             pos = np.nonzero(md.mesh.vertexonsurface)[0]
-            md.thermal.spctemperature[pos] = md.initialization.temperature[pos]  #impose observed temperature on surface
+            md.thermal.spctemperature[pos] = md.initialization.temperature[pos]  # impose observed temperature on surface
         if not isinstance(md.basalforcings.geothermalflux, np.ndarray) or not np.size(md.basalforcings.geothermalflux) == md.mesh.numberofvertices:
-            md.basalforcings.geothermalflux = 50. * 10**-3 * np.ones((md.mesh.numberofvertices))  #50 mW / m^2
+            md.basalforcings.geothermalflux = 50.0 * pow(10, -3) * np.ones((md.mesh.numberofvertices))  # 50 mW/m^2
     else:
-        print("      no thermal boundary conditions created: no observed temperature found")
+        print('      no thermal boundary conditions created: no observed temperature found')
 
     return md
Index: /issm/trunk/src/m/boundaryconditions/SetMLHOBC.m
===================================================================
--- /issm/trunk/src/m/boundaryconditions/SetMLHOBC.m	(revision 26744)
+++ /issm/trunk/src/m/boundaryconditions/SetMLHOBC.m	(revision 26744)
@@ -0,0 +1,16 @@
+function md=SetMLHOBC(md)
+%SETMLHOBC - Create the boundary conditions for stressbalance for MLHO: VxBase, VyBase, VxShear, VyShear
+%
+%   Usage:
+%      md=SetMLHOBC(md)
+%
+
+
+%node on Dirichlet
+if md.flowequation.isMLHO
+	md.stressbalance.spcvx_base=md.stressbalance.spcvx;
+	md.stressbalance.spcvy_base=md.stressbalance.spcvy;
+
+	md.stressbalance.spcvx_shear=NaN*ones(size(md.stressbalance.spcvx_base));
+	md.stressbalance.spcvy_shear=NaN*ones(size(md.stressbalance.spcvy_base));
+end
Index: /issm/trunk/src/m/boundaryconditions/SetMLHOBC.py
===================================================================
--- /issm/trunk/src/m/boundaryconditions/SetMLHOBC.py	(revision 26744)
+++ /issm/trunk/src/m/boundaryconditions/SetMLHOBC.py	(revision 26744)
@@ -0,0 +1,22 @@
+import numpy as np
+
+
+def SetMLHOBC(md):
+    """
+    SETMLHOBC - Create the boundary conditions for stressbalance for MLHO: VxBase, VyBase, VxShear, VyShear
+
+       Usage:
+          md = SetIceShelfBC(md, varargin)
+
+       Example:
+          md = SetIceShelfBC(md)
+
+    """
+
+    #node on Dirichlet (boundary and ~icefront)
+    md.stressbalance.spcvx_base = md.stressbalance.spcvx
+    md.stressbalance.spcvy_base = md.stressbalance.spcvy
+    md.stressbalance.spcvx_shear = np.nan * md.stressbalance.spcvx
+    md.stressbalance.spcvy_shear = np.nan * md.stressbalance.spcvy
+
+    return md
Index: /issm/trunk/src/m/boundaryconditions/SetMarineIceSheetBC.m
===================================================================
--- /issm/trunk/src/m/boundaryconditions/SetMarineIceSheetBC.m	(revision 26743)
+++ /issm/trunk/src/m/boundaryconditions/SetMarineIceSheetBC.m	(revision 26744)
@@ -40,5 +40,5 @@
 pos=find(md.mesh.vertexonboundary & ~vertexonicefront);
 if isempty(pos),
-	disp('SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet applied')
+	disp('Warning: SetMarineIceSheetBC.m: ice front all around the glacier, no dirichlet applied')
 end
 md.stressbalance.spcvx=NaN*ones(md.mesh.numberofvertices,1);
Index: /issm/trunk/src/m/boundaryconditions/SetMarineIceSheetBC.py
===================================================================
--- /issm/trunk/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 26743)
+++ /issm/trunk/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 26744)
@@ -5,51 +5,51 @@
 
 def SetMarineIceSheetBC(md, icefrontfile=''):
-    """
-    SETICEMARINESHEETBC - Create the boundary conditions for stressbalance and thermal models for a  Marine Ice Sheet with Ice Front
+    """SETICEMARINESHEETBC - Create the boundary conditions for stressbalance 
+    and thermal models for a  Marine Ice Sheet with Ice Front
 
-       Neumann BC are used on the ice front (an ARGUS contour around the ice front
-       can be given in input, or it will be deduced as onfloatingice & onboundary)
-       Dirichlet BC are used elsewhere for stressbalance
+    Neumann BC are used on the ice front (an ARGUS contour around the ice front
+    can be given in input, or it will be deduced as onfloatingice & onboundary)
+    Dirichlet BC are used elsewhere for stressbalance
 
-       Usage:
-          md = SetMarineIceSheetBC(md, icefrontfile)
-          md = SetMarineIceSheetBC(md)
+    Usage:
+        md = SetMarineIceSheetBC(md, icefrontfile)
+        md = SetMarineIceSheetBC(md)
 
-       Example:
-          md = SetMarineIceSheetBC(md, 'Front.exp')
-          md = SetMarineIceSheetBC(md)
+    Example:
+        md = SetMarineIceSheetBC(md, 'Front.exp')
+        md = SetMarineIceSheetBC(md)
 
-       See also: SETICESHELFBC, SETMARINEICESHEETBC
+    See also: SETICESHELFBC, SETMARINEICESHEETBC
     """
     #node on Dirichlet (boundary and ~icefront)
     if icefrontfile:
-        #User provided Front.exp, use it
+        # User provided Front.exp, use it
         if not os.path.exists(icefrontfile):
-            raise IOError("SetMarineIceSheetBC error message: ice front file '%s' not found." % icefrontfile)
+            raise IOError('SetMarineIceSheetBC error message: ice front file \'{}\' not found.'.format(icefrontfile))
         incontour = ContourToMesh(md.mesh.elements, md.mesh.x, md.mesh.y, icefrontfile, 'node', 2)
         vertexonicefront = np.logical_and(md.mesh.vertexonboundary, incontour.reshape(-1))
     else:
-        #Guess where the ice front is
+        # Guess where the ice front is
         vertexonfloatingice = np.zeros((md.mesh.numberofvertices))
-        pos = np.nonzero(np.sum(md.mask.ocean_levelset[md.mesh.elements - 1] < 0., axis=1) > 0.)[0]
+        pos = np.nonzero(np.sum(md.mask.ocean_levelset[md.mesh.elements - 1] < 0.0, axis=1) > 0.0)[0]
         vertexonfloatingice[md.mesh.elements[pos].astype(int) - 1] = 1.
-        vertexonicefront = np.logical_and(np.reshape(md.mesh.vertexonboundary, (-1, )), vertexonfloatingice > 0.)
+        vertexonicefront = np.logical_and(np.reshape(md.mesh.vertexonboundary, (-1, )), vertexonfloatingice > 0.0)
 
     #pos = find(md.mesh.vertexonboundary & ~vertexonicefront)
     pos = np.nonzero(np.logical_and(md.mesh.vertexonboundary, np.logical_not(vertexonicefront)))[0]
     if not np.size(pos):
-        print("SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually.")
+        print('Warning: SetMarineIceSheetBC.py: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually.')
 
-    md.stressbalance.spcvx = float('nan') * np.ones(md.mesh.numberofvertices)
-    md.stressbalance.spcvy = float('nan') * np.ones(md.mesh.numberofvertices)
-    md.stressbalance.spcvz = float('nan') * np.ones(md.mesh.numberofvertices)
-    md.stressbalance.referential = float('nan') * np.ones((md.mesh.numberofvertices, 6))
+    md.stressbalance.spcvx = np.nan * np.ones(md.mesh.numberofvertices)
+    md.stressbalance.spcvy = np.nan * np.ones(md.mesh.numberofvertices)
+    md.stressbalance.spcvz = np.nan * np.ones(md.mesh.numberofvertices)
+    md.stressbalance.referential = np.nan * np.ones((md.mesh.numberofvertices, 6))
     md.stressbalance.loadingforce = 0 * np.ones((md.mesh.numberofvertices, 3))
 
-    #Position of ice front
+    # Position of ice front
     pos = np.nonzero(vertexonicefront)[0]
     md.mask.ice_levelset[pos] = 0
 
-    #First find segments that are not completely on the front
+    # First find segments that are not completely on the front
     if md.mesh.elementtype() == 'Penta':
         numbernodesfront = 4
@@ -57,5 +57,5 @@
         numbernodesfront = 2
     else:
-        raise Exception("Mesh type not supported")
+        raise Exception('Mesh type not supported')
     if any(md.mask.ice_levelset <= 0):
         values = md.mask.ice_levelset[md.mesh.segments[:, 0:-1] - 1]
@@ -63,5 +63,5 @@
         np.sum(segmentsfront, axis=1) != numbernodesfront
         segments = np.nonzero(np.sum(segmentsfront, axis=1) != numbernodesfront)[0]
-    #Find all nodes for these segments and spc them
+        # Find all nodes for these segments and spc them
         pos = md.mesh.segments[segments, 0:-1] - 1
     else:
@@ -71,11 +71,11 @@
     md.stressbalance.spcvz[pos] = 0
 
-    #Dirichlet Values
+    # Dirichlet Values
     if isinstance(md.inversion.vx_obs, np.ndarray) and np.size(md.inversion.vx_obs, axis=0) == md.mesh.numberofvertices and isinstance(md.inversion.vy_obs, np.ndarray) and np.size(md.inversion.vy_obs, axis=0) == md.mesh.numberofvertices:
-        print("      boundary conditions for stressbalance model: spc set as observed velocities")
+        print('      boundary conditions for stressbalance model: spc set as observed velocities')
         md.stressbalance.spcvx[pos] = md.inversion.vx_obs[pos]
         md.stressbalance.spcvy[pos] = md.inversion.vy_obs[pos]
     else:
-        print("      boundary conditions for stressbalance model: spc set as zero")
+        print('      boundary conditions for stressbalance model: spc set as zero')
 
     md.hydrology.spcwatercolumn = np.zeros((md.mesh.numberofvertices, 2))
@@ -90,20 +90,20 @@
     if np.all(np.isnan(md.balancethickness.thickening_rate)):
         md.balancethickness.thickening_rate = np.zeros((md.mesh.numberofvertices))
-        print("      no balancethickness.thickening_rate specified: values set as zero")
+        print('      no balancethickness.thickening_rate specified: values set as zero')
 
-    md.masstransport.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices))
-    md.balancethickness.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices))
-    md.damage.spcdamage = float('nan') * np.ones((md.mesh.numberofvertices))
+    md.masstransport.spcthickness = np.nan * np.ones((md.mesh.numberofvertices))
+    md.balancethickness.spcthickness = np.nan * np.ones((md.mesh.numberofvertices))
+    md.damage.spcdamage = np.nan * np.ones((md.mesh.numberofvertices))
 
     if isinstance(md.initialization.temperature, np.ndarray) and np.size(md.initialization.temperature, axis=0) == md.mesh.numberofvertices:
-        md.thermal.spctemperature = float('nan') * np.ones((md.mesh.numberofvertices))
+        md.thermal.spctemperature = np.nan * np.ones((md.mesh.numberofvertices))
         if hasattr(md.mesh, 'vertexonsurface'):
             pos = np.nonzero(md.mesh.vertexonsurface)[0]
-            md.thermal.spctemperature[pos] = md.initialization.temperature[pos]  #impose observed temperature on surface
+            md.thermal.spctemperature[pos] = md.initialization.temperature[pos]  # impose observed temperature on surface
         if not isinstance(md.basalforcings.geothermalflux, np.ndarray) or not np.size(md.basalforcings.geothermalflux, axis=0) == md.mesh.numberofvertices:
             md.basalforcings.geothermalflux = np.zeros((md.mesh.numberofvertices))
-            md.basalforcings.geothermalflux[np.nonzero(md.mask.ocean_levelset > 0.)] = 50. * 10.**- 3  #50mW / m2
+            md.basalforcings.geothermalflux[np.nonzero(md.mask.ocean_levelset > 0.0)] = 50.0 * pow(10.0, -3)  # 50mW/m2
     else:
-        print("      no thermal boundary conditions created: no observed temperature found")
+        print('      no thermal boundary conditions created: no observed temperature found')
 
     return md
Index: /issm/trunk/src/m/boundaryconditions/getlovenumbers.js
===================================================================
--- /issm/trunk/src/m/boundaryconditions/getlovenumbers.js	(revision 26744)
+++ /issm/trunk/src/m/boundaryconditions/getlovenumbers.js	(revision 26744)
@@ -0,0 +1,10104 @@
+function getlovenumbers() {//{{{
+	/**
+	 * GETLOVENUMBERS: provide love numbers retrieved from,
+	 *
+	 *     http://www.srosat.com/iag-jsg/loveNb.php
+	 *
+	 * in a chosen reference frame
+	 *
+	 * Usage:
+	 *     series = getlovenumbers('type', 'loadingverticaldisplacement', 'referenceframe', 'CM', 'maxdeg', 1000);
+	 * - type = one of 'loadingverticaldisplacement', 
+	'loadinggravitationalpotential', 'loadinghorizontaldisplacement', 
+	'tidalverticaldisplacement', 'tidalgravitationalpotential', 
+	'tidalhorizontaldisplacement'
+	 * - referenceframe = one of 'CM' (default) and 'CF'
+	 * - maxdeg = default 1000
+	 *
+	 * Example:
+	 *     h = getlovenumbers('type', 'loadingverticaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg);
+	 *     k = getlovenumbers('type', 'loadinggravitationalpotential', 'referenceframe', 'CM', 'maxdeg', maxdeg);
+	 *     l = getlovenumbers('type', 'loadinghorizontaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg);
+	 *     th = getlovenumbers('type', 'tidalverticaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg);
+	 *     tk = getlovenumbers('type', 'tidalgravitationalpotential', 'referenceframe', 'CM', 'maxdeg', maxdeg);
+	 *     tl = getlovenumbers('type', 'tidalhorizontaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg);
+	 */
+
+	// Recover options
+	let options = new pairoptions(arguments);
+	let type = options.getfieldvalue('type');
+	let frame = options.getfieldvalue('referenceframe', 'CM');
+	let maxdeg = options.getfieldvalue('maxdeg', 1000);
+
+	if (maxdeg > 10000) {
+		error('PREM love numbers computed only for deg < 10,000. Request lower maxdeg');
+	}
+
+	const TYPES = [
+		'loadingverticaldisplacement',
+		'loadinggravitationalpotential',
+		'loadinghorizontaldisplacement',
+		'tidalverticaldisplacement',
+		'tidalgravitationalpotential',
+		'tidalhorizontaldisplacement'
+	];
+
+	if (!(TYPES.includes(type))) {
+		error('type should be one of \'loadingverticaldisplacement\', \'loadinggravitationalpotential\', \'loadinghorizontaldisplacement\',\'tidalverticaldisplacement\', \'tidalgravitationalpotential\', \'tidalhorizontaldisplacement\'');
+	}
+
+	let love_numbers = [
+		[0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000],
+		[-1.28740059, -1.00000000, -0.89858519, 0.00000000, 0.00000000, 0.00000000],
+		[-1.00025365, -0.30922675, 0.02060926, 0.62933648, 0.30136172, 0.08745784],
+		[-1.06243501, -0.19927948, 0.06801636, 0.29799672, 0.09304210, 0.01525258],
+		[-1.06779588, -0.13649834, 0.05667027, 0.18024117, 0.04181593, 0.01055799],
+		[-1.10365923, -0.10736896, 0.04401221, 0.13257950, 0.02455390, 0.00874595],
+		[-1.16440348, -0.09295485, 0.03638747, 0.10999739, 0.01694141, 0.00701045],
+		[-1.23634156, -0.08469861, 0.03202759, 0.09727833, 0.01279626, 0.00556581],
+		[-1.31140380, -0.07921412, 0.02937593, 0.08896691, 0.01019313, 0.00445157],
+		[-1.38582399, -0.07513541, 0.02762338, 0.08291950, 0.00840274, 0.00360620],
+		[-1.45807465, -0.07187005, 0.02638627, 0.07819716, 0.00709641, 0.00295944],
+		[-1.52763314, -0.06913154, 0.02547640, 0.07433538, 0.00610349, 0.00245649],
+		[-1.59437866, -0.06676258, 0.02479080, 0.07107472, 0.00532548, 0.00205857],
+		[-1.65833071, -0.06466619, 0.02426511, 0.06825469, 0.00470107, 0.00173889],
+		[-1.71954820, -0.06277732, 0.02385464, 0.06576832, 0.00418998, 0.00147872],
+		[-1.77809640, -0.06105001, 0.02352654, 0.06354080, 0.00376467, 0.00126474],
+		[-1.83403970, -0.05945081, 0.02325609, 0.06151811, 0.00340573, 0.00108719],
+		[-1.88744242, -0.05795502, 0.02302469, 0.05966045, 0.00309910, 0.00093879],
+		[-1.93837115, -0.05654418, 0.02281843, 0.05793806, 0.00283441, 0.00081397],
+		[-1.98689666, -0.05520447, 0.02262706, 0.05632844, 0.00260382, 0.00070843],
+		[-2.03309477, -0.05392545, 0.02244322, 0.05481440, 0.00240132, 0.00061877],
+		[-2.07704643, -0.05269926, 0.02226173, 0.05338269, 0.00222224, 0.00054227],
+		[-2.11883714, -0.05151988, 0.02207909, 0.05202300, 0.00206289, 0.00047675],
+		[-2.15855611, -0.05038274, 0.02189307, 0.05072723, 0.00192031, 0.00042043],
+		[-2.19629514, -0.04928430, 0.02170238, 0.04948894, 0.00179212, 0.00037187],
+		[-2.23214747, -0.04822179, 0.02150643, 0.04830294, 0.00167634, 0.00032986],
+		[-2.26620674, -0.04719301, 0.02130509, 0.04716500, 0.00157138, 0.00029341],
+		[-2.29856595, -0.04619619, 0.02109858, 0.04607163, 0.00147587, 0.00026171],
+		[-2.32931659, -0.04522983, 0.02088735, 0.04501989, 0.00138869, 0.00023405],
+		[-2.35854794, -0.04429270, 0.02067197, 0.04400725, 0.00130886, 0.00020985],
+		[-2.38634650, -0.04338368, 0.02045310, 0.04303154, 0.00123559, 0.00018864],
+		[-2.41279547, -0.04250179, 0.02023142, 0.04209082, 0.00116814, 0.00017000],
+		[-2.43797451, -0.04164613, 0.02000761, 0.04118337, 0.00110593, 0.00015358],
+		[-2.46195951, -0.04081583, 0.01978231, 0.04030761, 0.00104841, 0.00013908],
+		[-2.48482241, -0.04001011, 0.01955614, 0.03946212, 0.00099513, 0.00012625],
+		[-2.50663126, -0.03922817, 0.01932966, 0.03864555, 0.00094568, 0.00011488],
+		[-2.52745016, -0.03846928, 0.01910337, 0.03785666, 0.00089971, 0.00010477],
+		[-2.54733938, -0.03773269, 0.01887774, 0.03709428, 0.00085689, 0.00009577],
+		[-2.56635547, -0.03701769, 0.01865317, 0.03635731, 0.00081696, 0.00008775],
+		[-2.58455138, -0.03632358, 0.01843000, 0.03564469, 0.00077965, 0.00008057],
+		[-2.60197665, -0.03564968, 0.01820854, 0.03495543, 0.00074474, 0.00007415],
+		[-2.61867756, -0.03499532, 0.01798905, 0.03428858, 0.00071205, 0.00006839],
+		[-2.63469733, -0.03435985, 0.01777176, 0.03364323, 0.00068137, 0.00006322],
+		[-2.65007629, -0.03374263, 0.01755683, 0.03301851, 0.00065257, 0.00005857],
+		[-2.66485208, -0.03314303, 0.01734443, 0.03241359, 0.00062548, 0.00005438],
+		[-2.67905981, -0.03256047, 0.01713468, 0.03182769, 0.00059998, 0.00005059],
+		[-2.69273222, -0.03199435, 0.01692767, 0.03126003, 0.00057595, 0.00004717],
+		[-2.70589990, -0.03144411, 0.01672347, 0.03070991, 0.00055327, 0.00004407],
+		[-2.71859139, -0.03090919, 0.01652215, 0.03017662, 0.00053186, 0.00004127],
+		[-2.73083334, -0.03038907, 0.01632374, 0.02965950, 0.00051162, 0.00003872],
+		[-2.74265068, -0.02988323, 0.01612826, 0.02915791, 0.00049246, 0.00003641],
+		[-2.75406669, -0.02939118, 0.01593573, 0.02867125, 0.00047432, 0.00003431],
+		[-2.76510320, -0.02891245, 0.01574615, 0.02819894, 0.00045712, 0.00003239],
+		[-2.77578063, -0.02844656, 0.01555950, 0.02774043, 0.00044081, 0.00003065],
+		[-2.78611812, -0.02799309, 0.01537578, 0.02729517, 0.00042531, 0.00002905],
+		[-2.79613364, -0.02755161, 0.01519496, 0.02686267, 0.00041059, 0.00002760],
+		[-2.80584405, -0.02712170, 0.01501701, 0.02644244, 0.00039659, 0.00002627],
+		[-2.81526521, -0.02670298, 0.01484191, 0.02603402, 0.00038326, 0.00002505],
+		[-2.82441204, -0.02629506, 0.01466961, 0.02563696, 0.00037057, 0.00002393],
+		[-2.83329857, -0.02589759, 0.01450009, 0.02525085, 0.00035847, 0.00002291],
+		[-2.84193804, -0.02551021, 0.01433329, 0.02487527, 0.00034693, 0.00002197],
+		[-2.85034293, -0.02513260, 0.01416919, 0.02450984, 0.00033591, 0.00002111],
+		[-2.85852503, -0.02476443, 0.01400773, 0.02415420, 0.00032539, 0.00002031],
+		[-2.86649548, -0.02440538, 0.01384888, 0.02380798, 0.00031534, 0.00001958],
+		[-2.87426481, -0.02405518, 0.01369258, 0.02347086, 0.00030573, 0.00001891],
+		[-2.88184299, -0.02371352, 0.01353880, 0.02314250, 0.00029653, 0.00001829],
+		[-2.88923945, -0.02338014, 0.01338749, 0.02282261, 0.00028772, 0.00001772],
+		[-2.89646316, -0.02305478, 0.01323861, 0.02251087, 0.00027928, 0.00001720],
+		[-2.90352261, -0.02273718, 0.01309211, 0.02220702, 0.00027120, 0.00001671],
+		[-2.91042585, -0.02242710, 0.01294795, 0.02191078, 0.00026344, 0.00001626],
+		[-2.91718054, -0.02212431, 0.01280609, 0.02162189, 0.00025600, 0.00001585],
+		[-2.92379397, -0.02182859, 0.01266648, 0.02134010, 0.00024886, 0.00001546],
+		[-2.93027306, -0.02153971, 0.01252908, 0.02106517, 0.00024200, 0.00001511],
+		[-2.93662439, -0.02125748, 0.01239386, 0.02079689, 0.00023540, 0.00001478],
+		[-2.94285425, -0.02098169, 0.01226077, 0.02053502, 0.00022907, 0.00001447],
+		[-2.94896860, -0.02071215, 0.01212977, 0.02027936, 0.00022297, 0.00001419],
+		[-2.95497314, -0.02044868, 0.01200082, 0.02002971, 0.00021710, 0.00001392],
+		[-2.96087331, -0.02019110, 0.01187388, 0.01978587, 0.00021146, 0.00001368],
+		[-2.96667427, -0.01993924, 0.01174893, 0.01954767, 0.00020602, 0.00001345],
+		[-2.97238097, -0.01969293, 0.01162591, 0.01931492, 0.00020078, 0.00001324],
+		[-2.97799813, -0.01945201, 0.01150481, 0.01908746, 0.00019573, 0.00001305],
+		[-2.98353025, -0.01921634, 0.01138557, 0.01886511, 0.00019086, 0.00001286],
+		[-2.98898162, -0.01898576, 0.01126817, 0.01864773, 0.00018616, 0.00001269],
+		[-2.99435636, -0.01876014, 0.01115257, 0.01843516, 0.00018162, 0.00001253],
+		[-2.99965838, -0.01853932, 0.01103875, 0.01822725, 0.00017725, 0.00001238],
+		[-3.00489143, -0.01832319, 0.01092666, 0.01802387, 0.00017302, 0.00001224],
+		[-3.01005909, -0.01811161, 0.01081628, 0.01782489, 0.00016893, 0.00001211],
+		[-3.01516479, -0.01790446, 0.01070757, 0.01763017, 0.00016499, 0.00001199],
+		[-3.02021180, -0.01770162, 0.01060052, 0.01743958, 0.00016117, 0.00001187],
+		[-3.02520323, -0.01750298, 0.01049508, 0.01725302, 0.00015748, 0.00001177],
+		[-3.03014209, -0.01730842, 0.01039123, 0.01707036, 0.00015391, 0.00001166],
+		[-3.03503122, -0.01711783, 0.01028894, 0.01689149, 0.00015045, 0.00001157],
+		[-3.03987336, -0.01693111, 0.01018819, 0.01671631, 0.00014711, 0.00001148],
+		[-3.04467112, -0.01674816, 0.01008894, 0.01654470, 0.00014387, 0.00001139],
+		[-3.04942699, -0.01656889, 0.00999117, 0.01637658, 0.00014073, 0.00001131],
+		[-3.05414335, -0.01639319, 0.00989485, 0.01621185, 0.00013769, 0.00001124],
+		[-3.05882250, -0.01622097, 0.00979997, 0.01605041, 0.00013474, 0.00001116],
+		[-3.06346660, -0.01605215, 0.00970649, 0.01589217, 0.00013189, 0.00001109],
+		[-3.06807773, -0.01588664, 0.00961439, 0.01573705, 0.00012912, 0.00001103],
+		[-3.07265789, -0.01572436, 0.00952364, 0.01558496, 0.00012643, 0.00001097],
+		[-3.07720897, -0.01556522, 0.00943423, 0.01543582, 0.00012382, 0.00001091],
+		[-3.08173279, -0.01540916, 0.00934613, 0.01528956, 0.00012129, 0.00001085],
+		[-3.08623109, -0.01525608, 0.00925931, 0.01514610, 0.00011883, 0.00001080],
+		[-3.09070551, -0.01510592, 0.00917376, 0.01500536, 0.00011645, 0.00001074],
+		[-3.09515765, -0.01495861, 0.00908946, 0.01486728, 0.00011413, 0.00001069],
+		[-3.09958899, -0.01481408, 0.00900637, 0.01473179, 0.00011188, 0.00001064],
+		[-3.10400100, -0.01467225, 0.00892449, 0.01459882, 0.00010969, 0.00001060],
+		[-3.10839504, -0.01453308, 0.00884379, 0.01446831, 0.00010756, 0.00001055],
+		[-3.11277241, -0.01439648, 0.00876425, 0.01434019, 0.00010549, 0.00001051],
+		[-3.11713438, -0.01426240, 0.00868586, 0.01421441, 0.00010348, 0.00001047],
+		[-3.12148213, -0.01413079, 0.00860858, 0.01409091, 0.00010152, 0.00001042],
+		[-3.12581680, -0.01400157, 0.00853241, 0.01396963, 0.00009962, 0.00001038],
+		[-3.13013947, -0.01387471, 0.00845733, 0.01385052, 0.00009776, 0.00001034],
+		[-3.13445117, -0.01375013, 0.00838331, 0.01373352, 0.00009596, 0.00001031],
+		[-3.13875289, -0.01362779, 0.00831034, 0.01361859, 0.00009420, 0.00001027],
+		[-3.14304556, -0.01350764, 0.00823841, 0.01350567, 0.00009249, 0.00001023],
+		[-3.14733008, -0.01338963, 0.00816748, 0.01339472, 0.00009083, 0.00001020],
+		[-3.15160728, -0.01327370, 0.00809756, 0.01328569, 0.00008920, 0.00001016],
+		[-3.15587797, -0.01315981, 0.00802862, 0.01317853, 0.00008762, 0.00001012],
+		[-3.16014293, -0.01304792, 0.00796064, 0.01307320, 0.00008608, 0.00001009],
+		[-3.16440288, -0.01293797, 0.00789361, 0.01296967, 0.00008458, 0.00001006],
+		[-3.16865852, -0.01282993, 0.00782751, 0.01286788, 0.00008311, 0.00001002],
+		[-3.17291049, -0.01272375, 0.00776233, 0.01276779, 0.00008169, 0.00000999],
+		[-3.17715942, -0.01261940, 0.00769805, 0.01266938, 0.00008029, 0.00000996],
+		[-3.18140591, -0.01251682, 0.00763466, 0.01257259, 0.00007893, 0.00000992],
+		[-3.18565052, -0.01241598, 0.00757215, 0.01247740, 0.00007761, 0.00000989],
+		[-3.18989378, -0.01231685, 0.00751049, 0.01238376, 0.00007631, 0.00000986],
+		[-3.19413619, -0.01221938, 0.00744968, 0.01229165, 0.00007505, 0.00000983],
+		[-3.19837823, -0.01212354, 0.00738970, 0.01220103, 0.00007381, 0.00000979],
+		[-3.20262035, -0.01202930, 0.00733053, 0.01211186, 0.00007261, 0.00000976],
+		[-3.20686298, -0.01193661, 0.00727217, 0.01202412, 0.00007143, 0.00000973],
+		[-3.21110653, -0.01184546, 0.00721461, 0.01193777, 0.00007028, 0.00000970],
+		[-3.21535137, -0.01175579, 0.00715782, 0.01185279, 0.00006916, 0.00000967],
+		[-3.21959786, -0.01166759, 0.00710179, 0.01176914, 0.00006806, 0.00000964],
+		[-3.22384634, -0.01158082, 0.00704652, 0.01168680, 0.00006699, 0.00000961],
+		[-3.22809714, -0.01149545, 0.00699199, 0.01160573, 0.00006594, 0.00000957],
+		[-3.23235055, -0.01141146, 0.00693819, 0.01152591, 0.00006492, 0.00000954],
+		[-3.23660685, -0.01132880, 0.00688511, 0.01144732, 0.00006392, 0.00000951],
+		[-3.24086631, -0.01124746, 0.00683273, 0.01136993, 0.00006294, 0.00000948],
+		[-3.24512918, -0.01116741, 0.00678105, 0.01129371, 0.00006198, 0.00000945],
+		[-3.24939569, -0.01108862, 0.00673005, 0.01121864, 0.00006105, 0.00000942],
+		[-3.25366606, -0.01101107, 0.00667973, 0.01114470, 0.00006013, 0.00000939],
+		[-3.25794050, -0.01093473, 0.00663007, 0.01107186, 0.00005923, 0.00000936],
+		[-3.26221918, -0.01085957, 0.00658106, 0.01100010, 0.00005835, 0.00000932],
+		[-3.26650230, -0.01078557, 0.00653269, 0.01092939, 0.00005750, 0.00000929],
+		[-3.27079000, -0.01071272, 0.00648495, 0.01085973, 0.00005665, 0.00000926],
+		[-3.27508246, -0.01064097, 0.00643784, 0.01079108, 0.00005583, 0.00000923],
+		[-3.27937980, -0.01057032, 0.00639134, 0.01072343, 0.00005503, 0.00000920],
+		[-3.28368216, -0.01050074, 0.00634544, 0.01065676, 0.00005424, 0.00000917],
+		[-3.28798965, -0.01043222, 0.00630013, 0.01059104, 0.00005346, 0.00000914],
+		[-3.29230239, -0.01036472, 0.00625541, 0.01052626, 0.00005271, 0.00000910],
+		[-3.29662047, -0.01029823, 0.00621126, 0.01046241, 0.00005196, 0.00000907],
+		[-3.30094399, -0.01023273, 0.00616768, 0.01039945, 0.00005124, 0.00000904],
+		[-3.30527303, -0.01016819, 0.00612465, 0.01033738, 0.00005053, 0.00000901],
+		[-3.30960766, -0.01010461, 0.00608218, 0.01027618, 0.00004983, 0.00000898],
+		[-3.31394795, -0.01004197, 0.00604024, 0.01021583, 0.00004914, 0.00000895],
+		[-3.31829395, -0.00998024, 0.00599883, 0.01015631, 0.00004847, 0.00000891],
+		[-3.32264573, -0.00991940, 0.00595795, 0.01009762, 0.00004781, 0.00000888],
+		[-3.32700331, -0.00985945, 0.00591759, 0.01003973, 0.00004717, 0.00000885],
+		[-3.33136675, -0.00980035, 0.00587773, 0.00998262, 0.00004654, 0.00000882],
+		[-3.33573607, -0.00974211, 0.00583838, 0.00992630, 0.00004592, 0.00000879],
+		[-3.34011130, -0.00968470, 0.00579951, 0.00987073, 0.00004531, 0.00000875],
+		[-3.34449246, -0.00962810, 0.00576113, 0.00981591, 0.00004471, 0.00000872],
+		[-3.34887956, -0.00957230, 0.00572323, 0.00976182, 0.00004413, 0.00000869],
+		[-3.35327261, -0.00951729, 0.00568581, 0.00970845, 0.00004355, 0.00000866],
+		[-3.35767163, -0.00946304, 0.00564884, 0.00965578, 0.00004299, 0.00000863],
+		[-3.36207660, -0.00940956, 0.00561233, 0.00960381, 0.00004244, 0.00000859],
+		[-3.36648753, -0.00935681, 0.00557627, 0.00955252, 0.00004189, 0.00000856],
+		[-3.37090440, -0.00930480, 0.00554066, 0.00950190, 0.00004136, 0.00000853],
+		[-3.37532721, -0.00925350, 0.00550548, 0.00945194, 0.00004084, 0.00000850],
+		[-3.37975593, -0.00920290, 0.00547073, 0.00940262, 0.00004032, 0.00000847],
+		[-3.38419056, -0.00915300, 0.00543641, 0.00935393, 0.00003982, 0.00000843],
+		[-3.38863105, -0.00910377, 0.00540251, 0.00930586, 0.00003932, 0.00000840],
+		[-3.39307740, -0.00905520, 0.00536901, 0.00925841, 0.00003884, 0.00000837],
+		[-3.39752956, -0.00900729, 0.00533593, 0.00921156, 0.00003836, 0.00000834],
+		[-3.40198751, -0.00896002, 0.00530324, 0.00916530, 0.00003789, 0.00000830],
+		[-3.40645121, -0.00891338, 0.00527095, 0.00911962, 0.00003743, 0.00000827],
+		[-3.41092063, -0.00886736, 0.00523904, 0.00907451, 0.00003697, 0.00000824],
+		[-3.41539571, -0.00882195, 0.00520752, 0.00902996, 0.00003653, 0.00000821],
+		[-3.41987643, -0.00877713, 0.00517637, 0.00898596, 0.00003609, 0.00000817],
+		[-3.42436272, -0.00873290, 0.00514560, 0.00894250, 0.00003566, 0.00000814],
+		[-3.42885456, -0.00868925, 0.00511520, 0.00889958, 0.00003524, 0.00000811],
+		[-3.43335188, -0.00864617, 0.00508515, 0.00885718, 0.00003482, 0.00000808],
+		[-3.43785464, -0.00860364, 0.00505546, 0.00881530, 0.00003441, 0.00000804],
+		[-3.44236278, -0.00856166, 0.00502613, 0.00877392, 0.00003401, 0.00000801],
+		[-3.44687625, -0.00852021, 0.00499714, 0.00873304, 0.00003361, 0.00000798],
+		[-3.45139500, -0.00847930, 0.00496849, 0.00869264, 0.00003323, 0.00000795],
+		[-3.45591895, -0.00843890, 0.00494017, 0.00865273, 0.00003284, 0.00000791],
+		[-3.46044807, -0.00839902, 0.00491219, 0.00861330, 0.00003247, 0.00000788],
+		[-3.46498227, -0.00835964, 0.00488454, 0.00857433, 0.00003210, 0.00000785],
+		[-3.46952151, -0.00832075, 0.00485721, 0.00853582, 0.00003173, 0.00000782],
+		[-3.47406572, -0.00828234, 0.00483019, 0.00849776, 0.00003138, 0.00000778],
+		[-3.47861484, -0.00824442, 0.00480349, 0.00846014, 0.00003102, 0.00000775],
+		[-3.48316880, -0.00820696, 0.00477710, 0.00842296, 0.00003068, 0.00000772],
+		[-3.48772753, -0.00816996, 0.00475102, 0.00838622, 0.00003034, 0.00000769],
+		[-3.49229097, -0.00813342, 0.00472523, 0.00834989, 0.00003000, 0.00000766],
+		[-3.49685904, -0.00809733, 0.00469975, 0.00831398, 0.00002967, 0.00000762],
+		[-3.50143169, -0.00806167, 0.00467455, 0.00827848, 0.00002935, 0.00000759],
+		[-3.50600884, -0.00802644, 0.00464964, 0.00824338, 0.00002903, 0.00000756],
+		[-3.51059042, -0.00799164, 0.00462502, 0.00820868, 0.00002871, 0.00000753],
+		[-3.51517637, -0.00795726, 0.00460068, 0.00817437, 0.00002840, 0.00000750],
+		[-3.51976660, -0.00792329, 0.00457662, 0.00814045, 0.00002810, 0.00000746],
+		[-3.52436105, -0.00788972, 0.00455283, 0.00810691, 0.00002779, 0.00000743],
+		[-3.52895964, -0.00785655, 0.00452930, 0.00807373, 0.00002750, 0.00000740],
+		[-3.53356231, -0.00782377, 0.00450605, 0.00804093, 0.00002721, 0.00000737],
+		[-3.53816898, -0.00779138, 0.00448306, 0.00800849, 0.00002692, 0.00000734],
+		[-3.54277957, -0.00775937, 0.00446032, 0.00797640, 0.00002664, 0.00000730],
+		[-3.54739402, -0.00772773, 0.00443784, 0.00794466, 0.00002636, 0.00000727],
+		[-3.55201224, -0.00769645, 0.00441562, 0.00791327, 0.00002608, 0.00000724],
+		[-3.55663417, -0.00766554, 0.00439364, 0.00788222, 0.00002581, 0.00000721],
+		[-3.56125973, -0.00763498, 0.00437190, 0.00785151, 0.00002555, 0.00000718],
+		[-3.56588885, -0.00760478, 0.00435041, 0.00782113, 0.00002528, 0.00000715],
+		[-3.57052145, -0.00757491, 0.00432916, 0.00779107, 0.00002502, 0.00000712],
+		[-3.57515745, -0.00754539, 0.00430814, 0.00776133, 0.00002477, 0.00000708],
+		[-3.57979678, -0.00751620, 0.00428736, 0.00773191, 0.00002452, 0.00000705],
+		[-3.58443937, -0.00748734, 0.00426681, 0.00770279, 0.00002427, 0.00000702],
+		[-3.58908514, -0.00745880, 0.00424648, 0.00767399, 0.00002403, 0.00000699],
+		[-3.59373401, -0.00743059, 0.00422637, 0.00764549, 0.00002379, 0.00000696],
+		[-3.59838592, -0.00740268, 0.00420649, 0.00761728, 0.00002355, 0.00000693],
+		[-3.60304078, -0.00737509, 0.00418682, 0.00758937, 0.00002331, 0.00000690],
+		[-3.60769852, -0.00734780, 0.00416737, 0.00756175, 0.00002308, 0.00000687],
+		[-3.61235907, -0.00732081, 0.00414813, 0.00753441, 0.00002286, 0.00000684],
+		[-3.61702235, -0.00729411, 0.00412910, 0.00750735, 0.00002263, 0.00000681],
+		[-3.62168828, -0.00726771, 0.00411028, 0.00748058, 0.00002241, 0.00000678],
+		[-3.62635680, -0.00724159, 0.00409166, 0.00745407, 0.00002219, 0.00000674],
+		[-3.63102782, -0.00721575, 0.00407325, 0.00742783, 0.00002198, 0.00000671],
+		[-3.63570128, -0.00719020, 0.00405503, 0.00740186, 0.00002176, 0.00000668],
+		[-3.64037709, -0.00716491, 0.00403700, 0.00737615, 0.00002156, 0.00000665],
+		[-3.64505519, -0.00713990, 0.00401918, 0.00735070, 0.00002135, 0.00000662],
+		[-3.64973550, -0.00711515, 0.00400154, 0.00732550, 0.00002115, 0.00000659],
+		[-3.65441795, -0.00709066, 0.00398409, 0.00730055, 0.00002094, 0.00000656],
+		[-3.65910247, -0.00706643, 0.00396683, 0.00727585, 0.00002075, 0.00000653],
+		[-3.66378898, -0.00704246, 0.00394975, 0.00725140, 0.00002055, 0.00000650],
+		[-3.66847740, -0.00701873, 0.00393286, 0.00722718, 0.00002036, 0.00000647],
+		[-3.67316767, -0.00699526, 0.00391614, 0.00720320, 0.00002017, 0.00000644],
+		[-3.67785972, -0.00697202, 0.00389960, 0.00717946, 0.00001998, 0.00000641],
+		[-3.68255347, -0.00694903, 0.00388324, 0.00715594, 0.00001979, 0.00000638],
+		[-3.68724885, -0.00692627, 0.00386705, 0.00713266, 0.00001961, 0.00000636],
+		[-3.69194579, -0.00690374, 0.00385103, 0.00710959, 0.00001943, 0.00000633],
+		[-3.69664421, -0.00688145, 0.00383518, 0.00708675, 0.00001925, 0.00000630],
+		[-3.70134406, -0.00685938, 0.00381949, 0.00706413, 0.00001907, 0.00000627],
+		[-3.70604525, -0.00683753, 0.00380397, 0.00704173, 0.00001890, 0.00000624],
+		[-3.71074772, -0.00681590, 0.00378861, 0.00701953, 0.00001873, 0.00000621],
+		[-3.71545140, -0.00679449, 0.00377342, 0.00699755, 0.00001856, 0.00000618],
+		[-3.72015622, -0.00677330, 0.00375838, 0.00697577, 0.00001839, 0.00000615],
+		[-3.72486211, -0.00675231, 0.00374349, 0.00695420, 0.00001823, 0.00000612],
+		[-3.72956899, -0.00673153, 0.00372877, 0.00693283, 0.00001806, 0.00000609],
+		[-3.73427682, -0.00671096, 0.00371419, 0.00691165, 0.00001790, 0.00000607],
+		[-3.73898550, -0.00669059, 0.00369976, 0.00689068, 0.00001774, 0.00000604],
+		[-3.74369498, -0.00667042, 0.00368549, 0.00686989, 0.00001759, 0.00000601],
+		[-3.74840519, -0.00665044, 0.00367136, 0.00684930, 0.00001743, 0.00000598],
+		[-3.75311607, -0.00663066, 0.00365738, 0.00682890, 0.00001728, 0.00000595],
+		[-3.75782754, -0.00661107, 0.00364354, 0.00680868, 0.00001713, 0.00000592],
+		[-3.76253955, -0.00659167, 0.00362984, 0.00678865, 0.00001698, 0.00000590],
+		[-3.76725202, -0.00657245, 0.00361628, 0.00676880, 0.00001683, 0.00000587],
+		[-3.77196489, -0.00655341, 0.00360286, 0.00674913, 0.00001668, 0.00000584],
+		[-3.77667809, -0.00653456, 0.00358958, 0.00672963, 0.00001654, 0.00000581],
+		[-3.78139156, -0.00651589, 0.00357643, 0.00671031, 0.00001640, 0.00000579],
+		[-3.78610525, -0.00649739, 0.00356342, 0.00669116, 0.00001625, 0.00000576],
+		[-3.79081907, -0.00647906, 0.00355053, 0.00667218, 0.00001612, 0.00000573],
+		[-3.79553298, -0.00646091, 0.00353778, 0.00665337, 0.00001598, 0.00000570],
+		[-3.80024690, -0.00644292, 0.00352516, 0.00663472, 0.00001584, 0.00000568],
+		[-3.80496078, -0.00642510, 0.00351266, 0.00661624, 0.00001571, 0.00000565],
+		[-3.80967455, -0.00640745, 0.00350029, 0.00659792, 0.00001557, 0.00000562],
+		[-3.81438815, -0.00638996, 0.00348804, 0.00657976, 0.00001544, 0.00000560],
+		[-3.81910152, -0.00637262, 0.00347592, 0.00656176, 0.00001531, 0.00000557],
+		[-3.82381460, -0.00635545, 0.00346392, 0.00654391, 0.00001519, 0.00000554],
+		[-3.82852732, -0.00633843, 0.00345204, 0.00652622, 0.00001506, 0.00000552],
+		[-3.83323964, -0.00632157, 0.00344027, 0.00650867, 0.00001493, 0.00000549],
+		[-3.83795149, -0.00630485, 0.00342863, 0.00649128, 0.00001481, 0.00000546],
+		[-3.84266280, -0.00628829, 0.00341709, 0.00647404, 0.00001469, 0.00000544],
+		[-3.84737353, -0.00627187, 0.00340568, 0.00645694, 0.00001457, 0.00000541],
+		[-3.85208361, -0.00625560, 0.00339437, 0.00643998, 0.00001445, 0.00000538],
+		[-3.85679299, -0.00623948, 0.00338318, 0.00642317, 0.00001433, 0.00000536],
+		[-3.86150160, -0.00622349, 0.00337210, 0.00640650, 0.00001421, 0.00000533],
+		[-3.86620939, -0.00620765, 0.00336112, 0.00638997, 0.00001410, 0.00000531],
+		[-3.87091631, -0.00619194, 0.00335026, 0.00637358, 0.00001398, 0.00000528],
+		[-3.87562229, -0.00617637, 0.00333950, 0.00635732, 0.00001387, 0.00000526],
+		[-3.88032729, -0.00616094, 0.00332885, 0.00634120, 0.00001376, 0.00000523],
+		[-3.88503124, -0.00614564, 0.00331830, 0.00632520, 0.00001364, 0.00000521],
+		[-3.88973410, -0.00613047, 0.00330785, 0.00630934, 0.00001354, 0.00000518],
+		[-3.89443580, -0.00611543, 0.00329750, 0.00629361, 0.00001343, 0.00000515],
+		[-3.89913629, -0.00610051, 0.00328726, 0.00627801, 0.00001332, 0.00000513],
+		[-3.90383552, -0.00608573, 0.00327711, 0.00626253, 0.00001321, 0.00000510],
+		[-3.90853343, -0.00607107, 0.00326707, 0.00624718, 0.00001311, 0.00000508],
+		[-3.91322998, -0.00605653, 0.00325712, 0.00623195, 0.00001301, 0.00000506],
+		[-3.91792511, -0.00604212, 0.00324726, 0.00621684, 0.00001290, 0.00000503],
+		[-3.92261876, -0.00602782, 0.00323750, 0.00620185, 0.00001280, 0.00000501],
+		[-3.92731089, -0.00601364, 0.00322784, 0.00618698, 0.00001270, 0.00000498],
+		[-3.93200144, -0.00599958, 0.00321826, 0.00617223, 0.00001260, 0.00000496],
+		[-3.93669036, -0.00598564, 0.00320878, 0.00615760, 0.00001250, 0.00000493],
+		[-3.94137761, -0.00597181, 0.00319939, 0.00614308, 0.00001241, 0.00000491],
+		[-3.94606313, -0.00595809, 0.00319009, 0.00612867, 0.00001231, 0.00000488],
+		[-3.95074687, -0.00594449, 0.00318088, 0.00611438, 0.00001221, 0.00000486],
+		[-3.95542878, -0.00593099, 0.00317175, 0.00610019, 0.00001212, 0.00000484],
+		[-3.96010882, -0.00591761, 0.00316271, 0.00608612, 0.00001203, 0.00000481],
+		[-3.96478693, -0.00590433, 0.00315376, 0.00607215, 0.00001193, 0.00000479],
+		[-3.96946306, -0.00589116, 0.00314489, 0.00605829, 0.00001184, 0.00000477],
+		[-3.97413718, -0.00587809, 0.00313611, 0.00604454, 0.00001175, 0.00000474],
+		[-3.97880922, -0.00586512, 0.00312740, 0.00603089, 0.00001166, 0.00000472],
+		[-3.98347915, -0.00585226, 0.00311878, 0.00601735, 0.00001157, 0.00000470],
+		[-3.98814692, -0.00583950, 0.00311024, 0.00600390, 0.00001149, 0.00000467],
+		[-3.99281247, -0.00582684, 0.00310178, 0.00599056, 0.00001140, 0.00000465],
+		[-3.99747577, -0.00581428, 0.00309340, 0.00597732, 0.00001131, 0.00000463],
+		[-4.00213677, -0.00580181, 0.00308510, 0.00596417, 0.00001123, 0.00000460],
+		[-4.00679542, -0.00578944, 0.00307688, 0.00595113, 0.00001114, 0.00000458],
+		[-4.01145168, -0.00577717, 0.00306873, 0.00593818, 0.00001106, 0.00000456],
+		[-4.01610551, -0.00576499, 0.00306065, 0.00592532, 0.00001098, 0.00000454],
+		[-4.02075685, -0.00575290, 0.00305266, 0.00591256, 0.00001090, 0.00000451],
+		[-4.02540567, -0.00574091, 0.00304473, 0.00589990, 0.00001082, 0.00000449],
+		[-4.03005191, -0.00572900, 0.00303688, 0.00588732, 0.00001073, 0.00000447],
+		[-4.03469555, -0.00571719, 0.00302910, 0.00587484, 0.00001066, 0.00000445],
+		[-4.03933654, -0.00570546, 0.00302139, 0.00586244, 0.00001058, 0.00000443],
+		[-4.04397482, -0.00569382, 0.00301375, 0.00585014, 0.00001050, 0.00000440],
+		[-4.04861037, -0.00568227, 0.00300619, 0.00583792, 0.00001042, 0.00000438],
+		[-4.05324314, -0.00567080, 0.00299869, 0.00582579, 0.00001035, 0.00000436],
+		[-4.05787308, -0.00565942, 0.00299126, 0.00581375, 0.00001027, 0.00000434],
+		[-4.06250017, -0.00564812, 0.00298390, 0.00580179, 0.00001019, 0.00000432],
+		[-4.06712435, -0.00563690, 0.00297660, 0.00578992, 0.00001012, 0.00000430],
+		[-4.07174558, -0.00562577, 0.00296937, 0.00577813, 0.00001005, 0.00000427],
+		[-4.07636383, -0.00561471, 0.00296221, 0.00576642, 0.00000997, 0.00000425],
+		[-4.08097906, -0.00560374, 0.00295511, 0.00575480, 0.00000990, 0.00000423],
+		[-4.08559122, -0.00559284, 0.00294807, 0.00574325, 0.00000983, 0.00000421],
+		[-4.09020028, -0.00558202, 0.00294110, 0.00573179, 0.00000976, 0.00000419],
+		[-4.09480620, -0.00557128, 0.00293419, 0.00572040, 0.00000969, 0.00000417],
+		[-4.09940894, -0.00556061, 0.00292734, 0.00570909, 0.00000962, 0.00000415],
+		[-4.10400846, -0.00555002, 0.00292056, 0.00569786, 0.00000955, 0.00000413],
+		[-4.10860473, -0.00553950, 0.00291383, 0.00568670, 0.00000948, 0.00000411],
+		[-4.11319770, -0.00552906, 0.00290717, 0.00567562, 0.00000942, 0.00000409],
+		[-4.11778734, -0.00551869, 0.00290056, 0.00566462, 0.00000935, 0.00000407],
+		[-4.12237362, -0.00550839, 0.00289401, 0.00565369, 0.00000928, 0.00000405],
+		[-4.12695649, -0.00549816, 0.00288752, 0.00564283, 0.00000922, 0.00000403],
+		[-4.13153592, -0.00548801, 0.00288109, 0.00563204, 0.00000915, 0.00000401],
+		[-4.13611188, -0.00547792, 0.00287471, 0.00562133, 0.00000909, 0.00000399],
+		[-4.14068433, -0.00546790, 0.00286839, 0.00561069, 0.00000902, 0.00000397],
+		[-4.14525323, -0.00545795, 0.00286213, 0.00560011, 0.00000896, 0.00000395],
+		[-4.14981854, -0.00544806, 0.00285592, 0.00558961, 0.00000890, 0.00000393],
+		[-4.15438025, -0.00543824, 0.00284976, 0.00557918, 0.00000883, 0.00000391],
+		[-4.15893830, -0.00542849, 0.00284366, 0.00556881, 0.00000877, 0.00000389],
+		[-4.16349267, -0.00541880, 0.00283761, 0.00555851, 0.00000871, 0.00000387],
+		[-4.16804332, -0.00540918, 0.00283162, 0.00554827, 0.00000865, 0.00000385],
+		[-4.17259021, -0.00539962, 0.00282567, 0.00553811, 0.00000859, 0.00000383],
+		[-4.17713333, -0.00539012, 0.00281978, 0.00552800, 0.00000853, 0.00000381],
+		[-4.18167262, -0.00538069, 0.00281394, 0.00551796, 0.00000847, 0.00000379],
+		[-4.18620807, -0.00537131, 0.00280815, 0.00550799, 0.00000841, 0.00000377],
+		[-4.19073963, -0.00536200, 0.00280241, 0.00549808, 0.00000836, 0.00000375],
+		[-4.19526728, -0.00535274, 0.00279671, 0.00548823, 0.00000830, 0.00000373],
+		[-4.19979098, -0.00534355, 0.00279107, 0.00547844, 0.00000824, 0.00000372],
+		[-4.20431070, -0.00533441, 0.00278548, 0.00546871, 0.00000818, 0.00000370],
+		[-4.20882641, -0.00532534, 0.00277993, 0.00545905, 0.00000813, 0.00000368],
+		[-4.21333809, -0.00531632, 0.00277443, 0.00544944, 0.00000807, 0.00000366],
+		[-4.21784569, -0.00530735, 0.00276897, 0.00543989, 0.00000802, 0.00000364],
+		[-4.22234919, -0.00529845, 0.00276357, 0.00543040, 0.00000796, 0.00000362],
+		[-4.22684856, -0.00528959, 0.00275820, 0.00542097, 0.00000791, 0.00000361],
+		[-4.23134377, -0.00528080, 0.00275289, 0.00541160, 0.00000786, 0.00000359],
+		[-4.23583479, -0.00527206, 0.00274762, 0.00540228, 0.00000780, 0.00000357],
+		[-4.24032159, -0.00526337, 0.00274239, 0.00539302, 0.00000775, 0.00000355],
+		[-4.24480413, -0.00525473, 0.00273720, 0.00538382, 0.00000770, 0.00000353],
+		[-4.24928241, -0.00524615, 0.00273206, 0.00537467, 0.00000765, 0.00000352],
+		[-4.25375637, -0.00523762, 0.00272697, 0.00536557, 0.00000759, 0.00000350],
+		[-4.25822600, -0.00522914, 0.00272191, 0.00535653, 0.00000754, 0.00000348],
+		[-4.26269127, -0.00522071, 0.00271690, 0.00534754, 0.00000749, 0.00000346],
+		[-4.26715214, -0.00521233, 0.00271193, 0.00533861, 0.00000744, 0.00000345],
+		[-4.27160860, -0.00520401, 0.00270700, 0.00532973, 0.00000739, 0.00000343],
+		[-4.27606061, -0.00519573, 0.00270211, 0.00532090, 0.00000734, 0.00000341],
+		[-4.28050816, -0.00518750, 0.00269726, 0.00531212, 0.00000729, 0.00000339],
+		[-4.28495120, -0.00517932, 0.00269245, 0.00530339, 0.00000725, 0.00000338],
+		[-4.28938971, -0.00517119, 0.00268767, 0.00529471, 0.00000720, 0.00000336],
+		[-4.29382368, -0.00516310, 0.00268294, 0.00528608, 0.00000715, 0.00000334],
+		[-4.29825306, -0.00515506, 0.00267825, 0.00527750, 0.00000710, 0.00000333],
+		[-4.30267785, -0.00514707, 0.00267359, 0.00526897, 0.00000706, 0.00000331],
+		[-4.30709800, -0.00513912, 0.00266898, 0.00526049, 0.00000701, 0.00000329],
+		[-4.31151350, -0.00513122, 0.00266440, 0.00525206, 0.00000696, 0.00000328],
+		[-4.31592431, -0.00512337, 0.00265985, 0.00524367, 0.00000692, 0.00000326],
+		[-4.32033043, -0.00511555, 0.00265535, 0.00523533, 0.00000687, 0.00000324],
+		[-4.32473181, -0.00510779, 0.00265088, 0.00522704, 0.00000683, 0.00000323],
+		[-4.32912844, -0.00510006, 0.00264644, 0.00521879, 0.00000678, 0.00000321],
+		[-4.33352030, -0.00509238, 0.00264204, 0.00521059, 0.00000674, 0.00000319],
+		[-4.33790735, -0.00508474, 0.00263768, 0.00520243, 0.00000669, 0.00000318],
+		[-4.34228957, -0.00507715, 0.00263335, 0.00519432, 0.00000665, 0.00000316],
+		[-4.34666695, -0.00506959, 0.00262906, 0.00518625, 0.00000661, 0.00000315],
+		[-4.35103946, -0.00506208, 0.00262479, 0.00517822, 0.00000656, 0.00000313],
+		[-4.35540706, -0.00505461, 0.00262057, 0.00517024, 0.00000652, 0.00000311],
+		[-4.35976976, -0.00504718, 0.00261637, 0.00516230, 0.00000648, 0.00000310],
+		[-4.36412751, -0.00503978, 0.00261221, 0.00515441, 0.00000644, 0.00000308],
+		[-4.36848029, -0.00503243, 0.00260808, 0.00514656, 0.00000639, 0.00000307],
+		[-4.37282810, -0.00502512, 0.00260399, 0.00513874, 0.00000635, 0.00000305],
+		[-4.37717089, -0.00501785, 0.00259992, 0.00513097, 0.00000631, 0.00000304],
+		[-4.38150866, -0.00501061, 0.00259589, 0.00512324, 0.00000627, 0.00000302],
+		[-4.38584137, -0.00500341, 0.00259189, 0.00511555, 0.00000623, 0.00000301],
+		[-4.39016901, -0.00499626, 0.00258792, 0.00510791, 0.00000619, 0.00000299],
+		[-4.39449156, -0.00498913, 0.00258397, 0.00510030, 0.00000615, 0.00000298],
+		[-4.39880900, -0.00498205, 0.00258006, 0.00509273, 0.00000611, 0.00000296],
+		[-4.40312130, -0.00497500, 0.00257618, 0.00508520, 0.00000607, 0.00000295],
+		[-4.40742845, -0.00496799, 0.00257233, 0.00507770, 0.00000603, 0.00000293],
+		[-4.41173042, -0.00496101, 0.00256851, 0.00507025, 0.00000599, 0.00000292],
+		[-4.41602719, -0.00495407, 0.00256472, 0.00506283, 0.00000596, 0.00000290],
+		[-4.42031875, -0.00494717, 0.00256096, 0.00505545, 0.00000592, 0.00000289],
+		[-4.42460508, -0.00494030, 0.00255722, 0.00504811, 0.00000588, 0.00000287],
+		[-4.42888615, -0.00493346, 0.00255351, 0.00504081, 0.00000584, 0.00000286],
+		[-4.43316194, -0.00492666, 0.00254984, 0.00503354, 0.00000581, 0.00000284],
+		[-4.43743244, -0.00491989, 0.00254618, 0.00502631, 0.00000577, 0.00000283],
+		[-4.44169763, -0.00491316, 0.00254256, 0.00501911, 0.00000573, 0.00000281],
+		[-4.44595749, -0.00490646, 0.00253896, 0.00501195, 0.00000570, 0.00000280],
+		[-4.45021200, -0.00489979, 0.00253539, 0.00500482, 0.00000566, 0.00000279],
+		[-4.45446115, -0.00489316, 0.00253185, 0.00499773, 0.00000562, 0.00000277],
+		[-4.45870490, -0.00488655, 0.00252833, 0.00499068, 0.00000559, 0.00000276],
+		[-4.46294326, -0.00487998, 0.00252484, 0.00498365, 0.00000555, 0.00000274],
+		[-4.46717619, -0.00487344, 0.00252137, 0.00497667, 0.00000552, 0.00000273],
+		[-4.47140368, -0.00486693, 0.00251793, 0.00496971, 0.00000548, 0.00000272],
+		[-4.47562571, -0.00486046, 0.00251451, 0.00496279, 0.00000545, 0.00000270],
+		[-4.47984227, -0.00485401, 0.00251112, 0.00495590, 0.00000541, 0.00000269],
+		[-4.48405334, -0.00484759, 0.00250775, 0.00494904, 0.00000538, 0.00000268],
+		[-4.48825891, -0.00484121, 0.00250441, 0.00494222, 0.00000535, 0.00000266],
+		[-4.49245894, -0.00483485, 0.00250109, 0.00493543, 0.00000531, 0.00000265],
+		[-4.49665344, -0.00482852, 0.00249780, 0.00492867, 0.00000528, 0.00000264],
+		[-4.50084238, -0.00482223, 0.00249453, 0.00492194, 0.00000525, 0.00000262],
+		[-4.50502575, -0.00481596, 0.00249128, 0.00491524, 0.00000521, 0.00000261],
+		[-4.50920352, -0.00480972, 0.00248805, 0.00490857, 0.00000518, 0.00000260],
+		[-4.51337569, -0.00480350, 0.00248485, 0.00490194, 0.00000515, 0.00000258],
+		[-4.51754224, -0.00479732, 0.00248167, 0.00489533, 0.00000512, 0.00000257],
+		[-4.52170315, -0.00479117, 0.00247851, 0.00488876, 0.00000508, 0.00000256],
+		[-4.52585842, -0.00478504, 0.00247538, 0.00488221, 0.00000505, 0.00000254],
+		[-4.53000801, -0.00477894, 0.00247227, 0.00487569, 0.00000502, 0.00000253],
+		[-4.53415192, -0.00477286, 0.00246917, 0.00486921, 0.00000499, 0.00000252],
+		[-4.53829014, -0.00476682, 0.00246610, 0.00486275, 0.00000496, 0.00000251],
+		[-4.54242264, -0.00476080, 0.00246306, 0.00485632, 0.00000493, 0.00000249],
+		[-4.54654942, -0.00475480, 0.00246003, 0.00484992, 0.00000490, 0.00000248],
+		[-4.55067046, -0.00474884, 0.00245702, 0.00484354, 0.00000487, 0.00000247],
+		[-4.55478574, -0.00474290, 0.00245404, 0.00483720, 0.00000484, 0.00000245],
+		[-4.55889526, -0.00473698, 0.00245107, 0.00483088, 0.00000481, 0.00000244],
+		[-4.56299899, -0.00473109, 0.00244812, 0.00482459, 0.00000478, 0.00000243],
+		[-4.56709693, -0.00472522, 0.00244520, 0.00481833, 0.00000475, 0.00000242],
+		[-4.57118906, -0.00471938, 0.00244229, 0.00481209, 0.00000472, 0.00000241],
+		[-4.57527536, -0.00471357, 0.00243940, 0.00480588, 0.00000469, 0.00000239],
+		[-4.57935583, -0.00470778, 0.00243654, 0.00479970, 0.00000466, 0.00000238],
+		[-4.58343045, -0.00470201, 0.00243369, 0.00479354, 0.00000463, 0.00000237],
+		[-4.58749921, -0.00469627, 0.00243086, 0.00478741, 0.00000460, 0.00000236],
+		[-4.59156210, -0.00469055, 0.00242805, 0.00478131, 0.00000457, 0.00000235],
+		[-4.59561910, -0.00468485, 0.00242526, 0.00477523, 0.00000454, 0.00000233],
+		[-4.59967020, -0.00467918, 0.00242248, 0.00476918, 0.00000452, 0.00000232],
+		[-4.60371538, -0.00467353, 0.00241973, 0.00476315, 0.00000449, 0.00000231],
+		[-4.60775465, -0.00466791, 0.00241699, 0.00475714, 0.00000446, 0.00000230],
+		[-4.61178797, -0.00466230, 0.00241427, 0.00475116, 0.00000443, 0.00000229],
+		[-4.61581536, -0.00465672, 0.00241157, 0.00474521, 0.00000441, 0.00000228],
+		[-4.61983678, -0.00465116, 0.00240889, 0.00473928, 0.00000438, 0.00000226],
+		[-4.62385223, -0.00464563, 0.00240622, 0.00473337, 0.00000435, 0.00000225],
+		[-4.62786170, -0.00464011, 0.00240357, 0.00472749, 0.00000432, 0.00000224],
+		[-4.63186517, -0.00463462, 0.00240093, 0.00472163, 0.00000430, 0.00000223],
+		[-4.63586264, -0.00462915, 0.00239832, 0.00471580, 0.00000427, 0.00000222],
+		[-4.63985410, -0.00462370, 0.00239572, 0.00470998, 0.00000425, 0.00000221],
+		[-4.64383953, -0.00461827, 0.00239313, 0.00470419, 0.00000422, 0.00000220],
+		[-4.64781892, -0.00461286, 0.00239057, 0.00469843, 0.00000419, 0.00000219],
+		[-4.65179227, -0.00460748, 0.00238802, 0.00469268, 0.00000417, 0.00000217],
+		[-4.65575956, -0.00460211, 0.00238548, 0.00468696, 0.00000414, 0.00000216],
+		[-4.65972078, -0.00459677, 0.00238296, 0.00468126, 0.00000412, 0.00000215],
+		[-4.66367592, -0.00459144, 0.00238046, 0.00467559, 0.00000409, 0.00000214],
+		[-4.66762497, -0.00458614, 0.00237797, 0.00466993, 0.00000407, 0.00000213],
+		[-4.67156793, -0.00458085, 0.00237549, 0.00466430, 0.00000404, 0.00000212],
+		[-4.67550478, -0.00457558, 0.00237303, 0.00465869, 0.00000402, 0.00000211],
+		[-4.67943552, -0.00457034, 0.00237059, 0.00465310, 0.00000399, 0.00000210],
+		[-4.68336012, -0.00456511, 0.00236816, 0.00464753, 0.00000397, 0.00000209],
+		[-4.68727860, -0.00455990, 0.00236575, 0.00464198, 0.00000394, 0.00000208],
+		[-4.69119092, -0.00455472, 0.00236335, 0.00463645, 0.00000392, 0.00000207],
+		[-4.69509710, -0.00454955, 0.00236096, 0.00463095, 0.00000389, 0.00000206],
+		[-4.69899711, -0.00454440, 0.00235859, 0.00462546, 0.00000387, 0.00000205],
+		[-4.70289095, -0.00453926, 0.00235623, 0.00461999, 0.00000385, 0.00000204],
+		[-4.70677861, -0.00453415, 0.00235389, 0.00461455, 0.00000382, 0.00000203],
+		[-4.71066008, -0.00452905, 0.00235156, 0.00460912, 0.00000380, 0.00000202],
+		[-4.71453535, -0.00452398, 0.00234924, 0.00460372, 0.00000378, 0.00000200],
+		[-4.71840442, -0.00451892, 0.00234694, 0.00459833, 0.00000375, 0.00000199],
+		[-4.72226728, -0.00451387, 0.00234465, 0.00459296, 0.00000373, 0.00000198],
+		[-4.72612392, -0.00450885, 0.00234237, 0.00458761, 0.00000371, 0.00000197],
+		[-4.72997433, -0.00450384, 0.00234011, 0.00458229, 0.00000369, 0.00000196],
+		[-4.73381850, -0.00449885, 0.00233786, 0.00457698, 0.00000366, 0.00000195],
+		[-4.73765643, -0.00449388, 0.00233562, 0.00457168, 0.00000364, 0.00000195],
+		[-4.74148810, -0.00448893, 0.00233340, 0.00456641, 0.00000362, 0.00000194],
+		[-4.74531352, -0.00448399, 0.00233119, 0.00456116, 0.00000360, 0.00000193],
+		[-4.74913267, -0.00447907, 0.00232899, 0.00455592, 0.00000357, 0.00000192],
+		[-4.75294555, -0.00447416, 0.00232680, 0.00455071, 0.00000355, 0.00000191],
+		[-4.75675214, -0.00446927, 0.00232462, 0.00454551, 0.00000353, 0.00000190],
+		[-4.76055246, -0.00446440, 0.00232246, 0.00454033, 0.00000351, 0.00000189],
+		[-4.76434647, -0.00445955, 0.00232031, 0.00453516, 0.00000349, 0.00000188],
+		[-4.76813419, -0.00445471, 0.00231816, 0.00453002, 0.00000347, 0.00000187],
+		[-4.77191560, -0.00444988, 0.00231604, 0.00452489, 0.00000344, 0.00000186],
+		[-4.77569070, -0.00444507, 0.00231392, 0.00451978, 0.00000342, 0.00000185],
+		[-4.77945947, -0.00444028, 0.00231181, 0.00451469, 0.00000340, 0.00000184],
+		[-4.78322192, -0.00443550, 0.00230972, 0.00450961, 0.00000338, 0.00000183],
+		[-4.78697804, -0.00443074, 0.00230763, 0.00450455, 0.00000336, 0.00000182],
+		[-4.79072783, -0.00442600, 0.00230556, 0.00449951, 0.00000334, 0.00000181],
+		[-4.79447127, -0.00442127, 0.00230350, 0.00449448, 0.00000332, 0.00000180],
+		[-4.79820836, -0.00441655, 0.00230145, 0.00448947, 0.00000330, 0.00000179],
+		[-4.80193909, -0.00441185, 0.00229941, 0.00448448, 0.00000328, 0.00000178],
+		[-4.80566347, -0.00440716, 0.00229738, 0.00447951, 0.00000326, 0.00000178],
+		[-4.80938148, -0.00440249, 0.00229536, 0.00447454, 0.00000324, 0.00000177],
+		[-4.81309312, -0.00439783, 0.00229335, 0.00446960, 0.00000322, 0.00000176],
+		[-4.81679838, -0.00439319, 0.00229135, 0.00446467, 0.00000320, 0.00000175],
+		[-4.82049726, -0.00438856, 0.00228937, 0.00445976, 0.00000318, 0.00000174],
+		[-4.82418976, -0.00438395, 0.00228739, 0.00445486, 0.00000316, 0.00000173],
+		[-4.82787587, -0.00437935, 0.00228542, 0.00444998, 0.00000314, 0.00000172],
+		[-4.83155558, -0.00437476, 0.00228346, 0.00444512, 0.00000312, 0.00000171],
+		[-4.83522889, -0.00437019, 0.00228151, 0.00444027, 0.00000310, 0.00000171],
+		[-4.83889580, -0.00436563, 0.00227957, 0.00443543, 0.00000308, 0.00000170],
+		[-4.84255630, -0.00436109, 0.00227764, 0.00443061, 0.00000306, 0.00000169],
+		[-4.84621038, -0.00435656, 0.00227572, 0.00442580, 0.00000305, 0.00000168],
+		[-4.84985805, -0.00435204, 0.00227381, 0.00442101, 0.00000303, 0.00000167],
+		[-4.85349930, -0.00434753, 0.00227191, 0.00441624, 0.00000301, 0.00000166],
+		[-4.85713412, -0.00434304, 0.00227002, 0.00441148, 0.00000299, 0.00000165],
+		[-4.86076252, -0.00433856, 0.00226813, 0.00440673, 0.00000297, 0.00000165],
+		[-4.86438448, -0.00433410, 0.00226626, 0.00440200, 0.00000295, 0.00000164],
+		[-4.86800001, -0.00432965, 0.00226439, 0.00439728, 0.00000294, 0.00000163],
+		[-4.87160909, -0.00432521, 0.00226253, 0.00439258, 0.00000292, 0.00000162],
+		[-4.87521174, -0.00432078, 0.00226069, 0.00438789, 0.00000290, 0.00000161],
+		[-4.87880793, -0.00431637, 0.00225885, 0.00438321, 0.00000288, 0.00000161],
+		[-4.88239768, -0.00431196, 0.00225701, 0.00437855, 0.00000286, 0.00000160],
+		[-4.88598098, -0.00430758, 0.00225519, 0.00437390, 0.00000285, 0.00000159],
+		[-4.88955781, -0.00430320, 0.00225338, 0.00436927, 0.00000283, 0.00000158],
+		[-4.89312819, -0.00429883, 0.00225157, 0.00436465, 0.00000281, 0.00000157],
+		[-4.89669211, -0.00429448, 0.00224977, 0.00436004, 0.00000279, 0.00000157],
+		[-4.90024957, -0.00429014, 0.00224798, 0.00435545, 0.00000278, 0.00000156],
+		[-4.90380055, -0.00428581, 0.00224620, 0.00435087, 0.00000276, 0.00000155],
+		[-4.90734507, -0.00428150, 0.00224442, 0.00434630, 0.00000274, 0.00000154],
+		[-4.91088312, -0.00427719, 0.00224266, 0.00434174, 0.00000272, 0.00000153],
+		[-4.91441469, -0.00427290, 0.00224090, 0.00433720, 0.00000271, 0.00000153],
+		[-4.91793978, -0.00426862, 0.00223915, 0.00433267, 0.00000269, 0.00000152],
+		[-4.92145840, -0.00426435, 0.00223740, 0.00432816, 0.00000267, 0.00000151],
+		[-4.92497053, -0.00426009, 0.00223566, 0.00432366, 0.00000266, 0.00000150],
+		[-4.92847618, -0.00425584, 0.00223394, 0.00431916, 0.00000264, 0.00000150],
+		[-4.93197535, -0.00425160, 0.00223221, 0.00431469, 0.00000262, 0.00000149],
+		[-4.93546803, -0.00424738, 0.00223050, 0.00431022, 0.00000261, 0.00000148],
+		[-4.93895423, -0.00424317, 0.00222879, 0.00430577, 0.00000259, 0.00000147],
+		[-4.94243393, -0.00423896, 0.00222709, 0.00430133, 0.00000258, 0.00000147],
+		[-4.94590714, -0.00423477, 0.00222540, 0.00429690, 0.00000256, 0.00000146],
+		[-4.94937386, -0.00423059, 0.00222371, 0.00429248, 0.00000254, 0.00000145],
+		[-4.95283409, -0.00422642, 0.00222203, 0.00428808, 0.00000253, 0.00000144],
+		[-4.95628782, -0.00422226, 0.00222036, 0.00428368, 0.00000251, 0.00000144],
+		[-4.95973505, -0.00421811, 0.00221869, 0.00427930, 0.00000250, 0.00000143],
+		[-4.96317579, -0.00421397, 0.00221703, 0.00427493, 0.00000248, 0.00000142],
+		[-4.96661002, -0.00420984, 0.00221538, 0.00427058, 0.00000246, 0.00000142],
+		[-4.97003776, -0.00420573, 0.00221373, 0.00426623, 0.00000245, 0.00000141],
+		[-4.97345900, -0.00420162, 0.00221209, 0.00426189, 0.00000243, 0.00000140],
+		[-4.97687374, -0.00419752, 0.00221046, 0.00425757, 0.00000242, 0.00000139],
+		[-4.98028197, -0.00419344, 0.00220883, 0.00425326, 0.00000240, 0.00000139],
+		[-4.98368371, -0.00418936, 0.00220721, 0.00424896, 0.00000239, 0.00000138],
+		[-4.98707894, -0.00418529, 0.00220559, 0.00424467, 0.00000237, 0.00000137],
+		[-4.99046767, -0.00418123, 0.00220398, 0.00424039, 0.00000236, 0.00000137],
+		[-4.99384989, -0.00417719, 0.00220238, 0.00423612, 0.00000234, 0.00000136],
+		[-4.99722561, -0.00417315, 0.00220078, 0.00423187, 0.00000233, 0.00000135],
+		[-5.00059483, -0.00416912, 0.00219919, 0.00422762, 0.00000231, 0.00000135],
+		[-5.00395754, -0.00416511, 0.00219761, 0.00422339, 0.00000230, 0.00000134],
+		[-5.00731375, -0.00416110, 0.00219603, 0.00421916, 0.00000228, 0.00000133],
+		[-5.01066346, -0.00415710, 0.00219445, 0.00421495, 0.00000227, 0.00000133],
+		[-5.01400667, -0.00415311, 0.00219288, 0.00421075, 0.00000226, 0.00000132],
+		[-5.01734337, -0.00414913, 0.00219132, 0.00420655, 0.00000224, 0.00000131],
+		[-5.02067356, -0.00414516, 0.00218976, 0.00420237, 0.00000223, 0.00000131],
+		[-5.02399726, -0.00414120, 0.00218821, 0.00419820, 0.00000221, 0.00000130],
+		[-5.02731445, -0.00413724, 0.00218666, 0.00419404, 0.00000220, 0.00000129],
+		[-5.03062515, -0.00413330, 0.00218512, 0.00418989, 0.00000218, 0.00000129],
+		[-5.03392934, -0.00412937, 0.00218359, 0.00418574, 0.00000217, 0.00000128],
+		[-5.03722703, -0.00412544, 0.00218206, 0.00418161, 0.00000216, 0.00000127],
+		[-5.04051822, -0.00412153, 0.00218053, 0.00417749, 0.00000214, 0.00000127],
+		[-5.04380292, -0.00411762, 0.00217901, 0.00417338, 0.00000213, 0.00000126],
+		[-5.04708112, -0.00411372, 0.00217750, 0.00416928, 0.00000212, 0.00000125],
+		[-5.05035282, -0.00410983, 0.00217599, 0.00416519, 0.00000210, 0.00000125],
+		[-5.05361802, -0.00410595, 0.00217448, 0.00416111, 0.00000209, 0.00000124],
+		[-5.05687674, -0.00410208, 0.00217298, 0.00415703, 0.00000207, 0.00000124],
+		[-5.06012896, -0.00409821, 0.00217148, 0.00415297, 0.00000206, 0.00000123],
+		[-5.06337469, -0.00409436, 0.00216999, 0.00414892, 0.00000205, 0.00000122],
+		[-5.06661393, -0.00409051, 0.00216851, 0.00414488, 0.00000203, 0.00000122],
+		[-5.06984668, -0.00408668, 0.00216703, 0.00414084, 0.00000202, 0.00000121],
+		[-5.07307294, -0.00408285, 0.00216555, 0.00413682, 0.00000201, 0.00000121],
+		[-5.07629272, -0.00407902, 0.00216408, 0.00413280, 0.00000199, 0.00000120],
+		[-5.07950602, -0.00407521, 0.00216261, 0.00412880, 0.00000198, 0.00000119],
+		[-5.08271283, -0.00407141, 0.00216115, 0.00412480, 0.00000197, 0.00000119],
+		[-5.08591317, -0.00406761, 0.00215969, 0.00412081, 0.00000196, 0.00000118],
+		[-5.08910703, -0.00406382, 0.00215823, 0.00411683, 0.00000194, 0.00000118],
+		[-5.09229441, -0.00406004, 0.00215678, 0.00411286, 0.00000193, 0.00000117],
+		[-5.09547532, -0.00405627, 0.00215534, 0.00410890, 0.00000192, 0.00000116],
+		[-5.09864975, -0.00405250, 0.00215390, 0.00410495, 0.00000191, 0.00000116],
+		[-5.10181772, -0.00404874, 0.00215246, 0.00410101, 0.00000189, 0.00000115],
+		[-5.10497922, -0.00404500, 0.00215102, 0.00409707, 0.00000188, 0.00000115],
+		[-5.10813425, -0.00404125, 0.00214960, 0.00409315, 0.00000187, 0.00000114],
+		[-5.11128282, -0.00403752, 0.00214817, 0.00408923, 0.00000186, 0.00000114],
+		[-5.11442494, -0.00403379, 0.00214675, 0.00408532, 0.00000184, 0.00000113],
+		[-5.11756059, -0.00403008, 0.00214533, 0.00408142, 0.00000183, 0.00000112],
+		[-5.12068979, -0.00402637, 0.00214392, 0.00407753, 0.00000182, 0.00000112],
+		[-5.12381254, -0.00402266, 0.00214251, 0.00407365, 0.00000181, 0.00000111],
+		[-5.12692884, -0.00401897, 0.00214110, 0.00406978, 0.00000179, 0.00000111],
+		[-5.13003869, -0.00401528, 0.00213970, 0.00406591, 0.00000178, 0.00000110],
+		[-5.13314210, -0.00401160, 0.00213831, 0.00406205, 0.00000177, 0.00000110],
+		[-5.13623906, -0.00400792, 0.00213691, 0.00405820, 0.00000176, 0.00000109],
+		[-5.13932959, -0.00400426, 0.00213552, 0.00405436, 0.00000175, 0.00000109],
+		[-5.14241368, -0.00400060, 0.00213413, 0.00405053, 0.00000173, 0.00000108],
+		[-5.14549135, -0.00399695, 0.00213275, 0.00404670, 0.00000172, 0.00000107],
+		[-5.14856258, -0.00399330, 0.00213137, 0.00404289, 0.00000171, 0.00000107],
+		[-5.15162739, -0.00398967, 0.00213000, 0.00403908, 0.00000170, 0.00000106],
+		[-5.15468577, -0.00398604, 0.00212862, 0.00403528, 0.00000169, 0.00000106],
+		[-5.15773774, -0.00398241, 0.00212725, 0.00403148, 0.00000168, 0.00000105],
+		[-5.16078329, -0.00397880, 0.00212589, 0.00402770, 0.00000167, 0.00000105],
+		[-5.16382243, -0.00397519, 0.00212453, 0.00402392, 0.00000165, 0.00000104],
+		[-5.16685516, -0.00397159, 0.00212317, 0.00402015, 0.00000164, 0.00000104],
+		[-5.16988149, -0.00396799, 0.00212181, 0.00401639, 0.00000163, 0.00000103],
+		[-5.17290141, -0.00396440, 0.00212046, 0.00401264, 0.00000162, 0.00000103],
+		[-5.17591494, -0.00396082, 0.00211911, 0.00400889, 0.00000161, 0.00000102],
+		[-5.17892208, -0.00395724, 0.00211776, 0.00400515, 0.00000160, 0.00000102],
+		[-5.18192282, -0.00395368, 0.00211642, 0.00400142, 0.00000159, 0.00000101],
+		[-5.18491718, -0.00395011, 0.00211508, 0.00399770, 0.00000158, 0.00000101],
+		[-5.18790516, -0.00394656, 0.00211374, 0.00399398, 0.00000156, 0.00000100],
+		[-5.19088675, -0.00394301, 0.00211241, 0.00399027, 0.00000155, 0.00000100],
+		[-5.19386198, -0.00393947, 0.00211108, 0.00398657, 0.00000154, 0.00000099],
+		[-5.19683083, -0.00393593, 0.00210975, 0.00398288, 0.00000153, 0.00000099],
+		[-5.19979332, -0.00393241, 0.00210843, 0.00397919, 0.00000152, 0.00000098],
+		[-5.20274945, -0.00392888, 0.00210710, 0.00397551, 0.00000151, 0.00000098],
+		[-5.20569922, -0.00392537, 0.00210578, 0.00397184, 0.00000150, 0.00000097],
+		[-5.20864264, -0.00392186, 0.00210447, 0.00396817, 0.00000149, 0.00000097],
+		[-5.21157971, -0.00391835, 0.00210315, 0.00396451, 0.00000148, 0.00000096],
+		[-5.21451043, -0.00391486, 0.00210184, 0.00396086, 0.00000147, 0.00000096],
+		[-5.21743482, -0.00391137, 0.00210054, 0.00395722, 0.00000146, 0.00000095],
+		[-5.22035287, -0.00390788, 0.00209923, 0.00395358, 0.00000145, 0.00000095],
+		[-5.22326459, -0.00390440, 0.00209793, 0.00394995, 0.00000144, 0.00000094],
+		[-5.22616999, -0.00390093, 0.00209663, 0.00394633, 0.00000143, 0.00000094],
+		[-5.22906906, -0.00389747, 0.00209533, 0.00394271, 0.00000142, 0.00000093],
+		[-5.23196182, -0.00389401, 0.00209404, 0.00393910, 0.00000141, 0.00000093],
+		[-5.23484826, -0.00389055, 0.00209274, 0.00393550, 0.00000140, 0.00000093],
+		[-5.23772840, -0.00388711, 0.00209145, 0.00393191, 0.00000139, 0.00000092],
+		[-5.24060224, -0.00388366, 0.00209017, 0.00392832, 0.00000138, 0.00000092],
+		[-5.24346978, -0.00388023, 0.00208888, 0.00392473, 0.00000137, 0.00000091],
+		[-5.24633103, -0.00387680, 0.00208760, 0.00392116, 0.00000136, 0.00000091],
+		[-5.24918599, -0.00387338, 0.00208632, 0.00391759, 0.00000135, 0.00000090],
+		[-5.25203467, -0.00386996, 0.00208504, 0.00391403, 0.00000134, 0.00000090],
+		[-5.25487707, -0.00386655, 0.00208377, 0.00391047, 0.00000133, 0.00000089],
+		[-5.25771320, -0.00386314, 0.00208250, 0.00390692, 0.00000132, 0.00000089],
+		[-5.26054307, -0.00385974, 0.00208123, 0.00390338, 0.00000131, 0.00000088],
+		[-5.26336668, -0.00385634, 0.00207996, 0.00389984, 0.00000130, 0.00000088],
+		[-5.26618402, -0.00385295, 0.00207869, 0.00389631, 0.00000129, 0.00000088],
+		[-5.26899512, -0.00384957, 0.00207743, 0.00389279, 0.00000128, 0.00000087],
+		[-5.27179998, -0.00384619, 0.00207617, 0.00388927, 0.00000127, 0.00000087],
+		[-5.27459860, -0.00384282, 0.00207491, 0.00388576, 0.00000126, 0.00000086],
+		[-5.27739098, -0.00383945, 0.00207365, 0.00388226, 0.00000125, 0.00000086],
+		[-5.28017713, -0.00383609, 0.00207240, 0.00387876, 0.00000124, 0.00000085],
+		[-5.28295706, -0.00383274, 0.00207115, 0.00387527, 0.00000123, 0.00000085],
+		[-5.28573078, -0.00382939, 0.00206989, 0.00387178, 0.00000122, 0.00000085],
+		[-5.28849828, -0.00382604, 0.00206865, 0.00386830, 0.00000121, 0.00000084],
+		[-5.29125958, -0.00382271, 0.00206740, 0.00386483, 0.00000120, 0.00000084],
+		[-5.29401468, -0.00381937, 0.00206616, 0.00386136, 0.00000119, 0.00000083],
+		[-5.29676358, -0.00381604, 0.00206491, 0.00385790, 0.00000118, 0.00000083],
+		[-5.29950630, -0.00381272, 0.00206367, 0.00385445, 0.00000118, 0.00000083],
+		[-5.30224283, -0.00380940, 0.00206243, 0.00385100, 0.00000117, 0.00000082],
+		[-5.30497319, -0.00380609, 0.00206120, 0.00384755, 0.00000116, 0.00000082],
+		[-5.30769738, -0.00380279, 0.00205996, 0.00384412, 0.00000115, 0.00000081],
+		[-5.31041540, -0.00379948, 0.00205873, 0.00384068, 0.00000114, 0.00000081],
+		[-5.31312727, -0.00379619, 0.00205750, 0.00383726, 0.00000113, 0.00000081],
+		[-5.31583299, -0.00379290, 0.00205627, 0.00383384, 0.00000112, 0.00000080],
+		[-5.31853255, -0.00378961, 0.00205504, 0.00383043, 0.00000111, 0.00000080],
+		[-5.32122598, -0.00378633, 0.00205382, 0.00382702, 0.00000110, 0.00000079],
+		[-5.32391328, -0.00378306, 0.00205259, 0.00382362, 0.00000110, 0.00000079],
+		[-5.32659445, -0.00377979, 0.00205137, 0.00382022, 0.00000109, 0.00000079],
+		[-5.32926950, -0.00377652, 0.00205015, 0.00381683, 0.00000108, 0.00000078],
+		[-5.33193843, -0.00377326, 0.00204893, 0.00381344, 0.00000107, 0.00000078],
+		[-5.33460126, -0.00377000, 0.00204772, 0.00381006, 0.00000106, 0.00000077],
+		[-5.33725798, -0.00376675, 0.00204650, 0.00380669, 0.00000105, 0.00000077],
+		[-5.33990861, -0.00376351, 0.00204529, 0.00380332, 0.00000104, 0.00000077],
+		[-5.34255316, -0.00376027, 0.00204408, 0.00379996, 0.00000103, 0.00000076],
+		[-5.34519162, -0.00375703, 0.00204287, 0.00379660, 0.00000103, 0.00000076],
+		[-5.34782400, -0.00375380, 0.00204166, 0.00379325, 0.00000102, 0.00000075],
+		[-5.35045032, -0.00375058, 0.00204045, 0.00378991, 0.00000101, 0.00000075],
+		[-5.35307057, -0.00374736, 0.00203925, 0.00378657, 0.00000100, 0.00000075],
+		[-5.35568477, -0.00374414, 0.00203804, 0.00378323, 0.00000099, 0.00000074],
+		[-5.35829292, -0.00374093, 0.00203684, 0.00377990, 0.00000098, 0.00000074],
+		[-5.36089503, -0.00373773, 0.00203564, 0.00377658, 0.00000098, 0.00000074],
+		[-5.36349110, -0.00373453, 0.00203444, 0.00377326, 0.00000097, 0.00000073],
+		[-5.36608114, -0.00373133, 0.00203324, 0.00376994, 0.00000096, 0.00000073],
+		[-5.36866517, -0.00372814, 0.00203205, 0.00376664, 0.00000095, 0.00000073],
+		[-5.37124318, -0.00372495, 0.00203085, 0.00376333, 0.00000094, 0.00000072],
+		[-5.37381518, -0.00372177, 0.00202966, 0.00376004, 0.00000094, 0.00000072],
+		[-5.37638118, -0.00371859, 0.00202847, 0.00375674, 0.00000093, 0.00000071],
+		[-5.37894119, -0.00371542, 0.00202728, 0.00375346, 0.00000092, 0.00000071],
+		[-5.38149521, -0.00371225, 0.00202609, 0.00375018, 0.00000091, 0.00000071],
+		[-5.38404325, -0.00370909, 0.00202490, 0.00374690, 0.00000090, 0.00000070],
+		[-5.38658532, -0.00370593, 0.00202371, 0.00374363, 0.00000090, 0.00000070],
+		[-5.38912142, -0.00370278, 0.00202253, 0.00374036, 0.00000089, 0.00000070],
+		[-5.39165157, -0.00369963, 0.00202134, 0.00373710, 0.00000088, 0.00000069],
+		[-5.39417576, -0.00369648, 0.00202016, 0.00373385, 0.00000087, 0.00000069],
+		[-5.39669401, -0.00369334, 0.00201898, 0.00373059, 0.00000087, 0.00000069],
+		[-5.39920633, -0.00369021, 0.00201780, 0.00372735, 0.00000086, 0.00000068],
+		[-5.40171272, -0.00368707, 0.00201662, 0.00372411, 0.00000085, 0.00000068],
+		[-5.40421318, -0.00368395, 0.00201544, 0.00372087, 0.00000084, 0.00000068],
+		[-5.40670773, -0.00368082, 0.00201427, 0.00371764, 0.00000083, 0.00000067],
+		[-5.40919637, -0.00367771, 0.00201309, 0.00371442, 0.00000083, 0.00000067],
+		[-5.41167912, -0.00367459, 0.00201192, 0.00371119, 0.00000082, 0.00000067],
+		[-5.41415597, -0.00367148, 0.00201075, 0.00370798, 0.00000081, 0.00000066],
+		[-5.41662693, -0.00366838, 0.00200957, 0.00370477, 0.00000080, 0.00000066],
+		[-5.41909202, -0.00366528, 0.00200840, 0.00370156, 0.00000080, 0.00000066],
+		[-5.42155124, -0.00366218, 0.00200724, 0.00369836, 0.00000079, 0.00000065],
+		[-5.42400460, -0.00365909, 0.00200607, 0.00369516, 0.00000078, 0.00000065],
+		[-5.42645210, -0.00365600, 0.00200490, 0.00369197, 0.00000077, 0.00000065],
+		[-5.42889376, -0.00365292, 0.00200374, 0.00368879, 0.00000077, 0.00000064],
+		[-5.43132958, -0.00364984, 0.00200257, 0.00368560, 0.00000076, 0.00000064],
+		[-5.43375956, -0.00364677, 0.00200141, 0.00368243, 0.00000075, 0.00000064],
+		[-5.43618372, -0.00364370, 0.00200024, 0.00367926, 0.00000075, 0.00000063],
+		[-5.43860207, -0.00364063, 0.00199908, 0.00367609, 0.00000074, 0.00000063],
+		[-5.44101460, -0.00363757, 0.00199792, 0.00367293, 0.00000073, 0.00000063],
+		[-5.44342134, -0.00363451, 0.00199676, 0.00366977, 0.00000072, 0.00000063],
+		[-5.44582228, -0.00363146, 0.00199561, 0.00366661, 0.00000072, 0.00000062],
+		[-5.44821744, -0.00362841, 0.00199445, 0.00366346, 0.00000071, 0.00000062],
+		[-5.45060682, -0.00362536, 0.00199329, 0.00366032, 0.00000070, 0.00000062],
+		[-5.45299043, -0.00362232, 0.00199214, 0.00365718, 0.00000070, 0.00000061],
+		[-5.45536828, -0.00361929, 0.00199098, 0.00365405, 0.00000069, 0.00000061],
+		[-5.45774037, -0.00361625, 0.00198983, 0.00365092, 0.00000068, 0.00000061],
+		[-5.46010672, -0.00361323, 0.00198868, 0.00364779, 0.00000067, 0.00000060],
+		[-5.46246734, -0.00361020, 0.00198753, 0.00364467, 0.00000067, 0.00000060],
+		[-5.46482222, -0.00360718, 0.00198638, 0.00364155, 0.00000066, 0.00000060],
+		[-5.46717138, -0.00360417, 0.00198523, 0.00363844, 0.00000065, 0.00000060],
+		[-5.46951483, -0.00360115, 0.00198408, 0.00363533, 0.00000065, 0.00000059],
+		[-5.47185257, -0.00359814, 0.00198293, 0.00363223, 0.00000064, 0.00000059],
+		[-5.47418461, -0.00359514, 0.00198178, 0.00362913, 0.00000063, 0.00000059],
+		[-5.47651097, -0.00359214, 0.00198064, 0.00362604, 0.00000063, 0.00000058],
+		[-5.47883164, -0.00358914, 0.00197949, 0.00362295, 0.00000062, 0.00000058],
+		[-5.48114664, -0.00358615, 0.00197835, 0.00361986, 0.00000061, 0.00000058],
+		[-5.48345598, -0.00358316, 0.00197721, 0.00361678, 0.00000061, 0.00000058],
+		[-5.48575966, -0.00358018, 0.00197606, 0.00361370, 0.00000060, 0.00000057],
+		[-5.48805769, -0.00357720, 0.00197492, 0.00361063, 0.00000059, 0.00000057],
+		[-5.49035007, -0.00357422, 0.00197378, 0.00360756, 0.00000059, 0.00000057],
+		[-5.49263683, -0.00357125, 0.00197264, 0.00360450, 0.00000058, 0.00000056],
+		[-5.49491797, -0.00356828, 0.00197150, 0.00360144, 0.00000057, 0.00000056],
+		[-5.49719348, -0.00356532, 0.00197036, 0.00359839, 0.00000057, 0.00000056],
+		[-5.49946339, -0.00356236, 0.00196923, 0.00359534, 0.00000056, 0.00000056],
+		[-5.50172771, -0.00355940, 0.00196809, 0.00359229, 0.00000056, 0.00000055],
+		[-5.50398643, -0.00355645, 0.00196695, 0.00358925, 0.00000055, 0.00000055],
+		[-5.50623957, -0.00355350, 0.00196582, 0.00358621, 0.00000054, 0.00000055],
+		[-5.50848713, -0.00355055, 0.00196468, 0.00358318, 0.00000054, 0.00000054],
+		[-5.51072913, -0.00354761, 0.00196355, 0.00358015, 0.00000053, 0.00000054],
+		[-5.51296557, -0.00354467, 0.00196242, 0.00357712, 0.00000052, 0.00000054],
+		[-5.51519647, -0.00354174, 0.00196129, 0.00357410, 0.00000052, 0.00000054],
+		[-5.51742182, -0.00353881, 0.00196016, 0.00357108, 0.00000051, 0.00000053],
+		[-5.51964164, -0.00353588, 0.00195902, 0.00356807, 0.00000050, 0.00000053],
+		[-5.52185594, -0.00353296, 0.00195789, 0.00356506, 0.00000050, 0.00000053],
+		[-5.52406473, -0.00353004, 0.00195677, 0.00356206, 0.00000049, 0.00000053],
+		[-5.52626800, -0.00352712, 0.00195564, 0.00355906, 0.00000049, 0.00000052],
+		[-5.52846578, -0.00352421, 0.00195451, 0.00355606, 0.00000048, 0.00000052],
+		[-5.53065808, -0.00352130, 0.00195338, 0.00355307, 0.00000047, 0.00000052],
+		[-5.53284489, -0.00351840, 0.00195226, 0.00355008, 0.00000047, 0.00000052],
+		[-5.53502623, -0.00351550, 0.00195113, 0.00354710, 0.00000046, 0.00000051],
+		[-5.53720210, -0.00351260, 0.00195001, 0.00354412, 0.00000046, 0.00000051],
+		[-5.53937252, -0.00350971, 0.00194888, 0.00354114, 0.00000045, 0.00000051],
+		[-5.54153750, -0.00350682, 0.00194776, 0.00353817, 0.00000044, 0.00000051],
+		[-5.54369704, -0.00350393, 0.00194663, 0.00353520, 0.00000044, 0.00000050],
+		[-5.54585115, -0.00350105, 0.00194551, 0.00353224, 0.00000043, 0.00000050],
+		[-5.54799984, -0.00349817, 0.00194439, 0.00352928, 0.00000043, 0.00000050],
+		[-5.55014311, -0.00349529, 0.00194327, 0.00352632, 0.00000042, 0.00000050],
+		[-5.55228099, -0.00349242, 0.00194215, 0.00352337, 0.00000041, 0.00000049],
+		[-5.55441347, -0.00348955, 0.00194103, 0.00352042, 0.00000041, 0.00000049],
+		[-5.55654057, -0.00348669, 0.00193991, 0.00351748, 0.00000040, 0.00000049],
+		[-5.55866229, -0.00348383, 0.00193879, 0.00351454, 0.00000040, 0.00000049],
+		[-5.56077864, -0.00348097, 0.00193767, 0.00351160, 0.00000039, 0.00000048],
+		[-5.56288964, -0.00347811, 0.00193655, 0.00350867, 0.00000039, 0.00000048],
+		[-5.56499528, -0.00347526, 0.00193544, 0.00350574, 0.00000038, 0.00000048],
+		[-5.56709558, -0.00347242, 0.00193432, 0.00350282, 0.00000037, 0.00000048],
+		[-5.56919055, -0.00346957, 0.00193321, 0.00349990, 0.00000037, 0.00000047],
+		[-5.57128020, -0.00346673, 0.00193209, 0.00349698, 0.00000036, 0.00000047],
+		[-5.57336453, -0.00346390, 0.00193098, 0.00349407, 0.00000036, 0.00000047],
+		[-5.57544356, -0.00346106, 0.00192986, 0.00349116, 0.00000035, 0.00000047],
+		[-5.57751729, -0.00345823, 0.00192875, 0.00348825, 0.00000035, 0.00000047],
+		[-5.57958573, -0.00345541, 0.00192764, 0.00348535, 0.00000034, 0.00000046],
+		[-5.58164889, -0.00345259, 0.00192652, 0.00348245, 0.00000033, 0.00000046],
+		[-5.58370679, -0.00344977, 0.00192541, 0.00347956, 0.00000033, 0.00000046],
+		[-5.58575942, -0.00344695, 0.00192430, 0.00347667, 0.00000032, 0.00000046],
+		[-5.58780679, -0.00344414, 0.00192319, 0.00347378, 0.00000032, 0.00000045],
+		[-5.58984893, -0.00344133, 0.00192208, 0.00347090, 0.00000031, 0.00000045],
+		[-5.59188583, -0.00343852, 0.00192097, 0.00346802, 0.00000031, 0.00000045],
+		[-5.59391750, -0.00343572, 0.00191986, 0.00346515, 0.00000030, 0.00000045],
+		[-5.59594396, -0.00343292, 0.00191875, 0.00346228, 0.00000030, 0.00000045],
+		[-5.59796521, -0.00343013, 0.00191764, 0.00345941, 0.00000029, 0.00000044],
+		[-5.59998126, -0.00342733, 0.00191653, 0.00345654, 0.00000029, 0.00000044],
+		[-5.60199212, -0.00342455, 0.00191543, 0.00345368, 0.00000028, 0.00000044],
+		[-5.60399781, -0.00342176, 0.00191432, 0.00345083, 0.00000028, 0.00000044],
+		[-5.60599831, -0.00341898, 0.00191321, 0.00344797, 0.00000027, 0.00000043],
+		[-5.60799366, -0.00341620, 0.00191211, 0.00344513, 0.00000026, 0.00000043],
+		[-5.60998385, -0.00341342, 0.00191100, 0.00344228, 0.00000026, 0.00000043],
+		[-5.61196890, -0.00341065, 0.00190990, 0.00343944, 0.00000025, 0.00000043],
+		[-5.61394881, -0.00340788, 0.00190879, 0.00343660, 0.00000025, 0.00000043],
+		[-5.61592360, -0.00340512, 0.00190769, 0.00343376, 0.00000024, 0.00000042],
+		[-5.61789327, -0.00340235, 0.00190659, 0.00343093, 0.00000024, 0.00000042],
+		[-5.61985783, -0.00339960, 0.00190548, 0.00342811, 0.00000023, 0.00000042],
+		[-5.62181729, -0.00339684, 0.00190438, 0.00342528, 0.00000023, 0.00000042],
+		[-5.62377166, -0.00339409, 0.00190328, 0.00342246, 0.00000022, 0.00000042],
+		[-5.62572095, -0.00339134, 0.00190218, 0.00341964, 0.00000022, 0.00000041],
+		[-5.62766517, -0.00338859, 0.00190108, 0.00341683, 0.00000021, 0.00000041],
+		[-5.62960432, -0.00338585, 0.00189998, 0.00341402, 0.00000021, 0.00000041],
+		[-5.63153842, -0.00338311, 0.00189888, 0.00341122, 0.00000020, 0.00000041],
+		[-5.63346748, -0.00338037, 0.00189778, 0.00340841, 0.00000020, 0.00000041],
+		[-5.63539150, -0.00337764, 0.00189668, 0.00340561, 0.00000019, 0.00000040],
+		[-5.63731050, -0.00337491, 0.00189558, 0.00340282, 0.00000019, 0.00000040],
+		[-5.63922447, -0.00337218, 0.00189448, 0.00340003, 0.00000018, 0.00000040],
+		[-5.64113344, -0.00336946, 0.00189338, 0.00339724, 0.00000018, 0.00000040],
+		[-5.64303741, -0.00336674, 0.00189229, 0.00339445, 0.00000017, 0.00000040],
+		[-5.64493639, -0.00336402, 0.00189119, 0.00339167, 0.00000017, 0.00000039],
+		[-5.64683039, -0.00336131, 0.00189009, 0.00338889, 0.00000016, 0.00000039],
+		[-5.64871942, -0.00335860, 0.00188899, 0.00338612, 0.00000016, 0.00000039],
+		[-5.65060348, -0.00335589, 0.00188790, 0.00338335, 0.00000015, 0.00000039],
+		[-5.65248259, -0.00335319, 0.00188680, 0.00338058, 0.00000015, 0.00000039],
+		[-5.65435676, -0.00335049, 0.00188571, 0.00337781, 0.00000014, 0.00000038],
+		[-5.65622600, -0.00334779, 0.00188461, 0.00337505, 0.00000014, 0.00000038],
+		[-5.65809030, -0.00334509, 0.00188352, 0.00337229, 0.00000013, 0.00000038],
+		[-5.65994970, -0.00334240, 0.00188243, 0.00336954, 0.00000013, 0.00000038],
+		[-5.66180418, -0.00333971, 0.00188133, 0.00336679, 0.00000013, 0.00000038],
+		[-5.66365377, -0.00333703, 0.00188024, 0.00336404, 0.00000012, 0.00000038],
+		[-5.66549846, -0.00333434, 0.00187915, 0.00336130, 0.00000012, 0.00000037],
+		[-5.66733828, -0.00333166, 0.00187805, 0.00335856, 0.00000011, 0.00000037],
+		[-5.66917323, -0.00332899, 0.00187696, 0.00335582, 0.00000011, 0.00000037],
+		[-5.67100331, -0.00332631, 0.00187587, 0.00335309, 0.00000010, 0.00000037],
+		[-5.67282855, -0.00332364, 0.00187478, 0.00335035, 0.00000010, 0.00000037],
+		[-5.67464894, -0.00332098, 0.00187369, 0.00334763, 0.00000009, 0.00000036],
+		[-5.67646450, -0.00331831, 0.00187260, 0.00334490, 0.00000009, 0.00000036],
+		[-5.67827523, -0.00331565, 0.00187151, 0.00334218, 0.00000008, 0.00000036],
+		[-5.68008115, -0.00331299, 0.00187042, 0.00333947, 0.00000008, 0.00000036],
+		[-5.68188226, -0.00331034, 0.00186933, 0.00333675, 0.00000007, 0.00000036],
+		[-5.68367858, -0.00330769, 0.00186824, 0.00333404, 0.00000007, 0.00000036],
+		[-5.68547011, -0.00330504, 0.00186715, 0.00333133, 0.00000007, 0.00000035],
+		[-5.68725686, -0.00330239, 0.00186606, 0.00332863, 0.00000006, 0.00000035],
+		[-5.68903884, -0.00329975, 0.00186498, 0.00332593, 0.00000006, 0.00000035],
+		[-5.69081606, -0.00329711, 0.00186389, 0.00332323, 0.00000005, 0.00000035],
+		[-5.69258853, -0.00329447, 0.00186280, 0.00332054, 0.00000005, 0.00000035],
+		[-5.69435627, -0.00329184, 0.00186172, 0.00331785, 0.00000004, 0.00000035],
+		[-5.69611926, -0.00328921, 0.00186063, 0.00331516, 0.00000004, 0.00000034],
+		[-5.69787754, -0.00328658, 0.00185954, 0.00331247, 0.00000003, 0.00000034],
+		[-5.69963110, -0.00328396, 0.00185846, 0.00330979, 0.00000003, 0.00000034],
+		[-5.70137996, -0.00328133, 0.00185737, 0.00330711, 0.00000003, 0.00000034],
+		[-5.70312413, -0.00327872, 0.00185629, 0.00330444, 0.00000002, 0.00000034],
+		[-5.70486360, -0.00327610, 0.00185520, 0.00330177, 0.00000002, 0.00000034],
+		[-5.70659840, -0.00327349, 0.00185412, 0.00329910, 0.00000001, 0.00000033],
+		[-5.70832854, -0.00327088, 0.00185304, 0.00329643, 0.00000001, 0.00000033],
+		[-5.71005402, -0.00326827, 0.00185195, 0.00329377, 0.00000000, 0.00000033],
+		[-5.71177484, -0.00326567, 0.00185087, 0.00329111, 0.00000000, 0.00000033],
+		[-5.71349103, -0.00326306, 0.00184979, 0.00328846, -0.00000000, 0.00000033],
+		[-5.71520259, -0.00326047, 0.00184870, 0.00328580, -0.00000001, 0.00000033],
+		[-5.71690953, -0.00325787, 0.00184762, 0.00328316, -0.00000001, 0.00000032],
+		[-5.71861185, -0.00325528, 0.00184654, 0.00328051, -0.00000002, 0.00000032],
+		[-5.72030958, -0.00325269, 0.00184546, 0.00327787, -0.00000002, 0.00000032],
+		[-5.72200271, -0.00325010, 0.00184438, 0.00327523, -0.00000002, 0.00000032],
+		[-5.72369126, -0.00324752, 0.00184330, 0.00327259, -0.00000003, 0.00000032],
+		[-5.72537523, -0.00324494, 0.00184222, 0.00326996, -0.00000003, 0.00000032],
+		[-5.72705463, -0.00324236, 0.00184114, 0.00326733, -0.00000004, 0.00000032],
+		[-5.72872948, -0.00323979, 0.00184006, 0.00326470, -0.00000004, 0.00000031],
+		[-5.73039979, -0.00323721, 0.00183898, 0.00326207, -0.00000005, 0.00000031],
+		[-5.73206555, -0.00323464, 0.00183790, 0.00325945, -0.00000005, 0.00000031],
+		[-5.73372679, -0.00323208, 0.00183682, 0.00325683, -0.00000005, 0.00000031],
+		[-5.73538351, -0.00322952, 0.00183574, 0.00325422, -0.00000006, 0.00000031],
+		[-5.73703572, -0.00322695, 0.00183466, 0.00325161, -0.00000006, 0.00000031],
+		[-5.73868343, -0.00322440, 0.00183359, 0.00324900, -0.00000007, 0.00000030],
+		[-5.74032664, -0.00322184, 0.00183251, 0.00324639, -0.00000007, 0.00000030],
+		[-5.74196538, -0.00321929, 0.00183143, 0.00324379, -0.00000007, 0.00000030],
+		[-5.74359964, -0.00321674, 0.00183036, 0.00324119, -0.00000008, 0.00000030],
+		[-5.74522943, -0.00321419, 0.00182928, 0.00323859, -0.00000008, 0.00000030],
+		[-5.74685478, -0.00321165, 0.00182820, 0.00323600, -0.00000009, 0.00000030],
+		[-5.74847567, -0.00320911, 0.00182713, 0.00323341, -0.00000009, 0.00000030],
+		[-5.75009213, -0.00320657, 0.00182605, 0.00323082, -0.00000009, 0.00000029],
+		[-5.75170417, -0.00320404, 0.00182498, 0.00322824, -0.00000010, 0.00000029],
+		[-5.75331179, -0.00320151, 0.00182390, 0.00322566, -0.00000010, 0.00000029],
+		[-5.75491499, -0.00319898, 0.00182283, 0.00322308, -0.00000010, 0.00000029],
+		[-5.75651380, -0.00319645, 0.00182176, 0.00322050, -0.00000011, 0.00000029],
+		[-5.75810822, -0.00319393, 0.00182068, 0.00321793, -0.00000011, 0.00000029],
+		[-5.75969826, -0.00319141, 0.00181961, 0.00321536, -0.00000012, 0.00000029],
+		[-5.76128392, -0.00318889, 0.00181854, 0.00321280, -0.00000012, 0.00000028],
+		[-5.76286523, -0.00318637, 0.00181746, 0.00321023, -0.00000012, 0.00000028],
+		[-5.76444218, -0.00318386, 0.00181639, 0.00320767, -0.00000013, 0.00000028],
+		[-5.76601479, -0.00318135, 0.00181532, 0.00320512, -0.00000013, 0.00000028],
+		[-5.76758306, -0.00317884, 0.00181425, 0.00320256, -0.00000013, 0.00000028],
+		[-5.76914700, -0.00317634, 0.00181318, 0.00320001, -0.00000014, 0.00000028],
+		[-5.77070663, -0.00317384, 0.00181210, 0.00319746, -0.00000014, 0.00000028],
+		[-5.77226195, -0.00317134, 0.00181103, 0.00319492, -0.00000015, 0.00000028],
+		[-5.77381298, -0.00316884, 0.00180996, 0.00319237, -0.00000015, 0.00000027],
+		[-5.77535971, -0.00316635, 0.00180889, 0.00318984, -0.00000015, 0.00000027],
+		[-5.77690216, -0.00316386, 0.00180782, 0.00318730, -0.00000016, 0.00000027],
+		[-5.77844035, -0.00316137, 0.00180675, 0.00318477, -0.00000016, 0.00000027],
+		[-5.77997427, -0.00315889, 0.00180569, 0.00318223, -0.00000016, 0.00000027],
+		[-5.78150394, -0.00315640, 0.00180462, 0.00317971, -0.00000017, 0.00000027],
+		[-5.78302936, -0.00315393, 0.00180355, 0.00317718, -0.00000017, 0.00000027],
+		[-5.78455056, -0.00315145, 0.00180248, 0.00317466, -0.00000017, 0.00000026],
+		[-5.78606752, -0.00314897, 0.00180141, 0.00317214, -0.00000018, 0.00000026],
+		[-5.78758027, -0.00314650, 0.00180035, 0.00316963, -0.00000018, 0.00000026],
+		[-5.78908882, -0.00314403, 0.00179928, 0.00316711, -0.00000019, 0.00000026],
+		[-5.79059316, -0.00314157, 0.00179821, 0.00316460, -0.00000019, 0.00000026],
+		[-5.79209332, -0.00313911, 0.00179715, 0.00316209, -0.00000019, 0.00000026],
+		[-5.79358930, -0.00313665, 0.00179608, 0.00315959, -0.00000020, 0.00000026],
+		[-5.79508110, -0.00313419, 0.00179501, 0.00315709, -0.00000020, 0.00000026],
+		[-5.79656875, -0.00313173, 0.00179395, 0.00315459, -0.00000020, 0.00000025],
+		[-5.79805224, -0.00312928, 0.00179288, 0.00315209, -0.00000021, 0.00000025],
+		[-5.79953159, -0.00312683, 0.00179182, 0.00314960, -0.00000021, 0.00000025],
+		[-5.80100681, -0.00312438, 0.00179075, 0.00314711, -0.00000021, 0.00000025],
+		[-5.80247790, -0.00312194, 0.00178969, 0.00314462, -0.00000022, 0.00000025],
+		[-5.80394487, -0.00311950, 0.00178863, 0.00314214, -0.00000022, 0.00000025],
+		[-5.80540774, -0.00311706, 0.00178756, 0.00313966, -0.00000022, 0.00000025],
+		[-5.80686651, -0.00311462, 0.00178650, 0.00313718, -0.00000023, 0.00000025],
+		[-5.80832119, -0.00311219, 0.00178544, 0.00313470, -0.00000023, 0.00000024],
+		[-5.80977179, -0.00310976, 0.00178438, 0.00313223, -0.00000023, 0.00000024],
+		[-5.81121832, -0.00310733, 0.00178331, 0.00312976, -0.00000024, 0.00000024],
+		[-5.81266079, -0.00310490, 0.00178225, 0.00312729, -0.00000024, 0.00000024],
+		[-5.81409921, -0.00310248, 0.00178119, 0.00312483, -0.00000024, 0.00000024],
+		[-5.81553358, -0.00310006, 0.00178013, 0.00312237, -0.00000025, 0.00000024],
+		[-5.81696392, -0.00309764, 0.00177907, 0.00311991, -0.00000025, 0.00000024],
+		[-5.81839023, -0.00309523, 0.00177801, 0.00311745, -0.00000025, 0.00000024],
+		[-5.81981252, -0.00309282, 0.00177695, 0.00311500, -0.00000026, 0.00000024],
+		[-5.82123081, -0.00309041, 0.00177589, 0.00311255, -0.00000026, 0.00000023],
+		[-5.82264509, -0.00308800, 0.00177483, 0.00311010, -0.00000026, 0.00000023],
+		[-5.82405539, -0.00308560, 0.00177377, 0.00310766, -0.00000027, 0.00000023],
+		[-5.82546171, -0.00308319, 0.00177271, 0.00310521, -0.00000027, 0.00000023],
+		[-5.82686405, -0.00308079, 0.00177165, 0.00310277, -0.00000027, 0.00000023],
+		[-5.82826243, -0.00307840, 0.00177059, 0.00310034, -0.00000028, 0.00000023],
+		[-5.82965686, -0.00307600, 0.00176954, 0.00309790, -0.00000028, 0.00000023],
+		[-5.83104734, -0.00307361, 0.00176848, 0.00309547, -0.00000028, 0.00000023],
+		[-5.83243389, -0.00307122, 0.00176742, 0.00309305, -0.00000029, 0.00000023],
+		[-5.83381650, -0.00306884, 0.00176637, 0.00309062, -0.00000029, 0.00000022],
+		[-5.83519520, -0.00306645, 0.00176531, 0.00308820, -0.00000029, 0.00000022],
+		[-5.83656999, -0.00306407, 0.00176425, 0.00308578, -0.00000030, 0.00000022],
+		[-5.83794088, -0.00306169, 0.00176320, 0.00308336, -0.00000030, 0.00000022],
+		[-5.83930788, -0.00305932, 0.00176214, 0.00308095, -0.00000030, 0.00000022],
+		[-5.84067099, -0.00305695, 0.00176109, 0.00307853, -0.00000031, 0.00000022],
+		[-5.84203023, -0.00305458, 0.00176003, 0.00307612, -0.00000031, 0.00000022],
+		[-5.84338560, -0.00305221, 0.00175898, 0.00307372, -0.00000031, 0.00000022],
+		[-5.84473712, -0.00304984, 0.00175793, 0.00307132, -0.00000031, 0.00000022],
+		[-5.84608479, -0.00304748, 0.00175687, 0.00306891, -0.00000032, 0.00000022],
+		[-5.84742862, -0.00304512, 0.00175582, 0.00306652, -0.00000032, 0.00000021],
+		[-5.84876862, -0.00304276, 0.00175477, 0.00306412, -0.00000032, 0.00000021],
+		[-5.85010480, -0.00304041, 0.00175371, 0.00306173, -0.00000033, 0.00000021],
+		[-5.85143717, -0.00303805, 0.00175266, 0.00305934, -0.00000033, 0.00000021],
+		[-5.85276573, -0.00303570, 0.00175161, 0.00305695, -0.00000033, 0.00000021],
+		[-5.85409050, -0.00303336, 0.00175056, 0.00305457, -0.00000034, 0.00000021],
+		[-5.85541148, -0.00303101, 0.00174951, 0.00305218, -0.00000034, 0.00000021],
+		[-5.85672868, -0.00302867, 0.00174846, 0.00304981, -0.00000034, 0.00000021],
+		[-5.85804212, -0.00302633, 0.00174741, 0.00304743, -0.00000034, 0.00000021],
+		[-5.85935180, -0.00302399, 0.00174636, 0.00304506, -0.00000035, 0.00000020],
+		[-5.86065772, -0.00302166, 0.00174531, 0.00304268, -0.00000035, 0.00000020],
+		[-5.86195991, -0.00301932, 0.00174426, 0.00304032, -0.00000035, 0.00000020],
+		[-5.86325835, -0.00301699, 0.00174321, 0.00303795, -0.00000036, 0.00000020],
+		[-5.86455308, -0.00301467, 0.00174216, 0.00303559, -0.00000036, 0.00000020],
+		[-5.86584409, -0.00301234, 0.00174111, 0.00303323, -0.00000036, 0.00000020],
+		[-5.86713139, -0.00301002, 0.00174006, 0.00303087, -0.00000037, 0.00000020],
+		[-5.86841499, -0.00300770, 0.00173902, 0.00302851, -0.00000037, 0.00000020],
+		[-5.86969490, -0.00300538, 0.00173797, 0.00302616, -0.00000037, 0.00000020],
+		[-5.87097113, -0.00300307, 0.00173692, 0.00302381, -0.00000037, 0.00000020],
+		[-5.87224368, -0.00300076, 0.00173588, 0.00302146, -0.00000038, 0.00000020],
+		[-5.87351257, -0.00299845, 0.00173483, 0.00301912, -0.00000038, 0.00000019],
+		[-5.87477781, -0.00299614, 0.00173378, 0.00301678, -0.00000038, 0.00000019],
+		[-5.87603940, -0.00299383, 0.00173274, 0.00301444, -0.00000039, 0.00000019],
+		[-5.87729735, -0.00299153, 0.00173169, 0.00301210, -0.00000039, 0.00000019],
+		[-5.87855167, -0.00298923, 0.00173065, 0.00300977, -0.00000039, 0.00000019],
+		[-5.87980237, -0.00298694, 0.00172961, 0.00300744, -0.00000039, 0.00000019],
+		[-5.88104946, -0.00298464, 0.00172856, 0.00300511, -0.00000040, 0.00000019],
+		[-5.88229294, -0.00298235, 0.00172752, 0.00300278, -0.00000040, 0.00000019],
+		[-5.88353283, -0.00298006, 0.00172648, 0.00300046, -0.00000040, 0.00000019],
+		[-5.88476913, -0.00297777, 0.00172543, 0.00299814, -0.00000040, 0.00000019],
+		[-5.88600185, -0.00297549, 0.00172439, 0.00299582, -0.00000041, 0.00000019],
+		[-5.88723100, -0.00297320, 0.00172335, 0.00299350, -0.00000041, 0.00000018],
+		[-5.88845659, -0.00297093, 0.00172231, 0.00299119, -0.00000041, 0.00000018],
+		[-5.88967862, -0.00296865, 0.00172127, 0.00298888, -0.00000042, 0.00000018],
+		[-5.89089712, -0.00296637, 0.00172022, 0.00298657, -0.00000042, 0.00000018],
+		[-5.89211207, -0.00296410, 0.00171918, 0.00298427, -0.00000042, 0.00000018],
+		[-5.89332350, -0.00296183, 0.00171814, 0.00298196, -0.00000042, 0.00000018],
+		[-5.89453141, -0.00295956, 0.00171710, 0.00297966, -0.00000043, 0.00000018],
+		[-5.89573581, -0.00295730, 0.00171607, 0.00297737, -0.00000043, 0.00000018],
+		[-5.89693670, -0.00295504, 0.00171503, 0.00297507, -0.00000043, 0.00000018],
+		[-5.89813411, -0.00295278, 0.00171399, 0.00297278, -0.00000043, 0.00000018],
+		[-5.89932802, -0.00295052, 0.00171295, 0.00297049, -0.00000044, 0.00000018],
+		[-5.90051846, -0.00294826, 0.00171191, 0.00296820, -0.00000044, 0.00000017],
+		[-5.90170544, -0.00294601, 0.00171088, 0.00296592, -0.00000044, 0.00000017],
+		[-5.90288895, -0.00294376, 0.00170984, 0.00296363, -0.00000045, 0.00000017],
+		[-5.90406901, -0.00294151, 0.00170880, 0.00296136, -0.00000045, 0.00000017],
+		[-5.90524562, -0.00293927, 0.00170777, 0.00295908, -0.00000045, 0.00000017],
+		[-5.90641881, -0.00293702, 0.00170673, 0.00295680, -0.00000045, 0.00000017],
+		[-5.90758856, -0.00293478, 0.00170569, 0.00295453, -0.00000046, 0.00000017],
+		[-5.90875490, -0.00293254, 0.00170466, 0.00295226, -0.00000046, 0.00000017],
+		[-5.90991782, -0.00293031, 0.00170363, 0.00295000, -0.00000046, 0.00000017],
+		[-5.91107735, -0.00292807, 0.00170259, 0.00294773, -0.00000046, 0.00000017],
+		[-5.91223348, -0.00292584, 0.00170156, 0.00294547, -0.00000047, 0.00000017],
+		[-5.91338622, -0.00292362, 0.00170052, 0.00294321, -0.00000047, 0.00000017],
+		[-5.91453559, -0.00292139, 0.00169949, 0.00294095, -0.00000047, 0.00000016],
+		[-5.91568159, -0.00291917, 0.00169846, 0.00293870, -0.00000047, 0.00000016],
+		[-5.91682423, -0.00291694, 0.00169743, 0.00293645, -0.00000048, 0.00000016],
+		[-5.91796352, -0.00291472, 0.00169639, 0.00293420, -0.00000048, 0.00000016],
+		[-5.91909946, -0.00291251, 0.00169536, 0.00293195, -0.00000048, 0.00000016],
+		[-5.92023207, -0.00291029, 0.00169433, 0.00292971, -0.00000048, 0.00000016],
+		[-5.92136135, -0.00290808, 0.00169330, 0.00292746, -0.00000049, 0.00000016],
+		[-5.92248731, -0.00290587, 0.00169227, 0.00292523, -0.00000049, 0.00000016],
+		[-5.92360996, -0.00290367, 0.00169124, 0.00292299, -0.00000049, 0.00000016],
+		[-5.92472930, -0.00290146, 0.00169021, 0.00292075, -0.00000049, 0.00000016],
+		[-5.92584536, -0.00289926, 0.00168918, 0.00291852, -0.00000050, 0.00000016],
+		[-5.92695812, -0.00289706, 0.00168816, 0.00291629, -0.00000050, 0.00000016],
+		[-5.92806761, -0.00289486, 0.00168713, 0.00291407, -0.00000050, 0.00000016],
+		[-5.92917382, -0.00289267, 0.00168610, 0.00291184, -0.00000050, 0.00000015],
+		[-5.93027677, -0.00289047, 0.00168507, 0.00290962, -0.00000051, 0.00000015],
+		[-5.93137647, -0.00288828, 0.00168405, 0.00290740, -0.00000051, 0.00000015],
+		[-5.93247293, -0.00288610, 0.00168302, 0.00290518, -0.00000051, 0.00000015],
+		[-5.93356614, -0.00288391, 0.00168199, 0.00290297, -0.00000051, 0.00000015],
+		[-5.93465613, -0.00288173, 0.00168097, 0.00290076, -0.00000051, 0.00000015],
+		[-5.93574289, -0.00287955, 0.00167994, 0.00289855, -0.00000052, 0.00000015],
+		[-5.93682644, -0.00287737, 0.00167892, 0.00289634, -0.00000052, 0.00000015],
+		[-5.93790678, -0.00287519, 0.00167789, 0.00289414, -0.00000052, 0.00000015],
+		[-5.93898392, -0.00287302, 0.00167687, 0.00289193, -0.00000052, 0.00000015],
+		[-5.94005788, -0.00287085, 0.00167585, 0.00288973, -0.00000053, 0.00000015],
+		[-5.94112865, -0.00286868, 0.00167482, 0.00288754, -0.00000053, 0.00000015],
+		[-5.94219625, -0.00286651, 0.00167380, 0.00288534, -0.00000053, 0.00000015],
+		[-5.94326068, -0.00286435, 0.00167278, 0.00288315, -0.00000053, 0.00000015],
+		[-5.94432196, -0.00286218, 0.00167176, 0.00288096, -0.00000054, 0.00000014],
+		[-5.94538008, -0.00286002, 0.00167074, 0.00287877, -0.00000054, 0.00000014],
+		[-5.94643506, -0.00285787, 0.00166971, 0.00287659, -0.00000054, 0.00000014],
+		[-5.94748691, -0.00285571, 0.00166869, 0.00287441, -0.00000054, 0.00000014],
+		[-5.94853563, -0.00285356, 0.00166767, 0.00287222, -0.00000055, 0.00000014],
+		[-5.94958124, -0.00285141, 0.00166666, 0.00287005, -0.00000055, 0.00000014],
+		[-5.95062373, -0.00284926, 0.00166564, 0.00286787, -0.00000055, 0.00000014],
+		[-5.95166312, -0.00284711, 0.00166462, 0.00286570, -0.00000055, 0.00000014],
+		[-5.95269941, -0.00284497, 0.00166360, 0.00286353, -0.00000055, 0.00000014],
+		[-5.95373262, -0.00284283, 0.00166258, 0.00286136, -0.00000056, 0.00000014],
+		[-5.95476275, -0.00284069, 0.00166156, 0.00285919, -0.00000056, 0.00000014],
+		[-5.95578980, -0.00283855, 0.00166055, 0.00285703, -0.00000056, 0.00000014],
+		[-5.95681380, -0.00283642, 0.00165953, 0.00285487, -0.00000056, 0.00000014],
+		[-5.95783474, -0.00283429, 0.00165852, 0.00285271, -0.00000057, 0.00000014],
+		[-5.95885262, -0.00283216, 0.00165750, 0.00285056, -0.00000057, 0.00000014],
+		[-5.95986747, -0.00283003, 0.00165648, 0.00284840, -0.00000057, 0.00000013],
+		[-5.96087929, -0.00282791, 0.00165547, 0.00284625, -0.00000057, 0.00000013],
+		[-5.96188808, -0.00282578, 0.00165446, 0.00284410, -0.00000057, 0.00000013],
+		[-5.96289385, -0.00282366, 0.00165344, 0.00284196, -0.00000058, 0.00000013],
+		[-5.96389662, -0.00282154, 0.00165243, 0.00283981, -0.00000058, 0.00000013],
+		[-5.96489638, -0.00281943, 0.00165142, 0.00283767, -0.00000058, 0.00000013],
+		[-5.96589315, -0.00281732, 0.00165040, 0.00283553, -0.00000058, 0.00000013],
+		[-5.96688693, -0.00281520, 0.00164939, 0.00283339, -0.00000058, 0.00000013],
+		[-5.96787774, -0.00281310, 0.00164838, 0.00283126, -0.00000059, 0.00000013],
+		[-5.96886557, -0.00281099, 0.00164737, 0.00282913, -0.00000059, 0.00000013],
+		[-5.96985044, -0.00280888, 0.00164636, 0.00282700, -0.00000059, 0.00000013],
+		[-5.97083235, -0.00280678, 0.00164535, 0.00282487, -0.00000059, 0.00000013],
+		[-5.97181132, -0.00280468, 0.00164434, 0.00282274, -0.00000060, 0.00000013],
+		[-5.97278734, -0.00280258, 0.00164333, 0.00282062, -0.00000060, 0.00000013],
+		[-5.97376044, -0.00280049, 0.00164232, 0.00281850, -0.00000060, 0.00000013],
+		[-5.97473060, -0.00279840, 0.00164131, 0.00281638, -0.00000060, 0.00000013],
+		[-5.97569785, -0.00279631, 0.00164031, 0.00281427, -0.00000060, 0.00000012],
+		[-5.97666219, -0.00279422, 0.00163930, 0.00281215, -0.00000061, 0.00000012],
+		[-5.97762362, -0.00279213, 0.00163829, 0.00281004, -0.00000061, 0.00000012],
+		[-5.97858216, -0.00279005, 0.00163729, 0.00280793, -0.00000061, 0.00000012],
+		[-5.97953782, -0.00278796, 0.00163628, 0.00280583, -0.00000061, 0.00000012],
+		[-5.98049059, -0.00278589, 0.00163527, 0.00280372, -0.00000061, 0.00000012],
+		[-5.98144049, -0.00278381, 0.00163427, 0.00280162, -0.00000062, 0.00000012],
+		[-5.98238752, -0.00278173, 0.00163326, 0.00279952, -0.00000062, 0.00000012],
+		[-5.98333170, -0.00277966, 0.00163226, 0.00279742, -0.00000062, 0.00000012],
+		[-5.98427302, -0.00277759, 0.00163126, 0.00279533, -0.00000062, 0.00000012],
+		[-5.98521150, -0.00277552, 0.00163025, 0.00279324, -0.00000062, 0.00000012],
+		[-5.98614715, -0.00277346, 0.00162925, 0.00279115, -0.00000063, 0.00000012],
+		[-5.98707997, -0.00277139, 0.00162825, 0.00278906, -0.00000063, 0.00000012],
+		[-5.98800996, -0.00276933, 0.00162725, 0.00278697, -0.00000063, 0.00000012],
+		[-5.98893715, -0.00276727, 0.00162625, 0.00278489, -0.00000063, 0.00000012],
+		[-5.98986153, -0.00276521, 0.00162525, 0.00278281, -0.00000063, 0.00000012],
+		[-5.99078310, -0.00276316, 0.00162425, 0.00278073, -0.00000064, 0.00000012],
+		[-5.99170189, -0.00276111, 0.00162325, 0.00277865, -0.00000064, 0.00000012],
+		[-5.99261789, -0.00275906, 0.00162225, 0.00277658, -0.00000064, 0.00000011],
+		[-5.99353112, -0.00275701, 0.00162125, 0.00277451, -0.00000064, 0.00000011],
+		[-5.99444158, -0.00275496, 0.00162025, 0.00277244, -0.00000064, 0.00000011],
+		[-5.99534927, -0.00275292, 0.00161925, 0.00277037, -0.00000065, 0.00000011],
+		[-5.99625421, -0.00275088, 0.00161826, 0.00276831, -0.00000065, 0.00000011],
+		[-5.99715640, -0.00274884, 0.00161726, 0.00276624, -0.00000065, 0.00000011],
+		[-5.99805585, -0.00274680, 0.00161626, 0.00276418, -0.00000065, 0.00000011],
+		[-5.99895257, -0.00274476, 0.00161527, 0.00276213, -0.00000065, 0.00000011],
+		[-5.99984656, -0.00274273, 0.00161427, 0.00276007, -0.00000066, 0.00000011],
+		[-6.00073784, -0.00274070, 0.00161328, 0.00275802, -0.00000066, 0.00000011],
+		[-6.00162640, -0.00273867, 0.00161228, 0.00275597, -0.00000066, 0.00000011],
+		[-6.00251225, -0.00273665, 0.00161129, 0.00275392, -0.00000066, 0.00000011],
+		[-6.00339541, -0.00273462, 0.00161030, 0.00275187, -0.00000066, 0.00000011],
+		[-6.00427588, -0.00273260, 0.00160931, 0.00274983, -0.00000066, 0.00000011],
+		[-6.00515367, -0.00273058, 0.00160831, 0.00274778, -0.00000067, 0.00000011],
+		[-6.00602878, -0.00272856, 0.00160732, 0.00274574, -0.00000067, 0.00000011],
+		[-6.00690122, -0.00272655, 0.00160633, 0.00274371, -0.00000067, 0.00000011],
+		[-6.00777100, -0.00272454, 0.00160534, 0.00274167, -0.00000067, 0.00000011],
+		[-6.00863812, -0.00272252, 0.00160435, 0.00273964, -0.00000067, 0.00000011],
+		[-6.00950260, -0.00272052, 0.00160336, 0.00273761, -0.00000068, 0.00000010],
+		[-6.01036444, -0.00271851, 0.00160237, 0.00273558, -0.00000068, 0.00000010],
+		[-6.01122364, -0.00271651, 0.00160138, 0.00273355, -0.00000068, 0.00000010],
+		[-6.01208022, -0.00271450, 0.00160039, 0.00273153, -0.00000068, 0.00000010],
+		[-6.01293417, -0.00271250, 0.00159941, 0.00272951, -0.00000068, 0.00000010],
+		[-6.01378552, -0.00271051, 0.00159842, 0.00272749, -0.00000068, 0.00000010],
+		[-6.01463426, -0.00270851, 0.00159743, 0.00272547, -0.00000069, 0.00000010],
+		[-6.01548040, -0.00270652, 0.00159645, 0.00272346, -0.00000069, 0.00000010],
+		[-6.01632394, -0.00270453, 0.00159546, 0.00272144, -0.00000069, 0.00000010],
+		[-6.01716491, -0.00270254, 0.00159448, 0.00271943, -0.00000069, 0.00000010],
+		[-6.01800329, -0.00270055, 0.00159349, 0.00271742, -0.00000069, 0.00000010],
+		[-6.01883911, -0.00269856, 0.00159251, 0.00271542, -0.00000070, 0.00000010],
+		[-6.01967236, -0.00269658, 0.00159153, 0.00271341, -0.00000070, 0.00000010],
+		[-6.02050306, -0.00269460, 0.00159054, 0.00271141, -0.00000070, 0.00000010],
+		[-6.02133120, -0.00269262, 0.00158956, 0.00270941, -0.00000070, 0.00000010],
+		[-6.02215680, -0.00269065, 0.00158858, 0.00270741, -0.00000070, 0.00000010],
+		[-6.02297987, -0.00268867, 0.00158760, 0.00270542, -0.00000070, 0.00000010],
+		[-6.02380040, -0.00268670, 0.00158662, 0.00270343, -0.00000071, 0.00000010],
+		[-6.02461841, -0.00268473, 0.00158564, 0.00270144, -0.00000071, 0.00000010],
+		[-6.02543391, -0.00268276, 0.00158466, 0.00269945, -0.00000071, 0.00000010],
+		[-6.02624690, -0.00268080, 0.00158368, 0.00269746, -0.00000071, 0.00000010],
+		[-6.02705738, -0.00267883, 0.00158270, 0.00269548, -0.00000071, 0.00000009],
+		[-6.02786537, -0.00267687, 0.00158172, 0.00269350, -0.00000071, 0.00000009],
+		[-6.02867087, -0.00267491, 0.00158074, 0.00269152, -0.00000072, 0.00000009],
+		[-6.02947389, -0.00267296, 0.00157977, 0.00268954, -0.00000072, 0.00000009],
+		[-6.03027443, -0.00267100, 0.00157879, 0.00268756, -0.00000072, 0.00000009],
+		[-6.03107251, -0.00266905, 0.00157781, 0.00268559, -0.00000072, 0.00000009],
+		[-6.03186812, -0.00266710, 0.00157684, 0.00268362, -0.00000072, 0.00000009],
+		[-6.03266127, -0.00266515, 0.00157586, 0.00268165, -0.00000072, 0.00000009],
+		[-6.03345198, -0.00266320, 0.00157489, 0.00267968, -0.00000073, 0.00000009],
+		[-6.03424025, -0.00266126, 0.00157391, 0.00267772, -0.00000073, 0.00000009],
+		[-6.03502608, -0.00265932, 0.00157294, 0.00267576, -0.00000073, 0.00000009],
+		[-6.03580948, -0.00265738, 0.00157197, 0.00267380, -0.00000073, 0.00000009],
+		[-6.03659046, -0.00265544, 0.00157100, 0.00267184, -0.00000073, 0.00000009],
+		[-6.03736903, -0.00265350, 0.00157002, 0.00266988, -0.00000073, 0.00000009],
+		[-6.03814518, -0.00265157, 0.00156905, 0.00266793, -0.00000074, 0.00000009],
+		[-6.03891894, -0.00264964, 0.00156808, 0.00266598, -0.00000074, 0.00000009],
+		[-6.03969029, -0.00264771, 0.00156711, 0.00266403, -0.00000074, 0.00000009],
+		[-6.04045926, -0.00264578, 0.00156614, 0.00266208, -0.00000074, 0.00000009],
+		[-6.04122585, -0.00264386, 0.00156517, 0.00266014, -0.00000074, 0.00000009],
+		[-6.04199006, -0.00264193, 0.00156421, 0.00265819, -0.00000074, 0.00000009],
+		[-6.04275190, -0.00264001, 0.00156324, 0.00265625, -0.00000075, 0.00000009],
+		[-6.04351138, -0.00263809, 0.00156227, 0.00265431, -0.00000075, 0.00000009],
+		[-6.04426850, -0.00263618, 0.00156130, 0.00265238, -0.00000075, 0.00000009],
+		[-6.04502327, -0.00263426, 0.00156034, 0.00265044, -0.00000075, 0.00000008],
+		[-6.04577570, -0.00263235, 0.00155937, 0.00264851, -0.00000075, 0.00000008],
+		[-6.04652579, -0.00263044, 0.00155841, 0.00264658, -0.00000075, 0.00000008],
+		[-6.04727354, -0.00262853, 0.00155744, 0.00264465, -0.00000075, 0.00000008],
+		[-6.04801898, -0.00262662, 0.00155648, 0.00264273, -0.00000076, 0.00000008],
+		[-6.04876210, -0.00262472, 0.00155552, 0.00264080, -0.00000076, 0.00000008],
+		[-6.04950290, -0.00262282, 0.00155455, 0.00263888, -0.00000076, 0.00000008],
+		[-6.05024140, -0.00262092, 0.00155359, 0.00263696, -0.00000076, 0.00000008],
+		[-6.05097760, -0.00261902, 0.00155263, 0.00263505, -0.00000076, 0.00000008],
+		[-6.05171151, -0.00261712, 0.00155167, 0.00263313, -0.00000076, 0.00000008],
+		[-6.05244313, -0.00261523, 0.00155071, 0.00263122, -0.00000077, 0.00000008],
+		[-6.05317248, -0.00261334, 0.00154975, 0.00262931, -0.00000077, 0.00000008],
+		[-6.05389955, -0.00261145, 0.00154879, 0.00262740, -0.00000077, 0.00000008],
+		[-6.05462435, -0.00260956, 0.00154783, 0.00262549, -0.00000077, 0.00000008],
+		[-6.05534689, -0.00260767, 0.00154687, 0.00262359, -0.00000077, 0.00000008],
+		[-6.05606718, -0.00260579, 0.00154591, 0.00262169, -0.00000077, 0.00000008],
+		[-6.05678521, -0.00260391, 0.00154495, 0.00261979, -0.00000077, 0.00000008],
+		[-6.05750101, -0.00260203, 0.00154400, 0.00261789, -0.00000078, 0.00000008],
+		[-6.05821457, -0.00260015, 0.00154304, 0.00261599, -0.00000078, 0.00000008],
+		[-6.05892590, -0.00259827, 0.00154209, 0.00261410, -0.00000078, 0.00000008],
+		[-6.05963501, -0.00259640, 0.00154113, 0.00261221, -0.00000078, 0.00000008],
+		[-6.06034190, -0.00259453, 0.00154018, 0.00261032, -0.00000078, 0.00000008],
+		[-6.06104657, -0.00259266, 0.00153922, 0.00260843, -0.00000078, 0.00000008],
+		[-6.06174905, -0.00259079, 0.00153827, 0.00260654, -0.00000078, 0.00000008],
+		[-6.06244932, -0.00258893, 0.00153732, 0.00260466, -0.00000079, 0.00000008],
+		[-6.06314740, -0.00258706, 0.00153637, 0.00260278, -0.00000079, 0.00000008],
+		[-6.06384330, -0.00258520, 0.00153541, 0.00260090, -0.00000079, 0.00000008],
+		[-6.06453701, -0.00258334, 0.00153446, 0.00259902, -0.00000079, 0.00000007],
+		[-6.06522855, -0.00258148, 0.00153351, 0.00259715, -0.00000079, 0.00000007],
+		[-6.06591793, -0.00257963, 0.00153256, 0.00259527, -0.00000079, 0.00000007],
+		[-6.06660514, -0.00257778, 0.00153161, 0.00259340, -0.00000079, 0.00000007],
+		[-6.06729019, -0.00257592, 0.00153067, 0.00259153, -0.00000080, 0.00000007],
+		[-6.06797309, -0.00257408, 0.00152972, 0.00258967, -0.00000080, 0.00000007],
+		[-6.06865385, -0.00257223, 0.00152877, 0.00258780, -0.00000080, 0.00000007],
+		[-6.06933248, -0.00257038, 0.00152782, 0.00258594, -0.00000080, 0.00000007],
+		[-6.07000896, -0.00256854, 0.00152688, 0.00258408, -0.00000080, 0.00000007],
+		[-6.07068333, -0.00256670, 0.00152593, 0.00258222, -0.00000080, 0.00000007],
+		[-6.07135557, -0.00256486, 0.00152499, 0.00258036, -0.00000080, 0.00000007],
+		[-6.07202570, -0.00256302, 0.00152404, 0.00257851, -0.00000081, 0.00000007],
+		[-6.07269372, -0.00256119, 0.00152310, 0.00257666, -0.00000081, 0.00000007],
+		[-6.07335964, -0.00255935, 0.00152215, 0.00257480, -0.00000081, 0.00000007],
+		[-6.07402346, -0.00255752, 0.00152121, 0.00257296, -0.00000081, 0.00000007],
+		[-6.07468520, -0.00255569, 0.00152027, 0.00257111, -0.00000081, 0.00000007],
+		[-6.07534484, -0.00255387, 0.00151933, 0.00256927, -0.00000081, 0.00000007],
+		[-6.07600241, -0.00255204, 0.00151839, 0.00256742, -0.00000081, 0.00000007],
+		[-6.07665791, -0.00255022, 0.00151745, 0.00256558, -0.00000082, 0.00000007],
+		[-6.07731134, -0.00254840, 0.00151651, 0.00256374, -0.00000082, 0.00000007],
+		[-6.07796271, -0.00254658, 0.00151557, 0.00256191, -0.00000082, 0.00000007],
+		[-6.07861202, -0.00254476, 0.00151463, 0.00256007, -0.00000082, 0.00000007],
+		[-6.07925928, -0.00254294, 0.00151369, 0.00255824, -0.00000082, 0.00000007],
+		[-6.07990450, -0.00254113, 0.00151275, 0.00255641, -0.00000082, 0.00000007],
+		[-6.08054769, -0.00253932, 0.00151182, 0.00255458, -0.00000082, 0.00000007],
+		[-6.08118884, -0.00253751, 0.00151088, 0.00255276, -0.00000082, 0.00000007],
+		[-6.08182796, -0.00253570, 0.00150994, 0.00255093, -0.00000083, 0.00000007],
+		[-6.08246507, -0.00253390, 0.00150901, 0.00254911, -0.00000083, 0.00000007],
+		[-6.08310016, -0.00253210, 0.00150807, 0.00254729, -0.00000083, 0.00000007],
+		[-6.08373324, -0.00253029, 0.00150714, 0.00254547, -0.00000083, 0.00000007],
+		[-6.08436431, -0.00252849, 0.00150621, 0.00254366, -0.00000083, 0.00000006],
+		[-6.08499339, -0.00252670, 0.00150527, 0.00254184, -0.00000083, 0.00000006],
+		[-6.08562048, -0.00252490, 0.00150434, 0.00254003, -0.00000083, 0.00000006],
+		[-6.08624558, -0.00252311, 0.00150341, 0.00253822, -0.00000084, 0.00000006],
+		[-6.08686870, -0.00252132, 0.00150248, 0.00253641, -0.00000084, 0.00000006],
+		[-6.08748985, -0.00251953, 0.00150155, 0.00253461, -0.00000084, 0.00000006],
+		[-6.08810902, -0.00251774, 0.00150062, 0.00253280, -0.00000084, 0.00000006],
+		[-6.08872624, -0.00251595, 0.00149969, 0.00253100, -0.00000084, 0.00000006],
+		[-6.08934149, -0.00251417, 0.00149876, 0.00252920, -0.00000084, 0.00000006],
+		[-6.08995479, -0.00251239, 0.00149784, 0.00252740, -0.00000084, 0.00000006],
+		[-6.09056615, -0.00251061, 0.00149691, 0.00252561, -0.00000084, 0.00000006],
+		[-6.09117556, -0.00250883, 0.00149598, 0.00252381, -0.00000085, 0.00000006],
+		[-6.09178304, -0.00250705, 0.00149506, 0.00252202, -0.00000085, 0.00000006],
+		[-6.09238859, -0.00250528, 0.00149413, 0.00252023, -0.00000085, 0.00000006],
+		[-6.09299221, -0.00250351, 0.00149320, 0.00251844, -0.00000085, 0.00000006],
+		[-6.09359392, -0.00250174, 0.00149228, 0.00251666, -0.00000085, 0.00000006],
+		[-6.09419371, -0.00249997, 0.00149136, 0.00251487, -0.00000085, 0.00000006],
+		[-6.09479159, -0.00249820, 0.00149043, 0.00251309, -0.00000085, 0.00000006],
+		[-6.09538757, -0.00249644, 0.00148951, 0.00251131, -0.00000085, 0.00000006],
+		[-6.09598165, -0.00249468, 0.00148859, 0.00250953, -0.00000086, 0.00000006],
+		[-6.09657385, -0.00249292, 0.00148767, 0.00250776, -0.00000086, 0.00000006],
+		[-6.09716415, -0.00249116, 0.00148675, 0.00250598, -0.00000086, 0.00000006],
+		[-6.09775257, -0.00248940, 0.00148583, 0.00250421, -0.00000086, 0.00000006],
+		[-6.09833912, -0.00248765, 0.00148491, 0.00250244, -0.00000086, 0.00000006],
+		[-6.09892380, -0.00248589, 0.00148399, 0.00250067, -0.00000086, 0.00000006],
+		[-6.09950662, -0.00248414, 0.00148307, 0.00249891, -0.00000086, 0.00000006],
+		[-6.10008757, -0.00248239, 0.00148215, 0.00249714, -0.00000086, 0.00000006],
+		[-6.10066667, -0.00248065, 0.00148124, 0.00249538, -0.00000086, 0.00000006],
+		[-6.10124393, -0.00247890, 0.00148032, 0.00249362, -0.00000087, 0.00000006],
+		[-6.10181934, -0.00247716, 0.00147941, 0.00249186, -0.00000087, 0.00000006],
+		[-6.10239291, -0.00247542, 0.00147849, 0.00249010, -0.00000087, 0.00000006],
+		[-6.10296465, -0.00247368, 0.00147758, 0.00248835, -0.00000087, 0.00000006],
+		[-6.10353456, -0.00247194, 0.00147666, 0.00248660, -0.00000087, 0.00000006],
+		[-6.10410265, -0.00247020, 0.00147575, 0.00248484, -0.00000087, 0.00000006],
+		[-6.10466892, -0.00246847, 0.00147484, 0.00248310, -0.00000087, 0.00000006],
+		[-6.10523338, -0.00246674, 0.00147393, 0.00248135, -0.00000087, 0.00000005],
+		[-6.10579604, -0.00246501, 0.00147301, 0.00247960, -0.00000088, 0.00000005],
+		[-6.10635689, -0.00246328, 0.00147210, 0.00247786, -0.00000088, 0.00000005],
+		[-6.10691595, -0.00246155, 0.00147119, 0.00247612, -0.00000088, 0.00000005],
+		[-6.10747322, -0.00245983, 0.00147028, 0.00247438, -0.00000088, 0.00000005],
+		[-6.10802871, -0.00245811, 0.00146937, 0.00247264, -0.00000088, 0.00000005],
+		[-6.10858241, -0.00245639, 0.00146847, 0.00247091, -0.00000088, 0.00000005],
+		[-6.10913434, -0.00245467, 0.00146756, 0.00246917, -0.00000088, 0.00000005],
+		[-6.10968450, -0.00245295, 0.00146665, 0.00246744, -0.00000088, 0.00000005],
+		[-6.11023289, -0.00245123, 0.00146575, 0.00246571, -0.00000088, 0.00000005],
+		[-6.11077953, -0.00244952, 0.00146484, 0.00246398, -0.00000089, 0.00000005],
+		[-6.11132441, -0.00244781, 0.00146393, 0.00246226, -0.00000089, 0.00000005],
+		[-6.11186754, -0.00244610, 0.00146303, 0.00246053, -0.00000089, 0.00000005],
+		[-6.11240893, -0.00244439, 0.00146213, 0.00245881, -0.00000089, 0.00000005],
+		[-6.11294858, -0.00244269, 0.00146122, 0.00245709, -0.00000089, 0.00000005],
+		[-6.11348649, -0.00244098, 0.00146032, 0.00245537, -0.00000089, 0.00000005],
+		[-6.11402268, -0.00243928, 0.00145942, 0.00245366, -0.00000089, 0.00000005],
+		[-6.11455714, -0.00243758, 0.00145852, 0.00245194, -0.00000089, 0.00000005],
+		[-6.11508989, -0.00243588, 0.00145762, 0.00245023, -0.00000089, 0.00000005],
+		[-6.11562092, -0.00243419, 0.00145672, 0.00244852, -0.00000090, 0.00000005],
+		[-6.11615024, -0.00243249, 0.00145582, 0.00244681, -0.00000090, 0.00000005],
+		[-6.11667786, -0.00243080, 0.00145492, 0.00244510, -0.00000090, 0.00000005],
+		[-6.11720378, -0.00242911, 0.00145402, 0.00244340, -0.00000090, 0.00000005],
+		[-6.11772800, -0.00242742, 0.00145312, 0.00244170, -0.00000090, 0.00000005],
+		[-6.11825054, -0.00242574, 0.00145223, 0.00244000, -0.00000090, 0.00000005],
+		[-6.11877140, -0.00242405, 0.00145133, 0.00243830, -0.00000090, 0.00000005],
+		[-6.11929057, -0.00242237, 0.00145043, 0.00243660, -0.00000090, 0.00000005],
+		[-6.11980807, -0.00242069, 0.00144954, 0.00243490, -0.00000090, 0.00000005],
+		[-6.12032390, -0.00241901, 0.00144864, 0.00243321, -0.00000090, 0.00000005],
+		[-6.12083807, -0.00241733, 0.00144775, 0.00243152, -0.00000091, 0.00000005],
+		[-6.12135058, -0.00241565, 0.00144686, 0.00242983, -0.00000091, 0.00000005],
+		[-6.12186144, -0.00241398, 0.00144597, 0.00242814, -0.00000091, 0.00000005],
+		[-6.12237064, -0.00241231, 0.00144507, 0.00242645, -0.00000091, 0.00000005],
+		[-6.12287820, -0.00241064, 0.00144418, 0.00242477, -0.00000091, 0.00000005],
+		[-6.12338412, -0.00240897, 0.00144329, 0.00242309, -0.00000091, 0.00000005],
+		[-6.12388841, -0.00240730, 0.00144240, 0.00242141, -0.00000091, 0.00000005],
+		[-6.12439107, -0.00240563, 0.00144151, 0.00241973, -0.00000091, 0.00000005],
+		[-6.12489210, -0.00240397, 0.00144062, 0.00241805, -0.00000091, 0.00000005],
+		[-6.12539151, -0.00240231, 0.00143974, 0.00241637, -0.00000092, 0.00000005],
+		[-6.12588931, -0.00240065, 0.00143885, 0.00241470, -0.00000092, 0.00000005],
+		[-6.12638549, -0.00239899, 0.00143796, 0.00241303, -0.00000092, 0.00000005],
+		[-6.12688007, -0.00239734, 0.00143708, 0.00241136, -0.00000092, 0.00000005],
+		[-6.12737305, -0.00239568, 0.00143619, 0.00240969, -0.00000092, 0.00000005],
+		[-6.12786443, -0.00239403, 0.00143531, 0.00240803, -0.00000092, 0.00000004],
+		[-6.12835422, -0.00239238, 0.00143442, 0.00240636, -0.00000092, 0.00000004],
+		[-6.12884242, -0.00239073, 0.00143354, 0.00240470, -0.00000092, 0.00000004],
+		[-6.12932904, -0.00238908, 0.00143266, 0.00240304, -0.00000092, 0.00000004],
+		[-6.12981408, -0.00238744, 0.00143177, 0.00240138, -0.00000092, 0.00000004],
+		[-6.13029755, -0.00238580, 0.00143089, 0.00239972, -0.00000093, 0.00000004],
+		[-6.13077945, -0.00238416, 0.00143001, 0.00239807, -0.00000093, 0.00000004],
+		[-6.13125979, -0.00238252, 0.00142913, 0.00239642, -0.00000093, 0.00000004],
+		[-6.13173857, -0.00238088, 0.00142825, 0.00239477, -0.00000093, 0.00000004],
+		[-6.13221579, -0.00237924, 0.00142737, 0.00239312, -0.00000093, 0.00000004],
+		[-6.13269147, -0.00237761, 0.00142649, 0.00239147, -0.00000093, 0.00000004],
+		[-6.13316560, -0.00237598, 0.00142562, 0.00238982, -0.00000093, 0.00000004],
+		[-6.13363819, -0.00237434, 0.00142474, 0.00238818, -0.00000093, 0.00000004],
+		[-6.13410924, -0.00237272, 0.00142386, 0.00238654, -0.00000093, 0.00000004],
+		[-6.13457876, -0.00237109, 0.00142299, 0.00238490, -0.00000093, 0.00000004],
+		[-6.13504676, -0.00236946, 0.00142211, 0.00238326, -0.00000093, 0.00000004],
+		[-6.13551323, -0.00236784, 0.00142124, 0.00238162, -0.00000094, 0.00000004],
+		[-6.13597818, -0.00236622, 0.00142036, 0.00237999, -0.00000094, 0.00000004],
+		[-6.13644163, -0.00236460, 0.00141949, 0.00237835, -0.00000094, 0.00000004],
+		[-6.13690356, -0.00236298, 0.00141862, 0.00237672, -0.00000094, 0.00000004],
+		[-6.13736399, -0.00236136, 0.00141774, 0.00237509, -0.00000094, 0.00000004],
+		[-6.13782292, -0.00235975, 0.00141687, 0.00237347, -0.00000094, 0.00000004],
+		[-6.13828035, -0.00235814, 0.00141600, 0.00237184, -0.00000094, 0.00000004],
+		[-6.13873630, -0.00235652, 0.00141513, 0.00237022, -0.00000094, 0.00000004],
+		[-6.13919076, -0.00235492, 0.00141426, 0.00236859, -0.00000094, 0.00000004],
+		[-6.13964373, -0.00235331, 0.00141339, 0.00236697, -0.00000094, 0.00000004],
+		[-6.14009523, -0.00235170, 0.00141253, 0.00236535, -0.00000094, 0.00000004],
+		[-6.14054526, -0.00235010, 0.00141166, 0.00236374, -0.00000095, 0.00000004],
+		[-6.14099381, -0.00234850, 0.00141079, 0.00236212, -0.00000095, 0.00000004],
+		[-6.14144091, -0.00234689, 0.00140993, 0.00236051, -0.00000095, 0.00000004],
+		[-6.14188654, -0.00234530, 0.00140906, 0.00235890, -0.00000095, 0.00000004],
+		[-6.14233072, -0.00234370, 0.00140820, 0.00235729, -0.00000095, 0.00000004],
+		[-6.14277345, -0.00234210, 0.00140733, 0.00235568, -0.00000095, 0.00000004],
+		[-6.14321473, -0.00234051, 0.00140647, 0.00235407, -0.00000095, 0.00000004],
+		[-6.14365457, -0.00233892, 0.00140561, 0.00235247, -0.00000095, 0.00000004],
+		[-6.14409297, -0.00233733, 0.00140474, 0.00235087, -0.00000095, 0.00000004],
+		[-6.14452994, -0.00233574, 0.00140388, 0.00234926, -0.00000095, 0.00000004],
+		[-6.14496548, -0.00233415, 0.00140302, 0.00234767, -0.00000095, 0.00000004],
+		[-6.14539959, -0.00233257, 0.00140216, 0.00234607, -0.00000096, 0.00000004],
+		[-6.14583228, -0.00233098, 0.00140130, 0.00234447, -0.00000096, 0.00000004],
+		[-6.14626356, -0.00232940, 0.00140044, 0.00234288, -0.00000096, 0.00000004],
+		[-6.14669342, -0.00232782, 0.00139958, 0.00234129, -0.00000096, 0.00000004],
+		[-6.14712188, -0.00232625, 0.00139873, 0.00233970, -0.00000096, 0.00000004],
+		[-6.14754894, -0.00232467, 0.00139787, 0.00233811, -0.00000096, 0.00000004],
+		[-6.14797459, -0.00232309, 0.00139701, 0.00233652, -0.00000096, 0.00000004],
+		[-6.14839885, -0.00232152, 0.00139616, 0.00233493, -0.00000096, 0.00000004],
+		[-6.14882172, -0.00231995, 0.00139530, 0.00233335, -0.00000096, 0.00000004],
+		[-6.14924320, -0.00231838, 0.00139445, 0.00233177, -0.00000096, 0.00000004],
+		[-6.14966330, -0.00231681, 0.00139359, 0.00233019, -0.00000096, 0.00000004],
+		[-6.15008202, -0.00231525, 0.00139274, 0.00232861, -0.00000097, 0.00000004],
+		[-6.15049937, -0.00231368, 0.00139189, 0.00232704, -0.00000097, 0.00000004],
+		[-6.15091535, -0.00231212, 0.00139104, 0.00232546, -0.00000097, 0.00000004],
+		[-6.15132996, -0.00231056, 0.00139018, 0.00232389, -0.00000097, 0.00000004],
+		[-6.15174321, -0.00230900, 0.00138933, 0.00232232, -0.00000097, 0.00000003],
+		[-6.15215510, -0.00230744, 0.00138848, 0.00232075, -0.00000097, 0.00000003],
+		[-6.15256564, -0.00230589, 0.00138763, 0.00231918, -0.00000097, 0.00000003],
+		[-6.15297483, -0.00230433, 0.00138679, 0.00231761, -0.00000097, 0.00000003],
+		[-6.15338268, -0.00230278, 0.00138594, 0.00231605, -0.00000097, 0.00000003],
+		[-6.15378918, -0.00230123, 0.00138509, 0.00231449, -0.00000097, 0.00000003],
+		[-6.15419435, -0.00229968, 0.00138424, 0.00231293, -0.00000097, 0.00000003],
+		[-6.15459818, -0.00229814, 0.00138340, 0.00231137, -0.00000097, 0.00000003],
+		[-6.15500069, -0.00229659, 0.00138255, 0.00230981, -0.00000097, 0.00000003],
+		[-6.15540187, -0.00229505, 0.00138171, 0.00230825, -0.00000098, 0.00000003],
+		[-6.15580173, -0.00229350, 0.00138087, 0.00230670, -0.00000098, 0.00000003],
+		[-6.15620027, -0.00229196, 0.00138002, 0.00230515, -0.00000098, 0.00000003],
+		[-6.15659750, -0.00229042, 0.00137918, 0.00230360, -0.00000098, 0.00000003],
+		[-6.15699342, -0.00228889, 0.00137834, 0.00230205, -0.00000098, 0.00000003],
+		[-6.15738804, -0.00228735, 0.00137750, 0.00230050, -0.00000098, 0.00000003],
+		[-6.15778136, -0.00228582, 0.00137666, 0.00229896, -0.00000098, 0.00000003],
+		[-6.15817338, -0.00228429, 0.00137582, 0.00229741, -0.00000098, 0.00000003],
+		[-6.15856410, -0.00228276, 0.00137498, 0.00229587, -0.00000098, 0.00000003],
+		[-6.15895354, -0.00228123, 0.00137414, 0.00229433, -0.00000098, 0.00000003],
+		[-6.15934170, -0.00227970, 0.00137330, 0.00229279, -0.00000098, 0.00000003],
+		[-6.15972857, -0.00227818, 0.00137246, 0.00229125, -0.00000098, 0.00000003],
+		[-6.16011416, -0.00227665, 0.00137162, 0.00228972, -0.00000099, 0.00000003],
+		[-6.16049848, -0.00227513, 0.00137079, 0.00228818, -0.00000099, 0.00000003],
+		[-6.16088154, -0.00227361, 0.00136995, 0.00228665, -0.00000099, 0.00000003],
+		[-6.16126332, -0.00227209, 0.00136912, 0.00228512, -0.00000099, 0.00000003],
+		[-6.16164385, -0.00227057, 0.00136828, 0.00228359, -0.00000099, 0.00000003],
+		[-6.16202312, -0.00226906, 0.00136745, 0.00228207, -0.00000099, 0.00000003],
+		[-6.16240113, -0.00226754, 0.00136662, 0.00228054, -0.00000099, 0.00000003],
+		[-6.16277790, -0.00226603, 0.00136579, 0.00227902, -0.00000099, 0.00000003],
+		[-6.16315341, -0.00226452, 0.00136495, 0.00227750, -0.00000099, 0.00000003],
+		[-6.16352769, -0.00226301, 0.00136412, 0.00227598, -0.00000099, 0.00000003],
+		[-6.16390073, -0.00226151, 0.00136329, 0.00227446, -0.00000099, 0.00000003],
+		[-6.16427253, -0.00226000, 0.00136246, 0.00227294, -0.00000099, 0.00000003],
+		[-6.16464310, -0.00225850, 0.00136164, 0.00227143, -0.00000099, 0.00000003],
+		[-6.16501245, -0.00225700, 0.00136081, 0.00226991, -0.00000100, 0.00000003],
+		[-6.16538057, -0.00225549, 0.00135998, 0.00226840, -0.00000100, 0.00000003],
+		[-6.16574747, -0.00225400, 0.00135915, 0.00226689, -0.00000100, 0.00000003],
+		[-6.16611316, -0.00225250, 0.00135833, 0.00226538, -0.00000100, 0.00000003],
+		[-6.16647763, -0.00225100, 0.00135750, 0.00226388, -0.00000100, 0.00000003],
+		[-6.16684090, -0.00224951, 0.00135668, 0.00226237, -0.00000100, 0.00000003],
+		[-6.16720296, -0.00224802, 0.00135585, 0.00226087, -0.00000100, 0.00000003],
+		[-6.16756382, -0.00224653, 0.00135503, 0.00225936, -0.00000100, 0.00000003],
+		[-6.16792348, -0.00224504, 0.00135421, 0.00225786, -0.00000100, 0.00000003],
+		[-6.16828195, -0.00224355, 0.00135338, 0.00225637, -0.00000100, 0.00000003],
+		[-6.16863923, -0.00224206, 0.00135256, 0.00225487, -0.00000100, 0.00000003],
+		[-6.16899533, -0.00224058, 0.00135174, 0.00225337, -0.00000100, 0.00000003],
+		[-6.16935024, -0.00223910, 0.00135092, 0.00225188, -0.00000100, 0.00000003],
+		[-6.16970397, -0.00223762, 0.00135010, 0.00225039, -0.00000100, 0.00000003],
+		[-6.17005653, -0.00223614, 0.00134928, 0.00224890, -0.00000101, 0.00000003],
+		[-6.17040791, -0.00223466, 0.00134846, 0.00224741, -0.00000101, 0.00000003],
+		[-6.17075813, -0.00223318, 0.00134765, 0.00224592, -0.00000101, 0.00000003],
+		[-6.17110719, -0.00223171, 0.00134683, 0.00224444, -0.00000101, 0.00000003],
+		[-6.17145508, -0.00223024, 0.00134601, 0.00224295, -0.00000101, 0.00000003],
+		[-6.17180182, -0.00222876, 0.00134520, 0.00224147, -0.00000101, 0.00000003],
+		[-6.17214740, -0.00222729, 0.00134438, 0.00223999, -0.00000101, 0.00000003],
+		[-6.17249183, -0.00222583, 0.00134357, 0.00223851, -0.00000101, 0.00000003],
+		[-6.17283512, -0.00222436, 0.00134275, 0.00223703, -0.00000101, 0.00000003],
+		[-6.17317726, -0.00222289, 0.00134194, 0.00223556, -0.00000101, 0.00000003],
+		[-6.17351827, -0.00222143, 0.00134113, 0.00223408, -0.00000101, 0.00000003],
+		[-6.17385813, -0.00221997, 0.00134032, 0.00223261, -0.00000101, 0.00000003],
+		[-6.17419687, -0.00221851, 0.00133950, 0.00223114, -0.00000101, 0.00000003],
+		[-6.17453448, -0.00221705, 0.00133869, 0.00222967, -0.00000101, 0.00000003],
+		[-6.17487096, -0.00221559, 0.00133788, 0.00222820, -0.00000101, 0.00000003],
+		[-6.17520632, -0.00221414, 0.00133708, 0.00222674, -0.00000102, 0.00000003],
+		[-6.17554056, -0.00221269, 0.00133627, 0.00222527, -0.00000102, 0.00000003],
+		[-6.17587369, -0.00221123, 0.00133546, 0.00222381, -0.00000102, 0.00000003],
+		[-6.17620571, -0.00220978, 0.00133465, 0.00222235, -0.00000102, 0.00000003],
+		[-6.17653662, -0.00220833, 0.00133385, 0.00222089, -0.00000102, 0.00000003],
+		[-6.17686642, -0.00220689, 0.00133304, 0.00221943, -0.00000102, 0.00000003],
+		[-6.17719513, -0.00220544, 0.00133223, 0.00221798, -0.00000102, 0.00000003],
+		[-6.17752273, -0.00220400, 0.00133143, 0.00221652, -0.00000102, 0.00000003],
+		[-6.17784925, -0.00220255, 0.00133063, 0.00221507, -0.00000102, 0.00000003],
+		[-6.17817467, -0.00220111, 0.00132982, 0.00221362, -0.00000102, 0.00000002],
+		[-6.17849900, -0.00219967, 0.00132902, 0.00221217, -0.00000102, 0.00000002],
+		[-6.17882225, -0.00219823, 0.00132822, 0.00221072, -0.00000102, 0.00000002],
+		[-6.17914442, -0.00219680, 0.00132742, 0.00220927, -0.00000102, 0.00000002],
+		[-6.17946552, -0.00219536, 0.00132662, 0.00220782, -0.00000102, 0.00000002],
+		[-6.17978554, -0.00219393, 0.00132582, 0.00220638, -0.00000102, 0.00000002],
+		[-6.18010448, -0.00219250, 0.00132502, 0.00220494, -0.00000103, 0.00000002],
+		[-6.18042237, -0.00219107, 0.00132422, 0.00220350, -0.00000103, 0.00000002],
+		[-6.18073919, -0.00218964, 0.00132342, 0.00220206, -0.00000103, 0.00000002],
+		[-6.18105494, -0.00218821, 0.00132262, 0.00220062, -0.00000103, 0.00000002],
+		[-6.18136964, -0.00218679, 0.00132183, 0.00219919, -0.00000103, 0.00000002],
+		[-6.18168329, -0.00218536, 0.00132103, 0.00219775, -0.00000103, 0.00000002],
+		[-6.18199589, -0.00218394, 0.00132024, 0.00219632, -0.00000103, 0.00000002],
+		[-6.18230744, -0.00218252, 0.00131944, 0.00219489, -0.00000103, 0.00000002],
+		[-6.18261795, -0.00218110, 0.00131865, 0.00219346, -0.00000103, 0.00000002],
+		[-6.18292741, -0.00217968, 0.00131785, 0.00219203, -0.00000103, 0.00000002],
+		[-6.18323584, -0.00217827, 0.00131706, 0.00219060, -0.00000103, 0.00000002],
+		[-6.18354323, -0.00217685, 0.00131627, 0.00218918, -0.00000103, 0.00000002],
+		[-6.18384960, -0.00217544, 0.00131548, 0.00218776, -0.00000103, 0.00000002],
+		[-6.18415493, -0.00217403, 0.00131469, 0.00218633, -0.00000103, 0.00000002],
+		[-6.18445924, -0.00217262, 0.00131390, 0.00218491, -0.00000103, 0.00000002],
+		[-6.18476253, -0.00217121, 0.00131311, 0.00218350, -0.00000103, 0.00000002],
+		[-6.18506481, -0.00216980, 0.00131232, 0.00218208, -0.00000104, 0.00000002],
+		[-6.18536606, -0.00216840, 0.00131153, 0.00218066, -0.00000104, 0.00000002],
+		[-6.18566631, -0.00216699, 0.00131074, 0.00217925, -0.00000104, 0.00000002],
+		[-6.18596555, -0.00216559, 0.00130996, 0.00217784, -0.00000104, 0.00000002],
+		[-6.18626378, -0.00216419, 0.00130917, 0.00217643, -0.00000104, 0.00000002],
+		[-6.18656101, -0.00216279, 0.00130839, 0.00217502, -0.00000104, 0.00000002],
+		[-6.18685724, -0.00216139, 0.00130760, 0.00217361, -0.00000104, 0.00000002],
+		[-6.18715248, -0.00216000, 0.00130682, 0.00217220, -0.00000104, 0.00000002],
+		[-6.18744673, -0.00215860, 0.00130603, 0.00217080, -0.00000104, 0.00000002],
+		[-6.18773998, -0.00215721, 0.00130525, 0.00216939, -0.00000104, 0.00000002],
+		[-6.18803225, -0.00215582, 0.00130447, 0.00216799, -0.00000104, 0.00000002],
+		[-6.18832353, -0.00215443, 0.00130369, 0.00216659, -0.00000104, 0.00000002],
+		[-6.18861384, -0.00215304, 0.00130291, 0.00216519, -0.00000104, 0.00000002],
+		[-6.18890316, -0.00215165, 0.00130213, 0.00216380, -0.00000104, 0.00000002],
+		[-6.18919152, -0.00215026, 0.00130135, 0.00216240, -0.00000104, 0.00000002],
+		[-6.18947890, -0.00214888, 0.00130057, 0.00216101, -0.00000104, 0.00000002],
+		[-6.18976532, -0.00214750, 0.00129979, 0.00215961, -0.00000104, 0.00000002],
+		[-6.19005077, -0.00214612, 0.00129901, 0.00215822, -0.00000105, 0.00000002],
+		[-6.19033526, -0.00214474, 0.00129823, 0.00215683, -0.00000105, 0.00000002],
+		[-6.19061879, -0.00214336, 0.00129746, 0.00215545, -0.00000105, 0.00000002],
+		[-6.19090136, -0.00214198, 0.00129668, 0.00215406, -0.00000105, 0.00000002],
+		[-6.19118298, -0.00214061, 0.00129591, 0.00215268, -0.00000105, 0.00000002],
+		[-6.19146366, -0.00213923, 0.00129513, 0.00215129, -0.00000105, 0.00000002],
+		[-6.19174338, -0.00213786, 0.00129436, 0.00214991, -0.00000105, 0.00000002],
+		[-6.19202217, -0.00213649, 0.00129359, 0.00214853, -0.00000105, 0.00000002],
+		[-6.19230001, -0.00213512, 0.00129281, 0.00214715, -0.00000105, 0.00000002],
+		[-6.19257691, -0.00213375, 0.00129204, 0.00214577, -0.00000105, 0.00000002],
+		[-6.19285288, -0.00213239, 0.00129127, 0.00214440, -0.00000105, 0.00000002],
+		[-6.19312792, -0.00213102, 0.00129050, 0.00214302, -0.00000105, 0.00000002],
+		[-6.19340203, -0.00212966, 0.00128973, 0.00214165, -0.00000105, 0.00000002],
+		[-6.19367521, -0.00212830, 0.00128896, 0.00214028, -0.00000105, 0.00000002],
+		[-6.19394748, -0.00212694, 0.00128819, 0.00213891, -0.00000105, 0.00000002],
+		[-6.19421882, -0.00212558, 0.00128743, 0.00213754, -0.00000105, 0.00000002],
+		[-6.19448924, -0.00212422, 0.00128666, 0.00213617, -0.00000105, 0.00000002],
+		[-6.19475875, -0.00212286, 0.00128589, 0.00213481, -0.00000105, 0.00000002],
+		[-6.19502735, -0.00212151, 0.00128513, 0.00213344, -0.00000105, 0.00000002],
+		[-6.19529504, -0.00212016, 0.00128436, 0.00213208, -0.00000106, 0.00000002],
+		[-6.19556183, -0.00211880, 0.00128360, 0.00213072, -0.00000106, 0.00000002],
+		[-6.19582771, -0.00211745, 0.00128283, 0.00212936, -0.00000106, 0.00000002],
+		[-6.19609270, -0.00211611, 0.00128207, 0.00212800, -0.00000106, 0.00000002],
+		[-6.19635678, -0.00211476, 0.00128131, 0.00212665, -0.00000106, 0.00000002],
+		[-6.19661998, -0.00211341, 0.00128054, 0.00212529, -0.00000106, 0.00000002],
+		[-6.19688228, -0.00211207, 0.00127978, 0.00212394, -0.00000106, 0.00000002],
+		[-6.19714369, -0.00211073, 0.00127902, 0.00212259, -0.00000106, 0.00000002],
+		[-6.19740422, -0.00210938, 0.00127826, 0.00212123, -0.00000106, 0.00000002],
+		[-6.19766387, -0.00210804, 0.00127750, 0.00211989, -0.00000106, 0.00000002],
+		[-6.19792264, -0.00210671, 0.00127674, 0.00211854, -0.00000106, 0.00000002],
+		[-6.19818053, -0.00210537, 0.00127599, 0.00211719, -0.00000106, 0.00000002],
+		[-6.19843754, -0.00210403, 0.00127523, 0.00211585, -0.00000106, 0.00000002],
+		[-6.19869369, -0.00210270, 0.00127447, 0.00211450, -0.00000106, 0.00000002],
+		[-6.19894896, -0.00210137, 0.00127372, 0.00211316, -0.00000106, 0.00000002],
+		[-6.19920337, -0.00210004, 0.00127296, 0.00211182, -0.00000106, 0.00000002],
+		[-6.19945692, -0.00209871, 0.00127221, 0.00211048, -0.00000106, 0.00000002],
+		[-6.19970961, -0.00209738, 0.00127145, 0.00210914, -0.00000106, 0.00000002],
+		[-6.19996144, -0.00209605, 0.00127070, 0.00210781, -0.00000106, 0.00000002],
+		[-6.20021242, -0.00209473, 0.00126995, 0.00210647, -0.00000107, 0.00000002],
+		[-6.20046254, -0.00209340, 0.00126919, 0.00210514, -0.00000107, 0.00000002],
+		[-6.20071181, -0.00209208, 0.00126844, 0.00210381, -0.00000107, 0.00000002],
+		[-6.20096024, -0.00209076, 0.00126769, 0.00210248, -0.00000107, 0.00000002],
+		[-6.20120782, -0.00208944, 0.00126694, 0.00210115, -0.00000107, 0.00000002],
+		[-6.20145457, -0.00208812, 0.00126619, 0.00209982, -0.00000107, 0.00000002],
+		[-6.20170047, -0.00208680, 0.00126544, 0.00209850, -0.00000107, 0.00000002],
+		[-6.20194554, -0.00208549, 0.00126469, 0.00209717, -0.00000107, 0.00000002],
+		[-6.20218978, -0.00208417, 0.00126395, 0.00209585, -0.00000107, 0.00000002],
+		[-6.20243318, -0.00208286, 0.00126320, 0.00209453, -0.00000107, 0.00000002],
+		[-6.20267576, -0.00208155, 0.00126245, 0.00209321, -0.00000107, 0.00000002],
+		[-6.20291751, -0.00208024, 0.00126171, 0.00209189, -0.00000107, 0.00000002],
+		[-6.20315844, -0.00207893, 0.00126096, 0.00209057, -0.00000107, 0.00000002],
+		[-6.20339855, -0.00207762, 0.00126022, 0.00208925, -0.00000107, 0.00000002],
+		[-6.20363785, -0.00207632, 0.00125947, 0.00208794, -0.00000107, 0.00000002],
+		[-6.20387633, -0.00207501, 0.00125873, 0.00208663, -0.00000107, 0.00000002],
+		[-6.20411399, -0.00207371, 0.00125799, 0.00208532, -0.00000107, 0.00000002],
+		[-6.20435085, -0.00207241, 0.00125725, 0.00208400, -0.00000107, 0.00000002],
+		[-6.20458690, -0.00207111, 0.00125650, 0.00208270, -0.00000107, 0.00000002],
+		[-6.20482215, -0.00206981, 0.00125576, 0.00208139, -0.00000107, 0.00000002],
+		[-6.20505660, -0.00206852, 0.00125502, 0.00208008, -0.00000107, 0.00000002],
+		[-6.20529024, -0.00206722, 0.00125428, 0.00207878, -0.00000108, 0.00000002],
+		[-6.20552310, -0.00206593, 0.00125355, 0.00207748, -0.00000108, 0.00000002],
+		[-6.20575515, -0.00206463, 0.00125281, 0.00207617, -0.00000108, 0.00000002],
+		[-6.20598642, -0.00206334, 0.00125207, 0.00207487, -0.00000108, 0.00000002],
+		[-6.20621690, -0.00206205, 0.00125133, 0.00207357, -0.00000108, 0.00000002],
+		[-6.20644659, -0.00206076, 0.00125060, 0.00207228, -0.00000108, 0.00000002],
+		[-6.20667550, -0.00205947, 0.00124986, 0.00207098, -0.00000108, 0.00000002],
+		[-6.20690362, -0.00205819, 0.00124913, 0.00206969, -0.00000108, 0.00000002],
+		[-6.20713097, -0.00205690, 0.00124839, 0.00206839, -0.00000108, 0.00000002],
+		[-6.20735754, -0.00205562, 0.00124766, 0.00206710, -0.00000108, 0.00000002],
+		[-6.20758334, -0.00205434, 0.00124693, 0.00206581, -0.00000108, 0.00000002],
+		[-6.20780837, -0.00205306, 0.00124619, 0.00206452, -0.00000108, 0.00000001],
+		[-6.20803263, -0.00205178, 0.00124546, 0.00206323, -0.00000108, 0.00000001],
+		[-6.20825612, -0.00205050, 0.00124473, 0.00206195, -0.00000108, 0.00000001],
+		[-6.20847885, -0.00204923, 0.00124400, 0.00206066, -0.00000108, 0.00000001],
+		[-6.20870082, -0.00204795, 0.00124327, 0.00205938, -0.00000108, 0.00000001],
+		[-6.20892203, -0.00204668, 0.00124254, 0.00205810, -0.00000108, 0.00000001],
+		[-6.20914249, -0.00204540, 0.00124181, 0.00205681, -0.00000108, 0.00000001],
+		[-6.20936219, -0.00204413, 0.00124109, 0.00205554, -0.00000108, 0.00000001],
+		[-6.20958114, -0.00204286, 0.00124036, 0.00205426, -0.00000108, 0.00000001],
+		[-6.20979934, -0.00204160, 0.00123963, 0.00205298, -0.00000108, 0.00000001],
+		[-6.21001679, -0.00204033, 0.00123891, 0.00205171, -0.00000108, 0.00000001],
+		[-6.21023350, -0.00203906, 0.00123818, 0.00205043, -0.00000108, 0.00000001],
+		[-6.21044947, -0.00203780, 0.00123746, 0.00204916, -0.00000109, 0.00000001],
+		[-6.21066470, -0.00203654, 0.00123673, 0.00204789, -0.00000109, 0.00000001],
+		[-6.21087920, -0.00203528, 0.00123601, 0.00204662, -0.00000109, 0.00000001],
+		[-6.21109295, -0.00203402, 0.00123529, 0.00204535, -0.00000109, 0.00000001],
+		[-6.21130598, -0.00203276, 0.00123456, 0.00204408, -0.00000109, 0.00000001],
+		[-6.21151828, -0.00203150, 0.00123384, 0.00204282, -0.00000109, 0.00000001],
+		[-6.21172985, -0.00203024, 0.00123312, 0.00204155, -0.00000109, 0.00000001],
+		[-6.21194069, -0.00202899, 0.00123240, 0.00204029, -0.00000109, 0.00000001],
+		[-6.21215082, -0.00202774, 0.00123168, 0.00203903, -0.00000109, 0.00000001],
+		[-6.21236022, -0.00202648, 0.00123096, 0.00203777, -0.00000109, 0.00000001],
+		[-6.21256890, -0.00202523, 0.00123025, 0.00203651, -0.00000109, 0.00000001],
+		[-6.21277687, -0.00202398, 0.00122953, 0.00203525, -0.00000109, 0.00000001],
+		[-6.21298413, -0.00202274, 0.00122881, 0.00203399, -0.00000109, 0.00000001],
+		[-6.21319067, -0.00202149, 0.00122809, 0.00203274, -0.00000109, 0.00000001],
+		[-6.21339651, -0.00202025, 0.00122738, 0.00203149, -0.00000109, 0.00000001],
+		[-6.21360164, -0.00201900, 0.00122666, 0.00203023, -0.00000109, 0.00000001],
+		[-6.21380607, -0.00201776, 0.00122595, 0.00202898, -0.00000109, 0.00000001],
+		[-6.21400979, -0.00201652, 0.00122523, 0.00202773, -0.00000109, 0.00000001],
+		[-6.21421282, -0.00201528, 0.00122452, 0.00202649, -0.00000109, 0.00000001],
+		[-6.21441515, -0.00201404, 0.00122381, 0.00202524, -0.00000109, 0.00000001],
+		[-6.21461678, -0.00201280, 0.00122310, 0.00202399, -0.00000109, 0.00000001],
+		[-6.21481773, -0.00201157, 0.00122239, 0.00202275, -0.00000109, 0.00000001],
+		[-6.21501798, -0.00201033, 0.00122167, 0.00202151, -0.00000109, 0.00000001],
+		[-6.21521754, -0.00200910, 0.00122096, 0.00202026, -0.00000109, 0.00000001],
+		[-6.21541642, -0.00200787, 0.00122026, 0.00201902, -0.00000110, 0.00000001],
+		[-6.21561461, -0.00200664, 0.00121955, 0.00201779, -0.00000110, 0.00000001],
+		[-6.21581213, -0.00200541, 0.00121884, 0.00201655, -0.00000110, 0.00000001],
+		[-6.21600896, -0.00200418, 0.00121813, 0.00201531, -0.00000110, 0.00000001],
+		[-6.21620512, -0.00200295, 0.00121742, 0.00201408, -0.00000110, 0.00000001],
+		[-6.21640060, -0.00200173, 0.00121672, 0.00201284, -0.00000110, 0.00000001],
+		[-6.21659541, -0.00200050, 0.00121601, 0.00201161, -0.00000110, 0.00000001],
+		[-6.21678955, -0.00199928, 0.00121531, 0.00201038, -0.00000110, 0.00000001],
+		[-6.21698302, -0.00199806, 0.00121460, 0.00200915, -0.00000110, 0.00000001],
+		[-6.21717583, -0.00199684, 0.00121390, 0.00200792, -0.00000110, 0.00000001],
+		[-6.21736797, -0.00199562, 0.00121320, 0.00200670, -0.00000110, 0.00000001],
+		[-6.21755945, -0.00199440, 0.00121249, 0.00200547, -0.00000110, 0.00000001],
+		[-6.21775028, -0.00199319, 0.00121179, 0.00200425, -0.00000110, 0.00000001],
+		[-6.21794044, -0.00199197, 0.00121109, 0.00200302, -0.00000110, 0.00000001],
+		[-6.21812995, -0.00199076, 0.00121039, 0.00200180, -0.00000110, 0.00000001],
+		[-6.21831881, -0.00198955, 0.00120969, 0.00200058, -0.00000110, 0.00000001],
+		[-6.21850702, -0.00198833, 0.00120899, 0.00199936, -0.00000110, 0.00000001],
+		[-6.21869457, -0.00198712, 0.00120829, 0.00199815, -0.00000110, 0.00000001],
+		[-6.21888149, -0.00198592, 0.00120759, 0.00199693, -0.00000110, 0.00000001],
+		[-6.21906775, -0.00198471, 0.00120689, 0.00199571, -0.00000110, 0.00000001],
+		[-6.21925338, -0.00198350, 0.00120620, 0.00199450, -0.00000110, 0.00000001],
+		[-6.21943836, -0.00198230, 0.00120550, 0.00199329, -0.00000110, 0.00000001],
+		[-6.21962271, -0.00198110, 0.00120481, 0.00199208, -0.00000110, 0.00000001],
+		[-6.21980642, -0.00197989, 0.00120411, 0.00199087, -0.00000110, 0.00000001],
+		[-6.21998950, -0.00197869, 0.00120342, 0.00198966, -0.00000110, 0.00000001],
+		[-6.22017194, -0.00197749, 0.00120272, 0.00198845, -0.00000110, 0.00000001],
+		[-6.22035376, -0.00197630, 0.00120203, 0.00198724, -0.00000110, 0.00000001],
+		[-6.22053495, -0.00197510, 0.00120134, 0.00198604, -0.00000110, 0.00000001],
+		[-6.22071551, -0.00197390, 0.00120064, 0.00198484, -0.00000111, 0.00000001],
+		[-6.22089545, -0.00197271, 0.00119995, 0.00198363, -0.00000111, 0.00000001],
+		[-6.22107477, -0.00197152, 0.00119926, 0.00198243, -0.00000111, 0.00000001],
+		[-6.22125347, -0.00197032, 0.00119857, 0.00198123, -0.00000111, 0.00000001],
+		[-6.22143155, -0.00196913, 0.00119788, 0.00198003, -0.00000111, 0.00000001],
+		[-6.22160902, -0.00196794, 0.00119719, 0.00197884, -0.00000111, 0.00000001],
+		[-6.22178587, -0.00196676, 0.00119650, 0.00197764, -0.00000111, 0.00000001],
+		[-6.22196211, -0.00196557, 0.00119582, 0.00197645, -0.00000111, 0.00000001],
+		[-6.22213774, -0.00196438, 0.00119513, 0.00197525, -0.00000111, 0.00000001],
+		[-6.22231277, -0.00196320, 0.00119444, 0.00197406, -0.00000111, 0.00000001],
+		[-6.22248719, -0.00196202, 0.00119376, 0.00197287, -0.00000111, 0.00000001],
+		[-6.22266101, -0.00196083, 0.00119307, 0.00197168, -0.00000111, 0.00000001],
+		[-6.22283422, -0.00195965, 0.00119239, 0.00197049, -0.00000111, 0.00000001],
+		[-6.22300684, -0.00195848, 0.00119170, 0.00196931, -0.00000111, 0.00000001],
+		[-6.22317886, -0.00195730, 0.00119102, 0.00196812, -0.00000111, 0.00000001],
+		[-6.22335028, -0.00195612, 0.00119034, 0.00196694, -0.00000111, 0.00000001],
+		[-6.22352111, -0.00195495, 0.00118965, 0.00196575, -0.00000111, 0.00000001],
+		[-6.22369135, -0.00195377, 0.00118897, 0.00196457, -0.00000111, 0.00000001],
+		[-6.22386100, -0.00195260, 0.00118829, 0.00196339, -0.00000111, 0.00000001],
+		[-6.22403007, -0.00195143, 0.00118761, 0.00196221, -0.00000111, 0.00000001],
+		[-6.22419854, -0.00195026, 0.00118693, 0.00196103, -0.00000111, 0.00000001],
+		[-6.22436644, -0.00194909, 0.00118625, 0.00195986, -0.00000111, 0.00000001],
+		[-6.22453375, -0.00194792, 0.00118557, 0.00195868, -0.00000111, 0.00000001],
+		[-6.22470048, -0.00194675, 0.00118490, 0.00195751, -0.00000111, 0.00000001],
+		[-6.22486664, -0.00194559, 0.00118422, 0.00195633, -0.00000111, 0.00000001],
+		[-6.22503222, -0.00194442, 0.00118354, 0.00195516, -0.00000111, 0.00000001],
+		[-6.22519722, -0.00194326, 0.00118287, 0.00195399, -0.00000111, 0.00000001],
+		[-6.22536166, -0.00194210, 0.00118219, 0.00195282, -0.00000111, 0.00000001],
+		[-6.22552552, -0.00194094, 0.00118152, 0.00195165, -0.00000111, 0.00000001],
+		[-6.22568881, -0.00193978, 0.00118084, 0.00195049, -0.00000111, 0.00000001],
+		[-6.22585154, -0.00193862, 0.00118017, 0.00194932, -0.00000112, 0.00000001],
+		[-6.22601370, -0.00193746, 0.00117950, 0.00194816, -0.00000112, 0.00000001],
+		[-6.22617531, -0.00193631, 0.00117882, 0.00194699, -0.00000112, 0.00000001],
+		[-6.22633635, -0.00193515, 0.00117815, 0.00194583, -0.00000112, 0.00000001],
+		[-6.22649683, -0.00193400, 0.00117748, 0.00194467, -0.00000112, 0.00000001],
+		[-6.22665675, -0.00193285, 0.00117681, 0.00194351, -0.00000112, 0.00000001],
+		[-6.22681612, -0.00193170, 0.00117614, 0.00194235, -0.00000112, 0.00000001],
+		[-6.22697494, -0.00193055, 0.00117547, 0.00194120, -0.00000112, 0.00000001],
+		[-6.22713320, -0.00192940, 0.00117480, 0.00194004, -0.00000112, 0.00000001],
+		[-6.22729092, -0.00192825, 0.00117413, 0.00193889, -0.00000112, 0.00000001],
+		[-6.22744808, -0.00192711, 0.00117346, 0.00193773, -0.00000112, 0.00000001],
+		[-6.22760470, -0.00192596, 0.00117280, 0.00193658, -0.00000112, 0.00000001],
+		[-6.22776078, -0.00192482, 0.00117213, 0.00193543, -0.00000112, 0.00000001],
+		[-6.22791631, -0.00192368, 0.00117147, 0.00193428, -0.00000112, 0.00000001],
+		[-6.22807131, -0.00192253, 0.00117080, 0.00193313, -0.00000112, 0.00000001],
+		[-6.22822576, -0.00192139, 0.00117014, 0.00193198, -0.00000112, 0.00000001],
+		[-6.22837968, -0.00192026, 0.00116947, 0.00193084, -0.00000112, 0.00000001],
+		[-6.22853306, -0.00191912, 0.00116881, 0.00192969, -0.00000112, 0.00000001],
+		[-6.22868591, -0.00191798, 0.00116815, 0.00192855, -0.00000112, 0.00000001],
+		[-6.22883823, -0.00191685, 0.00116748, 0.00192741, -0.00000112, 0.00000001],
+		[-6.22899002, -0.00191571, 0.00116682, 0.00192627, -0.00000112, 0.00000001],
+		[-6.22914128, -0.00191458, 0.00116616, 0.00192513, -0.00000112, 0.00000001],
+		[-6.22929201, -0.00191345, 0.00116550, 0.00192399, -0.00000112, 0.00000001],
+		[-6.22944222, -0.00191232, 0.00116484, 0.00192285, -0.00000112, 0.00000001],
+		[-6.22959190, -0.00191119, 0.00116418, 0.00192171, -0.00000112, 0.00000001],
+		[-6.22974107, -0.00191006, 0.00116352, 0.00192058, -0.00000112, 0.00000001],
+		[-6.22988971, -0.00190893, 0.00116286, 0.00191944, -0.00000112, 0.00000001],
+		[-6.23003784, -0.00190781, 0.00116221, 0.00191831, -0.00000112, 0.00000001],
+		[-6.23018545, -0.00190669, 0.00116155, 0.00191718, -0.00000112, 0.00000001],
+		[-6.23033255, -0.00190556, 0.00116089, 0.00191605, -0.00000112, 0.00000001],
+		[-6.23047913, -0.00190444, 0.00116024, 0.00191492, -0.00000112, 0.00000001],
+		[-6.23062521, -0.00190332, 0.00115958, 0.00191379, -0.00000112, 0.00000001],
+		[-6.23077077, -0.00190220, 0.00115893, 0.00191267, -0.00000112, 0.00000001],
+		[-6.23091583, -0.00190108, 0.00115828, 0.00191154, -0.00000112, 0.00000001],
+		[-6.23106038, -0.00189996, 0.00115762, 0.00191042, -0.00000113, 0.00000001],
+		[-6.23120443, -0.00189885, 0.00115697, 0.00190929, -0.00000113, 0.00000001],
+		[-6.23134798, -0.00189773, 0.00115632, 0.00190817, -0.00000113, 0.00000001],
+		[-6.23149102, -0.00189662, 0.00115567, 0.00190705, -0.00000113, 0.00000001],
+		[-6.23163357, -0.00189551, 0.00115501, 0.00190593, -0.00000113, 0.00000001],
+		[-6.23177562, -0.00189439, 0.00115436, 0.00190481, -0.00000113, 0.00000001],
+		[-6.23191717, -0.00189328, 0.00115371, 0.00190369, -0.00000113, 0.00000001],
+		[-6.23205823, -0.00189218, 0.00115307, 0.00190258, -0.00000113, 0.00000001],
+		[-6.23219880, -0.00189107, 0.00115242, 0.00190146, -0.00000113, 0.00000001],
+		[-6.23233888, -0.00188996, 0.00115177, 0.00190035, -0.00000113, 0.00000001],
+		[-6.23247846, -0.00188886, 0.00115112, 0.00189924, -0.00000113, 0.00000001],
+		[-6.23261756, -0.00188775, 0.00115047, 0.00189812, -0.00000113, 0.00000001],
+		[-6.23275618, -0.00188665, 0.00114983, 0.00189701, -0.00000113, 0.00000001],
+		[-6.23289431, -0.00188555, 0.00114918, 0.00189591, -0.00000113, 0.00000001],
+		[-6.23303196, -0.00188444, 0.00114854, 0.00189480, -0.00000113, 0.00000001],
+		[-6.23316912, -0.00188334, 0.00114789, 0.00189369, -0.00000113, 0.00000001],
+		[-6.23330581, -0.00188225, 0.00114725, 0.00189258, -0.00000113, 0.00000001],
+		[-6.23344202, -0.00188115, 0.00114661, 0.00189148, -0.00000113, 0.00000001],
+		[-6.23357776, -0.00188005, 0.00114596, 0.00189038, -0.00000113, 0.00000001],
+		[-6.23371302, -0.00187896, 0.00114532, 0.00188927, -0.00000113, 0.00000001],
+		[-6.23384781, -0.00187786, 0.00114468, 0.00188817, -0.00000113, 0.00000001],
+		[-6.23398212, -0.00187677, 0.00114404, 0.00188707, -0.00000113, 0.00000001],
+		[-6.23411597, -0.00187568, 0.00114340, 0.00188598, -0.00000113, 0.00000001],
+		[-6.23424935, -0.00187459, 0.00114276, 0.00188488, -0.00000113, 0.00000001],
+		[-6.23438226, -0.00187350, 0.00114212, 0.00188378, -0.00000113, 0.00000001],
+		[-6.23451471, -0.00187241, 0.00114148, 0.00188269, -0.00000113, 0.00000001],
+		[-6.23464669, -0.00187132, 0.00114084, 0.00188159, -0.00000113, 0.00000001],
+		[-6.23477821, -0.00187024, 0.00114021, 0.00188050, -0.00000113, 0.00000001],
+		[-6.23490927, -0.00186915, 0.00113957, 0.00187941, -0.00000113, 0.00000001],
+		[-6.23503988, -0.00186807, 0.00113893, 0.00187832, -0.00000113, 0.00000001],
+		[-6.23517002, -0.00186698, 0.00113830, 0.00187723, -0.00000113, 0.00000001],
+		[-6.23529971, -0.00186590, 0.00113766, 0.00187614, -0.00000113, 0.00000001],
+		[-6.23542895, -0.00186482, 0.00113703, 0.00187505, -0.00000113, 0.00000001],
+		[-6.23555773, -0.00186374, 0.00113639, 0.00187396, -0.00000113, 0.00000001],
+		[-6.23568606, -0.00186267, 0.00113576, 0.00187288, -0.00000113, 0.00000001],
+		[-6.23581395, -0.00186159, 0.00113513, 0.00187180, -0.00000113, 0.00000001],
+		[-6.23594138, -0.00186051, 0.00113449, 0.00187071, -0.00000113, 0.00000001],
+		[-6.23606837, -0.00185944, 0.00113386, 0.00186963, -0.00000113, 0.00000001],
+		[-6.23619491, -0.00185836, 0.00113323, 0.00186855, -0.00000113, 0.00000001],
+		[-6.23632102, -0.00185729, 0.00113260, 0.00186747, -0.00000113, 0.00000001],
+		[-6.23644667, -0.00185622, 0.00113197, 0.00186639, -0.00000114, 0.00000001],
+		[-6.23657189, -0.00185515, 0.00113134, 0.00186532, -0.00000114, 0.00000001],
+		[-6.23669667, -0.00185408, 0.00113071, 0.00186424, -0.00000114, 0.00000001],
+		[-6.23682101, -0.00185301, 0.00113009, 0.00186317, -0.00000114, 0.00000001],
+		[-6.23694492, -0.00185195, 0.00112946, 0.00186209, -0.00000114, 0.00000001],
+		[-6.23706839, -0.00185088, 0.00112883, 0.00186102, -0.00000114, 0.00000001],
+		[-6.23719143, -0.00184981, 0.00112820, 0.00185995, -0.00000114, 0.00000001],
+		[-6.23731403, -0.00184875, 0.00112758, 0.00185888, -0.00000114, 0.00000001],
+		[-6.23743621, -0.00184769, 0.00112695, 0.00185781, -0.00000114, 0.00000001],
+		[-6.23755795, -0.00184663, 0.00112633, 0.00185674, -0.00000114, 0.00000001],
+		[-6.23767927, -0.00184557, 0.00112570, 0.00185567, -0.00000114, 0.00000001],
+		[-6.23780017, -0.00184451, 0.00112508, 0.00185461, -0.00000114, 0.00000001],
+		[-6.23792064, -0.00184345, 0.00112446, 0.00185354, -0.00000114, 0.00000001],
+		[-6.23804068, -0.00184239, 0.00112383, 0.00185248, -0.00000114, 0.00000001],
+		[-6.23816031, -0.00184134, 0.00112321, 0.00185142, -0.00000114, 0.00000001],
+		[-6.23827952, -0.00184028, 0.00112259, 0.00185035, -0.00000114, 0.00000001],
+		[-6.23839830, -0.00183923, 0.00112197, 0.00184929, -0.00000114, 0.00000001],
+		[-6.23851667, -0.00183817, 0.00112135, 0.00184823, -0.00000114, 0.00000001],
+		[-6.23863462, -0.00183712, 0.00112073, 0.00184718, -0.00000114, 0.00000001],
+		[-6.23875216, -0.00183607, 0.00112011, 0.00184612, -0.00000114, 0.00000001],
+		[-6.23886929, -0.00183502, 0.00111949, 0.00184506, -0.00000114, 0.00000001],
+		[-6.23898600, -0.00183398, 0.00111887, 0.00184401, -0.00000114, 0.00000001],
+		[-6.23910231, -0.00183293, 0.00111826, 0.00184295, -0.00000114, 0.00000001],
+		[-6.23921820, -0.00183188, 0.00111764, 0.00184190, -0.00000114, 0.00000001],
+		[-6.23933369, -0.00183084, 0.00111702, 0.00184085, -0.00000114, 0.00000001],
+		[-6.23944877, -0.00182979, 0.00111641, 0.00183980, -0.00000114, 0.00000001],
+		[-6.23956345, -0.00182875, 0.00111579, 0.00183875, -0.00000114, 0.00000001],
+		[-6.23967773, -0.00182771, 0.00111518, 0.00183770, -0.00000114, 0.00000001],
+		[-6.23979160, -0.00182667, 0.00111456, 0.00183665, -0.00000114, 0.00000001],
+		[-6.23990507, -0.00182563, 0.00111395, 0.00183561, -0.00000114, 0.00000001],
+		[-6.24001814, -0.00182459, 0.00111334, 0.00183456, -0.00000114, 0.00000001],
+		[-6.24013082, -0.00182355, 0.00111273, 0.00183352, -0.00000114, 0.00000001],
+		[-6.24024309, -0.00182251, 0.00111211, 0.00183248, -0.00000114, 0.00000001],
+		[-6.24035498, -0.00182148, 0.00111150, 0.00183143, -0.00000114, 0.00000001],
+		[-6.24046647, -0.00182045, 0.00111089, 0.00183039, -0.00000114, 0.00000001],
+		[-6.24057756, -0.00181941, 0.00111028, 0.00182935, -0.00000114, 0.00000001],
+		[-6.24068827, -0.00181838, 0.00110967, 0.00182831, -0.00000114, 0.00000001],
+		[-6.24079858, -0.00181735, 0.00110906, 0.00182728, -0.00000114, 0.00000001],
+		[-6.24090851, -0.00181632, 0.00110846, 0.00182624, -0.00000114, 0.00000001],
+		[-6.24101805, -0.00181529, 0.00110785, 0.00182521, -0.00000114, 0.00000001],
+		[-6.24112720, -0.00181426, 0.00110724, 0.00182417, -0.00000114, 0.00000001],
+		[-6.24123597, -0.00181324, 0.00110663, 0.00182314, -0.00000114, 0.00000001],
+		[-6.24134436, -0.00181221, 0.00110603, 0.00182211, -0.00000114, 0.00000001],
+		[-6.24145237, -0.00181118, 0.00110542, 0.00182107, -0.00000114, 0.00000001],
+		[-6.24155999, -0.00181016, 0.00110482, 0.00182004, -0.00000114, 0.00000001],
+		[-6.24166723, -0.00180914, 0.00110421, 0.00181902, -0.00000114, 0.00000001],
+		[-6.24177410, -0.00180812, 0.00110361, 0.00181799, -0.00000114, 0.00000001],
+		[-6.24188059, -0.00180710, 0.00110300, 0.00181696, -0.00000115, 0.00000001],
+		[-6.24198671, -0.00180608, 0.00110240, 0.00181593, -0.00000115, 0.00000001],
+		[-6.24209245, -0.00180506, 0.00110180, 0.00181491, -0.00000115, 0.00000001],
+		[-6.24219781, -0.00180404, 0.00110120, 0.00181389, -0.00000115, 0.00000001],
+		[-6.24230281, -0.00180302, 0.00110060, 0.00181286, -0.00000115, 0.00000001],
+		[-6.24240743, -0.00180201, 0.00110000, 0.00181184, -0.00000115, 0.00000001],
+		[-6.24251169, -0.00180100, 0.00109940, 0.00181082, -0.00000115, 0.00000001],
+		[-6.24261558, -0.00179998, 0.00109880, 0.00180980, -0.00000115, 0.00000001],
+		[-6.24271910, -0.00179897, 0.00109820, 0.00180878, -0.00000115, 0.00000001],
+		[-6.24282226, -0.00179796, 0.00109760, 0.00180777, -0.00000115, 0.00000001],
+		[-6.24292505, -0.00179695, 0.00109700, 0.00180675, -0.00000115, 0.00000001],
+		[-6.24302748, -0.00179594, 0.00109640, 0.00180573, -0.00000115, 0.00000001],
+		[-6.24312955, -0.00179493, 0.00109581, 0.00180472, -0.00000115, 0.00000001],
+		[-6.24323126, -0.00179392, 0.00109521, 0.00180371, -0.00000115, 0.00000001],
+		[-6.24333261, -0.00179292, 0.00109461, 0.00180269, -0.00000115, 0.00000001],
+		[-6.24343360, -0.00179191, 0.00109402, 0.00180168, -0.00000115, 0.00000001],
+		[-6.24353423, -0.00179091, 0.00109342, 0.00180067, -0.00000115, 0.00000001],
+		[-6.24363451, -0.00178991, 0.00109283, 0.00179966, -0.00000115, 0.00000001],
+		[-6.24373444, -0.00178891, 0.00109224, 0.00179866, -0.00000115, 0.00000001],
+		[-6.24383401, -0.00178790, 0.00109164, 0.00179765, -0.00000115, 0.00000001],
+		[-6.24393323, -0.00178690, 0.00109105, 0.00179664, -0.00000115, 0.00000001],
+		[-6.24403210, -0.00178591, 0.00109046, 0.00179564, -0.00000115, 0.00000001],
+		[-6.24413062, -0.00178491, 0.00108987, 0.00179463, -0.00000115, 0.00000001],
+		[-6.24422879, -0.00178391, 0.00108928, 0.00179363, -0.00000115, 0.00000001],
+		[-6.24432661, -0.00178292, 0.00108869, 0.00179263, -0.00000115, 0.00000001],
+		[-6.24442409, -0.00178192, 0.00108810, 0.00179163, -0.00000115, 0.00000001],
+		[-6.24452123, -0.00178093, 0.00108751, 0.00179063, -0.00000115, 0.00000000],
+		[-6.24461802, -0.00177993, 0.00108692, 0.00178963, -0.00000115, 0.00000000],
+		[-6.24471446, -0.00177894, 0.00108633, 0.00178863, -0.00000115, 0.00000000],
+		[-6.24481057, -0.00177795, 0.00108574, 0.00178764, -0.00000115, 0.00000000],
+		[-6.24490634, -0.00177696, 0.00108516, 0.00178664, -0.00000115, 0.00000000],
+		[-6.24500177, -0.00177597, 0.00108457, 0.00178565, -0.00000115, 0.00000000],
+		[-6.24509686, -0.00177499, 0.00108398, 0.00178465, -0.00000115, 0.00000000],
+		[-6.24519161, -0.00177400, 0.00108340, 0.00178366, -0.00000115, 0.00000000],
+		[-6.24528603, -0.00177301, 0.00108281, 0.00178267, -0.00000115, 0.00000000],
+		[-6.24538012, -0.00177203, 0.00108223, 0.00178168, -0.00000115, 0.00000000],
+		[-6.24547387, -0.00177105, 0.00108164, 0.00178069, -0.00000115, 0.00000000],
+		[-6.24556729, -0.00177006, 0.00108106, 0.00177970, -0.00000115, 0.00000000],
+		[-6.24566038, -0.00176908, 0.00108048, 0.00177871, -0.00000115, 0.00000000],
+		[-6.24575314, -0.00176810, 0.00107990, 0.00177772, -0.00000115, 0.00000000],
+		[-6.24584557, -0.00176712, 0.00107931, 0.00177674, -0.00000115, 0.00000000],
+		[-6.24593768, -0.00176614, 0.00107873, 0.00177575, -0.00000115, 0.00000000],
+		[-6.24602946, -0.00176517, 0.00107815, 0.00177477, -0.00000115, 0.00000000],
+		[-6.24612091, -0.00176419, 0.00107757, 0.00177379, -0.00000115, 0.00000000],
+		[-6.24621204, -0.00176321, 0.00107699, 0.00177281, -0.00000115, 0.00000000],
+		[-6.24630285, -0.00176224, 0.00107641, 0.00177183, -0.00000115, 0.00000000],
+		[-6.24639333, -0.00176127, 0.00107584, 0.00177085, -0.00000115, 0.00000000],
+		[-6.24648350, -0.00176029, 0.00107526, 0.00176987, -0.00000115, 0.00000000],
+		[-6.24657334, -0.00175932, 0.00107468, 0.00176889, -0.00000115, 0.00000000],
+		[-6.24666287, -0.00175835, 0.00107410, 0.00176791, -0.00000115, 0.00000000],
+		[-6.24675208, -0.00175738, 0.00107353, 0.00176694, -0.00000115, 0.00000000],
+		[-6.24684097, -0.00175641, 0.00107295, 0.00176596, -0.00000115, 0.00000000],
+		[-6.24692955, -0.00175545, 0.00107238, 0.00176499, -0.00000115, 0.00000000],
+		[-6.24701781, -0.00175448, 0.00107180, 0.00176402, -0.00000115, 0.00000000],
+		[-6.24710576, -0.00175351, 0.00107123, 0.00176305, -0.00000115, 0.00000000],
+		[-6.24719340, -0.00175255, 0.00107065, 0.00176207, -0.00000115, 0.00000000],
+		[-6.24728073, -0.00175158, 0.00107008, 0.00176110, -0.00000115, 0.00000000],
+		[-6.24736775, -0.00175062, 0.00106951, 0.00176014, -0.00000115, 0.00000000],
+		[-6.24745446, -0.00174966, 0.00106893, 0.00175917, -0.00000115, 0.00000000],
+		[-6.24754086, -0.00174870, 0.00106836, 0.00175820, -0.00000115, 0.00000000],
+		[-6.24762695, -0.00174774, 0.00106779, 0.00175724, -0.00000116, 0.00000000],
+		[-6.24771274, -0.00174678, 0.00106722, 0.00175627, -0.00000116, 0.00000000],
+		[-6.24779823, -0.00174582, 0.00106665, 0.00175531, -0.00000116, 0.00000000],
+		[-6.24788341, -0.00174487, 0.00106608, 0.00175434, -0.00000116, 0.00000000],
+		[-6.24796829, -0.00174391, 0.00106551, 0.00175338, -0.00000116, 0.00000000],
+		[-6.24805287, -0.00174296, 0.00106494, 0.00175242, -0.00000116, 0.00000000],
+		[-6.24813715, -0.00174200, 0.00106438, 0.00175146, -0.00000116, 0.00000000],
+		[-6.24822113, -0.00174105, 0.00106381, 0.00175050, -0.00000116, 0.00000000],
+		[-6.24830481, -0.00174010, 0.00106324, 0.00174955, -0.00000116, 0.00000000],
+		[-6.24838819, -0.00173915, 0.00106267, 0.00174859, -0.00000116, 0.00000000],
+		[-6.24847128, -0.00173819, 0.00106211, 0.00174763, -0.00000116, 0.00000000],
+		[-6.24855407, -0.00173725, 0.00106154, 0.00174668, -0.00000116, 0.00000000],
+		[-6.24863657, -0.00173630, 0.00106098, 0.00174572, -0.00000116, 0.00000000],
+		[-6.24871878, -0.00173535, 0.00106041, 0.00174477, -0.00000116, 0.00000000],
+		[-6.24880069, -0.00173440, 0.00105985, 0.00174382, -0.00000116, 0.00000000],
+		[-6.24888231, -0.00173346, 0.00105929, 0.00174287, -0.00000116, 0.00000000],
+		[-6.24896365, -0.00173251, 0.00105872, 0.00174192, -0.00000116, 0.00000000],
+		[-6.24904469, -0.00173157, 0.00105816, 0.00174097, -0.00000116, 0.00000000],
+		[-6.24912545, -0.00173063, 0.00105760, 0.00174002, -0.00000116, 0.00000000],
+		[-6.24920591, -0.00172969, 0.00105704, 0.00173907, -0.00000116, 0.00000000],
+		[-6.24928610, -0.00172875, 0.00105648, 0.00173813, -0.00000116, 0.00000000],
+		[-6.24936599, -0.00172781, 0.00105592, 0.00173718, -0.00000116, 0.00000000],
+		[-6.24944561, -0.00172687, 0.00105536, 0.00173624, -0.00000116, 0.00000000],
+		[-6.24952494, -0.00172593, 0.00105480, 0.00173529, -0.00000116, 0.00000000],
+		[-6.24960399, -0.00172499, 0.00105424, 0.00173435, -0.00000116, 0.00000000],
+		[-6.24968275, -0.00172406, 0.00105368, 0.00173341, -0.00000116, 0.00000000],
+		[-6.24976124, -0.00172312, 0.00105312, 0.00173247, -0.00000116, 0.00000000],
+		[-6.24983945, -0.00172219, 0.00105257, 0.00173153, -0.00000116, 0.00000000],
+		[-6.24991738, -0.00172126, 0.00105201, 0.00173059, -0.00000116, 0.00000000],
+		[-6.24999503, -0.00172032, 0.00105145, 0.00172965, -0.00000116, 0.00000000],
+		[-6.25007241, -0.00171939, 0.00105090, 0.00172871, -0.00000116, 0.00000000],
+		[-6.25014951, -0.00171846, 0.00105034, 0.00172778, -0.00000116, 0.00000000],
+		[-6.25022634, -0.00171753, 0.00104979, 0.00172684, -0.00000116, 0.00000000],
+		[-6.25030289, -0.00171660, 0.00104923, 0.00172591, -0.00000116, 0.00000000],
+		[-6.25037917, -0.00171568, 0.00104868, 0.00172498, -0.00000116, 0.00000000],
+		[-6.25045518, -0.00171475, 0.00104813, 0.00172404, -0.00000116, 0.00000000],
+		[-6.25053092, -0.00171382, 0.00104758, 0.00172311, -0.00000116, 0.00000000],
+		[-6.25060639, -0.00171290, 0.00104702, 0.00172218, -0.00000116, 0.00000000],
+		[-6.25068159, -0.00171198, 0.00104647, 0.00172125, -0.00000116, 0.00000000],
+		[-6.25075652, -0.00171105, 0.00104592, 0.00172032, -0.00000116, 0.00000000],
+		[-6.25083119, -0.00171013, 0.00104537, 0.00171940, -0.00000116, 0.00000000],
+		[-6.25090559, -0.00170921, 0.00104482, 0.00171847, -0.00000116, 0.00000000],
+		[-6.25097972, -0.00170829, 0.00104427, 0.00171754, -0.00000116, 0.00000000],
+		[-6.25105359, -0.00170737, 0.00104372, 0.00171662, -0.00000116, 0.00000000],
+		[-6.25112720, -0.00170645, 0.00104317, 0.00171570, -0.00000116, 0.00000000],
+		[-6.25120055, -0.00170554, 0.00104262, 0.00171477, -0.00000116, 0.00000000],
+		[-6.25127363, -0.00170462, 0.00104208, 0.00171385, -0.00000116, 0.00000000],
+		[-6.25134646, -0.00170370, 0.00104153, 0.00171293, -0.00000116, 0.00000000],
+		[-6.25141902, -0.00170279, 0.00104098, 0.00171201, -0.00000116, 0.00000000],
+		[-6.25149133, -0.00170188, 0.00104044, 0.00171109, -0.00000116, 0.00000000],
+		[-6.25156338, -0.00170096, 0.00103989, 0.00171017, -0.00000116, 0.00000000],
+		[-6.25163517, -0.00170005, 0.00103935, 0.00170926, -0.00000116, 0.00000000],
+		[-6.25170670, -0.00169914, 0.00103880, 0.00170834, -0.00000116, 0.00000000],
+		[-6.25177798, -0.00169823, 0.00103826, 0.00170742, -0.00000116, 0.00000000],
+		[-6.25184901, -0.00169732, 0.00103771, 0.00170651, -0.00000116, 0.00000000],
+		[-6.25191978, -0.00169641, 0.00103717, 0.00170560, -0.00000116, 0.00000000],
+		[-6.25199031, -0.00169551, 0.00103663, 0.00170468, -0.00000116, 0.00000000],
+		[-6.25206057, -0.00169460, 0.00103609, 0.00170377, -0.00000116, 0.00000000],
+		[-6.25213059, -0.00169369, 0.00103555, 0.00170286, -0.00000116, 0.00000000],
+		[-6.25220036, -0.00169279, 0.00103500, 0.00170195, -0.00000116, 0.00000000],
+		[-6.25226988, -0.00169189, 0.00103446, 0.00170104, -0.00000116, 0.00000000],
+		[-6.25233916, -0.00169098, 0.00103392, 0.00170013, -0.00000116, 0.00000000],
+		[-6.25240818, -0.00169008, 0.00103338, 0.00169923, -0.00000116, 0.00000000],
+		[-6.25247696, -0.00168918, 0.00103285, 0.00169832, -0.00000116, 0.00000000],
+		[-6.25254550, -0.00168828, 0.00103231, 0.00169741, -0.00000116, 0.00000000],
+		[-6.25261379, -0.00168738, 0.00103177, 0.00169651, -0.00000116, 0.00000000],
+		[-6.25268183, -0.00168648, 0.00103123, 0.00169560, -0.00000116, 0.00000000],
+		[-6.25274963, -0.00168559, 0.00103069, 0.00169470, -0.00000116, 0.00000000],
+		[-6.25281720, -0.00168469, 0.00103016, 0.00169380, -0.00000116, 0.00000000],
+		[-6.25288452, -0.00168379, 0.00102962, 0.00169290, -0.00000116, 0.00000000],
+		[-6.25295160, -0.00168290, 0.00102909, 0.00169200, -0.00000116, 0.00000000],
+		[-6.25301844, -0.00168200, 0.00102855, 0.00169110, -0.00000116, 0.00000000],
+		[-6.25308504, -0.00168111, 0.00102802, 0.00169020, -0.00000116, 0.00000000],
+		[-6.25315140, -0.00168022, 0.00102748, 0.00168930, -0.00000116, 0.00000000],
+		[-6.25321753, -0.00167933, 0.00102695, 0.00168841, -0.00000116, 0.00000000],
+		[-6.25328342, -0.00167844, 0.00102641, 0.00168751, -0.00000116, 0.00000000],
+		[-6.25334907, -0.00167755, 0.00102588, 0.00168662, -0.00000116, 0.00000000],
+		[-6.25341450, -0.00167666, 0.00102535, 0.00168572, -0.00000116, 0.00000000],
+		[-6.25347968, -0.00167577, 0.00102482, 0.00168483, -0.00000116, 0.00000000],
+		[-6.25354464, -0.00167489, 0.00102429, 0.00168394, -0.00000116, 0.00000000],
+		[-6.25360936, -0.00167400, 0.00102376, 0.00168305, -0.00000116, 0.00000000],
+		[-6.25367385, -0.00167312, 0.00102323, 0.00168216, -0.00000116, 0.00000000],
+		[-6.25373811, -0.00167223, 0.00102270, 0.00168127, -0.00000116, 0.00000000],
+		[-6.25380215, -0.00167135, 0.00102217, 0.00168038, -0.00000116, 0.00000000],
+		[-6.25386595, -0.00167047, 0.00102164, 0.00167949, -0.00000117, 0.00000000],
+		[-6.25392952, -0.00166958, 0.00102111, 0.00167860, -0.00000117, 0.00000000],
+		[-6.25399287, -0.00166870, 0.00102058, 0.00167772, -0.00000117, 0.00000000],
+		[-6.25405599, -0.00166782, 0.00102005, 0.00167683, -0.00000117, 0.00000000],
+		[-6.25411889, -0.00166694, 0.00101953, 0.00167595, -0.00000117, 0.00000000],
+		[-6.25418156, -0.00166607, 0.00101900, 0.00167507, -0.00000117, 0.00000000],
+		[-6.25424401, -0.00166519, 0.00101847, 0.00167418, -0.00000117, 0.00000000],
+		[-6.25430623, -0.00166431, 0.00101795, 0.00167330, -0.00000117, 0.00000000],
+		[-6.25436823, -0.00166344, 0.00101742, 0.00167242, -0.00000117, 0.00000000],
+		[-6.25443001, -0.00166256, 0.00101690, 0.00167154, -0.00000117, 0.00000000],
+		[-6.25449157, -0.00166169, 0.00101638, 0.00167066, -0.00000117, 0.00000000],
+		[-6.25455291, -0.00166082, 0.00101585, 0.00166978, -0.00000117, 0.00000000],
+		[-6.25461403, -0.00165994, 0.00101533, 0.00166891, -0.00000117, 0.00000000],
+		[-6.25467493, -0.00165907, 0.00101481, 0.00166803, -0.00000117, 0.00000000],
+		[-6.25473561, -0.00165820, 0.00101428, 0.00166715, -0.00000117, 0.00000000],
+		[-6.25479608, -0.00165733, 0.00101376, 0.00166628, -0.00000117, 0.00000000],
+		[-6.25485633, -0.00165647, 0.00101324, 0.00166541, -0.00000117, 0.00000000],
+		[-6.25491636, -0.00165560, 0.00101272, 0.00166453, -0.00000117, 0.00000000],
+		[-6.25497618, -0.00165473, 0.00101220, 0.00166366, -0.00000117, 0.00000000],
+		[-6.25503579, -0.00165386, 0.00101168, 0.00166279, -0.00000117, 0.00000000],
+		[-6.25509518, -0.00165300, 0.00101116, 0.00166192, -0.00000117, 0.00000000],
+		[-6.25515436, -0.00165214, 0.00101064, 0.00166105, -0.00000117, 0.00000000],
+		[-6.25521333, -0.00165127, 0.00101012, 0.00166018, -0.00000117, 0.00000000],
+		[-6.25527209, -0.00165041, 0.00100961, 0.00165931, -0.00000117, 0.00000000],
+		[-6.25533063, -0.00164955, 0.00100909, 0.00165845, -0.00000117, 0.00000000],
+		[-6.25538897, -0.00164869, 0.00100857, 0.00165758, -0.00000117, 0.00000000],
+		[-6.25544710, -0.00164783, 0.00100806, 0.00165672, -0.00000117, 0.00000000],
+		[-6.25550502, -0.00164697, 0.00100754, 0.00165585, -0.00000117, 0.00000000],
+		[-6.25556273, -0.00164611, 0.00100702, 0.00165499, -0.00000117, 0.00000000],
+		[-6.25562024, -0.00164525, 0.00100651, 0.00165413, -0.00000117, 0.00000000],
+		[-6.25567754, -0.00164440, 0.00100599, 0.00165326, -0.00000117, 0.00000000],
+		[-6.25573464, -0.00164354, 0.00100548, 0.00165240, -0.00000117, 0.00000000],
+		[-6.25579153, -0.00164268, 0.00100497, 0.00165154, -0.00000117, 0.00000000],
+		[-6.25584821, -0.00164183, 0.00100445, 0.00165068, -0.00000117, 0.00000000],
+		[-6.25590470, -0.00164098, 0.00100394, 0.00164982, -0.00000117, 0.00000000],
+		[-6.25596098, -0.00164012, 0.00100343, 0.00164897, -0.00000117, 0.00000000],
+		[-6.25601706, -0.00163927, 0.00100292, 0.00164811, -0.00000117, 0.00000000],
+		[-6.25607294, -0.00163842, 0.00100241, 0.00164725, -0.00000117, 0.00000000],
+		[-6.25612862, -0.00163757, 0.00100189, 0.00164640, -0.00000117, 0.00000000],
+		[-6.25618410, -0.00163672, 0.00100138, 0.00164554, -0.00000117, 0.00000000],
+		[-6.25623938, -0.00163587, 0.00100087, 0.00164469, -0.00000117, 0.00000000],
+		[-6.25629447, -0.00163503, 0.00100036, 0.00164384, -0.00000117, 0.00000000],
+		[-6.25634936, -0.00163418, 0.00099986, 0.00164299, -0.00000117, 0.00000000],
+		[-6.25640405, -0.00163333, 0.00099935, 0.00164214, -0.00000117, 0.00000000],
+		[-6.25645854, -0.00163249, 0.00099884, 0.00164129, -0.00000117, 0.00000000],
+		[-6.25651284, -0.00163164, 0.00099833, 0.00164044, -0.00000117, 0.00000000],
+		[-6.25656694, -0.00163080, 0.00099782, 0.00163959, -0.00000117, 0.00000000],
+		[-6.25662085, -0.00162996, 0.00099732, 0.00163874, -0.00000117, 0.00000000],
+		[-6.25667457, -0.00162912, 0.00099681, 0.00163789, -0.00000117, 0.00000000],
+		[-6.25672809, -0.00162828, 0.00099631, 0.00163705, -0.00000117, 0.00000000],
+		[-6.25678143, -0.00162744, 0.00099580, 0.00163620, -0.00000117, 0.00000000],
+		[-6.25683457, -0.00162660, 0.00099530, 0.00163536, -0.00000117, 0.00000000],
+		[-6.25688752, -0.00162576, 0.00099479, 0.00163451, -0.00000117, 0.00000000],
+		[-6.25694028, -0.00162492, 0.00099429, 0.00163367, -0.00000117, 0.00000000],
+		[-6.25699285, -0.00162408, 0.00099378, 0.00163283, -0.00000117, 0.00000000],
+		[-6.25704524, -0.00162325, 0.00099328, 0.00163199, -0.00000117, 0.00000000],
+		[-6.25709743, -0.00162241, 0.00099278, 0.00163115, -0.00000117, 0.00000000],
+		[-6.25714944, -0.00162158, 0.00099228, 0.00163031, -0.00000117, 0.00000000],
+		[-6.25720127, -0.00162074, 0.00099177, 0.00162947, -0.00000117, 0.00000000],
+		[-6.25725290, -0.00161991, 0.00099127, 0.00162863, -0.00000117, 0.00000000],
+		[-6.25730435, -0.00161908, 0.00099077, 0.00162780, -0.00000117, 0.00000000],
+		[-6.25735562, -0.00161825, 0.00099027, 0.00162696, -0.00000117, 0.00000000],
+		[-6.25740670, -0.00161742, 0.00098977, 0.00162613, -0.00000117, 0.00000000],
+		[-6.25745761, -0.00161659, 0.00098927, 0.00162529, -0.00000117, 0.00000000],
+		[-6.25750832, -0.00161576, 0.00098877, 0.00162446, -0.00000117, 0.00000000],
+		[-6.25755886, -0.00161493, 0.00098828, 0.00162362, -0.00000117, 0.00000000],
+		[-6.25760921, -0.00161411, 0.00098778, 0.00162279, -0.00000117, 0.00000000],
+		[-6.25765939, -0.00161328, 0.00098728, 0.00162196, -0.00000117, 0.00000000],
+		[-6.25770938, -0.00161245, 0.00098678, 0.00162113, -0.00000117, 0.00000000],
+		[-6.25775920, -0.00161163, 0.00098629, 0.00162030, -0.00000117, 0.00000000],
+		[-6.25780883, -0.00161080, 0.00098579, 0.00161947, -0.00000117, 0.00000000],
+		[-6.25785829, -0.00160998, 0.00098529, 0.00161864, -0.00000117, 0.00000000],
+		[-6.25790757, -0.00160916, 0.00098480, 0.00161782, -0.00000117, 0.00000000],
+		[-6.25795667, -0.00160834, 0.00098430, 0.00161699, -0.00000117, 0.00000000],
+		[-6.25800560, -0.00160752, 0.00098381, 0.00161616, -0.00000117, 0.00000000],
+		[-6.25805435, -0.00160670, 0.00098332, 0.00161534, -0.00000117, 0.00000000],
+		[-6.25810293, -0.00160588, 0.00098282, 0.00161452, -0.00000117, 0.00000000],
+		[-6.25815133, -0.00160506, 0.00098233, 0.00161369, -0.00000117, 0.00000000],
+		[-6.25819956, -0.00160424, 0.00098184, 0.00161287, -0.00000117, 0.00000000],
+		[-6.25824762, -0.00160342, 0.00098134, 0.00161205, -0.00000117, 0.00000000],
+		[-6.25829550, -0.00160261, 0.00098085, 0.00161123, -0.00000117, 0.00000000],
+		[-6.25834321, -0.00160179, 0.00098036, 0.00161041, -0.00000117, 0.00000000],
+		[-6.25839075, -0.00160098, 0.00097987, 0.00160959, -0.00000117, 0.00000000],
+		[-6.25843812, -0.00160017, 0.00097938, 0.00160877, -0.00000117, 0.00000000],
+		[-6.25848532, -0.00159935, 0.00097889, 0.00160795, -0.00000117, 0.00000000],
+		[-6.25853235, -0.00159854, 0.00097840, 0.00160713, -0.00000117, 0.00000000],
+		[-6.25857922, -0.00159773, 0.00097791, 0.00160632, -0.00000117, 0.00000000],
+		[-6.25862591, -0.00159692, 0.00097742, 0.00160550, -0.00000117, 0.00000000],
+		[-6.25867244, -0.00159611, 0.00097693, 0.00160469, -0.00000117, 0.00000000],
+		[-6.25871879, -0.00159530, 0.00097645, 0.00160387, -0.00000117, 0.00000000],
+		[-6.25876499, -0.00159449, 0.00097596, 0.00160306, -0.00000117, 0.00000000],
+		[-6.25881101, -0.00159368, 0.00097547, 0.00160225, -0.00000117, 0.00000000],
+		[-6.25885688, -0.00159288, 0.00097499, 0.00160144, -0.00000117, 0.00000000],
+		[-6.25890257, -0.00159207, 0.00097450, 0.00160063, -0.00000117, 0.00000000],
+		[-6.25894810, -0.00159127, 0.00097402, 0.00159982, -0.00000117, 0.00000000],
+		[-6.25899347, -0.00159046, 0.00097353, 0.00159901, -0.00000117, 0.00000000],
+		[-6.25903868, -0.00158966, 0.00097305, 0.00159820, -0.00000117, 0.00000000],
+		[-6.25908372, -0.00158886, 0.00097256, 0.00159739, -0.00000117, 0.00000000],
+		[-6.25912861, -0.00158805, 0.00097208, 0.00159659, -0.00000117, 0.00000000],
+		[-6.25917333, -0.00158725, 0.00097159, 0.00159578, -0.00000117, 0.00000000],
+		[-6.25921789, -0.00158645, 0.00097111, 0.00159497, -0.00000117, 0.00000000],
+		[-6.25926229, -0.00158565, 0.00097063, 0.00159417, -0.00000117, 0.00000000],
+		[-6.25930653, -0.00158485, 0.00097015, 0.00159337, -0.00000117, 0.00000000],
+		[-6.25935061, -0.00158406, 0.00096966, 0.00159256, -0.00000117, 0.00000000],
+		[-6.25939453, -0.00158326, 0.00096918, 0.00159176, -0.00000117, 0.00000000],
+		[-6.25943830, -0.00158246, 0.00096870, 0.00159096, -0.00000117, 0.00000000],
+		[-6.25948191, -0.00158167, 0.00096822, 0.00159016, -0.00000117, 0.00000000],
+		[-6.25952536, -0.00158087, 0.00096774, 0.00158936, -0.00000117, 0.00000000],
+		[-6.25956866, -0.00158008, 0.00096726, 0.00158856, -0.00000117, 0.00000000],
+		[-6.25961180, -0.00157928, 0.00096678, 0.00158776, -0.00000117, 0.00000000],
+		[-6.25965478, -0.00157849, 0.00096631, 0.00158696, -0.00000117, 0.00000000],
+		[-6.25969761, -0.00157770, 0.00096583, 0.00158617, -0.00000117, 0.00000000],
+		[-6.25974029, -0.00157691, 0.00096535, 0.00158537, -0.00000117, 0.00000000],
+		[-6.25978282, -0.00157612, 0.00096487, 0.00158458, -0.00000117, 0.00000000],
+		[-6.25982519, -0.00157533, 0.00096440, 0.00158378, -0.00000117, 0.00000000],
+		[-6.25986741, -0.00157454, 0.00096392, 0.00158299, -0.00000117, 0.00000000],
+		[-6.25990947, -0.00157375, 0.00096344, 0.00158220, -0.00000117, 0.00000000],
+		[-6.25995139, -0.00157296, 0.00096297, 0.00158140, -0.00000117, 0.00000000],
+		[-6.25999315, -0.00157217, 0.00096249, 0.00158061, -0.00000117, 0.00000000],
+		[-6.26003477, -0.00157139, 0.00096202, 0.00157982, -0.00000117, 0.00000000],
+		[-6.26007624, -0.00157060, 0.00096154, 0.00157903, -0.00000117, 0.00000000],
+		[-6.26011755, -0.00156982, 0.00096107, 0.00157824, -0.00000117, 0.00000000],
+		[-6.26015872, -0.00156903, 0.00096060, 0.00157745, -0.00000117, 0.00000000],
+		[-6.26019974, -0.00156825, 0.00096012, 0.00157667, -0.00000117, 0.00000000],
+		[-6.26024061, -0.00156747, 0.00095965, 0.00157588, -0.00000117, 0.00000000],
+		[-6.26028134, -0.00156669, 0.00095918, 0.00157509, -0.00000117, 0.00000000],
+		[-6.26032192, -0.00156591, 0.00095871, 0.00157431, -0.00000117, 0.00000000],
+		[-6.26036235, -0.00156513, 0.00095823, 0.00157352, -0.00000117, 0.00000000],
+		[-6.26040264, -0.00156435, 0.00095776, 0.00157274, -0.00000117, 0.00000000],
+		[-6.26044279, -0.00156357, 0.00095729, 0.00157195, -0.00000117, 0.00000000],
+		[-6.26048279, -0.00156279, 0.00095682, 0.00157117, -0.00000117, 0.00000000],
+		[-6.26052264, -0.00156201, 0.00095635, 0.00157039, -0.00000117, 0.00000000],
+		[-6.26056235, -0.00156124, 0.00095588, 0.00156961, -0.00000117, 0.00000000],
+		[-6.26060192, -0.00156046, 0.00095542, 0.00156883, -0.00000117, 0.00000000],
+		[-6.26064135, -0.00155969, 0.00095495, 0.00156805, -0.00000117, 0.00000000],
+		[-6.26068064, -0.00155891, 0.00095448, 0.00156727, -0.00000117, 0.00000000],
+		[-6.26071978, -0.00155814, 0.00095401, 0.00156649, -0.00000117, 0.00000000],
+		[-6.26075879, -0.00155737, 0.00095354, 0.00156572, -0.00000117, 0.00000000],
+		[-6.26079765, -0.00155659, 0.00095308, 0.00156494, -0.00000117, 0.00000000],
+		[-6.26083637, -0.00155582, 0.00095261, 0.00156416, -0.00000117, 0.00000000],
+		[-6.26087496, -0.00155505, 0.00095215, 0.00156339, -0.00000117, 0.00000000],
+		[-6.26091341, -0.00155428, 0.00095168, 0.00156261, -0.00000117, 0.00000000],
+		[-6.26095171, -0.00155351, 0.00095122, 0.00156184, -0.00000117, 0.00000000],
+		[-6.26098988, -0.00155274, 0.00095075, 0.00156107, -0.00000117, 0.00000000],
+		[-6.26102792, -0.00155198, 0.00095029, 0.00156029, -0.00000117, 0.00000000],
+		[-6.26106581, -0.00155121, 0.00094982, 0.00155952, -0.00000117, 0.00000000],
+		[-6.26110357, -0.00155044, 0.00094936, 0.00155875, -0.00000117, 0.00000000],
+		[-6.26114120, -0.00154968, 0.00094890, 0.00155798, -0.00000117, 0.00000000],
+		[-6.26117869, -0.00154891, 0.00094843, 0.00155721, -0.00000117, 0.00000000],
+		[-6.26121604, -0.00154815, 0.00094797, 0.00155644, -0.00000117, 0.00000000],
+		[-6.26125326, -0.00154739, 0.00094751, 0.00155568, -0.00000117, 0.00000000],
+		[-6.26129035, -0.00154662, 0.00094705, 0.00155491, -0.00000117, 0.00000000],
+		[-6.26132730, -0.00154586, 0.00094659, 0.00155414, -0.00000117, 0.00000000],
+		[-6.26136412, -0.00154510, 0.00094613, 0.00155338, -0.00000117, 0.00000000],
+		[-6.26140081, -0.00154434, 0.00094567, 0.00155261, -0.00000117, 0.00000000],
+		[-6.26143736, -0.00154358, 0.00094521, 0.00155185, -0.00000117, 0.00000000],
+		[-6.26147379, -0.00154282, 0.00094475, 0.00155109, -0.00000117, 0.00000000],
+		[-6.26151008, -0.00154206, 0.00094429, 0.00155032, -0.00000117, 0.00000000],
+		[-6.26154624, -0.00154131, 0.00094383, 0.00154956, -0.00000117, 0.00000000],
+		[-6.26158228, -0.00154055, 0.00094337, 0.00154880, -0.00000117, 0.00000000],
+		[-6.26161818, -0.00153979, 0.00094292, 0.00154804, -0.00000117, 0.00000000],
+		[-6.26165395, -0.00153904, 0.00094246, 0.00154728, -0.00000117, 0.00000000],
+		[-6.26168960, -0.00153828, 0.00094200, 0.00154652, -0.00000117, 0.00000000],
+		[-6.26172512, -0.00153753, 0.00094155, 0.00154576, -0.00000117, 0.00000000],
+		[-6.26176051, -0.00153677, 0.00094109, 0.00154500, -0.00000117, 0.00000000],
+		[-6.26179577, -0.00153602, 0.00094063, 0.00154425, -0.00000117, 0.00000000],
+		[-6.26183090, -0.00153527, 0.00094018, 0.00154349, -0.00000117, 0.00000000],
+		[-6.26186591, -0.00153452, 0.00093972, 0.00154273, -0.00000117, 0.00000000],
+		[-6.26190080, -0.00153377, 0.00093927, 0.00154198, -0.00000117, 0.00000000],
+		[-6.26193555, -0.00153302, 0.00093882, 0.00154123, -0.00000117, 0.00000000],
+		[-6.26197019, -0.00153227, 0.00093836, 0.00154047, -0.00000117, 0.00000000],
+		[-6.26200470, -0.00153152, 0.00093791, 0.00153972, -0.00000117, 0.00000000],
+		[-6.26203908, -0.00153077, 0.00093746, 0.00153897, -0.00000117, 0.00000000],
+		[-6.26207334, -0.00153003, 0.00093700, 0.00153822, -0.00000118, 0.00000000],
+		[-6.26210748, -0.00152928, 0.00093655, 0.00153746, -0.00000118, 0.00000000],
+		[-6.26214149, -0.00152853, 0.00093610, 0.00153671, -0.00000118, 0.00000000],
+		[-6.26217539, -0.00152779, 0.00093565, 0.00153597, -0.00000118, 0.00000000],
+		[-6.26220916, -0.00152705, 0.00093520, 0.00153522, -0.00000118, 0.00000000],
+		[-6.26224280, -0.00152630, 0.00093475, 0.00153447, -0.00000118, 0.00000000],
+		[-6.26227633, -0.00152556, 0.00093430, 0.00153372, -0.00000118, 0.00000000],
+		[-6.26230974, -0.00152482, 0.00093385, 0.00153298, -0.00000118, 0.00000000],
+		[-6.26234303, -0.00152408, 0.00093340, 0.00153223, -0.00000118, 0.00000000],
+		[-6.26237620, -0.00152333, 0.00093295, 0.00153148, -0.00000118, 0.00000000],
+		[-6.26240924, -0.00152259, 0.00093250, 0.00153074, -0.00000118, 0.00000000],
+		[-6.26244217, -0.00152186, 0.00093205, 0.00153000, -0.00000118, 0.00000000],
+		[-6.26247499, -0.00152112, 0.00093161, 0.00152925, -0.00000118, 0.00000000],
+		[-6.26250768, -0.00152038, 0.00093116, 0.00152851, -0.00000118, 0.00000000],
+		[-6.26254025, -0.00151964, 0.00093071, 0.00152777, -0.00000118, 0.00000000],
+		[-6.26257271, -0.00151890, 0.00093027, 0.00152703, -0.00000118, 0.00000000],
+		[-6.26260505, -0.00151817, 0.00092982, 0.00152629, -0.00000118, 0.00000000],
+		[-6.26263728, -0.00151743, 0.00092937, 0.00152555, -0.00000118, 0.00000000],
+		[-6.26266939, -0.00151670, 0.00092893, 0.00152481, -0.00000118, 0.00000000],
+		[-6.26270138, -0.00151596, 0.00092848, 0.00152407, -0.00000118, 0.00000000],
+		[-6.26273326, -0.00151523, 0.00092804, 0.00152333, -0.00000118, 0.00000000],
+		[-6.26276503, -0.00151450, 0.00092760, 0.00152260, -0.00000118, 0.00000000],
+		[-6.26279668, -0.00151377, 0.00092715, 0.00152186, -0.00000118, 0.00000000],
+		[-6.26282822, -0.00151304, 0.00092671, 0.00152113, -0.00000118, 0.00000000],
+		[-6.26285964, -0.00151231, 0.00092627, 0.00152039, -0.00000118, 0.00000000],
+		[-6.26289095, -0.00151158, 0.00092582, 0.00151966, -0.00000118, 0.00000000],
+		[-6.26292215, -0.00151085, 0.00092538, 0.00151892, -0.00000118, 0.00000000],
+		[-6.26295323, -0.00151012, 0.00092494, 0.00151819, -0.00000118, 0.00000000],
+		[-6.26298421, -0.00150939, 0.00092450, 0.00151746, -0.00000118, 0.00000000],
+		[-6.26301507, -0.00150866, 0.00092406, 0.00151673, -0.00000118, 0.00000000],
+		[-6.26304582, -0.00150794, 0.00092362, 0.00151600, -0.00000118, 0.00000000],
+		[-6.26307646, -0.00150721, 0.00092318, 0.00151527, -0.00000118, 0.00000000],
+		[-6.26310699, -0.00150649, 0.00092274, 0.00151454, -0.00000118, 0.00000000],
+		[-6.26313741, -0.00150576, 0.00092230, 0.00151381, -0.00000118, 0.00000000],
+		[-6.26316772, -0.00150504, 0.00092186, 0.00151308, -0.00000118, 0.00000000],
+		[-6.26319793, -0.00150431, 0.00092142, 0.00151235, -0.00000118, 0.00000000],
+		[-6.26322802, -0.00150359, 0.00092098, 0.00151163, -0.00000118, 0.00000000],
+		[-6.26325801, -0.00150287, 0.00092055, 0.00151090, -0.00000118, 0.00000000],
+		[-6.26328788, -0.00150215, 0.00092011, 0.00151018, -0.00000118, 0.00000000],
+		[-6.26331765, -0.00150143, 0.00091967, 0.00150945, -0.00000118, 0.00000000],
+		[-6.26334732, -0.00150071, 0.00091924, 0.00150873, -0.00000118, 0.00000000],
+		[-6.26337687, -0.00149999, 0.00091880, 0.00150800, -0.00000118, 0.00000000],
+		[-6.26340633, -0.00149927, 0.00091836, 0.00150728, -0.00000118, 0.00000000],
+		[-6.26343567, -0.00149855, 0.00091793, 0.00150656, -0.00000118, 0.00000000],
+		[-6.26346491, -0.00149784, 0.00091749, 0.00150584, -0.00000118, 0.00000000],
+		[-6.26349404, -0.00149712, 0.00091706, 0.00150512, -0.00000118, 0.00000000],
+		[-6.26352307, -0.00149640, 0.00091662, 0.00150440, -0.00000118, 0.00000000],
+		[-6.26355200, -0.00149569, 0.00091619, 0.00150368, -0.00000118, 0.00000000],
+		[-6.26358082, -0.00149498, 0.00091576, 0.00150296, -0.00000118, 0.00000000],
+		[-6.26360954, -0.00149426, 0.00091532, 0.00150224, -0.00000118, 0.00000000],
+		[-6.26363815, -0.00149355, 0.00091489, 0.00150152, -0.00000118, 0.00000000],
+		[-6.26366666, -0.00149284, 0.00091446, 0.00150081, -0.00000118, 0.00000000],
+		[-6.26369507, -0.00149212, 0.00091403, 0.00150009, -0.00000118, 0.00000000],
+		[-6.26372338, -0.00149141, 0.00091359, 0.00149938, -0.00000118, 0.00000000],
+		[-6.26375159, -0.00149070, 0.00091316, 0.00149866, -0.00000118, 0.00000000],
+		[-6.26377969, -0.00148999, 0.00091273, 0.00149795, -0.00000118, 0.00000000],
+		[-6.26380769, -0.00148928, 0.00091230, 0.00149723, -0.00000118, 0.00000000],
+		[-6.26383560, -0.00148857, 0.00091187, 0.00149652, -0.00000118, 0.00000000],
+		[-6.26386340, -0.00148787, 0.00091144, 0.00149581, -0.00000118, 0.00000000],
+		[-6.26389110, -0.00148716, 0.00091101, 0.00149510, -0.00000118, 0.00000000],
+		[-6.26391870, -0.00148645, 0.00091058, 0.00149439, -0.00000118, 0.00000000],
+		[-6.26394621, -0.00148575, 0.00091016, 0.00149368, -0.00000118, 0.00000000],
+		[-6.26397361, -0.00148504, 0.00090973, 0.00149297, -0.00000118, 0.00000000],
+		[-6.26400092, -0.00148434, 0.00090930, 0.00149226, -0.00000118, 0.00000000],
+		[-6.26402813, -0.00148363, 0.00090887, 0.00149155, -0.00000118, 0.00000000],
+		[-6.26405524, -0.00148293, 0.00090844, 0.00149084, -0.00000118, 0.00000000],
+		[-6.26408225, -0.00148223, 0.00090802, 0.00149014, -0.00000118, 0.00000000],
+		[-6.26410916, -0.00148152, 0.00090759, 0.00148943, -0.00000118, 0.00000000],
+		[-6.26413598, -0.00148082, 0.00090717, 0.00148872, -0.00000118, 0.00000000],
+		[-6.26416271, -0.00148012, 0.00090674, 0.00148802, -0.00000118, 0.00000000],
+		[-6.26418933, -0.00147942, 0.00090631, 0.00148732, -0.00000118, 0.00000000],
+		[-6.26421586, -0.00147872, 0.00090589, 0.00148661, -0.00000118, 0.00000000],
+		[-6.26424230, -0.00147802, 0.00090547, 0.00148591, -0.00000118, 0.00000000],
+		[-6.26426864, -0.00147733, 0.00090504, 0.00148521, -0.00000118, 0.00000000],
+		[-6.26429489, -0.00147663, 0.00090462, 0.00148450, -0.00000118, 0.00000000],
+		[-6.26432104, -0.00147593, 0.00090419, 0.00148380, -0.00000118, 0.00000000],
+		[-6.26434710, -0.00147523, 0.00090377, 0.00148310, -0.00000118, 0.00000000],
+		[-6.26437306, -0.00147454, 0.00090335, 0.00148240, -0.00000118, 0.00000000],
+		[-6.26439893, -0.00147384, 0.00090293, 0.00148170, -0.00000118, 0.00000000],
+		[-6.26442471, -0.00147315, 0.00090250, 0.00148101, -0.00000118, 0.00000000],
+		[-6.26445040, -0.00147246, 0.00090208, 0.00148031, -0.00000118, 0.00000000],
+		[-6.26447599, -0.00147176, 0.00090166, 0.00147961, -0.00000118, 0.00000000],
+		[-6.26450150, -0.00147107, 0.00090124, 0.00147891, -0.00000118, 0.00000000],
+		[-6.26452691, -0.00147038, 0.00090082, 0.00147822, -0.00000118, 0.00000000],
+		[-6.26455222, -0.00146969, 0.00090040, 0.00147752, -0.00000118, 0.00000000],
+		[-6.26457745, -0.00146900, 0.00089998, 0.00147683, -0.00000118, 0.00000000],
+		[-6.26460259, -0.00146831, 0.00089956, 0.00147613, -0.00000118, 0.00000000],
+		[-6.26462764, -0.00146762, 0.00089914, 0.00147544, -0.00000118, 0.00000000],
+		[-6.26465259, -0.00146693, 0.00089872, 0.00147475, -0.00000118, 0.00000000],
+		[-6.26467746, -0.00146624, 0.00089831, 0.00147406, -0.00000118, 0.00000000],
+		[-6.26470224, -0.00146555, 0.00089789, 0.00147336, -0.00000118, 0.00000000],
+		[-6.26472693, -0.00146486, 0.00089747, 0.00147267, -0.00000118, 0.00000000],
+		[-6.26475153, -0.00146418, 0.00089705, 0.00147198, -0.00000118, 0.00000000],
+		[-6.26477604, -0.00146349, 0.00089664, 0.00147129, -0.00000118, 0.00000000],
+		[-6.26480047, -0.00146281, 0.00089622, 0.00147060, -0.00000118, 0.00000000],
+		[-6.26482481, -0.00146212, 0.00089580, 0.00146992, -0.00000118, 0.00000000],
+		[-6.26484906, -0.00146144, 0.00089539, 0.00146923, -0.00000118, 0.00000000],
+		[-6.26487322, -0.00146076, 0.00089497, 0.00146854, -0.00000118, 0.00000000],
+		[-6.26489730, -0.00146007, 0.00089456, 0.00146785, -0.00000118, 0.00000000],
+		[-6.26492129, -0.00145939, 0.00089414, 0.00146717, -0.00000118, 0.00000000],
+		[-6.26494519, -0.00145871, 0.00089373, 0.00146648, -0.00000118, 0.00000000],
+		[-6.26496901, -0.00145803, 0.00089332, 0.00146580, -0.00000118, 0.00000000],
+		[-6.26499274, -0.00145735, 0.00089290, 0.00146511, -0.00000118, 0.00000000],
+		[-6.26501639, -0.00145667, 0.00089249, 0.00146443, -0.00000118, 0.00000000],
+		[-6.26503995, -0.00145599, 0.00089208, 0.00146375, -0.00000118, 0.00000000],
+		[-6.26506343, -0.00145531, 0.00089166, 0.00146307, -0.00000118, 0.00000000],
+		[-6.26508682, -0.00145463, 0.00089125, 0.00146238, -0.00000118, 0.00000000],
+		[-6.26511013, -0.00145396, 0.00089084, 0.00146170, -0.00000118, 0.00000000],
+		[-6.26513336, -0.00145328, 0.00089043, 0.00146102, -0.00000118, 0.00000000],
+		[-6.26515650, -0.00145261, 0.00089002, 0.00146034, -0.00000118, 0.00000000],
+		[-6.26517956, -0.00145193, 0.00088961, 0.00145966, -0.00000118, 0.00000000],
+		[-6.26520254, -0.00145126, 0.00088920, 0.00145898, -0.00000118, 0.00000000],
+		[-6.26522543, -0.00145058, 0.00088879, 0.00145831, -0.00000118, 0.00000000],
+		[-6.26524824, -0.00144991, 0.00088838, 0.00145763, -0.00000118, 0.00000000],
+		[-6.26527098, -0.00144924, 0.00088797, 0.00145695, -0.00000118, 0.00000000],
+		[-6.26529363, -0.00144856, 0.00088756, 0.00145628, -0.00000118, 0.00000000],
+		[-6.26531619, -0.00144789, 0.00088715, 0.00145560, -0.00000118, 0.00000000],
+		[-6.26533868, -0.00144722, 0.00088674, 0.00145493, -0.00000118, 0.00000000],
+		[-6.26536109, -0.00144655, 0.00088634, 0.00145425, -0.00000118, 0.00000000],
+		[-6.26538341, -0.00144588, 0.00088593, 0.00145358, -0.00000118, 0.00000000],
+		[-6.26540566, -0.00144521, 0.00088552, 0.00145291, -0.00000118, 0.00000000],
+		[-6.26542783, -0.00144454, 0.00088511, 0.00145223, -0.00000118, 0.00000000],
+		[-6.26544992, -0.00144387, 0.00088471, 0.00145156, -0.00000118, 0.00000000],
+		[-6.26547192, -0.00144321, 0.00088430, 0.00145089, -0.00000118, 0.00000000],
+		[-6.26549385, -0.00144254, 0.00088390, 0.00145022, -0.00000118, 0.00000000],
+		[-6.26551570, -0.00144187, 0.00088349, 0.00144955, -0.00000118, 0.00000000],
+		[-6.26553748, -0.00144121, 0.00088309, 0.00144888, -0.00000118, 0.00000000],
+		[-6.26555917, -0.00144054, 0.00088268, 0.00144821, -0.00000118, 0.00000000],
+		[-6.26558079, -0.00143988, 0.00088228, 0.00144754, -0.00000118, 0.00000000],
+		[-6.26560233, -0.00143922, 0.00088187, 0.00144687, -0.00000118, 0.00000000],
+		[-6.26562379, -0.00143855, 0.00088147, 0.00144621, -0.00000118, 0.00000000],
+		[-6.26564518, -0.00143789, 0.00088107, 0.00144554, -0.00000118, 0.00000000],
+		[-6.26566648, -0.00143723, 0.00088066, 0.00144488, -0.00000118, 0.00000000],
+		[-6.26568772, -0.00143657, 0.00088026, 0.00144421, -0.00000118, 0.00000000],
+		[-6.26570887, -0.00143590, 0.00087986, 0.00144355, -0.00000118, 0.00000000],
+		[-6.26572995, -0.00143524, 0.00087946, 0.00144288, -0.00000118, 0.00000000],
+		[-6.26575096, -0.00143458, 0.00087906, 0.00144222, -0.00000118, 0.00000000],
+		[-6.26577189, -0.00143393, 0.00087865, 0.00144155, -0.00000118, 0.00000000],
+		[-6.26579274, -0.00143327, 0.00087825, 0.00144089, -0.00000118, 0.00000000],
+		[-6.26581352, -0.00143261, 0.00087785, 0.00144023, -0.00000118, 0.00000000],
+		[-6.26583423, -0.00143195, 0.00087745, 0.00143957, -0.00000118, 0.00000000],
+		[-6.26585486, -0.00143130, 0.00087705, 0.00143891, -0.00000118, 0.00000000],
+		[-6.26587542, -0.00143064, 0.00087665, 0.00143825, -0.00000118, 0.00000000],
+		[-6.26589591, -0.00142998, 0.00087626, 0.00143759, -0.00000118, 0.00000000],
+		[-6.26591632, -0.00142933, 0.00087586, 0.00143693, -0.00000118, 0.00000000],
+		[-6.26593666, -0.00142867, 0.00087546, 0.00143627, -0.00000118, 0.00000000],
+		[-6.26595692, -0.00142802, 0.00087506, 0.00143562, -0.00000118, 0.00000000],
+		[-6.26597711, -0.00142737, 0.00087466, 0.00143496, -0.00000118, 0.00000000],
+		[-6.26599724, -0.00142671, 0.00087426, 0.00143430, -0.00000118, 0.00000000],
+		[-6.26601728, -0.00142606, 0.00087387, 0.00143365, -0.00000118, 0.00000000],
+		[-6.26603726, -0.00142541, 0.00087347, 0.00143299, -0.00000118, 0.00000000],
+		[-6.26605717, -0.00142476, 0.00087307, 0.00143234, -0.00000118, 0.00000000],
+		[-6.26607700, -0.00142411, 0.00087268, 0.00143168, -0.00000118, 0.00000000],
+		[-6.26609676, -0.00142346, 0.00087228, 0.00143103, -0.00000118, 0.00000000],
+		[-6.26611646, -0.00142281, 0.00087189, 0.00143038, -0.00000118, 0.00000000],
+		[-6.26613608, -0.00142216, 0.00087149, 0.00142972, -0.00000118, 0.00000000],
+		[-6.26615563, -0.00142151, 0.00087110, 0.00142907, -0.00000118, 0.00000000],
+		[-6.26617512, -0.00142087, 0.00087070, 0.00142842, -0.00000118, 0.00000000],
+		[-6.26619453, -0.00142022, 0.00087031, 0.00142777, -0.00000118, 0.00000000],
+		[-6.26621387, -0.00141957, 0.00086992, 0.00142712, -0.00000118, 0.00000000],
+		[-6.26623315, -0.00141893, 0.00086952, 0.00142647, -0.00000118, 0.00000000],
+		[-6.26625235, -0.00141828, 0.00086913, 0.00142582, -0.00000118, 0.00000000],
+		[-6.26627149, -0.00141764, 0.00086874, 0.00142517, -0.00000118, 0.00000000],
+		[-6.26629056, -0.00141699, 0.00086835, 0.00142452, -0.00000118, 0.00000000],
+		[-6.26630956, -0.00141635, 0.00086795, 0.00142388, -0.00000118, 0.00000000],
+		[-6.26632849, -0.00141571, 0.00086756, 0.00142323, -0.00000118, 0.00000000],
+		[-6.26634735, -0.00141506, 0.00086717, 0.00142258, -0.00000118, 0.00000000],
+		[-6.26636615, -0.00141442, 0.00086678, 0.00142194, -0.00000118, 0.00000000],
+		[-6.26638488, -0.00141378, 0.00086639, 0.00142129, -0.00000118, 0.00000000],
+		[-6.26640355, -0.00141314, 0.00086600, 0.00142065, -0.00000118, 0.00000000],
+		[-6.26642214, -0.00141250, 0.00086561, 0.00142001, -0.00000118, 0.00000000],
+		[-6.26644067, -0.00141186, 0.00086522, 0.00141936, -0.00000118, 0.00000000],
+		[-6.26645914, -0.00141122, 0.00086483, 0.00141872, -0.00000118, 0.00000000],
+		[-6.26647754, -0.00141058, 0.00086444, 0.00141808, -0.00000118, 0.00000000],
+		[-6.26649587, -0.00140995, 0.00086405, 0.00141744, -0.00000118, 0.00000000],
+		[-6.26651414, -0.00140931, 0.00086366, 0.00141680, -0.00000118, 0.00000000],
+		[-6.26653234, -0.00140867, 0.00086328, 0.00141616, -0.00000118, 0.00000000],
+		[-6.26655048, -0.00140804, 0.00086289, 0.00141552, -0.00000118, 0.00000000],
+		[-6.26656855, -0.00140740, 0.00086250, 0.00141488, -0.00000118, 0.00000000],
+		[-6.26658656, -0.00140677, 0.00086211, 0.00141424, -0.00000118, 0.00000000],
+		[-6.26660450, -0.00140613, 0.00086173, 0.00141360, -0.00000118, 0.00000000],
+		[-6.26662238, -0.00140550, 0.00086134, 0.00141296, -0.00000118, 0.00000000],
+		[-6.26664020, -0.00140486, 0.00086096, 0.00141233, -0.00000118, 0.00000000],
+		[-6.26665795, -0.00140423, 0.00086057, 0.00141169, -0.00000118, 0.00000000],
+		[-6.26667564, -0.00140360, 0.00086018, 0.00141105, -0.00000118, 0.00000000],
+		[-6.26669326, -0.00140297, 0.00085980, 0.00141042, -0.00000118, 0.00000000],
+		[-6.26671083, -0.00140234, 0.00085942, 0.00140978, -0.00000118, 0.00000000],
+		[-6.26672833, -0.00140171, 0.00085903, 0.00140915, -0.00000118, 0.00000000],
+		[-6.26674577, -0.00140108, 0.00085865, 0.00140852, -0.00000118, 0.00000000],
+		[-6.26676314, -0.00140045, 0.00085826, 0.00140788, -0.00000118, 0.00000000],
+		[-6.26678046, -0.00139982, 0.00085788, 0.00140725, -0.00000118, 0.00000000],
+		[-6.26679771, -0.00139919, 0.00085750, 0.00140662, -0.00000118, 0.00000000],
+		[-6.26681490, -0.00139856, 0.00085711, 0.00140599, -0.00000118, 0.00000000],
+		[-6.26683203, -0.00139793, 0.00085673, 0.00140536, -0.00000118, 0.00000000],
+		[-6.26684910, -0.00139731, 0.00085635, 0.00140472, -0.00000118, 0.00000000],
+		[-6.26686611, -0.00139668, 0.00085597, 0.00140409, -0.00000118, 0.00000000],
+		[-6.26688306, -0.00139605, 0.00085559, 0.00140347, -0.00000118, 0.00000000],
+		[-6.26689994, -0.00139543, 0.00085521, 0.00140284, -0.00000118, 0.00000000],
+		[-6.26691677, -0.00139481, 0.00085482, 0.00140221, -0.00000118, 0.00000000],
+		[-6.26693354, -0.00139418, 0.00085444, 0.00140158, -0.00000118, 0.00000000],
+		[-6.26695024, -0.00139356, 0.00085406, 0.00140095, -0.00000118, 0.00000000],
+		[-6.26696689, -0.00139293, 0.00085368, 0.00140033, -0.00000118, 0.00000000],
+		[-6.26698348, -0.00139231, 0.00085331, 0.00139970, -0.00000118, 0.00000000],
+		[-6.26700001, -0.00139169, 0.00085293, 0.00139908, -0.00000118, 0.00000000],
+		[-6.26701648, -0.00139107, 0.00085255, 0.00139845, -0.00000118, 0.00000000],
+		[-6.26703289, -0.00139045, 0.00085217, 0.00139783, -0.00000118, 0.00000000],
+		[-6.26704925, -0.00138983, 0.00085179, 0.00139720, -0.00000118, 0.00000000],
+		[-6.26706554, -0.00138921, 0.00085141, 0.00139658, -0.00000118, 0.00000000],
+		[-6.26708178, -0.00138859, 0.00085104, 0.00139596, -0.00000118, 0.00000000],
+		[-6.26709796, -0.00138797, 0.00085066, 0.00139534, -0.00000118, 0.00000000],
+		[-6.26711408, -0.00138735, 0.00085028, 0.00139471, -0.00000118, 0.00000000],
+		[-6.26713015, -0.00138674, 0.00084990, 0.00139409, -0.00000118, 0.00000000],
+		[-6.26714616, -0.00138612, 0.00084953, 0.00139347, -0.00000118, 0.00000000],
+		[-6.26716211, -0.00138550, 0.00084915, 0.00139285, -0.00000118, 0.00000000],
+		[-6.26717800, -0.00138489, 0.00084878, 0.00139223, -0.00000118, 0.00000000],
+		[-6.26719384, -0.00138427, 0.00084840, 0.00139161, -0.00000118, 0.00000000],
+		[-6.26720962, -0.00138366, 0.00084803, 0.00139100, -0.00000118, 0.00000000],
+		[-6.26722535, -0.00138304, 0.00084765, 0.00139038, -0.00000118, 0.00000000],
+		[-6.26724102, -0.00138243, 0.00084728, 0.00138976, -0.00000118, 0.00000000],
+		[-6.26725663, -0.00138181, 0.00084690, 0.00138914, -0.00000118, 0.00000000],
+		[-6.26727219, -0.00138120, 0.00084653, 0.00138853, -0.00000118, 0.00000000],
+		[-6.26728769, -0.00138059, 0.00084616, 0.00138791, -0.00000118, 0.00000000],
+		[-6.26730314, -0.00137998, 0.00084578, 0.00138730, -0.00000118, 0.00000000],
+		[-6.26731854, -0.00137937, 0.00084541, 0.00138668, -0.00000118, 0.00000000],
+		[-6.26733388, -0.00137876, 0.00084504, 0.00138607, -0.00000118, 0.00000000],
+		[-6.26734916, -0.00137815, 0.00084467, 0.00138545, -0.00000118, 0.00000000],
+		[-6.26736439, -0.00137754, 0.00084429, 0.00138484, -0.00000118, 0.00000000],
+		[-6.26737957, -0.00137693, 0.00084392, 0.00138423, -0.00000118, 0.00000000],
+		[-6.26739469, -0.00137632, 0.00084355, 0.00138362, -0.00000118, 0.00000000],
+		[-6.26740976, -0.00137571, 0.00084318, 0.00138301, -0.00000118, 0.00000000],
+		[-6.26742477, -0.00137510, 0.00084281, 0.00138239, -0.00000118, 0.00000000],
+		[-6.26743974, -0.00137450, 0.00084244, 0.00138178, -0.00000118, 0.00000000],
+		[-6.26745464, -0.00137389, 0.00084207, 0.00138117, -0.00000118, 0.00000000],
+		[-6.26746950, -0.00137328, 0.00084170, 0.00138056, -0.00000118, 0.00000000],
+		[-6.26748430, -0.00137268, 0.00084133, 0.00137996, -0.00000117, 0.00000000],
+		[-6.26749906, -0.00137207, 0.00084096, 0.00137935, -0.00000117, 0.00000000],
+		[-6.26751375, -0.00137147, 0.00084059, 0.00137874, -0.00000117, 0.00000000],
+		[-6.26752840, -0.00137087, 0.00084022, 0.00137813, -0.00000117, 0.00000000],
+		[-6.26754300, -0.00137026, 0.00083986, 0.00137753, -0.00000117, 0.00000000],
+		[-6.26755754, -0.00136966, 0.00083949, 0.00137692, -0.00000117, 0.00000000],
+		[-6.26757203, -0.00136906, 0.00083912, 0.00137631, -0.00000117, 0.00000000],
+		[-6.26758647, -0.00136846, 0.00083875, 0.00137571, -0.00000117, 0.00000000],
+		[-6.26760086, -0.00136786, 0.00083839, 0.00137510, -0.00000117, 0.00000000],
+		[-6.26761520, -0.00136725, 0.00083802, 0.00137450, -0.00000117, 0.00000000],
+		[-6.26762949, -0.00136665, 0.00083765, 0.00137390, -0.00000117, 0.00000000],
+		[-6.26764372, -0.00136605, 0.00083729, 0.00137329, -0.00000117, 0.00000000],
+		[-6.26765791, -0.00136546, 0.00083692, 0.00137269, -0.00000117, 0.00000000],
+		[-6.26767205, -0.00136486, 0.00083656, 0.00137209, -0.00000117, 0.00000000],
+		[-6.26768613, -0.00136426, 0.00083619, 0.00137149, -0.00000117, 0.00000000],
+		[-6.26770017, -0.00136366, 0.00083583, 0.00137089, -0.00000117, 0.00000000],
+		[-6.26771416, -0.00136306, 0.00083546, 0.00137029, -0.00000117, 0.00000000],
+		[-6.26772809, -0.00136247, 0.00083510, 0.00136969, -0.00000117, 0.00000000],
+		[-6.26774198, -0.00136187, 0.00083474, 0.00136909, -0.00000117, 0.00000000],
+		[-6.26775582, -0.00136128, 0.00083437, 0.00136849, -0.00000117, 0.00000000],
+		[-6.26776961, -0.00136068, 0.00083401, 0.00136789, -0.00000117, 0.00000000],
+		[-6.26778335, -0.00136009, 0.00083365, 0.00136729, -0.00000117, 0.00000000],
+		[-6.26779704, -0.00135949, 0.00083328, 0.00136669, -0.00000117, 0.00000000],
+		[-6.26781069, -0.00135890, 0.00083292, 0.00136610, -0.00000117, 0.00000000],
+		[-6.26782428, -0.00135831, 0.00083256, 0.00136550, -0.00000117, 0.00000000],
+		[-6.26783783, -0.00135771, 0.00083220, 0.00136490, -0.00000117, 0.00000000],
+		[-6.26785133, -0.00135712, 0.00083184, 0.00136431, -0.00000117, 0.00000000],
+		[-6.26786479, -0.00135653, 0.00083148, 0.00136371, -0.00000117, 0.00000000],
+		[-6.26787819, -0.00135594, 0.00083111, 0.00136312, -0.00000117, 0.00000000],
+		[-6.26789155, -0.00135535, 0.00083075, 0.00136253, -0.00000117, 0.00000000],
+		[-6.26790486, -0.00135476, 0.00083039, 0.00136193, -0.00000117, 0.00000000],
+		[-6.26791812, -0.00135417, 0.00083003, 0.00136134, -0.00000117, 0.00000000],
+		[-6.26793134, -0.00135358, 0.00082967, 0.00136075, -0.00000117, 0.00000000],
+		[-6.26794451, -0.00135299, 0.00082931, 0.00136016, -0.00000117, 0.00000000],
+		[-6.26795764, -0.00135240, 0.00082896, 0.00135956, -0.00000117, 0.00000000],
+		[-6.26797071, -0.00135182, 0.00082860, 0.00135897, -0.00000117, 0.00000000],
+		[-6.26798374, -0.00135123, 0.00082824, 0.00135838, -0.00000117, 0.00000000],
+		[-6.26799673, -0.00135064, 0.00082788, 0.00135779, -0.00000117, 0.00000000],
+		[-6.26800967, -0.00135006, 0.00082752, 0.00135720, -0.00000117, 0.00000000],
+		[-6.26802256, -0.00134947, 0.00082717, 0.00135662, -0.00000117, 0.00000000],
+		[-6.26803541, -0.00134889, 0.00082681, 0.00135603, -0.00000117, 0.00000000],
+		[-6.26804822, -0.00134830, 0.00082645, 0.00135544, -0.00000117, 0.00000000],
+		[-6.26806098, -0.00134772, 0.00082609, 0.00135485, -0.00000117, 0.00000000],
+		[-6.26807369, -0.00134713, 0.00082574, 0.00135427, -0.00000117, 0.00000000],
+		[-6.26808636, -0.00134655, 0.00082538, 0.00135368, -0.00000117, 0.00000000],
+		[-6.26809898, -0.00134597, 0.00082503, 0.00135309, -0.00000117, 0.00000000],
+		[-6.26811156, -0.00134539, 0.00082467, 0.00135251, -0.00000117, 0.00000000],
+		[-6.26812410, -0.00134481, 0.00082432, 0.00135192, -0.00000117, 0.00000000],
+		[-6.26813659, -0.00134422, 0.00082396, 0.00135134, -0.00000117, 0.00000000],
+		[-6.26814904, -0.00134364, 0.00082361, 0.00135075, -0.00000117, 0.00000000],
+		[-6.26816144, -0.00134306, 0.00082325, 0.00135017, -0.00000117, 0.00000000],
+		[-6.26817380, -0.00134248, 0.00082290, 0.00134959, -0.00000117, 0.00000000],
+		[-6.26818612, -0.00134191, 0.00082255, 0.00134901, -0.00000117, 0.00000000],
+		[-6.26819839, -0.00134133, 0.00082219, 0.00134842, -0.00000117, 0.00000000],
+		[-6.26821062, -0.00134075, 0.00082184, 0.00134784, -0.00000117, 0.00000000],
+		[-6.26822281, -0.00134017, 0.00082149, 0.00134726, -0.00000117, 0.00000000],
+		[-6.26823495, -0.00133959, 0.00082113, 0.00134668, -0.00000117, 0.00000000],
+		[-6.26824705, -0.00133902, 0.00082078, 0.00134610, -0.00000117, 0.00000000],
+		[-6.26825911, -0.00133844, 0.00082043, 0.00134552, -0.00000117, 0.00000000],
+		[-6.26827113, -0.00133787, 0.00082008, 0.00134494, -0.00000117, 0.00000000],
+		[-6.26828310, -0.00133729, 0.00081973, 0.00134437, -0.00000117, 0.00000000],
+		[-6.26829504, -0.00133672, 0.00081938, 0.00134379, -0.00000117, 0.00000000],
+		[-6.26830693, -0.00133614, 0.00081902, 0.00134321, -0.00000117, 0.00000000],
+		[-6.26831878, -0.00133557, 0.00081867, 0.00134263, -0.00000117, 0.00000000],
+		[-6.26833058, -0.00133499, 0.00081832, 0.00134206, -0.00000117, 0.00000000],
+		[-6.26834235, -0.00133442, 0.00081797, 0.00134148, -0.00000117, 0.00000000],
+		[-6.26835407, -0.00133385, 0.00081762, 0.00134090, -0.00000117, 0.00000000],
+		[-6.26836576, -0.00133328, 0.00081728, 0.00134033, -0.00000117, 0.00000000],
+		[-6.26837740, -0.00133271, 0.00081693, 0.00133976, -0.00000117, 0.00000000],
+		[-6.26838900, -0.00133214, 0.00081658, 0.00133918, -0.00000117, 0.00000000],
+		[-6.26840056, -0.00133157, 0.00081623, 0.00133861, -0.00000117, 0.00000000],
+		[-6.26841209, -0.00133100, 0.00081588, 0.00133803, -0.00000117, 0.00000000],
+		[-6.26842357, -0.00133043, 0.00081553, 0.00133746, -0.00000117, 0.00000000],
+		[-6.26843501, -0.00132986, 0.00081519, 0.00133689, -0.00000117, 0.00000000],
+		[-6.26844641, -0.00132929, 0.00081484, 0.00133632, -0.00000117, 0.00000000],
+		[-6.26845777, -0.00132872, 0.00081449, 0.00133575, -0.00000117, 0.00000000],
+		[-6.26846909, -0.00132815, 0.00081414, 0.00133518, -0.00000117, 0.00000000],
+		[-6.26848037, -0.00132759, 0.00081380, 0.00133461, -0.00000117, 0.00000000],
+		[-6.26849161, -0.00132702, 0.00081345, 0.00133404, -0.00000117, 0.00000000],
+		[-6.26850281, -0.00132645, 0.00081311, 0.00133347, -0.00000117, 0.00000000],
+		[-6.26851397, -0.00132589, 0.00081276, 0.00133290, -0.00000117, 0.00000000],
+		[-6.26852510, -0.00132532, 0.00081242, 0.00133233, -0.00000117, 0.00000000],
+		[-6.26853618, -0.00132476, 0.00081207, 0.00133176, -0.00000117, 0.00000000],
+		[-6.26854723, -0.00132419, 0.00081173, 0.00133120, -0.00000117, 0.00000000],
+		[-6.26855824, -0.00132363, 0.00081138, 0.00133063, -0.00000117, 0.00000000],
+		[-6.26856921, -0.00132307, 0.00081104, 0.00133006, -0.00000117, 0.00000000],
+		[-6.26858014, -0.00132251, 0.00081069, 0.00132950, -0.00000117, 0.00000000],
+		[-6.26859103, -0.00132194, 0.00081035, 0.00132893, -0.00000117, 0.00000000],
+		[-6.26860188, -0.00132138, 0.00081001, 0.00132837, -0.00000117, 0.00000000],
+		[-6.26861270, -0.00132082, 0.00080966, 0.00132780, -0.00000117, 0.00000000],
+		[-6.26862348, -0.00132026, 0.00080932, 0.00132724, -0.00000117, 0.00000000],
+		[-6.26863422, -0.00131970, 0.00080898, 0.00132667, -0.00000117, 0.00000000],
+		[-6.26864493, -0.00131914, 0.00080864, 0.00132611, -0.00000117, 0.00000000],
+		[-6.26865559, -0.00131858, 0.00080829, 0.00132555, -0.00000117, 0.00000000],
+		[-6.26866622, -0.00131802, 0.00080795, 0.00132499, -0.00000117, 0.00000000],
+		[-6.26867681, -0.00131746, 0.00080761, 0.00132442, -0.00000117, 0.00000000],
+		[-6.26868737, -0.00131690, 0.00080727, 0.00132386, -0.00000117, 0.00000000],
+		[-6.26869789, -0.00131635, 0.00080693, 0.00132330, -0.00000117, 0.00000000],
+		[-6.26870837, -0.00131579, 0.00080659, 0.00132274, -0.00000117, 0.00000000],
+		[-6.26871882, -0.00131523, 0.00080625, 0.00132218, -0.00000117, 0.00000000],
+		[-6.26872923, -0.00131468, 0.00080591, 0.00132162, -0.00000117, 0.00000000],
+		[-6.26873960, -0.00131412, 0.00080557, 0.00132106, -0.00000117, 0.00000000],
+		[-6.26874993, -0.00131357, 0.00080523, 0.00132050, -0.00000117, 0.00000000],
+		[-6.26876024, -0.00131301, 0.00080489, 0.00131995, -0.00000117, 0.00000000],
+		[-6.26877050, -0.00131246, 0.00080455, 0.00131939, -0.00000117, 0.00000000],
+		[-6.26878073, -0.00131190, 0.00080421, 0.00131883, -0.00000117, 0.00000000],
+		[-6.26879092, -0.00131135, 0.00080387, 0.00131828, -0.00000117, 0.00000000],
+		[-6.26880108, -0.00131080, 0.00080354, 0.00131772, -0.00000117, 0.00000000],
+		[-6.26881120, -0.00131024, 0.00080320, 0.00131716, -0.00000117, 0.00000000],
+		[-6.26882129, -0.00130969, 0.00080286, 0.00131661, -0.00000117, 0.00000000],
+		[-6.26883135, -0.00130914, 0.00080252, 0.00131605, -0.00000117, 0.00000000],
+		[-6.26884136, -0.00130859, 0.00080219, 0.00131550, -0.00000117, 0.00000000],
+		[-6.26885135, -0.00130804, 0.00080185, 0.00131495, -0.00000117, 0.00000000],
+		[-6.26886129, -0.00130749, 0.00080151, 0.00131439, -0.00000117, 0.00000000],
+		[-6.26887121, -0.00130694, 0.00080118, 0.00131384, -0.00000117, 0.00000000],
+		[-6.26888109, -0.00130639, 0.00080084, 0.00131329, -0.00000117, 0.00000000],
+		[-6.26889093, -0.00130584, 0.00080051, 0.00131274, -0.00000117, 0.00000000],
+		[-6.26890074, -0.00130529, 0.00080017, 0.00131218, -0.00000117, 0.00000000],
+		[-6.26891052, -0.00130474, 0.00079984, 0.00131163, -0.00000117, 0.00000000],
+		[-6.26892026, -0.00130420, 0.00079950, 0.00131108, -0.00000117, 0.00000000],
+		[-6.26892997, -0.00130365, 0.00079917, 0.00131053, -0.00000117, 0.00000000],
+		[-6.26893965, -0.00130310, 0.00079883, 0.00130998, -0.00000117, 0.00000000],
+		[-6.26894929, -0.00130256, 0.00079850, 0.00130943, -0.00000117, 0.00000000],
+		[-6.26895890, -0.00130201, 0.00079816, 0.00130888, -0.00000117, 0.00000000],
+		[-6.26896848, -0.00130146, 0.00079783, 0.00130834, -0.00000117, 0.00000000],
+		[-6.26897802, -0.00130092, 0.00079750, 0.00130779, -0.00000117, 0.00000000],
+		[-6.26898753, -0.00130038, 0.00079717, 0.00130724, -0.00000117, 0.00000000],
+		[-6.26899700, -0.00129983, 0.00079683, 0.00130669, -0.00000117, 0.00000000],
+		[-6.26900645, -0.00129929, 0.00079650, 0.00130615, -0.00000117, 0.00000000],
+		[-6.26901586, -0.00129875, 0.00079617, 0.00130560, -0.00000117, 0.00000000],
+		[-6.26902524, -0.00129820, 0.00079584, 0.00130506, -0.00000117, 0.00000000],
+		[-6.26903458, -0.00129766, 0.00079550, 0.00130451, -0.00000117, 0.00000000],
+		[-6.26904390, -0.00129712, 0.00079517, 0.00130397, -0.00000117, 0.00000000],
+		[-6.26905318, -0.00129658, 0.00079484, 0.00130342, -0.00000117, 0.00000000],
+		[-6.26906243, -0.00129604, 0.00079451, 0.00130288, -0.00000117, 0.00000000],
+		[-6.26907164, -0.00129550, 0.00079418, 0.00130233, -0.00000117, 0.00000000],
+		[-6.26908083, -0.00129496, 0.00079385, 0.00130179, -0.00000117, 0.00000000],
+		[-6.26908998, -0.00129442, 0.00079352, 0.00130125, -0.00000117, 0.00000000],
+		[-6.26909911, -0.00129388, 0.00079319, 0.00130071, -0.00000117, 0.00000000],
+		[-6.26910820, -0.00129334, 0.00079286, 0.00130016, -0.00000117, 0.00000000],
+		[-6.26911726, -0.00129280, 0.00079253, 0.00129962, -0.00000117, 0.00000000],
+		[-6.26912629, -0.00129226, 0.00079220, 0.00129908, -0.00000117, 0.00000000],
+		[-6.26913528, -0.00129173, 0.00079188, 0.00129854, -0.00000117, 0.00000000],
+		[-6.26914425, -0.00129119, 0.00079155, 0.00129800, -0.00000117, 0.00000000],
+		[-6.26915318, -0.00129065, 0.00079122, 0.00129746, -0.00000117, 0.00000000],
+		[-6.26916209, -0.00129012, 0.00079089, 0.00129692, -0.00000117, 0.00000000],
+		[-6.26917096, -0.00128958, 0.00079056, 0.00129639, -0.00000117, 0.00000000],
+		[-6.26917981, -0.00128905, 0.00079024, 0.00129585, -0.00000117, 0.00000000],
+		[-6.26918862, -0.00128851, 0.00078991, 0.00129531, -0.00000117, 0.00000000],
+		[-6.26919740, -0.00128798, 0.00078958, 0.00129477, -0.00000117, 0.00000000],
+		[-6.26920615, -0.00128744, 0.00078926, 0.00129424, -0.00000117, 0.00000000],
+		[-6.26921488, -0.00128691, 0.00078893, 0.00129370, -0.00000117, 0.00000000],
+		[-6.26922357, -0.00128638, 0.00078860, 0.00129316, -0.00000117, 0.00000000],
+		[-6.26923223, -0.00128585, 0.00078828, 0.00129263, -0.00000117, 0.00000000],
+		[-6.26924086, -0.00128531, 0.00078795, 0.00129209, -0.00000117, 0.00000000],
+		[-6.26924947, -0.00128478, 0.00078763, 0.00129156, -0.00000117, 0.00000000],
+		[-6.26925804, -0.00128425, 0.00078730, 0.00129102, -0.00000117, 0.00000000],
+		[-6.26926658, -0.00128372, 0.00078698, 0.00129049, -0.00000117, 0.00000000],
+		[-6.26927510, -0.00128319, 0.00078665, 0.00128996, -0.00000117, 0.00000000],
+		[-6.26928358, -0.00128266, 0.00078633, 0.00128942, -0.00000117, 0.00000000],
+		[-6.26929204, -0.00128213, 0.00078601, 0.00128889, -0.00000117, 0.00000000],
+		[-6.26930047, -0.00128160, 0.00078568, 0.00128836, -0.00000117, 0.00000000],
+		[-6.26930887, -0.00128107, 0.00078536, 0.00128783, -0.00000117, 0.00000000],
+		[-6.26931724, -0.00128054, 0.00078504, 0.00128730, -0.00000117, 0.00000000],
+		[-6.26932558, -0.00128002, 0.00078471, 0.00128677, -0.00000117, 0.00000000],
+		[-6.26933389, -0.00127949, 0.00078439, 0.00128624, -0.00000117, 0.00000000],
+		[-6.26934217, -0.00127896, 0.00078407, 0.00128571, -0.00000117, 0.00000000],
+		[-6.26935043, -0.00127844, 0.00078375, 0.00128518, -0.00000117, 0.00000000],
+		[-6.26935866, -0.00127791, 0.00078342, 0.00128465, -0.00000117, 0.00000000],
+		[-6.26936686, -0.00127738, 0.00078310, 0.00128412, -0.00000117, 0.00000000],
+		[-6.26937503, -0.00127686, 0.00078278, 0.00128359, -0.00000117, 0.00000000],
+		[-6.26938317, -0.00127634, 0.00078246, 0.00128306, -0.00000117, 0.00000000],
+		[-6.26939129, -0.00127581, 0.00078214, 0.00128254, -0.00000117, 0.00000000],
+		[-6.26939937, -0.00127529, 0.00078182, 0.00128201, -0.00000117, 0.00000000],
+		[-6.26940743, -0.00127476, 0.00078150, 0.00128148, -0.00000117, 0.00000000],
+		[-6.26941547, -0.00127424, 0.00078118, 0.00128096, -0.00000117, 0.00000000],
+		[-6.26942347, -0.00127372, 0.00078086, 0.00128043, -0.00000117, 0.00000000],
+		[-6.26943145, -0.00127320, 0.00078054, 0.00127991, -0.00000117, 0.00000000],
+		[-6.26943940, -0.00127267, 0.00078022, 0.00127938, -0.00000117, 0.00000000],
+		[-6.26944732, -0.00127215, 0.00077990, 0.00127886, -0.00000117, 0.00000000],
+		[-6.26945522, -0.00127163, 0.00077958, 0.00127833, -0.00000117, 0.00000000],
+		[-6.26946309, -0.00127111, 0.00077926, 0.00127781, -0.00000117, 0.00000000],
+		[-6.26947093, -0.00127059, 0.00077895, 0.00127729, -0.00000117, 0.00000000],
+		[-6.26947875, -0.00127007, 0.00077863, 0.00127677, -0.00000117, 0.00000000],
+		[-6.26948654, -0.00126955, 0.00077831, 0.00127624, -0.00000117, 0.00000000],
+		[-6.26949430, -0.00126903, 0.00077799, 0.00127572, -0.00000117, 0.00000000],
+		[-6.26950204, -0.00126852, 0.00077768, 0.00127520, -0.00000117, 0.00000000],
+		[-6.26950975, -0.00126800, 0.00077736, 0.00127468, -0.00000117, 0.00000000],
+		[-6.26951743, -0.00126748, 0.00077704, 0.00127416, -0.00000117, 0.00000000],
+		[-6.26952509, -0.00126696, 0.00077673, 0.00127364, -0.00000117, 0.00000000],
+		[-6.26953272, -0.00126645, 0.00077641, 0.00127312, -0.00000117, 0.00000000],
+		[-6.26954033, -0.00126593, 0.00077609, 0.00127260, -0.00000117, 0.00000000],
+		[-6.26954791, -0.00126541, 0.00077578, 0.00127208, -0.00000117, 0.00000000],
+		[-6.26955546, -0.00126490, 0.00077546, 0.00127156, -0.00000117, 0.00000000],
+		[-6.26956299, -0.00126438, 0.00077515, 0.00127104, -0.00000117, 0.00000000],
+		[-6.26957049, -0.00126387, 0.00077483, 0.00127053, -0.00000117, 0.00000000],
+		[-6.26957797, -0.00126335, 0.00077452, 0.00127001, -0.00000117, 0.00000000],
+		[-6.26958542, -0.00126284, 0.00077420, 0.00126949, -0.00000117, 0.00000000],
+		[-6.26959285, -0.00126233, 0.00077389, 0.00126898, -0.00000117, 0.00000000],
+		[-6.26960025, -0.00126181, 0.00077357, 0.00126846, -0.00000117, 0.00000000],
+		[-6.26960763, -0.00126130, 0.00077326, 0.00126795, -0.00000117, 0.00000000],
+		[-6.26961498, -0.00126079, 0.00077295, 0.00126743, -0.00000117, 0.00000000],
+		[-6.26962230, -0.00126028, 0.00077263, 0.00126692, -0.00000117, 0.00000000],
+		[-6.26962961, -0.00125977, 0.00077232, 0.00126640, -0.00000117, 0.00000000],
+		[-6.26963688, -0.00125926, 0.00077201, 0.00126589, -0.00000117, 0.00000000],
+		[-6.26964414, -0.00125874, 0.00077170, 0.00126537, -0.00000117, 0.00000000],
+		[-6.26965137, -0.00125823, 0.00077138, 0.00126486, -0.00000117, 0.00000000],
+		[-6.26965857, -0.00125772, 0.00077107, 0.00126435, -0.00000117, 0.00000000],
+		[-6.26966575, -0.00125722, 0.00077076, 0.00126384, -0.00000117, 0.00000000],
+		[-6.26967290, -0.00125671, 0.00077045, 0.00126333, -0.00000117, 0.00000000],
+		[-6.26968003, -0.00125620, 0.00077014, 0.00126281, -0.00000117, 0.00000000],
+		[-6.26968714, -0.00125569, 0.00076983, 0.00126230, -0.00000117, 0.00000000],
+		[-6.26969422, -0.00125518, 0.00076952, 0.00126179, -0.00000117, 0.00000000],
+		[-6.26970128, -0.00125468, 0.00076920, 0.00126128, -0.00000117, 0.00000000],
+		[-6.26970832, -0.00125417, 0.00076889, 0.00126077, -0.00000117, 0.00000000],
+		[-6.26971533, -0.00125366, 0.00076858, 0.00126026, -0.00000117, 0.00000000],
+		[-6.26972232, -0.00125316, 0.00076827, 0.00125975, -0.00000117, 0.00000000],
+		[-6.26972928, -0.00125265, 0.00076797, 0.00125925, -0.00000117, 0.00000000],
+		[-6.26973622, -0.00125214, 0.00076766, 0.00125874, -0.00000117, 0.00000000],
+		[-6.26974314, -0.00125164, 0.00076735, 0.00125823, -0.00000117, 0.00000000],
+		[-6.26975003, -0.00125114, 0.00076704, 0.00125772, -0.00000117, 0.00000000],
+		[-6.26975691, -0.00125063, 0.00076673, 0.00125722, -0.00000117, 0.00000000],
+		[-6.26976375, -0.00125013, 0.00076642, 0.00125671, -0.00000117, 0.00000000],
+		[-6.26977058, -0.00124962, 0.00076611, 0.00125620, -0.00000117, 0.00000000],
+		[-6.26977738, -0.00124912, 0.00076581, 0.00125570, -0.00000117, 0.00000000],
+		[-6.26978416, -0.00124862, 0.00076550, 0.00125519, -0.00000117, 0.00000000],
+		[-6.26979092, -0.00124812, 0.00076519, 0.00125469, -0.00000117, 0.00000000],
+		[-6.26979765, -0.00124762, 0.00076488, 0.00125418, -0.00000117, 0.00000000],
+		[-6.26980436, -0.00124711, 0.00076458, 0.00125368, -0.00000117, 0.00000000],
+		[-6.26981105, -0.00124661, 0.00076427, 0.00125318, -0.00000117, 0.00000000],
+		[-6.26981772, -0.00124611, 0.00076396, 0.00125267, -0.00000117, 0.00000000],
+		[-6.26982436, -0.00124561, 0.00076366, 0.00125217, -0.00000117, 0.00000000],
+		[-6.26983098, -0.00124511, 0.00076335, 0.00125167, -0.00000117, 0.00000000],
+		[-6.26983758, -0.00124461, 0.00076305, 0.00125116, -0.00000117, 0.00000000],
+		[-6.26984416, -0.00124412, 0.00076274, 0.00125066, -0.00000117, 0.00000000],
+		[-6.26985071, -0.00124362, 0.00076244, 0.00125016, -0.00000117, 0.00000000],
+		[-6.26985725, -0.00124312, 0.00076213, 0.00124966, -0.00000117, 0.00000000],
+		[-6.26986376, -0.00124262, 0.00076183, 0.00124916, -0.00000117, 0.00000000],
+		[-6.26987025, -0.00124212, 0.00076152, 0.00124866, -0.00000117, 0.00000000],
+		[-6.26987672, -0.00124163, 0.00076122, 0.00124816, -0.00000117, 0.00000000],
+		[-6.26988316, -0.00124113, 0.00076091, 0.00124766, -0.00000117, 0.00000000],
+		[-6.26988959, -0.00124063, 0.00076061, 0.00124716, -0.00000117, 0.00000000],
+		[-6.26989599, -0.00124014, 0.00076031, 0.00124666, -0.00000117, 0.00000000],
+		[-6.26990237, -0.00123964, 0.00076000, 0.00124617, -0.00000117, 0.00000000],
+		[-6.26990873, -0.00123915, 0.00075970, 0.00124567, -0.00000117, 0.00000000],
+		[-6.26991507, -0.00123865, 0.00075940, 0.00124517, -0.00000117, 0.00000000],
+		[-6.26992139, -0.00123816, 0.00075909, 0.00124467, -0.00000117, 0.00000000],
+		[-6.26992769, -0.00123767, 0.00075879, 0.00124418, -0.00000117, 0.00000000],
+		[-6.26993396, -0.00123717, 0.00075849, 0.00124368, -0.00000117, 0.00000000],
+		[-6.26994022, -0.00123668, 0.00075819, 0.00124319, -0.00000117, 0.00000000],
+		[-6.26994645, -0.00123619, 0.00075789, 0.00124269, -0.00000117, 0.00000000],
+		[-6.26995267, -0.00123569, 0.00075758, 0.00124219, -0.00000117, 0.00000000],
+		[-6.26995886, -0.00123520, 0.00075728, 0.00124170, -0.00000117, 0.00000000],
+		[-6.26996503, -0.00123471, 0.00075698, 0.00124121, -0.00000117, 0.00000000],
+		[-6.26997119, -0.00123422, 0.00075668, 0.00124071, -0.00000117, 0.00000000],
+		[-6.26997732, -0.00123373, 0.00075638, 0.00124022, -0.00000117, 0.00000000],
+		[-6.26998343, -0.00123324, 0.00075608, 0.00123973, -0.00000117, 0.00000000],
+		[-6.26998952, -0.00123275, 0.00075578, 0.00123923, -0.00000117, 0.00000000],
+		[-6.26999559, -0.00123226, 0.00075548, 0.00123874, -0.00000117, 0.00000000],
+		[-6.27000164, -0.00123177, 0.00075518, 0.00123825, -0.00000117, 0.00000000],
+		[-6.27000767, -0.00123128, 0.00075488, 0.00123776, -0.00000117, 0.00000000],
+		[-6.27001368, -0.00123079, 0.00075458, 0.00123727, -0.00000117, 0.00000000],
+		[-6.27001968, -0.00123031, 0.00075428, 0.00123678, -0.00000117, 0.00000000],
+		[-6.27002565, -0.00122982, 0.00075399, 0.00123629, -0.00000117, 0.00000000],
+		[-6.27003160, -0.00122933, 0.00075369, 0.00123580, -0.00000117, 0.00000000],
+		[-6.27003753, -0.00122884, 0.00075339, 0.00123531, -0.00000117, 0.00000000],
+		[-6.27004344, -0.00122836, 0.00075309, 0.00123482, -0.00000117, 0.00000000],
+		[-6.27004933, -0.00122787, 0.00075279, 0.00123433, -0.00000117, 0.00000000],
+		[-6.27005521, -0.00122739, 0.00075250, 0.00123384, -0.00000117, 0.00000000],
+		[-6.27006106, -0.00122690, 0.00075220, 0.00123335, -0.00000117, 0.00000000],
+		[-6.27006690, -0.00122642, 0.00075190, 0.00123286, -0.00000117, 0.00000000],
+		[-6.27007271, -0.00122593, 0.00075160, 0.00123238, -0.00000117, 0.00000000],
+		[-6.27007851, -0.00122545, 0.00075131, 0.00123189, -0.00000117, 0.00000000],
+		[-6.27008428, -0.00122496, 0.00075101, 0.00123140, -0.00000117, 0.00000000],
+		[-6.27009004, -0.00122448, 0.00075072, 0.00123092, -0.00000117, 0.00000000],
+		[-6.27009578, -0.00122400, 0.00075042, 0.00123043, -0.00000117, 0.00000000],
+		[-6.27010150, -0.00122351, 0.00075012, 0.00122995, -0.00000117, 0.00000000],
+		[-6.27010720, -0.00122303, 0.00074983, 0.00122946, -0.00000117, 0.00000000],
+		[-6.27011288, -0.00122255, 0.00074953, 0.00122898, -0.00000117, 0.00000000],
+		[-6.27011855, -0.00122207, 0.00074924, 0.00122849, -0.00000117, 0.00000000],
+		[-6.27012419, -0.00122159, 0.00074894, 0.00122801, -0.00000117, 0.00000000],
+		[-6.27012982, -0.00122111, 0.00074865, 0.00122752, -0.00000117, 0.00000000],
+		[-6.27013543, -0.00122063, 0.00074836, 0.00122704, -0.00000117, 0.00000000],
+		[-6.27014102, -0.00122015, 0.00074806, 0.00122656, -0.00000117, 0.00000000],
+		[-6.27014659, -0.00121967, 0.00074777, 0.00122608, -0.00000117, 0.00000000],
+		[-6.27015214, -0.00121919, 0.00074747, 0.00122559, -0.00000117, 0.00000000],
+		[-6.27015767, -0.00121871, 0.00074718, 0.00122511, -0.00000117, 0.00000000],
+		[-6.27016319, -0.00121823, 0.00074689, 0.00122463, -0.00000117, 0.00000000],
+		[-6.27016869, -0.00121775, 0.00074659, 0.00122415, -0.00000117, 0.00000000],
+		[-6.27017417, -0.00121727, 0.00074630, 0.00122367, -0.00000117, 0.00000000],
+		[-6.27017963, -0.00121680, 0.00074601, 0.00122319, -0.00000117, 0.00000000],
+		[-6.27018508, -0.00121632, 0.00074572, 0.00122271, -0.00000117, 0.00000000],
+		[-6.27019050, -0.00121584, 0.00074543, 0.00122223, -0.00000117, 0.00000000],
+		[-6.27019591, -0.00121537, 0.00074513, 0.00122175, -0.00000117, 0.00000000],
+		[-6.27020130, -0.00121489, 0.00074484, 0.00122127, -0.00000117, 0.00000000],
+		[-6.27020668, -0.00121441, 0.00074455, 0.00122080, -0.00000117, 0.00000000],
+		[-6.27021203, -0.00121394, 0.00074426, 0.00122032, -0.00000117, 0.00000000],
+		[-6.27021737, -0.00121346, 0.00074397, 0.00121984, -0.00000117, 0.00000000],
+		[-6.27022270, -0.00121299, 0.00074368, 0.00121936, -0.00000117, 0.00000000],
+		[-6.27022800, -0.00121252, 0.00074339, 0.00121889, -0.00000117, 0.00000000],
+		[-6.27023329, -0.00121204, 0.00074310, 0.00121841, -0.00000117, 0.00000000],
+		[-6.27023856, -0.00121157, 0.00074281, 0.00121793, -0.00000117, 0.00000000],
+		[-6.27024381, -0.00121110, 0.00074252, 0.00121746, -0.00000117, 0.00000000],
+		[-6.27024904, -0.00121062, 0.00074223, 0.00121698, -0.00000117, 0.00000000],
+		[-6.27025426, -0.00121015, 0.00074194, 0.00121651, -0.00000117, 0.00000000],
+		[-6.27025946, -0.00120968, 0.00074165, 0.00121603, -0.00000117, 0.00000000],
+		[-6.27026465, -0.00120921, 0.00074136, 0.00121556, -0.00000117, 0.00000000],
+		[-6.27026982, -0.00120874, 0.00074107, 0.00121509, -0.00000117, 0.00000000],
+		[-6.27027497, -0.00120827, 0.00074078, 0.00121461, -0.00000117, 0.00000000],
+		[-6.27028010, -0.00120780, 0.00074050, 0.00121414, -0.00000117, 0.00000000],
+		[-6.27028522, -0.00120732, 0.00074021, 0.00121367, -0.00000116, 0.00000000],
+		[-6.27029032, -0.00120686, 0.00073992, 0.00121319, -0.00000116, 0.00000000],
+		[-6.27029541, -0.00120639, 0.00073963, 0.00121272, -0.00000116, 0.00000000],
+		[-6.27030047, -0.00120592, 0.00073934, 0.00121225, -0.00000116, 0.00000000],
+		[-6.27030552, -0.00120545, 0.00073906, 0.00121178, -0.00000116, 0.00000000],
+		[-6.27031056, -0.00120498, 0.00073877, 0.00121131, -0.00000116, 0.00000000],
+		[-6.27031558, -0.00120451, 0.00073848, 0.00121084, -0.00000116, 0.00000000],
+		[-6.27032058, -0.00120404, 0.00073820, 0.00121037, -0.00000116, 0.00000000],
+		[-6.27032557, -0.00120358, 0.00073791, 0.00120990, -0.00000116, 0.00000000],
+		[-6.27033054, -0.00120311, 0.00073763, 0.00120943, -0.00000116, 0.00000000],
+		[-6.27033549, -0.00120264, 0.00073734, 0.00120896, -0.00000116, 0.00000000],
+		[-6.27034043, -0.00120218, 0.00073705, 0.00120849, -0.00000116, 0.00000000],
+		[-6.27034536, -0.00120171, 0.00073677, 0.00120802, -0.00000116, 0.00000000],
+		[-6.27035026, -0.00120125, 0.00073648, 0.00120755, -0.00000116, 0.00000000],
+		[-6.27035515, -0.00120078, 0.00073620, 0.00120709, -0.00000116, 0.00000000],
+		[-6.27036003, -0.00120032, 0.00073591, 0.00120662, -0.00000116, 0.00000000],
+		[-6.27036489, -0.00119985, 0.00073563, 0.00120615, -0.00000116, 0.00000000],
+		[-6.27036973, -0.00119939, 0.00073535, 0.00120569, -0.00000116, 0.00000000],
+		[-6.27037456, -0.00119892, 0.00073506, 0.00120522, -0.00000116, 0.00000000],
+		[-6.27037937, -0.00119846, 0.00073478, 0.00120475, -0.00000116, 0.00000000],
+		[-6.27038417, -0.00119800, 0.00073449, 0.00120429, -0.00000116, 0.00000000],
+		[-6.27038895, -0.00119754, 0.00073421, 0.00120382, -0.00000116, 0.00000000],
+		[-6.27039372, -0.00119707, 0.00073393, 0.00120336, -0.00000116, 0.00000000],
+		[-6.27039847, -0.00119661, 0.00073364, 0.00120289, -0.00000116, 0.00000000],
+		[-6.27040321, -0.00119615, 0.00073336, 0.00120243, -0.00000116, 0.00000000],
+		[-6.27040793, -0.00119569, 0.00073308, 0.00120197, -0.00000116, 0.00000000],
+		[-6.27041263, -0.00119523, 0.00073280, 0.00120150, -0.00000116, 0.00000000],
+		[-6.27041732, -0.00119477, 0.00073251, 0.00120104, -0.00000116, 0.00000000],
+		[-6.27042200, -0.00119431, 0.00073223, 0.00120058, -0.00000116, 0.00000000],
+		[-6.27042666, -0.00119385, 0.00073195, 0.00120011, -0.00000116, 0.00000000],
+		[-6.27043131, -0.00119339, 0.00073167, 0.00119965, -0.00000116, 0.00000000],
+		[-6.27043594, -0.00119293, 0.00073139, 0.00119919, -0.00000116, 0.00000000],
+		[-6.27044055, -0.00119247, 0.00073111, 0.00119873, -0.00000116, 0.00000000],
+		[-6.27044516, -0.00119201, 0.00073083, 0.00119827, -0.00000116, 0.00000000],
+		[-6.27044974, -0.00119155, 0.00073054, 0.00119781, -0.00000116, 0.00000000],
+		[-6.27045432, -0.00119110, 0.00073026, 0.00119735, -0.00000116, 0.00000000],
+		[-6.27045887, -0.00119064, 0.00072998, 0.00119689, -0.00000116, 0.00000000],
+		[-6.27046342, -0.00119018, 0.00072970, 0.00119643, -0.00000116, 0.00000000],
+		[-6.27046795, -0.00118973, 0.00072942, 0.00119597, -0.00000116, 0.00000000],
+		[-6.27047246, -0.00118927, 0.00072914, 0.00119551, -0.00000116, 0.00000000],
+		[-6.27047696, -0.00118881, 0.00072887, 0.00119505, -0.00000116, 0.00000000],
+		[-6.27048145, -0.00118836, 0.00072859, 0.00119459, -0.00000116, 0.00000000],
+		[-6.27048592, -0.00118790, 0.00072831, 0.00119414, -0.00000116, 0.00000000],
+		[-6.27049038, -0.00118745, 0.00072803, 0.00119368, -0.00000116, 0.00000000],
+		[-6.27049482, -0.00118699, 0.00072775, 0.00119322, -0.00000116, 0.00000000],
+		[-6.27049925, -0.00118654, 0.00072747, 0.00119277, -0.00000116, 0.00000000],
+		[-6.27050366, -0.00118609, 0.00072719, 0.00119231, -0.00000116, 0.00000000],
+		[-6.27050807, -0.00118563, 0.00072692, 0.00119185, -0.00000116, 0.00000000],
+		[-6.27051245, -0.00118518, 0.00072664, 0.00119140, -0.00000116, 0.00000000],
+		[-6.27051683, -0.00118473, 0.00072636, 0.00119094, -0.00000116, 0.00000000],
+		[-6.27052119, -0.00118427, 0.00072608, 0.00119049, -0.00000116, 0.00000000],
+		[-6.27052553, -0.00118382, 0.00072581, 0.00119003, -0.00000116, 0.00000000],
+		[-6.27052986, -0.00118337, 0.00072553, 0.00118958, -0.00000116, 0.00000000],
+		[-6.27053418, -0.00118292, 0.00072525, 0.00118912, -0.00000116, 0.00000000],
+		[-6.27053849, -0.00118247, 0.00072498, 0.00118867, -0.00000116, 0.00000000],
+		[-6.27054278, -0.00118202, 0.00072470, 0.00118822, -0.00000116, 0.00000000],
+		[-6.27054706, -0.00118157, 0.00072442, 0.00118776, -0.00000116, 0.00000000],
+		[-6.27055132, -0.00118112, 0.00072415, 0.00118731, -0.00000116, 0.00000000],
+		[-6.27055557, -0.00118067, 0.00072387, 0.00118686, -0.00000116, 0.00000000],
+		[-6.27055981, -0.00118022, 0.00072360, 0.00118641, -0.00000116, 0.00000000],
+		[-6.27056403, -0.00117977, 0.00072332, 0.00118596, -0.00000116, 0.00000000],
+		[-6.27056825, -0.00117932, 0.00072305, 0.00118550, -0.00000116, 0.00000000],
+		[-6.27057244, -0.00117887, 0.00072277, 0.00118505, -0.00000116, 0.00000000],
+		[-6.27057663, -0.00117842, 0.00072250, 0.00118460, -0.00000116, 0.00000000],
+		[-6.27058080, -0.00117798, 0.00072222, 0.00118415, -0.00000116, 0.00000000],
+		[-6.27058496, -0.00117753, 0.00072195, 0.00118370, -0.00000116, 0.00000000],
+		[-6.27058910, -0.00117708, 0.00072167, 0.00118325, -0.00000116, 0.00000000],
+		[-6.27059324, -0.00117663, 0.00072140, 0.00118280, -0.00000116, 0.00000000],
+		[-6.27059736, -0.00117619, 0.00072113, 0.00118236, -0.00000116, 0.00000000],
+		[-6.27060146, -0.00117574, 0.00072085, 0.00118191, -0.00000116, 0.00000000],
+		[-6.27060556, -0.00117530, 0.00072058, 0.00118146, -0.00000116, 0.00000000],
+		[-6.27060964, -0.00117485, 0.00072031, 0.00118101, -0.00000116, 0.00000000],
+		[-6.27061371, -0.00117441, 0.00072004, 0.00118056, -0.00000116, 0.00000000],
+		[-6.27061776, -0.00117396, 0.00071976, 0.00118012, -0.00000116, 0.00000000],
+		[-6.27062180, -0.00117352, 0.00071949, 0.00117967, -0.00000116, 0.00000000],
+		[-6.27062583, -0.00117307, 0.00071922, 0.00117922, -0.00000116, 0.00000000],
+		[-6.27062985, -0.00117263, 0.00071895, 0.00117878, -0.00000116, 0.00000000],
+		[-6.27063386, -0.00117219, 0.00071867, 0.00117833, -0.00000116, 0.00000000],
+		[-6.27063785, -0.00117174, 0.00071840, 0.00117789, -0.00000116, 0.00000000],
+		[-6.27064183, -0.00117130, 0.00071813, 0.00117744, -0.00000116, 0.00000000],
+		[-6.27064580, -0.00117086, 0.00071786, 0.00117700, -0.00000116, 0.00000000],
+		[-6.27064976, -0.00117042, 0.00071759, 0.00117655, -0.00000116, 0.00000000],
+		[-6.27065370, -0.00116997, 0.00071732, 0.00117611, -0.00000116, 0.00000000],
+		[-6.27065763, -0.00116953, 0.00071705, 0.00117566, -0.00000116, 0.00000000],
+		[-6.27066155, -0.00116909, 0.00071678, 0.00117522, -0.00000116, 0.00000000],
+		[-6.27066546, -0.00116865, 0.00071651, 0.00117478, -0.00000116, 0.00000000],
+		[-6.27066935, -0.00116821, 0.00071624, 0.00117433, -0.00000116, 0.00000000],
+		[-6.27067323, -0.00116777, 0.00071597, 0.00117389, -0.00000116, 0.00000000],
+		[-6.27067711, -0.00116733, 0.00071570, 0.00117345, -0.00000116, 0.00000000],
+		[-6.27068096, -0.00116689, 0.00071543, 0.00117301, -0.00000116, 0.00000000],
+		[-6.27068481, -0.00116645, 0.00071516, 0.00117257, -0.00000116, 0.00000000],
+		[-6.27068865, -0.00116601, 0.00071489, 0.00117212, -0.00000116, 0.00000000],
+		[-6.27069247, -0.00116558, 0.00071462, 0.00117168, -0.00000116, 0.00000000],
+		[-6.27069628, -0.00116514, 0.00071435, 0.00117124, -0.00000116, 0.00000000],
+		[-6.27070008, -0.00116470, 0.00071409, 0.00117080, -0.00000116, 0.00000000],
+		[-6.27070387, -0.00116426, 0.00071382, 0.00117036, -0.00000116, 0.00000000],
+		[-6.27070765, -0.00116383, 0.00071355, 0.00116992, -0.00000116, 0.00000000],
+		[-6.27071141, -0.00116339, 0.00071328, 0.00116948, -0.00000116, 0.00000000],
+		[-6.27071516, -0.00116295, 0.00071301, 0.00116905, -0.00000116, 0.00000000],
+		[-6.27071891, -0.00116252, 0.00071275, 0.00116861, -0.00000116, 0.00000000],
+		[-6.27072264, -0.00116208, 0.00071248, 0.00116817, -0.00000116, 0.00000000],
+		[-6.27072636, -0.00116165, 0.00071221, 0.00116773, -0.00000116, 0.00000000],
+		[-6.27073006, -0.00116121, 0.00071195, 0.00116729, -0.00000116, 0.00000000],
+		[-6.27073376, -0.00116078, 0.00071168, 0.00116686, -0.00000116, 0.00000000],
+		[-6.27073744, -0.00116034, 0.00071141, 0.00116642, -0.00000116, 0.00000000],
+		[-6.27074112, -0.00115991, 0.00071115, 0.00116598, -0.00000116, 0.00000000],
+		[-6.27074478, -0.00115947, 0.00071088, 0.00116555, -0.00000116, 0.00000000],
+		[-6.27074843, -0.00115904, 0.00071062, 0.00116511, -0.00000116, 0.00000000],
+		[-6.27075207, -0.00115861, 0.00071035, 0.00116468, -0.00000116, 0.00000000],
+		[-6.27075570, -0.00115817, 0.00071008, 0.00116424, -0.00000116, 0.00000000],
+		[-6.27075932, -0.00115774, 0.00070982, 0.00116381, -0.00000116, 0.00000000],
+		[-6.27076293, -0.00115731, 0.00070955, 0.00116337, -0.00000116, 0.00000000],
+		[-6.27076652, -0.00115688, 0.00070929, 0.00116294, -0.00000116, 0.00000000],
+		[-6.27077011, -0.00115644, 0.00070902, 0.00116250, -0.00000116, 0.00000000],
+		[-6.27077368, -0.00115601, 0.00070876, 0.00116207, -0.00000116, 0.00000000],
+		[-6.27077724, -0.00115558, 0.00070850, 0.00116164, -0.00000116, 0.00000000],
+		[-6.27078080, -0.00115515, 0.00070823, 0.00116120, -0.00000116, 0.00000000],
+		[-6.27078434, -0.00115472, 0.00070797, 0.00116077, -0.00000116, 0.00000000],
+		[-6.27078787, -0.00115429, 0.00070770, 0.00116034, -0.00000116, 0.00000000],
+		[-6.27079139, -0.00115386, 0.00070744, 0.00115991, -0.00000116, 0.00000000],
+		[-6.27079490, -0.00115343, 0.00070718, 0.00115947, -0.00000116, 0.00000000],
+		[-6.27079840, -0.00115300, 0.00070692, 0.00115904, -0.00000116, 0.00000000],
+		[-6.27080189, -0.00115257, 0.00070665, 0.00115861, -0.00000116, 0.00000000],
+		[-6.27080537, -0.00115215, 0.00070639, 0.00115818, -0.00000116, 0.00000000],
+		[-6.27080883, -0.00115172, 0.00070613, 0.00115775, -0.00000116, 0.00000000],
+		[-6.27081229, -0.00115129, 0.00070586, 0.00115732, -0.00000116, 0.00000000],
+		[-6.27081574, -0.00115086, 0.00070560, 0.00115689, -0.00000116, 0.00000000],
+		[-6.27081917, -0.00115044, 0.00070534, 0.00115646, -0.00000116, 0.00000000],
+		[-6.27082260, -0.00115001, 0.00070508, 0.00115603, -0.00000116, 0.00000000],
+		[-6.27082601, -0.00114958, 0.00070482, 0.00115560, -0.00000116, 0.00000000],
+		[-6.27082942, -0.00114916, 0.00070456, 0.00115517, -0.00000116, 0.00000000],
+		[-6.27083281, -0.00114873, 0.00070430, 0.00115475, -0.00000116, 0.00000000],
+		[-6.27083620, -0.00114830, 0.00070403, 0.00115432, -0.00000116, 0.00000000],
+		[-6.27083957, -0.00114788, 0.00070377, 0.00115389, -0.00000116, 0.00000000],
+		[-6.27084294, -0.00114745, 0.00070351, 0.00115346, -0.00000116, 0.00000000],
+		[-6.27084629, -0.00114703, 0.00070325, 0.00115304, -0.00000116, 0.00000000],
+		[-6.27084964, -0.00114661, 0.00070299, 0.00115261, -0.00000116, 0.00000000],
+		[-6.27085297, -0.00114618, 0.00070273, 0.00115218, -0.00000116, 0.00000000],
+		[-6.27085630, -0.00114576, 0.00070247, 0.00115176, -0.00000116, 0.00000000],
+		[-6.27085961, -0.00114533, 0.00070221, 0.00115133, -0.00000116, 0.00000000],
+		[-6.27086292, -0.00114491, 0.00070195, 0.00115091, -0.00000116, 0.00000000],
+		[-6.27086621, -0.00114449, 0.00070169, 0.00115048, -0.00000116, 0.00000000],
+		[-6.27086950, -0.00114407, 0.00070144, 0.00115006, -0.00000116, 0.00000000],
+		[-6.27087277, -0.00114364, 0.00070118, 0.00114963, -0.00000116, 0.00000000],
+		[-6.27087604, -0.00114322, 0.00070092, 0.00114921, -0.00000116, 0.00000000],
+		[-6.27087929, -0.00114280, 0.00070066, 0.00114878, -0.00000116, 0.00000000],
+		[-6.27088254, -0.00114238, 0.00070040, 0.00114836, -0.00000116, 0.00000000],
+		[-6.27088577, -0.00114196, 0.00070014, 0.00114794, -0.00000116, 0.00000000],
+		[-6.27088900, -0.00114154, 0.00069989, 0.00114751, -0.00000116, 0.00000000],
+		[-6.27089222, -0.00114112, 0.00069963, 0.00114709, -0.00000116, 0.00000000],
+		[-6.27089543, -0.00114070, 0.00069937, 0.00114667, -0.00000116, 0.00000000],
+		[-6.27089862, -0.00114028, 0.00069911, 0.00114625, -0.00000116, 0.00000000],
+		[-6.27090181, -0.00113986, 0.00069886, 0.00114582, -0.00000116, 0.00000000],
+		[-6.27090499, -0.00113944, 0.00069860, 0.00114540, -0.00000116, 0.00000000],
+		[-6.27090816, -0.00113902, 0.00069834, 0.00114498, -0.00000116, 0.00000000],
+		[-6.27091132, -0.00113860, 0.00069809, 0.00114456, -0.00000116, 0.00000000],
+		[-6.27091447, -0.00113818, 0.00069783, 0.00114414, -0.00000116, 0.00000000],
+		[-6.27091762, -0.00113777, 0.00069757, 0.00114372, -0.00000116, 0.00000000],
+		[-6.27092075, -0.00113735, 0.00069732, 0.00114330, -0.00000116, 0.00000000],
+		[-6.27092387, -0.00113693, 0.00069706, 0.00114288, -0.00000116, 0.00000000],
+		[-6.27092699, -0.00113651, 0.00069681, 0.00114246, -0.00000116, 0.00000000],
+		[-6.27093009, -0.00113610, 0.00069655, 0.00114204, -0.00000116, 0.00000000],
+		[-6.27093319, -0.00113568, 0.00069629, 0.00114162, -0.00000116, 0.00000000],
+		[-6.27093627, -0.00113527, 0.00069604, 0.00114121, -0.00000116, 0.00000000],
+		[-6.27093935, -0.00113485, 0.00069578, 0.00114079, -0.00000116, 0.00000000],
+		[-6.27094242, -0.00113443, 0.00069553, 0.00114037, -0.00000116, 0.00000000],
+		[-6.27094548, -0.00113402, 0.00069528, 0.00113995, -0.00000116, 0.00000000],
+		[-6.27094853, -0.00113360, 0.00069502, 0.00113954, -0.00000116, 0.00000000],
+		[-6.27095157, -0.00113319, 0.00069477, 0.00113912, -0.00000116, 0.00000000],
+		[-6.27095461, -0.00113278, 0.00069451, 0.00113870, -0.00000116, 0.00000000],
+		[-6.27095763, -0.00113236, 0.00069426, 0.00113829, -0.00000116, 0.00000000],
+		[-6.27096065, -0.00113195, 0.00069401, 0.00113787, -0.00000116, 0.00000000],
+		[-6.27096365, -0.00113154, 0.00069375, 0.00113745, -0.00000116, 0.00000000],
+		[-6.27096665, -0.00113112, 0.00069350, 0.00113704, -0.00000116, 0.00000000],
+		[-6.27096964, -0.00113071, 0.00069325, 0.00113662, -0.00000116, 0.00000000],
+		[-6.27097262, -0.00113030, 0.00069299, 0.00113621, -0.00000116, 0.00000000],
+		[-6.27097559, -0.00112989, 0.00069274, 0.00113580, -0.00000116, 0.00000000],
+		[-6.27097856, -0.00112947, 0.00069249, 0.00113538, -0.00000116, 0.00000000],
+		[-6.27098151, -0.00112906, 0.00069224, 0.00113497, -0.00000116, 0.00000000],
+		[-6.27098446, -0.00112865, 0.00069198, 0.00113455, -0.00000116, 0.00000000],
+		[-6.27098739, -0.00112824, 0.00069173, 0.00113414, -0.00000116, 0.00000000],
+		[-6.27099032, -0.00112783, 0.00069148, 0.00113373, -0.00000116, 0.00000000],
+		[-6.27099324, -0.00112742, 0.00069123, 0.00113332, -0.00000116, 0.00000000],
+		[-6.27099616, -0.00112701, 0.00069098, 0.00113290, -0.00000116, 0.00000000],
+		[-6.27099906, -0.00112660, 0.00069072, 0.00113249, -0.00000116, 0.00000000],
+		[-6.27100196, -0.00112619, 0.00069047, 0.00113208, -0.00000116, 0.00000000],
+		[-6.27100484, -0.00112578, 0.00069022, 0.00113167, -0.00000116, 0.00000000],
+		[-6.27100772, -0.00112537, 0.00068997, 0.00113126, -0.00000116, 0.00000000],
+		[-6.27101059, -0.00112496, 0.00068972, 0.00113085, -0.00000116, 0.00000000],
+		[-6.27101345, -0.00112455, 0.00068947, 0.00113044, -0.00000116, 0.00000000],
+		[-6.27101631, -0.00112415, 0.00068922, 0.00113003, -0.00000116, 0.00000000],
+		[-6.27101915, -0.00112374, 0.00068897, 0.00112962, -0.00000116, 0.00000000],
+		[-6.27102199, -0.00112333, 0.00068872, 0.00112921, -0.00000116, 0.00000000],
+		[-6.27102482, -0.00112292, 0.00068847, 0.00112880, -0.00000116, 0.00000000],
+		[-6.27102764, -0.00112252, 0.00068822, 0.00112839, -0.00000116, 0.00000000],
+		[-6.27103045, -0.00112211, 0.00068797, 0.00112798, -0.00000116, 0.00000000],
+		[-6.27103326, -0.00112171, 0.00068772, 0.00112757, -0.00000116, 0.00000000],
+		[-6.27103606, -0.00112130, 0.00068747, 0.00112716, -0.00000116, 0.00000000],
+		[-6.27103885, -0.00112089, 0.00068723, 0.00112675, -0.00000116, 0.00000000],
+		[-6.27104163, -0.00112049, 0.00068698, 0.00112635, -0.00000116, 0.00000000],
+		[-6.27104440, -0.00112008, 0.00068673, 0.00112594, -0.00000116, 0.00000000],
+		[-6.27104717, -0.00111968, 0.00068648, 0.00112553, -0.00000116, 0.00000000],
+		[-6.27104992, -0.00111927, 0.00068623, 0.00112513, -0.00000116, 0.00000000],
+		[-6.27105267, -0.00111887, 0.00068599, 0.00112472, -0.00000116, 0.00000000],
+		[-6.27105541, -0.00111847, 0.00068574, 0.00112431, -0.00000116, 0.00000000],
+		[-6.27105815, -0.00111806, 0.00068549, 0.00112391, -0.00000116, 0.00000000],
+		[-6.27106088, -0.00111766, 0.00068524, 0.00112350, -0.00000116, 0.00000000],
+		[-6.27106359, -0.00111726, 0.00068500, 0.00112310, -0.00000116, 0.00000000],
+		[-6.27106630, -0.00111685, 0.00068475, 0.00112269, -0.00000116, 0.00000000],
+		[-6.27106901, -0.00111645, 0.00068450, 0.00112229, -0.00000116, 0.00000000],
+		[-6.27107170, -0.00111605, 0.00068426, 0.00112188, -0.00000116, 0.00000000],
+		[-6.27107439, -0.00111565, 0.00068401, 0.00112148, -0.00000116, 0.00000000],
+		[-6.27107707, -0.00111525, 0.00068376, 0.00112107, -0.00000116, 0.00000000],
+		[-6.27107974, -0.00111484, 0.00068352, 0.00112067, -0.00000116, 0.00000000],
+		[-6.27108241, -0.00111444, 0.00068327, 0.00112027, -0.00000116, 0.00000000],
+		[-6.27108507, -0.00111404, 0.00068302, 0.00111987, -0.00000116, 0.00000000],
+		[-6.27108772, -0.00111364, 0.00068278, 0.00111946, -0.00000116, 0.00000000],
+		[-6.27109036, -0.00111324, 0.00068253, 0.00111906, -0.00000116, 0.00000000],
+		[-6.27109300, -0.00111284, 0.00068229, 0.00111866, -0.00000116, 0.00000000],
+		[-6.27109562, -0.00111244, 0.00068204, 0.00111826, -0.00000116, 0.00000000],
+		[-6.27109825, -0.00111204, 0.00068180, 0.00111786, -0.00000116, 0.00000000],
+		[-6.27110086, -0.00111164, 0.00068155, 0.00111745, -0.00000116, 0.00000000],
+		[-6.27110347, -0.00111125, 0.00068131, 0.00111705, -0.00000116, 0.00000000],
+		[-6.27110606, -0.00111085, 0.00068106, 0.00111665, -0.00000116, 0.00000000],
+		[-6.27110866, -0.00111045, 0.00068082, 0.00111625, -0.00000116, 0.00000000],
+		[-6.27111124, -0.00111005, 0.00068058, 0.00111585, -0.00000116, 0.00000000],
+		[-6.27111382, -0.00110965, 0.00068033, 0.00111545, -0.00000116, 0.00000000],
+		[-6.27111639, -0.00110926, 0.00068009, 0.00111505, -0.00000116, 0.00000000],
+		[-6.27111895, -0.00110886, 0.00067985, 0.00111465, -0.00000116, 0.00000000],
+		[-6.27112151, -0.00110846, 0.00067960, 0.00111425, -0.00000116, 0.00000000],
+		[-6.27112405, -0.00110807, 0.00067936, 0.00111386, -0.00000116, 0.00000000],
+		[-6.27112660, -0.00110767, 0.00067912, 0.00111346, -0.00000116, 0.00000000],
+		[-6.27112913, -0.00110728, 0.00067887, 0.00111306, -0.00000116, 0.00000000],
+		[-6.27113166, -0.00110688, 0.00067863, 0.00111266, -0.00000116, 0.00000000],
+		[-6.27113418, -0.00110648, 0.00067839, 0.00111226, -0.00000116, 0.00000000],
+		[-6.27113669, -0.00110609, 0.00067815, 0.00111187, -0.00000116, 0.00000000],
+		[-6.27113920, -0.00110569, 0.00067790, 0.00111147, -0.00000116, 0.00000000],
+		[-6.27114170, -0.00110530, 0.00067766, 0.00111107, -0.00000116, 0.00000000],
+		[-6.27114419, -0.00110491, 0.00067742, 0.00111068, -0.00000116, 0.00000000],
+		[-6.27114668, -0.00110451, 0.00067718, 0.00111028, -0.00000116, 0.00000000],
+		[-6.27114915, -0.00110412, 0.00067694, 0.00110989, -0.00000116, 0.00000000],
+		[-6.27115163, -0.00110372, 0.00067670, 0.00110949, -0.00000116, 0.00000000],
+		[-6.27115409, -0.00110333, 0.00067646, 0.00110910, -0.00000116, 0.00000000],
+		[-6.27115655, -0.00110294, 0.00067621, 0.00110870, -0.00000116, 0.00000000],
+		[-6.27115900, -0.00110255, 0.00067597, 0.00110831, -0.00000116, 0.00000000],
+		[-6.27116145, -0.00110215, 0.00067573, 0.00110791, -0.00000116, 0.00000000],
+		[-6.27116389, -0.00110176, 0.00067549, 0.00110752, -0.00000116, 0.00000000],
+		[-6.27116632, -0.00110137, 0.00067525, 0.00110712, -0.00000116, 0.00000000],
+		[-6.27116874, -0.00110098, 0.00067501, 0.00110673, -0.00000116, 0.00000000],
+		[-6.27117116, -0.00110059, 0.00067477, 0.00110634, -0.00000115, 0.00000000],
+		[-6.27117357, -0.00110020, 0.00067453, 0.00110594, -0.00000115, 0.00000000],
+		[-6.27117598, -0.00109981, 0.00067429, 0.00110555, -0.00000115, 0.00000000],
+		[-6.27117838, -0.00109942, 0.00067405, 0.00110516, -0.00000115, 0.00000000],
+		[-6.27118077, -0.00109903, 0.00067381, 0.00110477, -0.00000115, 0.00000000],
+		[-6.27118315, -0.00109864, 0.00067358, 0.00110437, -0.00000115, 0.00000000],
+		[-6.27118553, -0.00109825, 0.00067334, 0.00110398, -0.00000115, 0.00000000],
+		[-6.27118791, -0.00109786, 0.00067310, 0.00110359, -0.00000115, 0.00000000],
+		[-6.27119027, -0.00109747, 0.00067286, 0.00110320, -0.00000115, 0.00000000],
+		[-6.27119263, -0.00109708, 0.00067262, 0.00110281, -0.00000115, 0.00000000],
+		[-6.27119499, -0.00109669, 0.00067238, 0.00110242, -0.00000115, 0.00000000],
+		[-6.27119733, -0.00109630, 0.00067214, 0.00110203, -0.00000115, 0.00000000],
+		[-6.27119968, -0.00109592, 0.00067191, 0.00110164, -0.00000115, 0.00000000],
+		[-6.27120201, -0.00109553, 0.00067167, 0.00110125, -0.00000115, 0.00000000],
+		[-6.27120434, -0.00109514, 0.00067143, 0.00110086, -0.00000115, 0.00000000],
+		[-6.27120666, -0.00109475, 0.00067119, 0.00110047, -0.00000115, 0.00000000],
+		[-6.27120898, -0.00109437, 0.00067096, 0.00110008, -0.00000115, 0.00000000],
+		[-6.27121129, -0.00109398, 0.00067072, 0.00109969, -0.00000115, 0.00000000],
+		[-6.27121359, -0.00109360, 0.00067048, 0.00109930, -0.00000115, 0.00000000],
+		[-6.27121589, -0.00109321, 0.00067025, 0.00109892, -0.00000115, 0.00000000],
+		[-6.27121818, -0.00109282, 0.00067001, 0.00109853, -0.00000115, 0.00000000],
+		[-6.27122046, -0.00109244, 0.00066977, 0.00109814, -0.00000115, 0.00000000],
+		[-6.27122274, -0.00109205, 0.00066954, 0.00109775, -0.00000115, 0.00000000],
+		[-6.27122501, -0.00109167, 0.00066930, 0.00109737, -0.00000115, 0.00000000],
+		[-6.27122728, -0.00109128, 0.00066907, 0.00109698, -0.00000115, 0.00000000],
+		[-6.27122954, -0.00109090, 0.00066883, 0.00109659, -0.00000115, 0.00000000],
+		[-6.27123179, -0.00109052, 0.00066859, 0.00109621, -0.00000115, 0.00000000],
+		[-6.27123404, -0.00109013, 0.00066836, 0.00109582, -0.00000115, 0.00000000],
+		[-6.27123629, -0.00108975, 0.00066812, 0.00109544, -0.00000115, 0.00000000],
+		[-6.27123852, -0.00108937, 0.00066789, 0.00109505, -0.00000115, 0.00000000],
+		[-6.27124075, -0.00108898, 0.00066765, 0.00109467, -0.00000115, 0.00000000],
+		[-6.27124298, -0.00108860, 0.00066742, 0.00109428, -0.00000115, 0.00000000],
+		[-6.27124520, -0.00108822, 0.00066718, 0.00109390, -0.00000115, 0.00000000],
+		[-6.27124741, -0.00108784, 0.00066695, 0.00109351, -0.00000115, 0.00000000],
+		[-6.27124962, -0.00108745, 0.00066672, 0.00109313, -0.00000115, 0.00000000],
+		[-6.27125182, -0.00108707, 0.00066648, 0.00109275, -0.00000115, 0.00000000],
+		[-6.27125401, -0.00108669, 0.00066625, 0.00109236, -0.00000115, 0.00000000],
+		[-6.27125620, -0.00108631, 0.00066601, 0.00109198, -0.00000115, 0.00000000],
+		[-6.27125839, -0.00108593, 0.00066578, 0.00109160, -0.00000115, 0.00000000],
+		[-6.27126057, -0.00108555, 0.00066555, 0.00109121, -0.00000115, 0.00000000],
+		[-6.27126274, -0.00108517, 0.00066531, 0.00109083, -0.00000115, 0.00000000],
+		[-6.27126490, -0.00108479, 0.00066508, 0.00109045, -0.00000115, 0.00000000],
+		[-6.27126707, -0.00108441, 0.00066485, 0.00109007, -0.00000115, 0.00000000],
+		[-6.27126922, -0.00108403, 0.00066461, 0.00108969, -0.00000115, 0.00000000],
+		[-6.27127137, -0.00108365, 0.00066438, 0.00108930, -0.00000115, 0.00000000],
+		[-6.27127351, -0.00108327, 0.00066415, 0.00108892, -0.00000115, 0.00000000],
+		[-6.27127565, -0.00108289, 0.00066392, 0.00108854, -0.00000115, 0.00000000],
+		[-6.27127779, -0.00108251, 0.00066369, 0.00108816, -0.00000115, 0.00000000],
+		[-6.27127991, -0.00108214, 0.00066345, 0.00108778, -0.00000115, 0.00000000],
+		[-6.27128204, -0.00108176, 0.00066322, 0.00108740, -0.00000115, 0.00000000],
+		[-6.27128415, -0.00108138, 0.00066299, 0.00108702, -0.00000115, 0.00000000],
+		[-6.27128626, -0.00108100, 0.00066276, 0.00108664, -0.00000115, 0.00000000],
+		[-6.27128837, -0.00108063, 0.00066253, 0.00108626, -0.00000115, 0.00000000],
+		[-6.27129047, -0.00108025, 0.00066230, 0.00108588, -0.00000115, 0.00000000],
+		[-6.27129256, -0.00107987, 0.00066206, 0.00108551, -0.00000115, 0.00000000],
+		[-6.27129465, -0.00107950, 0.00066183, 0.00108513, -0.00000115, 0.00000000],
+		[-6.27129674, -0.00107912, 0.00066160, 0.00108475, -0.00000115, 0.00000000],
+		[-6.27129881, -0.00107874, 0.00066137, 0.00108437, -0.00000115, 0.00000000],
+		[-6.27130089, -0.00107837, 0.00066114, 0.00108399, -0.00000115, 0.00000000],
+		[-6.27130295, -0.00107799, 0.00066091, 0.00108362, -0.00000115, 0.00000000],
+		[-6.27130502, -0.00107762, 0.00066068, 0.00108324, -0.00000115, 0.00000000],
+		[-6.27130707, -0.00107724, 0.00066045, 0.00108286, -0.00000115, 0.00000000],
+		[-6.27130913, -0.00107687, 0.00066022, 0.00108249, -0.00000115, 0.00000000],
+		[-6.27131117, -0.00107649, 0.00065999, 0.00108211, -0.00000115, 0.00000000],
+		[-6.27131321, -0.00107612, 0.00065976, 0.00108173, -0.00000115, 0.00000000],
+		[-6.27131525, -0.00107575, 0.00065953, 0.00108136, -0.00000115, 0.00000000],
+		[-6.27131728, -0.00107537, 0.00065931, 0.00108098, -0.00000115, 0.00000000],
+		[-6.27131930, -0.00107500, 0.00065908, 0.00108061, -0.00000115, 0.00000000],
+		[-6.27132133, -0.00107463, 0.00065885, 0.00108023, -0.00000115, 0.00000000],
+		[-6.27132334, -0.00107425, 0.00065862, 0.00107986, -0.00000115, 0.00000000],
+		[-6.27132535, -0.00107388, 0.00065839, 0.00107948, -0.00000115, 0.00000000],
+		[-6.27132736, -0.00107351, 0.00065816, 0.00107911, -0.00000115, 0.00000000],
+		[-6.27132936, -0.00107314, 0.00065793, 0.00107873, -0.00000115, 0.00000000],
+		[-6.27133135, -0.00107277, 0.00065771, 0.00107836, -0.00000115, 0.00000000],
+		[-6.27133334, -0.00107239, 0.00065748, 0.00107799, -0.00000115, 0.00000000],
+		[-6.27133532, -0.00107202, 0.00065725, 0.00107761, -0.00000115, 0.00000000],
+		[-6.27133730, -0.00107165, 0.00065702, 0.00107724, -0.00000115, 0.00000000],
+		[-6.27133928, -0.00107128, 0.00065680, 0.00107687, -0.00000115, 0.00000000],
+		[-6.27134125, -0.00107091, 0.00065657, 0.00107650, -0.00000115, 0.00000000],
+		[-6.27134321, -0.00107054, 0.00065634, 0.00107612, -0.00000115, 0.00000000],
+		[-6.27134517, -0.00107017, 0.00065611, 0.00107575, -0.00000115, 0.00000000],
+		[-6.27134713, -0.00106980, 0.00065589, 0.00107538, -0.00000115, 0.00000000],
+		[-6.27134908, -0.00106943, 0.00065566, 0.00107501, -0.00000115, 0.00000000],
+		[-6.27135102, -0.00106906, 0.00065543, 0.00107464, -0.00000115, 0.00000000],
+		[-6.27135296, -0.00106870, 0.00065521, 0.00107427, -0.00000115, 0.00000000],
+		[-6.27135490, -0.00106833, 0.00065498, 0.00107390, -0.00000115, 0.00000000],
+		[-6.27135683, -0.00106796, 0.00065476, 0.00107353, -0.00000115, 0.00000000],
+		[-6.27135875, -0.00106759, 0.00065453, 0.00107316, -0.00000115, 0.00000000],
+		[-6.27136067, -0.00106722, 0.00065430, 0.00107279, -0.00000115, 0.00000000],
+		[-6.27136259, -0.00106685, 0.00065408, 0.00107242, -0.00000115, 0.00000000],
+		[-6.27136450, -0.00106649, 0.00065385, 0.00107205, -0.00000115, 0.00000000],
+		[-6.27136641, -0.00106612, 0.00065363, 0.00107168, -0.00000115, 0.00000000],
+		[-6.27136831, -0.00106575, 0.00065340, 0.00107131, -0.00000115, 0.00000000],
+		[-6.27137021, -0.00106539, 0.00065318, 0.00107094, -0.00000115, 0.00000000],
+		[-6.27137210, -0.00106502, 0.00065295, 0.00107057, -0.00000115, 0.00000000],
+		[-6.27137399, -0.00106465, 0.00065273, 0.00107020, -0.00000115, 0.00000000],
+		[-6.27137587, -0.00106429, 0.00065250, 0.00106984, -0.00000115, 0.00000000],
+		[-6.27137775, -0.00106392, 0.00065228, 0.00106947, -0.00000115, 0.00000000],
+		[-6.27137962, -0.00106356, 0.00065206, 0.00106910, -0.00000115, 0.00000000],
+		[-6.27138149, -0.00106319, 0.00065183, 0.00106873, -0.00000115, 0.00000000],
+		[-6.27138335, -0.00106283, 0.00065161, 0.00106837, -0.00000115, 0.00000000],
+		[-6.27138521, -0.00106246, 0.00065139, 0.00106800, -0.00000115, 0.00000000],
+		[-6.27138707, -0.00106210, 0.00065116, 0.00106763, -0.00000115, 0.00000000],
+		[-6.27138892, -0.00106173, 0.00065094, 0.00106727, -0.00000115, 0.00000000],
+		[-6.27139077, -0.00106137, 0.00065072, 0.00106690, -0.00000115, 0.00000000],
+		[-6.27139261, -0.00106101, 0.00065049, 0.00106654, -0.00000115, 0.00000000],
+		[-6.27139445, -0.00106064, 0.00065027, 0.00106617, -0.00000115, 0.00000000],
+		[-6.27139628, -0.00106028, 0.00065005, 0.00106581, -0.00000115, 0.00000000],
+		[-6.27139811, -0.00105992, 0.00064982, 0.00106544, -0.00000115, 0.00000000],
+		[-6.27139993, -0.00105956, 0.00064960, 0.00106508, -0.00000115, 0.00000000],
+		[-6.27140175, -0.00105919, 0.00064938, 0.00106471, -0.00000115, 0.00000000],
+		[-6.27140356, -0.00105883, 0.00064916, 0.00106435, -0.00000115, 0.00000000],
+		[-6.27140537, -0.00105847, 0.00064893, 0.00106399, -0.00000115, 0.00000000],
+		[-6.27140718, -0.00105811, 0.00064871, 0.00106362, -0.00000115, 0.00000000],
+		[-6.27140898, -0.00105775, 0.00064849, 0.00106326, -0.00000115, 0.00000000],
+		[-6.27141078, -0.00105739, 0.00064827, 0.00106290, -0.00000115, 0.00000000],
+		[-6.27141257, -0.00105702, 0.00064805, 0.00106253, -0.00000115, 0.00000000],
+		[-6.27141436, -0.00105666, 0.00064783, 0.00106217, -0.00000115, 0.00000000],
+		[-6.27141614, -0.00105630, 0.00064761, 0.00106181, -0.00000115, 0.00000000],
+		[-6.27141792, -0.00105594, 0.00064739, 0.00106145, -0.00000115, 0.00000000],
+		[-6.27141970, -0.00105558, 0.00064716, 0.00106108, -0.00000115, 0.00000000],
+		[-6.27142147, -0.00105522, 0.00064694, 0.00106072, -0.00000115, 0.00000000],
+		[-6.27142324, -0.00105486, 0.00064672, 0.00106036, -0.00000115, 0.00000000],
+		[-6.27142500, -0.00105451, 0.00064650, 0.00106000, -0.00000115, 0.00000000],
+		[-6.27142676, -0.00105415, 0.00064628, 0.00105964, -0.00000115, 0.00000000],
+		[-6.27142851, -0.00105379, 0.00064606, 0.00105928, -0.00000115, 0.00000000],
+		[-6.27143026, -0.00105343, 0.00064584, 0.00105892, -0.00000115, 0.00000000],
+		[-6.27143201, -0.00105307, 0.00064562, 0.00105856, -0.00000115, 0.00000000],
+		[-6.27143375, -0.00105271, 0.00064540, 0.00105820, -0.00000115, 0.00000000],
+		[-6.27143549, -0.00105236, 0.00064518, 0.00105784, -0.00000115, 0.00000000],
+		[-6.27143722, -0.00105200, 0.00064496, 0.00105748, -0.00000115, 0.00000000],
+		[-6.27143895, -0.00105164, 0.00064475, 0.00105712, -0.00000115, 0.00000000],
+		[-6.27144068, -0.00105128, 0.00064453, 0.00105676, -0.00000115, 0.00000000],
+		[-6.27144240, -0.00105093, 0.00064431, 0.00105640, -0.00000115, 0.00000000],
+		[-6.27144412, -0.00105057, 0.00064409, 0.00105604, -0.00000115, 0.00000000],
+		[-6.27144583, -0.00105021, 0.00064387, 0.00105569, -0.00000115, 0.00000000],
+		[-6.27144754, -0.00104986, 0.00064365, 0.00105533, -0.00000115, 0.00000000],
+		[-6.27144924, -0.00104950, 0.00064343, 0.00105497, -0.00000115, 0.00000000],
+		[-6.27145094, -0.00104915, 0.00064322, 0.00105461, -0.00000115, 0.00000000],
+		[-6.27145264, -0.00104879, 0.00064300, 0.00105425, -0.00000115, 0.00000000],
+		[-6.27145433, -0.00104844, 0.00064278, 0.00105390, -0.00000115, 0.00000000],
+		[-6.27145602, -0.00104808, 0.00064256, 0.00105354, -0.00000115, 0.00000000],
+		[-6.27145771, -0.00104773, 0.00064234, 0.00105318, -0.00000115, 0.00000000],
+		[-6.27145939, -0.00104737, 0.00064213, 0.00105283, -0.00000115, 0.00000000],
+		[-6.27146107, -0.00104702, 0.00064191, 0.00105247, -0.00000115, 0.00000000],
+		[-6.27146274, -0.00104667, 0.00064169, 0.00105212, -0.00000115, 0.00000000],
+		[-6.27146441, -0.00104631, 0.00064148, 0.00105176, -0.00000115, 0.00000000],
+		[-6.27146607, -0.00104596, 0.00064126, 0.00105141, -0.00000115, 0.00000000],
+		[-6.27146774, -0.00104561, 0.00064104, 0.00105105, -0.00000115, 0.00000000],
+		[-6.27146939, -0.00104525, 0.00064083, 0.00105070, -0.00000115, 0.00000000],
+		[-6.27147105, -0.00104490, 0.00064061, 0.00105034, -0.00000115, 0.00000000],
+		[-6.27147270, -0.00104455, 0.00064039, 0.00104999, -0.00000115, 0.00000000],
+		[-6.27147434, -0.00104420, 0.00064018, 0.00104963, -0.00000115, 0.00000000],
+		[-6.27147599, -0.00104384, 0.00063996, 0.00104928, -0.00000115, 0.00000000],
+		[-6.27147762, -0.00104349, 0.00063975, 0.00104893, -0.00000115, 0.00000000],
+		[-6.27147926, -0.00104314, 0.00063953, 0.00104857, -0.00000115, 0.00000000],
+		[-6.27148089, -0.00104279, 0.00063931, 0.00104822, -0.00000115, 0.00000000],
+		[-6.27148252, -0.00104244, 0.00063910, 0.00104787, -0.00000115, 0.00000000],
+		[-6.27148414, -0.00104209, 0.00063888, 0.00104751, -0.00000115, 0.00000000],
+		[-6.27148576, -0.00104174, 0.00063867, 0.00104716, -0.00000115, 0.00000000],
+		[-6.27148738, -0.00104139, 0.00063845, 0.00104681, -0.00000115, 0.00000000],
+		[-6.27148899, -0.00104104, 0.00063824, 0.00104646, -0.00000115, 0.00000000],
+		[-6.27149060, -0.00104069, 0.00063802, 0.00104610, -0.00000115, 0.00000000],
+		[-6.27149220, -0.00104034, 0.00063781, 0.00104575, -0.00000115, 0.00000000],
+		[-6.27149380, -0.00103999, 0.00063760, 0.00104540, -0.00000115, 0.00000000],
+		[-6.27149540, -0.00103964, 0.00063738, 0.00104505, -0.00000115, 0.00000000],
+		[-6.27149699, -0.00103929, 0.00063717, 0.00104470, -0.00000115, 0.00000000],
+		[-6.27149859, -0.00103894, 0.00063695, 0.00104435, -0.00000115, 0.00000000],
+		[-6.27150017, -0.00103859, 0.00063674, 0.00104400, -0.00000115, 0.00000000],
+		[-6.27150175, -0.00103824, 0.00063653, 0.00104365, -0.00000115, 0.00000000],
+		[-6.27150333, -0.00103790, 0.00063631, 0.00104330, -0.00000115, 0.00000000],
+		[-6.27150491, -0.00103755, 0.00063610, 0.00104295, -0.00000115, 0.00000000],
+		[-6.27150648, -0.00103720, 0.00063589, 0.00104260, -0.00000115, 0.00000000],
+		[-6.27150805, -0.00103685, 0.00063567, 0.00104225, -0.00000115, 0.00000000],
+		[-6.27150962, -0.00103651, 0.00063546, 0.00104190, -0.00000115, 0.00000000],
+		[-6.27151118, -0.00103616, 0.00063525, 0.00104155, -0.00000115, 0.00000000],
+		[-6.27151274, -0.00103581, 0.00063503, 0.00104120, -0.00000115, 0.00000000],
+		[-6.27151429, -0.00103547, 0.00063482, 0.00104086, -0.00000115, 0.00000000],
+		[-6.27151584, -0.00103512, 0.00063461, 0.00104051, -0.00000115, 0.00000000],
+		[-6.27151739, -0.00103478, 0.00063440, 0.00104016, -0.00000115, 0.00000000],
+		[-6.27151893, -0.00103443, 0.00063419, 0.00103981, -0.00000115, 0.00000000],
+		[-6.27152048, -0.00103408, 0.00063397, 0.00103947, -0.00000115, 0.00000000],
+		[-6.27152201, -0.00103374, 0.00063376, 0.00103912, -0.00000115, 0.00000000],
+		[-6.27152355, -0.00103339, 0.00063355, 0.00103877, -0.00000115, 0.00000000],
+		[-6.27152508, -0.00103305, 0.00063334, 0.00103843, -0.00000115, 0.00000000],
+		[-6.27152660, -0.00103270, 0.00063313, 0.00103808, -0.00000115, 0.00000000],
+		[-6.27152813, -0.00103236, 0.00063292, 0.00103773, -0.00000115, 0.00000000],
+		[-6.27152965, -0.00103202, 0.00063271, 0.00103739, -0.00000115, 0.00000000],
+		[-6.27153117, -0.00103167, 0.00063249, 0.00103704, -0.00000115, 0.00000000],
+		[-6.27153268, -0.00103133, 0.00063228, 0.00103670, -0.00000115, 0.00000000],
+		[-6.27153419, -0.00103099, 0.00063207, 0.00103635, -0.00000115, 0.00000000],
+		[-6.27153570, -0.00103064, 0.00063186, 0.00103601, -0.00000115, 0.00000000],
+		[-6.27153720, -0.00103030, 0.00063165, 0.00103566, -0.00000115, 0.00000000],
+		[-6.27153870, -0.00102996, 0.00063144, 0.00103532, -0.00000115, 0.00000000],
+		[-6.27154020, -0.00102961, 0.00063123, 0.00103497, -0.00000115, 0.00000000],
+		[-6.27154169, -0.00102927, 0.00063102, 0.00103463, -0.00000115, 0.00000000],
+		[-6.27154318, -0.00102893, 0.00063081, 0.00103428, -0.00000115, 0.00000000],
+		[-6.27154467, -0.00102859, 0.00063060, 0.00103394, -0.00000115, 0.00000000],
+		[-6.27154615, -0.00102825, 0.00063039, 0.00103360, -0.00000115, 0.00000000],
+		[-6.27154763, -0.00102791, 0.00063018, 0.00103325, -0.00000115, 0.00000000],
+		[-6.27154911, -0.00102756, 0.00062997, 0.00103291, -0.00000115, 0.00000000],
+		[-6.27155059, -0.00102722, 0.00062976, 0.00103257, -0.00000115, 0.00000000],
+		[-6.27155206, -0.00102688, 0.00062956, 0.00103223, -0.00000115, 0.00000000],
+		[-6.27155352, -0.00102654, 0.00062935, 0.00103188, -0.00000115, 0.00000000],
+		[-6.27155499, -0.00102620, 0.00062914, 0.00103154, -0.00000115, 0.00000000],
+		[-6.27155645, -0.00102586, 0.00062893, 0.00103120, -0.00000115, 0.00000000],
+		[-6.27155791, -0.00102552, 0.00062872, 0.00103086, -0.00000115, 0.00000000],
+		[-6.27155936, -0.00102518, 0.00062851, 0.00103052, -0.00000115, 0.00000000],
+		[-6.27156082, -0.00102484, 0.00062830, 0.00103018, -0.00000115, 0.00000000],
+		[-6.27156226, -0.00102451, 0.00062810, 0.00102983, -0.00000115, 0.00000000],
+		[-6.27156371, -0.00102417, 0.00062789, 0.00102949, -0.00000115, 0.00000000],
+		[-6.27156515, -0.00102383, 0.00062768, 0.00102915, -0.00000115, 0.00000000],
+		[-6.27156659, -0.00102349, 0.00062747, 0.00102881, -0.00000115, 0.00000000],
+		[-6.27156803, -0.00102315, 0.00062727, 0.00102847, -0.00000115, 0.00000000],
+		[-6.27156946, -0.00102281, 0.00062706, 0.00102813, -0.00000115, 0.00000000],
+		[-6.27157089, -0.00102248, 0.00062685, 0.00102779, -0.00000115, 0.00000000],
+		[-6.27157232, -0.00102214, 0.00062664, 0.00102745, -0.00000115, 0.00000000],
+		[-6.27157374, -0.00102180, 0.00062644, 0.00102712, -0.00000115, 0.00000000],
+		[-6.27157517, -0.00102146, 0.00062623, 0.00102678, -0.00000115, 0.00000000],
+		[-6.27157658, -0.00102113, 0.00062602, 0.00102644, -0.00000115, 0.00000000],
+		[-6.27157800, -0.00102079, 0.00062582, 0.00102610, -0.00000115, 0.00000000],
+		[-6.27157941, -0.00102045, 0.00062561, 0.00102576, -0.00000115, 0.00000000],
+		[-6.27158082, -0.00102012, 0.00062540, 0.00102542, -0.00000115, 0.00000000],
+		[-6.27158223, -0.00101978, 0.00062520, 0.00102509, -0.00000115, 0.00000000],
+		[-6.27158363, -0.00101945, 0.00062499, 0.00102475, -0.00000115, 0.00000000],
+		[-6.27158503, -0.00101911, 0.00062479, 0.00102441, -0.00000115, 0.00000000],
+		[-6.27158643, -0.00101878, 0.00062458, 0.00102407, -0.00000115, 0.00000000],
+		[-6.27158782, -0.00101844, 0.00062438, 0.00102374, -0.00000115, 0.00000000],
+		[-6.27158921, -0.00101811, 0.00062417, 0.00102340, -0.00000115, 0.00000000],
+		[-6.27159060, -0.00101777, 0.00062396, 0.00102306, -0.00000115, 0.00000000],
+		[-6.27159199, -0.00101744, 0.00062376, 0.00102273, -0.00000115, 0.00000000],
+		[-6.27159337, -0.00101710, 0.00062355, 0.00102239, -0.00000115, 0.00000000],
+		[-6.27159475, -0.00101677, 0.00062335, 0.00102206, -0.00000115, 0.00000000],
+		[-6.27159613, -0.00101644, 0.00062314, 0.00102172, -0.00000115, 0.00000000],
+		[-6.27159750, -0.00101610, 0.00062294, 0.00102138, -0.00000115, 0.00000000],
+		[-6.27159887, -0.00101577, 0.00062274, 0.00102105, -0.00000115, 0.00000000],
+		[-6.27160024, -0.00101544, 0.00062253, 0.00102071, -0.00000115, 0.00000000],
+		[-6.27160160, -0.00101510, 0.00062233, 0.00102038, -0.00000115, 0.00000000],
+		[-6.27160297, -0.00101477, 0.00062212, 0.00102005, -0.00000115, 0.00000000],
+		[-6.27160433, -0.00101444, 0.00062192, 0.00101971, -0.00000115, 0.00000000],
+		[-6.27160568, -0.00101410, 0.00062171, 0.00101938, -0.00000115, 0.00000000],
+		[-6.27160704, -0.00101377, 0.00062151, 0.00101904, -0.00000115, 0.00000000],
+		[-6.27160839, -0.00101344, 0.00062131, 0.00101871, -0.00000115, 0.00000000],
+		[-6.27160974, -0.00101311, 0.00062110, 0.00101838, -0.00000115, 0.00000000],
+		[-6.27161108, -0.00101278, 0.00062090, 0.00101804, -0.00000115, 0.00000000],
+		[-6.27161243, -0.00101245, 0.00062070, 0.00101771, -0.00000115, 0.00000000],
+		[-6.27161377, -0.00101212, 0.00062049, 0.00101738, -0.00000115, 0.00000000],
+		[-6.27161511, -0.00101179, 0.00062029, 0.00101705, -0.00000115, 0.00000000],
+		[-6.27161644, -0.00101146, 0.00062009, 0.00101671, -0.00000115, 0.00000000],
+		[-6.27161777, -0.00101112, 0.00061989, 0.00101638, -0.00000115, 0.00000000],
+		[-6.27161910, -0.00101079, 0.00061968, 0.00101605, -0.00000115, 0.00000000],
+		[-6.27162043, -0.00101046, 0.00061948, 0.00101572, -0.00000115, 0.00000000],
+		[-6.27162175, -0.00101014, 0.00061928, 0.00101539, -0.00000115, 0.00000000],
+		[-6.27162307, -0.00100981, 0.00061908, 0.00101505, -0.00000115, 0.00000000],
+		[-6.27162439, -0.00100948, 0.00061887, 0.00101472, -0.00000115, 0.00000000],
+		[-6.27162571, -0.00100915, 0.00061867, 0.00101439, -0.00000115, 0.00000000],
+		[-6.27162702, -0.00100882, 0.00061847, 0.00101406, -0.00000115, 0.00000000],
+		[-6.27162833, -0.00100849, 0.00061827, 0.00101373, -0.00000115, 0.00000000],
+		[-6.27162964, -0.00100816, 0.00061807, 0.00101340, -0.00000115, 0.00000000],
+		[-6.27163095, -0.00100783, 0.00061787, 0.00101307, -0.00000115, 0.00000000],
+		[-6.27163225, -0.00100751, 0.00061767, 0.00101274, -0.00000115, 0.00000000],
+		[-6.27163355, -0.00100718, 0.00061746, 0.00101241, -0.00000115, 0.00000000],
+		[-6.27163485, -0.00100685, 0.00061726, 0.00101208, -0.00000115, 0.00000000],
+		[-6.27163614, -0.00100652, 0.00061706, 0.00101175, -0.00000115, 0.00000000],
+		[-6.27163743, -0.00100620, 0.00061686, 0.00101143, -0.00000115, 0.00000000],
+		[-6.27163872, -0.00100587, 0.00061666, 0.00101110, -0.00000115, 0.00000000],
+		[-6.27164001, -0.00100554, 0.00061646, 0.00101077, -0.00000115, 0.00000000],
+		[-6.27164130, -0.00100522, 0.00061626, 0.00101044, -0.00000115, 0.00000000],
+		[-6.27164258, -0.00100489, 0.00061606, 0.00101011, -0.00000115, 0.00000000],
+		[-6.27164386, -0.00100456, 0.00061586, 0.00100978, -0.00000115, 0.00000000],
+		[-6.27164513, -0.00100424, 0.00061566, 0.00100946, -0.00000115, 0.00000000],
+		[-6.27164641, -0.00100391, 0.00061546, 0.00100913, -0.00000114, 0.00000000],
+		[-6.27164768, -0.00100359, 0.00061526, 0.00100880, -0.00000114, 0.00000000],
+		[-6.27164895, -0.00100326, 0.00061506, 0.00100848, -0.00000114, 0.00000000],
+		[-6.27165022, -0.00100294, 0.00061486, 0.00100815, -0.00000114, 0.00000000],
+		[-6.27165148, -0.00100261, 0.00061466, 0.00100782, -0.00000114, 0.00000000],
+		[-6.27165274, -0.00100229, 0.00061446, 0.00100750, -0.00000114, 0.00000000],
+		[-6.27165400, -0.00100196, 0.00061427, 0.00100717, -0.00000114, 0.00000000],
+		[-6.27165526, -0.00100164, 0.00061407, 0.00100684, -0.00000114, 0.00000000],
+		[-6.27165651, -0.00100132, 0.00061387, 0.00100652, -0.00000114, 0.00000000],
+		[-6.27165777, -0.00100099, 0.00061367, 0.00100619, -0.00000114, 0.00000000],
+		[-6.27165902, -0.00100067, 0.00061347, 0.00100587, -0.00000114, 0.00000000],
+		[-6.27166026, -0.00100035, 0.00061327, 0.00100554, -0.00000114, 0.00000000],
+		[-6.27166151, -0.00100002, 0.00061307, 0.00100522, -0.00000114, 0.00000000],
+		[-6.27166275, -0.00099970, 0.00061288, 0.00100489, -0.00000114, 0.00000000],
+		[-6.27166399, -0.00099938, 0.00061268, 0.00100457, -0.00000114, 0.00000000],
+		[-6.27166523, -0.00099905, 0.00061248, 0.00100424, -0.00000114, 0.00000000],
+		[-6.27166646, -0.00099873, 0.00061228, 0.00100392, -0.00000114, 0.00000000],
+		[-6.27166770, -0.00099841, 0.00061208, 0.00100360, -0.00000114, 0.00000000],
+		[-6.27166893, -0.00099809, 0.00061189, 0.00100327, -0.00000114, 0.00000000],
+		[-6.27167015, -0.00099777, 0.00061169, 0.00100295, -0.00000114, 0.00000000],
+		[-6.27167138, -0.00099745, 0.00061149, 0.00100263, -0.00000114, 0.00000000],
+		[-6.27167260, -0.00099712, 0.00061130, 0.00100230, -0.00000114, 0.00000000],
+		[-6.27167382, -0.00099680, 0.00061110, 0.00100198, -0.00000114, 0.00000000],
+		[-6.27167504, -0.00099648, 0.00061090, 0.00100166, -0.00000114, 0.00000000],
+		[-6.27167626, -0.00099616, 0.00061070, 0.00100134, -0.00000114, 0.00000000],
+		[-6.27167747, -0.00099584, 0.00061051, 0.00100101, -0.00000114, 0.00000000],
+		[-6.27167868, -0.00099552, 0.00061031, 0.00100069, -0.00000114, 0.00000000],
+		[-6.27167989, -0.00099520, 0.00061012, 0.00100037, -0.00000114, 0.00000000],
+		[-6.27168110, -0.00099488, 0.00060992, 0.00100005, -0.00000114, 0.00000000],
+		[-6.27168231, -0.00099456, 0.00060972, 0.00099973, -0.00000114, 0.00000000],
+		[-6.27168351, -0.00099424, 0.00060953, 0.00099941, -0.00000114, 0.00000000],
+		[-6.27168471, -0.00099392, 0.00060933, 0.00099909, -0.00000114, 0.00000000],
+		[-6.27168591, -0.00099360, 0.00060914, 0.00099877, -0.00000114, 0.00000000],
+		[-6.27168710, -0.00099329, 0.00060894, 0.00099844, -0.00000114, 0.00000000],
+		[-6.27168829, -0.00099297, 0.00060874, 0.00099812, -0.00000114, 0.00000000],
+		[-6.27168949, -0.00099265, 0.00060855, 0.00099780, -0.00000114, 0.00000000],
+		[-6.27169067, -0.00099233, 0.00060835, 0.00099748, -0.00000114, 0.00000000],
+		[-6.27169186, -0.00099201, 0.00060816, 0.00099716, -0.00000114, 0.00000000],
+		[-6.27169305, -0.00099170, 0.00060796, 0.00099685, -0.00000114, 0.00000000],
+		[-6.27169423, -0.00099138, 0.00060777, 0.00099653, -0.00000114, 0.00000000],
+		[-6.27169541, -0.00099106, 0.00060757, 0.00099621, -0.00000114, 0.00000000],
+		[-6.27169659, -0.00099074, 0.00060738, 0.00099589, -0.00000114, 0.00000000],
+		[-6.27169776, -0.00099043, 0.00060719, 0.00099557, -0.00000114, 0.00000000],
+		[-6.27169893, -0.00099011, 0.00060699, 0.00099525, -0.00000114, 0.00000000],
+		[-6.27170011, -0.00098979, 0.00060680, 0.00099493, -0.00000114, 0.00000000],
+		[-6.27170128, -0.00098948, 0.00060660, 0.00099461, -0.00000114, 0.00000000],
+		[-6.27170244, -0.00098916, 0.00060641, 0.00099430, -0.00000114, 0.00000000],
+		[-6.27170361, -0.00098884, 0.00060622, 0.00099398, -0.00000114, 0.00000000],
+		[-6.27170477, -0.00098853, 0.00060602, 0.00099366, -0.00000114, 0.00000000],
+		[-6.27170593, -0.00098821, 0.00060583, 0.00099334, -0.00000114, 0.00000000],
+		[-6.27170709, -0.00098790, 0.00060563, 0.00099303, -0.00000114, 0.00000000],
+		[-6.27170825, -0.00098758, 0.00060544, 0.00099271, -0.00000114, 0.00000000],
+		[-6.27170940, -0.00098727, 0.00060525, 0.00099239, -0.00000114, 0.00000000],
+		[-6.27171055, -0.00098695, 0.00060505, 0.00099208, -0.00000114, 0.00000000],
+		[-6.27171170, -0.00098664, 0.00060486, 0.00099176, -0.00000114, 0.00000000],
+		[-6.27171285, -0.00098633, 0.00060467, 0.00099145, -0.00000114, 0.00000000],
+		[-6.27171399, -0.00098601, 0.00060448, 0.00099113, -0.00000114, 0.00000000],
+		[-6.27171514, -0.00098570, 0.00060428, 0.00099081, -0.00000114, 0.00000000],
+		[-6.27171628, -0.00098538, 0.00060409, 0.00099050, -0.00000114, 0.00000000],
+		[-6.27171742, -0.00098507, 0.00060390, 0.00099018, -0.00000114, 0.00000000],
+		[-6.27171856, -0.00098476, 0.00060371, 0.00098987, -0.00000114, 0.00000000],
+		[-6.27171969, -0.00098444, 0.00060351, 0.00098955, -0.00000114, 0.00000000],
+		[-6.27172082, -0.00098413, 0.00060332, 0.00098924, -0.00000114, 0.00000000],
+		[-6.27172196, -0.00098382, 0.00060313, 0.00098893, -0.00000114, 0.00000000],
+		[-6.27172309, -0.00098351, 0.00060294, 0.00098861, -0.00000114, 0.00000000],
+		[-6.27172421, -0.00098319, 0.00060275, 0.00098830, -0.00000114, 0.00000000],
+		[-6.27172534, -0.00098288, 0.00060256, 0.00098798, -0.00000114, 0.00000000],
+		[-6.27172646, -0.00098257, 0.00060236, 0.00098767, -0.00000114, 0.00000000],
+		[-6.27172758, -0.00098226, 0.00060217, 0.00098736, -0.00000114, 0.00000000],
+		[-6.27172870, -0.00098195, 0.00060198, 0.00098704, -0.00000114, 0.00000000],
+		[-6.27172982, -0.00098163, 0.00060179, 0.00098673, -0.00000114, 0.00000000],
+		[-6.27173093, -0.00098132, 0.00060160, 0.00098642, -0.00000114, 0.00000000],
+		[-6.27173205, -0.00098101, 0.00060141, 0.00098610, -0.00000114, 0.00000000],
+		[-6.27173316, -0.00098070, 0.00060122, 0.00098579, -0.00000114, 0.00000000],
+		[-6.27173427, -0.00098039, 0.00060103, 0.00098548, -0.00000114, 0.00000000],
+		[-6.27173537, -0.00098008, 0.00060084, 0.00098517, -0.00000114, 0.00000000],
+		[-6.27173648, -0.00097977, 0.00060065, 0.00098486, -0.00000114, 0.00000000],
+		[-6.27173758, -0.00097946, 0.00060046, 0.00098454, -0.00000114, 0.00000000],
+		[-6.27173868, -0.00097915, 0.00060027, 0.00098423, -0.00000114, 0.00000000],
+		[-6.27173978, -0.00097884, 0.00060008, 0.00098392, -0.00000114, 0.00000000],
+		[-6.27174088, -0.00097853, 0.00059989, 0.00098361, -0.00000114, 0.00000000],
+		[-6.27174198, -0.00097822, 0.00059970, 0.00098330, -0.00000114, 0.00000000],
+		[-6.27174307, -0.00097791, 0.00059951, 0.00098299, -0.00000114, 0.00000000],
+		[-6.27174416, -0.00097761, 0.00059932, 0.00098268, -0.00000114, 0.00000000],
+		[-6.27174525, -0.00097730, 0.00059913, 0.00098237, -0.00000114, 0.00000000],
+		[-6.27174634, -0.00097699, 0.00059894, 0.00098206, -0.00000114, 0.00000000],
+		[-6.27174743, -0.00097668, 0.00059875, 0.00098175, -0.00000114, 0.00000000],
+		[-6.27174851, -0.00097637, 0.00059856, 0.00098144, -0.00000114, 0.00000000],
+		[-6.27174959, -0.00097606, 0.00059837, 0.00098113, -0.00000114, 0.00000000],
+		[-6.27175067, -0.00097576, 0.00059818, 0.00098082, -0.00000114, 0.00000000],
+		[-6.27175175, -0.00097545, 0.00059800, 0.00098051, -0.00000114, 0.00000000],
+		[-6.27175283, -0.00097514, 0.00059781, 0.00098020, -0.00000114, 0.00000000],
+		[-6.27175390, -0.00097484, 0.00059762, 0.00097989, -0.00000114, 0.00000000],
+		[-6.27175497, -0.00097453, 0.00059743, 0.00097958, -0.00000114, 0.00000000],
+		[-6.27175605, -0.00097422, 0.00059724, 0.00097928, -0.00000114, 0.00000000],
+		[-6.27175712, -0.00097392, 0.00059705, 0.00097897, -0.00000114, 0.00000000],
+		[-6.27175818, -0.00097361, 0.00059687, 0.00097866, -0.00000114, 0.00000000],
+		[-6.27175925, -0.00097330, 0.00059668, 0.00097835, -0.00000114, 0.00000000],
+		[-6.27176031, -0.00097300, 0.00059649, 0.00097805, -0.00000114, 0.00000000],
+		[-6.27176137, -0.00097269, 0.00059630, 0.00097774, -0.00000114, 0.00000000],
+		[-6.27176243, -0.00097239, 0.00059612, 0.00097743, -0.00000114, 0.00000000],
+		[-6.27176349, -0.00097208, 0.00059593, 0.00097712, -0.00000114, 0.00000000],
+		[-6.27176455, -0.00097178, 0.00059574, 0.00097682, -0.00000114, 0.00000000],
+		[-6.27176560, -0.00097147, 0.00059555, 0.00097651, -0.00000114, 0.00000000],
+		[-6.27176666, -0.00097117, 0.00059537, 0.00097620, -0.00000114, 0.00000000],
+		[-6.27176771, -0.00097086, 0.00059518, 0.00097590, -0.00000114, 0.00000000],
+		[-6.27176876, -0.00097056, 0.00059499, 0.00097559, -0.00000114, 0.00000000],
+		[-6.27176980, -0.00097025, 0.00059481, 0.00097529, -0.00000114, 0.00000000],
+		[-6.27177085, -0.00096995, 0.00059462, 0.00097498, -0.00000114, 0.00000000],
+		[-6.27177189, -0.00096965, 0.00059443, 0.00097468, -0.00000114, 0.00000000],
+		[-6.27177294, -0.00096934, 0.00059425, 0.00097437, -0.00000114, 0.00000000],
+		[-6.27177398, -0.00096904, 0.00059406, 0.00097407, -0.00000114, 0.00000000],
+		[-6.27177502, -0.00096874, 0.00059388, 0.00097376, -0.00000114, 0.00000000],
+		[-6.27177605, -0.00096843, 0.00059369, 0.00097346, -0.00000114, 0.00000000],
+		[-6.27177709, -0.00096813, 0.00059350, 0.00097315, -0.00000114, 0.00000000],
+		[-6.27177812, -0.00096783, 0.00059332, 0.00097285, -0.00000114, 0.00000000],
+		[-6.27177915, -0.00096752, 0.00059313, 0.00097254, -0.00000114, 0.00000000],
+		[-6.27178018, -0.00096722, 0.00059295, 0.00097224, -0.00000114, 0.00000000],
+		[-6.27178121, -0.00096692, 0.00059276, 0.00097194, -0.00000114, 0.00000000],
+		[-6.27178224, -0.00096662, 0.00059258, 0.00097163, -0.00000114, 0.00000000],
+		[-6.27178326, -0.00096632, 0.00059239, 0.00097133, -0.00000114, 0.00000000],
+		[-6.27178429, -0.00096602, 0.00059221, 0.00097103, -0.00000114, 0.00000000],
+		[-6.27178531, -0.00096571, 0.00059202, 0.00097072, -0.00000114, 0.00000000],
+		[-6.27178633, -0.00096541, 0.00059184, 0.00097042, -0.00000114, 0.00000000],
+		[-6.27178735, -0.00096511, 0.00059165, 0.00097012, -0.00000114, 0.00000000],
+		[-6.27178836, -0.00096481, 0.00059147, 0.00096981, -0.00000114, 0.00000000],
+		[-6.27178938, -0.00096451, 0.00059128, 0.00096951, -0.00000114, 0.00000000],
+		[-6.27179039, -0.00096421, 0.00059110, 0.00096921, -0.00000114, 0.00000000],
+		[-6.27179140, -0.00096391, 0.00059091, 0.00096891, -0.00000114, 0.00000000],
+		[-6.27179242, -0.00096361, 0.00059073, 0.00096861, -0.00000114, 0.00000000],
+		[-6.27179342, -0.00096331, 0.00059055, 0.00096831, -0.00000114, 0.00000000],
+		[-6.27179443, -0.00096301, 0.00059036, 0.00096800, -0.00000114, 0.00000000],
+		[-6.27179544, -0.00096271, 0.00059018, 0.00096770, -0.00000114, 0.00000000],
+		[-6.27179644, -0.00096241, 0.00058999, 0.00096740, -0.00000114, 0.00000000],
+		[-6.27179744, -0.00096211, 0.00058981, 0.00096710, -0.00000114, 0.00000000],
+		[-6.27179844, -0.00096181, 0.00058963, 0.00096680, -0.00000114, 0.00000000],
+		[-6.27179944, -0.00096152, 0.00058944, 0.00096650, -0.00000114, 0.00000000],
+		[-6.27180044, -0.00096122, 0.00058926, 0.00096620, -0.00000114, 0.00000000],
+		[-6.27180143, -0.00096092, 0.00058908, 0.00096590, -0.00000114, 0.00000000],
+		[-6.27180243, -0.00096062, 0.00058890, 0.00096560, -0.00000114, 0.00000000],
+		[-6.27180342, -0.00096032, 0.00058871, 0.00096530, -0.00000114, 0.00000000],
+		[-6.27180441, -0.00096002, 0.00058853, 0.00096500, -0.00000114, 0.00000000],
+		[-6.27180540, -0.00095973, 0.00058835, 0.00096470, -0.00000114, 0.00000000],
+		[-6.27180639, -0.00095943, 0.00058816, 0.00096440, -0.00000114, 0.00000000],
+		[-6.27180737, -0.00095913, 0.00058798, 0.00096410, -0.00000114, 0.00000000],
+		[-6.27180836, -0.00095884, 0.00058780, 0.00096381, -0.00000114, 0.00000000],
+		[-6.27180934, -0.00095854, 0.00058762, 0.00096351, -0.00000114, 0.00000000],
+		[-6.27181032, -0.00095824, 0.00058744, 0.00096321, -0.00000114, 0.00000000],
+		[-6.27181130, -0.00095795, 0.00058725, 0.00096291, -0.00000114, 0.00000000],
+		[-6.27181228, -0.00095765, 0.00058707, 0.00096261, -0.00000114, 0.00000000],
+		[-6.27181325, -0.00095735, 0.00058689, 0.00096232, -0.00000114, 0.00000000],
+		[-6.27181423, -0.00095706, 0.00058671, 0.00096202, -0.00000114, 0.00000000],
+		[-6.27181520, -0.00095676, 0.00058653, 0.00096172, -0.00000114, 0.00000000],
+		[-6.27181618, -0.00095647, 0.00058635, 0.00096142, -0.00000114, 0.00000000],
+		[-6.27181715, -0.00095617, 0.00058616, 0.00096113, -0.00000114, 0.00000000],
+		[-6.27181811, -0.00095588, 0.00058598, 0.00096083, -0.00000114, 0.00000000],
+		[-6.27181908, -0.00095558, 0.00058580, 0.00096053, -0.00000114, 0.00000000],
+		[-6.27182005, -0.00095529, 0.00058562, 0.00096024, -0.00000114, 0.00000000],
+		[-6.27182101, -0.00095499, 0.00058544, 0.00095994, -0.00000114, 0.00000000],
+		[-6.27182198, -0.00095470, 0.00058526, 0.00095964, -0.00000114, 0.00000000],
+		[-6.27182294, -0.00095440, 0.00058508, 0.00095935, -0.00000114, 0.00000000],
+		[-6.27182390, -0.00095411, 0.00058490, 0.00095905, -0.00000114, 0.00000000],
+		[-6.27182486, -0.00095381, 0.00058472, 0.00095876, -0.00000114, 0.00000000],
+		[-6.27182581, -0.00095352, 0.00058454, 0.00095846, -0.00000114, 0.00000000],
+		[-6.27182677, -0.00095323, 0.00058436, 0.00095817, -0.00000114, 0.00000000],
+		[-6.27182772, -0.00095293, 0.00058418, 0.00095787, -0.00000114, 0.00000000],
+		[-6.27182867, -0.00095264, 0.00058400, 0.00095758, -0.00000114, 0.00000000],
+		[-6.27182963, -0.00095235, 0.00058382, 0.00095728, -0.00000114, 0.00000000],
+		[-6.27183058, -0.00095205, 0.00058364, 0.00095699, -0.00000114, 0.00000000],
+		[-6.27183152, -0.00095176, 0.00058346, 0.00095669, -0.00000114, 0.00000000],
+		[-6.27183247, -0.00095147, 0.00058328, 0.00095640, -0.00000114, 0.00000000],
+		[-6.27183342, -0.00095118, 0.00058310, 0.00095611, -0.00000114, 0.00000000],
+		[-6.27183436, -0.00095088, 0.00058292, 0.00095581, -0.00000114, 0.00000000],
+		[-6.27183530, -0.00095059, 0.00058274, 0.00095552, -0.00000114, 0.00000000],
+		[-6.27183624, -0.00095030, 0.00058256, 0.00095523, -0.00000114, 0.00000000],
+		[-6.27183718, -0.00095001, 0.00058238, 0.00095493, -0.00000114, 0.00000000],
+		[-6.27183812, -0.00094972, 0.00058221, 0.00095464, -0.00000114, 0.00000000],
+		[-6.27183906, -0.00094943, 0.00058203, 0.00095435, -0.00000114, 0.00000000],
+		[-6.27183999, -0.00094914, 0.00058185, 0.00095405, -0.00000114, 0.00000000],
+		[-6.27184093, -0.00094884, 0.00058167, 0.00095376, -0.00000114, 0.00000000],
+		[-6.27184186, -0.00094855, 0.00058149, 0.00095347, -0.00000114, 0.00000000],
+		[-6.27184279, -0.00094826, 0.00058131, 0.00095318, -0.00000114, 0.00000000],
+		[-6.27184372, -0.00094797, 0.00058113, 0.00095288, -0.00000114, 0.00000000],
+		[-6.27184465, -0.00094768, 0.00058096, 0.00095259, -0.00000114, 0.00000000],
+		[-6.27184558, -0.00094739, 0.00058078, 0.00095230, -0.00000114, 0.00000000],
+		[-6.27184650, -0.00094710, 0.00058060, 0.00095201, -0.00000114, 0.00000000],
+		[-6.27184743, -0.00094681, 0.00058042, 0.00095172, -0.00000114, 0.00000000],
+		[-6.27184835, -0.00094652, 0.00058025, 0.00095143, -0.00000114, 0.00000000],
+		[-6.27184927, -0.00094623, 0.00058007, 0.00095114, -0.00000114, 0.00000000],
+		[-6.27185019, -0.00094595, 0.00057989, 0.00095085, -0.00000114, 0.00000000],
+		[-6.27185111, -0.00094566, 0.00057971, 0.00095056, -0.00000114, 0.00000000],
+		[-6.27185203, -0.00094537, 0.00057954, 0.00095027, -0.00000114, 0.00000000],
+		[-6.27185294, -0.00094508, 0.00057936, 0.00094998, -0.00000114, 0.00000000],
+		[-6.27185386, -0.00094479, 0.00057918, 0.00094969, -0.00000114, 0.00000000],
+		[-6.27185477, -0.00094450, 0.00057901, 0.00094940, -0.00000114, 0.00000000],
+		[-6.27185568, -0.00094421, 0.00057883, 0.00094911, -0.00000114, 0.00000000],
+		[-6.27185659, -0.00094393, 0.00057865, 0.00094882, -0.00000114, 0.00000000],
+		[-6.27185750, -0.00094364, 0.00057848, 0.00094853, -0.00000114, 0.00000000],
+		[-6.27185841, -0.00094335, 0.00057830, 0.00094824, -0.00000114, 0.00000000],
+		[-6.27185932, -0.00094306, 0.00057812, 0.00094795, -0.00000114, 0.00000000],
+		[-6.27186022, -0.00094278, 0.00057795, 0.00094766, -0.00000114, 0.00000000],
+		[-6.27186113, -0.00094249, 0.00057777, 0.00094737, -0.00000114, 0.00000000],
+		[-6.27186203, -0.00094220, 0.00057759, 0.00094708, -0.00000114, 0.00000000],
+		[-6.27186293, -0.00094192, 0.00057742, 0.00094680, -0.00000114, 0.00000000],
+		[-6.27186383, -0.00094163, 0.00057724, 0.00094651, -0.00000114, 0.00000000],
+		[-6.27186473, -0.00094134, 0.00057707, 0.00094622, -0.00000114, 0.00000000],
+		[-6.27186563, -0.00094106, 0.00057689, 0.00094593, -0.00000114, 0.00000000],
+		[-6.27186652, -0.00094077, 0.00057672, 0.00094564, -0.00000114, 0.00000000],
+		[-6.27186742, -0.00094049, 0.00057654, 0.00094536, -0.00000114, 0.00000000],
+		[-6.27186831, -0.00094020, 0.00057636, 0.00094507, -0.00000114, 0.00000000],
+		[-6.27186920, -0.00093991, 0.00057619, 0.00094478, -0.00000114, 0.00000000],
+		[-6.27187010, -0.00093963, 0.00057601, 0.00094450, -0.00000114, 0.00000000],
+		[-6.27187098, -0.00093934, 0.00057584, 0.00094421, -0.00000114, 0.00000000],
+		[-6.27187187, -0.00093906, 0.00057567, 0.00094392, -0.00000114, 0.00000000],
+		[-6.27187276, -0.00093877, 0.00057549, 0.00094364, -0.00000114, 0.00000000],
+		[-6.27187365, -0.00093849, 0.00057532, 0.00094335, -0.00000114, 0.00000000],
+		[-6.27187453, -0.00093821, 0.00057514, 0.00094306, -0.00000114, 0.00000000],
+		[-6.27187541, -0.00093792, 0.00057497, 0.00094278, -0.00000114, 0.00000000],
+		[-6.27187630, -0.00093764, 0.00057479, 0.00094249, -0.00000114, 0.00000000],
+		[-6.27187718, -0.00093735, 0.00057462, 0.00094221, -0.00000114, 0.00000000],
+		[-6.27187806, -0.00093707, 0.00057444, 0.00094192, -0.00000114, 0.00000000],
+		[-6.27187894, -0.00093679, 0.00057427, 0.00094164, -0.00000114, 0.00000000],
+		[-6.27187981, -0.00093650, 0.00057410, 0.00094135, -0.00000114, 0.00000000],
+		[-6.27188069, -0.00093622, 0.00057392, 0.00094107, -0.00000114, 0.00000000],
+		[-6.27188156, -0.00093594, 0.00057375, 0.00094078, -0.00000114, 0.00000000],
+		[-6.27188244, -0.00093565, 0.00057358, 0.00094050, -0.00000114, 0.00000000],
+		[-6.27188331, -0.00093537, 0.00057340, 0.00094021, -0.00000114, 0.00000000],
+		[-6.27188418, -0.00093509, 0.00057323, 0.00093993, -0.00000114, 0.00000000],
+		[-6.27188505, -0.00093481, 0.00057306, 0.00093965, -0.00000114, 0.00000000],
+		[-6.27188592, -0.00093452, 0.00057288, 0.00093936, -0.00000114, 0.00000000],
+		[-6.27188679, -0.00093424, 0.00057271, 0.00093908, -0.00000114, 0.00000000],
+		[-6.27188765, -0.00093396, 0.00057254, 0.00093880, -0.00000114, 0.00000000],
+		[-6.27188852, -0.00093368, 0.00057236, 0.00093851, -0.00000114, 0.00000000],
+		[-6.27188938, -0.00093340, 0.00057219, 0.00093823, -0.00000114, 0.00000000],
+		[-6.27189025, -0.00093312, 0.00057202, 0.00093795, -0.00000114, 0.00000000],
+		[-6.27189111, -0.00093283, 0.00057185, 0.00093766, -0.00000114, 0.00000000],
+		[-6.27189197, -0.00093255, 0.00057167, 0.00093738, -0.00000114, 0.00000000],
+		[-6.27189283, -0.00093227, 0.00057150, 0.00093710, -0.00000114, 0.00000000],
+		[-6.27189369, -0.00093199, 0.00057133, 0.00093682, -0.00000114, 0.00000000],
+		[-6.27189454, -0.00093171, 0.00057116, 0.00093654, -0.00000114, 0.00000000],
+		[-6.27189540, -0.00093143, 0.00057098, 0.00093625, -0.00000114, 0.00000000],
+		[-6.27189625, -0.00093115, 0.00057081, 0.00093597, -0.00000114, 0.00000000],
+		[-6.27189711, -0.00093087, 0.00057064, 0.00093569, -0.00000114, 0.00000000],
+		[-6.27189796, -0.00093059, 0.00057047, 0.00093541, -0.00000114, 0.00000000],
+		[-6.27189881, -0.00093031, 0.00057030, 0.00093513, -0.00000114, 0.00000000],
+		[-6.27189966, -0.00093003, 0.00057013, 0.00093485, -0.00000114, 0.00000000],
+		[-6.27190051, -0.00092975, 0.00056995, 0.00093457, -0.00000114, 0.00000000],
+		[-6.27190136, -0.00092947, 0.00056978, 0.00093429, -0.00000114, 0.00000000],
+		[-6.27190220, -0.00092919, 0.00056961, 0.00093401, -0.00000114, 0.00000000],
+		[-6.27190305, -0.00092892, 0.00056944, 0.00093372, -0.00000114, 0.00000000],
+		[-6.27190389, -0.00092864, 0.00056927, 0.00093344, -0.00000114, 0.00000000],
+		[-6.27190474, -0.00092836, 0.00056910, 0.00093316, -0.00000114, 0.00000000],
+		[-6.27190558, -0.00092808, 0.00056893, 0.00093288, -0.00000114, 0.00000000],
+		[-6.27190642, -0.00092780, 0.00056876, 0.00093261, -0.00000114, 0.00000000],
+		[-6.27190726, -0.00092752, 0.00056859, 0.00093233, -0.00000114, 0.00000000],
+		[-6.27190810, -0.00092725, 0.00056842, 0.00093205, -0.00000114, 0.00000000],
+		[-6.27190893, -0.00092697, 0.00056825, 0.00093177, -0.00000114, 0.00000000],
+		[-6.27190977, -0.00092669, 0.00056808, 0.00093149, -0.00000114, 0.00000000],
+		[-6.27191061, -0.00092641, 0.00056791, 0.00093121, -0.00000114, 0.00000000],
+		[-6.27191144, -0.00092614, 0.00056774, 0.00093093, -0.00000114, 0.00000000],
+		[-6.27191227, -0.00092586, 0.00056757, 0.00093065, -0.00000114, 0.00000000],
+		[-6.27191311, -0.00092558, 0.00056740, 0.00093037, -0.00000114, 0.00000000],
+		[-6.27191394, -0.00092531, 0.00056723, 0.00093010, -0.00000114, 0.00000000],
+		[-6.27191477, -0.00092503, 0.00056706, 0.00092982, -0.00000114, 0.00000000],
+		[-6.27191559, -0.00092475, 0.00056689, 0.00092954, -0.00000114, 0.00000000],
+		[-6.27191642, -0.00092448, 0.00056672, 0.00092926, -0.00000114, 0.00000000],
+		[-6.27191725, -0.00092420, 0.00056655, 0.00092899, -0.00000114, 0.00000000],
+		[-6.27191807, -0.00092393, 0.00056638, 0.00092871, -0.00000114, 0.00000000],
+		[-6.27191890, -0.00092365, 0.00056621, 0.00092843, -0.00000114, 0.00000000],
+		[-6.27191972, -0.00092338, 0.00056604, 0.00092815, -0.00000114, 0.00000000],
+		[-6.27192054, -0.00092310, 0.00056587, 0.00092788, -0.00000114, 0.00000000],
+		[-6.27192136, -0.00092282, 0.00056570, 0.00092760, -0.00000114, 0.00000000],
+		[-6.27192218, -0.00092255, 0.00056553, 0.00092732, -0.00000114, 0.00000000],
+		[-6.27192300, -0.00092227, 0.00056537, 0.00092705, -0.00000114, 0.00000000],
+		[-6.27192382, -0.00092200, 0.00056520, 0.00092677, -0.00000114, 0.00000000],
+		[-6.27192464, -0.00092173, 0.00056503, 0.00092650, -0.00000114, 0.00000000],
+		[-6.27192545, -0.00092145, 0.00056486, 0.00092622, -0.00000114, 0.00000000],
+		[-6.27192627, -0.00092118, 0.00056469, 0.00092594, -0.00000114, 0.00000000],
+		[-6.27192708, -0.00092090, 0.00056452, 0.00092567, -0.00000114, 0.00000000],
+		[-6.27192790, -0.00092063, 0.00056436, 0.00092539, -0.00000114, 0.00000000],
+		[-6.27192871, -0.00092036, 0.00056419, 0.00092512, -0.00000114, 0.00000000],
+		[-6.27192952, -0.00092008, 0.00056402, 0.00092484, -0.00000114, 0.00000000],
+		[-6.27193033, -0.00091981, 0.00056385, 0.00092457, -0.00000114, 0.00000000],
+		[-6.27193114, -0.00091954, 0.00056368, 0.00092429, -0.00000114, 0.00000000],
+		[-6.27193194, -0.00091926, 0.00056352, 0.00092402, -0.00000114, 0.00000000],
+		[-6.27193275, -0.00091899, 0.00056335, 0.00092374, -0.00000114, 0.00000000],
+		[-6.27193356, -0.00091872, 0.00056318, 0.00092347, -0.00000114, 0.00000000],
+		[-6.27193436, -0.00091844, 0.00056301, 0.00092320, -0.00000114, 0.00000000],
+		[-6.27193516, -0.00091817, 0.00056285, 0.00092292, -0.00000114, 0.00000000],
+		[-6.27193597, -0.00091790, 0.00056268, 0.00092265, -0.00000114, 0.00000000],
+		[-6.27193677, -0.00091763, 0.00056251, 0.00092238, -0.00000114, 0.00000000],
+		[-6.27193757, -0.00091736, 0.00056235, 0.00092210, -0.00000114, 0.00000000],
+		[-6.27193837, -0.00091708, 0.00056218, 0.00092183, -0.00000114, 0.00000000],
+		[-6.27193917, -0.00091681, 0.00056201, 0.00092156, -0.00000114, 0.00000000],
+		[-6.27193996, -0.00091654, 0.00056185, 0.00092128, -0.00000114, 0.00000000],
+		[-6.27194076, -0.00091627, 0.00056168, 0.00092101, -0.00000114, 0.00000000],
+		[-6.27194155, -0.00091600, 0.00056151, 0.00092074, -0.00000114, 0.00000000],
+		[-6.27194235, -0.00091573, 0.00056135, 0.00092046, -0.00000114, 0.00000000],
+		[-6.27194314, -0.00091546, 0.00056118, 0.00092019, -0.00000114, 0.00000000],
+		[-6.27194394, -0.00091519, 0.00056102, 0.00091992, -0.00000114, 0.00000000],
+		[-6.27194473, -0.00091492, 0.00056085, 0.00091965, -0.00000114, 0.00000000],
+		[-6.27194552, -0.00091465, 0.00056068, 0.00091938, -0.00000114, 0.00000000],
+		[-6.27194631, -0.00091438, 0.00056052, 0.00091911, -0.00000114, 0.00000000],
+		[-6.27194710, -0.00091411, 0.00056035, 0.00091883, -0.00000114, 0.00000000],
+		[-6.27194788, -0.00091384, 0.00056019, 0.00091856, -0.00000114, 0.00000000],
+		[-6.27194867, -0.00091357, 0.00056002, 0.00091829, -0.00000114, 0.00000000],
+		[-6.27194946, -0.00091330, 0.00055986, 0.00091802, -0.00000114, 0.00000000],
+		[-6.27195024, -0.00091303, 0.00055969, 0.00091775, -0.00000114, 0.00000000],
+		[-6.27195102, -0.00091276, 0.00055953, 0.00091748, -0.00000114, 0.00000000],
+		[-6.27195181, -0.00091249, 0.00055936, 0.00091721, -0.00000114, 0.00000000],
+		[-6.27195259, -0.00091222, 0.00055920, 0.00091694, -0.00000114, 0.00000000],
+		[-6.27195337, -0.00091195, 0.00055903, 0.00091667, -0.00000114, 0.00000000],
+		[-6.27195415, -0.00091168, 0.00055887, 0.00091640, -0.00000114, 0.00000000],
+		[-6.27195493, -0.00091141, 0.00055870, 0.00091613, -0.00000114, 0.00000000],
+		[-6.27195571, -0.00091115, 0.00055854, 0.00091586, -0.00000114, 0.00000000],
+		[-6.27195648, -0.00091088, 0.00055837, 0.00091559, -0.00000114, 0.00000000],
+		[-6.27195726, -0.00091061, 0.00055821, 0.00091532, -0.00000114, 0.00000000],
+		[-6.27195803, -0.00091034, 0.00055804, 0.00091505, -0.00000114, 0.00000000],
+		[-6.27195881, -0.00091007, 0.00055788, 0.00091478, -0.00000114, 0.00000000],
+		[-6.27195958, -0.00090981, 0.00055771, 0.00091451, -0.00000114, 0.00000000],
+		[-6.27196035, -0.00090954, 0.00055755, 0.00091424, -0.00000114, 0.00000000],
+		[-6.27196113, -0.00090927, 0.00055739, 0.00091397, -0.00000114, 0.00000000],
+		[-6.27196190, -0.00090901, 0.00055722, 0.00091371, -0.00000114, 0.00000000],
+		[-6.27196267, -0.00090874, 0.00055706, 0.00091344, -0.00000114, 0.00000000],
+		[-6.27196344, -0.00090847, 0.00055690, 0.00091317, -0.00000114, 0.00000000],
+		[-6.27196420, -0.00090821, 0.00055673, 0.00091290, -0.00000114, 0.00000000],
+		[-6.27196497, -0.00090794, 0.00055657, 0.00091263, -0.00000114, 0.00000000],
+		[-6.27196574, -0.00090767, 0.00055641, 0.00091237, -0.00000114, 0.00000000],
+		[-6.27196650, -0.00090741, 0.00055624, 0.00091210, -0.00000114, 0.00000000],
+		[-6.27196726, -0.00090714, 0.00055608, 0.00091183, -0.00000114, 0.00000000],
+		[-6.27196803, -0.00090688, 0.00055592, 0.00091156, -0.00000114, 0.00000000],
+		[-6.27196879, -0.00090661, 0.00055575, 0.00091130, -0.00000114, 0.00000000],
+		[-6.27196955, -0.00090634, 0.00055559, 0.00091103, -0.00000114, 0.00000000],
+		[-6.27197031, -0.00090608, 0.00055543, 0.00091076, -0.00000114, 0.00000000],
+		[-6.27197107, -0.00090581, 0.00055526, 0.00091050, -0.00000114, 0.00000000],
+		[-6.27197183, -0.00090555, 0.00055510, 0.00091023, -0.00000114, 0.00000000],
+		[-6.27197259, -0.00090528, 0.00055494, 0.00090997, -0.00000114, 0.00000000],
+		[-6.27197335, -0.00090502, 0.00055478, 0.00090970, -0.00000114, 0.00000000],
+		[-6.27197410, -0.00090476, 0.00055461, 0.00090943, -0.00000114, 0.00000000],
+		[-6.27197486, -0.00090449, 0.00055445, 0.00090917, -0.00000114, 0.00000000],
+		[-6.27197561, -0.00090423, 0.00055429, 0.00090890, -0.00000114, 0.00000000],
+		[-6.27197637, -0.00090396, 0.00055413, 0.00090864, -0.00000114, 0.00000000],
+		[-6.27197712, -0.00090370, 0.00055397, 0.00090837, -0.00000114, 0.00000000],
+		[-6.27197787, -0.00090344, 0.00055380, 0.00090811, -0.00000114, 0.00000000],
+		[-6.27197862, -0.00090317, 0.00055364, 0.00090784, -0.00000114, 0.00000000],
+		[-6.27197937, -0.00090291, 0.00055348, 0.00090758, -0.00000114, 0.00000000],
+		[-6.27198012, -0.00090264, 0.00055332, 0.00090731, -0.00000114, 0.00000000],
+		[-6.27198087, -0.00090238, 0.00055316, 0.00090705, -0.00000114, 0.00000000],
+		[-6.27198162, -0.00090212, 0.00055300, 0.00090678, -0.00000114, 0.00000000],
+		[-6.27198236, -0.00090186, 0.00055284, 0.00090652, -0.00000114, 0.00000000],
+		[-6.27198311, -0.00090159, 0.00055267, 0.00090625, -0.00000114, 0.00000000],
+		[-6.27198385, -0.00090133, 0.00055251, 0.00090599, -0.00000113, 0.00000000],
+		[-6.27198460, -0.00090107, 0.00055235, 0.00090573, -0.00000113, 0.00000000],
+		[-6.27198534, -0.00090081, 0.00055219, 0.00090546, -0.00000113, 0.00000000],
+		[-6.27198608, -0.00090054, 0.00055203, 0.00090520, -0.00000113, 0.00000000],
+		[-6.27198682, -0.00090028, 0.00055187, 0.00090494, -0.00000113, 0.00000000],
+		[-6.27198756, -0.00090002, 0.00055171, 0.00090467, -0.00000113, 0.00000000],
+		[-6.27198830, -0.00089976, 0.00055155, 0.00090441, -0.00000113, 0.00000000],
+		[-6.27198904, -0.00089950, 0.00055139, 0.00090415, -0.00000113, 0.00000000],
+		[-6.27198978, -0.00089924, 0.00055123, 0.00090388, -0.00000113, 0.00000000],
+		[-6.27199052, -0.00089898, 0.00055107, 0.00090362, -0.00000113, 0.00000000],
+		[-6.27199126, -0.00089871, 0.00055091, 0.00090336, -0.00000113, 0.00000000],
+		[-6.27199199, -0.00089845, 0.00055075, 0.00090310, -0.00000113, 0.00000000],
+		[-6.27199273, -0.00089819, 0.00055059, 0.00090284, -0.00000113, 0.00000000],
+		[-6.27199346, -0.00089793, 0.00055043, 0.00090257, -0.00000113, 0.00000000],
+		[-6.27199419, -0.00089767, 0.00055027, 0.00090231, -0.00000113, 0.00000000],
+		[-6.27199493, -0.00089741, 0.00055011, 0.00090205, -0.00000113, 0.00000000],
+		[-6.27199566, -0.00089715, 0.00054995, 0.00090179, -0.00000113, 0.00000000],
+		[-6.27199639, -0.00089689, 0.00054979, 0.00090153, -0.00000113, 0.00000000],
+		[-6.27199712, -0.00089663, 0.00054963, 0.00090127, -0.00000113, 0.00000000],
+		[-6.27199785, -0.00089637, 0.00054947, 0.00090100, -0.00000113, 0.00000000],
+		[-6.27199857, -0.00089611, 0.00054931, 0.00090074, -0.00000113, 0.00000000],
+		[-6.27199930, -0.00089585, 0.00054915, 0.00090048, -0.00000113, 0.00000000],
+		[-6.27200003, -0.00089559, 0.00054899, 0.00090022, -0.00000113, 0.00000000],
+		[-6.27200076, -0.00089534, 0.00054883, 0.00089996, -0.00000113, 0.00000000],
+		[-6.27200148, -0.00089508, 0.00054868, 0.00089970, -0.00000113, 0.00000000],
+		[-6.27200220, -0.00089482, 0.00054852, 0.00089944, -0.00000113, 0.00000000],
+		[-6.27200293, -0.00089456, 0.00054836, 0.00089918, -0.00000113, 0.00000000],
+		[-6.27200365, -0.00089430, 0.00054820, 0.00089892, -0.00000113, 0.00000000],
+		[-6.27200437, -0.00089404, 0.00054804, 0.00089866, -0.00000113, 0.00000000],
+		[-6.27200509, -0.00089378, 0.00054788, 0.00089840, -0.00000113, 0.00000000],
+		[-6.27200581, -0.00089353, 0.00054772, 0.00089814, -0.00000113, 0.00000000],
+		[-6.27200653, -0.00089327, 0.00054757, 0.00089788, -0.00000113, 0.00000000],
+		[-6.27200725, -0.00089301, 0.00054741, 0.00089763, -0.00000113, 0.00000000],
+		[-6.27200797, -0.00089275, 0.00054725, 0.00089737, -0.00000113, 0.00000000],
+		[-6.27200869, -0.00089250, 0.00054709, 0.00089711, -0.00000113, 0.00000000],
+		[-6.27200940, -0.00089224, 0.00054693, 0.00089685, -0.00000113, 0.00000000],
+		[-6.27201012, -0.00089198, 0.00054678, 0.00089659, -0.00000113, 0.00000000],
+		[-6.27201083, -0.00089172, 0.00054662, 0.00089633, -0.00000113, 0.00000000],
+		[-6.27201155, -0.00089147, 0.00054646, 0.00089607, -0.00000113, 0.00000000],
+		[-6.27201226, -0.00089121, 0.00054630, 0.00089582, -0.00000113, 0.00000000],
+		[-6.27201297, -0.00089095, 0.00054615, 0.00089556, -0.00000113, 0.00000000],
+		[-6.27201369, -0.00089070, 0.00054599, 0.00089530, -0.00000113, 0.00000000],
+		[-6.27201440, -0.00089044, 0.00054583, 0.00089504, -0.00000113, 0.00000000],
+		[-6.27201511, -0.00089019, 0.00054568, 0.00089479, -0.00000113, 0.00000000],
+		[-6.27201582, -0.00088993, 0.00054552, 0.00089453, -0.00000113, 0.00000000],
+		[-6.27201653, -0.00088967, 0.00054536, 0.00089427, -0.00000113, 0.00000000],
+		[-6.27201723, -0.00088942, 0.00054520, 0.00089401, -0.00000113, 0.00000000],
+		[-6.27201794, -0.00088916, 0.00054505, 0.00089376, -0.00000113, 0.00000000],
+		[-6.27201865, -0.00088891, 0.00054489, 0.00089350, -0.00000113, 0.00000000],
+		[-6.27201935, -0.00088865, 0.00054473, 0.00089324, -0.00000113, 0.00000000],
+		[-6.27202006, -0.00088840, 0.00054458, 0.00089299, -0.00000113, 0.00000000],
+		[-6.27202076, -0.00088814, 0.00054442, 0.00089273, -0.00000113, 0.00000000],
+		[-6.27202147, -0.00088789, 0.00054427, 0.00089248, -0.00000113, 0.00000000],
+		[-6.27202217, -0.00088763, 0.00054411, 0.00089222, -0.00000113, 0.00000000],
+		[-6.27202287, -0.00088738, 0.00054395, 0.00089196, -0.00000113, 0.00000000],
+		[-6.27202357, -0.00088713, 0.00054380, 0.00089171, -0.00000113, 0.00000000],
+		[-6.27202427, -0.00088687, 0.00054364, 0.00089145, -0.00000113, 0.00000000],
+		[-6.27202497, -0.00088662, 0.00054349, 0.00089120, -0.00000113, 0.00000000],
+		[-6.27202567, -0.00088636, 0.00054333, 0.00089094, -0.00000113, 0.00000000],
+		[-6.27202637, -0.00088611, 0.00054317, 0.00089069, -0.00000113, 0.00000000],
+		[-6.27202707, -0.00088586, 0.00054302, 0.00089043, -0.00000113, 0.00000000],
+		[-6.27202777, -0.00088560, 0.00054286, 0.00089018, -0.00000113, 0.00000000],
+		[-6.27202846, -0.00088535, 0.00054271, 0.00088992, -0.00000113, 0.00000000],
+		[-6.27202916, -0.00088510, 0.00054255, 0.00088967, -0.00000113, 0.00000000],
+		[-6.27202985, -0.00088484, 0.00054240, 0.00088941, -0.00000113, 0.00000000],
+		[-6.27203055, -0.00088459, 0.00054224, 0.00088916, -0.00000113, 0.00000000],
+		[-6.27203124, -0.00088434, 0.00054209, 0.00088891, -0.00000113, 0.00000000],
+		[-6.27203193, -0.00088409, 0.00054193, 0.00088865, -0.00000113, 0.00000000],
+		[-6.27203262, -0.00088383, 0.00054178, 0.00088840, -0.00000113, 0.00000000],
+		[-6.27203332, -0.00088358, 0.00054162, 0.00088814, -0.00000113, 0.00000000],
+		[-6.27203401, -0.00088333, 0.00054147, 0.00088789, -0.00000113, 0.00000000],
+		[-6.27203470, -0.00088308, 0.00054131, 0.00088764, -0.00000113, 0.00000000],
+		[-6.27203539, -0.00088282, 0.00054116, 0.00088738, -0.00000113, 0.00000000],
+		[-6.27203607, -0.00088257, 0.00054100, 0.00088713, -0.00000113, 0.00000000],
+		[-6.27203676, -0.00088232, 0.00054085, 0.00088688, -0.00000113, 0.00000000],
+		[-6.27203745, -0.00088207, 0.00054069, 0.00088663, -0.00000113, 0.00000000],
+		[-6.27203813, -0.00088182, 0.00054054, 0.00088637, -0.00000113, 0.00000000],
+		[-6.27203882, -0.00088157, 0.00054039, 0.00088612, -0.00000113, 0.00000000],
+		[-6.27203950, -0.00088132, 0.00054023, 0.00088587, -0.00000113, 0.00000000],
+		[-6.27204019, -0.00088107, 0.00054008, 0.00088562, -0.00000113, 0.00000000],
+		[-6.27204087, -0.00088082, 0.00053992, 0.00088536, -0.00000113, 0.00000000],
+		[-6.27204156, -0.00088056, 0.00053977, 0.00088511, -0.00000113, 0.00000000],
+		[-6.27204224, -0.00088031, 0.00053962, 0.00088486, -0.00000113, 0.00000000],
+		[-6.27204292, -0.00088006, 0.00053946, 0.00088461, -0.00000113, 0.00000000],
+		[-6.27204360, -0.00087981, 0.00053931, 0.00088436, -0.00000113, 0.00000000],
+		[-6.27204428, -0.00087956, 0.00053916, 0.00088411, -0.00000113, 0.00000000],
+		[-6.27204496, -0.00087931, 0.00053900, 0.00088385, -0.00000113, 0.00000000],
+		[-6.27204564, -0.00087906, 0.00053885, 0.00088360, -0.00000113, 0.00000000],
+		[-6.27204632, -0.00087881, 0.00053870, 0.00088335, -0.00000113, 0.00000000],
+		[-6.27204699, -0.00087857, 0.00053854, 0.00088310, -0.00000113, 0.00000000],
+		[-6.27204767, -0.00087832, 0.00053839, 0.00088285, -0.00000113, 0.00000000],
+		[-6.27204835, -0.00087807, 0.00053824, 0.00088260, -0.00000113, 0.00000000],
+		[-6.27204902, -0.00087782, 0.00053809, 0.00088235, -0.00000113, 0.00000000],
+		[-6.27204970, -0.00087757, 0.00053793, 0.00088210, -0.00000113, 0.00000000],
+		[-6.27205037, -0.00087732, 0.00053778, 0.00088185, -0.00000113, 0.00000000],
+		[-6.27205104, -0.00087707, 0.00053763, 0.00088160, -0.00000113, 0.00000000],
+		[-6.27205172, -0.00087682, 0.00053748, 0.00088135, -0.00000113, 0.00000000],
+		[-6.27205239, -0.00087658, 0.00053732, 0.00088110, -0.00000113, 0.00000000],
+		[-6.27205306, -0.00087633, 0.00053717, 0.00088085, -0.00000113, 0.00000000],
+		[-6.27205373, -0.00087608, 0.00053702, 0.00088060, -0.00000113, 0.00000000],
+		[-6.27205440, -0.00087583, 0.00053687, 0.00088035, -0.00000113, 0.00000000],
+		[-6.27205507, -0.00087558, 0.00053671, 0.00088010, -0.00000113, 0.00000000],
+		[-6.27205574, -0.00087534, 0.00053656, 0.00087985, -0.00000113, 0.00000000],
+		[-6.27205641, -0.00087509, 0.00053641, 0.00087961, -0.00000113, 0.00000000],
+		[-6.27205707, -0.00087484, 0.00053626, 0.00087936, -0.00000113, 0.00000000],
+		[-6.27205774, -0.00087459, 0.00053611, 0.00087911, -0.00000113, 0.00000000],
+		[-6.27205841, -0.00087435, 0.00053596, 0.00087886, -0.00000113, 0.00000000],
+		[-6.27205907, -0.00087410, 0.00053580, 0.00087861, -0.00000113, 0.00000000],
+		[-6.27205974, -0.00087385, 0.00053565, 0.00087836, -0.00000113, 0.00000000],
+		[-6.27206040, -0.00087361, 0.00053550, 0.00087812, -0.00000113, 0.00000000],
+		[-6.27206106, -0.00087336, 0.00053535, 0.00087787, -0.00000113, 0.00000000],
+		[-6.27206173, -0.00087311, 0.00053520, 0.00087762, -0.00000113, 0.00000000],
+		[-6.27206239, -0.00087287, 0.00053505, 0.00087737, -0.00000113, 0.00000000],
+		[-6.27206305, -0.00087262, 0.00053490, 0.00087713, -0.00000113, 0.00000000],
+		[-6.27206371, -0.00087238, 0.00053475, 0.00087688, -0.00000113, 0.00000000],
+		[-6.27206437, -0.00087213, 0.00053460, 0.00087663, -0.00000113, 0.00000000],
+		[-6.27206503, -0.00087188, 0.00053445, 0.00087638, -0.00000113, 0.00000000],
+		[-6.27206569, -0.00087164, 0.00053429, 0.00087614, -0.00000113, 0.00000000],
+		[-6.27206635, -0.00087139, 0.00053414, 0.00087589, -0.00000113, 0.00000000],
+		[-6.27206701, -0.00087115, 0.00053399, 0.00087564, -0.00000113, 0.00000000],
+		[-6.27206767, -0.00087090, 0.00053384, 0.00087540, -0.00000113, 0.00000000],
+		[-6.27206832, -0.00087066, 0.00053369, 0.00087515, -0.00000113, 0.00000000],
+		[-6.27206898, -0.00087041, 0.00053354, 0.00087491, -0.00000113, 0.00000000],
+		[-6.27206963, -0.00087017, 0.00053339, 0.00087466, -0.00000113, 0.00000000],
+		[-6.27207029, -0.00086992, 0.00053324, 0.00087441, -0.00000113, 0.00000000],
+		[-6.27207094, -0.00086968, 0.00053309, 0.00087417, -0.00000113, 0.00000000],
+		[-6.27207160, -0.00086944, 0.00053294, 0.00087392, -0.00000113, 0.00000000],
+		[-6.27207225, -0.00086919, 0.00053279, 0.00087368, -0.00000113, 0.00000000],
+		[-6.27207290, -0.00086895, 0.00053264, 0.00087343, -0.00000113, 0.00000000],
+		[-6.27207355, -0.00086870, 0.00053249, 0.00087319, -0.00000113, 0.00000000],
+		[-6.27207420, -0.00086846, 0.00053234, 0.00087294, -0.00000113, 0.00000000],
+		[-6.27207485, -0.00086822, 0.00053219, 0.00087270, -0.00000113, 0.00000000],
+		[-6.27207550, -0.00086797, 0.00053205, 0.00087245, -0.00000113, 0.00000000],
+		[-6.27207615, -0.00086773, 0.00053190, 0.00087221, -0.00000113, 0.00000000],
+		[-6.27207680, -0.00086749, 0.00053175, 0.00087196, -0.00000113, 0.00000000],
+		[-6.27207745, -0.00086724, 0.00053160, 0.00087172, -0.00000113, 0.00000000],
+		[-6.27207810, -0.00086700, 0.00053145, 0.00087147, -0.00000113, 0.00000000],
+		[-6.27207874, -0.00086676, 0.00053130, 0.00087123, -0.00000113, 0.00000000],
+		[-6.27207939, -0.00086652, 0.00053115, 0.00087099, -0.00000113, 0.00000000],
+		[-6.27208004, -0.00086627, 0.00053100, 0.00087074, -0.00000113, 0.00000000],
+		[-6.27208068, -0.00086603, 0.00053085, 0.00087050, -0.00000113, 0.00000000],
+		[-6.27208132, -0.00086579, 0.00053070, 0.00087026, -0.00000113, 0.00000000],
+		[-6.27208197, -0.00086555, 0.00053056, 0.00087001, -0.00000113, 0.00000000],
+		[-6.27208261, -0.00086530, 0.00053041, 0.00086977, -0.00000113, 0.00000000],
+		[-6.27208325, -0.00086506, 0.00053026, 0.00086953, -0.00000113, 0.00000000],
+		[-6.27208390, -0.00086482, 0.00053011, 0.00086928, -0.00000113, 0.00000000],
+		[-6.27208454, -0.00086458, 0.00052996, 0.00086904, -0.00000113, 0.00000000],
+		[-6.27208518, -0.00086434, 0.00052981, 0.00086880, -0.00000113, 0.00000000],
+		[-6.27208582, -0.00086410, 0.00052967, 0.00086856, -0.00000113, 0.00000000],
+		[-6.27208646, -0.00086386, 0.00052952, 0.00086831, -0.00000113, 0.00000000],
+		[-6.27208710, -0.00086361, 0.00052937, 0.00086807, -0.00000113, 0.00000000],
+		[-6.27208774, -0.00086337, 0.00052922, 0.00086783, -0.00000113, 0.00000000],
+		[-6.27208837, -0.00086313, 0.00052908, 0.00086759, -0.00000113, 0.00000000],
+		[-6.27208901, -0.00086289, 0.00052893, 0.00086734, -0.00000113, 0.00000000],
+		[-6.27208965, -0.00086265, 0.00052878, 0.00086710, -0.00000113, 0.00000000],
+		[-6.27209028, -0.00086241, 0.00052863, 0.00086686, -0.00000113, 0.00000000],
+		[-6.27209092, -0.00086217, 0.00052849, 0.00086662, -0.00000113, 0.00000000],
+		[-6.27209155, -0.00086193, 0.00052834, 0.00086638, -0.00000113, 0.00000000],
+		[-6.27209219, -0.00086169, 0.00052819, 0.00086614, -0.00000113, 0.00000000],
+		[-6.27209282, -0.00086145, 0.00052804, 0.00086590, -0.00000113, 0.00000000],
+		[-6.27209346, -0.00086121, 0.00052790, 0.00086565, -0.00000113, 0.00000000],
+		[-6.27209409, -0.00086097, 0.00052775, 0.00086541, -0.00000113, 0.00000000],
+		[-6.27209472, -0.00086073, 0.00052760, 0.00086517, -0.00000113, 0.00000000],
+		[-6.27209535, -0.00086049, 0.00052746, 0.00086493, -0.00000113, 0.00000000],
+		[-6.27209598, -0.00086025, 0.00052731, 0.00086469, -0.00000113, 0.00000000],
+		[-6.27209661, -0.00086002, 0.00052716, 0.00086445, -0.00000113, 0.00000000],
+		[-6.27209724, -0.00085978, 0.00052702, 0.00086421, -0.00000113, 0.00000000],
+		[-6.27209787, -0.00085954, 0.00052687, 0.00086397, -0.00000113, 0.00000000],
+		[-6.27209850, -0.00085930, 0.00052672, 0.00086373, -0.00000113, 0.00000000],
+		[-6.27209913, -0.00085906, 0.00052658, 0.00086349, -0.00000113, 0.00000000],
+		[-6.27209976, -0.00085882, 0.00052643, 0.00086325, -0.00000113, 0.00000000],
+		[-6.27210038, -0.00085858, 0.00052628, 0.00086301, -0.00000113, 0.00000000],
+		[-6.27210101, -0.00085835, 0.00052614, 0.00086277, -0.00000113, 0.00000000],
+		[-6.27210164, -0.00085811, 0.00052599, 0.00086253, -0.00000113, 0.00000000],
+		[-6.27210226, -0.00085787, 0.00052585, 0.00086230, -0.00000113, 0.00000000],
+		[-6.27210289, -0.00085763, 0.00052570, 0.00086206, -0.00000113, 0.00000000],
+		[-6.27210351, -0.00085740, 0.00052555, 0.00086182, -0.00000113, 0.00000000],
+		[-6.27210414, -0.00085716, 0.00052541, 0.00086158, -0.00000113, 0.00000000],
+		[-6.27210476, -0.00085692, 0.00052526, 0.00086134, -0.00000113, 0.00000000],
+		[-6.27210538, -0.00085668, 0.00052512, 0.00086110, -0.00000113, 0.00000000],
+		[-6.27210600, -0.00085645, 0.00052497, 0.00086086, -0.00000113, 0.00000000],
+		[-6.27210663, -0.00085621, 0.00052483, 0.00086063, -0.00000113, 0.00000000],
+		[-6.27210725, -0.00085597, 0.00052468, 0.00086039, -0.00000113, 0.00000000],
+		[-6.27210787, -0.00085574, 0.00052454, 0.00086015, -0.00000113, 0.00000000],
+		[-6.27210849, -0.00085550, 0.00052439, 0.00085991, -0.00000113, 0.00000000],
+		[-6.27210911, -0.00085526, 0.00052425, 0.00085967, -0.00000113, 0.00000000],
+		[-6.27210973, -0.00085503, 0.00052410, 0.00085944, -0.00000113, 0.00000000],
+		[-6.27211034, -0.00085479, 0.00052396, 0.00085920, -0.00000113, 0.00000000],
+		[-6.27211096, -0.00085456, 0.00052381, 0.00085896, -0.00000113, 0.00000000],
+		[-6.27211158, -0.00085432, 0.00052367, 0.00085873, -0.00000113, 0.00000000],
+		[-6.27211220, -0.00085408, 0.00052352, 0.00085849, -0.00000113, 0.00000000],
+		[-6.27211281, -0.00085385, 0.00052338, 0.00085825, -0.00000113, 0.00000000],
+		[-6.27211343, -0.00085361, 0.00052323, 0.00085801, -0.00000113, 0.00000000],
+		[-6.27211404, -0.00085338, 0.00052309, 0.00085778, -0.00000113, 0.00000000],
+		[-6.27211466, -0.00085314, 0.00052295, 0.00085754, -0.00000113, 0.00000000],
+		[-6.27211527, -0.00085291, 0.00052280, 0.00085731, -0.00000113, 0.00000000],
+		[-6.27211589, -0.00085267, 0.00052266, 0.00085707, -0.00000113, 0.00000000],
+		[-6.27211650, -0.00085244, 0.00052251, 0.00085683, -0.00000113, 0.00000000],
+		[-6.27211711, -0.00085220, 0.00052237, 0.00085660, -0.00000113, 0.00000000],
+		[-6.27211772, -0.00085197, 0.00052222, 0.00085636, -0.00000113, 0.00000000],
+		[-6.27211833, -0.00085173, 0.00052208, 0.00085613, -0.00000113, 0.00000000],
+		[-6.27211895, -0.00085150, 0.00052194, 0.00085589, -0.00000113, 0.00000000],
+		[-6.27211956, -0.00085127, 0.00052179, 0.00085565, -0.00000113, 0.00000000],
+		[-6.27212017, -0.00085103, 0.00052165, 0.00085542, -0.00000113, 0.00000000],
+		[-6.27212078, -0.00085080, 0.00052151, 0.00085518, -0.00000113, 0.00000000],
+		[-6.27212138, -0.00085056, 0.00052136, 0.00085495, -0.00000113, 0.00000000],
+		[-6.27212199, -0.00085033, 0.00052122, 0.00085471, -0.00000113, 0.00000000],
+		[-6.27212260, -0.00085010, 0.00052108, 0.00085448, -0.00000113, 0.00000000],
+		[-6.27212321, -0.00084986, 0.00052093, 0.00085425, -0.00000113, 0.00000000],
+		[-6.27212381, -0.00084963, 0.00052079, 0.00085401, -0.00000113, 0.00000000],
+		[-6.27212442, -0.00084940, 0.00052065, 0.00085378, -0.00000113, 0.00000000],
+		[-6.27212503, -0.00084916, 0.00052050, 0.00085354, -0.00000113, 0.00000000],
+		[-6.27212563, -0.00084893, 0.00052036, 0.00085331, -0.00000113, 0.00000000],
+		[-6.27212624, -0.00084870, 0.00052022, 0.00085307, -0.00000113, 0.00000000],
+		[-6.27212684, -0.00084847, 0.00052008, 0.00085284, -0.00000113, 0.00000000],
+		[-6.27212744, -0.00084823, 0.00051993, 0.00085261, -0.00000113, 0.00000000],
+		[-6.27212805, -0.00084800, 0.00051979, 0.00085237, -0.00000113, 0.00000000],
+		[-6.27212865, -0.00084777, 0.00051965, 0.00085214, -0.00000113, 0.00000000],
+		[-6.27212925, -0.00084754, 0.00051951, 0.00085191, -0.00000113, 0.00000000],
+		[-6.27212986, -0.00084730, 0.00051936, 0.00085167, -0.00000113, 0.00000000],
+		[-6.27213046, -0.00084707, 0.00051922, 0.00085144, -0.00000113, 0.00000000],
+		[-6.27213106, -0.00084684, 0.00051908, 0.00085121, -0.00000113, 0.00000000],
+		[-6.27213166, -0.00084661, 0.00051894, 0.00085097, -0.00000113, 0.00000000],
+		[-6.27213226, -0.00084638, 0.00051879, 0.00085074, -0.00000113, 0.00000000],
+		[-6.27213286, -0.00084615, 0.00051865, 0.00085051, -0.00000113, 0.00000000],
+		[-6.27213345, -0.00084592, 0.00051851, 0.00085028, -0.00000113, 0.00000000],
+		[-6.27213405, -0.00084568, 0.00051837, 0.00085004, -0.00000113, 0.00000000],
+		[-6.27213465, -0.00084545, 0.00051823, 0.00084981, -0.00000113, 0.00000000],
+		[-6.27213525, -0.00084522, 0.00051809, 0.00084958, -0.00000113, 0.00000000],
+		[-6.27213585, -0.00084499, 0.00051794, 0.00084935, -0.00000113, 0.00000000],
+		[-6.27213644, -0.00084476, 0.00051780, 0.00084912, -0.00000113, 0.00000000],
+		[-6.27213704, -0.00084453, 0.00051766, 0.00084888, -0.00000113, 0.00000000],
+		[-6.27213763, -0.00084430, 0.00051752, 0.00084865, -0.00000113, 0.00000000],
+		[-6.27213823, -0.00084407, 0.00051738, 0.00084842, -0.00000113, 0.00000000],
+		[-6.27213882, -0.00084384, 0.00051724, 0.00084819, -0.00000113, 0.00000000],
+		[-6.27213942, -0.00084361, 0.00051710, 0.00084796, -0.00000113, 0.00000000],
+		[-6.27214001, -0.00084338, 0.00051696, 0.00084773, -0.00000113, 0.00000000],
+		[-6.27214060, -0.00084315, 0.00051681, 0.00084750, -0.00000113, 0.00000000],
+		[-6.27214120, -0.00084292, 0.00051667, 0.00084727, -0.00000113, 0.00000000],
+		[-6.27214179, -0.00084269, 0.00051653, 0.00084703, -0.00000113, 0.00000000],
+		[-6.27214238, -0.00084246, 0.00051639, 0.00084680, -0.00000113, 0.00000000],
+		[-6.27214297, -0.00084223, 0.00051625, 0.00084657, -0.00000113, 0.00000000],
+		[-6.27214356, -0.00084200, 0.00051611, 0.00084634, -0.00000113, 0.00000000],
+		[-6.27214415, -0.00084178, 0.00051597, 0.00084611, -0.00000113, 0.00000000],
+		[-6.27214474, -0.00084155, 0.00051583, 0.00084588, -0.00000113, 0.00000000],
+		[-6.27214533, -0.00084132, 0.00051569, 0.00084565, -0.00000113, 0.00000000],
+		[-6.27214592, -0.00084109, 0.00051555, 0.00084542, -0.00000113, 0.00000000],
+		[-6.27214651, -0.00084086, 0.00051541, 0.00084519, -0.00000113, 0.00000000],
+		[-6.27214709, -0.00084063, 0.00051527, 0.00084496, -0.00000113, 0.00000000],
+		[-6.27214768, -0.00084040, 0.00051513, 0.00084473, -0.00000113, 0.00000000],
+		[-6.27214827, -0.00084018, 0.00051499, 0.00084451, -0.00000113, 0.00000000],
+		[-6.27214885, -0.00083995, 0.00051485, 0.00084428, -0.00000113, 0.00000000],
+		[-6.27214944, -0.00083972, 0.00051471, 0.00084405, -0.00000113, 0.00000000],
+		[-6.27215002, -0.00083949, 0.00051457, 0.00084382, -0.00000113, 0.00000000],
+		[-6.27215061, -0.00083926, 0.00051443, 0.00084359, -0.00000113, 0.00000000],
+		[-6.27215119, -0.00083904, 0.00051429, 0.00084336, -0.00000113, 0.00000000],
+		[-6.27215178, -0.00083881, 0.00051415, 0.00084313, -0.00000113, 0.00000000],
+		[-6.27215236, -0.00083858, 0.00051401, 0.00084290, -0.00000113, 0.00000000],
+		[-6.27215294, -0.00083836, 0.00051387, 0.00084268, -0.00000113, 0.00000000],
+		[-6.27215353, -0.00083813, 0.00051373, 0.00084245, -0.00000113, 0.00000000],
+		[-6.27215411, -0.00083790, 0.00051359, 0.00084222, -0.00000113, 0.00000000],
+		[-6.27215469, -0.00083768, 0.00051345, 0.00084199, -0.00000113, 0.00000000],
+		[-6.27215527, -0.00083745, 0.00051332, 0.00084176, -0.00000113, 0.00000000],
+		[-6.27215585, -0.00083722, 0.00051318, 0.00084154, -0.00000113, 0.00000000],
+		[-6.27215643, -0.00083700, 0.00051304, 0.00084131, -0.00000113, 0.00000000],
+		[-6.27215701, -0.00083677, 0.00051290, 0.00084108, -0.00000113, 0.00000000],
+		[-6.27215759, -0.00083654, 0.00051276, 0.00084085, -0.00000113, 0.00000000],
+		[-6.27215817, -0.00083632, 0.00051262, 0.00084063, -0.00000113, 0.00000000],
+		[-6.27215875, -0.00083609, 0.00051248, 0.00084040, -0.00000113, 0.00000000],
+		[-6.27215933, -0.00083587, 0.00051234, 0.00084017, -0.00000113, 0.00000000],
+		[-6.27215990, -0.00083564, 0.00051221, 0.00083995, -0.00000113, 0.00000000],
+		[-6.27216048, -0.00083541, 0.00051207, 0.00083972, -0.00000113, 0.00000000],
+		[-6.27216106, -0.00083519, 0.00051193, 0.00083949, -0.00000113, 0.00000000],
+		[-6.27216164, -0.00083496, 0.00051179, 0.00083927, -0.00000113, 0.00000000],
+		[-6.27216221, -0.00083474, 0.00051165, 0.00083904, -0.00000113, 0.00000000],
+		[-6.27216279, -0.00083451, 0.00051151, 0.00083881, -0.00000113, 0.00000000],
+		[-6.27216336, -0.00083429, 0.00051138, 0.00083859, -0.00000113, 0.00000000],
+		[-6.27216394, -0.00083406, 0.00051124, 0.00083836, -0.00000113, 0.00000000],
+		[-6.27216451, -0.00083384, 0.00051110, 0.00083813, -0.00000113, 0.00000000],
+		[-6.27216508, -0.00083361, 0.00051096, 0.00083791, -0.00000113, 0.00000000],
+		[-6.27216566, -0.00083339, 0.00051083, 0.00083768, -0.00000113, 0.00000000],
+		[-6.27216623, -0.00083317, 0.00051069, 0.00083746, -0.00000113, 0.00000000],
+		[-6.27216680, -0.00083294, 0.00051055, 0.00083723, -0.00000113, 0.00000000],
+		[-6.27216737, -0.00083272, 0.00051041, 0.00083701, -0.00000113, 0.00000000],
+		[-6.27216794, -0.00083249, 0.00051028, 0.00083678, -0.00000113, 0.00000000],
+		[-6.27216851, -0.00083227, 0.00051014, 0.00083656, -0.00000113, 0.00000000],
+		[-6.27216909, -0.00083205, 0.00051000, 0.00083633, -0.00000113, 0.00000000],
+		[-6.27216966, -0.00083182, 0.00050986, 0.00083611, -0.00000113, 0.00000000],
+		[-6.27217022, -0.00083160, 0.00050973, 0.00083588, -0.00000113, 0.00000000],
+		[-6.27217079, -0.00083138, 0.00050959, 0.00083566, -0.00000113, 0.00000000],
+		[-6.27217136, -0.00083115, 0.00050945, 0.00083543, -0.00000113, 0.00000000],
+		[-6.27217193, -0.00083093, 0.00050932, 0.00083521, -0.00000113, 0.00000000],
+		[-6.27217250, -0.00083071, 0.00050918, 0.00083499, -0.00000113, 0.00000000],
+		[-6.27217307, -0.00083048, 0.00050904, 0.00083476, -0.00000113, 0.00000000],
+		[-6.27217363, -0.00083026, 0.00050891, 0.00083454, -0.00000113, 0.00000000],
+		[-6.27217420, -0.00083004, 0.00050877, 0.00083431, -0.00000113, 0.00000000],
+		[-6.27217477, -0.00082982, 0.00050863, 0.00083409, -0.00000113, 0.00000000],
+		[-6.27217533, -0.00082959, 0.00050850, 0.00083387, -0.00000113, 0.00000000],
+		[-6.27217590, -0.00082937, 0.00050836, 0.00083364, -0.00000113, 0.00000000],
+		[-6.27217646, -0.00082915, 0.00050822, 0.00083342, -0.00000113, 0.00000000],
+		[-6.27217703, -0.00082893, 0.00050809, 0.00083320, -0.00000113, 0.00000000],
+		[-6.27217759, -0.00082871, 0.00050795, 0.00083297, -0.00000113, 0.00000000],
+		[-6.27217815, -0.00082848, 0.00050782, 0.00083275, -0.00000113, 0.00000000],
+		[-6.27217872, -0.00082826, 0.00050768, 0.00083253, -0.00000113, 0.00000000],
+		[-6.27217928, -0.00082804, 0.00050754, 0.00083230, -0.00000113, 0.00000000],
+		[-6.27217984, -0.00082782, 0.00050741, 0.00083208, -0.00000113, 0.00000000],
+		[-6.27218040, -0.00082760, 0.00050727, 0.00083186, -0.00000113, 0.00000000],
+		[-6.27218097, -0.00082738, 0.00050714, 0.00083164, -0.00000113, 0.00000000],
+		[-6.27218153, -0.00082716, 0.00050700, 0.00083141, -0.00000113, 0.00000000],
+		[-6.27218209, -0.00082693, 0.00050686, 0.00083119, -0.00000113, 0.00000000],
+		[-6.27218265, -0.00082671, 0.00050673, 0.00083097, -0.00000113, 0.00000000],
+		[-6.27218321, -0.00082649, 0.00050659, 0.00083075, -0.00000113, 0.00000000],
+		[-6.27218377, -0.00082627, 0.00050646, 0.00083053, -0.00000113, 0.00000000],
+		[-6.27218433, -0.00082605, 0.00050632, 0.00083031, -0.00000113, 0.00000000],
+		[-6.27218488, -0.00082583, 0.00050619, 0.00083008, -0.00000113, 0.00000000],
+		[-6.27218544, -0.00082561, 0.00050605, 0.00082986, -0.00000113, 0.00000000],
+		[-6.27218600, -0.00082539, 0.00050592, 0.00082964, -0.00000113, 0.00000000],
+		[-6.27218656, -0.00082517, 0.00050578, 0.00082942, -0.00000113, 0.00000000],
+		[-6.27218711, -0.00082495, 0.00050565, 0.00082920, -0.00000113, 0.00000000],
+		[-6.27218767, -0.00082473, 0.00050551, 0.00082898, -0.00000113, 0.00000000],
+		[-6.27218823, -0.00082451, 0.00050538, 0.00082876, -0.00000113, 0.00000000],
+		[-6.27218878, -0.00082429, 0.00050524, 0.00082854, -0.00000113, 0.00000000],
+		[-6.27218934, -0.00082407, 0.00050511, 0.00082832, -0.00000113, 0.00000000],
+		[-6.27218989, -0.00082385, 0.00050497, 0.00082810, -0.00000113, 0.00000000],
+		[-6.27219045, -0.00082363, 0.00050484, 0.00082787, -0.00000113, 0.00000000],
+		[-6.27219100, -0.00082341, 0.00050471, 0.00082765, -0.00000113, 0.00000000],
+		[-6.27219155, -0.00082320, 0.00050457, 0.00082743, -0.00000113, 0.00000000],
+		[-6.27219211, -0.00082298, 0.00050444, 0.00082721, -0.00000113, 0.00000000],
+		[-6.27219266, -0.00082276, 0.00050430, 0.00082699, -0.00000113, 0.00000000],
+		[-6.27219321, -0.00082254, 0.00050417, 0.00082677, -0.00000113, 0.00000000],
+		[-6.27219376, -0.00082232, 0.00050403, 0.00082656, -0.00000113, 0.00000000],
+		[-6.27219432, -0.00082210, 0.00050390, 0.00082634, -0.00000113, 0.00000000],
+		[-6.27219487, -0.00082188, 0.00050377, 0.00082612, -0.00000113, 0.00000000],
+		[-6.27219542, -0.00082167, 0.00050363, 0.00082590, -0.00000113, 0.00000000],
+		[-6.27219597, -0.00082145, 0.00050350, 0.00082568, -0.00000113, 0.00000000],
+		[-6.27219652, -0.00082123, 0.00050337, 0.00082546, -0.00000113, 0.00000000],
+		[-6.27219707, -0.00082101, 0.00050323, 0.00082524, -0.00000113, 0.00000000],
+		[-6.27219762, -0.00082080, 0.00050310, 0.00082502, -0.00000113, 0.00000000],
+		[-6.27219817, -0.00082058, 0.00050296, 0.00082480, -0.00000113, 0.00000000],
+		[-6.27219872, -0.00082036, 0.00050283, 0.00082458, -0.00000113, 0.00000000],
+		[-6.27219926, -0.00082014, 0.00050270, 0.00082436, -0.00000113, 0.00000000],
+		[-6.27219981, -0.00081993, 0.00050256, 0.00082415, -0.00000113, 0.00000000],
+		[-6.27220036, -0.00081971, 0.00050243, 0.00082393, -0.00000113, 0.00000000],
+		[-6.27220091, -0.00081949, 0.00050230, 0.00082371, -0.00000113, 0.00000000],
+		[-6.27220145, -0.00081927, 0.00050216, 0.00082349, -0.00000113, 0.00000000],
+		[-6.27220200, -0.00081906, 0.00050203, 0.00082327, -0.00000113, 0.00000000],
+		[-6.27220254, -0.00081884, 0.00050190, 0.00082306, -0.00000113, 0.00000000],
+		[-6.27220309, -0.00081862, 0.00050177, 0.00082284, -0.00000113, 0.00000000],
+		[-6.27220363, -0.00081841, 0.00050163, 0.00082262, -0.00000113, 0.00000000],
+		[-6.27220418, -0.00081819, 0.00050150, 0.00082240, -0.00000113, 0.00000000],
+		[-6.27220472, -0.00081798, 0.00050137, 0.00082219, -0.00000113, 0.00000000],
+		[-6.27220527, -0.00081776, 0.00050124, 0.00082197, -0.00000113, 0.00000000],
+		[-6.27220581, -0.00081754, 0.00050110, 0.00082175, -0.00000113, 0.00000000],
+		[-6.27220635, -0.00081733, 0.00050097, 0.00082153, -0.00000113, 0.00000000],
+		[-6.27220690, -0.00081711, 0.00050084, 0.00082132, -0.00000113, 0.00000000],
+		[-6.27220744, -0.00081690, 0.00050071, 0.00082110, -0.00000113, 0.00000000],
+		[-6.27220798, -0.00081668, 0.00050057, 0.00082088, -0.00000113, 0.00000000],
+		[-6.27220852, -0.00081647, 0.00050044, 0.00082067, -0.00000113, 0.00000000],
+		[-6.27220906, -0.00081625, 0.00050031, 0.00082045, -0.00000113, 0.00000000],
+		[-6.27220960, -0.00081604, 0.00050018, 0.00082024, -0.00000113, 0.00000000],
+		[-6.27221014, -0.00081582, 0.00050005, 0.00082002, -0.00000113, 0.00000000],
+		[-6.27221068, -0.00081561, 0.00049991, 0.00081980, -0.00000113, 0.00000000],
+		[-6.27221122, -0.00081539, 0.00049978, 0.00081959, -0.00000113, 0.00000000],
+		[-6.27221176, -0.00081518, 0.00049965, 0.00081937, -0.00000113, 0.00000000],
+		[-6.27221230, -0.00081496, 0.00049952, 0.00081916, -0.00000113, 0.00000000],
+		[-6.27221284, -0.00081475, 0.00049939, 0.00081894, -0.00000113, 0.00000000],
+		[-6.27221338, -0.00081453, 0.00049926, 0.00081872, -0.00000113, 0.00000000],
+		[-6.27221391, -0.00081432, 0.00049912, 0.00081851, -0.00000113, 0.00000000],
+		[-6.27221445, -0.00081410, 0.00049899, 0.00081829, -0.00000113, 0.00000000],
+		[-6.27221499, -0.00081389, 0.00049886, 0.00081808, -0.00000113, 0.00000000],
+		[-6.27221552, -0.00081368, 0.00049873, 0.00081786, -0.00000113, 0.00000000],
+		[-6.27221606, -0.00081346, 0.00049860, 0.00081765, -0.00000113, 0.00000000],
+		[-6.27221660, -0.00081325, 0.00049847, 0.00081743, -0.00000113, 0.00000000],
+		[-6.27221713, -0.00081303, 0.00049834, 0.00081722, -0.00000113, 0.00000000],
+		[-6.27221767, -0.00081282, 0.00049821, 0.00081700, -0.00000113, 0.00000000],
+		[-6.27221820, -0.00081261, 0.00049807, 0.00081679, -0.00000113, 0.00000000],
+		[-6.27221874, -0.00081239, 0.00049794, 0.00081657, -0.00000113, 0.00000000],
+		[-6.27221927, -0.00081218, 0.00049781, 0.00081636, -0.00000113, 0.00000000],
+		[-6.27221980, -0.00081197, 0.00049768, 0.00081615, -0.00000113, 0.00000000],
+		[-6.27222034, -0.00081176, 0.00049755, 0.00081593, -0.00000113, 0.00000000],
+		[-6.27222087, -0.00081154, 0.00049742, 0.00081572, -0.00000113, 0.00000000],
+		[-6.27222140, -0.00081133, 0.00049729, 0.00081550, -0.00000113, 0.00000000],
+		[-6.27222193, -0.00081112, 0.00049716, 0.00081529, -0.00000113, 0.00000000],
+		[-6.27222247, -0.00081090, 0.00049703, 0.00081508, -0.00000113, 0.00000000],
+		[-6.27222300, -0.00081069, 0.00049690, 0.00081486, -0.00000113, 0.00000000],
+		[-6.27222353, -0.00081048, 0.00049677, 0.00081465, -0.00000113, 0.00000000],
+		[-6.27222406, -0.00081027, 0.00049664, 0.00081444, -0.00000113, 0.00000000],
+		[-6.27222459, -0.00081006, 0.00049651, 0.00081422, -0.00000113, 0.00000000],
+		[-6.27222512, -0.00080984, 0.00049638, 0.00081401, -0.00000113, 0.00000000],
+		[-6.27222565, -0.00080963, 0.00049625, 0.00081380, -0.00000113, 0.00000000],
+		[-6.27222618, -0.00080942, 0.00049612, 0.00081359, -0.00000113, 0.00000000],
+		[-6.27222671, -0.00080921, 0.00049599, 0.00081337, -0.00000113, 0.00000000],
+		[-6.27222723, -0.00080900, 0.00049586, 0.00081316, -0.00000113, 0.00000000],
+		[-6.27222776, -0.00080879, 0.00049573, 0.00081295, -0.00000113, 0.00000000],
+		[-6.27222829, -0.00080857, 0.00049560, 0.00081273, -0.00000113, 0.00000000],
+		[-6.27222882, -0.00080836, 0.00049547, 0.00081252, -0.00000113, 0.00000000],
+		[-6.27222934, -0.00080815, 0.00049534, 0.00081231, -0.00000113, 0.00000000],
+		[-6.27222987, -0.00080794, 0.00049521, 0.00081210, -0.00000113, 0.00000000],
+		[-6.27223040, -0.00080773, 0.00049508, 0.00081189, -0.00000113, 0.00000000],
+		[-6.27223092, -0.00080752, 0.00049495, 0.00081167, -0.00000113, 0.00000000],
+		[-6.27223145, -0.00080731, 0.00049482, 0.00081146, -0.00000113, 0.00000000],
+		[-6.27223197, -0.00080710, 0.00049469, 0.00081125, -0.00000113, 0.00000000],
+		[-6.27223250, -0.00080689, 0.00049457, 0.00081104, -0.00000113, 0.00000000],
+		[-6.27223302, -0.00080668, 0.00049444, 0.00081083, -0.00000113, 0.00000000],
+		[-6.27223355, -0.00080647, 0.00049431, 0.00081062, -0.00000113, 0.00000000],
+		[-6.27223407, -0.00080626, 0.00049418, 0.00081041, -0.00000113, 0.00000000],
+		[-6.27223460, -0.00080605, 0.00049405, 0.00081019, -0.00000113, 0.00000000],
+		[-6.27223512, -0.00080584, 0.00049392, 0.00080998, -0.00000113, 0.00000000],
+		[-6.27223564, -0.00080563, 0.00049379, 0.00080977, -0.00000113, 0.00000000],
+		[-6.27223616, -0.00080542, 0.00049366, 0.00080956, -0.00000113, 0.00000000],
+		[-6.27223669, -0.00080521, 0.00049354, 0.00080935, -0.00000113, 0.00000000],
+		[-6.27223721, -0.00080500, 0.00049341, 0.00080914, -0.00000113, 0.00000000],
+		[-6.27223773, -0.00080479, 0.00049328, 0.00080893, -0.00000113, 0.00000000],
+		[-6.27223825, -0.00080458, 0.00049315, 0.00080872, -0.00000113, 0.00000000],
+		[-6.27223877, -0.00080437, 0.00049302, 0.00080851, -0.00000113, 0.00000000],
+		[-6.27223929, -0.00080416, 0.00049289, 0.00080830, -0.00000113, 0.00000000],
+		[-6.27223981, -0.00080395, 0.00049277, 0.00080809, -0.00000113, 0.00000000],
+		[-6.27224033, -0.00080375, 0.00049264, 0.00080788, -0.00000113, 0.00000000],
+		[-6.27224085, -0.00080354, 0.00049251, 0.00080767, -0.00000113, 0.00000000],
+		[-6.27224137, -0.00080333, 0.00049238, 0.00080746, -0.00000113, 0.00000000],
+		[-6.27224189, -0.00080312, 0.00049225, 0.00080725, -0.00000113, 0.00000000],
+		[-6.27224241, -0.00080291, 0.00049213, 0.00080704, -0.00000113, 0.00000000],
+		[-6.27224292, -0.00080270, 0.00049200, 0.00080683, -0.00000113, 0.00000000],
+		[-6.27224344, -0.00080250, 0.00049187, 0.00080662, -0.00000113, 0.00000000],
+		[-6.27224396, -0.00080229, 0.00049174, 0.00080641, -0.00000113, 0.00000000],
+		[-6.27224447, -0.00080208, 0.00049162, 0.00080621, -0.00000113, 0.00000000],
+		[-6.27224499, -0.00080187, 0.00049149, 0.00080600, -0.00000113, 0.00000000],
+		[-6.27224551, -0.00080166, 0.00049136, 0.00080579, -0.00000113, 0.00000000],
+		[-6.27224602, -0.00080146, 0.00049123, 0.00080558, -0.00000113, 0.00000000],
+		[-6.27224654, -0.00080125, 0.00049111, 0.00080537, -0.00000113, 0.00000000],
+		[-6.27224705, -0.00080104, 0.00049098, 0.00080516, -0.00000113, 0.00000000],
+		[-6.27224757, -0.00080084, 0.00049085, 0.00080495, -0.00000113, 0.00000000],
+		[-6.27224808, -0.00080063, 0.00049072, 0.00080475, -0.00000113, 0.00000000],
+		[-6.27224860, -0.00080042, 0.00049060, 0.00080454, -0.00000113, 0.00000000],
+		[-6.27224911, -0.00080021, 0.00049047, 0.00080433, -0.00000113, 0.00000000],
+		[-6.27224962, -0.00080001, 0.00049034, 0.00080412, -0.00000113, 0.00000000],
+		[-6.27225014, -0.00079980, 0.00049022, 0.00080391, -0.00000113, 0.00000000],
+		[-6.27225065, -0.00079959, 0.00049009, 0.00080371, -0.00000113, 0.00000000],
+		[-6.27225116, -0.00079939, 0.00048996, 0.00080350, -0.00000113, 0.00000000],
+		[-6.27225168, -0.00079918, 0.00048984, 0.00080329, -0.00000113, 0.00000000],
+		[-6.27225219, -0.00079897, 0.00048971, 0.00080308, -0.00000113, 0.00000000],
+		[-6.27225270, -0.00079877, 0.00048958, 0.00080288, -0.00000113, 0.00000000],
+		[-6.27225321, -0.00079856, 0.00048946, 0.00080267, -0.00000113, 0.00000000],
+		[-6.27225372, -0.00079836, 0.00048933, 0.00080246, -0.00000113, 0.00000000],
+		[-6.27225423, -0.00079815, 0.00048921, 0.00080226, -0.00000113, 0.00000000],
+		[-6.27225474, -0.00079795, 0.00048908, 0.00080205, -0.00000113, 0.00000000],
+		[-6.27225525, -0.00079774, 0.00048895, 0.00080184, -0.00000113, 0.00000000],
+		[-6.27225576, -0.00079753, 0.00048883, 0.00080164, -0.00000113, 0.00000000],
+		[-6.27225627, -0.00079733, 0.00048870, 0.00080143, -0.00000113, 0.00000000],
+		[-6.27225678, -0.00079712, 0.00048857, 0.00080122, -0.00000113, 0.00000000],
+		[-6.27225729, -0.00079692, 0.00048845, 0.00080102, -0.00000113, 0.00000000],
+		[-6.27225780, -0.00079671, 0.00048832, 0.00080081, -0.00000113, 0.00000000],
+		[-6.27225830, -0.00079651, 0.00048820, 0.00080060, -0.00000113, 0.00000000],
+		[-6.27225881, -0.00079630, 0.00048807, 0.00080040, -0.00000113, 0.00000000],
+		[-6.27225932, -0.00079610, 0.00048795, 0.00080019, -0.00000113, 0.00000000],
+		[-6.27225983, -0.00079589, 0.00048782, 0.00079999, -0.00000113, 0.00000000],
+		[-6.27226033, -0.00079569, 0.00048769, 0.00079978, -0.00000113, 0.00000000],
+		[-6.27226084, -0.00079548, 0.00048757, 0.00079957, -0.00000113, 0.00000000],
+		[-6.27226134, -0.00079528, 0.00048744, 0.00079937, -0.00000113, 0.00000000],
+		[-6.27226185, -0.00079508, 0.00048732, 0.00079916, -0.00000113, 0.00000000],
+		[-6.27226235, -0.00079487, 0.00048719, 0.00079896, -0.00000113, 0.00000000],
+		[-6.27226286, -0.00079467, 0.00048707, 0.00079875, -0.00000113, 0.00000000],
+		[-6.27226336, -0.00079446, 0.00048694, 0.00079855, -0.00000113, 0.00000000],
+		[-6.27226387, -0.00079426, 0.00048682, 0.00079834, -0.00000113, 0.00000000],
+		[-6.27226437, -0.00079406, 0.00048669, 0.00079814, -0.00000113, 0.00000000],
+		[-6.27226488, -0.00079385, 0.00048657, 0.00079793, -0.00000113, 0.00000000],
+		[-6.27226538, -0.00079365, 0.00048644, 0.00079773, -0.00000113, 0.00000000],
+		[-6.27226588, -0.00079345, 0.00048632, 0.00079752, -0.00000113, 0.00000000],
+		[-6.27226639, -0.00079324, 0.00048619, 0.00079732, -0.00000113, 0.00000000],
+		[-6.27226689, -0.00079304, 0.00048607, 0.00079712, -0.00000113, 0.00000000],
+		[-6.27226739, -0.00079284, 0.00048594, 0.00079691, -0.00000113, 0.00000000],
+		[-6.27226789, -0.00079263, 0.00048582, 0.00079671, -0.00000113, 0.00000000],
+		[-6.27226839, -0.00079243, 0.00048570, 0.00079650, -0.00000113, 0.00000000],
+		[-6.27226889, -0.00079223, 0.00048557, 0.00079630, -0.00000113, 0.00000000],
+		[-6.27226939, -0.00079202, 0.00048545, 0.00079610, -0.00000113, 0.00000000],
+		[-6.27226990, -0.00079182, 0.00048532, 0.00079589, -0.00000113, 0.00000000],
+		[-6.27227040, -0.00079162, 0.00048520, 0.00079569, -0.00000113, 0.00000000],
+		[-6.27227090, -0.00079142, 0.00048507, 0.00079549, -0.00000113, 0.00000000],
+		[-6.27227139, -0.00079121, 0.00048495, 0.00079528, -0.00000113, 0.00000000],
+		[-6.27227189, -0.00079101, 0.00048483, 0.00079508, -0.00000113, 0.00000000],
+		[-6.27227239, -0.00079081, 0.00048470, 0.00079488, -0.00000113, 0.00000000],
+		[-6.27227289, -0.00079061, 0.00048458, 0.00079467, -0.00000113, 0.00000000],
+		[-6.27227339, -0.00079041, 0.00048445, 0.00079447, -0.00000113, 0.00000000],
+		[-6.27227389, -0.00079020, 0.00048433, 0.00079427, -0.00000113, 0.00000000],
+		[-6.27227439, -0.00079000, 0.00048421, 0.00079406, -0.00000113, 0.00000000],
+		[-6.27227488, -0.00078980, 0.00048408, 0.00079386, -0.00000113, 0.00000000],
+		[-6.27227538, -0.00078960, 0.00048396, 0.00079366, -0.00000113, 0.00000000],
+		[-6.27227588, -0.00078940, 0.00048384, 0.00079346, -0.00000113, 0.00000000],
+		[-6.27227637, -0.00078920, 0.00048371, 0.00079325, -0.00000113, 0.00000000],
+		[-6.27227687, -0.00078900, 0.00048359, 0.00079305, -0.00000113, 0.00000000],
+		[-6.27227736, -0.00078880, 0.00048347, 0.00079285, -0.00000113, 0.00000000],
+		[-6.27227786, -0.00078859, 0.00048334, 0.00079265, -0.00000113, 0.00000000],
+		[-6.27227836, -0.00078839, 0.00048322, 0.00079245, -0.00000113, 0.00000000],
+		[-6.27227885, -0.00078819, 0.00048310, 0.00079224, -0.00000113, 0.00000000],
+		[-6.27227934, -0.00078799, 0.00048297, 0.00079204, -0.00000113, 0.00000000],
+		[-6.27227984, -0.00078779, 0.00048285, 0.00079184, -0.00000113, 0.00000000],
+		[-6.27228033, -0.00078759, 0.00048273, 0.00079164, -0.00000113, 0.00000000],
+		[-6.27228083, -0.00078739, 0.00048260, 0.00079144, -0.00000113, 0.00000000],
+		[-6.27228132, -0.00078719, 0.00048248, 0.00079124, -0.00000113, 0.00000000],
+		[-6.27228181, -0.00078699, 0.00048236, 0.00079104, -0.00000113, 0.00000000],
+		[-6.27228231, -0.00078679, 0.00048224, 0.00079083, -0.00000113, 0.00000000],
+		[-6.27228280, -0.00078659, 0.00048211, 0.00079063, -0.00000113, 0.00000000],
+		[-6.27228329, -0.00078639, 0.00048199, 0.00079043, -0.00000113, 0.00000000],
+		[-6.27228378, -0.00078619, 0.00048187, 0.00079023, -0.00000113, 0.00000000],
+		[-6.27228427, -0.00078599, 0.00048175, 0.00079003, -0.00000113, 0.00000000],
+		[-6.27228476, -0.00078579, 0.00048162, 0.00078983, -0.00000113, 0.00000000],
+		[-6.27228526, -0.00078559, 0.00048150, 0.00078963, -0.00000113, 0.00000000],
+		[-6.27228575, -0.00078539, 0.00048138, 0.00078943, -0.00000113, 0.00000000],
+		[-6.27228624, -0.00078519, 0.00048126, 0.00078923, -0.00000113, 0.00000000],
+		[-6.27228673, -0.00078500, 0.00048113, 0.00078903, -0.00000113, 0.00000000],
+		[-6.27228722, -0.00078480, 0.00048101, 0.00078883, -0.00000113, 0.00000000],
+		[-6.27228771, -0.00078460, 0.00048089, 0.00078863, -0.00000113, 0.00000000],
+		[-6.27228819, -0.00078440, 0.00048077, 0.00078843, -0.00000113, 0.00000000],
+		[-6.27228868, -0.00078420, 0.00048065, 0.00078823, -0.00000113, 0.00000000],
+		[-6.27228917, -0.00078400, 0.00048052, 0.00078803, -0.00000113, 0.00000000],
+		[-6.27228966, -0.00078380, 0.00048040, 0.00078783, -0.00000113, 0.00000000],
+		[-6.27229015, -0.00078360, 0.00048028, 0.00078763, -0.00000113, 0.00000000],
+		[-6.27229064, -0.00078341, 0.00048016, 0.00078743, -0.00000113, 0.00000000],
+		[-6.27229112, -0.00078321, 0.00048004, 0.00078723, -0.00000113, 0.00000000],
+		[-6.27229161, -0.00078301, 0.00047992, 0.00078703, -0.00000113, 0.00000000],
+		[-6.27229210, -0.00078281, 0.00047979, 0.00078683, -0.00000113, 0.00000000],
+		[-6.27229258, -0.00078261, 0.00047967, 0.00078663, -0.00000113, 0.00000000],
+		[-6.27229307, -0.00078242, 0.00047955, 0.00078644, -0.00000113, 0.00000000],
+		[-6.27229356, -0.00078222, 0.00047943, 0.00078624, -0.00000113, 0.00000000],
+		[-6.27229404, -0.00078202, 0.00047931, 0.00078604, -0.00000113, 0.00000000],
+		[-6.27229453, -0.00078182, 0.00047919, 0.00078584, -0.00000113, 0.00000000],
+		[-6.27229501, -0.00078163, 0.00047907, 0.00078564, -0.00000113, 0.00000000],
+		[-6.27229550, -0.00078143, 0.00047895, 0.00078544, -0.00000113, 0.00000000],
+		[-6.27229598, -0.00078123, 0.00047882, 0.00078524, -0.00000113, 0.00000000],
+		[-6.27229646, -0.00078103, 0.00047870, 0.00078505, -0.00000113, 0.00000000],
+		[-6.27229695, -0.00078084, 0.00047858, 0.00078485, -0.00000113, 0.00000000],
+		[-6.27229743, -0.00078064, 0.00047846, 0.00078465, -0.00000113, 0.00000000],
+		[-6.27229791, -0.00078044, 0.00047834, 0.00078445, -0.00000113, 0.00000000],
+		[-6.27229840, -0.00078025, 0.00047822, 0.00078426, -0.00000113, 0.00000000],
+		[-6.27229888, -0.00078005, 0.00047810, 0.00078406, -0.00000113, 0.00000000],
+		[-6.27229936, -0.00077985, 0.00047798, 0.00078386, -0.00000113, 0.00000000],
+		[-6.27229984, -0.00077966, 0.00047786, 0.00078366, -0.00000113, 0.00000000],
+		[-6.27230033, -0.00077946, 0.00047774, 0.00078346, -0.00000113, 0.00000000],
+		[-6.27230081, -0.00077926, 0.00047762, 0.00078327, -0.00000113, 0.00000000],
+		[-6.27230129, -0.00077907, 0.00047750, 0.00078307, -0.00000113, 0.00000000],
+		[-6.27230177, -0.00077887, 0.00047738, 0.00078287, -0.00000113, 0.00000000],
+		[-6.27230225, -0.00077868, 0.00047726, 0.00078268, -0.00000113, 0.00000000],
+		[-6.27230273, -0.00077848, 0.00047714, 0.00078248, -0.00000113, 0.00000000],
+		[-6.27230321, -0.00077828, 0.00047702, 0.00078228, -0.00000113, 0.00000000],
+		[-6.27230369, -0.00077809, 0.00047690, 0.00078209, -0.00000113, 0.00000000],
+		[-6.27230417, -0.00077789, 0.00047678, 0.00078189, -0.00000113, 0.00000000],
+		[-6.27230465, -0.00077770, 0.00047666, 0.00078169, -0.00000113, 0.00000000],
+		[-6.27230513, -0.00077750, 0.00047654, 0.00078150, -0.00000113, 0.00000000],
+		[-6.27230561, -0.00077731, 0.00047642, 0.00078130, -0.00000113, 0.00000000],
+		[-6.27230609, -0.00077711, 0.00047630, 0.00078110, -0.00000113, 0.00000000],
+		[-6.27230656, -0.00077692, 0.00047618, 0.00078091, -0.00000113, 0.00000000],
+		[-6.27230704, -0.00077672, 0.00047606, 0.00078071, -0.00000113, 0.00000000],
+		[-6.27230752, -0.00077653, 0.00047594, 0.00078052, -0.00000113, 0.00000000],
+		[-6.27230800, -0.00077633, 0.00047582, 0.00078032, -0.00000113, 0.00000000],
+		[-6.27230847, -0.00077614, 0.00047570, 0.00078012, -0.00000113, 0.00000000],
+		[-6.27230895, -0.00077594, 0.00047558, 0.00077993, -0.00000113, 0.00000000],
+		[-6.27230943, -0.00077575, 0.00047546, 0.00077973, -0.00000113, 0.00000000],
+		[-6.27230990, -0.00077556, 0.00047534, 0.00077954, -0.00000113, 0.00000000],
+		[-6.27231038, -0.00077536, 0.00047522, 0.00077934, -0.00000113, 0.00000000],
+		[-6.27231085, -0.00077517, 0.00047510, 0.00077915, -0.00000113, 0.00000000],
+		[-6.27231133, -0.00077497, 0.00047498, 0.00077895, -0.00000113, 0.00000000],
+		[-6.27231180, -0.00077478, 0.00047487, 0.00077876, -0.00000113, 0.00000000],
+		[-6.27231228, -0.00077458, 0.00047475, 0.00077856, -0.00000113, 0.00000000],
+		[-6.27231275, -0.00077439, 0.00047463, 0.00077837, -0.00000113, 0.00000000],
+		[-6.27231323, -0.00077420, 0.00047451, 0.00077817, -0.00000113, 0.00000000],
+		[-6.27231370, -0.00077400, 0.00047439, 0.00077798, -0.00000113, 0.00000000],
+		[-6.27231417, -0.00077381, 0.00047427, 0.00077778, -0.00000113, 0.00000000],
+		[-6.27231465, -0.00077362, 0.00047415, 0.00077759, -0.00000113, 0.00000000],
+		[-6.27231512, -0.00077342, 0.00047403, 0.00077740, -0.00000113, 0.00000000],
+		[-6.27231559, -0.00077323, 0.00047392, 0.00077720, -0.00000113, 0.00000000],
+		[-6.27231607, -0.00077304, 0.00047380, 0.00077701, -0.00000113, 0.00000000],
+		[-6.27231654, -0.00077284, 0.00047368, 0.00077681, -0.00000113, 0.00000000],
+		[-6.27231701, -0.00077265, 0.00047356, 0.00077662, -0.00000113, 0.00000000],
+		[-6.27231748, -0.00077246, 0.00047344, 0.00077643, -0.00000113, 0.00000000],
+		[-6.27231795, -0.00077227, 0.00047332, 0.00077623, -0.00000113, 0.00000000],
+		[-6.27231842, -0.00077207, 0.00047321, 0.00077604, -0.00000113, 0.00000000],
+		[-6.27231889, -0.00077188, 0.00047309, 0.00077584, -0.00000113, 0.00000000],
+		[-6.27231936, -0.00077169, 0.00047297, 0.00077565, -0.00000113, 0.00000000],
+		[-6.27231984, -0.00077150, 0.00047285, 0.00077546, -0.00000113, 0.00000000],
+		[-6.27232031, -0.00077130, 0.00047273, 0.00077526, -0.00000113, 0.00000000],
+		[-6.27232077, -0.00077111, 0.00047262, 0.00077507, -0.00000113, 0.00000000],
+		[-6.27232124, -0.00077092, 0.00047250, 0.00077488, -0.00000113, 0.00000000],
+		[-6.27232171, -0.00077073, 0.00047238, 0.00077469, -0.00000113, 0.00000000],
+		[-6.27232218, -0.00077054, 0.00047226, 0.00077449, -0.00000113, 0.00000000],
+		[-6.27232265, -0.00077034, 0.00047215, 0.00077430, -0.00000113, 0.00000000],
+		[-6.27232312, -0.00077015, 0.00047203, 0.00077411, -0.00000113, 0.00000000],
+		[-6.27232359, -0.00076996, 0.00047191, 0.00077391, -0.00000113, 0.00000000],
+		[-6.27232406, -0.00076977, 0.00047179, 0.00077372, -0.00000113, 0.00000000],
+		[-6.27232452, -0.00076958, 0.00047168, 0.00077353, -0.00000113, 0.00000000],
+		[-6.27232499, -0.00076939, 0.00047156, 0.00077334, -0.00000113, 0.00000000],
+		[-6.27232546, -0.00076920, 0.00047144, 0.00077315, -0.00000113, 0.00000000],
+		[-6.27232592, -0.00076900, 0.00047132, 0.00077295, -0.00000113, 0.00000000],
+		[-6.27232639, -0.00076881, 0.00047121, 0.00077276, -0.00000113, 0.00000000],
+		[-6.27232686, -0.00076862, 0.00047109, 0.00077257, -0.00000113, 0.00000000],
+		[-6.27232732, -0.00076843, 0.00047097, 0.00077238, -0.00000113, 0.00000000],
+		[-6.27232779, -0.00076824, 0.00047086, 0.00077219, -0.00000113, 0.00000000],
+		[-6.27232825, -0.00076805, 0.00047074, 0.00077199, -0.00000113, 0.00000000],
+		[-6.27232872, -0.00076786, 0.00047062, 0.00077180, -0.00000113, 0.00000000],
+		[-6.27232918, -0.00076767, 0.00047050, 0.00077161, -0.00000113, 0.00000000],
+		[-6.27232965, -0.00076748, 0.00047039, 0.00077142, -0.00000113, 0.00000000],
+		[-6.27233011, -0.00076729, 0.00047027, 0.00077123, -0.00000113, 0.00000000],
+		[-6.27233058, -0.00076710, 0.00047015, 0.00077104, -0.00000113, 0.00000000],
+		[-6.27233104, -0.00076691, 0.00047004, 0.00077085, -0.00000113, 0.00000000],
+		[-6.27233150, -0.00076672, 0.00046992, 0.00077066, -0.00000113, 0.00000000],
+		[-6.27233197, -0.00076653, 0.00046981, 0.00077046, -0.00000113, 0.00000000],
+		[-6.27233243, -0.00076634, 0.00046969, 0.00077027, -0.00000113, 0.00000000],
+		[-6.27233289, -0.00076615, 0.00046957, 0.00077008, -0.00000113, 0.00000000],
+		[-6.27233336, -0.00076596, 0.00046946, 0.00076989, -0.00000113, 0.00000000],
+		[-6.27233382, -0.00076577, 0.00046934, 0.00076970, -0.00000113, 0.00000000],
+		[-6.27233428, -0.00076558, 0.00046922, 0.00076951, -0.00000113, 0.00000000],
+		[-6.27233474, -0.00076539, 0.00046911, 0.00076932, -0.00000113, 0.00000000],
+		[-6.27233520, -0.00076520, 0.00046899, 0.00076913, -0.00000113, 0.00000000],
+		[-6.27233566, -0.00076501, 0.00046888, 0.00076894, -0.00000113, 0.00000000],
+		[-6.27233612, -0.00076482, 0.00046876, 0.00076875, -0.00000113, 0.00000000],
+		[-6.27233658, -0.00076464, 0.00046864, 0.00076856, -0.00000113, 0.00000000],
+		[-6.27233705, -0.00076445, 0.00046853, 0.00076837, -0.00000113, 0.00000000],
+		[-6.27233751, -0.00076426, 0.00046841, 0.00076818, -0.00000113, 0.00000000],
+		[-6.27233797, -0.00076407, 0.00046830, 0.00076799, -0.00000113, 0.00000000],
+		[-6.27233843, -0.00076388, 0.00046818, 0.00076780, -0.00000113, 0.00000000],
+		[-6.27233888, -0.00076369, 0.00046806, 0.00076761, -0.00000113, 0.00000000],
+		[-6.27233934, -0.00076350, 0.00046795, 0.00076742, -0.00000113, 0.00000000],
+		[-6.27233980, -0.00076332, 0.00046783, 0.00076723, -0.00000113, 0.00000000],
+		[-6.27234026, -0.00076313, 0.00046772, 0.00076704, -0.00000113, 0.00000000],
+		[-6.27234072, -0.00076294, 0.00046760, 0.00076686, -0.00000113, 0.00000000],
+		[-6.27234118, -0.00076275, 0.00046749, 0.00076667, -0.00000113, 0.00000000],
+		[-6.27234163, -0.00076256, 0.00046737, 0.00076648, -0.00000113, 0.00000000],
+		[-6.27234209, -0.00076238, 0.00046726, 0.00076629, -0.00000113, 0.00000000],
+		[-6.27234255, -0.00076219, 0.00046714, 0.00076610, -0.00000113, 0.00000000],
+		[-6.27234301, -0.00076200, 0.00046703, 0.00076591, -0.00000113, 0.00000000],
+		[-6.27234346, -0.00076181, 0.00046691, 0.00076572, -0.00000113, 0.00000000],
+		[-6.27234392, -0.00076163, 0.00046680, 0.00076553, -0.00000113, 0.00000000],
+		[-6.27234438, -0.00076144, 0.00046668, 0.00076535, -0.00000113, 0.00000000],
+		[-6.27234483, -0.00076125, 0.00046657, 0.00076516, -0.00000113, 0.00000000],
+		[-6.27234529, -0.00076106, 0.00046645, 0.00076497, -0.00000113, 0.00000000],
+		[-6.27234574, -0.00076088, 0.00046634, 0.00076478, -0.00000113, 0.00000000],
+		[-6.27234620, -0.00076069, 0.00046622, 0.00076459, -0.00000113, 0.00000000],
+		[-6.27234665, -0.00076050, 0.00046611, 0.00076441, -0.00000113, 0.00000000],
+		[-6.27234711, -0.00076032, 0.00046599, 0.00076422, -0.00000113, 0.00000000],
+		[-6.27234756, -0.00076013, 0.00046588, 0.00076403, -0.00000113, 0.00000000],
+		[-6.27234802, -0.00075994, 0.00046576, 0.00076384, -0.00000113, 0.00000000],
+		[-6.27234847, -0.00075976, 0.00046565, 0.00076366, -0.00000113, 0.00000000],
+		[-6.27234892, -0.00075957, 0.00046554, 0.00076347, -0.00000113, 0.00000000],
+		[-6.27234938, -0.00075938, 0.00046542, 0.00076328, -0.00000113, 0.00000000],
+		[-6.27234983, -0.00075920, 0.00046531, 0.00076309, -0.00000113, 0.00000000],
+		[-6.27235028, -0.00075901, 0.00046519, 0.00076291, -0.00000113, 0.00000000],
+		[-6.27235074, -0.00075882, 0.00046508, 0.00076272, -0.00000113, 0.00000000],
+		[-6.27235119, -0.00075864, 0.00046496, 0.00076253, -0.00000113, 0.00000000],
+		[-6.27235164, -0.00075845, 0.00046485, 0.00076235, -0.00000113, 0.00000000],
+		[-6.27235209, -0.00075827, 0.00046474, 0.00076216, -0.00000113, 0.00000000],
+		[-6.27235255, -0.00075808, 0.00046462, 0.00076197, -0.00000113, 0.00000000],
+		[-6.27235300, -0.00075790, 0.00046451, 0.00076179, -0.00000113, 0.00000000],
+		[-6.27235345, -0.00075771, 0.00046440, 0.00076160, -0.00000113, 0.00000000],
+		[-6.27235390, -0.00075753, 0.00046428, 0.00076141, -0.00000113, 0.00000000],
+		[-6.27235435, -0.00075734, 0.00046417, 0.00076123, -0.00000113, 0.00000000],
+		[-6.27235480, -0.00075715, 0.00046405, 0.00076104, -0.00000113, 0.00000000],
+		[-6.27235525, -0.00075697, 0.00046394, 0.00076085, -0.00000113, 0.00000000],
+		[-6.27235570, -0.00075678, 0.00046383, 0.00076067, -0.00000113, 0.00000000],
+		[-6.27235615, -0.00075660, 0.00046371, 0.00076048, -0.00000113, 0.00000000],
+		[-6.27235660, -0.00075641, 0.00046360, 0.00076030, -0.00000113, 0.00000000],
+		[-6.27235705, -0.00075623, 0.00046349, 0.00076011, -0.00000113, 0.00000000],
+		[-6.27235750, -0.00075605, 0.00046337, 0.00075992, -0.00000113, 0.00000000],
+		[-6.27235795, -0.00075586, 0.00046326, 0.00075974, -0.00000113, 0.00000000],
+		[-6.27235840, -0.00075568, 0.00046315, 0.00075955, -0.00000113, 0.00000000],
+		[-6.27235884, -0.00075549, 0.00046303, 0.00075937, -0.00000113, 0.00000000],
+		[-6.27235929, -0.00075531, 0.00046292, 0.00075918, -0.00000113, 0.00000000],
+		[-6.27235974, -0.00075512, 0.00046281, 0.00075900, -0.00000113, 0.00000000],
+		[-6.27236019, -0.00075494, 0.00046269, 0.00075881, -0.00000113, 0.00000000],
+		[-6.27236063, -0.00075475, 0.00046258, 0.00075863, -0.00000113, 0.00000000],
+		[-6.27236108, -0.00075457, 0.00046247, 0.00075844, -0.00000113, 0.00000000],
+		[-6.27236153, -0.00075439, 0.00046236, 0.00075826, -0.00000113, 0.00000000],
+		[-6.27236197, -0.00075420, 0.00046224, 0.00075807, -0.00000113, 0.00000000],
+		[-6.27236242, -0.00075402, 0.00046213, 0.00075789, -0.00000113, 0.00000000],
+		[-6.27236287, -0.00075384, 0.00046202, 0.00075770, -0.00000113, 0.00000000],
+		[-6.27236331, -0.00075365, 0.00046191, 0.00075752, -0.00000113, 0.00000000],
+		[-6.27236376, -0.00075347, 0.00046179, 0.00075733, -0.00000113, 0.00000000],
+		[-6.27236420, -0.00075329, 0.00046168, 0.00075715, -0.00000113, 0.00000000],
+		[-6.27236465, -0.00075310, 0.00046157, 0.00075697, -0.00000113, 0.00000000],
+		[-6.27236509, -0.00075292, 0.00046146, 0.00075678, -0.00000113, 0.00000000],
+		[-6.27236554, -0.00075274, 0.00046134, 0.00075660, -0.00000113, 0.00000000],
+		[-6.27236598, -0.00075255, 0.00046123, 0.00075641, -0.00000113, 0.00000000],
+		[-6.27236643, -0.00075237, 0.00046112, 0.00075623, -0.00000113, 0.00000000],
+		[-6.27236687, -0.00075219, 0.00046101, 0.00075605, -0.00000113, 0.00000000],
+		[-6.27236731, -0.00075200, 0.00046089, 0.00075586, -0.00000113, 0.00000000],
+		[-6.27236776, -0.00075182, 0.00046078, 0.00075568, -0.00000113, 0.00000000],
+		[-6.27236820, -0.00075164, 0.00046067, 0.00075550, -0.00000113, 0.00000000],
+		[-6.27236864, -0.00075146, 0.00046056, 0.00075531, -0.00000113, 0.00000000],
+		[-6.27236909, -0.00075127, 0.00046045, 0.00075513, -0.00000113, 0.00000000],
+		[-6.27236953, -0.00075109, 0.00046034, 0.00075495, -0.00000113, 0.00000000],
+		[-6.27236997, -0.00075091, 0.00046022, 0.00075476, -0.00000113, 0.00000000],
+		[-6.27237041, -0.00075073, 0.00046011, 0.00075458, -0.00000113, 0.00000000],
+		[-6.27237085, -0.00075055, 0.00046000, 0.00075440, -0.00000113, 0.00000000],
+		[-6.27237130, -0.00075036, 0.00045989, 0.00075421, -0.00000113, 0.00000000],
+		[-6.27237174, -0.00075018, 0.00045978, 0.00075403, -0.00000113, 0.00000000],
+		[-6.27237218, -0.00075000, 0.00045967, 0.00075385, -0.00000113, 0.00000000],
+		[-6.27237262, -0.00074982, 0.00045955, 0.00075366, -0.00000113, 0.00000000],
+		[-6.27237306, -0.00074964, 0.00045944, 0.00075348, -0.00000113, 0.00000000],
+		[-6.27237350, -0.00074946, 0.00045933, 0.00075330, -0.00000113, 0.00000000],
+		[-6.27237394, -0.00074927, 0.00045922, 0.00075312, -0.00000113, 0.00000000],
+		[-6.27237438, -0.00074909, 0.00045911, 0.00075294, -0.00000113, 0.00000000],
+		[-6.27237482, -0.00074891, 0.00045900, 0.00075275, -0.00000113, 0.00000000],
+		[-6.27237526, -0.00074873, 0.00045889, 0.00075257, -0.00000113, 0.00000000],
+		[-6.27237570, -0.00074855, 0.00045878, 0.00075239, -0.00000113, 0.00000000],
+		[-6.27237614, -0.00074837, 0.00045866, 0.00075221, -0.00000113, 0.00000000],
+		[-6.27237657, -0.00074819, 0.00045855, 0.00075203, -0.00000113, 0.00000000],
+		[-6.27237701, -0.00074801, 0.00045844, 0.00075184, -0.00000113, 0.00000000],
+		[-6.27237745, -0.00074783, 0.00045833, 0.00075166, -0.00000113, 0.00000000],
+		[-6.27237789, -0.00074765, 0.00045822, 0.00075148, -0.00000113, 0.00000000],
+		[-6.27237833, -0.00074747, 0.00045811, 0.00075130, -0.00000113, 0.00000000],
+		[-6.27237876, -0.00074728, 0.00045800, 0.00075112, -0.00000113, 0.00000000],
+		[-6.27237920, -0.00074710, 0.00045789, 0.00075094, -0.00000113, 0.00000000],
+		[-6.27237964, -0.00074692, 0.00045778, 0.00075075, -0.00000113, 0.00000000],
+		[-6.27238007, -0.00074674, 0.00045767, 0.00075057, -0.00000113, 0.00000000],
+		[-6.27238051, -0.00074656, 0.00045756, 0.00075039, -0.00000113, 0.00000000],
+		[-6.27238095, -0.00074638, 0.00045745, 0.00075021, -0.00000113, 0.00000000],
+		[-6.27238138, -0.00074620, 0.00045734, 0.00075003, -0.00000113, 0.00000000],
+		[-6.27238182, -0.00074602, 0.00045723, 0.00074985, -0.00000113, 0.00000000],
+		[-6.27238225, -0.00074584, 0.00045712, 0.00074967, -0.00000113, 0.00000000],
+		[-6.27238269, -0.00074566, 0.00045701, 0.00074949, -0.00000113, 0.00000000],
+		[-6.27238312, -0.00074548, 0.00045690, 0.00074931, -0.00000113, 0.00000000],
+		[-6.27238356, -0.00074531, 0.00045679, 0.00074913, -0.00000113, 0.00000000],
+		[-6.27238399, -0.00074513, 0.00045668, 0.00074895, -0.00000113, 0.00000000],
+		[-6.27238443, -0.00074495, 0.00045657, 0.00074877, -0.00000113, 0.00000000],
+		[-6.27238486, -0.00074477, 0.00045646, 0.00074859, -0.00000113, 0.00000000],
+		[-6.27238530, -0.00074459, 0.00045635, 0.00074841, -0.00000113, 0.00000000],
+		[-6.27238573, -0.00074441, 0.00045624, 0.00074823, -0.00000113, 0.00000000],
+		[-6.27238616, -0.00074423, 0.00045613, 0.00074805, -0.00000113, 0.00000000],
+		[-6.27238660, -0.00074405, 0.00045602, 0.00074787, -0.00000113, 0.00000000],
+		[-6.27238703, -0.00074387, 0.00045591, 0.00074769, -0.00000113, 0.00000000],
+		[-6.27238746, -0.00074369, 0.00045580, 0.00074751, -0.00000113, 0.00000000],
+		[-6.27238790, -0.00074352, 0.00045569, 0.00074733, -0.00000113, 0.00000000],
+		[-6.27238833, -0.00074334, 0.00045558, 0.00074715, -0.00000113, 0.00000000],
+		[-6.27238876, -0.00074316, 0.00045547, 0.00074697, -0.00000113, 0.00000000],
+		[-6.27238919, -0.00074298, 0.00045536, 0.00074679, -0.00000113, 0.00000000],
+		[-6.27238962, -0.00074280, 0.00045525, 0.00074661, -0.00000113, 0.00000000],
+		[-6.27239006, -0.00074262, 0.00045514, 0.00074643, -0.00000113, 0.00000000],
+		[-6.27239049, -0.00074245, 0.00045503, 0.00074625, -0.00000113, 0.00000000],
+		[-6.27239092, -0.00074227, 0.00045492, 0.00074607, -0.00000113, 0.00000000],
+		[-6.27239135, -0.00074209, 0.00045481, 0.00074589, -0.00000113, 0.00000000],
+		[-6.27239178, -0.00074191, 0.00045470, 0.00074572, -0.00000113, 0.00000000],
+		[-6.27239221, -0.00074173, 0.00045459, 0.00074554, -0.00000113, 0.00000000],
+		[-6.27239264, -0.00074156, 0.00045449, 0.00074536, -0.00000113, 0.00000000],
+		[-6.27239307, -0.00074138, 0.00045438, 0.00074518, -0.00000113, 0.00000000],
+		[-6.27239350, -0.00074120, 0.00045427, 0.00074500, -0.00000113, 0.00000000],
+		[-6.27239393, -0.00074102, 0.00045416, 0.00074482, -0.00000113, 0.00000000],
+		[-6.27239436, -0.00074085, 0.00045405, 0.00074464, -0.00000113, 0.00000000],
+		[-6.27239479, -0.00074067, 0.00045394, 0.00074447, -0.00000113, 0.00000000],
+		[-6.27239522, -0.00074049, 0.00045383, 0.00074429, -0.00000113, 0.00000000],
+		[-6.27239564, -0.00074031, 0.00045372, 0.00074411, -0.00000113, 0.00000000],
+		[-6.27239607, -0.00074014, 0.00045362, 0.00074393, -0.00000113, 0.00000000],
+		[-6.27239650, -0.00073996, 0.00045351, 0.00074375, -0.00000113, 0.00000000],
+		[-6.27239693, -0.00073978, 0.00045340, 0.00074358, -0.00000112, 0.00000000],
+		[-6.27239736, -0.00073961, 0.00045329, 0.00074340, -0.00000112, 0.00000000],
+		[-6.27239778, -0.00073943, 0.00045318, 0.00074322, -0.00000112, 0.00000000],
+		[-6.27239821, -0.00073925, 0.00045307, 0.00074304, -0.00000112, 0.00000000],
+		[-6.27239864, -0.00073908, 0.00045296, 0.00074287, -0.00000112, 0.00000000],
+		[-6.27239906, -0.00073890, 0.00045286, 0.00074269, -0.00000112, 0.00000000],
+		[-6.27239949, -0.00073872, 0.00045275, 0.00074251, -0.00000112, 0.00000000],
+		[-6.27239992, -0.00073855, 0.00045264, 0.00074233, -0.00000112, 0.00000000],
+		[-6.27240034, -0.00073837, 0.00045253, 0.00074216, -0.00000112, 0.00000000],
+		[-6.27240077, -0.00073820, 0.00045242, 0.00074198, -0.00000112, 0.00000000],
+		[-6.27240119, -0.00073802, 0.00045232, 0.00074180, -0.00000112, 0.00000000],
+		[-6.27240162, -0.00073784, 0.00045221, 0.00074163, -0.00000112, 0.00000000],
+		[-6.27240205, -0.00073767, 0.00045210, 0.00074145, -0.00000112, 0.00000000],
+		[-6.27240247, -0.00073749, 0.00045199, 0.00074127, -0.00000112, 0.00000000],
+		[-6.27240289, -0.00073732, 0.00045188, 0.00074110, -0.00000112, 0.00000000],
+		[-6.27240332, -0.00073714, 0.00045178, 0.00074092, -0.00000112, 0.00000000],
+		[-6.27240374, -0.00073697, 0.00045167, 0.00074074, -0.00000112, 0.00000000],
+		[-6.27240417, -0.00073679, 0.00045156, 0.00074057, -0.00000112, 0.00000000],
+		[-6.27240459, -0.00073662, 0.00045145, 0.00074039, -0.00000112, 0.00000000],
+		[-6.27240502, -0.00073644, 0.00045135, 0.00074022, -0.00000112, 0.00000000],
+		[-6.27240544, -0.00073626, 0.00045124, 0.00074004, -0.00000112, 0.00000000],
+		[-6.27240586, -0.00073609, 0.00045113, 0.00073986, -0.00000112, 0.00000000],
+		[-6.27240628, -0.00073591, 0.00045102, 0.00073969, -0.00000112, 0.00000000],
+		[-6.27240671, -0.00073574, 0.00045092, 0.00073951, -0.00000112, 0.00000000],
+		[-6.27240713, -0.00073556, 0.00045081, 0.00073934, -0.00000112, 0.00000000],
+		[-6.27240755, -0.00073539, 0.00045070, 0.00073916, -0.00000112, 0.00000000],
+		[-6.27240797, -0.00073522, 0.00045060, 0.00073898, -0.00000112, 0.00000000],
+		[-6.27240840, -0.00073504, 0.00045049, 0.00073881, -0.00000112, 0.00000000],
+		[-6.27240882, -0.00073487, 0.00045038, 0.00073863, -0.00000112, 0.00000000],
+		[-6.27240924, -0.00073469, 0.00045027, 0.00073846, -0.00000112, 0.00000000],
+		[-6.27240966, -0.00073452, 0.00045017, 0.00073828, -0.00000112, 0.00000000],
+		[-6.27241008, -0.00073434, 0.00045006, 0.00073811, -0.00000112, 0.00000000],
+		[-6.27241050, -0.00073417, 0.00044995, 0.00073793, -0.00000112, 0.00000000],
+		[-6.27241092, -0.00073400, 0.00044985, 0.00073776, -0.00000112, 0.00000000],
+		[-6.27241134, -0.00073382, 0.00044974, 0.00073758, -0.00000112, 0.00000000],
+		[-6.27241176, -0.00073365, 0.00044963, 0.00073741, -0.00000112, 0.00000000],
+		[-6.27241218, -0.00073347, 0.00044953, 0.00073723, -0.00000112, 0.00000000],
+		[-6.27241260, -0.00073330, 0.00044942, 0.00073706, -0.00000112, 0.00000000],
+		[-6.27241302, -0.00073313, 0.00044931, 0.00073688, -0.00000112, 0.00000000],
+		[-6.27241344, -0.00073295, 0.00044921, 0.00073671, -0.00000112, 0.00000000],
+		[-6.27241386, -0.00073278, 0.00044910, 0.00073653, -0.00000112, 0.00000000],
+		[-6.27241428, -0.00073261, 0.00044899, 0.00073636, -0.00000112, 0.00000000],
+		[-6.27241470, -0.00073243, 0.00044889, 0.00073619, -0.00000112, 0.00000000],
+		[-6.27241512, -0.00073226, 0.00044878, 0.00073601, -0.00000112, 0.00000000],
+		[-6.27241554, -0.00073209, 0.00044868, 0.00073584, -0.00000112, 0.00000000],
+		[-6.27241595, -0.00073191, 0.00044857, 0.00073566, -0.00000112, 0.00000000],
+		[-6.27241637, -0.00073174, 0.00044846, 0.00073549, -0.00000112, 0.00000000],
+		[-6.27241679, -0.00073157, 0.00044836, 0.00073532, -0.00000112, 0.00000000],
+		[-6.27241721, -0.00073139, 0.00044825, 0.00073514, -0.00000112, 0.00000000],
+		[-6.27241762, -0.00073122, 0.00044815, 0.00073497, -0.00000112, 0.00000000],
+		[-6.27241804, -0.00073105, 0.00044804, 0.00073479, -0.00000112, 0.00000000],
+		[-6.27241846, -0.00073088, 0.00044793, 0.00073462, -0.00000112, 0.00000000],
+		[-6.27241887, -0.00073070, 0.00044783, 0.00073445, -0.00000112, 0.00000000],
+		[-6.27241929, -0.00073053, 0.00044772, 0.00073427, -0.00000112, 0.00000000],
+		[-6.27241971, -0.00073036, 0.00044762, 0.00073410, -0.00000112, 0.00000000],
+		[-6.27242012, -0.00073019, 0.00044751, 0.00073393, -0.00000112, 0.00000000],
+		[-6.27242054, -0.00073001, 0.00044741, 0.00073376, -0.00000112, 0.00000000],
+		[-6.27242095, -0.00072984, 0.00044730, 0.00073358, -0.00000112, 0.00000000],
+		[-6.27242137, -0.00072967, 0.00044719, 0.00073341, -0.00000112, 0.00000000],
+		[-6.27242178, -0.00072950, 0.00044709, 0.00073324, -0.00000112, 0.00000000],
+		[-6.27242220, -0.00072933, 0.00044698, 0.00073306, -0.00000112, 0.00000000],
+		[-6.27242261, -0.00072915, 0.00044688, 0.00073289, -0.00000112, 0.00000000],
+		[-6.27242303, -0.00072898, 0.00044677, 0.00073272, -0.00000112, 0.00000000],
+		[-6.27242344, -0.00072881, 0.00044667, 0.00073255, -0.00000112, 0.00000000],
+		[-6.27242386, -0.00072864, 0.00044656, 0.00073237, -0.00000112, 0.00000000],
+		[-6.27242427, -0.00072847, 0.00044646, 0.00073220, -0.00000112, 0.00000000],
+		[-6.27242468, -0.00072830, 0.00044635, 0.00073203, -0.00000112, 0.00000000],
+		[-6.27242510, -0.00072813, 0.00044625, 0.00073186, -0.00000112, 0.00000000],
+		[-6.27242551, -0.00072795, 0.00044614, 0.00073168, -0.00000112, 0.00000000],
+		[-6.27242592, -0.00072778, 0.00044604, 0.00073151, -0.00000112, 0.00000000],
+		[-6.27242634, -0.00072761, 0.00044593, 0.00073134, -0.00000112, 0.00000000],
+		[-6.27242675, -0.00072744, 0.00044583, 0.00073117, -0.00000112, 0.00000000],
+		[-6.27242716, -0.00072727, 0.00044572, 0.00073100, -0.00000112, 0.00000000],
+		[-6.27242757, -0.00072710, 0.00044562, 0.00073082, -0.00000112, 0.00000000],
+		[-6.27242798, -0.00072693, 0.00044551, 0.00073065, -0.00000112, 0.00000000],
+		[-6.27242840, -0.00072676, 0.00044541, 0.00073048, -0.00000112, 0.00000000],
+		[-6.27242881, -0.00072659, 0.00044530, 0.00073031, -0.00000112, 0.00000000],
+		[-6.27242922, -0.00072642, 0.00044520, 0.00073014, -0.00000112, 0.00000000],
+		[-6.27242963, -0.00072625, 0.00044509, 0.00072997, -0.00000112, 0.00000000],
+		[-6.27243004, -0.00072608, 0.00044499, 0.00072980, -0.00000112, 0.00000000],
+		[-6.27243045, -0.00072591, 0.00044488, 0.00072962, -0.00000112, 0.00000000],
+		[-6.27243086, -0.00072574, 0.00044478, 0.00072945, -0.00000112, 0.00000000],
+		[-6.27243127, -0.00072557, 0.00044468, 0.00072928, -0.00000112, 0.00000000],
+		[-6.27243168, -0.00072540, 0.00044457, 0.00072911, -0.00000112, 0.00000000],
+		[-6.27243209, -0.00072523, 0.00044447, 0.00072894, -0.00000112, 0.00000000],
+		[-6.27243250, -0.00072506, 0.00044436, 0.00072877, -0.00000112, 0.00000000],
+		[-6.27243291, -0.00072489, 0.00044426, 0.00072860, -0.00000112, 0.00000000],
+		[-6.27243332, -0.00072472, 0.00044416, 0.00072843, -0.00000112, 0.00000000],
+		[-6.27243373, -0.00072455, 0.00044405, 0.00072826, -0.00000112, 0.00000000],
+		[-6.27243414, -0.00072438, 0.00044395, 0.00072809, -0.00000112, 0.00000000],
+		[-6.27243455, -0.00072421, 0.00044384, 0.00072792, -0.00000112, 0.00000000],
+		[-6.27243496, -0.00072404, 0.00044374, 0.00072775, -0.00000112, 0.00000000],
+		[-6.27243536, -0.00072387, 0.00044364, 0.00072758, -0.00000112, 0.00000000],
+		[-6.27243577, -0.00072370, 0.00044353, 0.00072741, -0.00000112, 0.00000000],
+		[-6.27243618, -0.00072353, 0.00044343, 0.00072724, -0.00000112, 0.00000000],
+		[-6.27243659, -0.00072336, 0.00044332, 0.00072707, -0.00000112, 0.00000000],
+		[-6.27243700, -0.00072319, 0.00044322, 0.00072690, -0.00000112, 0.00000000],
+		[-6.27243740, -0.00072302, 0.00044312, 0.00072673, -0.00000112, 0.00000000],
+		[-6.27243781, -0.00072285, 0.00044301, 0.00072656, -0.00000112, 0.00000000],
+		[-6.27243822, -0.00072269, 0.00044291, 0.00072639, -0.00000112, 0.00000000],
+		[-6.27243862, -0.00072252, 0.00044281, 0.00072622, -0.00000112, 0.00000000],
+		[-6.27243903, -0.00072235, 0.00044270, 0.00072605, -0.00000112, 0.00000000],
+		[-6.27243944, -0.00072218, 0.00044260, 0.00072588, -0.00000112, 0.00000000],
+		[-6.27243984, -0.00072201, 0.00044250, 0.00072571, -0.00000112, 0.00000000],
+		[-6.27244025, -0.00072184, 0.00044239, 0.00072554, -0.00000112, 0.00000000],
+		[-6.27244065, -0.00072167, 0.00044229, 0.00072537, -0.00000112, 0.00000000],
+		[-6.27244106, -0.00072151, 0.00044219, 0.00072520, -0.00000112, 0.00000000],
+		[-6.27244146, -0.00072134, 0.00044208, 0.00072503, -0.00000112, 0.00000000],
+		[-6.27244187, -0.00072117, 0.00044198, 0.00072486, -0.00000112, 0.00000000],
+		[-6.27244227, -0.00072100, 0.00044188, 0.00072470, -0.00000112, 0.00000000],
+		[-6.27244268, -0.00072083, 0.00044177, 0.00072453, -0.00000112, 0.00000000],
+		[-6.27244308, -0.00072067, 0.00044167, 0.00072436, -0.00000112, 0.00000000],
+		[-6.27244349, -0.00072050, 0.00044157, 0.00072419, -0.00000112, 0.00000000],
+		[-6.27244389, -0.00072033, 0.00044147, 0.00072402, -0.00000112, 0.00000000],
+		[-6.27244429, -0.00072016, 0.00044136, 0.00072385, -0.00000112, 0.00000000],
+		[-6.27244470, -0.00072000, 0.00044126, 0.00072368, -0.00000112, 0.00000000],
+		[-6.27244510, -0.00071983, 0.00044116, 0.00072352, -0.00000112, 0.00000000],
+		[-6.27244550, -0.00071966, 0.00044105, 0.00072335, -0.00000112, 0.00000000],
+		[-6.27244591, -0.00071949, 0.00044095, 0.00072318, -0.00000112, 0.00000000],
+		[-6.27244631, -0.00071933, 0.00044085, 0.00072301, -0.00000112, 0.00000000],
+		[-6.27244671, -0.00071916, 0.00044075, 0.00072284, -0.00000112, 0.00000000],
+		[-6.27244712, -0.00071899, 0.00044064, 0.00072268, -0.00000112, 0.00000000],
+		[-6.27244752, -0.00071883, 0.00044054, 0.00072251, -0.00000112, 0.00000000],
+		[-6.27244792, -0.00071866, 0.00044044, 0.00072234, -0.00000112, 0.00000000],
+		[-6.27244832, -0.00071849, 0.00044034, 0.00072217, -0.00000112, 0.00000000],
+		[-6.27244872, -0.00071833, 0.00044024, 0.00072200, -0.00000112, 0.00000000],
+		[-6.27244912, -0.00071816, 0.00044013, 0.00072184, -0.00000112, 0.00000000],
+		[-6.27244953, -0.00071799, 0.00044003, 0.00072167, -0.00000112, 0.00000000],
+		[-6.27244993, -0.00071783, 0.00043993, 0.00072150, -0.00000112, 0.00000000],
+		[-6.27245033, -0.00071766, 0.00043983, 0.00072133, -0.00000112, 0.00000000],
+		[-6.27245073, -0.00071749, 0.00043972, 0.00072117, -0.00000112, 0.00000000],
+		[-6.27245113, -0.00071733, 0.00043962, 0.00072100, -0.00000112, 0.00000000],
+		[-6.27245153, -0.00071716, 0.00043952, 0.00072083, -0.00000112, 0.00000000],
+		[-6.27245193, -0.00071699, 0.00043942, 0.00072067, -0.00000112, 0.00000000],
+		[-6.27245233, -0.00071683, 0.00043932, 0.00072050, -0.00000112, 0.00000000],
+		[-6.27245273, -0.00071666, 0.00043922, 0.00072033, -0.00000112, 0.00000000],
+		[-6.27245313, -0.00071650, 0.00043911, 0.00072017, -0.00000112, 0.00000000],
+		[-6.27245353, -0.00071633, 0.00043901, 0.00072000, -0.00000112, 0.00000000],
+		[-6.27245393, -0.00071617, 0.00043891, 0.00071983, -0.00000112, 0.00000000],
+		[-6.27245432, -0.00071600, 0.00043881, 0.00071967, -0.00000112, 0.00000000],
+		[-6.27245472, -0.00071583, 0.00043871, 0.00071950, -0.00000112, 0.00000000],
+		[-6.27245512, -0.00071567, 0.00043861, 0.00071933, -0.00000112, 0.00000000],
+		[-6.27245552, -0.00071550, 0.00043850, 0.00071917, -0.00000112, 0.00000000],
+		[-6.27245592, -0.00071534, 0.00043840, 0.00071900, -0.00000112, 0.00000000],
+		[-6.27245632, -0.00071517, 0.00043830, 0.00071883, -0.00000112, 0.00000000],
+		[-6.27245671, -0.00071501, 0.00043820, 0.00071867, -0.00000112, 0.00000000],
+		[-6.27245711, -0.00071484, 0.00043810, 0.00071850, -0.00000112, 0.00000000],
+		[-6.27245751, -0.00071468, 0.00043800, 0.00071834, -0.00000112, 0.00000000],
+		[-6.27245791, -0.00071451, 0.00043790, 0.00071817, -0.00000112, 0.00000000],
+		[-6.27245830, -0.00071435, 0.00043779, 0.00071800, -0.00000112, 0.00000000],
+		[-6.27245870, -0.00071418, 0.00043769, 0.00071784, -0.00000112, 0.00000000],
+		[-6.27245910, -0.00071402, 0.00043759, 0.00071767, -0.00000112, 0.00000000],
+		[-6.27245949, -0.00071385, 0.00043749, 0.00071751, -0.00000112, 0.00000000],
+		[-6.27245989, -0.00071369, 0.00043739, 0.00071734, -0.00000112, 0.00000000],
+		[-6.27246028, -0.00071352, 0.00043729, 0.00071718, -0.00000112, 0.00000000],
+		[-6.27246068, -0.00071336, 0.00043719, 0.00071701, -0.00000112, 0.00000000],
+		[-6.27246108, -0.00071320, 0.00043709, 0.00071685, -0.00000112, 0.00000000],
+		[-6.27246147, -0.00071303, 0.00043699, 0.00071668, -0.00000112, 0.00000000],
+		[-6.27246187, -0.00071287, 0.00043689, 0.00071652, -0.00000112, 0.00000000],
+		[-6.27246226, -0.00071270, 0.00043679, 0.00071635, -0.00000112, 0.00000000],
+		[-6.27246266, -0.00071254, 0.00043669, 0.00071619, -0.00000112, 0.00000000],
+		[-6.27246305, -0.00071237, 0.00043658, 0.00071602, -0.00000112, 0.00000000],
+		[-6.27246345, -0.00071221, 0.00043648, 0.00071586, -0.00000112, 0.00000000],
+		[-6.27246384, -0.00071205, 0.00043638, 0.00071569, -0.00000112, 0.00000000],
+		[-6.27246423, -0.00071188, 0.00043628, 0.00071553, -0.00000112, 0.00000000],
+		[-6.27246463, -0.00071172, 0.00043618, 0.00071536, -0.00000112, 0.00000000],
+		[-6.27246502, -0.00071156, 0.00043608, 0.00071520, -0.00000112, 0.00000000],
+		[-6.27246541, -0.00071139, 0.00043598, 0.00071503, -0.00000112, 0.00000000],
+		[-6.27246581, -0.00071123, 0.00043588, 0.00071487, -0.00000112, 0.00000000],
+		[-6.27246620, -0.00071107, 0.00043578, 0.00071471, -0.00000112, 0.00000000],
+		[-6.27246659, -0.00071090, 0.00043568, 0.00071454, -0.00000112, 0.00000000],
+		[-6.27246699, -0.00071074, 0.00043558, 0.00071438, -0.00000112, 0.00000000],
+		[-6.27246738, -0.00071058, 0.00043548, 0.00071421, -0.00000112, 0.00000000],
+		[-6.27246777, -0.00071041, 0.00043538, 0.00071405, -0.00000112, 0.00000000],
+		[-6.27246816, -0.00071025, 0.00043528, 0.00071389, -0.00000112, 0.00000000],
+		[-6.27246856, -0.00071009, 0.00043518, 0.00071372, -0.00000112, 0.00000000],
+		[-6.27246895, -0.00070992, 0.00043508, 0.00071356, -0.00000112, 0.00000000],
+		[-6.27246934, -0.00070976, 0.00043498, 0.00071339, -0.00000112, 0.00000000],
+		[-6.27246973, -0.00070960, 0.00043488, 0.00071323, -0.00000112, 0.00000000],
+		[-6.27247012, -0.00070944, 0.00043478, 0.00071307, -0.00000112, 0.00000000],
+		[-6.27247051, -0.00070927, 0.00043468, 0.00071290, -0.00000112, 0.00000000],
+		[-6.27247090, -0.00070911, 0.00043458, 0.00071274, -0.00000112, 0.00000000],
+		[-6.27247129, -0.00070895, 0.00043448, 0.00071258, -0.00000112, 0.00000000],
+		[-6.27247168, -0.00070879, 0.00043438, 0.00071241, -0.00000112, 0.00000000],
+		[-6.27247207, -0.00070862, 0.00043428, 0.00071225, -0.00000112, 0.00000000],
+		[-6.27247246, -0.00070846, 0.00043418, 0.00071209, -0.00000112, 0.00000000],
+		[-6.27247285, -0.00070830, 0.00043409, 0.00071193, -0.00000112, 0.00000000],
+		[-6.27247324, -0.00070814, 0.00043399, 0.00071176, -0.00000112, 0.00000000],
+		[-6.27247363, -0.00070798, 0.00043389, 0.00071160, -0.00000112, 0.00000000],
+		[-6.27247402, -0.00070781, 0.00043379, 0.00071144, -0.00000112, 0.00000000],
+		[-6.27247441, -0.00070765, 0.00043369, 0.00071127, -0.00000112, 0.00000000],
+		[-6.27247480, -0.00070749, 0.00043359, 0.00071111, -0.00000112, 0.00000000],
+		[-6.27247519, -0.00070733, 0.00043349, 0.00071095, -0.00000112, 0.00000000],
+		[-6.27247558, -0.00070717, 0.00043339, 0.00071079, -0.00000112, 0.00000000],
+		[-6.27247597, -0.00070701, 0.00043329, 0.00071062, -0.00000112, 0.00000000],
+		[-6.27247636, -0.00070684, 0.00043319, 0.00071046, -0.00000112, 0.00000000],
+		[-6.27247674, -0.00070668, 0.00043309, 0.00071030, -0.00000112, 0.00000000],
+		[-6.27247713, -0.00070652, 0.00043299, 0.00071014, -0.00000112, 0.00000000],
+		[-6.27247752, -0.00070636, 0.00043290, 0.00070998, -0.00000112, 0.00000000],
+		[-6.27247791, -0.00070620, 0.00043280, 0.00070981, -0.00000112, 0.00000000],
+		[-6.27247829, -0.00070604, 0.00043270, 0.00070965, -0.00000112, 0.00000000],
+		[-6.27247868, -0.00070588, 0.00043260, 0.00070949, -0.00000112, 0.00000000],
+		[-6.27247907, -0.00070572, 0.00043250, 0.00070933, -0.00000112, 0.00000000],
+		[-6.27247945, -0.00070556, 0.00043240, 0.00070917, -0.00000112, 0.00000000],
+		[-6.27247984, -0.00070539, 0.00043230, 0.00070900, -0.00000112, 0.00000000],
+		[-6.27248023, -0.00070523, 0.00043220, 0.00070884, -0.00000112, 0.00000000],
+		[-6.27248061, -0.00070507, 0.00043211, 0.00070868, -0.00000112, 0.00000000],
+		[-6.27248100, -0.00070491, 0.00043201, 0.00070852, -0.00000112, 0.00000000],
+		[-6.27248139, -0.00070475, 0.00043191, 0.00070836, -0.00000112, 0.00000000],
+		[-6.27248177, -0.00070459, 0.00043181, 0.00070820, -0.00000112, 0.00000000],
+		[-6.27248216, -0.00070443, 0.00043171, 0.00070804, -0.00000112, 0.00000000],
+		[-6.27248254, -0.00070427, 0.00043161, 0.00070788, -0.00000112, 0.00000000],
+		[-6.27248293, -0.00070411, 0.00043152, 0.00070771, -0.00000112, 0.00000000],
+		[-6.27248331, -0.00070395, 0.00043142, 0.00070755, -0.00000112, 0.00000000],
+		[-6.27248370, -0.00070379, 0.00043132, 0.00070739, -0.00000112, 0.00000000],
+		[-6.27248408, -0.00070363, 0.00043122, 0.00070723, -0.00000112, 0.00000000],
+		[-6.27248447, -0.00070347, 0.00043112, 0.00070707, -0.00000112, 0.00000000],
+		[-6.27248485, -0.00070331, 0.00043103, 0.00070691, -0.00000112, 0.00000000],
+		[-6.27248523, -0.00070315, 0.00043093, 0.00070675, -0.00000112, 0.00000000],
+		[-6.27248562, -0.00070299, 0.00043083, 0.00070659, -0.00000112, 0.00000000],
+		[-6.27248600, -0.00070283, 0.00043073, 0.00070643, -0.00000112, 0.00000000],
+		[-6.27248638, -0.00070267, 0.00043063, 0.00070627, -0.00000112, 0.00000000],
+		[-6.27248677, -0.00070251, 0.00043054, 0.00070611, -0.00000112, 0.00000000],
+		[-6.27248715, -0.00070235, 0.00043044, 0.00070595, -0.00000112, 0.00000000],
+		[-6.27248753, -0.00070219, 0.00043034, 0.00070579, -0.00000112, 0.00000000],
+		[-6.27248792, -0.00070203, 0.00043024, 0.00070563, -0.00000112, 0.00000000],
+		[-6.27248830, -0.00070188, 0.00043014, 0.00070547, -0.00000112, 0.00000000],
+		[-6.27248868, -0.00070172, 0.00043005, 0.00070531, -0.00000112, 0.00000000],
+		[-6.27248906, -0.00070156, 0.00042995, 0.00070515, -0.00000112, 0.00000000],
+		[-6.27248945, -0.00070140, 0.00042985, 0.00070499, -0.00000112, 0.00000000],
+		[-6.27248983, -0.00070124, 0.00042975, 0.00070483, -0.00000112, 0.00000000],
+		[-6.27249021, -0.00070108, 0.00042966, 0.00070467, -0.00000112, 0.00000000],
+		[-6.27249059, -0.00070092, 0.00042956, 0.00070451, -0.00000112, 0.00000000],
+		[-6.27249097, -0.00070076, 0.00042946, 0.00070435, -0.00000112, 0.00000000],
+		[-6.27249135, -0.00070060, 0.00042937, 0.00070419, -0.00000112, 0.00000000],
+		[-6.27249173, -0.00070045, 0.00042927, 0.00070403, -0.00000112, 0.00000000],
+		[-6.27249211, -0.00070029, 0.00042917, 0.00070387, -0.00000112, 0.00000000],
+		[-6.27249250, -0.00070013, 0.00042907, 0.00070371, -0.00000112, 0.00000000],
+		[-6.27249288, -0.00069997, 0.00042898, 0.00070355, -0.00000112, 0.00000000],
+		[-6.27249326, -0.00069981, 0.00042888, 0.00070339, -0.00000112, 0.00000000],
+		[-6.27249364, -0.00069965, 0.00042878, 0.00070323, -0.00000112, 0.00000000],
+		[-6.27249402, -0.00069950, 0.00042869, 0.00070308, -0.00000112, 0.00000000],
+		[-6.27249440, -0.00069934, 0.00042859, 0.00070292, -0.00000112, 0.00000000],
+		[-6.27249477, -0.00069918, 0.00042849, 0.00070276, -0.00000112, 0.00000000],
+		[-6.27249515, -0.00069902, 0.00042840, 0.00070260, -0.00000112, 0.00000000],
+		[-6.27249553, -0.00069887, 0.00042830, 0.00070244, -0.00000112, 0.00000000],
+		[-6.27249591, -0.00069871, 0.00042820, 0.00070228, -0.00000112, 0.00000000],
+		[-6.27249629, -0.00069855, 0.00042810, 0.00070212, -0.00000112, 0.00000000],
+		[-6.27249667, -0.00069839, 0.00042801, 0.00070197, -0.00000112, 0.00000000],
+		[-6.27249705, -0.00069823, 0.00042791, 0.00070181, -0.00000112, 0.00000000],
+		[-6.27249743, -0.00069808, 0.00042781, 0.00070165, -0.00000112, 0.00000000],
+		[-6.27249780, -0.00069792, 0.00042772, 0.00070149, -0.00000112, 0.00000000],
+		[-6.27249818, -0.00069776, 0.00042762, 0.00070133, -0.00000112, 0.00000000],
+		[-6.27249856, -0.00069761, 0.00042753, 0.00070117, -0.00000112, 0.00000000],
+		[-6.27249894, -0.00069745, 0.00042743, 0.00070102, -0.00000112, 0.00000000],
+		[-6.27249931, -0.00069729, 0.00042733, 0.00070086, -0.00000112, 0.00000000],
+		[-6.27249969, -0.00069713, 0.00042724, 0.00070070, -0.00000112, 0.00000000],
+		[-6.27250007, -0.00069698, 0.00042714, 0.00070054, -0.00000112, 0.00000000],
+		[-6.27250045, -0.00069682, 0.00042704, 0.00070038, -0.00000112, 0.00000000],
+		[-6.27250082, -0.00069666, 0.00042695, 0.00070023, -0.00000112, 0.00000000],
+		[-6.27250120, -0.00069651, 0.00042685, 0.00070007, -0.00000112, 0.00000000],
+		[-6.27250158, -0.00069635, 0.00042676, 0.00069991, -0.00000112, 0.00000000],
+		[-6.27250195, -0.00069619, 0.00042666, 0.00069975, -0.00000112, 0.00000000],
+		[-6.27250233, -0.00069604, 0.00042656, 0.00069960, -0.00000112, 0.00000000],
+		[-6.27250270, -0.00069588, 0.00042647, 0.00069944, -0.00000112, 0.00000000],
+		[-6.27250308, -0.00069572, 0.00042637, 0.00069928, -0.00000112, 0.00000000],
+		[-6.27250345, -0.00069557, 0.00042628, 0.00069913, -0.00000112, 0.00000000],
+		[-6.27250383, -0.00069541, 0.00042618, 0.00069897, -0.00000112, 0.00000000],
+		[-6.27250420, -0.00069525, 0.00042608, 0.00069881, -0.00000112, 0.00000000],
+		[-6.27250458, -0.00069510, 0.00042599, 0.00069865, -0.00000112, 0.00000000],
+		[-6.27250495, -0.00069494, 0.00042589, 0.00069850, -0.00000112, 0.00000000],
+		[-6.27250533, -0.00069479, 0.00042580, 0.00069834, -0.00000112, 0.00000000],
+		[-6.27250570, -0.00069463, 0.00042570, 0.00069818, -0.00000112, 0.00000000],
+		[-6.27250608, -0.00069447, 0.00042561, 0.00069803, -0.00000112, 0.00000000],
+		[-6.27250645, -0.00069432, 0.00042551, 0.00069787, -0.00000112, 0.00000000],
+		[-6.27250683, -0.00069416, 0.00042541, 0.00069771, -0.00000112, 0.00000000],
+		[-6.27250720, -0.00069401, 0.00042532, 0.00069756, -0.00000112, 0.00000000],
+		[-6.27250757, -0.00069385, 0.00042522, 0.00069740, -0.00000112, 0.00000000],
+		[-6.27250795, -0.00069370, 0.00042513, 0.00069725, -0.00000112, 0.00000000],
+		[-6.27250832, -0.00069354, 0.00042503, 0.00069709, -0.00000112, 0.00000000],
+		[-6.27250869, -0.00069339, 0.00042494, 0.00069693, -0.00000112, 0.00000000],
+		[-6.27250906, -0.00069323, 0.00042484, 0.00069678, -0.00000112, 0.00000000],
+		[-6.27250944, -0.00069308, 0.00042475, 0.00069662, -0.00000112, 0.00000000],
+		[-6.27250981, -0.00069292, 0.00042465, 0.00069646, -0.00000112, 0.00000000],
+		[-6.27251018, -0.00069277, 0.00042456, 0.00069631, -0.00000112, 0.00000000],
+		[-6.27251055, -0.00069261, 0.00042446, 0.00069615, -0.00000112, 0.00000000],
+		[-6.27251093, -0.00069246, 0.00042437, 0.00069600, -0.00000112, 0.00000000],
+		[-6.27251130, -0.00069230, 0.00042427, 0.00069584, -0.00000112, 0.00000000],
+		[-6.27251167, -0.00069215, 0.00042418, 0.00069569, -0.00000112, 0.00000000],
+		[-6.27251204, -0.00069199, 0.00042408, 0.00069553, -0.00000112, 0.00000000],
+		[-6.27251241, -0.00069184, 0.00042399, 0.00069537, -0.00000112, 0.00000000],
+		[-6.27251278, -0.00069168, 0.00042389, 0.00069522, -0.00000112, 0.00000000],
+		[-6.27251315, -0.00069153, 0.00042380, 0.00069506, -0.00000112, 0.00000000],
+		[-6.27251353, -0.00069137, 0.00042370, 0.00069491, -0.00000112, 0.00000000],
+		[-6.27251390, -0.00069122, 0.00042361, 0.00069475, -0.00000112, 0.00000000],
+		[-6.27251427, -0.00069106, 0.00042351, 0.00069460, -0.00000112, 0.00000000],
+		[-6.27251464, -0.00069091, 0.00042342, 0.00069444, -0.00000112, 0.00000000],
+		[-6.27251501, -0.00069076, 0.00042332, 0.00069429, -0.00000112, 0.00000000],
+		[-6.27251538, -0.00069060, 0.00042323, 0.00069413, -0.00000112, 0.00000000],
+		[-6.27251575, -0.00069045, 0.00042314, 0.00069398, -0.00000112, 0.00000000],
+		[-6.27251612, -0.00069029, 0.00042304, 0.00069382, -0.00000112, 0.00000000],
+		[-6.27251649, -0.00069014, 0.00042295, 0.00069367, -0.00000112, 0.00000000],
+		[-6.27251685, -0.00068999, 0.00042285, 0.00069351, -0.00000112, 0.00000000],
+		[-6.27251722, -0.00068983, 0.00042276, 0.00069336, -0.00000112, 0.00000000],
+		[-6.27251759, -0.00068968, 0.00042266, 0.00069321, -0.00000112, 0.00000000],
+		[-6.27251796, -0.00068952, 0.00042257, 0.00069305, -0.00000112, 0.00000000],
+		[-6.27251833, -0.00068937, 0.00042248, 0.00069290, -0.00000112, 0.00000000],
+		[-6.27251870, -0.00068922, 0.00042238, 0.00069274, -0.00000112, 0.00000000],
+		[-6.27251907, -0.00068906, 0.00042229, 0.00069259, -0.00000112, 0.00000000],
+		[-6.27251943, -0.00068891, 0.00042219, 0.00069243, -0.00000112, 0.00000000],
+		[-6.27251980, -0.00068876, 0.00042210, 0.00069228, -0.00000112, 0.00000000],
+		[-6.27252017, -0.00068860, 0.00042200, 0.00069213, -0.00000112, 0.00000000],
+		[-6.27252054, -0.00068845, 0.00042191, 0.00069197, -0.00000112, 0.00000000],
+		[-6.27252091, -0.00068830, 0.00042182, 0.00069182, -0.00000112, 0.00000000],
+		[-6.27252127, -0.00068815, 0.00042172, 0.00069166, -0.00000112, 0.00000000],
+		[-6.27252164, -0.00068799, 0.00042163, 0.00069151, -0.00000112, 0.00000000],
+		[-6.27252201, -0.00068784, 0.00042154, 0.00069136, -0.00000112, 0.00000000],
+		[-6.27252237, -0.00068769, 0.00042144, 0.00069120, -0.00000112, 0.00000000],
+		[-6.27252274, -0.00068753, 0.00042135, 0.00069105, -0.00000112, 0.00000000],
+		[-6.27252311, -0.00068738, 0.00042125, 0.00069090, -0.00000112, 0.00000000],
+		[-6.27252347, -0.00068723, 0.00042116, 0.00069074, -0.00000112, 0.00000000],
+		[-6.27252384, -0.00068708, 0.00042107, 0.00069059, -0.00000112, 0.00000000],
+		[-6.27252420, -0.00068692, 0.00042097, 0.00069044, -0.00000112, 0.00000000],
+		[-6.27252457, -0.00068677, 0.00042088, 0.00069028, -0.00000112, 0.00000000],
+		[-6.27252494, -0.00068662, 0.00042079, 0.00069013, -0.00000112, 0.00000000],
+		[-6.27252530, -0.00068647, 0.00042069, 0.00068998, -0.00000112, 0.00000000],
+		[-6.27252567, -0.00068631, 0.00042060, 0.00068982, -0.00000112, 0.00000000],
+		[-6.27252603, -0.00068616, 0.00042051, 0.00068967, -0.00000112, 0.00000000],
+		[-6.27252640, -0.00068601, 0.00042041, 0.00068952, -0.00000112, 0.00000000],
+		[-6.27252676, -0.00068586, 0.00042032, 0.00068937, -0.00000112, 0.00000000],
+		[-6.27252712, -0.00068571, 0.00042023, 0.00068921, -0.00000112, 0.00000000],
+		[-6.27252749, -0.00068555, 0.00042013, 0.00068906, -0.00000112, 0.00000000],
+		[-6.27252785, -0.00068540, 0.00042004, 0.00068891, -0.00000112, 0.00000000],
+		[-6.27252822, -0.00068525, 0.00041995, 0.00068875, -0.00000112, 0.00000000],
+		[-6.27252858, -0.00068510, 0.00041985, 0.00068860, -0.00000112, 0.00000000],
+		[-6.27252895, -0.00068495, 0.00041976, 0.00068845, -0.00000112, 0.00000000],
+		[-6.27252931, -0.00068480, 0.00041967, 0.00068830, -0.00000112, 0.00000000],
+		[-6.27252967, -0.00068464, 0.00041958, 0.00068815, -0.00000112, 0.00000000],
+		[-6.27253004, -0.00068449, 0.00041948, 0.00068799, -0.00000112, 0.00000000],
+		[-6.27253040, -0.00068434, 0.00041939, 0.00068784, -0.00000112, 0.00000000],
+		[-6.27253076, -0.00068419, 0.00041930, 0.00068769, -0.00000112, 0.00000000],
+		[-6.27253112, -0.00068404, 0.00041920, 0.00068754, -0.00000112, 0.00000000],
+		[-6.27253149, -0.00068389, 0.00041911, 0.00068738, -0.00000112, 0.00000000],
+		[-6.27253185, -0.00068374, 0.00041902, 0.00068723, -0.00000112, 0.00000000],
+		[-6.27253221, -0.00068359, 0.00041893, 0.00068708, -0.00000112, 0.00000000],
+		[-6.27253257, -0.00068344, 0.00041883, 0.00068693, -0.00000112, 0.00000000],
+		[-6.27253293, -0.00068328, 0.00041874, 0.00068678, -0.00000112, 0.00000000],
+		[-6.27253330, -0.00068313, 0.00041865, 0.00068663, -0.00000112, 0.00000000],
+		[-6.27253366, -0.00068298, 0.00041856, 0.00068647, -0.00000112, 0.00000000],
+		[-6.27253402, -0.00068283, 0.00041846, 0.00068632, -0.00000112, 0.00000000],
+		[-6.27253438, -0.00068268, 0.00041837, 0.00068617, -0.00000112, 0.00000000],
+		[-6.27253474, -0.00068253, 0.00041828, 0.00068602, -0.00000112, 0.00000000],
+		[-6.27253510, -0.00068238, 0.00041819, 0.00068587, -0.00000112, 0.00000000],
+		[-6.27253546, -0.00068223, 0.00041810, 0.00068572, -0.00000112, 0.00000000],
+		[-6.27253582, -0.00068208, 0.00041800, 0.00068557, -0.00000112, 0.00000000],
+		[-6.27253618, -0.00068193, 0.00041791, 0.00068542, -0.00000112, 0.00000000],
+		[-6.27253654, -0.00068178, 0.00041782, 0.00068526, -0.00000112, 0.00000000],
+		[-6.27253690, -0.00068163, 0.00041773, 0.00068511, -0.00000112, 0.00000000],
+		[-6.27253726, -0.00068148, 0.00041763, 0.00068496, -0.00000112, 0.00000000],
+		[-6.27253762, -0.00068133, 0.00041754, 0.00068481, -0.00000112, 0.00000000],
+		[-6.27253798, -0.00068118, 0.00041745, 0.00068466, -0.00000112, 0.00000000],
+		[-6.27253834, -0.00068103, 0.00041736, 0.00068451, -0.00000112, 0.00000000],
+		[-6.27253870, -0.00068088, 0.00041727, 0.00068436, -0.00000112, 0.00000000],
+		[-6.27253906, -0.00068073, 0.00041718, 0.00068421, -0.00000112, 0.00000000],
+		[-6.27253942, -0.00068058, 0.00041708, 0.00068406, -0.00000112, 0.00000000],
+		[-6.27253978, -0.00068043, 0.00041699, 0.00068391, -0.00000112, 0.00000000],
+		[-6.27254014, -0.00068028, 0.00041690, 0.00068376, -0.00000112, 0.00000000],
+		[-6.27254050, -0.00068013, 0.00041681, 0.00068361, -0.00000112, 0.00000000],
+		[-6.27254086, -0.00067998, 0.00041672, 0.00068346, -0.00000112, 0.00000000],
+		[-6.27254121, -0.00067983, 0.00041662, 0.00068331, -0.00000112, 0.00000000],
+		[-6.27254157, -0.00067968, 0.00041653, 0.00068316, -0.00000112, 0.00000000],
+		[-6.27254193, -0.00067953, 0.00041644, 0.00068301, -0.00000112, 0.00000000],
+		[-6.27254229, -0.00067939, 0.00041635, 0.00068286, -0.00000112, 0.00000000],
+		[-6.27254264, -0.00067924, 0.00041626, 0.00068271, -0.00000112, 0.00000000],
+		[-6.27254300, -0.00067909, 0.00041617, 0.00068256, -0.00000112, 0.00000000],
+		[-6.27254336, -0.00067894, 0.00041608, 0.00068241, -0.00000112, 0.00000000],
+		[-6.27254372, -0.00067879, 0.00041598, 0.00068226, -0.00000112, 0.00000000],
+		[-6.27254407, -0.00067864, 0.00041589, 0.00068211, -0.00000112, 0.00000000],
+		[-6.27254443, -0.00067849, 0.00041580, 0.00068196, -0.00000112, 0.00000000],
+		[-6.27254479, -0.00067834, 0.00041571, 0.00068181, -0.00000112, 0.00000000],
+		[-6.27254514, -0.00067819, 0.00041562, 0.00068166, -0.00000112, 0.00000000],
+		[-6.27254550, -0.00067805, 0.00041553, 0.00068151, -0.00000112, 0.00000000],
+		[-6.27254585, -0.00067790, 0.00041544, 0.00068136, -0.00000112, 0.00000000],
+		[-6.27254621, -0.00067775, 0.00041535, 0.00068121, -0.00000112, 0.00000000],
+		[-6.27254657, -0.00067760, 0.00041526, 0.00068106, -0.00000112, 0.00000000],
+		[-6.27254692, -0.00067745, 0.00041516, 0.00068092, -0.00000112, 0.00000000],
+		[-6.27254728, -0.00067730, 0.00041507, 0.00068077, -0.00000112, 0.00000000],
+		[-6.27254763, -0.00067716, 0.00041498, 0.00068062, -0.00000112, 0.00000000],
+		[-6.27254799, -0.00067701, 0.00041489, 0.00068047, -0.00000112, 0.00000000],
+		[-6.27254834, -0.00067686, 0.00041480, 0.00068032, -0.00000112, 0.00000000],
+		[-6.27254870, -0.00067671, 0.00041471, 0.00068017, -0.00000112, 0.00000000],
+		[-6.27254905, -0.00067656, 0.00041462, 0.00068002, -0.00000112, 0.00000000],
+		[-6.27254941, -0.00067642, 0.00041453, 0.00067987, -0.00000112, 0.00000000],
+		[-6.27254976, -0.00067627, 0.00041444, 0.00067972, -0.00000112, 0.00000000],
+		[-6.27255012, -0.00067612, 0.00041435, 0.00067958, -0.00000112, 0.00000000],
+		[-6.27255047, -0.00067597, 0.00041426, 0.00067943, -0.00000112, 0.00000000],
+		[-6.27255082, -0.00067583, 0.00041417, 0.00067928, -0.00000112, 0.00000000],
+		[-6.27255118, -0.00067568, 0.00041408, 0.00067913, -0.00000112, 0.00000000],
+		[-6.27255153, -0.00067553, 0.00041399, 0.00067898, -0.00000112, 0.00000000],
+		[-6.27255188, -0.00067538, 0.00041390, 0.00067883, -0.00000112, 0.00000000],
+		[-6.27255224, -0.00067524, 0.00041381, 0.00067869, -0.00000112, 0.00000000],
+		[-6.27255259, -0.00067509, 0.00041372, 0.00067854, -0.00000112, 0.00000000],
+		[-6.27255294, -0.00067494, 0.00041362, 0.00067839, -0.00000112, 0.00000000],
+		[-6.27255330, -0.00067479, 0.00041353, 0.00067824, -0.00000112, 0.00000000],
+		[-6.27255365, -0.00067465, 0.00041344, 0.00067810, -0.00000112, 0.00000000],
+		[-6.27255400, -0.00067450, 0.00041335, 0.00067795, -0.00000112, 0.00000000],
+		[-6.27255435, -0.00067435, 0.00041326, 0.00067780, -0.00000112, 0.00000000],
+		[-6.27255470, -0.00067421, 0.00041317, 0.00067765, -0.00000112, 0.00000000],
+		[-6.27255506, -0.00067406, 0.00041308, 0.00067750, -0.00000112, 0.00000000],
+		[-6.27255541, -0.00067391, 0.00041299, 0.00067736, -0.00000112, 0.00000000],
+		[-6.27255576, -0.00067377, 0.00041290, 0.00067721, -0.00000112, 0.00000000],
+		[-6.27255611, -0.00067362, 0.00041281, 0.00067706, -0.00000112, 0.00000000],
+		[-6.27255646, -0.00067347, 0.00041272, 0.00067691, -0.00000112, 0.00000000],
+		[-6.27255681, -0.00067333, 0.00041263, 0.00067677, -0.00000112, 0.00000000],
+		[-6.27255717, -0.00067318, 0.00041254, 0.00067662, -0.00000112, 0.00000000],
+		[-6.27255752, -0.00067303, 0.00041245, 0.00067647, -0.00000112, 0.00000000],
+		[-6.27255787, -0.00067289, 0.00041236, 0.00067633, -0.00000112, 0.00000000],
+		[-6.27255822, -0.00067274, 0.00041228, 0.00067618, -0.00000112, 0.00000000],
+		[-6.27255857, -0.00067260, 0.00041219, 0.00067603, -0.00000112, 0.00000000],
+		[-6.27255892, -0.00067245, 0.00041210, 0.00067589, -0.00000112, 0.00000000],
+		[-6.27255927, -0.00067230, 0.00041201, 0.00067574, -0.00000112, 0.00000000],
+		[-6.27255962, -0.00067216, 0.00041192, 0.00067559, -0.00000112, 0.00000000],
+		[-6.27255997, -0.00067201, 0.00041183, 0.00067544, -0.00000112, 0.00000000],
+		[-6.27256032, -0.00067187, 0.00041174, 0.00067530, -0.00000112, 0.00000000],
+		[-6.27256067, -0.00067172, 0.00041165, 0.00067515, -0.00000112, 0.00000000],
+		[-6.27256102, -0.00067157, 0.00041156, 0.00067501, -0.00000112, 0.00000000],
+		[-6.27256137, -0.00067143, 0.00041147, 0.00067486, -0.00000112, 0.00000000],
+		[-6.27256171, -0.00067128, 0.00041138, 0.00067471, -0.00000112, 0.00000000],
+		[-6.27256206, -0.00067114, 0.00041129, 0.00067457, -0.00000112, 0.00000000],
+		[-6.27256241, -0.00067099, 0.00041120, 0.00067442, -0.00000112, 0.00000000],
+		[-6.27256276, -0.00067085, 0.00041111, 0.00067427, -0.00000112, 0.00000000],
+		[-6.27256311, -0.00067070, 0.00041102, 0.00067413, -0.00000112, 0.00000000],
+		[-6.27256346, -0.00067056, 0.00041093, 0.00067398, -0.00000112, 0.00000000],
+		[-6.27256381, -0.00067041, 0.00041085, 0.00067384, -0.00000112, 0.00000000],
+		[-6.27256415, -0.00067027, 0.00041076, 0.00067369, -0.00000112, 0.00000000],
+		[-6.27256450, -0.00067012, 0.00041067, 0.00067354, -0.00000112, 0.00000000],
+		[-6.27256485, -0.00066998, 0.00041058, 0.00067340, -0.00000112, 0.00000000],
+		[-6.27256520, -0.00066983, 0.00041049, 0.00067325, -0.00000112, 0.00000000],
+		[-6.27256554, -0.00066969, 0.00041040, 0.00067311, -0.00000112, 0.00000000],
+		[-6.27256589, -0.00066954, 0.00041031, 0.00067296, -0.00000112, 0.00000000],
+		[-6.27256624, -0.00066940, 0.00041022, 0.00067282, -0.00000112, 0.00000000],
+		[-6.27256658, -0.00066925, 0.00041013, 0.00067267, -0.00000112, 0.00000000],
+		[-6.27256693, -0.00066911, 0.00041005, 0.00067252, -0.00000112, 0.00000000],
+		[-6.27256728, -0.00066896, 0.00040996, 0.00067238, -0.00000112, 0.00000000],
+		[-6.27256762, -0.00066882, 0.00040987, 0.00067223, -0.00000112, 0.00000000],
+		[-6.27256797, -0.00066867, 0.00040978, 0.00067209, -0.00000112, 0.00000000],
+		[-6.27256832, -0.00066853, 0.00040969, 0.00067194, -0.00000112, 0.00000000],
+		[-6.27256866, -0.00066838, 0.00040960, 0.00067180, -0.00000112, 0.00000000],
+		[-6.27256901, -0.00066824, 0.00040951, 0.00067165, -0.00000112, 0.00000000],
+		[-6.27256935, -0.00066810, 0.00040943, 0.00067151, -0.00000112, 0.00000000],
+		[-6.27256970, -0.00066795, 0.00040934, 0.00067136, -0.00000112, 0.00000000],
+		[-6.27257004, -0.00066781, 0.00040925, 0.00067122, -0.00000112, 0.00000000],
+		[-6.27257039, -0.00066766, 0.00040916, 0.00067107, -0.00000112, 0.00000000],
+		[-6.27257073, -0.00066752, 0.00040907, 0.00067093, -0.00000112, 0.00000000],
+		[-6.27257108, -0.00066738, 0.00040898, 0.00067078, -0.00000112, 0.00000000],
+		[-6.27257142, -0.00066723, 0.00040890, 0.00067064, -0.00000112, 0.00000000],
+		[-6.27257177, -0.00066709, 0.00040881, 0.00067050, -0.00000112, 0.00000000],
+		[-6.27257211, -0.00066694, 0.00040872, 0.00067035, -0.00000112, 0.00000000],
+		[-6.27257246, -0.00066680, 0.00040863, 0.00067021, -0.00000112, 0.00000000],
+		[-6.27257280, -0.00066666, 0.00040854, 0.00067006, -0.00000112, 0.00000000],
+		[-6.27257315, -0.00066651, 0.00040846, 0.00066992, -0.00000112, 0.00000000],
+		[-6.27257349, -0.00066637, 0.00040837, 0.00066977, -0.00000112, 0.00000000],
+		[-6.27257383, -0.00066623, 0.00040828, 0.00066963, -0.00000112, 0.00000000],
+		[-6.27257418, -0.00066608, 0.00040819, 0.00066949, -0.00000112, 0.00000000],
+		[-6.27257452, -0.00066594, 0.00040810, 0.00066934, -0.00000112, 0.00000000],
+		[-6.27257486, -0.00066580, 0.00040802, 0.00066920, -0.00000112, 0.00000000],
+		[-6.27257521, -0.00066565, 0.00040793, 0.00066905, -0.00000112, 0.00000000],
+		[-6.27257555, -0.00066551, 0.00040784, 0.00066891, -0.00000112, 0.00000000],
+		[-6.27257589, -0.00066537, 0.00040775, 0.00066877, -0.00000112, 0.00000000],
+		[-6.27257623, -0.00066522, 0.00040766, 0.00066862, -0.00000112, 0.00000000],
+		[-6.27257658, -0.00066508, 0.00040758, 0.00066848, -0.00000112, 0.00000000],
+		[-6.27257692, -0.00066494, 0.00040749, 0.00066833, -0.00000112, 0.00000000],
+		[-6.27257726, -0.00066480, 0.00040740, 0.00066819, -0.00000112, 0.00000000],
+		[-6.27257760, -0.00066465, 0.00040731, 0.00066805, -0.00000112, 0.00000000],
+		[-6.27257795, -0.00066451, 0.00040723, 0.00066790, -0.00000112, 0.00000000],
+		[-6.27257829, -0.00066437, 0.00040714, 0.00066776, -0.00000112, 0.00000000],
+		[-6.27257863, -0.00066422, 0.00040705, 0.00066762, -0.00000112, 0.00000000],
+		[-6.27257897, -0.00066408, 0.00040696, 0.00066747, -0.00000112, 0.00000000],
+		[-6.27257931, -0.00066394, 0.00040688, 0.00066733, -0.00000112, 0.00000000],
+		[-6.27257965, -0.00066380, 0.00040679, 0.00066719, -0.00000112, 0.00000000],
+		[-6.27257999, -0.00066366, 0.00040670, 0.00066704, -0.00000112, 0.00000000],
+		[-6.27258033, -0.00066351, 0.00040662, 0.00066690, -0.00000112, 0.00000000],
+		[-6.27258068, -0.00066337, 0.00040653, 0.00066676, -0.00000112, 0.00000000],
+		[-6.27258102, -0.00066323, 0.00040644, 0.00066662, -0.00000112, 0.00000000],
+		[-6.27258136, -0.00066309, 0.00040635, 0.00066647, -0.00000112, 0.00000000],
+		[-6.27258170, -0.00066294, 0.00040627, 0.00066633, -0.00000112, 0.00000000],
+		[-6.27258204, -0.00066280, 0.00040618, 0.00066619, -0.00000112, 0.00000000],
+		[-6.27258238, -0.00066266, 0.00040609, 0.00066604, -0.00000112, 0.00000000],
+		[-6.27258272, -0.00066252, 0.00040601, 0.00066590, -0.00000112, 0.00000000],
+		[-6.27258306, -0.00066238, 0.00040592, 0.00066576, -0.00000112, 0.00000000],
+		[-6.27258340, -0.00066224, 0.00040583, 0.00066562, -0.00000112, 0.00000000],
+		[-6.27258373, -0.00066209, 0.00040574, 0.00066547, -0.00000112, 0.00000000],
+		[-6.27258407, -0.00066195, 0.00040566, 0.00066533, -0.00000112, 0.00000000],
+		[-6.27258441, -0.00066181, 0.00040557, 0.00066519, -0.00000112, 0.00000000],
+		[-6.27258475, -0.00066167, 0.00040548, 0.00066505, -0.00000112, 0.00000000],
+		[-6.27258509, -0.00066153, 0.00040540, 0.00066491, -0.00000112, 0.00000000],
+		[-6.27258543, -0.00066139, 0.00040531, 0.00066476, -0.00000112, 0.00000000],
+		[-6.27258577, -0.00066125, 0.00040522, 0.00066462, -0.00000112, 0.00000000],
+		[-6.27258611, -0.00066110, 0.00040514, 0.00066448, -0.00000112, 0.00000000],
+		[-6.27258644, -0.00066096, 0.00040505, 0.00066434, -0.00000112, 0.00000000],
+		[-6.27258678, -0.00066082, 0.00040496, 0.00066420, -0.00000112, 0.00000000],
+		[-6.27258712, -0.00066068, 0.00040488, 0.00066405, -0.00000112, 0.00000000],
+		[-6.27258746, -0.00066054, 0.00040479, 0.00066391, -0.00000112, 0.00000000],
+		[-6.27258780, -0.00066040, 0.00040471, 0.00066377, -0.00000112, 0.00000000],
+		[-6.27258813, -0.00066026, 0.00040462, 0.00066363, -0.00000112, 0.00000000],
+		[-6.27258847, -0.00066012, 0.00040453, 0.00066349, -0.00000112, 0.00000000],
+		[-6.27258881, -0.00065998, 0.00040445, 0.00066335, -0.00000112, 0.00000000],
+		[-6.27258914, -0.00065984, 0.00040436, 0.00066320, -0.00000112, 0.00000000],
+		[-6.27258948, -0.00065970, 0.00040427, 0.00066306, -0.00000112, 0.00000000],
+		[-6.27258982, -0.00065955, 0.00040419, 0.00066292, -0.00000112, 0.00000000],
+		[-6.27259015, -0.00065941, 0.00040410, 0.00066278, -0.00000112, 0.00000000],
+		[-6.27259049, -0.00065927, 0.00040401, 0.00066264, -0.00000112, 0.00000000],
+		[-6.27259083, -0.00065913, 0.00040393, 0.00066250, -0.00000112, 0.00000000],
+		[-6.27259116, -0.00065899, 0.00040384, 0.00066236, -0.00000112, 0.00000000],
+		[-6.27259150, -0.00065885, 0.00040376, 0.00066222, -0.00000112, 0.00000000],
+		[-6.27259184, -0.00065871, 0.00040367, 0.00066208, -0.00000112, 0.00000000],
+		[-6.27259217, -0.00065857, 0.00040358, 0.00066193, -0.00000112, 0.00000000],
+		[-6.27259251, -0.00065843, 0.00040350, 0.00066179, -0.00000112, 0.00000000],
+		[-6.27259284, -0.00065829, 0.00040341, 0.00066165, -0.00000112, 0.00000000],
+		[-6.27259318, -0.00065815, 0.00040333, 0.00066151, -0.00000112, 0.00000000],
+		[-6.27259351, -0.00065801, 0.00040324, 0.00066137, -0.00000112, 0.00000000],
+		[-6.27259385, -0.00065787, 0.00040316, 0.00066123, -0.00000112, 0.00000000],
+		[-6.27259418, -0.00065773, 0.00040307, 0.00066109, -0.00000112, 0.00000000],
+		[-6.27259452, -0.00065759, 0.00040298, 0.00066095, -0.00000112, 0.00000000],
+		[-6.27259485, -0.00065745, 0.00040290, 0.00066081, -0.00000112, 0.00000000],
+		[-6.27259519, -0.00065731, 0.00040281, 0.00066067, -0.00000112, 0.00000000],
+		[-6.27259552, -0.00065717, 0.00040273, 0.00066053, -0.00000112, 0.00000000],
+		[-6.27259585, -0.00065703, 0.00040264, 0.00066039, -0.00000112, 0.00000000],
+		[-6.27259619, -0.00065690, 0.00040256, 0.00066025, -0.00000112, 0.00000000],
+		[-6.27259652, -0.00065676, 0.00040247, 0.00066011, -0.00000112, 0.00000000],
+		[-6.27259686, -0.00065662, 0.00040239, 0.00065997, -0.00000112, 0.00000000],
+		[-6.27259719, -0.00065648, 0.00040230, 0.00065983, -0.00000112, 0.00000000],
+		[-6.27259752, -0.00065634, 0.00040221, 0.00065969, -0.00000112, 0.00000000],
+		[-6.27259786, -0.00065620, 0.00040213, 0.00065955, -0.00000112, 0.00000000],
+		[-6.27259819, -0.00065606, 0.00040204, 0.00065941, -0.00000112, 0.00000000],
+		[-6.27259852, -0.00065592, 0.00040196, 0.00065927, -0.00000112, 0.00000000],
+		[-6.27259885, -0.00065578, 0.00040187, 0.00065913, -0.00000112, 0.00000000],
+		[-6.27259919, -0.00065564, 0.00040179, 0.00065899, -0.00000112, 0.00000000],
+		[-6.27259952, -0.00065550, 0.00040170, 0.00065885, -0.00000112, 0.00000000],
+		[-6.27259985, -0.00065537, 0.00040162, 0.00065871, -0.00000112, 0.00000000],
+		[-6.27260018, -0.00065523, 0.00040153, 0.00065857, -0.00000112, 0.00000000],
+		[-6.27260052, -0.00065509, 0.00040145, 0.00065843, -0.00000112, 0.00000000],
+		[-6.27260085, -0.00065495, 0.00040136, 0.00065829, -0.00000112, 0.00000000],
+		[-6.27260118, -0.00065481, 0.00040128, 0.00065815, -0.00000112, 0.00000000],
+		[-6.27260151, -0.00065467, 0.00040119, 0.00065801, -0.00000112, 0.00000000],
+		[-6.27260184, -0.00065453, 0.00040111, 0.00065788, -0.00000112, 0.00000000],
+		[-6.27260217, -0.00065440, 0.00040102, 0.00065774, -0.00000112, 0.00000000],
+		[-6.27260251, -0.00065426, 0.00040094, 0.00065760, -0.00000112, 0.00000000],
+		[-6.27260284, -0.00065412, 0.00040085, 0.00065746, -0.00000112, 0.00000000],
+		[-6.27260317, -0.00065398, 0.00040077, 0.00065732, -0.00000112, 0.00000000],
+		[-6.27260350, -0.00065384, 0.00040068, 0.00065718, -0.00000112, 0.00000000],
+		[-6.27260383, -0.00065370, 0.00040060, 0.00065704, -0.00000112, 0.00000000],
+		[-6.27260416, -0.00065357, 0.00040051, 0.00065690, -0.00000112, 0.00000000],
+		[-6.27260449, -0.00065343, 0.00040043, 0.00065676, -0.00000112, 0.00000000],
+		[-6.27260482, -0.00065329, 0.00040035, 0.00065663, -0.00000112, 0.00000000],
+		[-6.27260515, -0.00065315, 0.00040026, 0.00065649, -0.00000112, 0.00000000],
+		[-6.27260548, -0.00065302, 0.00040018, 0.00065635, -0.00000112, 0.00000000],
+		[-6.27260581, -0.00065288, 0.00040009, 0.00065621, -0.00000112, 0.00000000],
+		[-6.27260614, -0.00065274, 0.00040001, 0.00065607, -0.00000112, 0.00000000],
+		[-6.27260647, -0.00065260, 0.00039992, 0.00065593, -0.00000112, 0.00000000],
+		[-6.27260680, -0.00065246, 0.00039984, 0.00065580, -0.00000112, 0.00000000],
+		[-6.27260713, -0.00065233, 0.00039975, 0.00065566, -0.00000112, 0.00000000],
+		[-6.27260746, -0.00065219, 0.00039967, 0.00065552, -0.00000112, 0.00000000],
+		[-6.27260779, -0.00065205, 0.00039959, 0.00065538, -0.00000112, 0.00000000],
+		[-6.27260812, -0.00065192, 0.00039950, 0.00065524, -0.00000112, 0.00000000],
+		[-6.27260844, -0.00065178, 0.00039942, 0.00065510, -0.00000112, 0.00000000],
+		[-6.27260877, -0.00065164, 0.00039933, 0.00065497, -0.00000112, 0.00000000],
+		[-6.27260910, -0.00065150, 0.00039925, 0.00065483, -0.00000112, 0.00000000],
+		[-6.27260943, -0.00065137, 0.00039917, 0.00065469, -0.00000112, 0.00000000],
+		[-6.27260976, -0.00065123, 0.00039908, 0.00065455, -0.00000112, 0.00000000],
+		[-6.27261009, -0.00065109, 0.00039900, 0.00065442, -0.00000112, 0.00000000],
+		[-6.27261041, -0.00065096, 0.00039891, 0.00065428, -0.00000112, 0.00000000],
+		[-6.27261074, -0.00065082, 0.00039883, 0.00065414, -0.00000112, 0.00000000],
+		[-6.27261107, -0.00065068, 0.00039875, 0.00065400, -0.00000112, 0.00000000],
+		[-6.27261140, -0.00065055, 0.00039866, 0.00065387, -0.00000112, 0.00000000],
+		[-6.27261172, -0.00065041, 0.00039858, 0.00065373, -0.00000112, 0.00000000],
+		[-6.27261205, -0.00065027, 0.00039849, 0.00065359, -0.00000112, 0.00000000],
+		[-6.27261238, -0.00065014, 0.00039841, 0.00065345, -0.00000112, 0.00000000],
+		[-6.27261271, -0.00065000, 0.00039833, 0.00065332, -0.00000112, 0.00000000],
+		[-6.27261303, -0.00064986, 0.00039824, 0.00065318, -0.00000112, 0.00000000],
+		[-6.27261336, -0.00064973, 0.00039816, 0.00065304, -0.00000112, 0.00000000],
+		[-6.27261369, -0.00064959, 0.00039808, 0.00065290, -0.00000112, 0.00000000],
+		[-6.27261401, -0.00064945, 0.00039799, 0.00065277, -0.00000112, 0.00000000],
+		[-6.27261434, -0.00064932, 0.00039791, 0.00065263, -0.00000112, 0.00000000],
+		[-6.27261466, -0.00064918, 0.00039782, 0.00065249, -0.00000112, 0.00000000],
+		[-6.27261499, -0.00064904, 0.00039774, 0.00065236, -0.00000112, 0.00000000],
+		[-6.27261532, -0.00064891, 0.00039766, 0.00065222, -0.00000112, 0.00000000],
+		[-6.27261564, -0.00064877, 0.00039757, 0.00065208, -0.00000112, 0.00000000],
+		[-6.27261597, -0.00064864, 0.00039749, 0.00065195, -0.00000112, 0.00000000],
+		[-6.27261629, -0.00064850, 0.00039741, 0.00065181, -0.00000112, 0.00000000],
+		[-6.27261662, -0.00064836, 0.00039732, 0.00065167, -0.00000112, 0.00000000],
+		[-6.27261694, -0.00064823, 0.00039724, 0.00065154, -0.00000112, 0.00000000],
+		[-6.27261727, -0.00064809, 0.00039716, 0.00065140, -0.00000112, 0.00000000],
+		[-6.27261759, -0.00064796, 0.00039707, 0.00065126, -0.00000112, 0.00000000],
+		[-6.27261792, -0.00064782, 0.00039699, 0.00065113, -0.00000112, 0.00000000],
+		[-6.27261824, -0.00064769, 0.00039691, 0.00065099, -0.00000112, 0.00000000],
+		[-6.27261857, -0.00064755, 0.00039683, 0.00065086, -0.00000112, 0.00000000],
+		[-6.27261889, -0.00064742, 0.00039674, 0.00065072, -0.00000112, 0.00000000],
+		[-6.27261921, -0.00064728, 0.00039666, 0.00065058, -0.00000112, 0.00000000],
+		[-6.27261954, -0.00064715, 0.00039658, 0.00065045, -0.00000112, 0.00000000],
+		[-6.27261986, -0.00064701, 0.00039649, 0.00065031, -0.00000112, 0.00000000],
+		[-6.27262019, -0.00064687, 0.00039641, 0.00065018, -0.00000112, 0.00000000],
+		[-6.27262051, -0.00064674, 0.00039633, 0.00065004, -0.00000112, 0.00000000],
+		[-6.27262083, -0.00064660, 0.00039624, 0.00064990, -0.00000112, 0.00000000],
+		[-6.27262116, -0.00064647, 0.00039616, 0.00064977, -0.00000112, 0.00000000],
+		[-6.27262148, -0.00064633, 0.00039608, 0.00064963, -0.00000112, 0.00000000],
+		[-6.27262180, -0.00064620, 0.00039600, 0.00064950, -0.00000112, 0.00000000],
+		[-6.27262213, -0.00064606, 0.00039591, 0.00064936, -0.00000112, 0.00000000],
+		[-6.27262245, -0.00064593, 0.00039583, 0.00064923, -0.00000112, 0.00000000],
+		[-6.27262277, -0.00064579, 0.00039575, 0.00064909, -0.00000112, 0.00000000],
+		[-6.27262309, -0.00064566, 0.00039567, 0.00064895, -0.00000112, 0.00000000],
+		[-6.27262342, -0.00064553, 0.00039558, 0.00064882, -0.00000112, 0.00000000],
+		[-6.27262374, -0.00064539, 0.00039550, 0.00064868, -0.00000112, 0.00000000],
+		[-6.27262406, -0.00064526, 0.00039542, 0.00064855, -0.00000112, 0.00000000],
+		[-6.27262438, -0.00064512, 0.00039534, 0.00064841, -0.00000112, 0.00000000],
+		[-6.27262470, -0.00064499, 0.00039525, 0.00064828, -0.00000112, 0.00000000],
+		[-6.27262503, -0.00064485, 0.00039517, 0.00064814, -0.00000112, 0.00000000],
+		[-6.27262535, -0.00064472, 0.00039509, 0.00064801, -0.00000112, 0.00000000],
+		[-6.27262567, -0.00064458, 0.00039501, 0.00064787, -0.00000112, 0.00000000],
+		[-6.27262599, -0.00064445, 0.00039492, 0.00064774, -0.00000112, 0.00000000],
+		[-6.27262631, -0.00064432, 0.00039484, 0.00064760, -0.00000112, 0.00000000],
+		[-6.27262663, -0.00064418, 0.00039476, 0.00064747, -0.00000112, 0.00000000],
+		[-6.27262695, -0.00064405, 0.00039468, 0.00064733, -0.00000112, 0.00000000],
+		[-6.27262727, -0.00064391, 0.00039460, 0.00064720, -0.00000112, 0.00000000],
+		[-6.27262759, -0.00064378, 0.00039451, 0.00064706, -0.00000112, 0.00000000],
+		[-6.27262792, -0.00064365, 0.00039443, 0.00064693, -0.00000112, 0.00000000],
+		[-6.27262824, -0.00064351, 0.00039435, 0.00064680, -0.00000112, 0.00000000],
+		[-6.27262856, -0.00064338, 0.00039427, 0.00064666, -0.00000112, 0.00000000],
+		[-6.27262888, -0.00064325, 0.00039418, 0.00064653, -0.00000112, 0.00000000],
+		[-6.27262920, -0.00064311, 0.00039410, 0.00064639, -0.00000112, 0.00000000],
+		[-6.27262952, -0.00064298, 0.00039402, 0.00064626, -0.00000112, 0.00000000],
+		[-6.27262984, -0.00064284, 0.00039394, 0.00064612, -0.00000112, 0.00000000],
+		[-6.27263015, -0.00064271, 0.00039386, 0.00064599, -0.00000112, 0.00000000],
+		[-6.27263047, -0.00064258, 0.00039378, 0.00064586, -0.00000112, 0.00000000],
+		[-6.27263079, -0.00064244, 0.00039369, 0.00064572, -0.00000112, 0.00000000],
+		[-6.27263111, -0.00064231, 0.00039361, 0.00064559, -0.00000112, 0.00000000],
+		[-6.27263143, -0.00064218, 0.00039353, 0.00064545, -0.00000112, 0.00000000],
+		[-6.27263175, -0.00064204, 0.00039345, 0.00064532, -0.00000112, 0.00000000],
+		[-6.27263207, -0.00064191, 0.00039337, 0.00064519, -0.00000112, 0.00000000],
+		[-6.27263239, -0.00064178, 0.00039329, 0.00064505, -0.00000112, 0.00000000],
+		[-6.27263271, -0.00064165, 0.00039320, 0.00064492, -0.00000112, 0.00000000],
+		[-6.27263302, -0.00064151, 0.00039312, 0.00064478, -0.00000112, 0.00000000],
+		[-6.27263334, -0.00064138, 0.00039304, 0.00064465, -0.00000112, 0.00000000],
+		[-6.27263366, -0.00064125, 0.00039296, 0.00064452, -0.00000112, 0.00000000],
+		[-6.27263398, -0.00064111, 0.00039288, 0.00064438, -0.00000112, 0.00000000],
+		[-6.27263430, -0.00064098, 0.00039280, 0.00064425, -0.00000112, 0.00000000],
+		[-6.27263461, -0.00064085, 0.00039271, 0.00064412, -0.00000112, 0.00000000],
+		[-6.27263493, -0.00064072, 0.00039263, 0.00064398, -0.00000112, 0.00000000],
+		[-6.27263525, -0.00064058, 0.00039255, 0.00064385, -0.00000112, 0.00000000],
+		[-6.27263557, -0.00064045, 0.00039247, 0.00064372, -0.00000112, 0.00000000],
+		[-6.27263588, -0.00064032, 0.00039239, 0.00064358, -0.00000112, 0.00000000],
+		[-6.27263620, -0.00064019, 0.00039231, 0.00064345, -0.00000112, 0.00000000],
+		[-6.27263652, -0.00064005, 0.00039223, 0.00064332, -0.00000112, 0.00000000],
+		[-6.27263683, -0.00063992, 0.00039215, 0.00064319, -0.00000112, 0.00000000],
+		[-6.27263715, -0.00063979, 0.00039206, 0.00064305, -0.00000112, 0.00000000],
+		[-6.27263747, -0.00063966, 0.00039198, 0.00064292, -0.00000112, 0.00000000],
+		[-6.27263778, -0.00063952, 0.00039190, 0.00064279, -0.00000112, 0.00000000],
+		[-6.27263810, -0.00063939, 0.00039182, 0.00064265, -0.00000112, 0.00000000],
+		[-6.27263842, -0.00063926, 0.00039174, 0.00064252, -0.00000112, 0.00000000],
+		[-6.27263873, -0.00063913, 0.00039166, 0.00064239, -0.00000112, 0.00000000],
+		[-6.27263905, -0.00063900, 0.00039158, 0.00064226, -0.00000112, 0.00000000],
+		[-6.27263936, -0.00063886, 0.00039150, 0.00064212, -0.00000112, 0.00000000],
+		[-6.27263968, -0.00063873, 0.00039142, 0.00064199, -0.00000112, 0.00000000],
+		[-6.27263999, -0.00063860, 0.00039134, 0.00064186, -0.00000112, 0.00000000],
+		[-6.27264031, -0.00063847, 0.00039126, 0.00064173, -0.00000112, 0.00000000],
+		[-6.27264063, -0.00063834, 0.00039117, 0.00064159, -0.00000112, 0.00000000],
+		[-6.27264094, -0.00063821, 0.00039109, 0.00064146, -0.00000112, 0.00000000],
+		[-6.27264126, -0.00063807, 0.00039101, 0.00064133, -0.00000112, 0.00000000],
+		[-6.27264157, -0.00063794, 0.00039093, 0.00064120, -0.00000112, 0.00000000],
+		[-6.27264188, -0.00063781, 0.00039085, 0.00064106, -0.00000112, 0.00000000],
+		[-6.27264220, -0.00063768, 0.00039077, 0.00064093, -0.00000112, 0.00000000],
+		[-6.27264251, -0.00063755, 0.00039069, 0.00064080, -0.00000113, 0.00000000],
+		[-6.27264283, -0.00063742, 0.00039061, 0.00064067, -0.00000113, 0.00000000],
+		[-6.27264314, -0.00063729, 0.00039053, 0.00064054, -0.00000113, 0.00000000],
+		[-6.27264346, -0.00063716, 0.00039045, 0.00064040, -0.00000113, 0.00000000],
+		[-6.27264377, -0.00063702, 0.00039037, 0.00064027, -0.00000113, 0.00000000],
+		[-6.27264408, -0.00063689, 0.00039029, 0.00064014, -0.00000113, 0.00000000],
+		[-6.27264440, -0.00063676, 0.00039021, 0.00064001, -0.00000113, 0.00000000],
+		[-6.27264471, -0.00063663, 0.00039013, 0.00063988, -0.00000113, 0.00000000],
+		[-6.27264502, -0.00063650, 0.00039005, 0.00063975, -0.00000113, 0.00000000],
+		[-6.27264534, -0.00063637, 0.00038997, 0.00063961, -0.00000113, 0.00000000],
+		[-6.27264565, -0.00063624, 0.00038989, 0.00063948, -0.00000113, 0.00000000],
+		[-6.27264596, -0.00063611, 0.00038981, 0.00063935, -0.00000113, 0.00000000],
+		[-6.27264628, -0.00063598, 0.00038973, 0.00063922, -0.00000113, 0.00000000],
+		[-6.27264659, -0.00063585, 0.00038965, 0.00063909, -0.00000113, 0.00000000],
+		[-6.27264690, -0.00063572, 0.00038957, 0.00063896, -0.00000113, 0.00000000],
+		[-6.27264721, -0.00063559, 0.00038949, 0.00063883, -0.00000113, 0.00000000],
+		[-6.27264753, -0.00063545, 0.00038941, 0.00063870, -0.00000113, 0.00000000],
+		[-6.27264784, -0.00063532, 0.00038933, 0.00063856, -0.00000113, 0.00000000],
+		[-6.27264815, -0.00063519, 0.00038925, 0.00063843, -0.00000113, 0.00000000],
+		[-6.27264846, -0.00063506, 0.00038917, 0.00063830, -0.00000113, 0.00000000],
+		[-6.27264877, -0.00063493, 0.00038909, 0.00063817, -0.00000113, 0.00000000],
+		[-6.27264909, -0.00063480, 0.00038901, 0.00063804, -0.00000113, 0.00000000],
+		[-6.27264940, -0.00063467, 0.00038893, 0.00063791, -0.00000113, 0.00000000],
+		[-6.27264971, -0.00063454, 0.00038885, 0.00063778, -0.00000113, 0.00000000],
+		[-6.27265002, -0.00063441, 0.00038877, 0.00063765, -0.00000113, 0.00000000],
+		[-6.27265033, -0.00063428, 0.00038869, 0.00063752, -0.00000113, 0.00000000],
+		[-6.27265064, -0.00063415, 0.00038861, 0.00063739, -0.00000113, 0.00000000],
+		[-6.27265095, -0.00063402, 0.00038853, 0.00063726, -0.00000113, 0.00000000],
+		[-6.27265126, -0.00063389, 0.00038845, 0.00063713, -0.00000113, 0.00000000],
+		[-6.27265157, -0.00063376, 0.00038837, 0.00063700, -0.00000113, 0.00000000],
+		[-6.27265189, -0.00063363, 0.00038829, 0.00063686, -0.00000113, 0.00000000],
+		[-6.27265220, -0.00063350, 0.00038821, 0.00063673, -0.00000113, 0.00000000],
+		[-6.27265251, -0.00063337, 0.00038813, 0.00063660, -0.00000113, 0.00000000],
+		[-6.27265282, -0.00063324, 0.00038805, 0.00063647, -0.00000113, 0.00000000],
+		[-6.27265313, -0.00063312, 0.00038797, 0.00063634, -0.00000113, 0.00000000],
+		[-6.27265344, -0.00063299, 0.00038789, 0.00063621, -0.00000113, 0.00000000],
+		[-6.27265375, -0.00063286, 0.00038781, 0.00063608, -0.00000113, 0.00000000],
+		[-6.27265406, -0.00063273, 0.00038773, 0.00063595, -0.00000113, 0.00000000],
+		[-6.27265436, -0.00063260, 0.00038765, 0.00063582, -0.00000113, 0.00000000],
+		[-6.27265467, -0.00063247, 0.00038758, 0.00063569, -0.00000113, 0.00000000],
+		[-6.27265498, -0.00063234, 0.00038750, 0.00063556, -0.00000113, 0.00000000],
+		[-6.27265529, -0.00063221, 0.00038742, 0.00063543, -0.00000113, 0.00000000],
+		[-6.27265560, -0.00063208, 0.00038734, 0.00063530, -0.00000113, 0.00000000],
+		[-6.27265591, -0.00063195, 0.00038726, 0.00063517, -0.00000113, 0.00000000],
+		[-6.27265622, -0.00063182, 0.00038718, 0.00063504, -0.00000113, 0.00000000],
+		[-6.27265653, -0.00063169, 0.00038710, 0.00063492, -0.00000113, 0.00000000],
+		[-6.27265684, -0.00063157, 0.00038702, 0.00063479, -0.00000113, 0.00000000],
+		[-6.27265714, -0.00063144, 0.00038694, 0.00063466, -0.00000113, 0.00000000],
+		[-6.27265745, -0.00063131, 0.00038686, 0.00063453, -0.00000113, 0.00000000],
+		[-6.27265776, -0.00063118, 0.00038678, 0.00063440, -0.00000113, 0.00000000],
+		[-6.27265807, -0.00063105, 0.00038671, 0.00063427, -0.00000113, 0.00000000],
+		[-6.27265838, -0.00063092, 0.00038663, 0.00063414, -0.00000113, 0.00000000],
+		[-6.27265868, -0.00063079, 0.00038655, 0.00063401, -0.00000113, 0.00000000],
+		[-6.27265899, -0.00063066, 0.00038647, 0.00063388, -0.00000113, 0.00000000],
+		[-6.27265930, -0.00063054, 0.00038639, 0.00063375, -0.00000113, 0.00000000],
+		[-6.27265961, -0.00063041, 0.00038631, 0.00063362, -0.00000113, 0.00000000],
+		[-6.27265991, -0.00063028, 0.00038623, 0.00063349, -0.00000113, 0.00000000],
+		[-6.27266022, -0.00063015, 0.00038615, 0.00063336, -0.00000113, 0.00000000],
+		[-6.27266053, -0.00063002, 0.00038608, 0.00063323, -0.00000113, 0.00000000],
+		[-6.27266083, -0.00062989, 0.00038600, 0.00063311, -0.00000113, 0.00000000],
+		[-6.27266114, -0.00062977, 0.00038592, 0.00063298, -0.00000113, 0.00000000],
+		[-6.27266145, -0.00062964, 0.00038584, 0.00063285, -0.00000113, 0.00000000],
+		[-6.27266175, -0.00062951, 0.00038576, 0.00063272, -0.00000113, 0.00000000],
+		[-6.27266206, -0.00062938, 0.00038568, 0.00063259, -0.00000113, 0.00000000],
+		[-6.27266237, -0.00062925, 0.00038560, 0.00063246, -0.00000113, 0.00000000],
+		[-6.27266267, -0.00062913, 0.00038553, 0.00063233, -0.00000113, 0.00000000],
+		[-6.27266298, -0.00062900, 0.00038545, 0.00063221, -0.00000113, 0.00000000],
+		[-6.27266329, -0.00062887, 0.00038537, 0.00063208, -0.00000113, 0.00000000],
+		[-6.27266359, -0.00062874, 0.00038529, 0.00063195, -0.00000113, 0.00000000],
+		[-6.27266390, -0.00062862, 0.00038521, 0.00063182, -0.00000113, 0.00000000],
+		[-6.27266420, -0.00062849, 0.00038513, 0.00063169, -0.00000113, 0.00000000],
+		[-6.27266451, -0.00062836, 0.00038506, 0.00063156, -0.00000113, 0.00000000],
+		[-6.27266481, -0.00062823, 0.00038498, 0.00063144, -0.00000113, 0.00000000],
+		[-6.27266512, -0.00062811, 0.00038490, 0.00063131, -0.00000113, 0.00000000],
+		[-6.27266542, -0.00062798, 0.00038482, 0.00063118, -0.00000113, 0.00000000],
+		[-6.27266573, -0.00062785, 0.00038474, 0.00063105, -0.00000113, 0.00000000],
+		[-6.27266603, -0.00062772, 0.00038467, 0.00063092, -0.00000113, 0.00000000],
+		[-6.27266634, -0.00062760, 0.00038459, 0.00063080, -0.00000113, 0.00000000],
+		[-6.27266664, -0.00062747, 0.00038451, 0.00063067, -0.00000113, 0.00000000],
+		[-6.27266695, -0.00062734, 0.00038443, 0.00063054, -0.00000113, 0.00000000],
+		[-6.27266725, -0.00062721, 0.00038435, 0.00063041, -0.00000113, 0.00000000],
+		[-6.27266755, -0.00062709, 0.00038428, 0.00063028, -0.00000113, 0.00000000],
+		[-6.27266786, -0.00062696, 0.00038420, 0.00063016, -0.00000113, 0.00000000],
+		[-6.27266816, -0.00062683, 0.00038412, 0.00063003, -0.00000113, 0.00000000],
+		[-6.27266847, -0.00062671, 0.00038404, 0.00062990, -0.00000113, 0.00000000],
+		[-6.27266877, -0.00062658, 0.00038396, 0.00062977, -0.00000113, 0.00000000],
+		[-6.27266907, -0.00062645, 0.00038389, 0.00062965, -0.00000113, 0.00000000],
+		[-6.27266938, -0.00062633, 0.00038381, 0.00062952, -0.00000113, 0.00000000],
+		[-6.27266968, -0.00062620, 0.00038373, 0.00062939, -0.00000113, 0.00000000],
+		[-6.27266998, -0.00062607, 0.00038365, 0.00062926, -0.00000113, 0.00000000],
+		[-6.27267028, -0.00062595, 0.00038358, 0.00062914, -0.00000113, 0.00000000],
+		[-6.27267059, -0.00062582, 0.00038350, 0.00062901, -0.00000113, 0.00000000],
+		[-6.27267089, -0.00062569, 0.00038342, 0.00062888, -0.00000113, 0.00000000],
+		[-6.27267119, -0.00062557, 0.00038334, 0.00062876, -0.00000113, 0.00000000],
+		[-6.27267150, -0.00062544, 0.00038327, 0.00062863, -0.00000113, 0.00000000],
+		[-6.27267180, -0.00062531, 0.00038319, 0.00062850, -0.00000113, 0.00000000],
+		[-6.27267210, -0.00062519, 0.00038311, 0.00062837, -0.00000113, 0.00000000],
+		[-6.27267240, -0.00062506, 0.00038303, 0.00062825, -0.00000113, 0.00000000],
+		[-6.27267270, -0.00062494, 0.00038296, 0.00062812, -0.00000113, 0.00000000],
+		[-6.27267301, -0.00062481, 0.00038288, 0.00062799, -0.00000113, 0.00000000],
+		[-6.27267331, -0.00062468, 0.00038280, 0.00062787, -0.00000113, 0.00000000],
+		[-6.27267361, -0.00062456, 0.00038272, 0.00062774, -0.00000113, 0.00000000],
+		[-6.27267391, -0.00062443, 0.00038265, 0.00062761, -0.00000113, 0.00000000],
+		[-6.27267421, -0.00062431, 0.00038257, 0.00062749, -0.00000113, 0.00000000],
+		[-6.27267451, -0.00062418, 0.00038249, 0.00062736, -0.00000113, 0.00000000],
+		[-6.27267481, -0.00062405, 0.00038241, 0.00062723, -0.00000113, 0.00000000],
+		[-6.27267512, -0.00062393, 0.00038234, 0.00062711, -0.00000113, 0.00000000],
+		[-6.27267542, -0.00062380, 0.00038226, 0.00062698, -0.00000113, 0.00000000],
+		[-6.27267572, -0.00062368, 0.00038218, 0.00062685, -0.00000113, 0.00000000],
+		[-6.27267602, -0.00062355, 0.00038211, 0.00062673, -0.00000113, 0.00000000],
+		[-6.27267632, -0.00062342, 0.00038203, 0.00062660, -0.00000113, 0.00000000],
+		[-6.27267662, -0.00062330, 0.00038195, 0.00062648, -0.00000113, 0.00000000],
+		[-6.27267692, -0.00062317, 0.00038188, 0.00062635, -0.00000113, 0.00000000],
+		[-6.27267722, -0.00062305, 0.00038180, 0.00062622, -0.00000113, 0.00000000],
+		[-6.27267752, -0.00062292, 0.00038172, 0.00062610, -0.00000113, 0.00000000],
+		[-6.27267782, -0.00062280, 0.00038164, 0.00062597, -0.00000113, 0.00000000],
+		[-6.27267812, -0.00062267, 0.00038157, 0.00062585, -0.00000113, 0.00000000],
+		[-6.27267842, -0.00062255, 0.00038149, 0.00062572, -0.00000113, 0.00000000],
+		[-6.27267872, -0.00062242, 0.00038141, 0.00062559, -0.00000113, 0.00000000],
+		[-6.27267902, -0.00062230, 0.00038134, 0.00062547, -0.00000113, 0.00000000],
+		[-6.27267932, -0.00062217, 0.00038126, 0.00062534, -0.00000113, 0.00000000],
+		[-6.27267962, -0.00062205, 0.00038118, 0.00062522, -0.00000113, 0.00000000],
+		[-6.27267992, -0.00062192, 0.00038111, 0.00062509, -0.00000113, 0.00000000],
+		[-6.27268021, -0.00062180, 0.00038103, 0.00062497, -0.00000113, 0.00000000],
+		[-6.27268051, -0.00062167, 0.00038095, 0.00062484, -0.00000113, 0.00000000],
+		[-6.27268081, -0.00062155, 0.00038088, 0.00062471, -0.00000113, 0.00000000],
+		[-6.27268111, -0.00062142, 0.00038080, 0.00062459, -0.00000113, 0.00000000],
+		[-6.27268141, -0.00062130, 0.00038072, 0.00062446, -0.00000113, 0.00000000],
+		[-6.27268171, -0.00062117, 0.00038065, 0.00062434, -0.00000113, 0.00000000],
+		[-6.27268201, -0.00062105, 0.00038057, 0.00062421, -0.00000113, 0.00000000],
+		[-6.27268230, -0.00062092, 0.00038050, 0.00062409, -0.00000113, 0.00000000],
+		[-6.27268260, -0.00062080, 0.00038042, 0.00062396, -0.00000113, 0.00000000],
+		[-6.27268290, -0.00062067, 0.00038034, 0.00062384, -0.00000113, 0.00000000],
+		[-6.27268320, -0.00062055, 0.00038027, 0.00062371, -0.00000113, 0.00000000],
+		[-6.27268350, -0.00062043, 0.00038019, 0.00062359, -0.00000113, 0.00000000],
+		[-6.27268379, -0.00062030, 0.00038011, 0.00062346, -0.00000113, 0.00000000],
+		[-6.27268409, -0.00062018, 0.00038004, 0.00062334, -0.00000113, 0.00000000],
+		[-6.27268439, -0.00062005, 0.00037996, 0.00062321, -0.00000113, 0.00000000],
+		[-6.27268468, -0.00061993, 0.00037989, 0.00062309, -0.00000113, 0.00000000],
+		[-6.27268498, -0.00061980, 0.00037981, 0.00062296, -0.00000113, 0.00000000],
+		[-6.27268528, -0.00061968, 0.00037973, 0.00062284, -0.00000113, 0.00000000],
+		[-6.27268558, -0.00061956, 0.00037966, 0.00062271, -0.00000113, 0.00000000],
+		[-6.27268587, -0.00061943, 0.00037958, 0.00062259, -0.00000113, 0.00000000],
+		[-6.27268617, -0.00061931, 0.00037951, 0.00062246, -0.00000113, 0.00000000],
+		[-6.27268647, -0.00061919, 0.00037943, 0.00062234, -0.00000113, 0.00000000],
+		[-6.27268676, -0.00061906, 0.00037935, 0.00062222, -0.00000113, 0.00000000],
+		[-6.27268706, -0.00061894, 0.00037928, 0.00062209, -0.00000113, 0.00000000],
+		[-6.27268735, -0.00061881, 0.00037920, 0.00062197, -0.00000113, 0.00000000],
+		[-6.27268765, -0.00061869, 0.00037913, 0.00062184, -0.00000113, 0.00000000],
+		[-6.27268795, -0.00061857, 0.00037905, 0.00062172, -0.00000113, 0.00000000],
+		[-6.27268824, -0.00061844, 0.00037897, 0.00062159, -0.00000113, 0.00000000],
+		[-6.27268854, -0.00061832, 0.00037890, 0.00062147, -0.00000113, 0.00000000],
+		[-6.27268883, -0.00061820, 0.00037882, 0.00062135, -0.00000113, 0.00000000],
+		[-6.27268913, -0.00061807, 0.00037875, 0.00062122, -0.00000113, 0.00000000],
+		[-6.27268942, -0.00061795, 0.00037867, 0.00062110, -0.00000113, 0.00000000],
+		[-6.27268972, -0.00061783, 0.00037860, 0.00062097, -0.00000113, 0.00000000],
+		[-6.27269001, -0.00061770, 0.00037852, 0.00062085, -0.00000113, 0.00000000],
+		[-6.27269031, -0.00061758, 0.00037844, 0.00062073, -0.00000113, 0.00000000],
+		[-6.27269060, -0.00061746, 0.00037837, 0.00062060, -0.00000113, 0.00000000],
+		[-6.27269090, -0.00061733, 0.00037829, 0.00062048, -0.00000113, 0.00000000],
+		[-6.27269119, -0.00061721, 0.00037822, 0.00062035, -0.00000113, 0.00000000],
+		[-6.27269149, -0.00061709, 0.00037814, 0.00062023, -0.00000113, 0.00000000],
+		[-6.27269178, -0.00061696, 0.00037807, 0.00062011, -0.00000113, 0.00000000],
+		[-6.27269208, -0.00061684, 0.00037799, 0.00061998, -0.00000113, 0.00000000],
+		[-6.27269237, -0.00061672, 0.00037792, 0.00061986, -0.00000113, 0.00000000],
+		[-6.27269266, -0.00061660, 0.00037784, 0.00061974, -0.00000113, 0.00000000],
+		[-6.27269296, -0.00061647, 0.00037777, 0.00061961, -0.00000113, 0.00000000],
+		[-6.27269325, -0.00061635, 0.00037769, 0.00061949, -0.00000113, 0.00000000],
+		[-6.27269354, -0.00061623, 0.00037762, 0.00061937, -0.00000113, 0.00000000],
+		[-6.27269384, -0.00061610, 0.00037754, 0.00061924, -0.00000113, 0.00000000],
+		[-6.27269413, -0.00061598, 0.00037746, 0.00061912, -0.00000113, 0.00000000],
+		[-6.27269442, -0.00061586, 0.00037739, 0.00061900, -0.00000113, 0.00000000],
+		[-6.27269472, -0.00061574, 0.00037731, 0.00061887, -0.00000113, 0.00000000],
+		[-6.27269501, -0.00061561, 0.00037724, 0.00061875, -0.00000113, 0.00000000],
+		[-6.27269530, -0.00061549, 0.00037716, 0.00061863, -0.00000113, 0.00000000],
+		[-6.27269560, -0.00061537, 0.00037709, 0.00061850, -0.00000113, 0.00000000],
+		[-6.27269589, -0.00061525, 0.00037701, 0.00061838, -0.00000113, 0.00000000],
+		[-6.27269618, -0.00061512, 0.00037694, 0.00061826, -0.00000113, 0.00000000],
+		[-6.27269647, -0.00061500, 0.00037686, 0.00061814, -0.00000113, 0.00000000],
+		[-6.27269677, -0.00061488, 0.00037679, 0.00061801, -0.00000113, 0.00000000],
+		[-6.27269706, -0.00061476, 0.00037671, 0.00061789, -0.00000113, 0.00000000],
+		[-6.27269735, -0.00061464, 0.00037664, 0.00061777, -0.00000113, 0.00000000],
+		[-6.27269764, -0.00061451, 0.00037656, 0.00061764, -0.00000113, 0.00000000],
+		[-6.27269793, -0.00061439, 0.00037649, 0.00061752, -0.00000113, 0.00000000],
+		[-6.27269823, -0.00061427, 0.00037642, 0.00061740, -0.00000113, 0.00000000],
+		[-6.27269852, -0.00061415, 0.00037634, 0.00061728, -0.00000113, 0.00000000],
+		[-6.27269881, -0.00061403, 0.00037627, 0.00061715, -0.00000113, 0.00000000],
+		[-6.27269910, -0.00061390, 0.00037619, 0.00061703, -0.00000113, 0.00000000],
+		[-6.27269939, -0.00061378, 0.00037612, 0.00061691, -0.00000113, 0.00000000],
+		[-6.27269968, -0.00061366, 0.00037604, 0.00061679, -0.00000113, 0.00000000],
+		[-6.27269997, -0.00061354, 0.00037597, 0.00061667, -0.00000113, 0.00000000],
+		[-6.27270027, -0.00061342, 0.00037589, 0.00061654, -0.00000113, 0.00000000],
+		[-6.27270056, -0.00061330, 0.00037582, 0.00061642, -0.00000113, 0.00000000],
+		[-6.27270085, -0.00061318, 0.00037574, 0.00061630, -0.00000113, 0.00000000],
+		[-6.27270114, -0.00061305, 0.00037567, 0.00061618, -0.00000113, 0.00000000],
+		[-6.27270143, -0.00061293, 0.00037559, 0.00061605, -0.00000113, 0.00000000],
+		[-6.27270172, -0.00061281, 0.00037552, 0.00061593, -0.00000113, 0.00000000],
+		[-6.27270201, -0.00061269, 0.00037545, 0.00061581, -0.00000113, 0.00000000],
+		[-6.27270230, -0.00061257, 0.00037537, 0.00061569, -0.00000113, 0.00000000],
+		[-6.27270259, -0.00061245, 0.00037530, 0.00061557, -0.00000113, 0.00000000],
+		[-6.27270288, -0.00061233, 0.00037522, 0.00061545, -0.00000113, 0.00000000],
+		[-6.27270317, -0.00061221, 0.00037515, 0.00061532, -0.00000113, 0.00000000],
+		[-6.27270346, -0.00061208, 0.00037507, 0.00061520, -0.00000113, 0.00000000],
+		[-6.27270375, -0.00061196, 0.00037500, 0.00061508, -0.00000113, 0.00000000],
+		[-6.27270404, -0.00061184, 0.00037493, 0.00061496, -0.00000113, 0.00000000],
+		[-6.27270433, -0.00061172, 0.00037485, 0.00061484, -0.00000113, 0.00000000],
+		[-6.27270462, -0.00061160, 0.00037478, 0.00061472, -0.00000113, 0.00000000],
+		[-6.27270490, -0.00061148, 0.00037470, 0.00061459, -0.00000113, 0.00000000],
+		[-6.27270519, -0.00061136, 0.00037463, 0.00061447, -0.00000113, 0.00000000],
+		[-6.27270548, -0.00061124, 0.00037456, 0.00061435, -0.00000113, 0.00000000],
+		[-6.27270577, -0.00061112, 0.00037448, 0.00061423, -0.00000113, 0.00000000],
+		[-6.27270606, -0.00061100, 0.00037441, 0.00061411, -0.00000113, 0.00000000],
+		[-6.27270635, -0.00061088, 0.00037433, 0.00061399, -0.00000113, 0.00000000],
+		[-6.27270664, -0.00061076, 0.00037426, 0.00061387, -0.00000113, 0.00000000],
+		[-6.27270692, -0.00061064, 0.00037419, 0.00061375, -0.00000113, 0.00000000],
+		[-6.27270721, -0.00061051, 0.00037411, 0.00061362, -0.00000113, 0.00000000],
+		[-6.27270750, -0.00061039, 0.00037404, 0.00061350, -0.00000113, 0.00000000],
+		[-6.27270779, -0.00061027, 0.00037396, 0.00061338, -0.00000113, 0.00000000],
+		[-6.27270808, -0.00061015, 0.00037389, 0.00061326, -0.00000113, 0.00000000],
+		[-6.27270836, -0.00061003, 0.00037382, 0.00061314, -0.00000113, 0.00000000],
+		[-6.27270865, -0.00060991, 0.00037374, 0.00061302, -0.00000113, 0.00000000],
+		[-6.27270894, -0.00060979, 0.00037367, 0.00061290, -0.00000113, 0.00000000],
+		[-6.27270923, -0.00060967, 0.00037360, 0.00061278, -0.00000113, 0.00000000],
+		[-6.27270951, -0.00060955, 0.00037352, 0.00061266, -0.00000113, 0.00000000],
+		[-6.27270980, -0.00060943, 0.00037345, 0.00061254, -0.00000113, 0.00000000],
+		[-6.27271009, -0.00060931, 0.00037338, 0.00061242, -0.00000113, 0.00000000],
+		[-6.27271038, -0.00060919, 0.00037330, 0.00061230, -0.00000113, 0.00000000],
+		[-6.27271066, -0.00060907, 0.00037323, 0.00061218, -0.00000113, 0.00000000],
+		[-6.27271095, -0.00060895, 0.00037315, 0.00061205, -0.00000113, 0.00000000],
+		[-6.27271124, -0.00060883, 0.00037308, 0.00061193, -0.00000113, 0.00000000],
+		[-6.27271152, -0.00060871, 0.00037301, 0.00061181, -0.00000113, 0.00000000],
+		[-6.27271181, -0.00060859, 0.00037293, 0.00061169, -0.00000113, 0.00000000],
+		[-6.27271209, -0.00060847, 0.00037286, 0.00061157, -0.00000113, 0.00000000],
+		[-6.27271238, -0.00060836, 0.00037279, 0.00061145, -0.00000113, 0.00000000],
+		[-6.27271267, -0.00060824, 0.00037271, 0.00061133, -0.00000113, 0.00000000],
+		[-6.27271295, -0.00060812, 0.00037264, 0.00061121, -0.00000113, 0.00000000],
+		[-6.27271324, -0.00060800, 0.00037257, 0.00061109, -0.00000113, 0.00000000],
+		[-6.27271352, -0.00060788, 0.00037249, 0.00061097, -0.00000113, 0.00000000],
+		[-6.27271381, -0.00060776, 0.00037242, 0.00061085, -0.00000113, 0.00000000],
+		[-6.27271410, -0.00060764, 0.00037235, 0.00061073, -0.00000113, 0.00000000],
+		[-6.27271438, -0.00060752, 0.00037228, 0.00061061, -0.00000113, 0.00000000],
+		[-6.27271467, -0.00060740, 0.00037220, 0.00061049, -0.00000113, 0.00000000],
+		[-6.27271495, -0.00060728, 0.00037213, 0.00061037, -0.00000113, 0.00000000],
+		[-6.27271524, -0.00060716, 0.00037206, 0.00061025, -0.00000113, 0.00000000],
+		[-6.27271552, -0.00060704, 0.00037198, 0.00061013, -0.00000113, 0.00000000],
+		[-6.27271581, -0.00060692, 0.00037191, 0.00061001, -0.00000113, 0.00000000],
+		[-6.27271609, -0.00060680, 0.00037184, 0.00060989, -0.00000113, 0.00000000],
+		[-6.27271637, -0.00060669, 0.00037176, 0.00060978, -0.00000113, 0.00000000],
+		[-6.27271666, -0.00060657, 0.00037169, 0.00060966, -0.00000113, 0.00000000],
+		[-6.27271694, -0.00060645, 0.00037162, 0.00060954, -0.00000113, 0.00000000],
+		[-6.27271723, -0.00060633, 0.00037155, 0.00060942, -0.00000113, 0.00000000],
+		[-6.27271751, -0.00060621, 0.00037147, 0.00060930, -0.00000113, 0.00000000],
+		[-6.27271780, -0.00060609, 0.00037140, 0.00060918, -0.00000113, 0.00000000],
+		[-6.27271808, -0.00060597, 0.00037133, 0.00060906, -0.00000113, 0.00000000],
+		[-6.27271836, -0.00060585, 0.00037125, 0.00060894, -0.00000113, 0.00000000],
+		[-6.27271865, -0.00060574, 0.00037118, 0.00060882, -0.00000113, 0.00000000],
+		[-6.27271893, -0.00060562, 0.00037111, 0.00060870, -0.00000113, 0.00000000],
+		[-6.27271921, -0.00060550, 0.00037104, 0.00060858, -0.00000113, 0.00000000],
+		[-6.27271950, -0.00060538, 0.00037096, 0.00060846, -0.00000113, 0.00000000],
+		[-6.27271978, -0.00060526, 0.00037089, 0.00060834, -0.00000113, 0.00000000],
+		[-6.27272006, -0.00060514, 0.00037082, 0.00060823, -0.00000113, 0.00000000],
+		[-6.27272035, -0.00060503, 0.00037075, 0.00060811, -0.00000113, 0.00000000],
+		[-6.27272063, -0.00060491, 0.00037067, 0.00060799, -0.00000113, 0.00000000],
+		[-6.27272091, -0.00060479, 0.00037060, 0.00060787, -0.00000113, 0.00000000],
+		[-6.27272120, -0.00060467, 0.00037053, 0.00060775, -0.00000113, 0.00000000],
+		[-6.27272148, -0.00060455, 0.00037046, 0.00060763, -0.00000113, 0.00000000],
+		[-6.27272176, -0.00060444, 0.00037038, 0.00060751, -0.00000113, 0.00000000],
+		[-6.27272204, -0.00060432, 0.00037031, 0.00060739, -0.00000113, 0.00000000],
+		[-6.27272232, -0.00060420, 0.00037024, 0.00060728, -0.00000113, 0.00000000],
+		[-6.27272261, -0.00060408, 0.00037017, 0.00060716, -0.00000113, 0.00000000],
+		[-6.27272289, -0.00060396, 0.00037009, 0.00060704, -0.00000113, 0.00000000],
+		[-6.27272317, -0.00060385, 0.00037002, 0.00060692, -0.00000113, 0.00000000],
+		[-6.27272345, -0.00060373, 0.00036995, 0.00060680, -0.00000113, 0.00000000],
+		[-6.27272373, -0.00060361, 0.00036988, 0.00060668, -0.00000113, 0.00000000],
+		[-6.27272402, -0.00060349, 0.00036981, 0.00060657, -0.00000113, 0.00000000],
+		[-6.27272430, -0.00060337, 0.00036973, 0.00060645, -0.00000113, 0.00000000],
+		[-6.27272458, -0.00060326, 0.00036966, 0.00060633, -0.00000113, 0.00000000],
+		[-6.27272486, -0.00060314, 0.00036959, 0.00060621, -0.00000113, 0.00000000],
+		[-6.27272514, -0.00060302, 0.00036952, 0.00060609, -0.00000113, 0.00000000],
+		[-6.27272542, -0.00060290, 0.00036945, 0.00060597, -0.00000113, 0.00000000],
+		[-6.27272570, -0.00060279, 0.00036937, 0.00060586, -0.00000113, 0.00000000],
+		[-6.27272598, -0.00060267, 0.00036930, 0.00060574, -0.00000113, 0.00000000],
+		[-6.27272626, -0.00060255, 0.00036923, 0.00060562, -0.00000113, 0.00000000],
+		[-6.27272654, -0.00060244, 0.00036916, 0.00060550, -0.00000113, 0.00000000],
+		[-6.27272683, -0.00060232, 0.00036909, 0.00060538, -0.00000113, 0.00000000],
+		[-6.27272711, -0.00060220, 0.00036901, 0.00060527, -0.00000113, 0.00000000],
+		[-6.27272739, -0.00060208, 0.00036894, 0.00060515, -0.00000113, 0.00000000],
+		[-6.27272767, -0.00060197, 0.00036887, 0.00060503, -0.00000113, 0.00000000],
+		[-6.27272795, -0.00060185, 0.00036880, 0.00060491, -0.00000113, 0.00000000],
+		[-6.27272823, -0.00060173, 0.00036873, 0.00060480, -0.00000113, 0.00000000],
+		[-6.27272851, -0.00060162, 0.00036865, 0.00060468, -0.00000113, 0.00000000],
+		[-6.27272879, -0.00060150, 0.00036858, 0.00060456, -0.00000113, 0.00000000],
+		[-6.27272907, -0.00060138, 0.00036851, 0.00060444, -0.00000113, 0.00000000],
+		[-6.27272934, -0.00060127, 0.00036844, 0.00060433, -0.00000113, 0.00000000],
+		[-6.27272962, -0.00060115, 0.00036837, 0.00060421, -0.00000113, 0.00000000],
+		[-6.27272990, -0.00060103, 0.00036830, 0.00060409, -0.00000113, 0.00000000],
+		[-6.27273018, -0.00060092, 0.00036823, 0.00060397, -0.00000113, 0.00000000],
+		[-6.27273046, -0.00060080, 0.00036815, 0.00060386, -0.00000113, 0.00000000],
+		[-6.27273074, -0.00060068, 0.00036808, 0.00060374, -0.00000113, 0.00000000],
+		[-6.27273102, -0.00060057, 0.00036801, 0.00060362, -0.00000113, 0.00000000],
+		[-6.27273130, -0.00060045, 0.00036794, 0.00060351, -0.00000113, 0.00000000],
+		[-6.27273158, -0.00060033, 0.00036787, 0.00060339, -0.00000113, 0.00000000],
+		[-6.27273186, -0.00060022, 0.00036780, 0.00060327, -0.00000113, 0.00000000],
+		[-6.27273213, -0.00060010, 0.00036773, 0.00060315, -0.00000113, 0.00000000],
+		[-6.27273241, -0.00059998, 0.00036765, 0.00060304, -0.00000113, 0.00000000],
+		[-6.27273269, -0.00059987, 0.00036758, 0.00060292, -0.00000113, 0.00000000],
+		[-6.27273297, -0.00059975, 0.00036751, 0.00060280, -0.00000113, 0.00000000],
+		[-6.27273325, -0.00059963, 0.00036744, 0.00060269, -0.00000113, 0.00000000],
+		[-6.27273352, -0.00059952, 0.00036737, 0.00060257, -0.00000113, 0.00000000],
+		[-6.27273380, -0.00059940, 0.00036730, 0.00060245, -0.00000113, 0.00000000],
+		[-6.27273408, -0.00059929, 0.00036723, 0.00060234, -0.00000113, 0.00000000],
+		[-6.27273436, -0.00059917, 0.00036716, 0.00060222, -0.00000113, 0.00000000],
+		[-6.27273463, -0.00059905, 0.00036708, 0.00060210, -0.00000113, 0.00000000],
+		[-6.27273491, -0.00059894, 0.00036701, 0.00060199, -0.00000113, 0.00000000],
+		[-6.27273519, -0.00059882, 0.00036694, 0.00060187, -0.00000113, 0.00000000],
+		[-6.27273547, -0.00059871, 0.00036687, 0.00060175, -0.00000113, 0.00000000],
+		[-6.27273574, -0.00059859, 0.00036680, 0.00060164, -0.00000113, 0.00000000],
+		[-6.27273602, -0.00059848, 0.00036673, 0.00060152, -0.00000113, 0.00000000],
+		[-6.27273630, -0.00059836, 0.00036666, 0.00060141, -0.00000113, 0.00000000],
+		[-6.27273657, -0.00059824, 0.00036659, 0.00060129, -0.00000113, 0.00000000],
+		[-6.27273685, -0.00059813, 0.00036652, 0.00060117, -0.00000113, 0.00000000],
+		[-6.27273713, -0.00059801, 0.00036645, 0.00060106, -0.00000113, 0.00000000],
+		[-6.27273740, -0.00059790, 0.00036637, 0.00060094, -0.00000113, 0.00000000],
+		[-6.27273768, -0.00059778, 0.00036630, 0.00060082, -0.00000113, 0.00000000],
+		[-6.27273796, -0.00059767, 0.00036623, 0.00060071, -0.00000113, 0.00000000],
+		[-6.27273823, -0.00059755, 0.00036616, 0.00060059, -0.00000113, 0.00000000],
+		[-6.27273851, -0.00059744, 0.00036609, 0.00060048, -0.00000113, 0.00000000],
+		[-6.27273878, -0.00059732, 0.00036602, 0.00060036, -0.00000113, 0.00000000],
+		[-6.27273906, -0.00059721, 0.00036595, 0.00060025, -0.00000113, 0.00000000],
+		[-6.27273933, -0.00059709, 0.00036588, 0.00060013, -0.00000113, 0.00000000],
+		[-6.27273961, -0.00059698, 0.00036581, 0.00060001, -0.00000113, 0.00000000],
+		[-6.27273989, -0.00059686, 0.00036574, 0.00059990, -0.00000113, 0.00000000],
+		[-6.27274016, -0.00059674, 0.00036567, 0.00059978, -0.00000113, 0.00000000],
+		[-6.27274044, -0.00059663, 0.00036560, 0.00059967, -0.00000113, 0.00000000],
+		[-6.27274071, -0.00059651, 0.00036553, 0.00059955, -0.00000113, 0.00000000],
+		[-6.27274099, -0.00059640, 0.00036546, 0.00059944, -0.00000113, 0.00000000],
+		[-6.27274126, -0.00059629, 0.00036539, 0.00059932, -0.00000113, 0.00000000],
+		[-6.27274154, -0.00059617, 0.00036532, 0.00059920, -0.00000113, 0.00000000],
+		[-6.27274181, -0.00059606, 0.00036525, 0.00059909, -0.00000113, 0.00000000],
+		[-6.27274208, -0.00059594, 0.00036517, 0.00059897, -0.00000113, 0.00000000],
+		[-6.27274236, -0.00059583, 0.00036510, 0.00059886, -0.00000113, 0.00000000],
+		[-6.27274263, -0.00059571, 0.00036503, 0.00059874, -0.00000113, 0.00000000],
+		[-6.27274291, -0.00059560, 0.00036496, 0.00059863, -0.00000113, 0.00000000],
+		[-6.27274318, -0.00059548, 0.00036489, 0.00059851, -0.00000113, 0.00000000],
+		[-6.27274346, -0.00059537, 0.00036482, 0.00059840, -0.00000113, 0.00000000],
+		[-6.27274373, -0.00059525, 0.00036475, 0.00059828, -0.00000113, 0.00000000],
+		[-6.27274400, -0.00059514, 0.00036468, 0.00059817, -0.00000113, 0.00000000],
+		[-6.27274428, -0.00059502, 0.00036461, 0.00059805, -0.00000113, 0.00000000],
+		[-6.27274455, -0.00059491, 0.00036454, 0.00059794, -0.00000113, 0.00000000],
+		[-6.27274482, -0.00059480, 0.00036447, 0.00059782, -0.00000113, 0.00000000],
+		[-6.27274510, -0.00059468, 0.00036440, 0.00059771, -0.00000113, 0.00000000],
+		[-6.27274537, -0.00059457, 0.00036433, 0.00059759, -0.00000113, 0.00000000],
+		[-6.27274564, -0.00059445, 0.00036426, 0.00059748, -0.00000113, 0.00000000],
+		[-6.27274592, -0.00059434, 0.00036419, 0.00059736, -0.00000113, 0.00000000],
+		[-6.27274619, -0.00059422, 0.00036412, 0.00059725, -0.00000113, 0.00000000],
+		[-6.27274646, -0.00059411, 0.00036405, 0.00059713, -0.00000113, 0.00000000],
+		[-6.27274674, -0.00059400, 0.00036398, 0.00059702, -0.00000113, 0.00000000],
+		[-6.27274701, -0.00059388, 0.00036391, 0.00059690, -0.00000113, 0.00000000],
+		[-6.27274728, -0.00059377, 0.00036384, 0.00059679, -0.00000113, 0.00000000],
+		[-6.27274755, -0.00059365, 0.00036377, 0.00059668, -0.00000113, 0.00000000],
+		[-6.27274783, -0.00059354, 0.00036370, 0.00059656, -0.00000113, 0.00000000],
+		[-6.27274810, -0.00059343, 0.00036363, 0.00059645, -0.00000113, 0.00000000],
+		[-6.27274837, -0.00059331, 0.00036356, 0.00059633, -0.00000113, 0.00000000],
+		[-6.27274864, -0.00059320, 0.00036349, 0.00059622, -0.00000113, 0.00000000],
+		[-6.27274891, -0.00059309, 0.00036342, 0.00059610, -0.00000113, 0.00000000],
+		[-6.27274919, -0.00059297, 0.00036335, 0.00059599, -0.00000113, 0.00000000],
+		[-6.27274946, -0.00059286, 0.00036329, 0.00059588, -0.00000113, 0.00000000],
+		[-6.27274973, -0.00059275, 0.00036322, 0.00059576, -0.00000113, 0.00000000],
+		[-6.27275000, -0.00059263, 0.00036315, 0.00059565, -0.00000113, 0.00000000],
+		[-6.27275027, -0.00059252, 0.00036308, 0.00059553, -0.00000113, 0.00000000],
+		[-6.27275054, -0.00059241, 0.00036301, 0.00059542, -0.00000113, 0.00000000],
+		[-6.27275081, -0.00059229, 0.00036294, 0.00059531, -0.00000113, 0.00000000],
+		[-6.27275109, -0.00059218, 0.00036287, 0.00059519, -0.00000113, 0.00000000],
+		[-6.27275136, -0.00059207, 0.00036280, 0.00059508, -0.00000113, 0.00000000],
+		[-6.27275163, -0.00059195, 0.00036273, 0.00059496, -0.00000113, 0.00000000],
+		[-6.27275190, -0.00059184, 0.00036266, 0.00059485, -0.00000113, 0.00000000],
+		[-6.27275217, -0.00059173, 0.00036259, 0.00059474, -0.00000113, 0.00000000],
+		[-6.27275244, -0.00059161, 0.00036252, 0.00059462, -0.00000113, 0.00000000],
+		[-6.27275271, -0.00059150, 0.00036245, 0.00059451, -0.00000113, 0.00000000],
+		[-6.27275298, -0.00059139, 0.00036238, 0.00059440, -0.00000113, 0.00000000],
+		[-6.27275325, -0.00059127, 0.00036231, 0.00059428, -0.00000113, 0.00000000],
+		[-6.27275352, -0.00059116, 0.00036224, 0.00059417, -0.00000113, 0.00000000],
+		[-6.27275379, -0.00059105, 0.00036217, 0.00059406, -0.00000113, 0.00000000],
+		[-6.27275406, -0.00059094, 0.00036211, 0.00059394, -0.00000113, 0.00000000],
+		[-6.27275433, -0.00059082, 0.00036204, 0.00059383, -0.00000113, 0.00000000],
+		[-6.27275460, -0.00059071, 0.00036197, 0.00059372, -0.00000113, 0.00000000],
+		[-6.27275487, -0.00059060, 0.00036190, 0.00059360, -0.00000113, 0.00000000],
+		[-6.27275514, -0.00059048, 0.00036183, 0.00059349, -0.00000113, 0.00000000],
+		[-6.27275541, -0.00059037, 0.00036176, 0.00059338, -0.00000113, 0.00000000],
+		[-6.27275568, -0.00059026, 0.00036169, 0.00059326, -0.00000113, 0.00000000],
+		[-6.27275595, -0.00059015, 0.00036162, 0.00059315, -0.00000113, 0.00000000],
+		[-6.27275622, -0.00059003, 0.00036155, 0.00059304, -0.00000113, 0.00000000],
+		[-6.27275649, -0.00058992, 0.00036148, 0.00059292, -0.00000113, 0.00000000],
+		[-6.27275675, -0.00058981, 0.00036141, 0.00059281, -0.00000113, 0.00000000],
+		[-6.27275702, -0.00058970, 0.00036135, 0.00059270, -0.00000113, 0.00000000],
+		[-6.27275729, -0.00058958, 0.00036128, 0.00059258, -0.00000113, 0.00000000],
+		[-6.27275756, -0.00058947, 0.00036121, 0.00059247, -0.00000113, 0.00000000],
+		[-6.27275783, -0.00058936, 0.00036114, 0.00059236, -0.00000113, 0.00000000],
+		[-6.27275810, -0.00058925, 0.00036107, 0.00059225, -0.00000113, 0.00000000],
+		[-6.27275837, -0.00058914, 0.00036100, 0.00059213, -0.00000113, 0.00000000],
+		[-6.27275863, -0.00058902, 0.00036093, 0.00059202, -0.00000113, 0.00000000],
+		[-6.27275890, -0.00058891, 0.00036086, 0.00059191, -0.00000113, 0.00000000],
+		[-6.27275917, -0.00058880, 0.00036080, 0.00059180, -0.00000113, 0.00000000],
+		[-6.27275944, -0.00058869, 0.00036073, 0.00059168, -0.00000113, 0.00000000],
+		[-6.27275971, -0.00058858, 0.00036066, 0.00059157, -0.00000113, 0.00000000],
+		[-6.27275997, -0.00058846, 0.00036059, 0.00059146, -0.00000113, 0.00000000],
+		[-6.27276024, -0.00058835, 0.00036052, 0.00059135, -0.00000113, 0.00000000],
+		[-6.27276051, -0.00058824, 0.00036045, 0.00059123, -0.00000113, 0.00000000],
+		[-6.27276078, -0.00058813, 0.00036038, 0.00059112, -0.00000113, 0.00000000],
+		[-6.27276104, -0.00058802, 0.00036032, 0.00059101, -0.00000113, 0.00000000],
+		[-6.27276131, -0.00058790, 0.00036025, 0.00059090, -0.00000113, 0.00000000],
+		[-6.27276158, -0.00058779, 0.00036018, 0.00059078, -0.00000113, 0.00000000],
+		[-6.27276184, -0.00058768, 0.00036011, 0.00059067, -0.00000113, 0.00000000],
+		[-6.27276211, -0.00058757, 0.00036004, 0.00059056, -0.00000113, 0.00000000],
+		[-6.27276238, -0.00058746, 0.00035997, 0.00059045, -0.00000113, 0.00000000],
+		[-6.27276265, -0.00058735, 0.00035991, 0.00059034, -0.00000113, 0.00000000],
+		[-6.27276291, -0.00058724, 0.00035984, 0.00059022, -0.00000113, 0.00000000],
+		[-6.27276318, -0.00058712, 0.00035977, 0.00059011, -0.00000113, 0.00000000],
+		[-6.27276344, -0.00058701, 0.00035970, 0.00059000, -0.00000113, 0.00000000],
+		[-6.27276371, -0.00058690, 0.00035963, 0.00058989, -0.00000113, 0.00000000],
+		[-6.27276398, -0.00058679, 0.00035956, 0.00058978, -0.00000113, 0.00000000],
+		[-6.27276424, -0.00058668, 0.00035950, 0.00058966, -0.00000113, 0.00000000],
+		[-6.27276451, -0.00058657, 0.00035943, 0.00058955, -0.00000113, 0.00000000],
+		[-6.27276478, -0.00058646, 0.00035936, 0.00058944, -0.00000113, 0.00000000],
+		[-6.27276504, -0.00058635, 0.00035929, 0.00058933, -0.00000113, 0.00000000],
+		[-6.27276531, -0.00058623, 0.00035922, 0.00058922, -0.00000113, 0.00000000],
+		[-6.27276557, -0.00058612, 0.00035916, 0.00058911, -0.00000113, 0.00000000],
+		[-6.27276584, -0.00058601, 0.00035909, 0.00058899, -0.00000113, 0.00000000],
+		[-6.27276610, -0.00058590, 0.00035902, 0.00058888, -0.00000113, 0.00000000],
+		[-6.27276637, -0.00058579, 0.00035895, 0.00058877, -0.00000113, 0.00000000],
+		[-6.27276663, -0.00058568, 0.00035888, 0.00058866, -0.00000113, 0.00000000],
+		[-6.27276690, -0.00058557, 0.00035882, 0.00058855, -0.00000113, 0.00000000],
+		[-6.27276716, -0.00058546, 0.00035875, 0.00058844, -0.00000113, 0.00000000],
+		[-6.27276743, -0.00058535, 0.00035868, 0.00058833, -0.00000113, 0.00000000],
+		[-6.27276769, -0.00058524, 0.00035861, 0.00058821, -0.00000113, 0.00000000],
+		[-6.27276796, -0.00058513, 0.00035854, 0.00058810, -0.00000113, 0.00000000],
+		[-6.27276822, -0.00058502, 0.00035848, 0.00058799, -0.00000113, 0.00000000],
+		[-6.27276849, -0.00058491, 0.00035841, 0.00058788, -0.00000113, 0.00000000],
+		[-6.27276875, -0.00058480, 0.00035834, 0.00058777, -0.00000113, 0.00000000],
+		[-6.27276902, -0.00058468, 0.00035827, 0.00058766, -0.00000113, 0.00000000],
+		[-6.27276928, -0.00058457, 0.00035820, 0.00058755, -0.00000113, 0.00000000],
+		[-6.27276954, -0.00058446, 0.00035814, 0.00058744, -0.00000113, 0.00000000],
+		[-6.27276981, -0.00058435, 0.00035807, 0.00058733, -0.00000113, 0.00000000],
+		[-6.27277007, -0.00058424, 0.00035800, 0.00058721, -0.00000113, 0.00000000],
+		[-6.27277034, -0.00058413, 0.00035793, 0.00058710, -0.00000113, 0.00000000],
+		[-6.27277060, -0.00058402, 0.00035787, 0.00058699, -0.00000113, 0.00000000],
+		[-6.27277086, -0.00058391, 0.00035780, 0.00058688, -0.00000113, 0.00000000],
+		[-6.27277113, -0.00058380, 0.00035773, 0.00058677, -0.00000113, 0.00000000],
+		[-6.27277139, -0.00058369, 0.00035766, 0.00058666, -0.00000113, 0.00000000],
+		[-6.27277165, -0.00058358, 0.00035760, 0.00058655, -0.00000113, 0.00000000],
+		[-6.27277192, -0.00058347, 0.00035753, 0.00058644, -0.00000113, 0.00000000],
+		[-6.27277218, -0.00058336, 0.00035746, 0.00058633, -0.00000113, 0.00000000],
+		[-6.27277244, -0.00058325, 0.00035739, 0.00058622, -0.00000113, 0.00000000],
+		[-6.27277270, -0.00058314, 0.00035733, 0.00058611, -0.00000113, 0.00000000],
+		[-6.27277297, -0.00058303, 0.00035726, 0.00058600, -0.00000113, 0.00000000],
+		[-6.27277323, -0.00058292, 0.00035719, 0.00058589, -0.00000113, 0.00000000],
+		[-6.27277349, -0.00058281, 0.00035712, 0.00058578, -0.00000113, 0.00000000],
+		[-6.27277376, -0.00058270, 0.00035706, 0.00058567, -0.00000113, 0.00000000],
+		[-6.27277402, -0.00058259, 0.00035699, 0.00058556, -0.00000113, 0.00000000],
+		[-6.27277428, -0.00058248, 0.00035692, 0.00058545, -0.00000113, 0.00000000],
+		[-6.27277454, -0.00058237, 0.00035686, 0.00058534, -0.00000113, 0.00000000],
+		[-6.27277480, -0.00058227, 0.00035679, 0.00058523, -0.00000113, 0.00000000],
+		[-6.27277507, -0.00058216, 0.00035672, 0.00058512, -0.00000113, 0.00000000],
+		[-6.27277533, -0.00058205, 0.00035665, 0.00058501, -0.00000113, 0.00000000],
+		[-6.27277559, -0.00058194, 0.00035659, 0.00058490, -0.00000113, 0.00000000],
+		[-6.27277585, -0.00058183, 0.00035652, 0.00058479, -0.00000113, 0.00000000],
+		[-6.27277611, -0.00058172, 0.00035645, 0.00058468, -0.00000113, 0.00000000],
+		[-6.27277637, -0.00058161, 0.00035639, 0.00058457, -0.00000113, 0.00000000],
+		[-6.27277664, -0.00058150, 0.00035632, 0.00058446, -0.00000113, 0.00000000],
+		[-6.27277690, -0.00058139, 0.00035625, 0.00058435, -0.00000113, 0.00000000],
+		[-6.27277716, -0.00058128, 0.00035619, 0.00058424, -0.00000113, 0.00000000],
+		[-6.27277742, -0.00058117, 0.00035612, 0.00058413, -0.00000113, 0.00000000],
+		[-6.27277768, -0.00058106, 0.00035605, 0.00058402, -0.00000113, 0.00000000],
+		[-6.27277794, -0.00058095, 0.00035598, 0.00058391, -0.00000113, 0.00000000],
+		[-6.27277820, -0.00058084, 0.00035592, 0.00058380, -0.00000113, 0.00000000],
+		[-6.27277846, -0.00058074, 0.00035585, 0.00058369, -0.00000113, 0.00000000],
+		[-6.27277872, -0.00058063, 0.00035578, 0.00058358, -0.00000113, 0.00000000],
+		[-6.27277898, -0.00058052, 0.00035572, 0.00058347, -0.00000113, 0.00000000],
+		[-6.27277924, -0.00058041, 0.00035565, 0.00058336, -0.00000113, 0.00000000],
+		[-6.27277950, -0.00058030, 0.00035558, 0.00058325, -0.00000113, 0.00000000],
+		[-6.27277977, -0.00058019, 0.00035552, 0.00058314, -0.00000113, 0.00000000],
+		[-6.27278003, -0.00058008, 0.00035545, 0.00058303, -0.00000113, 0.00000000],
+		[-6.27278029, -0.00057997, 0.00035538, 0.00058292, -0.00000113, 0.00000000],
+		[-6.27278055, -0.00057987, 0.00035532, 0.00058281, -0.00000113, 0.00000000],
+		[-6.27278080, -0.00057976, 0.00035525, 0.00058271, -0.00000113, 0.00000000],
+		[-6.27278106, -0.00057965, 0.00035518, 0.00058260, -0.00000113, 0.00000000],
+		[-6.27278132, -0.00057954, 0.00035512, 0.00058249, -0.00000113, 0.00000000],
+		[-6.27278158, -0.00057943, 0.00035505, 0.00058238, -0.00000113, 0.00000000],
+		[-6.27278184, -0.00057932, 0.00035498, 0.00058227, -0.00000113, 0.00000000],
+		[-6.27278210, -0.00057921, 0.00035492, 0.00058216, -0.00000113, 0.00000000],
+		[-6.27278236, -0.00057911, 0.00035485, 0.00058205, -0.00000113, 0.00000000],
+		[-6.27278262, -0.00057900, 0.00035479, 0.00058194, -0.00000113, 0.00000000],
+		[-6.27278288, -0.00057889, 0.00035472, 0.00058183, -0.00000113, 0.00000000],
+		[-6.27278314, -0.00057878, 0.00035465, 0.00058172, -0.00000113, 0.00000000],
+		[-6.27278340, -0.00057867, 0.00035459, 0.00058162, -0.00000113, 0.00000000],
+		[-6.27278366, -0.00057857, 0.00035452, 0.00058151, -0.00000113, 0.00000000],
+		[-6.27278392, -0.00057846, 0.00035445, 0.00058140, -0.00000113, 0.00000000],
+		[-6.27278417, -0.00057835, 0.00035439, 0.00058129, -0.00000113, 0.00000000],
+		[-6.27278443, -0.00057824, 0.00035432, 0.00058118, -0.00000113, 0.00000000],
+		[-6.27278469, -0.00057813, 0.00035425, 0.00058107, -0.00000113, 0.00000000],
+		[-6.27278495, -0.00057802, 0.00035419, 0.00058096, -0.00000113, 0.00000000],
+		[-6.27278521, -0.00057792, 0.00035412, 0.00058086, -0.00000113, 0.00000000],
+		[-6.27278547, -0.00057781, 0.00035406, 0.00058075, -0.00000113, 0.00000000],
+		[-6.27278572, -0.00057770, 0.00035399, 0.00058064, -0.00000113, 0.00000000],
+		[-6.27278598, -0.00057759, 0.00035392, 0.00058053, -0.00000113, 0.00000000],
+		[-6.27278624, -0.00057749, 0.00035386, 0.00058042, -0.00000113, 0.00000000],
+		[-6.27278650, -0.00057738, 0.00035379, 0.00058031, -0.00000113, 0.00000000],
+		[-6.27278675, -0.00057727, 0.00035373, 0.00058021, -0.00000113, 0.00000000],
+		[-6.27278701, -0.00057716, 0.00035366, 0.00058010, -0.00000113, 0.00000000],
+		[-6.27278727, -0.00057706, 0.00035359, 0.00057999, -0.00000113, 0.00000000],
+		[-6.27278753, -0.00057695, 0.00035353, 0.00057988, -0.00000113, 0.00000000],
+		[-6.27278778, -0.00057684, 0.00035346, 0.00057977, -0.00000113, 0.00000000],
+		[-6.27278804, -0.00057673, 0.00035340, 0.00057966, -0.00000113, 0.00000000],
+		[-6.27278830, -0.00057663, 0.00035333, 0.00057956, -0.00000113, 0.00000000],
+		[-6.27278855, -0.00057652, 0.00035326, 0.00057945, -0.00000113, 0.00000000],
+		[-6.27278881, -0.00057641, 0.00035320, 0.00057934, -0.00000113, 0.00000000],
+		[-6.27278907, -0.00057630, 0.00035313, 0.00057923, -0.00000113, 0.00000000],
+		[-6.27278933, -0.00057620, 0.00035307, 0.00057913, -0.00000113, 0.00000000],
+		[-6.27278958, -0.00057609, 0.00035300, 0.00057902, -0.00000113, 0.00000000],
+		[-6.27278984, -0.00057598, 0.00035294, 0.00057891, -0.00000113, 0.00000000],
+		[-6.27279009, -0.00057587, 0.00035287, 0.00057880, -0.00000113, 0.00000000],
+		[-6.27279035, -0.00057577, 0.00035280, 0.00057869, -0.00000113, 0.00000000],
+		[-6.27279061, -0.00057566, 0.00035274, 0.00057859, -0.00000113, 0.00000000],
+		[-6.27279086, -0.00057555, 0.00035267, 0.00057848, -0.00000113, 0.00000000],
+		[-6.27279112, -0.00057545, 0.00035261, 0.00057837, -0.00000113, 0.00000000],
+		[-6.27279137, -0.00057534, 0.00035254, 0.00057826, -0.00000113, 0.00000000],
+		[-6.27279163, -0.00057523, 0.00035248, 0.00057816, -0.00000113, 0.00000000],
+		[-6.27279189, -0.00057513, 0.00035241, 0.00057805, -0.00000113, 0.00000000],
+		[-6.27279214, -0.00057502, 0.00035235, 0.00057794, -0.00000113, 0.00000000],
+		[-6.27279240, -0.00057491, 0.00035228, 0.00057783, -0.00000113, 0.00000000],
+		[-6.27279265, -0.00057480, 0.00035221, 0.00057773, -0.00000113, 0.00000000],
+		[-6.27279291, -0.00057470, 0.00035215, 0.00057762, -0.00000113, 0.00000000],
+		[-6.27279316, -0.00057459, 0.00035208, 0.00057751, -0.00000113, 0.00000000],
+		[-6.27279342, -0.00057448, 0.00035202, 0.00057741, -0.00000113, 0.00000000],
+		[-6.27279367, -0.00057438, 0.00035195, 0.00057730, -0.00000113, 0.00000000],
+		[-6.27279393, -0.00057427, 0.00035189, 0.00057719, -0.00000113, 0.00000000],
+		[-6.27279418, -0.00057417, 0.00035182, 0.00057708, -0.00000113, 0.00000000],
+		[-6.27279444, -0.00057406, 0.00035176, 0.00057698, -0.00000113, 0.00000000],
+		[-6.27279469, -0.00057395, 0.00035169, 0.00057687, -0.00000113, 0.00000000],
+		[-6.27279495, -0.00057385, 0.00035163, 0.00057676, -0.00000113, 0.00000000],
+		[-6.27279520, -0.00057374, 0.00035156, 0.00057666, -0.00000113, 0.00000000],
+		[-6.27279546, -0.00057363, 0.00035150, 0.00057655, -0.00000113, 0.00000000],
+		[-6.27279571, -0.00057353, 0.00035143, 0.00057644, -0.00000113, 0.00000000],
+		[-6.27279596, -0.00057342, 0.00035137, 0.00057634, -0.00000113, 0.00000000],
+		[-6.27279622, -0.00057331, 0.00035130, 0.00057623, -0.00000113, 0.00000000],
+		[-6.27279647, -0.00057321, 0.00035124, 0.00057612, -0.00000113, 0.00000000],
+		[-6.27279673, -0.00057310, 0.00035117, 0.00057602, -0.00000113, 0.00000000],
+		[-6.27279698, -0.00057300, 0.00035111, 0.00057591, -0.00000113, 0.00000000],
+		[-6.27279723, -0.00057289, 0.00035104, 0.00057580, -0.00000113, 0.00000000],
+		[-6.27279749, -0.00057278, 0.00035098, 0.00057570, -0.00000113, 0.00000000],
+		[-6.27279774, -0.00057268, 0.00035091, 0.00057559, -0.00000113, 0.00000000],
+		[-6.27279799, -0.00057257, 0.00035085, 0.00057548, -0.00000113, 0.00000000],
+		[-6.27279825, -0.00057247, 0.00035078, 0.00057538, -0.00000113, 0.00000000],
+		[-6.27279850, -0.00057236, 0.00035072, 0.00057527, -0.00000113, 0.00000000],
+		[-6.27279875, -0.00057225, 0.00035065, 0.00057516, -0.00000113, 0.00000000],
+		[-6.27279901, -0.00057215, 0.00035059, 0.00057506, -0.00000113, 0.00000000],
+		[-6.27279926, -0.00057204, 0.00035052, 0.00057495, -0.00000113, 0.00000000],
+		[-6.27279951, -0.00057194, 0.00035046, 0.00057484, -0.00000113, 0.00000000],
+		[-6.27279977, -0.00057183, 0.00035039, 0.00057474, -0.00000113, 0.00000000],
+		[-6.27280002, -0.00057173, 0.00035033, 0.00057463, -0.00000113, 0.00000000],
+		[-6.27280027, -0.00057162, 0.00035026, 0.00057453, -0.00000113, 0.00000000],
+		[-6.27280052, -0.00057152, 0.00035020, 0.00057442, -0.00000113, 0.00000000],
+		[-6.27280078, -0.00057141, 0.00035013, 0.00057431, -0.00000113, 0.00000000],
+		[-6.27280103, -0.00057130, 0.00035007, 0.00057421, -0.00000113, 0.00000000],
+		[-6.27280128, -0.00057120, 0.00035000, 0.00057410, -0.00000113, 0.00000000],
+		[-6.27280153, -0.00057109, 0.00034994, 0.00057400, -0.00000113, 0.00000000],
+		[-6.27280178, -0.00057099, 0.00034987, 0.00057389, -0.00000113, 0.00000000],
+		[-6.27280204, -0.00057088, 0.00034981, 0.00057378, -0.00000113, 0.00000000],
+		[-6.27280229, -0.00057078, 0.00034974, 0.00057368, -0.00000113, 0.00000000],
+		[-6.27280254, -0.00057067, 0.00034968, 0.00057357, -0.00000113, 0.00000000],
+		[-6.27280279, -0.00057057, 0.00034962, 0.00057347, -0.00000113, 0.00000000],
+		[-6.27280304, -0.00057046, 0.00034955, 0.00057336, -0.00000113, 0.00000000],
+		[-6.27280329, -0.00057036, 0.00034949, 0.00057326, -0.00000113, 0.00000000],
+		[-6.27280355, -0.00057025, 0.00034942, 0.00057315, -0.00000113, 0.00000000],
+		[-6.27280380, -0.00057015, 0.00034936, 0.00057304, -0.00000113, 0.00000000],
+		[-6.27280405, -0.00057004, 0.00034929, 0.00057294, -0.00000113, 0.00000000],
+		[-6.27280430, -0.00056994, 0.00034923, 0.00057283, -0.00000113, 0.00000000],
+		[-6.27280455, -0.00056983, 0.00034916, 0.00057273, -0.00000113, 0.00000000],
+		[-6.27280480, -0.00056973, 0.00034910, 0.00057262, -0.00000113, 0.00000000],
+		[-6.27280505, -0.00056962, 0.00034904, 0.00057252, -0.00000113, 0.00000000],
+		[-6.27280530, -0.00056952, 0.00034897, 0.00057241, -0.00000113, 0.00000000],
+		[-6.27280555, -0.00056941, 0.00034891, 0.00057231, -0.00000113, 0.00000000],
+		[-6.27280580, -0.00056931, 0.00034884, 0.00057220, -0.00000113, 0.00000000],
+		[-6.27280606, -0.00056920, 0.00034878, 0.00057210, -0.00000113, 0.00000000],
+		[-6.27280631, -0.00056910, 0.00034872, 0.00057199, -0.00000113, 0.00000000],
+		[-6.27280656, -0.00056899, 0.00034865, 0.00057189, -0.00000113, 0.00000000],
+		[-6.27280681, -0.00056889, 0.00034859, 0.00057178, -0.00000113, 0.00000000],
+		[-6.27280706, -0.00056878, 0.00034852, 0.00057168, -0.00000113, 0.00000000],
+		[-6.27280731, -0.00056868, 0.00034846, 0.00057157, -0.00000113, 0.00000000],
+		[-6.27280756, -0.00056858, 0.00034839, 0.00057147, -0.00000113, 0.00000000],
+		[-6.27280781, -0.00056847, 0.00034833, 0.00057136, -0.00000113, 0.00000000],
+		[-6.27280806, -0.00056837, 0.00034827, 0.00057126, -0.00000113, 0.00000000],
+		[-6.27280830, -0.00056826, 0.00034820, 0.00057115, -0.00000113, 0.00000000],
+		[-6.27280855, -0.00056816, 0.00034814, 0.00057105, -0.00000113, 0.00000000],
+		[-6.27280880, -0.00056805, 0.00034807, 0.00057094, -0.00000113, 0.00000000],
+		[-6.27280905, -0.00056795, 0.00034801, 0.00057084, -0.00000113, 0.00000000],
+		[-6.27280930, -0.00056785, 0.00034795, 0.00057073, -0.00000113, 0.00000000],
+		[-6.27280955, -0.00056774, 0.00034788, 0.00057063, -0.00000113, 0.00000000],
+		[-6.27280980, -0.00056764, 0.00034782, 0.00057052, -0.00000113, 0.00000000],
+		[-6.27281005, -0.00056753, 0.00034776, 0.00057042, -0.00000113, 0.00000000],
+		[-6.27281030, -0.00056743, 0.00034769, 0.00057031, -0.00000113, 0.00000000],
+		[-6.27281055, -0.00056733, 0.00034763, 0.00057021, -0.00000113, 0.00000000],
+		[-6.27281080, -0.00056722, 0.00034756, 0.00057010, -0.00000113, 0.00000000],
+		[-6.27281104, -0.00056712, 0.00034750, 0.00057000, -0.00000113, 0.00000000],
+		[-6.27281129, -0.00056701, 0.00034744, 0.00056990, -0.00000113, 0.00000000],
+		[-6.27281154, -0.00056691, 0.00034737, 0.00056979, -0.00000113, 0.00000000],
+		[-6.27281179, -0.00056681, 0.00034731, 0.00056969, -0.00000113, 0.00000000],
+		[-6.27281204, -0.00056670, 0.00034725, 0.00056958, -0.00000113, 0.00000000],
+		[-6.27281229, -0.00056660, 0.00034718, 0.00056948, -0.00000113, 0.00000000],
+		[-6.27281253, -0.00056649, 0.00034712, 0.00056937, -0.00000113, 0.00000000],
+		[-6.27281278, -0.00056639, 0.00034706, 0.00056927, -0.00000113, 0.00000000],
+		[-6.27281303, -0.00056629, 0.00034699, 0.00056917, -0.00000113, 0.00000000],
+		[-6.27281328, -0.00056618, 0.00034693, 0.00056906, -0.00000113, 0.00000000],
+		[-6.27281353, -0.00056608, 0.00034686, 0.00056896, -0.00000113, 0.00000000],
+		[-6.27281377, -0.00056598, 0.00034680, 0.00056885, -0.00000113, 0.00000000],
+		[-6.27281402, -0.00056587, 0.00034674, 0.00056875, -0.00000113, 0.00000000],
+		[-6.27281427, -0.00056577, 0.00034667, 0.00056865, -0.00000113, 0.00000000],
+		[-6.27281452, -0.00056567, 0.00034661, 0.00056854, -0.00000113, 0.00000000],
+		[-6.27281476, -0.00056556, 0.00034655, 0.00056844, -0.00000113, 0.00000000],
+		[-6.27281501, -0.00056546, 0.00034648, 0.00056833, -0.00000113, 0.00000000],
+		[-6.27281526, -0.00056536, 0.00034642, 0.00056823, -0.00000113, 0.00000000],
+		[-6.27281550, -0.00056525, 0.00034636, 0.00056813, -0.00000113, 0.00000000],
+		[-6.27281575, -0.00056515, 0.00034629, 0.00056802, -0.00000113, 0.00000000],
+		[-6.27281600, -0.00056505, 0.00034623, 0.00056792, -0.00000113, 0.00000000],
+		[-6.27281624, -0.00056494, 0.00034617, 0.00056781, -0.00000113, 0.00000000],
+		[-6.27281649, -0.00056484, 0.00034610, 0.00056771, -0.00000113, 0.00000000],
+		[-6.27281674, -0.00056474, 0.00034604, 0.00056761, -0.00000113, 0.00000000],
+		[-6.27281698, -0.00056463, 0.00034598, 0.00056750, -0.00000113, 0.00000000],
+		[-6.27281723, -0.00056453, 0.00034592, 0.00056740, -0.00000113, 0.00000000],
+		[-6.27281748, -0.00056443, 0.00034585, 0.00056730, -0.00000113, 0.00000000],
+		[-6.27281772, -0.00056433, 0.00034579, 0.00056719, -0.00000113, 0.00000000],
+		[-6.27281797, -0.00056422, 0.00034573, 0.00056709, -0.00000113, 0.00000000],
+		[-6.27281822, -0.00056412, 0.00034566, 0.00056699, -0.00000113, 0.00000000],
+		[-6.27281846, -0.00056402, 0.00034560, 0.00056688, -0.00000113, 0.00000000],
+		[-6.27281871, -0.00056391, 0.00034554, 0.00056678, -0.00000113, 0.00000000],
+		[-6.27281895, -0.00056381, 0.00034547, 0.00056668, -0.00000113, 0.00000000],
+		[-6.27281920, -0.00056371, 0.00034541, 0.00056657, -0.00000113, 0.00000000],
+		[-6.27281944, -0.00056361, 0.00034535, 0.00056647, -0.00000113, 0.00000000],
+		[-6.27281969, -0.00056350, 0.00034528, 0.00056637, -0.00000113, 0.00000000],
+		[-6.27281993, -0.00056340, 0.00034522, 0.00056626, -0.00000113, 0.00000000],
+		[-6.27282018, -0.00056330, 0.00034516, 0.00056616, -0.00000113, 0.00000000],
+		[-6.27282043, -0.00056320, 0.00034510, 0.00056606, -0.00000113, 0.00000000],
+		[-6.27282067, -0.00056309, 0.00034503, 0.00056596, -0.00000113, 0.00000000],
+		[-6.27282092, -0.00056299, 0.00034497, 0.00056585, -0.00000113, 0.00000000],
+		[-6.27282116, -0.00056289, 0.00034491, 0.00056575, -0.00000113, 0.00000000],
+		[-6.27282141, -0.00056279, 0.00034485, 0.00056565, -0.00000113, 0.00000000],
+		[-6.27282165, -0.00056268, 0.00034478, 0.00056554, -0.00000113, 0.00000000],
+		[-6.27282189, -0.00056258, 0.00034472, 0.00056544, -0.00000113, 0.00000000],
+		[-6.27282214, -0.00056248, 0.00034466, 0.00056534, -0.00000113, 0.00000000],
+		[-6.27282238, -0.00056238, 0.00034459, 0.00056524, -0.00000113, 0.00000000],
+		[-6.27282263, -0.00056228, 0.00034453, 0.00056513, -0.00000113, 0.00000000],
+		[-6.27282287, -0.00056217, 0.00034447, 0.00056503, -0.00000113, 0.00000000],
+		[-6.27282312, -0.00056207, 0.00034441, 0.00056493, -0.00000113, 0.00000000],
+		[-6.27282336, -0.00056197, 0.00034434, 0.00056483, -0.00000113, 0.00000000],
+		[-6.27282360, -0.00056187, 0.00034428, 0.00056472, -0.00000113, 0.00000000],
+		[-6.27282385, -0.00056177, 0.00034422, 0.00056462, -0.00000113, 0.00000000],
+		[-6.27282409, -0.00056166, 0.00034416, 0.00056452, -0.00000113, 0.00000000],
+		[-6.27282434, -0.00056156, 0.00034409, 0.00056442, -0.00000113, 0.00000000],
+		[-6.27282458, -0.00056146, 0.00034403, 0.00056431, -0.00000113, 0.00000000],
+		[-6.27282482, -0.00056136, 0.00034397, 0.00056421, -0.00000113, 0.00000000],
+		[-6.27282507, -0.00056126, 0.00034391, 0.00056411, -0.00000113, 0.00000000],
+		[-6.27282531, -0.00056115, 0.00034384, 0.00056401, -0.00000113, 0.00000000],
+		[-6.27282555, -0.00056105, 0.00034378, 0.00056390, -0.00000113, 0.00000000],
+		[-6.27282580, -0.00056095, 0.00034372, 0.00056380, -0.00000113, 0.00000000],
+		[-6.27282604, -0.00056085, 0.00034366, 0.00056370, -0.00000113, 0.00000000],
+		[-6.27282628, -0.00056075, 0.00034360, 0.00056360, -0.00000113, 0.00000000],
+		[-6.27282653, -0.00056065, 0.00034353, 0.00056349, -0.00000113, 0.00000000],
+		[-6.27282677, -0.00056055, 0.00034347, 0.00056339, -0.00000113, 0.00000000],
+		[-6.27282701, -0.00056044, 0.00034341, 0.00056329, -0.00000113, 0.00000000],
+		[-6.27282725, -0.00056034, 0.00034335, 0.00056319, -0.00000113, 0.00000000],
+		[-6.27282750, -0.00056024, 0.00034328, 0.00056309, -0.00000113, 0.00000000],
+		[-6.27282774, -0.00056014, 0.00034322, 0.00056299, -0.00000113, 0.00000000],
+		[-6.27282798, -0.00056004, 0.00034316, 0.00056288, -0.00000113, 0.00000000],
+		[-6.27282822, -0.00055994, 0.00034310, 0.00056278, -0.00000113, 0.00000000],
+		[-6.27282847, -0.00055984, 0.00034304, 0.00056268, -0.00000113, 0.00000000],
+		[-6.27282871, -0.00055973, 0.00034297, 0.00056258, -0.00000113, 0.00000000],
+		[-6.27282895, -0.00055963, 0.00034291, 0.00056248, -0.00000113, 0.00000000],
+		[-6.27282919, -0.00055953, 0.00034285, 0.00056237, -0.00000113, 0.00000000],
+		[-6.27282944, -0.00055943, 0.00034279, 0.00056227, -0.00000113, 0.00000000],
+		[-6.27282968, -0.00055933, 0.00034273, 0.00056217, -0.00000113, 0.00000000],
+		[-6.27282992, -0.00055923, 0.00034266, 0.00056207, -0.00000113, 0.00000000],
+		[-6.27283016, -0.00055913, 0.00034260, 0.00056197, -0.00000113, 0.00000000],
+		[-6.27283040, -0.00055903, 0.00034254, 0.00056187, -0.00000113, 0.00000000],
+		[-6.27283064, -0.00055893, 0.00034248, 0.00056177, -0.00000113, 0.00000000],
+		[-6.27283089, -0.00055882, 0.00034242, 0.00056166, -0.00000113, 0.00000000],
+		[-6.27283113, -0.00055872, 0.00034235, 0.00056156, -0.00000113, 0.00000000],
+		[-6.27283137, -0.00055862, 0.00034229, 0.00056146, -0.00000113, 0.00000000],
+		[-6.27283161, -0.00055852, 0.00034223, 0.00056136, -0.00000113, 0.00000000],
+		[-6.27283185, -0.00055842, 0.00034217, 0.00056126, -0.00000113, 0.00000000],
+		[-6.27283209, -0.00055832, 0.00034211, 0.00056116, -0.00000113, 0.00000000],
+		[-6.27283233, -0.00055822, 0.00034204, 0.00056106, -0.00000113, 0.00000000],
+		[-6.27283257, -0.00055812, 0.00034198, 0.00056095, -0.00000113, 0.00000000],
+		[-6.27283281, -0.00055802, 0.00034192, 0.00056085, -0.00000113, 0.00000000],
+		[-6.27283305, -0.00055792, 0.00034186, 0.00056075, -0.00000113, 0.00000000],
+		[-6.27283329, -0.00055782, 0.00034180, 0.00056065, -0.00000113, 0.00000000],
+		[-6.27283353, -0.00055772, 0.00034174, 0.00056055, -0.00000113, 0.00000000],
+		[-6.27283378, -0.00055762, 0.00034168, 0.00056045, -0.00000113, 0.00000000],
+		[-6.27283402, -0.00055752, 0.00034161, 0.00056035, -0.00000113, 0.00000000],
+		[-6.27283426, -0.00055742, 0.00034155, 0.00056025, -0.00000113, 0.00000000],
+		[-6.27283450, -0.00055732, 0.00034149, 0.00056015, -0.00000113, 0.00000000],
+		[-6.27283474, -0.00055722, 0.00034143, 0.00056005, -0.00000113, 0.00000000],
+		[-6.27283498, -0.00055712, 0.00034137, 0.00055994, -0.00000113, 0.00000000],
+		[-6.27283522, -0.00055701, 0.00034131, 0.00055984, -0.00000113, 0.00000000],
+		[-6.27283546, -0.00055691, 0.00034124, 0.00055974, -0.00000113, 0.00000000],
+		[-6.27283570, -0.00055681, 0.00034118, 0.00055964, -0.00000113, 0.00000000],
+		[-6.27283593, -0.00055671, 0.00034112, 0.00055954, -0.00000113, 0.00000000],
+		[-6.27283617, -0.00055661, 0.00034106, 0.00055944, -0.00000113, 0.00000000],
+		[-6.27283641, -0.00055651, 0.00034100, 0.00055934, -0.00000113, 0.00000000],
+		[-6.27283665, -0.00055641, 0.00034094, 0.00055924, -0.00000113, 0.00000000],
+		[-6.27283689, -0.00055631, 0.00034088, 0.00055914, -0.00000113, 0.00000000],
+		[-6.27283713, -0.00055621, 0.00034081, 0.00055904, -0.00000113, 0.00000000],
+		[-6.27283737, -0.00055611, 0.00034075, 0.00055894, -0.00000113, 0.00000000],
+		[-6.27283761, -0.00055601, 0.00034069, 0.00055884, -0.00000113, 0.00000000],
+		[-6.27283785, -0.00055591, 0.00034063, 0.00055874, -0.00000113, 0.00000000],
+		[-6.27283809, -0.00055581, 0.00034057, 0.00055864, -0.00000113, 0.00000000],
+		[-6.27283833, -0.00055571, 0.00034051, 0.00055854, -0.00000113, 0.00000000],
+		[-6.27283856, -0.00055562, 0.00034045, 0.00055844, -0.00000113, 0.00000000],
+		[-6.27283880, -0.00055552, 0.00034039, 0.00055834, -0.00000113, 0.00000000],
+		[-6.27283904, -0.00055542, 0.00034033, 0.00055824, -0.00000113, 0.00000000],
+		[-6.27283928, -0.00055532, 0.00034026, 0.00055814, -0.00000113, 0.00000000],
+		[-6.27283952, -0.00055522, 0.00034020, 0.00055804, -0.00000113, 0.00000000],
+		[-6.27283976, -0.00055512, 0.00034014, 0.00055794, -0.00000113, 0.00000000],
+		[-6.27283999, -0.00055502, 0.00034008, 0.00055784, -0.00000113, 0.00000000],
+		[-6.27284023, -0.00055492, 0.00034002, 0.00055774, -0.00000113, 0.00000000],
+		[-6.27284047, -0.00055482, 0.00033996, 0.00055764, -0.00000113, 0.00000000],
+		[-6.27284071, -0.00055472, 0.00033990, 0.00055754, -0.00000113, 0.00000000],
+		[-6.27284095, -0.00055462, 0.00033984, 0.00055744, -0.00000113, 0.00000000],
+		[-6.27284118, -0.00055452, 0.00033978, 0.00055734, -0.00000113, 0.00000000],
+		[-6.27284142, -0.00055442, 0.00033972, 0.00055724, -0.00000113, 0.00000000],
+		[-6.27284166, -0.00055432, 0.00033965, 0.00055714, -0.00000113, 0.00000000],
+		[-6.27284190, -0.00055422, 0.00033959, 0.00055704, -0.00000113, 0.00000000],
+		[-6.27284213, -0.00055412, 0.00033953, 0.00055694, -0.00000113, 0.00000000],
+		[-6.27284237, -0.00055402, 0.00033947, 0.00055684, -0.00000113, 0.00000000],
+		[-6.27284261, -0.00055393, 0.00033941, 0.00055674, -0.00000113, 0.00000000],
+		[-6.27284285, -0.00055383, 0.00033935, 0.00055664, -0.00000113, 0.00000000],
+		[-6.27284308, -0.00055373, 0.00033929, 0.00055654, -0.00000113, 0.00000000],
+		[-6.27284332, -0.00055363, 0.00033923, 0.00055644, -0.00000113, 0.00000000],
+		[-6.27284356, -0.00055353, 0.00033917, 0.00055634, -0.00000113, 0.00000000],
+		[-6.27284379, -0.00055343, 0.00033911, 0.00055624, -0.00000113, 0.00000000],
+		[-6.27284403, -0.00055333, 0.00033905, 0.00055614, -0.00000113, 0.00000000],
+		[-6.27284427, -0.00055323, 0.00033899, 0.00055604, -0.00000113, 0.00000000],
+		[-6.27284450, -0.00055313, 0.00033893, 0.00055594, -0.00000113, 0.00000000],
+		[-6.27284474, -0.00055303, 0.00033887, 0.00055584, -0.00000113, 0.00000000],
+		[-6.27284498, -0.00055294, 0.00033880, 0.00055574, -0.00000113, 0.00000000],
+		[-6.27284521, -0.00055284, 0.00033874, 0.00055564, -0.00000113, 0.00000000],
+		[-6.27284545, -0.00055274, 0.00033868, 0.00055555, -0.00000113, 0.00000000],
+		[-6.27284568, -0.00055264, 0.00033862, 0.00055545, -0.00000113, 0.00000000],
+		[-6.27284592, -0.00055254, 0.00033856, 0.00055535, -0.00000113, 0.00000000],
+		[-6.27284616, -0.00055244, 0.00033850, 0.00055525, -0.00000113, 0.00000000],
+		[-6.27284639, -0.00055234, 0.00033844, 0.00055515, -0.00000113, 0.00000000],
+		[-6.27284663, -0.00055225, 0.00033838, 0.00055505, -0.00000113, 0.00000000],
+		[-6.27284686, -0.00055215, 0.00033832, 0.00055495, -0.00000113, 0.00000000],
+		[-6.27284710, -0.00055205, 0.00033826, 0.00055485, -0.00000113, 0.00000000],
+		[-6.27284733, -0.00055195, 0.00033820, 0.00055475, -0.00000113, 0.00000000],
+		[-6.27284757, -0.00055185, 0.00033814, 0.00055465, -0.00000113, 0.00000000],
+		[-6.27284781, -0.00055175, 0.00033808, 0.00055455, -0.00000113, 0.00000000],
+		[-6.27284804, -0.00055165, 0.00033802, 0.00055446, -0.00000113, 0.00000000],
+		[-6.27284828, -0.00055156, 0.00033796, 0.00055436, -0.00000113, 0.00000000],
+		[-6.27284851, -0.00055146, 0.00033790, 0.00055426, -0.00000113, 0.00000000],
+		[-6.27284875, -0.00055136, 0.00033784, 0.00055416, -0.00000113, 0.00000000],
+		[-6.27284898, -0.00055126, 0.00033778, 0.00055406, -0.00000113, 0.00000000],
+		[-6.27284922, -0.00055116, 0.00033772, 0.00055396, -0.00000113, 0.00000000],
+		[-6.27284945, -0.00055107, 0.00033766, 0.00055386, -0.00000113, 0.00000000],
+		[-6.27284968, -0.00055097, 0.00033760, 0.00055377, -0.00000113, 0.00000000],
+		[-6.27284992, -0.00055087, 0.00033754, 0.00055367, -0.00000113, 0.00000000],
+		[-6.27285015, -0.00055077, 0.00033748, 0.00055357, -0.00000113, 0.00000000],
+		[-6.27285039, -0.00055067, 0.00033742, 0.00055347, -0.00000113, 0.00000000],
+		[-6.27285062, -0.00055058, 0.00033736, 0.00055337, -0.00000113, 0.00000000],
+		[-6.27285086, -0.00055048, 0.00033730, 0.00055327, -0.00000113, 0.00000000],
+		[-6.27285109, -0.00055038, 0.00033724, 0.00055317, -0.00000113, 0.00000000],
+		[-6.27285133, -0.00055028, 0.00033718, 0.00055308, -0.00000113, 0.00000000],
+		[-6.27285156, -0.00055018, 0.00033712, 0.00055298, -0.00000113, 0.00000000],
+		[-6.27285179, -0.00055009, 0.00033706, 0.00055288, -0.00000113, 0.00000000],
+		[-6.27285203, -0.00054999, 0.00033700, 0.00055278, -0.00000113, 0.00000000],
+		[-6.27285226, -0.00054989, 0.00033694, 0.00055268, -0.00000113, 0.00000000],
+		[-6.27285249, -0.00054979, 0.00033688, 0.00055258, -0.00000113, 0.00000000],
+		[-6.27285273, -0.00054970, 0.00033682, 0.00055249, -0.00000113, 0.00000000],
+		[-6.27285296, -0.00054960, 0.00033676, 0.00055239, -0.00000113, 0.00000000],
+		[-6.27285319, -0.00054950, 0.00033670, 0.00055229, -0.00000113, 0.00000000],
+		[-6.27285343, -0.00054940, 0.00033664, 0.00055219, -0.00000113, 0.00000000],
+		[-6.27285366, -0.00054931, 0.00033658, 0.00055209, -0.00000113, 0.00000000],
+		[-6.27285389, -0.00054921, 0.00033652, 0.00055200, -0.00000113, 0.00000000],
+		[-6.27285413, -0.00054911, 0.00033646, 0.00055190, -0.00000113, 0.00000000],
+		[-6.27285436, -0.00054901, 0.00033640, 0.00055180, -0.00000113, 0.00000000],
+		[-6.27285459, -0.00054892, 0.00033634, 0.00055170, -0.00000113, 0.00000000],
+		[-6.27285483, -0.00054882, 0.00033628, 0.00055160, -0.00000113, 0.00000000],
+		[-6.27285506, -0.00054872, 0.00033622, 0.00055151, -0.00000113, 0.00000000],
+		[-6.27285529, -0.00054862, 0.00033616, 0.00055141, -0.00000113, 0.00000000],
+		[-6.27285552, -0.00054853, 0.00033610, 0.00055131, -0.00000113, 0.00000000],
+		[-6.27285576, -0.00054843, 0.00033604, 0.00055121, -0.00000113, 0.00000000],
+		[-6.27285599, -0.00054833, 0.00033598, 0.00055112, -0.00000113, 0.00000000],
+		[-6.27285622, -0.00054824, 0.00033592, 0.00055102, -0.00000113, 0.00000000],
+		[-6.27285645, -0.00054814, 0.00033586, 0.00055092, -0.00000113, 0.00000000],
+		[-6.27285669, -0.00054804, 0.00033580, 0.00055082, -0.00000113, 0.00000000],
+		[-6.27285692, -0.00054794, 0.00033574, 0.00055073, -0.00000113, 0.00000000],
+		[-6.27285715, -0.00054785, 0.00033568, 0.00055063, -0.00000113, 0.00000000],
+		[-6.27285738, -0.00054775, 0.00033563, 0.00055053, -0.00000113, 0.00000000],
+		[-6.27285761, -0.00054765, 0.00033557, 0.00055043, -0.00000113, 0.00000000],
+		[-6.27285785, -0.00054756, 0.00033551, 0.00055034, -0.00000113, 0.00000000],
+		[-6.27285808, -0.00054746, 0.00033545, 0.00055024, -0.00000113, 0.00000000],
+		[-6.27285831, -0.00054736, 0.00033539, 0.00055014, -0.00000113, 0.00000000],
+		[-6.27285854, -0.00054727, 0.00033533, 0.00055004, -0.00000113, 0.00000000],
+		[-6.27285877, -0.00054717, 0.00033527, 0.00054995, -0.00000113, 0.00000000],
+		[-6.27285900, -0.00054707, 0.00033521, 0.00054985, -0.00000113, 0.00000000],
+		[-6.27285923, -0.00054698, 0.00033515, 0.00054975, -0.00000113, 0.00000000],
+		[-6.27285947, -0.00054688, 0.00033509, 0.00054966, -0.00000113, 0.00000000],
+		[-6.27285970, -0.00054678, 0.00033503, 0.00054956, -0.00000113, 0.00000000],
+		[-6.27285993, -0.00054669, 0.00033497, 0.00054946, -0.00000113, 0.00000000],
+		[-6.27286016, -0.00054659, 0.00033491, 0.00054936, -0.00000113, 0.00000000],
+		[-6.27286039, -0.00054649, 0.00033485, 0.00054927, -0.00000113, 0.00000000],
+		[-6.27286062, -0.00054640, 0.00033480, 0.00054917, -0.00000113, 0.00000000],
+		[-6.27286085, -0.00054630, 0.00033474, 0.00054907, -0.00000113, 0.00000000],
+		[-6.27286108, -0.00054620, 0.00033468, 0.00054898, -0.00000113, 0.00000000],
+		[-6.27286131, -0.00054611, 0.00033462, 0.00054888, -0.00000113, 0.00000000],
+		[-6.27286154, -0.00054601, 0.00033456, 0.00054878, -0.00000113, 0.00000000],
+		[-6.27286177, -0.00054591, 0.00033450, 0.00054869, -0.00000113, 0.00000000],
+		[-6.27286200, -0.00054582, 0.00033444, 0.00054859, -0.00000113, 0.00000000],
+		[-6.27286223, -0.00054572, 0.00033438, 0.00054849, -0.00000113, 0.00000000],
+		[-6.27286246, -0.00054563, 0.00033432, 0.00054840, -0.00000113, 0.00000000],
+		[-6.27286269, -0.00054553, 0.00033426, 0.00054830, -0.00000113, 0.00000000],
+		[-6.27286292, -0.00054543, 0.00033420, 0.00054820, -0.00000113, 0.00000000],
+		[-6.27286315, -0.00054534, 0.00033415, 0.00054811, -0.00000113, 0.00000000],
+		[-6.27286338, -0.00054524, 0.00033409, 0.00054801, -0.00000113, 0.00000000],
+		[-6.27286361, -0.00054515, 0.00033403, 0.00054791, -0.00000113, 0.00000000],
+		[-6.27286384, -0.00054505, 0.00033397, 0.00054782, -0.00000113, 0.00000000],
+		[-6.27286407, -0.00054495, 0.00033391, 0.00054772, -0.00000113, 0.00000000],
+		[-6.27286430, -0.00054486, 0.00033385, 0.00054762, -0.00000113, 0.00000000],
+		[-6.27286453, -0.00054476, 0.00033379, 0.00054753, -0.00000113, 0.00000000],
+		[-6.27286476, -0.00054467, 0.00033373, 0.00054743, -0.00000113, 0.00000000],
+		[-6.27286499, -0.00054457, 0.00033368, 0.00054733, -0.00000113, 0.00000000],
+		[-6.27286522, -0.00054447, 0.00033362, 0.00054724, -0.00000113, 0.00000000],
+		[-6.27286545, -0.00054438, 0.00033356, 0.00054714, -0.00000113, 0.00000000],
+		[-6.27286568, -0.00054428, 0.00033350, 0.00054705, -0.00000113, 0.00000000],
+		[-6.27286591, -0.00054419, 0.00033344, 0.00054695, -0.00000113, 0.00000000],
+		[-6.27286614, -0.00054409, 0.00033338, 0.00054685, -0.00000113, 0.00000000],
+		[-6.27286636, -0.00054400, 0.00033332, 0.00054676, -0.00000113, 0.00000000],
+		[-6.27286659, -0.00054390, 0.00033326, 0.00054666, -0.00000113, 0.00000000],
+		[-6.27286682, -0.00054380, 0.00033321, 0.00054657, -0.00000113, 0.00000000],
+		[-6.27286705, -0.00054371, 0.00033315, 0.00054647, -0.00000113, 0.00000000],
+		[-6.27286728, -0.00054361, 0.00033309, 0.00054637, -0.00000113, 0.00000000],
+		[-6.27286751, -0.00054352, 0.00033303, 0.00054628, -0.00000113, 0.00000000],
+		[-6.27286774, -0.00054342, 0.00033297, 0.00054618, -0.00000113, 0.00000000],
+		[-6.27286796, -0.00054333, 0.00033291, 0.00054609, -0.00000113, 0.00000000],
+		[-6.27286819, -0.00054323, 0.00033286, 0.00054599, -0.00000113, 0.00000000],
+		[-6.27286842, -0.00054314, 0.00033280, 0.00054589, -0.00000113, 0.00000000],
+		[-6.27286865, -0.00054304, 0.00033274, 0.00054580, -0.00000113, 0.00000000],
+		[-6.27286888, -0.00054295, 0.00033268, 0.00054570, -0.00000113, 0.00000000],
+		[-6.27286910, -0.00054285, 0.00033262, 0.00054561, -0.00000113, 0.00000000],
+		[-6.27286933, -0.00054276, 0.00033256, 0.00054551, -0.00000113, 0.00000000],
+		[-6.27286956, -0.00054266, 0.00033250, 0.00054542, -0.00000113, 0.00000000],
+		[-6.27286979, -0.00054257, 0.00033245, 0.00054532, -0.00000113, 0.00000000],
+		[-6.27287001, -0.00054247, 0.00033239, 0.00054522, -0.00000113, 0.00000000],
+		[-6.27287024, -0.00054238, 0.00033233, 0.00054513, -0.00000113, 0.00000000],
+		[-6.27287047, -0.00054228, 0.00033227, 0.00054503, -0.00000113, 0.00000000],
+		[-6.27287070, -0.00054219, 0.00033221, 0.00054494, -0.00000113, 0.00000000],
+		[-6.27287092, -0.00054209, 0.00033216, 0.00054484, -0.00000113, 0.00000000],
+		[-6.27287115, -0.00054200, 0.00033210, 0.00054475, -0.00000113, 0.00000000],
+		[-6.27287138, -0.00054190, 0.00033204, 0.00054465, -0.00000113, 0.00000000],
+		[-6.27287160, -0.00054181, 0.00033198, 0.00054456, -0.00000113, 0.00000000],
+		[-6.27287183, -0.00054171, 0.00033192, 0.00054446, -0.00000113, 0.00000000],
+		[-6.27287206, -0.00054162, 0.00033186, 0.00054437, -0.00000113, 0.00000000],
+		[-6.27287228, -0.00054152, 0.00033181, 0.00054427, -0.00000113, 0.00000000],
+		[-6.27287251, -0.00054143, 0.00033175, 0.00054417, -0.00000113, 0.00000000],
+		[-6.27287274, -0.00054133, 0.00033169, 0.00054408, -0.00000113, 0.00000000],
+		[-6.27287296, -0.00054124, 0.00033163, 0.00054398, -0.00000113, 0.00000000],
+		[-6.27287319, -0.00054114, 0.00033157, 0.00054389, -0.00000113, 0.00000000],
+		[-6.27287342, -0.00054105, 0.00033152, 0.00054379, -0.00000113, 0.00000000],
+		[-6.27287364, -0.00054095, 0.00033146, 0.00054370, -0.00000113, 0.00000000],
+		[-6.27287387, -0.00054086, 0.00033140, 0.00054360, -0.00000113, 0.00000000],
+		[-6.27287409, -0.00054076, 0.00033134, 0.00054351, -0.00000113, 0.00000000],
+		[-6.27287432, -0.00054067, 0.00033128, 0.00054341, -0.00000113, 0.00000000],
+		[-6.27287455, -0.00054058, 0.00033123, 0.00054332, -0.00000113, 0.00000000],
+		[-6.27287477, -0.00054048, 0.00033117, 0.00054322, -0.00000113, 0.00000000],
+		[-6.27287500, -0.00054039, 0.00033111, 0.00054313, -0.00000113, 0.00000000],
+		[-6.27287522, -0.00054029, 0.00033105, 0.00054304, -0.00000113, 0.00000000],
+		[-6.27287545, -0.00054020, 0.00033100, 0.00054294, -0.00000113, 0.00000000],
+		[-6.27287568, -0.00054010, 0.00033094, 0.00054285, -0.00000113, 0.00000000],
+		[-6.27287590, -0.00054001, 0.00033088, 0.00054275, -0.00000113, 0.00000000],
+		[-6.27287613, -0.00053992, 0.00033082, 0.00054266, -0.00000113, 0.00000000],
+		[-6.27287635, -0.00053982, 0.00033076, 0.00054256, -0.00000113, 0.00000000],
+		[-6.27287658, -0.00053973, 0.00033071, 0.00054247, -0.00000113, 0.00000000],
+		[-6.27287680, -0.00053963, 0.00033065, 0.00054237, -0.00000113, 0.00000000],
+		[-6.27287703, -0.00053954, 0.00033059, 0.00054228, -0.00000113, 0.00000000],
+		[-6.27287725, -0.00053945, 0.00033053, 0.00054218, -0.00000113, 0.00000000],
+		[-6.27287748, -0.00053935, 0.00033048, 0.00054209, -0.00000113, 0.00000000],
+		[-6.27287770, -0.00053926, 0.00033042, 0.00054199, -0.00000113, 0.00000000],
+		[-6.27287793, -0.00053916, 0.00033036, 0.00054190, -0.00000113, 0.00000000],
+		[-6.27287815, -0.00053907, 0.00033030, 0.00054181, -0.00000113, 0.00000000],
+		[-6.27287838, -0.00053898, 0.00033025, 0.00054171, -0.00000113, 0.00000000],
+		[-6.27287860, -0.00053888, 0.00033019, 0.00054162, -0.00000113, 0.00000000],
+		[-6.27287882, -0.00053879, 0.00033013, 0.00054152, -0.00000113, 0.00000000],
+		[-6.27287905, -0.00053869, 0.00033007, 0.00054143, -0.00000113, 0.00000000],
+		[-6.27287927, -0.00053860, 0.00033002, 0.00054133, -0.00000113, 0.00000000],
+		[-6.27287950, -0.00053851, 0.00032996, 0.00054124, -0.00000113, 0.00000000],
+		[-6.27287972, -0.00053841, 0.00032990, 0.00054115, -0.00000113, 0.00000000],
+		[-6.27287994, -0.00053832, 0.00032984, 0.00054105, -0.00000113, 0.00000000],
+		[-6.27288017, -0.00053823, 0.00032979, 0.00054096, -0.00000113, 0.00000000],
+		[-6.27288039, -0.00053813, 0.00032973, 0.00054086, -0.00000113, 0.00000000],
+		[-6.27288062, -0.00053804, 0.00032967, 0.00054077, -0.00000113, 0.00000000],
+		[-6.27288084, -0.00053795, 0.00032961, 0.00054068, -0.00000113, 0.00000000],
+		[-6.27288106, -0.00053785, 0.00032956, 0.00054058, -0.00000113, 0.00000000],
+		[-6.27288129, -0.00053776, 0.00032950, 0.00054049, -0.00000113, 0.00000000],
+		[-6.27288151, -0.00053767, 0.00032944, 0.00054039, -0.00000113, 0.00000000],
+		[-6.27288173, -0.00053757, 0.00032938, 0.00054030, -0.00000113, 0.00000000],
+		[-6.27288196, -0.00053748, 0.00032933, 0.00054021, -0.00000113, 0.00000000],
+		[-6.27288218, -0.00053739, 0.00032927, 0.00054011, -0.00000113, 0.00000000],
+		[-6.27288240, -0.00053729, 0.00032921, 0.00054002, -0.00000113, 0.00000000],
+		[-6.27288263, -0.00053720, 0.00032916, 0.00053992, -0.00000113, 0.00000000],
+		[-6.27288285, -0.00053711, 0.00032910, 0.00053983, -0.00000113, 0.00000000],
+		[-6.27288307, -0.00053701, 0.00032904, 0.00053974, -0.00000113, 0.00000000],
+		[-6.27288330, -0.00053692, 0.00032898, 0.00053964, -0.00000113, 0.00000000],
+		[-6.27288352, -0.00053683, 0.00032893, 0.00053955, -0.00000113, 0.00000000],
+		[-6.27288374, -0.00053673, 0.00032887, 0.00053946, -0.00000113, 0.00000000],
+		[-6.27288396, -0.00053664, 0.00032881, 0.00053936, -0.00000113, 0.00000000],
+		[-6.27288419, -0.00053655, 0.00032876, 0.00053927, -0.00000113, 0.00000000],
+		[-6.27288441, -0.00053645, 0.00032870, 0.00053918, -0.00000113, 0.00000000],
+		[-6.27288463, -0.00053636, 0.00032864, 0.00053908, -0.00000113, 0.00000000],
+		[-6.27288485, -0.00053627, 0.00032859, 0.00053899, -0.00000113, 0.00000000],
+		[-6.27288508, -0.00053618, 0.00032853, 0.00053890, -0.00000113, 0.00000000],
+		[-6.27288530, -0.00053608, 0.00032847, 0.00053880, -0.00000113, 0.00000000],
+		[-6.27288552, -0.00053599, 0.00032841, 0.00053871, -0.00000113, 0.00000000],
+		[-6.27288574, -0.00053590, 0.00032836, 0.00053862, -0.00000113, 0.00000000],
+		[-6.27288596, -0.00053580, 0.00032830, 0.00053852, -0.00000113, 0.00000000],
+		[-6.27288619, -0.00053571, 0.00032824, 0.00053843, -0.00000113, 0.00000000],
+		[-6.27288641, -0.00053562, 0.00032819, 0.00053834, -0.00000113, 0.00000000],
+		[-6.27288663, -0.00053553, 0.00032813, 0.00053824, -0.00000113, 0.00000000],
+		[-6.27288685, -0.00053543, 0.00032807, 0.00053815, -0.00000113, 0.00000000],
+		[-6.27288707, -0.00053534, 0.00032802, 0.00053806, -0.00000113, 0.00000000],
+		[-6.27288729, -0.00053525, 0.00032796, 0.00053796, -0.00000113, 0.00000000],
+		[-6.27288752, -0.00053516, 0.00032790, 0.00053787, -0.00000113, 0.00000000],
+		[-6.27288774, -0.00053506, 0.00032785, 0.00053778, -0.00000113, 0.00000000],
+		[-6.27288796, -0.00053497, 0.00032779, 0.00053769, -0.00000113, 0.00000000],
+		[-6.27288818, -0.00053488, 0.00032773, 0.00053759, -0.00000113, 0.00000000],
+		[-6.27288840, -0.00053479, 0.00032768, 0.00053750, -0.00000113, 0.00000000],
+		[-6.27288862, -0.00053469, 0.00032762, 0.00053741, -0.00000113, 0.00000000],
+		[-6.27288884, -0.00053460, 0.00032756, 0.00053731, -0.00000113, 0.00000000],
+		[-6.27288906, -0.00053451, 0.00032751, 0.00053722, -0.00000113, 0.00000000],
+		[-6.27288928, -0.00053442, 0.00032745, 0.00053713, -0.00000113, 0.00000000],
+		[-6.27288950, -0.00053432, 0.00032739, 0.00053704, -0.00000113, 0.00000000],
+		[-6.27288973, -0.00053423, 0.00032734, 0.00053694, -0.00000113, 0.00000000],
+		[-6.27288995, -0.00053414, 0.00032728, 0.00053685, -0.00000113, 0.00000000],
+		[-6.27289017, -0.00053405, 0.00032722, 0.00053676, -0.00000113, 0.00000000],
+		[-6.27289039, -0.00053396, 0.00032717, 0.00053666, -0.00000113, 0.00000000],
+		[-6.27289061, -0.00053386, 0.00032711, 0.00053657, -0.00000113, 0.00000000],
+		[-6.27289083, -0.00053377, 0.00032705, 0.00053648, -0.00000113, 0.00000000],
+		[-6.27289105, -0.00053368, 0.00032700, 0.00053639, -0.00000113, 0.00000000],
+		[-6.27289127, -0.00053359, 0.00032694, 0.00053629, -0.00000113, 0.00000000],
+		[-6.27289149, -0.00053350, 0.00032689, 0.00053620, -0.00000113, 0.00000000],
+		[-6.27289171, -0.00053340, 0.00032683, 0.00053611, -0.00000113, 0.00000000],
+		[-6.27289193, -0.00053331, 0.00032677, 0.00053602, -0.00000113, 0.00000000],
+		[-6.27289215, -0.00053322, 0.00032672, 0.00053593, -0.00000113, 0.00000000],
+		[-6.27289237, -0.00053313, 0.00032666, 0.00053583, -0.00000113, 0.00000000],
+		[-6.27289259, -0.00053304, 0.00032660, 0.00053574, -0.00000113, 0.00000000],
+		[-6.27289281, -0.00053294, 0.00032655, 0.00053565, -0.00000113, 0.00000000],
+		[-6.27289303, -0.00053285, 0.00032649, 0.00053556, -0.00000113, 0.00000000],
+		[-6.27289325, -0.00053276, 0.00032643, 0.00053546, -0.00000113, 0.00000000],
+		[-6.27289346, -0.00053267, 0.00032638, 0.00053537, -0.00000113, 0.00000000],
+		[-6.27289368, -0.00053258, 0.00032632, 0.00053528, -0.00000113, 0.00000000],
+		[-6.27289390, -0.00053249, 0.00032627, 0.00053519, -0.00000113, 0.00000000],
+		[-6.27289412, -0.00053239, 0.00032621, 0.00053510, -0.00000113, 0.00000000],
+		[-6.27289434, -0.00053230, 0.00032615, 0.00053500, -0.00000113, 0.00000000],
+		[-6.27289456, -0.00053221, 0.00032610, 0.00053491, -0.00000113, 0.00000000],
+		[-6.27289478, -0.00053212, 0.00032604, 0.00053482, -0.00000113, 0.00000000],
+		[-6.27289500, -0.00053203, 0.00032599, 0.00053473, -0.00000113, 0.00000000],
+		[-6.27289522, -0.00053194, 0.00032593, 0.00053464, -0.00000113, 0.00000000],
+		[-6.27289544, -0.00053185, 0.00032587, 0.00053454, -0.00000113, 0.00000000],
+		[-6.27289565, -0.00053175, 0.00032582, 0.00053445, -0.00000113, 0.00000000],
+		[-6.27289587, -0.00053166, 0.00032576, 0.00053436, -0.00000113, 0.00000000],
+		[-6.27289609, -0.00053157, 0.00032571, 0.00053427, -0.00000113, 0.00000000],
+		[-6.27289631, -0.00053148, 0.00032565, 0.00053418, -0.00000113, 0.00000000],
+		[-6.27289653, -0.00053139, 0.00032559, 0.00053408, -0.00000113, 0.00000000],
+		[-6.27289675, -0.00053130, 0.00032554, 0.00053399, -0.00000113, 0.00000000],
+		[-6.27289696, -0.00053121, 0.00032548, 0.00053390, -0.00000113, 0.00000000],
+		[-6.27289718, -0.00053112, 0.00032543, 0.00053381, -0.00000113, 0.00000000],
+		[-6.27289740, -0.00053102, 0.00032537, 0.00053372, -0.00000113, 0.00000000],
+		[-6.27289762, -0.00053093, 0.00032531, 0.00053363, -0.00000113, 0.00000000],
+		[-6.27289784, -0.00053084, 0.00032526, 0.00053354, -0.00000113, 0.00000000],
+		[-6.27289805, -0.00053075, 0.00032520, 0.00053344, -0.00000113, 0.00000000],
+		[-6.27289827, -0.00053066, 0.00032515, 0.00053335, -0.00000113, 0.00000000],
+		[-6.27289849, -0.00053057, 0.00032509, 0.00053326, -0.00000113, 0.00000000],
+		[-6.27289871, -0.00053048, 0.00032504, 0.00053317, -0.00000113, 0.00000000],
+		[-6.27289892, -0.00053039, 0.00032498, 0.00053308, -0.00000113, 0.00000000],
+		[-6.27289914, -0.00053030, 0.00032492, 0.00053299, -0.00000113, 0.00000000],
+		[-6.27289936, -0.00053021, 0.00032487, 0.00053290, -0.00000113, 0.00000000],
+		[-6.27289958, -0.00053012, 0.00032481, 0.00053280, -0.00000113, 0.00000000],
+		[-6.27289979, -0.00053002, 0.00032476, 0.00053271, -0.00000113, 0.00000000],
+		[-6.27290001, -0.00052993, 0.00032470, 0.00053262, -0.00000113, 0.00000000],
+		[-6.27290023, -0.00052984, 0.00032465, 0.00053253, -0.00000113, 0.00000000],
+		[-6.27290044, -0.00052975, 0.00032459, 0.00053244, -0.00000113, 0.00000000],
+		[-6.27290066, -0.00052966, 0.00032453, 0.00053235, -0.00000113, 0.00000000],
+		[-6.27290088, -0.00052957, 0.00032448, 0.00053226, -0.00000113, 0.00000000],
+		[-6.27290109, -0.00052948, 0.00032442, 0.00053217, -0.00000113, 0.00000000],
+		[-6.27290131, -0.00052939, 0.00032437, 0.00053208, -0.00000113, 0.00000000],
+		[-6.27290153, -0.00052930, 0.00032431, 0.00053198, -0.00000113, 0.00000000],
+		[-6.27290174, -0.00052921, 0.00032426, 0.00053189, -0.00000113, 0.00000000],
+		[-6.27290196, -0.00052912, 0.00032420, 0.00053180, -0.00000113, 0.00000000],
+		[-6.27290218, -0.00052903, 0.00032415, 0.00053171, -0.00000113, 0.00000000],
+		[-6.27290239, -0.00052894, 0.00032409, 0.00053162, -0.00000113, 0.00000000],
+		[-6.27290261, -0.00052885, 0.00032404, 0.00053153, -0.00000113, 0.00000000],
+		[-6.27290283, -0.00052876, 0.00032398, 0.00053144, -0.00000113, 0.00000000],
+		[-6.27290304, -0.00052867, 0.00032392, 0.00053135, -0.00000113, 0.00000000],
+		[-6.27290326, -0.00052858, 0.00032387, 0.00053126, -0.00000113, 0.00000000],
+		[-6.27290347, -0.00052849, 0.00032381, 0.00053117, -0.00000113, 0.00000000],
+		[-6.27290369, -0.00052840, 0.00032376, 0.00053108, -0.00000113, 0.00000000],
+		[-6.27290391, -0.00052831, 0.00032370, 0.00053099, -0.00000113, 0.00000000],
+		[-6.27290412, -0.00052822, 0.00032365, 0.00053089, -0.00000113, 0.00000000],
+		[-6.27290434, -0.00052813, 0.00032359, 0.00053080, -0.00000113, 0.00000000],
+		[-6.27290455, -0.00052804, 0.00032354, 0.00053071, -0.00000113, 0.00000000],
+		[-6.27290477, -0.00052795, 0.00032348, 0.00053062, -0.00000113, 0.00000000],
+		[-6.27290498, -0.00052786, 0.00032343, 0.00053053, -0.00000113, 0.00000000],
+		[-6.27290520, -0.00052777, 0.00032337, 0.00053044, -0.00000113, 0.00000000],
+		[-6.27290541, -0.00052768, 0.00032332, 0.00053035, -0.00000113, 0.00000000],
+		[-6.27290563, -0.00052759, 0.00032326, 0.00053026, -0.00000113, 0.00000000],
+		[-6.27290584, -0.00052750, 0.00032321, 0.00053017, -0.00000113, 0.00000000],
+		[-6.27290606, -0.00052741, 0.00032315, 0.00053008, -0.00000113, 0.00000000],
+		[-6.27290627, -0.00052732, 0.00032310, 0.00052999, -0.00000113, 0.00000000],
+		[-6.27290649, -0.00052723, 0.00032304, 0.00052990, -0.00000113, 0.00000000],
+		[-6.27290670, -0.00052714, 0.00032299, 0.00052981, -0.00000113, 0.00000000],
+		[-6.27290692, -0.00052705, 0.00032293, 0.00052972, -0.00000113, 0.00000000],
+		[-6.27290713, -0.00052696, 0.00032288, 0.00052963, -0.00000113, 0.00000000],
+		[-6.27290735, -0.00052687, 0.00032282, 0.00052954, -0.00000113, 0.00000000],
+		[-6.27290756, -0.00052678, 0.00032277, 0.00052945, -0.00000113, 0.00000000],
+		[-6.27290778, -0.00052669, 0.00032271, 0.00052936, -0.00000113, 0.00000000],
+		[-6.27290799, -0.00052660, 0.00032266, 0.00052927, -0.00000113, 0.00000000],
+		[-6.27290821, -0.00052651, 0.00032260, 0.00052918, -0.00000113, 0.00000000],
+		[-6.27290842, -0.00052642, 0.00032255, 0.00052909, -0.00000113, 0.00000000],
+		[-6.27290863, -0.00052633, 0.00032249, 0.00052900, -0.00000113, 0.00000000],
+		[-6.27290885, -0.00052624, 0.00032244, 0.00052891, -0.00000113, 0.00000000],
+		[-6.27290906, -0.00052615, 0.00032238, 0.00052882, -0.00000113, 0.00000000],
+		[-6.27290928, -0.00052606, 0.00032233, 0.00052873, -0.00000113, 0.00000000],
+		[-6.27290949, -0.00052597, 0.00032227, 0.00052864, -0.00000113, 0.00000000],
+		[-6.27290970, -0.00052588, 0.00032222, 0.00052855, -0.00000113, 0.00000000],
+		[-6.27290992, -0.00052579, 0.00032216, 0.00052846, -0.00000113, 0.00000000],
+		[-6.27291013, -0.00052570, 0.00032211, 0.00052837, -0.00000113, 0.00000000],
+		[-6.27291034, -0.00052561, 0.00032205, 0.00052828, -0.00000113, 0.00000000],
+		[-6.27291056, -0.00052553, 0.00032200, 0.00052819, -0.00000113, 0.00000000],
+		[-6.27291077, -0.00052544, 0.00032194, 0.00052810, -0.00000113, 0.00000000],
+		[-6.27291098, -0.00052535, 0.00032189, 0.00052801, -0.00000113, 0.00000000],
+		[-6.27291120, -0.00052526, 0.00032183, 0.00052792, -0.00000113, 0.00000000],
+		[-6.27291141, -0.00052517, 0.00032178, 0.00052783, -0.00000113, 0.00000000],
+		[-6.27291162, -0.00052508, 0.00032173, 0.00052774, -0.00000113, 0.00000000],
+		[-6.27291184, -0.00052499, 0.00032167, 0.00052765, -0.00000113, 0.00000000],
+		[-6.27291205, -0.00052490, 0.00032162, 0.00052756, -0.00000113, 0.00000000],
+		[-6.27291226, -0.00052481, 0.00032156, 0.00052747, -0.00000113, 0.00000000],
+		[-6.27291248, -0.00052472, 0.00032151, 0.00052738, -0.00000113, 0.00000000],
+		[-6.27291269, -0.00052463, 0.00032145, 0.00052730, -0.00000113, 0.00000000],
+		[-6.27291290, -0.00052455, 0.00032140, 0.00052721, -0.00000113, 0.00000000],
+		[-6.27291311, -0.00052446, 0.00032134, 0.00052712, -0.00000113, 0.00000000],
+		[-6.27291333, -0.00052437, 0.00032129, 0.00052703, -0.00000113, 0.00000000],
+		[-6.27291354, -0.00052428, 0.00032123, 0.00052694, -0.00000113, 0.00000000],
+		[-6.27291375, -0.00052419, 0.00032118, 0.00052685, -0.00000113, 0.00000000],
+		[-6.27291396, -0.00052410, 0.00032113, 0.00052676, -0.00000113, 0.00000000],
+		[-6.27291418, -0.00052401, 0.00032107, 0.00052667, -0.00000113, 0.00000000],
+		[-6.27291439, -0.00052392, 0.00032102, 0.00052658, -0.00000113, 0.00000000],
+		[-6.27291460, -0.00052384, 0.00032096, 0.00052649, -0.00000113, 0.00000000],
+		[-6.27291481, -0.00052375, 0.00032091, 0.00052640, -0.00000113, 0.00000000],
+		[-6.27291503, -0.00052366, 0.00032085, 0.00052631, -0.00000113, 0.00000000],
+		[-6.27291524, -0.00052357, 0.00032080, 0.00052622, -0.00000113, 0.00000000],
+		[-6.27291545, -0.00052348, 0.00032075, 0.00052614, -0.00000113, 0.00000000],
+		[-6.27291566, -0.00052339, 0.00032069, 0.00052605, -0.00000113, 0.00000000],
+		[-6.27291587, -0.00052330, 0.00032064, 0.00052596, -0.00000113, 0.00000000],
+		[-6.27291608, -0.00052322, 0.00032058, 0.00052587, -0.00000113, 0.00000000],
+		[-6.27291630, -0.00052313, 0.00032053, 0.00052578, -0.00000113, 0.00000000],
+		[-6.27291651, -0.00052304, 0.00032047, 0.00052569, -0.00000113, 0.00000000],
+		[-6.27291672, -0.00052295, 0.00032042, 0.00052560, -0.00000113, 0.00000000],
+		[-6.27291693, -0.00052286, 0.00032037, 0.00052551, -0.00000113, 0.00000000],
+		[-6.27291714, -0.00052277, 0.00032031, 0.00052542, -0.00000113, 0.00000000],
+		[-6.27291735, -0.00052269, 0.00032026, 0.00052534, -0.00000113, 0.00000000],
+		[-6.27291756, -0.00052260, 0.00032020, 0.00052525, -0.00000113, 0.00000000],
+		[-6.27291777, -0.00052251, 0.00032015, 0.00052516, -0.00000113, 0.00000000],
+		[-6.27291799, -0.00052242, 0.00032010, 0.00052507, -0.00000113, 0.00000000],
+		[-6.27291820, -0.00052233, 0.00032004, 0.00052498, -0.00000113, 0.00000000],
+		[-6.27291841, -0.00052225, 0.00031999, 0.00052489, -0.00000113, 0.00000000],
+		[-6.27291862, -0.00052216, 0.00031993, 0.00052480, -0.00000113, 0.00000000],
+		[-6.27291883, -0.00052207, 0.00031988, 0.00052472, -0.00000113, 0.00000000],
+		[-6.27291904, -0.00052198, 0.00031983, 0.00052463, -0.00000113, 0.00000000],
+		[-6.27291925, -0.00052189, 0.00031977, 0.00052454, -0.00000113, 0.00000000],
+		[-6.27291946, -0.00052180, 0.00031972, 0.00052445, -0.00000113, 0.00000000],
+		[-6.27291967, -0.00052172, 0.00031966, 0.00052436, -0.00000113, 0.00000000],
+		[-6.27291988, -0.00052163, 0.00031961, 0.00052427, -0.00000113, 0.00000000],
+		[-6.27292009, -0.00052154, 0.00031956, 0.00052419, -0.00000113, 0.00000000],
+		[-6.27292030, -0.00052145, 0.00031950, 0.00052410, -0.00000113, 0.00000000],
+		[-6.27292051, -0.00052137, 0.00031945, 0.00052401, -0.00000113, 0.00000000],
+		[-6.27292072, -0.00052128, 0.00031939, 0.00052392, -0.00000113, 0.00000000],
+		[-6.27292093, -0.00052119, 0.00031934, 0.00052383, -0.00000113, 0.00000000],
+		[-6.27292114, -0.00052110, 0.00031929, 0.00052374, -0.00000113, 0.00000000],
+		[-6.27292135, -0.00052101, 0.00031923, 0.00052366, -0.00000113, 0.00000000],
+		[-6.27292156, -0.00052093, 0.00031918, 0.00052357, -0.00000113, 0.00000000],
+		[-6.27292177, -0.00052084, 0.00031913, 0.00052348, -0.00000113, 0.00000000],
+		[-6.27292198, -0.00052075, 0.00031907, 0.00052339, -0.00000113, 0.00000000],
+		[-6.27292219, -0.00052066, 0.00031902, 0.00052330, -0.00000113, 0.00000000],
+		[-6.27292240, -0.00052058, 0.00031896, 0.00052322, -0.00000113, 0.00000000],
+		[-6.27292261, -0.00052049, 0.00031891, 0.00052313, -0.00000113, 0.00000000],
+		[-6.27292282, -0.00052040, 0.00031886, 0.00052304, -0.00000113, 0.00000000],
+		[-6.27292303, -0.00052031, 0.00031880, 0.00052295, -0.00000113, 0.00000000],
+		[-6.27292324, -0.00052023, 0.00031875, 0.00052286, -0.00000113, 0.00000000],
+		[-6.27292345, -0.00052014, 0.00031870, 0.00052278, -0.00000113, 0.00000000],
+		[-6.27292366, -0.00052005, 0.00031864, 0.00052269, -0.00000113, 0.00000000],
+		[-6.27292386, -0.00051996, 0.00031859, 0.00052260, -0.00000113, 0.00000000],
+		[-6.27292407, -0.00051988, 0.00031854, 0.00052251, -0.00000113, 0.00000000],
+		[-6.27292428, -0.00051979, 0.00031848, 0.00052242, -0.00000113, 0.00000000],
+		[-6.27292449, -0.00051970, 0.00031843, 0.00052234, -0.00000113, 0.00000000],
+		[-6.27292470, -0.00051962, 0.00031837, 0.00052225, -0.00000113, 0.00000000],
+		[-6.27292491, -0.00051953, 0.00031832, 0.00052216, -0.00000113, 0.00000000],
+		[-6.27292512, -0.00051944, 0.00031827, 0.00052207, -0.00000113, 0.00000000],
+		[-6.27292533, -0.00051935, 0.00031821, 0.00052199, -0.00000113, 0.00000000],
+		[-6.27292553, -0.00051927, 0.00031816, 0.00052190, -0.00000113, 0.00000000],
+		[-6.27292574, -0.00051918, 0.00031811, 0.00052181, -0.00000113, 0.00000000],
+		[-6.27292595, -0.00051909, 0.00031805, 0.00052172, -0.00000113, 0.00000000],
+		[-6.27292616, -0.00051901, 0.00031800, 0.00052164, -0.00000113, 0.00000000],
+		[-6.27292637, -0.00051892, 0.00031795, 0.00052155, -0.00000113, 0.00000000],
+		[-6.27292658, -0.00051883, 0.00031789, 0.00052146, -0.00000113, 0.00000000],
+		[-6.27292678, -0.00051874, 0.00031784, 0.00052137, -0.00000113, 0.00000000],
+		[-6.27292699, -0.00051866, 0.00031779, 0.00052129, -0.00000113, 0.00000000],
+		[-6.27292720, -0.00051857, 0.00031773, 0.00052120, -0.00000113, 0.00000000],
+		[-6.27292741, -0.00051848, 0.00031768, 0.00052111, -0.00000113, 0.00000000],
+		[-6.27292762, -0.00051840, 0.00031763, 0.00052102, -0.00000113, 0.00000000],
+		[-6.27292782, -0.00051831, 0.00031757, 0.00052094, -0.00000113, 0.00000000],
+		[-6.27292803, -0.00051822, 0.00031752, 0.00052085, -0.00000113, 0.00000000],
+		[-6.27292824, -0.00051814, 0.00031747, 0.00052076, -0.00000113, 0.00000000],
+		[-6.27292845, -0.00051805, 0.00031742, 0.00052068, -0.00000113, 0.00000000],
+		[-6.27292865, -0.00051796, 0.00031736, 0.00052059, -0.00000113, 0.00000000],
+		[-6.27292886, -0.00051788, 0.00031731, 0.00052050, -0.00000113, 0.00000000],
+		[-6.27292907, -0.00051779, 0.00031726, 0.00052041, -0.00000113, 0.00000000],
+		[-6.27292927, -0.00051770, 0.00031720, 0.00052033, -0.00000113, 0.00000000],
+		[-6.27292948, -0.00051762, 0.00031715, 0.00052024, -0.00000113, 0.00000000],
+		[-6.27292969, -0.00051753, 0.00031710, 0.00052015, -0.00000113, 0.00000000],
+		[-6.27292990, -0.00051744, 0.00031704, 0.00052007, -0.00000113, 0.00000000],
+		[-6.27293010, -0.00051736, 0.00031699, 0.00051998, -0.00000113, 0.00000000],
+		[-6.27293031, -0.00051727, 0.00031694, 0.00051989, -0.00000113, 0.00000000],
+		[-6.27293052, -0.00051718, 0.00031688, 0.00051981, -0.00000113, 0.00000000],
+		[-6.27293072, -0.00051710, 0.00031683, 0.00051972, -0.00000113, 0.00000000],
+		[-6.27293093, -0.00051701, 0.00031678, 0.00051963, -0.00000113, 0.00000000],
+		[-6.27293114, -0.00051693, 0.00031673, 0.00051955, -0.00000113, 0.00000000],
+		[-6.27293134, -0.00051684, 0.00031667, 0.00051946, -0.00000113, 0.00000000],
+		[-6.27293155, -0.00051675, 0.00031662, 0.00051937, -0.00000113, 0.00000000],
+		[-6.27293176, -0.00051667, 0.00031657, 0.00051929, -0.00000113, 0.00000000],
+		[-6.27293196, -0.00051658, 0.00031651, 0.00051920, -0.00000113, 0.00000000],
+		[-6.27293217, -0.00051649, 0.00031646, 0.00051911, -0.00000113, 0.00000000],
+		[-6.27293237, -0.00051641, 0.00031641, 0.00051903, -0.00000113, 0.00000000],
+		[-6.27293258, -0.00051632, 0.00031636, 0.00051894, -0.00000113, 0.00000000],
+		[-6.27293279, -0.00051624, 0.00031630, 0.00051885, -0.00000113, 0.00000000],
+		[-6.27293299, -0.00051615, 0.00031625, 0.00051877, -0.00000113, 0.00000000],
+		[-6.27293320, -0.00051606, 0.00031620, 0.00051868, -0.00000113, 0.00000000],
+		[-6.27293340, -0.00051598, 0.00031614, 0.00051859, -0.00000113, 0.00000000],
+		[-6.27293361, -0.00051589, 0.00031609, 0.00051851, -0.00000113, 0.00000000],
+		[-6.27293382, -0.00051581, 0.00031604, 0.00051842, -0.00000113, 0.00000000],
+		[-6.27293402, -0.00051572, 0.00031599, 0.00051833, -0.00000113, 0.00000000],
+		[-6.27293423, -0.00051563, 0.00031593, 0.00051825, -0.00000113, 0.00000000],
+		[-6.27293443, -0.00051555, 0.00031588, 0.00051816, -0.00000113, 0.00000000],
+		[-6.27293464, -0.00051546, 0.00031583, 0.00051807, -0.00000113, 0.00000000],
+		[-6.27293484, -0.00051538, 0.00031578, 0.00051799, -0.00000113, 0.00000000],
+		[-6.27293505, -0.00051529, 0.00031572, 0.00051790, -0.00000113, 0.00000000],
+		[-6.27293525, -0.00051520, 0.00031567, 0.00051782, -0.00000113, 0.00000000],
+		[-6.27293546, -0.00051512, 0.00031562, 0.00051773, -0.00000113, 0.00000000],
+		[-6.27293566, -0.00051503, 0.00031557, 0.00051764, -0.00000113, 0.00000000],
+		[-6.27293587, -0.00051495, 0.00031551, 0.00051756, -0.00000113, 0.00000000],
+		[-6.27293607, -0.00051486, 0.00031546, 0.00051747, -0.00000113, 0.00000000],
+		[-6.27293628, -0.00051478, 0.00031541, 0.00051739, -0.00000113, 0.00000000],
+		[-6.27293648, -0.00051469, 0.00031536, 0.00051730, -0.00000113, 0.00000000],
+		[-6.27293669, -0.00051461, 0.00031530, 0.00051721, -0.00000113, 0.00000000],
+		[-6.27293689, -0.00051452, 0.00031525, 0.00051713, -0.00000113, 0.00000000],
+		[-6.27293710, -0.00051443, 0.00031520, 0.00051704, -0.00000113, 0.00000000],
+		[-6.27293730, -0.00051435, 0.00031515, 0.00051696, -0.00000113, 0.00000000],
+		[-6.27293751, -0.00051426, 0.00031509, 0.00051687, -0.00000113, 0.00000000],
+		[-6.27293771, -0.00051418, 0.00031504, 0.00051678, -0.00000113, 0.00000000],
+		[-6.27293792, -0.00051409, 0.00031499, 0.00051670, -0.00000113, 0.00000000],
+		[-6.27293812, -0.00051401, 0.00031494, 0.00051661, -0.00000113, 0.00000000],
+		[-6.27293832, -0.00051392, 0.00031488, 0.00051653, -0.00000113, 0.00000000],
+		[-6.27293853, -0.00051384, 0.00031483, 0.00051644, -0.00000113, 0.00000000],
+		[-6.27293873, -0.00051375, 0.00031478, 0.00051635, -0.00000113, 0.00000000],
+		[-6.27293894, -0.00051367, 0.00031473, 0.00051627, -0.00000113, 0.00000000],
+		[-6.27293914, -0.00051358, 0.00031467, 0.00051618, -0.00000113, 0.00000000],
+		[-6.27293934, -0.00051350, 0.00031462, 0.00051610, -0.00000113, 0.00000000],
+		[-6.27293955, -0.00051341, 0.00031457, 0.00051601, -0.00000113, 0.00000000],
+		[-6.27293975, -0.00051333, 0.00031452, 0.00051593, -0.00000113, 0.00000000],
+		[-6.27293995, -0.00051324, 0.00031447, 0.00051584, -0.00000113, 0.00000000],
+		[-6.27294016, -0.00051315, 0.00031441, 0.00051576, -0.00000113, 0.00000000],
+		[-6.27294036, -0.00051307, 0.00031436, 0.00051567, -0.00000113, 0.00000000],
+		[-6.27294057, -0.00051298, 0.00031431, 0.00051558, -0.00000113, 0.00000000],
+		[-6.27294077, -0.00051290, 0.00031426, 0.00051550, -0.00000113, 0.00000000],
+		[-6.27294097, -0.00051281, 0.00031421, 0.00051541, -0.00000113, 0.00000000],
+		[-6.27294118, -0.00051273, 0.00031415, 0.00051533, -0.00000113, 0.00000000],
+		[-6.27294138, -0.00051265, 0.00031410, 0.00051524, -0.00000113, 0.00000000],
+		[-6.27294158, -0.00051256, 0.00031405, 0.00051516, -0.00000113, 0.00000000],
+		[-6.27294178, -0.00051248, 0.00031400, 0.00051507, -0.00000113, 0.00000000],
+		[-6.27294199, -0.00051239, 0.00031395, 0.00051499, -0.00000113, 0.00000000],
+		[-6.27294219, -0.00051231, 0.00031389, 0.00051490, -0.00000113, 0.00000000],
+		[-6.27294239, -0.00051222, 0.00031384, 0.00051482, -0.00000113, 0.00000000],
+		[-6.27294260, -0.00051214, 0.00031379, 0.00051473, -0.00000113, 0.00000000],
+		[-6.27294280, -0.00051205, 0.00031374, 0.00051465, -0.00000113, 0.00000000],
+		[-6.27294300, -0.00051197, 0.00031369, 0.00051456, -0.00000113, 0.00000000],
+		[-6.27294320, -0.00051188, 0.00031363, 0.00051448, -0.00000113, 0.00000000],
+		[-6.27294341, -0.00051180, 0.00031358, 0.00051439, -0.00000113, 0.00000000],
+		[-6.27294361, -0.00051171, 0.00031353, 0.00051431, -0.00000113, 0.00000000],
+		[-6.27294381, -0.00051163, 0.00031348, 0.00051422, -0.00000113, 0.00000000],
+		[-6.27294401, -0.00051154, 0.00031343, 0.00051414, -0.00000113, 0.00000000],
+		[-6.27294422, -0.00051146, 0.00031337, 0.00051405, -0.00000113, 0.00000000],
+		[-6.27294442, -0.00051137, 0.00031332, 0.00051397, -0.00000113, 0.00000000],
+		[-6.27294462, -0.00051129, 0.00031327, 0.00051388, -0.00000113, 0.00000000],
+		[-6.27294482, -0.00051121, 0.00031322, 0.00051380, -0.00000113, 0.00000000],
+		[-6.27294502, -0.00051112, 0.00031317, 0.00051371, -0.00000113, 0.00000000],
+		[-6.27294523, -0.00051104, 0.00031312, 0.00051363, -0.00000113, 0.00000000],
+		[-6.27294543, -0.00051095, 0.00031306, 0.00051354, -0.00000113, 0.00000000],
+		[-6.27294563, -0.00051087, 0.00031301, 0.00051346, -0.00000113, 0.00000000],
+		[-6.27294583, -0.00051078, 0.00031296, 0.00051337, -0.00000113, 0.00000000],
+		[-6.27294603, -0.00051070, 0.00031291, 0.00051329, -0.00000113, 0.00000000],
+		[-6.27294623, -0.00051062, 0.00031286, 0.00051320, -0.00000113, 0.00000000],
+		[-6.27294644, -0.00051053, 0.00031281, 0.00051312, -0.00000113, 0.00000000],
+		[-6.27294664, -0.00051045, 0.00031275, 0.00051303, -0.00000113, 0.00000000],
+		[-6.27294684, -0.00051036, 0.00031270, 0.00051295, -0.00000113, 0.00000000],
+		[-6.27294704, -0.00051028, 0.00031265, 0.00051286, -0.00000113, 0.00000000],
+		[-6.27294724, -0.00051019, 0.00031260, 0.00051278, -0.00000113, 0.00000000],
+		[-6.27294744, -0.00051011, 0.00031255, 0.00051270, -0.00000113, 0.00000000],
+		[-6.27294764, -0.00051003, 0.00031250, 0.00051261, -0.00000113, 0.00000000],
+		[-6.27294784, -0.00050994, 0.00031244, 0.00051253, -0.00000113, 0.00000000],
+		[-6.27294805, -0.00050986, 0.00031239, 0.00051244, -0.00000113, 0.00000000],
+		[-6.27294825, -0.00050977, 0.00031234, 0.00051236, -0.00000113, 0.00000000],
+		[-6.27294845, -0.00050969, 0.00031229, 0.00051227, -0.00000113, 0.00000000],
+		[-6.27294865, -0.00050961, 0.00031224, 0.00051219, -0.00000113, 0.00000000],
+		[-6.27294885, -0.00050952, 0.00031219, 0.00051210, -0.00000113, 0.00000000],
+		[-6.27294905, -0.00050944, 0.00031214, 0.00051202, -0.00000113, 0.00000000],
+		[-6.27294925, -0.00050936, 0.00031208, 0.00051194, -0.00000113, 0.00000000],
+		[-6.27294945, -0.00050927, 0.00031203, 0.00051185, -0.00000113, 0.00000000],
+		[-6.27294965, -0.00050919, 0.00031198, 0.00051177, -0.00000113, 0.00000000],
+		[-6.27294985, -0.00050910, 0.00031193, 0.00051168, -0.00000113, 0.00000000],
+		[-6.27295005, -0.00050902, 0.00031188, 0.00051160, -0.00000113, 0.00000000],
+		[-6.27295025, -0.00050894, 0.00031183, 0.00051152, -0.00000113, 0.00000000],
+		[-6.27295045, -0.00050885, 0.00031178, 0.00051143, -0.00000113, 0.00000000],
+		[-6.27295065, -0.00050877, 0.00031173, 0.00051135, -0.00000113, 0.00000000],
+		[-6.27295085, -0.00050869, 0.00031167, 0.00051126, -0.00000113, 0.00000000],
+		[-6.27295105, -0.00050860, 0.00031162, 0.00051118, -0.00000113, 0.00000000],
+		[-6.27295125, -0.00050852, 0.00031157, 0.00051109, -0.00000113, 0.00000000],
+		[-6.27295145, -0.00050844, 0.00031152, 0.00051101, -0.00000113, 0.00000000],
+		[-6.27295165, -0.00050835, 0.00031147, 0.00051093, -0.00000113, 0.00000000],
+		[-6.27295185, -0.00050827, 0.00031142, 0.00051084, -0.00000113, 0.00000000],
+		[-6.27295205, -0.00050818, 0.00031137, 0.00051076, -0.00000113, 0.00000000],
+		[-6.27295225, -0.00050810, 0.00031132, 0.00051068, -0.00000113, 0.00000000],
+		[-6.27295245, -0.00050802, 0.00031126, 0.00051059, -0.00000113, 0.00000000],
+		[-6.27295265, -0.00050793, 0.00031121, 0.00051051, -0.00000113, 0.00000000],
+		[-6.27295285, -0.00050785, 0.00031116, 0.00051042, -0.00000113, 0.00000000],
+		[-6.27295305, -0.00050777, 0.00031111, 0.00051034, -0.00000113, 0.00000000],
+		[-6.27295325, -0.00050768, 0.00031106, 0.00051026, -0.00000113, 0.00000000],
+		[-6.27295345, -0.00050760, 0.00031101, 0.00051017, -0.00000113, 0.00000000],
+		[-6.27295365, -0.00050752, 0.00031096, 0.00051009, -0.00000113, 0.00000000],
+		[-6.27295385, -0.00050743, 0.00031091, 0.00051001, -0.00000113, 0.00000000],
+		[-6.27295404, -0.00050735, 0.00031086, 0.00050992, -0.00000113, 0.00000000],
+		[-6.27295424, -0.00050727, 0.00031081, 0.00050984, -0.00000113, 0.00000000],
+		[-6.27295444, -0.00050719, 0.00031075, 0.00050975, -0.00000113, 0.00000000],
+		[-6.27295464, -0.00050710, 0.00031070, 0.00050967, -0.00000113, 0.00000000],
+		[-6.27295484, -0.00050702, 0.00031065, 0.00050959, -0.00000113, 0.00000000],
+		[-6.27295504, -0.00050694, 0.00031060, 0.00050950, -0.00000113, 0.00000000],
+		[-6.27295524, -0.00050685, 0.00031055, 0.00050942, -0.00000113, 0.00000000],
+		[-6.27295544, -0.00050677, 0.00031050, 0.00050934, -0.00000113, 0.00000000],
+		[-6.27295563, -0.00050669, 0.00031045, 0.00050925, -0.00000113, 0.00000000],
+		[-6.27295583, -0.00050660, 0.00031040, 0.00050917, -0.00000113, 0.00000000],
+		[-6.27295603, -0.00050652, 0.00031035, 0.00050909, -0.00000113, 0.00000000],
+		[-6.27295623, -0.00050644, 0.00031030, 0.00050900, -0.00000113, 0.00000000],
+		[-6.27295643, -0.00050636, 0.00031025, 0.00050892, -0.00000113, 0.00000000],
+		[-6.27295663, -0.00050627, 0.00031019, 0.00050884, -0.00000113, 0.00000000],
+		[-6.27295682, -0.00050619, 0.00031014, 0.00050875, -0.00000113, 0.00000000],
+		[-6.27295702, -0.00050611, 0.00031009, 0.00050867, -0.00000113, 0.00000000],
+		[-6.27295722, -0.00050602, 0.00031004, 0.00050859, -0.00000113, 0.00000000],
+		[-6.27295742, -0.00050594, 0.00030999, 0.00050851, -0.00000113, 0.00000000],
+		[-6.27295762, -0.00050586, 0.00030994, 0.00050842, -0.00000113, 0.00000000],
+		[-6.27295781, -0.00050578, 0.00030989, 0.00050834, -0.00000113, 0.00000000],
+		[-6.27295801, -0.00050569, 0.00030984, 0.00050826, -0.00000113, 0.00000000],
+		[-6.27295821, -0.00050561, 0.00030979, 0.00050817, -0.00000113, 0.00000000],
+		[-6.27295841, -0.00050553, 0.00030974, 0.00050809, -0.00000113, 0.00000000],
+		[-6.27295860, -0.00050545, 0.00030969, 0.00050801, -0.00000113, 0.00000000],
+		[-6.27295880, -0.00050536, 0.00030964, 0.00050792, -0.00000113, 0.00000000],
+		[-6.27295900, -0.00050528, 0.00030959, 0.00050784, -0.00000113, 0.00000000],
+		[-6.27295920, -0.00050520, 0.00030954, 0.00050776, -0.00000113, 0.00000000],
+		[-6.27295939, -0.00050512, 0.00030949, 0.00050768, -0.00000113, 0.00000000],
+		[-6.27295959, -0.00050503, 0.00030944, 0.00050759, -0.00000113, 0.00000000],
+		[-6.27295979, -0.00050495, 0.00030938, 0.00050751, -0.00000113, 0.00000000],
+		[-6.27295998, -0.00050487, 0.00030933, 0.00050743, -0.00000113, 0.00000000],
+		[-6.27296018, -0.00050479, 0.00030928, 0.00050734, -0.00000113, 0.00000000],
+		[-6.27296038, -0.00050470, 0.00030923, 0.00050726, -0.00000113, 0.00000000],
+		[-6.27296058, -0.00050462, 0.00030918, 0.00050718, -0.00000113, 0.00000000],
+		[-6.27296077, -0.00050454, 0.00030913, 0.00050710, -0.00000113, 0.00000000],
+		[-6.27296097, -0.00050446, 0.00030908, 0.00050701, -0.00000113, 0.00000000],
+		[-6.27296117, -0.00050438, 0.00030903, 0.00050693, -0.00000113, 0.00000000],
+		[-6.27296136, -0.00050429, 0.00030898, 0.00050685, -0.00000113, 0.00000000],
+		[-6.27296156, -0.00050421, 0.00030893, 0.00050677, -0.00000113, 0.00000000],
+		[-6.27296176, -0.00050413, 0.00030888, 0.00050668, -0.00000113, 0.00000000],
+		[-6.27296195, -0.00050405, 0.00030883, 0.00050660, -0.00000113, 0.00000000],
+		[-6.27296215, -0.00050397, 0.00030878, 0.00050652, -0.00000113, 0.00000000],
+		[-6.27296234, -0.00050388, 0.00030873, 0.00050644, -0.00000113, 0.00000000],
+		[-6.27296254, -0.00050380, 0.00030868, 0.00050635, -0.00000113, 0.00000000],
+		[-6.27296274, -0.00050372, 0.00030863, 0.00050627, -0.00000113, 0.00000000],
+		[-6.27296293, -0.00050364, 0.00030858, 0.00050619, -0.00000113, 0.00000000],
+		[-6.27296313, -0.00050356, 0.00030853, 0.00050611, -0.00000113, 0.00000000],
+		[-6.27296332, -0.00050347, 0.00030848, 0.00050602, -0.00000113, 0.00000000],
+		[-6.27296352, -0.00050339, 0.00030843, 0.00050594, -0.00000113, 0.00000000],
+		[-6.27296372, -0.00050331, 0.00030838, 0.00050586, -0.00000113, 0.00000000],
+		[-6.27296391, -0.00050323, 0.00030833, 0.00050578, -0.00000113, 0.00000000],
+		[-6.27296411, -0.00050315, 0.00030828, 0.00050569, -0.00000113, 0.00000000],
+		[-6.27296430, -0.00050306, 0.00030823, 0.00050561, -0.00000113, 0.00000000],
+		[-6.27296450, -0.00050298, 0.00030818, 0.00050553, -0.00000113, 0.00000000],
+		[-6.27296469, -0.00050290, 0.00030813, 0.00050545, -0.00000113, 0.00000000],
+		[-6.27296489, -0.00050282, 0.00030808, 0.00050537, -0.00000113, 0.00000000],
+		[-6.27296509, -0.00050274, 0.00030803, 0.00050528, -0.00000113, 0.00000000],
+		[-6.27296528, -0.00050266, 0.00030798, 0.00050520, -0.00000113, 0.00000000],
+		[-6.27296548, -0.00050257, 0.00030793, 0.00050512, -0.00000113, 0.00000000],
+		[-6.27296567, -0.00050249, 0.00030788, 0.00050504, -0.00000113, 0.00000000],
+		[-6.27296587, -0.00050241, 0.00030783, 0.00050496, -0.00000113, 0.00000000],
+		[-6.27296606, -0.00050233, 0.00030778, 0.00050487, -0.00000113, 0.00000000],
+		[-6.27296626, -0.00050225, 0.00030773, 0.00050479, -0.00000113, 0.00000000],
+		[-6.27296645, -0.00050217, 0.00030768, 0.00050471, -0.00000113, 0.00000000],
+		[-6.27296665, -0.00050209, 0.00030763, 0.00050463, -0.00000113, 0.00000000],
+		[-6.27296684, -0.00050200, 0.00030758, 0.00050455, -0.00000113, 0.00000000],
+		[-6.27296704, -0.00050192, 0.00030753, 0.00050446, -0.00000113, 0.00000000],
+		[-6.27296723, -0.00050184, 0.00030748, 0.00050438, -0.00000113, 0.00000000],
+		[-6.27296743, -0.00050176, 0.00030743, 0.00050430, -0.00000113, 0.00000000],
+		[-6.27296762, -0.00050168, 0.00030738, 0.00050422, -0.00000113, 0.00000000],
+		[-6.27296781, -0.00050160, 0.00030733, 0.00050414, -0.00000113, 0.00000000],
+		[-6.27296801, -0.00050152, 0.00030728, 0.00050406, -0.00000113, 0.00000000],
+		[-6.27296820, -0.00050143, 0.00030723, 0.00050397, -0.00000113, 0.00000000],
+		[-6.27296840, -0.00050135, 0.00030718, 0.00050389, -0.00000113, 0.00000000],
+		[-6.27296859, -0.00050127, 0.00030713, 0.00050381, -0.00000113, 0.00000000],
+		[-6.27296879, -0.00050119, 0.00030708, 0.00050373, -0.00000113, 0.00000000],
+		[-6.27296898, -0.00050111, 0.00030703, 0.00050365, -0.00000113, 0.00000000],
+		[-6.27296917, -0.00050103, 0.00030698, 0.00050357, -0.00000113, 0.00000000],
+		[-6.27296937, -0.00050095, 0.00030693, 0.00050348, -0.00000113, 0.00000000],
+		[-6.27296956, -0.00050087, 0.00030688, 0.00050340, -0.00000113, 0.00000000],
+		[-6.27296976, -0.00050079, 0.00030683, 0.00050332, -0.00000113, 0.00000000],
+		[-6.27296995, -0.00050070, 0.00030678, 0.00050324, -0.00000113, 0.00000000],
+		[-6.27297014, -0.00050062, 0.00030673, 0.00050316, -0.00000113, 0.00000000],
+		[-6.27297034, -0.00050054, 0.00030668, 0.00050308, -0.00000113, 0.00000000],
+		[-6.27297053, -0.00050046, 0.00030663, 0.00050300, -0.00000113, 0.00000000],
+		[-6.27297073, -0.00050038, 0.00030658, 0.00050291, -0.00000113, 0.00000000],
+		[-6.27297092, -0.00050030, 0.00030653, 0.00050283, -0.00000113, 0.00000000],
+		[-6.27297111, -0.00050022, 0.00030648, 0.00050275, -0.00000113, 0.00000000],
+		[-6.27297131, -0.00050014, 0.00030643, 0.00050267, -0.00000113, 0.00000000],
+		[-6.27297150, -0.00050006, 0.00030638, 0.00050259, -0.00000113, 0.00000000],
+		[-6.27297169, -0.00049998, 0.00030633, 0.00050251, -0.00000113, 0.00000000],
+		[-6.27297189, -0.00049990, 0.00030629, 0.00050243, -0.00000113, 0.00000000],
+		[-6.27297208, -0.00049982, 0.00030624, 0.00050235, -0.00000113, 0.00000000],
+		[-6.27297227, -0.00049973, 0.00030619, 0.00050227, -0.00000113, 0.00000000],
+		[-6.27297246, -0.00049965, 0.00030614, 0.00050218, -0.00000113, 0.00000000],
+		[-6.27297266, -0.00049957, 0.00030609, 0.00050210, -0.00000113, 0.00000000],
+		[-6.27297285, -0.00049949, 0.00030604, 0.00050202, -0.00000113, 0.00000000],
+		[-6.27297304, -0.00049941, 0.00030599, 0.00050194, -0.00000113, 0.00000000],
+		[-6.27297324, -0.00049933, 0.00030594, 0.00050186, -0.00000113, 0.00000000],
+		[-6.27297343, -0.00049925, 0.00030589, 0.00050178, -0.00000113, 0.00000000],
+		[-6.27297362, -0.00049917, 0.00030584, 0.00050170, -0.00000113, 0.00000000],
+		[-6.27297381, -0.00049909, 0.00030579, 0.00050162, -0.00000113, 0.00000000],
+		[-6.27297401, -0.00049901, 0.00030574, 0.00050154, -0.00000113, 0.00000000],
+		[-6.27297420, -0.00049893, 0.00030569, 0.00050146, -0.00000113, 0.00000000],
+		[-6.27297439, -0.00049885, 0.00030564, 0.00050137, -0.00000113, 0.00000000],
+		[-6.27297458, -0.00049877, 0.00030559, 0.00050129, -0.00000113, 0.00000000],
+		[-6.27297478, -0.00049869, 0.00030554, 0.00050121, -0.00000113, 0.00000000],
+		[-6.27297497, -0.00049861, 0.00030550, 0.00050113, -0.00000113, 0.00000000],
+		[-6.27297516, -0.00049853, 0.00030545, 0.00050105, -0.00000113, 0.00000000],
+		[-6.27297535, -0.00049845, 0.00030540, 0.00050097, -0.00000113, 0.00000000],
+		[-6.27297554, -0.00049837, 0.00030535, 0.00050089, -0.00000113, 0.00000000],
+		[-6.27297574, -0.00049829, 0.00030530, 0.00050081, -0.00000113, 0.00000000],
+		[-6.27297593, -0.00049821, 0.00030525, 0.00050073, -0.00000113, 0.00000000],
+		[-6.27297612, -0.00049813, 0.00030520, 0.00050065, -0.00000113, 0.00000000],
+		[-6.27297631, -0.00049805, 0.00030515, 0.00050057, -0.00000113, 0.00000000],
+		[-6.27297650, -0.00049797, 0.00030510, 0.00050049, -0.00000113, 0.00000000],
+		[-6.27297670, -0.00049789, 0.00030505, 0.00050041, -0.00000113, 0.00000000],
+		[-6.27297689, -0.00049781, 0.00030500, 0.00050033, -0.00000113, 0.00000000],
+		[-6.27297708, -0.00049773, 0.00030495, 0.00050025, -0.00000113, 0.00000000],
+		[-6.27297727, -0.00049765, 0.00030491, 0.00050017, -0.00000113, 0.00000000],
+		[-6.27297746, -0.00049757, 0.00030486, 0.00050009, -0.00000113, 0.00000000],
+		[-6.27297765, -0.00049749, 0.00030481, 0.00050000, -0.00000113, 0.00000000],
+		[-6.27297784, -0.00049741, 0.00030476, 0.00049992, -0.00000113, 0.00000000],
+		[-6.27297804, -0.00049733, 0.00030471, 0.00049984, -0.00000113, 0.00000000],
+		[-6.27297823, -0.00049725, 0.00030466, 0.00049976, -0.00000113, 0.00000000],
+		[-6.27297842, -0.00049717, 0.00030461, 0.00049968, -0.00000113, 0.00000000],
+		[-6.27297861, -0.00049709, 0.00030456, 0.00049960, -0.00000113, 0.00000000],
+		[-6.27297880, -0.00049701, 0.00030451, 0.00049952, -0.00000113, 0.00000000],
+		[-6.27297899, -0.00049693, 0.00030446, 0.00049944, -0.00000113, 0.00000000],
+		[-6.27297918, -0.00049685, 0.00030442, 0.00049936, -0.00000113, 0.00000000],
+		[-6.27297937, -0.00049677, 0.00030437, 0.00049928, -0.00000113, 0.00000000],
+		[-6.27297956, -0.00049669, 0.00030432, 0.00049920, -0.00000113, 0.00000000],
+		[-6.27297975, -0.00049661, 0.00030427, 0.00049912, -0.00000113, 0.00000000],
+		[-6.27297994, -0.00049653, 0.00030422, 0.00049904, -0.00000113, 0.00000000],
+		[-6.27298013, -0.00049645, 0.00030417, 0.00049896, -0.00000113, 0.00000000],
+		[-6.27298033, -0.00049637, 0.00030412, 0.00049888, -0.00000114, 0.00000000],
+		[-6.27298052, -0.00049629, 0.00030407, 0.00049880, -0.00000114, 0.00000000],
+		[-6.27298071, -0.00049621, 0.00030403, 0.00049872, -0.00000114, 0.00000000],
+		[-6.27298090, -0.00049613, 0.00030398, 0.00049864, -0.00000114, 0.00000000],
+		[-6.27298109, -0.00049605, 0.00030393, 0.00049856, -0.00000114, 0.00000000],
+		[-6.27298128, -0.00049597, 0.00030388, 0.00049848, -0.00000114, 0.00000000],
+		[-6.27298147, -0.00049589, 0.00030383, 0.00049840, -0.00000114, 0.00000000],
+		[-6.27298166, -0.00049581, 0.00030378, 0.00049832, -0.00000114, 0.00000000],
+		[-6.27298185, -0.00049573, 0.00030373, 0.00049824, -0.00000114, 0.00000000],
+		[-6.27298204, -0.00049565, 0.00030368, 0.00049816, -0.00000114, 0.00000000],
+		[-6.27298223, -0.00049557, 0.00030364, 0.00049808, -0.00000114, 0.00000000],
+		[-6.27298242, -0.00049550, 0.00030359, 0.00049800, -0.00000114, 0.00000000],
+		[-6.27298261, -0.00049542, 0.00030354, 0.00049792, -0.00000114, 0.00000000],
+		[-6.27298280, -0.00049534, 0.00030349, 0.00049784, -0.00000114, 0.00000000],
+		[-6.27298299, -0.00049526, 0.00030344, 0.00049776, -0.00000114, 0.00000000],
+		[-6.27298318, -0.00049518, 0.00030339, 0.00049769, -0.00000114, 0.00000000],
+		[-6.27298336, -0.00049510, 0.00030334, 0.00049761, -0.00000114, 0.00000000],
+		[-6.27298355, -0.00049502, 0.00030330, 0.00049753, -0.00000114, 0.00000000],
+		[-6.27298374, -0.00049494, 0.00030325, 0.00049745, -0.00000114, 0.00000000],
+		[-6.27298393, -0.00049486, 0.00030320, 0.00049737, -0.00000114, 0.00000000],
+		[-6.27298412, -0.00049478, 0.00030315, 0.00049729, -0.00000114, 0.00000000],
+		[-6.27298431, -0.00049470, 0.00030310, 0.00049721, -0.00000114, 0.00000000],
+		[-6.27298450, -0.00049462, 0.00030305, 0.00049713, -0.00000114, 0.00000000],
+		[-6.27298469, -0.00049455, 0.00030300, 0.00049705, -0.00000114, 0.00000000],
+		[-6.27298488, -0.00049447, 0.00030296, 0.00049697, -0.00000114, 0.00000000],
+		[-6.27298507, -0.00049439, 0.00030291, 0.00049689, -0.00000114, 0.00000000],
+		[-6.27298526, -0.00049431, 0.00030286, 0.00049681, -0.00000114, 0.00000000],
+		[-6.27298545, -0.00049423, 0.00030281, 0.00049673, -0.00000114, 0.00000000],
+		[-6.27298563, -0.00049415, 0.00030276, 0.00049665, -0.00000114, 0.00000000],
+		[-6.27298582, -0.00049407, 0.00030271, 0.00049657, -0.00000114, 0.00000000],
+		[-6.27298601, -0.00049399, 0.00030267, 0.00049649, -0.00000114, 0.00000000],
+		[-6.27298620, -0.00049391, 0.00030262, 0.00049641, -0.00000114, 0.00000000],
+		[-6.27298639, -0.00049384, 0.00030257, 0.00049634, -0.00000114, 0.00000000],
+		[-6.27298658, -0.00049376, 0.00030252, 0.00049626, -0.00000114, 0.00000000],
+		[-6.27298677, -0.00049368, 0.00030247, 0.00049618, -0.00000114, 0.00000000],
+		[-6.27298695, -0.00049360, 0.00030242, 0.00049610, -0.00000114, 0.00000000],
+		[-6.27298714, -0.00049352, 0.00030238, 0.00049602, -0.00000114, 0.00000000],
+		[-6.27298733, -0.00049344, 0.00030233, 0.00049594, -0.00000114, 0.00000000],
+		[-6.27298752, -0.00049336, 0.00030228, 0.00049586, -0.00000114, 0.00000000],
+		[-6.27298771, -0.00049328, 0.00030223, 0.00049578, -0.00000114, 0.00000000],
+		[-6.27298790, -0.00049321, 0.00030218, 0.00049570, -0.00000114, 0.00000000],
+		[-6.27298808, -0.00049313, 0.00030214, 0.00049562, -0.00000114, 0.00000000],
+		[-6.27298827, -0.00049305, 0.00030209, 0.00049554, -0.00000114, 0.00000000],
+		[-6.27298846, -0.00049297, 0.00030204, 0.00049547, -0.00000114, 0.00000000],
+		[-6.27298865, -0.00049289, 0.00030199, 0.00049539, -0.00000114, 0.00000000],
+		[-6.27298883, -0.00049281, 0.00030194, 0.00049531, -0.00000114, 0.00000000],
+		[-6.27298902, -0.00049273, 0.00030189, 0.00049523, -0.00000114, 0.00000000],
+		[-6.27298921, -0.00049266, 0.00030185, 0.00049515, -0.00000114, 0.00000000],
+		[-6.27298940, -0.00049258, 0.00030180, 0.00049507, -0.00000114, 0.00000000],
+		[-6.27298959, -0.00049250, 0.00030175, 0.00049499, -0.00000114, 0.00000000],
+		[-6.27298977, -0.00049242, 0.00030170, 0.00049491, -0.00000114, 0.00000000],
+		[-6.27298996, -0.00049234, 0.00030165, 0.00049484, -0.00000114, 0.00000000],
+		[-6.27299015, -0.00049226, 0.00030161, 0.00049476, -0.00000114, 0.00000000],
+		[-6.27299033, -0.00049219, 0.00030156, 0.00049468, -0.00000114, 0.00000000],
+		[-6.27299052, -0.00049211, 0.00030151, 0.00049460, -0.00000114, 0.00000000],
+		[-6.27299071, -0.00049203, 0.00030146, 0.00049452, -0.00000114, 0.00000000],
+		[-6.27299090, -0.00049195, 0.00030141, 0.00049444, -0.00000114, 0.00000000],
+		[-6.27299108, -0.00049187, 0.00030137, 0.00049436, -0.00000114, 0.00000000],
+		[-6.27299127, -0.00049180, 0.00030132, 0.00049428, -0.00000114, 0.00000000],
+		[-6.27299146, -0.00049172, 0.00030127, 0.00049421, -0.00000114, 0.00000000],
+		[-6.27299164, -0.00049164, 0.00030122, 0.00049413, -0.00000114, 0.00000000],
+		[-6.27299183, -0.00049156, 0.00030118, 0.00049405, -0.00000114, 0.00000000],
+		[-6.27299202, -0.00049148, 0.00030113, 0.00049397, -0.00000114, 0.00000000],
+		[-6.27299220, -0.00049140, 0.00030108, 0.00049389, -0.00000114, 0.00000000],
+		[-6.27299239, -0.00049133, 0.00030103, 0.00049381, -0.00000114, 0.00000000],
+		[-6.27299258, -0.00049125, 0.00030098, 0.00049374, -0.00000114, 0.00000000],
+		[-6.27299276, -0.00049117, 0.00030094, 0.00049366, -0.00000114, 0.00000000],
+		[-6.27299295, -0.00049109, 0.00030089, 0.00049358, -0.00000114, 0.00000000],
+		[-6.27299314, -0.00049102, 0.00030084, 0.00049350, -0.00000114, 0.00000000],
+		[-6.27299332, -0.00049094, 0.00030079, 0.00049342, -0.00000114, 0.00000000],
+		[-6.27299351, -0.00049086, 0.00030075, 0.00049334, -0.00000114, 0.00000000],
+		[-6.27299370, -0.00049078, 0.00030070, 0.00049327, -0.00000114, 0.00000000],
+		[-6.27299388, -0.00049070, 0.00030065, 0.00049319, -0.00000114, 0.00000000],
+		[-6.27299407, -0.00049063, 0.00030060, 0.00049311, -0.00000114, 0.00000000],
+		[-6.27299425, -0.00049055, 0.00030055, 0.00049303, -0.00000114, 0.00000000],
+		[-6.27299444, -0.00049047, 0.00030051, 0.00049295, -0.00000114, 0.00000000],
+		[-6.27299463, -0.00049039, 0.00030046, 0.00049288, -0.00000114, 0.00000000],
+		[-6.27299481, -0.00049032, 0.00030041, 0.00049280, -0.00000114, 0.00000000],
+		[-6.27299500, -0.00049024, 0.00030036, 0.00049272, -0.00000114, 0.00000000],
+		[-6.27299518, -0.00049016, 0.00030032, 0.00049264, -0.00000114, 0.00000000],
+		[-6.27299537, -0.00049008, 0.00030027, 0.00049256, -0.00000114, 0.00000000],
+		[-6.27299556, -0.00049000, 0.00030022, 0.00049249, -0.00000114, 0.00000000],
+		[-6.27299574, -0.00048993, 0.00030017, 0.00049241, -0.00000114, 0.00000000],
+		[-6.27299593, -0.00048985, 0.00030013, 0.00049233, -0.00000114, 0.00000000],
+		[-6.27299611, -0.00048977, 0.00030008, 0.00049225, -0.00000114, 0.00000000],
+		[-6.27299630, -0.00048969, 0.00030003, 0.00049217, -0.00000114, 0.00000000],
+		[-6.27299648, -0.00048962, 0.00029998, 0.00049210, -0.00000114, 0.00000000],
+		[-6.27299667, -0.00048954, 0.00029994, 0.00049202, -0.00000114, 0.00000000],
+		[-6.27299685, -0.00048946, 0.00029989, 0.00049194, -0.00000114, 0.00000000],
+		[-6.27299704, -0.00048938, 0.00029984, 0.00049186, -0.00000114, 0.00000000],
+		[-6.27299722, -0.00048931, 0.00029979, 0.00049178, -0.00000114, 0.00000000],
+		[-6.27299741, -0.00048923, 0.00029975, 0.00049171, -0.00000114, 0.00000000],
+		[-6.27299759, -0.00048915, 0.00029970, 0.00049163, -0.00000114, 0.00000000],
+		[-6.27299778, -0.00048908, 0.00029965, 0.00049155, -0.00000114, 0.00000000],
+		[-6.27299796, -0.00048900, 0.00029960, 0.00049147, -0.00000114, 0.00000000],
+		[-6.27299815, -0.00048892, 0.00029956, 0.00049140, -0.00000114, 0.00000000],
+		[-6.27299833, -0.00048884, 0.00029951, 0.00049132, -0.00000114, 0.00000000],
+		[-6.27299852, -0.00048877, 0.00029946, 0.00049124, -0.00000114, 0.00000000],
+		[-6.27299870, -0.00048869, 0.00029941, 0.00049116, -0.00000114, 0.00000000],
+		[-6.27299889, -0.00048861, 0.00029937, 0.00049109, -0.00000114, 0.00000000],
+		[-6.27299907, -0.00048854, 0.00029932, 0.00049101, -0.00000114, 0.00000000],
+		[-6.27299926, -0.00048846, 0.00029927, 0.00049093, -0.00000114, 0.00000000],
+		[-6.27299944, -0.00048838, 0.00029923, 0.00049085, -0.00000114, 0.00000000],
+		[-6.27299962, -0.00048830, 0.00029918, 0.00049078, -0.00000114, 0.00000000],
+		[-6.27299981, -0.00048823, 0.00029913, 0.00049070, -0.00000114, 0.00000000],
+		[-6.27299999, -0.00048815, 0.00029908, 0.00049062, -0.00000114, 0.00000000],
+		[-6.27300018, -0.00048807, 0.00029904, 0.00049054, -0.00000114, 0.00000000],
+		[-6.27300036, -0.00048800, 0.00029899, 0.00049047, -0.00000114, 0.00000000],
+		[-6.27300055, -0.00048792, 0.00029894, 0.00049039, -0.00000114, 0.00000000],
+		[-6.27300073, -0.00048784, 0.00029890, 0.00049031, -0.00000114, 0.00000000],
+		[-6.27300091, -0.00048777, 0.00029885, 0.00049023, -0.00000114, 0.00000000],
+		[-6.27300110, -0.00048769, 0.00029880, 0.00049016, -0.00000114, 0.00000000],
+		[-6.27300128, -0.00048761, 0.00029875, 0.00049008, -0.00000114, 0.00000000],
+		[-6.27300146, -0.00048754, 0.00029871, 0.00049000, -0.00000114, 0.00000000],
+		[-6.27300165, -0.00048746, 0.00029866, 0.00048993, -0.00000114, 0.00000000],
+		[-6.27300183, -0.00048738, 0.00029861, 0.00048985, -0.00000114, 0.00000000],
+		[-6.27300202, -0.00048730, 0.00029857, 0.00048977, -0.00000114, 0.00000000],
+		[-6.27300220, -0.00048723, 0.00029852, 0.00048969, -0.00000114, 0.00000000],
+		[-6.27300238, -0.00048715, 0.00029847, 0.00048962, -0.00000114, 0.00000000],
+		[-6.27300257, -0.00048707, 0.00029842, 0.00048954, -0.00000114, 0.00000000],
+		[-6.27300275, -0.00048700, 0.00029838, 0.00048946, -0.00000114, 0.00000000],
+		[-6.27300293, -0.00048692, 0.00029833, 0.00048939, -0.00000114, 0.00000000],
+		[-6.27300312, -0.00048685, 0.00029828, 0.00048931, -0.00000114, 0.00000000],
+		[-6.27300330, -0.00048677, 0.00029824, 0.00048923, -0.00000114, 0.00000000],
+		[-6.27300348, -0.00048669, 0.00029819, 0.00048916, -0.00000114, 0.00000000],
+		[-6.27300367, -0.00048662, 0.00029814, 0.00048908, -0.00000114, 0.00000000],
+		[-6.27300385, -0.00048654, 0.00029810, 0.00048900, -0.00000114, 0.00000000],
+		[-6.27300403, -0.00048646, 0.00029805, 0.00048892, -0.00000114, 0.00000000],
+		[-6.27300421, -0.00048639, 0.00029800, 0.00048885, -0.00000114, 0.00000000],
+		[-6.27300440, -0.00048631, 0.00029796, 0.00048877, -0.00000114, 0.00000000],
+		[-6.27300458, -0.00048623, 0.00029791, 0.00048869, -0.00000114, 0.00000000],
+		[-6.27300476, -0.00048616, 0.00029786, 0.00048862, -0.00000114, 0.00000000],
+		[-6.27300495, -0.00048608, 0.00029782, 0.00048854, -0.00000114, 0.00000000],
+		[-6.27300513, -0.00048600, 0.00029777, 0.00048846, -0.00000114, 0.00000000],
+		[-6.27300531, -0.00048593, 0.00029772, 0.00048839, -0.00000114, 0.00000000],
+		[-6.27300549, -0.00048585, 0.00029768, 0.00048831, -0.00000114, 0.00000000],
+		[-6.27300568, -0.00048578, 0.00029763, 0.00048823, -0.00000114, 0.00000000],
+		[-6.27300586, -0.00048570, 0.00029758, 0.00048816, -0.00000114, 0.00000000],
+		[-6.27300604, -0.00048562, 0.00029753, 0.00048808, -0.00000114, 0.00000000],
+		[-6.27300622, -0.00048555, 0.00029749, 0.00048800, -0.00000114, 0.00000000],
+		[-6.27300640, -0.00048547, 0.00029744, 0.00048793, -0.00000114, 0.00000000],
+		[-6.27300659, -0.00048539, 0.00029739, 0.00048785, -0.00000114, 0.00000000],
+		[-6.27300677, -0.00048532, 0.00029735, 0.00048777, -0.00000114, 0.00000000],
+		[-6.27300695, -0.00048524, 0.00029730, 0.00048770, -0.00000114, 0.00000000],
+		[-6.27300713, -0.00048517, 0.00029725, 0.00048762, -0.00000114, 0.00000000],
+		[-6.27300732, -0.00048509, 0.00029721, 0.00048755, -0.00000114, 0.00000000],
+		[-6.27300750, -0.00048501, 0.00029716, 0.00048747, -0.00000114, 0.00000000],
+		[-6.27300768, -0.00048494, 0.00029712, 0.00048739, -0.00000114, 0.00000000],
+		[-6.27300786, -0.00048486, 0.00029707, 0.00048732, -0.00000114, 0.00000000],
+		[-6.27300804, -0.00048479, 0.00029702, 0.00048724, -0.00000114, 0.00000000],
+		[-6.27300822, -0.00048471, 0.00029698, 0.00048716, -0.00000114, 0.00000000],
+		[-6.27300841, -0.00048463, 0.00029693, 0.00048709, -0.00000114, 0.00000000],
+		[-6.27300859, -0.00048456, 0.00029688, 0.00048701, -0.00000114, 0.00000000],
+		[-6.27300877, -0.00048448, 0.00029684, 0.00048693, -0.00000114, 0.00000000],
+		[-6.27300895, -0.00048441, 0.00029679, 0.00048686, -0.00000114, 0.00000000],
+		[-6.27300913, -0.00048433, 0.00029674, 0.00048678, -0.00000114, 0.00000000],
+		[-6.27300931, -0.00048426, 0.00029670, 0.00048671, -0.00000114, 0.00000000],
+		[-6.27300949, -0.00048418, 0.00029665, 0.00048663, -0.00000114, 0.00000000],
+		[-6.27300968, -0.00048410, 0.00029660, 0.00048655, -0.00000114, 0.00000000],
+		[-6.27300986, -0.00048403, 0.00029656, 0.00048648, -0.00000114, 0.00000000],
+		[-6.27301004, -0.00048395, 0.00029651, 0.00048640, -0.00000114, 0.00000000],
+		[-6.27301022, -0.00048388, 0.00029646, 0.00048633, -0.00000114, 0.00000000],
+		[-6.27301040, -0.00048380, 0.00029642, 0.00048625, -0.00000114, 0.00000000],
+		[-6.27301058, -0.00048373, 0.00029637, 0.00048617, -0.00000114, 0.00000000],
+		[-6.27301076, -0.00048365, 0.00029633, 0.00048610, -0.00000114, 0.00000000],
+		[-6.27301094, -0.00048357, 0.00029628, 0.00048602, -0.00000114, 0.00000000],
+		[-6.27301112, -0.00048350, 0.00029623, 0.00048595, -0.00000114, 0.00000000],
+		[-6.27301130, -0.00048342, 0.00029619, 0.00048587, -0.00000114, 0.00000000],
+		[-6.27301148, -0.00048335, 0.00029614, 0.00048579, -0.00000114, 0.00000000],
+		[-6.27301166, -0.00048327, 0.00029609, 0.00048572, -0.00000114, 0.00000000],
+		[-6.27301185, -0.00048320, 0.00029605, 0.00048564, -0.00000114, 0.00000000],
+		[-6.27301203, -0.00048312, 0.00029600, 0.00048557, -0.00000114, 0.00000000],
+		[-6.27301221, -0.00048305, 0.00029596, 0.00048549, -0.00000114, 0.00000000],
+		[-6.27301239, -0.00048297, 0.00029591, 0.00048542, -0.00000114, 0.00000000],
+		[-6.27301257, -0.00048290, 0.00029586, 0.00048534, -0.00000114, 0.00000000],
+		[-6.27301275, -0.00048282, 0.00029582, 0.00048526, -0.00000114, 0.00000000],
+		[-6.27301293, -0.00048275, 0.00029577, 0.00048519, -0.00000114, 0.00000000],
+		[-6.27301311, -0.00048267, 0.00029572, 0.00048511, -0.00000114, 0.00000000],
+		[-6.27301329, -0.00048259, 0.00029568, 0.00048504, -0.00000114, 0.00000000],
+		[-6.27301347, -0.00048252, 0.00029563, 0.00048496, -0.00000114, 0.00000000],
+		[-6.27301365, -0.00048244, 0.00029559, 0.00048489, -0.00000114, 0.00000000],
+		[-6.27301383, -0.00048237, 0.00029554, 0.00048481, -0.00000114, 0.00000000],
+		[-6.27301401, -0.00048229, 0.00029549, 0.00048473, -0.00000114, 0.00000000],
+		[-6.27301419, -0.00048222, 0.00029545, 0.00048466, -0.00000114, 0.00000000],
+		[-6.27301437, -0.00048214, 0.00029540, 0.00048458, -0.00000114, 0.00000000],
+		[-6.27301455, -0.00048207, 0.00029536, 0.00048451, -0.00000114, 0.00000000],
+		[-6.27301473, -0.00048199, 0.00029531, 0.00048443, -0.00000114, 0.00000000],
+		[-6.27301491, -0.00048192, 0.00029526, 0.00048436, -0.00000114, 0.00000000],
+		[-6.27301509, -0.00048184, 0.00029522, 0.00048428, -0.00000114, 0.00000000],
+		[-6.27301526, -0.00048177, 0.00029517, 0.00048421, -0.00000114, 0.00000000],
+		[-6.27301544, -0.00048169, 0.00029513, 0.00048413, -0.00000114, 0.00000000],
+		[-6.27301562, -0.00048162, 0.00029508, 0.00048406, -0.00000114, 0.00000000],
+		[-6.27301580, -0.00048154, 0.00029503, 0.00048398, -0.00000114, 0.00000000],
+		[-6.27301598, -0.00048147, 0.00029499, 0.00048390, -0.00000114, 0.00000000],
+		[-6.27301616, -0.00048139, 0.00029494, 0.00048383, -0.00000114, 0.00000000],
+		[-6.27301634, -0.00048132, 0.00029490, 0.00048375, -0.00000114, 0.00000000],
+		[-6.27301652, -0.00048124, 0.00029485, 0.00048368, -0.00000114, 0.00000000],
+		[-6.27301670, -0.00048117, 0.00029480, 0.00048360, -0.00000114, 0.00000000],
+		[-6.27301688, -0.00048109, 0.00029476, 0.00048353, -0.00000114, 0.00000000],
+		[-6.27301706, -0.00048102, 0.00029471, 0.00048345, -0.00000114, 0.00000000],
+		[-6.27301724, -0.00048095, 0.00029467, 0.00048338, -0.00000114, 0.00000000],
+		[-6.27301741, -0.00048087, 0.00029462, 0.00048330, -0.00000114, 0.00000000],
+		[-6.27301759, -0.00048080, 0.00029458, 0.00048323, -0.00000114, 0.00000000],
+		[-6.27301777, -0.00048072, 0.00029453, 0.00048315, -0.00000114, 0.00000000],
+		[-6.27301795, -0.00048065, 0.00029448, 0.00048308, -0.00000114, 0.00000000],
+		[-6.27301813, -0.00048057, 0.00029444, 0.00048300, -0.00000114, 0.00000000],
+		[-6.27301831, -0.00048050, 0.00029439, 0.00048293, -0.00000114, 0.00000000],
+		[-6.27301849, -0.00048042, 0.00029435, 0.00048285, -0.00000114, 0.00000000],
+		[-6.27301866, -0.00048035, 0.00029430, 0.00048278, -0.00000114, 0.00000000],
+		[-6.27301884, -0.00048027, 0.00029426, 0.00048270, -0.00000114, 0.00000000],
+		[-6.27301902, -0.00048020, 0.00029421, 0.00048263, -0.00000114, 0.00000000],
+		[-6.27301920, -0.00048012, 0.00029416, 0.00048255, -0.00000114, 0.00000000],
+		[-6.27301938, -0.00048005, 0.00029412, 0.00048248, -0.00000114, 0.00000000],
+		[-6.27301956, -0.00047998, 0.00029407, 0.00048240, -0.00000114, 0.00000000],
+		[-6.27301973, -0.00047990, 0.00029403, 0.00048233, -0.00000114, 0.00000000],
+		[-6.27301991, -0.00047983, 0.00029398, 0.00048225, -0.00000114, 0.00000000],
+		[-6.27302009, -0.00047975, 0.00029394, 0.00048218, -0.00000114, 0.00000000],
+		[-6.27302027, -0.00047968, 0.00029389, 0.00048211, -0.00000114, 0.00000000],
+		[-6.27302044, -0.00047960, 0.00029384, 0.00048203, -0.00000114, 0.00000000],
+		[-6.27302062, -0.00047953, 0.00029380, 0.00048196, -0.00000114, 0.00000000],
+		[-6.27302080, -0.00047946, 0.00029375, 0.00048188, -0.00000114, 0.00000000],
+		[-6.27302098, -0.00047938, 0.00029371, 0.00048181, -0.00000114, 0.00000000],
+		[-6.27302116, -0.00047931, 0.00029366, 0.00048173, -0.00000114, 0.00000000],
+		[-6.27302133, -0.00047923, 0.00029362, 0.00048166, -0.00000114, 0.00000000],
+		[-6.27302151, -0.00047916, 0.00029357, 0.00048158, -0.00000114, 0.00000000],
+		[-6.27302169, -0.00047908, 0.00029353, 0.00048151, -0.00000114, 0.00000000],
+		[-6.27302187, -0.00047901, 0.00029348, 0.00048143, -0.00000114, 0.00000000],
+		[-6.27302204, -0.00047894, 0.00029344, 0.00048136, -0.00000114, 0.00000000],
+		[-6.27302222, -0.00047886, 0.00029339, 0.00048128, -0.00000114, 0.00000000],
+		[-6.27302240, -0.00047879, 0.00029334, 0.00048121, -0.00000114, 0.00000000],
+		[-6.27302257, -0.00047871, 0.00029330, 0.00048114, -0.00000114, 0.00000000],
+		[-6.27302275, -0.00047864, 0.00029325, 0.00048106, -0.00000114, 0.00000000],
+		[-6.27302293, -0.00047857, 0.00029321, 0.00048099, -0.00000114, 0.00000000],
+		[-6.27302311, -0.00047849, 0.00029316, 0.00048091, -0.00000114, 0.00000000],
+		[-6.27302328, -0.00047842, 0.00029312, 0.00048084, -0.00000114, 0.00000000],
+		[-6.27302346, -0.00047834, 0.00029307, 0.00048076, -0.00000114, 0.00000000],
+		[-6.27302364, -0.00047827, 0.00029303, 0.00048069, -0.00000114, 0.00000000],
+		[-6.27302381, -0.00047820, 0.00029298, 0.00048062, -0.00000114, 0.00000000],
+		[-6.27302399, -0.00047812, 0.00029294, 0.00048054, -0.00000114, 0.00000000],
+		[-6.27302417, -0.00047805, 0.00029289, 0.00048047, -0.00000114, 0.00000000],
+		[-6.27302434, -0.00047797, 0.00029285, 0.00048039, -0.00000114, 0.00000000],
+		[-6.27302452, -0.00047790, 0.00029280, 0.00048032, -0.00000114, 0.00000000],
+		[-6.27302470, -0.00047783, 0.00029276, 0.00048024, -0.00000114, 0.00000000],
+		[-6.27302487, -0.00047775, 0.00029271, 0.00048017, -0.00000114, 0.00000000],
+		[-6.27302505, -0.00047768, 0.00029267, 0.00048010, -0.00000114, 0.00000000],
+		[-6.27302523, -0.00047761, 0.00029262, 0.00048002, -0.00000114, 0.00000000],
+		[-6.27302540, -0.00047753, 0.00029257, 0.00047995, -0.00000114, 0.00000000],
+		[-6.27302558, -0.00047746, 0.00029253, 0.00047987, -0.00000114, 0.00000000],
+		[-6.27302575, -0.00047739, 0.00029248, 0.00047980, -0.00000114, 0.00000000],
+		[-6.27302593, -0.00047731, 0.00029244, 0.00047973, -0.00000114, 0.00000000],
+		[-6.27302611, -0.00047724, 0.00029239, 0.00047965, -0.00000114, 0.00000000],
+		[-6.27302628, -0.00047716, 0.00029235, 0.00047958, -0.00000114, 0.00000000],
+		[-6.27302646, -0.00047709, 0.00029230, 0.00047950, -0.00000114, 0.00000000],
+		[-6.27302664, -0.00047702, 0.00029226, 0.00047943, -0.00000114, 0.00000000],
+		[-6.27302681, -0.00047694, 0.00029221, 0.00047936, -0.00000114, 0.00000000],
+		[-6.27302699, -0.00047687, 0.00029217, 0.00047928, -0.00000114, 0.00000000],
+		[-6.27302716, -0.00047680, 0.00029212, 0.00047921, -0.00000114, 0.00000000],
+		[-6.27302734, -0.00047672, 0.00029208, 0.00047913, -0.00000114, 0.00000000],
+		[-6.27302751, -0.00047665, 0.00029203, 0.00047906, -0.00000114, 0.00000000],
+		[-6.27302769, -0.00047658, 0.00029199, 0.00047899, -0.00000114, 0.00000000],
+		[-6.27302787, -0.00047650, 0.00029194, 0.00047891, -0.00000114, 0.00000000],
+		[-6.27302804, -0.00047643, 0.00029190, 0.00047884, -0.00000114, 0.00000000],
+		[-6.27302822, -0.00047636, 0.00029185, 0.00047877, -0.00000114, 0.00000000],
+		[-6.27302839, -0.00047628, 0.00029181, 0.00047869, -0.00000114, 0.00000000],
+		[-6.27302857, -0.00047621, 0.00029176, 0.00047862, -0.00000114, 0.00000000],
+		[-6.27302874, -0.00047614, 0.00029172, 0.00047855, -0.00000114, 0.00000000],
+		[-6.27302892, -0.00047606, 0.00029167, 0.00047847, -0.00000114, 0.00000000],
+		[-6.27302909, -0.00047599, 0.00029163, 0.00047840, -0.00000114, 0.00000000],
+		[-6.27302927, -0.00047592, 0.00029158, 0.00047832, -0.00000114, 0.00000000],
+		[-6.27302944, -0.00047584, 0.00029154, 0.00047825, -0.00000114, 0.00000000],
+		[-6.27302962, -0.00047577, 0.00029150, 0.00047818, -0.00000114, 0.00000000],
+		[-6.27302979, -0.00047570, 0.00029145, 0.00047810, -0.00000114, 0.00000000],
+		[-6.27302997, -0.00047562, 0.00029141, 0.00047803, -0.00000114, 0.00000000],
+		[-6.27303014, -0.00047555, 0.00029136, 0.00047796, -0.00000114, 0.00000000],
+		[-6.27303032, -0.00047548, 0.00029132, 0.00047788, -0.00000114, 0.00000000],
+		[-6.27303049, -0.00047541, 0.00029127, 0.00047781, -0.00000114, 0.00000000],
+		[-6.27303067, -0.00047533, 0.00029123, 0.00047774, -0.00000114, 0.00000000],
+		[-6.27303084, -0.00047526, 0.00029118, 0.00047766, -0.00000114, 0.00000000],
+		[-6.27303102, -0.00047519, 0.00029114, 0.00047759, -0.00000114, 0.00000000],
+		[-6.27303119, -0.00047511, 0.00029109, 0.00047752, -0.00000114, 0.00000000],
+		[-6.27303137, -0.00047504, 0.00029105, 0.00047744, -0.00000114, 0.00000000],
+		[-6.27303154, -0.00047497, 0.00029100, 0.00047737, -0.00000114, 0.00000000],
+		[-6.27303171, -0.00047490, 0.00029096, 0.00047730, -0.00000114, 0.00000000],
+		[-6.27303189, -0.00047482, 0.00029091, 0.00047722, -0.00000114, 0.00000000],
+		[-6.27303206, -0.00047475, 0.00029087, 0.00047715, -0.00000114, 0.00000000],
+		[-6.27303224, -0.00047468, 0.00029082, 0.00047708, -0.00000114, 0.00000000],
+		[-6.27303241, -0.00047460, 0.00029078, 0.00047700, -0.00000114, 0.00000000],
+		[-6.27303259, -0.00047453, 0.00029073, 0.00047693, -0.00000114, 0.00000000],
+		[-6.27303276, -0.00047446, 0.00029069, 0.00047686, -0.00000114, 0.00000000],
+		[-6.27303293, -0.00047439, 0.00029065, 0.00047678, -0.00000114, 0.00000000],
+		[-6.27303311, -0.00047431, 0.00029060, 0.00047671, -0.00000114, 0.00000000],
+		[-6.27303328, -0.00047424, 0.00029056, 0.00047664, -0.00000114, 0.00000000],
+		[-6.27303345, -0.00047417, 0.00029051, 0.00047657, -0.00000114, 0.00000000],
+		[-6.27303363, -0.00047410, 0.00029047, 0.00047649, -0.00000114, 0.00000000],
+		[-6.27303380, -0.00047402, 0.00029042, 0.00047642, -0.00000114, 0.00000000],
+		[-6.27303398, -0.00047395, 0.00029038, 0.00047635, -0.00000114, 0.00000000],
+		[-6.27303415, -0.00047388, 0.00029033, 0.00047627, -0.00000114, 0.00000000],
+		[-6.27303432, -0.00047380, 0.00029029, 0.00047620, -0.00000114, 0.00000000],
+		[-6.27303450, -0.00047373, 0.00029025, 0.00047613, -0.00000114, 0.00000000],
+		[-6.27303467, -0.00047366, 0.00029020, 0.00047606, -0.00000114, 0.00000000],
+		[-6.27303484, -0.00047359, 0.00029016, 0.00047598, -0.00000114, 0.00000000],
+		[-6.27303502, -0.00047351, 0.00029011, 0.00047591, -0.00000114, 0.00000000],
+		[-6.27303519, -0.00047344, 0.00029007, 0.00047584, -0.00000114, 0.00000000],
+		[-6.27303536, -0.00047337, 0.00029002, 0.00047576, -0.00000114, 0.00000000],
+		[-6.27303554, -0.00047330, 0.00028998, 0.00047569, -0.00000114, 0.00000000],
+		[-6.27303571, -0.00047323, 0.00028993, 0.00047562, -0.00000114, 0.00000000],
+		[-6.27303588, -0.00047315, 0.00028989, 0.00047555, -0.00000114, 0.00000000],
+		[-6.27303606, -0.00047308, 0.00028985, 0.00047547, -0.00000114, 0.00000000],
+		[-6.27303623, -0.00047301, 0.00028980, 0.00047540, -0.00000114, 0.00000000],
+		[-6.27303640, -0.00047294, 0.00028976, 0.00047533, -0.00000114, 0.00000000],
+		[-6.27303658, -0.00047286, 0.00028971, 0.00047526, -0.00000114, 0.00000000],
+		[-6.27303675, -0.00047279, 0.00028967, 0.00047518, -0.00000114, 0.00000000],
+		[-6.27303692, -0.00047272, 0.00028962, 0.00047511, -0.00000114, 0.00000000],
+		[-6.27303709, -0.00047265, 0.00028958, 0.00047504, -0.00000114, 0.00000000],
+		[-6.27303727, -0.00047258, 0.00028954, 0.00047497, -0.00000114, 0.00000000],
+		[-6.27303744, -0.00047250, 0.00028949, 0.00047489, -0.00000114, 0.00000000],
+		[-6.27303761, -0.00047243, 0.00028945, 0.00047482, -0.00000114, 0.00000000],
+		[-6.27303778, -0.00047236, 0.00028940, 0.00047475, -0.00000114, 0.00000000],
+		[-6.27303796, -0.00047229, 0.00028936, 0.00047468, -0.00000114, 0.00000000],
+		[-6.27303813, -0.00047221, 0.00028931, 0.00047460, -0.00000114, 0.00000000],
+		[-6.27303830, -0.00047214, 0.00028927, 0.00047453, -0.00000114, 0.00000000],
+		[-6.27303847, -0.00047207, 0.00028923, 0.00047446, -0.00000114, 0.00000000],
+		[-6.27303865, -0.00047200, 0.00028918, 0.00047439, -0.00000114, 0.00000000],
+		[-6.27303882, -0.00047193, 0.00028914, 0.00047431, -0.00000114, 0.00000000],
+		[-6.27303899, -0.00047185, 0.00028909, 0.00047424, -0.00000114, 0.00000000],
+		[-6.27303916, -0.00047178, 0.00028905, 0.00047417, -0.00000114, 0.00000000],
+		[-6.27303933, -0.00047171, 0.00028901, 0.00047410, -0.00000114, 0.00000000],
+		[-6.27303951, -0.00047164, 0.00028896, 0.00047402, -0.00000114, 0.00000000],
+		[-6.27303968, -0.00047157, 0.00028892, 0.00047395, -0.00000114, 0.00000000],
+		[-6.27303985, -0.00047150, 0.00028887, 0.00047388, -0.00000114, 0.00000000],
+		[-6.27304002, -0.00047142, 0.00028883, 0.00047381, -0.00000114, 0.00000000],
+		[-6.27304019, -0.00047135, 0.00028879, 0.00047374, -0.00000114, 0.00000000],
+		[-6.27304037, -0.00047128, 0.00028874, 0.00047366, -0.00000114, 0.00000000],
+		[-6.27304054, -0.00047121, 0.00028870, 0.00047359, -0.00000114, 0.00000000],
+		[-6.27304071, -0.00047114, 0.00028865, 0.00047352, -0.00000114, 0.00000000],
+		[-6.27304088, -0.00047106, 0.00028861, 0.00047345, -0.00000114, 0.00000000],
+		[-6.27304105, -0.00047099, 0.00028857, 0.00047337, -0.00000114, 0.00000000],
+		[-6.27304122, -0.00047092, 0.00028852, 0.00047330, -0.00000114, 0.00000000],
+		[-6.27304139, -0.00047085, 0.00028848, 0.00047323, -0.00000114, 0.00000000],
+		[-6.27304157, -0.00047078, 0.00028843, 0.00047316, -0.00000114, 0.00000000],
+		[-6.27304174, -0.00047071, 0.00028839, 0.00047309, -0.00000114, 0.00000000],
+		[-6.27304191, -0.00047064, 0.00028835, 0.00047302, -0.00000114, 0.00000000],
+		[-6.27304208, -0.00047056, 0.00028830, 0.00047294, -0.00000114, 0.00000000],
+		[-6.27304225, -0.00047049, 0.00028826, 0.00047287, -0.00000114, 0.00000000],
+		[-6.27304242, -0.00047042, 0.00028822, 0.00047280, -0.00000114, 0.00000000],
+		[-6.27304259, -0.00047035, 0.00028817, 0.00047273, -0.00000114, 0.00000000],
+		[-6.27304276, -0.00047028, 0.00028813, 0.00047266, -0.00000114, 0.00000000],
+		[-6.27304294, -0.00047021, 0.00028808, 0.00047258, -0.00000114, 0.00000000],
+		[-6.27304311, -0.00047013, 0.00028804, 0.00047251, -0.00000114, 0.00000000],
+		[-6.27304328, -0.00047006, 0.00028800, 0.00047244, -0.00000114, 0.00000000],
+		[-6.27304345, -0.00046999, 0.00028795, 0.00047237, -0.00000114, 0.00000000],
+		[-6.27304362, -0.00046992, 0.00028791, 0.00047230, -0.00000114, 0.00000000],
+		[-6.27304379, -0.00046985, 0.00028787, 0.00047223, -0.00000114, 0.00000000],
+		[-6.27304396, -0.00046978, 0.00028782, 0.00047215, -0.00000114, 0.00000000],
+		[-6.27304413, -0.00046971, 0.00028778, 0.00047208, -0.00000114, 0.00000000],
+		[-6.27304430, -0.00046964, 0.00028773, 0.00047201, -0.00000114, 0.00000000],
+		[-6.27304447, -0.00046956, 0.00028769, 0.00047194, -0.00000114, 0.00000000],
+		[-6.27304464, -0.00046949, 0.00028765, 0.00047187, -0.00000114, 0.00000000],
+		[-6.27304481, -0.00046942, 0.00028760, 0.00047180, -0.00000114, 0.00000000],
+		[-6.27304498, -0.00046935, 0.00028756, 0.00047172, -0.00000114, 0.00000000],
+		[-6.27304515, -0.00046928, 0.00028752, 0.00047165, -0.00000114, 0.00000000],
+		[-6.27304532, -0.00046921, 0.00028747, 0.00047158, -0.00000114, 0.00000000],
+		[-6.27304549, -0.00046914, 0.00028743, 0.00047151, -0.00000114, 0.00000000],
+		[-6.27304566, -0.00046907, 0.00028738, 0.00047144, -0.00000114, 0.00000000],
+		[-6.27304583, -0.00046900, 0.00028734, 0.00047137, -0.00000114, 0.00000000],
+		[-6.27304600, -0.00046892, 0.00028730, 0.00047130, -0.00000114, 0.00000000],
+		[-6.27304617, -0.00046885, 0.00028725, 0.00047122, -0.00000114, 0.00000000],
+		[-6.27304634, -0.00046878, 0.00028721, 0.00047115, -0.00000114, 0.00000000],
+		[-6.27304651, -0.00046871, 0.00028717, 0.00047108, -0.00000114, 0.00000000],
+		[-6.27304668, -0.00046864, 0.00028712, 0.00047101, -0.00000114, 0.00000000],
+		[-6.27304685, -0.00046857, 0.00028708, 0.00047094, -0.00000114, 0.00000000],
+		[-6.27304702, -0.00046850, 0.00028704, 0.00047087, -0.00000114, 0.00000000],
+		[-6.27304719, -0.00046843, 0.00028699, 0.00047080, -0.00000114, 0.00000000],
+		[-6.27304736, -0.00046836, 0.00028695, 0.00047072, -0.00000114, 0.00000000],
+		[-6.27304753, -0.00046829, 0.00028691, 0.00047065, -0.00000114, 0.00000000],
+		[-6.27304770, -0.00046821, 0.00028686, 0.00047058, -0.00000114, 0.00000000],
+		[-6.27304787, -0.00046814, 0.00028682, 0.00047051, -0.00000114, 0.00000000],
+		[-6.27304804, -0.00046807, 0.00028678, 0.00047044, -0.00000114, 0.00000000],
+		[-6.27304821, -0.00046800, 0.00028673, 0.00047037, -0.00000114, 0.00000000],
+		[-6.27304838, -0.00046793, 0.00028669, 0.00047030, -0.00000114, 0.00000000],
+		[-6.27304855, -0.00046786, 0.00028665, 0.00047023, -0.00000114, 0.00000000],
+		[-6.27304872, -0.00046779, 0.00028660, 0.00047016, -0.00000114, 0.00000000],
+		[-6.27304889, -0.00046772, 0.00028656, 0.00047008, -0.00000114, 0.00000000],
+		[-6.27304906, -0.00046765, 0.00028652, 0.00047001, -0.00000114, 0.00000000],
+		[-6.27304922, -0.00046758, 0.00028647, 0.00046994, -0.00000114, 0.00000000],
+		[-6.27304939, -0.00046751, 0.00028643, 0.00046987, -0.00000114, 0.00000000],
+		[-6.27304956, -0.00046744, 0.00028639, 0.00046980, -0.00000114, 0.00000000],
+		[-6.27304973, -0.00046737, 0.00028634, 0.00046973, -0.00000114, 0.00000000],
+		[-6.27304990, -0.00046730, 0.00028630, 0.00046966, -0.00000114, 0.00000000],
+		[-6.27305007, -0.00046723, 0.00028626, 0.00046959, -0.00000114, 0.00000000],
+		[-6.27305024, -0.00046715, 0.00028621, 0.00046952, -0.00000114, 0.00000000],
+		[-6.27305041, -0.00046708, 0.00028617, 0.00046945, -0.00000114, 0.00000000],
+		[-6.27305057, -0.00046701, 0.00028613, 0.00046938, -0.00000114, 0.00000000],
+		[-6.27305074, -0.00046694, 0.00028608, 0.00046930, -0.00000114, 0.00000000],
+		[-6.27305091, -0.00046687, 0.00028604, 0.00046923, -0.00000114, 0.00000000],
+		[-6.27305108, -0.00046680, 0.00028600, 0.00046916, -0.00000114, 0.00000000],
+		[-6.27305125, -0.00046673, 0.00028595, 0.00046909, -0.00000114, 0.00000000],
+		[-6.27305142, -0.00046666, 0.00028591, 0.00046902, -0.00000114, 0.00000000],
+		[-6.27305159, -0.00046659, 0.00028587, 0.00046895, -0.00000114, 0.00000000],
+		[-6.27305175, -0.00046652, 0.00028582, 0.00046888, -0.00000114, 0.00000000],
+		[-6.27305192, -0.00046645, 0.00028578, 0.00046881, -0.00000114, 0.00000000],
+		[-6.27305209, -0.00046638, 0.00028574, 0.00046874, -0.00000114, 0.00000000],
+		[-6.27305226, -0.00046631, 0.00028570, 0.00046867, -0.00000114, 0.00000000],
+		[-6.27305243, -0.00046624, 0.00028565, 0.00046860, -0.00000114, 0.00000000],
+		[-6.27305259, -0.00046617, 0.00028561, 0.00046853, -0.00000114, 0.00000000],
+		[-6.27305276, -0.00046610, 0.00028557, 0.00046846, -0.00000114, 0.00000000],
+		[-6.27305293, -0.00046603, 0.00028552, 0.00046839, -0.00000114, 0.00000000],
+		[-6.27305310, -0.00046596, 0.00028548, 0.00046832, -0.00000114, 0.00000000],
+		[-6.27305327, -0.00046589, 0.00028544, 0.00046824, -0.00000114, 0.00000000],
+		[-6.27305343, -0.00046582, 0.00028539, 0.00046817, -0.00000114, 0.00000000],
+		[-6.27305360, -0.00046575, 0.00028535, 0.00046810, -0.00000114, 0.00000000],
+		[-6.27305377, -0.00046568, 0.00028531, 0.00046803, -0.00000114, 0.00000000],
+		[-6.27305394, -0.00046561, 0.00028527, 0.00046796, -0.00000114, 0.00000000],
+		[-6.27305410, -0.00046554, 0.00028522, 0.00046789, -0.00000114, 0.00000000],
+		[-6.27305427, -0.00046547, 0.00028518, 0.00046782, -0.00000114, 0.00000000],
+		[-6.27305444, -0.00046540, 0.00028514, 0.00046775, -0.00000114, 0.00000000],
+		[-6.27305461, -0.00046533, 0.00028509, 0.00046768, -0.00000114, 0.00000000],
+		[-6.27305477, -0.00046526, 0.00028505, 0.00046761, -0.00000114, 0.00000000],
+		[-6.27305494, -0.00046519, 0.00028501, 0.00046754, -0.00000114, 0.00000000],
+		[-6.27305511, -0.00046512, 0.00028497, 0.00046747, -0.00000114, 0.00000000],
+		[-6.27305528, -0.00046505, 0.00028492, 0.00046740, -0.00000114, 0.00000000],
+		[-6.27305544, -0.00046498, 0.00028488, 0.00046733, -0.00000114, 0.00000000],
+		[-6.27305561, -0.00046491, 0.00028484, 0.00046726, -0.00000114, 0.00000000],
+		[-6.27305578, -0.00046484, 0.00028479, 0.00046719, -0.00000114, 0.00000000],
+		[-6.27305594, -0.00046477, 0.00028475, 0.00046712, -0.00000114, 0.00000000],
+		[-6.27305611, -0.00046470, 0.00028471, 0.00046705, -0.00000114, 0.00000000],
+		[-6.27305628, -0.00046463, 0.00028467, 0.00046698, -0.00000114, 0.00000000],
+		[-6.27305645, -0.00046456, 0.00028462, 0.00046691, -0.00000114, 0.00000000],
+		[-6.27305661, -0.00046449, 0.00028458, 0.00046684, -0.00000114, 0.00000000],
+		[-6.27305678, -0.00046442, 0.00028454, 0.00046677, -0.00000114, 0.00000000],
+		[-6.27305695, -0.00046435, 0.00028449, 0.00046670, -0.00000114, 0.00000000],
+		[-6.27305711, -0.00046428, 0.00028445, 0.00046663, -0.00000114, 0.00000000],
+		[-6.27305728, -0.00046421, 0.00028441, 0.00046656, -0.00000114, 0.00000000],
+		[-6.27305745, -0.00046414, 0.00028437, 0.00046649, -0.00000114, 0.00000000],
+		[-6.27305761, -0.00046407, 0.00028432, 0.00046642, -0.00000114, 0.00000000],
+		[-6.27305778, -0.00046400, 0.00028428, 0.00046635, -0.00000114, 0.00000000],
+		[-6.27305795, -0.00046393, 0.00028424, 0.00046628, -0.00000114, 0.00000000],
+		[-6.27305811, -0.00046386, 0.00028420, 0.00046621, -0.00000114, 0.00000000],
+		[-6.27305828, -0.00046380, 0.00028415, 0.00046614, -0.00000114, 0.00000000],
+		[-6.27305844, -0.00046373, 0.00028411, 0.00046607, -0.00000114, 0.00000000],
+		[-6.27305861, -0.00046366, 0.00028407, 0.00046600, -0.00000114, 0.00000000],
+		[-6.27305878, -0.00046359, 0.00028403, 0.00046593, -0.00000114, 0.00000000],
+		[-6.27305894, -0.00046352, 0.00028398, 0.00046586, -0.00000114, 0.00000000],
+		[-6.27305911, -0.00046345, 0.00028394, 0.00046579, -0.00000114, 0.00000000],
+		[-6.27305927, -0.00046338, 0.00028390, 0.00046572, -0.00000114, 0.00000000],
+		[-6.27305944, -0.00046331, 0.00028386, 0.00046565, -0.00000114, 0.00000000],
+		[-6.27305961, -0.00046324, 0.00028381, 0.00046558, -0.00000114, 0.00000000],
+		[-6.27305977, -0.00046317, 0.00028377, 0.00046551, -0.00000114, 0.00000000],
+		[-6.27305994, -0.00046310, 0.00028373, 0.00046544, -0.00000114, 0.00000000],
+		[-6.27306010, -0.00046303, 0.00028369, 0.00046537, -0.00000114, 0.00000000],
+		[-6.27306027, -0.00046296, 0.00028364, 0.00046530, -0.00000114, 0.00000000],
+		[-6.27306044, -0.00046289, 0.00028360, 0.00046523, -0.00000114, 0.00000000],
+		[-6.27306060, -0.00046282, 0.00028356, 0.00046516, -0.00000114, 0.00000000],
+		[-6.27306077, -0.00046276, 0.00028352, 0.00046509, -0.00000114, 0.00000000],
+		[-6.27306093, -0.00046269, 0.00028347, 0.00046502, -0.00000114, 0.00000000],
+		[-6.27306110, -0.00046262, 0.00028343, 0.00046496, -0.00000114, 0.00000000],
+		[-6.27306126, -0.00046255, 0.00028339, 0.00046489, -0.00000114, 0.00000000],
+		[-6.27306143, -0.00046248, 0.00028335, 0.00046482, -0.00000114, 0.00000000],
+		[-6.27306159, -0.00046241, 0.00028330, 0.00046475, -0.00000114, 0.00000000],
+		[-6.27306176, -0.00046234, 0.00028326, 0.00046468, -0.00000114, 0.00000000],
+		[-6.27306192, -0.00046227, 0.00028322, 0.00046461, -0.00000114, 0.00000000],
+		[-6.27306209, -0.00046220, 0.00028318, 0.00046454, -0.00000114, 0.00000000],
+		[-6.27306225, -0.00046213, 0.00028314, 0.00046447, -0.00000114, 0.00000000],
+		[-6.27306242, -0.00046206, 0.00028309, 0.00046440, -0.00000114, 0.00000000],
+		[-6.27306259, -0.00046200, 0.00028305, 0.00046433, -0.00000114, 0.00000000],
+		[-6.27306275, -0.00046193, 0.00028301, 0.00046426, -0.00000114, 0.00000000],
+		[-6.27306292, -0.00046186, 0.00028297, 0.00046419, -0.00000114, 0.00000000],
+		[-6.27306308, -0.00046179, 0.00028292, 0.00046412, -0.00000114, 0.00000000],
+		[-6.27306324, -0.00046172, 0.00028288, 0.00046405, -0.00000114, 0.00000000],
+		[-6.27306341, -0.00046165, 0.00028284, 0.00046398, -0.00000114, 0.00000000],
+		[-6.27306357, -0.00046158, 0.00028280, 0.00046392, -0.00000114, 0.00000000],
+		[-6.27306374, -0.00046151, 0.00028275, 0.00046385, -0.00000114, 0.00000000],
+		[-6.27306390, -0.00046144, 0.00028271, 0.00046378, -0.00000114, 0.00000000],
+		[-6.27306407, -0.00046138, 0.00028267, 0.00046371, -0.00000114, 0.00000000],
+		[-6.27306423, -0.00046131, 0.00028263, 0.00046364, -0.00000114, 0.00000000],
+		[-6.27306440, -0.00046124, 0.00028259, 0.00046357, -0.00000114, 0.00000000],
+		[-6.27306456, -0.00046117, 0.00028254, 0.00046350, -0.00000114, 0.00000000],
+		[-6.27306473, -0.00046110, 0.00028250, 0.00046343, -0.00000114, 0.00000000],
+		[-6.27306489, -0.00046103, 0.00028246, 0.00046336, -0.00000114, 0.00000000],
+		[-6.27306505, -0.00046096, 0.00028242, 0.00046329, -0.00000114, 0.00000000],
+		[-6.27306522, -0.00046090, 0.00028238, 0.00046322, -0.00000114, 0.00000000],
+		[-6.27306538, -0.00046083, 0.00028233, 0.00046316, -0.00000114, 0.00000000],
+		[-6.27306555, -0.00046076, 0.00028229, 0.00046309, -0.00000114, 0.00000000],
+		[-6.27306571, -0.00046069, 0.00028225, 0.00046302, -0.00000114, 0.00000000],
+		[-6.27306588, -0.00046062, 0.00028221, 0.00046295, -0.00000114, 0.00000000],
+		[-6.27306604, -0.00046055, 0.00028217, 0.00046288, -0.00000114, 0.00000000],
+		[-6.27306620, -0.00046048, 0.00028212, 0.00046281, -0.00000114, 0.00000000],
+		[-6.27306637, -0.00046042, 0.00028208, 0.00046274, -0.00000114, 0.00000000],
+		[-6.27306653, -0.00046035, 0.00028204, 0.00046267, -0.00000114, 0.00000000],
+		[-6.27306670, -0.00046028, 0.00028200, 0.00046260, -0.00000114, 0.00000000],
+		[-6.27306686, -0.00046021, 0.00028196, 0.00046254, -0.00000114, 0.00000000],
+		[-6.27306702, -0.00046014, 0.00028191, 0.00046247, -0.00000114, 0.00000000],
+		[-6.27306719, -0.00046007, 0.00028187, 0.00046240, -0.00000114, 0.00000000],
+		[-6.27306735, -0.00046000, 0.00028183, 0.00046233, -0.00000114, 0.00000000],
+		[-6.27306751, -0.00045994, 0.00028179, 0.00046226, -0.00000114, 0.00000000],
+		[-6.27306768, -0.00045987, 0.00028175, 0.00046219, -0.00000114, 0.00000000],
+		[-6.27306784, -0.00045980, 0.00028170, 0.00046212, -0.00000114, 0.00000000],
+		[-6.27306800, -0.00045973, 0.00028166, 0.00046205, -0.00000114, 0.00000000],
+		[-6.27306817, -0.00045966, 0.00028162, 0.00046199, -0.00000114, 0.00000000],
+		[-6.27306833, -0.00045959, 0.00028158, 0.00046192, -0.00000114, 0.00000000],
+		[-6.27306849, -0.00045953, 0.00028154, 0.00046185, -0.00000114, 0.00000000],
+		[-6.27306866, -0.00045946, 0.00028150, 0.00046178, -0.00000114, 0.00000000],
+		[-6.27306882, -0.00045939, 0.00028145, 0.00046171, -0.00000114, 0.00000000],
+		[-6.27306898, -0.00045932, 0.00028141, 0.00046164, -0.00000114, 0.00000000],
+		[-6.27306915, -0.00045925, 0.00028137, 0.00046158, -0.00000114, 0.00000000],
+		[-6.27306931, -0.00045919, 0.00028133, 0.00046151, -0.00000114, 0.00000000],
+		[-6.27306947, -0.00045912, 0.00028129, 0.00046144, -0.00000114, 0.00000000],
+		[-6.27306964, -0.00045905, 0.00028124, 0.00046137, -0.00000114, 0.00000000],
+		[-6.27306980, -0.00045898, 0.00028120, 0.00046130, -0.00000114, 0.00000000],
+		[-6.27306996, -0.00045891, 0.00028116, 0.00046123, -0.00000114, 0.00000000],
+		[-6.27307012, -0.00045885, 0.00028112, 0.00046116, -0.00000114, 0.00000000],
+		[-6.27307029, -0.00045878, 0.00028108, 0.00046110, -0.00000114, 0.00000000],
+		[-6.27307045, -0.00045871, 0.00028104, 0.00046103, -0.00000114, 0.00000000],
+		[-6.27307061, -0.00045864, 0.00028099, 0.00046096, -0.00000114, 0.00000000],
+		[-6.27307078, -0.00045857, 0.00028095, 0.00046089, -0.00000114, 0.00000000],
+		[-6.27307094, -0.00045851, 0.00028091, 0.00046082, -0.00000114, 0.00000000],
+		[-6.27307110, -0.00045844, 0.00028087, 0.00046075, -0.00000114, 0.00000000],
+		[-6.27307126, -0.00045837, 0.00028083, 0.00046069, -0.00000114, 0.00000000],
+		[-6.27307142, -0.00045830, 0.00028079, 0.00046062, -0.00000114, 0.00000000],
+		[-6.27307159, -0.00045823, 0.00028074, 0.00046055, -0.00000114, 0.00000000],
+		[-6.27307175, -0.00045817, 0.00028070, 0.00046048, -0.00000114, 0.00000000],
+		[-6.27307191, -0.00045810, 0.00028066, 0.00046041, -0.00000114, 0.00000000],
+		[-6.27307207, -0.00045803, 0.00028062, 0.00046035, -0.00000114, 0.00000000],
+		[-6.27307224, -0.00045796, 0.00028058, 0.00046028, -0.00000114, 0.00000000],
+		[-6.27307240, -0.00045790, 0.00028054, 0.00046021, -0.00000114, 0.00000000],
+		[-6.27307256, -0.00045783, 0.00028050, 0.00046014, -0.00000114, 0.00000000],
+		[-6.27307272, -0.00045776, 0.00028045, 0.00046007, -0.00000114, 0.00000000],
+		[-6.27307288, -0.00045769, 0.00028041, 0.00046001, -0.00000114, 0.00000000],
+		[-6.27307305, -0.00045762, 0.00028037, 0.00045994, -0.00000114, 0.00000000],
+		[-6.27307321, -0.00045756, 0.00028033, 0.00045987, -0.00000114, 0.00000000],
+		[-6.27307337, -0.00045749, 0.00028029, 0.00045980, -0.00000114, 0.00000000],
+		[-6.27307353, -0.00045742, 0.00028025, 0.00045973, -0.00000114, 0.00000000],
+		[-6.27307369, -0.00045735, 0.00028021, 0.00045967, -0.00000114, 0.00000000],
+		[-6.27307386, -0.00045729, 0.00028016, 0.00045960, -0.00000114, 0.00000000],
+		[-6.27307402, -0.00045722, 0.00028012, 0.00045953, -0.00000114, 0.00000000],
+		[-6.27307418, -0.00045715, 0.00028008, 0.00045946, -0.00000114, 0.00000000],
+		[-6.27307434, -0.00045708, 0.00028004, 0.00045939, -0.00000114, 0.00000000],
+		[-6.27307450, -0.00045702, 0.00028000, 0.00045933, -0.00000114, 0.00000000],
+		[-6.27307466, -0.00045695, 0.00027996, 0.00045926, -0.00000114, 0.00000000],
+		[-6.27307482, -0.00045688, 0.00027992, 0.00045919, -0.00000114, 0.00000000],
+		[-6.27307499, -0.00045681, 0.00027987, 0.00045912, -0.00000114, 0.00000000],
+		[-6.27307515, -0.00045675, 0.00027983, 0.00045905, -0.00000114, 0.00000000],
+		[-6.27307531, -0.00045668, 0.00027979, 0.00045899, -0.00000114, 0.00000000],
+		[-6.27307547, -0.00045661, 0.00027975, 0.00045892, -0.00000114, 0.00000000],
+		[-6.27307563, -0.00045654, 0.00027971, 0.00045885, -0.00000114, 0.00000000],
+		[-6.27307579, -0.00045648, 0.00027967, 0.00045878, -0.00000114, 0.00000000],
+		[-6.27307595, -0.00045641, 0.00027963, 0.00045872, -0.00000114, 0.00000000],
+		[-6.27307611, -0.00045634, 0.00027959, 0.00045865, -0.00000114, 0.00000000],
+		[-6.27307628, -0.00045628, 0.00027954, 0.00045858, -0.00000114, 0.00000000],
+		[-6.27307644, -0.00045621, 0.00027950, 0.00045851, -0.00000114, 0.00000000],
+		[-6.27307660, -0.00045614, 0.00027946, 0.00045845, -0.00000114, 0.00000000],
+		[-6.27307676, -0.00045607, 0.00027942, 0.00045838, -0.00000114, 0.00000000],
+		[-6.27307692, -0.00045601, 0.00027938, 0.00045831, -0.00000114, 0.00000000],
+		[-6.27307708, -0.00045594, 0.00027934, 0.00045824, -0.00000114, 0.00000000],
+		[-6.27307724, -0.00045587, 0.00027930, 0.00045818, -0.00000114, 0.00000000],
+		[-6.27307740, -0.00045581, 0.00027926, 0.00045811, -0.00000114, 0.00000000],
+		[-6.27307756, -0.00045574, 0.00027921, 0.00045804, -0.00000114, 0.00000000],
+		[-6.27307772, -0.00045567, 0.00027917, 0.00045797, -0.00000114, 0.00000000],
+		[-6.27307788, -0.00045560, 0.00027913, 0.00045791, -0.00000114, 0.00000000],
+		[-6.27307804, -0.00045554, 0.00027909, 0.00045784, -0.00000114, 0.00000000],
+		[-6.27307820, -0.00045547, 0.00027905, 0.00045777, -0.00000114, 0.00000000],
+		[-6.27307836, -0.00045540, 0.00027901, 0.00045770, -0.00000114, 0.00000000],
+		[-6.27307852, -0.00045534, 0.00027897, 0.00045764, -0.00000114, 0.00000000],
+		[-6.27307868, -0.00045527, 0.00027893, 0.00045757, -0.00000114, 0.00000000],
+		[-6.27307884, -0.00045520, 0.00027889, 0.00045750, -0.00000114, 0.00000000],
+		[-6.27307900, -0.00045514, 0.00027884, 0.00045743, -0.00000114, 0.00000000],
+		[-6.27307916, -0.00045507, 0.00027880, 0.00045737, -0.00000114, 0.00000000],
+		[-6.27307932, -0.00045500, 0.00027876, 0.00045730, -0.00000114, 0.00000000],
+		[-6.27307949, -0.00045493, 0.00027872, 0.00045723, -0.00000114, 0.00000000],
+		[-6.27307964, -0.00045487, 0.00027868, 0.00045717, -0.00000114, 0.00000000],
+		[-6.27307980, -0.00045480, 0.00027864, 0.00045710, -0.00000114, 0.00000000],
+		[-6.27307996, -0.00045473, 0.00027860, 0.00045703, -0.00000114, 0.00000000],
+		[-6.27308012, -0.00045467, 0.00027856, 0.00045696, -0.00000114, 0.00000000],
+		[-6.27308028, -0.00045460, 0.00027852, 0.00045690, -0.00000114, 0.00000000],
+		[-6.27308044, -0.00045453, 0.00027848, 0.00045683, -0.00000114, 0.00000000],
+		[-6.27308060, -0.00045447, 0.00027844, 0.00045676, -0.00000114, 0.00000000],
+		[-6.27308076, -0.00045440, 0.00027839, 0.00045670, -0.00000114, 0.00000000],
+		[-6.27308092, -0.00045433, 0.00027835, 0.00045663, -0.00000114, 0.00000000],
+		[-6.27308108, -0.00045427, 0.00027831, 0.00045656, -0.00000114, 0.00000000],
+		[-6.27308124, -0.00045420, 0.00027827, 0.00045650, -0.00000114, 0.00000000],
+		[-6.27308140, -0.00045413, 0.00027823, 0.00045643, -0.00000114, 0.00000000],
+		[-6.27308156, -0.00045407, 0.00027819, 0.00045636, -0.00000114, 0.00000000],
+		[-6.27308172, -0.00045400, 0.00027815, 0.00045629, -0.00000114, 0.00000000],
+		[-6.27308188, -0.00045393, 0.00027811, 0.00045623, -0.00000114, 0.00000000],
+		[-6.27308204, -0.00045387, 0.00027807, 0.00045616, -0.00000114, 0.00000000],
+		[-6.27308220, -0.00045380, 0.00027803, 0.00045609, -0.00000114, 0.00000000],
+		[-6.27308236, -0.00045373, 0.00027799, 0.00045603, -0.00000114, 0.00000000],
+		[-6.27308252, -0.00045367, 0.00027795, 0.00045596, -0.00000114, 0.00000000],
+		[-6.27308268, -0.00045360, 0.00027790, 0.00045589, -0.00000114, 0.00000000],
+		[-6.27308284, -0.00045353, 0.00027786, 0.00045583, -0.00000114, 0.00000000],
+		[-6.27308299, -0.00045347, 0.00027782, 0.00045576, -0.00000114, 0.00000000],
+		[-6.27308315, -0.00045340, 0.00027778, 0.00045569, -0.00000114, 0.00000000],
+		[-6.27308331, -0.00045334, 0.00027774, 0.00045563, -0.00000114, 0.00000000],
+		[-6.27308347, -0.00045327, 0.00027770, 0.00045556, -0.00000114, 0.00000000],
+		[-6.27308363, -0.00045320, 0.00027766, 0.00045549, -0.00000114, 0.00000000],
+		[-6.27308379, -0.00045314, 0.00027762, 0.00045543, -0.00000114, 0.00000000],
+		[-6.27308395, -0.00045307, 0.00027758, 0.00045536, -0.00000114, 0.00000000],
+		[-6.27308411, -0.00045300, 0.00027754, 0.00045529, -0.00000114, 0.00000000],
+		[-6.27308426, -0.00045294, 0.00027750, 0.00045523, -0.00000114, 0.00000000],
+		[-6.27308442, -0.00045287, 0.00027746, 0.00045516, -0.00000114, 0.00000000],
+		[-6.27308458, -0.00045281, 0.00027742, 0.00045509, -0.00000114, 0.00000000],
+		[-6.27308474, -0.00045274, 0.00027738, 0.00045503, -0.00000114, 0.00000000],
+		[-6.27308490, -0.00045267, 0.00027734, 0.00045496, -0.00000114, 0.00000000],
+		[-6.27308506, -0.00045261, 0.00027729, 0.00045489, -0.00000114, 0.00000000],
+		[-6.27308522, -0.00045254, 0.00027725, 0.00045483, -0.00000114, 0.00000000],
+		[-6.27308537, -0.00045247, 0.00027721, 0.00045476, -0.00000114, 0.00000000],
+		[-6.27308553, -0.00045241, 0.00027717, 0.00045469, -0.00000114, 0.00000000],
+		[-6.27308569, -0.00045234, 0.00027713, 0.00045463, -0.00000114, 0.00000000],
+		[-6.27308585, -0.00045228, 0.00027709, 0.00045456, -0.00000114, 0.00000000],
+		[-6.27308601, -0.00045221, 0.00027705, 0.00045449, -0.00000114, 0.00000000],
+		[-6.27308616, -0.00045214, 0.00027701, 0.00045443, -0.00000114, 0.00000000],
+		[-6.27308632, -0.00045208, 0.00027697, 0.00045436, -0.00000114, 0.00000000],
+		[-6.27308648, -0.00045201, 0.00027693, 0.00045430, -0.00000114, 0.00000000],
+		[-6.27308664, -0.00045195, 0.00027689, 0.00045423, -0.00000114, 0.00000000],
+		[-6.27308680, -0.00045188, 0.00027685, 0.00045416, -0.00000114, 0.00000000],
+		[-6.27308695, -0.00045181, 0.00027681, 0.00045410, -0.00000114, 0.00000000],
+		[-6.27308711, -0.00045175, 0.00027677, 0.00045403, -0.00000114, 0.00000000],
+		[-6.27308727, -0.00045168, 0.00027673, 0.00045396, -0.00000114, 0.00000000],
+		[-6.27308743, -0.00045162, 0.00027669, 0.00045390, -0.00000114, 0.00000000],
+		[-6.27308759, -0.00045155, 0.00027665, 0.00045383, -0.00000114, 0.00000000],
+		[-6.27308774, -0.00045148, 0.00027661, 0.00045376, -0.00000114, 0.00000000],
+		[-6.27308790, -0.00045142, 0.00027657, 0.00045370, -0.00000114, 0.00000000],
+		[-6.27308806, -0.00045135, 0.00027653, 0.00045363, -0.00000114, 0.00000000],
+		[-6.27308822, -0.00045129, 0.00027649, 0.00045357, -0.00000114, 0.00000000],
+		[-6.27308837, -0.00045122, 0.00027645, 0.00045350, -0.00000114, 0.00000000],
+		[-6.27308853, -0.00045116, 0.00027641, 0.00045343, -0.00000114, 0.00000000],
+		[-6.27308869, -0.00045109, 0.00027636, 0.00045337, -0.00000114, 0.00000000],
+		[-6.27308884, -0.00045102, 0.00027632, 0.00045330, -0.00000114, 0.00000000],
+		[-6.27308900, -0.00045096, 0.00027628, 0.00045324, -0.00000114, 0.00000000],
+		[-6.27308916, -0.00045089, 0.00027624, 0.00045317, -0.00000114, 0.00000000],
+		[-6.27308932, -0.00045083, 0.00027620, 0.00045310, -0.00000114, 0.00000000],
+		[-6.27308947, -0.00045076, 0.00027616, 0.00045304, -0.00000114, 0.00000000],
+		[-6.27308963, -0.00045070, 0.00027612, 0.00045297, -0.00000114, 0.00000000],
+		[-6.27308979, -0.00045063, 0.00027608, 0.00045291, -0.00000114, 0.00000000],
+		[-6.27308994, -0.00045056, 0.00027604, 0.00045284, -0.00000114, 0.00000000],
+		[-6.27309010, -0.00045050, 0.00027600, 0.00045277, -0.00000114, 0.00000000],
+		[-6.27309026, -0.00045043, 0.00027596, 0.00045271, -0.00000114, 0.00000000],
+		[-6.27309042, -0.00045037, 0.00027592, 0.00045264, -0.00000114, 0.00000000],
+		[-6.27309057, -0.00045030, 0.00027588, 0.00045258, -0.00000114, 0.00000000],
+		[-6.27309073, -0.00045024, 0.00027584, 0.00045251, -0.00000114, 0.00000000],
+		[-6.27309089, -0.00045017, 0.00027580, 0.00045245, -0.00000114, 0.00000000],
+		[-6.27309104, -0.00045011, 0.00027576, 0.00045238, -0.00000114, 0.00000000],
+		[-6.27309120, -0.00045004, 0.00027572, 0.00045231, -0.00000114, 0.00000000],
+		[-6.27309136, -0.00044997, 0.00027568, 0.00045225, -0.00000114, 0.00000000],
+		[-6.27309151, -0.00044991, 0.00027564, 0.00045218, -0.00000114, 0.00000000],
+		[-6.27309167, -0.00044984, 0.00027560, 0.00045212, -0.00000114, 0.00000000],
+		[-6.27309183, -0.00044978, 0.00027556, 0.00045205, -0.00000114, 0.00000000],
+		[-6.27309198, -0.00044971, 0.00027552, 0.00045198, -0.00000114, 0.00000000],
+		[-6.27309214, -0.00044965, 0.00027548, 0.00045192, -0.00000114, 0.00000000],
+		[-6.27309229, -0.00044958, 0.00027544, 0.00045185, -0.00000114, 0.00000000],
+		[-6.27309245, -0.00044952, 0.00027540, 0.00045179, -0.00000114, 0.00000000],
+		[-6.27309261, -0.00044945, 0.00027536, 0.00045172, -0.00000114, 0.00000000],
+		[-6.27309276, -0.00044939, 0.00027532, 0.00045166, -0.00000114, 0.00000000],
+		[-6.27309292, -0.00044932, 0.00027528, 0.00045159, -0.00000114, 0.00000000],
+		[-6.27309307, -0.00044926, 0.00027524, 0.00045153, -0.00000114, 0.00000000],
+		[-6.27309323, -0.00044919, 0.00027520, 0.00045146, -0.00000114, 0.00000000],
+		[-6.27309339, -0.00044913, 0.00027516, 0.00045139, -0.00000114, 0.00000000],
+		[-6.27309354, -0.00044906, 0.00027512, 0.00045133, -0.00000114, 0.00000000],
+		[-6.27309370, -0.00044900, 0.00027508, 0.00045126, -0.00000114, 0.00000000],
+		[-6.27309385, -0.00044893, 0.00027504, 0.00045120, -0.00000114, 0.00000000],
+		[-6.27309401, -0.00044887, 0.00027500, 0.00045113, -0.00000114, 0.00000000],
+		[-6.27309417, -0.00044880, 0.00027496, 0.00045107, -0.00000114, 0.00000000],
+		[-6.27309432, -0.00044874, 0.00027492, 0.00045100, -0.00000114, 0.00000000],
+		[-6.27309448, -0.00044867, 0.00027488, 0.00045094, -0.00000114, 0.00000000],
+		[-6.27309463, -0.00044861, 0.00027484, 0.00045087, -0.00000114, 0.00000000],
+		[-6.27309479, -0.00044854, 0.00027480, 0.00045081, -0.00000114, 0.00000000],
+		[-6.27309494, -0.00044848, 0.00027476, 0.00045074, -0.00000114, 0.00000000],
+		[-6.27309510, -0.00044841, 0.00027472, 0.00045068, -0.00000114, 0.00000000],
+		[-6.27309526, -0.00044835, 0.00027468, 0.00045061, -0.00000114, 0.00000000],
+		[-6.27309541, -0.00044828, 0.00027464, 0.00045054, -0.00000114, 0.00000000],
+		[-6.27309557, -0.00044822, 0.00027460, 0.00045048, -0.00000114, 0.00000000],
+		[-6.27309572, -0.00044815, 0.00027456, 0.00045041, -0.00000114, 0.00000000],
+		[-6.27309588, -0.00044809, 0.00027452, 0.00045035, -0.00000114, 0.00000000],
+		[-6.27309603, -0.00044802, 0.00027448, 0.00045028, -0.00000114, 0.00000000],
+		[-6.27309619, -0.00044796, 0.00027444, 0.00045022, -0.00000114, 0.00000000],
+		[-6.27309634, -0.00044789, 0.00027440, 0.00045015, -0.00000114, 0.00000000],
+		[-6.27309650, -0.00044783, 0.00027436, 0.00045009, -0.00000114, 0.00000000],
+		[-6.27309665, -0.00044776, 0.00027432, 0.00045002, -0.00000114, 0.00000000],
+		[-6.27309681, -0.00044770, 0.00027429, 0.00044996, -0.00000114, 0.00000000],
+		[-6.27309696, -0.00044763, 0.00027425, 0.00044989, -0.00000114, 0.00000000],
+		[-6.27309712, -0.00044757, 0.00027421, 0.00044983, -0.00000114, 0.00000000],
+		[-6.27309727, -0.00044750, 0.00027417, 0.00044976, -0.00000114, 0.00000000],
+		[-6.27309743, -0.00044744, 0.00027413, 0.00044970, -0.00000114, 0.00000000],
+		[-6.27309758, -0.00044737, 0.00027409, 0.00044963, -0.00000114, 0.00000000],
+		[-6.27309774, -0.00044731, 0.00027405, 0.00044957, -0.00000114, 0.00000000],
+		[-6.27309789, -0.00044724, 0.00027401, 0.00044950, -0.00000114, 0.00000000],
+		[-6.27309805, -0.00044718, 0.00027397, 0.00044944, -0.00000114, 0.00000000],
+		[-6.27309820, -0.00044712, 0.00027393, 0.00044937, -0.00000114, 0.00000000],
+		[-6.27309835, -0.00044705, 0.00027389, 0.00044931, -0.00000114, 0.00000000],
+		[-6.27309851, -0.00044699, 0.00027385, 0.00044924, -0.00000114, 0.00000000],
+		[-6.27309866, -0.00044692, 0.00027381, 0.00044918, -0.00000114, 0.00000000],
+		[-6.27309882, -0.00044686, 0.00027377, 0.00044911, -0.00000114, 0.00000000],
+		[-6.27309897, -0.00044679, 0.00027373, 0.00044905, -0.00000114, 0.00000000],
+		[-6.27309913, -0.00044673, 0.00027369, 0.00044898, -0.00000114, 0.00000000],
+		[-6.27309928, -0.00044666, 0.00027365, 0.00044892, -0.00000114, 0.00000000],
+		[-6.27309944, -0.00044660, 0.00027361, 0.00044885, -0.00000114, 0.00000000],
+		[-6.27309959, -0.00044653, 0.00027357, 0.00044879, -0.00000114, 0.00000000],
+		[-6.27309974, -0.00044647, 0.00027353, 0.00044873, -0.00000114, 0.00000000],
+		[-6.27309990, -0.00044641, 0.00027349, 0.00044866, -0.00000114, 0.00000000],
+		[-6.27310005, -0.00044634, 0.00027345, 0.00044860, -0.00000114, 0.00000000],
+		[-6.27310021, -0.00044628, 0.00027341, 0.00044853, -0.00000114, 0.00000000],
+		[-6.27310036, -0.00044621, 0.00027338, 0.00044847, -0.00000114, 0.00000000],
+		[-6.27310051, -0.00044615, 0.00027334, 0.00044840, -0.00000114, 0.00000000],
+		[-6.27310067, -0.00044608, 0.00027330, 0.00044834, -0.00000114, 0.00000000],
+		[-6.27310082, -0.00044602, 0.00027326, 0.00044827, -0.00000114, 0.00000000],
+		[-6.27310097, -0.00044596, 0.00027322, 0.00044821, -0.00000114, 0.00000000],
+		[-6.27310113, -0.00044589, 0.00027318, 0.00044814, -0.00000114, 0.00000000],
+		[-6.27310128, -0.00044583, 0.00027314, 0.00044808, -0.00000114, 0.00000000],
+		[-6.27310144, -0.00044576, 0.00027310, 0.00044801, -0.00000114, 0.00000000],
+		[-6.27310159, -0.00044570, 0.00027306, 0.00044795, -0.00000114, 0.00000000],
+		[-6.27310174, -0.00044563, 0.00027302, 0.00044789, -0.00000114, 0.00000000],
+		[-6.27310190, -0.00044557, 0.00027298, 0.00044782, -0.00000114, 0.00000000],
+		[-6.27310205, -0.00044551, 0.00027294, 0.00044776, -0.00000114, 0.00000000],
+		[-6.27310220, -0.00044544, 0.00027290, 0.00044769, -0.00000114, 0.00000000],
+		[-6.27310236, -0.00044538, 0.00027286, 0.00044763, -0.00000114, 0.00000000],
+		[-6.27310251, -0.00044531, 0.00027282, 0.00044756, -0.00000114, 0.00000000],
+		[-6.27310266, -0.00044525, 0.00027279, 0.00044750, -0.00000114, 0.00000000],
+		[-6.27310282, -0.00044519, 0.00027275, 0.00044743, -0.00000114, 0.00000000],
+		[-6.27310297, -0.00044512, 0.00027271, 0.00044737, -0.00000114, 0.00000000],
+		[-6.27310312, -0.00044506, 0.00027267, 0.00044731, -0.00000114, 0.00000000],
+		[-6.27310328, -0.00044499, 0.00027263, 0.00044724, -0.00000114, 0.00000000],
+		[-6.27310343, -0.00044493, 0.00027259, 0.00044718, -0.00000114, 0.00000000],
+		[-6.27310358, -0.00044487, 0.00027255, 0.00044711, -0.00000114, 0.00000000],
+		[-6.27310374, -0.00044480, 0.00027251, 0.00044705, -0.00000114, 0.00000000],
+		[-6.27310389, -0.00044474, 0.00027247, 0.00044698, -0.00000114, 0.00000000],
+		[-6.27310404, -0.00044467, 0.00027243, 0.00044692, -0.00000114, 0.00000000],
+		[-6.27310419, -0.00044461, 0.00027239, 0.00044686, -0.00000114, 0.00000000],
+		[-6.27310435, -0.00044455, 0.00027235, 0.00044679, -0.00000114, 0.00000000],
+		[-6.27310450, -0.00044448, 0.00027231, 0.00044673, -0.00000114, 0.00000000],
+		[-6.27310465, -0.00044442, 0.00027228, 0.00044666, -0.00000114, 0.00000000],
+		[-6.27310481, -0.00044436, 0.00027224, 0.00044660, -0.00000114, 0.00000000],
+		[-6.27310496, -0.00044429, 0.00027220, 0.00044654, -0.00000114, 0.00000000],
+		[-6.27310511, -0.00044423, 0.00027216, 0.00044647, -0.00000114, 0.00000000],
+		[-6.27310526, -0.00044416, 0.00027212, 0.00044641, -0.00000114, 0.00000000],
+		[-6.27310542, -0.00044410, 0.00027208, 0.00044634, -0.00000114, 0.00000000],
+		[-6.27310557, -0.00044404, 0.00027204, 0.00044628, -0.00000114, 0.00000000],
+		[-6.27310572, -0.00044397, 0.00027200, 0.00044621, -0.00000114, 0.00000000],
+		[-6.27310587, -0.00044391, 0.00027196, 0.00044615, -0.00000114, 0.00000000],
+		[-6.27310603, -0.00044385, 0.00027192, 0.00044609, -0.00000114, 0.00000000],
+		[-6.27310618, -0.00044378, 0.00027189, 0.00044602, -0.00000114, 0.00000000],
+		[-6.27310633, -0.00044372, 0.00027185, 0.00044596, -0.00000114, 0.00000000],
+		[-6.27310648, -0.00044365, 0.00027181, 0.00044590, -0.00000114, 0.00000000],
+		[-6.27310663, -0.00044359, 0.00027177, 0.00044583, -0.00000114, 0.00000000],
+		[-6.27310679, -0.00044353, 0.00027173, 0.00044577, -0.00000114, 0.00000000],
+		[-6.27310694, -0.00044346, 0.00027169, 0.00044570, -0.00000114, 0.00000000],
+		[-6.27310709, -0.00044340, 0.00027165, 0.00044564, -0.00000114, 0.00000000],
+		[-6.27310724, -0.00044334, 0.00027161, 0.00044558, -0.00000114, 0.00000000],
+		[-6.27310739, -0.00044327, 0.00027157, 0.00044551, -0.00000114, 0.00000000],
+		[-6.27310755, -0.00044321, 0.00027153, 0.00044545, -0.00000114, 0.00000000],
+		[-6.27310770, -0.00044315, 0.00027150, 0.00044538, -0.00000114, 0.00000000],
+		[-6.27310785, -0.00044308, 0.00027146, 0.00044532, -0.00000114, 0.00000000],
+		[-6.27310800, -0.00044302, 0.00027142, 0.00044526, -0.00000114, 0.00000000],
+		[-6.27310815, -0.00044296, 0.00027138, 0.00044519, -0.00000114, 0.00000000],
+		[-6.27310831, -0.00044289, 0.00027134, 0.00044513, -0.00000114, 0.00000000],
+		[-6.27310846, -0.00044283, 0.00027130, 0.00044507, -0.00000114, 0.00000000],
+		[-6.27310861, -0.00044277, 0.00027126, 0.00044500, -0.00000114, 0.00000000],
+		[-6.27310876, -0.00044270, 0.00027122, 0.00044494, -0.00000114, 0.00000000],
+		[-6.27310891, -0.00044264, 0.00027119, 0.00044487, -0.00000114, 0.00000000],
+		[-6.27310906, -0.00044258, 0.00027115, 0.00044481, -0.00000114, 0.00000000],
+		[-6.27310921, -0.00044251, 0.00027111, 0.00044475, -0.00000114, 0.00000000],
+		[-6.27310937, -0.00044245, 0.00027107, 0.00044468, -0.00000114, 0.00000000],
+		[-6.27310952, -0.00044239, 0.00027103, 0.00044462, -0.00000114, 0.00000000],
+		[-6.27310967, -0.00044232, 0.00027099, 0.00044456, -0.00000114, 0.00000000],
+		[-6.27310982, -0.00044226, 0.00027095, 0.00044449, -0.00000114, 0.00000000],
+		[-6.27310997, -0.00044220, 0.00027091, 0.00044443, -0.00000114, 0.00000000],
+		[-6.27311012, -0.00044213, 0.00027088, 0.00044437, -0.00000114, 0.00000000],
+		[-6.27311027, -0.00044207, 0.00027084, 0.00044430, -0.00000114, 0.00000000],
+		[-6.27311042, -0.00044201, 0.00027080, 0.00044424, -0.00000114, 0.00000000],
+		[-6.27311058, -0.00044194, 0.00027076, 0.00044418, -0.00000114, 0.00000000],
+		[-6.27311073, -0.00044188, 0.00027072, 0.00044411, -0.00000114, 0.00000000],
+		[-6.27311088, -0.00044182, 0.00027068, 0.00044405, -0.00000114, 0.00000000],
+		[-6.27311103, -0.00044176, 0.00027064, 0.00044399, -0.00000114, 0.00000000],
+		[-6.27311118, -0.00044169, 0.00027060, 0.00044392, -0.00000114, 0.00000000],
+		[-6.27311133, -0.00044163, 0.00027057, 0.00044386, -0.00000114, 0.00000000],
+		[-6.27311148, -0.00044157, 0.00027053, 0.00044380, -0.00000114, 0.00000000],
+		[-6.27311163, -0.00044150, 0.00027049, 0.00044373, -0.00000114, 0.00000000],
+		[-6.27311178, -0.00044144, 0.00027045, 0.00044367, -0.00000114, 0.00000000],
+		[-6.27311193, -0.00044138, 0.00027041, 0.00044361, -0.00000114, 0.00000000],
+		[-6.27311208, -0.00044131, 0.00027037, 0.00044354, -0.00000114, 0.00000000],
+		[-6.27311223, -0.00044125, 0.00027033, 0.00044348, -0.00000114, 0.00000000],
+		[-6.27311238, -0.00044119, 0.00027030, 0.00044342, -0.00000114, 0.00000000],
+		[-6.27311253, -0.00044113, 0.00027026, 0.00044335, -0.00000114, 0.00000000],
+		[-6.27311269, -0.00044106, 0.00027022, 0.00044329, -0.00000114, 0.00000000],
+		[-6.27311284, -0.00044100, 0.00027018, 0.00044323, -0.00000114, 0.00000000],
+		[-6.27311299, -0.00044094, 0.00027014, 0.00044316, -0.00000114, 0.00000000],
+		[-6.27311314, -0.00044087, 0.00027010, 0.00044310, -0.00000114, 0.00000000],
+		[-6.27311329, -0.00044081, 0.00027006, 0.00044304, -0.00000114, 0.00000000],
+		[-6.27311344, -0.00044075, 0.00027003, 0.00044297, -0.00000114, 0.00000000],
+		[-6.27311359, -0.00044069, 0.00026999, 0.00044291, -0.00000114, 0.00000000],
+		[-6.27311374, -0.00044062, 0.00026995, 0.00044285, -0.00000114, 0.00000000],
+		[-6.27311389, -0.00044056, 0.00026991, 0.00044279, -0.00000114, 0.00000000],
+		[-6.27311404, -0.00044050, 0.00026987, 0.00044272, -0.00000114, 0.00000000],
+		[-6.27311419, -0.00044044, 0.00026983, 0.00044266, -0.00000114, 0.00000000],
+		[-6.27311434, -0.00044037, 0.00026980, 0.00044260, -0.00000114, 0.00000000],
+		[-6.27311449, -0.00044031, 0.00026976, 0.00044253, -0.00000114, 0.00000000],
+		[-6.27311464, -0.00044025, 0.00026972, 0.00044247, -0.00000114, 0.00000000],
+		[-6.27311479, -0.00044018, 0.00026968, 0.00044241, -0.00000114, 0.00000000],
+		[-6.27311494, -0.00044012, 0.00026964, 0.00044234, -0.00000114, 0.00000000],
+		[-6.27311509, -0.00044006, 0.00026960, 0.00044228, -0.00000114, 0.00000000],
+		[-6.27311524, -0.00044000, 0.00026957, 0.00044222, -0.00000114, 0.00000000],
+		[-6.27311539, -0.00043993, 0.00026953, 0.00044216, -0.00000114, 0.00000000],
+		[-6.27311554, -0.00043987, 0.00026949, 0.00044209, -0.00000114, 0.00000000],
+		[-6.27311569, -0.00043981, 0.00026945, 0.00044203, -0.00000114, 0.00000000],
+		[-6.27311583, -0.00043975, 0.00026941, 0.00044197, -0.00000114, 0.00000000],
+		[-6.27311598, -0.00043968, 0.00026937, 0.00044190, -0.00000114, 0.00000000],
+		[-6.27311613, -0.00043962, 0.00026934, 0.00044184, -0.00000114, 0.00000000],
+		[-6.27311628, -0.00043956, 0.00026930, 0.00044178, -0.00000114, 0.00000000],
+		[-6.27311643, -0.00043950, 0.00026926, 0.00044172, -0.00000114, 0.00000000],
+		[-6.27311658, -0.00043944, 0.00026922, 0.00044165, -0.00000114, 0.00000000],
+		[-6.27311673, -0.00043937, 0.00026918, 0.00044159, -0.00000114, 0.00000000],
+		[-6.27311688, -0.00043931, 0.00026914, 0.00044153, -0.00000114, 0.00000000],
+		[-6.27311703, -0.00043925, 0.00026911, 0.00044147, -0.00000114, 0.00000000],
+		[-6.27311718, -0.00043919, 0.00026907, 0.00044140, -0.00000114, 0.00000000],
+		[-6.27311733, -0.00043912, 0.00026903, 0.00044134, -0.00000114, 0.00000000],
+		[-6.27311748, -0.00043906, 0.00026899, 0.00044128, -0.00000114, 0.00000000],
+		[-6.27311763, -0.00043900, 0.00026895, 0.00044122, -0.00000114, 0.00000000],
+		[-6.27311777, -0.00043894, 0.00026892, 0.00044115, -0.00000114, 0.00000000],
+		[-6.27311792, -0.00043887, 0.00026888, 0.00044109, -0.00000114, 0.00000000],
+		[-6.27311807, -0.00043881, 0.00026884, 0.00044103, -0.00000114, 0.00000000],
+		[-6.27311822, -0.00043875, 0.00026880, 0.00044096, -0.00000114, 0.00000000],
+		[-6.27311837, -0.00043869, 0.00026876, 0.00044090, -0.00000114, 0.00000000],
+		[-6.27311852, -0.00043863, 0.00026872, 0.00044084, -0.00000114, 0.00000000],
+		[-6.27311867, -0.00043856, 0.00026869, 0.00044078, -0.00000114, 0.00000000],
+		[-6.27311882, -0.00043850, 0.00026865, 0.00044072, -0.00000114, 0.00000000],
+		[-6.27311897, -0.00043844, 0.00026861, 0.00044065, -0.00000114, 0.00000000],
+		[-6.27311911, -0.00043838, 0.00026857, 0.00044059, -0.00000114, 0.00000000],
+		[-6.27311926, -0.00043832, 0.00026853, 0.00044053, -0.00000114, 0.00000000],
+		[-6.27311941, -0.00043825, 0.00026850, 0.00044047, -0.00000114, 0.00000000],
+		[-6.27311956, -0.00043819, 0.00026846, 0.00044040, -0.00000114, 0.00000000],
+		[-6.27311971, -0.00043813, 0.00026842, 0.00044034, -0.00000114, 0.00000000],
+		[-6.27311986, -0.00043807, 0.00026838, 0.00044028, -0.00000114, 0.00000000],
+		[-6.27312000, -0.00043800, 0.00026834, 0.00044022, -0.00000114, 0.00000000],
+		[-6.27312015, -0.00043794, 0.00026831, 0.00044015, -0.00000114, 0.00000000],
+		[-6.27312030, -0.00043788, 0.00026827, 0.00044009, -0.00000114, 0.00000000],
+		[-6.27312045, -0.00043782, 0.00026823, 0.00044003, -0.00000114, 0.00000000],
+		[-6.27312060, -0.00043776, 0.00026819, 0.00043997, -0.00000114, 0.00000000],
+		[-6.27312075, -0.00043770, 0.00026815, 0.00043990, -0.00000114, 0.00000000],
+		[-6.27312089, -0.00043763, 0.00026812, 0.00043984, -0.00000114, 0.00000000],
+		[-6.27312104, -0.00043757, 0.00026808, 0.00043978, -0.00000114, 0.00000000],
+		[-6.27312119, -0.00043751, 0.00026804, 0.00043972, -0.00000114, 0.00000000],
+		[-6.27312134, -0.00043745, 0.00026800, 0.00043966, -0.00000114, 0.00000000],
+		[-6.27312149, -0.00043739, 0.00026796, 0.00043959, -0.00000114, 0.00000000],
+		[-6.27312163, -0.00043732, 0.00026793, 0.00043953, -0.00000114, 0.00000000],
+		[-6.27312178, -0.00043726, 0.00026789, 0.00043947, -0.00000114, 0.00000000],
+		[-6.27312193, -0.00043720, 0.00026785, 0.00043941, -0.00000114, 0.00000000],
+		[-6.27312208, -0.00043714, 0.00026781, 0.00043935, -0.00000114, 0.00000000],
+		[-6.27312223, -0.00043708, 0.00026778, 0.00043928, -0.00000114, 0.00000000],
+		[-6.27312237, -0.00043702, 0.00026774, 0.00043922, -0.00000114, 0.00000000],
+		[-6.27312252, -0.00043695, 0.00026770, 0.00043916, -0.00000114, 0.00000000],
+		[-6.27312267, -0.00043689, 0.00026766, 0.00043910, -0.00000114, 0.00000000],
+		[-6.27312282, -0.00043683, 0.00026762, 0.00043904, -0.00000114, 0.00000000],
+		[-6.27312296, -0.00043677, 0.00026759, 0.00043897, -0.00000114, 0.00000000],
+		[-6.27312311, -0.00043671, 0.00026755, 0.00043891, -0.00000114, 0.00000000],
+		[-6.27312326, -0.00043665, 0.00026751, 0.00043885, -0.00000114, 0.00000000],
+		[-6.27312341, -0.00043658, 0.00026747, 0.00043879, -0.00000114, 0.00000000],
+		[-6.27312355, -0.00043652, 0.00026744, 0.00043873, -0.00000114, 0.00000000],
+		[-6.27312370, -0.00043646, 0.00026740, 0.00043866, -0.00000114, 0.00000000],
+		[-6.27312385, -0.00043640, 0.00026736, 0.00043860, -0.00000114, 0.00000000],
+		[-6.27312399, -0.00043634, 0.00026732, 0.00043854, -0.00000114, 0.00000000],
+		[-6.27312414, -0.00043628, 0.00026728, 0.00043848, -0.00000114, 0.00000000],
+		[-6.27312429, -0.00043622, 0.00026725, 0.00043842, -0.00000114, 0.00000000],
+		[-6.27312444, -0.00043615, 0.00026721, 0.00043836, -0.00000114, 0.00000000],
+		[-6.27312458, -0.00043609, 0.00026717, 0.00043829, -0.00000114, 0.00000000],
+		[-6.27312473, -0.00043603, 0.00026713, 0.00043823, -0.00000114, 0.00000000],
+		[-6.27312488, -0.00043597, 0.00026710, 0.00043817, -0.00000114, 0.00000000],
+		[-6.27312502, -0.00043591, 0.00026706, 0.00043811, -0.00000114, 0.00000000],
+		[-6.27312517, -0.00043585, 0.00026702, 0.00043805, -0.00000114, 0.00000000],
+		[-6.27312532, -0.00043579, 0.00026698, 0.00043798, -0.00000114, 0.00000000],
+		[-6.27312546, -0.00043572, 0.00026695, 0.00043792, -0.00000114, 0.00000000],
+		[-6.27312561, -0.00043566, 0.00026691, 0.00043786, -0.00000114, 0.00000000],
+		[-6.27312576, -0.00043560, 0.00026687, 0.00043780, -0.00000114, 0.00000000],
+		[-6.27312590, -0.00043554, 0.00026683, 0.00043774, -0.00000114, 0.00000000],
+		[-6.27312605, -0.00043548, 0.00026680, 0.00043768, -0.00000114, 0.00000000],
+		[-6.27312620, -0.00043542, 0.00026676, 0.00043762, -0.00000114, 0.00000000],
+		[-6.27312634, -0.00043536, 0.00026672, 0.00043755, -0.00000114, 0.00000000],
+		[-6.27312649, -0.00043529, 0.00026668, 0.00043749, -0.00000114, 0.00000000],
+		[-6.27312664, -0.00043523, 0.00026665, 0.00043743, -0.00000114, 0.00000000],
+		[-6.27312678, -0.00043517, 0.00026661, 0.00043737, -0.00000114, 0.00000000],
+		[-6.27312693, -0.00043511, 0.00026657, 0.00043731, -0.00000114, 0.00000000],
+		[-6.27312708, -0.00043505, 0.00026653, 0.00043725, -0.00000114, 0.00000000],
+		[-6.27312722, -0.00043499, 0.00026650, 0.00043718, -0.00000114, 0.00000000],
+		[-6.27312737, -0.00043493, 0.00026646, 0.00043712, -0.00000114, 0.00000000],
+		[-6.27312752, -0.00043487, 0.00026642, 0.00043706, -0.00000114, 0.00000000],
+		[-6.27312766, -0.00043481, 0.00026638, 0.00043700, -0.00000114, 0.00000000],
+		[-6.27312781, -0.00043474, 0.00026635, 0.00043694, -0.00000114, 0.00000000],
+		[-6.27312795, -0.00043468, 0.00026631, 0.00043688, -0.00000114, 0.00000000],
+		[-6.27312810, -0.00043462, 0.00026627, 0.00043682, -0.00000114, 0.00000000],
+		[-6.27312825, -0.00043456, 0.00026623, 0.00043676, -0.00000114, 0.00000000],
+		[-6.27312839, -0.00043450, 0.00026620, 0.00043669, -0.00000114, 0.00000000],
+		[-6.27312854, -0.00043444, 0.00026616, 0.00043663, -0.00000114, 0.00000000],
+		[-6.27312868, -0.00043438, 0.00026612, 0.00043657, -0.00000114, 0.00000000],
+		[-6.27312883, -0.00043432, 0.00026608, 0.00043651, -0.00000114, 0.00000000],
+		[-6.27312898, -0.00043426, 0.00026605, 0.00043645, -0.00000114, 0.00000000],
+		[-6.27312912, -0.00043420, 0.00026601, 0.00043639, -0.00000114, 0.00000000],
+		[-6.27312927, -0.00043413, 0.00026597, 0.00043633, -0.00000114, 0.00000000],
+		[-6.27312941, -0.00043407, 0.00026593, 0.00043626, -0.00000114, 0.00000000],
+		[-6.27312956, -0.00043401, 0.00026590, 0.00043620, -0.00000114, 0.00000000],
+		[-6.27312970, -0.00043395, 0.00026586, 0.00043614, -0.00000114, 0.00000000],
+		[-6.27312985, -0.00043389, 0.00026582, 0.00043608, -0.00000114, 0.00000000],
+		[-6.27313000, -0.00043383, 0.00026579, 0.00043602, -0.00000114, 0.00000000],
+		[-6.27313014, -0.00043377, 0.00026575, 0.00043596, -0.00000114, 0.00000000],
+		[-6.27313029, -0.00043371, 0.00026571, 0.00043590, -0.00000114, 0.00000000],
+		[-6.27313043, -0.00043365, 0.00026567, 0.00043584, -0.00000114, 0.00000000],
+		[-6.27313058, -0.00043359, 0.00026564, 0.00043578, -0.00000114, 0.00000000],
+		[-6.27313072, -0.00043353, 0.00026560, 0.00043572, -0.00000114, 0.00000000],
+		[-6.27313087, -0.00043347, 0.00026556, 0.00043565, -0.00000114, 0.00000000],
+		[-6.27313101, -0.00043341, 0.00026552, 0.00043559, -0.00000114, 0.00000000],
+		[-6.27313116, -0.00043335, 0.00026549, 0.00043553, -0.00000114, 0.00000000],
+		[-6.27313130, -0.00043328, 0.00026545, 0.00043547, -0.00000114, 0.00000000],
+		[-6.27313145, -0.00043322, 0.00026541, 0.00043541, -0.00000114, 0.00000000],
+		[-6.27313159, -0.00043316, 0.00026538, 0.00043535, -0.00000114, 0.00000000],
+		[-6.27313174, -0.00043310, 0.00026534, 0.00043529, -0.00000114, 0.00000000],
+		[-6.27313188, -0.00043304, 0.00026530, 0.00043523, -0.00000114, 0.00000000],
+		[-6.27313203, -0.00043298, 0.00026526, 0.00043517, -0.00000114, 0.00000000],
+		[-6.27313217, -0.00043292, 0.00026523, 0.00043511, -0.00000114, 0.00000000],
+		[-6.27313232, -0.00043286, 0.00026519, 0.00043504, -0.00000114, 0.00000000],
+		[-6.27313246, -0.00043280, 0.00026515, 0.00043498, -0.00000114, 0.00000000],
+		[-6.27313261, -0.00043274, 0.00026512, 0.00043492, -0.00000114, 0.00000000],
+		[-6.27313275, -0.00043268, 0.00026508, 0.00043486, -0.00000114, 0.00000000],
+		[-6.27313290, -0.00043262, 0.00026504, 0.00043480, -0.00000114, 0.00000000],
+		[-6.27313304, -0.00043256, 0.00026501, 0.00043474, -0.00000114, 0.00000000],
+		[-6.27313319, -0.00043250, 0.00026497, 0.00043468, -0.00000114, 0.00000000],
+		[-6.27313333, -0.00043244, 0.00026493, 0.00043462, -0.00000114, 0.00000000],
+		[-6.27313348, -0.00043238, 0.00026489, 0.00043456, -0.00000114, 0.00000000],
+		[-6.27313362, -0.00043232, 0.00026486, 0.00043450, -0.00000114, 0.00000000],
+		[-6.27313377, -0.00043226, 0.00026482, 0.00043444, -0.00000114, 0.00000000],
+		[-6.27313391, -0.00043220, 0.00026478, 0.00043438, -0.00000114, 0.00000000],
+		[-6.27313405, -0.00043214, 0.00026475, 0.00043432, -0.00000114, 0.00000000],
+		[-6.27313420, -0.00043207, 0.00026471, 0.00043426, -0.00000114, 0.00000000],
+		[-6.27313434, -0.00043201, 0.00026467, 0.00043419, -0.00000114, 0.00000000],
+		[-6.27313449, -0.00043195, 0.00026464, 0.00043413, -0.00000114, 0.00000000],
+		[-6.27313463, -0.00043189, 0.00026460, 0.00043407, -0.00000114, 0.00000000],
+		[-6.27313478, -0.00043183, 0.00026456, 0.00043401, -0.00000114, 0.00000000],
+		[-6.27313492, -0.00043177, 0.00026452, 0.00043395, -0.00000114, 0.00000000],
+		[-6.27313506, -0.00043171, 0.00026449, 0.00043389, -0.00000114, 0.00000000],
+		[-6.27313521, -0.00043165, 0.00026445, 0.00043383, -0.00000114, 0.00000000],
+		[-6.27313535, -0.00043159, 0.00026441, 0.00043377, -0.00000114, 0.00000000],
+		[-6.27313550, -0.00043153, 0.00026438, 0.00043371, -0.00000114, 0.00000000],
+		[-6.27313564, -0.00043147, 0.00026434, 0.00043365, -0.00000114, 0.00000000],
+		[-6.27313578, -0.00043141, 0.00026430, 0.00043359, -0.00000114, 0.00000000],
+		[-6.27313593, -0.00043135, 0.00026427, 0.00043353, -0.00000114, 0.00000000],
+		[-6.27313607, -0.00043129, 0.00026423, 0.00043347, -0.00000114, 0.00000000],
+		[-6.27313622, -0.00043123, 0.00026419, 0.00043341, -0.00000114, 0.00000000],
+		[-6.27313636, -0.00043117, 0.00026416, 0.00043335, -0.00000114, 0.00000000],
+		[-6.27313650, -0.00043111, 0.00026412, 0.00043329, -0.00000114, 0.00000000],
+		[-6.27313665, -0.00043105, 0.00026408, 0.00043323, -0.00000114, 0.00000000],
+		[-6.27313679, -0.00043099, 0.00026405, 0.00043317, -0.00000114, 0.00000000],
+		[-6.27313693, -0.00043093, 0.00026401, 0.00043311, -0.00000114, 0.00000000],
+		[-6.27313708, -0.00043087, 0.00026397, 0.00043305, -0.00000114, 0.00000000],
+		[-6.27313722, -0.00043081, 0.00026394, 0.00043299, -0.00000114, 0.00000000],
+		[-6.27313737, -0.00043075, 0.00026390, 0.00043293, -0.00000114, 0.00000000],
+		[-6.27313751, -0.00043069, 0.00026386, 0.00043287, -0.00000114, 0.00000000],
+		[-6.27313765, -0.00043063, 0.00026382, 0.00043281, -0.00000114, 0.00000000],
+		[-6.27313780, -0.00043057, 0.00026379, 0.00043275, -0.00000114, 0.00000000],
+		[-6.27313794, -0.00043051, 0.00026375, 0.00043268, -0.00000114, 0.00000000],
+		[-6.27313808, -0.00043045, 0.00026371, 0.00043262, -0.00000114, 0.00000000],
+		[-6.27313823, -0.00043039, 0.00026368, 0.00043256, -0.00000114, 0.00000000],
+		[-6.27313837, -0.00043033, 0.00026364, 0.00043250, -0.00000114, 0.00000000],
+		[-6.27313851, -0.00043027, 0.00026360, 0.00043244, -0.00000114, 0.00000000],
+		[-6.27313865, -0.00043021, 0.00026357, 0.00043238, -0.00000114, 0.00000000],
+		[-6.27313880, -0.00043015, 0.00026353, 0.00043232, -0.00000114, 0.00000000],
+		[-6.27313894, -0.00043009, 0.00026349, 0.00043226, -0.00000114, 0.00000000],
+		[-6.27313908, -0.00043003, 0.00026346, 0.00043220, -0.00000114, 0.00000000],
+		[-6.27313923, -0.00042997, 0.00026342, 0.00043214, -0.00000114, 0.00000000],
+		[-6.27313937, -0.00042991, 0.00026338, 0.00043208, -0.00000114, 0.00000000],
+		[-6.27313951, -0.00042985, 0.00026335, 0.00043202, -0.00000114, 0.00000000],
+		[-6.27313966, -0.00042980, 0.00026331, 0.00043196, -0.00000114, 0.00000000],
+		[-6.27313980, -0.00042974, 0.00026328, 0.00043190, -0.00000114, 0.00000000],
+		[-6.27313994, -0.00042968, 0.00026324, 0.00043184, -0.00000114, 0.00000000],
+		[-6.27314008, -0.00042962, 0.00026320, 0.00043178, -0.00000114, 0.00000000],
+		[-6.27314023, -0.00042956, 0.00026317, 0.00043172, -0.00000114, 0.00000000],
+		[-6.27314037, -0.00042950, 0.00026313, 0.00043166, -0.00000114, 0.00000000],
+		[-6.27314051, -0.00042944, 0.00026309, 0.00043160, -0.00000114, 0.00000000],
+		[-6.27314065, -0.00042938, 0.00026306, 0.00043154, -0.00000114, 0.00000000],
+		[-6.27314080, -0.00042932, 0.00026302, 0.00043148, -0.00000114, 0.00000000],
+		[-6.27314094, -0.00042926, 0.00026298, 0.00043142, -0.00000114, 0.00000000],
+		[-6.27314108, -0.00042920, 0.00026295, 0.00043136, -0.00000114, 0.00000000],
+		[-6.27314122, -0.00042914, 0.00026291, 0.00043131, -0.00000114, 0.00000000],
+		[-6.27314137, -0.00042908, 0.00026287, 0.00043125, -0.00000114, 0.00000000],
+		[-6.27314151, -0.00042902, 0.00026284, 0.00043119, -0.00000114, 0.00000000],
+		[-6.27314165, -0.00042896, 0.00026280, 0.00043113, -0.00000114, 0.00000000],
+		[-6.27314179, -0.00042890, 0.00026276, 0.00043107, -0.00000114, 0.00000000],
+		[-6.27314194, -0.00042884, 0.00026273, 0.00043101, -0.00000114, 0.00000000],
+		[-6.27314208, -0.00042878, 0.00026269, 0.00043095, -0.00000114, 0.00000000],
+		[-6.27314222, -0.00042872, 0.00026265, 0.00043089, -0.00000114, 0.00000000],
+		[-6.27314236, -0.00042866, 0.00026262, 0.00043083, -0.00000114, 0.00000000],
+		[-6.27314250, -0.00042861, 0.00026258, 0.00043077, -0.00000114, 0.00000000],
+		[-6.27314265, -0.00042855, 0.00026255, 0.00043071, -0.00000114, 0.00000000],
+		[-6.27314279, -0.00042849, 0.00026251, 0.00043065, -0.00000114, 0.00000000],
+		[-6.27314293, -0.00042843, 0.00026247, 0.00043059, -0.00000114, 0.00000000],
+		[-6.27314307, -0.00042837, 0.00026244, 0.00043053, -0.00000114, 0.00000000],
+		[-6.27314321, -0.00042831, 0.00026240, 0.00043047, -0.00000114, 0.00000000],
+		[-6.27314336, -0.00042825, 0.00026236, 0.00043041, -0.00000114, 0.00000000],
+		[-6.27314350, -0.00042819, 0.00026233, 0.00043035, -0.00000114, 0.00000000],
+		[-6.27314364, -0.00042813, 0.00026229, 0.00043029, -0.00000114, 0.00000000],
+		[-6.27314378, -0.00042807, 0.00026226, 0.00043023, -0.00000114, 0.00000000],
+		[-6.27314392, -0.00042801, 0.00026222, 0.00043017, -0.00000114, 0.00000000],
+		[-6.27314406, -0.00042795, 0.00026218, 0.00043011, -0.00000114, 0.00000000],
+		[-6.27314421, -0.00042789, 0.00026215, 0.00043005, -0.00000114, 0.00000000],
+		[-6.27314435, -0.00042783, 0.00026211, 0.00042999, -0.00000114, 0.00000000],
+		[-6.27314449, -0.00042778, 0.00026207, 0.00042993, -0.00000114, 0.00000000],
+		[-6.27314463, -0.00042772, 0.00026204, 0.00042987, -0.00000114, 0.00000000],
+		[-6.27314477, -0.00042766, 0.00026200, 0.00042982, -0.00000114, 0.00000000],
+		[-6.27314491, -0.00042760, 0.00026197, 0.00042976, -0.00000114, 0.00000000],
+		[-6.27314505, -0.00042754, 0.00026193, 0.00042970, -0.00000114, 0.00000000],
+		[-6.27314520, -0.00042748, 0.00026189, 0.00042964, -0.00000114, 0.00000000],
+		[-6.27314534, -0.00042742, 0.00026186, 0.00042958, -0.00000114, 0.00000000],
+		[-6.27314548, -0.00042736, 0.00026182, 0.00042952, -0.00000114, 0.00000000],
+		[-6.27314562, -0.00042730, 0.00026178, 0.00042946, -0.00000114, 0.00000000],
+		[-6.27314576, -0.00042724, 0.00026175, 0.00042940, -0.00000114, 0.00000000],
+		[-6.27314590, -0.00042719, 0.00026171, 0.00042934, -0.00000114, 0.00000000],
+		[-6.27314604, -0.00042713, 0.00026168, 0.00042928, -0.00000114, 0.00000000],
+		[-6.27314618, -0.00042707, 0.00026164, 0.00042922, -0.00000114, 0.00000000],
+		[-6.27314633, -0.00042701, 0.00026160, 0.00042916, -0.00000114, 0.00000000],
+		[-6.27314647, -0.00042695, 0.00026157, 0.00042910, -0.00000114, 0.00000000],
+		[-6.27314661, -0.00042689, 0.00026153, 0.00042904, -0.00000114, 0.00000000],
+		[-6.27314675, -0.00042683, 0.00026150, 0.00042899, -0.00000114, 0.00000000],
+		[-6.27314689, -0.00042677, 0.00026146, 0.00042893, -0.00000114, 0.00000000],
+		[-6.27314703, -0.00042671, 0.00026142, 0.00042887, -0.00000114, 0.00000000],
+		[-6.27314717, -0.00042666, 0.00026139, 0.00042881, -0.00000114, 0.00000000],
+		[-6.27314731, -0.00042660, 0.00026135, 0.00042875, -0.00000114, 0.00000000],
+		[-6.27314745, -0.00042654, 0.00026132, 0.00042869, -0.00000114, 0.00000000],
+		[-6.27314759, -0.00042648, 0.00026128, 0.00042863, -0.00000114, 0.00000000],
+		[-6.27314773, -0.00042642, 0.00026124, 0.00042857, -0.00000114, 0.00000000],
+		[-6.27314787, -0.00042636, 0.00026121, 0.00042851, -0.00000114, 0.00000000],
+		[-6.27314801, -0.00042630, 0.00026117, 0.00042845, -0.00000114, 0.00000000],
+		[-6.27314815, -0.00042624, 0.00026114, 0.00042839, -0.00000114, 0.00000000],
+		[-6.27314830, -0.00042619, 0.00026110, 0.00042834, -0.00000114, 0.00000000],
+		[-6.27314844, -0.00042613, 0.00026106, 0.00042828, -0.00000114, 0.00000000],
+		[-6.27314858, -0.00042607, 0.00026103, 0.00042822, -0.00000114, 0.00000000],
+		[-6.27314872, -0.00042601, 0.00026099, 0.00042816, -0.00000114, 0.00000000],
+		[-6.27314886, -0.00042595, 0.00026096, 0.00042810, -0.00000114, 0.00000000],
+		[-6.27314900, -0.00042589, 0.00026092, 0.00042804, -0.00000114, 0.00000000],
+		[-6.27314914, -0.00042583, 0.00026088, 0.00042798, -0.00000114, 0.00000000],
+		[-6.27314928, -0.00042578, 0.00026085, 0.00042792, -0.00000114, 0.00000000],
+		[-6.27314942, -0.00042572, 0.00026081, 0.00042786, -0.00000114, 0.00000000],
+		[-6.27314956, -0.00042566, 0.00026078, 0.00042781, -0.00000114, 0.00000000],
+		[-6.27314970, -0.00042560, 0.00026074, 0.00042775, -0.00000114, 0.00000000],
+		[-6.27314984, -0.00042554, 0.00026070, 0.00042769, -0.00000114, 0.00000000],
+		[-6.27314998, -0.00042548, 0.00026067, 0.00042763, -0.00000114, 0.00000000],
+		[-6.27315012, -0.00042542, 0.00026063, 0.00042757, -0.00000114, 0.00000000],
+		[-6.27315026, -0.00042537, 0.00026060, 0.00042751, -0.00000114, 0.00000000],
+		[-6.27315040, -0.00042531, 0.00026056, 0.00042745, -0.00000114, 0.00000000],
+		[-6.27315054, -0.00042525, 0.00026052, 0.00042739, -0.00000114, 0.00000000],
+		[-6.27315068, -0.00042519, 0.00026049, 0.00042734, -0.00000114, 0.00000000],
+		[-6.27315082, -0.00042513, 0.00026045, 0.00042728, -0.00000114, 0.00000000],
+		[-6.27315096, -0.00042507, 0.00026042, 0.00042722, -0.00000114, 0.00000000],
+		[-6.27315110, -0.00042502, 0.00026038, 0.00042716, -0.00000114, 0.00000000],
+		[-6.27315124, -0.00042496, 0.00026035, 0.00042710, -0.00000114, 0.00000000],
+		[-6.27315138, -0.00042490, 0.00026031, 0.00042704, -0.00000114, 0.00000000],
+		[-6.27315152, -0.00042484, 0.00026027, 0.00042698, -0.00000114, 0.00000000],
+		[-6.27315165, -0.00042478, 0.00026024, 0.00042692, -0.00000114, 0.00000000],
+		[-6.27315179, -0.00042472, 0.00026020, 0.00042687, -0.00000114, 0.00000000],
+		[-6.27315193, -0.00042467, 0.00026017, 0.00042681, -0.00000114, 0.00000000],
+		[-6.27315207, -0.00042461, 0.00026013, 0.00042675, -0.00000114, 0.00000000],
+		[-6.27315221, -0.00042455, 0.00026010, 0.00042669, -0.00000114, 0.00000000],
+		[-6.27315235, -0.00042449, 0.00026006, 0.00042663, -0.00000114, 0.00000000],
+		[-6.27315249, -0.00042443, 0.00026002, 0.00042657, -0.00000114, 0.00000000],
+		[-6.27315263, -0.00042437, 0.00025999, 0.00042652, -0.00000114, 0.00000000],
+		[-6.27315277, -0.00042432, 0.00025995, 0.00042646, -0.00000114, 0.00000000],
+		[-6.27315291, -0.00042426, 0.00025992, 0.00042640, -0.00000114, 0.00000000],
+		[-6.27315305, -0.00042420, 0.00025988, 0.00042634, -0.00000114, 0.00000000],
+		[-6.27315319, -0.00042414, 0.00025985, 0.00042628, -0.00000114, 0.00000000],
+		[-6.27315333, -0.00042408, 0.00025981, 0.00042622, -0.00000114, 0.00000000],
+		[-6.27315347, -0.00042403, 0.00025978, 0.00042616, -0.00000114, 0.00000000],
+		[-6.27315360, -0.00042397, 0.00025974, 0.00042611, -0.00000114, 0.00000000],
+		[-6.27315374, -0.00042391, 0.00025970, 0.00042605, -0.00000114, 0.00000000],
+		[-6.27315388, -0.00042385, 0.00025967, 0.00042599, -0.00000114, 0.00000000],
+		[-6.27315402, -0.00042379, 0.00025963, 0.00042593, -0.00000114, 0.00000000],
+		[-6.27315416, -0.00042374, 0.00025960, 0.00042587, -0.00000114, 0.00000000],
+		[-6.27315430, -0.00042368, 0.00025956, 0.00042581, -0.00000114, 0.00000000],
+		[-6.27315444, -0.00042362, 0.00025953, 0.00042576, -0.00000114, 0.00000000],
+		[-6.27315458, -0.00042356, 0.00025949, 0.00042570, -0.00000114, 0.00000000],
+		[-6.27315472, -0.00042350, 0.00025946, 0.00042564, -0.00000114, 0.00000000],
+		[-6.27315485, -0.00042345, 0.00025942, 0.00042558, -0.00000114, 0.00000000],
+		[-6.27315499, -0.00042339, 0.00025938, 0.00042552, -0.00000114, 0.00000000],
+		[-6.27315513, -0.00042333, 0.00025935, 0.00042547, -0.00000114, 0.00000000],
+		[-6.27315527, -0.00042327, 0.00025931, 0.00042541, -0.00000114, 0.00000000],
+		[-6.27315541, -0.00042321, 0.00025928, 0.00042535, -0.00000114, 0.00000000],
+		[-6.27315555, -0.00042316, 0.00025924, 0.00042529, -0.00000114, 0.00000000],
+		[-6.27315569, -0.00042310, 0.00025921, 0.00042523, -0.00000114, 0.00000000],
+		[-6.27315582, -0.00042304, 0.00025917, 0.00042517, -0.00000114, 0.00000000],
+		[-6.27315596, -0.00042298, 0.00025914, 0.00042512, -0.00000114, 0.00000000],
+		[-6.27315610, -0.00042292, 0.00025910, 0.00042506, -0.00000114, 0.00000000],
+		[-6.27315624, -0.00042287, 0.00025907, 0.00042500, -0.00000114, 0.00000000],
+		[-6.27315638, -0.00042281, 0.00025903, 0.00042494, -0.00000114, 0.00000000],
+		[-6.27315652, -0.00042275, 0.00025899, 0.00042488, -0.00000114, 0.00000000],
+		[-6.27315665, -0.00042269, 0.00025896, 0.00042483, -0.00000114, 0.00000000],
+		[-6.27315679, -0.00042264, 0.00025892, 0.00042477, -0.00000114, 0.00000000],
+		[-6.27315693, -0.00042258, 0.00025889, 0.00042471, -0.00000114, 0.00000000],
+		[-6.27315707, -0.00042252, 0.00025885, 0.00042465, -0.00000114, 0.00000000],
+		[-6.27315721, -0.00042246, 0.00025882, 0.00042459, -0.00000114, 0.00000000],
+		[-6.27315734, -0.00042241, 0.00025878, 0.00042454, -0.00000114, 0.00000000],
+		[-6.27315748, -0.00042235, 0.00025875, 0.00042448, -0.00000114, 0.00000000],
+		[-6.27315762, -0.00042229, 0.00025871, 0.00042442, -0.00000114, 0.00000000],
+		[-6.27315776, -0.00042223, 0.00025868, 0.00042436, -0.00000114, 0.00000000],
+		[-6.27315790, -0.00042218, 0.00025864, 0.00042430, -0.00000114, 0.00000000],
+		[-6.27315803, -0.00042212, 0.00025861, 0.00042425, -0.00000114, 0.00000000],
+		[-6.27315817, -0.00042206, 0.00025857, 0.00042419, -0.00000114, 0.00000000],
+		[-6.27315831, -0.00042200, 0.00025854, 0.00042413, -0.00000114, 0.00000000],
+		[-6.27315845, -0.00042194, 0.00025850, 0.00042407, -0.00000114, 0.00000000],
+		[-6.27315858, -0.00042189, 0.00025846, 0.00042402, -0.00000114, 0.00000000],
+		[-6.27315872, -0.00042183, 0.00025843, 0.00042396, -0.00000114, 0.00000000],
+		[-6.27315886, -0.00042177, 0.00025839, 0.00042390, -0.00000114, 0.00000000],
+		[-6.27315900, -0.00042171, 0.00025836, 0.00042384, -0.00000114, 0.00000000],
+		[-6.27315913, -0.00042166, 0.00025832, 0.00042378, -0.00000114, 0.00000000],
+		[-6.27315927, -0.00042160, 0.00025829, 0.00042373, -0.00000114, 0.00000000],
+		[-6.27315941, -0.00042154, 0.00025825, 0.00042367, -0.00000114, 0.00000000],
+		[-6.27315955, -0.00042149, 0.00025822, 0.00042361, -0.00000114, 0.00000000],
+		[-6.27315968, -0.00042143, 0.00025818, 0.00042355, -0.00000114, 0.00000000],
+		[-6.27315982, -0.00042137, 0.00025815, 0.00042350, -0.00000114, 0.00000000],
+		[-6.27315996, -0.00042131, 0.00025811, 0.00042344, -0.00000114, 0.00000000],
+		[-6.27316010, -0.00042126, 0.00025808, 0.00042338, -0.00000114, 0.00000000],
+		[-6.27316023, -0.00042120, 0.00025804, 0.00042332, -0.00000114, 0.00000000],
+		[-6.27316037, -0.00042114, 0.00025801, 0.00042327, -0.00000114, 0.00000000],
+		[-6.27316051, -0.00042108, 0.00025797, 0.00042321, -0.00000114, 0.00000000],
+		[-6.27316064, -0.00042103, 0.00025794, 0.00042315, -0.00000114, 0.00000000],
+		[-6.27316078, -0.00042097, 0.00025790, 0.00042309, -0.00000114, 0.00000000],
+		[-6.27316092, -0.00042091, 0.00025787, 0.00042304, -0.00000114, 0.00000000],
+		[-6.27316105, -0.00042085, 0.00025783, 0.00042298, -0.00000114, 0.00000000],
+		[-6.27316119, -0.00042080, 0.00025780, 0.00042292, -0.00000114, 0.00000000],
+		[-6.27316133, -0.00042074, 0.00025776, 0.00042286, -0.00000114, 0.00000000],
+		[-6.27316147, -0.00042068, 0.00025773, 0.00042281, -0.00000114, 0.00000000],
+		[-6.27316160, -0.00042063, 0.00025769, 0.00042275, -0.00000114, 0.00000000],
+		[-6.27316174, -0.00042057, 0.00025766, 0.00042269, -0.00000114, 0.00000000],
+		[-6.27316188, -0.00042051, 0.00025762, 0.00042263, -0.00000114, 0.00000000],
+		[-6.27316201, -0.00042045, 0.00025759, 0.00042258, -0.00000114, 0.00000000],
+		[-6.27316215, -0.00042040, 0.00025755, 0.00042252, -0.00000114, 0.00000000],
+		[-6.27316229, -0.00042034, 0.00025752, 0.00042246, -0.00000114, 0.00000000],
+		[-6.27316242, -0.00042028, 0.00025748, 0.00042240, -0.00000114, 0.00000000],
+		[-6.27316256, -0.00042023, 0.00025745, 0.00042235, -0.00000114, 0.00000000],
+		[-6.27316270, -0.00042017, 0.00025741, 0.00042229, -0.00000114, 0.00000000],
+		[-6.27316283, -0.00042011, 0.00025738, 0.00042223, -0.00000114, 0.00000000],
+		[-6.27316297, -0.00042006, 0.00025734, 0.00042217, -0.00000114, 0.00000000],
+		[-6.27316311, -0.00042000, 0.00025731, 0.00042212, -0.00000114, 0.00000000],
+		[-6.27316324, -0.00041994, 0.00025727, 0.00042206, -0.00000114, 0.00000000],
+		[-6.27316338, -0.00041988, 0.00025724, 0.00042200, -0.00000114, 0.00000000],
+		[-6.27316351, -0.00041983, 0.00025720, 0.00042194, -0.00000114, 0.00000000],
+		[-6.27316365, -0.00041977, 0.00025717, 0.00042189, -0.00000114, 0.00000000],
+		[-6.27316379, -0.00041971, 0.00025713, 0.00042183, -0.00000114, 0.00000000],
+		[-6.27316392, -0.00041966, 0.00025710, 0.00042177, -0.00000114, 0.00000000],
+		[-6.27316406, -0.00041960, 0.00025706, 0.00042172, -0.00000114, 0.00000000],
+		[-6.27316420, -0.00041954, 0.00025703, 0.00042166, -0.00000114, 0.00000000],
+		[-6.27316433, -0.00041949, 0.00025699, 0.00042160, -0.00000114, 0.00000000],
+		[-6.27316447, -0.00041943, 0.00025696, 0.00042154, -0.00000114, 0.00000000],
+		[-6.27316460, -0.00041937, 0.00025692, 0.00042149, -0.00000114, 0.00000000],
+		[-6.27316474, -0.00041932, 0.00025689, 0.00042143, -0.00000114, 0.00000000],
+		[-6.27316488, -0.00041926, 0.00025685, 0.00042137, -0.00000114, 0.00000000],
+		[-6.27316501, -0.00041920, 0.00025682, 0.00042132, -0.00000114, 0.00000000],
+		[-6.27316515, -0.00041915, 0.00025678, 0.00042126, -0.00000114, 0.00000000],
+		[-6.27316528, -0.00041909, 0.00025675, 0.00042120, -0.00000114, 0.00000000],
+		[-6.27316542, -0.00041903, 0.00025671, 0.00042115, -0.00000114, 0.00000000],
+		[-6.27316555, -0.00041898, 0.00025668, 0.00042109, -0.00000114, 0.00000000],
+		[-6.27316569, -0.00041892, 0.00025664, 0.00042103, -0.00000114, 0.00000000],
+		[-6.27316583, -0.00041886, 0.00025661, 0.00042097, -0.00000114, 0.00000000],
+		[-6.27316596, -0.00041881, 0.00025658, 0.00042092, -0.00000114, 0.00000000],
+		[-6.27316610, -0.00041875, 0.00025654, 0.00042086, -0.00000114, 0.00000000],
+		[-6.27316623, -0.00041869, 0.00025651, 0.00042080, -0.00000114, 0.00000000],
+		[-6.27316637, -0.00041864, 0.00025647, 0.00042075, -0.00000114, 0.00000000],
+		[-6.27316650, -0.00041858, 0.00025644, 0.00042069, -0.00000114, 0.00000000],
+		[-6.27316664, -0.00041852, 0.00025640, 0.00042063, -0.00000114, 0.00000000],
+		[-6.27316677, -0.00041847, 0.00025637, 0.00042058, -0.00000114, 0.00000000],
+		[-6.27316691, -0.00041841, 0.00025633, 0.00042052, -0.00000114, 0.00000000],
+		[-6.27316705, -0.00041835, 0.00025630, 0.00042046, -0.00000114, 0.00000000],
+		[-6.27316718, -0.00041830, 0.00025626, 0.00042041, -0.00000114, 0.00000000],
+		[-6.27316732, -0.00041824, 0.00025623, 0.00042035, -0.00000114, 0.00000000],
+		[-6.27316745, -0.00041818, 0.00025619, 0.00042029, -0.00000114, 0.00000000],
+		[-6.27316759, -0.00041813, 0.00025616, 0.00042023, -0.00000114, 0.00000000],
+		[-6.27316772, -0.00041807, 0.00025612, 0.00042018, -0.00000114, 0.00000000],
+		[-6.27316786, -0.00041801, 0.00025609, 0.00042012, -0.00000114, 0.00000000],
+		[-6.27316799, -0.00041796, 0.00025606, 0.00042006, -0.00000114, 0.00000000],
+		[-6.27316813, -0.00041790, 0.00025602, 0.00042001, -0.00000114, 0.00000000],
+		[-6.27316826, -0.00041784, 0.00025599, 0.00041995, -0.00000114, 0.00000000],
+		[-6.27316840, -0.00041779, 0.00025595, 0.00041989, -0.00000114, 0.00000000],
+		[-6.27316853, -0.00041773, 0.00025592, 0.00041984, -0.00000114, 0.00000000],
+		[-6.27316867, -0.00041768, 0.00025588, 0.00041978, -0.00000114, 0.00000000],
+		[-6.27316880, -0.00041762, 0.00025585, 0.00041972, -0.00000114, 0.00000000],
+		[-6.27316894, -0.00041756, 0.00025581, 0.00041967, -0.00000114, 0.00000000],
+		[-6.27316907, -0.00041751, 0.00025578, 0.00041961, -0.00000114, 0.00000000],
+		[-6.27316921, -0.00041745, 0.00025574, 0.00041955, -0.00000114, 0.00000000],
+		[-6.27316934, -0.00041739, 0.00025571, 0.00041950, -0.00000114, 0.00000000],
+		[-6.27316948, -0.00041734, 0.00025568, 0.00041944, -0.00000114, 0.00000000],
+		[-6.27316961, -0.00041728, 0.00025564, 0.00041939, -0.00000114, 0.00000000],
+		[-6.27316974, -0.00041722, 0.00025561, 0.00041933, -0.00000114, 0.00000000],
+		[-6.27316988, -0.00041717, 0.00025557, 0.00041927, -0.00000114, 0.00000000],
+		[-6.27317001, -0.00041711, 0.00025554, 0.00041922, -0.00000114, 0.00000000],
+		[-6.27317015, -0.00041706, 0.00025550, 0.00041916, -0.00000114, 0.00000000],
+		[-6.27317028, -0.00041700, 0.00025547, 0.00041910, -0.00000114, 0.00000000],
+		[-6.27317042, -0.00041694, 0.00025543, 0.00041905, -0.00000114, 0.00000000],
+		[-6.27317055, -0.00041689, 0.00025540, 0.00041899, -0.00000114, 0.00000000],
+		[-6.27317069, -0.00041683, 0.00025537, 0.00041893, -0.00000114, 0.00000000],
+		[-6.27317082, -0.00041678, 0.00025533, 0.00041888, -0.00000114, 0.00000000],
+		[-6.27317095, -0.00041672, 0.00025530, 0.00041882, -0.00000114, 0.00000000],
+		[-6.27317109, -0.00041666, 0.00025526, 0.00041876, -0.00000114, 0.00000000],
+		[-6.27317122, -0.00041661, 0.00025523, 0.00041871, -0.00000114, 0.00000000],
+		[-6.27317136, -0.00041655, 0.00025519, 0.00041865, -0.00000114, 0.00000000],
+		[-6.27317149, -0.00041649, 0.00025516, 0.00041860, -0.00000114, 0.00000000],
+		[-6.27317163, -0.00041644, 0.00025512, 0.00041854, -0.00000114, 0.00000000],
+		[-6.27317176, -0.00041638, 0.00025509, 0.00041848, -0.00000114, 0.00000000],
+		[-6.27317189, -0.00041633, 0.00025506, 0.00041843, -0.00000114, 0.00000000],
+		[-6.27317203, -0.00041627, 0.00025502, 0.00041837, -0.00000114, 0.00000000],
+		[-6.27317216, -0.00041621, 0.00025499, 0.00041831, -0.00000114, 0.00000000],
+		[-6.27317230, -0.00041616, 0.00025495, 0.00041826, -0.00000114, 0.00000000],
+		[-6.27317243, -0.00041610, 0.00025492, 0.00041820, -0.00000114, 0.00000000],
+		[-6.27317256, -0.00041605, 0.00025488, 0.00041814, -0.00000114, 0.00000000],
+		[-6.27317270, -0.00041599, 0.00025485, 0.00041809, -0.00000114, 0.00000000],
+		[-6.27317283, -0.00041594, 0.00025482, 0.00041803, -0.00000114, 0.00000000],
+		[-6.27317297, -0.00041588, 0.00025478, 0.00041798, -0.00000114, 0.00000000],
+		[-6.27317310, -0.00041582, 0.00025475, 0.00041792, -0.00000115, 0.00000000],
+		[-6.27317323, -0.00041577, 0.00025471, 0.00041786, -0.00000115, 0.00000000],
+		[-6.27317337, -0.00041571, 0.00025468, 0.00041781, -0.00000115, 0.00000000],
+		[-6.27317350, -0.00041566, 0.00025465, 0.00041775, -0.00000115, 0.00000000],
+		[-6.27317363, -0.00041560, 0.00025461, 0.00041770, -0.00000115, 0.00000000],
+		[-6.27317377, -0.00041554, 0.00025458, 0.00041764, -0.00000115, 0.00000000],
+		[-6.27317390, -0.00041549, 0.00025454, 0.00041758, -0.00000115, 0.00000000],
+		[-6.27317403, -0.00041543, 0.00025451, 0.00041753, -0.00000115, 0.00000000],
+		[-6.27317417, -0.00041538, 0.00025447, 0.00041747, -0.00000115, 0.00000000],
+		[-6.27317430, -0.00041532, 0.00025444, 0.00041742, -0.00000115, 0.00000000],
+		[-6.27317443, -0.00041527, 0.00025441, 0.00041736, -0.00000115, 0.00000000],
+		[-6.27317457, -0.00041521, 0.00025437, 0.00041730, -0.00000115, 0.00000000],
+		[-6.27317470, -0.00041515, 0.00025434, 0.00041725, -0.00000115, 0.00000000],
+		[-6.27317483, -0.00041510, 0.00025430, 0.00041719, -0.00000115, 0.00000000],
+		[-6.27317497, -0.00041504, 0.00025427, 0.00041714, -0.00000115, 0.00000000],
+		[-6.27317510, -0.00041499, 0.00025424, 0.00041708, -0.00000115, 0.00000000],
+		[-6.27317523, -0.00041493, 0.00025420, 0.00041702, -0.00000115, 0.00000000],
+		[-6.27317537, -0.00041488, 0.00025417, 0.00041697, -0.00000115, 0.00000000],
+		[-6.27317550, -0.00041482, 0.00025413, 0.00041691, -0.00000115, 0.00000000],
+		[-6.27317563, -0.00041476, 0.00025410, 0.00041686, -0.00000115, 0.00000000],
+		[-6.27317577, -0.00041471, 0.00025406, 0.00041680, -0.00000115, 0.00000000],
+		[-6.27317590, -0.00041465, 0.00025403, 0.00041674, -0.00000115, 0.00000000],
+		[-6.27317603, -0.00041460, 0.00025400, 0.00041669, -0.00000115, 0.00000000],
+		[-6.27317616, -0.00041454, 0.00025396, 0.00041663, -0.00000115, 0.00000000],
+		[-6.27317630, -0.00041449, 0.00025393, 0.00041658, -0.00000115, 0.00000000],
+		[-6.27317643, -0.00041443, 0.00025389, 0.00041652, -0.00000115, 0.00000000],
+		[-6.27317656, -0.00041438, 0.00025386, 0.00041647, -0.00000115, 0.00000000],
+		[-6.27317670, -0.00041432, 0.00025383, 0.00041641, -0.00000115, 0.00000000],
+		[-6.27317683, -0.00041427, 0.00025379, 0.00041635, -0.00000115, 0.00000000],
+		[-6.27317696, -0.00041421, 0.00025376, 0.00041630, -0.00000115, 0.00000000],
+		[-6.27317709, -0.00041415, 0.00025372, 0.00041624, -0.00000115, 0.00000000],
+		[-6.27317723, -0.00041410, 0.00025369, 0.00041619, -0.00000115, 0.00000000],
+		[-6.27317736, -0.00041404, 0.00025366, 0.00041613, -0.00000115, 0.00000000],
+		[-6.27317749, -0.00041399, 0.00025362, 0.00041608, -0.00000115, 0.00000000],
+		[-6.27317762, -0.00041393, 0.00025359, 0.00041602, -0.00000115, 0.00000000],
+		[-6.27317776, -0.00041388, 0.00025355, 0.00041596, -0.00000115, 0.00000000],
+		[-6.27317789, -0.00041382, 0.00025352, 0.00041591, -0.00000115, 0.00000000],
+		[-6.27317802, -0.00041377, 0.00025349, 0.00041585, -0.00000115, 0.00000000],
+		[-6.27317815, -0.00041371, 0.00025345, 0.00041580, -0.00000115, 0.00000000],
+		[-6.27317829, -0.00041366, 0.00025342, 0.00041574, -0.00000115, 0.00000000],
+		[-6.27317842, -0.00041360, 0.00025339, 0.00041569, -0.00000115, 0.00000000],
+		[-6.27317855, -0.00041355, 0.00025335, 0.00041563, -0.00000115, 0.00000000],
+		[-6.27317868, -0.00041349, 0.00025332, 0.00041558, -0.00000115, 0.00000000],
+		[-6.27317882, -0.00041344, 0.00025328, 0.00041552, -0.00000115, 0.00000000],
+		[-6.27317895, -0.00041338, 0.00025325, 0.00041546, -0.00000115, 0.00000000],
+		[-6.27317908, -0.00041333, 0.00025322, 0.00041541, -0.00000115, 0.00000000],
+		[-6.27317921, -0.00041327, 0.00025318, 0.00041535, -0.00000115, 0.00000000],
+		[-6.27317934, -0.00041321, 0.00025315, 0.00041530, -0.00000115, 0.00000000],
+		[-6.27317948, -0.00041316, 0.00025311, 0.00041524, -0.00000115, 0.00000000],
+		[-6.27317961, -0.00041310, 0.00025308, 0.00041519, -0.00000115, 0.00000000],
+		[-6.27317974, -0.00041305, 0.00025305, 0.00041513, -0.00000115, 0.00000000],
+		[-6.27317987, -0.00041299, 0.00025301, 0.00041508, -0.00000115, 0.00000000],
+		[-6.27318000, -0.00041294, 0.00025298, 0.00041502, -0.00000115, 0.00000000],
+		[-6.27318014, -0.00041288, 0.00025295, 0.00041497, -0.00000115, 0.00000000],
+		[-6.27318027, -0.00041283, 0.00025291, 0.00041491, -0.00000115, 0.00000000],
+		[-6.27318040, -0.00041277, 0.00025288, 0.00041485, -0.00000115, 0.00000000],
+		[-6.27318053, -0.00041272, 0.00025284, 0.00041480, -0.00000115, 0.00000000],
+		[-6.27318066, -0.00041266, 0.00025281, 0.00041474, -0.00000115, 0.00000000],
+		[-6.27318079, -0.00041261, 0.00025278, 0.00041469, -0.00000115, 0.00000000],
+		[-6.27318093, -0.00041255, 0.00025274, 0.00041463, -0.00000115, 0.00000000],
+		[-6.27318106, -0.00041250, 0.00025271, 0.00041458, -0.00000115, 0.00000000],
+		[-6.27318119, -0.00041244, 0.00025268, 0.00041452, -0.00000115, 0.00000000],
+		[-6.27318132, -0.00041239, 0.00025264, 0.00041447, -0.00000115, 0.00000000],
+		[-6.27318145, -0.00041233, 0.00025261, 0.00041441, -0.00000115, 0.00000000],
+		[-6.27318158, -0.00041228, 0.00025258, 0.00041436, -0.00000115, 0.00000000],
+		[-6.27318171, -0.00041222, 0.00025254, 0.00041430, -0.00000115, 0.00000000],
+		[-6.27318185, -0.00041217, 0.00025251, 0.00041425, -0.00000115, 0.00000000],
+		[-6.27318198, -0.00041211, 0.00025247, 0.00041419, -0.00000115, 0.00000000],
+		[-6.27318211, -0.00041206, 0.00025244, 0.00041414, -0.00000115, 0.00000000],
+		[-6.27318224, -0.00041200, 0.00025241, 0.00041408, -0.00000115, 0.00000000],
+		[-6.27318237, -0.00041195, 0.00025237, 0.00041403, -0.00000115, 0.00000000],
+		[-6.27318250, -0.00041190, 0.00025234, 0.00041397, -0.00000115, 0.00000000],
+		[-6.27318263, -0.00041184, 0.00025231, 0.00041392, -0.00000115, 0.00000000],
+		[-6.27318276, -0.00041179, 0.00025227, 0.00041386, -0.00000115, 0.00000000],
+		[-6.27318290, -0.00041173, 0.00025224, 0.00041381, -0.00000115, 0.00000000],
+		[-6.27318303, -0.00041168, 0.00025221, 0.00041375, -0.00000115, 0.00000000],
+		[-6.27318316, -0.00041162, 0.00025217, 0.00041370, -0.00000115, 0.00000000],
+		[-6.27318329, -0.00041157, 0.00025214, 0.00041364, -0.00000115, 0.00000000],
+		[-6.27318342, -0.00041151, 0.00025210, 0.00041359, -0.00000115, 0.00000000],
+		[-6.27318355, -0.00041146, 0.00025207, 0.00041353, -0.00000115, 0.00000000],
+		[-6.27318368, -0.00041140, 0.00025204, 0.00041348, -0.00000115, 0.00000000],
+		[-6.27318381, -0.00041135, 0.00025200, 0.00041342, -0.00000115, 0.00000000],
+		[-6.27318394, -0.00041129, 0.00025197, 0.00041337, -0.00000115, 0.00000000],
+		[-6.27318407, -0.00041124, 0.00025194, 0.00041331, -0.00000115, 0.00000000],
+		[-6.27318420, -0.00041118, 0.00025190, 0.00041326, -0.00000115, 0.00000000],
+		[-6.27318434, -0.00041113, 0.00025187, 0.00041320, -0.00000115, 0.00000000],
+		[-6.27318447, -0.00041107, 0.00025184, 0.00041315, -0.00000115, 0.00000000],
+		[-6.27318460, -0.00041102, 0.00025180, 0.00041309, -0.00000115, 0.00000000],
+		[-6.27318473, -0.00041097, 0.00025177, 0.00041304, -0.00000115, 0.00000000],
+		[-6.27318486, -0.00041091, 0.00025174, 0.00041298, -0.00000115, 0.00000000],
+		[-6.27318499, -0.00041086, 0.00025170, 0.00041293, -0.00000115, 0.00000000],
+		[-6.27318512, -0.00041080, 0.00025167, 0.00041287, -0.00000115, 0.00000000],
+		[-6.27318525, -0.00041075, 0.00025164, 0.00041282, -0.00000115, 0.00000000],
+		[-6.27318538, -0.00041069, 0.00025160, 0.00041276, -0.00000115, 0.00000000],
+		[-6.27318551, -0.00041064, 0.00025157, 0.00041271, -0.00000115, 0.00000000],
+		[-6.27318564, -0.00041058, 0.00025154, 0.00041265, -0.00000115, 0.00000000],
+		[-6.27318577, -0.00041053, 0.00025150, 0.00041260, -0.00000115, 0.00000000],
+		[-6.27318590, -0.00041048, 0.00025147, 0.00041254, -0.00000115, 0.00000000],
+		[-6.27318603, -0.00041042, 0.00025144, 0.00041249, -0.00000115, 0.00000000],
+		[-6.27318616, -0.00041037, 0.00025140, 0.00041243, -0.00000115, 0.00000000],
+		[-6.27318629, -0.00041031, 0.00025137, 0.00041238, -0.00000115, 0.00000000],
+		[-6.27318642, -0.00041026, 0.00025134, 0.00041233, -0.00000115, 0.00000000],
+		[-6.27318655, -0.00041020, 0.00025130, 0.00041227, -0.00000115, 0.00000000],
+		[-6.27318668, -0.00041015, 0.00025127, 0.00041222, -0.00000115, 0.00000000],
+		[-6.27318681, -0.00041009, 0.00025124, 0.00041216, -0.00000115, 0.00000000],
+		[-6.27318694, -0.00041004, 0.00025120, 0.00041211, -0.00000115, 0.00000000],
+		[-6.27318707, -0.00040999, 0.00025117, 0.00041205, -0.00000115, 0.00000000],
+		[-6.27318720, -0.00040993, 0.00025114, 0.00041200, -0.00000115, 0.00000000],
+		[-6.27318733, -0.00040988, 0.00025110, 0.00041194, -0.00000115, 0.00000000],
+		[-6.27318746, -0.00040982, 0.00025107, 0.00041189, -0.00000115, 0.00000000],
+		[-6.27318759, -0.00040977, 0.00025104, 0.00041183, -0.00000115, 0.00000000],
+		[-6.27318772, -0.00040971, 0.00025100, 0.00041178, -0.00000115, 0.00000000],
+		[-6.27318785, -0.00040966, 0.00025097, 0.00041173, -0.00000115, 0.00000000],
+		[-6.27318798, -0.00040961, 0.00025094, 0.00041167, -0.00000115, 0.00000000],
+		[-6.27318811, -0.00040955, 0.00025090, 0.00041162, -0.00000115, 0.00000000],
+		[-6.27318824, -0.00040950, 0.00025087, 0.00041156, -0.00000115, 0.00000000],
+		[-6.27318837, -0.00040944, 0.00025084, 0.00041151, -0.00000115, 0.00000000],
+		[-6.27318850, -0.00040939, 0.00025080, 0.00041145, -0.00000115, 0.00000000],
+		[-6.27318863, -0.00040934, 0.00025077, 0.00041140, -0.00000115, 0.00000000],
+		[-6.27318876, -0.00040928, 0.00025074, 0.00041134, -0.00000115, 0.00000000],
+		[-6.27318889, -0.00040923, 0.00025070, 0.00041129, -0.00000115, 0.00000000],
+		[-6.27318902, -0.00040917, 0.00025067, 0.00041124, -0.00000115, 0.00000000],
+		[-6.27318915, -0.00040912, 0.00025064, 0.00041118, -0.00000115, 0.00000000],
+		[-6.27318928, -0.00040906, 0.00025060, 0.00041113, -0.00000115, 0.00000000],
+		[-6.27318941, -0.00040901, 0.00025057, 0.00041107, -0.00000115, 0.00000000],
+		[-6.27318954, -0.00040896, 0.00025054, 0.00041102, -0.00000115, 0.00000000],
+		[-6.27318967, -0.00040890, 0.00025051, 0.00041096, -0.00000115, 0.00000000],
+		[-6.27318979, -0.00040885, 0.00025047, 0.00041091, -0.00000115, 0.00000000],
+		[-6.27318992, -0.00040879, 0.00025044, 0.00041086, -0.00000115, 0.00000000],
+		[-6.27319005, -0.00040874, 0.00025041, 0.00041080, -0.00000115, 0.00000000],
+		[-6.27319018, -0.00040869, 0.00025037, 0.00041075, -0.00000115, 0.00000000],
+		[-6.27319031, -0.00040863, 0.00025034, 0.00041069, -0.00000115, 0.00000000],
+		[-6.27319044, -0.00040858, 0.00025031, 0.00041064, -0.00000115, 0.00000000],
+		[-6.27319057, -0.00040852, 0.00025027, 0.00041058, -0.00000115, 0.00000000],
+		[-6.27319070, -0.00040847, 0.00025024, 0.00041053, -0.00000115, 0.00000000],
+		[-6.27319083, -0.00040842, 0.00025021, 0.00041048, -0.00000115, 0.00000000],
+		[-6.27319096, -0.00040836, 0.00025017, 0.00041042, -0.00000115, 0.00000000],
+		[-6.27319109, -0.00040831, 0.00025014, 0.00041037, -0.00000115, 0.00000000],
+		[-6.27319121, -0.00040826, 0.00025011, 0.00041031, -0.00000115, 0.00000000],
+		[-6.27319134, -0.00040820, 0.00025008, 0.00041026, -0.00000115, 0.00000000],
+		[-6.27319147, -0.00040815, 0.00025004, 0.00041021, -0.00000115, 0.00000000],
+		[-6.27319160, -0.00040809, 0.00025001, 0.00041015, -0.00000115, 0.00000000],
+		[-6.27319173, -0.00040804, 0.00024998, 0.00041010, -0.00000115, 0.00000000],
+		[-6.27319186, -0.00040799, 0.00024994, 0.00041004, -0.00000115, 0.00000000],
+		[-6.27319199, -0.00040793, 0.00024991, 0.00040999, -0.00000115, 0.00000000],
+		[-6.27319212, -0.00040788, 0.00024988, 0.00040993, -0.00000115, 0.00000000],
+		[-6.27319224, -0.00040783, 0.00024985, 0.00040988, -0.00000115, 0.00000000],
+		[-6.27319237, -0.00040777, 0.00024981, 0.00040983, -0.00000115, 0.00000000],
+		[-6.27319250, -0.00040772, 0.00024978, 0.00040977, -0.00000115, 0.00000000],
+		[-6.27319263, -0.00040766, 0.00024975, 0.00040972, -0.00000115, 0.00000000],
+		[-6.27319276, -0.00040761, 0.00024971, 0.00040966, -0.00000115, 0.00000000],
+		[-6.27319289, -0.00040756, 0.00024968, 0.00040961, -0.00000115, 0.00000000],
+		[-6.27319302, -0.00040750, 0.00024965, 0.00040956, -0.00000115, 0.00000000],
+		[-6.27319314, -0.00040745, 0.00024961, 0.00040950, -0.00000115, 0.00000000],
+		[-6.27319327, -0.00040740, 0.00024958, 0.00040945, -0.00000115, 0.00000000],
+		[-6.27319340, -0.00040734, 0.00024955, 0.00040940, -0.00000115, 0.00000000],
+		[-6.27319353, -0.00040729, 0.00024952, 0.00040934, -0.00000115, 0.00000000],
+		[-6.27319366, -0.00040724, 0.00024948, 0.00040929, -0.00000115, 0.00000000],
+		[-6.27319379, -0.00040718, 0.00024945, 0.00040923, -0.00000115, 0.00000000],
+		[-6.27319391, -0.00040713, 0.00024942, 0.00040918, -0.00000115, 0.00000000],
+		[-6.27319404, -0.00040707, 0.00024938, 0.00040913, -0.00000115, 0.00000000],
+		[-6.27319417, -0.00040702, 0.00024935, 0.00040907, -0.00000115, 0.00000000],
+		[-6.27319430, -0.00040697, 0.00024932, 0.00040902, -0.00000115, 0.00000000],
+		[-6.27319443, -0.00040691, 0.00024929, 0.00040896, -0.00000115, 0.00000000],
+		[-6.27319455, -0.00040686, 0.00024925, 0.00040891, -0.00000115, 0.00000000],
+		[-6.27319468, -0.00040681, 0.00024922, 0.00040886, -0.00000115, 0.00000000],
+		[-6.27319481, -0.00040675, 0.00024919, 0.00040880, -0.00000115, 0.00000000],
+		[-6.27319494, -0.00040670, 0.00024916, 0.00040875, -0.00000115, 0.00000000],
+		[-6.27319507, -0.00040665, 0.00024912, 0.00040870, -0.00000115, 0.00000000],
+		[-6.27319519, -0.00040659, 0.00024909, 0.00040864, -0.00000115, 0.00000000],
+		[-6.27319532, -0.00040654, 0.00024906, 0.00040859, -0.00000115, 0.00000000],
+		[-6.27319545, -0.00040649, 0.00024902, 0.00040854, -0.00000115, 0.00000000],
+		[-6.27319558, -0.00040643, 0.00024899, 0.00040848, -0.00000115, 0.00000000],
+		[-6.27319571, -0.00040638, 0.00024896, 0.00040843, -0.00000115, 0.00000000],
+		[-6.27319583, -0.00040633, 0.00024893, 0.00040837, -0.00000115, 0.00000000],
+		[-6.27319596, -0.00040627, 0.00024889, 0.00040832, -0.00000115, 0.00000000],
+		[-6.27319609, -0.00040622, 0.00024886, 0.00040827, -0.00000115, 0.00000000],
+		[-6.27319622, -0.00040617, 0.00024883, 0.00040821, -0.00000115, 0.00000000],
+		[-6.27319634, -0.00040611, 0.00024880, 0.00040816, -0.00000115, 0.00000000],
+		[-6.27319647, -0.00040606, 0.00024876, 0.00040811, -0.00000115, 0.00000000],
+		[-6.27319660, -0.00040601, 0.00024873, 0.00040805, -0.00000115, 0.00000000],
+		[-6.27319673, -0.00040595, 0.00024870, 0.00040800, -0.00000115, 0.00000000],
+		[-6.27319685, -0.00040590, 0.00024867, 0.00040795, -0.00000115, 0.00000000],
+		[-6.27319698, -0.00040585, 0.00024863, 0.00040789, -0.00000115, 0.00000000],
+		[-6.27319711, -0.00040579, 0.00024860, 0.00040784, -0.00000115, 0.00000000],
+		[-6.27319724, -0.00040574, 0.00024857, 0.00040779, -0.00000115, 0.00000000],
+		[-6.27319736, -0.00040569, 0.00024853, 0.00040773, -0.00000115, 0.00000000],
+		[-6.27319749, -0.00040563, 0.00024850, 0.00040768, -0.00000115, 0.00000000],
+		[-6.27319762, -0.00040558, 0.00024847, 0.00040763, -0.00000115, 0.00000000],
+		[-6.27319774, -0.00040553, 0.00024844, 0.00040757, -0.00000115, 0.00000000],
+		[-6.27319787, -0.00040547, 0.00024840, 0.00040752, -0.00000115, 0.00000000],
+		[-6.27319800, -0.00040542, 0.00024837, 0.00040746, -0.00000115, 0.00000000],
+		[-6.27319813, -0.00040537, 0.00024834, 0.00040741, -0.00000115, 0.00000000],
+		[-6.27319825, -0.00040532, 0.00024831, 0.00040736, -0.00000115, 0.00000000],
+		[-6.27319838, -0.00040526, 0.00024827, 0.00040730, -0.00000115, 0.00000000],
+		[-6.27319851, -0.00040521, 0.00024824, 0.00040725, -0.00000115, 0.00000000],
+		[-6.27319863, -0.00040516, 0.00024821, 0.00040720, -0.00000115, 0.00000000],
+		[-6.27319876, -0.00040510, 0.00024818, 0.00040714, -0.00000115, 0.00000000],
+		[-6.27319889, -0.00040505, 0.00024814, 0.00040709, -0.00000115, 0.00000000],
+		[-6.27319901, -0.00040500, 0.00024811, 0.00040704, -0.00000115, 0.00000000],
+		[-6.27319914, -0.00040494, 0.00024808, 0.00040699, -0.00000115, 0.00000000],
+		[-6.27319927, -0.00040489, 0.00024805, 0.00040693, -0.00000115, 0.00000000],
+		[-6.27319939, -0.00040484, 0.00024801, 0.00040688, -0.00000115, 0.00000000],
+		[-6.27319952, -0.00040479, 0.00024798, 0.00040683, -0.00000115, 0.00000000],
+		[-6.27319965, -0.00040473, 0.00024795, 0.00040677, -0.00000115, 0.00000000],
+		[-6.27319977, -0.00040468, 0.00024792, 0.00040672, -0.00000115, 0.00000000],
+		[-6.27319990, -0.00040463, 0.00024788, 0.00040667, -0.00000115, 0.00000000],
+		[-6.27320003, -0.00040457, 0.00024785, 0.00040661, -0.00000115, 0.00000000],
+		[-6.27320015, -0.00040452, 0.00024782, 0.00040656, -0.00000115, 0.00000000],
+		[-6.27320028, -0.00040447, 0.00024779, 0.00040651, -0.00000115, 0.00000000],
+		[-6.27320041, -0.00040442, 0.00024776, 0.00040645, -0.00000115, 0.00000000],
+		[-6.27320053, -0.00040436, 0.00024772, 0.00040640, -0.00000115, 0.00000000],
+		[-6.27320066, -0.00040431, 0.00024769, 0.00040635, -0.00000115, 0.00000000],
+		[-6.27320079, -0.00040426, 0.00024766, 0.00040629, -0.00000115, 0.00000000],
+		[-6.27320091, -0.00040420, 0.00024763, 0.00040624, -0.00000115, 0.00000000],
+		[-6.27320104, -0.00040415, 0.00024759, 0.00040619, -0.00000115, 0.00000000],
+		[-6.27320117, -0.00040410, 0.00024756, 0.00040613, -0.00000115, 0.00000000],
+		[-6.27320129, -0.00040405, 0.00024753, 0.00040608, -0.00000115, 0.00000000],
+		[-6.27320142, -0.00040399, 0.00024750, 0.00040603, -0.00000115, 0.00000000],
+		[-6.27320154, -0.00040394, 0.00024746, 0.00040598, -0.00000115, 0.00000000],
+		[-6.27320167, -0.00040389, 0.00024743, 0.00040592, -0.00000115, 0.00000000],
+		[-6.27320180, -0.00040383, 0.00024740, 0.00040587, -0.00000115, 0.00000000],
+		[-6.27320192, -0.00040378, 0.00024737, 0.00040582, -0.00000115, 0.00000000],
+		[-6.27320205, -0.00040373, 0.00024733, 0.00040576, -0.00000115, 0.00000000],
+		[-6.27320217, -0.00040368, 0.00024730, 0.00040571, -0.00000115, 0.00000000],
+		[-6.27320230, -0.00040362, 0.00024727, 0.00040566, -0.00000115, 0.00000000],
+		[-6.27320243, -0.00040357, 0.00024724, 0.00040561, -0.00000115, 0.00000000],
+		[-6.27320255, -0.00040352, 0.00024721, 0.00040555, -0.00000115, 0.00000000],
+		[-6.27320268, -0.00040347, 0.00024717, 0.00040550, -0.00000115, 0.00000000],
+		[-6.27320280, -0.00040341, 0.00024714, 0.00040545, -0.00000115, 0.00000000],
+		[-6.27320293, -0.00040336, 0.00024711, 0.00040539, -0.00000115, 0.00000000],
+		[-6.27320306, -0.00040331, 0.00024708, 0.00040534, -0.00000115, 0.00000000],
+		[-6.27320318, -0.00040326, 0.00024704, 0.00040529, -0.00000115, 0.00000000],
+		[-6.27320331, -0.00040320, 0.00024701, 0.00040524, -0.00000115, 0.00000000],
+		[-6.27320343, -0.00040315, 0.00024698, 0.00040518, -0.00000115, 0.00000000],
+		[-6.27320356, -0.00040310, 0.00024695, 0.00040513, -0.00000115, 0.00000000],
+		[-6.27320368, -0.00040305, 0.00024692, 0.00040508, -0.00000115, 0.00000000],
+		[-6.27320381, -0.00040299, 0.00024688, 0.00040502, -0.00000115, 0.00000000],
+		[-6.27320394, -0.00040294, 0.00024685, 0.00040497, -0.00000115, 0.00000000],
+		[-6.27320406, -0.00040289, 0.00024682, 0.00040492, -0.00000115, 0.00000000],
+		[-6.27320419, -0.00040284, 0.00024679, 0.00040487, -0.00000115, 0.00000000],
+		[-6.27320431, -0.00040278, 0.00024676, 0.00040481, -0.00000115, 0.00000000],
+		[-6.27320444, -0.00040273, 0.00024672, 0.00040476, -0.00000115, 0.00000000],
+		[-6.27320456, -0.00040268, 0.00024669, 0.00040471, -0.00000115, 0.00000000],
+		[-6.27320469, -0.00040263, 0.00024666, 0.00040466, -0.00000115, 0.00000000],
+		[-6.27320481, -0.00040257, 0.00024663, 0.00040460, -0.00000115, 0.00000000],
+		[-6.27320494, -0.00040252, 0.00024659, 0.00040455, -0.00000115, 0.00000000],
+		[-6.27320506, -0.00040247, 0.00024656, 0.00040450, -0.00000115, 0.00000000],
+		[-6.27320519, -0.00040242, 0.00024653, 0.00040445, -0.00000115, 0.00000000],
+		[-6.27320532, -0.00040237, 0.00024650, 0.00040439, -0.00000115, 0.00000000],
+		[-6.27320544, -0.00040231, 0.00024647, 0.00040434, -0.00000115, 0.00000000],
+		[-6.27320557, -0.00040226, 0.00024643, 0.00040429, -0.00000115, 0.00000000],
+		[-6.27320569, -0.00040221, 0.00024640, 0.00040424, -0.00000115, 0.00000000],
+		[-6.27320582, -0.00040216, 0.00024637, 0.00040418, -0.00000115, 0.00000000],
+		[-6.27320594, -0.00040210, 0.00024634, 0.00040413, -0.00000115, 0.00000000],
+		[-6.27320607, -0.00040205, 0.00024631, 0.00040408, -0.00000115, 0.00000000],
+		[-6.27320619, -0.00040200, 0.00024627, 0.00040403, -0.00000115, 0.00000000],
+		[-6.27320632, -0.00040195, 0.00024624, 0.00040397, -0.00000115, 0.00000000],
+		[-6.27320644, -0.00040190, 0.00024621, 0.00040392, -0.00000115, 0.00000000],
+		[-6.27320657, -0.00040184, 0.00024618, 0.00040387, -0.00000115, 0.00000000],
+		[-6.27320669, -0.00040179, 0.00024615, 0.00040382, -0.00000115, 0.00000000],
+		[-6.27320682, -0.00040174, 0.00024611, 0.00040376, -0.00000115, 0.00000000],
+		[-6.27320694, -0.00040169, 0.00024608, 0.00040371, -0.00000115, 0.00000000],
+		[-6.27320706, -0.00040163, 0.00024605, 0.00040366, -0.00000115, 0.00000000],
+		[-6.27320719, -0.00040158, 0.00024602, 0.00040361, -0.00000115, 0.00000000],
+		[-6.27320731, -0.00040153, 0.00024599, 0.00040355, -0.00000115, 0.00000000],
+		[-6.27320744, -0.00040148, 0.00024595, 0.00040350, -0.00000115, 0.00000000],
+		[-6.27320756, -0.00040143, 0.00024592, 0.00040345, -0.00000115, 0.00000000],
+		[-6.27320769, -0.00040137, 0.00024589, 0.00040340, -0.00000115, 0.00000000],
+		[-6.27320781, -0.00040132, 0.00024586, 0.00040334, -0.00000115, 0.00000000],
+		[-6.27320794, -0.00040127, 0.00024583, 0.00040329, -0.00000115, 0.00000000],
+		[-6.27320806, -0.00040122, 0.00024580, 0.00040324, -0.00000115, 0.00000000],
+		[-6.27320819, -0.00040117, 0.00024576, 0.00040319, -0.00000115, 0.00000000],
+		[-6.27320831, -0.00040111, 0.00024573, 0.00040313, -0.00000115, 0.00000000],
+		[-6.27320843, -0.00040106, 0.00024570, 0.00040308, -0.00000115, 0.00000000],
+		[-6.27320856, -0.00040101, 0.00024567, 0.00040303, -0.00000115, 0.00000000],
+		[-6.27320868, -0.00040096, 0.00024564, 0.00040298, -0.00000115, 0.00000000],
+		[-6.27320881, -0.00040091, 0.00024560, 0.00040293, -0.00000115, 0.00000000],
+		[-6.27320893, -0.00040085, 0.00024557, 0.00040287, -0.00000115, 0.00000000],
+		[-6.27320906, -0.00040080, 0.00024554, 0.00040282, -0.00000115, 0.00000000],
+		[-6.27320918, -0.00040075, 0.00024551, 0.00040277, -0.00000115, 0.00000000],
+		[-6.27320930, -0.00040070, 0.00024548, 0.00040272, -0.00000115, 0.00000000],
+		[-6.27320943, -0.00040065, 0.00024545, 0.00040267, -0.00000115, 0.00000000],
+		[-6.27320955, -0.00040059, 0.00024541, 0.00040261, -0.00000115, 0.00000000],
+		[-6.27320968, -0.00040054, 0.00024538, 0.00040256, -0.00000115, 0.00000000],
+		[-6.27320980, -0.00040049, 0.00024535, 0.00040251, -0.00000115, 0.00000000],
+		[-6.27320993, -0.00040044, 0.00024532, 0.00040246, -0.00000115, 0.00000000],
+		[-6.27321005, -0.00040039, 0.00024529, 0.00040240, -0.00000115, 0.00000000],
+		[-6.27321017, -0.00040034, 0.00024525, 0.00040235, -0.00000115, 0.00000000],
+		[-6.27321030, -0.00040028, 0.00024522, 0.00040230, -0.00000115, 0.00000000],
+		[-6.27321042, -0.00040023, 0.00024519, 0.00040225, -0.00000115, 0.00000000],
+		[-6.27321054, -0.00040018, 0.00024516, 0.00040220, -0.00000115, 0.00000000],
+		[-6.27321067, -0.00040013, 0.00024513, 0.00040214, -0.00000115, 0.00000000],
+		[-6.27321079, -0.00040008, 0.00024510, 0.00040209, -0.00000115, 0.00000000],
+		[-6.27321092, -0.00040003, 0.00024506, 0.00040204, -0.00000115, 0.00000000],
+		[-6.27321104, -0.00039997, 0.00024503, 0.00040199, -0.00000115, 0.00000000],
+		[-6.27321116, -0.00039992, 0.00024500, 0.00040194, -0.00000115, 0.00000000],
+		[-6.27321129, -0.00039987, 0.00024497, 0.00040189, -0.00000115, 0.00000000],
+		[-6.27321141, -0.00039982, 0.00024494, 0.00040183, -0.00000115, 0.00000000],
+		[-6.27321153, -0.00039977, 0.00024491, 0.00040178, -0.00000115, 0.00000000],
+		[-6.27321166, -0.00039972, 0.00024487, 0.00040173, -0.00000115, 0.00000000],
+		[-6.27321178, -0.00039966, 0.00024484, 0.00040168, -0.00000115, 0.00000000],
+		[-6.27321191, -0.00039961, 0.00024481, 0.00040163, -0.00000115, 0.00000000],
+		[-6.27321203, -0.00039956, 0.00024478, 0.00040157, -0.00000115, 0.00000000],
+		[-6.27321215, -0.00039951, 0.00024475, 0.00040152, -0.00000115, 0.00000000],
+		[-6.27321228, -0.00039946, 0.00024472, 0.00040147, -0.00000115, 0.00000000],
+		[-6.27321240, -0.00039941, 0.00024468, 0.00040142, -0.00000115, 0.00000000],
+		[-6.27321252, -0.00039935, 0.00024465, 0.00040137, -0.00000115, 0.00000000],
+		[-6.27321265, -0.00039930, 0.00024462, 0.00040131, -0.00000115, 0.00000000],
+		[-6.27321277, -0.00039925, 0.00024459, 0.00040126, -0.00000115, 0.00000000],
+		[-6.27321289, -0.00039920, 0.00024456, 0.00040121, -0.00000115, 0.00000000],
+		[-6.27321302, -0.00039915, 0.00024453, 0.00040116, -0.00000115, 0.00000000],
+		[-6.27321314, -0.00039910, 0.00024450, 0.00040111, -0.00000115, 0.00000000],
+		[-6.27321326, -0.00039905, 0.00024446, 0.00040106, -0.00000115, 0.00000000],
+		[-6.27321338, -0.00039899, 0.00024443, 0.00040100, -0.00000115, 0.00000000],
+		[-6.27321351, -0.00039894, 0.00024440, 0.00040095, -0.00000115, 0.00000000],
+		[-6.27321363, -0.00039889, 0.00024437, 0.00040090, -0.00000115, 0.00000000],
+		[-6.27321375, -0.00039884, 0.00024434, 0.00040085, -0.00000115, 0.00000000],
+		[-6.27321388, -0.00039879, 0.00024431, 0.00040080, -0.00000115, 0.00000000],
+		[-6.27321400, -0.00039874, 0.00024427, 0.00040075, -0.00000115, 0.00000000],
+		[-6.27321412, -0.00039869, 0.00024424, 0.00040069, -0.00000115, 0.00000000],
+		[-6.27321425, -0.00039863, 0.00024421, 0.00040064, -0.00000115, 0.00000000],
+		[-6.27321437, -0.00039858, 0.00024418, 0.00040059, -0.00000115, 0.00000000],
+		[-6.27321449, -0.00039853, 0.00024415, 0.00040054, -0.00000115, 0.00000000],
+		[-6.27321461, -0.00039848, 0.00024412, 0.00040049, -0.00000115, 0.00000000],
+		[-6.27321474, -0.00039843, 0.00024409, 0.00040044, -0.00000115, 0.00000000],
+		[-6.27321486, -0.00039838, 0.00024405, 0.00040039, -0.00000115, 0.00000000],
+		[-6.27321498, -0.00039833, 0.00024402, 0.00040033, -0.00000115, 0.00000000],
+		[-6.27321511, -0.00039828, 0.00024399, 0.00040028, -0.00000115, 0.00000000],
+		[-6.27321523, -0.00039822, 0.00024396, 0.00040023, -0.00000115, 0.00000000],
+		[-6.27321535, -0.00039817, 0.00024393, 0.00040018, -0.00000115, 0.00000000],
+		[-6.27321547, -0.00039812, 0.00024390, 0.00040013, -0.00000115, 0.00000000],
+		[-6.27321560, -0.00039807, 0.00024387, 0.00040008, -0.00000115, 0.00000000],
+		[-6.27321572, -0.00039802, 0.00024383, 0.00040002, -0.00000115, 0.00000000],
+		[-6.27321584, -0.00039797, 0.00024380, 0.00039997, -0.00000115, 0.00000000],
+		[-6.27321596, -0.00039792, 0.00024377, 0.00039992, -0.00000115, 0.00000000],
+		[-6.27321609, -0.00039787, 0.00024374, 0.00039987, -0.00000115, 0.00000000],
+		[-6.27321621, -0.00039781, 0.00024371, 0.00039982, -0.00000115, 0.00000000],
+		[-6.27321633, -0.00039776, 0.00024368, 0.00039977, -0.00000115, 0.00000000],
+		[-6.27321645, -0.00039771, 0.00024365, 0.00039972, -0.00000115, 0.00000000],
+		[-6.27321658, -0.00039766, 0.00024362, 0.00039966, -0.00000115, 0.00000000],
+		[-6.27321670, -0.00039761, 0.00024358, 0.00039961, -0.00000115, 0.00000000],
+		[-6.27321682, -0.00039756, 0.00024355, 0.00039956, -0.00000115, 0.00000000],
+		[-6.27321694, -0.00039751, 0.00024352, 0.00039951, -0.00000115, 0.00000000],
+		[-6.27321706, -0.00039746, 0.00024349, 0.00039946, -0.00000115, 0.00000000],
+		[-6.27321719, -0.00039741, 0.00024346, 0.00039941, -0.00000115, 0.00000000],
+		[-6.27321731, -0.00039736, 0.00024343, 0.00039936, -0.00000115, 0.00000000],
+		[-6.27321743, -0.00039730, 0.00024340, 0.00039931, -0.00000115, 0.00000000],
+		[-6.27321755, -0.00039725, 0.00024337, 0.00039925, -0.00000115, 0.00000000],
+		[-6.27321767, -0.00039720, 0.00024333, 0.00039920, -0.00000115, 0.00000000],
+		[-6.27321780, -0.00039715, 0.00024330, 0.00039915, -0.00000115, 0.00000000],
+		[-6.27321792, -0.00039710, 0.00024327, 0.00039910, -0.00000115, 0.00000000],
+		[-6.27321804, -0.00039705, 0.00024324, 0.00039905, -0.00000115, 0.00000000],
+		[-6.27321816, -0.00039700, 0.00024321, 0.00039900, -0.00000115, 0.00000000],
+		[-6.27321828, -0.00039695, 0.00024318, 0.00039895, -0.00000115, 0.00000000],
+		[-6.27321841, -0.00039690, 0.00024315, 0.00039890, -0.00000115, 0.00000000],
+		[-6.27321853, -0.00039685, 0.00024312, 0.00039884, -0.00000115, 0.00000000],
+		[-6.27321865, -0.00039680, 0.00024308, 0.00039879, -0.00000115, 0.00000000],
+		[-6.27321877, -0.00039674, 0.00024305, 0.00039874, -0.00000115, 0.00000000],
+		[-6.27321889, -0.00039669, 0.00024302, 0.00039869, -0.00000115, 0.00000000],
+		[-6.27321901, -0.00039664, 0.00024299, 0.00039864, -0.00000115, 0.00000000],
+		[-6.27321914, -0.00039659, 0.00024296, 0.00039859, -0.00000115, 0.00000000],
+		[-6.27321926, -0.00039654, 0.00024293, 0.00039854, -0.00000115, 0.00000000],
+		[-6.27321938, -0.00039649, 0.00024290, 0.00039849, -0.00000115, 0.00000000],
+		[-6.27321950, -0.00039644, 0.00024287, 0.00039844, -0.00000115, 0.00000000],
+		[-6.27321962, -0.00039639, 0.00024284, 0.00039839, -0.00000115, 0.00000000],
+		[-6.27321974, -0.00039634, 0.00024280, 0.00039833, -0.00000115, 0.00000000],
+		[-6.27321987, -0.00039629, 0.00024277, 0.00039828, -0.00000115, 0.00000000],
+		[-6.27321999, -0.00039624, 0.00024274, 0.00039823, -0.00000115, 0.00000000],
+		[-6.27322011, -0.00039619, 0.00024271, 0.00039818, -0.00000115, 0.00000000],
+		[-6.27322023, -0.00039613, 0.00024268, 0.00039813, -0.00000115, 0.00000000],
+		[-6.27322035, -0.00039608, 0.00024265, 0.00039808, -0.00000115, 0.00000000],
+		[-6.27322047, -0.00039603, 0.00024262, 0.00039803, -0.00000115, 0.00000000],
+		[-6.27322059, -0.00039598, 0.00024259, 0.00039798, -0.00000115, 0.00000000],
+		[-6.27322071, -0.00039593, 0.00024256, 0.00039793, -0.00000115, 0.00000000],
+		[-6.27322084, -0.00039588, 0.00024252, 0.00039788, -0.00000115, 0.00000000],
+		[-6.27322096, -0.00039583, 0.00024249, 0.00039782, -0.00000115, 0.00000000],
+		[-6.27322108, -0.00039578, 0.00024246, 0.00039777, -0.00000115, 0.00000000],
+		[-6.27322120, -0.00039573, 0.00024243, 0.00039772, -0.00000115, 0.00000000],
+		[-6.27322132, -0.00039568, 0.00024240, 0.00039767, -0.00000115, 0.00000000],
+		[-6.27322144, -0.00039563, 0.00024237, 0.00039762, -0.00000115, 0.00000000],
+		[-6.27322156, -0.00039558, 0.00024234, 0.00039757, -0.00000115, 0.00000000],
+		[-6.27322168, -0.00039553, 0.00024231, 0.00039752, -0.00000115, 0.00000000],
+		[-6.27322180, -0.00039548, 0.00024228, 0.00039747, -0.00000115, 0.00000000],
+		[-6.27322193, -0.00039543, 0.00024225, 0.00039742, -0.00000115, 0.00000000],
+		[-6.27322205, -0.00039538, 0.00024221, 0.00039737, -0.00000115, 0.00000000],
+		[-6.27322217, -0.00039533, 0.00024218, 0.00039732, -0.00000115, 0.00000000],
+		[-6.27322229, -0.00039528, 0.00024215, 0.00039727, -0.00000115, 0.00000000],
+		[-6.27322241, -0.00039522, 0.00024212, 0.00039722, -0.00000115, 0.00000000],
+		[-6.27322253, -0.00039517, 0.00024209, 0.00039716, -0.00000115, 0.00000000],
+		[-6.27322265, -0.00039512, 0.00024206, 0.00039711, -0.00000115, 0.00000000],
+		[-6.27322277, -0.00039507, 0.00024203, 0.00039706, -0.00000115, 0.00000000],
+		[-6.27322289, -0.00039502, 0.00024200, 0.00039701, -0.00000115, 0.00000000],
+		[-6.27322301, -0.00039497, 0.00024197, 0.00039696, -0.00000115, 0.00000000],
+		[-6.27322313, -0.00039492, 0.00024194, 0.00039691, -0.00000115, 0.00000000],
+		[-6.27322325, -0.00039487, 0.00024191, 0.00039686, -0.00000115, 0.00000000],
+		[-6.27322337, -0.00039482, 0.00024187, 0.00039681, -0.00000115, 0.00000000],
+		[-6.27322349, -0.00039477, 0.00024184, 0.00039676, -0.00000115, 0.00000000],
+		[-6.27322362, -0.00039472, 0.00024181, 0.00039671, -0.00000115, 0.00000000],
+		[-6.27322374, -0.00039467, 0.00024178, 0.00039666, -0.00000115, 0.00000000],
+		[-6.27322386, -0.00039462, 0.00024175, 0.00039661, -0.00000115, 0.00000000],
+		[-6.27322398, -0.00039457, 0.00024172, 0.00039656, -0.00000115, 0.00000000],
+		[-6.27322410, -0.00039452, 0.00024169, 0.00039651, -0.00000115, 0.00000000],
+		[-6.27322422, -0.00039447, 0.00024166, 0.00039646, -0.00000115, 0.00000000],
+		[-6.27322434, -0.00039442, 0.00024163, 0.00039641, -0.00000115, 0.00000000],
+		[-6.27322446, -0.00039437, 0.00024160, 0.00039635, -0.00000115, 0.00000000],
+		[-6.27322458, -0.00039432, 0.00024157, 0.00039630, -0.00000115, 0.00000000],
+		[-6.27322470, -0.00039427, 0.00024154, 0.00039625, -0.00000115, 0.00000000],
+		[-6.27322482, -0.00039422, 0.00024150, 0.00039620, -0.00000115, 0.00000000],
+		[-6.27322494, -0.00039417, 0.00024147, 0.00039615, -0.00000115, 0.00000000],
+		[-6.27322506, -0.00039412, 0.00024144, 0.00039610, -0.00000115, 0.00000000],
+		[-6.27322518, -0.00039407, 0.00024141, 0.00039605, -0.00000115, 0.00000000],
+		[-6.27322530, -0.00039402, 0.00024138, 0.00039600, -0.00000115, 0.00000000],
+		[-6.27322542, -0.00039397, 0.00024135, 0.00039595, -0.00000115, 0.00000000],
+		[-6.27322554, -0.00039392, 0.00024132, 0.00039590, -0.00000115, 0.00000000],
+		[-6.27322566, -0.00039387, 0.00024129, 0.00039585, -0.00000115, 0.00000000],
+		[-6.27322578, -0.00039382, 0.00024126, 0.00039580, -0.00000115, 0.00000000],
+		[-6.27322590, -0.00039377, 0.00024123, 0.00039575, -0.00000115, 0.00000000],
+		[-6.27322602, -0.00039372, 0.00024120, 0.00039570, -0.00000115, 0.00000000],
+		[-6.27322614, -0.00039367, 0.00024117, 0.00039565, -0.00000115, 0.00000000],
+		[-6.27322626, -0.00039362, 0.00024114, 0.00039560, -0.00000115, 0.00000000],
+		[-6.27322638, -0.00039357, 0.00024111, 0.00039555, -0.00000115, 0.00000000],
+		[-6.27322650, -0.00039352, 0.00024107, 0.00039550, -0.00000115, 0.00000000],
+		[-6.27322662, -0.00039347, 0.00024104, 0.00039545, -0.00000115, 0.00000000],
+		[-6.27322674, -0.00039342, 0.00024101, 0.00039540, -0.00000115, 0.00000000],
+		[-6.27322686, -0.00039337, 0.00024098, 0.00039535, -0.00000115, 0.00000000],
+		[-6.27322698, -0.00039332, 0.00024095, 0.00039530, -0.00000115, 0.00000000],
+		[-6.27322710, -0.00039327, 0.00024092, 0.00039525, -0.00000115, 0.00000000],
+		[-6.27322722, -0.00039322, 0.00024089, 0.00039520, -0.00000115, 0.00000000],
+		[-6.27322734, -0.00039317, 0.00024086, 0.00039515, -0.00000115, 0.00000000],
+		[-6.27322746, -0.00039312, 0.00024083, 0.00039510, -0.00000115, 0.00000000],
+		[-6.27322757, -0.00039307, 0.00024080, 0.00039505, -0.00000115, 0.00000000],
+		[-6.27322769, -0.00039302, 0.00024077, 0.00039500, -0.00000115, 0.00000000],
+		[-6.27322781, -0.00039297, 0.00024074, 0.00039495, -0.00000115, 0.00000000],
+		[-6.27322793, -0.00039292, 0.00024071, 0.00039490, -0.00000115, 0.00000000],
+		[-6.27322805, -0.00039287, 0.00024068, 0.00039485, -0.00000115, 0.00000000],
+		[-6.27322817, -0.00039282, 0.00024065, 0.00039480, -0.00000115, 0.00000000],
+		[-6.27322829, -0.00039277, 0.00024062, 0.00039475, -0.00000115, 0.00000000],
+		[-6.27322841, -0.00039272, 0.00024059, 0.00039470, -0.00000115, 0.00000000],
+		[-6.27322853, -0.00039267, 0.00024055, 0.00039465, -0.00000115, 0.00000000],
+		[-6.27322865, -0.00039262, 0.00024052, 0.00039460, -0.00000115, 0.00000000],
+		[-6.27322877, -0.00039257, 0.00024049, 0.00039455, -0.00000115, 0.00000000],
+		[-6.27322889, -0.00039252, 0.00024046, 0.00039450, -0.00000115, 0.00000000],
+		[-6.27322901, -0.00039247, 0.00024043, 0.00039445, -0.00000115, 0.00000000],
+		[-6.27322913, -0.00039242, 0.00024040, 0.00039440, -0.00000115, 0.00000000],
+		[-6.27322924, -0.00039237, 0.00024037, 0.00039435, -0.00000115, 0.00000000],
+		[-6.27322936, -0.00039232, 0.00024034, 0.00039430, -0.00000115, 0.00000000],
+		[-6.27322948, -0.00039227, 0.00024031, 0.00039425, -0.00000115, 0.00000000],
+		[-6.27322960, -0.00039222, 0.00024028, 0.00039420, -0.00000115, 0.00000000],
+		[-6.27322972, -0.00039217, 0.00024025, 0.00039415, -0.00000115, 0.00000000],
+		[-6.27322984, -0.00039212, 0.00024022, 0.00039410, -0.00000115, 0.00000000],
+		[-6.27322996, -0.00039207, 0.00024019, 0.00039405, -0.00000115, 0.00000000],
+		[-6.27323008, -0.00039202, 0.00024016, 0.00039400, -0.00000115, 0.00000000],
+		[-6.27323020, -0.00039197, 0.00024013, 0.00039395, -0.00000115, 0.00000000],
+		[-6.27323032, -0.00039192, 0.00024010, 0.00039390, -0.00000115, 0.00000000],
+		[-6.27323043, -0.00039187, 0.00024007, 0.00039385, -0.00000115, 0.00000000],
+		[-6.27323055, -0.00039182, 0.00024004, 0.00039380, -0.00000115, 0.00000000],
+		[-6.27323067, -0.00039177, 0.00024001, 0.00039375, -0.00000115, 0.00000000],
+		[-6.27323079, -0.00039172, 0.00023998, 0.00039370, -0.00000115, 0.00000000],
+		[-6.27323091, -0.00039167, 0.00023995, 0.00039365, -0.00000115, 0.00000000],
+		[-6.27323103, -0.00039162, 0.00023992, 0.00039360, -0.00000115, 0.00000000],
+		[-6.27323115, -0.00039158, 0.00023989, 0.00039355, -0.00000115, 0.00000000],
+		[-6.27323126, -0.00039153, 0.00023985, 0.00039350, -0.00000115, 0.00000000],
+		[-6.27323138, -0.00039148, 0.00023982, 0.00039345, -0.00000115, 0.00000000],
+		[-6.27323150, -0.00039143, 0.00023979, 0.00039340, -0.00000115, 0.00000000],
+		[-6.27323162, -0.00039138, 0.00023976, 0.00039335, -0.00000115, 0.00000000],
+		[-6.27323174, -0.00039133, 0.00023973, 0.00039330, -0.00000115, 0.00000000],
+		[-6.27323186, -0.00039128, 0.00023970, 0.00039325, -0.00000115, 0.00000000],
+		[-6.27323198, -0.00039123, 0.00023967, 0.00039320, -0.00000115, 0.00000000],
+		[-6.27323209, -0.00039118, 0.00023964, 0.00039315, -0.00000115, 0.00000000],
+		[-6.27323221, -0.00039113, 0.00023961, 0.00039310, -0.00000115, 0.00000000],
+		[-6.27323233, -0.00039108, 0.00023958, 0.00039305, -0.00000115, 0.00000000],
+		[-6.27323245, -0.00039103, 0.00023955, 0.00039300, -0.00000115, 0.00000000],
+		[-6.27323257, -0.00039098, 0.00023952, 0.00039295, -0.00000115, 0.00000000],
+		[-6.27323268, -0.00039093, 0.00023949, 0.00039290, -0.00000115, 0.00000000],
+		[-6.27323280, -0.00039088, 0.00023946, 0.00039285, -0.00000115, 0.00000000],
+		[-6.27323292, -0.00039083, 0.00023943, 0.00039280, -0.00000115, 0.00000000],
+		[-6.27323304, -0.00039078, 0.00023940, 0.00039275, -0.00000115, 0.00000000],
+		[-6.27323316, -0.00039073, 0.00023937, 0.00039270, -0.00000115, 0.00000000],
+		[-6.27323328, -0.00039069, 0.00023934, 0.00039265, -0.00000115, 0.00000000],
+		[-6.27323339, -0.00039064, 0.00023931, 0.00039260, -0.00000115, 0.00000000],
+		[-6.27323351, -0.00039059, 0.00023928, 0.00039255, -0.00000115, 0.00000000],
+		[-6.27323363, -0.00039054, 0.00023925, 0.00039250, -0.00000115, 0.00000000],
+		[-6.27323375, -0.00039049, 0.00023922, 0.00039245, -0.00000115, 0.00000000],
+		[-6.27323387, -0.00039044, 0.00023919, 0.00039241, -0.00000115, 0.00000000],
+		[-6.27323398, -0.00039039, 0.00023916, 0.00039236, -0.00000115, 0.00000000],
+		[-6.27323410, -0.00039034, 0.00023913, 0.00039231, -0.00000115, 0.00000000],
+		[-6.27323422, -0.00039029, 0.00023910, 0.00039226, -0.00000115, 0.00000000],
+		[-6.27323434, -0.00039024, 0.00023907, 0.00039221, -0.00000115, 0.00000000],
+		[-6.27323445, -0.00039019, 0.00023904, 0.00039216, -0.00000115, 0.00000000],
+		[-6.27323457, -0.00039014, 0.00023901, 0.00039211, -0.00000115, 0.00000000],
+		[-6.27323469, -0.00039009, 0.00023898, 0.00039206, -0.00000115, 0.00000000],
+		[-6.27323481, -0.00039005, 0.00023895, 0.00039201, -0.00000115, 0.00000000],
+		[-6.27323493, -0.00039000, 0.00023892, 0.00039196, -0.00000115, 0.00000000],
+		[-6.27323504, -0.00038995, 0.00023889, 0.00039191, -0.00000115, 0.00000000],
+		[-6.27323516, -0.00038990, 0.00023886, 0.00039186, -0.00000115, 0.00000000],
+		[-6.27323528, -0.00038985, 0.00023883, 0.00039181, -0.00000115, 0.00000000],
+		[-6.27323540, -0.00038980, 0.00023880, 0.00039176, -0.00000115, 0.00000000],
+		[-6.27323551, -0.00038975, 0.00023877, 0.00039171, -0.00000115, 0.00000000],
+		[-6.27323563, -0.00038970, 0.00023874, 0.00039166, -0.00000115, 0.00000000],
+		[-6.27323575, -0.00038965, 0.00023871, 0.00039161, -0.00000115, 0.00000000],
+		[-6.27323587, -0.00038960, 0.00023868, 0.00039157, -0.00000115, 0.00000000],
+		[-6.27323598, -0.00038955, 0.00023865, 0.00039152, -0.00000115, 0.00000000],
+		[-6.27323610, -0.00038951, 0.00023862, 0.00039147, -0.00000115, 0.00000000],
+		[-6.27323622, -0.00038946, 0.00023859, 0.00039142, -0.00000115, 0.00000000],
+		[-6.27323633, -0.00038941, 0.00023856, 0.00039137, -0.00000115, 0.00000000],
+		[-6.27323645, -0.00038936, 0.00023853, 0.00039132, -0.00000115, 0.00000000],
+		[-6.27323657, -0.00038931, 0.00023850, 0.00039127, -0.00000115, 0.00000000],
+		[-6.27323669, -0.00038926, 0.00023847, 0.00039122, -0.00000115, 0.00000000],
+		[-6.27323680, -0.00038921, 0.00023844, 0.00039117, -0.00000115, 0.00000000],
+		[-6.27323692, -0.00038916, 0.00023841, 0.00039112, -0.00000115, 0.00000000],
+		[-6.27323704, -0.00038911, 0.00023838, 0.00039107, -0.00000115, 0.00000000],
+		[-6.27323715, -0.00038907, 0.00023835, 0.00039102, -0.00000115, 0.00000000],
+		[-6.27323727, -0.00038902, 0.00023832, 0.00039097, -0.00000115, 0.00000000],
+		[-6.27323739, -0.00038897, 0.00023829, 0.00039093, -0.00000115, 0.00000000],
+		[-6.27323751, -0.00038892, 0.00023826, 0.00039088, -0.00000115, 0.00000000],
+		[-6.27323762, -0.00038887, 0.00023823, 0.00039083, -0.00000115, 0.00000000],
+		[-6.27323774, -0.00038882, 0.00023820, 0.00039078, -0.00000115, 0.00000000],
+		[-6.27323786, -0.00038877, 0.00023817, 0.00039073, -0.00000115, 0.00000000],
+		[-6.27323797, -0.00038872, 0.00023814, 0.00039068, -0.00000115, 0.00000000],
+		[-6.27323809, -0.00038867, 0.00023811, 0.00039063, -0.00000115, 0.00000000],
+		[-6.27323821, -0.00038863, 0.00023808, 0.00039058, -0.00000115, 0.00000000],
+		[-6.27323832, -0.00038858, 0.00023805, 0.00039053, -0.00000115, 0.00000000],
+		[-6.27323844, -0.00038853, 0.00023802, 0.00039048, -0.00000115, 0.00000000],
+		[-6.27323856, -0.00038848, 0.00023799, 0.00039044, -0.00000115, 0.00000000],
+		[-6.27323867, -0.00038843, 0.00023796, 0.00039039, -0.00000115, 0.00000000],
+		[-6.27323879, -0.00038838, 0.00023793, 0.00039034, -0.00000115, 0.00000000],
+		[-6.27323891, -0.00038833, 0.00023790, 0.00039029, -0.00000115, 0.00000000],
+		[-6.27323902, -0.00038828, 0.00023787, 0.00039024, -0.00000115, 0.00000000],
+		[-6.27323914, -0.00038824, 0.00023784, 0.00039019, -0.00000115, 0.00000000],
+		[-6.27323926, -0.00038819, 0.00023781, 0.00039014, -0.00000115, 0.00000000],
+		[-6.27323937, -0.00038814, 0.00023778, 0.00039009, -0.00000115, 0.00000000],
+		[-6.27323949, -0.00038809, 0.00023775, 0.00039004, -0.00000115, 0.00000000],
+		[-6.27323961, -0.00038804, 0.00023772, 0.00038999, -0.00000115, 0.00000000],
+		[-6.27323972, -0.00038799, 0.00023769, 0.00038995, -0.00000115, 0.00000000],
+		[-6.27323984, -0.00038794, 0.00023766, 0.00038990, -0.00000115, 0.00000000],
+		[-6.27323996, -0.00038789, 0.00023763, 0.00038985, -0.00000115, 0.00000000],
+		[-6.27324007, -0.00038785, 0.00023760, 0.00038980, -0.00000115, 0.00000000],
+		[-6.27324019, -0.00038780, 0.00023757, 0.00038975, -0.00000115, 0.00000000],
+		[-6.27324030, -0.00038775, 0.00023754, 0.00038970, -0.00000115, 0.00000000],
+		[-6.27324042, -0.00038770, 0.00023751, 0.00038965, -0.00000115, 0.00000000],
+		[-6.27324054, -0.00038765, 0.00023748, 0.00038960, -0.00000115, 0.00000000],
+		[-6.27324065, -0.00038760, 0.00023745, 0.00038956, -0.00000115, 0.00000000],
+		[-6.27324077, -0.00038755, 0.00023742, 0.00038951, -0.00000115, 0.00000000],
+		[-6.27324089, -0.00038751, 0.00023739, 0.00038946, -0.00000115, 0.00000000],
+		[-6.27324100, -0.00038746, 0.00023736, 0.00038941, -0.00000115, 0.00000000],
+		[-6.27324112, -0.00038741, 0.00023733, 0.00038936, -0.00000115, 0.00000000],
+		[-6.27324123, -0.00038736, 0.00023730, 0.00038931, -0.00000115, 0.00000000],
+		[-6.27324135, -0.00038731, 0.00023727, 0.00038926, -0.00000115, 0.00000000],
+		[-6.27324147, -0.00038726, 0.00023724, 0.00038921, -0.00000115, 0.00000000],
+		[-6.27324158, -0.00038722, 0.00023721, 0.00038917, -0.00000115, 0.00000000],
+		[-6.27324170, -0.00038717, 0.00023718, 0.00038912, -0.00000115, 0.00000000],
+		[-6.27324181, -0.00038712, 0.00023715, 0.00038907, -0.00000115, 0.00000000],
+		[-6.27324193, -0.00038707, 0.00023712, 0.00038902, -0.00000115, 0.00000000],
+		[-6.27324205, -0.00038702, 0.00023709, 0.00038897, -0.00000115, 0.00000000],
+		[-6.27324216, -0.00038697, 0.00023706, 0.00038892, -0.00000115, 0.00000000],
+		[-6.27324228, -0.00038693, 0.00023704, 0.00038887, -0.00000115, 0.00000000],
+		[-6.27324239, -0.00038688, 0.00023701, 0.00038882, -0.00000115, 0.00000000],
+		[-6.27324251, -0.00038683, 0.00023698, 0.00038878, -0.00000115, 0.00000000],
+		[-6.27324262, -0.00038678, 0.00023695, 0.00038873, -0.00000115, 0.00000000],
+		[-6.27324274, -0.00038673, 0.00023692, 0.00038868, -0.00000115, 0.00000000],
+		[-6.27324286, -0.00038668, 0.00023689, 0.00038863, -0.00000115, 0.00000000],
+		[-6.27324297, -0.00038664, 0.00023686, 0.00038858, -0.00000115, 0.00000000],
+		[-6.27324309, -0.00038659, 0.00023683, 0.00038853, -0.00000115, 0.00000000],
+		[-6.27324320, -0.00038654, 0.00023680, 0.00038848, -0.00000115, 0.00000000],
+		[-6.27324332, -0.00038649, 0.00023677, 0.00038844, -0.00000115, 0.00000000],
+		[-6.27324343, -0.00038644, 0.00023674, 0.00038839, -0.00000115, 0.00000000],
+		[-6.27324355, -0.00038639, 0.00023671, 0.00038834, -0.00000115, 0.00000000],
+		[-6.27324366, -0.00038635, 0.00023668, 0.00038829, -0.00000115, 0.00000000],
+		[-6.27324378, -0.00038630, 0.00023665, 0.00038824, -0.00000115, 0.00000000],
+		[-6.27324390, -0.00038625, 0.00023662, 0.00038819, -0.00000115, 0.00000000],
+		[-6.27324401, -0.00038620, 0.00023659, 0.00038815, -0.00000115, 0.00000000],
+		[-6.27324413, -0.00038615, 0.00023656, 0.00038810, -0.00000115, 0.00000000],
+		[-6.27324424, -0.00038610, 0.00023653, 0.00038805, -0.00000115, 0.00000000],
+		[-6.27324436, -0.00038606, 0.00023650, 0.00038800, -0.00000115, 0.00000000],
+		[-6.27324447, -0.00038601, 0.00023647, 0.00038795, -0.00000115, 0.00000000],
+		[-6.27324459, -0.00038596, 0.00023644, 0.00038790, -0.00000115, 0.00000000],
+		[-6.27324470, -0.00038591, 0.00023641, 0.00038786, -0.00000115, 0.00000000],
+		[-6.27324482, -0.00038586, 0.00023638, 0.00038781, -0.00000115, 0.00000000],
+		[-6.27324493, -0.00038582, 0.00023636, 0.00038776, -0.00000115, 0.00000000],
+		[-6.27324505, -0.00038577, 0.00023633, 0.00038771, -0.00000115, 0.00000000],
+		[-6.27324516, -0.00038572, 0.00023630, 0.00038766, -0.00000115, 0.00000000],
+		[-6.27324528, -0.00038567, 0.00023627, 0.00038761, -0.00000115, 0.00000000],
+		[-6.27324539, -0.00038562, 0.00023624, 0.00038757, -0.00000115, 0.00000000],
+		[-6.27324551, -0.00038558, 0.00023621, 0.00038752, -0.00000115, 0.00000000],
+		[-6.27324562, -0.00038553, 0.00023618, 0.00038747, -0.00000115, 0.00000000],
+		[-6.27324574, -0.00038548, 0.00023615, 0.00038742, -0.00000115, 0.00000000],
+		[-6.27324585, -0.00038543, 0.00023612, 0.00038737, -0.00000115, 0.00000000],
+		[-6.27324597, -0.00038538, 0.00023609, 0.00038732, -0.00000115, 0.00000000],
+		[-6.27324608, -0.00038534, 0.00023606, 0.00038728, -0.00000115, 0.00000000],
+		[-6.27324620, -0.00038529, 0.00023603, 0.00038723, -0.00000115, 0.00000000],
+		[-6.27324631, -0.00038524, 0.00023600, 0.00038718, -0.00000115, 0.00000000],
+		[-6.27324643, -0.00038519, 0.00023597, 0.00038713, -0.00000115, 0.00000000],
+		[-6.27324654, -0.00038514, 0.00023594, 0.00038708, -0.00000115, 0.00000000],
+		[-6.27324666, -0.00038510, 0.00023591, 0.00038703, -0.00000115, 0.00000000],
+		[-6.27324677, -0.00038505, 0.00023588, 0.00038699, -0.00000115, 0.00000000],
+		[-6.27324689, -0.00038500, 0.00023586, 0.00038694, -0.00000115, 0.00000000],
+		[-6.27324700, -0.00038495, 0.00023583, 0.00038689, -0.00000115, 0.00000000],
+		[-6.27324711, -0.00038490, 0.00023580, 0.00038684, -0.00000115, 0.00000000],
+		[-6.27324723, -0.00038486, 0.00023577, 0.00038679, -0.00000115, 0.00000000],
+		[-6.27324734, -0.00038481, 0.00023574, 0.00038675, -0.00000115, 0.00000000],
+		[-6.27324746, -0.00038476, 0.00023571, 0.00038670, -0.00000115, 0.00000000],
+		[-6.27324757, -0.00038471, 0.00023568, 0.00038665, -0.00000115, 0.00000000],
+		[-6.27324769, -0.00038467, 0.00023565, 0.00038660, -0.00000115, 0.00000000],
+		[-6.27324780, -0.00038462, 0.00023562, 0.00038655, -0.00000115, 0.00000000],
+		[-6.27324792, -0.00038457, 0.00023559, 0.00038651, -0.00000115, 0.00000000],
+		[-6.27324803, -0.00038452, 0.00023556, 0.00038646, -0.00000115, 0.00000000],
+		[-6.27324814, -0.00038447, 0.00023553, 0.00038641, -0.00000115, 0.00000000],
+		[-6.27324826, -0.00038443, 0.00023550, 0.00038636, -0.00000115, 0.00000000],
+		[-6.27324837, -0.00038438, 0.00023547, 0.00038631, -0.00000115, 0.00000000],
+		[-6.27324849, -0.00038433, 0.00023545, 0.00038627, -0.00000115, 0.00000000],
+		[-6.27324860, -0.00038428, 0.00023542, 0.00038622, -0.00000115, 0.00000000],
+		[-6.27324872, -0.00038424, 0.00023539, 0.00038617, -0.00000115, 0.00000000],
+		[-6.27324883, -0.00038419, 0.00023536, 0.00038612, -0.00000115, 0.00000000],
+		[-6.27324894, -0.00038414, 0.00023533, 0.00038607, -0.00000115, 0.00000000],
+		[-6.27324906, -0.00038409, 0.00023530, 0.00038603, -0.00000115, 0.00000000],
+		[-6.27324917, -0.00038405, 0.00023527, 0.00038598, -0.00000115, 0.00000000],
+		[-6.27324929, -0.00038400, 0.00023524, 0.00038593, -0.00000115, 0.00000000],
+		[-6.27324940, -0.00038395, 0.00023521, 0.00038588, -0.00000115, 0.00000000],
+		[-6.27324951, -0.00038390, 0.00023518, 0.00038583, -0.00000115, 0.00000000],
+		[-6.27324963, -0.00038385, 0.00023515, 0.00038579, -0.00000115, 0.00000000],
+		[-6.27324974, -0.00038381, 0.00023512, 0.00038574, -0.00000115, 0.00000000],
+		[-6.27324986, -0.00038376, 0.00023509, 0.00038569, -0.00000115, 0.00000000],
+		[-6.27324997, -0.00038371, 0.00023507, 0.00038564, -0.00000115, 0.00000000],
+		[-6.27325008, -0.00038366, 0.00023504, 0.00038560, -0.00000115, 0.00000000],
+		[-6.27325020, -0.00038362, 0.00023501, 0.00038555, -0.00000115, 0.00000000],
+		[-6.27325031, -0.00038357, 0.00023498, 0.00038550, -0.00000115, 0.00000000],
+		[-6.27325043, -0.00038352, 0.00023495, 0.00038545, -0.00000115, 0.00000000],
+		[-6.27325054, -0.00038347, 0.00023492, 0.00038540, -0.00000115, 0.00000000],
+		[-6.27325065, -0.00038343, 0.00023489, 0.00038536, -0.00000115, 0.00000000],
+		[-6.27325077, -0.00038338, 0.00023486, 0.00038531, -0.00000115, 0.00000000],
+		[-6.27325088, -0.00038333, 0.00023483, 0.00038526, -0.00000115, 0.00000000],
+		[-6.27325099, -0.00038328, 0.00023480, 0.00038521, -0.00000115, 0.00000000],
+		[-6.27325111, -0.00038324, 0.00023477, 0.00038517, -0.00000115, 0.00000000],
+		[-6.27325122, -0.00038319, 0.00023475, 0.00038512, -0.00000115, 0.00000000],
+		[-6.27325133, -0.00038314, 0.00023472, 0.00038507, -0.00000115, 0.00000000],
+		[-6.27325145, -0.00038309, 0.00023469, 0.00038502, -0.00000115, 0.00000000],
+		[-6.27325156, -0.00038305, 0.00023466, 0.00038498, -0.00000115, 0.00000000],
+		[-6.27325168, -0.00038300, 0.00023463, 0.00038493, -0.00000115, 0.00000000],
+		[-6.27325179, -0.00038295, 0.00023460, 0.00038488, -0.00000115, 0.00000000],
+		[-6.27325190, -0.00038291, 0.00023457, 0.00038483, -0.00000115, 0.00000000],
+		[-6.27325202, -0.00038286, 0.00023454, 0.00038478, -0.00000115, 0.00000000],
+		[-6.27325213, -0.00038281, 0.00023451, 0.00038474, -0.00000115, 0.00000000],
+		[-6.27325224, -0.00038276, 0.00023448, 0.00038469, -0.00000115, 0.00000000],
+		[-6.27325236, -0.00038272, 0.00023446, 0.00038464, -0.00000115, 0.00000000],
+		[-6.27325247, -0.00038267, 0.00023443, 0.00038459, -0.00000115, 0.00000000],
+		[-6.27325258, -0.00038262, 0.00023440, 0.00038455, -0.00000115, 0.00000000],
+		[-6.27325269, -0.00038257, 0.00023437, 0.00038450, -0.00000115, 0.00000000],
+		[-6.27325281, -0.00038253, 0.00023434, 0.00038445, -0.00000115, 0.00000000],
+		[-6.27325292, -0.00038248, 0.00023431, 0.00038440, -0.00000115, 0.00000000],
+		[-6.27325303, -0.00038243, 0.00023428, 0.00038436, -0.00000115, 0.00000000],
+		[-6.27325315, -0.00038238, 0.00023425, 0.00038431, -0.00000115, 0.00000000],
+		[-6.27325326, -0.00038234, 0.00023422, 0.00038426, -0.00000115, 0.00000000],
+		[-6.27325337, -0.00038229, 0.00023419, 0.00038421, -0.00000115, 0.00000000],
+		[-6.27325349, -0.00038224, 0.00023417, 0.00038417, -0.00000115, 0.00000000],
+		[-6.27325360, -0.00038220, 0.00023414, 0.00038412, -0.00000115, 0.00000000],
+		[-6.27325371, -0.00038215, 0.00023411, 0.00038407, -0.00000115, 0.00000000],
+		[-6.27325383, -0.00038210, 0.00023408, 0.00038402, -0.00000115, 0.00000000],
+		[-6.27325394, -0.00038205, 0.00023405, 0.00038398, -0.00000115, 0.00000000],
+		[-6.27325405, -0.00038201, 0.00023402, 0.00038393, -0.00000115, 0.00000000],
+		[-6.27325416, -0.00038196, 0.00023399, 0.00038388, -0.00000115, 0.00000000],
+		[-6.27325428, -0.00038191, 0.00023396, 0.00038384, -0.00000115, 0.00000000],
+		[-6.27325439, -0.00038187, 0.00023393, 0.00038379, -0.00000115, 0.00000000],
+		[-6.27325450, -0.00038182, 0.00023391, 0.00038374, -0.00000115, 0.00000000],
+		[-6.27325462, -0.00038177, 0.00023388, 0.00038369, -0.00000115, 0.00000000],
+		[-6.27325473, -0.00038172, 0.00023385, 0.00038365, -0.00000115, 0.00000000],
+		[-6.27325484, -0.00038168, 0.00023382, 0.00038360, -0.00000115, 0.00000000],
+		[-6.27325495, -0.00038163, 0.00023379, 0.00038355, -0.00000115, 0.00000000],
+		[-6.27325507, -0.00038158, 0.00023376, 0.00038350, -0.00000115, 0.00000000],
+		[-6.27325518, -0.00038154, 0.00023373, 0.00038346, -0.00000115, 0.00000000],
+		[-6.27325529, -0.00038149, 0.00023370, 0.00038341, -0.00000115, 0.00000000],
+		[-6.27325540, -0.00038144, 0.00023367, 0.00038336, -0.00000115, 0.00000000],
+		[-6.27325552, -0.00038140, 0.00023365, 0.00038332, -0.00000115, 0.00000000],
+		[-6.27325563, -0.00038135, 0.00023362, 0.00038327, -0.00000115, 0.00000000],
+		[-6.27325574, -0.00038130, 0.00023359, 0.00038322, -0.00000115, 0.00000000],
+		[-6.27325585, -0.00038125, 0.00023356, 0.00038317, -0.00000115, 0.00000000],
+		[-6.27325597, -0.00038121, 0.00023353, 0.00038313, -0.00000115, 0.00000000],
+		[-6.27325608, -0.00038116, 0.00023350, 0.00038308, -0.00000115, 0.00000000],
+		[-6.27325619, -0.00038111, 0.00023347, 0.00038303, -0.00000115, 0.00000000],
+		[-6.27325630, -0.00038107, 0.00023344, 0.00038298, -0.00000115, 0.00000000],
+		[-6.27325642, -0.00038102, 0.00023342, 0.00038294, -0.00000115, 0.00000000],
+		[-6.27325653, -0.00038097, 0.00023339, 0.00038289, -0.00000115, 0.00000000],
+		[-6.27325664, -0.00038093, 0.00023336, 0.00038284, -0.00000115, 0.00000000],
+		[-6.27325675, -0.00038088, 0.00023333, 0.00038280, -0.00000115, 0.00000000],
+		[-6.27325686, -0.00038083, 0.00023330, 0.00038275, -0.00000115, 0.00000000],
+		[-6.27325698, -0.00038079, 0.00023327, 0.00038270, -0.00000115, 0.00000000],
+		[-6.27325709, -0.00038074, 0.00023324, 0.00038265, -0.00000115, 0.00000000],
+		[-6.27325720, -0.00038069, 0.00023321, 0.00038261, -0.00000115, 0.00000000],
+		[-6.27325731, -0.00038065, 0.00023319, 0.00038256, -0.00000115, 0.00000000],
+		[-6.27325742, -0.00038060, 0.00023316, 0.00038251, -0.00000115, 0.00000000],
+		[-6.27325754, -0.00038055, 0.00023313, 0.00038247, -0.00000115, 0.00000000],
+		[-6.27325765, -0.00038050, 0.00023310, 0.00038242, -0.00000115, 0.00000000],
+		[-6.27325776, -0.00038046, 0.00023307, 0.00038237, -0.00000115, 0.00000000],
+		[-6.27325787, -0.00038041, 0.00023304, 0.00038233, -0.00000115, 0.00000000],
+		[-6.27325798, -0.00038036, 0.00023301, 0.00038228, -0.00000115, 0.00000000],
+		[-6.27325810, -0.00038032, 0.00023299, 0.00038223, -0.00000115, 0.00000000],
+		[-6.27325821, -0.00038027, 0.00023296, 0.00038218, -0.00000115, 0.00000000],
+		[-6.27325832, -0.00038022, 0.00023293, 0.00038214, -0.00000115, 0.00000000],
+		[-6.27325843, -0.00038018, 0.00023290, 0.00038209, -0.00000115, 0.00000000],
+		[-6.27325854, -0.00038013, 0.00023287, 0.00038204, -0.00000115, 0.00000000],
+		[-6.27325866, -0.00038008, 0.00023284, 0.00038200, -0.00000115, 0.00000000],
+		[-6.27325877, -0.00038004, 0.00023281, 0.00038195, -0.00000115, 0.00000000],
+		[-6.27325888, -0.00037999, 0.00023279, 0.00038190, -0.00000115, 0.00000000],
+		[-6.27325899, -0.00037994, 0.00023276, 0.00038186, -0.00000115, 0.00000000],
+		[-6.27325910, -0.00037990, 0.00023273, 0.00038181, -0.00000115, 0.00000000],
+		[-6.27325921, -0.00037985, 0.00023270, 0.00038176, -0.00000115, 0.00000000],
+		[-6.27325932, -0.00037980, 0.00023267, 0.00038172, -0.00000115, 0.00000000],
+		[-6.27325944, -0.00037976, 0.00023264, 0.00038167, -0.00000115, 0.00000000],
+		[-6.27325955, -0.00037971, 0.00023261, 0.00038162, -0.00000115, 0.00000000],
+		[-6.27325966, -0.00037966, 0.00023259, 0.00038158, -0.00000115, 0.00000000],
+		[-6.27325977, -0.00037962, 0.00023256, 0.00038153, -0.00000115, 0.00000000],
+		[-6.27325988, -0.00037957, 0.00023253, 0.00038148, -0.00000115, 0.00000000],
+		[-6.27325999, -0.00037953, 0.00023250, 0.00038144, -0.00000115, 0.00000000],
+		[-6.27326011, -0.00037948, 0.00023247, 0.00038139, -0.00000115, 0.00000000],
+		[-6.27326022, -0.00037943, 0.00023244, 0.00038134, -0.00000115, 0.00000000],
+		[-6.27326033, -0.00037939, 0.00023241, 0.00038129, -0.00000115, 0.00000000],
+		[-6.27326044, -0.00037934, 0.00023239, 0.00038125, -0.00000115, 0.00000000],
+		[-6.27326055, -0.00037929, 0.00023236, 0.00038120, -0.00000115, 0.00000000],
+		[-6.27326066, -0.00037925, 0.00023233, 0.00038115, -0.00000115, 0.00000000],
+		[-6.27326077, -0.00037920, 0.00023230, 0.00038111, -0.00000115, 0.00000000],
+		[-6.27326088, -0.00037915, 0.00023227, 0.00038106, -0.00000115, 0.00000000],
+		[-6.27326100, -0.00037911, 0.00023224, 0.00038101, -0.00000115, 0.00000000],
+		[-6.27326111, -0.00037906, 0.00023221, 0.00038097, -0.00000115, 0.00000000],
+		[-6.27326122, -0.00037901, 0.00023219, 0.00038092, -0.00000115, 0.00000000],
+		[-6.27326133, -0.00037897, 0.00023216, 0.00038087, -0.00000115, 0.00000000],
+		[-6.27326144, -0.00037892, 0.00023213, 0.00038083, -0.00000115, 0.00000000],
+		[-6.27326155, -0.00037887, 0.00023210, 0.00038078, -0.00000115, 0.00000000],
+		[-6.27326166, -0.00037883, 0.00023207, 0.00038073, -0.00000115, 0.00000000],
+		[-6.27326177, -0.00037878, 0.00023204, 0.00038069, -0.00000115, 0.00000000],
+		[-6.27326188, -0.00037874, 0.00023202, 0.00038064, -0.00000115, 0.00000000],
+		[-6.27326199, -0.00037869, 0.00023199, 0.00038060, -0.00000115, 0.00000000],
+		[-6.27326211, -0.00037864, 0.00023196, 0.00038055, -0.00000115, 0.00000000],
+		[-6.27326222, -0.00037860, 0.00023193, 0.00038050, -0.00000115, 0.00000000],
+		[-6.27326233, -0.00037855, 0.00023190, 0.00038046, -0.00000115, 0.00000000],
+		[-6.27326244, -0.00037850, 0.00023187, 0.00038041, -0.00000115, 0.00000000],
+		[-6.27326255, -0.00037846, 0.00023185, 0.00038036, -0.00000115, 0.00000000],
+		[-6.27326266, -0.00037841, 0.00023182, 0.00038032, -0.00000115, 0.00000000],
+		[-6.27326277, -0.00037837, 0.00023179, 0.00038027, -0.00000115, 0.00000000],
+		[-6.27326288, -0.00037832, 0.00023176, 0.00038022, -0.00000115, 0.00000000],
+		[-6.27326299, -0.00037827, 0.00023173, 0.00038018, -0.00000115, 0.00000000],
+		[-6.27326310, -0.00037823, 0.00023170, 0.00038013, -0.00000115, 0.00000000],
+		[-6.27326321, -0.00037818, 0.00023168, 0.00038008, -0.00000115, 0.00000000],
+		[-6.27326332, -0.00037813, 0.00023165, 0.00038004, -0.00000115, 0.00000000],
+		[-6.27326343, -0.00037809, 0.00023162, 0.00037999, -0.00000115, 0.00000000],
+		[-6.27326354, -0.00037804, 0.00023159, 0.00037994, -0.00000115, 0.00000000],
+		[-6.27326366, -0.00037800, 0.00023156, 0.00037990, -0.00000115, 0.00000000],
+		[-6.27326377, -0.00037795, 0.00023153, 0.00037985, -0.00000115, 0.00000000],
+		[-6.27326388, -0.00037790, 0.00023151, 0.00037981, -0.00000115, 0.00000000],
+		[-6.27326399, -0.00037786, 0.00023148, 0.00037976, -0.00000115, 0.00000000],
+		[-6.27326410, -0.00037781, 0.00023145, 0.00037971, -0.00000115, 0.00000000],
+		[-6.27326421, -0.00037777, 0.00023142, 0.00037967, -0.00000115, 0.00000000],
+		[-6.27326432, -0.00037772, 0.00023139, 0.00037962, -0.00000115, 0.00000000],
+		[-6.27326443, -0.00037767, 0.00023136, 0.00037957, -0.00000115, 0.00000000],
+		[-6.27326454, -0.00037763, 0.00023134, 0.00037953, -0.00000115, 0.00000000],
+		[-6.27326465, -0.00037758, 0.00023131, 0.00037948, -0.00000115, 0.00000000],
+		[-6.27326476, -0.00037753, 0.00023128, 0.00037943, -0.00000115, 0.00000000],
+		[-6.27326487, -0.00037749, 0.00023125, 0.00037939, -0.00000115, 0.00000000],
+		[-6.27326498, -0.00037744, 0.00023122, 0.00037934, -0.00000115, 0.00000000],
+		[-6.27326509, -0.00037740, 0.00023120, 0.00037930, -0.00000115, 0.00000000],
+		[-6.27326520, -0.00037735, 0.00023117, 0.00037925, -0.00000115, 0.00000000],
+		[-6.27326531, -0.00037730, 0.00023114, 0.00037920, -0.00000115, 0.00000000],
+		[-6.27326542, -0.00037726, 0.00023111, 0.00037916, -0.00000115, 0.00000000],
+		[-6.27326553, -0.00037721, 0.00023108, 0.00037911, -0.00000115, 0.00000000],
+		[-6.27326564, -0.00037717, 0.00023105, 0.00037906, -0.00000115, 0.00000000],
+		[-6.27326575, -0.00037712, 0.00023103, 0.00037902, -0.00000115, 0.00000000],
+		[-6.27326586, -0.00037707, 0.00023100, 0.00037897, -0.00000115, 0.00000000],
+		[-6.27326597, -0.00037703, 0.00023097, 0.00037893, -0.00000115, 0.00000000],
+		[-6.27326608, -0.00037698, 0.00023094, 0.00037888, -0.00000115, 0.00000000],
+		[-6.27326619, -0.00037694, 0.00023091, 0.00037883, -0.00000115, 0.00000000],
+		[-6.27326630, -0.00037689, 0.00023089, 0.00037879, -0.00000115, 0.00000000],
+		[-6.27326641, -0.00037685, 0.00023086, 0.00037874, -0.00000115, 0.00000000],
+		[-6.27326652, -0.00037680, 0.00023083, 0.00037870, -0.00000115, 0.00000000],
+		[-6.27326663, -0.00037675, 0.00023080, 0.00037865, -0.00000115, 0.00000000],
+		[-6.27326674, -0.00037671, 0.00023077, 0.00037860, -0.00000115, 0.00000000],
+		[-6.27326685, -0.00037666, 0.00023074, 0.00037856, -0.00000115, 0.00000000],
+		[-6.27326696, -0.00037662, 0.00023072, 0.00037851, -0.00000115, 0.00000000],
+		[-6.27326707, -0.00037657, 0.00023069, 0.00037847, -0.00000115, 0.00000000],
+		[-6.27326718, -0.00037652, 0.00023066, 0.00037842, -0.00000115, 0.00000000],
+		[-6.27326729, -0.00037648, 0.00023063, 0.00037837, -0.00000115, 0.00000000],
+		[-6.27326740, -0.00037643, 0.00023060, 0.00037833, -0.00000115, 0.00000000],
+		[-6.27326751, -0.00037639, 0.00023058, 0.00037828, -0.00000115, 0.00000000],
+		[-6.27326762, -0.00037634, 0.00023055, 0.00037823, -0.00000115, 0.00000000],
+		[-6.27326773, -0.00037630, 0.00023052, 0.00037819, -0.00000115, 0.00000000],
+		[-6.27326783, -0.00037625, 0.00023049, 0.00037814, -0.00000115, 0.00000000],
+		[-6.27326794, -0.00037620, 0.00023046, 0.00037810, -0.00000115, 0.00000000],
+		[-6.27326805, -0.00037616, 0.00023044, 0.00037805, -0.00000115, 0.00000000],
+		[-6.27326816, -0.00037611, 0.00023041, 0.00037801, -0.00000115, 0.00000000],
+		[-6.27326827, -0.00037607, 0.00023038, 0.00037796, -0.00000115, 0.00000000],
+		[-6.27326838, -0.00037602, 0.00023035, 0.00037791, -0.00000115, 0.00000000],
+		[-6.27326849, -0.00037598, 0.00023032, 0.00037787, -0.00000115, 0.00000000],
+		[-6.27326860, -0.00037593, 0.00023030, 0.00037782, -0.00000115, 0.00000000],
+		[-6.27326871, -0.00037588, 0.00023027, 0.00037778, -0.00000115, 0.00000000],
+		[-6.27326882, -0.00037584, 0.00023024, 0.00037773, -0.00000115, 0.00000000],
+		[-6.27326893, -0.00037579, 0.00023021, 0.00037768, -0.00000115, 0.00000000],
+		[-6.27326904, -0.00037575, 0.00023018, 0.00037764, -0.00000115, 0.00000000],
+		[-6.27326915, -0.00037570, 0.00023016, 0.00037759, -0.00000115, 0.00000000],
+		[-6.27326926, -0.00037566, 0.00023013, 0.00037755, -0.00000115, 0.00000000],
+		[-6.27326937, -0.00037561, 0.00023010, 0.00037750, -0.00000115, 0.00000000],
+		[-6.27326947, -0.00037557, 0.00023007, 0.00037745, -0.00000115, 0.00000000],
+		[-6.27326958, -0.00037552, 0.00023004, 0.00037741, -0.00000115, 0.00000000],
+		[-6.27326969, -0.00037547, 0.00023002, 0.00037736, -0.00000115, 0.00000000],
+		[-6.27326980, -0.00037543, 0.00022999, 0.00037732, -0.00000115, 0.00000000],
+		[-6.27326991, -0.00037538, 0.00022996, 0.00037727, -0.00000115, 0.00000000],
+		[-6.27327002, -0.00037534, 0.00022993, 0.00037723, -0.00000115, 0.00000000],
+		[-6.27327013, -0.00037529, 0.00022991, 0.00037718, -0.00000115, 0.00000000],
+		[-6.27327024, -0.00037525, 0.00022988, 0.00037713, -0.00000115, 0.00000000],
+		[-6.27327035, -0.00037520, 0.00022985, 0.00037709, -0.00000115, 0.00000000],
+		[-6.27327045, -0.00037516, 0.00022982, 0.00037704, -0.00000115, 0.00000000],
+		[-6.27327056, -0.00037511, 0.00022979, 0.00037700, -0.00000115, 0.00000000],
+		[-6.27327067, -0.00037506, 0.00022977, 0.00037695, -0.00000115, 0.00000000],
+		[-6.27327078, -0.00037502, 0.00022974, 0.00037691, -0.00000115, 0.00000000],
+		[-6.27327089, -0.00037497, 0.00022971, 0.00037686, -0.00000115, 0.00000000],
+		[-6.27327100, -0.00037493, 0.00022968, 0.00037681, -0.00000115, 0.00000000],
+		[-6.27327111, -0.00037488, 0.00022965, 0.00037677, -0.00000115, 0.00000000],
+		[-6.27327122, -0.00037484, 0.00022963, 0.00037672, -0.00000115, 0.00000000],
+		[-6.27327132, -0.00037479, 0.00022960, 0.00037668, -0.00000115, 0.00000000],
+		[-6.27327143, -0.00037475, 0.00022957, 0.00037663, -0.00000115, 0.00000000],
+		[-6.27327154, -0.00037470, 0.00022954, 0.00037659, -0.00000115, 0.00000000],
+		[-6.27327165, -0.00037466, 0.00022952, 0.00037654, -0.00000115, 0.00000000],
+		[-6.27327176, -0.00037461, 0.00022949, 0.00037650, -0.00000115, 0.00000000],
+		[-6.27327187, -0.00037457, 0.00022946, 0.00037645, -0.00000115, 0.00000000],
+		[-6.27327198, -0.00037452, 0.00022943, 0.00037640, -0.00000115, 0.00000000],
+		[-6.27327208, -0.00037447, 0.00022940, 0.00037636, -0.00000115, 0.00000000],
+		[-6.27327219, -0.00037443, 0.00022938, 0.00037631, -0.00000115, 0.00000000],
+		[-6.27327230, -0.00037438, 0.00022935, 0.00037627, -0.00000115, 0.00000000],
+		[-6.27327241, -0.00037434, 0.00022932, 0.00037622, -0.00000115, 0.00000000],
+		[-6.27327252, -0.00037429, 0.00022929, 0.00037618, -0.00000115, 0.00000000],
+		[-6.27327263, -0.00037425, 0.00022927, 0.00037613, -0.00000115, 0.00000000],
+		[-6.27327273, -0.00037420, 0.00022924, 0.00037609, -0.00000115, 0.00000000],
+		[-6.27327284, -0.00037416, 0.00022921, 0.00037604, -0.00000115, 0.00000000],
+		[-6.27327295, -0.00037411, 0.00022918, 0.00037599, -0.00000115, 0.00000000],
+		[-6.27327306, -0.00037407, 0.00022915, 0.00037595, -0.00000115, 0.00000000],
+		[-6.27327317, -0.00037402, 0.00022913, 0.00037590, -0.00000115, 0.00000000],
+		[-6.27327328, -0.00037398, 0.00022910, 0.00037586, -0.00000115, 0.00000000],
+		[-6.27327338, -0.00037393, 0.00022907, 0.00037581, -0.00000115, 0.00000000],
+		[-6.27327349, -0.00037389, 0.00022904, 0.00037577, -0.00000115, 0.00000000],
+		[-6.27327360, -0.00037384, 0.00022902, 0.00037572, -0.00000115, 0.00000000],
+		[-6.27327371, -0.00037380, 0.00022899, 0.00037568, -0.00000115, 0.00000000],
+		[-6.27327382, -0.00037375, 0.00022896, 0.00037563, -0.00000115, 0.00000000],
+		[-6.27327392, -0.00037371, 0.00022893, 0.00037559, -0.00000115, 0.00000000],
+		[-6.27327403, -0.00037366, 0.00022891, 0.00037554, -0.00000115, 0.00000000],
+		[-6.27327414, -0.00037362, 0.00022888, 0.00037550, -0.00000115, 0.00000000],
+		[-6.27327425, -0.00037357, 0.00022885, 0.00037545, -0.00000115, 0.00000000],
+		[-6.27327436, -0.00037353, 0.00022882, 0.00037541, -0.00000115, 0.00000000],
+		[-6.27327446, -0.00037348, 0.00022880, 0.00037536, -0.00000115, 0.00000000],
+		[-6.27327457, -0.00037344, 0.00022877, 0.00037531, -0.00000115, 0.00000000],
+		[-6.27327468, -0.00037339, 0.00022874, 0.00037527, -0.00000115, 0.00000000],
+		[-6.27327479, -0.00037335, 0.00022871, 0.00037522, -0.00000115, 0.00000000],
+		[-6.27327490, -0.00037330, 0.00022868, 0.00037518, -0.00000115, 0.00000000],
+		[-6.27327500, -0.00037326, 0.00022866, 0.00037513, -0.00000115, 0.00000000],
+		[-6.27327511, -0.00037321, 0.00022863, 0.00037509, -0.00000115, 0.00000000],
+		[-6.27327522, -0.00037317, 0.00022860, 0.00037504, -0.00000115, 0.00000000],
+		[-6.27327533, -0.00037312, 0.00022857, 0.00037500, -0.00000115, 0.00000000],
+		[-6.27327543, -0.00037308, 0.00022855, 0.00037495, -0.00000115, 0.00000000],
+		[-6.27327554, -0.00037303, 0.00022852, 0.00037491, -0.00000115, 0.00000000],
+		[-6.27327565, -0.00037299, 0.00022849, 0.00037486, -0.00000115, 0.00000000],
+		[-6.27327576, -0.00037294, 0.00022846, 0.00037482, -0.00000115, 0.00000000],
+		[-6.27327586, -0.00037290, 0.00022844, 0.00037477, -0.00000115, 0.00000000],
+		[-6.27327597, -0.00037285, 0.00022841, 0.00037473, -0.00000115, 0.00000000],
+		[-6.27327608, -0.00037281, 0.00022838, 0.00037468, -0.00000115, 0.00000000],
+		[-6.27327619, -0.00037276, 0.00022835, 0.00037464, -0.00000115, 0.00000000],
+		[-6.27327629, -0.00037272, 0.00022833, 0.00037459, -0.00000115, 0.00000000],
+		[-6.27327640, -0.00037267, 0.00022830, 0.00037455, -0.00000115, 0.00000000],
+		[-6.27327651, -0.00037263, 0.00022827, 0.00037450, -0.00000115, 0.00000000],
+		[-6.27327662, -0.00037258, 0.00022824, 0.00037446, -0.00000115, 0.00000000],
+		[-6.27327672, -0.00037254, 0.00022822, 0.00037441, -0.00000115, 0.00000000],
+		[-6.27327683, -0.00037249, 0.00022819, 0.00037437, -0.00000115, 0.00000000],
+		[-6.27327694, -0.00037245, 0.00022816, 0.00037432, -0.00000115, 0.00000000],
+		[-6.27327705, -0.00037240, 0.00022813, 0.00037428, -0.00000115, 0.00000000],
+		[-6.27327715, -0.00037236, 0.00022811, 0.00037423, -0.00000115, 0.00000000],
+		[-6.27327726, -0.00037231, 0.00022808, 0.00037419, -0.00000115, 0.00000000],
+		[-6.27327737, -0.00037227, 0.00022805, 0.00037414, -0.00000115, 0.00000000],
+		[-6.27327747, -0.00037222, 0.00022802, 0.00037410, -0.00000115, 0.00000000],
+		[-6.27327758, -0.00037218, 0.00022800, 0.00037405, -0.00000115, 0.00000000],
+		[-6.27327769, -0.00037213, 0.00022797, 0.00037401, -0.00000115, 0.00000000],
+		[-6.27327780, -0.00037209, 0.00022794, 0.00037396, -0.00000115, 0.00000000],
+		[-6.27327790, -0.00037204, 0.00022791, 0.00037392, -0.00000115, 0.00000000],
+		[-6.27327801, -0.00037200, 0.00022789, 0.00037387, -0.00000115, 0.00000000],
+		[-6.27327812, -0.00037195, 0.00022786, 0.00037383, -0.00000115, 0.00000000],
+		[-6.27327822, -0.00037191, 0.00022783, 0.00037378, -0.00000115, 0.00000000],
+		[-6.27327833, -0.00037187, 0.00022781, 0.00037374, -0.00000115, 0.00000000],
+		[-6.27327844, -0.00037182, 0.00022778, 0.00037369, -0.00000115, 0.00000000],
+		[-6.27327855, -0.00037178, 0.00022775, 0.00037365, -0.00000115, 0.00000000],
+		[-6.27327865, -0.00037173, 0.00022772, 0.00037360, -0.00000115, 0.00000000],
+		[-6.27327876, -0.00037169, 0.00022770, 0.00037356, -0.00000115, 0.00000000],
+		[-6.27327887, -0.00037164, 0.00022767, 0.00037351, -0.00000115, 0.00000000],
+		[-6.27327897, -0.00037160, 0.00022764, 0.00037347, -0.00000115, 0.00000000],
+		[-6.27327908, -0.00037155, 0.00022761, 0.00037342, -0.00000115, 0.00000000],
+		[-6.27327919, -0.00037151, 0.00022759, 0.00037338, -0.00000115, 0.00000000],
+		[-6.27327929, -0.00037146, 0.00022756, 0.00037333, -0.00000115, 0.00000000],
+		[-6.27327940, -0.00037142, 0.00022753, 0.00037329, -0.00000115, 0.00000000],
+		[-6.27327951, -0.00037137, 0.00022750, 0.00037324, -0.00000115, 0.00000000],
+		[-6.27327961, -0.00037133, 0.00022748, 0.00037320, -0.00000115, 0.00000000],
+		[-6.27327972, -0.00037129, 0.00022745, 0.00037315, -0.00000115, 0.00000000],
+		[-6.27327983, -0.00037124, 0.00022742, 0.00037311, -0.00000115, 0.00000000],
+		[-6.27327993, -0.00037120, 0.00022740, 0.00037306, -0.00000115, 0.00000000],
+		[-6.27328004, -0.00037115, 0.00022737, 0.00037302, -0.00000115, 0.00000000],
+		[-6.27328015, -0.00037111, 0.00022734, 0.00037297, -0.00000115, 0.00000000],
+		[-6.27328025, -0.00037106, 0.00022731, 0.00037293, -0.00000115, 0.00000000],
+		[-6.27328036, -0.00037102, 0.00022729, 0.00037289, -0.00000115, 0.00000000],
+		[-6.27328047, -0.00037097, 0.00022726, 0.00037284, -0.00000115, 0.00000000],
+		[-6.27328057, -0.00037093, 0.00022723, 0.00037280, -0.00000115, 0.00000000],
+		[-6.27328068, -0.00037089, 0.00022720, 0.00037275, -0.00000115, 0.00000000],
+		[-6.27328078, -0.00037084, 0.00022718, 0.00037271, -0.00000115, 0.00000000],
+		[-6.27328089, -0.00037080, 0.00022715, 0.00037266, -0.00000115, 0.00000000],
+		[-6.27328100, -0.00037075, 0.00022712, 0.00037262, -0.00000115, 0.00000000],
+		[-6.27328110, -0.00037071, 0.00022710, 0.00037257, -0.00000115, 0.00000000],
+		[-6.27328121, -0.00037066, 0.00022707, 0.00037253, -0.00000115, 0.00000000],
+		[-6.27328132, -0.00037062, 0.00022704, 0.00037248, -0.00000115, 0.00000000],
+		[-6.27328142, -0.00037057, 0.00022701, 0.00037244, -0.00000115, 0.00000000],
+		[-6.27328153, -0.00037053, 0.00022699, 0.00037239, -0.00000115, 0.00000000],
+		[-6.27328163, -0.00037049, 0.00022696, 0.00037235, -0.00000115, 0.00000000],
+		[-6.27328174, -0.00037044, 0.00022693, 0.00037230, -0.00000115, 0.00000000],
+		[-6.27328185, -0.00037040, 0.00022691, 0.00037226, -0.00000115, 0.00000000],
+		[-6.27328195, -0.00037035, 0.00022688, 0.00037222, -0.00000115, 0.00000000],
+		[-6.27328206, -0.00037031, 0.00022685, 0.00037217, -0.00000115, 0.00000000],
+		[-6.27328217, -0.00037026, 0.00022682, 0.00037213, -0.00000115, 0.00000000],
+		[-6.27328227, -0.00037022, 0.00022680, 0.00037208, -0.00000115, 0.00000000],
+		[-6.27328238, -0.00037018, 0.00022677, 0.00037204, -0.00000115, 0.00000000],
+		[-6.27328248, -0.00037013, 0.00022674, 0.00037199, -0.00000115, 0.00000000],
+		[-6.27328259, -0.00037009, 0.00022672, 0.00037195, -0.00000115, 0.00000000],
+		[-6.27328269, -0.00037004, 0.00022669, 0.00037190, -0.00000115, 0.00000000],
+		[-6.27328280, -0.00037000, 0.00022666, 0.00037186, -0.00000115, 0.00000000],
+		[-6.27328291, -0.00036995, 0.00022663, 0.00037182, -0.00000115, 0.00000000],
+		[-6.27328301, -0.00036991, 0.00022661, 0.00037177, -0.00000115, 0.00000000],
+		[-6.27328312, -0.00036987, 0.00022658, 0.00037173, -0.00000115, 0.00000000],
+		[-6.27328322, -0.00036982, 0.00022655, 0.00037168, -0.00000115, 0.00000000],
+		[-6.27328333, -0.00036978, 0.00022653, 0.00037164, -0.00000115, 0.00000000],
+		[-6.27328344, -0.00036973, 0.00022650, 0.00037159, -0.00000115, 0.00000000],
+		[-6.27328354, -0.00036969, 0.00022647, 0.00037155, -0.00000115, 0.00000000],
+		[-6.27328365, -0.00036965, 0.00022644, 0.00037150, -0.00000115, 0.00000000],
+		[-6.27328375, -0.00036960, 0.00022642, 0.00037146, -0.00000115, 0.00000000],
+		[-6.27328386, -0.00036956, 0.00022639, 0.00037142, -0.00000115, 0.00000000],
+		[-6.27328396, -0.00036951, 0.00022636, 0.00037137, -0.00000115, 0.00000000],
+		[-6.27328407, -0.00036947, 0.00022634, 0.00037133, -0.00000115, 0.00000000],
+		[-6.27328418, -0.00036942, 0.00022631, 0.00037128, -0.00000115, 0.00000000],
+		[-6.27328428, -0.00036938, 0.00022628, 0.00037124, -0.00000115, 0.00000000],
+		[-6.27328439, -0.00036934, 0.00022626, 0.00037119, -0.00000115, 0.00000000],
+		[-6.27328449, -0.00036929, 0.00022623, 0.00037115, -0.00000115, 0.00000000],
+		[-6.27328460, -0.00036925, 0.00022620, 0.00037111, -0.00000115, 0.00000000],
+		[-6.27328470, -0.00036920, 0.00022617, 0.00037106, -0.00000115, 0.00000000],
+		[-6.27328481, -0.00036916, 0.00022615, 0.00037102, -0.00000115, 0.00000000],
+		[-6.27328491, -0.00036912, 0.00022612, 0.00037097, -0.00000115, 0.00000000],
+		[-6.27328502, -0.00036907, 0.00022609, 0.00037093, -0.00000115, 0.00000000],
+		[-6.27328512, -0.00036903, 0.00022607, 0.00037088, -0.00000115, 0.00000000],
+		[-6.27328523, -0.00036898, 0.00022604, 0.00037084, -0.00000115, 0.00000000],
+		[-6.27328533, -0.00036894, 0.00022601, 0.00037080, -0.00000115, 0.00000000],
+		[-6.27328544, -0.00036890, 0.00022599, 0.00037075, -0.00000115, 0.00000000],
+		[-6.27328555, -0.00036885, 0.00022596, 0.00037071, -0.00000115, 0.00000000],
+		[-6.27328565, -0.00036881, 0.00022593, 0.00037066, -0.00000115, 0.00000000],
+		[-6.27328576, -0.00036876, 0.00022590, 0.00037062, -0.00000115, 0.00000000],
+		[-6.27328586, -0.00036872, 0.00022588, 0.00037058, -0.00000115, 0.00000000],
+		[-6.27328597, -0.00036868, 0.00022585, 0.00037053, -0.00000115, 0.00000000],
+		[-6.27328607, -0.00036863, 0.00022582, 0.00037049, -0.00000115, 0.00000000],
+		[-6.27328618, -0.00036859, 0.00022580, 0.00037044, -0.00000115, 0.00000000],
+		[-6.27328628, -0.00036855, 0.00022577, 0.00037040, -0.00000115, 0.00000000],
+		[-6.27328639, -0.00036850, 0.00022574, 0.00037035, -0.00000115, 0.00000000],
+		[-6.27328649, -0.00036846, 0.00022572, 0.00037031, -0.00000115, 0.00000000],
+		[-6.27328660, -0.00036841, 0.00022569, 0.00037027, -0.00000115, 0.00000000],
+		[-6.27328670, -0.00036837, 0.00022566, 0.00037022, -0.00000115, 0.00000000],
+		[-6.27328681, -0.00036833, 0.00022564, 0.00037018, -0.00000115, 0.00000000],
+		[-6.27328691, -0.00036828, 0.00022561, 0.00037013, -0.00000115, 0.00000000],
+		[-6.27328702, -0.00036824, 0.00022558, 0.00037009, -0.00000115, 0.00000000],
+		[-6.27328712, -0.00036819, 0.00022556, 0.00037005, -0.00000115, 0.00000000],
+		[-6.27328723, -0.00036815, 0.00022553, 0.00037000, -0.00000115, 0.00000000],
+		[-6.27328733, -0.00036811, 0.00022550, 0.00036996, -0.00000115, 0.00000000],
+		[-6.27328744, -0.00036806, 0.00022547, 0.00036991, -0.00000115, 0.00000000],
+		[-6.27328754, -0.00036802, 0.00022545, 0.00036987, -0.00000115, 0.00000000],
+		[-6.27328764, -0.00036798, 0.00022542, 0.00036983, -0.00000115, 0.00000000],
+		[-6.27328775, -0.00036793, 0.00022539, 0.00036978, -0.00000115, 0.00000000],
+		[-6.27328785, -0.00036789, 0.00022537, 0.00036974, -0.00000115, 0.00000000],
+		[-6.27328796, -0.00036784, 0.00022534, 0.00036969, -0.00000115, 0.00000000],
+		[-6.27328806, -0.00036780, 0.00022531, 0.00036965, -0.00000115, 0.00000000],
+		[-6.27328817, -0.00036776, 0.00022529, 0.00036961, -0.00000115, 0.00000000],
+		[-6.27328827, -0.00036771, 0.00022526, 0.00036956, -0.00000115, 0.00000000],
+		[-6.27328838, -0.00036767, 0.00022523, 0.00036952, -0.00000115, 0.00000000],
+		[-6.27328848, -0.00036763, 0.00022521, 0.00036947, -0.00000115, 0.00000000],
+		[-6.27328859, -0.00036758, 0.00022518, 0.00036943, -0.00000115, 0.00000000],
+		[-6.27328869, -0.00036754, 0.00022515, 0.00036939, -0.00000115, 0.00000000],
+		[-6.27328880, -0.00036749, 0.00022513, 0.00036934, -0.00000115, 0.00000000],
+		[-6.27328890, -0.00036745, 0.00022510, 0.00036930, -0.00000115, 0.00000000],
+		[-6.27328900, -0.00036741, 0.00022507, 0.00036926, -0.00000115, 0.00000000],
+		[-6.27328911, -0.00036736, 0.00022505, 0.00036921, -0.00000115, 0.00000000],
+		[-6.27328921, -0.00036732, 0.00022502, 0.00036917, -0.00000115, 0.00000000],
+		[-6.27328932, -0.00036728, 0.00022499, 0.00036912, -0.00000115, 0.00000000],
+		[-6.27328942, -0.00036723, 0.00022497, 0.00036908, -0.00000115, 0.00000000],
+		[-6.27328953, -0.00036719, 0.00022494, 0.00036904, -0.00000115, 0.00000000],
+		[-6.27328963, -0.00036715, 0.00022491, 0.00036899, -0.00000115, 0.00000000],
+		[-6.27328973, -0.00036710, 0.00022489, 0.00036895, -0.00000115, 0.00000000],
+		[-6.27328984, -0.00036706, 0.00022486, 0.00036891, -0.00000115, 0.00000000],
+		[-6.27328994, -0.00036702, 0.00022483, 0.00036886, -0.00000115, 0.00000000],
+		[-6.27329005, -0.00036697, 0.00022481, 0.00036882, -0.00000115, 0.00000000],
+		[-6.27329015, -0.00036693, 0.00022478, 0.00036877, -0.00000115, 0.00000000],
+		[-6.27329025, -0.00036689, 0.00022475, 0.00036873, -0.00000115, 0.00000000],
+		[-6.27329036, -0.00036684, 0.00022473, 0.00036869, -0.00000115, 0.00000000],
+		[-6.27329046, -0.00036680, 0.00022470, 0.00036864, -0.00000115, 0.00000000],
+		[-6.27329057, -0.00036675, 0.00022467, 0.00036860, -0.00000115, 0.00000000],
+		[-6.27329067, -0.00036671, 0.00022465, 0.00036856, -0.00000115, 0.00000000],
+		[-6.27329078, -0.00036667, 0.00022462, 0.00036851, -0.00000115, 0.00000000],
+		[-6.27329088, -0.00036662, 0.00022459, 0.00036847, -0.00000115, 0.00000000],
+		[-6.27329098, -0.00036658, 0.00022457, 0.00036842, -0.00000115, 0.00000000],
+		[-6.27329109, -0.00036654, 0.00022454, 0.00036838, -0.00000115, 0.00000000],
+		[-6.27329119, -0.00036649, 0.00022451, 0.00036834, -0.00000115, 0.00000000],
+		[-6.27329129, -0.00036645, 0.00022449, 0.00036829, -0.00000115, 0.00000000],
+		[-6.27329140, -0.00036641, 0.00022446, 0.00036825, -0.00000115, 0.00000000],
+		[-6.27329150, -0.00036636, 0.00022443, 0.00036821, -0.00000115, 0.00000000],
+		[-6.27329161, -0.00036632, 0.00022441, 0.00036816, -0.00000115, 0.00000000],
+		[-6.27329171, -0.00036628, 0.00022438, 0.00036812, -0.00000115, 0.00000000],
+		[-6.27329181, -0.00036623, 0.00022435, 0.00036808, -0.00000115, 0.00000000],
+		[-6.27329192, -0.00036619, 0.00022433, 0.00036803, -0.00000115, 0.00000000],
+		[-6.27329202, -0.00036615, 0.00022430, 0.00036799, -0.00000115, 0.00000000],
+		[-6.27329212, -0.00036610, 0.00022427, 0.00036795, -0.00000115, 0.00000000],
+		[-6.27329223, -0.00036606, 0.00022425, 0.00036790, -0.00000115, 0.00000000],
+		[-6.27329233, -0.00036602, 0.00022422, 0.00036786, -0.00000115, 0.00000000],
+		[-6.27329244, -0.00036597, 0.00022419, 0.00036781, -0.00000115, 0.00000000],
+		[-6.27329254, -0.00036593, 0.00022417, 0.00036777, -0.00000115, 0.00000000],
+		[-6.27329264, -0.00036589, 0.00022414, 0.00036773, -0.00000115, 0.00000000],
+		[-6.27329275, -0.00036584, 0.00022412, 0.00036768, -0.00000115, 0.00000000],
+		[-6.27329285, -0.00036580, 0.00022409, 0.00036764, -0.00000115, 0.00000000],
+		[-6.27329295, -0.00036576, 0.00022406, 0.00036760, -0.00000115, 0.00000000],
+		[-6.27329306, -0.00036571, 0.00022404, 0.00036755, -0.00000115, 0.00000000],
+		[-6.27329316, -0.00036567, 0.00022401, 0.00036751, -0.00000115, 0.00000000],
+		[-6.27329326, -0.00036563, 0.00022398, 0.00036747, -0.00000115, 0.00000000],
+		[-6.27329337, -0.00036559, 0.00022396, 0.00036742, -0.00000115, 0.00000000],
+		[-6.27329347, -0.00036554, 0.00022393, 0.00036738, -0.00000115, 0.00000000],
+		[-6.27329357, -0.00036550, 0.00022390, 0.00036734, -0.00000115, 0.00000000],
+		[-6.27329368, -0.00036546, 0.00022388, 0.00036729, -0.00000115, 0.00000000],
+		[-6.27329378, -0.00036541, 0.00022385, 0.00036725, -0.00000115, 0.00000000],
+		[-6.27329388, -0.00036537, 0.00022382, 0.00036721, -0.00000115, 0.00000000],
+		[-6.27329399, -0.00036533, 0.00022380, 0.00036716, -0.00000115, 0.00000000],
+		[-6.27329409, -0.00036528, 0.00022377, 0.00036712, -0.00000115, 0.00000000],
+		[-6.27329419, -0.00036524, 0.00022374, 0.00036708, -0.00000115, 0.00000000],
+		[-6.27329430, -0.00036520, 0.00022372, 0.00036703, -0.00000115, 0.00000000],
+		[-6.27329440, -0.00036515, 0.00022369, 0.00036699, -0.00000115, 0.00000000],
+		[-6.27329450, -0.00036511, 0.00022367, 0.00036695, -0.00000115, 0.00000000],
+		[-6.27329461, -0.00036507, 0.00022364, 0.00036690, -0.00000115, 0.00000000],
+		[-6.27329471, -0.00036502, 0.00022361, 0.00036686, -0.00000115, 0.00000000],
+		[-6.27329481, -0.00036498, 0.00022359, 0.00036682, -0.00000115, 0.00000000],
+		[-6.27329491, -0.00036494, 0.00022356, 0.00036677, -0.00000115, 0.00000000],
+		[-6.27329502, -0.00036490, 0.00022353, 0.00036673, -0.00000115, 0.00000000],
+		[-6.27329512, -0.00036485, 0.00022351, 0.00036669, -0.00000115, 0.00000000],
+		[-6.27329522, -0.00036481, 0.00022348, 0.00036664, -0.00000115, 0.00000000],
+		[-6.27329533, -0.00036477, 0.00022345, 0.00036660, -0.00000115, 0.00000000],
+		[-6.27329543, -0.00036472, 0.00022343, 0.00036656, -0.00000115, 0.00000000],
+		[-6.27329553, -0.00036468, 0.00022340, 0.00036651, -0.00000115, 0.00000000],
+		[-6.27329564, -0.00036464, 0.00022338, 0.00036647, -0.00000115, 0.00000000],
+		[-6.27329574, -0.00036460, 0.00022335, 0.00036643, -0.00000115, 0.00000000],
+		[-6.27329584, -0.00036455, 0.00022332, 0.00036639, -0.00000115, 0.00000000],
+		[-6.27329594, -0.00036451, 0.00022330, 0.00036634, -0.00000115, 0.00000000],
+		[-6.27329605, -0.00036447, 0.00022327, 0.00036630, -0.00000115, 0.00000000],
+		[-6.27329615, -0.00036442, 0.00022324, 0.00036626, -0.00000115, 0.00000000],
+		[-6.27329625, -0.00036438, 0.00022322, 0.00036621, -0.00000115, 0.00000000],
+		[-6.27329635, -0.00036434, 0.00022319, 0.00036617, -0.00000115, 0.00000000],
+		[-6.27329646, -0.00036429, 0.00022317, 0.00036613, -0.00000115, 0.00000000],
+		[-6.27329656, -0.00036425, 0.00022314, 0.00036608, -0.00000115, 0.00000000],
+		[-6.27329666, -0.00036421, 0.00022311, 0.00036604, -0.00000115, 0.00000000],
+		[-6.27329677, -0.00036417, 0.00022309, 0.00036600, -0.00000115, 0.00000000],
+		[-6.27329687, -0.00036412, 0.00022306, 0.00036595, -0.00000115, 0.00000000],
+		[-6.27329697, -0.00036408, 0.00022303, 0.00036591, -0.00000115, 0.00000000],
+		[-6.27329707, -0.00036404, 0.00022301, 0.00036587, -0.00000115, 0.00000000],
+		[-6.27329718, -0.00036399, 0.00022298, 0.00036583, -0.00000115, 0.00000000],
+		[-6.27329728, -0.00036395, 0.00022296, 0.00036578, -0.00000115, 0.00000000],
+		[-6.27329738, -0.00036391, 0.00022293, 0.00036574, -0.00000115, 0.00000000],
+		[-6.27329748, -0.00036387, 0.00022290, 0.00036570, -0.00000115, 0.00000000],
+		[-6.27329758, -0.00036382, 0.00022288, 0.00036565, -0.00000115, 0.00000000],
+		[-6.27329769, -0.00036378, 0.00022285, 0.00036561, -0.00000115, 0.00000000],
+		[-6.27329779, -0.00036374, 0.00022282, 0.00036557, -0.00000115, 0.00000000],
+		[-6.27329789, -0.00036370, 0.00022280, 0.00036552, -0.00000115, 0.00000000],
+		[-6.27329799, -0.00036365, 0.00022277, 0.00036548, -0.00000115, 0.00000000],
+		[-6.27329810, -0.00036361, 0.00022275, 0.00036544, -0.00000115, 0.00000000],
+		[-6.27329820, -0.00036357, 0.00022272, 0.00036540, -0.00000115, 0.00000000],
+		[-6.27329830, -0.00036352, 0.00022269, 0.00036535, -0.00000115, 0.00000000],
+		[-6.27329840, -0.00036348, 0.00022267, 0.00036531, -0.00000115, 0.00000000],
+		[-6.27329851, -0.00036344, 0.00022264, 0.00036527, -0.00000115, 0.00000000],
+		[-6.27329861, -0.00036340, 0.00022261, 0.00036522, -0.00000115, 0.00000000],
+		[-6.27329871, -0.00036335, 0.00022259, 0.00036518, -0.00000115, 0.00000000],
+		[-6.27329881, -0.00036331, 0.00022256, 0.00036514, -0.00000115, 0.00000000],
+		[-6.27329891, -0.00036327, 0.00022254, 0.00036510, -0.00000115, 0.00000000],
+		[-6.27329902, -0.00036323, 0.00022251, 0.00036505, -0.00000115, 0.00000000],
+		[-6.27329912, -0.00036318, 0.00022248, 0.00036501, -0.00000115, 0.00000000],
+		[-6.27329922, -0.00036314, 0.00022246, 0.00036497, -0.00000115, 0.00000000],
+		[-6.27329932, -0.00036310, 0.00022243, 0.00036492, -0.00000115, 0.00000000],
+		[-6.27329942, -0.00036306, 0.00022241, 0.00036488, -0.00000115, 0.00000000],
+		[-6.27329953, -0.00036301, 0.00022238, 0.00036484, -0.00000115, 0.00000000],
+		[-6.27329963, -0.00036297, 0.00022235, 0.00036480, -0.00000115, 0.00000000],
+		[-6.27329973, -0.00036293, 0.00022233, 0.00036475, -0.00000115, 0.00000000],
+		[-6.27329983, -0.00036289, 0.00022230, 0.00036471, -0.00000115, 0.00000000],
+		[-6.27329993, -0.00036284, 0.00022228, 0.00036467, -0.00000115, 0.00000000],
+		[-6.27330004, -0.00036280, 0.00022225, 0.00036462, -0.00000115, 0.00000000],
+		[-6.27330014, -0.00036276, 0.00022222, 0.00036458, -0.00000115, 0.00000000],
+		[-6.27330024, -0.00036272, 0.00022220, 0.00036454, -0.00000115, 0.00000000],
+		[-6.27330034, -0.00036267, 0.00022217, 0.00036450, -0.00000115, 0.00000000],
+		[-6.27330044, -0.00036263, 0.00022215, 0.00036445, -0.00000115, 0.00000000],
+		[-6.27330054, -0.00036259, 0.00022212, 0.00036441, -0.00000115, 0.00000000],
+		[-6.27330065, -0.00036255, 0.00022209, 0.00036437, -0.00000115, 0.00000000],
+		[-6.27330075, -0.00036250, 0.00022207, 0.00036433, -0.00000115, 0.00000000],
+		[-6.27330085, -0.00036246, 0.00022204, 0.00036428, -0.00000115, 0.00000000],
+		[-6.27330095, -0.00036242, 0.00022202, 0.00036424, -0.00000115, 0.00000000],
+		[-6.27330105, -0.00036238, 0.00022199, 0.00036420, -0.00000115, 0.00000000],
+		[-6.27330115, -0.00036233, 0.00022196, 0.00036416, -0.00000115, 0.00000000],
+		[-6.27330126, -0.00036229, 0.00022194, 0.00036411, -0.00000115, 0.00000000],
+		[-6.27330136, -0.00036225, 0.00022191, 0.00036407, -0.00000115, 0.00000000],
+		[-6.27330146, -0.00036221, 0.00022189, 0.00036403, -0.00000115, 0.00000000],
+		[-6.27330156, -0.00036216, 0.00022186, 0.00036398, -0.00000115, 0.00000000],
+		[-6.27330166, -0.00036212, 0.00022183, 0.00036394, -0.00000115, 0.00000000],
+		[-6.27330176, -0.00036208, 0.00022181, 0.00036390, -0.00000115, 0.00000000],
+		[-6.27330186, -0.00036204, 0.00022178, 0.00036386, -0.00000115, 0.00000000],
+		[-6.27330197, -0.00036199, 0.00022176, 0.00036381, -0.00000115, 0.00000000],
+		[-6.27330207, -0.00036195, 0.00022173, 0.00036377, -0.00000115, 0.00000000],
+		[-6.27330217, -0.00036191, 0.00022170, 0.00036373, -0.00000115, 0.00000000],
+		[-6.27330227, -0.00036187, 0.00022168, 0.00036369, -0.00000115, 0.00000000],
+		[-6.27330237, -0.00036182, 0.00022165, 0.00036364, -0.00000115, 0.00000000],
+		[-6.27330247, -0.00036178, 0.00022163, 0.00036360, -0.00000115, 0.00000000],
+		[-6.27330257, -0.00036174, 0.00022160, 0.00036356, -0.00000115, 0.00000000],
+		[-6.27330267, -0.00036170, 0.00022157, 0.00036352, -0.00000115, 0.00000000],
+		[-6.27330278, -0.00036166, 0.00022155, 0.00036347, -0.00000115, 0.00000000],
+		[-6.27330288, -0.00036161, 0.00022152, 0.00036343, -0.00000115, 0.00000000],
+		[-6.27330298, -0.00036157, 0.00022150, 0.00036339, -0.00000115, 0.00000000],
+		[-6.27330308, -0.00036153, 0.00022147, 0.00036335, -0.00000115, 0.00000000],
+		[-6.27330318, -0.00036149, 0.00022144, 0.00036330, -0.00000115, 0.00000000],
+		[-6.27330328, -0.00036144, 0.00022142, 0.00036326, -0.00000115, 0.00000000],
+		[-6.27330338, -0.00036140, 0.00022139, 0.00036322, -0.00000115, 0.00000000],
+		[-6.27330348, -0.00036136, 0.00022137, 0.00036318, -0.00000115, 0.00000000],
+		[-6.27330358, -0.00036132, 0.00022134, 0.00036313, -0.00000115, 0.00000000],
+		[-6.27330368, -0.00036128, 0.00022132, 0.00036309, -0.00000115, 0.00000000],
+		[-6.27330379, -0.00036123, 0.00022129, 0.00036305, -0.00000115, 0.00000000],
+		[-6.27330389, -0.00036119, 0.00022126, 0.00036301, -0.00000115, 0.00000000],
+		[-6.27330399, -0.00036115, 0.00022124, 0.00036297, -0.00000115, 0.00000000],
+		[-6.27330409, -0.00036111, 0.00022121, 0.00036292, -0.00000115, 0.00000000],
+		[-6.27330419, -0.00036107, 0.00022119, 0.00036288, -0.00000115, 0.00000000],
+		[-6.27330429, -0.00036102, 0.00022116, 0.00036284, -0.00000115, 0.00000000],
+		[-6.27330439, -0.00036098, 0.00022113, 0.00036280, -0.00000115, 0.00000000],
+		[-6.27330449, -0.00036094, 0.00022111, 0.00036275, -0.00000115, 0.00000000],
+		[-6.27330459, -0.00036090, 0.00022108, 0.00036271, -0.00000115, 0.00000000],
+		[-6.27330469, -0.00036085, 0.00022106, 0.00036267, -0.00000115, 0.00000000],
+		[-6.27330479, -0.00036081, 0.00022103, 0.00036263, -0.00000115, 0.00000000],
+		[-6.27330489, -0.00036077, 0.00022101, 0.00036258, -0.00000115, 0.00000000],
+		[-6.27330499, -0.00036073, 0.00022098, 0.00036254, -0.00000115, 0.00000000],
+		[-6.27330510, -0.00036069, 0.00022095, 0.00036250, -0.00000115, 0.00000000],
+		[-6.27330520, -0.00036064, 0.00022093, 0.00036246, -0.00000115, 0.00000000],
+		[-6.27330530, -0.00036060, 0.00022090, 0.00036242, -0.00000115, 0.00000000],
+		[-6.27330540, -0.00036056, 0.00022088, 0.00036237, -0.00000115, 0.00000000],
+		[-6.27330550, -0.00036052, 0.00022085, 0.00036233, -0.00000115, 0.00000000],
+		[-6.27330560, -0.00036048, 0.00022083, 0.00036229, -0.00000115, 0.00000000],
+		[-6.27330570, -0.00036043, 0.00022080, 0.00036225, -0.00000115, 0.00000000],
+		[-6.27330580, -0.00036039, 0.00022077, 0.00036220, -0.00000115, 0.00000000],
+		[-6.27330590, -0.00036035, 0.00022075, 0.00036216, -0.00000115, 0.00000000],
+		[-6.27330600, -0.00036031, 0.00022072, 0.00036212, -0.00000115, 0.00000000],
+		[-6.27330610, -0.00036027, 0.00022070, 0.00036208, -0.00000115, 0.00000000],
+		[-6.27330620, -0.00036023, 0.00022067, 0.00036204, -0.00000115, 0.00000000],
+		[-6.27330630, -0.00036018, 0.00022065, 0.00036199, -0.00000115, 0.00000000],
+		[-6.27330640, -0.00036014, 0.00022062, 0.00036195, -0.00000115, 0.00000000],
+		[-6.27330650, -0.00036010, 0.00022059, 0.00036191, -0.00000115, 0.00000000],
+		[-6.27330660, -0.00036006, 0.00022057, 0.00036187, -0.00000115, 0.00000000],
+		[-6.27330670, -0.00036002, 0.00022054, 0.00036183, -0.00000115, 0.00000000],
+		[-6.27330680, -0.00035997, 0.00022052, 0.00036178, -0.00000115, 0.00000000],
+		[-6.27330690, -0.00035993, 0.00022049, 0.00036174, -0.00000115, 0.00000000],
+		[-6.27330700, -0.00035989, 0.00022047, 0.00036170, -0.00000115, 0.00000000],
+		[-6.27330710, -0.00035985, 0.00022044, 0.00036166, -0.00000115, 0.00000000],
+		[-6.27330720, -0.00035981, 0.00022041, 0.00036162, -0.00000115, 0.00000000],
+		[-6.27330730, -0.00035976, 0.00022039, 0.00036157, -0.00000115, 0.00000000],
+		[-6.27330740, -0.00035972, 0.00022036, 0.00036153, -0.00000115, 0.00000000],
+		[-6.27330750, -0.00035968, 0.00022034, 0.00036149, -0.00000115, 0.00000000],
+		[-6.27330760, -0.00035964, 0.00022031, 0.00036145, -0.00000115, 0.00000000],
+		[-6.27330770, -0.00035960, 0.00022029, 0.00036141, -0.00000115, 0.00000000],
+		[-6.27330780, -0.00035956, 0.00022026, 0.00036136, -0.00000115, 0.00000000],
+		[-6.27330790, -0.00035951, 0.00022024, 0.00036132, -0.00000115, 0.00000000],
+		[-6.27330800, -0.00035947, 0.00022021, 0.00036128, -0.00000115, 0.00000000],
+		[-6.27330810, -0.00035943, 0.00022018, 0.00036124, -0.00000115, 0.00000000],
+		[-6.27330820, -0.00035939, 0.00022016, 0.00036120, -0.00000115, 0.00000000],
+		[-6.27330830, -0.00035935, 0.00022013, 0.00036115, -0.00000115, 0.00000000],
+		[-6.27330840, -0.00035931, 0.00022011, 0.00036111, -0.00000115, 0.00000000],
+		[-6.27330850, -0.00035926, 0.00022008, 0.00036107, -0.00000115, 0.00000000],
+		[-6.27330860, -0.00035922, 0.00022006, 0.00036103, -0.00000115, 0.00000000],
+		[-6.27330870, -0.00035918, 0.00022003, 0.00036099, -0.00000115, 0.00000000],
+		[-6.27330880, -0.00035914, 0.00022001, 0.00036094, -0.00000115, 0.00000000],
+		[-6.27330890, -0.00035910, 0.00021998, 0.00036090, -0.00000115, 0.00000000],
+		[-6.27330900, -0.00035906, 0.00021995, 0.00036086, -0.00000115, 0.00000000],
+		[-6.27330910, -0.00035901, 0.00021993, 0.00036082, -0.00000115, 0.00000000],
+		[-6.27330920, -0.00035897, 0.00021990, 0.00036078, -0.00000115, 0.00000000],
+		[-6.27330930, -0.00035893, 0.00021988, 0.00036073, -0.00000115, 0.00000000],
+		[-6.27330940, -0.00035889, 0.00021985, 0.00036069, -0.00000115, 0.00000000],
+		[-6.27330950, -0.00035885, 0.00021983, 0.00036065, -0.00000115, 0.00000000],
+		[-6.27330960, -0.00035881, 0.00021980, 0.00036061, -0.00000115, 0.00000000],
+		[-6.27330970, -0.00035876, 0.00021978, 0.00036057, -0.00000115, 0.00000000],
+		[-6.27330980, -0.00035872, 0.00021975, 0.00036053, -0.00000115, 0.00000000],
+		[-6.27330990, -0.00035868, 0.00021972, 0.00036048, -0.00000115, 0.00000000],
+		[-6.27331000, -0.00035864, 0.00021970, 0.00036044, -0.00000115, 0.00000000],
+		[-6.27331010, -0.00035860, 0.00021967, 0.00036040, -0.00000115, 0.00000000],
+		[-6.27331020, -0.00035856, 0.00021965, 0.00036036, -0.00000115, 0.00000000],
+		[-6.27331030, -0.00035851, 0.00021962, 0.00036032, -0.00000115, 0.00000000],
+		[-6.27331040, -0.00035847, 0.00021960, 0.00036028, -0.00000115, 0.00000000],
+		[-6.27331050, -0.00035843, 0.00021957, 0.00036023, -0.00000115, 0.00000000],
+		[-6.27331059, -0.00035839, 0.00021955, 0.00036019, -0.00000115, 0.00000000],
+		[-6.27331069, -0.00035835, 0.00021952, 0.00036015, -0.00000115, 0.00000000],
+		[-6.27331079, -0.00035831, 0.00021950, 0.00036011, -0.00000115, 0.00000000],
+		[-6.27331089, -0.00035827, 0.00021947, 0.00036007, -0.00000115, 0.00000000],
+		[-6.27331099, -0.00035822, 0.00021944, 0.00036002, -0.00000115, 0.00000000],
+		[-6.27331109, -0.00035818, 0.00021942, 0.00035998, -0.00000115, 0.00000000],
+		[-6.27331119, -0.00035814, 0.00021939, 0.00035994, -0.00000115, 0.00000000],
+		[-6.27331129, -0.00035810, 0.00021937, 0.00035990, -0.00000115, 0.00000000],
+		[-6.27331139, -0.00035806, 0.00021934, 0.00035986, -0.00000115, 0.00000000],
+		[-6.27331149, -0.00035802, 0.00021932, 0.00035982, -0.00000115, 0.00000000],
+		[-6.27331159, -0.00035798, 0.00021929, 0.00035978, -0.00000115, 0.00000000],
+		[-6.27331169, -0.00035793, 0.00021927, 0.00035973, -0.00000115, 0.00000000],
+		[-6.27331179, -0.00035789, 0.00021924, 0.00035969, -0.00000115, 0.00000000],
+		[-6.27331188, -0.00035785, 0.00021922, 0.00035965, -0.00000115, 0.00000000],
+		[-6.27331198, -0.00035781, 0.00021919, 0.00035961, -0.00000115, 0.00000000],
+		[-6.27331208, -0.00035777, 0.00021917, 0.00035957, -0.00000115, 0.00000000],
+		[-6.27331218, -0.00035773, 0.00021914, 0.00035953, -0.00000115, 0.00000000],
+		[-6.27331228, -0.00035769, 0.00021911, 0.00035948, -0.00000115, 0.00000000],
+		[-6.27331238, -0.00035764, 0.00021909, 0.00035944, -0.00000115, 0.00000000],
+		[-6.27331248, -0.00035760, 0.00021906, 0.00035940, -0.00000115, 0.00000000],
+		[-6.27331258, -0.00035756, 0.00021904, 0.00035936, -0.00000115, 0.00000000],
+		[-6.27331268, -0.00035752, 0.00021901, 0.00035932, -0.00000115, 0.00000000],
+		[-6.27331277, -0.00035748, 0.00021899, 0.00035928, -0.00000115, 0.00000000],
+		[-6.27331287, -0.00035744, 0.00021896, 0.00035923, -0.00000115, 0.00000000],
+		[-6.27331297, -0.00035740, 0.00021894, 0.00035919, -0.00000115, 0.00000000],
+		[-6.27331307, -0.00035736, 0.00021891, 0.00035915, -0.00000115, 0.00000000],
+		[-6.27331317, -0.00035731, 0.00021889, 0.00035911, -0.00000115, 0.00000000],
+		[-6.27331327, -0.00035727, 0.00021886, 0.00035907, -0.00000115, 0.00000000],
+		[-6.27331337, -0.00035723, 0.00021884, 0.00035903, -0.00000115, 0.00000000],
+		[-6.27331347, -0.00035719, 0.00021881, 0.00035899, -0.00000115, 0.00000000],
+		[-6.27331356, -0.00035715, 0.00021879, 0.00035894, -0.00000115, 0.00000000],
+		[-6.27331366, -0.00035711, 0.00021876, 0.00035890, -0.00000115, 0.00000000],
+		[-6.27331376, -0.00035707, 0.00021874, 0.00035886, -0.00000115, 0.00000000],
+		[-6.27331386, -0.00035703, 0.00021871, 0.00035882, -0.00000115, 0.00000000],
+		[-6.27331396, -0.00035698, 0.00021869, 0.00035878, -0.00000115, 0.00000000],
+		[-6.27331406, -0.00035694, 0.00021866, 0.00035874, -0.00000115, 0.00000000],
+		[-6.27331416, -0.00035690, 0.00021863, 0.00035870, -0.00000115, 0.00000000],
+		[-6.27331425, -0.00035686, 0.00021861, 0.00035866, -0.00000115, 0.00000000],
+		[-6.27331435, -0.00035682, 0.00021858, 0.00035861, -0.00000115, 0.00000000],
+		[-6.27331445, -0.00035678, 0.00021856, 0.00035857, -0.00000115, 0.00000000],
+		[-6.27331455, -0.00035674, 0.00021853, 0.00035853, -0.00000115, 0.00000000],
+		[-6.27331465, -0.00035670, 0.00021851, 0.00035849, -0.00000115, 0.00000000],
+		[-6.27331475, -0.00035666, 0.00021848, 0.00035845, -0.00000115, 0.00000000],
+		[-6.27331485, -0.00035661, 0.00021846, 0.00035841, -0.00000115, 0.00000000],
+		[-6.27331494, -0.00035657, 0.00021843, 0.00035837, -0.00000115, 0.00000000],
+		[-6.27331504, -0.00035653, 0.00021841, 0.00035832, -0.00000115, 0.00000000],
+		[-6.27331514, -0.00035649, 0.00021838, 0.00035828, -0.00000115, 0.00000000],
+		[-6.27331524, -0.00035645, 0.00021836, 0.00035824, -0.00000115, 0.00000000],
+		[-6.27331534, -0.00035641, 0.00021833, 0.00035820, -0.00000115, 0.00000000],
+		[-6.27331543, -0.00035637, 0.00021831, 0.00035816, -0.00000115, 0.00000000],
+		[-6.27331553, -0.00035633, 0.00021828, 0.00035812, -0.00000115, 0.00000000],
+		[-6.27331563, -0.00035629, 0.00021826, 0.00035808, -0.00000115, 0.00000000],
+		[-6.27331573, -0.00035625, 0.00021823, 0.00035804, -0.00000115, 0.00000000],
+		[-6.27331583, -0.00035620, 0.00021821, 0.00035799, -0.00000115, 0.00000000],
+		[-6.27331593, -0.00035616, 0.00021818, 0.00035795, -0.00000115, 0.00000000],
+		[-6.27331602, -0.00035612, 0.00021816, 0.00035791, -0.00000115, 0.00000000],
+		[-6.27331612, -0.00035608, 0.00021813, 0.00035787, -0.00000115, 0.00000000],
+		[-6.27331622, -0.00035604, 0.00021811, 0.00035783, -0.00000115, 0.00000000],
+		[-6.27331632, -0.00035600, 0.00021808, 0.00035779, -0.00000115, 0.00000000],
+		[-6.27331642, -0.00035596, 0.00021806, 0.00035775, -0.00000115, 0.00000000],
+		[-6.27331651, -0.00035592, 0.00021803, 0.00035771, -0.00000115, 0.00000000],
+		[-6.27331661, -0.00035588, 0.00021801, 0.00035767, -0.00000115, 0.00000000],
+		[-6.27331671, -0.00035584, 0.00021798, 0.00035762, -0.00000115, 0.00000000],
+		[-6.27331681, -0.00035579, 0.00021796, 0.00035758, -0.00000115, 0.00000000],
+		[-6.27331691, -0.00035575, 0.00021793, 0.00035754, -0.00000115, 0.00000000],
+		[-6.27331700, -0.00035571, 0.00021791, 0.00035750, -0.00000115, 0.00000000],
+		[-6.27331710, -0.00035567, 0.00021788, 0.00035746, -0.00000115, 0.00000000],
+		[-6.27331720, -0.00035563, 0.00021786, 0.00035742, -0.00000115, 0.00000000],
+		[-6.27331730, -0.00035559, 0.00021783, 0.00035738, -0.00000115, 0.00000000],
+		[-6.27331740, -0.00035555, 0.00021781, 0.00035734, -0.00000115, 0.00000000],
+		[-6.27331749, -0.00035551, 0.00021778, 0.00035730, -0.00000115, 0.00000000],
+		[-6.27331759, -0.00035547, 0.00021776, 0.00035725, -0.00000115, 0.00000000],
+		[-6.27331769, -0.00035543, 0.00021773, 0.00035721, -0.00000115, 0.00000000],
+		[-6.27331779, -0.00035539, 0.00021771, 0.00035717, -0.00000115, 0.00000000],
+		[-6.27331788, -0.00035535, 0.00021768, 0.00035713, -0.00000115, 0.00000000],
+		[-6.27331798, -0.00035530, 0.00021766, 0.00035709, -0.00000115, 0.00000000],
+		[-6.27331808, -0.00035526, 0.00021763, 0.00035705, -0.00000115, 0.00000000],
+		[-6.27331818, -0.00035522, 0.00021761, 0.00035701, -0.00000115, 0.00000000],
+		[-6.27331827, -0.00035518, 0.00021758, 0.00035697, -0.00000115, 0.00000000],
+		[-6.27331837, -0.00035514, 0.00021756, 0.00035693, -0.00000115, 0.00000000],
+		[-6.27331847, -0.00035510, 0.00021753, 0.00035689, -0.00000115, 0.00000000],
+		[-6.27331857, -0.00035506, 0.00021751, 0.00035684, -0.00000115, 0.00000000],
+		[-6.27331866, -0.00035502, 0.00021748, 0.00035680, -0.00000115, 0.00000000],
+		[-6.27331876, -0.00035498, 0.00021746, 0.00035676, -0.00000115, 0.00000000],
+		[-6.27331886, -0.00035494, 0.00021743, 0.00035672, -0.00000115, 0.00000000],
+		[-6.27331896, -0.00035490, 0.00021741, 0.00035668, -0.00000115, 0.00000000],
+		[-6.27331905, -0.00035486, 0.00021738, 0.00035664, -0.00000115, 0.00000000],
+		[-6.27331915, -0.00035482, 0.00021736, 0.00035660, -0.00000115, 0.00000000],
+		[-6.27331925, -0.00035478, 0.00021733, 0.00035656, -0.00000115, 0.00000000],
+		[-6.27331935, -0.00035473, 0.00021731, 0.00035652, -0.00000115, 0.00000000],
+		[-6.27331944, -0.00035469, 0.00021728, 0.00035648, -0.00000115, 0.00000000],
+		[-6.27331954, -0.00035465, 0.00021726, 0.00035644, -0.00000115, 0.00000000],
+		[-6.27331964, -0.00035461, 0.00021723, 0.00035640, -0.00000115, 0.00000000],
+		[-6.27331974, -0.00035457, 0.00021721, 0.00035635, -0.00000115, 0.00000000],
+		[-6.27331983, -0.00035453, 0.00021718, 0.00035631, -0.00000115, 0.00000000],
+		[-6.27331993, -0.00035449, 0.00021716, 0.00035627, -0.00000115, 0.00000000],
+		[-6.27332003, -0.00035445, 0.00021713, 0.00035623, -0.00000115, 0.00000000],
+		[-6.27332012, -0.00035441, 0.00021711, 0.00035619, -0.00000115, 0.00000000],
+		[-6.27332022, -0.00035437, 0.00021708, 0.00035615, -0.00000115, 0.00000000],
+		[-6.27332032, -0.00035433, 0.00021706, 0.00035611, -0.00000115, 0.00000000],
+		[-6.27332042, -0.00035429, 0.00021703, 0.00035607, -0.00000115, 0.00000000],
+		[-6.27332051, -0.00035425, 0.00021701, 0.00035603, -0.00000115, 0.00000000],
+		[-6.27332061, -0.00035421, 0.00021698, 0.00035599, -0.00000115, 0.00000000],
+		[-6.27332071, -0.00035417, 0.00021696, 0.00035595, -0.00000115, 0.00000000],
+		[-6.27332080, -0.00035413, 0.00021693, 0.00035591, -0.00000115, 0.00000000],
+		[-6.27332090, -0.00035409, 0.00021691, 0.00035587, -0.00000115, 0.00000000],
+		[-6.27332100, -0.00035405, 0.00021688, 0.00035582, -0.00000115, 0.00000000],
+		[-6.27332109, -0.00035400, 0.00021686, 0.00035578, -0.00000115, 0.00000000],
+		[-6.27332119, -0.00035396, 0.00021683, 0.00035574, -0.00000115, 0.00000000],
+		[-6.27332129, -0.00035392, 0.00021681, 0.00035570, -0.00000115, 0.00000000],
+		[-6.27332139, -0.00035388, 0.00021678, 0.00035566, -0.00000115, 0.00000000],
+		[-6.27332148, -0.00035384, 0.00021676, 0.00035562, -0.00000115, 0.00000000],
+		[-6.27332158, -0.00035380, 0.00021673, 0.00035558, -0.00000115, 0.00000000],
+		[-6.27332168, -0.00035376, 0.00021671, 0.00035554, -0.00000115, 0.00000000],
+		[-6.27332177, -0.00035372, 0.00021669, 0.00035550, -0.00000115, 0.00000000],
+		[-6.27332187, -0.00035368, 0.00021666, 0.00035546, -0.00000115, 0.00000000],
+		[-6.27332197, -0.00035364, 0.00021664, 0.00035542, -0.00000115, 0.00000000],
+		[-6.27332206, -0.00035360, 0.00021661, 0.00035538, -0.00000115, 0.00000000],
+		[-6.27332216, -0.00035356, 0.00021659, 0.00035534, -0.00000115, 0.00000000],
+		[-6.27332226, -0.00035352, 0.00021656, 0.00035530, -0.00000115, 0.00000000],
+		[-6.27332235, -0.00035348, 0.00021654, 0.00035526, -0.00000115, 0.00000000],
+		[-6.27332245, -0.00035344, 0.00021651, 0.00035522, -0.00000115, 0.00000000],
+		[-6.27332255, -0.00035340, 0.00021649, 0.00035517, -0.00000115, 0.00000000],
+		[-6.27332264, -0.00035336, 0.00021646, 0.00035513, -0.00000115, 0.00000000],
+		[-6.27332274, -0.00035332, 0.00021644, 0.00035509, -0.00000115, 0.00000000],
+		[-6.27332284, -0.00035328, 0.00021641, 0.00035505, -0.00000115, 0.00000000],
+		[-6.27332293, -0.00035324, 0.00021639, 0.00035501, -0.00000115, 0.00000000],
+		[-6.27332303, -0.00035320, 0.00021636, 0.00035497, -0.00000115, 0.00000000],
+		[-6.27332313, -0.00035316, 0.00021634, 0.00035493, -0.00000115, 0.00000000],
+		[-6.27332322, -0.00035312, 0.00021631, 0.00035489, -0.00000115, 0.00000000],
+		[-6.27332332, -0.00035308, 0.00021629, 0.00035485, -0.00000115, 0.00000000],
+		[-6.27332341, -0.00035304, 0.00021626, 0.00035481, -0.00000115, 0.00000000],
+		[-6.27332351, -0.00035300, 0.00021624, 0.00035477, -0.00000115, 0.00000000],
+		[-6.27332361, -0.00035296, 0.00021622, 0.00035473, -0.00000115, 0.00000000],
+		[-6.27332370, -0.00035291, 0.00021619, 0.00035469, -0.00000115, 0.00000000],
+		[-6.27332380, -0.00035287, 0.00021617, 0.00035465, -0.00000115, 0.00000000],
+		[-6.27332390, -0.00035283, 0.00021614, 0.00035461, -0.00000115, 0.00000000],
+		[-6.27332399, -0.00035279, 0.00021612, 0.00035457, -0.00000115, 0.00000000],
+		[-6.27332409, -0.00035275, 0.00021609, 0.00035453, -0.00000115, 0.00000000],
+		[-6.27332418, -0.00035271, 0.00021607, 0.00035449, -0.00000115, 0.00000000],
+		[-6.27332428, -0.00035267, 0.00021604, 0.00035445, -0.00000115, 0.00000000],
+		[-6.27332438, -0.00035263, 0.00021602, 0.00035441, -0.00000115, 0.00000000],
+		[-6.27332447, -0.00035259, 0.00021599, 0.00035437, -0.00000115, 0.00000000],
+		[-6.27332457, -0.00035255, 0.00021597, 0.00035432, -0.00000115, 0.00000000],
+		[-6.27332467, -0.00035251, 0.00021594, 0.00035428, -0.00000115, 0.00000000],
+		[-6.27332476, -0.00035247, 0.00021592, 0.00035424, -0.00000115, 0.00000000],
+		[-6.27332486, -0.00035243, 0.00021590, 0.00035420, -0.00000115, 0.00000000],
+		[-6.27332495, -0.00035239, 0.00021587, 0.00035416, -0.00000115, 0.00000000],
+		[-6.27332505, -0.00035235, 0.00021585, 0.00035412, -0.00000115, 0.00000000],
+		[-6.27332515, -0.00035231, 0.00021582, 0.00035408, -0.00000115, 0.00000000],
+		[-6.27332524, -0.00035227, 0.00021580, 0.00035404, -0.00000115, 0.00000000],
+		[-6.27332534, -0.00035223, 0.00021577, 0.00035400, -0.00000115, 0.00000000],
+		[-6.27332543, -0.00035219, 0.00021575, 0.00035396, -0.00000115, 0.00000000],
+		[-6.27332553, -0.00035215, 0.00021572, 0.00035392, -0.00000115, 0.00000000],
+		[-6.27332563, -0.00035211, 0.00021570, 0.00035388, -0.00000115, 0.00000000],
+		[-6.27332572, -0.00035207, 0.00021567, 0.00035384, -0.00000115, 0.00000000],
+		[-6.27332582, -0.00035203, 0.00021565, 0.00035380, -0.00000115, 0.00000000],
+		[-6.27332591, -0.00035199, 0.00021563, 0.00035376, -0.00000115, 0.00000000],
+		[-6.27332601, -0.00035195, 0.00021560, 0.00035372, -0.00000115, 0.00000000],
+		[-6.27332611, -0.00035191, 0.00021558, 0.00035368, -0.00000115, 0.00000000],
+		[-6.27332620, -0.00035187, 0.00021555, 0.00035364, -0.00000115, 0.00000000],
+		[-6.27332630, -0.00035183, 0.00021553, 0.00035360, -0.00000115, 0.00000000],
+		[-6.27332639, -0.00035179, 0.00021550, 0.00035356, -0.00000115, 0.00000000],
+		[-6.27332649, -0.00035175, 0.00021548, 0.00035352, -0.00000115, 0.00000000],
+		[-6.27332658, -0.00035171, 0.00021545, 0.00035348, -0.00000115, 0.00000000],
+		[-6.27332668, -0.00035167, 0.00021543, 0.00035344, -0.00000115, 0.00000000],
+		[-6.27332678, -0.00035163, 0.00021540, 0.00035340, -0.00000115, 0.00000000],
+		[-6.27332687, -0.00035159, 0.00021538, 0.00035336, -0.00000115, 0.00000000],
+		[-6.27332697, -0.00035155, 0.00021536, 0.00035332, -0.00000115, 0.00000000],
+		[-6.27332706, -0.00035151, 0.00021533, 0.00035328, -0.00000115, 0.00000000],
+		[-6.27332716, -0.00035147, 0.00021531, 0.00035324, -0.00000115, 0.00000000],
+		[-6.27332725, -0.00035143, 0.00021528, 0.00035320, -0.00000115, 0.00000000],
+		[-6.27332735, -0.00035139, 0.00021526, 0.00035316, -0.00000115, 0.00000000],
+		[-6.27332744, -0.00035135, 0.00021523, 0.00035312, -0.00000115, 0.00000000],
+		[-6.27332754, -0.00035131, 0.00021521, 0.00035308, -0.00000115, 0.00000000],
+		[-6.27332763, -0.00035127, 0.00021518, 0.00035304, -0.00000115, 0.00000000],
+		[-6.27332773, -0.00035123, 0.00021516, 0.00035300, -0.00000115, 0.00000000],
+		[-6.27332783, -0.00035119, 0.00021514, 0.00035296, -0.00000115, 0.00000000],
+		[-6.27332792, -0.00035115, 0.00021511, 0.00035292, -0.00000115, 0.00000000],
+		[-6.27332802, -0.00035111, 0.00021509, 0.00035288, -0.00000115, 0.00000000],
+		[-6.27332811, -0.00035107, 0.00021506, 0.00035284, -0.00000115, 0.00000000],
+		[-6.27332821, -0.00035103, 0.00021504, 0.00035280, -0.00000115, 0.00000000],
+		[-6.27332830, -0.00035099, 0.00021501, 0.00035276, -0.00000115, 0.00000000],
+		[-6.27332840, -0.00035095, 0.00021499, 0.00035272, -0.00000115, 0.00000000],
+		[-6.27332849, -0.00035091, 0.00021496, 0.00035268, -0.00000115, 0.00000000],
+		[-6.27332859, -0.00035087, 0.00021494, 0.00035264, -0.00000115, 0.00000000],
+		[-6.27332868, -0.00035084, 0.00021492, 0.00035260, -0.00000115, 0.00000000],
+		[-6.27332878, -0.00035080, 0.00021489, 0.00035256, -0.00000115, 0.00000000],
+		[-6.27332887, -0.00035076, 0.00021487, 0.00035252, -0.00000115, 0.00000000],
+		[-6.27332897, -0.00035072, 0.00021484, 0.00035248, -0.00000115, 0.00000000],
+		[-6.27332906, -0.00035068, 0.00021482, 0.00035244, -0.00000115, 0.00000000],
+		[-6.27332916, -0.00035064, 0.00021479, 0.00035240, -0.00000115, 0.00000000],
+		[-6.27332925, -0.00035060, 0.00021477, 0.00035236, -0.00000115, 0.00000000],
+		[-6.27332935, -0.00035056, 0.00021475, 0.00035232, -0.00000115, 0.00000000],
+		[-6.27332944, -0.00035052, 0.00021472, 0.00035228, -0.00000115, 0.00000000],
+		[-6.27332954, -0.00035048, 0.00021470, 0.00035224, -0.00000115, 0.00000000],
+		[-6.27332963, -0.00035044, 0.00021467, 0.00035220, -0.00000115, 0.00000000],
+		[-6.27332973, -0.00035040, 0.00021465, 0.00035216, -0.00000115, 0.00000000],
+		[-6.27332982, -0.00035036, 0.00021462, 0.00035212, -0.00000115, 0.00000000],
+		[-6.27332992, -0.00035032, 0.00021460, 0.00035208, -0.00000115, 0.00000000],
+		[-6.27333001, -0.00035028, 0.00021458, 0.00035204, -0.00000115, 0.00000000],
+		[-6.27333011, -0.00035024, 0.00021455, 0.00035200, -0.00000115, 0.00000000],
+		[-6.27333020, -0.00035020, 0.00021453, 0.00035196, -0.00000115, 0.00000000],
+		[-6.27333030, -0.00035016, 0.00021450, 0.00035192, -0.00000115, 0.00000000],
+		[-6.27333039, -0.00035012, 0.00021448, 0.00035188, -0.00000115, 0.00000000],
+		[-6.27333049, -0.00035008, 0.00021445, 0.00035184, -0.00000115, 0.00000000],
+		[-6.27333058, -0.00035004, 0.00021443, 0.00035180, -0.00000115, 0.00000000],
+		[-6.27333068, -0.00035000, 0.00021441, 0.00035176, -0.00000115, 0.00000000],
+		[-6.27333077, -0.00034996, 0.00021438, 0.00035172, -0.00000115, 0.00000000],
+		[-6.27333087, -0.00034992, 0.00021436, 0.00035168, -0.00000115, 0.00000000],
+		[-6.27333096, -0.00034988, 0.00021433, 0.00035164, -0.00000115, 0.00000000],
+		[-6.27333106, -0.00034984, 0.00021431, 0.00035160, -0.00000115, 0.00000000],
+		[-6.27333115, -0.00034980, 0.00021428, 0.00035156, -0.00000115, 0.00000000],
+		[-6.27333125, -0.00034976, 0.00021426, 0.00035152, -0.00000115, 0.00000000],
+		[-6.27333134, -0.00034973, 0.00021424, 0.00035148, -0.00000115, 0.00000000],
+		[-6.27333144, -0.00034969, 0.00021421, 0.00035144, -0.00000115, 0.00000000],
+		[-6.27333153, -0.00034965, 0.00021419, 0.00035140, -0.00000115, 0.00000000],
+		[-6.27333162, -0.00034961, 0.00021416, 0.00035136, -0.00000115, 0.00000000],
+		[-6.27333172, -0.00034957, 0.00021414, 0.00035132, -0.00000115, 0.00000000],
+		[-6.27333181, -0.00034953, 0.00021412, 0.00035128, -0.00000115, 0.00000000],
+		[-6.27333191, -0.00034949, 0.00021409, 0.00035124, -0.00000115, 0.00000000],
+		[-6.27333200, -0.00034945, 0.00021407, 0.00035120, -0.00000115, 0.00000000],
+		[-6.27333210, -0.00034941, 0.00021404, 0.00035117, -0.00000115, 0.00000000],
+		[-6.27333219, -0.00034937, 0.00021402, 0.00035113, -0.00000115, 0.00000000],
+		[-6.27333229, -0.00034933, 0.00021399, 0.00035109, -0.00000115, 0.00000000],
+		[-6.27333238, -0.00034929, 0.00021397, 0.00035105, -0.00000115, 0.00000000],
+		[-6.27333247, -0.00034925, 0.00021395, 0.00035101, -0.00000115, 0.00000000],
+		[-6.27333257, -0.00034921, 0.00021392, 0.00035097, -0.00000115, 0.00000000],
+		[-6.27333266, -0.00034917, 0.00021390, 0.00035093, -0.00000115, 0.00000000],
+		[-6.27333276, -0.00034913, 0.00021387, 0.00035089, -0.00000115, 0.00000000],
+		[-6.27333285, -0.00034909, 0.00021385, 0.00035085, -0.00000115, 0.00000000],
+		[-6.27333295, -0.00034905, 0.00021383, 0.00035081, -0.00000115, 0.00000000],
+		[-6.27333304, -0.00034902, 0.00021380, 0.00035077, -0.00000115, 0.00000000],
+		[-6.27333313, -0.00034898, 0.00021378, 0.00035073, -0.00000115, 0.00000000],
+		[-6.27333323, -0.00034894, 0.00021375, 0.00035069, -0.00000115, 0.00000000],
+		[-6.27333332, -0.00034890, 0.00021373, 0.00035065, -0.00000115, 0.00000000],
+		[-6.27333342, -0.00034886, 0.00021370, 0.00035061, -0.00000115, 0.00000000],
+		[-6.27333351, -0.00034882, 0.00021368, 0.00035057, -0.00000115, 0.00000000],
+		[-6.27333360, -0.00034878, 0.00021366, 0.00035053, -0.00000115, 0.00000000],
+		[-6.27333370, -0.00034874, 0.00021363, 0.00035049, -0.00000115, 0.00000000],
+		[-6.27333379, -0.00034870, 0.00021361, 0.00035045, -0.00000115, 0.00000000],
+		[-6.27333389, -0.00034866, 0.00021358, 0.00035041, -0.00000115, 0.00000000],
+		[-6.27333398, -0.00034862, 0.00021356, 0.00035037, -0.00000115, 0.00000000],
+		[-6.27333408, -0.00034858, 0.00021354, 0.00035033, -0.00000115, 0.00000000],
+		[-6.27333417, -0.00034854, 0.00021351, 0.00035030, -0.00000115, 0.00000000],
+		[-6.27333426, -0.00034850, 0.00021349, 0.00035026, -0.00000115, 0.00000000],
+		[-6.27333436, -0.00034847, 0.00021346, 0.00035022, -0.00000115, 0.00000000],
+		[-6.27333445, -0.00034843, 0.00021344, 0.00035018, -0.00000115, 0.00000000],
+		[-6.27333454, -0.00034839, 0.00021342, 0.00035014, -0.00000115, 0.00000000],
+		[-6.27333464, -0.00034835, 0.00021339, 0.00035010, -0.00000115, 0.00000000],
+		[-6.27333473, -0.00034831, 0.00021337, 0.00035006, -0.00000115, 0.00000000],
+		[-6.27333483, -0.00034827, 0.00021334, 0.00035002, -0.00000115, 0.00000000],
+		[-6.27333492, -0.00034823, 0.00021332, 0.00034998, -0.00000115, 0.00000000],
+		[-6.27333501, -0.00034819, 0.00021330, 0.00034994, -0.00000115, 0.00000000],
+		[-6.27333511, -0.00034815, 0.00021327, 0.00034990, -0.00000115, 0.00000000],
+		[-6.27333520, -0.00034811, 0.00021325, 0.00034986, -0.00000115, 0.00000000],
+		[-6.27333530, -0.00034807, 0.00021322, 0.00034982, -0.00000115, 0.00000000],
+		[-6.27333539, -0.00034803, 0.00021320, 0.00034978, -0.00000115, 0.00000000],
+		[-6.27333548, -0.00034800, 0.00021318, 0.00034974, -0.00000115, 0.00000000],
+		[-6.27333558, -0.00034796, 0.00021315, 0.00034970, -0.00000115, 0.00000000],
+		[-6.27333567, -0.00034792, 0.00021313, 0.00034967, -0.00000115, 0.00000000],
+		[-6.27333576, -0.00034788, 0.00021310, 0.00034963, -0.00000115, 0.00000000],
+		[-6.27333586, -0.00034784, 0.00021308, 0.00034959, -0.00000115, 0.00000000],
+		[-6.27333595, -0.00034780, 0.00021306, 0.00034955, -0.00000115, 0.00000000],
+		[-6.27333604, -0.00034776, 0.00021303, 0.00034951, -0.00000115, 0.00000000],
+		[-6.27333614, -0.00034772, 0.00021301, 0.00034947, -0.00000115, 0.00000000],
+		[-6.27333623, -0.00034768, 0.00021298, 0.00034943, -0.00000115, 0.00000000],
+		[-6.27333632, -0.00034764, 0.00021296, 0.00034939, -0.00000115, 0.00000000],
+		[-6.27333642, -0.00034760, 0.00021294, 0.00034935, -0.00000115, 0.00000000],
+		[-6.27333651, -0.00034757, 0.00021291, 0.00034931, -0.00000115, 0.00000000],
+		[-6.27333661, -0.00034753, 0.00021289, 0.00034927, -0.00000115, 0.00000000],
+		[-6.27333670, -0.00034749, 0.00021286, 0.00034923, -0.00000115, 0.00000000],
+		[-6.27333679, -0.00034745, 0.00021284, 0.00034919, -0.00000115, 0.00000000],
+		[-6.27333689, -0.00034741, 0.00021282, 0.00034915, -0.00000115, 0.00000000],
+		[-6.27333698, -0.00034737, 0.00021279, 0.00034912, -0.00000115, 0.00000000],
+		[-6.27333707, -0.00034733, 0.00021277, 0.00034908, -0.00000115, 0.00000000],
+		[-6.27333717, -0.00034729, 0.00021275, 0.00034904, -0.00000115, 0.00000000],
+		[-6.27333726, -0.00034725, 0.00021272, 0.00034900, -0.00000115, 0.00000000],
+		[-6.27333735, -0.00034721, 0.00021270, 0.00034896, -0.00000115, 0.00000000],
+		[-6.27333745, -0.00034718, 0.00021267, 0.00034892, -0.00000115, 0.00000000],
+		[-6.27333754, -0.00034714, 0.00021265, 0.00034888, -0.00000115, 0.00000000],
+		[-6.27333763, -0.00034710, 0.00021263, 0.00034884, -0.00000115, 0.00000000],
+		[-6.27333772, -0.00034706, 0.00021260, 0.00034880, -0.00000115, 0.00000000],
+		[-6.27333782, -0.00034702, 0.00021258, 0.00034876, -0.00000115, 0.00000000],
+		[-6.27333791, -0.00034698, 0.00021255, 0.00034872, -0.00000115, 0.00000000],
+		[-6.27333800, -0.00034694, 0.00021253, 0.00034869, -0.00000115, 0.00000000],
+		[-6.27333810, -0.00034690, 0.00021251, 0.00034865, -0.00000115, 0.00000000],
+		[-6.27333819, -0.00034686, 0.00021248, 0.00034861, -0.00000115, 0.00000000],
+		[-6.27333828, -0.00034683, 0.00021246, 0.00034857, -0.00000115, 0.00000000],
+		[-6.27333838, -0.00034679, 0.00021244, 0.00034853, -0.00000115, 0.00000000],
+		[-6.27333847, -0.00034675, 0.00021241, 0.00034849, -0.00000115, 0.00000000],
+		[-6.27333856, -0.00034671, 0.00021239, 0.00034845, -0.00000115, 0.00000000],
+		[-6.27333866, -0.00034667, 0.00021236, 0.00034841, -0.00000115, 0.00000000],
+		[-6.27333875, -0.00034663, 0.00021234, 0.00034837, -0.00000115, 0.00000000],
+		[-6.27333884, -0.00034659, 0.00021232, 0.00034833, -0.00000115, 0.00000000],
+		[-6.27333893, -0.00034655, 0.00021229, 0.00034829, -0.00000115, 0.00000000],
+		[-6.27333903, -0.00034652, 0.00021227, 0.00034826, -0.00000115, 0.00000000],
+		[-6.27333912, -0.00034648, 0.00021225, 0.00034822, -0.00000115, 0.00000000],
+		[-6.27333921, -0.00034644, 0.00021222, 0.00034818, -0.00000115, 0.00000000],
+		[-6.27333931, -0.00034640, 0.00021220, 0.00034814, -0.00000115, 0.00000000],
+		[-6.27333940, -0.00034636, 0.00021217, 0.00034810, -0.00000115, 0.00000000],
+		[-6.27333949, -0.00034632, 0.00021215, 0.00034806, -0.00000115, 0.00000000],
+		[-6.27333958, -0.00034628, 0.00021213, 0.00034802, -0.00000115, 0.00000000],
+		[-6.27333968, -0.00034624, 0.00021210, 0.00034798, -0.00000115, 0.00000000],
+		[-6.27333977, -0.00034620, 0.00021208, 0.00034794, -0.00000115, 0.00000000],
+		[-6.27333986, -0.00034617, 0.00021206, 0.00034791, -0.00000115, 0.00000000],
+		[-6.27333995, -0.00034613, 0.00021203, 0.00034787, -0.00000115, 0.00000000],
+		[-6.27334005, -0.00034609, 0.00021201, 0.00034783, -0.00000115, 0.00000000],
+		[-6.27334014, -0.00034605, 0.00021198, 0.00034779, -0.00000115, 0.00000000],
+		[-6.27334023, -0.00034601, 0.00021196, 0.00034775, -0.00000115, 0.00000000],
+		[-6.27334033, -0.00034597, 0.00021194, 0.00034771, -0.00000115, 0.00000000],
+		[-6.27334042, -0.00034593, 0.00021191, 0.00034767, -0.00000115, 0.00000000],
+		[-6.27334051, -0.00034590, 0.00021189, 0.00034763, -0.00000115, 0.00000000],
+		[-6.27334060, -0.00034586, 0.00021187, 0.00034759, -0.00000115, 0.00000000],
+		[-6.27334070, -0.00034582, 0.00021184, 0.00034756, -0.00000115, 0.00000000],
+		[-6.27334079, -0.00034578, 0.00021182, 0.00034752, -0.00000115, 0.00000000],
+		[-6.27334088, -0.00034574, 0.00021179, 0.00034748, -0.00000115, 0.00000000],
+		[-6.27334097, -0.00034570, 0.00021177, 0.00034744, -0.00000115, 0.00000000],
+		[-6.27334107, -0.00034566, 0.00021175, 0.00034740, -0.00000115, 0.00000000],
+		[-6.27334116, -0.00034563, 0.00021172, 0.00034736, -0.00000115, 0.00000000],
+		[-6.27334125, -0.00034559, 0.00021170, 0.00034732, -0.00000115, 0.00000000],
+		[-6.27334134, -0.00034555, 0.00021168, 0.00034728, -0.00000115, 0.00000000],
+		[-6.27334143, -0.00034551, 0.00021165, 0.00034725, -0.00000115, 0.00000000],
+		[-6.27334153, -0.00034547, 0.00021163, 0.00034721, -0.00000115, 0.00000000],
+		[-6.27334162, -0.00034543, 0.00021161, 0.00034717, -0.00000115, 0.00000000],
+		[-6.27334171, -0.00034539, 0.00021158, 0.00034713, -0.00000115, 0.00000000],
+		[-6.27334180, -0.00034536, 0.00021156, 0.00034709, -0.00000115, 0.00000000],
+		[-6.27334190, -0.00034532, 0.00021153, 0.00034705, -0.00000115, 0.00000000],
+		[-6.27334199, -0.00034528, 0.00021151, 0.00034701, -0.00000115, 0.00000000],
+		[-6.27334208, -0.00034524, 0.00021149, 0.00034697, -0.00000115, 0.00000000],
+		[-6.27334217, -0.00034520, 0.00021146, 0.00034694, -0.00000115, 0.00000000],
+		[-6.27334226, -0.00034516, 0.00021144, 0.00034690, -0.00000115, 0.00000000],
+		[-6.27334236, -0.00034512, 0.00021142, 0.00034686, -0.00000115, 0.00000000],
+		[-6.27334245, -0.00034509, 0.00021139, 0.00034682, -0.00000115, 0.00000000],
+		[-6.27334254, -0.00034505, 0.00021137, 0.00034678, -0.00000115, 0.00000000],
+		[-6.27334263, -0.00034501, 0.00021135, 0.00034674, -0.00000115, 0.00000000],
+		[-6.27334273, -0.00034497, 0.00021132, 0.00034670, -0.00000115, 0.00000000],
+		[-6.27334282, -0.00034493, 0.00021130, 0.00034666, -0.00000115, 0.00000000],
+		[-6.27334291, -0.00034489, 0.00021128, 0.00034663, -0.00000115, 0.00000000],
+		[-6.27334300, -0.00034486, 0.00021125, 0.00034659, -0.00000115, 0.00000000],
+		[-6.27334309, -0.00034482, 0.00021123, 0.00034655, -0.00000115, 0.00000000],
+		[-6.27334319, -0.00034478, 0.00021120, 0.00034651, -0.00000115, 0.00000000],
+		[-6.27334328, -0.00034474, 0.00021118, 0.00034647, -0.00000115, 0.00000000],
+		[-6.27334337, -0.00034470, 0.00021116, 0.00034643, -0.00000115, 0.00000000],
+		[-6.27334346, -0.00034466, 0.00021113, 0.00034639, -0.00000115, 0.00000000],
+		[-6.27334355, -0.00034462, 0.00021111, 0.00034636, -0.00000115, 0.00000000],
+		[-6.27334364, -0.00034459, 0.00021109, 0.00034632, -0.00000115, 0.00000000],
+		[-6.27334374, -0.00034455, 0.00021106, 0.00034628, -0.00000115, 0.00000000],
+		[-6.27334383, -0.00034451, 0.00021104, 0.00034624, -0.00000115, 0.00000000],
+		[-6.27334392, -0.00034447, 0.00021102, 0.00034620, -0.00000115, 0.00000000],
+		[-6.27334401, -0.00034443, 0.00021099, 0.00034616, -0.00000115, 0.00000000],
+		[-6.27334410, -0.00034439, 0.00021097, 0.00034612, -0.00000115, 0.00000000],
+		[-6.27334420, -0.00034436, 0.00021095, 0.00034609, -0.00000115, 0.00000000],
+		[-6.27334429, -0.00034432, 0.00021092, 0.00034605, -0.00000115, 0.00000000],
+		[-6.27334438, -0.00034428, 0.00021090, 0.00034601, -0.00000115, 0.00000000],
+		[-6.27334447, -0.00034424, 0.00021088, 0.00034597, -0.00000115, 0.00000000],
+		[-6.27334456, -0.00034420, 0.00021085, 0.00034593, -0.00000115, 0.00000000],
+		[-6.27334465, -0.00034417, 0.00021083, 0.00034589, -0.00000115, 0.00000000],
+		[-6.27334475, -0.00034413, 0.00021081, 0.00034586, -0.00000115, 0.00000000],
+		[-6.27334484, -0.00034409, 0.00021078, 0.00034582, -0.00000115, 0.00000000],
+		[-6.27334493, -0.00034405, 0.00021076, 0.00034578, -0.00000115, 0.00000000],
+		[-6.27334502, -0.00034401, 0.00021073, 0.00034574, -0.00000115, 0.00000000],
+		[-6.27334511, -0.00034397, 0.00021071, 0.00034570, -0.00000115, 0.00000000],
+		[-6.27334520, -0.00034394, 0.00021069, 0.00034566, -0.00000115, 0.00000000],
+		[-6.27334529, -0.00034390, 0.00021066, 0.00034562, -0.00000115, 0.00000000],
+		[-6.27334539, -0.00034386, 0.00021064, 0.00034559, -0.00000115, 0.00000000],
+		[-6.27334548, -0.00034382, 0.00021062, 0.00034555, -0.00000115, 0.00000000],
+		[-6.27334557, -0.00034378, 0.00021059, 0.00034551, -0.00000115, 0.00000000],
+		[-6.27334566, -0.00034374, 0.00021057, 0.00034547, -0.00000115, 0.00000000],
+		[-6.27334575, -0.00034371, 0.00021055, 0.00034543, -0.00000116, 0.00000000],
+		[-6.27334584, -0.00034367, 0.00021052, 0.00034539, -0.00000116, 0.00000000],
+		[-6.27334593, -0.00034363, 0.00021050, 0.00034536, -0.00000116, 0.00000000],
+		[-6.27334603, -0.00034359, 0.00021048, 0.00034532, -0.00000116, 0.00000000],
+		[-6.27334612, -0.00034355, 0.00021045, 0.00034528, -0.00000116, 0.00000000],
+		[-6.27334621, -0.00034352, 0.00021043, 0.00034524, -0.00000116, 0.00000000],
+		[-6.27334630, -0.00034348, 0.00021041, 0.00034520, -0.00000116, 0.00000000],
+		[-6.27334639, -0.00034344, 0.00021038, 0.00034516, -0.00000116, 0.00000000],
+		[-6.27334648, -0.00034340, 0.00021036, 0.00034513, -0.00000116, 0.00000000],
+		[-6.27334657, -0.00034336, 0.00021034, 0.00034509, -0.00000116, 0.00000000],
+		[-6.27334666, -0.00034333, 0.00021031, 0.00034505, -0.00000116, 0.00000000],
+		[-6.27334676, -0.00034329, 0.00021029, 0.00034501, -0.00000116, 0.00000000],
+		[-6.27334685, -0.00034325, 0.00021027, 0.00034497, -0.00000116, 0.00000000],
+		[-6.27334694, -0.00034321, 0.00021024, 0.00034494, -0.00000116, 0.00000000],
+		[-6.27334703, -0.00034317, 0.00021022, 0.00034490, -0.00000116, 0.00000000],
+		[-6.27334712, -0.00034313, 0.00021020, 0.00034486, -0.00000116, 0.00000000],
+		[-6.27334721, -0.00034310, 0.00021017, 0.00034482, -0.00000116, 0.00000000],
+		[-6.27334730, -0.00034306, 0.00021015, 0.00034478, -0.00000116, 0.00000000],
+		[-6.27334739, -0.00034302, 0.00021013, 0.00034474, -0.00000116, 0.00000000],
+		[-6.27334748, -0.00034298, 0.00021010, 0.00034471, -0.00000116, 0.00000000],
+		[-6.27334758, -0.00034294, 0.00021008, 0.00034467, -0.00000116, 0.00000000],
+		[-6.27334767, -0.00034291, 0.00021006, 0.00034463, -0.00000116, 0.00000000],
+		[-6.27334776, -0.00034287, 0.00021003, 0.00034459, -0.00000116, 0.00000000],
+		[-6.27334785, -0.00034283, 0.00021001, 0.00034455, -0.00000116, 0.00000000],
+		[-6.27334794, -0.00034279, 0.00020999, 0.00034451, -0.00000116, 0.00000000],
+		[-6.27334803, -0.00034276, 0.00020996, 0.00034448, -0.00000116, 0.00000000],
+		[-6.27334812, -0.00034272, 0.00020994, 0.00034444, -0.00000116, 0.00000000],
+		[-6.27334821, -0.00034268, 0.00020992, 0.00034440, -0.00000116, 0.00000000],
+		[-6.27334830, -0.00034264, 0.00020989, 0.00034436, -0.00000116, 0.00000000],
+		[-6.27334839, -0.00034260, 0.00020987, 0.00034432, -0.00000116, 0.00000000],
+		[-6.27334848, -0.00034257, 0.00020985, 0.00034429, -0.00000116, 0.00000000],
+		[-6.27334857, -0.00034253, 0.00020983, 0.00034425, -0.00000116, 0.00000000],
+		[-6.27334867, -0.00034249, 0.00020980, 0.00034421, -0.00000116, 0.00000000],
+		[-6.27334876, -0.00034245, 0.00020978, 0.00034417, -0.00000116, 0.00000000],
+		[-6.27334885, -0.00034241, 0.00020976, 0.00034413, -0.00000116, 0.00000000],
+		[-6.27334894, -0.00034238, 0.00020973, 0.00034410, -0.00000116, 0.00000000],
+		[-6.27334903, -0.00034234, 0.00020971, 0.00034406, -0.00000116, 0.00000000],
+		[-6.27334912, -0.00034230, 0.00020969, 0.00034402, -0.00000116, 0.00000000],
+		[-6.27334921, -0.00034226, 0.00020966, 0.00034398, -0.00000116, 0.00000000],
+		[-6.27334930, -0.00034222, 0.00020964, 0.00034394, -0.00000116, 0.00000000],
+		[-6.27334939, -0.00034219, 0.00020962, 0.00034391, -0.00000116, 0.00000000],
+		[-6.27334948, -0.00034215, 0.00020959, 0.00034387, -0.00000116, 0.00000000],
+		[-6.27334957, -0.00034211, 0.00020957, 0.00034383, -0.00000116, 0.00000000],
+		[-6.27334966, -0.00034207, 0.00020955, 0.00034379, -0.00000116, 0.00000000],
+		[-6.27334975, -0.00034204, 0.00020952, 0.00034375, -0.00000116, 0.00000000],
+		[-6.27334984, -0.00034200, 0.00020950, 0.00034372, -0.00000116, 0.00000000],
+		[-6.27334993, -0.00034196, 0.00020948, 0.00034368, -0.00000116, 0.00000000],
+		[-6.27335002, -0.00034192, 0.00020945, 0.00034364, -0.00000116, 0.00000000],
+		[-6.27335011, -0.00034188, 0.00020943, 0.00034360, -0.00000116, 0.00000000],
+		[-6.27335021, -0.00034185, 0.00020941, 0.00034356, -0.00000116, 0.00000000],
+		[-6.27335030, -0.00034181, 0.00020938, 0.00034353, -0.00000116, 0.00000000],
+		[-6.27335039, -0.00034177, 0.00020936, 0.00034349, -0.00000116, 0.00000000],
+		[-6.27335048, -0.00034173, 0.00020934, 0.00034345, -0.00000116, 0.00000000],
+		[-6.27335057, -0.00034170, 0.00020932, 0.00034341, -0.00000116, 0.00000000],
+		[-6.27335066, -0.00034166, 0.00020929, 0.00034337, -0.00000116, 0.00000000],
+		[-6.27335075, -0.00034162, 0.00020927, 0.00034334, -0.00000116, 0.00000000],
+		[-6.27335084, -0.00034158, 0.00020925, 0.00034330, -0.00000116, 0.00000000],
+		[-6.27335093, -0.00034154, 0.00020922, 0.00034326, -0.00000116, 0.00000000],
+		[-6.27335102, -0.00034151, 0.00020920, 0.00034322, -0.00000116, 0.00000000],
+		[-6.27335111, -0.00034147, 0.00020918, 0.00034318, -0.00000116, 0.00000000],
+		[-6.27335120, -0.00034143, 0.00020915, 0.00034315, -0.00000116, 0.00000000],
+		[-6.27335129, -0.00034139, 0.00020913, 0.00034311, -0.00000116, 0.00000000],
+		[-6.27335138, -0.00034136, 0.00020911, 0.00034307, -0.00000116, 0.00000000],
+		[-6.27335147, -0.00034132, 0.00020908, 0.00034303, -0.00000116, 0.00000000],
+		[-6.27335156, -0.00034128, 0.00020906, 0.00034300, -0.00000116, 0.00000000],
+		[-6.27335165, -0.00034124, 0.00020904, 0.00034296, -0.00000116, 0.00000000],
+		[-6.27335174, -0.00034121, 0.00020902, 0.00034292, -0.00000116, 0.00000000],
+		[-6.27335183, -0.00034117, 0.00020899, 0.00034288, -0.00000116, 0.00000000],
+		[-6.27335192, -0.00034113, 0.00020897, 0.00034284, -0.00000116, 0.00000000],
+		[-6.27335201, -0.00034109, 0.00020895, 0.00034281, -0.00000116, 0.00000000],
+		[-6.27335210, -0.00034106, 0.00020892, 0.00034277, -0.00000116, 0.00000000],
+		[-6.27335219, -0.00034102, 0.00020890, 0.00034273, -0.00000116, 0.00000000],
+		[-6.27335228, -0.00034098, 0.00020888, 0.00034269, -0.00000116, 0.00000000],
+		[-6.27335237, -0.00034094, 0.00020885, 0.00034266, -0.00000116, 0.00000000],
+		[-6.27335246, -0.00034091, 0.00020883, 0.00034262, -0.00000116, 0.00000000],
+		[-6.27335255, -0.00034087, 0.00020881, 0.00034258, -0.00000116, 0.00000000],
+		[-6.27335264, -0.00034083, 0.00020878, 0.00034254, -0.00000116, 0.00000000],
+		[-6.27335273, -0.00034079, 0.00020876, 0.00034250, -0.00000116, 0.00000000],
+		[-6.27335282, -0.00034076, 0.00020874, 0.00034247, -0.00000116, 0.00000000],
+		[-6.27335291, -0.00034072, 0.00020872, 0.00034243, -0.00000116, 0.00000000],
+		[-6.27335300, -0.00034068, 0.00020869, 0.00034239, -0.00000116, 0.00000000],
+		[-6.27335309, -0.00034064, 0.00020867, 0.00034235, -0.00000116, 0.00000000],
+		[-6.27335318, -0.00034061, 0.00020865, 0.00034232, -0.00000116, 0.00000000],
+		[-6.27335327, -0.00034057, 0.00020862, 0.00034228, -0.00000116, 0.00000000],
+		[-6.27335336, -0.00034053, 0.00020860, 0.00034224, -0.00000116, 0.00000000],
+		[-6.27335345, -0.00034049, 0.00020858, 0.00034220, -0.00000116, 0.00000000],
+		[-6.27335354, -0.00034046, 0.00020856, 0.00034217, -0.00000116, 0.00000000],
+		[-6.27335363, -0.00034042, 0.00020853, 0.00034213, -0.00000116, 0.00000000],
+		[-6.27335372, -0.00034038, 0.00020851, 0.00034209, -0.00000116, 0.00000000],
+		[-6.27335380, -0.00034034, 0.00020849, 0.00034205, -0.00000116, 0.00000000],
+		[-6.27335389, -0.00034031, 0.00020846, 0.00034201, -0.00000116, 0.00000000],
+		[-6.27335398, -0.00034027, 0.00020844, 0.00034198, -0.00000116, 0.00000000],
+		[-6.27335407, -0.00034023, 0.00020842, 0.00034194, -0.00000116, 0.00000000],
+		[-6.27335416, -0.00034019, 0.00020839, 0.00034190, -0.00000116, 0.00000000],
+		[-6.27335425, -0.00034016, 0.00020837, 0.00034186, -0.00000116, 0.00000000],
+		[-6.27335434, -0.00034012, 0.00020835, 0.00034183, -0.00000116, 0.00000000],
+		[-6.27335443, -0.00034008, 0.00020833, 0.00034179, -0.00000116, 0.00000000],
+		[-6.27335452, -0.00034004, 0.00020830, 0.00034175, -0.00000116, 0.00000000],
+		[-6.27335461, -0.00034001, 0.00020828, 0.00034171, -0.00000116, 0.00000000],
+		[-6.27335470, -0.00033997, 0.00020826, 0.00034168, -0.00000116, 0.00000000],
+		[-6.27335479, -0.00033993, 0.00020823, 0.00034164, -0.00000116, 0.00000000],
+		[-6.27335488, -0.00033989, 0.00020821, 0.00034160, -0.00000116, 0.00000000],
+		[-6.27335497, -0.00033986, 0.00020819, 0.00034156, -0.00000116, 0.00000000],
+		[-6.27335506, -0.00033982, 0.00020817, 0.00034153, -0.00000116, 0.00000000],
+		[-6.27335515, -0.00033978, 0.00020814, 0.00034149, -0.00000116, 0.00000000],
+		[-6.27335524, -0.00033975, 0.00020812, 0.00034145, -0.00000116, 0.00000000],
+		[-6.27335533, -0.00033971, 0.00020810, 0.00034141, -0.00000116, 0.00000000],
+		[-6.27335541, -0.00033967, 0.00020807, 0.00034138, -0.00000116, 0.00000000],
+		[-6.27335550, -0.00033963, 0.00020805, 0.00034134, -0.00000116, 0.00000000],
+		[-6.27335559, -0.00033960, 0.00020803, 0.00034130, -0.00000116, 0.00000000],
+		[-6.27335568, -0.00033956, 0.00020801, 0.00034126, -0.00000116, 0.00000000],
+		[-6.27335577, -0.00033952, 0.00020798, 0.00034123, -0.00000116, 0.00000000],
+		[-6.27335586, -0.00033948, 0.00020796, 0.00034119, -0.00000116, 0.00000000],
+		[-6.27335595, -0.00033945, 0.00020794, 0.00034115, -0.00000116, 0.00000000],
+		[-6.27335604, -0.00033941, 0.00020791, 0.00034111, -0.00000116, 0.00000000],
+		[-6.27335613, -0.00033937, 0.00020789, 0.00034108, -0.00000116, 0.00000000],
+		[-6.27335622, -0.00033934, 0.00020787, 0.00034104, -0.00000116, 0.00000000],
+		[-6.27335631, -0.00033930, 0.00020785, 0.00034100, -0.00000116, 0.00000000],
+		[-6.27335639, -0.00033926, 0.00020782, 0.00034097, -0.00000116, 0.00000000],
+		[-6.27335648, -0.00033922, 0.00020780, 0.00034093, -0.00000116, 0.00000000],
+		[-6.27335657, -0.00033919, 0.00020778, 0.00034089, -0.00000116, 0.00000000],
+		[-6.27335666, -0.00033915, 0.00020776, 0.00034085, -0.00000116, 0.00000000],
+		[-6.27335675, -0.00033911, 0.00020773, 0.00034082, -0.00000116, 0.00000000],
+		[-6.27335684, -0.00033908, 0.00020771, 0.00034078, -0.00000116, 0.00000000],
+		[-6.27335693, -0.00033904, 0.00020769, 0.00034074, -0.00000116, 0.00000000],
+		[-6.27335702, -0.00033900, 0.00020766, 0.00034070, -0.00000116, 0.00000000],
+		[-6.27335711, -0.00033896, 0.00020764, 0.00034067, -0.00000116, 0.00000000],
+		[-6.27335720, -0.00033893, 0.00020762, 0.00034063, -0.00000116, 0.00000000],
+		[-6.27335728, -0.00033889, 0.00020760, 0.00034059, -0.00000116, 0.00000000],
+		[-6.27335737, -0.00033885, 0.00020757, 0.00034055, -0.00000116, 0.00000000],
+		[-6.27335746, -0.00033882, 0.00020755, 0.00034052, -0.00000116, 0.00000000],
+		[-6.27335755, -0.00033878, 0.00020753, 0.00034048, -0.00000116, 0.00000000],
+		[-6.27335764, -0.00033874, 0.00020751, 0.00034044, -0.00000116, 0.00000000],
+		[-6.27335773, -0.00033870, 0.00020748, 0.00034041, -0.00000116, 0.00000000],
+		[-6.27335782, -0.00033867, 0.00020746, 0.00034037, -0.00000116, 0.00000000],
+		[-6.27335791, -0.00033863, 0.00020744, 0.00034033, -0.00000116, 0.00000000],
+		[-6.27335799, -0.00033859, 0.00020741, 0.00034029, -0.00000116, 0.00000000],
+		[-6.27335808, -0.00033856, 0.00020739, 0.00034026, -0.00000116, 0.00000000],
+		[-6.27335817, -0.00033852, 0.00020737, 0.00034022, -0.00000116, 0.00000000],
+		[-6.27335826, -0.00033848, 0.00020735, 0.00034018, -0.00000116, 0.00000000],
+		[-6.27335835, -0.00033845, 0.00020732, 0.00034015, -0.00000116, 0.00000000],
+		[-6.27335844, -0.00033841, 0.00020730, 0.00034011, -0.00000116, 0.00000000],
+		[-6.27335853, -0.00033837, 0.00020728, 0.00034007, -0.00000116, 0.00000000],
+		[-6.27335861, -0.00033833, 0.00020726, 0.00034003, -0.00000116, 0.00000000],
+		[-6.27335870, -0.00033830, 0.00020723, 0.00034000, -0.00000116, 0.00000000],
+		[-6.27335879, -0.00033826, 0.00020721, 0.00033996, -0.00000116, 0.00000000],
+		[-6.27335888, -0.00033822, 0.00020719, 0.00033992, -0.00000116, 0.00000000],
+		[-6.27335897, -0.00033819, 0.00020716, 0.00033988, -0.00000116, 0.00000000],
+		[-6.27335906, -0.00033815, 0.00020714, 0.00033985, -0.00000116, 0.00000000],
+		[-6.27335915, -0.00033811, 0.00020712, 0.00033981, -0.00000116, 0.00000000],
+		[-6.27335923, -0.00033808, 0.00020710, 0.00033977, -0.00000116, 0.00000000],
+		[-6.27335932, -0.00033804, 0.00020707, 0.00033974, -0.00000116, 0.00000000],
+		[-6.27335941, -0.00033800, 0.00020705, 0.00033970, -0.00000116, 0.00000000],
+		[-6.27335950, -0.00033797, 0.00020703, 0.00033966, -0.00000116, 0.00000000],
+		[-6.27335959, -0.00033793, 0.00020701, 0.00033963, -0.00000116, 0.00000000],
+		[-6.27335968, -0.00033789, 0.00020698, 0.00033959, -0.00000116, 0.00000000],
+		[-6.27335976, -0.00033785, 0.00020696, 0.00033955, -0.00000116, 0.00000000],
+		[-6.27335985, -0.00033782, 0.00020694, 0.00033951, -0.00000116, 0.00000000],
+		[-6.27335994, -0.00033778, 0.00020692, 0.00033948, -0.00000116, 0.00000000],
+		[-6.27336003, -0.00033774, 0.00020689, 0.00033944, -0.00000116, 0.00000000],
+		[-6.27336012, -0.00033771, 0.00020687, 0.00033940, -0.00000116, 0.00000000],
+		[-6.27336021, -0.00033767, 0.00020685, 0.00033937, -0.00000116, 0.00000000],
+		[-6.27336029, -0.00033763, 0.00020683, 0.00033933, -0.00000116, 0.00000000],
+		[-6.27336038, -0.00033760, 0.00020680, 0.00033929, -0.00000116, 0.00000000],
+		[-6.27336047, -0.00033756, 0.00020678, 0.00033925, -0.00000116, 0.00000000],
+		[-6.27336056, -0.00033752, 0.00020676, 0.00033922, -0.00000116, 0.00000000],
+		[-6.27336065, -0.00033749, 0.00020674, 0.00033918, -0.00000116, 0.00000000],
+		[-6.27336073, -0.00033745, 0.00020671, 0.00033914, -0.00000116, 0.00000000],
+		[-6.27336082, -0.00033741, 0.00020669, 0.00033911, -0.00000116, 0.00000000],
+		[-6.27336091, -0.00033738, 0.00020667, 0.00033907, -0.00000116, 0.00000000],
+		[-6.27336100, -0.00033734, 0.00020665, 0.00033903, -0.00000116, 0.00000000],
+		[-6.27336109, -0.00033730, 0.00020662, 0.00033900, -0.00000116, 0.00000000],
+		[-6.27336117, -0.00033727, 0.00020660, 0.00033896, -0.00000116, 0.00000000],
+		[-6.27336126, -0.00033723, 0.00020658, 0.00033892, -0.00000116, 0.00000000],
+		[-6.27336135, -0.00033719, 0.00020656, 0.00033889, -0.00000116, 0.00000000],
+		[-6.27336144, -0.00033716, 0.00020653, 0.00033885, -0.00000116, 0.00000000],
+		[-6.27336153, -0.00033712, 0.00020651, 0.00033881, -0.00000116, 0.00000000],
+		[-6.27336161, -0.00033708, 0.00020649, 0.00033877, -0.00000116, 0.00000000],
+		[-6.27336170, -0.00033705, 0.00020647, 0.00033874, -0.00000116, 0.00000000],
+		[-6.27336179, -0.00033701, 0.00020644, 0.00033870, -0.00000116, 0.00000000],
+		[-6.27336188, -0.00033697, 0.00020642, 0.00033866, -0.00000116, 0.00000000],
+		[-6.27336197, -0.00033694, 0.00020640, 0.00033863, -0.00000116, 0.00000000],
+		[-6.27336205, -0.00033690, 0.00020638, 0.00033859, -0.00000116, 0.00000000],
+		[-6.27336214, -0.00033686, 0.00020635, 0.00033855, -0.00000116, 0.00000000],
+		[-6.27336223, -0.00033683, 0.00020633, 0.00033852, -0.00000116, 0.00000000],
+		[-6.27336232, -0.00033679, 0.00020631, 0.00033848, -0.00000116, 0.00000000],
+		[-6.27336240, -0.00033675, 0.00020629, 0.00033844, -0.00000116, 0.00000000],
+		[-6.27336249, -0.00033672, 0.00020626, 0.00033841, -0.00000116, 0.00000000],
+		[-6.27336258, -0.00033668, 0.00020624, 0.00033837, -0.00000116, 0.00000000],
+		[-6.27336267, -0.00033664, 0.00020622, 0.00033833, -0.00000116, 0.00000000],
+		[-6.27336275, -0.00033661, 0.00020620, 0.00033830, -0.00000116, 0.00000000],
+		[-6.27336284, -0.00033657, 0.00020617, 0.00033826, -0.00000116, 0.00000000],
+		[-6.27336293, -0.00033653, 0.00020615, 0.00033822, -0.00000116, 0.00000000],
+		[-6.27336302, -0.00033650, 0.00020613, 0.00033819, -0.00000116, 0.00000000],
+		[-6.27336311, -0.00033646, 0.00020611, 0.00033815, -0.00000116, 0.00000000],
+		[-6.27336319, -0.00033642, 0.00020608, 0.00033811, -0.00000116, 0.00000000],
+		[-6.27336328, -0.00033639, 0.00020606, 0.00033808, -0.00000116, 0.00000000],
+		[-6.27336337, -0.00033635, 0.00020604, 0.00033804, -0.00000116, 0.00000000],
+		[-6.27336346, -0.00033631, 0.00020602, 0.00033800, -0.00000116, 0.00000000],
+		[-6.27336354, -0.00033628, 0.00020599, 0.00033796, -0.00000116, 0.00000000],
+		[-6.27336363, -0.00033624, 0.00020597, 0.00033793, -0.00000116, 0.00000000],
+		[-6.27336372, -0.00033620, 0.00020595, 0.00033789, -0.00000116, 0.00000000],
+		[-6.27336381, -0.00033617, 0.00020593, 0.00033785, -0.00000116, 0.00000000],
+		[-6.27336389, -0.00033613, 0.00020590, 0.00033782, -0.00000116, 0.00000000],
+		[-6.27336398, -0.00033609, 0.00020588, 0.00033778, -0.00000116, 0.00000000],
+		[-6.27336407, -0.00033606, 0.00020586, 0.00033774, -0.00000116, 0.00000000],
+		[-6.27336415, -0.00033602, 0.00020584, 0.00033771, -0.00000116, 0.00000000],
+		[-6.27336424, -0.00033598, 0.00020582, 0.00033767, -0.00000116, 0.00000000],
+		[-6.27336433, -0.00033595, 0.00020579, 0.00033763, -0.00000116, 0.00000000],
+		[-6.27336442, -0.00033591, 0.00020577, 0.00033760, -0.00000116, 0.00000000],
+		[-6.27336450, -0.00033587, 0.00020575, 0.00033756, -0.00000116, 0.00000000],
+		[-6.27336459, -0.00033584, 0.00020573, 0.00033752, -0.00000116, 0.00000000],
+		[-6.27336468, -0.00033580, 0.00020570, 0.00033749, -0.00000116, 0.00000000],
+		[-6.27336477, -0.00033577, 0.00020568, 0.00033745, -0.00000116, 0.00000000],
+		[-6.27336485, -0.00033573, 0.00020566, 0.00033742, -0.00000116, 0.00000000],
+		[-6.27336494, -0.00033569, 0.00020564, 0.00033738, -0.00000116, 0.00000000],
+		[-6.27336503, -0.00033566, 0.00020561, 0.00033734, -0.00000116, 0.00000000],
+		[-6.27336511, -0.00033562, 0.00020559, 0.00033731, -0.00000116, 0.00000000],
+		[-6.27336520, -0.00033558, 0.00020557, 0.00033727, -0.00000116, 0.00000000],
+		[-6.27336529, -0.00033555, 0.00020555, 0.00033723, -0.00000116, 0.00000000],
+		[-6.27336538, -0.00033551, 0.00020553, 0.00033720, -0.00000116, 0.00000000],
+		[-6.27336546, -0.00033547, 0.00020550, 0.00033716, -0.00000116, 0.00000000],
+		[-6.27336555, -0.00033544, 0.00020548, 0.00033712, -0.00000116, 0.00000000],
+		[-6.27336564, -0.00033540, 0.00020546, 0.00033709, -0.00000116, 0.00000000],
+		[-6.27336572, -0.00033537, 0.00020544, 0.00033705, -0.00000116, 0.00000000],
+		[-6.27336581, -0.00033533, 0.00020541, 0.00033701, -0.00000116, 0.00000000],
+		[-6.27336590, -0.00033529, 0.00020539, 0.00033698, -0.00000116, 0.00000000],
+		[-6.27336598, -0.00033526, 0.00020537, 0.00033694, -0.00000116, 0.00000000],
+		[-6.27336607, -0.00033522, 0.00020535, 0.00033690, -0.00000116, 0.00000000],
+		[-6.27336616, -0.00033518, 0.00020532, 0.00033687, -0.00000116, 0.00000000],
+		[-6.27336625, -0.00033515, 0.00020530, 0.00033683, -0.00000116, 0.00000000],
+		[-6.27336633, -0.00033511, 0.00020528, 0.00033679, -0.00000116, 0.00000000],
+		[-6.27336642, -0.00033508, 0.00020526, 0.00033676, -0.00000116, 0.00000000],
+		[-6.27336651, -0.00033504, 0.00020524, 0.00033672, -0.00000116, 0.00000000],
+		[-6.27336659, -0.00033500, 0.00020521, 0.00033668, -0.00000116, 0.00000000],
+		[-6.27336668, -0.00033497, 0.00020519, 0.00033665, -0.00000116, 0.00000000],
+		[-6.27336677, -0.00033493, 0.00020517, 0.00033661, -0.00000116, 0.00000000],
+		[-6.27336685, -0.00033489, 0.00020515, 0.00033658, -0.00000116, 0.00000000],
+		[-6.27336694, -0.00033486, 0.00020512, 0.00033654, -0.00000116, 0.00000000],
+		[-6.27336703, -0.00033482, 0.00020510, 0.00033650, -0.00000116, 0.00000000],
+		[-6.27336711, -0.00033479, 0.00020508, 0.00033647, -0.00000116, 0.00000000],
+		[-6.27336720, -0.00033475, 0.00020506, 0.00033643, -0.00000116, 0.00000000],
+		[-6.27336729, -0.00033471, 0.00020504, 0.00033639, -0.00000116, 0.00000000],
+		[-6.27336737, -0.00033468, 0.00020501, 0.00033636, -0.00000116, 0.00000000],
+		[-6.27336746, -0.00033464, 0.00020499, 0.00033632, -0.00000116, 0.00000000],
+		[-6.27336755, -0.00033460, 0.00020497, 0.00033628, -0.00000116, 0.00000000],
+		[-6.27336763, -0.00033457, 0.00020495, 0.00033625, -0.00000116, 0.00000000],
+		[-6.27336772, -0.00033453, 0.00020493, 0.00033621, -0.00000116, 0.00000000],
+		[-6.27336781, -0.00033450, 0.00020490, 0.00033618, -0.00000116, 0.00000000],
+		[-6.27336789, -0.00033446, 0.00020488, 0.00033614, -0.00000116, 0.00000000],
+		[-6.27336798, -0.00033442, 0.00020486, 0.00033610, -0.00000116, 0.00000000],
+		[-6.27336807, -0.00033439, 0.00020484, 0.00033607, -0.00000116, 0.00000000],
+		[-6.27336815, -0.00033435, 0.00020481, 0.00033603, -0.00000116, 0.00000000],
+		[-6.27336824, -0.00033432, 0.00020479, 0.00033599, -0.00000116, 0.00000000],
+		[-6.27336833, -0.00033428, 0.00020477, 0.00033596, -0.00000116, 0.00000000],
+		[-6.27336841, -0.00033424, 0.00020475, 0.00033592, -0.00000116, 0.00000000],
+		[-6.27336850, -0.00033421, 0.00020473, 0.00033588, -0.00000116, 0.00000000],
+		[-6.27336858, -0.00033417, 0.00020470, 0.00033585, -0.00000116, 0.00000000],
+		[-6.27336867, -0.00033413, 0.00020468, 0.00033581, -0.00000116, 0.00000000],
+		[-6.27336876, -0.00033410, 0.00020466, 0.00033578, -0.00000116, 0.00000000],
+		[-6.27336884, -0.00033406, 0.00020464, 0.00033574, -0.00000116, 0.00000000],
+		[-6.27336893, -0.00033403, 0.00020462, 0.00033570, -0.00000116, 0.00000000],
+		[-6.27336902, -0.00033399, 0.00020459, 0.00033567, -0.00000116, 0.00000000],
+		[-6.27336910, -0.00033395, 0.00020457, 0.00033563, -0.00000116, 0.00000000],
+		[-6.27336919, -0.00033392, 0.00020455, 0.00033559, -0.00000116, 0.00000000],
+		[-6.27336927, -0.00033388, 0.00020453, 0.00033556, -0.00000116, 0.00000000],
+		[-6.27336936, -0.00033385, 0.00020451, 0.00033552, -0.00000116, 0.00000000],
+		[-6.27336945, -0.00033381, 0.00020448, 0.00033549, -0.00000116, 0.00000000],
+		[-6.27336953, -0.00033377, 0.00020446, 0.00033545, -0.00000116, 0.00000000],
+		[-6.27336962, -0.00033374, 0.00020444, 0.00033541, -0.00000116, 0.00000000],
+		[-6.27336971, -0.00033370, 0.00020442, 0.00033538, -0.00000116, 0.00000000],
+		[-6.27336979, -0.00033367, 0.00020439, 0.00033534, -0.00000116, 0.00000000],
+		[-6.27336988, -0.00033363, 0.00020437, 0.00033531, -0.00000116, 0.00000000],
+		[-6.27336996, -0.00033359, 0.00020435, 0.00033527, -0.00000116, 0.00000000],
+		[-6.27337005, -0.00033356, 0.00020433, 0.00033523, -0.00000116, 0.00000000],
+		[-6.27337014, -0.00033352, 0.00020431, 0.00033520, -0.00000116, 0.00000000],
+		[-6.27337022, -0.00033349, 0.00020428, 0.00033516, -0.00000116, 0.00000000],
+		[-6.27337031, -0.00033345, 0.00020426, 0.00033513, -0.00000116, 0.00000000],
+		[-6.27337039, -0.00033342, 0.00020424, 0.00033509, -0.00000116, 0.00000000],
+		[-6.27337048, -0.00033338, 0.00020422, 0.00033505, -0.00000116, 0.00000000],
+		[-6.27337057, -0.00033334, 0.00020420, 0.00033502, -0.00000116, 0.00000000],
+		[-6.27337065, -0.00033331, 0.00020417, 0.00033498, -0.00000116, 0.00000000],
+		[-6.27337074, -0.00033327, 0.00020415, 0.00033494, -0.00000116, 0.00000000],
+		[-6.27337082, -0.00033324, 0.00020413, 0.00033491, -0.00000116, 0.00000000],
+		[-6.27337091, -0.00033320, 0.00020411, 0.00033487, -0.00000116, 0.00000000],
+		[-6.27337100, -0.00033316, 0.00020409, 0.00033484, -0.00000116, 0.00000000],
+		[-6.27337108, -0.00033313, 0.00020406, 0.00033480, -0.00000116, 0.00000000],
+		[-6.27337117, -0.00033309, 0.00020404, 0.00033476, -0.00000116, 0.00000000],
+		[-6.27337125, -0.00033306, 0.00020402, 0.00033473, -0.00000116, 0.00000000],
+		[-6.27337134, -0.00033302, 0.00020400, 0.00033469, -0.00000116, 0.00000000],
+		[-6.27337142, -0.00033298, 0.00020398, 0.00033466, -0.00000116, 0.00000000],
+		[-6.27337151, -0.00033295, 0.00020395, 0.00033462, -0.00000116, 0.00000000],
+		[-6.27337160, -0.00033291, 0.00020393, 0.00033458, -0.00000116, 0.00000000],
+		[-6.27337168, -0.00033288, 0.00020391, 0.00033455, -0.00000116, 0.00000000],
+		[-6.27337177, -0.00033284, 0.00020389, 0.00033451, -0.00000116, 0.00000000],
+		[-6.27337185, -0.00033281, 0.00020387, 0.00033448, -0.00000116, 0.00000000],
+		[-6.27337194, -0.00033277, 0.00020385, 0.00033444, -0.00000116, 0.00000000],
+		[-6.27337202, -0.00033273, 0.00020382, 0.00033440, -0.00000116, 0.00000000],
+		[-6.27337211, -0.00033270, 0.00020380, 0.00033437, -0.00000116, 0.00000000],
+		[-6.27337220, -0.00033266, 0.00020378, 0.00033433, -0.00000116, 0.00000000],
+		[-6.27337228, -0.00033263, 0.00020376, 0.00033430, -0.00000116, 0.00000000],
+		[-6.27337237, -0.00033259, 0.00020374, 0.00033426, -0.00000116, 0.00000000],
+		[-6.27337245, -0.00033256, 0.00020371, 0.00033422, -0.00000116, 0.00000000],
+		[-6.27337254, -0.00033252, 0.00020369, 0.00033419, -0.00000116, 0.00000000],
+		[-6.27337262, -0.00033248, 0.00020367, 0.00033415, -0.00000116, 0.00000000],
+		[-6.27337271, -0.00033245, 0.00020365, 0.00033412, -0.00000116, 0.00000000],
+		[-6.27337279, -0.00033241, 0.00020363, 0.00033408, -0.00000116, 0.00000000],
+		[-6.27337288, -0.00033238, 0.00020360, 0.00033405, -0.00000116, 0.00000000],
+		[-6.27337297, -0.00033234, 0.00020358, 0.00033401, -0.00000116, 0.00000000],
+		[-6.27337305, -0.00033231, 0.00020356, 0.00033397, -0.00000116, 0.00000000],
+		[-6.27337314, -0.00033227, 0.00020354, 0.00033394, -0.00000116, 0.00000000],
+		[-6.27337322, -0.00033223, 0.00020352, 0.00033390, -0.00000116, 0.00000000],
+		[-6.27337331, -0.00033220, 0.00020350, 0.00033387, -0.00000116, 0.00000000],
+		[-6.27337339, -0.00033216, 0.00020347, 0.00033383, -0.00000116, 0.00000000],
+		[-6.27337348, -0.00033213, 0.00020345, 0.00033379, -0.00000116, 0.00000000],
+		[-6.27337356, -0.00033209, 0.00020343, 0.00033376, -0.00000116, 0.00000000],
+		[-6.27337365, -0.00033206, 0.00020341, 0.00033372, -0.00000116, 0.00000000],
+		[-6.27337373, -0.00033202, 0.00020339, 0.00033369, -0.00000116, 0.00000000],
+		[-6.27337382, -0.00033198, 0.00020336, 0.00033365, -0.00000116, 0.00000000],
+		[-6.27337390, -0.00033195, 0.00020334, 0.00033362, -0.00000116, 0.00000000],
+		[-6.27337399, -0.00033191, 0.00020332, 0.00033358, -0.00000116, 0.00000000],
+		[-6.27337407, -0.00033188, 0.00020330, 0.00033354, -0.00000116, 0.00000000],
+		[-6.27337416, -0.00033184, 0.00020328, 0.00033351, -0.00000116, 0.00000000],
+		[-6.27337425, -0.00033181, 0.00020326, 0.00033347, -0.00000116, 0.00000000],
+		[-6.27337433, -0.00033177, 0.00020323, 0.00033344, -0.00000116, 0.00000000],
+		[-6.27337442, -0.00033174, 0.00020321, 0.00033340, -0.00000116, 0.00000000],
+		[-6.27337450, -0.00033170, 0.00020319, 0.00033337, -0.00000116, 0.00000000],
+		[-6.27337459, -0.00033166, 0.00020317, 0.00033333, -0.00000116, 0.00000000],
+		[-6.27337467, -0.00033163, 0.00020315, 0.00033329, -0.00000116, 0.00000000],
+		[-6.27337476, -0.00033159, 0.00020312, 0.00033326, -0.00000116, 0.00000000],
+		[-6.27337484, -0.00033156, 0.00020310, 0.00033322, -0.00000116, 0.00000000],
+		[-6.27337493, -0.00033152, 0.00020308, 0.00033319, -0.00000116, 0.00000000],
+		[-6.27337501, -0.00033149, 0.00020306, 0.00033315, -0.00000116, 0.00000000],
+		[-6.27337510, -0.00033145, 0.00020304, 0.00033312, -0.00000116, 0.00000000],
+		[-6.27337518, -0.00033142, 0.00020302, 0.00033308, -0.00000116, 0.00000000],
+		[-6.27337527, -0.00033138, 0.00020299, 0.00033304, -0.00000116, 0.00000000],
+		[-6.27337535, -0.00033135, 0.00020297, 0.00033301, -0.00000116, 0.00000000],
+		[-6.27337544, -0.00033131, 0.00020295, 0.00033297, -0.00000116, 0.00000000],
+		[-6.27337552, -0.00033127, 0.00020293, 0.00033294, -0.00000116, 0.00000000],
+		[-6.27337561, -0.00033124, 0.00020291, 0.00033290, -0.00000116, 0.00000000],
+		[-6.27337569, -0.00033120, 0.00020289, 0.00033287, -0.00000116, 0.00000000],
+		[-6.27337578, -0.00033117, 0.00020286, 0.00033283, -0.00000116, 0.00000000],
+		[-6.27337586, -0.00033113, 0.00020284, 0.00033279, -0.00000116, 0.00000000],
+		[-6.27337594, -0.00033110, 0.00020282, 0.00033276, -0.00000116, 0.00000000],
+		[-6.27337603, -0.00033106, 0.00020280, 0.00033272, -0.00000116, 0.00000000],
+		[-6.27337611, -0.00033103, 0.00020278, 0.00033269, -0.00000116, 0.00000000],
+		[-6.27337620, -0.00033099, 0.00020275, 0.00033265, -0.00000116, 0.00000000],
+		[-6.27337628, -0.00033096, 0.00020273, 0.00033262, -0.00000116, 0.00000000],
+		[-6.27337637, -0.00033092, 0.00020271, 0.00033258, -0.00000116, 0.00000000],
+		[-6.27337645, -0.00033088, 0.00020269, 0.00033255, -0.00000116, 0.00000000],
+		[-6.27337654, -0.00033085, 0.00020267, 0.00033251, -0.00000116, 0.00000000],
+		[-6.27337662, -0.00033081, 0.00020265, 0.00033247, -0.00000116, 0.00000000],
+		[-6.27337671, -0.00033078, 0.00020262, 0.00033244, -0.00000116, 0.00000000],
+		[-6.27337679, -0.00033074, 0.00020260, 0.00033240, -0.00000116, 0.00000000],
+		[-6.27337688, -0.00033071, 0.00020258, 0.00033237, -0.00000116, 0.00000000],
+		[-6.27337696, -0.00033067, 0.00020256, 0.00033233, -0.00000116, 0.00000000],
+		[-6.27337705, -0.00033064, 0.00020254, 0.00033230, -0.00000116, 0.00000000],
+		[-6.27337713, -0.00033060, 0.00020252, 0.00033226, -0.00000116, 0.00000000],
+		[-6.27337721, -0.00033057, 0.00020250, 0.00033223, -0.00000116, 0.00000000],
+		[-6.27337730, -0.00033053, 0.00020247, 0.00033219, -0.00000116, 0.00000000],
+		[-6.27337738, -0.00033050, 0.00020245, 0.00033216, -0.00000116, 0.00000000],
+		[-6.27337747, -0.00033046, 0.00020243, 0.00033212, -0.00000116, 0.00000000],
+		[-6.27337755, -0.00033043, 0.00020241, 0.00033208, -0.00000116, 0.00000000],
+		[-6.27337764, -0.00033039, 0.00020239, 0.00033205, -0.00000116, 0.00000000],
+		[-6.27337772, -0.00033035, 0.00020237, 0.00033201, -0.00000116, 0.00000000],
+		[-6.27337781, -0.00033032, 0.00020234, 0.00033198, -0.00000116, 0.00000000],
+		[-6.27337789, -0.00033028, 0.00020232, 0.00033194, -0.00000116, 0.00000000],
+		[-6.27337797, -0.00033025, 0.00020230, 0.00033191, -0.00000116, 0.00000000],
+		[-6.27337806, -0.00033021, 0.00020228, 0.00033187, -0.00000116, 0.00000000],
+		[-6.27337814, -0.00033018, 0.00020226, 0.00033184, -0.00000116, 0.00000000],
+		[-6.27337823, -0.00033014, 0.00020224, 0.00033180, -0.00000116, 0.00000000],
+		[-6.27337831, -0.00033011, 0.00020221, 0.00033177, -0.00000116, 0.00000000],
+		[-6.27337840, -0.00033007, 0.00020219, 0.00033173, -0.00000116, 0.00000000],
+		[-6.27337848, -0.00033004, 0.00020217, 0.00033169, -0.00000116, 0.00000000],
+		[-6.27337856, -0.00033000, 0.00020215, 0.00033166, -0.00000116, 0.00000000],
+		[-6.27337865, -0.00032997, 0.00020213, 0.00033162, -0.00000116, 0.00000000],
+		[-6.27337873, -0.00032993, 0.00020211, 0.00033159, -0.00000116, 0.00000000],
+		[-6.27337882, -0.00032990, 0.00020208, 0.00033155, -0.00000116, 0.00000000],
+		[-6.27337890, -0.00032986, 0.00020206, 0.00033152, -0.00000116, 0.00000000],
+		[-6.27337899, -0.00032983, 0.00020204, 0.00033148, -0.00000116, 0.00000000],
+		[-6.27337907, -0.00032979, 0.00020202, 0.00033145, -0.00000116, 0.00000000],
+		[-6.27337915, -0.00032976, 0.00020200, 0.00033141, -0.00000116, 0.00000000],
+		[-6.27337924, -0.00032972, 0.00020198, 0.00033138, -0.00000116, 0.00000000],
+		[-6.27337932, -0.00032969, 0.00020196, 0.00033134, -0.00000116, 0.00000000],
+		[-6.27337941, -0.00032965, 0.00020193, 0.00033131, -0.00000116, 0.00000000],
+		[-6.27337949, -0.00032962, 0.00020191, 0.00033127, -0.00000116, 0.00000000],
+		[-6.27337957, -0.00032958, 0.00020189, 0.00033124, -0.00000116, 0.00000000],
+		[-6.27337966, -0.00032955, 0.00020187, 0.00033120, -0.00000116, 0.00000000],
+		[-6.27337974, -0.00032951, 0.00020185, 0.00033116, -0.00000116, 0.00000000],
+		[-6.27337983, -0.00032948, 0.00020183, 0.00033113, -0.00000116, 0.00000000],
+		[-6.27337991, -0.00032944, 0.00020181, 0.00033109, -0.00000116, 0.00000000],
+		[-6.27337999, -0.00032941, 0.00020178, 0.00033106, -0.00000116, 0.00000000],
+		[-6.27338008, -0.00032937, 0.00020176, 0.00033102, -0.00000116, 0.00000000],
+		[-6.27338016, -0.00032934, 0.00020174, 0.00033099, -0.00000116, 0.00000000],
+		[-6.27338025, -0.00032930, 0.00020172, 0.00033095, -0.00000116, 0.00000000],
+		[-6.27338033, -0.00032927, 0.00020170, 0.00033092, -0.00000116, 0.00000000],
+		[-6.27338041, -0.00032923, 0.00020168, 0.00033088, -0.00000116, 0.00000000],
+		[-6.27338050, -0.00032920, 0.00020165, 0.00033085, -0.00000116, 0.00000000],
+		[-6.27338058, -0.00032916, 0.00020163, 0.00033081, -0.00000116, 0.00000000],
+		[-6.27338067, -0.00032913, 0.00020161, 0.00033078, -0.00000116, 0.00000000],
+		[-6.27338075, -0.00032909, 0.00020159, 0.00033074, -0.00000116, 0.00000000],
+		[-6.27338083, -0.00032906, 0.00020157, 0.00033071, -0.00000116, 0.00000000],
+		[-6.27338092, -0.00032902, 0.00020155, 0.00033067, -0.00000116, 0.00000000],
+		[-6.27338100, -0.00032899, 0.00020153, 0.00033064, -0.00000116, 0.00000000],
+		[-6.27338108, -0.00032895, 0.00020150, 0.00033060, -0.00000116, 0.00000000],
+		[-6.27338117, -0.00032892, 0.00020148, 0.00033057, -0.00000116, 0.00000000],
+		[-6.27338125, -0.00032888, 0.00020146, 0.00033053, -0.00000116, 0.00000000],
+		[-6.27338134, -0.00032885, 0.00020144, 0.00033050, -0.00000116, 0.00000000],
+		[-6.27338142, -0.00032881, 0.00020142, 0.00033046, -0.00000116, 0.00000000],
+		[-6.27338150, -0.00032878, 0.00020140, 0.00033043, -0.00000116, 0.00000000],
+		[-6.27338159, -0.00032874, 0.00020138, 0.00033039, -0.00000116, 0.00000000],
+		[-6.27338167, -0.00032871, 0.00020135, 0.00033036, -0.00000116, 0.00000000],
+		[-6.27338175, -0.00032867, 0.00020133, 0.00033032, -0.00000116, 0.00000000],
+		[-6.27338184, -0.00032864, 0.00020131, 0.00033029, -0.00000116, 0.00000000],
+		[-6.27338192, -0.00032860, 0.00020129, 0.00033025, -0.00000116, 0.00000000],
+		[-6.27338200, -0.00032857, 0.00020127, 0.00033022, -0.00000116, 0.00000000],
+		[-6.27338209, -0.00032853, 0.00020125, 0.00033018, -0.00000116, 0.00000000],
+		[-6.27338217, -0.00032850, 0.00020123, 0.00033015, -0.00000116, 0.00000000],
+		[-6.27338225, -0.00032846, 0.00020121, 0.00033011, -0.00000116, 0.00000000],
+		[-6.27338234, -0.00032843, 0.00020118, 0.00033008, -0.00000116, 0.00000000],
+		[-6.27338242, -0.00032839, 0.00020116, 0.00033004, -0.00000116, 0.00000000],
+		[-6.27338250, -0.00032836, 0.00020114, 0.00033001, -0.00000116, 0.00000000],
+		[-6.27338259, -0.00032832, 0.00020112, 0.00032997, -0.00000116, 0.00000000],
+		[-6.27338267, -0.00032829, 0.00020110, 0.00032994, -0.00000116, 0.00000000],
+		[-6.27338275, -0.00032825, 0.00020108, 0.00032990, -0.00000116, 0.00000000],
+		[-6.27338284, -0.00032822, 0.00020106, 0.00032987, -0.00000116, 0.00000000],
+		[-6.27338292, -0.00032818, 0.00020103, 0.00032983, -0.00000116, 0.00000000],
+		[-6.27338300, -0.00032815, 0.00020101, 0.00032980, -0.00000116, 0.00000000],
+		[-6.27338309, -0.00032811, 0.00020099, 0.00032976, -0.00000116, 0.00000000],
+		[-6.27338317, -0.00032808, 0.00020097, 0.00032973, -0.00000116, 0.00000000],
+		[-6.27338325, -0.00032804, 0.00020095, 0.00032969, -0.00000116, 0.00000000],
+		[-6.27338334, -0.00032801, 0.00020093, 0.00032966, -0.00000116, 0.00000000],
+		[-6.27338342, -0.00032797, 0.00020091, 0.00032962, -0.00000116, 0.00000000],
+		[-6.27338350, -0.00032794, 0.00020089, 0.00032959, -0.00000116, 0.00000000],
+		[-6.27338359, -0.00032791, 0.00020086, 0.00032955, -0.00000116, 0.00000000],
+		[-6.27338367, -0.00032787, 0.00020084, 0.00032952, -0.00000116, 0.00000000],
+		[-6.27338375, -0.00032784, 0.00020082, 0.00032948, -0.00000116, 0.00000000],
+		[-6.27338384, -0.00032780, 0.00020080, 0.00032945, -0.00000116, 0.00000000],
+		[-6.27338392, -0.00032777, 0.00020078, 0.00032941, -0.00000116, 0.00000000],
+		[-6.27338400, -0.00032773, 0.00020076, 0.00032938, -0.00000116, 0.00000000],
+		[-6.27338409, -0.00032770, 0.00020074, 0.00032934, -0.00000116, 0.00000000],
+		[-6.27338417, -0.00032766, 0.00020072, 0.00032931, -0.00000116, 0.00000000],
+		[-6.27338425, -0.00032763, 0.00020069, 0.00032927, -0.00000116, 0.00000000],
+		[-6.27338433, -0.00032759, 0.00020067, 0.00032924, -0.00000116, 0.00000000],
+		[-6.27338442, -0.00032756, 0.00020065, 0.00032920, -0.00000116, 0.00000000],
+		[-6.27338450, -0.00032752, 0.00020063, 0.00032917, -0.00000116, 0.00000000],
+		[-6.27338458, -0.00032749, 0.00020061, 0.00032913, -0.00000116, 0.00000000],
+		[-6.27338467, -0.00032745, 0.00020059, 0.00032910, -0.00000116, 0.00000000],
+		[-6.27338475, -0.00032742, 0.00020057, 0.00032906, -0.00000116, 0.00000000],
+		[-6.27338483, -0.00032739, 0.00020055, 0.00032903, -0.00000116, 0.00000000],
+		[-6.27338492, -0.00032735, 0.00020052, 0.00032899, -0.00000116, 0.00000000],
+		[-6.27338500, -0.00032732, 0.00020050, 0.00032896, -0.00000116, 0.00000000],
+		[-6.27338508, -0.00032728, 0.00020048, 0.00032892, -0.00000116, 0.00000000],
+		[-6.27338516, -0.00032725, 0.00020046, 0.00032889, -0.00000116, 0.00000000],
+		[-6.27338525, -0.00032721, 0.00020044, 0.00032885, -0.00000116, 0.00000000],
+		[-6.27338533, -0.00032718, 0.00020042, 0.00032882, -0.00000116, 0.00000000],
+		[-6.27338541, -0.00032714, 0.00020040, 0.00032878, -0.00000116, 0.00000000],
+		[-6.27338550, -0.00032711, 0.00020038, 0.00032875, -0.00000116, 0.00000000],
+		[-6.27338558, -0.00032707, 0.00020035, 0.00032872, -0.00000116, 0.00000000],
+		[-6.27338566, -0.00032704, 0.00020033, 0.00032868, -0.00000116, 0.00000000],
+		[-6.27338574, -0.00032700, 0.00020031, 0.00032865, -0.00000116, 0.00000000],
+		[-6.27338583, -0.00032697, 0.00020029, 0.00032861, -0.00000116, 0.00000000],
+		[-6.27338591, -0.00032694, 0.00020027, 0.00032858, -0.00000116, 0.00000000],
+		[-6.27338599, -0.00032690, 0.00020025, 0.00032854, -0.00000116, 0.00000000],
+		[-6.27338607, -0.00032687, 0.00020023, 0.00032851, -0.00000116, 0.00000000],
+		[-6.27338616, -0.00032683, 0.00020021, 0.00032847, -0.00000116, 0.00000000],
+		[-6.27338624, -0.00032680, 0.00020019, 0.00032844, -0.00000116, 0.00000000],
+		[-6.27338632, -0.00032676, 0.00020016, 0.00032840, -0.00000116, 0.00000000],
+		[-6.27338640, -0.00032673, 0.00020014, 0.00032837, -0.00000116, 0.00000000],
+		[-6.27338649, -0.00032669, 0.00020012, 0.00032833, -0.00000116, 0.00000000],
+		[-6.27338657, -0.00032666, 0.00020010, 0.00032830, -0.00000116, 0.00000000],
+		[-6.27338665, -0.00032663, 0.00020008, 0.00032826, -0.00000116, 0.00000000],
+		[-6.27338674, -0.00032659, 0.00020006, 0.00032823, -0.00000116, 0.00000000],
+		[-6.27338682, -0.00032656, 0.00020004, 0.00032820, -0.00000116, 0.00000000],
+		[-6.27338690, -0.00032652, 0.00020002, 0.00032816, -0.00000116, 0.00000000],
+		[-6.27338698, -0.00032649, 0.00020000, 0.00032813, -0.00000116, 0.00000000],
+		[-6.27338706, -0.00032645, 0.00019997, 0.00032809, -0.00000116, 0.00000000],
+		[-6.27338715, -0.00032642, 0.00019995, 0.00032806, -0.00000116, 0.00000000],
+		[-6.27338723, -0.00032638, 0.00019993, 0.00032802, -0.00000116, 0.00000000],
+		[-6.27338731, -0.00032635, 0.00019991, 0.00032799, -0.00000116, 0.00000000],
+		[-6.27338739, -0.00032632, 0.00019989, 0.00032795, -0.00000116, 0.00000000],
+		[-6.27338748, -0.00032628, 0.00019987, 0.00032792, -0.00000116, 0.00000000],
+		[-6.27338756, -0.00032625, 0.00019985, 0.00032788, -0.00000116, 0.00000000],
+		[-6.27338764, -0.00032621, 0.00019983, 0.00032785, -0.00000116, 0.00000000],
+		[-6.27338772, -0.00032618, 0.00019981, 0.00032781, -0.00000116, 0.00000000],
+		[-6.27338781, -0.00032614, 0.00019978, 0.00032778, -0.00000116, 0.00000000],
+		[-6.27338789, -0.00032611, 0.00019976, 0.00032775, -0.00000116, 0.00000000],
+		[-6.27338797, -0.00032607, 0.00019974, 0.00032771, -0.00000116, 0.00000000],
+		[-6.27338805, -0.00032604, 0.00019972, 0.00032768, -0.00000116, 0.00000000],
+		[-6.27338814, -0.00032601, 0.00019970, 0.00032764, -0.00000116, 0.00000000],
+		[-6.27338822, -0.00032597, 0.00019968, 0.00032761, -0.00000116, 0.00000000],
+		[-6.27338830, -0.00032594, 0.00019966, 0.00032757, -0.00000116, 0.00000000],
+		[-6.27338838, -0.00032590, 0.00019964, 0.00032754, -0.00000116, 0.00000000],
+		[-6.27338846, -0.00032587, 0.00019962, 0.00032750, -0.00000116, 0.00000000],
+		[-6.27338855, -0.00032583, 0.00019960, 0.00032747, -0.00000116, 0.00000000],
+		[-6.27338863, -0.00032580, 0.00019957, 0.00032744, -0.00000116, 0.00000000],
+		[-6.27338871, -0.00032577, 0.00019955, 0.00032740, -0.00000116, 0.00000000],
+		[-6.27338879, -0.00032573, 0.00019953, 0.00032737, -0.00000116, 0.00000000],
+		[-6.27338887, -0.00032570, 0.00019951, 0.00032733, -0.00000116, 0.00000000],
+		[-6.27338896, -0.00032566, 0.00019949, 0.00032730, -0.00000116, 0.00000000],
+		[-6.27338904, -0.00032563, 0.00019947, 0.00032726, -0.00000116, 0.00000000],
+		[-6.27338912, -0.00032559, 0.00019945, 0.00032723, -0.00000116, 0.00000000],
+		[-6.27338920, -0.00032556, 0.00019943, 0.00032719, -0.00000116, 0.00000000],
+		[-6.27338928, -0.00032553, 0.00019941, 0.00032716, -0.00000116, 0.00000000],
+		[-6.27338937, -0.00032549, 0.00019939, 0.00032713, -0.00000116, 0.00000000],
+		[-6.27338945, -0.00032546, 0.00019936, 0.00032709, -0.00000116, 0.00000000],
+		[-6.27338953, -0.00032542, 0.00019934, 0.00032706, -0.00000116, 0.00000000],
+		[-6.27338961, -0.00032539, 0.00019932, 0.00032702, -0.00000116, 0.00000000],
+		[-6.27338969, -0.00032536, 0.00019930, 0.00032699, -0.00000116, 0.00000000],
+		[-6.27338978, -0.00032532, 0.00019928, 0.00032695, -0.00000116, 0.00000000],
+		[-6.27338986, -0.00032529, 0.00019926, 0.00032692, -0.00000116, 0.00000000],
+		[-6.27338994, -0.00032525, 0.00019924, 0.00032688, -0.00000116, 0.00000000],
+		[-6.27339002, -0.00032522, 0.00019922, 0.00032685, -0.00000116, 0.00000000],
+		[-6.27339010, -0.00032518, 0.00019920, 0.00032682, -0.00000116, 0.00000000],
+		[-6.27339019, -0.00032515, 0.00019918, 0.00032678, -0.00000116, 0.00000000],
+		[-6.27339027, -0.00032512, 0.00019915, 0.00032675, -0.00000116, 0.00000000],
+		[-6.27339035, -0.00032508, 0.00019913, 0.00032671, -0.00000116, 0.00000000],
+		[-6.27339043, -0.00032505, 0.00019911, 0.00032668, -0.00000116, 0.00000000],
+		[-6.27339051, -0.00032501, 0.00019909, 0.00032664, -0.00000116, 0.00000000],
+		[-6.27339059, -0.00032498, 0.00019907, 0.00032661, -0.00000116, 0.00000000],
+		[-6.27339068, -0.00032495, 0.00019905, 0.00032658, -0.00000116, 0.00000000],
+		[-6.27339076, -0.00032491, 0.00019903, 0.00032654, -0.00000116, 0.00000000],
+		[-6.27339084, -0.00032488, 0.00019901, 0.00032651, -0.00000116, 0.00000000],
+		[-6.27339092, -0.00032484, 0.00019899, 0.00032647, -0.00000116, 0.00000000],
+		[-6.27339100, -0.00032481, 0.00019897, 0.00032644, -0.00000116, 0.00000000],
+		[-6.27339108, -0.00032477, 0.00019895, 0.00032640, -0.00000116, 0.00000000],
+		[-6.27339117, -0.00032474, 0.00019892, 0.00032637, -0.00000116, 0.00000000],
+		[-6.27339125, -0.00032471, 0.00019890, 0.00032634, -0.00000116, 0.00000000],
+		[-6.27339133, -0.00032467, 0.00019888, 0.00032630, -0.00000116, 0.00000000],
+		[-6.27339141, -0.00032464, 0.00019886, 0.00032627, -0.00000116, 0.00000000],
+		[-6.27339149, -0.00032460, 0.00019884, 0.00032623, -0.00000116, 0.00000000],
+		[-6.27339157, -0.00032457, 0.00019882, 0.00032620, -0.00000116, 0.00000000],
+		[-6.27339165, -0.00032454, 0.00019880, 0.00032617, -0.00000116, 0.00000000],
+		[-6.27339174, -0.00032450, 0.00019878, 0.00032613, -0.00000116, 0.00000000],
+		[-6.27339182, -0.00032447, 0.00019876, 0.00032610, -0.00000116, 0.00000000],
+		[-6.27339190, -0.00032443, 0.00019874, 0.00032606, -0.00000116, 0.00000000],
+		[-6.27339198, -0.00032440, 0.00019872, 0.00032603, -0.00000116, 0.00000000],
+		[-6.27339206, -0.00032437, 0.00019870, 0.00032599, -0.00000116, 0.00000000],
+		[-6.27339214, -0.00032433, 0.00019867, 0.00032596, -0.00000116, 0.00000000],
+		[-6.27339222, -0.00032430, 0.00019865, 0.00032593, -0.00000116, 0.00000000],
+		[-6.27339231, -0.00032426, 0.00019863, 0.00032589, -0.00000116, 0.00000000],
+		[-6.27339239, -0.00032423, 0.00019861, 0.00032586, -0.00000116, 0.00000000],
+		[-6.27339247, -0.00032420, 0.00019859, 0.00032582, -0.00000116, 0.00000000],
+		[-6.27339255, -0.00032416, 0.00019857, 0.00032579, -0.00000116, 0.00000000],
+		[-6.27339263, -0.00032413, 0.00019855, 0.00032576, -0.00000116, 0.00000000],
+		[-6.27339271, -0.00032409, 0.00019853, 0.00032572, -0.00000116, 0.00000000],
+		[-6.27339279, -0.00032406, 0.00019851, 0.00032569, -0.00000116, 0.00000000],
+		[-6.27339287, -0.00032403, 0.00019849, 0.00032565, -0.00000116, 0.00000000],
+		[-6.27339296, -0.00032399, 0.00019847, 0.00032562, -0.00000116, 0.00000000],
+		[-6.27339304, -0.00032396, 0.00019845, 0.00032558, -0.00000116, 0.00000000],
+		[-6.27339312, -0.00032393, 0.00019843, 0.00032555, -0.00000116, 0.00000000],
+		[-6.27339320, -0.00032389, 0.00019840, 0.00032552, -0.00000116, 0.00000000],
+		[-6.27339328, -0.00032386, 0.00019838, 0.00032548, -0.00000116, 0.00000000],
+		[-6.27339336, -0.00032382, 0.00019836, 0.00032545, -0.00000116, 0.00000000],
+		[-6.27339344, -0.00032379, 0.00019834, 0.00032541, -0.00000116, 0.00000000],
+		[-6.27339352, -0.00032376, 0.00019832, 0.00032538, -0.00000116, 0.00000000],
+		[-6.27339360, -0.00032372, 0.00019830, 0.00032535, -0.00000116, 0.00000000],
+		[-6.27339369, -0.00032369, 0.00019828, 0.00032531, -0.00000116, 0.00000000],
+		[-6.27339377, -0.00032365, 0.00019826, 0.00032528, -0.00000116, 0.00000000],
+		[-6.27339385, -0.00032362, 0.00019824, 0.00032524, -0.00000116, 0.00000000],
+		[-6.27339393, -0.00032359, 0.00019822, 0.00032521, -0.00000116, 0.00000000],
+		[-6.27339401, -0.00032355, 0.00019820, 0.00032518, -0.00000116, 0.00000000],
+		[-6.27339409, -0.00032352, 0.00019818, 0.00032514, -0.00000116, 0.00000000],
+		[-6.27339417, -0.00032349, 0.00019816, 0.00032511, -0.00000116, 0.00000000],
+		[-6.27339425, -0.00032345, 0.00019813, 0.00032507, -0.00000116, 0.00000000],
+		[-6.27339433, -0.00032342, 0.00019811, 0.00032504, -0.00000116, 0.00000000],
+		[-6.27339441, -0.00032338, 0.00019809, 0.00032501, -0.00000116, 0.00000000],
+		[-6.27339450, -0.00032335, 0.00019807, 0.00032497, -0.00000116, 0.00000000],
+		[-6.27339458, -0.00032332, 0.00019805, 0.00032494, -0.00000116, 0.00000000],
+		[-6.27339466, -0.00032328, 0.00019803, 0.00032490, -0.00000116, 0.00000000],
+		[-6.27339474, -0.00032325, 0.00019801, 0.00032487, -0.00000116, 0.00000000],
+		[-6.27339482, -0.00032321, 0.00019799, 0.00032484, -0.00000116, 0.00000000],
+		[-6.27339490, -0.00032318, 0.00019797, 0.00032480, -0.00000116, 0.00000000],
+		[-6.27339498, -0.00032315, 0.00019795, 0.00032477, -0.00000116, 0.00000000],
+		[-6.27339506, -0.00032311, 0.00019793, 0.00032473, -0.00000116, 0.00000000],
+		[-6.27339514, -0.00032308, 0.00019791, 0.00032470, -0.00000116, 0.00000000],
+		[-6.27339522, -0.00032305, 0.00019789, 0.00032467, -0.00000116, 0.00000000],
+		[-6.27339530, -0.00032301, 0.00019787, 0.00032463, -0.00000116, 0.00000000],
+		[-6.27339538, -0.00032298, 0.00019785, 0.00032460, -0.00000116, 0.00000000],
+		[-6.27339546, -0.00032295, 0.00019782, 0.00032457, -0.00000116, 0.00000000],
+		[-6.27339555, -0.00032291, 0.00019780, 0.00032453, -0.00000116, 0.00000000],
+		[-6.27339563, -0.00032288, 0.00019778, 0.00032450, -0.00000116, 0.00000000],
+		[-6.27339571, -0.00032284, 0.00019776, 0.00032446, -0.00000116, 0.00000000],
+		[-6.27339579, -0.00032281, 0.00019774, 0.00032443, -0.00000116, 0.00000000],
+		[-6.27339587, -0.00032278, 0.00019772, 0.00032440, -0.00000116, 0.00000000],
+		[-6.27339595, -0.00032274, 0.00019770, 0.00032436, -0.00000116, 0.00000000],
+		[-6.27339603, -0.00032271, 0.00019768, 0.00032433, -0.00000116, 0.00000000],
+		[-6.27339611, -0.00032268, 0.00019766, 0.00032429, -0.00000116, 0.00000000],
+		[-6.27339619, -0.00032264, 0.00019764, 0.00032426, -0.00000116, 0.00000000],
+		[-6.27339627, -0.00032261, 0.00019762, 0.00032423, -0.00000116, 0.00000000],
+		[-6.27339635, -0.00032258, 0.00019760, 0.00032419, -0.00000116, 0.00000000],
+		[-6.27339643, -0.00032254, 0.00019758, 0.00032416, -0.00000116, 0.00000000],
+		[-6.27339651, -0.00032251, 0.00019756, 0.00032413, -0.00000116, 0.00000000],
+		[-6.27339659, -0.00032247, 0.00019754, 0.00032409, -0.00000116, 0.00000000],
+		[-6.27339667, -0.00032244, 0.00019752, 0.00032406, -0.00000116, 0.00000000],
+		[-6.27339675, -0.00032241, 0.00019749, 0.00032402, -0.00000116, 0.00000000],
+		[-6.27339683, -0.00032237, 0.00019747, 0.00032399, -0.00000116, 0.00000000],
+		[-6.27339691, -0.00032234, 0.00019745, 0.00032396, -0.00000116, 0.00000000],
+		[-6.27339699, -0.00032231, 0.00019743, 0.00032392, -0.00000116, 0.00000000],
+		[-6.27339708, -0.00032227, 0.00019741, 0.00032389, -0.00000116, 0.00000000],
+		[-6.27339716, -0.00032224, 0.00019739, 0.00032386, -0.00000116, 0.00000000],
+		[-6.27339724, -0.00032221, 0.00019737, 0.00032382, -0.00000116, 0.00000000],
+		[-6.27339732, -0.00032217, 0.00019735, 0.00032379, -0.00000116, 0.00000000],
+		[-6.27339740, -0.00032214, 0.00019733, 0.00032375, -0.00000116, 0.00000000],
+		[-6.27339748, -0.00032210, 0.00019731, 0.00032372, -0.00000116, 0.00000000],
+		[-6.27339756, -0.00032207, 0.00019729, 0.00032369, -0.00000116, 0.00000000],
+		[-6.27339764, -0.00032204, 0.00019727, 0.00032365, -0.00000116, 0.00000000],
+		[-6.27339772, -0.00032200, 0.00019725, 0.00032362, -0.00000116, 0.00000000],
+		[-6.27339780, -0.00032197, 0.00019723, 0.00032359, -0.00000116, 0.00000000],
+		[-6.27339788, -0.00032194, 0.00019721, 0.00032355, -0.00000116, 0.00000000],
+		[-6.27339796, -0.00032190, 0.00019719, 0.00032352, -0.00000116, 0.00000000],
+		[-6.27339804, -0.00032187, 0.00019717, 0.00032349, -0.00000116, 0.00000000],
+		[-6.27339812, -0.00032184, 0.00019715, 0.00032345, -0.00000116, 0.00000000],
+		[-6.27339820, -0.00032180, 0.00019713, 0.00032342, -0.00000116, 0.00000000],
+		[-6.27339828, -0.00032177, 0.00019710, 0.00032338, -0.00000116, 0.00000000],
+		[-6.27339836, -0.00032174, 0.00019708, 0.00032335, -0.00000116, 0.00000000],
+		[-6.27339844, -0.00032170, 0.00019706, 0.00032332, -0.00000116, 0.00000000],
+		[-6.27339852, -0.00032167, 0.00019704, 0.00032328, -0.00000116, 0.00000000],
+		[-6.27339860, -0.00032164, 0.00019702, 0.00032325, -0.00000116, 0.00000000],
+		[-6.27339868, -0.00032160, 0.00019700, 0.00032322, -0.00000116, 0.00000000],
+		[-6.27339876, -0.00032157, 0.00019698, 0.00032318, -0.00000116, 0.00000000],
+		[-6.27339884, -0.00032154, 0.00019696, 0.00032315, -0.00000116, 0.00000000],
+		[-6.27339892, -0.00032150, 0.00019694, 0.00032312, -0.00000116, 0.00000000],
+		[-6.27339900, -0.00032147, 0.00019692, 0.00032308, -0.00000116, 0.00000000],
+		[-6.27339908, -0.00032144, 0.00019690, 0.00032305, -0.00000116, 0.00000000],
+		[-6.27339916, -0.00032140, 0.00019688, 0.00032302, -0.00000116, 0.00000000],
+		[-6.27339924, -0.00032137, 0.00019686, 0.00032298, -0.00000116, 0.00000000],
+		[-6.27339932, -0.00032134, 0.00019684, 0.00032295, -0.00000116, 0.00000000],
+		[-6.27339940, -0.00032130, 0.00019682, 0.00032291, -0.00000116, 0.00000000],
+		[-6.27339948, -0.00032127, 0.00019680, 0.00032288, -0.00000116, 0.00000000],
+		[-6.27339956, -0.00032124, 0.00019678, 0.00032285, -0.00000116, 0.00000000],
+		[-6.27339964, -0.00032120, 0.00019676, 0.00032281, -0.00000116, 0.00000000],
+		[-6.27339972, -0.00032117, 0.00019674, 0.00032278, -0.00000116, 0.00000000],
+		[-6.27339980, -0.00032114, 0.00019672, 0.00032275, -0.00000116, 0.00000000],
+		[-6.27339988, -0.00032110, 0.00019670, 0.00032271, -0.00000116, 0.00000000],
+		[-6.27339996, -0.00032107, 0.00019668, 0.00032268, -0.00000116, 0.00000000],
+		[-6.27340004, -0.00032104, 0.00019665, 0.00032265, -0.00000116, 0.00000000],
+		[-6.27340012, -0.00032100, 0.00019663, 0.00032261, -0.00000116, 0.00000000],
+		[-6.27340020, -0.00032097, 0.00019661, 0.00032258, -0.00000116, 0.00000000],
+		[-6.27340028, -0.00032094, 0.00019659, 0.00032255, -0.00000116, 0.00000000],
+		[-6.27340036, -0.00032090, 0.00019657, 0.00032251, -0.00000116, 0.00000000],
+		[-6.27340043, -0.00032087, 0.00019655, 0.00032248, -0.00000116, 0.00000000],
+		[-6.27340051, -0.00032084, 0.00019653, 0.00032245, -0.00000116, 0.00000000],
+		[-6.27340059, -0.00032080, 0.00019651, 0.00032241, -0.00000116, 0.00000000],
+		[-6.27340067, -0.00032077, 0.00019649, 0.00032238, -0.00000116, 0.00000000],
+		[-6.27340075, -0.00032074, 0.00019647, 0.00032235, -0.00000116, 0.00000000],
+		[-6.27340083, -0.00032070, 0.00019645, 0.00032231, -0.00000116, 0.00000000],
+		[-6.27340091, -0.00032067, 0.00019643, 0.00032228, -0.00000116, 0.00000000],
+		[-6.27340099, -0.00032064, 0.00019641, 0.00032225, -0.00000116, 0.00000000],
+		[-6.27340107, -0.00032060, 0.00019639, 0.00032221, -0.00000116, 0.00000000],
+		[-6.27340115, -0.00032057, 0.00019637, 0.00032218, -0.00000116, 0.00000000],
+		[-6.27340123, -0.00032054, 0.00019635, 0.00032215, -0.00000116, 0.00000000],
+		[-6.27340131, -0.00032050, 0.00019633, 0.00032211, -0.00000116, 0.00000000],
+		[-6.27340139, -0.00032047, 0.00019631, 0.00032208, -0.00000116, 0.00000000],
+		[-6.27340147, -0.00032044, 0.00019629, 0.00032205, -0.00000116, 0.00000000],
+		[-6.27340155, -0.00032040, 0.00019627, 0.00032201, -0.00000116, 0.00000000],
+		[-6.27340163, -0.00032037, 0.00019625, 0.00032198, -0.00000116, 0.00000000],
+		[-6.27340171, -0.00032034, 0.00019623, 0.00032195, -0.00000116, 0.00000000],
+		[-6.27340179, -0.00032031, 0.00019621, 0.00032191, -0.00000116, 0.00000000],
+		[-6.27340187, -0.00032027, 0.00019619, 0.00032188, -0.00000116, 0.00000000],
+		[-6.27340194, -0.00032024, 0.00019617, 0.00032185, -0.00000116, 0.00000000],
+		[-6.27340202, -0.00032021, 0.00019615, 0.00032181, -0.00000116, 0.00000000],
+		[-6.27340210, -0.00032017, 0.00019613, 0.00032178, -0.00000116, 0.00000000],
+		[-6.27340218, -0.00032014, 0.00019611, 0.00032175, -0.00000116, 0.00000000],
+		[-6.27340226, -0.00032011, 0.00019608, 0.00032171, -0.00000116, 0.00000000],
+		[-6.27340234, -0.00032007, 0.00019606, 0.00032168, -0.00000116, 0.00000000],
+		[-6.27340242, -0.00032004, 0.00019604, 0.00032165, -0.00000116, 0.00000000],
+		[-6.27340250, -0.00032001, 0.00019602, 0.00032161, -0.00000116, 0.00000000],
+		[-6.27340258, -0.00031997, 0.00019600, 0.00032158, -0.00000116, 0.00000000],
+		[-6.27340266, -0.00031994, 0.00019598, 0.00032155, -0.00000116, 0.00000000],
+		[-6.27340274, -0.00031991, 0.00019596, 0.00032151, -0.00000116, 0.00000000],
+		[-6.27340282, -0.00031987, 0.00019594, 0.00032148, -0.00000116, 0.00000000],
+		[-6.27340290, -0.00031984, 0.00019592, 0.00032145, -0.00000116, 0.00000000],
+		[-6.27340297, -0.00031981, 0.00019590, 0.00032141, -0.00000116, 0.00000000],
+		[-6.27340305, -0.00031978, 0.00019588, 0.00032138, -0.00000116, 0.00000000],
+		[-6.27340313, -0.00031974, 0.00019586, 0.00032135, -0.00000116, 0.00000000],
+		[-6.27340321, -0.00031971, 0.00019584, 0.00032131, -0.00000116, 0.00000000],
+		[-6.27340329, -0.00031968, 0.00019582, 0.00032128, -0.00000116, 0.00000000],
+		[-6.27340337, -0.00031964, 0.00019580, 0.00032125, -0.00000116, 0.00000000],
+		[-6.27340345, -0.00031961, 0.00019578, 0.00032121, -0.00000116, 0.00000000],
+		[-6.27340353, -0.00031958, 0.00019576, 0.00032118, -0.00000116, 0.00000000],
+		[-6.27340361, -0.00031954, 0.00019574, 0.00032115, -0.00000116, 0.00000000],
+		[-6.27340369, -0.00031951, 0.00019572, 0.00032111, -0.00000116, 0.00000000],
+		[-6.27340377, -0.00031948, 0.00019570, 0.00032108, -0.00000116, 0.00000000],
+		[-6.27340384, -0.00031945, 0.00019568, 0.00032105, -0.00000116, 0.00000000],
+		[-6.27340392, -0.00031941, 0.00019566, 0.00032102, -0.00000116, 0.00000000],
+		[-6.27340400, -0.00031938, 0.00019564, 0.00032098, -0.00000116, 0.00000000],
+		[-6.27340408, -0.00031935, 0.00019562, 0.00032095, -0.00000116, 0.00000000],
+		[-6.27340416, -0.00031931, 0.00019560, 0.00032092, -0.00000116, 0.00000000],
+		[-6.27340424, -0.00031928, 0.00019558, 0.00032088, -0.00000116, 0.00000000],
+		[-6.27340432, -0.00031925, 0.00019556, 0.00032085, -0.00000116, 0.00000000],
+		[-6.27340440, -0.00031922, 0.00019554, 0.00032082, -0.00000116, 0.00000000],
+		[-6.27340448, -0.00031918, 0.00019552, 0.00032078, -0.00000116, 0.00000000],
+		[-6.27340455, -0.00031915, 0.00019550, 0.00032075, -0.00000116, 0.00000000],
+		[-6.27340463, -0.00031912, 0.00019548, 0.00032072, -0.00000116, 0.00000000],
+		[-6.27340471, -0.00031908, 0.00019546, 0.00032068, -0.00000116, 0.00000000],
+		[-6.27340479, -0.00031905, 0.00019544, 0.00032065, -0.00000116, 0.00000000],
+		[-6.27340487, -0.00031902, 0.00019542, 0.00032062, -0.00000116, 0.00000000],
+		[-6.27340495, -0.00031899, 0.00019540, 0.00032059, -0.00000116, 0.00000000],
+		[-6.27340503, -0.00031895, 0.00019538, 0.00032055, -0.00000116, 0.00000000],
+		[-6.27340511, -0.00031892, 0.00019536, 0.00032052, -0.00000116, 0.00000000],
+		[-6.27340518, -0.00031889, 0.00019534, 0.00032049, -0.00000116, 0.00000000],
+		[-6.27340526, -0.00031885, 0.00019532, 0.00032045, -0.00000116, 0.00000000],
+		[-6.27340534, -0.00031882, 0.00019530, 0.00032042, -0.00000116, 0.00000000],
+		[-6.27340542, -0.00031879, 0.00019528, 0.00032039, -0.00000116, 0.00000000],
+		[-6.27340550, -0.00031876, 0.00019526, 0.00032035, -0.00000116, 0.00000000],
+		[-6.27340558, -0.00031872, 0.00019524, 0.00032032, -0.00000116, 0.00000000],
+		[-6.27340566, -0.00031869, 0.00019522, 0.00032029, -0.00000116, 0.00000000],
+		[-6.27340573, -0.00031866, 0.00019520, 0.00032026, -0.00000116, 0.00000000],
+		[-6.27340581, -0.00031862, 0.00019518, 0.00032022, -0.00000116, 0.00000000],
+		[-6.27340589, -0.00031859, 0.00019516, 0.00032019, -0.00000116, 0.00000000],
+		[-6.27340597, -0.00031856, 0.00019514, 0.00032016, -0.00000116, 0.00000000],
+		[-6.27340605, -0.00031853, 0.00019512, 0.00032012, -0.00000116, 0.00000000],
+		[-6.27340613, -0.00031849, 0.00019510, 0.00032009, -0.00000116, 0.00000000],
+		[-6.27340621, -0.00031846, 0.00019508, 0.00032006, -0.00000116, 0.00000000],
+		[-6.27340628, -0.00031843, 0.00019506, 0.00032002, -0.00000116, 0.00000000],
+		[-6.27340636, -0.00031839, 0.00019504, 0.00031999, -0.00000116, 0.00000000],
+		[-6.27340644, -0.00031836, 0.00019502, 0.00031996, -0.00000116, 0.00000000],
+		[-6.27340652, -0.00031833, 0.00019500, 0.00031993, -0.00000116, 0.00000000],
+		[-6.27340660, -0.00031830, 0.00019498, 0.00031989, -0.00000116, 0.00000000],
+		[-6.27340668, -0.00031826, 0.00019496, 0.00031986, -0.00000116, 0.00000000],
+		[-6.27340675, -0.00031823, 0.00019494, 0.00031983, -0.00000116, 0.00000000],
+		[-6.27340683, -0.00031820, 0.00019492, 0.00031979, -0.00000116, 0.00000000],
+		[-6.27340691, -0.00031817, 0.00019490, 0.00031976, -0.00000116, 0.00000000],
+		[-6.27340699, -0.00031813, 0.00019488, 0.00031973, -0.00000116, 0.00000000],
+		[-6.27340707, -0.00031810, 0.00019486, 0.00031970, -0.00000116, 0.00000000],
+		[-6.27340715, -0.00031807, 0.00019484, 0.00031966, -0.00000116, 0.00000000],
+		[-6.27340722, -0.00031803, 0.00019482, 0.00031963, -0.00000116, 0.00000000],
+		[-6.27340730, -0.00031800, 0.00019480, 0.00031960, -0.00000116, 0.00000000],
+		[-6.27340738, -0.00031797, 0.00019478, 0.00031956, -0.00000116, 0.00000000],
+		[-6.27340746, -0.00031794, 0.00019476, 0.00031953, -0.00000116, 0.00000000],
+		[-6.27340754, -0.00031790, 0.00019474, 0.00031950, -0.00000116, 0.00000000],
+		[-6.27340761, -0.00031787, 0.00019472, 0.00031947, -0.00000116, 0.00000000],
+		[-6.27340769, -0.00031784, 0.00019470, 0.00031943, -0.00000116, 0.00000000],
+		[-6.27340777, -0.00031781, 0.00019468, 0.00031940, -0.00000116, 0.00000000],
+		[-6.27340785, -0.00031777, 0.00019466, 0.00031937, -0.00000116, 0.00000000],
+		[-6.27340793, -0.00031774, 0.00019464, 0.00031933, -0.00000116, 0.00000000],
+		[-6.27340801, -0.00031771, 0.00019462, 0.00031930, -0.00000116, 0.00000000],
+		[-6.27340808, -0.00031768, 0.00019460, 0.00031927, -0.00000116, 0.00000000],
+		[-6.27340816, -0.00031764, 0.00019458, 0.00031924, -0.00000116, 0.00000000],
+		[-6.27340824, -0.00031761, 0.00019456, 0.00031920, -0.00000116, 0.00000000],
+		[-6.27340832, -0.00031758, 0.00019454, 0.00031917, -0.00000116, 0.00000000],
+		[-6.27340840, -0.00031755, 0.00019452, 0.00031914, -0.00000116, 0.00000000],
+		[-6.27340847, -0.00031751, 0.00019450, 0.00031911, -0.00000116, 0.00000000],
+		[-6.27340855, -0.00031748, 0.00019448, 0.00031907, -0.00000116, 0.00000000],
+		[-6.27340863, -0.00031745, 0.00019446, 0.00031904, -0.00000116, 0.00000000],
+		[-6.27340871, -0.00031742, 0.00019444, 0.00031901, -0.00000116, 0.00000000],
+		[-6.27340879, -0.00031738, 0.00019442, 0.00031897, -0.00000116, 0.00000000],
+		[-6.27340886, -0.00031735, 0.00019440, 0.00031894, -0.00000116, 0.00000000],
+		[-6.27340894, -0.00031732, 0.00019438, 0.00031891, -0.00000116, 0.00000000],
+		[-6.27340902, -0.00031728, 0.00019436, 0.00031888, -0.00000116, 0.00000000],
+		[-6.27340910, -0.00031725, 0.00019434, 0.00031884, -0.00000116, 0.00000000],
+		[-6.27340917, -0.00031722, 0.00019432, 0.00031881, -0.00000116, 0.00000000],
+		[-6.27340925, -0.00031719, 0.00019430, 0.00031878, -0.00000116, 0.00000000],
+		[-6.27340933, -0.00031715, 0.00019428, 0.00031875, -0.00000116, 0.00000000],
+		[-6.27340941, -0.00031712, 0.00019426, 0.00031871, -0.00000116, 0.00000000],
+		[-6.27340949, -0.00031709, 0.00019424, 0.00031868, -0.00000116, 0.00000000],
+		[-6.27340956, -0.00031706, 0.00019422, 0.00031865, -0.00000116, 0.00000000],
+		[-6.27340964, -0.00031702, 0.00019420, 0.00031862, -0.00000116, 0.00000000],
+		[-6.27340972, -0.00031699, 0.00019418, 0.00031858, -0.00000116, 0.00000000],
+		[-6.27340980, -0.00031696, 0.00019416, 0.00031855, -0.00000116, 0.00000000],
+		[-6.27340987, -0.00031693, 0.00019414, 0.00031852, -0.00000116, 0.00000000],
+		[-6.27340995, -0.00031690, 0.00019412, 0.00031848, -0.00000116, 0.00000000],
+		[-6.27341003, -0.00031686, 0.00019410, 0.00031845, -0.00000116, 0.00000000],
+		[-6.27341011, -0.00031683, 0.00019408, 0.00031842, -0.00000116, 0.00000000],
+		[-6.27341019, -0.00031680, 0.00019406, 0.00031839, -0.00000116, 0.00000000],
+		[-6.27341026, -0.00031677, 0.00019404, 0.00031835, -0.00000116, 0.00000000],
+		[-6.27341034, -0.00031673, 0.00019402, 0.00031832, -0.00000116, 0.00000000],
+		[-6.27341042, -0.00031670, 0.00019400, 0.00031829, -0.00000116, 0.00000000],
+		[-6.27341050, -0.00031667, 0.00019398, 0.00031826, -0.00000116, 0.00000000],
+		[-6.27341057, -0.00031664, 0.00019396, 0.00031822, -0.00000116, 0.00000000],
+		[-6.27341065, -0.00031660, 0.00019394, 0.00031819, -0.00000116, 0.00000000],
+		[-6.27341073, -0.00031657, 0.00019392, 0.00031816, -0.00000116, 0.00000000],
+		[-6.27341081, -0.00031654, 0.00019390, 0.00031813, -0.00000116, 0.00000000],
+		[-6.27341088, -0.00031651, 0.00019388, 0.00031809, -0.00000116, 0.00000000],
+		[-6.27341096, -0.00031647, 0.00019386, 0.00031806, -0.00000116, 0.00000000],
+		[-6.27341104, -0.00031644, 0.00019384, 0.00031803, -0.00000116, 0.00000000],
+		[-6.27341112, -0.00031641, 0.00019382, 0.00031800, -0.00000116, 0.00000000],
+		[-6.27341119, -0.00031638, 0.00019380, 0.00031796, -0.00000116, 0.00000000],
+		[-6.27341127, -0.00031634, 0.00019378, 0.00031793, -0.00000116, 0.00000000],
+		[-6.27341135, -0.00031631, 0.00019376, 0.00031790, -0.00000116, 0.00000000],
+		[-6.27341143, -0.00031628, 0.00019374, 0.00031787, -0.00000116, 0.00000000],
+		[-6.27341150, -0.00031625, 0.00019372, 0.00031783, -0.00000116, 0.00000000],
+		[-6.27341158, -0.00031622, 0.00019370, 0.00031780, -0.00000116, 0.00000000],
+		[-6.27341166, -0.00031618, 0.00019368, 0.00031777, -0.00000116, 0.00000000],
+		[-6.27341173, -0.00031615, 0.00019366, 0.00031774, -0.00000116, 0.00000000],
+		[-6.27341181, -0.00031612, 0.00019364, 0.00031770, -0.00000116, 0.00000000],
+		[-6.27341189, -0.00031609, 0.00019362, 0.00031767, -0.00000116, 0.00000000],
+		[-6.27341197, -0.00031605, 0.00019360, 0.00031764, -0.00000116, 0.00000000],
+		[-6.27341204, -0.00031602, 0.00019358, 0.00031761, -0.00000116, 0.00000000],
+		[-6.27341212, -0.00031599, 0.00019356, 0.00031757, -0.00000116, 0.00000000],
+		[-6.27341220, -0.00031596, 0.00019354, 0.00031754, -0.00000116, 0.00000000],
+		[-6.27341228, -0.00031592, 0.00019352, 0.00031751, -0.00000116, 0.00000000],
+		[-6.27341235, -0.00031589, 0.00019350, 0.00031748, -0.00000116, 0.00000000],
+		[-6.27341243, -0.00031586, 0.00019348, 0.00031744, -0.00000116, 0.00000000],
+		[-6.27341251, -0.00031583, 0.00019346, 0.00031741, -0.00000116, 0.00000000],
+		[-6.27341258, -0.00031580, 0.00019344, 0.00031738, -0.00000116, 0.00000000],
+		[-6.27341266, -0.00031576, 0.00019342, 0.00031735, -0.00000116, 0.00000000],
+		[-6.27341274, -0.00031573, 0.00019340, 0.00031732, -0.00000116, 0.00000000],
+		[-6.27341282, -0.00031570, 0.00019338, 0.00031728, -0.00000116, 0.00000000],
+		[-6.27341289, -0.00031567, 0.00019336, 0.00031725, -0.00000116, 0.00000000],
+		[-6.27341297, -0.00031563, 0.00019334, 0.00031722, -0.00000116, 0.00000000],
+		[-6.27341305, -0.00031560, 0.00019333, 0.00031719, -0.00000116, 0.00000000],
+		[-6.27341312, -0.00031557, 0.00019331, 0.00031715, -0.00000116, 0.00000000],
+		[-6.27341320, -0.00031554, 0.00019329, 0.00031712, -0.00000116, 0.00000000],
+		[-6.27341328, -0.00031551, 0.00019327, 0.00031709, -0.00000116, 0.00000000],
+		[-6.27341336, -0.00031547, 0.00019325, 0.00031706, -0.00000116, 0.00000000],
+		[-6.27341343, -0.00031544, 0.00019323, 0.00031702, -0.00000116, 0.00000000],
+		[-6.27341351, -0.00031541, 0.00019321, 0.00031699, -0.00000116, 0.00000000],
+		[-6.27341359, -0.00031538, 0.00019319, 0.00031696, -0.00000116, 0.00000000],
+		[-6.27341366, -0.00031535, 0.00019317, 0.00031693, -0.00000116, 0.00000000],
+		[-6.27341374, -0.00031531, 0.00019315, 0.00031689, -0.00000116, 0.00000000],
+		[-6.27341382, -0.00031528, 0.00019313, 0.00031686, -0.00000116, 0.00000000],
+		[-6.27341389, -0.00031525, 0.00019311, 0.00031683, -0.00000116, 0.00000000],
+		[-6.27341397, -0.00031522, 0.00019309, 0.00031680, -0.00000116, 0.00000000],
+		[-6.27341405, -0.00031519, 0.00019307, 0.00031677, -0.00000116, 0.00000000],
+		[-6.27341412, -0.00031515, 0.00019305, 0.00031673, -0.00000116, 0.00000000],
+		[-6.27341420, -0.00031512, 0.00019303, 0.00031670, -0.00000116, 0.00000000],
+		[-6.27341428, -0.00031509, 0.00019301, 0.00031667, -0.00000116, 0.00000000],
+		[-6.27341435, -0.00031506, 0.00019299, 0.00031664, -0.00000116, 0.00000000],
+		[-6.27341443, -0.00031502, 0.00019297, 0.00031660, -0.00000116, 0.00000000],
+		[-6.27341451, -0.00031499, 0.00019295, 0.00031657, -0.00000116, 0.00000000],
+		[-6.27341459, -0.00031496, 0.00019293, 0.00031654, -0.00000116, 0.00000000],
+		[-6.27341466, -0.00031493, 0.00019291, 0.00031651, -0.00000116, 0.00000000],
+		[-6.27341474, -0.00031490, 0.00019289, 0.00031648, -0.00000116, 0.00000000],
+		[-6.27341482, -0.00031486, 0.00019287, 0.00031644, -0.00000116, 0.00000000],
+		[-6.27341489, -0.00031483, 0.00019285, 0.00031641, -0.00000116, 0.00000000],
+		[-6.27341497, -0.00031480, 0.00019283, 0.00031638, -0.00000116, 0.00000000],
+		[-6.27341505, -0.00031477, 0.00019281, 0.00031635, -0.00000116, 0.00000000],
+		[-6.27341512, -0.00031474, 0.00019279, 0.00031631, -0.00000116, 0.00000000],
+		[-6.27341520, -0.00031470, 0.00019277, 0.00031628, -0.00000116, 0.00000000],
+		[-6.27341528, -0.00031467, 0.00019275, 0.00031625, -0.00000116, 0.00000000],
+		[-6.27341535, -0.00031464, 0.00019274, 0.00031622, -0.00000116, 0.00000000],
+		[-6.27341543, -0.00031461, 0.00019272, 0.00031619, -0.00000116, 0.00000000],
+		[-6.27341550, -0.00031458, 0.00019270, 0.00031615, -0.00000116, 0.00000000],
+		[-6.27341558, -0.00031454, 0.00019268, 0.00031612, -0.00000116, 0.00000000],
+		[-6.27341566, -0.00031451, 0.00019266, 0.00031609, -0.00000116, 0.00000000],
+		[-6.27341573, -0.00031448, 0.00019264, 0.00031606, -0.00000116, 0.00000000],
+		[-6.27341581, -0.00031445, 0.00019262, 0.00031603, -0.00000116, 0.00000000],
+		[-6.27341589, -0.00031442, 0.00019260, 0.00031599, -0.00000116, 0.00000000],
+		[-6.27341596, -0.00031438, 0.00019258, 0.00031596, -0.00000116, 0.00000000],
+		[-6.27341604, -0.00031435, 0.00019256, 0.00031593, -0.00000116, 0.00000000],
+		[-6.27341612, -0.00031432, 0.00019254, 0.00031590, -0.00000116, 0.00000000],
+		[-6.27341619, -0.00031429, 0.00019252, 0.00031587, -0.00000116, 0.00000000],
+		[-6.27341627, -0.00031426, 0.00019250, 0.00031583, -0.00000116, 0.00000000],
+		[-6.27341635, -0.00031423, 0.00019248, 0.00031580, -0.00000116, 0.00000000],
+		[-6.27341642, -0.00031419, 0.00019246, 0.00031577, -0.00000116, 0.00000000],
+		[-6.27341650, -0.00031416, 0.00019244, 0.00031574, -0.00000116, 0.00000000],
+		[-6.27341658, -0.00031413, 0.00019242, 0.00031571, -0.00000116, 0.00000000],
+		[-6.27341665, -0.00031410, 0.00019240, 0.00031567, -0.00000116, 0.00000000],
+		[-6.27341673, -0.00031407, 0.00019238, 0.00031564, -0.00000116, 0.00000000],
+		[-6.27341680, -0.00031403, 0.00019236, 0.00031561, -0.00000116, 0.00000000],
+		[-6.27341688, -0.00031400, 0.00019234, 0.00031558, -0.00000116, 0.00000000],
+		[-6.27341696, -0.00031397, 0.00019232, 0.00031554, -0.00000116, 0.00000000],
+		[-6.27341703, -0.00031394, 0.00019231, 0.00031551, -0.00000116, 0.00000000],
+		[-6.27341711, -0.00031391, 0.00019229, 0.00031548, -0.00000116, 0.00000000],
+		[-6.27341719, -0.00031387, 0.00019227, 0.00031545, -0.00000116, 0.00000000],
+		[-6.27341726, -0.00031384, 0.00019225, 0.00031542, -0.00000116, 0.00000000],
+		[-6.27341734, -0.00031381, 0.00019223, 0.00031538, -0.00000116, 0.00000000],
+		[-6.27341741, -0.00031378, 0.00019221, 0.00031535, -0.00000116, 0.00000000],
+		[-6.27341749, -0.00031375, 0.00019219, 0.00031532, -0.00000116, 0.00000000],
+		[-6.27341757, -0.00031372, 0.00019217, 0.00031529, -0.00000116, 0.00000000],
+		[-6.27341764, -0.00031368, 0.00019215, 0.00031526, -0.00000116, 0.00000000],
+		[-6.27341772, -0.00031365, 0.00019213, 0.00031523, -0.00000116, 0.00000000],
+		[-6.27341779, -0.00031362, 0.00019211, 0.00031519, -0.00000116, 0.00000000],
+		[-6.27341787, -0.00031359, 0.00019209, 0.00031516, -0.00000116, 0.00000000],
+		[-6.27341795, -0.00031356, 0.00019207, 0.00031513, -0.00000116, 0.00000000],
+		[-6.27341802, -0.00031353, 0.00019205, 0.00031510, -0.00000116, 0.00000000],
+		[-6.27341810, -0.00031349, 0.00019203, 0.00031507, -0.00000116, 0.00000000],
+		[-6.27341817, -0.00031346, 0.00019201, 0.00031503, -0.00000116, 0.00000000],
+		[-6.27341825, -0.00031343, 0.00019199, 0.00031500, -0.00000116, 0.00000000],
+		[-6.27341833, -0.00031340, 0.00019197, 0.00031497, -0.00000116, 0.00000000],
+		[-6.27341840, -0.00031337, 0.00019195, 0.00031494, -0.00000116, 0.00000000],
+		[-6.27341848, -0.00031333, 0.00019194, 0.00031491, -0.00000116, 0.00000000],
+		[-6.27341855, -0.00031330, 0.00019192, 0.00031487, -0.00000116, 0.00000000],
+		[-6.27341863, -0.00031327, 0.00019190, 0.00031484, -0.00000116, 0.00000000],
+		[-6.27341871, -0.00031324, 0.00019188, 0.00031481, -0.00000116, 0.00000000],
+		[-6.27341878, -0.00031321, 0.00019186, 0.00031478, -0.00000116, 0.00000000],
+		[-6.27341886, -0.00031318, 0.00019184, 0.00031475, -0.00000116, 0.00000000],
+		[-6.27341893, -0.00031314, 0.00019182, 0.00031471, -0.00000116, 0.00000000],
+		[-6.27341901, -0.00031311, 0.00019180, 0.00031468, -0.00000116, 0.00000000],
+		[-6.27341909, -0.00031308, 0.00019178, 0.00031465, -0.00000116, 0.00000000],
+		[-6.27341916, -0.00031305, 0.00019176, 0.00031462, -0.00000116, 0.00000000],
+		[-6.27341924, -0.00031302, 0.00019174, 0.00031459, -0.00000116, 0.00000000],
+		[-6.27341931, -0.00031299, 0.00019172, 0.00031456, -0.00000116, 0.00000000],
+		[-6.27341939, -0.00031295, 0.00019170, 0.00031452, -0.00000116, 0.00000000],
+		[-6.27341946, -0.00031292, 0.00019168, 0.00031449, -0.00000116, 0.00000000],
+		[-6.27341954, -0.00031289, 0.00019166, 0.00031446, -0.00000116, 0.00000000],
+		[-6.27341962, -0.00031286, 0.00019164, 0.00031443, -0.00000116, 0.00000000],
+		[-6.27341969, -0.00031283, 0.00019162, 0.00031440, -0.00000116, 0.00000000],
+		[-6.27341977, -0.00031280, 0.00019161, 0.00031437, -0.00000116, 0.00000000],
+		[-6.27341984, -0.00031276, 0.00019159, 0.00031433, -0.00000116, 0.00000000],
+		[-6.27341992, -0.00031273, 0.00019157, 0.00031430, -0.00000116, 0.00000000],
+		[-6.27341999, -0.00031270, 0.00019155, 0.00031427, -0.00000116, 0.00000000],
+		[-6.27342007, -0.00031267, 0.00019153, 0.00031424, -0.00000116, 0.00000000],
+		[-6.27342015, -0.00031264, 0.00019151, 0.00031421, -0.00000116, 0.00000000],
+		[-6.27342022, -0.00031261, 0.00019149, 0.00031417, -0.00000116, 0.00000000],
+		[-6.27342030, -0.00031258, 0.00019147, 0.00031414, -0.00000116, 0.00000000],
+		[-6.27342037, -0.00031254, 0.00019145, 0.00031411, -0.00000116, 0.00000000],
+		[-6.27342045, -0.00031251, 0.00019143, 0.00031408, -0.00000116, 0.00000000],
+		[-6.27342052, -0.00031248, 0.00019141, 0.00031405, -0.00000116, 0.00000000],
+		[-6.27342060, -0.00031245, 0.00019139, 0.00031402, -0.00000116, 0.00000000],
+		[-6.27342067, -0.00031242, 0.00019137, 0.00031398, -0.00000116, 0.00000000],
+		[-6.27342075, -0.00031239, 0.00019135, 0.00031395, -0.00000116, 0.00000000],
+		[-6.27342083, -0.00031235, 0.00019133, 0.00031392, -0.00000116, 0.00000000],
+		[-6.27342090, -0.00031232, 0.00019132, 0.00031389, -0.00000116, 0.00000000],
+		[-6.27342098, -0.00031229, 0.00019130, 0.00031386, -0.00000116, 0.00000000],
+		[-6.27342105, -0.00031226, 0.00019128, 0.00031383, -0.00000116, 0.00000000],
+		[-6.27342113, -0.00031223, 0.00019126, 0.00031379, -0.00000116, 0.00000000],
+		[-6.27342120, -0.00031220, 0.00019124, 0.00031376, -0.00000116, 0.00000000],
+		[-6.27342128, -0.00031217, 0.00019122, 0.00031373, -0.00000116, 0.00000000],
+		[-6.27342135, -0.00031213, 0.00019120, 0.00031370, -0.00000116, 0.00000000],
+		[-6.27342143, -0.00031210, 0.00019118, 0.00031367, -0.00000116, 0.00000000],
+		[-6.27342150, -0.00031207, 0.00019116, 0.00031364, -0.00000116, 0.00000000],
+		[-6.27342158, -0.00031204, 0.00019114, 0.00031360, -0.00000116, 0.00000000],
+		[-6.27342166, -0.00031201, 0.00019112, 0.00031357, -0.00000116, 0.00000000],
+		[-6.27342173, -0.00031198, 0.00019110, 0.00031354, -0.00000116, 0.00000000],
+		[-6.27342181, -0.00031195, 0.00019108, 0.00031351, -0.00000116, 0.00000000],
+		[-6.27342188, -0.00031191, 0.00019106, 0.00031348, -0.00000116, 0.00000000],
+		[-6.27342196, -0.00031188, 0.00019105, 0.00031345, -0.00000116, 0.00000000],
+		[-6.27342203, -0.00031185, 0.00019103, 0.00031341, -0.00000116, 0.00000000],
+		[-6.27342211, -0.00031182, 0.00019101, 0.00031338, -0.00000116, 0.00000000],
+		[-6.27342218, -0.00031179, 0.00019099, 0.00031335, -0.00000116, 0.00000000],
+		[-6.27342226, -0.00031176, 0.00019097, 0.00031332, -0.00000116, 0.00000000],
+		[-6.27342233, -0.00031173, 0.00019095, 0.00031329, -0.00000116, 0.00000000],
+		[-6.27342241, -0.00031169, 0.00019093, 0.00031326, -0.00000116, 0.00000000],
+		[-6.27342248, -0.00031166, 0.00019091, 0.00031323, -0.00000116, 0.00000000],
+		[-6.27342256, -0.00031163, 0.00019089, 0.00031319, -0.00000116, 0.00000000],
+		[-6.27342263, -0.00031160, 0.00019087, 0.00031316, -0.00000116, 0.00000000],
+		[-6.27342271, -0.00031157, 0.00019085, 0.00031313, -0.00000116, 0.00000000],
+		[-6.27342278, -0.00031154, 0.00019083, 0.00031310, -0.00000116, 0.00000000],
+		[-6.27342286, -0.00031151, 0.00019081, 0.00031307, -0.00000116, 0.00000000],
+		[-6.27342293, -0.00031147, 0.00019080, 0.00031304, -0.00000116, 0.00000000],
+		[-6.27342301, -0.00031144, 0.00019078, 0.00031300, -0.00000116, 0.00000000],
+		[-6.27342308, -0.00031141, 0.00019076, 0.00031297, -0.00000116, 0.00000000],
+		[-6.27342316, -0.00031138, 0.00019074, 0.00031294, -0.00000116, 0.00000000],
+		[-6.27342323, -0.00031135, 0.00019072, 0.00031291, -0.00000116, 0.00000000],
+		[-6.27342331, -0.00031132, 0.00019070, 0.00031288, -0.00000116, 0.00000000],
+		[-6.27342338, -0.00031129, 0.00019068, 0.00031285, -0.00000116, 0.00000000],
+		[-6.27342346, -0.00031126, 0.00019066, 0.00031282, -0.00000116, 0.00000000],
+		[-6.27342353, -0.00031122, 0.00019064, 0.00031278, -0.00000116, 0.00000000],
+		[-6.27342361, -0.00031119, 0.00019062, 0.00031275, -0.00000116, 0.00000000],
+		[-6.27342368, -0.00031116, 0.00019060, 0.00031272, -0.00000116, 0.00000000],
+		[-6.27342376, -0.00031113, 0.00019058, 0.00031269, -0.00000116, 0.00000000],
+		[-6.27342383, -0.00031110, 0.00019057, 0.00031266, -0.00000116, 0.00000000],
+		[-6.27342391, -0.00031107, 0.00019055, 0.00031263, -0.00000116, 0.00000000],
+		[-6.27342398, -0.00031104, 0.00019053, 0.00031260, -0.00000116, 0.00000000],
+		[-6.27342406, -0.00031101, 0.00019051, 0.00031256, -0.00000116, 0.00000000],
+		[-6.27342413, -0.00031097, 0.00019049, 0.00031253, -0.00000116, 0.00000000],
+		[-6.27342421, -0.00031094, 0.00019047, 0.00031250, -0.00000116, 0.00000000],
+		[-6.27342428, -0.00031091, 0.00019045, 0.00031247, -0.00000116, 0.00000000],
+		[-6.27342436, -0.00031088, 0.00019043, 0.00031244, -0.00000116, 0.00000000],
+		[-6.27342443, -0.00031085, 0.00019041, 0.00031241, -0.00000116, 0.00000000],
+		[-6.27342451, -0.00031082, 0.00019039, 0.00031238, -0.00000116, 0.00000000],
+		[-6.27342458, -0.00031079, 0.00019037, 0.00031235, -0.00000116, 0.00000000],
+		[-6.27342466, -0.00031076, 0.00019035, 0.00031231, -0.00000116, 0.00000000],
+		[-6.27342473, -0.00031072, 0.00019034, 0.00031228, -0.00000116, 0.00000000],
+		[-6.27342480, -0.00031069, 0.00019032, 0.00031225, -0.00000116, 0.00000000],
+		[-6.27342488, -0.00031066, 0.00019030, 0.00031222, -0.00000116, 0.00000000],
+		[-6.27342495, -0.00031063, 0.00019028, 0.00031219, -0.00000116, 0.00000000],
+		[-6.27342503, -0.00031060, 0.00019026, 0.00031216, -0.00000116, 0.00000000],
+		[-6.27342510, -0.00031057, 0.00019024, 0.00031213, -0.00000116, 0.00000000],
+		[-6.27342518, -0.00031054, 0.00019022, 0.00031209, -0.00000116, 0.00000000],
+		[-6.27342525, -0.00031051, 0.00019020, 0.00031206, -0.00000116, 0.00000000],
+		[-6.27342533, -0.00031047, 0.00019018, 0.00031203, -0.00000116, 0.00000000],
+		[-6.27342540, -0.00031044, 0.00019016, 0.00031200, -0.00000116, 0.00000000],
+		[-6.27342548, -0.00031041, 0.00019014, 0.00031197, -0.00000116, 0.00000000],
+		[-6.27342555, -0.00031038, 0.00019013, 0.00031194, -0.00000116, 0.00000000],
+		[-6.27342563, -0.00031035, 0.00019011, 0.00031191, -0.00000116, 0.00000000],
+		[-6.27342570, -0.00031032, 0.00019009, 0.00031188, -0.00000116, 0.00000000],
+		[-6.27342577, -0.00031029, 0.00019007, 0.00031184, -0.00000116, 0.00000000],
+		[-6.27342585, -0.00031026, 0.00019005, 0.00031181, -0.00000116, 0.00000000],
+		[-6.27342592, -0.00031023, 0.00019003, 0.00031178, -0.00000116, 0.00000000],
+		[-6.27342600, -0.00031019, 0.00019001, 0.00031175, -0.00000116, 0.00000000],
+		[-6.27342607, -0.00031016, 0.00018999, 0.00031172, -0.00000116, 0.00000000],
+		[-6.27342615, -0.00031013, 0.00018997, 0.00031169, -0.00000116, 0.00000000],
+		[-6.27342622, -0.00031010, 0.00018995, 0.00031166, -0.00000116, 0.00000000],
+		[-6.27342630, -0.00031007, 0.00018993, 0.00031163, -0.00000116, 0.00000000],
+		[-6.27342637, -0.00031004, 0.00018992, 0.00031159, -0.00000116, 0.00000000],
+		[-6.27342644, -0.00031001, 0.00018990, 0.00031156, -0.00000116, 0.00000000],
+		[-6.27342652, -0.00030998, 0.00018988, 0.00031153, -0.00000116, 0.00000000],
+		[-6.27342659, -0.00030995, 0.00018986, 0.00031150, -0.00000116, 0.00000000],
+		[-6.27342667, -0.00030992, 0.00018984, 0.00031147, -0.00000116, 0.00000000],
+		[-6.27342674, -0.00030988, 0.00018982, 0.00031144, -0.00000116, 0.00000000],
+		[-6.27342682, -0.00030985, 0.00018980, 0.00031141, -0.00000116, 0.00000000],
+		[-6.27342689, -0.00030982, 0.00018978, 0.00031138, -0.00000116, 0.00000000],
+		[-6.27342696, -0.00030979, 0.00018976, 0.00031134, -0.00000116, 0.00000000],
+		[-6.27342704, -0.00030976, 0.00018974, 0.00031131, -0.00000116, 0.00000000],
+		[-6.27342711, -0.00030973, 0.00018973, 0.00031128, -0.00000116, 0.00000000],
+		[-6.27342719, -0.00030970, 0.00018971, 0.00031125, -0.00000116, 0.00000000],
+		[-6.27342726, -0.00030967, 0.00018969, 0.00031122, -0.00000116, 0.00000000],
+		[-6.27342733, -0.00030964, 0.00018967, 0.00031119, -0.00000116, 0.00000000],
+		[-6.27342741, -0.00030961, 0.00018965, 0.00031116, -0.00000116, 0.00000000],
+		[-6.27342748, -0.00030957, 0.00018963, 0.00031113, -0.00000116, 0.00000000],
+		[-6.27342756, -0.00030954, 0.00018961, 0.00031110, -0.00000116, 0.00000000],
+		[-6.27342763, -0.00030951, 0.00018959, 0.00031106, -0.00000116, 0.00000000],
+		[-6.27342771, -0.00030948, 0.00018957, 0.00031103, -0.00000116, 0.00000000],
+		[-6.27342778, -0.00030945, 0.00018956, 0.00031100, -0.00000116, 0.00000000]
+	];
+
+	// Cut off series at maxdeg
+	love_numbers.splice(maxdeg + 1, love_numbers.length - maxdeg + 1);
+
+	// Retrieve right type
+
+	/*
+	Arrow function to retrieve column of values
+
+	Sources:
+	 - https://stackoverflow.com/questions/7848004/get-column-from-a-two-dimensional-array
+
+	TODO:
+	- Place this in another scope so that it is available generally as a helper 
+	function.
+	*/
+	const array_column = (arr, n) => arr.map(x => x[n]);
+
+	let series = [];
+	if (type === 'loadingverticaldisplacement') {
+		series = array_column(love_numbers, 0);
+	} else if (type === 'loadinggravitationalpotential') {
+		series = array_column(love_numbers, 1);
+	} else if (type === 'loadinghorizontaldisplacement') {
+		series = array_column(love_numbers, 2);
+	} else if (type === 'tidalverticaldisplacement') {
+		series = array_column(love_numbers, 3);
+	} else if (type === 'tidalgravitationalpotential') {
+		series = array_column(love_numbers, 4);
+	} else if (type === 'tidalhorizontaldisplacement') {
+		series = array_column(love_numbers, 5);
+	} else {
+		error('love_numbers error message: unknown type: ' + type);
+	}
+
+	// Choose degree 1 term for CF reference system
+	if (frame === 'CM') {
+		// pass
+	} else if (frame === 'CF') {
+		if (type === 'loadingverticaldisplacement') {
+			series[1] = -0.269;
+		} else if (type === 'loadinggravitationalpotential') {
+			series[1] = -0.021;
+		} else if (type === 'loadinghorizontaldisplacement') {
+			series[1] = -0.134;
+		}
+	} else {
+		error('love_numbers error message: unknown reference frame:' + frame);
+	}
+
+	return series;
+} //}}}
Index: /issm/trunk/src/m/boundaryconditions/getlovenumbers.py
===================================================================
--- /issm/trunk/src/m/boundaryconditions/getlovenumbers.py	(revision 26743)
+++ /issm/trunk/src/m/boundaryconditions/getlovenumbers.py	(revision 26744)
@@ -5,21 +5,25 @@
 
 def getlovenumbers(*args): #{{{
-    '''
-    GETLOVENUMBERS - provide love numbers retrieved from: 
+    """GETLOVENUMBERS - provide love numbers retrieved from: 
     http://www.srosat.com/iag-jsg/loveNb.php in a chosen reference frame
 
-        Usage:
-            series = love_numbers('type', 'loadingverticaldisplacement', 'referenceframe', 'CM', 'maxdeg', 1001)
+    Usage:
+        series = love_numbers('type', 'loadingverticaldisplacement', 'referenceframe', 'CM', 'maxdeg', 1001)
 
-        - type = one of 'loadingverticaldisplacement', 
-        'loadinggravitationalpotential', 'loadinghorizontaldisplacement', 
-        'tidalverticaldisplacement', 'tidalgravitationalpotential', 
-        'tidalhorizontaldisplacement'
-        - reference_frame = one of 'CM' (default) and 'CF'
-        - maxdeg = default 1000
+    - type = one of 'loadingverticaldisplacement', 
+    'loadinggravitationalpotential', 'loadinghorizontaldisplacement', 
+    'tidalverticaldisplacement', 'tidalgravitationalpotential', 
+    'tidalhorizontaldisplacement'
+    - reference_frame = one of 'CM' (default) and 'CF'
+    - maxdeg = default 1000
 
-        Example:
-            h = love_number
-    '''
+    Example:
+        h = getlovenumbers('type', 'loadingverticaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg)
+        k = getlovenumbers('type', 'loadinggravitationalpotential', 'referenceframe', 'CM', 'maxdeg', maxdeg)
+        l = getlovenumbers('type', 'loadinghorizontaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg)
+        th = getlovenumbers('type', 'tidalverticaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg)
+        tk = getlovenumbers('type', 'tidalgravitationalpotential', 'referenceframe', 'CM', 'maxdeg', maxdeg)
+        tl = getlovenumbers('type', 'tidalhorizontaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg)
+    """
 
     TYPES = [
@@ -32,9 +36,12 @@
     ]
 
-    #recover options
+    # Recover options
     options = pairoptions(*args)
     type = options.getfieldvalue('type')
     frame = options.getfieldvalue('referenceframe', 'CM')
     maxdeg = options.getfieldvalue('maxdeg', 1000)
+
+    if (maxdeg > 10000):
+        raise Exception('PREM love numbers computed only for deg < 10,000. Request lower maxdeg')
 
     if type not in TYPES:
@@ -10045,8 +10052,8 @@
     ])
 
-    #cut off series at maxdeg
+    # Cut off series at maxdeg
     love_numbers = np.delete(love_numbers, range(maxdeg + 1, len(love_numbers)), axis=0)
 
-    #retrieve right type
+    # Retrieve right type
     if type == 'loadingverticaldisplacement':
         series = love_numbers[:, 0]
@@ -10062,5 +10069,5 @@
         series = love_numbers[:, 5]
     else:
-        raise Exception("love_numbers error message: unknown type: {}".format(type))
+        raise Exception('love_numbers error message: unknown type: {}'.format(type))
 
     #choose degree 1 term for CF reference system
@@ -10075,5 +10082,5 @@
             series[1] = 0.134
     else:
-        raise Exception("love_numbers error message: unknown reference frame: {}".format(frame))
+        raise Exception('love_numbers error message: unknown reference frame: {}'.format(frame))
 
     return series
Index: /issm/trunk/src/m/classes/SMBautoregression.m
===================================================================
--- /issm/trunk/src/m/classes/SMBautoregression.m	(revision 26744)
+++ /issm/trunk/src/m/classes/SMBautoregression.m	(revision 26744)
@@ -0,0 +1,122 @@
+%SMBautoregression Class definition
+%
+%   Usage:
+%      SMBautoregression=SMBautoregression();
+
+classdef SMBautoregression
+	properties (SetAccess=public)
+		num_basins        = 0;
+		beta0             = NaN;
+		beta1             = NaN;
+		ar_order          = 0;
+		ar_initialtime    = 0;
+		ar_timestep       = 0;
+		phi               = NaN;
+		basin_id          = NaN;
+		steps_per_step    = 1;
+		averaging         = 0;
+		requested_outputs = {};
+	end
+	methods
+		function self = SMBautoregression(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = extrude(self,md) % {{{
+			%Nothing for now
+		end % }}}
+		function list = defaultoutputs(self,md) % {{{
+			list = {''};
+		end % }}}
+		function self = initialize(self,md) % {{{
+			if isnan(self.beta1)
+				self.beta1 = zeros(1,self.num_basins); %no trend in SMB
+				disp('      smb.beta1 (trend) not specified: value set to 0');
+			end
+			if (self.ar_order==0)
+				self.ar_order = 1; %dummy 1 value for autoregression
+				self.phi      = zeros(self.num_basins,self.ar_order); %autoregression coefficients all set to 0 
+				disp('      smb.ar_order (order of autoregressive model) not specified: order of autoregressive model set to 0');
+			end
+			if (self.ar_initialtime==0)
+				self.ar_initialtime = md.timestepping.start_time; %autoregression model has no prescribed initial time
+				disp('      smb.ar_initialtime (initial time in the autoregressive model parameterization) not specified: set to md.timestepping.start_time');
+			end
+			if (self.ar_timestep==0)
+				self.ar_timestep = md.timestepping.time_step; %autoregression model has no prescribed time step
+				disp('      smb.ar_timestep (timestep of autoregressive model) not specified: set to md.timestepping.time_step');
+			end
+			if isnan(self.phi)
+				self.phi = zeros(self.num_basins,self.ar_order); %autoregression model of order 0 
+				disp('      smb.phi (lag coefficients) not specified: order of autoregressive model set to 0');
+			end
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+			self.ar_order    = 0.0; %autoregression model of order 0
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) 
+
+			if ismember('MasstransportAnalysis',analyses),
+				md = checkfield(md,'fieldname','smb.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
+				md = checkfield(md,'fieldname','smb.basin_id','Inf',1,'>=',0,'<=',md.smb.num_basins,'size',[md.mesh.numberofelements,1]);
+				md = checkfield(md,'fieldname','smb.beta0','NaN',1,'Inf',1,'size',[1,md.smb.num_basins],'numel',md.smb.num_basins); %scheme fails if passed as column vector
+				md = checkfield(md,'fieldname','smb.beta1','NaN',1,'Inf',1,'size',[1,md.smb.num_basins],'numel',md.smb.num_basins); %scheme fails if passed as column vector
+				md = checkfield(md,'fieldname','smb.ar_order','numel',1,'NaN',1,'Inf',1,'>=',0);
+				md = checkfield(md,'fieldname','smb.ar_initialtime','numel',1,'NaN',1,'Inf',1); 
+				md = checkfield(md,'fieldname','smb.ar_timestep','numel',1,'NaN',1,'Inf',1,'>=',md.timestepping.time_step); %autoregression time step cannot be finer than ISSM timestep
+				md = checkfield(md,'fieldname','smb.phi','NaN',1,'Inf',1,'size',[md.smb.num_basins,md.smb.ar_order]);
+			end
+			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
+			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
+			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
+		end 
+		function disp(self) % {{{
+			disp(sprintf('   surface forcings parameters:'));
+			fielddisplay(self,'num_basins','number of different basins [unitless]');
+			fielddisplay(self,'basin_id','basin number assigned to each element [unitless]');
+			fielddisplay(self,'beta0','basin-specific intercept values [m ice eq./yr]');
+			fielddisplay(self,'beta1','basin-specific trend values [m ice eq. yr^(-2)]');
+			fielddisplay(self,'ar_order','order of the autoregressive model [unitless]');
+			fielddisplay(self,'ar_initialtime','initial time assumed in the autoregressive model parameterization [yr]');
+			fielddisplay(self,'ar_timestep','time resolution of the autoregressive model [yr]');
+			fielddisplay(self,'phi','basin-specific vectors of lag coefficients [unitless]');
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
+			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
+			disp(sprintf('%51s  0: Arithmetic (default)',' '));
+			disp(sprintf('%51s  1: Geometric',' '));
+			disp(sprintf('%51s  2: Harmonic',' '));
+			fielddisplay(self,'requested_outputs','additional outputs requested');
+
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+
+			yts=md.constants.yts;
+
+			WriteData(fid,prefix,'name','md.smb.model','data',55,'format','Integer');
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','num_basins','format','Integer');
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ar_order','format','Integer');
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ar_initialtime','format','Double','scale',yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ar_timestep','format','Double','scale',yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','basin_id','data',self.basin_id-1,'name','md.smb.basin_id','format','IntMat','mattype',2); %0-indexed
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','beta0','format','DoubleMat','name','md.smb.beta0','scale',1./yts,'yts',yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','beta1','format','DoubleMat','name','md.smb.beta1','scale',1./(yts^2),'yts',yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','phi','format','DoubleMat','name','md.smb.phi','yts',yts); 
+			WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer');
+
+			%process requested outputs
+			outputs = self.requested_outputs;
+			pos  = find(ismember(outputs,'default'));
+			if ~isempty(pos),
+				outputs(pos) = [];                         %remove 'default' from outputs
+				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+			end
+			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
+
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/SMBautoregression.py
===================================================================
--- /issm/trunk/src/m/classes/SMBautoregression.py	(revision 26744)
+++ /issm/trunk/src/m/classes/SMBautoregression.py	(revision 26744)
@@ -0,0 +1,128 @@
+import numpy as np
+
+from checkfield import *
+from fielddisplay import fielddisplay
+from project3d import *
+from WriteData import *
+
+
+class SMBautoregression(object):
+    """SMBAUTOREGRESSION class definition
+
+    Usage:
+        SMBautoregression = SMBautoregression()
+    """
+
+    def __init__(self, *args):  # {{{
+        self.num_basins = 0
+        self.beta0 = np.nan
+        self.beta1 = np.nan
+        self.ar_order = 0
+        self.ar_initialtime = 0
+        self.ar_timestep = 0
+        self.phi = np.nan
+        self.basin_id = np.nan
+        self.steps_per_step = 1
+        self.averaging = 0
+        self.requested_outputs = []
+
+        nargs = len(args)
+        if nargs == 0:
+            self.setdefaultparameters()
+        else:
+            raise Exception('constructor not supported')
+    # }}}
+
+    def __repr__(self):  # {{{
+        s = '   surface forcings parameters:\n'
+        s += '{}\n'.format(fielddisplay(self, 'num_basins', 'number of different basins [unitless]'))
+        s += '{}\n'.format(fielddisplay(self, 'basin_id', 'basin number assigned to each element [unitless]'))
+        s += '{}\n'.format(fielddisplay(self, 'beta0', 'basin-specific intercept values [m ice eq./yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'beta1', 'basin-specific trend values [m ice eq. yr^(-2)]'))
+        s += '{}\n'.format(fielddisplay(self, 'ar_order', 'order of the autoregressive model [unitless]'))
+        s += '{}\n'.format(fielddisplay(self, 'ar_initialtime', 'initial time assumed in the autoregressive model parameterization [yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'ar_timestep', 'time resolution of the autoregressive model [yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'phi', 'basin-specific vectors of lag coefficients [unitless]'))
+        s += '{}\n'.format(fielddisplay(self, 'covmat', 'inter-basin covariance matrix for multivariate normal noise at each time step [m^2 ice eq. yr^(-2)]'))
+        s += '{}\n'.format(fielddisplay(self, 'randomflag', 'whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)'))
+        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
+        s += '\t\t{}\n'.format('0: Arithmetic (default)')
+        s += '\t\t{}\n'.format('1: Geometric')
+        s += '\t\t{}\n'.format('2: Harmonic')
+        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        return s
+    # }}}
+
+    def setdefaultparameters(self): #{{{
+        self.ar_order = 0.0 # Autoregression model of order 0
+    # }}}
+
+    def extrude(self, md):  # {{{
+        return self # Nothing for now
+    # }}}
+
+    def defaultoutputs(self, md):  # {{{
+        return []
+    # }}}
+
+    def initialize(self, md):  # {{{
+        if np.all(np.isnan(self.beta1)):
+            self.beta1 = np.zeros((1, self.num_basins)) # No trend in SMB
+            print('      smb.beta1 (trend) not specified: value set to 0')
+        if self.ar_order == 0:
+            self.ar_order = 1 # Dummy 1 value for autoregression
+            self.phi = np.zeros((self.num_basins, self.ar_order)) # Autorgression coefficients all set to 0
+            print('      smb.ar_order (order of autoregressive model) not specified: order of autoregressive model set to 0')
+        if self.ar_initialtime == 0:
+            self.ar_initialtime = md.timestepping.start_time # Autoregression model has no prescribed initial time
+            print('      smb.ar_initialtime (initial time in the autoregressive model parameterization) not specified: set to md.timestepping.start_time')
+        if self.ar_timestep == 0:
+            self.ar_timestep = md.timestepping.time_step # Autoregression model has no prescribed time step
+            print('      smb.ar_timestep (timestep of autoregressive model) not specified: set to md.timestepping.time_step')
+        if np.all(np.isnan(self.phi)):
+            self.phi = np.zeros((self.num_basins, self.ar_order)) # Autoregression model of order 0
+            print('      smb.phi (lag coefficients) not specified: order of autoregressive model set to 0')
+        return self
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if 'MasstransportAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'smb.num_basins', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
+            md = checkfield(md, 'fieldname', 'smb.basin_id', 'Inf', 1, '>=', 0, '<=', md.smb.num_basins, 'size', [md.mesh.numberofelements])
+            md = checkfield(md, 'fieldname', 'smb.beta0', 'NaN', 1, 'Inf', 1, 'size', [1, md.smb.num_basins], 'numel', md.smb.num_basins) # Scheme fails if passed as column vector
+            md = checkfield(md, 'fieldname', 'smb.beta1', 'NaN', 1, 'Inf', 1, 'size', [1, md.smb.num_basins], 'numel', md.smb.num_basins) # Scheme fails if passed as column vector; NOTE: As opposed to MATLAB implementation, pass list
+            md = checkfield(md, 'fieldname', 'smb.ar_order', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
+            md = checkfield(md, 'fieldname', 'smb.ar_initialtime', 'numel', 1, 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.ar_timestep', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', md.timestepping.time_step) # Autoregression time step cannot be finer than ISSM timestep
+            md = checkfield(md, 'fieldname', 'smb.phi', 'NaN', 1, 'Inf', 1, 'size', [md.smb.num_basins, md.smb.ar_order])
+        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
+        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+
+        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 55, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'num_basins', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ar_order', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ar_initialtime', 'format', 'Double', 'scale', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ar_timestep', 'format', 'Double', 'scale', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'basin_id', 'data', self.basin_id, 'name', 'md.smb.basin_id', 'format', 'IntMat', 'mattype', 2) # 0-indexed
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'beta0', 'format', 'DoubleMat', 'name', 'md.smb.beta0', 'scale', 1 / yts, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'beta1', 'format', 'DoubleMat', 'name', 'md.smb.beta1', 'scale', 1 / (yts ** 2), 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'phi', 'format', 'DoubleMat', 'name', 'md.smb.phi', 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
+
+        # Process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
+
+    # }}}
Index: /issm/trunk/src/m/classes/SMBcomponents.m
===================================================================
--- /issm/trunk/src/m/classes/SMBcomponents.m	(revision 26743)
+++ /issm/trunk/src/m/classes/SMBcomponents.m	(revision 26744)
@@ -6,5 +6,4 @@
 classdef SMBcomponents
 	properties (SetAccess=public)
-		isclimatology = 0;
 		accumulation = NaN;
 		runoff = NaN;
@@ -13,4 +12,5 @@
 		averaging = 0;
 		requested_outputs     = {};
+		isclimatology;
 	end
 	methods
@@ -21,4 +21,16 @@
 					error('constructor not supported');
 			end
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   surface forcings parameters (SMB=accumulation-runoff-evaporation) :'));
+			fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]');
+			fielddisplay(self,'runoff','amount of ice melt lost from the ice column [m/yr ice eq]');
+			fielddisplay(self,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
+			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
+			disp(sprintf('%51s  0: Arithmetic (default)',' '));
+			disp(sprintf('%51s  1: Geometric',' '));
+			disp(sprintf('%51s  2: Harmonic',' '));
+			fielddisplay(self,'requested_outputs','additional outputs requested');
 		end % }}}
 		function self = extrude(self,md) % {{{
@@ -38,13 +50,13 @@
 			if isnan(self.accumulation)
 				self.accumulation=zeros(md.mesh.numberofvertices,1);
-				disp('	no smb.accumulation specified: values set as zero');
+				disp('      no smb.accumulation specified: values set as zero');
 			end
 			if isnan(self.evaporation)
 				self.evaporation=zeros(md.mesh.numberofvertices,1);
-				disp('	no smb.evaporation specified: values set as zero');
+				disp('      no smb.evaporation specified: values set as zero');
 			end
 			if isnan(self.runoff)
 				self.runoff=zeros(md.mesh.numberofvertices,1);
-				disp('	no smb.runoff specified: values set as zero');
+				disp('      no smb.runoff specified: values set as zero');
 			end
 
@@ -65,26 +77,4 @@
 			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-			md = checkfield(md,'fieldname','smb.isclimatology','values',[0 1]);
-			if (self.isclimatology)
-				md = checkfield(md,'fieldname', 'smb.accumulation', 'size',[md.mesh.numberofvertices+1],...
-						'message',['accumulation must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
-				md = checkfield(md,'fieldname', 'smb.runoff', 'size',[md.mesh.numberofvertices+1],...
-						'message',['runoff must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
-				md = checkfield(md,'fieldname', 'smb.evaporation', 'size',[md.mesh.numberofvertices+1],...
-						'message',['evaporation must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('	  surface forcings parameters (SMB=accumulation-runoff-evaporation) :'));
-			fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]');
-			fielddisplay(self,'runoff','amount of ice melt lost from the ice column [m/yr ice eq]');
-			fielddisplay(self,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
-			fielddisplay(self,'isclimatology','repeat all forcings when past last forcing time (default false)');
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested');
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -93,7 +83,7 @@
 
 			WriteData(fid,prefix,'name','md.smb.model','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoff','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoff','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
 			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
 			WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer');
@@ -102,9 +92,8 @@
 			pos  = find(ismember(outputs,'default'));
 			if ~isempty(pos),
-				outputs(pos) = [];			       %remove 'default' from outputs
+				outputs(pos) = [];                            %remove 'default' from outputs
 				outputs	 = [outputs defaultoutputs(self,md)]; %add defaults
 			end
 			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isclimatology','format','Boolean');
 
 		end % }}}
Index: /issm/trunk/src/m/classes/SMBcomponents.py
===================================================================
--- /issm/trunk/src/m/classes/SMBcomponents.py	(revision 26743)
+++ /issm/trunk/src/m/classes/SMBcomponents.py	(revision 26744)
@@ -15,5 +15,4 @@
 
     def __init__(self, *args):  # {{{
-        self.isclimatology = 0
         self.accumulation = np.nan
         self.runoff = np.nan
@@ -22,4 +21,5 @@
         self.averaging = 0
         self.requested_outputs = []
+        self.isclimatology = np.nan
 
         nargs = len(args)
@@ -31,9 +31,8 @@
 
     def __repr__(self):  # {{{
-        s = '   surface forcings parameters (SMB = accumulation-runoff-evaporation):\n'
+        s = '   surface forcings parameters (SMB=accumulation-runoff-evaporation) :\n'
         s += '{}\n'.format(fielddisplay(self, 'accumulation', 'accumulated snow [m/yr ice eq]'))
         s += '{}\n'.format(fielddisplay(self, 'runoff', 'amount of ice melt lost from the ice column [m/yr ice eq]'))
         s += '{}\n'.format(fielddisplay(self, 'evaporation', 'mount of ice lost to evaporative processes [m/yr ice eq]'))
-        s += '{}\n'.format(fielddisplay(self, 'isclimatology', 'repeat all forcings when past last forcing time (default false)'))
         s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
         s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
@@ -46,7 +45,7 @@
 
     def extrude(self, md):  # {{{
-        self.mass_balance = project3d(md, 'vector', self.accumulation, 'type', 'node')
-        self.mass_balance = project3d(md, 'vector', self.runoff, 'type', 'node')
-        self.mass_balance = project3d(md, 'vector', self.evaporation, 'type', 'node')
+        self.accumulation = project3d(md, 'vector', self.accumulation, 'type', 'node')
+        self.runoff = project3d(md, 'vector', self.runoff, 'type', 'node')
+        self.evaporation = project3d(md, 'vector', self.evaporation, 'type', 'node')
         return self
     # }}}
@@ -59,12 +58,11 @@
         if np.all(np.isnan(self.accumulation)):
             self.accumulation = np.zeros((md.mesh.numberofvertices))
-            print("      no SMB.accumulation specified: values set as zero")
+            print('      no SMB.accumulation specified: values set as zero')
+        if np.all(np.isnan(self.evaporation)):
+            self.evaporation = np.zeros((md.mesh.numberofvertices))
+            print('      no SMB.evaporation specified: values set as zero')
         if np.all(np.isnan(self.runoff)):
             self.runoff = np.zeros((md.mesh.numberofvertices))
-            print("      no SMB.runoff specified: values set as zero")
-
-        if np.all(np.isnan(self.evaporation)):
-            self.evaporation = np.zeros((md.mesh.numberofvertices))
-            print("      no SMB.evaporation specified: values set as zero")
+            print('      no SMB.runoff specified: values set as zero')
         return self
     # }}}
@@ -81,11 +79,5 @@
         md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
         md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
-        md = checkfield(md, 'fieldname', 'smb.isclimatology', 'values', [0, 1])
-        if self.isclimatology:
-            md = checkfield(md, 'fieldname', 'smb.accumulation', 'size', [md.mesh.numberofvertices + 1],
-                'message', 'accumulation must have md.mesh.numberofvertices+1 rows in order to force a climatology')
-            md = checkfield(md, 'fieldname', 'smb.runoff', 'size', [md.mesh.numberofvertices + 1], 'message', 'runoff must have md.mesh.numberofvertices+1 rows in order to force a climatology')
-            md = checkfield(md, 'fieldname', 'smb.evaporation', 'size', [md.mesh.numberofvertices + 1], 'message', 'evaporation must have md.mesh.numberofvertices+1 rows in order to force a climatology')
+        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
         return md
     # }}}
@@ -95,10 +87,10 @@
 
         WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 2, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accumulation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'runoff', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'evaporation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accumulation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'runoff', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'evaporation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
         WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-    #process requested outputs
+        # Process requested outputs
         outputs = self.requested_outputs
         indices = [i for i, x in enumerate(outputs) if x == 'default']
@@ -107,9 +99,4 @@
             outputs = outputscopy
         WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isclimatology', 'format', 'Boolean')
-        if (self.isclimatology > 0):
-            md = checkfield(md, 'fieldname', 'smb.accumulation', 'size', [md.mesh.numberofvertices + 1], 'message', 'accumulation must have md.mesh.numberofvertices + 1 rows in order to force a climatology')
-            md = checkfield(md, 'fieldname', 'smb.runoff', 'size', [md.mesh.numberofvertices + 1], 'message', 'runoff must have md.mesh.numberofvertices + 1 rows in order to force a climatology')
-            md = checkfield(md, 'fieldname', 'smb.evaporation', 'size', [md.mesh.numberofvertices + 1], 'message', 'evaporation must have md.mesh.numberofvertices + 1 rows in order to force a climatology')
 
     # }}}
Index: /issm/trunk/src/m/classes/SMBforcing.js
===================================================================
--- /issm/trunk/src/m/classes/SMBforcing.js	(revision 26743)
+++ /issm/trunk/src/m/classes/SMBforcing.js	(revision 26744)
@@ -12,5 +12,10 @@
 		console.log(sprintf('   surface forcings parameters:'));
 		fielddisplay(this,'mass_balance','surface mass balance [m/yr ice eq]');
+		fielddisplay(this,'steps_per_step', 'number of smb steps per time step');
 		fielddisplay(this,'requested_outputs','additional outputs requested');
+		fielddisplay(this,'averaging','averaging methods from short to long steps');
+		console.log(sprintf('%51s  0: Arithmetic (default)',' '));
+		console.log(sprintf('%51s  1: Geometric',' '));
+		console.log(sprintf('%51s  2: Harmonic',' '));
 	} // }}}
 	this.defaultoutputs = function(){ // {{{
@@ -33,5 +38,5 @@
     } // }}}
     this.checkconsistency = function(md,solution,analyses) { //{{{
-
+		if (solution=='TransientSolution' && md.transient.issmb == 0) return;
         if(ArrayAnyEqual(ArrayIsMember('MasstransportAnalysis',analyses),1)){
             checkfield(md,'fieldname','smb.mass_balance','timeseries',1,'NaN',1,'Inf',1);
@@ -40,6 +45,7 @@
             checkfield(md,'fieldname','smb.mass_balance','size',[md.mesh.numberofvertices,1],'NaN',1,'Inf',1);
         }
-        checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-
+		checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
+		checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
+		checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0,1,2]);
     } // }}}
     this.marshall=function(md,prefix,fid) { //{{{
@@ -49,4 +55,6 @@
         WriteData(fid,prefix,'name','md.smb.model','data',1,'format','Integer');
         WriteData(fid,prefix,'object',this,'class','smb','fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+		WriteData(fid,prefix,'object',this,'fieldname','steps_per_step','format','Integer');
+		WriteData(fid,prefix,'object',this,'fieldname','averaging','format','Integer');
 
         //process requested outputs
@@ -66,6 +74,8 @@
 	//properties 
     // {{{
-	this.mass_balance = NaN;
-	this.requested_outputs      = [];
+	this.mass_balance 	   = NaN;
+	this.requested_outputs = [];
+	this.steps_per_step    = 1;
+	this.averaging         = 0;
 	this.setdefaultparameters();
     // }}}
Index: /issm/trunk/src/m/classes/SMBforcing.m
===================================================================
--- /issm/trunk/src/m/classes/SMBforcing.m	(revision 26743)
+++ /issm/trunk/src/m/classes/SMBforcing.m	(revision 26744)
@@ -6,9 +6,9 @@
 classdef SMBforcing
 	properties (SetAccess=public)
-		isclimatology     = 0;
 		mass_balance      = NaN;
 		steps_per_step    = 1;
 		requested_outputs = {};
 		averaging         = 0;
+		isclimatology;
 	end
 	methods
@@ -55,15 +55,9 @@
 			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-			md = checkfield(md,'fieldname','smb.isclimatology','values',[0 1]);
 			md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2]);
-			if (self.isclimatology)
-				md = checkfield(md,'fieldname', 'smb.mass_balance', 'size',[md.mesh.numberofvertices+1],...
-						'message',['mass_balance must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
-			end
 		end % }}}
 		function disp(self) % {{{
 			disp(sprintf('   surface forcings parameters:'));
 			fielddisplay(self,'mass_balance','surface mass balance [m/yr ice eq]');
-			fielddisplay(self,'isclimatology','repeat all forcings when past last forcing time (default false)');
 			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
 			fielddisplay(self,'requested_outputs','additional outputs requested');
@@ -90,5 +84,4 @@
 			end
 			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isclimatology','format','Boolean');
 
 		end % }}}
@@ -97,5 +90,4 @@
 			writejs1Darray(fid,[modelname '.smb.mass_balance'],self.mass_balance);
 			writejscellstring(fid,[modelname '.smb.requested_outputs'],self.requested_outputs);
-			writejs1Darray(fid,[modelname '.smb.isclimatology'],self.isclimatology);
 
 		end % }}}
Index: /issm/trunk/src/m/classes/SMBforcing.py
===================================================================
--- /issm/trunk/src/m/classes/SMBforcing.py	(revision 26743)
+++ /issm/trunk/src/m/classes/SMBforcing.py	(revision 26744)
@@ -15,9 +15,9 @@
 
     def __init__(self, *args):  # {{{
-        self.isclimatology = 0
         self.mass_balance = np.nan
         self.steps_per_step = 1
         self.requested_outputs = []
         self.averaging = 0
+        self.isclimatology = np.nan
 
         nargs = len(args)
@@ -31,11 +31,10 @@
         s = '   surface forcings parameters:\n'
         s += '{}\n'.format(fielddisplay(self, 'mass_balance', 'surface mass balance [m/yr ice eq]'))
-        s += '{}\n'.format(fielddisplay(self, 'isclimatology', 'repeat all forcings when past last forcing time (default false)'))
         s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
         s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
         s += '\t\t{}\n'.format('0: Arithmetic (default)')
         s += '\t\t{}\n'.format('1: Geometric')
         s += '\t\t{}\n'.format('2: Harmonic')
-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
         return s
     #}}}
@@ -53,5 +52,5 @@
         if np.all(np.isnan(self.mass_balance)):
             self.mass_balance = np.zeros((md.mesh.numberofvertices))
-            print("      no SMBforcing.mass_balance specified: values set as zero")
+            print("      no smb.mass_balance specified: values set as zero")
         return self
     #}}}
@@ -67,7 +66,4 @@
         md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
         md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
-        md = checkfield(md, 'fieldname', 'smb.isclimatology', 'values', [0, 1])
-        if self.isclimatology:
-            md = checkfield(md, 'fieldname', 'smb.mass_balance', 'size', [md.mesh.numberofvertices + 1], 'message', 'mass_balance must have md.mesh.numberofvertices + 1 rows in order to force a climatology')
         return md
     # }}}
@@ -76,5 +72,5 @@
         yts = md.constants.yts
         WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'mass_balance', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'mass_balance', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
         WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
@@ -87,4 +83,3 @@
             outputs = outputscopy
         WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isclimatology', 'format', 'Boolean')
     # }}}
Index: /issm/trunk/src/m/classes/SMBgemb.m
===================================================================
--- /issm/trunk/src/m/classes/SMBgemb.m	(revision 26743)
+++ /issm/trunk/src/m/classes/SMBgemb.m	(revision 26744)
@@ -22,6 +22,7 @@
 		isdensification;
 		isturbulentflux;
+		isconstrainsurfaceT;
 		isclimatology;
-		isconstrainsurfaceT;
+		isdeltaLWup;
 
 		%inputs:
@@ -41,6 +42,8 @@
 
 		%optional inputs:
-		aValue = NaN; %Albedo forcing at every element.  Used only if aIdx == 0.
-		teValue = NaN; %Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)
+		aValue = NaN; %Albedo forcing at every element.  Used only if aIdx == 0, or density exceeds adThresh
+		teValue = NaN; %Outward longwave radiation thermal emissivity forcing at every element (default in code is 1). 
+		               %Used only if eIdx== 0, or effective grain radius exceeds teThresh
+		dulwrfValue = NaN; %Delta with which to perturn the long wave radiation upwards. Use if isdeltaLWup is true;  
 
 		% Initialization of snow properties
@@ -53,4 +56,5 @@
 		Wini = NaN; %Water content (kg m-2)
 		Aini = NaN; %albedo (0-1)
+		Adiffini = NaN; %albedo, diffusive radiation (0-1)
 		Tini = NaN; %snow temperature (K)
 		Sizeini = NaN; %Number of layers
@@ -58,27 +62,32 @@
 		%settings:
 		aIdx   = NaN; %method for calculating albedo and subsurface absorption (default is 1)
-			      % 0: direct input from aValue parameter
-			      % 1: effective grain radius [Gardner & Sharp, 2009]
-			      % 2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003]], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)
-			      % 3: density and cloud amount [Greuell & Konzelmann, 1994]
-			      % 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
-
-		swIdx  = NaN; % apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, with snow density (taken from Bassford, 2004))
+		% 0: direct input from aValue parameter, no use of adThresh
+		% 1: effective grain radius [Gardner & Sharp, 2009]
+		% 2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003]], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)
+		% 3: density and cloud amount [Greuell & Konzelmann, 1994]
+		% 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
+
+		eIdx   = NaN; %method for calculating emissivity (default is 1)
+		% 0: direct input from teValue parameter, no use of teThresh
+		% 1: default value of 1, in areas with grain radius below teThresh
+		% 2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface
+
+		swIdx  = NaN; % apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002))
 
 		denIdx = NaN; %densification model to use (default is 2):
-			      % 1 = emperical model of Herron and Langway (1980)
-			      % 2 = semi-emperical model of Anthern et al. (2010)
-			      % 3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)
-			      % 4 = DO NOT USE: emperical model of Li and Zwally (2004)
-			      % 5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)
-			      % 6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)
-			      % 7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)
+		% 1 = emperical model of Herron and Langway (1980)
+		% 2 = semi-emperical model of Anthern et al. (2010)
+		% 3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)
+		% 4 = DO NOT USE: emperical model of Li and Zwally (2004)
+		% 5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)
+		% 6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)
+		% 7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)
 
 		dsnowIdx = NaN; %model for fresh snow accumulation density (default is 1):
-				% 0 = Original GEMB value, 150 kg/m^3
-				% 1 = Antarctica value of fresh snow density, 350 kg/m^3
-				% 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2008)
-				% 3 = Antarctica model of Kaspers et al. (2004)
-				% 4 = Greenland model of Kuipers Munneke et al. (2015)
+		% 0 = Original GEMB value, 150 kg/m^3
+		% 1 = Antarctica value of fresh snow density, 350 kg/m^3
+		% 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)
+		% 3 = Antarctica model of Kaspers et al. (2004)
+		% 4 = Greenland model of Kuipers Munneke et al. (2015)
 
 		zTop  = NaN; % depth over which grid length is constant at the top of the snopack (default 10) [m]
@@ -92,16 +101,25 @@
 
 		%specific albedo parameters:
+		%Method 1
+		dswdiffrf = NaN; %downward diffusive shortwave radiation flux [W/m^2]
+		szaValue = NaN; %Solar Zenith Angle [degree]
+		cotValue = NaN; %Cloud Optical Thickness
+		ccsnowValue = NaN; %concentration of light absorbing carbon for snow [ppm1]
+		cciceValue = NaN; %concentration of light absorbing carbon for ice [ppm1]
 		%Method 1 and 2:
 		aSnow = NaN; % new snow albedo (0.64 - 0.89)
 		aIce  = NaN; % range 0.27-0.58 for old snow
-			     %Method 3: Radiation Correction Factors -> only used for met station data and Greuell & Konzelmann, 1994 albedo
+		%Method 3: Radiation Correction Factors -> only used for met station data and Greuell & Konzelmann, 1994 albedo
 		cldFrac = NaN; % average cloud amount
-			       %Method 4: additonal tuning parameters albedo as a funtion of age and water content (Bougamont et al., 2005)
+		%Method 4: additonal tuning parameters albedo as a funtion of age and water content (Bougamont et al., 2005)
 		t0wet = NaN; % time scale for wet snow (15-21.9)
 		t0dry = NaN; % warm snow timescale (30)
 		K     = NaN; % time scale temperature coef. (7)
 		adThresh = NaN; %Apply aIdx method to all areas with densities below this value,
-		                %or else apply direct input value from aValue, allowing albedo to be altered.
-				%Default value is rho water (1023 kg m-3).
+		%or else apply direct input value from aValue, allowing albedo to be altered.
+		%Default value is rho water (1023 kg m-3).
+		teThresh = NaN; %Apply eIdx method to all areas with grain radii below this value,
+		%or else apply direct input value from teValue, allowing emissivity to be altered.
+		%Default value is a effective grain radius of 10 mm.
 
 		%densities:
@@ -115,5 +133,6 @@
 		requested_outputs      = {};
 
-		%Several fields are missing from the standard GEMB model, which are capture intrinsically by ISSM.
+		%Several fields are missing from the standard GEMB model, which are 
+		%captured intrinsically by ISSM.
 		%dateN: that's the last row of the above fields.
 		%dt:    included in dateN. Not an input.
@@ -132,163 +151,4 @@
 			end
 		end % }}}
-		function self = extrude(self,md) % {{{
-
-			self.Ta=project3d(md,'vector',self.Ta,'type','node');
-			self.V=project3d(md,'vector',self.V,'type','node');
-			self.dswrf=project3d(md,'vector',self.dswrf,'type','node');
-			self.dswrf=project3d(md,'vector',self.dswrf,'type','node');
-			self.P=project3d(md,'vector',self.P,'type','node');
-			self.eAir=project3d(md,'vector',self.eAir,'type','node');
-			self.pAir=project3d(md,'vector',self.pAir,'type','node');
-
-			if (aIdx == 0) & ~isnan(self.aValue)
-				self.aValue=project3d(md,'vector',self.aValue,'type','node');
-			end
-			if ~isnan(self.teValue)
-				self.teValue=project3d(md,'vector',self.teValue,'type','node');
-			end
-
-
-		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'SmbMassBalance'};
-		end % }}}
-		function self = setdefaultparameters(self,mesh,geometry) % {{{
-
-			self.isgraingrowth=1;
-			self.isalbedo=1;
-			self.isshortwave=1;
-			self.isthermal=1;
-			self.isaccumulation=1;
-			self.ismelt=1;
-			self.isdensification=1;
-			self.isturbulentflux=1;
-			self.isclimatology=0;
-			self.isconstrainsurfaceT=0;
-
-			self.aIdx = 1;
-			self.swIdx = 1;
-			self.denIdx = 2;
-			self.dsnowIdx = 1;
-			self.zTop=10*ones(mesh.numberofelements,1);
-			self.dzTop = .05* ones (mesh.numberofelements,1);
-			self.dzMin = self.dzTop/2;
-			self.InitDensityScaling = 1.0;
-			self.ThermoDeltaTScaling = 1/11;
-
-			self.Vmean=10.0*ones(mesh.numberofelements,1);
-
-			self.zMax=250*ones(mesh.numberofelements,1);
-			self.zMin=130*ones(mesh.numberofelements,1);
-			self.zY = 1.025*ones(mesh.numberofelements,1);
-			self.outputFreq = 30;
-
-			%additional albedo parameters
-			self.aSnow = 0.85;
-			self.aIce = 0.48;
-			self.cldFrac = 0.1;
-			self.t0wet = 15;
-			self.t0dry = 30;
-			self.K = 7;
-			self.adThresh = 1023;
-
-			self.teValue = ones(mesh.numberofelements,1);
-			self.aValue = self.aSnow*ones(mesh.numberofelements,1);
-
-			self.Dzini=0.05*ones(mesh.numberofelements,2);
-			self.Dini=910.0*ones(mesh.numberofelements,2);
-			self.Reini=2.5*ones(mesh.numberofelements,2);
-			self.Gdnini=0.0*ones(mesh.numberofelements,2);
-			self.Gspini=0.0*ones(mesh.numberofelements,2);
-			self.ECini=0.0*ones(mesh.numberofelements,1);
-			self.Wini=0.0*ones(mesh.numberofelements,2);
-			self.Aini=self.aSnow*ones(mesh.numberofelements,2);
-			self.Tini=273.15*ones(mesh.numberofelements,2);
-			% 		/!\ Default value of Tini must be equal to Tmean but don't know Tmean yet (computed when atmospheric forcings are interpolated on mesh).
-			% 		If initialization without restart, this value will be overwritten when snow parameters are retrieved in Element.cpp
-			self.Sizeini=2*ones(mesh.numberofelements,1);
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			md = checkfield(md,'fieldname','smb.isgraingrowth','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isalbedo','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isshortwave','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isthermal','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isaccumulation','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.ismelt','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isdensification','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isturbulentflux','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isclimatology','values',[0 1]);
-			md = checkfield(md,'fieldname','smb.isconstrainsurfaceT','values',[0 1]);
-
-			md = checkfield(md,'fieldname','smb.Ta','timeseries',1,'NaN',1,'Inf',1,'>',273-100,'<',273+100); %-100/100 celsius min/max value
-			md = checkfield(md,'fieldname','smb.V','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<',45,'size',size(self.Ta)); %max 500 km/h
-			md = checkfield(md,'fieldname','smb.dswrf','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1400,'size',size(self.Ta));
-			md = checkfield(md,'fieldname','smb.dlwrf','timeseries',1,'NaN',1,'Inf',1,'>=',0,'size',size(self.Ta));
-			md = checkfield(md,'fieldname','smb.P','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',200,'size',size(self.Ta));
-			md = checkfield(md,'fieldname','smb.eAir','timeseries',1,'NaN',1,'Inf',1,'size',size(self.Ta));
-
-			if (self.isclimatology)
-				md = checkfield(md,'fieldname', 'smb.Ta', 'size',[md.mesh.numberofelements+1],...
-						'message',['Ta must have md.mesh.numberofelements+1 rows in order to force a climatology']);
-				md = checkfield(md,'fieldname', 'smb.V', 'size',[md.mesh.numberofelements+1],...
-						'message',['V must have md.mesh.numberofelements+1 rows in order to force a climatology']);
-				md = checkfield(md,'fieldname', 'smb.dswrf', 'size',[md.mesh.numberofelements+1],...
-						'message',['dswrf must have md.mesh.numberofelements+1 rows in order to force a climatology']);
-				md = checkfield(md,'fieldname', 'smb.dlwrf', 'size',[md.mesh.numberofelements+1],...
-						'message',['dlwrf must have md.mesh.numberofelements+1 rows in order to force a climatology']);
-				md = checkfield(md,'fieldname', 'smb.P', 'size',[md.mesh.numberofelements+1],...
-						'message',['P must have md.mesh.numberofelements+1 rows in order to force a climatology']);
-				md = checkfield(md,'fieldname', 'smb.eAir', 'size',[md.mesh.numberofelements+1],...
-						'message',['eAir must have md.mesh.numberofelements+1 rows in order to force a climatology']);
-			end
-
-			md = checkfield(md,'fieldname','smb.Tmean','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>',273-100,'<',273+100); %-100/100 celsius min/max value
-			md = checkfield(md,'fieldname','smb.C','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>=',0);
-			md = checkfield(md,'fieldname','smb.Vmean','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>=',0);
-			md = checkfield(md,'fieldname','smb.Tz','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>=',0,'<=',5000);
-			md = checkfield(md,'fieldname','smb.Vz','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>=',0,'<=',5000);
-
-			md = checkfield(md,'fieldname','smb.teValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1);
-
-			md = checkfield(md,'fieldname','smb.aIdx','NaN',1,'Inf',1,'values',[0,1,2,3,4]);
-			md = checkfield(md,'fieldname','smb.swIdx','NaN',1,'Inf',1,'values',[0,1]);
-			md = checkfield(md,'fieldname','smb.denIdx','NaN',1,'Inf',1,'values',[1,2,3,4,5,6,7]);
-			md = checkfield(md,'fieldname','smb.dsnowIdx','NaN',1,'Inf',1,'values',[0,1,2,3,4]);
-
-			md = checkfield(md,'fieldname','smb.zTop','NaN',1,'Inf',1,'>=',0);
-			md = checkfield(md,'fieldname','smb.dzTop','NaN',1,'Inf',1,'>',0);
-			md = checkfield(md,'fieldname','smb.dzMin','NaN',1,'Inf',1,'>',0);
-			md = checkfield(md,'fieldname','smb.zY','NaN',1,'Inf',1,'>=',1);
-			md = checkfield(md,'fieldname','smb.outputFreq','NaN',1,'Inf',1,'>',0,'<',10*365); %10 years max
-			md = checkfield(md,'fieldname','smb.InitDensityScaling','NaN',1,'Inf',1,'>=',0,'<=',1);
-			md = checkfield(md,'fieldname','smb.ThermoDeltaTScaling','NaN',1,'Inf',1,'>=',0,'<=',1);
-			md = checkfield(md,'fieldname','smb.adThresh','NaN',1,'Inf',1,'>=',0);
-
-			switch self.aIdx,
-				case 0
-					md = checkfield(md,'fieldname','smb.aValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1);
-				case {1 2}
-					md = checkfield(md,'fieldname','smb.aSnow','NaN',1,'Inf',1,'>=',.64,'<=',.89);
-					md = checkfield(md,'fieldname','smb.aIce','NaN',1,'Inf',1,'>=',.27,'<=',.58);
-				case 3
-					md = checkfield(md,'fieldname','smb.cldFrac','NaN',1,'Inf',1,'>=',0,'<=',1);
-				case 4
-					md = checkfield(md,'fieldname','smb.t0wet','NaN',1,'Inf',1,'>=',15,'<=',21.9);
-					md = checkfield(md,'fieldname','smb.t0dry','NaN',1,'Inf',1,'>=',30,'<=',30);
-					md = checkfield(md,'fieldname','smb.K','NaN',1,'Inf',1,'>=',7,'<=',7);
-			end
-
-			%check zTop is < local thickness:
-			he=sum(md.geometry.thickness(md.mesh.elements),2)/size(md.mesh.elements,2);
-			if any(he<self.zTop),
-				error('SMBgemb consistency check error: zTop should be smaller than local ice thickness');
-			end
-			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
-			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
-			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-
-		end % }}}
 		function disp(self) % {{{
 
@@ -303,10 +163,11 @@
 			fielddisplay(self,'isdensification','run densification module (default true)');
 			fielddisplay(self,'isturbulentflux','run turbulant heat fluxes module (default true)');
-			fielddisplay(self,'isconstrainsurfaceT','constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change');
-			fielddisplay(self,'isclimatology','repeat all forcings when past last forcing time (default false)');
+			fielddisplay(self,'isconstrainsurfaceT','constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change (default false)');
+			fielddisplay(self,'isdeltaLWup','set to true to invoke a bias in the long wave upward spatially, specified by dulwrfValue (default false)'); 
 			fielddisplay(self,'Ta','2 m air temperature, in Kelvin');
 			fielddisplay(self,'V','wind speed (m s-1)');
-			fielddisplay(self,'dlwrf','downward shortwave radiation flux [W/m^2]');
-			fielddisplay(self,'dswrf','downward longwave radiation flux [W/m^2]');
+			fielddisplay(self,'dswrf','downward shortwave radiation flux [W/m^2]');
+			fielddisplay(self,'dswdiffrf','downward diffusive portion of shortwave radiation flux (default to 0) [W/m^2]');
+			fielddisplay(self,'dlwrf','downward longwave radiation flux [W/m^2]');
 			fielddisplay(self,'P','precipitation [mm w.e. / m^2]');
 			fielddisplay(self,'eAir','screen level vapor pressure [Pa]');
@@ -328,11 +189,17 @@
 			fielddisplay(self,'adThresh',{'Apply aIdx method to all areas with densities below this value,','or else apply direct input value from aValue, allowing albedo to be altered.'});
 			fielddisplay(self,'aIdx',{'method for calculating albedo and subsurface absorption (default is 1)',...
-					    '0: direct input from aValue parameter',...
-					    '1: effective grain radius [Gardner & Sharp, 2009]',...
-					    '2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)',...
-					    '3: density and cloud amount [Greuell & Konzelmann, 1994]',...
-					    '4: exponential time decay & wetness [Bougamont & Bamber, 2005]'})
-
+				'0: direct input from aValue parameter',...
+				'1: effective grain radius [Gardner & Sharp, 2009]',...
+				'2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)',...
+				'3: density and cloud amount [Greuell & Konzelmann, 1994]',...
+				'4: exponential time decay & wetness [Bougamont & Bamber, 2005]'})
+
+			fielddisplay(self,'dulwrfValue','Specified bias to be applied to the outward long wave radiation every element (W/m-2, +upward)');
 			fielddisplay(self,'teValue','Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)');
+			fielddisplay(self,'teThresh',{'Apply eIdx method to all areas with effective grain radius below this value,','or else apply direct input value from teValue, allowing emissivity to be altered.'});
+			fielddisplay(self,'eIdx',{'method for calculating emissivity (default is 1)',...
+				'0: direct input from teValue parameter, no use of teThresh',...
+				'1: default value of 1, in areas with grain radius below teThresh',...
+				'2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface'});
 
 			%snow properties init
@@ -345,15 +212,20 @@
 			fielddisplay(self,'Wini','Initial snow water content when restart [kg m-2]');
 			fielddisplay(self,'Aini','Initial albedo when restart [-]');
+			fielddisplay(self,'Adiffini','Initial diffusive radiation albedo when restart (default to 1) [-]');
 			fielddisplay(self,'Tini','Initial snow temperature when restart [K]');
 			fielddisplay(self,'Sizeini','Initial number of layers when restart [-]');
 
-
 			%additional albedo parameters:
+			fielddisplay(self,'aValue','Albedo forcing at every element');
 			switch self.aIdx
-				case {0 5}
-					fielddisplay(self,'aValue','Albedo forcing at every element.  Used only if aIdx == {0,5}.');
 				case {1 2}
 					fielddisplay(self,'aSnow','new snow albedo (0.64 - 0.89)');
 					fielddisplay(self,'aIce','albedo of ice (0.27-0.58)');
+					if self.aIdx==1
+						fielddisplay(self,'szaValue','Solar Zenith Angle [degree]');
+						fielddisplay(self,'cotValue','Cloud Optical Thickness');
+						fielddisplay(self,'ccsnowValue','concentration of light absorbing carbon for snow [ppm1]');
+						fielddisplay(self,'cciceValue','concentration of light absorbing carbon for snow [ppm1]');
+					end
 				case 3
 					fielddisplay(self,'cldFrac','average cloud amount');
@@ -364,19 +236,19 @@
 			end
 
-			fielddisplay(self,'swIdx','apply all SW to top grid cell (0) or allow SW to penetrate surface (1) [default 1, with snow density (taken from Bassford, 2004)]');
+			fielddisplay(self,'swIdx','apply all SW to top grid cell (0) or allow SW to penetrate surface (1) [default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)]');
 			fielddisplay(self,'denIdx',{'densification model to use (default is 2):',...
-					    '1 = emperical model of Herron and Langway (1980)',...
-					    '2 = semi-emperical model of Anthern et al. (2010)',...
-					    '3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)',...
-					    '4 = DO NOT USE: emperical model of Li and Zwally (2004)',...
-					    '5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',...
-					    '6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',...
-					    '7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)'});
+				'1 = emperical model of Herron and Langway (1980)',...
+				'2 = semi-emperical model of Anthern et al. (2010)',...
+				'3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)',...
+				'4 = DO NOT USE: emperical model of Li and Zwally (2004)',...
+				'5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',...
+				'6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',...
+				'7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)'});
 			fielddisplay(self,'dsnowIdx',{'model for fresh snow accumulation density (default is 1):',...
-					    '0 = Original GEMB value, 150 kg/m^3',...
-					    '1 = Antarctica value of fresh snow density, 350 kg/m^3',...
-					    '2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2008)',...
-					    '3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',...
-					    '4 = Greenland model of Kuipers Munneke et al. (2015)'});
+				'0 = Original GEMB value, 150 kg/m^3',...
+				'1 = Antarctica value of fresh snow density, 350 kg/m^3',...
+				'2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)',...
+				'3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',...
+				'4 = Greenland model of Kuipers Munneke et al. (2015)'});
 
 			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
@@ -387,4 +259,212 @@
 			fielddisplay(self,'requested_outputs','additional outputs requested');
 
+
+		end % }}}
+		function self = extrude(self,md) % {{{
+
+			self.Ta=project3d(md,'vector',self.Ta,'type','element');
+			self.V=project3d(md,'vector',self.V,'type','element');
+			self.dswrf=project3d(md,'vector',self.dswrf,'type','element');
+			self.dslrf=project3d(md,'vector',self.dslrf,'type','element');
+			self.P=project3d(md,'vector',self.P,'type','element');
+			self.eAir=project3d(md,'vector',self.eAir,'type','element');
+			self.pAir=project3d(md,'vector',self.pAir,'type','element');
+
+			if ~isnan(self.Dzini)
+				self.Dzini=project3d(md,'vector',self.Dzini,'type','element');
+			end
+			if ~isnan(self.Dini)
+				self.Dini=project3d(md,'vector',self.Dini,'type','element');
+			end
+			if ~isnan(self.Reini)
+				self.Reini=project3d(md,'vector',self.Reini,'type','element');
+			end
+			if ~isnan(self.Gdnini)
+				self.Gdnini=project3d(md,'vector',self.Gdnini,'type','element');
+			end
+			if ~isnan(self.Gspini)
+				self.Gspini=project3d(md,'vector',self.Gspini,'type','element');
+			end
+			if ~isnan(self.ECini)
+				self.ECini=project3d(md,'vector',self.ECini,'type','element');
+			end
+			if ~isnan(self.Wini)
+				self.Wini=project3d(md,'vector',self.Wini,'type','element');
+			end
+			if ~isnan(self.Aini)
+				self.Aini=project3d(md,'vector',self.Aini,'type','element');
+			end
+			if ~isnan(self.Adiffini)
+				self.Adiffini=project3d(md,'vector',self.Adiffini,'type','element');
+			end
+			if ~isnan(self.Tini)
+				self.Tini=project3d(md,'vector',self.Tini,'type','element');
+			end
+
+			if ~isnan(self.dswdiffrf)
+				self.dswdiffrf=project3d(md,'vector',self.dswdiffrf,'type','element');
+			end
+			if ~isnan(self.szaValue)
+				self.szaValue=project3d(md,'vector',self.szaValue,'type','element');
+			end
+			if ~isnan(self.cotValue)
+				self.cotValue=project3d(md,'vector',self.cotValue,'type','element');
+			end
+			if ~isnan(self.ccsnowValue)
+				self.ccsnowValue=project3d(md,'vector',self.ccsnowValue,'type','element');
+			end
+			if ~isnan(self.cciceValue)
+				self.cciceValue=project3d(md,'vector',self.cciceValue,'type','element');
+			end
+			if ~isnan(self.aValue)
+				self.aValue=project3d(md,'vector',self.aValue,'type','element');
+			end
+			if ~isnan(self.teValue)
+				self.teValue=project3d(md,'vector',self.teValue,'type','element');
+			end
+
+		end % }}}
+		function list = defaultoutputs(self,md) % {{{
+			list = {'SmbMassBalance','SmbAccumulatedMassBalance'};
+		end % }}}
+		function self = setdefaultparameters(self,mesh,geometry) % {{{
+
+			self.isgraingrowth=1;
+			self.isalbedo=1;
+			self.isshortwave=1;
+			self.isthermal=1;
+			self.isaccumulation=1;
+			self.ismelt=1;
+			self.isdensification=1;
+			self.isturbulentflux=1;
+			self.isconstrainsurfaceT=0;
+			self.isdeltaLWup=0;
+
+			self.aIdx = 1;
+			self.eIdx = 1;
+			self.swIdx = 1;
+			self.denIdx = 2;
+			self.dsnowIdx = 1;
+			self.zTop=10*ones(mesh.numberofelements,1);
+			self.dzTop = .05* ones (mesh.numberofelements,1);
+			self.dzMin = self.dzTop/2;
+			self.InitDensityScaling = 1.0;
+			self.ThermoDeltaTScaling = 1/11;
+
+			self.Vmean=10.0*ones(mesh.numberofelements,1);
+
+			self.zMax=250*ones(mesh.numberofelements,1);
+			self.zMin=130*ones(mesh.numberofelements,1);
+			self.zY = 1.025*ones(mesh.numberofelements,1);
+			self.outputFreq = 30;
+
+			%additional albedo parameters
+			self.aSnow = 0.85;
+			self.aIce = 0.48;
+			self.cldFrac = 0.1;
+			self.t0wet = 15;
+			self.t0dry = 30;
+			self.K = 7;
+			self.adThresh = 1023;
+			self.teThresh = 10;
+
+			self.teValue = ones(mesh.numberofelements,1);
+			self.aValue = self.aSnow*ones(mesh.numberofelements,1);
+			self.dulwrfValue = zeros(mesh.numberofelements,1);
+
+			self.dswdiffrf=0.0*ones(mesh.numberofelements,1);
+			self.szaValue=0.0*ones(mesh.numberofelements,1);
+			self.cotValue=0.0*ones(mesh.numberofelements,1);
+			self.ccsnowValue=0.0*ones(mesh.numberofelements,1);
+			self.cciceValue=0.0*ones(mesh.numberofelements,1);
+
+			self.Dzini=0.05*ones(mesh.numberofelements,2);
+			self.Dini=910.0*ones(mesh.numberofelements,2);
+			self.Reini=2.5*ones(mesh.numberofelements,2);
+			self.Gdnini=0.0*ones(mesh.numberofelements,2);
+			self.Gspini=0.0*ones(mesh.numberofelements,2);
+			self.ECini=0.0*ones(mesh.numberofelements,1);
+			self.Wini=0.0*ones(mesh.numberofelements,2);
+			self.Aini=self.aSnow*ones(mesh.numberofelements,2);
+			self.Adiffini=ones(mesh.numberofelements,2);
+			self.Tini=273.15*ones(mesh.numberofelements,2);
+			% 		/!\ Default value of Tini must be equal to Tmean but don't know Tmean yet (computed when atmospheric forcings are interpolated on mesh).
+			% 		If initialization without restart, this value will be overwritten when snow parameters are retrieved in Element.cpp
+			self.Sizeini=2*ones(mesh.numberofelements,1);
+
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			md = checkfield(md,'fieldname','smb.isgraingrowth','values',[0 1]);
+			md = checkfield(md,'fieldname','smb.isalbedo','values',[0 1]);
+			md = checkfield(md,'fieldname','smb.isshortwave','values',[0 1]);
+			md = checkfield(md,'fieldname','smb.isthermal','values',[0 1]);
+			md = checkfield(md,'fieldname','smb.isaccumulation','values',[0 1]);
+			md = checkfield(md,'fieldname','smb.ismelt','values',[0 1]);
+			md = checkfield(md,'fieldname','smb.isdensification','values',[0 1]);
+			md = checkfield(md,'fieldname','smb.isturbulentflux','values',[0 1]);
+			md = checkfield(md,'fieldname','smb.isconstrainsurfaceT','values',[0 1]);
+			md = checkfield(md,'fieldname','smb.isdeltaLWup','values',[0 1]);
+
+			md = checkfield(md,'fieldname','smb.Ta','timeseries',1,'NaN',1,'Inf',1,'>',273-100,'<',273+100); %-100/100 celsius min/max value
+			md = checkfield(md,'fieldname','smb.V','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<',45,'size',size(self.Ta)); %max 500 km/h
+			md = checkfield(md,'fieldname','smb.dswrf','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1400,'size',size(self.Ta));
+			md = checkfield(md,'fieldname','smb.dswdiffrf','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1400);
+			md = checkfield(md,'fieldname','smb.dlwrf','timeseries',1,'NaN',1,'Inf',1,'>=',0,'size',size(self.Ta));
+			md = checkfield(md,'fieldname','smb.P','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',200,'size',size(self.Ta));
+			md = checkfield(md,'fieldname','smb.eAir','timeseries',1,'NaN',1,'Inf',1,'size',size(self.Ta));
+
+			md = checkfield(md,'fieldname','smb.Tmean','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>',273-100,'<',273+100); %-100/100 celsius min/max value
+			md = checkfield(md,'fieldname','smb.C','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>',0);
+			md = checkfield(md,'fieldname','smb.Vmean','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>=',0);
+			md = checkfield(md,'fieldname','smb.Tz','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>=',0,'<=',5000);
+			md = checkfield(md,'fieldname','smb.Vz','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>=',0,'<=',5000);
+
+			md = checkfield(md,'fieldname','smb.teValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1);
+			md = checkfield(md,'fieldname','smb.dulwrfValue','timeseries',1,'NaN',1,'Inf',1);
+
+			md = checkfield(md,'fieldname','smb.aIdx','NaN',1,'Inf',1,'values',[0,1,2,3,4]);
+			md = checkfield(md,'fieldname','smb.eIdx','NaN',1,'Inf',1,'values',[0,1,2]);
+			md = checkfield(md,'fieldname','smb.swIdx','NaN',1,'Inf',1,'values',[0,1]);
+			md = checkfield(md,'fieldname','smb.denIdx','NaN',1,'Inf',1,'values',[1,2,3,4,5,6,7]);
+			md = checkfield(md,'fieldname','smb.dsnowIdx','NaN',1,'Inf',1,'values',[0,1,2,3,4]);
+
+			md = checkfield(md,'fieldname','smb.zTop','NaN',1,'Inf',1,'>=',0);
+			md = checkfield(md,'fieldname','smb.dzTop','NaN',1,'Inf',1,'>',0);
+			md = checkfield(md,'fieldname','smb.dzMin','NaN',1,'Inf',1,'>',0);
+			md = checkfield(md,'fieldname','smb.zY','NaN',1,'Inf',1,'>=',1);
+			md = checkfield(md,'fieldname','smb.outputFreq','NaN',1,'Inf',1,'>',0,'<',10*365); %10 years max
+			md = checkfield(md,'fieldname','smb.InitDensityScaling','NaN',1,'Inf',1,'>=',0,'<=',1);
+			md = checkfield(md,'fieldname','smb.ThermoDeltaTScaling','NaN',1,'Inf',1,'>=',0,'<=',1);
+			md = checkfield(md,'fieldname','smb.adThresh','NaN',1,'Inf',1,'>=',0);
+			md = checkfield(md,'fieldname','smb.teThresh','NaN',1,'Inf',1,'>=',0);
+
+			md = checkfield(md,'fieldname','smb.aValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1);
+			switch self.aIdx,
+				case {1 2}
+					md = checkfield(md,'fieldname','smb.aSnow','NaN',1,'Inf',1,'>=',.64,'<=',.89);
+					md = checkfield(md,'fieldname','smb.aIce','NaN',1,'Inf',1,'>=',.27,'<=',.58);
+					if self.aIdx==1
+						md = checkfield(md,'fieldname','smb.szaValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',90);
+						md = checkfield(md,'fieldname','smb.cotValue','timeseries',1,'NaN',1,'Inf',1,'>=',0);
+						md = checkfield(md,'fieldname','smb.ccsnowValue','timeseries',1,'NaN',1,'Inf',1,'>=',0);
+						md = checkfield(md,'fieldname','smb.cciceValue','timeseries',1,'NaN',1,'Inf',1,'>=',0);
+					end
+				case 3
+					md = checkfield(md,'fieldname','smb.cldFrac','NaN',1,'Inf',1,'>=',0,'<=',1);
+				case 4
+					md = checkfield(md,'fieldname','smb.t0wet','NaN',1,'Inf',1,'>=',15,'<=',21.9);
+					md = checkfield(md,'fieldname','smb.t0dry','NaN',1,'Inf',1,'>=',30,'<=',30);
+					md = checkfield(md,'fieldname','smb.K','NaN',1,'Inf',1,'>=',7,'<=',7);
+			end
+
+			%check zTop is < local thickness:
+			he=sum(md.geometry.thickness(md.mesh.elements),2)/size(md.mesh.elements,2);
+			if any(he<self.zTop),
+				error('SMBgemb consistency check error: zTop should be smaller than local ice thickness');
+			end
+			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
+			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
+			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
 
 		end % }}}
@@ -403,10 +483,11 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdensification','format','Boolean');
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isturbulentflux','format','Boolean');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isclimatology','format','Boolean');
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isconstrainsurfaceT','format','Boolean');
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdeltaLWup','format','Boolean');
 
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Ta','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','V','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dswrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dswdiffrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dlwrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','P','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
@@ -427,4 +508,5 @@
 
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','aIdx','format','Integer');
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','eIdx','format','Integer');
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','swIdx','format','Integer');
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','denIdx','format','Integer');
@@ -440,7 +522,13 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','K','format','Double');
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','adThresh','format','Double');
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','teThresh','format','Double');
 
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','aValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','teValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dulwrfValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','szaValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','cotValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ccsnowValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','cciceValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
 
 			%snow properties init
@@ -453,4 +541,5 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Wini','format','DoubleMat','mattype',3);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Aini','format','DoubleMat','mattype',3);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Adiffini','format','DoubleMat','mattype',3);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tini','format','DoubleMat','mattype',3);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Sizeini','format','IntMat','mattype',2);
@@ -466,4 +555,28 @@
 				error('All GEMB forcings (Ta, P, V, dswrf, dlwrf, eAir, pAir) must have the same time steps in the final row!');
 			end
+			if size(md.smb.teValue,2)>1 & any(md.smb.teValue(end,:) - md.smb.Ta(end,:) ~= 0)
+				error('If GEMB forcing teValue is transient, it must have the same time steps as input Ta in the final row!');
+			end
+			if size(md.smb.dswdiffrf,2)>1 & any(md.smb.dswdiffrf(end,:) - md.smb.Ta(end,:) ~= 0)
+				error('If GEMB forcing dswdiffrf is transient, it must have the same time steps as input Ta in the final row!');
+			end
+			if size(md.smb.dulwrfValue,2)>1 & any(md.smb.dulwrfValue(end,:) - md.smb.Ta(end,:) ~= 0)
+				error('If GEMB forcing dulwrfValue is transient, it must have the same time steps as input Ta in the final row!');
+			end
+			if size(md.smb.aValue,2)>1 & any(md.smb.aValue(end,:) - md.smb.Ta(end,:) ~= 0)
+				error('If GEMB forcing aValue is transient, it must have the same time steps as input Ta in the final row!');
+			end
+			if size(md.smb.szaValue,2)>1 & any(md.smb.szaValue(end,:) - md.smb.Ta(end,:) ~= 0)
+				error('If GEMB forcing szaValue is transient, it must have the same time steps as input Ta in the final row!');
+			end
+			if size(md.smb.cotValue,2)>1 & any(md.smb.cotValue(end,:) - md.smb.Ta(end,:) ~= 0)
+				error('If GEMB forcing cotValue is transient, it must have the same time steps as input Ta in the final row!');
+			end
+			if size(md.smb.ccsnowValue,2)>1 & any(md.smb.ccsnowValue(end,:) - md.smb.Ta(end,:) ~= 0)
+				error('If GEMB forcing ccsnowValue is transient, it must have the same time steps as input Ta in the final row!');
+			end
+			if size(md.smb.cciceValue,2)>1 & any(md.smb.cciceValue(end,:) - md.smb.Ta(end,:) ~= 0)
+				error('If GEMB forcing cciceValue is transient, it must have the same time steps as input Ta in the final row!');
+			end
 			time=self.Ta(end,:); %assume all forcings are on the same time step
 			dtime=diff(time,1);
Index: /issm/trunk/src/m/classes/SMBgemb.py
===================================================================
--- /issm/trunk/src/m/classes/SMBgemb.py	(revision 26743)
+++ /issm/trunk/src/m/classes/SMBgemb.py	(revision 26744)
@@ -8,29 +8,31 @@
 
 class SMBgemb(object):
+    """SMBGEMB class definition
+
+    Usage:
+        SMB = SMBgemb()
     """
-    SMBgemb Class definition
-
-       Usage:
-          SMB = SMBgemb()
-    """
 
     def __init__(self, *args):  # {{{
-        #each one of these properties is a transient forcing to the GEMB model, loaded from meteorological data derived
-        #from an automatic weather stations (AWS). Each property is therefore a matrix, of size (numberofvertices x number
-        #of time steps. )
+        """Each one of these properties is a transient forcing to the GEMB 
+        model, loaded from meteorological data derived from an automatic 
+        weather stations (AWS). Each property is therefore a matrix, of size 
+        (numberofvertices x number of time steps.
+        """
 
         #solution choices
-        #check these:
-        #self.isgraingrowth = 0
-        #self.issmbgradients = 0
-        #isalbedo
-        #isshortwave
-        #isthermal
-        #isaccumulation
-        #ismelt
-        #isdensification
-        #isturbulentflux
-
-        #inputs:
+        self.isgraingrowth = 0
+        self.isalbedo = 0
+        self.isshortwave = 0
+        self.isthermal = 0
+        self.isaccumulation = 0
+        self.ismelt = 0
+        self.isdensification = 0
+        self.isturbulentflux = 0
+        self.isconstrainsurfaceT = 0
+        self.isdeltaLWup = 0
+        self.isclimatology = np.nan
+
+        # Inputs
         self.Ta                     = np.nan    # 2 m air temperature, in Kelvin
         self.V                      = np.nan    # wind speed (m/s-1)
@@ -40,4 +42,5 @@
         self.eAir                   = np.nan    # screen level vapor pressure [Pa]
         self.pAir                   = np.nan    # surface pressure [Pa]
+
         self.Tmean                  = np.nan    # mean annual temperature [K]
         self.Vmean                  = np.nan    # mean annual wind velocity [m s-1]
@@ -46,7 +49,8 @@
         self.Vz                     = np.nan    # height above ground at which wind (V) was sampled [m]
 
-        #optional inputs:
-        self.aValue                 = np.nan    # Albedo forcing at every element.  Used only if aIdx == 0.
-        self.teValue                = np.nan    # Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)
+        # Optional inputs
+        self.aValue                 = np.nan    # Albedo forcing at every element. Used only if aIdx == 0, or density exceeds adThresh.
+        self.teValue                = np.nan    # Outward longwave radiation thermal emissivity forcing at every element (default in code is 1), Used only if eIdx== 0, or effective grain radius exceeds teThresh
+        dulwrfValue                 = np.nan    #Delta with which to perturn the long wave radiation upwards. Use if isdeltaLWup is true
 
         # Initialization of snow properties
@@ -54,40 +58,48 @@
         self.Dini                   = np.nan    # snow density (kg m-3)
         self.Reini                  = np.nan    # effective grain size (mm)
-        self.Gdnini                 = np.nan    # grain dricity (0-1)
+        self.Gdnini                 = np.nan    # grain dendricity (0-1)
         self.Gspini                 = np.nan    # grain sphericity (0-1)
         self.ECini                  = np.nan    # evaporation/condensation (kg m-2)
         self.Wini                   = np.nan    # Water content (kg m-2)
         self.Aini                   = np.nan    # albedo (0-1)
+        self.Adiffini               = np.nan    # albedo, diffusive radiation (0-1)
         self.Tini                   = np.nan    # snow temperature (K)
         self.Sizeini                = np.nan    # Number of layers
 
-        #settings:
+        # Settings
         self.aIdx                   = np.nan    # method for calculating albedo and subsurface absorption (default is 1)
-            # 0: direct input from aValue parameter
-            # 1: effective grain radius [Gardner & Sharp, 2009]
-            # 2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)
-            # 3: density and cloud amount [Greuell & Konzelmann, 1994]
-            # 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
-
-        self.swIdx                  = np.nan    # apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, with snow density (taken from Bassford, 2004))
+        # 0: direct input from aValue parameter, no use of adThresh
+        # 1: effective grain radius [Gardner & Sharp, 2009]
+        # 2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)
+        # 3: density and cloud amount [Greuell & Konzelmann, 1994]
+        # 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
+        
+        self.eIdx                   = np.nan    #method for calculating emissivity (default is 1)
+        # 0: direct input from teValue parameter, no use of teThresh
+        # 1: default value of 1, in areas with grain radius below teThresh
+        # 2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface
+
+        self.swIdx                  = np.nan    # apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002))
+
         self.denIdx                 = np.nan    # densification model to use (default is 2):
-            # 1 = emperical model of Herron and Langway (1980)
-            # 2 = semi-emperical model of Anthern et al. (2010)
-            # 3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)
-            # 4 = DO NOT USE: emperical model of Li and Zwally (2004)
-            # 5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)
-            # 6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)
-            # 7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)
+        # 1 = emperical model of Herron and Langway (1980)
+        # 2 = semi-emperical model of Anthern et al. (2010)
+        # 3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)
+        # 4 = DO NOT USE: emperical model of Li and Zwally (2004)
+        # 5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)
+        # 6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)
+        # 7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)
 
         self.dsnowIdx               = np.nan    # model for fresh snow accumulation density (default is 1):
-            # 0 = Original GEMB value, 150 kg/m^3
-            # 1 = Antarctica value of fresh snow density, 350 kg/m^3
-            # 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2008)
-            # 3 = Antarctica model of Kaspers et al. (2004)
-            # 4 = Greenland model of Kuipers Munneke et al. (2015)
+        # 0 = Original GEMB value, 150 kg/m^3
+        # 1 = Antarctica value of fresh snow density, 350 kg/m^3
+        # 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)
+        # 3 = Antarctica model of Kaspers et al. (2004)
+        # 4 = Greenland model of Kuipers Munneke et al. (2015)
 
         self.zTop                   = np.nan    # depth over which grid length is constant at the top of the snopack (default 10) [m]
         self.dzTop                  = np.nan    # initial top vertical grid spacing (default .05) [m]
         self.dzMin                  = np.nan    # initial min vertical allowable grid spacing (default dzMin/2) [m]
+
         self.zY                     = np.nan    # strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]
         self.zMax                   = np.nan    # initial max model depth (default is min(thickness, 250)) [m]
@@ -95,6 +107,12 @@
         self.outputFreq             = np.nan    # output frequency in days (default is monthly, 30)
 
-        #specific albedo parameters:
-        #Method 1 and 2:
+        # Specific albedo parameters
+        # Method 1
+        self.dswdiffrf              = np.nan    # downward diffusive shortwave radiation flux [W/m^2]
+        self.szaValue               = np.nan    # Solar Zenith Angle [degree]
+        self.cotValue               = np.nan    # Cloud Optical Thickness
+        self.ccsnowValue            = np.nan    # concentration of light absorbing carbon for snow [ppm1]
+        self.cciceValue             = np.nan    # concentration of light absorbing carbon for ice [ppm1]
+        # Method 1 and 2
         self.aSnow                  = np.nan    # new snow albedo (0.64 - 0.89)
         self.aIce                   = np.nan    # range 0.27-0.58 for old snow
@@ -108,9 +126,12 @@
         # or else apply direct input value from aValue, allowing albedo to be altered.
         # Default value is rho water (1023 kg m-3).
-
-        #densities:
+        teThresh                    = np.nan    #Apply eIdx method to all areas with grain radii below this value,
+        #or else apply direct input value from teValue, allowing emissivity to be altered.
+        #Default value is a effective grain radius of 10 mm.
+
+        # Densities
         self.InitDensityScaling     = np.nan    # initial scaling factor multiplying the density of ice, which describes the density of the snowpack.
 
-        #thermo:
+        # Thermal
         self.ThermoDeltaTScaling    = np.nan    # scaling factor to multiply the thermal diffusion timestep (delta t)
 
@@ -119,5 +140,6 @@
         self.requested_outputs      = []
 
-        #Several fields are missing from the standard GEMB model, which are capture intrinsically by ISSM.
+        #Several fields are missing from the standard GEMB model, which are 
+        #captured intrinsically by ISSM.
         #dateN: that's the last row of the above fields.
         #dt:    included in dateN. Not an input.
@@ -125,11 +147,10 @@
 
         nargin = len(args)
-        if nargin:
-            if nargin == 2:
-                mesh = args[0]
-                geometry = args[1]
-                self.setdefaultparameters(mesh, geometry)
-            else:
-                raise Exception('constructor not supported: need mesh and geometry to set defaults')
+        if nargin == 2:
+            mesh = args[0]
+            geometry = args[1]
+            self.setdefaultparameters(mesh, geometry)
+        else:
+            raise Exception('constructor not supported: need mesh and geometry to set defaults')
         #}}}
 
@@ -138,109 +159,153 @@
         #string = "#s\n#s"%(string, fielddisplay(self, 'mass_balance', 'surface mass balance [m/yr ice eq]'))
         #string = "#s\n#s"%(string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        string = '   surface forcings for SMB GEMB model :'
-        string = "%s\n%s" % (string, fielddisplay(self, 'issmbgradients', 'is smb gradients method activated (0 or 1, default is 0)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'isgraingrowth', 'run grain growth module (default true)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'isalbedo', 'run albedo module (default true)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'isshortwave', 'run short wave module (default true)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'isthermal', 'run thermal module (default true)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'isaccumulation', 'run accumulation module (default true)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'ismelt', 'run melting  module (default true)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'isdensification', 'run densification module (default true)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'isturbulentflux', 'run turbulant heat fluxes module (default true)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'isconstrainsurfaceT', 'constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'isclimatology', 'repeat all forcings when past last forcing time (default false)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'Ta', '2 m air temperature, in Kelvin'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'V', 'wind speed (m s-1)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'dlwrf', 'downward shortwave radiation flux [W/m^2]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'dswrf', 'downward longwave radiation flux [W/m^2]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'P', 'precipitation [mm w.e. / m^2]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'eAir', 'screen level vapor pressure [Pa]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'pAir', 'surface pressure [Pa]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'Tmean', 'mean annual temperature [K]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'C', 'mean annual snow accumulation [kg m-2 yr-1]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'Vmean', 'mean annual temperature [m s-1] (default 10 m/s)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'Tz', 'height above ground at which temperature (T) was sampled [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'Vz', 'height above ground at which wind (V) eas sampled [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'zTop', 'depth over which grid length is constant at the top of the snopack (default 10) [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'dzTop', 'initial top vertical grid spacing (default .05) [m] '))
-        string = "%s\n%s" % (string, fielddisplay(self, 'dzMin', 'initial min vertical allowable grid spacing (default dzMin/2) [m] '))
-        string = "%s\n%s" % (string, fielddisplay(self, 'zMax', 'initial max model depth (default is min(thickness, 500)) [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'zMin', 'initial min model depth (default is min(thickness, 30)) [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'zY', 'strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'InitDensityScaling', ['initial scaling factor multiplying the density of ice', 'which describes the density of the snowpack.']))
-        string = "%s\n%s" % (string, fielddisplay(self, 'ThermoDeltaTScaling', 'scaling factor to multiply the thermal diffusion timestep (delta t)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'outputFreq', 'output frequency in days (default is monthly, 30)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'adThresh', 'Apply aIdx method to all areas with densities below this value, ', 'or else apply direct input value from aValue, allowing albedo to be altered.'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'aIdx', ['method for calculating albedo and subsurface absorption (default is 1)',
-                                                                 '0: direct input from aValue parameter',
-                                                                 '1: effective grain radius [Gardner & Sharp, 2009]',
-                                                                 '2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)',
-                                                                 '3: density and cloud amount [Greuell & Konzelmann, 1994]',
-                                                                 '4: exponential time decay & wetness [Bougamont & Bamber, 2005]']))
-        string = "%s\n%s" % (string, fielddisplay(self, 'teValue', 'Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)'))
-        #snow properties init
-        string = "%s\n%s" % (string, fielddisplay(self, 'Dzini', 'Initial cell depth when restart [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'Dini', 'Initial snow density when restart [kg m-3]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'Reini', 'Initial grain size when restart [mm]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'Gdnini', 'Initial grain dricity when restart [-]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'Gspini', 'Initial grain sphericity when restart [-]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'ECini', 'Initial evaporation/condensation when restart [kg m-2]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'Wini', 'Initial snow water content when restart [kg m-2]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'Aini', 'Initial albedo when restart [-]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'Tini', 'Initial snow temperature when restart [K]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'Sizeini', 'Initial number of layers when restart [-]'))
-
-        #additional albedo parameters:
+        s = '   surface forcings for SMB GEMB model :\n'
+        s += '{}\n'.format(fielddisplay(self, 'isgraingrowth', 'run grain growth module (default true)'))
+        s += '{}\n'.format(fielddisplay(self, 'isalbedo', 'run albedo module (default true)'))
+        s += '{}\n'.format(fielddisplay(self, 'isshortwave', 'run short wave module (default true)'))
+        s += '{}\n'.format(fielddisplay(self, 'isthermal', 'run thermal module (default true)'))
+        s += '{}\n'.format(fielddisplay(self, 'isaccumulation', 'run accumulation module (default true)'))
+        s += '{}\n'.format(fielddisplay(self, 'ismelt', 'run melting  module (default true)'))
+        s += '{}\n'.format(fielddisplay(self, 'isdensification', 'run densification module (default true)'))
+        s += '{}\n'.format(fielddisplay(self, 'isturbulentflux', 'run turbulant heat fluxes module (default true)'))
+        s += '{}\n'.format(fielddisplay(self, 'isconstrainsurfaceT', 'constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change (default false)'))
+        s += '{}\n'.format(fielddisplay(self, 'isdeltaLWup', 'set to true to invoke a bias in the long wave upward spatially, specified by dulwrfValue (default false)'))
+        s += '{}\n'.format(fielddisplay(self, 'Ta', '2 m air temperature, in Kelvin'))
+        s += '{}\n'.format(fielddisplay(self, 'V', 'wind speed (m s-1)'))
+        s += '{}\n'.format(fielddisplay(self, 'dswrf', 'downward shortwave radiation flux [W/m^2]'))
+        s += '{}\n'.format(fielddisplay(self, 'dswdiffrf', 'downward diffusive portion of shortwave radiation flux (default to 0) [W/m^2]'))
+        s += '{}\n'.format(fielddisplay(self, 'dlwrf', 'downward longwave radiation flux [W/m^2]'))
+        s += '{}\n'.format(fielddisplay(self, 'P', 'precipitation [mm w.e. / m^2]'))
+        s += '{}\n'.format(fielddisplay(self, 'eAir', 'screen level vapor pressure [Pa]'))
+        s += '{}\n'.format(fielddisplay(self, 'pAir', 'surface pressure [Pa]'))
+        s += '{}\n'.format(fielddisplay(self, 'Tmean', 'mean annual temperature [K]'))
+        s += '{}\n'.format(fielddisplay(self, 'C', 'mean annual snow accumulation [kg m-2 yr-1]'))
+        s += '{}\n'.format(fielddisplay(self, 'Vmean', 'mean annual temperature [m s-1] (default 10 m/s)'))
+        s += '{}\n'.format(fielddisplay(self, 'Tz', 'height above ground at which temperature (T) was sampled [m]'))
+        s += '{}\n'.format(fielddisplay(self, 'Vz', 'height above ground at which wind (V) eas sampled [m]'))
+        s += '{}\n'.format(fielddisplay(self, 'zTop', 'depth over which grid length is constant at the top of the snopack (default 10) [m]'))
+        s += '{}\n'.format(fielddisplay(self, 'dzTop', 'initial top vertical grid spacing (default .05) [m] '))
+        s += '{}\n'.format(fielddisplay(self, 'dzMin', 'initial min vertical allowable grid spacing (default dzMin/2) [m] '))
+        s += '{}\n'.format(fielddisplay(self, 'zMax', 'initial max model depth (default is min(thickness, 500)) [m]'))
+        s += '{}\n'.format(fielddisplay(self, 'zMin', 'initial min model depth (default is min(thickness, 30)) [m]'))
+        s += '{}\n'.format(fielddisplay(self, 'zY', 'strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]'))
+        s += '{}\n'.format(fielddisplay(self, 'InitDensityScaling', ['initial scaling factor multiplying the density of ice', 'which describes the density of the snowpack.']))
+        s += '{}\n'.format(fielddisplay(self, 'ThermoDeltaTScaling', 'scaling factor to multiply the thermal diffusion timestep (delta t)'))
+        s += '{}\n'.format(fielddisplay(self, 'outputFreq', 'output frequency in days (default is monthly, 30)'))
+        s += '{}\n'.format(fielddisplay(self, 'adThresh', 'Apply aIdx method to all areas with densities below this value, ', 'or else apply direct input value from aValue, allowing albedo to be altered.'))
+        s += '{}\n'.format(fielddisplay(self, 'aIdx', ['method for calculating albedo and subsurface absorption (default is 1)',
+            '0: direct input from aValue parameter',
+            '1: effective grain radius [Gardner & Sharp, 2009]',
+            '2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)',
+            '3: density and cloud amount [Greuell & Konzelmann, 1994]',
+            '4: exponential time decay & wetness [Bougamont & Bamber, 2005]']))
+
+        s += '{}\n'.format(fielddisplay(self, 'dulwrfValue', 'Specified bias to be applied to the outward long wave radiation every element (W/m-2, +upward)'))
+        s += '{}\n'.format(fielddisplay(self, 'teValue', 'Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)'))
+        s += '{}\n'.format(fielddisplay(self, 'teThresh', ['Apply eIdx method to all areas with effective grain radius below this value,', 'or else apply direct input value from teValue, allowing emissivity to be altered.']))
+        s += '{}\n'.format(fielddisplay(self, 'eIdx', ['method for calculating emissivity (default is 1)',
+            '0: direct input from teValue parameter, no use of teThresh',
+            '1: default value of 1, in areas with grain radius below teThresh',
+            '2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface']))
+
+        # Snow properties init
+        s += '{}\n'.format(fielddisplay(self, 'Dzini', 'Initial cell depth when restart [m]'))
+        s += '{}\n'.format(fielddisplay(self, 'Dini', 'Initial snow density when restart [kg m-3]'))
+        s += '{}\n'.format(fielddisplay(self, 'Reini', 'Initial grain size when restart [mm]'))
+        s += '{}\n'.format(fielddisplay(self, 'Gdnini', 'Initial grain dricity when restart [-]'))
+        s += '{}\n'.format(fielddisplay(self, 'Gspini', 'Initial grain sphericity when restart [-]'))
+        s += '{}\n'.format(fielddisplay(self, 'ECini', 'Initial evaporation/condensation when restart [kg m-2]'))
+        s += '{}\n'.format(fielddisplay(self, 'Wini', 'Initial snow water content when restart [kg m-2]'))
+        s += '{}\n'.format(fielddisplay(self, 'Aini', 'Initial albedo when restart [-]'))
+        s += '{}\n'.format(fielddisplay(self, 'Adiffini', 'Initial diffusive radiation albedo when restart (default to 1) [-]'))
+        s += '{}\n'.format(fielddisplay(self, 'Tini', 'Initial snow temperature when restart [K]'))
+        s += '{}\n'.format(fielddisplay(self, 'Sizeini', 'Initial number of layers when restart [-]'))
+
+        # Additional albedo parameters
+        s += '{}\n'.format(fielddisplay(self, 'aValue', 'Albedo forcing at every element'))
         if isinstance(self.aIdx, (list, type(np.array([1, 2])))) and (self.aIdx == [1, 2] or (1 in self.aIdx and 2 in self.aIdx)):
-            string = "%s\n%s" % (string, fielddisplay(self, 'aSnow', 'new snow albedo (0.64 - 0.89)'))
-            string = "%s\n%s" % (string, fielddisplay(self, 'aIce', 'albedo of ice (0.27-0.58)'))
-        elif self.aIdx == 0:
-            string = "%s\n%s" % (string, fielddisplay(self, 'aValue', 'Albedo forcing at every element.  Used only if aIdx == {0, 5}'))
-        elif self.aIdx == 5:
-            string = "%s\n%s" % (string, fielddisplay(self, 'aValue', 'Albedo forcing at every element.  Used only if aIdx == {0, 5}'))
+            s += '{}\n'.format(fielddisplay(self, 'aSnow', 'new snow albedo (0.64 - 0.89)'))
+            s += '{}\n'.format(fielddisplay(self, 'aIce', 'albedo of ice (0.27-0.58)'))
+            if self.aIdx == 1:
+                s += '{}\n'.format(fielddisplay(self,'szaValue','Solar Zenith Angle [degree]'))
+                s += '{}\n'.format(fielddisplay(self,'cotValue','Cloud Optical Thickness'))
+                s += '{}\n'.format(fielddisplay(self,'ccsnowValue','concentration of light absorbing carbon for snow [ppm1]'))
+                s += '{}\n'.format(fielddisplay(self,'cciceValue','concentration of light absorbing carbon for snow [ppm1]'))
         elif self.aIdx == 3:
-            string = "%s\n%s" % (string, fielddisplay(self, 'cldFrac', 'average cloud amount'))
+            s += '{}\n'.format(fielddisplay(self, 'cldFrac', 'average cloud amount'))
         elif self.aIdx == 4:
-            string = "%s\n%s" % (string, fielddisplay(self, 't0wet', 'time scale for wet snow (15-21.9) [d]'))
-            string = "%s\n%s" % (string, fielddisplay(self, 't0dry', 'warm snow timescale (30) [d]'))
-            string = "%s\n%s" % (string, fielddisplay(self, 'K', 'time scale temperature coef. (7) [d]'))
-
-        string = "%s\n%s" % (string, fielddisplay(self, 'swIdx', 'apply all SW to top grid cell (0) or allow SW to penetrate surface (1) [default 1, with snow density (taken from Bassford, 2004)]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'denIdx', ['densification model to use (default is 2):',
-                                                                   '1 = emperical model of Herron and Langway (1980)',
-                                                                   '2 = semi-emperical model of Anthern et al. (2010)',
-                                                                   '3 = DO NOT USE: physical model from Appix B of Anthern et al. (2010)',
-                                                                   '4 = DO NOT USE: emperical model of Li and Zwally (2004)',
-                                                                   '5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',
-                                                                   '6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',
-                                                                   '7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)']))
-        string = "%s\n%s" % (string, fielddisplay(self, 'dsnowIdx', ['model for fresh snow accumulation density (default is 1):',
-                                                                     '0 = Original GEMB value, 150 kg/m^3',
-                                                                     '1 = Antarctica value of fresh snow density, 350 kg/m^3',
-                                                                     '2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2008)',
-                                                                     '3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',
-                                                                     '4 = Greenland model of Kuipers Munneke et al. (2015)']))
-        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        string = "%s\n\t\t%s" % (string, '0: Arithmetic (default)')
-        string = "%s\n\t\t%s" % (string, '1: Geometric')
-        string = "%s\n\t\t%s" % (string, '2: Harmonic')
-        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return string
+            s += '{}\n'.format(fielddisplay(self, 't0wet', 'time scale for wet snow (15-21.9) [d]'))
+            s += '{}\n'.format(fielddisplay(self, 't0dry', 'warm snow timescale (30) [d]'))
+            s += '{}\n'.format(fielddisplay(self, 'K', 'time scale temperature coef. (7) [d]'))
+
+        s += '{}\n'.format(fielddisplay(self, 'swIdx', 'apply all SW to top grid cell (0) or allow SW to penetrate surface (1) [default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)]'))
+        s += '{}\n'.format(fielddisplay(self, 'denIdx', ['densification model to use (default is 2):',
+            '1 = emperical model of Herron and Langway (1980)',
+            '2 = semi-emperical model of Anthern et al. (2010)',
+            '3 = DO NOT USE: physical model from Appix B of Anthern et al. (2010)',
+            '4 = DO NOT USE: emperical model of Li and Zwally (2004)',
+            '5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',
+            '6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',
+            '7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)']))
+        s += '{}\n'.format(fielddisplay(self, 'dsnowIdx', ['model for fresh snow accumulation density (default is 1):',
+            '0 = Original GEMB value, 150 kg/m^3',
+            '1 = Antarctica value of fresh snow density, 350 kg/m^3',
+            '2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)',
+            '3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',
+            '4 = Greenland model of Kuipers Munneke et al. (2015)']))
+
+        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
+        s += '\t\t{}\n'.format('0: Arithmetic (default)')
+        s += '\t\t{}\n'.format('1: Geometric')
+        s += '\t\t{}\n'.format('2: Harmonic')
+        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        return s
     #}}}
 
     def extrude(self, md):  # {{{
-        self.Ta = project3d(md, 'vector', self.Ta, 'type', 'node')
-        self.V = project3d(md, 'vector', self.V, 'type', 'node')
-        self.dswrf = project3d(md, 'vector', self.dswrf, 'type', 'node')
-        self.dswrf = project3d(md, 'vector', self.dswrf, 'type', 'node')
-        self.P = project3d(md, 'vector', self.P, 'type', 'node')
-        self.eAir = project3d(md, 'vector', self.eAir, 'type', 'node')
-        self.pAir = project3d(md, 'vector', self.pAir, 'type', 'node')
-
-        if (self.aIdx == 0) and np.isnan(self.aValue):
-            self.aValue = project3d(md, 'vector', self.aValue, 'type', 'node')
-        if np.isnan(self.teValue):
-            self.teValue = project3d(md, 'vector', self.teValue, 'type', 'node')
+        self.Ta = project3d(md, 'vector', self.Ta, 'type', 'element')
+        self.V = project3d(md, 'vector', self.V, 'type', 'element')
+        self.dswrf = project3d(md, 'vector', self.dswrf, 'type', 'element')
+        self.dslrf = project3d(md, 'vector', self.dslrf, 'type', 'element')
+        self.P = project3d(md, 'vector', self.P, 'type', 'element')
+        self.eAir = project3d(md, 'vector', self.eAir, 'type', 'element')
+        self.pAir = project3d(md, 'vector', self.pAir, 'type', 'element')
+
+        if not np.isnan(self.Dzini):
+            self.self.Dzini=project3d(md,'vector',self.self.Dzini,'type','element');
+        if not np.isnan(self.Dini):
+            self.self.Dini=project3d(md,'vector',self.Dini,'type','element');
+        if not np.isnan(self.Reini):
+            self.self.Reini=project3d(md,'vector',self.Reini,'type','element');
+        if not np.isnan(self.Gdnini):
+            self.Gdnini=project3d(md,'vector',self.Gdnini,'type','element');
+        if not np.isnan(self.Gspini):
+            self.Gspini=project3d(md,'vector',self.Gspini,'type','element');
+        if not np.isnan(self.ECini):
+            self.ECini=project3d(md,'vector',self.ECini,'type','element');
+        if not np.isnan(self.Wini):
+            self.Wini=project3d(md,'vector',self.Wini,'type','element');
+        if not np.isnan(self.Aini):
+            self.Aini=project3d(md,'vector',self.Aini,'type','element');
+        if not np.isnan(self.Adiffini):
+            self.Adiffini=project3d(md,'vector',self.Adiffini,'type','element');
+        if not np.isnan(self.Tini):
+            self.Tini=project3d(md,'vector',self.Tini,'type','element');
+
+        if not np.isnan(self.dswdiffrf):
+            self.dswdiffrf=project3d(md,'vector',self.dswdiffrf,'type','element');
+        if not np.isnan(self.szaValue):
+            self.szaValue=project3d(md,'vector',self.szaValue,'type','element');
+        if not np.isnan(self.cotValue):
+            self.cotValue=project3d(md,'vector',self.cotValue,'type','element');
+        if not np.isnan(self.ccsnowValue):
+            self.ccsnowValue=project3d(md,'vector',self.ccsnowValue,'type','element');
+        if not np.isnan(self.cciceValue):
+            self.cciceValue=project3d(md,'vector',self.cciceValue,'type','element');
+
+        if not np.isnan(self.aValue):
+            self.aValue = project3d(md, 'vector', self.aValue, 'type', 'element')
+        if not np.isnan(self.teValue):
+            self.teValue = project3d(md, 'vector', self.teValue, 'type', 'element')
 
         return self
@@ -248,10 +313,9 @@
 
     def defaultoutputs(self, md):  # {{{
-        return ['SmbMassBalance']
+        return ['SmbMassBalance','SmbAccumulatedMassBalance']
     #}}}
 
     def setdefaultparameters(self, mesh, geometry):  # {{{
         self.isgraingrowth = 1
-        self.issmbgradients = 0
         self.isalbedo = 1
         self.isshortwave = 1
@@ -261,13 +325,14 @@
         self.isdensification = 1
         self.isturbulentflux = 1
-        self.isclimatology = 0
         self.isconstrainsurfaceT = 0
+        self.isdeltaLWup = 0
 
         self.aIdx = 1
+        self.eIdx = 1
         self.swIdx = 1
         self.denIdx = 2
         self.dsnowIdx = 1
         self.zTop = 10 * np.ones((mesh.numberofelements,))
-        self.dzTop = .05 * np.ones((mesh.numberofelements,))
+        self.dzTop = 0.05 * np.ones((mesh.numberofelements,))
         self.dzMin = self.dzTop / 2
         self.InitDensityScaling = 1.0
@@ -281,5 +346,5 @@
         self.outputFreq = 30
 
-        #additional albedo parameters
+        # Additional albedo parameters
         self.aSnow = 0.85
         self.aIce = 0.48
@@ -289,7 +354,15 @@
         self.K = 7
         self.adThresh = 1023
+        self.teThresh = 10
 
         self.teValue = np.ones((mesh.numberofelements,))
         self.aValue = self.aSnow * np.ones(mesh.numberofelements,)
+        self.dulwrfValue = np.zeros((mesh.numberofelements,))
+
+        self.dswdiffrf = 0.0 * np.ones(mesh.numberofelements,)
+        self.szaValue = 0.0 * np.ones(mesh.numberofelements,)
+        self.cotValue = 0.0 * np.ones(mesh.numberofelements,)
+        self.ccsnowValue = 0.0 * np.ones(mesh.numberofelements,)
+        self.cciceValue = 0.0 * np.ones(mesh.numberofelements,)
 
         self.Dzini = 0.05 * np.ones((mesh.numberofelements, 2))
@@ -300,8 +373,13 @@
         self.ECini = 0.0 * np.ones((mesh.numberofelements,))
         self.Wini = 0.0 * np.ones((mesh.numberofelements, 2))
-        self.Aini = self.aSnow * np.ones((mesh.numberofelements, 2))
+        self.Aini = 0.0 * np.ones((mesh.numberofelements, 2))
+        self.Adiffini = np.ones((mesh.numberofelements, 2))
         self.Tini = 273.15 * np.ones((mesh.numberofelements, 2))
-#       /!\ Default value of Tini must be equal to Tmean but don't know Tmean yet (computed when atmospheric forcings are interpolated on mesh).
-#       If initialization without restart, this value will be overwritten when snow parameters are retrieved in Element.cpp
+        #       /!\ Default value of Tini must be equal to Tmean but don't know 
+        #           Tmean yet (computed when atmospheric forcings are 
+        #           interpolated on mesh).
+        #           If initialization without restart, this value will be 
+        #           overwritten when snow parameters are retrieved in 
+        #           Element.cpp
         self.Sizeini = 2 * np.ones((mesh.numberofelements,))
     #}}}
@@ -310,5 +388,4 @@
 
         md = checkfield(md, 'fieldname', 'smb.isgraingrowth', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'smb.issmbgradients', 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'smb.isalbedo', 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'smb.isshortwave', 'values', [0, 1])
@@ -318,5 +395,5 @@
         md = checkfield(md, 'fieldname', 'smb.isdensification', 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'smb.isturbulentflux', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'smb.isclimatology', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'smb.isdeltaLWup', 'values',[0, 1])
         md = checkfield(md, 'fieldname', 'smb.isconstrainsurfaceT', 'values', [0, 1])
 
@@ -324,18 +401,11 @@
         md = checkfield(md, 'fieldname', 'smb.V', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, '<', 45, 'size', np.shape(self.Ta))  #max 500 km/h
         md = checkfield(md, 'fieldname', 'smb.dswrf', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 1400, 'size', np.shape(self.Ta))
+        md = checkfield(md, 'fieldname', 'smb.dswdiffrf', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 1400)
         md = checkfield(md, 'fieldname', 'smb.dlwrf', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, 'size', np.shape(self.Ta))
         md = checkfield(md, 'fieldname', 'smb.P', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 200, 'size', np.shape(self.Ta))
         md = checkfield(md, 'fieldname', 'smb.eAir', 'timeseries', 1, 'NaN', 1, 'Inf', 1, 'size', np.shape(self.Ta))
 
-        if (self.isclimatology > 0):
-            md = checkfield(md, 'fieldname', 'smb.Ta', 'size', [md.mesh.numberofelements + 1], 'message', 'Ta must have md.mesh.numberofelements+1 rows in order to force a climatology')
-            md = checkfield(md, 'fieldname', 'smb.V', 'size', [md.mesh.numberofelements + 1], 'message', 'V must have md.mesh.numberofelements+1 rows in order to force a climatology')
-            md = checkfield(md, 'fieldname', 'smb.dswrf', 'size', [md.mesh.numberofelements + 1], 'message', 'dswrf must have md.mesh.numberofelements+1 rows in order to force a climatology')
-            md = checkfield(md, 'fieldname', 'smb.dlwrf', 'size', [md.mesh.numberofelements + 1], 'message', 'dlwrf must have md.mesh.numberofelements+1 rows in order to force a climatology')
-            md = checkfield(md, 'fieldname', 'smb.P', 'size', [md.mesh.numberofelements + 1], 'message', 'P must have md.mesh.numberofelements+1 rows in order to force a climatology')
-            md = checkfield(md, 'fieldname', 'smb.eAir', 'size', [md.mesh.numberofelements + 1], 'message', 'eAir must have md.mesh.numberofelements+1 rows in order to force a climatology')
-
         md = checkfield(md, 'fieldname', 'smb.Tmean', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '>', 273 - 100, '<', 273 + 100)  #-100/100 celsius min/max value
-        md = checkfield(md, 'fieldname', 'smb.C', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> = ', 0)
+        md = checkfield(md, 'fieldname', 'smb.C', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> ', 0)
         md = checkfield(md, 'fieldname', 'smb.Vmean', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> = ', 0)
         md = checkfield(md, 'fieldname', 'smb.Tz', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 5000)
@@ -343,6 +413,8 @@
 
         md = checkfield(md, 'fieldname', 'smb.teValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', 1)
+        md = checkfield(md, 'fieldname', 'smb.dulwrfValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
 
         md = checkfield(md, 'fieldname', 'smb.aIdx', 'NaN', 1, 'Inf', 1, 'values', [0, 1, 2, 3, 4])
+        md = checkfield(md, 'fieldname', 'smb.eIdx', 'NaN', 1, 'Inf', 1, 'values', [0, 1, 2])
         md = checkfield(md, 'fieldname', 'smb.swIdx', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'smb.denIdx', 'NaN', 1, 'Inf', 1, 'values', [1, 2, 3, 4, 5, 6, 7])
@@ -357,10 +429,15 @@
         md = checkfield(md, 'fieldname', 'smb.ThermoDeltaTScaling', 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 1)
         md = checkfield(md, 'fieldname', 'smb.adThresh', 'NaN', 1, 'Inf', 1, '>=', 0)
-
+        md = checkfield(md, 'fieldname', 'smb.teThresh', 'NaN', 1, 'Inf',1,'>=',0)
+        
+        md = checkfield(md, 'fieldname', 'smb.aValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', 1)
         if isinstance(self.aIdx, (list, type(np.array([1, 2])))) and (self.aIdx == [1, 2] or (1 in self.aIdx and 2 in self.aIdx)):
             md = checkfield(md, 'fieldname', 'smb.aSnow', 'NaN', 1, 'Inf', 1, '> = ', .64, '< = ', .89)
             md = checkfield(md, 'fieldname', 'smb.aIce', 'NaN', 1, 'Inf', 1, '> = ', .27, '< = ', .58)
-        elif self.aIdx == 0:
-            md = checkfield(md, 'fieldname', 'smb.aValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', 1)
+            if self.aIdx == 1:
+                md = checkfield(md,'fieldname','smb.szaValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',90)
+                md = checkfield(md,'fieldname','smb.cotValue','timeseries',1,'NaN',1,'Inf',1,'>=',0)
+                md = checkfield(md,'fieldname','smb.ccsnowValue','timeseries',1,'NaN',1,'Inf',1,'>=',0)
+                md = checkfield(md,'fieldname','smb.cciceValue','timeseries',1,'NaN',1,'Inf',1,'>=',0)
         elif self.aIdx == 3:
             md = checkfield(md, 'fieldname', 'smb.cldFrac', 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 1)
@@ -370,5 +447,5 @@
             md = checkfield(md, 'fieldname', 'smb.K', 'NaN', 1, 'Inf', 1, '> = ', 7, '< = ', 7)
 
-        #check zTop is < local thickness:
+        # Check zTop is < local thickness
         he = np.sum(md.geometry.thickness[md.mesh.elements - 1], axis=1) / np.size(md.mesh.elements, 1)
         if np.any(he < self.zTop):
@@ -386,5 +463,4 @@
 
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isgraingrowth', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'issmbgradients', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isalbedo', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isshortwave', 'format', 'Boolean')
@@ -394,9 +470,11 @@
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isdensification', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isturbulentflux', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isclimatology', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isconstrainsurfaceT', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isdeltaLWup','format','Boolean')
+
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Ta', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'V', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dswrf', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dswdiffrf', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dlwrf', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'P', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
@@ -417,4 +495,5 @@
 
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'aIdx', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'eIdx', 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'swIdx', 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'denIdx', 'format', 'Integer')
@@ -430,7 +509,13 @@
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'K', 'format', 'Double')
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'adThresh', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'teThresh', 'format', 'Double')
 
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'aValue', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'teValue', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+        WriteData(fid,prefix,'object',self,'class','smb','fieldname','dulwrfValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
+        WriteData(fid,prefix,'object',self,'class','smb','fieldname','szaValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
+        WriteData(fid,prefix,'object',self,'class','smb','fieldname','cotValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
+        WriteData(fid,prefix,'object',self,'class','smb','fieldname','ccsnowValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
+        WriteData(fid,prefix,'object',self,'class','smb','fieldname','cciceValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
 
         #snow properties init
@@ -443,13 +528,31 @@
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Wini', 'format', 'DoubleMat', 'mattype', 3)
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Aini', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Adiffini', 'format', 'DoubleMat', 'mattype', 3)
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tini', 'format', 'DoubleMat', 'mattype', 3)
         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Sizeini', 'format', 'IntMat', 'mattype', 2)
         WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
-        #figure out dt from forcings:
+        # Figure out dt from forcings
         if (np.any(self.P[-1] - self.Ta[-1] != 0) | np.any(self.V[-1] - self.Ta[-1] != 0) | np.any(self.dswrf[-1] - self.Ta[-1] != 0) | np.any(self.dlwrf[-1] - self.Ta[-1] != 0) | np.any(self.eAir[-1] - self.Ta[-1] != 0) | np.any(self.pAir[-1] - self.Ta[-1] != 0)):
             raise IOError('All GEMB forcings (Ta, P, V, dswrf, dlwrf, eAir, pAir) must have the same time steps in the final row!')
 
-        time = self.Ta[-1]  #assume all forcings are on the same time step
+        if ((np.ndim(self.teValue)>1) & np.any(self.teValue[-1] - self.Ta[-1] != 0)):
+            raise IOError('If GEMB forcing teValue is transient, it must have the same time steps as input Ta in the final row!')
+        if ((np.ndim(self.dswdiffrf)>1) & np.any(self.dswdiffrf[-1] - self.Ta[-1] != 0)):
+            raise IOError('If GEMB forcing dswdiffrf is transient, it must have the same time steps as input Ta in the final row!')
+        if ((np.ndim(self.aValue)>1) & np.any(self.aValue[-1] - self.Ta[-1] != 0)):
+            raise IOError('If GEMB forcing aValue is transient, it must have the same time steps as input Ta in the final row!')
+        if ((np.ndim(self.dulwrfValue)>1) & np.any(self.dulwrfValue[-1] - self.Ta[-1] != 0)):
+            raise IOError('If GEMB forcing dulwrfValue is transient, it must have the same time steps as input Ta in the final row!')
+        if ((np.ndim(self.szaValue)>1) & np.any(self.szaValue[-1] - self.Ta[-1] != 0)):
+            raise IOError('If GEMB forcing szaValue is transient, it must have the same time steps as input Ta in the final row!')
+        if ((np.ndim(self.cotValue)>1) & np.any(self.cotValue[-1] - self.Ta[-1] != 0)):
+            raise IOError('If GEMB forcing cotValue is transient, it must have the same time steps as input Ta in the final row!')
+        if ((np.ndim(self.ccsnowValue)>1) & np.any(self.ccsnowValue[-1] - self.Ta[-1] != 0)):
+            raise IOError('If GEMB forcing ccsnowValue is transient, it must have the same time steps as input Ta in the final row!')
+        if ((np.ndim(self.cciceValue)>1) & np.any(self.cciceValue[-1] - self.Ta[-1] != 0)):
+            raise IOError('If GEMB forcing cciceValue is transient, it must have the same time steps as input Ta in the final row!')
+
+        time = self.Ta[-1]  # Assume all forcings are on the same time step
         dtime = np.diff(time, n=1, axis=0)
         dt = min(dtime)
@@ -459,7 +562,7 @@
         # Check if smb_dt goes evenly into transient core time step
         if (md.timestepping.time_step % dt >= 1e-10):
-            raise IOError('smb_dt/dt = #f. The number of SMB time steps in one transient core time step has to be an an integer', md.timestepping.time_step / dt)
-
-        #process requested outputs
+            raise IOError('smb_dt/dt = {}. The number of SMB time steps in one transient core time step has to be an an integer'.format(md.timestepping.time_step / dt))
+
+        # Process requested outputs
         outputs = self.requested_outputs
         indices = [i for i, x in enumerate(outputs) if x == 'default']
Index: /issm/trunk/src/m/classes/SMBmeltcomponents.m
===================================================================
--- /issm/trunk/src/m/classes/SMBmeltcomponents.m	(revision 26743)
+++ /issm/trunk/src/m/classes/SMBmeltcomponents.m	(revision 26744)
@@ -6,12 +6,12 @@
 classdef SMBmeltcomponents
 	properties (SetAccess=public)
-		isclimatology = 0;
 		accumulation = NaN;
 		evaporation = NaN;
 		melt = NaN;
 		refreeze = NaN;
-		steps_per_step=1;
+		steps_per_step = 1;
 		averaging = 0;
-		requested_outputs      = {};
+		requested_outputs= {};
+		isclimatology;
 	end
 	methods
@@ -22,4 +22,17 @@
 					error('constructor not supported');
 			end
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   surface forcings parameters with melt (SMB=accumulation-evaporation-melt+refreeze) :'));
+			fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]');
+			fielddisplay(self,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
+			fielddisplay(self,'melt','amount of ice melt in ice column [m/yr ice eq]');
+			fielddisplay(self,'refreeze','amount of ice melt refrozen in ice column [m/yr ice eq]');
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
+			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
+			disp(sprintf('%51s  0: Arithmetic (default)',' '));
+			disp(sprintf('%51s  1: Geometric',' '));
+			disp(sprintf('%51s  2: Harmonic',' '));
+			fielddisplay(self,'requested_outputs','additional outputs requested');
 		end % }}}
 		function self = extrude(self,md) % {{{
@@ -71,29 +84,4 @@
 			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-			md = checkfield(md,'fieldname','smb.isclimatology','values',[0 1]);
-			if (self.isclimatology)
-				md = checkfield(md,'fieldname', 'smb.accumulation', 'size',[md.mesh.numberofvertices+1],...
-						'message',['accumulation must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
-				md = checkfield(md,'fieldname', 'smb.melt', 'size',[md.mesh.numberofvertices+1],...
-						'message',['melt must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
-				md = checkfield(md,'fieldname', 'smb.refreeze', 'size',[md.mesh.numberofvertices+1],...
-						'message',['refreeze must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
-				md = checkfield(md,'fieldname', 'smb.evaporation', 'size',[md.mesh.numberofvertices+1],...
-						'message',['evaporation must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
-			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters with melt (SMB=accumulation-evaporation-melt+refreeze) :'));
-			fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]');
-			fielddisplay(self,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
-			fielddisplay(self,'melt','amount of ice melt in ice column [m/yr ice eq]');
-			fielddisplay(self,'refreeze','amount of ice melt refrozen in ice column [m/yr ice eq]');
-			fielddisplay(self,'isclimatology','repeat all forcings when past last forcing time (default false)');
-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
-			disp(sprintf('%51s  1: Geometric',' '));
-			disp(sprintf('%51s  2: Harmonic',' '));
-			fielddisplay(self,'requested_outputs','additional outputs requested');
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -117,5 +105,4 @@
 			end
 			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isclimatology','format','Boolean');
 
 		end % }}}
Index: /issm/trunk/src/m/classes/SMBmeltcomponents.py
===================================================================
--- /issm/trunk/src/m/classes/SMBmeltcomponents.py	(revision 26743)
+++ /issm/trunk/src/m/classes/SMBmeltcomponents.py	(revision 26744)
@@ -1,4 +1,6 @@
+import numpy as np
+
+from checkfield import *
 from fielddisplay import fielddisplay
-from checkfield import *
 from project3d import *
 from WriteData import *
@@ -6,35 +8,39 @@
 
 class SMBmeltcomponents(object):
-    """
-    SMBmeltcomponents Class definition
+    """SMBMELTCOMPONENTS lass definition
 
-       Usage:
-          SMBmeltcomponents = SMBmeltcomponents();
+    Usage:
+        SMBmeltcomponents = SMBmeltcomponents();
     """
 
-    def __init__(self):  # {{{
-        self.accumulation = float('NaN')
-        self.runoff = float('NaN')
-        self.evaporation = float('NaN')
-        self.isclimatology = 0
+    def __init__(self, *args):  # {{{
+        self.accumulation = np.nan
+        self.evaporation = np.nan
+        self.melt = np.nan
+        self.refreeze = np.nan
         self.steps_per_step = 1
         self.averaging = 0
         self.requested_outputs = []
+        self.isclimatology = np.nan
+
+        if len(args) == 0:
+            pass
+        else:
+            error('constructor not supported')
     #}}}
 
     def __repr__(self):  # {{{
-        string = "   surface forcings parameters with melt (SMB = accumulation-evaporation-melt+refreeze) :"
-        string = "%s\n%s" % (string, fielddisplay(self, 'accumulation', 'accumulated snow [m/yr ice eq]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'evaporation', 'mount of ice lost to evaporative processes [m/yr ice eq]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'melt', 'amount of ice melt in the ice column [m/yr ice eq]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'refreeze', 'amount of ice melt refrozen in the ice column [m/yr ice eq]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'isclimatology', 'repeat all forcings when past last forcing time (default false)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
-        string = "%s\n\t\t%s" % (string, '0: Arithmetic (default)')
-        string = "%s\n\t\t%s" % (string, '1: Geometric')
-        string = "%s\n\t\t%s" % (string, '2: Harmonic')
-        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return string
+        s = '   surface forcings parameters with melt (SMB = accumulation-evaporation-melt+refreeze) :\n'
+        s += '{}\n'.format(fielddisplay(self, 'accumulation', 'accumulated snow [m/yr ice eq]'))
+        s += '{}\n'.format(fielddisplay(self, 'evaporation', 'mount of ice lost to evaporative processes [m/yr ice eq]'))
+        s += '{}\n'.format(fielddisplay(self, 'melt', 'amount of ice melt in the ice column [m/yr ice eq]'))
+        s += '{}\n'.format(fielddisplay(self, 'refreeze', 'amount of ice melt refrozen in the ice column [m/yr ice eq]'))
+        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
+        s += '\t\t{}\n'.format('0: Arithmetic (default)')
+        s += '\t\t{}\n'.format('1: Geometric')
+        s += '\t\t{}\n'.format('2: Harmonic')
+        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        return s
     #}}}
 
@@ -54,49 +60,48 @@
         if np.all(np.isnan(self.accumulation)):
             self.accumulation = np.zeros((md.mesh.numberofvertices))
-            print("      no SMB.accumulation specified: values set as zero")
+            print("      no smb.accumulation specified: values set as zero")
 
         if np.all(np.isnan(self.evaporation)):
             self.evaporation = np.zeros((md.mesh.numberofvertices))
-            print("      no SMB.evaporation specified: values set as zero")
+            print("      no smb.evaporation specified: values set as zero")
+
+        if np.all(np.isnan(self.refreeze)):
+            self.refreeze = np.zeros((md.mesh.numberofvertices))
+            print("      no smb.refreeze specified: values set as zero")
 
         if np.all(np.isnan(self.melt)):
             self.melt = np.zeros((md.mesh.numberofvertices))
-            print("      no SMB.melt specified: values set as zero")
-
-        if np.all(np.isnan(self.refreeze)):
-            self.refreeze = np.zeros((md.mesh.numberofvertices))
-            print("      no SMB.refreeze specified: values set as zero")
+            print("      no smb.melt specified: values set as zero")
 
         return self
     #}}}
 
-    def checkconsistency(self, md, solution, analyses):    # {{{
+    def checkconsistency(self, md, solution, analyses):  # {{{
         if 'MasstransportAnalysis' in analyses:
             md = checkfield(md, 'fieldname', 'smb.accumulation', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.evaporation', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.refreeze', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
             md = checkfield(md, 'fieldname', 'smb.melt', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.refreeze', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.evaporation', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
 
         if 'BalancethicknessAnalysis' in analyses:
             md = checkfield(md, 'fieldname', 'smb.accumulation', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.evaporation', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.refreeze', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
             md = checkfield(md, 'fieldname', 'smb.melt', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.refreeze', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'smb.evaporation', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
 
         md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
         md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
-        md = checkfield(md, 'fieldname', 'smb.isclimatology', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
         return md
     # }}}
-    def marshall(self, prefix, md, fid):    # {{{
+    def marshall(self, prefix, md, fid):  # {{{
 
         yts = md.constants.yts
 
         WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 3, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accumulation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'evaporation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'melt', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'refreeze', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accumulation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'evaporation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'melt', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'refreeze', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
         WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
@@ -109,10 +114,3 @@
             outputs = outputscopy
         WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isclimatology', 'format', 'Boolean')
-        if (self.isclimatology > 0):
-            md = checkfield(md, 'fieldname', 'smb.accumulation', 'size', [md.mesh.numberofvertices + 1], 'message', 'accumulation must have md.mesh.numberofvertices+1 rows in order to force a climatology')
-            md = checkfield(md, 'fieldname', 'smb.melt', 'size', [md.mesh.numberofvertices + 1], 'message', 'melt must have md.mesh.numberofvertices+1 rows in order to force a climatology')
-            md = checkfield(md, 'fieldname', 'smb.refreeze', 'size', [md.mesh.numberofvertices + 1], 'message', 'refreeze must have md.mesh.numberofvertices+1 rows in order to force a climatology')
-            md = checkfield(md, 'fieldname', 'smb.evaporation', 'size', [md.mesh.numberofvertices + 1], 'message', 'evaporation must have md.mesh.numberofvertices+1 rows in order to force a climatology')
-
     # }}}
Index: /issm/trunk/src/m/classes/additionalsolidearthsolution.m
===================================================================
--- /issm/trunk/src/m/classes/additionalsolidearthsolution.m	(revision 26744)
+++ /issm/trunk/src/m/classes/additionalsolidearthsolution.m	(revision 26744)
@@ -0,0 +1,43 @@
+%ADDITIONALSOLIDEARTHSOLUTION class definition
+%
+%   Usage:
+%      addsol=additionalsolidearthsolution();
+
+classdef additionalsolidearthsolution < solidearthsolution
+	properties (SetAccess=public) 
+	end
+	methods
+		function self = additionalsolidearthsolution(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+			self.setdefaultparameters@solidearthsolution();
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==0), 
+				error('additionalsolidearthsolution checkconsistency error message: need to run GRD solution if you are supplying a GRD additional pattern solution');
+			end
+			self.checkconsistency@solidearthsolution(md,solution,analyses);
+
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   external: additionalsolidearth solution:'));
+			self.disp@solidearthsolution();
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+			WriteData(fid,prefix,'data',1,'name','md.solidearth.external.nature','format','Integer'); %code 1 for additionalsolidearthsolution class
+			self.marshall@solidearthsolution(prefix,md,fid);
+		end % }}}
+		function savemodeljs(self,fid,modelname) % {{{
+			self.savemodeljs@solidearthsolution(fid,modelname);
+		end % }}}
+		function self = extrude(self,md) % {{{
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/amr.js
===================================================================
--- /issm/trunk/src/m/classes/amr.js	(revision 26743)
+++ /issm/trunk/src/m/classes/amr.js	(revision 26744)
@@ -7,10 +7,20 @@
 	//methods
 	this.setdefaultparameters = function(){// {{{
+
+		//hmin and hmax
 		this.hmin								= 100.;
 		this.hmax								= 100.e3;
+
+		//fields
 		this.fieldname							= "Vel";
 		this.err								= 3.;
+
+		//keep metric?
 		this.keepmetric							= 1;
+
+		//control of element lengths
 		this.gradation							= 1.5;
+
+		//other criterias
 		this.groundingline_resolution			= 500.;
 		this.groundingline_distance				= 0;
@@ -25,4 +35,7 @@
 		this.deviatoricerror_groupthreshold		= 0;	
 		this.deviatoricerror_maximum			= 0;	
+
+		//is restart? This calls femmodel->ReMesh() before first time step. 
+		this.restart							= 0;
 	}// }}}
 	this.disp= function(){// {{{
@@ -45,4 +58,6 @@
 		fielddisplay(this,'deviatoricerror_groupthreshold','maximum group threshold deviatoricstress error permitted');
 		fielddisplay(this,'deviatoricerror_maximum','maximum deviatoricstress error permitted');
+		fielddisplay(this,'deviatoricerror_maximum','maximum deviatoricstress error permitted');
+		fielddisplay(this,'restart','indicates if ReMesh() will call before first time step');
 	}// }}}
 	this.classname= function(){// {{{
@@ -67,4 +82,5 @@
 		checkfield(md,'fieldname','amr.deviatoricerror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1);
 		checkfield(md,'fieldname','amr.deviatoricerror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1);
+		checkfield(md,'fieldname','amr.restart','numel',[1],'>=',0,'<=',1,'NaN',1);
 	} // }}}
 	this.marshall=function(md,prefix,fid) { //{{{
@@ -88,4 +104,5 @@
 		WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_groupthreshold','format','Double');
 		WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_maximum','format','Double');
+		WriteData(fid,prefix,'object',this,'fieldname','restart','format','Integer');
 	}//}}}
 	this.fix=function() { //{{{
@@ -111,4 +128,5 @@
 	this.deviatoricerror_groupthreshold		= 0.;
 	this.deviatoricerror_maximum			= 0.;
+	this.restart							= 0.;
 
 	this.setdefaultparameters();
Index: /issm/trunk/src/m/classes/amr.m
===================================================================
--- /issm/trunk/src/m/classes/amr.m	(revision 26743)
+++ /issm/trunk/src/m/classes/amr.m	(revision 26744)
@@ -84,5 +84,5 @@
 			self.gradation=1.5;
 
-			%other criterias
+			%other criteria
 			self.groundingline_resolution=500.;
 			self.groundingline_distance=0.;
Index: /issm/trunk/src/m/classes/amr.py
===================================================================
--- /issm/trunk/src/m/classes/amr.py	(revision 26743)
+++ /issm/trunk/src/m/classes/amr.py	(revision 26744)
@@ -5,6 +5,5 @@
 
 class amr(object):
-    """
-    AMR Class definition
+    """AMR Class definition
 
     Usage:
@@ -12,75 +11,85 @@
     """
 
-    def __init__(self):  # {{{
-        self.hmin = 0.
-        self.hmax = 0.
+    def __init__(self): #{{{
+        self.hmin = 0
+        self.hmax = 0
         self.fieldname = ''
-        self.err = 0.
-        self.keepmetric = 0.
-        self.gradation = 0.
-        self.groundingline_resolution = 0.
-        self.groundingline_distance = 0.
-        self.icefront_resolution = 0.
-        self.icefront_distance = 0.
-        self.thicknesserror_resolution = 0.
-        self.thicknesserror_threshold = 0.
-        self.thicknesserror_groupthreshold = 0.
-        self.thicknesserror_maximum = 0.
-        self.deviatoricerror_resolution = 0.
-        self.deviatoricerror_threshold = 0.
-        self.deviatoricerror_groupthreshold = 0.
-        self.deviatoricerror_maximum = 0.
-        self.restart = 0.
-    #set defaults
+        self.err = 0
+        self.keepmetric = 0
+        self.gradation = 0
+        self.groundingline_resolution = 0
+        self.groundingline_distance = 0
+        self.icefront_resolution = 0
+        self.icefront_distance = 0
+        self.thicknesserror_resolution = 0
+        self.thicknesserror_threshold = 0
+        self.thicknesserror_groupthreshold = 0
+        self.thicknesserror_maximum = 0
+        self.deviatoricerror_resolution = 0
+        self.deviatoricerror_threshold = 0
+        self.deviatoricerror_groupthreshold = 0
+        self.deviatoricerror_maximum = 0
+        self.restart = 0
+
         self.setdefaultparameters()
     #}}}
 
-    def __repr__(self):  # {{{
-        string = "   amr parameters:"
-        string = "%s\n%s" % (string, fielddisplay(self, "hmin", "minimum element length"))
-        string = "%s\n%s" % (string, fielddisplay(self, "hmax", "maximum element length"))
-        string = "%s\n%s" % (string, fielddisplay(self, "fieldname", "name of input that will be used to compute the metric (should be an input of FemModel)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "keepmetric", "indicates whether the metric should be kept every remeshing time"))
-        string = "%s\n%s" % (string, fielddisplay(self, "gradation", "maximum ratio between two adjacent edges"))
-        string = "%s\n%s" % (string, fielddisplay(self, "groundingline_resolution", "element length near the grounding line"))
-        string = "%s\n%s" % (string, fielddisplay(self, "groundingline_distance", "distance around the grounding line which elements will be refined"))
-        string = "%s\n%s" % (string, fielddisplay(self, "icefront_resolution", "element length near the ice front"))
-        string = "%s\n%s" % (string, fielddisplay(self, "icefront_distance", "distance around the ice front which elements will be refined"))
-        string = "%s\n%s" % (string, fielddisplay(self, "thicknesserror_resolution", "element length when thickness error estimator is used"))
-        string = "%s\n%s" % (string, fielddisplay(self, "thicknesserror_threshold", "maximum threshold thickness error permitted"))
-        string = "%s\n%s" % (string, fielddisplay(self, "thicknesserror_groupthreshold", "maximum group threshold thickness error permitted"))
-        string = "%s\n%s" % (string, fielddisplay(self, "thicknesserror_maximum", "maximum thickness error permitted"))
-        string = "%s\n%s" % (string, fielddisplay(self, "deviatoricerror_resolution", "element length when deviatoric stress error estimator is used"))
-        string = "%s\n%s" % (string, fielddisplay(self, "deviatoricerror_threshold", "maximum threshold deviatoricstress error permitted"))
-        string = "%s\n%s" % (string, fielddisplay(self, "deviatoricerror_groupthreshold", "maximum group threshold deviatoric stress error permitted"))
-        string = "%s\n%s" % (string, fielddisplay(self, "deviatoricerror_maximum", "maximum deviatoricstress error permitted"))
-        string = "%s\n%s" % (string, fielddisplay(self, "restart", "indicates if ReMesh() will call before first time step"))
-        return string
+    def __repr__(self): #{{{
+        s = '   amr parameters:\n'
+        s += '{}\n'.format(fielddisplay(self, 'hmin', 'minimum element length'))
+        s += '{}\n'.format(fielddisplay(self, 'hmax', 'maximum element length'))
+        s += '{}\n'.format(fielddisplay(self, 'fieldname', 'name of input that will be used to compute the metric (should be an input of FemModel)'))
+        s += '{}\n'.format(fielddisplay(self, 'keepmetric', 'indicates whether the metric should be kept every remeshing time'))
+        s += '{}\n'.format(fielddisplay(self, 'gradation', 'maximum ratio between two adjacent edges'))
+        s += '{}\n'.format(fielddisplay(self, 'groundingline_resolution', 'element length near the grounding line'))
+        s += '{}\n'.format(fielddisplay(self, 'groundingline_distance', 'distance around the grounding line which elements will be refined'))
+        s += '{}\n'.format(fielddisplay(self, 'icefront_resolution', 'element length near the ice front'))
+        s += '{}\n'.format(fielddisplay(self, 'icefront_distance', 'distance around the ice front which elements will be refined'))
+        s += '{}\n'.format(fielddisplay(self, 'thicknesserror_resolution', 'element length when thickness error estimator is used'))
+        s += '{}\n'.format(fielddisplay(self, 'thicknesserror_threshold', 'maximum threshold thickness error permitted'))
+        s += '{}\n'.format(fielddisplay(self, 'thicknesserror_groupthreshold', 'maximum group threshold thickness error permitted'))
+        s += '{}\n'.format(fielddisplay(self, 'thicknesserror_maximum', 'maximum thickness error permitted'))
+        s += '{}\n'.format(fielddisplay(self, 'deviatoricerror_resolution', 'element length when deviatoric stress error estimator is used'))
+        s += '{}\n'.format(fielddisplay(self, 'deviatoricerror_threshold', 'maximum threshold deviatoricstress error permitted'))
+        s += '{}\n'.format(fielddisplay(self, 'deviatoricerror_groupthreshold', 'maximum group threshold deviatoric stress error permitted'))
+        s += '{}\n'.format(fielddisplay(self, 'deviatoricerror_maximum', 'maximum deviatoricstress error permitted'))
+        s += '{}\n'.format(fielddisplay(self, 'restart', 'indicates if ReMesh() will call before first time step'))
+        return s
     #}}}
 
-    def setdefaultparameters(self):  # {{{
-        self.hmin = 100.
-        self.hmax = 100.e3
+    def setdefaultparameters(self): #{{{
+        self.hmin = 100
+        self.hmax = 100e3
+
+        # Fields
         self.fieldname = 'Vel'
-        self.err = 3.
+        self.err = 3
+
+        # Keep metric?
         self.keepmetric = 1
+
+        # Control of element lengths
         self.gradation = 1.5
-        self.groundingline_resolution = 500.
+
+        # Other criteria
+        self.groundingline_resolution = 500
         self.groundingline_distance = 0
-        self.icefront_resolution = 500.
+        self.icefront_resolution = 500
         self.icefront_distance = 0
-        self.thicknesserror_resolution = 500.
+        self.thicknesserror_resolution = 500
         self.thicknesserror_threshold = 0
         self.thicknesserror_groupthreshold = 0
         self.thicknesserror_maximum = 0
-        self.deviatoricerror_resolution = 500.
+        self.deviatoricerror_resolution = 500
         self.deviatoricerror_threshold = 0
         self.deviatoricerror_groupthreshold = 0
         self.deviatoricerror_maximum = 0
-        self.restart = 0.
+
+        # Is restart? This calls femmodel->ReMesh() before first time step.
+        self.restart = 0
         return self
     #}}}
 
-    def checkconsistency(self, md, solution, analyses):  # {{{
+    def checkconsistency(self, md, solution, analyses): #{{{
         md = checkfield(md, 'fieldname', 'amr.hmax', 'numel', [1], '>', 0, 'NaN', 1)
         md = checkfield(md, 'fieldname', 'amr.hmin', 'numel', [1], '>', 0, '<', self.hmax, 'NaN', 1)
@@ -101,7 +110,7 @@
         md = checkfield(md, 'fieldname', 'amr.restart', 'numel', [1], '>=', 0, '<=', 1, 'NaN', 1)
         return md
-    # }}}
+   # }}}
 
-    def marshall(self, prefix, md, fid):  # {{{
+    def marshall(self, prefix, md, fid): #{{{
         WriteData(fid, prefix, 'name', 'md.amr.type', 'data', 1, 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'hmin', 'format', 'Double')
@@ -124,3 +133,3 @@
         WriteData(fid, prefix, 'object', self, 'fieldname', 'deviatoricerror_maximum', 'format', 'Double')
         WriteData(fid, prefix, 'object', self, 'class', 'amr', 'fieldname', 'restart', 'format', 'Integer')
-    # }}}
+    #}}}
Index: /issm/trunk/src/m/classes/balancethickness.js
===================================================================
--- /issm/trunk/src/m/classes/balancethickness.js	(revision 26743)
+++ /issm/trunk/src/m/classes/balancethickness.js	(revision 26744)
@@ -40,4 +40,7 @@
 			WriteData(fid,prefix,'object',this,'fieldname','thickening_rate','format','DoubleMat','mattype',1,'scale',1/yts);
 			WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer');
+
+			WriteData(fid,prefix,'object',this,'fieldname','slopex','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',this,'fieldname','slopey','format','DoubleMat','mattype',1);
 			WriteData(fid,prefix,'object',this,'fieldname','omega','format','DoubleMat','mattype',1);
 
@@ -53,5 +56,8 @@
 	this.thickening_rate   = NaN;
 	this.stabilization     = 0;
+
 	this.omega             = NaN;
+	this.slopex            = NaN;
+	this.slopey            = NaN;
 	this.setdefaultparameters();
 	//}}}
Index: /issm/trunk/src/m/classes/basalforcings.m
===================================================================
--- /issm/trunk/src/m/classes/basalforcings.m	(revision 26743)
+++ /issm/trunk/src/m/classes/basalforcings.m	(revision 26744)
@@ -11,9 +11,4 @@
 	end
 	methods
-		function self = extrude(self,md) % {{{
-			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1); 
-			self.floatingice_melting_rate=project3d(md,'vector',self.floatingice_melting_rate,'type','node','layer',1); 
-			self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','node','layer',1); %bedrock only gets geothermal flux
-		end % }}}
 		function self = basalforcings(varargin) % {{{
 			switch nargin
@@ -23,4 +18,17 @@
 					error('constructor not supported');
 			end
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   basal forcings parameters:'));
+
+			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
+			fielddisplay(self,'floatingice_melting_rate','basal melting rate (positive if melting) [m/yr]');
+			fielddisplay(self,'geothermalflux','geothermal heat flux [W/m^2]');
+
+		end % }}}
+		function self = extrude(self,md) % {{{
+			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1); 
+			self.floatingice_melting_rate=project3d(md,'vector',self.floatingice_melting_rate,'type','node','layer',1); 
+			self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','node','layer',1); %bedrock only gets geothermal flux
 		end % }}}
 		function self = initialize(self,md) % {{{
@@ -56,12 +64,4 @@
 			end
 		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   basal forcings parameters:'));
-
-			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
-			fielddisplay(self,'floatingice_melting_rate','basal melting rate (positive if melting) [m/yr]');
-			fielddisplay(self,'geothermalflux','geothermal heat flux [W/m^2]');
-
-		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
 
@@ -69,7 +69,7 @@
 
 			WriteData(fid,prefix,'name','md.basalforcings.model','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts)
+			WriteData(fid,prefix,'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts)
+			WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
Index: /issm/trunk/src/m/classes/basalforcings.py
===================================================================
--- /issm/trunk/src/m/classes/basalforcings.py	(revision 26743)
+++ /issm/trunk/src/m/classes/basalforcings.py	(revision 26744)
@@ -21,13 +21,11 @@
         self.setdefaultparameters()
     #}}}
-
     def __repr__(self):  # {{{
         s = '   basal forcings parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, "groundedice_melting_rate", "basal melting rate (positive if melting) [m / yr]"))
-        s += '{}\n'.format(fielddisplay(self, "floatingice_melting_rate", "basal melting rate (positive if melting) [m / yr]"))
-        s += '{}\n'.format(fielddisplay(self, "geothermalflux", "geothermal heat flux [W / m^2]"))
+        s += '{}\n'.format(fielddisplay(self, 'groundedice_melting_rate', 'basal melting rate (positive if melting) [m/yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'floatingice_melting_rate', 'basal melting rate (positive if melting) [m/yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'geothermalflux', 'geothermal heat flux [W/m^2]'))
         return s
     #}}}
-
     def extrude(self, md):  # {{{
         self.groundedice_melting_rate = project3d(md, 'vector', self.groundedice_melting_rate, 'type', 'node', 'layer', 1)
@@ -36,19 +34,16 @@
         return self
     #}}}
-
     def initialize(self, md):  # {{{
         if np.all(np.isnan(self.groundedice_melting_rate)):
             self.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
-            print("      no basalforcings.groundedice_melting_rate specified: values set as zero")
+            print('      no basalforcings.groundedice_melting_rate specified: values set as zero')
         if np.all(np.isnan(self.floatingice_melting_rate)):
             self.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
-            print("      no basalforcings.floatingice_melting_rate specified: values set as zero")
+            print('      no basalforcings.floatingice_melting_rate specified: values set as zero')
         return self
     #}}}
-
     def setdefaultparameters(self):  # {{{
         return self
     #}}}
-
     def checkconsistency(self, md, solution, analyses):  # {{{
         if 'MasstransportAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.ismasstransport:
@@ -64,10 +59,9 @@
         return md
     # }}}
-
     def marshall(self, prefix, md, fid):  # {{{
         yts = md.constants.yts
         WriteData(fid, prefix, 'name', 'md.basalforcings.model', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'floatingice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'geothermalflux', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'floatingice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'geothermalflux', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
     # }}}
Index: /issm/trunk/src/m/classes/basalforcingsismip6.m
===================================================================
--- /issm/trunk/src/m/classes/basalforcingsismip6.m	(revision 26743)
+++ /issm/trunk/src/m/classes/basalforcingsismip6.m	(revision 26744)
@@ -59,5 +59,5 @@
 			md = checkfield(md,'fieldname','basalforcings.gamma_0','numel',1,'NaN',1,'Inf',1,'>',0);
 			md = checkfield(md,'fieldname','basalforcings.tf_depths','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','basalforcings.delta_t','NaN',1,'Inf',1,'numel',md.basalforcings.num_basins);
+			md = checkfield(md,'fieldname','basalforcings.delta_t','NaN',1,'Inf',1,'numel',md.basalforcings.num_basins,'size',[1,md.basalforcings.num_basins]);
 			md = checkfield(md,'fieldname','basalforcings.islocal','values',[0 1]);
 			md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'>=',0,'timeseries',1);
Index: /issm/trunk/src/m/classes/calving.js
===================================================================
--- /issm/trunk/src/m/classes/calving.js	(revision 26743)
+++ /issm/trunk/src/m/classes/calving.js	(revision 26744)
@@ -35,4 +35,5 @@
 		this.fix=function() { //{{{
 			this.calvingrate=NullFix(this.calvingrate,NaN);
+			this.meltingrate=NullFix(this.meltingrate,NaN);
 		}//}}}
 	//properties 
Index: /issm/trunk/src/m/classes/calving.py
===================================================================
--- /issm/trunk/src/m/classes/calving.py	(revision 26743)
+++ /issm/trunk/src/m/classes/calving.py	(revision 26744)
@@ -16,20 +16,19 @@
     def __init__(self):  # {{{
         self.calvingrate = np.nan
-        self.setdefaultparameters()
-
+        #self.setdefaultparameters() # Uncomment if/when setdefaultparameters is used
     #}}}
 
     def __repr__(self):  # {{{
         s = '   Calving parameters:'
-        s += '{}\n'.format(fielddisplay(self, 'calvingrate', 'calving rate at given location [m / a]'))
+        s += '{}\n'.format(fielddisplay(self, 'calvingrate', 'calving rate at given location [m/a]'))
         return s
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        return self
     #}}}
 
     def extrude(self, md):  # {{{
         self.calvingrate = project3d(md, 'vector', self.calvingrate, 'type', 'node')
-        return self
-    #}}}
-
-    def setdefaultparameters(self):  # {{{
         return self
     #}}}
Index: /issm/trunk/src/m/classes/calvingcrevassedepth.m
===================================================================
--- /issm/trunk/src/m/classes/calvingcrevassedepth.m	(revision 26743)
+++ /issm/trunk/src/m/classes/calvingcrevassedepth.m	(revision 26744)
@@ -6,5 +6,6 @@
 classdef calvingcrevassedepth
 	properties (SetAccess=public) 
-		crevasse_opening_stress=1.;
+		crevasse_opening_stress=1;
+		crevasse_threshold     =1.;
 		water_height = 0.;
 	end
@@ -32,6 +33,7 @@
 		function self = setdefaultparameters(self) % {{{
 			
-			self.water_height = 0.;
-			crevasse_opening_stress=1.;
+			crevasse_threshold      = 1.;
+			crevasse_opening_stress = 1;
+         self.water_height       = 0.;
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
@@ -40,4 +42,5 @@
 
 			md = checkfield(md,'fieldname','calving.crevasse_opening_stress','numel',[1],'values',[0,1]);
+         md = checkfield(md,'fieldname','calving.crevasse_threshold','numel',[1],'>',0,'<=',1);
 			md = checkfield(md,'fieldname','calving.water_height','NaN',1,'Inf',1,'timeseries',1,'>=',0);
 		end % }}}
@@ -45,4 +48,5 @@
 			disp(sprintf('   Calving Pi parameters:'));
 			fielddisplay(self,'crevasse_opening_stress','0: stress only in the ice-flow direction, 1: max principal');
+			fielddisplay(self,'crevasse_threshold','ratio of full thickness to calve (e.g. 0.75 is for 75% of the total ice thickness)');
 			fielddisplay(self,'water_height','water height in the crevasse [m]');
 
@@ -52,4 +56,5 @@
 			WriteData(fid,prefix,'name','md.calving.law','data',6,'format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','crevasse_opening_stress','format','Integer');
+         WriteData(fid,prefix,'object',self,'fieldname','crevasse_threshold','format','Double');
 			WriteData(fid,prefix,'object',self,'fieldname','water_height','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 		end % }}}
Index: /issm/trunk/src/m/classes/calvingcrevassedepth.py
===================================================================
--- /issm/trunk/src/m/classes/calvingcrevassedepth.py	(revision 26744)
+++ /issm/trunk/src/m/classes/calvingcrevassedepth.py	(revision 26744)
@@ -0,0 +1,51 @@
+from checkfield import checkfield
+from fielddisplay import fielddisplay
+#from project3d import project3d # Uncomment if/when extrude is implemented
+from WriteData import WriteData
+
+
+class calvingcrevassedepth(object):
+    """CALVINCREVASSEDEPTH class definition
+
+    Usage:
+        calvingcrevassedepth = calvingcrevassedepth()
+    """
+
+    def __init__(self):  # {{{
+        self.crevasse_opening_stress = 1
+        self.crevasse_threshold      = 1.
+        self.water_height            = 0.
+
+        #self.setdefaultparameters() # Uncomment if/when setdefaultparameters is used
+    #}}}
+    def __repr__(self):  # {{{
+        s = '   Calving Pi parameters:'
+        s += '{}\n'.format(fielddisplay(self, 'crevasse_opening_stress', '0: stress only in the ice-flow direction, 1: max principal'))
+        s += '{}\n'.format(fielddisplay(self, 'crevasse_threshold', 'ratio of full thickness to calve (e.g. 0.75 is for 75% of the total ice thickness)'))
+        s += '{}\n'.format(fielddisplay(self, 'water_height', 'water height in the crevasse [m]'))
+        return s
+    #}}}
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
+    def extrude(self, md):  # {{{
+        return self
+    #}}}
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if solution != 'TransientSolution' or not md.transient.ismovingfront:
+            return md
+
+        md = checkfield(md, 'fieldname', 'calving.crevasse_opening_stress', 'numel', [1], 'values', [0,1])
+        md = checkfield(md, 'fieldname', 'calving.crevasse_threshold', 'numel', [1], '>', 0., '<=', 1.)
+        md = checkfield(md, 'fieldname', 'calving.water_height', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0) 
+
+        return md
+    # }}}
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+        WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 6, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'crevasse_opening_stress', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'crevasse_threshold', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'water_height', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+    # }}}
Index: /issm/trunk/src/m/classes/calvingdev2.m
===================================================================
--- /issm/trunk/src/m/classes/calvingdev2.m	(revision 26743)
+++ /issm/trunk/src/m/classes/calvingdev2.m	(revision 26744)
@@ -42,6 +42,6 @@
 			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
 
-			md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'nan',1,'Inf',1);
-			md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'nan',1,'Inf',1);
+			md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'NaN',1,'Inf',1);
 			md = checkfield(md,'fieldname','calving.height_above_floatation','<=',0);
 		end % }}}
Index: /issm/trunk/src/m/classes/calvingvonmises.m
===================================================================
--- /issm/trunk/src/m/classes/calvingvonmises.m	(revision 26743)
+++ /issm/trunk/src/m/classes/calvingvonmises.m	(revision 26744)
@@ -44,6 +44,6 @@
 			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
 
-			md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'nan',1,'Inf',1);
-			md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'nan',1,'Inf',1);
+			md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'NaN',1,'Inf',1);
 			md = checkfield(md,'fieldname','calving.min_thickness','>=',0,'NaN',1,'Inf',1,'numel',1);
 		end % }}}
Index: /issm/trunk/src/m/classes/calvingvonmises.py
===================================================================
--- /issm/trunk/src/m/classes/calvingvonmises.py	(revision 26743)
+++ /issm/trunk/src/m/classes/calvingvonmises.py	(revision 26744)
@@ -1,20 +1,18 @@
+from checkfield import checkfield
 from fielddisplay import fielddisplay
-from checkfield import checkfield
 from WriteData import WriteData
 
 
 class calvingvonmises(object):
-    """
-    CALVINGVONMISES class definition
+    """CALVINGVONMISES class definition
 
-       Usage:
-          calvingvonmises = calvingvonmises()
+    Usage:
+        calvingvonmises = calvingvonmises()
     """
 
     def __init__(self):  # {{{
-
-        self.stress_threshold_groundedice = 0.
-        self.stress_threshold_floatingice = 0.
-        self.min_thickness = 0.
+        self.stress_threshold_groundedice = 0
+        self.stress_threshold_floatingice = 0
+        self.min_thickness = 0
 
     #set defaults
@@ -24,10 +22,9 @@
 
     def __repr__(self):  # {{{
-        string = '   Calving VonMises parameters:'
-        string = "%s\n%s" % (string, fielddisplay(self, 'stress_threshold_groundedice', 'sigma_max applied to grounded ice only [Pa]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'stress_threshold_floatingice', 'sigma_max applied to floating ice only [Pa]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'min_thickness', 'minimum thickness below which no ice is allowed [m]'))
-
-        return string
+        s = '   Calving VonMises parameters:\n'
+        s += '{}\n'.format(fielddisplay(self, 'stress_threshold_groundedice', 'sigma_max applied to grounded ice only [Pa]'))
+        s += '{}\n'.format(fielddisplay(self, 'stress_threshold_floatingice', 'sigma_max applied to floating ice only [Pa]'))
+        s += '{}\n'.format(fielddisplay(self, 'min_thickness', 'minimum thickness below which no ice is allowed [m]'))
+        return s
     #}}}
 
@@ -37,9 +34,9 @@
 
     def setdefaultparameters(self):  # {{{
-        #Default sigma max
+        # Default sigma max
         self.stress_threshold_groundedice = 1e6
         self.stress_threshold_floatingice = 150e3
 
-        #turn off min_thickness by default.
+        # Turn off min_thickness by default
         self.min_thickness = 0.
         return self
@@ -47,6 +44,6 @@
 
     def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
-        if solution == 'TransientSolution' or md.transient.ismovingfront == 0:
+        # Early return
+        if solution == 'TransientSolution' or not md.transient.ismovingfront:
             return
 
Index: /issm/trunk/src/m/classes/cflevelsetmisfit.m
===================================================================
--- /issm/trunk/src/m/classes/cflevelsetmisfit.m	(revision 26744)
+++ /issm/trunk/src/m/classes/cflevelsetmisfit.m	(revision 26744)
@@ -0,0 +1,103 @@
+%MISFIT class definition
+%
+%   Usage:
+%      cflevelsetmisfit=cflevelsetmisfit();
+%      cflevelsetmisfit=cflevelsetmisfit('name','CalvingFrontPosition',...
+%                    'definitionstring','Outputdefinition1',... 
+%							'model_string','MaskIceLevelset',...
+%                    'observation_string','LevelsetObservations',...
+%                    'observation',md.mask.ice_levelset,...
+%                    'weights',ones(md.mesh.numberofvertices,1),...
+%                    'weights_string','WeightsLevelsetObservations',...
+%							'datatime',time);
+%
+%
+
+classdef cflevelsetmisfit
+	properties (SetAccess=public)
+		%cflevelsetmisfit
+		name               = '';
+		definitionstring   = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-100]'
+		model_string       = ''; %string for field that is modeled
+		observation        = NaN; %observed field that we compare the model against
+		observation_string = ''; %string for observed field.
+		weights            = NaN; %weight coefficients for every vertex
+		weights_string     = ''; %string to identify this particular set of weights
+		datatime				 = 0; %time in years from start that the data is from 
+		cumulated          = NaN; %do we cumulate cflevelsetmisfit through time?
+	end
+	
+	methods
+		function self = extrude(self,md) % {{{
+			if ~isnan(self.weights)
+				self.weights=project3d(md,'vector',self.weights,'type','node');
+			end
+			if ~isnan(self.observation)
+				self.observation=project3d(md,'vector',self.observation,'type','node');
+			end
+		end % }}}
+		function self = cflevelsetmisfit(varargin) % {{{
+			if nargin==0,
+				self=setdefaultparameters(self);
+			else
+				%use provided options to change fields
+				options=pairoptions(varargin{:});
+
+				%get name
+				self.name=getfieldvalue(options,'name','');
+				self.definitionstring=getfieldvalue(options,'definitionstring');
+				self.model_string=getfieldvalue(options,'model_string');
+				self.observation=getfieldvalue(options,'observation',NaN);
+				self.observation_string=getfieldvalue(options,'observation_string');
+				self.weights=getfieldvalue(options,'weights',NaN);
+				self.weights_string=getfieldvalue(options,'weights_string','');
+				self.datatime = getfieldvalue(options, 'datatime');
+
+			end
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+			self.datatime = 0;
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			if ~ischar(self.name),
+				error('cflevelsetmisfit error message: ''name'' field should be a string!');
+			end
+			OutputdefinitionStringArray={};
+			for i=1:100
+				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
+			end
+			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
+
+			md = checkfield(md,'fieldname','self.observation','field',self.observation,'timeseries',1,'NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','self.weights','field',self.weights,'timeseries',1,'NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','self.datatime','field',self.datatime,'<=',md.timestepping.final_time);
+
+		end % }}}
+		function md = disp(self) % {{{
+		
+			disp(sprintf('   TimeMisfit:\n'));
+
+			fielddisplay(self,'name','identifier for this cflevelsetmisfit response');
+			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-10]''');
+			fielddisplay(self,'model_string','string for field that is modeled');
+			fielddisplay(self,'observation','observed field that we compare the model against');
+			fielddisplay(self,'observation_string','observation string');
+			fielddisplay(self,'weights','weights (at vertices) to apply to the cflevelsetmisfit');
+			fielddisplay(self,'weights_string','string for weights for identification purposes');
+			fielddisplay(self,'datatime','time to compare data to model for misfit');
+
+		end % }}}
+		function md = marshall(self,prefix,md,fid) % {{{
+
+		WriteData(fid,prefix,'data',self.name,'name','md.cflevelsetmisfit.name','format','String');
+		WriteData(fid,prefix,'data',self.definitionstring,'name','md.cflevelsetmisfit.definitionstring','format','String');
+		WriteData(fid,prefix,'data',self.model_string,'name','md.cflevelsetmisfit.model_string','format','String');
+		WriteData(fid,prefix,'data',self.observation,'name','md.cflevelsetmisfit.observation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+		WriteData(fid,prefix,'data',self.observation_string,'name','md.cflevelsetmisfit.observation_string','format','String');
+		WriteData(fid,prefix,'data',self.weights,'name','md.cflevelsetmisfit.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+		WriteData(fid,prefix,'data',self.weights_string,'name','md.cflevelsetmisfit.weights_string','format','String');
+		WriteData(fid,prefix,'data',round(self.datatime*md.constants.yts),'name','md.cflevelsetmisfit.datatime','format','Double');
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/cfsurfacelogvel.m
===================================================================
--- /issm/trunk/src/m/classes/cfsurfacelogvel.m	(revision 26743)
+++ /issm/trunk/src/m/classes/cfsurfacelogvel.m	(revision 26744)
@@ -101,5 +101,5 @@
 		WriteData(fid,prefix,'data',self.weights,'name','md.cfsurfacelogvel.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 		WriteData(fid,prefix,'data',self.weights_string,'name','md.cfsurfacelogvel.weights_string','format','String');
-		WriteData(fid,prefix,'data',round(self.datatime*md.constants.yts),'name','md.cfsurfacelogvel.datatime','format','Integer');
+		WriteData(fid,prefix,'data',round(self.datatime*md.constants.yts),'name','md.cfsurfacelogvel.datatime','format','Double');
 		end % }}}
 	end
Index: /issm/trunk/src/m/classes/cfsurfacesquare.m
===================================================================
--- /issm/trunk/src/m/classes/cfsurfacesquare.m	(revision 26743)
+++ /issm/trunk/src/m/classes/cfsurfacesquare.m	(revision 26744)
@@ -98,5 +98,5 @@
 		WriteData(fid,prefix,'data',self.weights,'name','md.cfsurfacesquare.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 		WriteData(fid,prefix,'data',self.weights_string,'name','md.cfsurfacesquare.weights_string','format','String');
-		WriteData(fid,prefix,'data',round(self.datatime*md.constants.yts),'name','md.cfsurfacesquare.datatime','format','Integer');
+		WriteData(fid,prefix,'data',round(self.datatime*md.constants.yts),'name','md.cfsurfacesquare.datatime','format','Double');
 		end % }}}
 	end
Index: /issm/trunk/src/m/classes/clusters/acenet.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/acenet.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/acenet.m	(revision 26744)
@@ -7,164 +7,164 @@
 
 classdef acenet
-    properties (SetAccess=public) 
-		 % {{{
-		 %name='glacdyn.ace-net.ca'
-		 name='placentia.ace-net.ca'
-		 %name='brasdor.ace-net.ca'
-		 login='klemorza';
-		 np=10;
-		 port=0;
-		 queue='longq';
-		 time=10;
-		 % codepath='/usr/local/issm-r11321/bin'; % this one is for issm on acenet global
-		 codepath='/home/klemorza/issm/trunk-jpl/bin'; % this one is for issm on my acenet directory
-		 %executionpath='/home/klemorza/issm/trunk-jpl/execution';
-		 %executionpath='/home/klemorza/scratch/issmres.dir';
-		 executionpath='/net/glacdyn-data/glacdyn/1/klemorza/issm.dir';                 
-		 %}}}
-	 end
-	 methods
-		 function cluster=acenet(varargin) % {{{
-			 %use provided options to change fields
-			 options=pairoptions(varargin{:});
-			 %initialize cluster using user settings if provided
-			 if (exist([cluster.name '_settings'])==2), eval([cluster.name '_settings']); end
+	properties (SetAccess=public)
+		% {{{
+		%name='glacdyn.ace-net.ca'
+		name='placentia.ace-net.ca'
+		%name='brasdor.ace-net.ca'
+		login='klemorza';
+		np=10;
+		port=0;
+		queue='longq';
+		time=10;
+		% codepath='/usr/local/issm-r11321/bin'; % this one is for issm on acenet global
+		codepath='/home/klemorza/issm/trunk-jpl/bin'; % this one is for issm on my acenet directory
+		%executionpath='/home/klemorza/issm/trunk-jpl/execution';
+		%executionpath='/home/klemorza/scratch/issmres.dir';
+		executionpath='/net/glacdyn-data/glacdyn/1/klemorza/issm.dir';
+		%}}}
+	end
+	methods
+		function cluster=acenet(varargin) % {{{
+			%use provided options to change fields
+			options=pairoptions(varargin{:});
+			%initialize cluster using user settings if provided
+			if (exist([cluster.name '_settings'])==2), eval([cluster.name '_settings']); end
 
-			 %OK get other fields
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}} 
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    np: %i',cluster.np));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    queue: %s',cluster.queue));
-			 disp(sprintf('    time: %i',cluster.time));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-                 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+			%OK get other fields
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}} 
+		function disp(cluster) % {{{
+			% display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    np: %i',cluster.np));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_queues={'debug','shortq','longq'};
-			 queue_requirements_time=[48*1 48*7 48*15];
-			 queue_requirements_np=[32 128 256];
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+			available_queues={'debug','shortq','longq'};
+			queue_requirements_time=[48*1 48*7 48*15];
+			queue_requirements_np=[32 128 256];
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#$ -cwd\n');
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#$ -cwd\n');
 
-                         fprintf(fid,'#$ -N issm\n');
-                         % fprintf(fid,'#$ -l h_rt=00:15:00\n');
-                         % fprintf(fid,'#$ -l h_rt=5:00:0\n');
-                         % fprintf(fid,'#$ -l h_rt=25:00:0\n');
-                         % fprintf(fid,'#$ -l h_rt=47:59:00\n');
-                         % fprintf(fid,'#$ -l h_rt=72:00:0\n');
-                         % fprintf(fid,'#$ -l h_rt=96:00:0\n');
-                         % fprintf(fid,'#$ -l h_rt=336:00:0\n');
-                         tstr = sprintf('#$ -l h_rt=%i:00:00\n',cluster.time);
-                         fprintf(fid,tstr);
+			fprintf(fid,'#$ -N issm\n');
+			% fprintf(fid,'#$ -l h_rt=00:15:00\n');
+			% fprintf(fid,'#$ -l h_rt=5:00:0\n');
+			% fprintf(fid,'#$ -l h_rt=25:00:0\n');
+			% fprintf(fid,'#$ -l h_rt=47:59:00\n');
+			% fprintf(fid,'#$ -l h_rt=72:00:0\n');
+			% fprintf(fid,'#$ -l h_rt=96:00:0\n');
+			% fprintf(fid,'#$ -l h_rt=336:00:0\n');
+			tstr = sprintf('#$ -l h_rt=%i:00:00\n',cluster.time);
+			fprintf(fid,tstr);
 
-                         fprintf(fid,'#$ -l h_vmem=2G\n');
+			fprintf(fid,'#$ -l h_vmem=2G\n');
 
-                         if strcmp(cluster.executionpath,'/home/klemorza/scratch/issmres.dir')
-                             % ---- Which acent queue to use ----
-                             fprintf(fid,'#$ -q short.q@*,medium.q@*\n');
-                             %fprintf(fid,'#$ -q medium.q@*,long.q@*\n');
-                             %fprintf(fid,'#$ -q medium.q@*\n');
-                             %fprintf(fid,'#$ -q short.q@*\n');
-                             % Acenet nodes with 16cpus and more than 60G mem
-                             % fprintf(fid,'#$ -l h=cl001|cl002|cl003|cl004|cl005|cl006|cl007|cl008|cl009|cl010|cl011|cl012|cl021|cl022|cl023|cl024 \n');
-                             % ---- cpus on different nodes ----
-                             if cluster.np==4
-                                 % -------- All cpus in the same node --------          
-                                 fprintf(fid,'#$ -pe openmp %i\n',cluster.np);
-                             else
-                                 fprintf(fid,'#$ -pe ompi %i\n',cluster.np); % To avoid green acenet that does not have InfiniBand
-                             end
-                         
-                         elseif strcmp(cluster.executionpath,'/net/glacdyn-data/glacdyn/1/klemorza/issm.dir')
-                             % ---- Which node for Lev's queue are selected ----
-                             fprintf(fid,'#$ -q tarasov.q\n');
-                             fprintf(fid,'#$ -l h=cl27*|cl28*|cl29*|cl30*|cl31*|cl320|cl267|cl268|cl269|cl338 \n');
-                             %fprintf(fid,'#$ -l h=cl27*|cl28*|cl29*|cl30*|cl31*|cl320|cl267|cl268|cl269 \n');
-                             %fprintf(fid,'#$ -l h=cl0* \n');
-                             % fprintf(fid,'#$ -l h=cl338 \n');
-                             
-                             if cluster.np==4
-                                 % -------- All cpus in the same node --------          
-                                 fprintf(fid,'#$ -pe openmp %i\n',cluster.np);
-                             else
-                                 fprintf(fid,'#$ -pe ompi* %i\n',cluster.np);
-                                 %fprintf(fid,'#$ -pe 4per %i\n',cluster.np);
-                                 %fprintf(fid,'#$ -pe 8per %i\n',cluster.np);
-                             end
-                         end
-                                                  
-                         % ---- misc ----
-                         fprintf(fid,'#$ -j y\n');
-                         
-                         fprintf(fid,'module purge\n');
-                         %fprintf(fid,'module load gcc openmpi/gcc\n');
-                         %fprintf(fid,'module unload openmpi\n');
-                         fprintf(fid,'module load intel/12.1.7.367\n');
-                         fprintf(fid,'module load openmpi/intel/1.2.9\n');
+			if strcmp(cluster.executionpath,'/home/klemorza/scratch/issmres.dir')
+				% ---- Which acent queue to use ----
+				fprintf(fid,'#$ -q short.q@*,medium.q@*\n');
+				%fprintf(fid,'#$ -q medium.q@*,long.q@*\n');
+				%fprintf(fid,'#$ -q medium.q@*\n');
+				%fprintf(fid,'#$ -q short.q@*\n');
+				% Acenet nodes with 16cpus and more than 60G mem
+				% fprintf(fid,'#$ -l h=cl001|cl002|cl003|cl004|cl005|cl006|cl007|cl008|cl009|cl010|cl011|cl012|cl021|cl022|cl023|cl024 \n');
+				% ---- cpus on different nodes ----
+				if cluster.np==4
+					% -------- All cpus in the same node --------          
+					fprintf(fid,'#$ -pe openmp %i\n',cluster.np);
+				else
+					fprintf(fid,'#$ -pe ompi %i\n',cluster.np); % To avoid green acenet that does not have InfiniBand
+				end
 
-                         fprintf(fid,'module load gsl\n');
-                         %fprintf(fid,'module load issm\n');
-                         fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-                         fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-                         fprintf(fid,'\n');
-                         fprintf(fid,'mpiexec %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog\n',...
-                                 cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname);
-                         %fprintf(fid,'echo $HOSTNAME >>%s.outlog',modelname);
-			 fclose(fid);
+			elseif strcmp(cluster.executionpath,'/net/glacdyn-data/glacdyn/1/klemorza/issm.dir')
+				% ---- Which node for Lev's queue are selected ----
+				fprintf(fid,'#$ -q tarasov.q\n');
+				fprintf(fid,'#$ -l h=cl27*|cl28*|cl29*|cl30*|cl31*|cl320|cl267|cl268|cl269|cl338 \n');
+				%fprintf(fid,'#$ -l h=cl27*|cl28*|cl29*|cl30*|cl31*|cl320|cl267|cl268|cl269 \n');
+				%fprintf(fid,'#$ -l h=cl0* \n');
+				% fprintf(fid,'#$ -l h=cl338 \n');
+				
+				if cluster.np==4
+					% -------- All cpus in the same node --------          
+					fprintf(fid,'#$ -pe openmp %i\n',cluster.np);
+				else
+					fprintf(fid,'#$ -pe ompi* %i\n',cluster.np);
+					%fprintf(fid,'#$ -pe 4per %i\n',cluster.np);
+					%fprintf(fid,'#$ -pe 8per %i\n',cluster.np);
+				end
+			end
+						
+			% ---- misc ----
+			fprintf(fid,'#$ -j y\n');
+			
+			fprintf(fid,'module purge\n');
+			%fprintf(fid,'module load gcc openmpi/gcc\n');
+			%fprintf(fid,'module unload openmpi\n');
+			fprintf(fid,'module load intel/12.1.7.367\n');
+			fprintf(fid,'module load openmpi/intel/1.2.9\n');
 
-		 end
-		 %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+			fprintf(fid,'module load gsl\n');
+			%fprintf(fid,'module load issm\n');
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'\n');
+			fprintf(fid,'mpiexec %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog\n',...
+					cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname);
+			%fprintf(fid,'echo $HOSTNAME >>%s.outlog',modelname);
+			fclose(fid);
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 system(compressstring);
+		end
+		%}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
-			 disp('uploading input file and queueing script');
-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			system(compressstring);
 
-		 end %}}}
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
 
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart)% {{{
+		end %}}}
 
-			 disp('launching solution sequence on remote cluster');
-			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
-			 else
-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz && qsub ' modelname '.queue '];
-			 end
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end %}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart) % {{{
 
-		 function Download(cluster,dirname,filelist)% {{{
+			disp('launching solution sequence on remote cluster');
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz && qsub ' modelname '.queue '];
+			end
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
 
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+		function Download(cluster,dirname,filelist) % {{{
 
-		 end %}}}
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/clusters/aci.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/aci.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/aci.m	(revision 26744)
@@ -53,5 +53,5 @@
 			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.ppn*cluster.nodes,1)
 
-			%Miscelaneous
+			%Miscellaneous
 			if cluster.ppn>20, md = checkmessage(md,'cannot request more that 20 cores per node'); end
 			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
Index: /issm/trunk/src/m/classes/clusters/aurora.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/aurora.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/aurora.m	(revision 26744)
@@ -1,3 +1,3 @@
-%AURORA class definition
+%AURORA cluster class definition
 %
 %   Usage:
@@ -7,128 +7,131 @@
 
 classdef aurora
-    properties (SetAccess=public) 
-		 % {{{
-		 name='aurora.jpl.nasa.gov'
-		 login='username';
-		 numnodes = 1;
-		 cpuspernode = 24;
-		 modules = {'intel/cluster-toolkit-2013.5.192'};
-		 port=1070;
-		 queue='shortq';
-		 time=3*60;
-		 codepath='~/issm/trunk/';
-		 executionpath='~/issm/trunk/execution/';
-		 mpipath='/opt/intel/impi/4.1.3/intel64/bin/';
-		 %}}}
-	 end
-	 methods
-		 function cluster=aurora(varargin) % {{{
+	properties (SetAccess=public)
+		% {{{
+		name='aurora.jpl.nasa.gov'
+		login='username';
+		numnodes = 1;
+		cpuspernode = 24;
+		modules = {'intel/cluster-toolkit-2013.5.192'};
+		port=1070;
+		queue='shortq';
+		time=3*60;
+		codepath='~/issm/trunk/';
+		executionpath='~/issm/trunk/execution/';
+		mpipath='/opt/intel/impi/4.1.3/intel64/bin/';
+		%}}}
+	end
+	methods
+		function cluster=aurora(varargin) % {{{
 
-			 %initialize cluster using default settings if provided
-			 if (exist('aurora_settings')==2), aurora_settings; end
+			%initialize cluster using default settings if provided
+			if (exist('aurora_settings')==2), aurora_settings; end
 
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    queue: %s',cluster.queue));
-			 disp(sprintf('    time: %i',cluster.time));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-		 end
-		 %}}}
-		 function numprocs=np(cluster) % {{{
-			 %compute number of processors
-			 numprocs=cluster.numnodes*cluster.cpuspernode;
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    numnodes: %i',cluster.numnodes));
+			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			disp(sprintf('    np: %i',cluster.nprocs()));
+			disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+			disp(sprintf('    mpipath: %s',cluster.mpipath));
+		end
+		%}}}
+		function numprocs=nprocs(cluster) % {{{
+			%compute number of processors
+			numprocs=cluster.numnodes*cluster.cpuspernode;
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_queues={'debugq','shortq','mediumq','longq','verylongq'};
-			 queue_requirements_time=[60*1 60*3 60*12 60*48 60*192];
-			 queue_requirements_np=[16 256 256 128 128];
+			available_queues={'debugq','shortq','mediumq','longq','verylongq'};
+			queue_requirements_time=[60*1 60*3 60*12 60*48 60*192];
+			queue_requirements_np=[16 256 256 128 128];
 
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.numnodes.*cluster.cpuspernode,cluster.time)
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.numnodes.*cluster.cpuspernode,cluster.time)
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
-			 executable='issm.exe';
-			 if isdakota,
-				 version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
-				 if (version>=6),
-					 executable='issm_dakota.exe';
-				 end
-			 end
-			 if isoceancoupling,
-				 executable='issm_ocean.exe';
-			 end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			executable='issm.exe';
+			if isdakota,
+				version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
+				if (version>=6),
+					executable='issm_dakota.exe';
+				end
+			end
+			if isoceancoupling,
+				executable='issm_ocean.exe';
+			end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#PBS -l select=%i:ncpus=%i\n',cluster.numnodes,cluster.cpuspernode);
-			 fprintf(fid,'#PBS -N %s\n',modelname);
-			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
-			 fprintf(fid,'#PBS -q %s\n',cluster.queue);
-			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
-			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
-			 fprintf(fid,'source /usr/share/Modules/init/bash\n');
-			 for i=1:numel(cluster.modules), fprintf(fid,['module load ' cluster.modules{i} '\n\n']); end
-			 fprintf(fid,'export PATH="$PATH:."\n\n');
-			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
-			 fprintf(fid,'export MPI_UNBUFFERED_STDIO=true\n\n');
-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath);
-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');      
-			 fprintf(fid,'export PATH="$PATH:.:%s"\n',cluster.mpipath);
-			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
-			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
-			 fprintf(fid,'mpirun -n %i %s/%s %s %s %s',cluster.np(),cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
-			 fclose(fid);
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#PBS -l select=%i:ncpus=%i\n',cluster.numnodes,cluster.cpuspernode);
+			fprintf(fid,'#PBS -N %s\n',modelname);
+			fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
+			fprintf(fid,'#PBS -q %s\n',cluster.queue);
+			fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+			fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+			fprintf(fid,'source /usr/share/Modules/init/bash\n');
+			for i=1:numel(cluster.modules), fprintf(fid,['module load ' cluster.modules{i} '\n\n']); end
+			fprintf(fid,'export PATH="$PATH:."\n\n');
+			fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
+			fprintf(fid,'export MPI_UNBUFFERED_STDIO=true\n\n');
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath);
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');      
+			fprintf(fid,'export PATH="$PATH:.:%s"\n',cluster.mpipath);
+			fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
+			fprintf(fid,'cd $PBS_O_WORKDIR\n');
+			fprintf(fid,'mpirun -n %i %s/%s %s %s %s',cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+			fclose(fid);
 
-		 end
-		 %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+		end
+		%}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 system(compressstring);
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			system(compressstring);
 
-			 disp('uploading input file and queueing script');
-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
 
-		 end %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+		end %}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
 
-			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
-			 else
-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
-			 end
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
+			end
 
-			 disp('launching solution sequence on remote cluster');
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+			disp('launching solution sequence on remote cluster');
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
 
-		 end %}}}
-		 function Download(cluster,dirname,filelist)% {{{
+		end %}}}
+		function Download(cluster,dirname,filelist) % {{{
 
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
 
-		 end %}}}
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/clusters/camhpc.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/camhpc.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/camhpc.m	(revision 26744)
@@ -1,3 +1,3 @@
-%PFE class definition
+%CAMHPC cluster class definition
 %
 %   Usage:
@@ -7,145 +7,145 @@
 
 classdef camhpc
-    properties (SetAccess=public)  
-		 % {{{
-		 name          = 'camhpc'
-		 login         = '';
-		 numnodes      = 20;
-		 cpuspernode   = 8;
-		 port          = 8000;
-		 project       = '';
-		 partition     = '';
-		 codepath      = '';
-		 executionpath = '';
-		 interactive   = 0;
-		 time          = 24*60;
-		 memory        = 2;
-	 end
-	 %}}}
-	 methods
-		 function cluster=camhpc(varargin) % {{{
+	properties (SetAccess=public)
+		% {{{
+		name          = 'camhpc'
+		login         = '';
+		numnodes      = 20;
+		cpuspernode   = 8;
+		port          = 8000;
+		project       = '';
+		partition     = '';
+		codepath      = '';
+		executionpath = '';
+		interactive   = 0;
+		time          = 24*60;
+		memory        = 2;
+	end
+	%}}}
+	methods
+		function cluster=camhpc(varargin) % {{{
 
-			 %initialize cluster using default settings if provided
-			 if (exist('camhpc_settings')==2), camhpc_settings; end
+			%initialize cluster using default settings if provided
+			if (exist('camhpc_settings')==2), camhpc_settings; end
 
-			 %use provided options to change fields
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
-			 disp(sprintf('    project: %s',cluster.project));
-			 disp(sprintf('    partition: %s',cluster.partition));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-			 disp(sprintf('    interactive: %i',cluster.interactive));
-			 disp(sprintf('    time: %i',cluster.time));
-			 disp(sprintf('    memory: %i',cluster.memory));
-		 end
-		 %}}}
-		 function numprocs=np(cluster) % {{{
-			 %compute number of processors
-			 numprocs=cluster.numnodes*cluster.cpuspernode;
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+			%use provided options to change fields
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    numnodes: %i',cluster.numnodes));
+			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			disp(sprintf('    np: %i',cluster.nprocs()));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    project: %s',cluster.project));
+			disp(sprintf('    partition: %s',cluster.partition));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+			disp(sprintf('    interactive: %i',cluster.interactive));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    memory: %i',cluster.memory));
+		end
+		%}}}
+		function numprocs=nprocs(cluster) % {{{
+			%compute number of processors
+			numprocs=cluster.numnodes*cluster.cpuspernode;
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_queues={'ARNOLD-SL3-CPU'}; % Updated for csd3 NSA 28/3/18
-			 queue_requirements_time=[Inf Inf];
-			 queue_requirements_np=[80 80];
+			available_queues={'ARNOLD-SL3-CPU'}; % Updated for csd3 NSA 28/3/18
+			queue_requirements_time=[Inf Inf];
+			queue_requirements_np=[80 80];
 
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.project,cluster.np,1)
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.project,cluster.nprocs(),1)
 
-			 %Miscelaneous
-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+			%Miscellaneous
+			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
 
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-             disp(modelname)
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
-			 fprintf(fid,'#SBATCH -p %s \n',cluster.partition);
-			 fprintf(fid,'#SBATCH -A %s \n',cluster.project);
-			 fprintf(fid,'#SBATCH --mail-type=ALL\n');
-			 fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
-			 fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60) %walltime is in seconds.
-			 fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
-			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-			 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
+			%write queuing script
+			disp(modelname)
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
+			fprintf(fid,'#SBATCH -p %s \n',cluster.partition);
+			fprintf(fid,'#SBATCH -A %s \n',cluster.project);
+			fprintf(fid,'#SBATCH --mail-type=ALL\n');
+			fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
+			fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60) %walltime is in seconds.
+			fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
+			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+			fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+			fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
 
-			 %in interactive mode, create a run file, and errlog and outlog file
-			 if cluster.interactive,
-				 fid=fopen([modelname '.run'],'w');
-				 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-				 if ~io_gather, %concatenate the output files:
-					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-				 end
-				 fclose(fid);
-				 fid=fopen([modelname '.errlog'],'w');
-				 fclose(fid);
-				 fid=fopen([modelname '.outlog'],'w');
-				 fclose(fid);
-			 end
-		 end %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+			%in interactive mode, create a run file, and errlog and outlog file
+			if cluster.interactive,
+				fid=fopen([modelname '.run'],'w');
+				fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+				if ~io_gather, %concatenate the output files:
+					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+				end
+				fclose(fid);
+				fid=fopen([modelname '.errlog'],'w');
+				fclose(fid);
+				fid=fopen([modelname '.outlog'],'w');
+				fclose(fid);
+			end
+		end %}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 if cluster.interactive,
-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
-			 end
-			 system(compressstring);
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
 
-			 disp('uploading input file and queueing script');
-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
 
-		 end %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+		end %}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
 
-			 disp('launching solution sequence on remote cluster');
+			disp('launching solution sequence on remote cluster');
              %
              % qsub replaced by sbatch for csd3 system NSA 28/3/18
-			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
-			 else
-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
-			 end
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end %}}}
-		 function Download(cluster,dirname,filelist)% {{{
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
+			end
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function Download(cluster,dirname,filelist) % {{{
 
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
 
-		 end %}}}
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/clusters/castor.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/castor.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/castor.m	(revision 26744)
@@ -7,101 +7,101 @@
 
 classdef castor
-    properties (SetAccess=public) 
-		 % {{{
-		 name='castor'
-		 login='username';
-		 np   =128;
-		 port=0;
-		 queue='shortc';
-		 time=180;
-		 codepath='/workp/edw/issm-2.0/bin'
-		 executionpath='/workp/edw/Testing/Execution'
-		 %}}}
-	 end
-	 methods
-		 function cluster=castor(varargin) % {{{
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    np: %i',cluster.np));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    queue: %s',cluster.queue));
-			 disp(sprintf('    time: %i',cluster.time));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+	properties (SetAccess=public)
+		% {{{
+		name='castor'
+		login='username';
+		np=128;
+		port=0;
+		queue='shortc';
+		time=180;
+		codepath='/workp/edw/issm-2.0/bin'
+		executionpath='/workp/edw/Testing/Execution'
+		%}}}
+	end
+	methods
+		function cluster=castor(varargin) % {{{
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    np: %i',cluster.np));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_queues={'shortc','longc'};
-			 queue_requirements_time=[180 720];
-			 queue_requirements_np=[128 128];
+			available_queues={'shortc','longc'};
+			queue_requirements_time=[180 720];
+			queue_requirements_np=[128 128];
 
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/sh\n');
-			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
-			 fprintf(fid,'#PBS -N %s\n',modelname);
-			 fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np);
-			 if ~isempty(queue),
-				 fprintf(fid,'#PBS -q %s\n',cluster.queue);
-			 end
-			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
-			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
-			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
-			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
-			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
-			 fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-			 fclose(fid);
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/sh\n');
+			fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
+			fprintf(fid,'#PBS -N %s\n',modelname);
+			fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np);
+			if ~isempty(queue),
+				fprintf(fid,'#PBS -q %s\n',cluster.queue);
+			end
+			fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+			fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+			fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
+			fprintf(fid,'cd $PBS_O_WORKDIR\n');
+			fprintf(fid,'export OMP_NUM_THREADS=1\n');
+			fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+			fclose(fid);
 
-		 end
-		 %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+		end
+		%}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 if cluster.interactive,
-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
-			 end
-			 system(compressstring);
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
 
-			 disp('uploading input file and queueing script');
-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
 
-		 end %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart)% {{{
+		end %}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart) % {{{
 
-			 disp('launching solution sequence on remote cluster');
-			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
-			 else
-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
-			 end
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end %}}}
-		 function Download(cluster,dirname,filelist)% {{{
+			disp('launching solution sequence on remote cluster');
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
+			end
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function Download(cluster,dirname,filelist) % {{{
 
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
 
-		 end %}}}
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/clusters/cloud.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/cloud.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/cloud.m	(revision 26744)
@@ -6,5 +6,5 @@
 
 classdef cloud
-	properties (SetAccess=public) 
+	properties (SetAccess=public)
 		% {{{
 		name='';
@@ -20,6 +20,6 @@
 
 			%initialize cluster using user settings if provided
-			if (exist('cloud_settings')==2), 
-				eval('cloud_settings'); 
+			if (exist('cloud_settings')==2),
+				cloud_settings;
 			end
 
@@ -29,5 +29,5 @@
 		%}}}
 		function disp(cluster) % {{{
-			%  display the object
+			%display the object
 			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
 			disp(sprintf('    name: %s',cluster.name));
@@ -53,16 +53,10 @@
 			fid=fopen([modelname '.queue'],'w');
 			fprintf(fid,'#!/bin/bash\n');
-			if cluster.interactive
-				fprintf(fid,'source %s%s\n',cluster.codepath,'/../etc/environment.sh');
-				fprintf(fid,'cd %s\n',[cluster.executionpath '/' dirname]);
-				fprintf(fid,'mpiexec -np %i -f /home/mpich2.hosts %s/issm.exe %s %s %s 2> %s.errlog > /dev/stdout | tee %s.outlog ',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname);
-			else
-				fprintf(fid,'source %s%s\n',cluster.codepath,'/../etc/environment.sh');
-				fprintf(fid,'cd %s\n',[cluster.executionpath '/' dirname]);
-				fprintf(fid,'mpiexec -np %i -f /home/mpich2.hosts %s/issm.exe %s %s %s 2> %s.errlog > /dev/stdout | tee %s.outlog ',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname);
-			end
+			fprintf(fid,'source %s%s\n',cluster.codepath,'/../etc/environment.sh');
+			fprintf(fid,'cd %s\n',[cluster.executionpath '/' dirname]);
+			fprintf(fid,'mpiexec -np %i -f /home/mpich2.hosts %s/issm.exe %s %s/%s %s 2> %s.errlog > /dev/stdout | tee %s.outlog',cluster.np,cluster.codepath,solution,cluster.executionpath,dirname,modelname,modelname,modelname);
 		end
 		%}}}
-		function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
 			%compress the files into one zip.
@@ -80,5 +74,5 @@
 
 		end %}}}
-		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart)% {{{
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart) % {{{
 
 			if cluster.interactive, 
@@ -88,18 +82,18 @@
 				else
 					launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz '];
+						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz'];
 				end
 			else
 				disp('launching solution sequence on remote cluster');
 				if ~isempty(restart)
-					launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub  ' modelname '.queue '];
+					launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue'];
 				else
 					launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub  ' modelname '.queue '];
+						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz && qsub ' modelname '.queue'];
 				end
 			end
 			issmstssh(cluster.name,cluster.login,launchcommand);
 		end %}}}
-		function Download(cluster,dirname,filelist)% {{{
+		function Download(cluster,dirname,filelist) % {{{
 
 			%copy files from cluster to current directory
Index: /issm/trunk/src/m/classes/clusters/cloud.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/cloud.py	(revision 26744)
+++ /issm/trunk/src/m/classes/clusters/cloud.py	(revision 26744)
@@ -0,0 +1,101 @@
+import subprocess
+
+try:
+    from cloud_settings import cloud_settings
+except ImportError:
+    print('You need cloud_settings.py to proceed, check presence and sys.path')
+
+class cloud(object):
+    """CLOUD cluster class definition
+
+    Usage:
+        cluster = cloud('name', 'astrid', 'np', 3)
+        cluster = cloud('name', oshostname(), 'np', 3, 'login', 'username')
+    """
+
+    def __init__(self, *args):  # {{{
+        self.name = ''
+        self.login = ''
+        self.np = 1
+        self.codepath = ''
+        self.executionpath = ''
+        self.interactive = 0
+
+        # Initialize cluster using user settings if provided
+        try:
+            self = cloud_settings(self)
+        except NameError:
+            print('cloud_settings.py not found, using default settings')
+
+        # OK get other fields
+        options = pairoptions(*args)
+        self = options.AssignObjectFields(self)
+    # }}}
+
+    def __repr__(self):  # {{{
+        # Display the object
+        s = 'class \'{}\' object \'{}\' = \n'.format(type(self), 'self')
+        s += '    name: {}\n'.format(self.name)
+        s += '    login: {}\n'.format(self.login)
+        s += '    np: {}\n'.format(self.np)
+        s += '    codepath: {}\n'.format(self.codepath)
+        s += '    executionpath: {}\n'.format(self.executionpath)
+        s += '    interactive: {}\n'.format(self.interactive)
+        return s
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if self.np < 1:
+            md = md.checkmessage('number of processors should be at least 1')
+
+        if np.isnan(self.np):
+            md = md.checkmessage('number of processors should not be NaN!')
+
+        return self
+    # }}}
+
+    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
+        # Write queuing script
+        fid = open(modelname + '.queue', 'w')
+
+        fid.write('#/bin/bash\n')
+        fid.write('source {}{}\n'.format(self.codepath, '/../etc/environment.sh'))
+        fid.write('cd {}/{}\n'.format(self.executionpath, dirname))
+        fid.write('mpiexec -np {} -f /home/mpich2.hosts {}/issm.exe {} {}/{} {} 2> {}.errlog > /dev/stdout | tee {}.outlog\n'.format(self.np, self.codepath, solution, self.executionpath, dirname, modelname, modelname, modelname))
+    # }}}
+
+    def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
+        # Compress the files into one zip
+        compressstring = 'tar -zcf {}.tar.gz'.format(dirname)
+        for file in filelist:
+            compressstring += ' {}'.format(file)
+        subprocess.call(compressstring, shell=True)
+
+        if isempty(self.login):
+            raise Exception('cloud BuildQueueScript: login should be supplied!')
+
+        print('uploading input file and queueing script')
+        issmstscpout(self.name, self.executionpath, self.login, '{}.tar.gz'.format(dirname))
+    # }}}
+
+    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
+        if self.interactive:
+            print('sending files to remote cluster. once done, please log into cluster and launch job')
+            if not isempty(restart):
+                launchcommand = 'cd {} && cd {}'.format(self.executionpath, dirname)
+            else:
+                launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && mv ../{}.tar.gz ./ && tar -zxf {}.tar.gz'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname)
+        else:
+            print('launching solution sequence on remote cluster')
+            if not isempty(restart):
+                launchcommand = 'cd {} && cd {} && qsub {}.queue'.format(self.executionpath, dirname, modelname)
+            else:
+                launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && mv ../{}.tar.gz ./ && tar -zxf {}.tar.gz && qsub {}.queue'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+        issmstssh(self.name, self.login, launchcommand)
+    # }}}
+
+    def Download(self, dirname, filelist):  # {{{
+        # Copy files from cluster to current directory
+        directory = '{}/{}/'.format(self.executionpath, dirname)
+        issmstscpin(self.name, self.login, directory, filelist)
+    # }}}
Index: /issm/trunk/src/m/classes/clusters/cosmos.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/cosmos.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/cosmos.m	(revision 26744)
@@ -7,101 +7,101 @@
 
 classdef cosmos
-    properties (SetAccess=public) 
-		 % {{{
-		 name='cosmos'
-		 login='username';
-		 np=128;
-		 port=0;
-		 queue='shortq';
-		 time=3*60;
-		 codepath='/work00/edw/issm-2.0/bin';
-		 executionpath='/work00/edw/Execution';
-		 %}}}
-	 end
-	 methods
-		 function cluster=cosmos(varargin) % {{{
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    np: %i',cluster.np));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    queue: %s',cluster.queue));
-			 disp(sprintf('    time: %i',cluster.time));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+	properties (SetAccess=public)
+		% {{{
+		name='cosmos'
+		login='username';
+		np=128;
+		port=0;
+		queue='shortq';
+		time=3*60;
+		codepath='/work00/edw/issm-2.0/bin';
+		executionpath='/work00/edw/Execution';
+		%}}}
+	end
+	methods
+		function cluster=cosmos(varargin) % {{{
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    np: %i',cluster.np));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_queues={'debug','shortq','longq'};
-			 queue_requirements_time=[60*1 60*3 60*17];
-			 queue_requirements_np=[32 128 256];
+			available_queues={'debug','shortq','longq'};
+			queue_requirements_time=[60*1 60*3 60*17];
+			queue_requirements_np=[32 128 256];
 
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#PBS -l select=%i:ncpus=1\n',cluster.np);
-			 fprintf(fid,'#PBS -N %s\n',modelname);
-			 fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds.
-			 fprintf(fid,'#PBS -q %s\n',queue);
-			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
-			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
-			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
-			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
-			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
-			 fprintf(fid,'ulimit -s unlimited\n');
-			 fprintf(fid,'ulimit -c 0\n');
-			 fprintf(fid,'/opt/mpich/gm/intel10.1/bin/mpiexec -np %i %s/issm.exe %s %s %s',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-			 fclose(fid);
+			%write queuing script
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#PBS -l select=%i:ncpus=1\n',cluster.np);
+			fprintf(fid,'#PBS -N %s\n',modelname);
+			fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds.
+			fprintf(fid,'#PBS -q %s\n',queue);
+			fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+			fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+			fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
+			fprintf(fid,'cd $PBS_O_WORKDIR\n');
+			fprintf(fid,'export OMP_NUM_THREADS=1\n');
+			fprintf(fid,'ulimit -s unlimited\n');
+			fprintf(fid,'ulimit -c 0\n');
+			fprintf(fid,'/opt/mpich/gm/intel10.1/bin/mpiexec -np %i %s/issm.exe %s %s %s',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+			fclose(fid);
 
-		 end
-		 %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+		end
+		%}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 if cluster.interactive,
-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
-			 end
-			 system(compressstring);
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
 
-			 disp('uploading input file and queueing script');
-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
 
-		 end %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart)% {{{
+		end %}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart) % {{{
 
-			 disp('launching solution sequence on remote cluster');
-			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
-			 else
-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
-			 end
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end %}}}
-		 function Download(cluster,dirname,filelist)% {{{
+			disp('launching solution sequence on remote cluster');
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
+			end
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function Download(cluster,dirname,filelist) % {{{
 
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
 
-		 end %}}}
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/clusters/cyclone.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/cyclone.py	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/cyclone.py	(revision 26744)
@@ -1,25 +1,28 @@
 import subprocess
-from fielddisplay import fielddisplay
-from pairoptions import pairoptions
-from issmssh import issmssh
-from issmscpin import issmscpin
-from issmscpout import issmscpout
+
 try:
     from cyclone_settings import cyclone_settings
 except ImportError:
     print('You need cyclone_settings.py to proceed, check presence and sys.path')
+from fielddisplay import fielddisplay
+from helpers import *
+from pairoptions import pairoptions
+from issmscpin import issmscpin
+from issmscpout import issmscpout
+from issmssh import issmssh
 
 
 class cyclone(object):
-    """
-    Be aware that this is not a cluster as we usually know them. There is no scheduling and ressources are pretty low.
-    The Computer have 20 cpus and 512Gb of memory used by a number of person so be respectful with your usage.
-    I putted some restrictive upper limits to avoid over - use. (Basile)
+    """CYCLONE cluster class definition
 
-       Usage:
-          cluster = cyclone()
+    Be aware that this is not a cluster as we usually know them. There is no scheduling and resources are pretty low.
+    The computer has 20 CPUs and 512GB of memory used by a number of persons, so be respectful with your usage.
+    I have put some restrictive upper limits in place to avoid overuse. (Basile)
+
+    Usage:
+        cluster = cyclone()
     """
 
-    def __init__(self, *args):    # {{{
+    def __init__(self, *args):  # {{{
         self.name = 'cyclone'
         self.login = ''
@@ -31,16 +34,15 @@
         self.interactive = 0
 
-    #use provided options to change fields
+        # Use provided options to change fields
         options = pairoptions(*args)
 
-    #initialize cluster using user settings if provided
+        # Initialize cluster using user settings if provided
         self = cyclone_settings(self)
-    #OK get other fields
+        # OK get other fields
         self = options.AssignObjectFields(self)
-
     # }}}
 
-    def __repr__(self):    # {{{
-        #  display the object
+    def __repr__(self):  # {{{
+        # Display the object
         s = "class cyclone object:"
         s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
@@ -53,6 +55,6 @@
     # }}}
 
-    def checkconsistency(self, md, solution, analyses):    # {{{
-        #Miscelaneous
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        # Miscellaneous
         if not self.login:
             md = md.checkmessage('login empty')
@@ -69,7 +71,7 @@
     # }}}
 
-    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
+    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
         executable = 'issm.exe'
-        #write queuing script
+        # Write queuing script
         fid = open(modelname + '.queue', 'w')
         fid.write('export ISSM_DIR="%s/../ "\n' % self.codepath)
@@ -83,28 +85,25 @@
         fid.write('mpiexec -np %i %s/%s %s %s %s>%s.outlog 2>%s.errlog\n' % (self.np, self.codepath, executable, str(solution), rundir, modelname, runfile, runfile))
         fid.close()
-
     # }}}
-    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
+    def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
         #compress the files into one zip.
         compressstring = 'tar -zcf %s.tar.gz ' % dirname
         for file in filelist:
-            compressstring += ' %s' % file
+            compressstring += ' {}'.format(file)
         subprocess.call(compressstring, shell=True)
 
         print('uploading input file and queueing script')
         issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
-
     # }}}
-    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
+    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
         print('launching solution sequence on remote cluster')
-        if restart:
+        if not isempty(restart):
             launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
         else:
             launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && chmod +x ./%s.queue && ./%s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname, modelname)
         issmssh(self.name, self.login, self.port, launchcommand)
-
     # }}}
-    def Download(self, dirname, filelist):    # {{{
-        #copy files from cluster to current directory
+    def Download(self, dirname, filelist):  # {{{
+        # Copy files from cluster to current directory
         directory = '%s/%s/' % (self.executionpath, dirname)
         issmscpin(self.name, self.login, self.port, directory, filelist)
Index: /issm/trunk/src/m/classes/clusters/discover.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/discover.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/discover.m	(revision 26744)
@@ -1,3 +1,3 @@
-%PFE class definition
+%DISCOVER cluster class definition
 %
 %   Usage:
@@ -6,221 +6,223 @@
 %      cluster=discover('np',3,'login','username');
 
-classdef discover 
-    properties (SetAccess=public)  
-		 % {{{
-		 name=oshostname();
-		 login='';
-		 modules        = {};
-		 numnodes=20;
-		 cpuspernode=8; 
-		 port=0;
-		 queue='general';
-		 time=12*60*60;
-		 processor='west';
-		 codepath='';
-		 executionpath='';
-		 interactive=0;
-		 bbftp=0;
-		 numstreams=8;
-		 hyperthreading=0;
-		 email='';
-	 end
-	 %}}}
-	 methods
-		 function cluster=discover(varargin) % {{{
-
-			 %initialize cluster using default settings if provided
-			 if (exist('discover_settings')==2), discover_settings; end
-
-			 %use provided options to change fields
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
-			 disp(sprintf('    queue: %s',cluster.queue));
-			 disp(sprintf('    time: %i',cluster.time));
-			 disp(sprintf('    processor: %s',cluster.processor));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-			 disp(sprintf('    interactive: %i',cluster.interactive));
-			 disp(sprintf('    hyperthreading: %i',cluster.hyperthreading));
-			 disp(sprintf('    email: %s',cluster.email));
-		 end
-		 %}}}
-		 function numprocs=np(cluster) % {{{
-			 %compute number of processors
-			 numprocs=cluster.numnodes*cluster.cpuspernode;
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
-
-			 available_queues={'long','allnccs','debug'};
-			 queue_requirements_time=[24*60*60 12*60*60 1*60*60];
-			 queue_requirements_np=[560 6000 532];
-
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
-
-			 %now, check cluster.cpuspernode according to processor type
-			 if ( strcmpi(cluster.processor,'sand')),
-				 if ((cluster.cpuspernode>16 ) | (cluster.cpuspernode<1)),
-					 md = checkmessage(md,'cpuspernode should be between 1 and 16 for ''sand'' processors');
-				 end
-			 elseif strcmpi(cluster.processor,'hasw'),
-				 if ((cluster.cpuspernode>28 ) | (cluster.cpuspernode<1)),
-					 md = checkmessage(md,'cpuspernode should be between 1 and 28 for ''hasw'' processors');
-				 end
-			 else
-				 md = checkmessage(md,'unknown processor type, should be ''sand'' or ''hasw'' ');
-			 end
-
-			 %Miscelaneous
-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
-
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
-
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
-
-			 executable='issm.exe';
-			 if isdakota,
-				 version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
-				 if (version>=6),
-					 executable='issm_dakota.exe';
-				 end
-			 end
-			 if isoceancoupling,
-				 executable='issm_ocean.exe';
-			 end
-
-			 %write queuing script
-			 fid=fopen([modelname '.queue'],'w');
-
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#SBATCH -J %s \n',modelname);
-			 fprintf(fid,'#SBATCH --qos=%s \n',cluster.queue);
-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
-			 fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
-			 fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*cluster.cpuspernode);
-			 fprintf(fid,'#SBATCH -N %i \n',cluster.numnodes);
-			 fprintf(fid,'#SBATCH -t %02i:%02i:00 \n',floor(cluster.time/3600),floor(mod(cluster.time,3600)/60));
-			 fprintf(fid,'#SBATCH -A s1690 \n\n');
-			 for i=1:numel(cluster.modules),
-				 fprintf(fid,['module load ' cluster.modules{i} '\n']);
-			 end
-			 if length(find(cluster.email=='@'))>0
-				 fprintf(fid,'#SBATCH --mail-user=%s \n',cluster.email);
-				 fprintf(fid,'#SBATCH --mail-type=end \n\n');
-			 end
-			 fprintf(fid,'. /usr/share/modules/init/bash\n\n');
-			 fprintf(fid,'module load comp/intel/20.0.0.166\n');
-			 fprintf(fid,'module load mpi/sgi-mpt/2.17\n');
-			 fprintf(fid,'module load cmake/3.17.0\n');
-			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
-			 fprintf(fid,'export MPI_UNBUFFERED_STDIO=true\n\n');
-			 fprintf(fid,'export PATH="$PATH:."\n\n');
-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-
-			 fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
-
-			 %in interactive mode, create a run file, and errlog and outlog file
-			 if cluster.interactive,
-				 fid=fopen([modelname '.run'],'w');
-				 if ~isvalgrind,
-					 fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
-				 else
-					 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
-				 end
-				 if ~io_gather, %concatenate the output files:
-					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-				 end
-				 fclose(fid);
-				 fid=fopen([modelname '.errlog'],'w');
-				 fclose(fid);
-				 fid=fopen([modelname '.outlog'],'w');
-				 fclose(fid);
-			 end
-		 end %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
-
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 if cluster.interactive,
-				 compressstring = [compressstring ' ' modelname '.run '  modelname '.errlog ' modelname '.outlog '];
-			 end
-			 system(compressstring);
-
-			 disp('uploading input file and queueing script');
-			 if cluster.interactive,
-				 directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive)];
-			 else 
-				 directory=cluster.executionpath;
-			 end
-
-			 if ~cluster.bbftp,
-				 issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
-			 else
-				 issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
-			 end
-
-		 end
-		 %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
-
-			 if ~cluster.interactive, 
-				 if ~isempty(restart)
-					 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && sbatch ' modelname '.queue '];
-				 else
-					 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-						 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && sbatch ' modelname '.queue '];
-				 end
-			 else
-				 if ~isempty(restart)
-					 launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive)];
-				 else
-					 launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive) ' && tar -zxf ' dirname '.tar.gz'];
-				 end
-			 end
-
-			 disp('launching solution sequence on remote cluster');
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end
-		 %}}}
-		 function Download(cluster,dirname,filelist)% {{{
-
-			 %copy files from cluster to current directory
-			 if ~cluster.interactive,
-				 directory=[cluster.executionpath '/' dirname '/'];
-			 else
-				 directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive) '/'];
-			 end
-
-			 if ~cluster.bbftp,
-				 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
-			 else
-				 issmbbftpin(cluster.name, cluster.login, cluster.port, cluster.numstreams, directory, filelist);
-			 end
-
-		 end %}}}
+classdef discover
+	properties (SetAccess=public)
+		% {{{
+		name=oshostname();
+		login='';
+		modules={'comp/intel/20.0.0.166' 'mpi/sgi-mpt/2.17' 'cmake/3.17.0'};
+		numnodes=20;
+		cpuspernode=8;
+		port=0;
+		queue='general';
+		time=12*60*60;
+		processor='west';
+		codepath='';
+		executionpath='';
+		grouplist='';
+		interactive=0;
+		bbftp=0;
+		numstreams=8;
+		hyperthreading=0;
+		email='';
+	end
+	%}}}
+	methods
+		function cluster=discover(varargin) % {{{
+
+			%initialize cluster using default settings if provided
+			if (exist('discover_settings')==2), discover_settings; end
+
+			%use provided options to change fields
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
+			disp(sprintf('    numnodes: %i',cluster.numnodes));
+			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			disp(sprintf('    np: %i',cluster.nprocs()));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    processor: %s',cluster.processor));
+			disp(sprintf('    srcpath: %s',cluster.srcpath));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+			disp(sprintf('    grouplist: %s',cluster.grouplist));
+			disp(sprintf('    interactive: %i',cluster.interactive));
+			disp(sprintf('    bbftp: %s',cluster.bbftp));
+			disp(sprintf('    numstreams: %s',cluster.numstreams));
+			disp(sprintf('    hyperthreading: %i',cluster.hyperthreading));
+			disp(sprintf('    email: %s',cluster.email));
+		end
+		%}}}
+		function numprocs=nprocs(cluster) % {{{
+			%compute number of processors
+			numprocs=cluster.numnodes*cluster.cpuspernode;
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+
+			available_queues={'long','allnccs','debug'};
+			queue_requirements_time=[24*60*60 12*60*60 1*60*60];
+			queue_requirements_np=[560 6000 532];
+
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.nprocs(),cluster.time)
+
+			%now, check cluster.cpuspernode according to processor type
+			if ( strcmpi(cluster.processor,'sand')),
+				if ((cluster.cpuspernode>16 ) | (cluster.cpuspernode<1)),
+					md = checkmessage(md,'cpuspernode should be between 1 and 16 for ''sand'' processors');
+				end
+			elseif strcmpi(cluster.processor,'hasw'),
+				if ((cluster.cpuspernode>28 ) | (cluster.cpuspernode<1)),
+					md = checkmessage(md,'cpuspernode should be between 1 and 28 for ''hasw'' processors');
+				end
+			else
+				md = checkmessage(md,'unknown processor type, should be ''sand'' or ''hasw'' ');
+			end
+
+			%Miscellaneous
+			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+
+			executable='issm.exe';
+			if isdakota,
+				version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
+				if (version>=6),
+					executable='issm_dakota.exe';
+				end
+			end
+			if isoceancoupling,
+				executable='issm_ocean.exe';
+			end
+
+			%write queuing script
+			fid=fopen([modelname '.queue'],'w');
+
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#SBATCH -J %s \n',modelname);
+			fprintf(fid,'#SBATCH --qos=%s \n',cluster.queue);
+			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+			fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
+			fprintf(fid,'#SBATCH -n %i \n',cluster.nprocs());
+			fprintf(fid,'#SBATCH -N %i \n',cluster.numnodes);
+			fprintf(fid,'#SBATCH -t %02i:%02i:00 \n',floor(cluster.time/3600),floor(mod(cluster.time,3600)/60));
+			fprintf(fid,'#SBATCH -A %s \n\n',cluster.grouplist);
+			if length(find(cluster.email=='@'))>0
+				fprintf(fid,'#SBATCH --mail-user=%s \n',cluster.email);
+				fprintf(fid,'#SBATCH --mail-type=end \n\n');
+			end
+			fprintf(fid,'. /usr/share/modules/init/bash\n\n');
+			for i=1:numel(cluster.modules),
+				fprintf(fid,['module load ' cluster.modules{i} '\n']);
+			end
+			fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
+			fprintf(fid,'export MPI_UNBUFFERED_STDIO=true\n\n');
+			fprintf(fid,'export PATH="$PATH:."\n\n');
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+
+			fprintf(fid,'mpiexec -np %i %s/%s %s %s/%s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,cluster.executionpath,dirname,modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
+
+			%in interactive mode, create a run file, and errlog and outlog file
+			if cluster.interactive,
+				fid=fopen([modelname '.run'],'w');
+				if ~isvalgrind,
+					fprintf(fid,'mpiexec -np %i %s/%s %s %s/%s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,cluster.executionpath,dirname,modelname);
+				else
+					fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/%s %s %s/%s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,cluster.executionpath,dirname,modelname);
+				end
+				if ~io_gather, %concatenate the output files:
+					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+				end
+				fclose(fid);
+				fid=fopen([modelname '.errlog'],'w'); % TODO: Change this to system call (touch <file>)?
+				fclose(fid);
+				fid=fopen([modelname '.outlog'],'w'); % TODO: Change this to system call (touch <file>)?
+				fclose(fid);
+			end
+		end %}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
+
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz'];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.run '  modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
+
+			disp('uploading input file and queueing script');
+			if cluster.interactive,
+				directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive)];
+			else 
+				directory=cluster.executionpath;
+			end
+
+			if cluster.bbftp,
+				issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
+			else
+				issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			end
+
+		end
+		%}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+
+			if cluster.interactive,
+				if ~isempty(restart)
+					launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive)];
+				else
+					launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive) ' && tar -zxf ' dirname '.tar.gz'];
+				end
+			else
+				if ~isempty(restart)
+					launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && sbatch ' modelname '.queue '];
+				else
+					launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && sbatch ' modelname '.queue '];
+				end
+			end
+
+			disp('launching solution sequence on remote cluster');
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end
+		%}}}
+		function Download(cluster,dirname,filelist) % {{{
+
+			%copy files from cluster to current directory
+			if cluster.interactive,
+				directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive) '/'];
+			else
+				directory=[cluster.executionpath '/' dirname '/'];
+			end
+
+			if cluster.bbftp,
+				issmbbftpin(cluster.name, cluster.login, cluster.port, cluster.numstreams, directory, filelist);
+			else
+				issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+			end
+
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/clusters/discover.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/discover.py	(revision 26744)
+++ /issm/trunk/src/m/classes/clusters/discover.py	(revision 26744)
@@ -0,0 +1,222 @@
+import subprocess
+
+try:
+    from discover_settings import discover_settings
+except ImportError:
+    print('You need discover_settings.py to proceed, check presence and sys.path')
+from fielddisplay import fielddisplay
+from helpers import *
+from IssmConfig import IssmConfig
+from issmscpin import issmscpin
+from issmscpout import issmscpout
+from issmssh import issmssh
+from MatlabFuncs import *
+from pairoptions import pairoptions
+from QueueRequirements import QueueRequirements
+
+class discover(object):
+    """DISCOVER cluster class definition
+
+    Usage:
+        cluster = discover()
+        cluster = discover('np', 3)
+        cluster = discover('np', 3, 'login', 'username')
+    """
+
+    def __init__(self, *args):  # {{{
+        self.name = oshostname()
+        self.login = ''
+        self.modules = ['comp/intel/20.0.0.166', 'mpi/sgi-mpt/2.17', 'cmake/3.17.0']
+        self.numnodes = 20
+        self.cpuspernode = 8
+        self.port = 0
+        self.queue = 'general'
+        self.time = 12 * 60 * 60
+        self.processor = 'west'
+        self.srcpath = ''
+        self.codepath = ''
+        self.executionpath = ''
+        self.grouplist = ''
+        self.interactive = 0
+        self.bbftp = 0
+        self.numstreams = 8
+        self.hyperthreading = 0
+        self.email = ''
+
+        # Use provided options to change fields
+        options = pairoptions(*args)
+
+        # Initialize cluster using user settings if provided
+        try:
+            self = discover_settings(self)
+        except NameError:
+            print('discover_settings.py not found, using default settings')
+
+        # OK get other fields
+        self = options.AssignObjectFields(self)
+    # }}}
+
+    def __repr__(self):  # {{{
+        # Display the object
+        s = 'class discover object\n'
+        s += '    name: {}\n'.format(self.name)
+        s += '    login: {}\n'.format(self.login)
+        s += '    modules: {}\n'.format(strjoin(self.modules, ', '))
+        s += '    numnodes: {}\n'.format(self.numnodes)
+        s += '    cpuspernode: {}\n'.format(self.cpuspernode)
+        s += '    np: {}\n'.format(self.nprocs())
+        s += '    port: {}\n'.format(self.port)
+        s += '    queue: {}\n'.format(self.queue)
+        s += '    time: {}\n'.format(self.time)
+        s += '    processor: {}\n'.format(self.processor)
+        s += '    srcpath: {}\n'.format(self.srcpath)
+        s += '    codepath: {}\n'.format(self.codepath)
+        s += '    executionpath: {}\n'.format(self.executionpath)
+        s += '    grouplist: {}\n'.format(self.grouplist)
+        s += '    interactive: {}\n'.format(self.interactive)
+        s += '    bbftp: {}\n'.format(self.bbftp)
+        s += '    numstreams: {}\n'.format(self.numstreams)
+        s += '    hyperthreading: {}\n'.format(self.hyperthreading)
+        return s
+    # }}}
+
+    def nprocs(self):  # {{{
+        return self.numnodes * self.cpuspernode
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        queuedict = {'long': [24 * 60 * 60, 560],
+                     'allnccs': [12 * 60 * 60, 6000],
+                     'debug': [1 * 60 * 60, 532]}
+        QueueRequirements(queuedict, self.queue, self.nprocs(), self.time)
+
+        # Now, check cluster.cpuspernode according to processor type
+        if self.processor == 'sand':
+            if self.cpuspernode > 16 or self.cpuspernode < 1:
+                md = md.checkmessage('cpuspernode should be between 1 and 16 for \'sand\' processors in hyperthreading mode')
+        elif self.processor == 'hasw':
+            if self.cpuspernode > 28 or self.cpuspernode < 1:
+                md = md.checkmessage('cpuspernode should be between 1 and 28 for \'hasw\' processors in hyperthreading mode')
+        else:
+            md = md.checkmessage('unknown processor type, should be \'sand\' or \'hasw\'')
+
+        # Miscellaneous
+        if not self.login:
+            md = md.checkmessage('login empty')
+        if not self.codepath:
+            md = md.checkmessage('codepath empty')
+        if not self.executionpath:
+            md = md.checkmessage('executionpath empty')
+
+        return self
+    # }}}
+
+    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
+        if isgprof:
+            print('gprof not supported by cluster, ignoring...')
+
+        executable = 'issm.exe'
+        if isdakota:
+            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
+            version = float(str(version[0]))
+            if version >= 6:
+                executable = 'issm_dakota.exe'
+        if isoceancoupling:
+            executable = 'issm_ocean.exe'
+
+        # Write queuing script
+        fid = open(modelname + '.queue', 'w')
+
+        fid.write('#!/bin/bash\n')
+        fid.write('#SBATCH -J {} \n'.format(modelname))
+        fid.write('#SBATCH --qos={} \n'.format(self.queue))
+        fid.write('#SBATCH -o {}.outlog \n'.format(modelname))
+        fid.write('#SBATCH -e {}.errlog \n'.format(modelname))
+        fid.write('#SBATCH -n {} \n'.format(self.nprocs()))
+        fid.write('#SBATCH -N {} \n'.format(self.numnodes))
+        fid.write('#SBATCH -t {:02d}:{:02d}:00 \n'.format(int(floor(self.time / 3600)), int(floor(self.time % 3600) / 60)))
+        fid.write('#SBATCH -A {} \n\n'.format(self.grouplist))
+        if (self.email.find('@')>-1):
+            fid.write('#SBATCH --mail-user={} \n'.format(self.email))
+            fid.write('#SBATCH --mail-type=end \n\n')
+        fid.write('. /usr/share/modules/init/bash\n\n')
+        for i in range(len(self.modules)):
+            fid.write('module load {}\n'.format(self.modules[i]))
+        fid.write('export MPI_GROUP_MAX=64\n\n')
+        fid.write('export MPI_UNBUFFERED_STDIO=true\n\n')
+        fid.write('export PATH="$PATH:."\n\n')
+        fid.write('export ISSM_DIR="{}/../"\n'.format(self.codepath)) # FIXME
+        fid.write('source $ISSM_DIR/etc/environment.sh\n') # FIXME
+        fid.write('cd {}/{}\n\n'.format(self.executionpath, dirname))
+
+        fid.write('mpiexec -np {} {}/{} {} {}/{} {}\n'.format(self.nprocs(), self.codepath, executable, solution, self.executionpath, dirname, modelname))
+
+        if not io_gather: # concatenate the output files
+            fid.write('cat {}.outbin.* > {}.outbin'.format(modelname, modelname))
+        fid.close()
+
+        # In interactive mode, create a run file, and errlog and outlog file
+        if self.interactive:
+            fid = open(modelname + '.run', 'w')
+            if not isvalgrind:
+                fid.write('mpiexec -np {} {}/{} {} {}/{} {}\n'.format(self.nprocs(), self.codepath, executable, solution, self.executionpath, dirname, modelname))
+            else:
+                fid.write('mpiexec -np {} valgrind --leak-check=full {}/{} {} {}/{} {}\n'.format(self.nprocs(), self.codepath, executable, solution, self.executionpath, dirname, modelname))
+            if not io_gather: # concatenate the output files
+                fid.write('cat {}.outbin.* > {}.outbin'.format(modelname, modelname))
+            fid.close()
+            fid = open(modelname + '.errlog', 'w') # TODO: Change this to system call (touch <file>)?
+            fid.close()
+            fid = open(modelname + '.outlog', 'w') # TODO: Change this to system call (touch <file>)?
+            fid.close()
+    # }}}
+
+    def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
+        # Compress the files into one zip
+        compressstring = 'tar -zcf {}.tar.gz'.format(dirname)
+        for file in filelist:
+            compressstring += ' {}'.format(file)
+        if self.interactive:
+            compressstring += ' {}.run {}.errlog {}.outlog'.format(modelname, modelname, modelname)
+        subprocess.call(compressstring, shell=True)
+
+        print('uploading input file and queueing script')
+        if self.interactive:
+            directory = '{}/Interactive{}'.format(self.executionpath, self.interactive)
+        else:
+            directory = self.executionpath
+
+        if self.bbftp:
+            issmbbftpout(self.name, directory, self.login, self.port, self.numstreams, '{}.tar.gz'.format(dirname))
+        else:
+            issmscpout(self.name, directory, self.login, self.port, ['{}.tar.gz'.format(dirname)])
+    # }}}
+
+    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
+        if self.interactive:
+            if not isempty(restart):
+                launchcommand = 'cd {}/Interactive{}'.format(self.executionpath, self.interactive)
+            else:
+                launchcommand = 'cd {}/Interactive{} && tar -zxf {}.tar.gz'.format(self.executionpath, self.interactive, dirname)
+        else:
+            if not isempty(restart):
+                launchcommand = 'cd {} && cd {} && sbatch {}.queue'.format(self.executionpath, dirname, modelname)
+            else:
+                launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && mv ../{}.tar.gz ./ && tar -zxf {}.tar.gz && sbatch {}.queue'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+
+        print('launching solution sequence on remote cluster')
+        issmssh(self.name, self.login, self.port, launchcommand)
+    # }}}
+
+    def Download(self, dirname, filelist):  # {{{
+        # Copy files from cluster to current directory
+        if self.interactive:
+            directory = '{}/Interactive{}'.format(self.executionpath, self.interactive)
+        else:
+            directory = '{}/{}/'.format(self.executionpath, dirname)
+
+        if self.bbftp:
+            issmbbftpin(self.name, self.login, self.port, self.numstreams, directory, filelist)
+        else:
+            issmscpin(self.name, self.login, self.port, directory, filelist)
+    # }}}
Index: /issm/trunk/src/m/classes/clusters/fram.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/fram.py	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/fram.py	(revision 26744)
@@ -1,35 +1,38 @@
 import subprocess
+
 import numpy as np
+
 from fielddisplay import fielddisplay
-from pairoptions import pairoptions
-from issmssh import issmssh
-from issmscpin import issmscpin
-from issmscpout import issmscpout
-from QueueRequirements import QueueRequirements
-from IssmConfig import IssmConfig
 try:
     from fram_settings import fram_settings
 except ImportError:
     print('You need fram_settings.py to proceed, check presence and sys.path')
+from helpers import *
+from pairoptions import pairoptions
+from IssmConfig import IssmConfig
+from issmscpin import issmscpin
+from issmscpout import issmscpout
+from issmssh import issmssh
+from QueueRequirements import QueueRequirements
 
 
 class fram(object):
-    """
-    Fram cluster class definition
+    """FRAM cluster class definition
+
     This is a SLURM queue
     The priorities are based on a point system, reservation when reaching 20000 and earning 1 point per min.
-     - Devel queue starts at 19990
-     - Normal starts at 19940
-     - Normal unpri atarts at 19400
+    - Devel queue starts at 19990
+    - Normal starts at 19940
+    - Normal unpri atarts at 19400
 
     Jobs can be:
-     - normal (4 to 30 nodes, more if asked, 48h max walltime, 60Gb per nodes)
-     - bigmem for big memory nodes (8 512Gb nodes and 2 6Tb nodes, shared nodes, 14days max walltime
+    - normal (4 to 30 nodes, more if asked, 48h max walltime, 60Gb per nodes)
+    - bigmem for big memory nodes (8 512Gb nodes and 2 6Tb nodes, shared nodes, 14days max walltime
 
-       Usage:
-          cluster = stallo()
+    Usage:
+        cluster = fram()
     """
 
-    def __init__(self, *args):    # {{{
+    def __init__(self, *args):  # {{{
         self.name = 'fram'
         self.login = ''
@@ -45,17 +48,18 @@
         self.accountname = ''
         self.profiling = 0
-    #use provided options to change fields
+        # Use provided options to change fields
         options = pairoptions(*args)
 
-    #initialize cluster using user settings if provided
+        # Initialize cluster using user settings if provided
         self = fram_settings(self)
-    #OK get other fields
+
+        # OK get other fields
         self = options.AssignObjectFields(self)
         self.np = self.numnodes * self.cpuspernode
     # }}}
 
-    def __repr__(self):    # {{{
-        #  display the object
-        s = "class vilje object:"
+    def __repr__(self):  # {{{
+        # Display the object
+        s = "class fram object:"
         s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
         s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
@@ -74,10 +78,10 @@
 
     def checkconsistency(self, md, solution, analyses):  # {{{
-        #Queue dictionarry  gives queue name as key and max walltime and cpus as var
+        # Queue dictionary gives queue name as key and max walltime and CPUs as var
         queuedict = {'normal': [2 * 24 * 60, 2048],
                      'devel': [4 * 60, 2048]}
         QueueRequirements(queuedict, self.queue, self.np, self.time)
 
-    #Miscelaneous
+        # Miscellaneous
         if not self.login:
             md = md.checkmessage('login empty')
@@ -91,5 +95,5 @@
     # }}}
 
-    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
+    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
         executable = 'issm.exe'
         if isdakota:
@@ -100,5 +104,5 @@
         if isoceancoupling:
             executable = 'issm_ocean.exe'
-    #write queuing script
+        # Write queuing script
         shortname = modelname[0:min(12, len(modelname))]
         fid = open(modelname + '.queue', 'w')
@@ -125,5 +129,5 @@
         fid.write('module load ParMETIS/4.0.3-intel-2017a\n')
         fid.write('cd %s/%s/ \n\n' % (self.executionpath, dirname))
-        if self.profiling == 1:
+        if self.profiling:
             fid.write('module load perf-report\n')
             fid.write('perf-report mpirun -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
@@ -131,12 +135,11 @@
             fid.write('mpirun -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
         fid.close()
-
     # }}}
 
-    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
-        #compress the files into one zip.
+    def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
+        # Compress the files into one zip
         compressstring = 'tar -zcf %s.tar.gz ' % dirname
         for file in filelist:
-            compressstring += ' %s' % file
+            compressstring += ' {}'.format(file)
         subprocess.call(compressstring, shell=True)
 
@@ -145,15 +148,14 @@
 
     # }}}
-    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
+    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
         print('launching solution sequence on remote cluster')
-        if restart:
+        if not isempty(restart):
             launchcommand = 'cd %s && cd %s && sbatch %s.queue' % (self.executionpath, dirname, modelname)
         else:
             launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && sbatch %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
         issmssh(self.name, self.login, self.port, launchcommand)
-
     # }}}
-    def Download(self, dirname, filelist):    # {{{
-        #copy files from cluster to current directory
+    def Download(self, dirname, filelist):  # {{{
+        # Copy files from cluster to current directory
         directory = '%s/%s/' % (self.executionpath, dirname)
         issmscpin(self.name, self.login, self.port, directory, filelist)
Index: /issm/trunk/src/m/classes/clusters/frontera.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/frontera.m	(revision 26744)
+++ /issm/trunk/src/m/classes/clusters/frontera.m	(revision 26744)
@@ -0,0 +1,202 @@
+%FRONTERA cluster class definition
+%
+%   Usage:
+%      cluster=frontera();
+%      cluster=frontera('np',3);
+%      cluster=frontera('np',3,'login','username');
+
+classdef frontera
+	properties (SetAccess=public)
+		% {{{
+		name          = 'frontera'
+		login         = '';
+		modules        = {'petsc/3.15'};
+		numnodes      = 1;
+		cpuspernode   = 56;
+		port          = 0;
+		queue         = 'normal';
+		codepath      = '';
+		executionpath = '';
+		interactive   = 0;
+		time          = 48*60*60;
+		email         = '';
+	end
+	%}}}
+	methods
+		function cluster=frontera(varargin) % {{{
+
+			%initialize cluster using default settings if provided
+			if (exist('frontera_settings')==2), frontera_settings; end
+
+			%use provided options to change fields
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    numnodes: %i',cluster.numnodes));
+			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			disp(sprintf('    np: %i',cluster.nprocs()));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+			disp(sprintf('    interactive: %i',cluster.interactive));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    email: %s',cluster.email));
+		end
+		%}}}
+		function numprocs=nprocs(cluster) % {{{
+			%compute number of processors
+			numprocs=cluster.numnodes*cluster.cpuspernode;
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+
+			%https://frontera-portal.tacc.utexas.edu/user-guide/running/
+			available_queues={'small','normal','development'};
+			queue_requirements_time=[48*60*60 48*60*60 2*60*60];
+			queue_requirements_np=[2*56 512*56 40*56];
+
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.nprocs(),cluster.time)
+
+			%Miscellaneous
+			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+		end
+		%}}}
+		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#$ -N %s\n',modelname);
+			fprintf(fid,'#$ -q %s \n',cluster.queue);
+			fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
+			fprintf(fid,'#$ -R y\n');
+			fprintf(fid,'#$ -m beas\n');
+			fprintf(fid,'#$ -o %s.outlog \n',modelname);
+			fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
+			fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.nprocs(),cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+
+			executable='issm.exe';
+			if isdakota,
+				version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
+				if (version>=6),
+					executable='issm_dakota.exe';
+				end
+			end
+			if isoceancoupling,
+				executable='issm_ocean.exe';
+			end
+
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#SBATCH -J %s \n',modelname);
+			fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
+			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+			fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
+			fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*max(cluster.nprocs()/cluster.numnodes,56));
+			fprintf(fid,'#SBATCH -N %i \n',cluster.numnodes);
+			fprintf(fid,'#SBATCH -t %02i:%02i:00 \n\n',floor(cluster.time/3600),floor(mod(cluster.time,3600)/60));
+			for i=1:numel(cluster.modules),
+				fprintf(fid,['module load ' cluster.modules{i} '\n']);
+			end
+
+			if isdakota,
+				fprintf(fid,'export KMP_AFFINITY="granularity=fine,compact,verbose" \n\n');
+			end
+
+			if length(find(cluster.email=='@'))>0
+				fprintf(fid,'#SBATCH --mail-user=%s \n',cluster.email);
+				fprintf(fid,'#SBATCH --mail-type=end \n\n');
+
+				%fprintf(fid,'ssh login1 "mail -s ''SLURM Jobid=${SLURM_JOBID} Name=${SLURM_JOB_NAME} Began on Lonestar 5.'' %s <<< ''Job Started'' " \n\n',cluster.email);
+			end
+
+			fprintf(fid,'export PATH="$PATH:."\n\n');
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+			fprintf(fid,'ibrun -np %i %s/%s %s %s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+
+			fclose(fid);
+
+			%in interactive mode, create a run file, and errlog and outlog file
+			if cluster.interactive,
+				fid=fopen([modelname '.run'],'w');
+				fprintf(fid,'ibrun -np %i %s/%s %s %s %s\n',cluster.nprocs(),executable,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+				if ~io_gather, %concatenate the output files:
+					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+				end
+				fclose(fid);
+				fid=fopen([modelname '.errlog'],'w');
+				fclose(fid);
+				fid=fopen([modelname '.outlog'],'w');
+				fclose(fid);
+			end
+		end %}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
+
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
+
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+
+		end %}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+
+			disp('launching solution sequence on remote cluster');
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
+			end
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function Download(cluster,dirname,filelist) % {{{
+
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+
+		end %}}}
+	end
+end
Index: /issm/trunk/src/m/classes/clusters/gemini.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/gemini.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/gemini.m	(revision 26744)
@@ -7,5 +7,5 @@
 
 classdef gemini
-    properties (SetAccess=public) 
+	properties (SetAccess=public)
 	% {{{
 		name='gemini'
@@ -18,91 +18,91 @@
 		executionpath='/workg/edw/Testing/Execution'
 	%}}}
-    end
-    methods
-		 function cluster=gemini(varargin) % {{{
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    np: %i',cluster.np));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    queue: %s',cluster.queue));
-			 disp(sprintf('    time: %i',cluster.time));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+	end
+	methods
+		function cluster=gemini(varargin) % {{{
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    np: %i',cluster.np));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_queues={'debug','shortg','longg'};
-			 queue_requirements_time=[60 180 720];
-			 queue_requirements_np=[50 50 50];
+			available_queues={'debug','shortg','longg'};
+			queue_requirements_time=[60 180 720];
+			queue_requirements_np=[50 50 50];
 
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/sh\n');
-			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
-			 fprintf(fid,'#PBS -N %s\n',modelname);
-			 fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np);
-			 if ~isempty(queue),
-				 fprintf(fid,'#PBS -q %s\n',cluster.queue);
-			 end
-			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
-			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/sh\n');
+			fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
+			fprintf(fid,'#PBS -N %s\n',modelname);
+			fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np);
+			if ~isempty(queue),
+				fprintf(fid,'#PBS -q %s\n',cluster.queue);
+			end
+			fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+			fprintf(fid,'#PBS -e %s.errlog \n',modelname);
 
-			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
-			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
-			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
-			 fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-			 fclose(fid);
+			fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
+			fprintf(fid,'cd $PBS_O_WORKDIR\n');
+			fprintf(fid,'export OMP_NUM_THREADS=1\n');
+			fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+			fclose(fid);
 
-		 end
-		 %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+		end
+		%}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 if cluster.interactive,
-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
-			 end
-			 system(compressstring);
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
 
-			 disp('uploading input file and queueing script');
-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
 
-		 end %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart)% {{{
+		end %}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart) % {{{
 
-			 disp('launching solution sequence on remote cluster');
-			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
-			 else
-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
-			 end
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end %}}}
-		 function Download(cluster,dirname,filelist)% {{{
+			disp('launching solution sequence on remote cluster');
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
+			end
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function Download(cluster,dirname,filelist) % {{{
 
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
 
-		 end %}}}
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/clusters/generic.js
===================================================================
--- /issm/trunk/src/m/classes/clusters/generic.js	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/generic.js	(revision 26744)
@@ -115,6 +115,7 @@
 		
 		// Set request properties
-		request.position 	= 0; // Keep track of current parsing position in repsonseText
-		request.timeout 	= 1000 * 60 * 60 * 3; // 3 hrs (in milliseconds); NOTE: This should match FastCgiServer timeout in Apache conf
+		request.position 	 = 0; // Keep track of current parsing position in repsonseText
+		request.timeout 	= 1000 * 60 * 10; // in milliseconds; NOTE: Under current implementation, this should match 'Timeout' option in Apache conf (/etc/apache2/apache2.conf)
+		request.resultBegin = false;
 		
 		request.ontimeout = function(event) { //{{{
@@ -187,5 +188,14 @@
 					}
 				} else if (request.responseText.length >= endIndex) { // Ensure entire chunk is loaded
-					progress = parseInt(request.responseText.slice(startIndex, endIndex));
+					if (request.resultBegin) {
+						return;
+					}
+					chunk = request.responseText.slice(startIndex, endIndex)
+					if (chunk == 'RESULT_BEGIN') {
+						progress = 100;
+						request.resultBegin = true;
+					} else {
+						progress = parseInt(chunk);
+					}
 					if (hasCallout) {
 						callout.setHeader('Computing...');
@@ -221,14 +231,21 @@
 			
 			try {
-/*
-				console.log(request.responseText);
-				console.log('request.position : ' + request.position);
-				console.log('request.responseType : ' + request.responseType);
-				console.log('request.responseText.length : ' + request.responseText.length);
-*/
+				//Scan through buffer until progress updates stop and 'RESULT_BEGIN' string is received
+				let startIndex 	= request.position;
+				let endIndex 	= request.position + 10;
+				let chunkSize = 0;
+				let chunk = 0;
+				while (!request.resultBegin && chunk != 'RESULT_BEGIN') {
+					chunkSize = parseInt(request.responseText.slice(startIndex, endIndex));
+					startIndex 	= endIndex;
+					endIndex 	= startIndex + chunkSize;
+					chunk = request.responseText.slice(startIndex, endIndex);
+					startIndex 	= endIndex;
+					endIndex 	= startIndex + 10;
+					request.position = startIndex;
+				}
+
 				responseText 	= window.atob(request.responseText.slice(request.position + 10).replace(/\s/g, ''));
-// 				console.log('responseText.length : ' + responseText.length);
 				buffer 			= str2ab(responseText);
-// 				console.log('buffer.length : ' + buffer.length);
 /*
 	            bufferInflated 	= UZIP.inflate(buffer);
@@ -248,5 +265,5 @@
 				// Let front end script handle changes to callout
 				if (hasCallout) {
-					callout.set('Success!', '<p>Solve successful</p>');
+					callout.set('Success!', '<p>Request successful</p>');
 				} else {
 					solveButton.text(solveButtonText).prop('disabled', false);
@@ -255,5 +272,5 @@
 			} catch (e) {
 				console.log(e);
-				if (vesl.string.startsWith(responseText, 'Error')) {
+				if (vesl.strings.startsWith(responseText, 'Error')) {
 					if (hasCallout) {
 						callout.set(vesl.ERROR_HEADER_GENERAL, '<p>Something went wrong. ' + vesl.ERROR_CONTENT_TRY_AGAIN + '</p>');
@@ -272,5 +289,5 @@
 		}; //}}}
 		
-		request.responseType = 'application/octet-stream';
+		request.responseType = 'text';
 		
 		/* Construct request */
Index: /issm/trunk/src/m/classes/clusters/generic.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/generic.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/generic.m	(revision 26744)
@@ -4,4 +4,9 @@
 %      cluster=generic('name','astrid','np',3);
 %      cluster=generic('name',oshostname(),'np',3,'login','username');
+%
+%   TODO:
+%   - Add support for restart to Windows (under MSYS2), then activate tests 125 
+%   and 126 in test suite
+%
 
 classdef generic
@@ -28,5 +33,5 @@
 
 			%Change the defaults if ispc
-			if ispc,
+			if ispc & ~ismingw,
 				cluster.codepath      = [issmdir() '\bin'];
 				cluster.etcpath       = [issmdir() '\etc'];
@@ -65,4 +70,8 @@
 		end
 		%}}}
+		function numprocs=nprocs(cluster) % {{{
+			numprocs=cluster.np;
+		end
+		%}}}
 		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 			if cluster.np<1
@@ -139,13 +148,14 @@
 				fprintf(fid,'@echo off\n');
 
-				if IssmConfig('_HAVE_PETSC_MPI_'),
-					warning('parallel runs not allowed yet in Windows. Defaulting to 1 cpus');
-					cluster.np=1;
-				end
+				% if IssmConfig('_HAVE_PETSC_MPI_'),
+				% 	warning('parallel runs not allowed yet in Windows. Defaulting to 1 cpus');
+				% 	cluster.np=1;
+				% end
 
 				if cluster.np>1,
-					fprintf(fid,'"C:\\Program Files\\MPICH2\\bin\\mpiexec.exe" -n %i "%s/%s" %s ./ %s ',cluster.np,cluster.codepath,executable,solution,modelname);
-				else
-					fprintf(fid,'"%s/%s" %s ./ %s ',cluster.codepath,executable,solution,modelname);
+					% fprintf(fid,'"C:\\Program Files\\MPICH2\\bin\\mpiexec.exe" -n %i "%s/%s" %s ./ %s',cluster.np,cluster.codepath,executable,solution,modelname);
+					fprintf(fid,'"C:\\Program Files\\Microsoft MPI\\Bin\\mpiexec.exe" -n %i "%s/%s" %s ./ %s',cluster.np,cluster.codepath,executable,solution,modelname);
+				else
+					fprintf(fid,'"%s/%s" %s ./ %s',cluster.codepath,executable,solution,modelname);
 				end
 				fclose(fid);
@@ -165,5 +175,5 @@
 
 			%what is the executable being called?
-			executable='issm_slr.exe';
+			executable='issm_slc.exe';
 
 			if ispc(), error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
@@ -280,5 +290,5 @@
 		end
 		%}}}
-		function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
 			if ~ispc,
@@ -301,8 +311,7 @@
 			end
 		end %}}}
-		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
 
 			if ~ispc,
-
 				%figure out what shell extension we will use:
 				if isempty(strfind(cluster.shell,'csh')),
@@ -318,8 +327,8 @@
 				else
 					if ~batch,
-					launchcommand=['source ' cluster.etcpath '/environment.' shellext ' && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+						launchcommand=['source ' cluster.etcpath '/environment.' shellext ' && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
 						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && source  ' modelname '.queue '];
 					else
-					launchcommand=['source ' cluster.etcpath '/environment.' shellext ' && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+						launchcommand=['source ' cluster.etcpath '/environment.' shellext ' && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
 						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz '];
 					end
@@ -331,5 +340,5 @@
 
 		end %}}}
-		function LaunchQueueJobIceOcean(cluster,modelname,dirname,filelist,restart,batch)% {{{
+		function LaunchQueueJobIceOcean(cluster,modelname,dirname,filelist,restart,batch) % {{{
 
 			if ~ispc,
@@ -360,5 +369,5 @@
 
 		end %}}}
-		function Download(cluster,dirname,filelist)% {{{
+		function Download(cluster,dirname,filelist) % {{{
 
 			if ispc(),
Index: /issm/trunk/src/m/classes/clusters/generic.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/generic.py	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/generic.py	(revision 26744)
@@ -1,12 +1,12 @@
-from socket import gethostname
 from subprocess import call
 
-import numpy as np
-
+from fielddisplay import fielddisplay
+from helpers import *
 try:
     from generic_settings import generic_settings
 except ImportError:
-    print('Warning generic_settings.py not found, default will be used')
-from MatlabFuncs import ispc
+    #print('Warning: generic.py: generic_settings.py not found, default will be used')
+    pass
+from MatlabFuncs import *
 from IssmConfig import IssmConfig
 from issmdir import issmdir
@@ -39,36 +39,40 @@
         self.shell = '/bin/sh'
 
-        #use provided options to change fields
+        # Use provided options to change fields
         options = pairoptions(*args)
 
-        #get name
-        self.name = gethostname()
-
-        #initialize cluster using user settings if provided
-
+        # Get name
+        self.name = oshostname()
+
+        # Initialize cluster using user settings if provided
         try:
             self = generic_settings(self)
         except NameError:
-            print("generic_settings.py not found, using default settings")
-
-        #OK get other fields
+            # print('generic_settings.py not found, using default settings')
+            pass
+
+        # OK get other fields
         self = options.AssignObjectFields(self)
     # }}}
 
     def __repr__(self):  # {{{
-        #  display the object
-        s = "class '%s' object '%s' = \n" % (type(self), 'self')
-        s += "    name: %s\n" % self.name
-        s += "    login: %s\n" % self.login
-        s += "    np: %i\n" % self.np
-        s += "    port: %i\n" % self.port
-        s += "    codepath: %s\n" % self.codepath
-        s += "    executionpath: %s\n" % self.executionpath
-        s += "    valgrind: %s\n" % self.valgrind
-        s += "    valgrindlib: %s\n" % self.valgrindlib
-        s += "    valgrindsup: %s\n" % self.valgrindsup
-        s += "    verbose: %s\n" % self.verbose
-        s += "    shell: %s\n" % self.shell
+        # Display the object
+        s = 'class \'{}\' object \'{}\' = \n'.format(type(self), 'self')
+        s += '    name: {}\n'.format(self.name)
+        s += '    login: {}\n'.format(self.login)
+        s += '    np: {}\n'.format(self.np)
+        s += '    port: {}\n'.format(self.port)
+        s += '    codepath: {}\n'.format(self.codepath)
+        s += '    executionpath: {}\n'.format(self.executionpath)
+        s += '    valgrind: {}\n'.format(self.valgrind)
+        s += '    valgrindlib: {}\n'.format(self.valgrindlib)
+        s += '    valgrindsup: {}\n'.format(self.valgrindsup)
+        s += '    verbose: {}\n'.format(self.verbose)
+        s += '    shell: {}\n'.format(self.shell)
         return s
+    # }}}
+
+    def nprocs(self):  # {{{
+        return self.np
     # }}}
 
@@ -179,5 +183,5 @@
             fid.close()
 
-        #in interactive mode, create a run file, and errlog and outlog file
+        # In interactive mode, create a run file, and errlog and outlog file
         if self.interactive:
             fid = open(modelname + '.errlog', 'w')
@@ -188,5 +192,5 @@
 
     def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
-        #compress the files into one zip.
+        # Compress the files into one zip
         compressstring = 'tar -zcf {}.tar.gz '.format(dirname)
         for file in filelist:
@@ -203,5 +207,5 @@
     def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
         print('launching solution sequence on remote cluster')
-        if restart:
+        if not isempty(restart):
             launchcommand = 'cd {} && cd {} chmod 755 {}.queue && ./{}.queue'.format(self.executionpath, dirname, modelname, modelname)
         else:
@@ -215,7 +219,7 @@
     def Download(self, dirname, filelist):  # {{{
         if ispc():
-            #do nothing
+            # Do nothing
             return
-        #copy files from cluster to current directory
+        # Copy files from cluster to current directory
         directory = '{}/{}/'.format(self.executionpath, dirname)
         issmscpin(self.name, self.login, self.port, directory, filelist)
Index: /issm/trunk/src/m/classes/clusters/generic_static.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/generic_static.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/generic_static.m	(revision 26744)
@@ -36,4 +36,6 @@
 			disp(sprintf('    np: %i',cluster.np));
 			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+			disp(sprintf('    interactive: %s',cluster.interactive));
 			disp(sprintf('    shell: %s',cluster.shell));
 		end
@@ -84,9 +86,9 @@
 		end
 		%}}}
-		function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 			% Do nothing
 			return;
 		end %}}}
-		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
 			if ~ispc,
 				% Figure out which file extension to use
@@ -104,5 +106,5 @@
 			end
 		end %}}}
-		function Download(cluster,dirname,filelist)% {{{
+		function Download(cluster,dirname,filelist) % {{{
 			% Do nothing
 			return;
Index: /issm/trunk/src/m/classes/clusters/generic_static.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/generic_static.py	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/generic_static.py	(revision 26744)
@@ -1,9 +1,6 @@
 import math
 import os
-import socket
 import subprocess
-
 import numpy as np
-
 from IssmConfig import IssmConfig
 from issmdir import issmdir
@@ -11,14 +8,13 @@
 from issmscpin import issmscpin
 from issmscpout import issmscpout
-import MatlabFuncs as m
+from MatlabFuncs import *
 from pairoptions import pairoptions
 
 
 class generic_static(object):
-    """
-    GENERIC cluster class definition
+    """GENERIC cluster class definition
 
-       Usage:
-          cluster = generic_static('name', 'astrid', 'np', 3)
+    Usage:
+        cluster = generic_static('name', 'astrid', 'np', 3)
     """
 
@@ -38,5 +34,5 @@
 
         #get name
-        self.name = socket.gethostname()
+        self.name = oshostname()
 
         #initialize cluster using user settings if provided
Index: /issm/trunk/src/m/classes/clusters/greenplanet.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/greenplanet.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/greenplanet.m	(revision 26744)
@@ -1,3 +1,3 @@
-%PFE class definition
+%GREENPLANET cluster class definition
 %
 %   Usage:
@@ -7,163 +7,171 @@
 
 classdef greenplanet
-    properties (SetAccess=public)  
-		 % {{{
-		 name          = 'greenplanet'
-		 login         = '';
-		 numnodes      = 20;
-		 cpuspernode   = 8;
-		 port          = 8000;
-		 queue         = 'c6145';
-		 codepath      = '';
-		 executionpath = '';
-		 interactive   = 0;
-		 time          = 24*60;
-		 memory        = 2;
-	 end
-	 %}}}
-	 methods
-		 function cluster=greenplanet(varargin) % {{{
+	properties (SetAccess=public)
+		% {{{
+		name          = 'greenplanet'
+		login         = '';
+		numnodes      = 20;
+		cpuspernode   = 8;
+		port          = 8000;
+		queue         = 'c6145';
+		codepath      = '';
+		executionpath = '';
+		interactive   = 0;
+		time          = 24*60;
+		memory        = 2;
+	end
+	%}}}
+	methods
+		function cluster=greenplanet(varargin) % {{{
 
-			 %initialize cluster using default settings if provided
-			 if (exist('greenplanet_settings')==2), greenplanet_settings; end
+			%initialize cluster using default settings if provided
+			if (exist('greenplanet_settings')==2), greenplanet_settings; end
 
-			 %use provided options to change fields
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
-			 disp(sprintf('    queue: %s',cluster.queue));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-			 disp(sprintf('    interactive: %i',cluster.interactive));
-			 disp(sprintf('    time: %i',cluster.time));
-			 disp(sprintf('    memory: %i',cluster.memory));
-		 end
-		 %}}}
-		 function numprocs=np(cluster) % {{{
-			 %compute number of processors
-			 numprocs=cluster.numnodes*cluster.cpuspernode;
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+			%use provided options to change fields
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    numnodes: %i',cluster.numnodes));
+			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			disp(sprintf('    np: %i',cluster.nprocs()));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+			disp(sprintf('    interactive: %i',cluster.interactive));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    memory: %i',cluster.memory));
+		end
+		%}}}
+		function numprocs=nprocs(cluster) % {{{
+			%compute number of processors
+			numprocs=cluster.numnodes*cluster.cpuspernode;
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_queues={'c6145','ilg2.3','default'};
-			 queue_requirements_time=[Inf Inf];
-			 queue_requirements_np=[80 80];
+			available_queues={'brd2.4','has2.5','ilg2.3','m-c1.9','m-c2.2','nes2.8','sib2.9','m2090','default'};
+			queue_requirements_time=[Inf Inf Inf Inf Inf Inf Inf Inf Inf];
+			queue_requirements_np=[80 80 80 80 80 80 80 80 80];
 
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.nprocs(),1)
 
-			 %Miscelaneous
-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+			%Miscellaneous
+			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
 
-		 end
-		 %}}}
-		 function BuildKrigingQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+		end
+		%}}}
+		function BuildKrigingQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
-			 fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
-			 fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
-			 fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
-			 fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
-			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-			 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
+			fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
+			fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
+			fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
+			fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
+			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+			fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+			fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.nprocs(),cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
-			 fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
-			 fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
-			 fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
-			 fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
-			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-			 fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
+			fprintf(fid,'#SBATCH --partition=%s',cluster.queue{1});
+			for i=2:length(cluster.queue) 
+				fprintf(fid,',%s',cluster.queue{i});
+			end
+			fprintf(fid,'\n');
+			%fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
+			%fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
+			fprintf(fid,'#SBATCH --nodes=%i\n',cluster.numnodes); % in general, just 1
+			fprintf(fid,'#SBATCH --ntasks=%i\n',cluster.cpuspernode); % in general, just 1
+			fprintf(fid,'#SBATCH --cpus-per-task=%i\n',1); 
+			fprintf(fid,'#SBATCH --mem=%igb\n',cluster.memory); % minimum total node memory required
+			fprintf(fid,'#SBATCH --time=%s\n',datestr(cluster.time/24,'HH:MM:SS')); %walltime is in HH:MM:SS format. cluster.time is in hour
+			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+			fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+			fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
 
-			 %in interactive mode, create a run file, and errlog and outlog file
-			 if cluster.interactive,
-				 fid=fopen([modelname '.run'],'w');
-				 fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-				 if ~io_gather, %concatenate the output files:
-					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-				 end
-				 fclose(fid);
-				 fid=fopen([modelname '.errlog'],'w');
-				 fclose(fid);
-				 fid=fopen([modelname '.outlog'],'w');
-				 fclose(fid);
-			 end
-		 end %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+			%in interactive mode, create a run file, and errlog and outlog file
+			if cluster.interactive,
+				fid=fopen([modelname '.run'],'w');
+				fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+				if ~io_gather, %concatenate the output files:
+					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+				end
+				fclose(fid);
+				fid=fopen([modelname '.errlog'],'w');
+				fclose(fid);
+				fid=fopen([modelname '.outlog'],'w');
+				fclose(fid);
+			end
+		end %}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 if cluster.interactive,
-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
-			 end
-			 system(compressstring);
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
 
-			 disp('uploading input file and queueing script');
-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
 
-		 end %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+		end %}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
 
-			 disp('launching solution sequence on remote cluster');
-			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
-			 else
-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
-			 end
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end %}}}
-		 function Download(cluster,dirname,filelist)% {{{
+			disp('launching solution sequence on remote cluster');
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
+			end
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function Download(cluster,dirname,filelist) % {{{
 
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
 
-		 end %}}}
+		end %}}}
 	end
 end
Index: sm/trunk/src/m/classes/clusters/hexagon.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/hexagon.py	(revision 26743)
+++ 	(revision )
@@ -1,145 +1,0 @@
-import subprocess
-from fielddisplay import fielddisplay
-from pairoptions import pairoptions
-from issmssh import issmssh
-from issmscpin import issmscpin
-from issmscpout import issmscpout
-from IssmConfig import IssmConfig
-import datetime
-try:
-    from hexagon_settings import hexagon_settings
-except ImportError:
-    print('You need hexagon_settings.py to proceed, check presence and sys.path')
-
-
-class hexagon(object):
-    """
-    Hexagon cluster class definition
-    Hexagon have nodes built of 2 * 16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway.
-    You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
-       Usage:
-          cluster = hexagon()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.name = 'hexagon'
-        self.login = ''
-        self.numnodes = 2
-        self.procspernodes = 32
-        self.mem = 32000
-        self.queue = 'batch'
-        self.time = 2 * 60
-        self.codepath = ''
-        self.executionpath = ''
-        self.interactive = 0
-        self.port = []
-        self.accountname = ''
-
-    #use provided options to change fields
-        options = pairoptions(*args)
-
-    #initialize cluster using user settings if provided
-        self = hexagon_settings(self)
-
-    #OK get other fields
-        self = options.AssignObjectFields(self)
-        self.np = self.numnodes * self.procspernodes
-    # }}}
-
-    def __repr__(self):      # {{{
-        #  display the object
-        s = "class hexagon object:"
-        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'procspernodes', 'number of mpi procs per nodes  default and optimal is 32'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'mem', 'Total node memory'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
-        s = "%s\n%s" % (s, fielddisplay(self, 'accountname', 'your cluster account'))
-        return s
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):      # {{{
-        #mem should not be over 32000mb
-        #numprocs should not be over 4096
-        #we have cpupernodes * numberofcpus = mppwidth and mppnppn = cpupernodes,
-        #Miscelaneous
-        if not self.login:
-            md = md.checkmessage('login empty')
-        if not self.codepath:
-            md = md.checkmessage('codepath empty')
-        if not self.executionpath:
-            md = md.checkmessage('executionpath empty')
-        if self.interactive == 1:
-            md = md.checkmessage('interactive mode not implemented')
-        if self.mem > 32000:
-            md = md.checkmessage('asking too much memory max is 32000 per node')
-        return self
-    # }}}
-
-    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
-        executable = 'issm.exe'
-        if isdakota:
-            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
-            version = float(version)
-            if version >= 6:
-                executable = 'issm_dakota.exe'
-        if isoceancoupling:
-            executable = 'issm_ocean.exe'
-
-    #write queuing script
-        shortname = modelname[0:min(12, len(modelname))]
-        fid = open(modelname + '.queue', 'w')
-        fid.write('  #!/bin/bash\n')
-        fid.write('  #PBS - N %s \n' % shortname)
-        fid.write('  #PBS - l mppwidth=%i, mppnppn=%i\n' % (self.np, self.procspernodes))
-        timeobj = datetime.timedelta(minutes=self.time)
-        m, s = divmod(timeobj.total_seconds(), 60)
-        h, m = divmod(m, 60)
-        timestring = "%02d:%02d:%02d" % (h, m, s)
-        fid.write('#PBS -l walltime=%s\n' % timestring)  #walltime is hh:mm:ss
-        fid.write('#PBS -l mppmem=%imb\n' % int(self.mem / self.procspernodes))
-        fid.write('#PBS -A %s\n' % self.accountname)
-        fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
-        fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
-        fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
-        fid.write('export CRAY_ROOTFS=DSL\n')
-        fid.write('module swap PrgEnv-cray / 5.2.40 PrgEnv - gnu\n')
-        fid.write('module load cray-petsc\n')
-        fid.write('module load cray-tpsl\n')
-        fid.write('module load cray-mpich\n')
-        fid.write('module load gsl\n')
-        fid.write('cd %s/%s/\n\n' % (self.executionpath, dirname))
-        fid.write('aprun -B %s/%s %s %s/%s %s\n' % (self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
-        fid.close()
-    # }}}
-
-    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
-        #compress the files into one zip.
-        compressstring = 'tar -zcf %s.tar.gz ' % dirname
-        for file in filelist:
-            compressstring += ' %s' % file
-        subprocess.call(compressstring, shell=True)
-
-        print('uploading input file and queueing script')
-        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
-    # }}}
-
-    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
-        print('launching solution sequence on remote cluster')
-        if restart:
-            launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
-        else:
-            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
-        issmssh(self.name, self.login, self.port, launchcommand)
-    # }}}
-
-    def Download(self, dirname, filelist):    # {{{
-        #copy files from cluster to current directory
-        directory = '%s/%s/' % (self.executionpath, dirname)
-        issmscpin(self.name, self.login, self.port, directory, filelist)
-    # }}}
Index: /issm/trunk/src/m/classes/clusters/hpc.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/hpc.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/hpc.m	(revision 26744)
@@ -1,3 +1,3 @@
-%HPC class definition
+%HPC cluster class definition
 %
 %   Usage:
@@ -7,159 +7,159 @@
 
 classdef hpc
-    properties (SetAccess=public)  
-		 % {{{
-		 name='hpc.oit.uci.edu'
-		 login='';
-		 numnodes=1;
-		 cpuspernode=4; 
-		 port=0;
-		 queue='pub64';
-		 codepath='';
-		 executionpath='';
-		 interactive=0;
-	 end
-	 %}}}
-	 methods
-		 function cluster=hpc(varargin) % {{{
+	properties (SetAccess=public)
+		% {{{
+		name='hpc.oit.uci.edu'
+		login='';
+		numnodes=1;
+		cpuspernode=4; 
+		port=0;
+		queue='pub64';
+		codepath='';
+		executionpath='';
+		interactive=0;
+	end
+	%}}}
+	methods
+		function cluster=hpc(varargin) % {{{
 
-			 %initialize cluster using default settings if provided
-			 if (exist('hpc_settings')==2), hpc_settings; end
+			%initialize cluster using default settings if provided
+			if (exist('hpc_settings')==2), hpc_settings; end
 
-			 %use provided options to change fields
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
-			 disp(sprintf('    queue: %s',cluster.queue));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-			 disp(sprintf('    interactive: %i',cluster.interactive));
-		 end
-		 %}}}
-		 function numprocs=np(cluster) % {{{
-			 %compute number of processors
-			 numprocs=cluster.numnodes*cluster.cpuspernode;
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+			%use provided options to change fields
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    numnodes: %i',cluster.numnodes));
+			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			disp(sprintf('    np: %i',cluster.nprocs()));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+			disp(sprintf('    interactive: %i',cluster.interactive));
+		end
+		%}}}
+		function numprocs=nprocs(cluster) % {{{
+			%compute number of processors
+			numprocs=cluster.numnodes*cluster.cpuspernode;
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_queues={'pub64','free64','free48','free*,pub64','free*'};
-			 queue_requirements_time=[Inf Inf Inf Inf Inf];
-			 queue_requirements_np=[64 64 48 48 48];
+			available_queues={'pub64','free64','free48','free*,pub64','free*'};
+			queue_requirements_time=[Inf Inf Inf Inf Inf];
+			queue_requirements_np=[64 64 48 48 48];
 
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.nprocs(),1)
 
-			 %Miscelaneous
-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+			%Miscellaneous
+			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
 
-		 end
-		 %}}}
-		 function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+		end
+		%}}}
+		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#$ -N %s\n',modelname);
-			 fprintf(fid,'#$ -q %s \n',cluster.queue);
-			 fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
-			 fprintf(fid,'#$ -R y\n');
-			 fprintf(fid,'#$ -m beas\n');
-			 fprintf(fid,'#$ -o %s.outlog \n',modelname);
-			 fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
-			 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#$ -N %s\n',modelname);
+			fprintf(fid,'#$ -q %s \n',cluster.queue);
+			fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
+			fprintf(fid,'#$ -R y\n');
+			fprintf(fid,'#$ -m beas\n');
+			fprintf(fid,'#$ -o %s.outlog \n',modelname);
+			fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
+			fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.nprocs(),cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#$ -N %s\n',modelname);
-			 fprintf(fid,'#$ -q %s \n',cluster.queue);
-			 fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
-			 fprintf(fid,'#$ -R y\n');
-			 %fprintf(fid,'#$ -m beas\n');
-			 fprintf(fid,'#$ -o %s.outlog \n',modelname);
-			 fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#$ -N %s\n',modelname);
+			fprintf(fid,'#$ -q %s \n',cluster.queue);
+			fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
+			fprintf(fid,'#$ -R y\n');
+			%fprintf(fid,'#$ -m beas\n');
+			fprintf(fid,'#$ -o %s.outlog \n',modelname);
+			fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+			fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
 
-			 %in interactive mode, create a run file, and errlog and outlog file
-			 if cluster.interactive,
-				 fid=fopen([modelname '.run'],'w');
-				 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-				 if ~io_gather, %concatenate the output files:
-					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-				 end
-				 fclose(fid);
-				 fid=fopen([modelname '.errlog'],'w');
-				 fclose(fid);
-				 fid=fopen([modelname '.outlog'],'w');
-				 fclose(fid);
-			 end
-		 end %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+			%in interactive mode, create a run file, and errlog and outlog file
+			if cluster.interactive,
+				fid=fopen([modelname '.run'],'w');
+				fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+				if ~io_gather, %concatenate the output files:
+					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+				end
+				fclose(fid);
+				fid=fopen([modelname '.errlog'],'w');
+				fclose(fid);
+				fid=fopen([modelname '.outlog'],'w');
+				fclose(fid);
+			end
+		end %}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 if cluster.interactive,
-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
-			 end
-			 system(compressstring);
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
 
-			 disp('uploading input file and queueing script');
-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
 
-		 end %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+		end %}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
 
-			 disp('launching solution sequence on remote cluster');
-			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
-			 else
-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
-			 end
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end %}}}
-		 function Download(cluster,dirname,filelist)% {{{
+			disp('launching solution sequence on remote cluster');
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
+			end
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function Download(cluster,dirname,filelist) % {{{
 
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
 
-		 end %}}}
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/clusters/hpc_simba.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/hpc_simba.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/hpc_simba.m	(revision 26744)
@@ -1,3 +1,3 @@
-%HPC class definition
+%HPC_SIMBA cluster class definition
 %
 %   Usage:
@@ -7,176 +7,171 @@
 
 classdef hpc_simba
-    properties (SetAccess=public)  
-		 % {{{
-		 name='simba00'
-		 login='inwoo';
-		 numnodes=1;
-		 cpuspernode=36; 
-		 np=4;
-		 port=7777;
-		 queue='pub64';
-		 codepath='/home/DATA/externalpackagesissm/issm/trunk-jpl/bin';
-		 executionpath='/home/DATA/externalpackages/issm/trunk-jpl/execution/';
-		 interactive=0;
-	 end
-	 %}}}
-	 methods
-		 function cluster=hpc_simba(varargin) % {{{
+	properties (SetAccess=public)
+		% {{{
+		name='simba00'
+		login='inwoo';
+		numnodes=1;
+		cpuspernode=36; 
+		np=4;
+		port=7777;
+		queue='pub64';
+		codepath='/home/DATA/externalpackagesissm/issm/trunk-jpl/bin';
+		executionpath='/home/DATA/externalpackages/issm/trunk-jpl/execution/';
+		interactive=0;
+	end
+	%}}}
+	methods
+		function cluster=hpc_simba(varargin) % {{{
 
-			 %initialize cluster using default settings if provided
-			 if (exist('hpc_settings')==2), hpc_settings; end
+			%initialize cluster using default settings if provided
+			if (exist('hpc_settings')==2), hpc_settings; end
 
-			 %use provided options to change fields
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
-			 disp(sprintf('    queue: %s',cluster.queue));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-			 disp(sprintf('    interactive: %i',cluster.interactive));
-		 end
-		 %}}}
-		 %function numprocs=np(cluster) % {{{
-		%	 %compute number of processors
-		%	 numprocs=cluster.numnodes*cluster.cpuspernode;
-		% end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+			%use provided options to change fields
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    numnodes: %i',cluster.numnodes));
+			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			disp(sprintf('    np: %i',cluster.np));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+			disp(sprintf('    interactive: %i',cluster.interactive));
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_queues={'pub64','free64','free48','free*,pub64','free*'};
-			 queue_requirements_time=[Inf Inf Inf Inf Inf];
-			 queue_requirements_np=[64 64 48 48 48];
+			available_queues={'pub64','free64','free48','free*,pub64','free*'};
+			queue_requirements_time=[Inf Inf Inf Inf Inf];
+			queue_requirements_np=[64 64 48 48 48];
 
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
 
-			 %Miscelaneous
-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+			%Miscellaneous
+			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
 
-		 end
-		 %}}}
-		 function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+		end
+		%}}}
+		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#$ -N %s\n',modelname);
-			 fprintf(fid,'#$ -q %s \n',cluster.queue);
-			 fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
-			 fprintf(fid,'#$ -R y\n');
-			 fprintf(fid,'#$ -m beas\n');
-			 fprintf(fid,'#$ -o %s.outlog \n',modelname);
-			 fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
-			 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#$ -N %s\n',modelname);
+			fprintf(fid,'#$ -q %s \n',cluster.queue);
+			fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
+			fprintf(fid,'#$ -R y\n');
+			fprintf(fid,'#$ -m beas\n');
+			fprintf(fid,'#$ -o %s.outlog \n',modelname);
+			fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
+			fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 if 0
-				 fprintf(fid,'#!/bin/bash\n');
-				 fprintf(fid,'#$ -N %s\n',modelname);
-				 fprintf(fid,'#$ -q %s \n',cluster.queue);
-				 fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
-				 fprintf(fid,'#$ -R y\n');
-				 %fprintf(fid,'#$ -m beas\n');
-				 fprintf(fid,'#$ -o %s.outlog \n',modelname);
-				 fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
-			 else % FIXME : This script for SIMBA-Kopri 
-				 fprintf(fid,'#!/bin/bash\n');
-				 %fprintf(fid,'#PBS -q workq\n');
-				 fprintf(fid,'#PBS -N %s\n',modelname);
-				 %fprintf(fid,'#PBS -l nodes=simba01:ppn=%d\n',...
-				%	 ceil(cluster.np/cluster.cpuspernode), cluster.np);
-				 fprintf(fid,'#PBS -l nodes=simba01:ppn=%d\n',...
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			if 0
+				fprintf(fid,'#!/bin/bash\n');
+				fprintf(fid,'#$ -N %s\n',modelname);
+				fprintf(fid,'#$ -q %s \n',cluster.queue);
+				fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
+				fprintf(fid,'#$ -R y\n');
+				%fprintf(fid,'#$ -m beas\n');
+				fprintf(fid,'#$ -o %s.outlog \n',modelname);
+				fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
+			else % FIXME : This script for SIMBA-Kopri 
+				fprintf(fid,'#!/bin/bash\n');
+				%fprintf(fid,'#PBS -q workq\n');
+				fprintf(fid,'#PBS -N %s\n',modelname);
+				%fprintf(fid,'#PBS -l nodes=simba01:ppn=%d\n',...
+				%	ceil(cluster.np/cluster.cpuspernode), cluster.np);
+				fprintf(fid,'#PBS -l nodes=simba01:ppn=%d\n',...
 					cluster.np);
-				 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
-				 fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
-				 fprintf(fid,'\n');
-			 end
-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			 fprintf(fid,'\n');
-			 fprintf(fid,'module load intel18/impi-18\n');
-			 fprintf(fid,'\n');
-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-			 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
+				fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+				fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
+				fprintf(fid,'\n');
+			end
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'\n');
+			fprintf(fid,'module load intel18/impi-18\n');
+			fprintf(fid,'\n');
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+			fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
 
-			 %in interactive mode, create a run file, and errlog and outlog file
-			 if cluster.interactive,
-				 fid=fopen([modelname '.run'],'w');
-				 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-				 if ~io_gather, %concatenate the output files:
-					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-				 end
-				 fclose(fid);
-				 fid=fopen([modelname '.errlog'],'w');
-				 fclose(fid);
-				 fid=fopen([modelname '.outlog'],'w');
-				 fclose(fid);
-			 end
-		 end %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+			%in interactive mode, create a run file, and errlog and outlog file
+			if cluster.interactive,
+				fid=fopen([modelname '.run'],'w');
+				fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+				if ~io_gather, %concatenate the output files:
+					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+				end
+				fclose(fid);
+				fid=fopen([modelname '.errlog'],'w');
+				fclose(fid);
+				fid=fopen([modelname '.outlog'],'w');
+				fclose(fid);
+			end
+		end %}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 if cluster.interactive,
-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
-			 end
-			 system(compressstring);
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
 
-			 disp('uploading input file and queueing script');
-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
 
-		 end %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+		end %}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
 
-			 disp('launching solution sequence on remote cluster');
-			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
-			 else
-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
-			 end
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end %}}}
-		 function Download(cluster,dirname,filelist)% {{{
+			disp('launching solution sequence on remote cluster');
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
+			end
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function Download(cluster,dirname,filelist) % {{{
 
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
 
-		 end %}}}
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/clusters/local.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/local.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/local.m	(revision 26744)
@@ -36,6 +36,6 @@
 			disp(sprintf('    np: %i',cluster.np));
 			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    etcpath: %s',cluster.etcpath));
 			disp(sprintf('    executionpath: %s',cluster.executionpath));
-			disp(sprintf('    etcpath: %s',cluster.etcpath));
 			disp(sprintf('    verbose: %s',cluster.verbose));
 			disp(sprintf('    shell: %s',cluster.shell));
Index: /issm/trunk/src/m/classes/clusters/localpfe.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/localpfe.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/localpfe.m	(revision 26744)
@@ -1,3 +1,3 @@
-%localpfe cluster class definition
+%LOCALPFE cluster class definition
 %
 %   Usage:
@@ -27,6 +27,6 @@
 		function cluster=localpfe(varargin) % {{{
 
-			%Change the defaults if ispc
-			if ispc,
+			%Change the defaults if ispc and not ismingw
+			if ispc & ~ismingw,
 				cluster.codepath      = [issmdir() '\bin'];
 				cluster.etcpath       = [issmdir() '\etc'];
@@ -53,8 +53,10 @@
 			disp(sprintf('    login: %s',cluster.login));
 			disp(sprintf('    np: %i',cluster.np));
+			disp(sprintf('    npocean: %i',cluster.npocean));
 			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    interactive: %i',cluster.interactive));
 			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    etcpath: %s',cluster.etcpath));
 			disp(sprintf('    executionpath: %s',cluster.executionpath));
-			disp(sprintf('    etcpath: %s',cluster.etcpath));
 			disp(sprintf('    valgrind: %s',cluster.valgrind));
 			disp(sprintf('    valgrindlib: %s',cluster.valgrindlib));
@@ -104,7 +106,7 @@
 
 			%what is the executable being called? 
-			executable='issm_slr.exe';
-
-			if ispc(), error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
+			executable='issm_slc.exe';
+
+			if ispc & ~ismingw, error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
 			
 			%write queuing script 
@@ -170,5 +172,5 @@
 
 			%write queuing script 
-			if ~ispc(),
+			if ~ispc,
 
 				fid=fopen([modelname '.queue'],'w');
@@ -214,5 +216,5 @@
 		%}}}
 		function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
-			if ~ispc,
+			if ~ispc | ismingw,
 
 				%compress the files into one zip.
@@ -262,5 +264,5 @@
 		function Download(cluster,dirname,filelist)% {{{
 
-			if ispc(),
+			if ispc && ~ismingw,
 				%do nothing
 				return;
Index: /issm/trunk/src/m/classes/clusters/lonestar.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/lonestar.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/lonestar.m	(revision 26744)
@@ -1,3 +1,3 @@
-%LONESTAR class definition
+%LONESTAR cluster class definition
 %
 %   Usage:
@@ -7,194 +7,195 @@
 
 classdef lonestar
-    properties (SetAccess=public)  
-		 % {{{
-		 name          = 'ls5.tacc.utexas.edu'
-		 login         = '';
-		 modules        = {'intel/16.0.1'};
-		 numnodes      = 1;
-		 cpuspernode   = 24;
-		 port          = 1099;
-		 queue         = 'normal';
-		 codepath      = '';
-		 executionpath = '';
-		 interactive   = 0;
-		 time          = 48*60*60;
-		 email         = '';
-	 end
-	 %}}}
-	 methods
-		 function cluster=lonestar(varargin) % {{{
-
-			 %initialize cluster using default settings if provided
-			 if (exist('lonestar_settings')==2), lonestar_settings; end
-
-			 %use provided options to change fields
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
-			 disp(sprintf('    np: %i',cluster.np));
-			 disp(sprintf('    queue: %s',cluster.queue));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-			 disp(sprintf('    interactive: %i',cluster.interactive));
-			 disp(sprintf('    time: %i',cluster.time));
-			 disp(sprintf('    email: %s',cluster.email));
-		 end
-		 %}}}
-		 function numprocs=np(cluster) % {{{
-			 %compute number of processors
-			 numprocs=cluster.numnodes*cluster.cpuspernode;
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
-
-			 available_queues={'normal','development'};
-			 queue_requirements_time=[48*60*60 2*60*60];
-			 queue_requirements_np=[4104 264];
-
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
-
-			 %Miscelaneous
-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
-		 end
-		 %}}}
-		 function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
-
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
-
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#$ -N %s\n',modelname);
-			 fprintf(fid,'#$ -q %s \n',cluster.queue);
-			 fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
-			 fprintf(fid,'#$ -R y\n');
-			 fprintf(fid,'#$ -m beas\n');
-			 fprintf(fid,'#$ -o %s.outlog \n',modelname);
-			 fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
-			 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
-
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
-
-			 executable='issm.exe';
-			 if isdakota,
-				 version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
-				 if (version>=6),
-					 executable='issm_dakota.exe';
-				 end
-			 end
-			 if isoceancoupling,
-				 executable='issm_ocean.exe';
-			 end
-
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#SBATCH -J %s \n',modelname);
-			 fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
-			 fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
-			 fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*max(cluster.numnodes,24));
-			 fprintf(fid,'#SBATCH -N %i \n',cluster.numnodes);
-			 fprintf(fid,'#SBATCH -t %02i:%02i:00 \n\n',floor(cluster.time/3600),floor(mod(cluster.time,3600)/60));
-			 for i=1:numel(cluster.modules),
-				 fprintf(fid,['module load ' cluster.modules{i} '\n']);
-			 end
-
-			 if isdakota,
-				 fprintf(fid,'export KMP_AFFINITY="granularity=fine,compact,verbose" \n\n');
-			 end
-
-			 if length(find(cluster.email=='@'))>0
-				 fprintf(fid,'#SBATCH --mail-user=%s \n',cluster.email);
-				 fprintf(fid,'#SBATCH --mail-type=end \n\n');
-
-				 %fprintf(fid,'ssh login1 "mail -s ''SLURM Jobid=${SLURM_JOBID} Name=${SLURM_JOB_NAME} Began on Lonestar 5.'' %s <<< ''Job Started'' " \n\n',cluster.email);
-			 end
-
-			 fprintf(fid,'export PATH="$PATH:."\n\n');
-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-			 fprintf(fid,'ibrun -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-
-			 fclose(fid);
-
-			 %in interactive mode, create a run file, and errlog and outlog file
-			 if cluster.interactive,
-				 fid=fopen([modelname '.run'],'w');
-				 fprintf(fid,'ibrun -np %i %s/%s %s %s %s\n',cluster.np,executable,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-				 if ~io_gather, %concatenate the output files:
-					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-				 end
-				 fclose(fid);
-				 fid=fopen([modelname '.errlog'],'w');
-				 fclose(fid);
-				 fid=fopen([modelname '.outlog'],'w');
-				 fclose(fid);
-			 end
-		 end %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
-
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 if cluster.interactive,
-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
-			 end
-			 system(compressstring);
-
-			 disp('uploading input file and queueing script');
-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
-
-		 end %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
-
-			 disp('launching solution sequence on remote cluster');
-			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
-			 else
-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
-			 end
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end %}}}
-		 function Download(cluster,dirname,filelist)% {{{
-
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
-
-		 end %}}}
+	properties (SetAccess=public)
+		% {{{
+		name          = 'ls5.tacc.utexas.edu'
+		login         = '';
+		modules        = {'intel/18.0.2' 'gsl'};
+		numnodes      = 1;
+		cpuspernode   = 24;
+		port          = 1099;
+		queue         = 'normal';
+		codepath      = '';
+		executionpath = '';
+		interactive   = 0;
+		time          = 48*60*60;
+		email         = '';
+	end
+	%}}}
+	methods
+		function cluster=lonestar(varargin) % {{{
+
+			%initialize cluster using default settings if provided
+			if (exist('lonestar_settings')==2), lonestar_settings; end
+
+			%use provided options to change fields
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    numnodes: %i',cluster.numnodes));
+			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			disp(sprintf('    np: %i',cluster.nprocs()));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+			disp(sprintf('    interactive: %i',cluster.interactive));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    email: %s',cluster.email));
+		end
+		%}}}
+		function numprocs=nprocs(cluster) % {{{
+			%compute number of processors
+			numprocs=cluster.numnodes*cluster.cpuspernode;
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+
+			available_queues={'normal','development'};
+			queue_requirements_time=[48*60*60 2*60*60];
+			queue_requirements_np=[4104 264];
+
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.nprocs(),cluster.time)
+
+			%Miscellaneous
+			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+		end
+		%}}}
+		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#$ -N %s\n',modelname);
+			fprintf(fid,'#$ -q %s \n',cluster.queue);
+			fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
+			fprintf(fid,'#$ -R y\n');
+			fprintf(fid,'#$ -m beas\n');
+			fprintf(fid,'#$ -o %s.outlog \n',modelname);
+			fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
+			fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.nprocs(),cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+
+			executable='issm.exe';
+			if isdakota,
+				version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
+				if (version>=6),
+					executable='issm_dakota.exe';
+				end
+			end
+			if isoceancoupling,
+				executable='issm_ocean.exe';
+			end
+
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#SBATCH -J %s \n',modelname);
+			fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
+			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+			fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
+			fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*max(cluster.nprocs()/cluster.numnodes,24));
+			fprintf(fid,'#SBATCH -N %i \n',cluster.numnodes);
+			fprintf(fid,'#SBATCH -t %02i:%02i:00 \n\n',floor(cluster.time/3600),floor(mod(cluster.time,3600)/60));
+			for i=1:numel(cluster.modules),
+				fprintf(fid,['module load ' cluster.modules{i} '\n']);
+			end
+
+			if isdakota,
+				fprintf(fid,'export KMP_AFFINITY="granularity=fine,compact,verbose" \n\n');
+			end
+
+			if length(find(cluster.email=='@'))>0
+				fprintf(fid,'#SBATCH --mail-user=%s \n',cluster.email);
+				fprintf(fid,'#SBATCH --mail-type=end \n\n');
+
+				%fprintf(fid,'ssh login1 "mail -s ''SLURM Jobid=${SLURM_JOBID} Name=${SLURM_JOB_NAME} Began on Lonestar 5.'' %s <<< ''Job Started'' " \n\n',cluster.email);
+			end
+
+			fprintf(fid,'export PATH="$PATH:."\n\n');
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+			fprintf(fid,'ibrun -np %i %s/%s %s %s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+
+			fclose(fid);
+
+			%in interactive mode, create a run file, and errlog and outlog file
+			if cluster.interactive,
+				fid=fopen([modelname '.run'],'w');
+				fprintf(fid,'ibrun -np %i %s/%s %s %s %s\n',cluster.nprocs(),executable,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+				if ~io_gather, %concatenate the output files:
+					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+				end
+				fclose(fid);
+				fid=fopen([modelname '.errlog'],'w');
+				fclose(fid);
+				fid=fopen([modelname '.outlog'],'w');
+				fclose(fid);
+			end
+		end %}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
+
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
+
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+
+		end %}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+
+			disp('launching solution sequence on remote cluster');
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
+			end
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function Download(cluster,dirname,filelist) % {{{
+
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/clusters/maui.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/maui.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/maui.m	(revision 26744)
@@ -1,3 +1,3 @@
-%MAUI class definition
+%MAUI cluster class definition
 %
 %   Usage:
@@ -7,146 +7,146 @@
 
 classdef maui
-    properties (SetAccess=public)  
-		 % {{{
-		 name           = 'maui'
-		 login          = '';
-		 numnodes       = 1;
-		 cpuspernode    = 8;
-		 port           = 0;
-		 projectaccount = '';
-		 partition      = 'nesi_research';
-		 codepath       = '';
-		 executionpath  = '';
-		 interactive    = 0;
-		 time           = 24*60;
-		 memory         = 2;
-	 end
-	 %}}}
-	 methods
-		 function cluster=maui(varargin) % {{{
+	properties (SetAccess=public)
+		% {{{
+		name           = 'maui'
+		login          = '';
+		numnodes       = 1;
+		cpuspernode    = 8;
+		port           = 0;
+		projectaccount = '';
+		partition      = 'nesi_research';
+		codepath       = '';
+		executionpath  = '';
+		interactive    = 0;
+		time           = 24*60;
+		memory         = 2;
+	end
+	%}}}
+	methods
+		function cluster=maui(varargin) % {{{
 
-			 %initialize cluster using default settings if provided
-			 if (exist('maui_settings')==2), maui_settings; end
+			%initialize cluster using default settings if provided
+			if (exist('maui_settings')==2), maui_settings; end
 
-			 %use provided options to change fields
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
-			 disp(sprintf('    projectaccount: %s',cluster.projectaccount));
-			 disp(sprintf('    partition: %s',cluster.partition));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-			 disp(sprintf('    interactive: %i',cluster.interactive));
-			 disp(sprintf('    time: %i',cluster.time));
-			 disp(sprintf('    memory: %i',cluster.memory));
-		 end
-		 %}}}
-		 function numprocs=np(cluster) % {{{
-			 %compute number of processors
-			 numprocs=cluster.numnodes*cluster.cpuspernode;
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+			%use provided options to change fields
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    numnodes: %i',cluster.numnodes));
+			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			disp(sprintf('    np: %i',cluster.nprocs()));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    projectaccount: %s',cluster.projectaccount));
+			disp(sprintf('    partition: %s',cluster.partition));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+			disp(sprintf('    interactive: %i',cluster.interactive));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    memory: %i',cluster.memory));
+		end
+		%}}}
+		function numprocs=nprocs(cluster) % {{{
+			%compute number of processors
+			numprocs=cluster.numnodes*cluster.cpuspernode;
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_partitions={'nesi_research'}
-			 partition_requirements_time=[24*60];
-			 partition_requirements_np=[80];
+			available_partitions={'nesi_research'}
+			partition_requirements_time=[24*60];
+			partition_requirements_np=[80];
 
-			 QueueRequirements(available_partitions,partition_requirements_time,partition_requirements_np,cluster.partition,cluster.np,1)
+			QueueRequirements(available_partitions,partition_requirements_time,partition_requirements_np,cluster.partition,cluster.nprocs(),1)
 
-			 %Miscelaneous
-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
-		 end
-		 %}}}
-		 function BuildKrigingQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
-			 error('not implemented yet');
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+			%Miscellaneous
+			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+		end
+		%}}}
+		function BuildKrigingQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+			error('not implemented yet');
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
-			 fprintf(fid,'#SBATCH --account=%s \n',cluster.projectaccount);
-			 fprintf(fid,'#SBATCH --partition=%s \n',cluster.partition);
-			 fprintf(fid,'#SBATCH --ntasks=%i  \n',cluster.numnodes);
-			 fprintf(fid,'#SBATCH --cpus-per-task=%i\n',cluster.cpuspernode);
-			 fprintf(fid,'#SBATCH --time=%i\n',cluster.time); %walltime is in minutes
-			 fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
-			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			 fprintf(fid,'module swap PrgEnv-cray PrgEnv-intel\n');
-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-			 fprintf(fid,'srun -n %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
+			fprintf(fid,'#SBATCH --account=%s \n',cluster.projectaccount);
+			fprintf(fid,'#SBATCH --partition=%s \n',cluster.partition);
+			fprintf(fid,'#SBATCH --ntasks=%i  \n',cluster.numnodes);
+			fprintf(fid,'#SBATCH --cpus-per-task=%i\n',cluster.cpuspernode);
+			fprintf(fid,'#SBATCH --time=%i\n',cluster.time); %walltime is in minutes
+			fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
+			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+			fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'module swap PrgEnv-cray PrgEnv-intel\n');
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+			fprintf(fid,'srun -n %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
 
-			 %in interactive mode, create a run file, and errlog and outlog file
-			 if cluster.interactive,
-				 fid=fopen([modelname '.run'],'w');
-				 fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-				 if ~io_gather, %concatenate the output files:
-					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-				 end
-				 fclose(fid);
-				 fid=fopen([modelname '.errlog'],'w');
-				 fclose(fid);
-				 fid=fopen([modelname '.outlog'],'w');
-				 fclose(fid);
-			 end
-		 end %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+			%in interactive mode, create a run file, and errlog and outlog file
+			if cluster.interactive,
+				fid=fopen([modelname '.run'],'w');
+				fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+				if ~io_gather, %concatenate the output files:
+					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+				end
+				fclose(fid);
+				fid=fopen([modelname '.errlog'],'w');
+				fclose(fid);
+				fid=fopen([modelname '.outlog'],'w');
+				fclose(fid);
+			end
+		end %}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 if cluster.interactive,
-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
-			 end
-			 system(compressstring);
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
 
-			 disp('uploading input file and queueing script');
-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
 
-		 end %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+		end %}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
 
-			 disp('launching solution sequence on remote cluster');
-			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
-			 else
-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
-			 end
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end %}}}
-		 function Download(cluster,dirname,filelist)% {{{
+			disp('launching solution sequence on remote cluster');
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
+			end
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function Download(cluster,dirname,filelist) % {{{
 
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
 
-		 end %}}}
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/clusters/pfe.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/pfe.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/pfe.m	(revision 26744)
@@ -1,3 +1,3 @@
-%PFE class definition
+%PFE cluster class definition
 %
 %   Usage:
@@ -7,9 +7,9 @@
 
 classdef pfe
-	properties (SetAccess=public)  
+	properties (SetAccess=public)
 		% {{{
 		name           = 'pfe'
 		login          = '';
-		modules        = {'comp-intel/2016.2.181' 'mpi-sgi/mpt'};
+		modules        = {'comp-intel/2016.2.181' 'mpt'};
 		numnodes       = 20;
 		cpuspernode    = 8;
@@ -21,5 +21,5 @@
 		codepath       = '';
 		executionpath  = '';
-		grouplist     = 's1690';
+		grouplist      = '';
 		interactive    = 0;
 		bbftp          = 0;
@@ -39,26 +39,27 @@
 		%}}}
 		function disp(cluster) % {{{
-			%  display the object
+			% display the object
 			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
 			disp(sprintf('    name: %s',cluster.name));
 			disp(sprintf('    login: %s',cluster.login));
-			modules=''; for i=1:length(cluster.modules), modules=[modules cluster.modules{i} ',']; end; modules=modules(1:end-1); 
-			disp(sprintf('    modules: %s',modules));
+			disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
+			disp(sprintf('    numnodes: %s',cluster.numnodes));
+			disp(sprintf('    cpuspernode: %s',cluster.cpuspernode));
+			disp(sprintf('    np: %i',cluster.nprocs()));
 			disp(sprintf('    port: %i',cluster.port));
-			disp(sprintf('    numnodes: %i',cluster.numnodes));
-			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
-			disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
-			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    queue: %i',cluster.queue));
 			disp(sprintf('    time: %i',cluster.time));
-			disp(sprintf('    processor: %s',cluster.processor));
-			disp(sprintf('    srcpath: %s ($ISSM_DIR on pfe)',cluster.srcpath));
-			disp(sprintf('    codepath: %s  ($ISSM_DIR/bin on pfe)',cluster.codepath));
-			disp(sprintf('    executionpath: %s  (directory containing issm.exe on pfe)',cluster.executionpath));
+			disp(sprintf('    processor: %i',cluster.processor));
+			disp(sprintf('    srcpath: %s',cluster.srcpath));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
 			disp(sprintf('    grouplist: %s',cluster.grouplist));
-			disp(sprintf('    interactive: %i',cluster.interactive));
-			disp(sprintf('    hyperthreading: %i',cluster.hyperthreading));
-		end
-		%}}}
-		function numprocs=np(cluster) % {{{
+			disp(sprintf('    interactive: %s',cluster.interactive));
+			disp(sprintf('    bbftp: %s',cluster.bbftp));
+			disp(sprintf('    numstreams: %s',cluster.numstreams));
+			disp(sprintf('    hyperthreading: %s',cluster.hyperthreading));
+		end
+		%}}}
+		function numprocs=nprocs(cluster) % {{{
 			%compute number of processors
 			numprocs=cluster.numnodes*cluster.cpuspernode;
@@ -71,5 +72,5 @@
 			queue_requirements_np=[2048 2048 150 150 2048];
 
-			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.nprocs(),cluster.time)
 
 			%now, check cluster.cpuspernode according to processor type
@@ -128,5 +129,5 @@
 			
 			else
-				md = checkmessage(md,'unknown processor type, should be ''bro'' or ''has'' or ''ivy'' or ''san'' or ''cas_ait''');
+				md = checkmessage(md,'unknown processor type, should be ''bro'', ''has'', ''ivy'', ''san'', or ''cas_ait''');
 			end
 
@@ -161,9 +162,9 @@
 			fprintf(fid,'#PBS -l select=%i:ncpus=%i:model=%s\n',cluster.numnodes,cluster.cpuspernode,cluster.processor);
 			fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
-			fprintf(fid,'#PBS -q %s \n',cluster.queue);
+			fprintf(fid,'#PBS -q %s\n',cluster.queue);
 			fprintf(fid,'#PBS -W group_list=%s\n',cluster.grouplist);
 			fprintf(fid,'#PBS -m e\n');
-			fprintf(fid,'#PBS -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
-			fprintf(fid,'#PBS -e %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
+			fprintf(fid,'#PBS -o %s/%s/%s.outlog \n',cluster.executionpath,dirname,modelname);
+			fprintf(fid,'#PBS -e %s/%s/%s.errlog \n\n',cluster.executionpath,dirname,modelname);
 			fprintf(fid,'. /usr/share/modules/init/bash\n\n');
 			for i=1:numel(cluster.modules), fprintf(fid,['module load ' cluster.modules{i} '\n']); end
@@ -176,7 +177,7 @@
 			fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,dirname);
 			if ~isvalgrind,
-				fprintf(fid,'/u/scicon/tools/bin/several_tries mpiexec -np %i /u/scicon/tools/bin/mbind.x -cs -n%i %s/%s %s %s %s\n',cluster.np,cluster.cpuspernode,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
-			else
-				fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+				fprintf(fid,'/u/scicon/tools/bin/toss3/several_tries mpiexec -np %i %s/%s %s %s/%s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,cluster.executionpath,dirname,modelname);
+			else
+				fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/%s %s %s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
 			end
 			if ~io_gather, %concatenate the output files:
@@ -190,10 +191,10 @@
 				if cluster.interactive==10,
 						fprintf(fid,'module unload mpi-mvapich2/1.4.1/gcc\n');
-						fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[pwd() '/run'],modelname);
+						fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,[pwd() '/run'],modelname);
 				else
 					if ~isvalgrind,
-						fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/Interactive' num2str(cluster.interactive)],modelname);
+						fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/Interactive' num2str(cluster.interactive)],modelname);
 					else
-						fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/Interactive' num2str(cluster.interactive)],modelname);
+						fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/%s %s %s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/Interactive' num2str(cluster.interactive)],modelname);
 					end
 				end
@@ -214,7 +215,7 @@
 
 			%what is the executable being called? 
-			executable='issm_slr.exe';
-
-			if ispc(), error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
+			executable='issm_slc.exe';
+
+			if ispc & ~ismingw, error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
 
 			%write queuing script 
@@ -318,5 +319,5 @@
 			fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
 			fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,modelname);
-			fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname); %FIXME
+			fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.nprocs(),cluster.codepath,[cluster.executionpath '/' modelname],modelname); %FIXME
 			if ~io_gather, %concatenate the output files:
 				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
@@ -328,7 +329,7 @@
 				fid=fopen([modelname '.run'],'w');
 				if ~isvalgrind,
-					fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
-				else
-					fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+					fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.nprocs(),cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+				else
+					fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/kriging.exe %s %s\n',cluster.nprocs(),cluster.codepath,[cluster.executionpath '/' modelname],modelname);
 				end
 				if ~io_gather, %concatenate the output files:
@@ -382,8 +383,8 @@
 
 		end %}}}
-		function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
 			%compress the files into one zip.
-			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			compressstring=['tar -zcf ' dirname '.tar.gz'];
 			for i=1:numel(filelist),
 				compressstring = [compressstring ' ' filelist{i}];
@@ -403,23 +404,16 @@
 			end
 
-			if ~cluster.bbftp,
+			if cluster.bbftp,
+				issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
+			else
 				issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
-			else
-				issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
-			end
-
-		end
-		%}}}
-		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
-
-			%lauch command, to be executed via ssh
-			if ~cluster.interactive, 
-				if ~isempty(restart)
-					launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
-				else
-					launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
-				end
-			else
+			end
+
+		end
+		%}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+
+			%launch command, to be executed via ssh
+			if cluster.interactive,
 				if ~isempty(restart)
 					launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive)];
@@ -431,4 +425,11 @@
 					end
 				end
+			else
+				if ~isempty(restart)
+					launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
+				else
+					launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz && qsub ' modelname '.queue '];
+				end
 			end
 
@@ -437,5 +438,5 @@
 		end
 		%}}}
-		function Download(cluster,dirname,filelist)% {{{
+		function Download(cluster,dirname,filelist) % {{{
 
 			%copy files from cluster to current directory
@@ -448,8 +449,8 @@
 			end
 
-			if ~cluster.bbftp,
+			if cluster.bbftp,
+				issmbbftpin(cluster.name, cluster.login, cluster.port, cluster.numstreams, directory, filelist);
+			else
 				issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
-			else
-				issmbbftpin(cluster.name, cluster.login, cluster.port, cluster.numstreams, directory, filelist);
 			end
 
Index: /issm/trunk/src/m/classes/clusters/pfe.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/pfe.py	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/pfe.py	(revision 26744)
@@ -1,29 +1,32 @@
 import subprocess
+
 from fielddisplay import fielddisplay
-from pairoptions import pairoptions
-from issmssh import issmssh
+from helpers import *
+from IssmConfig import IssmConfig
 from issmscpin import issmscpin
 from issmscpout import issmscpout
-from QueueRequirements import QueueRequirements
-from IssmConfig import IssmConfig
+from issmssh import issmssh
+from MatlabFuncs import *
+from pairoptions import pairoptions
 try:
     from pfe_settings import pfe_settings
 except ImportError:
-    print('You need pfe_settings.py to proceed, check presence and sys.path')
-
+    # print('You need pfe_settings.py to proceed, check presence and sys.path')
+    pass
+from QueueRequirements import QueueRequirements
 
 class pfe(object):
+    """PFE cluster class definition
+
+    Usage:
+        cluster = pfe()
+        cluster = pfe('np', 3)
+        cluster = pfe('np', 3, 'login', 'username')
     """
-    PFE cluster class definition
-
-       Usage:
-          cluster = pfe()
-          cluster = pfe('np', 3)
-          cluster = pfe('np', 3, 'login', 'username')
-    """
-
-    def __init__(self, *args):    # {{{
-        self.name = 'pfe'
+
+    def __init__(self, *args):  # {{{
+        self.name = ''
         self.login = ''
+        self.modules = ['comp-intel/2016.2.181', 'mpt']
         self.numnodes = 20
         self.cpuspernode = 8
@@ -31,9 +34,9 @@
         self.queue = 'long'
         self.time = 12 * 60
-        self.processor = 'bro'
+        self.processor = 'ivy'
         self.srcpath = ''
         self.codepath = ''
         self.executionpath = ''
-        self.grouplist = 's1010'
+        self.grouplist = ''
         self.interactive = 0
         self.bbftp = 0
@@ -41,44 +44,47 @@
         self.hyperthreading = 0
 
-        #use provided options to change fields
+        # Use provided options to change fields
         options = pairoptions(*args)
 
-        #initialize cluster using user settings if provided
-        self = pfe_settings(self)
-        self.np = self.nprocs()
-
-        #OK get other fields
+        # Initialize cluster using user settings if provided
+        try:
+            self = pfe_settings(self)
+        except NameError:
+            #print('pfe_settings.py not found, using default settings')
+            pass
+
+        # OK get other fields
         self = options.AssignObjectFields(self)
-
-    # }}}
-
-    def __repr__(self):    # {{{
-        #  display the object
-        s = "class pfe object:"
-        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'cpuspernode', 'number of nodes per CPUs'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'np', 'number of CPUs'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'port', 'machine access port'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'processor', 'type of processor'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', '$ISSM_DIR on pfe'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'directory containing issm.exe on pfe'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'grouplist', 'name of the group'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
-        s = "%s\n%s" % (s, fielddisplay(self, 'bbftp', ''))
-        s = "%s\n%s" % (s, fielddisplay(self, 'numstreams', ''))
-        s = "%s\n%s" % (s, fielddisplay(self, 'hyperthreading', ''))
+    # }}}
+
+    def __repr__(self):  # {{{
+        # Display the object
+        s = 'class pfe object\n'
+        s += '    name: {}\n'.format(self.name)
+        s += '    login: {}\n'.format(self.login)
+        s += '    modules: {}\n'.format(strjoin(self.modules, ', '))
+        s += '    numnodes: {}\n'.format(self.numnodes)
+        s += '    cpuspernode: {}\n'.format(self.cpuspernode)
+        s += '    np: {}\n'.format(self.nprocs())
+        s += '    port: {}\n'.format(self.port)
+        s += '    queue: {}\n'.format(self.queue)
+        s += '    time: {}\n'.format(self.time)
+        s += '    processor: {}\n'.format(self.processor)
+        s += '    srcpath: {}\n'.format(self.srcpath)
+        s += '    codepath: {}\n'.format(self.codepath)
+        s += '    executionpath: {}\n'.format(self.executionpath)
+        s += '    grouplist: {}\n'.format(self.grouplist)
+        s += '    interactive: {}\n'.format(self.interactive)
+        s += '    bbftp: {}\n'.format(self.bbftp)
+        s += '    numstreams: {}\n'.format(self.numstreams)
+        s += '    hyperthreading: {}\n'.format(self.hyperthreading)
         return s
     # }}}
 
-    def nprocs(self):    # {{{
-        self.np = self.numnodes * self.cpuspernode
-        return self.np
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):    # {{{
+    def nprocs(self):  # {{{
+        return self.numnodes * self.cpuspernode
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
         queuedict = {'long': [5 * 24 * 60, 2048],
                      'normal': [8 * 60, 2048],
@@ -87,32 +93,44 @@
         QueueRequirements(queuedict, self.queue, self.nprocs(), self.time)
 
-        #now, check cluster.cpuspernode according to processor type
-        if self.processor == 'har' or self.processor == 'neh':
-            if self.hyperthreading:
-                if not 0 < self.cpuspernode < 17:
-                    md = md.checkmessage('cpuspernode should be between 1 and 16 for ''neh'' and ''har'' processors in hyperthreading mode')
-            else:
-                if not 0 < self.cpuspernode < 9:
-                    md = md.checkmessage('cpuspernode should be between 1 and 8 for ''neh'' and ''har'' processors')
-
+        # Now, check cluster.cpuspernode according to processor type
+        if self.processor == 'ivy':
+            if self.hyperthreading:
+                if self.cpuspernode > 40 or self.cpuspernode < 1:
+                    md = md.checkmessage('cpuspernode should be between 1 and 40 for \'ivy\' processors in hyperthreading mode')
+            else:
+                if self.cpuspernode > 20 or self.cpuspernode < 1:
+                    md = md.checkmessage('cpuspernode should be between 1 and 20 for \'ivy\' processors')
         elif self.processor == 'bro':
             if self.hyperthreading:
-                if not 0 < self.cpuspernode < 57:
-                    md = md.checkmessage('cpuspernode should be between 1 and 56 for ''bro'' processors in hyperthreading mode')
-            else:
-                if not 0 < self.cpuspernode < 29:
-                    md = md.checkmessage('cpuspernode should be between 1 and 28 for ''bro'' processors')
-
-        elif self.processor == 'ivy':
-            if self.hyperthreading:
-                if not 0 < self.cpuspernode < 41:
-                    md = md.checkmessage('cpuspernode should be between 1 and 40 for ''ivy'' processors in hyperthreading mode')
-            else:
-                if not 0 < self.cpuspernode < 21:
-                    md = md.checkmessage('cpuspernode should be between 1 and 20 for ''ivy'' processors')
+                if self.cpuspernode > 56 or self.cpuspernode < 1:
+                    md = md.checkmessage('cpuspernode should be between 1 and 56 for \'bro\' processors in hyperthreading mode')
+            else:
+                if self.cpuspernode > 28 or self.cpuspernode < 1:
+                    md = md.checkmessage('cpuspernode should be between 1 and 28 for \'bro\' processors')
+        elif self.processor == 'has':
+            if self.hyperthreading:
+                if self.cpuspernode > 48 or self.cpuspernode < 1:
+                    md = md.checkmessage('cpuspernode should be between 1 and 48 for \'has\' processors in hyperthreading mode')
+            else:
+                if self.cpuspernode > 24 or self.cpuspernode < 1:
+                    md = md.checkmessage('cpuspernode should be between 1 and 24 for \'has\' processors')
+        elif self.processor == 'san':
+            if self.hyperthreading:
+                if self.cpuspernode > 32 or self.cpuspernode < 1:
+                    md = md.checkmessage('cpuspernode should be between 1 and 32 for \'san\' processors in hyperthreading mode')
+            else:
+                if self.cpuspernode > 16 or self.cpuspernode < 1:
+                    md = md.checkmessage('cpuspernode should be between 1 and 16 for \'san\' processors')
+        elif self.processor == 'cas_ait':
+            if self.hyperthreading:
+                if self.cpuspernode > 80 or self.cpuspernode < 1:
+                    md = md.checkmessage('cpuspernode should be between 1 and 80 for \'cas_ait\' processors in hyperthreading mode')
+            else:
+                if self.cpuspernode > 40 or self.cpuspernode < 1:
+                    md = md.checkmessage('cpuspernode should be between 1 and 40 for \'cas_ait\' processors')
         else:
-            md = md.checkmessage('unknown processor type, should be ''neh'', ''bro'' or ''har'' or ''ivy''')
-
-        #Miscellaneous
+            md = md.checkmessage('unknown processor type, should be \'bro\', \'has\', \'ivy\', \'san\', or \'cas_ait\'')
+
+        # Miscellaneous
         if not self.login:
             md = md.checkmessage('login empty')
@@ -125,11 +143,12 @@
         if not self.grouplist:
             md = md.checkmessage('grouplist empty')
-        if self.interactive == 1:
-            md = md.checkmessage('interactive mode not implemented')
 
         return self
     # }}}
 
-    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
+    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
+        if isgprof:
+            print('gprof not supported by cluster, ignoring...')
+
         executable = 'issm.exe'
         if isdakota:
@@ -141,52 +160,64 @@
             executable = 'issm_ocean.exe'
 
-    #write queuing script
+        # Write queuing script
         fid = open(modelname + '.queue', 'w')
-        fid.write('#PBS -S / bin / bash\n')
-        fid.write('#PBS -l select=%i:ncpus=%i:model=%s\n' % (self.numnodes, self.cpuspernode, self.processor))
-        fid.write('#PBS -l walltime=%i\n' % (self.time * 60))
-        fid.write('#PBS -q %s \n' % self.queue)
-        fid.write('#PBS -W group_list=%s\n' % self.grouplist)
+        fid.write('#PBS -S /bin/bash\n')
+        fid.write('#PBS -l select={}:ncpus={}:model={}\n'.format(self.numnodes, self.cpuspernode, self.processor))
+        fid.write('#PBS -l walltime={}\n'.format(self.time * 60)) # walltime is in seconds
+        fid.write('#PBS -q {} \n'.format(self.queue))
+        fid.write('#PBS -W group_list={}\n'.format(self.grouplist))
         fid.write('#PBS -m e\n')
-        fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
-        fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
-        fid.write('./usr/share/modules/init/bash\n\n')
-        fid.write('module load comp-intel/2015.0.090\n')
-        fid.write('module load mpi-sgi/mpt.2.11r13\n')
+        fid.write('#PBS -o {}/{}/{}.outlog \n'.format(self.executionpath, dirname, modelname))
+        fid.write('#PBS -e {}/{}/{}.errlog \n\n'.format(self.executionpath, dirname, modelname))
+        fid.write('. /usr/share/modules/init/bash\n\n')
+        for i in range(len(self.modules)):
+            fid.write('module load {}\n'.format(self.modules[i]))
         fid.write('export PATH="$PATH:."\n\n')
+        fid.write('export MPI_LAUNCH_TIMEOUT=520\n')
         fid.write('export MPI_GROUP_MAX=64\n\n')
-        fid.write('export ISSM_DIR="%s"\n' % self.srcpath)
-        fid.write('source $ISSM_DIR/etc/environment.sh\n')
+        fid.write('export ISSM_DIR="{}"\n'.format(self.srcpath)) # FIXME
+        fid.write('source $ISSM_DIR/etc/environment.sh\n') # FIXME
         fid.write('export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ISSM_DIR/externalpackages/petsc/install/lib"\n')
-        fid.write('cd %s/%s/ \n\n' % (self.executionpath, dirname))
-        fid.write('mpiexec - np %i %s/%s %s %s/%s %s\n' % (self.nprocs(), self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
+        fid.write('cd {}/{}/\n\n'.format(self.executionpath, dirname))
+        fid.write('mpiexec -np {} {}/{} {} {}/{} {}\n'.format(self.nprocs(), self.codepath, executable, solution, self.executionpath, dirname, modelname))
 
         fid.close()
-
-    # }}}
-
-    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
-        #compress the files into one zip.
-        compressstring = 'tar -zcf %s.tar.gz ' % dirname
+    # }}}
+
+    def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
+        # Compress the files into one zip
+        compressstring = 'tar -zcf {}.tar.gz'.format(dirname)
         for file in filelist:
-            compressstring += ' %s' % file
+            compressstring += ' {}'.format(file)
         subprocess.call(compressstring, shell=True)
 
         print('uploading input file and queueing script')
-        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
-
-    # }}}
-    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
+        directory = self.executionpath
+        issmscpout(self.name, directory, self.login, self.port, [dirname + '.tar.gz'])
+
+    # }}}
+    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
+        # Launch command, to be executed via ssh
+        if self.interactive:
+            if not isempty(restart):
+                launchcommand = 'cd {} /Interactive{}'.format(self.executionpath, self.interactive)
+            else:
+                if self.interactive == 10:
+                    launchcommand = 'cd {}/run && tar -zxf {}.tar.gz'.format(pwd(), dirname)
+                else:
+                    launchcommand = 'cd {} /Interactive{} && tar -zxf {}.tar.gz'.format(self.executionpath, self.interactive, dirname)
+        else:
+            if not isempty(restart):
+                launchcommand = 'cd {} && cd {} && qsub {}.queue'.format(self.executionpath, dirname, modelname)
+            else:
+                launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && mv ../{}.tar.gz ./ && tar -zxf {}.tar.gz  && qsub {}.queue'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+
         print('launching solution sequence on remote cluster')
-        if restart:
-            launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
-        else:
-            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
         issmssh(self.name, self.login, self.port, launchcommand)
 
     # }}}
-    def Download(self, dirname, filelist):    # {{{
-        #copy files from cluster to current directory
-        directory = '%s/%s/' % (self.executionpath, dirname)
+    def Download(self, dirname, filelist):  # {{{
+        # Copy files from cluster to current directory
+        directory = '{}/{}/'.format(self.executionpath, dirname)
         issmscpin(self.name, self.login, self.port, directory, filelist)
     # }}}
Index: /issm/trunk/src/m/classes/clusters/pollux.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/pollux.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/pollux.m	(revision 26744)
@@ -7,98 +7,98 @@
 
 classdef pollux
-    properties (SetAccess=public) 
-		 % {{{
-		 name='pollux'
-		 login='username';
-		 np=128;
-		 port=0;
-		 queue='shortp';
-		 time=180;
-		 codepath='/workc/edw/issm-2.0/bin'
-		 executionpath='/workc/edw/Testing/Execution'
-		 %}}}
-	 end
-	 methods
-		 function cluster=pollux(varargin) % {{{
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    np: %i',cluster.np));
-			 disp(sprintf('    queue: %s',cluster.queue));
-			 disp(sprintf('    time: %i',cluster.time));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+	properties (SetAccess=public)
+		% {{{
+		name='pollux'
+		login='username';
+		np=128;
+		port=0;
+		queue='shortp';
+		time=180;
+		codepath='/workc/edw/issm-2.0/bin'
+		executionpath='/workc/edw/Testing/Execution'
+		%}}}
+	end
+	methods
+		function cluster=pollux(varargin) % {{{
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    np: %i',cluster.np));
+			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_queues={'shortp','longp'};
-			 queue_requirements_time=[180 720];
-			 queue_requirements_np=[128 128];
+			available_queues={'shortp','longp'};
+			queue_requirements_time=[180 720];
+			queue_requirements_np=[128 128];
 
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/sh\n');
-			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
-			 fprintf(fid,'#PBS -N %s\n',modelname);
-			 fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np);
-			 if ~isempty(queue),
-				 fprintf(fid,'#PBS -q %s\n',cluster.queue);
-			 end
-			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
-			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
-			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
-			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
-			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
-			 fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-			 fclose(fid);
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/sh\n');
+			fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
+			fprintf(fid,'#PBS -N %s\n',modelname);
+			fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np);
+			if ~isempty(queue),
+				fprintf(fid,'#PBS -q %s\n',cluster.queue);
+			end
+			fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+			fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+			fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
+			fprintf(fid,'cd $PBS_O_WORKDIR\n');
+			fprintf(fid,'export OMP_NUM_THREADS=1\n');
+			fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+			fclose(fid);
 
-		 end
-		 %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart)% {{{
+		end
+		%}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart) % {{{
 
-			 disp('launching solution sequence on remote cluster');
-			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
-			 else
-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
-			 end
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+			disp('launching solution sequence on remote cluster');
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
+			end
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 if cluster.interactive,
-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
-			 end
-			 system(compressstring);
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
 
-		 end %}}}
-		 function Download(cluster,dirname,filelist)% {{{
+		end %}}}
+		function Download(cluster,dirname,filelist) % {{{
 
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
 
-		 end %}}}
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/clusters/raijin.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/raijin.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/raijin.m	(revision 26744)
@@ -7,119 +7,121 @@
 
 classdef raijin
-    properties (SetAccess=public)  
-		 % {{{
-		 name='';
-		 login='';
-		 np=0;
-                 mem=0;
-                 time=0;
-                 project='';
-                 email='';
-		 port=0;
-		 queue='';
-		 codepath='';
-		 executionpath='';
-                 modules={};
-	 end
-	 %}}}
-	 methods
-		 function cluster=raijin(varargin) % {{{
+	properties (SetAccess=public)
+		% {{{
+		name='';
+		login='';
+		np=0;
+		mem=0;
+		time=0;
+		project='';
+		email='';
+		port=0;
+		queue='';
+		codepath='';
+		executionpath='';
+		modules={};
+	end
+	%}}}
+	methods
+		function cluster=raijin(varargin) % {{{
 
-			 %initialize cluster using default settings if provided
-			 if (exist('raijin_settings')==2), raijin_settings; end
+			%initialize cluster using default settings if provided
+			if (exist('raijin_settings')==2), raijin_settings; end
 
-			 %use provided options to change fields
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    mem: %i',cluster.mem));
-			 disp(sprintf('    time: %i',cluster.time));
-			 disp(sprintf('    np: %i',cluster.np));
-			 disp(sprintf('    queue: %s',cluster.queue));
-                         disp(sprintf('    project: %s',cluster.project));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+			%use provided options to change fields
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    np: %i',cluster.np));
+			disp(sprintf('    mem: %i',cluster.mem));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    project: %s',cluster.project));
+			disp(sprintf('    email: %s',cluster.email));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+			disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_queues={'express', 'normal'};
-			 queue_requirements_time=[5*60 40*60];
-			 queue_requirements_np=[256 1024];
+			available_queues={'express', 'normal'};
+			queue_requirements_time=[5*60 40*60];
+			queue_requirements_np=[256 1024];
 
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
 
-			 %Miscelaneous
-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+			%Miscellaneous
+			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
 
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
-                     
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-                         fprintf(fid,'#PBS -S /bin/bash\n');
-                         fprintf(fid,'#PBS -P %s\n', cluster.project);
-                         fprintf(fid,'#PBS -q %s\n',cluster.queue);
-                         fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np);
-                         fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); % walltime is in seconds
-                         fprintf(fid,'#PBS -l mem=%igb\n', cluster.mem);
-                         fprintf(fid,'#PBS -M %s\n', cluster.email);
-                         fprintf(fid,'#PBS -o %s.outlog\n',(modelname));
-                         fprintf(fid,'#PBS -e %s.errlog\n',(modelname));
-                         fprintf(fid,'#PBS -l wd\n\n');
-                         fprintf(fid,'source ~/.bashrc\n');
-                         fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');
-                         for i=1:numel(cluster.modules)
-                             fprintf(fid,'module load %s\n', cluster.modules{i});
-                         end
-			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
-		 end %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 system(compressstring);
+			%write queuing script
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#PBS -S /bin/bash\n');
+			fprintf(fid,'#PBS -P %s\n', cluster.project);
+			fprintf(fid,'#PBS -q %s\n',cluster.queue);
+			fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np);
+			fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); % walltime is in seconds
+			fprintf(fid,'#PBS -l mem=%igb\n', cluster.mem);
+			fprintf(fid,'#PBS -M %s\n', cluster.email);
+			fprintf(fid,'#PBS -o %s.outlog\n',(modelname));
+			fprintf(fid,'#PBS -e %s.errlog\n',(modelname));
+			fprintf(fid,'#PBS -l wd\n\n');
+			fprintf(fid,'source ~/.bashrc\n');
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');
+			for i=1:numel(cluster.modules)
+				fprintf(fid,'module load %s\n', cluster.modules{i});
+			end
+			fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
+		end %}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
-			 disp('uploading input file and queueing script');
-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			system(compressstring);
 
-		 end %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
-                         
-			 disp('launching solution sequence on remote cluster');
-			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
-			 else
-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
-			 end
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end %}}}
-		 function Download(cluster,dirname,filelist)% {{{
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
 
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+		end %}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+			
+			disp('launching solution sequence on remote cluster');
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
+			end
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function Download(cluster,dirname,filelist) % {{{
 
-		 end %}}}
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/clusters/saga.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/saga.py	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/saga.py	(revision 26744)
@@ -1,11 +1,13 @@
+import datetime
 import subprocess
+
 from fielddisplay import fielddisplay
-from pairoptions import pairoptions
-from issmssh import issmssh
+from helpers import *
+from IssmConfig import IssmConfig
 from issmscpin import issmscpin
 from issmscpout import issmscpout
+from issmssh import issmssh
+from pairoptions import pairoptions
 from QueueRequirements import QueueRequirements
-from IssmConfig import IssmConfig
-import datetime
 try:
     from saga_settings import saga_settings
@@ -15,10 +17,10 @@
 
 class saga(object):
-    """
-    Saga cluster class definition
+    """SAGA cluster class definition
+
     This is a SLURM queue
 
-       Usage:
-          cluster = saga()
+    Usage:
+        cluster = saga()
     """
 
@@ -44,9 +46,9 @@
         self.valgrind = '/cluster/software/Valgrind/3.16.1-gompi-2019b/bin/valgrind'
 
-    #use provided options to change fields
+        # Use provided options to change fields
         options = pairoptions(*args)
-    #initialize cluster using user settings if provided
+        # Initialize cluster using user settings if provided
         self = saga_settings(self)
-    #OK get other fields
+        # OK get other fields
         self = options.AssignObjectFields(self)
         self.np = self.numnodes * self.cpuspernode
@@ -54,5 +56,5 @@
 
     def __repr__(self):  # {{{
-        #  display the object
+        # Display the object
         s = "class vilje object:"
         s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
@@ -72,5 +74,5 @@
 
     def checkconsistency(self, md, solution, analyses):  # {{{
-        #Queue dictionarry  gives queue name as key and max walltime, cpus and memory (GB) as var
+        # Queue dictionarry  gives queue name as key and max walltime, CPUs, and memory (GB) as var
         queuedict = {'normal': [7 * 24 * 60, 256, 8],
                      'bigmem': [14 * 24 * 60, 256, 10],
@@ -78,5 +80,5 @@
         QueueRequirements(queuedict, self.queue, self.np, self.time)
 
-    #Miscelaneous
+        # Miscellaneous
         if not self.login:
             md = md.checkmessage('login empty')
@@ -91,5 +93,4 @@
 
     def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
-
         executable = 'issm.exe'
         if isdakota:
@@ -100,5 +101,5 @@
         if isoceancoupling:
             executable = 'issm_ocean.exe'
-    #write queuing script
+        # Write queuing script
         shortname = modelname[0:min(12, len(modelname))]
         timeobj = datetime.timedelta(minutes=self.time)
@@ -146,29 +147,29 @@
     # }}}
     def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
-        #compress the files into one zip.
+        # Compress the files into one zip
         compressstring = 'tar -zcf %s.tar.gz ' % dirname
         for file in filelist:
-            compressstring += ' %s' % file
+            compressstring += ' {}'.format(file)
         subprocess.call(compressstring, shell=True)
 
         print('uploading input file and queueing script')
         issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
-
     # }}}
 
     def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
-
         print('launching solution sequence on remote cluster')
-        if restart:
+        if not isempty(restart):
             launchcommand = 'cd %s && cd %s && sbatch %s.queue' % (self.executionpath, dirname, modelname)
         else:
             launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && sbatch %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
         issmssh(self.name, self.login, self.port, launchcommand)
-
     # }}}
 
     def Download(self, dirname, filelist):  # {{{
-        #copy files from cluster to current directory
+        # Copy files from cluster to current directory
         directory = '%s/%s/' % (self.executionpath, dirname)
-        issmscpin(self.name, self.login, self.port, directory, filelist)
-    # }}}
+        try:
+            issmscpin(self.name, self.login, self.port, directory, filelist)
+        except OSError:
+            print("File does not exsit, skiping")
+            # }}}
Index: /issm/trunk/src/m/classes/clusters/sherlock.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/sherlock.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/sherlock.m	(revision 26744)
@@ -1,3 +1,3 @@
-%PFE class definition
+%SHERLOCK cluster class definition
 %
 %   Usage:
@@ -7,154 +7,154 @@
 
 classdef sherlock
-    properties (SetAccess=public)  
-		 % {{{
-		 name          = 'sherlock'
-		 login         = '';
-		 numnodes      = 1;
-		 cpuspernode   = 24;
-		 port          = 0;
-		 codepath      = '';
-		 executionpath = '';
-		 interactive   = 0;
-		 time          = 30;
-		 memory        = 2;
-	 end
-	 %}}}
-	 methods
-		 function cluster=sherlock(varargin) % {{{
+	properties (SetAccess=public)
+		% {{{
+		name          = 'sherlock'
+		login         = '';
+		numnodes      = 1;
+		cpuspernode   = 24;
+		port          = 0;
+		codepath      = '';
+		executionpath = '';
+		interactive   = 0;
+		time          = 30;
+		memory        = 2;
+	end
+	%}}}
+	methods
+		function cluster=sherlock(varargin) % {{{
 
-			 %initialize cluster using default settings if provided
-			 if (exist('sherlock_settings')==2), sherlock_settings; end
+			%initialize cluster using default settings if provided
+			if (exist('sherlock_settings')==2), sherlock_settings; end
 
-			 %use provided options to change fields
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-			 disp(sprintf('    interactive: %i',cluster.interactive));
-			 disp(sprintf('    time: %i',cluster.time));
-			 disp(sprintf('    memory: %i',cluster.memory));
-		 end
-		 %}}}
-		 function numprocs=np(cluster) % {{{
-			 %compute number of processors
-			 numprocs=cluster.numnodes*cluster.cpuspernode;
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+			%use provided options to change fields
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    numnodes: %i',cluster.numnodes));
+			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			disp(sprintf('    np: %i',cluster.nprocs()));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+			disp(sprintf('    interactive: %i',cluster.interactive));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    memory: %i',cluster.memory));
+		end
+		%}}}
+		function numprocs=nprocs(cluster) % {{{
+			%compute number of processors
+			numprocs=cluster.numnodes*cluster.cpuspernode;
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 %Miscelaneous
-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+			%Miscellaneous
+			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
 
-		 end
-		 %}}}
-		 function BuildKrigingQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+		end
+		%}}}
+		function BuildKrigingQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#SBATCH --job-name=%s\n',mdelname);
-			 fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
-			 fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
-			 fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
-			 fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
-			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-			 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#SBATCH --job-name=%s\n',mdelname);
+			fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
+			fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
+			fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
+			fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
+			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+			fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+			fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.nprocs(),cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/bash\n');
-			 fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
-			 fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
-			 fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
-			 fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
-			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-			 fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
+			fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
+			fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
+			fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
+			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+			fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+			fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
 
-			 %in interactive mode, create a run file, and errlog and outlog file
-			 if cluster.interactive,
-				 fid=fopen([modelname '.run'],'w');
-				 fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-				 if ~io_gather, %concatenate the output files:
-					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-				 end
-				 fclose(fid);
-				 fid=fopen([modelname '.errlog'],'w');
-				 fclose(fid);
-				 fid=fopen([modelname '.outlog'],'w');
-				 fclose(fid);
-			 end
-		 end %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+			%in interactive mode, create a run file, and errlog and outlog file
+			if cluster.interactive,
+				fid=fopen([modelname '.run'],'w');
+				fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+				if ~io_gather, %concatenate the output files:
+					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+				end
+				fclose(fid);
+				fid=fopen([modelname '.errlog'],'w');
+				fclose(fid);
+				fid=fopen([modelname '.outlog'],'w');
+				fclose(fid);
+			end
+		end %}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 if cluster.interactive,
-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
-			 end
-			 system(compressstring);
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
 
-			 disp('uploading input file and queueing script');
-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			disp('uploading input file and queueing script');
+			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
 
-		 end %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+		end %}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
 
-			 disp('launching solution sequence on remote cluster');
-			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
-			 else
-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
-			 end
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end %}}}
-		 function Download(cluster,dirname,filelist)% {{{
+			disp('launching solution sequence on remote cluster');
+			if ~isempty(restart)
+				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
+			end
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function Download(cluster,dirname,filelist) % {{{
 
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
 
-		 end %}}}
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/clusters/smce_eis.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/smce_eis.py	(revision 26744)
+++ /issm/trunk/src/m/classes/clusters/smce_eis.py	(revision 26744)
@@ -0,0 +1,216 @@
+import os
+import shutil
+import subprocess
+
+try:
+    from smce_eis_settings import smce_eis_settings
+except ImportError:
+    print('You need smce_eis_settings.py to proceed, check presence and sys.path')
+from fielddisplay import fielddisplay
+from helpers import *
+from IssmConfig import IssmConfig
+from issmssh import issmssh
+from MatlabFuncs import *
+from pairoptions import pairoptions
+
+class smce_eis(object):
+    """SMCE_EIS cluster class definition
+
+    Usage:
+        cluster = smce_eis()
+        cluster = smce_eis('np', 3)
+        cluster = smce_eis('np', 3, 'login', 'username')
+    """
+
+    def __init__(self, *args):  # {{{
+        self.name = '52.54.75.45'
+        self.login = 'jdquinn1'
+        self.idfile = '~/.ssh/smce-aws-eis-pilot'
+        self.modules = []
+        self.numnodes = 8
+        self.cpuspernode = 1
+        self.port = 0
+        self.time = 12 * 60 * 60
+        self.processor = 'skylake'
+        self.srcpath = '/shared/issm/issm/trunk-jpl'
+        self.codepath = '/shared/issm/issm/trunk-jpl/bin'
+        self.executionpath = '/home/jdquinn1/issm-exec'
+        self.interactive = 0
+        self.numstreams = 1
+        self.hyperthreading = 0
+        self.email = ''
+
+        # Use provided options to change fields
+        options = pairoptions(*args)
+
+        # Initialize cluster using user settings if provided
+        try:
+            self = smce_eis_settings(self)
+        except NameError:
+            print('smce_eis_settings.py not found, using default settings')
+
+        # OK get other fields
+        self = options.AssignObjectFields(self)
+    # }}}
+
+    def __repr__(self):  # {{{
+        # Display the object
+        s = 'class smce_eis object\n'
+        s += '    name: {}\n'.format(self.name)
+        s += '    login: {}\n'.format(self.login)
+        s += '    idfile: {}\n'.format(self.idfile)
+        s += '    modules: {}\n'.format(strjoin(self.modules, ', '))
+        s += '    numnodes: {}\n'.format(self.numnodes)
+        s += '    cpuspernode: {}\n'.format(self.cpuspernode)
+        s += '    np: {}\n'.format(self.nprocs())
+        s += '    port: {}\n'.format(self.port)
+        s += '    time: {}\n'.format(self.time)
+        s += '    processor: {}\n'.format(self.processor)
+        s += '    srcpath: {}\n'.format(self.srcpath)
+        s += '    codepath: {}\n'.format(self.codepath)
+        s += '    executionpath: {}\n'.format(self.executionpath)
+        s += '    interactive: {}\n'.format(self.interactive)
+        s += '    numstreams: {}\n'.format(self.numstreams)
+        s += '    hyperthreading: {}\n'.format(self.hyperthreading)
+        return s
+    # }}}
+
+    def nprocs(self):  # {{{
+        return self.numnodes * self.cpuspernode
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        # Now, check cluster.cpuspernode according to processor type
+        if self.processor == 'skylake':
+            if self.cpuspernode > 14 or self.cpuspernode < 1:
+                md = md.checkmessage('cpuspernode should be between 1 and 14 for \'skyw\' processors in hyperthreading mode')
+        else:
+            md = md.checkmessage('unknown processor type, should be \'skylake\'')
+
+        # Miscellaneous
+        if not self.login:
+            md = md.checkmessage('login empty')
+        if self.port:
+            md = md.checkmessage('port must be set to 0 as we do not have an SSH tunnel')
+        if not self.codepath:
+            md = md.checkmessage('codepath empty')
+        if not self.executionpath:
+            md = md.checkmessage('executionpath empty')
+
+        return self
+    # }}}
+
+    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
+        if isgprof:
+            print('gprof not supported by cluster, ignoring...')
+
+        executable = 'issm.exe'
+        if isdakota:
+            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
+            version = float(str(version[0]))
+            if version >= 6:
+                executable = 'issm_dakota.exe'
+        if isoceancoupling:
+            executable = 'issm_ocean.exe'
+
+        # Write queuing script
+        fid = open(modelname + '.queue', 'w')
+
+        fid.write('#!/bin/bash\n')
+        fid.write('#SBATCH --partition=hpc-spot \n')
+        fid.write('#SBATCH -J {} \n'.format(modelname))
+        fid.write('#SBATCH -o {}.outlog \n'.format(modelname))
+        fid.write('#SBATCH -e {}.errlog \n'.format(modelname))
+        fid.write('#SBATCH --nodes={} \n'.format(self.numnodes))
+        fid.write('#SBATCH --ntasks-per-node={} \n'.format(self.cpuspernode))
+        fid.write('#SBATCH --cpus-per-task={} \n'.format(self.numstreams))
+        fid.write('#SBATCH -t {:02d}:{:02d}:00 \n'.format(int(floor(self.time / 3600)), int(floor(self.time % 3600) / 60)))
+        if (self.email.find('@')>-1):
+            fid.write('#SBATCH --mail-user={} \n'.format(self.email))
+            fid.write('#SBATCH --mail-type=BEGIN,END,FAIL \n\n')
+        # for i in range(len(self.modules)):
+        #     fid.write('module load {}\n'.format(self.modules[i]))
+        fid.write('export MPI_GROUP_MAX=64\n\n')
+        fid.write('export MPI_UNBUFFERED_STDIO=true\n\n')
+        fid.write('export PATH="$PATH:/opt/slurm/bin"\n') # TODO: Figure out how to add this to PATH by sourcing environment script
+        fid.write('export PATH="$PATH:."\n\n')
+        fid.write('export ISSM_DIR="{}"\n'.format(self.srcpath)) # FIXME
+        fid.write('export HYDRA_HOST_FILE={}/{}/'.format(self.executionpath, dirname))
+        fid.write('${USER}-hydranodes-sj:${SLURM_JOB_ID}\n')
+        #fid.write('source /usr/share/modules/init/bash\n')
+        #fid.write('source /efs/spack-justin/share/spack/setup-env.sh\n')
+        #fid.write('module load gcc-9.3.0-gcc-9.3.0-ug2hqa3\n')
+        fid.write('touch ${HYDRA_HOST_FILE}\n')
+        fid.write('/efs/mrilee/snodelist/build/snodelist -m -f "%h%[:]c" >> ${HYDRA_HOST_FILE}\n')
+        fid.write('source $ISSM_DIR/etc/environment.sh\n') # FIXME
+        fid.write('cd {}/{}/\n\n'.format(self.executionpath, dirname))
+
+        fid.write('mpiexec -np {} {}/{} {} {}/{} {}\n'.format(self.nprocs(), self.codepath, executable, solution, self.executionpath, dirname, modelname))
+
+        if not io_gather: # concatenate the output files
+            fid.write('cat {}.outbin.* > {}.outbin'.format(modelname, modelname))
+        fid.close()
+
+        # In interactive mode, create a run file, and errlog and outlog file
+        if self.interactive:
+            fid = open(modelname + '.run', 'w')
+            if not isvalgrind:
+                fid.write('mpiexec -np {} {}/{} {} {}/{} {}\n'.format(self.nprocs(), self.codepath, executable, solution, self.executionpath, dirname, modelname))
+            else:
+                fid.write('mpiexec -np {} valgrind --leak-check=full {}/{} {} {}/{} {}\n'.format(self.nprocs(), self.codepath, executable, solution, self.executionpath, dirname, modelname))
+            if not io_gather: # concatenate the output files
+                fid.write('cat {}.outbin.* > {}.outbin'.format(modelname, modelname))
+            fid.close()
+            fid = open(modelname + '.errlog', 'w') # TODO: Change this to system call (touch <file>)?
+            fid.close()
+            fid = open(modelname + '.outlog', 'w') # TODO: Change this to system call (touch <file>)?
+            fid.close()
+    # }}}
+
+    def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
+        # Compress the files into one zip
+        compressstring = 'tar -zcf {}.tar.gz'.format(dirname)
+        for file in filelist:
+            compressstring += ' {}'.format(file)
+        if self.interactive:
+            compressstring += ' {}.run {}.errlog {}.outlog'.format(modelname, modelname, modelname)
+        subprocess.call(compressstring, shell=True)
+
+        print('uploading input file and queueing script')
+        if self.interactive:
+            directory = '{}/Interactive{}'.format(self.executionpath, self.interactive)
+        else:
+            directory = self.executionpath
+
+        # NOTE: Replacement for issmscpout(self.name, directory, self.login, self.port, ['{}.tar.gz'.format(dirname)])
+        copystring = 'cp {}.tar.gz /efs/issm-tmp/'.format(dirname, dirname)
+        subprocess.call(copystring, shell=True)
+    # }}}
+
+    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
+        if self.interactive:
+            if not isempty(restart):
+                launchcommand = 'cd {}/Interactive{}'.format(self.executionpath, self.interactive)
+            else:
+                launchcommand = 'cd {}/Interactive{} && tar -zxf {}.tar.gz'.format(self.executionpath, self.interactive, dirname)
+        else:
+            if not isempty(restart):
+                launchcommand = 'cd {} && cd {} && /opt/slurm/bin/sbatch {}.queue'.format(self.executionpath, dirname, modelname)
+            else:
+                launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && cp /efs/issm-tmp/{}.tar.gz ./ && tar -zxf {}.tar.gz && /opt/slurm/bin/sbatch {}.queue'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+
+        print('launching solution sequence on remote cluster')
+
+        # NOTE: Replacement for issmssh(self.name, self.login, self.port, launchcommand)
+        subprocess.call('ssh -l {} -i {} {} "{}"'.format(self.login, self.idfile, self.name, launchcommand), shell=True)
+    # }}}
+
+    def Download(self, dirname, filelist):  # {{{
+        # Copy files from cluster to current directory
+    
+        # NOTE: Replacement for issmscpin(self.name, self.login, self.port, directory, filelist)
+        directory = '{}/{}/'.format(self.executionpath, dirname)
+        fileliststr = "'{" + ','.join([str(x) for x in filelist]) + "}'"
+        downloadcommand = 'scp -T -i {} {}@{}:{} {}/.'.format(self.idfile, self.login, self.name, os.path.join(directory, fileliststr), os.getcwd())
+        subprocess.call(downloadcommand, shell=True) 
+    # }}}
Index: sm/trunk/src/m/classes/clusters/stallo.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/stallo.m	(revision 26743)
+++ 	(revision )
@@ -1,216 +1,0 @@
-%        Stallo cluster class definition
-%	        This is a SLURM queue
-%	        The priorities are given to:
-%	           - Large jobs
-%	           - Short jobs
-%	           - small number of job per user
-%
-%	        There are some 20cpu nodes and 16cpu nodes, with 32GB (a few with 128GB) mem per node, you can ask for part of a node if you need more memory.(1 node, 2 CPUS and 10GB per cpu for example)
-
-%   Usage:
-%      cluster=stallo();
-%      cluster=stallo('np',3);
-%      cluster=stallo('np',3,'login','username');
-
-%node task and cpu must be defined, ask andreas for his stallo.py?
-
-classdef stallo
-    properties (SetAccess=public)
-		 % {{{
-		 name           = 'stallo';
-		 login          = '';
-		 numnodes       = 2;
-		 cpuspernode    = 10;
-		 mem            = 1.5;
-		 queue          = 'normal';
-		 time           = 2*60;
-		 codepath       = '';
-		 executionpath  = '';
-		 interactive    = 0;
-		 port           = [];
-		 accountname    = '';
-		 profiling	= 0;
-		 bbftp          = 0;
-		 % }}}
-	 end
-	 methods
-		 function cluster=stallo(varargin) % {{{
-
-			 %initialize cluster using default settings if provided
-			 if (exist('stallo_settings')==2), stallo_settings; end
-
-			 %use provided options to change fields
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    accountname: %s',cluster.accountname));
-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
-			 disp(sprintf('    cpuspernode: %i, cpu per nodes',cluster.cpuspernode));
-			 disp(sprintf('    queue: %s, name of the queue (normal (D), short,singlenode,multinode,devel)',cluster.queue));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-			 disp(sprintf('    interactive: %i',cluster.interactive));
-			 disp(sprintf('    time: %i, walltime requested in minutes',cluster.time));
-			 disp(sprintf('    memory: %i, memory per CPU',cluster.mem));
-			 disp(sprintf('    profiling: %i, enable profiling if 1 default is 0',cluster.profiling));
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
-
-			 available_queues={'short','normal','singlenode','multinode','devel'};
-			 queue_requirements_time=[60 2*24*60 28*24*60 28*24*60 4*60];
-			 queue_requirements_np=[2048 2048 20 2048 2048];
-
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
-
-			 %Miscelaneous
-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
-			 if isempty(cluster.accountname), md = checkmessage(md,'accountname empty'); end
-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
-
-		 end
-		 %}}}
-		 function numprocs=np(cluster) % {{{
-			 %compute number of processors
-			 numprocs=cluster.numnodes*cluster.cpuspernode;
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
-
-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
-
-			 executable='issm.exe';
-			 if isdakota,
-				 version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
-				 if (version>=6),
-					 executable='issm_dakota.exe';
-				 end
-			 end
-			 if isoceancoupling,
-				 executable='issm_ocean.exe';
-			 end
-
-			 days=floor(cluster.time/(60*24));
-			 hours=floor((cluster.time-(days*60*24))/60);
-			 minutes=floor(mod((cluster.time-(days*60*24)-(hours*60)),60));
-
-			 %write queuing script
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/bash -l\n');
-			 fprintf(fid,'#SBATCH --job-name=%s \n',modelname);
-			 fprintf(fid,'#SBATCH --qos=%s \n',cluster.queue);
-			 fprintf(fid,'#SBATCH --nodes=%i \n',cluster.numnodes);
-			 fprintf(fid,'#SBATCH --ntasks-per-node=%i \n',cluster.cpuspernode);
-			 fprintf(fid,'#SBATCH --time=%02i-%02i:%02i:00 \n',days,hours,minutes);
-			 fprintf(fid,'#SBATCH --mem-per-cpu=%iMB\n',1000*cluster.mem); % mem in MB
-			 if (mod(cluster.np,16)+mod(cluster.np,20))==0,
-			 	fprintf(fid,'#SBATCH --ntask=%i\n',cluster.np);
-			 end
-			 fprintf(fid,'#SBATCH --account=%s\n',cluster.accountname);
- 			 fprintf(fid,'#SBATCH -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
- 			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
-
- 			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath);%FIXME
- 			 fprintf(fid,'module purge\n');
- 			 fprintf(fid,'module load CMake/3.8.0-GCCcore-6.3.0\n');
- 			 fprintf(fid,'module load Automake/1.15.1-GCCcore-6.3.0\n');
- 			 fprintf(fid,'module load libtool/2.4.6\n');
- 			 fprintf(fid,'module load OpenSSL/1.1.0e-intel-2017a\n');
- 			 fprintf(fid,'module load PETSc/3.7.5-intel-2017a-downloaded-deps\n');
-
- 			 fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,dirname);
-			 if cluster.profiling==1,
-			 	fprintf(fid,'module load perf-report\n');
-			 	fprintf(fid,'perf-report mpirun -np %i %s/%s %s %s/%s %s\n',cluster.np,cluster.codepath,executable,solution,cluster.executionpath,dirname,modelname);
-			 else
-			 	fprintf(fid,'mpirun -np %i %s/%s %s %s/%s %s\n',cluster.np,cluster.codepath,executable,solution,cluster.executionpath,dirname,modelname);
-			 end
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
-
-			 %in interactive mode, create a run file, and errlog and outlog file
-			 if cluster.interactive,
-			 	 fid=fopen([modelname '.run'],'w');
-			 	 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-		 	 	 if ~io_gather, %concatenate the output files:
-			 		 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 	 end
-			 	 fclose(fid);
-			 	 fid=fopen([modelname '.errlog'],'w');
-			 	 fclose(fid);
-			 	 fid=fopen([modelname '.outlog'],'w');
-			 	 fclose(fid);
-			 end
-		 end
-		 %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
-
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 if cluster.interactive,
-				 compressstring = [compressstring ' ' modelname '.run '  modelname '.errlog ' modelname '.outlog '];
-			 end
-			 system(compressstring);
-			 disp('uploading input file and queueing script');
-			 if cluster.interactive==10,
-				 directory=[pwd() '/run/'];
-			 elseif cluster.interactive,
-				 directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive)];
-			 else
-				 directory=cluster.executionpath;
-			 end
-
-			 if ~cluster.bbftp,
-				 issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
-			 else
-				 issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
-
-			 end
-		 end %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
-
-			 %lauch command, to be executed via ssh
-			 if ~cluster.interactive,
-				 if ~isempty(restart)
-					 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && sbatch ' modelname '.queue '];
-				 else
-					 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-						 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && sbatch ' modelname '.queue '];
-				 end
-			 else
-				 if ~isempty(restart)
-					 launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive)];
-				 else
-					 if cluster.interactive==10,
-						 launchcommand=['cd ' pwd() '/run && tar -zxf ' dirname '.tar.gz'];
-					 else
-						 launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive) ' && tar -zxf ' dirname '.tar.gz'];
-					 end
-				 end
-			 end
-
-			 disp('launching solution sequence on remote cluster');
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end
-		 %}}}
-		 function Download(cluster,dirname,filelist)% {{{
-
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
-
-		 end %}}}
-	end
-end
Index: sm/trunk/src/m/classes/clusters/stallo.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/stallo.py	(revision 26743)
+++ 	(revision )
@@ -1,179 +1,0 @@
-import subprocess
-import numpy as np
-from fielddisplay import fielddisplay
-from pairoptions import pairoptions
-from issmssh import issmssh
-from issmscpin import issmscpin
-from issmscpout import issmscpout
-from QueueRequirements import QueueRequirements
-from IssmConfig import IssmConfig
-import datetime
-try:
-    from stallo_settings import stallo_settings
-except ImportError:
-    print('You need stallo_settings.py to proceed, check presence and sys.path')
-
-
-class stallo(object):
-    """
-    Stallo cluster class definition
-    This is a SLURM queue
-    The priorities are given to:
- - Large jobs
- - Short jobs
- - small number of job per user
-
-    There are some 20cpu nodes and 16cpu nodes, with 32GB (a few with 128GB) mem per node, you can ask for part of a node if you need more memory.(1 node, 2 CPUS and 10GB per cpu for example)
-
-
-       Usage:
-          cluster = stallo()
-    """
-
-    def __init__(self, *args):  # {{{
-        self.name = 'stallo'
-        self.login = ''
-        self.numnodes = 2
-        self.cpuspernode = 20
-        self.mem = 1.6
-        self.queue = 'normal'
-        self.time = 2 * 60
-        self.codepath = ''
-        self.executionpath = ''
-        self.interactive = 0
-        self.port = []
-        self.accountname = ''
-        self.profiling = 0
-        self.exclusive = False
-    #use provided options to change fields
-        options = pairoptions(*args)
-    #initialize cluster using user settings if provided
-        self = stallo_settings(self)
-    #OK get other fields
-        self = options.AssignObjectFields(self)
-        self.np = self.numnodes * self.cpuspernode
-    # }}}
-
-    def __repr__(self):  # {{{
-        #  display the object
-        s = "class vilje object:"
-        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'cpuspernode', 'number of CPUs per nodes'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'mem', 'memory per CPU'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue (normal (D), short, singlenode, multinode, devel)'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
-        s = "%s\n%s" % (s, fielddisplay(self, 'accountname', 'your cluster account'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'profiling', 'enable profiling if 1 default is 0'))
-        return s
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        #Queue dictionarry  gives queue name as key and max walltime and cpus as var
-        queuedict = {'short': [2 * 24 * 60, 2048],
-                     'normal': [5 * 24 * 60, 2048],
-                     'singlenode': [28 * 24 * 60, 20],
-                     'multinode': [28 * 24 * 60, 2048],
-                     'devel': [4 * 60, 2048]}
-        QueueRequirements(queuedict, self.queue, self.np, self.time)
-
-    #Miscelaneous
-        if not self.login:
-            md = md.checkmessage('login empty')
-        if not self.codepath:
-            md = md.checkmessage('codepath empty')
-        if not self.executionpath:
-            md = md.checkmessage('executionpath empty')
-        if self.interactive == 1:
-            md = md.checkmessage('interactive mode not implemented')
-        return self
-    # }}}
-
-    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
-
-        executable = 'issm.exe'
-        if isdakota:
-            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
-            version = float(version)
-            if version >= 6:
-                executable = 'issm_dakota.exe'
-        if isoceancoupling:
-            executable = 'issm_ocean.exe'
-    #write queuing script
-        shortname = modelname[0:min(12, len(modelname))]
-        timeobj = datetime.timedelta(minutes=self.time)
-        m, s = divmod(timeobj.total_seconds(), 60)
-        h, m = divmod(m, 60)
-        d, h = divmod(h, 24)
-        timestring = "%02d-%02d:%02d:%02d" % (d, h, m, s)
-        print('timestring')
-        fid = open(modelname + '.queue', 'w')
-        fid.write('#!/bin/bash -l\n')
-        fid.write('#SBATCH --job-name=%s \n' % shortname)
-        if self.queue in ['devel', 'short']:
-            fid.write('#SBATCH --qos=%s \n' % self.queue)
-        else:
-            fid.write('#SBATCH --partition=%s \n' % self.queue)
-            if self.time < 2 * 24 * 60:
-                fid.write('#SBATCH --qos=short \n')
-        fid.write('#SBATCH --nodes=%i \n' % self.numnodes)
-        fid.write('#SBATCH --ntasks-per-node=%i \n' % self.cpuspernode)
-        fid.write('#SBATCH --time={}\n'.format(timestring))  #walltime is minutes
-        fid.write('#SBATCH --mem-per-cpu={}MB\n'.format(int(1000 * self.mem)))  # mem is in MB
-        if (np.mod(self.np, 16) + np.mod(self.np, 20)) == 0:
-            fid.write('  #SBATCH --ntask=%i\n' % self.np)
-        fid.write('#SBATCH --account=%s\n' % self.accountname)
-        fid.write('#SBATCH --output %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
-        fid.write('#SBATCH --error %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
-        if self.exclusive:
-            fid.write('#SBATCH --exclusive \n')
-
-        fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
-        fid.write('module purge\n')
-        fid.write('module load CMake/3.8.0-GCCcore-6.3.0\n')
-        fid.write('module load Automake/1.15.1-GCCcore-6.3.0\n')
-        fid.write('module load libtool/2.4.6\n')
-        fid.write('module load OpenSSL/1.1.0e-intel-2017a\n')
-        fid.write('module load PETSc/3.7.5-intel-2017a-downloaded-deps\n')
-
-        fid.write('cd %s/%s/ \n\n' % (self.executionpath, dirname))
-        if self.profiling == 1:
-            fid.write('module load perf-report\n')
-            fid.write('perf-report mpirun -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
-        else:
-            fid.write('mpirun -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
-        fid.close()
-
-    # }}}
-    def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
-        #compress the files into one zip.
-        compressstring = 'tar -zcf %s.tar.gz ' % dirname
-        for file in filelist:
-            compressstring += ' %s' % file
-        subprocess.call(compressstring, shell=True)
-
-        print('uploading input file and queueing script')
-        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
-
-    # }}}
-
-    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
-
-        print('launching solution sequence on remote cluster')
-        if restart:
-            launchcommand = 'cd %s && cd %s && sbatch %s.queue' % (self.executionpath, dirname, modelname)
-        else:
-            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && sbatch %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
-        issmssh(self.name, self.login, self.port, launchcommand)
-
-    # }}}
-
-    def Download(self, dirname, filelist):  # {{{
-        #copy files from cluster to current directory
-        directory = '%s/%s/' % (self.executionpath, dirname)
-        issmscpin(self.name, self.login, self.port, directory, filelist)
-    # }}}
Index: /issm/trunk/src/m/classes/clusters/tetralith.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/tetralith.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/tetralith.m	(revision 26744)
@@ -1,3 +1,3 @@
-%teralith class definition
+%TERALITH cluster class definition
 %
 %   Usage:
@@ -7,5 +7,5 @@
 
 classdef tetralith
-	properties (SetAccess=public)  
+	properties (SetAccess=public)
 		% {{{
 		name           = 'tetralith';
@@ -38,14 +38,15 @@
 			disp(sprintf('    name: %s',cluster.name));
 			disp(sprintf('    login: %s',cluster.login));
-			disp(sprintf('    accountname: %s',cluster.accountname));
 			disp(sprintf('    numnodes: %i',cluster.numnodes));
 			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
-			disp(sprintf('    np: %i', cluster.cpuspernode*cluster.numnodes));
+			disp(sprintf('    np: %i',cluster.nprocs()));
+			disp(sprintf('    memory: %i',cluster.mem));
 			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    time: %i',cluster.time));
 			disp(sprintf('    codepath: %s',cluster.codepath));
 			disp(sprintf('    executionpath: %s',cluster.executionpath));
 			disp(sprintf('    interactive: %i',cluster.interactive));
-			disp(sprintf('    time: %i',cluster.time));
-			disp(sprintf('    memory: %i',cluster.mem));
+			disp(sprintf('    port: %s',cluster.port));
+			disp(sprintf('    accountname: %s',cluster.accountname));
 		end
 		%}}}
@@ -56,7 +57,7 @@
 			queue_requirements_np=[1024 2*32];
 
-			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
-
-			%Miscelaneous
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.nprocs(),1)
+
+			%Miscellaneous
 			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
 			if isempty(cluster.accountname), md = checkmessage(md,'accountname empty'); end
@@ -66,5 +67,5 @@
 		end
 		%}}}
-		function numprocs=np(self) % {{{
+		function numprocs=nprocs(self) % {{{
 			%compute number of processors
 			numprocs=self.numnodes*self.cpuspernode;
@@ -78,5 +79,5 @@
 			%compute number of processors
 % 			cluster.np=cluster.numnodes*cluster.cpuspernode;
-			np(cluster);%=cluster.numnodes*cluster.cpuspernode;
+%			nprocs(cluster);%=cluster.numnodes*cluster.cpuspernode;
 
 			%write queuing script 
@@ -104,12 +105,12 @@
 			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
 			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-% 			fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+% 			fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
 % 			fprintf(fid,'mpiexec_mpt -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
-			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-% 			fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-			 if ~io_gather, %concatenate the output files:
-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
-			 fclose(fid);
+			fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+% 			fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+			if ~io_gather, %concatenate the output files:
+				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			end
+			fclose(fid);
 		end
 		%}}}
@@ -132,5 +133,5 @@
 			%compute number of processors
 % 			cluster.np=cluster.numnodes*cluster.cpuspernode;
-			np(cluster);%=cluster.numnodes*cluster.cpuspernode;                     
+			nprocs(cluster);%=cluster.numnodes*cluster.cpuspernode;
 % 			shortname = substring(modelname,1,min(12,length(modelname)));
 
@@ -159,8 +160,8 @@
 			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
 			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-% 			fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
-			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-% 			fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-% 			fprintf(fid,'mpiexec_mpt -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+% 			fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+			fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+% 			fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+% 			fprintf(fid,'mpiexec_mpt -np %i %s/%s %s %s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
 
 			if ~io_gather, %concatenate the output files:
@@ -172,5 +173,5 @@
 			if cluster.interactive,
 				fid=fopen([modelname '.run'],'w');
-				fprintf(fid,'mpiexec_mpt -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+				fprintf(fid,'mpiexec_mpt -np %i %s/issm.exe %s %s %s\n',cluster.nprocs(),cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
 				if ~io_gather, %concatenate the output files:
 					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
@@ -183,5 +184,5 @@
 			end
 		end %}}}
-		function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
 			%compress the files into one zip.
@@ -198,5 +199,5 @@
 		end
 		%}}}
-		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
 
 			disp('launching solution sequence on remote cluster');
@@ -206,5 +207,5 @@
 			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
 		end %}}}
-		function Download(cluster,dirname,filelist)% {{{
+		function Download(cluster,dirname,filelist) % {{{
 
 			%copy files from cluster to current directory
Index: sm/trunk/src/m/classes/clusters/vilje.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/vilje.m	(revision 26743)
+++ 	(revision )
@@ -1,209 +1,0 @@
-%vilje class definition
-%
-%   Usage:
-%      cluster=greenplanet();
-%      cluster=greenplanet('np',3);
-%      cluster=greenplanet('np',3,'login','username');
-
-classdef vilje
-	properties (SetAccess=public)  
-		% {{{
-		name           = 'vilje';
-		login          = '';
-		numnodes       = 2;
-		cpuspernode    = 32;
-		procspernodes  = 16;
-		mem            = 28;
-		numstreams		= 8; %Henning added
-		queue          = 'workq';
-		time           = 2*60;
-		codepath       = '';
-		executionpath  = '';
-		interactive    = 0;
-		port           = [];
-		accountname    = '';
-		% }}}
-	end
-	methods
-		function cluster=vilje(varargin) % {{{
-
-			%initialize cluster using default settings if provided
-			if (exist('vilje_settings')==2), vilje_settings; end
-
-			%use provided options to change fields
-			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		end
-		%}}}
-		function disp(cluster) % {{{
-			%  display the object
-			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			disp(sprintf('    name: %s',cluster.name));
-			disp(sprintf('    login: %s',cluster.login));
-			disp(sprintf('    accountname: %s',cluster.accountname));
-			disp(sprintf('    numnodes: %i',cluster.numnodes));
-			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
-			disp(sprintf('    np: %i', cluster.cpuspernode*cluster.numnodes));
-			disp(sprintf('    procspernodes: %i',cluster.procspernodes));
-			disp(sprintf('    queue: %s',cluster.queue));
-			disp(sprintf('    codepath: %s',cluster.codepath));
-			disp(sprintf('    executionpath: %s',cluster.executionpath));
-			disp(sprintf('    interactive: %i',cluster.interactive));
-			disp(sprintf('    time: %i',cluster.time));
-			disp(sprintf('    memory: %i',cluster.mem));
-		end
-		%}}}
-		function md = checkconsistency(cluster,md,solution,analyses) % {{{
-
-			available_queues={'workq'};
-			queue_requirements_time=[5*24*60];
-			queue_requirements_np=[30];
-
-			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
-
-			%Miscelaneous
-			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
-			if isempty(cluster.accountname), md = checkmessage(md,'accountname empty'); end
-			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
-			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
-
-		end
-		%}}}
-		function numprocs=np(self) % {{{
-			%compute number of processors
-			numprocs=self.numnodes*self.procspernodes;
-		end
-		%}}}
-		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
-
-			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
-
-			%compute number of processors
-% 			cluster.np=cluster.numnodes*cluster.cpuspernode;
-			np(cluster);%=cluster.numnodes*cluster.cpuspernode;
-
-			%write queuing script 
-			fid=fopen([modelname '.queue'],'w');
-			fprintf(fid,'#PBS -S /bin/bash\n');
-			fprintf(fid,'#PBS -N %s\n',modelname);
-			fprintf(fid,'#PBS -l select=%i:ncpus=%i:mpiprocs=%i\n',cluster.numnodes,cluster.cpuspernode,16);
-			
-			%calculate walltime in hh:mm:ss format
-			walltime=datestr(cluster.time/(60*24),'HH:MM:SS');
-			fprintf(fid,'#PBS -l walltime=%s\n',walltime); %walltime should be in hh:mm:ss
-			fprintf(fid,'#PBS -A %s\n',cluster.accountname);
-			fprintf(fid,'#PBS -o %s.outlog \n',modelname);
-			fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
-			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			fprintf(fid,'module load intelcomp/17.0.0\n') 
-			fprintf(fid,'module load mpt/2.14\n')
-			fprintf(fid,'module load petsc/3.7.4d\n')
-			fprintf(fid,'module load parmetis/4.0.3\n') 
-			fprintf(fid,'module load mumps/5.0.2\n')
-			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
-			fprintf(fid,'mpiexec_mpt -n %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
-			if ~io_gather, %concatenate the output files:
-				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			end
-			fclose(fid);
-		end
-		%}}}
-		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
-
-			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
-			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
-
-			executable='issm.exe';
-			if isdakota,
-				version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
-				if (version>=6),
-					executable='issm_dakota.exe';
-				end
-			end
-			if isoceancoupling,
-				executable='issm_ocean.exe';
-			end
-
-			%compute number of processors
-% 			cluster.np=cluster.numnodes*cluster.cpuspernode;
-			np(cluster);%=cluster.numnodes*cluster.cpuspernode;                     
-% 			shortname = substring(modelname,1,min(12,length(modelname)));
-
-			%write queuing script 
-			fid=fopen([modelname '.queue'],'w');
-			fprintf(fid,'#PBS -S /bin/bash\n');
-% 			fprintf(fid,'#PBS -N %s\n',shortname);
-			fprintf(fid,'#PBS -N %s\n',modelname);
-			fprintf(fid,'#PBS -q %s \n',cluster.queue);
-			fprintf(fid,'#PBS -l select=%i:ncpus=%i:mpiprocs=%i\n',cluster.numnodes,cluster.cpuspernode,cluster.procspernodes);
-
-			%calculate walltime in hh:mm:ss format
-			walltime=datestr(cluster.time/(60*24),'HH:MM:SS');
-% 			fprintf(fid,'#PBS -l walltime=%s\n',duration(0,cluster.time,0)); %walltime is in minutes.
-% 			fprintf(fid,'#PBS -l walltime=%s\n',10); %walltime is in minutes.
-			fprintf(fid,'#PBS -l walltime=%s\n',walltime); %walltime should be in hh:mm:ss
-% 			fprintf(fid,'#PBS -l walltime=%i\n',walltime); %walltime is in hh:mm:ss
-			fprintf(fid,'#PBS -A %s\n',cluster.accountname);
-			fprintf(fid,'#PBS -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
-			fprintf(fid,'#PBS -e %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
-			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
-			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
-			fprintf(fid,'module load intelcomp/17.0.0\n') 
-			fprintf(fid,'module load mpt/2.14\n')
-			fprintf(fid,'module load petsc/3.7.4d\n')
-			fprintf(fid,'module load parmetis/4.0.3\n') 
-			fprintf(fid,'module load mumps/5.0.2\n')
-			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-			fprintf(fid,'mpiexec_mpt -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
-
-			if ~io_gather, %concatenate the output files:
-				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-			end
-			fclose(fid);
-
-			%in interactive mode, create a run file, and errlog and outlog file
-			if cluster.interactive,
-				fid=fopen([modelname '.run'],'w');
-				fprintf(fid,'mpiexec_mpt -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
-				if ~io_gather, %concatenate the output files:
-					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
-				end
-				fclose(fid);
-				fid=fopen([modelname '.errlog'],'w');
-				fclose(fid);
-				fid=fopen([modelname '.outlog'],'w');
-				fclose(fid);
-			end
-		end %}}}
-		function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
-
-			%compress the files into one zip.
-			compressstring=['tar -zcf ' dirname '.tar.gz '];
-			for i=1:numel(filelist),
-				compressstring = [compressstring ' ' filelist{i}];
-			end
-			system(compressstring);
-			disp('uploading input file and queueing script');
-			directory=cluster.executionpath;
-% 			issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
-			issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
-
-		end
-		%}}}
-		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
-
-			disp('launching solution sequence on remote cluster');
-			launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-				' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
-			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		end %}}}
-		function Download(cluster,dirname,filelist)% {{{
-
-			%copy files from cluster to current directory
-			directory=[cluster.executionpath '/' dirname '/'];
-			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
-
-		end %}}}
-	end
-end
Index: sm/trunk/src/m/classes/clusters/vilje.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/vilje.py	(revision 26743)
+++ 	(revision )
@@ -1,145 +1,0 @@
-import subprocess
-from fielddisplay import fielddisplay
-from pairoptions import pairoptions
-from issmssh import issmssh
-from issmscpin import issmscpin
-from issmscpout import issmscpout
-from QueueRequirements import QueueRequirements
-from IssmConfig import IssmConfig
-import datetime
-try:
-    from vilje_settings import vilje_settings
-except ImportError:
-    print('You need vilje_settings.py to proceed, check presence and sys.path')
-
-
-class vilje(object):
-    """
-    Vilje cluster class definition
-
-       Usage:
-          cluster = vilje()
-    """
-
-    def __init__(self, *args):    # {{{
-        self.name = 'vilje'
-        self.login = ''
-        self.numnodes = 2
-        self.cpuspernode = 32
-        self.procspernodes = 16
-        self.mem = 28
-        self.queue = 'workq'
-        self.time = 2 * 60
-        self.codepath = ''
-        self.executionpath = ''
-        self.interactive = 0
-        self.port = []
-        self.accountname = ''
-
-    #use provided options to change fields
-        options = pairoptions(*args)
-
-    #initialize cluster using user settings if provided
-        self = vilje_settings(self)
-    #OK get other fields
-        self = options.AssignObjectFields(self)
-        self.np = self.numnodes * self.procspernodes
-    # }}}
-
-    def __repr__(self):    # {{{
-        #  display the object
-        s = "class vilje object:"
-        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'cpuspernode', 'number of nodes per CPUs (32)'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'procspernodes', 'number of mpi procs per nodes'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'mem', 'node memory'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue (test is an option, workq the default)'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
-        s = "%s\n%s" % (s, fielddisplay(self, 'accountname', 'your cluster account'))
-        return s
-    # }}}
-
-    def checkconsistency(self, md, solution, analyses):    # {{{
-        #Queue dictionarry  gives queu name as key and max walltime and cpus as var
-        queuedict = {'workq': [5 * 24 * 60, 30],
-                     'test': [30, 4]}
-        QueueRequirements(queuedict, self.queue, self.np, self.time)
-
-    #Miscelaneous
-        if not self.login:
-            md = md.checkmessage('login empty')
-        if not self.codepath:
-            md = md.checkmessage('codepath empty')
-        if not self.executionpath:
-            md = md.checkmessage('executionpath empty')
-        if self.interactive == 1:
-            md = md.checkmessage('interactive mode not implemented')
-        return self
-    # }}}
-
-    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
-        executable = 'issm.exe'
-        if isdakota:
-            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
-            version = float(version)
-            if version >= 6:
-                executable = 'issm_dakota.exe'
-        if isoceancoupling:
-            executable = 'issm_ocean.exe'
-
-    #write queuing script
-        shortname = modelname[0:min(12, len(modelname))]
-        fid = open(modelname + '.queue', 'w')
-        fid.write('#PBS -S / bin / bash\n')
-        fid.write('#PBS -N %s \n' % shortname)
-        fid.write('#PBS -q %s \n' % self.queue)
-        fid.write('#PBS -l select=%i:ncpus=%i:mpiprocs=%s\n' % (self.numnodes, self.cpuspernode, self.procspernodes))
-        timeobj = datetime.timedelta(minutes=self.time)
-        m, s = divmod(timeobj.total_seconds(), 60)
-        h, m = divmod(m, 60)
-        timestring = "%02d:%02d:%02d" % (h, m, s)
-        fid.write('#PBS -l walltime=%s\n' % timestring)  #walltime is hh:mm:ss
-        fid.write('#PBS -A %s\n' % self.accountname)
-        fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
-        fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
-        fid.write('export ISSM_DIR="%s/../ "\n' % self.codepath)
-        fid.write('module load intelcomp/17.0.0\n')
-        fid.write('module load mpt/2.14\n')
-        fid.write('module load petsc/3.7.4d\n')
-        fid.write('module load parmetis/4.0.3\n')
-        fid.write('module load mumps/5.0.2\n')
-        fid.write('cd %s/%s/\n\n' % (self.executionpath, dirname))
-        fid.write('mpiexec_mpt -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
-        fid.close()
-    # }}}
-
-    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
-        #compress the files into one zip.
-        compressstring = 'tar -zcf %s.tar.gz ' % dirname
-        for file in filelist:
-            compressstring += ' %s' % file
-        subprocess.call(compressstring, shell=True)
-
-        print('uploading input file and queueing script')
-        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
-    # }}}
-
-    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
-        print('launching solution sequence on remote cluster')
-        if restart:
-            launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
-        else:
-            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
-        issmssh(self.name, self.login, self.port, launchcommand)
-    # }}}
-
-    def Download(self, dirname, filelist):    # {{{
-        #copy files from cluster to current directory
-        directory = '%s/%s/' % (self.executionpath, dirname)
-        issmscpin(self.name, self.login, self.port, directory, filelist)
-    # }}}
Index: /issm/trunk/src/m/classes/clusters/yellowstone.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/yellowstone.m	(revision 26743)
+++ /issm/trunk/src/m/classes/clusters/yellowstone.m	(revision 26744)
@@ -1,3 +1,3 @@
-%YELLOWSTONE class definition
+%YELLOWSTONE cluster class definition
 %
 %   Usage:
@@ -7,150 +7,149 @@
 
 classdef yellowstone
-    properties (SetAccess=public)  
-		 % {{{
-		 name           = 'yellowstone.ucar.edu'
-		 login          = '';
-		 modules        = {'ncarenv/1.0' 'ncarbinlibs/1.1' 'perlmods/5.0' 'gmake/4.1' 'python/2.7.7' 'all-python-libs' 'git/2.3.0' 'intel/15.0.3' 'mkl/11.1.2' 'esmf' 'esmf-6.3.0rp1-defio-mpi-O' 'netcdf-mpi/4.3.3.1' 'pnetcdf/1.6.1' 'ncarcompilers/1.0' 'cmake/3.0.2' 'matlab/R2015b' 'issm'};
-		 numnodes       = 1;
-		 cpuspernode    = 8;
-		 port           = 0;
-		 queue          = 'premium';
-		 time           = 12*60;
-		 processor      = 'sandy';
-		 codepath       = '';
-		 executionpath  = '';
-		 grouplist     = 'P93300301';
-	 end
-	 %}}}
-	 methods
-		 function cluster=yellowstone(varargin) % {{{
+	properties (SetAccess=public)
+		% {{{
+		name           = 'yellowstone.ucar.edu'
+		login          = '';
+		modules        = {'ncarenv/1.0' 'ncarbinlibs/1.1' 'perlmods/5.0' 'gmake/4.1' 'python/2.7.7' 'all-python-libs' 'git/2.3.0' 'intel/15.0.3' 'mkl/11.1.2' 'esmf' 'esmf-6.3.0rp1-defio-mpi-O' 'netcdf-mpi/4.3.3.1' 'pnetcdf/1.6.1' 'ncarcompilers/1.0' 'cmake/3.0.2' 'matlab/R2015b' 'issm'};
+		numnodes       = 1;
+		cpuspernode    = 8;
+		port           = 0;
+		queue          = 'premium';
+		time           = 12*60;
+		processor      = 'sandy';
+		codepath       = '';
+		executionpath  = '';
+		grouplist     = 'P93300301';
+	end
+	%}}}
+	methods
+		function cluster=yellowstone(varargin) % {{{
 
-			 %initialize cluster using default settings if provided
-			 if (exist('yellowstone_settings')==2), yellowstone_settings; end
+			%initialize cluster using default settings if provided
+			if (exist('yellowstone_settings')==2), yellowstone_settings; end
 
-			 %use provided options to change fields
-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
-		 end
-		 %}}}
-		 function disp(cluster) % {{{
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
-			 disp(sprintf('    name: %s',cluster.name));
-			 disp(sprintf('    login: %s',cluster.login));
-			 modules=''; for i=1:length(cluster.modules), modules=[modules cluster.modules{i} ',']; end; modules=modules(1:end-1); 
-			 disp(sprintf('    modules: %s',modules));
-			 disp(sprintf('    port: %i',cluster.port));
-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
-			 disp(sprintf('    queue: %s',cluster.queue));
-			 disp(sprintf('    time: %i',cluster.time));
-			 disp(sprintf('    processor: %s',cluster.processor));
-			 disp(sprintf('    codepath: %s',cluster.codepath));
-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
-			 disp(sprintf('    grouplist: %s',cluster.grouplist));
-		 end
-		 %}}}
-		 function numprocs=np(cluster) % {{{
-			 %compute number of processors
-			 numprocs=cluster.numnodes*cluster.cpuspernode;
-		 end
-		 %}}}
-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+			%use provided options to change fields
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
+			disp(sprintf('    numnodes: %i',cluster.numnodes));
+			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			disp(sprintf('    np: %i',cluster.nprocs()));
+			disp(sprintf('    port: %i',cluster.port));
+			disp(sprintf('    queue: %s',cluster.queue));
+			disp(sprintf('    time: %i',cluster.time));
+			disp(sprintf('    processor: %s',cluster.processor));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+			disp(sprintf('    grouplist: %s',cluster.grouplist));
+		end
+		%}}}
+		function numprocs=nprocs(cluster) % {{{
+			%compute number of processors
+			numprocs=cluster.numnodes*cluster.cpuspernode;
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_queues={'premium','regular'};
-			 queue_requirements_time=[12*60 12*650];
-			 queue_requirements_np=[16384 16384];
+			available_queues={'premium','regular'};
+			queue_requirements_time=[12*60 12*650];
+			queue_requirements_np=[16384 16384];
 
-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.nprocs(),cluster.time)
 
-			 %Miscelaneous
-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
-			 if isempty(cluster.grouplist), md = checkmessage(md,'grouplist empty'); end
+			%Miscellaneous
+			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+			if isempty(cluster.grouplist), md = checkmessage(md,'grouplist empty'); end
 
-		 end
-		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
-			 executable='issm.exe';
-			 if isdakota,
-				 version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
-				 if (version>=6),
-					 executable='issm_dakota.exe';
-				 end
-			 end
-			 if isoceancoupling,
-				 executable='issm_ocean.exe';
-			 end
+			executable='issm.exe';
+			if isdakota,
+				version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
+				if (version>=6),
+					executable='issm_dakota.exe';
+				end
+			end
+			if isoceancoupling,
+				executable='issm_ocean.exe';
+			end
 
 
-			 %write queuing script 
-			 fid=fopen([modelname '.queue'],'w');
-			 fprintf(fid,'#!/bin/tcsh\n');
-			 fprintf(fid,'#BSUB -P %s\n',cluster.grouplist);
-			 fprintf(fid,'#BSUB -W %i:%i\n',floor(cluster.time/60),cluster.time-floor(cluster.time/60)*60);
-			 fprintf(fid,'#BSUB -n %i\n',cluster.np);
-			 fprintf(fid,'#BSUB -J %s\n',modelname);
-			 fprintf(fid,'#BSUB -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
-			 fprintf(fid,'#BSUB -e %s.errlog \n',[cluster.executionpath '/' dirname '/' modelname]);
-			 fprintf(fid,'#BSUB -q %s\n',cluster.queue);
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/tcsh\n');
+			fprintf(fid,'#BSUB -P %s\n',cluster.grouplist);
+			fprintf(fid,'#BSUB -W %i:%i\n',floor(cluster.time/60),cluster.time-floor(cluster.time/60)*60);
+			fprintf(fid,'#BSUB -n %i\n',cluster.nprocs());
+			fprintf(fid,'#BSUB -J %s\n',modelname);
+			fprintf(fid,'#BSUB -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
+			fprintf(fid,'#BSUB -e %s.errlog \n',[cluster.executionpath '/' dirname '/' modelname]);
+			fprintf(fid,'#BSUB -q %s\n',cluster.queue);
 
-			 fprintf(fid,'module purge\n');
-			 for i=1:length(cluster.modules),
-				 fprintf(fid,'module load %s\n',cluster.modules{i});
-			 end
+			fprintf(fid,'module purge\n');
+			for i=1:length(cluster.modules),
+				fprintf(fid,'module load %s\n',cluster.modules{i});
+			end
 
-			 fprintf(fid,'setenv OMP_STACKSIZE 256M\n');
-			 fprintf(fid,'setenv MP_LABELIO yes\n');
-			 fprintf(fid,'setenv MP_INFOLEVEL 2\n');
-			 fprintf(fid,'setenv MP_SHARED_MEMORY yes\n');
-			 fprintf(fid,'setenv MP_EUILIB us\n');
-			 fprintf(fid,'setenv MP_STDOUTMODE unordered\n');
-			 fprintf(fid,'setenv MP_RC_USE_LMC yes\n');
-			 fprintf(fid,'setenv MP_MPILIB mpich2\n');
-			 fprintf(fid,'setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/opt/ibmhpc/pecurrent/mpich2/intel/lib64/\n');
-			 fprintf(fid,'setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/ncar/opt/intel/psxe-2015_update3/impi/5.0.3.048/lib64/\n');
+			fprintf(fid,'setenv OMP_STACKSIZE 256M\n');
+			fprintf(fid,'setenv MP_LABELIO yes\n');
+			fprintf(fid,'setenv MP_INFOLEVEL 2\n');
+			fprintf(fid,'setenv MP_SHARED_MEMORY yes\n');
+			fprintf(fid,'setenv MP_EUILIB us\n');
+			fprintf(fid,'setenv MP_STDOUTMODE unordered\n');
+			fprintf(fid,'setenv MP_RC_USE_LMC yes\n');
+			fprintf(fid,'setenv MP_MPILIB mpich2\n');
+			fprintf(fid,'setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/opt/ibmhpc/pecurrent/mpich2/intel/lib64/\n');
+			fprintf(fid,'setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/ncar/opt/intel/psxe-2015_update3/impi/5.0.3.048/lib64/\n');
 
-			 fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,dirname);
+			fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,dirname);
 
-			 fprintf(fid,'mpirun.lsf %s/%s %s %s %s\n',cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
-			 fclose(fid);
+			fprintf(fid,'mpirun.lsf %s/%s %s %s %s\n',cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+			fclose(fid);
 
-		 end %}}}
-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+		end %}}}
+		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
 
-			 %compress the files into one zip.
-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
-			 for i=1:numel(filelist),
-				 compressstring = [compressstring ' ' filelist{i}];
-			 end
-			 system(compressstring);
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			system(compressstring);
 
-			 disp('uploading input file and queueing script');
-			 directory=cluster.executionpath;
+			disp('uploading input file and queueing script');
+			directory=cluster.executionpath;
 
-			 issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
+			issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
 
-		 end
-		 %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+		end
+		%}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
 
-			 %lauch command, to be executed via ssh
-			 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-						 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && bsub < ' modelname '.queue '];
+			%launch command, to be executed via ssh
+			launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && bsub < ' modelname '.queue '];
 
-			 disp('launching solution sequence on remote cluster');
-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-		 end
-		 %}}}
-		 function Download(cluster,dirname,filelist)% {{{
+			disp('launching solution sequence on remote cluster');
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end
+		%}}}
+		function Download(cluster,dirname,filelist) % {{{
 
-			 %copy files from cluster to current directory
-			 directory=[cluster.executionpath '/' dirname '/'];
-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
 
-		 end %}}}
+		end %}}}
 	end
 end
Index: /issm/trunk/src/m/classes/constants.js
===================================================================
--- /issm/trunk/src/m/classes/constants.js	(revision 26743)
+++ /issm/trunk/src/m/classes/constants.js	(revision 26744)
@@ -19,4 +19,7 @@
 			//the reference temperature for enthalpy model (cf Aschwanden)
 			this.referencetemperature=223.15;
+
+			//gravitational constant: 
+			this.gravitational_constant = 6.67259e-11;
 		}// }}}
 		this.disp = function () { //{{{
@@ -27,4 +30,5 @@
 			fielddisplay(this,'yts','number of seconds in a year [s/yr]');
 			fielddisplay(this,'referencetemperature','reference temperature used in the enthalpy model [K]');
+			fielddisplay(this,'gravitational_constant','Newtonian constant of gravitation [m^3/kg/s^2]');
 
 		} //}}}
@@ -39,4 +43,5 @@
 			checkfield(md,'fieldname','constants.yts','>',0,'size',[1,1]);
 			checkfield(md,'fieldname','constants.referencetemperature','size',[1,1]);
+			checkfield(md,'fieldname','constants.gravitational_constant','size',[1,1]);
 
 		} // }}}
@@ -45,4 +50,5 @@
 			WriteData(fid,prefix,'object',this,'fieldname','yts','format','Double');
 			WriteData(fid,prefix,'object',this,'fieldname','referencetemperature','format','Double');
+			WriteData(fid,prefix,'object',this,'fieldname','gravitational_constant','format','Double');
 		}//}}}
 		this.fix=function() { //{{{
@@ -50,8 +56,9 @@
 	//properties 
 	// {{{
-		this.g                    = 0.;
-		this.omega                = 0.;
-		this.yts                  = 0.;
-		this.referencetemperature = 0.;
+		this.g						  = 0.;
+		this.omega					  = 0.;
+		this.yts					  = 0.;
+		this.referencetemperature	  = 0.;
+		this.gravitational_constant   = 0.;
 		this.setdefaultparameters();
 		//}}}
Index: /issm/trunk/src/m/classes/constants.m
===================================================================
--- /issm/trunk/src/m/classes/constants.m	(revision 26743)
+++ /issm/trunk/src/m/classes/constants.m	(revision 26744)
@@ -6,8 +6,9 @@
 classdef constants
 	properties (SetAccess=public) 
-		g                    = 0.;
-		omega                = 0.;
-		yts                  = 0.;
-		referencetemperature = 0.;
+		g                      = 0.;
+		omega                  = 0.;
+		yts                    = 0.;
+		referencetemperature   = 0.;
+		gravitational_constant = 0.;
 	end
 	methods
@@ -33,4 +34,7 @@
 			%the reference temperature for enthalpy model (cf Aschwanden)
 			self.referencetemperature=223.15;
+		
+			%gravitational constant: 
+			self.gravitational_constant = 6.67259e-11;
 
 		end % }}}
@@ -41,4 +45,5 @@
 			md = checkfield(md,'fieldname','constants.yts','>',0,'size',[1 1]);
 			md = checkfield(md,'fieldname','constants.referencetemperature','size',[1 1]);
+			md = checkfield(md,'fieldname','constants.gravitational_constant','size',[1 1]);
 
 		end % }}}
@@ -50,4 +55,5 @@
 			fielddisplay(self,'yts','number of seconds in a year [s/yr]');
 			fielddisplay(self,'referencetemperature','reference temperature used in the enthalpy model [K]');
+			fielddisplay(self,'gravitational_constant','Newtonian constant of gravitation [m^3/kg/s^2]');
 
 		end % }}}
@@ -56,4 +62,5 @@
 			WriteData(fid,prefix,'object',self,'fieldname','yts','format','Double');
 			WriteData(fid,prefix,'object',self,'fieldname','referencetemperature','format','Double');
+			WriteData(fid,prefix,'object',self,'fieldname','gravitational_constant','format','Double');
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
@@ -63,4 +70,5 @@
 			writejsdouble(fid,[modelname '.constants.yts'],self.yts);
 			writejsdouble(fid,[modelname '.constants.referencetemperature'],self.referencetemperature);
+			writejsdouble(fid,[modelname '.constants.gravitational_constant'],self.gravitational_constant);
 
 		end % }}}
Index: /issm/trunk/src/m/classes/constants.py
===================================================================
--- /issm/trunk/src/m/classes/constants.py	(revision 26743)
+++ /issm/trunk/src/m/classes/constants.py	(revision 26744)
@@ -1,10 +1,9 @@
+from checkfield import checkfield
 from fielddisplay import fielddisplay
-from checkfield import checkfield
 from WriteData import WriteData
 
 
 class constants(object):
-    """
-    CONSTANTS class definition
+    """CONSTANTS class definition
 
        Usage:
@@ -13,52 +12,53 @@
 
     def __init__(self):  # {{{
-        self.g = 0.
-        self.omega = 0.
-        self.yts = 0.
-        self.referencetemperature = 0.
+        self.g                      = 0.
+        self.omega                  = 0.
+        self.yts                    = 0.
+        self.referencetemperature   = 0.
+        self.gravitational_constant = 0.;
 
-    #set defaults
+        #set defaults
         self.setdefaultparameters()
-
     #}}}
     def __repr__(self):  # {{{
-        string = "   constants parameters:"
-
-        string = "%s\n%s" % (string, fielddisplay(self, "g", "gravitational acceleration [m / s^2]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "omega", "angular velocity of Earth [rad / s]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "yts", "number of seconds in a year [s / yr]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "referencetemperature", "reference temperature used in the enthalpy model [K]"))
-
-        return string
+        s = '   constants parameters:\n'
+        s += '{}\n'.format(fielddisplay(self, 'g', 'gravitational acceleration [m/s^2]'))
+        s += '{}\n'.format(fielddisplay(self, 'omega', 'angular velocity of Earth [rad/s]'))
+        s += '{}\n'.format(fielddisplay(self, 'yts', 'number of seconds in a year [s/yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'referencetemperature', 'reference temperature used in the enthalpy model [K]'))
+        s += '{}\n'.format(fielddisplay(self, 'gravitational_constant', 'Newtonian constant of gravitation [m^3/kg/s^2]'))
+        return s
     #}}}
-
     def setdefaultparameters(self):  # {{{
-        #acceleration due to gravity (m / s^2)
+        # Acceleration due to gravity (m / s^2)
         self.g = 9.81
 
-        #Earth's rotation speed
+        # Earth's rotation speed
         self.omega = 7.292 * 1e-5
 
-        #converstion from year to seconds
-        self.yts = 365. * 24. * 3600.
+        # Converstion from year to seconds
+        self.yts = 365.0 * 24.0 * 3600.0
 
-        #the reference temperature for enthalpy model (cf Aschwanden)
+        # The reference temperature for enthalpy model (cf Aschwanden)
         self.referencetemperature = 223.15
+
+        # Gravitational constant:
+        self.gravitational_constant = 6.67259e-11
 
         return self
     #}}}
-
     def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'constants.g', '>=', 0, 'size', [1])
+        md = checkfield(md, 'fieldname', 'constants.g', '>=', 0, 'size', [1]) # We allow 0 for validation tests
         md = checkfield(md, 'fieldname', 'constants.omega', '>=', 0, 'size', [1])
         md = checkfield(md, 'fieldname', 'constants.yts', '>', 0, 'size', [1])
         md = checkfield(md, 'fieldname', 'constants.referencetemperature', 'size', [1])
+        md = checkfield(md, 'fieldname', 'constants.gravitational_constant','size',[1]);
 
         return md
     # }}}
-
     def marshall(self, prefix, md, fid):  # {{{
         WriteData(fid, prefix, 'object', self, 'fieldname', 'g', 'format', 'Double')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'yts', 'format', 'Double')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'referencetemperature', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'gravitational_constant', 'format', 'Double');
     # }}}
Index: /issm/trunk/src/m/classes/damage.js
===================================================================
--- /issm/trunk/src/m/classes/damage.js	(revision 26743)
+++ /issm/trunk/src/m/classes/damage.js	(revision 26744)
@@ -48,5 +48,5 @@
 			fielddisplay(this,'max_damage','maximum possible damage (0<=max_damage<1)');
 
-			fielddisplay(this,'stabilization','0: no, 1: artificial_diffusivity, 2: SUPG (not working), 4: flux corrected transport');
+			fielddisplay(this,'stabilization','0: no stabilization, 1: artificial diffusion, 2: SUPG (not working), 4: flux corrected transport');
 			fielddisplay(this,'maxiter','maximum number of non linear iterations');
 			fielddisplay(this,'elementinterp',"interpolation scheme for finite elements {'P1','P2'}");
Index: /issm/trunk/src/m/classes/damage.m
===================================================================
--- /issm/trunk/src/m/classes/damage.m	(revision 26743)
+++ /issm/trunk/src/m/classes/damage.m	(revision 26744)
@@ -130,5 +130,5 @@
 				fielddisplay(self,'max_damage','maximum possible damage (0<=max_damage<1)');
 				
-				fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: SUPG (not working), 4: flux corrected transport');
+				fielddisplay(self,'stabilization','0: no stabilization, 1: artificial diffusion, 2: SUPG (not working), 4: flux corrected transport');
 				fielddisplay(self,'maxiter','maximum number of non linear iterations');
 				fielddisplay(self,'elementinterp','interpolation scheme for finite elements {''P1'',''P2''}');
Index: /issm/trunk/src/m/classes/damage.py
===================================================================
--- /issm/trunk/src/m/classes/damage.py	(revision 26743)
+++ /issm/trunk/src/m/classes/damage.py	(revision 26744)
@@ -52,5 +52,5 @@
             s += "%s\n" % fielddisplay(self, "spcdamage", "damage constraints (NaN means no constraint)")
             s += "%s\n" % fielddisplay(self, "max_damage", "maximum possible damage (0 <=max_damage < 1)")
-            s += "%s\n" % fielddisplay(self, "stabilization", "0: no, 1: artificial_diffusivity, 2: SUPG (not working), 4: Flux corrected transport")
+            s += "%s\n" % fielddisplay(self, "stabilization", "0: no stabilization, 1: artificial diffusion, 2: SUPG (not working), 4: flux corrected transport")
             s += "%s\n" % fielddisplay(self, "maxiter", "maximum number of non linear iterations")
             s += "%s\n" % fielddisplay(self, "elementinterp", "interpolation scheme for finite elements [''P1'', ''P2'']")
@@ -70,7 +70,8 @@
 
     def extrude(self, md):  # {{{
-        self.D = project3d(md, 'vector', self.D, 'type', 'node')
-        self.spcdamage = project3d(md, 'vector', self.spcdamage, 'type', 'node')
-        return self
+        if self.isdamage:
+            self.D = project3d(md, 'vector', self.D, 'type', 'node')
+            self.spcdamage = project3d(md, 'vector', self.spcdamage, 'type', 'node')
+            return self
     #}}}
 
Index: /issm/trunk/src/m/classes/dsl.js
===================================================================
--- /issm/trunk/src/m/classes/dsl.js	(revision 26743)
+++ /issm/trunk/src/m/classes/dsl.js	(revision 26744)
@@ -1,55 +1,61 @@
-//dsl Class definition
-//
-//   Usage:
-//      dsl=dsl();
+class dsl {//{{{
+	/**
+	 * DSL class definition
+	 *
+	 * Usage:
+	 *     dsl=dsl();
+	 * 
+	 * TODO:
+	 * - Implement from struct constructor (see dsl.m)?
+	 */
+	constructor() {//{{{
+		this.global_average_thermosteric_sea_level; // Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m)
+		this.sea_surface_height_above_geoid; // Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m)
+		this.sea_water_pressure_at_sea_floor; // Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!)
 
-function dsl(){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-		this.requested_outputs=['default'];
-	} // }}}
-	this.disp = function(){ // {{{
-		console.log(sprintf('   dsl parameters:'));
-		fielddisplay(this,'global_average_thermosteric_sea_level_change','corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)');
-		fielddisplay(this,'sea_surface_height_change_above_geoid','corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr)');
-		fielddisplay(this,'sea_water_pressure_change_at_sea_floor','corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in Pa/yr)');
+		let nargs = arguments.length;
+		if (nargs == 0) {
+			this.setdefaultparameters();
+		} else {
+			error('constructor not supported');
+		}
+	} //}}}
 
+	setdefaultparameters() {//{{{
+		this.global_average_thermosteric_sea_level = NaN;
+		this.sea_surface_height_above_geoid = NaN;
+		this.sea_water_pressure_at_sea_floor = NaN;
+	} //}}}
 
-	} // }}}
-	this.defaultoutputs = function(){ // {{{
-		return '';
-	}//}}}
-    this.classname = function(){ // {{{
-        return "dsl";
-    } // }}}
-    this.extrude = function(md) {//{{{
-        this.sea_surface_height_change_above_geoid=project3d(md,'vector',this.sea_surface_height_change_above_geoid,'type','node');
-        this.sea_water_pressure_change_at_sea_floor=project3d(md,'vector',this.sea_water_pressure_change_at_sea_floor,'type','node');
-        return this;
-    }//}}}
-    this.checkconsistency = function(md,solution,analyses) { //{{{
+	checkconsistency(md, solution, analyses) {//{{{
+		if (!analyses.includes('SealevelchangeAnalysis') || (solution === 'TransientSolution' && !md.transient.isslc) || !md.transient.isoceantransport) {
+			return md;
+		}
 
-        if(ArrayAnyEqual(ArrayIsMember('SealevelriseAnalysis',analyses),1)){
-            checkfield(md,'fieldname','dsl.sea_surface_height_change_above_geoid','timeseries',1,'NaN',1,'Inf',1);
-            checkfield(md,'fieldname','dsl.sea_water_pressure_change_at_sea_floor','timeseries',1,'NaN',1,'Inf',1);
-        }
+		md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level', 'NaN', 1, 'Inf', 1);
+		md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1);
+		md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'NaN', 1, 'Inf', 1, 'timeseries', 1);
 
-    } // }}}
-    this.marshall=function(md,prefix,fid) { //{{{
+		if (md.solidearth.settings.compute_bp_grd) {
+			md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'empty', 1);
+		}
 
-        var yts=md.constants.yts;
+		return md;
+	} //}}}
 
-		WriteData(fid,prefix,'name','md.dsl.model','data',1,'format','Integer');
-		WriteData(fid,prefix,'object',this,'class','dsl','fieldname','global_average_thermosteric_sea_level_change','format','DoubleMat','mattype',1,'timeserieslength',1+1,'yts',md.constants.yts,'scale',1e-3/md.constants.yts);
-			WriteData(fid,prefix,'object',this,'class','dsl','fieldname','sea_water_pressure_change_at_sea_floor','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3/md.constants.yts);
-			WriteData(fid,prefix,'object',this,'class',dsl,'fieldname','sea_surface_height_change_above_geoid','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-    }//}}}
-    this.fix=function() { //{{{
-    }//}}}
-	//properties 
-    // {{{
-	this.global_average_thermosteric_sea_level_change = NaN;
-	this.sea_surface_height_change_above_geoid = NaN;
-	this.sea_water_pressure_change_at_sea_floor = NaN;
-    // }}}
-}
+	disp() {//{{{
+		console.log('WARNING: dsl::disp is not yet implemented');
+	} //}}}
+
+	marshall(md, prefix, fid) {//{{{
+		WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 1, 'format', 'Integer');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeseries', 1, 'timeserieslength', 2, 'yts', md.constants.yts); // mattype 2, because we are sending a GMSL value identical everywhere on each element
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts); // mattype 1 because we specify DSL at vertex locations
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts); // mattype 1 because we specify bottom pressure at vertex locations
+	} //}}}
+
+	extrude(md) {//{{{
+		this.sea_surface_height_above_geoid = project3d(md, 'vector', this.sea_surface_height_above_geoid, 'type', 'node', 'layer', 1);
+		this.sea_water_pressure_at_sea_floor = project3d(md, 'vector', this.sea_water_pressure_at_sea_floor, 'type', 'node', 'layer', 1);
+	} //}}}
+} //}}}
Index: /issm/trunk/src/m/classes/dsl.m
===================================================================
--- /issm/trunk/src/m/classes/dsl.m	(revision 26743)
+++ /issm/trunk/src/m/classes/dsl.m	(revision 26744)
@@ -7,15 +7,10 @@
 	properties (SetAccess=public) 
 
-		global_average_thermosteric_sea_level_change; %corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)
-		sea_surface_height_change_above_geoid; %corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr)
-		sea_water_pressure_change_at_sea_floor; %corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in mm/yr equivalent, not in Pa/yr!) for each ensemble
-		compute_fingerprints; %do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid
+		global_average_thermosteric_sea_level; %Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).
+		sea_surface_height_above_geoid; %Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).
+		sea_water_pressure_at_sea_floor; %Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).
 
 	end
 	methods
-		function self = extrude(self,md) % {{{
-			self.sea_surface_height_change_above_geoid=project3d(md,'vector',self.sea_surface_height_change_above_geoid,'type','node','layer',1);
-			self.sea_water_pressure_change_at_sea_floor=project3d(md,'vector',self.sea_water_pressure_change_at_sea_floor,'type','node','layer',1);
-		end % }}}
 		function self = dsl(varargin) % {{{
 			switch nargin
@@ -30,8 +25,15 @@
 		function self = setdefaultparameters(self) % {{{
 
-			self.global_average_thermosteric_sea_level_change=0;
-			self.sea_surface_height_change_above_geoid=NaN;
-			self.sea_water_pressure_change_at_sea_floor=NaN;
-			self.compute_fingerprints=0;
+			self.global_average_thermosteric_sea_level=NaN;
+			self.sea_surface_height_above_geoid=NaN;
+			self.sea_water_pressure_at_sea_floor=NaN;
+
+		end % }}}
+		function disp(self) % {{{
+
+			disp(sprintf('   dsl parameters:'));
+			fielddisplay(self,'global_average_thermosteric_sea_level','Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).');
+			fielddisplay(self,'sea_surface_height_above_geoid','Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).');
+			fielddisplay(self,'sea_water_pressure_at_sea_floor','Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).');
 
 		end % }}}
@@ -39,42 +41,48 @@
 
 			%Early return
-			if ~ismember('SealevelriseAnalysis',analyses), return; end
-			if (strcmp(solution,'TransientSolution') & md.transient.isslr == 0), return; end
-			md = checkfield(md,'fieldname','dsl.global_average_thermosteric_sea_level_change','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','dsl.sea_surface_height_change_above_geoid','NaN',1,'Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','dsl.sea_water_pressure_change_at_sea_floor','NaN',1,'Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','dsl.compute_fingerprints','NaN',1,'Inf',1,'values',[0,1]);
-			if self.compute_fingerprints,
-				%check geodetic flag of slr is on: 
-				if md.slr.geodetic==0,
-					error('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, slr class should have geodetic flag on');
-				end
+			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc == 0) | (md.transient.isoceantransport==0),
+				return;
 			end
+			md = checkfield(md,'fieldname','dsl.global_average_thermosteric_sea_level','NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','dsl.sea_surface_height_above_geoid','NaN',1,'Inf',1,'timeseries',1);
+			md = checkfield(md,'fieldname','dsl.sea_water_pressure_at_sea_floor','NaN',1,'Inf',1,'timeseries',1);
+			
+			if md.solidearth.settings.compute_bp_grd==1, 
+				md = checkfield(md,'fieldname','dsl.sea_water_pressure_at_sea_floor','empty',1);
+			end
+			
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+			yts=md.constants.yts;
+			WriteData(fid,prefix,'name','md.dsl.model','data',1,'format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','global_average_thermosteric_sea_level','format','DoubleMat','mattype',2,'timeseries',1,'timeserieslength',2,'yts',yts); %mattype 2, because we are sending a GMSL value identical everywhere on each element. 
+			WriteData(fid,prefix,'object',self,'fieldname','sea_surface_height_above_geoid','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); %mattype 1 because we specify DSL at vertex locations.
+			WriteData(fid,prefix,'object',self,'fieldname','sea_water_pressure_at_sea_floor','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); %mattype 1 because we specify bottom pressure at vertex locations.
 
 		end % }}}
-		function disp(self) % {{{
+		function self = extrude(self,md) % {{{
+			self.sea_surface_height_above_geoid=project3d(md,'vector',self.sea_surface_height_above_geoid,'type','node','layer',1);
+			self.sea_water_pressure_at_sea_floor=project3d(md,'vector',self.sea_water_pressure_at_sea_floor,'type','node','layer',1);
+		end % }}}
+		function self = initialize(self,md) % {{{
 
-			disp(sprintf('   dsl parameters:'));
-			fielddisplay(self,'global_average_thermosteric_sea_level_change','corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)');
-			fielddisplay(self,'sea_surface_height_change_above_geoid','corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr)');
-			fielddisplay(self,'sea_water_pressure_change_at_sea_floor','corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in Pa/yr)');
-			fielddisplay(self,'compute_fingerprints','%do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-
-			WriteData(fid,prefix,'name','md.dsl.model','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','compute_fingerprints','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','global_average_thermosteric_sea_level_change','format','DoubleMat','mattype',1,'timeseries',1,'timeserieslength',2,'yts',md.constants.yts,'scale',1e-3/md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','sea_water_pressure_change_at_sea_floor','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','sea_surface_height_change_above_geoid','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-
+			if isnan(self.global_average_thermosteric_sea_level)
+				self.global_average_thermosteric_sea_level=[0;0];
+				disp('      no dsl.global_average_thermosteric_sea_level specified: transient values set at zero');
+			end
+			if isnan(self.sea_surface_height_above_geoid)
+				self.sea_surface_height_above_geoid=[zeros(md.mesh.numberofvertices,1);0];
+				disp('      no dsl.sea_surface_height_above_geoid specified: transient values set at zero');
+			end
+			if isnan(self.sea_water_pressure_at_sea_floor)
+				self.sea_water_pressure_at_sea_floor=[zeros(md.mesh.numberofvertices,1);0];
+				disp('      no dsl.sea_water_pressure_at_sea_floor specified: transient values set at zero');
+			end
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejs1Darray(fid,[modelname '.dsl.global_average_thermosteric_sea_level_change'],self.global_average_thermosteric_sea_level_change);
-			writejs1Darray(fid,[modelname '.dsl.compute_fingerprints'],self.compute_fingerprints);
-			writejs1Darray(fid,[modelname '.dsl.sea_surface_height_change_above_geoid'],self.sea_surface_height_change_above_geoid);
-			writejs1Darray(fid,[modelname '.dsl.sea_water_pressure_change_at_sea_floor'],self.sea_water_pressure_change_at_sea_floor);
+
+			writejs1Darray(fid,[modelname '.dsl.global_average_thermosteric_sea_level'],self.global_average_thermosteric_sea_level);
+			writejs1Darray(fid,[modelname '.dsl.sea_surface_height_above_geoid'],self.sea_surface_height_above_geoid);
+			writejs1Darray(fid,[modelname '.dsl.sea_water_pressure_at_sea_floor'],self.sea_water_pressure_at_sea_floor);
 
 		end % }}}
Index: /issm/trunk/src/m/classes/dsl.py
===================================================================
--- /issm/trunk/src/m/classes/dsl.py	(revision 26743)
+++ /issm/trunk/src/m/classes/dsl.py	(revision 26744)
@@ -8,50 +8,46 @@
 
 class dsl(object):
-    """DSL - slass definition
+    """DSL - class definition
 
     Usage:
-        dsl = dsl()
+        dsl = dsl() # dynamic sea level class, based on CMIP5 outputs
     """
 
-    def __init__(self): #{{{
-        self.global_average_thermosteric_sea_level_change = 0 #corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)
-        self.sea_surface_height_change_above_geoid = float('NaN') #corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr)
-        self.sea_water_pressure_change_at_sea_floor = float('NaN') #corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in Pa/yr)
-        self.compute_fingerprints = 0; #do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid
+    def __init__(self, *args):  #{{{
+        self.global_average_thermosteric_sea_level = np.nan  # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).
+        self.sea_surface_height_above_geoid = np.nan  # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).
+        self.sea_water_pressure_at_sea_floor = np.nan  #  Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).
+
+        if len(args) == 0:
+            self.setdefaultparameters()
+        else:
+            raise Exception('constructor not supported')
     #}}}
 
-    def __repr__(self): #{{{
+    def __repr__(self):  #{{{
         s = '   dsl parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level_change', 'corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)'))
-        s += '{}\n'.format(fielddisplay(self, 'sea_surface_height_change_above_geoid', 'corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr)'))
-        s += '{}\n'.format(fielddisplay(self, 'sea_water_pressure_change_at_sea_floor', 'corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in Pa/yr)'))
-        s += '{}\n'.format(fielddisplay(self, 'compute_fingerprints', 'do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid'))
+        s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level', 'Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).'))
+        s += '{}\n'.format(fielddisplay(self, 'sea_surface_height_above_geoid', 'Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).'))
+        s += '{}\n'.format(fielddisplay(self, 'sea_water_pressure_at_sea_floor', 'Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).'))
         return s
     #}}}
 
-    def extrude(self, md): #{{{
-        self.sea_surface_height_change_above_geoid = project3d(md, 'vector', self.sea_surface_height_change_above_geoid, 'type', 'node')
-        self.sea_water_pressure_change_at_sea_floor = project3d(md, 'vector', self.sea_water_pressure_change_at_sea_floor, 'type', 'node')
-        return self
+    def setdefaultparameters(self):  #{{{
+        self.global_average_thermosteric_sea_level = np.nan
+        self.sea_surface_height_above_geoid = np.nan
+        self.sea_water_pressure_at_sea_floor = np.nan
     #}}}
 
-    def defaultoutputs(self, md): #{{{
-        return []
-    #}}}
+    def checkconsistency(self, md, solution, analyses):  #{{{
+        # Early return
+        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc) or (not md.transient.isoceantransport):
+            return md
+        md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
 
-    def checkconsistency(self, md, solution, analyses): #{{{
-        # Early return
-        if 'SealevelriseAnalysis' not in analyses:
-            return md
-        if solution == 'TransientSolution' and md.transient.isslr == 0:
-            return md
-        md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level_change', 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_change_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_change_at_sea_floor', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'dsl.compute_fingerprints', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
-        if self.compute_fingerprints:
-            # Check if geodetic flag of slr is on
-            if not md.slr.geodetic:
-                raise RuntimeError('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, slr class should have geodetic flag on')
+        if md.solidearth.settings.compute_bp_grd:
+            md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'empty', 1)
+
         return md
     # }}}
@@ -60,7 +56,26 @@
         yts = md.constants.yts
         WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'compute_fingerprints', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'global_average_thermosteric_sea_level_change', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 1+1, 'yts', md.constants.yts, 'scale', 1e-3/md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'sea_water_pressure_change_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices+1, 'yts', md.constants.yts, 'scale', 1e-3/md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'sea_surface_height_change_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices+1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeseries', 1, 'timeserieslength', 2, 'yts', yts) # mattype 2, because we are sending a GMSL value identical everywhere on each element.
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)  # mattype 1 because we specify DSL at vertex locations.
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)  # mattype 1 because we specify bottom pressure at vertex locations.
     # }}}
+
+    def extrude(self, md):  #{{{
+        self.sea_surface_height_above_geoid = project3d(md, 'vector', self.sea_surface_height_above_geoid, 'type', 'node', 'layer', 1)
+        self.sea_water_pressure_at_sea_floor = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor, 'type', 'node', 'layer', 1)
+        return self
+    #}}}
+
+    def initialize(self, md):  #{{{
+        if np.isnan(self.global_average_thermosteric_sea_level):
+            self.global_average_thermosteric_sea_level = np.array([0, 0]).reshape(-1, 1)
+            print('      no dsl.global_average_thermosteric_sea_level specified: transient values set at zero')
+
+        if np.isnan(self.sea_surface_height_above_geoid):
+            self.sea_surface_height_above_geoid = np.append(np.zeros((md.mesh.numberofvertices, 1)), 0).reshape(-1, 1)
+            print('      no dsl.sea_surface_height_above_geoid specified: transient values set at zero')
+
+        if np.isnan(self.sea_water_pressure_at_sea_floor):
+            self.sea_water_pressure_at_sea_floor = np.append(np.zeros((md.mesh.numberofvertices, 1)), 0).reshape(-1, 1)
+            print('      no dsl.sea_water_pressure_at_sea_floor specified: transient values set at zero')
+    #}}}
Index: /issm/trunk/src/m/classes/dslmme.m
===================================================================
--- /issm/trunk/src/m/classes/dslmme.m	(revision 26743)
+++ /issm/trunk/src/m/classes/dslmme.m	(revision 26744)
@@ -8,8 +8,7 @@
 
 		modelid; %index into the multi-model ensemble, determine which field will be used.
-		global_average_thermosteric_sea_level_change; %corresponds to zostoga fields in CMIP5 archives. Specified as a temporally variable global rate (mm/yr) for each ensemble.
-		sea_surface_height_change_above_geoid; %corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) for each ensemble
-		sea_water_pressure_change_at_sea_floor; %corresponds to bpo fields in CMIP5 archives. Specified as a spatio-temporally variable rate (in mm/yr equivalent, not in Pa/yr!) for each ensemble
-		compute_fingerprints; %do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid
+		global_average_thermosteric_sea_level; %Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.
+		sea_surface_height_above_geoid; %Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.
+		sea_water_pressure_at_sea_floor; %Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.
 
 	end
@@ -28,8 +27,7 @@
 
 			self.modelid=0;
-			self.global_average_thermosteric_sea_level_change={};
-			self.sea_surface_height_change_above_geoid={};
-			self.sea_water_pressure_change_at_sea_floor={};
-			self.compute_fingerprints=0;
+			self.global_average_thermosteric_sea_level={};
+			self.sea_surface_height_above_geoid={};
+			self.sea_water_pressure_at_sea_floor={};
 
 		end % }}}
@@ -37,19 +35,17 @@
 
 			%Early return
-			if ~ismember('SealevelriseAnalysis',analyses), return; end
-			if (strcmp(solution,'TransientSolution') & md.transient.isslr == 0), return; end
-			for i=1:length(self.global_average_thermosteric_sea_level_change),
-				md = checkfield(md,'field',self.global_average_thermosteric_sea_level_change{i},'NaN',1,'Inf',1);
-				md = checkfield(md,'field',self.sea_surface_height_change_above_geoid{i},'NaN',1,'Inf',1,'timeseries',1);
-				md = checkfield(md,'field',self.sea_water_pressure_change_at_sea_floor{i},'NaN',1,'Inf',1,'timeseries',1);
+			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc == 0) | (md.transient.isoceantransport==0),
+				return;
 			end
-			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',1,'<=',length(self.global_average_thermosteric_sea_level_change));
-			if self.compute_fingerprints,
-				%check geodetic flag of slr is on: 
-				if md.solidearth.settings.computesealevelchange==0,
-					error('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, slr class should have geodetic flag on');
-				end
+			for i=1:length(self.global_average_thermosteric_sea_level),
+				md = checkfield(md,'field',self.global_average_thermosteric_sea_level{i},'NaN',1,'Inf',1);
+				md = checkfield(md,'field',self.sea_surface_height_above_geoid{i},'NaN',1,'Inf',1,'timeseries',1);
+				md = checkfield(md,'field',self.sea_water_pressure_at_sea_floor{i},'NaN',1,'Inf',1,'timeseries',1);
 			end
+			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',1,'<=',length(self.global_average_thermosteric_sea_level));
 
+			if md.solidearth.settings.compute_bp_grd==1, 
+				md = checkfield(md,'fieldname','dsl.sea_water_pressure_at_sea_floor','empty',1);
+			end
 
 		end % }}}
@@ -58,24 +54,22 @@
 			disp(sprintf('   dsl mme parameters:'));
 			fielddisplay(self,'modelid','index into the multi-model ensemble, determine which field will be used.');
-			fielddisplay(self,'global_average_thermosteric_sea_level_change','corresponds to zostoga fields in CMIP5 archives. Specified as a temporally variable global rate (mm/yr) for each ensemble.');
-			fielddisplay(self,'sea_surface_height_change_above_geoid','corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) for each ensemble.');
-			fielddisplay(self,'sea_water_pressure_change_at_sea_floor','corresponds to bpo fields in CMIP5 archives. Specified as a spatio-temporally variable rate (in mm/yr) for each ensemble.');
-			fielddisplay(self,'compute_fingerprints','%do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid');
+			fielddisplay(self,'global_average_thermosteric_sea_level','Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.');
+			fielddisplay(self,'sea_surface_height_above_geoid','Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.');
+			fielddisplay(self,'sea_water_pressure_at_sea_floor','Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.');
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
 
 			WriteData(fid,prefix,'name','md.dsl.model','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','compute_fingerprints','format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
-			WriteData(fid,prefix,'name','md.dsl.nummodels','data',length(self.global_average_thermosteric_sea_level_change),'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','global_average_thermosteric_sea_level_change','format','MatArray','timeseries',1,'timeserieslength',2,'yts',md.constants.yts,'scale',1e-3/md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','sea_water_pressure_change_at_sea_floor','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
-			WriteData(fid,prefix,'object',self,'fieldname','sea_surface_height_change_above_geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3/md.constants.yts);
+			WriteData(fid,prefix,'name','md.dsl.nummodels','data',length(self.global_average_thermosteric_sea_level),'format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','global_average_thermosteric_sea_level','format','MatArray','timeseries',1,'timeserieslength',2);
+			WriteData(fid,prefix,'object',self,'fieldname','sea_water_pressure_at_sea_floor','format','MatArray','timeserieslength',md.mesh.numberofvertices+1);
+			WriteData(fid,prefix,'object',self,'fieldname','sea_surface_height_above_geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1);
 
 		end % }}}
 		function self = extrude(self,md) % {{{
-			for i=1:length(self.global_average_thermosteric_sea_level_change),
-				self.sea_surface_height_change_above_geoid{i}=project3d(md,'vector',self.sea_surface_height_change_above_geoid{i},'type','node','layer',1);
-				self.sea_water_pressure_change_at_sea_floor{i}=project3d(md,'vector',self.sea_water_pressure_change_at_sea_floor{i},'type','node','layer',1);
+			for i=1:length(self.global_average_thermosteric_sea_level),
+				self.sea_surface_height_above_geoid{i}=project3d(md,'vector',self.sea_surface_height_above_geoid{i},'type','node','layer',1);
+				self.sea_water_pressure_at_sea_floor{i}=project3d(md,'vector',self.sea_water_pressure_at_sea_floor{i},'type','node','layer',1);
 			end
 		end % }}}
@@ -83,8 +77,8 @@
 			
 			writejsdouble(fid,[modelname '.dsl.modelid'],self.modelid);
-			writejscellarray(fid,[modelname '.dsl.global_average_thermosteric_sea_level_change'],self.global_average_thermosteric_sea_level_change);
-			writejscellarray(fid,[modelname '.dsl.sea_surface_height_change_above_geoid'],self.sea_surface_height_change_above_geoid);
+			writejscellarray(fid,[modelname '.dsl.global_average_thermosteric_sea_level'],self.global_average_thermosteric_sea_level);
+			writejscellarray(fid,[modelname '.dsl.sea_surface_height_above_geoid'],self.sea_surface_height_above_geoid);
 			writejs1Darray(fid,[modelname '.dsl.compute_fingerprints'],self.compute_fingerprints);
-			writejscellarray(fid,[modelname '.dsl.sea_water_pressure_change_at_sea_floor'],self.sea_water_pressure_change_at_sea_floor);
+			writejscellarray(fid,[modelname '.dsl.sea_water_pressure_at_sea_floor'],self.sea_water_pressure_at_sea_floor);
 
 		end % }}}
Index: /issm/trunk/src/m/classes/dslmme.py
===================================================================
--- /issm/trunk/src/m/classes/dslmme.py	(revision 26743)
+++ /issm/trunk/src/m/classes/dslmme.py	(revision 26744)
@@ -1,4 +1,2 @@
-import numpy as np
-
 from checkfield import checkfield
 from fielddisplay import fielddisplay
@@ -14,14 +12,13 @@
     """
 
-    def __init__(self, *args): #{{{
-        self.modelid                                        = 0 #index into the multi-model ensemble
-        self.global_average_thermosteric_sea_level_change   = [] #corresponds to zostoga fields in CMIP5 archives. Specified as a temporally variable global rate (mm/yr) for each ensemble.
-        self.sea_surface_height_change_above_geoid          = [] #corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) for each ensemble
-        self.sea_water_pressure_change_at_sea_floor         = [] #corresponds to bpo fields in CMIP5 archives. Specified as a spatio-temporally variable rate (in mm/yr equivalent, not in Pa/yr!) for each ensemble
-        self.compute_fingerprints                           = 0 #corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) for each ensemble
-        
-        nargin = len(args)
+    def __init__(self, *args):  #{{{
+        self.modelid = 0  # Index into the multi-model ensemble, determine which field will be used
+        self.global_average_thermosteric_sea_level = [] # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.
+        self.sea_surface_height_above_geoid = [] # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.
+        self.sea_water_pressure_at_sea_floor = [] #Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.
 
-        if nargin == 0:
+        nargs = len(args)
+
+        if nargs == 0:
             self.setdefaultparameters()
         else:
@@ -29,47 +26,47 @@
     #}}}
 
-    def __repr__(self): # {{{
+    def __repr__(self):  # {{{
         s = '   dsl mme parameters:\n'
         s += '{}\n'.format(fielddisplay(self, 'modelid', 'index into the multi-model ensemble, determines which field will be used.'))
-        s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level_change', 'corresponds to zostoga fields in CMIP5 archives. Specified as a temporally variable global rate (mm/yr) for each ensemble.'))
-        s += '{}\n'.format(fielddisplay(self, 'sea_surface_height_change_above_geoid', 'corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) for each ensemble.'))
-        s += '{}\n'.format(fielddisplay(self, 'sea_water_pressure_change_at_sea_floor', 'corresponds to bpo fields in CMIP5 archives. Specified as a spatio-temporally variable rate (in mm/yr) for each ensemble.'))
-        s += '{}\n'.format(fielddisplay(self, 'compute_fingerprints', 'do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid'))
+        s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level', 'Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.'))
+        s += '{}\n'.format(fielddisplay(self, 'sea_surface_height_above_geoid', 'Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.'))
+        s += '{}\n'.format(fielddisplay(self, 'sea_water_pressure_at_sea_floor', 'Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.'))
         return s
     #}}}
 
-    def setdefaultparameters(self): #{{{
+    def setdefaultparameters(self):  #{{{
         return self
     #}}}
 
-    def checkconsistency(self, md, solution, analyses): # {{{
-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr):
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        # Early return
+        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc) or (not md.transient.isoceantransport):
             return md
-        for i in range(len(self.global_average_thermosteric_sea_level_change)):
-            md = checkfield(md, 'field', self.global_average_thermosteric_sea_level_change[i], 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'field', self.sea_surface_height_change_above_geoid[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-            md = checkfield(md, 'field', self.sea_water_pressure_change_at_sea_floor[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'field', self.modelid, 'NaN', 1, 'Inf', 1, '>=', 1, '<=',len(self.global_average_thermosteric_sea_level_change))
-        if self.compute_fingerprints:
-            #check geodetic flag of slr is on
-            if not md.solidearth.settings.computesealevelchange:
-                raise Exception('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, slr class should have geodetic flag on')
+
+        for i in range(len(self.global_average_thermosteric_sea_level)):
+            md = checkfield(md, 'field', self.global_average_thermosteric_sea_level[i], 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'field', self.sea_surface_height_above_geoid[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+            md = checkfield(md, 'field', self.sea_water_pressure_at_sea_floor[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'field', self.modelid, 'NaN', 1, 'Inf', 1, '>=', 1, '<=', len(self.global_average_thermosteric_sea_level))
+
+        if self.solidearth.settings.compute_bp_grd:
+            md = checkfield(md, 'field', self.sea_water_pressure_at_sea_floor, 'empty', 1)
+
         return md
     #}}}
 
-    def marshall(self, prefix, md, fid): #{{{
+    def marshall(self, prefix, md, fid):  #{{{
         WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 2, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'compute_fingerprints', 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'modelid', 'format', 'Double')
-        WriteData(fid, prefix, 'name', 'md.dsl.nummodels', 'data', len(self.global_average_thermosteric_sea_level_change), 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level_change', 'format', 'MatArray', 'timeseries', 1, 'timeserieslength', 2, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_change_at_sea_floor', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts, 'scale', 1e-3)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_change_above_geoid', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts)
+        WriteData(fid, prefix, 'name', 'md.dsl.nummodels', 'data', len(self.global_average_thermosteric_sea_level), 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'MatArray', 'timeseries', 1, 'timeserieslength', 2)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1)
     #}}}
 
-    def extrude(self, md): #{{{
-        for i in range(len(self.global_average_thermosteric_sea_level_change)):
-            self.sea_surface_height_change_above_geoid[i] = project3d(md, 'vector', self.self.sea_surface_height_change_above_geoid[i], 'type', 'node', 'layer', 1)
-            self.sea_water_pressure_change_at_sea_floor[i] = project3d(md, 'vector', self.sea_water_pressure_change_at_sea_floor[i], 'type', 'node', 'layer', 1)
+    def extrude(self, md):  #{{{
+        for i in range(len(self.global_average_thermosteric_sea_level)):
+            self.sea_surface_height_above_geoid[i] = project3d(md, 'vector', self.self.sea_surface_height_above_geoid[i], 'type', 'node', 'layer', 1)
+            self.sea_water_pressure_at_sea_floor[i] = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor[i], 'type', 'node', 'layer', 1)
 
         return self
Index: /issm/trunk/src/m/classes/flowequation.js
===================================================================
--- /issm/trunk/src/m/classes/flowequation.js	(revision 26743)
+++ /issm/trunk/src/m/classes/flowequation.js	(revision 26744)
@@ -22,7 +22,9 @@
 		fielddisplay(this,'isSSA','is the Shelfy-Stream Approximation (SSA) used ?');
 		fielddisplay(this,'isL1L2','is the L1L2 approximation used ?');
-		fielddisplay(this,'isMLHO','is the MLHO approximation used ?');
+		fielddisplay(this,'isMLHO','is the Mono-Layer Higher-Order approximation used?');
 		fielddisplay(this,'isHO','is the Higher-Order (HO) approximation used ?');
 		fielddisplay(this,'isFS','are the Full-FS (FS) equations used ?');
+		fielddisplay(this,'isNitscheBC','is weakly imposed condition used?');
+		fielddisplay(this,'FSNitscheGamma','Gamma value for the Nitsche term (default: 1e6)');
 		fielddisplay(this,'fe_SSA',"Finite Element for SSA  'P1', 'P1bubble' 'P1bubblecondensed' 'P2'");
 		fielddisplay(this,'fe_HO', "Finite Element for HO   'P1' 'P1bubble' 'P1bubblecondensed' 'P1xP2' 'P2xP1' 'P2'");
@@ -60,4 +62,6 @@
 			checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0, 1]);
 			checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','flowequation.isNitscheBC','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','flowequation.FSNitscheGamma','numel',[1], '>=', 0);
 			checkfield(md,'fieldname','flowequation.fe_SSA','values',['P1','P1bubble','P1bubblecondensed','P2','P2bubble']);
 			checkfield(md,'fieldname','flowequation.fe_HO' ,'values',['P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4']);
@@ -80,19 +84,19 @@
 			}
 			else if (md.mesh.domaintype() =='2Dvertical'){
-				checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices, 1],'values',[2,5,6]);
-				checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[2,5,6]);
+				checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices, 1],'values',[2,4,5]);
+				checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[2,4,5]);
 			}
 			else if (md.mesh.domaintype() =='3D'){
-				checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices, 1],'values',[0,1,2,3,4,5,6,7,8,9]);
-				checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[0,1,2,3,4,5,6,7,8,9]);
+				checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices, 1],'values',[0,1,2,3,4,5,6,7,8]);
+				checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[0,1,2,3,4,5,6,7,8]);
 			}
 			else throw Error('Case not supported yet');
 			
 			if (!(this.isSIA | this.isSSA | this.isL1L2 | this.isMLHO | this.isHO | this.isFS)){
-				md = checkmessage(md,['no element types set for this model']);
+				checkmessage(md,['no element types set for this model']);
 			}
 			if(ArrayAnyEqual(ArrayIsMember('StressbalanceSIAAnalysis', analyses),1)){
 				if (ArrayAnyEqual(this.element_equation,1)){
-					if(this.vertex_equation & ArrayAnyBelowStrict(md.mask.ocean_levelset)){
+					if(this.vertex_equation & ArrayAnyBelowStrict(md.mask.groundedice_levelset)){
 						console.log(sprintf("\n !!! Warning: SIA's model is not consistent on ice shelves !!!\n"));
 					}
@@ -107,4 +111,6 @@
 			WriteData(fid,prefix,'object',this,'fieldname','isHO','format','Boolean');
 			WriteData(fid,prefix,'object',this,'fieldname','isFS','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','isNitscheBC','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','FSNitscheGamma','format','Double');
 			WriteData(fid,prefix,'object',this,'fieldname','fe_SSA','data',this.fe_SSA,'format','String');
 			WriteData(fid,prefix,'object',this,'fieldname','fe_HO','data',this.fe_HO,'format','String');
@@ -135,4 +141,6 @@
 	this.isHO                           = 0;
 	this.isFS                           = 0;
+	this.isNitscheBC                    = 0;
+	this.FSNitscheGamma                 = 1e6;
 	this.fe_SSA                         = '';
 	this.fe_HO                          = '';
Index: /issm/trunk/src/m/classes/flowequation.m
===================================================================
--- /issm/trunk/src/m/classes/flowequation.m	(revision 26743)
+++ /issm/trunk/src/m/classes/flowequation.m	(revision 26744)
@@ -62,8 +62,7 @@
 			end
 
-			%Oct 8 2020
-			%Warning if MLHO
+			%Nov 6 2021
 			if any(self.vertex_equation==4)
-				warning(['Monolayer Higher-Order (MLHO) detected in md.flowequation, this is probably a mistake, you need to run setflowequation again']);
+				disp(['Monolayer Higher-Order (MLHO) detected in md.flowequation, this is still under development. Please double check your settings.']);
 			end
 
@@ -122,6 +121,6 @@
 			md = checkfield(md,'fieldname','flowequation.borderFS','size',[md.mesh.numberofvertices 1],'values',[0 1]);
 			if strcmp(domaintype(md.mesh),'2Dhorizontal')
-				md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[1:2]);
-				md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[1:2]);
+				md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[1,2,4]);
+				md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[1,2,4]);
 			elseif strcmp(domaintype(md.mesh),'3Dsurface')
 				md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[1:2]);
Index: /issm/trunk/src/m/classes/flowequation.py
===================================================================
--- /issm/trunk/src/m/classes/flowequation.py	(revision 26743)
+++ /issm/trunk/src/m/classes/flowequation.py	(revision 26744)
@@ -27,9 +27,9 @@
         self.fe_HO = ''
         self.fe_FS = ''
-        self.augmented_lagrangian_r = 1.
-        self.augmented_lagrangian_rhop = 1.
-        self.augmented_lagrangian_rlambda = 1.
-        self.augmented_lagrangian_rholambda = 1.
-        self.XTH_theta = 0.
+        self.augmented_lagrangian_r = 1
+        self.augmented_lagrangian_rhop = 1
+        self.augmented_lagrangian_rlambda = 1
+        self.augmented_lagrangian_rholambda = 1
+        self.XTH_theta = 0
         self.vertex_equation = np.nan
         self.element_equation = np.nan
@@ -107,6 +107,9 @@
         md = checkfield(md, 'fieldname', 'flowequation.XTH_theta', 'numel', [1], '>=', 0., '<', .5)
         if m.strcmp(md.mesh.domaintype(), '2Dhorizontal'):
-            md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', [1, 2])
-            md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', [1, 2])
+            md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', [1, 2, 4])
+            md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', [1, 2, 4])
+        elif m.strcmp(md.mesh.domaintype(), '3Dsurface'):
+            md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', np.arange(1, 2 + 1))
+            md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', np.arange(1, 2 + 1))
         elif m.strcmp(md.mesh.domaintype(), '2Dvertical'):
             md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', [2, 5, 6])
@@ -117,4 +120,5 @@
         else:
             raise RuntimeError('Case not supported yet')
+
         if not (self.isSIA or self.isSSA or self.isL1L2 or self.isMLHO or self.isHO or self.isFS):
             md.checkmessage("no element types set for this model")
Index: /issm/trunk/src/m/classes/fourierlove.js
===================================================================
--- /issm/trunk/src/m/classes/fourierlove.js	(revision 26743)
+++ /issm/trunk/src/m/classes/fourierlove.js	(revision 26744)
@@ -11,14 +11,24 @@
 	this.setdefaultparameters = function() { // {{{
 		//we setup an elastic love number computation by default.
-		this.nfreq=1; 
-		this.frequencies=[0]; //Hz
-		this.sh_nmax=256; // .35 degree, 40 km at the equator.
-		this.sh_nmin=1; 
-		this.g0=10; // m/s^2; 
-		this.r0=6378*1e3; //m;
-		this.mu0=10**11; // Pa
-		this.allow_layer_deletion=1; 
-		this.love_kernels=0; 
-		this.forcing_type = 11; 
+			this.nfreq=1; 
+			this.frequencies=[0]; //Hz
+			this.sh_nmax=256; // .35 degree, 40 km at the equator.
+			this.sh_nmin=1;
+			// work on matlab script for computing g0 for given Earth's structure. 
+			this.g0=9.81; // m/s^2; 
+			this.r0=6371*1e3; //m;
+			this.mu0=1e11; // Pa
+			this.Gravitational_Constant=6.67259e-11; // m^3 kg^-1 s^-2
+			this.allow_layer_deletion=1;
+			this.underflow_tol=1e-16; //threshold of deep to surface love number ratio to trigger the deletion of layer 
+			this.integration_steps_per_layer=100;
+			this.istemporal=0;
+			this.n_temporal_iterations=8;
+			this.time=[0]; //s
+			this.love_kernels=0; 
+			this.forcing_type = 11; // surface loading
+			this.inner_core_boundary=1;
+			this.core_mantle_boundary=2;
+			this.complex_computation=0;
 	} // }}}
 	this.disp = function() { // {{{
@@ -28,26 +38,61 @@
 		fielddisplay(this,'sh_nmin','minimum spherical harmonic degree (default 1)');
 		fielddisplay(this,'g0','adimensioning constant for gravity (default 10) [m/s^2]');
-		fielddisplay(this,'r0','adimensioning constant for radius (default 6378*10^3) [m]');
+		fielddisplay(this,'r0','adimensioning constant for radius (default 6371*10^3) [m]');
 		fielddisplay(this,'mu0','adimensioning constant for stress (default 10^11) [Pa]');
+		fielddisplay(this,'Gravitational_Constant','Newtonian constant of gravitation (default 6.67259e-11 [m^3 kg^-1 s^-2])');
 		fielddisplay(this,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default 1)');
+		fielddisplay(this,'underflow_tol','threshold of deep to surface love number ratio to trigger the deletion of layers (default 2.2204460492503131E-016)');
+		fielddisplay(this,'integration_steps_per_layer','number of radial steps to propagate the yi system from the bottom to the top of each layer (default 100)');
+		fielddisplay(this,'istemporal','1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default 0)', 'If 1: use fourierlove function build_frequencies_from_time to meet consistency');
+		fielddisplay(this,'n_temporal_iterations','max number of iterations in the inverse Laplace transform. Also the number of spectral samples per time step requested (default 8)');
+		fielddisplay(this,'time','time vector for deformation if istemporal (default 0) [s]');
 		fielddisplay(this,'love_kernels','compute love numbers at depth? (default 0)');
-		fielddisplay(this,'forcing_type',['integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :','1:  Inner core boundary -- Volumic Potential','2:  Inner core boundary -- Pressure','3:  Inner core boundary -- Loading','4:  Inner core boundary -- Tangential traction','5:  Core mantle boundary -- Volumic Potential','6:  Core mantle boundary -- Pressure','7:  Core mantle boundary -- Loading','8:  Core mantle boundary -- Tangential traction','9:  Surface -- Volumic Potential','10: Surface -- Pressure','11: Surface -- Loading','12: Surface -- Tangential traction ']); 
+		fielddisplay(this,'forcing_type','integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :','1:  Inner core boundary -- Volumic Potential','2:  Inner core boundary -- Pressure','3:  Inner core boundary -- Loading','4:  Inner core boundary -- Tangential traction','5:  Core mantle boundary -- Volumic Potential','6:  Core mantle boundary -- Pressure','7:  Core mantle boundary -- Loading','8:  Core mantle boundary -- Tangential traction','9:  Surface -- Volumic Potential','10: Surface -- Pressure','11: Surface -- Loading','12: Surface -- Tangential traction ');
+		fielddisplay(this,'inner_core_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 1--4 (default 1)');
+		fielddisplay(this,'core_mantle_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default 2)'); 
 
 	} // }}}
 	this.checkconsistency = function(md,solution,analyses) { // {{{
 
-		md = checkfield(md,'fieldname','love.nfreq','NaN',1,'Inf',1,'numel',1,'>',0);
-		md = checkfield(md,'fieldname','love.frequencies','NaN',1,'Inf',1,'numel',md.love.nfreq);
-		md = checkfield(md,'fieldname','love.sh_nmax','NaN',1,'Inf',1,'numel',1,'>',0);
-		md = checkfield(md,'fieldname','love.sh_nmin','NaN',1,'Inf',1,'numel',1,'>',0);
-		md = checkfield(md,'fieldname','love.g0','NaN',1,'Inf',1,'numel',1,'>',0);
-		md = checkfield(md,'fieldname','love.r0','NaN',1,'Inf',1,'numel',1,'>',0);
-		md = checkfield(md,'fieldname','love.mu0','NaN',1,'Inf',1,'numel',1,'>',0);
-		md = checkfield(md,'fieldname','love.allow_layer_deletion','values',[0, 1]);
-		md = checkfield(md,'fieldname','love.love_kernels','values',[0, 1]);
-		md = checkfield(md,'fieldname','love.forcing_type','NaN',1,'Inf',1,'numel',1,'>',0, '<=', 12);
-		if (md.love.sh_nmin<=1 && md.love.forcing_type==9) {
+		if (ArrayAnyEqual(ArrayIsMember('LoveAnalysis',analyses),1)) return; 
+
+		checkfield(md,'fieldname','love.nfreq','NaN',1,'Inf',1,'numel',1,'>',0);
+		checkfield(md,'fieldname','love.frequencies','NaN',1,'Inf',1,'numel',md.love.nfreq);
+		checkfield(md,'fieldname','love.sh_nmax','NaN',1,'Inf',1,'numel',1,'>',0);
+		checkfield(md,'fieldname','love.sh_nmin','NaN',1,'Inf',1,'numel',1,'>',0);
+		checkfield(md,'fieldname','love.g0','NaN',1,'Inf',1,'numel',1,'>',0);
+		checkfield(md,'fieldname','love.r0','NaN',1,'Inf',1,'numel',1,'>',0);
+		checkfield(md,'fieldname','love.mu0','NaN',1,'Inf',1,'numel',1,'>',0);
+		checkfield(md,'fieldname','love.Gravitational_Constant','NaN',1,'Inf',1,'numel',1,'>',0);
+		checkfield(md,'fieldname','love.allow_layer_deletion','values',[0, 1]);
+		checkfield(md,'fieldname','love.underflow_tol','NaN',1,'Inf',1,'numel',1,'>',0);
+		checkfield(md,'fieldname','love.integration_steps_per_layer','NaN',1,'Inf',1,'numel',1,'>',0);
+		checkfield(md,'fieldname','love.love_kernels','values',[0, 1]);
+		checkfield(md,'fieldname','love.forcing_type','NaN',1,'Inf',1,'numel',1,'>',0, '<=', 12);
+		checkfield(md,'fieldname','love.complex_computation','NaN',1,'Inf',1,'numel',1,'values',[0, 1]);
+
+		checkfield(md,'fieldname','love.istemporal','values',[0, 1]);
+
+		if (md.love.istemporal==1){
+			checkfield(md,'fieldname','love.n_temporal_iterations','NaN',1,'Inf',1,'numel',1,'>',0);
+			checkfield(md,'fieldname','love.time','NaN',1,'Inf',1,'numel',md.love.nfreq/2/md.love.n_temporal_iterations);
+		}
+		if (md.love.sh_nmin<=1 && md.love.forcing_type==9 || md.love.forcing_type==5 || md.love.forcing_type==1) {
 			throw 'Degree 1 not supported for Volumetric Potential forcing. Use sh_min>=2 for this kind of calculation.';
 		}
+
+		//need 'litho' material: 
+		console.log('md.fourierlove check consistency only paritally implemented for litho material');
+		/*
+		if ~isa(md.materials,'materials') | ~sum(strcmpi(md.materials.nature,'litho'))
+			error('Need a "litho" material to run a Fourier Love number analysis');
+		end
+
+		mat=find(strcmpi(md.materials.nature,'litho'));
+		if (md.love.forcing_type<=4) {
+			checkfield(md,'fieldname','love.inner_core_boundary','NaN',1,'Inf',1,'numel',1,'>',0, '<=', md.materials(mat).numlayers);
+		} else if (md.love.forcing_type<=8) {
+			checkfield(md,'fieldname','love.core_mantle_boundary','NaN',1,'Inf',1,'numel',1,'>',0, '<=', md.materials(mat).numlayers);
+		} */
 	} // }}}
 	this.marshall = function(md,prefix,fid) { // {{{
@@ -60,22 +105,39 @@
 		WriteData(fid,prefix,'object',this,'fieldname','r0','format','Double');
 		WriteData(fid,prefix,'object',this,'fieldname','mu0','format','Double');
+		WriteData(fid,prefix,'object',this,'fieldname','Gravitational_Constant','format','Double');
 		WriteData(fid,prefix,'object',this,'fieldname','allow_layer_deletion','format','Boolean');
+		WriteData(fid,prefix,'object',this,'fieldname','underflow_tol','format','Double');
+		WriteData(fid,prefix,'object',this,'fieldname','integration_steps_per_layer','format','Integer');
+		WriteData(fid,prefix,'object',this,'fieldname','istemporal','format','Boolean');
+		WriteData(fid,prefix,'object',this,'fieldname','n_temporal_iterations','format','Integer');
+		WriteData(fid,prefix,'object',this,'fieldname','complex_computation','format','Boolean');
+		//note: no need to marshall the time vector, we have frequencies
 		WriteData(fid,prefix,'object',this,'fieldname','love_kernels','format','Boolean');
 		WriteData(fid,prefix,'object',this,'fieldname','forcing_type','format','Integer');
+		WriteData(fid,prefix,'object',this,'fieldname','inner_core_boundary','format','Integer');
+		WriteData(fid,prefix,'object',this,'fieldname','core_mantle_boundary','format','Integer');
 
 	} // }}}
 	//properties 
 	// {{{
-		
-	this.nfreq                =  NaN;
-	this.frequencies          =  NaN;
-	this.sh_nmax              =  NaN;
-	this.sh_nmin              =  NaN;
-	this.g0                   =  NaN; 
-	this.r0                   =  NaN; 
-	this.mu0                  =  NaN;
-	this.allow_layer_deletion =  NaN;
-	this.love_kernels =  NaN;
-	this.forcing_type         =  NaN;
+	this.nfreq                		= NaN;
+	this.frequencies          		= NaN;
+	this.sh_nmax              		= NaN;
+	this.sh_nmin              		= NaN;
+	this.g0                   		= NaN; 
+	this.r0                   		= NaN; 
+	this.mu0                  		= NaN;
+	this.Gravitational_Constant 	= 0;
+	this.allow_layer_deletion 		= NaN;
+	this.underflow_tol              = 0;
+	this.integration_steps_per_layer= 0;
+	this.istemporal		   			= 0;
+	this.n_temporal_iterations	  	= 0;
+	this.time			            = 0;
+	this.love_kernels 				= NaN;
+	this.forcing_type         		= NaN;
+	this.inner_core_boundary	    = 0;
+	this.core_mantle_boundary	    = 0;
+	this.complex_computation        = 0;
 	
 	//set defaults
Index: /issm/trunk/src/m/classes/fourierlove.m
===================================================================
--- /issm/trunk/src/m/classes/fourierlove.m	(revision 26743)
+++ /issm/trunk/src/m/classes/fourierlove.m	(revision 26744)
@@ -6,14 +6,24 @@
 classdef fourierlove
 	properties (SetAccess=public) 
-		nfreq                = 0;
-		frequencies          = 0;
-		sh_nmax              = 0;
-		sh_nmin              = 0;
-		g0                   = 0;
-		r0                   = 0;
-		mu0                  = 0;
-		allow_layer_deletion = 0;
-		love_kernels         = 0;
-		forcing_type         = 0;
+		nfreq                       = 0;
+		frequencies                 = 0;
+		sh_nmax                     = 0;
+		sh_nmin                     = 0;
+		g0                          = 0;
+		r0                          = 0;
+		mu0                         = 0;
+		Gravitational_Constant      = 0;
+		allow_layer_deletion        = 0;
+		underflow_tol               = 0;
+		integration_steps_per_layer = 0;
+		istemporal                  = 0;
+		n_temporal_iterations       = 0;
+		time                        = 0;
+		love_kernels                = 0;
+		forcing_type                = 0;
+		inner_core_boundary         = 0;
+		core_mantle_boundary        = 0;
+		complex_computation         = 0;
+
 	end
 	methods (Static)
@@ -24,6 +34,4 @@
 	end
 	methods
-		function self = extrude(self,md) % {{{
-		end % }}}
 		function self = fourierlove(varargin) % {{{
 			switch nargin
@@ -43,23 +51,42 @@
 			self.g0=9.81; % m/s^2; 
 			self.r0=6371*1e3; %m;
-			self.mu0=10^11; % Pa
-			self.allow_layer_deletion=1; 
+			self.mu0=1e11; % Pa
+			self.Gravitational_Constant=6.67259e-11; % m^3 kg^-1 s^-2
+			self.allow_layer_deletion=1;
+			self.underflow_tol=1e-16; %threshold of deep to surface love number ratio to trigger the deletion of layer 
+			self.integration_steps_per_layer=100;
+			self.istemporal=0;
+			self.n_temporal_iterations=8;
+			self.time=[0]; %s
 			self.love_kernels=0; 
-			self.forcing_type = 11; 
+			self.forcing_type = 11; % surface loading
+			self.inner_core_boundary=1;
+			self.core_mantle_boundary=2;
+			self.complex_computation=0;
 		end % }}}
 		function disp(self) % {{{
-			fielddisplay(self,'nfreq','number of frequencies sampled (default 1, elastic) [Hz]');
+			fielddisplay(self,'nfreq','number of frequencies sampled (default: 1, elastic) [Hz]');
 			fielddisplay(self,'frequencies','frequencies sampled (convention defaults to 0 for the elastic case) [Hz]');
-			fielddisplay(self,'sh_nmax','maximum spherical harmonic degree (default 256, .35 deg, or 40 km at equator)');
-			fielddisplay(self,'sh_nmin','minimum spherical harmonic degree (default 1)');
-			fielddisplay(self,'g0','adimensioning constant for gravity (default 10) [m/s^2]');
-			fielddisplay(self,'r0','adimensioning constant for radius (default 6378*10^3) [m]');
-			fielddisplay(self,'mu0','adimensioning constant for stress (default 10^11) [Pa]');
-			fielddisplay(self,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default 1)');
-			fielddisplay(self,'love_kernels','compute love numbers at depth? (default 0)');
-			fielddisplay(self,'forcing_type',{'integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :','1:  Inner core boundary -- Volumic Potential','2:  Inner core boundary -- Pressure','3:  Inner core boundary -- Loading','4:  Inner core boundary -- Tangential traction','5:  Core mantle boundary -- Volumic Potential','6:  Core mantle boundary -- Pressure','7:  Core mantle boundary -- Loading','8:  Core mantle boundary -- Tangential traction','9:  Surface -- Volumic Potential','10: Surface -- Pressure','11: Surface -- Loading','12: Surface -- Tangential traction '}); 
+			fielddisplay(self,'sh_nmax','maximum spherical harmonic degree (default: 256, .35 deg, or 40 km at equator)');
+			fielddisplay(self,'sh_nmin','minimum spherical harmonic degree (default: 1)');
+			fielddisplay(self,'g0','adimensioning constant for gravity (default: 10) [m/s^2]');
+			fielddisplay(self,'r0','adimensioning constant for radius (default: 6371*10^3) [m]');
+			fielddisplay(self,'mu0','adimensioning constant for stress (default: 10^11) [Pa]');
+			fielddisplay(self,'Gravitational_Constant','Newtonian constant of gravitation (default: 6.67259e-11 [m^3 kg^-1 s^-2])');
+			fielddisplay(self,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default: 1)');
+			fielddisplay(self,'underflow_tol','threshold of deep to surface love number ratio to trigger the deletion of layers (default: 1e-16)');
+			fielddisplay(self,'integration_steps_per_layer','number of radial steps to propagate the yi system from the bottom to the top of each layer (default: 100)');
+			fielddisplay(self,'istemporal',{'1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default: 0)', 'If 1: use fourierlove function build_frequencies_from_time to meet consistency'});
+			fielddisplay(self,'n_temporal_iterations','max number of iterations in the inverse Laplace transform. Also the number of spectral samples per time step requested (default: 8)');
+			fielddisplay(self,'time','time vector for deformation if istemporal (default: 0) [s]');
+			fielddisplay(self,'love_kernels','compute love numbers at depth? (default: 0)');
+			fielddisplay(self,'forcing_type',{'integer indicating the nature and depth of the forcing for the Love number calculation (default: 11):','1:  Inner core boundary -- Volumic Potential','2:  Inner core boundary -- Pressure','3:  Inner core boundary -- Loading','4:  Inner core boundary -- Tangential traction','5:  Core mantle boundary -- Volumic Potential','6:  Core mantle boundary -- Pressure','7:  Core mantle boundary -- Loading','8:  Core mantle boundary -- Tangential traction','9:  Surface -- Volumic Potential','10: Surface -- Pressure','11: Surface -- Loading','12: Surface -- Tangential traction '});
+			fielddisplay(self,'inner_core_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 1--4 (default: 1)');
+			fielddisplay(self,'core_mantle_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default: 2)'); 
 
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			if ~ismember('LoveAnalysis',analyses), return; end
 
 			md = checkfield(md,'fieldname','love.nfreq','NaN',1,'Inf',1,'numel',1,'>',0);
@@ -70,13 +97,36 @@
 			md = checkfield(md,'fieldname','love.r0','NaN',1,'Inf',1,'numel',1,'>',0);
 			md = checkfield(md,'fieldname','love.mu0','NaN',1,'Inf',1,'numel',1,'>',0);
+			md = checkfield(md,'fieldname','love.Gravitational_Constant','NaN',1,'Inf',1,'numel',1,'>',0);
 			md = checkfield(md,'fieldname','love.allow_layer_deletion','values',[0 1]);
+			md = checkfield(md,'fieldname','love.underflow_tol','NaN',1,'Inf',1,'numel',1,'>',0);
+			md = checkfield(md,'fieldname','love.integration_steps_per_layer','NaN',1,'Inf',1,'numel',1,'>',0);
 			md = checkfield(md,'fieldname','love.love_kernels','values',[0 1]);
 			md = checkfield(md,'fieldname','love.forcing_type','NaN',1,'Inf',1,'numel',1,'>',0, '<=', 12);
-			if md.love.sh_nmin<=1 & md.love.forcing_type==9
-				error('Degree 1 not supported for Volumetric Potential forcing. Use sh_min>=2 for this kind of calculation.')
+			md = checkfield(md,'fieldname','love.complex_computation','NaN',1,'Inf',1,'numel',1,'values',[0 1]);
+
+			md = checkfield(md,'fieldname','love.istemporal','values',[0 1]);
+			if md.love.istemporal==1
+				md = checkfield(md,'fieldname','love.n_temporal_iterations','NaN',1,'Inf',1,'numel',1,'>',0);
+				md = checkfield(md,'fieldname','love.time','NaN',1,'Inf',1,'numel',md.love.nfreq/2/md.love.n_temporal_iterations);
 			end
+			if md.love.sh_nmin<=1 & (md.love.forcing_type==1 || md.love.forcing_type==5 || md.love.forcing_type==9)
+				error(['Degree 1 not supported for forcing type ' num2str(md.love.forcing_type) '. Use sh_min>=2 for this kind of calculation.'])
+			end
+
+			%need 'litho' material: 
+			if ~isa(md.materials,'materials') | ~sum(strcmpi(md.materials.nature,'litho'))
+				error('Need a ''litho'' material to run a Fourier Love number analysis');
+			end
+
+			mat=find(strcmpi(md.materials.nature,'litho'));
+			if md.love.forcing_type<=4
+				md = checkfield(md,'fieldname','love.inner_core_boundary','NaN',1,'Inf',1,'numel',1,'>',0, '<=', md.materials(mat).numlayers);
+			elseif md.love.forcing_type<=8
+				md = checkfield(md,'fieldname','love.core_mantle_boundary','NaN',1,'Inf',1,'numel',1,'>',0, '<=', md.materials(mat).numlayers);
+			end
+
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
-		
+
 			WriteData(fid,prefix,'object',self,'fieldname','nfreq','format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','frequencies','format','DoubleMat','mattype',3);
@@ -86,12 +136,36 @@
 			WriteData(fid,prefix,'object',self,'fieldname','r0','format','Double');
 			WriteData(fid,prefix,'object',self,'fieldname','mu0','format','Double');
+			WriteData(fid,prefix,'object',self,'fieldname','Gravitational_Constant','format','Double');
 			WriteData(fid,prefix,'object',self,'fieldname','allow_layer_deletion','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','underflow_tol','format','Double');
+			WriteData(fid,prefix,'object',self,'fieldname','integration_steps_per_layer','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','istemporal','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','n_temporal_iterations','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','complex_computation','format','Boolean');
+			%note: no need to marshall the time vector, we have frequencies
 			WriteData(fid,prefix,'object',self,'fieldname','love_kernels','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','forcing_type','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','inner_core_boundary','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','core_mantle_boundary','format','Integer');
 
+		end % }}}
+		function self = extrude(self,md) % {{{
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
 			error('not implemented yet!');
 		end % }}}
+		function self=build_frequencies_from_time(self) % {{{
+			if ~self.istemporal
+				error('cannot build frequencies for temporal love numbers if love.istemporal==0')
+			end
+			disp('Temporal love numbers: Overriding md.love.nfreq and md.love.frequencies');
+			self.nfreq=length(self.time)*2*self.n_temporal_iterations;
+			self.frequencies=zeros(self.nfreq,1);
+			for i=1:length(self.time)
+				for j=1:2*self.n_temporal_iterations
+					self.frequencies((i-1)*2*self.n_temporal_iterations +j) = j*log(2)/self.time(i)/2/pi;
+				end
+			end
+		end % }}}
 	end
 end
Index: /issm/trunk/src/m/classes/fourierlove.py
===================================================================
--- /issm/trunk/src/m/classes/fourierlove.py	(revision 26743)
+++ /issm/trunk/src/m/classes/fourierlove.py	(revision 26744)
@@ -1,2 +1,4 @@
+import numpy as np
+
 from fielddisplay import fielddisplay
 from checkfield import checkfield
@@ -5,11 +7,11 @@
 
 class fourierlove(object):
+    """FOURIERLOVE - class definition
+
+    Usage:
+        md.love = fourierlove()
     """
-    Fourier Love Number class definition
 
-       Usage:
-          fourierlove = fourierlove()
-    """
-    def __init__(self):  # {{{
+    def __init__(self): #{{{
         self.nfreq = 0
         self.frequencies = 0
@@ -19,80 +21,126 @@
         self.r0 = 0
         self.mu0 = 0
+        self.Gravitational_Constant = 0
         self.allow_layer_deletion = 0
+        self.underflow_tol = 0
+        self.integration_steps_per_layer = 0
+        self.istemporal = 0
+        self.n_temporal_iterations = 0
+        self.time = 0
         self.love_kernels = 0
         self.forcing_type = 0
+        self.inner_core_boundary = 0
+        self.core_mantle_boundary = 0
+        self.complex_computation = 0
 
-    #set defaults
         self.setdefaultparameters()
     #}}}
 
-    def __repr__(self):  # {{{
-        string = '   Fourier Love class:'
-        string = "%s\n%s" % (string, fielddisplay(self, 'nfreq', 'number of frequencies sampled (default 1, elastic) [Hz]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'frequencies', 'frequencies sampled (convention defaults to 0 for the elastic case) [Hz]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'sh_nmax', 'maximum spherical harmonic degree (default 256, .35 deg, or 40 km at equator)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'sh_nmin', 'minimum spherical harmonic degree (default 1)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'g0', 'adimensioning constant for gravity (default 10) [m / s^2]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'r0', 'adimensioning constant for radius (default 6378e3) [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'mu0', 'adimensioning constant for stress (default 1.0e11) [Pa]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'allow_layer_deletion', 'allow for migration of the integration boundary with increasing spherical harmonics degree (default 1)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'love_kernels', 'compute love numbers at depth? (default 0)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'forcing_type', 'integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :'))
-        string = "%s\n%s" % (string, '                                                     1:  Inner core boundary -- Volumic Potential')
-        string = "%s\n%s" % (string, '                                                     2:  Inner core boundary --  Pressure')
-        string = "%s\n%s" % (string, '                                                     3:  Inner core boundary --  Loading')
-        string = "%s\n%s" % (string, '                                                     4:  Inner core boundary --  Tangential traction')
-        string = "%s\n%s" % (string, '                                                     5:  Core mantle boundary --  Volumic Potential')
-        string = "%s\n%s" % (string, '                                                     6:  Core mantle boundary --  Pressure')
-        string = "%s\n%s" % (string, '                                                     7:  Core mantle boundary --  Loading')
-        string = "%s\n%s" % (string, '                                                     8:  Core mantle boundary --  Tangential traction')
-        string = "%s\n%s" % (string, '                                                     9:  Surface--  Volumic Potential')
-        string = "%s\n%s" % (string, '                                                     10: Surface--  Pressure')
-        string = "%s\n%s" % (string, '                                                     11: Surface--  Loading')
-        string = "%s\n%s" % (string, '                                                     12: Surface--  Tangential traction ')
+    def __repr__(self): #{{{
+        # TODO:
+        # - Correct display to match MATLAB
+        #
+        s = '   Fourier Love class:\n'
+        s += '{}\n'.format(fielddisplay(self, 'nfreq', 'number of frequencies sampled (default: 1, elastic) [Hz]'))
+        s += '{}\n'.format(fielddisplay(self, 'frequencies', 'frequencies sampled (convention defaults to 0 for the elastic case) [Hz]'))
+        s += '{}\n'.format(fielddisplay(self, 'sh_nmax', 'maximum spherical harmonic degree (default: 256, .35 deg, or 40 km at equator)'))
+        s += '{}\n'.format(fielddisplay(self, 'sh_nmin', 'minimum spherical harmonic degree (default: 1)'))
+        s += '{}\n'.format(fielddisplay(self, 'g0', 'adimensioning constant for gravity (default: 10) [m/s^2]'))
+        s += '{}\n'.format(fielddisplay(self, 'r0', 'adimensioning constant for radius (default: 6371*10^3) [m]'))
+        s += '{}\n'.format(fielddisplay(self, 'mu0', 'adimensioning constant for stress (default: 10^11) [Pa]'))
+        s += '{}\n'.format(fielddisplay(self, 'allow_layer_deletion', 'allow for migration of the integration boundary with increasing spherical harmonics degree (default: 1)'))
+        s += '{}\n'.format(fielddisplay(self, 'Gravitational_Constant', 'Newtonian constant of gravitation (default: 6.67259e-11 [m^3 kg^-1 s^-2])'))
+        s += '{}\n'.format(fielddisplay(self, 'allow_layer_deletion', 'allow for migration of the integration boundary with increasing spherical harmonics degree (default: 1)'))
+        s += '{}\n'.format(fielddisplay(self, 'underflow_tol', 'threshold of deep to surface love number ratio to trigger the deletion of layers (default: 1e-16)'))
+        s += '{}\n'.format(fielddisplay(self, 'integration_steps_per_layer', 'number of radial steps to propagate the yi system from the bottom to the top of each layer (default: 100)'))
+        s += '{}\n'.format(fielddisplay(self, 'istemporal', ['1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default: 0)', 'If 1: use fourierlove function build_frequencies_from_time to meet consistency']))
+        s += '{}\n'.format(fielddisplay(self, 'n_temporal_iterations', 'max number of iterations in the inverse Laplace transform. Also the number of spectral samples per time step requested (default: 8)'))
+        s += '{}\n'.format(fielddisplay(self, 'time', 'time vector for deformation if istemporal (default: 0) [s]'))
+        s += '{}\n'.format(fielddisplay(self, 'love_kernels', 'compute love numbers at depth? (default: 0)'))
+        s += '{}\n'.format(fielddisplay(self, 'forcing_type', 'integer indicating the nature and depth of the forcing for the Love number calculation (default: 11):'))
+        s += '{}\n'.format('                                                     1:  Inner core boundary -- Volumic Potential')
+        s += '{}\n'.format('                                                     2:  Inner core boundary --  Pressure')
+        s += '{}\n'.format('                                                     3:  Inner core boundary --  Loading')
+        s += '{}\n'.format('                                                     4:  Inner core boundary --  Tangential traction')
+        s += '{}\n'.format('                                                     5:  Core mantle boundary --  Volumic Potential')
+        s += '{}\n'.format('                                                     6:  Core mantle boundary --  Pressure')
+        s += '{}\n'.format('                                                     7:  Core mantle boundary --  Loading')
+        s += '{}\n'.format('                                                     8:  Core mantle boundary --  Tangential traction')
+        s += '{}\n'.format('                                                     9:  Surface--  Volumic Potential')
+        s += '{}\n'.format('                                                     10: Surface--  Pressure')
+        s += '{}\n'.format('                                                     11: Surface--  Loading')
+        s += '{}\n'.format('                                                     12: Surface--  Tangential traction ')
+        s += '{}\n'.format(fielddisplay(self, 'inner_core_boundary', 'interface index in materials.radius locating forcing. Only used for forcing_type 1--4 (default: 1)'))
+        s += '{}\n'.format(fielddisplay(self, 'core_mantle_boundary', 'interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default: 2)'))
 
-        return string
+        return s
     #}}}
 
-    def extrude(self, md):  # {{{
-        return self
+    def setdefaultparameters(self): #{{{
+        # We setup an elastic love number computation by default
+        self.nfreq = 1
+        self.frequencies = [0] # Hz
+        self.sh_nmax = 256 # .35 degree, 40 km at the equator
+        self.sh_nmin = 1
+        # Work on matlab script for computing g0 for given Earth's structure
+        self.g0 = 9.81 # m/s^2
+        self.r0 = 6371 * 1e3 # m
+        self.mu0 = 1e11 # Pa
+        self.Gravitational_Constant = 6.67259e-11 # m^3 kg^-1 s^-2
+        self.allow_layer_deletion = 1
+        self.underflow_tol = 1e-16 # Threshold of deep to surface love number ratio to trigger the deletion of layer
+        self.integration_steps_per_layer = 100
+        self.istemporal = 0
+        self.n_temporal_iterations = 8
+        self.time = [0] # s
+        self.love_kernels = 0
+        self.forcing_type = 11 # Surface loading
+        self.inner_core_boundary = 1
+        self.core_mantle_boundary = 2
+        self.complex_computation = 0
     #}}}
 
-    def setdefaultparameters(self):  # {{{
-        #we setup an elastic love number computation by default.
-        self.nfreq = 1
-        self.frequencies = [0]  #Hz
-        self.sh_nmax = 256  # .35 degree, 40 km at the equator.
-        self.sh_nmin = 1
-        self.g0 = 9.81 # m/s^2
-        self.r0 = 6371e3 #m
-        self.mu0 = 1e11 # Pa
-        self.allow_layer_deletion = 1
-        self.love_kernels = 0
-        self.forcing_type = 11
+    def checkconsistency(self, md, solution, analyses): #{{{
+        if 'LoveAnalysis' not in analyses:
+            return md
 
-        return self
+        md = checkfield(md, 'fieldname', 'love.nfreq', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+        md = checkfield(md, 'fieldname', 'love.frequencies', 'NaN', 1, 'Inf', 1, 'numel', md.love.nfreq)
+        md = checkfield(md, 'fieldname', 'love.sh_nmax', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+        md = checkfield(md, 'fieldname', 'love.sh_nmin', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+        md = checkfield(md, 'fieldname', 'love.g0', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+        md = checkfield(md, 'fieldname', 'love.r0', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+        md = checkfield(md, 'fieldname', 'love.mu0', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+        md = checkfield(md, 'fieldname', 'love.Gravitational_Constant', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+        md = checkfield(md, 'fieldname', 'love.allow_layer_deletion', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'love.underflow_tol', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+        md = checkfield(md, 'fieldname', 'love.integration_steps_per_layer', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+        md = checkfield(md, 'fieldname', 'love.love_kernels', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'love.forcing_type', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0, '<=', 12)
+        md = checkfield(md, 'fieldname', 'love.complex_computation', 'NaN', 1, 'Inf', 1, 'numel', 1, 'values', [0, 1])
+
+        md = checkfield(md, 'fieldname', 'love.istemporal', 'values', [0, 1])
+        if md.love.istemporal:
+            md = checkfield(md, 'fieldname', 'love.n_temporal_iterations', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+            md = checkfield(md, 'fieldname', 'love.time', 'NaN', 1, 'Inf', 1, 'numel', md.love.nfreq / 2 / md.love.n_temporal_iterations)
+        if md.love.sh_nmin <= 1 and (md.love.forcing_type == 9 or md.love.forcing_type == 5 or md.love.forcing_type == 1):
+            raise RuntimeError('Degree 1 not supported for forcing type {}. Use sh_min >= 2 for this kind of calculation.'.format(md.love.forcing_type))
+
+        # Need 'litho' material
+        if not hasattr(md.materials, 'materials') or 'litho' not in md.materials.nature:
+            raise RuntimeError('Need a \'litho\' material to run a Fourier Love number analysis')
+
+        mat = np.where(np.array(nature) == 'litho')[0]
+        if md.love.forcing_type <= 4:
+            md = checkfield(md, 'fieldname', 'love.inner_core_boundary', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0, '<=', md.materials[mat].numlayers)
+        elif md.love.forcing_type <= 8:
+            md = checkfield(md, 'fieldname', 'love.core_mantle_boundary', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0, '<=', md.materials[mat].numlayers)
+
+        return md
     #}}}
 
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        md = checkfield(md, 'fieldname', 'love.nfreq', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0)
-        md = checkfield(md, 'fieldname', 'love.frequencies', 'NaN', 1, 'Inf', 1, 'numel', [md.love.nfreq])
-        md = checkfield(md, 'fieldname', 'love.sh_nmax', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0)
-        md = checkfield(md, 'fieldname', 'love.sh_nmin', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0)
-        md = checkfield(md, 'fieldname', 'love.g0', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0)
-        md = checkfield(md, 'fieldname', 'love.r0', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0)
-        md = checkfield(md, 'fieldname', 'love.mu0', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0)
-        md = checkfield(md, 'fieldname', 'love.allow_layer_deletion', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'love.love_kernels', 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'love.forcing_type', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0, '<=', 12)
-        if md.love.sh_nmin <= 1 and md.love.forcing_type == 9:
-            raise RuntimeError("Degree 1 not supported for Volumetric Potential forcing. Use sh_min >= 2 for this kind of calculation.")
-
-        return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
+    def marshall(self, prefix, md, fid): #{{{
         WriteData(fid, prefix, 'object', self, 'fieldname', 'nfreq', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'frequencies', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'frequencies', 'format', 'DoubleMat', 'mattype',3)
         WriteData(fid, prefix, 'object', self, 'fieldname', 'sh_nmax', 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'sh_nmin', 'format', 'Integer')
@@ -100,6 +148,30 @@
         WriteData(fid, prefix, 'object', self, 'fieldname', 'r0', 'format', 'Double')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'mu0', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'Gravitational_Constant', 'format', 'Double')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'allow_layer_deletion', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'underflow_tol', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'integration_steps_per_layer', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'istemporal', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'n_temporal_iterations', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'complex_computation', 'format', 'Boolean')
+        # Note: no need to marshall the time vector, we have frequencies
         WriteData(fid, prefix, 'object', self, 'fieldname', 'love_kernels', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'forcing_type', 'format', 'Integer')
-    # }}}
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'inner_core_boundary', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'core_mantle_boundary', 'format', 'Integer')
+    #}}}
+
+    def extrude(self, md): #{{{
+        return self
+    #}}}
+
+    def build_frequencies_from_time(self): #{{{
+        if not self.istemporal:
+            raise RuntimeError('cannot build frequencies for temporal love numbers if love.istemporal==0')
+        print('Temporal love numbers: Overriding md.love.nfreq and md.love.frequencies')
+        self.nfreq = len(self.time) * 2 * self.n_temporal_iterations
+        self.frequencies = np.zeros((self.nfreq, 1))
+        for i in range(len(self.time)):
+            for j in range(2 * self.n_temporal_iterations):
+                self.frequencies[(i - 1) * 2 * self.n_temporal_iterations + j] = j * np.log(2) / self.time[i] / 2 / np.pi
+    #}}}
Index: /issm/trunk/src/m/classes/friction.js
===================================================================
--- /issm/trunk/src/m/classes/friction.js	(revision 26743)
+++ /issm/trunk/src/m/classes/friction.js	(revision 26744)
@@ -14,5 +14,7 @@
 		fielddisplay(this,'p','p exponent');
 		fielddisplay(this,'q','q exponent');
+		fielddisplay(this,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
 		fielddisplay(this,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled(not implemented yet)');
+		fielddisplay(this,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');
 	} // }}}
 	this.extrude = function(md) {//{{{
@@ -42,12 +44,13 @@
 				return; 
 			}
-			md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements ,1]);
-			md = checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements ,1]);
-			md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0, 1, 2]);
+			checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1);
+			checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements ,1]);
+			checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements ,1]);
+			checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0, 1, 2]);
+			checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
 			switch (this.coupling) {
 				case 0:
 				case 1:
-					md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
+					checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
 					break;
 				case 2:
@@ -63,11 +66,20 @@
 
 			WriteData(fid,prefix,'name','md.friction.law','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			//WriteData(fid,prefix,'object',this,'fieldname','coefficient','format','DoubleMat','mattype',1);
+			let mattype,tsl;
+			if ((size(this.coefficient,0)==md.mesh.numberofvertices | size(this.coefficient,1)==md.mesh.numberofvertices+1)) {
+				mattype=1;
+				tsl = md.mesh.numberofvertices;
+			} else {
+				mattype=2;
+				tsl = md.mesh.numberofelements;
+			}
+			WriteData(fid,prefix,'object',this,'fieldname','coefficient','format','DoubleMat','mattype',mattype,'timeserieslength',tsl+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',this,'fieldname','p','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'object',this,'fieldname','q','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'class','friction','object',this,'fieldname','coupling','format','Integer');
+			WriteData(fid,prefix,'object',this,'class','friction','fieldname','effective_pressure_limit','format','Double');
 			switch (this.coupling) {
 				case 0:
+					break;
 				case 1:
 					WriteData(fid,prefix,'class','friction','object',this,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
@@ -79,6 +91,4 @@
 					console.error('not supported yet');		
 			}
-			
-
 		}//}}}
 		this.fix=function() { //{{{
@@ -86,9 +96,10 @@
 	//properties 
 	//{{{
-	this.coefficient = NaN;
-	this.p           = NaN;
-	this.q           = NaN;
-	this.coupling    = 0;
-	this.effective_pressure = NaN;
+	this.coefficient			  = NaN;
+	this.p						  = NaN;
+	this.q						  = NaN;
+	this.coupling				  = 0;
+	this.effective_pressure 	  = NaN;
+	this.effective_pressure_limit = 0;
 	this.setdefaultparameters();
 	//}}}
Index: /issm/trunk/src/m/classes/friction.m
===================================================================
--- /issm/trunk/src/m/classes/friction.m	(revision 26743)
+++ /issm/trunk/src/m/classes/friction.m	(revision 26744)
@@ -6,9 +6,9 @@
 classdef friction
 	properties (SetAccess=public) 
-		coefficient = NaN;
-		p           = NaN;
-		q           = NaN;
-		coupling    = 0;
-		effective_pressure = NaN;
+		coefficient              = NaN;
+		p                        = NaN;
+		q                        = NaN;
+		coupling                 = 0;
+		effective_pressure       = NaN;
 		effective_pressure_limit = 0;
 	end
@@ -18,14 +18,6 @@
 			self.p=project3d(md,'vector',self.p,'type','element');
 			self.q=project3d(md,'vector',self.q,'type','element');
-			switch self.coupling
-				case 0
-				case 1
-				case 2
-				case 3
-					self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
-				case 4
-					self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
-				otherwise
-					error('not supported yet');		
+			if self.coupling==3 || self.coupling==4
+				self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
 			end
 		end % }}}
@@ -57,14 +49,6 @@
 			md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0:4]);
 			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
-			switch self.coupling
-				case 0
-				case 1
-				case 2
-				case 3
-					md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
-				case 4
-				
-				otherwise
-					error('not supported yet');
+         if self.coupling==3
+            md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
 			end
 		end % }}}
@@ -92,14 +76,6 @@
 			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
 			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
-			switch self.coupling
-				case 0
-				case 1
-				case 2
-				case 3
-					WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				case 4
-					WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-				otherwise
-					error('not supported yet');		
+			if self.coupling==3 || self.coupling==4
+				WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 			end
 		end % }}}
Index: /issm/trunk/src/m/classes/friction.py
===================================================================
--- /issm/trunk/src/m/classes/friction.py	(revision 26743)
+++ /issm/trunk/src/m/classes/friction.py	(revision 26744)
@@ -23,5 +23,4 @@
         self.setdefaultparameters()
     #}}}
-
     def __repr__(self):  # {{{
         s = 'Basal shear stress parameters: Sigma_b = coefficient^2 * Neff ^r * |u_b|^(s - 1) * u_b,\n'
@@ -35,27 +34,20 @@
         return s
     #}}}
-
     def setdefaultparameters(self):  # {{{
         self.effective_pressure_limit = 0
         return self
     #}}}
-
     def extrude(self, md):  # {{{
         self.coefficient = project3d(md, 'vector', self.coefficient, 'type', 'node', 'layer', 1)
         self.p = project3d(md, 'vector', self.p, 'type', 'element')
         self.q = project3d(md, 'vector', self.q, 'type', 'element')
-        # If self.coupling == 0:  #doesnt work with empty loop, so just skip it?
         if self.coupling in[3, 4]:
             self.effective_pressure = project3d(md, 'vector', self.effective_pressure, 'type', 'node', 'layer', 1)
-        elif self.coupling > 4:
-            raise ValueError('md.friction.coupling larger than 4, not supported yet')
         return self
     #}}}
-
     def defaultoutputs(self, md):  # {{{
         list = []
         return list
     #}}}
-
     def checkconsistency(self, md, solution, analyses):  # {{{
         # Early return
@@ -71,9 +63,6 @@
         if self.coupling == 3:
             md = checkfield(md, 'fieldname', 'friction.effective_pressure', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
-        elif self.coupling > 4:
-            raise ValueError('not supported yet')
         return md
     # }}}
-
     def marshall(self, prefix, md, fid):  # {{{
         WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 1, 'format', 'Integer')
@@ -89,9 +78,5 @@
         WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'coupling', 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'class', 'friction', 'fieldname', 'effective_pressure_limit', 'format', 'Double')
-        if self.coupling == 3:
+        if self.coupling == 3 or self.coupling == 4:
             WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        elif self.coupling == 4:
-            WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        elif self.coupling > 4:
-            raise ValueError('not supported yet')
     # }}}
Index: /issm/trunk/src/m/classes/frictioncoulomb2.m
===================================================================
--- /issm/trunk/src/m/classes/frictioncoulomb2.m	(revision 26744)
+++ /issm/trunk/src/m/classes/frictioncoulomb2.m	(revision 26744)
@@ -0,0 +1,102 @@
+%FRICTIONCOULOMB2 class definition
+%
+%   Usage:
+%      frictioncoulomb=frictioncoulomb2();
+
+classdef frictioncoulomb2
+	properties (SetAccess=public) 
+		C                        = NaN;
+		m                        = NaN;
+		coupling                 = 0;
+		effective_pressure       = NaN;
+		effective_pressure_limit = 0;
+	end
+	methods (Static)
+		function self = loadobj(self) % {{{
+			if isstruct(self)
+				disp('Recovering frictioncoulomb2 from older version');
+				if isfield(self,'coefficient')
+					self.C = self.coefficient;
+				end
+				self = structtoobj(frictioncoulomb2(),self);
+			end
+		end% }}}
+	end
+	methods
+		function self = extrude(self,md) % {{{
+			self.C=project3d(md,'vector',self.C,'type','node','layer',1);
+			self.m=project3d(md,'vector',self.m,'type','element');
+			switch self.coupling
+				case 0
+				case 1
+					self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
+				case 2
+					error('not implemented yet');
+				otherwise
+					error('not supported yet');		
+			end
+		end % }}}
+		function self = frictioncoulomb(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+
+			self.effective_pressure_limit = 0;
+
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			%Early return
+			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
+			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
+			md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0 1 2]);
+			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);			
+			switch self.coupling
+				case 0
+				case 1
+					md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
+				case 2
+					error('not implemented yet');
+				otherwise
+					error('not supported yet');		
+			end
+		end % }}}
+		function disp(self) % {{{
+         disp('Coulomb limited sliding law parameters:');
+         disp(' ');
+         disp('                     C^2 |u_b|^(m-1) * (.5*N)           ');
+         disp('      tau_b = - _________________________________   u_b ');
+         disp('                (C^(2/m) |u_b| + (0.5*N)^(1/m) )^m      ');
+         disp(' ');
+			fielddisplay(self,'C','friction coefficient [SI]');
+			fielddisplay(self,'m','m exponent (Weertman would be 1/3)');
+			fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
+			fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled (not implemented yet)');
+			fielddisplay(self,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');	
+			end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+
+			WriteData(fid,prefix,'name','md.friction.law','data',13,'format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'fieldname','m','format','DoubleMat','mattype',2);
+			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
+			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
+			switch self.coupling
+				case 0
+				case 1
+					WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+				case 2
+					error('not implemented yet');
+				otherwise
+					error('not supported yet');		
+			end
+
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/frictionschoof.m
===================================================================
--- /issm/trunk/src/m/classes/frictionschoof.m	(revision 26743)
+++ /issm/trunk/src/m/classes/frictionschoof.m	(revision 26744)
@@ -6,7 +6,9 @@
 classdef frictionschoof
 	properties (SetAccess=public) 
-		C    = NaN;
-		Cmax = NaN;
-		m    = NaN;
+		C                        = NaN;
+		Cmax                     = NaN;
+		m                        = NaN;
+		coupling                 = 0;
+		effective_pressure       = NaN;
 		effective_pressure_limit = 0;
 	end
@@ -26,7 +28,11 @@
 			self.Cmax = project3d(md,'vector',self.Cmax,'type','node');
 			self.m    = project3d(md,'vector',self.m,'type','element');
+			if self.coupling==3 || self.coupling==4
+				self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
+			end
 		end % }}}
 		function self = setdefaultparameters(self) % {{{
 
+         self.coupling = 0;
 			self.effective_pressure_limit = 0;
 
@@ -36,8 +42,12 @@
 			%Early return
 			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
-			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1,'>',0.);
+			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1,'>=',0.);
 			md = checkfield(md,'fieldname','friction.Cmax','timeseries',1,'NaN',1,'Inf',1,'>',0.);
 			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'>',0.,'size',[md.mesh.numberofelements,1]);
 			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
+         md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0:4]);
+         if self.coupling==3
+            md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
+         end
 		end % }}}
 		function disp(self) % {{{
@@ -52,4 +62,6 @@
 			fielddisplay(self,'Cmax','Iken''s bound (typically between 0.17 and 0.84) [SI]');
 			fielddisplay(self,'m','m exponent (generally taken as m = 1/n = 1/3)');
+			fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
+         fielddisplay(self,'coupling','Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: use coupled model (not implemented yet)');
 			fielddisplay(self,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');
 		end % }}}
@@ -62,4 +74,8 @@
 			WriteData(fid,prefix,'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
+         WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
+         if self.coupling==3 || self.coupling==4
+            WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+         end
 		end % }}}
 	end
Index: /issm/trunk/src/m/classes/frictionschoof.py
===================================================================
--- /issm/trunk/src/m/classes/frictionschoof.py	(revision 26743)
+++ /issm/trunk/src/m/classes/frictionschoof.py	(revision 26744)
@@ -16,8 +16,10 @@
 
     def __init__(self, *args):  # {{{
-        self.C                          = np.nan
-        self.Cmax                       = np.nan
-        self.m                          = np.nan
-        self.effective_pressure_limit   = 0
+        self.C                        = np.nan
+        self.Cmax                     = np.nan
+        self.m                        = np.nan
+        self.coupling                 = 0
+        self.effective_pressure       = np.nan
+        self.effective_pressure_limit = 0
         
         nargs = len(args)
@@ -29,5 +31,4 @@
             raise Exception('constructor not supported')
     #}}}
-
     def __repr__(self):  # {{{
         # See Brondex et al. 2019 https://www.the-cryosphere.net/13/177/2019/
@@ -41,20 +42,21 @@
         s += "{}\n".format(fielddisplay(self, 'Cmax', 'Iken\'s bound (typically between 0.17 and 0.84) [SI]'))
         s += "{}\n".format(fielddisplay(self, 'm', 'm exponent (generally taken as m = 1/n = 1/3)'))
+        s += '{}\n'.format(fielddisplay(self, 'coupling', 'Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: used coupled model (not implemented yet)'))
+        s += '{}\n'.format(fielddisplay(self, 'effective_pressure', 'Effective Pressure for the forcing if not coupled [Pa]'))
         s += "{}\n".format(fielddisplay(self, 'effective_pressure_limit', 'fNeff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)'))
         return s
     #}}}
-
     def setdefaultparameters(self):  # {{{
         self.effective_pressure_limit = 0
         return self
     #}}}
-
     def extrude(self, md):  # {{{
         self.C = project3d(md, 'vector', self.C, 'type', 'node')
         self.Cmax = project3d(md, 'vector', self.Cmax, 'type', 'node')
         self.m = project3d(md, 'vector', self.m, 'type', 'element')
+        if self.coupling in[3, 4]:
+            self.effective_pressure = project3d(md, 'vector', self.effective_pressure, 'type', 'node', 'layer', 1)
         return self
     #}}}
-
     def checkconsistency(self, md, solution, analyses):  # {{{
         # Early return
@@ -65,7 +67,9 @@
         md = checkfield(md, 'fieldname', 'friction.m', 'NaN', 1, 'Inf', 1, '>', 0., 'size', [md.mesh.numberofelements, 1])
         md = checkfield(md, 'fieldname', 'friction.effective_pressure_limit', 'numel', [1], '>=', 0)
+        md = checkfield(md, 'fieldname', 'friction.coupling', 'numel', [1], 'values', [0, 1, 2, 3, 4])
+        if self.coupling == 3:
+            md = checkfield(md, 'fieldname', 'friction.effective_pressure', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
         return md
     # }}}
-
     def marshall(self, prefix, md, fid):  # {{{
         yts = md.constants.yts
@@ -75,5 +79,7 @@
         WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'Cmax', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
         WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'm', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'coupling', 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'class', 'friction', 'fieldname', 'effective_pressure_limit', 'format', 'Double')
+        if self.coupling == 3 or self.coupling == 4:
+            WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
     # }}}
-
Index: /issm/trunk/src/m/classes/frictionweertman.m
===================================================================
--- /issm/trunk/src/m/classes/frictionweertman.m	(revision 26743)
+++ /issm/trunk/src/m/classes/frictionweertman.m	(revision 26744)
@@ -37,5 +37,5 @@
 			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
 		end % }}}
-		function disp(self) % {{{z
+		function disp(self) % {{{
 			disp('Weertman sliding law parameters:');
 			disp('   Weertman''s sliding law reads:');
Index: /issm/trunk/src/m/classes/frontalforcings.js
===================================================================
--- /issm/trunk/src/m/classes/frontalforcings.js	(revision 26744)
+++ /issm/trunk/src/m/classes/frontalforcings.js	(revision 26744)
@@ -0,0 +1,41 @@
+//FRONTAL FORCINGS Class definition
+//
+//   Usage:
+//      frontalforcings=frontalforcings();
+
+function frontalforcings(){
+	//methods
+    this.classname = function(){ // {{{
+        return "frontalforcings";
+    } // }}}
+    this.extrude = function(md) {//{{{
+		this.meltingrate=project3d(md,'vector',this.meltingrate,'type','node');
+        return this;
+    }//}}}
+	this.setdefaultparameters = function(){// {{{
+		this.meltingrate   = NaN;
+	} // }}}
+    this.checkconsistency = function(md,solution,analyses) { //{{{
+		//Early return
+		if (!solution=='TransientSolution' || md.transient.ismovingfront == 0) return;
+
+		md = checkfield(md,'fieldname','frontalforcings.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
+
+    } // }}}
+	this.disp = function(){ // {{{
+		console.log(sprintf('   Frontalforcings parameters:'));
+		fielddisplay(this,'meltingrate','melting rate at given location [m/a]');
+	} // }}}
+    this.marshall=function(md,prefix,fid) { //{{{
+		let yts=md.constants.yts;
+		WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',1,'format','Integer');
+		WriteData(fid,prefix,'object',this,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
+    }//}}}
+    this.fix=function() { //{{{
+    }//}}}
+	//properties 
+    // {{{
+	this.meltingrate   = NaN;
+	this.setdefaultparameters();
+    // }}}
+}
Index: /issm/trunk/src/m/classes/frontalforcingsrignot.m
===================================================================
--- /issm/trunk/src/m/classes/frontalforcingsrignot.m	(revision 26743)
+++ /issm/trunk/src/m/classes/frontalforcingsrignot.m	(revision 26744)
@@ -6,8 +6,8 @@
 classdef frontalforcingsrignot
 	properties (SetAccess=public) 
-		basin= NaN;
-		numberofbasins=0;
-		subglacial_discharge= NaN;
-		thermalforcing=NaN;
+		basin_id             = NaN;
+		num_basins           = 0;
+		subglacial_discharge = NaN;
+		thermalforcing       = NaN;
 	end
 	methods
@@ -35,8 +35,8 @@
 		function self = setdefaultparameters(self) % {{{
 
-			basin=NaN;
-			numberofbasins=0;
-			subglacial_discharge=NaN;
-			thermalforcing=NaN;
+			basin_id             = NaN;
+			num_basins           = 0;
+			subglacial_discharge = NaN;
+			thermalforcing       = NaN;
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
@@ -44,14 +44,14 @@
 			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
 
-			md = checkfield(md,'fieldname','frontalforcings.basin','>',0,'nan',1,'Inf',1);
-			md = checkfield(md,'fieldname','frontalforcings.numberofbasins','numel',[1]);
-			md = checkfield(md,'fieldname','frontalforcings.subglacial_discharge','>=',0,'nan',1,'Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','frontalforcings.thermalforcing','nan',1,'Inf',1,'timeseries',1);
+			md = checkfield(md,'fieldname','frontalforcings.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
+			md = checkfield(md,'fieldname','frontalforcings.basin_id','Inf',1,'>=',0,'<=',md.frontalforcings.num_basins,'size',[md.mesh.numberofelements 1]);
+			md = checkfield(md,'fieldname','frontalforcings.subglacial_discharge','>=',0,'NaN',1,'Inf',1,'timeseries',1);
+			md = checkfield(md,'fieldname','frontalforcings.thermalforcing','NaN',1,'Inf',1,'timeseries',1);
 
 		end % }}}
 		function disp(self) % {{{
 			disp(sprintf('   Frontalforcings parameters:'));
-			fielddisplay(self,'basin','basin ID for vertices');
-			fielddisplay(self,'numberofbasins', 'number of basins');
+			fielddisplay(self,'basin_id','basin ID for elements');
+			fielddisplay(self,'num_basins', 'number of basins');
 			fielddisplay(self,'subglacial_discharge','sum of subglacial discharge for each basin [m/d]');
 			fielddisplay(self,'thermalforcing','thermal forcing [∘C]');
@@ -59,6 +59,6 @@
 		function marshall(self,prefix,md,fid) % {{{
 			WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','basin','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','numberofbasins','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','basin_id','data',self.basin_id-1,'name','md.frontalforcings.basin_id','format','IntMat','mattype',2); %0-indexed
+			WriteData(fid,prefix,'object',self,'fieldname','num_basins','format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','subglacial_discharge','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'fieldname','thermalforcing','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
Index: /issm/trunk/src/m/classes/frontalforcingsrignot.py
===================================================================
--- /issm/trunk/src/m/classes/frontalforcingsrignot.py	(revision 26743)
+++ /issm/trunk/src/m/classes/frontalforcingsrignot.py	(revision 26744)
@@ -1,2 +1,6 @@
+# -*- coding: utf-8 -*-
+
+import numpy as np
+
 from checkfield import checkfield
 from WriteData import WriteData
@@ -5,30 +9,39 @@
 
 class frontalforcingsrignot(object):
-    """
-    FRONTAL FORCINGS Rignot class definition
+    """FRONTALFORCINGSRIGNOT class definition
 
-       Usage:
-          frontalforcingsrignot = frontalforcingsrignot()
+    Usage:
+        frontalforcingsrignot = frontalforcingsrignot()
     """
 
-    def __init__(self):  # {{{
-        self.basin = float('NaN')
-        self.numberofbasins = 0.
-        self.subglacial_discharge = float('NaN')
-        self.thermalforcing = float('NaN')
+    def __init__(self, *args):  # {{{
+        self.basin_id = np.nan
+        self.num_basins = 0
+        self.subglacial_discharge = np.nan
+        self.thermalforcing = np.nan
 
-    #set defaults
-        self.setdefaultparameters()
+        if len(args) == 0:
+            self.setdefaultparameters()
+        else:
+            error('constructor not supported')
 
     #}}}
 
     def __repr__(self):  # {{{
-        string = '   Frontalforcings parameters:'
-        string = "%s\n%s" % (string, fielddisplay(self, 'basin', 'basin ID for vertices'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'numberofbasins', 'number of basins'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'subglacial_discharge', 'sum of subglacial discharge for each basin [m / d]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'thermalforcing', 'thermal forcing [C]'))
+        s = '   Frontalforcings parameters:\n'
+        s += '{}\n'.format(fielddisplay(self, 'basin_id', 'basin ID for elements'))
+        s += '{}\n'.format(fielddisplay(self, 'num_basins', 'number of basins'))
+        s += '{}\n'.format(fielddisplay(self, 'subglacial_discharge', 'sum of subglacial discharge for each basin [m/d]'))
+        s += '{}\n'.format(fielddisplay(self, 'thermalforcing', 'thermal forcing [∘C]'))
+        return s
+    #}}}
 
-        return string
+    def setdefaultparameters(self): # {{{
+        self.basin_id = np.nan
+        self.num_basins = 0
+        self.subglacial_discharge = np.nan
+        self.thermalforcing = np.nan
+
+        return self
     #}}}
 
@@ -37,18 +50,13 @@
     #}}}
 
-    def setdefaultparameters(self):  # {{{
-
-        return self
-    #}}}
-
     def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
+        # Early return
         if (solution != 'TransientSolution') or (not md.transient.ismovingfront):
             return md
 
-        md = checkfield(md, 'fieldname', 'frontalforcings.basin', '>', 0, 'nan', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'frontalforcings.numberofbasins', 'numel', [1])
-        md = checkfield(md, 'fieldname', 'frontalforcings.subglacial_discharge', '>=', 0, 'nan', 1, 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'frontalforcings.thermalforcing', 'nan', 1, 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'frontalforcings.num_basins', 'numel', [1], 'NaN', 1, 'Inf', 1, '>', 0)
+        md = checkfield(md, 'fieldname', 'frontalforcings.basin_id', 'Inf', 1, '>=', 0, '<=', md.frontalforcings.num_basins, 'size', [md.mesh.numberofelements])
+        md = checkfield(md, 'fieldname', 'frontalforcings.subglacial_discharge', '>=', 0, 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'frontalforcings.thermalforcing', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
         return md
     # }}}
@@ -56,8 +64,7 @@
     def marshall(self, prefix, md, fid):  # {{{
         WriteData(fid, prefix, 'name', 'md.frontalforcings.parameterization', 'data', 2, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'basin', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'numberofbasins', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'subglacial_discharge', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'thermalforcing', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1)
-
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'basin_id', 'data', self.basin_id, 'name', 'md.frontalforcings.basin_id', 'format', 'IntMat', 'mattype', 2) # 0-indexed
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'num_basins', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'subglacial_discharge', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'thermalforcing', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
     # }}}
Index: /issm/trunk/src/m/classes/frontalforcingsrignotautoregression.m
===================================================================
--- /issm/trunk/src/m/classes/frontalforcingsrignotautoregression.m	(revision 26744)
+++ /issm/trunk/src/m/classes/frontalforcingsrignotautoregression.m	(revision 26744)
@@ -0,0 +1,89 @@
+%FRONTAL FORCINGS rignot autoregression class definition
+%
+%   Usage:
+%      frontalforcingsrignotautoregression=frontalforcingsrignotautoregression();
+
+classdef frontalforcingsrignotautoregression
+	properties (SetAccess=public) 
+		num_basins           = 0;
+		beta0                = NaN;
+		beta1                = NaN;
+		ar_order             = 0;
+		ar_initialtime       = 0;
+		ar_timestep          = 0;
+		phi                  = NaN;
+		basin_id             = NaN;
+		subglacial_discharge = NaN;
+	end
+	methods
+		function self = frontalforcingsrignot(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				case 1
+					inputstruct=varargin{1};
+					list1 = properties('frontalforcingsrignotautoregression');
+					list2 = fieldnames(inputstruct);
+					for i=1:length(list1)
+						fieldname = list1{i};
+						if ismember(fieldname,list2),
+							self.(fieldname) = inputstruct.(fieldname);
+						end
+					end
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = extrude(self,md) % {{{
+		    % nothing for now
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+
+			self.basin_id             = NaN;
+			self.num_basins           = 0;
+			self.subglacial_discharge = NaN;
+			self.ar_order             = 0.0; %autoregression model of order 0
+
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+			%Early return
+			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
+
+			md = checkfield(md,'fieldname','frontalforcings.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
+         md = checkfield(md,'fieldname','frontalforcings.basin_id','Inf',1,'>=',0,'<=',md.frontalforcings.num_basins,'size',[md.mesh.numberofelements 1]);
+			md = checkfield(md,'fieldname','frontalforcings.subglacial_discharge','>=',0,'NaN',1,'Inf',1,'timeseries',1);
+			md = checkfield(md,'fieldname','frontalforcings.beta0','NaN',1,'Inf',1,'size',[1,md.frontalforcings.num_basins],'numel',md.frontalforcings.num_basins); 
+         md = checkfield(md,'fieldname','frontalforcings.beta1','NaN',1,'Inf',1,'size',[1,md.frontalforcings.num_basins],'numel',md.frontalforcings.num_basins); 
+         md = checkfield(md,'fieldname','frontalforcings.ar_order','numel',1,'NaN',1,'Inf',1,'>=',0);
+         md = checkfield(md,'fieldname','frontalforcings.ar_initialtime','numel',1,'NaN',1,'Inf',1);
+         md = checkfield(md,'fieldname','frontalforcings.ar_timestep','numel',1,'NaN',1,'Inf',1,'>=',md.timestepping.time_step); %autoregression time step cannot be finer than ISSM timestep
+			md = checkfield(md,'fieldname','frontalforcings.phi','NaN',1,'Inf',1,'size',[md.frontalforcings.num_basins,md.frontalforcings.ar_order]);
+
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   Frontalforcings parameters:'));
+			fielddisplay(self,'num_basins','number of different basins [unitless]');
+         fielddisplay(self,'basin_id','basin number assigned to each element [unitless]');
+         fielddisplay(self,'subglacial_discharge','sum of subglacial discharge for each basin [m/d]');
+         fielddisplay(self,'beta0','basin-specific intercept values [∘C]');
+         fielddisplay(self,'beta1','basin-specific trend values [∘C yr^(-1)]');
+         fielddisplay(self,'ar_order','order of the autoregressive model [unitless]');
+         fielddisplay(self,'ar_initialtime','initial time assumed in the autoregressive model parameterization [yr]');
+         fielddisplay(self,'ar_timestep','time resolution of the autoregressive model [yr]');
+         fielddisplay(self,'phi','basin-specific vectors of lag coefficients [unitless]');
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+			yts=md.constants.yts;
+			WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',55,'format','Integer');
+			WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','num_basins','format','Integer');
+			WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','subglacial_discharge','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','ar_order','format','Integer');
+         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','ar_initialtime','format','Double','scale',yts);
+         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','ar_timestep','format','Double','scale',yts);
+         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','basin_id','data',self.basin_id-1,'name','md.frontalforcings.basin_id','format','IntMat','mattype',2); %0-indexed
+         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','beta0','format','DoubleMat','name','md.frontalforcings.beta0');
+         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','beta1','format','DoubleMat','name','md.frontalforcings.beta1','scale',1./yts,'yts',yts);
+         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','phi','format','DoubleMat','name','md.frontalforcings.phi','yts',yts);
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/frontalforcingsrignotautoregression.py
===================================================================
--- /issm/trunk/src/m/classes/frontalforcingsrignotautoregression.py	(revision 26744)
+++ /issm/trunk/src/m/classes/frontalforcingsrignotautoregression.py	(revision 26744)
@@ -0,0 +1,89 @@
+# -*- coding: utf-8 -*-
+
+import numpy as np
+
+from checkfield import checkfield
+from fielddisplay import fielddisplay
+from MatlabFuncs import *
+from WriteData import WriteData
+
+class frontalforcingsrignotautoregression(object):
+    """FRONTALFORCINGSRIGNOTAUTOREGRESSION class definition
+
+    Usage:
+        frontalforcingsrignotautoregression = frontalforcingsrignotautoregression()
+    """
+
+    def __init__(self, *args):  # {{{
+        self.num_basins = 0
+        self.beta0 = np.nan
+        self.beta1 = np.nan
+        self.ar_order = 0
+        self.ar_initialtime = 0
+        self.ar_timestep = 0
+        self.phi = np.nan
+        self.basin_id = np.nan
+        self.subglacial_discharge = np.nan
+
+        if len(args) == 0:
+            self.setdefaultparameters()
+        else:
+            error('constructor not supported')
+
+    def __repr__(self):  # {{{
+        s = '   Frontalforcings parameters:\n'
+        s += '{}\n'.format(fielddisplay(self, 'num_basins', 'number of different basins [unitless]'))
+        s += '{}\n'.format(fielddisplay(self, 'basin_id', 'basin number assigned to each element [unitless]'))
+        s += '{}\n'.format(fielddisplay(self, 'subglacial_discharge', 'sum of subglacial discharge for each basin [m/d]'))
+        s += '{}\n'.format(fielddisplay(self, 'beta0', 'basin-specific intercept values [°C]'))
+        s += '{}\n'.format(fielddisplay(self, 'beta1', 'basin-specific trend values [°C yr^(-1)]'))
+        s += '{}\n'.format(fielddisplay(self, 'ar_order', 'order of the autoregressive model [unitless]'))
+        s += '{}\n'.format(fielddisplay(self, 'ar_initialtime', 'initial time assumed in the autoregressive model parameterization [yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'ar_timestep', 'time resolution of the autoregressive model [yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'phi', 'basin-specific vectors of lag coefficients [unitless]'))
+        return s
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        self.basin_id = np.nan
+        self.num_basins = 0
+        self.subglacial_discharge = np.nan
+        self.ar_order = 0.0 # Autoregression model of order 0
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        # Early return
+        if not (solution == 'TransientSolution') or not md.transient.ismovingfront:
+            return md
+
+        md = checkfield(md, 'fieldname', 'frontalforcings.num_basins', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
+        md = checkfield(md, 'fieldname', 'frontalforcings.basin_id', 'Inf', 1, '>=', 0, '<=', md.frontalforcings.num_basins, 'size', [md.mesh.numberofelements])
+        md = checkfield(md, 'fieldname', 'frontalforcings.subglacial_discharge', '>=', 0, 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'frontalforcings.beta0', 'NaN', 1, 'Inf', 1, 'size', [1, md.frontalforcings.num_basins], 'numel', md.frontalforcings.num_basins)
+        md = checkfield(md, 'fieldname', 'frontalforcings.beta1', 'NaN', 1, 'Inf', 1, 'size', [1, md.frontalforcings.num_basins], 'numel', md.frontalforcings.num_basins)
+        md = checkfield(md, 'fieldname', 'frontalforcings.ar_order', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
+        md = checkfield(md, 'fieldname', 'frontalforcings.ar_initialtime', 'numel', 1, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'frontalforcings.ar_timestep', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', md.timestepping.time_step) # Autoregression time step cannot be finer than ISSM timestep
+        md = checkfield(md, 'fieldname', 'frontalforcings.phi', 'NaN', 1, 'Inf', 1, 'size', [md.frontalforcings.num_basins, md.frontalforcings.ar_order])
+        return md
+    # }}}
+
+    def extrude(self, md):  # {{{
+        # Nothing for now
+        return self
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+        WriteData(fid, prefix, 'name', 'md.frontalforcings.parameterization', 'data', 55, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'num_basins', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'subglacial_discharge', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'ar_order', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'ar_initialtime', 'format', 'Double', 'scale', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'ar_timestep', 'format', 'Double', 'scale', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'basin_id', 'data', self.basin_id, 'name', 'md.frontalforcings.basin_id', 'format', 'IntMat', 'mattype', 2) # 0-indexed
+        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'beta0', 'format', 'DoubleMat', 'name', 'md.frontalforcings.beta0')
+        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'beta1', 'format', 'DoubleMat', 'name', 'md.frontalforcings.beta1', 'scale', 1 / yts, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'phi', 'format', 'DoubleMat', 'name', 'md.frontalforcings.phi', 'yts', yts)
+    # }}}
Index: /issm/trunk/src/m/classes/geometry.js
===================================================================
--- /issm/trunk/src/m/classes/geometry.js	(revision 26743)
+++ /issm/trunk/src/m/classes/geometry.js	(revision 26744)
@@ -30,5 +30,5 @@
 
 			if ((solution=='TransientSolution' & md.trans.isgia) | (solution=='GiaSolution')){
-				checkfield(md,'fieldname','geometry.thickness','timeseries',1,'NaN',1,'Inf',1);
+				checkfield(md,'fieldname','geometry.thickness','timeseries',1,'NaN',1,'Inf',1,'>=',0);
 			}
 			else{
@@ -38,5 +38,5 @@
 				for(var i=0;i<md.mesh.numberofvertices;i++){
 					if (Math.abs(md.geometry.thickness[i]-md.geometry.surface[i]+md.geometry.base[i])>Math.pow(10,9)){
-						md = checkmessage(md,'equality thickness=surface-base violated');
+						checkmessage(md,'equality thickness=surface-base violated');
 						break;
 					}
@@ -48,6 +48,13 @@
 		} // }}}
 		this.marshall=function(md,prefix,fid) { //{{{
+			let length_thickness=size(this.thickness,0);
+			if (length_thickness==md.mesh.numberofvertices || length_thickness==md.mesh.numberofvertices+1) {
+				WriteData(fid,prefix,'object',this,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			} else if (length_thickness==md.mesh.numberofelements || length_thickness==md.mesh.numberofelements+1) {
+				WriteData(fid,prefix,'object',this,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+			} else {
+				error('geometry thickness time series should be a vertex or element time series');
+			}
 			WriteData(fid,prefix,'object',this,'fieldname','surface','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',this,'fieldname','base','format','DoubleMat','mattype',1);
 			WriteData(fid,prefix,'object',this,'fieldname','bed','format','DoubleMat','mattype',1);
Index: /issm/trunk/src/m/classes/geometry.m
===================================================================
--- /issm/trunk/src/m/classes/geometry.m	(revision 26743)
+++ /issm/trunk/src/m/classes/geometry.m	(revision 26744)
@@ -33,11 +33,4 @@
 	end
 	methods
-		function self = extrude(self,md) % {{{
-			self.surface=project3d(md,'vector',self.surface,'type','node');
-			self.thickness=project3d(md,'vector',self.thickness,'type','node');
-			self.hydrostatic_ratio=project3d(md,'vector',self.hydrostatic_ratio,'type','node');
-			self.base=project3d(md,'vector',self.base,'type','node');
-			self.bed=project3d(md,'vector',self.bed,'type','node');
-		end % }}}
 		function self = geometry(varargin) % {{{
 			switch nargin
@@ -53,10 +46,5 @@
 		function md = checkconsistency(self,md,solution,analyses) % {{{
 
-			if (strcmp(solution,'TransientSolution') & md.transient.isgia) | strcmp(solution,'GiaSolution'),
-				md = checkfield(md,'fieldname','geometry.thickness','timeseries',1,'NaN',1,'Inf',1);
-			elseif strcmpi(solution,'SealevelriseSolution'),
-				md = checkfield(md,'fieldname','geometry.bed','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-				return;
-			elseif strcmpi(solution,'LoveSolution'),
+			if strcmpi(solution,'LoveSolution'),
 				return; 
 			else
@@ -90,9 +78,24 @@
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
+			length_thickness=size(self.thickness,1);
+			if length_thickness==md.mesh.numberofvertices | length_thickness==md.mesh.numberofvertices+1,
+				WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			elseif length_thickness==md.mesh.numberofelements | length_thickness==md.mesh.numberofelements+1,
+				WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+			else
+				error('geometry thickness time series should be a vertex or element time series');
+			end
+
 			WriteData(fid,prefix,'object',self,'fieldname','surface','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'fieldname','base','format','DoubleMat','mattype',1);
 			WriteData(fid,prefix,'object',self,'fieldname','bed','format','DoubleMat','mattype',1);
 			WriteData(fid,prefix,'object',self,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1);
+		end % }}}
+		function self = extrude(self,md) % {{{
+			self.surface=project3d(md,'vector',self.surface,'type','node');
+			self.thickness=project3d(md,'vector',self.thickness,'type','node');
+			self.hydrostatic_ratio=project3d(md,'vector',self.hydrostatic_ratio,'type','node');
+			self.base=project3d(md,'vector',self.base,'type','node');
+			self.bed=project3d(md,'vector',self.bed,'type','node');
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
Index: /issm/trunk/src/m/classes/geometry.py
===================================================================
--- /issm/trunk/src/m/classes/geometry.py	(revision 26743)
+++ /issm/trunk/src/m/classes/geometry.py	(revision 26744)
@@ -14,5 +14,5 @@
     """
 
-    def __init__(self, *args): #{{{
+    def __init__(self, *args):  # {{{
         self.surface = np.nan
         self.thickness = np.nan
@@ -21,12 +21,11 @@
         self.hydrostatic_ratio = np.nan
 
-        nargs = len(args)
-        if nargs == 0:
+        if len(args) == 0:
             self.setdefaultparameters()
         else:
             raise Exception('constructor not supported')
-    #}}}
+    # }}}
 
-    def __repr__(self): #{{{
+    def __repr__(self):  # {{{
         s = '   geometry parameters:\n'
         s += '{}\n'.format(fielddisplay(self, 'surface', 'ice upper surface elevation [m]'))
@@ -35,7 +34,46 @@
         s += '{}\n'.format(fielddisplay(self, 'bed', 'bed elevation [m]'))
         return s
-    #}}}
+    # }}}
 
-    def extrude(self, md): #{{{
+    def setdefaultparameters(self):  # {{{
+        return
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if solution == 'LoveSolution':
+            return md
+        else:
+            md = checkfield(md, 'fieldname', 'geometry.surface', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'geometry.base', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'geometry.thickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>=', 0)
+            if any(abs(self.thickness - self.surface + self.base) > 1e-9):
+                md.checkmessage('equality thickness = surface-base violated')
+            if solution == 'TransientSolution' and md.transient.isgroundingline:
+                md = checkfield(md, 'fieldname', 'geometry.bed', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+                if np.any(self.bed - self.base > 1e-12):
+                    md.checkmessage('base < bed on one or more vertex')
+                pos = np.where(md.mask.ocean_levelset > 0)
+                if np.any(np.abs(self.bed[pos] - self.base[pos]) > 1e-9):
+                    md.checkmessage('equality base = bed on grounded ice violated')
+                md = checkfield(md, 'fieldname', 'geometry.bed', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        length_thickness = len(self.thickness)
+        if (length_thickness == md.mesh.numberofvertices) or (length_thickness == md.mesh.numberofvertices + 1):
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        elif (length_thickness == md.mesh.numberofelements) or (length_thickness == md.mesh.numberofelements + 1):
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', md.constants.yts)
+        else:
+            raise RuntimeError('geometry thickness time series should be a vertex or element time series')
+
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'surface', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'base', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'bed', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'hydrostatic_ratio', 'format', 'DoubleMat', 'mattype', 1)
+    # }}}
+
+    def extrude(self, md):  # {{{
         self.surface = project3d(md, 'vector', self.surface, 'type', 'node')
         self.thickness = project3d(md, 'vector', self.thickness, 'type', 'node')
@@ -44,40 +82,3 @@
         self.bed = project3d(md, 'vector', self.bed, 'type', 'node')
         return self
-    #}}}
-
-    def setdefaultparameters(self): #{{{
-        return self
-    #}}}
-
-    def checkconsistency(self, md, solution, analyses): #{{{
-        if (solution == 'TransientSolution' and md.transient.isgia) or (solution == 'GiaSolution'):
-            md = checkfield(md, 'fieldname', 'geometry.thickness', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        elif solution == 'SealevelriseSolution':
-            md = checkfield(md, 'fieldname', 'geometry.bed', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        elif solution == 'LoveSolution':
-            return
-        else:
-            md = checkfield(md, 'fieldname', 'geometry.surface', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'geometry.base', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-            md = checkfield(md, 'fieldname', 'geometry.thickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>', 0, 'timeseries', 1)
-            if any(abs(self.thickness - self.surface + self.base) > 10**-9):
-                md.checkmessage("equality thickness = surface-base violated")
-            if solution == 'TransientSolution' and md.transient.isgroundingline:
-                md = checkfield(md, 'fieldname', 'geometry.bed', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-                if np.any(self.bed - self.base > 10**-12):
-                    md.checkmessage('base < bed on one or more vertex')
-                pos = np.where(md.mask.ocean_levelset > 0)
-                if np.any(np.abs(self.bed[pos] - self.base[pos]) > 10**-9):
-                    md.checkmessage('equality base = bed on grounded ice violated')
-                md = checkfield(md, 'fieldname', 'geometry.bed', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-
-        return md
     # }}}
-
-    def marshall(self, prefix, md, fid): #{{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'surface', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'base', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'bed', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'hydrostatic_ratio', 'format', 'DoubleMat', 'mattype', 1)
-    # }}}
Index: sm/trunk/src/m/classes/giaivins.js
===================================================================
--- /issm/trunk/src/m/classes/giaivins.js	(revision 26743)
+++ 	(revision )
@@ -1,64 +1,0 @@
-//GIA class definition for Ivins and James model 
-//
-//   Usage:
-//      giaivins=new giaivins();
-
-function giaivins (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-
-		this.cross_section_shape=1; //square as default (see iedge in GiaDeflectionCorex)
-	
-	}// }}}
-	this.disp= function(){// {{{
-
-		console.log(sprintf('   giaivins parameters:'));
-
-		fielddisplay(this,'mantle_viscosity','mantle viscosity[Pa s]');
-		fielddisplay(this,'lithosphere_thickness','lithosphere thickness (km)');
-		fielddisplay(this,'cross_section_shape','1: square-edged (default). 2: elliptical.  See iedge in GiaDeflectionCore');
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "giaivins";
-	}// }}}
-	this.checkconsistency = function(md,solution,analyses) { // {{{
-
-		if(!ArrayAnyEqual(ArrayIsMember('GiaAnalysis',analyses),1))return;
-
-		checkfield(md,'fieldname','gia.mantle_viscosity','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices,1],'>',0);
-		checkfield(md,'fieldname','gia.lithosphere_thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices,1],'>',0);
-		checkfield(md,'fieldname','gia.cross_section_shape','numel',[1],'values',[1,2]);
-
-		//be sure that if we are running a masstransport ice flow model coupled with giaivins, that thickness forcings 
-		//are not provided into the future.
-		if (solution=='TransientSolution' & md.trans.ismasstransport & md.trans.isgia){
-			//figure out if thickness is a transient forcing: 
-			if (md.geometry.thickness.length == (md.mesh.numberofvertices+1)){
-				//recover the furthest time "in time": 
-				t=md.geometry.thickness[0].length;
-				if(md.geometry.thickness[md.geometry.thickness.length-1][t-1]!=md.timestepping.start_time){
-					md.checkmessage('if ismasstransport is on, transient thickness forcing for the giaivins model should not be provided in the future. Synchronize your start_time to correspond to the most recent transient thickness forcing timestep');
-				}
-			}
-		}
-	} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'object',this,'fieldname','mantle_viscosity','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','lithosphere_thickness','format','DoubleMat','mattype',1,'scale',Math.pow(10,3)); //from km to m
-			WriteData(fid,prefix,'object',this,'fieldname','cross_section_shape','format','Integer');
-		}//}}}
-		this.fix=function() { //{{{
-			this.mantle_viscosity=NullFix(this.mantle_viscosity,NaN);
-			this.lithosphere_thickness=NullFix(this.lithosphere_thickness,NaN);
-		}//}}}
-	//properties 
-	// {{{
-
-	this.mantle_viscosity              = NaN;
-	this.lithosphere_thickness         = NaN;
-	this.cross_section_shape           = 0;
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: sm/trunk/src/m/classes/giaivins.m
===================================================================
--- /issm/trunk/src/m/classes/giaivins.m	(revision 26743)
+++ 	(revision )
@@ -1,73 +1,0 @@
-%GIA class definition for Ivins and James model 
-%
-%   Usage:
-%      giaivins=giaivins();
-
-classdef giaivins
-	properties (SetAccess=public) 
-		mantle_viscosity              = NaN;
-		lithosphere_thickness         = NaN;
-		cross_section_shape           = 0;
-	end
-	methods
-		function self = giaivins(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		self.cross_section_shape=1; %square as default (see iedge in GiaDeflectionCorex)
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('GiaAnalysis',analyses), return; end
-			md = checkfield(md,'fieldname','gia.mantle_viscosity','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
-			md = checkfield(md,'fieldname','gia.lithosphere_thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
-			md = checkfield(md,'fieldname','gia.cross_section_shape','numel',[1],'values',[1,2]);
-
-			%be sure that if we are running a masstransport ice flow model coupled with giaivins, that thickness forcings 
-			%are not provided into the future.
-			if strcmp(solution,'TransientSolution') & md.transient.ismasstransport & md.transient.isgia,
-				%figure out if thickness is a transient forcing: 
-				if size(md.geometry.thickness,1)==md.mesh.numberofvertices+1,
-					%recover the furthest time "in time": 
-					if(md.geometry.thickness(end,end)~=md.timestepping.start_time),
-						md = checkmessage(md,['if ismasstransport is on, transient thickness forcing'...
-							' for the giaivins model should not be provided in the future.'...
-							' Synchronize your start_time to correspond to the most recent transient'...
-							' thickness forcing timestep']);
-					end
-				end
-			end
-
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   giaivins parameters:'));
-
-			fielddisplay(self,'mantle_viscosity','mantle viscosity[Pa s]');
-			fielddisplay(self,'lithosphere_thickness','lithosphere thickness (km)');
-			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical.  See iedge in GiaDeflectionCore');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.gia.model','data',1,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','mantle_viscosity','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','lithosphere_thickness','format','DoubleMat','mattype',1,'scale',10^3); %from km to m
-			WriteData(fid,prefix,'object',self,'fieldname','cross_section_shape','format','Integer');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.gia.mantle_viscosity'],self.mantle_viscosity);
-			writejsdouble(fid,[modelname '.gia.lithosphere_thickness'],self.lithosphere_thickness);
-			writejsdouble(fid,[modelname '.gia.cross_section_shape'],self.cross_section_shape);
-
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.mantle_viscosity=project3d(md,'vector',self.mantle_viscosity,'type','node');
-			self.lithosphere_thickness=project3d(md,'vector',self.lithosphere_thickness,'type','node');
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/giaivins.py
===================================================================
--- /issm/trunk/src/m/classes/giaivins.py	(revision 26743)
+++ 	(revision )
@@ -1,72 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class giaivins(object):
-    """GIA class definition for Ivins and James model
-
-    Usage:
-        giaivins = giaivins()
-    """
-
-    def __init__(self, *args): #{{{
-        self.mantle_viscosity       = np.nan
-        self.lithosphere_thickness  = np.nan
-        self.cross_section_shape    = 0
-
-        nargin = len(args)
-        if nargin == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    #}}}
-
-    def __repr__(self): #{{{
-        s = '   giaivins parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'mantle_viscosity', 'mantle viscosity [Pa s]'))
-        s += '{}\n'.format(fielddisplay(self, 'lithosphere_thickness', 'lithosphere thickness (km)'))
-        s += '{}\n'.format(fielddisplay(self, 'cross_section_shape', "1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore"))
-        return s
-    #}}}
-
-    def setdefaultparameters(self): #{{{
-        self.cross_section_shape = 1
-        return self
-    #}}}
-
-    def checkconsistency(self, md, solution, analyses): #{{{
-        if 'GiaAnalysis' not in analyses:
-            return md
-
-        md = checkfield(md, 'fieldname', 'gia.mantle_viscosity', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>', 0)
-        md = checkfield(md, 'fieldname', 'gia.lithosphere_thickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>', 0)
-        md = checkfield(md, 'fieldname', 'gia.cross_section_shape', 'numel', [1], 'values', [1, 2])
-
-        # Be sure that if we are running a masstransport ice flow model coupled 
-        # with giaivins, that thickness forcings are not provided into the 
-        # future.
-        if solution == 'TransientSolution' and md.transient.ismasstransport and md.transient.isgia:
-            # Figure out if thickness is a transient forcing
-            if md.geometry.thickness.shape[0] == md.mesh.numberofvertices + 1:
-                # Recover the furthest time "in time"
-                if md.geometry.thickness[-1, -1] != md.timestepping.start_time:
-                    md.checkmessage('if masstransport is on, transient thickness forcing for the giaivins model should not be provided in the future. Synchronize your start_time to correspond to the most recent transient thickness forcing timestep')
-        return md
-    #}}}
-
-    def marshall(self, prefix, md, fid): #{{{
-        WriteData(fid, prefix, 'name', 'md.gia.model', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'mantle_viscosity', 'format', 'DoubleMat', 'mattype', 1)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'lithosphere_thickness', 'format', 'DoubleMat', 'mattype', 1, 'scale', 10.**3.)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'cross_section_shape', 'format', 'Integer')
-    #}}}
-
-    def extrude(self, md): #{{{
-        self.mantle_viscosity = project3d(md, 'vector', self.mantle_viscosity, 'type', 'node')
-        self.lithosphere_thickness = project3d(md, 'vector', self.lithosphere_thickness, 'type', 'node')
-        return self
-    #}}}
Index: sm/trunk/src/m/classes/giamme.m
===================================================================
--- /issm/trunk/src/m/classes/giamme.m	(revision 26743)
+++ 	(revision )
@@ -1,77 +1,0 @@
-%GIAMME class definition
-%
-%   Usage:
-%      gia=giamme(); %gia class based on a multi-model 
-%                     ensemble  (ex: Caron et al 2017 statistics)
-
-classdef giamme
-	properties (SetAccess=public) 
-
-		modelid; %index into the multi-model ensemble
-		Ngia;  %geoid ensemble
-		Ugia;  %uplift ensemble
-
-	end
-	methods
-		function self = giamme(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				case 1
-					self=structtoobj(gia(),varargin{1});
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-
-			self.modelid=0;
-			self.Ngia=[];
-			self.Ugia=[];
-
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			%Early return
-			if ~ismember('SealevelriseAnalysis',analyses), return; end
-			if (strcmp(solution,'TransientSolution') & md.transient.isslr == 0), return; end
-			md = checkfield(md,'field',self.Ngia,'NaN',1,'Inf',1);
-			md = checkfield(md,'field',self.Ugia,'NaN',1,'Inf',1);
-			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',0,'<=',length(self.Ngia));
-		end % }}}
-		function disp(self) % {{{
-
-			disp(sprintf('   gia mme parameters:'));
-			fielddisplay(self,'modelid','index into the multi-model ensemble, determines which field will be used.');
-			fielddisplay(self,'Ngia','geoid (mm/yr).');
-			fielddisplay(self,'Ugia','uplift (mm/yr).');
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'name','md.gia.model','data',3,'format','Integer');
-			if size(self.Ngia,2)==0,
-				WriteData(fid,prefix,'data',zeros(md.mesh.numberofvertices,1),'format','DoubleMat','mattype',1,'name','md.gia.Ngia');
-				WriteData(fid,prefix,'data',zeros(md.mesh.numberofvertices,1),'format','DoubleMat','mattype',1,'name','md.gia.Ugia');
-				WriteData(fid,prefix,'data',1,'name','md.gia.modelid','format','Double');
-				WriteData(fid,prefix,'name','md.gia.nummodels','data',1,'format','Integer');
-			else
-				WriteData(fid,prefix,'object',self,'fieldname','Ngia','format','DoubleMat','scale',1/1000/md.constants.yts);
-				WriteData(fid,prefix,'object',self,'fieldname','Ugia','format','DoubleMat','scale',1/1000/md.constants.yts);
-				WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
-				WriteData(fid,prefix,'name','md.gia.nummodels','data',size(self.Ngia,2),'format','Integer');
-			end
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-			
-			writejsdouble(fid,[modelname '.gia.modelid'],self.modelid);
-			writejscellarray(fid,[modelname '.gia.Ngia'],self.Ngia);
-			writejscellarray(fid,[modelname '.gia.Ugia'],self.Ugia);
-
-		end % }}}
-		function self = extrude(self,md) % {{{
-			for i=1:length(self.Ngia),
-				self.Ngia{i}=project3d(md,'vector',self.Ngia{i},'type','node','layer',1);
-				self.Ugia{i}=project3d(md,'vector',self.Ugia{i},'type','node','layer',1);
-			end
-		end % }}}
-	end
-end
Index: sm/trunk/src/m/classes/giamme.py
===================================================================
--- /issm/trunk/src/m/classes/giamme.py	(revision 26743)
+++ 	(revision )
@@ -1,72 +1,0 @@
-import numpy as np
-
-from checkfield import checkfield
-from fielddisplay import fielddisplay
-from project3d import project3d
-from WriteData import WriteData
-
-
-class giamme(object):
-    """GIAMME class definition
-
-    Usage:
-        gia = giamme() #gia class based on a multi-model ensemble (ex: Caron et al 2017 statistics)
-    """
-
-    def __init__(self, *args): #{{{
-        self.modelid    = 0 #index into the multi-model ensemble
-        self.Ngia       = [] #geoid ensemble
-        self.Ugia       = [] #uplift ensemble
-        
-        nargin = len(args)
-
-        if nargin == 0:
-            self.setdefaultparameters()
-        else:
-            raise Exception('constructor not supported')
-    #}}}
-
-    def __repr__(self): # {{{
-        s = '   gia mme parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'modelid', 'index into the multi-model ensemble, determines which field will be used.'))
-        s += '{}\n'.format(fielddisplay(self, 'Ngia', 'geoid (mm/yr).'))
-        s += '{}\n'.format(fielddisplay(self, 'Ugia', 'uplift (mm/yr).'))
-        return s
-    #}}}
-
-    def setdefaultparameters(self): # {{{
-        return self
-    #}}}
-
-    def checkconsistency(self, md, solution, analyses): # {{{
-        if 'SealevelriseAnalysis' not in analyses:
-            return md
-        if solution == 'TransientSolution' and not md.transient.isslr:
-            return md
-        md = checkfield(md, 'field', self.Ngia, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'field', self.Ugia, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'field', self.modelid, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', len(self.Ngia))
-        return md
-    #}}}
-
-    def marshall(self, prefix, md, fid): #{{{
-        WriteData(fid, prefix, 'name', 'md.gia.model', 'data', 3, 'format', 'Integer')
-
-        if isinstance(self.Ngia, list) or self.Ngia.ndim == 1: #list or 1D numpy.ndarray
-            WriteData(fid, prefix, 'data', np.zeros((md.mesh.numberofvertices, 1)), 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.gia.Ngia')
-            WriteData(fid, prefix, 'data', np.zeros((md.mesh.numberofvertices, 1)), 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.gia.Ugia')
-            WriteData(fid, prefix, 'data', 1, 'name', 'md.gia.modelid', 'format', 'Double')
-            WriteData(fid, prefix, 'name', 'md.gia.nummodels', 'data', 1, 'format', 'Integer')
-        else: #2D numpy.ndarray
-            WriteData(fid, prefix, 'object ', self, 'fieldname', 'Ngia', 'format', 'DoubleMat', 'scale', 1 / 1000 / md.constants.yts)
-            WriteData(fid, prefix, 'object ', self, 'fieldname', 'Ugia', 'format', 'DoubleMat', 'scale', 1 / 1000 / md.constants.yts)
-            WriteData(fid, prefix, 'object ', self, 'fieldname', 'modelid', 'format', 'Double')
-            WriteData(fid, prefix, 'name', 'md.gia.nummodels', 'data', self.Ngia.shape[1],'format', 'Integer') #NOTE: <<numpy.ndarray>>.shape[1] gives length of second dimension
-    #}}}
-
-    def extrude(self, md): #{{{
-        for i in range(len(self.Ngia)):
-            self.Ngia[i] = project3d(md, 'vector', self.Ngia[i], 'type', 'node', 'layer', 1)
-            self.Ugia[i] = project3d(md, 'vector', self.Ugia[i], 'type', 'node', 'layer', 1)
-        return self
-    #}}}
Index: /issm/trunk/src/m/classes/groundingline.js
===================================================================
--- /issm/trunk/src/m/classes/groundingline.js	(revision 26743)
+++ /issm/trunk/src/m/classes/groundingline.js	(revision 26744)
@@ -8,7 +8,7 @@
 	this.setdefaultparameters = function(){// {{{
 		//Type of migration
-		this.migration='AggressiveMigration';
-		this.friction_interpolation='SubelementFriction1';
-		this.melt_interpolation='NoMeltOnPartiallyFloating';
+		this.migration				= 'SubelementMigration';
+		this.friction_interpolation	= 'SubelementFriction1';
+		this.melt_interpolation		= 'NoMeltOnPartiallyFloating';
 
 	}// }}}
@@ -29,15 +29,15 @@
 			checkfield(md,'fieldname','groundingline.melt_interpolation','values',['NoMeltOnPartiallyFloating', 'SubelementMelt1', 'SubelementMelt2', 'FullMeltOnPartiallyFloating']);
 
-			if(this.migration !='None' & md.trans.isgroundingline==1 & solution == 'TransientSolution'){
+			if (this.migration !='None'){
 				if (isNaN(md.geometry.bed)){
 					md.checkmessage('requesting grounding line migration, but bathymetry is absent!');
 				}
 				for (var i=0;i<md.mesh.numberofvertices;i++){
-					if(md.mask.ocean_levelset[i]>0){
+					if(md.mask.groundedice_levelset[i]>0){
 						md.checkmessage('base not equal to bed on grounded ice!');
 						break;
 					}
 					if(md.geometry.bed[i] - md.geometry.base[i] > Math.pow(10,-9)){
-						md = checkmessage(md,'bed superior to base on floating ice!');
+						checkmessage(md,'bed superior to base on floating ice!');
 						break;
 					}
@@ -47,6 +47,6 @@
 		this.marshall=function(md,prefix,fid) { //{{{
 			WriteData(fid,prefix,'data',this.migration,'name','md.groundingline.migration','format','String');
-			WriteData(fid,prefix,'data',this.migration,'name','md.groundingline.friction_interpolation','format','String');
-			WriteData(fid,prefix,'data',this.migration,'name','md.groundingline.melt_interpolation','format','String');
+			WriteData(fid,prefix,'data',this.friction_interpolation,'name','md.groundingline.friction_interpolation','format','String');
+			WriteData(fid,prefix,'data',this.melt_interpolation,'name','md.groundingline.melt_interpolation','format','String');
 		}//}}}
 		this.fix=function() { //{{{
Index: /issm/trunk/src/m/classes/groundingline.py
===================================================================
--- /issm/trunk/src/m/classes/groundingline.py	(revision 26743)
+++ /issm/trunk/src/m/classes/groundingline.py	(revision 26744)
@@ -1,7 +1,7 @@
 import numpy as np
+from checkfield import checkfield
 from fielddisplay import fielddisplay
-from checkfield import checkfield
+import MatlabFuncs as m
 from WriteData import WriteData
-import MatlabFuncs as m
 
 
@@ -19,21 +19,19 @@
         self.melt_interpolation = ''
 
-    #set defaults
+        # Set defaults
         self.setdefaultparameters()
 
-    #}}}
+    # }}}
 
     def __repr__(self):  # {{{
-        string = '   grounding line migration parameters:'
-
-        string = "%s\n%s" % (string, fielddisplay(self, 'migration', 'type of grounding line migration: ''SoftMigration'', ''SubelementMigration'', ''AggressiveMigration'', ''Contact'', ''None'''))
-        string = "%s\n%s" % (string, fielddisplay(self, 'migration', 'type of friction interpolation on partially floating elements: ''SubelementFriction1'', ''SubelementFriction2'', ''NoFrictionOnPartiallyFloating'''))
-        string = "%s\n%s" % (string, fielddisplay(self, 'migration', 'type of melt interpolation on partially floating elements: ''SubelementMelt1'', ''SubelementMelt2'', ''NoMeltOnPartiallyFloating'', ''FullMeltOnPartiallyFloating'''))
-        return string
-    #}}}
+        s = '   grounding line migration parameters:\n'
+        s += '{}\n'.format(fielddisplay(self, 'migration', 'type of grounding line migration: \'SoftMigration\', \'SubelementMigration\', \'AggressiveMigration\', \'Contact\', \'None\''))
+        s += '{}\n'.format(fielddisplay(self, 'migration', 'type of friction interpolation on partially floating elements: ''SubelementFriction1'', ''SubelementFriction2'', ''NoFrictionOnPartiallyFloating'''))
+        s += '{}\n'.format(fielddisplay(self, 'migration', 'type of melt interpolation on partially floating elements: \'SubelementMelt1\', \'SubelementMelt2\', \'NoMeltOnPartiallyFloating\', \'FullMeltOnPartiallyFloating\''))
+        return s
+    # }}}
 
     def setdefaultparameters(self):  # {{{
-
-        #Type of migration
+        # Type of migration
         self.migration = 'SubelementMigration'
         self.friction_interpolation = 'SubelementFriction1'
@@ -41,8 +39,7 @@
 
         return self
-    #}}}
+    # }}}
 
     def checkconsistency(self, md, solution, analyses):  # {{{
-
         md = checkfield(md, 'fieldname', 'groundingline.migration', 'values', ['None', 'SubelementMigration', 'AggressiveMigration', 'SoftMigration', 'Contact', 'GroundingOnly'])
         md = checkfield(md, 'fieldname', 'groundingline.friction_interpolation', 'values', ['SubelementFriction1', 'SubelementFriction2', 'NoFrictionOnPartiallyFloating'])
@@ -53,7 +50,7 @@
                 md.checkmessage("requesting grounding line migration, but bathymetry is absent!")
             pos = np.nonzero(md.mask.ocean_levelset > 0.)[0]
-            if any(np.abs(md.geometry.base[pos] - md.geometry.bed[pos]) > 10**-10):
+            if any(np.abs(md.geometry.base[pos] - md.geometry.bed[pos]) > pow(10, -10)):
                 md.checkmessage("base not equal to bed on grounded ice!")
-            if any(md.geometry.bed - md.geometry.base > 10**-9):
+            if any(md.geometry.bed - md.geometry.base > pow(10, -9)):
                 md.checkmessage("bed superior to base on floating ice!")
 
Index: /issm/trunk/src/m/classes/hydrologydc.py
===================================================================
--- /issm/trunk/src/m/classes/hydrologydc.py	(revision 26743)
+++ /issm/trunk/src/m/classes/hydrologydc.py	(revision 26744)
@@ -7,9 +7,8 @@
 
 class hydrologydc(object):
-    """
-    Hydrologydc class definition
+    """HYDROLOGYDC class definition
 
     Usage:
-            hydrologydc = hydrologydc()
+        hydrologydc = hydrologydc()
     """
 
@@ -49,9 +48,12 @@
         self.eplflip_lock = 0
 
-    #set defaults
         self.setdefaultparameters()
     # }}}
 
     def __repr__(self):  # {{{
+        # TODO:
+        # - Convert all formatting to calls to <string>.format (see any 
+        #   already converted <class>.__repr__ method for examples)
+        #
         string = '   hydrology Dual Porous Continuum Equivalent parameters:'
         string = ' - general parameters'
Index: /issm/trunk/src/m/classes/hydrologyshreve.js
===================================================================
--- /issm/trunk/src/m/classes/hydrologyshreve.js	(revision 26743)
+++ /issm/trunk/src/m/classes/hydrologyshreve.js	(revision 26744)
@@ -1,73 +1,74 @@
-//HYDROLOGYSHREVE class definition
-//
-//   Usage:
-//      hydrologyshreve=new hydrologyshreve();
+class hydrologyshreve {//{{{
+	/**
+	 * HYDROLOGYSHREVE class definition
+	 *
+	 * Usage:
+	 *     hydrologyshreve = hydrologyshreve();
+	 */
+	constructor() {//{{{
+		this.spcwatercolumn = NaN;
+		this.stabilization = 0;
+		this.requested_outputs = [];
 
-function hydrologyshreve (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
+		if (arguments.length == 0) {
+			this.setdefaultparameters();
+		} else {
+			error('constructor not supported');
+		}
+	} //}}}
 
-		//Type of stabilization to use 0:nothing 1:artificial_diffusivity
-		this.stabilization=1;
+	disp() {//{{{
+		console.log(sprintf('   hydrologyshreve solution parameters:'));
+		fielddisplay(this, 'spcwatercolumn', 'water thickness constraints (NaN means no constraint) [m]');
+		fielddisplay(this, 'stabilization', 'artificial diffusivity (default: 1). can be more than 1 to increase diffusivity.');
+		fielddisplay(this, 'requested_outputs', 'additional outputs requested');
+	} //}}}
 
-		//default output
-		this.requested_outputs=['default'];
+	setdefaultparameters() {//{{{
+		// Type of stabilization to use 0:nothing 1:artificial_diffusivity
+		this.stabilization = 1;
+		this.requested_outputs = ['default'];
+	} //}}}
 
-	}// }}}
-		this.disp= function(){// {{{
+	checkconsistency(md, solution, analyses) {//{{{
+		// Early return
+		if (!analyses.contains('HydrologyShreveAnalysis') || (solution == 'TransientSolution' && !md.transient.ishydrology)) {
+			return md;
+		}
+		md = checkfield(md, 'fieldname', 'hydrology.spcwatercolumn', 'Inf', 1, 'timeseries', 1);
+		md = checkfield(md, 'fieldname', 'hydrology.stabilization', '>=', 0);
+		return md;
+	} //}}}
 
-		console.log(sprintf('   hydrologyshreve solution parameters:'));
-		fielddisplay(this,'spcwatercolumn','water thickness constraints (NaN means no constraint) [m]');
-		fielddisplay(this,'stabilization','artificial diffusivity (default is 1). can be more than 1 to increase diffusivity.');
-		fielddisplay(this,'requested_outputs','additional outputs requested');
+	defaultoutputs(md) {//{{{
+		return ['Watercolumn', 'HydrologyWaterVx', 'HydrologyWaterVy'];
+	} //}}}
 
-	}// }}}
-    this.extrude = function(md) {//{{{
-        return this;
-    };//}}}
-		this.classname= function(){// {{{
-			return "hydrologyshreve";
+	marshall(md, prefix, fid) {//{{{
+		WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 2, 'format', 'Integer');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'spcwatercolumn', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts);
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'stabilization', 'format', 'Double');
 
-		}// }}}
-	this.type= function(){// {{{
+		// Process requested outputs
+		let outputs = this.requested_outputs;
+		let pos = find(ismember(outputs, 'default'));
+		if (pos.length) {
+			/*
+			NOTE: In order to handle case where user has added 'default' more 
+			than once to this.requested_outputs, need to remove elements by 
+			index in reverse order.
+			*/
+			for (let i = (pos.length - 1); i >= 0; --i) {
+				outputs.splice(pos[i], 1);
+			}
+			let default_outputs = this.defaultoutputs(md);
+			for (let i = 0; i < default_outputs.length; ++i) {
+				outputs.push(default_outputs[i]);
+			}
+		}
+		WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray');
+	} //}}}
 
-		return "hydrologyshreve";
-	}// }}}
-		this.checkconsistency = function(md,solution,analyses) { //{{{
-
-			//Early return
-			if(!ArrayAnyEqual(ArrayIsMember('HydrologyShreveAnalysis',analyses),1)) return;
-
-			checkfield(md,'fieldname','hydrology.spcwatercolumn','Inf',1,'timeseries',1);
-			checkfield(md,'fieldname','hydrology.stabilization','>=',0);
-			checkfield(md,'fieldname','hydrology.requested_outputs','stringrow',1);
-
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'name','md.hydrology.model','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Double');
-			var outputs = this.requested_outputs;
-			for (var i=0;i<outputs.length;i++){
-				if (outputs[i] == 'default') {
-					outputs.splice(i,1);
-					var newoutputs=this.defaultoutputs(md);
-					for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
-				}
-			}
-			WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
-		}//}}}
-		this.defaultoutputs = function(md) { //{{{
-				return ['Watercolumn','HydrologyWaterVx','HydrologyWaterVy'];
-		}//}}}
-		this.fix=function() { //{{{
-			this.spcwatercolumn=NullFix(this.spcwatercolumn,NaN);
-		}//}}}
-	//properties 
-	// {{{
-	this.spcwatercolumn = NaN;
-	this.stabilization  = 0;
-	this.requested_outputs = [];
-	this.setdefaultparameters();
-	//}}}
-}
+	extrude(md) {//{{{
+	} //}}}
+} //}}}
Index: /issm/trunk/src/m/classes/hydrologyshreve.m
===================================================================
--- /issm/trunk/src/m/classes/hydrologyshreve.m	(revision 26743)
+++ /issm/trunk/src/m/classes/hydrologyshreve.m	(revision 26744)
@@ -11,6 +11,4 @@
 	end
 	methods
-		function self = extrude(self,md) % {{{
-		end % }}}
 		function self = hydrologyshreve(varargin) % {{{
 			switch nargin
@@ -23,30 +21,27 @@
 			end
 		end % }}}
-		function list = defaultoutputs(self,md) % {{{
-			list = {'Watercolumn','HydrologyWaterVx','HydrologyWaterVy'};
-		end % }}}    
+		function disp(self) % {{{
+			disp(sprintf('   hydrologyshreve solution parameters:'));
+			fielddisplay(self,'spcwatercolumn','water thickness constraints (NaN means no constraint) [m]');
+			fielddisplay(self,'stabilization','artificial diffusivity (default: 1). can be more than 1 to increase diffusivity.');
+			fielddisplay(self,'requested_outputs','additional outputs requested');
 
+		end % }}}
 		function self = setdefaultparameters(self) % {{{
 
 			%Type of stabilization to use 0:nothing 1:artificial_diffusivity
 			self.stabilization     = 1;
-      self.requested_outputs = {'default'};
+			self.requested_outputs = {'default'};
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
 
 			%Early return
-			if ~ismember('HydrologyShreveAnalysis',analyses)
-				return;
-			end
+			if ~ismember('HydrologyShreveAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.ishydrology==0), return; end
 
 			md = checkfield(md,'fieldname','hydrology.spcwatercolumn','Inf',1,'timeseries',1);
 			md = checkfield(md,'fieldname','hydrology.stabilization','>=',0);
 		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   hydrologyshreve solution parameters:'));
-			fielddisplay(self,'spcwatercolumn','water thickness constraints (NaN means no constraint) [m]');
-			fielddisplay(self,'stabilization','artificial diffusivity (default is 1). can be more than 1 to increase diffusivity.');
-      fielddisplay(self,'requested_outputs','additional outputs requested');
-
+		function list = defaultoutputs(self,md) % {{{
+			list = {'Watercolumn','HydrologyWaterVx','HydrologyWaterVy'};
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -54,11 +49,13 @@
 			WriteData(fid,prefix,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Double');
-      outputs = self.requested_outputs;
-      pos  = find(ismember(outputs,'default'));
-      if ~isempty(pos),
-        outputs(pos) = [];  %remove 'default' from outputs
-        outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-      end
-      WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
+			outputs = self.requested_outputs;
+			pos = find(ismember(outputs,'default'));
+			if ~isempty(pos),
+				outputs(pos) = []; %remove 'default' from outputs
+				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+			end
+			WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
+		end % }}}
+		function self = extrude(self,md) % {{{
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
Index: /issm/trunk/src/m/classes/hydrologyshreve.py
===================================================================
--- /issm/trunk/src/m/classes/hydrologyshreve.py	(revision 26743)
+++ /issm/trunk/src/m/classes/hydrologyshreve.py	(revision 26744)
@@ -1,2 +1,4 @@
+import numpy as np
+
 from fielddisplay import fielddisplay
 from checkfield import checkfield
@@ -5,67 +7,65 @@
 
 class hydrologyshreve(object):
-    """
-    HYDROLOGYSHREVE class definition
+    """HYDROLOGYSHREVE class definition
 
-       Usage:
-          hydrologyshreve = hydrologyshreve()
+    Usage:
+        hydrologyshreve = hydrologyshreve()
     """
 
-    def __init__(self):  # {{{
-        self.spcwatercolumn = float('NaN')
+    def __init__(self, *args): #{{{
+        self.spcwatercolumn = np.nan
         self.stabilization = 0
         self.requested_outputs = []
-    #set defaults
-        self.setdefaultparameters()
 
+        nargs = len(args)
+        if nargs == 0:
+            self.setdefaultparameters()
+        elif nargs == 1:
+            self.setdefaultparameters(args)
+        else:
+            raise RuntimeError('constructor not supported')
     #}}}
 
-    def __repr__(self):  # {{{
-
-        string = '   hydrologyshreve solution parameters:'
-        string = "%s\n%s" % (string, fielddisplay(self, 'spcwatercolumn', 'water thickness constraints (NaN means no constraint) [m]'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'stabilization', 'artificial diffusivity (default is 1). can be more than 1 to increase diffusivity.'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
-        return string
+    def __repr__(self): #{{{
+        s = '   hydrologyshreve solution parameters:\n'
+        s += '{}\n'.format(fielddisplay(self, 'spcwatercolumn', 'water thickness constraints (NaN means no constraint) [m]'))
+        s += '{}\n'.format(fielddisplay(self, 'stabilization', 'artificial diffusivity (default: 1). can be more than 1 to increase diffusivity.'))
+        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        return s
     #}}}
 
-    def extrude(self, md):  # {{{
-        return self
+    def setdefaultparameters(self): #{{{
+        # Type of stabilization to use 0:nothing 1:artificial_diffusivity
+        self.stabilization = 1
+        self.requested_outputs = ['default']
     #}}}
 
-    def setdefaultparameters(self):  # {{{
-        #Type of stabilization to use 0:nothing 1:artificial_diffusivity
-        self.stabilization = 1
-        self.requested_outputs = ['default']
-        return self
-    #}}}
-
-    def defaultoutputs(self, md):  # {{{
-        list = ['Watercolumn', 'HydrologyWaterVx', 'HydrologyWaterVy']
-        return list
-    #}}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
+    def checkconsistency(self, md, solution, analyses): #{{{
         #Early return
-        if 'HydrologyShreveAnalysis' not in analyses:
+        if 'HydrologyShreveAnalysis' not in analyses or (solution == 'TransientSolution' and not md.transient.ishydrology):
             return md
 
         md = checkfield(md, 'fieldname', 'hydrology.spcwatercolumn', 'Inf', 1, 'timeseries', 1)
         md = checkfield(md, 'fieldname', 'hydrology.stabilization', '>=', 0)
-        md = checkfield(md, 'fieldname', 'hydrology.requested_outputs', 'stringrow', 1)
         return md
     # }}}
 
-    def marshall(self, prefix, md, fid):  # {{{
+    def defaultoutputs(self, md): #{{{
+        return ['Watercolumn', 'HydrologyWaterVx', 'HydrologyWaterVy']
+    #}}}
+
+    def marshall(self, prefix, md, fid): #{{{
         WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 2, 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'spcwatercolumn', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
         WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Double')
-    #process requested outputs
         outputs = self.requested_outputs
         indices = [i for i, x in enumerate(outputs) if x == 'default']
-        if len(indices) > 0:
+        if len(indices):
             outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
             outputs = outputscopy
         WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray')
+    # }}}
 
-    # }}}
+    def extrude(self, md): #{{{
+        return self
+    #}}}
Index: /issm/trunk/src/m/classes/hydrologytws.m
===================================================================
--- /issm/trunk/src/m/classes/hydrologytws.m	(revision 26744)
+++ /issm/trunk/src/m/classes/hydrologytws.m	(revision 26744)
@@ -0,0 +1,63 @@
+%HYDROLOGYTWS class definition
+%
+%   Usage:
+%      hydrologytws=hydrologytws();
+
+classdef hydrologytws
+	properties (SetAccess=public) 
+		spcwatercolumn     = NaN;
+		requested_outputs  = {};
+	end
+	methods
+		function self = extrude(self,md) % {{{
+		end % }}}
+		function self = hydrologytws(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				case 1
+					self=structtoobj(self,varargin{1});
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function list = defaultoutputs(self,md) % {{{
+			list = {''};
+		end % }}}
+
+		function self = setdefaultparameters(self) % {{{
+			self.requested_outputs = {'default'};
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			%Early return
+			if ~ismember('HydrologyTwsAnalysis',analyses)
+				return;
+			end
+			md = checkfield(md,'fieldname','hydrology.spcwatercolumn','Inf',1,'timeseries',1);
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   hydrologytws solution parameters:'));
+			fielddisplay(self,'spcwatercolumn','water thickness constraints (NaN means no constraint) [m]');
+			fielddisplay(self,'requested_outputs','additional outputs requested');
+
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+			WriteData(fid,prefix,'name','md.hydrology.model','data',2,'format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			outputs = self.requested_outputs;
+			pos  = find(ismember(outputs,'default'));
+			if ~isempty(pos),
+				outputs(pos) = [];  %remove 'default' from outputs
+				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+			end
+			WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
+		end % }}}
+		function savemodeljs(self,fid,modelname) % {{{
+
+			writejs1Darray(fid,[modelname '.hydrology.spcwatercolumn'],self.spcwatercolumn);
+
+		end % }}}
+	end
+end
+
Index: /issm/trunk/src/m/classes/hydrologytws.py
===================================================================
--- /issm/trunk/src/m/classes/hydrologytws.py	(revision 26744)
+++ /issm/trunk/src/m/classes/hydrologytws.py	(revision 26744)
@@ -0,0 +1,64 @@
+import numpy as np
+
+from structtoobj import structtoobj
+
+class hydrologytws(object):
+    """HYDROLOGYTWS class definition
+
+    Usage:
+        hydrologytws = hydrologytws()
+    """
+
+    def __init__(self):  # {{{
+        self.spcwatercolumn = np.nan
+        self.requested_outputs = np.nan
+
+        nargs = len(args)
+        if nargs == 0:
+            self.setdefaultparameters()
+        elif nargs == 1:
+            self = structtoobj(self, args[0])
+        else:
+            raise RuntimeError('constructor not supported')
+    #}}}
+
+    def __repr__(self):  # {{{
+        s = '   hydrologytws solution parameters:\n'
+        s += '{}\n'.format(fielddisplay(self, 'spcwatercolumn', 'water thickness constraints (NaN means no constraint) [m]'))
+        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        return s
+    #}}}
+
+    def defaultoutputs(self, md): # {{{
+        return ['']
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        self.requested_outputs = ['defualt']
+        return self
+    #}}}
+
+    def extrude(self, md):  # {{{
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        # Early return
+        if 'HydrologyTwsAnalysis' not in analyses:
+            return
+        md = checkfield(md, 'fieldname', 'hydrology.spcwatercolumn', 'Inf', 1, 'timeseries', 1)
+    #}}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 2, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'spcwatercolumn', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        outputs = self.requested_outputs
+        pos  = find(ismember(outputs,'default'))
+        if not len(pos),
+            outputs[pos] = [];  # remove 'default' from outputs
+            outputs.extend(defaultoutputs(self, md)) # add defaults
+        end
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray')
+    # }}}
+
+
Index: /issm/trunk/src/m/classes/initialization.js
===================================================================
--- /issm/trunk/src/m/classes/initialization.js	(revision 26743)
+++ /issm/trunk/src/m/classes/initialization.js	(revision 26744)
@@ -17,9 +17,16 @@
 		fielddisplay(this,'pressure','pressure field [Pa]');
 		fielddisplay(this,'temperature','temperature [K]');
+		fielddisplay(this,'enthalpy','enthalpy [J]');
 		fielddisplay(this,'waterfraction','fraction of water in the ice');
 		fielddisplay(this,'sediment_head','sediment water head of subglacial system [m]');
 		fielddisplay(this,'epl_head','epl water head of subglacial system [m]');
 		fielddisplay(this,'epl_thickness','epl layer thickness [m]');
-		fielddisplay(this,'watercolumn','thickness of subglacial water [m]');
+		fielddisplay(this,'watercolumn','subglacial water sheet thickness (for Shreve and GlaDS) [m]');
+		fielddisplay(this,'hydraulic_potential','Hydraulic potential (for GlaDS) [Pa]');
+		fielddisplay(this,'channelarea','subglacial water channel area (for GlaDS) [m2]');
+		fielddisplay(this,'sample','Realization of a Gaussian random field');
+		fielddisplay(this,'bottompressure','Bottom pressures');
+		fielddisplay(this,'dsl','Dynamic sea level.');
+		fielddisplay(this,'str','Steric sea level.');
 
 	}// }}}
@@ -51,4 +58,11 @@
 				checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
 			}
+			if(ArrayAnyEqual(ArrayIsMember('OceantransportAnalysis',analyses),1)){
+				if (strcmp(solution,'TransientSolution') && md.transient.isslc && md.transient.isoceantransport) {
+					checkfield(md,'fieldname','initialization.bottompressure','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+					checkfield(md,'fieldname','initialization.dsl','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+					checkfield(md,'fieldname','initialization.str','NaN',1,'Inf',1,'size',[1, 1]);
+				}
+			}
 			if(ArrayAnyEqual(ArrayIsMember('BalancethicknessSolution',analyses),1) & (solution=='BalancethicknessSolution')){
 				checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
@@ -65,28 +79,45 @@
 				}
 			}
-			if(ArrayAnyEqual(ArrayIsMember('ThermalAnalysis',analyses),1)){
+			if ((ArrayAnyEqual(ArrayIsMember('ThermalAnalysis',analyses),1)) && !strcmp(solution,'TransientSolution') && md.transient.isthermal == 0){
 				checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
 				checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
-				if (md.mesh.dimension() == 3){
-					checkfield(md,'fieldname','initialization.vz','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
-				}
-				checkfield(md,'fieldname','initialization.pressure','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
-				checkfield(md,'fieldname','initialization.temperature','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
-			}
-			if( ArrayAnyEqual(ArrayIsMember('EnthalpyAnalysis',analyses),1) & md.thermal.isenthalpy){
-				checkfield(md,'fieldname','initialization.waterfraction','>=',0,'size',[md.mesh.numberofvertices, 1]);
-				checkfield(md,'fieldname','initialization.watercolumn'  ,'>=',0,'size',[md.mesh.numberofvertices, 1]);
-			}
-			if(ArrayAnyEqual(ArrayIsMember('HydrologyShreveAnalysis',analyses),1)){
+				if (md.mesh.dimension()==3) {
+					checkfield(md,'fieldname','initialization.vz','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+				}
+				checkfield(md,'fieldname','initialization.pressure','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+				checkfield(md,'fieldname','initialization.temperature','NaN',1,'Inf',1,'size','universal');
+			}
+			if (ArrayAnyEqual(ArrayIsMember('EnthalpyAnalysis',analyses),1) && md.thermal.isenthalpy){
+				checkfield(md,'fieldname','initialization.waterfraction','>=',0,'size','universal');
+				checkfield(md,'fieldname','initialization.watercolumn'  ,'>=',0,'size','universal');
+			}
+			if (ArrayAnyEqual(ArrayIsMember('HydrologyShreveAnalysis',analyses),1)){
 				if (md.hydrology.type() == 'hydrologyshreve'){
 					checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
 				}
 			}
-			if(ArrayAnyEqual(ArrayIsMember('HydrologyDCInefficientAnalysis',analyses),1)){
+			if (ArrayAnyEqual(ArrayIsMember('HydrologyTwsAnalysis',analyses),1)){
+				if (md.hydrology.type() == 'hydrologytws'){
+					checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
+				}
+			}
+			if (ArrayAnyEqual(ArrayIsMember('SealevelchangeAnalysis',analyses),1)){
+				if (strcmp(solution,'TransientSolution') && md.transient.isslc) {
+					checkfield(md,'fieldname','initialization.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+				}
+			}
+			if (ArrayAnyEqual(ArrayIsMember('HydrologyGlaDSAnalysis',analyses),1)){
+				if (md.hydrology.type() == 'hydrologyglads'){
+					checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+					checkfield(md,'fieldname','initialization.hydraulic_potential','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+					checkfield(md,'fieldname','initialization.channelarea','NaN',1,'Inf',1,'>=',0,'size',[md.mesh.numberofedges, 1]);
+				}
+			}
+			if (ArrayAnyEqual(ArrayIsMember('HydrologyDCInefficientAnalysis',analyses),1)){
 				if (md.hydrology.type() == 'hydrologydc'){
 					checkfield(md,'fieldname','initialization.sediment_head','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
 				}
 			}
-			if(ArrayAnyEqual(ArrayIsMember('HydrologyDCEfficientAnalysis',analyses),1)){
+			if (ArrayAnyEqual(ArrayIsMember('HydrologyDCEfficientAnalysis',analyses),1)){
 				if (md.hydrology.type() == 'hydrologydc'){
 					if (md.hydrology.isefficientlayer==1){
@@ -96,4 +127,9 @@
 				}
 			}
+			if (ArrayAnyEqual(ArrayIsMember('SamplingAnalysis',analyses),1) && !strcmp(solution,'TransientSolution')&& md.transient.issampling == 0){
+				if (!isNaN(md.initialization.sample)) {
+					checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+				}
+			}
 		} //}}}
 		this.marshall=function(md,prefix,fid) { //{{{
@@ -105,4 +141,8 @@
 			WriteData(fid,prefix,'object',this,'fieldname','vz','format','DoubleMat','mattype',1,'scale',1./yts);
 			WriteData(fid,prefix,'object',this,'fieldname','pressure','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',this,'fieldname','sealevel','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',this,'fieldname','bottompressure','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',this,'fieldname','str','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',this,'fieldname','dsl','format','DoubleMat','mattype',1);
 			WriteData(fid,prefix,'object',this,'fieldname','temperature','format','DoubleMat','mattype',1);
 			WriteData(fid,prefix,'object',this,'fieldname','waterfraction','format','DoubleMat','mattype',1);
@@ -111,13 +151,20 @@
 			WriteData(fid,prefix,'object',this,'fieldname','epl_thickness','format','DoubleMat','mattype',1);
 			WriteData(fid,prefix,'object',this,'fieldname','watercolumn','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',this,'fieldname','channelarea','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',this,'fieldname','hydraulic_potential','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',this,'fieldname','sample','format','DoubleMat','mattype',1);
 
 			if (md.thermal.isenthalpy){
-				tpmp=NewArrayFill(md.mesh.numberofvertices,0);
-				for (var i=0;i<md.mesh.numberofvertices;i++) tpmp[i]= md.materials.meltingpoint - md.materials.beta*md.initialization.pressure[i];
-				enthalpy=NewArrayFill(md.mesh.numberofvertices,0); 
-				for (var i=0;i<md.mesh.numberofvertices;i++)enthalpy[i] = md.materials.heatcapacity*(md.initialization.temperature[i]-md.constants.referencetemperature);
-				
-				for (var i=0;i<md.mesh.numberofvertices;i++)if(md.initialization.temperature[i]>=tpmp[i]){
-					enthalpy[i] = md.materials.heatcapacity*(tpmp[i] - md.constants.referencetemperature) + md.materials.latentheat*md.initialization.waterfraction[i];
+				let enthalpy;
+				if (isNaN(self.enthalpy) && this.enthalpy.length <= 1) {
+					tpmp=NewArrayFill(md.mesh.numberofvertices,0);
+					for (var i=0;i<md.mesh.numberofvertices;i++) tpmp[i]= md.materials.meltingpoint - md.materials.beta*md.initialization.pressure[i];
+					enthalpy=NewArrayFill(md.mesh.numberofvertices,0); 
+					for (var i=0;i<md.mesh.numberofvertices;i++)enthalpy[i] = md.materials.heatcapacity*(md.initialization.temperature[i]-md.constants.referencetemperature);
+					for (var i=0;i<md.mesh.numberofvertices;i++)if(md.initialization.temperature[i]>=tpmp[i]){
+						enthalpy[i] = md.materials.heatcapacity*(tpmp[i] - md.constants.referencetemperature) + md.materials.latentheat*md.initialization.waterfraction[i];
+					}
+				} else {
+					enthalpy = this.enthalpy;
 				}
 				WriteData(fid,prefix,'data',enthalpy,'format','DoubleMat','mattype',1,'name','md.initialization.enthalpy');
@@ -136,15 +183,23 @@
 	//properties 
 	// {{{
-	this.vx            = NaN;
-	this.vy            = NaN;
-	this.vz            = NaN;
-	this.vel           = NaN;
-	this.pressure      = NaN;
-	this.temperature   = NaN;
-	this.waterfraction = NaN;
-	this.sediment_head = NaN;
-	this.epl_head      = NaN;
-	this.epl_thickness = NaN;
-	this.watercolumn   = NaN;
+	this.vx                  = NaN;
+	this.vy                  = NaN;
+	this.vz                  = NaN;
+	this.vel                 = NaN;
+	this.pressure            = NaN;
+	this.temperature         = NaN;
+	this.enthalpy            = NaN;
+	this.waterfraction       = NaN;
+	this.sediment_head       = NaN;
+	this.epl_head            = NaN;
+	this.epl_thickness       = NaN;
+	this.watercolumn         = NaN;
+	this.hydraulic_potential = NaN;
+	this.channelarea         = NaN;
+	this.sealevel            = NaN;
+	this.bottompressure      = NaN;
+	this.dsl                 = NaN;
+	this.str                 = NaN;
+	this.sample              = NaN;
 	this.setdefaultparameters();
 
Index: /issm/trunk/src/m/classes/initialization.m
===================================================================
--- /issm/trunk/src/m/classes/initialization.m	(revision 26743)
+++ /issm/trunk/src/m/classes/initialization.m	(revision 26744)
@@ -20,22 +20,11 @@
 		hydraulic_potential = NaN;
 		channelarea         = NaN;
+		sealevel            = NaN;
+		bottompressure      = NaN;
+		dsl                 = NaN;
+		str                 = NaN;
+		sample              = NaN;
 	end
 	methods
-		function self = extrude(self,md) % {{{
-			self.vx=project3d(md,'vector',self.vx,'type','node');
-			self.vy=project3d(md,'vector',self.vy,'type','node');
-			self.vz=project3d(md,'vector',self.vz,'type','node');
-			self.vel=project3d(md,'vector',self.vel,'type','node');
-			self.temperature=project3d(md,'vector',self.temperature,'type','node');
-			self.enthalpy=project3d(md,'vector',self.enthalpy,'type','node');
-			self.waterfraction=project3d(md,'vector',self.waterfraction,'type','node');
-			self.watercolumn=project3d(md,'vector',self.watercolumn,'type','node','layer',1);
-			self.sediment_head=project3d(md,'vector',self.sediment_head,'type','node','layer',1);
-			self.epl_head=project3d(md,'vector',self.epl_head,'type','node','layer',1);
-			self.epl_thickness=project3d(md,'vector',self.epl_thickness,'type','node','layer',1);
-
-			%Lithostatic pressure by default
-			self.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z);
-		end % }}}
 		function self = initialization(varargin) % {{{
 			switch nargin
@@ -47,5 +36,4 @@
 		end % }}}
 		function self = setdefaultparameters(self) % {{{
-
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
@@ -59,4 +47,11 @@
 				md = checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
 				md = checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+			end
+			if ismember('OceantransportAnalysis',analyses) 
+				if strcmp(solution,'TransientSolution') & md.transient.isslc & md.transient.isoceantransport,
+					md = checkfield(md,'fieldname','initialization.bottompressure','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+					md = checkfield(md,'fieldname','initialization.dsl','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+					md = checkfield(md,'fieldname','initialization.str','NaN',1,'Inf',1,'size',[1 1]);
+				end
 			end
 			if ismember('BalancethicknessAnalysis',analyses) & strcmp(solution,'BalancethicknessSolution'),
@@ -88,5 +83,17 @@
 			if ismember('HydrologyShreveAnalysis',analyses),
 				if isa(md.hydrology,'hydrologyshreve'),
+					if (strcmp(solution,'TransientSolution') & md.transient.ishydrology) | strcmp(solution,'HydrologySolution'),
+						md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+					end
+				end
+			end
+			if ismember('HydrologyTwsAnalysis',analyses),
+				if isa(md.hydrology,'hydrologytws'),
 					md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+				end
+			end
+			if ismember('SealevelchangeAnalysis',analyses),
+				if strcmp(solution,'TransientSolution') & md.transient.isslc,
+					md = checkfield(md,'fieldname','initialization.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
 				end
 			end
@@ -109,4 +116,9 @@
 						md = checkfield(md,'fieldname','initialization.epl_thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
 					end
+				end
+			end
+			if ismember('SamplingAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.issampling == 0),
+				if ~isnan(md.initialization.sample)
+					md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
 				end
 			end
@@ -129,5 +141,8 @@
 			fielddisplay(self,'hydraulic_potential','Hydraulic potential (for GlaDS) [Pa]');
 			fielddisplay(self,'channelarea','subglacial water channel area (for GlaDS) [m2]');
-
+			fielddisplay(self,'sample','Realization of a Gaussian random field');
+			fielddisplay(self,'bottompressure','Bottom pressures');
+			fielddisplay(self,'dsl','Dynamic sea level.');
+			fielddisplay(self,'str','Steric sea level.');
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -139,4 +154,8 @@
 			WriteData(fid,prefix,'object',self,'fieldname','vz','format','DoubleMat','mattype',1,'scale',1./yts);
 			WriteData(fid,prefix,'object',self,'fieldname','pressure','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',self,'fieldname','sealevel','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'fieldname','bottompressure','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',self,'fieldname','str','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',self,'fieldname','dsl','format','DoubleMat','mattype',1);
 			WriteData(fid,prefix,'object',self,'fieldname','temperature','format','DoubleMat','mattype',1);
 			WriteData(fid,prefix,'object',self,'fieldname','waterfraction','format','DoubleMat','mattype',1);
@@ -147,4 +166,5 @@
 			WriteData(fid,prefix,'object',self,'fieldname','channelarea','format','DoubleMat','mattype',1);
 			WriteData(fid,prefix,'object',self,'fieldname','hydraulic_potential','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',self,'fieldname','sample','format','DoubleMat','mattype',1);
 
 			if md.thermal.isenthalpy,
@@ -161,6 +181,26 @@
 			end
 		end % }}}
+		function self = extrude(self,md) % {{{
+			self.vx=project3d(md,'vector',self.vx,'type','node');
+			self.vy=project3d(md,'vector',self.vy,'type','node');
+			self.vz=project3d(md,'vector',self.vz,'type','node');
+			self.vel=project3d(md,'vector',self.vel,'type','node');
+			self.temperature=project3d(md,'vector',self.temperature,'type','node');
+			self.enthalpy=project3d(md,'vector',self.enthalpy,'type','node');
+			self.waterfraction=project3d(md,'vector',self.waterfraction,'type','node');
+			self.watercolumn=project3d(md,'vector',self.watercolumn,'type','node','layer',1);
+			self.sediment_head=project3d(md,'vector',self.sediment_head,'type','node','layer',1);
+			self.epl_head=project3d(md,'vector',self.epl_head,'type','node','layer',1);
+			self.epl_thickness=project3d(md,'vector',self.epl_thickness,'type','node','layer',1);
+			self.sealevel=project3d(md,'vector',self.sealevel,'type','node','layer',1);
+			self.bottompressure=project3d(md,'vector',self.bottompressure,'type','node','layer',1);
+			self.dsl=project3d(md,'vector',self.dsl,'type','node','layer',1);
+			self.str=project3d(md,'vector',self.str,'type','node','layer',1);
+
+			%Lithostatic pressure by default
+			self.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z);
+		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
-		
+
 			writejs1Darray(fid,[modelname '.initialization.vx'],self.vx);
 			writejs1Darray(fid,[modelname '.initialization.vy'],self.vy);
@@ -177,4 +217,5 @@
 			writejs1Darray(fid,[modelname '.initialization.hydraulic_potential'],self.hydraulic_potential);
 			writejs1Darray(fid,[modelname '.initialization.channel'],self.channelarea);
+			writejs1Darray(fid,[modelname '.initialization.sample'],self.sample);
 
 		end % }}}
Index: /issm/trunk/src/m/classes/initialization.py
===================================================================
--- /issm/trunk/src/m/classes/initialization.py	(revision 26743)
+++ /issm/trunk/src/m/classes/initialization.py	(revision 26744)
@@ -11,33 +11,36 @@
 
     Usage:
-    initialization = initialization()
+        initialization = initialization()
     """
 
-    def __init__(self):  # {{{
+    def __init__(self): #{{{
         self.vx = np.nan
         self.vy = np.nan
         self.vz = np.nan
         self.vel = np.nan
-        self.enthalpy = np.nan
         self.pressure = np.nan
         self.temperature = np.nan
+        self.enthalpy = np.nan
         self.waterfraction = np.nan
-        self.watercolumn = np.nan
         self.sediment_head = np.nan
         self.epl_head = np.nan
         self.epl_thickness = np.nan
+        self.watercolumn = np.nan
         self.hydraulic_potential = np.nan
         self.channelarea = np.nan
+        self.sealevel = np.nan
+        self.bottompressure = np.nan
+        self.dsl = np.nan
+        self.str = np.nan
+        self.sample = np.nan
 
-        #set defaults
         self.setdefaultparameters()
     #}}}
-
-    def __repr__(self):  # {{{
+    def __repr__(self): #{{{
         s = '   initial field values:\n'
-        s += '{}\n'.format(fielddisplay(self, 'vx', 'x component of velocity [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'vy', 'y component of velocity [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'vz', 'z component of velocity [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'vel', 'velocity norm [m / yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'vx', 'x component of velocity [m/yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'vy', 'y component of velocity [m/yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'vz', 'z component of velocity [m/yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'vel', 'velocity norm [m/yr]'))
         s += '{}\n'.format(fielddisplay(self, 'pressure', 'pressure [Pa]'))
         s += '{}\n'.format(fielddisplay(self, 'temperature', 'temperature [K]'))
@@ -50,35 +53,11 @@
         s += '{}\n'.format(fielddisplay(self, 'hydraulic_potential', 'Hydraulic potential (for GlaDS) [Pa]'))
         s += '{}\n'.format(fielddisplay(self, 'channelarea', 'subglaciale water channel area (for GlaDS) [m2]'))
+        s += '{}\n'.format(fielddisplay(self,'sample', 'Realization of a Gaussian random field'))
         return s
     #}}}
-
-    def extrude(self, md):  # {{{
-        self.vx = project3d(md, 'vector', self.vx, 'type', 'node')
-        self.vy = project3d(md, 'vector', self.vy, 'type', 'node')
-        self.vz = project3d(md, 'vector', self.vz, 'type', 'node')
-        self.vel = project3d(md, 'vector', self.vel, 'type', 'node')
-        self.temperature = project3d(md, 'vector', self.temperature, 'type', 'node')
-        self.enthalpy = project3d(md, 'vector', self.enthalpy, 'type', 'node')
-        self.waterfraction = project3d(md, 'vector', self.waterfraction, 'type', 'node')
-        self.watercolumn = project3d(md, 'vector', self.watercolumn, 'type', 'node')
-        self.sediment_head = project3d(md, 'vector', self.sediment_head, 'type', 'node', 'layer', 1)
-        self.epl_head = project3d(md, 'vector', self.epl_head, 'type', 'node', 'layer', 1)
-        self.epl_thickness = project3d(md, 'vector', self.epl_thickness, 'type', 'node', 'layer', 1)
-
-        #Lithostatic pressure by default
-        if np.ndim(md.geometry.surface) == 2:
-            print('Reshaping md.geometry.surface for your convenience but you should fix it in your model set up')
-            self.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface.reshape(-1, ) - md.mesh.z)
-        else:
-            self.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface - md.mesh.z)
-
-        return self
+    def setdefaultparameters(self): #{{{
+        return
     #}}}
-
-    def setdefaultparameters(self):  # {{{
-        return self
-    #}}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
+    def checkconsistency(self, md, solution, analyses): #{{{
         if 'StressbalanceAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.isstressbalance:
             if not np.any(np.logical_or(np.isnan(md.initialization.vx), np.isnan(md.initialization.vy))):
@@ -88,4 +67,9 @@
             md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
             md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        if 'OceantransportAnalysis' in analyses:
+            if solution == 'TransientSolution' and md.transient.isslc and md.transient.isoceantransport:
+                md = checkfield(md, 'fieldname', 'initialization.bottompressure', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+                md = checkfield(md, 'fieldname', 'initialization.dsl', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+                md = checkfield(md, 'fieldname', 'initialization.str', 'NaN', 1, 'Inf', 1, 'size', [1])
         if 'BalancethicknessAnalysis' in analyses and solution == 'BalancethicknessSolution':
             md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
@@ -110,13 +94,12 @@
         if 'HydrologyShreveAnalysis' in analyses:
             if hasattr(md.hydrology, 'hydrologyshreve'):
+                if (solution == 'TransientSolution' and md.transient.ishydrology) or solution == 'HydrologySolution':
+                    md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        if 'HydrologyTwsAnalysis' in analyses:
+            if hasattr(md.hydrology, 'hydrologytws'):
                 md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        if 'HydrologyDCInefficientAnalysis' in analyses:
-            if hasattr(md.hydrology, 'hydrologydc'):
-                md = checkfield(md, 'fieldname', 'initialization.sediment_head', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-        if 'HydrologyDCEfficientAnalysis' in analyses:
-            if hasattr(md.hydrology, 'hydrologydc'):
-                if md.hydrology.isefficientlayer == 1:
-                    md = checkfield(md, 'fieldname', 'initialization.epl_head', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
-                    md = checkfield(md, 'fieldname', 'initialization.epl_thickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        if 'SealevelchangeAnalysis' in analyses:
+            if solution == 'TransientSolution' and md.transient.isslc:
+                md = checkfield(md, 'fieldname', 'initialization.sealevel', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
         if 'HydrologyGlaDSAnalysis' in analyses:
             if hasattr(md.hydrology, 'hydrologyglads'):
@@ -124,13 +107,20 @@
                 md = checkfield(md, 'fieldname', 'initialization.hydraulic_potential', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
                 md = checkfield(md, 'fieldname', 'initialization.channelarea', 'NaN', 1, 'Inf', 1, '>=', 0, 'size', [md.mesh.numberofelements])
+        if 'SamplingAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.issampling:
+            if np.any(np.isnan(md.initialization.sample)):
+                md = checkfield(md, 'fieldname', 'initialization.sample', 'NaN', 1,'Inf', 1, 'size', [md.mesh.numberofvertices])
         return md
-    # }}}
+    #}}}
+    def marshall(self, prefix, md, fid): #{{{
+        yts = md.constants.yts
 
-    def marshall(self, prefix, md, fid):  # {{{
-        yts = md.constants.yts
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vx', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vy', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vz', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'vx', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'vy', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'vz', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts)
         WriteData(fid, prefix, 'object', self, 'fieldname', 'pressure', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevel', 'format', 'DoubleMat', 'mattype', 1,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'bottompressure', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'str', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'dsl', 'format', 'DoubleMat', 'mattype', 1)
         WriteData(fid, prefix, 'object', self, 'fieldname', 'temperature', 'format', 'DoubleMat', 'mattype', 1)
         WriteData(fid, prefix, 'object', self, 'fieldname', 'waterfraction', 'format', 'DoubleMat', 'mattype', 1)
@@ -141,11 +131,40 @@
         WriteData(fid, prefix, 'object', self, 'fieldname', 'channelarea', 'format', 'DoubleMat', 'mattype', 1)
         WriteData(fid, prefix, 'object', self, 'fieldname', 'hydraulic_potential', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sample', 'format', 'DoubleMat', 'mattype', 1)
+
         if md.thermal.isenthalpy:
             if (np.size(self.enthalpy) <= 1):
+                # Reconstruct enthalpy
                 tpmp = md.materials.meltingpoint - md.materials.beta * md.initialization.pressure
-                pos = np.nonzero(md.initialization.waterfraction > 0.)[0]
+                pos = np.where(md.initialization.waterfraction > 0)[0]
                 self.enthalpy = md.materials.heatcapacity * (md.initialization.temperature - md.constants.referencetemperature)
-                self.enthalpy[pos] = md.materials.heatcapacity * (tpmp[pos].reshape(-1, ) - md.constants.referencetemperature) + md.materials.latentheat * md.initialization.waterfraction[pos].reshape(-1, )
+                self.enthalpy[pos] = md.materials.heatcapacity * (tpmp[pos].reshape(-1,) - md.constants.referencetemperature) + md.materials.latentheat * md.initialization.waterfraction[pos].reshape(-1,)
 
             WriteData(fid, prefix, 'data', self.enthalpy, 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.initialization.enthalpy')
-    # }}}
+    #}}}
+    def extrude(self, md): #{{{
+        self.vx = project3d(md, 'vector', self.vx, 'type', 'node')
+        self.vy = project3d(md, 'vector', self.vy, 'type', 'node')
+        self.vz = project3d(md, 'vector', self.vz, 'type', 'node')
+        self.vel = project3d(md, 'vector', self.vel, 'type', 'node')
+        self.temperature = project3d(md, 'vector', self.temperature, 'type', 'node')
+        self.enthalpy = project3d(md, 'vector', self.enthalpy, 'type', 'node')
+        self.waterfraction = project3d(md, 'vector', self.waterfraction, 'type', 'node')
+        self.watercolumn = project3d(md, 'vector', self.watercolumn, 'type', 'node')
+        self.sediment_head = project3d(md, 'vector', self.sediment_head, 'type', 'node', 'layer', 1)
+        self.epl_head = project3d(md, 'vector', self.epl_head, 'type', 'node', 'layer', 1)
+        self.epl_thickness = project3d(md, 'vector', self.epl_thickness, 'type', 'node', 'layer', 1)
+        self.sealevel = project3d(md, 'vector', self.sealevel, 'type', 'node', 'layer', 1)
+        self.bottompressure = project3d(md, 'vector', self.bottompressure, 'type', 'node', 'layer', 1)
+        self.dsl = project3d(md, 'vector', self.dsl, 'type', 'node', 'layer', 1)
+        self.str = project3d(md, 'vector', self.str, 'type', 'node', 'layer', 1)
+
+        # Lithostatic pressure by default
+        if np.ndim(md.geometry.surface) == 2:
+            print('Reshaping md.geometry.surface for your convenience but you should fix it in your model set up')
+            self.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface.reshape(-1, 1) - md.mesh.z)
+        else:
+            self.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface - md.mesh.z)
+
+        return self
+    #}}}
Index: /issm/trunk/src/m/classes/inversion.js
===================================================================
--- /issm/trunk/src/m/classes/inversion.js	(revision 26743)
+++ /issm/trunk/src/m/classes/inversion.js	(revision 26744)
@@ -140,4 +140,5 @@
 			WriteData(fid,prefix,'object',this,'fieldname','iscontrol','format','Boolean');
 			WriteData(fid,prefix,'object',this,'fieldname','incomplete_adjoint','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','vel_obs','format','DoubleMat','mattype',1,'scale',1/yts);
 			if (!this.iscontrol) return;
 			WriteData(fid,prefix,'object',this,'fieldname','nsteps','format','Integer');
Index: /issm/trunk/src/m/classes/inversion.m
===================================================================
--- /issm/trunk/src/m/classes/inversion.m	(revision 26743)
+++ /issm/trunk/src/m/classes/inversion.m	(revision 26744)
@@ -99,11 +99,11 @@
 			md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
 			md = checkfield(md,'fieldname','inversion.gradient_scaling','size',[md.inversion.nsteps num_controls]);
-			md = checkfield(md,'fieldname','inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
-			md = checkfield(md,'fieldname','inversion.max_parameters','size',[md.mesh.numberofvertices num_controls]);
+			md = checkfield(md,'fieldname','inversion.min_parameters','size',[NaN num_controls]);
+			md = checkfield(md,'fieldname','inversion.max_parameters','size',[NaN num_controls]);
 
 			%Only SSA, HO and FS are supported right now
 			if strcmp(solution,'StressbalanceSolution')
-				if ~(md.flowequation.isSSA || md.flowequation.isHO || md.flowequation.isFS || md.flowequation.isL1L2),
-					md = checkmessage(md,['inversion can only be performed for SSA, HO or FS ice flow models']);
+				if ~(md.flowequation.isSSA || md.flowequation.isMLHO || md.flowequation.isHO || md.flowequation.isFS || md.flowequation.isL1L2),
+					md = checkmessage(md,['inversion can only be performed for SSA, MLHO, HO or FS ice flow models']);
 				end
 			end
Index: /issm/trunk/src/m/classes/inversion.py
===================================================================
--- /issm/trunk/src/m/classes/inversion.py	(revision 26743)
+++ /issm/trunk/src/m/classes/inversion.py	(revision 26744)
@@ -138,6 +138,6 @@
         # Only SSA, HO and FS are supported right now
         if solution == 'StressbalanceSolution':
-            if not (md.flowequation.isSSA or md.flowequation.isHO or md.flowequation.isFS or md.flowequation.isL1L2):
-                md.checkmessage("'inversion can only be performed for SSA, HO or FS ice flow models")
+            if not (md.flowequation.isSSA or md.flowequation.isMLHO or md.flowequation.isHO or md.flowequation.isFS or md.flowequation.isL1L2):
+                md.checkmessage("'inversion can only be performed for SSA, MLHO, HO or FS ice flow models")
         if solution == 'BalancethicknessSolution':
             md = checkfield(md, 'fieldname', 'inversion.thickness_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
Index: /issm/trunk/src/m/classes/issmsettings.js
===================================================================
--- /issm/trunk/src/m/classes/issmsettings.js	(revision 26743)
+++ /issm/trunk/src/m/classes/issmsettings.js	(revision 26744)
@@ -5,90 +5,95 @@
 
 function issmsettings (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-		//are we short in memory ? (0 faster but requires more memory)
-		this.lowmem=0;
+    //methods
+    this.setdefaultparameters = function(){// {{{
+        //are we short in memory ? (0 faster but requires more memory)
+        this.lowmem=0;
 
-		//i/o:
-		this.io_gather=1;
+        //i/o:
+        this.io_gather=1;
 
-		//results frequency by default every step
-		this.output_frequency=1;
+        //results frequency by default every step
+        this.output_frequency=1;
 
-		//checkpoints frequency, by default never: 
-		this.checkpoint_frequency=0;
+        //coupling frequency of the stress balance solver by default every step
+        this.sb_coupling_frequency=1;
 
-		//this option can be activated to load automatically the results
-		//onto the model after a parallel run by waiting for the lock file
-		//N minutes that is generated once the solution has converged
-		//0 to deactivate
-		this.waitonlock=Infinity;
+        //checkpoints frequency, by default never:
+        this.checkpoint_frequency=0;
 
-		//upload options: 
-		upload_port         = 0;
-		
-		//throw an error if solver residue exceeds this value
-		this.solver_residue_threshold=1e-6;
+        //this option can be activated to load automatically the results
+        //onto the model after a parallel run by waiting for the lock file
+        //N minutes that is generated once the solution has converged
+        //0 to deactivate
+        this.waitonlock=Infinity;
 
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   issmsettings class echo:'));
-		
-		fielddisplay(this,'results_on_nodes','results are output for all the nodes of each element');
-		fielddisplay(this,'io_gather','I/O gathering strategy for result outputs (default 1)');
-		fielddisplay(this,'lowmem','is the memory limited ? (0 or 1)');
-		fielddisplay(this,'output_frequency','frequency at which results are saved in all solutions with multiple time_steps');
-		fielddisplay(this,'checkpoint_frequency','frequency at which the runs are being recorded, allowing for a restart');
-		fielddisplay(this,'waitonlock','maximum number of minutes to wait for batch results (NaN to deactivate)');
-		fielddisplay(this,'upload_server','server hostname where model should be uploaded');
-		fielddisplay(this,'upload_path','path on server where model should be uploaded');
-		fielddisplay(this,'upload_login','server login');
-		fielddisplay(this,'upload_port','port login (default is 0)');
-		fielddisplay(this,'upload_filename','unique id generated when uploading the file to server');
-		fielddisplay(this,'solver_residue_threshold','throw an error if solver residue exceeds this value');
+        //upload options:
+        this.upload_port         = 0;
+
+        //throw an error if solver residue exceeds this value
+        this.solver_residue_threshold=1e-6;
+
+    }// }}}
+    this.disp= function(){// {{{
+        console.log(sprintf('   issmsettings class echo:'));
+
+        fielddisplay(this,'results_on_nodes','results are output for all the nodes of each element');
+        fielddisplay(this,'io_gather','I/O gathering strategy for result outputs (default 1)');
+        fielddisplay(this,'lowmem','is the memory limited ? (0 or 1)');
+        fielddisplay(this,'output_frequency','frequency at which results are saved in all solutions with multiple time_steps');
+        fielddisplay(this,'checkpoint_frequency','frequency at which the runs are being recorded, allowing for a restart');
+        fielddisplay(this,'waitonlock','maximum number of minutes to wait for batch results (NaN to deactivate)');
+        fielddisplay(this,'upload_server','server hostname where model should be uploaded');
+        fielddisplay(this,'upload_path','path on server where model should be uploaded');
+        fielddisplay(this,'upload_login','server login');
+        fielddisplay(this,'upload_port','port login (default is 0)');
+        fielddisplay(this,'upload_filename','unique id generated when uploading the file to server');
+        fielddisplay(this,'solver_residue_threshold','throw an error if solver residue exceeds this value');
 
 
-	}// }}}
-	this.classname= function(){// {{{
-		return "issmsettings";
+    }// }}}
+    this.classname= function(){// {{{
+        return "issmsettings";
 
-	}// }}}
-		this.checkconsistency = function(md,solution,analyses) { // {{{
+    }// }}}
+	this.checkconsistency = function(md,solution,analyses) { // {{{
 
-			checkfield(md,'fieldname','settings.results_on_nodes','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','settings.io_gather','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','settings.lowmem','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','settings.output_frequency','numel',[1],'>=',1);
-			checkfield(md,'fieldname','settings.checkpoint_frequency','numel',[1],'>=',0);
-			checkfield(md,'fieldname','settings.waitonlock','numel',[1]);
-			checkfield(md,'fieldname','settings.solver_residue_threshold','numel',[1],'>',0);
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-			WriteData(fid,prefix,'object',this,'class','settings','fieldname','results_on_nodes','format','Boolean');
-			WriteData(fid,prefix,'object',this,'class','settings','fieldname','io_gather','format','Boolean');
-			WriteData(fid,prefix,'object',this,'class','settings','fieldname','lowmem','format','Boolean');
-			WriteData(fid,prefix,'object',this,'class','settings','fieldname','output_frequency','format','Integer');
-			WriteData(fid,prefix,'object',this,'class','settings','fieldname','checkpoint_frequency','format','Integer');
-			WriteData(fid,prefix,'object',this,'class','settings','fieldname','solver_residue_threshold','format','Double');
-			if (this.waitonlock>0) WriteData(fid,prefix,'name','md.settings.waitonlock','data',true,'format','Boolean');
-			else WriteData(fid,prefix,'name','md.settings.waitonlock','data',false,'format','Boolean');
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-	//properties 
-	// {{{
-	this.results_on_nodes    = 0;
-	this.io_gather           = 0;
-	this.lowmem              = 0;
-	this.output_frequency    = 0;
-	this.checkpoint_frequency   = 0;
-	this.waitonlock          = 0;
-	this.upload_server       = '';
-	this.upload_path         = '';
-	this.upload_login        = '';
-	this.upload_port         = 0;
-	this.upload_filename     = '';
-	this.solver_residue_threshold = 0;
-	this.setdefaultparameters();
-	//}}}
+		checkfield(md,'fieldname','settings.results_on_nodes','stringrow',1);
+		checkfield(md,'fieldname','settings.io_gather','numel',[1],'values',[0, 1]);
+		checkfield(md,'fieldname','settings.lowmem','numel',[1],'values',[0, 1]);
+		checkfield(md,'fieldname','settings.output_frequency','numel',[1],'>=',1);
+		checkfield(md,'fieldname','settings.sb_coupling_frequency','numel',[1],'>=',1);
+		checkfield(md,'fieldname','settings.checkpoint_frequency','numel',[1],'>=',0);
+		checkfield(md,'fieldname','settings.waitonlock','numel',[1]);
+		checkfield(md,'fieldname','settings.solver_residue_threshold','numel',[1],'>',0);
+	} // }}}
+	this.marshall=function(md,prefix,fid) { //{{{
+		WriteData(fid,prefix,'object',this,'class','settings','fieldname','results_on_nodes','format','StringArray');
+		WriteData(fid,prefix,'object',this,'class','settings','fieldname','io_gather','format','Boolean');
+		WriteData(fid,prefix,'object',this,'class','settings','fieldname','lowmem','format','Boolean');
+		WriteData(fid,prefix,'object',this,'class','settings','fieldname','output_frequency','format','Integer');
+		WriteData(fid,prefix,'object',this,'class','settings','fieldname','sb_coupling_frequency','format','Integer');
+		WriteData(fid,prefix,'object',this,'class','settings','fieldname','checkpoint_frequency','format','Integer');
+		WriteData(fid,prefix,'object',this,'class','settings','fieldname','waitonlock','data',this.waitonlock>0,'format','Boolean');
+		WriteData(fid,prefix,'object',this,'class','settings','fieldname','solver_residue_threshold','format','Double');
+	}//}}}
+	this.fix=function() { //{{{
+	}//}}}
+	//properties
+    // {{{
+    this.results_on_nodes        = '';
+    this.io_gather               = 0;
+    this.lowmem                  = 0;
+    this.output_frequency        = 0;
+    this.sb_coupling_frequency   = 0;
+    this.checkpoint_frequency    = 0;
+    this.waitonlock              = 0;
+    this.upload_server           = '';
+    this.upload_path             = '';
+    this.upload_login            = '';
+    this.upload_port             = 0;
+    this.upload_filename         = '';
+    this.solver_residue_threshold = 0;
+    this.setdefaultparameters();
+    //}}}
 }
Index: /issm/trunk/src/m/classes/issmsettings.py
===================================================================
--- /issm/trunk/src/m/classes/issmsettings.py	(revision 26743)
+++ /issm/trunk/src/m/classes/issmsettings.py	(revision 26744)
@@ -21,40 +21,38 @@
         self.solver_residue_threshold = 0
 
-    #set defaults
+        # Set defaults
         self.setdefaultparameters()
-
     #}}}
 
     def __repr__(self):  # {{{
-        string = "   general issmsettings parameters:"
-
-        string = "%s\n%s" % (string, fielddisplay(self, "results_on_nodes", "list of output for which results will be output for all the nodes of each element, Use 'all' for all output on nodes."))
-        string = "%s\n%s" % (string, fielddisplay(self, "io_gather", "I / O gathering strategy for result outputs (default 1)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "lowmem", "is the memory limited ? (0 or 1)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "output_frequency", "frequency at which results are saved in all solutions with multiple time_steps"))
-        string = "%s\n%s" % (string, fielddisplay(self, "sb_coupling_frequency", "frequency at which StressBalance solver is coupled (default 1)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "checkpoint_frequency", "frequency at which the runs are being recorded, allowing for a restart"))
-        string = "%s\n%s" % (string, fielddisplay(self, "waitonlock", "maximum number of minutes to wait for batch results, or return 0"))
-        string = "%s\n%s" % (string, fielddisplay(self, "solver_residue_threshold", "throw an error if solver residue exceeds this value (NaN to deactivate)"))
-        return string
+        s = "   general issmsettings parameters:\n"
+        s += '{}\n'.format(fielddisplay(self, "results_on_nodes", "list of output for which results will be output for all the nodes of each element, Use 'all' for all output on nodes."))
+        s += '{}\n'.format(fielddisplay(self, "io_gather", "I / O gathering strategy for result outputs (default 1)"))
+        s += '{}\n'.format(fielddisplay(self, "lowmem", "is the memory limited ? (0 or 1)"))
+        s += '{}\n'.format(fielddisplay(self, "output_frequency", "frequency at which results are saved in all solutions with multiple time_steps"))
+        s += '{}\n'.format(fielddisplay(self, "sb_coupling_frequency", "frequency at which StressBalance solver is coupled (default 1)"))
+        s += '{}\n'.format(fielddisplay(self, "checkpoint_frequency", "frequency at which the runs are being recorded, allowing for a restart"))
+        s += '{}\n'.format(fielddisplay(self, "waitonlock", "maximum number of minutes to wait for batch results, or return 0"))
+        s += '{}\n'.format(fielddisplay(self, "solver_residue_threshold", "throw an error if solver residue exceeds this value (NaN to deactivate)"))
+        return s
     #}}}
 
     def setdefaultparameters(self):  # {{{
-        #are we short in memory ? (0 faster but requires more memory)
+        # Are we short in memory? (0 faster but requires more memory)
         self.lowmem = 0
-        #i / o:
+        # I/O:
         self.io_gather = 1
-        #results frequency by default every step
+        # Results frequency by default every step
         self.output_frequency = 1
-        #coupling frequency of the stress balance solver by default every step
+        # Coupling frequency of the stress balance solver by default every step
         self.sb_coupling_frequency = 1
-        #checkpoints frequency, by default never:
+        # Checkpoints frequency, by default never:
         self.checkpoint_frequency = 0
-        #this option can be activated to load automatically the results
-        #onto the model after a parallel run by waiting for the lock file
-        #N minutes that is generated once the solution has converged
-        #0 to deactivate
-        self.waitonlock = 2**31 - 1
-        #throw an error if solver residue exceeds this value
+        # This option can be activated to load automatically the results onto 
+        # the model after a parallel run by waiting for the lock file N minutes 
+        # that is generated once the solution has converged
+        # Set to 0 to deactivate
+        self.waitonlock = pow(2, 31) - 1
+        # Throw an error if solver residue exceeds this value
         self.solver_residue_threshold = 1e-6
 
Index: /issm/trunk/src/m/classes/levelset.js
===================================================================
--- /issm/trunk/src/m/classes/levelset.js	(revision 26743)
+++ /issm/trunk/src/m/classes/levelset.js	(revision 26744)
@@ -8,7 +8,12 @@
 	this.setdefaultparameters = function(){// {{{
 
-		//stabilization = 2 by default
-		this.stabilization		= 2;
+		//stabilization = 1 by default
+		this.stabilization		= 1;
 		this.reinit_frequency	= 5;
+		this.kill_icebergs      = 1;
+		this.migration_max      = 1e12; //No need for general cases, unless specified
+
+		//Linear elements by default
+		this.fe='P1';
 	
 	}// }}}
@@ -19,10 +24,13 @@
 		fielddisplay(this,'spclevelset','Levelset constraints (NaN means no constraint)');
 		fielddisplay(this,'reinit_frequency','Amount of time steps after which the levelset function in re-initialized (NaN: no re-initialization).');
+		fielddisplay(this,'kill_icebergs','remove floating icebergs to prevent rigid body motions (1: true, 0: false)');
+		fielddisplay(this,'migration_max','maximum allowed migration rate (m/a)');
+		fielddisplay(this,'fe','Finite Element type: "P1" (default), or "P2"');
 
 	}// }}}
-	this.extrude = function(md) {//{{{
-		this.spclevelset=project3d(md,'vector',this.spclevelset,'type','node');
-		return this;
-	}//}}}
+    this.extrude = function(md) {//{{{
+        this.spclevelset=project3d(md,'vector',this.spclevelset,'type','node');
+        return this;
+    }//}}}
 	this.classname= function(){// {{{
 		return "levelset";
@@ -33,21 +41,32 @@
 
 		checkfield(md,'fieldname','levelset.spclevelset','Inf',1,'timeseries',1);
-		checkfield(md,'fieldname','levelset.stabilization','values',[0,1,2]);
+		checkfield(md,'fieldname','levelset.stabilization','values',[0,1,2,5]);
+		checkfield(md,'fieldname','levelset.kill_icebergs','numel',1,'values',[0, 1]);
+		checkfield(md,'fieldname','levelset.migration_max','numel',1,'NaN',1,'Inf',1,'>',0);
+		checkfield(md,'fieldname','levelset.fe','values',['P1','P2']);
 	} //}}}
 	this.marshall=function(md,prefix,fid) { //{{{
+
+		let yts=md.constants.yts;
+
 		WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer');
 		WriteData(fid,prefix,'object',this,'fieldname','spclevelset','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 		WriteData(fid,prefix,'object',this,'fieldname','reinit_frequency','format','Integer');
-
+		WriteData(fid,prefix,'object',this,'fieldname','kill_icebergs','format','Boolean');
+		WriteData(fid,prefix,'object',this,'fieldname','migration_max','format','Double','scale',1/yts);
+		WriteData(fid,prefix,'object',this,'fieldname','fe','format','String');
 	}//}}}
-	this.fix=function() { //{{{
-		this.spclevelset=NullFix(this.spclevelset,NaN);
-	}//}}}
+		this.fix=function() { //{{{
+			this.spclevelset=NullFix(this.spclevelset,NaN);
+		}//}}}
 	//properties 
 	// {{{
 
 	this.stabilization		= 0;
-	this.spclevelset			= NaN;
+	this.spclevelset		= NaN;
 	this.reinit_frequency	= NaN;
+	this.kill_icebergs     	= 0;
+	this.migration_max      = 0.;
+	this.fe              	= 'P1';
 
 	this.setdefaultparameters();
Index: /issm/trunk/src/m/classes/levelset.m
===================================================================
--- /issm/trunk/src/m/classes/levelset.m	(revision 26743)
+++ /issm/trunk/src/m/classes/levelset.m	(revision 26744)
@@ -9,7 +9,7 @@
 		spclevelset			= NaN;
 		reinit_frequency	= 5;
-		kill_icebergs     = 0;
-		migration_max       = 0.;
-		fe                = 'P1';
+		kill_icebergs		= 0;
+		migration_max		= 0.;
+		fe					= 'P1';
 	end
 	methods
@@ -32,4 +32,13 @@
 			end
 		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   Level-set parameters:'));
+			fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: streamline upwinding');
+			fielddisplay(self,'spclevelset','Levelset constraints (NaN means no constraint)');
+			fielddisplay(self,'reinit_frequency','Amount of time steps after which the levelset function in re-initialized');
+			fielddisplay(self,'kill_icebergs','remove floating icebergs to prevent rigid body motions (1: true, 0: false)');
+			fielddisplay(self,'migration_max','maximum allowed migration rate (m/a)');
+			fielddisplay(self,'fe','Finite Element type: ''P1'' (default), or ''P2''');
+		end % }}}
 		function self = extrude(self,md) % {{{
 
@@ -42,5 +51,5 @@
 			self.reinit_frequency = 5;
 			self.kill_icebergs    = 1;
-			self.migration_max      = 3000.;
+			self.migration_max    = 1e12; % No need for general cases, unless specified
 
 			%Linear elements by default
@@ -53,17 +62,8 @@
 
 			md = checkfield(md,'fieldname','levelset.spclevelset','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','levelset.stabilization','values',[0 1 2]);
+			md = checkfield(md,'fieldname','levelset.stabilization','values',[0 1 2 5]);
 			md = checkfield(md,'fieldname','levelset.kill_icebergs','numel',1,'values',[0 1]);
 			md = checkfield(md,'fieldname','levelset.migration_max','numel',1,'NaN',1,'Inf',1,'>',0);
 			md = checkfield(md,'fieldname','levelset.fe','values',{'P1','P2'});
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   Level-set parameters:'));
-			fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: streamline upwinding');
-			fielddisplay(self,'spclevelset','Levelset constraints (NaN means no constraint)');
-			fielddisplay(self,'reinit_frequency','Amount of time steps after which the levelset function in re-initialized');
-			fielddisplay(self,'kill_icebergs','remove floating icebergs to prevent rigid body motions (1: true, 0: false)');
-			fielddisplay(self,'migration_max','maximum allowed migration rate (m/a)');
-			fielddisplay(self,'fe','Finite Element type: ''P1'' (default), or ''P2''');
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -72,5 +72,5 @@
 
 			WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','spclevelset','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'fieldname','spclevelset','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
 			WriteData(fid,prefix,'object',self,'fieldname','reinit_frequency','format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','kill_icebergs','format','Boolean');
Index: /issm/trunk/src/m/classes/levelset.py
===================================================================
--- /issm/trunk/src/m/classes/levelset.py	(revision 26743)
+++ /issm/trunk/src/m/classes/levelset.py	(revision 26744)
@@ -1,54 +1,48 @@
+import numpy as np
+
+from checkfield import checkfield
 from fielddisplay import fielddisplay
 from project3d import project3d
-from checkfield import checkfield
 from WriteData import WriteData
 
 
 class levelset(object):
-    """
-    LEVELSET class definition
+    """LEVELSET class definition
 
-       Usage:
-          levelset = levelset()
+    Usage:
+        levelset = levelset()
     """
 
     def __init__(self):  # {{{
-
         self.stabilization = 0
-        self.spclevelset = float('NaN')
-        self.reinit_frequency = 0
+        self.spclevelset = np.nan
+        self.reinit_frequency = 5
         self.kill_icebergs = 0
-        self.migration_max = 0.
+        self.migration_max = 0
         self.fe = 'P1'
 
-    #set defaults
+        # Set defaults
         self.setdefaultparameters()
-
     #}}}
     def __repr__(self):  # {{{
-        string = '   Level - set parameters:'
-        string = "%s\n%s" % (string, fielddisplay(self, 'stabilization', '0: no, 1: artificial_diffusivity, 2: streamline upwinding'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'spclevelset', 'levelset constraints (NaN means no constraint)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'reinit_frequency', 'Amount of time steps after which the levelset function in re-initialized'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'kill_icebergs', 'remove floating icebergs to prevent rigid body motions (1: true, 0: false)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'migration_max', 'maximum allowed migration rate (m / a)'))
-        string = "%s\n%s" % (string, fielddisplay(self, 'fe', 'Finite Element type: ''P1'' (default), or ''P2'''))
+        s = '   Level-set parameters:\n'
+        s += '{}\n'.format(fielddisplay(self, 'stabilization', '0: no, 1: artificial_diffusivity, 2: streamline upwinding'))
+        s += '{}\n'.format(fielddisplay(self, 'spclevelset', 'Levelset constraints (NaN means no constraint)'))
+        s += '{}\n'.format(fielddisplay(self, 'reinit_frequency', 'Amount of time steps after which the levelset function in re-initialized'))
+        s += '{}\n'.format(fielddisplay(self, 'kill_icebergs', 'remove floating icebergs to prevent rigid body motions (1: true, 0: false)'))
+        s += '{}\n'.format(fielddisplay(self, 'migration_max', 'maximum allowed migration rate (m/a)'))
+        s += '{}\n'.format(fielddisplay(self, 'fe', 'Finite Element type: \'P1\' (default), or \'P2\''))
 
-        return string
-    #}}}
-
-    def extrude(self, md):  # {{{
-        self.spclevelset = project3d(md, 'vector', self.spclevelset, 'type', 'node')
-        return self
+        return s
     #}}}
 
     def setdefaultparameters(self):  # {{{
-        #stabilization = 1 by default
+        # Stabilization = 1 by default
         self.stabilization = 1
         self.reinit_frequency = 5
         self.kill_icebergs = 1
-        self.migration_max = 3000.
+        self.migration_max = 1e12 # No need for general cases, unless specified
 
-    #Linear elements by default
+        # Linear elements by default
         self.fe = 'P1'
 
@@ -57,10 +51,10 @@
 
     def checkconsistency(self, md, solution, analyses):  # {{{
-        #Early return
+        # Early return
         if (solution != 'TransientSolution') or (not md.transient.ismovingfront):
             return md
 
         md = checkfield(md, 'fieldname', 'levelset.spclevelset', 'Inf', 1, 'timeseries', 1)
-        md = checkfield(md, 'fieldname', 'levelset.stabilization', 'numel', [1], 'values', [0, 1, 2])
+        md = checkfield(md, 'fieldname', 'levelset.stabilization', 'numel', [1], 'values', [0, 1, 2, 5])
         md = checkfield(md, 'fieldname', 'levelset.kill_icebergs', 'numel', [1], 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'levelset.migration_max', 'numel', [1], 'NaN', 1, 'Inf', 1, '>', 0)
@@ -69,4 +63,9 @@
         return md
     # }}}
+
+    def extrude(self, md):  # {{{
+        self.spclevelset = project3d(md, 'vector', self.spclevelset, 'type', 'node')
+        return self
+    #}}}
 
     def marshall(self, prefix, md, fid):  # {{{
@@ -77,5 +76,5 @@
         WriteData(fid, prefix, 'object', self, 'fieldname', 'reinit_frequency', 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'kill_icebergs', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'migration_max', 'format', 'Double', 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'migration_max', 'format', 'Double', 'scale', 1 / yts)
         WriteData(fid, prefix, 'object', self, 'fieldname', 'fe', 'format', 'String')
     # }}}
Index: /issm/trunk/src/m/classes/lovenumbers.m
===================================================================
--- /issm/trunk/src/m/classes/lovenumbers.m	(revision 26743)
+++ /issm/trunk/src/m/classes/lovenumbers.m	(revision 26744)
@@ -9,5 +9,5 @@
 classdef lovenumbers
 	properties (SetAccess=public) 
-		
+
 		%regular love numbers:
 		h           = []; %provided by PREM model
@@ -16,8 +16,12 @@
 		
 		%tidal love numbers for computing rotational feedback:
-		th          = []; 
-		tk          = []; 
-		tl          = []; 
-		tk2secular  = 0;  %deg 2 secular number.
+		th          = [];
+		tk          = [];
+		tl          = [];
+		tk2secular  = 0; %deg 2 secular number.
+
+		%time/frequency for visco-elastic love numbers
+		timefreq    = [];
+		istime      = 1;
 
 	end
@@ -29,6 +33,22 @@
 			self=setdefaultparameters(self,maxdeg,referenceframe);
 		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   lovenumbers parameters:'));
+
+			fielddisplay(self,'h','load Love number for radial displacement');
+			fielddisplay(self,'k','load Love number for gravitational potential perturbation');
+			fielddisplay(self,'l','load Love number for horizontal displacements');
+
+			fielddisplay(self,'th','tidal load Love number (deg 2)');
+			fielddisplay(self,'tk','tidal load Love number (deg 2)');
+			fielddisplay(self,'tl','tidal load Love number (deg 2)');
+			fielddisplay(self,'tk2secular','secular fluid Love number');
+
+			fielddisplay(self,'istime','time (default: 1) or frequency love numbers (0)');
+			fielddisplay(self,'timefreq','time/frequency vector (yr or 1/yr)');
+
+		end % }}}
 		function self = setdefaultparameters(self,maxdeg,referenceframe) % {{{
-		
+
 			%initialize love numbers:
 			self.h=getlovenumbers('type','loadingverticaldisplacement','referenceframe',referenceframe,'maxdeg',maxdeg);
@@ -42,9 +62,12 @@
 			self.tk2secular=0.942; 
 
+			%time: 
+			self.istime=1; %temporal love numbers by default
+			self.timefreq=0; %elastic case by default.
 
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
 
-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslr==0), 
+			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
 				return; 
 			end
@@ -57,5 +80,8 @@
 			md = checkfield(md,'fieldname','solidearth.lovenumbers.th','NaN',1,'Inf',1);
 			md = checkfield(md,'fieldname','solidearth.lovenumbers.tk','NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','solidearth.lovenumbers.tl','NaN',1,'Inf',1);
 			md = checkfield(md,'fieldname','solidearth.lovenumbers.tk2secular','NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','solidearth.lovenumbers.timefreq','NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','solidearth.lovenumbers.istime','NaN',1,'Inf',1,'values',[0 1]);
 
 			%check that love numbers are provided at the same level of accuracy: 
@@ -64,20 +90,12 @@
 			end
 
+			ntf=length(self.timefreq);
+			if( size(self.h,2) ~= ntf | size(self.k,2) ~= ntf | size(self.l,2) ~= ntf | size(self.th,2) ~= ntf | size(self.tk,2) ~= ntf | size(self.tl,2) ~= ntf ),
+				error('lovenumbers error message: love numbers should have as many time/frequency steps as the time/frequency vector');
+			end
 
 		end % }}}
 		function list=defaultoutputs(self,md) % {{{
 			list = {};
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   lovenumbers parameters:'));
-
-			fielddisplay(self,'h','load Love number for radial displacement');
-			fielddisplay(self,'k','load Love number for gravitational potential perturbation');
-			fielddisplay(self,'l','load Love number for horizontal displacements');
-
-			fielddisplay(self,'th','tidal load Love number (deg 2)');
-			fielddisplay(self,'tk','tidal load Love number (deg 2)');
-			fielddisplay(self,'tk2secular','secular fluid Love number');
-
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -92,4 +110,12 @@
 			WriteData(fid,prefix,'object',self,'data',self.tk2secular,'fieldname','lovenumbers.tk2secular','format','Double');
 
+			if self.istime,
+				scale=md.constants.yts; 
+			else
+				scale=1.0/md.constants.yts;
+			end
+			WriteData(fid,prefix,'object',self,'fieldname','istime','name','md.solidearth.lovenumbers.istime','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','timefreq','name','md.solidearth.lovenumbers.timefreq','format','DoubleMat','mattype',1,'scale',scale);
+
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
@@ -97,4 +123,6 @@
 			writejs1Darray(fid,[modelname '.lovenumbers.k'],self.k);
 			writejs1Darray(fid,[modelname '.lovenumbers.l'],self.l);
+			writejs1Darray(fid,[modelname '.lovenumbers.istime'],self.istime);
+			writejs1Darray(fid,[modelname '.lovenumbers.time'],self.time);
 		end % }}}
 		function self = extrude(self,md) % {{{
Index: /issm/trunk/src/m/classes/lovenumbers.py
===================================================================
--- /issm/trunk/src/m/classes/lovenumbers.py	(revision 26743)
+++ /issm/trunk/src/m/classes/lovenumbers.py	(revision 26744)
@@ -1,4 +1,3 @@
 import numpy as np
-
 from checkfield import checkfield
 from fielddisplay import fielddisplay
@@ -8,17 +7,20 @@
 
 
-class lovenumbers(object): #{{{
+class lovenumbers(object):  #{{{
     """LOVENUMBERS class definition
 
     Usage:
-        lovenumbers = lovenumbers() #will setup love numbers deg 1001 by default
-        lovenumbers = lovenumbers('maxdeg', 10001);  #supply numbers of degrees required (here, 10001)
+        lovenumbers = lovenumbers()
+        lovenumbers = lovenumbers('maxdeg', 10000, 'referenceframe', 'CF');
+
+    Choose numbers of degrees required (1000 by default) and reference frame 
+    (between CF and CM; CM by default)
     """
 
-    def __init__(self, *args): #{{{
+    def __init__(self, *args):  #{{{
         # Regular love numbers
-        self.h = []  # Provided by PREM model
-        self.k = []  # idem
-        self.l = []  # idem
+        self.h = []   # Provided by PREM model
+        self.k = []   # idem
+        self.l = []   # idem
 
         # Tidal love numbers for computing rotational feedback
@@ -26,5 +28,9 @@
         self.tk = []
         self.tl = []
-        self.tk2secular = 0 # deg 2 secular number
+        self.tk2secular = 0  # deg 2 secular number
+
+        # Time/frequency for visco-elastic love numbers
+        self.timefreq = []
+        self.istime = 1
 
         options = pairoptions(*args)
@@ -34,20 +40,38 @@
     #}}}
 
-    def setdefaultparameters(self, maxdeg, referenceframe): #{{{
+    def __repr__(self):  #{{{
+        s = '   lovenumbers parameters:\n'
+        s += '{}\n'.format(fielddisplay(self, 'h', 'load Love number for radial displacement'))
+        s += '{}\n'.format(fielddisplay(self, 'k', 'load Love number for gravitational potential perturbation'))
+        s += '{}\n'.format(fielddisplay(self, 'l', 'load Love number for horizontal displacements'))
+        s += '{}\n'.format(fielddisplay(self, 'th', 'tidal load Love number (deg 2)'))
+        s += '{}\n'.format(fielddisplay(self, 'tk', 'tidal load Love number (deg 2)'))
+        s += '{}\n'.format(fielddisplay(self, 'tl', 'tidal load Love number (deg 2)'))
+        s += '{}\n'.format(fielddisplay(self, 'tk2secular', 'secular fluid Love number'))
+        s += '{}\n'.format(fielddisplay(self, 'istime', 'time (default: 1) or frequency love numbers (0)'))
+        s += '{}\n'.format(fielddisplay(self, 'timefreq', 'time/frequency vector (yr or 1/yr)'))
+        return s
+    #}}}
+
+    def setdefaultparameters(self, maxdeg, referenceframe):  #{{{
         # Initialize love numbers
-        self.h = getlovenumbers('type', 'loadingverticaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
-        self.k = getlovenumbers('type', 'loadinggravitationalpotential', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
-        self.l = getlovenumbers('type', 'loadinghorizontaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
-        self.th = getlovenumbers('type', 'tidalverticaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
-        self.tk = getlovenumbers('type', 'tidalgravitationalpotential', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
-        self.tl = getlovenumbers('type', 'tidalhorizontaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
+        self.h = getlovenumbers('type', 'loadingverticaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
+        self.k = getlovenumbers('type', 'loadinggravitationalpotential', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
+        self.l = getlovenumbers('type', 'loadinghorizontaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
+        self.th = getlovenumbers('type', 'tidalverticaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
+        self.tk = getlovenumbers('type', 'tidalgravitationalpotential', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
+        self.tl = getlovenumbers('type', 'tidalhorizontaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
 
         # Secular fluid love number
         self.tk2secular = 0.942
+
+        # Time
+        self.istime = 1 # Temporal love numbers by default
+        self.timefreq = np.zeros(1) # Elastic case by default
         return self
     #}}}
 
-    def checkconsistency(self, md, solution, analyses): #{{{
-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr):
+    def checkconsistency(self, md, solution, analyses):  #{{{
+        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
             return
         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.h', 'NaN', 1, 'Inf', 1)
@@ -57,27 +81,25 @@
         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.th', 'NaN', 1, 'Inf', 1)
         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.tk', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.tl', 'NaN', 1, 'Inf', 1)
         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.tk2secular', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.timefreq', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.istime', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
+
         # Check that love numbers are provided at the same level of accuracy
         if (self.h.shape[0] != self.k.shape[0]) or (self.h.shape[0] != self.l.shape[0]):
             raise ValueError('lovenumbers error message: love numbers should be provided at the same level of accuracy')
+
+        ntf = len(self.timefreq)
+        if (np.shape(self.h)[1] != ntf or np.shape(self.k)[1] != ntf or np.shape(self.l)[1] != ntf or np.shape(self.th)[1] != ntf or np.shape(self.tk)[1] != ntf or np.shape(self.tl)[1] != ntf):
+            raise ValueError('lovenumbers error message: love numbers should have as many time/frequency steps as the time/frequency vector')
+
         return md
     #}}}
 
-    def defaultoutputs(self, md): #{{{
+    def defaultoutputs(self, md):  #{{{
         return[]
     #}}}
 
-    def __repr__(self): #{{{
-        s = '   lovenumbers parameters:\n'
-        s += '{}\n'.format(fielddisplay(self, 'h', 'load Love number for radial displacement'))
-        s += '{}\n'.format(fielddisplay(self, 'k', 'load Love number for gravitational potential perturbation'))
-        s += '{}\n'.format(fielddisplay(self, 'l', 'load Love number for horizontal displacements'))
-        s += '{}\n'.format(fielddisplay(self, 'th', 'tidal load Love number (deg 2)'))
-        s += '{}\n'.format(fielddisplay(self, 'tk', 'tidal load Love number (deg 2)'))
-        s += '{}\n'.format(fielddisplay(self, 'tk2secular', 'secular fluid Love number'))
-        return s
-    #}}}
-
-    def marshall(self, prefix, md, fid): #{{{
+    def marshall(self, prefix, md, fid):  #{{{
         WriteData(fid, prefix, 'object', self, 'fieldname', 'h', 'name', 'md.solidearth.lovenumbers.h', 'format', 'DoubleMat', 'mattype', 1)
         WriteData(fid, prefix, 'object', self, 'fieldname', 'k', 'name', 'md.solidearth.lovenumbers.k', 'format', 'DoubleMat', 'mattype', 1)
@@ -88,7 +110,14 @@
         WriteData(fid, prefix, 'object', self, 'fieldname', 'tl', 'name', 'md.solidearth.lovenumbers.tl', 'format', 'DoubleMat', 'mattype', 1)
         WriteData(fid, prefix, 'object', self, 'data', self.tk2secular, 'fieldname', 'lovenumbers.tk2secular', 'format', 'Double')
+
+        if (self.istime):
+            scale = md.constants.yts
+        else:
+            scale = 1.0 / md.constants.yts
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'istime', 'name', 'md.solidearth.lovenumbers.istime', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'timefreq', 'name', 'md.solidearth.lovenumbers.timefreq', 'format', 'DoubleMat', 'mattype', 1, 'scale', scale);
     #}}}
 
-    def extrude(self, md): #{{{
+    def extrude(self, md):  #{{{
         return
 #}}}
Index: /issm/trunk/src/m/classes/mask.js
===================================================================
--- /issm/trunk/src/m/classes/mask.js	(revision 26743)
+++ /issm/trunk/src/m/classes/mask.js	(revision 26744)
@@ -7,6 +7,6 @@
 	//properties 
 	// {{{
-		this.ocean_levelset                           = NaN;
-		this.ice_levelset                           = NaN;
+		this.ocean_levelset	= NaN;
+		this.ice_levelset	= NaN;
 		//}}}
 	//methods 
@@ -14,8 +14,8 @@
 		} // }}}
 		this.disp = function () { //{{{
-			console.log(sprintf("   mask:")); 
+			console.log(sprintf("   masks:")); 
 
-			fielddisplay(this,"ocean_levelset","presence of ocean if < 0, coastline/grounding line if = 0, no ocean if > 0");
-			fielddisplay(this,"ice_levelset","presence of ice if < 0, icefront position if = 0, no ice if > 0");
+			fielddisplay(this,'ocean_levelset','presence of ocean if < 0, coastline/grounding line if = 0, no ocean if > 0');
+			fielddisplay(this,'ice_levelset','presence of ice if < 0, icefront position if = 0, no ice if > 0');
 		} //}}}
 		this.extrude = function(md) {//{{{
@@ -28,4 +28,5 @@
 		} //}}}
 		this.checkconsistency = function(md,solution,analyses){ //{{{
+			if (solution=='LoveSolution') return;
 
 			checkfield(md,'fieldname','mask.ocean_levelset','size',[md.mesh.numberofvertices, 1]);
@@ -46,4 +47,3 @@
 		this.fix=function() { //{{{
 		}//}}}
-
 }
Index: /issm/trunk/src/m/classes/masstransport.js
===================================================================
--- /issm/trunk/src/m/classes/masstransport.js	(revision 26743)
+++ /issm/trunk/src/m/classes/masstransport.js	(revision 26744)
@@ -1,104 +1,102 @@
-//MASSTRANSPORT class definition
-//
-//   Usage:
-//      masstransport=new masstransport();
+class masstransport {//{{{
+	/**
+	 * MASSTRANSPORT class definition
+	 *
+	 * Usage:
+	 *     masstransport = masstransport();
+	 */
+	constructor() {//{{{
+		this.spcthickness = NaN;
+		this.isfreesurface = 0;
+		this.min_thickness = 0;
+		this.hydrostatic_adjustment = 0;
+		this.stabilization = 0;
+		this.vertex_pairing = 0;
+		this.penalty_factor = 0;
+		this.requested_outputs = 0;
 
-function masstransport (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
+		if (arguments.length == 0) {
+			this.setdefaultparameters();
+		} else {
+			error('constructor not supported');
+		}
+	} //}}}
 
-		//Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
-		this.stabilization=1;
+	disp() {//{{{
+		console.log('WARNING: masstransport::disp is not yet implemented');
+	} //}}}
 
-		//Factor applied to compute the penalties kappa=max(stiffness matrix)*10^penalty_factor
-		this.penalty_factor=3;
+	setdefaultparameters() {//{{{
+		// Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
+		this.stabilization = 1;
 
-		//Minimum ice thickness that can be used
-		this.min_thickness=1;
+		// Factor applied to compute the penalties kappa=max(stiffness matrix)*10^penalty_factor
+		this.penalty_factor = 3;
 
-		//Hydrostatic adjustment
-		this.hydrostatic_adjustment='Absolute';
+		// Minimum ice thickness that can be used
+		this.min_thickness = 1;
 
-		//default output
-		this.requested_outputs=['default'];
+		// Hydrostatic adjustment
+		this.hydrostatic_adjustment = 'Absolute';
 
-	}// }}}
-	this.disp= function(){// {{{
-		console.log(sprintf('   Masstransport solution parameters:'));
-		fielddisplay(this,'spcthickness','thickness constraints (NaN means no constraint) [m]');
-		fielddisplay(this,'isfreesurface','do we use free surfaces (FS only) or mass conservation');
-		fielddisplay(this,'min_thickness','minimum ice thickness allowed [m]');
-		fielddisplay(this,'hydrostatic_adjustment',"adjustment of ice shelves surface and bed elevations: 'Incremental' or 'Absolute' ");
-		fielddisplay(this,'stabilization','0: no, 1: artificial_diffusivity, 2: streamline upwinding, 3: discontinuous Galerkin, 4: Flux Correction Transport');
+		// Default output
+		this.requested_outputs = ['default'];
+	} //}}}
 
-		console.log(sprintf('\n      %s','Penalty options:'));
-		fielddisplay(this,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset');
-		fielddisplay(this,'vertex_pairing','pairs of vertices that are penalized');
-		fielddisplay(this,'requested_outputs','additional outputs requested');
+	checkconsistency(md, solution, analyses) {//{{{
+		// Early return
+		if (analyses.includes('HydrologyShreveAnalysis') || (solution == 'TransientSolution' && !md.trans.ismasstransport)) {
+			return md;
+		}
 
-	}// }}}
-	this.classname= function(){// {{{
-		return "masstransport";
-	}// }}}
-    this.extrude = function(md) {//{{{
-        this.spcthickness=project3d(md,'vector',this.spcthickness,'type','node');
-        return this;
-    }//}}}
-		this.checkconsistency = function (md,solution,analyses){  // {{{
+		md = checkfield(md, 'fieldname', 'masstransport.spcthickness', 'Inf', 1, 'timeseries', 1);
+		md = checkfield(md, 'fieldname', 'masstransport.isfreesurface', 'values', [0, 1]);
+		md = checkfield(md, 'fieldname', 'masstransport.hydrostatic_adjustment', 'values', ['Absolute', 'Incremental']);
+		md = checkfield(md, 'fieldname', 'masstransport.stabilization', 'values', [0, 1, 2, 3, 4, 5]);
+		md = checkfield(md, 'fieldname', 'masstransport.min_thickness', '>', 0);
+		md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1);
+		if (!any(isnan(md.stressbalance.vertex.vertex_pairing))) {
+			md = checkfield(md, 'fieldname', 'stressbalance.vertex_pairing', '>', 0);
+		}
 
-			//Early return
-			if(!ArrayAnyEqual(ArrayIsMember('HydrologyShreveAnalysis',analyses),1) | (solution=='TransientSolution' & md.trans.ismasstransport==0)) return; 
+		return md;
+	} //}}}
 
-			checkfield(md,'fieldname','masstransport.spcthickness','Inf',1,'timeseries',1);
-			checkfield(md,'fieldname','masstransport.isfreesurface','values',[0 ,1]);
-			checkfield(md,'fieldname','masstransport.hydrostatic_adjustment','values',['Absolute', 'Incremental']);
-			checkfield(md,'fieldname','masstransport.stabilization','values',[0,1,2,3,4]);
-			checkfield(md,'fieldname','masstransport.min_thickness','>',0);
-			checkfield(md,'fieldname','masstransport.requested_outputs','stringrow',1);
+	defaultoutputs(md) {//{{{
+		return ['Thickness', 'Surface', 'Base'];
+	} //}}}
 
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
+	marshall(md, prefix, fid) {//{{{
+		let yts = md.constants.yts;
 
-			var yts=md.constants.yts;
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'spcthickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'isfreesurface', 'format', 'Boolean');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'min_thickness', 'format', 'Double');
+		WriteData(fid, prefix, 'data', this.hydrostatic_adjustment, 'format', 'String', 'name', 'md.masstransport.hydrostatic_adjustment');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'stabilization', 'format', 'Integer');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'vertex_pairing', 'format', 'DoubleMat', 'mattype', 3);
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'penalty_factor', 'format', 'Double');
 
-			WriteData(fid,prefix,'object',this,'fieldname','spcthickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',this,'fieldname','isfreesurface','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','min_thickness','format','Double');
-			WriteData(fid,prefix,'data',this.hydrostatic_adjustment,'format','String','name','md.masstransport.hydrostatic_adjustment');
-			WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer');
-			WriteData(fid,prefix,'object',this,'fieldname','vertex_pairing','format','DoubleMat','mattype',3);
-			WriteData(fid,prefix,'object',this,'fieldname','penalty_factor','format','Double');
+		// Process requested outputs
+		let outputs = this.requested_outputs;
+		let pos = find(ismember(outputs, 'default'));
+		if (pos.length) {
+			/*
+			NOTE: In order to handle case where user has added 'default' more 
+			than once to this.requested_outputs, need to remove elements by 
+			index in reverse order.
+			*/
+			for (let i = (pos.length - 1); i >= 0; --i) {
+				outputs.splice(pos[i], 1);
+			}
+			let default_outputs = this.defaultoutputs(md);
+			for (let i = 0; i < default_outputs.length; ++i) {
+				outputs.push(default_outputs[i]);
+			}
+		}
+		WriteData(fid, prefix, 'data', outputs, 'name', 'md.masstransport.requested_outputs', 'format', 'StringArray');
+	} //}}}
 
-			//process requested outputs
-			var outputs = this.requested_outputs;
-			for (var i=0;i<outputs.length;i++){
-				if (outputs[i] == 'default') {
-					outputs.splice(i,1);
-					var newoutputs=this.defaultoutputs(md);
-					for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
-				}
-			}
-			WriteData(fid,prefix,'data',outputs,'name','md.masstransport.requested_outputs','format','StringArray');
-		}//}}}
-		this.defaultoutputs = function(md) { //{{{
-			return ['Thickness','Surface','Base'];
-		}//}}}
-		this.fix=function() { //{{{
-			this.spcthickness=NullFix(this.spcthickness,NaN);
-			this.vertex_pairing=NullFix(this.vertex_pairing,NaN);
-		}//}}}
-	//properties 
-	// {{{
-
-	this.spcthickness           = NaN;
-	this.isfreesurface          = 0;
-	this.min_thickness          = 0;
-	this.hydrostatic_adjustment = 0;
-	this.stabilization          = 0;
-	this.vertex_pairing         = NaN;
-	this.penalty_factor         = 0;
-	this.requested_outputs      = [];
-
-	this.setdefaultparameters();
-	//}}}
+	extrude(md) {//{{{
+	} //}}}
 }
Index: /issm/trunk/src/m/classes/masstransport.m
===================================================================
--- /issm/trunk/src/m/classes/masstransport.m	(revision 26743)
+++ /issm/trunk/src/m/classes/masstransport.m	(revision 26744)
@@ -105,5 +105,5 @@
 			fielddisplay(self,'min_thickness','minimum ice thickness allowed [m]');
 			fielddisplay(self,'hydrostatic_adjustment','adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute'' ');
-			fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: streamline upwinding, 3: discontinuous Galerkin, 4: Flux Correction Transport, 5: streamline upwind Petrov-Galerkin (SUPG)');
+			fielddisplay(self,'stabilization','0: no stabilization, 1: artificial diffusion, 2: streamline upwinding, 3: discontinuous Galerkin, 4: flux corrected transport, 5: streamline upwind Petrov-Galerkin (SUPG)');
 
 			disp(sprintf('\n      %s','Penalty options:'));
Index: /issm/trunk/src/m/classes/masstransport.py
===================================================================
--- /issm/trunk/src/m/classes/masstransport.py	(revision 26743)
+++ /issm/trunk/src/m/classes/masstransport.py	(revision 26744)
@@ -35,5 +35,5 @@
         s += '{}\n'.format(fielddisplay(self, 'min_thickness', 'minimum ice thickness allowed [m]'))
         s += '{}\n'.format(fielddisplay(self, 'hydrostatic_adjustment', 'adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute'' '))
-        s += '{}\n'.format(fielddisplay(self, 'stabilization', '0: no, 1: artificial_diffusivity, 2: streamline upwinding, 3: discontinuous Galerkin, 4: Flux Correction Transport'))
+        s += '{}\n'.format(fielddisplay(self, 'stabilization', '0: no stabilization, 1: artificial diffusion, 2: streamline upwinding, 3: discontinuous Galerkin, 4: flux corrected transport, 5: streamline upwind Petrov-Galerkin (SUPG)'))
         s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
         return s
@@ -71,5 +71,5 @@
         md = checkfield(md, 'fieldname', 'masstransport.isfreesurface', 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'masstransport.hydrostatic_adjustment', 'values', ['Absolute', 'Incremental'])
-        md = checkfield(md, 'fieldname', 'masstransport.stabilization', 'values', [0, 1, 2, 3, 4])
+        md = checkfield(md, 'fieldname', 'masstransport.stabilization', 'values', [0, 1, 2, 3, 4, 5])
         md = checkfield(md, 'fieldname', 'masstransport.min_thickness', '>', 0)
         md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
Index: /issm/trunk/src/m/classes/matdamageice.m
===================================================================
--- /issm/trunk/src/m/classes/matdamageice.m	(revision 26743)
+++ /issm/trunk/src/m/classes/matdamageice.m	(revision 26744)
@@ -6,29 +6,23 @@
 classdef matdamageice
 	properties (SetAccess=public) 
-		rho_ice                    = 0.;
-		rho_water                  = 0.;
-		rho_freshwater             = 0.;
-		mu_water                   = 0.;
-		heatcapacity               = 0.;
-		latentheat                 = 0.;
-		thermalconductivity        = 0.;
-		temperateiceconductivity   = 0.;
+		rho_ice                         = 0.;
+		rho_water                       = 0.;
+		rho_freshwater                  = 0.;
+		mu_water                        = 0.;
+		heatcapacity                    = 0.;
+		latentheat                      = 0.;
+		thermalconductivity             = 0.;
+		temperateiceconductivity        = 0.;
 		effectiveconductivity_averaging = 0.;
-		meltingpoint               = 0.;
-		beta                       = 0.;
-		mixed_layer_capacity       = 0.;
-		thermal_exchange_velocity  = 0.;
-		rheology_B   = NaN;
-		rheology_n   = NaN;
-		rheology_law = '';
+		meltingpoint                    = 0.;
+		beta                            = 0.;
+		mixed_layer_capacity            = 0.;
+		thermal_exchange_velocity       = 0.;
+		rheology_B                      = NaN;
+		rheology_n                      = NaN;
+		rheology_law                    = '';
 
-		%giaivins: 
-		lithosphere_shear_modulus  = 0.;
-		lithosphere_density        = 0.;
-		mantle_shear_modulus       = 0.;
-		mantle_density             = 0.;
-
-		%slr
-		earth_density              = 0;
+		%slc
+		earth_density                   = 0;
 
 	end
@@ -78,5 +72,5 @@
 			%ice thermal conductivity (W/m/K)
 			self.thermalconductivity=2.4;
-			
+
 			%wet ice thermal conductivity (W/m/K)
 			self.temperateiceconductivity=.24;
@@ -84,5 +78,5 @@
 			%computation of effective conductivity
 			self.effectiveconductivity_averaging=1;
-            
+
 			%the melting point of ice at 1 atmosphere of pressure in K
 			self.meltingpoint=273.15;
@@ -101,12 +95,6 @@
 			self.rheology_law='Paterson';
 
-			% GIA:
-			self.lithosphere_shear_modulus  = 6.7*10^10;  % (Pa)
-			self.lithosphere_density        = 3.32;       % (g/cm^-3)
-			self.mantle_shear_modulus       = 1.45*10^11; % (Pa)
-			self.mantle_density             = 3.34;       % (g/cm^-3)
-
-			%SLR
-			self.earth_density= 5512;  % average density of the Earth, (kg/m^3)
+			%SLC
+			self.earth_density= 5512; % average density of the Earth (kg/m^3)
 
 		end % }}}
@@ -121,11 +109,5 @@
 			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
 			
-			if ismember('GiaAnalysis',analyses),
-				md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
-				md = checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1);
-				md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
-				md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
-			end
-			if ismember('SealevelriseAnalysis',analyses),
+			if ismember('SealevelchangeAnalysis',analyses),
 				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
 			end
@@ -152,8 +134,4 @@
 			fielddisplay(self,'rheology_n','Glen''s flow law exponent');
 			fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', ''Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval''']);
-			fielddisplay(self,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
-			fielddisplay(self,'lithosphere_density','Lithosphere density [g/cm^-3]');
-			fielddisplay(self,'mantle_shear_modulus','Mantle shear modulus [Pa]');
-			fielddisplay(self,'mantle_density','Mantle density [g/cm^-3]');
 			fielddisplay(self,'earth_density','Mantle density [kg/m^-3]');
 		end % }}}
@@ -177,8 +155,4 @@
 			WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String');
 
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3);
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10^3);
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
 
Index: /issm/trunk/src/m/classes/matdamageice.py
===================================================================
--- /issm/trunk/src/m/classes/matdamageice.py	(revision 26743)
+++ /issm/trunk/src/m/classes/matdamageice.py	(revision 26744)
@@ -1,2 +1,4 @@
+import numpy as np
+
 from fielddisplay import fielddisplay
 from project3d import project3d
@@ -6,6 +8,5 @@
 
 class matdamageice(object):
-    """
-    MATICE class definition
+    """MATICE class definition
 
        Usage:
@@ -14,55 +15,46 @@
 
     def __init__(self):  # {{{
-        self.rho_ice = 0.
-        self.rho_water = 0.
-        self.rho_freshwater = 0.
-        self.mu_water = 0.
-        self.heatcapacity = 0.
-        self.latentheat = 0.
-        self.thermalconductivity = 0.
-        self.temperateiceconductivity = 0.
+        self.rho_ice = 0
+        self.rho_water = 0
+        self.rho_freshwater = 0
+        self.mu_water = 0
+        self.heatcapacity = 0
+        self.latentheat = 0
+        self.thermalconductivity = 0
+        self.temperateiceconductivity = 0
         self.effectiveconductivity_averaging = 0
-        self.meltingpoint = 0.
-        self.beta = 0.
-        self.mixed_layer_capacity = 0.
-        self.thermal_exchange_velocity = 0.
-        self.rheology_B = float('NaN')
-        self.rheology_n = float('NaN')
+        self.meltingpoint = 0
+        self.beta = 0
+        self.mixed_layer_capacity = 0
+        self.thermal_exchange_velocity = 0
+        self.rheology_B = np.nan
+        self.rheology_n = np.nan
         self.rheology_law = ''
 
-    #giaivins:
-        self.lithosphere_shear_modulus = 0.
-        self.lithosphere_density = 0.
-        self.mantle_shear_modulus = 0.
-        self.mantle_density = 0.
+        #SLC
+        self.earth_density = 0
 
-    #SLR
-        self.earth_density = 5512  # average density of the Earth, (kg / m^3)
         self.setdefaultparameters()
     #}}}
 
     def __repr__(self):  # {{{
-        string = "   Materials:"
-        string = "%s\n%s" % (string, fielddisplay(self, "rho_ice", "ice density [kg / m^3]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "rho_water", "water density [kg / m^3]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "rho_freshwater", "fresh water density [kg / m^3]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "mu_water", "water viscosity [N s / m^2]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "heatcapacity", "heat capacity [J / kg / K]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "thermalconductivity", "ice thermal conductivity [W / m / K]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "temperateiceconductivity", "temperate ice thermal conductivity [W / m / K]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "effectiveconductivity_averaging", "computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "meltingpoint", "melting point of ice at 1atm in K"))
-        string = "%s\n%s" % (string, fielddisplay(self, "latentheat", "latent heat of fusion [J / m^3]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "beta", "rate of change of melting point with pressure [K / Pa]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "mixed_layer_capacity", "mixed layer capacity [W / kg / K]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "thermal_exchange_velocity", "thermal exchange velocity [m / s]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1 / n)]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
-        string = "%s\n%s" % (string, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'"))
-        string = "%s\n%s" % (string, fielddisplay(self, "lithosphere_shear_modulus", "Lithosphere shear modulus [Pa]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "lithosphere_density", "Lithosphere density [g / cm^ - 3]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "mantle_shear_modulus", "Mantle shear modulus [Pa]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "mantle_density", "Mantle density [g / cm^ - 3]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "earth_density", "Mantle density [kg / m^ - 3]"))
+        s = '   Materials:\n'
+        s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'rho_water', 'water density [kg/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [N s/m^2]'))
+        s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
+        s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', 'ice thermal conductivity [W/m/K]'))
+        s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
+        s += '{}\n'.format(fielddisplay(self, 'effectiveconductivity_averaging', 'computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)'))
+        s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
+        s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
+        s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/ kg/K]'))
+        s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
+        s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/n)]'))
+        s += '{}\n'.format(fielddisplay(self, 'rheology_n', 'Glen\'s flow law exponent'))
+        s += '{}\n'.format(fielddisplay(self, 'rheology_law', 'law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\' or \'LliboutryDuval\''))
+        s += '{}\n'.format(fielddisplay(self, 'earth_density', 'Mantle density [kg m^-3]'))
         return string
     #}}}
@@ -75,42 +67,36 @@
 
     def setdefaultparameters(self):  # {{{
-        #ice density (kg / m^3)
-        self.rho_ice = 917.
-        #ocean water density (kg / m^3)
-        self.rho_water = 1023.
-        #fresh water density (kg / m^3)
-        self.rho_freshwater = 1000.
-        #water viscosity (N.s / m^2)
+        # Ice density (kg/m^3)
+        self.rho_ice = 917.0
+        # Ocean water density (kg/m^3)
+        self.rho_water = 1023.0
+        # Fresh water density (kg/m^3)
+        self.rho_freshwater = 1000.0
+        # Water viscosity (N.s/m^2)
         self.mu_water = 0.001787
-        #ice heat capacity cp (J / kg / K)
-        self.heatcapacity = 2093.
-        #ice latent heat of fusion L (J / kg)
-        self.latentheat = 3.34e5
-        #ice thermal conductivity (W / m / K)
+        # Ice heat capacity cp (J/kg/K)
+        self.heatcapacity = 2093.0
+        # Ice latent heat of fusion L (J/kg)
+        self.latentheat = 3.34 * pow(10, 5)
+        # Ice thermal conductivity (W/m/K)
         self.thermalconductivity = 2.4
-        #temperate ice thermal conductivity (W / m / K)
+        # Temperate ice thermal conductivity (W/m/K)
         self.temperateiceconductivity = 0.24
-        #computation of effective conductivity
+        # Computation of effective conductivity
         self.effectiveconductivity_averaging = 1
-        #the melting point of ice at 1 atmosphere of pressure in K
+        # The melting point of ice at 1 atmosphere of pressure in K
         self.meltingpoint = 273.15
-        #rate of change of melting point with pressure (K / Pa)
-        self.beta = 9.8e-8
-        #mixed layer (ice-water interface) heat capacity (J / kg / K)
-        self.mixed_layer_capacity = 3974.
-        #thermal exchange velocity (ice-water interface) (m / s)
+        # Rate of change of melting point with pressure (K/Pa)
+        self.beta = 9.8 * pow(10, -8)
+        # Mixed layer (ice-water interface) heat capacity (J/kg/K)
+        self.mixed_layer_capacity = 3974.0
+        # Thermal exchange velocity (ice-water interface) (m/s)
         self.thermal_exchange_velocity = 1.00e-4
-        #Rheology law: what is the temperature dependence of B with T
-        #available: none, paterson and arrhenius
+        # Rheology law: what is the temperature dependence of B with T 
+        # available: none, paterson and arrhenius
         self.rheology_law = 'Paterson'
 
-        # GIA:
-        self.lithosphere_shear_modulus = 6.7e10  # (Pa)
-        self.lithosphere_density = 3.32  # (g / cm^ - 3)
-        self.mantle_shear_modulus = 1.45e11  # (Pa)
-        self.mantle_density = 3.34  # (g / cm^ - 3)
-
-        #SLR
-        self.earth_density = 5512  #average density of the Earth, (kg / m^3)
+        # SLC
+        self.earth_density = 5512  # average density of the Earth (kg/m^3)
         return self
     #}}}
@@ -125,17 +111,6 @@
         md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval'])
         md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
-        md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', [1])
-        md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])
 
-        if 'GiaAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', 1)
-            md = checkfield(md,'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', 1)
-            md = checkfield(md,'fieldname', 'materials.mantle_density', '>', 0, 'numel', 1)
-
-        if 'SealevelriseAnalysis' in analyses:
+        if 'SealevelchangeAnalysis' in analyses:
                 md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1)
 
@@ -161,8 +136,4 @@
         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2)
         WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_shear_modulus', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_density', 'format', 'Double', 'scale', 10.**3.)
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_shear_modulus', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_density', 'format', 'Double', 'scale', 10.**3.)
         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
 
Index: /issm/trunk/src/m/classes/matenhancedice.m
===================================================================
--- /issm/trunk/src/m/classes/matenhancedice.m	(revision 26743)
+++ /issm/trunk/src/m/classes/matenhancedice.m	(revision 26744)
@@ -6,30 +6,24 @@
 classdef matenhancedice
 	properties (SetAccess=public) 
-		rho_ice                    = 0.;
-		rho_water                  = 0.;
-		rho_freshwater             = 0.;
-		mu_water                   = 0.;
-		heatcapacity               = 0.;
-		latentheat                 = 0.;
-		thermalconductivity        = 0.;
-		temperateiceconductivity   = 0.;
+		rho_ice                         = 0.;
+		rho_water                       = 0.;
+		rho_freshwater                  = 0.;
+		mu_water                        = 0.;
+		heatcapacity                    = 0.;
+		latentheat                      = 0.;
+		thermalconductivity             = 0.;
+		temperateiceconductivity        = 0.;
 		effectiveconductivity_averaging = 0.;
-		meltingpoint               = 0.;
-		beta                       = 0.;
-		mixed_layer_capacity       = 0.;
-		thermal_exchange_velocity  = 0.;
-		rheology_E   = NaN;
-		rheology_B   = NaN;
-		rheology_n   = NaN;
-		rheology_law = '';
+		meltingpoint                    = 0.;
+		beta                            = 0.;
+		mixed_layer_capacity            = 0.;
+		thermal_exchange_velocity       = 0.;
+		rheology_E                      = NaN;
+		rheology_B                      = NaN;
+		rheology_n                      = NaN;
+		rheology_law                    = '';
 
-		%giaivins: 
-		lithosphere_shear_modulus  = 0.;
-		lithosphere_density        = 0.;
-		mantle_shear_modulus       = 0.;
-		mantle_density             = 0.;
-
-		%slr
-		earth_density              = 0;
+		%SLC
+		earth_density                   = 0;
 
 	end
@@ -70,5 +64,5 @@
 
 			%water viscosity (N.s/m^2)
-			self.mu_water=0.001787;  
+			self.mu_water=0.001787;
 
 			%ice heat capacity cp (J/kg/K)
@@ -86,5 +80,5 @@
 			%computation of effective conductivity
 			self.effectiveconductivity_averaging=1;
-            
+
 			%the melting point of ice at 1 atmosphere of pressure in K
 			self.meltingpoint=273.15;
@@ -103,11 +97,5 @@
 			self.rheology_law='Paterson';
 
-			% GIA:
-			self.lithosphere_shear_modulus  = 6.7*10^10;  % (Pa)
-			self.lithosphere_density        = 3.32;       % (g/cm^-3)
-			self.mantle_shear_modulus       = 1.45*10^11; % (Pa)
-			self.mantle_density             = 3.34;       % (g/cm^-3)
-
-			%SLR
+			%SLC
 			self.earth_density= 5512;  % average density of the Earth, (kg/m^3)
 
@@ -124,11 +112,5 @@
 			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
             
-			if ismember('GiaAnalysis',analyses),
-				md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
-				md = checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1);
-				md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
-				md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
-			end
-			if ismember('SealevelriseAnalysis',analyses),
+			if ismember('SealevelchangeAnalysis',analyses),
 				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
 			end
@@ -155,8 +137,4 @@
 			fielddisplay(self,'rheology_n','Glen''s flow law exponent');
 			fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval''']);
-			fielddisplay(self,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
-			fielddisplay(self,'lithosphere_density','Lithosphere density [g/cm^-3]');
-			fielddisplay(self,'mantle_shear_modulus','Mantle shear modulus [Pa]');
-			fielddisplay(self,'mantle_density','Mantle density [g/cm^-3]');
 			fielddisplay(self,'earth_density','Mantle density [kg/m^-3]');
 		end % }}}
@@ -181,8 +159,4 @@
 			WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String');
 
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3);
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10^3);
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
 		end % }}}
@@ -207,8 +181,4 @@
 			writejs1Darray(fid,[modelname '.materials.rheology_n'],self.rheology_n);
 			writejsstring(fid,[modelname '.materials.rheology_law'],self.rheology_law);
-			writejsdouble(fid,[modelname '.materials.lithosphere_shear_modulus'],self.lithosphere_shear_modulus);
-			writejsdouble(fid,[modelname '.materials.lithosphere_density'],self.lithosphere_density);
-			writejsdouble(fid,[modelname '.materials.mantle_shear_modulus'],self.mantle_shear_modulus);
-			writejsdouble(fid,[modelname '.materials.mantle_density'],self.mantle_density);
 			writejsdouble(fid,[modelname '.materials.earth_density'],self.earth_density);
 
Index: /issm/trunk/src/m/classes/matenhancedice.py
===================================================================
--- /issm/trunk/src/m/classes/matenhancedice.py	(revision 26743)
+++ /issm/trunk/src/m/classes/matenhancedice.py	(revision 26744)
@@ -1,125 +1,111 @@
+import numpy as np
+
+from checkfield import checkfield
 from fielddisplay import fielddisplay
 from project3d import project3d
-from checkfield import checkfield
 from WriteData import WriteData
 
 
 class matenhancedice(object):
-    """
-    MATICE class definition
+    """MATICE class definition
 
-        Usage:
-            matenhancedice = matenhancedice()
+    Usage:
+        matenhancedice = matenhancedice()
     """
 
-    def __init__(self): #{{{
-        self.rho_ice = 0.
-        self.rho_water = 0.
-        self.rho_freshwater = 0.
-        self.mu_water = 0.
-        self.heatcapacity = 0.
-        self.latentheat = 0.
-        self.thermalconductivity = 0.
-        self.temperateiceconductivity = 0.
+    def __init__(self):  # {{{
+        self.rho_ice = 0
+        self.rho_water = 0
+        self.rho_freshwater = 0
+        self.mu_water = 0
+        self.heatcapacity = 0
+        self.latentheat = 0
+        self.thermalconductivity = 0
+        self.temperateiceconductivity = 0
         self.effectiveconductivity_averaging = 0
-        self.meltingpoint = 0.
-        self.beta = 0.
-        self.mixed_layer_capacity = 0.
-        self.thermal_exchange_velocity = 0.
-        self.rheology_E = float('NaN')
-        self.rheology_B = float('NaN')
-        self.rheology_n = float('NaN')
+        self.meltingpoint = 0
+        self.beta = 0
+        self.mixed_layer_capacity = 0
+        self.thermal_exchange_velocity = 0
+        self.rheology_E = np.nan
+        self.rheology_B = np.nan
+        self.rheology_n = np.nan
         self.rheology_law = ''
 
-        #GIA
-        self.lithosphere_shear_modulus = 0.
-        self.lithosphere_density = 0.
-        self.mantle_shear_modulus = 0.
-        self.mantle_density = 0.
+        #SLC
+        self.earth_density = 0
 
-        #SLR
-        self.earth_density = 0  # average density of the Earth, (kg/m^3)
         self.setdefaultparameters()
-    #}}}
+    # }}}
 
-    def __repr__(self): #{{{
-        s = "   Materials:"
-        s = "%s\n%s" % (s, fielddisplay(self, "rho_ice", "ice density [kg/m^3]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "rho_water", "water density [kg/m^3]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "rho_freshwater", "fresh water density [kg/m^3]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "mu_water", "water viscosity [N s/m^2]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "heatcapacity", "heat capacity [J/kg/K]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "thermalconductivity", "ice thermal conductivity [W/m/K]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "temperateiceconductivity", "temperate ice thermal conductivity [W/m/K]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "effectiveconductivity_averaging", "computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
-        s = "%s\n%s" % (s, fielddisplay(self, "meltingpoint", "melting point of ice at 1atm in K"))
-        s = "%s\n%s" % (s, fielddisplay(self, "latentheat", "latent heat of fusion [J/m^3]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "beta", "rate of change of melting point with pressure [K/Pa]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "mixed_layer_capacity", "mixed layer capacity [W/kg/K]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "thermal_exchange_velocity", "thermal exchange velocity [m/s]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "rheology_E", "enhancement factor"))
-        s = "%s\n%s" % (s, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1/n)]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
-        s = "%s\n%s" % (s, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'"))
-        s = "%s\n%s" % (s, fielddisplay(self, "lithosphere_shear_modulus", "Lithosphere shear modulus [Pa]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "lithosphere_density", "Lithosphere density [g/cm^-3]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "mantle_shear_modulus", "Mantle shear modulus [Pa]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "mantle_density", "Mantle density [g/cm^-3]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "earth_density", "Mantle density [kg/m^-3]"))
+    def __repr__(self):  # {{{
+        s = '   Materials:\n'
+        s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'rho_water', 'water density [kg/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [N s/m^2]'))
+        s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
+        s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', 'ice thermal conductivity [W/m/K]'))
+        s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
+        s += '{}\n'.format(fielddisplay(self, 'effectiveconductivity_averaging', 'computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)'))
+        s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
+        s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
+        s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/kg/K]'))
+        s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
+        s += '{}\n'.format(fielddisplay(self, 'rheology_E', 'enhancement factor'))
+        s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/n)]'))
+        s += '{}\n'.format(fielddisplay(self, 'rheology_n', 'Glen\'s flow law exponent'))
+        s += '{}\n'.format(fielddisplay(self, 'rheology_law', 'law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\' or \'LliboutryDuval\''))
+        s += '{}\n'.format(fielddisplay(self, 'earth_density', 'Mantle density [kg/m^-3]'))
 
         return s
-    #}}}
+    # }}}
 
-    def extrude(self, md): #{{{
+    def extrude(self, md):  # {{{
         self.rheology_E = project3d(md, 'vector', self.rheology_E, 'type', 'node')
         self.rheology_B = project3d(md, 'vector', self.rheology_B, 'type', 'node')
         self.rheology_n = project3d(md, 'vector', self.rheology_n, 'type', 'element')
         return self
-    #}}}
+    # }}}
 
-    def setdefaultparameters(self): #{{{
-        #ice density (kg / m^3)
-        self.rho_ice = 917.
-        #ocean water density (kg / m^3)
-        self.rho_water = 1023.
-        #fresh water density (kg / m^3)
-        self.rho_freshwater = 1000.
-        #water viscosity (N.s / m^2)
+    def setdefaultparameters(self):  # {{{
+        # Ice density (kg/m^3)
+        self.rho_ice = 917.0
+        # Ocean water density (kg/m^3)
+        self.rho_water = 1023.0
+        # Fresh water density (kg/m^3)
+        self.rho_freshwater = 1000.0
+        # Water viscosity (N.s/m^2)
         self.mu_water = 0.001787
-        #ice heat capacity cp (J / kg / K)
-        self.heatcapacity = 2093.
-        #ice latent heat of fusion L (J / kg)
-        self.latentheat = 3.34 * 10**5
-        #ice thermal conductivity (W / m / K)
+        # Ice heat capacity cp (J/kg/K)
+        self.heatcapacity = 2093.0
+        # Ice latent heat of fusion L (J/kg)
+        self.latentheat = 3.34 * pow(10, 5)
+        # Ice thermal conductivity (W/m/K)
         self.thermalconductivity = 2.4
-        #temperate ice thermal conductivity (W / m / K)
+        # Temperate ice thermal conductivity (W/m/K)
         self.temperateiceconductivity = 0.24
-        #computation of effective conductivity
+        # Computation of effective conductivity
         self.effectiveconductivity_averaging = 1
-        #the melting point of ice at 1 atmosphere of pressure in K
+        # The melting point of ice at 1 atmosphere of pressure in K
         self.meltingpoint = 273.15
-        #rate of change of melting point with pressure (K / Pa)
-        self.beta = 9.8 * 10**-8
-        #mixed layer (ice-water interface) heat capacity (J / kg / K)
-        self.mixed_layer_capacity = 3974.
-        #thermal exchange velocity (ice-water interface) (m / s)
-        self.thermal_exchange_velocity = 1.00 * 10**-4
-        #Rheology law: what is the temperature dependence of B with T
-        #available: none, paterson and arrhenius
+        # Rate of change of melting point with pressure (K/Pa)
+        self.beta = 9.8 * pow(10, -8)
+        # Mixed layer (ice-water interface) heat capacity (J/kg/K)
+        self.mixed_layer_capacity = 3974.0
+        # Thermal exchange velocity (ice-water interface) (m/s)
+        self.thermal_exchange_velocity = 1.00 * pow(10, -4)
+        # Rheology law: what is the temperature dependence of B with T
+        # available: none, paterson and arrhenius
         self.rheology_law = 'Paterson'
 
-    # GIA:
-        self.lithosphere_shear_modulus = 6.7 * 10**10  # (Pa)
-        self.lithosphere_density = 3.32  # (g / cm^ - 3)
-        self.mantle_shear_modulus = 1.45 * 10**11  # (Pa)
-        self.mantle_density = 3.34  # (g / cm^ - 3)
-
-    #SLR
-        self.earth_density = 5512  #average density of the Earth, (kg / m^3)
+        # SLC
+        self.earth_density = 5512 # average density of the Earth, (kg/m^3)
 
         return self
-    #}}}
+    # }}}
 
-    def checkconsistency(self, md, solution, analyses): #{{{
+    def checkconsistency(self, md, solution, analyses):  # {{{
         md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
         md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
@@ -132,16 +118,10 @@
         md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
 
-        if 'GiaAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', 1)
-            
-        if 'SealevelriseAnalysis' in analyses:
+        if 'SealevelchangeAnalysis' in analyses:
             md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1)
         return md
     # }}}
 
-    def marshall(self, prefix, md, fid): #{{{
+    def marshall(self, prefix, md, fid):  # {{{
         WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 4, 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
@@ -162,8 +142,4 @@
         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2)
         WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_shear_modulus', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_density', 'format', 'Double', 'scale', 10**3)
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_shear_modulus', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_density', 'format', 'Double', 'scale', 10**3)
         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
     # }}}
Index: /issm/trunk/src/m/classes/materials.js
===================================================================
--- /issm/trunk/src/m/classes/materials.js	(revision 26744)
+++ /issm/trunk/src/m/classes/materials.js	(revision 26744)
@@ -0,0 +1,380 @@
+class materials {
+	/**
+	 * MATERIALS class definition
+	 *
+	 * Usage:
+	 *     materials = materials();
+	 */
+	constructor() {//{{{
+		this.nature = [];
+
+		let nargs = arguments.length;
+		if (nargs == 0) {
+			this.nature=['ice'];
+		} else {
+			this.nature=arguments;
+		}
+
+		// Check this is acceptable
+		for (let i = 0; i < this.nature.length; ++i) {
+			if (!(strcmpi(this.nature[i], 'litho') || strcmpi(this.nature[i], 'ice') || strcmpi(this.nature[i], 'hydro'))) {
+				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
+			}
+		}
+
+		// Start filling in the dynamic fields (not truly dynamic under JavaScript)
+		for (let i = 0; i < length(this.nature); ++i) {
+			let nat = this.nature[i];
+			switch (nat) {
+				case 'ice':
+					this.rho_ice = 0;
+					this.rho_water = 0;
+					this.rho_freshwater = 0;
+					this.mu_water = 0;
+					this.heatcapacity = 0;
+					this.latentheat = 0;
+					this.thermalconductivity = 0;
+					this.temperateiceconductivity = 0;
+					this.effectiveconductivity_averaging = 0;
+					this.meltingpoint = 0;
+					this.beta = 0;
+					this.mixed_layer_capacity = 0;
+					this.thermal_exchange_velocity = 0;
+					this.rheology_B = 0;
+					this.rheology_n = 0;
+					this.rheology_law = 0;
+					break;
+				case 'litho':
+					this.numlayers = 0;
+					this.radius = 0;
+					this.viscosity = 0;
+					this.lame_lambda = 0;
+					this.lame_mu = 0;
+					this.burgers_viscosity = 0;
+					this.burgers_mu = 0;
+					this.ebm_alpha = 0;
+					this.ebm_delta = 0;
+					this.ebm_taul = 0;
+					this.ebm_tauh = 0;
+					this.rheologymodel = 0;
+					this.density = 0;
+					this.issolid = 0;
+					break;
+				case 'hydro':
+					this.rho_ice = 0;
+					this.rho_water = 0;
+					this.rho_freshwater = 0;
+					break;
+				default:
+					error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
+			}
+			this.earth_density = 0;
+
+			// Set default parameters
+			this.setdefaultparameters();
+		}
+	} //}}}
+	disp() {//{{{
+		console.log(sprintf('   Materials:'));
+
+		for (let i = 0; i < length(this.nature); ++i) {
+			let nat = this.nature[i];
+			switch (nat) {
+				case 'ice':
+					console.log(sprintf('   \nIce:'));
+					fielddisplay(this,'rho_ice','ice density [kg/m^3]');
+					fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
+					fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
+					fielddisplay(this,'mu_water','water viscosity [N s/m^2]');
+					fielddisplay(this,'heatcapacity','heat capacity [J/kg/K]');
+					fielddisplay(this,'thermalconductivity','ice thermal conductivity [W/m/K]');
+					fielddisplay(this,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
+					fielddisplay(this,'meltingpoint','melting point of ice at 1atm in K');
+					fielddisplay(this,'latentheat','latent heat of fusion [J/kg]');
+					fielddisplay(this,'beta','rate of change of melting point with pressure [K/Pa]');
+					fielddisplay(this,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
+					fielddisplay(this,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
+					fielddisplay(this,'rheology_B','flow law parameter [Pa s^(1/n)]');
+					fielddisplay(this,'rheology_n','Glen\'s flow law exponent');
+					fielddisplay(this,'rheology_law','law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\', \'LliboutryDuval\', \'NyeCO2\', or \'NyeH2O\'');
+					break;
+				case 'litho':
+					console.log(sprintf('   \nLitho:'));
+					fielddisplay(this,'numlayers','number of layers (default: 2)');
+					fielddisplay(this,'radius','array describing the radius for each interface (numlayers+1) [m]');
+					fielddisplay(this,'viscosity','array describing each layer\'s viscosity (numlayers) [Pa.s]');
+					fielddisplay(this,'lame_lambda','array describing the lame lambda parameter (numlayers) [Pa]');
+					fielddisplay(this,'lame_mu','array describing the shear modulus for each layers (numlayers) [Pa]');
+					fielddisplay(this,'burgers_viscosity','array describing each layer\'s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]');
+					fielddisplay(this,'burgers_mu','array describing each layer\'s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]');
+
+					fielddisplay(this,'ebm_alpha','array describing each layer\'s exponent parameter controlling the shape of shear modulus curve between taul and tauh, only for EBM rheology (numlayers)');
+					fielddisplay(this,'ebm_delta','array describing each layer\'s amplitude of the transient relaxation (ratio between elastic rigity to pre-maxwell relaxation rigity), only for EBM rheology (numlayers)');
+					fielddisplay(this,'ebm_taul','array describing each layer\'s starting period for transient relaxation, only for EBM rheology  (numlayers) [s]');
+					fielddisplay(this,'ebm_tauh','array describing each layer\'s array describing each layer\'s end period for transient relaxation, only for Burgers rheology (numlayers) [s]');
+
+					fielddisplay(this,'rheologymodel','array describing whether we adopt a Maxwell (0), Burgers (1) or EBM (2) rheology (default: 0)');
+					fielddisplay(this,'density','array describing each layer\'s density (numlayers) [kg/m^3]');
+					fielddisplay(this,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)');
+					break;
+				case 'hydro':
+					console.log(sprintf('   \nHydro:'));
+					fielddisplay(this,'rho_ice','ice density [kg/m^3]');
+					fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
+					fielddisplay(this,'earth_density','mantle density [kg/m^3]');
+					fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
+					break;
+				default:
+					error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
+			}
+		}
+	} //}}}
+	setdefaultparameters() {//{{{
+		for (let i = 0; i < this.nature.length; ++i) {
+			let nat = this.nature[i];
+			switch (nat) {
+				case 'ice':
+					// Ice density (kg/m^3)
+					this.rho_ice = 917;
+
+					// Ocean water density (kg/m^3)
+					this.rho_water = 1023
+
+					// Fresh water density (kg/m^3)
+					this.rho_freshwater = 1000;
+
+					// Water viscosity (N.s/m^2)
+					this.mu_water = 0.001787;
+
+					// Ice heat capacity cp (J/kg/K)
+					this.heatcapacity = 2093;
+
+					// Ice latent heat of fusion L (J/kg)
+					this.latentheat = 3.34 * 1e5;
+
+					// Ice thermal conductivity (W/m/K)
+					this.thermalconductivity = 2.4;
+
+					// Wet ice thermal conductivity (W/m/K)
+					this.temperateiceconductivity = 0.24;
+
+					// Computation of effective conductivity
+					this.effectiveconductivity_averaging = 1;
+
+					// The melting point of ice at 1 atmosphere of pressure in K
+					this.meltingpoint = 273.15;
+
+					// Rate of change of melting point with pressure (K/Pa)
+					this.beta = 9.8 * 1e-8;
+
+					// Mixed layer (ice-water interface) heat capacity (J/kg/K)
+					this.mixed_layer_capacity = 3974;
+
+					// Thermal exchange velocity (ice-water interface) (m/s)
+					this.thermal_exchange_velocity = 1.00 * 1e-4;
+
+					// Rheology law: what is the temperature dependence of B with T
+					// available: none, paterson and arrhenius
+					this.rheology_law = 'Paterson';
+
+					// Rheology fields default
+					this.rheology_B = 1 * 1e8;
+					this.rheology_n = 3;
+					break;
+				case 'litho':
+					// We default to a configuration that enables running GIA 
+					// solutions using giacaron and/or giaivins
+					this.numlayers = 2;
+
+					// Center of the earth (approximation, must not be 0), then the 
+					// lab (lithosphere/asthenosphere boundary) then the surface
+					// (with 1d3 to avoid numerical singularities)
+					this.radius = [1e3, 6278 * 1e3, 6378 * 1e3];
+
+					this.viscosity = [1e21, 1e40]; // Mantle and lithosphere viscosity (respectively) [Pa.s]
+					this.lame_mu = [1.45 * 1e11, 6.7 * 1e10]; // (Pa) // Lithosphere and mantle shear modulus (respectively) [Pa]
+					this.lame_lambda = this.lame_mu; // (Pa) // Mantle and lithosphere lamba parameter (respectively) [Pa]
+					this.burgers_viscosity = [NaN, NaN];
+					this.burgers_mu = [NaN, NaN];
+
+					this.ebm_alpha = [NaN, NaN];
+					this.ebm_delta = [NaN, NaN];
+					this.ebm_taul = [NaN, NaN];
+					this.ebm_tauh = [NaN, NaN];
+					this.rheologymodel = [0, 0];
+					this.density = [5.51 * 1e3, 5.50 * 1e3]; // (Pa) // Mantle and lithosphere density [kg/m^3]
+					this.issolid = [1, 1]; // Is layer solid or liquid?
+					break;
+				case 'hydro':
+					// Ice density (kg/m^3)
+					this.rho_ice = 917;
+
+					// Ocean water density (kg/m^3)
+					this.rho_water = 1023;
+
+					// Fresh water density (kg/m^3)
+					this.rho_freshwater = 1000;
+					break;
+				default:
+					error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
+			}
+
+			// Average density of the Earth (kg/m^3)
+			this.earth_density = 5512;
+		}
+	} //}}}
+	checkconsistency(md, solution, analyses) {//{{{
+		for (let i = 0; i < this.nature.length; ++i) {
+			let nat = this.nature[i];
+			if (nat == 'ice') {
+				md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0);
+				md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0);
+				md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0);
+				md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0);
+				md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'timeseries', 1, 'NaN', 1, 'Inf', 1);
+				md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'size', [md.mesh.numberofelements, 1]);
+				md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', 'NyeH2O']);
+			} else if (nat == 'litho') {
+				if (!analyses.includes('LoveAnalysis')) {
+					return md;
+				}
+
+				md = checkfield(md, 'fieldname', 'materials.numlayers', 'NaN', 1, 'Inf', 1, '>', 0, 'numel', 1);
+				md = checkfield(md, 'fieldname', 'materials.radius', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers + 1, 1], '>', 0);
+				md = checkfield(md, 'fieldname', 'materials.lame_mu', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
+				md = checkfield(md, 'fieldname', 'materials.lame_lambda', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
+				md = checkfield(md, 'fieldname', 'materials.issolid', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0, '<', 2);
+				md = checkfield(md, 'fieldname', 'materials.density', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>', 0);
+				md = checkfield(md, 'fieldname', 'materials.viscosity', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
+				md = checkfield(md, 'fieldname', 'materials.rheologymodel', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0, '<=', 2);
+				md = checkfield(md, 'fieldname', 'materials.burgers_viscosity', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
+				md = checkfield(md, 'fieldname', 'materials.burgers_mu', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
+				md = checkfield(md, 'fieldname', 'materials.ebm_alpha', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
+				md = checkfield(md, 'fieldname', 'materials.ebm_delta', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
+				md = checkfield(md, 'fieldname', 'materials.ebm_taul', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
+				md = checkfield(md, 'fieldname', 'materials.ebm_tauh', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
+
+				for (let i = 0; i < md.materials.numlayers; ++i) {
+					if (md.materials.rheologymodel[i] == 1 && (isnan(md.materials.burgers_viscosity[i]) || isnan(md.materials.burgers_mu[i]))) {
+						error('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with rheologymodel choice');
+					}
+					if (md.materials.rheologymodel[i] == 2 && (isnan(md.materials.ebm_alpha[i]) || isnan(md.materials.ebm_delta[i])) || isnan(md.materials.ebm_taul[i] || isnan(md.materials.ebm_tauh[i]))) {
+						error('materials checkconsistency error message: Litho ebm_alpha, ebm_delta, ebm_taul or ebm_tauh has NaN values, inconsistent with rheologymodel choice');
+					}
+				}
+				if (md.materials.issolid[0] == 0 || md.materials.lame_mu[0] == 0) {
+					error('First layer must be solid (issolid[0] > 0 AND lame_mu[0] > 0). Add a weak inner core if necessary.');
+				}
+				let ind = find(md.materials.issolid == 0);
+				if (sum(ismember(diff(ind), 1) >= 1)) { // If there are at least two consecutive indices that contain issolid = 0
+					error('Fluid layers detected at layers #' + ind + ', but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.');
+				}
+			} else if (nat == 'hydro') {
+				md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0);
+				md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0);
+				md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1);
+				md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0);
+			} else {
+				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
+			}
+		}
+
+		return md;
+	} //}}}
+	marshall(md, prefix, fid) {//{{{
+		// 1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
+		WriteData(fid, prefix, 'name', 'md.materials.nature', 'data', naturetointeger(this.nature), 'format', 'IntMat', 'mattype', 3);
+		WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 5, 'format', 'Integer'); // DANGER: this can evolve if you have classes
+		for (let i = 0; i < this.nature.length; ++i) {
+			let nat = this.nature[i];
+			if (nat == 'ice') {
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'mu_water', 'format', 'Double');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'heatcapacity', 'format', 'Double');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'latentheat', 'format', 'Double');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'effectiveconductivity_averaging', 'format', 'Integer');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'mixed_layer_capacity', 'format', 'Double');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'thermal_exchange_velocity', 'format', 'Double');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts);
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2);
+				WriteData(fid, prefix, 'data', this.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String');
+			} else if (nat == 'litho') {
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'numlayers', 'format', 'Integer');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'radius', 'format', 'DoubleMat', 'mattype', 3);
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'lame_mu', 'format', 'DoubleMat', 'mattype', 3);
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'lame_lambda', 'format', 'DoubleMat', 'mattype', 3);
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'issolid', 'format', 'DoubleMat', 'mattype', 3);
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'density', 'format', 'DoubleMat', 'mattype', 3);
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'viscosity', 'format', 'DoubleMat', 'mattype', 3);
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rheologymodel', 'format', 'DoubleMat', 'mattype', 3);
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'burgers_viscosity', 'format', 'DoubleMat', 'mattype', 3);
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'burgers_mu', 'format', 'DoubleMat', 'mattype', 3);
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'ebm_alpha', 'format', 'DoubleMat', 'mattype', 3);
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'ebm_delta', 'format', 'DoubleMat', 'mattype', 3);
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'ebm_taul', 'format', 'DoubleMat', 'mattype', 3);
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'ebm_tauh', 'format', 'DoubleMat', 'mattype', 3);
+				// Compute earth density compatible with our layer density distribution
+				let earth_density = 0;
+				for (let i = 0; i < this.numlayers; ++i) {
+					earth_density = earth_density + (Math.pow(this.radius[i + 1], 3) - Math.pow(this.radius[i], 3)) * this.density[i];
+				}
+				earth_density = earth_density / Math.pow(this.radius[this.numlayers]);
+				this.earth_density = earth_density;
+			} else if (nat == 'hydro') {
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double');
+				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double');
+			} else {
+				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
+			}
+			WriteData(fid, prefix, 'data', this.earth_density, 'name', 'md.materials.earth_density', 'format', 'Double');
+		}
+	} //}}}
+	extrude(md) {//{{{
+		for (let i = 0; i < this.nature.length; ++i) {
+			let nat = this.nature[i];
+			if (nat == 'ice') {
+				this.rheology_B = project3d(md, 'vector', this.rheology_B, 'type', 'node');
+				this.rheology_n = project3d(md, 'vector', this.rheology_n, 'type', 'element');
+			}
+		}
+	} //}}}
+} //}}}
+
+function naturetointeger(strnat) {//{{{
+	let intnat = zeros(strnat.length, 1);
+	for (let i = 0; i < strnat.length; ++i) {
+		switch (strnat[i]) {
+			case 'damageice':
+				intnat[i] = 1;
+				break;
+			case 'estar':
+				intnat[i] = 2;
+				break;
+			case 'ice':
+				intnat[i] = 3;
+				break;
+			case 'enhancedice':
+				intnat[i] = 4;
+				break;
+			//case 'materials': // This case will never happen, kept to ensure equivalent of codes between IoCodeToMaterialsEnum and IoCodeToNatureEnum
+			//	intnat[i] = 5;
+			//	break;
+			case 'litho':
+				intnat[i] = 6;
+				break;
+			case 'hydro':
+				intnat[i] = 7;
+				break;
+			default:
+				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
+		}
+	}
+	return intnat;
+}// }}}
Index: /issm/trunk/src/m/classes/materials.m
===================================================================
--- /issm/trunk/src/m/classes/materials.m	(revision 26743)
+++ /issm/trunk/src/m/classes/materials.m	(revision 26744)
@@ -37,4 +37,5 @@
 					self.addprop('thermalconductivity');
 					self.addprop('temperateiceconductivity');
+					self.addprop('effectiveconductivity_averaging');
 					self.addprop('meltingpoint');
 					self.addprop('beta');
@@ -52,5 +53,9 @@
 					self.addprop('burgers_viscosity');
 					self.addprop('burgers_mu');
-					self.addprop('isburgers');
+					self.addprop('ebm_alpha');
+					self.addprop('ebm_delta');
+					self.addprop('ebm_taul');
+					self.addprop('ebm_tauh');
+					self.addprop('rheologymodel');
 					self.addprop('density');
 					self.addprop('issolid');
@@ -59,9 +64,10 @@
 					self.addprop('rho_water');
 					self.addprop('rho_freshwater');
-					self.addprop('earth_density');
 				otherwise
 					error('materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'' or ''hydro'')');
 				end
 			end
+			self.addprop('earth_density');
+
 			%set default parameters:
 			self.setdefaultparameters();
@@ -90,5 +96,5 @@
 
 					%ice latent heat of fusion L (J/kg)
-					self.latentheat=3.34*10^5;
+					self.latentheat=3.34*1e5;
 
 					%ice thermal conductivity (W/m/K)
@@ -98,9 +104,12 @@
 					self.temperateiceconductivity=.24;
 
+					%computation of effective conductivity
+					self.effectiveconductivity_averaging=1;
+
 					%the melting point of ice at 1 atmosphere of pressure in K
 					self.meltingpoint=273.15;
 
 					%rate of change of melting point with pressure (K/Pa)
-					self.beta=9.8*10^-8;
+					self.beta=9.8*1e-8;
 
 					%mixed layer (ice-water interface) heat capacity (J/kg/K)
@@ -108,5 +117,5 @@
 
 					%thermal exchange velocity (ice-water interface) (m/s)
-					self.thermal_exchange_velocity=1.00*10^-4;
+					self.thermal_exchange_velocity=1.00*1e-4;
 
 					%Rheology law: what is the temperature dependence of B with T
@@ -114,4 +123,8 @@
 					self.rheology_law='Paterson';
 
+					%Rheology fields default: 
+					self.rheology_B   = 1 * 1e8;
+					self.rheology_n   = 3;
+
 				case 'litho'
 					%we default to a configuration that enables running GIA solutions using giacaron and/or giaivins.
@@ -123,9 +136,14 @@
 
 					self.viscosity=[1e21;1e40]; %mantle and lithosphere viscosity (respectively) [Pa.s]
-					self.lame_mu=[1.45*1e11;6.7*10^10];  % (Pa) %lithosphere and mantle shear modulus (respectively) [Pa]
+					self.lame_mu=[1.45*1e11;6.7*1e10];  % (Pa) %lithosphere and mantle shear modulus (respectively) [Pa]
 					self.lame_lambda=self.lame_mu;  % (Pa) %mantle and lithosphere lamba parameter (respectively) [Pa]
 					self.burgers_viscosity=[NaN;NaN];
 					self.burgers_mu=[NaN;NaN];
-					self.isburgers=[0;0];
+
+					self.ebm_alpha=[NaN;NaN];
+					self.ebm_delta=[NaN;NaN];
+					self.ebm_taul=[NaN;NaN];
+					self.ebm_tauh=[NaN;NaN];
+					self.rheologymodel=[0;0];
 					self.density=[5.51*1e3;5.50*1e3];  % (Pa) %mantle and lithosphere density [kg/m^3]
 					self.issolid=[1;1]; % is layer solid or liquid.
@@ -137,7 +155,5 @@
 					%ocean water density (kg/m^3)
 					self.rho_water=1023.;
-					% average density of the Earth (kg/m^3)
-					self.earth_density=5512;
-
+					
 					%fresh water density (kg/m^3)
 					self.rho_freshwater=1000.;
@@ -146,4 +162,8 @@
 					error('materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'' or ''hydro'')');
 				end
+
+				% average density of the Earth (kg/m^3)
+				self.earth_density=5512;
+
 			end
 		end % }}}
@@ -155,5 +175,5 @@
 				switch nat
 				case 'ice'
-					disp(sprintf('   \nIce:'));
+					disp(sprintf('\n      Ice:'));
 					fielddisplay(self,'rho_ice','ice density [kg/m^3]');
 					fielddisplay(self,'rho_water','ocean water density [kg/m^3]');
@@ -172,6 +192,6 @@
 					fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'', ''LliboutryDuval'', ''NyeCO2'', or ''NyeH2O''']);
 				case 'litho'
-					disp(sprintf('   \nLitho:'));
-					fielddisplay(self,'numlayers','number of layers (default 2)');
+					disp(sprintf('\n      Litho:'));
+					fielddisplay(self,'numlayers','number of layers (default: 2)');
 					fielddisplay(self,'radius','array describing the radius for each interface (numlayers+1) [m]');
 					fielddisplay(self,'viscosity','array describing each layer''s viscosity (numlayers) [Pa.s]');
@@ -180,9 +200,16 @@
 					fielddisplay(self,'burgers_viscosity','array describing each layer''s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]');
 					fielddisplay(self,'burgers_mu','array describing each layer''s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]');
-					fielddisplay(self,'isburgers','array describing whether we adopt a MaxWell (0) or Burgers (1) rheology (default 0)');
+
+					fielddisplay(self,'ebm_alpha','array describing each layer''s exponent parameter controlling the shape of shear modulus curve between taul and tauh, only for EBM rheology (numlayers)');
+					fielddisplay(self,'ebm_delta','array describing each layer''s amplitude of the transient relaxation (ratio between elastic rigity to pre-maxwell relaxation rigity), only for EBM rheology (numlayers)');
+					fielddisplay(self,'ebm_taul','array describing each layer''s starting period for transient relaxation, only for EBM rheology  (numlayers) [s]');
+					fielddisplay(self,'ebm_tauh','array describing each layer''s array describing each layer''s end period for transient relaxation, only for Burgers rheology (numlayers) [s]');
+
+
+					fielddisplay(self,'rheologymodel','array describing whether we adopt a Maxwell (0), Burgers (1) or EBM (2) rheology (default: 0)');
 					fielddisplay(self,'density','array describing each layer''s density (numlayers) [kg/m^3]');
 					fielddisplay(self,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)');
 				case 'hydro'
-					disp(sprintf('   \nHydro:'));
+					disp(sprintf('\n      Hydro:'));
 					fielddisplay(self,'rho_ice','ice density [kg/m^3]');
 					fielddisplay(self,'rho_water','ocean water density [kg/m^3]');
@@ -217,19 +244,26 @@
 					md = checkfield(md,'fieldname','materials.density','NaN',1,'Inf',1,'size',[md.materials.numlayers 1],'>',0);
 					md = checkfield(md,'fieldname','materials.viscosity','NaN',1,'Inf',1,'size',[md.materials.numlayers 1],'>=',0);
-					md = checkfield(md,'fieldname','materials.isburgers','NaN',1,'Inf',1,'size',[md.materials.numlayers 1],'>=',0,'<=',1);
+					md = checkfield(md,'fieldname','materials.rheologymodel','NaN',1,'Inf',1,'size',[md.materials.numlayers 1],'>=',0,'<=',2);
 					md = checkfield(md,'fieldname','materials.burgers_viscosity','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
 					md = checkfield(md,'fieldname','materials.burgers_mu','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
+					md = checkfield(md,'fieldname','materials.ebm_alpha','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
+					md = checkfield(md,'fieldname','materials.ebm_delta','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
+					md = checkfield(md,'fieldname','materials.ebm_taul','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
+					md = checkfield(md,'fieldname','materials.ebm_tauh','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
 
 					for i=1:md.materials.numlayers,
-						if md.materials.isburgers(i) & (isnan(md.materials.burgers_viscosity(i) | isnan(md.materials.burgers_mu(i)))),
-							error('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with isburgers choice');
+						if md.materials.rheologymodel(i)==1 & (isnan(md.materials.burgers_viscosity(i) | isnan(md.materials.burgers_mu(i)))),
+							error('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with rheologymodel choice');
+						end
+						if md.materials.rheologymodel(i)==2 & (isnan(md.materials.ebm_alpha(i)) | isnan(md.materials.ebm_delta(i)) | isnan(md.materials.ebm_taul(i)) | isnan(md.materials.ebm_tauh(i))),
+							error('materials checkconsistency error message: Litho ebm_alpha, ebm_delta, ebm_taul or ebm_tauh has NaN values, inconsistent with rheologymodel choice');
 						end
 					end
 					if md.materials.issolid(1)==0 | md.materials.lame_mu(1)==0
-							error('First layer must be solid (issolid(1) > 0 AND lame_mu(1) > 0). Add a weak inner core if necessary.');
+						error('First layer must be solid (issolid(1) > 0 AND lame_mu(1) > 0). Add a weak inner core if necessary.');
 					end
 					ind=find(md.materials.issolid==0);
 					if sum(ismember(diff(ind),1)>=1) %if there are at least two consecutive indices that contain issolid = 0
-							error(['Fluid layers detected at layers #', num2str(ind'), ', but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.'])
+						error(['Fluid layers detected at layers #', num2str(ind'), ', but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.'])
 					end
 
@@ -250,6 +284,5 @@
 			%1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
 			WriteData(fid,prefix,'name','md.materials.nature','data',naturetointeger(self.nature),'format','IntMat','mattype',3);
-			WriteData(fid,prefix,'name','md.materials.type','data',5,'format','Integer'); %DANGER, this can evolve if you have classes.
-
+			WriteData(fid,prefix,'name','md.materials.type','data',5,'format','Integer'); %DANGER: this can evolve if you have classes.
 			for i=1:length(self.nature),
 				nat=self.nature{i};
@@ -264,4 +297,5 @@
 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double');
 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double');
+					WriteData(fid,prefix,'object',self,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double');
 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double');
@@ -279,17 +313,27 @@
 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','density','format','DoubleMat','mattype',3);
 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','viscosity','format','DoubleMat','mattype',3);
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','isburgers','format','DoubleMat','mattype',3);
+					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheologymodel','format','DoubleMat','mattype',3);
 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','burgers_viscosity','format','DoubleMat','mattype',3);
 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','burgers_mu','format','DoubleMat','mattype',3);
+					WriteData(fid,prefix,'object',self,'class','materials','fieldname','ebm_alpha','format','DoubleMat','mattype',3);
+					WriteData(fid,prefix,'object',self,'class','materials','fieldname','ebm_delta','format','DoubleMat','mattype',3);
+					WriteData(fid,prefix,'object',self,'class','materials','fieldname','ebm_taul','format','DoubleMat','mattype',3);
+					WriteData(fid,prefix,'object',self,'class','materials','fieldname','ebm_tauh','format','DoubleMat','mattype',3);
+					%compute earth density compatible with our layer density distribution: 
+					earth_density=0;
+					for i=1:self.numlayers,
+						earth_density=earth_density + (self.radius(i+1)^3-self.radius(i)^3)*self.density(i);
+					end
+					earth_density=earth_density/self.radius(self.numlayers+1)^3;
+					self.earth_density=earth_density;
 				case 'hydro'
 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double');
 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double');
-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double');
-
 				otherwise
 					error('materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'' or ''hydro'')');
 				end
 			end
+			WriteData(fid,prefix,'data',self.earth_density,'name','md.materials.earth_density','format','Double');
 		end % }}}
 		function self = extrude(self,md) % {{{
@@ -317,4 +361,5 @@
 					writejsdouble(fid,[modelname '.materials.thermalconductivity'],self.thermalconductivity);
 					writejsdouble(fid,[modelname '.materials.temperateiceconductivity'],self.temperateiceconductivity);
+					writejsdouble(fid,[modelname '.materials.effectiveconductivity_averaging'],self.effectiveconductivity_averaging);
 					writejsdouble(fid,[modelname '.materials.meltingpoint'],self.meltingpoint);
 					writejsdouble(fid,[modelname '.materials.beta'],self.beta);
@@ -333,7 +378,11 @@
 					writejsdouble(fid,[modelname '.materials.density'],self.density);
 					writejsdouble(fid,[modelname '.materials.viscosity'],self.viscosity);
-					writejsdouble(fid,[modelname '.materials.isburgers'],self.isburgers);
+					writejsdouble(fid,[modelname '.materials.rheologymodel'],self.rheologymodel);
 					writejsdouble(fid,[modelname '.materials.burgers_viscosity'],self.burgers_viscosity);
 					writejsdouble(fid,[modelname '.materials.burgers_mu'],self.burgers_mu);
+					writejsdouble(fid,[modelname '.materials.ebm_alpha'],self.ebm_alpha);
+					writejsdouble(fid,[modelname '.materials.ebm_delta'],self.ebm_delta);
+					writejsdouble(fid,[modelname '.materials.ebm_taul'],self.ebm_taul);
+					writejsdouble(fid,[modelname '.materials.ebm_tauh'],self.ebm_tauh);
 
 				case 'hydro'
@@ -351,4 +400,161 @@
 
 		end % }}}
+		function setlitho2prem(self) % {{{
+			%based on materials.radius and materials.issolid, replaces materials.density, materials.lame_mu, materials.lame_lambda
+			% with volumetric averages of a polynomial version of the PREM model
+			if ~strcmpi(self.nature, 'litho')
+			error('materials setlitho2prem error message: materials.nature must be ''litho''')
+			end
+		   
+		   
+		   ra=self.radius(end);
+		   r(1) = 0.0;     r(2) = 1221.5; r(3) = 3480.0; r(4) = 3630.;
+		   r(5) = 5600.0;  r(6) = 5701.0;  r(7) = 5771.0; r(8) = 5971.;
+		   r(9) = 6151.0; r(10) = 6291.0; r(11) = 6346.6;
+		   r(12) = 6356.0; r(13) = 6368.0; r(14) = 6371.;
+		  
+		   if (r(14)*1e3 ~= ra) 
+			error(['materials setlitho2prem error message: Earth surface radius in PREM r=' num2str(r(end)*1e3) ' does not match materials.radius(end)=' num2str(self.radius(end))]); 
+		   end
+
+		  d = zeros(12,4); %polynomial coef for density
+		  d(1,1) = 13.0885; 		         	  d(1,3) = -8.8381 ;
+		  d(2,1) = 12.5815; d(2,2) = -1.2638; d(2,3) = -3.6426; d(2,4) = -5.5281;
+		  d(3,1) = 7.9565 ; d(3,2) = -6.4761;   d(3,3) = 5.5283;  d(3,4) = -3.0807;
+		  d(4,1) = 7.9565 ; d(4,2) = -6.4761;   d(4,3) = 5.5283;  d(4,4) = -3.0807;
+		  d(5,1) = 7.9565 ; d(5,2) = -6.4761;   d(5,3) = 5.5283;  d(5,4) = -3.0807;
+		  d(6,1) = 5.3197 ; d(6,2) = -1.4836;
+		  d(7,1) = 11.2494; d(7,2) = -8.0298;
+		  d(8,1) = 7.1089 ; d(8,2) = -3.8045;
+		  d(9,1) = 2.6910 ; d(9,2) = 0.6924;
+		  d(10,1) = 2.6910; d(10,2) = 0.6924;
+		  d(11,1) = 2.9  ;
+		  d(12,1) = 2.6  ;
+
+		% ocean
+		  if (~self.issolid(end)) 
+		  	d(13,1) = 1.02 ;
+
+		% continental
+		  else
+		  d(13,1) = d(12,1);
+		  end
+
+		  p = zeros(13,4); %polynomial coef for Vp, pressure wave velocity
+		  p(1,1) = 11.2622 ; p(1,3) = -6.3640;
+		  p(2,1) = 11.0487 ; p(2,2) = -4.0362; p(2,3)  = 4.8023; p(2,4) = -13.5732;
+		  p(3,1) = 15.3891 ; p(3,2) = -5.3181; p(3,3)  = 5.5242; p(3,4) = -2.5514;
+		  p(4,1) = 24.952 ; p(4,2)  = -40.4673; p(4,3) = 51.4832; p(4,4) = -26.6419;
+		  p(5,1) = 29.2766 ; p(5,2) = -23.6027; p(5,3) = 5.5242; p(5,4) = -2.5514;
+		  p(6,1) = 19.0957 ; p(6,2)  = -9.8672;
+		  p(7,1) = 39.7027 ; p(7,2)  = -32.6166;
+		  p(8,1) = 20.3926 ; p(8,2)  = -12.2569;
+		  p(9,1) = 4.1875 ; p(9,2)  = 3.9382;
+		  p(10,1) = 4.1875 ; p(10,2) = 3.9382;
+		  p(11,1) = 6.8 ;
+		  p(12,1) = 5.8;
+		%
+		% ocean
+		  if (~self.issolid(end)) 
+		  p(13,1) = 1.45 ;
+		%
+		% continental
+		  else
+		  p(13,1) = p(12,1);
+		  end
+		%----
+		%
+		  s = zeros(13,4); %polynomial coef for Vs, shear wave velocity
+		%
+		  s(1,1) = 3.6678; s(1,3) = -4.4475;
+
+		  s(3,1) = 6.9254; s(3,2) = 1.4672; s(3,3) = -2.0834; s(3,4) = 0.9783;
+		  s(4,1) = 11.1671; s(4,2) = -13.7818; s(4,3) = 17.4575; s(4,4) = -9.2777;
+		  s(5,1) = 22.3459; s(5,2) = -17.2473; s(5,3) = -2.0834; s(5,4) = 0.9783;
+		  s(6,1) = 9.9839; s(6,2) = -4.9324;
+		  s(7,1) = 22.3512; s(7,2) = -18.5856 ;
+		  s(8,1) = 8.9496; s(8,2) = -4.4597;
+		  s(9,1) = 2.1519; s(9,2) = 2.3481;
+		  s(10,1) = 2.1519; s(10,2) = 2.3481;
+		  s(11,1) = 3.9 ;
+		  s(12,1) = 3.2 ;
+		%
+		% ocean (please don't modify)
+		  if (~self.issolid(end))
+		%
+		% continental
+		  else
+		  s(13,1) = s(12,1);
+		  end
+		%
+		%
+		  r = r*1e3;
+		  
+		  %- handling the first layer : central sphere
+		  rad = self.radius;
+		  rad(1) = 0.;
+		  
+		  for j = 1:self.numlayers
+		  
+			ro = 0.;
+			vp = 0.;
+			vs = 0.;
+
+			for i = 1:13
+
+				r1 = 0.;
+				r2 = 0.;
+				if ((rad(j) > r(i)) & (rad(j) <= r(i+1))) 
+					if (rad(j+1) <= r(i+1)) 
+						r2 = rad(j+1);
+						r1 = rad(j);
+					else
+						r2 = r(i+1);
+						r1 = rad(j);
+					end
+				elseif (rad(j) <= r(i))
+					if ((rad(j+1) > r(i)) & (rad(j+1) <= r(i+1)))
+						r2 = rad(j+1);
+						r1 = r(i);
+					elseif (rad(j+1) > r(i+1))
+						r2 = r(i+1);
+						r1 = r(i);
+					end
+				end
+
+				t1 = d(i,1)/3.;
+				t2 = d(i,2)/(ra*4.);
+				t3 = d(i,3)/((ra^2)*5.);
+				t4 = d(i,4)/((ra^3)*6.);
+				ro =  ro + t1*(r2^3) + t2*(r2^4) + t3*(r2^5) + t4*(r2^6) - ( t1*(r1^3) + t2*(r1^4) + t3*(r1^5) + t4*(r1^6) );
+					  
+				t1 = p(i,1)/3.;
+				t2 = p(i,2)/(ra*4.);
+				t3 = p(i,3)/((ra^2)*5.);
+				t4 = p(i,4)/((ra^3)*6.);
+				vp =  vp + t1*(r2^3) + t2*(r2^4) + t3*(r2^5) + t4*(r2^6) - ( t1*(r1^3) + t2*(r1^4) + t3*(r1^5) + t4*(r1^6) );
+					  
+				t1 = s(i,1)/3.;
+				t2 = s(i,2)/(ra*4.);
+				t3 = s(i,3)/((ra^2)*5.);
+				t4 = s(i,4)/((ra^3)*6.);
+				vs =  vs + t1*(r2^3) + t2*(r2^4) + t3*(r2^5) + t4*(r2^6) - ( t1*(r1^3) + t2*(r1^4) + t3*(r1^5) + t4*(r1^6) );
+
+			end
+			ro = ro*3 / (rad(j+1)^3-rad(j)^3);
+			vp = vp*3 /(rad(j+1)^3-rad(j)^3);
+			vs = vs*3 / (rad(j+1)^3-rad(j)^3);
+			mu = ro*vs.^2;
+			la = ro*vp.^2 - 2.*mu;
+			ro = ro*1e3;
+			la = la*1e9;
+			mu = mu*1e9;
+
+			self.density(j) = ro;
+			self.lame_lambda(j) = la;
+			self.lame_mu(j) = mu;
+		  end
+
+		end % }}}
 	end
 end
@@ -358,5 +564,5 @@
 	for i=1:length(strnat),
 		switch strnat{i},
-			case 'damageice'
+		case 'damageice'
 			intnat(i)=1;
 		case 'estar'
Index: /issm/trunk/src/m/classes/materials.py
===================================================================
--- /issm/trunk/src/m/classes/materials.py	(revision 26743)
+++ /issm/trunk/src/m/classes/materials.py	(revision 26744)
@@ -8,14 +8,13 @@
 
 class materials(object):
-    '''
-    MATERIALS class definition
-
-       Usage:
-          materials = materials()
-    '''
+    """MATERIALS class definition
+
+    Usage:
+        materials = materials()
+    """
 
     def __init__(self, *args): #{{{
         self.nature = []
-        if not len(args):
+        if len(args) == 0:
             self.nature = ['ice']
         else:
@@ -26,148 +25,188 @@
                 raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
 
-        #start filling in the dynamic fields:
-        for i in range(len(self.nature)):
-            nat = self.nature[i]
-            if nat == 'ice':
-                setattr(self, 'rho_ice', 0)
-                setattr(self, 'rho_water', 0)
-                setattr(self, 'rho_freshwater', 0)
-                setattr(self, 'mu_water', 0)
-                setattr(self, 'heatcapacity', 0)
-                setattr(self, 'latentheat', 0)
-                setattr(self, 'thermalconductivity', 0)
-                setattr(self, 'temperateiceconductivity', 0)
-                setattr(self, 'meltingpoint', 0)
-                setattr(self, 'beta', 0)
-                setattr(self, 'mixed_layer_capacity', 0)
-                setattr(self, 'thermal_exchange_velocity', 0)
-                setattr(self, 'rheology_B', 0)
-                setattr(self, 'rheology_n', 0)
-                setattr(self, 'rheology_law', 0)
-            elif nat == 'litho':
-                setattr(self, 'numlayers', 0)
-                setattr(self, 'radius', 0)
-                setattr(self, 'viscosity', 0)
-                setattr(self, 'lame_lambda', 0)
-                setattr(self, 'lame_mu', 0)
-                setattr(self, 'burgers_viscosity', 0)
-                setattr(self, 'burgers_mu', 0)
-                setattr(self, 'isburgers', 0)
-                setattr(self, 'density', 0)
-                setattr(self, 'issolid', 0)
-            elif nat == 'hydro':
-                setattr(self, 'rho_ice', 0)
-                setattr(self, 'rho_water', 0)
-                setattr(self, 'rho_freshwater', 0)
-                setattr(self, 'earth_density', 0)
+        # Start filling in the dynamic fields (not truly dynamic under Python)
+        for i in range(len(self.nature)):
+            nat = self.nature[i]
+            if nat == 'ice':
+                self.rho_ice = 0
+                self.rho_water = 0
+                self.rho_freshwater = 0
+                self.mu_water = 0
+                self.heatcapacity = 0
+                self.latentheat = 0
+                self.thermalconductivity = 0
+                self.temperateiceconductivity = 0
+                self.effectiveconductivity_averaging = 0
+                self.meltingpoint = 0
+                self.beta = 0
+                self.mixed_layer_capacity = 0
+                self.thermal_exchange_velocity = 0
+                self.rheology_B = 0
+                self.rheology_n = 0
+                self.rheology_law = 0
+            elif nat == 'litho':
+                self.numlayers = 0
+                self.radius = 0
+                self.viscosity = 0
+                self.lame_lambda = 0
+                self.lame_mu = 0
+                self.burgers_viscosity = 0
+                self.burgers_mu = 0
+                self.ebm_alpha = 0
+                self.ebm_delta = 0
+                self.ebm_taul = 0
+                self.ebm_tauh = 0
+                self.rheologymodel = 0
+                self.density = 0
+                self.issolid = 0
+            elif nat == 'hydro':
+                self.rho_ice = 0
+                self.rho_water = 0
+                self.rho_freshwater = 0
             else:
                 raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
-
-        #set default parameters:
+        self.earth_density = 0
+
         self.setdefaultparameters()
     #}}}
 
+    def __repr__(self): #{{{
+        s = '   Materials:\n'
+        for i in range(len(self.nature)):
+            nat = self.nature[i]
+            if nat == 'ice':
+                s += '\n      Ice:\n'
+                s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
+                s += '{}\n'.format(fielddisplay(self, 'rho_water', 'ocean water density [kg/m^3]'))
+                s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
+                s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [N s/m^2]'))
+                s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
+                s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', 'ice thermal conductivity [W/m/K]'))
+                s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
+                s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
+                s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/m^3]'))
+                s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
+                s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/kg/K]'))
+                s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
+                s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/n)]'))
+                s += '{}\n'.format(fielddisplay(self, 'rheology_n', 'Glen\'s flow law exponent'))
+                s += '{}\n'.format(fielddisplay(self, 'rheology_law', 'law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\', \'LliboutryDuval\', \'NyeCO2\', or \'NyeH2O\''))
+            elif nat == 'litho':
+                s += '\n      Litho:\n'
+                s += '{}\n'.format(fielddisplay(self, 'numlayers', 'number of layers (default: 2)'))
+                s += '{}\n'.format(fielddisplay(self, 'radius', 'array describing the radius for each interface (numlayers + 1) [m]'))
+                s += '{}\n'.format(fielddisplay(self, 'viscosity', 'array describing each layer\'s viscosity (numlayers) [Pa.s]'))
+                s += '{}\n'.format(fielddisplay(self, 'lame_lambda', 'array describing the lame lambda parameter (numlayers) [Pa]'))
+                s += '{}\n'.format(fielddisplay(self, 'lame_mu', 'array describing the shear modulus for each layers (numlayers) [Pa]'))
+                s += '{}\n'.format(fielddisplay(self, 'burgers_viscosity', 'array describing each layer\'s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]'))
+                s += '{}\n'.format(fielddisplay(self, 'burgers_mu', 'array describing each layer\'s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]'))
+
+                s += '{}\n'.format(fielddisplay(self, 'ebm_alpha', 'array describing each layer\'s exponent parameter controlling the shape of shear modulus curve between taul and tauh, only for EBM rheology (numlayers)'))
+                s += '{}\n'.format(fielddisplay(self, 'ebm_delta', 'array describing each layer\'s amplitude of the transient relaxation (ratio between elastic rigity to pre-maxwell relaxation rigity), only for EBM rheology (numlayers)'))
+                s += '{}\n'.format(fielddisplay(self, 'ebm_taul', 'array describing each layer\'s starting period for transient relaxation, only for EBM rheology  (numlayers) [s]'))
+                s += '{}\n'.format(fielddisplay(self, 'ebm_tauh', 'array describing each layer''s array describing each layer\'s end period for transient relaxation, only for Burgers rheology (numlayers) [s]'))
+
+                s += '{}\n'.format(fielddisplay(self, 'rheologymodel', 'array describing whether we adopt a Maxwell (0), Burgers (1) or EBM (2) rheology (default: 0)'))
+                s += '{}\n'.format(fielddisplay(self, 'density', 'array describing each layer\'s density (numlayers) [kg/m^3]'))
+                s += '{}\n'.format(fielddisplay(self, 'issolid', 'array describing whether the layer is solid or liquid (default: 1) (numlayers)'))
+            elif nat == 'hydro':
+                s += '\n      Hydro:\n'
+                s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
+                s += '{}\n'.format(fielddisplay(self, 'rho_water', 'ocean water density [kg/m^3]'))
+                s += '{}\n'.format(fielddisplay(self, 'earth_density', 'mantle density [kg/m^3]'))
+                s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
+
+            else:
+                raise RuntimeError('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')')
+        return s
+    #}}}
+
     def setdefaultparameters(self): #{{{
         for i in range(len(self.nature)):
             nat = self.nature[i]
             if nat == 'ice':
-                #ice density (kg/m^3)
-                self.rho_ice = 917.
-                #ocean water density (kg/m^3)
-                self.rho_water = 1023.
-                #fresh water density (kg/m^3)
-                self.rho_freshwater = 1000.
-                #water viscosity (N.s/m^2)
+                # Ice density (kg/m^3)
+                self.rho_ice = 917.0
+
+                # Ocean water density (kg/m^3)
+                self.rho_water = 1023.0
+
+                # Fresh water density (kg/m^3)
+                self.rho_freshwater = 1000.0
+
+                # Water viscosity (N.s/m^2)
                 self.mu_water = 0.001787
-                #ice heat capacity cp (J/kg/K)
-                self.heatcapacity = 2093.
-                #ice latent heat of fusion L (J / kg)
-                self.latentheat = 3.34e5
-                #ice thermal conductivity (W/m/K)
+
+                # Ice heat capacity cp (J/kg/K)
+                self.heatcapacity = 2093.0
+
+                # Ice latent heat of fusion L (J/kg)
+                self.latentheat = 3.34 * 1e5
+
+                # Ice thermal conductivity (W/m/K)
                 self.thermalconductivity = 2.4
-                #wet ice thermal conductivity (W/m/K)
+
+                # Wet ice thermal conductivity (W/m/K)
                 self.temperateiceconductivity = 0.24
-                #the melting point of ice at 1 atmosphere of pressure in K
+
+                # Computation of effective conductivity
+                self.effectiveconductivity_averaging = 1
+
+                # The melting point of ice at 1 atmosphere of pressure in K
                 self.meltingpoint = 273.15
-                #rate of change of melting point with pressure (K/Pa)
-                self.beta = 9.8e-8
-                #mixed layer (ice-water interface) heat capacity (J/kg/K)
-                self.mixed_layer_capacity = 3974.
-                #thermal exchange velocity (ice-water interface) (m/s)
-                self.thermal_exchange_velocity = 1.00e-4
-                #Rheology law: what is the temperature dependence of B with T
-                #available: none, paterson and arrhenius
+
+                # Rate of change of melting point with pressure (K/Pa)
+                self.beta = 9.8 * 1e-8
+
+                # Mixed layer (ice-water interface) heat capacity (J/kg/K)
+                self.mixed_layer_capacity = 3974.0
+
+                # Thermal exchange velocity (ice-water interface) (m/s)
+                self.thermal_exchange_velocity = 1.00 * 1e-4
+
+                # Rheology law: what is the temperature dependence of B with T
+                # available: none, paterson and arrhenius
                 self.rheology_law = 'Paterson'
-            elif nat == 'litho':
-                #we default to a configuration that enables running GIA solutions using giacaron and / or giaivins.
+
+                # Rheology fields default
+                self.rheology_B = 1 * 1e8
+                self.rheology_n = 3
+            elif nat == 'litho':
+                # We default to a configuration that enables running GIA 
+                # solutions using giacaron and/or giaivins
                 self.numlayers = 2
-                #center of the earth (approximation, must not be 0), then the lab (lithosphere / asthenosphere boundary) then the surface
-                #(with 1d3 to avoid numerical singularities)
-                self.radius = [1e3, 6278e3, 6378e3]
-                self.viscosity = [1e21, 1e40]  #mantle and lithosphere viscosity (respectively) [Pa.s]
-                self.lame_mu = [1.45e11, 6.7e10]  # (Pa)  #lithosphere and mantle shear modulus (respectively) [Pa]
-                self.lame_lambda = self.lame_mu  # (Pa)  #mantle and lithosphere lamba parameter (respectively) [Pa]
+
+                # Center of the earth (approximation, must not be 0), then the 
+                # lab (lithosphere/asthenosphere boundary) then the surface
+                # (with 1d3 to avoid numerical singularities)
+                self.radius = [1e3, 6278 * 1e3, 6378 * 1e3]
+
+                self.viscosity = [1e21, 1e40] # Mantle and lithosphere viscosity (respectively) [Pa.s]
+                self.lame_mu = [1.45 * 1e11, 6.7 * 1e10] # (Pa) # Lithosphere and mantle shear modulus (respectively) [Pa]
+                self.lame_lambda = self.lame_mu # (Pa) # Mantle and lithosphere lamba parameter (respectively) [Pa]
                 self.burgers_viscosity = [np.nan, np.nan]
                 self.burgers_mu = [np.nan, np.nan]
-                self.isburgers = [0, 0]
-                self.density = [5.51e3, 5.50e3]  # (Pa)  #mantle and lithosphere density [kg/m^3]
-                self.issolid = [1, 1]  # is layer solid or liquid.
-            elif nat == 'hydro':
-                #ice density (kg/m^3)
-                self.rho_ice = 917.
-                #ocean water density (kg/m^3)
-                self.rho_water = 1023.
-                #average density of the Earth (kg/m^3)
-                self.earth_density = 5512
-                #fresh water density (kg/m^3)
-                self.rho_freshwater = 1000.
+
+                self.ebm_alpha = [np.nan, np.nan]
+                self.ebm_delta = [np.nan, np.nan]
+                self.ebm_taul = [np.nan, np.nan]
+                self.ebm_tauh = [np.nan, np.nan]
+                self.rheologymodel = [0, 0]
+                self.density = [5.51 * 1e3, 5.50 * 1e3] # (Pa) # Mantle and lithosphere density [kg/m^3]
+                self.issolid = [1, 1] # Is layer solid or liquid?
+            elif nat == 'hydro':
+                # Ice density (kg/m^3)
+                self.rho_ice = 917.0
+
+                # Ocean water density (kg/m^3)
+                self.rho_water = 1023.0
+
+                # Fresh water density (kg/m^3)
+                self.rho_freshwater = 1000.0
             else:
                 raise RuntimeError("materials setdefaultparameters error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
-    #}}}
-
-    def __repr__(self): #{{{
-        string = "   Materials:"
-        for i in range(len(self.nature)):
-            nat = self.nature[i]
-            if nat == 'ice':
-                string = "%s\n%s" % (string, 'Ice:')
-                string = "%s\n%s" % (string, fielddisplay(self, "rho_ice", "ice density [kg/m^3]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "rho_water", "ocean water density [kg/m^3]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "rho_freshwater", "fresh water density [kg/m^3]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "mu_water", "water viscosity [N s/m^2]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "heatcapacity", "heat capacity [J/kg/K]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "thermalconductivity", "ice thermal conductivity [W/m/K]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "temperateiceconductivity", "temperate ice thermal conductivity [W/m/K]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "meltingpoint", "melting point of ice at 1atm in K"))
-                string = "%s\n%s" % (string, fielddisplay(self, "latentheat", "latent heat of fusion [J/m^3]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "beta", "rate of change of melting point with pressure [K/Pa]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "mixed_layer_capacity", "mixed layer capacity [W/kg/K]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "thermal_exchange_velocity", "thermal exchange velocity [m/s]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1/n)]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
-                string = "%s\n%s" % (string, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', or 'NyeH2O'"))
-            elif nat == 'litho':
-                string = "%s\n%s" % (string, 'Litho:')
-                string = "%s\n%s" % (string, fielddisplay(self, 'numlayers', 'number of layers (default 2)'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'radius', 'array describing the radius for each interface (numlayers + 1) [m]'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'viscosity', 'array describing each layer''s viscosity (numlayers) [Pa.s]'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'lame_lambda', 'array describing the lame lambda parameter (numlayers) [Pa]'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'lame_mu', 'array describing the shear modulus for each layers (numlayers) [Pa]'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'burgers_viscosity', 'array describing each layer''s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'burgers_mu', 'array describing each layer''s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'isburgers', 'array describing whether we adopt a MaxWell (0) or Burgers (1) rheology (default 0)'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'density', 'array describing each layer''s density (numlayers) [kg/m^3]'))
-                string = "%s\n%s" % (string, fielddisplay(self, 'issolid', 'array describing whether the layer is solid or liquid (default 1) (numlayers)'))
-            elif nat == 'hydro':
-                string = "%s\n%s" % (string, 'Hydro:')
-                string = "%s\n%s" % (string, fielddisplay(self, "rho_ice", "ice density [kg/m^3]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "rho_water", "ocean water density [kg/m^3]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "earth_density", "mantle density [kg/m^3]"))
-                string = "%s\n%s" % (string, fielddisplay(self, "rho_freshwater", "fresh water density [kg/m^3]"))
-
-            else:
-                raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
-
-        return string
+
+            # Average density of the Earth (kg/m^3)
+            self.earth_density = 5512
     #}}}
 
@@ -194,18 +233,24 @@
                 md = checkfield(md, 'fieldname', 'materials.density', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>', 0)
                 md = checkfield(md, 'fieldname', 'materials.viscosity', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
-                md = checkfield(md, 'fieldname', 'materials.isburgers', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0, '<=', 1)
+                md = checkfield(md, 'fieldname', 'materials.rheologymodel', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0, '<=', 2)
                 md = checkfield(md, 'fieldname', 'materials.burgers_viscosity', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
                 md = checkfield(md, 'fieldname', 'materials.burgers_mu', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
+                md = checkfield(md, 'fieldname', 'materials.ebm_alpha', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
+                md = checkfield(md, 'fieldname', 'materials.ebm_delta', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
+                md = checkfield(md, 'fieldname', 'materials.ebm_taul', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
+                md = checkfield(md, 'fieldname', 'materials.ebm_tauh', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
 
                 for i in range(md.materials.numlayers):
-                    if md.materials.isburgers[i] and (np.isnan(md.materials.burgers_viscosity[i] or np.isnan(md.materials.burgers_mu[i]))):
-                        raise RuntimeError("materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with isburgers choice")
-
-                    if md.materials.issolid[0] == 0 or md.materials.lame_mu[0] == 0:
-                        raise RuntimeError('First layer must be solid (issolid(1) > 0 AND lame_mu(1) > 0). Add a weak inner core if necessary.')
-
-                    for i in range(md.materials.numlayers - 1):
-                        if (not md.materials.issolid[i]) and (not md.materials.issolid[i + 1]):  #if there are at least two consecutive indices that contain issolid = 0
-                            raise RuntimeError("%s%i%s" % ('2 or more adjacent fluid layers detected starting at layer ', i, '. This is not supported yet. Consider merging them.'))
+                    if md.materials.rheologymodel[i] == 1 and (np.isnan(md.materials.burgers_viscosity[i] or np.isnan(md.materials.burgers_mu[i]))):
+                        raise RuntimeError('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with rheologymodel choice')
+
+                    if md.materials.rheologymodel[i] == 2 and (np.isnan(md.materials.ebm_alpha[i]) or np.isnan(md.materials.ebm_delta[i]) or np.isnan(md.materials.ebm_taul[i]) or np.isnan(md.materials.ebm_tauh[i])):
+                        raise RuntimeError('materials checkconsistency error message: Litho ebm_alpha, ebm_delta, ebm_taul or ebm_tauh has NaN values, inconsistent with rheologymodel choice')
+                if md.materials.issolid[0] == 0 or md.materials.lame_mu[0] == 0:
+                    raise RuntimeError('First layer must be solid (issolid[0] > 0 AND lame_mu[0] > 0). Add a weak inner core if necessary.')
+                ind = np.where(md.materials.issolid == 0)[0]
+                if np.sum(np.in1d(np.diff(ind),1) >= 1): # If there are at least two consecutive indices that contain issolid = 0
+                    raise RuntimeError('Fluid layers detected at layers #' + indices + ', but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.')
+
             elif nat == 'hydro':
                 md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
@@ -214,5 +259,5 @@
                 md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
             else:
-                raise RuntimeError("materials checkconsistency error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
+                raise RuntimeError('materials checkconsistency error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')')
 
         return md
@@ -222,10 +267,8 @@
         #1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
         WriteData(fid, prefix, 'name', 'md.materials.nature', 'data', naturetointeger(self.nature), 'format', 'IntMat', 'mattype', 3)
-        WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 5, 'format', 'Integer') #DANGER, this can evolve if you have classes
-
-        for i in range(len(self.nature)):
-            nat = self.nature[i]
-            if nat == 'ice':
-                WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 3, 'format', 'Integer')
+        WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 5, 'format', 'Integer') #DANGER: this can evolve if you have classes
+        for i in range(len(self.nature)):
+            nat = self.nature[i]
+            if nat == 'ice':
                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
@@ -236,4 +279,5 @@
                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double')
                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double')
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'effectiveconductivity_averaging', 'format', 'Integer')
                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double')
                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double')
@@ -251,14 +295,24 @@
                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'density', 'format', 'DoubleMat', 'mattype', 3)
                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'viscosity', 'format', 'DoubleMat', 'mattype', 3)
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'isburgers', 'format', 'DoubleMat', 'mattype', 3)
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheologymodel', 'format', 'DoubleMat', 'mattype', 3) 
                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'burgers_viscosity', 'format', 'DoubleMat', 'mattype', 3)
                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'burgers_mu', 'format', 'DoubleMat', 'mattype', 3)
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'ebm_alpha', 'format', 'DoubleMat', 'mattype', 3)
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'ebm_delta', 'format', 'DoubleMat', 'mattype', 3)
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'ebm_taul', 'format', 'DoubleMat', 'mattype', 3)
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'ebm_tauh', 'format', 'DoubleMat', 'mattype', 3)
+                # Compute earth density compatible with our layer density distribution
+                earth_density = 0
+                for i in range(self.numlayers):
+                    earth_density = earth_density + (pow(self.radius[i + 1], 3) - pow(self.radius[i], 3)) * self.density[i]
+                earth_density = earth_density / pow(self.radius[self.numlayers], 3)
+                self.earth_density = earth_density
             elif nat == 'hydro':
                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double')
             else:
-                raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
+                raise RuntimeError('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')')
+        WriteData(fid, prefix, 'data', self.earth_density, 'name', 'md.materials.earth_density', 'format', 'Double')
     #}}}
 
@@ -277,20 +331,21 @@
 
     for i in range(len(intnat)):
-        if strnat[i] == 'damageice':
+        str_nat = strnat[i]
+        if str_nat == 'damageice':
             intnat[i] = 1
-        elif strnat[i] == 'estar':
+        elif str_nat == 'estar':
             intnat[i] = 2
-        elif strnat[i] == 'ice':
+        elif str_nat == 'ice':
             intnat[i] = 3
-        elif strnat[i] == 'enhancedice':
+        elif str_nat == 'enhancedice':
             intnat[i] = 4
-        # elif strnat[i] == 'materials':
+        # elif str_nat == 'materials':
         #     intnat[i] = 5 #this case will never happen, kept to ensure equivalent of codes between IoCodeToMeterialsEnum and IoCodeToNatureEnum
-        elif strnat[i] == 'litho':
+        elif str_nat == 'litho':
             intnat[i] = 6
-        elif strnat[i] == 'hydro':
+        elif str_nat == 'hydro':
             intnat[i] = 7
         else:
-            raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
+            raise RuntimeError('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')')
 
     return intnat
Index: /issm/trunk/src/m/classes/matestar.m
===================================================================
--- /issm/trunk/src/m/classes/matestar.m	(revision 26743)
+++ /issm/trunk/src/m/classes/matestar.m	(revision 26744)
@@ -6,30 +6,24 @@
 classdef matestar
 	properties (SetAccess=public) 
-		rho_ice                    = 0.;
-		rho_water                  = 0.;
-		rho_freshwater             = 0.;
-		mu_water                   = 0.;
-		heatcapacity               = 0.;
-		latentheat                 = 0.;
-		thermalconductivity        = 0.;
-		temperateiceconductivity   = 0.;
+		rho_ice                         = 0.;
+		rho_water                       = 0.;
+		rho_freshwater                  = 0.;
+		mu_water                        = 0.;
+		heatcapacity                    = 0.;
+		latentheat                      = 0.;
+		thermalconductivity             = 0.;
+		temperateiceconductivity        = 0.;
 		effectiveconductivity_averaging = 0;
-		meltingpoint               = 0.;
-		beta                       = 0.;
-		mixed_layer_capacity       = 0.;
-		thermal_exchange_velocity  = 0.;
-		rheology_B    = NaN;
-		rheology_Ec   = NaN;
-		rheology_Es   = NaN;
-		rheology_law = '';
+		meltingpoint                    = 0.;
+		beta                            = 0.;
+		mixed_layer_capacity            = 0.;
+		thermal_exchange_velocity       = 0.;
+		rheology_B                      = NaN;
+		rheology_Ec                     = NaN;
+		rheology_Es                     = NaN;
+		rheology_law                    = '';
 
-		%giaivins: 
-		lithosphere_shear_modulus  = 0.;
-		lithosphere_density        = 0.;
-		mantle_shear_modulus       = 0.;
-		mantle_density             = 0.;
-
-		%slr
-		earth_density              = 0;
+		%SLC
+		earth_density                   = 0;
 
 	end
@@ -93,5 +87,5 @@
 			%computation of effective conductivity
 			self.effectiveconductivity_averaging=1;
-            
+
 			%the melting point of ice at 1 atmosphere of pressure in K
 			self.meltingpoint=273.15;
@@ -110,12 +104,6 @@
 			self.rheology_law='Paterson';
 
-			% GIA:
-			self.lithosphere_shear_modulus  = 6.7*10^10;  % (Pa)
-			self.lithosphere_density        = 3.32;       % (g/cm^-3)
-			self.mantle_shear_modulus       = 1.45*10^11; % (Pa)
-			self.mantle_density             = 3.34;       % (g/cm^-3)
-
-			%SLR
-			self.earth_density= 5512;  % average density of the Earth, (kg/m^3)
+			%SLC
+			self.earth_density= 5512; % average density of the Earth, (kg/m^3)
 
 		end % }}}
@@ -130,12 +118,6 @@
 			md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval'});
 			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
-            
-			if ismember('GiaAnalysis',analyses),
-				md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
-				md = checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1);
-				md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
-				md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
-			end
-			if ismember('SealevelriseAnalysis',analyses),
+
+			if ismember('SealevelchangeAnalysis',analyses),
 				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
 			end
@@ -162,8 +144,4 @@
 			fielddisplay(self,'rheology_Es','shear enhancement factor');
 			fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', ''Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval''']);
-			fielddisplay(self,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
-			fielddisplay(self,'lithosphere_density','Lithosphere density [g/cm^-3]');
-			fielddisplay(self,'mantle_shear_modulus','Mantle shear modulus [Pa]');
-			fielddisplay(self,'mantle_density','Mantle density [g/cm^-3]');
 			fielddisplay(self,'earth_density','Mantle density [kg/m^-3]');
 		end % }}}
@@ -188,8 +166,4 @@
 			WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String');
 
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3);
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10^3);
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
 		end % }}}
@@ -214,8 +188,4 @@
 			writejs1Darray(fid,[modelname '.materials.rheology_Es'],self.rheology_Es);
 			writejsstring(fid,[modelname '.materials.rheology_law'],self.rheology_law);
-			writejsdouble(fid,[modelname '.materials.lithosphere_shear_modulus'],self.lithosphere_shear_modulus);
-			writejsdouble(fid,[modelname '.materials.lithosphere_density'],self.lithosphere_density);
-			writejsdouble(fid,[modelname '.materials.mantle_shear_modulus'],self.mantle_shear_modulus);
-			writejsdouble(fid,[modelname '.materials.mantle_density'],self.mantle_density);
 			writejsdouble(fid,[modelname '.materials.earth_density'],self.earth_density);
 
Index: /issm/trunk/src/m/classes/matestar.py
===================================================================
--- /issm/trunk/src/m/classes/matestar.py	(revision 26743)
+++ /issm/trunk/src/m/classes/matestar.py	(revision 26744)
@@ -8,12 +8,11 @@
 
 class matestar(object):
-    '''
-    MATESTAR class definition
+    """MATESTAR class definition
 
-        Usage:
-            matestar = matestar()
-    '''
+    Usage:
+        matestar = matestar()
+    """
 
-    def __init__(self): #{{{
+    def __init__(self):  # {{{
         self.rho_ice = 0.
         self.rho_water = 0.
@@ -34,46 +33,36 @@
         self.rheology_law = ''
 
-        #GIA
-        self.lithosphere_shear_modulus = 0.
-        self.lithosphere_density = 0.
-        self.mantle_shear_modulus = 0.
-        self.mantle_density = 0.
-
-        #SLR
+        # SLC
         self.earth_density = 0
 
-        #set default parameters
+        # Set default parameters
         self.setdefaultparameters()
-    #}}}
+    # }}}
 
-    def __repr__(self): #{{{
-        s = "   Materials:"
-        s = "%s\n%s" % (s, fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'rho_water', 'ocean water density [kg/m^3]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'mu_water', 'water viscosity [N s/m^2]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'thermalconductivity', ['ice thermal conductivity [W/m/K]']))
-        s = "%s\n%s" % (s, fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
-        s = "%s\n%s" % (s, fielddisplay(self, "effectiveconductivity_averaging", "computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
-        s = "%s\n%s" % (s, fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'latentheat', 'latent heat of fusion [J / kg]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/kg/K]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/3)]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'rheology_Ec', 'compressive enhancement factor'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'rheology_Es', 'shear enhancement factor'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'rheology_law', ['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', ''Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval''']))
-        s = "%s\n%s" % (s, fielddisplay(self, 'lithosphere_shear_modulus', 'Lithosphere shear modulus [Pa]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'lithosphere_density', 'Lithosphere density [g/cm^-3]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'mantle_shear_modulus', 'Mantle shear modulus [Pa]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'mantle_density', 'Mantle density [g/cm^-3]'))
-        s = "%s\n%s" % (s, fielddisplay(self, 'earth_density', 'Mantle density [kg/m^-3]'))
+    def __repr__(self):  # {{{
+        s = '   Materials:\n'
+        s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'rho_water', 'ocean water density [kg/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [N s/m^2]'))
+        s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
+        s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', ['ice thermal conductivity [W/m/K]']))
+        s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
+        s += '{}\n'.format(fielddisplay(self, "effectiveconductivity_averaging", "computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
+        s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
+        s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/kg]'))
+        s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
+        s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/kg/K]'))
+        s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
+        s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/3)]'))
+        s += '{}\n'.format(fielddisplay(self, 'rheology_Ec', 'compressive enhancement factor'))
+        s += '{}\n'.format(fielddisplay(self, 'rheology_Es', 'shear enhancement factor'))
+        s += '{}\n'.format(fielddisplay(self, 'rheology_law', ['law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\' or \'LliboutryDuval\'']))
+        s += '{}\n'.format(fielddisplay(self, 'earth_density', 'Mantle density [kg/m^-3]'))
 
         return s
-    #}}}
+    # }}}
 
-    def extrude(self, md): #{{{
+    def extrude(self, md):  # {{{
         self.rheology_B = project3d(md, 'vector', self.rheology_B, 'type', 'node')
         self.rheology_Ec = project3d(md, 'vector', self.rheology_Ec, 'type', 'node')
@@ -81,48 +70,43 @@
 
         return self
-    #}}}
+    # }}}
 
-    def setdefaultparameters(self): #{{{
-        #ice density (kg / m^3)
-        self.rho_ice = 917.
-        #ocean water density (kg / m^3)
-        self.rho_water = 1023.
-        #fresh water density (kg / m^3)
-        self.rho_freshwater = 1000.
-        #water viscosity (N.s / m^2)
+    def setdefaultparameters(self):  # {{{
+        # Ice density (kg/m^3)
+        self.rho_ice = 917.0
+        # Ocean water density (kg/m^3)
+        self.rho_water = 1023.0
+        # Fresh water density (kg/m^3)
+        self.rho_freshwater = 1000.0
+        # Water viscosity (N.s/m^2)
         self.mu_water = 0.001787
-        #ice heat capacity cp (J / kg / K)
-        self.heatcapacity = 2093.
-        #ice latent heat of fusion L (J / kg)
-        self.latentheat = 3.34e5
-        #ice thermal conductivity (W / m / K)
+        # Ice heat capacity cp (J/kg/K)
+        self.heatcapacity = 2093.0
+        # Ice latent heat of fusion L (J/kg)
+        self.latentheat = 3.34 * pow(10, 5)
+        # Ice thermal conductivity (W/m/K)
         self.thermalconductivity = 2.4
-        #wet ice thermal conductivity (W / m / K)
+        # Wet ice thermal conductivity (W/m/K)
         self.temperateiceconductivity = 0.24
-        #computation of effective conductivity
+        # Computation of effective conductivity
         self.effectiveconductivity_averaging = 1
-        #the melting point of ice at 1 atmosphere of pressure in K
+        # The melting point of ice at 1 atmosphere of pressure in K
         self.meltingpoint = 273.15
-        #rate of change of melting point with pressure (K / Pa)
-        self.beta = 9.8e-8
-        #mixed layer (ice-water interface) heat capacity (J / kg / K)
-        self.mixed_layer_capacity = 3974.
-        #thermal exchange velocity (ice-water interface) (m / s)
-        self.thermal_exchange_velocity = 1.00e-4
-        #Rheology law: what is the temperature dependence of B with T
-        #available: none, paterson and arrhenius
+        # Rate of change of melting point with pressure (K/Pa)
+        self.beta = 9.8 * pow(10, -8)
+        # Mixed layer (ice-water interface) heat capacity (J/kg/K)
+        self.mixed_layer_capacity = 3974.0
+        # Thermal exchange velocity (ice-water interface) (m/s)
+        self.thermal_exchange_velocity = 1.00 * pow(10, -4)
+        # Rheology law: what is the temperature dependence of B with T
+        # available: none, paterson and arrhenius
         self.rheology_law = 'Paterson'
-        # GIA
-        self.lithosphere_shear_modulus = 6.7e10  # (Pa)
-        self.lithosphere_density = 3.32  # (g / cm^ - 3)
-        self.mantle_shear_modulus = 1.45e11  # (Pa)
-        self.mantle_density = 3.34  # (g / cm^ - 3)
-        #SLR
-        self.earth_density = 5512  # average density of the Earth, (kg / m^3)
+        # SLC
+        self.earth_density = 5512 # average density of the Earth (kg/m^3)
 
         return self
-    #}}}
+    # }}}
 
-    def checkconsistency(self, md, solution, analyses): #{{{
+    def checkconsistency(self, md, solution, analyses):  # {{{
         md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
         md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
@@ -135,11 +119,5 @@
         md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
 
-        if 'GiaAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', 1)
-            md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', 1)
-
-        if 'SealevelriseAnalysis' in analyses:
+        if 'SealevelchangeAnalysis' in analyses:
             md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1)
 
@@ -147,5 +125,5 @@
     # }}}
 
-    def marshall(self, prefix, md, fid): #{{{
+    def marshall(self, prefix, md, fid):  # {{{
         WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 2, 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
@@ -166,8 +144,4 @@
         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_Es', 'format', 'DoubleMat', 'mattype', 1)
         WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_shear_modulus', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_density', 'format', 'Double', 'scale', 1.0e3)
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_shear_modulus', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_density', 'format', 'Double', 'scale', 1.0e3)
         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
     # }}}
Index: /issm/trunk/src/m/classes/matice.js
===================================================================
--- /issm/trunk/src/m/classes/matice.js	(revision 26743)
+++ /issm/trunk/src/m/classes/matice.js	(revision 26744)
@@ -2,27 +2,52 @@
 //
 //   Usage:
-//      matice=matice();
+//      matice = new matice();
 
 function matice(){
+	//properties
+	// {{{
+	this.rho_ice							= 0;
+	this.rho_water							= 0;
+	this.rho_freshwater						= 0;
+	this.mu_water							= 0;
+	this.heatcapacity						= 0;
+	this.latentheat							= 0;
+	this.thermalconductivity				= 0;
+	this.temperateiceconductivity			= 0;
+	this.effectiveconductivity_averaging	= 0;
+	this.meltingpoint						= 0;
+	this.beta								= 0;
+	this.mixed_layer_capacity				= 0;
+	this.thermal_exchange_velocity			= 0;
+	this.rheology_B							= NaN;
+	this.rheology_n							= NaN;
+	this.rheology_law						= '';
+
+	//SLC
+	this.earth_density= 5512; // average density of the Earth, (kg/m^3)
+
+	this.setdefaultparameters();
+	//}}}
+
 	//methods
 	this.setdefaultparameters = function(){ // {{{
 
 		//ice density (kg/m^3)
-		this.rho_ice=917.;
+		this.rho_ice=917;
 
 		//ocean water density (kg/m^3)
-		this.rho_water=1023.;
+		this.rho_water=1023;
 
 		//fresh water density (kg/m^3)
-		this.rho_freshwater=1000.;
+		this.rho_freshwater=1000;
 
 		//water viscosity (N.s/m^2)
-		this.mu_water=0.001787;  
+		this.mu_water=0.001787;
 
 		//ice heat capacity cp (J/kg/K)
-		this.heatcapacity=2093.;
+		this.heatcapacity=2093;
 
 		//ice latent heat of fusion L (J/kg)
-		this.latentheat=3.34*Math.pow(10,5);
+		this.latentheat=3.34*Math.pow(10, 5);
 
 		//ice thermal conductivity (W/m/K)
@@ -32,15 +57,18 @@
 		this.temperateiceconductivity=.24;
 
+		//computation of effective conductivity
+		this.effectiveconductivity_averaging=1;
+
 		//the melting point of ice at 1 atmosphere of pressure in K
 		this.meltingpoint=273.15;
 
 		//rate of change of melting point with pressure (K/Pa)
-		this.beta=9.8*Math.pow(10,-8);
+		this.beta=9.8e-8;
 
 		//mixed layer (ice-water interface) heat capacity (J/kg/K)
-		this.mixed_layer_capacity=3974.;
+		this.mixed_layer_capacity=3974;
 
 		//thermal exchange velocity (ice-water interface) (m/s)
-		this.thermal_exchange_velocity=1.00*Math.pow(10,-4);
+		this.thermal_exchange_velocity=1.00*1e-4;
 
 		//Rheology law: what is the temperature dependence of B with T
@@ -48,12 +76,10 @@
 		this.rheology_law='Paterson';
 
-		// GIA:
-		this.lithosphere_shear_modulus  = 6.7*Math.pow(10,10);  // (Pa)
-		this.lithosphere_density        = 3.32;       // (g/cm^-3)
-		this.mantle_shear_modulus       = 1.45*Math.pow(10,11); // (Pa)
-		this.mantle_density             = 3.34;       // (g/cm^-3)
+		// Rheology for ice
+		this.rheology_B = 2.1 * 1e8
+		this.rheology_n = 3
 
-		//SLR
-		this.earth_density= 5512;  // average density of the Earth, (kg/m^3)
+		//SLC
+		this.earth_density= 5512; // average density of the Earth, (kg/m^3)
 
 
@@ -69,4 +95,5 @@
 		fielddisplay(this,'thermalconductivity','ice thermal conductivity [W/m/K]');
 		fielddisplay(this,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
+		fielddisplay(this,'effectiveconductivity_averaging','computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)');
 		fielddisplay(this,'meltingpoint','melting point of ice at 1atm in K');
 		fielddisplay(this,'latentheat','latent heat of fusion [J/kg]');
@@ -75,10 +102,6 @@
 		fielddisplay(this,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
 		fielddisplay(this,'rheology_B','flow law parameter [Pa s^(1/n)]');
-		fielddisplay(this,'rheology_n',"Glen's flow law exponent");
-		fielddisplay(this,'rheology_law',"law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius','LliboutryDuval','NyeH2O', or 'NyeCO2'");
-		fielddisplay(this,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
-		fielddisplay(this,'lithosphere_density','Lithosphere density [g/cm^-3]');
-		fielddisplay(this,'mantle_shear_modulus','Mantle shear modulus [Pa]');
-		fielddisplay(this,'mantle_density','Mantle density [g/cm^-3]');
+		fielddisplay(this,'rheology_n','Glen\'s flow law exponent');
+		fielddisplay(this,'rheology_law','law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\', \'LliboutryDuval\', \'NyeH2O\', or \'NyeCO2\'');
 		fielddisplay(this,'earth_density','Mantle density [kg/m^-3]');
 
@@ -90,26 +113,19 @@
 	}//}}}
 	this.classname = function() {// {{{
-		return "matice";
+		return 'matice';
 	} // }}}
 	this.checkconsistency = function(md,solution,analyses) { // {{{
-		checkfield(md,'fieldname','materials.rho_ice','>',0);
-		checkfield(md,'fieldname','materials.rho_water','>',0);
-		checkfield(md,'fieldname','materials.rho_freshwater','>',0);
-		checkfield(md,'fieldname','materials.mu_water','>',0);
-		checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements,1]);
-		checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval','NyeH2O','NyeCO2']);
-
-		if(ArrayAnyEqual(ArrayIsMember('GiaAnalysis',analyses),1)){
-			checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
-			checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1);
-			checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
-			checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
+		if (solution == 'TransientSolution' && md.transient.isslc) {
+			checkfield(md,'fieldname','materials.earth_density','>',0,'numel',[1])
+		} else {
+			checkfield(md,'fieldname','materials.rho_ice','>',0);
+			checkfield(md,'fieldname','materials.rho_water','>',0);
+			checkfield(md,'fieldname','materials.rho_freshwater','>',0);
+			checkfield(md,'fieldname','materials.mu_water','>',0);
+			checkfield(md,'fieldname','materials.rheology_B','>',0,'universal',1,'NaN',1,'Inf',1);
+			checkfield(md,'fieldname','materials.rheology_n','>',0,'universal',1,'NaN',1,'Inf',1);
+			checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval','NyeH2O','NyeCO2']);
+			checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0,1,2])
 		}
-		if (ArrayAnyEqual(ArrayIsMember('SealevelriseAnalysis',analyses),1)){
-			checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
-		}
-
-
 	} // }}}
 	this.marshall=function(md,prefix,fid) { //{{{
@@ -123,15 +139,19 @@
 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermalconductivity','format','Double');
 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','temperateiceconductivity','format','Double');
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','meltingpoint','format','Double');
 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','beta','format','Double');
 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','mixed_layer_capacity','format','Double');
 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+		if ((shape(self.rheology_B)[0] == md.mesh.numberofvertices) || (shape(self.rheology_B)[0] == md.mesh.numberofvertices + 1) or (shape(self.rheology_B)[0] == md.mesh.numberofelements && shape(self.rheology_B)[1] > 1)) {
+			mattype = 1
+			tsl = md.mesh.numberofvertices
+		} else {
+			mattype = 2
+			tsl = md.mesh.numberofelements
+		}
+		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',mattype,'timeserieslength',tsl+1,'yts',md.constants.yts);
 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
 		WriteData(fid,prefix,'data',this.rheology_law,'name','md.materials.rheology_law','format','String');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','lithosphere_density','format','Double','scale',Math.pow(10,3));
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','mantle_shear_modulus','format','Double');
-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','mantle_density','format','Double','scale',Math.pow(10,3));
 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','earth_density','format','Double');
 
@@ -139,32 +159,3 @@
 	this.fix=function() { //{{{
 	}//}}}
-	//properties 
-	// {{{
-		this.rho_ice                    = 0.;
-		this.rho_water                  = 0.;
-		this.rho_freshwater             = 0.;
-		this.mu_water                   = 0.;
-		this.heatcapacity               = 0.;
-		this.latentheat                 = 0.;
-		this.thermalconductivity        = 0.;
-		this.temperateiceconductivity   = 0.;
-		this.meltingpoint               = 0.;
-		this.beta                       = 0.;
-		this.mixed_layer_capacity       = 0.;
-		this.thermal_exchange_velocity  = 0.;
-		this.rheology_B   = NaN;
-		this.rheology_n   = NaN;
-		this.rheology_law = '';
-
-		//giaivins: 
-		this.lithosphere_shear_modulus  = 0.;
-		this.lithosphere_density        = 0.;
-		this.mantle_shear_modulus       = 0.;
-		this.mantle_density             = 0.;
-
-		//SLR
-		this.earth_density= 5512;  // average density of the Earth, (kg/m^3)
-
-		this.setdefaultparameters();
-		//}}}
 }
Index: /issm/trunk/src/m/classes/matice.m
===================================================================
--- /issm/trunk/src/m/classes/matice.m	(revision 26743)
+++ /issm/trunk/src/m/classes/matice.m	(revision 26744)
@@ -6,29 +6,23 @@
 classdef matice
 	properties (SetAccess=public) 
-		rho_ice                    = 0.;
-		rho_water                  = 0.;
-		rho_freshwater             = 0.;
-		mu_water                   = 0.;
-		heatcapacity               = 0.;
-		latentheat                 = 0.;
-		thermalconductivity        = 0.;
-		temperateiceconductivity   = 0.;
+		rho_ice                         = 0.;
+		rho_water                       = 0.;
+		rho_freshwater                  = 0.;
+		mu_water                        = 0.;
+		heatcapacity                    = 0.;
+		latentheat                      = 0.;
+		thermalconductivity             = 0.;
+		temperateiceconductivity        = 0.;
 		effectiveconductivity_averaging = 0.;
-		meltingpoint               = 0.;
-		beta                       = 0.;
-		mixed_layer_capacity       = 0.;
-		thermal_exchange_velocity  = 0.;
-		rheology_B   = NaN;
-		rheology_n   = NaN;
-		rheology_law = '';
+		meltingpoint                    = 0.;
+		beta                            = 0.;
+		mixed_layer_capacity            = 0.;
+		thermal_exchange_velocity       = 0.;
+		rheology_B                      = NaN;
+		rheology_n                      = NaN;
+		rheology_law                    = '';
 
-		%giaivins: 
-		lithosphere_shear_modulus  = 0.;
-		lithosphere_density        = 0.;
-		mantle_shear_modulus       = 0.;
-		mantle_density             = 0.;
-
-		%slr
-		earth_density              = 0;
+		%slc
+		earth_density                   = 0;
 
 	end
@@ -81,5 +75,5 @@
 			%wet ice thermal conductivity (W/m/K)
 			self.temperateiceconductivity=.24;
-			
+
 			%computation of effective conductivity
 			self.effectiveconductivity_averaging=1;
@@ -101,9 +95,7 @@
 			self.rheology_law='Paterson';
 
-			% GIA:
-			self.lithosphere_shear_modulus  = 6.7*10^10;  % (Pa)
-			self.lithosphere_density        = 3.32;       % (g/cm^-3)
-			self.mantle_shear_modulus       = 1.45*10^11; % (Pa)
-			self.mantle_density             = 3.34;       % (g/cm^-3)
+			%Rheology for ice: 
+			self.rheology_B=2.1*1e8;
+			self.rheology_n=3;
 
 			%SLR
@@ -112,6 +104,8 @@
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
-	
-			if ~strcmpi(solution,'SealevelriseSolution'),
+
+			if strcmpi(solution,'TransientSolution') & md.transient.isslc,
+				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
+			else
 				md = checkfield(md,'fieldname','materials.rho_ice','>',0);
 				md = checkfield(md,'fieldname','materials.rho_water','>',0);
@@ -119,17 +113,7 @@
 				md = checkfield(md,'fieldname','materials.mu_water','>',0);
 				md = checkfield(md,'fieldname','materials.rheology_B','>',0,'universal',1,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
+				md = checkfield(md,'fieldname','materials.rheology_n','>',0,'universal',1,'NaN',1,'Inf',1);
 				md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval' 'NyeCO2' 'NyeH2O'});
 				md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
-			end
-
-			if ismember('GiaAnalysis',analyses),
-				md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
-				md = checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1);
-				md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
-				md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
-			end
-			if ismember('SealevelriseAnalysis',analyses),
-				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
 			end
 
@@ -154,8 +138,4 @@
 			fielddisplay(self,'rheology_n','Glen''s flow law exponent');
 			fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'', ''LliboutryDuval'', ''NyeH2O'', or ''NyeCO2''']);
-			fielddisplay(self,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
-			fielddisplay(self,'lithosphere_density','Lithosphere density [g/cm^-3]');
-			fielddisplay(self,'mantle_shear_modulus','Mantle shear modulus [Pa]');
-			fielddisplay(self,'mantle_density','Mantle density [g/cm^-3]');
 			fielddisplay(self,'earth_density','Mantle density [kg/m^-3]');
 		end % }}}
@@ -183,8 +163,4 @@
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3);
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');
-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10^3);
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
 		end % }}}
@@ -208,8 +184,4 @@
 			writejs1Darray(fid,[modelname '.materials.rheology_n'],self.rheology_n);
 			writejsstring(fid,[modelname '.materials.rheology_law'],self.rheology_law);
-			writejsdouble(fid,[modelname '.materials.lithosphere_shear_modulus'],self.lithosphere_shear_modulus);
-			writejsdouble(fid,[modelname '.materials.lithosphere_density'],self.lithosphere_density);
-			writejsdouble(fid,[modelname '.materials.mantle_shear_modulus'],self.mantle_shear_modulus);
-			writejsdouble(fid,[modelname '.materials.mantle_density'],self.mantle_density);
 			writejsdouble(fid,[modelname '.materials.earth_density'],self.earth_density);
 
Index: /issm/trunk/src/m/classes/matice.py
===================================================================
--- /issm/trunk/src/m/classes/matice.py	(revision 26743)
+++ /issm/trunk/src/m/classes/matice.py	(revision 26744)
@@ -8,116 +8,105 @@
 
 class matice(object):
-    '''
-    MATICE class definition
+    """MATICE class definition
 
     Usage:
             matice = matice()
-    '''
+    """
 
-    def __init__(self): #{{{
-        self.rho_ice = 0.
-        self.rho_water = 0.
-        self.rho_freshwater = 0.
-        self.mu_water = 0.
-        self.heatcapacity = 0.
-        self.latentheat = 0.
-        self.thermalconductivity = 0.
-        self.temperateiceconductivity = 0.
+    def __init__(self):  # {{{
+        self.rho_ice = 0
+        self.rho_water = 0
+        self.rho_freshwater = 0
+        self.mu_water = 0
+        self.heatcapacity = 0
+        self.latentheat = 0
+        self.thermalconductivity = 0
+        self.temperateiceconductivity = 0
         self.effectiveconductivity_averaging = 0
-        self.meltingpoint = 0.
-        self.beta = 0.
-        self.mixed_layer_capacity = 0.
-        self.thermal_exchange_velocity = 0.
+        self.meltingpoint = 0
+        self.beta = 0
+        self.mixed_layer_capacity = 0
+        self.thermal_exchange_velocity = 0
         self.rheology_B = np.nan
         self.rheology_n = np.nan
         self.rheology_law = ''
 
-        #giaivins
-        self.lithosphere_shear_modulus = 0.
-        self.lithosphere_density = 0.
-        self.mantle_shear_modulus = 0.
-        self.mantle_density = 0.
+        # SLC
+        self.earth_density = 0
 
-        #slr
-        self.earth_density = 0
         self.setdefaultparameters()
-    #}}}
+    # }}}
 
-    def __repr__(self): #{{{
-        s = "   Materials:"
-        s = "%s\n%s" % (s, fielddisplay(self, "rho_ice", "ice density [kg/m^3]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "rho_water", "water density [kg/m^3]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "rho_freshwater", "fresh water density [kg/m^3]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "mu_water", "water viscosity [Ns/m^2]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "heatcapacity", "heat capacity [J/kg/K]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "thermalconductivity", "ice thermal conductivity [W/m/K]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "temperateiceconductivity", "temperate ice thermal conductivity [W/m/K]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "effectiveconductivity_averaging", "computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
-        s = "%s\n%s" % (s, fielddisplay(self, "meltingpoint", "melting point of ice at 1atm in K"))
-        s = "%s\n%s" % (s, fielddisplay(self, "latentheat", "latent heat of fusion [J/m^3]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "beta", "rate of change of melting point with pressure [K/Pa]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "mixed_layer_capacity", "mixed layer capacity [W/kg/K]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "thermal_exchange_velocity", "thermal exchange velocity [m/s]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1/n)]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
-        s = "%s\n%s" % (s, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', or 'NyeH2O'"))
-        s = "%s\n%s" % (s, fielddisplay(self, "lithosphere_shear_modulus", "Lithosphere shear modulus [Pa]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "lithosphere_density", "Lithosphere density [g/cm^-3]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "mantle_shear_modulus", "Mantle shear modulus [Pa]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "mantle_density", "Mantle density [g/cm^-3]"))
-        s = "%s\n%s" % (s, fielddisplay(self, "earth_density", "Mantle density [kg/m^-3]"))
+    def __repr__(self):  # {{{
+        s = '   Materials:\n'
+        s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'rho_water', 'water density [kg/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [Ns/m^2]'))
+        s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
+        s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', 'ice thermal conductivity [W/m/K]'))
+        s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
+        s += '{}\n'.format(fielddisplay(self, 'effectiveconductivity_averaging', 'computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)'))
+        s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
+        s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
+        s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/kg/K]'))
+        s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
+        s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/n)]'))
+        s += '{}\n'.format(fielddisplay(self, 'rheology_n', 'Glen\'s flow law exponent'))
+        s += '{}\n'.format(fielddisplay(self, 'rheology_law', 'law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\', \'LliboutryDuval\', \'NyeCO2\', or \'NyeH2O\''))
+        s += '{}\n'.format(fielddisplay(self, 'earth_density', 'Mantle density [kg/m^-3]'))
+        return s
+    # }}}
 
-        return s
-    #}}}
-
-    def extrude(self, md): #{{{
+    def extrude(self, md):  # {{{
         self.rheology_B = project3d(md, 'vector', self.rheology_B, 'type', 'node')
         self.rheology_n = project3d(md, 'vector', self.rheology_n, 'type', 'element')
         return self
-    #}}}
+    # }}}
 
-    def setdefaultparameters(self): #{{{
-        #ice density (kg/m^3)
-        self.rho_ice = 917.
-        #ocean water density (kg/m^3)
-        self.rho_water = 1023.
-        #fresh water density (kg/m^3)
-        self.rho_freshwater = 1000.
-        #water viscosity (N.s/m^2)
+    def setdefaultparameters(self):  # {{{
+        # Ice density (kg/m^3)
+        self.rho_ice = 917.0
+        # Ocean water density (kg/m^3)
+        self.rho_water = 1023.0
+        # Fresh water density (kg/m^3)
+        self.rho_freshwater = 1000.0
+        # Water viscosity (N.s/m^2)
         self.mu_water = 0.001787
-        #ice heat capacity cp (J/kg/K)
-        self.heatcapacity = 2093.
-        #ice latent heat of fusion L (J/kg)
-        self.latentheat = 3.34e5
-        #ice thermal conductivity (W/m/K)
+        # Ice heat capacity cp (J/kg/K)
+        self.heatcapacity = 2093.0
+        # Ice latent heat of fusion L (J/kg)
+        self.latentheat = 3.34 * pow(10, 5)
+        # Ice thermal conductivity (W/m/K)
         self.thermalconductivity = 2.4
-        #temperate ice thermal conductivity (W/m/K)
+        # Temperate ice thermal conductivity (W/m/K)
         self.temperateiceconductivity = 0.24
-        #computation of effective conductivity
+        # Computation of effective conductivity
         self.effectiveconductivity_averaging = 1
-        #the melting point of ice at 1 atmosphere of pressure in K
+        # The melting point of ice at 1 atmosphere of pressure in K
         self.meltingpoint = 273.15
-        #rate of change of melting point with pressure (K/Pa)
-        self.beta = 9.8e-8
-        #mixed layer (ice-water interface) heat capacity (J/kg/K)
-        self.mixed_layer_capacity = 3974.
-        #thermal exchange velocity (ice-water interface) (m/s)
-        self.thermal_exchange_velocity = 1.00e-4
-        #Rheology law: what is the temperature dependence of B with T
-        #available: none, paterson and arrhenius
+        # Rate of change of melting point with pressure (K/Pa)
+        self.beta = 9.8 * pow(10, -8)
+        # Mixed layer (ice-water interface) heat capacity (J/kg/K)
+        self.mixed_layer_capacity = 3974.0
+        # Thermal exchange velocity (ice-water interface) (m/s)
+        self.thermal_exchange_velocity = 1.00 * pow(10, -4)
+        # Rheology law: what is the temperature dependence of B with T
+        # available: none, paterson and arrhenius
         self.rheology_law = 'Paterson'
 
-        # GIA:
-        self.lithosphere_shear_modulus = 6.7e10 # (Pa)
-        self.lithosphere_density = 3.32  # (g/cm^-3)
-        self.mantle_shear_modulus = 1.45e11  # (Pa)
-        self.mantle_density = 3.34  # (g/cm^-3)
+        # Rheology for ice
+        self.rheology_B = 2.1 * 1e8
+        self.rheology_n = 3
 
         # SLR
         self.earth_density = 5512  # average density of the Earth, (kg/m^3)
-    #}}}
+    # }}}
 
-    def checkconsistency(self, md, solution, analyses): #{{{
-        if solution != 'SealevelriseSolution':
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if solution == 'TransientSolution' and md.transient.isslc:
+            md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])
+        else:
             md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
             md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
@@ -125,21 +114,12 @@
             md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0)
             md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'universal', 1, 'NaN', 1, 'Inf', 1)
-            md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'size', [md.mesh.numberofelements])
+            md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'universal',1, 'NaN', 1, 'Inf', 1)
             md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', 'NyeH2O'])
             md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
 
-        if 'GiaAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', [1])
-            md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', [1])
+        return md
+    # }}}
 
-        if 'SealevelriseAnalysis' in analyses:
-            md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])
-
-        return md
-    #}}}
-
-    def marshall(self, prefix, md, fid): #{{{
+    def marshall(self, prefix, md, fid):  # {{{
         WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 3, 'format', 'Integer')
         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
@@ -156,11 +136,14 @@
         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mixed_layer_capacity', 'format', 'Double')
         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermal_exchange_velocity', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        # NOTE: We first have to check if we have a NumPy array here
+        if np.size(self.rheology_B)==1 or (((np.shape(self.rheology_B)[0] == md.mesh.numberofvertices) or (np.shape(self.rheology_B)[0] == md.mesh.numberofvertices + 1)) or ((len(np.shape(self.rheology_B)) == 2) and (np.shape(self.rheology_B)[0] == md.mesh.numberofelements) and (np.shape(self.rheology_B)[1] > 1))):
+            mattype = 1
+            tsl = md.mesh.numberofvertices
+        else:
+            mattype = 2
+            tsl = md.mesh.numberofelements
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', mattype, 'timeserieslength', tsl + 1, 'yts', md.constants.yts)
         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2)
         WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_shear_modulus', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_density', 'format', 'Double', 'scale', 10.**3.)
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_shear_modulus', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_density', 'format', 'Double', 'scale', 10.**3.)
         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
-    #}}}
+    # }}}
Index: /issm/trunk/src/m/classes/mesh3dprisms.js
===================================================================
--- /issm/trunk/src/m/classes/mesh3dprisms.js	(revision 26743)
+++ /issm/trunk/src/m/classes/mesh3dprisms.js	(revision 26744)
@@ -23,5 +23,5 @@
 
             if(ArrayAnyEqual(ArrayIsMember(NewArrayFillIncrement(md.mesh.numberofvertices,1,1),ArraySort(ArrayUnique(MatrixToList(md.mesh.elements)))),0)){
-				//md = checkmessage(md,'orphan nodes have been found. Check the mesh outline'); @TODO
+				//checkmessage(md,'orphan nodes have been found. Check the mesh outline'); @TODO
                 md.checkmessage('orphan nodes have been found. Check the mesh outline');
 			}
@@ -127,5 +127,6 @@
         } //}}}
 
-        //properties (SetAccess=public) 
+	//properties 
+	// {{{
         this.x                           = NaN;
         this.y                           = NaN;
@@ -139,5 +140,5 @@
         this.long                        = NaN;
         this.epsg                        = 0;
-		  this.scale_factor                = NaN;
+		this.scale_factor                = NaN;
 
         this.vertexonbase                = NaN;
@@ -161,3 +162,4 @@
         this.extractedvertices           = NaN;
         this.extractedelements           = NaN;
+	//}}}
 }
Index: /issm/trunk/src/m/classes/mesh3dsurface.js
===================================================================
--- /issm/trunk/src/m/classes/mesh3dsurface.js	(revision 26743)
+++ /issm/trunk/src/m/classes/mesh3dsurface.js	(revision 26744)
@@ -87,4 +87,5 @@
 			WriteData(fid,prefix,'object',this,'fieldname','long','format','DoubleMat','mattype',1);
 			WriteData(fid,prefix,'object',this,'fieldname','r','format','DoubleMat','mattype',1);
+			//WriteData(fid,prefix,'object',this,'fieldname','z','format','DoubleMat','mattype',1);
 			WriteData(fid,prefix,'object',this,'fieldname','elements','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'object',this,'fieldname','numberofelements','format','Integer');
@@ -92,5 +93,5 @@
 			WriteData(fid,prefix,'object',this,'fieldname','average_vertex_connectivity','format','Integer');
 			WriteData(fid,prefix,'object',this,'fieldname','vertexonboundary','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',this,'fieldname','segments','format','DoubleMat','mattype',3);
+			//WriteData(fid,prefix,'object',this,'fieldname','segments','format','DoubleMat','mattype',3);
 		}//}}}
 		this.fix=function() { //{{{
Index: /issm/trunk/src/m/classes/mmeadditionalsolidearthsolution.m
===================================================================
--- /issm/trunk/src/m/classes/mmeadditionalsolidearthsolution.m	(revision 26744)
+++ /issm/trunk/src/m/classes/mmeadditionalsolidearthsolution.m	(revision 26744)
@@ -0,0 +1,104 @@
+%MMEADDITIONALSOLIDEARTHSOLUTION class definition
+%
+%   Usage:
+%      addsol=mmeadditionalsolidearthsolution(); where the additional solid earth solutions %                               are based on a multi-model ensemble (ex: Caron et al 2017 statistics) 
+
+classdef mmeadditionalsolidearthsolution < additionalsolidearthsolution 
+	properties (SetAccess=public) 
+		modelid; %index into the multi-model ensemble, each ensemble variable being defined 
+	         %in the father class.
+	end
+	methods
+		function self = mmeadditionalsolidearthsolution(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+			self.setdefaultparameters@additionalsolidearthsolution();
+			self.modelid=0;
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==0), 
+				error('mmeadditionalsolidearthsolution checkconsistency error message: need to run GRD solution if you are supplying a GRD additional pattern solution');
+			end
+
+			seast=length(self.displacementeast);
+			snorth=length(self.displacementnorth);
+			sup=length(self.displacementup);
+			sgeoid=length(self.geoid);
+
+			if (seast-snorth)~=0,
+				error('mmeadditionalsolidearthsolution checkconsistency error message: displacementeast and displacementnorth should be the same size');
+			end
+
+			if (seast-sup)~=0,
+				error('mmeadditionalsolidearthsolution checkconsistency error message: displacementeast and displacementup should be the same size');
+			end
+
+			if (seast-sgeoid)~=0,
+				error('mmeadditionalsolidearthsolution checkconsistency error message: displacementeast and geoid should be the same size');
+			end
+			
+			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',1,'<=',length(self.displacementeast));
+
+			for i=1:seast,
+				md = checkfield(md,'field',self.displacementeast{i},'NaN',1,'Inf',1,'timeseries',1);
+				md = checkfield(md,'field',self.displacementup{i},'NaN',1,'Inf',1,'timeseries',1);
+				md = checkfield(md,'field',self.displacementnorth{i},'NaN',1,'Inf',1,'timeseries',1);
+				md = checkfield(md,'field',self.geoid{i},'NaN',1,'Inf',1,'timeseries',1);
+			end
+
+
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   external: mmeadditionalsolidearth solution:'));
+			self.disp@solidearthsolution();
+			fielddisplay(self,'modelid','index into the multi-model ensemble, determines which field will be used.');
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+			WriteData(fid,prefix,'data',3,'name','md.solidearth.external.nature','format','Integer'); %code 3 for mmeadditionalsolidearthsolution class
+
+			nummodels=length(self.displacementeast);
+			WriteData(fid,prefix,'name','md.solidearth.external.nummodels','data',nummodels,'format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
+
+			%transform our cell array of time series into cell array of time series of rates 
+			for i=1:nummodels,
+				displacementeast=self.displacementeast{i}; 
+				displacementnorth=self.displacementnorth{i}; 
+				displacementup=self.displacementup{i}; 
+				geoid=self.geoid{i}; 
+
+				time=displacementeast(end,:);
+				dt=diff(time,1,2);
+				
+				displacementeast_rate=diff(displacementeast(1:end-1,:),1,2)./dt;
+				displacementnorth_rate=diff(displacementnorth(1:end-1,:),1,2)./dt;
+				displacementup_rate=diff(displacementup(1:end-1,:),1,2)./dt;
+				geoid_rate=diff(geoid(1:end-1,:),1,2)./dt;
+
+				self.displacementeast{i}=displacementeast_rate; 
+				self.displacementnorth{i}=displacementnorth_rate; 
+				self.displacementup{i}=displacementup_rate; 
+				self.geoid{i}=geoid_rate; 
+			end
+			
+			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+			WriteData(fid,prefix,'object',self,'fieldname','displacementup','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+			WriteData(fid,prefix,'object',self,'fieldname','geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+
+		end % }}}
+
+		function savemodeljs(self,fid,modelname) % {{{
+			error('mmeadditionalsolidearthsolution error message: not implemented yet');
+		end % }}}
+		function self = extrude(self,md) % {{{
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/mmeofflinesolidearthsolution.m
===================================================================
--- /issm/trunk/src/m/classes/mmeofflinesolidearthsolution.m	(revision 26744)
+++ /issm/trunk/src/m/classes/mmeofflinesolidearthsolution.m	(revision 26744)
@@ -0,0 +1,103 @@
+%MMEOFFLINESOLIDEARTHSOLUTION class definition
+%
+%   Usage:
+%      addsol=mmeofflinesolidearthsolution(); where the offline solid earth solutions %                               are based on a multi-model ensemble (ex: Caron et al 2017 statistics) 
+
+classdef mmeofflinesolidearthsolution < offlinesolidearthsolution 
+	properties (SetAccess=public) 
+		modelid; %index into the multi-model ensemble, each ensemble variable being defined 
+	         %in the father class.
+	end
+	methods
+		function self = mmeofflinesolidearthsolution(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+			self.setdefaultparameters@offlinesolidearthsolution();
+			self.modelid=0;
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==1), 
+				error('mmeofflinesolidearthsolution checkconsistency error message: trying to run GRD patterns while supplying an offline solution for those patterns!'); 
+			end
+			
+			seast=length(self.displacementeast);
+			snorth=length(self.displacementnorth);
+			sup=length(self.displacementup);
+			sgeoid=length(self.geoid);
+
+			if (seast-snorth)~=0,
+				error('mmeofflinesolidearthsolution checkconsistency error message: displacementeast and displacementnorth should be the same size');
+			end
+
+			if (seast-sup)~=0,
+				error('mmeofflinesolidearthsolution checkconsistency error message: displacementeast and displacementup should be the same size');
+			end
+
+			if (seast-sgeoid)~=0,
+				error('mmeofflinesolidearthsolution checkconsistency error message: displacementeast and geoid should be the same size');
+			end
+			
+			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',1,'<=',length(self.displacementeast));
+
+			for i=1:seast,
+				md = checkfield(md,'field',self.displacementeast{i},'NaN',1,'Inf',1,'timeseries',1);
+				md = checkfield(md,'field',self.displacementup{i},'NaN',1,'Inf',1,'timeseries',1);
+				md = checkfield(md,'field',self.displacementnorth{i},'NaN',1,'Inf',1,'timeseries',1);
+				md = checkfield(md,'field',self.geoid{i},'NaN',1,'Inf',1,'timeseries',1);
+			end
+
+
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   external: mmeofflinesolidearth solution:'));
+			self.disp@solidearthsolution();
+			fielddisplay(self,'modelid','index into the multi-model ensemble, determines which field will be used.');
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+			WriteData(fid,prefix,'data',4,'name','md.solidearth.external.nature','format','Integer'); %code 4 for mmeofflinesolidearthsolution class
+			WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
+			nummodels=length(self.displacementeast);
+			WriteData(fid,prefix,'name','md.solidearth.external.nummodels','data',nummodels,'format','Integer');
+
+			%transform our cell array of time series into cell array of time series of rates 
+			for i=1:nummodels,
+				displacementeast=self.displacementeast{i}; 
+				displacementnorth=self.displacementnorth{i}; 
+				displacementup=self.displacementup{i}; 
+				geoid=self.geoid{i}; 
+
+				time=displacementeast(end,:);
+				dt=diff(time,1,2);
+				
+				displacementeast_rate=diff(displacementeast(1:end-1,:),1,2)./dt;
+				displacementnorth_rate=diff(displacementnorth(1:end-1,:),1,2)./dt;
+				displacementup_rate=diff(displacementup(1:end-1,:),1,2)./dt;
+				geoid_rate=diff(geoid(1:end-1,:),1,2)./dt;
+				barystaticsealevel_rate=diff(barystaticsealevel(1:end-1,:),1,2)./dt;
+
+				self.displacementeast{i}=displacementeast_rate; 
+				self.displacementnorth{i}=displacementnorth_rate; 
+				self.displacementup{i}=displacementup_rate; 
+				self.geoid{i}=geoid_rate; 
+			end
+			
+			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+			WriteData(fid,prefix,'object',self,'fieldname','displacementup','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+			WriteData(fid,prefix,'object',self,'fieldname','geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+
+		end % }}}
+		function savemodeljs(self,fid,modelname) % {{{
+			error('mmeofflinesolidearthsolution error message: not implemented yet');
+		end % }}}
+		function self = extrude(self,md) % {{{
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/model.js
===================================================================
--- /issm/trunk/src/m/classes/model.js	(revision 26743)
+++ /issm/trunk/src/m/classes/model.js	(revision 26744)
@@ -1,780 +1,785 @@
-//MODEL class definition
-//
-//   Usage:
-//      md = new model()
-
-function model () {
+/**
+ * MODEL class definition
+ *
+ * Usage:
+ *     md = new model();
+ *
+ * TODO:
+ * - Convert to ES6 class
+ */
+function model(planet) {
 	//methods
-		this.disp = function() { //{{{
-			console.log(sprintf("class model echo: "));
-			console.log(sprintf("//19s: //-22s -- //s","mesh"            ,"[1x1 " + typeof(this.mesh) + "]","mesh properties"));
-			console.log(sprintf("//19s: //-22s -- //s","mask"            ,"[1x1 " + typeof(this.mask) + "]","defines grounded and floating elements"));
-			console.log(sprintf("//19s: //-22s -- //s","geometry"        ,"[1x1 " + typeof(this.geometry) + "]","surface elevation, bedrock topography, ice thickness,..."));
-			console.log(sprintf("//19s: //-22s -- //s","constants"       ,"[1x1 " + typeof(this.constants) + "]","physical constants"));
-			console.log(sprintf("//19s: //-22s -- //s","smb"             ,"[1x1 " + typeof(this.smb) + "]","surface mass balance"));
-			console.log(sprintf("//19s: //-22s -- //s","basalforcings"   ,"[1x1 " + typeof(this.basalforcings) + "]","bed forcings"));
-			console.log(sprintf("//19s: //-22s -- //s","materials"       ,"[1x1 " + typeof(this.materials) + "]","material properties"));
-			console.log(sprintf("//19s: //-22s -- //s","damage"          ,"[1x1 " + typeof(this.damage) + "]","parameters for damage evolution solution"));
-			console.log(sprintf("//19s: //-22s -- //s","friction"        ,"[1x1 " + typeof(this.friction) + "]","basal friction/drag properties"));
-			console.log(sprintf("//19s: //-22s -- //s","flowequation"    ,"[1x1 " + typeof(this.flowequation) + "]","flow equations"));
-			console.log(sprintf("//19s: //-22s -- //s","timestepping"    ,"[1x1 " + typeof(this.timestepping) + "]","time stepping for trans models"));
-			console.log(sprintf("//19s: //-22s -- //s","initialization"  ,"[1x1 " + typeof(this.initialization) + "]","initial guess/state"));
-			console.log(sprintf("//19s: //-22s -- //s","rifts"           ,"[1x1 " + typeof(this.rifts) + "]","rifts properties"));
-			console.log(sprintf("//19s: //-22s -- //s","slr"             ,"[1x1 " + typeof(this.slr) + "]","slr forcings"));
-			console.log(sprintf("//19s: //-22s -- //s","dsl"             ,"[1x1 " + typeof(this.dsl) + "]","dynamic sea level"));
-			console.log(sprintf("//19s: //-22s -- //s","debug"           ,"[1x1 " + typeof(this.debug) + "]","debugging tools (valgrind, gprof)"));
-			console.log(sprintf("//19s: //-22s -- //s","verbose"         ,"[1x1 " + typeof(this.verbose) + "]","verbosity level in solve"));
-			console.log(sprintf("//19s: //-22s -- //s","settings"        ,"[1x1 " + typeof(this.settings) + "]","settings properties"));
-			console.log(sprintf("//19s: //-22s -- //s","toolkits"        ,"[1x1 " + typeof(this.toolkits) + "]","PETSc options for each solution"));
-			console.log(sprintf("//19s: //-22s -- //s","cluster"         ,"[1x1 " + typeof(this.cluster) + "]","cluster parameters (number of cpus...)"));
-			console.log(sprintf("//19s: //-22s -- //s","balancethickness","[1x1 " + typeof(this.balancethickness) + "]","parameters for balancethickness solution"));
-			console.log(sprintf("//19s: //-22s -- //s","stressbalance"   ,"[1x1 " + typeof(this.stressbalance) + "]","parameters for stressbalance solution"));
-			console.log(sprintf("//19s: //-22s -- //s","groundingline"   ,"[1x1 " + typeof(this.groundingline) + "]","parameters for groundingline solution"));
-			console.log(sprintf("//19s: //-22s -- //s","hydrology"       ,"[1x1 " + typeof(this.hydrology) + "]","parameters for hydrology solution"));
-			console.log(sprintf("//19s: //-22s -- //s","masstransport"   ,"[1x1 " + typeof(this.masstransport) + "]","parameters for masstransport solution"));
-			console.log(sprintf("//19s: //-22s -- //s","thermal"         ,"[1x1 " + typeof(this.thermal) + "]","parameters for thermal solution"));
-			console.log(sprintf("//19s: //-22s -- //s","steadystate"     ,"[1x1 " + typeof(this.steadystate) + "]","parameters for steadystate solution"));
-			console.log(sprintf("//19s: //-22s -- //s","trans"           ,"[1x1 " + typeof(this.trans) + "]","parameters for trans solution"));
-			console.log(sprintf("//19s: //-22s -- //s","levelset"        ,"[1x1 " + typeof(this.levelset) + "]","parameters for moving boundaries (level-set method)"));
-			console.log(sprintf("//19s: //-22s -- //s","calving"         ,"[1x1 " + typeof(this.calving) + "]","parameters for calving"));
-			console.log(sprintf("//19s: //-22s -- //s","gia"             ,"[1x1 " + typeof(this.gia) + "]","parameters for gia solution"));
-			console.log(sprintf("//19s: //-22s -- //s","love"            ,"[1x1 " + typeof(this.love) + "]","parameters for love solution"));
-			console.log(sprintf("//19s: //-22s -- //s","esa"             ,"[1x1 " + typeof(this.esa) + "]","parameters for elastic adjustment solution"));
-			console.log(sprintf("//19s: //-22s -- //s","autodiff"        ,"[1x1 " + typeof(this.autodiff) + "]","automatic differentiation parameters"));
-			console.log(sprintf("//19s: //-22s -- //s","inversion"       ,"[1x1 " + typeof(this.inversion) + "]","parameters for inverse methods"));
-			console.log(sprintf("//19s: //-22s -- //s","qmu"             ,"[1x1 " + typeof(this.qmu) + "]","dakota properties"));
-			console.log(sprintf("//19s: //-22s -- //s","amr"             ,"[1x1 " + typeof(this.amr) + "]","adaptive mesh refinement properties"));
-			console.log(sprintf("//19s: //-22s -- //s","outputdefinition","[1x1 " + typeof(this.outputdefinition) + "]","output definition"));
-			console.log(sprintf("//19s: //-22s -- //s","results"         ,"[1x1 " + typeof(this.results) + "]","model results"));
-			console.log(sprintf("//19s: //-22s -- //s","radaroverlay"    ,"[1x1 " + typeof(this.radaroverlay) + "]","radar image for plot overlay"));
-			console.log(sprintf("//19s: //-22s -- //s","miscellaneous"   ,"[1x1 " + typeof(this.miscellaneous) + "]","miscellaneous fields"));
-		} //}}}
-		this.setdefaultparameters = function () { // {{{
-
-			//initialize subclasses
-			this.mesh             = new mesh2d();
-			this.mask             = new mask();
-			this.constants        = new constants();
-			this.geometry         = new geometry();
-			this.smb              = new SMBforcing();
-			this.basalforcings    = new basalforcings();
-			this.materials        = new matice();
-			this.damage           = new damage();
-			this.friction         = new friction();
-			this.flowequation     = new flowequation();
-			this.timestepping     = new timestepping();
-			this.initialization   = new initialization();
-			this.rifts            = new rifts();
-			this.slr              = new slr();
-			this.dsl              = new dsl();
-
-			this.debug            = new debug();
-			this.verbose          = new verbose();
-			this.settings         = new issmsettings();
-			this.toolkits         = new toolkits();
-			this.cluster          = new local();
-
-			this.balancethickness = new balancethickness();
-			this.stressbalance    = new stressbalance();
-			this.groundingline    = new groundingline();
-			this.hydrology        = new hydrologyshreve();
-			this.masstransport    = new masstransport();
-			this.thermal          = new thermal();
-			this.steadystate      = new steadystate();
-			this.trans            = new trans();
-			this.levelset         = new levelset();
-			this.calving          = new calving();
-			this.gia              = new giaivins();
-			this.love             = new fourierlove();
-			this.esa              = new esa();
-			this.autodiff         = new autodiff();
-			this.inversion        = new inversion();
-			this.qmu              = new qmu();
-			this.amr					 = new amr();
-			this.radaroverlay     = new radaroverlay();
-			this.results          = {};
-			this.outputdefinition = new outputdefinition();
-			this.radaroverlay     = new radaroverlay();
-			this.miscellaneous    = new miscellaneous();
-			this.priv             = new priv();
-		} //}}}
-		this.checkmessage = function(string){ //{{{
-			console.log('model not consistent: ' + string);
-			this.priv.isconsistent=false;
-		} //}}}
-		this.fix = function(){ //{{{
-
-			for (var field in this){
-
-				//Some properties do not need to be fixed
-				if (field == 'results' | field =='radaroverlay' | field == 'toolkits' | field =='cluster' | field == 'priv') continue;
-
-				//Check that current field is a class
-				if(typeof this[field] == 'function'){
-					continue;
+	this.disp = function() { //{{{
+		console.log(sprintf("class model echo: "));
+		console.log(sprintf("//19s: //-22s -- //s","mesh"            ,"[1x1 " + typeof(this.mesh) + "]","mesh properties"));
+		console.log(sprintf("//19s: //-22s -- //s","mask"            ,"[1x1 " + typeof(this.mask) + "]","defines grounded and floating elements"));
+		console.log(sprintf("//19s: //-22s -- //s","geometry"        ,"[1x1 " + typeof(this.geometry) + "]","surface elevation, bedrock topography, ice thickness,..."));
+		console.log(sprintf("//19s: //-22s -- //s","constants"       ,"[1x1 " + typeof(this.constants) + "]","physical constants"));
+		console.log(sprintf("//19s: //-22s -- //s","smb"             ,"[1x1 " + typeof(this.smb) + "]","surface mass balance"));
+		console.log(sprintf("//19s: //-22s -- //s","basalforcings"   ,"[1x1 " + typeof(this.basalforcings) + "]","bed forcings"));
+		console.log(sprintf("//19s: //-22s -- //s","materials"       ,"[1x1 " + typeof(this.materials) + "]","material properties"));
+		console.log(sprintf("//19s: //-22s -- //s","damage"          ,"[1x1 " + typeof(this.damage) + "]","parameters for damage evolution solution"));
+		console.log(sprintf("//19s: //-22s -- //s","friction"        ,"[1x1 " + typeof(this.friction) + "]","basal friction/drag properties"));
+		console.log(sprintf("//19s: //-22s -- //s","flowequation"    ,"[1x1 " + typeof(this.flowequation) + "]","flow equations"));
+		console.log(sprintf("//19s: //-22s -- //s","timestepping"    ,"[1x1 " + typeof(this.timestepping) + "]","time stepping for trans models"));
+		console.log(sprintf("//19s: //-22s -- //s","initialization"  ,"[1x1 " + typeof(this.initialization) + "]","initial guess/state"));
+		console.log(sprintf("//19s: //-22s -- //s","rifts"           ,"[1x1 " + typeof(this.rifts) + "]","rifts properties"));
+		console.log(sprintf("//19s: //-22s -- //s","solidearth"      ,"[1x1 " + typeof(this.solidearth) + "]","solidearth inputs and settings"));
+		console.log(sprintf("//19s: //-22s -- //s","slr"             ,"[1x1 " + typeof(this.slr) + "]","slr forcings"));
+		console.log(sprintf("//19s: //-22s -- //s","dsl"             ,"[1x1 " + typeof(this.dsl) + "]","dynamic sea level"));
+		console.log(sprintf("//19s: //-22s -- //s","debug"           ,"[1x1 " + typeof(this.debug) + "]","debugging tools (valgrind, gprof)"));
+		console.log(sprintf("//19s: //-22s -- //s","verbose"         ,"[1x1 " + typeof(this.verbose) + "]","verbosity level in solve"));
+		console.log(sprintf("//19s: //-22s -- //s","settings"        ,"[1x1 " + typeof(this.settings) + "]","settings properties"));
+		console.log(sprintf("//19s: //-22s -- //s","toolkits"        ,"[1x1 " + typeof(this.toolkits) + "]","PETSc options for each solution"));
+		console.log(sprintf("//19s: //-22s -- //s","cluster"         ,"[1x1 " + typeof(this.cluster) + "]","cluster parameters (number of CPUs...)"));
+		console.log(sprintf("//19s: //-22s -- //s","balancethickness","[1x1 " + typeof(this.balancethickness) + "]","parameters for balancethickness solution"));
+		console.log(sprintf("//19s: //-22s -- //s","stressbalance"   ,"[1x1 " + typeof(this.stressbalance) + "]","parameters for stressbalance solution"));
+		console.log(sprintf("//19s: //-22s -- //s","groundingline"   ,"[1x1 " + typeof(this.groundingline) + "]","parameters for groundingline solution"));
+		console.log(sprintf("//19s: //-22s -- //s","hydrology"       ,"[1x1 " + typeof(this.hydrology) + "]","parameters for hydrology solution"));
+		console.log(sprintf("//19s: //-22s -- //s","masstransport"   ,"[1x1 " + typeof(this.masstransport) + "]","parameters for masstransport solution"));
+		console.log(sprintf("//19s: //-22s -- //s","thermal"         ,"[1x1 " + typeof(this.thermal) + "]","parameters for thermal solution"));
+		console.log(sprintf("//19s: //-22s -- //s","steadystate"     ,"[1x1 " + typeof(this.steadystate) + "]","parameters for steadystate solution"));
+		console.log(sprintf("//19s: //-22s -- //s","transient"       ,"[1x1 " + typeof(this.transient) + "]","parameters for transient solution"));
+		console.log(sprintf("//19s: //-22s -- //s","levelset"        ,"[1x1 " + typeof(this.levelset) + "]","parameters for moving boundaries (level-set method)"));
+		console.log(sprintf("//19s: //-22s -- //s","calving"         ,"[1x1 " + typeof(this.calving) + "]","parameters for calving"));
+		console.log(sprintf("//19s: //-22s -- //s","gia"             ,"[1x1 " + typeof(this.gia) + "]","parameters for gia solution"));
+		console.log(sprintf("//19s: //-22s -- //s","love"            ,"[1x1 " + typeof(this.love) + "]","parameters for love solution"));
+		console.log(sprintf("//19s: //-22s -- //s","esa"             ,"[1x1 " + typeof(this.esa) + "]","parameters for elastic adjustment solution"));
+		console.log(sprintf("//19s: //-22s -- //s","sampling"        ,"[1x1 " + typeof(this.sampling) + "]","parameters for stochastic sampler"));
+		console.log(sprintf("//19s: //-22s -- //s","autodiff"        ,"[1x1 " + typeof(this.autodiff) + "]","automatic differentiation parameters"));
+		console.log(sprintf("//19s: //-22s -- //s","inversion"       ,"[1x1 " + typeof(this.inversion) + "]","parameters for inverse methods"));
+		console.log(sprintf("//19s: //-22s -- //s","qmu"             ,"[1x1 " + typeof(this.qmu) + "]","Dakota properties"));
+		console.log(sprintf("//19s: //-22s -- //s","amr"             ,"[1x1 " + typeof(this.amr) + "]","adaptive mesh refinement properties"));
+		console.log(sprintf("//19s: //-22s -- //s","outputdefinition","[1x1 " + typeof(this.outputdefinition) + "]","output definition"));
+		console.log(sprintf("//19s: //-22s -- //s","results"         ,"[1x1 " + typeof(this.results) + "]","model results"));
+		console.log(sprintf("//19s: //-22s -- //s","radaroverlay"    ,"[1x1 " + typeof(this.radaroverlay) + "]","radar image for plot overlay"));
+		console.log(sprintf("//19s: //-22s -- //s","miscellaneous"   ,"[1x1 " + typeof(this.miscellaneous) + "]","miscellaneous fields"));
+	} //}}}
+	this.setdefaultparameters = function(planet) { // {{{
+		this.mesh             = new mesh2d();
+		this.mask             = new mask();
+
+		this.geometry         = new geometry();
+		this.constants        = new constants();
+		this.smb              = new SMBforcing();
+		this.basalforcings    = new basalforcings();
+		this.materials        = new matice();
+		this.damage           = new damage();
+		this.friction         = new friction();
+		this.flowequation     = new flowequation();
+		this.timestepping     = new timestepping();
+		this.initialization   = new initialization();
+		this.rifts            = new rifts();
+		this.dsl              = new dsl();
+		this.solidearth       = new solidearth(planet);
+
+		this.debug            = new debug();
+		this.verbose          = new verbose();
+		this.settings         = new issmsettings();
+		this.toolkits         = new toolkits();
+		this.cluster          = new local();
+
+		this.balancethickness = new balancethickness();
+		this.stressbalance    = new stressbalance();
+		this.groundingline    = new groundingline();
+		this.hydrology        = new hydrologyshreve();
+		this.masstransport    = new masstransport();
+		this.thermal          = new thermal();
+		this.steadystate      = new steadystate();
+		this.transient        = new transient();
+		this.levelset         = new levelset();
+		this.calving          = new calving();
+		this.frontalforcings  = new frontalforcings();
+		this.love             = new fourierlove();
+		this.esa              = new esa();
+		this.sampling         = new sampling();
+
+		this.autodiff         = new autodiff();
+		this.inversion        = new inversion();
+		this.qmu              = new qmu();
+		this.amr              = new amr();
+		this.results          = {};
+		this.outputdefinition = new outputdefinition();
+		this.radaroverlay     = new radaroverlay();
+		this.miscellaneous    = new miscellaneous();
+		this.priv             = new priv();
+	} //}}}
+	this.checkmessage = function(string){ //{{{
+		console.log('model not consistent: ' + string);
+		this.priv.isconsistent=false;
+	} //}}}
+	this.fix = function(){ //{{{
+
+		for (var field in this){
+
+			//Some properties do not need to be fixed
+			if (field == 'results' | field =='radaroverlay' | field == 'toolkits' | field =='cluster' | field == 'priv') continue;
+
+			//Check that current field is a class
+			if(typeof this[field] == 'function'){
+				continue;
+			}
+
+			//Fix current object
+			this[field].fix(this);
+		}
+
+	} //}}}
+	this.extrude = function(md) { //{{{
+		//EXTRUDE - vertically extrude a 2d mesh
+		//
+		//   vertically extrude a 2d mesh and create corresponding 3d mesh.
+		//   The vertical distribution can:
+		//    - follow a polynomial law
+		//    - follow two polynomial laws, one for the lower part and one for the upper part of the mesh
+		//    - be described by a list of coefficients (between 0 and 1)
+		//   
+		//
+		//   Usage:
+		//      md=extrude(md,numlayers,extrusionexponent);
+		//      md=extrude(md,numlayers,lowerexponent,upperexponent);
+		//      md=extrude(md,listofcoefficients);
+		//
+		//   Example:
+		//      md=extrude(md,15,1.3);
+		//      md=extrude(md,15,1.3,1.2);
+		//      md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1]);
+		//
+		//   See also: MODELEXTRACT, COLLAPSE
+
+		//some checks on list of arguments
+		var argc = arguments.length;
+		var extrusionlist;
+		var numlayers;
+		
+		if ((argc > 4) | (argc < 2)) {
+			error("extrude error message");
+		}
+
+		//Extrude the mesh
+		if (argc==2) { //list of coefficients
+			clist=arguments[0];
+			if (ArrayAnyBelowStrict(clist,0) || ArrayAnyAboveStrict(clist,1)) {
+				error('extrusioncoefficients must be between 0 and 1');
+			}
+			extrusionlist=ArraySort(ArrayUnique(clist.push(0,1)));
+			numlayers=extrusionlist.length;
+		} else if (argc==3) { //one polynomial law
+			if (arguments[1]<=0) {
+				error('extrusionexponent must be >=0');
+			}
+			numlayers=arguments[1];
+			extrusionlist = [];
+			for (var i = 0; i < numlayers; i++) {
+				extrusionlist.push(Math.pow(i/(numlayers-1), arguments[2]));
+			}
+		} else if (argc==4) { //two polynomial laws
+			numlayers=arguments[1];
+			var lowerexp=arguments[2];
+			var upperexp=arguments[3];
+
+			if (arguments[2]<=0 || arguments[3]<=0) {
+				error('lower and upper extrusionexponents must be >=0');
+			}
+
+			var lowerextrusionlist = [];
+			for (var i = 0; i <= 1; i += (2/(numlayers-1))) {
+				lowerextrusionlist.push(Math.pow(i, lowerexp)/2)
+			}
+			var upperextrusionlist = [];
+			for (var i = 0; i <= 1; i += (2/(numlayers-1))) {
+				upperextrusionlist.push(1-Math.pow(i, upperexp)/2)
+			}
+			extrusionlist=ArrayConcat(lowerextrusionlist,upperextrusionlist);
+			extrusionlist=ArraySort(ArrayUnique(extrusionlist.push(1)));
+		}
+
+		if (numlayers<2) {
+			console.error('number of layers should be at least 2');
+		}
+		if (md.mesh.domaintype() === '3D') {
+			console.error('Cannot extrude a 3d mesh (extrude cannot be called more than once)');
+		}
+
+		//Initialize with the 2d mesh
+		var mesh2d = md.mesh;
+		md.mesh=new mesh3dprisms();
+		md.mesh.x                           = mesh2d.x;
+		md.mesh.y                           = mesh2d.y;
+		md.mesh.elements                    = mesh2d.elements;
+		md.mesh.numberofelements            = mesh2d.numberofelements;
+		md.mesh.numberofvertices            = mesh2d.numberofvertices;
+
+		md.mesh.lat                         = mesh2d.lat;
+		md.mesh.long                        = mesh2d.long;
+		md.mesh.epsg                        = mesh2d.epsg;
+		md.mesh.scale_factor                = mesh2d.scale_factor;
+
+		md.mesh.vertexonboundary            = mesh2d.vertexonboundary;
+		md.mesh.vertexconnectivity          = mesh2d.vertexconnectivity;
+		md.mesh.elementconnectivity         = mesh2d.elementconnectivity;
+		md.mesh.average_vertex_connectivity = mesh2d.average_vertex_connectivity;
+
+		md.mesh.extractedvertices           = mesh2d.extractedvertices;
+		md.mesh.extractedelements           = mesh2d.extractedelements;
+
+		var x3d=new Float64Array(); 
+		var y3d=new Float64Array();
+		var z3d=new Float64Array();  //the lower node is on the bed
+		var thickness3d=md.geometry.thickness; //thickness and bed for these nodes
+		var bed3d=md.geometry.base;
+
+		//Create the new layers
+		//Dimensions of x/y/z3d: md.mesh.numberofvertices * numlayers, 1
+		for (var i = 1; i <= numlayers; i++) {
+			x3d=ArrayConcat(x3d, md.mesh.x); 
+			y3d=ArrayConcat(y3d, md.mesh.y); 
+			//nodes are distributed between bed and surface accordingly to the given exponent
+			z3d=ArrayConcat(z3d, FloatFix(thickness3d.map(function(value,index) { return bed3d[index] + value * extrusionlist[i-1]; }), thickness3d.length)); 
+		}
+		var number_nodes3d=x3d.length; //number of 3d nodes for the non extruded part of the mesh
+
+		//Extrude elements 
+		//Create the elements of the 3d mesh for the non extruded part
+		//Dimensions of elements3d: md.mesh.numberofelements * (numlayers - 1), 6
+		var elements3d=[];
+		var elements_prisms=[];
+		for (var i = 1; i < numlayers; i++) {
+			for (var j = 0; j < md.mesh.numberofelements; j++) {
+				elements_prisms = [];
+				for (var k = 0, offset = (i - 1) * md.mesh.numberofvertices; k < 3; k++) {
+					elements_prisms.push(md.mesh.elements[j][k]+offset);
 				}
-
-				//Fix current object
-				this[field].fix(this);
-			}
-
-		} //}}}
-		this.extrude = function(md) { //{{{
-			//EXTRUDE - vertically extrude a 2d mesh
-			//
-			//   vertically extrude a 2d mesh and create corresponding 3d mesh.
-			//   The vertical distribution can:
-			//    - follow a polynomial law
-			//    - follow two polynomial laws, one for the lower part and one for the upper part of the mesh
-			//    - be described by a list of coefficients (between 0 and 1)
-			//   
-			//
-			//   Usage:
-			//      md=extrude(md,numlayers,extrusionexponent);
-			//      md=extrude(md,numlayers,lowerexponent,upperexponent);
-			//      md=extrude(md,listofcoefficients);
-			//
-			//   Example:
-			//      md=extrude(md,15,1.3);
-			//      md=extrude(md,15,1.3,1.2);
-			//      md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1]);
-			//
-			//   See also: MODELEXTRACT, COLLAPSE
-
-			//some checks on list of arguments
-			var argc = arguments.length;
-			var extrusionlist;
-			var numlayers;
-			
-			if ((argc > 4) | (argc < 2)) {
-				throw "extrude error message";
-			}
-
-			//Extrude the mesh
-			if (argc==2) { //list of coefficients
-				clist=arguments[0];
-				if (ArrayAnyBelowStrict(clist,0) || ArrayAnyAboveStrict(clist,1)) {
-					throw 'extrusioncoefficients must be between 0 and 1';
+				for (var k = 0, offset = i * md.mesh.numberofvertices; k < 3; k++) {
+					elements_prisms.push(md.mesh.elements[j][k]+offset);
 				}
-				extrusionlist=ArraySort(ArrayUnique(clist.push(0,1)));
-				numlayers=extrusionlist.length;
-			} else if (argc==3) { //one polynomial law
-				if (arguments[1]<=0) {
-					throw 'extrusionexponent must be >=0';
+				elements3d.push(elements_prisms);
+			}				
+		}
+		number_el3d=elements3d.length; //number of 3d nodes for the non extruded part of the mesh
+
+		//Keep a trace of lower and upper nodes
+		var lowervertex = NewArrayFill(number_nodes3d, NaN);
+		var uppervertex = NewArrayFill(number_nodes3d, NaN);
+		//Set first layer to NaN and start count from 1 at next layer (i = md.mesh.numberofvertices+1)
+		for (var i = md.mesh.numberofvertices, k = 1; i < lowervertex.length; i++, k++) {
+			lowervertex[i] = k;
+		};
+		//Set last layer to NaN and start count from md.mesh.numberofvertices+1 at first layer (i = 1)
+		for (var i = 0, k = md.mesh.numberofvertices+1; i < (numlayers-1)*md.mesh.numberofvertices; i++, k++) {
+			uppervertex[i] = k;
+		};
+		md.mesh.lowervertex=lowervertex;
+		md.mesh.uppervertex=uppervertex;
+
+		//same for lower and upper elements
+		var lowerelements = NewArrayFill(number_el3d, NaN);
+		var upperelements = NewArrayFill(number_el3d, NaN);
+		//Set first layer to NaN and start count from 1 at next layer (i = md.mesh.numberofelements+1)
+		for (var i = md.mesh.numberofelements, k = 1; i < lowerelements.length; i++, k++) {
+			lowerelements[i] = k;
+		};
+		//Set last 2 layers to NaN and start count from md.mesh.numberofvertices+1 at first layer (i = 1)
+		for (var i = 0, k = md.mesh.numberofelements + 1; i < (numlayers-2)*md.mesh.numberofelements; i++, k++) {
+			upperelements[i] = k;
+		};
+		md.mesh.lowerelements=lowerelements;
+		md.mesh.upperelements=upperelements;
+
+		//Save old mesh 
+		md.mesh.x2d=md.mesh.x;
+		md.mesh.y2d=md.mesh.y;
+		md.mesh.elements2d=md.mesh.elements;
+		md.mesh.numberofelements2d=md.mesh.numberofelements;
+		md.mesh.numberofvertices2d=md.mesh.numberofvertices;
+
+		//Build global 3d mesh 
+		md.mesh.elements=elements3d;
+		md.mesh.x=x3d;
+		md.mesh.y=y3d;
+		md.mesh.z=z3d;
+		md.mesh.numberofelements=number_el3d;
+		md.mesh.numberofvertices=number_nodes3d;
+		md.mesh.numberoflayers=numlayers;
+
+		//Ok, now deal with the other fields from the 2d mesh:
+
+		//bedinfo and surface info
+		md.mesh.vertexonbase=project3d(md,'vector',NewArrayFill(md.mesh.numberofvertices2d,1),'type','node','layer',1);
+		md.mesh.vertexonsurface=project3d(md,'vector',NewArrayFill(md.mesh.numberofvertices2d,1),'type','node','layer',md.mesh.numberoflayers);
+		md.mesh.vertexonboundary=project3d(md,'vector',md.mesh.vertexonboundary,'type','node');
+
+		//lat long
+		md.mesh.lat=project3d(md,'vector',md.mesh.lat,'type','node');
+		md.mesh.long=project3d(md,'vector',md.mesh.long,'type','node');
+		md.mesh.scale_factor=project3d(md,'vector',md.mesh.scale_factor,'type','node');
+
+		md.geometry=md.geometry.extrude(md);
+		md.friction=md.friction.extrude(md);
+		md.inversion=md.inversion.extrude(md);
+		md.smb=md.smb.extrude(md);
+		md.initialization=md.initialization.extrude(md);
+
+		md.flowequation=md.flowequation.extrude(md);
+		md.stressbalance=md.stressbalance.extrude(md);
+		md.thermal=md.thermal.extrude(md);
+		md.masstransport=md.masstransport.extrude(md);
+		md.levelset=md.levelset.extrude(md);
+		md.calving=md.calving.extrude(md);
+		md.hydrology = md.hydrology.extrude(md);
+		md.solidearth = md.solidearth.extrude(md);
+
+		//connectivity
+		if (!ArrayAnyNaN(md.mesh.elementconnectivity)) {
+			//md.mesh.elementconnectivity=repmat(md.mesh.elementconnectivity,numlayers-1,1); //Replicate the matrix across numlayers-1 
+			var temparr = [];
+			for (var i = 0; i < numlayers - 1; i++) {
+				temparr = ArrayConcat(temparr, md.mesh.elementconnectivity);
+			}
+			md.mesh.elementconnectivity = temparr;
+	
+			//md.mesh.elementconnectivity(find(md.mesh.elementconnectivity==0))=NaN;
+			var indices = ArrayFind(md.mesh.elementconnectivity, 0);
+			for (var i = 0; i < indices.length; i++) {
+				md.mesh.elementconnectivity[i] = NaN;
+			};
+	
+			for (var i = 2; i < numlayers; i++) {
+				//md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)...
+				//=md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)+md.mesh.numberofelements2d;
+				for (var j = (i-1)*md.mesh.numberofelements2d; j <= (i)*md.mesh.numberofelements2d-1; j++) {
+					for (var k = 0; k < 3; k++) {
+						md.mesh.elementconnectivity[j][k] += md.mesh.numberofelements2d;
+					}
 				}
-				numlayers=arguments[1];
-				extrusionlist = [];
-				for (var i = 0; i < numlayers; i++) {
-					extrusionlist.push(Math.pow(i/(numlayers-1), arguments[2]));
-				}
-			} else if (argc==4) { //two polynomial laws
-				numlayers=arguments[1];
-				var lowerexp=arguments[2];
-				var upperexp=arguments[3];
-
-				if (arguments[2]<=0 || arguments[3]<=0) {
-					throw 'lower and upper extrusionexponents must be >=0';
-				}
-
-				var lowerextrusionlist = [];
-				for (var i = 0; i <= 1; i += (2/(numlayers-1))) {
-					lowerextrusionlist.push(Math.pow(i, lowerexp)/2)
-				}
-				var upperextrusionlist = [];
-				for (var i = 0; i <= 1; i += (2/(numlayers-1))) {
-					upperextrusionlist.push(1-Math.pow(i, upperexp)/2)
-				}
-				extrusionlist=ArrayConcat(lowerextrusionlist,upperextrusionlist);
-				extrusionlist=ArraySort(ArrayUnique(extrusionlist.push(1)));
-			}
-
-			if (numlayers<2) {
-				console.error('number of layers should be at least 2');
-			}
-			if (md.mesh.domaintype() === '3D') {
-				console.error('Cannot extrude a 3d mesh (extrude cannot be called more than once)');
-			}
-
-			//Initialize with the 2d mesh
-			var mesh2d = md.mesh;
-			md.mesh=new mesh3dprisms();
-			md.mesh.x                           = mesh2d.x;
-			md.mesh.y                           = mesh2d.y;
-			md.mesh.elements                    = mesh2d.elements;
-			md.mesh.numberofelements            = mesh2d.numberofelements;
-			md.mesh.numberofvertices            = mesh2d.numberofvertices;
-
-			md.mesh.lat                         = mesh2d.lat;
-			md.mesh.long                        = mesh2d.long;
-			md.mesh.epsg                        = mesh2d.epsg;
-			md.mesh.scale_factor                = mesh2d.scale_factor;
-
-			md.mesh.vertexonboundary            = mesh2d.vertexonboundary;
-			md.mesh.vertexconnectivity          = mesh2d.vertexconnectivity;
-			md.mesh.elementconnectivity         = mesh2d.elementconnectivity;
-			md.mesh.average_vertex_connectivity = mesh2d.average_vertex_connectivity;
-
-			md.mesh.extractedvertices           = mesh2d.extractedvertices;
-			md.mesh.extractedelements           = mesh2d.extractedelements;
-
-			var x3d=new Float64Array(); 
-			var y3d=new Float64Array();
-			var z3d=new Float64Array();  //the lower node is on the bed
-			var thickness3d=md.geometry.thickness; //thickness and bed for these nodes
-			var bed3d=md.geometry.base;
-
-			//Create the new layers
-			//Dimensions of x/y/z3d: md.mesh.numberofvertices * numlayers, 1
-			for (var i = 1; i <= numlayers; i++) {
-				x3d=ArrayConcat(x3d, md.mesh.x); 
-				y3d=ArrayConcat(y3d, md.mesh.y); 
-				//nodes are distributed between bed and surface accordingly to the given exponent
-				z3d=ArrayConcat(z3d, FloatFix(thickness3d.map(function(value,index) { return bed3d[index] + value * extrusionlist[i-1]; }), thickness3d.length)); 
-			}
-			var number_nodes3d=x3d.length; //number of 3d nodes for the non extruded part of the mesh
-
-			//Extrude elements 
-			//Create the elements of the 3d mesh for the non extruded part
-			//Dimensions of elements3d: md.mesh.numberofelements * (numlayers - 1), 6
-			var elements3d=[];
-			var elements_prisms=[];
-			for (var i = 1; i < numlayers; i++) {
-				for (var j = 0; j < md.mesh.numberofelements; j++) {
-					elements_prisms = [];
-					for (var k = 0, offset = (i - 1) * md.mesh.numberofvertices; k < 3; k++) {
-						elements_prisms.push(md.mesh.elements[j][k]+offset);
-					}
-					for (var k = 0, offset = i * md.mesh.numberofvertices; k < 3; k++) {
-						elements_prisms.push(md.mesh.elements[j][k]+offset);
-					}
-					elements3d.push(elements_prisms);
-				}				
-			}
-			number_el3d=elements3d.length; //number of 3d nodes for the non extruded part of the mesh
-
-			//Keep a trace of lower and upper nodes
-			var lowervertex = NewArrayFill(number_nodes3d, NaN);
-			var uppervertex = NewArrayFill(number_nodes3d, NaN);
-			//Set first layer to NaN and start count from 1 at next layer (i = md.mesh.numberofvertices+1)
-			for (var i = md.mesh.numberofvertices, k = 1; i < lowervertex.length; i++, k++) {
-				lowervertex[i] = k;
-			};
-			//Set last layer to NaN and start count from md.mesh.numberofvertices+1 at first layer (i = 1)
-			for (var i = 0, k = md.mesh.numberofvertices+1; i < (numlayers-1)*md.mesh.numberofvertices; i++, k++) {
-				uppervertex[i] = k;
-			};
-			md.mesh.lowervertex=lowervertex;
-			md.mesh.uppervertex=uppervertex;
-
-			//same for lower and upper elements
-			var lowerelements = NewArrayFill(number_el3d, NaN);
-			var upperelements = NewArrayFill(number_el3d, NaN);
-			//Set first layer to NaN and start count from 1 at next layer (i = md.mesh.numberofelements+1)
-			for (var i = md.mesh.numberofelements, k = 1; i < lowerelements.length; i++, k++) {
-				lowerelements[i] = k;
-			};
-			//Set last 2 layers to NaN and start count from md.mesh.numberofvertices+1 at first layer (i = 1)
-			for (var i = 0, k = md.mesh.numberofelements + 1; i < (numlayers-2)*md.mesh.numberofelements; i++, k++) {
-				upperelements[i] = k;
-			};
-			md.mesh.lowerelements=lowerelements;
-			md.mesh.upperelements=upperelements;
-
-			//Save old mesh 
-			md.mesh.x2d=md.mesh.x;
-			md.mesh.y2d=md.mesh.y;
-			md.mesh.elements2d=md.mesh.elements;
-			md.mesh.numberofelements2d=md.mesh.numberofelements;
-			md.mesh.numberofvertices2d=md.mesh.numberofvertices;
-
-			//Build global 3d mesh 
-			md.mesh.elements=elements3d;
-			md.mesh.x=x3d;
-			md.mesh.y=y3d;
-			md.mesh.z=z3d;
-			md.mesh.numberofelements=number_el3d;
-			md.mesh.numberofvertices=number_nodes3d;
-			md.mesh.numberoflayers=numlayers;
-
-			//Ok, now deal with the other fields from the 2d mesh:
-
-			//bedinfo and surface info
-			md.mesh.vertexonbase=project3d(md,'vector',NewArrayFill(md.mesh.numberofvertices2d,1),'type','node','layer',1);
-			md.mesh.vertexonsurface=project3d(md,'vector',NewArrayFill(md.mesh.numberofvertices2d,1),'type','node','layer',md.mesh.numberoflayers);
-			md.mesh.vertexonboundary=project3d(md,'vector',md.mesh.vertexonboundary,'type','node');
-
-			//lat long
-			md.mesh.lat=project3d(md,'vector',md.mesh.lat,'type','node');
-			md.mesh.long=project3d(md,'vector',md.mesh.long,'type','node');
-			md.mesh.scale_factor=project3d(md,'vector',md.mesh.scale_factor,'type','node');
-
-			md.geometry=md.geometry.extrude(md);
-			md.friction=md.friction.extrude(md);
-			md.inversion=md.inversion.extrude(md);
-			md.smb=md.smb.extrude(md);
-			md.initialization=md.initialization.extrude(md);
-
-			md.flowequation=md.flowequation.extrude(md);
-			md.stressbalance=md.stressbalance.extrude(md);
-			md.thermal=md.thermal.extrude(md);
-			md.masstransport=md.masstransport.extrude(md);
-			md.levelset=md.levelset.extrude(md);
-			md.calving=md.calving.extrude(md);
-			md.hydrology = md.hydrology.extrude(md);
-
-			//connectivity
-			if (!ArrayAnyNaN(md.mesh.elementconnectivity)) {
-				//md.mesh.elementconnectivity=repmat(md.mesh.elementconnectivity,numlayers-1,1); //Replicate the matrix across numlayers-1 
-				var temparr = [];
-				for (var i = 0; i < numlayers - 1; i++) {
-					temparr = ArrayConcat(temparr, md.mesh.elementconnectivity);
-				}
-				md.mesh.elementconnectivity = temparr;
+			}
+			md.mesh.elementconnectivity = md.mesh.elementconnectivity.map(function(value) { return (Number.isNaN(value)) ? 0 : value; });
+		}
+
+		md.materials=md.materials.extrude(md);
+		md.damage=md.damage.extrude(md);
+		md.mask=md.mask.extrude(md);
+		md.qmu=md.qmu.extrude(md);
+		md.basalforcings=md.basalforcings.extrude(md);
+
+		//increase connectivity if less than 25:
+		if (md.mesh.average_vertex_connectivity<=25) {
+			md.mesh.average_vertex_connectivity=100;
+		}
+	} //}}}
+	this.extract = function(md,area) { //{{{
+		//extract - extract a model according to an Argus contour or flag list
+		//
+		//   This routine extracts a submodel from a bigger model with respect to a given contour
+		//   md must be followed by the corresponding exp file or flags list
+		//   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
+		//   If user wants every element outside the domain to be 
+		//   extract2d, add '~' to the name of the domain file (ex: '~HO.exp');
+		//   an empty string '' will be considered as an empty domain
+		//   a string 'all' will be considered as the entire domain
+		//
+		//   Usage:
+		//      md2=extract(md,area);
+		//
+		//   Examples:
+		//      md2=extract(md,'Domain.exp');
+		//
+		//   See also: EXTRUDE, COLLAPSE
+
+		//some checks on list of arguments
+		var argc = arguments.length;
+
+		if (!((argc == 2) | (argc == 1))) {
+			error('extract error message: bad usage');
+		}
 		
-				//md.mesh.elementconnectivity(find(md.mesh.elementconnectivity==0))=NaN;
-				var indices = ArrayFind(md.mesh.elementconnectivity, 0);
-				for (var i = 0; i < indices.length; i++) {
-					md.mesh.elementconnectivity[i] = NaN;
-				};
+		//get elements that are inside area
+		flag_elem=FlagElements(this,area);
+
+		if (!ArrayAnyEqual(flag_elem,1)) {
+			error('extracted model is empty!');
+		}
+
+		/*kick out all elements with 3 dirichlets: actually, not so fast, not good for javscript usually.
+		spc_elem=find(~flag_elem);
+		spc_node=sort(unique(md1.mesh.elements(spc_elem,:)));
+		flag=ones(md1.mesh.numberofvertices,1);
+		flag(spc_node)=0;
+		pos=find(sum(flag(md1.mesh.elements),2)==0);
+		flag_elem(pos)=0;*/
+
+		//extracted elements and nodes lists
+		var pos_elem = ArrayFind(flag_elem,1);
+		var dup_nodes= new Array(pos_elem.length*3);
+		for(var i=0;i<pos_elem.length;i++){
+			dup_nodes[3*i]=md.mesh.elements[pos_elem[i]][0]-1;
+			dup_nodes[3*i+1]=md.mesh.elements[pos_elem[i]][1]-1;
+			dup_nodes[3*i+2]=md.mesh.elements[pos_elem[i]][2]-1;
+		}
+		pos_node=ArrayUnique(dup_nodes); pos_node=ArraySort(pos_node);
+
+		//keep track of some fields
+		var numberofvertices1=md.mesh.numberofvertices;
+		var numberofelements1=md.mesh.numberofelements;
+		var numberofvertices2=pos_node.length;
+		var numberofelements2=pos_elem.length;
+		var flag_node=NewArrayFill(numberofvertices1,0);
+		for (var i=0;i<pos_node.length;i++)flag_node[pos_node[i]]=1;
+
+		//Create Pelem and Pnode (transform old nodes in new nodes and same thing for the elements)
+		Pelem=NewArrayFill(numberofelements1,0);
+		for (var i=0;i<numberofelements2;i++) Pelem[pos_elem[i]]=i;
+		Pnode=NewArrayFill(numberofvertices1,0);
+		for (var i=0;i<numberofvertices2;i++) Pnode[pos_node[i]]=i;
+		//renumber the elements (some nodes won't exist anymore)
+		var elements_2=NewArrayFill2D(numberofelements2,3,0);
+		for (var i=0;i<numberofelements2;i++){
+			for (var j=0;j<3;j++){
+				elements_2[i][j]=Pnode[md.mesh.elements[i][j]-1]+1;
+			}
+		}
 		
-				for (var i = 2; i < numlayers; i++) {
-					//md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)...
-					//=md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)+md.mesh.numberofelements2d;
-					for (var j = (i-1)*md.mesh.numberofelements2d; j <= (i)*md.mesh.numberofelements2d-1; j++) {
-						for (var k = 0; k < 3; k++) {
-							md.mesh.elementconnectivity[j][k] += md.mesh.numberofelements2d;
+		/*if isa(md.mesh,'mesh3dprisms'),
+			elements_2(:,4)=Pnode(elements_2(:,4));
+			elements_2(:,5)=Pnode(elements_2(:,5));
+			elements_2(:,6)=Pnode(elements_2(:,6));
+		end
+		*/
+		
+		//OK, now create the new model!
+
+		//take every field from model
+		var md2=md.deepcopy(md);
+		//var md2=new model(); md2.mesh=new mesh3dsurface();
+		
+		//deal with mesh: {{{
+		md2.mesh.numberofvertices=numberofvertices2;
+		md2.mesh.numberofelements=numberofelements2;
+		md2.mesh.elements=elements_2;
+
+		md2.mesh.x=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.x[i]=md.mesh.x[pos_node[i]];
+		md2.mesh.y=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.y[i]=md.mesh.y[pos_node[i]];
+		md2.mesh.z=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.z[i]=md.mesh.z[pos_node[i]];
+		md2.mesh.lat=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.lat[i]=md.mesh.lat[pos_node[i]];
+		md2.mesh.long=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.long[i]=md.mesh.long[pos_node[i]];
+		md2.mesh.r=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.r[i]=md.mesh.r[pos_node[i]];
+		//}}}
+		//deal with geometry: {{{
+		md2.geometry.base=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.base[i]=md.geometry.base[pos_node[i]];
+		md2.geometry.thickness=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.thickness[i]=md.geometry.thickness[pos_node[i]];
+		md2.geometry.surface=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.surface[i]=md.geometry.surface[pos_node[i]];
+		md2.geometry.bed=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.bed[i]=md.geometry.bed[pos_node[i]];
+		//}}}
+
+		//Keep track of pos_node and pos_elem
+		for (var i=0;i<md2.mesh.numberofvertices;i++)pos_node[i]=pos_node[i]+1;
+		for (var i=0;i<md2.mesh.numberofelements;i++)pos_elem[i]=pos_elem[i]+1;
+		md2.mesh.extractedvertices=pos_node;
+		md2.mesh.extractedelements=pos_elem;
+
+		return md2;
+
+		//automatically modify fields
+
+		//loop over model fields
+		//model_fields=fields(md);
+	} //}}}
+	this.collapse = function(md) { //{{{
+		/*
+		 *COLLAPSE - collapses a 3d mesh into a 2d mesh
+		 *
+		 *   This routine collapses a 3d model into a 2d model
+		 *   and collapses all the fileds of the 3d model by
+		 *   taking their depth-averaged values
+		 *
+		 *   Usage:
+		 *	 md=collapse(md)
+		 *
+		 *   See also: EXTRUDE, MODELEXTRACT
+		 */
+
+		// Check that the model is really a 3d model
+		if (md.mesh.elementtype() !== 'Penta') {
+			console.error('collapse error message: only 3d mesh can be collapsed')
+		}
+
+		// Start with changing all the fields from the 3d mesh 
+
+		// dealing with the friction law
+		// drag is limited to nodes that are on the bedrock.
+		if (md.friction.classname() === 'friction') {
+			md.friction.coefficient=project2d(md,md.friction.coefficient,1);
+			md.friction.p=project2d(md,md.friction.p,1);
+			md.friction.q=project2d(md,md.friction.q,1);
+		} else if (md.friction.classname() === 'frictionhydro') {
+			md.friction.q=project2d(md,md.friction.q,1);
+			md.friction.C=project2d(md,md.friction.C,1);
+			md.friction.As=project2d(md,md.friction.As,1);
+			md.friction.effective_pressure=project2d(md,md.friction.effective_pressure,1);
+		} else if (md.friction.classname() === 'frictionwaterlayer') {
+			md.friction.coefficient=project2d(md,md.friction.coefficient,1);
+			md.friction.p=project2d(md,md.friction.p,1);
+			md.friction.q=project2d(md,md.friction.q,1);
+			md.friction.water_layer=project2d(md,md.friction.water_layer,1);
+		} else if (md.friction.classname() === 'frictionweertman') {
+			md.friction.C=project2d(md,md.friction.C,1);
+			md.friction.m=project2d(md,md.friction.m,1);
+		} else if (md.friction.classname() === 'frictionweertmantemp') {
+			md.friction.C=project2d(md,md.friction.C,1);
+			md.friction.m=project2d(md,md.friction.m,1);
+		} else {
+			disp('friction type not supported');
+		}
+
+		// observations
+		if (!Number.isNaN(md.inversion.vx_obs))
+			md.inversion.vx_obs=project2d(md,md.inversion.vx_obs,md.mesh.numberoflayers);
+
+		if (!Number.isNaN(md.inversion.vy_obs))
+			md.inversion.vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers);
+
+		if (!Number.isNaN(md.inversion.vel_obs))
+			md.inversion.vel_obs=project2d(md,md.inversion.vel_obs,md.mesh.numberoflayers);
+
+		if (!Number.isNaN(md.inversion.cost_functions_coefficients))
+			md.inversion.cost_functions_coefficients=project2d(md,md.inversion.cost_functions_coefficients,md.mesh.numberoflayers);
+
+		if (numel(md.inversion.min_parameters)>1)
+			md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers);
+
+		if (numel(md.inversion.max_parameters)>1) 
+			md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers);
+
+		if (md.smb.classname() === 'SMBforcing' && !Number.isNaN(md.smb.mass_balance)) {
+			md.smb.mass_balance=project2d(md,md.smb.mass_balance,md.mesh.numberoflayers);
+		} else if (md.smb.classname() === 'SMBhenning' && !Number.isNaN(md.smb.smbref)) {
+			md.smb.smbref=project2d(md,md.smb.smbref,md.mesh.numberoflayers);
+		}
+
+		// results
+		if (!Number.isNaN(md.initialization.vx))
+			md.initialization.vx=DepthAverage(md,md.initialization.vx);
+		if (!Number.isNaN(md.initialization.vy))
+			md.initialization.vy=DepthAverage(md,md.initialization.vy);
+		if (!Number.isNaN(md.initialization.vz))
+			md.initialization.vz=DepthAverage(md,md.initialization.vz);
+		if (!Number.isNaN(md.initialization.vel))
+			md.initialization.vel=DepthAverage(md,md.initialization.vel);
+		if (!Number.isNaN(md.initialization.temperature))
+			md.initialization.temperature=DepthAverage(md,md.initialization.temperature);
+		if (!Number.isNaN(md.initialization.pressure))
+			md.initialization.pressure=project2d(md,md.initialization.pressure,1);
+		if (!Number.isNaN(md.initialization.sediment_head))
+			md.initialization.sediment_head=project2d(md,md.initialization.sediment_head,1);
+		if (!Number.isNaN(md.initialization.epl_head))
+			md.initialization.epl_head=project2d(md,md.initialization.epl_head,1);
+		if (!Number.isNaN(md.initialization.epl_thickness))
+			md.initialization.epl_thickness=project2d(md,md.initialization.epl_thickness,1);
+
+		// giaivins
+		if (!Number.isNaN(md.gia.mantle_viscosity))
+			md.gia.mantle_viscosity=project2d(md,md.gia.mantle_viscosity,1);
+		if (!Number.isNaN(md.gia.lithosphere_thickness))
+			md.gia.lithosphere_thickness=project2d(md,md.gia.lithosphere_thickness,1);
+
+		// elementstype
+		if (!Number.isNaN(md.flowequation.element_equation)) {
+			md.flowequation.element_equation=project2d(md,md.flowequation.element_equation,1);
+			md.flowequation.vertex_equation=project2d(md,md.flowequation.vertex_equation,1);
+			md.flowequation.borderSSA=project2d(md,md.flowequation.borderSSA,1);
+			md.flowequation.borderHO=project2d(md,md.flowequation.borderHO,1);
+			md.flowequation.borderFS=project2d(md,md.flowequation.borderFS,1);
+		}
+
+		// boundary conditions
+		md.stressbalance.spcvx=project2d(md,md.stressbalance.spcvx,md.mesh.numberoflayers);
+		md.stressbalance.spcvy=project2d(md,md.stressbalance.spcvy,md.mesh.numberoflayers);
+		md.stressbalance.spcvz=project2d(md,md.stressbalance.spcvz,md.mesh.numberoflayers);
+		md.stressbalance.referential=project2d(md,md.stressbalance.referential,md.mesh.numberoflayers);
+		md.stressbalance.loadingforce=project2d(md,md.stressbalance.loadingforce,md.mesh.numberoflayers);
+		md.masstransport.spcthickness=project2d(md,md.masstransport.spcthickness,md.mesh.numberoflayers);
+		if (!Number.isNaN(md.damage.spcdamage))
+			md.damage.spcdamage=project2d(md,md.damage.spcdamage,md.mesh.numberoflayers);
+		md.thermal.spctemperature=project2d(md,md.thermal.spctemperature,md.mesh.numberoflayers);
+
+		// Hydrologydc variables
+		if (md.hydrology.classname() === 'hydrologydc') {
+			md.hydrology.spcsediment_head=project2d(md,md.hydrology.spcsediment_head,1);
+			md.hydrology.mask_eplactive_node=project2d(md,md.hydrology.mask_eplactive_node,1);
+			md.hydrology.sediment_transmitivity=project2d(md,md.hydrology.sediment_transmitivity,1);
+			md.hydrology.basal_moulin_input=project2d(md,md.hydrology.basal_moulin_input,1);
+
+			if(md.hydrology.isefficientlayer==1)
+				md.hydrology.spcepl_head=project2d(md,md.hydrology.spcepl_head,1);
+		}
+		
+		// materials
+		md.materials.rheology_B=DepthAverage(md,md.materials.rheology_B);
+		md.materials.rheology_n=project2d(md,md.materials.rheology_n,1);
+		
+		// damage: 
+		if (md.damage.isdamage)
+			md.damage.D=DepthAverage(md,md.damage.D);
+
+		// special for thermal modeling:
+		if (!Number.isNaN(md.basalforcings.groundedice_melting_rate))
+			md.basalforcings.groundedice_melting_rate=project2d(md,md.basalforcings.groundedice_melting_rate,1); 
+
+		if (!Number.isNaN(md.basalforcings.floatingice_melting_rate))
+			md.basalforcings.floatingice_melting_rate=project2d(md,md.basalforcings.floatingice_melting_rate,1); 
+
+		md.basalforcings.geothermalflux=project2d(md,md.basalforcings.geothermalflux,1); // bedrock only gets geothermal flux
+
+		// update of connectivity matrix
+		md.mesh.average_vertex_connectivity=25;
+
+		// Collapse the mesh
+		var nodes2d=md.mesh.numberofvertices2d;
+		var elements2d=md.mesh.numberofelements2d;
+
+		// parameters
+		md.geometry.surface=project2d(md,md.geometry.surface,1);
+		md.geometry.thickness=project2d(md,md.geometry.thickness,1);
+		md.geometry.base=project2d(md,md.geometry.base,1);
+		if (!Number.isNaN(md.geometry.bed))
+			md.geometry.bed=project2d(md,md.geometry.bed,1);
+
+		if (!Number.isNaN(md.mask.ocean_levelset))
+			md.mask.ocean_levelset=project2d(md,md.mask.ocean_levelset,1);
+
+		if (!Number.isNaN(md.mask.ice_levelset))
+			md.mask.ice_levelset=project2d(md,md.mask.ice_levelset,1);
+
+		// lat long
+		if (numel(md.mesh.lat) === md.mesh.numberofvertices)
+			md.mesh.lat=project2d(md,md.mesh.lat,1);
+		if (numel(md.mesh.long) === md.mesh.numberofvertices)
+			md.mesh.long=project2d(md,md.mesh.long,1);
+		if (numel(md.mesh.scale_factor) === md.mesh.numberofvertices)
+			md.mesh.scale_factor=project2d(md,md.mesh.scale_factor,1);
+
+		// Initialize with the 2d mesh
+		var mesh = new mesh2d();
+		mesh.x=md.mesh.x2d;
+		mesh.y=md.mesh.y2d;
+		mesh.numberofvertices=md.mesh.numberofvertices2d;
+		mesh.numberofelements=md.mesh.numberofelements2d;
+		mesh.elements=md.mesh.elements2d;
+
+		if (!Number.isNaN(md.mesh.vertexonboundary))
+			mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1);
+		if (!Number.isNaN(md.mesh.elementconnectivity))
+			mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1);
+
+		md.mesh=mesh;
+		md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+		md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+		md.mesh.segments=contourenvelope(md.mesh);
+
+		return md;
+	} /*}}}*/
+	this.deepCopy = function(md) { //{{{
+		/*
+		 *DEEPCOPY - returns a deep copy of the model.
+		 *
+		 *   This routine creates a new model with new objects 
+		 *   for each corresponding object in the original model,
+		 *   so that changes in one do not affect the other.
+		 *
+		 *   Usage:
+		 *	 md1=deepCopy(md)
+		 *
+		 */
+		function recursiveDeepCopy(obj) {
+			var returnValue;
+
+			switch (typeof obj) {
+				case "object":
+					if (obj === null) {
+						// null => null
+						returnValue = null;
+					} else {
+						switch (toString.call(obj)) {
+							case "[object Array]":
+								// It's an array, create a new array with deep copies of the entries
+								returnValue = obj.map(recursiveDeepCopy);
+								break;
+							default:
+								// Some other kind of object, deep-copy its properties into a new object
+								returnValue = Object.keys(obj).reduce(function(prev, key) {
+									prev[key] = recursiveDeepCopy(obj[key]);
+									return prev;
+								}, {});
+								break;
 						}
 					}
-				}
-				md.mesh.elementconnectivity = md.mesh.elementconnectivity.map(function(value) { return (Number.isNaN(value)) ? 0 : value; });
-			}
-
-			md.materials=md.materials.extrude(md);
-			md.damage=md.damage.extrude(md);
-			md.mask=md.mask.extrude(md);
-			md.qmu=md.qmu.extrude(md);
-			md.basalforcings=md.basalforcings.extrude(md);
-
-			//increase connectivity if less than 25:
-			if (md.mesh.average_vertex_connectivity<=25) {
-				md.mesh.average_vertex_connectivity=100;
-			}
-		} //}}}
-		this.extract = function(md,area) { //{{{
-			//extract - extract a model according to an Argus contour or flag list
-			//
-			//   This routine extracts a submodel from a bigger model with respect to a given contour
-			//   md must be followed by the corresponding exp file or flags list
-			//   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
-			//   If user wants every element outside the domain to be 
-			//   extract2d, add '~' to the name of the domain file (ex: '~HO.exp');
-			//   an empty string '' will be considered as an empty domain
-			//   a string 'all' will be considered as the entire domain
-			//
-			//   Usage:
-			//      md2=extract(md,area);
-			//
-			//   Examples:
-			//      md2=extract(md,'Domain.exp');
-			//
-			//   See also: EXTRUDE, COLLAPSE
-
-			//some checks on list of arguments
-			var argc = arguments.length;
-
-			if (!((argc == 2) | (argc == 1))) {
-				throw "extract error message: bad usage";
-			}
-			
-			//get elements that are inside area
-			flag_elem=FlagElements(this,area);
-
-			if (!ArrayAnyEqual(flag_elem,1))throw "extracted model is empty!"
-
-			/*kick out all elements with 3 dirichlets: actually, not so fast, not good for javscript usually.
-			spc_elem=find(~flag_elem);
-			spc_node=sort(unique(md1.mesh.elements(spc_elem,:)));
-			flag=ones(md1.mesh.numberofvertices,1);
-			flag(spc_node)=0;
-			pos=find(sum(flag(md1.mesh.elements),2)==0);
-			flag_elem(pos)=0;*/
-
-			//extracted elements and nodes lists
-			var pos_elem = ArrayFind(flag_elem,1);
-			var dup_nodes= new Array(pos_elem.length*3);
-			for(var i=0;i<pos_elem.length;i++){
-				dup_nodes[3*i]=md.mesh.elements[pos_elem[i]][0]-1;
-				dup_nodes[3*i+1]=md.mesh.elements[pos_elem[i]][1]-1;
-				dup_nodes[3*i+2]=md.mesh.elements[pos_elem[i]][2]-1;
-			}
-			pos_node=ArrayUnique(dup_nodes); pos_node=ArraySort(pos_node);
-
-			//keep track of some fields
-			var numberofvertices1=md.mesh.numberofvertices;
-			var numberofelements1=md.mesh.numberofelements;
-			var numberofvertices2=pos_node.length;
-			var numberofelements2=pos_elem.length;
-			var flag_node=NewArrayFill(numberofvertices1,0);
-			for (var i=0;i<pos_node.length;i++)flag_node[pos_node[i]]=1;
-
-			//Create Pelem and Pnode (transform old nodes in new nodes and same thing for the elements)
-			Pelem=NewArrayFill(numberofelements1,0);
-			for (var i=0;i<numberofelements2;i++) Pelem[pos_elem[i]]=i;
-			Pnode=NewArrayFill(numberofvertices1,0);
-			for (var i=0;i<numberofvertices2;i++) Pnode[pos_node[i]]=i;
-			//renumber the elements (some nodes won't exist anymore)
-			var elements_2=NewArrayFill2D(numberofelements2,3,0);
-			for (var i=0;i<numberofelements2;i++){
-				for (var j=0;j<3;j++){
-					elements_2[i][j]=Pnode[md.mesh.elements[i][j]-1]+1;
-				}
-			}
-			
-			/*if isa(md.mesh,'mesh3dprisms'),
-				elements_2(:,4)=Pnode(elements_2(:,4));
-				elements_2(:,5)=Pnode(elements_2(:,5));
-				elements_2(:,6)=Pnode(elements_2(:,6));
-			end
-			*/
-			
-			//OK, now create the new model!
-
-			//take every field from model
-			var md2=md.deepcopy(md);
-			//var md2=new model(); md2.mesh=new mesh3dsurface();
-			
-			//deal with mesh: {{{
-			md2.mesh.numberofvertices=numberofvertices2;
-			md2.mesh.numberofelements=numberofelements2;
-			md2.mesh.elements=elements_2;
-
-			md2.mesh.x=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.x[i]=md.mesh.x[pos_node[i]];
-			md2.mesh.y=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.y[i]=md.mesh.y[pos_node[i]];
-			md2.mesh.z=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.z[i]=md.mesh.z[pos_node[i]];
-			md2.mesh.lat=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.lat[i]=md.mesh.lat[pos_node[i]];
-			md2.mesh.long=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.long[i]=md.mesh.long[pos_node[i]];
-			md2.mesh.r=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.r[i]=md.mesh.r[pos_node[i]];
-			//}}}
-			//deal with geometry: {{{
-			md2.geometry.base=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.base[i]=md.geometry.base[pos_node[i]];
-			md2.geometry.thickness=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.thickness[i]=md.geometry.thickness[pos_node[i]];
-			md2.geometry.surface=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.surface[i]=md.geometry.surface[pos_node[i]];
-			md2.geometry.bed=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.bed[i]=md.geometry.bed[pos_node[i]];
-			//}}}
-
-			//Keep track of pos_node and pos_elem
-			for (var i=0;i<md2.mesh.numberofvertices;i++)pos_node[i]=pos_node[i]+1;
-			for (var i=0;i<md2.mesh.numberofelements;i++)pos_elem[i]=pos_elem[i]+1;
-			md2.mesh.extractedvertices=pos_node;
-			md2.mesh.extractedelements=pos_elem;
-
-			return md2;
-
-
-
-			//automatically modify fields
-
-			//loop over model fields
-			//model_fields=fields(md);
-
-
-
-
-
-		} //}}}
-		this.collapse = function(md) { //{{{
-			/*
-			 *COLLAPSE - collapses a 3d mesh into a 2d mesh
-			 *
-			 *   This routine collapses a 3d model into a 2d model
-			 *   and collapses all the fileds of the 3d model by
-			 *   taking their depth-averaged values
-			 *
-			 *   Usage:
-			 *	 md=collapse(md)
-			 *
-			 *   See also: EXTRUDE, MODELEXTRACT
-			 */
-
-			// Check that the model is really a 3d model
-			if (md.mesh.elementtype() !== 'Penta') {
-				console.error('collapse error message: only 3d mesh can be collapsed')
-			}
-
-			// Start with changing all the fields from the 3d mesh 
-
-			// dealing with the friction law
-			// drag is limited to nodes that are on the bedrock.
-			if (md.friction.classname() === 'friction') {
-				md.friction.coefficient=project2d(md,md.friction.coefficient,1);
-				md.friction.p=project2d(md,md.friction.p,1);
-				md.friction.q=project2d(md,md.friction.q,1);
-			} else if (md.friction.classname() === 'frictionhydro') {
-				md.friction.q=project2d(md,md.friction.q,1);
-				md.friction.C=project2d(md,md.friction.C,1);
-				md.friction.As=project2d(md,md.friction.As,1);
-				md.friction.effective_pressure=project2d(md,md.friction.effective_pressure,1);
-			} else if (md.friction.classname() === 'frictionwaterlayer') {
-				md.friction.coefficient=project2d(md,md.friction.coefficient,1);
-				md.friction.p=project2d(md,md.friction.p,1);
-				md.friction.q=project2d(md,md.friction.q,1);
-				md.friction.water_layer=project2d(md,md.friction.water_layer,1);
-			} else if (md.friction.classname() === 'frictionweertman') {
-				md.friction.C=project2d(md,md.friction.C,1);
-				md.friction.m=project2d(md,md.friction.m,1);
-			} else if (md.friction.classname() === 'frictionweertmantemp') {
-				md.friction.C=project2d(md,md.friction.C,1);
-				md.friction.m=project2d(md,md.friction.m,1);
-			} else {
-				disp('friction type not supported');
-			}
-
-			// observations
-			if (!Number.isNaN(md.inversion.vx_obs))
-				md.inversion.vx_obs=project2d(md,md.inversion.vx_obs,md.mesh.numberoflayers);
-
-			if (!Number.isNaN(md.inversion.vy_obs))
-				md.inversion.vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers);
-
-			if (!Number.isNaN(md.inversion.vel_obs))
-				md.inversion.vel_obs=project2d(md,md.inversion.vel_obs,md.mesh.numberoflayers);
-
-			if (!Number.isNaN(md.inversion.cost_functions_coefficients))
-				md.inversion.cost_functions_coefficients=project2d(md,md.inversion.cost_functions_coefficients,md.mesh.numberoflayers);
-
-			if (numel(md.inversion.min_parameters)>1)
-				md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers);
-
-			if (numel(md.inversion.max_parameters)>1) 
-				md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers);
-
-			if (md.smb.classname() === 'SMBforcing' && !Number.isNaN(md.smb.mass_balance)) {
-				md.smb.mass_balance=project2d(md,md.smb.mass_balance,md.mesh.numberoflayers);
-			} else if (md.smb.classname() === 'SMBhenning' && !Number.isNaN(md.smb.smbref)) {
-				md.smb.smbref=project2d(md,md.smb.smbref,md.mesh.numberoflayers);
-			}
-
-			// results
-			if (!Number.isNaN(md.initialization.vx))
-				md.initialization.vx=DepthAverage(md,md.initialization.vx);
-			if (!Number.isNaN(md.initialization.vy))
-				md.initialization.vy=DepthAverage(md,md.initialization.vy);
-			if (!Number.isNaN(md.initialization.vz))
-				md.initialization.vz=DepthAverage(md,md.initialization.vz);
-			if (!Number.isNaN(md.initialization.vel))
-				md.initialization.vel=DepthAverage(md,md.initialization.vel);
-			if (!Number.isNaN(md.initialization.temperature))
-				md.initialization.temperature=DepthAverage(md,md.initialization.temperature);
-			if (!Number.isNaN(md.initialization.pressure))
-				md.initialization.pressure=project2d(md,md.initialization.pressure,1);
-			if (!Number.isNaN(md.initialization.sediment_head))
-				md.initialization.sediment_head=project2d(md,md.initialization.sediment_head,1);
-			if (!Number.isNaN(md.initialization.epl_head))
-				md.initialization.epl_head=project2d(md,md.initialization.epl_head,1);
-			if (!Number.isNaN(md.initialization.epl_thickness))
-				md.initialization.epl_thickness=project2d(md,md.initialization.epl_thickness,1);
-
-			// giaivins
-			if (!Number.isNaN(md.gia.mantle_viscosity))
-				md.gia.mantle_viscosity=project2d(md,md.gia.mantle_viscosity,1);
-			if (!Number.isNaN(md.gia.lithosphere_thickness))
-				md.gia.lithosphere_thickness=project2d(md,md.gia.lithosphere_thickness,1);
-
-			// elementstype
-			if (!Number.isNaN(md.flowequation.element_equation)) {
-				md.flowequation.element_equation=project2d(md,md.flowequation.element_equation,1);
-				md.flowequation.vertex_equation=project2d(md,md.flowequation.vertex_equation,1);
-				md.flowequation.borderSSA=project2d(md,md.flowequation.borderSSA,1);
-				md.flowequation.borderHO=project2d(md,md.flowequation.borderHO,1);
-				md.flowequation.borderFS=project2d(md,md.flowequation.borderFS,1);
-			}
-
-			// boundary conditions
-			md.stressbalance.spcvx=project2d(md,md.stressbalance.spcvx,md.mesh.numberoflayers);
-			md.stressbalance.spcvy=project2d(md,md.stressbalance.spcvy,md.mesh.numberoflayers);
-			md.stressbalance.spcvz=project2d(md,md.stressbalance.spcvz,md.mesh.numberoflayers);
-			md.stressbalance.referential=project2d(md,md.stressbalance.referential,md.mesh.numberoflayers);
-			md.stressbalance.loadingforce=project2d(md,md.stressbalance.loadingforce,md.mesh.numberoflayers);
-			md.masstransport.spcthickness=project2d(md,md.masstransport.spcthickness,md.mesh.numberoflayers);
-			if (!Number.isNaN(md.damage.spcdamage))
-				md.damage.spcdamage=project2d(md,md.damage.spcdamage,md.mesh.numberoflayers);
-			md.thermal.spctemperature=project2d(md,md.thermal.spctemperature,md.mesh.numberoflayers);
-
-			// Hydrologydc variables
-			if (md.hydrology.classname() === 'hydrologydc') {
-				md.hydrology.spcsediment_head=project2d(md,md.hydrology.spcsediment_head,1);
-				md.hydrology.mask_eplactive_node=project2d(md,md.hydrology.mask_eplactive_node,1);
-				md.hydrology.sediment_transmitivity=project2d(md,md.hydrology.sediment_transmitivity,1);
-				md.hydrology.basal_moulin_input=project2d(md,md.hydrology.basal_moulin_input,1);
-
-				if(md.hydrology.isefficientlayer==1)
-					md.hydrology.spcepl_head=project2d(md,md.hydrology.spcepl_head,1);
-			}
-			
-			// materials
-			md.materials.rheology_B=DepthAverage(md,md.materials.rheology_B);
-			md.materials.rheology_n=project2d(md,md.materials.rheology_n,1);
-			
-			// damage: 
-			if (md.damage.isdamage)
-				md.damage.D=DepthAverage(md,md.damage.D);
-
-			// special for thermal modeling:
-			if (!Number.isNaN(md.basalforcings.groundedice_melting_rate))
-				md.basalforcings.groundedice_melting_rate=project2d(md,md.basalforcings.groundedice_melting_rate,1); 
-
-			if (!Number.isNaN(md.basalforcings.floatingice_melting_rate))
-				md.basalforcings.floatingice_melting_rate=project2d(md,md.basalforcings.floatingice_melting_rate,1); 
-
-			md.basalforcings.geothermalflux=project2d(md,md.basalforcings.geothermalflux,1); // bedrock only gets geothermal flux
-
-			// update of connectivity matrix
-			md.mesh.average_vertex_connectivity=25;
-
-			// Collapse the mesh
-			var nodes2d=md.mesh.numberofvertices2d;
-			var elements2d=md.mesh.numberofelements2d;
-
-			// parameters
-			md.geometry.surface=project2d(md,md.geometry.surface,1);
-			md.geometry.thickness=project2d(md,md.geometry.thickness,1);
-			md.geometry.base=project2d(md,md.geometry.base,1);
-			if (!Number.isNaN(md.geometry.bed))
-				md.geometry.bed=project2d(md,md.geometry.bed,1);
-
-			if (!Number.isNaN(md.mask.ocean_levelset))
-				md.mask.ocean_levelset=project2d(md,md.mask.ocean_levelset,1);
-
-			if (!Number.isNaN(md.mask.ice_levelset))
-				md.mask.ice_levelset=project2d(md,md.mask.ice_levelset,1);
-
-			// lat long
-			if (numel(md.mesh.lat) === md.mesh.numberofvertices)
-				md.mesh.lat=project2d(md,md.mesh.lat,1);
-			if (numel(md.mesh.long) === md.mesh.numberofvertices)
-				md.mesh.long=project2d(md,md.mesh.long,1);
-			if (numel(md.mesh.scale_factor) === md.mesh.numberofvertices)
-				md.mesh.scale_factor=project2d(md,md.mesh.scale_factor,1);
-
-			// Initialize with the 2d mesh
-			var mesh = new mesh2d();
-			mesh.x=md.mesh.x2d;
-			mesh.y=md.mesh.y2d;
-			mesh.numberofvertices=md.mesh.numberofvertices2d;
-			mesh.numberofelements=md.mesh.numberofelements2d;
-			mesh.elements=md.mesh.elements2d;
-
-			if (!Number.isNaN(md.mesh.vertexonboundary))
-				mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1);
-			if (!Number.isNaN(md.mesh.elementconnectivity))
-				mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1);
-
-			md.mesh=mesh;
-			md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
-			md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
-			md.mesh.segments=contourenvelope(md.mesh);
-
-			return md;
-		} /*}}}*/
-		this.deepCopy = function(md) { //{{{
-			/*
-			 *DEEPCOPY - returns a deep copy of the model.
-			 *
-			 *   This routine creates a new model with new objects 
-			 *   for each corresponding object in the original model,
-			 *   so that changes in one do not affect the other.
-			 *
-			 *   Usage:
-			 *	 md1=deepCopy(md)
-			 *
-			 */
-			function recursiveDeepCopy(obj) {
-				var returnValue;
-
-				switch (typeof obj) {
-					case "object":
-						if (obj === null) {
-							// null => null
-							returnValue = null;
-						} else {
-							switch (toString.call(obj)) {
-								case "[object Array]":
-									// It's an array, create a new array with deep copies of the entries
-									returnValue = obj.map(recursiveDeepCopy);
-									break;
-								default:
-									// Some other kind of object, deep-copy its properties into a new object
-									returnValue = Object.keys(obj).reduce(function(prev, key) {
-										prev[key] = recursiveDeepCopy(obj[key]);
-										return prev;
-									}, {});
-									break;
-							}
-						}
-						break;
-					default:
-						// It's a primitive, copy via assignment
-						returnValue = obj;
-						break;
-				}
-				return returnValue;
-			}
-			
-			return recursiveDeepCopy(md);
-		} /*}}}*/
-	//properties
-	// {{{
-		//Careful here: no other class should be used as default value this is a bug of matlab
-		this.mesh             = 0;
-		this.mask             = 0;
-
-		this.geometry         = 0;
-		this.constants        = 0;
-		this.smb              = 0;
-		this.basalforcings    = 0;
-		this.materials        = 0;
-		this.damage           = 0;
-		this.friction         = 0;
-		this.flowequation     = 0;
-		this.timestepping     = 0;
-		this.initialization   = 0;
-		this.rifts            = 0;
-		this.slr              = 0;
-		this.dsl              = 0;
-
-		this.debug            = 0;
-		this.verbose          = 0;
-		this.settings         = 0;
-		this.toolkits         = 0;
-		this.cluster          = 0;
-
-		this.balancethickness = 0;
-		this.stressbalance    = 0;
-		this.groundingline    = 0;
-		this.hydrology        = 0;
-		this.masstransport    = 0;
-		this.thermal          = 0;
-		this.steadystate      = 0;
-		this.trans            = 0;
-		this.levelset         = 0;
-		this.calving          = 0;
-		this.love             = 0;
-		this.gia              = 0;
-		this.esa              = 0;
-
-		this.autodiff         = 0;
-		this.inversion        = 0;
-		this.qmu              = 0;
-		this.amr					 = 0;
-
-		this.results          = 0;
-		this.outputdefinition = 0;
-		this.radaroverlay     = 0;
-		this.miscellaneous    = 0;
-		this.priv             = 0;
-
-		//set default values for fields
-		this.setdefaultparameters();
-
-		//}}}
+					break;
+				default:
+					// It's a primitive, copy via assignment
+					returnValue = obj;
+					break;
+			}
+			return returnValue;
+		}
+		
+		return recursiveDeepCopy(md);
+	} /*}}}*/
+//properties
+// {{{
+	//Careful here: no other class should be used as default value this is a bug of matlab
+	this.mesh             = 0;
+	this.mask             = 0;
+
+	this.geometry         = 0;
+	this.constants        = 0;
+	this.smb              = 0;
+	this.basalforcings    = 0;
+	this.materials        = 0;
+	this.damage           = 0;
+	this.friction         = 0;
+	this.flowequation     = 0;
+	this.timestepping     = 0;
+	this.initialization   = 0;
+	this.rifts            = 0;
+	this.dsl              = 0;
+	this.solidearth       = 0;
+
+	this.debug            = 0;
+	this.verbose          = 0;
+	this.settings         = 0;
+	this.toolkits         = 0;
+	this.cluster          = 0;
+
+	this.balancethickness = 0;
+	this.stressbalance    = 0;
+	this.groundingline    = 0;
+	this.hydrology        = 0;
+	this.masstransport    = 0;
+	this.thermal          = 0;
+	this.steadystate      = 0;
+	this.transient        = 0;
+	this.levelset         = 0;
+	this.calving          = 0;
+	this.frontalforcings  = 0;
+	this.love             = 0;
+	this.esa              = 0;
+	this.sampling         = 0;
+
+	this.autodiff         = 0;
+	this.inversion        = 0;
+	this.qmu              = 0;
+	this.amr              = 0;
+	this.results          = 0;
+	this.outputdefinition = 0;
+	this.radaroverlay     = 0;
+	this.miscellaneous    = 0;
+	this.priv             = 0;
+
+	// Set default values for fields
+	if (arguments.length == 0) {
+		this.setdefaultparameters('earth');
+	} else {
+		this.setdefaultparameters(planet);
+	}
+	//}}}
 }
Index: /issm/trunk/src/m/classes/model.m
===================================================================
--- /issm/trunk/src/m/classes/model.m	(revision 26743)
+++ /issm/trunk/src/m/classes/model.m	(revision 26744)
@@ -39,15 +39,15 @@
 		steadystate      = 0;
 		transient        = 0;
-		levelset			  = 0;
+		levelset         = 0;
 		calving          = 0;
 		frontalforcings  = 0;
-		love			     = 0;
-		gia				  = 0;
+		love             = 0;
 		esa              = 0;
+		sampling         = 0;
 
 		autodiff         = 0;
 		inversion        = 0;
 		qmu              = 0;
-		amr				 = 0;
+		amr              = 0;
 		results          = 0;
 		outputdefinition = 0;
@@ -55,4 +55,5 @@
 		miscellaneous    = 0;
 		private          = 0;
+		stochasticforcing= 0;
 
 		%}}}
@@ -133,6 +134,4 @@
 				end
 			end
-			%2017 April 10th
-			if isa(md.gia,'gia'), md.gia=giamme(); end
 			%2017 May 4th
 			if isa(md.amr,'double'); md.amr=amr(); end
@@ -156,5 +155,5 @@
 			if isa(md.frontalforcings,'double');
 				if(isprop('meltingrate',md.calving) & ~isnan(md.calving.meltingrate))
-					disp('Warning: md.calving.meltingrate is now in md.frontalforcings');
+		gia			disp('Warning: md.calving.meltingrate is now in md.frontalforcings');
 				end
 				md.frontalforcings=frontalforcings(md.calving); 
@@ -168,14 +167,17 @@
 				end
 			end
-			%2019 Mar 28
+			%2019 Mar 28, updated 2021 April 23
 			if isa(md.smb,'SMBcomponents') | isa(md.smb,'SMBmeltcomponents') | isa(md.smb,'SMBforcing') | isa(md.smb,'SMBgemb') 
-				if isa(md.smb.isclimatology,'double')
-					if prod(size(md.smb.isclimatology)) ~= 1
-						md.smb.isclimatology = 0;
+				if any(strcmp(fieldnames(md.smb),'isclimatology'))
+					if isa(md.smb.isclimatology,'double')
+						if prod(size(md.smb.isclimatology)) ~= 1
+							md.smb.isclimatology = 0;
+						end
+						md.timestepping.cycle_forcing=md.smb.isclimatology;
 					end
 				end
 			end
 			%2019 Dec 16
-			if isa(md.dsl,'double') | isempty(md.dsl.compute_fingerprints)
+			if isa(md.dsl,'double') 
 				md.dsl=dsl();
 			end
@@ -188,4 +190,8 @@
 				end
 			end
+			%2021 February 17
+			if isa(md.sampling,'double'); md.sampling=sampling(); end
+			%VV
+			if ~isa(md.stochasticforcing,'stochasticforcing'); md.stochasticforcing=stochasticforcing(); end
 		end% }}}
 	end
@@ -204,4 +210,49 @@
 		end
 		%}}}
+		function disp(self) % {{{
+			disp(sprintf('%19s: %-22s -- %s','mesh'            ,['[1x1 ' class(self.mesh) ']'],'mesh properties'));
+			disp(sprintf('%19s: %-22s -- %s','mask'            ,['[1x1 ' class(self.mask) ']'],'defines grounded and floating elements'));
+			disp(sprintf('%19s: %-22s -- %s','geometry'        ,['[1x1 ' class(self.geometry) ']'],'surface elevation, bedrock topography, ice thickness,...'));
+			disp(sprintf('%19s: %-22s -- %s','constants'       ,['[1x1 ' class(self.constants) ']'],'physical constants'));
+			disp(sprintf('%19s: %-22s -- %s','smb'             ,['[1x1 ' class(self.smb) ']'],'surface mass balance'));
+			disp(sprintf('%19s: %-22s -- %s','basalforcings'   ,['[1x1 ' class(self.basalforcings) ']'],'bed forcings'));
+			disp(sprintf('%19s: %-22s -- %s','materials'       ,['[1x1 ' class(self.materials) ']'],'material properties'));
+			disp(sprintf('%19s: %-22s -- %s','damage'          ,['[1x1 ' class(self.damage) ']'],'parameters for damage evolution solution'));
+			disp(sprintf('%19s: %-22s -- %s','friction'        ,['[1x1 ' class(self.friction) ']'],'basal friction/drag properties'));
+			disp(sprintf('%19s: %-22s -- %s','flowequation'    ,['[1x1 ' class(self.flowequation) ']'],'flow equations'));
+			disp(sprintf('%19s: %-22s -- %s','timestepping'    ,['[1x1 ' class(self.timestepping) ']'],'time stepping for transient models'));
+			disp(sprintf('%19s: %-22s -- %s','initialization'  ,['[1x1 ' class(self.initialization) ']'],'initial guess/state'));
+			disp(sprintf('%19s: %-22s -- %s','rifts'           ,['[1x1 ' class(self.rifts) ']'],'rifts properties'));
+			disp(sprintf('%19s: %-22s -- %s','solidearth'      ,['[1x1 ' class(self.solidearth) ']'],'solidearth inputs and settings'));
+			disp(sprintf('%19s: %-22s -- %s','dsl'             ,['[1x1 ' class(self.dsl) ']'],'dynamic sea-level '));
+			disp(sprintf('%19s: %-22s -- %s','debug'           ,['[1x1 ' class(self.debug) ']'],'debugging tools (valgrind, gprof)'));
+			disp(sprintf('%19s: %-22s -- %s','verbose'         ,['[1x1 ' class(self.verbose) ']'],'verbosity level in solve'));
+			disp(sprintf('%19s: %-22s -- %s','settings'        ,['[1x1 ' class(self.settings) ']'],'settings properties'));
+			disp(sprintf('%19s: %-22s -- %s','toolkits'        ,['[1x1 ' class(self.toolkits) ']'],'PETSc options for each solution'));
+			disp(sprintf('%19s: %-22s -- %s','cluster'         ,['[1x1 ' class(self.cluster) ']'],'cluster parameters (number of CPUs...)'));
+			disp(sprintf('%19s: %-22s -- %s','balancethickness',['[1x1 ' class(self.balancethickness) ']'],'parameters for balancethickness solution'));
+			disp(sprintf('%19s: %-22s -- %s','stressbalance'   ,['[1x1 ' class(self.stressbalance) ']'],'parameters for stressbalance solution'));
+			disp(sprintf('%19s: %-22s -- %s','groundingline'   ,['[1x1 ' class(self.groundingline) ']'],'parameters for groundingline solution'));
+			disp(sprintf('%19s: %-22s -- %s','hydrology'       ,['[1x1 ' class(self.hydrology) ']'],'parameters for hydrology solution'));
+			disp(sprintf('%19s: %-22s -- %s','masstransport'   ,['[1x1 ' class(self.masstransport) ']'],'parameters for masstransport solution'));
+			disp(sprintf('%19s: %-22s -- %s','thermal'         ,['[1x1 ' class(self.thermal) ']'],'parameters for thermal solution'));
+			disp(sprintf('%19s: %-22s -- %s','steadystate'     ,['[1x1 ' class(self.steadystate) ']'],'parameters for steadystate solution'));
+			disp(sprintf('%19s: %-22s -- %s','transient'       ,['[1x1 ' class(self.transient) ']'],'parameters for transient solution'));
+			disp(sprintf('%19s: %-22s -- %s','levelset'        ,['[1x1 ' class(self.levelset) ']'],'parameters for moving boundaries (level-set method)'));
+			disp(sprintf('%19s: %-22s -- %s','calving'         ,['[1x1 ' class(self.calving) ']'],'parameters for calving'));
+			disp(sprintf('%19s: %-22s -- %s','frontalforcings' ,['[1x1 ' class(self.frontalforcings) ']'],'parameters for frontalforcings'));
+			disp(sprintf('%19s: %-22s -- %s','esa'             ,['[1x1 ' class(self.esa) ']'],'parameters for elastic adjustment solution'));
+			disp(sprintf('%19s: %-22s -- %s','love'            ,['[1x1 ' class(self.love) ']'],'parameters for love solution'));
+			disp(sprintf('%19s: %-22s -- %s','sampling'        ,['[1x1 ' class(self.sampling) ']'],'parameters for stochastic sampler'));
+			disp(sprintf('%19s: %-22s -- %s','autodiff'        ,['[1x1 ' class(self.autodiff) ']'],'automatic differentiation parameters'));
+			disp(sprintf('%19s: %-22s -- %s','inversion'       ,['[1x1 ' class(self.inversion) ']'],'parameters for inverse methods'));
+			disp(sprintf('%19s: %-22s -- %s','qmu'             ,['[1x1 ' class(self.qmu) ']'],'Dakota properties'));
+			disp(sprintf('%19s: %-22s -- %s','amr'             ,['[1x1 ' class(self.amr) ']'],'adaptive mesh refinement properties'));
+			disp(sprintf('%19s: %-22s -- %s','outputdefinition',['[1x1 ' class(self.outputdefinition) ']'],'output definition'));
+			disp(sprintf('%19s: %-22s -- %s','results'         ,['[1x1 ' class(self.results) ']'],'model results'));
+			disp(sprintf('%19s: %-22s -- %s','radaroverlay'    ,['[1x1 ' class(self.radaroverlay) ']'],'radar image for plot overlay'));
+			disp(sprintf('%19s: %-22s -- %s','miscellaneous'   ,['[1x1 ' class(self.miscellaneous) ']'],'miscellaneous fields'));
+			disp(sprintf('%19s: %-22s -- %s','stochasticforcing',['[1x1 ' class(self.stochasticforcing) ']'],'stochasticity applied to model forcings'));
+		end % }}}
 		function md = setdefaultparameters(md,planet) % {{{
 
@@ -238,7 +289,7 @@
 			md.calving          = calving();
 			md.frontalforcings  = frontalforcings();
-			md.gia              = giamme();
 			md.love             = fourierlove();
 			md.esa              = esa();
+			md.sampling         = sampling();
 			md.autodiff         = autodiff();
 			md.inversion        = inversion();
@@ -250,4 +301,5 @@
 			md.miscellaneous    = miscellaneous();
 			md.private          = private();
+			md.stochasticforcing= stochasticforcing();
 		end
 		%}}}
@@ -304,4 +356,7 @@
 				md.friction.C=project2d(md,md.friction.C,1);
 				md.friction.m=project2d(md,md.friction.m,1);
+			elseif isa(md.friction,'frictionjosh'),
+				md.friction.coefficient=project2d(md,md.friction.coefficient,1);
+				md.friction.pressure_adjusted_temperature=project2d(md,md.friction.pressure_adjusted_temperature,1);
 			else
 				disp('friction type not supported');
@@ -371,9 +426,4 @@
 			end
 
-			%giaivins
-			if isa(md.gia,'giaivins'),
-				if ~isnan(md.gia.mantle_viscosity), md.gia.mantle_viscosity=project2d(md,md.gia.mantle_viscosity,1); end
-				if ~isnan(md.gia.lithosphere_thickness), md.gia.lithosphere_thickness=project2d(md,md.gia.lithosphere_thickness,1); end
-			end
 
 			%elementstype
@@ -417,4 +467,7 @@
 			md.materials.rheology_B=DepthAverage(md,md.materials.rheology_B);
 			md.materials.rheology_n=project2d(md,md.materials.rheology_n,1);
+			if isprop(md.materials,'rheology_E')
+				md.materials.rheology_E=project2d(md,md.materials.rheology_E,1);
+			end
 			
 			%damage: 
@@ -615,6 +668,6 @@
 						elseif fieldsize(1)==numberofelements1
 							md2.(model_fields{i}).(object_fields{j})=field(pos_elem,:);
-                        elseif (fieldsize(1)==numberofelements1+1)
-                            md2.(model_fields{i}).(object_fields{j})=[field(pos_elem,:); field(end,:)];
+						elseif (fieldsize(1)==numberofelements1+1)
+							md2.(model_fields{i}).(object_fields{j})=[field(pos_elem,:); field(end,:)];
 						end
 					end
@@ -628,5 +681,5 @@
 					elseif fieldsize(1)==numberofelements1
 						md2.(model_fields{i})=field(pos_elem,:);
-                    elseif (fieldsize(1)==numberofelements1+1)
+					elseif (fieldsize(1)==numberofelements1+1)
 						md2.(model_fields{i})=[field(pos_elem,:); field(end,:)];
 					end
@@ -775,16 +828,16 @@
 						% loop over time steps
 						for p=1:length(md1.results.(solutionfields{i}))
-						    current = md1.results.(solutionfields{i})(p);
-						    solutionsubfields=fields(current);
-						    for j=1:length(solutionsubfields),
+							current = md1.results.(solutionfields{i})(p);
+							solutionsubfields=fields(current);
+							for j=1:length(solutionsubfields),
 							field=md1.results.(solutionfields{i})(p).(solutionsubfields{j});
 							if length(field)==numberofvertices1,
-							    md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field(pos_node);
+								md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field(pos_node);
 							elseif length(field)==numberofelements1,
-							    md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field(pos_elem);
+								md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field(pos_elem);
 							else
-							    md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field;
+								md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field;
 							end
-						    end
+							end
 						end
 					else
@@ -820,4 +873,126 @@
 			md2.mesh.extractedvertices=pos_node;
 			md2.mesh.extractedelements=pos_elem;
+		end % }}}
+		function md2 = refine(md) % {{{
+			%refine - split all triangles into 3 to refine the mesh everywhere
+			%
+			%   This function only works for 2d triangle meshes
+			%
+			%   Usage:
+			%      md2=refine(md);
+			%
+			%   See also: EXTRUDE, COLLAPSE, EXTRACT
+
+			%Check incoming 
+			if ~strcmp(elementtype(md.mesh),'Tria')
+				error('not supported for 3d meshes');
+			end
+
+			%copy model
+			md2=md;
+
+			disp('Getting edges');
+			%initialization of some variables
+			nbe   = md.mesh.numberofelements;
+			nbv   = md.mesh.numberofvertices;
+			index = md.mesh.elements;
+			elementslist=1:nbe;
+			%1: list of edges
+			edges=[index(:,[1,2]); index(:,[2,3]); index(:,[3,1])];
+			%2: find unique edges
+			[edges,I,J]=unique(sort(edges,2),'rows');
+			%3: unique edge numbers
+			vec=J;
+			%4: unique edges numbers in each triangle (2 triangles sharing the same edge will have the same edge number)
+			edges_tria=[vec(elementslist+nbe) vec(elementslist+2*nbe) vec(elementslist)];
+
+			% We divide each element as follows
+			%
+			%                   e2
+			%    n1 ------------+------------ n3
+			%       \          / \          /
+			%        \    1   /   \   3    /
+			%         \      /     \      /
+			%          \    /   2   \    /
+			%           \  /         \  /
+			%         e3 +____________\/ e1
+			%             \           /
+			%              \         /
+			%               \   4   /
+			%                \     /
+			%                 \   /
+			%                   n2
+
+			%Create new coordinates
+			disp('Remeshing...');
+			x_edges = 0.5*(md.mesh.x(edges(:,1)) + md.mesh.x(edges(:,2)));
+			y_edges = 0.5*(md.mesh.y(edges(:,1)) + md.mesh.y(edges(:,2)));
+			md2.mesh.x = [md2.mesh.x;x_edges];
+			md2.mesh.y = [md2.mesh.y;y_edges];
+			md2.mesh.elements = [...
+				index(:,1)          nbv+edges_tria(:,3) nbv+edges_tria(:,2);...
+				nbv+edges_tria(:,2) nbv+edges_tria(:,3) nbv+edges_tria(:,1);...
+				nbv+edges_tria(:,2) nbv+edges_tria(:,1) index(:,3);...
+				nbv+edges_tria(:,3) index(:,2)          nbv+edges_tria(:,1)];
+			md2.mesh.numberofelements = 4*nbe;
+			md2.mesh.numberofvertices = nbv + size(edges,1);
+			disp(['   Old number of elements: ' num2str(nbe)]);
+			disp(['   New number of elements: ' num2str(4*nbe)]);
+
+			disp('Interpolate all fields');
+			numberofvertices1 = md.mesh.numberofvertices;
+			numberofelements1 = md.mesh.numberofelements;
+			nbv2 = md2.mesh.numberofvertices;
+
+			%Create transformation vectors
+			nbedges = size(edges,1);
+			Pelem = sparse(1:4*nbe,repmat([1:nbe],1,4),ones(4*nbe,1),4*nbe,nbe);
+			Pnode = sparse([1:nbv,repmat([nbv+1:nbv+nbedges],1,2)],[1:nbv edges(:)'],[ones(nbv,1);1/2*ones(2*nbedges,1)],md2.mesh.numberofvertices,nbv);
+
+			%Deal with mesh
+			if numel(md.mesh.scale_factor)==md.mesh.numberofvertices
+				md2.mesh.scale_factor=Pnode*md.mesh.scale_factor;
+			end
+
+			%loop over model fields
+			model_fields=setxor(fields(md),{'mesh'});
+			%remove mesh from this field
+			for i=1:length(model_fields),
+				%get field
+				field=md.(model_fields{i});
+				fieldsize=size(field);
+				if isobject(field), %recursive call
+					object_fields=fields(md.(model_fields{i}));
+					for j=1:length(object_fields),
+						%get field
+						field=md.(model_fields{i}).(object_fields{j});
+						fieldsize=size(field);
+						%size = number of nodes * n
+						if fieldsize(1)==numberofvertices1
+							md2.(model_fields{i}).(object_fields{j})=Pnode*field;
+						elseif (fieldsize(1)==numberofvertices1+1)
+							md2.(model_fields{i}).(object_fields{j})=[Pnode*field(1:end-1,:); field(end,:)];
+							%size = number of elements * n
+						elseif fieldsize(1)==numberofelements1
+							md2.(model_fields{i}).(object_fields{j})=Pelem*field;
+						elseif (fieldsize(1)==numberofelements1+1)
+							md2.(model_fields{i}).(object_fields{j})=[Pelem*field(1:end-1,:); field(end,:)];
+						end
+					end
+				else
+					%size = number of nodes * n
+					if fieldsize(1)==numberofvertices1
+						md2.(model_fields{i})=Pnode*field;
+					elseif (fieldsize(1)==numberofvertices1+1)
+						md2.(model_fields{i})=[Pnode*field(1:end-1,:); field(end,:)];
+						%size = number of elements * n
+					elseif fieldsize(1)==numberofelements1
+						md2.(model_fields{i})=Pelem*field;
+					elseif (fieldsize(1)==numberofelements1+1)
+						md2.(model_fields{i})=[Pelem*field(1:end-1,:); field(end,:)];
+					end
+				end
+			end
+
 		end % }}}
 		function md = extrude(md,varargin) % {{{
@@ -1017,5 +1192,5 @@
 				md.mesh.average_vertex_connectivity=100;
 			end
-			end % }}}
+		end % }}}
 		function md = structtomodel(md,structmd) % {{{
 
@@ -1300,5 +1475,6 @@
 				md.smb=SMBhenning(structmd.surfaceforcings);
 			end
-			if isfield(structmd,'slr'),
+			if isfield(structmd,'slr') && ~isempty(structmd.slr)
+				md.solidearth       = solidearth('Earth');
 				disp('Recovering old slr class');
 				if isfield(structmd.slr,'sealevel'),
@@ -1467,95 +1643,52 @@
 			end
 		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('%19s: %-22s -- %s','mesh'            ,['[1x1 ' class(self.mesh) ']'],'mesh properties'));
-			disp(sprintf('%19s: %-22s -- %s','mask'            ,['[1x1 ' class(self.mask) ']'],'defines grounded and floating elements'));
-			disp(sprintf('%19s: %-22s -- %s','geometry'        ,['[1x1 ' class(self.geometry) ']'],'surface elevation, bedrock topography, ice thickness,...'));
-			disp(sprintf('%19s: %-22s -- %s','constants'       ,['[1x1 ' class(self.constants) ']'],'physical constants'));
-			disp(sprintf('%19s: %-22s -- %s','smb'             ,['[1x1 ' class(self.smb) ']'],'surface mass balance'));
-			disp(sprintf('%19s: %-22s -- %s','basalforcings'   ,['[1x1 ' class(self.basalforcings) ']'],'bed forcings'));
-			disp(sprintf('%19s: %-22s -- %s','materials'       ,['[1x1 ' class(self.materials) ']'],'material properties'));
-			disp(sprintf('%19s: %-22s -- %s','damage'          ,['[1x1 ' class(self.damage) ']'],'parameters for damage evolution solution'));
-			disp(sprintf('%19s: %-22s -- %s','friction'        ,['[1x1 ' class(self.friction) ']'],'basal friction/drag properties'));
-			disp(sprintf('%19s: %-22s -- %s','flowequation'    ,['[1x1 ' class(self.flowequation) ']'],'flow equations'));
-			disp(sprintf('%19s: %-22s -- %s','timestepping'    ,['[1x1 ' class(self.timestepping) ']'],'time stepping for transient models'));
-			disp(sprintf('%19s: %-22s -- %s','initialization'  ,['[1x1 ' class(self.initialization) ']'],'initial guess/state'));
-			disp(sprintf('%19s: %-22s -- %s','rifts'           ,['[1x1 ' class(self.rifts) ']'],'rifts properties'));
-			disp(sprintf('%19s: %-22s -- %s','solidearth'      ,['[1x1 ' class(self.solidearth) ']'],'solidearth inputs and settings'));
-			disp(sprintf('%19s: %-22s -- %s','dsl'             ,['[1x1 ' class(self.dsl) ']'],'dynamic sea-level '));
-			disp(sprintf('%19s: %-22s -- %s','debug'           ,['[1x1 ' class(self.debug) ']'],'debugging tools (valgrind, gprof)'));
-			disp(sprintf('%19s: %-22s -- %s','verbose'         ,['[1x1 ' class(self.verbose) ']'],'verbosity level in solve'));
-			disp(sprintf('%19s: %-22s -- %s','settings'        ,['[1x1 ' class(self.settings) ']'],'settings properties'));
-			disp(sprintf('%19s: %-22s -- %s','toolkits'        ,['[1x1 ' class(self.toolkits) ']'],'PETSc options for each solution'));
-			disp(sprintf('%19s: %-22s -- %s','cluster'         ,['[1x1 ' class(self.cluster) ']'],'cluster parameters (number of cpus...)'));
-			disp(sprintf('%19s: %-22s -- %s','balancethickness',['[1x1 ' class(self.balancethickness) ']'],'parameters for balancethickness solution'));
-			disp(sprintf('%19s: %-22s -- %s','stressbalance'   ,['[1x1 ' class(self.stressbalance) ']'],'parameters for stressbalance solution'));
-			disp(sprintf('%19s: %-22s -- %s','groundingline'   ,['[1x1 ' class(self.groundingline) ']'],'parameters for groundingline solution'));
-			disp(sprintf('%19s: %-22s -- %s','hydrology'       ,['[1x1 ' class(self.hydrology) ']'],'parameters for hydrology solution'));
-			disp(sprintf('%19s: %-22s -- %s','masstransport'   ,['[1x1 ' class(self.masstransport) ']'],'parameters for masstransport solution'));
-			disp(sprintf('%19s: %-22s -- %s','thermal'         ,['[1x1 ' class(self.thermal) ']'],'parameters for thermal solution'));
-			disp(sprintf('%19s: %-22s -- %s','steadystate'     ,['[1x1 ' class(self.steadystate) ']'],'parameters for steadystate solution'));
-			disp(sprintf('%19s: %-22s -- %s','transient'       ,['[1x1 ' class(self.transient) ']'],'parameters for transient solution'));
-			disp(sprintf('%19s: %-22s -- %s','levelset'        ,['[1x1 ' class(self.levelset) ']'],'parameters for moving boundaries (level-set method)'));
-			disp(sprintf('%19s: %-22s -- %s','calving'         ,['[1x1 ' class(self.calving) ']'],'parameters for calving'));
-			disp(sprintf('%19s: %-22s -- %s','frontalforcings' ,['[1x1 ' class(self.frontalforcings) ']'],'parameters for frontalforcings'));
-			disp(sprintf('%19s: %-22s -- %s','gia'             ,['[1x1 ' class(self.gia) ']'],'parameters for gia solution'));
-			disp(sprintf('%19s: %-22s -- %s','esa'             ,['[1x1 ' class(self.esa) ']'],'parameters for elastic adjustment solution'));
-			disp(sprintf('%19s: %-22s -- %s','love'            ,['[1x1 ' class(self.love) ']'],'parameters for love solution'));
-			disp(sprintf('%19s: %-22s -- %s','autodiff'        ,['[1x1 ' class(self.autodiff) ']'],'automatic differentiation parameters'));
-			disp(sprintf('%19s: %-22s -- %s','inversion'       ,['[1x1 ' class(self.inversion) ']'],'parameters for inverse methods'));
-			disp(sprintf('%19s: %-22s -- %s','qmu'             ,['[1x1 ' class(self.qmu) ']'],'dakota properties'));
-			disp(sprintf('%19s: %-22s -- %s','amr'             ,['[1x1 ' class(self.amr) ']'],'adaptive mesh refinement properties'));
-			disp(sprintf('%19s: %-22s -- %s','outputdefinition',['[1x1 ' class(self.outputdefinition) ']'],'output definition'));
-			disp(sprintf('%19s: %-22s -- %s','results'         ,['[1x1 ' class(self.results) ']'],'model results'));
-			disp(sprintf('%19s: %-22s -- %s','radaroverlay'    ,['[1x1 ' class(self.radaroverlay) ']'],'radar image for plot overlay'));
-			disp(sprintf('%19s: %-22s -- %s','miscellaneous'   ,['[1x1 ' class(self.miscellaneous) ']'],'miscellaneous fields'));
-		end % }}}
 		function memory(self) % {{{
 
-		disp(sprintf('\nMemory imprint:\n'));
-
-		fields=properties('model');
-		mem=0;
-
-		for i=1:length(fields),
-			field=self.(fields{i});
-			s=whos('field'); 
-			mem=mem+s.bytes/1e6;
-			disp(sprintf('%19s: %6.2f Mb',fields{i},s.bytes/1e6));
+			disp(sprintf('\nMemory imprint:\n'));
+
+			fields=properties('model');
+			mem=0;
+
+			for i=1:length(fields),
+				field=self.(fields{i});
+				s=whos('field'); 
+				mem=mem+s.bytes/1e6;
+				disp(sprintf('%19s: %6.2f Mb',fields{i},s.bytes/1e6));
+			end
+			disp(sprintf('%19s--%10s','--------------','--------------'));
+			disp(sprintf('%19s: %g Mb','Total',mem));
 		end
-		disp(sprintf('%19s--%10s','--------------','--------------'));
-		disp(sprintf('%19s: %g Mb','Total',mem));
-		end % }}}
+		% }}}
 		function netcdf(self,filename) % {{{
-		%NETCDF - save model as netcdf
-		%
-		%   Usage:
-		%      netcdf(md,filename)
-		%
-		%   Example:
-		%      netcdf(md,'model.nc');
-
-		disp('Saving model as NetCDF');
-		%1. Create NetCDF file
-		ncid=netcdf.create(filename,'CLOBBER');
-		netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Conventions','CF-1.4');
-		netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Title',['ISSM model (' self.miscellaneous.name ')']);
-		netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Author',getenv('USER'));
-		netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Date',datestr(now));
-
-		%Preallocate variable id, needed to write variables in netcdf file
-		var_id=zeros(1000,1);%preallocate
-
-		for step=1:2,
-			counter=0;
-			[var_id,counter]=structtonc(ncid,'md',self,0,var_id,counter,step);
-			if step==1, netcdf.endDef(ncid); end
-		end
-
-		if counter>1000,
-			warning(['preallocation of var_id need to be updated from ' num2str(1000) ' to ' num2str(counter)]);
-		end
-
-		netcdf.close(ncid)
+			%NETCDF - save model as netcdf
+			%
+			%   Usage:
+			%      netcdf(md,filename)
+			%
+			%   Example:
+			%      netcdf(md,'model.nc');
+
+			disp('Saving model as NetCDF');
+			%1. Create NetCDF file
+			ncid=netcdf.create(filename,'CLOBBER');
+			netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Conventions','CF-1.4');
+			netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Title',['ISSM model (' self.miscellaneous.name ')']);
+			netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Author',getenv('USER'));
+			netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Date',datestr(now));
+
+			%Preallocate variable id, needed to write variables in netcdf file
+			var_id=zeros(1000,1);%preallocate
+
+			for step=1:2,
+				counter=0;
+				[var_id,counter]=structtonc(ncid,'md',self,0,var_id,counter,step);
+				if step==1, netcdf.endDef(ncid); end
+			end
+
+			if counter>1000,
+				warning(['preallocation of var_id need to be updated from ' num2str(1000) ' to ' num2str(counter)]);
+			end
+
+			netcdf.close(ncid)
 		end % }}}
 		function xylim(self) % {{{
@@ -1565,38 +1698,38 @@
 		end % }}}
 		function md=upload(md) % {{{
-		%the goal of this routine is to upload the model onto a server, and to empty it.
-		%So first, save the model with a unique name and upload the file to the server: 
-		random_part=fix(rand(1)*10000);
-		id=[md.miscellaneous.name '-' regexprep(datestr(now),'[^\w'']','') '-' num2str(random_part)  '-' getenv('USER') '-' oshostname() '.upload']; 
-		eval(['save ' id ' md']);
-
-		%Now, upload the file: 
-		issmscpout(md.settings.upload_server,md.settings.upload_path,md.settings.upload_login,md.settings.upload_port,{id},1);
-
-		%Now, empty this model of everything except settings, and record name of file we just uploaded!
-		settings_back=md.settings;
-		md=model();
-		md.settings=settings_back;
-		md.settings.upload_filename=id;
-
-		%get locally rid of file that was uploaded
-		eval(['delete ' id]);
+			%the goal of this routine is to upload the model onto a server, and to empty it.
+			%So first, save the model with a unique name and upload the file to the server: 
+			random_part=fix(rand(1)*10000);
+			id=[md.miscellaneous.name '-' regexprep(datestr(now),'[^\w'']','') '-' num2str(random_part)  '-' getenv('USER') '-' oshostname() '.upload']; 
+			eval(['save ' id ' md']);
+
+			%Now, upload the file: 
+			issmscpout(md.settings.upload_server,md.settings.upload_path,md.settings.upload_login,md.settings.upload_port,{id},1);
+
+			%Now, empty this model of everything except settings, and record name of file we just uploaded!
+			settings_back=md.settings;
+			md=model();
+			md.settings=settings_back;
+			md.settings.upload_filename=id;
+
+			%get locally rid of file that was uploaded
+			eval(['delete ' id]);
 
 		end % }}}
 		function md=download(md) % {{{
 
-		%the goal of this routine is to download the internals of the current model from a server, because 
-		%this model is empty, except for the settings which tell us where to go and find this model!
-
-		%Download the file: 
-		issmscpin(md.settings.upload_server, md.settings.upload_login, md.settings.upload_port, md.settings.upload_path, {md.settings.upload_filename});
-
-		name=md.settings.upload_filename;
-
-		%Now, load this model: 
-		md=loadmodel(md.settings.upload_filename);
-
-		%get locally rid of file that was downloaded
-		eval(['delete ' name]);
+			%the goal of this routine is to download the internals of the current model from a server, because 
+			%this model is empty, except for the settings which tell us where to go and find this model!
+
+			%Download the file: 
+			issmscpin(md.settings.upload_server, md.settings.upload_login, md.settings.upload_port, md.settings.upload_path, {md.settings.upload_filename});
+
+			name=md.settings.upload_filename;
+
+			%Now, load this model: 
+			md=loadmodel(md.settings.upload_filename);
+
+			%get locally rid of file that was downloaded
+			eval(['delete ' name]);
 
 		end % }}}
Index: /issm/trunk/src/m/classes/model.py
===================================================================
--- /issm/trunk/src/m/classes/model.py	(revision 26743)
+++ /issm/trunk/src/m/classes/model.py	(revision 26744)
@@ -37,10 +37,4 @@
 from toolkits import toolkits
 from generic import generic
-from pfe import pfe
-from vilje import vilje
-from hexagon import hexagon
-from cyclone import cyclone
-from stallo import stallo
-from saga import saga
 from balancethickness import balancethickness
 from stressbalance import stressbalance
@@ -55,6 +49,4 @@
 from steadystate import steadystate
 from transient import transient
-from giaivins import giaivins
-from giamme import giamme
 from esa import esa
 from autodiff import autodiff
@@ -76,26 +68,34 @@
 from contourenvelope import contourenvelope
 from DepthAverage import DepthAverage
+from sampling import sampling
+from stochasticforcing import stochasticforcing
 #}}}
 
 
 class model(object):
-    #properties
-    def __init__(self, *args): #{{{
+    """MODEL - class definition
+
+    Usage:
+        md = model()
+    """
+
+    def __init__(self, *args):  #{{{
         self.mesh = None
         self.mask = None
+
+        self.geometry = None
         self.constants = None
-        self.geometry = None
-        self.initialization = None
         self.smb = None
         self.basalforcings = None
-        self.friction = None
-        self.rifts = None
-        self.solidearth = None
-        self.dsl = None
-        self.timestepping = None
-        self.groundingline = None
         self.materials = None
         self.damage = None
+        self.friction = None
         self.flowequation = None
+        self.timestepping = None
+        self.initialization = None
+        self.rifts = None
+        self.dsl = None
+        self.solidearth = None
+
         self.debug = None
         self.verbose = None
@@ -103,6 +103,8 @@
         self.toolkits = None
         self.cluster = None
+
         self.balancethickness = None
         self.stressbalance = None
+        self.groundingline = None
         self.hydrology = None
         self.masstransport = None
@@ -113,82 +115,32 @@
         self.calving = None
         self.frontalforcings = None
-        self.gia = None
         self.love = None
         self.esa = None
+        self.sampling = None
+
         self.autodiff = None
         self.inversion = None
         self.qmu = None
         self.amr = None
-        self.radaroverlay = None
         self.results = None
         self.outputdefinition = None
+        self.radaroverlay = None
         self.miscellaneous = None
         self.private = None
-
-        nargs = len(args)
-
-        if nargs == 0:
+        self.stochasticforcing = None
+
+        if len(args) == 0:
             self.setdefaultparameters('earth')
         else:
-            self.setdefaultparameters(args[0])
             options = pairoptions(*args)
             planet = options.getfieldvalue('planet', 'earth')
             self.setdefaultparameters(planet)
-#}}}
-
-    def properties(self):  # {{{
-        # ordered list of properties since vars(self) is random
-        return ['mesh',
-                'mask',
-                'constants',
-                'geometry',
-                'initialization',
-                'smb',
-                'basalforcings',
-                'friction',
-                'rifts',
-                'solidearth',
-                'dsl',
-                'timestepping',
-                'groundingline',
-                'materials',
-                'damage',
-                'flowequation',
-                'debug',
-                'verbose',
-                'settings',
-                'toolkits',
-                'cluster',
-                'balancethickness',
-                'stressbalance',
-                'hydrology',
-                'masstransport',
-                'thermal',
-                'steadystate',
-                'transient',
-                'levelset',
-                'calving',
-                'frontalforcings',
-                'gia',
-                'love',
-                'esa',
-                'autodiff',
-                'inversion',
-                'qmu',
-                'amr',
-                'radaroverlay',
-                'results',
-                'outputdefinition',
-                'miscellaneous',
-                'private']
-    # }}}
+    #}}}
 
     def __repr__(obj):  #{{{
         # TODO:
-        # - Convert all formatting to calls to <string>.format (see any 
+        # - Convert all formatting to calls to <string>.format (see any
         #   already converted <class>.__repr__ method for examples)
         #
-
-        #print "Here %s the number: %d" % ("is", 37)
         s = "%19s: %-22s -- %s" % ("mesh", "[%s %s]" % ("1x1", obj.mesh.__class__.__name__), "mesh properties")
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("mask", "[%s %s]" % ("1x1", obj.mask.__class__.__name__), "defines grounded and floating elements"))
@@ -210,5 +162,5 @@
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("settings", "[%s %s]" % ("1x1", obj.settings.__class__.__name__), "settings properties"))
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("toolkits", "[%s %s]" % ("1x1", obj.toolkits.__class__.__name__), "PETSc options for each solution"))
-        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("cluster", "[%s %s]" % ("1x1", obj.cluster.__class__.__name__), "cluster parameters (number of cpus...)"))
+        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("cluster", "[%s %s]" % ("1x1", obj.cluster.__class__.__name__), "cluster parameters (number of CPUs...)"))
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("balancethickness", "[%s %s]" % ("1x1", obj.balancethickness.__class__.__name__), "parameters for balancethickness solution"))
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("stressbalance", "[%s %s]" % ("1x1", obj.stressbalance.__class__.__name__), "parameters for stressbalance solution"))
@@ -219,13 +171,13 @@
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("steadystate", "[%s %s]" % ("1x1", obj.steadystate.__class__.__name__), "parameters for steadystate solution"))
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("transient", "[%s %s]" % ("1x1", obj.transient.__class__.__name__), "parameters for transient solution"))
-        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("levelset", "[%s %s]" % ("1x1", obj.levelset.__class__.__name__), "parameters for moving boundaries (level - set method)"))
+        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("levelset", "[%s %s]" % ("1x1", obj.levelset.__class__.__name__), "parameters for moving boundaries (level-set method)"))
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("calving", "[%s %s]" % ("1x1", obj.calving.__class__.__name__), "parameters for calving"))
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("frontalforcings", "[%s %s]" % ("1x1", obj.frontalforcings.__class__.__name__), "parameters for frontalforcings"))
-        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("gia", "[%s %s]" % ("1x1", obj.gia.__class__.__name__), "parameters for gia solution"))
         s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("esa", "[%s %s]" % ("1x1", obj.esa.__class__.__name__), "parameters for elastic adjustment solution"))
+        s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("sampling", "[%s %s]" % ("1x1", obj.sampling.__class__.__name__), "parameters for stochastic sampler"))
         s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("love", "[%s %s]" % ("1x1", obj.love.__class__.__name__), "parameters for love solution"))
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("autodiff", "[%s %s]" % ("1x1", obj.autodiff.__class__.__name__), "automatic differentiation parameters"))
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("inversion", "[%s %s]" % ("1x1", obj.inversion.__class__.__name__), "parameters for inverse methods"))
-        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("qmu", "[%s %s]" % ("1x1", obj.qmu.__class__.__name__), "dakota properties"))
+        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("qmu", "[%s %s]" % ("1x1", obj.qmu.__class__.__name__), "Dakota properties"))
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("amr", "[%s %s]" % ("1x1", obj.amr.__class__.__name__), "adaptive mesh refinement properties"))
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("outputdefinition", "[%s %s]" % ("1x1", obj.outputdefinition.__class__.__name__), "output definition"))
@@ -233,8 +185,59 @@
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("radaroverlay", "[%s %s]" % ("1x1", obj.radaroverlay.__class__.__name__), "radar image for plot overlay"))
         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("miscellaneous", "[%s %s]" % ("1x1", obj.miscellaneous.__class__.__name__), "miscellaneous fields"))
+        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("stochasticforcing", "[%s %s]" % ("1x1", obj.stochasticforcing.__class__.__name__), "stochasticity applied to model forcings"))
         return s
-    # }}}
-
-    def setdefaultparameters(self, planet): #{{{
+    #}}}
+
+    def properties(self):  #{{{
+        # ordered list of properties since vars(self) is random
+        return [
+            'mesh',
+            'mask',
+            'geometry',
+            'constants',
+            'smb',
+            'basalforcings',
+            'materials',
+            'damage',
+            'friction',
+            'flowequation',
+            'timestepping',
+            'initialization',
+            'rifts',
+            'dsl',
+            'solidearth',
+            'debug',
+            'verbose',
+            'settings',
+            'toolkits',
+            'cluster',
+            'balancethickness',
+            'stressbalance',
+            'groundingline',
+            'hydrology',
+            'masstransport',
+            'thermal',
+            'steadystate',
+            'transient',
+            'levelset',
+            'calving',
+            'frontalforcings',
+            'love',
+            'esa',
+            'sampling',
+            'autodiff',
+            'inversion',
+            'qmu',
+            'amr',
+            'results',
+            'outputdefinition',
+            'radaroverlay',
+            'miscellaneous',
+            'private',
+            'stochasticforcing'
+        ]
+    #}}}
+
+    def setdefaultparameters(self, planet):  #{{{
         self.mesh = mesh2d()
         self.mask = mask()
@@ -268,7 +271,7 @@
         self.calving = calving()
         self.frontalforcings = frontalforcings()
-        self.gia = giamme()
         self.love = fourierlove()
         self.esa = esa()
+        self.sampling = sampling()
         self.autodiff = autodiff()
         self.inversion = inversion()
@@ -280,14 +283,15 @@
         self.miscellaneous = miscellaneous()
         self.private = private()
+        self.stochasticforcing = stochasticforcing()
     #}}}
 
-    def checkmessage(self, string):  # {{{
+    def checkmessage(self, string):  #{{{
         print("model not consistent: {}".format(string))
         self.private.isconsistent = False
         return self
-    # }}}
+    #}}}
     #@staticmethod
 
-    def extract(self, area):  # {{{
+    def extract(self, area):  #{{{
         """EXTRACT - extract a model according to an Argus contour or flag list
 
@@ -367,5 +371,5 @@
             field = getattr(md1, fieldi)
             fieldsize = np.shape(field)
-            if hasattr(field, '__dict__') and fieldi not in ['results']: #recursive call
+            if hasattr(field, '__dict__') and fieldi not in ['results']:  #recursive call
                 object_fields = vars(field)
                 for fieldj in object_fields:
@@ -566,7 +570,7 @@
 
         return md2
-    # }}}
-
-    def extrude(md, *args):  # {{{
+    #}}}
+
+    def extrude(md, *args):  #{{{
         """EXTRUDE - vertically extrude a 2d mesh
 
@@ -753,7 +757,7 @@
 
         return md
-    # }}}
-
-    def collapse(md): #{{{
+    #}}}
+
+    def collapse(md):  #{{{
         """COLLAPSE - collapses a 3d mesh into a 2d mesh
 
@@ -847,11 +851,4 @@
             md.initialization.watercolumn = project2d(md, md.initialization.watercolumn, 1)
 
-        # giaivins
-        if md.gia.__class__.__name__ == 'giaivins':
-            if not np.isnan(md.gia.mantle_viscosity).all():
-                md.gia.mantle_viscosity = project2d(md, md.gia.mantle_viscosity, 1)
-            if not np.isnan(md.gia.lithosphere_thickness).all():
-                md.gia.lithosphere_thickness = project2d(md, md.gia.lithosphere_thickness, 1)
-
         # elementstype
         if not np.isnan(md.flowequation.element_equation).all():
@@ -979,5 +976,5 @@
             mesh.scale_factor = project2d(md, md.mesh.scale_factor, 1)
         if hasattr(md.mesh, 'vertexonboundary') and not np.isnan(md.mesh.vertexonboundary).all():
-            mesh.vertexonboundary= project2d(md, md.mesh.vertexonboundary, 1)
+            mesh.vertexonboundary = project2d(md, md.mesh.vertexonboundary, 1)
         if hasattr(md.mesh, 'elementonboundary') and not np.isnan(md.mesh.elementonboundary).all():
             mesh.elementonboundary = project2d(md, md.mesh.elementonboundary, 1)
Index: /issm/trunk/src/m/classes/nodalvalue.m
===================================================================
--- /issm/trunk/src/m/classes/nodalvalue.m	(revision 26743)
+++ /issm/trunk/src/m/classes/nodalvalue.m	(revision 26744)
@@ -3,7 +3,7 @@
 %   Usage:
 %      nodalvalue=nodalvalue();
-%      nodalvalue=nodalvalue('name','SealevelriseSNodalValue',...
+%      nodalvalue=nodalvalue('name','SealevelchangeSNodalValue',...
 %                    'definitionstring','Outputdefinition1', 
-%                    'model_string','SealevelriseS',
+%                    'model_string','SealevelchangeS',
 %                    'node',1);
 
Index: /issm/trunk/src/m/classes/nodalvalue.py
===================================================================
--- /issm/trunk/src/m/classes/nodalvalue.py	(revision 26743)
+++ /issm/trunk/src/m/classes/nodalvalue.py	(revision 26744)
@@ -1,4 +1,3 @@
 import numpy as np
-
 from checkfield import checkfield
 from fielddisplay import fielddisplay
@@ -13,28 +12,28 @@
         nodalvalue=nodalvalue()
         nodalvalue=nodalvalue(
-            'name', 'SealevelriseSNodalValue',
+            'name', 'SealevelchangeSNodalValue',
             'definitionstring', 'Outputdefinition1',
-            'model_string', 'SealevelriseS',
+            'model_string', 'SealevelchangeS',
             'node', 1
         )
     """
 
-    def __init__(self, *args): #{{{
-        self.name               = ''
-        self.definitionstring   = '' # string that identifies this output definition uniquely, from 'Outputdefinition[1-10]'
-        self.model_string       = '' # string for field that is being retrieved
-        self.node               = np.nan #for which node are we retrieving the value?
-        
+    def __init__(self, *args):  #{{{
+        self.name = ''
+        self.definitionstring = ''  # string that identifies this output definition uniquely, from 'Outputdefinition[1-10]'
+        self.model_string = ''  # string for field that is being retrieved
+        self.node = np.nan  #for which node are we retrieving the value?
+
         #use provided options to change fields
         options = pairoptions(*args)
 
         # Get name
-        self.name               = options.getfieldvalue('name', '')
-        self.definitionstring   = options.getfieldvalue('definitionstring', '')
-        self.model_string       = options.getfieldvalue('model_string', '')
-        self.node               = options.getfieldvalue('node', '')
+        self.name = options.getfieldvalue('name', '')
+        self.definitionstring = options.getfieldvalue('definitionstring', '')
+        self.model_string = options.getfieldvalue('model_string', '')
+        self.node = options.getfieldvalue('node', '')
     #}}}
 
-    def __repr__(self): # {{{
+    def __repr__(self):  # {{{
         s = '   Nodalvalue:\n'
         s += '{}\n'.format(fielddisplay(self, 'name', 'identifier for this nodalvalue response'))
@@ -45,10 +44,10 @@
     #}}}
 
-    def setdefaultparameters(self): # {{{
+    def setdefaultparameters(self):  # {{{
         return self
     #}}}
 
-    def checkconsistency(self, md, solution, analyses): # {{{
-        if not isinstance(self.name, basestring):
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if not isinstance(self.name, str):
             raise Exception('nodalvalue error message: \'name\' field should be a string!')
         OutputdefinitionStringArray = []
@@ -60,5 +59,5 @@
     #}}}
 
-    def marshall(self, prefix, md, fid): #{{{
+    def marshall(self, prefix, md, fid):  #{{{
         WriteData(fid, prefix, 'data', self.name, 'name', 'md.nodalvalue.name', 'format', 'String')
         WriteData(fid, prefix, 'data', self.definitionstring, 'name', 'md.nodalvalue.definitionenum', 'format', 'String')
Index: /issm/trunk/src/m/classes/offlinesolidearthsolution.m
===================================================================
--- /issm/trunk/src/m/classes/offlinesolidearthsolution.m	(revision 26744)
+++ /issm/trunk/src/m/classes/offlinesolidearthsolution.m	(revision 26744)
@@ -0,0 +1,44 @@
+%OFFLINESOLIDEARTHSOLUTION class definition
+%
+%   Usage:
+%      addsol=offlinesolidearthsolution();
+
+classdef offlinesolidearthsolution < solidearthsolution
+	properties (SetAccess=public) 
+	end
+	methods
+		function self = offlinesolidearthsolution(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+			self.setdefaultparameters@solidearthsolution();
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==1), 
+				error('offlinesolidearthsolution.m::checkconsistency: trying to run GRD patterns while supplying an offline solution for those patterns!'); 
+			end
+			self.checkconsistency@solidearthsolution(md,solution,analyses);
+
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   external: offlinesolidearth solution:'));
+			self.disp@solidearthsolution();
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+			disp(sprintf('   external (offlinesolidearthsolution) solution:'));
+			WriteData(fid,prefix,'data',2,'name','md.solidearth.external.nature','format','Integer'); %code 2 for offlinesolidearthsolution  class
+			self.marshall@solidearthsolution(prefix,md,fid);
+		end % }}}
+		function savemodeljs(self,fid,modelname) % {{{
+			self.savemodeljs@solidearthsolution(fid,modelname);
+		end % }}}
+		function self = extrude(self,md) % {{{
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/offlinesolidearthsolution.py
===================================================================
--- /issm/trunk/src/m/classes/offlinesolidearthsolution.py	(revision 26744)
+++ /issm/trunk/src/m/classes/offlinesolidearthsolution.py	(revision 26744)
@@ -0,0 +1,85 @@
+import numpy as np
+
+from checkfield import checkfield
+from fielddisplay import fielddisplay
+from WriteData import WriteData
+
+
+class offlinesolidearthsolution(object):
+    """OFFLINESOLIDEARTHSOLUTION class definition
+
+    Usage:
+        offlinesolidearthsolution = offlinesolidearthsolution()
+    """
+
+    def __init__(self, *args): #{{{
+        self.displacementeast = None
+        self.displacementnorth = None
+        self.displacementup = None
+        self.geoid = None
+
+        if len(args) == 0:
+            self.setdefaultparameters()
+        else:
+            raise RuntimeError('constructor not supported')
+    #}}}
+
+    def __repr__(self): #{{{
+        s = '         units for time series is (yr)\n       external: offlinesolidearth solution\n'
+        s += '{}\n'.format(fielddisplay(self, 'displacementeast', 'solid-Earth Eastwards bedrock displacement series (m)'))
+        s += '{}\n'.format(fielddisplay(self, 'displacementnorth', 'solid-Earth Northwards bedrock displacement time series (m)'))
+        s += '{}\n'.format(fielddisplay(self, 'displacementup', 'solid-Earth bedrock uplift time series (m)'))
+        s += '{}\n'.format(fielddisplay(self, 'geoid', 'solid-Earth geoid time series (m)'))
+
+        return s
+    #}}}
+
+    def setdefaultparameters(self): #{{{
+        self.displacementeast = []
+        self.displacementnorth = []
+        self.displacementup = []
+        self.geoid = []
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses): #{{{
+        if ('SealevelchangeAnalysis' not in analyses) or ((solution=='TransientSolution') and (md.solidearth.settings.isgrd==1)): 
+            print('offlinesolidearthsolution checkconsistency error message: trying to run GRD patterns while supplying an offline solution for those patterns!')
+            return md
+        md = checkfield(md, 'fieldname', 'solidearth.external.displacementeast', 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'solidearth.external.displacementnorth', 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'solidearth.external.displacementup', 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'solidearth.external.geoid', 'Inf', 1, 'timeseries', 1)
+    #}}}
+
+    def marshall(self, prefix, md, fid): #{{{
+        yts = md.constants.yts
+
+        # Transform our time series into time series rates
+        if len(np.shape(self.displacementeast)) == 1:
+            print('Warning: offlinesolidearthsolution.py::marshall: only one time step provided, assuming the values are rates per year')
+            displacementeast_rate = np.append(np.array(self.displacementeast).reshape(-1, 1), 0)
+            displacementnorth_rate = np.append(np.array(self.displacementnorth).reshape(-1, 1), 0)
+            displacementup_rate = np.append(np.array(self.displacementup).reshape(-1, 1), 0)
+            geoid_rate = np.append(np.array(self.geoid).reshape(-1, 1), 0)
+        else:
+            time = self.displacementeast[-1, :]
+            dt = np.diff(time, axis=0)
+            displacementeast_rate = np.diff(self.displacementeast[0:-2, :], 1, 1) / dt
+            displacementeast_rate = np.append(displacementeast_rate,time[:-1].reshape(1,-1),axis=0)
+            displacementnorth_rate = np.diff(self.displacementnorth[0:-2, :], 1, 1) / dt
+            displacementnorth_rate = np.append(displacementnorth_rate,time[:-1].reshape(1,-1),axis=0)
+            displacementup_rate = np.diff(self.displacementup[0:-2, :], 1, 1) / dt
+            displacementup_rate = np.append(displacementup_rate,time[:-1].reshape(1,-1),axis=0)
+            geoid_rate = np.diff(self.geoid[0:-2, :], 1, 1) / dt
+            geoid_rate = np.append(geoid_rate,time[:-1].reshape(1,-1),axis=0)
+
+        WriteData(fid, prefix, 'name', 'md.solidearth.external.nature', 'data', 2, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementeast', 'data', displacementeast_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementeast', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementup', 'data', displacementup_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementup', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementnorth', 'data', displacementnorth_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementnorth', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'geoid', 'data', geoid_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.geoid', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+    #}}}
+
+    def extrude(self, md): #{{{
+        return self
+    #}}}
Index: /issm/trunk/src/m/classes/organizer.py
===================================================================
--- /issm/trunk/src/m/classes/organizer.py	(revision 26743)
+++ /issm/trunk/src/m/classes/organizer.py	(revision 26744)
@@ -9,5 +9,5 @@
 try:
     #py3 import
-    from dbm.ndbm import whichdb
+    import dbm
 except ImportError:
     #py2 import
@@ -110,12 +110,12 @@
 
         #figure out if the model is there, otherwise, we have to use the default path supplied by user.
-        if whichdb(path1):
+        if dbm.whichdb(path1):
             md = loadmodel(path1)
             return md
-        elif whichdb(path2):
+        elif dbm.whichdb(path2):
             md = loadmodel(path2)
             return md
 
-    #If we are here, the model has not been found. Try trunk prefix if provided
+        #If we are here, the model has not been found. Try trunk prefix if provided
         if self.trunkprefix:
             path2 = os.path.join(self.repository, self.trunkprefix + string)
@@ -153,5 +153,5 @@
             print(("   step  #%i : %s" % (self.steps[self._currentstep - 1]['id'], self.steps[self._currentstep - 1]['string'])))
 
-    #Ok, now if _currentstep is a member of steps, return true
+        #Ok, now if _currentstep is a member of steps, return true
         if self._currentstep in self.requestedsteps:
             print(("\n   step  #%i : %s\n" % (self.steps[self._currentstep - 1]['id'], self.steps[self._currentstep - 1]['string'])))
@@ -159,5 +159,5 @@
 
             #last check: is this step locked?
-            s = self.steps[self._currentstep].string
+            s = self.steps[self._currentstep - 1]['string']
             if len(s) > 7:
                 if s[-6:] == 'Locked':
Index: /issm/trunk/src/m/classes/pairoptions.m
===================================================================
--- /issm/trunk/src/m/classes/pairoptions.m	(revision 26743)
+++ /issm/trunk/src/m/classes/pairoptions.m	(revision 26744)
@@ -182,5 +182,5 @@
 		end % }}}
 		function value = getfieldvalue(self,field,varargin), % {{{
-		%GETOPTION - get the value of an option
+		%GETFIELDVALUE - get the value of an option
 		%
 		%   Usage:
@@ -220,5 +220,5 @@
 		end % }}}
 		function values = getfieldvalues(self,field,varargin), % {{{
-		%GETOPTION - get the value of an option (if the option is repeated, return multiple values)
+		%GETFIELDVALUES - get the value of an option (if the option is repeated, return multiple values)
 		%
 		%   Usage:
@@ -229,6 +229,6 @@
 		%
 		%   Examples:
-		%      values=getfieldvalue(options,'caxis');
-		%      values=getfieldvalue(options,'caxis',{[0 2],[3 4]});
+		%      values=getfieldvalues(options,'caxis');
+		%      values=getfieldvalues(options,'caxis',{[0 2],[3 4]});
 
 			%some argument checking: 
@@ -248,5 +248,5 @@
 				for i=1:length(pos),
 					values{i}=self.list{pos(i),2};
-					self.list{pos(i),3}=true;  % option used
+					self.list{pos(i),3}=true; % option used
 				end
 				return;
@@ -267,5 +267,5 @@
 		%
 		%   if warn==1 display an info message to warn user that
-		%   some of his options have been removed.
+		%   some of their options have been removed.
 
 			%check is field exist
Index: /issm/trunk/src/m/classes/pairoptions.py
===================================================================
--- /issm/trunk/src/m/classes/pairoptions.py	(revision 26743)
+++ /issm/trunk/src/m/classes/pairoptions.py	(revision 26744)
@@ -14,10 +14,10 @@
         self.list = OrderedDict()
 
-    #get calling function name
+        #get calling function name
         import inspect
         if len(inspect.stack()) > 1:
             self.functionname = inspect.stack()[1][3]
 
-    #initialize list
+        #initialize list
         if not len(arg):
             pass  #Do nothing,
@@ -57,5 +57,7 @@
 
     def addfield(self, field, value):  # {{{
-        """ADDFIELD - add a field to an options list"""
+        """ADDFIELD - add a field to an options list
+        """
+
         if isinstance(field, str):
             if field in self.list:
@@ -65,5 +67,7 @@
 
     def addfielddefault(self, field, value):  # {{{
-        """ADDFIELDDEFAULT - add a field to an options list if it does not already exist"""
+        """ADDFIELDDEFAULT - add a field to an options list if it does not already exist
+        """
+
         if isinstance(field, str):
             if field not in self.list:
@@ -72,5 +76,7 @@
 
     def AssignObjectFields(self, obj2):  # {{{
-        """ASSIGNOBJECTFIELDS - assign object fields from options"""
+        """ASSIGNOBJECTFIELDS - assign object fields from options
+        """
+
         for item in list(self.list.items()):
             if item[0] in dir(obj2):
@@ -82,11 +88,19 @@
 
     def changefieldvalue(self, field, newvalue):  # {{{
-        """CHANGEOPTIONVALUE - change the value of an option in an option list"""
+        """CHANGEOPTIONVALUE - change the value of an option in an option list
+        """
 
         self.list[field] = newvalue
     # }}}
 
+    def displayunused(self): #{{{
+        """DISPLAYUNUSED - display unused options
+        """
+
+        disp(['WARNING: pairoptions::displayunused is not yet implemented'])
+    # }}}
     def exist(self, field):  # {{{
-        """EXIST - check if the option exist"""
+        """EXIST - check if the option exists
+        """
 
         #some argument checking:
@@ -104,6 +118,5 @@
 
     def getfieldvalue(self, field, default=None):  # {{{
-        """
-        GETOPTION - get the value of an option
+        """GETFIELDVALUE - get the value of an option
 
         Usage:
@@ -118,5 +131,5 @@
         """
 
-    #some argument checking:
+        #some argument checking:
         if field is None or field == '':
             raise ValueError('getfieldvalue error message: bad usage')
@@ -124,5 +137,5 @@
             raise TypeError("getfieldvalue error message: field '%s' should be a string." % str(field))
 
-    #Recover option
+        #Recover option
         if field in self.list:
             value = self.list[field]
@@ -137,6 +150,5 @@
 
     def removefield(self, field, warn):  # {{{
-        """
-        REMOVEFIELD - delete a field in an option list
+        """REMOVEFIELD - delete a field in an option list
 
         Usage:
@@ -144,5 +156,5 @@
 
         if warn == 1 display an info message to warn user that
-        some of his options have been removed.
+        some of their options have been removed.
         """
 
Index: /issm/trunk/src/m/classes/plumebasalforcings.py
===================================================================
--- /issm/trunk/src/m/classes/plumebasalforcings.py	(revision 26743)
+++ /issm/trunk/src/m/classes/plumebasalforcings.py	(revision 26744)
@@ -39,13 +39,13 @@
         else:
             error('constuctor not supported')
-    #}}}
+    # }}}
 
     def __repr__(self):  # {{{
         s = '   mantle plume basal melt parameterization:\n'
-        s += '{}\n'.format(fielddisplay(self, 'groundedice_melting_rate', 'basal melting rate (positive if melting) [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'floatingice_melting_rate', 'basal melting rate (positive if melting) [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'mantleconductivity', 'mantle heat conductivity [W / m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'groundedice_melting_rate', 'basal melting rate (positive if melting) [m/yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'floatingice_melting_rate', 'basal melting rate (positive if melting) [m/yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'mantleconductivity', 'mantle heat conductivity [W/m^3]'))
         s += '{}\n'.format(fielddisplay(self, 'nusselt', 'nusselt number, ratio of mantle to plume [1]'))
-        s += '{}\n'.format(fielddisplay(self, 'dtbg', 'background temperature gradient [degree / m]'))
+        s += '{}\n'.format(fielddisplay(self, 'dtbg', 'background temperature gradient [degree/m]'))
         s += '{}\n'.format(fielddisplay(self, 'plumeradius', 'radius of the mantle plume [m]'))
         s += '{}\n'.format(fielddisplay(self, 'topplumedepth', 'depth of the mantle plume top below the crust [m]'))
@@ -55,8 +55,8 @@
         s += '{}\n'.format(fielddisplay(self, 'crustthickness', 'thickness of the crust [m]'))
         s += '{}\n'.format(fielddisplay(self, 'uppercrustthickness', 'thickness of the upper crust [m]'))
-        s += '{}\n'.format(fielddisplay(self, 'uppercrustheat', 'volumic heat of the upper crust [w / m^3]'))
-        s += '{}\n'.format(fielddisplay(self, 'lowercrustheat', 'volumic heat of the lowercrust [w / m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'uppercrustheat', 'volumic heat of the upper crust [w/m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'lowercrustheat', 'volumic heat of the lowercrust [w/m^3]'))
         return s
-    #}}}
+    # }}}
 
     def initialize(self, md):  #{{{
@@ -68,5 +68,5 @@
             print('      no basalforcings.floatingice_melting_rate specified: values set as zero')
         return self
-    #}}}
+    # }}}
 
     def extrude(self, md):  # {{{
@@ -74,5 +74,5 @@
         self.floatingice_melting_rate = project3d(md, 'vector', self.floatingice_melting_rate, 'type', 'node', 'layer', 1)
         return self
-    #}}}
+    # }}}
 
     def setdefaultparameters(self):  # {{{
@@ -80,5 +80,5 @@
         self.mantleconductivity = 2.2
         self.nusselt = 300
-        self.dtbg = 11 / 1000.
+        self.dtbg = 11 / 1000.0
         self.plumeradius = 100000
         self.topplumedepth = 10000
@@ -86,8 +86,8 @@
         self.crustthickness = 30000
         self.uppercrustthickness = 14000
-        self.uppercrustheat = 1.7 * 10**-6
-        self.lowercrustheat = 0.4 * 10**-6
+        self.uppercrustheat = 1.7 * pow(10, -6)
+        self.lowercrustheat = 0.4 * pow(10, -6)
         return self
-    #}}}
+    # }}}
 
     def checkconsistency(self, md, solution, analyses):  # {{{
Index: /issm/trunk/src/m/classes/qmu.js
===================================================================
--- /issm/trunk/src/m/classes/qmu.js	(revision 26743)
+++ /issm/trunk/src/m/classes/qmu.js	(revision 26744)
@@ -12,5 +12,7 @@
 		console.log(sprintf('   qmu parameters:'));
 
-		/*fielddisplay(this,'isdakota','is qmu analysis activated?');
+		fielddisplay(this,'isdakota','is qmu analysis activated?');
+		fielddisplay(this,'output','are we outputting ISSM results, default is 0');
+		/*
 		for (var i=0;i<this.variables.length;i++){
 			console.log(sprintf('         variables%s:  (arrays of each variable class)',...
@@ -106,4 +108,5 @@
 		this.marshall=function(md,prefix,fid) { //{{{
 			WriteData(fid,prefix,'object',this,'fieldname','isdakota','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','output','format','Boolean');
 			if (!this.isdakota){
 				WriteData(fid,prefix,'data',0,'name','md.qmu.mass_flux_segments_present','format','Boolean');
@@ -129,4 +132,5 @@
 
 	this.isdakota                    = 0;
+	this.output                      = 0;
 	this.variables                   = []
 	this.responses                   = [];
Index: /issm/trunk/src/m/classes/qmu.m
===================================================================
--- /issm/trunk/src/m/classes/qmu.m	(revision 26743)
+++ /issm/trunk/src/m/classes/qmu.m	(revision 26744)
@@ -88,5 +88,5 @@
 					md = checkmessage(md,['evaluation_scheduling in qmu.params should be set to ''master''']);
 				end
-				if md.cluster.np<=1,
+				if md.cluster.nprocs()<=1,
 					md = checkmessage(md,['in parallel library mode, Dakota needs to run on at least 2 cpus, 1 cpu for the master, 1 cpu for the slave. Modify md.cluster.np accordingly.']);
 				end
@@ -95,5 +95,5 @@
 					md = checkmessage(md,['in parallel library mode, Dakota needs to run at least one slave on one cpu (md.qmu.params.processors_per_evaluation >=1)!']);
 				end
-				if mod(md.cluster.np-1,self.params.processors_per_evaluation),
+				if mod(md.cluster.nprocs()-1,self.params.processors_per_evaluation),
 					%md = checkmessage(md,['in parallel library mode, the requirement is for md.cluster.np = md.qmu.params.processors_per_evaluation * number_of_slaves, where number_of_slaves will automatically be determined by Dakota. Modify md.cluster.np accordingly']);
 				end
Index: /issm/trunk/src/m/classes/qmu.py
===================================================================
--- /issm/trunk/src/m/classes/qmu.py	(revision 26743)
+++ /issm/trunk/src/m/classes/qmu.py	(revision 26744)
@@ -149,5 +149,5 @@
                 md.checkmessage('evaluation_scheduling in qmu.params should be set to "master"')
 
-            if md.cluster.np <= 1:
+            if md.cluster.nprocs() <= 1:
                 md.checkmessage('in parallel library mode, Dakota needs to run on at least 2 cpus, 1 cpu for the master, 1 cpu for the slave. Modify md.cluster.np accordingly.')
 
@@ -155,5 +155,5 @@
                 md.checkmessage('in parallel library mode, Dakota needs to run at least one slave on one cpu (md.qmu.params.processors_per_evaluation >= 1)!')
 
-            if np.mod(md.cluster.np - 1, self.params.processors_per_evaluation):
+            if np.mod(md.cluster.nprocs() - 1, self.params.processors_per_evaluation):
                 #md.checkmessage('in parallel library mode, the requirement is for md.cluster.np = md.qmu.params.processors_per_evaluation * number_of_slaves, where number_of_slaves will automatically be determined by Dakota. Modify md.cluster.np accordingly')
                 pass
Index: /issm/trunk/src/m/classes/qmu/dakota_method/dmeth_params_write.m
===================================================================
--- /issm/trunk/src/m/classes/qmu/dakota_method/dmeth_params_write.m	(revision 26743)
+++ /issm/trunk/src/m/classes/qmu/dakota_method/dmeth_params_write.m	(revision 26744)
@@ -598,6 +598,4 @@
 	else
 		warning('param_write:param_unrecog','Parameter ''%s'' is of unrecognized type ''%s''.',pname,class(params.(pname)));
-		return
 	end
-
 end% }}}
Index: /issm/trunk/src/m/classes/qmu/dakota_method/dmeth_params_write.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/dakota_method/dmeth_params_write.py	(revision 26743)
+++ /issm/trunk/src/m/classes/qmu/dakota_method/dmeth_params_write.py	(revision 26744)
@@ -7,7 +7,7 @@
 
 def dmeth_params_write(dm, fid, sbeg='\t  '):
-    '''  write the parameters from a dakota_method object.
+    """write the parameters from a dakota_method object.
     [] = dmeth_params_write(dm, fid, sbeg)
-    '''
+    """
 
     if not isinstance(dm, dakota_method):
@@ -509,10 +509,10 @@
     #  check for errors
     if not isfield(params, pname):
-        warning('param_write:param_not_found', 'Parameter ' + str(pname) + ' not found in ' + params + '.')
+        print('Warning: dmeth_params_write.py::param_write: Parameter {} not found in {}.'.format(pname, params))
         return
     elif type(vars(params)[pname]) == bool and not vars(params)[pname]:
         return
     elif isempty(vars(params)[pname]):
-        print('Warning: param_write:param_empty: Parameter {} requires input of type {}.'.format(pname, type(vars(params)[pname])))
+        print('Warning: dmeth_params_write.py::param_write: Parameter {} requires input of type {}.'.format(pname, type(vars(params)[pname])))
         return
 
@@ -535,4 +535,4 @@
 
     else:
-        print('Warning: param_write:param_unrecog: Parameter {} is of unrecognized type {}.'.format(pname, type(vars(params)[pname])))
-        return
+        print('Warning: dmeth_params_write.py::param_write: Parameter {} is of unrecognized type {}.'.format(pname, type(vars(params)[pname])))
+    return
Index: /issm/trunk/src/m/classes/qmustatistics.m
===================================================================
--- /issm/trunk/src/m/classes/qmustatistics.m	(revision 26743)
+++ /issm/trunk/src/m/classes/qmustatistics.m	(revision 26744)
@@ -14,5 +14,5 @@
 
 		%name: name of method, one of 'None','Histogram','SampleSeries' or 'MeanVariance'
-		%fields: fields for the  statistics being requested, ex: 'Sealevel','BslrIce','BslrHydro'
+		%fields: fields for the  statistics being requested, ex: 'Sealevel','BslcIce','BslcHydro'
 		%steps: time steps at which each field statistic is computed, ex: [1:2,5,20] or 1:100
 		%nbins: number of bins for 'Histogram' statistics
Index: /issm/trunk/src/m/classes/rotational.js
===================================================================
--- /issm/trunk/src/m/classes/rotational.js	(revision 26744)
+++ /issm/trunk/src/m/classes/rotational.js	(revision 26744)
@@ -0,0 +1,58 @@
+class rotational {//{{{
+	/**
+	 * ROTATIONAL class definition
+	 *
+	 * Usage:
+	 *     rotational = rotational();
+	 */
+	constructor() {//{{{
+		this.equatorialmoi		= 0;
+		this.polarmoi			= 0;
+		this.angularvelocity	= 0;
+
+		let nargs = arguments.length;
+		if (nargs == 0) {
+			this.setdefaultparameters();
+		} else {
+			error('constructor not supported');
+		}
+	} //}}}
+
+	disp() {//{{{
+		console.log('WARNING: rotational::disp is not yet implemented');
+	} //}}}
+
+	setdefaultparameters() {//{{{
+		// Moment of inertia
+		this.equatorialmoi	= 8.0077e37; // [kg m^2]
+		this.polarmoi		= 8.0345e37; // [kg m^2]
+
+		// Mean rotational velocity of earth
+		this.angularvelocity = 7.2921e-5; // [s^-1]
+	} //}}}
+
+	checkconsistency(md, solution, analyses) {//{{{
+		if (!analyses.includes('SealevelchangeAnalysis') || (solution === 'TransientSolution' && !md.transient.isslc)) {
+			return md;
+		}
+
+		md = checkfield(md, 'fieldname', 'solidearth.rotational.equatorialmoi', 'NaN', 1, 'Inf', 1);
+		md = checkfield(md, 'fieldname', 'solidearth.rotational.polarmoi', 'NaN', 1, 'Inf', 1);
+		md = checkfield(md, 'fieldname', 'solidearth.rotational.angularvelocity', 'NaN', 1, 'Inf', 1);
+
+		return md;
+	} //}}}
+
+	defaultoutputs(md) {//{{{
+		return [];
+	} //}}}
+
+	marshall(md, prefix, fid) {//{{{
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'equatorialmoi', 'name', 'md.solidearth.rotational.equatorialmoi', 'format', 'Double');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'polarmoi', 'name', 'md.solidearth.rotational.polarmoi', 'format', 'Double');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'angularvelocity', 'name', 'md.solidearth.rotational.angularvelocity', 'format', 'Double');
+	} //}}}
+
+	extrude(md) {//{{{
+	} //}}}
+} //}}}
Index: /issm/trunk/src/m/classes/rotational.m
===================================================================
--- /issm/trunk/src/m/classes/rotational.m	(revision 26743)
+++ /issm/trunk/src/m/classes/rotational.m	(revision 26744)
@@ -20,15 +20,15 @@
 		end % }}}
 		function self = setdefaultparameters(self) % {{{
-		
-		%moment of inertia: 
-		self.equatorialmoi	=8.0077*10^37; % [kg m^2] 
-		self.polarmoi		=8.0345*10^37; % [kg m^2] 
 
-		% mean rotational velocity of earth 
-		self.angularvelocity=7.2921*10^-5; % [s^-1] 
+			%moment of inertia:
+			self.equatorialmoi	=8.0077*10^37; % [kg m^2]
+			self.polarmoi		=8.0345*10^37; % [kg m^2]
+
+			% mean rotational velocity of earth
+			self.angularvelocity=7.2921*10^-5; % [s^-1]
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
 
-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslr==0), 
+			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
 				return; 
 			end
Index: /issm/trunk/src/m/classes/rotational.py
===================================================================
--- /issm/trunk/src/m/classes/rotational.py	(revision 26743)
+++ /issm/trunk/src/m/classes/rotational.py	(revision 26744)
@@ -1,4 +1,2 @@
-import numpy as np
-
 from checkfield import checkfield
 from fielddisplay import fielddisplay
@@ -13,8 +11,8 @@
     """
 
-    def __init__(self, *args): #{{{
-        self.equatorialmoi      = 0
-        self.polarmoi           = 0
-        self.langularvelocity   = 0
+    def __init__(self, *args):  #{{{
+        self.equatorialmoi = 0
+        self.polarmoi = 0
+        self.langularvelocity = 0
 
         nargin = len(args)
@@ -25,5 +23,5 @@
     #}}}
 
-    def __repr__(self): # {{{
+    def __repr__(self):  # {{{
         s = '   rotational parameters:\n'
         s += '{}\n'.format(fielddisplay(self, 'equatorialmoi', 'mean equatorial moment of inertia [kg m^2]'))
@@ -33,16 +31,16 @@
     #}}}
 
-    def setdefaultparameters(self): # {{{
+    def setdefaultparameters(self):  # {{{
         # Moment of inertia
-        self.equatorialmoi  = 8.0077e37 # [kg m^2]
-        self.polarmoi       = 8.0345e37 # [kg m^2]
+        self.equatorialmoi = 8.0077 * pow(10, 37) # [kg m^2]
+        self.polarmoi = 8.0345 * pow(10, 37) # [kg m^2]
 
         # Mean rotational velocity of earth
-        self.angularvelocity = 7.2921e-5 # [s^-1]
+        self.angularvelocity = 7.2921 * pow(10, -5) # [s^-1]
         return self
     #}}}
 
-    def checkconsistency(self, md, solution, analyses): # {{{
-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr):
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
             return md
         md = checkfield(md, 'fieldname', 'solidearth.rotational.equatorialmoi', 'NaN', 1, 'Inf', 1)
@@ -52,9 +50,9 @@
     #}}}
 
-    def defaultoutputs(self, md): #{{{
+    def defaultoutputs(self, md):  #{{{
         return []
     #}}}
 
-    def marshall(self, prefix, md, fid): #{{{
+    def marshall(self, prefix, md, fid):  #{{{
         WriteData(fid, prefix, 'object', self, 'fieldname', 'equatorialmoi', 'name', 'md.solidearth.rotational.equatorialmoi', 'format', 'Double')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'polarmoi', 'name', 'md.solidearth.rotational.polarmoi', 'format', 'Double')
@@ -62,5 +60,5 @@
     #}}}
 
-    def extrude(self, md): #{{{
+    def extrude(self, md):  #{{{
         return self
     #}}}
Index: /issm/trunk/src/m/classes/sampling.js
===================================================================
--- /issm/trunk/src/m/classes/sampling.js	(revision 26744)
+++ /issm/trunk/src/m/classes/sampling.js	(revision 26744)
@@ -0,0 +1,99 @@
+//SAMPLING class definition
+//
+//   Usage:
+//      sampling=new sampling();
+
+function sampling (){
+	//methods
+	this.defaultoutputs = function(){// {{{
+       	return [];
+	}// }}}
+	this.setdefaultparameters = function(){// {{{
+
+		//Scaling coefficient
+		this.tau=1;  
+
+		//Apply Robin boundary conditions
+		this.robin=0;   
+		
+		//Temporal correlation factor
+		this.phi=0;  
+		
+		//Exponent in fraction SPDE (default=2, biLaplacian covariance
+		//operator)
+		this.alpha=2; // Default 
+		
+		//Seed for pseudorandom number generator (default -1 for random seed)
+		this.seed=-1;
+		
+		//default output
+		this.requested_outputs=['default'];
+	}// }}}
+	this.disp= function(){// {{{
+		console.log(sprintf('   Sampling parameters:'));
+
+		console.log(sprintf('\n      %s','Parameters of PDE operator (kappa^2 I-Laplacian)^(alpha/2)(tau):'));
+		fielddisplay(this,'kappa','coefficient of the identity operator');
+		fielddisplay(this,'tau','scaling coefficient of the solution (default 1.0)');
+		fielddisplay(this,'alpha','exponent in PDE operator, (default 2.0, BiLaplacian covariance operator)');
+	  
+		console.log(sprintf('\n      %s','Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():'));
+		fielddisplay(this,'robin','Apply Robin boundary conditions (1 if applied and 0 for homogenous Neumann boundary conditions) (default 0)');
+		fielddisplay(this,'beta','Coefficient in Robin boundary conditions (to be defined for robin = 1)');          
+		
+		console.log(sprintf('\n      %s','Parameters for first-order autoregressive process (X_t = phi X_{t-1} + noise) (if transient):'));
+		fielddisplay(this,'phi','Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)');
+		
+		console.log(sprintf('\n      %s','Other parameters of stochastic sampler:'));
+		fielddisplay(this,'seed','Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default -1)');
+		fielddisplay(this,'requested_outputs','additional outputs requested (not implemented yet)');
+	}// }}}
+	this.classname= function(){// {{{
+		return "sampling";
+	}// }}}
+	this.checkconsistency = function(md,solution,analyses) { //{{{
+		if (!ismember('SamplingAnalysis',analyses)) return;
+		
+		checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices,1],'>',0);
+		checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0);
+		checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0,1]);
+		if (md.sampling.robin) {
+			checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices,1],'>',0);
+		}
+		checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0);
+		checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0);
+		checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1);
+		checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1);
+	} // }}}
+	this.marshall=function(md,prefix,fid) { //{{{
+		WriteData(fid,prefix,'object',this,'fieldname','kappa','format','DoubleMat','mattype',1);
+		WriteData(fid,prefix,'object',this,'fieldname','tau','format','Double');
+		WriteData(fid,prefix,'object',this,'fieldname','beta','format','DoubleMat','mattype',1);
+		WriteData(fid,prefix,'object',this,'fieldname','phi','format','Double');
+		WriteData(fid,prefix,'object',this,'fieldname','alpha','format','Integer');
+		WriteData(fid,prefix,'object',this,'fieldname','robin','format','Boolean');
+		WriteData(fid,prefix,'object',this,'fieldname','seed','format','Integer');
+		
+		//process requested outputs
+		outputs = this.requested_outputs;
+		pos = find(ismember(outputs,'default'));
+		if (!isempty(pos)) {
+			ArrayIndex(outputs,pos,[]);                         //remove 'default' from outputs
+			outputs = ArrayConcat(outputs, this.defaultoutputs()); //add defaults
+		}
+		WriteData(fid,prefix,'data',outputs,'name','md.sampling.requested_outputs','format','StringArray');
+	}//}}}
+	//properties 
+	// {{{
+    this.kappa          	= NaN;
+	this.tau            	= 0;
+	this.beta           	= NaN;
+    this.phi            	= 0;
+    this.alpha          	= 0;
+    this.robin          	= 0;
+    this.seed           	= 0;
+	this.requested_outputs  = [];
+
+	this.setdefaultparameters();
+	//}}}
+}
Index: /issm/trunk/src/m/classes/sampling.m
===================================================================
--- /issm/trunk/src/m/classes/sampling.m	(revision 26744)
+++ /issm/trunk/src/m/classes/sampling.m	(revision 26744)
@@ -0,0 +1,131 @@
+%SAMPLING class definition
+%
+%   Usage:
+%      sampling=sampling();
+
+classdef sampling
+	properties (SetAccess=public)
+		kappa             = NaN;
+		tau               = 0;
+		beta              = NaN;
+		phi               = 0;
+		alpha             = 0;
+		robin             = 0;
+		seed              = 0;
+		requested_outputs = {};
+	end
+	methods
+		function self = sampling(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function disp(self) % {{{
+
+			disp(sprintf('   Sampling parameters:'));
+
+			disp(sprintf('\n      %s','Parameters of PDE operator (kappa^2 I-Laplacian)^(alpha/2)(tau):'));
+			fielddisplay(self,'kappa','coefficient of the identity operator');
+			fielddisplay(self,'tau','scaling coefficient of the solution (default: 1.0)');
+			fielddisplay(self,'alpha','exponent in PDE operator, (default: 2.0, BiLaplacian covariance operator)');
+
+			disp(sprintf('\n      %s','Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():'));
+			fielddisplay(self,'robin','Apply Robin boundary conditions (1 if applied and 0 for homogenous Neumann boundary conditions) (default: 0)');
+			fielddisplay(self,'beta','Coefficient in Robin boundary conditions (to be defined for robin = 1)');
+
+			disp(sprintf('\n      %s','Parameters for first-order autoregressive process (X_t = phi X_{t-1} + noise) (if transient):'));
+			fielddisplay(self,'phi','Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)');
+
+			disp(sprintf('\n      %s','Other parameters of stochastic sampler:'));
+			fielddisplay(self,'seed','Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default: -1)');
+			fielddisplay(self,'requested_outputs','additional outputs requested (not implemented yet)');
+
+		end % }}}','
+		function self = setdefaultparameters(self) % {{{
+
+			%Scaling coefficient
+			self.tau=1;
+
+			%Apply Robin boundary conditions
+			self.robin=0;
+
+			%Temporal correlation factor
+			self.phi=0;
+
+			%Exponent in fraction SPDE (default: 2, biLaplacian covariance
+			%operator)
+			self.alpha=2; % Default 
+
+			%Seed for pseudorandom number generator (default: -1, for random seed)
+			self.seed=-1;
+
+			%default output
+			self.requested_outputs={'default'};
+
+		end % }}}
+		function list = defaultoutputs(self,md) % {{{
+
+			list = {};
+
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			if ~ismember('SamplingAnalysis',analyses), return; end
+
+			md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
+			md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0);
+			md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1]);
+			if(md.sampling.robin)
+				md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
+			end
+			md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0);
+			md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0);
+			md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1);
+			md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1);
+
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+
+			WriteData(fid,prefix,'object',self,'fieldname','kappa','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',self,'fieldname','tau','format','Double');
+			WriteData(fid,prefix,'object',self,'fieldname','beta','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',self,'fieldname','phi','format','Double');
+			WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer');
+
+			%process requested outputs
+			outputs = self.requested_outputs;
+			pos  = find(ismember(outputs,'default'));
+			if ~isempty(pos),
+				outputs(pos) = [];                         %remove 'default' from outputs
+				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+			end
+			WriteData(fid,prefix,'data',outputs,'name','md.sampling.requested_outputs','format','StringArray');
+		end % }}}
+		function md = setparameters(self,md,lc,sigma) % {{{
+
+			nu = self.alpha-1;
+			KAPPA = sqrt(8*nu)/lc;
+			TAU = sqrt(gamma(nu)/(gamma(self.alpha)*(4*pi)*KAPPA^(2*nu)*sigma^2));
+			md.sampling.kappa = KAPPA*ones(md.mesh.numberofvertices,1);
+			md.sampling.tau = TAU;
+
+		end % }}}
+		function savemodeljs(self,fid,modelname) % {{{
+
+			writejsdouble(fid,[modelname '.sampling.kappa'],self.kappa);
+			writejsdouble(fid,[modelname '.sampling.tau'],self.tau);
+			writejsdouble(fid,[modelname '.sampling.beta'],self.beta);
+			writejsdouble(fid,[modelname '.sampling.phi'],self.beta);
+			writejsdouble(fid,[modelname '.sampling.alpha'],self.alpha);
+			writejsdouble(fid,[modelname '.sampling.robin'],self.robin);
+			writejsdouble(fid,[modelname '.sampling.seed'],self.seed);
+			writejscellstring(fid,[modelname '.sampling.requested_outputs'],self.requested_outputs);
+
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/sampling.py
===================================================================
--- /issm/trunk/src/m/classes/sampling.py	(revision 26744)
+++ /issm/trunk/src/m/classes/sampling.py	(revision 26744)
@@ -0,0 +1,125 @@
+import numpy as np
+
+from math import *
+
+from checkfield import checkfield
+from fielddisplay import fielddisplay
+from project3d import project3d
+from WriteData import WriteData
+
+
+class sampling(object):
+    """SAMPLING class definition
+
+    Usage:
+        sampling = sampling()
+    """
+
+    def __init__(self, *args): #{{{
+        self.kappa = np.nan
+        self.tau = 0
+        self.beta = np.nan
+        self.phi = 0
+        self.alpha = 0
+        self.robin = 0
+        self.seed = 0
+        self.requested_outputs = []
+
+        if len(args) == 0:
+            self.setdefaultparameters()
+        else:
+            raise RuntimeError('constructor not supported')
+    #}}}
+
+    def __repr__(self): #{{{
+        s = '   Sampling parameters::\n'
+        s += '      Parameters of PDE operator (kappa^2 I-Laplacian)^(alpha/2)(tau):\n'
+        s += '{}\n'.format(fielddisplay(self, 'kappa', 'coefficient of the identity operator'))
+        s += '{}\n'.format(fielddisplay(self, 'tau', 'scaling coefficient of the solution (default: 1.0)'))
+        s += '{}\n'.format(fielddisplay(self, 'alpha', 'exponent in PDE operator, (default: 2.0, BiLaplacian covariance operator)'))
+
+        s += '      Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():\n'
+        s += '{}\n'.format(fielddisplay(self, 'robin', 'Apply Robin boundary conditions (1 if applied and 0 for homogenous Neumann boundary conditions) (default: 0)'))
+        s += '{}\n'.format(fielddisplay(self, 'beta', 'Coefficient in Robin boundary conditions (to be defined for robin = 1)'))
+
+        s += '      Parameters for first-order autoregressive process (X_t = phi X_{t-1} + noise) (if transient):\n'
+        s += '{}\n'.format(fielddisplay(self, 'phi', 'Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)'))
+
+        s += '      Other parameters of stochastic sampler:\n'
+        s += '{}\n'.format(fielddisplay(self, 'seed', 'Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default: -1)'))
+        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested (not implemented yet)'))
+
+        return s
+    #}}}
+
+    def setdefaultparameters(self): #{{{
+        # Scaling coefficient
+        self.tau = 1
+
+        # Apply Robin boundary conditions
+        self.robin = 0
+
+        # Temporal correlation factor
+        self.phi = 0
+
+        # Exponent in fraction SPDE (default: 2, biLaplacian covariance operator)
+        self.alpha = 2
+
+        # Seed for pseudorandom number generator (default: -1, for random seed)
+        self.seed = -1
+
+        # Default output
+        self.requested_outputs = ['default']
+
+        return self
+    #}}}
+
+    def defaultoutputs(self, md): #{{{
+        return []
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses): #{{{
+        if ('SamplingAnalysis' not in analyses):
+            return md
+
+        md = checkfield(md, 'fieldname', 'sampling.kappa', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>', 0)
+        md = checkfield(md, 'fieldname', 'sampling.tau', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+        md = checkfield(md, 'fieldname', 'sampling.robin', 'numel', 1, 'values', [0, 1])
+        if md.sampling.robin:
+            md = checkfield(md, 'fieldname', 'sampling.beta', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>', 0)
+        end
+        md = checkfield(md, 'fieldname', 'sampling.phi', 'NaN', 1, 'Inf', 1, 'numel', 1, '>=', 0)
+        md = checkfield(md, 'fieldname', 'sampling.alpha', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+        md = checkfield(md, 'fieldname', 'sampling.seed', 'NaN', 1, 'Inf', 1, 'numel', 1)
+        md = checkfield(md, 'fieldname', 'sampling.requested_outputs', 'stringrow', 1)
+
+        return md
+    #}}}
+
+    def marshall(self, prefix, md, fid): #{{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'kappa', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'tau', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'beta', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'phi', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'alpha', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'robin', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'seed', 'format', 'Integer')
+
+        # Process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.sampling.requested_outputs', 'format', 'StringArray')
+    #}}}
+
+    def setparameters(self, md, lc, sigma): #{{{
+        nu = self.alpha - 1
+        KAPPA = pow((8 * nu), 0.5) / lc
+        TAU = pow((math.gamma(nu) / math.gamma(self.alpha) * (4 *  np.pi) * pow(KAPPA, 2 * nu) * pow(sigma, 2)), 0.5)
+        md.sampling.kappa = KAPPA * np.ones((md.mesh.numberofvertices, 1))
+        md.sampling.tau = TAU
+
+        return md
+    #}}}
Index: /issm/trunk/src/m/classes/sealevelmodel.js
===================================================================
--- /issm/trunk/src/m/classes/sealevelmodel.js	(revision 26744)
+++ /issm/trunk/src/m/classes/sealevelmodel.js	(revision 26744)
@@ -0,0 +1,143 @@
+class sealevelmodel {
+	/**
+	 * SEALEVELMODEL class definition
+	 * 
+	 * Usage:
+	 *     slm = sealevelmodel(varargin)
+	 *
+	 * Example:
+	 *     slm = sealevelmodel(
+	 *         'icecap', md_greenland,
+	 *         'icecap', md_antarctica,
+	 *         'earth', md_earth
+	 *     )
+	 *
+	 * TODO:
+	 * - Finish translation
+	 */
+	constructor(...varargin) {//{{{
+		this.icecaps = []; // list of land/ice models; name should be changed later
+		this.earth = null; // model for the whole earth
+		this.basins = []; // list of basins, matching icecaps, where shapefile info is held
+		this.cluster = null;
+		this.miscellaneous = null;
+		this.settings = null;
+		this.private = null;
+		this.mergedcaps = null;
+		this.transitions = [];
+		this.eltransitions = [];
+		this.planet = '';
+
+		this.setdefaultparamters();
+
+		if (varargin.length) {
+			let options = pairoptions(varargin);
+
+			// Recover all the icecap models
+			this.icecaps = options.getfieldvalues('ice_cap', []);
+
+			// Recover the earth model
+			this.earth = options.getfieldvalue('earth', 0);
+
+			// Set planet type
+			this.planet = options.getfieldvalue('planet', 'earth');
+		}
+	} //}}}
+
+	setdefaultparamters() {//{{{
+		// Initialize subclasses
+		this.icecaps = [];
+		this.earth = [];
+		this.cluster = generic();
+		this.miscellaneous = miscellaneous();
+		this.settings = issmsettings();
+		this.private = private();
+		this.transitions = [];
+		this.eltransitions = [];
+		this.planet = 'earth';
+	} //}}}
+
+	static checkconsistency(slm, solutiontype) {//{{{
+		// Is the coupler turned on?
+		for (let i = 0; slm.icecaps.length; ++i) {
+			if (!slm.icecaps[0].transient.iscoupler) {
+				console.log('sealevelmodel checkconsistency error: icecap model ' +  slm.icecaps[0].miscellaneous.name + ' should have the transient coupler option turned on!');
+			}
+		}
+
+		if (!slm.earth.transient.iscoupler) {
+			console.log('sealevelmodel checkconsistency error: earth model should have the transient coupler option turned on!');
+		}
+
+		// Check that the transition vectors have the right size
+		for (let i = 0; i < slm.icecaps.length; ++i) {
+			if (slm.icecaps[0].mesh.numberorvertices != slm.earth.solidearth.transitions[0].length) {
+				error('sealevelmodel checkconsistency issue with size of transition vector for ice cap: ' + i + ' name: ' + slm.icecaps[0].miscellaneous.name);
+			}
+		}
+
+		// Check that runfrequency is the same everywhere
+		for (let i = 0; i < slm.icecaps; ++i) {
+			if (slm.icecaps[i].solidearth.settings.runfrequency != slm.earth.solidearth.settings.runfrequency) {
+				error('sealevelmodel checkconsistency error: icecap model ' + slm.icecaps[i].miscellaneous.name + ' should have the same run frequency as earth!');
+			}
+		}
+
+		// Make sure steric_rate is the same everywhere
+		for (let i = 0; i < slm.icecaps.length; ++i) {
+			let md = slm.icecaps[i];
+			if (!isempty(find(md.dsl.steric_rate - slm.earth.dsl.steric_rate[slm.earth.dsl.transitions[i]]))) {
+				error('steric rate on ice cap ' + md.miscellaneous.name + ' is not the same as for the earth');
+			}
+		}
+
+		// Make sure grd is the same everywhere
+		for (let i = 0; i < slm.icecaps.length; ++i) {
+			let md = slm.icecaps[i];
+			if (md.solidearthsettings.isgrd != slm.earth.solidearthsettings.isgrd) {
+				error('isgrd on ice cap ' + md.miscellaneous.name + ' is not the same as for the earth');
+			}
+		}
+
+		// Make sure that there is no solid earth external forcing on the basins
+		for (let i = 0; i < slm.icecaps.length; ++i) {
+			let md = slm.icecaps[i];
+			if (!isempty(md.solidearth.external)) {
+				error('cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model');
+			}
+		}
+
+		// Make sure that we have the right grd model for computing out sealevel patterns
+		for (let i = 0; i < slm.icecaps.length; ++i) {
+			let md = slm.icecaps[i];
+			if (md.solidearth.settings.grdmodel) {
+				error('sealevelmodel checkconsistency error message: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap ' + i);
+			}
+		}
+	} //}}}
+
+	disp() {//{{{
+		console.log('WARNING: sealevelmodel::disp is not yet implemented');
+	} //}}}
+
+	mergeresults() {//{{{
+		let champs = fieldnames(this.icecaps[0].results.TransientSolution);
+		for (let i = 0; i < this.mergedcaps.length / 2; ++i) {
+			let md = this.mergedcaps[2 * i];
+			let trans = this.mergedcaps[2 * i + 1];
+			//let icecaps = this.icecaps[this.range[2 * i + 2]];
+			for (let j = 0; j < this.icecaps[0].results.TransientSolution) {
+				for (let k = 0; champs.length; ++k) {
+					if (strcmpi(typeof(icecaps[0].results.TransientSolution[j][champs[k]]) == 'double')) {
+						// Vertex or element?
+						if (icecaps[0].results.TransientSolution[j][champs[k]].length == icecaps[0].mesh.numberofvertices) {
+							md.results.TransientSolution[j][champs[k]] == icecaps[0].mesh.numberofvertices;
+
+						}
+					} else {
+
+					}
+				}
+			}
+	} //}}}
+}
Index: /issm/trunk/src/m/classes/sealevelmodel.m
===================================================================
--- /issm/trunk/src/m/classes/sealevelmodel.m	(revision 26743)
+++ /issm/trunk/src/m/classes/sealevelmodel.m	(revision 26744)
@@ -4,7 +4,7 @@
 %      slm = sealevelmodel(varargin)
 %
-%      where varargin is a variable list of options: 
+%      where varargin is a variable list of options:
 %
-%   Example: 
+%   Example:
 %      slm = sealevel('icecap',md_greenland,'icecap',md_antarctica,'earth',md_earth);
 
@@ -14,5 +14,5 @@
 		icecaps          = {}; % list of land/ice models, name should  be change longer term.
 		earth            = 0;  % model for the whole earth
-		basins           = {}; % list  of basins, matching icecaps, where shapefile info is held.
+		basins           = {}; % list of basins, matching icecaps, where shapefile info is held
 		cluster          = 0;
 		miscellaneous    = 0;
@@ -33,11 +33,11 @@
 				options=pairoptions(varargin{:});
 
-				%recover all the icecap models: 
-				slm.icecaps=getfieldvalues(options,'ice_cap',{}); 
+				%recover all the icecap models:
+				slm.icecaps=getfieldvalues(options,'ice_cap',{});
 				
 				%recover the earth model:
 				slm.earth = getfieldvalue(options,'earth',0);
 
-				%set planet type: 
+				%set planet type:
 				slm.planet=getfieldvalue(options,'planet','earth');
 
@@ -47,34 +47,58 @@
 		function checkconsistency(slm,solutiontype) % {{{
 
-			%is the coupler turned on? 
+			%is the coupler turned on?
 			for i=1:length(slm.icecaps),
 				if slm.icecaps{i}.transient.iscoupler==0,
-					warning(sprintf('sealevelmodel checkconsistenty error:  icecap model %s should have the transient coupler option turned on!',slm.icecaps{i}.miscellaneous.name));
+					warning(sprintf('sealevelmodel.m::checkconsistency: icecap model %s should have the transient coupler option turned on!',slm.icecaps{i}.miscellaneous.name));
 				end
 			end
 				
 			if slm.earth.transient.iscoupler==0,
-				warning('sealevelmodel checkconsistenty error:  earth model should have the transient coupler option turned on!');
-			end
-
-			%check that the transition vectors have the right size: 
-			for i=1:length(slm.icecaps),
-				if slm.icecaps{i}.mesh.numberofvertices ~= length(slm.earth.slr.transitions{i}),
-					error(['sealevelmodel checkconsistenty issue with size of transition vector for ice cap: ' num2str(i) ' name: ' slm.icecaps{i}.miscellaneous.name]);
-				end
-			end
-			
-			%check that run_frequency is the same everywhere: 
-			for i=1:length(slm.icecaps),
-				if slm.icecaps{i}.slr.geodetic_run_frequency~=slm.earth.slr.geodetic_run_frequency,
-					error(sprintf('sealevelmodel checkconsistenty error:  icecap model %s should have the same run frequency as earth!',slm.icecaps{i}.miscellaneous.name));
-				end
-			end
-
-			%make sure steric_rate is the same everywhere: 
-			for i=1:length(slm.icecaps),
-				md= slm.icecaps{i}; 
-				if ~isempty(find(md.slr.steric_rate - slm.earth.slr.steric_rate(slm.earth.slr.transitions{i}))),
-					error(sprintf('steric rate on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
+				warning('sealevelmodel.m::checkconsistency: earth model should have the transient coupler option turned on!');
+			end
+
+			%check that the transition vectors have the right size:
+			for i=1:length(slm.icecaps),
+				if slm.icecaps{i}.mesh.numberofvertices ~= length(slm.earth.solidearth.transitions{i}),
+					error(['sealevelmodel.m::checkconsistency: issue with size of transition vector for ice cap: ' num2str(i) ' name: ' slm.icecaps{i}.miscellaneous.name]);
+				end
+			end
+			
+			%check that runfrequency is the same everywhere:
+			for i=1:length(slm.icecaps),
+				if slm.icecaps{i}.solidearth.settings.runfrequency~=slm.earth.solidearth.settings.runfrequency,
+					error(sprintf('sealevelmodel.m::checkconsistency: icecap model %s should have the same run frequency as earth!',slm.icecaps{i}.miscellaneous.name));
+				end
+			end
+
+			%make sure steric_rate is the same everywhere:
+			for i=1:length(slm.icecaps),
+				md= slm.icecaps{i};
+				if ~isempty(find(md.dsl.steric_rate - slm.earth.dsl.steric_rate(slm.earth.dsl.transitions{i}))),
+					error(sprintf('sealevelmodel.m::checkconsistency: steric rate on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
+				end
+			end
+
+			%make sure grd is the same everywhere:
+			for i=1:length(slm.icecaps),
+				md= slm.icecaps{i};
+				if md.solidearthsettings.isgrd~=slm.earth.solidearthsettings.isgrd
+					error(sprintf('sealevelmodel.m::checkconsistency: isgrd on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
+				end
+			end
+
+			%make sure that there is no solid earth external forcing on the basins:
+			for i=1:length(slm.icecaps),
+				md= slm.icecaps{i};
+				if ~isempty(md.solidearth.external),
+					error('sealevelmodel.m::checkconsistency: cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model');
+				end
+
+			end
+			%make sure that we have the right grd model for computing out sealevel patterns:
+			for i=1:length(slm.icecaps),
+				md= slm.icecaps{i};
+				if md.solidearth.settings.grdmodel~=0
+					error(sprintf('sealevelmodel.m::checkconsistency: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap %i',i));
 				end
 			end
@@ -111,5 +135,5 @@
 					for k=1:length(champs),
 						if strcmpi(class(icecaps{1}.results.TransientSolution(j).(champs{k})),'double'),
-							%vertex or element? 
+							%vertex or element?
 							if length(icecaps{1}.results.TransientSolution(j).(champs{k}))==icecaps{1}.mesh.numberofvertices,
 								md.results.TransientSolution(j).(champs{k})=zeros(md.mesh.numberofvertices,1);
@@ -118,5 +142,5 @@
 									md.results.TransientSolution(j).(champs{k})(trans{l})=resultcap;
 								end
-							else 
+							else
 								if strcmpi(champs{k},'IceVolume') | strcmpi(champs{k},'IceVolumeAboveFloatation') ,
 									md.results.TransientSolution(j).(champs{k})=0;
@@ -171,8 +195,8 @@
 		function intersections2d(self,varargin) % {{{
 
-			options=pairoptions(varargin{:}); 
+			options=pairoptions(varargin{:});
 			force=getfieldvalue(options,'force',0);
 			
-			%initialize, to avoid issues of having more transitions than meshes. 
+			%initialize, to avoid issues of having more transitions than meshes.
 			self.transitions={};
 			self.eltransitions={};
@@ -185,5 +209,5 @@
 				mdi=self.icecaps{i};
 		
-				%for elements: 
+				%for elements:
 				xei=mdi.mesh.x(mdi.mesh.elements)*[1;1;1]/3;
 				yei=mdi.mesh.y(mdi.mesh.elements)*[1;1;1]/3;
@@ -198,8 +222,8 @@
 		function intersections(self,varargin) % {{{
 
-			options=pairoptions(varargin{:}); 
+			options=pairoptions(varargin{:});
 			force=getfieldvalue(options,'force',0);
 			
-			%initialize, to avoid issues of having more transitions than meshes. 
+			%initialize, to avoid issues of having more transitions than meshes.
 			self.transitions={};
 			self.eltransitions={};
@@ -214,5 +238,5 @@
 				mdi=TwoDToThreeD(mdi,self.planet);
 		
-				%for elements: 
+				%for elements:
 				xei=mdi.mesh.x(mdi.mesh.elements)*[1;1;1]/3;
 				yei=mdi.mesh.y(mdi.mesh.elements)*[1;1;1]/3;
@@ -241,5 +265,5 @@
 		end % }}}
 		function baslist=basinindx(self,varargin) % {{{
-			options=pairoptions(varargin{:}); 
+			options=pairoptions(varargin{:});
 			continent=getfieldvalue(options,'continent','all');
 			bas=getfieldvalue(options,'basin','all');
@@ -249,6 +273,6 @@
 				if length(continent)==1,
 					if strcmpi(continent{1},'all'),
-						%need to transform this into a list of continents: 
-						continent={}; 
+						%need to transform this into a list of continents:
+						continent={};
 						for i=1:length(self.basins),
 							continent{end+1}=self.basins{i}.continent;
@@ -263,6 +287,6 @@
 			else
 				if strcmpi(continent,'all'),
-					%need to transform this into a list of continents: 
-					continent={}; 
+					%need to transform this into a list of continents:
+					continent={};
 					for i=1:length(self.basins),
 						continent{end+1}=self.basins{i}.continent;
@@ -278,5 +302,5 @@
 				if length(bas)==1,
 					if strcmpi(bas{1},'all'),
-						%need to transform this into a list of basins: 
+						%need to transform this into a list of basins:
 						baslist=[];
 						for i=1:length(self.basins),
@@ -299,5 +323,5 @@
 					end
 				else
-					%we have a list of basin names: 
+					%we have a list of basin names:
 					baslist=[];
 					for i=1:length(bas),
@@ -350,6 +374,6 @@
 		function caticecaps(self,varargin) % {{{
 			
-			%recover options: 
-			options=pairoptions(varargin{:}); 
+			%recover options:
+			options=pairoptions(varargin{:});
 			tolerance=getfieldvalue(options,'tolerance',.65);
 			loneedgesdetect=getfieldvalue(options,'loneedgesdetect',0);
@@ -362,5 +386,5 @@
 			
 			%Plug all models together:
-			md=models{1}; 
+			md=models{1};
 			for i=2:length(models),
 				md=modelmerge3d(md,models{i},'tolerance',tolerance);
@@ -381,5 +405,5 @@
 			end %}}}
 	
-			%Plug into earth: 
+			%Plug into earth:
 			self.earth=md;
 
@@ -390,6 +414,6 @@
 		function caticecaps2d(self,varargin) % {{{
 
-			%recover options: 
-			options=pairoptions(varargin{:}); 
+			%recover options:
+			options=pairoptions(varargin{:});
 			tolerance=getfieldvalue(options,'tolerance',1e-5);
 			loneedgesdetect=getfieldvalue(options,'loneedgesdetect',0);
@@ -397,5 +421,5 @@
 
 			%Plug all models together:
-			md=models{1}; 
+			md=models{1};
 			for i=2:length(models),
 				md=modelmerge2d(md,models{i},'tolerance',tolerance);
@@ -413,5 +437,5 @@
 			end %}}}
 
-			%Plug into earth: 
+			%Plug into earth:
 			self.earth=md;
 
@@ -439,5 +463,5 @@
 		end % }}}
 		function transfer(self,string) % {{{
-			%Recover field size in one icecap: 
+			%Recover field size in one icecap:
 			eval(['n=size(self.icecaps{1}.' string ',1);']);
 			if n==self.icecaps{1}.mesh.numberofvertices,
@@ -447,5 +471,5 @@
 				end
 			elseif n==(self.icecaps{1}.mesh.numberofvertices+1),
-				%dealing with a transient dataset. 
+				%dealing with a transient dataset.
 				%check that all timetags are similar between all icecaps:  %{{{
 				for i=1:length(self.icecaps),
@@ -458,5 +482,5 @@
 					end
 				end
-				eval(['capfield1= self.icecaps{1}.' string ';']); 
+				eval(['capfield1= self.icecaps{1}.' string ';']);
 				times=capfield1(end,:);
 				nsteps=length(times);
@@ -490,5 +514,5 @@
 			mintimestep=Inf;
 			for  i=1:length(self.icecaps),
-				ic=self.icecaps{i}; 
+				ic=self.icecaps{i};
 				mintimestep=min(mintimestep, length(ic.results.TransientSolution));
 			end
@@ -498,5 +522,5 @@
 			
 			for  i=1:length(self.icecaps),
-				ic=self.icecaps{i}; 
+				ic=self.icecaps{i};
 				ic.results.TransientSolution=ic.results.TransientSolution(1:mintimestep);
 				self.icecaps{i}=ic;
Index: /issm/trunk/src/m/classes/sealevelmodel.py
===================================================================
--- /issm/trunk/src/m/classes/sealevelmodel.py	(revision 26743)
+++ /issm/trunk/src/m/classes/sealevelmodel.py	(revision 26744)
@@ -1,4 +1,3 @@
 from copy import deepcopy
-import warnings
 
 import numpy as np
@@ -36,7 +35,7 @@
     """
 
-    def __init__(self, *args):  #{{{
-        self.icecaps = []  # list of land/ice models; name should be changed later
-        self.earth = 0  # model for the whole earth
+    def __init__(self, *args):  # {{{
+        self.icecaps = [] # list of land/ice models; name should be changed later
+        self.earth = 0 # model for the whole earth
         self.basins = []  # list of basins, matching icecaps, where shapefile info is held
         self.cluster = 0
@@ -62,5 +61,5 @@
             # Set planet type
             self.planet = options.getfieldvalue('planet', 'earth')
-    #}}}
+    # }}}
 
     def __repr__(self):  # {{{
@@ -72,5 +71,5 @@
 
         return s
-    #}}}
+    # }}}
 
     def setdefaultparameters(self):  # {{{
@@ -84,5 +83,5 @@
         self.eltransitions = []
         self.planet = 'earth'
-    #}}}
+    # }}}
 
     @staticmethod
@@ -91,25 +90,42 @@
         for i in range(len(slm.icecaps)):
             if not slm.icecaps[i].transient.iscoupler:
-                warnings.warn('sealevelmodel checkconsistency error: icecap model {} should have the transient coupler option turned on!'.format(slm.icecaps[i].miscellaneous.name))
+                print('Warning: sealevelmodel.py::checkconsistency: icecap model {} should have the transient coupler option turned on!'.format(slm.icecaps[i].miscellaneous.name))
 
         if not slm.earth.transient.iscoupler:
-            warnings.warn('sealevelmodel checkconsistency error: earth model should have the transient coupler option turned on!')
+            print('Warning: sealevelmodel.py::checkconsistency: earth model should have the transient coupler option turned on!')
 
         # Check that the transition vectors have the right size
         for i in range(len(slm.icecaps)):
             if slm.icecaps[i].mesh.numberofvertices != len(slm.earth.slr.transitions[i]):
-                raise Exception('sealevelmodel checkconsistency issue with size of transition vector for ice cap: {} name: {}'.format(i, slm.icecaps[i].miscellaneous.name))
+                raise Exception('sealevelmodel.py::checkconsistency: issue with size of transition vector for ice cap: {} name: {}'.format(i, slm.icecaps[i].miscellaneous.name))
 
         # Check that run frequency is the same everywhere
         for i in range(len(slm.icecaps)):
-            if slm.icecaps[i].slr.geodetic_run_frequency != slm.earth.geodetic_run_frequency:
-                raise Exception('sealevelmodel checkconsistency error: icecap model {} should have the same run frequency as earth!'.format(slm.icecaps[i].miscellaneous.name))
+            if slm.icecaps[i].solidearth.settings.runfrequency != slm.earth.solidearth.settings.runfrequency:
+                raise Exception('sealevelmodel.py::checkconsistency: icecap model {} should have the same run frequency as earth!'.format(slm.icecaps[i].miscellaneous.name))
 
         # Make sure steric_rate is the same everywhere
         for i in range(len(slm.icecaps)):
             md = slm.icecaps[i]
-            if np.nonzero(md.slr.steric_rate - slm.earth.slr.steric_rate[slm.earth.slr.transitions[i]]) != []:
-                raise Exception('steric rate on ice cap {} is not the same as for the earth'.format(md.miscellaneous.name))
-    #}}}
+            if np.nonzero(md.dsl.steric_rate - slm.earth.dsl.steric_rate[slm.earth.dsl.transitions[i]]) != []:
+                raise Exception('sealevelmodel.py::checkconsistency: steric rate on ice cap {} is not the same as for the earth'.format(md.miscellaneous.name))
+
+        # Make sure grd is the same everywhere
+        for i in range(len(slm.icecaps)):
+            md = slm.icecaps[i]
+            if md.solidearthsettings.isgrd != slm.earth.solidearthsettings.isgrd:
+                raise RuntimeError('sealevelmodel.py::checkconsistency: isgrd on ice cap {} is not the same as for the earth\n'.format(md.miscellaneous.name))
+
+        # Make sure that there is no solid earth external forcing on the basins
+        for i in range(len(slm.icecaps)):
+            md = slm.icecaps[i]
+            if md.solidearth.external:
+                raise RuntimeError('sealevelmodel.py::checkconsistency: cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model')
+        # Make sure that we have the right grd model for computing our sealevel patterns
+        for i in range(len(slm.icecaps)):
+            md = slm.icecaps[i]
+            if md.solidearth.settings.grdmodel != 0:
+                raise RuntimeError('sealevelmodel.py::checkconsistency: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap {}'.format(i))
+    # }}}
 
     def mergeresults(self):  # {{{
@@ -118,4 +134,5 @@
             md = self.mergedcaps[2 * i]
             trans = self.mergedcaps[2 * i + 1]
+            #icecaps = self.icecaps[self.range[2 * i + 2]]
             for j in range(len(self.icecaps[0].results.TransientSolution)):
                 for k in range(len(champs)):
@@ -140,14 +157,14 @@
                         continue
             self.mergedcaps[2 * i] = md
-    #}}}
+    # }}}
 
     def listcaps(self):  # {{{
         for i in range(len(self.icecaps)):
             print('{}: {}'.format(i, self.icecaps[i].miscellaneous.name))
-    #}}}
+    # }}}
 
     def ncaps(self): #{{{
         return len(self.icecaps)
-    #}}}
+    # }}}
 
     def continents(self):  # {{{
@@ -156,5 +173,5 @@
             list.append = self.basins[i].continent
         return np.unique(list)
-    #}}}
+    # }}}
 
     def basinsfromcontinent(self, continent):  # {{{
@@ -164,5 +181,5 @@
                 list.append = self.basins[i].name
         return np.unique(list)
-    #}}}
+    # }}}
 
     def addbasin(self, bas):  # {{{
@@ -170,5 +187,5 @@
             raise Exception('addbasin method only takes a \'basin\' class object as input')
         self.basins.append(bas)
-    #}}}
+    # }}}
 
     def intersections2d(self, *args): #{{{
@@ -195,7 +212,7 @@
             self.transitions.append(meshintersect2d(self.earth.mesh.x, self.earth.mesh.y, mdi.mesh.x, mdi.mesh.y, 'force', force))
             self.eltransitions.append(meshintersect2d(xe, ye, xei, yei, 'force', force))
-    #}}}
-
-    def intersections(self, *args):  #{{{
+    # }}}
+
+    def intersections(self, *args):  # {{{
         options = pairoptions(*args)
         force = options.getfieldvalue('force', 0)
@@ -223,19 +240,19 @@
             self.transitions.append(meshintersect3d(self.earth.mesh.x, self.earth.mesh.y, self.earth.mesh.z, mdi.mesh.x, mdi.mesh.y, mdi.mesh.z, 'force', force))
             self.eltransitions.append(meshintersect3d(xe, ye, ze, xei, yei, zei, 'force', force))
-    #}}}
-
-    def checkintersections(self):  #{{{
+    # }}}
+
+    def checkintersections(self):  # {{{
         flags = np.zeros(self.earth.mesh.numberofvertices, 1)
         for i in range(len(self.basins)):
             flags[self.transitions[i]] = i
         plotmodel(self.earth, 'data', flags, 'coastline', 'on')
-    #}}}
-
-    def checkbasinconsistency(self):  #{{{
+    # }}}
+
+    def checkbasinconsistency(self):  # {{{
         for i in range(len(self.basins)):
             self.basins[i].checkconsistency()
-    #}}}
-
-    def basinindx(self, *args):  #{{{
+    # }}}
+
+    def basinindx(self, *args):  # {{{
         options = pairoptions(*args)
         continent = options.getfieldvalue('continent', 'all')
@@ -264,5 +281,5 @@
             else:
                 pass  # Nothing to do: assume we have a list of continents
-        #}}}
+        # }}}
 
         # Expand basins list using the continent list above and the extra bas discriminator #{{{
@@ -309,20 +326,20 @@
 
         return baslist
-        #}}}
-    #}}}
-
-    def addicecap(self, md):  #{{{
+        # }}}
+    # }}}
+
+    def addicecap(self, md):  # {{{
         if not type(md) == model:
             raise Exception("addicecap method only takes a 'model' class object as input")
 
         self.icecaps.append(md)
-    #}}}
-
-    def basinsplot3d(self, *args):  #{{{
+    # }}}
+
+    def basinsplot3d(self, *args):  # {{{
         for i in range(len(self.basins)):
             self.basins[i].plot3d(*args)
-    #}}}
-
-    def caticecaps(self, *args):  #{{{
+    # }}}
+
+    def caticecaps(self, *args):  # {{{
         # Recover options
         options = pairoptions(*args)
@@ -356,7 +373,7 @@
         # Create mesh radius
         self.earth.mesh.r = planetradius('earth') * np.ones((md.mesh.numberofvertices, ))
-    #}}}
-
-    def caticecaps2d(self, *args):  #{{{
+    # }}}
+
+    def caticecaps2d(self, *args):  # {{{
         # Recover options
         options = pairoptions(*args)
@@ -382,7 +399,7 @@
         # Plug into earth
         self.earth = md
-    #}}}
-
-    def viscousiterations(self):  #{{{
+    # }}}
+
+    def viscousiterations(self):  # {{{
         for i in range(len(self.icecaps)):
             ic = self.icecaps[i]
@@ -391,7 +408,7 @@
                 mvi = np.max(mvi, ic.results.TransientSolution[j].StressbalanceConvergenceNumSteps)
             print("{}, {}: {}".format(i, self.icecaps[i].miscellaneous.name, mvi))
-    #}}}
-
-    def maxtimestep(self):  #{{{
+    # }}}
+
+    def maxtimestep(self):  # {{{
         for i in range(len(self.icecaps)):
             ic = self.icecaps[i]
@@ -403,7 +420,7 @@
         timei = self.earth.results.TransientSolution[-1].time
         print("Earth: {}/{}", mvi, timei)
-    #}}}
-
-    def transfer(self, string):  #{{{
+    # }}}
+
+    def transfer(self, string):  # {{{
         # Recover field size in one icecap
         n = getsubattr(self.icecaps[0], string).shape[0]
@@ -426,9 +443,9 @@
             times = capfield1[-1, :]
             nsteps = len(times)
-            #}}}
+            # }}}
             # Initialize #{{{
             field = np.zeros((self.earth.mesh.numberofvertices + 1, nsteps))
             field[-1, :] = times  # Transfer the times only, not the values
-            #}}}
+            # }}}
             # Transfer all the time fields #{{{
             for i in range(len(self.icecaps)):
@@ -437,5 +454,5 @@
                     field[self.transitions[i], j] = capfieldi[0:-1, j]  # Transfer only the values, not the time
             setsubattr(self.earth, string, field)  # Do not forget to plug the field variable into its final location
-            #}}}
+            # }}}
         elif n == (self.icecaps[0].mesh.numberofelements):
             setsubattr(self.earth, string, np.zeros((self.earth.mesh.numberofelements, ))) # Assign array of zeros to target attribute
@@ -445,7 +462,7 @@
         else:
             raise Exception('not supported yet')
-    #}}}
-
-    def homogenize(self, noearth=0):  #{{{
+    # }}}
+
+    def homogenize(self, noearth=0):  # {{{
         mintimestep = np.inf
 
@@ -470,10 +487,10 @@
 
         return self
-    #}}}
-
-    def initializemodels(self):  #{{{
+    # }}}
+
+    def initializemodels(self):  # {{{
         for i in range(len(self.basins)):
             md = model()
             md.miscellaneous.name = self.basins[i].name
             self.addicecap(md)
-    #}}}
+    # }}}
Index: /issm/trunk/src/m/classes/slr.js
===================================================================
--- /issm/trunk/src/m/classes/slr.js	(revision 26743)
+++ /issm/trunk/src/m/classes/slr.js	(revision 26744)
@@ -114,5 +114,6 @@
 		} //}}}
 		this.marshall=function(md,prefix,fid) { //{{{
-
+			console.log('WARNING: NOT MARHSALLING SLR FOR NOW.');
+			return;
 			WriteData(fid,prefix,'object',this,'fieldname','deltathickness','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'object',this,'fieldname','sealevel','mattype',1,'format','DoubleMat','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
Index: sm/trunk/src/m/classes/slr.m
===================================================================
--- /issm/trunk/src/m/classes/slr.m	(revision 26743)
+++ 	(revision )
@@ -1,257 +1,0 @@
-%SLR class definition
-%
-%   Usage:
-%      slr=slr();
-
-classdef slr
-	properties (SetAccess=public) 
-		deltathickness         = NaN;
-		sealevel               = NaN;
-		spcthickness           = NaN;
-		maxiter                = 0;
-		reltol                 = 0;
-		abstol                 = 0;
-		love_h                 = 0; %provided by PREM model
-		love_k                 = 0; %ideam
-		love_l                 = 0; %ideam
-		tide_love_k            = 0; %ideam
-		tide_love_h            = 0; %ideam
-		fluid_love             = 0;
-		equatorial_moi         = 0;
-		polar_moi              = 0;
-		angular_velocity       = 0;
-		rigid                  = 0;
-		elastic                = 0;
-		rotation               = 0;
-		ocean_area_scaling     = 0;
-		hydro_rate             = 0; %rate of steric expansion from hydrological effects.
-		geodetic_run_frequency = 1; %how many time steps we skip before we run the geodetic part of the solver during transient
-		geodetic               = 0; %compute geodetic SLR? (in addition to steric?)
-		degacc                 = 0;
-		horiz                  = 0;
-		planetradius           = planetradius('earth');
-		requested_outputs      = {};
-		transitions            = {};
-	end
-	methods
-		function self = slr(varargin) % {{{
-			switch nargin
-				case 0
-					self=setdefaultparameters(self);
-				otherwise
-					error('constructor not supported');
-			end
-		end % }}}
-		function self = setdefaultparameters(self) % {{{
-		
-		%Convergence criterion: absolute, relative and residual
-		self.reltol=0.01; % 1 per cent 
-		self.abstol=NaN;  % default 
-
-		%maximum of non-linear iterations.
-		self.maxiter=5;
-
-		%computational flags: 
-		self.geodetic=0;
-		self.rigid=1;
-		self.elastic=1;
-		self.ocean_area_scaling=0;
-		self.rotation=1;
-
-		%tidal love numbers: 
-		self.tide_love_h=0.6149; %degree 2
-		self.tide_love_k=0.3055; % degree 2
-	
-		%secular fluid love number: 
-		self.fluid_love=0.942; 
-		
-		%moment of inertia: 
-		self.equatorial_moi=8.0077*10^37; % [kg m^2] 
-		self.polar_moi		 =8.0345*10^37; % [kg m^2] 
-
-		% mean rotational velocity of earth 
-		self.angular_velocity=7.2921*10^-5; % [s^-1] 
-
-		%numerical discretization accuracy
-		self.degacc=.01;
-
-		%hydro
-		self.hydro_rate=0;
-	
-		%how many time steps we skip before we run SLR solver during transient
-		self.geodetic_run_frequency=1;
-	
-		%output default:
-		self.requested_outputs={'default'};
-
-		%transitions should be a cell array of vectors: 
-		self.transitions={};
-
-		%horizontal displacement?  (not by default)
-		self.horiz=0;
-
-		%earth area
-		self.planetradius= planetradius('earth');
-		
-		end % }}}
-		function md = checkconsistency(self,md,solution,analyses) % {{{
-
-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslr==0), 
-				return; 
-			end
-
-			%md = checkfield(md,'fieldname','slr.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','slr.deltathickness','timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','slr.spcthickness','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','slr.love_h','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.love_k','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.love_l','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.tide_love_h','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.tide_love_k','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.fluid_love','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.equatorial_moi','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.polar_moi','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.angular_velocity','NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','slr.reltol','size',[1 1]);
-			md = checkfield(md,'fieldname','slr.abstol','size',[1 1]);
-			md = checkfield(md,'fieldname','slr.maxiter','size',[1 1],'>=',1);
-			md = checkfield(md,'fieldname','slr.geodetic_run_frequency','size',[1 1],'>=',1);
-			md = checkfield(md,'fieldname','slr.hydro_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','slr.degacc','size',[1 1],'>=',1e-10);
-			md = checkfield(md,'fieldname','slr.requested_outputs','stringrow',1);
-			md = checkfield(md,'fieldname','slr.horiz','NaN',1,'Inf',1,'values',[0 1]);
-
-			%check that love numbers are provided at the same level of accuracy: 
-			if (size(self.love_h,1)~=size(self.love_k,1) | size(self.love_h,1)~=size(self.love_l,1)),
-				error('slr error message: love numbers should be provided at the same level of accuracy');
-			end
-
-			%cross check that whereever we have an ice load, the mask is <0 on each vertex: 
-			%pos=find(self.deltathickness);
-			%maskpos=md.mask.ice_levelset(md.mesh.elements(pos,:)); 
-			%[els,vertices]=find(maskpos>0);
-			%if length(els),
-			%	warning('slr checkconsistency fail: there are elements with ice loads where some vertices are not on the ice!');
-			%end
-
-			%check that if geodetic is requested, we are a mesh3dsurface model (planet), or if we are not, 
-			%a coupler to a planet model is provided. 
-			if self.geodetic,
-				if md.transient.iscoupler, 
-					%we are good; 
-				else
-					if strcmpi(class(md.mesh),'mesh3dsurface'),
-						%we are good
-					else
-						error('model is requesting geodetic computations without being a mesh3dsurface, or being coupled to one!');
-					end
-				end
-			end
-
-		end % }}}
-		function list=defaultoutputs(self,md) % {{{
-			list = {'Sealevel'};
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   slr parameters:'));
-
-			fielddisplay(self,'deltathickness','thickness change: ice height equivalent [m]');
-			fielddisplay(self,'sealevel','current sea level (prior to computation) [m]');
-			fielddisplay(self,'spcthickness','thickness constraints (NaN means no constraint) [m]');
-			fielddisplay(self,'reltol','sea level rise relative convergence criterion, (default, NaN: not applied)');
-			fielddisplay(self,'abstol','sea level rise absolute convergence criterion, NaN: not applied');
-			fielddisplay(self,'maxiter','maximum number of nonlinear iterations');
-			fielddisplay(self,'love_h','load Love number for radial displacement');
-			fielddisplay(self,'love_k','load Love number for gravitational potential perturbation');
-			fielddisplay(self,'love_l','load Love number for horizontal displacements');
-			fielddisplay(self,'tide_love_k','tidal load Love number (deg 2)');
-			fielddisplay(self,'tide_love_h','tidal load Love number (deg 2)');
-			fielddisplay(self,'fluid_love','secular fluid Love number');
-			fielddisplay(self,'equatorial_moi','mean equatorial moment of inertia [kg m^2]');
-			fielddisplay(self,'polar_moi','polar moment of inertia [kg m^2]');
-			fielddisplay(self,'angular_velocity','mean rotational velocity of earth [per second]'); 
-			fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'); 
-			fielddisplay(self,'hydro_rate','rate of hydrological expansion (in mm/yr)'); 
-			fielddisplay(self,'geodetic','compute geodetic SLR? ( in addition to steric?) default 0');
-			fielddisplay(self,'geodetic_run_frequency','how many time steps we skip before we run SLR solver during transient (default: 1)');
-			fielddisplay(self,'rigid','rigid earth graviational potential perturbation');
-			fielddisplay(self,'elastic','elastic earth graviational potential perturbation');
-			fielddisplay(self,'rotation','earth rotational potential perturbation');
-			fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions');
-			fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps');
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			%WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',2);
-			WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			%WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofelements+1);
-			WriteData(fid,prefix,'object',self,'fieldname','sealevel','mattype',1,'format','DoubleMat','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','reltol','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','abstol','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','love_h','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','love_k','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','love_l','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','tide_love_h','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','tide_love_k','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','fluid_love','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','equatorial_moi','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','polar_moi','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','angular_velocity','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','rigid','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','elastic','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','rotation','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','ocean_area_scaling','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','geodetic_run_frequency','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','hydro_rate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3/md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','degacc','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray');
-			WriteData(fid,prefix,'object',self,'fieldname','horiz','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','geodetic','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','planetradius','format','Double');
-			
-			%process requested outputs
-			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
-			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-			end
-			WriteData(fid,prefix,'data',outputs,'name','md.slr.requested_outputs','format','StringArray');
-
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejs1Darray(fid,[modelname '.slr.deltathickness'],self.deltathickness);
-			writejs1Darray(fid,[modelname '.slr.sealevel'],self.sealevel);
-			writejs1Darray(fid,[modelname '.slr.spcthickness'],self.spcthickness);
-			writejsdouble(fid,[modelname '.slr.maxiter'],self.maxiter);
-			writejsdouble(fid,[modelname '.slr.reltol'],self.reltol);
-			writejsdouble(fid,[modelname '.slr.abstol'],self.abstol);
-			writejs1Darray(fid,[modelname '.slr.love_h'],self.love_h);
-			writejs1Darray(fid,[modelname '.slr.love_k'],self.love_k);
-			writejs1Darray(fid,[modelname '.slr.love_l'],self.love_l);
-			writejsdouble(fid,[modelname '.slr.tide_love_k'],self.tide_love_k);
-			writejsdouble(fid,[modelname '.slr.tide_love_h'],self.tide_love_h);
-			writejsdouble(fid,[modelname '.slr.fluid_love'],self.fluid_love);
-			writejsdouble(fid,[modelname '.slr.equatorial_moi'],self.equatorial_moi);
-			writejsdouble(fid,[modelname '.slr.polar_moi'],self.polar_moi);
-			writejsdouble(fid,[modelname '.slr.angular_velocity'],self.angular_velocity);
-			writejsdouble(fid,[modelname '.slr.rigid'],self.rigid);
-			writejsdouble(fid,[modelname '.slr.elastic'],self.elastic);
-			writejsdouble(fid,[modelname '.slr.rotation'],self.rotation);
-			writejsdouble(fid,[modelname '.slr.ocean_area_scaling'],self.ocean_area_scaling);
-			writejsdouble(fid,[modelname '.slr.geodetic_run_frequency'],self.geodetic_run_frequency);
-			writejs1Darray(fid,[modelname '.slr.hydro_rate'],self.hydro_rate);
-			writejsdouble(fid,[modelname '.slr.degacc'],self.degacc);
-			writejscellstring(fid,[modelname '.slr.requested_outputs'],self.requested_outputs);
-			writejscellarray(fid,[modelname '.slr.transitions'],self.transitions);
-		end % }}}
-		function self = extrude(self,md) % {{{
-			self.sealevel=project3d(md,'vector',self.sealevel,'type','node');
-		end % }}}
-	end
-end
Index: /issm/trunk/src/m/classes/slr.py
===================================================================
--- /issm/trunk/src/m/classes/slr.py	(revision 26743)
+++ /issm/trunk/src/m/classes/slr.py	(revision 26744)
@@ -7,13 +7,13 @@
 from planetradius import planetradius
 from WriteData import WriteData
+from project3d import project3d
 
 
 class slr(object):
-    '''
-    SLR class definition
-
-        Usage:
-          slr = slr()
-    '''
+    """SLR class definition
+
+    Usage:
+        slr = slr()
+    """
     def __init__(self):  # {{{
         self.deltathickness = np.nan
@@ -120,5 +120,5 @@
     def checkconsistency(self, md, solution, analyses):  # {{{
         # Early return
-        if 'SealevelriseAnalysis' not in analyses or (solution == 'TransientSolution' and not md.transient.isslr):
+        if 'SealevelchangeAnalysis' not in analyses or (solution == 'TransientSolution' and not md.transient.isslr):
             return md
 
@@ -153,5 +153,5 @@
         els = np.where(maskpos > 0)
         if len(els[0]) > 0:
-            warnings.warn('slr checkconsistency fail: there are elements with ice loads where some vertices are not on the ice!')
+            print('Warning: slr.py::checkconsistency: there are elements with ice loads where some vertices are not on the ice!')
 
         # Check that if geodetic is requested, we are a mesh3dsurface model (planet), or if we are not, a coupler to a planet model is provided
Index: /issm/trunk/src/m/classes/solidearth.js
===================================================================
--- /issm/trunk/src/m/classes/solidearth.js	(revision 26744)
+++ /issm/trunk/src/m/classes/solidearth.js	(revision 26744)
@@ -0,0 +1,135 @@
+class solidearth {//{{{
+	/**
+	 * SOLIDEARTH class definition
+	 *
+	 * Usage:
+	 *     solidearth = solidearth();
+	 *     solidearth = solidearth('earth');
+	 */
+	constructor() {//{{{
+		this.settings = new solidearthsettings();
+		this.external = null;
+		this.lovenumbers = new lovenumbers();
+		this.rotational = new rotational();
+		this.planetradius = planetradius('earth');
+		this.requested_outputs = [];
+		this.transitions = [];
+		this.partitionice = [];
+		this.partitionhydro = [];
+		this.partitionocean = [];
+
+		let nargs = arguments.length;
+		if (nargs == 0) {
+			this.setdefaultparameters('earth');
+		} else if (nargs == 1) {
+			this.setdefaultparameters(arguments[0]);
+		} else {
+			error('solidearth constructor error message: zero or one argument only!');
+		}
+	} //}}}
+
+	disp() {//{{{
+		console.log('WARNING: solidearth::disp is not yet implemented');
+	} //}}}
+
+	setdefaultparameters(planet) {//{{{
+		// Output default
+		this.requested_outputs = ['default'];
+
+		// Transitions should be an array
+		this.transitions = [];
+
+		// No partitions requested for barystatic contribution
+		this.partitionice = [];
+		this.partitionhydro = [];
+		this.partitionocean = [];
+
+		// No external solutions by default
+		this.external = null;
+
+		// Planet radius
+		this.planetradius = planetradius(planet);
+	} //}}}
+
+	checkconsistency(md, solution, analyses) {//{{{
+		if (!analyses.includes('SealevelchangeAnalysis') || (solution === 'TransientSolution' && !md.transient.isslc)) {
+			return md;
+		}
+
+		md = checkfield(md, 'fieldname', 'solidearth.requested_outputs', 'stringrow', 1);
+
+		this.settings.checkconsistency(md, solution, analyses);
+		this.lovenumbers.checkconsistency(md, solution, analyses);
+		this.rotational.checkconsistency(md, solution, analyses);
+
+		if (this.external != null) {
+			if (typeof(this.external) != 'solidearthsolution') {
+				error('solidearth consistency check: external field should be a solidearthsolution');
+			}
+		}
+
+		return md;
+	} //}}}
+
+	defaultoutputs(md) {//{{{
+		return ['Sealevel'];
+	} //}}}
+
+	marshall(md, prefix, fid) {//{{{
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'planetradius', 'format', 'Double');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'transitions', 'format', 'MatArray');
+
+		let npartice = 0;
+		if (this.partitionice.length) {
+			npartice = max(this.partitionice) + 2;
+		}
+
+		let nparthydro = 0;
+		if (this.partitionhydro.length) {
+			nparthydro = max(this.partitionhydro) + 2;
+		}
+
+		let npartocean = 0;
+		if (this.partitionocean.length) {
+			npartocean = max(this.partitionocean) + 2;
+		}
+
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'partitionice', 'mattype', 1, 'format', 'DoubleMat');
+		WriteData(fid, prefix, 'data', npartice, 'format', 'Integer', 'name', 'md.solidearth.npartice');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'partitionhydro', 'mattype', 1, 'format', 'DoubleMat');
+		WriteData(fid, prefix, 'data', nparthydro, 'format', 'Integer', 'name', 'md.solidearth.nparthydro');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'partitionocean', 'mattype', 1, 'format', 'DoubleMat');
+		WriteData(fid, prefix, 'data', npartocean, 'format', 'Integer', 'name', 'md.solidearth.npartocean');
+
+		this.settings.marshall(md, prefix, fid);
+		this.lovenumbers.marshall(md, prefix, fid);
+		this.rotational.marshall(md, prefix, fid);
+
+		if (this.external != null) {
+			WriteData(fid, prefix, 'data', 1, 'format', 'Integer', 'name', 'md.solidearth.isexternal');
+			this.external.marshall(md, prefix, fid);
+		} else {
+			WriteData(fid, prefix, 'data', 0, 'format', 'Integer', 'name', 'md.solidearth.isexternal');
+		}
+
+		// Process requested outputs
+		let outputs = this.requested_outputs;
+		let pos = find(ismember(outputs, 'default'));
+		if (pos.length) {
+			/*
+			NOTE: In order to handle case where user has added 'default' more 
+			than once to this.requested_outputs, need to remove elements by 
+			index in reverse order.
+			*/
+			for (let i = (pos.length - 1); i >= 0; --i) {
+				outputs.splice(pos[i], 1);
+			}
+
+			outputs.push(this.defaultoutputs(md));
+		}
+		WriteData(fid, prefix, 'data', outputs, 'name', 'md.solidearth.requested_outputs', 'format', 'StringArray');
+	} //}}}
+
+	extrude(md) {//{{{
+	} //}}}
+} //}}}
Index: /issm/trunk/src/m/classes/solidearth.m
===================================================================
--- /issm/trunk/src/m/classes/solidearth.m	(revision 26743)
+++ /issm/trunk/src/m/classes/solidearth.m	(revision 26744)
@@ -3,11 +3,10 @@
 %   Usage:
 %      solidearth=solidearth();
+%      solidearth=solidearth('earth');
 
 classdef solidearth
 	properties (SetAccess=public) 
-		initialsealevel        = NaN;
 		settings               = solidearthsettings(); 
 		external               = [];
-		surfaceload            = surfaceload();
 		lovenumbers            = lovenumbers();
 		rotational             = rotational();
@@ -17,4 +16,22 @@
 		partitionice           = [];
 		partitionhydro         = [];
+		partitionocean         = [];
+	end
+	methods (Static)
+		function self = loadobj(self) % {{{
+			% This function is directly called by matlab when a model object is
+			% loaded. If the input is a struct it is an old version of this class and
+			% old fields must be recovered (make sure they are in the deprecated
+			% model properties)
+
+			if isstruct(self)
+				% 2021, Jan 10
+				if isfield(self,'sealevel')
+					self.initialsealevel = self.sealevel;
+				end
+				self = structtoobj(solidearth(),self);
+
+			end
+		end% }}}
 	end
 	methods
@@ -29,4 +46,22 @@
 			end
 		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   solidearth inputs, forcings and settings:'));
+
+			fielddisplay(self,'planetradius','planet radius [m]');
+			fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps');
+			fielddisplay(self,'requested_outputs','additional outputs requested');
+			fielddisplay(self,'partitionice','ice partition vector for barystatic contribution');
+			fielddisplay(self,'partitionhydro','hydro partition vector for barystatic contribution');
+			fielddisplay(self,'partitionocean','ocean partition vector for barystatic contribution');
+			if isempty(self.external), fielddisplay(self,'external','external solution, of the type solidearthsolution'); end
+			self.settings.disp();
+			self.lovenumbers.disp();
+			self.rotational.disp();
+			if ~isempty(self.external),
+				self.external.disp();
+			end
+
+		end % }}}
 		function self = setdefaultparameters(self,planet) % {{{
 
@@ -34,29 +69,28 @@
 			self.requested_outputs={'default'};
 
-			%transitions should be a cell array of vectors: 
+			%transitions should be a cell array of vectors:
 			self.transitions={};
-			
-			%no partitions requested for barystatic contribution: 
+
+			%no partitions requested for barystatic contribution:
 			self.partitionice=[];
 			self.partitionhydro=[];
+			self.partitionocean=[];
 
-			%no external solutions by defalt: 
+			%no external solutions by default:
 			self.external=[];
 
-			%earth radius
+			%planet radius
 			self.planetradius= planetradius(planet);
-		
+
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
 
-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslr==0), 
+			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
 				return; 
 			end
 
-			md = checkfield(md,'fieldname','solidearth.initialsealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
 			md = checkfield(md,'fieldname','solidearth.requested_outputs','stringrow',1);
 
 			self.settings.checkconsistency(md,solution,analyses);
-			self.surfaceload.checkconsistency(md,solution,analyses);
 			self.lovenumbers.checkconsistency(md,solution,analyses);
 			self.rotational.checkconsistency(md,solution,analyses);
@@ -68,34 +102,13 @@
 			end
 
-			
 		end % }}}
 		function list=defaultoutputs(self,md) % {{{
 			list = {'Sealevel'};
 		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   solidearth inputs, forcings and settings:'));
+		function marshall(self,prefix,md,fid) % {{{
 
-			fielddisplay(self,'initialsealevel','sea level at the start of computation) [m]');
-			fielddisplay(self,'planetradius','planet radius [m]');
-			fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps');
-			fielddisplay(self,'requested_outputs','additional outputs requested');
-			fielddisplay(self,'partitionice','ice partition vector for barystatic contribution');
-			fielddisplay(self,'partitionhydro','hydro partition vector for barystatic contribution');
-			if isempty(self.external), fielddisplay(self,'external','external solution, of the type solidearthsolution'); end
-			self.settings.disp();
-			self.surfaceload.disp();
-			self.lovenumbers.disp();
-			self.rotational.disp();
-			if ~isempty(self.external),
-				self.external.disp();
-			end
-
-		end % }}}
-		function marshall(self,prefix,md,fid) % {{{
-			
-			WriteData(fid,prefix,'object',self,'fieldname','initialsealevel','mattype',1,'format','DoubleMat','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'fieldname','planetradius','format','Double');
 			WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray');
-		
+
 			if ~isempty(self.partitionice),
 				npartice=max(self.partitionice)+2;
@@ -103,4 +116,5 @@
 				npartice=0;
 			end
+
 			if ~isempty(self.partitionhydro),
 				nparthydro=max(self.partitionhydro)+2;
@@ -108,22 +122,30 @@
 				nparthydro=0;
 			end
+			if ~isempty(self.partitionocean),
+				npartocean=max(self.partitionocean)+2;
+			else
+				npartocean=0;
+			end
 
-			
 			WriteData(fid,prefix,'object',self,'fieldname','partitionice','mattype',1,'format','DoubleMat');
 			WriteData(fid,prefix,'data',npartice,'format','Integer','name','md.solidearth.npartice');
 			WriteData(fid,prefix,'object',self,'fieldname','partitionhydro','mattype',1,'format','DoubleMat');
 			WriteData(fid,prefix,'data',nparthydro,'format','Integer','name','md.solidearth.nparthydro');
-			
+			WriteData(fid,prefix,'object',self,'fieldname','partitionocean','mattype',1,'format','DoubleMat');
+			WriteData(fid,prefix,'data',npartocean,'format','Integer','name','md.solidearth.npartocean');
+
 			self.settings.marshall(prefix,md,fid);
-			self.surfaceload.marshall(prefix,md,fid);
 			self.lovenumbers.marshall(prefix,md,fid);
 			self.rotational.marshall(prefix,md,fid);
 			if ~isempty(self.external),
+				WriteData(fid,prefix,'data',1,'format','Integer','name','md.solidearth.isexternal');
 				self.external.marshall(prefix,md,fid);
+			else
+				WriteData(fid,prefix,'data',0,'format','Integer','name','md.solidearth.isexternal');
 			end
-			
+
 			%process requested outputs
 			outputs = self.requested_outputs;
-			pos  = find(ismember(outputs,'default'));
+			pos = find(ismember(outputs,'default'));
 			if ~isempty(pos),
 				outputs(pos) = [];                         %remove 'default' from outputs
@@ -133,9 +155,9 @@
 
 		end % }}}
+		function self = extrude(self,md) % {{{
+		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
 		
-			writejs1Darray(fid,[modelname '.solidearth.initialsealevel'],self.initialsealevel);
 			self.settings.savemodeljs(fid,modelname);
-			self.surfaceload.savemodeljs(fid,modelname);
 			self.lovenumbers.savemodeljs(fid,modelname);
 			self.rotational.savemodeljs(fid,modelname);
@@ -147,7 +169,4 @@
 			writejscellarray(fid,[modelname '.solidearth.partition'],self.partition);
 		end % }}}
-		function self = extrude(self,md) % {{{
-			self.initialsealevel=project3d(md,'vector',self.initialsealevel,'type','node');
-		end % }}}
 	end
 end
Index: /issm/trunk/src/m/classes/solidearth.py
===================================================================
--- /issm/trunk/src/m/classes/solidearth.py	(revision 26743)
+++ /issm/trunk/src/m/classes/solidearth.py	(revision 26744)
@@ -4,9 +4,10 @@
 from fielddisplay import fielddisplay
 from lovenumbers import lovenumbers
+from MatlabFuncs import *
 from planetradius import planetradius
 from project3d import project3d
 from rotational import rotational
 from solidearthsettings import solidearthsettings
-from surfaceload import surfaceload
+from solidearthsolution import solidearthsolution
 from WriteData import WriteData
 
@@ -17,11 +18,13 @@
     Usage:
         solidearth = solidearth()
+        solidearth = solidearth('earth')
+
+    TODO:
+    - Update translation from solidearth.m
     """
 
-    def __init__(self, *args):  #{{{
-        self.initialsealevel    = np.nan
+    def __init__(self, *args):  # {{{
         self.settings           = solidearthsettings()
-        self.external           = []
-        self.surfaceload        = surfaceload()
+        self.external           = None
         self.lovenumbers        = lovenumbers()
         self.rotational         = rotational()
@@ -31,7 +34,7 @@
         self.partitionice       = []
         self.partitionhydro     = []
+        self.partitionocean     = []
 
         nargs = len(args)
-
         if nargs == 0:
             self.setdefaultparameters('earth')
@@ -40,9 +43,7 @@
         else:
             raise Exception('solidearth constructor error message: zero or one argument only!')
-    #}}}
-
+    # }}}
     def __repr__(self):  # {{{
         s = '   solidearthinputs, forcings and settings:\n'
-        s += '{}\n'.format(fielddisplay(self, 'initialsealevel', 'sea level at the start of computation [m]'))
         s += '{}\n'.format(fielddisplay(self, 'planetradius', 'planet radius [m]'))
         s += '{}\n'.format(fielddisplay(self, 'transitions', 'indices into parts of the mesh that will be icecaps'))
@@ -50,17 +51,16 @@
         s += '{}\n'.format(fielddisplay(self, 'partitionice', 'ice partition vector for barystatic contribution'))
         s += '{}\n'.format(fielddisplay(self, 'partitionhydro', 'hydro partition vector for barystatic contribution'))
+        s += '{}\n'.format(fielddisplay(self, 'partitionocean', 'ocean partition vector for barystatic contribution'))
         if not self.external:
             s += '{}\n'.format(fielddisplay(self, 'external', 'external solution, of the type solidearthsolution'))
         print(self.settings)
-        print(self.surfaceload)
         print(self.lovenumbers)
         print(self.rotational)
-        if self.external:
+        if len(self.external):
             print(self.external)
         return s
-    #}}}
-
+    # }}}
     def setdefaultparameters(self, planet):  # {{{
-        # Default output
+        # Output default
         self.requested_outputs = ['default']
 
@@ -71,36 +71,31 @@
         self.partitionice = []
         self.partitionhydro = []
+        self.partitionocean = []
 
-        # No external solutions by defalt
-        self.external = []
+        # No external solutions by default
+        self.external = None
 
-        # Earth radius
+        # Planet radius
         self.planetradius = planetradius(planet)
-    #}}}
+    # }}}
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+            return md
 
-    def checkconsistency(self, md, solution, analyses):  # {{{
-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr):
-            return md
-        md = checkfield(md, 'fieldname', 'solidearth.initialsealevel', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
         md = checkfield(md, 'fieldname', 'solidearth.requested_outputs', 'stringrow', 1)
 
         self.settings.checkconsistency(md, solution, analyses)
-        self.surfaceload.checkconsistency(md, solution, analyses)
         self.lovenumbers.checkconsistency(md, solution, analyses)
         self.rotational.checkconsistency(md, solution, analyses)
         if self.external:
-            if not isinstance(self.external,'solidearthsolution'):
+            if not isa(self.external, solidearthsolution):
                 raise Exception('solidearth consistency check: external field should be a solidearthsolution')
-            end
-            self.external.checkconsistency(md,solution,analyses)
+            self.external.checkconsistency(md, solution, analyses)
         return md
-    #}}}
-
-    def defaultoutputs(self, md):  #{{{
+    # }}}
+    def defaultoutputs(self, md):  # {{{
         return ['Sealevel']
-    #}}}
-
-    def marshall(self, prefix, md, fid):  #{{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'initialsealevel', 'mattype', 1, 'format', 'DoubleMat', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+    # }}}
+    def marshall(self, prefix, md, fid):  # {{{
         WriteData(fid, prefix, 'object', self, 'fieldname', 'planetradius', 'format', 'Double')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'transitions', 'format', 'MatArray')
@@ -116,27 +111,34 @@
             nparthydro = 0
 
+        if len(self.partitionocean):
+            npartocean = np.max(self.partitionocean) + 2
+        else:
+            npartocean = 0
+
         WriteData(fid, prefix, 'object', self, 'fieldname', 'partitionice', 'mattype', 1, 'format', 'DoubleMat');
         WriteData(fid, prefix, 'data', npartice, 'format', 'Integer', 'name', 'md.solidearth.npartice');
         WriteData(fid, prefix, 'object', self, 'fieldname', 'partitionhydro', 'mattype', 1, 'format', 'DoubleMat');
         WriteData(fid, prefix, 'data', nparthydro,'format', 'Integer', 'name','md.solidearth.nparthydro');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'partitionocean', 'mattype', 1, 'format', 'DoubleMat');
+        WriteData(fid, prefix, 'data', npartocean,'format', 'Integer', 'name','md.solidearth.npartocean');
 
         self.settings.marshall(prefix, md, fid)
-        self.surfaceload.marshall(prefix, md, fid)
         self.lovenumbers.marshall(prefix, md, fid)
         self.rotational.marshall(prefix, md, fid)
         if self.external:
+            WriteData(fid, prefix, 'data', 1, 'format', 'Integer', 'name', 'md.solidearth.isexternal')
             self.external.marshall(prefix, md, fid)
+        else:
+            WriteData(fid, prefix, 'data', 0, 'format', 'Integer', 'name', 'md.solidearth.isexternal')
 
-        #process requested outputs
+        # Process requested outputs
         outputs = self.requested_outputs
         pos = np.where(np.asarray(outputs) == 'default')[0]
         if len(pos):
-            outputs = np.delete(outputs, pos)  #remove 'default' from outputs
-            outputs = np.append(outputs, self.defaultoutputs(md))  #add defaults
+            outputs = np.delete(outputs, pos) # remove 'default' from outputs
+            outputs = np.append(outputs, self.defaultoutputs(md)) # add defaults
         WriteData(fid, prefix, 'data', outputs, 'name', 'md.solidearth.requested_outputs', 'format', 'StringArray')
-    #}}}
-
-    def extrude(self, md): #{{{
-        self.initialsealevel = project3d(md, 'vector', self.initialsealevel, 'type', 'node')
+    # }}}
+    def extrude(self, md):  # {{{
         return self
-    #}}}
+    # }}}
Index: /issm/trunk/src/m/classes/solidearthsettings.js
===================================================================
--- /issm/trunk/src/m/classes/solidearthsettings.js	(revision 26744)
+++ /issm/trunk/src/m/classes/solidearthsettings.js	(revision 26744)
@@ -0,0 +1,145 @@
+class solidearthsettings {//{{{
+	/**
+	 * SOLIDEARTHSETTINGS class definition
+	 *
+	 * Usage:
+	 *     solidearthsettings = solidearthsettings();
+	 */
+	constructor() {//{{{
+		this.reltol					= 0;
+		this.abstol					= 0;
+		this.maxiter				= 0;
+		this.selfattraction			= 1;
+		this.elastic				= 1;
+		this.viscous				= 1;
+		this.rotation				= 1;
+		this.grdocean				= 1;
+		this.ocean_area_scaling		= 0;
+		this.runfrequency			= 1; // How many time steps will we skip before we run grd_core
+		this.sealevelloading		= 1; // Will sea-level loads be computed?
+		this.isgrd					= 0; // Will GRD patterns be computed?
+		this.compute_bp_grd			= 0; // Will GRD patterns for bottom pressures be computed?
+		this.degacc					= 0; // Degree increment for resolution of Green tables
+		this.timeacc				= 0; // Time step accuracy required to compute Green tables
+		this.horiz					= 0; // Compute horizontal deformation
+		this.grdmodel				= 0; // GRD model (0 by defualt, 1 for (visco-)elastic, 2 for Ivins)
+		this.cross_section_shape	= 0; // Cross section only used when GRD model is Ivins
+
+		if (arguments.length == 0) {
+			this.setdefaultparameters();
+		} else {
+			error('constructor not supported');
+		}
+	} //}}}
+
+	disp() {//{{{
+		console.log('WARNING: solidearthsettings::disp is not yet implemented');
+	} //}}}
+
+	setdefaultparameters() {//{{{
+		// Convergence criterion: absolute, relative, and residual
+		this.restol = 0.01; // 1 percent
+		this.abstol = NaN;
+
+		// Maximum of non-linear iterations
+		this.maxiter = 5;
+
+		// Computational flags
+		this.selfattraction = 1;
+		this.elastic = 1;
+		this.viscous = 1;
+		this.rotation = 1;
+		this.grdocean = 1;
+		this.ocean_area_scaling = 0;
+		this.compute_bp_grd = 0;
+		this.isgrd = 0;
+		this.sealevelloading = 1;
+
+		// Numerical discretiztion accuracy
+		this.degacc = 0.01;
+		this.timeacc = 1;
+
+		// How many time steps we skip before we run solidearthsettings solver during transient
+		this.runfrequency = 1;
+
+		// Horizontal displacement? (not on by default)
+		this.horiz = 0;
+
+		// Cross section for Ivins model
+		this.cross_section_shape = 1; // Square as default (see idege in GiaDeflectionCorex)
+
+		// No GRD model by default
+		this.grdmodel = 0;
+	} //}}}
+
+	checkconsistency(md, solution, analyses) {//{{{
+		if (!analyses.includes('SealevelchangeAnalysis') || (solution === 'TransientSolution' && !md.transient.isslc)) {
+			return md;
+		}
+
+		md = checkfield(md, 'fieldname', 'solidearth.settings.reltol', 'size', [1]);
+		md = checkfield(md, 'fieldname', 'solidearth.settings.abstol', 'size', [1]);
+		md = checkfield(md, 'fieldname', 'solidearth.settings.maxiter', 'size', [1], '>=', 1);
+		md = checkfield(md, 'fieldname', 'solidearth.settings.runfrequency', 'size', [1], '>=', 1);
+		md = checkfield(md, 'fieldname', 'solidearth.settings.degacc', 'size', [1], '>=', 1e-10);
+		md = checkfield(md, 'fieldname', 'solidearth.settings.timeacc', 'size', [1], '>', 0);
+		md = checkfield(md, 'fieldname', 'solidearth.settings.horiz', 'NaN', 1, 'Inf', 1, 'values', [0, 1]);
+		md = checkfield(md, 'fieldname', 'solidearth.settings.grdmodel', '>=', 0, '<=', 2);
+		md = checkfield(md, 'fieldname', 'solidearth.settings.cross_section_shape', 'numel', [1], 'values', [1, 2]);
+
+		// Checks on computational flags
+		if (this.elastic && !this.rigid) {
+			error('solidearthsettings checkconsistency error message: need rigid on if elastic flag is set');
+		}
+		if (this.viscous && !this.elastic) {
+			error('solidearthsettings checkconsistency error message: need elastic on if viscous flag is set');
+		}
+
+		// A GRD computation has been requested, make some checks on the nature of the meshes provided
+		if (this.isgrd) {
+			if (strcmpi(typeof(md.mesh), 'mesh3dsurface')) {
+				if (this.grdmodel == 2) {
+					error('model requires a 2D mesh to run gia Ivins computations (change mesh from mesh3dsurface to mesh2d)');
+				}
+			} else {
+				if (this.grdmodel == 1) {
+					error('model requires a 3D surface mesh to run GRD computations (change mesh from mesh2d to mesh3dsurface)');
+				}
+			}
+			
+			if (this.sealevelloading && !this.grdocean) {
+				error('solidearthsettings checkconsistency error message: need grdocean on if sealevelloading flag is set');
+			}
+		}
+
+		if (this.compute_bp_grd && !md.solidearth.settings.isgrd) {
+			error('solidearthsettings checkconsistency error message; if bottom pressure grd patterns are requested, solidearth settings class should have isgrd flag on');
+		}
+
+		return md;
+	} //}}}
+
+	marshall(md, prefix, fid) {//{{{
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'reltol', 'name', 'md.solidearth.settings.reltol', 'format', 'Double');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'abstol', 'name', 'md.solidearth.settings.abstol', 'format', 'Double');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'maxiter', 'name', 'md.solidearth.settings.maxiter', 'format', 'Integer');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'selfattraction', 'name', 'md.solidearth.settings.selfattraction', 'format', 'Boolean');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'elastic', 'name', 'md.solidearth.settings.elastic', 'format', 'Boolean');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'viscous', 'name', 'md.solidearth.settings.viscous', 'format', 'Boolean');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'rotation', 'name', 'md.solidearth.settings.rotation', 'format', 'Boolean');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'grdocean', 'name', 'md.solidearth.settings.grdocean', 'format', 'Boolean');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'ocean_area_scaling', 'name', 'md.solidearth.settings.ocean_area_scaling', 'format', 'Boolean');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'runfrequency', 'name', 'md.solidearth.settings.runfrequency', 'format', 'Integer');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'degacc', 'name', 'md.solidearth.settings.degacc', 'format', 'Double');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'timeacc', 'name', 'md.solidearth.settings.timeacc', 'format', 'Double', 'scale', md.constants.yts);
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'horiz', 'name', 'md.solidearth.settings.horiz', 'format', 'Integer');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'sealevelloading', 'name', 'md.solidearth.settings.sealevelloading', 'format', 'Integer');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'isgrd', 'name', 'md.solidearth.settings.isgrd', 'format', 'Integer');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'compute_bp_grd', 'name', 'md.solidearth.settings.compute_bp_grd', 'format', 'Integer');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'grdmodel', 'name', 'md.solidearth.settings.grdmodel', 'format', 'Integer');
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'cross_section_shape', 'name', 'md.solidearth.settings.cross_section_shape', 'format', 'Integer');
+	} //}}}
+
+	extrude(md) {//{{{
+	} //}}}
+} //}}}
Index: /issm/trunk/src/m/classes/solidearthsettings.m
===================================================================
--- /issm/trunk/src/m/classes/solidearthsettings.m	(revision 26743)
+++ /issm/trunk/src/m/classes/solidearthsettings.m	(revision 26744)
@@ -5,20 +5,46 @@
 
 classdef solidearthsettings
-	properties (SetAccess=public) 
+	properties (SetAccess=public)
 		reltol                 = 0;
 		abstol                 = 0;
 		maxiter                = 0;
-		rigid                  = 0;
-		elastic                = 0;
-		rotation               = 0;
+		selfattraction         = 1;
+		elastic                = 1;
+		viscous                = 1;
+		rotation               = 1;
+		grdocean               = 1;
 		ocean_area_scaling     = 0;
 		runfrequency           = 1; %how many time steps we skip before we run grd_core
-		computesealevelchange  = 1; %will sea-level be coputed? 
-		isgrd                  = 1; %will GRD patterns be computed? 
-		degacc                 = 0; %degree increment for resolution of Green tables
+		sealevelloading        = 1; %will sea-level loads be computed? 
+		isgrd                  = 0; %will GRD patterns be computed? 
+		compute_bp_grd         = 0; %will GRD patterns for bottom pressures be computed? 
+		degacc                 = 0; %degree increment for resolution of Green tables.
+		timeacc                = 0; %time step accuracy required to compute Green tables
 		horiz                  = 0; %compute horizontal deformation
-		glfraction             = 1; %barystatic contribution full or fractional (default fractional)
+		grdmodel               = 0; %grd model (0 by default, 1 for (visco-)elastic, 2 for Ivins)
+		cross_section_shape    = 0; %cross section only used when grd model is Ivins
+	end
+	methods (Static)
+		function self = loadobj(self) % {{{
+			% This function is directly called by matlab when a model object is
+			% loaded. If the input is a struct it is an old version of this class and
+			% old fields must be recovered (make sure they are in the deprecated
+			% model properties)
+
+			if isstruct(self)
+				% 2021, Jun 4
+				if isfield(self,'rigid')
+					self.selfattraction = self.rigid;
+				end
+				if isfield(self,'computesealevelchange')
+					self.sealevelloading = self.computesealevelchange;
+				end
+				self = structtoobj(solidearthsettings(),self);
+
+			end
+		end% }}}
 	end
 	methods
+
 		function self = solidearthsettings(varargin) % {{{
 			switch nargin
@@ -30,35 +56,64 @@
 		end % }}}
 		function self = setdefaultparameters(self) % {{{
-		
-		%Convergence criterion: absolute, relative and residual
-		self.reltol=0.01; % 1 per cent 
-		self.abstol=NaN;  % default 
 
-		%maximum of non-linear iterations.
-		self.maxiter=5;
+			%Convergence criterion: absolute, relative and residual
+			self.reltol=0.01; % 1 percent
+			self.abstol=NaN;  % default
 
-		%computational flags: 
-		self.rigid=1;
-		self.elastic=1;
-		self.rotation=1;
-		self.ocean_area_scaling=0;
-		self.isgrd=1;
-		self.computesealevelchange=1;
+			%maximum of non-linear iterations.
+			self.maxiter=5;
 
-		%numerical discretization accuracy
-		self.degacc=.01;
+			%computational flags:
+			self.selfattraction=1;
+			self.elastic=1;
+			self.viscous=1;
+			self.rotation=1;
+			self.grdocean=1;
+			self.ocean_area_scaling=0;
+			self.compute_bp_grd=0;
+			self.isgrd=0;
+			self.sealevelloading=1;
 
-		%how many time steps we skip before we run solidearthsettings solver during transient
-		self.runfrequency=1;
-		
-		%fractional contribution: 
-		self.glfraction=1;
-	
-		%horizontal displacement?  (not by default)
-		self.horiz=0;
+			%numerical discretization accuracy
+			self.degacc=.01;
+			self.timeacc=1; 
+
+			%how many time steps we skip before we run solidearthsettings solver during transient
+			self.runfrequency=1;
+
+			%horizontal displacement? (not on by default)
+			self.horiz=0;
+
+			%cross section for Ivins model
+			self.cross_section_shape=1; %square as default (see iedge in GiaDeflectionCorex)
+
+			%no grd model by default:
+			self.grdmodel=0;
+
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   solidearth settings:'));
+
+			fielddisplay(self,'reltol','sea level change relative convergence criterion (default, NaN: not applied)');
+			fielddisplay(self,'abstol','sea level change absolute convergence criterion(default, NaN: not applied)');
+			fielddisplay(self,'maxiter','maximum number of nonlinear iterations');
+			fielddisplay(self,'grdocean','does this planet have an ocean, if set to 1: global water mass is conserved in GRD module (default: 1)'); 
+			fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area (default: No correction)'); 
+			fielddisplay(self,'sealevelloading','enables surface loading from sea-level change (default: 1)');
+			fielddisplay(self,'isgrd','compute GRD patterns (default: 1)');
+			fielddisplay(self,'compute_bp_grd','compute GRD patterns for bottom pressure loads (default: 1)');
+			fielddisplay(self,'runfrequency','how many time steps we skip before we run solidearthsettings solver during transient (default: 1)');
+			fielddisplay(self,'selfattraction','enables surface mass load to perturb the gravity field');
+			fielddisplay(self,'elastic','enables elastic deformation from surface loading');
+			fielddisplay(self,'viscous','enables viscous deformation from surface loading');
+			fielddisplay(self,'rotation','enables polar motion to feedback on the GRD fields');
+			fielddisplay(self,'degacc','accuracy (default: .01 deg) for numerical discretization of the Green''s functions');
+			fielddisplay(self,'timeacc','time accuracy (default: 1 yr) for numerical discretization of the Green''s functions');
+			fielddisplay(self,'grdmodel','type of deformation model, 0 for no GRD, 1 for spherical GRD model (SESAW model), 2 for half-space planar GRD (visco-elastic model from Ivins)');
+			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore');
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
 
-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslr==0), 
+			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
 				return; 
 			end
@@ -68,41 +123,36 @@
 			md = checkfield(md,'fieldname','solidearth.settings.runfrequency','size',[1 1],'>=',1);
 			md = checkfield(md,'fieldname','solidearth.settings.degacc','size',[1 1],'>=',1e-10);
+			md = checkfield(md,'fieldname','solidearth.settings.timeacc','size',[1 1],'>',0);
 			md = checkfield(md,'fieldname','solidearth.settings.horiz','NaN',1,'Inf',1,'values',[0 1]);
-			md = checkfield(md,'fieldname','solidearth.settings.glfraction','values',[0 1]);
+			md = checkfield(md,'fieldname','solidearth.settings.grdmodel','>=',0,'<=',2);
+			md = checkfield(md,'fieldname','solidearth.settings.cross_section_shape','numel',[1],'values',[1,2]);
 
-			%checks on computational flags
-			if self.elastic==1 & self.rigid==0,
-				error('solidearthsettings checkconsistency error message: need rigid on if elastic flag is set');
+			if self.elastic==1 & self.selfattraction==0,
+				error('solidearthsettings checkconsistency error message: need selfattraction on if elastic flag is set');
+			end
+			if self.viscous==1 & self.elastic==0,
+				error('solidearthsettings checkconsistency error message: need elastic on if viscous flag is set');
 			end
 
-			%a coupler to a planet model is provided. 
+			%a GRD computation has been requested, make some checks on the nature of the meshes provided. 
 			if self.isgrd,
-				if md.transient.iscoupler, 
-					%we are good; 
+				if strcmpi(class(md.mesh),'mesh3dsurface'),
+					if self.grdmodel==2,
+						error('model requires a 2D mesh to run gia Ivins computations (change mesh from mesh3dsurface to mesh2d)');
+					end
 				else
-					if strcmpi(class(md.mesh),'mesh3dsurface'),
-						%we are good
-					else
-						error('model is requesting sealevel computations without being a mesh3dsurface, or being coupled to one!');
+					if self.grdmodel==1,
+						error('model requires a 3D surface mesh to run GRD computations (change mesh from mesh2d to mesh3dsurface)');
 					end
+				end
+				if self.sealevelloading==1 & self.grdocean==0
+					error('solidearthsettings checkconsistency error message: need grdocean on if sealevelloading flag is set');
 				end
 			end
 
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   solidearth settings:'));
+			if self.compute_bp_grd==1 & md.solidearth.settings.isgrd==0,
+					error('solidearthsettings checkconsistency error message; if bottom pressure grd patterns are requested, solidearth settings class should have isgrd flag on');
+			end
 
-			fielddisplay(self,'reltol','sea level rise relative convergence criterion, (default, NaN: not applied)');
-			fielddisplay(self,'abstol','sea level rise absolute convergence criterion, NaN: not applied');
-			fielddisplay(self,'maxiter','maximum number of nonlinear iterations');
-			fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'); 
-			fielddisplay(self,'computesealevelchange','compute sealevel change (default 1)');
-			fielddisplay(self,'isgrd','compute GRD patterns (default 1)');
-			fielddisplay(self,'runfrequency','how many time steps we skip before we run solidearthsettings solver during transient (default: 1)');
-			fielddisplay(self,'rigid','rigid earth graviational potential perturbation');
-			fielddisplay(self,'elastic','elastic earth graviational potential perturbation');
-			fielddisplay(self,'rotation','earth rotational potential perturbation');
-			fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions');
-			fielddisplay(self,'glfraction','contribute fractionally (default, 1) to barystatic sea level');
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -110,30 +160,38 @@
 			WriteData(fid,prefix,'object',self,'fieldname','abstol','name','md.solidearth.settings.abstol','format','Double');
 			WriteData(fid,prefix,'object',self,'fieldname','maxiter','name','md.solidearth.settings.maxiter','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','rigid','name','md.solidearth.settings.rigid','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','selfattraction','name','md.solidearth.settings.selfattraction','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','elastic','name','md.solidearth.settings.elastic','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','viscous','name','md.solidearth.settings.viscous','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','rotation','name','md.solidearth.settings.rotation','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','grdocean','name','md.solidearth.settings.grdocean','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','ocean_area_scaling','name','md.solidearth.settings.ocean_area_scaling','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','runfrequency','name','md.solidearth.settings.runfrequency','format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','degacc','name','md.solidearth.settings.degacc','format','Double');
+			WriteData(fid,prefix,'object',self,'fieldname','timeacc','name','md.solidearth.settings.timeacc','format','Double','scale',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'fieldname','horiz','name','md.solidearth.settings.horiz','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','computesealevelchange','name','md.solidearth.settings.computesealevelchange','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','sealevelloading','name','md.solidearth.settings.sealevelloading','format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','isgrd','name','md.solidearth.settings.isgrd','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','glfraction','name','md.solidearth.settings.glfraction','format','Integer');
-		end % }}}
-		function savemodeljs(self,fid,modelname) % {{{
-		
-			writejsdouble(fid,[modelname '.slr.settings.maxiter'],self.maxiter);
-			writejsdouble(fid,[modelname '.slr.settings.reltol'],self.reltol);
-			writejsdouble(fid,[modelname '.slr.settings.abstol'],self.abstol);
-			writejsdouble(fid,[modelname '.slr.settings.rigid'],self.rigid);
-			writejsdouble(fid,[modelname '.slr.settings.elastic'],self.elastic);
-			writejsdouble(fid,[modelname '.slr.settings.rotation'],self.rotation);
-			writejsdouble(fid,[modelname '.slr.settings.ocean_area_scaling'],self.ocean_area_scaling);
-			writejsdouble(fid,[modelname '.slr.settings.run_frequency'],self.run_frequency);
-			writejsdouble(fid,[modelname '.slr.settings.degacc'],self.degacc);
-			writejsdouble(fid,[modelname '.slr.settings.glfraction'],self.glfraction);
+			WriteData(fid,prefix,'object',self,'fieldname','compute_bp_grd','name','md.solidearth.settings.compute_bp_grd','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','grdmodel','name','md.solidearth.settings.grdmodel','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','cross_section_shape','name','md.solidearth.settings.cross_section_shape','format','Integer');
 		end % }}}
 		function self = extrude(self,md) % {{{
 		end % }}}
+		function savemodeljs(self,fid,modelname) % {{{
+			% TODO: Update the following fields so that coverage is complete
+			writejsdouble(fid,[modelname '.solidearth.settings.maxiter'],self.maxiter);
+			writejsdouble(fid,[modelname '.solidearth.settings.reltol'],self.reltol);
+			writejsdouble(fid,[modelname '.solidearth.settings.abstol'],self.abstol);
+			writejsdouble(fid,[modelname '.solidearth.settings.selfattraction'],self.selfattraction);
+			writejsdouble(fid,[modelname '.solidearth.settings.elastic'],self.elastic);
+			writejsdouble(fid,[modelname '.solidearth.settings.viscous'],self.viscous);
+			writejsdouble(fid,[modelname '.solidearth.settings.rotation'],self.rotation);
+			writejsdouble(fid,[modelname '.solidearth.settings.grdocean'],self.rotation);
+			writejsdouble(fid,[modelname '.solidearth.settings.ocean_area_scaling'],self.ocean_area_scaling);
+			writejsdouble(fid,[modelname '.solidearth.settings.run_frequency'],self.run_frequency);
+			writejsdouble(fid,[modelname '.solidearth.settings.degacc'],self.degacc);
+			writejsdouble(fid,[modelname '.solidearth.settings.timeacc'],self.timeacc);
+			writejsdouble(fid,[modelname '.solidearth.settings.cross_section_shape'],self.cross_section_shape);
+		end % }}}
 	end
 end
Index: /issm/trunk/src/m/classes/solidearthsettings.py
===================================================================
--- /issm/trunk/src/m/classes/solidearthsettings.py	(revision 26743)
+++ /issm/trunk/src/m/classes/solidearthsettings.py	(revision 26744)
@@ -13,47 +13,56 @@
     """
 
-    def __init__(self, *args):  #{{{
+    def __init__(self, *args):  # {{{
         self.reltol                 = 0
         self.abstol                 = 0
         self.maxiter                = 0
-        self.rigid                  = 0
-        self.elastic                = 0
-        self.rotation               = 0
+        self.selfattraction         = 1
+        self.elastic                = 1
+        self.viscous                = 1
+        self.rotation               = 1
+        self.grdocean               = 1
         self.ocean_area_scaling     = 0
         self.runfrequency           = 1 # How many time steps we skip before we run grd_core
-        self.computesealevelchange  = 1 # Will grd_core compute sea level?
-        self.isgrd                  = 1 # Will GRD patterns be computed?
+        self.sealevelloading        = 1 # Will sea-level loads be computed?
+        self.isgrd                  = 0 # Will GRD patterns be computed?
+        self.compute_bp_grd         = 0 # Will GRD patterns for bottom pressures be computed?
         self.degacc                 = 0 # Degree increment for resolution of Green tables
-        self.horiz                  = 0 # Compute horizontal displacement?
-        self.glfraction             = 1 # Barystatic contribution: full or fractional (default: fractional)
+        self.timeacc                = 0 # Time step accuracy required to compute Green tables
+        self.horiz                  = 0 # Compute horizontal deformation?
+        self.grdmodel               = 0 # GRD model (0 by default, 1 for (visco-)elastic, 2 for Ivins)
+        self.cross_section_shape    = 0 # Cross section only used when GRD model is Ivins
 
-        nargin = len(args)
-
-        if nargin == 0:
+        if len(args) == 0:
             self.setdefaultparameters()
         else:
             raise Exception('constructor not supported')
-    #}}}
+    # }}}
 
-    def __repr__(self): # {{{
+    def __repr__(self):  # {{{
         s = '   solidearth settings:\n'
-        s += '{}\n'.format(fielddisplay(self, 'reltol', 'sea level rise relative convergence criterion, (default, NaN: not applied)'))
-        s += '{}\n'.format(fielddisplay(self, 'abstol', 'sea level rise absolute convergence criterion, NaN: not applied'))
+        s += '{}\n'.format(fielddisplay(self, 'reltol', 'sea level change relative convergence criterion (default, NaN: not applied)'))
+        s += '{}\n'.format(fielddisplay(self, 'abstol', 'sea level change absolute convergence criterion (default, NaN: not applied)'))
         s += '{}\n'.format(fielddisplay(self, 'maxiter', 'maximum number of nonlinear iterations'))
-        s += '{}\n'.format(fielddisplay(self, 'ocean_area_scaling', 'correction for model representation of ocean area [default: No correction]'))
-        s += '{}\n'.format(fielddisplay(self, 'computesealevelchange', 'compute sealevel change from GRD in addition to steric?) default 0'))
+        s += '{}\n'.format(fielddisplay(self, 'grdocean', 'does this planet have an ocean, if set to 1: global water mass is conserved in GRD module (default: 1)'))
+        s += '{}\n'.format(fielddisplay(self, 'ocean_area_scaling', 'correction for model representation of ocean area (default: No correction)'))
+        s += '{}\n'.format(fielddisplay(self, 'sealevelloading', 'enables surface loading from sea-level change (default: 1)'))
         s += '{}\n'.format(fielddisplay(self, 'isgrd', 'compute GRD patterns (default: 1'))
+        s += '{}\n'.format(fielddisplay(self, 'compute_bp_grd', 'compute GRD patterns for bottom pressure loads (default 1)'))
         s += '{}\n'.format(fielddisplay(self, 'runfrequency', 'how many time steps we skip before we run solidearthsettings solver during transient (default: 1)'))
-        s += '{}\n'.format(fielddisplay(self, 'rigid', 'rigid earth graviational potential perturbation'))
-        s += '{}\n'.format(fielddisplay(self, 'elastic', 'elastic earth graviational potential perturbation'))
-        s += '{}\n'.format(fielddisplay(self, 'degacc', 'accuracy (default .01 deg) for numerical discretization of the Green\'s functions'))
-        s += '{}\n'.format(fielddisplay(self, 'glfraction', 'contribute fractionally (default, 1) to barystatic sea level'))
+        s += '{}\n'.format(fielddisplay(self, 'selfattraction', 'enables surface mass load to perturb the gravity field'))
+        s += '{}\n'.format(fielddisplay(self, 'elastic', 'enables elastic deformation from surface loading'))
+        s += '{}\n'.format(fielddisplay(self, 'viscous', 'enables viscous deformation from surface loading'))
+        s += '{}\n'.format(fielddisplay(self, 'rotation', 'enables polar motion to feedback on the GRD fields'))
+        s += '{}\n'.format(fielddisplay(self, 'degacc', 'accuracy (default: .01 deg) for numerical discretization of the Green\'s functions'))
+        s += '{}\n'.format(fielddisplay(self, 'timeacc', 'time accuracy (default: 1 year) for numerical discretization of the Green\'s functions'))
+        s += '{}\n'.format(fielddisplay(self, 'grdmodel', 'type of deformation model, 0 for no GRD, 1 for spherical GRD model (SESAW model), 2 for half-space planar GRD (visco-elastic model from Ivins)'))
+        s += '{}\n'.format(fielddisplay(self, 'cross_section_shape', '1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore'))
         return s
-    #}}}
+    # }}}
 
-    def setdefaultparameters(self): # {{{
+    def setdefaultparameters(self):  # {{{
         # Convergence criterion: absolute, relative, and residual
-        self.reltol = 0.01 # 1 percent
-        self.abstol = np.nan # default
+        self.reltol = 0.01  # 1 percent
+        self.abstol = np.nan  # default
 
         # Maximum of non-linear iterations
@@ -61,27 +70,35 @@
 
         # Computational flags
-        self.rigid = 1
+        self.selfattraction = 1
         self.elastic = 1
+        self.viscous = 1
         self.rotation = 1
+        self.grdocean = 1
         self.ocean_area_scaling = 0
-        self.isgrd = 1
-        self.computesealevelchange = 1
+        self.compute_bp_grd = 0
+        self.isgrd = 0
+        self.sealevelloading = 1
 
         # Numerical discretization accuracy
-        self.degacc = .01
+        self.degacc = 0.01
+        self.timeacc = 1
 
         # How many time steps we skip before we run solidearthsettings solver during transient
         self.runfrequency = 1
 
-        # Fractional contribution
-        self.glfraction = 1
-
         # Horizontal displacement? (not on by default)
         self.horiz = 0
-    #}}}
 
-    def checkconsistency(self, md, solution, analyses): # {{{
-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr):
+        # Cross section for Ivins model
+        self.cross_section_shape = 1 # Square as default (see iedge in GiaDeflectionCorex)
+
+        # No GRD model by default
+        self.grdmodel = 0
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
             return md
+
         md = checkfield(md, 'fieldname', 'solidearth.settings.reltol', 'size', [1])
         md = checkfield(md, 'fieldname', 'solidearth.settings.abstol', 'size', [1])
@@ -89,42 +106,53 @@
         md = checkfield(md, 'fieldname', 'solidearth.settings.runfrequency', 'size', [1], '>=', 1)
         md = checkfield(md, 'fieldname', 'solidearth.settings.degacc', 'size', [1], '>=', 1e-10)
+        md = checkfield(md, 'fieldname', 'solidearth.settings.timeacc', 'size', [1], '>', 0)
         md = checkfield(md, 'fieldname', 'solidearth.settings.horiz', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'solidearth.settings.glfraction', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'solidearth.settings.grdmodel', '>=', 0, '<=', 2)
+        md = checkfield(md, 'fieldname', 'solidearth.settings.cross_section_shape', 'numel', [1], 'values', [1, 2])
 
-        # Checks on computational flags
-        if self.elastic and not self.rigid:
-            raise Exception('solidearthsettings checkconsistency error message: need rigid on if elastic flag is set')
+        if self.elastic and not self.selfattraction:
+            raise Exception('solidearthsettings checkconsistency error message: need selfattraction on if elastic flag is set')
+        if self.viscous and not self.elastic:
+            raise Exception('solidearthsettings checkconsistency error message: need elastic on if viscous flag is set')
 
-        # A coupler to planet model is provided
+        # A GRD computation has been requested, make some checks on the nature of the meshes provided
         if self.isgrd:
-            if md.transient.iscoupler:
-                # We are good
-                pass
+            if md.mesh.__class__.__name__ == 'mesh3dsurface':
+                if self.grdmodel == 2:
+                    raise RuntimeException('model requires a 2D mesh to run gia Ivins computations (change mesh from mesh3dsurface to mesh2d)')
             else:
-                if md.mesh.__class__.__name__ == 'mesh3dsurface':
-                    # We are good
-                    pass
-                else:
-                    raise Exception('model is requesting sealevel computations without being a mesh3dsurface, or being coupled to one!')
+                if self.grdmodel == 1:
+                    raise RuntimeException('model requires a 3D surface mesh to run GRD computations (change mesh from mesh2d to mesh3dsurface)')
+            if self.sealevelloading and not self.grdocean:
+                raise RuntimeException('solidearthsettings checkconsistency error message: need grdocean on if sealevelloading flag is set')
+
+        if self.compute_bp_grd and not md.solidearth.settings.isgrd:
+            raise RuntimeException('solidearthsettings checkconsistency error message; if bottom pressure grd patterns are requested, solidearth settings class should have isgrd flag on')
+
         return md
-    #}}}
+    # }}}
 
-    def marshall(self, prefix, md, fid): #{{{
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'reltol', 'name', 'md.solidearth.settings.reltol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'abstol', 'name', 'md.solidearth.settings.abstol', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'name', 'md.solidearth.settings.maxiter', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'rigid', 'name', 'md.solidearth.settings.rigid', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'elastic', 'name', 'md.solidearth.settings.elastic', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'rotation', 'name', 'md.solidearth.settings.rotation', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'ocean_area_scaling', 'name', 'md.solidearth.settings.ocean_area_scaling', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'runfrequency', 'name', 'md.solidearth.settings.runfrequency', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'degacc', 'name', 'md.solidearth.settings.degacc', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'horiz', 'name', 'md.solidearth.settings.horiz', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'computesealevelchange', 'name', 'md.solidearth.settings.computesealevelchange', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname','isgrd', 'name', 'md.solidearth.settings.isgrd', 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname','glfraction', 'name', 'md.solidearth.settings.glfraction', 'format', 'Integer')
-    #}}}
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'reltol', 'name', 'md.solidearth.settings.reltol', 'format', 'Double');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'abstol', 'name', 'md.solidearth.settings.abstol', 'format', 'Double');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'name', 'md.solidearth.settings.maxiter', 'format', 'Integer');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'selfattraction', 'name', 'md.solidearth.settings.selfattraction', 'format', 'Boolean');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'elastic', 'name', 'md.solidearth.settings.elastic', 'format', 'Boolean');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'viscous', 'name', 'md.solidearth.settings.viscous', 'format', 'Boolean');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'rotation', 'name', 'md.solidearth.settings.rotation', 'format', 'Boolean');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'grdocean', 'name', 'md.solidearth.settings.grdocean', 'format', 'Boolean');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'ocean_area_scaling', 'name', 'md.solidearth.settings.ocean_area_scaling', 'format', 'Boolean');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'runfrequency', 'name', 'md.solidearth.settings.runfrequency', 'format', 'Integer');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'degacc', 'name', 'md.solidearth.settings.degacc', 'format', 'Double');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'timeacc', 'name', 'md.solidearth.settings.timeacc', 'format', 'Double', 'scale', md.constants.yts);
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'horiz', 'name', 'md.solidearth.settings.horiz', 'format', 'Integer');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevelloading', 'name', 'md.solidearth.settings.sealevelloading', 'format', 'Integer');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isgrd', 'name', 'md.solidearth.settings.isgrd', 'format', 'Integer');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'compute_bp_grd', 'name', 'md.solidearth.settings.compute_bp_grd', 'format', 'Integer');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'grdmodel', 'name', 'md.solidearth.settings.grdmodel', 'format', 'Integer');
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'cross_section_shape', 'name', 'md.solidearth.settings.cross_section_shape', 'format', 'Integer');
+    # }}}
 
-    def extrude(self, md): #{{{
+    def extrude(self, md):  # {{{
         return self
-    #}}}
+    # }}}
Index: /issm/trunk/src/m/classes/solidearthsolution.js
===================================================================
--- /issm/trunk/src/m/classes/solidearthsolution.js	(revision 26744)
+++ /issm/trunk/src/m/classes/solidearthsolution.js	(revision 26744)
@@ -0,0 +1,77 @@
+class solidearthsolution {//{{{
+	/**
+	 * SOLIDEARTHSOLUTION class definition
+	 *
+	 * Usage:
+	 *     solidearthsolution = solidearthsolution();
+	 */
+	constructor() {//{{{
+		this.displacementeast	= [];
+		this.displacementnorth	= [];
+		this.displacementup		= [];
+		this.geoid				= [];
+
+		let nargs = arguments.length;
+		if (nargs == 0) {
+			this.setdefaultparameters();
+		} else {
+			error('constructor not supported');
+		}
+	} //}}}
+
+	setdefaultparameters() {//{{{
+		this.displacementeast	= [];
+		this.displacementnorth	= [];
+		this.displacementup		= [];
+		this.geoid				= [];
+	} //}}}
+
+	checkconsistency(md, solution, analyses) {//{{{
+		md = checkfield(md, 'fieldname', 'solidearth.external.displacementeast', 'Inf', 1, 'timeseries', 1);
+		md = checkfield(md, 'fieldname', 'solidearth.external.displacementnorth', 'Inf', 1, 'timeseries', 1);
+		md = checkfield(md, 'fieldname', 'solidearth.external.displacementup', 'Inf', 1, 'timeseries', 1);
+		md = checkfield(md, 'fieldname', 'solidearth.external.geoid', 'Inf', 1, 'timeseries', 1);
+
+		return md;
+	} //}}}
+
+	disp() {//{{{
+		console.log('WARNING: solidearthsolution::disp is not yet implemented');
+	} //}}}
+
+	marshall(md, prefix, fid) {//{{{
+		let yts = md.constants.yts;
+
+		// Transform our time series into time series rates
+		let displacementeast_rate	= [];
+		let displacementnorth_rate	= [];
+		let displacementup_rate		= [];
+		let geoid_rate				= [];
+		if (size(this.displacementeast, 1) == 1) {
+			disp('External solidearthsolution warning: only one time step provided, assuming the values are rates per year');
+			displacementeast_rate	= [this.displacementeast; 0];
+			displacementnorth_rate	= [this.displacementnorth; 0];
+			displacementup_rate		= [this.displacementup; 0];
+			geoid_rate				= [this.geoid; 0];
+		} else {
+			let time = this.displacementeast[end, :];
+			let dt = diff(time, 1, 2);
+			displacementeast_rate = diff(this.displacementeast[0:-1,:], 1, 2) ./ dt;
+			displacementeast_rate[end + 1, :] = time[0:-1];
+			displacementnorth_rate = diff(this.displacementnorth_rate[0:-1,:], 1, 2) ./ dt;
+			displacementnorth_rate[end + 1, :] = time[0:-1];
+			displacementup_rate = diff(this.displacementup_rate[0:-1,:], 1, 2) ./ dt;
+			displacementup_rate[end + 1, :] = time[0:-1];
+			geoid_rate = diff(this.geoid_rate[0:-1,:], 1, 2) ./ dt;
+			geoid_rate[end + 1, :] = tgeoid_rateime[0:-1];
+		}
+
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'displacementeast', 'data', displacementeast_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementeast', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'displacementup', 'data', displacementup_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementup', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'displacementnorth', 'data', displacementnorth_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementnorth', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+		WriteData(fid, prefix, 'object', this, 'fieldname', 'geoid', 'data', geoid_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.geoid', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+	} //}}}
+
+	extrude(md) {//{{{
+	} //}}}
+} //}}}
Index: /issm/trunk/src/m/classes/solidearthsolution.m
===================================================================
--- /issm/trunk/src/m/classes/solidearthsolution.m	(revision 26743)
+++ /issm/trunk/src/m/classes/solidearthsolution.m	(revision 26744)
@@ -10,5 +10,4 @@
 		displacementup=[];
 		geoid=[];
-		barystaticsealevel=[];
 	end
 	methods
@@ -21,4 +20,12 @@
 			end
 		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('%s','         units for time series is (yr)'));
+			fielddisplay(self,'displacementeast','solid-Earth Eastwards bedrock displacement series (m)');
+			fielddisplay(self,'displacementnorth','solid-Earth Northwards bedrock displacement time series (m)');
+			fielddisplay(self,'displacementup','solid-Earth bedrock uplift time series (m)');
+			fielddisplay(self,'geoid','solid-Earth geoid time series (m)');
+
+		end % }}}
 		function self = setdefaultparameters(self) % {{{
 	
@@ -27,5 +34,4 @@
 			self.displacementup=[];
 			self.geoid=[];
-			self.barystaticsealevel=[];
 	
 		end % }}}
@@ -36,23 +42,35 @@
 			md = checkfield(md,'fieldname','solidearth.external.displacementup','Inf',1,'timeseries',1);
 			md = checkfield(md,'fieldname','solidearth.external.geoid','Inf',1,'timeseries',1);
-			md = checkfield(md,'fieldname','solidearth.external.barystaticsealevel','Inf',1,'timeseries',1);
-
-		end % }}}
-		function disp(self) % {{{
-			fielddisplay(self,'displacementeast','solid-Earth Eastwards bedrock motion (m/yr)');
-			fielddisplay(self,'displacementnorth','solid-Earth Northwards bedrock motion (m/yr)');
-			fielddisplay(self,'displacementup','solid-Earth bedrock uplift rate (m/yr)');
-			fielddisplay(self,'geoid','solid-Earth geoid motion (m/yr)');
-			fielddisplay(self,'barystaticsealevel','barystatic absolute sea-level rate (m/yr)');
 
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
 			yts=md.constants.yts;
-			WriteData(fid,prefix,'object',self,'class','solidearthsolution','fieldname','displacementeast','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','solidearthsolution','fieldname','displacementnorth','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','solidearthsolution','fieldname','displacementup','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','solidearthsolution','fieldname','geoid','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','solidearthsolution','fieldname','barystaticsealevel','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-	
+
+			%transform our time series into time series rates 
+			if size(self.displacementeast,2)==1
+				disp('External solidearthsolution warning: only one time step provided, assuming the values are rates per year');
+				displacementeast_rate=[self.displacementeast;0];
+				displacementnorth_rate=[self.displacementnorth;0];
+				displacementup_rate=[self.displacementup;0];
+				geoid_rate=[self.geoid;0];
+			else
+				time=self.displacementeast(end,:);
+				dt=diff(time,1,2);
+				displacementeast_rate=diff(self.displacementeast(1:end-1,:),1,2)./dt;
+				displacementeast_rate(end+1,:)=time(1:end-1);
+				displacementnorth_rate=diff(self.displacementnorth(1:end-1,:),1,2)./dt;
+				displacementnorth_rate(end+1,:)=time(1:end-1);
+				displacementup_rate=diff(self.displacementup(1:end-1,:),1,2)./dt;
+				displacementup_rate(end+1,:)=time(1:end-1);
+				geoid_rate=diff(self.geoid(1:end-1,:),1,2)./dt;
+				geoid_rate(end+1,:)=time(1:end-1);
+			end
+
+			WriteData(fid, prefix, 'name', 'md.solidearth.external.nature', 'data', 0, 'format', 'Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','data',displacementeast_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementeast','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+			WriteData(fid,prefix,'object',self,'fieldname','displacementup','data',displacementup_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementup','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','data',displacementnorth_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementnorth','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+			WriteData(fid,prefix,'object',self,'fieldname','geoid','data',geoid_rate,'format','DoubleMat','name', 'md.solidearth.external.geoid','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+			
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
@@ -61,5 +79,4 @@
 			writejs1Darray(fid,[modelname '.solidearth.external.displacementup'],self.displacementup);
 			writejs1Darray(fid,[modelname '.solidearth.external.geoid'],self.geoid);
-			writejs1Darray(fid,[modelname '.solidearth.external.barystaticsealevel'],self.barystaticsealevel);
 		end % }}}
 		function self = extrude(self,md) % {{{
Index: /issm/trunk/src/m/classes/solidearthsolution.py
===================================================================
--- /issm/trunk/src/m/classes/solidearthsolution.py	(revision 26744)
+++ /issm/trunk/src/m/classes/solidearthsolution.py	(revision 26744)
@@ -0,0 +1,85 @@
+import numpy as np
+
+from checkfield import checkfield
+from fielddisplay import fielddisplay
+from WriteData import WriteData
+
+
+class solidearthsolution(object):
+    """SOLIDEARTHSOLUTION class definition
+
+    Usage:
+        solidearthsolution = solidearthsolution()
+    """
+
+    def __init__(self, *args):  # {{{
+        self.displacementeast = []
+        self.displacementnorth = []
+        self.displacementup = []
+        self.geoid = []
+
+        if len(args) == 0:
+            self.setdefaultparameters()
+        else:
+            raise RuntimeError('constructor not supported')
+    # }}}
+
+    def __repr__(self):  # {{{
+        s = '         units for time series is (yr)\n'
+        s += '{}\n'.format(fielddisplay(self, 'displacementeast', 'solid-Earth Eastwards bedrock displacement series (m)'))
+        s += '{}\n'.format(fielddisplay(self, 'displacementnorth', 'solid-Earth Northwards bedrock displacement time series (m)'))
+        s += '{}\n'.format(fielddisplay(self, 'displacementup', 'solid-Earth bedrock uplift time series (m)'))
+        s += '{}\n'.format(fielddisplay(self, 'geoid', 'solid-Earth geoid time series (m)'))
+
+        return s
+    # }}}
+
+    def setdefaultparameters(self):  # {{{
+        self.displacementeast = []
+        self.displacementnorth = []
+        self.displacementup = []
+        self.geoid = []
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'solidearth.external.displacementeast', 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'solidearth.external.displacementnorth', 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'solidearth.external.displacementup', 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'solidearth.external.geoid', 'Inf', 1, 'timeseries', 1)
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+
+        print('sadjsda')
+        exit()
+
+        # Transform our time series into time series rates
+        if np.shape(self.displacementeast)[1] == 1:
+            print('solidearthsolution.py::marshall: Warning: only one time step provided, assuming the values are rates per year')
+            displacementeast_rate = np.append(np.array(self.displacementeast).reshape(-1, 1), 0)
+            displacementnorth_rate = np.append(np.array(self.displacementnorth).reshape(-1, 1), 0)
+            displacementup_rate = np.append(np.array(self.displacementup).reshape(-1, 1), 0)
+            geoid_rate = np.append(np.array(self.geoid).reshape(-1, 1), 0)
+        else:
+            time = self.displacementeast[-1, :]
+            dt = np.diff(time, axis=0)
+            displacementeast_rate = np.diff(self.displacementeast[0:-2, :], 1, 1) / dt
+            displacementeast_rate = np.append(displacementeast_rate,time[:-1].reshape(1,-1),axis=0)
+            displacementnorth_rate = np.diff(self.displacementnorth[0:-2, :], 1, 1) / dt
+            displacementnorth_rate = np.append(displacementnorth_rate,time[:-1].reshape(1,-1),axis=0)
+            displacementup_rate = np.diff(self.displacementup[0:-2, :], 1, 1) / dt
+            displacementup_rate = np.append(displacementup_rate,time[:-1].reshape(1,-1),axis=0)
+            geoid_rate = np.diff(self.geoid[0:-2, :], 1, 1) / dt
+            geoid_rate = np.append(geoid_rate,time[:-1].reshape(1,-1),axis=0)
+
+        WriteData(fid, prefix, 'name', 'md.solidearth.external.nature', 'data', 0, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementeast', 'data', displacementeast_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementeast', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementup', 'data', displacementup_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementup', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementnorth', 'data', displacementnorth_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementnorth', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'geoid', 'data', geoid_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.geoid', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+    # }}}
+
+    def extrude(self, md):  # {{{
+        return self
+    # }}}
Index: /issm/trunk/src/m/classes/stochasticforcing.m
===================================================================
--- /issm/trunk/src/m/classes/stochasticforcing.m	(revision 26744)
+++ /issm/trunk/src/m/classes/stochasticforcing.m	(revision 26744)
@@ -0,0 +1,210 @@
+%STOCHASTICFORCING class definition
+%
+%   Usage:
+%      stochasticforcing=stochasticforcing();
+
+classdef stochasticforcing
+	properties (SetAccess=public)
+		isstochasticforcing	= 0;
+		fields					= NaN;
+		defaultdimension		= 0;
+		default_id				= NaN;
+		covariance				= NaN;
+		randomflag				= 1;
+	end
+	methods
+		function self = stochasticforcing(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = extrude(self,md) % {{{
+			%Nothing for now
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+			self.isstochasticforcing	= 0; %stochasticforcing is turned off by default
+			self.randomflag				= 1; %true randomness is implemented by default
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			%Early return
+			if ~self.isstochasticforcing, return; end
+
+			num_fields = numel(self.fields);
+
+			%Check that covariance matrix is positive definite
+			try
+				chol(self.covariance);
+			catch
+				error('md.stochasticforcing.covariance is not positive definite');
+			end
+
+			%Check that all fields agree with the corresponding md class and if any field needs the default params
+			checkdefaults	= false; %need to check defaults only if one of the fields does not have its own dimensionality
+			structstoch		= structstochforcing();
+			for field=self.fields
+				%Checking agreement of classes
+				if(contains(field,'SMB'))
+					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
+					if~(isequal(class(md.smb),char(mdname)))
+						error('md.smb does not agree with stochasticforcing field %s', char(field));
+					end
+				end
+				if(contains(field,'FrontalForcings'))
+					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
+					if~(isequal(class(md.frontalforcings),char(mdname)))
+						error('md.frontalforcings does not agree with stochasticforcing field %s', char(field));
+					end
+				end
+				if(contains(field,'Calving'))
+					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
+					if~(isequal(class(md.calving),char(mdname)))
+						error('md.calving does not agree with stochasticforcing field %s', char(field));
+					end
+				end
+				if(contains(field,'BasalforcingsFloatingice'))
+					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
+					if~(isequal(class(md.basalforcings),char(mdname)))
+						error('md.basalforcings does not agree with stochasticforcing field %s', char(field));
+					end
+				end
+				if(contains(field,'WaterPressure'))
+               mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
+               if~(isequal(class(md.friction),char(mdname)))
+                  error('stochasticforcing field %s is only implemented for default friction', char(field));
+               end
+               if(md.friction.coupling~=0 && md.friction.coupling~=1 && md.friction.coupling~=2)
+                  error('stochasticforcing field %s is only implemented for cases md.friction.coupling 0 or 1 or 2', char(field));
+               end
+               if(any(md.friction.q==0))
+                  error('stochasticforcing field %s requires non-zero q exponent',char(field));
+               end
+            end
+				%Checking for specific dimensions
+				if ~(strcmp(field,'SMBautoregression') || strcmp(field,'FrontalForcingsRignotAutoregression'))
+					checkdefaults = true; %field with non-specific dimensionality
+				end
+			end
+
+			%Retrieve sum of all the field dimensionalities
+			size_tot	= self.defaultdimension*num_fields;
+			indSMBar	= -1; %about to check for index of SMBautoregression
+			indTFar	= -1; %about to check for index of FrontalForcingsRignotAutoregression
+			if any(contains(self.fields,'SMBautoregression'))
+				size_tot = size_tot-self.defaultdimension+md.smb.num_basins;
+				indSMBar = find(contains(self.fields,'SMBautoregression')); %index of SMBar, now check for consistency with TFar timestep (08Nov2021)
+			end
+			if any(contains(self.fields,'FrontalForcingsRignotAutoregression'))
+				size_tot	= size_tot-self.defaultdimension+md.frontalforcings.num_basins;
+				indTFar	= find(contains(self.fields,'FrontalForcingsRignotAutoregression')); %index of TFar, now check for consistency with SMBar timestep (08Nov2021)
+			end
+
+			if(indSMBar~=-1 && indTFar~=-1) %both autoregressive models are used: check autoregressive time step consistency
+				if((md.smb.ar_timestep~=md.frontalforcings.ar_timestep) && any(self.covariance(1+sum(self.dimensions(1:indSMBar-1)):sum(self.dimensions(1:indSMBar)),1+sum(self.dimensions(1:indTFar-1)):sum(self.dimensions(1:indTFar))))~=0)
+					error('SMBautoregression and FrontalForcingsRignotAutoregression have different ar_timestep and non-zero covariance');
+				end
+			end
+
+			md = checkfield(md,'fieldname','stochasticforcing.isstochasticforcing','values',[0 1]);
+			md = checkfield(md,'fieldname','stochasticforcing.fields','numel',num_fields,'cell',1,'values',supportedstochforcings());
+			md = checkfield(md,'fieldname','stochasticforcing.covariance','NaN',1,'Inf',1,'size',[size_tot,size_tot]); %global covariance matrix
+			md = checkfield(md,'fieldname','stochasticforcing.randomflag','numel',[1],'values',[0 1]);
+			if(checkdefaults) %need to check the defaults
+				md = checkfield(md,'fieldname','stochasticforcing.defaultdimension','numel',1,'NaN',1,'Inf',1,'>',0);
+				md = checkfield(md,'fieldname','stochasticforcing.default_id','Inf',1,'>=',0,'<=',self.defaultdimension,'size',[md.mesh.numberofelements,1]);
+			end
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   stochasticforcing parameters:'));
+			fielddisplay(self,'isstochasticforcing','is stochasticity activated?');
+			fielddisplay(self,'fields','fields with stochasticity applied, ex: {''SMBautoregression''}, or {''FrontalForcingsRignotAutoregression''}');
+			fielddisplay(self,'defaultdimension','dimensionality of the noise terms (does not apply to fields with their specific dimension)');
+			fielddisplay(self,'default_id','id of each element for partitioning of the noise terms (does not apply to fields with their specific partition)');
+			fielddisplay(self,'covariance','covariance matrix for within- and between-fields covariance (units must be squared field units)');
+			fielddisplay(self,'randomflag','whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)');
+			disp('Available fields:');
+			for field=supportedstochforcings()
+				fprintf('   %s\n',string(field));
+			end
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+
+			yts=md.constants.yts;
+			num_fields = numel(self.fields);
+
+			WriteData(fid,prefix,'object',self,'fieldname','isstochasticforcing','format','Boolean');
+			if ~self.isstochasticforcing 
+				return
+			else
+
+				%Retrieve dimensionality of each field
+				dimensions = self.defaultdimension*ones(1,num_fields);
+				ind = 1;
+				for field=self.fields
+					%Checking for specific dimensions
+					if(strcmp(field,'SMBautoregression'))
+						dimensions(ind) = md.smb.num_basins;
+					end
+					if(strcmp(field,'FrontalForcingsRignotAutoregression'))
+						dimensions(ind) = md.frontalforcings.num_basins;
+					end
+					ind = ind+1;
+				end
+
+				%Scaling covariance matrix (scale column-by-column and row-by-row)
+				scaledfields = {'DefaultCalving','FloatingMeltRate','SMBautoregression'}; %list of fields that need scaling *1/yts
+				tempcovariance = self.covariance; %copy of covariance to avoid writing back in member variable
+				for i=1:num_fields
+					if any(strcmp(scaledfields,self.fields(i)))
+						inds = [1+sum(dimensions(1:i-1)):1:sum(dimensions(1:i))];
+						for row=inds %scale rows corresponding to scaled field
+							tempcovariance(row,:) = 1./yts*tempcovariance(row,:);
+						end
+						for col=inds %scale columns corresponding to scaled field
+							tempcovariance(:,col) = 1./yts*tempcovariance(:,col);
+						end
+					end
+				end
+				%Set dummy default_id vector if defaults not used
+				if isnan(self.default_id)
+					self.default_id = zeros(md.mesh.numberofelements,1);
+				end
+				WriteData(fid,prefix,'data',num_fields,'name','md.stochasticforcing.num_fields','format','Integer');
+				WriteData(fid,prefix,'object',self,'fieldname','fields','format','StringArray');
+				WriteData(fid,prefix,'data',dimensions,'name','md.stochasticforcing.dimensions','format','IntMat');
+				WriteData(fid,prefix,'object',self,'fieldname','default_id','data',self.default_id-1,'format','IntMat','mattype',2); %0-indexed
+				WriteData(fid,prefix,'object',self,'fieldname','defaultdimension','format','Integer');
+				WriteData(fid,prefix,'data',tempcovariance,'name','md.stochasticforcing.covariance','format','DoubleMat');
+				WriteData(fid,prefix,'object',self,'fieldname','randomflag','format','Boolean');
+			end
+		end % }}}
+	end
+end
+function list = supportedstochforcings() % {{{
+	% Defines list of fields supported
+	% by the class md.stochasticforcing
+
+	list = structstochforcing();
+	list = list.fields;
+end % }}}
+function structure = structstochforcing() % {{{
+	% Defines structure with list of fields
+	% supported and corresponding md names
+	structure.fields = {...
+		'DefaultCalving',...
+		'FloatingMeltRate',...
+		'FrictionWaterPressure',...
+		'FrontalForcingsRignotAutoregression',...
+		'SMBautoregression'
+		};
+	structure.mdnames = {...
+		'calving',...
+		'basalforcings',...
+		'friction',...
+		'frontalforcingsrignotautoregression',...
+		'SMBautoregression'
+	};
+end % }}}
Index: /issm/trunk/src/m/classes/stochasticforcing.py
===================================================================
--- /issm/trunk/src/m/classes/stochasticforcing.py	(revision 26744)
+++ /issm/trunk/src/m/classes/stochasticforcing.py	(revision 26744)
@@ -0,0 +1,188 @@
+import numpy as np
+from checkfield import checkfield
+from fielddisplay import fielddisplay
+from WriteData import WriteData
+
+
+class stochasticforcing(object):
+    """STOCHASTICFORCING class definition
+
+    Usage:
+        stochasticforcing = stochasticforcing()
+    """
+
+    def __init__(self, *args):  # {{{
+        self.isstochasticforcing = 0
+        self.fields = np.nan
+        self.defaultdimension = 0
+        self.default_id = np.nan
+        self.covariance = np.nan
+        self.randomflag = 1
+
+        if len(args) == 0:
+            self.setdefaultparameters()
+        else:
+            raise RuntimeError('constructor not supported for stochasticforcing')
+
+    def __repr__(self):  # {{{
+        s = '   stochasticforcing parameters:\n'
+        s += '{}\n'.format(fielddisplay(self, 'isstochasticforcing', 'is stochasticity activated?'))
+        s += '{}\n'.format(fielddisplay(self, 'fields', 'fields with stochasticity applied, ex: [\'SMBautoregression\'], or [\'FrontalForcingsRignotAutoregression\']'))
+        s += '{}\n'.format(fielddisplay(self, 'defaultdimension', 'dimensionality of the noise terms (does not apply to fields with their specific dimension)'))
+        s += '{}\n'.format(fielddisplay(self, 'default_id', 'id of each element for partitioning of the noise terms (does not apply to fields with their specific partition)'))
+        s += '{}\n'.format(fielddisplay(self, 'covariance', 'covariance matrix for within- and between-fields covariance (units must be squared field units)'))
+        s += '{}\n'.format(fielddisplay(self, 'randomflag', 'whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)'))
+        s += 'Available fields:\n'
+        s += '   DefaultCalving\n'
+        s += '   FloatingMeltRate\n'
+        s += '   SMBautoregression\n'
+        s += '   FrontalForcingsRignotAutoregression (thermal forcing)\n'
+        return s
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        # Type of stabilization used
+        self.isstochasticforcing = 0 # stochasticforcing is turned off by default
+        self.fields = [] # Need to initialize to list to avoid "RuntimeError: object of type 'float' has no len()" on import of class
+        self.randomflag = 1 # true randomness is implemented by default
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        # Early return
+        if not self.isstochasticforcing:
+            return md
+
+        num_fields = len(self.fields)
+
+        # Check that covariance matrix is positive definite (this is done internally by linalg)
+        try:
+            np.linalg.cholesky(self.covariance)
+        except:
+            raise TypeError('md.stochasticforcing.covariance is not positive definite')
+
+        # Check that all fields agree with the corresponding md class and if any field needs the default params
+        checkdefaults = False # Need to check defaults only if one of the fields does not have its own dimensionality
+        structstoch = self.structstochforcing()
+        for field in self.fields:
+            # Checking agreement of classes
+            if 'SMB' in field:
+                mdname = structstoch[field]
+                if (type(md.smb).__name__ != mdname):
+                    raise TypeError('md.smb does not agree with stochasticforcing field {}'.format(field))
+            if 'FrontalForcings' in field:
+                mdname = structstoch[field]
+                if (type(md.frontalforcings).__name__ != mdname):
+                    raise TypeError('md.frontalforcings does not agree with stochasticforcing field {}'.format(field))
+            if 'Calving' in field:
+                mdname = structstoch[field]
+                if (type(md.calving).__name__ != mdname):
+                    raise TypeError('md.calving does not agree with stochasticforcing field {}'.format(field))
+            if 'BasalforcingsFloatingice' in field:
+                mdname = structstoch[field]
+                if (type(md.basalforcings).__name__ != mdname):
+                    raise TypeError('md.basalforcings does not agree with stochasticforcing field {}'.format(field))
+            if 'WaterPressure' in field:
+                mdname = structstoch[field]
+                if (type(md.friction).__name__ != mdname):
+                    raise TypeError('stochasticforcing field {} is only implemented for default friction'.format(field))
+                if (md.friction.coupling!=0 and md.friction.coupling!=1 and md.friction.coupling!=2):
+                    raise TypeError('stochasticforcing field {} is only implemented for cases md.friction.coupling 0 or 1 or 2'.format(field))
+                if (np.any(md.friction.q==0)):
+                        raise TypeError('stochasticforcing field {} requires non-zero q exponent'.format(field))
+
+            # Checking for specific dimensions
+            if not (field == 'SMBautoregression' or field == 'FrontalForcingsRignotAutoregression'):
+                checkdefaults = True # field with non-specific dimensionality
+
+        # Retrieve sum of all the field dimensionalities
+        size_tot = self.defaultdimension * num_fields
+        indSMBar = -1 # About to check for index of SMBautoregression
+        indTFar = -1 # About to check for index of FrontalForcingsRignotAutoregression
+        if ('SMBautoregression' in self.fields):
+            size_tot = size_tot - self.defaultdimension + md.smb.num_basins
+            indSMBar = self.fields.index('SMBautoregression') # Index of SMBar, now check for consistency with TFar timestep (08Nov2021)
+        if ('FrontalForcingsRignotAutoregression' in self.fields):
+            size_tot = size_tot - self.defaultdimension + md.frontalforcings.num_basins
+            indTFar = self.fields.index('FrontalForcingsRignotAutoregression') # Index of TFar, now check for consistency with SMBar timestep (08Nov2021)
+        if (indSMBar != -1 and indTFar != -1): # Both autoregressive models are used: check autoregressive time step consistency
+            covsum = self.covariance[np.sum(self.defaultdimensions[0:indSMBar]).astype(int):np.sum(self.defaultdimensions[0:indSMBar + 1]).astype(int), np.sum(self.defaultdimensions[0:indTFar]).astype(int):np.sum(self.defaultdimensions[0:indTFar + 1]).astype(int)]
+            if((md.smb.ar_timestep != md.frontalforcings.ar_timestep) and np.any(covsum != 0)):
+                raise IOError('SMBautoregression and FrontalForcingsRignotAutoregression have different ar_timestep and non-zero covariance')
+
+        md = checkfield(md, 'fieldname', 'stochasticforcing.isstochasticforcing', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'stochasticforcing.fields', 'numel', num_fields, 'cell', 1, 'values', self.supportedstochforcings())
+        md = checkfield(md, 'fieldname', 'stochasticforcing.covariance', 'NaN', 1, 'Inf', 1, 'size', [size_tot, size_tot])  # global covariance matrix
+        md = checkfield(md, 'fieldname', 'stochasticforcing.randomflag', 'numel', [1], 'values', [0, 1])
+        if (checkdefaults):
+            md = checkfield(md, 'fieldname', 'stochasticforcing.defaultdimension', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
+            md = checkfield(md, 'fieldname', 'stochasticforcing.default_id','Inf',1,'NaN',1,'>=',0,'<=',self.defaultdimension,'size', [md.mesh.numberofelements])
+        return md
+    # }}}
+
+    def extrude(self, md):  # {{{
+        # Nothing for now
+        return self
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+        num_fields = len(self.fields)
+
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isstochasticforcing', 'format', 'Boolean')
+        if not self.isstochasticforcing:
+            return md
+        else:
+            # Retrieve dimensionality of each field
+            dimensions = self.defaultdimension * np.ones((num_fields,))
+            for ind, field in enumerate(self.fields):
+                # Checking for specific dimensions
+                if (field == 'SMBautoregression'):
+                    dimensions[ind] = md.smb.num_basins
+                if (field == 'FrontalForcingsRignotAutoregression'):
+                    dimensions[ind] = md.frontalforcings.num_basins
+
+            # Scaling covariance matrix (scale column-by-column and row-by-row)
+            scaledfields = ['DefaultCalving','FloatingMeltRate','SMBautoregression'] # list of fields that need scaling * 1/yts
+            tempcovariance = np.copy(self.covariance)
+            for i in range(num_fields):
+                if self.fields[i] in scaledfields:
+                    inds = range(int(np.sum(dimensions[0:i])), int(np.sum(dimensions[0:i + 1])))
+                    for row in inds:  # scale rows corresponding to scaled field
+                        tempcovariance[row, :] = 1 / yts * tempcovariance[row, :]
+                    for col in inds:  # scale columns corresponding to scaled field
+                        tempcovariance[:, col] = 1 / yts * tempcovariance[:, col]
+            # Set dummy default_id vector if defaults not used
+            if np.any(np.isnan(self.default_id)):
+                self.default_id = np.zeros(md.mesh.numberofelements)
+            # Reshape dimensions as column array for marshalling
+            dimensions = dimensions.reshape(1,len(dimensions))
+
+            WriteData(fid, prefix, 'data', num_fields, 'name', 'md.stochasticforcing.num_fields', 'format', 'Integer')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'fields', 'format', 'StringArray')
+            WriteData(fid, prefix, 'data', dimensions, 'name', 'md.stochasticforcing.dimensions', 'format', 'IntMat','mattype',2)
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'default_id', 'format', 'IntMat', 'mattype', 2)  #12Nov2021 make sure this is zero-indexed!
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'defaultdimension', 'format', 'Integer')
+            WriteData(fid, prefix, 'data', tempcovariance, 'name', 'md.stochasticforcing.covariance', 'format', 'DoubleMat')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'randomflag', 'format', 'Boolean')
+    # }}}
+
+    def supportedstochforcings(self):  # {{{
+        """Defines list of fields supported by the class md.stochasticforcing
+        """
+        list1 = self.structstochforcing()
+        list1 = list1.keys()
+        return list(list1)
+    #}}}
+
+    def structstochforcing(self):  # {{{
+        """Defines dictionary with list of fields
+           supported and corresponding md names
+        """
+        structure = {'DefaultCalving': 'calving',
+                     'FloatingMeltRate': 'basalforcings',
+                     'FrictionWaterPressure': 'friction',
+                     'FrontalForcingsRignotAutoregression': 'frontalforcingsrignotautoregression',
+                     'SMBautoregression': 'SMBautoregression'}
+        return structure
+    # }}}
Index: /issm/trunk/src/m/classes/stressbalance.js
===================================================================
--- /issm/trunk/src/m/classes/stressbalance.js	(revision 26743)
+++ /issm/trunk/src/m/classes/stressbalance.js	(revision 26744)
@@ -158,11 +158,9 @@
 		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','referential','format','DoubleMat','mattype',1);
 
-		var lx=NewArrayFill(this.loadingforce.length,0); for(var i=0;i<lx.length;i++)lx[i]=this.loadingforce[i][0];
-		var ly=NewArrayFill(this.loadingforce.length,0); for(var i=0;i<lx.length;i++)ly[i]=this.loadingforce[i][1];
-		var lz=NewArrayFill(this.loadingforce.length,0); for(var i=0;i<lx.length;i++)lz[i]=this.loadingforce[i][2];
-
-		WriteData(fid,prefix,'data',lx,'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcex');
-		WriteData(fid,prefix,'data',ly,'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcey');
-		WriteData(fid,prefix,'data',lz,'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcez');
+		if (size(this.loadingforce,1)==3) {
+			WriteData(fid,prefix,'data',ArrayCol(this.loadingforce,0),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcex');
+			WriteData(fid,prefix,'data',ArrayCol(this.loadingforce,1),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcey');
+			WriteData(fid,prefix,'data',ArrayCol(this.loadingforce,2),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcez');
+		}
 
 		//process requested outputs
Index: /issm/trunk/src/m/classes/stressbalance.m
===================================================================
--- /issm/trunk/src/m/classes/stressbalance.m	(revision 26743)
+++ /issm/trunk/src/m/classes/stressbalance.m	(revision 26744)
@@ -8,4 +8,8 @@
 		spcvx                  = NaN;
 		spcvy                  = NaN;
+		spcvx_base             = NaN;
+		spcvy_base             = NaN;
+		spcvx_shear            = NaN;
+		spcvy_shear            = NaN;
 		spcvz                  = NaN;
 		restol                 = 0;
@@ -32,4 +36,11 @@
 			self.loadingforce=project3d(md,'vector',self.loadingforce,'type','node');
 
+			% for MLHO
+			if md.flowequation.isMLHO
+				self.spcvx_base=project3d(md,'vector',self.spcvx_base,'type','node');
+				self.spcvy_base=project3d(md,'vector',self.spcvy_base,'type','node');
+				self.spcvx_shear=project3d(md,'vector',self.spcvx_shear,'type','poly','degree',4);
+				self.spcvy_shear=project3d(md,'vector',self.spcvy_shear,'type','poly','degree',4);
+			end
 		end % }}}
 		function self = stressbalance(varargin) % {{{
@@ -53,28 +64,28 @@
 		function self = setdefaultparameters(self) % {{{
 
-			 %maximum of non-linear iterations.
-			 self.maxiter=100;
-
-			 %Convergence criterion: absolute, relative and residual
-			 self.restol=10^-4;
-			 self.reltol=0.01;
-			 self.abstol=10;
-
-			 self.FSreconditioning=10^13;
-			 self.shelf_dampening=0;
-
-			 %Penalty factor applied kappa=max(stiffness matrix)*10^penalty_factor
-			 self.penalty_factor=3;
-
-			 %Stop the iterations of rift if below a threshold
-			 self.rift_penalty_threshold=0;
-
-			 %in some solutions, it might be needed to stop a run when only
-			 %a few constraints remain unstable. For thermal computation, this
-			 %parameter is often used.
-			 self.rift_penalty_lock=10;
-
-			 %output default:
-			 self.requested_outputs={'default'};
+			%maximum of non-linear iterations.
+			self.maxiter=100;
+
+			%Convergence criterion: absolute, relative and residual
+			self.restol=10^-4;
+			self.reltol=0.01;
+			self.abstol=10;
+
+			self.FSreconditioning=10^13;
+			self.shelf_dampening=0;
+
+			%Penalty factor applied kappa=max(stiffness matrix)*10^penalty_factor
+			self.penalty_factor=3;
+
+			%Stop the iterations of rift if below a threshold
+			self.rift_penalty_threshold=0;
+
+			%in some solutions, it might be needed to stop a run when only
+			%a few constraints remain unstable. For thermal computation, this
+			%parameter is often used.
+			self.rift_penalty_lock=10;
+
+			%output default:
+			self.requested_outputs={'default'};
 
 		end % }}}
@@ -123,4 +134,11 @@
 				md = checkfield(md,'fieldname','stressbalance.FSreconditioning','>',0);
 			end
+			% CHECK THIS ONLY WORKS FOR MLHO
+			if md.flowequation.isMLHO
+				md = checkfield(md,'fieldname','stressbalance.spcvx_base','Inf',1,'timeseries',1);
+				md = checkfield(md,'fieldname','stressbalance.spcvy_base','Inf',1,'timeseries',1);
+				md = checkfield(md,'fieldname','stressbalance.spcvx_shear','Inf',1,'timeseries',1);
+				md = checkfield(md,'fieldname','stressbalance.spcvy_shear','Inf',1,'timeseries',1);
+			end
 		end % }}}
 		function list=defaultoutputs(self,md) % {{{
@@ -150,4 +168,10 @@
 			fielddisplay(self,'spcvy','y-axis velocity constraint (NaN means no constraint) [m/yr]');
 			fielddisplay(self,'spcvz','z-axis velocity constraint (NaN means no constraint) [m/yr]');
+
+			disp(sprintf('\n      %s','MLHO boundary conditions:'));
+			fielddisplay(self,'spcvx_base','x-axis basal velocity constraint (NaN means no constraint) [m/yr]');
+			fielddisplay(self,'spcvy_base','y-axis basal velocity constraint (NaN means no constraint) [m/yr]');
+			fielddisplay(self,'spcvx_shear','x-axis shear velocity constraint (NaN means no constraint) [m/yr]');
+			fielddisplay(self,'spcvy_shear','y-axis shear velocity constraint (NaN means no constraint) [m/yr]');
 
 			disp(sprintf('\n      %s','Rift options:'));
@@ -202,4 +226,11 @@
 			end
 			WriteData(fid,prefix,'data',outputs,'name','md.stressbalance.requested_outputs','format','StringArray');
+			% for MLHO
+			if (md.flowequation.isMLHO)
+				WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvx_base','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+				WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvy_base','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+				WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvx_shear','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+				WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvy_shear','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			end
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
@@ -223,4 +254,8 @@
 			writejscellstring(fid,[modelname '.stressbalance.requested_outputs'],self.requested_outputs);
 
+			writejs1Darray(fid,[modelname '.stressbalance.spcvx_base'],self.spcvx_shear);
+			writejs1Darray(fid,[modelname '.stressbalance.spcvy_base'],self.spcvy_shear);
+			writejs1Darray(fid,[modelname '.stressbalance.spcvx_shear'],self.spcvx_shear);
+			writejs1Darray(fid,[modelname '.stressbalance.spcvy_shear'],self.spcvy_shear);
 		end % }}}
 	end
Index: /issm/trunk/src/m/classes/stressbalance.py
===================================================================
--- /issm/trunk/src/m/classes/stressbalance.py	(revision 26743)
+++ /issm/trunk/src/m/classes/stressbalance.py	(revision 26744)
@@ -18,7 +18,11 @@
 
     def __init__(self):  # {{{
-        self.spcvx = float('NaN')
-        self.spcvy = float('NaN')
-        self.spcvz = float('NaN')
+        self.spcvx = np.nan
+        self.spcvy = np.nan
+        self.spcvx_base = np.nan
+        self.spcvy_base = np.nan
+        self.spcvx_shear = np.nan
+        self.spcvy_shear = np.nan
+        self.spcvz = np.nan
         self.restol = 0
         self.reltol = 0
@@ -26,19 +30,20 @@
         self.isnewton = 0
         self.FSreconditioning = 0
-        self.icefront = float('NaN')
+        self.icefront = np.nan
         self.maxiter = 0
         self.shelf_dampening = 0
-        self.vertex_pairing = float('NaN')
-        self.penalty_factor = float('NaN')
-        self.rift_penalty_lock = float('NaN')
+        self.vertex_pairing = np.nan
+        self.penalty_factor = np.nan
+        self.rift_penalty_lock = np.nan
         self.rift_penalty_threshold = 0
-        self.referential = float('NaN')
-        self.loadingforce = float('NaN')
+        self.referential = np.nan
+        self.loadingforce = np.nan
         self.requested_outputs = []
 
-    #set defaults
+        # Set defaults
         self.setdefaultparameters()
 
-    #}}}
+    # }}}
+
     def __repr__(self):  # {{{
         s = '   StressBalance solution parameters:\n'
@@ -47,16 +52,21 @@
         s += '{}\n'.format(fielddisplay(self, 'reltol', 'velocity relative convergence criterion, NaN: not applied'))
         s += '{}\n'.format(fielddisplay(self, 'abstol', 'velocity absolute convergence criterion, NaN: not applied'))
-        s += '{}\n'.format(fielddisplay(self, 'isnewton', "0: Picard's fixed point, 1: Newton's method, 2: hybrid"))
+        s += '{}\n'.format(fielddisplay(self, 'isnewton', '0: Picard\'s fixed point, 1: Newton\'s method, 2: hybrid'))
         s += '{}\n'.format(fielddisplay(self, 'maxiter', 'maximum number of nonlinear iterations'))
         s += '      boundary conditions:\n'
-        s += '{}\n'.format(fielddisplay(self, 'spcvx', 'x - axis velocity constraint (NaN means no constraint) [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'spcvy', 'y - axis velocity constraint (NaN means no constraint) [m / yr]'))
-        s += '{}\n'.format(fielddisplay(self, 'spcvz', 'z - axis velocity constraint (NaN means no constraint) [m / yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'spcvx', 'x-axis velocity constraint (NaN means no constraint) [m / yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'spcvy', 'y-axis velocity constraint (NaN means no constraint) [m / yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'spcvz', 'z-axis velocity constraint (NaN means no constraint) [m / yr]'))
         s += '{}\n'.format(fielddisplay(self, 'icefront', 'segments on ice front list (last column 0: Air, 1: Water, 2: Ice'))
-        s = "%s\n%s" % (s, '\n      Rift options:')
+        s += '      MLHO boundary conditions:\n'
+        s += '{}\n'.format(fielddisplay(self, 'spcvx_base', 'x-axis basal velocity constraint (NaN means no constraint) [m / yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'spcvy_base', 'y-axis basal velocity constraint (NaN means no constraint) [m / yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'spcvx_shear', 'x-axis shear velocity constraint (NaN means no constraint) [m / yr]'))
+        s += '{}\n'.format(fielddisplay(self, 'spcvy_shear', 'y-axis shear velocity constraint (NaN means no constraint) [m / yr]'))
+        s += '      Rift options:\n'
         s += '{}\n'.format(fielddisplay(self, 'rift_penalty_threshold', 'threshold for instability of mechanical constraints'))
         s += '{}\n'.format(fielddisplay(self, 'rift_penalty_lock', 'number of iterations before rift penalties are locked'))
         s += '      Penalty options:\n'
-        s += '{}\n'.format(fielddisplay(self, 'penalty_factor', 'offset used by penalties: penalty = Kmax * 1.0**offset'))
+        s += '{}\n'.format(fielddisplay(self, 'penalty_factor', 'offset used by penalties: penalty = Kmax * 10^offset'))
         s += '{}\n'.format(fielddisplay(self, 'vertex_pairing', 'pairs of vertices that are penalized'))
         s += '      Other:\n'
@@ -64,8 +74,8 @@
         s += '{}\n'.format(fielddisplay(self, 'FSreconditioning', 'multiplier for incompressibility equation. Only for FS model'))
         s += '{}\n'.format(fielddisplay(self, 'referential', 'local referential'))
-        s += '{}\n'.format(fielddisplay(self, 'loadingforce', 'loading force applied on each point [N / m^3]'))
+        s += '{}\n'.format(fielddisplay(self, 'loadingforce', 'loading force applied on each point [N/m^3]'))
         s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
         return s
-    #}}}
+    # }}}
 
     def extrude(self, md):  # {{{
@@ -76,28 +86,40 @@
         self.loadingforce = project3d(md, 'vector', self.loadingforce, 'type', 'node')
 
+        if md.flowequation.isMLHO:
+            self.spcvx_base = project3d(md, 'vector', self.spcvx_base, 'type', 'node')
+            self.spcvy_base = project3d(md, 'vector', self.spcvy_base, 'type', 'node')
+            self.spcvx_shear = project3d(md, 'vector', self.spcvx_shear, 'type', 'poly', 'degree', 4)
+            self.spcvy_shear = project3d(md, 'vector', self.spcvy_shear, 'type', 'poly', 'degree', 4)
+
         return self
-    #}}}
+    # }}}
 
     def setdefaultparameters(self):  # {{{
-        #maximum of non - linear iterations.
+        # Maximum of non-linear iterations
         self.maxiter = 100
-        #Convergence criterion: absolute, relative and residual
-        self.restol = 1.0e-4
+
+        # Convergence criterion: absolute, relative and residual
+        self.restol = pow(10, -4)
         self.reltol = 0.01
         self.abstol = 10
-        self.FSreconditioning = 10**13
+
+        self.FSreconditioning = pow(10, 13)
         self.shelf_dampening = 0
-        #Penalty factor applied kappa = max(stiffness matrix) * 1.0**penalty_factor
+
+        # Penalty factor applied kappa = max(stiffness matrix) * 1.0^penalty_factor
         self.penalty_factor = 3
-        #Stop the iterations of rift if below a threshold
+
+        # Stop the iterations of rift if below a threshold
         self.rift_penalty_threshold = 0
-        #in some solutions, it might be needed to stop a run when only
-        #a few constraints remain unstable. For thermal computation, this
-        #parameter is often used.
+
+        # In some solutions, it might be needed to stop a run when only a few 
+        # constraints remain unstable. For thermal computation, this parameter 
+        # is often used.
         self.rift_penalty_lock = 10
-        #output default:
+
+        # Output default
         self.requested_outputs = ['default']
         return self
-    #}}}
+    # }}}
 
     def defaultoutputs(self, md):  # {{{
@@ -107,5 +129,5 @@
             list = ['Vx', 'Vy', 'Vel', 'Pressure']
         return list
-    #}}}
+    # }}}
 
     def checkconsistency(self, md, solution, analyses):  # {{{
@@ -131,13 +153,13 @@
         if not np.any(np.isnan(self.vertex_pairing)) and len(self.vertex_pairing) > 0:
             md = checkfield(md, 'fieldname', 'stressbalance.vertex_pairing', '>', 0)
-        #singular solution
+        # Singular solution
         #        if ~any((~isnan(md.stressbalance.spcvx) + ~isnan(md.stressbalance.spcvy)) == 2),
-        if not np.any(np.logical_and(np.logical_not(np.isnan(md.stressbalance.spcvx)), np.logical_not(np.isnan(md.stressbalance.spcvy)))):
+        if (not np.any(np.logical_or(np.logical_not(np.isnan(md.stressbalance.spcvx)), np.logical_not(np.isnan(md.stressbalance.spcvy))))) & (not np.any(md.mask.ocean_levelset>0)):
             print("\n !!! Warning: no spc applied, model might not be well posed if no basal friction is applied, check for solution crash\n")
-        #CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES
+        # CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES
         #        if any(sum(isnan(md.stressbalance.referential), 2)~=0 & sum(isnan(md.stressbalance.referential), 2)~=6),
         if np.any(np.logical_and(np.sum(np.isnan(md.stressbalance.referential), axis=1) != 0, np.sum(np.isnan(md.stressbalance.referential), axis=1) != 6)):
             md.checkmessage("Each line of stressbalance.referential should contain either only NaN values or no NaN values")
-        #CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL
+        # CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL
         #        if any(sum(isnan(md.stressbalance.referential), 2) == 0),
         if np.any(np.sum(np.isnan(md.stressbalance.referential), axis=1) == 0):
@@ -149,9 +171,14 @@
                 if np.abs(np.inner(item[0:2], item[3:5])) > sys.float_info.epsilon:
                     md.checkmessage("Vectors in stressbalance.referential (columns 1 to 3 and 4 to 6) must be orthogonal")
-        #CHECK THAT NO rotation specified for FS Grounded ice at base
+        # CHECK THAT NO rotation specified for FS Grounded ice at base
         if m.strcmp(md.mesh.domaintype(), '3D') and md.flowequation.isFS:
             pos = np.nonzero(np.logical_and(md.mask.ocean_levelset, md.mesh.vertexonbase))
             if np.any(np.logical_not(np.isnan(md.stressbalance.referential[pos, :]))):
                 md.checkmessage("no referential should be specified for basal vertices of grounded ice")
+        if md.flowequation.isMLHO:
+            md = checkfield(md, 'fieldname', 'stressbalance.spcvx_base', 'Inf', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'stressbalance.spcvy_base', 'Inf', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'stressbalance.spcvx_shear', 'Inf', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'stressbalance.spcvy_shear', 'Inf', 1, 'timeseries', 1)
         return md
     # }}}
@@ -188,3 +215,9 @@
             outputs = outputscopy
         WriteData(fid, prefix, 'data', outputs, 'name', 'md.stressbalance.requested_outputs', 'format', 'StringArray')
-    # }}}
+        # MLHO
+        if md.flowequation.isMLHO:
+            WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvx_base', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvy_base', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvx_shear', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvy_shear', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+    # }}}
Index: /issm/trunk/src/m/classes/surfaceload.m
===================================================================
--- /issm/trunk/src/m/classes/surfaceload.m	(revision 26743)
+++ /issm/trunk/src/m/classes/surfaceload.m	(revision 26744)
@@ -8,5 +8,5 @@
 		icethicknesschange     = [];
 		waterheightchange      = [];
-		other                  = [];
+		otherchange            = [];
 	end
 	methods
@@ -20,13 +20,13 @@
 		end % }}}
 		function self = setdefaultparameters(self) % {{{
-		
+
 			icethicknesschange=[];
 			waterheightchange=[];
-			other=[];
-		
+			otherchange=[];
+
 		end % }}}
-			function md = checkconsistency(self,md,solution,analyses) % {{{
+		function md = checkconsistency(self,md,solution,analyses) % {{{
 
-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslr==0), 
+			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
 				return; 
 			end
@@ -43,5 +43,5 @@
 				md = checkfield(md,'fieldname','solidearth.surfaceload.waterheightchange','timeseries',1,'NaN',1,'Inf',1);
 			end
-			if ~isempty(self.other),
+			if ~isempty(self.otherchange),
 				md = checkfield(md,'fieldname','solidearth.surfaceload.other','timeseries',1,'NaN',1,'Inf',1);
 			end
@@ -61,30 +61,95 @@
 			fielddisplay(self,'icethicknesschange','thickness change: ice height equivalent [mIce/yr]');
 			fielddisplay(self,'waterheightchange','water height change: water height equivalent [mWater/yr]');
-			fielddisplay(self,'other','other loads (sediments) [kg/m^2/yr]');
+			fielddisplay(self,'otherchange','other loads (sediments) [kg/m^2/yr]');
 
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
 
+			%deal with ice thickness change: {{{
 			if isempty(self.icethicknesschange),
 				self.icethicknesschange=zeros(md.mesh.numberofelements+1,1);
 			end
+
+			yts=md.constants.yts;
+
+			if isa(self.icethicknesschange,'cell'),
+				%transform our cell array of time series into cell array of time series of rates 
+				nummodels=length(self.icethicknesschange);
+				for i=1:nummodels,
+					icethicknesschange=self.icethicknesschange{i}; 
+					time=icethicknesschange(end,:);
+					dt=diff(time,1,2);
+					icethicknesschange_rate=diff(icethicknesschange(1:end-1,:),1,2)./dt;
+					self.icethicknesschange{i}=icethicknesschange_rate; 
+				end
+				WriteData(fid,prefix,'object',self,'fieldname','icethicknesschange','name','md.solidearth.surfaceload.icethicknesschange',...
+				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
+			else
+				icethicknesschange=self.icethicknesschange;
+				time=icethicknesschange(end,:);
+				dt=diff(time,1,2);
+				icethicknesschange_rate=diff(icethicknesschange(1:end-1,:),1,2)./dt;
+				self.icethicknesschange=icethicknesschange_rate; 
+
+				WriteData(fid,prefix,'object',self,'fieldname','icethicknesschange','name','md.solidearth.surfaceload.icethicknesschange',...
+				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
+			end
+			%}}}
+			%deal with water height change: {{{
 			if isempty(self.waterheightchange),
 				self.waterheightchange=zeros(md.mesh.numberofelements+1,1);
 			end
-			if isempty(self.other),
-				self.other=zeros(md.mesh.numberofelements+1,1);
+
+			if isa(self.waterheightchange,'cell'),
+				%transform our cell array of time series into cell array of time series of rates 
+				nummodels=length(self.waterheightchange);
+				for i=1:nummodels,
+					waterheightchange=self.waterheightchange{i}; 
+					time=waterheightchange(end,:);
+					dt=diff(time,1,2);
+					waterheightchange_rate=diff(waterheightchange(1:end-1,:),1,2)./dt;
+					self.waterheightchange{i}=waterheightchange_rate; 
+				end
+				WriteData(fid,prefix,'object',self,'fieldname','waterheightchange','name','md.solidearth.surfaceload.waterheightchange',...
+				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
+			else
+				waterheightchange=self.waterheightchange;
+				time=waterheightchange(end,:);
+				dt=diff(time,1,2);
+				waterheightchange_rate=diff(waterheightchange(1:end-1,:),1,2)./dt;
+				self.waterheightchange=waterheightchange_rate; 
+
+				WriteData(fid,prefix,'object',self,'fieldname','waterheightchange','name','md.solidearth.surfaceload.waterheightchange',...
+				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
 			end
-			if isa(self.icethicknesschange,'cell'),
-				WriteData(fid,prefix,'object',self,'fieldname','icethicknesschange','name','md.solidearth.surfaceload.icethicknesschange',...
-				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			else
-				WriteData(fid,prefix,'object',self,'fieldname','icethicknesschange','name','md.solidearth.surfaceload.icethicknesschange',...
-				'format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+			%}}}
+			%deal with other: {{{
+			if isempty(self.otherchange),
+				self.otherchange=zeros(md.mesh.numberofelements+1,1);
 			end
 
-			WriteData(fid,prefix,'object',self,'fieldname','waterheightchange','name','md.solidearth.surfaceload.waterheightchange',...
-				'format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','other','name','md.solidearth.surfaceload.other',...
-				'format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+			if isa(self.otherchange,'cell'),
+				%transform our cell array of time series into cell array of time series of rates 
+				nummodels=length(self.otherchange);
+				for i=1:nummodels,
+					otherchange=self.otherchange{i}; 
+					time=otherchange(end,:);
+					dt=diff(time,1,2);
+					otherchange_rate=diff(otherchange(1:end-1,:),1,2)./dt;
+					self.otherchange{i}=otherchange_rate; 
+				end
+				WriteData(fid,prefix,'object',self,'fieldname','otherchange','name','md.solidearth.surfaceload.otherchange',...
+				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
+			else
+				otherchange=self.otherchange;
+				time=otherchange(end,:);
+				dt=diff(time,1,2);
+				otherchange_rate=diff(otherchange(1:end-1,:),1,2)./dt;
+				self.otherchange=otherchange_rate; 
+
+				WriteData(fid,prefix,'object',self,'fieldname','otherchange','name','md.solidearth.surfaceload.otherchange',...
+				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
+			end
+			%}}}
 
 		end % }}}
@@ -93,5 +158,5 @@
 			writejs1Darray(fid,[modelname '.surfaceload.icethicknesschange'],self.icethicknesschange);
 			writejs1Darray(fid,[modelname '.surfaceload.waterheightchange'],self.waterheightchange);
-			writejs1Darray(fid,[modelname '.surfaceload.other'],self.other);
+			writejs1Darray(fid,[modelname '.surfaceload.otherchange'],self.otherchange);
 		end % }}}
 		function self = extrude(self,md) % {{{
Index: /issm/trunk/src/m/classes/surfaceload.py
===================================================================
--- /issm/trunk/src/m/classes/surfaceload.py	(revision 26743)
+++ /issm/trunk/src/m/classes/surfaceload.py	(revision 26744)
@@ -13,9 +13,9 @@
     """
 
-    def __init__(self, *args): #{{{
-        self.icethicknesschange = []
-        self.waterheightchange  = []
-        self.other              = []
-        
+    def __init__(self, *args):  #{{{
+        self.icethicknesschange = np.nan
+        self.waterheightchange = np.nan
+        self.other = np.nan
+
         nargin = len(args)
 
@@ -26,5 +26,5 @@
     #}}}
 
-    def __repr__(self): # {{{
+    def __repr__(self):  #{{{
         s = '   surfaceload:\n'
         s += '{}\n'.format(fielddisplay(self, 'icethicknesschange', 'thickness change: ice height equivalent [mIce/yr]'))
@@ -34,33 +34,48 @@
     #}}}
 
-    def setdefaultparameters(self): # {{{
+    def setdefaultparameters(self):  # {{{
         return self
     #}}}
 
-    def checkconsistency(self, md, solution, analyses): # {{{
-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr):
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
             return md
-        if len(self.icethicknesschange):
-            md  = checkfield(md,'fieldname', 'solidearth.surfaceload.icethicknesschange', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        if len(self.waterheightchange):
-            md  = checkfield(md,'fieldname', 'solidearth.surfaceload.waterheightchange', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
-        if len(self.other):
-            md  = checkfield(md,'fieldname', 'solidearth.surfaceload.other', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+        if type(self.icethicknesschange) == np.ndarray:
+            md = checkfield(md, 'fieldname', 'solidearth.surfaceload.icethicknesschange', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+        if type(self.waterheightchange) == np.ndarray:
+            md = checkfield(md, 'fieldname', 'solidearth.surfaceload.waterheightchange', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+        if type(self.other) == np.ndarray:
+            md = checkfield(md, 'fieldname', 'solidearth.surfaceload.other', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
         return md
     #}}}
 
-    def marshall(self, prefix, md, fid): #{{{
-        if len(self.icethicknesschange) == 0:
+    def marshall(self, prefix, md, fid):  #{{{
+        # TODO
+        # - When surfaceload class is used eventually, check premarshall 
+        # modifications against those done in MATLAB
+        #
+
+        # Deal with ice thickness change
+        if np.isempty(self.icethicknesschange):
             self.icethicknesschange = np.zeros((md.mesh.numberofelements + 1, ))
-        if len(self.waterheightchange) == 0:
+
+        yts = md.constants.yts
+
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'icethicknesschange', 'name', 'md.solidearth.surfaceload.icethicknesschange', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts, 'scale', 1 / yts)
+
+        # Deal with ice thickness change
+        if np.isempty(self.waterheightchange):
             self.waterheightchange = np.zeros((md.mesh.numberofelements + 1, ))
-        if len(self.other) == 0:
-            self.other = np.zeros((md.mesh.numberofelements + 1, ))
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'icethicknesschange', 'name', 'md.solidearth.surfaceload.icethicknesschange', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'waterheightchange', 'name', 'md.solidearth.surfaceload.waterheightchange', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', md.constants.yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'other', 'name', 'md.solidearth.surfaceload.other', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', md.constants.yts)
+
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'waterheightchange', 'name', 'md.solidearth.surfaceload.waterheightchange', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts, 'scale', 1 / yts)
+
+        # Deal with ice thickness change
+        if np.isempty(self.otherchange):
+            self.otherchange = np.zeros((md.mesh.numberofelements + 1, ))
+
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'otherchange', 'name', 'md.solidearth.surfaceload.otherchange', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts, 'scale', 1 / yts)
     #}}}
 
-    def extrude(self, md): #{{{
+    def extrude(self, md):  #{{{
         return self
     #}}}
Index: /issm/trunk/src/m/classes/taoinversion.m
===================================================================
--- /issm/trunk/src/m/classes/taoinversion.m	(revision 26743)
+++ /issm/trunk/src/m/classes/taoinversion.m	(revision 26744)
@@ -114,6 +114,6 @@
 			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',supportedcostfunctions());
 			md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
-			md = checkfield(md,'fieldname','inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
-			md = checkfield(md,'fieldname','inversion.max_parameters','size',[md.mesh.numberofvertices num_controls]);
+			md = checkfield(md,'fieldname','inversion.min_parameters','size',[NaN num_controls]);
+			md = checkfield(md,'fieldname','inversion.max_parameters','size',[NaN num_controls]);
 
 			if strcmp(solution,'BalancethicknessSolution')
Index: /issm/trunk/src/m/classes/thermal.js
===================================================================
--- /issm/trunk/src/m/classes/thermal.js	(revision 26743)
+++ /issm/trunk/src/m/classes/thermal.js	(revision 26744)
@@ -64,9 +64,9 @@
 		return "thermal";
 	}// }}}
-	this.extrude = function(md) {//{{{
-		this.spctemperature=project3d(md,'vector',this.spctemperature,'type','node','layer',md.mesh.numberoflayers,'padding',NaN);
-		if (md.initialization.temperature.length===md.mesh.numberofvertices) {
-			this.spctemperature = NewArrayFill(md.mesh.numberofvertices, NaN);
-			var pos=ArrayFindNot(md.mesh.vertexonsurface, 0);
+    this.extrude = function(md) {//{{{
+        this.spctemperature=project3d(md,'vector',this.spctemperature,'type','node','layer',md.mesh.numberoflayers,'padding',NaN);
+        if (md.initialization.temperature.length===md.mesh.numberofvertices) {
+            this.spctemperature = NewArrayFill(md.mesh.numberofvertices, NaN);
+            var pos=ArrayFindNot(md.mesh.vertexonsurface, 0);
 			// impose observed temperature on surface
 			for (var i=0,posIndex=0,count=0;i<md.initialization.temperature.length;i++){
@@ -89,8 +89,8 @@
 //				}
 //			}
-		}
+        }
 
-		return this;
-	}//}}}
+        return this;
+    }//}}}
 	this.checkconsistency = function(md,solution,analyses){ // {{{
 
@@ -104,5 +104,5 @@
 			checkfield(md,'fieldname','thermal.isdrainicecolumn','numel',[1],'values',[0, 1]);
 			checkfield(md,'fieldname','thermal.watercolumn_upperlimit','>=',0);
-
+			
 			for(var i=0;i<md.mesh.numberofvertices;i++){
 				for(var j=0;j<md.thermal.spctemperature[0].length;j++){
@@ -123,6 +123,6 @@
 					md.checkmessage('for a steadystate computation, thermal.reltol (relative convergence criterion) must be defined!');
 				}
+				checkfield(md,'fieldname','thermal.reltol','>',0.,'message','reltol must be larger than zero');
 			}
-			checkfield(md,'fieldname','thermal.reltol','>',0.,'message','reltol must be larger than zero');
 		}
 		checkfield(md,'fieldname','thermal.requested_outputs','stringrow',1);
@@ -163,18 +163,17 @@
 	//properties 
 	// {{{
-
-	this.spctemperature    = NaN;
-	this.penalty_threshold = 0;
-	this.stabilization     = 0;
-	this.reltol	   = 0;
-	this.maxiter           = 0;
-	this.penalty_lock      = 0;
-	this.penalty_factor    = 0;
-	this.isenthalpy        = 0;
-	this.isdynamicbasalspc = 0;
-	this.isdrainicecolumn  = 0;
-	this.watercolumn_upperlimit=0;
-	this.fe                = 'P1';
-	this.requested_outputs = [];
+	this.spctemperature    		= NaN;
+	this.penalty_threshold 		= 0;
+	this.stabilization     		= 0;
+	this.reltol			   		= 0;
+	this.maxiter           		= 0;
+	this.penalty_lock      		= 0;
+	this.penalty_factor    		= 0;
+	this.isenthalpy        		= 0;
+	this.isdynamicbasalspc 		= 0;
+	this.isdrainicecolumn  		= 0;
+	this.watercolumn_upperlimit = 0;
+	this.fe                		= 'P1';
+	this.requested_outputs 		= [];
 
 	this.setdefaultparameters();
Index: /issm/trunk/src/m/classes/timestepping.js
===================================================================
--- /issm/trunk/src/m/classes/timestepping.js	(revision 26743)
+++ /issm/trunk/src/m/classes/timestepping.js	(revision 26744)
@@ -6,5 +6,5 @@
 function timestepping (){
 	//methods
-	this.setdefaultparameters = function(){// {{{
+	this.setdefaultparameters = function(){ //{{{
 		//time between 2 time steps
 		this.time_step=1./2.;
@@ -14,7 +14,8 @@
 
 		//should we interpolate forcings between timesteps?
-		this.interp_forcings=1;
-	}// }}}
-	this.disp= function(){// {{{
+		this.interp_forcing=1;
+		this.cycle_forcing=0;
+	} //}}}
+	this.disp= function(){ //{{{
 
 		var unit;
@@ -24,12 +25,13 @@
 		fielddisplay(this,'final_time','final time to stop the simulation ['+ unit + ']');
 		fielddisplay(this,'time_step','length of time steps [' +unit+ ']');
-		fielddisplay(this,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)');
+		fielddisplay(this,'interp_forcing','interpolate in time between requested forcing values ? (0 or 1)');
+		fielddisplay(this,'cycle_forcing','cycle through forcing ? (0 or 1)');
 		fielddisplay(this,'coupling_time','length of coupling time steps with ocean model [' +unit+ ']');
 
-	}// }}}
-	this.classname= function(){// {{{
+	} //}}}
+	this.classname= function(){ //{{{
 		return "timestepping";
 
-	}// }}}
+	} //}}}
 	this.checkconsistency = function(md,solution,analyses) { //{{{
 
@@ -37,8 +39,12 @@
 		checkfield(md,'fieldname','timestepping.final_time','numel',[1],'NaN',1,'Inf',1);
 		checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0,1]);
+		checkfield(md,'fieldname','timestepping.interp_forcing','numel',[1],'values',[0,1]);
+		checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0,1]);
 		checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',0,'NaN',1,'Inf',1);
 		if (this.final_time-this.start_time<0){
 			md.checkmessage('timestepping.final_time should be larger than timestepping.start_time');
+		}
+		if (solution=='TransientSolution'){
+			checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>',0,'NaN',1,'Inf',1);
 		}
 	} // }}}
@@ -52,5 +58,6 @@
 		WriteData(fid,prefix,'object',this,'fieldname','final_time','format','Double','scale',scale);
 		WriteData(fid,prefix,'object',this,'fieldname','time_step','format','Double','scale',scale);
-		WriteData(fid,prefix,'object',this,'fieldname','interp_forcings','format','Boolean');
+		WriteData(fid,prefix,'object',this,'fieldname','interp_forcing','format','Boolean');
+		WriteData(fid,prefix,'object',this,'fieldname','cycle_forcing','format','Boolean');
 		WriteData(fid,prefix,'object',this,'fieldname','coupling_time','format','Double','scale',scale);
 
@@ -63,5 +70,6 @@
 	this.final_time      = 0.;
 	this.time_step       = 0.;
-	this.interp_forcings = 1;
+	this.interp_forcing  = 1;
+	this.cycle_forcing   = 1;
 	this.coupling_time   = 0.;
 
Index: /issm/trunk/src/m/classes/timestepping.m
===================================================================
--- /issm/trunk/src/m/classes/timestepping.m	(revision 26743)
+++ /issm/trunk/src/m/classes/timestepping.m	(revision 26744)
@@ -9,5 +9,6 @@
 		final_time      = 0.;
 		time_step       = 0.;
-		interp_forcings = 1;
+		interp_forcing  = 1;
+		cycle_forcing   = 0;
 		coupling_time   = 0.;
 	end
@@ -23,4 +24,16 @@
 			end
 		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   timestepping parameters:'));
+
+			unit = 'yr';
+			fielddisplay(self,'start_time',['simulation starting time [' unit ']']);
+			fielddisplay(self,'final_time',['final time to stop the simulation [' unit ']']);
+			fielddisplay(self,'time_step',['length of time steps [' unit ']']);
+			fielddisplay(self,'interp_forcing','interpolate in time between requested forcing values? (0 or 1)');
+			fielddisplay(self,'cycle_forcing','cycle through forcing? (0 or 1)');
+			fielddisplay(self,'coupling_time',['length of coupling time step with ocean model [' unit ']']);
+
+		end % }}}
 		function self = setdefaultparameters(self) % {{{
 
@@ -31,6 +44,7 @@
 			self.final_time=10.*self.time_step;
 
-			%should we interpolate forcings between timesteps?
-			self.interp_forcings=1;
+			%should we interpolate forcing between timesteps?
+			self.interp_forcing=1;
+			self.cycle_forcing=0;
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
@@ -39,5 +53,6 @@
 			md = checkfield(md,'fieldname','timestepping.final_time','numel',[1],'NaN',1,'Inf',1);
 			md = checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0 1]);
+			md = checkfield(md,'fieldname','timestepping.interp_forcing','numel',[1],'values',[0 1]);
+			md = checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0 1]);
 			if self.final_time-self.start_time<0,
 				md = checkmessage(md,'timestepping.final_time should be larger than timestepping.start_time');
@@ -45,17 +60,5 @@
 			if strcmp(solution,'TransientSolution'),
 				md = checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>',0,'NaN',1,'Inf',1);
-				md = checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1);
 			end
-		end % }}}
-		function disp(self) % {{{
-			disp(sprintf('   timestepping parameters:'));
-
-			unit = 'yr';
-			fielddisplay(self,'start_time',['simulation starting time [' unit ']']);
-			fielddisplay(self,'final_time',['final time to stop the simulation [' unit ']']);
-			fielddisplay(self,'time_step',['length of time steps [' unit ']']);
-			fielddisplay(self,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)');
-			fielddisplay(self,'coupling_time',['length of coupling time step with ocean model  [' unit ']']);
-
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -66,5 +69,6 @@
 			WriteData(fid,prefix,'object',self,'fieldname','final_time','format','Double','scale',scale);
 			WriteData(fid,prefix,'object',self,'fieldname','time_step','format','Double','scale',scale);
-			WriteData(fid,prefix,'object',self,'fieldname','interp_forcings','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','interp_forcing','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','cycle_forcing','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','coupling_time','format','Double','scale',scale);
 		end % }}}
@@ -74,5 +78,6 @@
 			writejsdouble(fid,[modelname '.timestepping.final_time'],self.final_time);
 			writejsdouble(fid,[modelname '.timestepping.time_step'],self.time_step);
-			writejsdouble(fid,[modelname '.timestepping.interp_forcings'],self.interp_forcings);
+			writejsdouble(fid,[modelname '.timestepping.interp_forcing'],self.interp_forcing);
+			writejsdouble(fid,[modelname '.timestepping.cycle_forcing'],self.cycle_forcing);
 
 		end % }}}
Index: /issm/trunk/src/m/classes/timestepping.py
===================================================================
--- /issm/trunk/src/m/classes/timestepping.py	(revision 26743)
+++ /issm/trunk/src/m/classes/timestepping.py	(revision 26744)
@@ -5,65 +5,67 @@
 
 class timestepping(object):
-    """
-    TIMESTEPPING Class definition
+    """TIMESTEPPING Class definition
 
-       Usage:
-          timestepping = timestepping()
+    Usage:
+        timestepping = timestepping()
     """
 
-    def __init__(self):  # {{{
-        self.start_time = 0.
-        self.final_time = 0.
-        self.time_step = 0.
-        self.interp_forcings = 1
-        self.coupling_time = 0.
+    def __init__(self, *args): #{{{
+        self.start_time = 0
+        self.final_time = 0
+        self.time_step = 0
+        self.interp_forcing = 1
+        self.cycle_forcing = 0
+        self.coupling_time = 0
 
-    #set defaults
-        self.setdefaultparameters()
+        if len(args) == 0:
+            self.setdefaultparameters()
+        else:
+            raise RuntimeError('constructor not supported')
+    #}}}
+    def __repr__(self): #{{{
+        s = '   timestepping parameters:\n'
+        unit = 'yr'
+        s += '{}\n'.format(fielddisplay(self, 'start_time', 'simulation starting time [' + unit + ']'))
+        s += '{}\n'.format(fielddisplay(self, 'final_time', 'final time to stop the simulation [' + unit + ']'))
+        s += '{}\n'.format(fielddisplay(self, 'time_step', 'length of time steps [' + unit + ']'))
+        s += '{}\n'.format(fielddisplay(self, 'interp_forcing', 'interpolate in time between requested forcing values? (0 or 1)'))
+        s += '{}\n'.format(fielddisplay(self, 'cycle_forcing', 'cycle through forcing? (0 or 1)'))
+        s += '{}\n'.format(fielddisplay(self, 'coupling_time', 'length of coupling time steps with ocean model [' + unit + ']'))
+        return s
+    #}}}
+    def setdefaultparameters(self): #{{{
+        # Time between 2 time steps
+        self.time_step = 1 / 2
 
-    #}}}
+        # Final time
+        self.final_time = 10 * self.time_step
 
-    def __repr__(self):  # {{{
-        string = "   timestepping parameters:"
-        string = "%s\n%s" % (string, fielddisplay(self, "start_time", "simulation starting time [yr]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "final_time", "final time to stop the simulation [yr]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "time_step", "length of time steps [yr]"))
-        string = "%s\n%s" % (string, fielddisplay(self, "interp_forcings", "interpolate in time between requested forcing values ? (0 or 1)"))
-        string = "%s\n%s" % (string, fielddisplay(self, "coupling_time", "length of coupling time steps with ocean model [yr]"))
-        return string
-    #}}}
-
-    def setdefaultparameters(self):  # {{{
-        #time between 2 time steps
-        self.time_step = 1. / 2.
-        #final time
-        self.final_time = 10. * self.time_step
-        #should we interpolate forcings between timesteps?
-        self.interp_forcings = 1
+        # Should we interpolate forcing between timesteps?
+        self.interp_forcing = 1
+        self.cycle_forcing = 0
 
         return self
     #}}}
-
-    def checkconsistency(self, md, solution, analyses):  # {{{
-
+    def checkconsistency(self, md, solution, analyses): #{{{
         md = checkfield(md, 'fieldname', 'timestepping.start_time', 'numel', [1], 'NaN', 1, 'Inf', 1)
         md = checkfield(md, 'fieldname', 'timestepping.final_time', 'numel', [1], 'NaN', 1, 'Inf', 1)
         md = checkfield(md, 'fieldname', 'timestepping.time_step', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
-        if self.final_time - self.start_time < 0:
-            md.checkmessage("timestepping.final_time should be larger than timestepping.start_time")
-            md = checkfield(md, 'fieldname', 'timestepping.coupling_time', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
-        md = checkfield(md, 'fieldname', 'timestepping.interp_forcings', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'timestepping.cycle_forcing', 'numel', [1], 'values', [0, 1])
+        if (self.final_time - self.start_time) < 0:
+            md.checkmessage('timestepping.final_time should be larger than timestepping.start_time')
+        if solution == 'TransientSolution':
+            md = checkfield(md, 'fieldname', 'timestepping.time_step', 'numel', [1], '>', 0, 'NaN', 1, 'Inf', 1)
 
         return md
-    # }}}
-
-    def marshall(self, prefix, md, fid):  # {{{
-
-        yts = md.constants.yts
+    #}}}
+    def marshall(self, prefix, md, fid): #{{{
+        scale = md.constants.yts
         WriteData(fid, prefix, 'name', 'md.timestepping.type', 'data', 1, 'format', 'Integer')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'start_time', 'format', 'Double', 'scale', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'final_time', 'format', 'Double', 'scale', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'time_step', 'format', 'Double', 'scale', yts)
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'interp_forcings', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'coupling_time', 'format', 'Double', 'scale', yts)
-    # }}}
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'start_time', 'format', 'Double', 'scale', scale)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'final_time', 'format', 'Double', 'scale', scale)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'time_step', 'format', 'Double', 'scale', scale)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'interp_forcing', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'cycle_forcing', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'coupling_time', 'format', 'Double', 'scale', scale)
+    #}}}
Index: /issm/trunk/src/m/classes/timesteppingadaptive.js
===================================================================
--- /issm/trunk/src/m/classes/timesteppingadaptive.js	(revision 26743)
+++ /issm/trunk/src/m/classes/timesteppingadaptive.js	(revision 26744)
@@ -19,4 +19,5 @@
 		//should we interpolate forcings between timesteps?
 		this.interp_forcings=1;
+		this.cycle_forcing=0;
 	}// }}}
 	this.disp= function(){// {{{
@@ -31,4 +32,5 @@
 		fielddisplay(this,'cfl_coefficient','coefficient applied to cfl condition');
 		fielddisplay(this,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)');
+		fielddisplay(this,'cycle_forcing','cycle through forcing ? (0 or 1)');
 		fielddisplay(this,'coupling_time','coupling time steps with ocean model [' +unit+ ']');
 
@@ -46,4 +48,5 @@
 		checkfield(md,'fieldname','timestepping.cfl_coefficient','numel',[1],'>',0,'<=',1);
 		checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0,1]);
+		checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0,1]);
 		if (this.final_time-this.start_time<0){
 			md.checkmessage('timestepping.final_time should be larger than timestepping.start_time');
@@ -63,4 +66,5 @@
 		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','cfl_coefficient','format','Double');
 		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','interp_forcings','format','Boolean');
+		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','cycle_forcing','format','Boolean');
 		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','coupling_time','format','Double','scale',scale);
 
@@ -76,4 +80,5 @@
 	this.cfl_coefficient = 0.;
 	this.interp_forcings = 1;
+	this.cycle_forcing   = 0;
 	this.coupling_time   = 0.;
 
Index: /issm/trunk/src/m/classes/timesteppingadaptive.m
===================================================================
--- /issm/trunk/src/m/classes/timesteppingadaptive.m	(revision 26743)
+++ /issm/trunk/src/m/classes/timesteppingadaptive.m	(revision 26744)
@@ -11,5 +11,6 @@
 		time_step_max   = 0.;
 		cfl_coefficient = 0.;
-		interp_forcings = 1;
+		interp_forcing = 1;
+		cycle_forcing = 1;
 		coupling_time   = 0.;
 	end
@@ -37,6 +38,7 @@
 			self.cfl_coefficient=0.5;
 
-			%should we interpolate forcings between timesteps?
-			self.interp_forcings=1;
+			%should we interpolate forcing between timesteps?
+			self.interp_forcing=1;
+			self.cycle_forcing=0;
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
@@ -47,5 +49,6 @@
 			md = checkfield(md,'fieldname','timestepping.time_step_max','numel',[1],'>=',md.timestepping.time_step_min,'NaN',1,'Inf',1);
 			md = checkfield(md,'fieldname','timestepping.cfl_coefficient','numel',[1],'>',0,'<=',1);
-			md = checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0 1]);
+			md = checkfield(md,'fieldname','timestepping.interp_forcing','numel',[1],'values',[0 1]);
+			md = checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',md.timestepping.coupling_time,'NaN',1,'Inf',1);
 			if self.final_time-self.start_time<0,
@@ -62,5 +65,6 @@
 			fielddisplay(self,'time_step_max',['maximum length of time step [' unit ']']);
 			fielddisplay(self,'cfl_coefficient','coefficient applied to cfl condition');
-			fielddisplay(self,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)');
+			fielddisplay(self,'interp_forcing','interpolate in time between requested forcing values ? (0 or 1)');
+			fielddisplay(self,'cycle_forcing','cycle through forcing ? (0 or 1)');
 			fielddisplay(self,'coupling_time',['coupling time step with ocean model [' unit ']']);
 
@@ -75,5 +79,6 @@
 			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','time_step_max','format','Double','scale',scale);
 			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','cfl_coefficient','format','Double');
-			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','interp_forcings','format','Boolean');
+			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','interp_forcing','format','Boolean');
+			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','cycle_forcing','format','Boolean');
 			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','coupling_time','format','Double','scale',scale);
 		end % }}}
@@ -85,5 +90,6 @@
 			writejsdouble(fid,[modelname '.timesteppingadaptive.time_step_max'],self.time_step_max);
 			writejsdouble(fid,[modelname '.timesteppingadaptive.cfl_coefficient'],self.cfl_coefficient);
-			writejsdouble(fid,[modelname '.timesteppingadaptive.interp_forcings'],self.interp_forcings);
+			writejsdouble(fid,[modelname '.timesteppingadaptive.interp_forcing'],self.interp_forcing);
+			writejsdouble(fid,[modelname '.timesteppingadaptive.cycle_forcing'],self.cycle_forcing);
 			writejsdouble(fid,[modelname '.timesteppingadaptive.coupling_time'],self.time_step_max);
 
Index: /issm/trunk/src/m/classes/timesteppingadaptive.py
===================================================================
--- /issm/trunk/src/m/classes/timesteppingadaptive.py	(revision 26743)
+++ /issm/trunk/src/m/classes/timesteppingadaptive.py	(revision 26744)
@@ -19,5 +19,6 @@
             self.time_step_max = 0.
             self.cfl_coefficient = 0.
-            self.interp_forcings = 1
+            self.interp_forcing = 1
+            self.cycle_forcing = 0
             self.coupling_time = 0.
 
@@ -31,5 +32,6 @@
             self.start_time = old.start_time
             self.final_time = old.final_time
-            self.interp_forcings = old.interp_forcings
+            self.interp_forcing = old.interp_forcing
+            self.cycle_forcing = old.cycle_forcing
             self.coupling_time = old.coupling_time
 
@@ -45,5 +47,6 @@
         string = "%s\n%s" % (string, fielddisplay(self, "time_step_max", "maximum length of time steps [yr]"))
         string = "%s\n%s" % (string, fielddisplay(self, "cfl_coefficient", "coefficient applied to cfl condition"))
-        string = "%s\n%s" % (string, fielddisplay(self, "interp_forcings", "interpolate in time between requested forcing values ? (0 or 1)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "interp_forcing", "interpolate in time between requested forcing values ? (0 or 1)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "cycle_forcing", "cycle through forcing ? (0 or 1)"))
         string = "%s\n%s" % (string, fielddisplay(self, "coupling_time", "coupling time steps with ocean model [yr]"))
         return string
@@ -58,6 +61,7 @@
         #time adaptation?
         self.cfl_coefficient = 0.5
-        #should we interpolate forcings between timesteps?
-        self.interp_forcings = 1
+        #should we interpolate forcing between timesteps?
+        self.interp_forcing = 1
+        self.cycle_forcing   = 0
         return self
     #}}}
@@ -71,5 +75,6 @@
         if self.final_time - self.start_time < 0:
             md.checkmessage("timestepping.final_time should be larger than timestepping.start_time")
-        md = checkfield(md, 'fieldname', 'timestepping.interp_forcings', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'timestepping.interp_forcing', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'timestepping.cycle_forcing', 'numel', [1], 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'timestepping.coupling_time', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
 
@@ -85,5 +90,6 @@
         WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'time_step_max', 'format', 'Double', 'scale', yts)
         WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'cfl_coefficient', 'format', 'Double')
-        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'interp_forcings', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'interp_forcing', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'cycle_forcing', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'coupling_time', 'format', 'Double', 'scale', yts)
     # }}}
Index: /issm/trunk/src/m/classes/toolkits.m
===================================================================
--- /issm/trunk/src/m/classes/toolkits.m	(revision 26743)
+++ /issm/trunk/src/m/classes/toolkits.m	(revision 26744)
@@ -105,5 +105,5 @@
 					case 'LoveAnalysis'
 					case 'EsaAnalysis'
-					case 'SealevelriseAnalysis'
+					case 'SealevelchangeAnalysis'
 					otherwise
 						md = checkmessage(md,['md.toolkits.' analyses{i} ' not supported yet']);
Index: sm/trunk/src/m/classes/trans.js
===================================================================
--- /issm/trunk/src/m/classes/trans.js	(revision 26743)
+++ 	(revision )
@@ -1,132 +1,0 @@
-//TRANS class definition
-//
-//   Usage:
-//      trans =new trans();
-
-function trans (){
-	//methods
-	this.setdefaultparameters = function(){// {{{
-
-		//full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
-		this.issmb             = 1;
-		this.ismasstransport   = 1;
-		this.isstressbalance   = 1;
-		this.isthermal         = 0;
-		this.isgroundingline   = 0;
-		this.isgia             = 0;
-		this.isesa             = 0;
-		this.isdamageevolution = 0;
-		this.ismovingfront     = 0;
-		this.ishydrology       = 0;
-		this.isslr             = 0;
-		this.isoceancoupling   = 0;
-		this.iscoupler         = 0;
-		this.amr_frequency     = 0;
-
-		//default output
-		this.requested_outputs=['default'];
-
-	}// }}}
-	this.disp= function(){// {{{
-
-		console.log(sprintf('   transient solution parameters:'));
-
-		fielddisplay(this,'issmb','indicates whether a surface mass balance solution is used in the transient');
-		fielddisplay(this,'ismasstransport','indicates whether a masstransport solution is used in the transient');
-		fielddisplay(this,'isstressbalance','indicates whether a stressbalance solution is used in the transient');
-		fielddisplay(this,'isthermal','indicates whether a thermal solution is used in the transient');
-		fielddisplay(this,'isgroundingline','indicates whether a groundingline migration is used in the transient');
-		fielddisplay(this,'isgia','indicates whether a postglacial rebound model is used in the transient');
-		fielddisplay(this,'isesa','indicates whether an elastic adjustment model is used in the transient');
-		fielddisplay(this,'isdamageevolution','indicates whether damage evolution is used in the transient');
-		fielddisplay(this,'ismovingfront','indicates whether a moving front capability is used in the transient');
-		fielddisplay(this,'ishydrology','indicates whether an hydrology model is used');
-		fielddisplay(this,'isslr','indicates whether a sea-level rise model is used');
-		fielddisplay(this,'isoceancoupling','indicates whether a coupling with an ocean model is used in the transient');
-		fielddisplay(this,'iscoupler','indicates whether different models are being run with need for coupling');
-		fielddisplay(this,'amr_frequency','frequency at which mesh is refined in simulations with multiple time_steps');
-		fielddisplay(this,'requested_outputs','list of additional outputs requested');
-
-
-	}// }}}
-	this.classname= function(){// {{{
-		return "transient";
-	}// }}}
-		this.checkconsistency = function(md,solution,analyses) { // {{{
-
-			//Early return
-			if (solution!='TransientSolution') return;
-
-			checkfield(md,'fieldname','trans.issmb','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','trans.ismasstransport','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','trans.isstressbalance','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','trans.isthermal','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','trans.isgroundingline','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','trans.isgia','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','trans.isesa','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','trans.isdamageevolution','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','trans.ismovingfront','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','trans.ishydrology','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','trans.isslr','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','trans.isoceancoupling','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','trans.iscoupler','numel',[1],'values',[0, 1]);
-			checkfield(md,'fieldname','trans.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1);
-			checkfield(md,'fieldname','trans.requested_outputs','stringrow',1);
-		} // }}}
-		this.marshall=function(md,prefix,fid) { //{{{
-
-			prefix='md.transient';
-			WriteData(fid,prefix,'object',this,'fieldname','issmb','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','ismasstransport','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isstressbalance','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isthermal','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isgroundingline','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isgia','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isesa','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isdamageevolution','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','ishydrology','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','ismovingfront','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isslr','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','isoceancoupling','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','iscoupler','format','Boolean');
-			WriteData(fid,prefix,'object',this,'fieldname','amr_frequency','format','Integer');
-
-			//process requested outputs
-			var outputs = this.requested_outputs;
-			for (var i=0;i<outputs.length;i++){
-				if (outputs[i] == 'default') {
-					outputs.splice(i,1);
-					var newoutputs=this.defaultoutputs(md);
-					for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
-				}
-			}			
-			WriteData(fid,prefix,'data',outputs,'name','md.transient.requested_outputs','format','StringArray');
-		}//}}}
-		this.defaultoutputs = function(md) { //{{{
-			if(this.issmb)return ['SmbMassBalance'];
-			else return [];
-		}//}}}
-		this.fix=function() { //{{{
-		}//}}}
-	//properties 
-	// {{{
-
-	this.issmb             = 0;
-	this.ismasstransport   = 0;
-	this.isstressbalance   = 0;
-	this.isthermal         = 0;
-	this.isgroundingline   = 0;
-	this.isgia             = 0;
-	this.isesa             = 0;
-	this.isdamageevolution = 0;
-	this.ismovingfront     = 0;
-	this.ishydrology       = 0;
-	this.isslr             = 0;
-	this.isoceancoupling   = 0;
-	this.iscoupler         = 0;
-	this.amr_frequency	   = 0;
-	this.requested_outputs = [];
-
-	this.setdefaultparameters();
-	//}}}
-}
Index: /issm/trunk/src/m/classes/transient.js
===================================================================
--- /issm/trunk/src/m/classes/transient.js	(revision 26744)
+++ /issm/trunk/src/m/classes/transient.js	(revision 26744)
@@ -0,0 +1,132 @@
+//TRANSIENT class definition
+//
+//   Usage:
+//      transient =new transient();
+
+function transient (){
+	//methods
+	this.setdefaultparameters = function(){// {{{
+
+		//full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
+		this.issmb             = 1;
+		this.ismasstransport   = 1;
+		this.isstressbalance   = 1;
+		this.isthermal         = 0;
+		this.isgroundingline   = 0;
+		this.isgia             = 0;
+		this.isesa             = 0;
+		this.isdamageevolution = 0;
+		this.ismovingfront     = 0;
+		this.ishydrology       = 0;
+		this.isslr             = 0;
+		this.isoceancoupling   = 0;
+		this.iscoupler         = 0;
+		this.amr_frequency     = 0;
+
+		//default output
+		this.requested_outputs=['default'];
+
+	}// }}}
+	this.disp= function(){// {{{
+
+		console.log(sprintf('   transient solution parameters:'));
+
+		fielddisplay(this,'issmb','indicates whether a surface mass balance solution is used in the transient');
+		fielddisplay(this,'ismasstransport','indicates whether a masstransport solution is used in the transient');
+		fielddisplay(this,'isstressbalance','indicates whether a stressbalance solution is used in the transient');
+		fielddisplay(this,'isthermal','indicates whether a thermal solution is used in the transient');
+		fielddisplay(this,'isgroundingline','indicates whether a groundingline migration is used in the transient');
+		fielddisplay(this,'isgia','indicates whether a postglacial rebound model is used in the transient');
+		fielddisplay(this,'isesa','indicates whether an elastic adjustment model is used in the transient');
+		fielddisplay(this,'isdamageevolution','indicates whether damage evolution is used in the transient');
+		fielddisplay(this,'ismovingfront','indicates whether a moving front capability is used in the transient');
+		fielddisplay(this,'ishydrology','indicates whether an hydrology model is used');
+		fielddisplay(this,'isslr','indicates whether a sea-level rise model is used');
+		fielddisplay(this,'isoceancoupling','indicates whether a coupling with an ocean model is used in the transient');
+		fielddisplay(this,'iscoupler','indicates whether different models are being run with need for coupling');
+		fielddisplay(this,'amr_frequency','frequency at which mesh is refined in simulations with multiple time_steps');
+		fielddisplay(this,'requested_outputs','list of additional outputs requested');
+
+
+	}// }}}
+	this.classname= function(){// {{{
+		return "transient";
+	}// }}}
+		this.checkconsistency = function(md,solution,analyses) { // {{{
+
+			//Early return
+			if (solution!='TransientSolution') return;
+
+			checkfield(md,'fieldname','transient.issmb','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','transient.ismasstransport','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','transient.isstressbalance','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','transient.isthermal','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','transient.isgroundingline','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','transient.isgia','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','transient.isesa','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','transient.isdamageevolution','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','transient.ismovingfront','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','transient.ishydrology','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','transient.isslr','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','transient.isoceancoupling','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','transient.iscoupler','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','transient.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1);
+			checkfield(md,'fieldname','transient.requested_outputs','stringrow',1);
+		} // }}}
+		this.marshall=function(md,prefix,fid) { //{{{
+
+			prefix='md.transient';
+			WriteData(fid,prefix,'object',this,'fieldname','issmb','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','ismasstransport','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','isoceantransport','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','isstressbalance','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','isthermal','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','isgroundingline','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','isesa','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','isdamageevolution','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','ishydrology','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','ismovingfront','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','issampling','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','isslc','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','isoceancoupling','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','amr_frequency','format','Integer');
+
+			//process requested outputs
+			var outputs = this.requested_outputs;
+			for (var i=0;i<outputs.length;i++){
+				if (outputs[i] == 'default') {
+					outputs.splice(i,1);
+					var newoutputs=this.defaultoutputs(md);
+					for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
+				}
+			}			
+			WriteData(fid,prefix,'data',outputs,'name','md.transient.requested_outputs','format','StringArray');
+		}//}}}
+		this.defaultoutputs = function(md) { //{{{
+			if(this.issmb)return ['SmbMassBalance'];
+			else return [];
+		}//}}}
+		this.fix=function() { //{{{
+		}//}}}
+	//properties 
+	// {{{
+
+	this.issmb             = 0;
+	this.ismasstransport   = 0;
+	this.isstressbalance   = 0;
+	this.isthermal         = 0;
+	this.isgroundingline   = 0;
+	this.isgia             = 0;
+	this.isesa             = 0;
+	this.isdamageevolution = 0;
+	this.ismovingfront     = 0;
+	this.ishydrology       = 0;
+	this.isslr             = 0;
+	this.isoceancoupling   = 0;
+	this.iscoupler         = 0;
+	this.amr_frequency	   = 0;
+	this.requested_outputs = [];
+
+	this.setdefaultparameters();
+	//}}}
+}
Index: /issm/trunk/src/m/classes/transient.m
===================================================================
--- /issm/trunk/src/m/classes/transient.m	(revision 26743)
+++ /issm/trunk/src/m/classes/transient.m	(revision 26744)
@@ -8,14 +8,14 @@
 		issmb             = 0;
 		ismasstransport   = 0;
+		isoceantransport  = 0;
 		isstressbalance   = 0;
 		isthermal         = 0;
 		isgroundingline   = 0;
-		isgia             = 0;
 		isesa             = 0;
 		isdamageevolution = 0;
 		ismovingfront     = 0;
 		ishydrology       = 0;
-		isslr             = 0;
-		iscoupler         = 0;
+		issampling        = 0;
+		isslc             = 0;
 		amr_frequency     = 0;
 		isoceancoupling   = 0;
@@ -34,18 +34,18 @@
 
 			%full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
-			self.issmb           = 0;
-			self.ismasstransport = 0;
-			self.isstressbalance = 0;
-			self.isthermal       = 0;
-			self.isgroundingline = 0;
-			self.isgia           = 0;
-			self.isesa           = 0;
+			self.issmb             = 0;
+			self.ismasstransport   = 0;
+			self.isoceantransport  = 0;
+			self.isstressbalance   = 0;
+			self.isthermal         = 0;
+			self.isgroundingline   = 0;
+			self.isesa             = 0;
 			self.isdamageevolution = 0;
-			self.ismovingfront   =0;
-			self.ishydrology     = 0;
-			self.isslr           = 0;
-			self.isoceancoupling = 0;
-			self.iscoupler       = 0;
-			self.amr_frequency	= 0;
+			self.ismovingfront     = 0;
+			self.ishydrology       = 0;
+			self.issampling        = 0;
+			self.isslc             = 0;
+			self.isoceancoupling   = 0;
+			self.amr_frequency     = 0;
 
 			%default output
@@ -55,18 +55,18 @@
 
 			%full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
-			self.issmb           = 1;
-			self.ismasstransport = 1;
-			self.isstressbalance = 1;
-			self.isthermal       = 1;
-			self.isgroundingline = 0;
-			self.isgia           = 0;
-			self.isesa           = 0;
+			self.issmb             = 1;
+			self.ismasstransport   = 1;
+			self.isoceantransport  = 0;
+			self.isstressbalance   = 1;
+			self.isthermal         = 1;
+			self.isgroundingline   = 0;
+			self.isesa             = 0;
 			self.isdamageevolution = 0;
-			self.ismovingfront   = 0;
-			self.ishydrology     = 0;
-			self.isslr           = 0;
-			self.isoceancoupling = 0;
-			self.iscoupler       = 0;
-			self.amr_frequency	= 0;
+			self.ismovingfront     = 0;
+			self.ishydrology       = 0;
+			self.issampling        = 0;
+			self.isslc             = 0;
+			self.isoceancoupling   = 0;
+			self.amr_frequency     = 0;
 
 			%default output
@@ -87,8 +87,8 @@
 			md = checkfield(md,'fieldname','transient.issmb','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.ismasstransport','numel',[1],'values',[0 1]);
+			md = checkfield(md,'fieldname','transient.isoceantransport','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.isstressbalance','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.isthermal','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.isgroundingline','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.isgia','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.isesa','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.isdamageevolution','numel',[1],'values',[0 1]);
@@ -96,7 +96,7 @@
 			md = checkfield(md,'fieldname','transient.ishydrology','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.requested_outputs','stringrow',1);
-			md = checkfield(md,'fieldname','transient.isslr','numel',[1],'values',[0 1]);
+			md = checkfield(md,'fieldname','transient.isslc','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','transient.isoceancoupling','numel',[1],'values',[0 1]);
-			md = checkfield(md,'fieldname','transient.iscoupler','numel',[1],'values',[0 1]);
+			md = checkfield(md,'fieldname','transient.issampling','numel',[1],'values',[0 1]);  
 			md = checkfield(md,'fieldname','transient.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1);
 
@@ -113,15 +113,15 @@
 			fielddisplay(self,'issmb','indicates whether a surface mass balance solution is used in the transient');
 			fielddisplay(self,'ismasstransport','indicates whether a masstransport solution is used in the transient');
+			fielddisplay(self,'isoceantransport','indicates whether an ocean masstransport solution is used in the transient');
 			fielddisplay(self,'isstressbalance','indicates whether a stressbalance solution is used in the transient');
 			fielddisplay(self,'isthermal','indicates whether a thermal solution is used in the transient');
 			fielddisplay(self,'isgroundingline','indicates whether a groundingline migration is used in the transient');
-			fielddisplay(self,'isgia','indicates whether a postglacial rebound model is used in the transient');
 			fielddisplay(self,'isesa','indicates whether an elastic adjustment model is used in the transient');
 			fielddisplay(self,'isdamageevolution','indicates whether damage evolution is used in the transient');
 			fielddisplay(self,'ismovingfront','indicates whether a moving front capability is used in the transient');
 			fielddisplay(self,'ishydrology','indicates whether an hydrology model is used');
-			fielddisplay(self,'isslr','indicates whether a sea-level rise solution is used in the transient');
+			fielddisplay(self,'issampling','indicates whether sampling is used in the transient')
+			fielddisplay(self,'isslc','indicates whether a sea-level change solution is used in the transient');
 			fielddisplay(self,'isoceancoupling','indicates whether a coupling with an ocean model is used in the transient');
-			fielddisplay(self,'iscoupler','indicates whether different models are being run with need for coupling');
 			fielddisplay(self,'amr_frequency','frequency at which mesh is refined in simulations with multiple time_steps');
 			fielddisplay(self,'requested_outputs','list of additional outputs requested');
@@ -131,15 +131,15 @@
 			WriteData(fid,prefix,'object',self,'fieldname','issmb','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','ismasstransport','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','isoceantransport','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','isstressbalance','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','isthermal','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','isgroundingline','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isgia','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','isesa','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','isdamageevolution','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','ishydrology','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','ismovingfront','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','isslr','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','issampling','format','Boolean'); 
+			WriteData(fid,prefix,'object',self,'fieldname','isslc','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','isoceancoupling','format','Boolean');
-			WriteData(fid,prefix,'object',self,'fieldname','iscoupler','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','amr_frequency','format','Integer');
 
@@ -157,15 +157,15 @@
 			writejsdouble(fid,[modelname '.trans.issmb'],self.issmb);
 			writejsdouble(fid,[modelname '.trans.ismasstransport'],self.ismasstransport);
+			writejsdouble(fid,[modelname '.trans.isoceantransport'],self.isoceantransport);
 			writejsdouble(fid,[modelname '.trans.isstressbalance'],self.isstressbalance);
 			writejsdouble(fid,[modelname '.trans.isthermal'],self.isthermal);
 			writejsdouble(fid,[modelname '.trans.isgroundingline'],self.isgroundingline);
-			writejsdouble(fid,[modelname '.trans.isgia'],self.isgia);
 			writejsdouble(fid,[modelname '.trans.isesa'],self.isesa);
 			writejsdouble(fid,[modelname '.trans.isdamageevolution'],self.isdamageevolution);
 			writejsdouble(fid,[modelname '.trans.ismovingfront'],self.ismovingfront);
 			writejsdouble(fid,[modelname '.trans.ishydrology'],self.ishydrology);
-			writejsdouble(fid,[modelname '.trans.isslr'],self.isslr);
+			writejsdouble(fid,[modelname '.trans.issampling'],self.issampling); 
+			writejsdouble(fid,[modelname '.trans.isslc'],self.isslc);
 			writejsdouble(fid,[modelname '.trans.isoceancoupling'],self.isoceancoupling);
-			writejsdouble(fid,[modelname '.trans.iscoupler'],self.iscoupler);
 			writejsdouble(fid,[modelname '.trans.amr_frequency'],self.amr_frequency);
 			writejscellstring(fid,[modelname '.trans.requested_outputs'],self.requested_outputs);
Index: /issm/trunk/src/m/classes/transient.py
===================================================================
--- /issm/trunk/src/m/classes/transient.py	(revision 26743)
+++ /issm/trunk/src/m/classes/transient.py	(revision 26744)
@@ -14,14 +14,14 @@
         self.issmb = 0
         self.ismasstransport = 0
+        self.isoceantransport = 0
         self.isstressbalance = 0
         self.isthermal = 0
         self.isgroundingline = 0
-        self.isgia = 0
         self.isesa = 0
         self.isdamageevolution = 0
         self.ismovingfront = 0
         self.ishydrology = 0
-        self.isslr = 0
-        self.iscoupler = 0
+        self.issampling = 0
+        self.isslc = 0
         self.amr_frequency = 0
         self.isoceancoupling = 0
@@ -29,5 +29,5 @@
 
         self.setdefaultparameters()
-    #}}}
+    # }}}
 
     def __repr__(self):  # {{{
@@ -35,19 +35,19 @@
         s += '{}\n'.format(fielddisplay(self, 'issmb', 'indicates if a surface mass balance solution is used in the transient'))
         s += '{}\n'.format(fielddisplay(self, 'ismasstransport', 'indicates if a masstransport solution is used in the transient'))
+        s += '{}\n'.format(fielddisplay(self, 'isoceantransport', 'indicates whether an ocean masstransport solution is used in the transient'))
         s += '{}\n'.format(fielddisplay(self, 'isstressbalance', 'indicates if a stressbalance solution is used in the transient'))
         s += '{}\n'.format(fielddisplay(self, 'isthermal', 'indicates if a thermal solution is used in the transient'))
         s += '{}\n'.format(fielddisplay(self, 'isgroundingline', 'indicates if a groundingline migration is used in the transient'))
-        s += '{}\n'.format(fielddisplay(self, 'isgia', 'indicates if a postglacial rebound is used in the transient'))
         s += '{}\n'.format(fielddisplay(self, 'isesa', 'indicates whether an elastic adjustment model is used in the transient'))
         s += '{}\n'.format(fielddisplay(self, 'isdamageevolution', 'indicates whether damage evolution is used in the transient'))
         s += '{}\n'.format(fielddisplay(self, 'ismovingfront', 'indicates whether a moving front capability is used in the transient'))
         s += '{}\n'.format(fielddisplay(self, 'ishydrology', 'indicates whether an hydrology model is used'))
-        s += '{}\n'.format(fielddisplay(self, 'isslr', 'indicates if a sea level rise solution is used in the transient'))
+        s += '{}\n'.format(fielddisplay(self, 'issampling', 'indicates whether sampling is used in the transient'))
+        s += '{}\n'.format(fielddisplay(self, 'isslc', 'indicates if a sea level change solution is used in the transient'))
         s += '{}\n'.format(fielddisplay(self, 'isoceancoupling', 'indicates whether coupling with an ocean model is used in the transient'))
-        s += '{}\n'.format(fielddisplay(self, 'iscoupler', 'indicates whether different models are being run with need for coupling'))
         s += '{}\n'.format(fielddisplay(self, 'amr_frequency', 'frequency at which mesh is refined in simulations with multiple time_steps'))
         s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'list of additional outputs requested'))
         return s
-    #}}}
+    # }}}
 
     def defaultoutputs(self, md):  # {{{
@@ -56,20 +56,20 @@
         else:
             return []
-    #}}}
+    # }}}
 
     def deactivateall(self):  #{{{
         self.issmb = 0
         self.ismasstransport = 0
+        self.isoceantransport = 0
         self.isstressbalance = 0
         self.isthermal = 0
         self.isgroundingline = 0
-        self.isgia = 0
         self.isesa = 0
         self.isdamageevolution = 0
         self.ismovingfront = 0
         self.ishydrology = 0
-        self.isslr = 0
+        self.issampling = 0
+        self.isslc = 0
         self.isoceancoupling = 0
-        self.iscoupler = 0
         self.amr_frequency = 0
 
@@ -77,21 +77,22 @@
         self.requested_outputs = []
         return self
-    #}}}
+    # }}}
 
     def setdefaultparameters(self):  # {{{
-        #full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
+        # Full analysis: Stressbalance, Masstransport and Thermal but no 
+        # groundingline migration for now
         self.issmb = 1
         self.ismasstransport = 1
+        self.isoceantransport = 0
         self.isstressbalance = 1
         self.isthermal = 1
         self.isgroundingline = 0
-        self.isgia = 0
         self.isesa = 0
         self.isdamageevolution = 0
         self.ismovingfront = 0
         self.ishydrology = 0
-        self.isslr = 0
+        self.issampling = 0
+        self.isslc = 0
         self.isoceancoupling = 0
-        self.iscoupler = 0
         self.amr_frequency = 0
 
@@ -99,5 +100,5 @@
         self.requested_outputs = ['default']
         return self
-    #}}}
+    # }}}
 
     def checkconsistency(self, md, solution, analyses):  # {{{
@@ -108,15 +109,15 @@
         md = checkfield(md, 'fieldname', 'transient.issmb', 'numel', [1], 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'transient.ismasstransport', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.isoceantransport', 'numel', [1], 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'transient.isstressbalance', 'numel', [1], 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'transient.isthermal', 'numel', [1], 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'transient.isgroundingline', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.isgia', 'numel', [1], 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'transient.isesa', 'numel', [1], 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'transient.isdamageevolution', 'numel', [1], 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'transient.ishydrology', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.issampling', 'numel', [1], 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'transient.ismovingfront', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.isslr', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.isslc', 'numel', [1], 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'transient.isoceancoupling', 'numel', [1], 'values', [0, 1])
-        md = checkfield(md, 'fieldname', 'transient.iscoupler', 'numel', [1], 'values', [0, 1])
         md = checkfield(md, 'fieldname', 'transient.amr_frequency', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
 
@@ -131,15 +132,15 @@
         WriteData(fid, prefix, 'object', self, 'fieldname', 'issmb', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'ismasstransport', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isoceantransport', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'isstressbalance', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'isthermal', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'isgroundingline', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isgia', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'isesa', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'isdamageevolution', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'ishydrology', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'ismovingfront', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isslr', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'issampling', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isslc', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'isoceancoupling', 'format', 'Boolean')
-        WriteData(fid, prefix, 'object', self, 'fieldname', 'iscoupler', 'format', 'Boolean')
         WriteData(fid, prefix, 'object', self, 'fieldname', 'amr_frequency', 'format', 'Integer')
 
Index: /issm/trunk/src/m/classes/verbose.js
===================================================================
--- /issm/trunk/src/m/classes/verbose.js	(revision 26743)
+++ /issm/trunk/src/m/classes/verbose.js	(revision 26744)
@@ -25,4 +25,9 @@
 	//methods
 	this.setdefaultparameters = function(){// {{{
+		//switch(nargin),
+			//case 0,
+		this.verbose.solution=true;
+		this.verbose.qmu=true;
+		this.verbose.control=true;
 	}// }}}
 	this.disp= function(){// {{{
@@ -67,5 +72,4 @@
 	//properties 
 	// {{{
-	//BEGINFIELDS
 	this.mprocessor=false;
 	this.module=false;
@@ -77,7 +81,6 @@
 	this.autodiff=false;
 	this.smb=false;
-	//ENDFIELDS
+
+	this.setdefaultparameters();
 	// }}}
-	this.setdefaultparameters();
-	//}}}
 }
Index: /issm/trunk/src/m/classes/verbose.py
===================================================================
--- /issm/trunk/src/m/classes/verbose.py	(revision 26743)
+++ /issm/trunk/src/m/classes/verbose.py	(revision 26744)
@@ -4,26 +4,27 @@
 
 class verbose(object):
-    """
-    VERBOSE class definition
+    """VERBOSE class definition
 
-       Available verbosity levels:
-          mprocessor  : model processing
-          module      : modules
-          solution    : solution sequence
-          solver      : solver info (extensive)
-          convergence : convergence criteria
-          control     : control method
-          qmu         : sensitivity analysis
-          autodiff    : AD analysis
-          smb         : SMB analysis
+    Available verbosity levels:
+        mprocessor  : model processing
+        module      : modules
+        solution    : solution sequence
+        solver      : solver info (extensive)
+        convergence : convergence criteria
+        control     : control method
+        qmu         : sensitivity analysis
+        autodiff    : AD analysis
+        smb         : SMB analysis
 
-       Usage:
-          verbose = verbose()
-          verbose = verbose(3)
-          verbose = verbose('001100')
-          verbose = verbose('module', True, 'solver', False)
+    Usage:
+        verbose = verbose()
+        verbose = verbose(3)
+        verbose = verbose('001100')
+        verbose = verbose('module', True, 'solver', False)
 
-    WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
-             Do not modify these sections. See src/c/shared/Numerics/README for more info
+    NOTE:
+    - Some parts of this file are Synchronized with 
+    src/c/shared/Numerics/Verbosity.h. Do not modify these sections. See 
+    src/c/shared/Numerics/README for more info.
     """
 
@@ -42,5 +43,5 @@
 
         if not len(args):
-            #Don't do anything
+            # Don't do anything
             self.solution = True
             self.qmu = True
@@ -52,7 +53,7 @@
             if isinstance(binary, str):
                 if binary.lower() == 'all':
-                    binary = 2**11 - 1  #all ones
+                    binary = pow(2, 11) - 1  # all ones
                     self.BinaryToVerbose(binary)
-                    self.solver = False  #Do not use by default
+                    self.solver = False  # Do not use by default
                 else:
                     binary = int(binary, 2)
@@ -62,8 +63,8 @@
 
         else:
-            #Use options to initialize object
+            # Use options to initialize object
             self = pairoptions(*args).AssignObjectFields(self)
 
-            #Cast to logicals
+            # Cast to logicals
             listproperties = vars(self)
             for fieldname, fieldvalue in list(listproperties.items()):
Index: /issm/trunk/src/m/consistency/checkfield.py
===================================================================
--- /issm/trunk/src/m/consistency/checkfield.py	(revision 26743)
+++ /issm/trunk/src/m/consistency/checkfield.py	(revision 26744)
@@ -11,14 +11,13 @@
 
     Used to check model consistency
-        
     Requires:
-        'field' or 'fieldname' option. If 'fieldname' is provided, it will 
+        'field' or 'fieldname' option. If 'fieldname' is provided, it will
         retrieve it from the model md. (md.(fieldname))
-        If 'field' is provided, it will assume the argument following 'field' 
+        If 'field' is provided, it will assume the argument following 'field'
         is a numeric array.
 
     Available options:
         - NaN: 1 if check that there is no NaN
-        - size: [lines cols], NaN for non checked dimensions, or 'universal' 
+        - size: [lines cols], NaN for non checked dimensions, or 'universal'
         for any input type (nodal, element, time series, etc)
         - > :  greater than provided value
@@ -72,6 +71,5 @@
         fieldsize = options.getfieldvalue('size')
         if type(fieldsize) == str:
-            if m.strcmp(fieldsize, 'universal'):
-
+            if fieldsize == 'universal':
                 #Check that vector size will not be confusing for ModelProcessorx
                 if (md.mesh.numberofvertices == md.mesh.numberofelements):
Index: /issm/trunk/src/m/consistency/ismodelselfconsistent.m
===================================================================
--- /issm/trunk/src/m/consistency/ismodelselfconsistent.m	(revision 26743)
+++ /issm/trunk/src/m/consistency/ismodelselfconsistent.m	(revision 26744)
@@ -3,5 +3,5 @@
 %
 %   Usage:
-%      ismodelselfconsistent(md),
+%      ismodelselfconsistent(md);
 
 %initialize consistency as true
@@ -52,4 +52,6 @@
 	elseif strcmp(solutiontype,'MasstransportSolution')
 		analyses={'MasstransportAnalysis'};
+	elseif strcmp(solutiontype,'OceantransportSolution')
+		analyses={'OceantransportAnalysis'};
 	elseif strcmp(solutiontype,'BalancethicknessSolution')
 		analyses={'BalancethicknessAnalysis'};
@@ -71,11 +73,13 @@
 		analyses={'EsaAnalysis'};
 	elseif strcmp(solutiontype,'TransientSolution')
-		analyses={'StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis','HydrologyShaktiAnalysis','HydrologyGladsAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis','SealevelriseAnalysis'};
-	elseif strcmp(solutiontype,'SealevelriseSolution')
-		analyses={'SealevelriseAnalysis'};
+		analyses={'StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis','OceantransportAnalysis','HydrologyShaktiAnalysis','HydrologyGladsAnalysis','HydrologyShreveAnalysis','HydrologyTwsAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis','SealevelchangeAnalysis'};
+	elseif strcmp(solutiontype,'SealevelchangeSolution')
+		analyses={'SealevelchangeAnalysis'};
 	elseif strcmp(solutiontype,'HydrologySolution')
-		analyses={'L2ProjectionBaseAnalysis','HydrologyShreveAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis'};
+		analyses={'L2ProjectionBaseAnalysis','HydrologyShreveAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis','HydrologyGladsAnalysis','HydrologyShaktiAnalysis','HydrologyTwsAnalysis'};
 	elseif strcmp(solutiontype,'DamageEvolutionSolution')
 		analyses={'DamageEvolutionAnalysis'};
+    elseif strcmp(solutiontype,'SamplingSolution')
+		analyses={'SamplingAnalysis'};    
 	else
 		error(' solution type: %s' , solutiontype, ' not supported yet!');
Index: /issm/trunk/src/m/consistency/ismodelselfconsistent.py
===================================================================
--- /issm/trunk/src/m/consistency/ismodelselfconsistent.py	(revision 26743)
+++ /issm/trunk/src/m/consistency/ismodelselfconsistent.py	(revision 26744)
@@ -1,11 +1,10 @@
 def ismodelselfconsistent(md):  #{{{
-    '''
-    ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+    """ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
 
-       Usage:
-          ismodelselfconsistent(md),
-    '''
+    Usage:
+        ismodelselfconsistent(md)
+    """
 
-    #initialize consistency as true
+    # Initialize consistency as true
     md.private.isconsistent = True
 
@@ -13,35 +12,34 @@
     # exit()
 
-    #Get solution and associated analyses
+    # Get solution and associated analyses
     solution = md.private.solution
     analyses = AnalysisConfiguration(solution)
-    #Go through a model fields, check that it is a class, and call checkconsistency
+    # Go through a model fields, check that it is a class, and call checkconsistency
     #fields = vars(md)
     #for field in fields.iterkeys():
     for field in md.properties():
-        #Some properties do not need to be checked
+        # Some properties do not need to be checked
         if field in ['results', 'debug', 'radaroverlay']:
             continue
 
-        #Check that current field is an object
+        # Check that current field is an object
         if not hasattr(getattr(md, field), 'checkconsistency'):
             md.checkmessage('field {} is not an object.'.format(field))
 
-        #Check consistency of the object
-        exec("md.{}.checkconsistency(md, '{}', {})".format(field, solution, analyses))
+        # Check consistency of the object
+        exec('md.{}.checkconsistency(md, \'{}\', {})'.format(field, solution, analyses))
 
-    #error message if mode is not consistent
+    # Error message if mode is not consistent
     if not md.private.isconsistent:
         raise RuntimeError('Model not consistent, see messages above.')
-#}}}
+# }}}
 
 
 def AnalysisConfiguration(solutiontype):  #{{{
-    '''
-    ANALYSISCONFIGURATION - return type of analyses, number of analyses
+    """ANALYSISCONFIGURATION - return type of analyses, number of analyses
 
-        Usage:
-                [analyses] = AnalysisConfiguration(solutiontype)
-    '''
+    Usage:
+        [analyses] = AnalysisConfiguration(solutiontype)
+    """
 
     if solutiontype == 'StressbalanceSolution':
@@ -53,4 +51,6 @@
     elif solutiontype == 'MasstransportSolution':
         analyses = ['MasstransportAnalysis']
+    elif solutiontype == 'OceantransportSolution':
+        analyses = ['OceantransportAnalysis']
     elif solutiontype == 'BalancethicknessSolution':
         analyses = ['BalancethicknessAnalysis']
@@ -72,14 +72,16 @@
         analyses = ['EsaAnalysis']
     elif solutiontype == 'TransientSolution':
-        analyses = ['StressbalanceAnalysis', 'StressbalanceVerticalAnalysis', 'StressbalanceSIAAnalysis', 'L2ProjectionBaseAnalysis', 'ThermalAnalysis', 'MeltingAnalysis', 'EnthalpyAnalysis', 'MasstransportAnalysis', 'HydrologyShaktiAnalysis', 'HydrologyGladsAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis', 'SealevelriseAnalysis']
-    elif solutiontype == 'SealevelriseSolution':
-        analyses = ['SealevelriseAnalysis']
+        analyses = ['StressbalanceAnalysis', 'StressbalanceVerticalAnalysis', 'StressbalanceSIAAnalysis', 'L2ProjectionBaseAnalysis', 'ThermalAnalysis', 'MeltingAnalysis', 'EnthalpyAnalysis', 'MasstransportAnalysis', 'OceantransportAnalysis', 'HydrologyShaktiAnalysis', 'HydrologyGladsAnalysis', 'HydrologyShreveAnalysis', 'HydrologyTwsAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis', 'SealevelchangeAnalysis']
+    elif solutiontype == 'SealevelchangeSolution':
+        analyses = ['SealevelchangeAnalysis']
     elif solutiontype == 'HydrologySolution':
-        analyses = ['L2ProjectionBaseAnalysis', 'HydrologyShreveAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis']
+        analyses = ['L2ProjectionBaseAnalysis', 'HydrologyShreveAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis', 'HydrologyGladsAnalysis', 'HydrologyShaktiAnalysis', 'HydrologyTwsAnalysis']
     elif 'DamageEvolutionSolution':
         analyses = ['DamageEvolutionAnalysis']
+    elif 'SamplingSolution':
+        analyses = ['SamplingAnalysis']
     else:
         raise TypeError('solution type: {} not supported yet!'.format(solutiontype))
 
     return analyses
-#}}}
+# }}}
Index: /issm/trunk/src/m/contrib/adhikari/wahr.m
===================================================================
--- /issm/trunk/src/m/contrib/adhikari/wahr.m	(revision 26744)
+++ /issm/trunk/src/m/contrib/adhikari/wahr.m	(revision 26744)
@@ -0,0 +1,58 @@
+function [vert, horz] = wahr(disc_rad,xi,love_h,love_l); 
+% a function to compute vertical and horizontal crustal motion... 
+% ...for a disc load, inspired by Figure 1 of Wahr et al., 2013. 
+% 
+% usage: 
+%		[vert, horz] = wahr(disc_rad,xi,love_h,love_l); 
+%		
+%		vert = vertical crustal motion [m] 
+%		horz = horizontal crustal motion [m] 
+%		disc_rad = disc radius [m] => set to 20 km to replicate the Wahr experiment. 
+%		xi = grid points along the distance away from the disc center [m] 
+%		love_h = load Love numbers h for the vertical crustal motion. 
+%		love_l = load Love numbers l for the horizontal crustal motion. 
+%		
+
+	disc_rad = disc_rad/1000; % km 
+	% compute P(x), dP(x)/dx, d2P(x)/dx2
+	%---------------------------------------------------------------------
+	% compute p_value 
+	theta=km2deg(xi/1000)';
+	ang = theta/180*pi; 
+	alpha=cos(ang);
+	m=length(alpha);
+	n=length(love_h)-1; 
+	p_value = p_polynomial_value(m,n,alpha);
+	p_prime = p_polynomial_prime(m,n,alpha);
+	%---------------------------------------------------------------------
+	nn=[0:n];
+	nn_plus_1=nn+1; 
+
+	% disc radius in degree 
+	disc_rad = km2deg(disc_rad)/180*pi; 
+	tau=zeros(size(love_h)); 
+	tau(1) = 0.5*(1-cos(disc_rad)); % tau_0 
+	p_value_disc = p_polynomial_value(1,n+1,cos(disc_rad));
+	p_prime_disc = p_polynomial_prime(1,n,cos(disc_rad));
+	for jj=2:n+1
+		nnn = jj-1; 
+		tau(jj) = 0.5 * (p_value_disc(jj-1) - p_value_disc(jj+1)); 
+	end
+
+	const=zeros(size(love_h)); 
+	for jj=1:n+1
+		const(jj) = 1/(2*(jj-1)+1); 
+	end
+
+	disc=sum(bsxfun(@times,p_value,tau'),2); 
+
+	g1 = -sum(bsxfun(@times,p_value,(tau.*love_h.*const)'),2); 
+	g5 = -sum(bsxfun(@times,-sin(ang),bsxfun(@times,p_prime,(tau.*love_l.*const)')),2); 
+
+	% coeff 
+	coeff = 1000*4*pi*(6.67408*10^-11)*(6.3781*10^6)/9.81; 
+
+	% vertical and horizontal solutions
+	vert = g1*coeff; % m 
+	horz = g5*coeff; % m 
+
Index: /issm/trunk/src/m/contrib/chenggong/interpFromMEaSUREsGeotiff.m
===================================================================
--- /issm/trunk/src/m/contrib/chenggong/interpFromMEaSUREsGeotiff.m	(revision 26744)
+++ /issm/trunk/src/m/contrib/chenggong/interpFromMEaSUREsGeotiff.m	(revision 26744)
@@ -0,0 +1,40 @@
+% This function calls src/m/contrib/morlighem/modeldata/interpFromGeotiff.m for multiple times to load all avaliable 
+% tif data in  /totten_1/ModelData/Greenland/VelMEaSUREs/Jakobshavn_2008_2021/ within the given time period (in decimal years)
+% For some reason, each .tif file in this folder contains two sets of data, only the first dataset is useful
+
+function dataout = interpFromMEaSUREsGeotiff(X,Y,Tstart,Tend)
+
+foldername = '/totten_1/ModelData/Greenland/VelMEaSUREs/Jakobshavn_2008_2021/';
+
+% get the time info from file names
+templist = dir([foldername,'*.meta']);
+Ndata = length(templist);
+dataTstart = zeros(Ndata,1);
+dataTend = zeros(Ndata,1);
+
+for i = 1:Ndata
+	tempConv = split(templist(i).name, '_');
+	% follow the naming convention
+	dataPrefix(i) = join(tempConv(1:5), '_');
+	dataTstart(i) = date2decyear(datenum(tempConv{3}));
+	dataTend(i) = date2decyear(datenum(tempConv{4}));
+end
+disp(['  Found ', num2str(Ndata), ' records in ', foldername]);
+disp(['    from ', datestr(decyear2date(min(dataTstart)),'yyyy-mm-dd'), ' to ', datestr(decyear2date(max(dataTend)),'yyyy-mm-dd') ]);
+
+
+% find all the data files with Tstart<=t<=Tend
+dataInd = (dataTend>=Tstart) & (dataTstart<=Tend);
+disp([' For the selected period: ', datestr(decyear2date((Tstart)),'yyyy-mm-dd'), ' to ', datestr(decyear2date((Tend)),'yyyy-mm-dd'), ', there are ', num2str(sum(dataInd)), ' records' ]);
+
+dataToLoad = dataPrefix(dataInd);
+TstartToload = dataTstart(dataInd);
+TendToload = dataTend(dataInd);
+
+for i = 1:length(dataToLoad)
+	dataout(i).vx = interpFromGeotiff([foldername, dataToLoad{i}, '_vx_v04.0.tif'], X, Y, 2e9);
+	dataout(i).vy = interpFromGeotiff([foldername, dataToLoad{i}, '_vy_v04.0.tif'], X, Y, 2e9);
+	dataout(i).vel = interpFromGeotiff([foldername, dataToLoad{i}, '_vv_v04.0.tif'], X, Y, -1);
+	dataout(i).Tstart = TstartToload(i);
+	dataout(i).Tend = TendToload(i);
+end
Index: /issm/trunk/src/m/contrib/defleurian/netCDF/export_netCDF.py
===================================================================
--- /issm/trunk/src/m/contrib/defleurian/netCDF/export_netCDF.py	(revision 26743)
+++ /issm/trunk/src/m/contrib/defleurian/netCDF/export_netCDF.py	(revision 26744)
@@ -3,23 +3,55 @@
 import time
 import collections
-from inspect import isclass, getmodule
+from inspect import isclass
 from os import path, remove
 
 
 class ResTable:
-
     def __init__(self):
         self.data = []
-
-    def update(self, row):
-        if len(np.shape(row)) == 0:
-            self.data.append(row)
-        else:
-            for r in row:
+        self.sizes = []
+
+    def update(self, stepvar):
+        #if we have a scalar we just add it to the en
+        #we save the size of the current step for further treatment
+        if len(np.shape(stepvar)) == 0:
+            self.sizes.append(1)
+            self.data.append(stepvar)
+        # if it is an array we add the values one by one
+        #we save the size of the current step for further treatment
+        else:
+            self.sizes.append(len(stepvar))
+            for r in stepvar:
                 self.data.append(r)
 
     def finalize(self, rows):
+        #we have more scalars than steps, so we have an array
         if len(self.data) > rows:
-            return np.reshape(self.data, newshape=(rows, int(len(self.data) / rows)))
+            #first check if all steps are the same size
+            SameSize = np.sum(np.asarray(self.sizes) - self.sizes[0]) == 0
+            if SameSize:
+                #same size for all steps, just reshape
+                return np.reshape(self.data, newshape=(rows, int(len(self.data) / rows)))
+            else:
+                #different sizes at each steps, first create a table big enough for the biggest step
+                startpoint = 0
+                datadim = len(np.shape(self.data))
+                if datadim == 1:
+                    outdat = np.nan * np.ones((rows, np.nanmax(self.sizes)))
+                    for step in range(rows):
+                        curlen = self.sizes[step]
+                        outdat[step, :curlen] = self.data[startpoint: startpoint + curlen]
+                        startpoint += curlen
+                elif datadim == 2:
+                    outdat = np.nan * np.ones((rows, np.nanmax(self.sizes), np.shape(self.data)[1]))
+                    for step in range(rows):
+                        curlen = self.sizes[step]
+                        outdat[step, :curlen, :] = self.data[startpoint: startpoint + curlen]
+                        startpoint += curlen
+
+                else:
+                    print("ERROR, reult treatment cant cope with dimensions above 2")
+                return outdat
+        #as much scalars as stpes (or less) so just one value per step
         else:
             return np.asarray(self.data)
@@ -47,4 +79,6 @@
     except AttributeError:  #no transient so just one timestep
         StepNum = 1
+    except TypeError:  #this isnot a result so no results in there
+        StepNum = 0
     TimeDim = NCData.createDimension('Time', StepNum)  # time is first
     DimDict = {len(TimeDim): 'Time'}
@@ -64,5 +98,5 @@
             DimDict[len(NewDim)] = dimnames[i]
 
-    typelist = [bool, str, str, int, float, complex,
+    typelist = [bool, str, int, float, complex,
                 collections.OrderedDict,
                 np.int64, np.ndarray, np.float64]
@@ -80,5 +114,9 @@
         NCgroup = NCData.createGroup(str(group))
         # In each group gather the fields of the class
-        fields = dict.keys(md.__dict__[group].__dict__)
+        try:
+            fields = dict.keys(md.__dict__[group].__dict__)
+        except AttributeError:
+            print("WARNING: md.{} as no fields, we skip it.".format(group))
+            continue
         # looping on fields in each group
         for field in fields:
@@ -119,4 +157,5 @@
                             if subfield not in['errlog', 'outlog']:
                                 StackedVar = ResTable()
+                                #first loop over the field (result type) to find the index of the last subfield (variable)
                                 for listindex in range(0, Listsize):
                                     try:
@@ -129,4 +168,5 @@
                                         lastindex = listindex
                                         continue
+                                    #Add the  subfield at the current step
                                     Var = SqueezeVar(Var)
                                     StackedVar.update(Var)
@@ -220,4 +260,16 @@
                             if ncvar is not None:
                                 FillVar(ncvar, StackedVar)
+                elif type(md.__dict__[group].__dict__[field]).__name__ == 'dict':
+                    # designed for a dict in dummy but might be used elsewhere
+                    # there is no subgroup
+                    klass = type(md.__dict__[group]).__module__ + '.' + type(md.__dict__[group]).__name__
+                    NCgroup.__setattr__('classtype', klass)
+                    Var = md.__dict__[group].__dict__[field]
+                    Var = SqueezeVar(Var)
+                    if verbose > 4:
+                        print("=WW=creating var for {}.{}".format(group, field))
+                    DimDict, ncvar = CreateVar(NCData, Var, field, NCgroup, DimDict)
+                    if ncvar is not None:
+                        FillVar(ncvar, Var)
                 else:
                     klass = type(md.__dict__[group]).__module__ + '.' + type(md.__dict__[group]).__name__
@@ -258,5 +310,5 @@
     # grab dimension
     if val_type in [collections.OrderedDict, dict]:
-        val_shape = len(var)
+        val_shape = len(var.keys())
         val_dim = 2
     else:
@@ -304,5 +356,5 @@
             ncvar = Group.createVariable(str(field), nctype, dimensions=dimensions, zlib=True)
     # treating bool tables and dict as string tables
-    elif val_type in ['bool', collections.OrderedDict, dict]:
+    elif val_type in [collections.OrderedDict, dict, 'bool']:
         if val_shape in [(), (0,), 0]:
             ncvar = Group.createVariable(str(field), str, zlib=True)
@@ -310,5 +362,5 @@
             dimensions, DimDict = GetDim(NCData, val_shape, val_type, DimDict, val_dim)
             ncvar = Group.createVariable(str(field), str, dimensions=dimensions, zlib=True)
-        # Now dealing with numeric variables
+    # Now dealing with numeric variables
     elif val_type in [float, 'float64', np.float64, int, 'int64']:
         if val_shape in [(), (0,), 0] and not SupDim:
Index: /issm/trunk/src/m/contrib/defleurian/paraview/exportVTK.py
===================================================================
--- /issm/trunk/src/m/contrib/defleurian/paraview/exportVTK.py	(revision 26743)
+++ /issm/trunk/src/m/contrib/defleurian/paraview/exportVTK.py	(revision 26744)
@@ -67,9 +67,12 @@
         for solution in solnames:
             #looking for multiple time steps
-            if (np.size(res_struct.__dict__[solution]) > num_of_timesteps):
-                num_of_timesteps = np.size(res_struct.__dict__[solution])
-                num_of_timesteps = int(num_of_timesteps)
-                if 'Surface' in dict.keys(res_struct.__dict__[solution][0].__dict__):
-                    moving_mesh = True
+            try:
+                if len(res_struct.__dict__[solution]) > num_of_timesteps:
+                    num_of_timesteps = len(res_struct.__dict__[solution])
+                    num_of_timesteps = int(num_of_timesteps)
+                    if 'Surface' in dict.keys(res_struct.__dict__[solution][0].__dict__):
+                        moving_mesh = True
+            except TypeError:
+                continue
     else:
         num_of_timesteps = 1
@@ -92,4 +95,5 @@
         raise BadDimension('exportVTK does not support your element type')
 
+    #only keep the envelope and not the bulk of the results.
     if enveloppe:
         if dim == 3:
@@ -252,28 +256,42 @@
             for sol in solnames:
                 treated_res = []
-    #dealing with results on different timesteps
-                if(np.size(res_struct.__dict__[sol]) > timestep):
-                    timestep = step
-                else:
-                    timestep = np.size(res_struct.__dict__[sol])
-
-    #getting the  fields in the solution
-                if(type(res_struct.__dict__[sol]) == list):
+                #dealing with results on different timesteps
+                try:
+                    if(len(res_struct.__dict__[sol]) > timestep):
+                        timestep = step
+                    else:
+                        timestep = np.size(res_struct.__dict__[sol])
+                except TypeError:
+                    #result as no len() so no timesteps
+                    timestep = 1
+
+                #getting the  fields in the solution
+                if(type(res_struct.__dict__[sol]).__name__ == 'solution'):
                     spe_res_struct = res_struct.__dict__[sol].__getitem__(timestep)
                     fieldnames = dict.keys(spe_res_struct.__dict__)
-                else:
+                elif(type(res_struct.__dict__[sol]).__name__ == 'solutionstep'):
                     spe_res_struct = res_struct.__dict__[sol]
                     fieldnames = dict.keys(spe_res_struct.__dict__)
-
-    #Sorting scalars, vectors and tensors
+                elif(type(res_struct.__dict__[sol]).__name__ == 'results'):  #this is a result without steps
+                    spe_res_struct = res_struct.__dict__[sol]
+                    fieldnames = dict.keys(spe_res_struct.__dict__)
+                else:
+                    print("WARNING, solution type '{}' is not recognise, exported results might be wrong".format(type(res_struct.__dict__[sol])))
+                    spe_res_struct = res_struct.__dict__[sol]
+                    fieldnames = dict.keys(spe_res_struct.__dict__)
+
+                #Sorting scalars, vectors and tensors
                 tensors = [field for field in fieldnames if field[-2:] in ['xx', 'yy', 'xy', 'zz', 'xz', 'yz']]
                 non_tensor = [field for field in fieldnames if field not in tensors]
                 vectors = [field for field in non_tensor if field[-1] in ['x', 'y', 'z'] and field[-4:] not in ['Flux']]
 
-    #check which field is a real result and print
+                #check which field is a real result and print
                 for field in fieldnames:
+                    print("Treating {}".format(field))
                     if field in treated_res:
+                        print("{} is already done".format(field))
                         continue
                     elif field in vectors:
+                        print("{} is a vector".format(field))
                         try:
                             Vxstruct = np.squeeze(spe_res_struct.__dict__[field[:-1] + 'x'])
@@ -299,4 +317,5 @@
 
                     elif field in tensors:
+                        print("{} is a tensor".format(field))
                         try:
                             Txxstruct = np.squeeze(spe_res_struct.__dict__[field[:-2] + 'xx'])
@@ -346,5 +365,4 @@
                         else:
                             print("format for field {}.{} is not suported, field is skipped".format(sol, field))
-                            continue
     # }}}
     # loop on arguments, if something other than result is asked, do it now {{{
Index: /issm/trunk/src/m/contrib/dlcheng/zoneaverage.m
===================================================================
--- /issm/trunk/src/m/contrib/dlcheng/zoneaverage.m	(revision 26744)
+++ /issm/trunk/src/m/contrib/dlcheng/zoneaverage.m	(revision 26744)
@@ -0,0 +1,79 @@
+function avg=zoneaverage(md,field,parameter,width,distweight,areaweight,iter)
+%ZONEAVERAGE - averages the field over the elements within the distance specified by parameter .* width. 
+%               Average is weighted by the element area using model's triangulation.
+%               Width determines distance multiplier of parameter when calculating a node's distance for inclusion in an average.
+%               Distweight and Areaweight control how the node distance and area affect the weighted average.
+%               Iteration is the number of iterations to run the zone averaging.
+%
+%   Usage:
+%      avg=zone_average(md,field,parameter,width,distweight,areaweight)
+
+%TODO: HANDLE NARGINS/PAIROPTION STYLE ARGS FOR WIDTH, DISTWEIGHT, AREAWEIGHT, ITER
+
+if (dimension(md.mesh)==2),
+	numberofelements=md.mesh.numberofelements;
+	numberofnodes=md.mesh.numberofvertices;
+	index=md.mesh.elements;
+	x=md.mesh.x; y=md.mesh.y;
+else
+	numberofelements=md.mesh.numberofelements2d;
+	numberofnodes=md.mesh.numberofvertices2d;
+	index=md.mesh.elements2d;
+	x=md.mesh.x2d; y=md.mesh.y2d;
+end
+
+%node
+if numel(field)==numberofnodes,
+    areas=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
+
+    %calculate distances between nodes and reshape into addressable matrix
+    nodes=[md.mesh.x, md.mesh.y];
+    dist=pdist([nodes;nodes]);
+    dist=squareform(dist);
+    dist=dist(1:numberofnodes,numberofnodes+1:end);
+
+    %calculate max distance to average each vertex using parameter * width and mask distances
+    maxdist = parameter * width;
+    flags=dist<=maxdist;
+    
+    %calculate average area per node
+    nodeareas=zeros(numberofnodes,1);
+    elementspernode=zeros(numberofnodes,1);
+    for i=1:numberofelements,
+        for j=1:3,
+            node=index(i,j);
+            nodeareas(node)=nodeareas(node)+areas(i);
+            elementspernode(node)=elementspernode(node)+1;
+        end
+    end
+    nodeareas=nodeareas./elementspernode;
+    
+    %get distance/area weighted average of field within specified parameter width
+    avg=zeros(numberofnodes,1);
+    totalweight=distweight+areaweight;
+    distweight=distweight/totalweight;
+    areaweight=areaweight/totalweight;
+    for iter=1:iter,
+%     for iter=1:1,
+        for i=1:numberofnodes,
+            %distance weighting
+            distsum = sum(dist(i,flags(i,:))) + eps;
+            distmax = max(dist(i,flags(i,:)));
+            distweights = ones(sum(flags(i,:)),1);
+            distweights = distweights + 1 - distweight*(dist(i,(flags(i,:)))'/distsum); %inverse linear distance weight
+            distweights = distweights / sum(distweights);
+
+            %area weighting
+            areasum = sum(nodeareas(flags(i,:))) + eps;
+            areaweights = areaweight*nodeareas(flags(i,:))/areasum;
+            weights=distweights+areaweights;
+            avg(i)=nansum(weights.*field(flags(i,:)));
+            %avg(i)=nanmean(field(flags(i,:)),1);
+
+    %         areasum = sum(nodeareas(flags));
+    %         weights = nodeareas(flags)/areasum;
+    %         avg=nanmean(weights.*field(flags),2);
+        end
+        field=avg;
+    end
+end
Index: /issm/trunk/src/m/contrib/morlighem/ad/rescalegradient.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/ad/rescalegradient.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/ad/rescalegradient.m	(revision 26744)
@@ -14,7 +14,7 @@
 	disp('Constructing mass matrix...');
 	tic
-	row   = zeros(10*md.mesh.numberofvertices);
-	col   = zeros(10*md.mesh.numberofvertices);
-	value = zeros(10*md.mesh.numberofvertices);
+	row   = zeros(10*md.mesh.numberofvertices,1);
+	col   = zeros(10*md.mesh.numberofvertices,1);
+	value = zeros(10*md.mesh.numberofvertices,1);
 
 	%Construct mass matrix using MATLAB's sparse function
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/InterpFromGrid.cpp
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/InterpFromGrid.cpp	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/InterpFromGrid.cpp	(revision 26744)
@@ -243,5 +243,5 @@
 
 				if(n0<0 || n3>=dataN || m0<0 || m3>=dataM){
-					interp[idx] = -9999;
+					interp[idx] = -9999.;
 					continue;
 				}
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 26744)
@@ -1,57 +1,64 @@
-function output = interpBedmachineAntarctica(X,Y,string,method,ncdate),
+function output = interpBedmachineAntarctica(X,Y,string,method,ncdate)
+%INTERPBEDMACHINEANTARCTICA - interpolate BedMachine data onto X and Y
+%
+%   Examples:
+%      bed       = interpBedmachineAntarctica(X,Y,'bed');
+%      surface   = interpBedmachineAntarctica(X,Y,'surface');
+%      thickness = interpBedmachineAntarctica(X,Y,'thickness');
+%      mask      = interpBedmachineAntarctica(X,Y,'mask');
+%      mask      = interpBedmachineAntarctica(X,Y,'mask','nearest','../Data/BedMachineAntarctica_2020-07-15_v02.nc');
+%
+%   - mask:   0 ocean, 1 land (ice free), 2 grounded ice, 3 floating ice
+%   - source: 1 IBCSO/RTopo-2, 2 MC, 3 interpolation, 4 hydrostatic eq, 
+%             5 Streamline diffusion, 6 Gravity inversion
+%   - optional 4th input argument: interpolation method.
+%             Supported interpolation methos: 'linear','cubic','nearest'
+%   - optional 5th input argument: path to dataset.
+%
+% Version 11/30/2018 Mathieu Morlighem mmorligh@uci.edu
 
 if nargin<3, string = 'bed'; end
 if nargin<4
 	if strcmp(string,'mask') | strcmp(string,'source')
-      method='nearest'; % default method
-   else
-      method='cubic'; % default method
-   end
+		method='nearest'; % default method
+	else
+		method='cubic'; % default method
+	end
 end
 if nargin<5
-	%ncdate='2014-03-12';
-	%ncdate='2014-04-28';
-	%ncdate='2014-07-31';
-	%ncdate='2014-09-23';
-	%ncdate='2015-11-06';
-	%ncdate='2015-12-09';
-	ncdate='2016-06-10';
-	ncdate='2016-08-26';
-	ncdate='2016-11-17';
-	ncdate='2017-01-05';
-	ncdate='2017-03-10';
-	ncdate='2018-02-02';
-	ncdate='2018-03-20';
-	ncdate='2018-05-18';
-	ncdate='2018-06-08';
-	ncdate='2018-09-26';
-	ncdate='2018-11-14';
-	ncdate='2019-01-30';
-	ncdate='2019-03-12';
-	ncdate='2019-04-02';
-	ncdate='2019-04-15'; % no need of firn correction
-	ncdate='2020-06-18';
-	ncdate='2020-07-15'; %BedMachine v2?
+	ncdate='2020-07-15'; %BedMachine v2
+	ncdate='2021-11-16'; %BedMachine v2
 end
-
 basename = 'BedMachineAntarctica';
 
-%read data
-switch (oshostname()),
-	case {'ronne'}
-		nc=['/home/ModelData/Antarctica/BedMachine/' basename '-' ncdate '.nc'];
-	case {'thwaites','murdo','astrid'}
-		nc=['/u/astrid-r1b/ModelData/BedMachine/' basename '-' ncdate '.nc'];
-	otherwise
-		error('hostname not supported yet');
-end
+if nargin==5
+	ncfile = ncdate;
+else
+	%List of common paths to try
+	paths = {...
+		['/u/astrid-r1b/ModelData/BedMachine/' basename '-' ncdate '.nc'],...
+		['/home/ModelData/Antarctica/BedMachine/' basename '-' ncdate '.nc'],...
+		['/totten_1/ModelData/Antarctica/BedMachine/' basename '-' ncdate '.nc'],...
+		['/Users/larour/ModelData/BedMachine/' basename '-' ncdate '.nc'],...
+		['./' basename '-' ncdate '.nc'],...
+		};
 
-if nargout==2,
-	string = 'bed';
+	found = 0;
+	for i=1:numel(paths)
+		if exist(paths{i},'file')
+			ncfile = paths{i};
+			found = 1;
+			break;
+		end
+	end
+
+	if ~found
+		error(['Could not find ' basename '-' ncdate '.nc, you can add the path to the list or provide its path as a 5th argument']);
+	end
 end
 
 disp(['   -- BedMachine Antarctica version: ' ncdate]);
-xdata = double(ncread(nc,'x'));
-ydata = double(ncread(nc,'y'));
+xdata = double(ncread(ncfile,'x'));
+ydata = double(ncread(ncfile,'y'));
 
 offset=2;
@@ -59,4 +66,5 @@
 xmin=min(X(:)); xmax=max(X(:));
 posx=find(xdata<=xmax);
+if isempty(posx), posx=numel(xdata); end
 id1x=max(1,find(xdata>=xmin,1)-offset);
 id2x=min(numel(xdata),posx(end)+offset);
@@ -64,4 +72,5 @@
 ymin=min(Y(:)); ymax=max(Y(:));
 posy=find(ydata>=ymin);
+if isempty(posy), posy=numel(ydata); end
 id1y=max(1,find(ydata<=ymax,1)-offset);
 id2y=min(numel(ydata),posy(end)+offset);
@@ -69,6 +78,6 @@
 if strcmp(string,'icemask'),
 	disp(['   -- BedMachine Antarctica: loading ' string]);
-	%data  = double(ncread(nc,'mask'))';
-	data  = double(ncread(nc,'mask',[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
+	%data  = double(ncread(ncfile,'mask'))';
+	data  = double(ncread(ncfile,'mask',[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
 	xdata=xdata(id1x:id2x);
 	ydata=ydata(id1y:id2y);
@@ -77,6 +86,6 @@
 else
 	disp(['   -- BedMachine Antarctica: loading ' string]);
-	%data  = double(ncread(nc,string))';
-	data  = double(ncread(nc,string,[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
+	%data  = double(ncread(ncfile,string))';
+	data  = double(ncread(ncfile,string,[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
 	xdata=xdata(id1x:id2x);
 	ydata=ydata(id1y:id2y);
@@ -87,7 +96,5 @@
 if strcmp(string,'mask') | strcmp(string,'source'),
 	%Need nearest neighbor to avoid interpolation between 0 and 2
-	tic
 	output = InterpFromGrid(xdata,ydata,data,double(X),double(Y),'nearest');
-	toc
 	%tic
 	%output = FastInterp(xdata,ydata,data,X,Y,'nearest');
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m	(revision 26744)
@@ -1,34 +1,61 @@
-function output = interpBedmachineGreenland(X,Y,string,ncdate),
+function output = interpBedmachineGreenland(X,Y,string,method,ncdate)
+%INTERPBEDMACHINEGREENLAND - interpolate BedMachine data onto X and Y
+%
+%   Examples:
+%      bed       = interpBedmachineGreenland(X,Y,'bed');
+%      surface   = interpBedmachineGreenland(X,Y,'surface');
+%      thickness = interpBedmachineGreenland(X,Y,'thickness');
+%      mask      = interpBedmachineGreenland(X,Y,'mask');
+%      mask      = interpBedmachineGreenland(X,Y,'mask','nearest','../Data/BedMachineGreenland_2020-07-15_v03.nc');
+%
+%   - mask:   0 ocean, 1 land (ice free), 2 grounded ice, 3 floating ice
+%   - source: 1 IBCSO/RTopo-2, 2 MC, 3 interpolation, 4 hydrostatic eq, 
+%             5 Streamline diffusion, 6 Gravity inversion
+%   - optional 4th input argument: interpolation method.
+%             Supported interpolation methos: 'linear','cubic','nearest'
+%   - optional 5th input argument: path to dataset.
+%
+% Version 11/30/2018 Mathieu Morlighem mmorligh@uci.edu
 
 if nargin<3, string = 'bed'; end
-if nargin<4,
+if nargin<4
+	if strcmp(string,'mask') | strcmp(string,'source')
+		method='nearest'; % default method
+	else
+		method='cubic'; % default method
+	end
+end
+if nargin<5
 	%ncdate='2015-04-27'; %BedMachine v2
 	ncdate='2017-09-25'; %BedMachine v3
 	ncdate='2020-04-14';
 end
-
 basename = 'BedMachineGreenland';
 
-%List of common paths to try
-paths = {...
-	['/u/astrid-r1b/ModelData/ModelData/MCdataset-' ncdate '.nc'],...
-	['/home/ModelData/Greenland/BedMachine/' basename '-' ncdate '.nc'],...
-	['/Users/larour/ModelData/BedMachine/' basename '-' ncdate '.nc'],...
-	['./' basename '-' ncdate '.nc'],...
-	};
+if nargin==5
+	ncfile = ncdate;
+else
+	%List of common paths to try
+	paths = {...
+		['/u/astrid-r1b/ModelData/ModelData/MCdataset-' ncdate '.nc'],...
+		['/home/ModelData/Greenland/BedMachine/' basename '-' ncdate '.nc'],...
+		['/totten_1/ModelData/Greenland/BedMachine/' basename '-' ncdate '.nc'],...
+		['/Users/larour/ModelData/BedMachine/' basename '-' ncdate '.nc'],...
+		['./' basename '-' ncdate '.nc'],...
+		};
 
-found = 0;
-for i=1:numel(paths)
-	if exist(paths{i},'file')
-		ncfile = paths{i};
-		found = 1;
-		break;
+	found = 0;
+	for i=1:numel(paths)
+		if exist(paths{i},'file')
+			ncfile = paths{i};
+			found = 1;
+			break;
+		end
+	end
+
+	if ~found
+		error(['Could not find ' basename '-' ncdate '.nc, you can add the path to the list or provide its path as a 5th argument']);
 	end
 end
-
-if ~found
-	error(['Could not find ' basename '-' ncdate '.nc, you can add the path to the list']);
-end
-
 
 disp(['   -- BedMachine Greenland version: ' ncdate]);
@@ -57,4 +84,5 @@
 
 disp(['   -- BedMachine Greenland: interpolating ' string]);
+disp(['       -- Interpolation method: ' method]);
 if strcmp(string,'mask') | strcmp(string,'source'),
 	%Need nearest neighbor to avoid interpolation between 0 and 2
@@ -64,3 +92,54 @@
 end
 
-%TEST https://www.mathworks.com/matlabcentral/fileexchange/10772-fast-2-dimensional-interpolation
+end
+function zi = FastInterp(x,y,data,xi,yi,method)
+
+	%get data size
+	[M N] = size(data);
+
+	% Get X and Y library array spacing
+	ndx = 1/(x(2)-x(1));    ndy = 1/(y(2)-y(1));
+	% Begin mapping xi and yi vectors onto index space by subtracting library
+	% array minima and scaling to index spacing
+
+	xi = (xi - x(1))*ndx;       yi = (yi - y(1))*ndy;
+
+	% Fill Zi with NaNs
+	zi = NaN(size(xi));
+
+	if strcmpi(method,'nearest'),
+		% Find the nearest point in index space
+		rxi = round(xi)+1;  ryi = round(yi)+1;
+		% Find points that are in X,Y range
+		flag = rxi>0 & rxi<=N & ~isnan(rxi) & ryi>0 & ryi<=M & ~isnan(ryi);
+		% Map subscripts to indices
+		ind = ryi + M*(rxi-1);
+		zi(flag) = data(ind(flag));
+
+	else %Bilinear
+
+		% Transform to unit square
+		fxi = floor(xi)+1;  fyi = floor(yi)+1; % x_i and y_i
+		dfxi = xi-fxi+1;    dfyi = yi-fyi+1;   % Location in unit square
+
+		% flagIn determines whether the requested location is inside of the data arrays
+		flagIn = fxi>0 & fxi<N & ~isnan(fxi) & fyi>0 & fyi<M & ~isnan(fyi);
+
+		%Toss all out-of-bounds variables now to save time
+		fxi  = fxi(flagIn);  fyi  = fyi(flagIn);
+		dfxi = dfxi(flagIn); dfyi = dfyi(flagIn);
+
+		%Find bounding vertices
+		ind1 = fyi + M*(fxi-1);     % indices of (  x_i  ,  y_i  )
+		ind2 = fyi + M*fxi;         % indices of ( x_i+1 ,  y_i  )
+		ind3 = fyi + 1 + M*fxi;     % indices of ( x_i+1 , y_i+1 )
+		ind4 = fyi + 1 + M*(fxi-1); % indices of (  x_i  , y_i+1 )
+
+		% Bilinear interpolation
+		zi(flagIn) = ...
+			data(ind1).*(1-dfxi).*(1-dfyi) + ...
+			data(ind2).*dfxi.*(1-dfyi) + ...
+			data(ind4).*(1-dfxi).*dfyi + ...
+			data(ind3).*dfxi.*dfyi;
+	end
+end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmap2.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmap2.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmap2.m	(revision 26744)
@@ -18,5 +18,12 @@
 %      [dataout] = interpBedmap2(X,Y,string)
 
-nc = '/home/ModelData/Antarctica/BedMap2/bedmap2_bin/Bedmap2.nc';
+switch (oshostname()),
+	case {'ronne'}
+		nc = '/home/ModelData/Antarctica/BedMap2/bedmap2_bin/Bedmap2.nc';
+	case {'totten'}
+		nc = '/totten_1/ModelData/Antarctica/BedMap2/bedmap2_bin/Bedmap2.nc';
+	otherwise
+		error('hostname not supported yet');
+end
 if exist(nc,'file')
 	if strcmp(string,'thickness_uncertainty_5km')
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpDTU19MDT.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpDTU19MDT.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpDTU19MDT.m	(revision 26744)
@@ -4,4 +4,6 @@
 	case {'ronne'}
 		rootname='/ronne_2/home/ModelData/Global/DTU19MDT/dtu19mdt.mat';
+	case {'totten'}
+		rootname='/totten_1/ModelData/Global/DTU19MDT/dtu19mdt.mat';
 	otherwise
 		error('machine not supported yet');
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpFromGeotiff.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpFromGeotiff.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpFromGeotiff.m	(revision 26744)
@@ -1,3 +1,7 @@
-function dataout = interpFromGeotiff(geotiffname,X,Y),
+function dataout = interpFromGeotiff(geotiffname,X,Y,nanValue),
+
+if nargin < 4
+	nanValue = 10^30;
+end
 
 usemap = 0;
@@ -21,10 +25,10 @@
 	%Get image info
 	Tinfo = imfinfo(geotiffname);
-	N     = Tinfo.Width;
-	M     = Tinfo.Height;
-	dx    = Tinfo.ModelPixelScaleTag(1);
-	dy    = Tinfo.ModelPixelScaleTag(2);
-	minx  = Tinfo.ModelTiepointTag(4);
-	maxy  = Tinfo.ModelTiepointTag(5);
+	N     = Tinfo(1).Width;
+	M     = Tinfo(1).Height;
+	dx    = Tinfo(1).ModelPixelScaleTag(1);
+	dy    = Tinfo(1).ModelPixelScaleTag(2);
+	minx  = Tinfo(1).ModelTiepointTag(4);
+	maxy  = Tinfo(1).ModelTiepointTag(5);
 
 	%Generate vectors
@@ -55,5 +59,9 @@
 		data=double(flipud(imread(geotiffname)));
 	end
-	data(find(abs(data)>10^30))=NaN;
+	if nanValue > 0
+		data(find(abs(data)>=nanValue))=NaN;
+	else 
+		data(find(data<=nanValue))=NaN;
+	end
 
 end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpGeoid.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpGeoid.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpGeoid.m	(revision 26744)
@@ -6,4 +6,6 @@
 	case {'ronne'}
 		rootname='/home/ModelData/Global/Geoid/eigen-6c4-1970.mat';
+	case {'totten'}
+		rootname='/totten_1/ModelData/Global/Geoid/eigen-6c4-1970.mat';
 	otherwise
 		error('machine not supported yet');
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpIBCSO.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpIBCSO.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpIBCSO.m	(revision 26744)
@@ -6,4 +6,7 @@
 		ncpath='/home/ModelData/Antarctica/IBCSO/ibcso_v1_bed.grd';
 		sidpath='/home/ModelData/Antarctica/IBCSO/ibcso_v1_sid.grd';
+	case {'totten'}
+		ncpath='/totten_1/ModelData/Antarctica/IBCSO/ibcso_v1_bed.grd';
+		sidpath='/totten_1/ModelData/Antarctica/IBCSO/ibcso_v1_sid.grd';
 	otherwise
 		error('hostname not supported yet');
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughinCompositeGreenland.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughinCompositeGreenland.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughinCompositeGreenland.m	(revision 26744)
@@ -2,5 +2,5 @@
 
 %data=load(['/u/astrid-r1b/morlighe/issmjpl/proj-morlighem/DatasetGreenland/Data/VelJoughin/IanGreenVel.mat']);
-filename = '/home/ModelData/Greenland/VelJoughin/IanGreenVel.mat';
+filename = '/totten_1/ModelData/Greenland/VelJoughin/IanGreenVel.mat';
 
 %Figure out what subset of the matrix should be read
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughinMosaic.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughinMosaic.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughinMosaic.m	(revision 26744)
@@ -4,4 +4,6 @@
 	case {'ronne'}
 		filename = '/home/ModelData/Greenland/VelJoughin/IanGreenVel.mat';
+	case {'totten'}
+		filename = '/totten_1/ModelData/Greenland/VelJoughin/IanGreenVel.mat';
 	otherwise
 		error('machine not supported yet');
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAnt2017.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAnt2017.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAnt2017.m	(revision 26744)
@@ -5,4 +5,6 @@
 	case {'ronne'}
 		nc = '/home/ModelData/Antarctica/MouginotVel/vel_nsidc.CF16_2.nc';
+	case {'totten'}
+		nc = '/totten_1/ModelData/Antarctica/MouginotVel/vel_nsidc.CF16_2.nc';
 	otherwise
 		error('hostname not supported yet');
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAntTimeSeries1973to2018.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAntTimeSeries1973to2018.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAntTimeSeries1973to2018.m	(revision 26744)
@@ -54,4 +54,6 @@
 	case {'ronne'}
 		nc = '/home/ModelData/Antarctica/MouginotVel/ASE_TimeSeries_1973-2018.nc';
+	case {'totten'}
+		nc = '/totten_1/ModelData/Antarctica/MouginotVel/ASE_TimeSeries_1973-2018.nc';
 	otherwise
 		error('hostname not supported yet');
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpRACMOant.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpRACMOant.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpRACMOant.m	(revision 26744)
@@ -1,5 +1,12 @@
 function smb = interpRACMOant(x,y);
 
-	smbfile = '/home/ModelData/Antarctica/RACMO2SMB/SMB_RACMO2.3_1979_2011.nc';
+switch oshostname(),
+	case {'ronne'}
+		smbfile = '/home/ModelData/Antarctica/RACMO2SMB/SMB_RACMO2.3_1979_2011.nc';
+	case {'totten'}
+		smbfile = '/totten_1/ModelData/Antarctica/RACMO2SMB/SMB_RACMO2.3_1979_2011.nc';
+	otherwise
+		error('machine not supported yet');
+end
 	LAT=ncread(smbfile,'lat2d')';
 	LON=ncread(smbfile,'lon2d')';
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpREMA.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpREMA.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpREMA.m	(revision 26744)
@@ -4,4 +4,6 @@
 	case {'ronne'}
 		remapath='/home/ModelData/Antarctica/REMA/REMA_200m_dem_filled.tif';
+	case {'totten'}
+		remapath='/totten_1/ModelData/Antarctica/REMA/REMA_200m_dem_filled.tif';
 	otherwise
 		error('machine not supported yet');
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpRTopo2.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpRTopo2.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpRTopo2.m	(revision 26744)
@@ -11,4 +11,6 @@
 	case {'ronne'}
 		rootname='/home/ModelData/Global/RTopo-2/RTopo-2.0.1_30sec_bedrock_topography.nc';
+	case {'totten'}
+		rootname='/totten_1/ModelData/Global/RTopo-2/RTopo-2.0.1_30sec_bedrock_topography.nc';
 	otherwise
 		error('machine not supported yet');
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpRignot2012.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpRignot2012.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpRignot2012.m	(revision 26744)
@@ -1,5 +1,5 @@
 function [vxout vyout]= interpRignot2012(X,Y),
 
-filename = '/home/ModelData/Greenland/VelMouginot/RignotGreenland2012Vel.mat';
+filename = '/totten_1/ModelData/Greenland/VelMouginot/RignotGreenland2012Vel.mat';
 
 
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpSeaRISE.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpSeaRISE.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpSeaRISE.m	(revision 26744)
@@ -52,4 +52,10 @@
 			searisenc='/u/astrid-r1b/ModelData/SeaRISE/Antarctica5km_shelves_v1.0/Antarctica_5km_dev1.0.nc';
 		end
+	case {'totten'}
+		if hemisphere==1,
+			searisenc='/totten_1/ModelData/SeaRISE/Greenland_5km_dev1.2.nc';
+		elseif hemisphere==-1,
+			searisenc='/totten_1/ModelData/SeaRISE/Antarctica_5km_dev1.0.nc';
+		end
 	otherwise
 		error('hostname not supported yet');
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpSmith2020.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpSmith2020.m	(revision 26743)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpSmith2020.m	(revision 26744)
@@ -33,4 +33,10 @@
 			path='/home/ModelData/Antarctica/DHDTSmith/';
 		end
+	case {'totten'}
+		if strcmp(string,'gris_filt') | strcmp(string,'gris')
+			path='/totten_1/ModelData/Greenland/DHDTSmith/';
+		else
+			path='/totten_1/ModelData/Antarctica/DHDTSmith/';
+		end
 	case {'recruta'}
 		path='/home/santos/ModelData/ICESat1_ICESat2_mass_change/';
Index: /issm/trunk/src/m/contrib/tsantos/integrate_field.m
===================================================================
--- /issm/trunk/src/m/contrib/tsantos/integrate_field.m	(revision 26744)
+++ /issm/trunk/src/m/contrib/tsantos/integrate_field.m	(revision 26744)
@@ -0,0 +1,22 @@
+function total=integrate_field(index,x,y,field)
+%INTEGRATE_FIELD: integrate a field over a 2D mesh
+%
+%   Usage:
+%      total=integrate_field(index,x,y,field);
+%
+%   Examples:
+%      volume=integrate_field(md.mesh.elements,md.mesh.x,md.mesh.y,md.geometry.thickness);
+
+% areas of each element
+x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3));
+y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
+areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)));
+
+% element-wise integration
+v1=index(:,1);	v2=index(:,2);	v3=index(:,3);
+elem_int=areas.*mean(field([v1 v2 v3]),2);
+
+% compute integration
+total=sum(elem_int);
+
+end
Index: /issm/trunk/src/m/coordsystems/gdaltransform.m
===================================================================
--- /issm/trunk/src/m/coordsystems/gdaltransform.m	(revision 26743)
+++ /issm/trunk/src/m/coordsystems/gdaltransform.m	(revision 26744)
@@ -20,5 +20,5 @@
 %			+proj=stere +lat_0=90 +lat_ts=71 +lon_0=-39 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.448564109 +units=m +no_defs
 %
-%	To get proj.4 string from EPSG, use gdalsrsinfo. Example:
+%	To get PROJ.4 string from EPSG, use gdalsrsinfo. Example:
 %		gdalsrsinfo epsg:4326 | grep "PROJ.4" | sed "s/PROJ.4 : //"
 
Index: /issm/trunk/src/m/coordsystems/gmtmask.m
===================================================================
--- /issm/trunk/src/m/coordsystems/gmtmask.m	(revision 26743)
+++ /issm/trunk/src/m/coordsystems/gmtmask.m	(revision 26744)
@@ -35,35 +35,10 @@
 	dlmwrite(filename_all,[long lat (1:nv)'],'delimiter','\t','precision',10);
 
-	%Avoid bypassing of the ld library path by Matlab (:()
-	%
-	% TODO: Do we really need this (we can/already set it in etc/environment.sh)?
-	if ismac,
-		dyld_library_path_old=getenv('DYLD_LIBRARY_PATH');
-		setenv('DYLD_LIBRARY_PATH',[ issmdir '/externalpackages/curl/install/lib:' issmdir '/externalpackages/hdf5/install/lib:' issmdir '/externalpackages/netcdf/install/lib' ]);
-	end
-
-	%Find path to gmt, list all possible known paths to gmt (you may need to add yours to the list)
-   gmtpaths = {[issmdir '/bin/gmt'],[issmdir '/externalpackages/gmt/install/bin/gmt'],'/Applications/GMT-5.4.3.app/Contents/Resources/bin/gmt'};
-   gmtpath = '';
-   for i=gmtpaths
-      if exist(i{1},'file'),
-         gmtpath = i{1};
-			break;
-      end
-   end
-   if isempty(gmtpath),
-      error('gmt not found! Make sure it is properly installed, or add its path to this file.');
-   end
-   
 	%figure out which vertices are on the ocean, which one on the continent:
-	[status,result] = system([gmtpath ' gmtselect ./' filename_all ' -h0 -Df -R0/360/-90/90  -A0 -JQ180/200 -Nk/s/s/k/s > ./' filename_oce]);
+	[status,result] = system(['gmtselect ./' filename_all ' -h0 -Df -R0/360/-90/90  -A0 -JQ180/200 -Nk/s/s/k/s > ./' filename_oce]);
 	if status~=0,
 		error(result);
 	end
 
-	%reset DYLD_LIBRARY_PATH to what it was: 
-	if ismac,
-		setenv('DYLD_LIBRARY_PATH',dyld_library_path_old);
-	end
 	%read the con_vertices.txt file and flag our mesh vertices on the continent
 	fid=fopen(['./' filename_oce],'r');
Index: /issm/trunk/src/m/coordsystems/gmtmask.py
===================================================================
--- /issm/trunk/src/m/coordsystems/gmtmask.py	(revision 26743)
+++ /issm/trunk/src/m/coordsystems/gmtmask.py	(revision 26744)
@@ -44,41 +44,6 @@
     np.savetxt('./all_vertices.txt', np.transpose([long, lat, np.arange(1, nv + 1)]), delimiter='\t', fmt='%.10f')
 
-    #Avoid bypassing of the ld library path by Matlab (:()
-    issm_dir = issmdir()
-
-    try:
-        ismac
-    except NameError:
-        ismac = False
-
-    # TODO: Do we really need this (we can/already set it in etc/environment.sh)?
-    if ismac:
-        dyld_library_path_old = os.getenv('DYLD_LIBRARY_PATH')
-        os.putenv('DYLD_LIBRARY_PATH', issm_dir + '/externalpackages/curl/install/lib:' + issm_dir + '/externalpackages/hdf5/install/lib:' + issm_dir + '/externalpackages/netcdf/install/lib')
-
-    #Find path to gmt (you may need to add yours to the list).
-    #
-    # NOTE: Assumes gmtselect is also in this directory.
-    #
-    gmtpaths = [
-        issm_dir + '/bin/gmt',
-        issm_dir + '/externalpackages/gmt/install/bin/gmt',
-        '/Applications/GMT-5.4.3.app/Contents/Resources/bin/gmt'
-    ]
-    gmtpath = ''
-    for i in range(len(gmtpaths)):
-        if os.path.isfile(gmtpaths[i]):
-            gmtpath = gmtpaths[i]
-            break
-
-    if gmtpath == '':
-        raise Exception('gmt not found! Make sure it is properly installed, or add its path to this file.')
-
     #figure out which vertices are on the ocean, which one on the continent:
-    subprocess.call(gmtpath + ' gmtselect ./ all_vertices.txt -h0 -Df -R0/360/-90/90 -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices.txt', shell=True)
-
-    #reset DYLD_LIBRARY_PATH to what it was:
-    if ismac:
-        os.putenv('DYLD_LIBRARY_PATH', dyld_library_path_old)
+    subprocess.call('gmtselect ./ all_vertices.txt -h0 -Df -R0/360/-90/90 -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices.txt', shell=True)
 
     #read the con_vertices.txt file and flag our mesh vertices on the continent
Index: /issm/trunk/src/m/coordsystems/laea.py
===================================================================
--- /issm/trunk/src/m/coordsystems/laea.py	(revision 26743)
+++ /issm/trunk/src/m/coordsystems/laea.py	(revision 26744)
@@ -1,5 +1,4 @@
 def laea(lat, long): #{{{
-    '''
-    LAEA - Lambert Azimuthal Equal Area projection at lat, long projection 
+    """LAEA - Lambert Azimuthal Equal Area projection at lat, long projection 
     center.
 
@@ -10,5 +9,5 @@
             string = laea(45, -90)
             return string = '+proj=laea +lat_0=45 +lon_0=-90 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs'
-    '''
+    """
 
     return '+proj=laea +lat_0={} +lon_0={} +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs'.format(lat, long)
Index: /issm/trunk/src/m/coordsystems/laea_inv.m
===================================================================
--- /issm/trunk/src/m/coordsystems/laea_inv.m	(revision 26744)
+++ /issm/trunk/src/m/coordsystems/laea_inv.m	(revision 26744)
@@ -0,0 +1,63 @@
+function [lat,lon] = laea_inv(x,y,lat1,lon0,falseeasting,falsenorthing)
+% laea_inv performs an inverse Lambert Azimuthal Equal Area projection
+% for a simple spherical Earth of radius 6371000 meters. 
+% 
+%% Syntax 
+% 
+%  [lat,lon] = laea_inv(x,y,lat1,lon0)
+%  [lat,lon] = laea_inv(x,y,lat1,lon0,falseeasting,falsenorthing)
+% 
+%% Description 
+% 
+% [lat,lon] = laea_inv(x,y,lat1,lon0) transforms the coordinates x,y (in 
+% meters) into geographic coordinates lat,lon. Inputs lat1 and lon0 specify 
+% the origin.
+%
+% [lat,lon] = laea_inv(x,y,lat1,lon0,falseeasting,falsenorthing) also allows
+% inclusion of false eastings and northings in meters. 
+% 
+%% Author Info 
+% Function written by Chad A. Greene of NASA Jet Propulsion Laboratory. 
+% December 2020. 
+% Formulas taken directly from Snyder 1987's classic tome, "Map Projections 
+% A Working Manual" starting around page 185. 
+
+%% Parse inputs: 
+
+narginchk(4,6)
+assert(isequal(size(lat1),size(lon0),[1 1]),'Error: Inputs lat1 and lon0 must both be scalars.')
+assert(abs(lat1)<=90,'lat1 cannot exceed +/-90 degrees.') 
+assert(abs(lon0)<=360,'lon0 cannot exceed +/-360 degrees.') 
+assert(isequal(size(x),size(y)),'Dimensions of x and y must match.') 
+
+if nargin<5
+   falseeasting = 0; 
+   falsenorthing = 0; 
+end
+
+%% 
+% Projection formulas:
+% From Snyder 1987, MAP PROJECTIONS-A WORKING MANUAL, page 185: https://pubs.usgs.gov/pp/1395/report.pdf
+
+% Account for false easting, northing: 
+x = x - falseeasting; 
+y = y - falsenorthing; 
+
+% Define constants: 
+R = 6371000; % earth radius (meters) 
+rho = hypot(x,y); 
+c = 2*asind(rho./(2*R)); 
+
+% Unproject: 
+lat = asind(cosd(c) .* sind(lat1) + (y .* sind(c) .* cosd(lat1))./rho); 
+
+switch lon0
+   case 90
+      lon = lon0 + atand(-x./y);
+   case -90
+      lon = lon0 + atand(x./y); 
+   otherwise
+      lon = lon0 + atand((x .* sind(c))./(rho.*cosd(lat1) .*cosd(c) - y.*sind(lat1).*sind(c))); 
+end
+
+end
Index: /issm/trunk/src/m/coordsystems/ll2xy.m
===================================================================
--- /issm/trunk/src/m/coordsystems/ll2xy.m	(revision 26743)
+++ /issm/trunk/src/m/coordsystems/ll2xy.m	(revision 26744)
@@ -36,5 +36,5 @@
 
 if nargout~=3 & nargout~=2,
-	help xy2ll
+	help ll2xy
 	error('bad usage');
 end
Index: /issm/trunk/src/m/coordsystems/ll2xy.py
===================================================================
--- /issm/trunk/src/m/coordsystems/ll2xy.py	(revision 26743)
+++ /issm/trunk/src/m/coordsystems/ll2xy.py	(revision 26744)
@@ -2,38 +2,50 @@
 
 
-def ll2xy(lat, lon, sgn=-1, central_meridian=0, standard_parallel=71):
-    '''
-    LL2XY - converts lat lon to polar stereographic
+def ll2xy(lat, lon, sgn, *args):
+    """LL2XY - converts lat lon to polar stereographic
 
-   Converts from geodetic latitude and longitude to Polar
-   Stereographic (X, Y) coordinates for the polar regions.
-   Author: Michael P. Schodlok, December 2003 (map2ll)
+    Converts from geodetic latitude and longitude to Polar
+    Stereographic (X, Y) coordinates for the polar regions.
+    Author: Michael P. Schodlok, December 2003 (map2ll)
 
-   Usage:
-      x, y = ll2xy(lat, lon, sgn)
-      x, y = ll2xy(lat, lon, sgn, central_meridian, standard_parallel)
+    Usage:
+        x, y = ll2xy(lat, lon, sgn)
+        x, y = ll2xy(lat, lon, sgn, central_meridian, standard_parallel)
 
- - sgn = Sign of latitude	1 : north latitude (default is mer = 45 lat = 70)
- 						   -1 : south latitude (default is mer = 0  lat = 71)
-    '''
+    - sgn = Sign of latitude	1 : north latitude (default is mer = 45 lat = 70)
+    						   -1 : south latitude (default is mer = 0  lat = 71)
+    """
+    assert sgn == 1 or sgn == -1, 'error: sgn should be either 1 or -1'
+	 
+	 # Get central_meridian and standard_parallel depending on hemisphere
+    if len(args) == 2:
+       delta = args[0]
+       slat = args[1]
+    elif len(args) == 0:
+       if sgn == 1:
+          delta = 45.
+          slat = 70.
+          print('        ll2xy: creating coordinates in north polar stereographic (Std Latitude: 70degN Meridian: 45deg)')
+       elif sgn == -1:
+          delta = 0.
+          slat = 71.
+          print('        ll2xy: creating coordinates in south polar stereographic (Std Latitude: 71degS Meridian: 0deg)')
+       else:
+          raise ValueError('sgn should be either 1 or -1')
+    else:
+       raise Exception('bad usage: type "help(ll2xy)" for details')
 
-    assert sgn == 1 or sgn == -1, 'error: sgn should be either 1 or -1'
-
-    #Get central_meridian and standard_parallel depending on hemisphere
-    if sgn == 1:
-        delta = 45
-        slat = 70
-        print('        ll2xy: creating coordinates in north polar stereographic (Std Latitude: 70N Meridian: 45)')
-    else:
-        delta = central_meridian
-        slat = standard_parallel
-        print('        ll2xy: creating coordinates in south polar stereographic (Std Latitude: 71S Meridian: 0)')
+    # if lat, lon passed as lists, convert to np.arrays
+    if type(lat) != "np.ndarray":
+       lat = np.array(lat)
+    if type(lon) != "np.ndarray":
+       lon = np.array(lon)
 
     # Conversion constant from degrees to radians
     #cde = 57.29577951
     # Radius of the earth in meters
-    re = 6378.273 * 10**3
+    re = 6378.273 * pow(10, 3)
     # Eccentricity of the Hughes ellipsoid squared
-    ex2 = .006693883
+    ex2 = 0.006693883
     # Eccentricity of the Hughes ellipsoid
     ex = np.sqrt(ex2)
@@ -58,6 +70,7 @@
     cnt1 = np.nonzero(latitude >= np.pi / 2.)[0]
 
-    if cnt1:
-        x[cnt1, 0] = 0.0
-        y[cnt1, 0] = 0.0
+    if len(cnt1)>0:
+        x[cnt1] = 0.0
+        y[cnt1] = 0.0
+
     return x, y
Index: /issm/trunk/src/m/coordsystems/xy2ll.py
===================================================================
--- /issm/trunk/src/m/coordsystems/xy2ll.py	(revision 26743)
+++ /issm/trunk/src/m/coordsystems/xy2ll.py	(revision 26744)
@@ -4,6 +4,5 @@
 
 def xy2ll(x, y, sgn, *args):
-    '''
-    XY2LL - converts xy to lat long
+    """XY2LL - converts xy to lat long
 
     Converts Polar  Stereographic (X, Y) coordinates for the polar regions to
@@ -13,12 +12,12 @@
 
     Usage:
-       [lat, lon] = xy2ll(x, y, sgn)
-       [lat, lon] = xy2ll(x, y, sgn, central_meridian, standard_parallel)
+        [lat, lon] = xy2ll(x, y, sgn)
+        [lat, lon] = xy2ll(x, y, sgn, central_meridian, standard_parallel)
 
-     - sgn = Sign of latitude	1 : north latitude (default is mer = 45 lat = 70)
-     						   -1 : south latitude (default is mer = 0  lat = 71)
-    '''
+    - sgn = Sign of latitude	1 : north latitude (default is mer = 45 lat = 70)
+    						   -1 : south latitude (default is mer = 0  lat = 71)
+    """
 
-    #Get central_meridian and standard_parallel depending on hemisphere
+    # Get central_meridian and standard_parallel depending on hemisphere
     if len(args) == 2:
         delta = args[0]
@@ -47,11 +46,11 @@
     #cde = 57.29577951
     # Radius of the earth in meters
-    re = 6378.273 * 10**3
+    re = 6378.273 * pow(10, 3)
     # Eccentricity of the Hughes ellipsoid squared
-    ex2 = .006693883
+    ex2 = 0.006693883
     # Eccentricity of the Hughes ellipsoid
     ex = np.sqrt(ex2)
 
-    sl = slat * pi / 180.
+    sl = slat * pi / 180.0
     rho = np.sqrt(x**2 + y**2)
     cm = np.cos(sl) / np.sqrt(1.0 - ex2 * (np.sin(sl)**2))
Index: /issm/trunk/src/m/dev/ISSM.py
===================================================================
--- /issm/trunk/src/m/dev/ISSM.py	(revision 26743)
+++ /issm/trunk/src/m/dev/ISSM.py	(revision 26744)
@@ -4,5 +4,4 @@
 import scipy.io as spio
 from model import *
-from socket import gethostname
 from triangle import *
 from setmask import *
@@ -10,5 +9,6 @@
 from setflowequation import *
 from solve import *
-from IssmConfing import *
+from IssmConfig import *
+from MatlabFuncs import *
 
 #Secondary imports
Index: /issm/trunk/src/m/dev/devpath.m
===================================================================
--- /issm/trunk/src/m/dev/devpath.m	(revision 26743)
+++ /issm/trunk/src/m/dev/devpath.m	(revision 26744)
@@ -3,9 +3,10 @@
 
 %Recover ISSM_DIR , or if on a Windows machine, ISSM_DIR_WIN
-if ~ispc,
+if ispc,
+	ISSM_DIR=getenv('ISSM_DIR_WIN');
+else
 	ISSM_DIR=getenv('ISSM_DIR');
-else
-	ISSM_DIR=getenv('ISSM_DIR_WIN');
 end
+
 if (isempty(ISSM_DIR)),
 	error('''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
@@ -18,5 +19,5 @@
 %ISSM path
 addpath([ISSM_DIR '/src/m/os/']); %load recursivepath
-addpath([ISSM_DIR '/lib']);       %load mex
+addpath([ISSM_DIR '/lib']);       %load MEX files
 addpath(recursivepath([ISSM_DIR '/src/m']));
 addpath(recursivepath([ISSM_DIR '/externalpackages/scotch']));
@@ -28,4 +29,5 @@
 addpath(recursivepath([ISSM_DIR '/externalpackages/dem']));
 addpath(recursivepath([ISSM_DIR '/externalpackages/mealpix']));
+addpath(recursivepath([ISSM_DIR '/externalpackages/pcatool']));
 clear ISSM_DIR;
 
Index: /issm/trunk/src/m/dev/devpath.py
===================================================================
--- /issm/trunk/src/m/dev/devpath.py	(revision 26743)
+++ /issm/trunk/src/m/dev/devpath.py	(revision 26744)
@@ -2,5 +2,4 @@
 import os
 import sys
-import warnings
 
 #Recover ISSM_DIR and USERNAME
@@ -16,6 +15,6 @@
         dirs.remove('.svn')
     for file in files:
-        if file.find(".py") != -1:
-            if file.find(".pyc") == -1:
+        if file.find('.py') != -1:
+            if file.find('.pyc') == -1:
                 if root not in sys.path:
                     sys.path.append(root)
@@ -36,5 +35,5 @@
             sys.path.append(jpl_path)
     else:
-        warnings.warn('cluster settings should be in, {}/usr/{}'.format(JPL_SVN, USERNAME))
+        print('Warning: devpath.py: cluster settings should be in {}'.format(jpl_path))
 
 from runme import runme  #first because plotmodel may fail
@@ -47,4 +46,4 @@
 #c.InteractiveShellApp.exec_lines.append('print "Warning: disable autoreload in startup.py to improve performance." ')
 
-print("\n  ISSM development path correctly loaded")
-print("Current path is {}\n\n".format(ISSM_DIR))
+# print("\n  ISSM development path correctly loaded")
+# print("Current path is {}\n\n".format(ISSM_DIR))
Index: /issm/trunk/src/m/dev/issmversion.m
===================================================================
--- /issm/trunk/src/m/dev/issmversion.m	(revision 26743)
+++ /issm/trunk/src/m/dev/issmversion.m	(revision 26744)
@@ -17,5 +17,5 @@
 disp(['Compiled on ' IssmConfig('HOST_VENDOR') ' ' IssmConfig('HOST_OS') ' ' IssmConfig('HOST_ARCH') ' by ' IssmConfig('USER_NAME')]);
 disp([' ']);
-disp(['Copyright (c) 2009-2020 California Institute of Technology']);
+disp(['Copyright (c) 2009-2021 California Institute of Technology']);
 disp([' ']);
 disp(['    to get started type: issmdoc']);
Index: /issm/trunk/src/m/dev/issmversion.py
===================================================================
--- /issm/trunk/src/m/dev/issmversion.py	(revision 26743)
+++ /issm/trunk/src/m/dev/issmversion.py	(revision 26744)
@@ -16,5 +16,5 @@
 print(' ')
 print(('Build date: ' + IssmConfig('PACKAGE_BUILD_DATE')[0]))
-print('Copyright (c) 2009 - 2020 California Institute of Technology')
+print('Copyright (c) 2009-2021 California Institute of Technology')
 print(' ')
 print('    to get started type: issmdoc')
Index: /issm/trunk/src/m/exp/contourlevelzero.m
===================================================================
--- /issm/trunk/src/m/exp/contourlevelzero.m	(revision 26743)
+++ /issm/trunk/src/m/exp/contourlevelzero.m	(revision 26744)
@@ -1,6 +1,6 @@
 function contours=contourlevelzero(md,mask,level)
-%CONTOURLEVELZERO - figure out the zero level (or offset thereof, specified by 
-%the level value) of a vectorial mask, and vectorialize it into an exp or shp 
-%compatible structure.
+%CONTOURLEVELZERO - figure out the zero level (or offset thereof, specified by the level value) 
+%                   of a vectorial mask, and vectorialize it into an exp or shp compatible 
+%structure.
 %
 %   Usage:
@@ -9,10 +9,7 @@
 %   See also: PLOT_CONTOUR
 
-if isempty(mask)
-	error('mask provided is empty');
-end
-
 %process data 
 if dimension(md.mesh)==3,
+% 	error('contourlevelzero error message: routine not supported for 3d meshes, project on a layer');
 	x = md.mesh.x2d;
 	y = md.mesh.y2d;
@@ -24,5 +21,5 @@
 end
 
-if isfield(md.mesh,'z'),
+if isprop(md.mesh,'z'),
 	z=md.mesh.z;
 else
@@ -30,6 +27,7 @@
 end
 
+if isempty(mask), error('mask provided is empty'); end
 if dimension(md.mesh)==3,
-	if length(mask)~=md.mesh.numberofvertices2d, error('Since this is a 3d model, you need to project the mask on a layer (e.g. project2d(md,mask,0))'); end
+	if length(mask)~=md.mesh.numberofvertices2d, error('mask provided should be specified at the vertices of the mesh'); end
 else
 	if length(mask)~=md.mesh.numberofvertices, error('mask provided should be specified at the vertices of the mesh'); end
Index: /issm/trunk/src/m/exp/contourlevelzero.py
===================================================================
--- /issm/trunk/src/m/exp/contourlevelzero.py	(revision 26744)
+++ /issm/trunk/src/m/exp/contourlevelzero.py	(revision 26744)
@@ -0,0 +1,237 @@
+import os.path
+import numpy as np
+from collections import OrderedDict
+
+def contourlevelzero(md,mask,level):
+    """CONTOURLEVELZERO - figure out the zero level (or offset thereof, specified by the level value)
+                       of a vectorial mask, and vectorialize it into an exp or shp compatible structure.
+    
+       Usage:
+          contours=contourlevelzero(md,mask,level)
+    
+       See also: PLOT_CONTOUR
+    """
+    
+    #process data 
+    if md.mesh.dimension()==3:
+        x = md.mesh.x2d
+        y = md.mesh.y2d
+        z=md.mesh.z
+        index=md.mesh.elements2d-1
+    else:
+        x=md.mesh.x
+        y=md.mesh.y
+        index=md.mesh.elements-1
+        z=np.zeros((md.mesh.numberofvertices,1))
+        
+    if len(mask)==0:
+        raise OSError("mask provided is empty")
+    
+    if md.mesh.dimension()==3:
+        if len(mask)!=md.mesh.numberofvertices2d: 
+            raise OSError("mask provided should be specified at the vertices of the mesh")
+    else:
+        if len(mask)!=md.mesh.numberofvertices:
+            raise OSError("mask provided should be specified at the vertices of the mesh")
+        
+    #initialization of some variables
+    numberofelements=np.size(index,0)
+    elementslist=np.c_[0:numberofelements]
+    c=[]
+    h=[]
+    
+    #get unique edges in mesh
+    #1: list of edges
+    edges=np.vstack((np.vstack((index[:,(0,1)],index[:,(1,2)])),index[:,(2,0)]))
+
+    #2: find unique edges
+    [edges,J]=np.unique(np.sort(edges,1),axis=0,return_inverse=True)
+    #3: unique edge numbers
+    vec=J
+    #4: unique edges numbers in each triangle (2 triangles sharing the same edge will have
+    #   the same edge number)
+    edges_tria=np.hstack((np.hstack((vec[elementslist],vec[elementslist+numberofelements])),vec[elementslist+2*numberofelements]))
+    
+    #segments [nodes1 nodes2]
+    Seg1=index[:,(0,1)]
+    Seg2=index[:,(1,2)]
+    Seg3=index[:,(2,0)]
+    
+    #segment numbers [1;4;6;...]
+    Seg1_num=edges_tria[:,0]
+    Seg2_num=edges_tria[:,1]
+    Seg3_num=edges_tria[:,2]
+    
+    #value of data on each tips of the segments
+    Data1=mask[Seg1]
+    Data2=mask[Seg2]
+    Data3=mask[Seg3]
+    
+    #get the ranges for each segment
+    Range1=np.sort(Data1,1)
+    Range2=np.sort(Data2,1)
+    Range3=np.sort(Data3,1)
+    
+    #find the segments that contain this value
+    pos1=(Range1[:,0]<level) & (Range1[:,1]>=level)
+    pos2=(Range2[:,0]<level) & (Range2[:,1]>=level)
+    pos3=(Range3[:,0]<level) & (Range3[:,1]>=level)
+    
+    #get elements
+    poselem12=(pos1) & (pos2)
+    poselem13=(pos1) & (pos3)
+    poselem23=(pos2) & (pos3)
+    poselem=np.where((poselem12) | (poselem13) | (poselem23))
+    poselem=poselem[0]
+    numelems=len(poselem)
+    
+    #if no element has been flagged, skip to the next level
+    if numelems==0:
+        raise Exception('contourlevelzero warning message: no elements found with corresponding level value in mask')
+        contours=[]
+        return contours
+    
+    #go through the elements and build the coordinates for each segment (1 by element)
+    x1=np.zeros((numelems,1))
+    x2=np.zeros((numelems,1))
+    y1=np.zeros((numelems,1))
+    y2=np.zeros((numelems,1))
+    z1=np.zeros((numelems,1))
+    z2=np.zeros((numelems,1))
+    
+    edge_l=np.zeros((numelems,2))
+    
+    for j in range(0,numelems):
+        
+        with np.errstate(divide='ignore', invalid='ignore'):
+            weight1=np.divide(level-Data1[poselem[j],0],Data1[poselem[j],1]-Data1[poselem[j],0])
+            weight2=np.divide(level-Data2[poselem[j],0],Data2[poselem[j],1]-Data2[poselem[j],0])
+            weight3=np.divide(level-Data3[poselem[j],0],Data3[poselem[j],1]-Data3[poselem[j],0])
+        
+        if poselem12[poselem[j]]==True:
+            
+            x1[j]=x[Seg1[poselem[j],0]]+weight1*[x[Seg1[poselem[j],1]]-x[Seg1[poselem[j],0]]]
+            x2[j]=x[Seg2[poselem[j],0]]+weight2*[x[Seg2[poselem[j],1]]-x[Seg2[poselem[j],0]]]
+            y1[j]=y[Seg1[poselem[j],0]]+weight1*[y[Seg1[poselem[j],1]]-y[Seg1[poselem[j],0]]]
+            y2[j]=y[Seg2[poselem[j],0]]+weight2*[y[Seg2[poselem[j],1]]-y[Seg2[poselem[j],0]]]
+            z1[j]=z[Seg1[poselem[j],0]]+weight1*[z[Seg1[poselem[j],1]]-z[Seg1[poselem[j],0]]]
+            z2[j]=z[Seg2[poselem[j],0]]+weight2*[z[Seg2[poselem[j],1]]-z[Seg2[poselem[j],0]]]
+            
+            edge_l[j,0]=Seg1_num[poselem[j]]
+            edge_l[j,1]=Seg2_num[poselem[j]]
+        elif poselem13[poselem[j]]==True:
+            
+            x1[j]=x[Seg1[poselem[j],0]]+weight1*[x[Seg1[poselem[j],1]]-x[Seg1[poselem[j],0]]]
+            x2[j]=x[Seg3[poselem[j],0]]+weight3*[x[Seg3[poselem[j],1]]-x[Seg3[poselem[j],0]]]
+            y1[j]=y[Seg1[poselem[j],0]]+weight1*[y[Seg1[poselem[j],1]]-y[Seg1[poselem[j],0]]]
+            y2[j]=y[Seg3[poselem[j],0]]+weight3*[y[Seg3[poselem[j],1]]-y[Seg3[poselem[j],0]]]
+            z1[j]=z[Seg1[poselem[j],0]]+weight1*[z[Seg1[poselem[j],1]]-z[Seg1[poselem[j],0]]]
+            z2[j]=z[Seg3[poselem[j],0]]+weight3*[z[Seg3[poselem[j],1]]-z[Seg3[poselem[j],0]]]
+            
+            edge_l[j,0]=Seg1_num[poselem[j]]
+            edge_l[j,1]=Seg3_num[poselem[j]]
+        elif poselem23[poselem[j]]==True:
+            
+            x1[j]=x[Seg2[poselem[j],0]]+weight2*[x[Seg2[poselem[j],1]]-x[Seg2[poselem[j],0]]]
+            x2[j]=x[Seg3[poselem[j],0]]+weight3*[x[Seg3[poselem[j],1]]-x[Seg3[poselem[j],0]]]
+            y1[j]=y[Seg2[poselem[j],0]]+weight2*[y[Seg2[poselem[j],1]]-y[Seg2[poselem[j],0]]]
+            y2[j]=y[Seg3[poselem[j],0]]+weight3*[y[Seg3[poselem[j],1]]-y[Seg3[poselem[j],0]]]
+            z1[j]=z[Seg2[poselem[j],0]]+weight2*[z[Seg2[poselem[j],1]]-z[Seg2[poselem[j],0]]]
+            z2[j]=z[Seg3[poselem[j],0]]+weight3*[z[Seg3[poselem[j],1]]-z[Seg3[poselem[j],0]]]
+
+            edge_l[j,0]=Seg2_num[poselem[j]]
+            edge_l[j,1]=Seg3_num[poselem[j]]
+
+        #else:
+	    #it shoud not go here
+            
+    #now that we have the segments, we must try to connect them...
+    
+    #loop over the subcontours
+    contours=[]
+    
+    while len(edge_l)>0:
+        
+        #take the right edge of the second segment and connect it to the next segments if any
+        e1=edge_l[0,0]
+        e2=edge_l[0,1]
+        xc=np.vstack((x1[0],x2[0]))
+        yc=np.vstack((y1[0],y2[0]))
+        zc=np.vstack((z1[0],z2[0]))
+        #erase the lines corresponding to this edge
+        edge_l=np.delete(edge_l,0,axis=0)
+        x1=np.delete(x1,0,axis=0)
+        x2=np.delete(x2,0,axis=0)
+        y1=np.delete(y1,0,axis=0)
+        y2=np.delete(y2,0,axis=0)
+        z1=np.delete(z1,0,axis=0)
+        z2=np.delete(z2,0,axis=0)
+        pos1=np.where(edge_l==e1)
+        
+        while len(pos1[0])>0:
+            
+            if np.all(pos1[1]==0):
+                xc=np.vstack((x2[pos1[0]],xc))
+                yc=np.vstack((y2[pos1[0]],yc))
+                zc=np.vstack((z2[pos1[0]],zc))
+                #next edge:
+                e1=edge_l[pos1[0],1]
+            else:
+                xc=np.vstack((x1[pos1[0]],xc))
+                yc=np.vstack((y1[pos1[0]],yc))
+                zc=np.vstack((z1[pos1[0]],zc))
+                #next edge:
+                e1=edge_l[pos1[0],0]
+                
+            #erase the lines of this
+            edge_l=np.delete(edge_l,pos1[0],axis=0)
+            x1=np.delete(x1,pos1[0],axis=0)
+            x2=np.delete(x2,pos1[0],axis=0)
+            y1=np.delete(y1,pos1[0],axis=0)
+            y2=np.delete(y2,pos1[0],axis=0)
+            z1=np.delete(z1,pos1[0],axis=0)
+            z2=np.delete(z2,pos1[0],axis=0)
+            #next connection
+            pos1=np.where(edge_l==e1)
+            
+        #same thing the other way (to the right)
+        pos2=np.where(edge_l==e2)
+
+        while len(pos2[0])>0:
+            
+            if np.all(pos2[1]==0):
+                xc=np.vstack((xc,x2[pos2[0]]))
+                yc=np.vstack((yc,y2[pos2[0]]))
+                zc=np.vstack((zc,z2[pos2[0]]))
+                #next edge:
+                e2=edge_l[pos2[0],1]
+            else:
+                xc=np.vstack((xc,x1[pos2[0]]))
+                yc=np.vstack((yc,y1[pos2[0]]))
+                zc=np.vstack((zc,z1[pos2[0]]))
+                #next edge:
+                e2=edge_l[pos2[0],0]
+                
+            #erase the lines of this
+            edge_l=np.delete(edge_l,pos2[0],axis=0)
+            x1=np.delete(x1,pos2[0],axis=0)
+            x2=np.delete(x2,pos2[0],axis=0)
+            y1=np.delete(y1,pos2[0],axis=0)
+            y2=np.delete(y2,pos2[0],axis=0)
+            z1=np.delete(z1,pos2[0],axis=0)
+            z2=np.delete(z2,pos2[0],axis=0)
+            #next connection
+            pos2=np.where(edge_l==e2)
+            
+        #save xc,yc contour: 
+        newcontour = OrderedDict()
+        newcontour['nods'] = np.size(xc)
+        newcontour['density'] = 1 
+        newcontour['closed'] = 0
+        newcontour['x'] = np.ma.filled(xc.astype(float), np.nan)
+        newcontour['y'] = np.ma.filled(yc.astype(float), np.nan)
+        newcontour['z'] = np.ma.filled(zc.astype(float), np.nan)
+        newcontour['name'] = ''
+        contours.append(newcontour)
+        
+    return contours
Index: /issm/trunk/src/m/exp/expcontourlevelzero.m
===================================================================
--- /issm/trunk/src/m/exp/expcontourlevelzero.m	(revision 26743)
+++ /issm/trunk/src/m/exp/expcontourlevelzero.m	(revision 26744)
@@ -6,5 +6,6 @@
 % 
 %   Example:
-%      expcontourlevelzero(md,md.geometry.thickness,0, 'Level0.exp');
+%      expcontourlevelzero(md,md.geometry.thickness,10, 'Level0.exp');
+%      expcontourlevelzero(md,md.mask.ocean_levelset,0, 'Level0.exp');
 %
 %   See also CONTOURLEVELZERO, EXPWRITE
Index: /issm/trunk/src/m/exp/expwrite.py
===================================================================
--- /issm/trunk/src/m/exp/expwrite.py	(revision 26743)
+++ /issm/trunk/src/m/exp/expwrite.py	(revision 26744)
@@ -3,45 +3,43 @@
 
 def expwrite(contours, filename):
-    """
-    EXPWRITE - write an Argus file from a dictionary given in input
+    """EXPWRITE - write an Argus file from a dictionary given in input
 
-       This routine writes an Argus file from a dict containing the fields:
-       x and y of the coordinates of the points.
-       The first argument is the list containing the points coordinates
-       and the second one the file to be written.
+    This routine writes an Argus file from a dict containing the fields:
+    x and y of the coordinates of the points.
+    The first argument is the list containing the points coordinates and the 
+    second one the file to be written.
 
-       Usage:
-          expwrite(contours, filename)
+    Usage:
+        expwrite(contours, filename)
 
-       Example:
-          expwrite(coordstruct, 'domainoutline.exp')
+    Example:
+        expwrite(coordstruct, 'domainoutline.exp')
 
-       See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
+    See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
     """
 
     fid = open(filename, 'w')
     for x, y in zip(contours['x'], contours['y']):
-        #if np.size(contour['x']) != np.size(contour['y']):
         if len(x) != len(y):
-            raise RuntimeError("contours x and y coordinates must be of identical size")
+            raise RuntimeError('contours x and y coordinates must be of identical size')
+
         if 'name' in contours:
-            fid.write("%s%s\n" % ('  # Name:', contours['name']))
+            fid.write('{}{}\n'.format('# Name:', contours['name']))
         else:
-            fid.write("%s%s\n" % ('  # Name:', filename))
+            fid.write('{}{}\n'.format('# Name:', filename))
 
-        #Add density if it's not there FIXME what is this ever used for?
-        #if 'density' not in contours:
-        #    contours['density'] = 1
-        density = 1
-
-        fid.write("%s\n" % '  # Icon:0')
-        fid.write("%s\n" % '  # Points Count Value')
-    #fid.write("%i %f\n" % (np.size(contour['x']), contour['density']))
-        fid.write("%i %f\n" % (np.size(x), density))
-        fid.write("%s\n" % '  # X pos Y pos')
-    #for x, y in zip(contour['x'], contour['y']):
+        fid.write('{}\n'.format('## Icon:0'))
+        fid.write('{}\n'.format('# Points Count Value'))
+        if 'density' in contours:
+            if isinstance(contours['density'], int):
+                fid.write('{} {}\n'.format(np.size(x), contours['density']))
+            else:
+                fid.write('{} {}\n'.format(np.size(x), 1.))
+        else:
+            fid.write('{} {}\n'.format(np.size(x), 1.))
+        fid.write('{}\n'.format('# X pos Y pos'))
         for xi, yi in zip(x, y):
-            fid.write("%10.10f %10.10f\n" % (xi, yi))
-        fid.write("\n")
+            fid.write('%10.10f %10.10f\n' % (xi, yi))
+        fid.write('\n')
 
     fid.close()
Index: /issm/trunk/src/m/extrusion/project3d.m
===================================================================
--- /issm/trunk/src/m/extrusion/project3d.m	(revision 26743)
+++ /issm/trunk/src/m/extrusion/project3d.m	(revision 26744)
@@ -7,9 +7,10 @@
 %   arguments: 
 %      'vector': 2d vector
-%      'type': 'element' or 'node'. 
+%      'type': 'element' or 'node' or 'poly'
 %   options: 
 %      'layer' a layer number where vector should keep its values. If not specified, all layers adopt the 
 %             value of the 2d vector.
 %      'padding': default to 0 (value adopted by other 3d layers not being projected0
+%		 'degree': degree of polynomials when extrude from bottom to the top
 %
 %   Egs:
@@ -33,4 +34,5 @@
 layer        = getfieldvalue(options,'layer',0);    %optional (do all layers otherwise)
 paddingvalue = getfieldvalue(options,'padding',0);  %0 by default
+polyexponent = getfieldvalue(options,'degree',0);   %0 by default, 0-degree polynomial
 
 if length(vector2d)==1,
@@ -80,4 +82,27 @@
 	end
 
+elseif strcmpi(type,'poly'), % interpolate values from 0 to 1 with a polynomial degree n
+	%Initialize 3d vector
+	if size(vector2d,1)==md.mesh.numberofvertices2d
+		projected_vector=paddingvalue*ones(md.mesh.numberofvertices, size(vector2d,2));
+	elseif size(vector2d,1)==md.mesh.numberofvertices2d+1
+		projected_vector=paddingvalue*ones(md.mesh.numberofvertices+1,size(vector2d,2));
+		projected_vector(end,:)=vector2d(end,:);
+		vector2d=vector2d(1:end-1,:);
+	else
+		error('vector length not supported')
+	end
+
+	polycoeff = [0:1./(md.mesh.numberoflayers-1):1];
+
+	%Fill in
+	if layer==0,
+		for i=1:md.mesh.numberoflayers,
+			projected_vector(((i-1)*md.mesh.numberofvertices2d+1):(i*md.mesh.numberofvertices2d),:)=vector2d*(1-(1-polycoeff(i)).^polyexponent);
+		end
+	else
+		projected_vector(((layer-1)*md.mesh.numberofvertices2d+1):(layer*md.mesh.numberofvertices2d),:)=vector2d*(1-(1-polycoeff(layer)).^polyexponent);
+	end
+
 else
 	error('project3d error message: unknown projection type');
Index: /issm/trunk/src/m/extrusion/project3d.py
===================================================================
--- /issm/trunk/src/m/extrusion/project3d.py	(revision 26743)
+++ /issm/trunk/src/m/extrusion/project3d.py	(revision 26744)
@@ -1,4 +1,3 @@
 import numpy as np
-
 from pairoptions import pairoptions
 
@@ -8,19 +7,20 @@
     PROJECT3D - vertically project a vector from 2d mesh
 
-        vertically project a vector from 2d mesh (split in noncoll and coll 
+        vertically project a vector from 2d mesh (split in noncoll and coll
         areas) into a 3d mesh.
-        This vector can be a node vector of size (md.mesh.numberofvertices2d, 
+        This vector can be a node vector of size (md.mesh.numberofvertices2d,
         N/A) or an element vector of size (md.mesh.numberofelements2d, N/A).
 
         arguments:
             'vector': 2d vector
-            'type': 'element' or 'node'
+            'type': 'element' or 'node' or 'poly'
 
         options:
-            'layer'     a layer number where vector should keep its values. If 
-                        not specified, all layers adopt the value of the 2d 
+            'layer'     a layer number where vector should keep its values. If
+                        not specified, all layers adopt the value of the 2d
                         vector.
-            'padding':  default to 0 (value adopted by other 3d layers not 
+            'padding':  default to 0 (value adopted by other 3d layers not
                         being projected.
+            'degree':   degree of polynomials when extrude from bottom to the top
 
         Examples:
@@ -42,4 +42,5 @@
     layer = options.getfieldvalue('layer', 0)  #optional (do all layers otherwise)
     paddingvalue = options.getfieldvalue('padding', 0)  #0 by default
+    polyexponent = options.getfieldvalue('degree', 0)  #0 by default, 0-degree polynomial
 
     #Handle special case where vector2d is single element (differs from representation in MATLAB)
@@ -115,5 +116,36 @@
             else:
                 projected_vector[((layer - 1) * md.mesh.numberofelements2d):(layer * md.mesh.numberofelements2d), :] = vector2d
-
+    elif vectype.lower() == 'poly':
+        #Initialize 3d vector
+        if np.ndim(vector2d) == 1:
+            if vector2d.shape[0] == md.mesh.numberofvertices2d:
+                projected_vector = (paddingvalue * np.ones((md.mesh.numberofvertices))).astype(vector2d.dtype)
+            elif vector2d.shape[0] == md.mesh.numberofvertices2d + 1:
+                projected_vector = (paddingvalue * np.ones((md.mesh.numberofvertices + 1))).astype(vector2d.dtype)
+                projected_vector[-1] = vector2d[-1]
+                vector2d = vector2d[:-1]
+            else:
+                raise TypeError("vector length not supported")
+            #Fill in
+            if layer == 0:
+                for i in range(md.mesh.numberoflayers - 1):
+                    projected_vector[(i * md.mesh.numberofvertices2d):((i + 1) * md.mesh.numberofvertices2d)] = vector2d * (1.0 - (1.0 - i / (md.mesh.numberoflayers - 1.0))**polyexponent)
+            else:
+                projected_vector[((layer - 1) * md.mesh.numberofvertices2d):(layer * md.mesh.numberofvertices2d)] = vector2d * (1.0 - (1.0 - layer / (md.mesh.numberoflayers - 1.0))**polyexponent)
+        else:
+            if vector2d.shape[0] == md.mesh.numberofvertices2d:
+                projected_vector = (paddingvalue * np.ones((md.mesh.numberofvertices, np.size(vector2d, axis=1)))).astype(vector2d.dtype)
+            elif vector2d.shape[0] == md.mesh.numberofvertices2d + 1:
+                projected_vector = (paddingvalue * np.ones((md.mesh.numberofvertices + 1, np.size(vector2d, axis=1)))).astype(vector2d.dtype)
+                projected_vector[-1, :] = vector2d[-1, :]
+                vector2d = vector2d[:-1, :]
+            else:
+                raise TypeError("vector length not supported")
+            #Fill in
+            if layer == 0:
+                for i in range(md.mesh.numberoflayers - 1):
+                    projected_vector[(i * md.mesh.numberofvertices2d):((i + 1) * md.mesh.numberofvertices2d), :] = vector2d * (1.0 - (1.0 - i / (md.mesh.numberoflayers - 1.0))**polyexponent)
+            else:
+                projected_vector[((layer - 1) * md.mesh.numberofvertices2d):(layer * md.mesh.numberofvertices2d), :] = vector2d * (1.0 - (1.0 - layer / (md.mesh.numberoflayers - 1.0))**polyexponent)
     else:
         raise TypeError("project3d error message: unknown projection type")
Index: /issm/trunk/src/m/geometry/planetradius.js
===================================================================
--- /issm/trunk/src/m/geometry/planetradius.js	(revision 26744)
+++ /issm/trunk/src/m/geometry/planetradius.js	(revision 26744)
@@ -0,0 +1,20 @@
+function planetradius(planet) {//{{{
+	/**
+	 * PLANETRADIUS - return planet radius according to planetary body name
+	 *
+	 * Usage:
+	 *     radius = planetradius(planet);
+	 *
+	 * Examples:
+	 * earthradius = planetradius('earth');
+	 */
+
+	let radius = 0;
+	if (planet === 'earth') {
+		radius = 6.371012e6;
+	} else if (planet === 'europa') {
+		radius = 1.5008e6;
+	} else {
+		error('planet type ' + planet + ' not supported yet!');
+	}
+} //}}}
Index: /issm/trunk/src/m/interp/averaging.m
===================================================================
--- /issm/trunk/src/m/interp/averaging.m	(revision 26743)
+++ /issm/trunk/src/m/interp/averaging.m	(revision 26744)
@@ -73,5 +73,5 @@
 linesize=rep*numberofelements;
 
-%update weights that holds the volume of all the element holding the node i
+%update weights that hold the volume of all the element holding the node i
 weights=sparse(line,ones(linesize,1),repmat(areas,rep,1),numberofnodes,1);
 
Index: /issm/trunk/src/m/interp/averaging.py
===================================================================
--- /issm/trunk/src/m/interp/averaging.py	(revision 26743)
+++ /issm/trunk/src/m/interp/averaging.py	(revision 26744)
@@ -29,8 +29,8 @@
     """
 
-    if len(data) != md.mesh.numberofelements and len(data) != md.mesh.numberofvertices:
+    if (len(data) != md.mesh.numberofelements) & (len(data) != md.mesh.numberofvertices):
         raise Exception('averaging error message: data not supported yet')
-    if md.mesh.dimension() == 3 and layer != 0:
-        if layer <= 0 or layer > md.mesh.numberoflayers:
+    if (md.mesh.dimension() == 3) & (layer != 0):
+        if (layer <= 0) | (layer > md.mesh.numberoflayers):
             raise ValueError('layer should be between 1 and md.mesh.numberoflayers')
     else:
@@ -39,9 +39,9 @@
     # Initialization
     if layer == 0:
-        weights = np.zeros(md.mesh.numberofvertices, )
-        data = data.flatten(1)
+        weights = np.zeros((md.mesh.numberofvertices, ))
+        data = np.asarray(data).flatten()
     else:
-        weights = np.zeros(md.mesh.numberofvertices2d, )
-        data = data[(layer - 1) * md.mesh.numberofvertices2d + 1:layer * md.mesh.numberofvertices2d, :]
+        weights = np.zeros((md.mesh.numberofvertices2d, ))
+        data = data[(layer - 1) * md.mesh.numberofvertices2d + 1:layer * md.mesh.numberofvertices2d - 1, :]
 
     # Load some variables (it is much faster if the variables are loaded from md once for all)
@@ -56,5 +56,5 @@
 
     # Build some variables
-    if md.mesh.dimension() == 3 and layer == 0:
+    if (md.mesh.dimension() == 3) & (layer == 0):
         rep = 6
         areas = GetAreas(index, md.mesh.x, md.mesh.y, md.mesh.z)
@@ -67,16 +67,16 @@
 
     index = index - 1  # Python indexes from zero
-    line = index.flatten(1)
+    line=index.T.flatten()
     areas = np.vstack(areas).reshape(-1, )
-    summation = 1. / rep * np.ones(rep, )
+    summation = 1. / rep * np.ones((rep,1) )
     linesize = rep * numberofelements
 
-    # Update weights that holds the volume of all the element holding the node i
-    weights = csc_matrix((np.tile(areas, (rep, 1)).reshape(-1, ), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
+    # Update weights that hold the volume of all the element holding the node i
+    weights = csc_matrix((np.tile(areas, (1, rep)).reshape(-1,), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
 
     # Initialization
     if len(data) == numberofelements:
-        average_node = csc_matrix((np.tile(areas * data, (rep, 1)).reshape(-1, ), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
-        average_node = average_node / weights
+        average_node = csc_matrix((np.tile(np.multiply(areas,data), (1, rep)).reshape(-1, ), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
+        average_node = np.divide(average_node,weights)
         average_node = csc_matrix(average_node)
     else:
@@ -85,11 +85,11 @@
     # Loop over iteration
     for i in np.arange(1, iterations + 1):
-        average_el = np.asarray(np.dot(average_node.todense()[index].reshape(numberofelements, rep), np.vstack(summation))).reshape(-1, )
-        average_node = csc_matrix((np.tile(areas * average_el.reshape(-1), (rep, 1)).reshape(-1, ), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
-        average_node = average_node / weights
+        average_el = np.asarray(average_node.todense()[index].reshape(numberofelements, rep)*summation).reshape(-1, )
+        average_node = csc_matrix((np.tile(np.multiply(areas,average_el.reshape(-1)), (1, rep)).reshape(-1, ), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
+        average_node = np.divide(average_node,weights)
         average_node = csc_matrix(average_node)
 
     # Return output as a full matrix (C code does not like sparse matrices)
-    average = np.asarray(average_node.todense()).reshape(-1, )
+    average = np.expand_dims(np.asarray(average_node.todense()).reshape(-1, ),axis=1)
 
     return average
Index: /issm/trunk/src/m/io/loadvars.py
===================================================================
--- /issm/trunk/src/m/io/loadvars.py	(revision 26743)
+++ /issm/trunk/src/m/io/loadvars.py	(revision 26744)
@@ -52,5 +52,5 @@
         raise TypeError("Unrecognized input arguments.")
 
-    onlylast = True
+    onlylast = False
 
     for key, value in kwargs.items():
@@ -88,17 +88,17 @@
             #==== First we create the model structure  {{{
             if debug:
-                print(' - Now treating classtype {}'.format(mod))
-            if np.size(classtree[mod]) > 1:
+                print(' ==== Now treating classtype {}'.format(mod))
+            if mod not in classtree.keys():
+                print("WARNING: {} classe is not in the model anymore and will be omited.".format(mod))
+            elif np.size(classtree[mod]) > 1:
                 # this points to a subclass (results.TransientSolution for example)
                 curclass = NCFile.groups[classtree[mod][0]].groups[classtree[mod][1]]
                 if debug:
-                    print("===> {} is of class {}".format(mod, classtype[mod]))
+                    print("    ==> {} is of class {}".format(mod, classtype[mod]))
                 if classtype[mod][0] == 'results.solutionstep':  #Treating results {{{
                     keylist = [key for key in curclass.groups]
-                    # this is related to the old structure of NC files where every steps of results had its own group
                     #that is the current treatment
                     #here we have a more NC approach with time being a dimension
                     listtype = split(r'\.', classtype[mod][0])[0]
-                    print("listtype is {}".format(listtype))
                     if len(NCFile.dimensions['Time']) == 1:
                         nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = getattr(classtype[mod][1], listtype)()
@@ -110,12 +110,31 @@
                             Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]]
                         else:
-                            #nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [getattr(classtype[mod][1], listtype)() for i in range(max(1, len(NCFile.dimensions['Time'])))]
-                            #Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]][:]
                             setattr(nvdict['md'].__dict__[classtree[mod][0]], classtree[mod][1], getattr(classtype[mod][1], 'solution')([]))
                             for i in range(max(1, len(NCFile.dimensions['Time']))):
                                 nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]].steps.append(getattr(classtype[mod][1], 'solutionstep')())
                             Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]][:]
-                            print(nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]].steps[0])
                 # }}}
+                elif "results" in mod and classtype[mod][0] == 'list':  #this is the old style of results where every step has a group{{{
+                    keylist = [key for key in curclass.groups]
+                    #one group per step so use that in place of time
+                    stepnum = len(NCFile.groups[classtree[mod][0]].groups[classtree[mod][1]].groups)
+                    #we need to redefine classtype from list to result
+                    listtype = 'results'
+                    classtype[mod].append(__import__(listtype))
+                    if stepnum == 1:
+                        nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = getattr(classtype[mod][1], listtype)()
+                        Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]]
+                    else:
+                        if onlylast:   #we load only the last result to save on time and memory
+                            nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [getattr(classtype[mod][1], listtype)()]
+                            Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]]
+                        else:
+                            #nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [getattr(classtype[mod][1], listtype)() for i in range(max(1, len(NCFile.dimensions['Time'])))]
+                            #Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]][:]
+                            setattr(nvdict['md'].__dict__[classtree[mod][0]], classtree[mod][1], getattr(classtype[mod][1], 'solution')([]))
+                            for i in range(max(1, stepnum)):
+                                nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]].steps.append(getattr(classtype[mod][1], 'solutionstep')())
+                            Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]][:]
+                    #}}}
                 elif classtype[mod][0] == 'massfluxatgate':  #this is for output definitions {{{
                     defname = split('Output|[0-9]+', classtree[mod][1])[1] + 's'
@@ -126,9 +145,9 @@
                 else:
                     if debug:
-                        print("Using the default for md.{}.{}, is that right??".format(classtree[mod][0], classtree[mod][1]))
+                        print("    Using the default for md.{}.{}, is that right??".format(classtree[mod][0], classtree[mod][1]))
                     try:
                         modulename = split(r'\.', classtype[mod][0])[0]
                         if debug:
-                            print("trying to import {} from {}".format(classtype[mod][0], modulename))
+                            print("    trying to import {} from {}".format(classtype[mod][0], modulename))
                         nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = getattr(classtype[mod][1], modulename)()
                     except AttributeError:
@@ -141,68 +160,75 @@
                 Tree = nvdict['md'].__dict__[classtree[mod][0]]
             if debug:
-                print("for {} Tree is a {}".format(mod, Tree.__class__.__name__))
+                print("    for {} Tree is a {} with len {}".format(mod, Tree.__class__.__name__, len(curclass.groups)))
             # }}}
             #==== Then we populate it {{{
-            for i in range(0, max(1, len(curclass.groups))):
-                if len(curclass.groups) > 0:
-                    listclass = curclass.groups[keylist[i]]
+            #for i in range(0, max(1, len(curclass.groups))):
+            if len(curclass.groups) > 0:  #that is presumably only for old style NC where each result step had its own group
+                if onlylast:
+                    groupclass = [curclass.groups[keylist[len(curclass.groups) - 1]]]
                 else:
-                    listclass = curclass
-                #==== We deal with Variables {{{
+                    groupclass = [curclass.groups[key] for key in keylist]
+            else:
+                groupclass = [curclass]
+            #==== We deal with Variables {{{
+            for groupindex, listclass in enumerate(groupclass):
                 for var in listclass.variables:
-                    if debug:
-                        print("treating var {}".format(var))
                     if var not in ['errlog', 'outlog']:
                         varval = listclass.variables[str(var)]
                         vardim = varval.ndim
+                        if debug:
+                            print("    ==> treating var {} of dimension {}".format(var, vardim))
                         #There is a special treatment for results to account for its specific structure
                         #that is the new export version where time is a named dimension
                         NewFormat = 'Time' in NCFile.dimensions
-                        if type(Tree) == list and NewFormat:
+                        if type(Tree) == list:  # and NewFormat:
                             if onlylast:
-                                if vardim == 1:
-                                    Tree[0].__dict__[str(var)] = varval[-1].data
-                                elif vardim == 2:
-                                    Tree[0].__dict__[str(var)] = varval[-1, :].data
-                                elif vardim == 3:
-                                    Tree[0].__dict__[str(var)] = varval[-1, :, :].data
+                                if NewFormat:
+                                    if vardim == 1:
+                                        Tree[0].__dict__[str(var)] = varval[-1].data
+                                    elif vardim == 2:
+                                        Tree[0].__dict__[str(var)] = varval[-1, :].data
+                                    elif vardim == 3:
+                                        Tree[0].__dict__[str(var)] = varval[-1, :, :].data
+                                    else:
+                                        print('table dimension greater than 3 not implemented yet')
+                                else:  #old format had step sorted in difeerent group so last group is last time
+                                    Tree[0].__dict__[str(var)] = varval[:].data
+                            else:
+                                if NewFormat:
+                                    incomplete = 'Time' not in varval.dimensions and NewFormat
+                                    if incomplete:
+                                        chosendim = varval.dimensions[0]
+                                        timelist = np.arange(0, len(NCFile.dimensions[chosendim]))
+                                        print('WARNING, {} is not present on every times, we chose {}({}) as the dimension to write it with'.format(var, chosendim, len(NCFile.dimensions[chosendim])))
+                                    else:
+                                        timelist = np.arange(0, len(NCFile.dimensions['Time']))
+                                    for t in timelist:
+                                        if debug:
+                                            print("filing step {} for {}".format(t, var))
+                                        if vardim == 0:
+                                            Tree[t].__dict__[str(var)] = varval[:].data
+                                        elif vardim == 1:
+                                            Tree[t].__dict__[str(var)] = varval[t].data
+                                        elif vardim == 2:
+                                            Tree[t].__dict__[str(var)] = varval[t, :].data
+                                        elif vardim == 3:
+                                            Tree[t].__dict__[str(var)] = varval[t, :, :].data
+                                        else:
+                                            print('table dimension greater than 3 not implemented yet')
                                 else:
-                                    print('table dimension greater than 3 not implemented yet')
-                            else:
-                                incomplete = 'Time' not in varval.dimensions
-                                if incomplete:
-                                    chosendim = varval.dimensions[0]
-                                    timelist = np.arange(0, len(NCFile.dimensions[chosendim]))
-                                    print('WARNING, {} is not present on every times, we chose {}({}) as the dimension to write it with'.format(var, chosendim, len(NCFile.dimensions[chosendim])))
-                                else:
-                                    timelist = np.arange(0, len(NCFile.dimensions['Time']))
-                                for t in timelist:
-                                    if vardim == 0:
-                                        Tree[t].__dict__[str(var)] = varval[:].data
-                                    if vardim == 1:
-                                        Tree[t].__dict__[str(var)] = varval[t].data
-                                    elif vardim == 2:
-                                        Tree[t].__dict__[str(var)] = varval[t, :].data
-                                    elif vardim == 3:
-                                        Tree[t].__dict__[str(var)] = varval[t, :, :].data
-                                    else:
-                                        print('table dimension greater than 3 not implemented yet')
+                                    if debug:
+                                        print("filing step {} for {}".format(groupindex, var))
+                                    Tree[groupindex].__dict__[str(var)] = varval[:].data
                         else:
                             if vardim == 0:  #that is a scalar
-                                if type(Tree) == list:
-                                    t = indexlist[i]
-                                    if listtype == 'dict':
-                                        Tree[t][str(var)] = varval[0].data
-                                    else:
-                                        Tree[t].__dict__[str(var)] = varval[0].data
+                                if str(varval[0]) == '':  #no value
+                                    Tree.__dict__[str(var)] = []
+                                elif varval[0] == 'True':  #treatin bool
+                                    Tree.__dict__[str(var)] = True
+                                elif varval[0] == 'False':  #treatin bool
+                                    Tree.__dict__[str(var)] = False
                                 else:
-                                    if str(varval[0]) == '':  #no value
-                                        Tree.__dict__[str(var)] = []
-                                    elif varval[0] == 'True':  #treatin bool
-                                        Tree.__dict__[str(var)] = True
-                                    elif varval[0] == 'False':  #treatin bool
-                                        Tree.__dict__[str(var)] = False
-                                    else:
-                                        Tree.__dict__[str(var)] = varval[0].item()
+                                    Tree.__dict__[str(var)] = varval[0].item()
 
                             elif vardim == 1:  #that is a vector
@@ -215,24 +241,17 @@
                                         Tree.__dict__[str(var)] = [str(vallue) for vallue in varval[:]]
                                 else:
-                                    if type(Tree) == list:
-                                        t = indexlist[i]
-                                        if listtype == 'dict':
-                                            Tree[t][str(var)] = varval[:].data
-                                        else:
-                                            Tree[t].__dict__[str(var)] = varval[:].data
-                                    else:
-                                        try:
-                                            #some thing specifically require a list
-                                            mdtype = type(Tree.__dict__[str(var)])
-                                        except KeyError:
-                                            mdtype = float
-                                        if mdtype == list:
-                                            Tree.__dict__[str(var)] = [mdval for mdval in varval[:]]
-                                        else:
-                                            Tree.__dict__[str(var)] = varval[:].data
+                                    try:
+                                        #some thing specifically require a list
+                                        mdtype = type(Tree.__dict__[str(var)])
+                                    except KeyError:
+                                        mdtype = float
+                                    if mdtype == list:
+                                        Tree.__dict__[str(var)] = [mdval for mdval in varval[:]]
+                                    else:
+                                        Tree.__dict__[str(var)] = varval[:].data
 
                             elif vardim == 2:
                                 #dealling with dict
-                                if varval.dtype == str:  #that is for toolkits wich needs to be ordered
+                                if varval.dtype == str:  #that is for dictionaries
                                     if any(varval[:, 0] == 'toolkit'):  #toolkit definition have to be first
                                         Tree.__dict__[str(var)] = OrderedDict([('toolkit', str(varval[np.where(varval[:, 0] == 'toolkit')[0][0], 1]))])
@@ -240,4 +259,8 @@
                                         strings2 = [str(arg[1]) for arg in varval if arg[0] != 'toolkits']
                                         Tree.__dict__[str(var)].update(list(zip(strings1, strings2)))
+                                    else:
+                                        strings1 = [str(arg[0]) for arg in varval]
+                                        strings2 = [str(arg[1]) for arg in varval]
+                                        Tree.__dict__[str(var)] = OrderedDict(list(zip(strings1, strings2)))
                                 else:
                                     if type(Tree) == list:
@@ -250,38 +273,23 @@
                                         Tree.__dict__[str(var)] = varval[:, :].data
                             elif vardim == 3:
-                                if type(Tree) == list:
-                                    t = int(indexlist[i])
-                                    if listtype == 'dict':
-                                        Tree[t][str(var)] = varval[:, :, :].data
-                                    else:
-                                        Tree[t].__dict__[str(var)] = varval[:, :, :]
-                                else:
-                                    Tree.__dict__[str(var)] = varval[:, :, :].data
+                                Tree.__dict__[str(var)] = varval[:, :, :].data
                             else:
                                 print('table dimension greater than 3 not implemented yet')
-                    # }}}
+                # }}}
                 #==== And with atribute {{{
                 for attr in listclass.ncattrs():
                     if debug:
-                        print("treating attribute {}".format(attr))
+                        print("      ==> treating attribute {}".format(attr))
                     if attr != 'classtype':  #classtype is for treatment, don't get it back
                         attribute = str(attr).swapcase()  #there is a reason for swapcase, no sure what it isanymore
                         if attr == 'VARNAME':
                             attribute = 'name'
-                        if type(Tree) == list and NewFormat:
+                        if type(Tree) == list:
                             if debug:
-                                print("printing with index 0")
+                                print("        printing with index 0")
                             if listtype == 'dict':
                                 Tree[0][attribute] = str(listclass.getncattr(attr))
                             else:
                                 Tree[0].__dict__[attribute] = str(listclass.getncattr(attr))
-                        elif type(Tree) == list:
-                            t = int(indexlist[i])
-                            if debug:
-                                print("printing with index {]".format(t))
-                            if listtype == 'dict':
-                                Tree[t][attribute] = str(listclass.getncattr(attr))
-                            else:
-                                Tree[t].__dict__[attribute] = str(listclass.getncattr(attr))
                         else:
                             Tree.__dict__[attribute] = str(listclass.getncattr(attr))
@@ -320,5 +328,4 @@
                     try:
                         modulename = split(r'\.', class_dict[classe][0])[0]
-                        #class_dict[classe].append(__import__(class_dict[classe][0]))
                         class_dict[classe].append(__import__(modulename))
                     except ModuleNotFoundError:
@@ -334,6 +341,9 @@
                 if class_dict[classe][0] not in ['dict', 'list', 'cell']:
                     modulename = split(r'\.', class_dict[classe][0])[0]
-                    class_dict[classe].append(__import__(modulename))
-                    class_tree[classe] = [group, ]
+                    if modulename == "giaivins":
+                        print("WARNING: module {} does not exist anymore and is skipped".format(modulename))
+                    else:
+                        class_dict[classe].append(__import__(modulename))
+                        class_tree[classe] = [group, ]
             except AttributeError:
                 print(('group {} is empty'.format(group)))
Index: /issm/trunk/src/m/materials/cuffey.py
===================================================================
--- /issm/trunk/src/m/materials/cuffey.py	(revision 26743)
+++ /issm/trunk/src/m/materials/cuffey.py	(revision 26744)
@@ -3,17 +3,17 @@
 
 def cuffey(temperature):
-    """
-    CUFFEY - calculates ice rigidity as a function of temperature
+    """CUFFEY - calculates ice rigidity as a function of temperature
 
-       rigidity (in s^(1 / 3)Pa) is the flow law parameter in the flow law sigma = B * e(1 / 3)
-        (Cuffey and Paterson, p75).
-       temperature is in Kelvin degrees
+    rigidity (in s^(1/3)Pa) is the flow law parameter in the flow law 
+    sigma = B * e(1/3) (Cuffey and Paterson, p75).
 
-       Usage:
-          rigidity = cuffey(temperature)
+    temperature is in Kelvin degrees
+
+    Usage:
+        rigidity = cuffey(temperature)
     """
 
-    if np.any(temperature < 0.):
-        raise RuntimeError("input temperature should be in Kelvin (positive)")
+    if np.any(temperature < 0.0):
+        raise RuntimeError('input temperature should be in Kelvin (positive)')
 
     if np.ndim(temperature) == 2:
@@ -28,39 +28,39 @@
     pos = np.nonzero(T <= -45)
     if len(pos):
-        rigidity[pos] = 10**8 * (-0.000396645116301 * (T[pos] + 50)**3 + 0.013345579471334 * (T[pos] + 50)**2 - 0.356868703259105 * (T[pos] + 50) + 7.272363035371383)
+        rigidity[pos] = pow(10, 8) * (-0.000396645116301 * (T[pos] + 50)**3 + 0.013345579471334 * (T[pos] + 50)**2 - 0.356868703259105 * (T[pos] + 50) + 7.272363035371383)
     pos = np.nonzero(np.logical_and(-45 <= T, T < -40))
     if len(pos):
-        rigidity[pos] = 10**8 * (-0.000396645116301 * (T[pos] + 45)**3 + 0.007395902726819 * (T[pos] + 45)**2 - 0.253161292268336 * (T[pos] + 45) + 5.772078366321591)
+        rigidity[pos] = pow(10, 8) * (-0.000396645116301 * (T[pos] + 45)**3 + 0.007395902726819 * (T[pos] + 45)**2 - 0.253161292268336 * (T[pos] + 45) + 5.772078366321591)
     pos = np.nonzero(np.logical_and(-40 <= T, T < -35))
     if len(pos):
-        rigidity[pos] = 10**8 * (0.000408322072669 * (T[pos] + 40)**3 + 0.001446225982305 * (T[pos] + 40)**2 - 0.208950648722716 * (T[pos] + 40) + 4.641588833612773)
+        rigidity[pos] = pow(10, 8) * (0.000408322072669 * (T[pos] + 40)**3 + 0.001446225982305 * (T[pos] + 40)**2 - 0.208950648722716 * (T[pos] + 40) + 4.641588833612773)
     pos = np.nonzero(np.logical_and(-35 <= T, T < -30))
     if len(pos):
-        rigidity[pos] = 10**8 * (-0.000423888728124 * (T[pos] + 35)**3 + 0.007571057072334 * (T[pos] + 35)**2 - 0.163864233449525 * (T[pos] + 35) + 3.684031498640382)
+        rigidity[pos] = pow(10, 8) * (-0.000423888728124 * (T[pos] + 35)**3 + 0.007571057072334 * (T[pos] + 35)**2 - 0.163864233449525 * (T[pos] + 35) + 3.684031498640382)
     pos = np.nonzero(np.logical_and(-30 <= T, T < -25))
     if len(pos):
-        rigidity[pos] = 10**8 * (0.000147154327025 * (T[pos] + 30)**3 + 0.001212726150476 * (T[pos] + 30)**2 - 0.119945317335478 * (T[pos] + 30) + 3.001000667185614)
+        rigidity[pos] = pow(10, 8) * (0.000147154327025 * (T[pos] + 30)**3 + 0.001212726150476 * (T[pos] + 30)**2 - 0.119945317335478 * (T[pos] + 30) + 3.001000667185614)
     pos = np.nonzero(np.logical_and(-25 <= T, T < -20))
     if len(pos):
-        rigidity[pos] = 10**8 * (-0.000193435838672 * (T[pos] + 25)**3 + 0.003420041055847 * (T[pos] + 25)**2 - 0.096781481303861 * (T[pos] + 25) + 2.449986525148220)
+        rigidity[pos] = pow(10, 8) * (-0.000193435838672 * (T[pos] + 25)**3 + 0.003420041055847 * (T[pos] + 25)**2 - 0.096781481303861 * (T[pos] + 25) + 2.449986525148220)
     pos = np.nonzero(np.logical_and(-20 <= T, T < -15))
     if len(pos):
-        rigidity[pos] = 10**8 * (0.000219771255067 * (T[pos] + 20)**3 + 0.000518503475772 * (T[pos] + 20)**2 - 0.077088758645767 * (T[pos] + 20) + 2.027400665191131)
+        rigidity[pos] = pow(10, 8) * (0.000219771255067 * (T[pos] + 20)**3 + 0.000518503475772 * (T[pos] + 20)**2 - 0.077088758645767 * (T[pos] + 20) + 2.027400665191131)
     pos = np.nonzero(np.logical_and(-15 <= T, T < -10))
     if len(pos):
-        rigidity[pos] = 10**8 * (-0.000653438900191 * (T[pos] + 15)**3 + 0.003815072301777 * (T[pos] + 15)**2 - 0.055420879758021 * (T[pos] + 15) + 1.682390865739973)
+        rigidity[pos] = pow(10, 8) * (-0.000653438900191 * (T[pos] + 15)**3 + 0.003815072301777 * (T[pos] + 15)**2 - 0.055420879758021 * (T[pos] + 15) + 1.682390865739973)
     pos = np.nonzero(np.logical_and(-10 <= T, T < -5))
     if len(pos):
-        rigidity[pos] = 10**8 * (0.000692439419762 * (T[pos] + 10)**3 - 0.005986511201093 * (T[pos] + 10)**2 - 0.066278074254598 * (T[pos] + 10) + 1.418983411970382)
+        rigidity[pos] = pow(10, 8) * (0.000692439419762 * (T[pos] + 10)**3 - 0.005986511201093 * (T[pos] + 10)**2 - 0.066278074254598 * (T[pos] + 10) + 1.418983411970382)
     pos = np.nonzero(np.logical_and(-5 <= T, T < -2))
     if len(pos):
-        rigidity[pos] = 10**8 * (-0.000132282004110 * (T[pos] + 5)**3 + 0.004400080095332 * (T[pos] + 5)**2 - 0.074210229783403 * (T[pos] + 5) + 1.024485188140279)
+        rigidity[pos] = pow(10, 8) * (-0.000132282004110 * (T[pos] + 5)**3 + 0.004400080095332 * (T[pos] + 5)**2 - 0.074210229783403 * (T[pos] + 5) + 1.024485188140279)
     pos = np.nonzero(-2 <= T)
     if len(pos):
-        rigidity[pos] = 10**8 * (-0.000132282004110 * (T[pos] + 2)**3 + 0.003209542058346 * (T[pos] + 2)**2 - 0.051381363322371 * (T[pos] + 2) + 0.837883605537096)
+        rigidity[pos] = pow(10, 8) * (-0.000132282004110 * (T[pos] + 2)**3 + 0.003209542058346 * (T[pos] + 2)**2 - 0.051381363322371 * (T[pos] + 2) + 0.837883605537096)
 
-    #Now make sure that rigidity is positive
+    # Now make sure that rigidity is positive
     pos = np.nonzero(rigidity < 0)
-    rigidity[pos] = 1**6
+    rigidity[pos] = pow(1, 6)
 
     return rigidity
Index: /issm/trunk/src/m/materials/nye.m
===================================================================
--- /issm/trunk/src/m/materials/nye.m	(revision 26743)
+++ /issm/trunk/src/m/materials/nye.m	(revision 26744)
@@ -13,11 +13,11 @@
 	if (ice_type==1)
 		if (any(temperature>200&temperature<220))
-			warning('CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.\nLook at indexes: %s', mat2str(find(temperature>200 & temperature<220))');
+			warning('nye.m: CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.\nLook at indexes: %s', mat2str(find(temperature>200 & temperature<220))');
 		end
 		if (any(temperature>=220))
-			warning('CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.\nLook at indexes: %s', mat2str(find(temperature>=220))');
+			warning('nye.m: CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.\nLook at indexes: %s', mat2str(find(temperature>=220))');
 		end
 	elseif ((ice_type==2)&&(any(temperature>273.15)))
-		warning('H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.\nLook at indexes: %s', mat2str(find(temperature>273.15))');
+		warning('nye.m: H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.\nLook at indexes: %s', mat2str(find(temperature>273.15))');
 	end
 
Index: /issm/trunk/src/m/materials/nye.py
===================================================================
--- /issm/trunk/src/m/materials/nye.py	(revision 26743)
+++ /issm/trunk/src/m/materials/nye.py	(revision 26744)
@@ -1,15 +1,13 @@
 import numpy as np
-from warnings import warn
 
 
 def nye(temperature, ice_type):
+    """NYE - figure out the rigidity of ice (either CO2 or H2O) for a given 
+    temperature rigidity (in s^(1/n)Pa) is the flow law parameter in the flow 
+    law sigma=B*e(1/n) (Nye, p2000). Temperature is in Kelvin degrees.
+
+    Usage:
+        rigidity=nye(temperature,ice_type) % ice_type = 1: CO2 ice // ice_type = 2: H2O ice
     """
-    NYE - figure out the rigidity of ice (either CO2 or H2O) for a given temperature
-        rigidity (in s^(1/n)Pa) is the flow law parameter in the flow law sigma=B*e(1/n) (Nye, p2000).
-        temperature is in Kelvin degrees
-
-   Usage:
-           rigidity=nye(temperature,ice_type) % ice_type = 1: CO2 ice // ice_type = 2: H2O ice
-        """
 
     # Declaring temperature and rigidity arrays
@@ -26,10 +24,10 @@
         for i in range(len(T)):
             if (200 < T[i] < 220):
-                warn('CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.')
+                print('Warning: nye.py: CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.')
             break
         if ((T >= 220).any()):
-            warn('CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.')
+            print('Warning: nye.py: CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.')
     elif (ice_type == 2) and ((T > 273.15).any()):
-        warn('H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.')
+        print('Warning: nye.py: H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.')
 
     Rg = 8.3144598              # J mol^-1 K^-1
Index: /issm/trunk/src/m/materials/paterson.py
===================================================================
--- /issm/trunk/src/m/materials/paterson.py	(revision 26743)
+++ /issm/trunk/src/m/materials/paterson.py	(revision 26744)
@@ -3,16 +3,17 @@
 
 def paterson(temperature):
-    """
-    PATERSON - figure out the rigidity of ice for a given temperature
+    """PATERSON - figure out the rigidity of ice for a given temperature
 
-       rigidity (in s^(1 / 3)Pa) is the flow law paramter in the flow law sigma = B * e(1 / 3) (Paterson, p97).
-       temperature is in Kelvin degrees
+    rigidity (in s^(1/3)Pa) is the flow law paramter in the flow law 
+    sigma = B * e(1/3) (Paterson, p97).
 
-       Usage:
-          rigidity = paterson(temperature)
+    temperature is in Kelvin degrees
+
+    Usage:
+        rigidity = paterson(temperature)
     """
 
-    if np.any(temperature < 0.):
-        raise RuntimeError("input temperature should be in Kelvin (positive)")
+    if np.any(temperature < 0.0):
+        raise RuntimeError('input temperature should be in Kelvin (positive)')
 
     if np.ndim(temperature) == 2:
@@ -24,5 +25,5 @@
         T = temperature - 273.15
 
-    #The routine below is equivalent to:
+    # The routine below is equivalent to:
 
     # n = 3; T = temperature-273
@@ -40,40 +41,40 @@
     pos1 = np.nonzero(T <= -45)[0]
     if len(pos1):
-        rigidity[pos1] = 10**8 * (-0.000292866376675 * (T[pos1] + 50)**3 + 0.011672640664130 * (T[pos1] + 50)**2 - 0.325004442485481 * (T[pos1] + 50) + 6.524779401948101)
+        rigidity[pos1] = pow(10, 8) * (-0.000292866376675 * (T[pos1] + 50)**3 + 0.011672640664130 * (T[pos1] + 50)**2 - 0.325004442485481 * (T[pos1] + 50) + 6.524779401948101)
     pos2 = np.nonzero(np.logical_and(-45 <= T, T < -40))[0]
     if len(pos2):
-        rigidity[pos2] = 10**8 * (-0.000292866376675 * (T[pos2] + 45)**3 + 0.007279645014004 * (T[pos2] + 45)**2 - 0.230243014094813 * (T[pos2] + 45) + 5.154964909039554)
+        rigidity[pos2] = pow(10, 8) * (-0.000292866376675 * (T[pos2] + 45)**3 + 0.007279645014004 * (T[pos2] + 45)**2 - 0.230243014094813 * (T[pos2] + 45) + 5.154964909039554)
     pos3 = np.nonzero(np.logical_and(-40 <= T, T < -35))[0]
     if len(pos3):
-        rigidity[pos3] = 10**8 * (0.000072737147457 * (T[pos3] + 40)**3 + 0.002886649363879 * (T[pos3] + 40)**2 - 0.179411542205399 * (T[pos3] + 40) + 4.149132666831214)
+        rigidity[pos3] = pow(10, 8) * (0.000072737147457 * (T[pos3] + 40)**3 + 0.002886649363879 * (T[pos3] + 40)**2 - 0.179411542205399 * (T[pos3] + 40) + 4.149132666831214)
     pos4 = np.nonzero(np.logical_and(-35 <= T, T < -30))[0]
     if len(pos4):
-        rigidity[pos4] = 10**8 * (-0.000086144770023 * (T[pos4] + 35)**3 + 0.003977706575736 * (T[pos4] + 35)**2 - 0.145089762507325 * (T[pos4] + 35) + 3.333333333333331)
+        rigidity[pos4] = pow(10, 8) * (-0.000086144770023 * (T[pos4] + 35)**3 + 0.003977706575736 * (T[pos4] + 35)**2 - 0.145089762507325 * (T[pos4] + 35) + 3.333333333333331)
     pos5 = np.nonzero(np.logical_and(-30 <= T, T < -25))[0]
     if len(pos5):
-        rigidity[pos5] = 10**8 * (-0.000043984685769 * (T[pos5] + 30)**3 + 0.002685535025386 * (T[pos5] + 30)**2 - 0.111773554501713 * (T[pos5] + 30) + 2.696559088937191)
+        rigidity[pos5] = pow(10, 8) * (-0.000043984685769 * (T[pos5] + 30)**3 + 0.002685535025386 * (T[pos5] + 30)**2 - 0.111773554501713 * (T[pos5] + 30) + 2.696559088937191)
     pos6 = np.nonzero(np.logical_and(-25 <= T, T < -20))[0]
     if len(pos6):
-        rigidity[pos6] = 10**8 * (-0.000029799523463 * (T[pos6] + 25)**3 + 0.002025764738854 * (T[pos6] + 25)**2 - 0.088217055680511 * (T[pos6] + 25) + 2.199331606342181)
+        rigidity[pos6] = pow(10, 8) * (-0.000029799523463 * (T[pos6] + 25)**3 + 0.002025764738854 * (T[pos6] + 25)**2 - 0.088217055680511 * (T[pos6] + 25) + 2.199331606342181)
     pos7 = np.nonzero(np.logical_and(-20 <= T, T < -15))[0]
     if len(pos7):
-        rigidity[pos7] = 10**8 * (0.000136920904777 * (T[pos7] + 20)**3 + 0.001578771886910 * (T[pos7] + 20)**2 - 0.070194372551690 * (T[pos7] + 20) + 1.805165505978111)
+        rigidity[pos7] = pow(10, 8) * (0.000136920904777 * (T[pos7] + 20)**3 + 0.001578771886910 * (T[pos7] + 20)**2 - 0.070194372551690 * (T[pos7] + 20) + 1.805165505978111)
     pos8 = np.nonzero(np.logical_and(-15 <= T, T < -10))[0]
     if len(pos8):
-        rigidity[pos8] = 10**8 * (-0.000899763781026 * (T[pos8] + 15)**3 + 0.003632585458564 * (T[pos8] + 15)**2 - 0.044137585824322 * (T[pos8] + 15) + 1.510778053489523)
+        rigidity[pos8] = pow(10, 8) * (-0.000899763781026 * (T[pos8] + 15)**3 + 0.003632585458564 * (T[pos8] + 15)**2 - 0.044137585824322 * (T[pos8] + 15) + 1.510778053489523)
     pos9 = np.nonzero(np.logical_and(-10 <= T, T < -5))[0]
     if len(pos9):
-        rigidity[pos9] = 10**8 * (0.001676964325070 * (T[pos9] + 10)**3 - 0.009863871256831 * (T[pos9] + 10)**2 - 0.075294014815659 * (T[pos9] + 10) + 1.268434288203714)
+        rigidity[pos9] = pow(10, 8) * (0.001676964325070 * (T[pos9] + 10)**3 - 0.009863871256831 * (T[pos9] + 10)**2 - 0.075294014815659 * (T[pos9] + 10) + 1.268434288203714)
     pos10 = np.nonzero(np.logical_and(-5 <= T, T < -2))[0]
     if len(pos10):
-        rigidity[pos10] = 10**8 * (-0.003748937622487 * (T[pos10] + 5)**3 + 0.015290593619213 * (T[pos10] + 5)**2 - 0.048160403003748 * (T[pos10] + 5) + 0.854987973338348)
+        rigidity[pos10] = pow(10, 8) * (-0.003748937622487 * (T[pos10] + 5)**3 + 0.015290593619213 * (T[pos10] + 5)**2 - 0.048160403003748 * (T[pos10] + 5) + 0.854987973338348)
     pos11 = np.nonzero(-2 <= T)[0]
     if len(pos11):
-        rigidity[pos11] = 10**8 * (-0.003748937622488 * (T[pos11] + 2)**3 - 0.018449844983174 * (T[pos11] + 2)**2 - 0.057638157095631 * (T[pos11] + 2) + 0.746900791092860)
+        rigidity[pos11] = pow(10, 8) * (-0.003748937622488 * (T[pos11] + 2)**3 - 0.018449844983174 * (T[pos11] + 2)**2 - 0.057638157095631 * (T[pos11] + 2) + 0.746900791092860)
 
     #Now make sure that rigidity is positive
     pos = np.nonzero(rigidity < 0)[0]
     if len(pos):
-        rigidity[pos] = 1.e6
+        rigidity[pos] = 1.0e6
 
     return rigidity
Index: /issm/trunk/src/m/mech/mechanicalproperties.m
===================================================================
--- /issm/trunk/src/m/mech/mechanicalproperties.m	(revision 26743)
+++ /issm/trunk/src/m/mech/mechanicalproperties.m	(revision 26744)
@@ -1,4 +1,4 @@
 function md=mechanicalproperties(md,vx,vy,varargin)
-%MECHANICALPROPERTIES - compute stress and strain rate for a goven velocity
+%MECHANICALPROPERTIES - compute stress and strain rate for a given velocity
 %
 %   this routine computes the components of the (deviatoric) stress tensor,
Index: /issm/trunk/src/m/mech/mechanicalproperties.py
===================================================================
--- /issm/trunk/src/m/mech/mechanicalproperties.py	(revision 26743)
+++ /issm/trunk/src/m/mech/mechanicalproperties.py	(revision 26744)
@@ -5,17 +5,17 @@
 
 def mechanicalproperties(md, vx, vy, **kwargs):
-    """
-    MECHANICALPROPERTIES - compute stress and strain rate for a goven velocity
+    """MECHANICALPROPERTIES - compute stress and strain rate for a given 
+    velocity
 
-   this routine computes the components of the stress tensor
-   strain rate tensor and their respective principal directions.
-   the results are in the model md: md.results
+    This routine computes the components of the stress tensor strain rate 
+    tensor and their respective principal directions. The results are in the 
+    model md: md.results
 
-   Usage:
-      md = mechanicalproperties(md, vx, vy)
+    Usage:
+        md = mechanicalproperties(md, vx, vy)
 
-   Example:
-      md = mechanicalproperties(md, md.initialization.vx, md.initialization.vy)
-      md = mechanicalproperties(md, md.inversion.vx_obs, md.inversion.vy_obs)
+    Example:
+        md = mechanicalproperties(md, md.initialization.vx, md.initialization.vy)
+        md = mechanicalproperties(md, md.inversion.vx_obs, md.inversion.vy_obs)
     """
 
@@ -75,5 +75,5 @@
     #some corrections
     location = np.nonzero(np.logical_and(second_inv == 0, power != 0))
-    nu[location] = 10**18  #arbitrary maximum viscosity to apply where there is no effective shear
+    nu[location] = pow(10, 18) #arbitrary maximum viscosity to apply where there is no effective shear
 
     if 'matice' in md.materials.__module__:
@@ -83,5 +83,5 @@
         nu[location] = B_bar[location]
         location = np.nonzero(np.logical_and(second_inv == 0, power != 0))
-        nu[location] = 10**18
+        nu[location] = pow(10, 18)
     elif 'matdamageice' in md.materials.__module__ and damage is not None:
         print('computing damage-dependent properties!')
Index: /issm/trunk/src/m/mech/steadystateiceshelftemp.py
===================================================================
--- /issm/trunk/src/m/mech/steadystateiceshelftemp.py	(revision 26743)
+++ /issm/trunk/src/m/mech/steadystateiceshelftemp.py	(revision 26744)
@@ -49,5 +49,5 @@
         temperature[pos] = -((Tb[pos] - Ts[pos]) * ki / wi[pos] + Hi[pos] * Tb[pos] - (Hi[pos] * Ts[pos] + (Tb[pos] - Ts[pos]) * ki / wi[pos]) * np.exp(Hi[pos] * wi[pos] / ki)) / (Hi[pos] * (np.exp(Hi[pos] * wi[pos] / ki) - 1))
     except FloatingPointError:
-        print('steadystateiceshelf warning: overflow encountered in multipy / divide / exp, trying another formulation.')
+        print('Warning: steadystateiceshelf.py: overflow encountered in multipy/divide/exp, trying another formulation.')
         temperature[pos] = -(((Tb[pos] - Ts[pos]) * ki / wi[pos] + Hi[pos] * Tb[pos]) / np.exp(Hi[pos] * wi[pos] / ki) - Hi[pos] * Ts[pos] + (Tb[pos] - Ts[pos]) * ki / wi[pos]) / (Hi[pos] * (1 - np.exp(-Hi[pos] * wi[pos] / ki)))
 
Index: /issm/trunk/src/m/mesh/bamg.py
===================================================================
--- /issm/trunk/src/m/mesh/bamg.py	(revision 26743)
+++ /issm/trunk/src/m/mesh/bamg.py	(revision 26744)
@@ -23,47 +23,93 @@
     Available options (for more details see ISSM website http://issm.jpl.nasa.gov/):
 
-    - domain :            followed by an ARGUS file that prescribes the domain outline
-    - holes :             followed by an ARGUS file that prescribes the holes
-    - subdomains :        followed by an ARGUS file that prescribes the list of
-                        subdomains (that need to be inside domain)
-
-    - hmin :              minimum edge length (default is 1.0e - 100)
-    - hmax :              maximum edge length (default is 1.0e100)
-    - hVertices :         imposed edge length for each vertex (geometry or mesh)
-    - hminVertices :      minimum edge length for each vertex (mesh)
-    - hmaxVertices :      maximum edge length for each vertex (mesh)
-
-    - anisomax :          maximum ratio between the smallest and largest edges (default is 1.0e30)
-    - coeff :             coefficient applied to the metric (2 -> twice as many elements, default is 1)
-    - cutoff :            scalar used to compute the metric when metric type 2 or 3 are applied
-    - err :               error used to generate the metric from a field
-    - errg :              geometric error (default is 0.1)
-    - field :             field of the model that will be used to compute the metric
-                                   to apply several fields, use one column per field
-    - gradation :         maximum ratio between two adjacent edges
-    - Hessiantype :       0 -> use double P2 projection (default)
-                            1 -> use Green formula
-    - KeepVertices :      try to keep initial vertices when adaptation is done on an existing mesh (default 1)
-    - NoBoundaryRefinement: do not refine boundary, only follow contour provided (default 0). Allow subdomain boundary refinement though
-    - NoBoundaryRefinementAllBoundaries: do not refine boundary, only follow contour provided (default 0)
-    - maxnbv :            maximum number of vertices used to allocate memory (default is 1.0e6)
-    - maxsubdiv :         maximum subdivision of exisiting elements (default is 10)
-    - metric :            matrix (numberofnodes x 3) used as a metric
-    - Metrictype :        1 -> absolute error          c / (err coeff^2) * Abs(H)        (default)
-                                   2 -> relative error          c / (err coeff^2) * Abs(H) / max(s, cutoff * max(s))
-                                   3 -> rescaled absolute error c / (err coeff^2) * Abs(H) / (smax - smin)
-    - nbjacoby :          correction used by Hessiantype = 1 (default is 1)
-    - nbsmooth :          number of metric smoothing procedure (default is 3)
-    - omega :             relaxation parameter of the smoothing procedure (default is 1.8)
-    - power :             power applied to the metric (default is 1)
-    - splitcorners :      split triangles whuch have 3 vertices on the outline (default is 1)
-    - verbose :           level of verbosity (default is 1)
-
-    - rifts :             followed by an ARGUS file that prescribes the rifts
-    - toltip :            tolerance to move tip on an existing point of the domain outline
-    - tracks :            followed by an ARGUS file that prescribes the tracks that the mesh will stick to
-    - RequiredVertices :  mesh vertices that are required. [x, y, ref]; ref is optional
-    - tol :               if the distance between 2 points of the domain outline is less than tol, they
-                             will be merged
+    - domain :                              followed by an ARGUS file that 
+                                            prescribes the domain outline
+    - holes :                               followed by an ARGUS file that 
+                                            prescribes the holes
+    - subdomains :                          followed by an ARGUS file that 
+                                            prescribes the list of subdomains 
+                                            (that need to be inside domain)
+
+    - hmin :                                minimum edge length (default is 
+                                            1.0e-100)
+    - hmax :                                maximum edge length (default is 
+                                            1.0e100)
+    - hVertices :                           imposed edge length for each vertex 
+                                            (geometry or mesh)
+    - hminVertices :                        minimum edge length for each vertex 
+                                            (mesh)
+    - hmaxVertices :                        maximum edge length for each vertex 
+                                            (mesh)
+
+    - anisomax :                            maximum ratio between the smallest 
+                                            and largest edges (default is 
+                                            1.0e30)
+    - coeff :                               coefficient applied to the metric 
+                                            (2 -> twice as many elements, 
+                                            default is 1)
+    - cutoff :                              scalar used to compute the metric 
+                                            when metric type 2 or 3 are applied
+    - err :                                 error used to generate the metric 
+                                            from a field
+    - errg :                                geometric error (default is 0.1)
+    - field :                               field of the model that will be 
+                                            used to compute the metric to apply 
+                                            several fields, use one column per 
+                                            field
+    - gradation :                           maximum ratio between two adjacent 
+                                            edges
+    - Hessiantype :                         0 -> use double P2 projection 
+                                            (default)
+                                            1 -> use Green formula
+    - KeepVertices :                        try to keep initial vertices when 
+                                            adaptation is done on an existing 
+                                            mesh (default 1)
+    - NoBoundaryRefinement :                do not refine boundary, only follow 
+                                            contour provided (default 0). Allow 
+                                            subdomain boundary refinement 
+                                            though
+    - NoBoundaryRefinementAllBoundaries :   do not refine boundary, only follow 
+                                            contour provided (default 0)
+    - maxnbv :                              maximum number of vertices used to 
+                                            allocate memory (default is 1.0e6)
+    - maxsubdiv :                           maximum subdivision of exisiting 
+                                            elements (default is 10)
+    - metric :                              matrix (numberofnodes x 3) used as 
+                                            a metric
+    - Metrictype :                          1 -> absolute error 
+                                            c/(err coeff^2) * Abs(H) (default)
+                                            2 -> relative error 
+                                            c / (err coeff^2) * Abs(H) / 
+                                            max(s, cutoff * max(s))
+                                            3 -> rescaled absolute error 
+                                            c / (err coeff^2) * Abs(H) / 
+                                            (smax - smin)
+    - nbjacoby :                            correction used by Hessiantype = 1 
+                                            (default is 1)
+    - nbsmooth :                            number of metric smoothing 
+                                            procedure (default is 3)
+    - omega :                               relaxation parameter of the 
+                                            smoothing procedure (default is 
+                                            1.8)
+    - power :                               power applied to the metric 
+                                            (default is 1)
+    - splitcorners :                        split triangles which have 3 
+                                            vertices on the outline (default is 
+                                            1)
+    - verbose :                             level of verbosity (default is 1)
+
+    - rifts :                               followed by an ARGUS file that 
+                                            prescribes the rifts
+    - toltip :                              tolerance to move tip on an 
+                                            existing point of the domain 
+                                            outline
+    - tracks :                              followed by an ARGUS file that 
+                                            prescribes the tracks that the mesh 
+                                            will stick to
+    - RequiredVertices :                    mesh vertices that are required. 
+                                            [x, y, ref]; ref is optional
+    - tol :                                 if the distance between 2 points of 
+                                            the domain outline is less than 
+                                            tol, they will be merged
 
     Examples:
@@ -76,9 +122,9 @@
     """
 
-    #process options
+    # Process options
     options = pairoptions(*args)
     #options = deleteduplicates(options, 1)
 
-    #initialize the structures required as input of Bamg
+    # Initialize the structures required as input of Bamg
     bamg_options = OrderedDict()
     bamg_geometry = bamggeom()
@@ -138,5 +184,5 @@
                         holes = holesfile
                     else:
-                        raise Exception("bamg error message: if 'holes' is a list, its elements must be of type dict or OrderedDict")
+                        raise Exception('bamg error message: if \'holes\' is a list, its elements must be of type dict or OrderedDict')
                 else:
                     holes = holesfile
@@ -144,5 +190,5 @@
                 holes = [holesfile]
             else:
-                raise Exception("'holes' type {} not supported yet".format(type(holesfile)))
+                raise Exception('\'holes\' type {} not supported yet'.format(type(holesfile)))
 
         subdomains = []
@@ -151,5 +197,5 @@
             if type(subdomainsfile) == str:
                 if not os.path.exists(subdomainsfile):
-                    raise IOError("bamg error message: file {} not found".format(subdomainsfile))
+                    raise IOError('bamg error message: file {} not found'.format(subdomainsfile))
 
                 # Read subdomains accoridng to its extension
@@ -166,5 +212,5 @@
                         subdomains = subdomainsfile
                     else:
-                        raise Exception("bamg error message: if 'subdomains' is a list, its elements must be of type dict or OrderedDict")
+                        raise Exception('bamg error message: if \'subdomains\' is a list, its elements must be of type dict or OrderedDict')
                 else:
                     subdomains = subdomainsfile
@@ -172,5 +218,5 @@
                 subdomains = [subdomainsfile]
             else:
-                raise Exception("'subdomains' type {} not supported yet".format(type(subdomainsfile)))
+                raise Exception('\'subdomains\' type {} not supported yet'.format(type(subdomainsfile)))
 
         # Build geometry
@@ -179,5 +225,5 @@
             # Check that the domain is closed
             if (domain[i]['x'][0] != domain[i]['x'][-1] or domain[i]['y'][0] != domain[i]['y'][-1]):
-                raise RuntimeError("bamg error message: all contours provided in ''domain'' should be closed")
+                raise RuntimeError('bamg error message: all contours provided in \'domain\' should be closed')
 
             # Check that all holes are INSIDE the principle domain outline
@@ -185,5 +231,5 @@
                 flags = ContourToNodes(domain[i]['x'], domain[i]['y'], [domain[0]], 0)[0] # NOTE: Down stack call to FetchPythonData requires contour to be a list of struct if we are not passing in a path to a file, hence the odd addressing: '[domain[0]]'
                 if np.any(np.logical_not(flags)):
-                    raise RuntimeError("bamg error message: All holes should be strictly inside the principal domain")
+                    raise RuntimeError('bamg error message: All holes should be strictly inside the principal domain')
 
             # Check orientation
@@ -221,10 +267,10 @@
             # heck that the hole is closed
             if (holes[i]['x'][0] != holes[i]['x'][-1] or holes[i]['y'][0] != holes[i]['y'][-1]):
-                raise RuntimeError("bamg error message: all contours provided in ''hole'' should be closed")
+                raise RuntimeError('bamg error message: all contours provided in \'hole\' should be closed')
 
             # Check that all holes are INSIDE the principal domain (principal domain should be index 0)
             flags = ContourToNodes(holes[i]['x'], holes[i]['y'], [domain[0]], 0)[0] # NOTE: Down stack call to FetchPythonData requires contour to be a list of struct if we are not passing in a path to a file, hence the odd addressing: '[domain[0]]'
             if np.any(np.logical_not(flags)):
-                raise RuntimeError("bamg error message: All holes should be strictly inside the principal domain")
+                raise RuntimeError('bamg error message: All holes should be strictly inside the principal domain')
 
             # Check that hole is correctly oriented
@@ -249,10 +295,10 @@
             # Check that the subdomain is closed
             if (subdomains[i]['x'][0] != subdomains[i]['x'][-1] or subdomains[i]['y'][0] != subdomains[i]['y'][-1]):
-                raise RuntimeError("bamg error message: all contours provided in ''subdomains'' should be closed")
+                raise RuntimeError('bamg error message: all contours provided in \'subdomains\' should be closed')
 
             # Check that all subdomains are INSIDE the principal domain (principal domain should be index 0)
             flags = ContourToNodes(subdomains[i]['x'], subdomains[i]['y'], [domain[0]], 0)[0] # NOTE: Down stack call to FetchPythonData requires contour to be a list of struct if we are not passing in a path to a file, hence the odd addressing: '[domain[0]]'
             if np.any(np.logical_not(flags)):
-                raise RuntimeError("bamg error message: All subdomains should be strictly inside the principal domain")
+                raise RuntimeError('bamg error message: All subdomains should be strictly inside the principal domain')
 
             # Check that subdomain is correctly oriented
@@ -277,5 +323,5 @@
         if options.getfieldvalue('vertical', 0):
             if np.size(options.getfieldvalue('Markers', [])) != np.size(bamg_geometry.Edges, 0):
-                raise RuntimeError('for 2d vertical mesh, ''Markers'' option is required, and should be of size ' + str(np.size(bamg_geometry.Edges, 0)))
+                raise RuntimeError('for 2d vertical mesh, \'Markers\' option is required, and should be of size {}'.format(str(np.size(bamg_geometry.Edges, 0))))
         if np.size(options.getfieldvalue('Markers', [])) == np.size(bamg_geometry.Edges, 0):
             bamg_geometry.Edges[:, 2] = options.getfieldvalue('Markers')
@@ -291,5 +337,5 @@
                 rift = shpread(riftfile)
             else:
-                raise IOError("bamg error message: file '{}' format not supported (.exp or .shp)".format(riftfile))
+                raise IOError('bamg error message: file \'{}\' format not supported (.exp or .shp)'.format(riftfile))
 
             for i in range(len(rift)):
@@ -297,12 +343,12 @@
                 flags = ContourToNodes(rift[i]['x'], rift[i]['y'], [domain[0]], 0)[0] # NOTE: Down stack call to FetchPythonData requires contour to be a list of struct if we are not passing in a path to a file, hence the odd addressing: '[domain[0]]'
                 if np.all(np.logical_not(flags)):
-                    raise RuntimeError("one rift has all its points outside of the domain outline")
+                    raise RuntimeError('one rift has all its points outside of the domain outline')
                 elif np.any(np.logical_not(flags)):
                     # We have LOTS of work to do
-                    print("Rift tip outside of or on the domain has been detected and is being processed...")
+                    print('Rift tip outside of or on the domain has been detected and is being processed...')
 
                     # Check that only one point is outside (for now)
                     if np.sum(np.logical_not(flags).astype(int)) != 1:
-                        raise RuntimeError("bamg error message: only one point outside of the domain is supported at this time")
+                        raise RuntimeError('bamg error message: only one point outside of the domain is supported at this time')
 
                     # Move tip outside to the first position
@@ -314,5 +360,5 @@
                         rift[i]['y'] = np.flipud(rift[i]['y'])
                     else:
-                        raise RuntimeError("bamg error message: only a rift tip can be outside of the domain")
+                        raise RuntimeError('bamg error message: only a rift tip can be outside of the domain')
 
                     # Get coordinate of intersection point
@@ -341,5 +387,5 @@
 
                             if np.min(tipdis) / segdis < options.getfieldvalue('toltip', 0):
-                                print("moving tip-domain intersection point")
+                                print('moving tip-domain intersection point')
 
                                 # Get position of the closer point
@@ -370,5 +416,5 @@
                                 pos = np.nonzero(np.logical_and(bamg_geometry.Edges[:, 0] == i1, bamg_geometry.Edges[:, 1] == i2))[0]
                                 if not pos:
-                                    raise RuntimeError("bamg error message: a problem occurred...")
+                                    raise RuntimeError('bamg error message: a problem occurred...')
                                 bamg_geometry.Edges = np.vstack((
                                     bamg_geometry.Edges[0:pos - 1, :],
@@ -507,7 +553,7 @@
     # Bamg options {{{
     bamg_options['Crack'] = options.getfieldvalue('Crack', 0)
-    bamg_options['anisomax'] = options.getfieldvalue('anisomax', 10.**18)
-    bamg_options['coeff'] = options.getfieldvalue('coeff', 1.)
-    bamg_options['cutoff'] = options.getfieldvalue('cutoff', 10.**-5)
+    bamg_options['anisomax'] = options.getfieldvalue('anisomax', pow(10.0, 18))
+    bamg_options['coeff'] = options.getfieldvalue('coeff', 1.0)
+    bamg_options['cutoff'] = options.getfieldvalue('cutoff', pow(10.0, -5))
     bamg_options['err'] = options.getfieldvalue('err', np.array([[0.01]]))
     bamg_options['errg'] = options.getfieldvalue('errg', 0.1)
@@ -515,12 +561,12 @@
     bamg_options['gradation'] = options.getfieldvalue('gradation', 1.5)
     bamg_options['Hessiantype'] = options.getfieldvalue('Hessiantype', 0)
-    bamg_options['hmin'] = options.getfieldvalue('hmin', 10.**-100)
-    bamg_options['hmax'] = options.getfieldvalue('hmax', 10.**100)
+    bamg_options['hmin'] = options.getfieldvalue('hmin', pow(10.0, -100))
+    bamg_options['hmax'] = options.getfieldvalue('hmax', pow(10.0, 100))
     bamg_options['hminVertices'] = options.getfieldvalue('hminVertices', np.empty((0, 1)))
     bamg_options['hmaxVertices'] = options.getfieldvalue('hmaxVertices', np.empty((0, 1)))
     bamg_options['hVertices'] = options.getfieldvalue('hVertices', np.empty((0, 1)))
     bamg_options['KeepVertices'] = options.getfieldvalue('KeepVertices', 1)
-    bamg_options['maxnbv'] = options.getfieldvalue('maxnbv', 10**6)
-    bamg_options['maxsubdiv'] = options.getfieldvalue('maxsubdiv', 10.)
+    bamg_options['maxnbv'] = options.getfieldvalue('maxnbv', pow(10, 6))
+    bamg_options['maxsubdiv'] = options.getfieldvalue('maxsubdiv', 10.0)
     bamg_options['metric'] = options.getfieldvalue('metric', np.empty((0, 1)))
     bamg_options['Metrictype'] = options.getfieldvalue('Metrictype', 0)
@@ -528,5 +574,5 @@
     bamg_options['nbsmooth'] = options.getfieldvalue('nbsmooth', 3)
     bamg_options['omega'] = options.getfieldvalue('omega', 1.8)
-    bamg_options['power'] = options.getfieldvalue('power', 1.)
+    bamg_options['power'] = options.getfieldvalue('power', 1.0)
     bamg_options['splitcorners'] = options.getfieldvalue('splitcorners', 1)
     bamg_options['verbose'] = options.getfieldvalue('verbose', 1)
@@ -595,7 +641,7 @@
     md.mesh.elementconnectivity = md.mesh.elementconnectivity.astype(int)
 
-    #Check for orphan
+    # Check for orphan
     if np.any(np.logical_not(np.in1d(np.arange(1, md.mesh.numberofvertices + 1), md.mesh.elements.flat))):
-        raise RuntimeError("Output mesh has orphans. Check your Domain and / or RequiredVertices")
+        raise RuntimeError('Output mesh has orphans. Check your Domain and/or RequiredVertices')
 
     return md
@@ -603,8 +649,8 @@
 
 def processgeometry(geom, tol, outline):  # {{{
-    raise RuntimeError("bamg.py::processgeometry is not complete.")
+    raise RuntimeError('bamg.py::processgeometry is not complete.')
 
     # Deal with edges
-    print("Checking Edge crossing...")
+    print('Checking Edge crossing...')
     i = 0
     while (i < np.size(geom.Edges, axis=0)):
@@ -659,5 +705,5 @@
 
     # Check point outside
-    print("Checking for points outside the domain...")
+    print('Checking for points outside the domain...')
     i = 0
     num = 0
@@ -687,5 +733,5 @@
 
     if num:
-        print(("WARNING: %d points outside the domain outline have been removed" % num))
+        print(('WARNING: {} points outside the domain outline have been removed'.format(num)))
 
     """
Index: /issm/trunk/src/m/mesh/planet/gmsh/gmshplanet.js
===================================================================
--- /issm/trunk/src/m/mesh/planet/gmsh/gmshplanet.js	(revision 26744)
+++ /issm/trunk/src/m/mesh/planet/gmsh/gmshplanet.js	(revision 26744)
@@ -0,0 +1,60 @@
+//GMSHPLANET - mesh generation for a sphere. Very specific code for gmsh from $ISSM_DIR/src/demos/simple_geo/sphere.geo
+//
+//   Available options (for more details see ISSM website http://issm.jpl.nasa.gov/):
+//
+//   - radius:             radius of the planet in km
+//   - resolution:         resolution in km
+//   - refine:             provide mesh
+//   - refinemetric:       mesh quantity to specify resolution
+//
+//   Returns 'mesh3dsurface' type mesh
+//
+//   Examples:
+//      md.mesh=gmshplanet('radius',6000,'resolution',100);
+//      md.mesh=gmshplanet('radius',6000,'resolution',100);
+async function gmshplanet(md) {
+	let args = Array.prototype.slice.call(arguments, 1);
+	let options = new pairoptions(args);
+	let radius = options.getfieldvalue('radius', planetradius('earth')); //warning: planetradius in m, not km
+	let resolution = options.getfieldvalue('resolution', 700);
+
+	md.cluster = cluster;
+	md = await solve(md, 'gmsh', 'checkconsistency', 'false', 'hmin', resolution);
+
+	//methods 
+	let results = md.results[0];
+	let mesh = new mesh3dsurface();
+	let elements = [];
+	for (let i = 0; i < results.Elements.length; i=i+3){
+		elements.push(results.Elements.slice(i, i+3));
+	}
+	mesh.numberofelements = results.NumberOfElements;
+	mesh.numberofvertices =  results.NumberOfVertices;
+	mesh.x = results.X;
+	mesh.y = results.Y;
+	mesh.z = results.Z;
+	mesh.r = results.R;
+	mesh.elements = elements;
+	mesh.lat = results.Lat;
+	mesh.long = results.Long;
+	mesh.average_vertex_connectivity = results.AverageVertexConnectivity;
+
+	//a little technicality here. the mesh generate is not exactly on the 
+	//sphere. we create lat,long coordinates, and reproject on an exact sphere. 
+	mesh.r=ArraySqrt(ArrayAdd(ArrayAdd(ArrayPow(mesh.x,2),ArrayPow(mesh.y,2)),ArrayPow(mesh.z,2)));
+
+	//make sure we don't have south and north pole: 
+	let pos=find(ArrayAnd(ArrayEqual(mesh.x,0), ArrayEqual(mesh.y,0)));
+	mesh.lat = asind(ArrayDivide(mesh.z,mesh.r));
+	mesh.long = atan2d(mesh.y,mesh.x);
+	pos=find(ArrayEqual(mesh.lat,90)); ArrayIndex(mesh.lat,pos,90-.01);
+	pos=find(ArrayEqual(mesh.lat,-90)); ArrayIndex(mesh.lat,pos,-90+.01);
+
+	let radius = planetradius('earth');
+	mesh.r=NewArrayFill(mesh.numberofvertices,radius);
+	mesh.x=ArrayMultiply(radius,ArrayMultiply(cosd(mesh.lat),cosd(mesh.long)));
+	mesh.y=ArrayMultiply(radius,ArrayMultiply(cosd(mesh.lat),sind(mesh.long)));
+	mesh.z=ArrayMultiply(radius,sind(mesh.lat));
+
+	return mesh;
+}
Index: /issm/trunk/src/m/mesh/planet/gmsh/gmshplanet.m
===================================================================
--- /issm/trunk/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26743)
+++ /issm/trunk/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26744)
@@ -15,23 +15,6 @@
 %      md.mesh=gmshplanet('radius',6000,'resolution',100);
 
-	%Find path to gmsh
-	paths = {...
-		[issmdir() 'bin/gmsh'],...
-		[issmdir() 'externalpackages/gmsh/install/gmsh']...
-	};
-	disp(paths{1})
-	gmshpath = '';
-	for i=paths
-		if exist(i{1},'file'),
-			gmshpath = i{1};
-			break;
-		end
-	end
-	if isempty(gmshpath),
-		error('gmsh not found, make sure it is properly installed');
-	end
-
 	% Get Gmsh version
-	[s,r]=system([gmshpath ' -info 2>&1 | command grep ''Version'' | sed -e ''s/Version[[:blank:]]*:[[:blank:]]//'' | cut -d ''.'' -f1']);
+	[s,r]=system(['gmsh -info 2>&1 | command grep ''Version'' | sed -e ''s/Version[[:blank:]]*:[[:blank:]]//'' | cut -d ''.'' -f1']);
 	if s~=0,
 		error(r);
@@ -56,10 +39,21 @@
 	fid=fopen('sphere.geo','w');
 
-	fprintf(fid,'Mesh.Algorithm = 1;\n');
+	% NOTE:
+	% - The default format in Gmsh 3 is "msh2". Rather than conditionally 
+	% modifying our parsing scheme for Gmsh 4, for now, we simply set the 
+	% 'Mesh.MshFileVersion' option.
+	% - Decreasing the value of the 'Mesh.RandomFactor' option leads to an 
+	% equal number of nodes and elements being produced under macOS and Linux 
+	% at certain resolutions using certain meshing algorithms.
+	%
+	fprintf(fid,'Mesh.Algorithm = 1;\n'); % MeshAdapt
+	fprintf(fid,'Mesh.MshFileVersion = 2;\n');
+	fprintf(fid,'Mesh.RandomFactor = 1e-10;\n');
 	if  exist(options,'refine'),
-		fprintf(fid,'Mesh.Algorithm = 7;\n');
-		fprintf(fid,'Mesh.CharacteristicLengthFromPoints= 0;\n');
-		fprintf(fid,'Mesh.SmoothRatio= 3;\n');
-		fprintf(fid,'Mesh.RemeshAlgorithm= 1;\n');
+		fprintf(fid,'Mesh.Algorithm = 7;\n'); % BAMG
+		fprintf(fid,'Mesh.CharacteristicLengthFromPoints = 0;\n');
+		if gmshmajorversion == 3,
+			fprintf(fid,'Mesh.RemeshAlgorithm = 1;\n');
+		end
 	end
 	fprintf(fid,'resolution=%g;\n',resolution);
@@ -137,13 +131,8 @@
 
 	% Call gmsh
-	%
-	% NOTE: The default format in Gmsh 3 is "msh2". Rather than conditionally 
-	%		modifying our parsing scheme for Gmsh 4, for now, we simply set the 
-	%		"-format" option.
-	%
 	if  exist(options,'refine'),
-		system([gmshpath ' -tol 1e-8 -2 -format msh2 sphere.geo -bgm sphere.pos']);
+		system(['gmsh -2 sphere.geo -bgm sphere.pos']);
 	else
-		system([gmshpath ' -tol 1e-8 -2 -format msh2 sphere.geo']);
+		system(['gmsh -2 sphere.geo']);
 	end
 
@@ -195,8 +184,19 @@
 	%}}}
 
-	%figure out other fields in mesh3dsurface:
+	%a little technicality here. the mesh generate is not exactly on the 
+	%sphere. we create lat,long coordinates, and reproject on an exact sphere. 
 	mesh.r=sqrt(mesh.x.^2+mesh.y.^2+mesh.z.^2);
-	mesh.lat = asin(mesh.z./mesh.r)/pi*180;
-	mesh.long = atan2(mesh.y,mesh.x)/pi*180;
+
+	%make sure we don't have south and north pole: 
+	pos=find(mesh.x==0 & mesh.y==0);
+	mesh.lat = asind(mesh.z./mesh.r);
+	mesh.long = atan2d(mesh.y,mesh.x);
+	pos=find(mesh.lat==90); mesh.lat(pos)=90-.01;
+	pos=find(mesh.lat==-90); mesh.lat(pos)=-90+.01;
+
+	mesh.r=radius*ones(mesh.numberofvertices,1);
+	mesh.x=radius*cosd(mesh.lat).*cosd(mesh.long);
+	mesh.y=radius*cosd(mesh.lat).*sind(mesh.long);
+	mesh.z=radius*sind(mesh.lat);
 
 	%erase files:
Index: /issm/trunk/src/m/mesh/planet/gmsh/gmshplanet.py
===================================================================
--- /issm/trunk/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26743)
+++ /issm/trunk/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26744)
@@ -9,6 +9,5 @@
 
 def gmshplanet(*args):
-    '''
-    GMSHPLANET - mesh generation for a sphere. Very specific code for gmsh from $ISSM_DIR/src/demos/simple_geo/sphere.geo
+    """GMSHPLANET - mesh generation for a sphere. Very specific code for gmsh from $ISSM_DIR/src/demos/simple_geo/sphere.geo
 
     Available options (for more details see ISSM website http://issm.jpl.nasa.gov/):
@@ -18,40 +17,53 @@
     - refinemetric:       mesh quantity to specify resolution
 
-        Returns 'mesh3dsurface' type mesh
-
-        Examples:
-            md.mesh = gmshplanet('radius', 6000, 'resolution', 100);
-            md.mesh = gmshplanet('radius', 6000, 'resolution', 100);
-    '''
+    Returns 'mesh3dsurface' type mesh
+
+    Examples:
+        md.mesh = gmshplanet('radius', 6000, 'resolution', 100);
+        md.mesh = gmshplanet('radius', 6000, 'resolution', 100);
+    """
 
     # Get Gmsh version
-    subproc_args = "gmsh -info 2>&1 | command grep 'Version' | sed -e 's/Version[[:blank:]]*:[[:blank:]]//' | cut -d '.' -f1"
+    subproc_args = 'gmsh -info 2>&1 | command grep \'Version\' | sed -e \'s/Version[[:blank:]]*:[[:blank:]]//\' | cut -d \'.\' -f1'
     subproc = subprocess.Popen(subproc_args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     outs, errs = subproc.communicate()
-    if errs != '':
-        raise Exception("gmshplanet: call to gmsh failed: {}".format(errs))
+
+    if ((not isinstance(errs,bytes)) & (errs != '')) or (isinstance(errs,bytes) & (errs.decode() != '')):
+        raise Exception('gmshplanet: call to gmsh failed: {}'.format(errs))
     gmshmajorversion = int(outs)
     if gmshmajorversion not in [3, 4]:
-        raise RuntimeError("gmshplanet: Gmsh major version {} not supported!".format(gmshmajorversion))
-
-    #process options
+        raise RuntimeError('gmshplanet: Gmsh major version {} not supported!'.format(gmshmajorversion))
+
+    # Process options
     options = pairoptions(*args)
     #options = deleteduplicates(options, 1)
 
-    #recover parameters:
+    # Recover parameters
     radius = options.getfieldvalue('radius') * 1000
     resolution = options.getfieldvalue('resolution') * 1000
 
-    #initialize mesh:
+    # Initialize mesh
     mesh = mesh3dsurface()
-    #create .geo file:  {{{
+    # Create .geo file:  {{{
     fid = open('sphere.geo', 'w')
 
-    fid.write('Mesh.Algorithm = 1;\n')
+    # Call gmsh
+    #
+    # NOTE:
+    # - The default format in Gmsh 3 is "msh2". Rather than conditionally 
+    # modifying our parsing scheme for Gmsh 4, for now, we simply set the 
+    # 'Mesh.MshFileVersion' option.
+    # - Decreasing the value of the 'Mesh.RandomFactor' option leads to an 
+    # equal number of nodes and elements being produced under macOS and Linux 
+    # at certain resolutions using certain meshing algorithms.
+    #
+    fid.write('Mesh.Algorithm = 1;\n') # MeshAdapt
+    fid.write('Mesh.MshFileVersion = 2;\n')
+    fid.write('Mesh.RandomFactor = 1e-10;\n')
     if options.exist('refine'):
-        fid.write('Mesh.Algorithm = 7;\n')
+        fid.write('Mesh.Algorithm = 7;\n') # BAMG
         fid.write('Mesh.CharacteristicLengthFromPoints = 0;\n')
-        fid.write('Mesh.SmoothRatio = 3;\n')
-        fid.write('Mesh.RemeshAlgorithm = 1;\n')
+        if gmshmajorversion == 3:
+            fid.write('Mesh.RemeshAlgorithm = 1;\n')
     fid.write('resolution = %g;\n' % resolution)
     fid.write('radius = %g;\n' % radius)
@@ -81,23 +93,23 @@
         curvename = 'Curve Loop'
 
-    fid.write('%s(13) = {2, 8, -10};\n' % curvename)
+    fid.write('%s(13) = {2,8,-10};\n' % curvename)
     fid.write('Surface(14) = {13};\n')
-    fid.write('%s(15) = {10, 3, 7};\n' % curvename)
+    fid.write('%s(15) = {10,3,7};\n' % curvename)
     fid.write('Surface(16) = {15};\n')
-    fid.write('%s(17) = {-8, -9, 1};\n' % curvename)
+    fid.write('%s(17) = {-8,-9,1};\n' % curvename)
     fid.write('Surface(18) = {17};\n')
-    fid.write('%s(19) = {-11, -2, 5};\n' % curvename)
+    fid.write('%s(19) = {-11,-2,5};\n' % curvename)
     fid.write('Surface(20) = {19};\n')
-    fid.write('%s(21) = {-5, -12, -1};\n' % curvename)
+    fid.write('%s(21) = {-5,-12,-1};\n' % curvename)
     fid.write('Surface(22) = {21};\n')
-    fid.write('%s(23) = {-3, 11, 6};\n' % curvename)
+    fid.write('%s(23) = {-3,11,6};\n' % curvename)
     fid.write('Surface(24) = {23};\n')
-    fid.write('%s(25) = {-7, 4, 9};\n' % curvename)
+    fid.write('%s(25) = {-7,4,9};\n' % curvename)
     fid.write('Surface(26) = {25};\n')
-    fid.write('%s(27) = {-4, 12, -6};\n' % curvename)
+    fid.write('%s(27) = {-4,12,-6};\n' % curvename)
     fid.write('Surface(28) = {27};\n')
-    fid.write('Surface Loop(29) = {28, 26, 16, 14, 20, 24, 22, 18};\n')
+    fid.write('Surface Loop(29) = {28,26,16,14,20,24,22,18};\n')
     fid.write('Volume(30) = {29};\n')
-    fid.write('Physical Surface(1) = {28, 26, 16, 14, 20, 24, 22, 18};\n')
+    fid.write('Physical Surface(1) = {28,26,16,14,20,24,22,18};\n')
     fid.write('Physical Volume(2) = 30;\n')
     fid.close()
@@ -108,33 +120,27 @@
         metric = options.getfieldvalue('refinemetric')
 
-    #create .pos file with existing mesh and refining metric:  {{{
+        # Create .pos file with existing mesh and refining metric:  {{{
         fid = open('sphere.pos', 'w')
 
-        fid.write('View "background mesh" [;\n')
+        fid.write('View "background mesh" {\n')
         for i in range(meshini.numberofelements):
-            fid.write('ST(%g, %g, %g, %g, %g, %g, %g, %g, %g)[%g, %g, %g];\n',
-                      meshini.x(meshini.elements(i, 0)), meshini.y(meshini.elements(i, 0)), meshini.z(meshini.elements(i, 0)),
-                      meshini.x(meshini.elements(i, 1)), meshini.y(meshini.elements(i, 1)), meshini.z(meshini.elements(i, 1)),
-                      meshini.x(meshini.elements(i, 2)), meshini.y(meshini.elements(i, 2)), meshini.z(meshini.elements(i, 2)),
-                      metric(meshini.elements(i, 0)), metric(meshini.elements(i, 1)), metric(meshini.elements(i, 2)))
-        fid.write('];\n')
+            fid.write('ST(%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g};\n'
+                % (meshini.x[meshini.elements[i, 0]-1], meshini.y[meshini.elements[i, 0]-1], meshini.z[meshini.elements[i, 0]-1],
+                meshini.x[meshini.elements[i, 1]-1], meshini.y[meshini.elements[i, 1]-1], meshini.z[meshini.elements[i, 1]-1],
+                meshini.x[meshini.elements[i, 2]-1], meshini.y[meshini.elements[i, 2]-1], meshini.z[meshini.elements[i, 2]-1],
+                metric[meshini.elements[i, 0]-1], metric[meshini.elements[i, 1]-1], metric[meshini.elements[i, 2]-1]))
+        fid.write('};\n')
         fid.close()
-    # }}}
-
-    # Call gmsh
-    #
-    # NOTE: The default format in Gmsh 3 is "msh2". Rather than conditionally 
-    #       modifying our parsing scheme for Gmsh 4, for now, we simply set the 
-    #       "-format" option.
-    #
+        #}}}
+
     if options.exist('refine'):
-        subprocess.call('gmsh -tol 1e-8 -2 -format msh2 sphere.geo -bgm sphere.pos', shell=True)
+        subprocess.call('gmsh -2 sphere.geo -bgm sphere.pos', shell=True)
     else:
-        subprocess.call('gmsh -tol 1e-8 -2 -format msh2 sphere.geo', shell=True)
-
-    #import mesh:  {{{
+        subprocess.call('gmsh -2 sphere.geo', shell=True)
+
+    # Import mesh  {{{
     fid = open('sphere.msh', 'r')
 
-    #Get Mesh format
+    # Get mesh format
     A = fid.readline().strip()
     if A != '$MeshFormat':
@@ -146,5 +152,5 @@
         raise RuntimeError(['Expecting $EndMeshFormat (', A, ')'])
 
-    #Nodes
+    # Nodes
     A = fid.readline().strip()
     if A != '$Nodes':
@@ -165,5 +171,5 @@
         raise RuntimeError(['Expecting $EndNodes (', A, ')'])
 
-    #Elements
+    # Elements
     A = fid.readline().strip()
     if A != '$Elements':
@@ -181,12 +187,25 @@
     #}}}
 
-    #figure out other fields in mesh3dsurface:
-    mesh.r = np.sqrt(mesh.x**2 + mesh.y**2 + mesh.z**2)
-    mesh.lat = np.arcsin(mesh.z / mesh.r) / np.pi * 180
-    mesh.long = np.arctan2(mesh.y, mesh.x) / np.pi * 180
-
-    #erase files:
+    # A little technicality here. The mesh is not exactly on the sphere. We 
+    # create lat,long coordiantes, and reproject onto an exact sphere.
+    mesh.r = np.sqrt(mesh.x ** 2 + mesh.y ** 2 + mesh.z ** 2)
+
+    # Make sure we don't have south and north pole
+    pos = np.where(np.logical_and.reduce((mesh.x == 0, mesh.y == 0)))[0]
+    mesh.lat = asind(mesh.z / mesh.r)
+    mesh.long = atan2d(mesh.y, mesh.x)
+    pos = np.where(mesh.lat == 90)[0]
+    mesh.lat[pos] = 90 - 0.01
+    pos = np.where(mesh.lat == -90)[0]
+    mesh.lat[pos] = -90 + 0.01
+
+    mesh.r = radius * np.ones((mesh.numberofvertices, ))
+    mesh.x = radius * cosd(mesh.lat) * cosd(mesh.long)
+    mesh.y = radius * cosd(mesh.lat) * sind(mesh.long)
+    mesh.z = radius * sind(mesh.lat)
+
+    # Erase files
     subprocess.call('rm -rf sphere.geo sphere.msh sphere.pos', shell=True)
 
-    #return mesh:
+    # Return mesh
     return mesh
Index: /issm/trunk/src/m/miscellaneous/MatlabFuncs.js
===================================================================
--- /issm/trunk/src/m/miscellaneous/MatlabFuncs.js	(revision 26744)
+++ /issm/trunk/src/m/miscellaneous/MatlabFuncs.js	(revision 26744)
@@ -0,0 +1,566 @@
+/*
+A collection of functions that replicate the behavior of MATLAB built-in
+functions of the same, respective name.
+
+Where possible, users are encouraged to use native and/or the most efficient 
+methods in JavaScript, but we provide these functions as a way to make 
+translations from the MATLAB to the JavaScript ISSM API more seamless.
+
+NOTE:
+- We cannot implement the following MATLAB built-in functions by name as their
+names are reserved keywords in JavaScript,
+    class
+
+TODO:
+- Implement,
+    sort
+    unique
+
+Sources:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#keywords
+*/
+
+/**
+ * FUNCTION any - Determine if any array elements are nonzero
+ *
+ * Replicates behavior of MATLAB's 'any' function.
+ *
+ * Usage:
+ *     B = any(A);
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/any.html
+ *
+ * NOTE:
+ * - Only basic functionality is implemented
+ */
+function any(A) {//{{{
+    for (let i = 0; i < A.length; ++i) {
+        if (A[i] !== 0) {
+            return true;
+        }
+    }
+    return false;
+} //}}}
+
+/**
+ * FUNCTION diff - Differences and approximate derivatives
+ *
+ * Replicates behavior of MATLAB's 'diff' function.
+ * 
+ * Y = diff(X) calculates differences between adjacent elements of X.
+ *
+ * Usage:
+ *     Y = diff(X);
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/diff.html
+ *
+ * NOTE:
+ * - Not all functionality is implemented
+ */
+function diff(X) {//{{{
+    let diffs = [];
+    for (let i = 0; i < (X.length - 1); ++i) {
+        diffs[i] = X[i + 1] - X[i];
+    }
+    return diffs;
+} //}}}
+
+/**
+ * FUNCTION disp - Display value of variable
+ *
+ * Replicates behavior of MATLAB's 'disp' function.
+ *
+ * Output is logged to console.
+ *
+ * Usage:
+ *     disp(X);
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/disp.html
+ */
+function disp(X) {//{{{
+    console.log(X);
+} //}}}
+
+/**
+ * FUNCTION error - Throw error and display message
+ *
+ * Replicates behavior of MATLAB's 'error' function
+ *
+ * Usage:
+ *     error(msg);
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/error.html
+ *
+ * NOTE:
+ * - Only basic functionality is implemented
+ */
+function error(msg) {//{{{
+    throw new Error(msg);
+} //}}}
+
+/**
+ * FUNCTION find - Find indices and values of nonzero elements
+ *
+ * Replicates behavior of MATLAB's 'find' function
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/find.html
+ *
+ * TODO:
+ * - Implement support for multidimensional arrays
+ * - Implement 'n' parameter
+ * - Implement 'direction' parameter
+ */
+function find(X, n, direction) {//{{{
+    if (typeof(X[0]) == 'number') {
+        let indices = [];
+        for (let i = 0; i < X.length; ++i) {
+            if (X[i] != 0) {
+                indices.push(i);
+            }
+        }
+        return indices;
+    } else { //TODO: If 2d array, assume return rows & cols - try to find a way to not always return rows/cols
+        let rowindices = [];
+        let colindices = [];
+        for (let i = 0; i < X.length; ++i) {
+            for (let j = 0; j < X[i].length; ++j) {
+                if (X[i][j] != 0) {
+                    rowindices.push(i);
+                    colindices.push(j);
+                }
+            }
+        }
+        return [rowindices, colindices];
+    }
+} //}}}
+
+/**
+ * FUNCTION isempty - Determine whether array is empty
+ *
+ * Replicates behavior of MATLAB's 'isempty' function
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/isempty.html
+ *
+ * TODO:
+ * - Implement support for multidimensional arrays
+ */
+function isempty(A) {//{{{
+    //NOTE: Expanded for clarity/debugging. Can reduce later.
+    if (A === undefined) {
+        return 1; //TODO: Fix this: for now, treat undefined as empty
+    } else {
+        return A.length == 0;
+    }
+} //}}}
+
+/**
+ * FUNCTION ismember - Array elements that are members of set array
+ *
+ * Replicates basic behavior of MATLAB's 'ismember' function with an important 
+ * modification: because of the way we use ismember under MATLAB (to determine 
+ * if *any* element of A is in B) and because the truthiness of an empty array 
+ * in JavaScript is true, we return 0 if the A is not in B.
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/double.ismember.html
+ *
+ * TODO:
+ * - Implement support for multidimensional arrays
+ */
+function ismember(A, B) {//{{{
+    let b = B;
+    if (typeof(B) == 'number' || typeof(B) == 'string') {
+        b = [B];
+    }
+    let indices = zeros(A.length);
+    for (let i = 0; i < A.length; ++i) {
+        for (let j = 0; j < b.length; ++j) {
+            if (A[i] === b[j]) {
+                indices[i] = 1;
+            }
+        }
+    }
+    if (indices.length) {
+        return indices;
+    } else {
+        return 0;
+    }
+} //}}}
+
+/**
+ * FUNCTION isnan - Determine which array elements are NaN
+ *
+ * Replicates behavior of MATLAB's 'isnan' function
+ *
+ * Usage:
+ *     TF = isnan(A)
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/isnan.html
+ * - https://medium.com/coding-in-simple-english/how-to-check-for-nan-in-javascript-4294e555b447
+ * 
+ * NOTE:
+ * - Not to be confused with JavaScript built-in function isNaN
+ * - Not to be confused with function Number.isNaN
+ */
+function isnan(A) {//{{{
+    if (A.constructor !== Array) {
+        error('isnan: argument must be an array')
+    }
+    is_nan = [];
+    for (let i = 0; i < A.length; ++i) {
+        if (Number.isNaN(A[i])) {
+            is_nan.push(1);
+        } else {
+            is_nan.push(0);
+        }
+    }
+    return is_nan;
+} //}}}/*
+
+/**
+ * FUNCTION length - Length of largest array dimension
+ *
+ * Replicates behavior of MATLAB's 'length' function
+ *
+ * Usage:
+ *     L = length(X)
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/length.html
+ *
+ * TODO:
+ * - Implement support for multidimensional arrays
+ */
+function length(A) {//{{{
+    return A.length;
+} //}}}/*
+
+/**
+ * FUNCTION max - Maximum elements of an array
+ *
+ * Replicates behavior of MATLAB's 'max' function
+ *
+ * Usage:
+ *     M = max(A)
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/max.html
+ *
+ * TODO:
+ * - Implement support for multidimensional arrays
+ * - Implement 'nanflag' parameter
+ */
+function max(A) {//{{{
+    return Math.max.apply(null, A);
+} //}}}/*
+
+/**
+ * FUNCTION min - Minimum elements of an array
+ *
+ * Replicates behavior of MATLAB's 'min' function
+ *
+ * Usage:
+ *     M = min(A)
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/min.html
+ *
+ * TODO:
+ * - Implement support for multidimensional arrays
+ * - Implement 'nanflag' parameter
+ */
+function min(A) {//{{{
+    return Math.min.apply(null, A);
+} //}}}/*
+
+/**
+ * FUNCTION ones - Create array of all ones
+ *
+ * Replicates behavior of MATLAB's 'zeros' function
+ * 
+ * Usage:
+ *     X = ones
+ *     X = ones(n)
+ *     X = ones(sz1,...,szN)
+ *     X = ones(sz)
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/ones.html
+ *
+ * TODO:
+ * - Create lower-level function to handle both ones and zeros functions as 
+ * they are essentially the same
+ * - Implement functionality for more than 2 dimensions
+ */
+function ones() {//{{{
+    nargs = arguments.length;
+    if (nargs == 0) {
+        return 1;
+    } else if (nargs == 1) {
+        let arg = arguments[0];
+        if (typeof(arg) == 'number') {
+            return NewArrayFill(arg, 1);
+        } else if (arg.constructor == Array) {
+            return ones(...arg); // spread array of sizes
+        } else {
+            error('ones: functionality for greater than 2 dimensions is not currently implemented')
+        }
+    } else if (nargs == 2) {
+        return NewArrayFill2D(arguments[0], arguments[1], 1);
+    } else {
+        error('ones: functionality for greater than 2 dimensions is not currently implemented')
+    }
+} //}}}
+
+/**
+ * FUNCTION size - Array size
+ *
+ * Replicates behavior of MATLAB's 'size' function
+ * 
+ * Usage:
+ *     sz = size(A);
+ *     szdim = size(A, dim);
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/size.html
+ * 
+ * NOTE:
+ * - Not all functionality is implemented
+ * - In a 2D array, if length of all columns are not equal, unexpected behavior 
+ * may result from subsequent processing based on the values returned from this 
+ * function.
+ */
+function size(A, dim) {//{{{
+    let nargs = arguments.length;
+    if (nargs == 0) {
+        error('size: at least one argument is required');
+    } else if (nargs == 1) {
+        if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
+            return [1, 1];
+        } else if (A.constructor != Array) {
+            error('size: A argument must be a number or an Array');
+        }
+        if (typeof(A) == 'undefined' || isNaN(A)) {
+            return [0];
+        } else if (A.length && A[0].constructor == Array) {
+            return [A.length, A[0].length];
+        } else {
+            return [A.length];
+        }
+    } else if (nargs == 2) {
+        if (typeof(dim) != 'number' || dim < 0 || dim > 1) {
+            error('size: dim argument must be a number between 0 and 1, inclusive');
+        }
+        if (dim == 0) {
+            if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
+                return 1;
+            } else {
+                return A.length;
+            }
+        } else {
+            if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
+                return 1;
+            } else if (typeof(A) == 'undefined' || isNaN(A)) {
+                return 0;
+            } else if (A[0].constructor != Array) {
+                error('size: A[0] is not an Array');
+            }
+            return A[0].length;
+        }
+    } else {
+        error('size: functionality for more than 2 arguments is not currently implemented');
+    }
+} //}}}
+
+/**
+ * FUNCTION strcmpi - Compare strings (case insensitive)
+ *
+ * Replicates behavior of MATLAB's 'strcmpi' function
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/strcmpi.html
+ */
+function strcmpi(s1, s2) {//{{{
+    return s1.toLowerCase() == s2.toLowerCase();
+} //}}}
+
+/**
+ * FUNCTION sum - Sum of elements of an array
+ *
+ * Replicates behavior of MATLAB's 'sum' function
+ *
+ * Usage:
+ *     S = sum(A)
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/sum.html
+ *
+ * TODO:
+ * - Implement support for multidimensional arrays
+ * - Implement 'nanflag' parameter
+ */
+function sum(A) {//{{{
+    return ArraySum(A);
+} //}}}
+
+/**
+ * FUNCTION zeros - Create array of all zeros
+ *
+ * Replicates behavior of MATLAB's 'zeros' function
+ * 
+ * Usage:
+ *     X = zeros
+ *     X = zeros(n)
+ *     X = zeros(sz1,...,szN)
+ *     X = zeros(sz)
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/zeros.html
+ *
+ * TODO:
+ * - Create lower-level function to handle both ones and zeros functions as 
+ * they are essentially the same
+ * - Implement functionality for more than 2 dimensions
+ */
+function zeros() {//{{{
+    nargs = arguments.length;
+    if (nargs == 0) {
+        return 0;
+    } else if (nargs == 1) {
+        let arg = arguments[0];
+        if (typeof(arg) == 'number') {
+            return NewArrayFill(arg, 0);
+        } else if (arg.constructor == Array) {
+            return zeros(...arg); // spread array of sizes
+        } else {
+            error('zeros: functionality for greater than 2 dimensions is not currently implemented')
+        }
+    } else if (nargs == 2) {
+        return NewArrayFill2D(arguments[0], arguments[1], 0);
+    } else {
+        error('zeros: functionality for greater than 2 dimensions is not currently implemented')
+    }
+} //}}}
+
+/**
+ * FUNCTIONS sin, cos, tan, asin, acos, atan2 - trig functions that work with radians
+ *
+ * Replicates behavior of MATLAB's trig functions
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/trigonometry.html
+ *
+ */
+function sin(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.sin(X[i]);
+    }
+    return result;
+} //}}}
+
+function cos(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.cos(X[i]);
+    }
+    return result;
+} //}}}
+
+function tan(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.tan(X[i]);
+    }
+    return result;
+} //}}}
+
+function asin(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.asin(X[i]);
+    }
+    return result;
+} //}}}
+
+function acos(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.acos(X[i]);
+    }
+    return result;
+} //}}}
+
+// TODO: Test that the arguments do not need to be reversed, as they are in MATLAB and Python
+function atan2(X, Y) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.atan2(X[i], Y[i]);
+    }
+    return result;
+} //}}}
+
+/**
+ * FUNCTIONS sind, cosd, tand, asind, acosd, atan2d - trig functions that work with degrees
+ *
+ * Replicates behavior of MATLAB's trig functions
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/trigonometry.html
+ *
+ */
+function sind(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.sin(X[i] * DEG2RAD);
+    }
+    return result;
+} //}}}
+
+function cosd(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.cos(X[i] * DEG2RAD);
+    }
+    return result;
+} //}}}
+
+function tand(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.tan(X[i] * DEG2RAD);
+    }
+    return result;
+} //}}}
+
+function asind(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = RAD2DEG * Math.asin(X[i]);
+    }
+    return result;
+} //}}}
+
+function acosd(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = RAD2DEG * Math.acos(X[i]);
+    }
+    return result;
+} //}}}
+
+// TODO: Test that the arguments do not need to be reversed, as they are in MATLAB and Python
+function atan2d(X, Y) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = RAD2DEG * Math.atan2(X[i], Y[i]);
+    }
+    return result;
+} //}}}
Index: /issm/trunk/src/m/miscellaneous/MatlabFuncs.py
===================================================================
--- /issm/trunk/src/m/miscellaneous/MatlabFuncs.py	(revision 26743)
+++ /issm/trunk/src/m/miscellaneous/MatlabFuncs.py	(revision 26744)
@@ -1,59 +1,206 @@
-def oshostname():
-    import socket
-
-    return socket.gethostname()
-
-
-def ispc():
+"""A collection of functions that replicate the behavior of MATLAB built-in
+functions of the same, respective name.
+
+Where possible, users are encouraged to use native and/or the most efficient 
+methods in Python, but we provide these functions as a way to make translations 
+from the MATLAB to the Python ISSM API more seamless.
+"""
+
+def acosd(X):  # {{{
+    """function acosd - Inverse cosine in degrees
+
+    Usage:
+        Y = acosd(X)
+    """
+    import numpy as np
+
+    return np.degrees(np.arccos(X))
+# }}}
+
+def asind(X):  # {{{
+    """function asind - Inverse sine in degrees
+
+    Usage:
+        Y = asind(X)
+    """
+    import numpy as np
+
+    return np.degrees(np.arcsin(X))
+# }}}
+
+def atand(X):  # {{{
+    """function atand - Inverse tangent in degrees
+
+    Usage:
+        Y = atand(X)
+    """
+    import numpy as np
+
+    return np.degrees(np.arctan(X))
+# }}}
+
+
+def atan2d(Y, X):  # {{{
+    """function atan2d - Four-quadrant inverse tangent in degrees
+
+    Usage:
+        D = atan2d(Y, X)
+    """
+    import numpy as np
+
+    return np.degrees(np.arctan2(Y, X))
+# }}}
+
+def contains(str, pat):  #{{{
+    """function contains - Determine if pattern is in strings
+
+    Usage:
+        TF = contains(str, pat)
+
+    TODO:
+    - Implement 'IgnoreCase' option
+    """
+
+# }}}
+
+def cosd(X):  # {{{
+    """function cosd - Cosine of argument in degrees
+
+    Usage:
+        Y = cosd(X)
+    """
+    import numpy as np
+
+    if type(X) == np.ndarray:
+        Y = np.array([])
+        for x in X:
+            Y = np.append(Y, cosdsingle(x))
+        return Y
+    else:
+        return cosdsingle(X)
+# }}}
+
+def cosdsingle(x):  # {{{
+    """function cosdsingle - Helper function for cosd to reduce repetition of 
+    logic
+
+    Usage:
+        y = cosdsingle(x)
+    """
+    import numpy as np
+
+    while x >= 360:
+        x = x - 360
+
+    if x == 0:
+        return 1
+    elif x == 90 or x == 270:
+        return 0
+    elif x == 180:
+        return -1
+    else:
+        return np.cos(np.radians(x))
+# }}}
+
+def det(a):  # {{{
+    if a.shape == (1, ):
+        return a[0]
+    elif a.shape == (1, 1):
+        return a[0, 0]
+    elif a.shape == (2, 2):
+        return a[0, 0] * a[1, 1] - a[0, 1] * a[1, 0]
+    else:
+        raise TypeError('MatlabFunc.det only implemented for shape (2, 2), not for shape {}.'.format(a.shape))
+# }}}
+
+def error(msg):  # {{{
+    raise Exception(msg)
+# }}}
+
+def etime(t2, t1):  # {{{
+    return t2 - t1
+# }}}
+
+def find(*args):  # {{{
+    nargs = len(args)
+    if nargs >= 1 or nargs <= 2:
+        X = args[0]
+        n = len(args[0])
+        if nargs == 2:
+            n = args[1]
+        indices=[]
+        for i in range(n):
+            if X[i] != 0:
+                indices.push(i)
+        return indices
+    else:
+        raise Exception('find: must have 1 or 2 arguments')
+# }}}
+
+def floor(X):  # {{{
+    import math
+
+    return int(math.floor(X))
+# }}}
+
+def heaviside(x):  # {{{
+    import numpy as np
+
+    y = np.zeros_like(x)
+    y[np.nonzero(x > 0.)] = 1.
+    y[np.nonzero(x == 0.)] = 0.5
+
+    return y
+# }}}
+
+def intersect(A, B):  # {{{
+    """function intersect - Set intersection of two arrays
+
+    Usage:
+        C = intersect(A, B)
+
+    NOTE:
+    - Only the following functionality is currently implemented:
+        - C = intersect(A,B) returns the data common to both A and B, with no 
+        repetitions. C is in sorted order.
+
+    """
+    import numpy as np
+
+    return np.intersect1d(A, B)
+#}}}
+
+def isa(A, dataType):  # {{{
+    """function isa
+
+    NOTE:
+    - Takes a type as its second argument (in contrast to the MATLAB function 
+    that it replicates, which takes a string representing the name of a type)
+    """
+    return type(A) == dataType
+# }}}
+
+# NOTE: Conflicts with definition of isempty in $ISSM_DIR/src/m/qmu/helpers.py
+#
+# def isempty(A):  # {{{
+#     return len(A) > 0
+# # }}}
+
+def isfile(fileName):  # {{{
+    import os
+
+    return os.path.exists(fileName)
+# }}}
+
+def ismac():  # {{{
     import platform
 
-    if 'Windows' in platform.system():
-        return True
-    else:
-        return False
-
-
-def ismac():
-    import platform
-
     if 'Darwin' in platform.system():
         return True
     else:
         return False
-
-
-def strcmp(s1, s2):
-
-    if s1 == s2:
-        return True
-    else:
-        return False
-
-
-def strncmp(s1, s2, n):
-
-    if s1[0:n] == s2[0:n]:
-        return True
-    else:
-        return False
-
-
-def strcmpi(s1, s2):
-
-    if s1.lower() == s2.lower():
-        return True
-    else:
-        return False
-
-
-def strncmpi(s1, s2, n):
-
-    if s1.lower()[0:n] == s2.lower()[0:n]:
-        return True
-    else:
-        return False
-
-
-def ismember(a, s):
+# }}}
+
+def ismember(a, s):  # {{{
     import numpy as np
 
@@ -66,5 +213,4 @@
     if not isinstance(a, np.ndarray):
         b = [item in s for item in a]
-
     else:
         if not isinstance(s, np.ndarray):
@@ -76,19 +222,102 @@
 
     return b
-
-
-def det(a):
-
-    if a.shape == (1, ):
-        return a[0]
-    elif a.shape == (1, 1):
-        return a[0, 0]
-    elif a.shape == (2, 2):
-        return a[0, 0] * a[1, 1] - a[0, 1] * a[1, 0]
-    else:
-        raise TypeError("MatlabFunc.det only implemented for shape (2, 2), not for shape %s." % str(a.shape))
-
-
-def sparse(ivec, jvec, svec, m=0, n=0, nzmax=0):
+# }}}
+
+def isnan(A):  # {{{
+    import numpy as np
+
+    return np.isnan(A)
+# }}}
+
+def ispc():  # {{{
+    import platform
+
+    if 'Windows' in platform.system():
+        return True
+    else:
+        return False
+# }}}
+
+def isprop(obj, PropertyName):  # {{{
+    return hasattr(obj, PropertyName)
+# }}}
+
+def mod(a, m):  # {{{
+    return a % m
+# }}}
+
+def numel(A):  # {{{
+    """function numel - Number of array elements
+
+    Usage:
+        n = numel(A))
+    """
+    import numpy as np
+
+    return np.size(A)
+# }}}
+
+def pause(n):  # {{{
+    import time
+
+    time.sleep(n)
+# }}}
+
+def pwd():  # {{{
+    import os
+
+    return os.getcwd()
+# }}}
+
+def oshostname():  # {{{
+    import socket
+
+    return socket.gethostname()
+# }}}
+
+def rem(a, b):  # {{{
+    return a % b
+# }}}
+
+def sind(X):  # {{{
+    """function sind - Sine of argument in degrees
+
+    Usage:
+        Y = sind(X)
+    """
+    import numpy as np
+
+    if type(X) == np.ndarray:
+        Y = np.array([])
+        for x in X:
+            Y = np.append(Y, sindsingle(x))
+        return Y
+    else:
+        return sindsingle(X)
+# }}}
+
+def sindsingle(x):  # {{{
+    """function sindsingle - Helper function for sind to reduce repetition of 
+    logic
+
+    Usage:
+        y = sindsingle(x)
+    """
+    import numpy as np
+
+    while x >= 360:
+        x = x - 360
+
+    if x == 0 or x == 180:
+        return 0
+    elif x == 90:
+        return 1
+    elif x == 270:
+        return -1
+    else:
+        return np.sin(np.radians(x))
+# }}}
+
+def sparse(ivec, jvec, svec, m=0, n=0, nzmax=0):  # {{{
     import numpy as np
 
@@ -104,12 +333,42 @@
 
     return a
-
-
-def heaviside(x):
-    import numpy as np
-
-    y = np.zeros_like(x)
-    y[np.nonzero(x > 0.)] = 1.
-    y[np.nonzero(x == 0.)] = 0.5
-
-    return y
+# }}}
+
+def strcmp(s1, s2):  # {{{
+    if s1 == s2:
+        return True
+    else:
+        return False
+# }}}
+
+def strcmpi(s1, s2):  # {{{
+    if s1.lower() == s2.lower():
+        return True
+    else:
+        return False
+# }}}
+
+def strjoin(*args):  # {{{
+    nargs = len(args)
+    if nargs >= 1 or nargs <= 2:
+        sep = ' '
+        if nargs == 2:
+            sep = args[1]
+        return sep.join(args[0])
+    else:
+        raise Exception('strjoin: must have 1 or 2 arguments')
+# }}}
+
+def strncmp(s1, s2, n):  # {{{
+    if s1[0:n] == s2[0:n]:
+        return True
+    else:
+        return False
+# }}}
+
+def strncmpi(s1, s2, n):  # {{{
+    if s1.lower()[0:n] == s2.lower()[0:n]:
+        return True
+    else:
+        return False
+# }}}
Index: /issm/trunk/src/m/miscellaneous/PythonFuncs.py
===================================================================
--- /issm/trunk/src/m/miscellaneous/PythonFuncs.py	(revision 26743)
+++ /issm/trunk/src/m/miscellaneous/PythonFuncs.py	(revision 26744)
@@ -2,6 +2,5 @@
 
 
-def logical_and_n(*arg):
-
+def logical_and_n(*arg): #{{{
     if len(arg):
         result = arg[0]
@@ -9,11 +8,9 @@
             result = np.logical_and(result, item)
         return result
-
     else:
         return None
+#}}}
 
-
-def logical_or_n(*arg):
-
+def logical_or_n(*arg): #{{{
     if len(arg):
         result = arg[0]
@@ -21,5 +18,5 @@
             result = np.logical_or(result, item)
         return result
-
     else:
         return None
+#}}}
Index: /issm/trunk/src/m/miscellaneous/prctile_issm.py
===================================================================
--- /issm/trunk/src/m/miscellaneous/prctile_issm.py	(revision 26743)
+++ /issm/trunk/src/m/miscellaneous/prctile_issm.py	(revision 26744)
@@ -41,5 +41,8 @@
         #  if one value, just copy it
         elif n == 1:
-            y = np.tile(x[0, :], (len(p), 1))
+            if isinstance(p, int):
+                y = x[0, :]
+            else:
+                y = np.tile(x[0, :], (len(p), 1))
 
         #  if no values, use NaN
Index: /issm/trunk/src/m/miscellaneous/pretty_print.m
===================================================================
--- /issm/trunk/src/m/miscellaneous/pretty_print.m	(revision 26743)
+++ /issm/trunk/src/m/miscellaneous/pretty_print.m	(revision 26744)
@@ -30,10 +30,10 @@
 		if shape(2)>6
 			output=sprintf('[[%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',data(1,1),data(1,2),data(1,3),data(1,end-2),data(1,end-1),data(1,end));
-			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',data(2,1),data(2,2),data(2,3),data(2,end-2),data(2,end-1),data(2,end));
-			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',data(3,1),data(3,2),data(3,3),data(3,end-2),data(3,end-1),data(3,end));
+			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',output,data(2,1),data(2,2),data(2,3),data(2,end-2),data(2,end-1),data(2,end));
+			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',output,data(3,1),data(3,2),data(3,3),data(3,end-2),data(3,end-1),data(3,end));
 			output=sprintf('%s ...\n',output);
-			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',data(end-2,1),data(end-2,2),data(end-2,3),data(end-2,end-2),data(end-2,end-1),data(end-2,end));
-			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',data(end-1,1),data(end-1,2),data(end-1,3),data(end-1,end-2),data(end-1,end-1),data(end-1,end));
-			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]]',data(end,1),data(end,2),data(end,3),data(end,end-2),data(end,end-1),data(end,end));
+			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',output,data(end-2,1),data(end-2,2),data(end-2,3),data(end-2,end-2),data(end-2,end-1),data(end-2,end));
+			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',output,data(end-1,1),data(end-1,2),data(end-1,3),data(end-1,end-2),data(end-1,end-1),data(end-1,end));
+			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]]',output,data(end,1),data(end,2),data(end,3),data(end,end-2),data(end,end-1),data(end,end));
 		else
 			output=sprintf('[[%.8f]\n',data(1,:));
Index: /issm/trunk/src/m/modules/CoordTransform.m
===================================================================
--- /issm/trunk/src/m/modules/CoordTransform.m	(revision 26743)
+++ /issm/trunk/src/m/modules/CoordTransform.m	(revision 26744)
@@ -10,8 +10,8 @@
 %
 %   Example of Projections:
-%      
+%
 %   lat/lon = '+init=epsg:4326'
 %   lat/lon = '+proj=longlat +datum=WGS84'
-%   
+%
 %   ll2xy default equivalent (uses with Hugues Ellispoid S)
 %   Greenland = '+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.448564109 +units=m +no_defs'
@@ -19,7 +19,9 @@
 %   Bamber Greenland = '+proj=stere +lat_0=90 +lat_ts=71 +lon_0=-39 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs'
 %
-%   for latitude/longitude, x is longitude and y latitude and the angles are in rad
+%   For latitude/longitude, x is longitude and y latitude and the angles are in 
+%   rad
 %
-%   This function will only work of PROJ has been installed in externalpackages
+%   This function will only work if PROJ has been installed and --with-proj-dir 
+%   option has been set to its location in ISSM configuration
 
 % Check usage
Index: /issm/trunk/src/m/modules/ExpToLevelSet.m
===================================================================
--- /issm/trunk/src/m/modules/ExpToLevelSet.m	(revision 26743)
+++ /issm/trunk/src/m/modules/ExpToLevelSet.m	(revision 26744)
@@ -18,12 +18,35 @@
 end
 
+multipleShp = 0;
+
 if ischar(contourname),
-	[path,name,ext]=fileparts(contourname); 
+	[path,name,ext]=fileparts(contourname);
 	if strcmpi(ext,'.shp'),
 		%read contour from shapefile
-		contourname=shpread(contourname); 
+		contourname=shpread(contourname);
+		if isstruct(contourname)
+			multipleShp = size(contourname, 2);
+		end
 	end
 end
 
 % Call mex module
-distance = ExpToLevelSet_matlab(x,y,contourname);
+if multipleShp>0 
+	% shp file contains multiple contours
+	distance = zeros(length(x)+1, multipleShp);
+	for i = 1:multipleShp
+		distance(1:end-1, i) = ExpToLevelSet_matlab(x,y,contourname(i));
+		% append the NAME information at the end of the distance
+		if isfield(contourname(i),'NAME')
+			distance(end, i) = contourname(i).NAME;
+		elseif isfield(contourname(i),'Date')
+			distance(end, i) = date2decyear(datenum(contourname(i).Date));
+			% to deal with 
+		else
+			distance(end, i) = i;
+		end        
+	end
+else
+	% single shape or exp file
+	distance = ExpToLevelSet_matlab(x,y,contourname);
+end
Index: /issm/trunk/src/m/modules/ExpToLevelSet.py
===================================================================
--- /issm/trunk/src/m/modules/ExpToLevelSet.py	(revision 26743)
+++ /issm/trunk/src/m/modules/ExpToLevelSet.py	(revision 26744)
@@ -1,2 +1,3 @@
+from ExpToLevelSet_python import ExpToLevelSet_python
 from helpers import fileparts
 from shpread import shpread
@@ -23,5 +24,5 @@
     """
 
-    if isinstance(contourname, basestring):
+    if isinstance(contourname, str):
         path, name, ext = fileparts(contourname)
         if ext == '.shp':
@@ -29,5 +30,5 @@
             contourname = shpread(contourname)
 
-    # NOTE: This library does not currently exist! See TODO list in function 
+    # NOTE: This module does not currently exist! See TODO list in function 
     #       header.
     distance = ExpToLevelSet_python(x, y, contourname)
Index: /issm/trunk/src/m/modules/InterpFromGridToMesh.py
===================================================================
--- /issm/trunk/src/m/modules/InterpFromGridToMesh.py	(revision 26743)
+++ /issm/trunk/src/m/modules/InterpFromGridToMesh.py	(revision 26744)
@@ -1,2 +1,3 @@
+import numpy as np
 from InterpFromGridToMesh_python import InterpFromGridToMesh_python
 
@@ -21,3 +22,3 @@
     data_mesh = InterpFromGridToMesh_python(x, y, data, x_mesh, y_mesh, default_value)
     # Return
-    return data_mesh
+    return np.squeeze(data_mesh)
Index: /issm/trunk/src/m/modules/ShpRead.m
===================================================================
--- /issm/trunk/src/m/modules/ShpRead.m	(revision 26743)
+++ /issm/trunk/src/m/modules/ShpRead.m	(revision 26744)
@@ -1,3 +1,3 @@
-function ShpRead(filename);
+function structout = ShpRead(filename);
 %	SHPREAD - Read shapefile
 %	
@@ -5,9 +5,8 @@
 %	
 %	   Usage:
-%	      ShpRead(filename);
-%	      filexp:      file name of exp file to be written
+%	      structout = ShpRead(filename);
 %	
 %	   Examples:
-%	      ShpRead('file.shp');
+%	      structout = ShpRead('file.shp');
 
 % Check usage
@@ -18,3 +17,3 @@
 
 % Call mex module
-ShpRead_matlab(filename);
+structout = ShpRead_matlab(filename);
Index: /issm/trunk/src/m/os/ismingw.m
===================================================================
--- /issm/trunk/src/m/os/ismingw.m	(revision 26744)
+++ /issm/trunk/src/m/os/ismingw.m	(revision 26744)
@@ -0,0 +1,11 @@
+function result=ismingw()
+%ISMINGW - Returns 1 if machine is running MinGW.
+%
+%   Usage:
+%      if ismingw,
+%         [...]
+%      end
+%
+
+[status,result]=system('uname -rs | grep "MINGW" | wc -l');
+result=str2num(result);
Index: /issm/trunk/src/m/os/issmscpin.m
===================================================================
--- /issm/trunk/src/m/os/issmscpin.m	(revision 26743)
+++ /issm/trunk/src/m/os/issmscpin.m	(revision 26744)
@@ -18,12 +18,9 @@
 %if hostname and host are the same, do a simple copy
 if strcmpi(hostname,host),
-
-    for i=1:numel(packages),
+	for i=1:numel(packages),
 		success=copyfile([path '/' packages{i}]); %keep going, even if success=0
 	end
-
 else
-
-	if ispc(),
+	if ispc & ~ismingw,
 		%use the putty project pscp.exe: it should be in the path.
 
Index: /issm/trunk/src/m/os/issmscpin.py
===================================================================
--- /issm/trunk/src/m/os/issmscpin.py	(revision 26743)
+++ /issm/trunk/src/m/os/issmscpin.py	(revision 26744)
@@ -1,17 +1,17 @@
-from socket import gethostname
-import subprocess
 import os
 import shutil
-import MatlabFuncs as m
+import subprocess
+from MatlabFuncs import *
 
 
 def issmscpin(host, login, port, path, packages):
-    """
-    ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
-       usage: issmscpin(host, packages, path)
+    """ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
+
+    Usage:
+        issmscpin(host, packages, path)
     """
 
     #first get hostname
-    hostname = gethostname()
+    hostname = oshostname()
     #first be sure packages are not in the current directory, this could conflict with pscp on windows.
     #remove warnings in case the files do not exist
@@ -29,5 +29,5 @@
                 pass
     else:
-        if m.ispc():
+        if ispc():
             #use the putty project pscp.exe: it should be in the path.
             #get ISSM_DIR variable
Index: /issm/trunk/src/m/os/issmscpout.m
===================================================================
--- /issm/trunk/src/m/os/issmscpout.m	(revision 26743)
+++ /issm/trunk/src/m/os/issmscpout.m	(revision 26744)
@@ -9,5 +9,5 @@
 hostname=oshostname();
 
-%are we dis-allowing symbolic links? 
+%are we disallowing symbolic links? 
 if nargin==6,
 	no_symlinks=1;
@@ -24,5 +24,5 @@
 		system(['rm -rf ' packages{i} ]);
 		if no_symlinks,
-			system(['cp  ' here '/' packages{i} ' .']);
+			system(['cp ' here '/' packages{i} ' .']);
 		else
 			system(['ln -s ' here '/' packages{i} ' .']);
@@ -31,5 +31,5 @@
 	end
 else 
-	if ispc(),
+	if ispc & ~ismingw,
 		%use the putty project pscp.exe: it should be in the path.
 
Index: /issm/trunk/src/m/os/issmscpout.py
===================================================================
--- /issm/trunk/src/m/os/issmscpout.py	(revision 26743)
+++ /issm/trunk/src/m/os/issmscpout.py	(revision 26744)
@@ -1,17 +1,17 @@
+import os
 from socket import gethostname
 import subprocess
-import os
-import MatlabFuncs as m
+from MatlabFuncs import *
 
 
 def issmscpout(host, path, login, port, packages):
-    """
-    ISSMSCPOUT send packages to a host, using scp on unix, and pscp on windows
+    """ISSMSCPOUT send packages to a host, using scp on unix, and pscp on windows
 
-       usage: issmscpout(host, path, packages)
+    Usage:
+        issmscpout(host, path, packages)
     """
 
     #get hostname
-    hostname = gethostname()
+    hostname = oshostname()
 
     #if hostname and host are the same, do a simple copy
@@ -28,5 +28,5 @@
             os.chdir(here)
     else:
-        if m.ispc():
+        if ispc():
             #use the putty project pscp.exe: it should be in the path.
             #get ISSM_DIR variable
Index: /issm/trunk/src/m/os/issmssh.m
===================================================================
--- /issm/trunk/src/m/os/issmssh.m	(revision 26743)
+++ /issm/trunk/src/m/os/issmssh.m	(revision 26744)
@@ -12,5 +12,5 @@
 	system(command);
 else
-	if ispc(),
+	if ispc & ~ismingw,
 		%use the putty project plink.exe: it should be in the path.
 
Index: /issm/trunk/src/m/os/issmssh.py
===================================================================
--- /issm/trunk/src/m/os/issmssh.py	(revision 26743)
+++ /issm/trunk/src/m/os/issmssh.py	(revision 26744)
@@ -1,25 +1,23 @@
-from socket import gethostname
+import os
+import subprocess
 from sys import platform as _platform
-import subprocess
-import os
-import MatlabFuncs as m
+from MatlabFuncs import *
 
 
 def issmssh(host, login, port, command):
-    """
-    ISSMSSH - wrapper for OS independent ssh command.
+    """ISSMSSH - wrapper for OS independent ssh command.
 
-       usage:
-          issmssh(host, command)
+    Usage:
+        issmssh(host, command)
     """
 
     #first get hostname
-    hostname = gethostname()
+    hostname = oshostname()
 
     #if same as host, just run the command.
-    if m.strcmpi(host, hostname):
+    if strcmpi(host, hostname):
         subprocess.call(command, shell=True)
     else:
-        if m.ispc():
+        if ispc():
             #use the putty project plink.exe: it should be in the path.
             #get ISSM_DIR variable
Index: /issm/trunk/src/m/os/oshostname.m
===================================================================
--- /issm/trunk/src/m/os/oshostname.m	(revision 26743)
+++ /issm/trunk/src/m/os/oshostname.m	(revision 26744)
@@ -22,5 +22,5 @@
 %Method 3, last chance
 if isempty(hostname),
-	if ispc
+	if ispc % If OS is MinGW, $COMPUTERNAME and $HOSTNAME are identical
 		hostname = getenv('COMPUTERNAME');
 	else
Index: /issm/trunk/src/m/parameterization/parameterize.py
===================================================================
--- /issm/trunk/src/m/parameterization/parameterize.py	(revision 26743)
+++ /issm/trunk/src/m/parameterization/parameterize.py	(revision 26744)
@@ -4,17 +4,16 @@
 
 def parameterize(md, parametername):
-    '''
-    PARAMETERIZE - parameterize a model
+    """PARAMETERIZE - parameterize a model
 
-        From a parameter Python file, start filling in all the model fields 
-        that were not filled in by the mesh.py and mask.py model methods.
-        Warning: the parameter file must be able to be run in Python
+    From a parameter Python file, start filling in all the model fields that 
+    were not filled in by the mesh.py and mask.py model methods. Warning: the 
+    parameter file must be able to be run in Python
 
-        Usage:
-            md = parameterize(md, parametername)
+    Usage:
+        md = parameterize(md, parametername)
 
-        Example:
-            md = parameterize(md, 'Square.par')
-    '''
+    Example:
+        md = parameterize(md, 'Square.py')
+    """
 
     #some checks
Index: /issm/trunk/src/m/parameterization/reinitializelevelset.py
===================================================================
--- /issm/trunk/src/m/parameterization/reinitializelevelset.py	(revision 26744)
+++ /issm/trunk/src/m/parameterization/reinitializelevelset.py	(revision 26744)
@@ -0,0 +1,39 @@
+import numpy as np
+from model import model
+from contourlevelzero import *
+from ExpToLevelSet import *
+
+def reinitializelevelset(md,levelset):
+    """REINITIALIZELEVELSET - reinitialize levelset as a signed distance function
+
+    Usage:
+       levelsetnew = reinitializelevelset(md,levelset)
+    """
+    
+    # if md is 3d, levelset should be projected on a 2d mesh 
+    if len(levelset) == 0:
+        raise IOError("levelset provided is empty")
+    
+    if md.mesh.dimension() == 3:
+        if len(levelset)!=md.mesh.numberofvertices2d:
+            raise IOError("levelset provided should be specified at the 2d vertices of the mesh")
+        else:
+            if len(levelset)!=md.mesh.numberofvertices:
+                raise IOError("levelset provided should be specified at the vertices of the mesh")
+            
+    #First: extract segments
+    contours=contourlevelzero(md,levelset,0)
+    
+    #Now, make this a distance field (might not be closed)
+    levelsetnew=np.abs(ExpToLevelSet(md.mesh.x,md.mesh.y,contours)).T # levelsetnew comes on the 3d vertices, if mesh is 3d
+    
+    #Finally, change sign
+    pos=np.where(levelset<0) # if mesh is 3d, it refers to the vertices on the base
+    if md.mesh.dimension()==3:
+        for i in range(md.mesh.numberoflayers):
+            pos3d=pos[0]+i*md.mesh.numberofvertices2d
+            levelsetnew[pos3d]=-levelsetnew[pos3d]
+    else:
+        levelsetnew[pos[0]]=-1*levelsetnew[pos[0]]
+        
+    return levelsetnew
Index: /issm/trunk/src/m/parameterization/setflowequation.m
===================================================================
--- /issm/trunk/src/m/parameterization/setflowequation.m	(revision 26743)
+++ /issm/trunk/src/m/parameterization/setflowequation.m	(revision 26744)
@@ -60,5 +60,5 @@
 %check that each element has only one flag
 if any(SIAflag+SSAflag+HOflag+L1L2flag+MLHOflag+FSflag>1),
-	disp('setflowequation warning message: some elements have several types, higher order type is used for them')
+	disp('setflowequation.m: Warning: some elements have several types, higher order type is used for them')
 	SIAflag(find(SIAflag & SSAflag))=0;
 	SIAflag(find(SIAflag & HOflag))=0;
Index: /issm/trunk/src/m/parameterization/setflowequation.py
===================================================================
--- /issm/trunk/src/m/parameterization/setflowequation.py	(revision 26743)
+++ /issm/trunk/src/m/parameterization/setflowequation.py	(revision 26744)
@@ -6,22 +6,23 @@
 
 def setflowequation(md, *args):
-    """
-    SETFLOWEQUATION - associate a solution type to each element
-
-       This routine works like plotmodel: it works with an even number of inputs
-       'SIA', 'SSA', 'HO', 'L1L2', 'MLHO', 'FS' and 'fill' are the possible options
-       that must be followed by the corresponding exp file or flags list
-       It can either be a domain file (argus type, .exp extension), or an array of element flags.
-       If user wants every element outside the domain to be
-       setflowequationd, add '~' to the name of the domain file (ex: '~HO.exp')
-       an empty string '' will be considered as an empty domain
-       a string 'all' will be considered as the entire domain
-       You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
-
-       Usage:
-          md = setflowequation(md, varargin)
-
-       Example:
-          md = setflowequation(md, 'HO', 'HO.exp', fill', 'SIA', 'coupling', 'tiling')
+    """SETFLOWEQUATION - associate a solution type to each element
+
+    This routine works like plotmodel: it works with an even number of inputs
+    'SIA', 'SSA', 'HO', 'L1L2', 'MLHO', 'FS' and 'fill' are the possible 
+    options that must be followed by the corresponding exp file or flags list. 
+    It can either be a domain file (argus type, .exp extension), or an array of 
+    element flags.
+    If user wants every element outside the domain to be setflowequationd, add 
+    '~' to the name of the domain file (ex: '~HO.exp') an empty string '' will 
+    be considered as an empty domain a string 'all' will be considered as the 
+    entire domain.
+    You can specify the type of coupling, 'penalties' or 'tiling', to use with 
+    the input 'coupling'.
+
+    Usage:
+        md = setflowequation(md, varargin)
+
+    Example:
+        md = setflowequation(md, 'HO', 'HO.exp', fill', 'SIA', 'coupling', 'tiling')
     """
 
@@ -61,5 +62,5 @@
     #check that each element has only one flag
     if any(SIAflag + SSAflag + L1L2flag + MLHOflag + HOflag + FSflag > 1):
-        print("setflowequation warning message: some elements have several types, higher order type is used for them")
+        print('Warning: setflowequation.py: some elements have several types, higher order type is used for them')
         SIAflag[np.where(np.logical_and(SIAflag, SSAflag))] = False
         SIAflag[np.where(np.logical_and(SIAflag, HOflag))] = False
Index: /issm/trunk/src/m/partition/partitioner.m
===================================================================
--- /issm/trunk/src/m/partition/partitioner.m	(revision 26743)
+++ /issm/trunk/src/m/partition/partitioner.m	(revision 26744)
@@ -1,3 +1,3 @@
-function [partitionvector, md]=partitioner(md,varargin)
+function [partitionvector,md]=partitioner(md,varargin)
 %PARTITIONER - partition mesh 
 %
Index: /issm/trunk/src/m/plot/applyoptions.js
===================================================================
--- /issm/trunk/src/m/plot/applyoptions.js	(revision 26743)
+++ /issm/trunk/src/m/plot/applyoptions.js	(revision 26744)
@@ -1,3 +1,5 @@
-function applyoptions(md, data, options, canvas){ //{{{
+'use strict';
+
+function applyoptions(md, data, options, canvas) {
 	//APPLYOPTIONS - apply colobar, text, cloud, and expdisp options to current plot
 	//
@@ -8,471 +10,358 @@
 
 	//{{{ colorbar
-	var gl = canvas.gl;
-	if (options.exist('colorbar')) {
-		if (options.getfieldvalue('colorbar')==1) {
-			//{{{ Variable options initialization
-			var caxis = options.getfieldvalue('caxis');
-			var ccanvasid, ctitleid, clabelsid, ccanvas, ctitle, clabels, ccontext, cmap, colorbar, cwidth, cheight, cgradient, color, y, x;
-			//}}}
-			//{{{ Create colorbar labels
-			var labels = [];
-			var cdivisions = options.getfieldvalue('colorbarnticks', 6);
-			var caxisdelta = caxis[1] - caxis[0];
-			var precision = options.getfieldvalue('colorbarprecision', 3);
-			var format = options.getfieldvalue('colorbarformat', 'f').toLowerCase();
-			if (options.getfieldvalue('log','off')!='off') {
-				for (var i=cdivisions; i >= 0; i--) {
-					var scale = (Math.log10(caxis[1])-Math.log10(caxis[0]))/Math.log10(options.getfieldvalue('log', 10));
-					if (format === 'f') {
-						labels[i] = (Math.pow(options.getfieldvalue('log', 10), Math.log10(caxis[0])/Math.log10(options.getfieldvalue('log', 10))+scale*(cdivisions-i)/cdivisions)).toFixed(precision);
-					}
-					else if (format === 'e') {
-						labels[i] = (Math.pow(options.getfieldvalue('log', 10), Math.log10(caxis[0])/Math.log10(options.getfieldvalue('log', 10))+scale*(cdivisions-i)/cdivisions)).toPrecision(precision);
-					}
-					else {
-						labels[i] = (Math.pow(options.getfieldvalue('log', 10), Math.log10(caxis[0])/Math.log10(options.getfieldvalue('log', 10))+scale*(cdivisions-i)/cdivisions)).toFixed(precision);
-					}
+	let gl = canvas.gl;
+	
+	if (options.getfieldvalue('colorbar', false)) {
+		//{{{ Create colorbar labels
+		let cAxis = options.getfieldvalue('caxis');
+		let labels = [];
+		let divisions = options.getfieldvalue('colorbarnticks', 6);
+		let cAxisDelta = cAxis[1] - cAxis[0];
+		let precision = options.getfieldvalue('colorbarprecision', 3);
+		let format = options.getfieldvalue('colorbarformat', 'f').toLowerCase();
+		if (options.getfieldvalue('log','off') !== 'off') {
+			for (let i = divisions; i >= 0; i--) {
+				let scale = (Math.log10(cAxis[1]) - Math.log10(cAxis[0])) / Math.log10(options.getfieldvalue('log', 10));
+				if (format === 'f') {
+					labels[i] = (Math.pow(options.getfieldvalue('log', 10), Math.log10(cAxis[0]) / Math.log10(options.getfieldvalue('log', 10)) + scale * (divisions - i) / divisions)).toFixed(precision);
+				} else if (format === 'e') {
+					labels[i] = (Math.pow(options.getfieldvalue('log', 10), Math.log10(cAxis[0]) / Math.log10(options.getfieldvalue('log', 10)) + scale * (divisions - i) / divisions)).toPrecision(precision);
+				} else {
+					labels[i] = (Math.pow(options.getfieldvalue('log', 10), Math.log10(cAxis[0]) / Math.log10(options.getfieldvalue('log', 10)) + scale * (divisions - i) / divisions)).toFixed(precision);
+				}
+			}
+		} else {
+			for (let i = divisions; i >= 0; i--) {
+				if (format === 'f') {
+					labels[i] = (cAxisDelta * (divisions - i) / divisions + cAxis[0]).toFixed(precision);
+				} else if (format === 'e') {
+					labels[i] = (cAxisDelta * (divisions - i) / divisions + cAxis[0]).toPrecision(precision);
+				} else {
+					labels[i] = (cAxisDelta * (divisions - i) / divisions + cAxis[0]).toFixed(precision);
+				}
+			}
+		} //}}}
+		//{{{ Initialize colorbar canvas
+		let cCanvasId = options.getfieldvalue('colorbarid', options.getfieldvalue('canvasid') + ('-colorbar-canvas'));
+		let cCanvasIdBase = cCanvasId.substring(0, cCanvasId.lastIndexOf('-canvas'));
+		let cCanvas = document.getElementById(cCanvasId);
+		let cWidth = cCanvas.width * options.getfieldvalue('colorbarwidth', 1);
+		let cHeight = cCanvas.height * options.getfieldvalue('colorbarheight', 1);
+		let cContext = cCanvas.getContext('2d');
+		let cMap = options.getfieldvalue('colormap', 'amp');
+		
+		// If value of cMap is of type array, assume we have a custom colorbar; otherwise, look up colormap by name from global letiable "colorbars"
+		let colorbar = null;
+		
+		if (vesl.arrays.isArray(cMap)) {
+			colorbar = cMap;
+		} else {
+    		for (let colormap in colorbars) {
+        		if (colormap === cMap) {
+			        colorbar = colorbars[cMap];
+			        break;
+                }
+            }
+            
+            if (colorbar === null) {
+                for (let colormap in cmoceanColormaps) {
+            		if (colormap === cMap) {
+    			        colorbar = cmoceanColormaps[cMap];
+    			        break;
+                    }
+                }
+            }
+		}
+		
+		let gradient = cContext.createLinearGradient(0, 0, 0, cHeight);
+		//}}}
+		//{{{ Draw colorbar gradient
+		// TODO: Allow for passing the opacity in as a fourth value of each array of a colormap?
+		let applyOpacityToColorbar  = options.getfieldvalue('applyOpacityToColorbar', false);
+		let color                   = null;
+		let background              = options.getfieldvalue('colorbarBackground', null);
+		let offset                  = 1 / (colorbar.length - 1) / 2;
+		let opacity                 = options.getfieldvalue('opacity', 1.0);
+		let position                = null;
+		let scaling                 = 1 - 2 * offset;
+		
+		if (!applyOpacityToColorbar) {
+    		opacity = 1.0;
+		}
+		
+		if (background !== null) {
+    		background = [background[0] * 255, background[1] * 255, background[2] * 255];
+    		$('#' + cCanvasId).css('background', 'rgba(' + background.toString() + ', 1.0');
+		}
+		
+		for (let i = 0; i < colorbar.length; i++) {
+			color = colorbar[colorbar.length - i - 1];
+			color = [Math.round(color[0] * 255), Math.round(color[1] * 255), Math.round(color[2] * 255)];
+			position = (i / (colorbar.length - 1) * scaling) + offset;
+			gradient.addColorStop(position, 'rgba(' + color.toString() + ', ' + opacity + ')');
+		}
+		
+		cContext.clearRect(0, 0, cWidth, cHeight);
+		cContext.beginPath();
+		cContext.fillStyle = gradient;
+		cContext.fillRect(0, 0, cWidth, cHeight);
+		//}}}
+		//{{{ Draw colorbar border
+		cContext.beginPath();
+		cContext.lineWidth = '1';
+		cContext.strokeStyle=options.getfieldvalue('colorbarfontcolor','black');
+		cContext.rect(0, 0, cWidth, cHeight);
+		cContext.stroke();
+		//}}}
+		//{{{ Draw colorbar labels
+		let cLabelsId = cCanvasIdBase + '-labels';
+		let cLabels = $('#' + cLabelsId);
+		let cLabelString = '';
+		let x, y;
+		cLabels.empty();
+		for (let i = 0; i <= divisions; i++) {
+			y = (i + 0.5) / (divisions + 1) * cHeight;
+			x = 0.2 * cWidth;
+			cLabelString += '<li><span>' + labels[i] + '</span></li>';
+			cContext.beginPath();
+			cContext.moveTo(0, y);
+			cContext.lineTo(x, y);
+			cContext.moveTo(cWidth - x, y);
+			cContext.lineTo(cWidth, y);
+			cContext.stroke();
+		}
+		cLabels.append(cLabelString);
+		//}}}
+		//{{{ Draw colorbar title
+		let cTitleId = cCanvasIdBase + '-heading';
+		let cTitle = $('#' + cTitleId);
+		if (options.exist('colorbartitle')) { cTitle.html(options.getfieldvalue('colorbartitle')); }
+		//}}}
+		//{{{ Setup texture/alpha canvases
+		let $canvas 	= $(canvas);
+		let tCanvasId 	= options.getfieldvalue('texturecanvasid', 'texturecanvas');
+		let aCanvasId 	= options.getfieldvalue('alphacanvasid', 'alphacanvas');
+		let tCanvas 	= document.getElementById(tCanvasId);
+		let aCanvas 	= document.getElementById(aCanvasId);
+		
+		if (tCanvas == null) {
+			$('<canvas id="' + tCanvasId + '" width="256" height="256" style="display: none;"></canvas>').insertAfter($canvas);
+			tCanvas = document.getElementById(tCanvasId);
+		}
+		
+		if (aCanvas == null) {
+			$('<canvas id="' + aCanvasId + '" width="256" height="256" style="display: none;"></canvas>').insertAfter($canvas);
+			aCanvas = document.getElementById(aCanvasId);
+		}
+	
+		//Set up canvas drawing contexes and gradients.
+		let tContext = tCanvas.getContext('2d');
+		let aContext = aCanvas.getContext('2d');
+		let tGradient = tContext.createLinearGradient(0, 0, 0, 256);
+		let aGradient = aContext.createLinearGradient(0, 0, 0, 256);
+		
+		//Determine where in gradient to start unit mesh transparency
+		let maskAlphaEnabled = options.getfieldvalue('maskAlphaEnabled', false);
+		let maskAlphaTolerance = options.getfieldvalue('maskAlphaTolerance', 0.1);
+		let maskAlphaValue = options.getfieldvalue('maskAlphaValue', 1.1);
+		let maskAlphaUseColor = options.getfieldvalue('maskAlphaUseColor', false);
+		let maskAlphaColor = options.getfieldvalue('maskAlphaColor', 'rgba(0.0, 0.0, 255, 1.0)');
+		let alphaValue = (maskAlphaValue - cAxis[0]) / cAxisDelta;
+		
+		//Apply transparency to alpha map that enables alpha to be read from texture, and to actual texture alpha.
+		for (let i = 0; i < colorbar.length; i++) {
+			color = colorbar[colorbar.length - i - 1];
+			color = [Math.round(color[0] * 255), Math.round(color[1] * 255), Math.round(color[2] * 255)];
+			let colorStop = i / (colorbar.length - 1);
+			if (maskAlphaEnabled && (colorStop > 1 - alphaValue || colorStop == colorbar.length - 1)) {
+				if (maskAlphaUseColor) {
+					tGradient.addColorStop(colorStop, maskAlphaColor);
+					aGradient.addColorStop(colorStop, 'rgb(255, 255, 255)');
+				} else {
+					tGradient.addColorStop(colorStop, 'rgba(' + color.toString() + ', 0.0)');
+					aGradient.addColorStop(colorStop, 'rgb(0, 0, 0)');
 				}
 			} else {
-				for (var i=cdivisions; i >= 0; i--) {
-					if (format === 'f') {
-						labels[i] = (caxisdelta*(cdivisions-i)/cdivisions+caxis[0]).toFixed(precision);
-					}
-					else if (format === 'e') {
-						labels[i] = (caxisdelta*(cdivisions-i)/cdivisions+caxis[0]).toPrecision(precision);
-					}
-					else {
-						labels[i] = (caxisdelta*(cdivisions-i)/cdivisions+caxis[0]).toFixed(precision);
-					}
-				}
-			} //}}}
-			//{{{ Initialize colorbar canvas
-			let colorbarSlug = options.getfieldvalue('colorbarSlug', options.getfieldvalue('canvasid') + '-colorbar');
-			ccanvasid = colorbarSlug + '-canvas';
-			ccanvas = $('#'+ccanvasid)[0];
-			cwidth = ccanvas.width*options.getfieldvalue('colorbarwidth', 1);
-			cheight = ccanvas.height*options.getfieldvalue('colorbarheight', 1);
-			ccontext = ccanvas.getContext('2d');
-			ccontext.clearRect(0, 0, cwidth, cheight);
-			ccontext.beginPath();
-			cmap = options.getfieldvalue('colormap','jet');
-			colorbar = colorbars[cmap];
-			cgradient = ccontext.createLinearGradient(0, 0, 0, cheight);
-			//}}}
-			//{{{ Draw colorbar gradient
-			var position;
-			var offset = 1 / (colorbar.length - 1) / 2;
-			var scaling = 1 - 2 * offset;
-			for (var i=0; i < colorbar.length; i++) {
-				color = colorbar[colorbar.length-i-1];
-				color = [Math.round(color[0]*255), Math.round(color[1]*255), Math.round(color[2]*255)];
-				position = (i / (colorbar.length - 1) * scaling) + offset;
-				cgradient.addColorStop(position, 'rgba(' + color.toString() + ', 1.0)');
-			}
-			ccontext.fillStyle=cgradient;
-			ccontext.fillRect(0, 0, cwidth, cheight);
-			//}}}
-			//{{{ Draw colorbar border
-			ccontext.beginPath();
-			ccontext.lineWidth='1';
-			ccontext.strokeStyle=options.getfieldvalue('colorbarfontcolor','black');
-			ccontext.rect(0, 0, cwidth, cheight);
-			ccontext.stroke();
-			//}}}
-			//{{{ Draw colorbar labels
-			clabelsid = colorbarSlug + '-labels';
-			clabels = $('#'+clabelsid);
-			var clabelstring = '';
-			clabels.empty();
-			for (var i=0; i <= cdivisions; i++) {
-				y = (i+0.5)/(cdivisions+1)*cheight;
-				x = 0.2*cwidth;
-				clabelstring += '<li><span>'+labels[i]+'</span></li>';
-				ccontext.beginPath();
-				ccontext.moveTo(0, y);
-				ccontext.lineTo(x, y);
-				ccontext.moveTo(cwidth-x, y);
-				ccontext.lineTo(cwidth, y);
-				ccontext.stroke();
-			}
-			clabels.append(clabelstring);
-			//}}}
-			//{{{ Draw colorbar title
-			ctitleid = colorbarSlug + '-heading';
-			ctitle = $('#'+ctitleid);
-			if (options.exist('colorbarHeader')) { ctitle.html(options.getfieldvalue('colorbarHeader')); }
-			//}}}
+				tGradient.addColorStop(colorStop, 'rgba(' + color.toString() + ', 1.0)');
+				aGradient.addColorStop(colorStop, 'rgb(255, 255, 255)');
+			}
+		}
+		
+		//Draw gradients to canvaes.
+		tContext.fillStyle = tGradient;
+		aContext.fillStyle = aGradient;
+		tContext.fillRect(0, 0, 256, 256);
+		aContext.fillRect(0, 0, 256, 256);
+		
+		//Allow for special texture colors, drawing each color in equal width vertical rectangles. The last rectanglar section is reserved for the colormap.
+		if (options.exist('maskregion')) {
+			let maskObject = options.getfieldvalue('maskregion',{'enabled':false});
+			if (maskObject.enabled && !vesl.helpers.isEmptyOrUndefined(maskObject.colors)) {
+				let x = 0;
+				let sections = Object.keys(maskObject.colors).length + 1;
+				let size = 256;
+				let width = Math.floor(1 / sections * size);
+				for (let color in maskObject.colors) {
+					tContext.fillStyle = maskObject.colors[color];
+					tContext.fillRect(x++ * width, 0, width, size);
+				}
+			}
+		}
+		
+		//Read canvases as images, and load as textures in Three.js
+		let tURL            = tCanvas.toDataURL();
+		let aURL            = aCanvas.toDataURL();
+		let textureMap      = new THREE.TextureLoader().load(tURL);
+		let alphaMap        = new THREE.TextureLoader().load(aURL);
+		let unitOptions 	= options.getfieldvalue('unitOptions', {'name' : 'unit'});
+		let unitName 		= unitOptions.name;
+		let unitSceneNode 	= canvas.unitNodes[unitName].sceneNode;
+		unitSceneNode.material.map          = textureMap;
+		unitSceneNode.material.emissiveMap  = textureMap;
+		unitSceneNode.material.color        = new THREE.Color(0xffffff);
+		unitSceneNode.material.needsUpdate  = true;
+		
+		//Only apply alpha map if enabled.
+		if (maskAlphaEnabled) {
+			unitSceneNode.material.alphaMap = alphaMap;
 		}
 	} //}}}
-	//{{{ texture canvas
-	var tcontext, tcanvas, tcanvasid, tURL, tgradient;
-	tcanvasid = 'texturecanvas';
-	var tcanvas = document.getElementById(tcanvasid);
-	if (tcanvas == null) {
-		$('<canvas id="texturecanvas" width="256" height="256" style="display: none;"></canvas>').insertAfter('#'+String(options.getfieldvalue('canvasid')));
-		tcanvas = document.getElementById(tcanvasid);
-	}
-	tcontext = tcanvas.getContext('2d');
-	tgradient = tcontext.createLinearGradient(0, 0, 0, 256);
-
-	var cmap = options.getfieldvalue('colormap','jet');
-	var colorbar = colorbars[cmap];
-	for (var i = 0; i < colorbar.length; i++) {
-		color = colorbar[colorbar.length - i - 1];
-		color = [Math.round(color[0] * 255), Math.round(color[1] * 255), Math.round(color[2] * 255)];
-		tgradient.addColorStop(i / (colorbar.length - 1), 'rgba(' + color.toString() + ', 1.0)');
-	}
-	tcontext.fillStyle = tgradient;
-	tcontext.fillRect(0, 0, 256, 256);
-
-	//Allow for special texture colors, drawing each color in equal width vertical rectangles. The last rectanglar section is reserved for the colormap.
-	if (options.exist('maskregion')) {
-		var maskObject = options.getfieldvalue('maskregion',{'enabled':false});
-		if (maskObject.enabled && !vesl.helpers.isEmptyOrUndefined(maskObject.colors)) {
-			var x = 0;
-			var sections = Object.keys(maskObject.colors).length + 1;
-			var size = 256;
-			var width = Math.floor(1 / sections * size);
-			for (var color in maskObject.colors) {
-				tcontext.fillStyle = maskObject.colors[color];
-				tcontext.fillRect(x++ * width, 0, width, size);
-			}
-		}
-	}
-
-	tURL = tcanvas.toDataURL();
-	if (options.getfieldvalue('clf','on')=='off') {
-		canvas.nodes['unit' + (Object.keys(canvas.nodes).length - 1)].texture = initTexture(canvas.gl, tURL);
-	} else {
-		canvas.nodes.unit.texture = initTexture(canvas.gl, tURL);
-	}
 	//}}}
-	//{{{ text display
-	var ctx;
-	var overlaycanvasid;
-	var overlaycanvas;
-	//Only intialize overlay canvas once by checking if it's already been defined
-	if (vesl.helpers.isEmptyOrUndefined(canvas.overlaycanvas)) {
-		//Get drawing context and save reference on main WebGL canvas
-		overlaycanvasid = options.getfieldvalue('overlayid', options.getfieldvalue('canvasid') + '-overlay')
-		overlaycanvas = $('#' + overlaycanvasid)[0];
-		ctx = overlaycanvas.getContext('2d');
-		canvas.overlaycanvas = overlaycanvas;
-	}
-	overlaycanvas = canvas.overlaycanvas;
-	ctx = overlaycanvas.getContext('2d');
-
-	if (options.exist('textlabels')) {//{{{
-		//Attatch new overlay handler to display text labels
-		var textLabels = options.getfieldvalue('textlabels',[]);
-		canvas.overlayHandlers['text'] = function(canvas) {
-			for (var i = 0; i < textLabels.length; i++) {
-				//Get text label to display
-				var textLabel = textLabels[i];
-				textLabel = {
-					position: defaultFor(textLabel.position, vec3.create()),
-					text: defaultFor(textLabel.text, ''),
-					fontSize: defaultFor(textLabel.fontSize, 18),
-					fontColor: defaultFor(textLabel.fontColor, 'black'),
-
-				};
-
-				// function declared in slr-gfm sim-front-end-controller.js
-				// if labels are behind the globe sphere then skip iteartion and do not display them
-				if (vesl.ui.isLabelVisible(textLabel)) {
-					//Transform from world space to viewport space
-					var screenPoint = vec3.transformMat4(vec3.create(), textLabel.position, canvas.camera.vpMatrix);
-					var x = (screenPoint[0] + 1.0) * (canvas.width / 2) + canvas.selector.offset().left;
-					var y = (-screenPoint[1] + 1.0) * (canvas.height / 2) + canvas.selector.offset().top;
-
-					//Draw text
-					ctx.font = 'bold ' + String(textLabel.fontSize) + 'px Arial Black, sans-serif';
-					ctx.fillStyle = textLabel.fontColor;
-					ctx.strokeStyle = 'white';
-					ctx.textAlign = 'center';
-					ctx.textBaseline = 'middle';
-					ctx.fillText(textLabel.text, x, y);
-					ctx.strokeText(textLabel.text, x, y);
-				}
-			}
-		}
-	}//}}}
-
-	//{{{ additional rendering nodes
-	if (options.exist('render')) {
-		var meshresults = processmesh(md, data, options);
-		var x = meshresults[0];
-		var y = meshresults[1];
-		var z = meshresults[2];
-		var elements = meshresults[3];
-		var is2d = meshresults[4];
-		var isplanet = meshresults[5];
-
-		var xlim = options.getfieldvalue('xlim', [ArrayMin(x), ArrayMax(x)]);
-		var ylim = options.getfieldvalue('ylim', [ArrayMin(y), ArrayMax(y)]);
-		var zlim = options.getfieldvalue('zlim', [ArrayMin(z), ArrayMax(z)]);
-
-		var global = vec3.length([(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, (zlim[0] + zlim[1]) / 2]) < 6371000/10; //tolerance for global models = center is 637100 meters away from center of earth
-		var translation = global ? [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, (zlim[0] + zlim[1]) / 2] : canvas.view.position;
-
-		var renderObjects = options.getfieldvalue('render',{});
-
-		for (var renderObject in renderObjects) {
-			//Modify renderObejct?
-			var object = renderObjects[renderObject];
-			object = {
-				enabled: defaultFor(object.enabled, true),					//Toggle display of the render object node
-				scale: defaultFor(object.scale, 1),							//Model matrix scaling
-				x: defaultFor(object.x, [0.0, 1.0, 0.0, 0.0, 0.0, 0.0]),	//x coordinate array
-				y: defaultFor(object.y, [0.0, 0.0, 0.0, 1.0, 0.0, 0.0]),	//y coordinate array
-				z: defaultFor(object.z, [0.0, 0.0, 0.0, 0.0, 0.0, 1.0]),	//z coordinate array
-				indices: defaultFor(object.indices, []),					//indices array
-				name: defaultFor(object.name, 'NY'),						//Text to display for cities.
-				size: defaultFor(object.size, 1),							//Physical size of the object in meters
-				color: defaultFor(object.color, 'black'),					//Diffuse color of object
-				height: defaultFor(object.height, 25000),					//Height of object along y axis, currently for clouds only
-				range: defaultFor(object.range, 120000),					//Range of sz plane to spawn object, currently for clouds only
-				quantity: defaultFor(object.quantity, 15),					//Quantity of objects to display, currently for clouds only
-				source: defaultFor(object.source, 'NY'),					//Quantity of objects to display, currently for clouds only
-				targets: defaultFor(object.targets, ['NY'])					//Quantity of objects to display, currently for clouds only
-			};
-			if (!object.enabled) { continue; }
-			if ('sky' === renderObject && !('sky' in canvas.nodes)) {
-				var mesh = GL.Mesh.icosahedron({size: 6371000 * canvas.atmosphere.scaleHeight, subdivisions: 5});
-				var texture = initTexture(gl, canvas.assetsPath + '/textures/TychoSkymapII_t4_2k.jpg');
-				node = new Node(
-					'canvas', canvas,
-					'options', options,
-					'renderObject', object,
-					'name', 'sky',
-					'shaderName', 'SkyFromSpace',
-					'cullFace', gl.FRONT,
-					'mesh', mesh,
-					'texture',texture,
-					'translation',translation
-				);
-			}
-			if ('space' === renderObject && !('space' in canvas.nodes)) {
-				var mesh = GL.Mesh.sphere({size: 6371000 * 20});
-				var texture = initTexture(gl, canvas.assetsPath + '/textures/TychoSkymapII_t4_2k.jpg');
-				node = new Node(
-					'canvas', canvas,
-					'options', options,
-					'renderObject', object,
-					'name', 'space',
-					'shaderName', 'Textured',
-					'cullFace', gl.FRONT,
-					'drawOrder', 2,
-					'mesh', mesh,
-					'texture',texture,
-					'translation',translation
-				);
-			}
-			if ('coastlines' === renderObject) {
-				node = new Node(
-					'canvas', canvas,
-					'options', options,
-					'renderObject', object,
-					'name', 'coastlines',
-					'shaderName', 'Colored',
-					'drawMode', gl.LINE_STRIP,
-					'lineWidth', options.getfieldvalue('linewidth', 1),
-					'scale', [object.scale, object.scale, object.scale],
-					'rotation', [-90, 0, 0]
-				);
-				node.patch('Vertices', [object.x, object.y, object.z], 'FaceColor', 'none');
-			}
-			if ('graticule' === renderObject && !('graticule' in canvas.nodes)) {
-				node = new Node(
-					'canvas', canvas,
-					'options', options,
-					'renderObject', object,
-					'name', 'graticule',
-					'shaderName', 'Colored',
-					'drawMode', gl.LINE_STRIP,
-					'lineWidth', options.getfieldvalue('linewidth', 1),
-					'scale', [object.scale, object.scale, object.scale],
-					'rotation', [-90, 180, 0]
-				);
-				node.patch('Vertices', [object.x, object.y, object.z], 'FaceColor', 'none');
-			}
-			if ('cities' === renderObject && !('cities' in canvas.nodes)) {
-				var mesh = GL.Mesh.icosahedron({size: object.size, subdivisions: 1});
-				node = new Node(
-					'canvas', canvas,
-					'options', options,
-					'renderObject', object,
-					'name', 'cities',
-					'shaderName', 'ColoredDiffuse',
-					'diffuseColor', object.color,
-					'lineWidth', options.getfieldvalue('linewidth', 1),
-					'scale', [object.scale, object.scale, object.scale],
-					'rotation', [-90, 0, 0]
-				);
-				node.geometryShader('Mesh', mesh, 'Vertices', [object.x, object.y, object.z], 'Indices', object.indices);
-			}
-			if ('axis' === renderObject && !('axis' in canvas.nodes)) {
-				node = new Node(
-					'canvas', canvas,
-					'options', options,
-					'renderObject', object,
-					'name', 'axis',
-					'shaderName', 'Colored',
-					'drawMode', gl.LINES,
-					'diffuseColor', [1.0, 0.0, 0.0, 1.0],
-					'lineWidth', options.getfieldvalue('linewidth', 1),
-					'scale', [object.scale, object.scale, object.scale],
-					'rotation', [0, 0, 0]
-				);
-				node.patch('Vertices', [object.x, object.y, object.z], 'FaceColor', 'none');
-			}
-			if ('city' === renderObject && !vesl.helpers.isEmptyOrUndefined(overlaycanvas)) {
-				//city
-				var mesh = GL.Mesh.sphere({size: object.size});
-				node = new Node(
-					'canvas', canvas,
-					'options', options,
-					'renderObject', object,
-					'name', 'city',
-					'shaderName', 'ColoredDiffuse',
-					'diffuseColor', object.color,
-					'mesh', mesh,
-					'translation', [object.x, object.z, -object.y]
-				);
-				//Attatch new overlay handler to display city name
-				canvas.overlayHandlers['city'] = function(canvas) {
-					var node = canvas.nodes['city'];
-					var object = node.renderObject;
-					var screenPoint = vec3.transformMat4(vec3.create(), node.translation, canvas.camera.vpMatrix);
-					var x = (screenPoint[0] + 1.0) * (canvas.width / 2) + canvas.selector.offset().left;
-					var y = (-screenPoint[1] + 1.0) * (canvas.height / 2) + canvas.selector.offset().top;
-
-					ctx.font = 'bold ' + String(options.getfieldvalue('colorbarfontsize', 22))+'px Arial Black, sans-serif';
-					ctx.fillStyle = options.getfieldvalue('colorbarfontcolor','black');
-					ctx.strokeStyle = 'white';
-					ctx.textAlign = 'center';
-					ctx.textBaseline = 'middle';
-					ctx.fillText(object.name, x, y);
-					ctx.strokeText(object.name, x, y);
-				}
-			}
-			if ('clouds' === renderObject && !('clouds0' in canvas.nodes)) {
-				//clouds
-				var mesh = GL.Mesh.fromURL(canvas.assetsPath + '/obj/cloud.obj');
-				for (var i = 0; i < object.quantity; i++) {
-					//TODO: More options, less magic numbers. Add animation. Better shading.
-					var offset = [randomizeAxis(translation[0], object.range),
-												randomizeCloudHeight(translation[1], object),
-												randomizeAxis(translation[2], object.range)];
-					var randomSize = randomizeCloudSize(object.scale);
-					var randomColor = randomizeCloudColor();
-					node = new Node(
-						'canvas', canvas,
-						'options', options,
-						'renderObject', object,
-						'name', 'clouds' + i,
-						'shaderName', 'ColoredDiffuse',
-						'diffuseColor', [randomColor, randomColor, randomColor, 1.0],
-						'specularColor', [0.1, 0.1, 0.1, 1.0],
-						'mesh', mesh,
-						'scale', [randomSize, randomSize, randomSize],
-						'translation', offset
-					);
-				}
-			}
-			if ('citylines' === renderObject) {
-				//city
-				node = new Node(
-					'canvas', canvas,
-					'options', options,
-					'renderObject', object,
-					'name', 'citylines',
-					'shaderName', 'ColoredDiffuse',
-					'drawMode', gl.LINES,
-					'diffuseColor', object.color,
-					'lineWidth', options.getfieldvalue('linewidth', 1),
-					'scale', [object.scale, object.scale, object.scale],
-					'rotation', [0, 0, 0]
-				);
-
-				//For each target city, calculate the shortest line across the earth by performing a quaternion slerp.
-				//Treat source and target city as vectors to rotate to from the north pole.
-				//Then, slerp between the two rotations, and generate points across equidistance points on the earth to create the line.
-				var north = vec3.fromValues(0, 1, 0);
-				var source = object.source;
-				var sourceXYZ = vec3.fromValues(xcity[source], zcity[source], -ycity[source]);
-				var radius = vec3.length(sourceXYZ);
-				var lineSteps = 50;
-				var lineX = [];
-				var lineY = [];
-				var lineZ = [];
-				var lineXYZ = vec3.create();
-
-				for (var i = 0; i < object.targets.length; i++) {
-					var target = object.targets[i];
-					var targetXYZ = vec3.fromValues(xcity[target], zcity[target], -ycity[target]);
-					var axis = vec3.cross(vec3.create(), sourceXYZ, targetXYZ);
-					vec3.normalize(axis, axis);
-
-					//Get the total angle between the two cities.
-					var sourceXYZAxis = vec3.normalize(vec3.create(), sourceXYZ);
-					var targetXYZAxis = vec3.normalize(vec3.create(), targetXYZ);
-					var dotProduct = vec3.dot(sourceXYZAxis, targetXYZAxis);
-					var totalAngle = Math.acos(dotProduct); //theta = arccos(u . v / (||u|| * ||v||); in this case, ||u|| and ||v|| are 1, since u and v are unit vectors.
-
-					var lineQuat = quat.create();
-					for (var j = 1; j <= lineSteps; j++) {
-						//Calculate the partial rotation to obtain points on the line between the two cities.
-						var angle = j / lineSteps * totalAngle;
-						quat.setAxisAngle(lineQuat, axis, angle);
-						quat.normalize(lineQuat, lineQuat);
-						vec3.transformQuat(lineXYZ, sourceXYZ, lineQuat);
-						//GL.LINES needs 2 points for each line - at the beginning, just use the sourceXYZ.
-						//TODO: Eliminate this if statement.
-						if (j === 1) {
-							lineX.push(sourceXYZ[0]);
-							lineY.push(sourceXYZ[1]);
-							lineZ.push(sourceXYZ[2]);
-						} else {
-							lineX.push(lineX[lineX.length - 1]);
-							lineY.push(lineY[lineY.length - 1]);
-							lineZ.push(lineZ[lineZ.length - 1]);
-						}
-						lineX.push(lineXYZ[0]);
-						lineY.push(lineXYZ[1]);
-						lineZ.push(lineXYZ[2]);
-					}
-				}
-				node.patch('Vertices', [lineX, lineY, lineZ]);
-			}
-		}
-	} //}}}
+	//{{{ Data marker
+	// TODO: Default parameters are already being handled by /js/vesl/DataMarker.js::constructor, so perhaps we should be initializing this elsewhere and/or by some other manner	
+	if (vesl.helpers.isEmptyOrUndefined(canvas.dataMarker)) { // Only define data marker once
+		let dataMarker 			= {};
+		let dataMarkerOptions 	= options.getfieldvalue('dataMarker', {});
+		
+		dataMarker = {
+			enabled: defaultFor(dataMarkerOptions.enabled, false)
+		};
+		
+		// Only initialize data marker object if we have enabled data markers for this canvas
+		if (dataMarker.enabled) {
+			dataMarker.object = new vesl.DataMarker(
+				{
+					canvas 			: canvas,
+					hasMarker 		: defaultFor(dataMarkerOptions.hasMarker, true),
+					markerImgPath 	: defaultFor(dataMarkerOptions.markerImgPath, '/canvas/data-markers/data-marker.svg'),
+					hasTooltip		: defaultFor(dataMarkerOptions.hasTooltip, false),
+					tooltipFormat	: defaultFor(dataMarkerOptions.tooltipFormat, ''),
+					tooltipFields	: defaultFor(dataMarkerOptions.tooltipFields, null),
+					width			: defaultFor(dataMarkerOptions.width, 32),
+					height			: defaultFor(dataMarkerOptions.height, 32)
+				}
+			);
+		}
+		
+		canvas.dataMarker = dataMarker;
+	}
+	//}}}
+	//contours
+	if (options.exist('contourlevels')) {
+		plot_contour(md,data,options,canvas);
+	}
 } //}}}
-
-function randomizeCloudHeight(canvasGroundHeight, object) {
-		// -+7000 seems a reasonable range
-		var maxHeight = object.height + 7000;
-		var minHeigth = object.height - 7000;
-		var randomHeight = (Math.random() * (maxHeight - minHeigth)) + minHeigth;
-
-		return canvasGroundHeight + randomHeight;
-}
-
-// assumes that originAxisValue is the mid-value between min and max.
-function randomizeAxis(originAxisValue, range) {
-		return originAxisValue + (Math.random() - 0.5) * (range * 2);
-}
-
-function randomizeCloudSize(scale) {
-	var maxResize = 1.3;
-	var minResize = 0.5;
-	var randomizationFactor = Math.random() * (maxResize - minResize) + minResize;
-	return scale * randomizationFactor;
-}
-
-function randomizeCloudColor() {
-	var lighestColor = 1;
-	var darkestColor = 0.9;
-	var randomColor = Math.random() * (lighestColor - darkestColor) + darkestColor;
-	return randomColor;
-}
+function drawGroundingLines(md, canvas, options, renderObject, lines, colors) { //{{{
+	let renderObjects = options.getfieldvalue('render',{});
+	let state = canvas.state;
+	let scene = state.scene;
+	
+	let group = scene.getObjectByName('groundingLines');
+	if (group !== undefined) {
+		scene.remove(group); //Remove old group if already exists
+	}
+	group = new THREE.Group();
+	group.name = 'groundingLines';
+	
+	//Plot multiple grounding lines, each consisting of multiple polygons. 
+	for (let i = 0; i < lines.length; i++) {
+		let groundingLine = lines[i]; //of type Proxy (not object or array), thus must iterate without length attribute
+		let color = processColor(colors[i]);
+		let x = [];
+		let y = [];
+		let z = [];
+		//In order to show polygons correctly, must convert from line strip to line segments
+		for (let j in groundingLine) {
+			let polygon = groundingLine[j]
+			let lineStripX = polygon['x'];
+			let lineStripY = polygon['y'];
+			let lineStripZ = polygon['z'];
+			let lineSegmentsX = [lineStripX[0]];
+			let lineSegmentsY = [lineStripY[0]];
+			let lineSegmentsZ = [lineStripZ[0]];
+			//Must push same coordinates as end of previous segment and beginning of next segment
+			for (let k = 1; k < lineStripX.length - 1; k++) {
+				lineSegmentsX.push(lineStripX[k], lineStripX[k]);
+				lineSegmentsY.push(lineStripY[k], lineStripY[k]);
+				lineSegmentsZ.push(lineStripZ[k], lineStripZ[k]);
+			}
+			//Cap off last coordinate
+			lineSegmentsX.push(lineStripX[lineStripX.length - 1]);
+			lineSegmentsY.push(lineStripY[lineStripY.length - 1]);
+			lineSegmentsZ.push(lineStripZ[lineStripZ.length - 1]);
+			//Add polygon coordinates to existing groundingLine
+			x = x.concat(lineSegmentsX);
+			y = y.concat(lineSegmentsY);
+			if (renderObject.followsBed) {
+				z = z.concat(lineSegmentsZ);
+			} else {
+				z = z.concat(NewArrayFill(lineSegmentsX.length, 10 * i));
+			}
+		}
+		z = ArrayScale(z, options.getfieldvalue('heightscale', 1));
+		let vertices = [x, y, z];
+		//console.log('ArrayMin(x):', ArrayMin(x), 'ArrayMax(x):', ArrayMax(x), 'ArrayMin(y):', ArrayMin(y), 'ArrayMax(y):', ArrayMax(y));
+			
+		let node = new Node(
+			'canvas', canvas,
+			'options', options,
+			'renderObject', renderObject,
+			'name', 'groundingLine_' + String(i),
+			'shaderName', 'lines',
+			//'dashed', dashed,
+			'depthTest', false,
+			'diffuseColor', color,
+			'lineWidth', renderObject.lineWidth,
+			//'lineWidth', options.getfieldvalue('linewidth', 3),
+			'scale', [renderObject.scale, renderObject.scale, renderObject.scale]
+		);
+		node.patch('Vertices', vertices, 'group', group, 'ViewReset', false);
+	}
+	scene.add(group);
+	return group;
+} //}}}
+function drawText(state, options, textLabels) { //{{{
+	let camera = state.camera;
+	let overlayCanvas = state.overlayCanvas;
+	let ctx = overlayCanvas.getContext('2d');
+	let widthHalf = overlayCanvas.width / 2
+	let heightHalf = overlayCanvas.height / 2;
+	
+	for (let i = 0; i < textLabels.length; i++) {
+		let textLabel = textLabels[i];
+		let position = textLabel.position.clone();
+		let text = textLabel.text;
+		
+		//Project world coordinates to screenspace coordinates
+		position.project(camera);
+		let x = (position.x * widthHalf) + widthHalf;
+		let y = -(position.y * heightHalf) + heightHalf;
+		
+		ctx.font = 'bold ' + String(options.getfieldvalue('colorbarfontsize', 22))+'px Arial Black, sans-serif';
+		ctx.fillStyle = options.getfieldvalue('colorbarfontcolor','black');
+		ctx.strokeStyle = 'white';
+		ctx.textAlign = 'center';
+		ctx.textBaseline = 'middle';
+		ctx.fillText(text, x, y);
+		ctx.strokeText(text, x, y);
+	}
+} //}}}
+function processColor(color) { //{{{
+	//Update the diffuse color with an RGB color name or vec4 containing r, g, b, and opacity values from 0.0 to 1.0
+	if (typeof color === 'string') {
+		color = new THREE.Color(color);
+	} else if (Array.isArray(color)) {
+		color = new THREE.Color().fromArray(color);
+	}
+	return color;
+} //}}}
Index: /issm/trunk/src/m/plot/applyoptions.m
===================================================================
--- /issm/trunk/src/m/plot/applyoptions.m	(revision 26743)
+++ /issm/trunk/src/m/plot/applyoptions.m	(revision 26744)
@@ -52,5 +52,5 @@
 if exist(options,'axis')
 	axisopts = getfieldvalue(options,'axis');
-	if ischar(axisopts) & contains(axisopts,' ');
+	if ischar(axisopts) & any(axisopts==' ');
 		axisopts = strsplit(axisopts);
 		axis(axisopts{:});
@@ -289,4 +289,41 @@
 		shpdisp(filenamei,1,stylei,linewidthi,getfieldvalue(options,'unit',1));
 	end
+end
+if exist(options,'contours'),
+
+	hold on;
+	contours=getfieldvalue(options,'contours');
+	style=getfieldvalue(options,'contourstyle',{'-'});
+	linewidth=getfieldvalue(options,'linewidth',{1});
+	color=getfieldvalue(options,'contourcolor',{'r'});
+	contourheight=getfieldvalue(options,'contourheight',1); 
+
+	radius=md.solidearth.planetradius;
+	ratio=1+(contourheight*1000/radius);
+
+	
+	if ~isa(contours,'cell'),
+		contours={contours};
+	end
+	nc=length(contours);
+	if ~isa(style,'cell'), error('contour style should be a cell array'); end
+	if ~isa(linewidth,'cell'), error('contour line width should be a cell array'); end
+	if ~isa(color,'cell'), error('contour color should be a cell array'); end
+
+	for i=1:length(contours),
+		ci=contours{i};
+		if length(style)==1, sti=style{1}; else sti=style{i}; end
+		if length(color)==1, coli=color{1}; else coli=color{i}; end
+		if length(linewidth)==1, li=linewidth{1}; else li=linewidth{i}; end
+
+		for j=1:length(ci),
+			cijx=ci(j).x*ratio;
+			cijy=ci(j).y*ratio;
+			cijz=ci(j).z*ratio;
+
+			plot3(cijx,cijy,cijz,'LineWidth',li,'LineStyle',sti,'Color',coli);
+		end
+	end
+
 end
 
@@ -448,10 +485,26 @@
 
 %flag edges of a partition
-if exist(options,'partitionedges') & ~strcmp(getfieldvalue(options,'partitionedges','off'),'off')
-	mdp=getfieldvalue(options,'partitionedges','off');
-	if ischar(mdp)
-		mdp=md;
-	end
-	[xsegments ysegments]=flagedges(mdp.mesh.elements,mdp.mesh.x,mdp.mesh.y,mdp.qmu.partition);
+%
+% TODO:
+% - Figure out how to expand string representing an object (e.g. 
+%	'md.qmu.variables.thickness.partition') to get the actual value *without* 
+%	using `eval` and like functions (md.('token').('token') works, but how do 
+%	we access md given the string 'md').
+if exist(options,'partition')
+	partition=getfieldvalue(options,'partition','');
+	if isvector(partition) & isnumeric(partition) % partition option is vector
+		% do nothing: we already have a partition vector
+	% elseif ischar(partition) & ~isempty(partition) % partition option is string
+	% 	% expand string
+	% 	partition=eval(partition);
+	% 	class(partition);
+	% 	if ~(isvector(partition) & isnumeric(partition))
+	% 		error('String passed to ''partition'' option does not represent a partition vector');
+	% 	end
+	else
+		error('If ''partition'' option is supplied, it should be a partition vector object');
+	end
+	mdp=md;
+	[xsegments ysegments]=flagedges(mdp.mesh.elements,mdp.mesh.x,mdp.mesh.y,partition);
 	xsegments=xsegments*getfieldvalue(options,'unit',1);
 	ysegments=ysegments*getfieldvalue(options,'unit',1);
Index: /issm/trunk/src/m/plot/checkplotoptions.py
===================================================================
--- /issm/trunk/src/m/plot/checkplotoptions.py	(revision 26743)
+++ /issm/trunk/src/m/plot/checkplotoptions.py	(revision 26744)
@@ -3,21 +3,20 @@
 
 def checkplotoptions(md, options):
-    '''
-    CHECKPLOTOPTIONS - build a structure that holds all plot options
+    """CHECKPLOTOPTIONS - build a structure that holds all plot options
 
-        Usage:
-            options = checkplotoptions(md, options)
+    Usage:
+        options = checkplotoptions(md, options)
 
-        See also: PLOTMODEL
+    See also: PLOTMODEL
 
-        NOTE: not fully implemented yet
-    '''
+    NOTE: not fully implemented yet
+    """
 
     # {{{ units
     if options.exist('unit'):
         if 'km' in options.getfieldvalue('unit', 'km'):
-            options.changefieldvalue('unit', 10**-3)
+            options.changefieldvalue('unit', pow(10, -3))
         elif '100km' in options.getfieldvalue('unit', '100km'):
-            options.changefieldvalue('unit', 10**-5)
+            options.changefieldvalue('unit', pow(10, -5))
     # }}}
     # {{{ density
@@ -62,5 +61,5 @@
         textlist.extend([text] if isinstance(text, str) else text)
         numtext = len(textlist)
-    # text position
+        # text position
         textpos = options.getfieldvalue('textposition', [0.5, 0.5])
         if not isinstance(textpos, list):
@@ -75,5 +74,5 @@
             raise Exception('textposition should contain one list of x, y vertices for every text instance')
 
-    # font size
+        # font size
         if options.exist('textfontsize'):
             textfontsize = options.getfieldvalue('textfontsize', 12)
@@ -85,5 +84,5 @@
             sizelist = np.tile(sizelist, numtext)
 
-    # font color
+        # font color
         if options.exist('textcolor'):
             textcolor = options.getfieldvalue('textcolor', 'k')
@@ -95,5 +94,5 @@
             colorlist = np.tile(colorlist, numtext)
 
-    # textweight
+        # textweight
         if options.exist('textweight'):
             textweight = options.getfieldvalue('textweight')
@@ -105,5 +104,5 @@
             weightlist = np.tile(weightlist, numtext)
 
-    # text rotation
+        # text rotation
         if options.exist('textrotation'):
             textrotation = options.getfieldvalue('textrotation', 0)
@@ -152,5 +151,5 @@
     if options.exist('northarrow'):
         if 'on' in options.getfieldvalue('northarrow', 'on'):
-            #default values
+            # default values
             Lx = max(md.mesh.x) - min(md.mesh.x)
             Ly = max(md.mesh.y) - min(md.mesh.y)
Index: /issm/trunk/src/m/plot/colormaps/cmocean.m
===================================================================
--- /issm/trunk/src/m/plot/colormaps/cmocean.m	(revision 26744)
+++ /issm/trunk/src/m/plot/colormaps/cmocean.m	(revision 26744)
@@ -0,0 +1,6989 @@
+function cmap = cmocean(ColormapName,varargin) 
+% cmocean returns perceptually-uniform colormaps created by Kristen Thyng. 
+% 
+%% Syntax 
+% 
+%  cmocean 
+%  cmap = cmocean('ColormapName') 
+%  cmap = cmocean('-ColormapName') 
+%  cmap = cmocean(...,NLevels)
+%  cmap = cmocean(...,'pivot',PivotValue) 
+%  cmap = cmocean(...,'negative') 
+%  cmocean(...)
+% 
+%% Description 
+% 
+% cmocean without any inputs displays the options for colormaps. 
+% 
+% cmap = cmocean('ColormapName') returns a 256x3 colormap. ColormapName can be any of 
+% of the following: 
+% 
+%          SEQUENTIAL:                DIVERGING: 
+%          'thermal'                  'balance'
+%          'haline'                   'delta'
+%          'solar'                    'curl'
+%          'ice'                      'diff'
+%          'gray'                     'tarn'
+%          'oxy' 
+%          'deep'                     CONSTANT LIGHTNESS:
+%          'dense'                    'phase'
+%          'algae'                
+%          'matter'                   OTHER:
+%          'turbid'                   'topo'
+%          'speed'                    
+%          'amp'
+%          'tempo'
+%          'rain'
+%
+% cmap = cmocean('-ColormapName') a minus sign preceeding any ColormapName flips the
+% order of the colormap. 
+%
+% cmap = cmocean(...,NLevels) specifies a number of levels in the colormap.  Default
+% value is 256. 
+%
+% cmap = cmocean(...,'pivot',PivotValue) centers a diverging colormap such that white 
+% corresponds to a given value and maximum extents are set using current caxis limits. 
+% If no PivotValue is set, 0 is assumed. Early versions of this function used 'zero'
+% as the syntax for 'pivot',0 and the old syntax is still supported. 
+%
+% cmap = cmocean(...,'negative') inverts the lightness profile of the colormap. This can be 
+% useful particularly for divergent colormaps if the default white point of divergence
+% gets lost in a white background. 
+% 
+% cmocean(...) without any outputs sets the current colormap to the current axes.  
+% 
+%% Examples 
+% Using this sample plot: 
+% 
+%   imagesc(peaks(1000)+1)
+%   colorbar
+% 
+% Set the colormap to 'algae': 
+% 
+%   cmocean('algae') 
+% 
+% Same as above, but with an inverted algae colormap: 
+% 
+%   cmocean('-algae')
+% 
+% Set the colormap to a 12-level 'solar': 
+% 
+%   cmocean('solar',12)
+% 
+% Get the RGB values of a 5-level thermal colormap: 
+% 
+%   RGB = cmocean('thermal',5)
+% 
+% Some of those values are below zero and others are above. If this dataset represents
+% anomalies, perhaps a diverging colormap is more appropriate: 
+% 
+%   cmocean('balance') 
+% 
+% It's unlikely that 1.7776 is an interesting value about which the data values 
+% diverge.  If you want to center the colormap on zero using the current color 
+% axis limits, simply include the 'pivot' option:  
+% 
+%   cmocean('balance','pivot',0) 
+%
+%% Author Info 
+% This function was written by Chad A. Greene of the Institute for Geophysics at the 
+% University of Texas at Austin (UTIG), June 2016, using colormaps created by Kristen
+% Thyng of Texas A&M University, Department of Oceanography. More information on the
+% cmocean project can be found at http://matplotlib.org/cmocean/. 
+% 
+%% Citing this colormap: 
+% If you find an occasion to cite these colormaps for any reason, or if you just want
+% some nice beach reading, check out the following paper from the journal Oceanography: 
+% 
+% Thyng, K.M., C.A. Greene, R.D. Hetland, H.M. Zimmerle, and S.F. DiMarco. 2016. True 
+% colors of oceanography: Guidelines for effective and accurate colormap selection. 
+% Oceanography 29(3):9?13, http://dx.doi.org/10.5670/oceanog.2016.66.
+% 
+% See also colormap and caxis.  
+
+%% Display colormap options: 
+
+if nargin==0
+   figure('menubar','none','numbertitle','off','Name','cmocean options:')
+   
+   if license('test','image_toolbox')
+      imshow(imread('cmocean.png')); 
+   else
+      axes('pos',[0 0 1 1])
+      image(imread('cmocean.png')); 
+      axis image off
+   end
+   
+   return
+end
+%% Error checks: 
+
+assert(isnumeric(ColormapName)==0,'Input error: ColormapName must be a string.') 
+
+%% Set defaults: 
+
+NLevels = 256; 
+autopivot = false; 
+PivotValue = 0; 
+InvertedColormap = false; 
+
+%% Parse inputs: 
+
+% Does user want to flip the colormap direction? 
+dash = regexp(ColormapName,'-'); 
+if any(dash) 
+   InvertedColormap = true; 
+   ColormapName(dash) = []; 
+end
+
+% Forgive the British: 
+if strncmpi(ColormapName,'grey',4)
+   ColormapName = 'gray'; 
+end
+
+% Does the user want a "negative" version of the colormap (with an inverted lightness profile)? 
+tmp = strncmpi(varargin,'negative',3); 
+if any(tmp) 
+   negativeColormap = true; 
+   varargin = varargin(~tmp); 
+else
+   negativeColormap = false; 
+end
+
+% Does the user want to center a diverging colormap on a specific value? 
+% This parsing support original 'zero' syntax and current 'pivot' syntax. 
+ tmp = strncmpi(varargin,'pivot',3) | strncmpi(varargin,'zero',3); % Thanks to Phelype Oleinik for this suggestion. 
+ if any(tmp) 
+   autopivot = true; 
+   try
+      if isscalar(varargin{find(tmp)+1})
+         PivotValue = varargin{find(tmp)+1}; 
+         tmp(find(tmp)+1) = 1; 
+      end
+   end
+   varargin = varargin(~tmp); 
+end
+
+% Has user requested a specific number of levels? 
+tmp = isscalar(varargin); 
+if any(tmp) 
+   NLevels = varargin{tmp}; 
+end
+
+
+%% Load RGB values and interpolate to NLevels: 
+
+cmap = cmoceanRawRGB(ColormapName); % a subfunction provided below with RGB values of all maps. 
+
+if negativeColormap
+   
+   % Convert RGB to LAB colorspace: 
+   LAB = colorspace('RGB->LAB',cmap); 
+
+   % Operate on the lightness profile: 
+   L = LAB(:,1); 
+
+   % Flip the lightness profile and set the lowest point to black:
+   L = max(L) - L; 
+
+   % Stretch the lightness profile to make the lightest bits 95% white. (Going 100% white
+   % would make the ends of a divergent profile impossible to distinguish.)
+   L = L*(95/max(L)); 
+
+   % Make a new LAB matrix: 
+   LAB = [L LAB(:,2:3)]; 
+   
+   % Convert LAB back to RGB: 
+   cmap = colorspace('LAB->RGB',LAB); 
+end
+
+%% Invert the colormap if requested by user: 
+
+if InvertedColormap
+   cmap = flipud(cmap); 
+end
+
+%% Adjust values to current caxis limits? 
+
+if autopivot
+   clim = caxis; 
+   assert(PivotValue>=clim(1) & PivotValue<=clim(2),'Error: pivot value must be within the current color axis limits.') 
+   maxval = max(abs(clim-PivotValue)); 
+   cmap = interp1(linspace(-maxval,maxval,size(cmap,1))+PivotValue, cmap, linspace(clim(1),clim(2),size(cmap,1)),'linear');
+end
+
+%% Interpolate if necessary: 
+
+if NLevels~=size(cmap,1)
+   cmap = interp1(1:size(cmap,1), cmap, linspace(1,size(cmap,1),NLevels),'linear');
+end
+
+%% Clean up 
+
+if nargout==0
+   colormap(gca,cmap) 
+   clear cmap  
+end
+
+
+
+%%  S U B F U N C T I O N S 
+
+
+function RGB = cmoceanRawRGB(cmapName) 
+
+
+switch lower(cmapName(1:3))
+   case {'dee'} 
+      RGB = [9.928371765383620096e-01 9.943734553013935384e-01 8.001361955494933342e-01
+9.849374457410008388e-01 9.913545172197536504e-01 7.953271573982337861e-01
+9.770418482420034634e-01 9.883418276673759939e-01 7.905717472557142189e-01
+9.691488355955474310e-01 9.853357520972024775e-01 7.858697059005903540e-01
+9.612382061888059548e-01 9.823439661710483550e-01 7.812181455049906909e-01
+9.533233708513803029e-01 9.793607550577946297e-01 7.766197776697654209e-01
+9.454069776374501854e-01 9.763847481120443428e-01 7.720753845210462929e-01
+9.374799177499437697e-01 9.734191074102575003e-01 7.675843461643131471e-01
+9.295353395208965086e-01 9.704660061861888343e-01 7.631467470398153319e-01
+9.215850348376466439e-01 9.675205198521025229e-01 7.587646801057830181e-01
+9.136274030668488644e-01 9.645828701859077148e-01 7.544386825530340346e-01
+9.056514559384564178e-01 9.616567079910524063e-01 7.501688017241657791e-01
+8.976569922484586295e-01 9.587415918264282633e-01 7.459562027416458685e-01
+8.896512126622908578e-01 9.558344072358454513e-01 7.418023698547455691e-01
+8.816325974742758032e-01 9.529352564923027069e-01 7.377082218108865774e-01
+8.735986658557798323e-01 9.500445573198598170e-01 7.336747582572585857e-01
+8.655355018678880796e-01 9.471666805105979359e-01 7.297031220835451526e-01
+8.574559441871676402e-01 9.442965454208677167e-01 7.257948454644865821e-01
+8.493586413080321806e-01 9.414341108550433601e-01 7.219511807036801398e-01
+8.412422934868647451e-01 9.385792958890862847e-01 7.181734629573161000e-01
+8.331056602292961077e-01 9.357319779845385543e-01 7.144631077114116380e-01
+8.249438571064254822e-01 9.328932140048489252e-01 7.108218561594963347e-01
+8.167536485550084269e-01 9.300634438432798801e-01 7.072516022427790539e-01
+8.085407925860420564e-01 9.272401607530683654e-01 7.037535913222745521e-01
+8.003043988510905038e-01 9.244230580301131539e-01 7.003294929842703853e-01
+7.920436855303579771e-01 9.216117772405966191e-01 6.969810377273069069e-01
+7.837579923068553889e-01 9.188059058340631857e-01 6.937100117646464170e-01
+7.754467945117471395e-01 9.160049747102424478e-01 6.905182510191696377e-01
+7.671097184662585278e-01 9.132084557727712104e-01 6.874076341947011892e-01
+7.587465580267132026e-01 9.104157595099175992e-01 6.843800748081978469e-01
+7.503572923166539343e-01 9.076262326497597233e-01 6.814375120698907828e-01
+7.419421046029871514e-01 9.048391559449654453e-01 6.785819005039074314e-01
+7.335014022414247936e-01 9.020537421501462205e-01 6.758151982106467281e-01
+7.250358375800118882e-01 8.992691342626382145e-01 6.731393536848668813e-01
+7.165463296678448168e-01 8.964844041051395207e-01 6.705562911206142118e-01
+7.080340865696405084e-01 8.936985513356989763e-01 6.680678941563225059e-01
+6.995006280355556827e-01 8.909105029766873907e-01 6.656759880411459163e-01
+6.909478082204841831e-01 8.881191135591984809e-01 6.633823202371271766e-01
+6.823778380886152961e-01 8.853231659823359578e-01 6.611885395113676900e-01
+6.737933070789577927e-01 8.825213731875580780e-01 6.590961736178440056e-01
+6.651972035471812594e-01 8.797123807461469935e-01 6.571066057195337207e-01
+6.565929334411800822e-01 8.768947704523611941e-01 6.552210497573525139e-01
+6.479843366143701600e-01 8.740670650055498703e-01 6.534405250319036407e-01
+6.393757001353049807e-01 8.712277338509245572e-01 6.517658303256151919e-01
+6.307693113306602761e-01 8.683757593089920235e-01 6.501986071208971651e-01
+6.221681809999368706e-01 8.655099786991408140e-01 6.487403091120448329e-01
+6.135828162115329887e-01 8.626276255310663110e-01 6.473888753222819537e-01
+6.050194699551968425e-01 8.597270135144634562e-01 6.461439080647282118e-01
+5.964848373853082197e-01 8.568064537576968176e-01 6.450046593443751197e-01
+5.879840953182007279e-01 8.538646600753627691e-01 6.439710905713145195e-01
+5.795218127572832056e-01 8.509005270271372545e-01 6.430435569229606685e-01
+5.711115213696185133e-01 8.479112775740021979e-01 6.422171169895777298e-01
+5.627614837100215484e-01 8.448953489705807174e-01 6.414893854468299850e-01
+5.544783665092802849e-01 8.418515860497588488e-01 6.408587965640016870e-01
+5.462695843545278818e-01 8.387787842708503971e-01 6.403232223573597226e-01
+5.381481232862911357e-01 8.356748924828519831e-01 6.398763669277579558e-01
+5.301228248165350543e-01 8.325387580839158641e-01 6.395142187190840932e-01
+5.221997330825246530e-01 8.293697946738645133e-01 6.392346216632595057e-01
+5.143908532894702068e-01 8.261665755050031645e-01 6.390304309659169402e-01
+5.067050118087177424e-01 8.229283397233977393e-01 6.388963162980869637e-01
+4.991495064662723746e-01 8.196546689563362076e-01 6.388277739100475250e-01
+4.917330703220189059e-01 8.163450533427777378e-01 6.388184799685107107e-01
+4.844633050708381794e-01 8.129992646664957467e-01 6.388624455765857801e-01
+4.773469739538908629e-01 8.096172922533247940e-01 6.389538165444101914e-01
+4.703904182695624603e-01 8.061992786917829834e-01 6.390864379965265352e-01
+4.635986539031755060e-01 8.027456073395251579e-01 6.392548734619343254e-01
+4.569766618393767410e-01 7.992567478306369377e-01 6.394529319719780558e-01
+4.505287643111087204e-01 7.957333261733031682e-01 6.396742566585853496e-01
+4.442569334258392177e-01 7.921762343010834151e-01 6.399148201157260907e-01
+4.381634653667463852e-01 7.885863788123392837e-01 6.401694292235835526e-01
+4.322513883314121341e-01 7.849647158245569578e-01 6.404304190942151642e-01
+4.265195639210723755e-01 7.813124732411278472e-01 6.406960731925235297e-01
+4.209679602144861810e-01 7.776308288475485275e-01 6.409622276506293792e-01
+4.155968407812616339e-01 7.739210344346504344e-01 6.412227317683711902e-01
+4.104045242070183952e-01 7.701844253858858291e-01 6.414742347181462412e-01
+4.053883482522956383e-01 7.664223146281371468e-01 6.417151578859574546e-01
+4.005459328058830759e-01 7.626360316845265386e-01 6.419424749255564500e-01
+3.958750262046074608e-01 7.588270315806920907e-01 6.421508285001665817e-01
+3.913718273240804346e-01 7.549966666219802836e-01 6.423387337484185444e-01
+3.870322615152646528e-01 7.511462095764531721e-01 6.425055472082883412e-01
+3.828523536620307977e-01 7.472769743775978801e-01 6.426493131526664904e-01
+3.788278449989629926e-01 7.433902546660990929e-01 6.427683061328856029e-01
+3.749542811367644335e-01 7.394876286687900313e-01 6.428573615340694714e-01
+3.712266123106295335e-01 7.355700686179795778e-01 6.429189618774799886e-01
+3.676399929257251897e-01 7.316387718079003788e-01 6.429520487195032885e-01
+3.641894512092864744e-01 7.276949011320993366e-01 6.429557270674552960e-01
+3.608699207518579755e-01 7.237395816489646805e-01 6.429292709767442382e-01
+3.576762479926827720e-01 7.197739138067411613e-01 6.428719883285997083e-01
+3.546027248366774298e-01 7.157992458648064771e-01 6.427810759039616073e-01
+3.516446005650431528e-01 7.118162697085735902e-01 6.426589560156208414e-01
+3.487967412412643076e-01 7.078259414050183107e-01 6.425054728664090220e-01
+3.460540467004642462e-01 7.038291754672099110e-01 6.423205839967465192e-01
+3.434114694865876838e-01 6.998268449671132263e-01 6.421043512357870187e-01
+3.408640318201912600e-01 6.958197818437616977e-01 6.418569321473704958e-01
+3.384068406811324148e-01 6.918087773726725453e-01 6.415785719753461791e-01
+3.360351011011302735e-01 6.877945827659479594e-01 6.412695960850323118e-01
+3.337441277691141628e-01 6.837779098758932639e-01 6.409304028912300444e-01
+3.315291322901112725e-01 6.797595093162658308e-01 6.405610222271946874e-01
+3.293855731203558790e-01 6.757400463409192204e-01 6.401618521317685717e-01
+3.273095072934468774e-01 6.717199943156246800e-01 6.397341828681051279e-01
+3.252967835603527980e-01 6.676999151191671533e-01 6.392786349130804568e-01
+3.233433949344308722e-01 6.636803359579184214e-01 6.387958727683986648e-01
+3.214454825944703664e-01 6.596617502568347113e-01 6.382866005148117861e-01
+3.195993388733257556e-01 6.556446185422359907e-01 6.377515576836865208e-01
+3.178014094235615539e-01 6.516293693095515094e-01 6.371915154212616228e-01
+3.160482946464280851e-01 6.476163998706647718e-01 6.366072729215248582e-01
+3.143367504654775990e-01 6.436060771766987099e-01 6.359996541044424800e-01
+3.126636885203824545e-01 6.395987386132337971e-01 6.353695045172913503e-01
+3.110261758511674857e-01 6.355946927658273626e-01 6.347176884379418516e-01
+3.094214341373541788e-01 6.315942201545601264e-01 6.340450861601970578e-01
+3.078468385510386152e-01 6.275975739369872297e-01 6.333525914425652825e-01
+3.062999162775806861e-01 6.236049805794583456e-01 6.326411091031564071e-01
+3.047783447524610168e-01 6.196166404972232034e-01 6.319115527447410896e-01
+3.032799496578738041e-01 6.156327286641396501e-01 6.311648425953061414e-01
+3.018027027180503197e-01 6.116533951930802626e-01 6.304019034507418739e-01
+3.003447193279823457e-01 6.076787658883653354e-01 6.296236627075371128e-01
+2.989042560461285802e-01 6.037089427717098333e-01 6.288310484745529561e-01
+2.974797079780254205e-01 5.997440045832753697e-01 6.280249877540684533e-01
+2.960696060742640245e-01 5.957840072594756675e-01 6.272064046833601969e-01
+2.946726143633343065e-01 5.918289843891730850e-01 6.263762188290394883e-01
+2.932875271368584058e-01 5.878789476499071132e-01 6.255353435272825724e-01
+2.919132661023912667e-01 5.839338872257091584e-01 6.246846842638799080e-01
+2.905488775167375803e-01 5.799937722079637759e-01 6.238251370887518688e-01
+2.891935293105973304e-01 5.760585509806988025e-01 6.229575870601862242e-01
+2.878465082138687570e-01 5.721281515915097593e-01 6.220829067145717817e-01
+2.865071747347951447e-01 5.682024945496734203e-01 6.212019079466474247e-01
+2.851749861947763254e-01 5.642814857106783766e-01 6.203153697409601319e-01
+2.838497050469647731e-01 5.603649539888247988e-01 6.194242689076802089e-01
+2.825310677598035780e-01 5.564527485481920444e-01 6.185294158631611250e-01
+2.812189151446758406e-01 5.525446999518639490e-01 6.176316008625786225e-01
+2.799131896111074491e-01 5.486406204645675189e-01 6.167315925457064196e-01
+2.786139324558262742e-01 5.447403043452749838e-01 6.158301364812402978e-01
+2.773212811865227168e-01 5.408435281299215358e-01 6.149279537054621603e-01
+2.760354668808263079e-01 5.369500509042623992e-01 6.140257392505246159e-01
+2.747568115804877587e-01 5.330596145668072827e-01 6.131241606570347891e-01
+2.734857257205313141e-01 5.291719440816851083e-01 6.122238564648385672e-01
+2.722227055926091377e-01 5.252867477212617153e-01 6.113254346750160995e-01
+2.709683308416185876e-01 5.214037172983150281e-01 6.104294711750373192e-01
+2.697232619941725140e-01 5.175225283875982685e-01 6.095365081178055755e-01
+2.684882380171457750e-01 5.136428405367017280e-01 6.086470522439324515e-01
+2.672640739041831637e-01 5.097642974662250914e-01 6.077615731349965689e-01
+2.660516582874621339e-01 5.058865272594796902e-01 6.068805013837572648e-01
+2.648519510715739433e-01 5.020091425421505660e-01 6.060042266652778675e-01
+2.636659810857353015e-01 4.981317406526836744e-01 6.051330956906521008e-01
+2.624948437498288434e-01 4.942539038045714039e-01 6.042674100224807443e-01
+2.613396987489819967e-01 4.903751992421883643e-01 6.034074237284018372e-01
+2.602017811880152354e-01 4.864951750164123179e-01 6.025533553474511361e-01
+2.590825816132030779e-01 4.826133005480903182e-01 6.017055804809932074e-01
+2.579832374637801018e-01 4.787291639776031782e-01 6.008639770499764055e-01
+2.569051367797046126e-01 4.748422758923547815e-01 6.000285749995881712e-01
+2.558497193309375306e-01 4.709521329962904068e-01 5.991993407256713811e-01
+2.548184740794410263e-01 4.670582183399953347e-01 5.983761730113198452e-01
+2.538129365659009817e-01 4.631600015854966945e-01 5.975588985257048735e-01
+2.528346862021874641e-01 4.592569393176054171e-01 5.967472668238706923e-01
+2.518853434473967146e-01 4.553484754161292725e-01 5.959409447786497838e-01
+2.509665668417216944e-01 4.514340415062205181e-01 5.951395103673859932e-01
+2.500800498681828299e-01 4.475130575075850214e-01 5.943424457267542094e-01
+2.492275176071283571e-01 4.435849323073600692e-01 5.935491293785424283e-01
+2.484107231427581941e-01 4.396490645862106139e-01 5.927588275177814170e-01
+2.476314436738927260e-01 4.357048438328084417e-01 5.919706842419948378e-01
+2.468914762732849488e-01 4.317516515883728090e-01 5.911837105866416531e-01
+2.461926332303804310e-01 4.277888629705645096e-01 5.903967722170088139e-01
+2.455367369014649914e-01 4.238158485348740845e-01 5.896085756110598375e-01
+2.449256139784778408e-01 4.198319765418777605e-01 5.888176525512366366e-01
+2.443611399380560822e-01 4.158365980702596332e-01 5.880223891276964432e-01
+2.438461792188084676e-01 4.118287207942545325e-01 5.872218507211212080e-01
+2.433817108226277726e-01 4.078080077755985022e-01 5.864131553289283483e-01
+2.429695407602900925e-01 4.037738393736669540e-01 5.855939512690606641e-01
+2.426114394907277760e-01 3.997256137994158465e-01 5.847615988448080504e-01
+2.423091294682429564e-01 3.956627542073260506e-01 5.839131390484204598e-01
+2.420642707838099872e-01 3.915847171721096864e-01 5.830452587571144374e-01
+2.418784445905285962e-01 3.874910027793410650e-01 5.821542521747482546e-01
+2.417531339648231747e-01 3.833811665857123074e-01 5.812359783131098023e-01
+2.416897018162703636e-01 3.792548337300427064e-01 5.802858143751018494e-01
+2.416907565718227624e-01 3.751112253980636857e-01 5.792995847596160708e-01
+2.417595622535183009e-01 3.709493751547713325e-01 5.782729391945388153e-01
+2.418940089237943680e-01 3.667702659833258494e-01 5.771972660307567171e-01
+2.420946965383475313e-01 3.625739944720036134e-01 5.760653956197256953e-01
+2.423619198524908369e-01 3.583608468185064400e-01 5.748693688323588402e-01
+2.426978313653707087e-01 3.541305556383861908e-01 5.736016010478480753e-01
+2.431056167697961956e-01 3.498826161637011989e-01 5.722540340252517677e-01
+2.435790408918375727e-01 3.456199709880173332e-01 5.708127541670769967e-01
+2.441164681518231960e-01 3.413441041408621368e-01 5.692658625959313712e-01
+2.447220255685461088e-01 3.370546900675063240e-01 5.676029832475817383e-01
+2.453897790312707938e-01 3.327551263503047418e-01 5.658082210414479007e-01
+2.461121481740833894e-01 3.284495884603169102e-01 5.638648470620498676e-01
+2.468912126448456479e-01 3.241391993124722593e-01 5.617586120246663706e-01
+2.477157002362878613e-01 3.198299095156284522e-01 5.594704462476630669e-01
+2.485761162021524751e-01 3.155272777788998839e-01 5.569822129976372826e-01
+2.494682375867288693e-01 3.112353605277175528e-01 5.542766318947622839e-01
+2.503729202057394798e-01 3.069632816204772574e-01 5.513352372309007210e-01
+2.512817651002536290e-01 3.027167370222472731e-01 5.481422664464320471e-01
+2.521753740527091225e-01 2.985048904754492582e-01 5.446839245346258851e-01
+2.530378388279626023e-01 2.943355684042912035e-01 5.409499814033098541e-01
+2.538514672799476179e-01 2.902167617845944347e-01 5.369345375383627328e-01
+2.545978636988186494e-01 2.861560770732184955e-01 5.326370186681820273e-01
+2.552597334794323158e-01 2.821600341185547811e-01 5.280624026249696179e-01
+2.558254018044066047e-01 2.782328077909240194e-01 5.232189983935346955e-01
+2.562737222001675308e-01 2.743799915974786674e-01 5.181261586082565040e-01
+2.566051651711689918e-01 2.706008890121900934e-01 5.127963599343589030e-01
+2.568071232679735028e-01 2.668971447705413280e-01 5.072541841677337127e-01
+2.568729082739400482e-01 2.632680806498599591e-01 5.015251413221865073e-01
+2.568088786232387566e-01 2.597098435540172168e-01 4.956253550777797723e-01
+2.566151212870083631e-01 2.562195453869526296e-01 4.895770754997314511e-01
+2.562879598478859378e-01 2.527944349049762174e-01 4.834087259028412853e-01
+2.558322794870629413e-01 2.494300496133808887e-01 4.771399728195321877e-01
+2.552572079534596305e-01 2.461214417402471932e-01 4.707834286138410929e-01
+2.545675711557803811e-01 2.428643843006248471e-01 4.643557571030281772e-01
+2.537686502971923108e-01 2.396546885092911139e-01 4.578718126285494239e-01
+2.528659964243425984e-01 2.364882912834416206e-01 4.513446141213755536e-01
+2.518652755598765891e-01 2.333613180085921113e-01 4.447853910070804773e-01
+2.507721436866522935e-01 2.302701237479483076e-01 4.382036814126420432e-01
+2.495921493408267966e-01 2.272113165747541852e-01 4.316074651476269897e-01
+2.483306606950595463e-01 2.241817667402334346e-01 4.250033167249620547e-01
+2.469928136315570621e-01 2.211786051187170643e-01 4.183965667275956202e-01
+2.455817950644241798e-01 2.181991605590304917e-01 4.117955160707330586e-01
+2.440963016438912891e-01 2.152407079180826410e-01 4.052187485307188752e-01
+2.425474613143962510e-01 2.123011804696942062e-01 3.986531809377649171e-01
+2.409394174709658110e-01 2.093786088479052676e-01 3.921004515047561423e-01
+2.392760085101002243e-01 2.064712127546999287e-01 3.855616338648150121e-01
+2.375559510487991743e-01 2.035768990151702318e-01 3.790513023869773179e-01
+2.357791582066215419e-01 2.006936504843463420e-01 3.725810406048237766e-01
+2.339566833930070699e-01 1.978208439176197264e-01 3.661282774694271658e-01
+2.320913707908846546e-01 1.949572807641995476e-01 3.596924727656225507e-01
+2.301734316844865069e-01 1.921000566693645550e-01 3.533131710447778295e-01
+2.282155151615900546e-01 1.892493734782149939e-01 3.469585312854190362e-01
+2.262221013532286218e-01 1.864046213456004575e-01 3.406203233993785884e-01
+2.241821302892643142e-01 1.835626593748518609e-01 3.343431537784405938e-01
+2.221083620693462546e-01 1.807243380946543521e-01 3.280900612914751102e-01
+2.200027865362182422e-01 1.778889096627078448e-01 3.218593457818205161e-01
+2.178554139765243036e-01 1.750533261852178779e-01 3.156932341101472139e-01
+2.156819223383368844e-01 1.722195412332822306e-01 3.095395593647118360e-01
+2.134730781003147948e-01 1.693846918206770857e-01 3.034377234324792671e-01
+2.112350828916275125e-01 1.665490510713014960e-01 2.973690772834624574e-01
+2.089702734855372057e-01 1.637121940546225618e-01 2.913286801723345421e-01
+2.066728560428846562e-01 1.608719311731062473e-01 2.853437530392856081e-01
+2.043551063834350701e-01 1.580301135357929931e-01 2.793689192405632293e-01
+2.020028382233076125e-01 1.551826890051333785e-01 2.734655011163185101e-01
+1.996333580091984583e-01 1.523327614839000976e-01 2.675659276139747411e-01
+1.972319620276792862e-01 1.494761585027865047e-01 2.617344119314569673e-01
+1.948137533226730334e-01 1.466155558553730864e-01 2.559107021731873988e-01
+1.923665760685599468e-01 1.437473901381048913e-01 2.501489823140411461e-01
+1.899031789417767457e-01 1.408738040042367690e-01 2.443975812138057813e-01
+1.874125186315797886e-01 1.379915476831030108e-01 2.387062880680187460e-01
+1.849071752981109873e-01 1.351026683367795023e-01 2.330231779340583564e-01
+1.823751828761793481e-01 1.322038111876145949e-01 2.274020989868827392e-01
+1.798308834661569988e-01 1.292972741720705698e-01 2.217828373102059270e-01
+1.772595702951434704e-01 1.263792859047284667e-01 2.162309361702130506e-01
+1.746769766714075522e-01 1.234522307754042925e-01 2.106797904214151584e-01
+1.720703275074147443e-01 1.205129174047056828e-01 2.051860710532931176e-01
+1.694509066570421274e-01 1.175626362090423926e-01 1.997023294326863430e-01
+1.668117590877864764e-01 1.145994139402238821e-01 1.942594655847655616e-01
+1.641571774416621943e-01 1.116231764992316466e-01 1.888399155026514453e-01
+1.614878059346168959e-01 1.086331782717616379e-01 1.834416540200605461e-01
+1.587995102818766935e-01 1.056281331759973130e-01 1.780821476813713722e-01
+1.561019746507273376e-01 1.026082525875711138e-01 1.727215696232307918e-01]; 
+
+   case 'mat' 
+      RGB = [9.942936149611202312e-01 9.303277953232079733e-01 6.910969022498407721e-01
+9.938034737629607429e-01 9.248067799917484288e-01 6.856470896792071779e-01
+9.932915386396504731e-01 9.192993747690529904e-01 6.802308895677181555e-01
+9.927922245331627371e-01 9.137917294903226129e-01 6.748329403835298113e-01
+9.922937701498860674e-01 9.082882194233706796e-01 6.694590190525575579e-01
+9.917843550306121303e-01 9.027933977435592672e-01 6.641148019075449049e-01
+9.912962746539998315e-01 8.972938428980343772e-01 6.587860434151366906e-01
+9.907825925330567829e-01 8.918085346471608110e-01 6.534941055176841651e-01
+9.902949549053171596e-01 8.863158938146130650e-01 6.482161486636766057e-01
+9.897868190815676259e-01 8.808350065840212517e-01 6.429731121246738956e-01
+9.892857473867685547e-01 8.753541152485579957e-01 6.377529594546893499e-01
+9.887800796370288525e-01 8.698778821960219121e-01 6.325610007226144527e-01
+9.882646997282734658e-01 8.644083076900085372e-01 6.273995656371403884e-01
+9.877584964502673648e-01 8.589369989413550011e-01 6.222606017222616082e-01
+9.872280289134517384e-01 8.534782966339129473e-01 6.171585665698279266e-01
+9.867183884350317902e-01 8.480122040334344691e-01 6.120742768604477968e-01
+9.861766767190066618e-01 8.425618846460892764e-01 6.070302342911766402e-01
+9.856563017997251874e-01 8.371033300354000506e-01 6.020039838864913451e-01
+9.851070454224936102e-01 8.316588814371468352e-01 5.970165676525449605e-01
+9.845690242211674326e-01 8.262101763023093071e-01 5.920513492549713819e-01
+9.840096682146298734e-01 8.207718909127237339e-01 5.871217557569952117e-01
+9.834535848293927129e-01 8.153324961500217904e-01 5.822177451775890633e-01
+9.828817074848651414e-01 8.099006555998068402e-01 5.773470477348076058e-01
+9.823072425148250408e-01 8.044699893992296458e-01 5.725043678439867278e-01
+9.817205500240108185e-01 7.990448613324698801e-01 5.676935526547516320e-01
+9.811274651130897917e-01 7.936222997819741831e-01 5.629123141708799460e-01
+9.805237822250761903e-01 7.882041368744077126e-01 5.581623151179201381e-01
+9.799119019116716567e-01 7.827890166019746410e-01 5.534426550185235216e-01
+9.792891597791347769e-01 7.773780574795166043e-01 5.487543863553446810e-01
+9.786583517021393286e-01 7.719696800001862869e-01 5.440965033742034551e-01
+9.780145739702225116e-01 7.665661517278330450e-01 5.394708896034823287e-01
+9.773647283145959763e-01 7.611637891820339785e-01 5.348750765091280224e-01
+9.766980163585675667e-01 7.557679109997390565e-01 5.303130790083464552e-01
+9.760290252537030531e-01 7.503708130006796484e-01 5.257797515465254534e-01
+9.753375433133614214e-01 7.449828010040938642e-01 5.212823917018596376e-01
+9.746492807368433153e-01 7.395902023503717615e-01 5.168121142252199984e-01
+9.739312415395592337e-01 7.342102748450782812e-01 5.123804929986149892e-01
+9.732235441351503313e-01 7.288214038955377339e-01 5.079740009039053206e-01
+9.724836441494412176e-01 7.234462681298939879e-01 5.036071894033782304e-01
+9.717498445504565430e-01 7.180638747370174935e-01 4.992675340324776445e-01
+9.709912116410467364e-01 7.126909352035095679e-01 4.949654270232705655e-01
+9.702261620325377534e-01 7.073170976907954266e-01 4.906951514278061199e-01
+9.694484453171449134e-01 7.019455954348422511e-01 4.864590138179895606e-01
+9.686504017535663147e-01 6.965805969226914751e-01 4.822596297437949375e-01
+9.678531538881393059e-01 6.912098001765796251e-01 4.780909555078191597e-01
+9.670272977476158660e-01 6.858499112812684873e-01 4.739621016861336744e-01
+9.662030356838596790e-01 6.804831678592252464e-01 4.698646253054341027e-01
+9.653577621840926382e-01 6.751225363106635458e-01 4.658054627874114728e-01
+9.644956606754987449e-01 6.697653999656224544e-01 4.617837747090557943e-01
+9.636302007256901669e-01 6.644033993552483919e-01 4.577964421810854501e-01
+9.627382975013459854e-01 6.590502602174439506e-01 4.538500459526182973e-01
+9.618419029037778012e-01 6.536923650498338567e-01 4.499394348167297664e-01
+9.609293304705296412e-01 6.483365953124501369e-01 4.460681718992942080e-01
+9.599915754015638791e-01 6.429884241455728899e-01 4.422388634417756537e-01
+9.590555927894280908e-01 6.376305748866927248e-01 4.384459238793448344e-01
+9.580962561892508722e-01 6.322786777663680358e-01 4.346957499886874854e-01
+9.571138853949342495e-01 6.269324224641481536e-01 4.309887354294504314e-01
+9.561315297025726467e-01 6.215764963092997863e-01 4.273209635732272416e-01
+9.551250405128054455e-01 6.162263913356859080e-01 4.236980325915365997e-01
+9.540950546856811210e-01 6.108815734129118269e-01 4.201203681538954182e-01
+9.530626716897264705e-01 6.055275479248746207e-01 4.165851980241140895e-01
+9.520078397406573911e-01 6.001775213709300560e-01 4.130968208871531600e-01
+9.509298744158470873e-01 5.948318045431840728e-01 4.096560342134981103e-01
+9.498400194890849191e-01 5.894823244090308112e-01 4.062621760942275451e-01
+9.487347976692349638e-01 5.841311256224190895e-01 4.029168199567615405e-01
+9.476064491016543689e-01 5.787834319880815759e-01 3.996218296412110127e-01
+9.464553073333200617e-01 5.734388133376047136e-01 3.963780340202668340e-01
+9.452939757532162757e-01 5.680877777926379713e-01 3.931855149232086899e-01
+9.441119180634874875e-01 5.627376402983688131e-01 3.900463532360756713e-01
+9.429065439155045469e-01 5.573900694724827076e-01 3.869617715840133476e-01
+9.416779791961638058e-01 5.520447400757862999e-01 3.839328326459904850e-01
+9.404312902807343555e-01 5.466974929733746658e-01 3.809606687756254551e-01
+9.391670109637508812e-01 5.413475099598963336e-01 3.780467610439202097e-01
+9.378784499903906058e-01 5.359996531278976573e-01 3.751924384200013285e-01
+9.365655059652620018e-01 5.306537435419416138e-01 3.723989770682498146e-01
+9.352280123612883855e-01 5.253096443760549850e-01 3.696677100588824927e-01
+9.338657357609021492e-01 5.199672647340076725e-01 3.670000247302842578e-01
+9.324834513518638346e-01 5.146223341056469502e-01 3.643980039003675286e-01
+9.310764112648535207e-01 5.092783920261573227e-01 3.618628439391275986e-01
+9.296425700359164379e-01 5.039368520229430271e-01 3.593958605013685692e-01
+9.281814529069224440e-01 4.985978383651590851e-01 3.569985751712403399e-01
+9.266925163734759385e-01 4.932615377693159719e-01 3.546725399001493528e-01
+9.251751483021848355e-01 4.879282029910456120e-01 3.524193303048753223e-01
+9.236286685007274455e-01 4.825981562592266960e-01 3.502405381564949738e-01
+9.220523297832619036e-01 4.772717924986036864e-01 3.481377630517493160e-01
+9.204453195710341484e-01 4.719495822836188847e-01 3.461126032707011468e-01
+9.188067620643404210e-01 4.666320744633321582e-01 3.441666458384411431e-01
+9.171357210169962526e-01 4.613198983953663013e-01 3.423014558239780292e-01
+9.154312031382285664e-01 4.560137657258883093e-01 3.405185649261683878e-01
+9.136921621394280546e-01 4.507144716528461159e-01 3.388194594142976412e-01
+9.119175034344646491e-01 4.454228956112940563e-01 3.372055675093833527e-01
+9.101060894923883593e-01 4.401400013227078634e-01 3.356782463109665438e-01
+9.082567458304244834e-01 4.348668361548626016e-01 3.342387683926176800e-01
+9.063682676234201541e-01 4.296045297451883127e-01 3.328883082070119848e-01
+9.044394268935215253e-01 4.243542918485532223e-01 3.316279284576256203e-01
+9.024689802311073317e-01 4.191174093801583456e-01 3.304585666082093254e-01
+9.004556769853120368e-01 4.138952426354805536e-01 3.293810217125931472e-01
+8.983982678499889962e-01 4.086892206819806583e-01 3.283959417554291327e-01
+8.962955137593517918e-01 4.035008359311561543e-01 3.275038116986458414e-01
+8.941481104554649395e-01 3.983293983456084875e-01 3.267070561329722400e-01
+8.919536525149722728e-01 3.931778253066712803e-01 3.260048269152195366e-01
+8.897101199351982181e-01 3.880487567649602565e-01 3.253961697320843505e-01
+8.874163795567694413e-01 3.829439054205242554e-01 3.248807846244438635e-01
+8.850713585473568568e-01 3.778650063033766049e-01 3.244581619630766411e-01
+8.826755435924777959e-01 3.728118797277990004e-01 3.241299144458608672e-01
+8.802274289557096010e-01 3.677869127615048805e-01 3.238946418203613176e-01
+8.777249655021830410e-01 3.627933891756242590e-01 3.237493930733041925e-01
+8.751673985732256744e-01 3.578330531078428023e-01 3.236927558288430484e-01
+8.725555139394461923e-01 3.529055754992642124e-01 3.237261048951861064e-01
+8.698877548666956727e-01 3.480139364384642886e-01 3.238460395212981457e-01
+8.671629330678980452e-01 3.431608117920707524e-01 3.240490255671465425e-01
+8.643813155550574834e-01 3.383468700732272794e-01 3.243343280815126350e-01
+8.615430100192384977e-01 3.335730372253879472e-01 3.247007528957156497e-01
+8.586467469801843944e-01 3.288425164717434512e-01 3.251427866013465451e-01
+8.556930023091509074e-01 3.241559097884965657e-01 3.256590726700412941e-01
+8.526821206317460877e-01 3.195140519652634459e-01 3.262477399527137223e-01
+8.496135249080434271e-01 3.149194771604064691e-01 3.269031319055852869e-01
+8.464880691147448344e-01 3.103723490573296884e-01 3.276240607685041994e-01
+8.433059903582461603e-01 3.058739837233550030e-01 3.284066774658670473e-01
+8.400675201697129779e-01 3.014258630212182100e-01 3.292462412802209526e-01
+8.367737994501905918e-01 2.970277335155548926e-01 3.301419279880662416e-01
+8.334250817653976462e-01 2.926812202808505847e-01 3.310879308798391207e-01
+8.300223167271181257e-01 2.883865925403408248e-01 3.320815261966803544e-01
+8.265664528479066409e-01 2.841441353717970020e-01 3.331197789552536870e-01
+8.230582869411739999e-01 2.799545862699168719e-01 3.341980671944378423e-01
+8.194989991910379690e-01 2.758177426460852733e-01 3.353144156579274116e-01
+8.158895345625488682e-01 2.717340841090945536e-01 3.364643892127716640e-01
+8.122310472907531276e-01 2.677035350490168386e-01 3.376451421817873721e-01
+8.085246874446361254e-01 2.637260312682816465e-01 3.388536188130562565e-01
+8.047716060121338222e-01 2.598015433395364782e-01 3.400863817867416095e-01
+8.009730135703670983e-01 2.559297758719957794e-01 3.413409259751189473e-01
+7.971300939112275774e-01 2.521105612652171368e-01 3.426140174094376434e-01
+7.932440533013958017e-01 2.483435687707094552e-01 3.439030220163640239e-01
+7.893160890135294538e-01 2.446284526280468330e-01 3.452052771464595993e-01
+7.853473877765537736e-01 2.409648192333603833e-01 3.465182972816244766e-01
+7.813391260814397388e-01 2.373522835108513029e-01 3.478394483472491694e-01
+7.772924488739767490e-01 2.337903640474600642e-01 3.491667244042649942e-01
+7.732084983091196406e-01 2.302786572731657100e-01 3.504975234338518764e-01
+7.690883651827444822e-01 2.268166676306541119e-01 3.518300145036632465e-01
+7.649331213342656088e-01 2.234039396519906795e-01 3.531621316810459876e-01
+7.607438261029081383e-01 2.200400345294166726e-01 3.544916653625779235e-01
+7.565214435019435024e-01 2.167244640001846911e-01 3.558173116773682421e-01
+7.522670051172567485e-01 2.134568325306841485e-01 3.571365659018996275e-01
+7.479813874637180060e-01 2.102366867865238520e-01 3.584483801868486030e-01
+7.436655059621508634e-01 2.070636399021255625e-01 3.597509060488300325e-01
+7.393202434785964838e-01 2.039373173302497233e-01 3.610423849932817841e-01
+7.349463482724380992e-01 2.008573725915569486e-01 3.623219106278985358e-01
+7.305447136853985279e-01 1.978234802458921360e-01 3.635871804824805653e-01
+7.261159828724578214e-01 1.948353685346151387e-01 3.648375781480875379e-01
+7.216608959662019762e-01 1.918927853792166127e-01 3.660715129191122186e-01
+7.171801670483409774e-01 1.889955002148961394e-01 3.672874263418225982e-01
+7.126743300531552805e-01 1.861433788319636073e-01 3.684846837309949108e-01
+7.081441223914051175e-01 1.833362215388179839e-01 3.696612595209343710e-01
+7.035900061356136215e-01 1.805739799909275023e-01 3.708165722616917348e-01
+6.990125222046897902e-01 1.778565964180273684e-01 3.719494030784631367e-01
+6.944122804123707970e-01 1.751839824866724127e-01 3.730580800830735622e-01
+6.897896069146784992e-01 1.725562544195547443e-01 3.741422132560422997e-01
+6.851450759297335047e-01 1.699733803139570343e-01 3.752000809033200213e-01
+6.804790620490438480e-01 1.674354838987148208e-01 3.762308077572429355e-01
+6.757918752796293616e-01 1.649427652357627616e-01 3.772336599439788940e-01
+6.710841190288990843e-01 1.624951923227635209e-01 3.782065903997158807e-01
+6.663559221262009835e-01 1.600931455660249692e-01 3.791494395940231965e-01
+6.616076837858697601e-01 1.577367904785384745e-01 3.800608417430486607e-01
+6.568398281175149567e-01 1.554262673949660112e-01 3.809393122355112515e-01
+6.520524648278914759e-01 1.531620260338200923e-01 3.817844598609113071e-01
+6.472460502131879290e-01 1.509441834093387669e-01 3.825945806932325444e-01
+6.424208086222070735e-01 1.487730846896873349e-01 3.833687631504908433e-01
+6.375768667154826375e-01 1.466491860640934397e-01 3.841063458261376740e-01
+6.327147719614083510e-01 1.445724818775720732e-01 3.848052877974663111e-01
+6.278345360543612363e-01 1.425435417995506715e-01 3.854652342077181104e-01
+6.229363449371848604e-01 1.405627442689544315e-01 3.860852182514847852e-01
+6.180208267587814497e-01 1.386299275595349323e-01 3.866630046493146899e-01
+6.130878172636732293e-01 1.367458410848005068e-01 3.871986373954375282e-01
+6.081376300127646628e-01 1.349106539902725221e-01 3.876907660008953038e-01
+6.031708343692542273e-01 1.331241752511138077e-01 3.881374204452801013e-01
+5.981872594198538451e-01 1.313871076769131119e-01 3.885385758335542783e-01
+5.931872993271581906e-01 1.296994119208923768e-01 3.888927420384044042e-01
+5.881715194167826954e-01 1.280607661499650052e-01 3.891980996789912162e-01
+5.831397292746328676e-01 1.264718001616958465e-01 3.894546477166113685e-01
+5.780923809284296278e-01 1.249322477491876249e-01 3.896608882675748342e-01
+5.730301484941315859e-01 1.234414650841386962e-01 3.898149438393606059e-01
+5.679527785339369972e-01 1.220000281824430710e-01 3.899169825800337663e-01
+5.628606992123619257e-01 1.206075179177948653e-01 3.899657247446918218e-01
+5.577549128735556083e-01 1.192626131188577743e-01 3.899588733885684388e-01
+5.526350045348186191e-01 1.179659461688005728e-01 3.898969895870120772e-01
+5.475013145908723677e-01 1.167170132781017999e-01 3.897791516609607765e-01
+5.423552229242829537e-01 1.155136939391362971e-01 3.896026927627281311e-01
+5.371963110518728213e-01 1.143564329775472455e-01 3.893682721938278024e-01
+5.320248625085529648e-01 1.132445825251853777e-01 3.890752921818558807e-01
+5.268418790923193873e-01 1.121763322989662304e-01 3.887220732362928199e-01
+5.216480344214139420e-01 1.111502746625857019e-01 3.883076350820581779e-01
+5.164430850451627864e-01 1.101663332257847294e-01 3.878324664548168932e-01
+5.112275102681053118e-01 1.092232673876926685e-01 3.872959651352503863e-01
+5.060029073959358970e-01 1.083180273650512782e-01 3.866960834588916152e-01
+5.007692304925555060e-01 1.074500336043514026e-01 3.860332364294135066e-01
+4.955265944792267008e-01 1.066184092659498428e-01 3.853076049214476662e-01
+4.902755524910634155e-01 1.058215397414334347e-01 3.845188368245686661e-01
+4.850176459901380244e-01 1.050561979453382144e-01 3.836654992000479436e-01
+4.797532909040905236e-01 1.043208730187463462e-01 3.827476922012114091e-01
+4.744823785889252243e-01 1.036148463575309320e-01 3.817661365680148355e-01
+4.692055171112920475e-01 1.029362343090417242e-01 3.807207588669155873e-01
+4.639233255037821801e-01 1.022831037225876705e-01 3.796115541526619008e-01
+4.586377341242697248e-01 1.016514176559336347e-01 3.784373263419291700e-01
+4.533486056644123185e-01 1.010403969450098804e-01 3.771990792167705386e-01
+4.480561070398016432e-01 1.004487677966155457e-01 3.758974928385367953e-01
+4.427608762820601784e-01 9.987450133495995308e-02 3.745328419993724234e-01
+4.374635532679027050e-01 9.931556251859710582e-02 3.731054660236349796e-01
+4.321647778868571432e-01 9.876991822512792840e-02 3.716157670899542520e-01
+4.268658599998730319e-01 9.823449013050672418e-02 3.700637078536853086e-01
+4.215676735765455097e-01 9.770690573986753891e-02 3.684497084664269395e-01
+4.162699168504104819e-01 9.718665004270135577e-02 3.667750666255454317e-01
+4.109731987208080639e-01 9.667179308527124038e-02 3.650404160810349907e-01
+4.056781184785120398e-01 9.616044175324228727e-02 3.632464399813756240e-01
+4.003852641200214557e-01 9.565074509543119996e-02 3.613938677771775798e-01
+3.950952107257716950e-01 9.514089908082037916e-02 3.594834719896101149e-01
+3.898085189133677075e-01 9.462915077538672226e-02 3.575160648711968037e-01
+3.845257333758309581e-01 9.411380193352703039e-02 3.554924949866632988e-01
+3.792473815136121473e-01 9.359321200643175298e-02 3.534136437413167853e-01
+3.739739721678181361e-01 9.306580057655630678e-02 3.512804218838474490e-01
+3.687059944607640194e-01 9.253004923332719400e-02 3.490937660095801975e-01
+3.634439167485821742e-01 9.198450291035600856e-02 3.468546350890427399e-01
+3.581881856892511484e-01 9.142777070873894796e-02 3.445640070453340198e-01
+3.529392254280559471e-01 9.085852623447668308e-02 3.422228754021731101e-01
+3.476974369011708865e-01 9.027550748073234765e-02 3.398322460227614084e-01
+3.424631972568040195e-01 8.967751628755202264e-02 3.373931339577017074e-01
+3.372368593921474811e-01 8.906341741289613978e-02 3.349065604182628331e-01
+3.320187516032832020e-01 8.843213724940904297e-02 3.323735498892629314e-01
+3.268091773441717529e-01 8.778266222136388297e-02 3.297951273938287686e-01
+3.216084150899517491e-01 8.711403689571997622e-02 3.271723159202782338e-01
+3.164167182989683913e-01 8.642536184028648538e-02 3.245061340194448363e-01
+3.112343154672587153e-01 8.571579126067202514e-02 3.217975935788711661e-01
+3.060614102686342042e-01 8.498453044606019136e-02 3.190476977785482449e-01
+3.008981817730306263e-01 8.423083305194795090e-02 3.162574392312175187e-01
+2.957447847354051640e-01 8.345399824589613824e-02 3.134277983087430108e-01
+2.906013499472219208e-01 8.265336774002721154e-02 3.105597416546946876e-01
+2.854679846423482936e-01 8.182832273165288606e-02 3.076542208820723934e-01
+2.803477329331294232e-01 8.097431979192776241e-02 3.047120362305891783e-01
+2.752380681858879186e-01 8.009433346301736423e-02 3.017343316299965217e-01
+2.701389341759609652e-01 7.918798082745703848e-02 2.987220235093637766e-01
+2.650503484302856316e-01 7.825477700181371343e-02 2.956760032243300196e-01
+2.599723067663477494e-01 7.729426121855428877e-02 2.925971426566268407e-01
+2.549047838884308526e-01 7.630599343423161152e-02 2.894862939132400448e-01
+2.498493147092451516e-01 7.528752506190716787e-02 2.863443687052725228e-01
+2.448074110283037785e-01 7.423648337865965119e-02 2.831723508316192905e-01
+2.397761080979832760e-01 7.315619369923848092e-02 2.799709378403843485e-01
+2.347552980534894362e-01 7.204627593897616755e-02 2.767409087277542534e-01
+2.297448542911243452e-01 7.090635374932227619e-02 2.734830227534650882e-01
+2.247460435545195478e-01 6.973430487024689928e-02 2.701981884636781017e-01
+2.197617914493367186e-01 6.852599251980440176e-02 2.668875888727837431e-01
+2.147876871428340828e-01 6.728630515821912295e-02 2.635514822299450111e-01
+2.098235281541684927e-01 6.601485651366462148e-02 2.601905585020159450e-01
+2.048690954628696881e-01 6.471124480576789795e-02 2.568054914489818485e-01
+1.999302337340111424e-01 6.336777961956377436e-02 2.533980282310328569e-01
+1.950016002461211762e-01 6.199020593164828591e-02 2.499680455203335816e-01
+1.900821894571196047e-01 6.057894133574073109e-02 2.465160535124999996e-01
+1.851717128353368158e-01 5.913348735199071976e-02 2.430426744218359136e-01];
+
+   case 'alg'
+      RGB = [8.429022637670927631e-01 9.769128443086748659e-01 8.146495714674897304e-01
+8.379898654100343958e-01 9.732407342044756549e-01 8.088430556678033456e-01
+8.330792003033266058e-01 9.695822214541992556e-01 8.030532648620265501e-01
+8.281700574948731575e-01 9.659372187629376993e-01 7.972802422761141594e-01
+8.232591263824388106e-01 9.623071583180456967e-01 7.915177499867750432e-01
+8.183491723383330418e-01 9.586904682961984170e-01 7.857720506350698297e-01
+8.134400361234097598e-01 9.550870346415619716e-01 7.800433040617480440e-01
+8.085287334688994187e-01 9.514980955891142456e-01 7.743261813916382241e-01
+8.036173420648491383e-01 9.479224436104144447e-01 7.686253533397395810e-01
+7.987060409170214648e-01 9.443598003220095016e-01 7.629416545120045745e-01
+7.937925122347354590e-01 9.408110588423104215e-01 7.572712382873506565e-01
+7.888774721308737803e-01 9.372756747279427092e-01 7.516160461408240012e-01
+7.839617672758154576e-01 9.337530574201664546e-01 7.459781551153893409e-01
+7.790441380861869991e-01 9.302435915337518013e-01 7.403557861728765621e-01
+7.741231638352710220e-01 9.267477183327949009e-01 7.347469917710997001e-01
+7.692007373711554630e-01 9.232643756857683570e-01 7.291556698393132363e-01
+7.642766080322838107e-01 9.197934849334901131e-01 7.235818576277038838e-01
+7.593478268473826676e-01 9.163361556599034508e-01 7.180210830197953920e-01
+7.544162681443719043e-01 9.128913482866579665e-01 7.124771068936172069e-01
+7.494821658995169944e-01 9.094587642780913583e-01 7.069508171108205286e-01
+7.445446445348200548e-01 9.060385878865820919e-01 7.014412864903698530e-01
+7.396014349798241128e-01 9.026315871837650162e-01 6.959454639490867400e-01
+7.346547940498792117e-01 8.992365867115311717e-01 6.904675150024160990e-01
+7.297044319156630321e-01 8.958535131435325649e-01 6.850074822882207259e-01
+7.247490312042899063e-01 8.924827183233180472e-01 6.795638773235905816e-01
+7.197871536503424039e-01 8.891245874731169563e-01 6.741351421211713157e-01
+7.148205906315451275e-01 8.857781679670407859e-01 6.687245323963695309e-01
+7.098490222489788337e-01 8.824433898084057537e-01 6.633320978710508520e-01
+7.048715598638584101e-01 8.791204089748886341e-01 6.579571019276890809e-01
+6.998858807424097606e-01 8.758099421807559182e-01 6.525968888447420957e-01
+6.948941393454671767e-01 8.725109084606608167e-01 6.472550946180131159e-01
+6.898959788510803381e-01 8.692232412884600690e-01 6.419317800561787912e-01
+6.848910317118895863e-01 8.659468751996841629e-01 6.366270089015387823e-01
+6.798769490247473790e-01 8.626825033431277934e-01 6.313382981547220885e-01
+6.748542718513756977e-01 8.594296871845804597e-01 6.260670342676678546e-01
+6.698236059410382914e-01 8.561879728828601932e-01 6.208146206652157550e-01
+6.647845365512859983e-01 8.529572984927470403e-01 6.155811388293935815e-01
+6.597366350463846896e-01 8.497376032066983331e-01 6.103666749315915796e-01
+6.546778498073401176e-01 8.465294186026240952e-01 6.051694131498632778e-01
+6.496081377794251654e-01 8.433325185775547572e-01 5.999900369339508099e-01
+6.445282101635998462e-01 8.401464057748564418e-01 5.948300803069692666e-01
+6.394375788791967219e-01 8.369710226136972686e-01 5.896896565661723377e-01
+6.343357381511850468e-01 8.338063126244976697e-01 5.845688863102624921e-01
+6.292221635729954299e-01 8.306522204479636073e-01 5.794678980553558123e-01
+6.240950633957039750e-01 8.275091254279797193e-01 5.743855059995368606e-01
+6.189539477625067843e-01 8.243769361676358542e-01 5.693220109772474391e-01
+6.137994351057367570e-01 8.212551782044565929e-01 5.642788688985792556e-01
+6.086309233573077293e-01 8.181437984076060932e-01 5.592562516207922885e-01
+6.034477870757418705e-01 8.150427445292480755e-01 5.542543429870632199e-01
+5.982493762730075604e-01 8.119519651518264380e-01 5.492733398149425295e-01
+5.930350151926494506e-01 8.088714096235919415e-01 5.443134529660692555e-01
+5.878040010377325597e-01 8.058010279811619325e-01 5.393749085029397872e-01
+5.825556026472022975e-01 8.027407708577772860e-01 5.344579489389233995e-01
+5.772876663840377232e-01 7.996910315164064142e-01 5.295616097386441901e-01
+5.720007307801391327e-01 7.966513294788654109e-01 5.246873967172444031e-01
+5.666941554135628278e-01 7.936215585273497242e-01 5.198357685218710778e-01
+5.613670944828393905e-01 7.906016675911841096e-01 5.150070514423125134e-01
+5.560186672658552487e-01 7.875916053777574088e-01 5.102015958622602154e-01
+5.506479565076832783e-01 7.845913201632197520e-01 5.054197781680845880e-01
+5.452540067541281621e-01 7.816007595558720489e-01 5.006620028015225099e-01
+5.398358226320055797e-01 7.786198702294978569e-01 4.959287044657145205e-01
+5.343923670778303325e-01 7.756485976236309199e-01 4.912203504944597232e-01
+5.289225595174025241e-01 7.726868856074639025e-01 4.865374433949326005e-01
+5.234252739997397041e-01 7.697346761037856533e-01 4.818805235744546001e-01
+5.178993372898965664e-01 7.667919086690104802e-01 4.772501722621809717e-01
+5.123435269266533032e-01 7.638585200249727869e-01 4.726470146367432457e-01
+5.067565692524964582e-01 7.609344435378136984e-01 4.680717231709499715e-01
+5.011371374253174027e-01 7.580196086388175658e-01 4.635250212045694540e-01
+4.954838494233231860e-01 7.551139401816627794e-01 4.590076867559155782e-01
+4.897952660572904571e-01 7.522173577300403924e-01 4.545205565824696481e-01
+4.840681573071378696e-01 7.493302232220337977e-01 4.500635797773255287e-01
+4.783013360124501179e-01 7.464523294656015828e-01 4.456380221845723244e-01
+4.724940506024824516e-01 7.435833409938815697e-01 4.412454477696442501e-01
+4.666445818616462016e-01 7.407231498818752646e-01 4.368869875723455642e-01
+4.607511431720994755e-01 7.378716377692448036e-01 4.325638579641650772e-01
+4.548118791551377105e-01 7.350286745174200442e-01 4.282773665493129212e-01
+4.488246916697360978e-01 7.321941577075956609e-01 4.240288438198308585e-01
+4.427816707495262905e-01 7.293693063882581429e-01 4.198173776667764034e-01
+4.366861225292572590e-01 7.265526435148784712e-01 4.156470546985623349e-01
+4.305358706593315765e-01 7.237439753686812915e-01 4.115196426107185501e-01
+4.243286683688641259e-01 7.209430867475091764e-01 4.074370373866784134e-01
+4.180533691692684961e-01 7.181516616727471325e-01 4.033983548745580516e-01
+4.117152151566086937e-01 7.153676995586070175e-01 3.994086748894248862e-01
+4.053120447326638009e-01 7.125908305255362896e-01 3.954704830581987074e-01
+3.988310338161633051e-01 7.098228382481286403e-01 3.915835586978753668e-01
+3.922773504125326993e-01 7.070616628058336017e-01 3.877531715317056316e-01
+3.856453036392904488e-01 7.043074656954597668e-01 3.839816779215288745e-01
+3.789264219900637110e-01 7.015608428874934299e-01 3.802713204645660205e-01
+3.721249180146385394e-01 6.988198403254852753e-01 3.766273561291236249e-01
+3.652256292309092323e-01 6.960861432527269965e-01 3.730515342232093579e-01
+3.582353316782660446e-01 6.933572072574926137e-01 3.695499404331015203e-01
+3.511405088327756996e-01 6.906341612001636321e-01 3.661256768699447939e-01
+3.439420657842418572e-01 6.879154082481935273e-01 3.627843734908121065e-01
+3.366376245587633931e-01 6.851998988322398620e-01 3.595313212824273741e-01
+3.292131284244469436e-01 6.824884139177085363e-01 3.563714602024023459e-01
+3.216744583078648412e-01 6.797783170101999728e-01 3.533114882245381727e-01
+3.140172671350762723e-01 6.770686201449667152e-01 3.503575531959788325e-01
+3.062375560076174841e-01 6.743581777161754554e-01 3.475162179105460436e-01
+2.983302406892556213e-01 6.716458949569478198e-01 3.447945234485624288e-01
+2.903003733928296581e-01 6.689291557488895590e-01 3.421993121220623379e-01
+2.821497842888552321e-01 6.662058429849556651e-01 3.397373505300674279e-01
+2.738829008222237738e-01 6.634735172067438569e-01 3.374150438308454736e-01
+2.655071740281889081e-01 6.607294316207971141e-01 3.352380978850171278e-01
+2.570334211300853156e-01 6.579705722659228151e-01 3.332111341597794874e-01
+2.484760249031935930e-01 6.551937268253881230e-01 3.313372827145077970e-01
+2.398529309513116603e-01 6.523955825377709683e-01 3.296177905380952566e-01
+2.311841779376898609e-01 6.495729702230954583e-01 3.280520259104468539e-01
+2.224959725553208312e-01 6.467225401811796948e-01 3.266360450956267703e-01
+2.138146081063950210e-01 6.438414682793780486e-01 3.253637783252084081e-01
+2.051671661243615885e-01 6.409273967897467505e-01 3.242268145630948784e-01
+1.965805108315318850e-01 6.379785280095539024e-01 3.232146947371194456e-01
+1.880802465071397533e-01 6.349936851788878789e-01 3.223153652533572999e-01
+1.796913740541281890e-01 6.319722298814686168e-01 3.215149361924393712e-01
+1.714330705005376321e-01 6.289143429606669500e-01 3.208003886075819211e-01
+1.633223574014183166e-01 6.258206603139722102e-01 3.201583938437198018e-01
+1.553730387230779220e-01 6.226922583196569105e-01 3.195761743639152774e-01
+1.475958738836526396e-01 6.195305528827301789e-01 3.190418452926268023e-01
+1.399989467346693939e-01 6.163371978378411331e-01 3.185446364378627382e-01
+1.325881576814804952e-01 6.131139916341550311e-01 3.180750084472180883e-01
+1.253677831749437921e-01 6.098627973272553460e-01 3.176246802424351201e-01
+1.183415125249481503e-01 6.065854884488630638e-01 3.171858497741395500e-01
+1.115126074344926499e-01 6.032839586583695901e-01 3.167505890039074568e-01
+1.048819394515066727e-01 5.999599650973242992e-01 3.163157773881625778e-01
+9.845229630728663528e-02 5.966151576836506987e-01 3.158774289651596345e-01
+9.222723505152297108e-02 5.932511684885474201e-01 3.154305788787992171e-01
+8.620976681204781111e-02 5.898696713297170158e-01 3.149695047280966498e-01
+8.040588003861268152e-02 5.864717566016173222e-01 3.144963594445834287e-01
+7.481986998062370442e-02 5.830590393336594346e-01 3.140045327658092522e-01
+6.946029534260433902e-02 5.796325615836696032e-01 3.134943864901328370e-01
+6.433627993915527754e-02 5.761934589668912254e-01 3.129640951373787172e-01
+5.945721644433194647e-02 5.727428791151661924e-01 3.124113492075187293e-01
+5.483676528890226581e-02 5.692816942618841303e-01 3.118359557718813901e-01
+5.049036852106828649e-02 5.658107385911853582e-01 3.112374314935371089e-01
+4.642777154917742538e-02 5.623311839573432724e-01 3.106124662721929663e-01
+4.267873894906259319e-02 5.588431316231524670e-01 3.099653177208470112e-01
+3.923368215696795835e-02 5.553481890828847467e-01 3.092892996314257625e-01
+3.621581017331615415e-02 5.518464055245291267e-01 3.085882846661225365e-01
+3.367174260746116921e-02 5.483382191382968340e-01 3.078629031746034084e-01
+3.155357134880961562e-02 5.448249609075901390e-01 3.071084590117025281e-01
+2.984163194432063598e-02 5.413067537046710731e-01 3.063273483583937029e-01
+2.851433193286296089e-02 5.377838583018560437e-01 3.055207233916585885e-01
+2.754542481457317171e-02 5.342567759013212569e-01 3.046882377538095987e-01
+2.689570440508957244e-02 5.307265908415563782e-01 3.038266898313282116e-01
+2.655111347348209846e-02 5.271933424208224972e-01 3.029380668195990611e-01
+2.649479114279441189e-02 5.236572235511334217e-01 3.020233215230865298e-01
+2.670582470265941977e-02 5.201186270434556835e-01 3.010823500978198064e-01
+2.716440603849906016e-02 5.165779238412415708e-01 3.001150958048797168e-01
+2.785177445187870041e-02 5.130354641701924123e-01 2.991215440838268513e-01
+2.874507672231698188e-02 5.094917938725799234e-01 2.981008701035369746e-01
+2.982666070550293522e-02 5.059472607886396078e-01 2.970530677865693692e-01
+3.108771284944302979e-02 5.024018586614166226e-01 2.959794192966550552e-01
+3.251322799624088711e-02 4.988558619272636663e-01 2.948800270305382831e-01
+3.408899261646199802e-02 4.953095294092992318e-01 2.937550173740440806e-01
+3.580154506882658044e-02 4.917631050765793321e-01 2.926045381193648209e-01
+3.763813815230969417e-02 4.882168187516792712e-01 2.914287561365453416e-01
+3.958670383768114059e-02 4.846708867690439626e-01 2.902278552740369943e-01
+4.160606223970295808e-02 4.811255125865287474e-01 2.890020344652265427e-01
+4.364369199371629510e-02 4.775808873526497522e-01 2.877515060197786689e-01
+4.569661527765144643e-02 4.740371904320783147e-01 2.864764940804359616e-01
+4.775452753988133209e-02 4.704945898919368763e-01 2.851772332276043542e-01
+4.980869291606532939e-02 4.669532429514431926e-01 2.838539672156359384e-01
+5.185173623572528895e-02 4.634132963974310626e-01 2.825069478261687528e-01
+5.387745614388812082e-02 4.598748869682287022e-01 2.811364338252513306e-01
+5.588065991543698235e-02 4.563381417083428038e-01 2.797426900122344517e-01
+5.785701915204972262e-02 4.528031782963246044e-01 2.783259863495758379e-01
+5.979876706363549538e-02 4.492703547749640758e-01 2.768859613477449022e-01
+6.170040530833437870e-02 4.457399494079358759e-01 2.754224910913550817e-01
+6.356556527046725025e-02 4.422117069661303246e-01 2.739367706711952621e-01
+6.539233256679152784e-02 4.386857116546215574e-01 2.724290903132413622e-01
+6.717918154984042767e-02 4.351620395957427334e-01 2.708997417620619963e-01
+6.892491848697404611e-02 4.316407590421982854e-01 2.693490177429860299e-01
+7.062863315353248850e-02 4.281219305768591554e-01 2.677772114552923188e-01
+7.228965757688332605e-02 4.246056073010452958e-01 2.661846160919238424e-01
+7.389641781918890318e-02 4.210926586635973523e-01 2.645697649893180015e-01
+7.545434928417493747e-02 4.175827498520321979e-01 2.629338431200398118e-01
+7.696833442757364252e-02 4.140755522595082616e-01 2.612779353323396725e-01
+7.843838726966873010e-02 4.105710916270851607e-01 2.596023362544704338e-01
+7.986463095393955824e-02 4.070693869948522892e-01 2.579073383225120586e-01
+8.124183059024486786e-02 4.035709045576263421e-01 2.561923603053372633e-01
+8.256190184629638718e-02 4.000763929725326684e-01 2.544563479235497083e-01
+8.383876927413885793e-02 3.965847495529768452e-01 2.527017537470714892e-01
+8.507286345646175585e-02 3.930959685837552287e-01 2.509288633450958983e-01
+8.626466273198904466e-02 3.896100382985579480e-01 2.491379583258400143e-01
+8.739775523971837767e-02 3.861285039195596069e-01 2.473266151547285352e-01
+8.848513420336723279e-02 3.826502629618194207e-01 2.454971009362341139e-01
+8.953167205157094855e-02 3.791748988832845391e-01 2.436503732426347768e-01
+9.053797836732038751e-02 3.757023773832682267e-01 2.417867000353674523e-01
+9.148554097617969671e-02 3.722345634210443843e-01 2.399033173203807268e-01
+9.239032630846283345e-02 3.687699624551818989e-01 2.380029261610703828e-01
+9.325665476520708652e-02 3.653081665793141419e-01 2.360863630636709232e-01
+9.407947178296760526e-02 3.618497205076261491e-01 2.341529827160940824e-01
+9.484677589858042657e-02 3.583959460277540421e-01 2.322010660237076030e-01
+9.557752330564703303e-02 3.549448939617083076e-01 2.302337247418529409e-01
+9.627239441888107985e-02 3.514964944168565975e-01 2.282511932335974936e-01
+9.690948221035081134e-02 3.480532009152630946e-01 2.262502344543431132e-01
+9.750943240499498899e-02 3.446127832007709890e-01 2.242341737774653510e-01
+9.807545896746669434e-02 3.411748780303069384e-01 2.222036193428468254e-01
+9.858840445742730885e-02 3.377417205454144589e-01 2.201557955312036796e-01
+9.906254148928930747e-02 3.343117038364873950e-01 2.180929998845686502e-01
+9.950470237088998582e-02 3.308840188006390015e-01 2.160163648855405460e-01
+9.989442828501457483e-02 3.274611474658599142e-01 2.139229716850828411e-01
+1.002478051840671458e-01 3.240411780581063939e-01 2.118153315535568071e-01
+1.005711171338506127e-01 3.206233202298787721e-01 2.096944585359068469e-01
+1.008389569492894877e-01 3.172107795653626439e-01 2.075567848977897256e-01
+1.010766013830992904e-01 3.138003866895044958e-01 2.054060788674454963e-01
+1.012797610659880443e-01 3.103926683916618523e-01 2.032418103374508123e-01
+1.014336128495174072e-01 3.069895754355959072e-01 2.010620024754192769e-01
+1.015604574719611575e-01 3.035881742672912331e-01 1.988698806638831140e-01
+1.016439043068387282e-01 3.001906378105418383e-01 1.966632618336682237e-01
+1.016900146818882356e-01 2.967961587009928515e-01 1.944430867217927517e-01
+1.017093270307037889e-01 2.934032641989809398e-01 1.922108533595217328e-01
+1.016765444870794677e-01 2.900154576395235773e-01 1.899632762562097343e-01
+1.016196069311545991e-01 2.866288210415605109e-01 1.877041478451552947e-01
+1.015219485974463154e-01 2.832456655164396486e-01 1.854313688320031739e-01
+1.013890307775781596e-01 2.798651977505757227e-01 1.831457349733398854e-01
+1.012281681325793714e-01 2.764863132581988348e-01 1.808482324484150805e-01
+1.010210261960676481e-01 2.731116796865848406e-01 1.785366459436490416e-01
+1.007923256501605802e-01 2.697375956289435606e-01 1.762140933897481665e-01
+1.005175174628768486e-01 2.663676978648497062e-01 1.738776494133498218e-01
+1.002173006867299876e-01 2.629988175863644528e-01 1.715298624270491512e-01
+9.988042668340707531e-02 2.596326158562400344e-01 1.691694475105532114e-01
+9.951032875855422843e-02 2.562685171837931764e-01 1.667968626726523129e-01
+9.911165965335702599e-02 2.529057275734052368e-01 1.644126697900448464e-01
+9.867326641808749077e-02 2.495459516150641543e-01 1.620156747879235859e-01
+9.821309319240137392e-02 2.461862546952748865e-01 1.596078670948603284e-01
+9.770793688346479655e-02 2.428303047023268602e-01 1.571867977376794623e-01
+9.718522833757223256e-02 2.394735637952865592e-01 1.547553696066038820e-01
+9.661611889067361902e-02 2.361206836681891130e-01 1.523106424045232721e-01
+9.602890382911671852e-02 2.327668939738092857e-01 1.498554790261657776e-01
+9.539953637497836092e-02 2.294161153913850115e-01 1.473875249443533098e-01
+9.474917991081285851e-02 2.260646807246796119e-01 1.449088125658586357e-01
+9.405984876891312907e-02 2.227155420665202223e-01 1.424176598027472040e-01
+9.334764966575742617e-02 2.193658224428529091e-01 1.399155213806154985e-01
+9.259864172169812724e-02 2.160178161752643877e-01 1.374011522998845325e-01
+9.182582886012352619e-02 2.126691252719348779e-01 1.348756437215534176e-01
+9.101741805439966804e-02 2.093216946605545581e-01 1.323379906767623293e-01
+9.018514688041953664e-02 2.059732968223858540e-01 1.297890966546490499e-01
+8.931758876675888192e-02 2.026258321763433345e-01 1.272280374767779110e-01
+8.842693764273418244e-02 1.992769388914110706e-01 1.246556670387520271e-01
+8.750046390510707317e-02 1.959287732623697376e-01 1.220710201130164874e-01
+8.655243027600306727e-02 1.925785390204607095e-01 1.194750015988692016e-01
+8.556724308545121671e-02 1.892289432653286863e-01 1.168665204409958802e-01
+8.456273936118519075e-02 1.858764606951441301e-01 1.142465958957942507e-01
+8.351900544036733320e-02 1.825246377933723574e-01 1.116139631166048474e-01
+8.245885447713624528e-02 1.791689319540810954e-01 1.089697819472404405e-01
+8.135669872091313981e-02 1.758140104483569555e-01 1.063126024658284652e-01
+8.023864908973366017e-02 1.724546122292074379e-01 1.036435837789304870e-01
+7.908112723260085630e-02 1.690950585274078044e-01 1.009615075211427460e-01
+7.790439520871850210e-02 1.657311325223233545e-01 9.826708487284271931e-02
+7.669293821383046939e-02 1.623656063191788734e-01 9.555954478117026363e-02
+7.545752224924831553e-02 1.589960594221086487e-01 9.283909520333205601e-02
+7.419260617097681032e-02 1.556232855365611012e-01 9.010535811327979872e-02
+7.289843379575938753e-02 1.522469176001574609e-01 8.735814807810177163e-02
+7.158041455970551303e-02 1.488655123209624287e-01 8.459734502497687214e-02
+7.022733114464504989e-02 1.454810031009998728e-01 8.182251708486179553e-02
+6.885643403782271132e-02 1.420894601159049808e-01 7.903362825094448207e-02]; 
+
+   case 'den' 
+      RGB = [9.022021640633741679e-01 9.441797977915000750e-01 9.438027309131502562e-01
+8.954445384876381642e-01 9.409578903665054561e-01 9.410648759794842944e-01
+8.886855788874895579e-01 9.377403820634679921e-01 9.384098650760986926e-01
+8.819275100483495722e-01 9.345262546442011375e-01 9.358372814047579702e-01
+8.751724774625697645e-01 9.313145521613219735e-01 9.333465385891809296e-01
+8.684225465562396273e-01 9.281043788756372370e-01 9.309368983040341439e-01
+8.616797015669134252e-01 9.248948973050555855e-01 9.286074874996731454e-01
+8.549458444869071361e-01 9.216853262599870034e-01 9.263573151615366319e-01
+8.482227943572994144e-01 9.184749387758168737e-01 9.241852885114790750e-01
+8.415122870990738857e-01 9.152630598938195083e-01 9.220902285443438595e-01
+8.348159759916423672e-01 9.120490642716416740e-01 9.200708847923535494e-01
+8.281354328507813944e-01 9.088323736256948004e-01 9.181259492188009741e-01
+8.214721499137223049e-01 9.056124540224106401e-01 9.162540691578000551e-01
+8.148275424063925465e-01 9.023888130447765832e-01 9.144538592359539031e-01
+8.082029517444304645e-01 8.991609968660188024e-01 9.127239122325879750e-01
+8.015996493038702875e-01 8.959285872646755022e-01 9.110628088561002480e-01
+7.950188742001107478e-01 8.926911903474541443e-01 9.094690972400388818e-01
+7.884617893745216044e-01 8.894484461080551796e-01 9.079413399350437786e-01
+7.819294709222469608e-01 8.862000288332800846e-01 9.064781367807944745e-01
+7.754229463217646723e-01 8.829456358148736195e-01 9.050781031537078469e-01
+7.689431984424601740e-01 8.796849849240929720e-01 9.037398757679527828e-01
+7.624911712284807574e-01 8.764178119047121296e-01 9.024621162700895427e-01
+7.560677754202349554e-01 8.731438677954835859e-01 9.012435140344750018e-01
+7.496738942657009686e-01 8.698629164913183054e-01 9.000827882281617898e-01
+7.433103891809360597e-01 8.665747324492172332e-01 8.989786892140232410e-01
+7.369781053261772463e-01 8.632790985421132657e-01 8.979299993594229701e-01
+7.306778770702586634e-01 8.599758040613866283e-01 8.969355333152028154e-01
+7.244105333220340892e-01 8.566646428667109570e-01 8.959941378263615031e-01
+7.181769027125698424e-01 8.533454116802825506e-01 8.951046911317568355e-01
+7.119778186163850942e-01 8.500179085211370111e-01 8.942661020057923738e-01
+7.058142285268640403e-01 8.466819129479339345e-01 8.934771781429077242e-01
+6.996868754737947116e-01 8.433372425635760061e-01 8.927370216147950677e-01
+6.935966262281186845e-01 8.399836925869731408e-01 8.920446369253884900e-01
+6.875443783072674453e-01 8.366210531289836050e-01 8.913990435590287698e-01
+6.815310569542375463e-01 8.332491095447560614e-01 8.907992825434407624e-01
+6.755576190661271019e-01 8.298676415986731003e-01 8.902444142113377090e-01
+6.696250569512002260e-01 8.264764227239829175e-01 8.897335158509319664e-01
+6.637344019158556430e-01 8.230752193711802223e-01 8.892656792634947571e-01
+6.578867276821276366e-01 8.196637904396377738e-01 8.888400082431817673e-01
+6.520831536351689994e-01 8.162418867874922102e-01 8.884556159917510465e-01
+6.463248478988037338e-01 8.128092508153051954e-01 8.881116224784991742e-01
+6.406130302355731443e-01 8.093656161195516008e-01 8.878071517537653445e-01
+6.349489747657169891e-01 8.059107072125802906e-01 8.875413292226665973e-01
+6.293340124974293737e-01 8.024442393062223289e-01 8.873132788842952312e-01
+6.237695336583948258e-01 7.989659181568090629e-01 8.871221205404720145e-01
+6.182569898160699129e-01 7.954754399699002221e-01 8.869669669772310971e-01
+6.127978529026838483e-01 7.919724939438572697e-01 8.868470036964815062e-01
+6.073937143892588209e-01 7.884567552174953642e-01 8.867613059311603152e-01
+6.020462362204239692e-01 7.849278896215748924e-01 8.867089225926839680e-01
+5.967571335484213035e-01 7.813855546115021644e-01 8.866889106706612456e-01
+5.915281898823177009e-01 7.778293984625483937e-01 8.867003055015370006e-01
+5.863612575196054388e-01 7.742590605302298590e-01 8.867421178165009188e-01
+5.812582575983973321e-01 7.706741715732086107e-01 8.868133307743576443e-01
+5.762211797340099917e-01 7.670743541409147381e-01 8.869128969829140896e-01
+5.712520812007981785e-01 7.634592230284988901e-01 8.870397355132993988e-01
+5.663530856178774497e-01 7.598283858019500014e-01 8.871927289126763094e-01
+5.615263810949739920e-01 7.561814433965411419e-01 8.873707202219829338e-01
+5.567742177930775638e-01 7.525179907919229416e-01 8.875725100066919060e-01
+5.520989048532665144e-01 7.488376177673574663e-01 8.877968534100384446e-01
+5.475028066465008614e-01 7.451399097406838923e-01 8.880424572398104566e-01
+5.429883038774732107e-01 7.414244411965056347e-01 8.883081102246548344e-01
+5.385578037806126872e-01 7.376907727350942023e-01 8.885926739767254778e-01
+5.342139074650678054e-01 7.339384990781333551e-01 8.888943435724941944e-01
+5.299591516928192636e-01 7.301671976158840005e-01 8.892116013883853975e-01
+5.257960979209626018e-01 7.263764470411206986e-01 8.895428673545512366e-01
+5.217273234975481344e-01 7.225658287807643632e-01 8.898864965652431014e-01
+5.177554119038457747e-01 7.187349285333118898e-01 8.902407770595432979e-01
+5.138829420298184347e-01 7.148833379130644650e-01 8.906039278005388748e-01
+5.101124764807559719e-01 7.110106562012711295e-01 8.909740968830553998e-01
+5.064465489258500597e-01 7.071164922032951994e-01 8.913493600019622987e-01
+5.028876505140544850e-01 7.032004662097455228e-01 8.917277192147863296e-01
+4.994382152582386714e-01 6.992621674331673809e-01 8.921074350832908229e-01
+4.961006347215984325e-01 6.953012224940204877e-01 8.924864661543192579e-01
+4.928771955532800786e-01 6.913173542206699773e-01 8.928621485317782547e-01
+4.897700668589555772e-01 6.873102514205022828e-01 8.932321753875414050e-01
+4.867812943786045676e-01 6.832796259123631311e-01 8.935941653626673364e-01
+4.839127827295982009e-01 6.792252150037093594e-01 8.939456639464463672e-01
+4.811662774244846452e-01 6.751467840099739659e-01 8.942841454160184167e-01
+4.785433468471342322e-01 6.710441287994942661e-01 8.946070153685665716e-01
+4.760453643890875663e-01 6.669170783452496032e-01 8.949116138746746607e-01
+4.736736428294658352e-01 6.627653768113491717e-01 8.951957859716279664e-01
+4.714290262412598742e-01 6.585890168305761350e-01 8.954562723025643045e-01
+4.693121574935592011e-01 6.543879757664989860e-01 8.956900818434682110e-01
+4.673234528945732769e-01 6.501622438680934035e-01 8.958943277799077398e-01
+4.654630534005658737e-01 6.459118568983728270e-01 8.960660842179661856e-01
+4.637308126788352580e-01 6.416368981971656282e-01 8.962023935259622043e-01
+4.621262870085202645e-01 6.373375005637914592e-01 8.963002743257548754e-01
+4.606487857322991153e-01 6.330138155630400387e-01 8.963568414436460241e-01
+4.592973162762510886e-01 6.286660463835676005e-01 8.963691878774373567e-01
+4.580703339287382492e-01 6.242945769689846047e-01 8.963339924500021150e-01
+4.569661322748618804e-01 6.198997574323485971e-01 8.962482674873512023e-01
+4.559826907629682125e-01 6.154819930493959923e-01 8.961090514006179175e-01
+4.551176793504218554e-01 6.110417444047528956e-01 8.959134196000665407e-01
+4.543684658154031886e-01 6.065795271800727972e-01 8.956584955889488331e-01
+4.537321103072295414e-01 6.020959187639063348e-01 8.953414439077735931e-01
+4.532053056792195167e-01 5.975915899334859338e-01 8.949594061016020730e-01
+4.527845804849874312e-01 5.930672153918072897e-01 8.945097368602321630e-01
+4.524662055084718859e-01 5.885235252040261766e-01 8.939898705469653262e-01
+4.522462243009037208e-01 5.839612972830612314e-01 8.933973456284665104e-01
+4.521204742039108271e-01 5.793813548677185787e-01 8.927298144348156939e-01
+4.520846088132207119e-01 5.747845636677534342e-01 8.919850523005500298e-01
+4.521340640278729839e-01 5.701718535137081378e-01 8.911609204213972735e-01
+4.522636556547669495e-01 5.655443967339887079e-01 8.902550664458118712e-01
+4.524690821672368579e-01 5.609029696513448959e-01 8.892660746141660688e-01
+4.527455061379137002e-01 5.562485728577384325e-01 8.881923021329055645e-01
+4.530880320659124716e-01 5.515822303923638703e-01 8.870322627966300555e-01
+4.534917310405354729e-01 5.469049855617650335e-01 8.857846304506885593e-01
+4.539516647179116515e-01 5.422178966900855768e-01 8.844482413776627583e-01
+4.544629083695410077e-01 5.375220328430567740e-01 8.830220956021650469e-01
+4.550204443687518308e-01 5.328185230036192044e-01 8.815052933071011454e-01
+4.556185611092698484e-01 5.281088097066267695e-01 8.798967638851667994e-01
+4.562534204266542326e-01 5.233935859930700651e-01 8.781964868264527935e-01
+4.569203709084596610e-01 5.186739169401044514e-01 8.764041195297782583e-01
+4.576148706477833339e-01 5.139508576774439730e-01 8.745194730542404926e-01
+4.583325010790182952e-01 5.092254498718804534e-01 8.725425074817807491e-01
+4.590689790493137079e-01 5.044987184411230396e-01 8.704733265502938577e-01
+4.598201671313326133e-01 4.997716685175846441e-01 8.683121716406742019e-01
+4.605820822069772169e-01 4.950452826784434435e-01 8.660594152048119998e-01
+4.613509023726869995e-01 4.903205184540396222e-01 8.637155537234258995e-01
+4.621229722350553293e-01 4.855983061224402042e-01 8.612812002829223212e-01
+4.628948066804312034e-01 4.808795467939734336e-01 8.587570768592888149e-01
+4.636621617804746465e-01 4.761655004408036906e-01 8.561438461496413410e-01
+4.644228483348319947e-01 4.714566096078480206e-01 8.534426324219575033e-01
+4.651739386269664878e-01 4.667536635703780079e-01 8.506544391441875907e-01
+4.659126485884828583e-01 4.620574294334566789e-01 8.477803402103136765e-01
+4.666363628095652749e-01 4.573686402108441684e-01 8.448214774526084936e-01
+4.673426313321316639e-01 4.526879945693308982e-01 8.417790529251527598e-01
+4.680291657078233247e-01 4.480161567955825430e-01 8.386543213914651185e-01
+4.686938344285310198e-01 4.433537569692765912e-01 8.354485830591045215e-01
+4.693346578320167217e-01 4.387013913255956021e-01 8.321631765974399908e-01
+4.699498025791529199e-01 4.340596227897761117e-01 8.287994724682681280e-01
+4.705375757926853475e-01 4.294289816663295900e-01 8.253588665927664714e-01
+4.710964189403291091e-01 4.248099664657251084e-01 8.218427743723751844e-01
+4.716249015377835252e-01 4.202030448517347638e-01 8.182526250758133113e-01
+4.721217147398471536e-01 4.156086546932221681e-01 8.145898565994108553e-01
+4.725856648806062155e-01 4.110272052049120939e-01 8.108559106034937125e-01
+4.730156670165072685e-01 4.064590781625461724e-01 8.070522280235292722e-01
+4.734107385193607187e-01 4.019046291787961578e-01 8.031802449512829289e-01
+4.737699927598160721e-01 3.973641890273297284e-01 7.992413888782301523e-01
+4.740926329157582608e-01 3.928380650035104282e-01 7.952370752909331264e-01
+4.743779459344564242e-01 3.883265423112774450e-01 7.911687046060347228e-01
+4.746252966720311828e-01 3.838298854668622528e-01 7.870376594308572393e-01
+4.748341222291213026e-01 3.793483397110574140e-01 7.828453021343189100e-01
+4.750039264972926722e-01 3.748821324227855634e-01 7.785929727119723642e-01
+4.751342749269319987e-01 3.704314745277388354e-01 7.742819869283568135e-01
+4.752247895239137265e-01 3.659965618967846446e-01 7.699136347195338903e-01
+4.752751440794077964e-01 3.615775767297375043e-01 7.654891788385849161e-01
+4.752846577346016566e-01 3.571748688576533159e-01 7.610100397104845316e-01
+4.752531583445195884e-01 3.527885695695618384e-01 7.564774234071200976e-01
+4.751807975405666906e-01 3.484186721552497978e-01 7.518923528283415481e-01
+4.750674206653115461e-01 3.440653140404167365e-01 7.472559685686853692e-01
+4.749129042193905303e-01 3.397286256677667371e-01 7.425693796885003417e-01
+4.747171524182526858e-01 3.354087317676910929e-01 7.378336635067138660e-01
+4.744800939620510971e-01 3.311057526021228270e-01 7.330498655303070432e-01
+4.742016790105380575e-01 3.268198051821941674e-01 7.282189995072744226e-01
+4.738818763543148349e-01 3.225510044607445836e-01 7.233420475907058611e-01
+4.735206707734627707e-01 3.182994645010271961e-01 7.184199606025195584e-01
+4.731180605743212086e-01 3.140652996233325722e-01 7.134536583862346459e-01
+4.726740552951489982e-01 3.098486255314443216e-01 7.084440302390293542e-01
+4.721886735713431427e-01 3.056495604211318384e-01 7.033919354141809910e-01
+4.716613727297020442e-01 3.014684828248803128e-01 6.982986813805610593e-01
+4.710926963645384880e-01 2.973052870266812420e-01 6.931646771793222861e-01
+4.704828136289659901e-01 2.931600441838846383e-01 6.879905802658634606e-01
+4.698317639381846544e-01 2.890328918495519428e-01 6.827771264871377310e-01
+4.691395866583317198e-01 2.849239757466777712e-01 6.775250248474340431e-01
+4.684063197381936328e-01 2.808334508365700755e-01 6.722349583426855402e-01
+4.676319984415455155e-01 2.767614823885942155e-01 6.669075848245407112e-01
+4.668166541724163010e-01 2.727082470546194348e-01 6.615435378909206854e-01
+4.659603133859185342e-01 2.686739339515746283e-01 6.561434278004181220e-01
+4.650628643816827057e-01 2.646588038897796924e-01 6.507079958832593380e-01
+4.641242580497152992e-01 2.606631006122758221e-01 6.452378997676680994e-01
+4.631447877428095938e-01 2.566869305701654502e-01 6.397333527350717031e-01
+4.621244494694312643e-01 2.527305449360881529e-01 6.341948722101476976e-01
+4.610632293393826520e-01 2.487942133948352064e-01 6.286229575018943416e-01
+4.599611028558598380e-01 2.448782253548376642e-01 6.230180909006084455e-01
+4.588180342503813125e-01 2.409828911918876493e-01 6.173807387973655469e-01
+4.576339758554896497e-01 2.371085435285009702e-01 6.117113528277585699e-01
+4.564088675103588622e-01 2.332555385522245284e-01 6.060103710422047874e-01
+4.551426114844220883e-01 2.294242672454404608e-01 6.002782575500510420e-01
+4.538352109035017068e-01 2.256151009415963693e-01 5.945152849064858636e-01
+4.524865766439374881e-01 2.218284716492017750e-01 5.887218272221994564e-01
+4.510965881023942248e-01 2.180648477346619485e-01 5.828982757017970862e-01
+4.496651090864017264e-01 2.143247287775243981e-01 5.770450152504881247e-01
+4.481919873439485502e-01 2.106086471651167358e-01 5.711624259770210488e-01
+4.466770541000937844e-01 2.069171697362102713e-01 5.652508847626541710e-01
+4.451201235978615167e-01 2.032508994724643858e-01 5.593107669047254760e-01
+4.435210649059648236e-01 1.996104535682982628e-01 5.533422989220041499e-01
+4.418797550887742509e-01 1.959964848006353622e-01 5.473456323671032075e-01
+4.401958303868417355e-01 1.924097603751145913e-01 5.413213827196030614e-01
+4.384690252866834115e-01 1.888510510844303159e-01 5.352699392743940354e-01
+4.366990547337928352e-01 1.853211730457038908e-01 5.291917009058230148e-01
+4.348856137062026561e-01 1.818209895007495414e-01 5.230870785018020275e-01
+4.330283767917184612e-01 1.783514125901697334e-01 5.169564975681201213e-01
+4.311269977716754020e-01 1.749134050778043403e-01 5.108004010215621005e-01
+4.291811092153304252e-01 1.715079819968361174e-01 5.046192521919092844e-01
+4.271904344659923636e-01 1.681361967924985268e-01 4.984132106571174670e-01
+4.251546522673581574e-01 1.647991755952243342e-01 4.921824740309181379e-01
+4.230731286286127379e-01 1.614981359784699588e-01 4.859281380753826540e-01
+4.209454004136206628e-01 1.582343200442791198e-01 4.796507952549767251e-01
+4.187709818950797191e-01 1.550090272321758555e-01 4.733510791258234707e-01
+4.165493646911141434e-01 1.518236143519533232e-01 4.670296690947607909e-01
+4.142800178080069395e-01 1.486794951032471834e-01 4.606872955350938548e-01
+4.119623878145514673e-01 1.455781389789607694e-01 4.543247452773370720e-01
+4.095958991778662628e-01 1.425210694369028197e-01 4.479428674896456797e-01
+4.071799547953330878e-01 1.395098612110991787e-01 4.415425799574690391e-01
+4.047139367624922324e-01 1.365461366216895456e-01 4.351248757648299992e-01
+4.021972936019284628e-01 1.336316105494000928e-01 4.286903779176353124e-01
+3.996293630849273582e-01 1.307680150350410408e-01 4.222401836338272596e-01
+3.970093606178293211e-01 1.279570274853844003e-01 4.157761120045768699e-01
+3.943365976380542870e-01 1.252003942696350014e-01 4.092995513119635498e-01
+3.916103749033576498e-01 1.224998688123591362e-01 4.028120041341317625e-01
+3.888299858840064682e-01 1.198571984110099742e-01 3.963150954999720699e-01
+3.859947208059889556e-01 1.172741089547249538e-01 3.898105809973525515e-01
+3.831038714159066827e-01 1.147522874417901684e-01 3.833003546699703667e-01
+3.801567365353383798e-01 1.122933622374599760e-01 3.767864564999491295e-01
+3.771526284658990869e-01 1.098988810729940035e-01 3.702710792321893263e-01
+3.740908802950018708e-01 1.075702868621947472e-01 3.637565742534386581e-01
+3.709708541354928557e-01 1.053088915040240603e-01 3.572454561957943420e-01
+3.677919503089708275e-01 1.031158479486348478e-01 3.507404058933542013e-01
+3.645536174519507511e-01 1.009921209275927434e-01 3.442442712851704334e-01
+3.612553634855836804e-01 9.893845688361260771e-02 3.377600658314386384e-01
+3.578967673433453012e-01 9.695535377529579391e-02 3.312909639976103771e-01
+3.544774912975176551e-01 9.504303157033086591e-02 3.248402933678479765e-01
+3.509972936657820841e-01 9.320140436662560646e-02 3.184115229802063629e-01
+3.474560416161082133e-01 9.143005518316707492e-02 3.120082475359999274e-01
+3.438537237247893397e-01 8.972821452832538403e-02 3.056341672288407363e-01
+3.401904735486728781e-01 8.809468358171337887e-02 2.992931815755145442e-01
+3.364665724714709372e-01 8.652789261304066892e-02 2.929892038941975252e-01
+3.326824502647063309e-01 8.502592614588003195e-02 2.867260839053818455e-01
+3.288387024976534012e-01 8.358647051086640078e-02 2.805076847277695462e-01
+3.249360934730275985e-01 8.220683878873383255e-02 2.743378151941179288e-01
+3.209755584101655623e-01 8.088399100741089365e-02 2.682201871550352612e-01
+3.169582022236226426e-01 7.961456284429593855e-02 2.621583713198606391e-01
+3.128852946012805614e-01 7.839490235071094881e-02 2.561557528820557206e-01
+3.087582612248004899e-01 7.722111381434071387e-02 2.502154883125917717e-01
+3.045786711401687885e-01 7.608910749927882966e-02 2.443404647714875755e-01
+3.003482204670568367e-01 7.499465368295166190e-02 2.385332635717280492e-01
+2.960687128198414286e-01 7.393343917254721620e-02 2.327961290245241788e-01
+2.917420369856660312e-01 7.290112435224016529e-02 2.271309438018545013e-01
+2.873701425511966390e-01 7.189339879884681928e-02 2.215392116816457535e-01
+2.829550142767416343e-01 7.090603360902006380e-02 2.160220482113159313e-01
+2.784999277173711985e-01 6.993210653137302280e-02 2.105832735994622174e-01
+2.740068130913843047e-01 6.896804327168698512e-02 2.052225548327365479e-01
+2.694770905593398824e-01 6.801140076763184661e-02 1.999383122503714527e-01
+2.649127155611373241e-01 6.705861363954487842e-02 1.947301490341072916e-01
+2.603155555465970217e-01 6.610638194498252851e-02 1.895973275559961757e-01
+2.556873713350471533e-01 6.515168315524647036e-02 1.845388003264406274e-01
+2.510311382384792789e-01 6.418928564209233634e-02 1.795555007506528800e-01
+2.463515264850693609e-01 6.321115386076697762e-02 1.746505568409140452e-01
+2.416465428487372114e-01 6.222162722501616700e-02 1.698160042316500806e-01
+2.369174512696113344e-01 6.121879219616855466e-02 1.650498029374760922e-01
+2.321653556071113234e-01 6.020099184329732317e-02 1.603497740495725687e-01
+2.273975644358762205e-01 5.915624173942467950e-02 1.557218456563352615e-01
+2.226121431237116921e-01 5.808842465569693386e-02 1.511590815358170026e-01
+2.178074381899826051e-01 5.700049790743180050e-02 1.466558187034970040e-01
+2.129839422000848193e-01 5.589168645699472276e-02 1.422095068240733784e-01]; 
+
+   case 'bal' 
+      RGB = [9.317630180115785143e-02 1.111733294776027225e-01 2.615123885530547532e-01
+9.697151501690241815e-02 1.168702109792841837e-01 2.730963071061036085e-01
+1.009688451686782534e-01 1.223931506799195018e-01 2.849103610759459171e-01
+1.049927013864766501e-01 1.278243708004132007e-01 2.968738052891420898e-01
+1.089874020283561201e-01 1.331935038256579495e-01 3.089538370897204067e-01
+1.129223008178065757e-01 1.385131449459734432e-01 3.211528356563003173e-01
+1.167787372671460905e-01 1.437907235567953967e-01 3.334763137669404798e-01
+1.205463368759411846e-01 1.490330498991488395e-01 3.459192712822865556e-01
+1.242159653236002137e-01 1.542448960991174289e-01 3.584824902114073786e-01
+1.277778433781233958e-01 1.594292997650425259e-01 3.711737182907450250e-01
+1.312243830518974863e-01 1.645899274655008293e-01 3.839938980982077199e-01
+1.345490385720651272e-01 1.697307784244891371e-01 3.969402498465131601e-01
+1.377440294143187915e-01 1.748552489081271477e-01 4.100132193954066917e-01
+1.407996250839473606e-01 1.799660943911219058e-01 4.232173781877683894e-01
+1.437072840727513789e-01 1.850671827584920992e-01 4.365502201613832844e-01
+1.464560785040432134e-01 1.901619264187031366e-01 4.500130967746718835e-01
+1.490348239402249919e-01 1.952544786288682443e-01 4.636036238706138235e-01
+1.514309258266629821e-01 2.003493745808981319e-01 4.773185296806868871e-01
+1.536266468153191511e-01 2.054503782969492598e-01 4.911623505831314018e-01
+1.556073044691906326e-01 2.105638989188344801e-01 5.051241984185815825e-01
+1.573534941852142433e-01 2.156962129560367203e-01 5.191977165014443063e-01
+1.588411077773489166e-01 2.208540630983729658e-01 5.333780986311171812e-01
+1.600396310676128475e-01 2.260448054488821412e-01 5.476626851250718797e-01
+1.609205321230856855e-01 2.312792188936386995e-01 5.620307968352061812e-01
+1.614455266589641669e-01 2.365687572657042548e-01 5.764661948566720540e-01
+1.615687582201552897e-01 2.419271731798259828e-01 5.909472809712390529e-01
+1.612352769386722617e-01 2.473711867632350236e-01 6.054446786315181850e-01
+1.603793369556453796e-01 2.529213001868846900e-01 6.199179403497330210e-01
+1.589165703217830516e-01 2.586022090180682964e-01 6.343183928801525706e-01
+1.567387388150081051e-01 2.644444177118183137e-01 6.485832602021305293e-01
+1.537422741701028883e-01 2.704875236386605764e-01 6.625942914402649375e-01
+1.497539850217274870e-01 2.767772906869140348e-01 6.762428866538948702e-01
+1.446190280141932405e-01 2.833703371099008383e-01 6.893303155405390292e-01
+1.381506719438430897e-01 2.903290266080994497e-01 7.016166706228140759e-01
+1.301937481102784511e-01 2.977137475582261605e-01 7.127928058673724809e-01
+1.207056294812082625e-01 3.055623316038361126e-01 7.225101391519437311e-01
+1.098226938414934850e-01 3.138651882979107688e-01 7.304694442052537262e-01
+9.795843445627248902e-02 3.225431024585883599e-01 7.365271649499161022e-01
+8.570023827886968926e-02 3.314661612751826358e-01 7.407718073497575606e-01
+7.367688675533522191e-02 3.404967458048910878e-01 7.434693436710165804e-01
+6.252232597310111717e-02 3.495197377754474255e-01 7.449562973790243570e-01
+5.283258403911513662e-02 3.584600781237165523e-01 7.455451847703780111e-01
+4.520938539971628561e-02 3.672749347230809258e-01 7.454889092261348660e-01
+4.023631323597558207e-02 3.759418522020857023e-01 7.449841371058433248e-01
+3.831576485736640919e-02 3.844536826035842014e-01 7.441746283479093726e-01
+3.948349528027724625e-02 3.928137536670130436e-01 7.431581338661337188e-01
+4.345843888396401511e-02 4.010237097170425424e-01 7.420243047032398787e-01
+4.962431895510652918e-02 4.090953160508887798e-01 7.408166831290733390e-01
+5.739800117053886486e-02 4.170346954168047682e-01 7.395877539875740370e-01
+6.626017539288729663e-02 4.248521500099918247e-01 7.383650122111450331e-01
+7.582789138192139178e-02 4.325572249230948407e-01 7.371697936237424642e-01
+8.583710398799437868e-02 4.401583433039914506e-01 7.360206802189788178e-01
+9.611023898027164225e-02 4.476635745571445613e-01 7.349312516211791158e-01
+1.065303883460570755e-01 4.550804241299538089e-01 7.339117735870001047e-01
+1.170216465020320479e-01 4.624159111924117660e-01 7.329693696980987827e-01
+1.275357983203295742e-01 4.696767197731893662e-01 7.321074968220891988e-01
+1.380432121650685962e-01 4.768686794858796318e-01 7.313295149248254523e-01
+1.485266661140711986e-01 4.839970747487774561e-01 7.306374469250058734e-01
+1.589774367328510296e-01 4.910666599003393196e-01 7.300322634722052895e-01
+1.693927097070233589e-01 4.980816767007848478e-01 7.295140990156090410e-01
+1.797738575018875684e-01 5.050458714090990675e-01 7.290824177866462863e-01
+1.901252883653588299e-01 5.119625097219066001e-01 7.287361439246872186e-01
+2.004536741991692628e-01 5.188343886055641896e-01 7.284737667569484154e-01
+2.107674308545827713e-01 5.256638445778923918e-01 7.282934299212738827e-01
+2.210763664417479957e-01 5.324527583974503209e-01 7.281930113726282627e-01
+2.313914398990180310e-01 5.392025564688637251e-01 7.281702001646749300e-01
+2.417245888287989919e-01 5.459142096302009861e-01 7.282225751002735503e-01
+2.520885959217774586e-01 5.525882304010224511e-01 7.283476897674903139e-01
+2.624969693582706598e-01 5.592246702775622857e-01 7.285431679898072277e-01
+2.729638158446638374e-01 5.658231192947545951e-01 7.288068131774058100e-01
+2.835036864649327915e-01 5.723827108458280355e-01 7.291367343046032401e-01
+2.941313761905648416e-01 5.789021356407471064e-01 7.295314900628433463e-01
+3.048616586033888742e-01 5.853796696249742304e-01 7.299902509334000866e-01
+3.157089391891977348e-01 5.918132215225327952e-01 7.305129762764809298e-01
+3.266868146870496870e-01 5.982004061606387424e-01 7.311005998876300982e-01
+3.378075337747806772e-01 6.045386495071959354e-01 7.317552128195412564e-01
+3.490818000871770965e-01 6.108253115449155946e-01 7.324796800093837934e-01
+3.605169723334935572e-01 6.170578982409773428e-01 7.332792190500567742e-01
+3.721163789840524760e-01 6.232343167456089184e-01 7.341612307067191256e-01
+3.838798790902256397e-01 6.293530561660979350e-01 7.351337469132933622e-01
+3.958028137607393915e-01 6.354134382185918639e-01 7.362060213183361235e-01
+4.078755353103907799e-01 6.414158575290970221e-01 7.373884640869047269e-01
+4.200825599604326444e-01 6.473620651543986471e-01 7.386930839012650907e-01
+4.324066537782813580e-01 6.532548504780409937e-01 7.401294470548486215e-01
+4.448270147115060968e-01 6.590982595876608841e-01 7.417069328868316491e-01
+4.573210929073768805e-01 6.648973878622411737e-01 7.434335263117878290e-01
+4.698658823662555939e-01 6.706581495075844002e-01 7.453153847182404368e-01
+4.824391638200489774e-01 6.763869948243975694e-01 7.473565606883062484e-01
+4.950205546820442004e-01 6.820906132919950515e-01 7.495589040396917202e-01
+5.075922656244505893e-01 6.877756591216436233e-01 7.519221394187723950e-01
+5.201395209800695474e-01 6.934485275105084501e-01 7.544440922042097153e-01
+5.326506556783058288e-01 6.991151975856019218e-01 7.571210204550441469e-01
+5.451151059190834092e-01 7.047815278674717243e-01 7.599492971931861574e-01
+5.575181558550945660e-01 7.104543187762520917e-01 7.629291415211207905e-01
+5.698635397781144363e-01 7.161365136199150383e-01 7.660488334775965580e-01
+5.821485860154738123e-01 7.218322109491160932e-01 7.693023567855580280e-01
+5.943602368020499682e-01 7.275477994362923306e-01 7.726916325476315128e-01
+6.065080899095934841e-01 7.332844479726540188e-01 7.762041114816310428e-01
+6.185864665812587093e-01 7.390466790641196937e-01 7.798383670352863062e-01
+6.305963554035781682e-01 7.448373397672364282e-01 7.835892177406345027e-01
+6.425403291413834816e-01 7.506587685331359561e-01 7.874510644025978223e-01
+6.544185977825304201e-01 7.565137308188258913e-01 7.914204294842384080e-01
+6.662315287143806275e-01 7.624048800378464552e-01 7.954941819359623301e-01
+6.779850393157120791e-01 7.683332855369554570e-01 7.996659972294575258e-01
+6.896755013217630292e-01 7.743024253591546113e-01 8.039360994237751967e-01
+7.013107513266423343e-01 7.803126348729136907e-01 8.082975524678305268e-01
+7.128885314512861671e-01 7.863668558670167119e-01 8.127502175082055302e-01
+7.244112448085553435e-01 7.924667152464015540e-01 8.172911293271547528e-01
+7.358836989688380958e-01 7.986130654557248576e-01 8.219158971644889844e-01
+7.473044386446877629e-01 8.048084510111997991e-01 8.266243361574353576e-01
+7.586759860087319840e-01 8.110542493572184819e-01 8.314137476978961105e-01
+7.700007022560961811e-01 8.173518180665149124e-01 8.362815657919246970e-01
+7.812789490175476859e-01 8.237030526155880716e-01 8.412265533654796901e-01
+7.925116214732782494e-01 8.301096652946458043e-01 8.462470956714009951e-01
+8.036997510351909790e-01 8.365733017623517842e-01 8.513414099007207136e-01
+8.148431081888104499e-01 8.430959697406819053e-01 8.565084542610862384e-01
+8.259421593641688153e-01 8.496794646156250463e-01 8.617465433522450979e-01
+8.369967539127278755e-01 8.563257710703112702e-01 8.670541605111352634e-01
+8.480038340013845710e-01 8.630377874332209043e-01 8.724315628924932398e-01
+8.589628398368314155e-01 8.698176873531217046e-01 8.778768407867350021e-01
+8.698718779534676537e-01 8.766681056859056964e-01 8.833884311630415542e-01
+8.807225950585577667e-01 8.835937613774932364e-01 8.889689808541467730e-01
+8.915125639987498962e-01 8.905976582376062822e-01 8.946157932523199907e-01
+9.022321856472953483e-01 8.976851819173250480e-01 9.003303399902121695e-01
+9.128629530771473766e-01 9.048646775143293075e-01 9.061201920398328502e-01
+9.233906674988954233e-01 9.121434538185491103e-01 9.119872701021832784e-01
+9.337690699519377580e-01 9.195389121458987791e-01 9.179604265763980919e-01
+9.438768578707728008e-01 9.270905817099515112e-01 9.241478407896098757e-01
+9.450241336950316873e-01 9.267273985243987822e-01 9.232017297254778709e-01
+9.401771503305338396e-01 9.175010969420787088e-01 9.127353023021862466e-01
+9.357788176131993652e-01 9.081849602977229985e-01 9.019958970504049489e-01
+9.316195516453253944e-01 8.988455936080792519e-01 8.911247259869568005e-01
+9.276366903952597553e-01 8.895015346080178409e-01 8.801625091446737548e-01
+9.237963723082156520e-01 8.801619939913720714e-01 8.691306632065185500e-01
+9.200767818087643990e-01 8.708323115565800299e-01 8.580426479951916985e-01
+9.164622665155582881e-01 8.615158650696722598e-01 8.469079246742292622e-01
+9.129409700010679973e-01 8.522148302070590153e-01 8.357335125969563849e-01
+9.095033897880691054e-01 8.429306461313940124e-01 8.245249535921664874e-01
+9.061413505699446036e-01 8.336643536120030840e-01 8.132870275157044748e-01
+9.028482401464246188e-01 8.244164969479621519e-01 8.020234992942889551e-01
+8.996183458250350817e-01 8.151873435674267254e-01 7.907375926293952473e-01
+8.964464017336835067e-01 8.059770371403549571e-01 7.794323253122593664e-01
+8.933280984986637918e-01 7.967854062668440207e-01 7.681100636805964221e-01
+8.902585423162623357e-01 7.876125240246927284e-01 7.567737971546929510e-01
+8.872341531517662361e-01 7.784580066111700392e-01 7.454255275413548265e-01
+8.842515223931736168e-01 7.693214239645329577e-01 7.340672060990318659e-01
+8.813075692568397290e-01 7.602022354826803996e-01 7.227005864751234743e-01
+8.783989821496545058e-01 7.511000050313838550e-01 7.113277185683902770e-01
+8.755220238171187441e-01 7.420144833045193566e-01 6.999511354610528091e-01
+8.726749843514796101e-01 7.329446408023255755e-01 6.885716411869530207e-01
+8.698547215416584377e-01 7.238900130170270453e-01 6.771913952144653637e-01
+8.670596624933959440e-01 7.148495108503407636e-01 6.658111988100340328e-01
+8.642855405275950975e-01 7.058231520382152180e-01 6.544344321908397433e-01
+8.615312235931757989e-01 6.968096810882964398e-01 6.430616521710770250e-01
+8.587945613193220806e-01 6.878082471826545419e-01 6.316944172411573799e-01
+8.560737697641845889e-01 6.788178389092562881e-01 6.203340096274330140e-01
+8.533647514077651319e-01 6.698384520573987810e-01 6.089840337795546787e-01
+8.506671813652186831e-01 6.608684511065675560e-01 5.976445430267850467e-01
+8.479803760976425409e-01 6.519062997089123401e-01 5.863159553827915760e-01
+8.452992890124730874e-01 6.429524288345007665e-01 5.750030931030669645e-01
+8.426233261680482478e-01 6.340052727647743636e-01 5.637064935396088883e-01
+8.399526706457652869e-01 6.250628349958033958e-01 5.524259435430849408e-01
+8.372823606159069953e-01 6.161255232979981900e-01 5.411665126797099434e-01
+8.346115013722664733e-01 6.071918418882036317e-01 5.299292934604437066e-01
+8.319416971332159738e-01 5.982589838531851001e-01 5.187128588454869016e-01
+8.292658393187906096e-01 5.893284247613858051e-01 5.075248627530006829e-01
+8.265865191963318592e-01 5.803968068112989043e-01 4.963630791145096643e-01
+8.239007716165898110e-01 5.714634777707676694e-01 4.852311209906218226e-01
+8.212047236427109098e-01 5.625283035002011101e-01 4.741337367172645534e-01
+8.185028441784485409e-01 5.535866371885466153e-01 4.630669974760600605e-01
+8.157857974447502158e-01 5.446412013022012832e-01 4.520417208585162938e-01
+8.130598755024439628e-01 5.356861530869529986e-01 4.410523109242584505e-01
+8.103157295614864530e-01 5.267242547499885186e-01 4.301100025814295069e-01
+8.075600763067809496e-01 5.177491168092126506e-01 4.192090517728162546e-01
+8.047829983640772955e-01 5.087638530967844019e-01 4.083617627821872209e-01
+8.019913643823087801e-01 4.997616265469864705e-01 3.975626288212918968e-01
+7.991776069093209367e-01 4.907441098507538402e-01 3.868219510427612362e-01
+7.963412506983238437e-01 4.817086347924898759e-01 3.761426799347312722e-01
+7.934853391750592566e-01 4.726500967551418020e-01 3.655242898980974875e-01
+7.906020861628313412e-01 4.635701843716890092e-01 3.549783159786080722e-01
+7.876922078438237662e-01 4.544650164439674178e-01 3.445075235304189132e-01
+7.847584433242353885e-01 4.453290095612297272e-01 3.341130019968927001e-01
+7.817943763481589592e-01 4.361626378195018194e-01 3.238062118505327658e-01
+7.787986023472407426e-01 4.269628178617235204e-01 3.135938243777520174e-01
+7.757700306772615795e-01 4.177259860608659170e-01 3.034828822113839197e-01
+7.727073763310282617e-01 4.084484227667745659e-01 2.934814547614346680e-01
+7.696090956246998127e-01 3.991262801626034307e-01 2.835988305456279002e-01
+7.664733140591651894e-01 3.897556205902359405e-01 2.738457322824414675e-01
+7.632977462662783319e-01 3.803324674237734127e-01 2.642345539395078435e-01
+7.600796083228246180e-01 3.708528707479538111e-01 2.547796171102231777e-01
+7.568155232311498670e-01 3.613129902046505748e-01 2.454974414736316723e-01
+7.535014210471865370e-01 3.517091973617619272e-01 2.364070204678299647e-01
+7.501324359996863755e-01 3.420381997805444496e-01 2.275300884680255264e-01
+7.467083678923864820e-01 3.322917332197801166e-01 2.188868097223075626e-01
+7.432206214135255173e-01 3.224689513722865386e-01 2.105072965395320406e-01
+7.396626352495903056e-01 3.125667176366879740e-01 2.024226257801388651e-01
+7.360276592028781595e-01 3.025817058357924139e-01 1.946669682951213953e-01
+7.323075054306246168e-01 2.925115926125090304e-01 1.872788656593587786e-01
+7.284886793139783157e-01 2.823599622393618280e-01 1.803025816545419935e-01
+7.245597795551689257e-01 2.721283507524605572e-01 1.737830391183990686e-01
+7.205052554891407945e-01 2.618237699935750395e-01 1.677681078164939554e-01
+7.163077524522897255e-01 2.514568470079543427e-01 1.623050371038979034e-01
+7.119477511381474555e-01 2.410431671523047270e-01 1.574376915741905747e-01
+7.074046106878864038e-01 2.306029576903746436e-01 1.532027782639572566e-01
+7.026577763956233236e-01 2.201603247696940491e-01 1.496264194674281345e-01
+6.976856380676357272e-01 2.097462458983016809e-01 1.467193374830310926e-01
+6.924700993857928477e-01 1.993923480969033712e-01 1.444757571309586708e-01
+6.869956304794752056e-01 1.891326217641629281e-01 1.428720296451389260e-01
+6.812509389222788370e-01 1.790005719286615893e-01 1.418684919672574540e-01
+6.752290404511711586e-01 1.690283951735306323e-01 1.414126182563193168e-01
+6.689272347019628029e-01 1.592460113853382819e-01 1.414436246187784352e-01
+6.623462930327670417e-01 1.496814992323431404e-01 1.418966965532167945e-01
+6.554894621920681619e-01 1.403622590219790744e-01 1.427060758527507467e-01
+6.483618361407726960e-01 1.313154491044398742e-01 1.438093776439538507e-01
+6.409690900196458596e-01 1.225708994915949840e-01 1.451466621124405387e-01
+6.333171868548845840e-01 1.141616381299322275e-01 1.466635532234118466e-01
+6.254117682555888624e-01 1.061263207405454406e-01 1.483083323541042609e-01
+6.172580943089347461e-01 9.850955940169045522e-02 1.500342818055006577e-01
+6.088612137441752337e-01 9.136271116346880716e-02 1.517946748017894032e-01
+6.002260075568476294e-01 8.474268845605749390e-02 1.535471889644061949e-01
+5.913580665313180607e-01 7.870937974751122945e-02 1.552475962263118736e-01
+5.822640724597829553e-01 7.332110668924821106e-02 1.568528524628541587e-01
+5.729523242155735163e-01 6.862870182587510470e-02 1.583209522546889236e-01
+5.634337248699358147e-01 6.466696013382158825e-02 1.596097119552595534e-01
+5.537224099506778963e-01 6.144626935987178989e-02 1.606779590153868675e-01
+5.438351395676241928e-01 5.894914800814857886e-02 1.614895452047331870e-01
+5.337912133736735232e-01 5.712858102881844535e-02 1.620138116792186611e-01
+5.236119994512118403e-01 5.591095129374230172e-02 1.622265257547594042e-01
+5.133214710039554207e-01 5.519900277454217047e-02 1.621082697921440163e-01
+5.029415119053961547e-01 5.489268743951671026e-02 1.616521201270082198e-01
+4.924920560465744224e-01 5.489497800522934179e-02 1.608594568967110505e-01
+4.819970419875420631e-01 5.509874164212420766e-02 1.597294678457327477e-01
+4.714685312956432006e-01 5.543752958786138385e-02 1.582803570073196830e-01
+4.609298385556733768e-01 5.581817450175154821e-02 1.565161535498545142e-01
+4.503882306974699712e-01 5.620093240974462917e-02 1.544603609580012249e-01
+4.398550445667638309e-01 5.653967482715421822e-02 1.521296397207116124e-01
+4.293395854267749168e-01 5.679892905513854451e-02 1.495413040881575784e-01
+4.188488052114383020e-01 5.695351275720081374e-02 1.467131019928892832e-01
+4.083874753510262079e-01 5.698679735961746651e-02 1.436626150429021476e-01
+3.979584206972520133e-01 5.688899115379054960e-02 1.404067946849407167e-01
+3.875661805934746962e-01 5.664744510513378128e-02 1.369596232193354413e-01
+3.772162562473511671e-01 5.624858727791105101e-02 1.333332882463785507e-01
+3.669009710312429173e-01 5.571027577451325569e-02 1.295456315830630090e-01
+3.566289201162299305e-01 5.501236188184371184e-02 1.256041268313332904e-01
+3.463946141954395985e-01 5.416713051157899528e-02 1.215221064681567403e-01
+3.362018241761821069e-01 5.316577293008726418e-02 1.173074037138401304e-01
+3.260424402261492549e-01 5.202497987647033972e-02 1.129713889339670624e-01
+3.159278573165507087e-01 5.071934147936141973e-02 1.085175153831856448e-01
+3.058440467352613878e-01 4.927677960771512794e-02 1.039569210271578392e-01
+2.957906289005873823e-01 4.769542811326495796e-02 9.929501197500162357e-02
+2.857761694878986902e-01 4.595516903310007534e-02 9.453469664208309642e-02
+2.757883929056377248e-01 4.407729543414404955e-02 8.968329380554104779e-02
+2.658251433737037206e-01 4.206161274965801444e-02 8.474472186508703875e-02
+2.558840557281191197e-01 3.990046570244704105e-02 7.972236454569985031e-02
+2.459622220783502511e-01 3.762595141506584057e-02 7.461913567560218841e-02
+2.360563646646140490e-01 3.529747994604028744e-02 6.943744239412558139e-02]; 
+
+   case 'gra'
+      RGB = [5.119113838889112324e-07 2.052270195661655352e-06 5.982577941045682640e-06
+2.598440803609315740e-04 2.625944024536107477e-04 2.770622839605119624e-04
+8.656156394278343835e-04 8.570638031131799393e-04 8.794207369001087564e-04
+1.769403238430108027e-03 1.740368058158140796e-03 1.768607096399604827e-03
+2.949472160671299040e-03 2.891903379202926793e-03 2.924180394823831797e-03
+4.392323531342203803e-03 4.298904740810657703e-03 4.333431047933433700e-03
+6.088553115957890012e-03 5.952519318106651129e-03 5.987527380406317858e-03
+8.031191715623246449e-03 7.846222922619310730e-03 7.879950296964649201e-03
+1.021487523527209347e-02 9.975026089550139557e-03 1.000570608701620810e-02
+1.263537226121889262e-02 1.233502163300135256e-02 1.236087717148891089e-02
+1.528929074309834900e-02 1.492310361152201538e-02 1.494234288239030227e-02
+1.817388406754013447e-02 1.773678153559082871e-02 1.774759483393608533e-02
+2.128691657088564032e-02 2.077405157770592994e-02 2.077460893832101113e-02
+2.462656669738432988e-02 2.403330390048570228e-02 2.402175331762853791e-02
+2.819135511163322477e-02 2.751325392935317568e-02 2.748772001065160481e-02
+3.198008997843642537e-02 3.121289009539909495e-02 3.117147304311678954e-02
+3.599182442355883943e-02 3.513143325966101155e-02 3.507220810044759524e-02
+4.022582286584987926e-02 3.926830463975648777e-02 3.918932064337803806e-02
+4.449007920559793633e-02 4.350122490641009781e-02 4.340640025397465157e-02
+4.870367428407672977e-02 4.767846692745423415e-02 4.756790269604229543e-02
+5.287362099388332598e-02 5.181334368492381687e-02 5.168705396373681621e-02
+5.700314746954803641e-02 5.590901252301124641e-02 5.576700147480036923e-02
+6.109513723484618491e-02 5.996829329212761267e-02 5.981055680351737153e-02
+6.515218007540821143e-02 6.399371820125457355e-02 6.382024521975740439e-02
+6.917661353844734018e-02 6.798757248509634810e-02 6.779834611081525519e-02
+7.317055710313111194e-02 7.195192788781537563e-02 7.174692627103734788e-02
+7.713594055593872567e-02 7.588867046670466632e-02 7.566786755046528423e-02
+8.107452773767656606e-02 7.979952385914274027e-02 7.956288999694530184e-02
+8.498793655960165672e-02 8.368606889245686076e-02 8.343357136470588853e-02
+8.887765598636060416e-02 8.754976022063193364e-02 8.728136366834671200e-02
+9.274506053351619372e-02 9.139194052486757092e-02 9.110760731542752455e-02
+9.659142271361736976e-02 9.521385270343013518e-02 9.491354324016601507e-02
+1.004179237775132127e-01 9.901665039071003149e-02 9.870032337586748250e-02
+1.042256630300536779e-01 1.028014070791676282e-01 1.024690197379714285e-01
+1.080156659465895397e-01 1.065691240661386929e-01 1.062206323382679229e-01
+1.117888912751462127e-01 1.103207374067532442e-01 1.099560961104033285e-01
+1.155462372762081913e-01 1.140571240219185878e-01 1.136762869947187948e-01
+1.192885472257254331e-01 1.177791070845015386e-01 1.173820273048238605e-01
+1.230166142857740674e-01 1.214874607860790545e-01 1.210740904776794746e-01
+1.267311858301593541e-01 1.251829145698133972e-01 1.247532052922631640e-01
+1.304329672982797728e-01 1.288661569013136721e-01 1.284200596282795426e-01
+1.341226256391360172e-01 1.325378386381312334e-01 1.320753038252369949e-01
+1.378007923979476801e-01 1.361985760492960551e-01 1.357195536930293212e-01
+1.414680664900422602e-01 1.398489535286627783e-01 1.393533932175645418e-01
+1.451250167001958413e-01 1.434895260394738747e-01 1.429773769986621423e-01
+1.487721839401931478e-01 1.471208213222370831e-01 1.465920324521616802e-01
+1.524100832928171334e-01 1.507433418935591463e-01 1.501978618037517477e-01
+1.560392058666605075e-01 1.543575668598215767e-01 1.537953438982961329e-01
+1.596600204829017322e-01 1.579639535664100758e-01 1.573849358452757696e-01
+1.632729752124383871e-01 1.615629391005102000e-01 1.609670745182808227e-01
+1.668784987794287578e-01 1.651549416631863942e-01 1.645421779242018656e-01
+1.704770018452845537e-01 1.687403618244931736e-01 1.681106464558155544e-01
+1.740688781854339839e-01 1.723195836736857167e-01 1.716728640397789662e-01
+1.776545057697057339e-01 1.758929758751424655e-01 1.752291991906090307e-01
+1.812342477558830656e-01 1.794608926393625181e-01 1.787800059799695696e-01
+1.848084534049017069e-01 1.830236746173136975e-01 1.823256249295160947e-01
+1.883774589251684672e-01 1.865816497254700890e-01 1.858663838346062414e-01
+1.919415882526751271e-01 1.901351339080520064e-01 1.894025985253704192e-01
+1.955011537728245652e-01 1.936844318422726863e-01 1.929345735709248333e-01
+1.990564569892651070e-01 1.972298375917654889e-01 1.964626029318853884e-01
+2.026077891444517665e-01 2.007716352128197101e-01 1.999869705657932872e-01
+2.061554317961845073e-01 2.043100993175656077e-01 2.035079509895849070e-01
+2.096996573539102737e-01 2.078454955978322194e-01 2.070258098028130989e-01
+2.132407295782156598e-01 2.113780813130166081e-01 2.105408041749530779e-01
+2.167789040465809003e-01 2.149081057449790388e-01 2.140531832997963901e-01
+2.203144285881817321e-01 2.184358106226793050e-01 2.175631888196422614e-01
+2.238475436902406246e-01 2.219614305190086845e-01 2.210710552217338698e-01
+2.273784828782031697e-01 2.254851932220399702e-01 2.245770102091559361e-01
+2.309074730717983193e-01 2.290073200827110744e-01 2.280812750482046902e-01
+2.344347349188553031e-01 2.325280263407684678e-01 2.315840648940526436e-01
+2.379604831085705419e-01 2.360475214306362868e-01 2.350855890963675088e-01
+2.414849266657837501e-01 2.395660092687221798e-01 2.385860514863973880e-01
+2.450082692276646656e-01 2.430836885235431177e-01 2.420856506468980207e-01
+2.485307093041047577e-01 2.466007528699289408e-01 2.455845801661603045e-01
+2.520524405229936926e-01 2.501173912284589962e-01 2.490830288772885037e-01
+2.555736518614571962e-01 2.536337879911821358e-01 2.525811810837814142e-01
+2.590945278640408023e-01 2.571501232345917431e-01 2.560792167723802693e-01
+2.626152488487566439e-01 2.606665729207388593e-01 2.595773118140702884e-01
+2.661359911018202906e-01 2.641833090872994227e-01 2.630756381540483857e-01
+2.696569270618426883e-01 2.677005000273448010e-01 2.665743639914045504e-01
+2.731782254941877985e-01 2.712183104595063399e-01 2.700736539492059607e-01
+2.767000516561451962e-01 2.747369016891675342e-01 2.735736692356186550e-01
+2.802225674535130939e-01 2.782564317612734595e-01 2.770745677966527931e-01
+2.837459315891543987e-01 2.817770556052956454e-01 2.805765044610715742e-01
+2.872702997040328943e-01 2.852989251728569320e-01 2.840796310779650780e-01
+2.907958245112020612e-01 2.888221895684777163e-01 2.875840966474506044e-01
+2.943226559231933992e-01 2.923469951738719153e-01 2.910900474449292785e-01
+2.978509411732042089e-01 2.958734857661936557e-01 2.945976271392962698e-01
+3.013808249304671394e-01 2.994018026306028979e-01 2.981069769054734420e-01
+3.049124494101519978e-01 3.029320846674894985e-01 3.016182355316066044e-01
+3.084459544781194551e-01 3.064644684946828401e-01 3.051315395212462755e-01
+3.119814777508492787e-01 3.099990885449340761e-01 3.086470231908091666e-01
+3.155191546907993305e-01 3.135360771589531526e-01 3.121648187625948867e-01
+3.190591186974824911e-01 3.170755646742604017e-01 3.156850564536164416e-01
+3.226015011944919908e-01 3.206176795100827426e-01 3.192078645604823350e-01
+3.261464317127154011e-01 3.241625482485306353e-01 3.227333695405575908e-01
+3.296940379699381807e-01 3.277102957122579041e-01 3.262616960896098095e-01
+3.332444459470546017e-01 3.312610450388014383e-01 3.297929672161359349e-01
+3.367977799610606948e-01 3.348149177517827924e-01 3.333273043125560831e-01
+3.403541627350049614e-01 3.383720338291492657e-01 3.368648272234392449e-01
+3.439137154650676598e-01 3.419325117686051185e-01 3.404056543109294508e-01
+3.474765578849234871e-01 3.454964686503906313e-01 3.439499025175156155e-01
+3.510428083275172195e-01 3.490640201975497847e-01 3.474976874262884485e-01
+3.546125837844137374e-01 3.526352808338130695e-01 3.510491233188203775e-01
+3.581859999628214664e-01 3.562103637392293742e-01 3.546043232307861115e-01
+3.617631713404313443e-01 3.597893809036549762e-01 3.581633990054478578e-01
+3.653442112181757850e-01 3.633724431782132114e-01 3.617264613451083854e-01
+3.689292317710045621e-01 3.669596603248330147e-01 3.652936198606414053e-01
+3.725183440967992365e-01 3.705511410639528158e-01 3.688649831191926354e-01
+3.761116582634963512e-01 3.741469931204933763e-01 3.724406586901452543e-01
+3.797092833545231416e-01 3.777473232681791138e-01 3.760207531894346200e-01
+3.833113275126273645e-01 3.813522373722905701e-01 3.796053723222968523e-01
+3.869178979821737419e-01 3.849618404309278485e-01 3.831946209245254420e-01
+3.905291011499888443e-01 3.885762366148534097e-01 3.867886030023093280e-01
+3.941450425848224692e-01 3.921955293059884440e-01 3.903874217707223315e-01
+3.977658270754869663e-01 3.958198211346236617e-01 3.939911796909281172e-01
+4.013915586677523906e-01 3.994492140154045079e-01 3.975999785061617997e-01
+4.050223407000290154e-01 4.030838091821594138e-01 4.012139192765472040e-01
+4.086582758379366798e-01 4.067237072216087768e-01 4.048331024128048461e-01
+4.122994661077632461e-01 4.103690081060247796e-01 4.084576277089013163e-01
+4.159460129289094255e-01 4.140198112248798523e-01 4.120875943736929670e-01
+4.195980171453375096e-01 4.176762154155350126e-01 4.157231010616072031e-01
+4.232555790560795228e-01 4.213383189930122175e-01 4.193642459024058966e-01
+4.269187984448540862e-01 4.250062197788932461e-01 4.230111265300784962e-01
+4.305877746088247471e-01 4.286800151293829186e-01 4.266638401108986955e-01
+4.342626063865396291e-01 4.323598019625811695e-01 4.303224833706847940e-01
+4.379433921850948153e-01 4.360456767849914539e-01 4.339871526213026076e-01
+4.416302300065532149e-01 4.397377357173059553e-01 4.376579437864426825e-01
+4.453232174736505011e-01 4.434360745195019549e-01 4.413349524267043966e-01
+4.490224518548273092e-01 4.471407886152713451e-01 4.450182737640205333e-01
+4.527280300886077913e-01 4.508519731158264210e-01 4.487080027054508036e-01
+4.564400488073677153e-01 4.545697228430990999e-01 4.524042338663719076e-01
+4.601586043605019882e-01 4.582941323523668786e-01 4.561070615930931660e-01
+4.638837928370361241e-01 4.620252959543280080e-01 4.598165799849223689e-01
+4.676157100876950357e-01 4.657633077366521435e-01 4.635328829157047692e-01
+4.713544517464566819e-01 4.695082615850322827e-01 4.672560640548638067e-01
+4.751001132516106673e-01 4.732602512037566433e-01 4.709862168879611066e-01
+4.788527898663595406e-01 4.770193701358209082e-01 4.747234347367983998e-01
+4.826125766989533550e-01 4.807857117826079274e-01 4.784678107790839019e-01
+4.863795687224105602e-01 4.845593694231487558e-01 4.822194380676812497e-01
+4.901538607938191183e-01 4.883404362329857862e-01 4.859784095494587564e-01
+4.939355476732588124e-01 4.921290053026548539e-01 4.897448180837610798e-01
+4.977247240423329777e-01 4.959251696558080735e-01 4.935187564605149624e-01
+5.015214845223622264e-01 4.997290222669866222e-01 4.973003174179899122e-01
+5.053259236922266195e-01 5.035406560790653963e-01 5.010895936602286493e-01
+5.091381361058908706e-01 5.073601640203813101e-01 5.048866778741611938e-01
+5.129582163096103598e-01 5.111876390215642774e-01 5.086916627464180829e-01
+5.167862588588553185e-01 5.150231740320770912e-01 5.125046409798591496e-01
+5.206223583349409711e-01 5.188668620364874640e-01 5.163257053098251337e-01
+5.244666093614033242e-01 5.227187960704765546e-01 5.201549485201331091e-01
+5.283191066201067265e-01 5.265790692366016934e-01 5.239924634588227770e-01
+5.321799448671195032e-01 5.304477747198240722e-01 5.278383430536651710e-01
+5.360492189483508918e-01 5.343250058028127247e-01 5.316926803274503177e-01
+5.399270238149752599e-01 5.382108558810341226e-01 5.355555684130592908e-01
+5.438134545386418273e-01 5.421054184776434859e-01 5.394271005683370923e-01
+5.477086063264958726e-01 5.460087872581790291e-01 5.433073701907695785e-01
+5.516125745359978794e-01 5.499210560450835672e-01 5.471964708319829729e-01
+5.555254546895829204e-01 5.538423188320419355e-01 5.510944962120672974e-01
+5.594473424891353019e-01 5.577726697981703063e-01 5.550015402337400428e-01
+5.633783338303157695e-01 5.617122033220391941e-01 5.589176969963529640e-01
+5.673185248167353922e-01 5.656610139955613459e-01 5.628430608097579890e-01
+5.712680117739895591e-01 5.696191966377359694e-01 5.667777262080311296e-01
+5.752268912635538634e-01 5.735868463082712809e-01 5.707217879630733792e-01
+5.791952600965620812e-01 5.775640583210815970e-01 5.746753410980864896e-01
+5.831732153474624702e-01 5.815509282576770689e-01 5.786384809009386121e-01
+5.871608543675723713e-01 5.855475519804423934e-01 5.826113029374229146e-01
+5.911582747985197894e-01 5.895540256458231543e-01 5.865939030644199415e-01
+5.951655745855983781e-01 5.935704457174205695e-01 5.905863774429681579e-01
+5.991828519910353812e-01 5.975969089789966437e-01 5.945888225512460101e-01
+6.032102056071760865e-01 6.016335125474120415e-01 5.986013351974859287e-01
+6.072477343695864560e-01 6.056803538854835800e-01 6.026240125328050645e-01
+6.112955375701087934e-01 6.097375308147855444e-01 6.066569520639827351e-01
+6.153537148698353665e-01 6.138051415283823919e-01 6.107002516661682590e-01
+6.194223663120388412e-01 6.178832846035217097e-01 6.147540095955469353e-01
+6.235015923350435418e-01 6.219720590142719940e-01 6.188183245019491796e-01
+6.275914937850678443e-01 6.260715641441202406e-01 6.228932954414247991e-01
+6.316921719290113924e-01 6.301818997985384474e-01 6.269790218887789646e-01
+6.358037284672281020e-01 6.343031662175184771e-01 6.310756037500810933e-01
+6.399262655462556459e-01 6.384354640880801623e-01 6.351831413751425348e-01
+6.440598857715362779e-01 6.425788945567643129e-01 6.393017355699824877e-01
+6.482046922201168959e-01 6.467335592421092905e-01 6.434314876092731561e-01
+6.523607884533356716e-01 6.508995602471195907e-01 6.475724992487805753e-01
+6.565282785295067924e-01 6.550770001717296509e-01 6.517248727377952244e-01
+6.607072670166060924e-01 6.592659821252698782e-01 6.558887108315696324e-01
+6.648978590049534620e-01 6.634666097389374517e-01 6.600641168037573170e-01
+6.691001601199109139e-01 6.676789871782776720e-01 6.642511944588598283e-01
+6.733142765345891956e-01 6.719032191556818523e-01 6.684500481446935538e-01
+6.775403149825812710e-01 6.761394109429005317e-01 6.726607827648712901e-01
+6.817783827707052380e-01 6.803876683835863304e-01 6.768835037913099040e-01
+6.860285877917917663e-01 6.846480979058627847e-01 6.811183172767648619e-01
+6.902910385374814162e-01 6.889208065349254895e-01 6.853653298673966221e-01
+6.945658441110833525e-01 6.932059019056816540e-01 6.896246488153768839e-01
+6.988531142404552643e-01 6.975034922754330680e-01 6.938963819915323628e-01
+7.031529592909376847e-01 7.018136865365992572e-01 6.981806378980350836e-01
+7.074654902783347188e-01 7.061365942294985931e-01 7.024775256811436330e-01
+7.117908188819498383e-01 7.104723255551799177e-01 7.067871551439977029e-01
+7.161290574576848478e-01 7.148209913883080135e-01 7.111096367594695877e-01
+7.204803190511824829e-01 7.191827032901243477e-01 7.154450816830777438e-01
+7.248447174110647095e-01 7.235575735214593296e-01 7.197936017659686270e-01
+7.292223670022126569e-01 7.279457150558282796e-01 7.241553095679664764e-01
+7.336133830191388094e-01 7.323472415925961210e-01 7.285303183706990371e-01
+7.380178813994349163e-01 7.367622675702208968e-01 7.329187421908015532e-01
+7.424359788373007252e-01 7.411909081795812204e-01 7.373206957932009198e-01
+7.468677927971572039e-01 7.456332793773956524e-01 7.417362947044913168e-01
+7.513134415273599043e-01 7.500894978997243445e-01 7.461656552263956632e-01
+7.557730440739957034e-01 7.545596812755732685e-01 7.506088944493225501e-01
+7.602467202947890135e-01 7.590439478405959228e-01 7.550661302660249818e-01
+7.647345908731115749e-01 7.635424167508956250e-01 7.595374813853584817e-01
+7.692367773320856195e-01 7.680552079969388268e-01 7.640230673461460009e-01
+7.737534020488213704e-01 7.725824424175786742e-01 7.685230085311559600e-01
+7.782845882687531303e-01 7.771242417141914771e-01 7.730374261811926440e-01
+7.828304601200990476e-01 7.816807284649387455e-01 7.775664424093062799e-01
+7.873911426284513349e-01 7.862520261391466869e-01 7.821101802151280147e-01
+7.919667617314893882e-01 7.908382591118159333e-01 7.866687634993275724e-01
+7.965574442938269106e-01 7.954395526782646053e-01 7.912423170782062476e-01
+8.011633181219949273e-01 8.000560330689072686e-01 7.958309666984236808e-01
+8.057845119795647992e-01 8.046878274641713347e-01 8.004348390518634115e-01
+8.104211556024298879e-01 8.093350640095594573e-01 8.050540617906442042e-01
+8.150733797142104553e-01 8.139978718308641392e-01 8.096887635422753693e-01
+8.197413160418366429e-01 8.186763810495288896e-01 8.143390739249705135e-01
+8.244250973312831077e-01 8.233707227981730270e-01 8.190051235631107263e-01
+8.291248573634558694e-01 8.280810292362735803e-01 8.236870441028736334e-01
+8.338407309702662307e-01 8.328074335660153871e-01 8.283849682280266524e-01
+8.385728540508587958e-01 8.375500700483110572e-01 8.330990296758882252e-01
+8.433213635880250081e-01 8.423090740189962400e-01 8.378293632534637991e-01
+8.480863976647909919e-01 8.470845819052075232e-01 8.425761048537626641e-01
+8.528680954812019044e-01 8.518767312419356363e-01 8.473393914722943121e-01
+8.576665973712844782e-01 8.566856606887783832e-01 8.521193612237554227e-01
+8.624820448202135115e-01 8.615115100468785370e-01 8.569161533589082502e-01
+8.673145804816755344e-01 8.663544202760624646e-01 8.617299082816555211e-01
+8.721643481954295396e-01 8.712145335121869172e-01 8.665607675663183906e-01
+8.770314930050886471e-01 8.760919930846851056e-01 8.714088739751210122e-01
+8.819161611761232589e-01 8.809869435343266053e-01 8.762743714758871594e-01
+8.868185002140476225e-01 8.858995306312075213e-01 8.811574052599523421e-01
+8.917386588828791760e-01 8.908299013929442678e-01 8.860581217602967463e-01
+8.966767872237935144e-01 8.957782041031091547e-01 8.909766686699112093e-01
+9.016330365740294894e-01 9.007445883298949019e-01 8.959131949603859058e-01
+9.066075595860336733e-01 9.057292049450164084e-01 9.008678509007446156e-01
+9.116005102468445198e-01 9.107322061428585469e-01 9.058407880765154685e-01
+9.166120438977335416e-01 9.157537454598729809e-01 9.108321594090563744e-01
+9.216423172541110542e-01 9.207939777942257820e-01 9.158421191751267010e-01
+9.266914884256760576e-01 9.258530594257129431e-01 9.208708230267246275e-01
+9.317597169368545540e-01 9.309311480359353519e-01 9.259184280111854015e-01
+9.368471637474911073e-01 9.360284027287524289e-01 9.309850925915528208e-01
+9.419539912738585929e-01 9.411449840510025533e-01 9.360709766672253851e-01
+9.470803634098973189e-01 9.462810540135232484e-01 9.411762415948876637e-01
+9.522264455488126389e-01 9.514367761124457035e-01 9.463010502097274346e-01
+9.573924046049070435e-01 9.566123153508007126e-01 9.514455668469502525e-01
+9.625784090357906164e-01 9.618078382604079435e-01 9.566099573635956643e-01
+9.677846288648154216e-01 9.670235129241012695e-01 9.617943891606574036e-01
+9.730112357039150117e-01 9.722595089982409844e-01 9.669990312055217752e-01
+9.782584027767170509e-01 9.775159977355695196e-01 9.722240540547290033e-01
+9.835263049420009951e-01 9.827931520083860173e-01 9.774696298770532144e-01
+9.888151187175039381e-01 9.880911463320615207e-01 9.827359324769276983e-01
+9.941250223040635214e-01 9.934101568888956679e-01 9.880231373182063459e-01
+9.994561956101176703e-01 9.987503615523224410e-01 9.933314215482736964e-01]; 
+
+   case 'oxy' 
+      RGB = [2.503217690585841648e-01 2.046237300762866404e-02 1.966891524096342492e-02
+2.555648459031592545e-01 2.111591456205731687e-02 2.090007960568026485e-02
+2.608015512876060149e-01 2.176436656689777205e-02 2.215967228611414111e-02
+2.660446264484087608e-01 2.238303577293145399e-02 2.344016212259009482e-02
+2.712886712210940687e-01 2.298148595687718801e-02 2.474301784763054818e-02
+2.765326364024714989e-01 2.356133594445880552e-02 2.606762144216200061e-02
+2.817861616671273883e-01 2.410204070052599998e-02 2.740685289115278589e-02
+2.870367982396965223e-01 2.462864448899236905e-02 2.876669328790133415e-02
+2.922964729271802509e-01 2.511521382538545177e-02 3.013810573921637051e-02
+2.975597737008193189e-01 2.557236440082744783e-02 3.152275139605174165e-02
+3.028221259572578816e-01 2.600980779972315513e-02 3.292220687889551439e-02
+3.080989498969098905e-01 2.639179365308667174e-02 3.432344572619091400e-02
+3.133766829953620880e-01 2.674829090811269017e-02 3.573422597599480721e-02
+3.186553157006936643e-01 2.707912721943054463e-02 3.715280555634475207e-02
+3.239494929539773471e-01 2.734824710730623595e-02 3.856493364156053649e-02
+3.292456607259481305e-01 2.758740066123798601e-02 3.997915613902540410e-02
+3.345444278514146941e-01 2.779482795061332528e-02 4.137064065412290187e-02
+3.398547648028715784e-01 2.794706430858015858e-02 4.271748371599067701e-02
+3.451724938219263294e-01 2.805368502448264342e-02 4.402857557145471029e-02
+3.504942702458693216e-01 2.812284384388611183e-02 4.530588662285887219e-02
+3.558206849295221796e-01 2.815263330374409914e-02 4.654771396733792949e-02
+3.611591248942810362e-01 2.812226066677377817e-02 4.774545304821291997e-02
+3.665053860525750440e-01 2.804229091411641200e-02 4.890135088859193929e-02
+3.718571787846235432e-01 2.791864422174392124e-02 5.001583572284549334e-02
+3.772149143594046850e-01 2.774987601297047857e-02 5.108646119902058441e-02
+3.825789453973626464e-01 2.753471831366087474e-02 5.211053476335369278e-02
+3.879495474114582620e-01 2.727215754453635524e-02 5.308509691226611510e-02
+3.933299882018631566e-01 2.695211659028963827e-02 5.400332569218738860e-02
+3.987172740322774689e-01 2.658339014111724477e-02 5.486495007360833037e-02
+4.041100983203390062e-01 2.617015416328878283e-02 5.566751194225177252e-02
+4.095080947848049324e-01 2.571397721177636972e-02 5.640694245975855919e-02
+4.149106638808665037e-01 2.521741655377478589e-02 5.707880838445476140e-02
+4.203169224276966931e-01 2.468426285194311523e-02 5.767829102284769555e-02
+4.257256449760880579e-01 2.411983059354547848e-02 5.820016787208186909e-02
+4.311355423694091527e-01 2.353014014799948567e-02 5.863827924234723404e-02
+4.365491859863961932e-01 2.290868330200904537e-02 5.897909145270988779e-02
+4.419598927187284310e-01 2.228071155950197418e-02 5.922145534252384186e-02
+4.473641324377782280e-01 2.166211126655111924e-02 5.935827807305734533e-02
+4.527575481284770720e-01 2.107281505394200879e-02 5.938213194820316648e-02
+4.581418547792654450e-01 2.051270615727579169e-02 5.927134198778213209e-02
+4.635070947573724509e-01 2.002404746597910568e-02 5.902266227273281901e-02
+4.688449749746688711e-01 1.964556257714445905e-02 5.862776439317262528e-02
+4.741516624279997205e-01 1.940234058919213661e-02 5.806380572763907705e-02
+4.794118268811014549e-01 1.936335100061424216e-02 5.733101890860898414e-02
+4.846131761746131361e-01 1.958983233892800865e-02 5.642063175373675937e-02
+4.897434510076072445e-01 2.014613479230887780e-02 5.532001973850570603e-02
+4.947824246224634126e-01 2.112807697320261829e-02 5.404462487713374702e-02
+4.997137287427875774e-01 2.261949505617124809e-02 5.260678769207213085e-02
+5.045221796142561610e-01 2.470021881498402766e-02 5.103037173727244941e-02
+5.091962933960687554e-01 2.743497840685808764e-02 4.934858848197953146e-02
+5.137301598248652512e-01 3.086487576009750225e-02 4.759930860912273826e-02
+5.181239197849397682e-01 3.500462903556054994e-02 4.582042542223261489e-02
+5.223830134996687580e-01 3.984501254619848137e-02 4.404711326285257883e-02
+5.265167824786487483e-01 4.511655072324017440e-02 4.230178743284147141e-02
+5.305361428192386652e-01 5.056764255442364880e-02 4.059909753035081253e-02
+5.344521625028915146e-01 5.613230116634507910e-02 3.893707769140806324e-02
+5.382767330694612218e-01 6.174820344635036790e-02 3.738224682749225619e-02
+5.420185347623404093e-01 6.738177887118912412e-02 3.591446197845812871e-02
+5.456872157339706098e-01 7.300021292187203192e-02 3.454024418762975668e-02
+5.492896320812740152e-01 7.858770433534650879e-02 3.324672306620826689e-02
+5.528333528391162766e-01 8.412806121949528704e-02 3.203530971705802199e-02
+5.563218795889670609e-01 8.962115486157959388e-02 3.088637914922974861e-02
+5.597632862141976862e-01 9.505189218342754987e-02 2.981373160271517594e-02
+5.631590542003003241e-01 1.004271762153811642e-01 2.879663766133408118e-02
+3.124295956605860902e-01 3.104471192643529220e-01 3.090926227255514358e-01
+3.153354478588585863e-01 3.133524060708574033e-01 3.119821443435121244e-01
+3.182430598922476594e-01 3.162596157133579222e-01 3.148735451052371292e-01
+3.211522197125276645e-01 3.191685075353222212e-01 3.177665914743306730e-01
+3.240629875467020971e-01 3.220791403920337248e-01 3.206613422482794129e-01
+3.269754230998080380e-01 3.249915726322321063e-01 3.235578557174154657e-01
+3.298895855632509311e-01 3.279058621062435619e-01 3.264561896730452384e-01
+3.328058950511413872e-01 3.308224519789740858e-01 3.293567801282767382e-01
+3.357242465615515870e-01 3.337412216005199994e-01 3.322595102624680830e-01
+3.386445426634580036e-01 3.366620612448586458e-01 3.351642734426954484e-01
+3.415668398051758814e-01 3.395850261019035532e-01 3.380711247962143173e-01
+3.444911940093728364e-01 3.425101709489803414e-01 3.409801190370675417e-01
+3.474177171638533901e-01 3.454376095238633759e-01 3.438913688818530656e-01
+3.503469833885533569e-01 3.483679413950338533e-01 3.468054653691610145e-01
+3.532785135690075240e-01 3.513006555881026949e-01 3.497219068304560641e-01
+3.562123614381408343e-01 3.542358046622061107e-01 3.526407457578920046e-01
+3.591485803768168505e-01 3.571734408356729285e-01 3.555620343021813068e-01
+3.620872234195166572e-01 3.601136159915630519e-01 3.584858242781328586e-01
+3.650286939883333193e-01 3.630567477596149395e-01 3.614125280750120628e-01
+3.679730835603966521e-01 3.660029262684281748e-01 3.643422355711175009e-01
+3.709200935456273829e-01 3.689518358458999114e-01 3.672746363207957110e-01
+3.738697751287151094e-01 3.719035265860498596e-01 3.702097803460631664e-01
+3.768221792091647204e-01 3.748580483073254976e-01 3.731477173927215119e-01
+3.797773564061294738e-01 3.778154505573166899e-01 3.760884969350717366e-01
+3.827360799167192629e-01 3.807765314450937688e-01 3.790329075084533650e-01
+3.856977984917309143e-01 3.837407150183698712e-01 3.819803814059496427e-01
+3.886624779865983093e-01 3.867079629882915204e-01 3.849308813833784426e-01
+3.916301675373726754e-01 3.896783234711069799e-01 3.878844554799001365e-01
+3.946009160512599645e-01 3.926518443624523180e-01 3.908411515134125325e-01
+3.975750328941100031e-01 3.956288421370338648e-01 3.938012827103044011e-01
+4.005529526089701697e-01 3.986097611264988183e-01 3.967652888788774646e-01
+4.035341133137877456e-01 4.015940188237794861e-01 3.997325949836182390e-01
+4.065185627017746106e-01 4.045816619557017213e-01 4.027032476697736119e-01
+4.095063482817839495e-01 4.075727370718815190e-01 4.056772934047228052e-01
+4.124975173818349883e-01 4.105672905481647095e-01 4.086547784814160145e-01
+4.154927954346919750e-01 4.135660647292051517e-01 4.116364375734101744e-01
+4.184918779167747238e-01 4.165687434984514104e-01 4.146219586956935155e-01
+4.214945204326190908e-01 4.195750736283389015e-01 4.176110918403175276e-01
+4.245007693662425363e-01 4.225851005893354051e-01 4.206038823909587498e-01
+4.275106709591262044e-01 4.255988697155072553e-01 4.236003755942250870e-01
+4.305243725018209622e-01 4.286165297439478161e-01 4.266007190310782127e-01
+4.335427826643468152e-01 4.316390076472571558e-01 4.296058306451354114e-01
+4.365650183856102373e-01 4.346653972573469860e-01 4.326148141166248351e-01
+4.395911251655309493e-01 4.376957432004656146e-01 4.356277139803868548e-01
+4.426211483952462444e-01 4.407300899994052723e-01 4.386445746671270296e-01
+4.456551333598003373e-01 4.437684820761266802e-01 4.416654405060406741e-01
+4.486936890393982691e-01 4.468115388000440946e-01 4.446909251918003680e-01
+4.517368917688296959e-01 4.498593352768152642e-01 4.477211036271617761e-01
+4.547842258698517881e-01 4.529113434703738172e-01 4.507554532964671012e-01
+4.578357360933586473e-01 4.559676072973268823e-01 4.537940180195341733e-01
+4.608914671138729657e-01 4.590281706024677000e-01 4.568368415436758201e-01
+4.639514635319542113e-01 4.620930771611265198e-01 4.598839675460500431e-01
+4.670168649608225642e-01 4.651634846458155281e-01 4.629365433533288998e-01
+4.700867768827386439e-01 4.682384803878612001e-01 4.659936652121621781e-01
+4.731611215843889440e-01 4.713179837040911146e-01 4.690552534918061012e-01
+4.762399433154002049e-01 4.744020380433919271e-01 4.721213515388643089e-01
+4.793232862779120418e-01 4.774906868110462277e-01 4.751920026556298859e-01
+4.824115798157278534e-01 4.805843644813184157e-01 4.782676377512943278e-01
+4.855054065192261903e-01 4.836836604074202794e-01 4.813488413805353527e-01
+4.886039206405141666e-01 4.867877139846760737e-01 4.844347609063475724e-01
+4.917071661727567822e-01 4.898965684306006430e-01 4.875254394390606261e-01
+4.948151870857158130e-01 4.930102669426385531e-01 4.906209200682110083e-01
+4.979280273277140179e-01 4.961288527000837223e-01 4.937212458644600344e-01
+5.010466910650995809e-01 4.992533419227356273e-01 4.968274246952877893e-01
+5.041707018503041038e-01 5.023832495766817896e-01 4.999389760567756191e-01
+5.072996974715958673e-01 5.055182071194114224e-01 5.030555348110034020e-01
+5.104337218186610903e-01 5.086582576893806662e-01 5.061771439834861219e-01
+5.135728187816994694e-01 5.118034444283539042e-01 5.093038466023047661e-01
+5.167171776492902602e-01 5.149539576128636664e-01 5.124358316223290855e-01
+5.198680090904711504e-01 5.181110205469275920e-01 5.155743126495593298e-01
+5.230240786607408543e-01 5.212733823701987124e-01 5.187180494068470704e-01
+5.261854303107180719e-01 5.244410863000215084e-01 5.218670849934367029e-01
+5.293521080119285571e-01 5.276141755769954145e-01 5.250214625310645200e-01
+5.325241557584816654e-01 5.307926934666159502e-01 5.281812251655980672e-01
+5.357023822572596350e-01 5.339774558564434059e-01 5.313471825523317094e-01
+5.388868512651764364e-01 5.371685253040656693e-01 5.345193971027960567e-01
+5.420768564731617278e-01 5.403651867966881017e-01 5.376971597230371103e-01
+5.452724420645790326e-01 5.435674838014370458e-01 5.408805137559964393e-01
+5.484736522643940404e-01 5.467754598289500390e-01 5.440695025873386603e-01
+5.516805313407564526e-01 5.499891584349245743e-01 5.472641696469991990e-01
+5.548945759211054707e-01 5.532100885206570062e-01 5.504660124980879088e-01
+5.581145670784500856e-01 5.564370183489838473e-01 5.536738091851505228e-01
+5.613403945534086725e-01 5.596698355312789142e-01 5.568874483927889196e-01
+5.645721029241054234e-01 5.629085839430609806e-01 5.601069738660463537e-01
+5.678097368298002934e-01 5.661533075224889355e-01 5.633324294117918463e-01
+5.710538502837967378e-01 5.694045636227955676e-01 5.665643684189753948e-01
+5.743051694640114446e-01 5.726630826009092567e-01 5.698035160864106663e-01
+5.775625831679842559e-01 5.759277431077964859e-01 5.730487596836393305e-01
+5.808261364437535823e-01 5.791985894982362160e-01 5.763001434292895908e-01
+5.840958744176996120e-01 5.824756662065079249e-01 5.795577116206488411e-01
+5.873718422959868235e-01 5.857590177478061433e-01 5.828215086350755358e-01
+5.906553283643478647e-01 5.890499401540877367e-01 5.860928212875072818e-01
+5.939456863496749284e-01 5.923477811162676243e-01 5.893710023062436187e-01
+5.972424456095442036e-01 5.956520656886060694e-01 5.926555803959596691e-01
+6.005456518693509382e-01 5.989628389111977258e-01 5.959466004538667150e-01
+6.038553509508688411e-01 6.022801459213279474e-01 5.992441074734932149e-01
+6.071717820521228548e-01 6.056042263837068118e-01 6.025483395942317077e-01
+6.104964593110322468e-01 6.089366020846007643e-01 6.058608080471198365e-01
+6.138278031916972743e-01 6.122756828005896379e-01 6.091799341380006449e-01
+6.171658601273857236e-01 6.156215142843693977e-01 6.125057634705911580e-01
+6.205106766639508775e-01 6.189741424017308757e-01 6.158383417607966592e-01
+6.238622994612079697e-01 6.223336131329110232e-01 6.191777148380593898e-01
+6.272217495526114517e-01 6.257009516987572795e-01 6.225249009896979269e-01
+6.305890773753839440e-01 6.290762073460191006e-01 6.258799493857725160e-01
+6.339633886626701020e-01 6.324584802535679895e-01 6.292419666367617959e-01
+6.373447307909330117e-01 6.358478171202772700e-01 6.326109992853028441e-01
+6.407331512665517259e-01 6.392442647751326312e-01 6.359870940032011921e-01
+6.441286977271819536e-01 6.426478701785689474e-01 6.393702975927646470e-01
+6.475332468520634821e-01 6.460605168712778568e-01 6.427624810073024886e-01
+6.509452405110124351e-01 6.494806387834576311e-01 6.461620890521664329e-01
+6.543645413031805580e-01 6.529080970404893547e-01 6.495689839578402403e-01
+6.577911976868459076e-01 6.563429394235856806e-01 6.529832133417282636e-01
+6.612252582674151835e-01 6.597852138609858752e-01 6.564048249672772561e-01
+6.646674156910871156e-01 6.632356145596635111e-01 6.598345085785605191e-01
+6.681185471134806209e-01 6.666950204492557708e-01 6.632731374913205524e-01
+6.715772676011302345e-01 6.701620407069336371e-01 6.667193303275074090e-01
+6.750436266693425891e-01 6.736367241694728447e-01 6.701731357532019207e-01
+6.785176739964410286e-01 6.771191198362991326e-01 6.736346025961090778e-01
+6.819994594251277409e-01 6.806092768708275065e-01 6.771037798468937385e-01
+6.854905830673579947e-01 6.841087989309356798e-01 6.805822608627878356e-01
+6.889902152593658791e-01 6.876168527353629933e-01 6.840692180364433828e-01
+6.924977753545575876e-01 6.911328551431065170e-01 6.875640721906080000e-01
+6.960133142099522718e-01 6.946568563288202380e-01 6.910668733210059145e-01
+6.995368828630013081e-01 6.981889066469423311e-01 6.945776716020720665e-01
+7.030687808865530020e-01 7.017293055249038680e-01 6.980967646835468665e-01
+7.066108508007371558e-01 7.052798983395075494e-01 7.016259863087929149e-01
+7.101611448678148975e-01 7.088387320594561336e-01 7.051633961675597417e-01
+7.137197152305658765e-01 7.124058581399919099e-01 7.087090455286524371e-01
+7.172866142285043711e-01 7.159813282321918493e-01 7.122629858555886706e-01
+7.208618943992978201e-01 7.195651941843620447e-01 7.158252688079900228e-01
+7.244468165907456125e-01 7.231587179839266133e-01 7.193971485631489582e-01
+7.280414152493157598e-01 7.267619329076518975e-01 7.229786584068481625e-01
+7.316445953770737143e-01 7.303737413779746168e-01 7.265687078387530473e-01
+7.352564107249326408e-01 7.339941964502680882e-01 7.301673497187975981e-01
+7.388769152586618372e-01 7.376233513935839259e-01 7.337746371194190376e-01
+7.425061631603386836e-01 7.412612596920828967e-01 7.373906233269835742e-01
+7.461464606086873896e-01 7.449102288687008411e-01 7.410176017144567417e-01
+7.497958701755464972e-01 7.485683184324932737e-01 7.446536440345916663e-01
+7.534542299137884092e-01 7.522353655092588465e-01 7.482985885600491605e-01
+7.571215953297079082e-01 7.559114248995535412e-01 7.519524898864893281e-01
+7.607980221631284179e-01 7.595965516360115855e-01 7.556154028404162837e-01
+7.644843645869688897e-01 7.632915995427993483e-01 7.592881761602847668e-01
+7.681816678947460675e-01 7.669976132758333787e-01 7.629718483168250742e-01
+7.718882453269261257e-01 7.707129043795911683e-01 7.666647413348012252e-01
+7.756041540460802963e-01 7.744375293002100369e-01 7.703669114468018053e-01
+7.793294514661021077e-01 7.781715447334471847e-01 7.740784151337410934e-01
+7.830641952537596984e-01 7.819150076262105786e-01 7.777993091263859515e-01
+7.868103454866590685e-01 7.856698771694257122e-01 7.815315409597441976e-01
+7.905668625004234062e-01 7.894351125938581237e-01 7.852740763344663311e-01
+7.943330461869060333e-01 7.932100130488932699e-01 7.890262187563090723e-01
+7.981089557544192026e-01 7.969946370120729595e-01 7.927880264788568221e-01
+8.018946506826831744e-01 8.007890432303661488e-01 7.965595580237599949e-01
+8.056905050124041345e-01 8.045936048548131270e-01 8.003411844486416626e-01
+8.094987355104209525e-01 8.084105365473570615e-01 8.041351074326460457e-01
+8.133169785258600459e-01 8.122374748676888245e-01 8.079389777476483347e-01
+8.171452951864401903e-01 8.160744801984102237e-01 8.117528555427496739e-01
+8.209837469106039398e-01 8.199216132106035282e-01 8.155768012541027012e-01
+8.248323954092128263e-01 8.237789348655052413e-01 8.194108756065791033e-01
+8.286927840915763177e-01 8.276479863786950775e-01 8.232566109078919281e-01
+8.325649270796637857e-01 8.315287807573953360e-01 8.271140202815062681e-01
+8.364475027756378411e-01 8.354199968604651971e-01 8.309817904707684777e-01
+8.403405746677916621e-01 8.393216974124767527e-01 8.348599839552471868e-01
+8.442442065571257315e-01 8.432339454481773133e-01 8.387486635231791166e-01
+8.481584625591254145e-01 8.471568043142441162e-01 8.426478922732166810e-01
+8.520861550384412064e-01 8.510930816852287917e-01 8.465604617719046932e-01
+8.560249024716682920e-01 8.550403982451367790e-01 8.504840066608007065e-01
+8.599745194151316996e-01 8.589985681043337262e-01 8.544183422480284840e-01
+8.639350718981159138e-01 8.629676565074151373e-01 8.583635335210283435e-01
+8.679066262857828562e-01 8.669477290320206642e-01 8.623196457986929131e-01
+8.718902314626645333e-01 8.709398320337272681e-01 8.662877195686166099e-01
+8.758871280259100667e-01 8.749452028944590953e-01 8.702689853121506891e-01
+8.798952803818768098e-01 8.789618087644507360e-01 8.742614219551688715e-01
+8.839147569330807475e-01 8.829897172412359829e-01 8.782650968268708169e-01
+8.879456264404302912e-01 8.870289962776199966e-01 8.822800776100528930e-01
+8.919879580252079165e-01 8.910797141836338531e-01 8.863064323430556168e-01
+8.960441427301344408e-01 8.951442561280015253e-01 8.903465328361804820e-01
+9.001128904953542564e-01 8.992213337528862649e-01 8.943990982004267343e-01
+9.041933650584489390e-01 9.033101118731188262e-01 8.984632980967039995e-01
+9.082856377297909845e-01 9.074106609684426950e-01 9.025392027229122149e-01
+9.123897802040108473e-01 9.115230518994157372e-01 9.066268826559935601e-01
+9.165062601210144377e-01 9.156477504829055869e-01 9.107268012198581619e-01
+9.206377372962850636e-01 9.197874089604549663e-01 9.148415959800745290e-01
+9.247813586963474775e-01 9.239391805138976732e-01 9.189684361991556916e-01
+9.289371983431667923e-01 9.281031383100254439e-01 9.231073947496013510e-01
+9.331053306682361992e-01 9.322793559214043180e-01 9.272585449078167841e-01
+9.372858305148153990e-01 9.364679073285836486e-01 9.314219603563131944e-01
+9.414805849385761150e-01 9.406706735323028257e-01 9.355995118038626934e-01
+9.456895815303881792e-01 9.448876411191396985e-01 9.397911860891489111e-01
+9.499112324285693409e-01 9.491172259914930631e-01 9.439954080097928690e-01
+9.541456149743491322e-01 9.533595046046891008e-01 9.482122537117517735e-01
+9.583928069476742584e-01 9.576145538486544595e-01 9.524417997736036590e-01
+9.626528865695892501e-01 9.618824510502640424e-01 9.566841232088870717e-01
+9.717386353800526733e-01 9.973777600608618732e-01 4.115658643585359822e-01
+9.662006602777347686e-01 9.937266459819259490e-01 4.023251811958163393e-01
+9.607627521945550919e-01 9.900572267174857499e-01 3.929085929665734889e-01
+9.554415272451376451e-01 9.863634202187735456e-01 3.833020851902597670e-01
+9.502559385734440367e-01 9.826387048868144847e-01 3.734797610708937010e-01
+9.452247574758879667e-01 9.788787426033022099e-01 3.633572044040755400e-01
+9.403922547690045652e-01 9.750651532690909340e-01 3.529658674736868007e-01
+9.358012781940933111e-01 9.711846436929117976e-01 3.422125309180296115e-01
+9.315219006576069827e-01 9.672115998149192206e-01 3.310553617148976335e-01
+9.276515136764329483e-01 9.631091768055900504e-01 3.194750358456411865e-01
+9.243262891934023173e-01 9.588257749438183764e-01 3.074483567011621621e-01
+9.217020058646493430e-01 9.542951650631289473e-01 2.951579532336194300e-01
+9.198887370469149838e-01 9.494613758630886524e-01 2.829933059330041467e-01
+9.188014423728452229e-01 9.443342663663614189e-01 2.716012421636955776e-01
+9.181820869339853974e-01 9.389970698605141219e-01 2.614202290916152749e-01
+9.177841550998647735e-01 9.335426933786861170e-01 2.524800001657211412e-01
+9.174401026070885257e-01 9.280407871647589069e-01 2.446155106635521936e-01
+9.170895513231805962e-01 9.225221346800714928e-01 2.375965624445583457e-01
+9.167020828694254497e-01 9.170043397013648567e-01 2.312467382449614473e-01
+9.162674970718558409e-01 9.114958340077099486e-01 2.254318760810480882e-01
+9.157691900066246005e-01 9.060063912564605415e-01 2.200571360818813216e-01
+9.152197058922081352e-01 9.005338027659569589e-01 2.150417998700874245e-01
+9.146241645334555193e-01 8.950779708690549397e-01 2.103289435929298068e-01
+9.139711070576973517e-01 8.896449914470077047e-01 2.058761237663177535e-01
+9.132755157040669536e-01 8.842301350859270714e-01 2.016464740967732761e-01
+9.125407126803214419e-01 8.788330083046588248e-01 1.976125145460150279e-01
+9.117530169460994482e-01 8.734600806229881886e-01 1.937497985711440218e-01
+9.109311963239964394e-01 8.681043338417845368e-01 1.900403276536027364e-01
+9.100752049629435847e-01 8.627663273889324413e-01 1.864683841517677521e-01
+9.091854095601151764e-01 8.574463833033296734e-01 1.830203816986048226e-01
+9.082549005100644113e-01 8.521478984780772592e-01 1.796821188488442467e-01
+9.072929210165844305e-01 8.468673217860986924e-01 1.764454502969030336e-01
+9.063013792870692198e-01 8.416041433916346959e-01 1.733019473598792493e-01
+9.052811273728736952e-01 8.363582655293054779e-01 1.702439219249277103e-01
+9.042330703505969680e-01 8.311295331123278451e-01 1.672645945644082588e-01
+9.031581378443196417e-01 8.259177493137719317e-01 1.643579680291452627e-01
+9.020572628789119696e-01 8.207226877358885231e-01 1.615187200622499042e-01
+9.009313663687085194e-01 8.155441018959304067e-01 1.587421124067343314e-01
+8.997813459322432372e-01 8.103817325993176723e-01 1.560239134014781981e-01
+8.986080680213675009e-01 8.052353136482993667e-01 1.533603319950107013e-01
+8.974123625824063089e-01 8.001045762385368132e-01 1.507479613684808151e-01
+8.961950196441476058e-01 7.949892523212133133e-01 1.481837306596257842e-01
+8.949567873642767513e-01 7.898890771497076857e-01 1.456648635287154658e-01
+8.936983711718720080e-01 7.848037911839249592e-01 1.431888425141153720e-01
+8.924204337256359532e-01 7.797331414892141321e-01 1.407533782964209279e-01
+8.911216151255343387e-01 7.746778361440714855e-01 1.383548030403051743e-01
+8.898020181760183389e-01 7.696378889985142635e-01 1.359906608477614021e-01
+8.884645911096110682e-01 7.646119206511362565e-01 1.336610605915157513e-01
+8.871098774237282658e-01 7.595996914637694886e-01 1.313644302926826601e-01
+8.857383791003278217e-01 7.546009727066200767e-01 1.290993233143932217e-01
+8.843505587935225343e-01 7.496155463925207041e-01 1.268644048815629477e-01
+8.829468419986222782e-01 7.446432050409976799e-01 1.246584402943621550e-01
+8.815249085514379468e-01 7.396851204434677918e-01 1.224776444651401730e-01
+8.800852120157934833e-01 7.347410842227017902e-01 1.203208501022957344e-01
+8.786308879175975806e-01 7.298095076593623665e-01 1.181897480034229675e-01
+8.771622516330287445e-01 7.248902111580254326e-01 1.160834456649006141e-01
+8.756795889485279316e-01 7.199830249122411985e-01 1.140011085329386831e-01
+8.741818688473920185e-01 7.150884618420272343e-01 1.119405415999485953e-01
+8.726664701310860028e-01 7.102078845126149620e-01 1.098977185964423176e-01
+8.711380365425036576e-01 7.053388457490094021e-01 1.078767213026572136e-01
+8.695967618761146767e-01 7.004812035381728919e-01 1.058769266693721234e-01
+8.680428176626151515e-01 6.956348241211850469e-01 1.038977462027144416e-01
+8.664728647912948167e-01 6.908014665312249836e-01 1.019343675562955354e-01
+8.648889520799001307e-01 6.859800077414488495e-01 9.998838514326469085e-02];
+
+   case 'sol' 
+      RGB = [2.014250997833959556e-01 7.730778455372402935e-02 9.342024025258441333e-02
+2.062319592710875060e-01 7.906207768979725548e-02 9.541606071998920413e-02
+2.110428892884436691e-01 8.079536357043612393e-02 9.737846202556904585e-02
+2.158580822956807643e-01 8.250806203226229707e-02 9.930725029816905858e-02
+2.206777103783343352e-01 8.420058748958639261e-02 1.012022063667477878e-01
+2.255019582885565144e-01 8.587332122435217818e-02 1.030630633154644982e-01
+2.303310909623697555e-01 8.752655129320324745e-02 1.048894558390352783e-01
+2.351651244914957362e-01 8.916077192669072393e-02 1.066811567589351084e-01
+2.400041538413338893e-01 9.077639059472936145e-02 1.084378476867565166e-01
+2.448482542469172518e-01 9.237381813988079782e-02 1.101591880324293282e-01
+2.496974811012195872e-01 9.395347052392380438e-02 1.118448155598189275e-01
+2.545518697677066067e-01 9.551577058896976169e-02 1.134943469265998206e-01
+2.594114353201673606e-01 9.706114983944272301e-02 1.151073782157037984e-01
+2.642761722125430146e-01 9.859005025060077476e-02 1.166834854654446307e-01
+2.691460538812255332e-01 1.001029261086328892e-01 1.182222252052740896e-01
+2.740210322821139965e-01 1.016002458867145131e-01 1.197231350040377507e-01
+2.789010373645949281e-01 1.030824941607314804e-01 1.211857340375411263e-01
+2.837859764845531707e-01 1.045501735676682975e-01 1.226095236822268009e-01
+2.886757337585150185e-01 1.060038068088898222e-01 1.239939881417738143e-01
+2.935705596266552364e-01 1.074435592047325860e-01 1.253382180210721730e-01
+2.984708123016127645e-01 1.088694832683588798e-01 1.266411225341654012e-01
+3.033754705455499190e-01 1.102829776040219478e-01 1.279029157767591629e-01
+3.082843160981594277e-01 1.116846670615513903e-01 1.291230138435368602e-01
+3.131971029671865581e-01 1.130752078289798124e-01 1.303008196341493008e-01
+3.181135564546491157e-01 1.144552897453308959e-01 1.314357238709698839e-01
+3.230337594016901570e-01 1.158252511924781902e-01 1.325266762725714476e-01
+3.279584359813157990e-01 1.171847867104950369e-01 1.335718110238658662e-01
+3.328858414856893377e-01 1.185360731157172887e-01 1.345719725768937669e-01
+3.378155708245871303e-01 1.198799635036237599e-01 1.355265097514237183e-01
+3.427471842250678358e-01 1.212173573516503733e-01 1.364347662233350855e-01
+3.476817676568914606e-01 1.225476080130979417e-01 1.372941239039429107e-01
+3.526179187878998866e-01 1.238726093833323050e-01 1.381049156392651633e-01
+3.575544570498519481e-01 1.251940557912539775e-01 1.388672386602565201e-01
+3.624908511464776661e-01 1.265129959708437557e-01 1.395803418854749678e-01
+3.674287950126607916e-01 1.278281902872998865e-01 1.402403192837867185e-01
+3.723652245912653647e-01 1.291433283978542790e-01 1.408496559025098349e-01
+3.772994043575393919e-01 1.304597230378949646e-01 1.414077190879147183e-01
+3.822328244976108125e-01 1.317763828069311027e-01 1.419104659088263887e-01
+3.871627501840784191e-01 1.330967329073056149e-01 1.423599677282273157e-01
+3.920880611619059208e-01 1.344225444091708133e-01 1.427559829693639537e-01
+3.970102845366911826e-01 1.357528321160993978e-01 1.430939047058796265e-01
+4.019257908029647552e-01 1.370920335458912787e-01 1.433773252895977068e-01
+4.068349561616130816e-01 1.384404082220755672e-01 1.436033049025308150e-01
+4.117365731263126216e-01 1.397998954736640875e-01 1.437714012378476514e-01
+4.166285955020519460e-01 1.411733354490503911e-01 1.438826947863026673e-01
+4.215115464927484679e-01 1.425608842716513391e-01 1.439334793454142836e-01
+4.263818625509953053e-01 1.439670074541691269e-01 1.439276912848104217e-01
+4.312408181144407604e-01 1.453911021832318962e-01 1.438598606513883382e-01
+4.360843175580979003e-01 1.468382080621888075e-01 1.437352070106750757e-01
+4.409133399041038626e-01 1.483080544589621963e-01 1.435484892033262738e-01
+4.457240620502335715e-01 1.498053889889406909e-01 1.433047202671754727e-01
+4.505169861034231116e-01 1.513304477119505886e-01 1.429993558897900696e-01
+4.552886678338638471e-01 1.528875528172430887e-01 1.426369447211624508e-01
+4.600387072749128614e-01 1.544778583065680166e-01 1.422148901612839134e-01
+4.647645669051368444e-01 1.561046932382532393e-01 1.417359354431781127e-01
+4.694647696847664142e-01 1.577702615986552870e-01 1.412003046328143552e-01
+4.741377460736882488e-01 1.594768244179092798e-01 1.406085235372486197e-01
+4.787811635810699795e-01 1.612273475797827982e-01 1.399635953741071304e-01
+4.833940392196432456e-01 1.630233960258756498e-01 1.392646788568434324e-01
+4.879740080405346458e-01 1.648678210719416448e-01 1.385155272254653958e-01
+4.925195693223419213e-01 1.667625387560449646e-01 1.377175480485133274e-01
+4.970292850743541213e-01 1.687093212494573113e-01 1.368722045288005285e-01
+5.015013418271374590e-01 1.707101850535491239e-01 1.359828524777431658e-01
+5.059344608615837791e-01 1.727665378729273671e-01 1.350513348829507354e-01
+5.103272555076001638e-01 1.748797680652766917e-01 1.340804814887887886e-01
+5.146784999821305551e-01 1.770509926066398676e-01 1.330731030668735604e-01
+5.189871207659747521e-01 1.792810660321904059e-01 1.320320170625302603e-01
+5.232521628013230286e-01 1.815706081303557207e-01 1.309602397868673829e-01
+5.274729145399480457e-01 1.839199144444812750e-01 1.298602350351042156e-01
+5.316485781433754054e-01 1.863291944433481395e-01 1.287360215107217765e-01
+5.357788119794710813e-01 1.887982003317690283e-01 1.275896151617726404e-01
+5.398632980453529351e-01 1.913265486380361924e-01 1.264236887032485768e-01
+5.439016755531911329e-01 1.939137144580994065e-01 1.252427388260835273e-01
+5.478941342086204314e-01 1.965587857098634594e-01 1.240472431523338970e-01
+5.518406011876045847e-01 1.992608233247842864e-01 1.228416287224595171e-01
+5.557413604777560190e-01 2.020186434106095441e-01 1.216276788300265921e-01
+5.595967825163993270e-01 2.048309740311727856e-01 1.204067641590413351e-01
+5.634071785471536087e-01 2.076963248023981912e-01 1.191839172318373274e-01
+5.671732069794859221e-01 2.106133447776186718e-01 1.179569341314256059e-01
+5.708953502475510033e-01 2.135801749668952421e-01 1.167331750031382620e-01
+5.745743340603017835e-01 2.165955297740416174e-01 1.155086834950974917e-01
+5.782108774062354462e-01 2.196573476346848075e-01 1.142903383669127693e-01
+5.818056681759461446e-01 2.227643917275112795e-01 1.130745297734544186e-01
+5.853596324247829497e-01 2.259144368785390156e-01 1.118679346243981187e-01
+5.888733531729506421e-01 2.291064977832514282e-01 1.106657061174652901e-01
+5.923480147332496060e-01 2.323380142637169188e-01 1.094762267036840098e-01
+5.957840241257977842e-01 2.356083643285451501e-01 1.082930207415330470e-01
+5.991826510896112179e-01 2.389150535758420846e-01 1.071233989765111305e-01
+6.025444033584952397e-01 2.422572079085022478e-01 1.059638000704014038e-01
+6.058701491001592387e-01 2.456332409492081315e-01 1.048158025498839019e-01
+6.091610396494541169e-01 2.490411636600449730e-01 1.036832083023569995e-01
+6.124172967183565408e-01 2.524805655496659695e-01 1.025613962727195683e-01
+6.156402174450263942e-01 2.559493015306805175e-01 1.014554136320146294e-01
+6.188304674185852727e-01 2.594462946423264360e-01 1.003647858381197522e-01
+6.219883549579363624e-01 2.629709881912258296e-01 9.928701461787994842e-02
+6.251150949354874475e-01 2.665215196417168309e-01 9.822607331815666476e-02
+6.282114705640686747e-01 2.700967151118268128e-01 9.718275325572381385e-02
+6.312775931157122988e-01 2.736963322450938207e-01 9.615407260814298751e-02
+6.343140968307461325e-01 2.773194022482146082e-01 9.514062524056160486e-02
+6.373225940474543938e-01 2.809637253536654833e-01 9.414820920814792604e-02
+6.403029049301643960e-01 2.846294803262617856e-01 9.317287627515624671e-02
+6.432554503146770131e-01 2.883160464262430889e-01 9.221435672465166933e-02
+6.461807870545831500e-01 2.920226445998113096e-01 9.127322088316058846e-02
+6.490798649799141007e-01 2.957480457349839220e-01 9.035190862912848009e-02
+6.519534890851086395e-01 2.994912417888541123e-01 8.945207804511770555e-02
+6.548014840508611378e-01 3.032523985397311828e-01 8.857115779395227650e-02
+6.576243271404891289e-01 3.070309030666096284e-01 8.770973119670061324e-02
+6.604224780876138956e-01 3.108261780844247535e-01 8.686839073952234980e-02
+6.631963792788750922e-01 3.146376804982159436e-01 8.604773901491818977e-02
+6.659464950830153995e-01 3.184648571182398524e-01 8.524854019761693436e-02
+6.686740068110078594e-01 3.223063950997894223e-01 8.447431908919650345e-02
+6.713784685540787889e-01 3.261627733896342862e-01 8.372242463404078183e-02
+6.740602498156743616e-01 3.300335755312562847e-01 8.299350184989945367e-02
+6.767197045307955516e-01 3.339184117562906673e-01 8.228820834254704786e-02
+6.793571714405546302e-01 3.378169176731946055e-01 8.160721412236313088e-02
+6.819729744807380145e-01 3.417287529939577184e-01 8.095120122856311329e-02
+6.845674231809769639e-01 3.456536003014257785e-01 8.032086315939043764e-02
+6.871408130714994345e-01 3.495911638591582271e-01 7.971690410726239850e-02
+6.896934260947393813e-01 3.535411684651399988e-01 7.914003799874758105e-02
+6.922255310194272981e-01 3.575033583501715517e-01 7.859098734029026923e-02
+6.947373838550107150e-01 3.614774961213378379e-01 7.807048187183049381e-02
+6.972292282645524697e-01 3.654633617505798626e-01 7.757925703187978916e-02
+6.997012959744630667e-01 3.694607516080961052e-01 7.711805223920600860e-02
+7.021538071796381564e-01 3.734694775400307920e-01 7.668760899803153674e-02
+7.045869709427744487e-01 3.774893659897066711e-01 7.628866883556534306e-02
+7.070009855867870341e-01 3.815202571614760840e-01 7.592197108269088668e-02
+7.093960390794303850e-01 3.855620042261392877e-01 7.558825051079040569e-02
+7.117723094093527658e-01 3.896144725667428643e-01 7.528823483980665032e-02
+7.141299649529336824e-01 3.936775390635336991e-01 7.502264213486334321e-02
+7.164691648313716854e-01 3.977510914167320943e-01 7.479217811087204848e-02
+7.187900592575979797e-01 4.018350275057843701e-01 7.459753336661339995e-02
+7.210927898726463559e-01 4.059292547837213827e-01 7.443938057163165811e-02
+7.233774900712311995e-01 4.100336897052239138e-01 7.431837163097509968e-02
+7.256442853163093121e-01 4.141482571870220286e-01 7.423513485418420377e-02
+7.278932934424962031e-01 4.182728900992377374e-01 7.419027215599127700e-02
+7.301246249482277184e-01 4.224075287863344741e-01 7.418435631686179366e-02
+7.323383832766364732e-01 4.265521206163164214e-01 7.421792833176479864e-02
+7.345353882716817440e-01 4.307060349567022883e-01 7.429319537753659164e-02
+7.367156646423576039e-01 4.348693003618859243e-01 7.441039153688730479e-02
+7.388787494489402752e-01 4.390423308641819844e-01 7.456862859096566321e-02
+7.410247212778052761e-01 4.432250991934941209e-01 7.476828631581519669e-02
+7.431536528151155840e-01 4.474175832571065103e-01 7.500970147240951236e-02
+7.452656110665121236e-01 4.516197658271001170e-01 7.529316628527241151e-02
+7.473606575657232298e-01 4.558316342481479322e-01 7.561892717684162712e-02
+7.494388485722311977e-01 4.600531801646510766e-01 7.598718377039928584e-02
+7.515014494005359813e-01 4.642834853101814319e-01 7.640057068894035019e-02
+7.535482386381918696e-01 4.685227724793568638e-01 7.685851802683341116e-02
+7.555784292647326206e-01 4.727716755322179387e-01 7.735934440269953694e-02
+7.575920584303713623e-01 4.770302023787819645e-01 7.790304647924226056e-02
+7.595891587998102601e-01 4.812983641144596425e-01 7.848957351759905388e-02
+7.615697586917992146e-01 4.855761748409669898e-01 7.911882810663906085e-02
+7.635351559772435293e-01 4.898627402128037933e-01 7.979298836587264687e-02
+7.654855818523200739e-01 4.941579525945941076e-01 8.051210547168902165e-02
+7.674196884953543574e-01 4.984628195279873775e-01 8.127340285315723389e-02
+7.693374880099380642e-01 5.027773670563000508e-01 8.207659805554132215e-02
+7.712389886872909051e-01 5.071016234993879213e-01 8.292136945254757752e-02
+7.731249880551478437e-01 5.114350748098054344e-01 8.380866202872513937e-02
+7.749971634096607387e-01 5.157766247025432627e-01 8.474069791771285387e-02
+7.768531656759695148e-01 5.201279334240793695e-01 8.571310136491594456e-02
+7.786929885023088360e-01 5.244890387928055064e-01 8.672540635712724932e-02
+7.805166220614638828e-01 5.288599804136482341e-01 8.777711918476124864e-02
+7.823261306937436821e-01 5.332394286426104246e-01 8.887078595429290240e-02
+7.841211261331867410e-01 5.376277019226174403e-01 9.000512625428583324e-02
+7.859000063657322066e-01 5.420258982280999893e-01 9.117718483670700369e-02
+7.876627478111991598e-01 5.464340650106903619e-01 9.238637445837943885e-02
+7.894103755328435446e-01 5.508515783238705499e-01 9.363351104642655964e-02
+7.911449489936349666e-01 5.552771776345648558e-01 9.492063714767667859e-02
+7.928634178435132185e-01 5.597128604871853819e-01 9.624295938665472505e-02
+7.945657449982463927e-01 5.641586812836011378e-01 9.759983714409603550e-02
+7.962529317489702718e-01 5.686140495102688375e-01 9.899190462101559174e-02
+7.979274645055595139e-01 5.730774789890704657e-01 1.004214627980108965e-01
+7.995858497679293464e-01 5.775511834408552092e-01 1.018835148330231588e-01
+8.012280368308171141e-01 5.820352236202099849e-01 1.033774013447087969e-01
+8.028560740659145267e-01 5.865283957952628358e-01 1.049048199319871921e-01
+8.044707409966546097e-01 5.910302911313597418e-01 1.064658666440542745e-01
+8.060691629501393063e-01 5.955426815778210869e-01 1.080566579062864629e-01
+8.076512751425731773e-01 6.000656338781130694e-01 1.096765425113208070e-01
+8.092212933019986565e-01 6.045967120149606799e-01 1.113292481825315650e-01
+8.107760556043207556e-01 6.091378327200270837e-01 1.130107512069984665e-01
+8.123144185459451050e-01 6.136896959567099685e-01 1.147193037693588491e-01
+8.138381395305365196e-01 6.182513237945769236e-01 1.164560306092000397e-01
+8.153492559398581863e-01 6.228216087115111543e-01 1.182221687055251269e-01
+8.168438497700267753e-01 6.274028329685673588e-01 1.200133807424188237e-01
+8.183218295752512361e-01 6.319950736315883555e-01 1.218290715633482957e-01
+8.197890431479778472e-01 6.365951069307501653e-01 1.236738150663118929e-01
+8.212397496268510899e-01 6.412061948148843893e-01 1.255419007966243339e-01
+8.226736710596913582e-01 6.458285162251576894e-01 1.274326125224898576e-01
+8.240954168836683857e-01 6.504595882304867738e-01 1.293492244766023536e-01
+8.255020135816337756e-01 6.551010940717902908e-01 1.312886736975442947e-01
+8.268916161790003105e-01 6.597540661653059635e-01 1.332490015865780419e-01
+8.282680782241739204e-01 6.644164751020815718e-01 1.352327076170389830e-01
+8.296302321797530688e-01 6.690890043064162684e-01 1.372383190289331867e-01
+8.309751426979781197e-01 6.737732479628292248e-01 1.392631732853782667e-01
+8.323064093623322446e-01 6.784673500649637257e-01 1.413094448639914957e-01
+8.336236702662669362e-01 6.831715585604193341e-01 1.433763438952303237e-01
+8.349233956754664732e-01 6.878877450853391196e-01 1.454609632889922177e-01
+8.362094522088989734e-01 6.926139541357441143e-01 1.475655370255327115e-01
+8.374812451634525701e-01 6.973505478666088830e-01 1.496891818583828970e-01
+8.387351652304512184e-01 7.020993985062000675e-01 1.518291366884736149e-01
+8.399758860500933233e-01 7.068581852631129481e-01 1.539880238042938276e-01
+8.412015039419409312e-01 7.116279196951651453e-01 1.561642027825314583e-01
+8.424088634362330019e-01 7.164102051502189150e-01 1.583553901645263495e-01
+8.436040043728154636e-01 7.212020966440341185e-01 1.605648786739153067e-01
+8.447825998855326146e-01 7.260057762544317450e-01 1.627897017014220959e-01
+8.459425004297633777e-01 7.308223161702667170e-01 1.650283355910636407e-01
+8.470916909310660659e-01 7.356478948636396842e-01 1.672849872513207936e-01
+8.482222682093125687e-01 7.404863725972353761e-01 1.695548732398838021e-01
+8.493354922705429466e-01 7.453371669715372905e-01 1.718384513727829743e-01
+8.504363950839656239e-01 7.501979378252857655e-01 1.741381147288197651e-01
+8.515178010463546610e-01 7.550721145067320617e-01 1.764497766633903175e-01
+8.525841071331127230e-01 7.599576641399760080e-01 1.787754909642916834e-01
+8.536351063891680635e-01 7.648547324583224727e-01 1.811148665949305070e-01
+8.546660216706046809e-01 7.697655561558608417e-01 1.834652953721074564e-01
+8.556846647048813592e-01 7.746865865799383855e-01 1.858303883039418847e-01
+8.566843283862169978e-01 7.796209322090990046e-01 1.882066457578640828e-01
+8.576654697805085048e-01 7.845684046728831351e-01 1.905941213680029112e-01
+8.586333372669123776e-01 7.895266856020336510e-01 1.929950487363375766e-01
+8.595800514528921799e-01 7.944993343355386539e-01 1.954056082908571246e-01
+8.605118919067250571e-01 7.994835879345245644e-01 1.978284835821235155e-01
+8.614257659190140970e-01 8.044808542070145396e-01 2.002621028413892890e-01
+8.623187318174559968e-01 8.094924397675259398e-01 2.027050514589471275e-01
+8.631990866135879070e-01 8.145147714844941378e-01 2.051607456378260474e-01
+8.640570316077024193e-01 8.195521241156307202e-01 2.076248627732380503e-01
+8.648985892446832136e-01 8.246019286985761809e-01 2.100998205615737802e-01
+8.657217542057287218e-01 8.296650789343075205e-01 2.125846498551076103e-01
+8.665227359996962031e-01 8.347431960854363453e-01 2.150777232526754901e-01
+8.673102956545263309e-01 8.398326248425269647e-01 2.175824369796515168e-01
+8.680739840584389411e-01 8.449377672354075886e-01 2.200945521598048904e-01
+8.688209397597312922e-01 8.500556721057834775e-01 2.226167862486261861e-01
+8.695475257414353454e-01 8.551878730451877297e-01 2.251476450914057237e-01
+8.702518466222823879e-01 8.603351573784762119e-01 2.276863618988967386e-01
+8.709403456886846140e-01 8.654949292658645765e-01 2.302352780671254040e-01
+8.716032871795772463e-01 8.706711460791707324e-01 2.327907403748207260e-01
+8.722504095804027857e-01 8.758599106230183784e-01 2.353562666294088945e-01
+8.728735089177709350e-01 8.810645242778994968e-01 2.379288443348342996e-01
+8.734755480931443161e-01 8.862838169179700909e-01 2.405095194908647427e-01
+8.740576468844427627e-01 8.915173698391286594e-01 2.430986533749082690e-01
+8.746134519571161503e-01 8.967676725126847437e-01 2.456940353088591378e-01
+8.751533192048812637e-01 9.020307187484648548e-01 2.482992135687792645e-01
+8.756648875509137619e-01 9.073112946820588443e-01 2.509099777331614822e-01
+8.761579961220332669e-01 9.126056308170312770e-01 2.535296558873600947e-01
+8.766251762717257590e-01 9.179165870428791507e-01 2.561557673694155324e-01
+8.770689942806796369e-01 9.232431892037369359e-01 2.587891932203917889e-01
+8.774903570045399226e-01 9.285851079338152125e-01 2.614302497362179234e-01
+8.778834706355089779e-01 9.339444999568264905e-01 2.640771174844134261e-01
+8.782575035190057777e-01 9.393179743031147000e-01 2.667327577149610218e-01
+8.785999460636340075e-01 9.447101339348284998e-01 2.693932729818908633e-01
+8.789235199162210854e-01 9.501163253664915986e-01 2.720626987422674059e-01
+8.792160143882136181e-01 9.555409855460589297e-01 2.747373107314689533e-01
+8.794851333774609259e-01 9.609813222108515296e-01 2.774195521504189688e-01
+8.797259382267708094e-01 9.664391027363387066e-01 2.801079938733134767e-01
+8.799388863582034981e-01 9.719141474258771174e-01 2.828028665891310078e-01
+8.801261631980005218e-01 9.774056784469543624e-01 2.855049064351531940e-01
+8.802811281654138176e-01 9.829160047653974219e-01 2.882122575277183407e-01
+8.804129372223431504e-01 9.884419266545670935e-01 2.909276978215925569e-01
+8.805080058500511786e-01 9.939881188401472611e-01 2.936474048368232226e-01]; 
+
+   case 'pha' 
+      RGB = [6.583083928922510708e-01 4.699391690315133929e-01 4.941288203988051381e-02
+6.643374189373471017e-01 4.662019008569991407e-01 5.766473450402211792e-02
+6.702086925052345157e-01 4.624801381219734719e-01 6.534560309537773559e-02
+6.760429905334627287e-01 4.586983759956768103e-01 7.273174322210870790e-02
+6.817522846284524984e-01 4.549140651836585669e-01 7.979261956680192003e-02
+6.874028047282801923e-01 4.510841669914616436e-01 8.667102950867147659e-02
+6.929504980948593129e-01 4.472389296506211198e-01 9.335868960148416273e-02
+6.984261912087648128e-01 4.433576785927097474e-01 9.992839268327721736e-02
+7.038122981036579739e-01 4.394532762349419586e-01 1.063871045640915336e-01
+7.091206923190102041e-01 4.355176525107516405e-01 1.127717449252612913e-01
+7.143452449012380745e-01 4.315557562030358230e-01 1.190934789448820086e-01
+7.194928861674689813e-01 4.275627171694253437e-01 1.253760590955056708e-01
+7.245561927479047259e-01 4.235446971269447580e-01 1.316232516304018385e-01
+7.295489482895208821e-01 4.194909849233816046e-01 1.378630483492892522e-01
+7.344517242247444733e-01 4.154177405103107734e-01 1.440803933719045082e-01
+7.392949550641365608e-01 4.112997327023164562e-01 1.503221736968965161e-01
+7.440383351241327547e-01 4.071715772870146410e-01 1.565433461845777419e-01
+7.487369523694534790e-01 4.029851907815384382e-01 1.628228161295872112e-01
+7.533231937521204236e-01 3.988010690198531272e-01 1.690756638056752914e-01
+7.578808294584169492e-01 3.945424511336589335e-01 1.754217924072464518e-01
+7.623326022156785564e-01 3.902809567197497165e-01 1.817591538530497208e-01
+7.667320478995347521e-01 3.859654943537603744e-01 1.881681875043557384e-01
+7.710524721820763983e-01 3.816214148216601210e-01 1.946153193576832252e-01
+7.752952778457107286e-01 3.772473246523442292e-01 2.011065208945331251e-01
+7.794866593781552000e-01 3.728150850100374614e-01 2.076872953652798559e-01
+7.835853362619955575e-01 3.683677247727679127e-01 2.142973641992331202e-01
+7.876376313731141554e-01 3.638539950288945946e-01 2.210164757476915653e-01
+7.916113385801130109e-01 3.593080404226161040e-01 2.277974012097270795e-01
+7.955060552511121763e-01 3.547298979176854994e-01 2.346435260251332755e-01
+7.993539838133075781e-01 3.500795929482780067e-01 2.416183193481767355e-01
+8.031167084780931331e-01 3.454015163918872089e-01 2.486589162182153978e-01
+8.068103261859892461e-01 3.406745225101673324e-01 2.558007514596662979e-01
+8.104452043001210138e-01 3.358824841311982556e-01 2.630722168071251699e-01
+8.139968010634672790e-01 3.310553831960054150e-01 2.704318260711638389e-01
+8.174768947816700715e-01 3.261752637674419919e-01 2.779109619017897659e-01
+8.208941481936247175e-01 3.212262889577221503e-01 2.855384604486080891e-01
+8.242271261613036692e-01 3.162361985850312696e-01 2.932761677775464482e-01
+8.274766137520660481e-01 3.112015433453460544e-01 3.011338788484150264e-01
+8.306639856730879679e-01 3.060845940504859919e-01 3.091757851828964565e-01
+8.337630658888238733e-01 3.009224359536462057e-01 3.173492086215453090e-01
+8.367728587568070697e-01 2.957134612590129330e-01 3.256619937531243236e-01
+8.396969301670653696e-01 2.904472328682123905e-01 3.341366497709652439e-01
+8.425387334318170662e-01 2.851115076990556330e-01 3.427996193346179443e-01
+8.452829693062083871e-01 2.797291658336165110e-01 3.516207809735176215e-01
+8.479270414576970394e-01 2.743004518168249417e-01 3.606068061808916925e-01
+8.504679257105771661e-01 2.688262350691851821e-01 3.697639476988339724e-01
+8.529105574510703613e-01 2.632885874038991547e-01 3.791311611530527870e-01
+8.552420044048544279e-01 2.577088839643039142e-01 3.886821696092926381e-01
+8.574567263211506640e-01 2.520936658861107627e-01 3.984160108673813205e-01
+8.595502320723124035e-01 2.464473708549377862e-01 4.083362533435646036e-01
+8.615176695665305306e-01 2.407756349505418836e-01 4.184455712413106543e-01
+8.633539245616504987e-01 2.350852138633325872e-01 4.287460573240959860e-01
+8.650568452189218993e-01 2.293728768111193417e-01 4.392600781097817930e-01
+8.666160631462880293e-01 2.236630759123471868e-01 4.499612660389528673e-01
+8.680257787196800079e-01 2.179678524813165597e-01 4.608475800597766070e-01
+8.692800281403405549e-01 2.123013227323138907e-01 4.719155444862356830e-01
+8.703727414475561641e-01 2.066798807505955682e-01 4.831601540690036445e-01
+8.712978068076887572e-01 2.011223984119477337e-01 4.945747939602412324e-01
+8.720491402648608004e-01 1.956504128743852822e-01 5.061511790861612514e-01
+8.726207597696474805e-01 1.902882889012951495e-01 5.178793172539123413e-01
+8.730068619526127893e-01 1.850633392111822872e-01 5.297474998646168887e-01
+8.732018998073337590e-01 1.800058813906028066e-01 5.417423233741458510e-01
+8.732006592202997686e-01 1.751492049740893675e-01 5.538487436526324803e-01
+8.729983321570818910e-01 1.705294177324829519e-01 5.660501641838993070e-01
+8.725905843033689990e-01 1.661851370964102237e-01 5.783285576821829421e-01
+8.719736126526835829e-01 1.621569796196943858e-01 5.906646606873059424e-01
+8.711441430703839028e-01 1.584866680756561452e-01 6.030388085538075371e-01
+8.700996606911847175e-01 1.552168662477456385e-01 6.154284378630663355e-01
+8.688382315166471859e-01 1.523889228568965915e-01 6.278117548576560569e-01
+8.673585803491290491e-01 1.500419870434277214e-01 6.401665059420836856e-01
+8.656600953609360216e-01 1.482114935188816873e-01 6.524702171100530412e-01
+8.637428203708292784e-01 1.469276207331668138e-01 6.647004334019646077e-01
+8.616074355850228406e-01 1.462138565700954185e-01 6.768349518289993316e-01
+8.592552279602999610e-01 1.460858181738819150e-01 6.888520417478360969e-01
+8.566880526588371847e-01 1.465504601378146143e-01 7.007306474947510022e-01
+8.539082940810565070e-01 1.476057634824317899e-01 7.124505416663439172e-01
+8.509188132430276497e-01 1.492409439214724132e-01 7.239924974090546916e-01
+8.477228732160004832e-01 1.514371672020923265e-01 7.353384896921373315e-01
+8.443240935674275471e-01 1.541686506679828816e-01 7.464717393223647690e-01
+8.407263939629991967e-01 1.574040314553000475e-01 7.573767829039294019e-01
+8.369339386719339968e-01 1.611078555520196187e-01 7.680395184197363889e-01
+8.329510832270686782e-01 1.652420527841307607e-01 7.784472273410004695e-01
+8.287823240288615390e-01 1.697672910052525075e-01 7.885885755886976600e-01
+8.244322514509230260e-01 1.746441391323516057e-01 7.984535959358352031e-01
+8.199055067926670493e-01 1.798340046929527702e-01 8.080336545530442116e-01
+8.152067432395495583e-01 1.852998414406232253e-01 8.173214043862717659e-01
+8.103405908369269994e-01 1.910066437572490727e-01 8.263107279415592421e-01
+8.053117579051806141e-01 1.969216010609510237e-01 8.349964504885767358e-01
+8.001246695316600599e-01 2.030146524204510805e-01 8.433748621071933682e-01
+7.947836730093801316e-01 2.092582614636481764e-01 8.514431956464665330e-01
+7.892930180385833161e-01 2.156273737159832282e-01 8.591995655348122485e-01
+7.836568069717744223e-01 2.220993550443281506e-01 8.666429444356050782e-01
+7.778789796122015376e-01 2.286538551089048465e-01 8.737730828797295457e-01
+7.719633002465959848e-01 2.352726496465096795e-01 8.805904299224873721e-01
+7.659133466040326521e-01 2.419394735315277267e-01 8.870960555269299386e-01
+7.597325004651533931e-01 2.486398530394249295e-01 8.932915751926430170e-01
+7.534239396834068181e-01 2.553609429642716422e-01 8.991790771963389384e-01
+7.469906314200031039e-01 2.620913721366889826e-01 9.047610526867282399e-01
+7.404353264352245834e-01 2.688210993418901351e-01 9.100403287788533246e-01
+7.337605543192734503e-01 2.755412805372748908e-01 9.150200047193097763e-01
+7.269686195850667554e-01 2.822441475132592692e-01 9.197033911407090923e-01
+7.200615985827201193e-01 2.889228976436723495e-01 9.240939523881464002e-01
+7.130413372306516617e-01 2.955715940634778272e-01 9.281952518796100504e-01
+7.059094495911268918e-01 3.021850754377659598e-01 9.320109004535763741e-01
+6.986673173487639721e-01 3.087588744057577217e-01 9.355445076582962205e-01
+6.913160902792203633e-01 3.152891437666022756e-01 9.387996359465969887e-01
+6.838566878221142842e-01 3.217725894980000279e-01 9.417797577558794098e-01
+6.762898018976056802e-01 3.282064097483991527e-01 9.444882154741288671e-01
+6.686159011300095711e-01 3.345882390078672719e-01 9.469281843183131597e-01
+6.608352366648267973e-01 3.409160967342457216e-01 9.491026381806494383e-01
+6.529478497874137144e-01 3.471883397852293385e-01 9.510143185305323099e-01
+6.449535815726188392e-01 3.534036180803885596e-01 9.526657064947888776e-01
+6.368520848146350666e-01 3.595608329884161236e-01 9.540589982761437104e-01
+6.286428385050449874e-01 3.656590980031973470e-01 9.551960841088614762e-01
+6.203251651440072623e-01 3.716977013375789007e-01 9.560785309910512231e-01
+6.118982511841425387e-01 3.776760701263490727e-01 9.567075694743777392e-01
+6.033611709179768079e-01 3.835937359904362243e-01 9.570840848332117234e-01
+5.947129141266446206e-01 3.894503017735960748e-01 9.572086129751365968e-01
+5.859524178083830304e-01 3.952454093215529429e-01 9.570813414919564499e-01
+5.770786022984990549e-01 4.009787082326203289e-01 9.567021162826109260e-01
+5.680904120756430364e-01 4.066498255689147689e-01 9.560704542043091392e-01
+5.589868615201727398e-01 4.122583365789312393e-01 9.551855622225308151e-01
+5.497670858464057675e-01 4.178037365457583641e-01 9.540463635305430623e-01
+5.404303973688802110e-01 4.232854139404694238e-01 9.526515310905910860e-01
+5.309763471805271084e-01 4.287026251268353794e-01 9.509995290068892215e-01
+5.214047922154096959e-01 4.340544709302417981e-01 9.490886620701871612e-01
+5.117159675380545947e-01 4.393398754490472347e-01 9.469171337096092822e-01
+5.019105635439048418e-01 4.445575675481795996e-01 9.444831124449268867e-01
+4.919898075708288299e-01 4.497060655293146358e-01 9.417848067474301477e-01
+4.819555492105473404e-01 4.547836655159373520e-01 9.388205479873396042e-01
+4.718103483745911819e-01 4.597884341201938230e-01 9.355888808698555881e-01
+4.615575649166388517e-01 4.647182059669867082e-01 9.320886604427106592e-01
+4.511980082251949020e-01 4.695721776839077433e-01 9.283178636903177683e-01
+4.407385246316099514e-01 4.743468819302843476e-01 9.242766906682317041e-01
+4.301872191964954406e-01 4.790386406828319177e-01 9.199661970019400448e-01
+4.195516590423077341e-01 4.836443962749994996e-01 9.153875906397229700e-01
+4.088406331006777528e-01 4.881609386110861704e-01 9.105429315654867128e-01
+3.980642083018061106e-01 4.925849423947825101e-01 9.054352272162426996e-01
+3.872337717548847147e-01 4.969130108713233906e-01 9.000685170373873278e-01
+3.763620564988861550e-01 5.011417254753421924e-01 8.944479427537497251e-01
+3.654612663762428770e-01 5.052684034325813922e-01 8.885787674719856089e-01
+3.545465439790672080e-01 5.092897968880314430e-01 8.824681923036010733e-01
+3.436377931849474154e-01 5.132015795889635079e-01 8.761266360928694485e-01
+3.327530939137686161e-01 5.170008198204416594e-01 8.695640864822369309e-01
+3.219116583925260011e-01 5.206848733578030020e-01 8.627916585616799416e-01
+3.111337198622898259e-01 5.242514414427805747e-01 8.558215206665023000e-01
+3.004403986093719392e-01 5.276986238157412856e-01 8.486667948769511804e-01
+2.898532566310526581e-01 5.310250549915590534e-01 8.413412305522999235e-01
+2.793961594244663282e-01 5.342293148180886631e-01 8.338605094653681604e-01
+2.690918119759744820e-01 5.373109871573702456e-01 8.262398418700288572e-01
+2.589630009926549015e-01 5.402702010433201307e-01 8.184947475296583397e-01
+2.490323931623479869e-01 5.431076290262466522e-01 8.106408952154365855e-01
+2.393222899575573326e-01 5.458244839403564308e-01 8.026939223701164972e-01
+2.298566351816503373e-01 5.484218890000336355e-01 7.946712158983202379e-01
+2.206551002944838191e-01 5.509024141956824216e-01 7.865870626923798792e-01
+2.117364094415158937e-01 5.532690129113547739e-01 7.784553296976853831e-01
+2.031184306485467883e-01 5.555248911915373622e-01 7.702897347110843063e-01
+1.948172015035146420e-01 5.576736467032974431e-01 7.621031776295352778e-01
+1.868465966290397962e-01 5.597192229650957973e-01 7.539076339343501187e-01
+1.792179884783634825e-01 5.616658613090964591e-01 7.457140662049784874e-01
+1.719421959020442647e-01 5.635174702399022850e-01 7.375349843171632447e-01
+1.650229512673002386e-01 5.652791533635259658e-01 7.293775439873284583e-01
+1.584611602813638387e-01 5.669560017699032395e-01 7.212481886261494779e-01
+1.522549918213680353e-01 5.685529672520610589e-01 7.131532051881548373e-01
+1.463987618681510117e-01 5.700750569206646245e-01 7.050976866560473288e-01
+1.408828405908224835e-01 5.715272914520931336e-01 6.970855353349069139e-01
+1.356936625367466953e-01 5.729146658465781305e-01 6.891194758268863740e-01
+1.308138525417579801e-01 5.742421127377883572e-01 6.812010763134157543e-01
+1.262224734293325157e-01 5.755144682058210837e-01 6.733307769330967307e-01
+1.218953938035638729e-01 5.767364399826563348e-01 6.655079242329828837e-01
+1.178065439715534068e-01 5.779123523036159282e-01 6.577323260140637284e-01
+1.139261298009009160e-01 5.790467957802227783e-01 6.499998366451625875e-01
+1.102234782385779766e-01 5.801439808367224726e-01 6.423063681141680803e-01
+1.066673235183970281e-01 5.812078215483343913e-01 6.346473314887408623e-01
+1.032263067644274834e-01 5.822419757773840132e-01 6.270172879951815270e-01
+9.986970116659238395e-02 5.832498248631478033e-01 6.194100074982554771e-01
+9.656813269866712512e-02 5.842344549012296051e-01 6.118185305845139643e-01
+9.329429206118067253e-02 5.851986396650793454e-01 6.042352341768219004e-01
+9.002364276931534848e-02 5.861448252640329981e-01 5.966519005456781821e-01
+8.673514013646366205e-02 5.870751166646858143e-01 5.890597894857422245e-01
+8.341198598223345528e-02 5.879912662222103181e-01 5.814497133016774955e-01
+8.004245400348602990e-02 5.888946643728962815e-01 5.738121141059205899e-01
+7.662083060590932360e-02 5.897863326271246542e-01 5.661371427838456372e-01
+7.314852485397654869e-02 5.906669189727291602e-01 5.584147388414824054e-01
+6.963540714651897390e-02 5.915366957529474279e-01 5.506347102299997687e-01
+6.610143501147561218e-02 5.923955600227664986e-01 5.427868121514007882e-01
+6.257860760091599195e-02 5.932430363153763375e-01 5.348608238014407323e-01
+5.911303759975024968e-02 5.940783314685343930e-01 5.268461376019544229e-01
+5.576765010285392871e-02 5.949002975004614724e-01 5.187321979872163702e-01
+5.262510565424809855e-02 5.957073200832398996e-01 5.105097808257538228e-01
+4.978880680939656161e-02 5.964975038111670624e-01 5.021693595319391967e-01
+4.738319269394732774e-02 5.972686215557058143e-01 4.937017361708459506e-01
+4.555066847662456869e-02 5.980181252952141424e-01 4.850980867717663014e-01
+4.444396189302631667e-02 5.987431566697054564e-01 4.763500004038906943e-01
+4.421322948900235222e-02 5.994405566877633040e-01 4.674495124401222834e-01
+4.498917867710291313e-02 6.001068740129568146e-01 4.583891327826852824e-01
+4.686604485069371245e-02 6.007383712762072170e-01 4.491618701849053319e-01
+4.988979024235475762e-02 6.013310288983726437e-01 4.397612541729841729e-01
+5.405573006313083712e-02 6.018805543938667846e-01 4.301812015738862294e-01
+5.932208540209162745e-02 6.023828876312081748e-01 4.204054325617814780e-01
+6.560773880422715587e-02 6.028325831369402144e-01 4.104377156032376628e-01
+7.281962363892094392e-02 6.032244155970721833e-01 4.002736262351211383e-01
+8.086176781346332554e-02 6.035528335053932381e-01 3.899094149354802585e-01
+8.964365767756551917e-02 6.038119404209635332e-01 3.793420777858104165e-01
+9.908952486975769469e-02 6.039955435016706176e-01 3.685641184021282157e-01
+1.091461686387718844e-01 6.040969460876761676e-01 3.575579876882719055e-01
+1.197411868235576382e-01 6.041085844094219448e-01 3.463409605502589250e-01
+1.308274635712054768e-01 6.040228036354146068e-01 3.349141605174003056e-01
+1.423800347596975990e-01 6.038311914501962585e-01 3.232669997463486489e-01
+1.543847008629261053e-01 6.035242532835117801e-01 3.113882295486853913e-01
+1.667909278439370091e-01 6.030930063069259717e-01 2.993102878563658198e-01
+1.795975741928860503e-01 6.025266800569213377e-01 2.870237044475537069e-01
+1.927996570161342460e-01 6.018136381688595771e-01 2.745296424849442141e-01
+2.063446461864067438e-01 6.009446614046377588e-01 2.618794002040416569e-01
+2.202728729725795254e-01 5.999042993738278318e-01 2.490425136645111337e-01
+2.344983329249494819e-01 5.986859114745567423e-01 2.361102156981361166e-01
+2.490441577314199684e-01 5.972745984023483112e-01 2.230778046167814499e-01
+2.638200588853058526e-01 5.956665601719514092e-01 2.100467332369221340e-01
+2.788103972435367339e-01 5.938520960352462463e-01 1.970548426870546432e-01
+2.939149436021079032e-01 5.918334783865150106e-01 1.842162055743405413e-01
+3.090633958032663053e-01 5.896130197890373514e-01 1.716194213262129398e-01
+3.241557701146778325e-01 5.872013194176191053e-01 1.593775348465770181e-01
+3.391058987925449908e-01 5.846116417760637285e-01 1.475901239657965436e-01
+3.537962403050050608e-01 5.818679304916246631e-01 1.363773405186440579e-01
+3.681790539934771678e-01 5.789861015095073560e-01 1.258005415905540103e-01
+3.821596573789931561e-01 5.759951191731197406e-01 1.159503977992311363e-01
+3.957282445230750900e-01 5.729092809436007183e-01 1.068503820674790161e-01
+4.088192648913888116e-01 5.697572697905517458e-01 9.855521202608327758e-02
+4.214810649035653500e-01 5.665415862717396722e-01 9.104002246571415990e-02
+4.336495334558000403e-01 5.632929561600926727e-01 8.434116239111955071e-02
+4.453890783516751273e-01 5.600085906382493706e-01 7.841305443909030171e-02
+4.567242130853677584e-01 5.566942951475172263e-01 7.322913012508130981e-02
+4.676501707681009479e-01 5.533637269053324204e-01 6.876762134759795142e-02
+4.781913781821610088e-01 5.500213008191600084e-01 6.498435721988443659e-02
+4.883968612384750885e-01 5.466619506976900800e-01 6.182162837413415074e-02
+4.982892398787829857e-01 5.432873953595327432e-01 5.922725775013665955e-02
+5.078911374422868663e-01 5.398982668933685058e-01 5.714465998451528223e-02
+5.172247456455653092e-01 5.364942872197172585e-01 5.551476288204022086e-02
+5.263115025893324583e-01 5.330744300746458331e-01 5.427792556635833293e-02
+5.351718645250624906e-01 5.296370658817842747e-01 5.337566853443905662e-02
+5.438251536372012973e-01 5.261800887043684982e-01 5.275207547378853862e-02
+5.522894663786476199e-01 5.227010255649303661e-01 5.235479075452074277e-02
+5.605816294780567866e-01 5.191971290183284848e-01 5.213559944466891055e-02
+5.687171933168381210e-01 5.156654540879882509e-01 5.205062439450063722e-02
+5.767104547724090091e-01 5.121029206313181259e-01 5.206020204364426168e-02
+5.845745037500035268e-01 5.085063619725217476e-01 5.212850674796504907e-02
+5.923212894447653643e-01 5.048725602928031408e-01 5.222298774900729218e-02
+5.999617038945115333e-01 5.011982688438658684e-01 5.231366903560310394e-02
+6.075056816322426112e-01 4.974802205790658793e-01 5.237234455720112675e-02
+6.149623152735116394e-01 4.937151222923196747e-01 5.237168182411356537e-02
+6.223399877334323538e-01 4.898996328220020513e-01 5.228422613133864444e-02
+6.296465225194588511e-01 4.860303233135512824e-01 5.208127381405584094e-02
+6.368893542334475022e-01 4.821036169426133333e-01 5.173155232549151578e-02
+6.440757220432393737e-01 4.781157049081125598e-01 5.119960076823739520e-02
+6.512128893528150719e-01 4.740624350126631525e-01 5.044367478760234530e-02
+6.583083928921535932e-01 4.699391690315524728e-01 4.941288204103298082e-02];
+
+   case 'hal' 
+      RGB = [1.629529545569048110e-01 9.521591660747855124e-02 4.225729247643043585e-01
+1.648101130638113809e-01 9.635115909727909322e-02 4.318459659833655540e-01
+1.666161667445505146e-01 9.744967053737302320e-02 4.412064832719169161e-01
+1.683662394047173716e-01 9.851521320092249123e-02 4.506510991070378780e-01
+1.700547063176806595e-01 9.955275459284393391e-02 4.601751103492678907e-01
+1.716750780810941956e-01 1.005687314559364776e-01 4.697722208210775574e-01
+1.732198670017069397e-01 1.015713570251385311e-01 4.794342308257477092e-01
+1.746804342417165035e-01 1.025709733421875103e-01 4.891506793097686878e-01
+1.760433654254164593e-01 1.035658402770499587e-01 4.989416012077843576e-01
+1.772982333235153807e-01 1.045802467658180357e-01 5.087715885336102639e-01
+1.784322966250933284e-01 1.056380265564063059e-01 5.186108302832771466e-01
+1.794226692010022772e-01 1.067416562108134404e-01 5.284836071020164727e-01
+1.802542327126359922e-01 1.079356346679062328e-01 5.383245681077661882e-01
+1.808975365813079994e-01 1.092386640641496154e-01 5.481352134375515606e-01
+1.813298273265454008e-01 1.107042924622455293e-01 5.578435355461390799e-01
+1.815069308605478937e-01 1.123613365530294061e-01 5.674471854200233700e-01
+1.813959559086370799e-01 1.142804413027345978e-01 5.768505865319291104e-01
+1.809499433760710929e-01 1.165251530113385336e-01 5.859821014031293407e-01
+1.801166524094891808e-01 1.191682999758127970e-01 5.947494236872948870e-01
+1.788419557731087683e-01 1.222886104999623413e-01 6.030366129604394221e-01
+1.770751344832933727e-01 1.259620672997293078e-01 6.107077426144936760e-01
+1.747764954226868062e-01 1.302486445940692350e-01 6.176174300439590814e-01
+1.719255883800615836e-01 1.351768519397535118e-01 6.236290832033221099e-01
+1.685302279919113078e-01 1.407308818346016399e-01 6.286357211183263294e-01
+1.646373543798159977e-01 1.468433194330099889e-01 6.325796572366660930e-01
+1.603141656593721487e-01 1.534074847391770635e-01 6.354701889106297852e-01
+1.556539455727427579e-01 1.602911795924207572e-01 6.373742153046678682e-01
+1.507373567977903506e-01 1.673688895313445446e-01 6.383989700654711941e-01
+1.456427577979826360e-01 1.745293312408868480e-01 6.386687569056349600e-01
+1.404368075255880977e-01 1.816841459042554952e-01 6.383089542091028301e-01
+1.351726504089350855e-01 1.887688275072176014e-01 6.374350053971095109e-01
+1.298906561807787186e-01 1.957398580438490798e-01 6.361469852044080442e-01
+1.246205125693149729e-01 2.025703385486158914e-01 6.345282558695404251e-01
+1.193859004780570554e-01 2.092446623034395214e-01 6.326478270215730726e-01
+1.142294912197052703e-01 2.157456284251405010e-01 6.305768690676523125e-01
+1.091404911375367659e-01 2.220831206181900774e-01 6.283455167242665285e-01
+1.041438584244326337e-01 2.282546518282705383e-01 6.259979600528258192e-01
+9.926304855671816418e-02 2.342609767388125763e-01 6.235717761795677161e-01
+9.449512580805050077e-02 2.401139958170242505e-01 6.210816676451920149e-01
+8.986951574154733446e-02 2.458147193889331228e-01 6.185591936304666305e-01
+8.539285840535987271e-02 2.513729453557033144e-01 6.160166295227810229e-01
+8.106756674391193962e-02 2.567997050291829786e-01 6.134596708213713168e-01
+7.694418932732069449e-02 2.620915612909199277e-01 6.109238301118911085e-01
+7.300703739422578775e-02 2.672655035330154250e-01 6.083965011432549419e-01
+6.927650669442811382e-02 2.723273008096985248e-01 6.058873223830183452e-01
+6.578801445169751849e-02 2.772789491245566951e-01 6.034141752438300088e-01
+6.255595479554787453e-02 2.821282390686886132e-01 6.009787922718963227e-01
+5.959205181913470456e-02 2.868831717247524726e-01 5.985797542127682114e-01
+5.691772151374491912e-02 2.915488716281217640e-01 5.962214962176209943e-01
+5.455347307306369214e-02 2.961302536799313989e-01 5.939076044300871660e-01
+5.251889627870443694e-02 3.006318409387543356e-01 5.916414807294642086e-01
+5.083877347247430650e-02 3.050562292020492783e-01 5.894315315373579445e-01
+4.951454037014189208e-02 3.094102218220906031e-01 5.872714908845412252e-01
+4.855490408104565919e-02 3.136977658751046727e-01 5.851627302038014955e-01
+4.796369156225028380e-02 3.179225992994973993e-01 5.831062484926557987e-01
+4.773946305380068894e-02 3.220882581897950847e-01 5.811027291021745311e-01
+4.787545181415154422e-02 3.261980852298422273e-01 5.791525884087008746e-01
+4.835984720504159923e-02 3.302552388254387794e-01 5.772560174768572860e-01
+4.917638757411300215e-02 3.342627026038174076e-01 5.754130176762238813e-01
+5.030518671680884318e-02 3.382232950310170572e-01 5.736234310853615126e-01
+5.172369283691292258e-02 3.421396789632700219e-01 5.718869664041401624e-01
+5.340767549062541003e-02 3.460143709989857430e-01 5.702032209969470911e-01
+5.533215100674954839e-02 3.498497505368459159e-01 5.685716996038682192e-01
+5.747218306369886870e-02 3.536480684754851334e-01 5.669918301827847618e-01
+5.980352430527090951e-02 3.574114555130643578e-01 5.654629772812437283e-01
+6.230309069250609261e-02 3.611419300223894235e-01 5.639844532816007394e-01
+6.494927925026378057e-02 3.648414054902228698e-01 5.625555278152573058e-01
+6.772215122553368327e-02 3.685116975190721456e-01 5.611754356007422340e-01
+7.060350747784929770e-02 3.721545303967777607e-01 5.598433829250933913e-01
+7.357840396611611822e-02 3.757710087912914942e-01 5.585612898846836760e-01
+7.663101364217325684e-02 3.793629991309988569e-01 5.573268773673928367e-01
+7.974739830752586300e-02 3.829322364932883360e-01 5.561380319387883020e-01
+8.291580548873803136e-02 3.864801413799028307e-01 5.549938581786431069e-01
+8.612580955679122185e-02 3.900080689665953448e-01 5.538934528024703763e-01
+8.936817980172057085e-02 3.935173134989205512e-01 5.528359060062189023e-01
+9.263475301781654014e-02 3.970091123550867351e-01 5.518203023495191761e-01
+9.591831391237073956e-02 4.004846497947374129e-01 5.508457212473490960e-01
+9.921323508992196949e-02 4.039446967979293257e-01 5.499133654313189679e-01
+1.025139614653171327e-01 4.073902646845309894e-01 5.490228475752887416e-01
+1.058144853522852702e-01 4.108228877965505177e-01 5.481703859285301794e-01
+1.091104131658914012e-01 4.142435690118807523e-01 5.473550236322454188e-01
+1.123978495089298091e-01 4.176532725696484594e-01 5.465757987301745890e-01
+1.156733362160069500e-01 4.210529263321469151e-01 5.458317432175192607e-01
+1.189341701380315364e-01 4.244432161011251203e-01 5.451231873866256850e-01
+1.221781892974011241e-01 4.278246691926565481e-01 5.444513010684173260e-01
+1.254018943745988379e-01 4.311987106338182607e-01 5.438113725374379426e-01
+1.286031296249826039e-01 4.345661396549306832e-01 5.432023919026625070e-01
+1.317799711665625373e-01 4.379277275711909168e-01 5.426233385794481112e-01
+1.349307019221451520e-01 4.412842189714309415e-01 5.420731800699918335e-01
+1.380549051543558114e-01 4.446356900078314855e-01 5.415550926551251365e-01
+1.411501069188544899e-01 4.479834819017672332e-01 5.410638066180113448e-01
+1.442150210041465985e-01 4.513283116704150388e-01 5.405979268760919831e-01
+1.472485820103837661e-01 4.546708245755168298e-01 5.401563599016087069e-01
+1.502499341655997578e-01 4.580115969309521140e-01 5.397383042732707414e-01
+1.532192022679761678e-01 4.613507130792227628e-01 5.393460827274304537e-01
+1.561545863558880531e-01 4.646893652629560667e-01 5.389744586257710912e-01
+1.590554825896313418e-01 4.680281092699005163e-01 5.386222668134232894e-01
+1.619213854747377779e-01 4.713674796485894380e-01 5.382883230992108192e-01
+1.647524478987731911e-01 4.747077026242289555e-01 5.379733478625169374e-01
+1.675482630437002962e-01 4.780493319379570116e-01 5.376757027790604049e-01
+1.703080688452488778e-01 4.813931150452205876e-01 5.373922894579649112e-01
+1.730317245949949956e-01 4.847395013664480001e-01 5.371218460871988176e-01
+1.757193664968157432e-01 4.880888303994977417e-01 5.368636833242294015e-01
+1.783716503259393793e-01 4.914412289641479359e-01 5.366183612997760255e-01
+1.809878167761821144e-01 4.947975030047193079e-01 5.363817525707026412e-01
+1.835680719416625251e-01 4.981580161432020426e-01 5.361525222751042374e-01
+1.861127112291278973e-01 5.015231101060642072e-01 5.359293193132266264e-01
+1.886230405888700001e-01 5.048927132825591357e-01 5.357133548543864254e-01
+1.910985251486422565e-01 5.082675669534003626e-01 5.355003101591436776e-01
+1.935397227717326196e-01 5.116479477164066481e-01 5.352887824024628038e-01
+1.959472883340568350e-01 5.150341080561433582e-01 5.350773667248226451e-01
+1.983227076664061950e-01 5.184259856373716335e-01 5.348665525352744865e-01
+2.006660342507454731e-01 5.218241099237964642e-01 5.346528031121534630e-01
+2.029781360478647434e-01 5.252286912572143862e-01 5.344345169358406533e-01
+2.052600444742044838e-01 5.286398903414566419e-01 5.342102605335536936e-01
+2.075134652380221101e-01 5.320576287402744020e-01 5.339799959048032729e-01
+2.097389494614402272e-01 5.354822793223580346e-01 5.337406085215398166e-01
+2.119377691272176234e-01 5.389139515314046447e-01 5.334905459074957834e-01
+2.141113437844118228e-01 5.423527133674995726e-01 5.332283775266504211e-01
+2.162615771757636085e-01 5.457984712571943842e-01 5.329535750363618707e-01
+2.183895286205785324e-01 5.492514494924778390e-01 5.326634150194080597e-01
+2.204969036245257863e-01 5.527116487772890663e-01 5.323564832742772035e-01
+2.225855272635121618e-01 5.561790393438251767e-01 5.320314302436226495e-01
+2.246573660062902156e-01 5.596535532346759156e-01 5.316870266023980829e-01
+2.267141352300188206e-01 5.631352211554988552e-01 5.313212748929951879e-01
+2.287579175696445311e-01 5.666239548700177098e-01 5.309328290550865415e-01
+2.307908679682200148e-01 5.701196510565367248e-01 5.305203252817071169e-01
+2.328150701112509102e-01 5.736222405040750649e-01 5.300820599240353426e-01
+2.348328561421904603e-01 5.771315766359990107e-01 5.296167282704775658e-01
+2.368466495707550745e-01 5.806474896434283828e-01 5.291230766564496424e-01
+2.388588283644081933e-01 5.841698333340915594e-01 5.285995915811123602e-01
+2.408716822240541400e-01 5.876984999166237067e-01 5.280443921862176815e-01
+2.428880608722543410e-01 5.912331932277818947e-01 5.274567814051942527e-01
+2.449106759672304290e-01 5.947736703172152861e-01 5.268356212312692577e-01
+2.469420290965465559e-01 5.983197676291379663e-01 5.261791312000029253e-01
+2.489846702882144713e-01 6.018713111492172141e-01 5.254854952988164962e-01
+2.510418446331669773e-01 6.054278820406324702e-01 5.247545535679302153e-01
+2.531164830585315162e-01 6.089891735215487989e-01 5.239852980594518206e-01
+2.552111567013787274e-01 6.125550130731924892e-01 5.231756545447472373e-01
+2.573286340449815746e-01 6.161251617120727664e-01 5.223239185167128928e-01
+2.594724447386158594e-01 6.196990932330638246e-01 5.214304767886038805e-01
+2.616456589963800927e-01 6.232764459181282524e-01 5.204944566826074093e-01
+2.638509342960791981e-01 6.268570181766053295e-01 5.195136536074571598e-01
+2.660910828965943331e-01 6.304405546707460006e-01 5.184861377534477622e-01
+2.683698467163787016e-01 6.340264147511259774e-01 5.174130230514244477e-01
+2.706903509949471487e-01 6.376141889650659422e-01 5.162935692788781505e-01
+2.730554221838172868e-01 6.412035896296301996e-01 5.151259285643695618e-01
+2.754676310512871873e-01 6.447944545228798674e-01 5.139069764892589820e-01
+2.779309010023177096e-01 6.483859905965968506e-01 5.126390269795514376e-01
+2.804483318408275694e-01 6.519777450281342146e-01 5.113214639163841113e-01
+2.830229969716622218e-01 6.555692556652558123e-01 5.099537040511894492e-01
+2.856569925022096612e-01 6.591606030439277619e-01 5.085297306531970651e-01
+2.883543502639873135e-01 6.627507929293073863e-01 5.070537569679475220e-01
+2.911180907975667309e-01 6.663393219020087299e-01 5.055253556302098383e-01
+2.939511790083492726e-01 6.699256847308838747e-01 5.039440536705714901e-01
+2.968562131418951422e-01 6.735096490751359966e-01 5.023062065413991251e-01
+2.998362114418811064e-01 6.770906951012128916e-01 5.006109626120457401e-01
+3.028943961763405635e-01 6.806680059292820051e-01 4.988609220555944579e-01
+3.060335830069556007e-01 6.842410278074210206e-01 4.970557164988521071e-01
+3.092565373453909361e-01 6.878091952372648032e-01 4.951950035800954386e-01
+3.125659486948474952e-01 6.913723055472413836e-01 4.932732004330610542e-01
+3.159647522698377231e-01 6.949295261702347348e-01 4.912927476409480465e-01
+3.194556489243873809e-01 6.984800979280558764e-01 4.892553378582480961e-01
+3.230412442793148542e-01 7.020233920397538352e-01 4.871607422199746851e-01
+3.267240985578743762e-01 7.055587631720373620e-01 4.850087606010107799e-01
+3.305070751488592418e-01 7.090857414439620809e-01 4.827955626459811689e-01
+3.343929739199408280e-01 7.126036449951604901e-01 4.805201317683439055e-01
+3.383839618515475101e-01 7.161115318028217214e-01 4.781864627637871235e-01
+3.424824761777380822e-01 7.196086676710338192e-01 4.757945201032026117e-01
+3.466909265050957534e-01 7.230942938245445983e-01 4.733443136156250675e-01
+3.510117003671430203e-01 7.265676248366644829e-01 4.708359034900377327e-01
+3.554477481971078934e-01 7.300279237012574640e-01 4.682667163182038794e-01
+3.600022066505755847e-01 7.334743741555846963e-01 4.656343331651458528e-01
+3.646764457841936702e-01 7.369059239634064840e-01 4.629441295765394648e-01
+3.694728210602395979e-01 7.403216514270205550e-01 4.601965063235068931e-01
+3.743936915522128039e-01 7.437205957454258165e-01 4.573919681273960758e-01
+3.794414259131371203e-01 7.471017539541063845e-01 4.545311394783269621e-01
+3.846184079557829483e-01 7.504640777072076885e-01 4.516147832933739559e-01
+3.899270416022538321e-01 7.538064699246833644e-01 4.486438228496626990e-01
+3.953697549145612777e-01 7.571277813375660859e-01 4.456193674826627871e-01
+4.009508646485598904e-01 7.604267477869489644e-01 4.425380639654961090e-01
+4.066714019599443342e-01 7.637021069222051928e-01 4.394056497009877216e-01
+4.125334807152798988e-01 7.669525443587899005e-01 4.362249727525224774e-01
+4.185395667527040398e-01 7.701766751192415938e-01 4.329983295596441795e-01
+4.246921350385852723e-01 7.733730477083216037e-01 4.297284080553480656e-01
+4.309936593663836191e-01 7.765401418648604226e-01 4.264183470604332449e-01
+4.374465975304094312e-01 7.796763669997491819e-01 4.230718037095967943e-01
+4.440533711015541840e-01 7.827800615723168320e-01 4.196930295353452078e-01
+4.508163388346139722e-01 7.858494937119429036e-01 4.162869557148224930e-01
+4.577377626480225170e-01 7.888828634531382944e-01 4.128592877810690620e-01
+4.648197650471433406e-01 7.918783070193569085e-01 4.094166097874233912e-01
+4.720642768256655963e-01 7.948339036614172626e-01 4.059664974607166132e-01
+4.794729738954752185e-01 7.977476856267914362e-01 4.025176392507668344e-01
+4.870472021865835388e-01 8.006176519006481529e-01 3.990799633442549399e-01
+4.947878897554374711e-01 8.034417864099652196e-01 3.956647676266520364e-01
+5.026954455748450235e-01 8.062180814071850943e-01 3.922848482216537147e-01
+5.107722312752203120e-01 8.089441566688712060e-01 3.889513459863399025e-01
+5.190175807229889804e-01 8.116180108735555621e-01 3.856804341377490508e-01
+5.274270476594079549e-01 8.142382455983395717e-01 3.824934902796895964e-01
+5.359974387485314518e-01 8.168032862890818313e-01 3.794106529717772847e-01
+5.447242959015131669e-01 8.193118012377970105e-01 3.764539238160731771e-01
+5.536017493685388979e-01 8.217627673204914718e-01 3.736470734604069865e-01
+5.626223858732353200e-01 8.241555398979113489e-01 3.710154595070918049e-01
+5.717801732913297963e-01 8.264893011624766528e-01 3.685830453573430421e-01
+5.810619798273547465e-01 8.287648131945639651e-01 3.663798607459672341e-01
+5.904522695833789303e-01 8.309836316507100973e-01 3.644363382969363352e-01
+5.999363056699199559e-01 8.331474672067843423e-01 3.627802030453921023e-01
+6.094978370184862548e-01 8.352587020450518152e-01 3.614380620192426119e-01
+6.191178753985615568e-01 8.373207419267220120e-01 3.604354982890065617e-01
+6.287753075069072439e-01 8.393379672623436649e-01 3.597956834322972863e-01
+6.384515865712356852e-01 8.413146218129586851e-01 3.595361765343614291e-01
+6.481275660781142811e-01 8.432555569199260415e-01 3.596707668706327632e-01
+6.577845458065525452e-01 8.451659780810962808e-01 3.602086612732601778e-01
+6.674047070379289792e-01 8.470513147981415525e-01 3.611542742755425861e-01
+6.769617561788032756e-01 8.489198363378159806e-01 3.625096347273936148e-01
+6.864487597795673191e-01 8.507748949282539774e-01 3.642665641101618390e-01
+6.958544314564799604e-01 8.526212799355240568e-01 3.664154684319869681e-01
+7.051685608468114541e-01 8.544637256207057163e-01 3.689436786046771388e-01
+7.143830272263600456e-01 8.563065614925247093e-01 3.718358172740615641e-01
+7.234917624309317175e-01 8.581536540348341235e-01 3.750744951817871486e-01
+7.324906484647774052e-01 8.600083717860309562e-01 3.786409937540124448e-01
+7.413773645706981386e-01 8.618735721244006331e-01 3.825158976261986421e-01
+7.501511992657796668e-01 8.637516069265696039e-01 3.866796514151401021e-01
+7.588128421172509741e-01 8.656443435632366068e-01 3.911130257986148440e-01
+7.673641682613402404e-01 8.675531974405399360e-01 3.957974875667232828e-01
+7.758080262912036007e-01 8.694791724028596569e-01 4.007154759905482422e-01
+7.841480375461038488e-01 8.714229056785223193e-01 4.058505933213660266e-01
+7.923777293356836227e-01 8.733886508286130557e-01 4.111824877427081026e-01
+8.004976303968860396e-01 8.753781889640523950e-01 4.166935560611597644e-01
+8.085242857272323391e-01 8.773871783186646400e-01 4.223760515178233144e-01
+8.164630734789560806e-01 8.794151844938148388e-01 4.282186311869483064e-01
+8.243194501554683695e-01 8.814616081475756815e-01 4.342112747863317024e-01
+8.320860387263339097e-01 8.835308362945183402e-01 4.403358497380424619e-01
+8.397544323444476877e-01 8.856278479633188372e-01 4.465723185371322512e-01
+8.473543986252204396e-01 8.877421380157632935e-01 4.529306634208433713e-01
+8.548913210362114601e-01 8.898726582646793171e-01 4.594053245849991085e-01
+8.623409541601502193e-01 8.920307544658760968e-01 4.659650403812060637e-01
+8.697191661117472661e-01 8.942111604773197442e-01 4.726125804953009157e-01
+8.770479480763140323e-01 8.964055876253053112e-01 4.793596015320920611e-01
+8.843061388708378656e-01 8.986242192828276520e-01 4.861771826919926709e-01
+8.914967901846199139e-01 9.008669432468144889e-01 4.930589607663434237e-01
+8.986506618699680038e-01 9.031210853874221955e-01 5.000298200873778409e-01
+9.057328617844134788e-01 9.054032588350297006e-01 5.070444917818385244e-01
+9.127681739145864226e-01 9.077032841253237505e-01 5.141229319104883011e-01
+9.197719823668246697e-01 9.100148294768658497e-01 5.212774789419143406e-01
+9.266999503758117651e-01 9.123594905222979223e-01 5.284479861571415027e-01
+9.336093927737403320e-01 9.147111822755604749e-01 5.356989519972219504e-01
+9.404610328906413130e-01 9.170893351552455997e-01 5.429753047678268496e-01
+9.472803518326599059e-01 9.194825361628593541e-01 5.503044468166357062e-01
+9.540659681238262690e-01 9.218921210725944393e-01 5.576799909240343078e-01
+9.608049809199471492e-01 9.243252266483533708e-01 5.650790057480892248e-01
+9.675287370768704820e-01 9.267668902399696096e-01 5.725413863443260531e-01
+9.741967269037244970e-01 9.292382142036349491e-01 5.800041593344547053e-01
+9.808627042040826138e-01 9.317124815536732552e-01 5.875425838151492330e-01
+9.874684104099172854e-01 9.342202886448683907e-01 5.950648878797101249e-01
+9.940805805099582892e-01 9.367275819156850591e-01 6.026699962989522374e-01]; 
+
+   case 'spe' 
+      RGB = [9.996253193176977137e-01 9.913711226010460953e-01 8.041012438578545307e-01
+9.969312990878144154e-01 9.865865913107011442e-01 7.958196545688069889e-01
+9.942533588637104680e-01 9.818135789307643746e-01 7.875317815897165952e-01
+9.915896776086415842e-01 9.770525904709529419e-01 7.792374356109948996e-01
+9.889384786221749879e-01 9.723041153469224041e-01 7.709364896057565586e-01
+9.862980251266783016e-01 9.675686302753326862e-01 7.626288656679628408e-01
+9.836666169060123144e-01 9.628466015967408476e-01 7.543145233681930462e-01
+9.810425876106124710e-01 9.581384871880828102e-01 7.459934495167190871e-01
+9.784237290846492519e-01 9.534448589527805273e-01 7.376670490866494845e-01
+9.758091741853186507e-01 9.487660072025493330e-01 7.293335612360094533e-01
+9.731976797213667263e-01 9.441023023821585314e-01 7.209921595340745837e-01
+9.705876565172376624e-01 9.394541905537218129e-01 7.126429103405369503e-01
+9.679775344953384097e-01 9.348221172710475813e-01 7.042858810456844587e-01
+9.653657609756586266e-01 9.302065285603877687e-01 6.959211353452218196e-01
+9.627508763245108403e-01 9.256078555762781157e-01 6.875485248304887831e-01
+9.601317913231469658e-01 9.210264571207541495e-01 6.791669211618720503e-01
+9.575068348330096901e-01 9.164628209777989643e-01 6.707767168399573210e-01
+9.548744491996995487e-01 9.119174176425877132e-01 6.623780173986024700e-01
+9.522330808045905703e-01 9.073907239128325974e-01 6.539709177027834830e-01
+9.495811770290348841e-01 9.028832240271246201e-01 6.455555018977681137e-01
+9.469171829214290126e-01 8.983954108674836458e-01 6.371318441574638225e-01
+9.442402190659517913e-01 8.939276490907958062e-01 6.286979645113369708e-01
+9.415486437855169477e-01 8.894804711503382366e-01 6.202539985663386712e-01
+9.388403761261178149e-01 8.850545069722992597e-01 6.118014161078325630e-01
+9.361137658947894513e-01 8.806503085987659185e-01 6.033403762527677072e-01
+9.333671427931780062e-01 8.762684428171652051e-01 5.948710444843188228e-01
+9.305988122871574619e-01 8.719094924143574454e-01 5.863935979844183688e-01
+9.278070514355759579e-01 8.675740573997056115e-01 5.779082318269497254e-01
+9.249901047433721768e-01 8.632627561697012730e-01 5.694151660419812799e-01
+9.221469800733509414e-01 8.589760860685742294e-01 5.609116482547054083e-01
+9.192753048560652340e-01 8.547148108589553983e-01 5.523997440377725887e-01
+9.163728560349155838e-01 8.504796735679325259e-01 5.438810466983201586e-01
+9.134376867190158178e-01 8.462713800742609482e-01 5.353560484875481418e-01
+9.104678046010745707e-01 8.420906570028113824e-01 5.268253096213930675e-01
+9.074611700430375016e-01 8.379382516634488187e-01 5.182894693241438810e-01
+9.044156948810763152e-01 8.338149316350844664e-01 5.097492574011085464e-01
+9.013292420875533839e-01 8.297214839374013051e-01 5.012055062134753713e-01
+8.981996264328737656e-01 8.256587137313211588e-01 4.926591628979440363e-01
+8.950246162923013449e-01 8.216274424893472705e-01 4.841113016411668357e-01
+8.918019367410795484e-01 8.176285055788921063e-01 4.755631357855747976e-01
+8.885292740744069606e-01 8.136627492060259925e-01 4.670160295098501613e-01
+8.852042818763621312e-01 8.097310266740884721e-01 4.584715087957387802e-01
+8.818245887426444662e-01 8.058341939216442373e-01 4.499312713647861117e-01
+8.783878077356160885e-01 8.019731043176190344e-01 4.413971952459587733e-01
+8.748915476159051519e-01 7.981486027081815537e-01 4.328713456201330745e-01
+8.713334258529761289e-01 7.943615187300834268e-01 4.243559795823733105e-01
+8.677110833677242896e-01 7.906126594284177411e-01 4.158535484698712703e-01
+8.640222009043423412e-01 7.869028012426558805e-01 4.073666974243692063e-01
+8.602645168678531018e-01 7.832326814525909509e-01 3.988982618942717440e-01
+8.564358463998196225e-01 7.796029892044549214e-01 3.904512608343593816e-01
+8.525341014005127782e-01 7.760143562656642846e-01 3.820288864300384613e-01
+8.485573111443696082e-01 7.724673476829161389e-01 3.736344902575098326e-01
+8.445036430802366212e-01 7.689624525410815314e-01 3.652715658890242079e-01
+8.403714233625397823e-01 7.655000750378188057e-01 3.569437280604416673e-01
+8.361591566273345322e-01 7.620805260995172636e-01 3.486546886323707573e-01
+8.318655445115968883e-01 7.587040157667198637e-01 3.404082296912668837e-01
+8.274895024172935765e-01 7.553706465705579687e-01 3.322081742472747790e-01
+8.230301740454328829e-01 7.520804081054507373e-01 3.240583550855133943e-01
+8.184868212302832680e-01 7.488332616294635091e-01 3.159617825674137515e-01
+8.138590110822148116e-01 7.456289896604103573e-01 3.079221377655331771e-01
+8.091468181242912339e-01 7.424670871619818424e-01 2.999443469091602199e-01
+8.043504122379883103e-01 7.393470563716729727e-01 2.920319686576324791e-01
+7.994702184716161453e-01 7.362682828578653860e-01 2.841884012704181672e-01
+7.945069109411802000e-01 7.332300399833050486e-01 2.764168555307422448e-01
+7.894614033518293494e-01 7.302314948629916591e-01 2.687203309843908539e-01
+7.843348364120679150e-01 7.272717156577747089e-01 2.611015959667907227e-01
+7.791285260147496894e-01 7.243496994364320152e-01 2.535630684860531447e-01
+7.738440801480908071e-01 7.214643092911102729e-01 2.461071963221510561e-01
+7.684833208817296590e-01 7.186143199358207001e-01 2.387362039122769009e-01
+7.630481315977482026e-01 7.157984953860191402e-01 2.314517734491695622e-01
+7.575405230514773436e-01 7.130155515836559266e-01 2.242553190375982108e-01
+7.519626112766101267e-01 7.102641669372077304e-01 2.171479941172158035e-01
+7.463165956980535309e-01 7.075429925763011552e-01 2.101307026608347228e-01
+7.406047378440419049e-01 7.048506621488696000e-01 2.032041138079452858e-01
+7.348297350913484127e-01 7.021856197788983733e-01 1.963692968886621149e-01
+7.289936844492124202e-01 6.995466025992004289e-01 1.896260481458106884e-01
+7.230988483362374986e-01 6.969322773880018973e-01 1.829743149302962002e-01
+7.171475322086006132e-01 6.943412998823550453e-01 1.764139943240976283e-01
+7.111420143928013360e-01 6.917723467781027313e-01 1.699448658068684892e-01
+7.050845338608371371e-01 6.892241206236302542e-01 1.635666199792324693e-01
+6.989772797030316953e-01 6.866953538838792559e-01 1.572788888364401172e-01
+6.928223822517928232e-01 6.841848122132092591e-01 1.510812776309110872e-01
+6.866220524799201419e-01 6.816912363109779438e-01 1.449735254345622115e-01
+6.803786701652846380e-01 6.792133090629258740e-01 1.389555620195359609e-01
+6.740936196655853418e-01 6.767501306945983286e-01 1.330266252977832520e-01
+6.677687244983904202e-01 6.743006234739316040e-01 1.271865644636745452e-01
+6.614057275351008514e-01 6.718637487365417549e-01 1.214353970802317662e-01
+6.550062900453353931e-01 6.694385066322930955e-01 1.157733573283348805e-01
+6.485719915801509972e-01 6.670239355272904458e-01 1.102009495253571669e-01
+6.421043305819508218e-01 6.646191111168818777e-01 1.047190080781650323e-01
+6.356047256163376291e-01 6.622231453008022850e-01 9.932876523540395963e-02
+6.290745171295046845e-01 6.598351848668921882e-01 9.403192821288078318e-02
+6.225149696438274649e-01 6.574544100249212208e-01 8.883076747185855715e-02
+6.159272743135092432e-01 6.550800328272597950e-01 8.372821811088401733e-02
+6.093126663293514378e-01 6.527112545185101977e-01 7.872799706657532259e-02
+6.026723170612737768e-01 6.503473055396404856e-01 7.383469856963406630e-02
+5.960069280976730832e-01 6.479875866853281874e-01 6.905400752442764079e-02
+5.893174254692321590e-01 6.456314203776034599e-01 6.439287527349069062e-02
+5.826046784844106652e-01 6.432781520370909334e-01 5.985968924725062340e-02
+5.758695032242261425e-01 6.409271483905801814e-01 5.546448455059219823e-02
+5.691126660872921628e-01 6.385777958070207871e-01 5.121916775709036557e-02
+5.623348873683923221e-01 6.362294986703330713e-01 4.713774156788400754e-02
+5.555368448583254404e-01 6.338816777957024806e-01 4.323651096469569716e-02
+5.487191774565705060e-01 6.315337688945173999e-01 3.952487864258176498e-02
+5.418824887917018662e-01 6.291852210919098853e-01 3.612051121019213551e-02
+5.350273508472259687e-01 6.268354954999130202e-01 3.311399967360150604e-02
+5.281543075929241438e-01 6.244840638484698836e-01 3.049096132752013993e-02
+5.212638786236020172e-01 6.221304071760309640e-01 2.823775650583685778e-02
+5.143565628087404251e-01 6.197740145810481938e-01 2.634144880489198981e-02
+5.074328419576341620e-01 6.174143820354919265e-01 2.478976657062584646e-02
+5.004931845054064743e-01 6.150510112614009373e-01 2.357106560875196072e-02
+4.935380492257968599e-01 6.126834086714986194e-01 2.267429306479169446e-02
+4.865677337149327264e-01 6.103111278318402722e-01 2.208918519158591109e-02
+4.795827833081557912e-01 6.079336535225863258e-01 2.180564619063158835e-02
+4.725836555273193462e-01 6.055504983495709759e-01 2.181419194008693205e-02
+4.655708088649732068e-01 6.031611773523495312e-01 2.210580170001537684e-02
+4.585447116306416437e-01 6.007652058968021569e-01 2.267187969798983502e-02
+4.515058459835388782e-01 5.983620990282547680e-01 2.350422445657735990e-02
+4.444547120266517104e-01 5.959513709030562767e-01 2.459499875403014374e-02
+4.373918319618326778e-01 5.935325343022211930e-01 2.593670014651517156e-02
+4.303177543037495223e-01 5.911051002310937497e-01 2.752213198538535840e-02
+4.232330581488202292e-01 5.886685776092354105e-01 2.934437486930205341e-02
+4.161383574931313278e-01 5.862224730549979723e-01 3.139675847884770832e-02
+4.090343055913983616e-01 5.837662907693373926e-01 3.367283375013734037e-02
+4.019215993467592507e-01 5.812995325235387201e-01 3.616634535426579283e-02
+3.948009837190709082e-01 5.788216977554323517e-01 3.887120446073646235e-02
+3.876732561372571162e-01 5.763322837785355146e-01 4.174672181203834681e-02
+3.805386564470196742e-01 5.738309171411589693e-01 4.468566878513501733e-02
+3.733986391498164137e-01 5.713169711328536238e-01 4.768049787246867594e-02
+3.662542351622480874e-01 5.687899279044026368e-01 5.071835758395210753e-02
+3.591065040473656045e-01 5.662492786415918022e-01 5.378828392041421630e-02
+3.519565800474088735e-01 5.636945152858550134e-01 5.688085721725138350e-02
+3.448056760545124555e-01 5.611251315161035480e-01 5.998797256299469999e-02
+3.376550874229136134e-01 5.585406238589376571e-01 6.310263770132876204e-02
+3.305061956006355439e-01 5.559404929241524851e-01 6.621879773242350664e-02
+3.233604715607960034e-01 5.533242447607230607e-01 6.933118466356372189e-02
+3.162194790161148017e-01 5.506913923265978061e-01 7.243518928216058361e-02
+3.090846039651472532e-01 5.480415027343880086e-01 7.552721746757809496e-02
+3.019574288899705139e-01 5.453741321890830385e-01 7.860394456462099777e-02
+2.948403194287022577e-01 5.426887379559618418e-01 8.166128713902018332e-02
+2.877352499045566225e-01 5.399848761881764769e-01 8.469633286585029341e-02
+2.806442994214729536e-01 5.372621189537871711e-01 8.770643445761908130e-02
+2.735696535538801322e-01 5.345200561570193631e-01 9.068916512095565041e-02
+2.665136059049172390e-01 5.317582974656462902e-01 9.364228167891575083e-02
+2.594785595977833204e-01 5.289764742223507232e-01 9.656369418956520234e-02
+2.524670287821700332e-01 5.261742413169625543e-01 9.945144107016240520e-02
+2.454813557062531792e-01 5.233513142453691813e-01 1.023041162767710510e-01
+2.385245828710040317e-01 5.205073603004944927e-01 1.051194831525161522e-01
+2.315996737216303170e-01 5.176421037021866622e-01 1.078956959800008442e-01
+2.247096070811669399e-01 5.147553123030387257e-01 1.106311405318080310e-01
+2.178574824667257048e-01 5.118467857547527311e-01 1.133242655958566492e-01
+2.110465244393363582e-01 5.089163566221597268e-01 1.159735773093806543e-01
+2.042800881777394606e-01 5.059638913007615812e-01 1.185776351459725819e-01
+1.975616665475327660e-01 5.029892907239723598e-01 1.211350492651094846e-01
+1.908950317685597087e-01 4.999924798399172921e-01 1.236442618572499708e-01
+1.842839642352289697e-01 4.969734333710090213e-01 1.261039978961912833e-01
+1.777324020667393756e-01 4.939321620495928378e-01 1.285130506256617899e-01
+1.712444848635372441e-01 4.908687102327232155e-01 1.308702368677320538e-01
+1.648245567449286297e-01 4.877831568788963401e-01 1.331744245804179216e-01
+1.584771896665797541e-01 4.846756148389082530e-01 1.354245338303780855e-01
+1.522072108246106115e-01 4.815462299379932865e-01 1.376195378692431359e-01
+1.460197345452351747e-01 4.783951798632230523e-01 1.397584642177332193e-01
+1.399204939260773328e-01 4.752226638142488802e-01 1.418397751955981501e-01
+1.339151022806790436e-01 4.720289313790105301e-01 1.438629155677119409e-01
+1.280096392738992173e-01 4.688142535267130762e-01 1.458273227721058329e-01
+1.222107627052576584e-01 4.655789223639808516e-01 1.477322650340249788e-01
+1.165256528622910237e-01 4.623232537320298152e-01 1.495770677617926092e-01
+1.109620746853187123e-01 4.590475853271560047e-01 1.513611132825743999e-01
+1.055284430115649430e-01 4.557522747771929894e-01 1.530838402977779955e-01
+1.002338888313226428e-01 4.524376976954341267e-01 1.547447430577089666e-01
+9.508832342249537439e-02 4.491042457325262194e-01 1.563433702619193288e-01
+9.010250937510871916e-02 4.457523324675090604e-01 1.578790892676192326e-01
+8.528801833375249108e-02 4.423823989146767888e-01 1.593510674113139958e-01
+8.065727940861416867e-02 4.389948528858526600e-01 1.607597457256386420e-01
+7.622371216564308161e-02 4.355901307746828932e-01 1.621048834368656322e-01
+7.200158271604989446e-02 4.321686757028083692e-01 1.633862841279137557e-01
+6.800589086138220107e-02 4.287309359317861834e-01 1.646037933778843332e-01
+6.425218103335716968e-02 4.252773633715483670e-01 1.657572962977645059e-01
+6.075626148835750612e-02 4.218084121914437157e-01 1.668467149892300661e-01
+5.753381975108700502e-02 4.183245375382101949e-01 1.678720059529140995e-01
+5.459992971435845971e-02 4.148261943636451510e-01 1.688331574715942474e-01
+5.196845773512390881e-02 4.113138363632788397e-01 1.697301869925023354e-01
+4.965139124510086627e-02 4.077879150260529384e-01 1.705631385315065085e-01
+4.765813208284918473e-02 4.042488787938245398e-01 1.713320801202671551e-01
+4.599481449154869256e-02 4.006971723285012166e-01 1.720371013157572515e-01
+4.466371969486728627e-02 3.971332358837184051e-01 1.726783107897287561e-01
+4.366274483561478209e-02 3.935575133766276990e-01 1.732557671739120286e-01
+4.298497468310508857e-02 3.899704687794856572e-01 1.737693705957654433e-01
+4.262017645185838671e-02 3.863724827023667929e-01 1.742196255705478480e-01
+4.255352467768171859e-02 3.827639728113220174e-01 1.746066936456434071e-01
+4.276673184831410873e-02 3.791453506945430818e-01 1.749307448926006592e-01
+4.323878239983177524e-02 3.755170217599948512e-01 1.751919563188165385e-01
+4.394675081101364483e-02 3.718793851987791665e-01 1.753905104335057585e-01
+4.486662442701292580e-02 3.682328340080037177e-01 1.755265939730583369e-01
+4.597406436707644067e-02 3.645777550668193867e-01 1.756003967899375517e-01
+4.724505801823831314e-02 3.609145292591857124e-01 1.756121109084000098e-01
+4.865643856140024898e-02 3.572435316368365310e-01 1.755619297495205344e-01
+5.018626632042253594e-02 3.535651316158259783e-01 1.754500475272437465e-01
+5.181408104443557122e-02 3.498796931999255677e-01 1.752766588164567374e-01
+5.352104295989750654e-02 3.461875752240315962e-01 1.750419582933170903e-01
+5.528998425553303259e-02 3.424891316106106198e-01 1.747461406473147794e-01
+5.710539287663336100e-02 3.387847116320403806e-01 1.743894006636908245e-01
+5.895334846203271334e-02 3.350746601715560713e-01 1.739719334739151524e-01
+6.082142709649813322e-02 3.313593179753057116e-01 1.734939349708606859e-01
+6.269858808390260663e-02 3.276390218878380001e-01 1.729556023841174184e-01
+6.457505267241087088e-02 3.239141050631572094e-01 1.723571350094970367e-01
+6.644218183629055363e-02 3.201848971432968427e-01 1.716987350852014205e-01
+6.829235792686130790e-02 3.164517243962254311e-01 1.709806088053268391e-01
+7.011887323479765177e-02 3.127149098048046527e-01 1.702029674593475428e-01
+7.191582719453681882e-02 3.089747730984767071e-01 1.693660286839586415e-01
+7.367740139700959534e-02 3.052317018390342529e-01 1.684698187582648887e-01
+7.539908659075802988e-02 3.014860094828903936e-01 1.675145933863426417e-01
+7.707730571895973770e-02 2.977379606831319081e-01 1.665007348086736949e-01
+7.870852955781817983e-02 2.939878648964006636e-01 1.654284970811750188e-01
+8.028965953863020921e-02 2.902360278178472974e-01 1.642981478645798299e-01
+8.181797774419891089e-02 2.864827509313960796e-01 1.631099700093367744e-01
+8.329110360766753263e-02 2.827283309501391617e-01 1.618642630930951787e-01
+8.470695659424687385e-02 2.789730591425138573e-01 1.605613448745624727e-01
+8.606372418387428502e-02 2.752172205414125661e-01 1.592015526248838075e-01
+8.735983452008261319e-02 2.714610930351273321e-01 1.577852442954886525e-01
+8.859393314120664331e-02 2.677049463410028363e-01 1.563127994796906506e-01
+8.976486326081492551e-02 2.639490408648579312e-01 1.547846201243904263e-01
+9.087164911293293956e-02 2.601936264515474218e-01 1.532011309481255412e-01
+9.191348192284298779e-02 2.564389410344570241e-01 1.515627795225681362e-01
+9.288704312629730842e-02 2.526856315239155992e-01 1.498693699931691048e-01
+9.379283018859288501e-02 2.489337717503207204e-01 1.481216905842226428e-01
+9.463163644057562274e-02 2.451833792964967507e-01 1.463205652098015508e-01
+9.540318566942779244e-02 2.414346401225993533e-01 1.444665315338557743e-01
+9.610732643393554708e-02 2.376877206774311024e-01 1.425601463139360425e-01
+9.674402718144511915e-02 2.339427661170380146e-01 1.406019829499289553e-01
+9.731337192794831115e-02 2.301998985206034631e-01 1.385926284969124511e-01
+9.781527030012060475e-02 2.264592671684997338e-01 1.365326231802845014e-01
+9.824358966693200190e-02 2.227221381992704474e-01 1.344213498047777955e-01
+9.860476008591259611e-02 2.189874851640599696e-01 1.322606854144605382e-01
+9.889926458171927059e-02 2.152553323101172311e-01 1.300512525669721697e-01
+9.912768720083675600e-02 2.115256719866073221e-01 1.277936680974917916e-01
+9.929070945217863264e-02 2.077984630697710111e-01 1.254885372707029156e-01
+9.938536693535210409e-02 2.040743841747782450e-01 1.231359093599569132e-01
+9.940987528000957973e-02 2.003539028956775048e-01 1.207361104943659447e-01
+9.937074432198822471e-02 1.966357733029605592e-01 1.182905659078862248e-01
+9.926899950314096999e-02 1.929198155529378012e-01 1.157998086675786908e-01
+9.910574746809375224e-02 1.892058087816931022e-01 1.132643300609986470e-01
+9.887273365069987330e-02 1.854955476839638961e-01 1.106837415179452166e-01
+9.857702759168757156e-02 1.817875303344013982e-01 1.080592207487474365e-01
+9.822269753736714848e-02 1.780808239249605796e-01 1.053914161709541830e-01
+9.781113633355650872e-02 1.743750377566490040e-01 1.026806351620476176e-01
+9.733238005935909709e-02 1.706723687329834982e-01 9.992670564763897478e-02
+9.679537330416121410e-02 1.669706979907544520e-01 9.713043093317094701e-02
+9.620476860769888727e-02 1.632687911401897729e-01 9.429209466525781402e-02
+9.555840111219859878e-02 1.595669718044100127e-01 9.141177435708905397e-02
+9.484851695793727888e-02 1.558669291806107915e-01 8.848983773912671991e-02
+9.408911153954402362e-02 1.521650578561620781e-01 8.552628708305054506e-02
+9.328192094338655371e-02 1.484606091474970080e-01 8.252094903627574252e-02
+9.241015243151923242e-02 1.447574737795673805e-01 7.947496936453349314e-02
+9.149313879389489590e-02 1.410504572025015335e-01 7.638732537156053826e-02
+9.053276383981978537e-02 1.373386075843833487e-01 7.325761429945673586e-02]; 
+
+   case 'the' 
+      RGB = [1.555601333154079877e-02 1.382442454646408414e-01 2.018108864558305071e-01
+1.620183633850513089e-02 1.410507428866217272e-01 2.089765125440807836e-01
+1.685648942708358952e-02 1.438270143621834252e-01 2.162386804476043589e-01
+1.752640064782528401e-02 1.465717250667996630e-01 2.235996996833259920e-01
+1.821871873545745021e-02 1.492834638238061673e-01 2.310618693528040390e-01
+1.894137836902154426e-02 1.519607349643580241e-01 2.386274839825403005e-01
+1.969967580211434005e-02 1.546014513385217670e-01 2.463049741539924953e-01
+2.050331512714091350e-02 1.572037794856419868e-01 2.540971092002056730e-01
+2.136720981691051999e-02 1.597664500864496573e-01 2.619991459036808412e-01
+2.230340677460975612e-02 1.622875536944013708e-01 2.700132114112391291e-01
+2.332520459934065912e-02 1.647650548255009395e-01 2.781413941166567261e-01
+2.444727823684482437e-02 1.671967824349823439e-01 2.863857270216258466e-01
+2.568581629165060318e-02 1.695804203313354408e-01 2.947481661145329168e-01
+2.705867185137392564e-02 1.719134976584987262e-01 3.032305630924797546e-01
+2.858552764394725262e-02 1.741933796245943022e-01 3.118346316168387755e-01
+3.028807626872338093e-02 1.764172587161002559e-01 3.205619061457981589e-01
+3.219021609777513587e-02 1.785821467123839268e-01 3.294136922283489310e-01
+3.431826321592867240e-02 1.806848679100377109e-01 3.383910069732901649e-01
+3.670117943457189280e-02 1.827220540829147533e-01 3.474945082255425644e-01
+3.937081594703384368e-02 1.846901418460877020e-01 3.567244107935257369e-01
+4.230474116360182640e-02 1.865853732643254770e-01 3.660803878810173217e-01
+4.544128431656369732e-02 1.884038007524381497e-01 3.755614556934170345e-01
+4.879889459256544354e-02 1.901412975600472455e-01 3.851658390246698871e-01
+5.238564999909287728e-02 1.917935754201579024e-01 3.948908155057742619e-01
+5.620896927989652708e-02 1.933562112707872260e-01 4.047325361348014794e-01
+6.027560971317643540e-02 1.948246853300575621e-01 4.146858197468099028e-01
+6.459519137924149557e-02 1.961877478810097886e-01 4.247714594384868758e-01
+6.917293885235362150e-02 1.974458334676339466e-01 4.349572770994127868e-01
+7.401397924875777190e-02 1.985943734629224688e-01 4.452322549865626589e-01
+7.912632580773251711e-02 1.996251445642635014e-01 4.555965555444902448e-01
+8.452074659970570947e-02 2.005284212595413451e-01 4.660508732253974551e-01
+9.019392390291772199e-02 2.013079448693051998e-01 4.765478779135125520e-01
+9.616430834359415702e-02 2.019472529514862447e-01 4.871044455010897223e-01
+1.024253987466881288e-01 2.024520213616345932e-01 4.976646226688278829e-01
+1.089944270249512126e-01 2.028088855832538839e-01 5.082270885561682716e-01
+1.158597351626668159e-01 2.030273547727350913e-01 5.187245256305992314e-01
+1.230424263443430921e-01 2.030937970306834206e-01 5.291483757425788914e-01
+1.305276694613609623e-01 2.030217816424806365e-01 5.394201195013325068e-01
+1.383099125215292158e-01 2.028195613734770086e-01 5.494767764101642360e-01
+1.463797060150685281e-01 2.025001769277504637e-01 5.592461312000727158e-01
+1.547186326280874380e-01 2.020850680852618320e-01 5.686422620965899677e-01
+1.632970499077517346e-01 2.016054641193363861e-01 5.775676861911989146e-01
+1.720728231749732162e-01 2.011027291278179585e-01 5.859183845130113699e-01
+1.809917622181062835e-01 2.006270524284321510e-01 5.935918186078640302e-01
+1.899902199574210471e-01 2.002341583564870575e-01 6.004970669758479263e-01
+1.989997441940680178e-01 1.999802927301375655e-01 6.065651516258429021e-01
+2.079529779081165097e-01 1.999164256738651391e-01 6.117570630961892686e-01
+2.167895160216459782e-01 2.000830340237900185e-01 6.160673924886361785e-01
+2.254604257150365498e-01 2.005067081654643424e-01 6.195227918364496489e-01
+2.339306302023402284e-01 2.011991984057693306e-01 6.221760825969698816e-01
+2.421790683949211487e-01 2.021587162723321729e-01 6.240979346009031259e-01
+2.501971277034634733e-01 2.033727314506766359e-01 6.253682433520739714e-01
+2.579861074778473928e-01 2.048213417591974728e-01 6.260687943604991146e-01
+2.655544225081862275e-01 2.064804694302365684e-01 6.262779744769025880e-01
+2.729150389729214088e-01 2.083244557603688429e-01 6.260675767301320249e-01
+2.800833915559314269e-01 2.103279194298604549e-01 6.255013265069014894e-01
+2.870675074033041674e-01 2.124691386407265292e-01 6.246420009551492125e-01
+2.938851360627945386e-01 2.147254304183257023e-01 6.235380183242871244e-01
+3.005577213461362307e-01 2.170756514619715527e-01 6.222251903623999825e-01
+3.070843773107185259e-01 2.195059802015210115e-01 6.207554984633752992e-01
+3.134916285549604886e-01 2.219983100391352271e-01 6.191452159520036691e-01
+3.197798380866583856e-01 2.245420356602937373e-01 6.174343435010863912e-01
+3.259695527216341926e-01 2.271241237863139140e-01 6.156329324235468858e-01
+3.320579089479565038e-01 2.297373625924510887e-01 6.137771467682858750e-01
+3.380660052498126178e-01 2.323715331127139128e-01 6.118660583919267593e-01
+3.439917420525137604e-01 2.350215076527270575e-01 6.099280657295180763e-01
+3.498460685618723365e-01 2.376808945869600675e-01 6.079694872801727490e-01
+3.556384580181179977e-01 2.403444043084654869e-01 6.059953497614897211e-01
+3.613686295558476425e-01 2.430089153836439420e-01 6.040241385974032262e-01
+3.670434468015162932e-01 2.456707832167414618e-01 6.020607616318822686e-01
+3.726708785615932551e-01 2.483266964722255499e-01 6.001059364008434205e-01
+3.782547954216434749e-01 2.509743622345630976e-01 5.981656274234778969e-01
+3.837960822688916696e-01 2.536122834643630419e-01 5.962498766549472196e-01
+3.892988345534371120e-01 2.562387736058999166e-01 5.943618049976240325e-01
+3.947690991030736729e-01 2.588520700720948198e-01 5.924996351953921714e-01
+4.002098946086877773e-01 2.614510659770345469e-01 5.906660913059953444e-01
+4.056240909379103532e-01 2.640348396856425084e-01 5.888633104220148962e-01
+4.110144223076953041e-01 2.666026246434279878e-01 5.870929096766683841e-01
+4.163832172801885667e-01 2.691538344975527575e-01 5.853565951388559618e-01
+4.217313231007376317e-01 2.716882525666767800e-01 5.836583632684495537e-01
+4.270634345309600177e-01 2.742050306264073312e-01 5.819941042354170868e-01
+4.323818104897113601e-01 2.767038027770706843e-01 5.803639256565888971e-01
+4.376886243188534142e-01 2.791842625143060586e-01 5.787676418773346487e-01
+4.429859696643737577e-01 2.816461519867726748e-01 5.772048027503156042e-01
+4.482758654902720408e-01 2.840892531259122666e-01 5.756747186760452495e-01
+4.535602602863915700e-01 2.865133804028727749e-01 5.741764823913096949e-01
+4.588410355259065487e-01 2.889183750000149931e-01 5.727089879419176022e-01
+4.641200084236148382e-01 2.913041002126984247e-01 5.712709472315609105e-01
+4.693989340425177015e-01 2.936704379215548943e-01 5.698609044983501404e-01
+4.746795067933508583e-01 2.960172859965477521e-01 5.684772490345112450e-01
+4.799633613697112389e-01 2.983445565121622955e-01 5.671182264323321176e-01
+4.852520731601697723e-01 3.006521746683436525e-01 5.657819486102849682e-01
+4.905471581781303825e-01 3.029400783247205298e-01 5.644664028469250638e-01
+4.958500725502145712e-01 3.052082180664184574e-01 5.631694600262432404e-01
+5.011622116043696895e-01 3.074565577287760587e-01 5.618888822762294621e-01
+5.064849085998188727e-01 3.096850753156841218e-01 5.606223301621769961e-01
+5.118194331420761189e-01 3.118937642524056697e-01 5.593673695773668797e-01
+5.171669893275794294e-01 3.140826349187781363e-01 5.581214784559522801e-01
+5.225287136638799845e-01 3.162517164128481606e-01 5.568820534159194535e-01
+5.279056728126164666e-01 3.184010584984696690e-01 5.556464164236831760e-01
+5.332988612036093645e-01 3.205307336933521101e-01 5.544118215561065766e-01
+5.387091985692399332e-01 3.226408394566178117e-01 5.531754619204082291e-01
+5.441375274486375258e-01 3.247315004373090841e-01 5.519344767774559957e-01
+5.495846107110635703e-01 3.268028707475315597e-01 5.506859588994191812e-01
+5.550511291471261766e-01 3.288551362262008837e-01 5.494269621786239677e-01
+5.605376791749926424e-01 3.308885166617086537e-01 5.481545094908906179e-01
+5.660447559653561944e-01 3.329032737201366166e-01 5.468656290966650291e-01
+5.715723572408055730e-01 3.348998704862335973e-01 5.455581199822507887e-01
+5.771213104289429907e-01 3.368784486432290226e-01 5.442280104688511644e-01
+5.826918609018115758e-01 3.388393806259411556e-01 5.428722728323092106e-01
+5.882841610050709713e-01 3.407830824811499126e-01 5.414878910241607279e-01
+5.938982692324897839e-01 3.427100153754324974e-01 5.400718694374621043e-01
+5.995341497366565298e-01 3.446206869260000083e-01 5.386212416598933350e-01
+6.051916721861749782e-01 3.465156523493675422e-01 5.371330791454219655e-01
+6.108706119725975103e-01 3.483955154267821541e-01 5.356044997333838653e-01
+6.165706507631435462e-01 3.502609292895154658e-01 5.340326759432469927e-01
+6.222913773881607602e-01 3.521125970311436149e-01 5.324148429745680922e-01
+6.280322890453092777e-01 3.539512721578863541e-01 5.307483063447554494e-01
+6.337927927958686425e-01 3.557777588917046541e-01 5.290304491020394462e-01
+6.395721854014132512e-01 3.575929224264804973e-01 5.272587829694529438e-01
+6.453697498455218673e-01 3.593976455700171879e-01 5.254307632896803026e-01
+6.511846984697030605e-01 3.611928549527803622e-01 5.235439096149940852e-01
+6.570160963803246545e-01 3.629795579684892415e-01 5.215959730192853971e-01
+6.628629283562820218e-01 3.647588132682739737e-01 5.195848109675399451e-01
+6.687241012633005077e-01 3.665317306708469891e-01 5.175083912494201632e-01
+6.745984464659754432e-01 3.682994710922303794e-01 5.153647953022981731e-01
+6.804847221871188623e-01 3.700632465224873990e-01 5.131522209386339961e-01
+6.863816157645579175e-01 3.718243200760849021e-01 5.108689845040222943e-01
+6.922877457570544291e-01 3.735840061411623281e-01 5.085135225034096429e-01
+6.982016638532075881e-01 3.753436706510840937e-01 5.060843927435032530e-01
+7.041218565401857754e-01 3.771047314992945210e-01 5.035802750493091340e-01
+7.100468845018954589e-01 3.788685911907690995e-01 5.009996451582281463e-01
+7.159752518731292703e-01 3.806367017978663503e-01 4.983410633235164089e-01
+7.219050254760910335e-01 3.824107548202065887e-01 4.956041045679995816e-01
+7.278344332015346252e-01 3.841923879692217270e-01 4.927879483140180095e-01
+7.337616407032357957e-01 3.859832960516177969e-01 4.898918977085310877e-01
+7.396847510296571393e-01 3.877852324461281697e-01 4.869153794944616753e-01
+7.456018038508585022e-01 3.896000107579556393e-01 4.838579440403712462e-01
+7.515107742785041012e-01 3.914295066368485010e-01 4.807192656291401911e-01
+7.574095712835625660e-01 3.932756597383701980e-01 4.774991431076147097e-01
+7.632960357235062387e-01 3.951404758009958162e-01 4.741975009994948143e-01
+7.691679379984673881e-01 3.970260288041012053e-01 4.708143911830061090e-01
+7.750229753641669772e-01 3.989344631636088656e-01 4.673499952331199858e-01
+7.808587689384376418e-01 4.008679959130103665e-01 4.638046275250513051e-01
+7.866728604480874854e-01 4.028289188075652172e-01 4.601787391913814695e-01
+7.924627087737056153e-01 4.048196002786729752e-01 4.564729230191116316e-01
+7.982256863620216247e-01 4.068424871537119070e-01 4.526879193650572009e-01
+8.039590755885861473e-01 4.089001060440320967e-01 4.488246231577860956e-01
+8.096600651680347926e-01 4.109950642903736351e-01 4.448840920414381395e-01
+8.153258420561760866e-01 4.131300072582320126e-01 4.408672005707100494e-01
+8.209533846301936277e-01 4.153077124896901728e-01 4.367753702901882029e-01
+8.265394587133882975e-01 4.175310847974926798e-01 4.326106584748535266e-01
+8.320808476618816174e-01 4.198030498289601065e-01 4.283748912056176694e-01
+8.375742298072511582e-01 4.221266063894242304e-01 4.240701127101388912e-01
+8.430161781421201539e-01 4.245048216497959159e-01 4.196985997897492715e-01
+8.484031611801808870e-01 4.269408247931844591e-01 4.152628771038663902e-01
+8.537315452228415591e-01 4.294377989032187592e-01 4.107657331305429871e-01
+8.589975982777037222e-01 4.319989708985695898e-01 4.062102365684474026e-01
+8.641974958823694930e-01 4.346275993272235572e-01 4.015997528869852951e-01
+8.693273290890853877e-01 4.373269598520185819e-01 3.969379606684441675e-01
+8.743831148591909574e-01 4.401003282876529976e-01 3.922288673203608855e-01
+8.793608090992056647e-01 4.429509610905758565e-01 3.874768236699652202e-01
+8.842563225402819693e-01 4.458820732584555802e-01 3.826865368883226592e-01
+8.890655396175203284e-01 4.488968136663485375e-01 3.778630811333164030e-01
+8.937843693689974112e-01 4.519982404973394430e-01 3.730116014425700621e-01
+8.984086715918495614e-01 4.551892900487020666e-01 3.681382748140558103e-01
+9.029343899688814234e-01 4.584727367754222738e-01 3.632494215164466245e-01
+9.073575586033109097e-01 4.618511663085561048e-01 3.583516614288673741e-01
+9.116743277656134126e-01 4.653269421603676848e-01 3.534519722899168159e-01
+9.158809992051784032e-01 4.689021723136149178e-01 3.485576699619067353e-01
+9.199740625655835613e-01 4.725786767270368505e-01 3.436763818638891022e-01
+9.239502320744639174e-01 4.763579567194722864e-01 3.388160133952918263e-01
+9.278064825504417357e-01 4.802411672570275347e-01 3.339847073943023048e-01
+9.315400836682339314e-01 4.842290931875970483e-01 3.291907969273191181e-01
+9.351486313601243827e-01 4.883221304365225612e-01 3.244427519772630775e-01
+9.386300752174523421e-01 4.925202730905588466e-01 3.197491208755643965e-01
+9.419827407976890665e-01 4.968231071526066356e-01 3.151184675888816233e-01
+9.452053458453827384e-01 5.012298115494860928e-01 3.105593062092800172e-01
+9.482970095990234105e-01 5.057391667267315816e-01 3.060800341879720277e-01
+9.512572545755481057e-01 5.103495708806106146e-01 3.016888659817511531e-01
+9.540860004899643920e-01 5.150590635745326828e-01 2.973937688352701891e-01
+9.567835502644689294e-01 5.198653561843505910e-01 2.932024023936338208e-01
+9.593505683914355098e-01 5.247658683349885056e-01 2.891220637265379811e-01
+9.617880522174245828e-01 5.297577692490467172e-01 2.851596391521897811e-01
+9.640972969908582213e-01 5.348380227429672118e-01 2.813215639873033469e-01
+9.662798557460373639e-01 5.400034344900018768e-01 2.776137910349112392e-01
+9.683374952663609259e-01 5.452507001277228094e-01 2.740417682745930894e-01
+9.702721494708056449e-01 5.505764528210163045e-01 2.706104258619907443e-01
+9.720889605050128113e-01 5.559744240639272750e-01 2.673323057285149629e-01
+9.737882391976736551e-01 5.614431075234689317e-01 2.642051375197135843e-01
+9.753722517954447335e-01 5.669791681305653697e-01 2.612321043607351290e-01
+9.768433321430202154e-01 5.725792962307277856e-01 2.584161030939570725e-01
+9.782037550763590383e-01 5.782403184217296266e-01 2.557595328984585970e-01
+9.794556966363962003e-01 5.839592236834146854e-01 2.532643241222839459e-01
+9.806011989875685897e-01 5.897331838357899869e-01 2.509319710696591987e-01
+9.816445119805891073e-01 5.955576445021050214e-01 2.487674614053176358e-01
+9.825957966513861885e-01 6.014235301335163486e-01 2.467838886220111161e-01
+9.834484089207010671e-01 6.073354334336248384e-01 2.449669167474177733e-01
+9.842037798764916579e-01 6.132913094304376367e-01 2.433164315861336413e-01
+9.848630901763529844e-01 6.192893396808167861e-01 2.418320393357376030e-01
+9.854335855591603854e-01 6.253232095344845032e-01 2.405207443125048083e-01
+9.859266054527725531e-01 6.313839151833324781e-01 2.393924955683320310e-01
+9.863290788081210403e-01 6.374805817839866995e-01 2.384285005271009616e-01
+9.866412575432023102e-01 6.436122274808632193e-01 2.376272705850792089e-01
+9.868743031654042541e-01 6.497702193582076680e-01 2.369977788720153966e-01
+9.870387195949218428e-01 6.559468364085242476e-01 2.365460008515470891e-01
+9.871160198111447182e-01 6.621544902577213287e-01 2.362516434857291903e-01
+9.871054832314208882e-01 6.683929123881801049e-01 2.361125093170109435e-01
+9.870452158568817635e-01 6.746361467497961062e-01 2.361551640855951706e-01
+9.869008071972434903e-01 6.809069196703931848e-01 2.363489608363473771e-01
+9.866692878063002548e-01 6.872064512263130753e-01 2.366900769944741967e-01
+9.863929517876753872e-01 6.935072010148546351e-01 2.372025181179537867e-01
+9.860358081545986808e-01 6.998320059248218650e-01 2.378591308273384497e-01
+9.855936903889445100e-01 7.061828277187244263e-01 2.386553467137359497e-01
+9.851166760681809853e-01 7.125285611733751523e-01 2.396137846497558566e-01
+9.845515404596055786e-01 7.189016348706930293e-01 2.407027465239837682e-01
+9.839219208542443473e-01 7.252873073536283410e-01 2.419304971970357987e-01
+9.832411577231264799e-01 7.316776102841332508e-01 2.432981102176038357e-01
+9.824686360853925882e-01 7.380960010628512258e-01 2.447853973017022899e-01
+9.816675490572134288e-01 7.445058075421049359e-01 2.464118597749720974e-01
+9.807811261674898029e-01 7.509394073137781733e-01 2.481527624504580309e-01
+9.798377198237012697e-01 7.573804700508821597e-01 2.500137146942527089e-01
+9.788392654586509645e-01 7.638279008720277874e-01 2.519905378906656113e-01
+9.777574675384567149e-01 7.702969047505190403e-01 2.540716600569991046e-01
+9.766479350869351483e-01 7.767573771217611833e-01 2.562664070834250185e-01
+9.754356977304895482e-01 7.832491288133777152e-01 2.585534361426328198e-01
+9.742107025732685832e-01 7.897246981741067318e-01 2.609472103669700505e-01
+9.728835679779427315e-01 7.962305102434532600e-01 2.634261983272434549e-01
+9.715297353896644728e-01 8.027276438790406088e-01 2.659994820979044161e-01
+9.700861348373609472e-01 8.092479763321948072e-01 2.686528986078252079e-01
+9.686057099481873989e-01 8.157648637457888263e-01 2.713899293880046582e-01
+9.670430691608270513e-01 8.223006128282058791e-01 2.742007328066633498e-01
+9.654377156641301694e-01 8.288358297838601674e-01 2.770858440538391254e-01
+9.637524161478506768e-01 8.353882936883590959e-01 2.800376262549509332e-01
+9.620231537308009395e-01 8.419407901977008502e-01 2.830554448577937698e-01
+9.602104885023859948e-01 8.485116373841136150e-01 2.861325388392048086e-01
+9.583576301078738924e-01 8.550807238511934916e-01 2.892681513706822360e-01
+9.564117528707279936e-01 8.616719638797333269e-01 2.924557053792812833e-01
+9.544348419615947821e-01 8.682572954460299197e-01 2.956947937778980906e-01
+9.523487086523741985e-01 8.748712522095133393e-01 2.989788164145827376e-01
+9.502464564071694264e-01 8.814728114137494464e-01 3.023077648025994102e-01
+9.480141307284709606e-01 8.881110895508603775e-01 3.056751963404329420e-01
+9.457819798963852387e-01 8.947301765899248194e-01 3.090811208408512645e-01
+9.434198646152930356e-01 9.013849121338212145e-01 3.125200216900483885e-01
+9.410286159691669816e-01 9.080328518084608280e-01 3.159906396320988908e-01
+9.385331275251967975e-01 9.147047487143539213e-01 3.194893313796646206e-01
+9.359711083432949996e-01 9.213848126149789541e-01 3.230138415459749002e-01
+9.333375985220991877e-01 9.280748341844049509e-01 3.265615469169362850e-01
+9.305915654403119630e-01 9.347905093445134650e-01 3.301299810381577715e-01
+9.278142496620381818e-01 9.414998557883345054e-01 3.337168327083647745e-01
+9.248899165263079203e-01 9.482470197415310276e-01 3.373199677733378365e-01
+9.219411401959984875e-01 9.549849147932994997e-01 3.409370492608514991e-01
+9.188613878011584468e-01 9.617532494963948464e-01 3.445662997232426528e-01
+9.156931782520092433e-01 9.685354904254356301e-01 3.482056900726151483e-01
+9.124490701578419349e-01 9.753266872784461805e-01 3.518533597970244786e-01
+9.090418416674036495e-01 9.821574063216705897e-01 3.555078064299531104e-01]; 
+
+   case 'tur' 
+      RGB = [9.128247827303703765e-01 9.639053479101408195e-01 6.723488894068933019e-01
+9.105541439463002984e-01 9.592872094872512134e-01 6.663907644186453094e-01
+9.082861583229014935e-01 9.546805250318116665e-01 6.604691147501789983e-01
+9.060452334346256187e-01 9.500783067250512248e-01 6.545538618591559832e-01
+9.038150489008132116e-01 9.454849862587190179e-01 6.486649327173524826e-01
+9.016037749037892901e-01 9.408980925645457072e-01 6.427923205892623892e-01
+8.994100526612220925e-01 9.363178430715828338e-01 6.369376634451241470e-01
+8.972283335855062436e-01 9.317456838096750404e-01 6.311075587918794083e-01
+8.950696728809198754e-01 9.271782394664687121e-01 6.252888115672152747e-01
+8.929173737868275618e-01 9.226202315494650419e-01 6.195011901939884158e-01
+8.907923116926522722e-01 9.180653547565199579e-01 6.137200788543796248e-01
+8.886692522817520867e-01 9.135209242332905655e-01 6.079750370293484085e-01
+8.865762636352767512e-01 9.089784066893161762e-01 6.022333770048255985e-01
+8.844822115233714754e-01 9.044469910654970857e-01 5.965311430834745465e-01
+8.824197090505849772e-01 8.999166548769963470e-01 5.908308404756164034e-01
+8.803543805345617201e-01 8.953977033216384829e-01 5.851717778972109762e-01
+8.783207074075700671e-01 8.908794045328807254e-01 5.795148392301145979e-01
+8.762837291194094380e-01 8.863723903264537629e-01 5.738994936029852001e-01
+8.742771906432560414e-01 8.818660105043367725e-01 5.682879912596860983e-01
+8.722681388310039585e-01 8.773704198332279436e-01 5.627170493987142530e-01
+8.702869566172963811e-01 8.728758815872331711e-01 5.571531747195710427e-01
+8.683053185700908561e-01 8.683912265313378231e-01 5.516275115467151879e-01
+8.663476627856837586e-01 8.639084851022803546e-01 5.461135394992869818e-01
+8.643928371591906856e-01 8.594343049131268897e-01 5.406342206369587622e-01
+8.624568202066339451e-01 8.549633517080399425e-01 5.351725180271732496e-01
+8.605281096749168857e-01 8.504992167172934492e-01 5.297408107341389227e-01
+8.586117879987910095e-01 8.460400804193519697e-01 5.243338350869022335e-01
+8.567083921128474389e-01 8.415855961633933457e-01 5.189512185545770429e-01
+8.548097683783190126e-01 8.371383437933764826e-01 5.136015164012288636e-01
+8.529307767408889074e-01 8.326931553267608033e-01 5.082696912104300857e-01
+8.510506087990278301e-01 8.282569318779919865e-01 5.029770800265680464e-01
+8.491921882796159560e-01 8.238216896030918779e-01 4.977007922336022516e-01
+8.473354714528938958e-01 8.193941476796476886e-01 4.924611248003303854e-01
+8.454893810507302376e-01 8.149710832043290942e-01 4.872494055687389136e-01
+8.436548921629284381e-01 8.105519834307682858e-01 4.820650051378080891e-01
+8.418197380538857688e-01 8.061410299518165790e-01 4.769199747107543685e-01
+8.400053197367541857e-01 8.017304745289870471e-01 4.717941759727964368e-01
+8.381909179373602248e-01 7.973275360052080041e-01 4.667076177307682427e-01
+8.363830265089613469e-01 7.929297607375542789e-01 4.616544156277210820e-01
+8.345877920103869085e-01 7.885347495856604993e-01 4.566293264683093933e-01
+8.327919089080556558e-01 7.841472126590459668e-01 4.516448413369297810e-01
+8.310063135234079246e-01 7.797629900031863848e-01 4.466914503101058753e-01
+8.292275089883606176e-01 7.753832051359705879e-01 4.417727747802380756e-01
+8.274479714210091208e-01 7.710105395274703399e-01 4.368957512003675547e-01
+8.256785592470122781e-01 7.666407630966191045e-01 4.320514550589309999e-01
+8.239135967944541949e-01 7.622758578672201857e-01 4.272453035219374029e-01
+8.221475640634913207e-01 7.579178098056661428e-01 4.224823211006376589e-01
+8.203879070453153899e-01 7.535636173491093714e-01 4.177568735562176006e-01
+8.186335117171099629e-01 7.492135470811618347e-01 4.130705335781763021e-01
+8.168774297351566460e-01 7.448701849739395309e-01 4.084293549358841147e-01
+8.151208269598283485e-01 7.405329639445877854e-01 4.038328842986566580e-01
+8.133730042127403914e-01 7.361980289394938204e-01 3.992747817294182155e-01
+8.116225817355652294e-01 7.318697849631130570e-01 3.947642928691043052e-01
+8.098694933912269356e-01 7.275481580762414024e-01 3.903019868836329342e-01
+8.081161421647475862e-01 7.232320558774254504e-01 3.858867812020280175e-01
+8.063663538470418057e-01 7.189197605534187741e-01 3.815168716651668457e-01
+8.046125622407066524e-01 7.146142683294098852e-01 3.771981838442269308e-01
+8.028545343811845925e-01 7.103155798131343124e-01 3.729315169481128289e-01
+8.010919901003339394e-01 7.060237163039633224e-01 3.687177325408004802e-01
+7.993300055097595225e-01 7.017364019961147559e-01 3.645545873969476269e-01
+7.975634994838864955e-01 6.974556802865253813e-01 3.604460667960328046e-01
+7.957906047709230046e-01 6.931822615073386373e-01 3.563940392198953200e-01
+7.940108757837693876e-01 6.889162546167795220e-01 3.523995277667577586e-01
+7.922238209776574225e-01 6.846577925964051348e-01 3.484635956840971271e-01
+7.904293753935112132e-01 6.804068218754933950e-01 3.445871200261476641e-01
+7.886299371669703850e-01 6.761621751401072355e-01 3.407699499113064912e-01
+7.868208547545553211e-01 6.719258532155115704e-01 3.370151794848580962e-01
+7.850015016585555339e-01 6.676980777850795024e-01 3.333239143922641090e-01
+7.831712152651345571e-01 6.634790940463787257e-01 3.296972647086952590e-01
+7.813292995863233559e-01 6.592691702526117803e-01 3.261363364073748827e-01
+7.794750283869652518e-01 6.550685970372218669e-01 3.226422224503434077e-01
+7.776076486673221266e-01 6.508776865233487641e-01 3.192159935965748763e-01
+7.757263844650232887e-01 6.466967712234903409e-01 3.158586890319579621e-01
+7.738304409335882150e-01 6.425262027384857078e-01 3.125713069333992955e-01
+7.719190086491207747e-01 6.383663502685200664e-01 3.093547950848793415e-01
+7.699919228068800026e-01 6.342172763144198200e-01 3.062099646060428282e-01
+7.680475840592058123e-01 6.300797563557358760e-01 3.031377731717001534e-01
+7.660850744742599971e-01 6.259542495514858196e-01 3.001389551573931946e-01
+7.641036016288820232e-01 6.218411653176698639e-01 2.972141439455896483e-01
+7.621023798026289597e-01 6.177409214840726692e-01 2.943638837738908332e-01
+7.600806343242360041e-01 6.136539422033919777e-01 2.915886230831420400e-01
+7.580376057793873912e-01 6.095806558220696614e-01 2.888887086342720734e-01
+7.559725540291885038e-01 6.055214927394206859e-01 2.862643804685457427e-01
+7.538847619930633126e-01 6.014768832813116584e-01 2.837157677714013393e-01
+7.517735391550399715e-01 5.974472556137478962e-01 2.812428856843471325e-01
+7.496385821697367779e-01 5.934328401156596655e-01 2.788457594157026098e-01
+7.474790247249349928e-01 5.894341791373612915e-01 2.765241346674250367e-01
+7.452941571551999766e-01 5.854517449359323278e-01 2.742776443121395791e-01
+7.430834135426160891e-01 5.814859431780246002e-01 2.721058338160937673e-01
+7.408462686359136296e-01 5.775371675495697410e-01 2.700081319859798934e-01
+7.385822390693008721e-01 5.736057983656746018e-01 2.679838537450121017e-01
+7.362908841899132861e-01 5.696922013455091305e-01 2.660322037116858995e-01
+7.339718065076965559e-01 5.657967265562297010e-01 2.641522805055408485e-01
+7.316246517864810617e-01 5.619197075270785380e-01 2.623430816971141777e-01
+7.292491087989990683e-01 5.580614605321673194e-01 2.606035093141773062e-01
+7.268449087719649482e-01 5.542222840379915638e-01 2.589323758133949549e-01
+7.244119971505563749e-01 5.504023530996886571e-01 2.573286095051418587e-01
+7.219503397818252122e-01 5.466018316756788842e-01 2.557911025974954899e-01
+7.194594088198653647e-01 5.428211930643935812e-01 2.543180251101427314e-01
+7.169390970998404944e-01 5.390606612983260826e-01 2.529078914226555730e-01
+7.143893337983732161e-01 5.353204418367376594e-01 2.515591605975798783e-01
+7.118100825627617922e-01 5.316007218689121627e-01 2.502702433238302993e-01
+7.092013395547599464e-01 5.279016707079033921e-01 2.490395087311264022e-01
+7.065632761648270588e-01 5.242233436125348645e-01 2.478655721838471937e-01
+7.038960056028840118e-01 5.205658319141027723e-01 2.467469222620103930e-01
+7.011993601253575514e-01 5.169294192806536126e-01 2.456813814978507926e-01
+6.984734491802424561e-01 5.133142072042380377e-01 2.446672141412145063e-01
+6.957184043559518916e-01 5.097202822466132544e-01 2.437026738057547215e-01
+6.929343773945654261e-01 5.061477167394171639e-01 2.427860085204449625e-01
+6.901216982990902027e-01 5.025964514073363310e-01 2.419159412674971588e-01
+6.872804633072713276e-01 4.990665929836670123e-01 2.410905423858894503e-01
+6.844107686966893755e-01 4.955582518851005536e-01 2.403077709414531138e-01
+6.815128311469199618e-01 4.920714492259936068e-01 2.395658950635757289e-01
+6.785868785067301623e-01 4.886061954699182919e-01 2.388631970725307307e-01
+6.756332326667190413e-01 4.851624213327032087e-01 2.381983436213906957e-01
+6.726521288960277678e-01 4.817401209176369048e-01 2.375696985886235346e-01
+6.696437188359446457e-01 4.783393588339723279e-01 2.369751854422654791e-01
+6.666082635296274317e-01 4.749601080715157297e-01 2.364131671114735878e-01
+6.635460289039749604e-01 4.716023339061982678e-01 2.358820311548202042e-01
+6.604573673748913576e-01 4.682659130292578520e-01 2.353807610155446706e-01
+6.573424797961275878e-01 4.649508592384817285e-01 2.349074379402631418e-01
+6.542016086091390070e-01 4.616571492422122946e-01 2.344603126221481149e-01
+6.510350327978842166e-01 4.583847209004847101e-01 2.340378795902509079e-01
+6.478430515953373936e-01 4.551334824230311438e-01 2.336388774485689268e-01
+6.446259633611755024e-01 4.519033296020167900e-01 2.332622032236857934e-01
+6.413839940492124247e-01 4.486942500114745047e-01 2.329058642884746511e-01
+6.381174276440877424e-01 4.455061586981217681e-01 2.325684660088059297e-01
+6.348265500932614991e-01 4.423389620941622913e-01 2.322486831842977550e-01
+6.315116605695774155e-01 4.391925158791953887e-01 2.319458531661305334e-01
+6.281730104223729461e-01 4.360667833034455043e-01 2.316579279478628295e-01
+6.248108867019236401e-01 4.329616581049553492e-01 2.313836187886625928e-01
+6.214255770673621226e-01 4.298770280576157399e-01 2.311216752923600515e-01
+6.180173538237878628e-01 4.268127440894281532e-01 2.308715541128374960e-01
+6.145865084649400067e-01 4.237687269357882092e-01 2.306313089541623396e-01
+6.111333338376842006e-01 4.207448478787260138e-01 2.303997483300764260e-01
+6.076581198732585731e-01 4.177409699743503957e-01 2.301757903742778777e-01
+6.041611292458852756e-01 4.147569442408376994e-01 2.299587629276800271e-01
+6.006426901866908086e-01 4.117926430199113641e-01 2.297469460659757323e-01
+5.971031071270087587e-01 4.088479120598013661e-01 2.295392371763493311e-01
+5.935426680352169360e-01 4.059225898260850895e-01 2.293347588094398759e-01
+5.899616653081597439e-01 4.030165124281641087e-01 2.291325734316880802e-01
+5.863604503326285133e-01 4.001295067793814719e-01 2.289312648345211421e-01
+5.827393462725786177e-01 3.972613890222796984e-01 2.287298138873416486e-01
+5.790986411902667719e-01 3.944119738157387811e-01 2.285275119372468522e-01
+5.754386920094946012e-01 3.915810608797961612e-01 2.283231701874827158e-01
+5.717598595710956522e-01 3.887684389212705538e-01 2.281156877135243621e-01
+5.680624888217489232e-01 3.859738913687448258e-01 2.279041499218198430e-01
+5.643468987836690598e-01 3.831972016166527162e-01 2.276878398717704366e-01
+5.606135014398240246e-01 3.804381236067138072e-01 2.274655664744977823e-01
+5.568626686009898741e-01 3.776964124183660454e-01 2.272364567122592827e-01
+5.530947703612836275e-01 3.749718169415875435e-01 2.269997025952595338e-01
+5.493102061694418170e-01 3.722640707136085636e-01 2.267544107214977123e-01
+5.455093844474366849e-01 3.695728971647626593e-01 2.264997151134776621e-01
+5.416927086216569709e-01 3.668980144097471752e-01 2.262348350480499204e-01
+5.378606217947595747e-01 3.642391205981750923e-01 2.259588836659274236e-01
+5.340135354481294616e-01 3.615959178208362768e-01 2.256711679956127647e-01
+5.301518754638107067e-01 3.589680973433583278e-01 2.253709864348782954e-01
+5.262761094769513592e-01 3.563553292394111560e-01 2.250575362145477709e-01
+5.223867172868102982e-01 3.537572724565644089e-01 2.247300369556790578e-01
+5.184841017313481792e-01 3.511736091955309780e-01 2.243880288453043437e-01
+5.145687147834636654e-01 3.486039985632924942e-01 2.240309158662728284e-01
+5.106411440519553757e-01 3.460480410893026493e-01 2.236577184811773256e-01
+5.067017881423235837e-01 3.435054056903972253e-01 2.232681227570667559e-01
+5.027510796252681047e-01 3.409757445575836710e-01 2.228617265136721426e-01
+4.987895070653633467e-01 3.384586834157125024e-01 2.224379910665530979e-01
+4.948177548651969127e-01 3.359537625951555251e-01 2.219958720410014630e-01
+4.908360971463728295e-01 3.334606870942352086e-01 2.215355358785864315e-01
+4.868450056329213793e-01 3.309790783774143597e-01 2.210565950309411609e-01
+4.828450375686827445e-01 3.285085184570587513e-01 2.205584694191147777e-01
+4.788368359138705510e-01 3.260485487451708631e-01 2.200404115431305319e-01
+4.748206472212548879e-01 3.235988770790072522e-01 2.195027100981302715e-01
+4.707969362808618885e-01 3.211591169778729160e-01 2.189450971836008897e-01
+4.667662693795122109e-01 3.187288356425135860e-01 2.183670869460304087e-01
+4.627293116701075015e-01 3.163075541790801304e-01 2.177680072916463594e-01
+4.586862340695841422e-01 3.138950081558932736e-01 2.171483462825098965e-01
+4.546374811311343911e-01 3.114908131915107847e-01 2.165079490118044792e-01
+4.505834924512453488e-01 3.090945859801553230e-01 2.158466824363790559e-01
+4.465251651502277208e-01 3.067057384379430762e-01 2.151634647284257906e-01
+4.424624800332205288e-01 3.043240886593481798e-01 2.144591818414338102e-01
+4.383958498551490668e-01 3.019492632236420726e-01 2.137337799541155214e-01
+4.343256784780819557e-01 2.995808923379119637e-01 2.129872269867968959e-01
+4.302525491830334059e-01 2.972185251864662980e-01 2.122191462426318287e-01
+4.261769801706936645e-01 2.948617395754311588e-01 2.114293130588631442e-01
+4.220990387565126678e-01 2.925103169029278360e-01 2.106183606559913768e-01
+4.180190866768337399e-01 2.901639064725308748e-01 2.097863381928281035e-01
+4.139374748855114139e-01 2.878221627482029921e-01 2.089333114395358071e-01
+4.098546564000305481e-01 2.854846942476605975e-01 2.080591616116443943e-01
+4.057712419033978057e-01 2.831510381788182595e-01 2.071635039021454405e-01
+4.016871580256169971e-01 2.808210427866469350e-01 2.062471500335373853e-01
+3.976027082875563945e-01 2.784943860456884357e-01 2.053102247884384113e-01
+3.935181846712299536e-01 2.761707517515646915e-01 2.043528642900468983e-01
+3.894338675796663596e-01 2.738498295626687340e-01 2.033752150347126197e-01
+3.853501485284500094e-01 2.715312592611229259e-01 2.023772355615125473e-01
+3.812675049241057712e-01 2.692146423201499661e-01 2.013587500039031863e-01
+3.771858334106182320e-01 2.668998447434733912e-01 2.003204988638387918e-01
+3.731053664536302938e-01 2.645865804728991244e-01 1.992626621753412208e-01
+3.690263252725575205e-01 2.622745690957888343e-01 1.981854256387428070e-01
+3.649489199677356521e-01 2.599635357439662453e-01 1.970889798104242807e-01
+3.608733496668369289e-01 2.576532109746325627e-01 1.959735193223784977e-01
+3.567998026886545215e-01 2.553433306346174492e-01 1.948392421320772061e-01
+3.527288062385475209e-01 2.530334781151396539e-01 1.936858449182176090e-01
+3.486601920186409020e-01 2.507235512004114542e-01 1.925140265725779620e-01
+3.445940882588859333e-01 2.484133136793199026e-01 1.913240314183973223e-01
+3.405306410460574029e-01 2.461025213487854080e-01 1.901160637330516767e-01
+3.364699867832531277e-01 2.437909343510991644e-01 1.888903276956251931e-01
+3.324122524192171801e-01 2.414783169649092898e-01 1.876470268273142949e-01
+3.283575556825768516e-01 2.391644373879673879e-01 1.863863634598928731e-01
+3.243060053196711312e-01 2.368490675124892975e-01 1.851085382313104599e-01
+3.202577013347079893e-01 2.345319826939236685e-01 1.838137496073975197e-01
+3.162127352310978301e-01 2.322129615138344705e-01 1.825021934285724068e-01
+3.121713481873937823e-01 2.298917159046080516e-01 1.811738589048320913e-01
+3.081335147958294551e-01 2.275680750195018809e-01 1.798290697596431065e-01
+3.040992288572926250e-01 2.252418581754896398e-01 1.784681064582642751e-01
+3.000685503066236048e-01 2.229128543385760497e-01 1.770911493801810288e-01
+2.960415318405872354e-01 2.205808544095470558e-01 1.756983743063298686e-01
+2.920182191423447704e-01 2.182456509647304199e-01 1.742899520962044868e-01
+2.879986511013646333e-01 2.159070379936562922e-01 1.728660483803914072e-01
+2.839828600283449411e-01 2.135648106336759944e-01 1.714268232671206371e-01
+2.799708718647850314e-01 2.112187649015158653e-01 1.699724310614039724e-01
+2.759627063869375951e-01 2.088686974216710790e-01 1.685030199953476415e-01
+2.719583774039363577e-01 2.065144051514603007e-01 1.670187319682087390e-01
+2.679578929499804030e-01 2.041556851024882158e-01 1.655197022947889340e-01
+2.639612554705231817e-01 2.017923340581795344e-01 1.640060594607524180e-01
+2.599684620025124460e-01 1.994241482869618665e-01 1.624779248834790635e-01
+2.559795043487851918e-01 1.970509232505948671e-01 1.609354126770728421e-01
+2.519943692468365470e-01 1.946724533070429697e-01 1.593786294201690046e-01
+2.480130385322499298e-01 1.922885314071993146e-01 1.578076739252100846e-01
+2.440354892972040890e-01 1.898989487846577950e-01 1.562226370078938775e-01
+2.400616940445691738e-01 1.875034946376172018e-01 1.546236012555405048e-01
+2.360916208382524140e-01 1.851019558018774935e-01 1.530106407931814128e-01
+2.321252334505864434e-01 1.826941164137449169e-01 1.513838210462468969e-01
+2.281624915077672400e-01 1.802797575614995262e-01 1.497431984988283338e-01
+2.242033506345226801e-01 1.778586569239049842e-01 1.480888204466117852e-01
+2.202477625994911925e-01 1.754305883940150690e-01 1.464207247437575854e-01
+2.162956754630863121e-01 1.729953216862958332e-01 1.447389395432186476e-01
+2.123470337300349953e-01 1.705526219247719688e-01 1.430434830302904636e-01
+2.084017785092666109e-01 1.681022492095620435e-01 1.413343631495822261e-01
+2.044598476844710633e-01 1.656439581587243193e-01 1.396115773261282222e-01
+2.005211760994463077e-01 1.631774974218037078e-01 1.378751121820577796e-01
+1.965856988864305155e-01 1.607026079587815515e-01 1.361249399201315824e-01
+1.926533421135208923e-01 1.582190261881047944e-01 1.343610282823611279e-01
+1.887240316449029232e-01 1.557264800392861304e-01 1.325833310557416600e-01
+1.847976928565723820e-01 1.532246885529702785e-01 1.307917884786300444e-01
+1.808742494403644818e-01 1.507133617751950094e-01 1.289863286797117148e-01
+1.769536238533599426e-01 1.481921999716426241e-01 1.271668674796427312e-01
+1.730357378708484994e-01 1.456608927537091369e-01 1.253333082519507424e-01
+1.691205132766324948e-01 1.431191180966186194e-01 1.234855418704042807e-01
+1.652078727370975830e-01 1.405665412234658185e-01 1.216234467798024410e-01
+1.612977409237918991e-01 1.380028133201234297e-01 1.197468892401933882e-01
+1.573900459762036241e-01 1.354275700331004917e-01 1.178557238119506412e-01
+1.534847214366352741e-01 1.328404296837557008e-01 1.159497941721605863e-01
+1.495817088501062986e-01 1.302409911046356894e-01 1.140289343827514401e-01
+1.456809613162400874e-01 1.276288309622561901e-01 1.120929707687035870e-01
+1.417824484273444985e-01 1.250035003675231404e-01 1.101417246101454861e-01
+1.378861632611661503e-01 1.223645204774909678e-01 1.081750159008208478e-01
+1.339921324751868759e-01 1.197113766395997425e-01 1.061926684632616136e-01]; 
+
+   case 'del'
+      RGB = [6.597738601379860013e-02 1.238600499381984077e-01 2.494811599712867811e-01
+6.865757658541371544e-02 1.266324956800233548e-01 2.555762447808356264e-01
+7.132312021900141796e-02 1.293951489111998809e-01 2.616639066260320057e-01
+7.396584278365506138e-02 1.321405798946303223e-01 2.677947952348482819e-01
+7.658629323761953489e-02 1.348691618055914976e-01 2.739690401973952083e-01
+7.919241629978698849e-02 1.375884267331394517e-01 2.801420635219376565e-01
+8.176925318412744947e-02 1.402841919021537431e-01 2.864049855987979565e-01
+8.433406612792618273e-02 1.429731754896261531e-01 2.926562894753481636e-01
+8.687299291862357609e-02 1.456421509856402619e-01 2.989801852647154812e-01
+8.939564312621503528e-02 1.483008215820366127e-01 3.053194113218902772e-01
+9.189721302857964402e-02 1.509448355999061520e-01 3.117030007960572280e-01
+9.437767086491094526e-02 1.535746031892240571e-01 3.181307112978130625e-01
+9.684032408298676176e-02 1.561940161218882128e-01 3.245815662969073756e-01
+9.927796547462605647e-02 1.587964393005784070e-01 3.310975577575396844e-01
+1.016993930631445442e-01 1.613915446377360008e-01 3.376235806086802516e-01
+1.040929763606517067e-01 1.639684016677392386e-01 3.442267209045115073e-01
+1.064700341792961802e-01 1.665394889067980111e-01 3.508360219569039429e-01
+1.088176547667218386e-01 1.690928617928972866e-01 3.575240510639015601e-01
+1.111462403295262191e-01 1.716403013777595965e-01 3.642247640300367850e-01
+1.134452622240499642e-01 1.741726760902385374e-01 3.709940519253031033e-01
+1.157201477866866002e-01 1.766970342921256598e-01 3.777940670973845005e-01
+1.179671104159276951e-01 1.792114205608784372e-01 3.846393215051533421e-01
+1.201817230210445731e-01 1.817136143480379551e-01 3.915459113873127617e-01
+1.223722204783651013e-01 1.842136886386882277e-01 3.984598273467554463e-01
+1.245183567208241193e-01 1.866951930885134003e-01 4.054791326498645709e-01
+1.266365389448252943e-01 1.891762365105242871e-01 4.125046892271796994e-01
+1.287143460345438750e-01 1.916485918438771141e-01 4.195883119105888182e-01
+1.307469548160320461e-01 1.941117894471887095e-01 4.267380618771365319e-01
+1.327408430973604225e-01 1.965752427165133320e-01 4.339060811804626439e-01
+1.346828243039070450e-01 1.990323873082787132e-01 4.411366760117488295e-01
+1.365667394636138066e-01 2.014836986376687955e-01 4.484350095699139449e-01
+1.383960163689361422e-01 2.039374403932631141e-01 4.557622019510663702e-01
+1.401636755967774206e-01 2.063944663974329741e-01 4.631231418544201062e-01
+1.418540865672596740e-01 2.088512567417482035e-01 4.705504424282677678e-01
+1.434598643146114128e-01 2.113116730887077965e-01 4.780359058662089766e-01
+1.449764155851626657e-01 2.137823044275377615e-01 4.855569960092488979e-01
+1.463910004146321830e-01 2.162663403203769485e-01 4.931143386027379560e-01
+1.476886377469379952e-01 2.187680022007208458e-01 5.007063827574367298e-01
+1.488517278855215897e-01 2.212928540992544768e-01 5.083284550145572567e-01
+1.498596541692162332e-01 2.238481772327865493e-01 5.159715446979967757e-01
+1.506883975687731414e-01 2.264434023743985280e-01 5.236207927150543506e-01
+1.513102256748371788e-01 2.290905757285599531e-01 5.312536911875026524e-01
+1.516842522456439690e-01 2.318030303219635324e-01 5.388545690381982833e-01
+1.517570170754133085e-01 2.345981922008114062e-01 5.464014367414956608e-01
+1.515076197810979464e-01 2.375036749636269540e-01 5.537960248334482527e-01
+1.508527167578624095e-01 2.405440732043884755e-01 5.610095372512794443e-01
+1.497779955302820376e-01 2.437529689807156341e-01 5.679039092169722025e-01
+1.482412957217069116e-01 2.471597695361844038e-01 5.743778793359424206e-01
+1.462677401356168583e-01 2.507850610764148502e-01 5.802953371129300209e-01
+1.439355627545357286e-01 2.546290083660951442e-01 5.855507465326762473e-01
+1.413540769625598603e-01 2.586695514989866829e-01 5.901033497204623002e-01
+1.386407864858154870e-01 2.628687111034194723e-01 5.939785160116007878e-01
+1.358917366388572578e-01 2.671843825843605580e-01 5.972486725556511722e-01
+1.331956301615234428e-01 2.715742302472205494e-01 6.000063534918327335e-01
+1.305811350178066321e-01 2.760102973743540078e-01 6.023428893290788677e-01
+1.280671927186234904e-01 2.804711462805791200e-01 6.043358297286517411e-01
+1.256919911974779258e-01 2.849349146429925872e-01 6.060559435528747319e-01
+1.234353694092780451e-01 2.893960415099317007e-01 6.075503879105464966e-01
+1.213123684738988406e-01 2.938438245262708359e-01 6.088643085732736715e-01
+1.193314037280503725e-01 2.982710543730990871e-01 6.100344852684282948e-01
+1.174733533629070403e-01 3.026784028742006138e-01 6.110815570440700784e-01
+1.157410513288365805e-01 3.070626658343806881e-01 6.120282423760157187e-01
+1.141526088065836497e-01 3.114180400183615416e-01 6.129002396427197796e-01
+1.126916634208409429e-01 3.157472412451859389e-01 6.137061650582799066e-01
+1.113553786510952659e-01 3.200503527841166984e-01 6.144572065766925606e-01
+1.101437722183151724e-01 3.243271585465217766e-01 6.151637952792941011e-01
+1.090564770800171446e-01 3.285777842283311712e-01 6.158346267162948529e-01
+1.080928143315710299e-01 3.328026048887181565e-01 6.164769721944358682e-01
+1.072518450875257212e-01 3.370021743369620570e-01 6.170969325182951160e-01
+1.065324069530126649e-01 3.411771714425693713e-01 6.176996445247795453e-01
+1.059331395146229648e-01 3.453283595087877078e-01 6.182894491232916456e-01
+1.054525023039967757e-01 3.494565556897754055e-01 6.188700280655170527e-01
+1.050887878891080540e-01 3.535626081054415448e-01 6.194445153697799578e-01
+1.048401320993113395e-01 3.576473788404232468e-01 6.200155882238653771e-01
+1.047045228648097182e-01 3.617117314301156461e-01 6.205855412748909616e-01
+1.046798087267215294e-01 3.657565217601439489e-01 6.211563474636030424e-01
+1.047637077327939481e-01 3.697825915556448573e-01 6.217297079493111500e-01
+1.049538171612311999e-01 3.737907638293131996e-01 6.223070931774267178e-01
+1.052476243004594747e-01 3.777818398051627224e-01 6.228897767433481114e-01
+1.056425183464732021e-01 3.817565969485811617e-01 6.234788633863599383e-01
+1.061358033549051061e-01 3.857157878203879009e-01 6.240753121902191669e-01
+1.067247120960378159e-01 3.896601395393941014e-01 6.246799558608577829e-01
+1.074064206019045564e-01 3.935903536891926513e-01 6.252935167860671495e-01
+1.081780631610760601e-01 3.975071065441324047e-01 6.259166204489629015e-01
+1.090367475038964695e-01 4.014110495195324368e-01 6.265498066600397875e-01
+1.099820192670150909e-01 4.053023125398828030e-01 6.271951607472914247e-01
+1.110081883132479630e-01 4.091820642340333603e-01 6.278512759575444191e-01
+1.121122195896028517e-01 4.130509161123952500e-01 6.285183732165030568e-01
+1.132912658654391114e-01 4.169094262530252948e-01 6.291967191746730137e-01
+1.145425291517750410e-01 4.207581307564207673e-01 6.298865324820219769e-01
+1.158632717089364272e-01 4.245975446528400532e-01 6.305879875238334931e-01
+1.172508261265178542e-01 4.284281627655473490e-01 6.313012175820684746e-01
+1.187026044305651562e-01 4.322504605241775932e-01 6.320263175158151725e-01
+1.202170218035645832e-01 4.360647043028175740e-01 6.327640308933485391e-01
+1.217903323311140817e-01 4.398716102802121553e-01 6.335133964865322653e-01
+1.234201965028123016e-01 4.436716084893622125e-01 6.342743647718233069e-01
+1.251044458168622253e-01 4.474650989352985664e-01 6.350469034989063566e-01
+1.268410231661077081e-01 4.512524653607909442e-01 6.358309517935993860e-01
+1.286279862353579828e-01 4.550340757553759663e-01 6.366264210299322768e-01
+1.304635102569667859e-01 4.588102828035847680e-01 6.374331955697576380e-01
+1.323456332495375476e-01 4.625814799269595823e-01 6.382509181299536039e-01
+1.342726301857550264e-01 4.663480223415985004e-01 6.390792893119938700e-01
+1.362431133778941039e-01 4.701102048314840798e-01 6.399181612927934415e-01
+1.382557801777440920e-01 4.738683163523436659e-01 6.407673303740510917e-01
+1.403094518927116008e-01 4.776226319622609018e-01 6.416265687705522414e-01
+1.424030742552521711e-01 4.813734129303259279e-01 6.424956248215036858e-01
+1.445357177858233311e-01 4.851209067888150872e-01 6.433742231671184530e-01
+1.467060787915918652e-01 4.888654617396300250e-01 6.442615910488664888e-01
+1.489131851676200047e-01 4.926073688646966375e-01 6.451570946472290347e-01
+1.511571091366653297e-01 4.963466938037996434e-01 6.460609578935421204e-01
+1.534374568113274773e-01 5.000836224936368035e-01 6.469728308538383876e-01
+1.557539606313337044e-01 5.038183265492227614e-01 6.478923408808500151e-01
+1.581064802328551455e-01 5.075509629447428894e-01 6.488190927082100323e-01
+1.604950035510952222e-01 5.112816736254882644e-01 6.497526685562985405e-01
+1.629196481906860228e-01 5.150105850470044766e-01 6.506926282565553832e-01
+1.653806563676609720e-01 5.187378093247897448e-01 6.516385018000171447e-01
+1.678770878978581016e-01 5.224637768298545648e-01 6.525882706071722827e-01
+1.704107945748090658e-01 5.261882349061756114e-01 6.535428899563763272e-01
+1.729824594318147002e-01 5.299112360468477556e-01 6.545018545237717422e-01
+1.755929057918094727e-01 5.336328137580849118e-01 6.554646382342502742e-01
+1.782431006664247641e-01 5.373529815601206794e-01 6.564306947203235598e-01
+1.809341585475496006e-01 5.410717318764055594e-01 6.573994578824640111e-01
+1.836673455941881250e-01 5.447890348032889962e-01 6.583703425703313350e-01
+1.864440842101210971e-01 5.485048367520860557e-01 6.593427454071065785e-01
+1.892659579998643982e-01 5.522190589552509188e-01 6.603160457822994100e-01
+1.921347170798090864e-01 5.559315958284012371e-01 6.612896070418273764e-01
+1.950522837092731887e-01 5.596423131801995243e-01 6.622627779079297561e-01
+1.980207581910957138e-01 5.633510462626485360e-01 6.632348941655241692e-01
+2.010424249735310309e-01 5.670575976553166031e-01 6.642052806559789468e-01
+2.041197588637720939e-01 5.707617349784390726e-01 6.651732536238323945e-01
+2.072554312381834074e-01 5.744631884318825987e-01 6.661381234667468343e-01
+2.104523161046616408e-01 5.781616481597345869e-01 6.670991979438091191e-01
+2.137134958380619842e-01 5.818567614439515978e-01 6.680557859020190836e-01
+2.170422663699277943e-01 5.855481297352551628e-01 6.690072015853253395e-01
+2.204421415686979580e-01 5.892353055354571101e-01 6.699527695945174388e-01
+2.239168564955728025e-01 5.929177891529354705e-01 6.708918305694538953e-01
+2.274703691651913662e-01 5.965950253621812305e-01 6.718237476670261277e-01
+2.311068603787596043e-01 6.002664000095238039e-01 6.727479139084245885e-01
+2.348307311320150803e-01 6.039312366204897531e-01 6.736637604671461554e-01
+2.386465970323070063e-01 6.075887930799791503e-01 6.745707659639463838e-01
+2.425592790908820962e-01 6.112382584746600678e-01 6.754684668258670310e-01
+2.465737901908315322e-01 6.148787502077949219e-01 6.763564687525340791e-01
+2.506953164731830497e-01 6.185093115199363778e-01 6.772344593131256474e-01
+2.549296306833234715e-01 6.221293277287609502e-01 6.780979140255732895e-01
+2.592822774336291380e-01 6.257372346725570411e-01 6.789506539234843041e-01
+2.637588638514070660e-01 6.293318265564150638e-01 6.797927409484227912e-01
+2.683650223312705752e-01 6.329118213522958447e-01 6.806243803889014954e-01
+2.731063499524681304e-01 6.364758627686015746e-01 6.814459485792905280e-01
+2.779906740187598757e-01 6.400228375684388071e-01 6.822520389699539001e-01
+2.830218658907085461e-01 6.435508363165360901e-01 6.830490580497422526e-01
+2.882048880496008714e-01 6.470582889109053326e-01 6.838383084593062655e-01
+2.935458083139746988e-01 6.505436502020417455e-01 6.846186591669699562e-01
+2.990503892938236596e-01 6.540052313531840023e-01 6.853899295935115266e-01
+3.047196724248331101e-01 6.574412743642752410e-01 6.861585944188198782e-01
+3.105583191416750322e-01 6.608501423712110912e-01 6.869242652383956704e-01
+3.165691502323280671e-01 6.642301693361829518e-01 6.876887756715628353e-01
+3.227495057337754214e-01 6.675799504508616034e-01 6.884592417367911832e-01
+3.291028263869451576e-01 6.708979305506697077e-01 6.892345854413708395e-01
+3.356230778965553774e-01 6.741831128414313978e-01 6.900227469259155866e-01
+3.423073210907732200e-01 6.774345078849072221e-01 6.908268664523685709e-01
+3.491497562850178760e-01 6.806514618485436374e-01 6.916515776970183493e-01
+3.561412724149042863e-01 6.838337923407922236e-01 6.925029303903535993e-01
+3.632736859780383298e-01 6.869814453814443445e-01 6.933849146347551562e-01
+3.705348353526126681e-01 6.900949744532235419e-01 6.943034006383217438e-01
+3.779122643387600178e-01 6.931752240960002975e-01 6.952632699407041983e-01
+3.853938489959773395e-01 6.962232375904670034e-01 6.962682692318554745e-01
+3.929633165309669440e-01 6.992408157519413026e-01 6.973239952904880523e-01
+4.006094014150666793e-01 7.022293785228771457e-01 6.984322280579721154e-01
+4.083159356621580693e-01 7.051912169731731073e-01 6.995972410351208870e-01
+4.160701459275524816e-01 7.081283984755933902e-01 7.008208963157127602e-01
+4.238620058191452378e-01 7.110427636723841704e-01 7.021034222566255867e-01
+4.316725578542053299e-01 7.139377080072604187e-01 7.034496090272048807e-01
+4.394994714751406240e-01 7.168142170649683953e-01 7.048555730206492731e-01
+4.473284906527433269e-01 7.196752689920701274e-01 7.063236640655090604e-01
+4.551495147015194864e-01 7.225233370762427221e-01 7.078541344797719681e-01
+4.629611457318438261e-01 7.253594732048370686e-01 7.094433480260243785e-01
+4.707534852399093972e-01 7.281862590349524877e-01 7.110918876863899785e-01
+4.785169352473264692e-01 7.310063519486531547e-01 7.128002486509635860e-01
+4.862541175206331334e-01 7.338201861642941193e-01 7.145637643240034809e-01
+4.939610178122765816e-01 7.366294113512334985e-01 7.163810048013540266e-01
+5.016310591672418218e-01 7.394362226143922356e-01 7.182517850494093414e-01
+5.092596479997313352e-01 7.422424836790947333e-01 7.201752147893440981e-01
+5.168502920324100636e-01 7.450484101459822206e-01 7.221473089909000720e-01
+5.244013381888714687e-01 7.478552285559243451e-01 7.241664310755349110e-01
+5.319115488689606375e-01 7.506640750099188297e-01 7.262309445597783242e-01
+5.393800515498496928e-01 7.534759997433319034e-01 7.283392250016084146e-01
+5.468044438041703703e-01 7.562923850920999502e-01 7.304903735115424457e-01
+5.541839357415714318e-01 7.591142604468823496e-01 7.326829886087474764e-01
+5.615214997302344635e-01 7.619417788590748808e-01 7.349143832677361710e-01
+5.688172658612942190e-01 7.647756983657992835e-01 7.371830791535139982e-01
+5.760715228891868378e-01 7.676167208435804579e-01 7.394876421854478243e-01
+5.832846906737159109e-01 7.704654971547720832e-01 7.418266842236616032e-01
+5.904572957555410673e-01 7.733226320830066669e-01 7.441988638633715292e-01
+5.975899498408560051e-01 7.761886890212207346e-01 7.466028864742004778e-01
+6.046833309596043593e-01 7.790641943891402077e-01 7.490375036038013912e-01
+6.117381670592270115e-01 7.819496417678519773e-01 7.515015118481881418e-01
+6.187552218007135174e-01 7.848454957475322624e-01 7.539937512752844517e-01
+6.257352823331345792e-01 7.877521954909707524e-01 7.565131034734732252e-01
+6.326791488358145532e-01 7.906701580203755464e-01 7.590584892833606157e-01
+6.395876256322543529e-01 7.935997812385013894e-01 7.616288662585695146e-01
+6.464615136961924247e-01 7.965414466975205832e-01 7.642232258900538699e-01
+6.533016043869401823e-01 7.994955221304983484e-01 7.668405906180205678e-01
+6.601086742679306285e-01 8.024623637610888149e-01 7.694800106460160105e-01
+6.668834808789664281e-01 8.054423184071207720e-01 7.721405605628438584e-01
+6.736267593487160754e-01 8.084357253933542875e-01 7.748213357696444037e-01
+6.803392197495884419e-01 8.114429182878516444e-01 7.775214487015286169e-01
+6.870215451120499361e-01 8.144642264752101068e-01 7.802400248254467430e-01
+6.936743900300211818e-01 8.174999765783720340e-01 7.829761983884004906e-01
+7.002974950415432609e-01 8.205507454139520096e-01 7.857294359175189813e-01
+7.068916498938800919e-01 8.236168074562510988e-01 7.884988108515800231e-01
+7.134582338528936418e-01 8.266982574818713125e-01 7.912831565844938853e-01
+7.199978016303433259e-01 8.297954164160811219e-01 7.940815874530331442e-01
+7.265108777000938156e-01 8.329086081072485381e-01 7.968932005645313899e-01
+7.329979578454549616e-01 8.360381599792610086e-01 7.997170690214260302e-01
+7.394595112267420278e-01 8.391844035374615984e-01 8.025522344938926800e-01
+7.458959830242087863e-01 8.423476747120355324e-01 8.053976990501692246e-01
+7.523077977331221744e-01 8.455283140156318877e-01 8.082524161470656665e-01
+7.586951667693938584e-01 8.487267253083131680e-01 8.111153620935316333e-01
+7.650577483984875027e-01 8.519434804026106978e-01 8.139856782226038145e-01
+7.713970926011407547e-01 8.551785852225586293e-01 8.168616329686009259e-01
+7.777135915287802792e-01 8.584323939893921951e-01 8.197418712821458175e-01
+7.840076454752769042e-01 8.617052627327101977e-01 8.226249282969148036e-01
+7.902796732960170045e-01 8.649975472537146937e-01 8.255092131742095551e-01
+7.965301248451132077e-01 8.683096003971411125e-01 8.283929915814087774e-01
+8.027594957590121760e-01 8.716417684881572203e-01 8.312743668855639978e-01
+8.089680559912207913e-01 8.749944751017242339e-01 8.341514052269850543e-01
+8.151567019468018982e-01 8.783679611555336164e-01 8.370217075803022544e-01
+8.213264334358614249e-01 8.817624446744987132e-01 8.398826380716230000e-01
+8.274781243204414327e-01 8.851781910186152791e-01 8.427314427493727278e-01
+8.336128134834004388e-01 8.886154231077250110e-01 8.455651044543932571e-01
+8.397317396975054749e-01 8.920743090766621863e-01 8.483803273271105505e-01
+8.458363795503203164e-01 8.955549480225133419e-01 8.511735264537213519e-01
+8.519285410708211659e-01 8.990573377468378258e-01 8.539407899678711500e-01
+8.580104271310651232e-01 9.025813506938162867e-01 8.566778627755414766e-01
+8.640844411003687497e-01 9.061267859275130565e-01 8.593803204948170515e-01
+8.701533853242351402e-01 9.096933004913555498e-01 8.620435066748899366e-01
+8.762204735799774546e-01 9.132803958502141439e-01 8.646625969293003644e-01
+8.822893382459134903e-01 9.168874047650978909e-01 8.672326784644417419e-01
+8.883640160698558219e-01 9.205134840158590848e-01 8.697488518860556628e-01
+8.944490897569347121e-01 9.241575627749747390e-01 8.722061884634622064e-01
+9.005494862654843669e-01 9.278183935417740891e-01 8.745999527261957285e-01
+9.066697518672085510e-01 9.314947526919318266e-01 8.769263428234910229e-01
+9.128147816848455331e-01 9.351852279261616552e-01 8.791818556054207257e-01
+9.189893388971293042e-01 9.388883614412766310e-01 8.813636793355511534e-01
+9.251978653035416444e-01 9.426027146413026303e-01 8.834697874077058755e-01
+9.314442876100802460e-01 9.463269403919151168e-01 8.854989876415102490e-01
+9.377318363007438595e-01 9.500598571817585603e-01 8.874509187201842231e-01
+9.440634086681402026e-01 9.538003778631106711e-01 8.893253867710815275e-01
+9.504401533195278029e-01 9.575479274112385086e-01 8.911237616446540111e-01
+9.568622268534309194e-01 9.613022612892393459e-01 8.928479377657454474e-01
+9.633289971376283178e-01 9.650634347497447640e-01 8.944999044139121391e-01
+9.698388693863758681e-01 9.688318688917866295e-01 8.960818313086871267e-01
+9.763893802744164629e-01 9.726083363283349881e-01 8.975959074248138769e-01
+9.829773205072419584e-01 9.763939321161484441e-01 8.990442065973827113e-01
+9.895988716426143972e-01 9.801900344288262401e-01 9.004285886132605832e-01
+9.962497442478134291e-01 9.839982596313375796e-01 9.017506391251587372e-01
+9.996253193176977137e-01 9.913711226010460953e-01 8.041012438578545307e-01
+9.969312990878144154e-01 9.865865913107011442e-01 7.958196545688069889e-01
+9.942533588637104680e-01 9.818135789307643746e-01 7.875317815897165952e-01
+9.915896776086415842e-01 9.770525904709529419e-01 7.792374356109948996e-01
+9.889384786221749879e-01 9.723041153469224041e-01 7.709364896057565586e-01
+9.862980251266783016e-01 9.675686302753326862e-01 7.626288656679628408e-01
+9.836666169060123144e-01 9.628466015967408476e-01 7.543145233681930462e-01
+9.810425876106124710e-01 9.581384871880828102e-01 7.459934495167190871e-01
+9.784237290846492519e-01 9.534448589527805273e-01 7.376670490866494845e-01
+9.758091741853186507e-01 9.487660072025493330e-01 7.293335612360094533e-01
+9.731976797213667263e-01 9.441023023821585314e-01 7.209921595340745837e-01
+9.705876565172376624e-01 9.394541905537218129e-01 7.126429103405369503e-01
+9.679775344953384097e-01 9.348221172710475813e-01 7.042858810456844587e-01
+9.653657609756586266e-01 9.302065285603877687e-01 6.959211353452218196e-01
+9.627508763245108403e-01 9.256078555762781157e-01 6.875485248304887831e-01
+9.601317913231469658e-01 9.210264571207541495e-01 6.791669211618720503e-01
+9.575068348330096901e-01 9.164628209777989643e-01 6.707767168399573210e-01
+9.548744491996995487e-01 9.119174176425877132e-01 6.623780173986024700e-01
+9.522330808045905703e-01 9.073907239128325974e-01 6.539709177027834830e-01
+9.495811770290348841e-01 9.028832240271246201e-01 6.455555018977681137e-01
+9.469171829214290126e-01 8.983954108674836458e-01 6.371318441574638225e-01
+9.442402190659517913e-01 8.939276490907958062e-01 6.286979645113369708e-01
+9.415486437855169477e-01 8.894804711503382366e-01 6.202539985663386712e-01
+9.388403761261178149e-01 8.850545069722992597e-01 6.118014161078325630e-01
+9.361137658947894513e-01 8.806503085987659185e-01 6.033403762527677072e-01
+9.333671427931780062e-01 8.762684428171652051e-01 5.948710444843188228e-01
+9.305988122871574619e-01 8.719094924143574454e-01 5.863935979844183688e-01
+9.278070514355759579e-01 8.675740573997056115e-01 5.779082318269497254e-01
+9.249901047433721768e-01 8.632627561697012730e-01 5.694151660419812799e-01
+9.221469800733509414e-01 8.589760860685742294e-01 5.609116482547054083e-01
+9.192753048560652340e-01 8.547148108589553983e-01 5.523997440377725887e-01
+9.163728560349155838e-01 8.504796735679325259e-01 5.438810466983201586e-01
+9.134376867190158178e-01 8.462713800742609482e-01 5.353560484875481418e-01
+9.104678046010745707e-01 8.420906570028113824e-01 5.268253096213930675e-01
+9.074611700430375016e-01 8.379382516634488187e-01 5.182894693241438810e-01
+9.044156948810763152e-01 8.338149316350844664e-01 5.097492574011085464e-01
+9.013292420875533839e-01 8.297214839374013051e-01 5.012055062134753713e-01
+8.981996264328737656e-01 8.256587137313211588e-01 4.926591628979440363e-01
+8.950246162923013449e-01 8.216274424893472705e-01 4.841113016411668357e-01
+8.918019367410795484e-01 8.176285055788921063e-01 4.755631357855747976e-01
+8.885292740744069606e-01 8.136627492060259925e-01 4.670160295098501613e-01
+8.852042818763621312e-01 8.097310266740884721e-01 4.584715087957387802e-01
+8.818245887426444662e-01 8.058341939216442373e-01 4.499312713647861117e-01
+8.783878077356160885e-01 8.019731043176190344e-01 4.413971952459587733e-01
+8.748915476159051519e-01 7.981486027081815537e-01 4.328713456201330745e-01
+8.713334258529761289e-01 7.943615187300834268e-01 4.243559795823733105e-01
+8.677110833677242896e-01 7.906126594284177411e-01 4.158535484698712703e-01
+8.640222009043423412e-01 7.869028012426558805e-01 4.073666974243692063e-01
+8.602645168678531018e-01 7.832326814525909509e-01 3.988982618942717440e-01
+8.564358463998196225e-01 7.796029892044549214e-01 3.904512608343593816e-01
+8.525341014005127782e-01 7.760143562656642846e-01 3.820288864300384613e-01
+8.485573111443696082e-01 7.724673476829161389e-01 3.736344902575098326e-01
+8.445036430802366212e-01 7.689624525410815314e-01 3.652715658890242079e-01
+8.403714233625397823e-01 7.655000750378188057e-01 3.569437280604416673e-01
+8.361591566273345322e-01 7.620805260995172636e-01 3.486546886323707573e-01
+8.318655445115968883e-01 7.587040157667198637e-01 3.404082296912668837e-01
+8.274895024172935765e-01 7.553706465705579687e-01 3.322081742472747790e-01
+8.230301740454328829e-01 7.520804081054507373e-01 3.240583550855133943e-01
+8.184868212302832680e-01 7.488332616294635091e-01 3.159617825674137515e-01
+8.138590110822148116e-01 7.456289896604103573e-01 3.079221377655331771e-01
+8.091468181242912339e-01 7.424670871619818424e-01 2.999443469091602199e-01
+8.043504122379883103e-01 7.393470563716729727e-01 2.920319686576324791e-01
+7.994702184716161453e-01 7.362682828578653860e-01 2.841884012704181672e-01
+7.945069109411802000e-01 7.332300399833050486e-01 2.764168555307422448e-01
+7.894614033518293494e-01 7.302314948629916591e-01 2.687203309843908539e-01
+7.843348364120679150e-01 7.272717156577747089e-01 2.611015959667907227e-01
+7.791285260147496894e-01 7.243496994364320152e-01 2.535630684860531447e-01
+7.738440801480908071e-01 7.214643092911102729e-01 2.461071963221510561e-01
+7.684833208817296590e-01 7.186143199358207001e-01 2.387362039122769009e-01
+7.630481315977482026e-01 7.157984953860191402e-01 2.314517734491695622e-01
+7.575405230514773436e-01 7.130155515836559266e-01 2.242553190375982108e-01
+7.519626112766101267e-01 7.102641669372077304e-01 2.171479941172158035e-01
+7.463165956980535309e-01 7.075429925763011552e-01 2.101307026608347228e-01
+7.406047378440419049e-01 7.048506621488696000e-01 2.032041138079452858e-01
+7.348297350913484127e-01 7.021856197788983733e-01 1.963692968886621149e-01
+7.289936844492124202e-01 6.995466025992004289e-01 1.896260481458106884e-01
+7.230988483362374986e-01 6.969322773880018973e-01 1.829743149302962002e-01
+7.171475322086006132e-01 6.943412998823550453e-01 1.764139943240976283e-01
+7.111420143928013360e-01 6.917723467781027313e-01 1.699448658068684892e-01
+7.050845338608371371e-01 6.892241206236302542e-01 1.635666199792324693e-01
+6.989772797030316953e-01 6.866953538838792559e-01 1.572788888364401172e-01
+6.928223822517928232e-01 6.841848122132092591e-01 1.510812776309110872e-01
+6.866220524799201419e-01 6.816912363109779438e-01 1.449735254345622115e-01
+6.803786701652846380e-01 6.792133090629258740e-01 1.389555620195359609e-01
+6.740936196655853418e-01 6.767501306945983286e-01 1.330266252977832520e-01
+6.677687244983904202e-01 6.743006234739316040e-01 1.271865644636745452e-01
+6.614057275351008514e-01 6.718637487365417549e-01 1.214353970802317662e-01
+6.550062900453353931e-01 6.694385066322930955e-01 1.157733573283348805e-01
+6.485719915801509972e-01 6.670239355272904458e-01 1.102009495253571669e-01
+6.421043305819508218e-01 6.646191111168818777e-01 1.047190080781650323e-01
+6.356047256163376291e-01 6.622231453008022850e-01 9.932876523540395963e-02
+6.290745171295046845e-01 6.598351848668921882e-01 9.403192821288078318e-02
+6.225149696438274649e-01 6.574544100249212208e-01 8.883076747185855715e-02
+6.159272743135092432e-01 6.550800328272597950e-01 8.372821811088401733e-02
+6.093126663293514378e-01 6.527112545185101977e-01 7.872799706657532259e-02
+6.026723170612737768e-01 6.503473055396404856e-01 7.383469856963406630e-02
+5.960069280976730832e-01 6.479875866853281874e-01 6.905400752442764079e-02
+5.893174254692321590e-01 6.456314203776034599e-01 6.439287527349069062e-02
+5.826046784844106652e-01 6.432781520370909334e-01 5.985968924725062340e-02
+5.758695032242261425e-01 6.409271483905801814e-01 5.546448455059219823e-02
+5.691126660872921628e-01 6.385777958070207871e-01 5.121916775709036557e-02
+5.623348873683923221e-01 6.362294986703330713e-01 4.713774156788400754e-02
+5.555368448583254404e-01 6.338816777957024806e-01 4.323651096469569716e-02
+5.487191774565705060e-01 6.315337688945173999e-01 3.952487864258176498e-02
+5.418824887917018662e-01 6.291852210919098853e-01 3.612051121019213551e-02
+5.350273508472259687e-01 6.268354954999130202e-01 3.311399967360150604e-02
+5.281543075929241438e-01 6.244840638484698836e-01 3.049096132752013993e-02
+5.212638786236020172e-01 6.221304071760309640e-01 2.823775650583685778e-02
+5.143565628087404251e-01 6.197740145810481938e-01 2.634144880489198981e-02
+5.074328419576341620e-01 6.174143820354919265e-01 2.478976657062584646e-02
+5.004931845054064743e-01 6.150510112614009373e-01 2.357106560875196072e-02
+4.935380492257968599e-01 6.126834086714986194e-01 2.267429306479169446e-02
+4.865677337149327264e-01 6.103111278318402722e-01 2.208918519158591109e-02
+4.795827833081557912e-01 6.079336535225863258e-01 2.180564619063158835e-02
+4.725836555273193462e-01 6.055504983495709759e-01 2.181419194008693205e-02
+4.655708088649732068e-01 6.031611773523495312e-01 2.210580170001537684e-02
+4.585447116306416437e-01 6.007652058968021569e-01 2.267187969798983502e-02
+4.515058459835388782e-01 5.983620990282547680e-01 2.350422445657735990e-02
+4.444547120266517104e-01 5.959513709030562767e-01 2.459499875403014374e-02
+4.373918319618326778e-01 5.935325343022211930e-01 2.593670014651517156e-02
+4.303177543037495223e-01 5.911051002310937497e-01 2.752213198538535840e-02
+4.232330581488202292e-01 5.886685776092354105e-01 2.934437486930205341e-02
+4.161383574931313278e-01 5.862224730549979723e-01 3.139675847884770832e-02
+4.090343055913983616e-01 5.837662907693373926e-01 3.367283375013734037e-02
+4.019215993467592507e-01 5.812995325235387201e-01 3.616634535426579283e-02
+3.948009837190709082e-01 5.788216977554323517e-01 3.887120446073646235e-02
+3.876732561372571162e-01 5.763322837785355146e-01 4.174672181203834681e-02
+3.805386564470196742e-01 5.738309171411589693e-01 4.468566878513501733e-02
+3.733986391498164137e-01 5.713169711328536238e-01 4.768049787246867594e-02
+3.662542351622480874e-01 5.687899279044026368e-01 5.071835758395210753e-02
+3.591065040473656045e-01 5.662492786415918022e-01 5.378828392041421630e-02
+3.519565800474088735e-01 5.636945152858550134e-01 5.688085721725138350e-02
+3.448056760545124555e-01 5.611251315161035480e-01 5.998797256299469999e-02
+3.376550874229136134e-01 5.585406238589376571e-01 6.310263770132876204e-02
+3.305061956006355439e-01 5.559404929241524851e-01 6.621879773242350664e-02
+3.233604715607960034e-01 5.533242447607230607e-01 6.933118466356372189e-02
+3.162194790161148017e-01 5.506913923265978061e-01 7.243518928216058361e-02
+3.090846039651472532e-01 5.480415027343880086e-01 7.552721746757809496e-02
+3.019574288899705139e-01 5.453741321890830385e-01 7.860394456462099777e-02
+2.948403194287022577e-01 5.426887379559618418e-01 8.166128713902018332e-02
+2.877352499045566225e-01 5.399848761881764769e-01 8.469633286585029341e-02
+2.806442994214729536e-01 5.372621189537871711e-01 8.770643445761908130e-02
+2.735696535538801322e-01 5.345200561570193631e-01 9.068916512095565041e-02
+2.665136059049172390e-01 5.317582974656462902e-01 9.364228167891575083e-02
+2.594785595977833204e-01 5.289764742223507232e-01 9.656369418956520234e-02
+2.524670287821700332e-01 5.261742413169625543e-01 9.945144107016240520e-02
+2.454813557062531792e-01 5.233513142453691813e-01 1.023041162767710510e-01
+2.385245828710040317e-01 5.205073603004944927e-01 1.051194831525161522e-01
+2.315996737216303170e-01 5.176421037021866622e-01 1.078956959800008442e-01
+2.247096070811669399e-01 5.147553123030387257e-01 1.106311405318080310e-01
+2.178574824667257048e-01 5.118467857547527311e-01 1.133242655958566492e-01
+2.110465244393363582e-01 5.089163566221597268e-01 1.159735773093806543e-01
+2.042800881777394606e-01 5.059638913007615812e-01 1.185776351459725819e-01
+1.975616665475327660e-01 5.029892907239723598e-01 1.211350492651094846e-01
+1.908950317685597087e-01 4.999924798399172921e-01 1.236442618572499708e-01
+1.842839642352289697e-01 4.969734333710090213e-01 1.261039978961912833e-01
+1.777324020667393756e-01 4.939321620495928378e-01 1.285130506256617899e-01
+1.712444848635372441e-01 4.908687102327232155e-01 1.308702368677320538e-01
+1.648245567449286297e-01 4.877831568788963401e-01 1.331744245804179216e-01
+1.584771896665797541e-01 4.846756148389082530e-01 1.354245338303780855e-01
+1.522072108246106115e-01 4.815462299379932865e-01 1.376195378692431359e-01
+1.460197345452351747e-01 4.783951798632230523e-01 1.397584642177332193e-01
+1.399204939260773328e-01 4.752226638142488802e-01 1.418397751955981501e-01
+1.339151022806790436e-01 4.720289313790105301e-01 1.438629155677119409e-01
+1.280096392738992173e-01 4.688142535267130762e-01 1.458273227721058329e-01
+1.222107627052576584e-01 4.655789223639808516e-01 1.477322650340249788e-01
+1.165256528622910237e-01 4.623232537320298152e-01 1.495770677617926092e-01
+1.109620746853187123e-01 4.590475853271560047e-01 1.513611132825743999e-01
+1.055284430115649430e-01 4.557522747771929894e-01 1.530838402977779955e-01
+1.002338888313226428e-01 4.524376976954341267e-01 1.547447430577089666e-01
+9.508832342249537439e-02 4.491042457325262194e-01 1.563433702619193288e-01
+9.010250937510871916e-02 4.457523324675090604e-01 1.578790892676192326e-01
+8.528801833375249108e-02 4.423823989146767888e-01 1.593510674113139958e-01
+8.065727940861416867e-02 4.389948528858526600e-01 1.607597457256386420e-01
+7.622371216564308161e-02 4.355901307746828932e-01 1.621048834368656322e-01
+7.200158271604989446e-02 4.321686757028083692e-01 1.633862841279137557e-01
+6.800589086138220107e-02 4.287309359317861834e-01 1.646037933778843332e-01
+6.425218103335716968e-02 4.252773633715483670e-01 1.657572962977645059e-01
+6.075626148835750612e-02 4.218084121914437157e-01 1.668467149892300661e-01
+5.753381975108700502e-02 4.183245375382101949e-01 1.678720059529140995e-01
+5.459992971435845971e-02 4.148261943636451510e-01 1.688331574715942474e-01
+5.196845773512390881e-02 4.113138363632788397e-01 1.697301869925023354e-01
+4.965139124510086627e-02 4.077879150260529384e-01 1.705631385315065085e-01
+4.765813208284918473e-02 4.042488787938245398e-01 1.713320801202671551e-01
+4.599481449154869256e-02 4.006971723285012166e-01 1.720371013157572515e-01
+4.466371969486728627e-02 3.971332358837184051e-01 1.726783107897287561e-01
+4.366274483561478209e-02 3.935575133766276990e-01 1.732557671739120286e-01
+4.298497468310508857e-02 3.899704687794856572e-01 1.737693705957654433e-01
+4.262017645185838671e-02 3.863724827023667929e-01 1.742196255705478480e-01
+4.255352467768171859e-02 3.827639728113220174e-01 1.746066936456434071e-01
+4.276673184831410873e-02 3.791453506945430818e-01 1.749307448926006592e-01
+4.323878239983177524e-02 3.755170217599948512e-01 1.751919563188165385e-01
+4.394675081101364483e-02 3.718793851987791665e-01 1.753905104335057585e-01
+4.486662442701292580e-02 3.682328340080037177e-01 1.755265939730583369e-01
+4.597406436707644067e-02 3.645777550668193867e-01 1.756003967899375517e-01
+4.724505801823831314e-02 3.609145292591857124e-01 1.756121109084000098e-01
+4.865643856140024898e-02 3.572435316368365310e-01 1.755619297495205344e-01
+5.018626632042253594e-02 3.535651316158259783e-01 1.754500475272437465e-01
+5.181408104443557122e-02 3.498796931999255677e-01 1.752766588164567374e-01
+5.352104295989750654e-02 3.461875752240315962e-01 1.750419582933170903e-01
+5.528998425553303259e-02 3.424891316106106198e-01 1.747461406473147794e-01
+5.710539287663336100e-02 3.387847116320403806e-01 1.743894006636908245e-01
+5.895334846203271334e-02 3.350746601715560713e-01 1.739719334739151524e-01
+6.082142709649813322e-02 3.313593179753057116e-01 1.734939349708606859e-01
+6.269858808390260663e-02 3.276390218878380001e-01 1.729556023841174184e-01
+6.457505267241087088e-02 3.239141050631572094e-01 1.723571350094970367e-01
+6.644218183629055363e-02 3.201848971432968427e-01 1.716987350852014205e-01
+6.829235792686130790e-02 3.164517243962254311e-01 1.709806088053268391e-01
+7.011887323479765177e-02 3.127149098048046527e-01 1.702029674593475428e-01
+7.191582719453681882e-02 3.089747730984767071e-01 1.693660286839586415e-01
+7.367740139700959534e-02 3.052317018390342529e-01 1.684698187582648887e-01
+7.539908659075802988e-02 3.014860094828903936e-01 1.675145933863426417e-01
+7.707730571895973770e-02 2.977379606831319081e-01 1.665007348086736949e-01
+7.870852955781817983e-02 2.939878648964006636e-01 1.654284970811750188e-01
+8.028965953863020921e-02 2.902360278178472974e-01 1.642981478645798299e-01
+8.181797774419891089e-02 2.864827509313960796e-01 1.631099700093367744e-01
+8.329110360766753263e-02 2.827283309501391617e-01 1.618642630930951787e-01
+8.470695659424687385e-02 2.789730591425138573e-01 1.605613448745624727e-01
+8.606372418387428502e-02 2.752172205414125661e-01 1.592015526248838075e-01
+8.735983452008261319e-02 2.714610930351273321e-01 1.577852442954886525e-01
+8.859393314120664331e-02 2.677049463410028363e-01 1.563127994796906506e-01
+8.976486326081492551e-02 2.639490408648579312e-01 1.547846201243904263e-01
+9.087164911293293956e-02 2.601936264515474218e-01 1.532011309481255412e-01
+9.191348192284298779e-02 2.564389410344570241e-01 1.515627795225681362e-01
+9.288704312629730842e-02 2.526856315239155992e-01 1.498693699931691048e-01
+9.379283018859288501e-02 2.489337717503207204e-01 1.481216905842226428e-01
+9.463163644057562274e-02 2.451833792964967507e-01 1.463205652098015508e-01
+9.540318566942779244e-02 2.414346401225993533e-01 1.444665315338557743e-01
+9.610732643393554708e-02 2.376877206774311024e-01 1.425601463139360425e-01
+9.674402718144511915e-02 2.339427661170380146e-01 1.406019829499289553e-01
+9.731337192794831115e-02 2.301998985206034631e-01 1.385926284969124511e-01
+9.781527030012060475e-02 2.264592671684997338e-01 1.365326231802845014e-01
+9.824358966693200190e-02 2.227221381992704474e-01 1.344213498047777955e-01
+9.860476008591259611e-02 2.189874851640599696e-01 1.322606854144605382e-01
+9.889926458171927059e-02 2.152553323101172311e-01 1.300512525669721697e-01
+9.912768720083675600e-02 2.115256719866073221e-01 1.277936680974917916e-01
+9.929070945217863264e-02 2.077984630697710111e-01 1.254885372707029156e-01
+9.938536693535210409e-02 2.040743841747782450e-01 1.231359093599569132e-01
+9.940987528000957973e-02 2.003539028956775048e-01 1.207361104943659447e-01
+9.937074432198822471e-02 1.966357733029605592e-01 1.182905659078862248e-01
+9.926899950314096999e-02 1.929198155529378012e-01 1.157998086675786908e-01
+9.910574746809375224e-02 1.892058087816931022e-01 1.132643300609986470e-01
+9.887273365069987330e-02 1.854955476839638961e-01 1.106837415179452166e-01
+9.857702759168757156e-02 1.817875303344013982e-01 1.080592207487474365e-01
+9.822269753736714848e-02 1.780808239249605796e-01 1.053914161709541830e-01
+9.781113633355650872e-02 1.743750377566490040e-01 1.026806351620476176e-01
+9.733238005935909709e-02 1.706723687329834982e-01 9.992670564763897478e-02
+9.679537330416121410e-02 1.669706979907544520e-01 9.713043093317094701e-02
+9.620476860769888727e-02 1.632687911401897729e-01 9.429209466525781402e-02
+9.555840111219859878e-02 1.595669718044100127e-01 9.141177435708905397e-02
+9.484851695793727888e-02 1.558669291806107915e-01 8.848983773912671991e-02
+9.408911153954402362e-02 1.521650578561620781e-01 8.552628708305054506e-02
+9.328192094338655371e-02 1.484606091474970080e-01 8.252094903627574252e-02
+9.241015243151923242e-02 1.447574737795673805e-01 7.947496936453349314e-02
+9.149313879389489590e-02 1.410504572025015335e-01 7.638732537156053826e-02
+9.053276383981978537e-02 1.373386075843833487e-01 7.325761429945673586e-02];
+
+   case 'cur'
+      RGB = [8.225559928700268419e-02 1.149244079727295142e-01 2.647901677800857390e-01
+8.312616532498406929e-02 1.190383729463048712e-01 2.668628892216621806e-01
+8.400180885962132971e-02 1.231074880892656653e-01 2.689526699064171411e-01
+8.487294239495335457e-02 1.271387529060027943e-01 2.710541708402016137e-01
+8.574385298640457842e-02 1.311333174761502018e-01 2.731691209373900975e-01
+8.661249189260347703e-02 1.350944971238551839e-01 2.752961432065319514e-01
+8.747533041314431435e-02 1.390258052165279645e-01 2.774332852121961235e-01
+8.833858505105957049e-02 1.429270910011002649e-01 2.795831537842536352e-01
+8.919012906146844832e-02 1.468043594975814992e-01 2.817400195447572475e-01
+9.004099984169053328e-02 1.506555099870153513e-01 2.839086654207542693e-01
+9.088231952195491292e-02 1.544850037627045203e-01 2.860850125083750362e-01
+9.171714479257989105e-02 1.582931942356169963e-01 2.882702798507874586e-01
+9.254607948203208423e-02 1.620811665705463311e-01 2.904645825457518593e-01
+9.336173420340779239e-02 1.658523274558137695e-01 2.926648040593683997e-01
+9.417284157369981701e-02 1.696050767223750977e-01 2.948744162588470830e-01
+9.496899572502048859e-02 1.733434725855039771e-01 2.970892156823352059e-01
+9.575619444438937533e-02 1.770666290075273708e-01 2.993115284087380368e-01
+9.653316478613682694e-02 1.807757562460599599e-01 3.015407883893915231e-01
+9.729328810023782359e-02 1.844734436312414905e-01 3.037745103921251633e-01
+9.804493118338306057e-02 1.881580898967480098e-01 3.060157402408537064e-01
+9.877832247043097369e-02 1.918329889556127654e-01 3.082609202522414993e-01
+9.949803783218733044e-02 1.954975058870322413e-01 3.105116763778897337e-01
+1.002054858430543316e-01 1.991518634625495388e-01 3.127684262427183892e-01
+1.008900241588315538e-01 2.027992883367119026e-01 3.150275553737127421e-01
+1.015620277820400430e-01 2.064376400065636719e-01 3.172925125709148420e-01
+1.022150454689789434e-01 2.100689913462399083e-01 3.195611195376787395e-01
+1.028468845169810686e-01 2.136942776676366007e-01 3.218326666201724029e-01
+1.034637486817424901e-01 2.173124203806320875e-01 3.241090419310820314e-01
+1.040556247342821483e-01 2.209261472703716311e-01 3.263871052200472134e-01
+1.046272664909374817e-01 2.245346804307608024e-01 3.286682704446855507e-01
+1.051814556007013568e-01 2.281377376539149293e-01 3.309532535866355762e-01
+1.057055066316897329e-01 2.317384538919968207e-01 3.332383062494437276e-01
+1.062093640276061124e-01 2.353348932541681759e-01 3.355262248019345583e-01
+1.066927192498384747e-01 2.389274243968986799e-01 3.378167764830257158e-01
+1.071428862568302165e-01 2.425189920877232619e-01 3.401063918909076889e-01
+1.075713140889580088e-01 2.461073946949010050e-01 3.423980926413837667e-01
+1.079763885418836000e-01 2.496932209057829977e-01 3.446912766824791197e-01
+1.083460004297124302e-01 2.532791299120676354e-01 3.469826761312421182e-01
+1.086913329090623825e-01 2.568630402753477870e-01 3.492750549670107785e-01
+1.090116287119651528e-01 2.604453159192556266e-01 3.515680214913912693e-01
+1.092932808921200649e-01 2.640287615628073015e-01 3.538580573547516761e-01
+1.095478763802813504e-01 2.676112773022403801e-01 3.561478615212890775e-01
+1.097748910210358808e-01 2.711931376089152246e-01 3.584370856671010852e-01
+1.099635342633853707e-01 2.747764822051754763e-01 3.607229892872333421e-01
+1.101198294511886444e-01 2.783603021914852760e-01 3.630068099573608986e-01
+1.102460152182262176e-01 2.819443225282238785e-01 3.652888319764409086e-01
+1.103361572207214036e-01 2.855297163446686715e-01 3.675674754730824945e-01
+1.103867349279119559e-01 2.891171759115234718e-01 3.698417464033080804e-01
+1.104047114339987423e-01 2.927055780381122019e-01 3.721129484539063559e-01
+1.103893448894039397e-01 2.962951553198432397e-01 3.743806401368951486e-01
+1.103290785873510815e-01 2.998879083652261635e-01 3.766420819050353419e-01
+1.102317288825286901e-01 3.034825829921489193e-01 3.788986922133656954e-01
+1.100986315611906241e-01 3.070790351009552999e-01 3.811504545068737926e-01
+1.099286556573810802e-01 3.106775192369479188e-01 3.833968205472055302e-01
+1.097092559883022234e-01 3.142800415550652815e-01 3.856349205402823110e-01
+1.094518269158459012e-01 3.178848431435130073e-01 3.878667847148202785e-01
+1.091556968975302966e-01 3.214920812428978536e-01 3.900919340676701208e-01
+1.088202096165073185e-01 3.251019032868823211e-01 3.923098843692563453e-01
+1.084337294201929702e-01 3.287160421828903556e-01 3.945179917556369542e-01
+1.080052802278752000e-01 3.323331728550899533e-01 3.967176863054378000e-01
+1.075355258379605550e-01 3.359532282299735328e-01 3.989087127976621017e-01
+1.070239159802940931e-01 3.395763147211236510e-01 4.010905648833596460e-01
+1.064666158592602885e-01 3.432029795356145718e-01 4.032620996037361571e-01
+1.058582376509708545e-01 3.468339423292918222e-01 4.054218838433404359e-01
+1.052065591856250482e-01 3.504681464569319171e-01 4.075709632165070984e-01
+1.045112201334900126e-01 3.541056562885774861e-01 4.097088092956981398e-01
+1.037719209811681642e-01 3.577465259466254266e-01 4.118348877541359032e-01
+1.029884320307208612e-01 3.613907991323849767e-01 4.139486582680417803e-01
+1.021513134274243950e-01 3.650396452261166491e-01 4.160478671051655586e-01
+1.012689167529539358e-01 3.686920150348446112e-01 4.181335233490640069e-01
+1.003423119365809690e-01 3.723477936835040136e-01 4.202052548968338574e-01
+9.937169919107982641e-02 3.760069784468507703e-01 4.222625006231348066e-01
+9.835741884413440328e-02 3.796695548525758634e-01 4.243046936775203282e-01
+9.729997123759509536e-02 3.833354963232004087e-01 4.263312615677605777e-01
+9.620003933222870396e-02 3.870047637840662302e-01 4.283416262899890081e-01
+9.505172587236093706e-02 3.906780327832828914e-01 4.303339883746660766e-01
+9.386233813144639893e-02 3.943545459798681874e-01 4.323088724355508838e-01
+9.263427266200571775e-02 3.980341179549674036e-01 4.342658626828024837e-01
+9.136927887187012987e-02 4.017166535612498035e-01 4.362043674792987491e-01
+9.006945702453716951e-02 4.054020428715323643e-01 4.381237915805220595e-01
+8.873730500447504776e-02 4.090901606132017476e-01 4.400235366709063789e-01
+8.737577058920215078e-02 4.127808655736769361e-01 4.419030019956885491e-01
+8.598830961259482097e-02 4.164739999785817548e-01 4.437615850971945997e-01
+8.457895032121595658e-02 4.201693888446985103e-01 4.455986826648858368e-01
+8.315236408743081897e-02 4.238668393102046350e-01 4.474136915088433031e-01
+8.171394242970148047e-02 4.275661399451892164e-01 4.492060096666721791e-01
+8.026987997778653461e-02 4.312670600459782566e-01 4.509750376540915817e-01
+7.882726258105521300e-02 4.349693489173894201e-01 4.527201798696426915e-01
+7.739415915996109008e-02 4.386727351476746306e-01 4.544408461640829233e-01
+7.597971511267428979e-02 4.423769258816079852e-01 4.561364535850265800e-01
+7.459424408415230023e-02 4.460816060979165276e-01 4.578064283072901808e-01
+7.324931366840245484e-02 4.497864378980456768e-01 4.594502077591564038e-01
+7.195781915786156335e-02 4.534910598140922677e-01 4.610672429543411499e-01
+7.073403782879061907e-02 4.571950861446216208e-01 4.626570010388615928e-01
+6.959365457471067273e-02 4.608981063279830592e-01 4.642189680611767399e-01
+6.855374817251533304e-02 4.645996843636931994e-01 4.657526519729214276e-01
+6.763272639280798471e-02 4.682993582933911436e-01 4.672575858662252890e-01
+6.685019795786503738e-02 4.719966397538147285e-01 4.687333314519904204e-01
+6.622677049492370349e-02 4.756910136151853430e-01 4.701794827815656830e-01
+6.577673858968982601e-02 4.793824370720338179e-01 4.715941633832017588e-01
+6.552566064603559948e-02 4.830700650743400826e-01 4.729777438223161101e-01
+6.549820807888259711e-02 4.867530881918184504e-01 4.743305399824718216e-01
+6.571558023976076246e-02 4.904308747270616498e-01 4.756523204648347991e-01
+6.619782080433814220e-02 4.941027658684106760e-01 4.769429100625798834e-01
+6.696293828126623215e-02 4.977680989992983585e-01 4.782021118153178540e-01
+6.801610562745827315e-02 5.014269919387287500e-01 4.794267081520149909e-01
+6.938287907938911481e-02 5.050778255979795350e-01 4.806197953737798012e-01
+7.107372065756567547e-02 5.087198306495862576e-01 4.817814896929000779e-01
+7.309574065371191032e-02 5.123522156200341904e-01 4.829119931483520367e-01
+7.544312997722565917e-02 5.159750173542567708e-01 4.840076729265158639e-01
+7.812721320542403980e-02 5.195865216476734938e-01 4.850725749743695636e-01
+8.114572394888117102e-02 5.231858403590214923e-01 4.861073630469811557e-01
+8.448832972524200624e-02 5.267726392289812098e-01 4.871097239159773440e-01
+8.815110303261089464e-02 5.303457163263245455e-01 4.880817131293228583e-01
+9.212706115366336990e-02 5.339038791645212001e-01 4.890257976801760109e-01
+9.640117372078826907e-02 5.374467824904106683e-01 4.899392661237967350e-01
+1.009651127375016111e-01 5.409730397620680087e-01 4.908260102866368046e-01
+1.058058868411170528e-01 5.444817357603629615e-01 4.916873206428047927e-01
+1.109091719419828259e-01 5.479722539284174188e-01 4.925220286879308795e-01
+1.162631754482068569e-01 5.514432364311973034e-01 4.933355557142476422e-01
+1.218535592637135234e-01 5.548942058020517321e-01 4.941256571865651481e-01
+1.276672732366210816e-01 5.583239554235875923e-01 4.948978636889357907e-01
+1.336912106530599997e-01 5.617318570854707982e-01 4.956519172255148820e-01
+1.399119531735926458e-01 5.651170059000043544e-01 4.963918396953513335e-01
+1.463171276735238113e-01 5.684787369209851615e-01 4.971190242696297834e-01
+1.528937099908951325e-01 5.718163393279495077e-01 4.978371217540351057e-01
+1.596300036906863895e-01 5.751292412901443107e-01 4.985481743532478860e-01
+1.665133003434038084e-01 5.784169089899582339e-01 4.992561455145328453e-01
+1.735328783097749850e-01 5.816789154432452369e-01 4.999631315071642601e-01
+1.806761031013389140e-01 5.849149331180006905e-01 5.006736479698321585e-01
+1.879334378838529440e-01 5.881246912104457492e-01 5.013896313522919757e-01
+1.952924636272905801e-01 5.913080959200207598e-01 5.021159025525618880e-01
+2.027443124327554802e-01 5.944650539898058694e-01 5.028546409645925364e-01
+2.102776619158149840e-01 5.975956842983582984e-01 5.036102222376415138e-01
+2.178835011739876371e-01 6.007001216855215597e-01 5.043855354959408954e-01
+2.255521696872271886e-01 6.037786523436265984e-01 5.051841613954050070e-01
+2.332749143253212143e-01 6.068316286127126702e-01 5.060092633925864503e-01
+2.410430130087069522e-01 6.098595200479223211e-01 5.068641518721540562e-01
+2.488489441844971561e-01 6.128628192186393875e-01 5.077515718650474907e-01
+2.566840197606024554e-01 6.158422311486778655e-01 5.086750547256451149e-01
+2.645425291505308918e-01 6.187983086880044503e-01 5.096365792929340444e-01
+2.724162323640093031e-01 6.217319406932720893e-01 5.106395912364674050e-01
+2.803003746086680792e-01 6.246437759477415641e-01 5.116857725517640620e-01
+2.881881143962810587e-01 6.275347641630057982e-01 5.127779478270290126e-01
+2.960748324121407205e-01 6.304057046767445049e-01 5.139178767894679867e-01
+3.039555214161791530e-01 6.332575133378499643e-01 5.151075596956975478e-01
+3.118254758119217707e-01 6.360911463304157465e-01 5.163488722475468862e-01
+3.196814435511296515e-01 6.389074409416231060e-01 5.176430585409529384e-01
+3.275188103490194735e-01 6.417074699067215615e-01 5.189919719540163623e-01
+3.353355552299603914e-01 6.444920106677175520e-01 5.203963563323180663e-01
+3.431277348645550562e-01 6.472621506436356809e-01 5.218577640245062321e-01
+3.508936232465371674e-01 6.500187029053001719e-01 5.233768303957324619e-01
+3.586308928051362699e-01 6.527625972609284455e-01 5.249544352005411918e-01
+3.663368289249827603e-01 6.554948605761221625e-01 5.265915743478537525e-01
+3.740119682194762429e-01 6.582160193662682790e-01 5.282880419647097980e-01
+3.816510562742471135e-01 6.609275747235534570e-01 5.300456830101799577e-01
+3.892580517875900981e-01 6.636294950347043642e-01 5.318631054022345817e-01
+3.968261890078971788e-01 6.663236061846555813e-01 5.337425455110953454e-01
+4.043593499172888350e-01 6.690098785171258999e-01 5.356826761355167887e-01
+4.118554481683104340e-01 6.716893377862352965e-01 5.376841277217632165e-01
+4.193119538935562440e-01 6.743631277083362852e-01 5.397475699351562684e-01
+4.267325988888523436e-01 6.770311866202418649e-01 5.418718349209995511e-01
+4.341129901223799714e-01 6.796950319734580415e-01 5.440580596655568701e-01
+4.414547339722453279e-01 6.823550079810395408e-01 5.463056567639269501e-01
+4.487598229028739172e-01 6.850113432670585922e-01 5.486140038956078824e-01
+4.560240745098563253e-01 6.876655632831355502e-01 5.509839689679422170e-01
+4.632498634530364812e-01 6.903178139102768007e-01 5.534147775766539157e-01
+4.704389351347622594e-01 6.929683367461523247e-01 5.559058726658481220e-01
+4.775890398856753039e-01 6.956182556045346077e-01 5.584575291026864230e-01
+4.846997162615552246e-01 6.982683108816961637e-01 5.610695620964348818e-01
+4.917741270603506742e-01 7.009183842407572529e-01 5.637411222277634026e-01
+4.988124547076915882e-01 7.035690215604037956e-01 5.664719533702552434e-01
+5.058115298480653221e-01 7.062215879970826782e-01 5.692622613027222833e-01
+5.127738759690677606e-01 7.088760718122417703e-01 5.721113127309581659e-01
+5.197010257328686933e-01 7.115326679134365007e-01 5.750185876848199484e-01
+5.265932673521412921e-01 7.141918646847531527e-01 5.779837442967735717e-01
+5.334494816269396145e-01 7.168545129510710545e-01 5.810065526719623286e-01
+5.402690647877386176e-01 7.195213413684249382e-01 5.840866494502513495e-01
+5.470548736207613283e-01 7.221921468817737999e-01 5.872233804977959881e-01
+5.538072551957783363e-01 7.248673679611095100e-01 5.904163410524770894e-01
+5.605265661533928023e-01 7.275474322700724583e-01 5.936651120515976654e-01
+5.672131712764029166e-01 7.302327570205698892e-01 5.969692609600730782e-01
+5.738649923321349489e-01 7.329244536181049874e-01 6.003283620189617809e-01
+5.804845702488933279e-01 7.356223182652517067e-01 6.037418650719156288e-01
+5.870727421002424062e-01 7.383266077479672118e-01 6.072092971993915400e-01
+5.936298933201957784e-01 7.410376988478269977e-01 6.107301851240671819e-01
+6.001564124519274124e-01 7.437559595200373685e-01 6.143040456187923715e-01
+6.066526905401021796e-01 7.464817491552263595e-01 6.179303860708607044e-01
+6.131191206125891080e-01 7.492154188267443615e-01 6.216087050224498034e-01
+6.195560972423146406e-01 7.519573115237726535e-01 6.253384926911926822e-01
+6.259635861936422296e-01 7.547078996712067722e-01 6.291191822939783407e-01
+6.323414409254812796e-01 7.574676913865331374e-01 6.329501570682624090e-01
+6.386911927456534466e-01 7.602366470910791874e-01 6.368310037415121361e-01
+6.450132383997043695e-01 7.630150778921287458e-01 6.407611911364364810e-01
+6.513079749051275957e-01 7.658032878094622742e-01 6.447401822997557153e-01
+6.575757994324034073e-01 7.686015739346664377e-01 6.487674349657708284e-01
+6.638171092147175933e-01 7.714102265818907345e-01 6.528424020163275943e-01
+6.700323014813579503e-01 7.742295294309987641e-01 6.569645319377305226e-01
+6.762217734101813038e-01 7.770597596640953508e-01 6.611332692747456941e-01
+6.823859220949484161e-01 7.799011880964143995e-01 6.653480550814426797e-01
+6.885251445237092760e-01 7.827540793025653532e-01 6.696083273682165160e-01
+6.946398375648411561e-01 7.856186917391158042e-01 6.739135215439332471e-01
+7.007303979576740005e-01 7.884952778644843674e-01 6.782630708517513041e-01
+7.067972223051004477e-01 7.913840842570615264e-01 6.826564067967675342e-01
+7.128407070658809852e-01 7.942853517324697243e-01 6.870929595632513376e-01
+7.188612485448663270e-01 7.971993154607720511e-01 6.915721584188375681e-01
+7.248592428796667431e-01 8.001262050844080154e-01 6.960934321026465144e-01
+7.308350860228653989e-01 8.030662448375227580e-01 7.006562091939169123e-01
+7.367891737192681090e-01 8.060196536672460388e-01 7.052599184573171698e-01
+7.427219014782563411e-01 8.089866453573647531e-01 7.099039891607071828e-01
+7.486327256130643759e-01 8.119678017125729896e-01 7.145873998348200029e-01
+7.545223076817887398e-01 8.149632306197714948e-01 7.193096566367255251e-01
+7.603915796412942241e-01 8.179729213555224643e-01 7.240704295566047222e-01
+7.662409381414175824e-01 8.209970689783633313e-01 7.288691437189614986e-01
+7.720707796269933310e-01 8.240358639329949941e-01 7.337052258319404219e-01
+7.778815003305534770e-01 8.270894921786368092e-01 7.385781042557458820e-01
+7.836734962813408645e-01 8.301581353160575327e-01 7.434872090029538416e-01
+7.894471633387081244e-01 8.332419707110174656e-01 7.484319716624078245e-01
+7.952028972601549173e-01 8.363411716110775718e-01 7.534118252377455249e-01
+8.009401766621723207e-01 8.394563042330350777e-01 7.584255820860429376e-01
+8.066584706735069332e-01 8.425879497641356464e-01 7.634719632765348818e-01
+8.123599093553812711e-01 8.457355276105180675e-01 7.685515296147656938e-01
+8.180448941186928558e-01 8.488991950022984900e-01 7.736637090147417961e-01
+8.237138279483190439e-01 8.520791051833870311e-01 7.788079287668441264e-01
+8.293671160911614271e-01 8.552754073408689317e-01 7.839836146965878383e-01
+8.350048677827189847e-01 8.584883831868801440e-01 7.891899443847590900e-01
+8.406246724049463159e-01 8.617194786977677712e-01 7.944239257301034529e-01
+8.462299834685677036e-01 8.649674562084326279e-01 7.996873827745283325e-01
+8.518212329614019973e-01 8.682324447773152043e-01 8.049797193798620132e-01
+8.573988637074910768e-01 8.715145671024431273e-01 8.103003320898716222e-01
+8.629633327895804840e-01 8.748139384163003962e-01 8.156486084917724533e-01
+8.685112937853189941e-01 8.781325055194139084e-01 8.210202040569095638e-01
+8.740469282893844616e-01 8.814686228402575097e-01 8.264178662740626624e-01
+8.795708463666609411e-01 8.848223352046364898e-01 8.318410153090299852e-01
+8.850836254841629724e-01 8.881937049832523412e-01 8.372889893254339411e-01
+8.905836610629007666e-01 8.915838848352710677e-01 8.427587078675609078e-01
+8.960718329388820402e-01 8.949928217018373600e-01 8.482495190363266158e-01
+9.015509263802756745e-01 8.984195016922670307e-01 8.537628451897162352e-01
+9.070218374764418279e-01 9.018638497314315217e-01 8.592980228813623667e-01
+9.124832972967743538e-01 9.053269113370198129e-01 8.648517190341429295e-01
+9.179365336943248188e-01 9.088084827838653901e-01 8.704232606428425889e-01
+9.233851804191220980e-01 9.123071100087158936e-01 8.760148319228351355e-01
+9.288308811012930821e-01 9.158223472192428272e-01 8.816263177427966502e-01
+9.342716413123769437e-01 9.193556495997508016e-01 8.872531405900644375e-01
+9.397124373542273812e-01 9.229047657151164819e-01 8.928998260600508052e-01
+9.451563753217823161e-01 9.264682865796181055e-01 8.985697730985615639e-01
+9.506035559047821826e-01 9.300461763422669392e-01 9.042646579991682199e-01
+9.560531046363628382e-01 9.336385357088663461e-01 9.099886803187530182e-01
+9.615066616129493982e-01 9.372434217616608665e-01 9.157560566822336989e-01
+9.669573847273637002e-01 9.408624710997687268e-01 9.215795307640300971e-01
+9.723870692594612786e-01 9.445024597948724621e-01 9.274670258562995873e-01
+9.777785730890226068e-01 9.481687534308861354e-01 9.334364948680430318e-01
+9.831050718338244510e-01 9.518727670560837018e-01 9.394860306213083101e-01
+9.883417388454437402e-01 9.556282921109976458e-01 9.455836323325411685e-01
+9.934918422996558141e-01 9.594375624216472387e-01 9.516983192548315040e-01
+9.985763296811461798e-01 9.632965417140263442e-01 9.577895036430327247e-01
+9.942114721489739848e-01 9.649414783718816002e-01 9.591713509300946461e-01
+9.916915526798163460e-01 9.600677293546330260e-01 9.527406681900515428e-01
+9.892073759214962125e-01 9.552017644060696311e-01 9.462702365737246657e-01
+9.867719407557972167e-01 9.503380654950176476e-01 9.397586228881678050e-01
+9.843739071729306067e-01 9.454788135288768602e-01 9.332265558186634280e-01
+9.820182926871906526e-01 9.406217084851765664e-01 9.266730991029579201e-01
+9.797019478013845317e-01 9.357670195072623764e-01 9.201050706729160256e-01
+9.774207980730996725e-01 9.309154126689619391e-01 9.135293740478817037e-01
+9.751815609868391688e-01 9.260643851639969171e-01 9.069399044850446900e-01
+9.729704910473376822e-01 9.212176417076594070e-01 9.003536220502811327e-01
+9.708034919455280631e-01 9.163699401531895106e-01 8.937532865598888376e-01
+9.686635749176782939e-01 9.115260705110270756e-01 8.871590238431372732e-01
+9.665594650012595546e-01 9.066829842770773862e-01 8.805615104307024099e-01
+9.644872784946666444e-01 9.018415117599095643e-01 8.739656672915365743e-01
+9.624420742140847862e-01 8.970028582796596428e-01 8.673774626543144795e-01
+9.604345584612016262e-01 8.921632903093835720e-01 8.607852860310053478e-01
+9.584498054598472594e-01 8.873272041947983801e-01 8.542061390733795001e-01
+9.564989754176022041e-01 8.824906944948268661e-01 8.476279025304513937e-01
+9.545749598026603833e-01 8.776557062005478915e-01 8.410587414202306267e-01
+9.526745457712032517e-01 8.728229738617154787e-01 8.345024009748316374e-01
+9.508087846256844111e-01 8.679885222040847337e-01 8.279470532549256800e-01
+9.489631025192423186e-01 8.631568397645421609e-01 8.214088147188137734e-01
+9.471457599180185261e-01 8.583248540920686009e-01 8.148789280451533834e-01
+9.453550305765402451e-01 8.534927996091392632e-01 8.083595091982623826e-01
+9.435830323389927665e-01 8.486630445127123501e-01 8.018591800395635794e-01
+9.418425662160879730e-01 8.438308651791852633e-01 7.953645386207840451e-01
+9.401224124677813876e-01 8.389997911592477209e-01 7.888877269212305476e-01
+9.384205871436177571e-01 8.341702205035793627e-01 7.824309818729748844e-01
+9.367501034134483318e-01 8.293372224294222050e-01 7.759809608693934990e-01
+9.350962812812430025e-01 8.245056601392387607e-01 7.695531958095181979e-01
+9.334610667718560295e-01 8.196745424298020888e-01 7.631458380069808811e-01
+9.318539060108851357e-01 8.148400979617762552e-01 7.567494905851217535e-01
+9.302622555140654947e-01 8.100065567310004155e-01 7.503772218901773039e-01
+9.286876056094349741e-01 8.051730724177085241e-01 7.440277117015546837e-01
+9.271395831502474705e-01 8.003357056772891776e-01 7.376916134646933632e-01
+9.256059253327618697e-01 7.954987025858116789e-01 7.313814866564718464e-01
+9.240863437601837260e-01 7.906618776065421628e-01 7.250978248201844778e-01
+9.225925658427436282e-01 7.858203843156221780e-01 7.188294627149656169e-01
+9.211126169365579930e-01 7.809784744974170856e-01 7.125884635347393692e-01
+9.196455684792974594e-01 7.761362045971830215e-01 7.063759865046427278e-01
+9.181979022265810420e-01 7.712906810954774928e-01 7.001861662941214481e-01
+9.167672001571998130e-01 7.664424894801199484e-01 6.940217357022171463e-01
+9.153481567945904729e-01 7.615934195093969628e-01 6.878880649909780987e-01
+9.139404639768551331e-01 7.567432836340363123e-01 6.817857667786046960e-01
+9.125539294301500126e-01 7.518876928783747582e-01 6.757062380855892725e-01
+9.111780957235272593e-01 7.470305845086899765e-01 6.696595752391263368e-01
+9.098122501649290594e-01 7.421719339914916169e-01 6.636468136699643638e-01
+9.084563128768237128e-01 7.373114504136536462e-01 6.576684342801734084e-01
+9.071185731273107011e-01 7.324452193667679856e-01 6.517176237314421527e-01
+9.057893354554222842e-01 7.275770233727173464e-01 6.458034937673092779e-01
+9.044682125236334080e-01 7.227067015228565428e-01 6.399268508324190696e-01
+9.031548045364521382e-01 7.178340969900336432e-01 6.340885324865254136e-01
+9.018536281154535539e-01 7.129568373829493488e-01 6.282852974032566706e-01
+9.005618093543485969e-01 7.080758191596225881e-01 6.225202235043866272e-01
+8.992759701121831872e-01 7.031922144373208283e-01 6.167967177972875081e-01
+8.979956379512032960e-01 6.983059000713781606e-01 6.111157531581823399e-01
+8.967203212860314077e-01 6.934167616666734313e-01 6.054783383481375791e-01
+8.954526708976771054e-01 6.885231926405954717e-01 5.998830635410449252e-01
+8.941915566016080952e-01 6.836253365962329243e-01 5.943315847613384051e-01
+8.929334172678807802e-01 6.787245284319090022e-01 5.888273795844850556e-01
+8.916776705242244194e-01 6.738207055230612808e-01 5.833715948784413685e-01
+8.904237095992360018e-01 6.689138192653601989e-01 5.779654133729836829e-01
+8.891709022410747565e-01 6.640038362746348843e-01 5.726100532447696567e-01
+8.879187220887899690e-01 6.590906724758603952e-01 5.673066752652388134e-01
+8.866700510547862457e-01 6.541724962989774461e-01 5.620541403257021118e-01
+8.854200814778028228e-01 6.492513861023391231e-01 5.568566631651752363e-01
+8.841680786914359880e-01 6.443273831269403784e-01 5.517155748042765762e-01
+8.829132805112128723e-01 6.394005490891804255e-01 5.466322335097351104e-01
+8.816548969914349554e-01 6.344709672901969189e-01 5.416080224154796730e-01
+8.803921103664992254e-01 6.295387436822825755e-01 5.366443467601184070e-01
+8.791240751896489680e-01 6.246040078804957485e-01 5.317426307330340718e-01
+8.778499186810901911e-01 6.196669141071349252e-01 5.269043139249947050e-01
+8.765687412960717628e-01 6.147276420564155019e-01 5.221308473833028430e-01
+8.752796175219744734e-01 6.097863976665317542e-01 5.174236892760738504e-01
+8.739815969115529715e-01 6.048434137862945814e-01 5.127843001752147023e-01
+8.726737941588253999e-01 5.998988989392898263e-01 5.082140946168248741e-01
+8.713557496267209102e-01 5.949528226638209905e-01 5.037142772058214035e-01
+8.700256052408116281e-01 5.900059904309469250e-01 4.992866995883939452e-01
+8.686823445912698061e-01 5.850587401058766623e-01 4.949327569364067592e-01
+8.673249354213553586e-01 5.801114372307474287e-01 4.906538189940125583e-01
+8.659523319452930856e-01 5.751644748762787529e-01 4.864512237593011101e-01
+8.645634773771747605e-01 5.702182733234352208e-01 4.823262709991545383e-01
+8.631573066573615671e-01 5.652732795695735168e-01 4.782802156484906031e-01
+8.617327493598900823e-01 5.603299666552966629e-01 4.743142611496265482e-01
+8.602887327613949475e-01 5.553888328102728478e-01 4.704295527914130193e-01
+8.588244189007790963e-01 5.504502458314576296e-01 4.666271134383851993e-01
+8.573388771464994784e-01 5.455146532392860514e-01 4.629079425847138496e-01
+8.558307110590109845e-01 5.405828402802138610e-01 4.592730689337449212e-01
+8.542988567054966564e-01 5.356554029582069054e-01 4.557233480219839428e-01
+8.527422657992969057e-01 5.307329553519699594e-01 4.522595444303549317e-01
+8.511599092771463537e-01 5.258161276783985816e-01 4.488823265086418490e-01
+8.495507808257551918e-01 5.209055642285482790e-01 4.455922615760174454e-01
+8.479139003246871642e-01 5.160019211927755478e-01 4.423898116530999292e-01
+8.462483171732270160e-01 5.111058643932878676e-01 4.392753297751230135e-01
+8.445531134701587117e-01 5.062180669436533442e-01 4.362490569289804720e-01
+8.428274070171406507e-01 5.013392068558483183e-01 4.333111196492664408e-01
+8.410703541185753362e-01 4.964699646160714575e-01 4.304615283001137493e-01
+8.392811521535089581e-01 4.916110207509353791e-01 4.277001760608312164e-01
+8.374593644075595256e-01 4.867627987429819503e-01 4.250269048992098009e-01
+8.356043139975503076e-01 4.819259312622626301e-01 4.224414243859783702e-01
+8.337148868611683472e-01 4.771014353948369036e-01 4.199431953989596344e-01
+8.317904658009995789e-01 4.722899701137897588e-01 4.175316375108732991e-01
+8.298304844983901418e-01 4.674921821164159108e-01 4.152060584430907197e-01
+8.278344282915189867e-01 4.627087037890093568e-01 4.129656573155296440e-01
+8.258018346451376779e-01 4.579401513029328075e-01 4.108095284678619508e-01
+8.237322933175019735e-01 4.531871228543432051e-01 4.087366658020525345e-01
+8.216256878784896633e-01 4.484499819155622347e-01 4.067461112065531847e-01
+8.194815690724320811e-01 4.437294051177347876e-01 4.048366204140803060e-01
+8.172995050178583076e-01 4.390260854893064946e-01 4.030068099238640067e-01
+8.150792968857805132e-01 4.343405321271661679e-01 4.012553165972070901e-01
+8.128207950280410543e-01 4.296732294003547947e-01 3.995807052170325946e-01
+8.105238975108269850e-01 4.250246362540385792e-01 3.979814747698801614e-01
+8.081885484630557670e-01 4.203951856851556590e-01 3.964560648094507256e-01
+8.058148470586988799e-01 4.157851737769109879e-01 3.950029765120905423e-01
+8.034026962411985329e-01 4.111951046689115152e-01 3.936204324142628108e-01
+8.009521378981909745e-01 4.066253627118514569e-01 3.923066947182650144e-01
+7.984632874676697023e-01 4.020762706733001512e-01 3.910600267933756480e-01
+7.959362958998934534e-01 3.975481251157440554e-01 3.898786646276527490e-01
+7.933713473226599033e-01 3.930411968130258504e-01 3.887608225579017307e-01
+7.907686574783574507e-01 3.885557303926693296e-01 3.877046999689159890e-01
+7.881284544156301752e-01 3.840919640902587529e-01 3.867084595587381712e-01
+7.854510012103226302e-01 3.796501032751679605e-01 3.857702673246294345e-01
+7.827365958532629397e-01 3.752303177293505598e-01 3.848883050999601374e-01
+7.799855573279415033e-01 3.708327552306592834e-01 3.840607581802352732e-01
+7.771982233463431422e-01 3.664575425267851405e-01 3.832858192234025463e-01
+7.743749481448563010e-01 3.621047863617611329e-01 3.825616918198675998e-01
+7.715160518337467188e-01 3.577746368683014655e-01 3.818864831434901075e-01
+7.686219524815265380e-01 3.534671195520193154e-01 3.812584982442814296e-01
+7.656930517948008497e-01 3.491822750013692245e-01 3.806760122706670524e-01
+7.627297518608332494e-01 3.449201381780978570e-01 3.801373059981723590e-01
+7.597324610418284552e-01 3.406807299395016586e-01 3.796406843015277532e-01
+7.567015922742318379e-01 3.364640582281425152e-01 3.791844777860022275e-01
+7.536375467881040180e-01 3.322701411099439062e-01 3.787669970190922220e-01
+7.505407196227874556e-01 3.280990002753491619e-01 3.783865433211569540e-01
+7.474115712082280982e-01 3.239505493622616417e-01 3.780416634360889150e-01
+7.442505183508412170e-01 3.198247550352249502e-01 3.777308063416947026e-01
+7.410579750279425726e-01 3.157215772518807695e-01 3.774524509829353947e-01
+7.378343512384677449e-01 3.116409704467773545e-01 3.772051064266770948e-01
+7.345800519344474200e-01 3.075828847103421748e-01 3.769873118279194468e-01
+7.312954622460766663e-01 3.035472925968438762e-01 3.767975677519167510e-01
+7.279809779377566237e-01 2.995341347142527755e-01 3.766344783074295766e-01
+7.246370003939071047e-01 2.955433232127043786e-01 3.764967560209065978e-01
+7.212639047983969709e-01 2.915748020657008555e-01 3.763830604225979481e-01
+7.178620569041518351e-01 2.876285169108695472e-01 3.762920784118068407e-01
+7.144318123927204667e-01 2.837044162122266955e-01 3.762225233422813453e-01
+7.109735162895217675e-01 2.798024524280844916e-01 3.761731340017399616e-01
+7.074875003639726767e-01 2.759225885803616163e-01 3.761426556123988463e-01
+7.039740902088845731e-01 2.720647802144139371e-01 3.761299015349165442e-01
+7.004335983291459788e-01 2.682289908573779469e-01 3.761337091569335600e-01
+6.968663212773178461e-01 2.644152012227610760e-01 3.761529095527339495e-01
+6.932725426766019883e-01 2.606234021780075572e-01 3.761863526116585033e-01
+6.896525329109274294e-01 2.568535960113472738e-01 3.762329055321002591e-01
+6.860065488492232966e-01 2.531057977294109973e-01 3.762914512548127810e-01
+6.823348363761195801e-01 2.493800214422073891e-01 3.763609500820121467e-01
+6.786376242649662105e-01 2.456763038128263466e-01 3.764403535110733556e-01
+6.749151231751110425e-01 2.419947210999891518e-01 3.765285264384131692e-01
+6.711675324616499516e-01 2.383353539955441192e-01 3.766243994612780699e-01
+6.673950369964636309e-01 2.346983031289386346e-01 3.767269100578239382e-01
+6.635978070649097837e-01 2.310836906390836831e-01 3.768350007100279009e-01
+6.597759982863891093e-01 2.274916618065601082e-01 3.769476169820946132e-01
+6.559297473209481089e-01 2.239223513030393353e-01 3.770639116649144307e-01
+6.520591754729223588e-01 2.203759654266244650e-01 3.771828077558652681e-01
+6.481643941443696599e-01 2.168527541906234979e-01 3.773031206968150975e-01
+6.442454984979625321e-01 2.133529749202845993e-01 3.774237883397635329e-01
+6.403025689859566105e-01 2.098769174022531714e-01 3.775437410683403772e-01
+6.363356714241054091e-01 2.064249059420060206e-01 3.776618996147099727e-01
+6.323448551853009247e-01 2.029972985879547887e-01 3.777771986896097389e-01
+6.283301122985771592e-01 1.995944416686266654e-01 3.778890664877021521e-01
+6.242914965761068302e-01 1.962168403108488501e-01 3.779958773221168133e-01
+6.202290151835444521e-01 1.928649814733044143e-01 3.780964890449534654e-01
+6.161426615427991749e-01 1.895393981082279800e-01 3.781897379927290359e-01
+6.120324156302930918e-01 1.862406715933664081e-01 3.782744366000001524e-01
+6.078982443238682976e-01 1.829694341941491276e-01 3.783493709986866516e-01
+6.037399990506459035e-01 1.797263486622488471e-01 3.784140428470601503e-01
+5.995576965897967403e-01 1.765121975913181707e-01 3.784665259488561584e-01
+5.953512720943007208e-01 1.733277858871770660e-01 3.785054621982753553e-01
+5.911206437729070728e-01 1.701739770998706713e-01 3.785295035265708874e-01
+5.868657195674668037e-01 1.670516976788867514e-01 3.785372630540221883e-01
+5.825863435035250060e-01 1.639619511220119508e-01 3.785276019365447775e-01
+5.782823203682633251e-01 1.609058321765788335e-01 3.784994295515334839e-01
+5.739536466014196758e-01 1.578844538430557720e-01 3.784505787767488694e-01
+5.696001981012460691e-01 1.548990153349074916e-01 3.783794775494400686e-01
+5.652218458222221242e-01 1.519507861175737884e-01 3.782845039525286057e-01
+5.608184279263467298e-01 1.490411220014642157e-01 3.781641038386275300e-01
+5.563896048179566289e-01 1.461715605343842650e-01 3.780173288805740439e-01
+5.519354537512982661e-01 1.433434802585686063e-01 3.778414852793369194e-01
+5.474558435278772395e-01 1.405584279152288785e-01 3.776347269993366451e-01
+5.429506470730138812e-01 1.378180135121435668e-01 3.773951523619960002e-01
+5.384196501144510316e-01 1.351239813932839096e-01 3.771211030874267456e-01
+5.338626135422905872e-01 1.324781762459926737e-01 3.768109124380045194e-01
+5.292796498492590151e-01 1.298822067930652524e-01 3.764618033826110377e-01
+5.246706783487381509e-01 1.273378756852094063e-01 3.760716446399895441e-01
+5.200356363922209457e-01 1.248470120733735367e-01 3.756382551974452033e-01
+5.153742367301422656e-01 1.224117140591406694e-01 3.751600258018771838e-01
+5.106866581816573714e-01 1.200336468026920456e-01 3.746341300161435961e-01
+5.059729862980435477e-01 1.177145617740232852e-01 3.740580772636119544e-01
+5.012332745984564575e-01 1.154562389937715539e-01 3.734295174784395543e-01
+4.964674957217509177e-01 1.132605442683873864e-01 3.727463195168757570e-01
+4.916758190194626121e-01 1.111290906599490258e-01 3.720059818290880060e-01
+4.868585609140311798e-01 1.090632523851999269e-01 3.712058226357082269e-01
+4.820159589014604840e-01 1.070644243738244350e-01 3.703434438399521023e-01
+4.771482837998479165e-01 1.051338742417683159e-01 3.694164970204523168e-01
+4.722559296975721854e-01 1.032725993184717139e-01 3.684225499867860298e-01
+4.673393879073711177e-01 1.014813305146687883e-01 3.673591735272957459e-01
+4.623991454541829804e-01 9.976065343840129218e-02 3.662241176536292220e-01
+4.574358041489324234e-01 9.811082191626963045e-02 3.650151416090168244e-01
+4.524502157463570762e-01 9.653152558968838837e-02 3.637298817526759542e-01
+4.474429556959144683e-01 9.502266265951053725e-02 3.623665563347658880e-01
+4.424148033564082039e-01 9.358361785401031474e-02 3.609233190012756665e-01
+4.373666093617918915e-01 9.221344371517425920e-02 3.593984619211612608e-01
+4.323000061476657274e-01 9.090969474799345806e-02 3.577897503619592023e-01
+4.272154852828886629e-01 8.967151542383772211e-02 3.560963875772367726e-01
+4.221140984792258188e-01 8.849693359303587026e-02 3.543172112905775273e-01
+4.169969758462759302e-01 8.738362154375492463e-02 3.524512375858371849e-01
+4.118658301965831270e-01 8.632803919827600203e-02 3.504973239811765007e-01
+4.067221669675408213e-01 8.532676500724681312e-02 3.484548346345710534e-01
+4.015666852977432533e-01 8.437757766440442952e-02 3.463238990387739746e-01
+3.964007130297593218e-01 8.347701754004596686e-02 3.441044235724556866e-01
+3.912256097683191602e-01 8.262141527259461715e-02 3.417965388380971303e-01
+3.860430941874281596e-01 8.180633277581816909e-02 3.394004639140563162e-01
+3.808555339288969832e-01 8.102605665725876039e-02 3.369164884312597086e-01
+3.756631594887540060e-01 8.027857713191724476e-02 3.343459517649038371e-01
+3.704673590324250032e-01 7.955977986332424257e-02 3.316898655204278401e-01
+3.652695090362573227e-01 7.886552703397090025e-02 3.289494343067977944e-01
+3.600709660701238435e-01 7.819169210462800779e-02 3.261260438198446687e-01
+3.548730588141333908e-01 7.753419260275734581e-02 3.232212473818363851e-01
+3.496770804198256477e-01 7.688902041627435069e-02 3.202367511798585031e-01
+3.444853557545813350e-01 7.625034119537774102e-02 3.171743822649770728e-01
+3.392982604990861795e-01 7.561586038621423422e-02 3.140362188799208365e-01
+3.341166082970875029e-01 7.498254313274954619e-02 3.108243324765390669e-01
+3.289414559917514524e-01 7.434697155739058982e-02 3.075408588184366798e-01
+3.237737954171283072e-01 7.370590341662106026e-02 3.041879989569576392e-01
+3.186145498482620964e-01 7.305628171756148315e-02 3.007680026557595920e-01
+3.134645711821229530e-01 7.239524117563511663e-02 2.972831523530131137e-01
+3.083246378402036969e-01 7.172011173017686647e-02 2.937357478389135412e-01
+3.031954533707552635e-01 7.102841937235576664e-02 2.901280917978547591e-01
+2.980776457172774063e-01 7.031788456468926474e-02 2.864624763353166292e-01
+2.929717671102379239e-01 6.958641854495320467e-02 2.827411705802333475e-01
+2.878782945311796904e-01 6.883211781082057557e-02 2.789664094251954607e-01
+2.827976306923836725e-01 6.805325707674123037e-02 2.751403834400568682e-01
+2.777301054710668571e-01 6.724828098296936618e-02 2.712652299698696257e-01
+2.726759777346169922e-01 6.641579481976991883e-02 2.673430254060571443e-01
+2.676354374924288515e-01 6.555455450916861104e-02 2.633757786005420098e-01
+2.626097591395918363e-01 6.466149844681601255e-02 2.593660533804174051e-01
+2.575992689989206608e-01 6.373522644476575794e-02 2.553159580518031269e-01
+2.526028775756383737e-01 6.277674824557366584e-02 2.512267303676423147e-01
+2.476205211412589313e-01 6.178532806314660647e-02 2.471000835041496368e-01
+2.426520784951842757e-01 6.076032925135082391e-02 2.429376426307544024e-01
+2.376973739685813714e-01 5.970120319443159712e-02 2.387409437758167274e-01
+2.327561803770203386e-01 5.860747847771281133e-02 2.345114333677875140e-01
+2.278285229664566147e-01 5.747825339035907838e-02 2.302506881609430733e-01
+2.229180662380075839e-01 5.630663136815370479e-02 2.259630047830259447e-01
+2.180204522985965676e-01 5.509893160286010588e-02 2.216467626153181270e-01
+2.131352588343927157e-01 5.385491895770589538e-02 2.173030574920574165e-01
+2.082620235717315138e-01 5.257438772048273617e-02 2.129328977906284059e-01
+2.034002463374002811e-01 5.125715285178860520e-02 2.085372063771265272e-01]; 
+
+   case 'amp' 
+      RGB = [9.463470914425774483e-01 9.290101343908121478e-01 9.257532417012246384e-01
+9.437115115548888600e-01 9.244624965319422349e-01 9.206701514370421169e-01
+9.413263164430620833e-01 9.198473615841167295e-01 9.154240958990897958e-01
+9.390547090113202655e-01 9.152093965940418796e-01 9.101090387889319011e-01
+9.368634575300728295e-01 9.105592179043572321e-01 9.047473920040983719e-01
+9.347358946162058757e-01 9.059020202913443676e-01 8.993502288257003707e-01
+9.326614522721177192e-01 9.012410121503533489e-01 8.939244930449518067e-01
+9.306333250978273686e-01 8.965781745298962990e-01 8.884745648022901454e-01
+9.286461606427048876e-01 8.919150224616214651e-01 8.830038737434344753e-01
+9.266960476646858291e-01 8.872526027444326280e-01 8.775148739503740858e-01
+9.247795820079757201e-01 8.825918040419664656e-01 8.720097084454925263e-01
+9.228944807039246578e-01 8.779331456742857087e-01 8.664897344910690302e-01
+9.210380342808240917e-01 8.732773006486703737e-01 8.609566713320465636e-01
+9.192087851735465387e-01 8.686245228987975464e-01 8.554113284148980867e-01
+9.174048150925064871e-01 8.639752297661511538e-01 8.498548926033711037e-01
+9.156244455582711606e-01 8.593297631172468476e-01 8.442883976261035262e-01
+9.138671371679708555e-01 8.546880756641417332e-01 8.387120160257571788e-01
+9.121305737300281491e-01 8.500507404321120397e-01 8.331273220967562176e-01
+9.104149075499773369e-01 8.454174764656698926e-01 8.275339791691540547e-01
+9.087182868982504047e-01 8.407887046755945226e-01 8.219332381316957203e-01
+9.070398066265998871e-01 8.361645202367321561e-01 8.163256242481420344e-01
+9.053796160871283583e-01 8.315446471258203243e-01 8.107108259382036497e-01
+9.037352419915254398e-01 8.269297416714002091e-01 8.050906531516163200e-01
+9.021080083908009639e-01 8.223191128622155954e-01 7.994638601040017223e-01
+9.004956244333240933e-01 8.177133605075642686e-01 7.938321412777887831e-01
+8.988977241110835958e-01 8.131124010808855607e-01 7.881956419539296599e-01
+8.973148627806266653e-01 8.085158161746068828e-01 7.825537446961500221e-01
+8.957442417382828204e-01 8.039244072828748422e-01 7.769086245337948338e-01
+8.941881096565635900e-01 7.993371392915321616e-01 7.712582600059587623e-01
+8.926437234223070227e-01 7.947548018176209261e-01 7.656048088583016220e-01
+8.911109613594879741e-01 7.901772295732085727e-01 7.599482475326526654e-01
+8.895909134152744091e-01 7.856038035950861920e-01 7.542875143411862382e-01
+8.880802871606852111e-01 7.810355387672826000e-01 7.486252986030703660e-01
+8.865819248532246233e-01 7.764711589075004028e-01 7.429590373479496579e-01
+8.850930260657449145e-01 7.719115034698935673e-01 7.372910251414285243e-01
+8.836131402967402071e-01 7.673565360639147404e-01 7.316215502737657417e-01
+8.821444223454562028e-01 7.628052217660783452e-01 7.259486135652994943e-01
+8.806827953756125593e-01 7.582589101067193083e-01 7.202756895379377466e-01
+8.792311851397603961e-01 7.537162649935950087e-01 7.146000961578288235e-01
+8.777875677079440830e-01 7.491778548550656058e-01 7.089235227883947665e-01
+8.763501988878248383e-01 7.446441541668697983e-01 7.032474436364752890e-01
+8.749232756241082098e-01 7.401133023432254765e-01 6.975679937396324082e-01
+8.735014600514631189e-01 7.355871888710872053e-01 6.918898915870100863e-01
+8.720870217729678187e-01 7.310647072768980959e-01 6.862110066741609060e-01
+8.706800348126626510e-01 7.265456103843925817e-01 6.805311805702053407e-01
+8.692770022519556994e-01 7.220310948598716028e-01 6.748535454654478460e-01
+8.678827146915726320e-01 7.175190094979648769e-01 6.691736166956238074e-01
+8.664927921052477666e-01 7.130109157552886323e-01 6.634953613259193528e-01
+8.651068719926267025e-01 7.085067580022798017e-01 6.578190657407729791e-01
+8.637289803901067042e-01 7.040046558915140640e-01 6.521408976142408775e-01
+8.623534679961476490e-01 6.995067341461493893e-01 6.464660893001026309e-01
+8.609830606578612322e-01 6.950116457163946215e-01 6.407920274183934728e-01
+8.596180478330472940e-01 6.905190440208218705e-01 6.351183727606340979e-01
+8.582544825018789680e-01 6.860303869186620274e-01 6.294488360238388314e-01
+8.568970944227636277e-01 6.815434400545420379e-01 6.237788543057761759e-01
+8.555425925651013452e-01 6.770593865574592307e-01 6.181115291897923969e-01
+8.541886800910097888e-01 6.725790118919016125e-01 6.124490539806487499e-01
+8.528418735895523239e-01 6.680992506239646911e-01 6.067850786519378703e-01
+8.514956700712879023e-01 6.636227191543088155e-01 6.011258775897345696e-01
+8.501500355486913962e-01 6.591492264653023847e-01 5.954714806881288292e-01
+8.488106382652110815e-01 6.546760150904927800e-01 5.898162979999663769e-01
+8.474706581846417341e-01 6.502059048227525340e-01 5.841670108646530579e-01
+8.461313452075343022e-01 6.457381204225883797e-01 5.785223911431566224e-01
+8.447969154607379849e-01 6.412705018379197819e-01 5.728782339090506825e-01
+8.434612056654142709e-01 6.368056357299208825e-01 5.672406638938772838e-01
+8.421258352164873173e-01 6.323425572542190620e-01 5.616080798917625350e-01
+8.407944708783339216e-01 6.278793105389963713e-01 5.559767932481035624e-01
+8.394611847956942041e-01 6.234184331258648681e-01 5.503527766345649441e-01
+8.381273683455257029e-01 6.189590462186138620e-01 5.447346560426542528e-01
+8.367972635859407537e-01 6.144988712509784623e-01 5.391181340824646728e-01
+8.354646463246349075e-01 6.100406459813725313e-01 5.335095625632335636e-01
+8.341299717058989760e-01 6.055839279215072812e-01 5.279085280772741751e-01
+8.327994021627661558e-01 6.011254425561419756e-01 5.223087380798424606e-01
+8.314657754399900069e-01 5.966684488411785336e-01 5.167175843922774403e-01
+8.301288592609736838e-01 5.922128365915518833e-01 5.111353769747372100e-01
+8.287951011685089631e-01 5.877551092176589442e-01 5.055554913593263144e-01
+8.274588476811213233e-01 5.832978393600145584e-01 4.999838390239015884e-01
+8.261188250087038165e-01 5.788414339387950580e-01 4.944218283197156505e-01
+8.247786369803286055e-01 5.743837798031475872e-01 4.888657757771856516e-01
+8.234381838800088893e-01 5.699246359812502050e-01 4.833158537977020885e-01
+8.220935149852323098e-01 5.654657957469002572e-01 4.777762994077761616e-01
+8.207444566974767541e-01 5.610071021581608530e-01 4.722474096096786478e-01
+8.193981033425531413e-01 5.565444762341525964e-01 4.667217962382390062e-01
+8.180472685091408902e-01 5.520814646564632389e-01 4.612071590527028753e-01
+8.166916431769154494e-01 5.476179715812223847e-01 4.557039631596026541e-01
+8.153328745786677656e-01 5.431528161626910656e-01 4.502105997079735578e-01
+8.139743540529152943e-01 5.386837997184832361e-01 4.447235925743368568e-01
+8.126106579688792131e-01 5.342136249170785778e-01 4.392488743242201066e-01
+8.112416585089723409e-01 5.297420805368263652e-01 4.337867573467541482e-01
+8.098689150112462487e-01 5.252679783528519941e-01 4.283357546423488538e-01
+8.084956135344389949e-01 5.207891399756702233e-01 4.228926326123328416e-01
+8.071166424763304148e-01 5.163081809730883931e-01 4.174630770396351442e-01
+8.057318945579315939e-01 5.118248549122679236e-01 4.120474263101407963e-01
+8.043412708255589516e-01 5.073389039757838503e-01 4.066460228640024210e-01
+8.029498733805645605e-01 5.028469116894594970e-01 4.012536130705923743e-01
+8.015531888402489535e-01 4.983512104818560995e-01 3.958753217358975118e-01
+8.001502657810105612e-01 4.938520308181937879e-01 3.905124577505094119e-01
+7.987410157112331266e-01 4.893490771437783438e-01 3.851654167818974739e-01
+7.973253554907255847e-01 4.848420416222078422e-01 3.798346066585175373e-01
+7.959075773999774173e-01 4.803278114438007118e-01 3.745157291750967898e-01
+7.944838857609586302e-01 4.758083650556605426e-01 3.692132449197628175e-01
+7.930533836294737515e-01 4.712838795689627269e-01 3.639285059842314873e-01
+7.916159847493996482e-01 4.667540085796573757e-01 3.586620124504662499e-01
+7.901716040813833164e-01 4.622183930878590030e-01 3.534142884263108408e-01
+7.887201567691978221e-01 4.576766614569128255e-01 3.481858850345221357e-01
+7.872638957915846225e-01 4.531268310219068174e-01 3.429748729037092048e-01
+7.858016971109998972e-01 4.485691650403910713e-01 3.377829921447058070e-01
+7.843319196766078694e-01 4.440043051111859929e-01 3.326125640359084423e-01
+7.828544529945841157e-01 4.394318439857143876e-01 3.274643000606006771e-01
+7.813691807701973469e-01 4.348513628187685720e-01 3.223389566893520852e-01
+7.798759793897394044e-01 4.302624315207902450e-01 3.172373399087716761e-01
+7.783747162977331380e-01 4.256646092089760858e-01 3.121603100704657408e-01
+7.768652482649208713e-01 4.210574447687118194e-01 3.071087870719240720e-01
+7.753474195428932125e-01 4.164404775377301138e-01 3.020837558793280642e-01
+7.738210599017090185e-01 4.118132381262810671e-01 2.970862723999735389e-01
+7.722859825475274498e-01 4.071752493875019363e-01 2.921174697090146433e-01
+7.707419819180442166e-01 4.025260275530667675e-01 2.871785646313976814e-01
+7.691888313545882649e-01 3.978650835500125438e-01 2.822708646751007633e-01
+7.676262806509283054e-01 3.931919245154482101e-01 2.773957753058901021e-01
+7.660540534803422785e-01 3.885060555265225091e-01 2.725548075466420750e-01
+7.644718447042359033e-01 3.838069815635994364e-01 2.677495858756240299e-01
+7.628793175676447103e-01 3.790942097250059595e-01 2.629818563878072446e-01
+7.612761007893139586e-01 3.743672517119065457e-01 2.582534951710902527e-01
+7.596617855567490141e-01 3.696256266018116965e-01 2.535665168349998111e-01
+7.580359224396768791e-01 3.648688639288839575e-01 2.489230831128432242e-01
+7.563980182387591844e-01 3.600965070884658559e-01 2.443255114391649219e-01
+7.547475327902162245e-01 3.553081170821107415e-01 2.397762833825934359e-01
+7.530838757510928128e-01 3.505032766177708092e-01 2.352780527895846907e-01
+7.514064033944252152e-01 3.456815945775675858e-01 2.308336534671754370e-01
+7.497144154482878742e-01 3.408427108627715696e-01 2.264461062026797977e-01
+7.480093931719870026e-01 3.359841374696425076e-01 2.221167453210010634e-01
+7.462904219476443890e-01 3.311055722690471881e-01 2.178492138304993775e-01
+7.445546708594931173e-01 3.262086086142511610e-01 2.136488350090644528e-01
+7.428011522578348291e-01 3.212930797652773784e-01 2.095194932063288440e-01
+7.410289292300998865e-01 3.163587556773898579e-01 2.054651883130465539e-01
+7.392422371017411953e-01 3.113999367010875097e-01 2.014864526930904010e-01
+7.374344355234756510e-01 3.064221768888288899e-01 1.975919663992890540e-01
+7.356041908206575330e-01 3.014256456718681365e-01 1.937864841719280640e-01
+7.337546411878117514e-01 2.964055318272263428e-01 1.900722381207737011e-01
+7.318814451569350954e-01 2.913651536558918287e-01 1.864564514321402355e-01
+7.299813549163196580e-01 2.863068267986909055e-01 1.829454454677189867e-01
+7.280589696708802405e-01 2.812237436541007995e-01 1.795417572234761505e-01
+7.261058295804370122e-01 2.761243371138519809e-01 1.762545002124356330e-01
+7.241247102013246284e-01 2.710038520778982329e-01 1.730875525793737491e-01
+7.221106804386585587e-01 2.658668602953934146e-01 1.700480125370592843e-01
+7.200637636280236009e-01 2.607119201605753722e-01 1.671411340183387162e-01
+7.179797241720924372e-01 2.555430923618877692e-01 1.643731951674216596e-01
+7.158585660201038925e-01 2.503590497486887223e-01 1.617494125495184398e-01
+7.136946458601574061e-01 2.451661844345556784e-01 1.592752687470095629e-01
+7.114894074734618989e-01 2.399613853901303440e-01 1.569555549892431845e-01
+7.092368038757341786e-01 2.347521795395665634e-01 1.547943364998323190e-01
+7.069352804131667778e-01 2.295401028324536297e-01 1.527950884695459255e-01
+7.045831993890990796e-01 2.243269505217069248e-01 1.509608633015488421e-01
+7.021764206472544956e-01 2.191186683316911910e-01 1.492928085088980894e-01
+6.997128684389145592e-01 2.139184608731344861e-01 1.477916611410667047e-01
+6.971911916356166028e-01 2.087286324898059431e-01 1.464577951274126655e-01
+6.946080256946649545e-01 2.035552197097931226e-01 1.452888805599515110e-01
+6.919615635162069678e-01 1.984021504802455094e-01 1.442823442764895880e-01
+6.892502621260994111e-01 1.932732898312458647e-01 1.434346916240710201e-01
+6.864728173440260983e-01 1.881724668500568132e-01 1.427415573021981465e-01
+6.836276497375878280e-01 1.831044861638990162e-01 1.421968539256191488e-01
+6.807138936899735926e-01 1.780732451543534933e-01 1.417942947939738185e-01
+6.777309286205458472e-01 1.730825547177755885e-01 1.415269568275668299e-01
+6.746783856387729150e-01 1.681360921159456845e-01 1.413874528291547972e-01
+6.715560313350845689e-01 1.632376302346780217e-01 1.413677792054587046e-01
+6.683639211377226941e-01 1.583906644890515358e-01 1.414598772073469568e-01
+6.651023056640176234e-01 1.535985670708633066e-01 1.416556412086291405e-01
+6.617715794982882427e-01 1.488646699200451562e-01 1.419469640184388703e-01
+6.583721731985413550e-01 1.441925388486675619e-01 1.423253876471278490e-01
+6.549047613747174257e-01 1.395853626420375526e-01 1.427832909133252004e-01
+6.513700233144809060e-01 1.350465677963595956e-01 1.433130440041158193e-01
+6.477686724727176326e-01 1.305797355595543496e-01 1.439072462489923432e-01
+6.441014028993071738e-01 1.261888040474711814e-01 1.445583185074540422e-01
+6.403689740006455189e-01 1.218777495533199251e-01 1.452593821489098769e-01
+6.365721433135939078e-01 1.176507620626412731e-01 1.460041387809807023e-01
+6.327116135602410818e-01 1.135124987936143026e-01 1.467862349801432043e-01
+6.287880597206695343e-01 1.094681045314993273e-01 1.475989566519263774e-01
+6.248021600743940418e-01 1.055229431116234684e-01 1.484364140781085362e-01
+6.207545450778898521e-01 1.016827736772349666e-01 1.492933020681679601e-01
+6.166458126074587653e-01 9.795388132578869422e-02 1.501640386258630555e-01
+6.124766416655831325e-01 9.434293988806133346e-02 1.510418818628477822e-01
+6.082475860694411818e-01 9.085689252672626837e-02 1.519224424106922766e-01
+6.039592307964848361e-01 8.750309254173271878e-02 1.528005492303129986e-01
+5.996123270243045589e-01 8.428892340087804080e-02 1.536699242631612283e-01
+5.952075850399283219e-01 8.122188415501030434e-02 1.545253736600938343e-01
+5.907456431322212209e-01 7.830966313722748096e-02 1.553624952709374007e-01
+5.862275380722600238e-01 7.555913263658070589e-02 1.561749022891834038e-01
+5.816543085194019191e-01 7.297679500504322680e-02 1.569571524895727321e-01
+5.770267606447557762e-01 7.056924923284621509e-02 1.577054842373717958e-01
+5.723466647463710810e-01 6.834024207619035507e-02 1.584124407437495219e-01
+5.676151929412465158e-01 6.629402087598951221e-02 1.590741634973840690e-01
+5.628336935771917071e-01 6.443348056543876656e-02 1.596865619581833706e-01
+5.580050003714496221e-01 6.275633232081309631e-02 1.602413164863800144e-01
+5.531297300263749994e-01 6.126496600367018625e-02 1.607383872225261745e-01
+5.482116402359448193e-01 5.995167246350390639e-02 1.611686284256901580e-01
+5.432516061451815315e-01 5.881547808076787592e-02 1.615323341086055964e-01
+5.382535120903690906e-01 5.784532671126727671e-02 1.618221724924289173e-01
+5.332186175206464762e-01 5.703660923770780683e-02 1.620384025483199708e-01
+5.281513818389996784e-01 5.637398150597446728e-02 1.621742451273615881e-01
+5.230520756324539278e-01 5.585383743496476899e-02 1.622329744665089168e-01
+5.179273401770114749e-01 5.545235617321788574e-02 1.622049347095048388e-01
+5.127760391281988017e-01 5.516900039838320419e-02 1.620968226308776017e-01
+5.076034324141470711e-01 5.498326606891081741e-02 1.619030677004743290e-01
+5.024122108869354397e-01 5.488240340299161552e-02 1.616236282627719067e-01
+4.972028565812885437e-01 5.486041454189729411e-02 1.612621553479370584e-01
+4.919800125101927990e-01 5.489873490341760226e-02 1.608156853259256336e-01
+4.867469976088732442e-01 5.498319810891529741e-02 1.602839538682285792e-01
+4.815035401048063934e-01 5.511074616505500651e-02 1.596718589083305773e-01
+4.762519241645499224e-01 5.527092475320084103e-02 1.589804323039821221e-01
+4.709943156232950234e-01 5.545404644646995812e-02 1.582109529908402590e-01
+4.657362887691403608e-01 5.564106402926658618e-02 1.573608184133624133e-01
+4.604760106385220042e-01 5.583489737898188893e-02 1.564363997859181399e-01
+4.552150906427448462e-01 5.602873466021515009e-02 1.554396278095509509e-01
+4.499550509587917912e-01 5.621638605393316362e-02 1.543724780354263082e-01
+4.446972616844994119e-01 5.639243657216582578e-02 1.532370205267698793e-01
+4.394429409822757093e-01 5.655220574247237647e-02 1.520353945457279254e-01
+4.341931570608791313e-01 5.669170022106548995e-02 1.507697850177304177e-01
+4.289488317782668703e-01 5.680756188500035025e-02 1.494424009624717165e-01
+4.237107456338875533e-01 5.689701352302534848e-02 1.480554560097830374e-01
+4.184795439135307604e-01 5.695780383827742793e-02 1.466111510548973595e-01
+4.132557437526688804e-01 5.698815310778364979e-02 1.451116590521219496e-01
+4.080397418937663501e-01 5.698670052046273665e-02 1.435591118993865545e-01
+4.028318229277383922e-01 5.695245393890951274e-02 1.419555893285963655e-01
+3.976321678282654926e-01 5.688474259913823411e-02 1.403031096878759043e-01
+3.924408626085833518e-01 5.678317307342812398e-02 1.386036224809996942e-01
+3.872615129675306966e-01 5.663896210711539397e-02 1.368568732654815434e-01
+3.820928251575063661e-01 5.645532265747305739e-02 1.350656214594591342e-01
+3.769329700865952648e-01 5.623657775378711893e-02 1.332326547817182794e-01
+3.717817181595340914e-01 5.598316066775241989e-02 1.313596470261583493e-01
+3.666387821359218258e-01 5.569561666867810928e-02 1.294481844724836295e-01
+3.615063297404105258e-01 5.536890534251808632e-02 1.274985831214487109e-01
+3.563880603817025094e-01 5.499475479736596478e-02 1.255105734342905621e-01
+3.512776042297060530e-01 5.458755525687735560e-02 1.234884411194991649e-01
+3.461744793988128510e-01 5.414817693699586904e-02 1.214334602338749125e-01
+3.410813090262644343e-01 5.367068674831452363e-02 1.193455923090092352e-01
+3.360026615292399654e-01 5.314516420281268499e-02 1.172242123426087412e-01
+3.309302966511110111e-01 5.258939733233552322e-02 1.150735180048746420e-01
+3.258636162106021694e-01 5.200433045735335796e-02 1.128944817728364247e-01
+3.208133832347068171e-01 5.136699574271335472e-02 1.106843415414836551e-01
+3.157696216592825178e-01 5.069836482305852682e-02 1.084473347788683095e-01
+3.107301266925714400e-01 5.000263599039595636e-02 1.061847548036680688e-01
+3.057061331880795430e-01 4.925629172594595678e-02 1.038940386221758327e-01
+3.006879268630521240e-01 4.847913366710451116e-02 1.015787046192155041e-01
+2.956726217207689689e-01 4.767654364208809975e-02 9.923998323658683729e-02
+2.906746306466351792e-01 4.681900231021129261e-02 9.687492161154248604e-02
+2.856782002647242358e-01 4.593789236755790178e-02 9.448789214269404102e-02
+2.806890017083342181e-01 4.502128372335665457e-02 9.207800935320636926e-02
+2.757102955542003464e-01 4.406225179606895054e-02 8.964513100796869804e-02
+2.707312541226000180e-01 4.308157177910076213e-02 8.719176105781661912e-02
+2.657667372933599781e-01 4.204947038025994704e-02 8.471559044612611555e-02
+2.608025053402583393e-01 4.099314121499578883e-02 8.221947676879418077e-02
+2.558451747035172530e-01 3.989182795135969711e-02 7.970262452812598708e-02
+2.508938137991353901e-01 3.876029441108298085e-02 7.716551375026653448e-02
+2.459428063629143790e-01 3.762148549775875400e-02 7.460911056507216199e-02
+2.410021600694670640e-01 3.645746689804394564e-02 7.203245689473128377e-02
+2.360563646646140490e-01 3.529747994604028744e-02 6.943744239412558139e-02]; 
+
+   case 'tem' 
+      RGB = [9.985763296811461798e-01 9.632965417140263442e-01 9.577895036430327247e-01
+9.934918422996558141e-01 9.594375624216472387e-01 9.516983192548315040e-01
+9.883417388454437402e-01 9.556282921109976458e-01 9.455836323325411685e-01
+9.831050718338244510e-01 9.518727670560837018e-01 9.394860306213083101e-01
+9.777785730890226068e-01 9.481687534308861354e-01 9.334364948680430318e-01
+9.723870692594612786e-01 9.445024597948724621e-01 9.274670258562995873e-01
+9.669573847273637002e-01 9.408624710997687268e-01 9.215795307640300971e-01
+9.615066616129493982e-01 9.372434217616608665e-01 9.157560566822336989e-01
+9.560531046363628382e-01 9.336385357088663461e-01 9.099886803187530182e-01
+9.506035559047821826e-01 9.300461763422669392e-01 9.042646579991682199e-01
+9.451563753217823161e-01 9.264682865796181055e-01 8.985697730985615639e-01
+9.397124373542273812e-01 9.229047657151164819e-01 8.928998260600508052e-01
+9.342716413123769437e-01 9.193556495997508016e-01 8.872531405900644375e-01
+9.288308811012930821e-01 9.158223472192428272e-01 8.816263177427966502e-01
+9.233851804191220980e-01 9.123071100087158936e-01 8.760148319228351355e-01
+9.179365336943248188e-01 9.088084827838653901e-01 8.704232606428425889e-01
+9.124832972967743538e-01 9.053269113370198129e-01 8.648517190341429295e-01
+9.070218374764418279e-01 9.018638497314315217e-01 8.592980228813623667e-01
+9.015509263802756745e-01 8.984195016922670307e-01 8.537628451897162352e-01
+8.960718329388820402e-01 8.949928217018373600e-01 8.482495190363266158e-01
+8.905836610629007666e-01 8.915838848352710677e-01 8.427587078675609078e-01
+8.850836254841629724e-01 8.881937049832523412e-01 8.372889893254339411e-01
+8.795708463666609411e-01 8.848223352046364898e-01 8.318410153090299852e-01
+8.740469282893844616e-01 8.814686228402575097e-01 8.264178662740626624e-01
+8.685112937853189941e-01 8.781325055194139084e-01 8.210202040569095638e-01
+8.629633327895804840e-01 8.748139384163003962e-01 8.156486084917724533e-01
+8.573988637074910768e-01 8.715145671024431273e-01 8.103003320898716222e-01
+8.518212329614019973e-01 8.682324447773152043e-01 8.049797193798620132e-01
+8.462299834685677036e-01 8.649674562084326279e-01 7.996873827745283325e-01
+8.406246724049463159e-01 8.617194786977677712e-01 7.944239257301034529e-01
+8.350048677827189847e-01 8.584883831868801440e-01 7.891899443847590900e-01
+8.293671160911614271e-01 8.552754073408689317e-01 7.839836146965878383e-01
+8.237138279483190439e-01 8.520791051833870311e-01 7.788079287668441264e-01
+8.180448941186928558e-01 8.488991950022984900e-01 7.736637090147417961e-01
+8.123599093553812711e-01 8.457355276105180675e-01 7.685515296147656938e-01
+8.066584706735069332e-01 8.425879497641356464e-01 7.634719632765348818e-01
+8.009401766621723207e-01 8.394563042330350777e-01 7.584255820860429376e-01
+7.952028972601549173e-01 8.363411716110775718e-01 7.534118252377455249e-01
+7.894471633387081244e-01 8.332419707110174656e-01 7.484319716624078245e-01
+7.836734962813408645e-01 8.301581353160575327e-01 7.434872090029538416e-01
+7.778815003305534770e-01 8.270894921786368092e-01 7.385781042557458820e-01
+7.720707796269933310e-01 8.240358639329949941e-01 7.337052258319404219e-01
+7.662409381414175824e-01 8.209970689783633313e-01 7.288691437189614986e-01
+7.603915796412942241e-01 8.179729213555224643e-01 7.240704295566047222e-01
+7.545223076817887398e-01 8.149632306197714948e-01 7.193096566367255251e-01
+7.486327256130643759e-01 8.119678017125729896e-01 7.145873998348200029e-01
+7.427219014782563411e-01 8.089866453573647531e-01 7.099039891607071828e-01
+7.367891737192681090e-01 8.060196536672460388e-01 7.052599184573171698e-01
+7.308350860228653989e-01 8.030662448375227580e-01 7.006562091939169123e-01
+7.248592428796667431e-01 8.001262050844080154e-01 6.960934321026465144e-01
+7.188612485448663270e-01 7.971993154607720511e-01 6.915721584188375681e-01
+7.128407070658809852e-01 7.942853517324697243e-01 6.870929595632513376e-01
+7.067972223051004477e-01 7.913840842570615264e-01 6.826564067967675342e-01
+7.007303979576740005e-01 7.884952778644843674e-01 6.782630708517513041e-01
+6.946398375648411561e-01 7.856186917391158042e-01 6.739135215439332471e-01
+6.885251445237092760e-01 7.827540793025653532e-01 6.696083273682165160e-01
+6.823859220949484161e-01 7.799011880964143995e-01 6.653480550814426797e-01
+6.762217734101813038e-01 7.770597596640953508e-01 6.611332692747456941e-01
+6.700323014813579503e-01 7.742295294309987641e-01 6.569645319377305226e-01
+6.638171092147175933e-01 7.714102265818907345e-01 6.528424020163275943e-01
+6.575757994324034073e-01 7.686015739346664377e-01 6.487674349657708284e-01
+6.513079749051275957e-01 7.658032878094622742e-01 6.447401822997557153e-01
+6.450132383997043695e-01 7.630150778921287458e-01 6.407611911364364810e-01
+6.386911927456534466e-01 7.602366470910791874e-01 6.368310037415121361e-01
+6.323414409254812796e-01 7.574676913865331374e-01 6.329501570682624090e-01
+6.259635861936422296e-01 7.547078996712067722e-01 6.291191822939783407e-01
+6.195560972423146406e-01 7.519573115237726535e-01 6.253384926911926822e-01
+6.131191206125891080e-01 7.492154188267443615e-01 6.216087050224498034e-01
+6.066526905401021796e-01 7.464817491552263595e-01 6.179303860708607044e-01
+6.001564124519274124e-01 7.437559595200373685e-01 6.143040456187923715e-01
+5.936298933201957784e-01 7.410376988478269977e-01 6.107301851240671819e-01
+5.870727421002424062e-01 7.383266077479672118e-01 6.072092971993915400e-01
+5.804845702488933279e-01 7.356223182652517067e-01 6.037418650719156288e-01
+5.738649923321349489e-01 7.329244536181049874e-01 6.003283620189617809e-01
+5.672131712764029166e-01 7.302327570205698892e-01 5.969692609600730782e-01
+5.605265661533928023e-01 7.275474322700724583e-01 5.936651120515976654e-01
+5.538072551957783363e-01 7.248673679611095100e-01 5.904163410524770894e-01
+5.470548736207613283e-01 7.221921468817737999e-01 5.872233804977959881e-01
+5.402690647877386176e-01 7.195213413684249382e-01 5.840866494502513495e-01
+5.334494816269396145e-01 7.168545129510710545e-01 5.810065526719623286e-01
+5.265932673521412921e-01 7.141918646847531527e-01 5.779837442967735717e-01
+5.197010257328686933e-01 7.115326679134365007e-01 5.750185876848199484e-01
+5.127738759690677606e-01 7.088760718122417703e-01 5.721113127309581659e-01
+5.058115298480653221e-01 7.062215879970826782e-01 5.692622613027222833e-01
+4.988124547076915882e-01 7.035690215604037956e-01 5.664719533702552434e-01
+4.917741270603506742e-01 7.009183842407572529e-01 5.637411222277634026e-01
+4.846997162615552246e-01 6.982683108816961637e-01 5.610695620964348818e-01
+4.775890398856753039e-01 6.956182556045346077e-01 5.584575291026864230e-01
+4.704389351347622594e-01 6.929683367461523247e-01 5.559058726658481220e-01
+4.632498634530364812e-01 6.903178139102768007e-01 5.534147775766539157e-01
+4.560240745098563253e-01 6.876655632831355502e-01 5.509839689679422170e-01
+4.487598229028739172e-01 6.850113432670585922e-01 5.486140038956078824e-01
+4.414547339722453279e-01 6.823550079810395408e-01 5.463056567639269501e-01
+4.341129901223799714e-01 6.796950319734580415e-01 5.440580596655568701e-01
+4.267325988888523436e-01 6.770311866202418649e-01 5.418718349209995511e-01
+4.193119538935562440e-01 6.743631277083362852e-01 5.397475699351562684e-01
+4.118554481683104340e-01 6.716893377862352965e-01 5.376841277217632165e-01
+4.043593499172888350e-01 6.690098785171258999e-01 5.356826761355167887e-01
+3.968261890078971788e-01 6.663236061846555813e-01 5.337425455110953454e-01
+3.892580517875900981e-01 6.636294950347043642e-01 5.318631054022345817e-01
+3.816510562742471135e-01 6.609275747235534570e-01 5.300456830101799577e-01
+3.740119682194762429e-01 6.582160193662682790e-01 5.282880419647097980e-01
+3.663368289249827603e-01 6.554948605761221625e-01 5.265915743478537525e-01
+3.586308928051362699e-01 6.527625972609284455e-01 5.249544352005411918e-01
+3.508936232465371674e-01 6.500187029053001719e-01 5.233768303957324619e-01
+3.431277348645550562e-01 6.472621506436356809e-01 5.218577640245062321e-01
+3.353355552299603914e-01 6.444920106677175520e-01 5.203963563323180663e-01
+3.275188103490194735e-01 6.417074699067215615e-01 5.189919719540163623e-01
+3.196814435511296515e-01 6.389074409416231060e-01 5.176430585409529384e-01
+3.118254758119217707e-01 6.360911463304157465e-01 5.163488722475468862e-01
+3.039555214161791530e-01 6.332575133378499643e-01 5.151075596956975478e-01
+2.960748324121407205e-01 6.304057046767445049e-01 5.139178767894679867e-01
+2.881881143962810587e-01 6.275347641630057982e-01 5.127779478270290126e-01
+2.803003746086680792e-01 6.246437759477415641e-01 5.116857725517640620e-01
+2.724162323640093031e-01 6.217319406932720893e-01 5.106395912364674050e-01
+2.645425291505308918e-01 6.187983086880044503e-01 5.096365792929340444e-01
+2.566840197606024554e-01 6.158422311486778655e-01 5.086750547256451149e-01
+2.488489441844971561e-01 6.128628192186393875e-01 5.077515718650474907e-01
+2.410430130087069522e-01 6.098595200479223211e-01 5.068641518721540562e-01
+2.332749143253212143e-01 6.068316286127126702e-01 5.060092633925864503e-01
+2.255521696872271886e-01 6.037786523436265984e-01 5.051841613954050070e-01
+2.178835011739876371e-01 6.007001216855215597e-01 5.043855354959408954e-01
+2.102776619158149840e-01 5.975956842983582984e-01 5.036102222376415138e-01
+2.027443124327554802e-01 5.944650539898058694e-01 5.028546409645925364e-01
+1.952924636272905801e-01 5.913080959200207598e-01 5.021159025525618880e-01
+1.879334378838529440e-01 5.881246912104457492e-01 5.013896313522919757e-01
+1.806761031013389140e-01 5.849149331180006905e-01 5.006736479698321585e-01
+1.735328783097749850e-01 5.816789154432452369e-01 4.999631315071642601e-01
+1.665133003434038084e-01 5.784169089899582339e-01 4.992561455145328453e-01
+1.596300036906863895e-01 5.751292412901443107e-01 4.985481743532478860e-01
+1.528937099908951325e-01 5.718163393279495077e-01 4.978371217540351057e-01
+1.463171276735238113e-01 5.684787369209851615e-01 4.971190242696297834e-01
+1.399119531735926458e-01 5.651170059000043544e-01 4.963918396953513335e-01
+1.336912106530599997e-01 5.617318570854707982e-01 4.956519172255148820e-01
+1.276672732366210816e-01 5.583239554235875923e-01 4.948978636889357907e-01
+1.218535592637135234e-01 5.548942058020517321e-01 4.941256571865651481e-01
+1.162631754482068569e-01 5.514432364311973034e-01 4.933355557142476422e-01
+1.109091719419828259e-01 5.479722539284174188e-01 4.925220286879308795e-01
+1.058058868411170528e-01 5.444817357603629615e-01 4.916873206428047927e-01
+1.009651127375016111e-01 5.409730397620680087e-01 4.908260102866368046e-01
+9.640117372078826907e-02 5.374467824904106683e-01 4.899392661237967350e-01
+9.212706115366336990e-02 5.339038791645212001e-01 4.890257976801760109e-01
+8.815110303261089464e-02 5.303457163263245455e-01 4.880817131293228583e-01
+8.448832972524200624e-02 5.267726392289812098e-01 4.871097239159773440e-01
+8.114572394888117102e-02 5.231858403590214923e-01 4.861073630469811557e-01
+7.812721320542403980e-02 5.195865216476734938e-01 4.850725749743695636e-01
+7.544312997722565917e-02 5.159750173542567708e-01 4.840076729265158639e-01
+7.309574065371191032e-02 5.123522156200341904e-01 4.829119931483520367e-01
+7.107372065756567547e-02 5.087198306495862576e-01 4.817814896929000779e-01
+6.938287907938911481e-02 5.050778255979795350e-01 4.806197953737798012e-01
+6.801610562745827315e-02 5.014269919387287500e-01 4.794267081520149909e-01
+6.696293828126623215e-02 4.977680989992983585e-01 4.782021118153178540e-01
+6.619782080433814220e-02 4.941027658684106760e-01 4.769429100625798834e-01
+6.571558023976076246e-02 4.904308747270616498e-01 4.756523204648347991e-01
+6.549820807888259711e-02 4.867530881918184504e-01 4.743305399824718216e-01
+6.552566064603559948e-02 4.830700650743400826e-01 4.729777438223161101e-01
+6.577673858968982601e-02 4.793824370720338179e-01 4.715941633832017588e-01
+6.622677049492370349e-02 4.756910136151853430e-01 4.701794827815656830e-01
+6.685019795786503738e-02 4.719966397538147285e-01 4.687333314519904204e-01
+6.763272639280798471e-02 4.682993582933911436e-01 4.672575858662252890e-01
+6.855374817251533304e-02 4.645996843636931994e-01 4.657526519729214276e-01
+6.959365457471067273e-02 4.608981063279830592e-01 4.642189680611767399e-01
+7.073403782879061907e-02 4.571950861446216208e-01 4.626570010388615928e-01
+7.195781915786156335e-02 4.534910598140922677e-01 4.610672429543411499e-01
+7.324931366840245484e-02 4.497864378980456768e-01 4.594502077591564038e-01
+7.459424408415230023e-02 4.460816060979165276e-01 4.578064283072901808e-01
+7.597971511267428979e-02 4.423769258816079852e-01 4.561364535850265800e-01
+7.739415915996109008e-02 4.386727351476746306e-01 4.544408461640829233e-01
+7.882726258105521300e-02 4.349693489173894201e-01 4.527201798696426915e-01
+8.026987997778653461e-02 4.312670600459782566e-01 4.509750376540915817e-01
+8.171394242970148047e-02 4.275661399451892164e-01 4.492060096666721791e-01
+8.315236408743081897e-02 4.238668393102046350e-01 4.474136915088433031e-01
+8.457895032121595658e-02 4.201693888446985103e-01 4.455986826648858368e-01
+8.598830961259482097e-02 4.164739999785817548e-01 4.437615850971945997e-01
+8.737577058920215078e-02 4.127808655736769361e-01 4.419030019956885491e-01
+8.873730500447504776e-02 4.090901606132017476e-01 4.400235366709063789e-01
+9.006945702453716951e-02 4.054020428715323643e-01 4.381237915805220595e-01
+9.136927887187012987e-02 4.017166535612498035e-01 4.362043674792987491e-01
+9.263427266200571775e-02 3.980341179549674036e-01 4.342658626828024837e-01
+9.386233813144639893e-02 3.943545459798681874e-01 4.323088724355508838e-01
+9.505172587236093706e-02 3.906780327832828914e-01 4.303339883746660766e-01
+9.620003933222870396e-02 3.870047637840662302e-01 4.283416262899890081e-01
+9.729997123759509536e-02 3.833354963232004087e-01 4.263312615677605777e-01
+9.835741884413440328e-02 3.796695548525758634e-01 4.243046936775203282e-01
+9.937169919107982641e-02 3.760069784468507703e-01 4.222625006231348066e-01
+1.003423119365809690e-01 3.723477936835040136e-01 4.202052548968338574e-01
+1.012689167529539358e-01 3.686920150348446112e-01 4.181335233490640069e-01
+1.021513134274243950e-01 3.650396452261166491e-01 4.160478671051655586e-01
+1.029884320307208612e-01 3.613907991323849767e-01 4.139486582680417803e-01
+1.037719209811681642e-01 3.577465259466254266e-01 4.118348877541359032e-01
+1.045112201334900126e-01 3.541056562885774861e-01 4.097088092956981398e-01
+1.052065591856250482e-01 3.504681464569319171e-01 4.075709632165070984e-01
+1.058582376509708545e-01 3.468339423292918222e-01 4.054218838433404359e-01
+1.064666158592602885e-01 3.432029795356145718e-01 4.032620996037361571e-01
+1.070239159802940931e-01 3.395763147211236510e-01 4.010905648833596460e-01
+1.075355258379605550e-01 3.359532282299735328e-01 3.989087127976621017e-01
+1.080052802278752000e-01 3.323331728550899533e-01 3.967176863054378000e-01
+1.084337294201929702e-01 3.287160421828903556e-01 3.945179917556369542e-01
+1.088202096165073185e-01 3.251019032868823211e-01 3.923098843692563453e-01
+1.091556968975302966e-01 3.214920812428978536e-01 3.900919340676701208e-01
+1.094518269158459012e-01 3.178848431435130073e-01 3.878667847148202785e-01
+1.097092559883022234e-01 3.142800415550652815e-01 3.856349205402823110e-01
+1.099286556573810802e-01 3.106775192369479188e-01 3.833968205472055302e-01
+1.100986315611906241e-01 3.070790351009552999e-01 3.811504545068737926e-01
+1.102317288825286901e-01 3.034825829921489193e-01 3.788986922133656954e-01
+1.103290785873510815e-01 2.998879083652261635e-01 3.766420819050353419e-01
+1.103893448894039397e-01 2.962951553198432397e-01 3.743806401368951486e-01
+1.104047114339987423e-01 2.927055780381122019e-01 3.721129484539063559e-01
+1.103867349279119559e-01 2.891171759115234718e-01 3.698417464033080804e-01
+1.103361572207214036e-01 2.855297163446686715e-01 3.675674754730824945e-01
+1.102460152182262176e-01 2.819443225282238785e-01 3.652888319764409086e-01
+1.101198294511886444e-01 2.783603021914852760e-01 3.630068099573608986e-01
+1.099635342633853707e-01 2.747764822051754763e-01 3.607229892872333421e-01
+1.097748910210358808e-01 2.711931376089152246e-01 3.584370856671010852e-01
+1.095478763802813504e-01 2.676112773022403801e-01 3.561478615212890775e-01
+1.092932808921200649e-01 2.640287615628073015e-01 3.538580573547516761e-01
+1.090116287119651528e-01 2.604453159192556266e-01 3.515680214913912693e-01
+1.086913329090623825e-01 2.568630402753477870e-01 3.492750549670107785e-01
+1.083460004297124302e-01 2.532791299120676354e-01 3.469826761312421182e-01
+1.079763885418836000e-01 2.496932209057829977e-01 3.446912766824791197e-01
+1.075713140889580088e-01 2.461073946949010050e-01 3.423980926413837667e-01
+1.071428862568302165e-01 2.425189920877232619e-01 3.401063918909076889e-01
+1.066927192498384747e-01 2.389274243968986799e-01 3.378167764830257158e-01
+1.062093640276061124e-01 2.353348932541681759e-01 3.355262248019345583e-01
+1.057055066316897329e-01 2.317384538919968207e-01 3.332383062494437276e-01
+1.051814556007013568e-01 2.281377376539149293e-01 3.309532535866355762e-01
+1.046272664909374817e-01 2.245346804307608024e-01 3.286682704446855507e-01
+1.040556247342821483e-01 2.209261472703716311e-01 3.263871052200472134e-01
+1.034637486817424901e-01 2.173124203806320875e-01 3.241090419310820314e-01
+1.028468845169810686e-01 2.136942776676366007e-01 3.218326666201724029e-01
+1.022150454689789434e-01 2.100689913462399083e-01 3.195611195376787395e-01
+1.015620277820400430e-01 2.064376400065636719e-01 3.172925125709148420e-01
+1.008900241588315538e-01 2.027992883367119026e-01 3.150275553737127421e-01
+1.002054858430543316e-01 1.991518634625495388e-01 3.127684262427183892e-01
+9.949803783218733044e-02 1.954975058870322413e-01 3.105116763778897337e-01
+9.877832247043097369e-02 1.918329889556127654e-01 3.082609202522414993e-01
+9.804493118338306057e-02 1.881580898967480098e-01 3.060157402408537064e-01
+9.729328810023782359e-02 1.844734436312414905e-01 3.037745103921251633e-01
+9.653316478613682694e-02 1.807757562460599599e-01 3.015407883893915231e-01
+9.575619444438937533e-02 1.770666290075273708e-01 2.993115284087380368e-01
+9.496899572502048859e-02 1.733434725855039771e-01 2.970892156823352059e-01
+9.417284157369981701e-02 1.696050767223750977e-01 2.948744162588470830e-01
+9.336173420340779239e-02 1.658523274558137695e-01 2.926648040593683997e-01
+9.254607948203208423e-02 1.620811665705463311e-01 2.904645825457518593e-01
+9.171714479257989105e-02 1.582931942356169963e-01 2.882702798507874586e-01
+9.088231952195491292e-02 1.544850037627045203e-01 2.860850125083750362e-01
+9.004099984169053328e-02 1.506555099870153513e-01 2.839086654207542693e-01
+8.919012906146844832e-02 1.468043594975814992e-01 2.817400195447572475e-01
+8.833858505105957049e-02 1.429270910011002649e-01 2.795831537842536352e-01
+8.747533041314431435e-02 1.390258052165279645e-01 2.774332852121961235e-01
+8.661249189260347703e-02 1.350944971238551839e-01 2.752961432065319514e-01
+8.574385298640457842e-02 1.311333174761502018e-01 2.731691209373900975e-01
+8.487294239495335457e-02 1.271387529060027943e-01 2.710541708402016137e-01
+8.400180885962132971e-02 1.231074880892656653e-01 2.689526699064171411e-01
+8.312616532498406929e-02 1.190383729463048712e-01 2.668628892216621806e-01
+8.225559928700268419e-02 1.149244079727295142e-01 2.647901677800857390e-01]; 
+
+   case 'ice'
+      RGB = [1.531167435543729846e-02 2.252059388699531942e-02 7.272873735907764425e-02
+1.800549591959003243e-02 2.544551608389769570e-02 7.841879116825511975e-02
+2.090133006203173313e-02 2.852652245071044673e-02 8.407771577420969367e-02
+2.399818650587986005e-02 3.176264327218273481e-02 8.970750416351327972e-02
+2.729775749004114890e-02 3.514909496851363613e-02 9.532647230499821656e-02
+3.080428146052393429e-02 3.867708164670261017e-02 1.009662673440025749e-01
+3.450984373415445089e-02 4.229955636714784889e-02 1.065828165743578915e-01
+3.841359784116892689e-02 4.587404239998996852e-02 1.121776340643418912e-01
+4.245789616397358662e-02 4.939963679832150983e-02 1.177960773094180458e-01
+4.645777532344794875e-02 5.288489849108807955e-02 1.234176036286754041e-01
+5.041621762087678676e-02 5.633788824565918313e-02 1.290216830927681801e-01
+5.433779516873311205e-02 5.975737503280462853e-02 1.346239246672657763e-01
+5.823000255128838593e-02 6.313585840823013329e-02 1.402651739202840087e-01
+6.208647351275981691e-02 6.648865889594307577e-02 1.458921724026617794e-01
+6.590890827576056932e-02 6.981759532833076154e-02 1.515056185497818952e-01
+6.970669712558172360e-02 7.310909804078333241e-02 1.571701055775910905e-01
+7.347360805650121618e-02 7.637815581467355397e-02 1.628308265129313204e-01
+7.720982185882321880e-02 7.962820406611839652e-02 1.684800394051645944e-01
+8.092190572547824923e-02 8.284856571837034833e-02 1.741697304708636207e-01
+8.460722520622676601e-02 8.604719820880801784e-02 1.798725773914293391e-01
+8.826407983557263415e-02 8.923087230589588081e-02 1.855652548242135713e-01
+9.189748856643911723e-02 9.238991627825218766e-02 1.912953251540190358e-01
+9.550605637353798416e-02 9.552936548231369396e-02 1.970466344723810770e-01
+9.908760199831237458e-02 9.865735598928837558e-02 2.027885080271309981e-01
+1.026464276979975609e-01 1.017632832609889626e-01 2.085729006866037794e-01
+1.061807481293115807e-01 1.048533987828409453e-01 2.143771619600378098e-01
+1.096889023760894977e-01 1.079351702016392300e-01 2.201721871249775475e-01
+1.131748168296289048e-01 1.109951338044804781e-01 2.260236443434878173e-01
+1.166355654717963208e-01 1.140448383112346031e-01 2.318836318580280165e-01
+1.200706770784045196e-01 1.170883693387409774e-01 2.377372345137335197e-01
+1.234831126917021182e-01 1.201095785266100835e-01 2.436640854600494177e-01
+1.268694769189046001e-01 1.231271973707054601e-01 2.495809234356071160e-01
+1.302307935855599175e-01 1.261348273230401829e-01 2.555217697948003464e-01
+1.335669536543798996e-01 1.291293381943951213e-01 2.615060473838256017e-01
+1.368768735891793542e-01 1.321228390190112012e-01 2.674792268238664894e-01
+1.401607222303006828e-01 1.351007751267265800e-01 2.735164638309879881e-01
+1.434177197831119077e-01 1.380764808543884503e-01 2.795564348972031099e-01
+1.466474902267766722e-01 1.410468359199091026e-01 2.856183790033576808e-01
+1.498489657362017669e-01 1.440082826282148287e-01 2.917246687573430419e-01
+1.530229361070791771e-01 1.469729643095797900e-01 2.978170527656492372e-01
+1.561658891044421793e-01 1.499237839873007738e-01 3.039884751881400948e-01
+1.592803696822101267e-01 1.528796824181726244e-01 3.101441051875748478e-01
+1.623627513097627983e-01 1.558287612260276789e-01 3.163512211275710251e-01
+1.654142439360292427e-01 1.587796212856360245e-01 3.225680108254420086e-01
+1.684327965090609003e-01 1.617293084063355368e-01 3.288148930781844004e-01
+1.714174532656698446e-01 1.646790560305917694e-01 3.350897686326997915e-01
+1.743682562241114509e-01 1.676319105902342177e-01 3.413798820958920399e-01
+1.772818953778146633e-01 1.705846382439054620e-01 3.477088809140311265e-01
+1.801603634233710782e-01 1.735435075165488450e-01 3.540447583078508709e-01
+1.829984949769703495e-01 1.765034834295459432e-01 3.604229741636628126e-01
+1.857993799242090571e-01 1.794715454820642320e-01 3.668060399217007994e-01
+1.885572370561371114e-01 1.824432159549585208e-01 3.732275719698777694e-01
+1.912746410827655397e-01 1.854240146696699842e-01 3.796579628109393312e-01
+1.939472187446417972e-01 1.884119984733164943e-01 3.861158710011389772e-01
+1.965746218202921169e-01 1.914094687319768118e-01 3.925922579541862301e-01
+1.991567237202455654e-01 1.944185425759841768e-01 3.990785276243757895e-01
+2.016870280617926170e-01 1.974370231299186207e-01 4.055979452145534458e-01
+2.041733231959791395e-01 2.004720971993999568e-01 4.121034638774260794e-01
+2.065989175964332847e-01 2.035163285945146838e-01 4.186611530978023854e-01
+2.089769981124778853e-01 2.065792251897101139e-01 4.252032229400294350e-01
+2.112968541690966595e-01 2.096575161864902004e-01 4.317649751357993670e-01
+2.135580062034990179e-01 2.127534028876823524e-01 4.383374070580626225e-01
+2.157654857120719361e-01 2.158705959834085197e-01 4.448946358553702574e-01
+2.179027467031688925e-01 2.190056896370822792e-01 4.514821666358075913e-01
+2.199801557481101399e-01 2.221640817576028826e-01 4.580565150394946827e-01
+2.219970327313536274e-01 2.253470663668500351e-01 4.646129330923238210e-01
+2.239359400161920477e-01 2.285528452407099564e-01 4.711900504070519191e-01
+2.258093253298022463e-01 2.317859657097744996e-01 4.777445723729306093e-01
+2.276150386234590539e-01 2.350474802331274371e-01 4.842749179389621017e-01
+2.293411129842480300e-01 2.383375691596468227e-01 4.908001225098672093e-01
+2.309905102772738528e-01 2.416584626823640725e-01 4.973037406011600603e-01
+2.325653899945122616e-01 2.450118207268658921e-01 5.037733153263704855e-01
+2.340634217066668299e-01 2.483988011172711396e-01 5.102061969115925244e-01
+2.354739391855478203e-01 2.518205609488499142e-01 5.166133649735229483e-01
+2.368010268106580107e-01 2.552786891057904350e-01 5.229787612622226467e-01
+2.380459056014049835e-01 2.587743537954566575e-01 5.292929958163873350e-01
+2.392069166726323859e-01 2.623086175634496420e-01 5.355517448643010159e-01
+2.402826487140223288e-01 2.658824888638082751e-01 5.417502762699162311e-01
+2.412690379036540600e-01 2.694971451746652202e-01 5.478870668064361737e-01
+2.421646534827242569e-01 2.731536075359688454e-01 5.539567283353189486e-01
+2.429737663975502504e-01 2.768521950965758815e-01 5.599478852923390759e-01
+2.436964271327693443e-01 2.805934002738960653e-01 5.658549936523274981e-01
+2.443331406488099544e-01 2.843775500649446952e-01 5.716723986670918523e-01
+2.448849019911867875e-01 2.882047861966390290e-01 5.773944132373918237e-01
+2.453532261044997220e-01 2.920750479307156477e-01 5.830154006066263772e-01
+2.457401707423141346e-01 2.959880581924350662e-01 5.885298594478888257e-01
+2.460483514874983180e-01 2.999433136125404520e-01 5.939325092217595525e-01
+2.462809480744551638e-01 3.039400789577370587e-01 5.992183735671519074e-01
+2.464417014302806019e-01 3.079773862803035778e-01 6.043828594654379049e-01
+2.465349011179689409e-01 3.120540389489538935e-01 6.094218299971551067e-01
+2.465653631589233563e-01 3.161686205399514837e-01 6.143316686920637926e-01
+2.465383985194727345e-01 3.203195083804638021e-01 6.191093337508785099e-01
+2.464597728499572371e-01 3.245048913568406301e-01 6.237524007769893464e-01
+2.463356583484295759e-01 3.287227914401089635e-01 6.282590930787467220e-01
+2.461725788681820570e-01 3.329710882494058555e-01 6.326282990625464731e-01
+2.459773495859159942e-01 3.372475458788758984e-01 6.368595767065934332e-01
+2.457570126857825388e-01 3.415498411593856920e-01 6.409531455573861392e-01
+2.455187705883344895e-01 3.458755925146314025e-01 6.449098671004442895e-01
+2.452699182619971774e-01 3.502223885999685149e-01 6.487312147029243858e-01
+2.450177761015216449e-01 3.545878159769456084e-01 6.524192345935843074e-01
+2.447696247503935441e-01 3.589694851701816236e-01 6.559764995268344556e-01
+2.445326430925611194e-01 3.633650545677170052e-01 6.594060568707836856e-01
+2.443138504548736933e-01 3.677722517524962265e-01 6.627113728687089589e-01
+2.441200538578628954e-01 3.721888919827969766e-01 6.658962747586536501e-01
+2.439578009410017234e-01 3.766128936655925852e-01 6.689648923098728828e-01
+2.438333389800677597e-01 3.810422907829071337e-01 6.719216001624749302e-01
+2.437527166088169217e-01 3.854752048525493247e-01 6.747709927211151815e-01
+2.437215868067584834e-01 3.899098965838322384e-01 6.775178104933975431e-01
+2.437449691034339061e-01 3.943448306666547665e-01 6.801668228779059744e-01
+2.438275942988586409e-01 3.987785785872524635e-01 6.827228592773180171e-01
+2.439737834704199804e-01 4.032098481987659855e-01 6.851907482426946583e-01
+2.441874434968405727e-01 4.076374812199010655e-01 6.875752826204606372e-01
+2.444720671645514987e-01 4.120604493040472271e-01 6.898811893971661391e-01
+2.448307373736109405e-01 4.164778489638755743e-01 6.921131040949622948e-01
+2.452661349520961487e-01 4.208888956165576789e-01 6.942755494834951246e-01
+2.457805495927352646e-01 4.252929169900244166e-01 6.963729183108620102e-01
+2.463758934401020784e-01 4.296893461032649797e-01 6.984094597147249006e-01
+2.470537168787759197e-01 4.340777140051458871e-01 7.003892689515083259e-01
+2.478152261001809742e-01 4.384576424279668649e-01 7.023162800736911793e-01
+2.486613020564674703e-01 4.428288364849563008e-01 7.041942611893784454e-01
+2.495925204424470634e-01 4.471910775158167151e-01 7.060268119517866259e-01
+2.506091723801374682e-01 4.515442161617032046e-01 7.078173629464002969e-01
+2.517112855138260996e-01 4.558881657309074575e-01 7.095691766682096224e-01
+2.528986452564736531e-01 4.602228958990267071e-01 7.112853498087290394e-01
+2.541708159598920491e-01 4.645484267725444316e-01 7.129688166009963135e-01
+2.555271618114321464e-01 4.688648233323279846e-01 7.146223529992972168e-01
+2.569668672886404326e-01 4.731721902633665988e-01 7.162485814980906751e-01
+2.584889570301312500e-01 4.774706671689665227e-01 7.178499764208978728e-01
+2.600923150060586719e-01 4.817604241612176152e-01 7.194288695343957762e-01
+2.617757028946650633e-01 4.860416578147523370e-01 7.209874558653309728e-01
+2.635377775926647237e-01 4.903145874672710236e-01 7.225277996180770046e-01
+2.653771078065290112e-01 4.945794518478790480e-01 7.240518401086443179e-01
+2.672921896891591875e-01 4.988365060127348261e-01 7.255613976468211490e-01
+2.692814615020625024e-01 5.030860185666778950e-01 7.270581793119333947e-01
+2.713433172968592322e-01 5.073282691492603247e-01 7.285437845796602918e-01
+2.734761196220429347e-01 5.115635461637654258e-01 7.300197107675363561e-01
+2.756782112712242161e-01 5.157921447283394523e-01 7.314873582754417569e-01
+2.779479260979498267e-01 5.200143648290899145e-01 7.329480356046209621e-01
+2.802835989294344965e-01 5.242305096559424227e-01 7.344029641448335255e-01
+2.826835746175559994e-01 5.284408841030631132e-01 7.358532827242095786e-01
+2.851462162701056124e-01 5.326457934167407871e-01 7.373000519204292447e-01
+2.876699127088762631e-01 5.368455419747276691e-01 7.387442581351216786e-01
+2.902530852036724895e-01 5.410404321821302709e-01 7.401868174359758079e-01
+2.928941935330091062e-01 5.452307634699987693e-01 7.416285791730816701e-01
+2.955917414230262996e-01 5.494168313837994866e-01 7.430703293775968721e-01
+2.983442814164117829e-01 5.535989267498891975e-01 7.445127939520038707e-01
+3.011504192226619470e-01 5.577773349090259236e-01 7.459566416621068452e-01
+3.040088176001567444e-01 5.619523350067550105e-01 7.474024869415085703e-01
+3.069181998192390681e-01 5.661241993312904341e-01 7.488508925197547850e-01
+3.098773527540035766e-01 5.702931926901545490e-01 7.503023718855809099e-01
+3.128851296485514188e-01 5.744595718174968502e-01 7.517573915968616127e-01
+3.159404526017212111e-01 5.786235848045079289e-01 7.532163734489466522e-01
+3.190423148119757579e-01 5.827854705458642703e-01 7.546796965130810886e-01
+3.221897826221614136e-01 5.869454581955374506e-01 7.561476990566410317e-01
+3.253819974015382255e-01 5.911037666256608869e-01 7.576206803568952264e-01
+3.286181773003176154e-01 5.952606038824642676e-01 7.590989024200323065e-01
+3.318976189096972118e-01 5.994161666335501293e-01 7.605825916172537227e-01
+3.352196988582024639e-01 6.035706396009887786e-01 7.620719402498039585e-01
+3.385838753729217276e-01 6.077241949749224714e-01 7.635671080549891743e-01
+3.419896898320652912e-01 6.118769918024981047e-01 7.650682236654324786e-01
+3.454367683330621941e-01 6.160291753470886755e-01 7.665753860341149029e-01
+3.489248232981658759e-01 6.201808764128988738e-01 7.680886658381395060e-01
+3.524536551372777216e-01 6.243322106301375518e-01 7.696081068746097875e-01
+3.560231539852872773e-01 6.284832776960781464e-01 7.711337274625911231e-01
+3.596333015286877766e-01 6.326341605674558055e-01 7.726655218657797475e-01
+3.632841729334435055e-01 6.367849245998262742e-01 7.742034617512983941e-01
+3.669759388831845826e-01 6.409356166297031088e-01 7.757474977008770312e-01
+3.707088677332940896e-01 6.450862639955934341e-01 7.772975607916928764e-01
+3.744833277827505080e-01 6.492368734944050646e-01 7.788535642652039126e-01
+3.782997896612683153e-01 6.533874302701627723e-01 7.804154053034927374e-01
+3.821588288242804832e-01 6.575378966326091978e-01 7.819829669338883571e-01
+3.860611281425825880e-01 6.616882108040403887e-01 7.835561200839490370e-01
+3.900074788490647260e-01 6.658383310313947812e-01 7.851343555476577585e-01
+3.939988161696960089e-01 6.699882294160507401e-01 7.867167620565498343e-01
+3.980361943268375668e-01 6.741376428249236108e-01 7.883041180552029514e-01
+4.021207666563880734e-01 6.782863970632155848e-01 7.898962603978111341e-01
+4.062538088695973326e-01 6.824342860499125196e-01 7.914930279577012673e-01
+4.104367215482290221e-01 6.865810701317770492e-01 7.930942653099937178e-01
+4.146710323688317379e-01 6.907264743609855540e-01 7.946998267750712275e-01
+4.189583979456862339e-01 6.948701867544626598e-01 7.963095808534970121e-01
+4.233007615496491849e-01 6.990119462600449252e-01 7.979223720379219342e-01
+4.277003131396773239e-01 7.031514402219964932e-01 7.995369318160842065e-01
+4.321588772737992579e-01 7.072880516513097016e-01 8.011551464379941256e-01
+4.366786594847170133e-01 7.114212963902242226e-01 8.027769966740599950e-01
+4.412619934972313862e-01 7.155506445548852623e-01 8.044025095123854552e-01
+4.459117519235324401e-01 7.196756076604832186e-01 8.060302209280784114e-01
+4.506310977664646500e-01 7.237956107627850910e-01 8.076586979980320269e-01
+4.554220533607292176e-01 7.279097909870729799e-01 8.092910180447286939e-01
+4.602874296132978826e-01 7.320174174690982083e-01 8.109274975540664565e-01
+4.652312929955615961e-01 7.361178015074247849e-01 8.125654680881110314e-01
+4.702567132124945704e-01 7.402100378643735601e-01 8.142058631482380626e-01
+4.753658389170350440e-01 7.442931579112735951e-01 8.158518248191980460e-01
+4.805629989896973986e-01 7.483662565565446512e-01 8.175014285494428545e-01
+4.858519412014848382e-01 7.524283052190463561e-01 8.191547180510726500e-01
+4.912340123610521858e-01 7.564782715855419282e-01 8.208164230788980165e-01
+4.967149567998503934e-01 7.605150334733405959e-01 8.224828836016547795e-01
+5.022958597070651399e-01 7.645375459922270078e-01 8.241590313627700226e-01
+5.079798024989584659e-01 7.685447202464326111e-01 8.258458806918314021e-01
+5.137703056538149848e-01 7.725354056237694333e-01 8.275437918161917539e-01
+5.196672668780889515e-01 7.765087356564679411e-01 8.292580362563429786e-01
+5.256748803701343231e-01 7.804635126371105569e-01 8.309874864714956733e-01
+5.317909415132198170e-01 7.843991695298314637e-01 8.327389435984492438e-01
+5.380183963455860141e-01 7.883146743347385632e-01 8.345120959574837682e-01
+5.443539980151446134e-01 7.922097498034269547e-01 8.363133084981756449e-01
+5.507978944105677011e-01 7.960838061951434064e-01 8.381442735434428970e-01
+5.573464847507825226e-01 7.999368256977259506e-01 8.400099169225816453e-01
+5.639964685183691540e-01 8.037688733081099768e-01 8.419139099857662067e-01
+5.707439504576503619e-01 8.075802108116317823e-01 8.438596871365160457e-01
+5.775827793152761291e-01 8.113715803382598457e-01 8.458518352418533670e-01
+5.845080419432422403e-01 8.151436572177973572e-01 8.478930504633812593e-01
+5.915124079987543748e-01 8.188976525325087907e-01 8.499872730184475644e-01
+5.985892343607183141e-01 8.226347979507546704e-01 8.521371651406997039e-01
+6.057310635784716180e-01 8.263566000070049489e-01 8.543453938014868854e-01
+6.129312041392928068e-01 8.300645419348708920e-01 8.566135671784518291e-01
+6.201810118833709362e-01 8.337606033851390208e-01 8.589441737734759830e-01
+6.274752226888651307e-01 8.374461999354567698e-01 8.613371235909390577e-01
+6.348052546879014990e-01 8.411235111538640785e-01 8.637941988526561810e-01
+6.421662450761786989e-01 8.447940336859747212e-01 8.663146822269915948e-01
+6.495514829538971968e-01 8.484597208451428729e-01 8.688988750843767983e-01
+6.569557263949438175e-01 8.521222755106645508e-01 8.715461474797051578e-01
+6.643745794481599187e-01 8.557832593714448377e-01 8.742554091588357057e-01
+6.718027324561179903e-01 8.594444859176019191e-01 8.770260761340837874e-01
+6.792376399817107169e-01 8.631071655185147407e-01 8.798561771298264444e-01
+6.866744996748753715e-01 8.667730629390760777e-01 8.827449654904524490e-01
+6.941118238786820882e-01 8.704431765687035139e-01 8.856901351703097003e-01
+7.015458707010223671e-01 8.741190620646153153e-01 8.886905723641257415e-01
+7.089754732757992395e-01 8.778016574148082007e-01 8.917440383282461136e-01
+7.163982330943452492e-01 8.814922113687924110e-01 8.948489665590808606e-01
+7.238129051546876580e-01 8.851916892315870866e-01 8.980033539675886800e-01
+7.312183003174410612e-01 8.889010427774228784e-01 9.012052612065797330e-01
+7.386131643998257168e-01 8.926212432189428725e-01 9.044528466250297827e-01
+7.459969493141647146e-01 8.963530775374040083e-01 9.077440285167398537e-01
+7.533688986576650981e-01 9.000973872698678768e-01 9.110768604175860652e-01
+7.607282142588290830e-01 9.038550280130126513e-01 9.144494382489702922e-01
+7.680754104857114850e-01 9.076264985347726189e-01 9.178593407704264129e-01
+7.754086380463782735e-01 9.114129489376284754e-01 9.213050832886523489e-01
+7.827298656902449414e-01 9.152144780056820084e-01 9.247836307542580681e-01
+7.900362445563153813e-01 9.190325332798994218e-01 9.282937907772289554e-01
+7.973305798287271262e-01 9.228669845876559252e-01 9.318320585938411060e-01
+8.046093603619434154e-01 9.267195025159972177e-01 9.353972761089011101e-01
+8.118762521869845594e-01 9.305897288106829146e-01 9.389853083637165199e-01
+8.191262403047088192e-01 9.344798221317863751e-01 9.425952041745783161e-01
+8.263649511242520118e-01 9.383888950299160703e-01 9.462215400179357916e-01
+8.335857899787124659e-01 9.423196480542496145e-01 9.498633823775902707e-01
+8.407925617377357552e-01 9.462718000641171523e-01 9.535152044674145566e-01
+8.479820749115867251e-01 9.502471776949116267e-01 9.571737430642662803e-01
+8.551509499643907830e-01 9.542477482079624318e-01 9.608352118692636834e-01
+8.623025919332756306e-01 9.582735696851335527e-01 9.644920284238761576e-01
+8.694298092423108359e-01 9.623279528450340292e-01 9.681401921277593692e-01
+8.765283703934805271e-01 9.664134798374283131e-01 9.717733036205912223e-01
+8.835932645286533882e-01 9.705331352089504593e-01 9.753839343072715495e-01
+8.906174074108087479e-01 9.746907136098538205e-01 9.789640951138071090e-01
+8.975917485137434593e-01 9.788908041054119602e-01 9.825051528035059212e-01
+9.045013427138774986e-01 9.831399005223971921e-01 9.860005773650694083e-01
+9.113300542301955298e-01 9.874449459956177177e-01 9.894442642623689776e-01
+9.180592960081255249e-01 9.918135358838490179e-01 9.928328638314803944e-01]; 
+
+   case 'rai' % rain
+      RGB = [9.345899218079473103e-01 9.308468535401923649e-01 9.527121598234155053e-01
+9.317427384147130009e-01 9.265559169859566291e-01 9.461412847112190549e-01
+9.288323151212234396e-01 9.222903185306413620e-01 9.397258851930316848e-01
+9.259014656554976908e-01 9.180422099085187027e-01 9.333811647328228434e-01
+9.229490910874459386e-01 9.138118271011793636e-01 9.271087656276950639e-01
+9.199777474389575493e-01 9.095987388769878335e-01 9.209029155030628022e-01
+9.169834318717224875e-01 9.054037550731951489e-01 9.147707495523473842e-01
+9.139687227512254264e-01 9.012264798371935060e-01 9.087060404880972220e-01
+9.109285940266572679e-01 8.970679577253415360e-01 9.027176878689184836e-01
+9.078584183128727281e-01 8.929291295619988800e-01 8.968142426813552337e-01
+9.047531063535361184e-01 8.888107271516731966e-01 8.910081776220351024e-01
+9.016111241776750829e-01 8.847109979588536621e-01 8.853222084733923802e-01
+8.984773600020180551e-01 8.806072441106347348e-01 8.798005863890318023e-01
+8.957156578807984326e-01 8.763733055795923654e-01 8.742439953591307766e-01
+8.934429895784954390e-01 8.720376849990935098e-01 8.679132827136474271e-01
+8.911862289430210193e-01 8.677553071034195264e-01 8.611451293770118198e-01
+8.889359451831089221e-01 8.635014856893418189e-01 8.542095914675652546e-01
+8.867116938006094351e-01 8.592609509355686459e-01 8.471741066544885568e-01
+8.845266087736632921e-01 8.550269405833543779e-01 8.400488385945689140e-01
+8.823737459191345334e-01 8.507991274319443020e-01 8.328611900775441113e-01
+8.802551767793974635e-01 8.465759973509723313e-01 8.256144073735601774e-01
+8.781723156295014876e-01 8.423565112404021171e-01 8.183096182593350143e-01
+8.761185057025142608e-01 8.381415609718929627e-01 8.109618862038079357e-01
+8.740930473614691998e-01 8.339308508975332712e-01 8.035739688319240015e-01
+8.720952068860511330e-01 8.297241543120810192e-01 7.961481162736230299e-01
+8.701280658536796331e-01 8.255204305809771270e-01 7.886787238448926818e-01
+8.681860361945246130e-01 8.213205960844648379e-01 7.811769076946536439e-01
+8.662688819092574377e-01 8.171244030607883735e-01 7.736431720476375506e-01
+8.643746025935312716e-01 8.129320197586197283e-01 7.660813810727764572e-01
+8.625034879855904002e-01 8.087431068747142904e-01 7.584907829855329631e-01
+8.606546147206539654e-01 8.045576097831967921e-01 7.508729509413730741e-01
+8.588266729702948021e-01 8.003755742930238615e-01 7.432301838409289818e-01
+8.569623869913148839e-01 7.962191366375533930e-01 7.355859431728856146e-01
+8.550504938518290743e-01 7.920970771858082404e-01 7.278998746292554278e-01
+8.530849581648412006e-01 7.880123772917803082e-01 7.201683837184543746e-01
+8.510553489556228479e-01 7.839691860217244956e-01 7.123959661845170599e-01
+8.489330228346508855e-01 7.799787143731991002e-01 7.045972788504087925e-01
+8.467217087867040526e-01 7.760402896946996254e-01 6.967642500138357953e-01
+8.444094675146763818e-01 7.721590919106836592e-01 6.888992560450724056e-01
+8.419826946126204303e-01 7.683408791881058963e-01 6.810067521686843373e-01
+8.393858369850137890e-01 7.646065720377731578e-01 6.731281946153443441e-01
+8.366346261960659891e-01 7.609512703952114876e-01 6.652451363576846743e-01
+8.336844747046829873e-01 7.573915193569474846e-01 6.573955009267002936e-01
+8.305100496696308232e-01 7.539367518776275423e-01 6.496025429014220531e-01
+8.270795595522559829e-01 7.505979386186598656e-01 6.419039537235261550e-01
+8.233795339766563082e-01 7.473786068829111340e-01 6.343290132703457429e-01
+8.193527781515338448e-01 7.442973494709732574e-01 6.269543660928612594e-01
+8.150187381418861898e-01 7.413436869430644061e-01 6.197992186956774452e-01
+8.103671933740643762e-01 7.385171999523609809e-01 6.129154791955783166e-01
+8.053792270659873020e-01 7.358201042585071905e-01 6.063662921639977332e-01
+8.001091487009975856e-01 7.332281055474541009e-01 6.001460682932164836e-01
+7.945789023747689139e-01 7.307291829728559396e-01 5.942715305031909256e-01
+7.888006960769626819e-01 7.283155171589156263e-01 5.887591680450797726e-01
+7.828500773466386953e-01 7.259575374530320424e-01 5.835578074632412626e-01
+7.767061505166655833e-01 7.236609437130246958e-01 5.786949863565322705e-01
+7.704515166608618681e-01 7.213952841209190225e-01 5.740985082128049477e-01
+7.640735967706561160e-01 7.191644341873529855e-01 5.697767469661422224e-01
+7.576101573082332230e-01 7.169548408227417458e-01 5.656900597267850994e-01
+7.510868163729491620e-01 7.147576249864890929e-01 5.618076267722970085e-01
+7.445073291928260284e-01 7.125716412063957117e-01 5.581177337866775057e-01
+7.378726341804960898e-01 7.103967525656292858e-01 5.546105609434751615e-01
+7.312079622811540336e-01 7.082247740235839695e-01 5.512528292120718598e-01
+7.245223864166319139e-01 7.060527915800670629e-01 5.480303444985812344e-01
+7.178179126910454455e-01 7.038807344069457628e-01 5.449299707841194218e-01
+7.111005957174848513e-01 7.017068393561574080e-01 5.419396078954504814e-01
+7.043748082863551252e-01 6.995299965106114293e-01 5.390480504976655762e-01
+6.976428841540770476e-01 6.973498542230505137e-01 5.362451349156007741e-01
+6.909082389019516324e-01 6.951656049847189101e-01 5.335213672589386169e-01
+6.841729694681116802e-01 6.929769158960692454e-01 5.308681129719833303e-01
+6.774389689374403778e-01 6.907834967201277321e-01 5.282774232028493167e-01
+6.707084440130518521e-01 6.885849153944831880e-01 5.257418638258782861e-01
+6.639830918601468124e-01 6.863809064730829190e-01 5.232546086946955333e-01
+6.572628938239016838e-01 6.841717926007404582e-01 5.208097057295569821e-01
+6.505310175956583452e-01 6.819627798840676158e-01 5.184181252103758908e-01
+6.438052208637921048e-01 6.797486679084566719e-01 5.160591646972285673e-01
+6.370832823378153043e-01 6.775304469295674314e-01 5.137285370282342889e-01
+6.303705085075785863e-01 6.753064791862326555e-01 5.114205507376848869e-01
+6.236618961603839217e-01 6.730786409287115024e-01 5.091324121853675333e-01
+6.169335288716588650e-01 6.708537547863058226e-01 5.068827462564762243e-01
+6.102104324218552422e-01 6.686246254359063945e-01 5.046462757174120517e-01
+6.034898306929903367e-01 6.663922665431509795e-01 5.024201930501221991e-01
+5.967676345670763771e-01 6.641578140003113750e-01 5.002054482667135371e-01
+5.900234330755329548e-01 6.619267690502547152e-01 4.980175294001410458e-01
+5.832786395653163369e-01 6.596933136673572839e-01 4.958328661006338733e-01
+5.765340663187056292e-01 6.574571405303393234e-01 4.936489952759946509e-01
+5.697582662671993869e-01 6.552266499575032377e-01 4.914884851056534054e-01
+5.629730101905379147e-01 6.529958318145387963e-01 4.893302200215370878e-01
+5.561847270851512093e-01 6.507627829419350141e-01 4.871678208383450337e-01
+5.493551097307179942e-01 6.485375215149538075e-01 4.850265872147694890e-01
+5.425256305514831734e-01 6.463076874918682879e-01 4.828887171920029364e-01
+5.356612977693596678e-01 6.440835181737865067e-01 4.807599721985225671e-01
+5.287922197832997107e-01 6.418536560641270317e-01 4.786600904179345028e-01
+5.218850344197893953e-01 6.396291731218471943e-01 4.765733407479101902e-01
+5.149376539505706729e-01 6.374099915253575999e-01 4.745006244225868364e-01
+5.079766080089844760e-01 6.351862479551418916e-01 4.724595195428232253e-01
+5.009755431565769968e-01 6.329662155198152451e-01 4.704378162646060679e-01
+4.939285311779693655e-01 6.307509252620584483e-01 4.684356727521749586e-01
+4.868490205117793068e-01 6.285349533886431805e-01 4.664642845323079823e-01
+4.797346535241335252e-01 6.263183759111613513e-01 4.645235778249863778e-01
+4.725684462540446495e-01 6.241056609282084056e-01 4.626084796977160685e-01
+4.653487483821732718e-01 6.218962626011749206e-01 4.607211778296827487e-01
+4.580958304602617548e-01 6.196828431511897106e-01 4.588752179328909331e-01
+4.507924598809112671e-01 6.174698402959368781e-01 4.570641185207933721e-01
+4.434287999890613730e-01 6.152589986197224414e-01 4.552877084880677105e-01
+4.360045483020283386e-01 6.130492733714320019e-01 4.535480340189612103e-01
+4.285254867993349426e-01 6.108377350391323013e-01 4.518515677783579432e-01
+4.209986373257934011e-01 6.086212623350139017e-01 4.502044135688367255e-01
+4.134050226321455135e-01 6.064040523424363283e-01 4.486012173551829352e-01
+4.057442294957287476e-01 6.041849412176459877e-01 4.470442374703665345e-01
+3.980103804981384719e-01 6.019638983605486438e-01 4.455375274544488007e-01
+3.902063406549050040e-01 5.997389567937310151e-01 4.440824403586798308e-01
+3.823330219069303038e-01 5.975084478594807624e-01 4.426827692274404313e-01
+3.743994820234466392e-01 5.952685939479632760e-01 4.413464089373288490e-01
+3.663895342858319859e-01 5.930221303804210642e-01 4.400695063624517345e-01
+3.583027331816978078e-01 5.907676584219552218e-01 4.388545840675231458e-01
+3.501387968837356146e-01 5.885037242420276815e-01 4.377041322664636525e-01
+3.418974318117430355e-01 5.862288538856508247e-01 4.366206692939140765e-01
+3.335788357145262895e-01 5.839414671596280249e-01 4.356065575056938810e-01
+3.251833166933908448e-01 5.816399536413853211e-01 4.346641338993996184e-01
+3.167127839080131069e-01 5.793224392963164382e-01 4.337951239114763990e-01
+3.081690890879107969e-01 5.769870856598143805e-01 4.330012470667766733e-01
+2.995554017471688812e-01 5.746318865559506550e-01 4.322836619258556556e-01
+2.908749326626684506e-01 5.722548869131893756e-01 4.316434590630243706e-01
+2.821317603555529852e-01 5.698540727656976612e-01 4.310813189213763552e-01
+2.733327132702973450e-01 5.674271544637526921e-01 4.305966557525391369e-01
+2.644844543662756564e-01 5.649720080402284017e-01 4.301888298931589305e-01
+2.555934335426425785e-01 5.624866759386734083e-01 4.298572085857526592e-01
+2.466705752105852745e-01 5.599688410786282100e-01 4.295989836123562111e-01
+2.377250969065505815e-01 5.574166090031631438e-01 4.294119794031988069e-01
+2.287974288505327247e-01 5.548237349096721838e-01 4.292976581628650257e-01
+2.198778468774868489e-01 5.521921840191843511e-01 4.292473634163982976e-01
+2.109782428379559649e-01 5.495207384038700571e-01 4.292558006274433957e-01
+2.021129920761091103e-01 5.468081421831656463e-01 4.293174959448664008e-01
+1.932970840289524594e-01 5.440534055393755342e-01 4.294264526279761851e-01
+1.845458994968318112e-01 5.412558313792091846e-01 4.295762645205056240e-01
+1.758747242186788073e-01 5.384150471574241648e-01 4.297604082769522771e-01
+1.672992650076766952e-01 5.355309682751767664e-01 4.299719066013750202e-01
+1.588637533307953875e-01 5.326007152638789766e-01 4.302077664091210063e-01
+1.505683016211286918e-01 5.296267950764182997e-01 4.304586487604788458e-01
+1.424122559523727238e-01 5.266116064108816719e-01 4.307170632116699704e-01
+1.344085890794944338e-01 5.235562755642496624e-01 4.309766346935359205e-01
+1.265690627070247265e-01 5.204621553185740934e-01 4.312317121888489257e-01
+1.189042023704675322e-01 5.173307669769749984e-01 4.314776038001592595e-01
+1.114246335252623010e-01 5.141637863856259871e-01 4.317091179175960858e-01
+1.041396630107440102e-01 5.109629971472293697e-01 4.319221604647225932e-01
+9.705780332103111641e-02 5.077302369436778040e-01 4.321134999997184867e-01
+9.018737534593762595e-02 5.044674058535019157e-01 4.322799148264460101e-01
+8.353621797943017180e-02 5.011764305824176757e-01 4.324186435951988816e-01
+7.711177607780977938e-02 4.978592446938872595e-01 4.325273326417442554e-01
+7.092118659398483071e-02 4.945177606318418850e-01 4.326041097483195319e-01
+6.497112946544478240e-02 4.911539160136639270e-01 4.326469613219918742e-01
+5.926836252985791947e-02 4.877695081001428012e-01 4.326551664213393877e-01
+5.381952845223608034e-02 4.843663141865421351e-01 4.326279059471102584e-01
+4.863121397792258965e-02 4.809460446320443228e-01 4.325646545440974822e-01
+4.370962682231178259e-02 4.775103648435110038e-01 4.324649641775900610e-01
+3.905112341714592900e-02 4.740608794693825234e-01 4.323285604649402813e-01
+3.496888770654411893e-02 4.705940487017962748e-01 4.321582669839647561e-01
+3.143475353593022659e-02 4.671148853349996188e-01 4.319569510186779815e-01
+2.822939081579376591e-02 4.636310861634273528e-01 4.317228454236091695e-01
+2.532316922257733458e-02 4.601429344885760719e-01 4.314611817794063997e-01
+2.271621196496529868e-02 4.566502451321696188e-01 4.311704916368828688e-01
+2.041021909707332535e-02 4.531526976651161776e-01 4.308500436842361836e-01
+1.840750332198089895e-02 4.496499166924270985e-01 4.304993286811824582e-01
+1.672948316457980103e-02 4.461408970806849950e-01 4.301165746135667267e-01
+1.538958862814012937e-02 4.426249994353490536e-01 4.296990539873294934e-01
+1.435413070644788770e-02 4.391028750771387434e-01 4.292495981309878972e-01
+1.362474263231045098e-02 4.355741563391084537e-01 4.287674174473046218e-01
+1.320277209836126682e-02 4.320384817616971795e-01 4.282516463471394697e-01
+1.308981022524788491e-02 4.284954582700414294e-01 4.277015087056333931e-01
+1.328604261598065328e-02 4.249447744648222614e-01 4.271158498149437155e-01
+1.379162556189269216e-02 4.213861028127094399e-01 4.264935743343106211e-01
+1.460601943539846688e-02 4.178191447440461337e-01 4.258334705527410113e-01
+1.572829683901560624e-02 4.142436086986017174e-01 4.251343095806048300e-01
+1.715690277980158954e-02 4.106592256461835122e-01 4.243947975574930975e-01
+1.888987211594707338e-02 4.070657340951429060e-01 4.236136390627659454e-01
+2.092392860184388512e-02 4.034629389123669529e-01 4.227893563025114654e-01
+2.325551642690237841e-02 3.998506428553240677e-01 4.219205349032726371e-01
+2.587976864011615197e-02 3.962287140215077774e-01 4.210056239775798459e-01
+2.879190433075056593e-02 3.925969951003727698e-01 4.200432223313694258e-01
+3.198535565039070661e-02 3.889554251322902556e-01 4.190317351172953564e-01
+3.545196060096311025e-02 3.853040266354982313e-01 4.179694561300110189e-01
+3.918323414610008770e-02 3.816428245764514893e-01 4.168548033419602339e-01
+4.307413522281567514e-02 3.779718375548203335e-01 4.156863315515785251e-01
+4.697176598438539824e-02 3.742911911603020725e-01 4.144624688814931845e-01
+5.086969232374114608e-02 3.706011159074634187e-01 4.131815676575790186e-01
+5.475506718563923764e-02 3.669018229746837667e-01 4.118421970922833131e-01
+5.861718450656796392e-02 3.631935427420149298e-01 4.104430479071176641e-01
+6.244486447080809660e-02 3.594767157385404532e-01 4.089825820635137332e-01
+6.623026614707036575e-02 3.557516605834906143e-01 4.074596950461942813e-01
+6.998642301215993178e-02 3.520178004091850665e-01 4.058682797037249657e-01
+7.368349105094931795e-02 3.482766831924774542e-01 4.042119944889063232e-01
+7.731558236370641990e-02 3.445288253637411868e-01 4.024900881431115462e-01
+8.087676210173380675e-02 3.407748586458358986e-01 4.007018083483494530e-01
+8.436223121714692130e-02 3.370153951525706182e-01 3.988466436336530196e-01
+8.776750670667690657e-02 3.332510976549885595e-01 3.969242240138116662e-01
+9.108869400118912996e-02 3.294826406371675898e-01 3.949343703704463748e-01
+9.432201977980475549e-02 3.257107550258697137e-01 3.928770441587735585e-01
+9.746469555428810549e-02 3.219361155964274857e-01 3.907524596946260753e-01
+1.005137065660947904e-01 3.181594785366577693e-01 3.885609392070024093e-01
+1.034667829102825787e-01 3.143815541170876804e-01 3.863030299565164416e-01
+1.063234262084384596e-01 3.106029224571804637e-01 3.839789892033815266e-01
+1.090886774331554510e-01 3.068237947954853828e-01 3.815863917579840892e-01
+1.117516829166099457e-01 3.030455295972052654e-01 3.791303642957770670e-01
+1.143116567201993838e-01 2.992687663919490482e-01 3.766121406045498943e-01
+1.167670145114603486e-01 2.954942819265780063e-01 3.740330281243106070e-01
+1.191180972380510850e-01 2.917225736922783308e-01 3.713945692144456912e-01
+1.213648735453208283e-01 2.879541937006656616e-01 3.686983734293431958e-01
+1.235072626972245069e-01 2.841897016932966036e-01 3.659461400710485868e-01
+1.255450172977832790e-01 2.804296856157670326e-01 3.631396556775801088e-01
+1.274793353662031781e-01 2.766744826581494787e-01 3.602808188600382100e-01
+1.293108779906596839e-01 2.729245043006408022e-01 3.573715653564341621e-01
+1.310404714307908669e-01 2.691801184313953876e-01 3.544138839210129732e-01
+1.326690608188904053e-01 2.654416544155482338e-01 3.514098053356367601e-01
+1.341977870856449484e-01 2.617093858425083575e-01 3.483613905337877847e-01
+1.356276601953987637e-01 2.579835900091309586e-01 3.452707288070074876e-01
+1.369600353052619901e-01 2.542644558590421155e-01 3.421399178935836116e-01
+1.381965371841252788e-01 2.505520924183904374e-01 3.389710465513224302e-01
+1.393387446776407912e-01 2.468465884786986142e-01 3.357661977904279893e-01
+1.403881322096931505e-01 2.431480256484742086e-01 3.325274517113971373e-01
+1.413463644264434660e-01 2.394564173026069165e-01 3.292568607367298839e-01
+1.422150204492807768e-01 2.357717647764656088e-01 3.259564633033559256e-01
+1.430241411872627821e-01 2.320878753057155075e-01 3.226241875019154048e-01
+1.437206808568328997e-01 2.284105260214233102e-01 3.193108148264102164e-01
+1.443167183567656553e-01 2.247376722352139033e-01 3.160160321612740519e-01
+1.448172234122950819e-01 2.210687136739122871e-01 3.127401980544551319e-01
+1.452270337553944191e-01 2.174029799543943375e-01 3.094836465796388381e-01
+1.455503303753529210e-01 2.137398650159642033e-01 3.062467330039463920e-01
+1.457916124736327868e-01 2.100785929129088681e-01 3.030297495827782850e-01
+1.459553844105018761e-01 2.064182886269750883e-01 2.998329600953320573e-01
+1.460450738341802501e-01 2.027582683855788659e-01 2.966566757283218836e-01
+1.460639705951699008e-01 1.990978105534875198e-01 2.935011720342979302e-01
+1.460132039806032178e-01 1.954367333080272440e-01 2.903667875231270012e-01
+1.458975819392981654e-01 1.917737643090239308e-01 2.872535927880979223e-01
+1.457218019293262112e-01 1.881075422549224607e-01 2.841616643549851884e-01
+1.454887645921259243e-01 1.844371298576089335e-01 2.810911343097461934e-01
+1.452032543446299950e-01 1.807609202544633309e-01 2.780420590388025248e-01
+1.448676044101755434e-01 1.770779511005421691e-01 2.750145417929056313e-01
+1.444780219943526678e-01 1.733892008568175547e-01 2.720086027887532176e-01
+1.440413431328422811e-01 1.696921848838350289e-01 2.690241039839223469e-01
+1.435643975093518765e-01 1.659841914110155581e-01 2.660610427935709565e-01
+1.430436238988290198e-01 1.622659427289601941e-01 2.631191819624335571e-01
+1.424820569142489501e-01 1.585358695252926109e-01 2.601982981359077240e-01
+1.418869430340855831e-01 1.547906985932924473e-01 2.572984244859990999e-01
+1.412504255878399562e-01 1.510326235840303566e-01 2.544186879929528633e-01
+1.405847553781910952e-01 1.472562100690701925e-01 2.515594367076940396e-01
+1.398866955406879442e-01 1.434617145934828086e-01 2.487199683062358835e-01
+1.391555552990901834e-01 1.396484041206631221e-01 2.458995874149805250e-01
+1.383972370289156262e-01 1.358126929549585971e-01 2.430982825013351944e-01
+1.376119899169210015e-01 1.319530974585303440e-01 2.403154706816485464e-01
+1.368012914537950486e-01 1.280674462139133607e-01 2.375506853082148262e-01
+1.359688085852648887e-01 1.241523347647442155e-01 2.348038243218179000e-01
+1.351079666263714507e-01 1.202088638287985289e-01 2.320731097859522474e-01
+1.342294527149119343e-01 1.162298274455028368e-01 2.293596493763065958e-01
+1.333340174081290574e-01 1.122121767595207487e-01 2.266630565550546428e-01
+1.324249399956005380e-01 1.081511805079039545e-01 2.239835024348004189e-01
+1.315721561940036699e-01 1.040055590640546201e-01 2.213363669373892839e-01];
+
+   case {'dem','top'} % dem or topo
+      RGB = [1.561019746507273376e-01 1.026082525875711138e-01 1.727215696232307918e-01
+1.614878059346168959e-01 1.086331782717616379e-01 1.834416540200605461e-01
+1.668117590877864764e-01 1.145994139402238821e-01 1.942594655847655616e-01
+1.720703275074147443e-01 1.205129174047056828e-01 2.051860710532931176e-01
+1.772595702951434704e-01 1.263792859047284667e-01 2.162309361702130506e-01
+1.823751828761793481e-01 1.322038111876145949e-01 2.274020989868827392e-01
+1.874125186315797886e-01 1.379915476831030108e-01 2.387062880680187460e-01
+1.923665760685599468e-01 1.437473901381048913e-01 2.501489823140411461e-01
+1.972319620276792862e-01 1.494761585027865047e-01 2.617344119314569673e-01
+2.020028382233076125e-01 1.551826890051333785e-01 2.734655011163185101e-01
+2.066728560428846562e-01 1.608719311731062473e-01 2.853437530392856081e-01
+2.112350828916275125e-01 1.665490510713014960e-01 2.973690772834624574e-01
+2.156819223383368844e-01 1.722195412332822306e-01 3.095395593647118360e-01
+2.200027865362182422e-01 1.778889096627078448e-01 3.218593457818205161e-01
+2.241821302892643142e-01 1.835626593748518609e-01 3.343431537784405938e-01
+2.282155151615900546e-01 1.892493734782149939e-01 3.469585312854190362e-01
+2.320913707908846546e-01 1.949572807641995476e-01 3.596924727656225507e-01
+2.357791582066215419e-01 2.006936504843463420e-01 3.725810406048237766e-01
+2.392760085101002243e-01 2.064712127546999287e-01 3.855616338648150121e-01
+2.425474613143962510e-01 2.123011804696942062e-01 3.986531809377649171e-01
+2.455817950644241798e-01 2.181991605590304917e-01 4.117955160707330586e-01
+2.483306606950595463e-01 2.241817667402334346e-01 4.250033167249620547e-01
+2.507721436866522935e-01 2.302701237479483076e-01 4.382036814126420432e-01
+2.528659964243425984e-01 2.364882912834416206e-01 4.513446141213755536e-01
+2.545675711557803811e-01 2.428643843006248471e-01 4.643557571030281772e-01
+2.558322794870629413e-01 2.494300496133808887e-01 4.771399728195321877e-01
+2.566151212870083631e-01 2.562195453869526296e-01 4.895770754997314511e-01
+2.568729082739400482e-01 2.632680806498599591e-01 5.015251413221865073e-01
+2.566051651711689918e-01 2.706008890121900934e-01 5.127963599343589030e-01
+2.558254018044066047e-01 2.782328077909240194e-01 5.232189983935346955e-01
+2.545978636988186494e-01 2.861560770732184955e-01 5.326370186681820273e-01
+2.530378388279626023e-01 2.943355684042912035e-01 5.409499814033098541e-01
+2.512817651002536290e-01 3.027167370222472731e-01 5.481422664464320471e-01
+2.494682375867288693e-01 3.112353605277175528e-01 5.542766318947622839e-01
+2.477157002362878613e-01 3.198299095156284522e-01 5.594704462476630669e-01
+2.461121481740833894e-01 3.284495884603169102e-01 5.638648470620498676e-01
+2.447220255685461088e-01 3.370546900675063240e-01 5.676029832475817383e-01
+2.435790408918375727e-01 3.456199709880173332e-01 5.708127541670769967e-01
+2.426978313653707087e-01 3.541305556383861908e-01 5.736016010478480753e-01
+2.420946965383475313e-01 3.625739944720036134e-01 5.760653956197256953e-01
+2.417595622535183009e-01 3.709493751547713325e-01 5.782729391945388153e-01
+2.416897018162703636e-01 3.792548337300427064e-01 5.802858143751018494e-01
+2.418784445905285962e-01 3.874910027793410650e-01 5.821542521747482546e-01
+2.423091294682429564e-01 3.956627542073260506e-01 5.839131390484204598e-01
+2.429695407602900925e-01 4.037738393736669540e-01 5.855939512690606641e-01
+2.438461792188084676e-01 4.118287207942545325e-01 5.872218507211212080e-01
+2.449256139784778408e-01 4.198319765418777605e-01 5.888176525512366366e-01
+2.461926332303804310e-01 4.277888629705645096e-01 5.903967722170088139e-01
+2.476314436738927260e-01 4.357048438328084417e-01 5.919706842419948378e-01
+2.492275176071283571e-01 4.435849323073600692e-01 5.935491293785424283e-01
+2.509665668417216944e-01 4.514340415062205181e-01 5.951395103673859932e-01
+2.528346862021874641e-01 4.592569393176054171e-01 5.967472668238706923e-01
+2.548184740794410263e-01 4.670582183399953347e-01 5.983761730113198452e-01
+2.569051367797046126e-01 4.748422758923547815e-01 6.000285749995881712e-01
+2.590825816132030779e-01 4.826133005480903182e-01 6.017055804809932074e-01
+2.613396987489819967e-01 4.903751992421883643e-01 6.034074237284018372e-01
+2.636659810857353015e-01 4.981317406526836744e-01 6.051330956906521008e-01
+2.660516582874621339e-01 5.058865272594796902e-01 6.068805013837572648e-01
+2.684882380171457750e-01 5.136428405367017280e-01 6.086470522439324515e-01
+2.709683308416185876e-01 5.214037172983150281e-01 6.104294711750373192e-01
+2.734857257205313141e-01 5.291719440816851083e-01 6.122238564648385672e-01
+2.760354668808263079e-01 5.369500509042623992e-01 6.140257392505246159e-01
+2.786139324558262742e-01 5.447403043452749838e-01 6.158301364812402978e-01
+2.812189151446758406e-01 5.525446999518639490e-01 6.176316008625786225e-01
+2.838497050469647731e-01 5.603649539888247988e-01 6.194242689076802089e-01
+2.865071747347951447e-01 5.682024945496734203e-01 6.212019079466474247e-01
+2.891935293105973304e-01 5.760585509806988025e-01 6.229575870601862242e-01
+2.919132661023912667e-01 5.839338872257091584e-01 6.246846842638799080e-01
+2.946726143633343065e-01 5.918289843891730850e-01 6.263762188290394883e-01
+2.974797079780254205e-01 5.997440045832753697e-01 6.280249877540684533e-01
+3.003447193279823457e-01 6.076787658883653354e-01 6.296236627075371128e-01
+3.032799496578738041e-01 6.156327286641396501e-01 6.311648425953061414e-01
+3.062999162775806861e-01 6.236049805794583456e-01 6.326411091031564071e-01
+3.094214341373541788e-01 6.315942201545601264e-01 6.340450861601970578e-01
+3.126636885203824545e-01 6.395987386132337971e-01 6.353695045172913503e-01
+3.160482946464280851e-01 6.476163998706647718e-01 6.366072729215248582e-01
+3.195993388733257556e-01 6.556446185422359907e-01 6.377515576836865208e-01
+3.233433949344308722e-01 6.636803359579184214e-01 6.387958727683986648e-01
+3.273095072934468774e-01 6.717199943156246800e-01 6.397341828681051279e-01
+3.315291322901112725e-01 6.797595093162658308e-01 6.405610222271946874e-01
+3.360351011011302735e-01 6.877945827659479594e-01 6.412695960850323118e-01
+3.408640318201912600e-01 6.958197818437616977e-01 6.418569321473704958e-01
+3.460540467004642462e-01 7.038291754672099110e-01 6.423205839967465192e-01
+3.516446005650431528e-01 7.118162697085735902e-01 6.426589560156208414e-01
+3.576762479926827720e-01 7.197739138067411613e-01 6.428719883285997083e-01
+3.641894512092864744e-01 7.276949011320993366e-01 6.429557270674552960e-01
+3.712266123106295335e-01 7.355700686179795778e-01 6.429189618774799886e-01
+3.788278449989629926e-01 7.433902546660990929e-01 6.427683061328856029e-01
+3.870322615152646528e-01 7.511462095764531721e-01 6.425055472082883412e-01
+3.958750262046074608e-01 7.588270315806920907e-01 6.421508285001665817e-01
+4.053883482522956383e-01 7.664223146281371468e-01 6.417151578859574546e-01
+4.155968407812616339e-01 7.739210344346504344e-01 6.412227317683711902e-01
+4.265195639210723755e-01 7.813124732411278472e-01 6.406960731925235297e-01
+4.381634653667463852e-01 7.885863788123392837e-01 6.401694292235835526e-01
+4.505287643111087204e-01 7.957333261733031682e-01 6.396742566585853496e-01
+4.635986539031755060e-01 8.027456073395251579e-01 6.392548734619343254e-01
+4.773469739538908629e-01 8.096172922533247940e-01 6.389538165444101914e-01
+4.917330703220189059e-01 8.163450533427777378e-01 6.388184799685107107e-01
+5.067050118087177424e-01 8.229283397233977393e-01 6.388963162980869637e-01
+5.221997330825246530e-01 8.293697946738645133e-01 6.392346216632595057e-01
+5.381481232862911357e-01 8.356748924828519831e-01 6.398763669277579558e-01
+5.544783665092802849e-01 8.418515860497588488e-01 6.408587965640016870e-01
+5.711115213696185133e-01 8.479112775740021979e-01 6.422171169895777298e-01
+5.879840953182007279e-01 8.538646600753627691e-01 6.439710905713145195e-01
+6.050194699551968425e-01 8.597270135144634562e-01 6.461439080647282118e-01
+6.221681809999368706e-01 8.655099786991408140e-01 6.487403091120448329e-01
+6.393757001353049807e-01 8.712277338509245572e-01 6.517658303256151919e-01
+6.565929334411800822e-01 8.768947704523611941e-01 6.552210497573525139e-01
+6.737933070789577927e-01 8.825213731875580780e-01 6.590961736178440056e-01
+6.909478082204841831e-01 8.881191135591984809e-01 6.633823202371271766e-01
+7.080340865696405084e-01 8.936985513356989763e-01 6.680678941563225059e-01
+7.250358375800118882e-01 8.992691342626382145e-01 6.731393536848668813e-01
+7.419421046029871514e-01 9.048391559449654453e-01 6.785819005039074314e-01
+7.587465580267132026e-01 9.104157595099175992e-01 6.843800748081978469e-01
+7.754467945117471395e-01 9.160049747102424478e-01 6.905182510191696377e-01
+7.920436855303579771e-01 9.216117772405966191e-01 6.969810377273069069e-01
+8.085407925860420564e-01 9.272401607530683654e-01 7.037535913222745521e-01
+8.249438571064254822e-01 9.328932140048489252e-01 7.108218561594963347e-01
+8.412422934868647451e-01 9.385792958890862847e-01 7.181734629573161000e-01
+8.574559441871676402e-01 9.442965454208677167e-01 7.257948454644865821e-01
+8.735986658557798323e-01 9.500445573198598170e-01 7.336747582572585857e-01
+8.896512126622908578e-01 9.558344072358454513e-01 7.418023698547455691e-01
+9.056514559384564178e-01 9.616567079910524063e-01 7.501688017241657791e-01
+9.215850348376466439e-01 9.675205198521025229e-01 7.587646801057830181e-01
+9.374799177499437697e-01 9.734191074102575003e-01 7.675843461643131471e-01
+9.533233708513803029e-01 9.793607550577946297e-01 7.766197776697654209e-01
+9.691488355955474310e-01 9.853357520972024775e-01 7.858697059005903540e-01
+9.849374457410008388e-01 9.913545172197536504e-01 7.953271573982337861e-01
+5.237510688652501772e-02 1.452546228317073418e-01 7.751950190923809214e-02
+5.622628551680566161e-02 1.523457500722602831e-01 8.040279400454641845e-02
+6.007072166263575236e-02 1.593963705834963718e-01 8.324827330002768089e-02
+6.385205670255669763e-02 1.664232541404700172e-01 8.599651952193751447e-02
+6.756460338718012215e-02 1.734310951493893138e-01 8.864073081078854832e-02
+7.121409992638502717e-02 1.804216402085259963e-01 9.118655316732873772e-02
+7.479859509186639888e-02 1.873981595163995706e-01 9.363114185870033412e-02
+7.832196854697648369e-02 1.943623428359516903e-01 9.597819921125996800e-02
+8.178249510428708957e-02 2.013169715395964343e-01 9.822505767280115263e-02
+8.518219102467458614e-02 2.082637805063026204e-01 1.003733079455831900e-01
+8.852454157738801066e-02 2.152040105951080751e-01 1.024263253707545229e-01
+9.181013978863614144e-02 2.221394247672267563e-01 1.043841327744766678e-01
+9.503809838243432173e-02 2.290719902760253168e-01 1.062449430282469132e-01
+9.821010670676499910e-02 2.360029705984670323e-01 1.080100113958255836e-01
+1.013286574784400540e-01 2.429333482333665417e-01 1.096815914631605327e-01
+1.043934471701543076e-01 2.498646410896294690e-01 1.112585290437959340e-01
+1.074478296880792549e-01 2.567911108934768372e-01 1.127437202480449374e-01
+1.106260709129789077e-01 2.636946096457899458e-01 1.140997527427590474e-01
+1.139531706355643714e-01 2.705743606077580798e-01 1.152896296272559462e-01
+1.174768136636618332e-01 2.774250521408649361e-01 1.162908535730605153e-01
+1.213000971217181034e-01 2.842316842811704602e-01 1.170941428738193346e-01
+1.255340801183247312e-01 2.909784812573655843e-01 1.176678790007481823e-01
+1.303876420091158728e-01 2.976323416853482451e-01 1.179910028329904936e-01
+1.361775080109454139e-01 3.041399107394244794e-01 1.180416347026809198e-01
+1.434815209152097981e-01 3.103930959766884601e-01 1.179050440739785321e-01
+1.530522840464018097e-01 3.162194219215394564e-01 1.180658427800789778e-01
+1.647443020935283886e-01 3.215541086259602332e-01 1.195833209716834211e-01
+1.771224001134716619e-01 3.266051714744359624e-01 1.228383029974784990e-01
+1.893186680349762951e-01 3.315543486926041949e-01 1.273271390832197980e-01
+2.011470216295637714e-01 3.364693524047602802e-01 1.325809211223410999e-01
+2.126201126913634942e-01 3.413717760208538898e-01 1.383257062913032798e-01
+2.237814929443558420e-01 3.462703085838705896e-01 1.444001987716135027e-01
+2.346826504126838242e-01 3.511667839317458850e-01 1.507119862068962424e-01
+2.453653984352425765e-01 3.560619397292786315e-01 1.572020472843533856e-01
+2.558610883411705506e-01 3.609568875025493395e-01 1.638280010474283122e-01
+2.662540618029768935e-01 3.658464720551902194e-01 1.703646574946249270e-01
+2.766375890957337713e-01 3.707202928157689592e-01 1.766042606681927363e-01
+2.870120792807265286e-01 3.755815421723879277e-01 1.825448147300349488e-01
+2.973798701367175723e-01 3.804331662296118188e-01 1.881754975600970214e-01
+3.077385714853347887e-01 3.852782482569529487e-01 1.935061166107706343e-01
+3.180883154404229307e-01 3.901193934855016199e-01 1.985393196990216658e-01
+3.284295845809043213e-01 3.949589033692603168e-01 2.032788009798182638e-01
+3.387636524478269684e-01 3.997986013442899611e-01 2.077297610727937283e-01
+3.490920713533000597e-01 4.046399832445768951e-01 2.118988339848660862e-01
+3.594164000962936090e-01 4.094843090462684243e-01 2.157940430809284771e-01
+3.697392907451491073e-01 4.143322752680254073e-01 2.194241817700406383e-01
+3.800629535453087238e-01 4.191845097543299148e-01 2.227990620346612660e-01
+3.903897648146955057e-01 4.240414062699767728e-01 2.259290789901750585e-01
+4.007222760346346169e-01 4.289031445516293117e-01 2.288249032905495528e-01
+4.110629393231473583e-01 4.337698031247444463e-01 2.314973656174672545e-01
+4.214141346107081465e-01 4.386413758769234783e-01 2.339572260458537833e-01
+4.317776944235289238e-01 4.435179532313937023e-01 2.362153631413001498e-01
+4.421554582272910761e-01 4.483995629988481446e-01 2.382822640902987343e-01
+4.525491728091692312e-01 4.532862202325000367e-01 2.401679621083726013e-01
+4.629617793452492358e-01 4.581777295849584486e-01 2.418766613523773423e-01
+4.733964081044912953e-01 4.630738873787103027e-01 2.434097398165305792e-01
+4.838512407114513025e-01 4.679753825260214994e-01 2.447870115640884969e-01
+4.943280333549550654e-01 4.728822194350857377e-01 2.460147775573224282e-01
+5.048329973069679566e-01 4.777936355059679285e-01 2.470786486003125892e-01
+5.153613297132805249e-01 4.827109910092828859e-01 2.480074378391989298e-01
+5.259177888805488532e-01 4.876337443949864681e-01 2.487920646168808037e-01
+5.365028531047130178e-01 4.925622747803105050e-01 2.494384427855986242e-01
+5.471168004411860464e-01 4.974969337464568153e-01 2.499544447192391661e-01
+5.577636102245655536e-01 5.024372790562059432e-01 2.503320304175396527e-01
+5.684402705004985012e-01 5.073846875194365502e-01 2.505862169320990929e-01
+5.791517884291441653e-01 5.123382474891868821e-01 2.507078127142677859e-01
+5.898977118592134694e-01 5.172986884163369714e-01 2.507019666506383193e-01
+6.006780609928230596e-01 5.222664305265023454e-01 2.505758843768319810e-01
+6.114977839232860202e-01 5.272408795639659251e-01 2.503116806147138718e-01
+6.223533151135658414e-01 5.322233326069301107e-01 2.499311738427514862e-01
+6.332678499493179514e-01 5.372050254585409856e-01 2.494034423308610915e-01
+6.442492302385145475e-01 5.421770814367210534e-01 2.488390322915944863e-01
+6.553235853574364000e-01 5.471283166651099705e-01 2.482154543042252026e-01
+6.664663550324848584e-01 5.520678623990600276e-01 2.475959486163559209e-01
+6.777036161655425328e-01 5.569846941304811283e-01 2.469507035732461664e-01
+6.890381603900364027e-01 5.618763691265282745e-01 2.463040749474359470e-01
+7.004711944468632323e-01 5.667403668940831363e-01 2.456991151603213352e-01
+7.120126265469914895e-01 5.715693590145963787e-01 2.451873584080898616e-01
+7.236929482815777082e-01 5.763444689764196660e-01 2.448364505953754544e-01
+7.355168651190714391e-01 5.810504769862679941e-01 2.449163925191181757e-01
+7.475258033710173722e-01 5.856296804733571726e-01 2.462013043800762579e-01
+7.577499494457186069e-01 5.908503548553694085e-01 2.547905571379186496e-01
+7.635824979182088690e-01 5.981540408918001317e-01 2.695060335496625714e-01
+7.685008057442868079e-01 6.059656669084559910e-01 2.841339736308181596e-01
+7.731069113227515555e-01 6.139683821427790456e-01 2.985534874705023101e-01
+7.775652489236080100e-01 6.220751351043045663e-01 3.127742014086093980e-01
+7.819223609772602002e-01 6.302590951035305089e-01 3.268597741416817137e-01
+7.862053950616281206e-01 6.385051507786967395e-01 3.408479839175493908e-01
+7.904426037822046558e-01 6.467997885569605199e-01 3.547436291978552925e-01
+7.946574580110756791e-01 6.551326370117361853e-01 3.685463547975237342e-01
+7.988337796012735526e-01 6.635096250178373900e-01 3.823162323281250607e-01
+8.030088001380106810e-01 6.719161948372565085e-01 3.960118210517307724e-01
+8.071531032877933276e-01 6.803638144055433878e-01 4.097046504341926854e-01
+8.113041001849377043e-01 6.888386707654255980e-01 4.233460558902438220e-01
+8.154602754828877975e-01 6.973419981167042758e-01 4.369537331203900976e-01
+8.196058627154122478e-01 7.058802025749554288e-01 4.505666902424197429e-01
+8.237568818874844156e-01 7.144480574336203871e-01 4.641691373089507633e-01
+8.279197418246522222e-01 7.230440823922363869e-01 4.777602014010458586e-01
+8.320913582455962132e-01 7.316701160638459100e-01 4.913552497157864241e-01
+8.362534254444016213e-01 7.403317836360435722e-01 5.050123599879642322e-01
+8.404445466425872757e-01 7.490163102116410565e-01 5.186797759271363217e-01
+8.446648066780128028e-01 7.577248034134459465e-01 5.323633003798176055e-01
+8.489177724746317377e-01 7.664572638824626027e-01 5.460621193928290040e-01
+8.532123511454875464e-01 7.752120992980529035e-01 5.597655879096986586e-01
+8.575441658298394998e-01 7.839918355417494489e-01 5.734875036821195371e-01
+8.619146064360614368e-01 7.927971784487287676e-01 5.872309291049341295e-01
+8.663250853209770730e-01 8.016288174204664330e-01 6.009988751772729065e-01
+8.707820725499390013e-01 8.104859794311163323e-01 6.147852119944903215e-01
+8.752928841127598503e-01 8.193677275097041024e-01 6.285824125979521115e-01
+8.798495959466368088e-01 8.282774528639023082e-01 6.424105990843714808e-01
+8.844600743726268588e-01 8.372140407050960853e-01 6.562614074750376947e-01
+8.891318088448872947e-01 8.461765685160849149e-01 6.701273264224787418e-01
+8.938558100770686021e-01 8.551685709847908212e-01 6.840307207014526547e-01
+8.986544949798678239e-01 8.641851727809914951e-01 6.979374582474833222e-01
+9.035103927619371200e-01 8.732320822602240851e-01 7.118855904188222672e-01
+9.084448340107732500e-01 8.823048446731206473e-01 7.258432784575933328e-01
+9.134526188903524524e-01 8.914059055188421343e-01 7.398268438202468822e-01
+9.185353828258727704e-01 9.005358905803305669e-01 7.538405390559674846e-01
+9.237018976170942031e-01 9.096936780016002810e-01 7.678758238575987827e-01
+9.289597403884261029e-01 9.188785152907725795e-01 7.819264008239902308e-01
+9.343121189309133712e-01 9.280907276838803455e-01 7.959940980655445530e-01
+9.397648981125013012e-01 9.373300331729016444e-01 8.100759042872343052e-01
+9.453185269797627077e-01 9.465973949550759992e-01 8.241789901926560580e-01
+9.509801771850346919e-01 9.558922732509941289e-01 8.382978631896051969e-01
+9.567560362262098606e-01 9.652144306850017896e-01 8.524284880105463813e-01
+9.626518136622860267e-01 9.745638255706342568e-01 8.665671328953633568e-01
+9.686647318914142213e-01 9.839422330504176140e-01 8.807260550903986962e-01
+9.747892173640951841e-01 9.933519398287798952e-01 8.949228432580742520e-01];
+
+   case 'dif' % diff
+      RGB = [3.080165225110909760e-02 1.368487040065790861e-01 2.498464445599150041e-01
+3.427654989146505099e-02 1.437127028532935447e-01 2.573239494162229413e-01
+3.787813715751361943e-02 1.505402390894255427e-01 2.647902048135927777e-01
+4.156812010333730406e-02 1.573357824203455158e-01 2.722473736730874894e-01
+4.517179532760850352e-02 1.641035092921928340e-01 2.796979818302940402e-01
+4.870180895529663961e-02 1.708454227759541588e-01 2.871401983091831367e-01
+5.214717289956722485e-02 1.775659175978645810e-01 2.945787303179320804e-01
+5.551364141943334468e-02 1.842674761732781552e-01 3.020142881481510666e-01
+5.878267145509050856e-02 1.909546841623958602e-01 3.094531346302050734e-01
+6.203222237219494645e-02 1.976272549553735325e-01 3.168486096722107348e-01
+6.521944756836103863e-02 2.042923786219034143e-01 3.242073651148437707e-01
+6.833928990190613062e-02 2.109538539883098474e-01 3.315240779733869547e-01
+7.142525636138788436e-02 2.176109417067573770e-01 3.387875021305949974e-01
+7.444813366291075374e-02 2.242694950814881905e-01 3.459978826653878348e-01
+7.742364240945528997e-02 2.309308575473027481e-01 3.531440825838942366e-01
+8.038349666926730697e-02 2.375958135712563091e-01 3.602034285272879832e-01
+8.335927002300280719e-02 2.442657843736594225e-01 3.671480689795030838e-01
+8.636609239069936717e-02 2.509437864845217581e-01 3.739531368808389766e-01
+8.948430357745071340e-02 2.576279992007458053e-01 3.805657110274591748e-01
+9.284058523033036914e-02 2.643149709823168769e-01 3.868990078988859826e-01
+9.668345778728781870e-02 2.709875997226547928e-01 3.928398106800405909e-01
+1.013388564145758508e-01 2.776155815858447617e-01 3.982760426582682145e-01
+1.072606416994524026e-01 2.841399259508246011e-01 4.031326823215036770e-01
+1.144021508332261350e-01 2.905306843282992602e-01 4.075704938470787742e-01
+1.224943240061644456e-01 2.967876633109050588e-01 4.117594183512530703e-01
+1.310866885733582565e-01 3.029446515900964254e-01 4.158631835078765437e-01
+1.399259448624195767e-01 3.090284381668210734e-01 4.199407082636338884e-01
+1.488880808179499637e-01 3.150548708758020844e-01 4.240166515702193939e-01
+1.578509724192573571e-01 3.210422517899584882e-01 4.281197299059529837e-01
+1.668002459411131178e-01 3.269969805380745775e-01 4.322421588278035354e-01
+1.756791094481522930e-01 3.329300099876690844e-01 4.364047384684796027e-01
+1.845067584338563049e-01 3.388436977327556332e-01 4.405895801655569377e-01
+1.932823885204988379e-01 3.447414431949823999e-01 4.447966430522279913e-01
+2.019870459778479455e-01 3.506290556082184984e-01 4.490357338061347625e-01
+2.106258150884706692e-01 3.565090549124025343e-01 4.533046032331278785e-01
+2.192099721057354511e-01 3.623829850143509002e-01 4.575959954859014078e-01
+2.277275445301833456e-01 3.682546023486205078e-01 4.619233127548696971e-01
+2.361939130992141700e-01 3.741245762230066552e-01 4.662760464071296629e-01
+2.446124256489054516e-01 3.799946234495278352e-01 4.706542744097454434e-01
+2.529874638889413330e-01 3.858660993963552444e-01 4.750577339190826254e-01
+2.613341048773878406e-01 3.917383910736120800e-01 4.794796637798960925e-01
+2.696394299537646644e-01 3.976153747948966699e-01 4.839303534081906277e-01
+2.779049881050036919e-01 4.034985563305431566e-01 4.884111449080716372e-01
+2.861363993124647065e-01 4.093887667782184492e-01 4.929196308795206760e-01
+2.943389940220551004e-01 4.152865778556348864e-01 4.974548265548736636e-01
+3.025334250389247748e-01 4.211897194688838386e-01 5.020046120542877022e-01
+3.106982442651501364e-01 4.271034039757660716e-01 5.065852469354352738e-01
+3.188368260273997667e-01 4.330284571606364818e-01 5.111959566876937977e-01
+3.269657343217935996e-01 4.389628772920392552e-01 5.158284147455556301e-01
+3.350816436419064015e-01 4.449085811856242079e-01 5.204856000258065718e-01
+3.431739289326510289e-01 4.508688325370560634e-01 5.251766674651570099e-01
+3.512656069646695189e-01 4.568402506918622374e-01 5.298868083741347101e-01
+3.593506132834142774e-01 4.628250736129231879e-01 5.346217853574988244e-01
+3.674172478556836929e-01 4.688267836740107053e-01 5.393913336663840319e-01
+3.754973469427250743e-01 4.748398228270848676e-01 5.441739055327718955e-01
+3.835625614368970981e-01 4.808709517650425203e-01 5.489922576544932209e-01
+3.916201861820892138e-01 4.869196696786777800e-01 5.538424587653016928e-01
+3.996888560566008164e-01 4.929829902359726401e-01 5.587113837570589769e-01
+4.077452976164708254e-01 4.990668992329919118e-01 5.636172499463452112e-01
+4.158238363550112449e-01 5.051647578473101863e-01 5.685356950340605398e-01
+4.238869442834262147e-01 5.112855069066921665e-01 5.734980302852201728e-01
+4.319617699154935098e-01 5.174241819464946435e-01 5.784833267853278782e-01
+4.400436018491948320e-01 5.235826893170786311e-01 5.834960386464431714e-01
+4.481312796407512233e-01 5.297621053719542283e-01 5.885383546494945550e-01
+4.562263279894743229e-01 5.359626809225542798e-01 5.936121659102355785e-01
+4.643239808635050703e-01 5.421865887597332456e-01 5.987202656129063660e-01
+4.724486870344450362e-01 5.484289164378903791e-01 6.038441893417568762e-01
+4.805822297704738788e-01 5.546948405817618832e-01 6.089980501349065989e-01
+4.887172410474664441e-01 5.609869159623338541e-01 6.141889435023867305e-01
+4.968703980230008699e-01 5.673022611108096136e-01 6.194017678807255400e-01
+5.050230443352835552e-01 5.736457002325791033e-01 6.246566996141469374e-01
+5.132020014296254651e-01 5.800120364495556791e-01 6.299281926614284099e-01
+5.213837697997298903e-01 5.864072076681272616e-01 6.352414056079356275e-01
+5.295840791882617804e-01 5.928284223714805901e-01 6.405818144094436173e-01
+5.377985006631785803e-01 5.992773867217912054e-01 6.459553074236056291e-01
+5.460310568089291605e-01 6.057538951510261782e-01 6.513591302487201640e-01
+5.542803602235417681e-01 6.122589708601943181e-01 6.567960616850564426e-01
+5.625427909572455754e-01 6.187941687382881861e-01 6.622712272448196824e-01
+5.708318382965930082e-01 6.253570561449082188e-01 6.677719395169281480e-01
+5.791326606499368479e-01 6.319518087895650282e-01 6.733150010032186161e-01
+5.874594162608378634e-01 6.385758077347706285e-01 6.788869295566190010e-01
+5.958021954354665306e-01 6.452321052037962579e-01 6.844994504225663245e-01
+6.041669493667392032e-01 6.519200031142581286e-01 6.901476288957911764e-01
+6.125605719486232337e-01 6.586385467570500252e-01 6.958254420726305289e-01
+6.209702599139194090e-01 6.653915355400340514e-01 7.015478000189213637e-01
+6.294086543235715148e-01 6.721766263526947061e-01 7.073025514622064414e-01
+6.378691230472761653e-01 6.789961486811091351e-01 7.130980827587862780e-01
+6.463529402277414793e-01 6.858505203730194122e-01 7.189343580950778856e-01
+6.548667336608775535e-01 6.927388303718031715e-01 7.248055449230874636e-01
+6.634047329440709850e-01 6.996632326198537477e-01 7.307191763991576217e-01
+6.719706356478575282e-01 7.066235438274829361e-01 7.366725743067246146e-01
+6.805691273316444301e-01 7.136193210595811465e-01 7.426619469578672472e-01
+6.891901686164448870e-01 7.206538297392898196e-01 7.486995567627365844e-01
+6.978417441976546565e-01 7.277258099214434228e-01 7.547780354337728648e-01
+7.065266827690414031e-01 7.348352863051689221e-01 7.608955968203486853e-01
+7.152395659488615109e-01 7.419843878319358765e-01 7.670595168287617227e-01
+7.239821407052556834e-01 7.491734241473727574e-01 7.732692164928602896e-01
+7.327590970387688474e-01 7.564019312463790001e-01 7.795208278459410112e-01
+7.415714112445037642e-01 7.636703716037079870e-01 7.858145260879668692e-01
+7.504112152902991939e-01 7.709814701087125410e-01 7.921602549877707622e-01
+7.592858091842216162e-01 7.783339526866095426e-01 7.985510124613616201e-01
+7.681958083667864701e-01 7.857281516038946423e-01 8.049869935018724165e-01
+7.771415943289318173e-01 7.931642615485536840e-01 8.114683168046802342e-01
+7.861210234635496175e-01 8.006428249211288151e-01 8.179973940806203325e-01
+7.951301023947144886e-01 8.081643845947440452e-01 8.245778955860991744e-01
+8.041728469938760337e-01 8.157266105617665408e-01 8.312032233576642781e-01
+8.132456568435891819e-01 8.233280673585187115e-01 8.378734408880845752e-01
+8.223487919825404058e-01 8.309646782111167473e-01 8.445815347091445435e-01
+8.314739162371332926e-01 8.386323940000459665e-01 8.513263697699344767e-01
+8.406130156021551780e-01 8.463239863842642041e-01 8.581012298825883011e-01
+8.497544923553936869e-01 8.540290636742366992e-01 8.648964939043677358e-01
+8.588848363304528721e-01 8.617324046759308187e-01 8.716956826827835236e-01
+8.679835640163260368e-01 8.694139530371515212e-01 8.784788921095023628e-01
+8.770201283066206832e-01 8.770482020713447069e-01 8.852238656983413279e-01
+8.859648522194258913e-01 8.845997703979764371e-01 8.918910598190278316e-01
+8.947687008355051930e-01 8.920276102541201402e-01 8.984445530744430419e-01
+9.033850238565973578e-01 8.992781133601027710e-01 9.048255526813022698e-01
+9.117454267355319386e-01 9.062912781484097069e-01 9.109792984365244761e-01
+9.197772674046712504e-01 9.129962371365842877e-01 9.168355520637951894e-01
+9.273989381574117008e-01 9.193137785263337802e-01 9.223160826098045773e-01
+9.345265056154450356e-01 9.251567923877340727e-01 9.273308757297369365e-01
+9.410568294999761552e-01 9.304383120413204367e-01 9.318033109548278237e-01
+9.469054517188711939e-01 9.350653892052174232e-01 9.356338452806639561e-01
+9.519782306847331954e-01 9.389521024465230514e-01 9.387414682758670192e-01
+9.561855219785392324e-01 9.420212349770757942e-01 9.410568432390962190e-01
+9.594583919916889192e-01 9.442053410129402913e-01 9.425129916890260251e-01
+9.617359608985257546e-01 9.454553544501299589e-01 9.430685634745854529e-01
+9.629655575123797773e-01 9.457446361853111272e-01 9.427146073591580189e-01
+9.629717304152120017e-01 9.451630117299317790e-01 9.411078740469980275e-01
+9.619086196808096512e-01 9.436969537999753133e-01 9.379427077261371926e-01
+9.599163272304170880e-01 9.412870435035790573e-01 9.337158672983336682e-01
+9.570384080931425563e-01 9.379846152444032414e-01 9.285135912753641474e-01
+9.533354457428268036e-01 9.338571023316933895e-01 9.224353821916627671e-01
+9.488865060103991445e-01 9.289840890976138743e-01 9.155685277230518615e-01
+9.437794827762752137e-01 9.234529155688914193e-01 9.080043258769950887e-01
+9.381021433775925678e-01 9.173543171347293690e-01 8.998514836828582775e-01
+9.319492013404071518e-01 9.107783993290641256e-01 8.911882560099286810e-01
+9.254038313424192141e-01 9.038112443270013285e-01 8.821180550321400249e-01
+9.185496533096065841e-01 8.965322509059643341e-01 8.727092681908217298e-01
+9.114540331246678839e-01 8.890124126067980859e-01 8.630519170031795140e-01
+9.041820632910790856e-01 8.813132734312176808e-01 8.531979805537907025e-01
+8.967869578435456734e-01 8.734867291901790010e-01 8.431978773211421530e-01
+8.893098149893794435e-01 8.655753876269207669e-01 8.331030513350975442e-01
+8.817848418192094639e-01 8.576132802667703059e-01 8.229492517613266056e-01
+8.742401985712474621e-01 8.496268650289525715e-01 8.127582978377587697e-01
+8.666945370128648074e-01 8.416362324606945222e-01 8.025572922175608914e-01
+8.591642949649661576e-01 8.336561546444334336e-01 7.923557697274130618e-01
+8.516606462490278195e-01 8.256972216872984216e-01 7.821629896098961643e-01
+8.441881675648532646e-01 8.177668584523517525e-01 7.719978747167733912e-01
+8.367546003836178192e-01 8.098699298493980958e-01 7.618548556771399527e-01
+8.293628053720738524e-01 8.020095841729102393e-01 7.517385870991303287e-01
+8.220122974103521996e-01 7.941877657343777708e-01 7.416604820361886174e-01
+8.147055831041186691e-01 7.864054338886661277e-01 7.316158935999518276e-01
+8.074428695046120819e-01 7.786629991741689238e-01 7.216062017816766705e-01
+8.002239536861533997e-01 7.709604828947951294e-01 7.116324410842282955e-01
+7.930486047248805903e-01 7.632976487972781277e-01 7.016945092401379869e-01
+7.859155444098100407e-01 7.556741407493390295e-01 6.917956122566603083e-01
+7.788239785472398369e-01 7.480894917424205648e-01 6.819365996758520732e-01
+7.717761666842225532e-01 7.405430431500328314e-01 6.721061511286441359e-01
+7.647695126504651109e-01 7.330343101062176681e-01 6.623117248985945782e-01
+7.578024759469249583e-01 7.255627582077430748e-01 6.525565861539863732e-01
+7.508747011746044198e-01 7.181277940669236193e-01 6.428393514066714776e-01
+7.439860296366358483e-01 7.107288105275537671e-01 6.331578659286328792e-01
+7.371380352230317845e-01 7.033650997305714858e-01 6.235032380461981161e-01
+7.303267295539673798e-01 6.960362660858002704e-01 6.138882457032197593e-01
+7.235516370761116978e-01 6.887417344158411892e-01 6.043120048450656423e-01
+7.168136574616641443e-01 6.814808447026716731e-01 5.947682975771849678e-01
+7.101132300652239770e-01 6.742529573780132734e-01 5.852527166373640011e-01
+7.034464832580180627e-01 6.670577263264326762e-01 5.757776499898806799e-01
+6.968134241386333416e-01 6.598945644190796767e-01 5.663404055906162693e-01
+6.902175511682563380e-01 6.527626219057073298e-01 5.569247166393624937e-01
+6.836530241251399520e-01 6.456617329968893371e-01 5.475506786771059398e-01
+6.771191923792275746e-01 6.385913765706551226e-01 5.382182031186726334e-01
+6.706213406334817773e-01 6.315505441676552145e-01 5.289041000996647091e-01
+6.641534350911151297e-01 6.245391367090507018e-01 5.196292578451316979e-01
+6.577148635275871236e-01 6.175566394334415232e-01 5.103934681036723653e-01
+6.513106015597026621e-01 6.106020304081083427e-01 5.011747507363846221e-01
+6.449339394177714402e-01 6.036753299959042307e-01 4.919966626063084214e-01
+6.385861657554016135e-01 5.967758543247165814e-01 4.828515990278902659e-01
+6.322678284337878152e-01 5.899029749242099552e-01 4.737348355247164577e-01
+6.259767255318442469e-01 5.830569263656453227e-01 4.646452891563762067e-01
+6.197016579332955688e-01 5.762398779913381341e-01 4.556052788341879434e-01
+6.134474028946137469e-01 5.694504347953359691e-01 4.465979423650075497e-01
+6.072178659159134240e-01 5.626871366850844103e-01 4.376111326566481941e-01
+6.010012505217495749e-01 5.559520936787821777e-01 4.286719487404299644e-01
+5.948055640046073789e-01 5.492429546962157572e-01 4.197575498195730836e-01
+5.886326075840858651e-01 5.425588558149744278e-01 4.108591465488395378e-01
+5.824702130202078498e-01 5.359018268492113934e-01 4.020079470557531565e-01
+5.763248263841350694e-01 5.292699281179926718e-01 3.931837482598241618e-01
+5.701972311820494577e-01 5.226623693222695044e-01 3.843824114977716366e-01
+5.640831336223245396e-01 5.160796590123359895e-01 3.756116269725132129e-01
+5.579774433964941327e-01 5.095224539424874077e-01 3.668822207066750885e-01
+5.518860265359687434e-01 5.029888698004121306e-01 3.581753826709989652e-01
+5.458070559295251645e-01 4.964787819395978796e-01 3.494931200704951557e-01
+5.397391255491313933e-01 4.899920506546056598e-01 3.408352402134943726e-01
+5.336730625437067221e-01 4.835304037810426725e-01 3.322231435985951165e-01
+5.276152444526773788e-01 4.770918383518058525e-01 3.236356057173125356e-01
+5.215648631466205387e-01 4.706762498171280229e-01 3.150682292920859440e-01
+5.155189794095078604e-01 4.642837707070938680e-01 3.065265223389798677e-01
+5.094751216031231378e-01 4.579145264501231494e-01 2.980134272377937266e-01
+5.034310278715931064e-01 4.515686733480185899e-01 2.895302566325898552e-01
+4.973847636608849654e-01 4.452464140846874030e-01 2.810755531259728768e-01
+4.913352410442906604e-01 4.389480201490584821e-01 2.726410128949737222e-01
+4.852774212045994351e-01 4.326740360757653225e-01 2.642407735080369302e-01
+4.792095319460407121e-01 4.264249820482975961e-01 2.558674925325885585e-01
+4.731283857839347351e-01 4.202016073968968812e-01 2.475197805445442101e-01
+4.670296949396188224e-01 4.140048440647509653e-01 2.392012072518971966e-01
+4.609095096289907434e-01 4.078358796897652017e-01 2.309089502347338452e-01
+4.547601620003904332e-01 4.016973741434559098e-01 2.226435585187958033e-01
+4.485682425668168771e-01 3.955931855786054552e-01 2.144296211245620976e-01
+4.423342563272031902e-01 3.895240159345254582e-01 2.062390835191822425e-01
+4.360296791131279548e-01 3.834992742811840771e-01 1.981208646399195139e-01
+4.296458451439821302e-01 3.775230805131955525e-01 1.900605950657147936e-01
+4.231474637241839920e-01 3.716087794574343128e-01 1.820957501112273613e-01
+4.164868167567738477e-01 3.657737180218046391e-01 1.742972729554080058e-01
+4.095973903281860951e-01 3.600427549828760787e-01 1.667592074668843294e-01
+4.023838616513769062e-01 3.544471779032521419e-01 1.597054883781360846e-01
+3.947814112345453541e-01 3.489995705485997579e-01 1.534550340717726336e-01
+3.868766298266183568e-01 3.436490149527227644e-01 1.482247271514051945e-01
+3.788659234446942747e-01 3.383142918487055395e-01 1.438533685673206441e-01
+3.708789643993818941e-01 3.329519259272508136e-01 1.400354190966675849e-01
+3.629572903164399733e-01 3.275541151937279016e-01 1.365461363519130944e-01
+3.551085081353937412e-01 3.221231228094754706e-01 1.332624917481727012e-01
+3.473247934253401170e-01 3.166654234722757755e-01 1.301119558630651207e-01
+3.396071981367110304e-01 3.111828368128046196e-01 1.270354172742856058e-01
+3.319394021514575632e-01 3.056815149128923048e-01 1.240384908643338280e-01
+3.243282276863680424e-01 3.001605128554065693e-01 1.210640172441826978e-01
+3.167622056152286647e-01 2.946237048061004504e-01 1.181174627342822525e-01
+3.092325069255885128e-01 2.890737927737177526e-01 1.152025540049777530e-01
+3.017324462072743518e-01 2.835140481503690690e-01 1.122895803439803164e-01
+2.942527745713884313e-01 2.779485572093680079e-01 1.093519738743563285e-01
+2.867898062904237211e-01 2.723775024827345681e-01 1.063941382240281286e-01
+2.793462654071084406e-01 2.667988809657529936e-01 1.034093116060303130e-01
+2.719194579070843831e-01 2.612124593378840620e-01 1.004000094727539039e-01
+2.645072257635520119e-01 2.556177666826844330e-01 9.736769715746559917e-02
+2.571104715415328812e-01 2.500132794565106398e-01 9.430849274229180512e-02
+2.497278694500691398e-01 2.443981535173898045e-01 9.122222486885092629e-02
+2.423563418593929208e-01 2.387720412133358949e-01 8.811155590734742749e-02
+2.350006052093227549e-01 2.331320446993035422e-01 8.496581087820043177e-02
+2.276523216303719677e-01 2.274793513535450784e-01 8.179625154164907319e-02
+2.203179455088669636e-01 2.218103948803600289e-01 7.858901255132699770e-02
+2.129902634426870667e-01 2.161258230519468304e-01 7.535305204258735401e-02
+2.056701553920205483e-01 2.104236534304168016e-01 7.208351221952713495e-02
+1.983573399507774226e-01 2.047021786467214111e-01 6.877728527916648904e-02
+1.910498721129175737e-01 1.989600929322370426e-01 6.543378475478747736e-02
+1.837444391314300429e-01 1.931963704923697345e-01 6.205437817912465986e-02
+1.764424601043844409e-01 1.874084358013911600e-01 5.863230865340122305e-02
+1.691401736478186091e-01 1.815951106612115895e-01 5.516899293098562890e-02
+1.618355962290499162e-01 1.757545129863619104e-01 5.166248843687707565e-02
+1.545273276784393246e-01 1.698844060286744673e-01 4.810942800782175982e-02
+1.472136064507999498e-01 1.639824533449356636e-01 4.450649296503813440e-02
+1.398915640220567136e-01 1.580463968635001659e-01 4.085151092791106803e-02
+1.325571921668454445e-01 1.520740186438245822e-01 3.716809665985362082e-02
+1.252084444586500644e-01 1.460622428214301272e-01 3.362553317766520805e-02
+1.178384206042670801e-01 1.400089579293633535e-01 3.023931012520724576e-02
+1.104210154536264532e-01 1.339166670121798297e-01 2.703939689144004010e-02]; 
+
+   case 'tar' % tarn, the rain anomaly map
+      RGB = [8.982325470083904473e-02 1.386884202488073425e-01 5.339634747542102572e-02
+9.490477059882479471e-02 1.456373382629968793e-01 5.489581825948507826e-02
+9.996820923335580922e-02 1.525451879246892684e-01 5.635425405965687612e-02
+1.049932629133125961e-01 1.594260027028096272e-01 5.767943871793178995e-02
+1.099844886715972414e-01 1.662815862271170841e-01 5.888156855042592924e-02
+1.149326133871393096e-01 1.731199934404946961e-01 5.990900196219744317e-02
+1.198471368660654901e-01 1.799400614735769122e-01 6.079328815375505818e-02
+1.247299637162895547e-01 1.867439924225139936e-01 6.153299800422255134e-02
+1.295805228510759355e-01 1.935349340052088807e-01 6.211473969231569997e-02
+1.343996539632437981e-01 2.003151607373700460e-01 6.253114410253807209e-02
+1.391929081922307909e-01 2.070845521371987852e-01 6.279848839795282300e-02
+1.439554110569007950e-01 2.138477306592140859e-01 6.288007868082229335e-02
+1.487348911403759133e-01 2.205914714224685436e-01 6.284098523281120285e-02
+1.535498540172954285e-01 2.273157827161538247e-01 6.260141657412987559e-02
+1.584099704346516035e-01 2.340203331404673293e-01 6.214047826160282867e-02
+1.633293887964821223e-01 2.407033599878570240e-01 6.143905222634648416e-02
+1.683325411333271293e-01 2.473603962447930571e-01 6.047333430287041983e-02
+1.734516487390746486e-01 2.539840110977820697e-01 5.924078177592304734e-02
+1.787290092053028800e-01 2.605653696981221068e-01 5.769398812038967900e-02
+1.842226903108559743e-01 2.670914347726459082e-01 5.577103201204060973e-02
+1.900442575104325516e-01 2.735335271652731270e-01 5.343902039527659992e-02
+1.964012889997470146e-01 2.798383207240314197e-01 5.059091721484253873e-02
+2.038180981569160388e-01 2.858582487774559699e-01 4.734796165359243109e-02
+2.134803580554236468e-01 2.912137742752328173e-01 4.542335962452376946e-02
+2.246379258326957618e-01 2.959985720226946948e-01 4.791967673999841110e-02
+2.357078843306291693e-01 3.007243105772285929e-01 5.139927647716215769e-02
+2.466644952616644515e-01 3.054215218481723948e-01 5.513668228793693754e-02
+2.575461415550749367e-01 3.100881502728962680e-01 5.896503676513652897e-02
+2.683585986429155579e-01 3.147286848554897709e-01 6.282164605955981029e-02
+2.791275572039774722e-01 3.193399608455813055e-01 6.667246926393996520e-02
+2.898358184319489994e-01 3.239318024263264095e-01 7.050980744893517449e-02
+3.004984152503225037e-01 3.285032192279036534e-01 7.432550653130615137e-02
+3.111553190646883515e-01 3.330438874028457952e-01 7.810231939881484564e-02
+3.218034422925408755e-01 3.375573450510525597e-01 8.184304787716339957e-02
+3.324333011718812458e-01 3.420495081780127733e-01 8.555280814984053683e-02
+3.430769162896195046e-01 3.465110261365142996e-01 8.922112292532158317e-02
+3.537299359050021241e-01 3.509453072047716837e-01 9.285241010232825332e-02
+3.643894401193512600e-01 3.553552732120655588e-01 9.645119893644621412e-02
+3.750453108858616824e-01 3.597467221513847013e-01 1.000256142638818735e-01
+3.857100245562226637e-01 3.641166297482588132e-01 1.035734980914473635e-01
+3.963858021351523986e-01 3.684657518577320601e-01 1.070973667641381966e-01
+4.071213221517259173e-01 3.727752094149718864e-01 1.105826082064781946e-01
+4.178758479312351115e-01 3.770629074315066109e-01 1.140472314573759138e-01
+4.286423372903069851e-01 3.813332614724057046e-01 1.174974726735356911e-01
+4.394433776892578969e-01 3.855777866767184925e-01 1.209275883437508081e-01
+4.502962927333878373e-01 3.897896541113713975e-01 1.243344105962937429e-01
+4.611581205683302209e-01 3.939890872463367444e-01 1.277374475879362037e-01
+4.720563913472620166e-01 3.981648558562365103e-01 1.311281116044327733e-01
+4.830210005713382881e-01 4.023038157279973936e-01 1.344963783804615232e-01
+4.939986962481786592e-01 4.064316868089741797e-01 1.378665047316342263e-01
+5.050443453644228864e-01 4.105232839216421126e-01 1.412177516567701130e-01
+5.161305471961733504e-01 4.145923196985767945e-01 1.445638179668259637e-01
+5.272226932670311950e-01 4.186568461649191053e-01 1.479227047630213288e-01
+5.384231737920478489e-01 4.226667334740543680e-01 1.512491796667267130e-01
+5.496735303963581343e-01 4.266509012024514158e-01 1.545811460866533815e-01
+5.608924552760781168e-01 4.306494794221744082e-01 1.580220317035593569e-01
+5.721888701475891237e-01 4.346087953039819429e-01 1.614907462658664583e-01
+5.835602689975579738e-01 4.385299786869343297e-01 1.649946574397075372e-01
+5.949141655760096237e-01 4.424610896723609743e-01 1.686236738948057867e-01
+6.063474969101482204e-01 4.463528192152232399e-01 1.722929976151095499e-01
+6.178322186277155348e-01 4.502196887286237792e-01 1.760393057804460759e-01
+6.293072576484797231e-01 4.540947330149664452e-01 1.799322501799610063e-01
+6.408487929862468624e-01 4.579376406332680838e-01 1.839101076250921896e-01
+6.524478209436700427e-01 4.617530075872406381e-01 1.879952778619465859e-01
+6.640840089637001231e-01 4.655519164846439462e-01 1.922225103058495532e-01
+6.757077110120256469e-01 4.693624324344119469e-01 1.966573342842017347e-01
+6.873619660726970615e-01 4.731606777592323732e-01 2.012786215471898954e-01
+6.990381205121832808e-01 4.769509785672518265e-01 2.061259388500985001e-01
+7.107469254673900450e-01 4.807250920628522439e-01 2.112467599398395457e-01
+7.224230526312156453e-01 4.845218253861356961e-01 2.167123076670600113e-01
+7.340988344738968996e-01 4.883178461040553198e-01 2.226023859070605515e-01
+7.456126256093577043e-01 4.922084125716105762e-01 2.291293878090427394e-01
+7.569950884983198680e-01 4.961693298634363702e-01 2.364236914878575235e-01
+7.680178179592376253e-01 5.003309692977765399e-01 2.449057676522546911e-01
+7.783432998143535730e-01 5.048913767328344626e-01 2.551145881355684764e-01
+7.872937751334541101e-01 5.102708429127015277e-01 2.676604181065562749e-01
+7.941838547011116356e-01 5.169436808272552808e-01 2.821513140071189585e-01
+7.994756138083272123e-01 5.246737693689591531e-01 2.970255774031809182e-01
+8.039010002452274817e-01 5.330024415850749264e-01 3.115266985520254717e-01
+8.078274978677594254e-01 5.416811012734407127e-01 3.255924452137653469e-01
+8.115188822314253203e-01 5.505337325024400874e-01 3.392264225271887645e-01
+8.149565405173153643e-01 5.595497555166275561e-01 3.527260919316282384e-01
+8.184200486555966991e-01 5.685470713353225625e-01 3.661765482687758810e-01
+8.218871005380722350e-01 5.775395855002405376e-01 3.796232120570560142e-01
+8.253524104820136875e-01 5.865320478639367563e-01 3.930813348872184143e-01
+8.288195980598317414e-01 5.955244594650943579e-01 4.065541730450397684e-01
+8.322893500409468404e-01 6.045186250474157141e-01 4.200438297618293571e-01
+8.357658919205435133e-01 6.135146821751165103e-01 4.335463882212042819e-01
+8.392529397355924514e-01 6.225129167459599877e-01 4.470604854774085646e-01
+8.427490015153409342e-01 6.315159424794672960e-01 4.605928597504284627e-01
+8.462593242877498589e-01 6.405233492783437566e-01 4.741391831670908608e-01
+8.497829397434528698e-01 6.495374502823044738e-01 4.877048504982988697e-01
+8.533243184659659031e-01 6.585581699790050703e-01 5.012868094865198243e-01
+8.568819326669031566e-01 6.675878581525517275e-01 5.148924377083944348e-01
+8.604592156604728981e-01 6.766270650074718285e-01 5.285174957354723535e-01
+8.640624159744237920e-01 6.856750887735367783e-01 5.421555222813166930e-01
+8.676874794762717835e-01 6.947353397221285309e-01 5.558159820355237368e-01
+8.713433578641075483e-01 7.038060956465443940e-01 5.694881225731345253e-01
+8.750269237065777528e-01 7.128903502475765208e-01 5.831797789138876142e-01
+8.787417347404306023e-01 7.219884934452005520e-01 5.968884207063740455e-01
+8.824929186507559642e-01 7.311003788594004904e-01 6.106091378045375162e-01
+8.862780839217170303e-01 7.402286277522096558e-01 6.243484010896452885e-01
+8.901025319225768229e-01 7.493730430239593510e-01 6.381009856311857797e-01
+8.939696421167129259e-01 7.585341679611918853e-01 6.518645964033017437e-01
+8.978784332841047711e-01 7.677140679252760780e-01 6.656434485771917098e-01
+9.018326061682566674e-01 7.769131645138506181e-01 6.794347199822515782e-01
+9.058380869535479496e-01 7.861311730497033690e-01 6.932323184728660381e-01
+9.098936269941250155e-01 7.953702376174893729e-01 7.070408050591605598e-01
+9.140018319746877618e-01 8.046311927664194785e-01 7.208589990654702406e-01
+9.181667424043119530e-01 8.139144268565462470e-01 7.346836216449236234e-01
+9.223937440297114154e-01 8.232199407988282092e-01 7.485094577713424790e-01
+9.266329848317796936e-01 8.325649094757640034e-01 7.624119242822527953e-01
+9.309587852706298072e-01 8.419294436897262202e-01 7.762663931757451952e-01
+9.353308095703787295e-01 8.513275998621367968e-01 7.901346256764255616e-01
+9.397666205989465560e-01 8.607552896628867245e-01 8.039940207918337967e-01
+9.442852447524148207e-01 8.702076963082445715e-01 8.178194726640143353e-01
+9.488564272552421075e-01 8.796932993686320534e-01 8.316532922424306751e-01
+9.535132490174164088e-01 8.891984622715306541e-01 8.454417866111457736e-01
+9.582183040236339489e-01 8.987227701762496856e-01 8.592166709390754997e-01
+9.629681108746700469e-01 9.082408064338201026e-01 8.729337059863773174e-01
+9.677369708112718572e-01 9.177061780026050108e-01 8.865286101605559521e-01
+9.724470492478461958e-01 9.270421466879262828e-01 8.999251032877214618e-01
+9.769577532404692954e-01 9.361234679319003771e-01 9.130099659367507670e-01
+9.810936756020608440e-01 9.447503559760432879e-01 9.255607060964068378e-01
+9.846187877628681528e-01 9.526495821380999152e-01 9.372697834100743863e-01
+9.872037589208276787e-01 9.594994318553785595e-01 9.478188041909386685e-01
+9.885417842181484227e-01 9.649430355113016722e-01 9.568049207415391111e-01
+9.884013930268252812e-01 9.686440358418687557e-01 9.637998740972807399e-01
+9.884162623276403492e-01 9.700501042547021724e-01 9.646078752920302923e-01
+9.882481988456427446e-01 9.691949840717196674e-01 9.590849806168054714e-01
+9.862202098271878326e-01 9.664497051565109631e-01 9.513022380762837793e-01
+9.825317256976796587e-01 9.620307807128735123e-01 9.416222408221766038e-01
+9.774953228979595954e-01 9.562506189604750295e-01 9.303982168749544979e-01
+9.714512581163280425e-01 9.494527517929901572e-01 9.180386343083645206e-01
+9.647328782040082151e-01 9.419601909858620337e-01 9.048410781832560978e-01
+9.576029833882070408e-01 9.340364327380904497e-01 8.911071594609687452e-01
+9.502540208567341606e-01 9.258747025552572785e-01 8.770597493210310347e-01
+9.428203850658012364e-01 9.176036605916164657e-01 8.628094676385467121e-01
+9.353802079259059266e-01 9.093000877222664480e-01 8.484369289828109784e-01
+9.279731512595491560e-01 9.010054158372772237e-01 8.340022711999641736e-01
+9.206162430864484048e-01 8.927397568877493139e-01 8.195491149365338179e-01
+9.133281854005529388e-01 8.845128541542209843e-01 8.050384948242300664e-01
+9.061049708588290175e-01 8.763271129727117081e-01 7.905141123067558340e-01
+8.988722526026153847e-01 8.682095990978259126e-01 7.760244884018141498e-01
+8.913604989190128114e-01 8.602593575538733939e-01 7.616936251859220963e-01
+8.834947766491649812e-01 8.525076069101691356e-01 7.475141723430621665e-01
+8.751348356324997191e-01 8.450011895094009517e-01 7.335968964229397926e-01
+8.660362122016208586e-01 8.378139590610478304e-01 7.202229230673017346e-01
+8.560628191678395504e-01 8.309783491388803567e-01 7.076282794978067114e-01
+8.450850551605781913e-01 8.245041095837670753e-01 6.962540521527236237e-01
+8.331237773418240788e-01 8.183393744081108867e-01 6.865239180889655124e-01
+8.205576283471390786e-01 8.123351983566962087e-01 6.783182715666855600e-01
+8.077229876914296947e-01 8.063801435632871328e-01 6.713153485176399649e-01
+7.947461515019460521e-01 8.004373108778479740e-01 6.653252445665102099e-01
+7.818234645252460924e-01 7.944593749272963468e-01 6.599830880041622772e-01
+7.690043949000203716e-01 7.884424060393956379e-01 6.551042701424648618e-01
+7.562981288404810876e-01 7.823918885846237181e-01 6.505794347324633797e-01
+7.437166688251096724e-01 7.763107155814537030e-01 6.463185559404119873e-01
+7.312864875465606707e-01 7.701962491575811143e-01 6.422364303657139839e-01
+7.189850527082707332e-01 7.640604119000086181e-01 6.382908369799579207e-01
+7.068142314422918293e-01 7.579064471112740842e-01 6.344344908612202794e-01
+6.947742510783049275e-01 7.517375363827888402e-01 6.306282821287318985e-01
+6.828537141789142728e-01 7.455586837934410349e-01 6.268596706266046370e-01
+6.710011548564486228e-01 7.393836600422335481e-01 6.231736409952126632e-01
+6.592657914925743601e-01 7.332038660876558644e-01 6.194650744353706884e-01
+6.476362335539276316e-01 7.270240901258274713e-01 6.157213868460473805e-01
+6.360362802101585666e-01 7.208613432160450030e-01 6.120373156027114625e-01
+6.245080854916185142e-01 7.147082392942302187e-01 6.083234269572357356e-01
+6.130488547076046180e-01 7.085668274101213360e-01 6.045591744160895287e-01
+6.015892322420162142e-01 7.024496994714828357e-01 6.008489625961975777e-01
+5.901987677923722364e-01 6.963445147045469463e-01 5.970628836865409239e-01
+5.787942193155654058e-01 6.902683578483006510e-01 5.932973990580240331e-01
+5.673843957655613224e-01 6.842194608428608937e-01 5.895220675517639508e-01
+5.559759005656629283e-01 6.781954870319548689e-01 5.857224142025272418e-01
+5.445452293547278222e-01 6.721991418209628533e-01 5.819309981473995697e-01
+5.330284999192810291e-01 6.662471887845208274e-01 5.781518614893066399e-01
+5.216118831320554206e-01 6.602860177867492242e-01 5.743450969986969579e-01
+5.100461930662858467e-01 6.543801579393034862e-01 5.705892298512411642e-01
+4.985462196160774240e-01 6.484680127740434230e-01 5.668522387113605898e-01
+4.869212854485653330e-01 6.426004706277155254e-01 5.631503671835994540e-01
+4.753175948425168440e-01 6.367342039857054603e-01 5.594833076156262575e-01
+4.635884121260610002e-01 6.309044987522948178e-01 5.558810414566710545e-01
+4.517937357110975438e-01 6.250933232803836948e-01 5.523287210439038475e-01
+4.399781445380013811e-01 6.192864046496112662e-01 5.488272822016192487e-01
+4.280176465668665831e-01 6.135117804844451017e-01 5.453889520686707737e-01
+4.160613175390713292e-01 6.077287406576958873e-01 5.420126140975655149e-01
+4.039857150007630238e-01 6.019638930796089582e-01 5.387130326489297794e-01
+3.917475183228279478e-01 5.962226288699170595e-01 5.354998204993742794e-01
+3.795396260545044753e-01 5.904576990603345177e-01 5.323562706006824685e-01
+3.671980489650730761e-01 5.847026249394290387e-01 5.292995421656493393e-01
+3.547169039649492039e-01 5.789540227003182604e-01 5.263324098770649773e-01
+3.421991518101316077e-01 5.731858973997910889e-01 5.234530196411122382e-01
+3.296321613618491964e-01 5.673978264587494769e-01 5.206643628468334839e-01
+3.169539434232791497e-01 5.615982678332219757e-01 5.179739584214747561e-01
+3.041848831902358996e-01 5.557790841809171489e-01 5.153814622924314248e-01
+2.913580245785495904e-01 5.499302942311713460e-01 5.128866030358065764e-01
+2.786210115475045712e-01 5.440237902965463501e-01 5.104770287408624263e-01
+2.658767813620477316e-01 5.380746002424073859e-01 5.081635613728290313e-01
+2.531728049963842264e-01 5.320730905152252221e-01 5.059419345415738789e-01
+2.405801746352321802e-01 5.260084224989675095e-01 5.037958873725133513e-01
+2.281731742156575815e-01 5.198710287686101328e-01 5.017115180274238639e-01
+2.160357564123031038e-01 5.136521477693153370e-01 4.996732344467323395e-01
+2.042553268175122949e-01 5.073441845910725556e-01 4.976709295334373340e-01
+1.929455786157068808e-01 5.009402502860922368e-01 4.956743078037426087e-01
+1.822159137211172564e-01 4.944360671084672698e-01 4.936576912144489682e-01
+1.721720047662203268e-01 4.878296612331804449e-01 4.915973661753361701e-01
+1.629121950514905992e-01 4.811217814834132800e-01 4.894661845895681984e-01
+1.545167219577190942e-01 4.743156260955230796e-01 4.872413962325574111e-01
+1.470425142510033700e-01 4.674166983864977420e-01 4.849028953714263346e-01
+1.405113128544070999e-01 4.604338355815827399e-01 4.824271757570474661e-01
+1.349217530726786463e-01 4.533748092665628726e-01 4.798101955391982920e-01
+1.302797342394179658e-01 4.462455116423036938e-01 4.770426757084247904e-01
+1.265939811024292538e-01 4.390496902560914738e-01 4.741166274104288703e-01
+1.236843852121248255e-01 4.318074599363258548e-01 4.710274926158040665e-01
+1.214646610875383670e-01 4.245259430194671113e-01 4.677892044131184979e-01
+1.198403481002758841e-01 4.172122902240388842e-01 4.644123639304529871e-01
+1.184609210323855077e-01 4.098925950294425857e-01 4.609615952184937249e-01
+1.168754986210283897e-01 4.026022451761210874e-01 4.575160089880971337e-01
+1.151007877850314109e-01 3.953385852310392079e-01 4.540805121238136732e-01
+1.131413084296974680e-01 3.881005310447923073e-01 4.506558243985225309e-01
+1.110221391582094097e-01 3.808834919340156611e-01 4.472532258515609649e-01
+1.087511055351796929e-01 3.736854209969548424e-01 4.438760147968137115e-01
+1.063262941094024749e-01 3.665057054845847206e-01 4.405230161394063093e-01
+1.037537167610996236e-01 3.593424059991345287e-01 4.371963158215718681e-01
+1.010396012430455071e-01 3.521934333571229425e-01 4.338979957908608021e-01
+9.820785452879465804e-02 3.450535925989220432e-01 4.306390199340546787e-01
+9.524886735285809092e-02 3.379231538671472745e-01 4.274136452659025309e-01
+9.216708027427711336e-02 3.307999936437661659e-01 4.242225680363120865e-01
+8.898719812499519821e-02 3.236783223748895821e-01 4.210773055644454477e-01
+8.570498821294705860e-02 3.165572544150943024e-01 4.179737087144154706e-01
+8.232861945095013012e-02 3.094336626170069993e-01 4.149138402418848237e-01
+7.888091832597513009e-02 3.023016385852106969e-01 4.119079586942359095e-01
+7.535426196281005962e-02 2.951606915265346798e-01 4.089483103763945637e-01
+7.178216232425585486e-02 2.880027122692483954e-01 4.060506695454764170e-01
+6.815855459758968227e-02 2.808269749834076956e-01 4.032054679392391150e-01
+6.448898508226078019e-02 2.736310489100942100e-01 4.004060238485768752e-01
+6.082018328964860360e-02 2.664035583373736138e-01 3.976774815474886093e-01
+5.716124112921574379e-02 2.591406963233486849e-01 3.950170320465338780e-01
+5.351466965820251415e-02 2.518414268825251989e-01 3.924068662312853450e-01
+4.993186694626653571e-02 2.444935102031051688e-01 3.898697442701583027e-01
+4.643877317377426844e-02 2.370912873691644052e-01 3.873999194228605614e-01
+4.308214165698193848e-02 2.296247589871482364e-01 3.850043813960570827e-01
+3.988193032745831340e-02 2.220895846072232227e-01 3.826648500695101207e-01
+3.696588053809187618e-02 2.144711117753294594e-01 3.803951582141073540e-01
+3.503963119120004355e-02 2.067382236169432175e-01 3.779948138188178319e-01
+3.478421889488789165e-02 1.988679039642712310e-01 3.751470684509792819e-01
+3.605446405610013977e-02 1.908764917041337605e-01 3.717394054831296146e-01
+3.860378491452313293e-02 1.827911805345073526e-01 3.676697392369102646e-01
+4.204158194669544574e-02 1.746484839257387567e-01 3.628639802125444569e-01
+4.580769332477269834e-02 1.664868235304900745e-01 3.572935027519454909e-01
+4.953046775643197425e-02 1.583391239953714225e-01 3.509783278645146609e-01
+5.294794616753940170e-02 1.502287847236943308e-01 3.439780107867805858e-01
+5.589746873554810730e-02 1.421689980048106428e-01 3.363784527482869824e-01
+5.832364005801801005e-02 1.341588757852459068e-01 3.282715328574966618e-01
+6.018929987904993867e-02 1.261942031427702726e-01 3.197538950865533303e-01
+6.152266558088163168e-02 1.182670459661474271e-01 3.108793933905304452e-01];
+      
+   otherwise 
+      error('Unrecognized colormap name.') 
+     
+
+end
+
+
+
+function varargout = colorspace(Conversion,varargin)
+%COLORSPACE  Transform a color image between color representations.
+%   B = COLORSPACE(S,A) transforms the color representation of image A
+%   where S is a string specifying the conversion.  The input array A 
+%   should be a real full double array of size Mx3 or MxNx3.  The output B 
+%   is the same size as A.
+%
+%   S tells the source and destination color spaces, S = 'dest<-src', or 
+%   alternatively, S = 'src->dest'.  Supported color spaces are
+%
+%     'RGB'              sRGB IEC 61966-2-1
+%     'YCbCr'            Luma + Chroma ("digitized" version of Y'PbPr)
+%     'JPEG-YCbCr'       Luma + Chroma space used in JFIF JPEG
+%     'YDbDr'            SECAM Y'DbDr Luma + Chroma
+%     'YPbPr'            Luma (ITU-R BT.601) + Chroma 
+%     'YUV'              NTSC PAL Y'UV Luma + Chroma
+%     'YIQ'              NTSC Y'IQ Luma + Chroma
+%     'HSV' or 'HSB'     Hue Saturation Value/Brightness
+%     'HSL' or 'HLS'     Hue Saturation Luminance
+%     'HSI'              Hue Saturation Intensity
+%     'XYZ'              CIE 1931 XYZ
+%     'Lab'              CIE 1976 L*a*b* (CIELAB)
+%     'Luv'              CIE L*u*v* (CIELUV)
+%     'LCH'              CIE L*C*H* (CIELCH)
+%     'CAT02 LMS'        CIE CAT02 LMS
+%
+%  All conversions assume 2 degree observer and D65 illuminant.
+%
+%  Color space names are case insensitive and spaces are ignored.  When 
+%  sRGB is the source or destination, it can be omitted. For example 
+%  'yuv<-' is short for 'yuv<-rgb'.
+%
+%  For sRGB, the values should be scaled between 0 and 1.  Beware that 
+%  transformations generally do not constrain colors to be "in gamut."  
+%  Particularly, transforming from another space to sRGB may obtain 
+%  R'G'B' values outside of the [0,1] range.  So the result should be 
+%  clamped to [0,1] before displaying:
+%     image(min(max(B,0),1));  % Clamp B to [0,1] and display
+%
+%  sRGB (Red Green Blue) is the (ITU-R BT.709 gamma-corrected) standard
+%  red-green-blue representation of colors used in digital imaging.  The 
+%  components should be scaled between 0 and 1.  The space can be 
+%  visualized geometrically as a cube.
+%  
+%  Y'PbPr, Y'CbCr, Y'DbDr, Y'UV, and Y'IQ are related to sRGB by linear
+%  transformations.  These spaces separate a color into a grayscale
+%  luminance component Y and two chroma components.  The valid ranges of
+%  the components depends on the space.
+%
+%  HSV (Hue Saturation Value) is related to sRGB by
+%     H = hexagonal hue angle   (0 <= H < 360),
+%     S = C/V                   (0 <= S <= 1),
+%     V = max(R',G',B')         (0 <= V <= 1),
+%  where C = max(R',G',B') - min(R',G',B').  The hue angle H is computed on
+%  a hexagon.  The space is geometrically a hexagonal cone.
+%
+%  HSL (Hue Saturation Lightness) is related to sRGB by
+%     H = hexagonal hue angle                (0 <= H < 360),
+%     S = C/(1 - |2L-1|)                     (0 <= S <= 1),
+%     L = (max(R',G',B') + min(R',G',B'))/2  (0 <= L <= 1),
+%  where H and C are the same as in HSV.  Geometrically, the space is a
+%  double hexagonal cone.
+%
+%  HSI (Hue Saturation Intensity) is related to sRGB by
+%     H = polar hue angle        (0 <= H < 360),
+%     S = 1 - min(R',G',B')/I    (0 <= S <= 1),
+%     I = (R'+G'+B')/3           (0 <= I <= 1).
+%  Unlike HSV and HSL, the hue angle H is computed on a circle rather than
+%  a hexagon. 
+%
+%  CIE XYZ is related to sRGB by inverse gamma correction followed by a
+%  linear transform.  Other CIE color spaces are defined relative to XYZ.
+%
+%  CIE L*a*b*, L*u*v*, and L*C*H* are nonlinear functions of XYZ.  The L*
+%  component is designed to match closely with human perception of
+%  lightness.  The other two components describe the chroma.
+%
+%  CIE CAT02 LMS is the linear transformation of XYZ using the MCAT02 
+%  chromatic adaptation matrix.  The space is designed to model the 
+%  response of the three types of cones in the human eye, where L, M, S,
+%  correspond respectively to red ("long"), green ("medium"), and blue
+%  ("short").
+
+% Pascal Getreuer 2005-2010
+
+
+%%% Input parsing %%%
+if nargin < 2, error('Not enough input arguments.'); end
+[SrcSpace,DestSpace] = parse(Conversion);
+
+if nargin == 2
+   Image = varargin{1};
+elseif nargin >= 3
+   Image = cat(3,varargin{:});
+else
+   error('Invalid number of input arguments.');
+end
+
+FlipDims = (size(Image,3) == 1);
+
+if FlipDims, Image = permute(Image,[1,3,2]); end
+if ~isa(Image,'double'), Image = double(Image)/255; end
+if size(Image,3) ~= 3, error('Invalid input size.'); end
+
+SrcT = gettransform(SrcSpace);
+DestT = gettransform(DestSpace);
+
+if ~ischar(SrcT) && ~ischar(DestT)
+   % Both source and destination transforms are affine, so they
+   % can be composed into one affine operation
+   T = [DestT(:,1:3)*SrcT(:,1:3),DestT(:,1:3)*SrcT(:,4)+DestT(:,4)];      
+   Temp = zeros(size(Image));
+   Temp(:,:,1) = T(1)*Image(:,:,1) + T(4)*Image(:,:,2) + T(7)*Image(:,:,3) + T(10);
+   Temp(:,:,2) = T(2)*Image(:,:,1) + T(5)*Image(:,:,2) + T(8)*Image(:,:,3) + T(11);
+   Temp(:,:,3) = T(3)*Image(:,:,1) + T(6)*Image(:,:,2) + T(9)*Image(:,:,3) + T(12);
+   Image = Temp;
+elseif ~ischar(DestT)
+   Image = rgb(Image,SrcSpace);
+   Temp = zeros(size(Image));
+   Temp(:,:,1) = DestT(1)*Image(:,:,1) + DestT(4)*Image(:,:,2) + DestT(7)*Image(:,:,3) + DestT(10);
+   Temp(:,:,2) = DestT(2)*Image(:,:,1) + DestT(5)*Image(:,:,2) + DestT(8)*Image(:,:,3) + DestT(11);
+   Temp(:,:,3) = DestT(3)*Image(:,:,1) + DestT(6)*Image(:,:,2) + DestT(9)*Image(:,:,3) + DestT(12);
+   Image = Temp;
+else
+   Image = feval(DestT,Image,SrcSpace);
+end
+
+%%% Output format %%%
+if nargout > 1
+   varargout = {Image(:,:,1),Image(:,:,2),Image(:,:,3)};
+else
+   if FlipDims, Image = permute(Image,[1,3,2]); end
+   varargout = {Image};
+end
+
+return;
+
+
+function [SrcSpace,DestSpace] = parse(Str)
+% Parse conversion argument
+
+if ischar(Str)
+   Str = lower(strrep(strrep(Str,'-',''),'=',''));
+   k = find(Str == '>');
+   
+   if length(k) == 1         % Interpret the form 'src->dest'
+      SrcSpace = Str(1:k-1);
+      DestSpace = Str(k+1:end);
+   else
+      k = find(Str == '<');
+      
+      if length(k) == 1      % Interpret the form 'dest<-src'
+         DestSpace = Str(1:k-1);
+         SrcSpace = Str(k+1:end);
+      else
+         error(['Invalid conversion, ''',Str,'''.']);
+      end   
+   end
+   
+   SrcSpace = alias(SrcSpace);
+   DestSpace = alias(DestSpace);
+else
+   SrcSpace = 1;             % No source pre-transform
+   DestSpace = Conversion;
+   if any(size(Conversion) ~= 3), error('Transformation matrix must be 3x3.'); end
+end
+return;
+
+
+function Space = alias(Space)
+Space = strrep(strrep(Space,'cie',''),' ','');
+
+if isempty(Space)
+   Space = 'rgb';
+end
+
+switch Space
+case {'ycbcr','ycc'}
+   Space = 'ycbcr';
+case {'hsv','hsb'}
+   Space = 'hsv';
+case {'hsl','hsi','hls'}
+   Space = 'hsl';
+case {'rgb','yuv','yiq','ydbdr','ycbcr','jpegycbcr','xyz','lab','luv','lch'}
+   return;
+end
+return;
+
+
+function T = gettransform(Space)
+% Get a colorspace transform: either a matrix describing an affine transform,
+% or a string referring to a conversion subroutine
+switch Space
+case 'ypbpr'
+   T = [0.299,0.587,0.114,0;-0.1687367,-0.331264,0.5,0;0.5,-0.418688,-0.081312,0];
+case 'yuv'
+   % sRGB to NTSC/PAL YUV
+   % Wikipedia: http://en.wikipedia.org/wiki/YUV
+   T = [0.299,0.587,0.114,0;-0.147,-0.289,0.436,0;0.615,-0.515,-0.100,0];
+case 'ydbdr'
+   % sRGB to SECAM YDbDr
+   % Wikipedia: http://en.wikipedia.org/wiki/YDbDr
+   T = [0.299,0.587,0.114,0;-0.450,-0.883,1.333,0;-1.333,1.116,0.217,0];
+case 'yiq'
+   % sRGB in [0,1] to NTSC YIQ in [0,1];[-0.595716,0.595716];[-0.522591,0.522591];
+   % Wikipedia: http://en.wikipedia.org/wiki/YIQ
+   T = [0.299,0.587,0.114,0;0.595716,-0.274453,-0.321263,0;0.211456,-0.522591,0.311135,0];
+case 'ycbcr'
+   % sRGB (range [0,1]) to ITU-R BRT.601 (CCIR 601) Y'CbCr
+   % Wikipedia: http://en.wikipedia.org/wiki/YCbCr
+   % Poynton, Equation 3, scaling of R'G'B to Y'PbPr conversion
+   T = [65.481,128.553,24.966,16;-37.797,-74.203,112.0,128;112.0,-93.786,-18.214,128];
+case 'jpegycbcr'
+   % Wikipedia: http://en.wikipedia.org/wiki/YCbCr
+   T = [0.299,0.587,0.114,0;-0.168736,-0.331264,0.5,0.5;0.5,-0.418688,-0.081312,0.5]*255;
+case {'rgb','xyz','hsv','hsl','lab','luv','lch','cat02lms'}
+   T = Space;
+otherwise
+   error(['Unknown color space, ''',Space,'''.']);
+end
+return;
+
+
+function Image = rgb(Image,SrcSpace)
+% Convert to sRGB from 'SrcSpace'
+switch SrcSpace
+case 'rgb'
+   return;
+case 'hsv'
+   % Convert HSV to sRGB
+   Image = huetorgb((1 - Image(:,:,2)).*Image(:,:,3),Image(:,:,3),Image(:,:,1));
+case 'hsl'
+   % Convert HSL to sRGB
+   L = Image(:,:,3);
+   Delta = Image(:,:,2).*min(L,1-L);
+   Image = huetorgb(L-Delta,L+Delta,Image(:,:,1));
+case {'xyz','lab','luv','lch','cat02lms'}
+   % Convert to CIE XYZ
+   Image = xyz(Image,SrcSpace);
+   % Convert XYZ to RGB
+   T = [3.2406, -1.5372, -0.4986; -0.9689, 1.8758, 0.0415; 0.0557, -0.2040, 1.057];
+   R = T(1)*Image(:,:,1) + T(4)*Image(:,:,2) + T(7)*Image(:,:,3);  % R
+   G = T(2)*Image(:,:,1) + T(5)*Image(:,:,2) + T(8)*Image(:,:,3);  % G
+   B = T(3)*Image(:,:,1) + T(6)*Image(:,:,2) + T(9)*Image(:,:,3);  % B
+   % Desaturate and rescale to constrain resulting RGB values to [0,1]   
+   AddWhite = -min(min(min(R,G),B),0);
+   R = R + AddWhite;
+   G = G + AddWhite;
+   B = B + AddWhite;
+   % Apply gamma correction to convert linear RGB to sRGB
+   Image(:,:,1) = gammacorrection(R);  % R'
+   Image(:,:,2) = gammacorrection(G);  % G'
+   Image(:,:,3) = gammacorrection(B);  % B'
+otherwise  % Conversion is through an affine transform
+   T = gettransform(SrcSpace);
+   temp = inv(T(:,1:3));
+   T = [temp,-temp*T(:,4)];
+   R = T(1)*Image(:,:,1) + T(4)*Image(:,:,2) + T(7)*Image(:,:,3) + T(10);
+   G = T(2)*Image(:,:,1) + T(5)*Image(:,:,2) + T(8)*Image(:,:,3) + T(11);
+   B = T(3)*Image(:,:,1) + T(6)*Image(:,:,2) + T(9)*Image(:,:,3) + T(12);
+   Image(:,:,1) = R;
+   Image(:,:,2) = G;
+   Image(:,:,3) = B;
+end
+
+% Clip to [0,1]
+Image = min(max(Image,0),1);
+return;
+
+
+function Image = xyz(Image,SrcSpace)
+% Convert to CIE XYZ from 'SrcSpace'
+WhitePoint = [0.950456,1,1.088754];  
+
+switch SrcSpace
+case 'xyz'
+   return;
+case 'luv'
+   % Convert CIE L*uv to XYZ
+   WhitePointU = (4*WhitePoint(1))./(WhitePoint(1) + 15*WhitePoint(2) + 3*WhitePoint(3));
+   WhitePointV = (9*WhitePoint(2))./(WhitePoint(1) + 15*WhitePoint(2) + 3*WhitePoint(3));
+   L = Image(:,:,1);
+   Y = (L + 16)/116;
+   Y = invf(Y)*WhitePoint(2);
+   U = Image(:,:,2)./(13*L + 1e-6*(L==0)) + WhitePointU;
+   V = Image(:,:,3)./(13*L + 1e-6*(L==0)) + WhitePointV;
+   Image(:,:,1) = -(9*Y.*U)./((U-4).*V - U.*V);                  % X
+   Image(:,:,2) = Y;                                             % Y
+   Image(:,:,3) = (9*Y - (15*V.*Y) - (V.*Image(:,:,1)))./(3*V);  % Z
+case {'lab','lch'}
+   Image = lab(Image,SrcSpace);
+   % Convert CIE L*ab to XYZ
+   fY = (Image(:,:,1) + 16)/116;
+   fX = fY + Image(:,:,2)/500;
+   fZ = fY - Image(:,:,3)/200;
+   Image(:,:,1) = WhitePoint(1)*invf(fX);  % X
+   Image(:,:,2) = WhitePoint(2)*invf(fY);  % Y
+   Image(:,:,3) = WhitePoint(3)*invf(fZ);  % Z
+case 'cat02lms'
+    % Convert CAT02 LMS to XYZ
+   T = inv([0.7328, 0.4296, -0.1624;-0.7036, 1.6975, 0.0061; 0.0030, 0.0136, 0.9834]);
+   L = Image(:,:,1);
+   M = Image(:,:,2);
+   S = Image(:,:,3);
+   Image(:,:,1) = T(1)*L + T(4)*M + T(7)*S;  % X 
+   Image(:,:,2) = T(2)*L + T(5)*M + T(8)*S;  % Y
+   Image(:,:,3) = T(3)*L + T(6)*M + T(9)*S;  % Z
+otherwise   % Convert from some gamma-corrected space
+   % Convert to sRGB
+   Image = rgb(Image,SrcSpace);
+   % Undo gamma correction
+   R = invgammacorrection(Image(:,:,1));
+   G = invgammacorrection(Image(:,:,2));
+   B = invgammacorrection(Image(:,:,3));
+   % Convert RGB to XYZ
+   T = inv([3.2406, -1.5372, -0.4986; -0.9689, 1.8758, 0.0415; 0.0557, -0.2040, 1.057]);
+   Image(:,:,1) = T(1)*R + T(4)*G + T(7)*B;  % X 
+   Image(:,:,2) = T(2)*R + T(5)*G + T(8)*B;  % Y
+   Image(:,:,3) = T(3)*R + T(6)*G + T(9)*B;  % Z
+end
+return;
+
+
+function Image = hsv(Image,SrcSpace)
+% Convert to HSV
+Image = rgb(Image,SrcSpace);
+V = max(Image,[],3);
+S = (V - min(Image,[],3))./(V + (V == 0));
+Image(:,:,1) = rgbtohue(Image);
+Image(:,:,2) = S;
+Image(:,:,3) = V;
+return;
+
+
+function Image = hsl(Image,SrcSpace)
+% Convert to HSL 
+switch SrcSpace
+case 'hsv'
+   % Convert HSV to HSL   
+   MaxVal = Image(:,:,3);
+   MinVal = (1 - Image(:,:,2)).*MaxVal;
+   L = 0.5*(MaxVal + MinVal);
+   temp = min(L,1-L);
+   Image(:,:,2) = 0.5*(MaxVal - MinVal)./(temp + (temp == 0));
+   Image(:,:,3) = L;
+otherwise
+   Image = rgb(Image,SrcSpace);  % Convert to sRGB
+   % Convert sRGB to HSL
+   MinVal = min(Image,[],3);
+   MaxVal = max(Image,[],3);
+   L = 0.5*(MaxVal + MinVal);
+   temp = min(L,1-L);
+   S = 0.5*(MaxVal - MinVal)./(temp + (temp == 0));
+   Image(:,:,1) = rgbtohue(Image);
+   Image(:,:,2) = S;
+   Image(:,:,3) = L;
+end
+return;
+
+
+function Image = lab(Image,SrcSpace)
+% Convert to CIE L*a*b* (CIELAB)
+WhitePoint = [0.950456,1,1.088754];
+
+switch SrcSpace
+case 'lab'
+   return;
+case 'lch'
+   % Convert CIE L*CH to CIE L*ab
+   C = Image(:,:,2);
+   Image(:,:,2) = cos(Image(:,:,3)*pi/180).*C;  % a*
+   Image(:,:,3) = sin(Image(:,:,3)*pi/180).*C;  % b*
+otherwise
+   Image = xyz(Image,SrcSpace);  % Convert to XYZ
+   % Convert XYZ to CIE L*a*b*
+   X = Image(:,:,1)/WhitePoint(1);
+   Y = Image(:,:,2)/WhitePoint(2);
+   Z = Image(:,:,3)/WhitePoint(3);
+   fX = f(X);
+   fY = f(Y);
+   fZ = f(Z);
+   Image(:,:,1) = 116*fY - 16;    % L*
+   Image(:,:,2) = 500*(fX - fY);  % a*
+   Image(:,:,3) = 200*(fY - fZ);  % b*
+end
+return;
+
+
+function Image = luv(Image,SrcSpace)
+% Convert to CIE L*u*v* (CIELUV)
+WhitePoint = [0.950456,1,1.088754];
+WhitePointU = (4*WhitePoint(1))./(WhitePoint(1) + 15*WhitePoint(2) + 3*WhitePoint(3));
+WhitePointV = (9*WhitePoint(2))./(WhitePoint(1) + 15*WhitePoint(2) + 3*WhitePoint(3));
+
+Image = xyz(Image,SrcSpace); % Convert to XYZ
+Denom = Image(:,:,1) + 15*Image(:,:,2) + 3*Image(:,:,3);
+U = (4*Image(:,:,1))./(Denom + (Denom == 0));
+V = (9*Image(:,:,2))./(Denom + (Denom == 0));
+Y = Image(:,:,2)/WhitePoint(2);
+L = 116*f(Y) - 16;
+Image(:,:,1) = L;                        % L*
+Image(:,:,2) = 13*L.*(U - WhitePointU);  % u*
+Image(:,:,3) = 13*L.*(V - WhitePointV);  % v*
+return;  
+
+
+function Image = lch(Image,SrcSpace)
+% Convert to CIE L*ch
+Image = lab(Image,SrcSpace);  % Convert to CIE L*ab
+H = atan2(Image(:,:,3),Image(:,:,2));
+H = H*180/pi + 360*(H < 0);
+Image(:,:,2) = sqrt(Image(:,:,2).^2 + Image(:,:,3).^2);  % C
+Image(:,:,3) = H;                                        % H
+return;
+
+
+function Image = cat02lms(Image,SrcSpace)
+% Convert to CAT02 LMS
+Image = xyz(Image,SrcSpace);
+T = [0.7328, 0.4296, -0.1624;-0.7036, 1.6975, 0.0061; 0.0030, 0.0136, 0.9834];
+X = Image(:,:,1);
+Y = Image(:,:,2);
+Z = Image(:,:,3);
+Image(:,:,1) = T(1)*X + T(4)*Y + T(7)*Z;  % L
+Image(:,:,2) = T(2)*X + T(5)*Y + T(8)*Z;  % M
+Image(:,:,3) = T(3)*X + T(6)*Y + T(9)*Z;  % S
+return;
+
+
+function Image = huetorgb(m0,m2,H)
+% Convert HSV or HSL hue to RGB
+N = size(H);
+H = min(max(H(:),0),360)/60;
+m0 = m0(:);
+m2 = m2(:);
+F = H - round(H/2)*2;
+M = [m0, m0 + (m2-m0).*abs(F), m2];
+Num = length(m0);
+j = [2 1 0;1 2 0;0 2 1;0 1 2;1 0 2;2 0 1;2 1 0]*Num;
+k = floor(H) + 1;
+Image = reshape([M(j(k,1)+(1:Num).'),M(j(k,2)+(1:Num).'),M(j(k,3)+(1:Num).')],[N,3]);
+return;
+
+
+function H = rgbtohue(Image)
+% Convert RGB to HSV or HSL hue
+[M,i] = sort(Image,3);
+i = i(:,:,3);
+Delta = M(:,:,3) - M(:,:,1);
+Delta = Delta + (Delta == 0);
+R = Image(:,:,1);
+G = Image(:,:,2);
+B = Image(:,:,3);
+H = zeros(size(R));
+k = (i == 1);
+H(k) = (G(k) - B(k))./Delta(k);
+k = (i == 2);
+H(k) = 2 + (B(k) - R(k))./Delta(k);
+k = (i == 3);
+H(k) = 4 + (R(k) - G(k))./Delta(k);
+H = 60*H + 360*(H < 0);
+H(Delta == 0) = nan;
+return;
+
+
+function Rp = gammacorrection(R)
+Rp = zeros(size(R));
+i = (R <= 0.0031306684425005883);
+Rp(i) = 12.92*R(i);
+Rp(~i) = real(1.055*R(~i).^0.416666666666666667 - 0.055);
+return;
+
+
+function R = invgammacorrection(Rp)
+R = zeros(size(Rp));
+i = (Rp <= 0.0404482362771076);
+R(i) = Rp(i)/12.92;
+R(~i) = real(((Rp(~i) + 0.055)/1.055).^2.4);
+return;
+
+
+function fY = f(Y)
+fY = real(Y.^(1/3));
+i = (Y < 0.008856);
+fY(i) = Y(i)*(841/108) + (4/29);
+return;
+
+
+function Y = invf(fY)
+Y = fY.^3;
+i = (Y < 0.008856);
+Y(i) = (fY(i) - 4/29)*(108/841);
+return;
Index: /issm/trunk/src/m/plot/colormaps/demmap.py
===================================================================
--- /issm/trunk/src/m/plot/colormaps/demmap.py	(revision 26743)
+++ /issm/trunk/src/m/plot/colormaps/demmap.py	(revision 26744)
@@ -64,6 +64,4 @@
         cmx = nland * interval
 
-    clim = [cmn, cmx]
-
     if strcmpi(colorscheme, 'dem'):
         # concatenate and transpose to match matplotlib's colormap format
Index: /issm/trunk/src/m/plot/colormaps/turbo.m
===================================================================
--- /issm/trunk/src/m/plot/colormaps/turbo.m	(revision 26744)
+++ /issm/trunk/src/m/plot/colormaps/turbo.m	(revision 26744)
@@ -0,0 +1,279 @@
+function map = turbo(m)
+%TURBO   Turbo colormap.
+%   TURBO(M) returns an M-by-3 matrix containing the turbo colormap, a
+%   variant of the jet colormap that is more perceptually uniform.
+%
+%   See also JET, COLORMAP.
+%	 
+%		Daniel Fortunato (2021). turbo (https://www.mathworks.com/matlabcentral/fileexchange/74662-turbo), MATLAB Central File Exchange. Retrieved August 4, 2021. 
+%
+%	more info: https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html
+%
+if nargin < 1
+   f = get(groot,'CurrentFigure');
+   if isempty(f)
+      m = size(get(groot,'DefaultFigureColormap'),1);
+   else
+      m = size(f.Colormap,1);
+   end
+end
+values = [
+     0.18995, 0.07176, 0.23217;
+     0.19483, 0.08339, 0.26149;
+     0.19956, 0.09498, 0.29024;
+     0.20415, 0.10652, 0.31844;
+     0.20860, 0.11802, 0.34607;
+     0.21291, 0.12947, 0.37314;
+     0.21708, 0.14087, 0.39964;
+     0.22111, 0.15223, 0.42558;
+     0.22500, 0.16354, 0.45096;
+     0.22875, 0.17481, 0.47578;
+     0.23236, 0.18603, 0.50004;
+     0.23582, 0.19720, 0.52373;
+     0.23915, 0.20833, 0.54686;
+     0.24234, 0.21941, 0.56942;
+     0.24539, 0.23044, 0.59142;
+     0.24830, 0.24143, 0.61286;
+     0.25107, 0.25237, 0.63374;
+     0.25369, 0.26327, 0.65406;
+     0.25618, 0.27412, 0.67381;
+     0.25853, 0.28492, 0.69300;
+     0.26074, 0.29568, 0.71162;
+     0.26280, 0.30639, 0.72968;
+     0.26473, 0.31706, 0.74718;
+     0.26652, 0.32768, 0.76412;
+     0.26816, 0.33825, 0.78050;
+     0.26967, 0.34878, 0.79631;
+     0.27103, 0.35926, 0.81156;
+     0.27226, 0.36970, 0.82624;
+     0.27334, 0.38008, 0.84037;
+     0.27429, 0.39043, 0.85393;
+     0.27509, 0.40072, 0.86692;
+     0.27576, 0.41097, 0.87936;
+     0.27628, 0.42118, 0.89123;
+     0.27667, 0.43134, 0.90254;
+     0.27691, 0.44145, 0.91328;
+     0.27701, 0.45152, 0.92347;
+     0.27698, 0.46153, 0.93309;
+     0.27680, 0.47151, 0.94214;
+     0.27648, 0.48144, 0.95064;
+     0.27603, 0.49132, 0.95857;
+     0.27543, 0.50115, 0.96594;
+     0.27469, 0.51094, 0.97275;
+     0.27381, 0.52069, 0.97899;
+     0.27273, 0.53040, 0.98461;
+     0.27106, 0.54015, 0.98930;
+     0.26878, 0.54995, 0.99303;
+     0.26592, 0.55979, 0.99583;
+     0.26252, 0.56967, 0.99773;
+     0.25862, 0.57958, 0.99876;
+     0.25425, 0.58950, 0.99896;
+     0.24946, 0.59943, 0.99835;
+     0.24427, 0.60937, 0.99697;
+     0.23874, 0.61931, 0.99485;
+     0.23288, 0.62923, 0.99202;
+     0.22676, 0.63913, 0.98851;
+     0.22039, 0.64901, 0.98436;
+     0.21382, 0.65886, 0.97959;
+     0.20708, 0.66866, 0.97423;
+     0.20021, 0.67842, 0.96833;
+     0.19326, 0.68812, 0.96190;
+     0.18625, 0.69775, 0.95498;
+     0.17923, 0.70732, 0.94761;
+     0.17223, 0.71680, 0.93981;
+     0.16529, 0.72620, 0.93161;
+     0.15844, 0.73551, 0.92305;
+     0.15173, 0.74472, 0.91416;
+     0.14519, 0.75381, 0.90496;
+     0.13886, 0.76279, 0.89550;
+     0.13278, 0.77165, 0.88580;
+     0.12698, 0.78037, 0.87590;
+     0.12151, 0.78896, 0.86581;
+     0.11639, 0.79740, 0.85559;
+     0.11167, 0.80569, 0.84525;
+     0.10738, 0.81381, 0.83484;
+     0.10357, 0.82177, 0.82437;
+     0.10026, 0.82955, 0.81389;
+     0.09750, 0.83714, 0.80342;
+     0.09532, 0.84455, 0.79299;
+     0.09377, 0.85175, 0.78264;
+     0.09287, 0.85875, 0.77240;
+     0.09267, 0.86554, 0.76230;
+     0.09320, 0.87211, 0.75237;
+     0.09451, 0.87844, 0.74265;
+     0.09662, 0.88454, 0.73316;
+     0.09958, 0.89040, 0.72393;
+     0.10342, 0.89600, 0.71500;
+     0.10815, 0.90142, 0.70599;
+     0.11374, 0.90673, 0.69651;
+     0.12014, 0.91193, 0.68660;
+     0.12733, 0.91701, 0.67627;
+     0.13526, 0.92197, 0.66556;
+     0.14391, 0.92680, 0.65448;
+     0.15323, 0.93151, 0.64308;
+     0.16319, 0.93609, 0.63137;
+     0.17377, 0.94053, 0.61938;
+     0.18491, 0.94484, 0.60713;
+     0.19659, 0.94901, 0.59466;
+     0.20877, 0.95304, 0.58199;
+     0.22142, 0.95692, 0.56914;
+     0.23449, 0.96065, 0.55614;
+     0.24797, 0.96423, 0.54303;
+     0.26180, 0.96765, 0.52981;
+     0.27597, 0.97092, 0.51653;
+     0.29042, 0.97403, 0.50321;
+     0.30513, 0.97697, 0.48987;
+     0.32006, 0.97974, 0.47654;
+     0.33517, 0.98234, 0.46325;
+     0.35043, 0.98477, 0.45002;
+     0.36581, 0.98702, 0.43688;
+     0.38127, 0.98909, 0.42386;
+     0.39678, 0.99098, 0.41098;
+     0.41229, 0.99268, 0.39826;
+     0.42778, 0.99419, 0.38575;
+     0.44321, 0.99551, 0.37345;
+     0.45854, 0.99663, 0.36140;
+     0.47375, 0.99755, 0.34963;
+     0.48879, 0.99828, 0.33816;
+     0.50362, 0.99879, 0.32701;
+     0.51822, 0.99910, 0.31622;
+     0.53255, 0.99919, 0.30581;
+     0.54658, 0.99907, 0.29581;
+     0.56026, 0.99873, 0.28623;
+     0.57357, 0.99817, 0.27712;
+     0.58646, 0.99739, 0.26849;
+     0.59891, 0.99638, 0.26038;
+     0.61088, 0.99514, 0.25280;
+     0.62233, 0.99366, 0.24579;
+     0.63323, 0.99195, 0.23937;
+     0.64362, 0.98999, 0.23356;
+     0.65394, 0.98775, 0.22835;
+     0.66428, 0.98524, 0.22370;
+     0.67462, 0.98246, 0.21960;
+     0.68494, 0.97941, 0.21602;
+     0.69525, 0.97610, 0.21294;
+     0.70553, 0.97255, 0.21032;
+     0.71577, 0.96875, 0.20815;
+     0.72596, 0.96470, 0.20640;
+     0.73610, 0.96043, 0.20504;
+     0.74617, 0.95593, 0.20406;
+     0.75617, 0.95121, 0.20343;
+     0.76608, 0.94627, 0.20311;
+     0.77591, 0.94113, 0.20310;
+     0.78563, 0.93579, 0.20336;
+     0.79524, 0.93025, 0.20386;
+     0.80473, 0.92452, 0.20459;
+     0.81410, 0.91861, 0.20552;
+     0.82333, 0.91253, 0.20663;
+     0.83241, 0.90627, 0.20788;
+     0.84133, 0.89986, 0.20926;
+     0.85010, 0.89328, 0.21074;
+     0.85868, 0.88655, 0.21230;
+     0.86709, 0.87968, 0.21391;
+     0.87530, 0.87267, 0.21555;
+     0.88331, 0.86553, 0.21719;
+     0.89112, 0.85826, 0.21880;
+     0.89870, 0.85087, 0.22038;
+     0.90605, 0.84337, 0.22188;
+     0.91317, 0.83576, 0.22328;
+     0.92004, 0.82806, 0.22456;
+     0.92666, 0.82025, 0.22570;
+     0.93301, 0.81236, 0.22667;
+     0.93909, 0.80439, 0.22744;
+     0.94489, 0.79634, 0.22800;
+     0.95039, 0.78823, 0.22831;
+     0.95560, 0.78005, 0.22836;
+     0.96049, 0.77181, 0.22811;
+     0.96507, 0.76352, 0.22754;
+     0.96931, 0.75519, 0.22663;
+     0.97323, 0.74682, 0.22536;
+     0.97679, 0.73842, 0.22369;
+     0.98000, 0.73000, 0.22161;
+     0.98289, 0.72140, 0.21918;
+     0.98549, 0.71250, 0.21650;
+     0.98781, 0.70330, 0.21358;
+     0.98986, 0.69382, 0.21043;
+     0.99163, 0.68408, 0.20706;
+     0.99314, 0.67408, 0.20348;
+     0.99438, 0.66386, 0.19971;
+     0.99535, 0.65341, 0.19577;
+     0.99607, 0.64277, 0.19165;
+     0.99654, 0.63193, 0.18738;
+     0.99675, 0.62093, 0.18297;
+     0.99672, 0.60977, 0.17842;
+     0.99644, 0.59846, 0.17376;
+     0.99593, 0.58703, 0.16899;
+     0.99517, 0.57549, 0.16412;
+     0.99419, 0.56386, 0.15918;
+     0.99297, 0.55214, 0.15417;
+     0.99153, 0.54036, 0.14910;
+     0.98987, 0.52854, 0.14398;
+     0.98799, 0.51667, 0.13883;
+     0.98590, 0.50479, 0.13367;
+     0.98360, 0.49291, 0.12849;
+     0.98108, 0.48104, 0.12332;
+     0.97837, 0.46920, 0.11817;
+     0.97545, 0.45740, 0.11305;
+     0.97234, 0.44565, 0.10797;
+     0.96904, 0.43399, 0.10294;
+     0.96555, 0.42241, 0.09798;
+     0.96187, 0.41093, 0.09310;
+     0.95801, 0.39958, 0.08831;
+     0.95398, 0.38836, 0.08362;
+     0.94977, 0.37729, 0.07905;
+     0.94538, 0.36638, 0.07461;
+     0.94084, 0.35566, 0.07031;
+     0.93612, 0.34513, 0.06616;
+     0.93125, 0.33482, 0.06218;
+     0.92623, 0.32473, 0.05837;
+     0.92105, 0.31489, 0.05475;
+     0.91572, 0.30530, 0.05134;
+     0.91024, 0.29599, 0.04814;
+     0.90463, 0.28696, 0.04516;
+     0.89888, 0.27824, 0.04243;
+     0.89298, 0.26981, 0.03993;
+     0.88691, 0.26152, 0.03753;
+     0.88066, 0.25334, 0.03521;
+     0.87422, 0.24526, 0.03297;
+     0.86760, 0.23730, 0.03082;
+     0.86079, 0.22945, 0.02875;
+     0.85380, 0.22170, 0.02677;
+     0.84662, 0.21407, 0.02487;
+     0.83926, 0.20654, 0.02305;
+     0.83172, 0.19912, 0.02131;
+     0.82399, 0.19182, 0.01966;
+     0.81608, 0.18462, 0.01809;
+     0.80799, 0.17753, 0.01660;
+     0.79971, 0.17055, 0.01520;
+     0.79125, 0.16368, 0.01387;
+     0.78260, 0.15693, 0.01264;
+     0.77377, 0.15028, 0.01148;
+     0.76476, 0.14374, 0.01041;
+     0.75556, 0.13731, 0.00942;
+     0.74617, 0.13098, 0.00851;
+     0.73661, 0.12477, 0.00769;
+     0.72686, 0.11867, 0.00695;
+     0.71692, 0.11268, 0.00629;
+     0.70680, 0.10680, 0.00571;
+     0.69650, 0.10102, 0.00522;
+     0.68602, 0.09536, 0.00481;
+     0.67535, 0.08980, 0.00449;
+     0.66449, 0.08436, 0.00424;
+     0.65345, 0.07902, 0.00408;
+     0.64223, 0.07380, 0.00401;
+     0.63082, 0.06868, 0.00401;
+     0.61923, 0.06367, 0.00410;
+     0.60746, 0.05878, 0.00427;
+     0.59550, 0.05399, 0.00453;
+     0.58336, 0.04931, 0.00486;
+     0.57103, 0.04474, 0.00529;
+     0.55852, 0.04028, 0.00579;
+     0.54583, 0.03593, 0.00638;
+     0.53295, 0.03169, 0.00705;
+     0.51989, 0.02756, 0.00780;
+     0.50664, 0.02354, 0.00863;
+     0.49321, 0.01963, 0.00955;
+     0.47960, 0.01583, 0.01055];
+P = size(values,1);
+map = interp1(1:P, values, linspace(1,P,m), 'linear');
+end
Index: /issm/trunk/src/m/plot/googlemaps.m
===================================================================
--- /issm/trunk/src/m/plot/googlemaps.m	(revision 26743)
+++ /issm/trunk/src/m/plot/googlemaps.m	(revision 26744)
@@ -175,8 +175,8 @@
 delete('temp.png');
 
-%If not gdal, exit
+%If not GDAL, exit
 if status~=0,
 	disp(result);
-	disp('googlemaps info: gdal not found or not working properly, the Google image will not be transformed');
+	disp('googlemaps info: GDAL not found or not working properly, the Google image will not be transformed');
 	[gX gY]=meshgrid(ulx:ulx+size(final,2)-1,uly:-1:uly-size(final,1)+1);
 	[LAT LON]=pixelstolatlon(gX,gY, zoom);
@@ -204,5 +204,5 @@
 if ~isempty(strfind(result,'ERROR')),
 	disp(result);
-	disp(' ');disp('googlemaps info: gdal not working properly (missing proj.4 library?), Google image will not be transformed');
+	disp(' ');disp('googlemaps info: GDAL not working properly (missing PROJ.4 library?), Google image will not be transformed');
 	disp(result);
 	[gX gY]=meshgrid(ulx:ulx+size(final,2)-1,uly:-1:uly-size(final,1)+1);
Index: /issm/trunk/src/m/plot/plot_contour.js
===================================================================
--- /issm/trunk/src/m/plot/plot_contour.js	(revision 26744)
+++ /issm/trunk/src/m/plot/plot_contour.js	(revision 26744)
@@ -0,0 +1,300 @@
+function plot_contour(md, datain, options, canvas) { //{{{
+	//PLOT_MESH - Function for plotting wireframe contour.
+	//
+	//   Usage:
+	//      plot_contour(md, options, canvas);
+	//
+	//   See also: PLOTMODEL, PLOT_MANAGER
+
+	//{{{
+	//Process data and model
+	//let meshresults = processmesh(md, [], options);
+	//let [x, y, z, index, is2d, isplanet, vertices, scale] = scaleMesh(md, meshresults, options);
+	let [x, y, z, index, is2d, isplanet]=processmesh(md,[],options);
+	options.removefield('log',0);;
+	let [data, datatype]=processdata(md,datain,options);
+	if (vesl.helpers.isEmptyOrUndefined(data)) error('data provided is empty');
+	
+	//check is2d
+	if (!is2d && !isplanet) {
+		error('plot_contour error message: contour not supported for 3d meshes, project on a layer');
+	}
+
+	//first, process data: must be on nodes
+	if (datatype==1) {
+		//elements -> take average
+		//data=averaging(md,data,0);
+		error('plot_contour error message: contour not supported for element data yet');
+	} else if (datatype==2) {
+		//nodes -> do nothing
+	} else if (datatype==3) {
+		//quiver -> take norm
+		//data=sqrt(sum(datain.*datain,2)); //(original)
+		//data=ArraySqrt(ArraySum(ArrayMultiply(datain, datain),2)); //js version
+		error('plot_contour error message: contour not supported for quiver data yet');
+	} else {
+		error('datatype not supported yet');
+	}
+
+	//prepare colors
+	if (options.exist('contouronly')) {
+		//remove the previous plots
+		//cla
+		error('contouronly not supported yet');
+	}
+	let color=options.getfieldvalue('contourcolor','yellow');
+	let linewidth=options.getfieldvalue('linewidth',1);
+
+	//get contours levels
+	let contourlevels=options.getfieldvalue('contourlevels');
+	let levels;
+	if (typeof(contourlevels) == 'number') {
+		//levels=round_ice(linspace(max(data),min(data),contourlevels),2);
+		error('numeric contourlevels not supported yet - must provide levels as an array');
+	} else {
+		//levels=sort(unique(levels),'descend');
+		levels=ArraySort(ArrayUnique(contourlevels)).reverse();
+	}
+	let numlevels=levels.length;
+
+	//initialization of some variables
+	let numberofelements=index.length; //same as size(index,1)
+	let elementslist=NewArrayFillIncrement(0,numberofelements,1); //1:numberofelements;
+	let c=[];
+	let h=[];;
+
+	//get unique edges in mesh
+	//1: list of edges
+	index = ArraySubtract2D(index, 1);
+	//edges=[index[:,[1,2]); index(:,[2,3]); index(:,[3,1])];
+	let edges=ArrayConcat(ArrayConcat(ArrayCol(index,[0,1]), ArrayCol(index,[1,2])), ArrayCol(index,[2,0]));
+	//2: find unique edges
+	//[edges,I,J]=unique(sort(edges,2),'rows');
+	[edges,I,J]=ArrayUnique(ArraySort(edges,2),'rows');
+	//3: unique edge numbers
+	let vec=J;
+	//4: unique edges numbers in each triangle (2 triangles sharing the same edge will have
+	//   the same edge number)
+	let edges_tria=ArrayTranspose([ArrayIndex(vec,elementslist), ArrayIndex(vec,ArrayAdd(elementslist,numberofelements)), ArrayIndex(vec,ArrayAdd(elementslist,2*numberofelements))]);
+
+	//segments [nodes1 nodes2]
+	let Seg1=ArrayCol(index,[0,1]);
+	let Seg2=ArrayCol(index,[1,2]);
+	let Seg3=ArrayCol(index,[2,0]);
+	
+	//segment numbers [1;4;6;...]
+	let Seg1_num=ArrayCol(edges_tria,0);
+	let Seg2_num=ArrayCol(edges_tria,1);
+	let Seg3_num=ArrayCol(edges_tria,2);
+
+	//value of data on each tips of the segments
+	let Data1=ArrayIndex(data,Seg1);
+	let Data2=ArrayIndex(data,Seg2);
+	let Data3=ArrayIndex(data,Seg3);
+
+	//get the ranges for each segment
+	let Range1=ArraySort(Data1,2);
+	let Range2=ArraySort(Data2,2);
+	let Range3=ArraySort(Data3,2);
+	
+	let hx = [];
+	let hy = [];
+	let hz = [];
+	for (let i=0; i<numlevels; i++) {
+		let level=levels[i];
+
+		//find the segments that contain this value
+		let pos1=ArrayAnd(ArrayLessThan(ArrayCol(Range1,0),level), ArrayGreaterThan(ArrayCol(Range1,1),level)); //pos1=(Range1(:,1)<level & Range1(:,2)>level);
+		let pos2=ArrayAnd(ArrayLessThan(ArrayCol(Range2,0),level), ArrayGreaterThan(ArrayCol(Range2,1),level)); //pos2=(Range2(:,1)<level & Range2(:,2)>level);
+		let pos3=ArrayAnd(ArrayLessThan(ArrayCol(Range3,0),level), ArrayGreaterThan(ArrayCol(Range3,1),level)); //pos3=(Range3(:,1)<level & Range3(:,2)>level);
+
+		//get elements
+		let poselem12=ArrayAnd(pos1, pos2);
+		let poselem13=ArrayAnd(pos1, pos3);
+		let poselem23=ArrayAnd(pos2, pos3);
+		let poselem=find(ArrayOr(ArrayOr(poselem12, poselem13), poselem23));
+		let numelems=length(poselem);
+
+		//if no element has been flagged, skip to the next level
+		if (numelems==0) {
+			continue;
+		}
+
+		//go through the elements and build the coordinates for each segment (1 by element)
+		let x1=zeros(numelems,1);
+		let x2=zeros(numelems,1);
+		let y1=zeros(numelems,1);
+		let y2=zeros(numelems,1);
+		let z1=zeros(numelems,1);
+		let z2=zeros(numelems,1);
+
+		let edge_l=zeros(numelems,2);
+
+		for (let j=0; j < numelems; j++) {
+
+			let weight1=(level-Data1[poselem[j]][0])/(Data1[poselem[j]][1]-Data1[poselem[j]][0]);
+			let weight2=(level-Data2[poselem[j]][0])/(Data2[poselem[j]][1]-Data2[poselem[j]][0]);
+			let weight3=(level-Data3[poselem[j]][0])/(Data3[poselem[j]][1]-Data3[poselem[j]][0]);
+
+			if (poselem12[poselem[j]]) {
+				x1[j]=x[Seg1[poselem[j]][0]]+weight1*(x[Seg1[poselem[j]][1]]-x[Seg1[poselem[j]][0]]);
+				x2[j]=x[Seg2[poselem[j]][0]]+weight2*(x[Seg2[poselem[j]][1]]-x[Seg2[poselem[j]][0]]);
+				y1[j]=y[Seg1[poselem[j]][0]]+weight1*(y[Seg1[poselem[j]][1]]-y[Seg1[poselem[j]][0]]);
+				y2[j]=y[Seg2[poselem[j]][0]]+weight2*(y[Seg2[poselem[j]][1]]-y[Seg2[poselem[j]][0]]);
+				z1[j]=z[Seg1[poselem[j]][0]]+weight1*(z[Seg1[poselem[j]][1]]-z[Seg1[poselem[j]][0]]);
+				z2[j]=z[Seg2[poselem[j]][0]]+weight2*(z[Seg2[poselem[j]][1]]-z[Seg2[poselem[j]][0]]);
+				edge_l[j][0]=Seg1_num[poselem[j]];
+				edge_l[j][1]=Seg2_num[poselem[j]];
+
+			} else if (poselem13[poselem[j]]) {
+                x1[j]=x[Seg1[poselem[j]][0]]+weight1*(x[Seg1[poselem[j]][1]]-x[Seg1[poselem[j]][0]]);
+				x2[j]=x[Seg3[poselem[j]][0]]+weight3*(x[Seg3[poselem[j]][1]]-x[Seg3[poselem[j]][0]]);
+				y1[j]=y[Seg1[poselem[j]][0]]+weight1*(y[Seg1[poselem[j]][1]]-y[Seg1[poselem[j]][0]]);
+				y2[j]=y[Seg3[poselem[j]][0]]+weight3*(y[Seg3[poselem[j]][1]]-y[Seg3[poselem[j]][0]]);
+				z1[j]=z[Seg1[poselem[j]][0]]+weight1*(z[Seg1[poselem[j]][1]]-z[Seg1[poselem[j]][0]]);
+				z2[j]=z[Seg3[poselem[j]][0]]+weight3*(z[Seg3[poselem[j]][1]]-z[Seg3[poselem[j]][0]]);
+				edge_l[j][0]=Seg1_num[poselem[j]];
+				edge_l[j][1]=Seg3_num[poselem[j]];
+
+			} else if (poselem23[poselem[j]]) {
+                x1[j]=x[Seg2[poselem[j]][0]]+weight2*(x[Seg2[poselem[j]][1]]-x[Seg2[poselem[j]][0]]);
+				x2[j]=x[Seg3[poselem[j]][0]]+weight3*(x[Seg3[poselem[j]][1]]-x[Seg3[poselem[j]][0]]);
+				y1[j]=y[Seg2[poselem[j]][0]]+weight2*(y[Seg2[poselem[j]][1]]-y[Seg2[poselem[j]][0]]);
+				y2[j]=y[Seg3[poselem[j]][0]]+weight3*(y[Seg3[poselem[j]][1]]-y[Seg3[poselem[j]][0]]);
+				z1[j]=z[Seg2[poselem[j]][0]]+weight2*(z[Seg2[poselem[j]][1]]-z[Seg2[poselem[j]][0]]);
+				z2[j]=z[Seg3[poselem[j]][0]]+weight3*(z[Seg3[poselem[j]][1]]-z[Seg3[poselem[j]][0]]);
+				edge_l[j][0]=Seg2_num[poselem[j]];
+				edge_l[j][1]=Seg3_num[poselem[j]];
+			} else {
+				//it shoud not go here
+			}
+			let test = new THREE.Vector3(x1[j], y1[j], z1[j]);
+			//console.log('helo', test.length());
+		}
+		//now that we have the segments, we must try to connect them...
+
+		//loop over the subcontours
+		while (!isempty(edge_l)) {
+			//take the right edge of the second segment and connect it to the next segments if any
+			let e1=edge_l[0][0];   let e2=edge_l[0][1];
+			let xc=[x1[0],x2[0]]; let yc=[y1[0],y2[0]]; let zc=[z1[0],z2[0]]; 
+
+			//erase the lines corresponding to this edge
+			//edge_l(1,:)=[];
+			//x1(1)=[]; x2(1)=[];
+			//y1(1)=[]; y2(1)=[];
+			//z1(1)=[]; z2(1)=[]
+			edge_l.splice(0,1);
+			x1.splice(0,1); x2.splice(0,1);
+			y1.splice(0,1); y2.splice(0,1);
+			z1.splice(0,1); z2.splice(0,1);
+			let [ro1,co1]=find(ArrayEqual(edge_l,e1));
+
+			while (!isempty(ro1)) {
+				if (co1==0) {
+					xc=[x2[ro1]].concat(xc); yc=[y2[ro1]].concat(yc); zc=[z2[ro1]].concat(zc);
+
+					//next edge:
+					e1=edge_l[ro1][1];
+
+				} else {
+					xc=[x1[ro1]].concat(xc); yc=[y1[ro1]].concat(yc); zc=[z1[ro1]].concat(zc);
+
+					//next edge:
+					e1=edge_l[ro1][0];
+				}
+
+				//erase the lines of this
+				edge_l.splice(ro1,1);
+				x1.splice(ro1,1); x2.splice(ro1,1);
+				y1.splice(ro1,1); y2.splice(ro1,1);
+				z1.splice(ro1,1); z2.splice(ro1,1);
+
+				//next connection
+				[ro1,co1]=find(ArrayEqual(edge_l,e1));
+			}
+
+			//same thing the other way (to the right)
+			let [ro2,co2]=find(ArrayEqual(edge_l,e2));
+
+			while (!isempty(ro2)) {
+
+				if (co2==0) {
+					xc=[x2[ro2]].concat(xc); yc=[y2[ro2]].concat(yc); zc=[z2[ro2]].concat(zc);
+
+					//next edge:
+					e2=edge_l[ro2][1];
+
+				} else {
+					xc=[x1[ro2]].concat(xc); yc=[y1[ro2]].concat(yc); zc=[z1[ro2]].concat(zc);
+
+					//next edge:
+					e2=edge_l[ro2][0];
+				}
+
+				//erase the lines of this
+				edge_l.splice(ro2,1);
+				x1.splice(ro2,1); x2.splice(ro2,1);
+				y1.splice(ro2,1); y2.splice(ro2,1);
+				z1.splice(ro2,1); z2.splice(ro2,1);
+
+				//next connection
+				[ro2,co2]=find(ArrayEqual(edge_l,e2));
+			}
+
+			//we now have one subcontour ready to be plotted
+			if (options.getfieldvalue('contouronly',0)) {
+				if (isplanet) {
+					hx = ArrayConcat(hx, ArrayConcat(xc, [NaN]));
+					hy = ArrayConcat(hy, ArrayConcat(yc, [NaN]));
+					hz = ArrayConcat(hz, ArrayConcat(zc, [NaN]));
+					//h=[h;patch('Xdata',[xc;NaN],'Ydata',[yc;NaN],'Zdata',[zc;NaN],'facecolor','none','linewidth',linewidth)];
+				} else {
+					hx = ArrayConcat(hx, ArrayConcat(xc, [NaN]));
+					hy = ArrayConcat(hy, ArrayConcat(yc, [NaN]));
+					hz = ArrayConcat(hz, ArrayConcat(zc, [NaN]));
+					//h=[h;patch('Xdata',[xc;NaN],'Ydata',[yc;NaN],'Zdata',zc,'Cdata',zc,'facecolor','none','edgecolor','flat','linewidth',linewidth)];
+				}
+				//hold on      
+			} else {
+				//dist = 5000;
+				dist = 0;
+				if (isplanet) {
+					if ((max(xc)-min(xc)+max(yc)-min(yc)+max(zc)-min(zc))<dist) { continue; }
+					hx = ArrayConcat(hx, ArrayConcat(xc, [NaN]));
+					hy = ArrayConcat(hy, ArrayConcat(yc, [NaN]));
+					hz = ArrayConcat(hz, ArrayConcat(zc, [NaN]));
+					//h=[h;patch('Xdata',[xc;NaN],'Ydata',[yc;NaN],'Zdata',[zc;NaN],'facecolor','none','edgecolor',color,'linewidth',linewidth)];
+					//c = horzcat([level, xc'; length(xc), yc'; length(xc), zc']);
+				} else {
+					if ((max(xc)-min(xc)+max(yc)-min(yc))<dist) { continue; }
+					hx = ArrayConcat(hx, ArrayConcat(xc, [NaN]));
+					hy = ArrayConcat(hy, ArrayConcat(yc, [NaN]));
+					hz = ArrayConcat(hz, ArrayConcat(zc, [NaN]));
+					//h=patch('Xdata',[xc;NaN],'Ydata',[yc;NaN],'facecolor','none','edgecolor',color,'linewidth',linewidth);
+					//c = horzcat([level, xc'; length(xc), yc']);
+				}
+				//clabel(c,h,'FontSize',10,'labelspacing',20000,'color',color);
+				//hold on
+			}
+			//break;
+		}
+	}
+
+	//Compute gl variables:
+	let scale = options.getfieldvalue('contourscale', 1.0005);
+	let node = new Node(
+		'canvas', canvas,
+		'options', options,
+		'md', md,
+		'name', 'contours',
+		'replaceNaN', false,
+		'shaderName', 'line_strip',
+		'lineWidth', options.getfieldvalue('linewidth', 1),
+		'scale', [scale, scale, scale]
+	);
+
+	node.patch('Vertices', [hx, hy, hz], 'FaceColor', 'none', 'EdgeColor', color);
+	//node.patch('Faces', elements, 'Vertices', vertices, 'FaceColor', 'none', 'EdgeColor', edgecolor);
+	//}}}
+} //}}}
Index: /issm/trunk/src/m/plot/plot_manager.js
===================================================================
--- /issm/trunk/src/m/plot/plot_manager.js	(revision 26743)
+++ /issm/trunk/src/m/plot/plot_manager.js	(revision 26744)
@@ -1,130 +1,162 @@
-function plot_manager(md,options,subplotwidth,nlines,ncols,i){ //{{{
+'use strict';
+
+function plot_manager(md, options, subplotwidth, nlines, ncols, i) { //{{{
 	//PLOT__MANAGER - distribute the plots, called by plotmodel
 	//
 	//   Usage:
-	//      plot_manager(md,options,subplotwidth,i);
+	//      plot_manager(md, options, subplotwidth, i);
 	//
 	//   See also: PLOTMODEL, PLOT_UNIT
+	let canvas      = document.getElementById(options.getfieldvalue('canvasid'));
+	let data        = options.getfieldvalue('data'); // Get data to be displayed
+	let dataresults = null; 
+	let datatype    = 0;
+	let	data2       = null;
 			
-	//parse options and get a structure of options. 
-	checkplotoptions(md,options);
-	
-	//get data to be displayed
-	var data = options.getfieldvalue('data');
-	var canvas = initCanvas(options);
-	var gl = canvas.gl;
-
-	//figure out if this is a special plot
-	if (typeof data === 'string'){
-		
-		switch(data){
-
+	// Parse options and get a structure of options
+	checkplotoptions(md, options);
+
+	// Figure out if this is a special plot
+	if (typeof data === 'string') {
+		switch(data) {
 			case 'boundaries':
-				plot_boundaries(md,options,subplotwidth,i);
-				return;
+				plot_boundaries(md, options, subplotwidth, i);
+				return;
+				
 			case 'BC':
-				plot_BC(md,options,subplotwidth,i,data);
-				return;
+				plot_BC(md, options, subplotwidth, i, data);
+				return;
+				
 			case 'edges':
-				plot_edges(md,options,subplotwidth,i,data);
-				return;
+				plot_edges(md, options, subplotwidth, i, data);
+				return;
+				
 			case 'elementnumbering':
-				plot_elementnumbering(md,options,subplotwidth,i);
-				return;
+				plot_elementnumbering(md, options, subplotwidth, i);
+				return;
+				
 			case 'highlightelements':
-				plot_highlightelements(md,options,subplotwidth,i);
-				return;
+				plot_highlightelements(md, options, subplotwidth, i);
+				return;
+				
 			case 'qmumean':
-				plot_qmumean(md,options,nlines,ncols,i);
-				return;
+				plot_qmumean(md, options, nlines, ncols, i);
+				return;
+				
 			case 'qmustddev':
-				plot_qmustddev(md,options,nlines,ncols,i);
-				return;
+				plot_qmustddev(md, options, nlines, ncols, i);
+				return;
+				
 			case 'qmuhistnorm':
-				plot_qmuhistnorm(md,options,nlines,ncols,i);
-				return;
+				plot_qmuhistnorm(md, options, nlines, ncols, i);
+				return;
+				
 			case 'qmu_mass_flux_segments':
-				plot_qmu_mass_flux_segments(md,options,nlines,ncols,i);
-				return;
+				plot_qmu_mass_flux_segments(md, options, nlines, ncols, i);
+				return;
+				
 			case 'part_hist':
-				plot_parthist(md,options,nlines,ncols,i);
-				return;
+				plot_parthist(md, options, nlines, ncols, i);
+				return;
+				
 			case 'part_hist_n':
-				plot_parthistn(md,options,nlines,ncols,i);
-				return;
+				plot_parthistn(md, options, nlines, ncols, i);
+				return;
+				
 			case 'part_hist_w':
-				plot_parthistw(md,options,nlines,ncols,i);
-				return;
+				plot_parthistw(md, options, nlines, ncols, i);
+				return;
+				
 			case 'elements_type':
-				plot_elementstype(md,options,subplotwidth,i);
-				return;
+				plot_elementstype(md, options, subplotwidth, i);
+				return;
+				
 			case 'vertexnumbering':
-				plot_vertexnumbering(md,options,subplotwidth,i);
-				return;
+				plot_vertexnumbering(md, options, subplotwidth, i);
+				return;
+				
 			case 'highlightvertices':
-				plot_highlightvertices(md,options,subplotwidth,i);
-				return;
+				plot_highlightvertices(md, options, subplotwidth, i);
+				return;
+				
 			case 'basal_drag':
-				plot_basaldrag(md,options,subplotwidth,i,data);
-				return;
+				plot_basaldrag(md, options, subplotwidth, i, data);
+				return;
+				
 			case 'basal_dragx':
-				plot_basaldrag(md,options,subplotwidth,i,data);
-				return;
+				plot_basaldrag(md, options, subplotwidth, i, data);
+				return;
+				
 			case 'basal_dragy':
-				plot_basaldrag(md,options,subplotwidth,i,data);
-				return;
+				plot_basaldrag(md, options, subplotwidth, i, data);
+				return;
+				
 			case 'driving_stress':
-				plot_drivingstress(md,options,subplotwidth,i);
-				return;
+				plot_drivingstress(md, options, subplotwidth, i);
+				return;
+				
 			case 'mesh':
-				plot_mesh(md,options,canvas);
-				return;
+				plot_mesh(md, options, canvas);
+				return;
+				
 			case 'none':
-				//if (!(options.exist('overlay'))){
-				//	plot_none(md,options,nlines,ncols,i);
-				//}
-				return;
+				return;
+				
 			case 'penalties':
-				plot_penalties(md,options,subplotwidth,i);
-				return;
+				plot_penalties(md, options, subplotwidth, i);
+				return;
+				
 			case 'partition':
-				plot_partition(md,options,nlines,ncols,i);
-				return;
+				plot_partition(md, options, nlines, ncols, i);
+				return;
+				
 			case 'referential':
-				plot_referential(md,options,nlines,ncols,i);
-				return;
+				plot_referential(md, options, nlines, ncols, i);
+				return;
+				
 			case 'riftvel':
-				plot_riftvel(md,options,nlines,ncols,i);
-				return;
+				plot_riftvel(md, options, nlines, ncols, i);
+				return;
+				
 			case 'riftnumbering':
-				plot_riftnumbering(md,options,nlines,ncols,i);
-				return;
+				plot_riftnumbering(md, options, nlines, ncols, i);
+				return;
+				
 			case 'rifts':
-				plot_rifts(md,options,nlines,ncols,i);
-				return;
+				plot_rifts(md, options, nlines, ncols, i);
+				return;
+				
 			case 'riftrelvel':
-				plot_riftrelvel(md,options,nlines,ncols,i);
-				return;
+				plot_riftrelvel(md, options, nlines, ncols, i);
+				return;
+				
 			case 'riftpenetration':
-				plot_riftpenetration(md,options,nlines,ncols,i);
-				return;
+				plot_riftpenetration(md, options, nlines, ncols, i);
+				return;
+				
 			case 'riftfraction':
-				plot_riftfraction(md,options,nlines,ncols,i);
-				return;
+				plot_riftfraction(md, options, nlines, ncols, i);
+				return;
+				
 			case 'sarpwr':
-				plot_sarpwr(md,options,subplotwidth,i);
-				return;
+				plot_sarpwr(md, options, subplotwidth, i);
+				return;
+				
 			case 'time_dependant':
-				plot_vstime(md,options,nlines,ncols,i);
-				return;
+				plot_vstime(md, options, nlines, ncols, i);
+				return;
+				
 			case 'icefront':
-				plot_icefront(md,options,subplotwidth,i,data);
-				return;
+				plot_icefront(md, options, subplotwidth, i, data);
+				return;
+				
 			case 'segments':
-				plot_segments(md,options,subplotwidth,i,data);
-				return;
+				plot_segments(md, options, subplotwidth, i, data);
+				return;
+				
 			case 'quiver':
-				plot_quiver(md,options,canvas);
-				return;
+				plot_quiver(md, options, canvas);
+				return;
+				
 			case 'strainrate_tensor':
 			case 'strainrate':
@@ -145,23 +177,27 @@
 			case 'deviatoricstress_principalaxis2':
 			case 'deviatoricstress_principalaxis3':
-				plot_tensor(md,options,subplotwidth,i,data);
-				return;
+				plot_tensor(md, options, subplotwidth, i, data);
+				return;
+				
 			case 'thermaltransient_results':
-				plot_thermaltransient_results(md,options,subplotwidth,i);
-				return;
+				plot_thermaltransient_results(md, options, subplotwidth, i);
+				return;
+				
 			case 'transient_movie':
-				plot_transient_movie(md,options,canvas);
-				return;
+				plot_transient_movie(md, options, canvas);
+				return;
+				
 			case 'transient_results':
-				plot_transient_results(md,options,subplotwidth,i);
-				return;
+				plot_transient_results(md, options, subplotwidth, i);
+				return;
+				
 			case 'transient_field':
-				plot_transient_field(md,options,subplotwidth,i);
-				return;
+				plot_transient_field(md, options, subplotwidth, i);
+				return;
+				
 			default:
-				if (data in md){
-					data=md[data];
-				}
-				else{
+				if (data in md) {
+					data = md[data];
+				} else {
 					error('plot error message: data provided not supported yet. Type plotdoc for help');
 				}
@@ -169,40 +205,41 @@
 	}
 
-	//Figure out if this is a semi-transparent plot.
-	if (options.getfieldvalue('overlay','off')=='on'){
-		plot_overlay(md,data,options,canvas);
-	}
-
-	//Figure out if this is a semi-transparent plot.
-	if (options.exist('googlemaps')){
-		plot_googlemaps(md,data,options,nlines,ncols,i);
-		return;
-	}
-
-	//Figure out if this is a semi-transparent plot.
-	if (options.exist('gridded')){
-		plot_gridded(md,data,options,nlines,ncols,i);
-		return;
-	}
-
-	//Figure out if this is a Section plot
-	if (options.exist('sectionvalue')){
-		plot_section(md,data,options,nlines,ncols,i);
+	// Figure out if this is a semi-transparent plot.
+	if (options.getfieldvalue('overlay', 'off') === 'on') {
+		plot_overlay(md, data, options, canvas);
+		//return;
+	}
+
+	// Figure out if this is a semi-transparent plot.
+	if (options.exist('googlemaps')) {
+		plot_googlemaps(md, data, options, nlines, ncols, i);
+		return;
+	}
+
+	// Figure out if this is a semi-transparent plot.
+	if (options.exist('gridded')) {
+		plot_gridded(md, data, options, nlines, ncols, i);
+		return;
+	}
+
+	// Figure out if this is a Section plot
+	if (options.exist('sectionvalue')) {
+		plot_section(md, data, options, nlines, ncols, i);
 		return;
 	}
 
 	//Figure out if this is a Profile plot
-	if (options.exist('profile')){
-		plot_profile(md,data,options,nlines,ncols,i);
+	if (options.exist('profile')) {
+		plot_profile(md, data, options, nlines, ncols, i);
 		return;
 	}
 	
-	var	dataresults = processdata(md,data,options);
-	var	data2 = dataresults[0]; 
-	var	datatype = dataresults[1];
+	dataresults = processdata(md, data, options);
+	data2       = dataresults[0]; 
+	datatype    = dataresults[1];
 	
-	//plot unit
-	plot_unit(md,data2,datatype,options,canvas);
-
-	applyoptions(md,data2,options,canvas);
+	// Plot unit
+	plot_unit(md, data2, datatype, options, canvas);
+
+	applyoptions(md, data2, options, canvas);
 } //}}}
Index: /issm/trunk/src/m/plot/plot_manager.py
===================================================================
--- /issm/trunk/src/m/plot/plot_manager.py	(revision 26743)
+++ /issm/trunk/src/m/plot/plot_manager.py	(revision 26744)
@@ -3,5 +3,5 @@
     overlaysupport = True
 except ImportError:
-    print('osgeo/gdal for python not installed, overlay plots are not enabled')
+    print('OSGeo/GDAL for Python not installed, overlay plots are not enabled')
     overlaysupport = False
 
@@ -20,6 +20,5 @@
 
 def plot_manager(md, options, fig, axgrid, gridindex):
-    '''
-    PLOT_MANAGER - distribute the plots called by plotmodel
+    """PLOT_MANAGER - distribute the plots called by plotmodel
 
     'fig' is a handle to the figure instance created by plotmodel.
@@ -35,5 +34,5 @@
 
     See also: PLOTMODEL, PLOT_UNIT
-    '''
+    """
     #parse options and get a structure of options
     options = checkplotoptions(md, options)
@@ -46,4 +45,5 @@
     # TODO: Check why we are doing this and if it is absolutely necessary (see
     #       also src/m/plot/plot_mesh.py, src/m/plot/applyoptions.py)
+    #
     options.addfielddefault('ticklabels', 'on')
 
Index: /issm/trunk/src/m/plot/plot_mesh.js
===================================================================
--- /issm/trunk/src/m/plot/plot_mesh.js	(revision 26743)
+++ /issm/trunk/src/m/plot/plot_mesh.js	(revision 26744)
@@ -7,64 +7,47 @@
 	//   See also: PLOTMODEL, PLOT_MANAGER
 
-	// If we already have the overlay and are using caching, short circuit
-	if ('mesh' in canvas.nodes && options.getfieldvalue('cachenodes', 'off') === 'on') {
-		return;
-	}
-	
-	/*
-		Local variables
-	*/
 	//{{{
 	//Process data and model
-	var meshresults = processmesh(md, [], options);
-	var x = meshresults[0]; 
-	var y = meshresults[1]; 
-	var z = meshresults[2]; 
-	var elements = meshresults[3]; 
-	var is2d = meshresults[4]; 
-	var isplanet = meshresults[5];
-		
-	//Compute coordinates and data range:
-	var xlim = options.getfieldvalue('xlim', [ArrayMin(x), ArrayMax(x)]);
-	var ylim = options.getfieldvalue('ylim', [ArrayMin(y), ArrayMax(y)]);
-	var zlim = options.getfieldvalue('zlim', [ArrayMin(z), ArrayMax(z)]);
-	
-	//Handle heightscale
-	var vertices, scale;
-	if (md.mesh.classname() !== 'mesh3dsurface') {
-		vertices = [x, y, z];
-		scale = [1, 1, options.getfieldvalue('heightscale', 1)];
-	}
-	else {
-		vertices = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false}));
-		scale = [1, 1, 1];
-	}
+	let meshresults = processmesh(md, [], options);
+	meshresults = scaleMesh(md, meshresults, options);
+	let x = meshresults[0]; 
+	let y = meshresults[1]; 
+	let z = meshresults[2]; 
+	let elements = meshresults[3];
+	let is2d = meshresults[4]; 
+	let isplanet = meshresults[5];
+	let vertices = meshresults[6];
+	let scale = meshresults[7];
 	
 	//Compute gl variables:
-	var edgecolor = options.getfieldvalue('edgecolor', 'black');
-	var node = new Node(
+	let edgecolor = options.getfieldvalue('edgecolor', 'black');
+	let node = new Node(
 		'canvas', canvas,
 		'options', options,
+		'md', md,
 		'name', 'mesh',
-		'shaderName', 'Colored',
-		'alpha', options.getfieldvalue('alpha', 1.0),
-		//'center', [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, md.mesh.classname() === 'mesh3dsurface' ? (zlim[0] + zlim[1]) / 2 : zlim[0]],
-		'center', [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, (zlim[0] + zlim[1]) / 2],
-		'drawMode', canvas.gl.LINES,
-		'diffuseColor', edgecolor,
+		'cullFace', THREE.DoubleSide,
+		'shaderName', 'lines',
+		'opacity', options.getfieldvalue('opacity', 1.0),
 		'lineWidth', options.getfieldvalue('linewidth', 1),
-		'maskEnabled', options.getfieldvalue('innermask','off') == 'on',
-		'maskHeight', options.getfieldvalue('innermaskheight', 150.0) / options.getfieldvalue('heightscale', 1),
-		'maskColor', options.getfieldvalue('innermaskcolor',[0.0, 0.0, 1.0, 1.0]),
-		'rotation', [-90, 0, 0],
 		'scale', scale
 	);
 	//}}}
 	//{{{ node plot
-	if (elements[0].length==6){ //prisms
-	}
-	else if (elements[0].length==4){ //tetras
-	}
-	else{ //2D triangular elements
+	if (elements[0].length === 6) { //prisms
+		//We can skip bottom and every other side to avoid drawing edges twice.
+		let abc = elements.map(function(value, index) { return [value[0], value[1], value[2]]; }); //top
+		// let dfe = elements.map(function(value, index) { return [value[3], value[5], value[4]]; }); //bottom
+		// let aeb = elements.map(function(value, index) { return [value[0], value[4], value[1]]; }); //1st side upper right
+		let ade = elements.map(function(value, index) { return [value[0], value[3], value[4]]; }); //1st side lower left
+		// let bfc = elements.map(function(value, index) { return [value[1], value[5], value[2]]; }); //2nd side upper right
+		let bef = elements.map(function(value, index) { return [value[1], value[4], value[5]]; }); //2nd side lower left
+		// let cda = elements.map(function(value, index) { return [value[2], value[3], value[0]]; }); //3rd side upper right
+		let cfd = elements.map(function(value, index) { return [value[2], value[5], value[3]]; }); //3rd side lower left
+		let prismElements = abc.concat(ade, bef, cfd);
+		node.patch('Faces', prismElements, 'Vertices', vertices, 'FaceColor', 'none', 'EdgeColor', edgecolor);
+	} else if (elements[0].length === 4) { //tetras
+        // TODO: Implement handling for tetras
+	} else { // 2D triangular elements
 		node.patch('Faces', elements, 'Vertices', vertices, 'FaceColor', 'none', 'EdgeColor', edgecolor);
 	}
Index: /issm/trunk/src/m/plot/plot_overlay.js
===================================================================
--- /issm/trunk/src/m/plot/plot_overlay.js	(revision 26743)
+++ /issm/trunk/src/m/plot/plot_overlay.js	(revision 26744)
@@ -1,98 +1,157 @@
-function plot_overlay(md, data, options, canvas){ //{{{
-	//PLOT_OVERLAY - Function for plotting a georeferenced image.  
-	//
-	//   Usage:
-	//      plot_overlay(md, data, options, canvas);
-	//
-	//   See also: PLOTMODEL, PLOT_MANAGER
+'use strict';
 
-	// If we already have the overlay and are using caching, short circuit
-	if ('overlay' in canvas.nodes && options.getfieldvalue('cachenodes', 'off') === 'on') {
-		return;
+/**
+ * Global Function: plotOverlay
+ *
+ * Plot a georeferenced image 
+ *
+ * Dependencies:
+ *      - /ext/proj4-<version>
+ *
+ * See Also:
+ *      - /js/plotmodel.js
+ *      - /js/plotmanager.js
+ */
+function plot_overlay(md, data, options, canvas) {
+    let elements        = null;
+    let meshresults     = null; // results from call to processmesh
+    let newX            = null; // scaled x-coordinates (array)
+    let newY            = null; // scaled y-coordinates (array)
+    let newZ            = null; // scaled z-coordinates (array)
+    let position        = null; // x-, y-, and z-coordinates of vertex (object)
+    let renderObject    = null; 
+    let reproject       = false; // default; whether or not to reproject overlay
+    let result          = null; // First, projection of radar overlay onto mesh; then, projection of overlay onto mesh
+    let scale           = null; // coordinate scalars (array)
+	let vertices        = null;
+    let x               = null; // x-coordinates from results (array)
+    let xlim            = null; // x-cooridinate limits (array)
+    let y               = null; // y-coordinates from results (array)
+    let ylim            = null; // y-cooridinate limits (array)
+    let z               = null; // z-coordinates from results (array)
+    
+	// Process data and model
+    meshresults = processmesh(md, [], options);
+	x           = meshresults[0]; 
+	y           = meshresults[1]; 
+	z           = meshresults[2]; 
+	elements    = meshresults[3];
+	
+	if (md.mesh.classname().startsWith('mesh2d')) {
+		if (vesl.helpers.isNaN(md.geometry.surface) || (md.geometry.surface[0] !== undefined && vesl.helpers.isNaN(md.geometry.surface[0]))) {
+			md.geometry.surface = NewArrayFill(x.length, 0);
+			z = NewArrayFill(x.length, 0);
+		} else {
+			z = md.geometry.surface;
+		}
 	}
 	
-	/*
-		Local variables
-	*/
-	//{{{
-	//Process data and model
-	var meshresults = processmesh(md, [], options);
-	var x = meshresults[0]; 
-	var y = meshresults[1]; 
-	var z = meshresults[2]; 
-	var elements = meshresults[3]; 
-	var is2d = meshresults[4]; 
-	var isplanet = meshresults[5];
-	if (md.mesh.classname() !== 'mesh3dsurface') z = md.geometry.surface;
+	// Compute coordinates and data range
+	xlim = options.getfieldvalue('xlim', [ArrayMin(x), ArrayMax(x)]);
+	ylim = options.getfieldvalue('ylim', [ArrayMin(y), ArrayMax(y)]);
 	
-	//Compute coordinates and data range:
-	var xlim = options.getfieldvalue('xlim', [ArrayMin(x), ArrayMax(x)]);
-	var ylim = options.getfieldvalue('ylim', [ArrayMin(y), ArrayMax(y)]);
-	var zlim = options.getfieldvalue('zlim', [ArrayMin(md.geometry.surface), ArrayMax(md.geometry.surface)]);
-	
-	//Handle radaroverlay
+	// Handle radaroverlay
 	if (md.radaroverlay.outerx) {
-		var result = Node.prototype.mergeVertices(x, y, z, elements, md.radaroverlay.outerx, md.radaroverlay.outery, md.radaroverlay.outerheight, md.radaroverlay.outerindex);
-		x = result.x;
-		y = result.y;
-		z = result.z;
-		elements = result.elements;
+		result      = Node.prototype.mergeVertices(x, y, z, elements, md.radaroverlay.outerx, md.radaroverlay.outery, md.radaroverlay.outerheight, md.radaroverlay.outerindex);
+		x           = result.x;
+		y           = result.y;
+		z           = result.z;
+		elements    = result.elements;
 	}
 	
-	//Handle heightscale
-	var vertices, scale;
-	if (md.mesh.classname() !== 'mesh3dsurface') {
-		vertices = [x, y, z];
-		scale = [1, 1, options.getfieldvalue('heightscale', 1)];
-	}
-	else {
-		vertices = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false}));
-		scale = [1, 1, 1];
+	// Handle heightscale
+	renderObject = options.getfieldvalue('render', {});
+	
+	if ('overlay' in renderObject && renderObject.overlay.reproject !== undefined) {
+		reproject = renderObject.overlay.reproject;
 	}
 	
-	//Compute gl variables:
-	var edgecolor = options.getfieldvalue('edgecolor', 'black');
-	var texture = initTexture(gl, options.getfieldvalue('overlay_image'));
-	var node = new Node(
+	if (reproject) {
+		//NOTE: This is being hardcoded for now, as we want to display Josh's greenland-ice-retreat model on a globe.
+		// If mesh3dprisims do not need to be displayed on a globe, add an option to the view/render objects to specify the reprojection.
+		// Currently, we are also hardcoding the reprojection from EPSG:3413 (WGS 84 / NSIDC Sea Ice Polar Stereographic North) to EPSG:4326 (WGS 84, standard 2d spherical projection))
+		// projection definitions are taken from http://epsg.io/XXXXX.js, where XXXXX is the projection number.
+		// Can be dynamically taken and retrieved via md.mesh.epsg, but again, hardcoded for efficiency.
+		proj4.defs("EPSG:3413","+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs"); // http://epsg.io/3413.js
+		//Don't need to redefine EPSG:4326, as it is defined by default - however, this is still included just in case.
+		// proj4.defs("EPSG:4326","+proj=longlat +datum=WGS84 +no_defs"); // http://epsg.io/4326.js
+		//Create empty copies of XYZ to avoid rescaling md.geomtery.surface in the case that z = md.geomtery.surface
+		newX = NewArrayFill(x.length, 0);
+		newY = NewArrayFill(x.length, 0);
+		newZ = NewArrayFill(x.length, 0);
+		
+		for (let i = 0; i < x.length; ++i) {
+			result      = proj4('EPSG:3413','EPSG:4326', [x[i], y[i]]);
+			position    = vesl.geo.geographicToCartesian(vesl.EARTH_RADIUS + z[i], result[1], result[0], true);
+			newX[i]     = position.x;
+			newY[i]     = position.y;
+			newZ[i]     = position.z;
+		}
+		
+		x           = newX;
+		y           = newY;
+		z           = newZ;
+		vertices    = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false, 'reproject':reproject}), true);
+		scale       = [1, 1, 1];
+    } else {
+		vertices    = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false, 'reproject':reproject}), true);
+		scale       = [1, 1, 1];
+	}
+	
+	// Compute coordinates and data range
+	xlim = options.getfieldvalue('xlim', [ArrayMin(x), ArrayMax(x)]);
+	ylim = options.getfieldvalue('ylim', [ArrayMin(y), ArrayMax(y)]);
+	
+	// Compute GL variables
+	let texture         = new THREE.TextureLoader().load(options.getfieldvalue('overlay_image'));
+	let groundEnabled   = false;
+	let name            = 'overlay';
+	
+	if ('ground' in renderObject) {
+    	groundEnabled = renderObject.ground.enabled;
+    }
+    
+	if ('overlay' in renderObject) {
+    	name = renderObject.overlay.name;
+    }
+    
+	let shaderName = groundEnabled ? 'ground' : 'overlay';
+	
+	let node = new Node(
 		'canvas', canvas,
 		'options', options,
-		'name', 'overlay',
-		'shaderName', 'ground' in options.getfieldvalue('render', {}) ? 'GroundFromSpace' : 'TexturedDiffuse',
-		'alpha', options.getfieldvalue('outeralpha', 1.0),
-		//'center', [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, md.mesh.classname() === 'mesh3dsurface' ? (zlim[0] + zlim[1]) / 2 : zlim[0]],
-		'center', [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, (zlim[0] + zlim[1]) / 2],
-		'ambientColor', [0.1, 0.1, 0.1 ,1.0],
-		'diffuseColor', [1.0, 1.0, 1.0 ,1.0],
-		'specularStrength', 0.0,
-		'maskEnabled', options.getfieldvalue('outermask','off') == 'on',
-		'maskHeight', options.getfieldvalue('outermaskheight', 150.0),
-		'maskColor', options.getfieldvalue('outermaskcolor',[0.0, 0.0, 1.0, 1.0]),
+		'md', md,
+		'name', name,
+		'shaderName', shaderName,
+		'opacity', options.getfieldvalue('outeropacity', 1.0),
+		'cullFace', THREE.DoubleSide,
 		'texture', texture,
-		'rotation', [-90, 0, 0],
 		'scale', scale
 	);
-	//}}}
+	canvas.overlayNode = node;
 
-	var xRange = xlim[1] - xlim[0];
-	var yRange = ylim[1] - ylim[0];
-	var coordArray = [new Array(x.length), new Array(x.length)];
+	let xRange      = xlim[1] - xlim[0];
+	let yRange      = ylim[1] - ylim[0];
+	let coordArray  = [new Array(x.length), new Array(x.length)];
 	
-	//generate mesh:
-	if (md.mesh.classname() == 'mesh3dsurface') {
-		var xyz, magnitude;
-		for(var i = 0; i < x.length; i++){
-			xyz = vec3.fromValues(vertices[0][i], vertices[1][i], vertices[2][i]);
-			magnitude = vec3.length(xyz);
+	// Generate mesh
+	if (reproject || md.mesh.classname().startsWith('mesh3d')) {
+		let magnitude   = 0;
+		let xyz         = null;
 		
-			coordArray[0][i] = Math.atan2(xyz[1], xyz[0]) / (2 * Math.PI) + 0.5;
-			coordArray[1][i] = Math.asin(xyz[2] / magnitude) / Math.PI + 0.5;
+		for (let i = 0; i < x.length; ++i) {
+			xyz                 = vec3.fromValues(vertices[0][i], vertices[1][i], vertices[2][i]);
+			magnitude           = vec3.length(xyz);
+		
+			coordArray[0][i]    = Math.atan2(xyz[1], xyz[0]) / (2 * Math.PI) + 0.5;
+			coordArray[1][i]    = Math.asin(xyz[2] / magnitude) / Math.PI + 0.5;
 		}
-	}
-	else {
-		for(var i = 0; i < x.length; i++){
+	} else {
+		for (let i = 0; i < x.length; ++i) {
 			coordArray[0][i] = (vertices[0][i] - xlim[0]) / xRange;
 			coordArray[1][i] = (vertices[1][i] - ylim[0]) / yRange;
 		}
 	}
+	
 	node.patch('Faces', elements, 'Vertices', vertices, 'FaceVertexCData', coordArray, 'FaceColor', 'interp');
-} //}}}
+}
Index: /issm/trunk/src/m/plot/plot_overlay.py
===================================================================
--- /issm/trunk/src/m/plot/plot_overlay.py	(revision 26743)
+++ /issm/trunk/src/m/plot/plot_overlay.py	(revision 26744)
@@ -11,5 +11,5 @@
     from osgeo import gdal
 except ImportError:
-    print('osgeo/gdal for python not installed, plot_overlay is disabled')
+    print('OSGeo/GDAL for python not installed, plot_overlay is disabled')
 
 from processdata import processdata
@@ -19,6 +19,5 @@
 
 def plot_overlay(md, data, options, ax):
-    '''
-    Function for plotting a georeferenced image. Called from plot_manager by 
+    """Function for plotting a georeferenced image. Called from plot_manager by 
     call to plotmodel.
 
@@ -27,5 +26,5 @@
 
     See also: PLOTMODEL
-    '''
+    """
 
     x, y, z, elements, is2d, isplanet = processmesh(md, [], options)
Index: /issm/trunk/src/m/plot/plot_quiver.js
===================================================================
--- /issm/trunk/src/m/plot/plot_quiver.js	(revision 26743)
+++ /issm/trunk/src/m/plot/plot_quiver.js	(revision 26744)
@@ -21,5 +21,7 @@
 	var is2d = meshresults[4]; 
 	var isplanet = meshresults[5];
-	if (md.mesh.classname() !== 'mesh3dsurface') z = md.geometry.surface;
+	if (!md.mesh.classname().startsWith('mesh3d')) {
+		z = md.geometry.surface;
+	}
 		
 	//Compute coordinates and data range:
@@ -35,10 +37,10 @@
 	//Handle heightscale
 	var vertices, scale;
-	if (md.mesh.classname() !== 'mesh3dsurface') {
+	if (!md.mesh.classname().startsWith('mesh3d')) {
 		vertices = [x, y, z];
 		scale = [1, 1, options.getfieldvalue('heightscale', 1)];
 	}
 	else {
-		vertices = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false}));
+		vertices = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false}), true);
 		scale = [1, 1, 1];
 	}
@@ -51,5 +53,5 @@
 		'name', 'quiver',
 		'shaderName', 'Colored',
-		'alpha', options.getfieldvalue('alpha', 1.0),
+		'opacity', options.getfieldvalue('opacity', 1.0),
 		//'center', [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, md.mesh.classname() === 'mesh3dsurface' ? (zlim[0] + zlim[1]) / 2 : zlim[0]],
 		'center', [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, (zlim[0] + zlim[1]) / 2],
Index: /issm/trunk/src/m/plot/plot_transient_movie.js
===================================================================
--- /issm/trunk/src/m/plot/plot_transient_movie.js	(revision 26743)
+++ /issm/trunk/src/m/plot/plot_transient_movie.js	(revision 26744)
@@ -1,119 +1,177 @@
-function plot_transient_movie(md, options, canvas) {//{{{
-	/**
-	 * PLOT_TRANSIENT_MOVIE - plot a transient result as a movie
-	 *
-	 * Usage:
-	 *	plot_transient_movie(md, options, canvas);
-	 *
-	 * See also: PLOTMODEL, PLOT_MANAGER
-	 */
+'use strict';
 
-	// Loop over the time steps
-	let data	 	= options.getfieldvalue('transient_field_data');
-	let dataType	= {};
-	let steps 		= new Array(data.length);
-
-	for (let i = 0, numSteps = steps.length; i < numSteps; ++i) {
+/**
+ * Global Function: plot_transient_movie
+ *
+ * Parameters:
+ *		options			- Object containing a number of property/value pairs.
+ *		animation		- Object containing a number of property/value pairs related to transient solution animation.
+ *		progressText	- Object containing a number of property/value pairs related to updating the playback slider text on frame change.
+ *		unit 			- String (default: '') which is appended to the frame index with a single white space before updating #playback-progress-text on frame change.
+ *		update			- Boolean (default: true) indicating whether or not to update #playback-progress-text on frame change with the frame index. Set this to 'false' if you would rather manage the update of #playback-progress-text via 'onMovieUpdate' handler (or by some other means).
+ * 
+ * See Also:
+ *		- /web/js/plotmodel.js
+ *		- /web/js/plot_manager.js
+ *
+ * TODO:
+ *		- Update function signature/handling to use ES6 default parameters for 'unit' and 'handling'.
+ */
+function plot_transient_movie(md, options, canvas) {
+	//loop over the time steps
+	let data = options.getfieldvalue('transient_field_data');
+	let steps = new Array(data.length);
+	
+	for (let i = 0; i < steps.length; i++) {
 		steps[i] = i;
 	}
-
-	// Calculate caxis
+	
+	//calculate caxis
 	if (!options.exist('caxis')) {
-		let range 			= [Infinity, -Infinity];
-		let	dataResults;
-
+		let range = [Infinity, -Infinity];
+		let dataresults;
 		for (let i in steps) {
-			dataResults = processdata(md, data[i], options);
-			range[0] = Math.min(range[0], ArrayMin(dataResults[1]));
-			range[1] = Math.max(range[1], ArrayMax(dataResults[1]));
+			dataresults = processdata(md, data[i], options);
+			range[0] = Math.min(range[0], ArrayMin(dataresults[1]));
+			range[1] = Math.max(range[1], ArrayMax(dataresults[1]));
 		}
-
-		dataType = dataResults[1];
 		options.addfielddefault('caxis', range);
 	}
+	
+	//Create unit node 
+	let dataresults = processdata(md, data[0], options);
+	let data2 = dataresults[0]; 
+	let datatype = dataresults[1];
+	plot_unit(md, data2, datatype, options, canvas);
+	let unitOptions = options.getfieldvalue('unitOptions', {'name' : 'unit'});
+	let unitName 	= unitOptions.name;
+	let node 		= canvas.unitNodes[unitName];
+	
+	//process data
+	let processedData = [];
+	for (let i in steps) {
+		dataresults = processdata(md, data[i].slice(), options);
+		processedData[i] = dataresults[0];
+	}
+	
+	//process mesh
+	let meshresults = processmesh(md, data2, options);
+	meshresults = scaleMesh(md, meshresults, options);
+	let x = meshresults[0]; 
+	let y = meshresults[1]; 
+	let z = meshresults[2]; 
+	let elements = meshresults[3];
+	let is2d = meshresults[4]; 
+	let isplanet = meshresults[5];
+	let vertices = meshresults[6];
+	let scale = meshresults[7];
+	
+	//process options
+	if (canvas.animation !== undefined && canvas.animation.handler !== undefined) {
+		clearInterval(canvas.animation.handler);
+	}
+	let animation = options.getfieldvalue('animation', {});
+	
+	let progressText = null;
+	if (!vesl.helpers.isEmptyOrUndefined(animation.progressText)) {
+		progressText = {
+					update	: defaultFor(animation.progressText.update, true),
+					unit	: defaultFor(animation.progressText.unit,  	'')
+				};
+	} else {
+		progressText = {
+					update	: false,
+					unit	: ''
+				};
+	}
+	canvas.animation = {
+		frame: defaultFor(animation.frame, 			0),
+		play: defaultFor(animation.play, 			true),
+		fps: defaultFor(animation.fps, 				4),
+		interval: defaultFor(animation.interval, 	1000 / defaultFor(animation.fps, 4)),
+		loop: defaultFor(animation.loop, 			true),
+		handler: 						{}, // Initialized below
+		progressText: 						progressText
+	}
+	//display movie
+	canvas.unitMovieData = processedData;
+	canvas.animation.totalFrames = processedData.length;
+	canvas.animation.frame = 0;
 
-	// Create unit node if it does not already exist
-	if (!('unit' in canvas.nodes)) {
-		let	dataResults = processdata(md, data[0],options);
-		let	data2 		= dataResults[0];
-		let	dataType 	= dataResults[1];
-
-		// Plot unit
-		plot_unit(md,data2,dataType,options,canvas);
+	let slider = null;
+	
+	if (!vesl.helpers.isEmptyOrUndefined(canvas.playbackControls)) {
+		if (!vesl.helpers.isEmptyOrUndefined(canvas.playbackControls.slider)) {
+			slider = canvas.playbackControls.slider;
+		}
+		
+		
+		if (!vesl.helpers.isEmptyOrUndefined(canvas.playbackControls.progressText)) {
+			progressText = canvas.playbackControls.progressText;
+		}
 	}
-
-	// Setup rendering node
-	let node = canvas.nodes.unit;
-
-	node.options 	= options;
-	node.alpha 		= options.getfieldvalue('alpha', 1.0);
-	node.caxis 		= options.getfieldvalue('caxis');
-	node.enabled 	= options.getfieldvalue('nodata', 'off') === 'off';
-	node.log 		= options.getfieldvalue('log', false);
-
-	// Process data
-	let	dataResults;
-	let processedData = [];
-
-	for (let i in steps) {
-		dataResults 		= processdata(md, data[i].slice(), options);
-		processedData[i] 	= dataResults[0];
-	}
-
-	// Display movie
-	canvas.unitMovieData		= processedData;
-	canvas.animation.frame 		= 0;
-	canvas.animation.handler 	= setInterval(function () {
+	
+	clearInterval(canvas.animation.handler);
+	canvas.animation.handler = setInterval(function() {
 		// Update current animation frame
-		let frame 		= canvas.animation.frame;
-		let numFrames 	= steps.length;
-
+		let frame = canvas.animation.frame;
+		
 		if (canvas.animation.play) {
-			if (canvas.animation.increment) {
-				if (frame >= numFrames - 1) {
-					if (canvas.animation.loop) {
-						frame = 0;
-					} else {
-						toggleMoviePlay(canvas);
-					}
+			if (frame >= steps.length - 1) {
+				if (canvas.animation.loop) {
+					frame = 0;
 				} else {
-					frame = (frame + 1) % numFrames;
+					canvas.animation.play = !canvas.animation.play;
 				}
+			} else {
+				frame = (frame + 1) % steps.length;
 			}
 		}
-
-		// If frame has changed, update unit node and data marker display
+		
+		//If frame has changed, update unit node and data marker display.
 		if (frame !== canvas.animation.lastFrame) {
+			canvas.state.dispatchEvent('onMovieUpdate', canvas, frame, node);
+			
+			//Rescale in case surface has changed
+			if (md.mesh.classname() === 'mesh3dsurface' || md.mesh.classname() === 'mesh3dprisms') {
+				vertices = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false, 'reproject':false}), true);
+			} else {
+				vertices = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false, 'reproject':false}), true);
+				//vertices = [x, y, z];
+			}
+	
+			node.updateBuffer('Vertices', vertices);
 			node.updateBuffer('Coords', processedData[frame]);
-			canvas.unitData = processedData[frame];
-
+			canvas.unitData[unitName] = processedData[frame];
 			if (canvas.graph.enabled) {
 				vesl.graph.draw(canvas);
 			}
-
-			if (!vesl.helpers.isEmptyOrUndefined(canvas.playbackControls.slider)) {
-				canvas.playbackControls.slider.val(frame);
+			if (slider != null) {
+				slider.val(frame);
 			}
-
-			if (!vesl.helpers.isEmptyOrUndefined(canvas.playbackControls.progressText)) {
-				canvas.playbackControls.progressText.html(steps[frame].toFixed(0) + ' ' + options.getfieldvalue('movietimeunit', 'yr'));
+			if (!vesl.helpers.isEmptyOrUndefined(progressText) && canvas.animation.progressText.update) {
+				if (canvas.animation.progressText.unit === '') {
+					progressText.html(steps[frame].toFixed(0));
+				} else {
+					progressText.html(steps[frame].toFixed(0) + ' ' + canvas.animation.progressText.unit);
+				}
 			}
-
-			if (!vesl.helpers.isEmptyOrUndefined(canvas.nodes.quiver)) {
-				plot_quiver(md, options, canvas, false);
-			}
+			//if (!vesl.helpers.isEmptyOrUndefined(canvas.nodes.quiver)) {
+			//	plot_quiver(md,options,canvas,false);
+			//}
+			
 		}
-
-		// Save new frame info
-		canvas.animation.lastFrame 	= canvas.animation.frame;
-		canvas.animation.frame 		= frame;
+		
+		//Save new frame info.
+		canvas.animation.lastFrame = canvas.animation.frame;
+		canvas.animation.frame = frame;
 	}, canvas.animation.interval);
-
-	// Update progress bar with new frame info
-	if (!vesl.helpers.isEmptyOrUndefined(canvas.playbackControls.slider)) {
-		canvas.playbackControls.slider.val(canvas.animation.frame);
-		canvas.playbackControls.slider.setUpperBound(steps.length - 1);
+	
+	//Update progress bar with new frame info.
+	if (!vesl.helpers.isEmptyOrUndefined(slider)) {
+		slider.max(steps.length - 1);
+		slider.val(canvas.animation.frame);
 	}
-
+				
 	applyoptions(md, [], options, canvas);
-}//}}}
+}
Index: /issm/trunk/src/m/plot/plot_unit.js
===================================================================
--- /issm/trunk/src/m/plot/plot_unit.js	(revision 26743)
+++ /issm/trunk/src/m/plot/plot_unit.js	(revision 26744)
@@ -1,2 +1,4 @@
+'use strict';
+
 function plot_unit(md, data, datatype, options, canvas) { //{{{
 	//PLOT_UNIT - unit plot, display data
@@ -6,121 +8,123 @@
 	//
 	//   See also: PLOTMODEL, PLOT_MANAGER
-
-	var name = 'unit';
-	if ('unit' in canvas.nodes) {
-		if (options.getfieldvalue('clf','on')=='on') {
-			for (var node in canvas.nodes) {
-				if (vesl.string.startsWith(node, 'unit')) {
-					delete canvas.octrees[node];
-					delete canvas.nodes[node];
-				}
+	
+	//{{{
+	// Process data and model
+	let meshresults = processmesh(md, data, options);
+	meshresults = scaleMesh(md, meshresults, options);
+	let x = meshresults[0]; 
+	let y = meshresults[1]; 
+	let z = meshresults[2]; 
+	let elements = meshresults[3];
+	let is2d = meshresults[4]; 
+	let isplanet = meshresults[5];
+	let vertices = meshresults[6];
+	let scale = meshresults[7];
+	
+	//Compute gl variables:
+	let edgecolor = options.getfieldvalue('edgecolor', [1.0, 1.0, 1.0, 1.0]);
+	let maskzeros = options.getfieldvalue('maskzeros', {});
+	
+	let unitOptions = options.getfieldvalue('unitOptions', {'name' : 'unit'});
+	let unitName 	= unitOptions.name;
+	
+	let node = new Node(
+		'canvas', canvas,
+		'options', options,
+		'md', md,
+		'name', unitName,
+		'shaderName', 'unit',
+		'opacity', options.getfieldvalue('opacity', 1.0),
+		'caxis', options.getfieldvalue('caxis',[ArrayMin(data), ArrayMax(data)]),
+		'cullFace', THREE.FrontSide,
+		'enabled', options.getfieldvalue('nodata', 'off') === 'off',
+		'log', options.getfieldvalue('log',false),
+		'maskObject', options.getfieldvalue('maskregion', {'enabled': false}),
+		'maskZerosColor', defaultFor(maskzeros.color, [1.0, 1.0, 1.0, 1.0]),
+		'maskZerosEnabled', defaultFor(maskzeros.enabled, false),
+		'maskZerosTolerance', defaultFor(maskzeros.tolerance, 1e-3),
+		'maskZerosZeroValue', defaultFor(maskzeros.zeroValue, 0.5),
+		'scale', scale
+	);
+	//}
+	
+	if (vesl.helpers.isEmptyOrUndefined(canvas.unitNodes)) {
+		canvas.unitNodes = {};
+	}
+	
+	if (vesl.helpers.isEmptyOrUndefined(canvas.unitData)) {
+		canvas.unitData = {};
+	}
+	
+	// If option 'clf' is on, remove all cached data associated with this unit
+	if (options.getfieldvalue('clf', 'on') === 'on') {
+		delete canvas.unitNodes[unitName];
+		canvas.unitData[unitName] = data;
+		
+		for (let i = 0, numUnits = canvas.state.scene.children.length; i < numUnits; ++i) {
+			if (canvas.state.scene.children[i].name === unitName) {
+				canvas.state.scene.children.splice(i, 1);
+				break;
 			}
 		}
-		else {
-			name = 'unit' + Object.keys(canvas.nodes).length;
-		}
-	}
-
-	//{{{ declare variables:
-	//Process data and model
-	var meshresults = processmesh(md, data, options);
-	var x = meshresults[0]; 
-	var y = meshresults[1]; 
-	var z = meshresults[2]; 
-	var elements = meshresults[3];
-	var is2d = meshresults[4]; 
-	var isplanet = meshresults[5];
-	if (md.mesh.classname() !== 'mesh3dsurface') {
-		if (vesl.helpers.isNaN(md.geometry.surface) || (md.geometry.surface[0] !== undefined && vesl.helpers.isNaN(md.geometry.surface[0]))) {
-			md.geometry.surface = NewArrayFill(x.length, 0);
-		}
-		z = md.geometry.surface;
 	}
 	
-	//Compute coordinates and data range:
-	var xlim = options.getfieldvalue('xlim', [ArrayMin(x), ArrayMax(x)]);
-	var ylim = options.getfieldvalue('ylim', [ArrayMin(y), ArrayMax(y)]);
-	var zlim = options.getfieldvalue('zlim', [ArrayMin(z), ArrayMax(z)]);
+	canvas.unitNodes[unitName] = node;
 	
-	//Handle heightscale
-	var vertices, scale;
-	if (md.mesh.classname() !== 'mesh3dsurface') {
-		vertices = [x, y, z];
-		scale = [1, 1, options.getfieldvalue('heightscale', 1)];
-	}
-	else {
-		vertices = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false}));
-		scale = [1, 1, 1];
-	}
-
-	//Compute gl variables:
-	var edgecolor = options.getfieldvalue('edgecolor', [1.0, 1.0, 1.0 ,1.0]);
-	var maskzeros = options.getfieldvalue('maskzeros', {});
-	var render = options.getfieldvalue('render', {});
-	var cullFace = ("unit" in render) ? canvas.gl[render.unit.cullFace] : canvas.gl.BACK;
-	var node = new Node(
-		'canvas', canvas,
-		'options', options,
-		'name', name,
-		'shaderName', 'TexturedDiffuse',
-		'alpha', options.getfieldvalue('alpha', 1.0),
-		'caxis', options.getfieldvalue('caxis',[ArrayMin(data), ArrayMax(data)]),
-		'center', [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, (zlim[0] + zlim[1]) / 2],
-		'cullFace', cullFace,
-		'lightingBias', canvas.view.lightingBias,
-		'diffuseColor', edgecolor,
-		'specularStrength', 0.0,
-		'enabled', options.getfieldvalue('nodata','off') == 'off' || (("unit" in render) && render.unit.enabled),
-		'log', options.getfieldvalue('log',false),
-		'maskEnabled', options.getfieldvalue('innermask','off') == 'on',
-		'maskHeight', options.getfieldvalue('innermaskheight', 150.0) / options.getfieldvalue('heightscale', 1),
-		'maskColor', options.getfieldvalue('innermaskcolor',[0.0, 0.0, 1.0, 1.0]),
-		'maskObject', options.getfieldvalue('maskregion',{'enabled':false}),
-		'maskZerosColor', defaultFor(maskzeros.color,[1.0, 1.0, 1.0, 1.0]),
-		'maskZerosEnabled', defaultFor(maskzeros.enabled,false),
-		'maskZerosTolerance', defaultFor(maskzeros.tolerance,1e-3),
-		'maskZerosZeroValue', defaultFor(maskzeros.zeroValue,0.5),
-		'rotation', [-90, 0, 0],
-		'scale', ("unit" in render) ? [render.unit.scale, render.unit.scale, render.unit.scale] : scale
-	);
-	//}
-	if (options.getfieldvalue('clf','on')=='on') {
-		canvas.unitNode = node;
-		canvas.unitData = data;
-	}
 	//}}}
-	switch(datatype){
+	switch(datatype) {
 		//{{{ element plot
 		case 1:
 			//WARNING: NaN are not properly found (NaN != NaN = true)
-			pos=ArrayFindNot(data, NaN); //needed for element on water
-			if (elements[0].length==6){ //prisms
-			}
-			else if (elements[0].length==4){ //tetras
-			}
-			else{ //triangular elements
+			let pos = ArrayFindNot(data, NaN); //needed for element on water
+			
+			if (elements[0].length === 6) { // prisms
+				let abc = elements.map(function(value, index) { return [value[0], value[1], value[2]]; }); //top
+				let dfe = elements.map(function(value, index) { return [value[3], value[5], value[4]]; }); //bottom
+				let aeb = elements.map(function(value, index) { return [value[0], value[4], value[1]]; }); //1st side upper right
+				let ade = elements.map(function(value, index) { return [value[0], value[3], value[4]]; }); //1st side lower left
+				let bfc = elements.map(function(value, index) { return [value[1], value[5], value[2]]; }); //2nd side upper right
+				let bef = elements.map(function(value, index) { return [value[1], value[4], value[5]]; }); //2nd side lower left
+				let cda = elements.map(function(value, index) { return [value[2], value[3], value[0]]; }); //3rd side upper right
+				let cfd = elements.map(function(value, index) { return [value[2], value[5], value[3]]; }); //3rd side lower left
+				let prismElements = abc.concat(dfe, aeb, ade, bfc, bef, cda, cfd);
+				node.patch('Faces', prismElements, 'Vertices', vertices, 'FaceVertexCData', data, 'FaceColor', 'flat', 'EdgeColor', edgecolor);
+			} else if (elements[0].length === 4) { // tetras
+    			// TODO: Implement handling for tetras
+			} else { // triangular elements
 				node.patch('Faces', elements, 'Vertices', vertices, 'FaceVertexCData', data, 'FaceColor', 'flat', 'EdgeColor', edgecolor);
 			}
+			
 			break;
 		//}}}
 		//{{{ node plot
 		case 2:
-			if (elements[0].length==6){ //prisms
-			}
-			else if (elements[0].length==4){ //tetras
-			}
-			else{ //triangular elements	
+			if (elements[0].length === 6) { // prisms
+				let abc = elements.map(function(value, index) { return [value[0], value[1], value[2]]; }); //top
+				let dfe = elements.map(function(value, index) { return [value[3], value[5], value[4]]; }); //bottom
+				let aeb = elements.map(function(value, index) { return [value[0], value[4], value[1]]; }); //1st side upper right
+				let ade = elements.map(function(value, index) { return [value[0], value[3], value[4]]; }); //1st side lower left
+				let bfc = elements.map(function(value, index) { return [value[1], value[5], value[2]]; }); //2nd side upper right
+				let bef = elements.map(function(value, index) { return [value[1], value[4], value[5]]; }); //2nd side lower left
+				let cda = elements.map(function(value, index) { return [value[2], value[3], value[0]]; }); //3rd side upper right
+				let cfd = elements.map(function(value, index) { return [value[2], value[5], value[3]]; }); //3rd side lower left
+				let prismElements = abc.concat(dfe, aeb, ade, bfc, bef, cda, cfd);
+				node.patch('Faces', prismElements, 'Vertices', vertices, 'FaceVertexCData', data, 'FaceColor', 'interp', 'EdgeColor', edgecolor);
+			} else if (elements[0].length === 4) { // tetras
+    			// TODO: Implement handling for tetras
+			} else { // triangular elements	
 				node.patch('Faces', elements, 'Vertices', vertices, 'FaceVertexCData', data, 'FaceColor', 'interp', 'EdgeColor', edgecolor);
 			}
+			
 			break;
 		//}}}
 		//{{{ quiver plot 
 		case 3:
-			if (is2d){
+			if (is2d) {
 				//plot_quiver(x, y, data(:, 1), data(:, 2), options);
-			}
-			else{
+			} else {
 				//plot_quiver3(x, y, z, data(:, 1), data(:, 2), data(:, 3), options);
 			}
+			
 			break;
 		//}}}
Index: /issm/trunk/src/m/plot/plotdoc.js
===================================================================
--- /issm/trunk/src/m/plot/plotdoc.js	(revision 26743)
+++ /issm/trunk/src/m/plot/plotdoc.js	(revision 26744)
@@ -24,5 +24,5 @@
 	console.log('       	"height": height to spawn clouds at (ex: 7500)');
 	console.log('       	"quantity": quantity of clouds to spawn (ex: 10)');
-	console.log('       "caxis": modify  colorbar range. (array of type [a, b] where b>=a)');
+	console.log('       "caxis": modify colorbar range (array of type [a, b] where b>=a)');
 	console.log('       "colorbar": add colorbar (default "off", ex: "on", "off")');
 	console.log('       "colorbarid": colorbar canvas id (string)');
@@ -39,9 +39,10 @@
 	console.log('       "dataMarker": object cotaining data marker parameters. See webgl.js for defaults. (ex: {"enabled":true,"format":["<div id="sim-plot"></div>"],"labels":["thickness","velocity","value"],"animated":true})');
 	console.log('       	"enabled": toggle data marker displays (default true, ex: false)');
-	console.log('       	"image": image used for marking the clicked point (ex: "/canvas/data-markers/data-marker.svg")');
-	console.log('       	"labels": when displaying a sim-plot graph, display these model fields. (ex: ["thickness","velocity","value"])');
-	console.log('       	"font": font to be used for display (ex: "24px "Comic Sans MS", cursive")');
-	console.log('       	"format": an array compatible with sprintf that will be displayed as html (ex: ["X: %.2e<br>Y: %.2e<br>Z: %.2e]<br>Value: %0.1f","x","y","z","value"])');
-	console.log('      		"size": specifiy the width and height of the data markers (default [32,32], ex: [24,32], [105,10])');
+	console.log('       	"hasMarker": whether or not the data marker has a marker (default true, ex: false)');
+	console.log('       	"markerImgPath": path to image to use for marker (default "/canvas/data-markers/data-marker.svg")');
+	console.log('       	"hasTooltip": whether or not the data marker has a tooltip (default false, ex: true)');
+	console.log('       	"tooltipFormat": C-style format string to be used when on calls to vesl.DataMarker.tooltipContent to format passed data points (default "", ex: ["X: %.2e<br>Y: %.2e<br>Z: %.2e])');	
+	console.log('       	"width": width, in pixels, of the data marker (default 32)');	
+	console.log('       	"height": height, in pixels, of the data marker (default 32)');
 	console.log('       "displayview": print view value to console (default "off", ex: "on", "off")');
 	console.log('       "displayzoom": print zoom value to console (default "off", ex: "on", "off")');
@@ -60,8 +61,8 @@
 	console.log('       "outermask*": Special mask that colors all parts of a overlay mesh below a height a certain color. provide outermaskheight and outermaskcolor options also (default "off", ex: "on", "off")');
 	console.log('       "overlay": overlay a radar amplitude image behind (default "off", ex: "on", "off")');
-	console.log('       "overlay_image": path to overlay image (default "", ex: "./images/radar.png")');
+	console.log('       "overlay_image": path to overlay image (default "", ex: "./img/radar.png")');
 	console.log('       "quiver": add quiver plot overlay for velocities. (default "off", ex: "on", "off")');
 	console.log('       "scaling": scaling factor used by quiver plots. Default is 0.4');
-	console.log('       "alpha": transparency coefficient 0.0 to 1.0, the lower, the more transparent. (default 1.0, ex: 0.5, 0.25)');
+	console.log('       "opacity": transparency coefficient 0.0 to 1.0, the lower, the more transparent. (default 1.0, ex: 0.5, 0.25)');
 	console.log('       "render": a object containing a list of default object to render. (default {}, ex: {"sky", "space"})');
 	console.log('       	"sky": render the atmosphere. (ex: {"enabled":true})');
Index: /issm/trunk/src/m/plot/plotdoc.m
===================================================================
--- /issm/trunk/src/m/plot/plotdoc.m	(revision 26743)
+++ /issm/trunk/src/m/plot/plotdoc.m	(revision 26744)
@@ -122,5 +122,5 @@
 disp('       ''mask'': list of flags of size numberofnodes or numberofelements. Only ''true'' values are plotted ');
 disp('       ''nan'': value assigned to NaNs (convenient when plotting BC)');
-disp('       ''partitionedges'': ''off'' by default. overlay plot of partition edges');
+disp('       ''partition'': a partion vector. generates overlay plot of partition edges');
 disp('       ''log'': value of log');
 disp('       ''latlon'': ''on'' or {latstep lonstep [resolution [color]]} where latstep,longstep and resolution are in degrees, color is a [r g b] array');
Index: /issm/trunk/src/m/plot/plotdoc.py
===================================================================
--- /issm/trunk/src/m/plot/plotdoc.py	(revision 26743)
+++ /issm/trunk/src/m/plot/plotdoc.py	(revision 26744)
@@ -127,5 +127,5 @@
     #                'border': " size of printlay border (in pixels). active only for overlay plots",
     #                'nan': " value assigned to NaNs (convenient when plotting BC)",
-    #                'partitionedges': " 'off' by default. overlay plot of partition edges",
+    #                'partition: " a partion vector. generates overlay plot of partition edges",
     #                'latlon': " 'on' or {latstep lonstep [resolution [color]]} where latstep, longstep and resolution are in degrees, color is a [r g b] array",
     #                'latlonnumbering': " 'on' or {latgap longap colornumber latangle lonangle} where latgap and longap are pixel gaps for the numbers",
Index: /issm/trunk/src/m/plot/plotmodel.js
===================================================================
--- /issm/trunk/src/m/plot/plotmodel.js	(revision 26743)
+++ /issm/trunk/src/m/plot/plotmodel.js	(revision 26744)
@@ -1,45 +1,54 @@
-function plotmodel(md){ //{{{
-	//Convert arguments to array: 
-	var args = Array.prototype.slice.call(arguments);
+'use strict';
 
-	//First process options
-	var options = new plotoptions(args.slice(1,args.length));
+function plotmodel(md) { //{{{
+	let args            = Array.prototype.slice.call(arguments); // Convert arguments to array 
+    let canvas          = null;
+    let ncols           = 0;
+    let nlines          = 0;
+    let numberofplots   = 0;
+    let options         = new plotoptions(args.slice(1, args.length)); // Process options
+    let subplotwidth    = Math.ceil(Math.sqrt(options.numberofplots)); // Get number of subplots
+    
+	// Get figure number and number of plots
+	numberofplots = options.numberofplots;
+
+	// If nlines and ncols specified, then bypass.
+	if (options.list[0].exist('nlines')) {
+		nlines = options.list[0].getfieldvalue('nlines');
+	} else {
+		nlines = Math.ceil(numberofplots / subplotwidth);
+	}
 	
-	//get number of subplots
-	subplotwidth=Math.ceil(Math.sqrt(options.numberofplots)); 
-	
-	//Get figure number and number of plots
-	numberofplots=options.numberofplots;
-
-	//if nlines and ncols specified, then bypass.
-	var nlines,ncols;
-	if (options.list[0].exist('nlines')){
-		nlines=options.list[0].getfieldvalue('nlines');
-	}
-	else {
-		nlines=Math.ceil(numberofplots/subplotwidth);
-	}
 	if (options.list[0].exist('ncols')){
-		ncols=options.list[0].getfieldvalue('ncols');
-	}
-	else {
-		ncols=subplotwidth;
+		ncols = options.list[0].getfieldvalue('ncols');
+	} else {
+		ncols = subplotwidth;
 	}
 	
 	//check that nlines and ncols were given at the same time!
-	if ((options.list[0].exist('ncols') & !options.list[0].exist('nlines')) | (options.list[0].exist('nlines') & !options.list[0].exist('ncols'))) throw Error('plotmodel error message: nlines and ncols need to be specified together, or not at all');
+	if ((options.list[0].exist('ncols') && !options.list[0].exist('nlines')) 
+	    || ((options.list[0].exist('nlines') && !options.list[0].exist('ncols')))) {
+    	    throw Error('plotmodel error message: nlines and ncols need to be specified together, or not at all');
+    }
 
-	//go through subplots
-	if (numberofplots){
-		//Reinitialize all canvases
-		for (var i=0;i<numberofplots;i++){
-			if (options.list[i].getfieldvalue('clf','on')!='off') document.getElementById(options.list[i].getfieldvalue('canvasid')).initialized = false;
+	// Go through subplots
+	if (numberofplots) {
+		// Go through all data plottable and close window if an error occurs
+
+		let canvases = [];
+		for (let i = 0; i < numberofplots; ++i) {
+			canvases[i] = document.getElementById(options.list[i].getfieldvalue('canvasid'));
+			canvases[i].state.dispatchEvent('onPlotModelStart', canvases[i], options.list[i]);
 		}
-		//Go through all data plottable and close window if an error occurs
-		for (var i=0;i<numberofplots;i++){
-			plot_manager(options.list[i].getfieldvalue('model',md),options.list[i],subplotwidth,nlines,ncols,i);
+		for (let i = 0; i < numberofplots; ++i) {
+			canvases[i].state.dispatchEvent('onPlotManagerStart', canvases[i], options.list[i]);
+			plot_manager(options.list[i].getfieldvalue('model',md), options.list[i], subplotwidth, nlines, ncols, i);
+			canvases[i].state.dispatchEvent('onPlotManagerEnd', canvases[i], options.list[i]);
 
-			//List all unused options
+			// List all unused options
 			options.list[i].displayunused();
+		}
+		for (let i = 0; i < numberofplots; ++i) {
+			canvases[i].state.dispatchEvent('onPlotModelEnd', canvases[i], options.list[i]);
 		}
 	}
Index: /issm/trunk/src/m/plot/plotmodel.py
===================================================================
--- /issm/trunk/src/m/plot/plotmodel.py	(revision 26743)
+++ /issm/trunk/src/m/plot/plotmodel.py	(revision 26744)
@@ -14,5 +14,5 @@
 def plotmodel(md, *args):
     '''
-    PLOTMODEL - At command prompt, type 'plotdoc()' for additional 
+    PLOTMODEL - At command prompt, type 'plotdoc()' for additional
     documentation.
 
@@ -31,5 +31,5 @@
     subplotwidth = ceil(sqrt(numberofplots))
 
-    # TODO: Check that commenting this out is correct; we do not need a hold 
+    # TODO: Check that commenting this out is correct; we do not need a hold
     # under matplotlib, right?
     #
@@ -60,5 +60,5 @@
     # Go through plots
     #
-    # NOTE: The following is where Python + matplolib differs substantially in 
+    # NOTE: The following is where Python + matplolib differs substantially in
     #       implementation and inteface from MATLAB.
     #
@@ -83,5 +83,5 @@
             plotnum = None
 
-        # NOTE: The inline comments for each of the following parameters are 
+        # NOTE: The inline comments for each of the following parameters are
         #       taken from https://matplotlib.org/api/_as_gen/mpl_toolkits.axes_grid1.axes_grid.ImageGrid.html
         #
@@ -95,5 +95,5 @@
         #
         # TODO:
-        # - Add 'edge' option (research if there is a corresponding option in 
+        # - Add 'edge' option (research if there is a corresponding option in
         #   MATLAB)?
         #
@@ -118,5 +118,5 @@
         #   rect(float, float, float, float) or int
         #
-        # The axes position, as a (left, bottom, width, height) tuple or as a 
+        # The axes position, as a (left, bottom, width, height) tuple or as a
         # three-digit subplot position code (e.g., "121").
         #
@@ -127,5 +127,4 @@
             direction=direction,
             axes_pad=axes_pad,
-            add_all=add_all,
             share_all=share_all,
             label_mode=label_mode,
Index: /issm/trunk/src/m/plot/processdata.m
===================================================================
--- /issm/trunk/src/m/plot/processdata.m	(revision 26743)
+++ /issm/trunk/src/m/plot/processdata.m	(revision 26744)
@@ -164,5 +164,5 @@
 			data(pos,:)=maskvalue;
 		else
-			disp('plotmodel warning: mask length not supported yet (supported length are numberofvertices and numberofelements');
+			disp('Warning: processdata.m: mask length not supported yet (supported length are numberofvertices and numberofelements');
 		end
 	end
@@ -194,5 +194,5 @@
 			data(md.mesh.elements(pos,:),:)=maskvalue;
 		else
-			disp('plotmodel warning: mask length not supported yet (supported length are numberofvertices and numberofelements');
+			disp('Warning: processdata.m: mask length not supported yet (supported length are numberofvertices and numberofelements');
 		end
 	end
@@ -236,5 +236,5 @@
 			data(md.mesh.elements(pos,:),:)=NaN;
 		else
-			disp('plotmodel warning: mask length not supported yet (supported length are numberofvertices and numberofelements');
+			disp('Warning: processdata.m: mask length not supported yet (supported length are numberofvertices and numberofelements');
 		end
 	end
Index: /issm/trunk/src/m/plot/processdata.py
===================================================================
--- /issm/trunk/src/m/plot/processdata.py	(revision 26743)
+++ /issm/trunk/src/m/plot/processdata.py	(revision 26744)
@@ -15,5 +15,5 @@
     See also: PLOTMODEL, PROCESSMESH
     """
-    # {{{ Initialization and grabbing auxiliaries
+    # Initialization and grabbing auxiliaries {{{
     # check format
     if (len(data) == 0 or (len(data) == 1 and not isinstance(data, dict) and np.isnan(data).all())):
@@ -22,8 +22,15 @@
     if 'numberofvertices2d' in dir(md.mesh):
         numberofvertices2d = md.mesh.numberofvertices2d
-        numberofelements2d = md.mesh.numberofelements2d
     else:
         numberofvertices2d = np.nan
-        numberofelements2d = np.nan
+
+    if options.exist('amr'):
+        step = options.getfieldvalue('amr', 0)
+        numberofvertices = len(md.results.TransientSolution[step].MeshX)
+        numberofelements = np.shape(md.results.TransientSolution[step].MeshElements)[0]
+    else:
+        numberofvertices = md.mesh.numberofvertices
+        numberofelements = md.mesh.numberofelements
+
     procdata = np.copy(data)
     #initialize datatype
@@ -44,5 +51,93 @@
         raise ValueError('data passed to plotmodel has bad dimensions; check that column vectors are rank - 1')
     # }}}
-    # {{{ process NaN's if any
+
+    #  log {{{
+    if options.exist('log'):
+        cutoff = options.getfieldvalue('log', 1)
+        procdata[np.where(procdata < cutoff)] = cutoff
+    # }}}
+
+    #  quiver plot {{{
+    if datasize[1] > 1 and datasize[0] != numberofvertices + 1:
+        if datasize[0] == numberofvertices and datasize[1] == 2:
+            datatype = 3
+        else:
+            raise ValueError('plotmodel error message: data should have two columns of length md.mesh.numberofvertices for a quiver plot')
+    # }}}
+
+    #  element data{{{
+    if datasize[0] == numberofelements and datasize[1] == 1:
+        #initialize datatype if non patch
+        if datatype != 4 and datatype != 5:
+            datatype = 1
+        # AMR {{{
+        if options.exist('amr'):
+            nonan = np.nonzero(~np.isnan(md.results.TransientSolution[step].MeshElements))
+            procdata = procdata[nonan]
+        # }}}
+        # mask {{{
+        if options.exist('mask'):
+            flags = options.getfieldvalue('mask')
+            hide = np.invert(flags)
+            if np.size(flags) == numberofvertices:
+                EltMask = np.asarray([np.any(np.in1d(index, np.where(hide))) for index in md.mesh.elements - 1])
+                procdata = np.ma.array(procdata, mask=EltMask)
+                options.addfielddefault('cmap_set_bad', 'w')
+            elif np.size(flags) == numberofelements:
+                procdata = np.ma.array(procdata, mask=hide)
+                options.addfielddefault('cmap_set_bad', 'w')
+            else:
+                print('Warning: processdata.py: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')
+        # }}}
+
+    # }}}
+
+    #  node data {{{
+    if datasize[0] in [numberofvertices, numberofvertices2d] and datasize[1] == 1:
+        datatype = 2
+        # AMR {{{
+        if options.exist('amr'):
+            nonan = np.nonzero(~np.isnan(md.results.TransientSolution[step].MeshX))
+            procdata = procdata[nonan]
+        # }}}
+        #  Mask {{{
+        if options.exist('mask'):
+            flags = options.getfieldvalue('mask')
+            hide = np.invert(flags)
+            if np.size(flags) == numberofvertices:
+                procdata = np.ma.array(procdata, mask=hide)
+                options.addfielddefault('cmap_set_bad', 'w')
+            elif np.size(flags) == numberofelements:
+                NodeMask = np.zeros(np.shape(md.mesh.x), dtype=bool)
+                HideElt = md.mesh.elements[np.where(hide)[0]] - 1
+                NodeMask[HideElt] = True
+                procdata = np.ma.array(procdata, mask=NodeMask)
+                options.addfielddefault('cmap_set_bad', 'w')
+            else:
+                print('Warning: processdata.py: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')
+        # }}}
+    # }}}
+
+    #  spc time series {{{
+    if datasize[0] == numberofvertices + 1:
+        datatype = 2
+        spccol = options.getfieldvalue('spccol', 0)
+        print('multiple-column spc field; specify column to plot using option "spccol"')
+        print(('column ', spccol, ' plotted for time: ', procdata[-1, spccol]))
+        procdata = procdata[0:-1, spccol]
+
+        #mask?
+
+        #layer projection?
+
+        #control arrow density if quiver plot
+    # }}}
+
+    # convert rank - 2 array to rank - 1 {{{
+    if np.ndim(procdata) == 2 and np.shape(procdata)[1] == 1:
+        procdata = procdata.reshape(-1, )
+    # }}}
+
+    #  process NaN's if any {{{
     nanfill = options.getfieldvalue('nan', -9999)
     if np.any(np.isnan(procdata)):
@@ -53,83 +148,13 @@
             ub = ub + 0.5
             nanfill = lb - 1
-    #procdata[np.isnan(procdata)] = nanfill
+        procdata[np.isnan(procdata)] = nanfill
         procdata = np.ma.array(procdata, mask=np.isnan(procdata))
-        options.addfielddefault('clim', [lb, ub])
+        #clim looks to be deprecated and replaced by caxis
+        #options.addfielddefault('clim', [lb, ub])
         options.addfielddefault('cmap_set_under', '1')
         print(("WARNING: nan's treated as", nanfill, "by default.  Change using pairoption 'nan', nan_fill_value in plotmodel call"))
     # }}}
-    # {{{ log
-    if options.exist('log'):
-        cutoff = options.getfieldvalue('log', 1)
-        procdata[np.where(procdata < cutoff)] = cutoff
-    # }}}
-    # {{{ quiver plot
-    if datasize[1] > 1 and datasize[0] != md.mesh.numberofvertices + 1:
-        if datasize[0] == md.mesh.numberofvertices and datasize[1] == 2:
-            datatype = 3
-        else:
-            raise ValueError('plotmodel error message: data should have two columns of length md.mesh.numberofvertices for a quiver plot')
-    # }}}
-    # {{{ element data
 
-    if datasize[0] == md.mesh.numberofelements and datasize[1] == 1:
-        #initialize datatype if non patch
-        if datatype != 4 and datatype != 5:
-            datatype = 1
-    # {{{mask
-        if options.exist('mask'):
-            flags = options.getfieldvalue('mask')
-            hide = np.invert(flags)
-            if np.size(flags) == md.mesh.numberofvertices:
-                EltMask = np.asarray([np.any(np.in1d(index, np.where(hide))) for index in md.mesh.elements - 1])
-                procdata = np.ma.array(procdata, mask=EltMask)
-                options.addfielddefault('cmap_set_bad', 'w')
-            elif np.size(flags) == md.mesh.numberofelements:
-                procdata = np.ma.array(procdata, mask=hide)
-                options.addfielddefault('cmap_set_bad', 'w')
-            else:
-                print('plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')
-    # }}}
-
-    # }}}
-    # {{{ node data
-    if datasize[0] == md.mesh.numberofvertices and datasize[1] == 1:
-        datatype = 2
-    # {{{ Mask
-        if options.exist('mask'):
-            flags = options.getfieldvalue('mask')
-            hide = np.invert(flags)
-            if np.size(flags) == md.mesh.numberofvertices:
-                procdata = np.ma.array(procdata, mask=hide)
-                options.addfielddefault('cmap_set_bad', 'w')
-            elif np.size(flags) == md.mesh.numberofelements:
-                NodeMask = np.zeros(np.shape(md.mesh.x), dtype=bool)
-                HideElt = md.mesh.elements[np.where(hide)[0]] - 1
-                NodeMask[HideElt] = True
-                procdata = np.ma.array(procdata, mask=NodeMask)
-                options.addfielddefault('cmap_set_bad', 'w')
-            else:
-                print('plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')
-    # }}}
-    # }}}
-    # {{{ spc time series
-    if datasize[0] == md.mesh.numberofvertices + 1:
-        datatype = 2
-        spccol = options.getfieldvalue('spccol', 0)
-        print('multiple-column spc field; specify column to plot using option "spccol"')
-        print(('column ', spccol, ' plotted for time: ', procdata[-1, spccol]))
-        procdata = procdata[0:-1, spccol]
-
-    #mask?
-
-    #layer projection?
-
-    #control arrow density if quiver plot
-    # }}}
-    # {{{ convert rank - 2 array to rank - 1
-    if np.ndim(procdata) == 2 and np.shape(procdata)[1] == 1:
-        procdata = procdata.reshape(-1, )
-    # }}}
-    # {{{ if datatype is still zero, error out
+    #  if datatype is still zero, error out {{{
     if datatype == 0:
         raise ValueError("processdata error: data provided not recognized or not supported")
Index: /issm/trunk/src/m/plot/processmesh.py
===================================================================
--- /issm/trunk/src/m/plot/processmesh.py	(revision 26743)
+++ /issm/trunk/src/m/plot/processmesh.py	(revision 26744)
@@ -41,12 +41,22 @@
     if hasattr(md.mesh, 'elements2d'):
         elements2d = md.mesh.elements2d
+        numofvertices2d = md.mesh.numberofvertices2d
+        numofelements2d = md.mesh.numberofelements2d
+    else:
+        numofvertices2d = np.nan
+        numofelements2d = np.nan
 
     if options.exist('amr'):
         step = options.getfieldvalue('amr')
-        x = md.results.TransientSolution[step].MeshX
-        y = md.results.TransientSolution[step].MeshY
-        elements = md.results.TransientSolution[step].MeshElements
+        nonan = np.nonzero(~np.isnan(md.results.TransientSolution[step].MeshX))
+        x = md.results.TransientSolution[step].MeshX[nonan]
+        y = md.results.TransientSolution[step].MeshY[nonan]
+        nonan = np.nonzero(~np.isnan(md.results.TransientSolution[step].MeshElements))
+        elements = md.results.TransientSolution[step].MeshElements[nonan] - 1
+        eldim = np.shape(md.results.TransientSolution[step].MeshElements)[1]
+        elements = np.reshape(elements, ((int(len(elements) / eldim), eldim)))
+
     else:
-        elements = md.mesh.elements
+        elements = md.mesh.elements - 1
         if options.getfieldvalue('coord', 'xy') != 'latlon':
             x = md.mesh.x
@@ -65,14 +75,13 @@
         z = getattr(md, z)
 
+    force2D = numofelements2d in np.shape(data) or numofvertices2d in np.shape(data)
     #is it a 2D plot?
-    if md.mesh.dimension() == 2 or options.getfieldvalue('layer', 0) >= 1:
+    if md.mesh.dimension() == 2 or options.getfieldvalue('layer', 0) >= 1 or force2D:
         is2d = 1
     else:
         is2d = 0
 
-    elements = md.mesh.elements - 1
-
     #layer projection?
-    if options.getfieldvalue('layer', 0) >= 1:
+    if options.getfieldvalue('layer', 0) >= 1 or force2D:
         if options.getfieldvalue('coord', 'xy') == 'latlon':
             raise Exception('processmesh error message: cannot work with 3D meshes for now')
Index: /issm/trunk/src/m/plot/radarpower.m
===================================================================
--- /issm/trunk/src/m/plot/radarpower.m	(revision 26743)
+++ /issm/trunk/src/m/plot/radarpower.m	(revision 26744)
@@ -29,5 +29,5 @@
 d = getfieldvalue(options,'overlay_adjust_d',1);
 
-%find gdal coordinates
+%find GDAL coordinates
 x0=min(xlim); x1=max(xlim);
 y0=min(ylim); y1=max(ylim);
@@ -38,13 +38,30 @@
 	elseif md.mesh.epsg==3031, %Antarctica
 			if highres,
-				paths = {'/Users/larour/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif','/home/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_200m.tif'};
+				paths = {'/Users/larour/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif',...
+					'/home/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_200m.tif',...
+					'/totten_1/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_200m.tif',...
+					'./amm125m_v2_200m.tif',...
+					};
 			else
-				paths = {'/Users/larour/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif','/home/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_1km.tif'};
+				paths = {'/Users/larour/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif',...
+					'/home/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_1km.tif',...
+					'/totten_1/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_1km.tif',...
+					'./amm125m_v2_1km.tif',...
+					};
 			end
 	elseif md.mesh.epsg==3413,   %Greenland 
 		if highres,
-			paths = {'/u/astrid-r1b/ModelData/MOG/mog100_r2_hp1.tif','/home/ModelData/Greenland/MOG/mog100_r2_hp1.tif'};
+			paths = {'/u/astrid-r1b/ModelData/MOG/mog100_r2_hp1.tif',...
+				'/home/ModelData/Greenland/MOG/mog100_r2_hp1.tif',...
+				'/totten_1/ModelData/Greenland/MOG/mog100_r2_hp1.tif',...
+				'./mog100_r2_hp1.tif',...
+				};
 		else
-			paths = {'/u/astrid-r1b/ModelData/MOG/mog500_r2_hp1.tif','/home/ModelData/Greenland/MOG/mog500_r2_hp1.tif'};
+			paths = {'/u/astrid-r1b/ModelData/MOG/mog500_r2_hp1.tif',...
+				'/home/ModelData/Greenland/MOG/mog500_r2_hp1.tif',...
+				'/totten_1/ModelData/Greenland/MOG/mog500_r2_hp1.tif',...
+				'/Users/larour/ModelData/MOG/mog500_r2_hp1.tif',...
+				'./mog500_r2_hp1.tif',...
+				};
 		end
 	else
Index: /issm/trunk/src/m/plot/radarpower.py
===================================================================
--- /issm/trunk/src/m/plot/radarpower.py	(revision 26744)
+++ /issm/trunk/src/m/plot/radarpower.py	(revision 26744)
@@ -0,0 +1,16 @@
+def solveslm(slm, solutionstringi, *args):
+    """RADARPOWER - overlay a power radar image on an existing mesh
+
+    This routine will overlay a power radar image on an existing mesh.
+    The power amplitude will be output to vel for now.
+    In the future, think about a field to hold this value.
+
+    Usage:
+        md=radarpower(md,options);
+        md=radarpower(md)
+
+    TODO:
+    - Translate from MATLAB API as we bring Python plotting capabilities online
+    """
+
+    return md
Index: /issm/trunk/src/m/plot/subplotmodel.m
===================================================================
--- /issm/trunk/src/m/plot/subplotmodel.m	(revision 26743)
+++ /issm/trunk/src/m/plot/subplotmodel.m	(revision 26744)
@@ -4,4 +4,20 @@
 %   Usage:
 %      h=subplotmodel(nlines,ncols,i,options)
+
+box=getfieldvalue(options,'box','off');
+if strcmpi(box,'on'),
+	visible='on';
+else
+	visible='off';
+end
+
+%Do we specify axes?
+if exist(options,'axes')
+	ax = getfieldvalue(options,'axes');
+	ha = axes('Units','normalized', ...
+		'Position',ax,'XTickLabel','','YTickLabel','',...
+		'Visible',visible,'box',box);
+	return
+end
 
 %Regular subplot
@@ -25,11 +41,4 @@
 ymin   = 1-vmargin(2)-height; 
 
-box=getfieldvalue(options,'box','off');
-if strcmpi(box,'on'),
-	visible='on';
-else
-	visible='off';
-end
-
 for i = 1:nlines
 	xmin = hmargin(1);
Index: /issm/trunk/src/m/shp/shp2exp.m
===================================================================
--- /issm/trunk/src/m/shp/shp2exp.m	(revision 26743)
+++ /issm/trunk/src/m/shp/shp2exp.m	(revision 26744)
@@ -1,4 +1,4 @@
 function shp2exp(shpfilename,expfilename)
-%SHP2EXP- transform shape file to Argus .exp file
+%SHP2EXP - transform shape file to Argus .exp file
 %
 %   Usage:
@@ -48,17 +48,28 @@
 	elseif strcmpi(shp(i).Geometry,'Point'),
 		x=shp(i).X; y=shp(i).Y;
-		expstruct(end+1).x=x;
-		expstruct(end).y=y;
-		expstruct(end).nods=length(x);
-		expstruct(end).density=1;
-		expstruct(end).closed=0;
-		%exp(end).name=num2str(shp(i).id);
+		if ~isnan(x) && ~isnan(y)
+			expstruct(end+1).x=x;
+			expstruct(end).y=y;
+			expstruct(end).nods=length(x);
+			expstruct(end).density=1;
+			expstruct(end).closed=0;
+			%exp(end).name=num2str(shp(i).id);
+		end
+	elseif strcmpi(shp(i).Geometry,'PointZ'),
+		shp(i)
 	elseif strcmpi(shp(i).Geometry,'Line'),
-		x=shp(i).X; y=shp(i).Y;
-		expstruct(end+1).x=x;
-		expstruct(end).y=y;
-		expstruct(end).nods=length(x);
-		expstruct(end).density=1;
-		expstruct(end).closed=0;
+		x=shp(i).X(:); y=shp(i).Y(:);
+		pos = find(~isnan(x) & ~isnan(y));
+		idx=find(diff(pos)~=1);
+		A=[idx(1);diff(idx);numel(pos)-idx(end)];
+		Cx=mat2cell(x(pos),A,1);
+		Cy=mat2cell(y(pos),A,1);
+		for i=1:numel(Cx)
+			expstruct(end+1).x=Cx{i};
+			expstruct(end).y=Cy{i};
+			expstruct(end).nods=length(Cx{i});
+			expstruct(end).density=1;
+			expstruct(end).closed=0;
+		end
 	end
 end
Index: /issm/trunk/src/m/shp/shp2exp.py
===================================================================
--- /issm/trunk/src/m/shp/shp2exp.py	(revision 26743)
+++ /issm/trunk/src/m/shp/shp2exp.py	(revision 26744)
@@ -1,12 +1,12 @@
+import os
 import shapefile
-import os
 from expwrite import expwrite
 
 
-def shp2exp(shapefilename, * expfilename):
-    '''
-    Convert a shapefile to an .exp file.  Optionally, expfilename can be
-    specified to give a name for the .exp file to be created, otherwise the
-    .exp file will have the same prefix as the .shp file.
+def shp2exp(shapefilename, *expfilename):
+    """SHP2EXP - Convert a shapefile to an Argus .exp file. Optionally, 
+    expfilename can be specified to give a name for the .exp file to be 
+    created, otherwise the .exp file will have the same prefix as the .shp 
+    file.
 
     Usage:
@@ -15,10 +15,12 @@
 
     Examples:
-        shp2exp('Domain.shp') % creates Domain.exp
-        shp2exp('Domain.shp', 'DomainForISSM.exp')
-    '''
+        shp2exp('Domain.shp') # Creates Domain.exp
+        shp2exp('Domain.shp', 'Domain.exp')
+
+    See also EXPMASTER, EXPDOC
+    """
 
     if not os.path.exists(shapefilename):
-        raise IOError("shp2exp error message: file '%s' not found!" % shapefilename)
+        raise IOError('shp2exp error message: file {} not found!'.format(shapefilename))
     if not len(expfilename):
         expfile = os.path.splitext(shapefilename)[0] + '.exp'
@@ -33,5 +35,5 @@
     for i in range(len(shp.shapes())):
         geom = shp.shapes()[i].shapeType
-        if geom == 5:  # polygon
+        if geom == 5: # polygon
             expdict['closed'] = 1
             tmpx = [p[0] for p in shp.shapes()[i].points]
@@ -39,5 +41,5 @@
             x.append(tmpx)
             y.append(tmpy)
-        elif geom == 3:  # line
+        elif geom == 3: # line
             expdict['closed'] = 0
             tmpx = [p[0] for p in shp.shapes()[i].points]
@@ -45,5 +47,5 @@
             x.append(tmpx)
             y.append(tmpy)
-        elif geom == 1:  # point
+        elif geom == 1: # point
             expdict['closed'] = 0
             x.append(shp.shapes()[i].points[0][0])
Index: /issm/trunk/src/m/solve/WriteData.js
===================================================================
--- /issm/trunk/src/m/solve/WriteData.js	(revision 26743)
+++ /issm/trunk/src/m/solve/WriteData.js	(revision 26744)
@@ -1,3 +1,3 @@
-function WriteData(fid,prefix){
+function WriteData(fid,prefix){ //{{{
 //WRITEDATA - write model field into binary buffer 
 //
@@ -74,4 +74,9 @@
 	}
 
+	let recordlengthtype = 'int';
+	if (svnversion >= 22708) {
+		recordlengthtype = 'long long';
+	}
+
 	//Step 1: write the name to identify this record uniquely
 	fid.fwrite(name.length,'int'); 
@@ -83,5 +88,5 @@
 
 		//first write length of record
-		fid.fwrite(4+4,'int');  //1 bool (disguised as an int)+code
+		fid.fwrite(4+4,recordlengthtype);  //1 bool (disguised as an int)+code
 
 		//write data code: 
@@ -95,5 +100,5 @@
 
 		//first write length of record
-		fid.fwrite(4+4,'int');  //1 integer + code
+		fid.fwrite(4+4,recordlengthtype);  //1 integer + code
 
 		//write data code: 
@@ -107,5 +112,5 @@
 
 		//first write length of record
-		fid.fwrite(8+4,'int');  //1 double+code
+		fid.fwrite(8+4,recordlengthtype);  //1 double+code
 
 		//write data code: 
@@ -117,5 +122,5 @@
 	else if (format == 'String'){ // {{{
 		//first write length of record
-		fid.fwrite(data.length+4+4,'int');  //string + string size + code
+		fid.fwrite(data.length+4+4,recordlengthtype);  //string + string size + code
 
 		//write data code: 
@@ -128,18 +133,24 @@
 	else if (format == 'BooleanMat'){ // {{{
 
-		//Get size
-		var s=[data.length,1];
-		if(IsArray(data[0]))s[1]=data[0].length;
+		//Get size (TODO: use into matlab.js::size)
+		var s=[data.length,1]; //vector
+		if (IsArray(data[0])) { //matrix
+			s[1]=data[0].length;
+        } else if (typeof data == 'number') { //scalar
+        	s[0]=1; s[1]=1
+        } else if (data.length == 0) { //empty matrix/vector
+            s[1]=0;
+        }
 
 		//if matrix = NaN, then do not write anything
-		if (s[0]==1 & s[1]==1 & isNaN(data)){
-			s[0]=0; s[1]=0;
-		}
-		if (s[0]==1 & s[1]==1 & isNaN(data[0])){
-			s[0]=0; s[1]=0;
-		}
-
-		//first write length of record
-		fid.fwrite(4+4+8*s[0]*s[1]+4+4,'int');  //2 integers (32 bits) + the double matrix + code + matrix type
+		if (s[0]==1 && s[1]==1 && isNaN(data)){
+			s[0]=0; s[1]=0;
+		}
+		if (typeof data != 'number' && s[0]==1 && s[1]==1 && isNaN(data[0])){
+			s[0]=0; s[1]=0;
+		}
+
+		//first write length of record
+		fid.fwrite(4+4+8*s[0]*s[1]+4+4,recordlengthtype);  //2 integers (32 bits) + the double matrix + code + matrix type
 
 		//write data code and matrix type: 
@@ -154,18 +165,24 @@
 	else if (format == 'IntMat'){ // {{{
 
-		//Get size
-		var s=[data.length,1];
-		if(IsArray(data[0]))s[1]=data[0].length;
+		//Get size (TODO: use into matlab.js::size)
+		var s=[data.length,1]; //vector
+		if (IsArray(data[0])) { //matrix
+			s[1]=data[0].length;
+        } else if (typeof data == 'number') { //scalar
+        	s[0]=1; s[1]=1
+        } else if (data.length == 0) { //empty matrix/vector
+            s[1]=0;
+        }
 
 		//if matrix = NaN, then do not write anything
-		if (s[0]==1 & s[1]==1 & isNaN(data)){
-			s[0]=0; s[1]=0;
-		}
-		if (s[0]==1 & s[1]==1 & isNaN(data[0])){
-			s[0]=0; s[1]=0;
-		}
-
-		//first write length of record
-		fid.fwrite(4+4+8*s[0]*s[1]+4+4,'int');  //2 integers (32 bits) + the double matrix + code + matrix type
+		if (s[0]==1 && s[1]==1 && isNaN(data)){
+			s[0]=0; s[1]=0;
+		}
+		if (typeof data != 'number' && s[0]==1 && s[1]==1 && isNaN(data[0])){
+			s[0]=0; s[1]=0;
+		}
+
+		//first write length of record
+		fid.fwrite(4+4+8*s[0]*s[1]+4+4,recordlengthtype);  //2 integers (32 bits) + the double matrix + code + matrix type
 
 		//write data code and matrix type: 
@@ -181,14 +198,19 @@
 	else if (format == 'DoubleMat'){ // {{{
 
-		//Get size
-		var s=[data.length,1];
-		if(IsArray(data[0]))s[1]=data[0].length;
-		if(typeof data == 'number'){s[0]=1; s[1]=1}
-
+		//Get size (TODO: use into matlab.js::size)
+		var s=[data.length,1]; //vector
+		if (IsArray(data[0])) { //matrix
+			s[1]=data[0].length;
+        } else if (typeof data == 'number') { //scalar
+        	s[0]=1; s[1]=1
+        } else if (data.length == 0) { //empty matrix/vector
+            s[1]=0;
+        }
+        
 		//if matrix = NaN, then do not write anything
-		if (s[0]==1 & s[1]==1 & isNaN(data)){
-			s[0]=0; s[1]=0;
-		}
-		if (s[0]==1 & s[1]==1 & isNaN(data[0])){
+		if (s[0]==1 && s[1]==1 && isNaN(data)){
+			s[0]=0; s[1]=0;
+		}
+		if (typeof data != 'number' && s[0]==1 && s[1]==1 && isNaN(data[0])){
 			s[0]=0; s[1]=0;
 		}
@@ -197,5 +219,5 @@
 		var recordlength=4+4+8*s[0]*s[1]+4+4; //2 integers (32 bits) + the double matrix + code + matrix type
 		if (recordlength>Math.pow(2,31)) throw Error(sprintf("field '%s' cannot be marshalled because it is larger than 2^31 bytes!",name));
-		fid.fwrite(recordlength,'int');
+		fid.fwrite(recordlength,recordlengthtype);
 
 		//write data code and matrix type: 
@@ -224,5 +246,5 @@
 
 		//write length of record
-		fid.fwrite(recordlength,'int'); 
+		fid.fwrite(recordlength,recordlengthtype); 
 
 		//write data code: 
@@ -247,5 +269,5 @@
 		//first get length of string array: 
 		num=data.length;
-		if ((typeof data[0] == 'numeric') & num==1 & isNaN(data[0])){
+		if ((typeof data[0] == 'number') & num==1 & isNaN(data[0])){
 			num = 0;
 		}
@@ -259,5 +281,5 @@
 
 		//write length of record
-		fid.fwrite(recordlength,'int'); 
+		fid.fwrite(recordlength,recordlengthtype); 
 
 		//write data code: 
@@ -278,6 +300,5 @@
 					format.toString(),name));
 	}
-}
-
+} //}}}
 function FormatToCode(format){ // {{{
 	//This routine takes the format string, and hardcodes it into an integer, which 
Index: /issm/trunk/src/m/solve/WriteData.py
===================================================================
--- /issm/trunk/src/m/solve/WriteData.py	(revision 26743)
+++ /issm/trunk/src/m/solve/WriteData.py	(revision 26744)
@@ -67,5 +67,10 @@
                 #We scale everything but the last line that holds time
                 data[:-1, :] = scale * data[:-1, :]
-            else:
+            elif type(data) is list: # Deal with "TypeError: can't multiply sequence by non-int of type 'float'" for type list
+                scaleddata = []
+                for i in range(len(data)):
+                    scaleddata.append(scale * data[i])
+                data = scaleddata
+            else: #
                 data = scale * data
         if np.ndim(data) > 1 and data.shape[0] == timeserieslength:
Index: /issm/trunk/src/m/solve/loadresultfromdisk.m
===================================================================
--- /issm/trunk/src/m/solve/loadresultfromdisk.m	(revision 26743)
+++ /issm/trunk/src/m/solve/loadresultfromdisk.m	(revision 26744)
@@ -49,4 +49,9 @@
 					N=fread(fid,1,'int');
 					field=fread(fid,[N M],'int')';
+				elseif type==5,
+					N=fread(fid,1,'int');
+					fieldr=fread(fid,[N M],'double')';
+					fieldi=fread(fid,[N M],'double')';
+					field=complex(fieldr,fieldi);
 				else
 					error(['cannot read data of type ' num2str(type) ]);
Index: /issm/trunk/src/m/solve/loadresultfromdisk.py
===================================================================
--- /issm/trunk/src/m/solve/loadresultfromdisk.py	(revision 26743)
+++ /issm/trunk/src/m/solve/loadresultfromdisk.py	(revision 26744)
@@ -4,16 +4,14 @@
 
 def loadresultfromdisk(filename, step, name, *args):  # {{{
-    """
-    LOADRESULTFROMDISK - load specific result of solution sequence from disk
+    """LOADRESULTFROMDISK - load specific result of solution sequence from disk
     file "filename"
 
-        Usage:
-            variable = loadresultsfromdisk(filename, step, name)
+    Usage:
+        variable = loadresultsfromdisk(filename, step, name)
 
-        TODO:
-        - Test this module against output of src/m/solve/loadresultsfromdisk.m
+    TODO:
+    - Test this module against output of src/m/solve/loadresultsfromdisk.m
     """
-    print('Got hwrwefew')
-    exit()
+
     # Open file
     try:
@@ -59,4 +57,17 @@
                 for i in range(M):
                     field[i, :] = struct.unpack('{}i'.format(N), fid.read(N * struct.calcsize('i')))
+            elif datatype == 5:
+                # TODO:
+                # - Check that the following results in the same output as 
+                # MATLAB
+                #
+                N = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+                fieldr = np.zeros(shape=(M, N), dtype=float)
+                fieldi = np.zeros(shape=(M, N), dtype=float)
+                for i in range(M):
+                    fieldr[i, :] = struct.unpack('{}d'.format(N), fid.read(N * struct.calcsize('d')))
+                    fieldi[i, :] = struct.unpack('{}d'.format(N), fid.read(N * struct.calcsize('d')))
+                field = np.vectorize(complex)(fieldr, fieldi)
+                print(field)
             else:
                 raise TypeError("cannot read data of type {}".format(datatype))
Index: /issm/trunk/src/m/solve/loadresultsfromcluster.m
===================================================================
--- /issm/trunk/src/m/solve/loadresultsfromcluster.m	(revision 26743)
+++ /issm/trunk/src/m/solve/loadresultsfromcluster.m	(revision 26744)
@@ -4,7 +4,9 @@
 %   Usage:
 %      md=loadresultsfromcluster(md,varargin);
-%      options include:
-%         - runtimename
-%         - nolog.
+%
+%      Options include: 'runtimename', 'nolog'
+%
+%   Example:
+%     md=loadresultsfromcluster(md,'runtimename','test101-06-15-2021-13-24-18-4883');
 
 %process options: 
Index: /issm/trunk/src/m/solve/loadresultsfromcluster.py
===================================================================
--- /issm/trunk/src/m/solve/loadresultsfromcluster.py	(revision 26743)
+++ /issm/trunk/src/m/solve/loadresultsfromcluster.py	(revision 26744)
@@ -1,19 +1,20 @@
 import os
-import socket
+import subprocess
 
 from helpers import *
 from loadresultsfromdisk import loadresultsfromdisk
-from MatlabFuncs import ispc
+from MatlabFuncs import *
 from pairoptions import pairoptions
 
 
-def remove(filename):
+def remove(filename):  #{{{
     try:
         os.remove(filename)
     except OSError:
         print(('WARNING: ' + filename + ' does not exist'))
+# }}}
 
 
-def loadresultsfromcluster(md, *args):
+def loadresultsfromcluster(md, *args):  #{{{
     """LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
 
@@ -21,4 +22,9 @@
         md = loadresultsfromcluster(md)
         md = loadresultsfromcluster(md, 'runtimename', runtimename)
+
+        Options include: 'runtimename', 'nolog'
+
+    Example:
+        md = loadresultsfromcluster(md, 'runtimename', 'test101-06-15-2021-13-24-18-4883')
     """
 
@@ -63,5 +69,5 @@
 
     # Erase input file if run was carried out on same platform
-    hostname = socket.gethostname()
+    hostname = oshostname()
     if hostname == cluster.name:
         remove(md.miscellaneous.name + '.bin')
@@ -75,2 +81,3 @@
 
     return md
+# }}}
Index: /issm/trunk/src/m/solve/loadresultsfromdisk.m
===================================================================
--- /issm/trunk/src/m/solve/loadresultsfromdisk.m	(revision 26743)
+++ /issm/trunk/src/m/solve/loadresultsfromdisk.m	(revision 26744)
@@ -12,5 +12,4 @@
 
 if ~md.qmu.isdakota,
-
 	%Check that file exists
 	if ~exist(filename,'file'),
Index: /issm/trunk/src/m/solve/loadresultsfromdisk.py
===================================================================
--- /issm/trunk/src/m/solve/loadresultsfromdisk.py	(revision 26743)
+++ /issm/trunk/src/m/solve/loadresultsfromdisk.py	(revision 26744)
@@ -16,5 +16,5 @@
     # Check number of inputs/outputs
     if not md or not filename:
-        raise ValueError("loadresultsfromdisk: error message.")
+        raise ValueError('loadresultsfromdisk: error message.')
 
     if not md.qmu.isdakota:
@@ -31,5 +31,5 @@
             return
 
-        # Initialize md.results if not a structure yet
+        # Initialize md.results if it is not a structure yet
         if not isinstance(md.results, results):
             md.results = results()
@@ -38,5 +38,5 @@
         structure = parseresultsfromdisk(md, filename, not md.settings.io_gather)
         if not structure:
-            raise RuntimeError("No result found in binary file '{}'. Check for solution crash.".format(filename))
+            raise RuntimeError('No result found in binary file \'{}\'. Check for solution crash.'.format(filename))
         if not hasattr(structure[0], 'SolutionType'):
             if hasattr(structure[-1], 'SolutionType'):
@@ -64,5 +64,5 @@
 
         if getattr(md.results, structure[0].SolutionType)[0].errlog:
-            print("loadresultsfromdisk info message: error during solution. Check your errlog and outlog model fields.")
+            print('loadresultsfromdisk info message: error during solution. Check your errlog and outlog model fields.')
 
         # If only one solution, extract it from list for user friendliness
Index: /issm/trunk/src/m/solve/marshall.m
===================================================================
--- /issm/trunk/src/m/solve/marshall.m	(revision 26743)
+++ /issm/trunk/src/m/solve/marshall.m	(revision 26744)
@@ -44,9 +44,9 @@
 st=fclose(fid);
 
-% Uncomment the following to make a copy of the binary input file for debugging 
-% purposes (can be fed into scripts/ReadBin.py).
-% copyfile([md.miscellaneous.name '.bin'], [md.miscellaneous.name '.m.bin'])
-
 if st==-1,
 	error(['marshall error message: could not close file ' [md.miscellaneous.name '.bin']]);
 end
+
+% Uncomment the following to make a copy of the binary input file for debugging 
+% purposes (can be fed into scripts/BinRead.py).
+% copyfile([md.miscellaneous.name '.bin'], [md.miscellaneous.name '.m.bin'])
Index: /issm/trunk/src/m/solve/marshall.py
===================================================================
--- /issm/trunk/src/m/solve/marshall.py	(revision 26743)
+++ /issm/trunk/src/m/solve/marshall.py	(revision 26744)
@@ -17,5 +17,5 @@
         print("marshalling file {}.bin".format(md.miscellaneous.name))
 
-    #open file for binary writing
+    # Open file for binary writing
     try:
         fid = open(md.miscellaneous.name + '.bin', 'wb')
@@ -26,15 +26,15 @@
     fields.sort() # sort fields so that comparison of binary files is easier
     for field in fields:
-        #Some properties do not need to be marshalled
+        # Some properties do not need to be marshalled
         if field in ['results', 'radaroverlay', 'toolkits', 'cluster', 'private']:
             continue
 
-        #Check that current field is an object
+        # Check that current field is an object
         if not hasattr(getattr(md, field), 'marshall'):
             raise TypeError("field '{}' is not an object.".format(field))
 
-        #Marshall current object
-        #print "marshalling %s ..." % field #Uncomment for debugging
-        exec("md.{}.marshall('md.{}', md, fid)".format(field, field))
+        # Marshall current object
+        #print('marshalling {} ...'.format(field) # Uncomment for debugging
+        exec('md.{}.marshall(\'md.{}\', md, fid)'.format(field, field))
 
     #Last, write "md.EOF" to make sure that the binary file is not corrupt
@@ -45,9 +45,9 @@
         fid.close()
 
-        # Uncomment the following to make a copy of the binary input file for 
-        # debugging purposes (can be fed into scripts/ReadBin.py).
-        # copy_cmd = "cp {}.bin {}.py.bin".format(md.miscellaneous.name, md.miscellaneous.name)
-        # subprocess.call(copy_cmd, shell=True)
+    except IOError as e:
+        print('marshall error message: could not close file \'{}.bin\' due to:'.format(md.miscellaneous.name), e)
 
-    except IOError as e:
-        print("marshall error message: could not close file '{}.bin' due to:".format(md.miscellaneous.name), e)
+    # Uncomment the following to make a copy of the binary input file for 
+    # debugging purposes (can be fed into scripts/BinRead.py).
+    # copy_cmd = 'cp {}.bin {}.py.bin'.format(md.miscellaneous.name, md.miscellaneous.name)
+    # subprocess.call(copy_cmd, shell=True)
Index: /issm/trunk/src/m/solve/parseresultsfromdisk.m
===================================================================
--- /issm/trunk/src/m/solve/parseresultsfromdisk.m	(revision 26743)
+++ /issm/trunk/src/m/solve/parseresultsfromdisk.m	(revision 26744)
@@ -225,4 +225,20 @@
 	elseif strcmp(fieldname,'Vel'),
 		field = field*yts;
+	elseif strcmp(fieldname,'VxShear'),
+		field = field*yts;
+	elseif strcmp(fieldname,'VyShear'),
+		field = field*yts;
+	elseif strcmp(fieldname,'VxBase'),
+		field = field*yts;
+	elseif strcmp(fieldname,'VyBase'),
+		field = field*yts;
+	elseif strcmp(fieldname,'VxSurface'),
+		field = field*yts;
+	elseif strcmp(fieldname,'VySurface'),
+		field = field*yts;
+	elseif strcmp(fieldname,'VxAverage'),
+		field = field*yts;
+	elseif strcmp(fieldname,'VyAverage'),
+		field = field*yts;
 	elseif strcmp(fieldname,'BasalforcingsGroundediceMeltingRate'),
 		field = field*yts;
@@ -251,4 +267,6 @@
 	elseif strcmp(fieldname,'SmbPrecipitation'),
 		field = field*yts;
+	elseif strcmp(fieldname,'SmbRain'),
+		field = field*yts;
 	elseif strcmp(fieldname,'SmbRunoff'),
 		field = field*yts;
@@ -266,4 +284,6 @@
 		field = field*yts;
 	elseif strcmp(fieldname,'SmbMAdd'),
+		field = field*yts;
+	elseif strcmp(fieldname,'SmbWAdd'),
 		field = field*yts;
 	elseif strcmp(fieldname,'CalvingCalvingrate'),
Index: /issm/trunk/src/m/solve/parseresultsfromdisk.py
===================================================================
--- /issm/trunk/src/m/solve/parseresultsfromdisk.py	(revision 26743)
+++ /issm/trunk/src/m/solve/parseresultsfromdisk.py	(revision 26744)
@@ -80,5 +80,5 @@
         fid = open(filename, 'rb')
     except IOError as e:
-        raise IOError("parseresultsfromdisk error message: could not open {} for binary reading".format(filename))
+        raise IOError('parseresultsfromdisk error message: could not open {} for binary reading'.format(filename))
 
     # Collect all results in a list
@@ -127,9 +127,9 @@
     """
 
-    #read field
+    # Read field
     try:
         length = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
         fieldname = struct.unpack('{}s'.format(length), fid.read(length))[0][:-1]
-        fieldname = fieldname.decode()  #strings are binaries when stored so need to be converted back
+        fieldname = fieldname.decode() # strings are binaries when stored so need to be converted back
         time = struct.unpack('d', fid.read(struct.calcsize('d')))[0]
         step = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
@@ -145,5 +145,5 @@
         elif datatype == 3:
             N = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
-    #field = transpose(fread(fid, [N M], 'double'))
+            #field = transpose(fread(fid, [N M], 'double'))
             field = np.zeros(shape=(M, N), dtype=float)
             for i in range(M):
@@ -152,5 +152,5 @@
         elif datatype == 4:
             N = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
-    # field = transpose(fread(fid, [N M], 'int'))
+            #field = transpose(fread(fid, [N M], 'int'))
             field = np.zeros(shape=(M, N), dtype=int)
             for i in range(M):
@@ -158,7 +158,7 @@
 
         else:
-            raise TypeError("cannot read data of datatype {}".format(datatype))
-
-        #Process units here FIXME: this should not be done here!
+            raise TypeError('cannot read data of datatype {}'.format(datatype))
+
+        # Process units here FIXME: this should not be done here!
         yts = md.constants.yts
         if fieldname == 'BalancethicknessThickeningRate':
@@ -176,4 +176,20 @@
         elif fieldname == 'Vel':
             field = field * yts
+        elif fieldname == 'VxShear':
+            field = field * yts
+        elif fieldname == 'VyShear':
+            field = field * yts
+        elif fieldname == 'VxBase':
+            field = field * yts
+        elif fieldname == 'VyBase':
+            field = field * yts
+        elif fieldname == 'VxSurface':
+            field = field * yts
+        elif fieldname == 'VySurface':
+            field = field * yts
+        elif fieldname == 'VxAverage':
+            field = field * yts
+        elif fieldname == 'VyAverage':
+            field = field * yts
         elif fieldname == 'BasalforcingsGroundediceMeltingRate':
             field = field * yts
@@ -181,25 +197,27 @@
             field = field * yts
         elif fieldname == 'TotalFloatingBmb':
-            field = field / 10.**12 * yts  #(GigaTon/year)
+            field = field / pow(10.0, 12) * yts # (GigaTon/year)
         elif fieldname == 'TotalFloatingBmbScaled':
-            field = field / 10.**12 * yts  #(GigaTon/year)
+            field = field / pow(10.0, 12) * yts # (GigaTon/year)
         elif fieldname == 'TotalGroundedBmb':
-            field = field / 10.**12 * yts  #(GigaTon/year)
+            field = field / pow(10.0, 12) * yts # (GigaTon/year)
         elif fieldname == 'TotalGroundedBmbScaled':
-            field = field / 10.**12 * yts  #(GigaTon/year)
+            field = field / pow(10.0, 12) * yts # (GigaTon/year)
         elif fieldname == 'TotalSmb':
-            field = field / 10.**12 * yts  #(GigaTon/year)
+            field = field / pow(10.0, 12) * yts # (GigaTon/year)
         elif fieldname == 'TotalSmbScaled':
-            field = field / 10.**12 * yts  #(GigaTon/year)
+            field = field / pow(10.0, 12) * yts # (GigaTon/year)
         elif fieldname == 'GroundinglineMassFlux':
-            field = field / 10.**12 * yts  #(GigaTon/year)
+            field = field / pow(10.0, 12) * yts # (GigaTon/year)
         elif fieldname == 'IcefrontMassFlux':
-            field = field / 10.**12 * yts  #(GigaTon/year)
+            field = field / pow(10.0, 12) * yts # (GigaTon/year)
         elif fieldname == 'IcefrontMassFluxLevelset':
-            field = field / 10.**12 * yts  #(GigaTon/year)
+            field = field / pow(10.0, 12) * yts # (GigaTon/year)
         elif fieldname == 'SmbMassBalance':
             field = field * yts
         elif fieldname == 'SmbPrecipitation':
             field = field * yts
+        elif fieldname == 'SmbRain':
+            field = field * yts
         elif fieldname == 'SmbRunoff':
             field = field * yts
@@ -217,4 +235,6 @@
             field = field * yts
         elif fieldname == 'SmbMAdd':
+            field = field * yts
+        elif fieldname == 'SmbWAdd':
             field = field * yts
         elif fieldname == 'CalvingCalvingrate':
Index: /issm/trunk/src/m/solve/solve.js
===================================================================
--- /issm/trunk/src/m/solve/solve.js	(revision 26743)
+++ /issm/trunk/src/m/solve/solve.js	(revision 26744)
@@ -1,90 +1,116 @@
-function solve(md, solutionstring) {//{{{
-/**
- * SOLVE - apply solution sequence for this model
- *
- *	Usage:
- *		solve(md, solutionstring, varargin);
- *		where varargin is a list of paired arguments of string OR enums
- *
- *	solution types available comprise:
- *		- 'Stressbalance'		or 'sb'
- *		- 'Masstransport'		or 'mt'
- *		- 'Thermal'				or 'th'
- *		- 'Steadystate'			or 'ss'
- *		- 'Transient'			or 'tr'
- *		- 'Balancethickness'	or 'mc'
- *		- 'Balancevelocity'		or 'bv'
- *		- 'BedSlope'			or 'bsl'
- *		- 'SurfaceSlope'		or 'ssl'
- *		- 'Hydrology'			or 'hy'
- *		- 'DamageEvolution'		or 'da'
- *		- 'Gia'					or 'gia'
- *		- 'Sealevelrise'		or 'slr'
- *
- *	extra options:
- *		- loadonly    		: do not solve, only load results
- *		- runtimename 		: true or false (default is true), makes name unique
- *		- checkconsistency 	: 'yes' or 'no' (default is 'yes'), ensures checks on consistency of model
- *		- restart			: directory name (relative to the execution directory) where the restart file is located
- *		- successCallback	: callback function to be called on success
- *		- errorCallback		: callback function to be called on error
- *
- *	reporting:
- *		With no optional arguments for reporting, progress and error reporting is written to the DOM element with ID 'solve-button'.
- *		- solveButtonId		: overrides default solve button ID
- *		- callout			: Callout to report progress/errors to; overrides reporting to solve button
- *		- withProgressBar	: reports progress of certain solution stages with a progress bar; will not display if a Callout has not been provided
- *
- *	Examples:
- *		md = solve(md, 'Stressbalance');
- *		md = solve(md, 'sb');
- */
-	if (typeof solutionstring !== 'string') {
-		throw Error(sprintf("%s\n", "ISSM's solve function only accepts strings for solution sequences. Type help solve to get a list of supported solutions."));
-	}
-
-	//recover and process solve options
-	let solutionStringLowerCase = solutionstring.toLowerCase();
-	
-	if ((solutionStringLowerCase === 'sb') || (solutionStringLowerCase === 'stressbalance')) {
+async function solve(md, solutionstring, ...varargin) { //{{{
+/*
+SOLVE - apply solution sequence for this model
+
+Usage:
+	solve(md, solutionstring[, ...]);
+
+where varargin is a list of paired arguments of string OR enums
+
+Solution types available comprise:
+- 'Stressbalance'			or 'sb'
+- 'Masstransport'			or 'mt'
+- 'Oceantransport'			or 'oceant'
+- 'Thermal'					or 'th'
+- 'Steadystate'				or 'ss'
+- 'Transient'				or 'tr'
+- 'Balancethickness'		or 'mc'
+- 'BalancethicknessSoft'	or 'mcsoft'
+- 'Balancevelocity'			or 'bv'
+- 'BedSlope'				or 'bsl'
+- 'SurfaceSlope'			or 'ssl'
+- 'Hydrology'				or 'hy'
+- 'DamageEvolution'			or 'da'
+- 'Gia'						or 'gia'
+- 'Love'					or 'lv'
+- 'Esa'						or 'esa'
+- 'Sampling'				or 'smp'
+- 'Gmsh'
+
+Extra options (these all need to be passed in via the third parameter, which is 
+a rest parameter):
+- loadonly    		: do not solve, only load results
+- runtimename 		: true or false (default is true); makes name unique
+- checkconsistency 	: true or false (default is true); checks consistency of model
+- restart			: directory name (relative to the execution directory) where the restart file is located
+
+Examples:
+	md = solve(md, 'Stressbalance');
+	md = solve(md, 'sb');
+	
+NOTE:
+- We do not strictly need to return md as objects are passed by reference in 
+JavaScript, but we do so to mirror MATLAB and Python APIs.
+
+TODO:
+- Refactor UI reporting structure so we do not have to check if it is defined
+*/	
+ 
+/*
+	// Check that md exists and that it is a model
+ 	if (md === null || md === undefined || md.constructor.name !== 'model') {
+ 		throw new Error('md needs to be an instance of the model class');
+ 	}
+*/
+	
+	if (typeof(solutionstring) !== 'string') {
+		throw new Error('ISSM\'s solve function only accepts strings for solution sequences. Type help solve to get a list of supported solutions.');
+	}
+
+	// Recover and process solve options
+	if (vesl.strings.strcmpi(solutionstring, 'sb') || vesl.strings.strcmpi(solutionstring, 'Stressbalance')) {
 		solutionstring = 'StressbalanceSolution';
-	} else if ((solutionStringLowerCase === 'mt') || (solutionStringLowerCase === 'masstransport')) {
+	} else if (vesl.strings.strcmpi(solutionstring, 'mt') || vesl.strings.strcmpi(solutionstring, 'Masstransport')) {
 		solutionstring = 'MasstransportSolution';	
-	} else if ((solutionStringLowerCase === 'th') || (solutionStringLowerCase === 'thermal')) {
+	} else if (vesl.strings.strcmpi(solutionstring, 'oceant') || vesl.strings.strcmpi(solutionstring, 'Oceantransport')) {
+		solutionstring = 'OceantransportSolution';	
+	} else if (vesl.strings.strcmpi(solutionstring, 'th') || vesl.strings.strcmpi(solutionstring, 'Thermal')) {
 		solutionstring = 'ThermalSolution';
-	} else if ((solutionStringLowerCase === 'st') || (solutionStringLowerCase === 'steadystate')) {
+	} else if (vesl.strings.strcmpi(solutionstring, 'st') || vesl.strings.strcmpi(solutionstring, 'Steadystate')) {
 		solutionstring = 'SteadystateSolution';
-	} else if ((solutionStringLowerCase === 'tr') || (solutionStringLowerCase === 'transient')) {
+	} else if (vesl.strings.strcmpi(solutionstring, 'tr') || vesl.strings.strcmpi(solutionstring, 'Transient')) {
 		solutionstring = 'TransientSolution';
-	} else if ((solutionStringLowerCase === 'mc') || (solutionStringLowerCase === 'balancethickness')) {
+	} else if (vesl.strings.strcmpi(solutionstring, 'mc') || vesl.strings.strcmpi(solutionstring, 'Balancethickness')) {
 		solutionstring = 'BalancethicknessSolution';
-	} else if ((solutionStringLowerCase === 'bv') || (solutionStringLowerCase === 'balancevelocity')) {
+	} else if (vesl.strings.strcmpi(solutionstring, 'mcsoft') || vesl.strings.strcmpi(solutionstring, 'BalancethicknessSoft')) {
+		solutionstring = 'BalancethicknessSoftSolution';
+	} else if (vesl.strings.strcmpi(solutionstring, 'bv') || vesl.strings.strcmpi(solutionstring, 'Balancevelocity')) {
 		solutionstring = 'BalancevelocitySolution';
-	} else if ((solutionStringLowerCase === 'bsl') || (solutionStringLowerCase === 'bedslope')) {
+	} else if (vesl.strings.strcmpi(solutionstring, 'bsl') || vesl.strings.strcmpi(solutionstring, 'BedSlope')) {
 		solutionstring = 'BedSlopeSolution';
-	} else if ((solutionStringLowerCase === 'ssl') || (solutionStringLowerCase === 'surfaceslope')) {
+	} else if (vesl.strings.strcmpi(solutionstring, 'ssl') || vesl.strings.strcmpi(solutionstring, 'SurfaceSlope')) {
 		solutionstring = 'SurfaceSlopeSolution';
-	} else if ((solutionStringLowerCase === 'hy') || (solutionStringLowerCase === 'hydrology')) {
+	} else if (vesl.strings.strcmpi(solutionstring, 'hy') || vesl.strings.strcmpi(solutionstring, 'Hydrology')) {
 		solutionstring = 'HydrologySolution';
-	} else if ((solutionStringLowerCase === 'da') || (solutionStringLowerCase === 'damageevolution')) {
+	} else if (vesl.strings.strcmpi(solutionstring, 'da') || vesl.strings.strcmpi(solutionstring, 'DamageEvolution')) {
 		solutionstring = 'DamageEvolutionSolution';
-	} else if ((solutionStringLowerCase === 'gia') || (solutionStringLowerCase === 'gia')) {
+	} else if (vesl.strings.strcmpi(solutionstring, 'gia') || vesl.strings.strcmpi(solutionstring, 'Gia')) {
 		solutionstring = 'GiaSolution';
-	} else if ((solutionStringLowerCase === 'slr') || (solutionStringLowerCase === 'sealevelrise')) {
-		solutionstring = 'SealevelriseSolution';
+	} else if (vesl.strings.strcmpi(solutionstring, 'lv') || vesl.strings.strcmpi(solutionstring, 'Love')) {
+		solutionstring = 'LoveSolution';
+	} else if (vesl.strings.strcmpi(solutionstring, 'Esa')) {
+		solutionstring = 'EsaSolution';
+	} else if (vesl.strings.strcmpi(solutionstring, 'smp') || vesl.strings.strcmpi(solutionstring, 'Sampling')) {
+		solutionstring = 'SamplingSolution';
+	} else if (vesl.strings.strcmpi(solutionstring, 'gmsh')) {
+		solutionstring = 'GmshSolution';
+	} else if (vesl.strings.strcmpi(solutionstring, 'gmt')) {
+		solutionstring = 'GmtSolution';
 	} else {
-		throw Error(sprintf("%s%s%s\n",'solutionstring ',solutionstring,' not supported!'));
-	}
-	
-	// Process options
-	let args 	= Array.prototype.slice.call(arguments);
-	let options = new pairoptions(args.slice(2, args.length));
-	options.addfield('solutionstring', solutionstring);
-
-	// recover some fields
+		throw new Error('solutionstring ' + solutionstring + ' not supported!');
+	}
+	let options = new pairoptions(varargin, 'solutionstring', solutionstring);
+	
+	// Recover some fields
 	md.priv.solution 	= solutionstring;
-	cluster 			= md.cluster;
-
-	//check model consistency
+	let cluster 		= md.cluster;
+	
+	// NOTE: Batch scripts are not currently implemented
+	let batch = 0; 
+	if (options.getfieldvalue('batch', 'no') === 'yes') {
+		batch = 1;
+	}
+	
+	// Check model consistency
 	if (options.getfieldvalue('checkconsistency', 'yes') === 'yes') {
 		if (md.verbose.solution) {
@@ -94,28 +120,30 @@
 		ismodelselfconsistent(md);
 	}
-
+	
 	// If we are restarting, actually use the provided runtime name:
 	restart = options.getfieldvalue('restart', '');
 
 	// First, build a runtime name that is unique
-	if (restart === 1 ) {
+	if (restart === 1) {
 		// Leave the runtimename as is
 	} else {
-		if (!(restart === '')) {
-			md.priv.runtimename=restart;
-		} else if (options.getfieldvalue('runtimename',true)) {
-			let c = new Date().getTime();
-			md.priv.runtimename = sprintf('%s-%g', md.miscellaneous.name, c);
+		if (restart !== '') {
+			md.priv.runtimename = restart;
 		} else {
-			md.priv.runtimename = md.miscellaneous.name;
-		}
-	}
-
-	// If running qmu analysis, some preprocessing of dakota files using models fields needs to be carried out
+			if (options.getfieldvalue('runtimename', true)) {
+				let c = new Date().getTime();
+				md.priv.runtimename = sprintf('%s-%g', md.miscellaneous.name, c);
+			} else {
+				md.priv.runtimename = md.miscellaneous.name;
+			}
+		}
+	}
+
+	// If running QMU analysis, some preprocessing of Dakota files using model fields needs to be carried out
 	if (md.qmu.isdakota) {
-		throw Error("solve error message: qmu runs not supported yet!");
-		//md.preqmu(options);
-	}
-
+		throw new Error("QMU not supported yet!");
+		//md = preqmu(md, options);
+	}
+	
 	// Do we load results only?
 	if (options.getfieldvalue('loadonly', false)){
@@ -124,97 +152,53 @@
 	}
 
-	// Marshall into a binary array (fid) all the fields of model
-	let fid = marshall(md); // bin file
-	
-	//deal with toolkits options: 
-	toolkitsstring = md.toolkits.ToolkitsFile(md.miscellaneous.name + '.toolkits'); // toolkits file
-
-
 	/*
-		Set success callback function
-		
-		Default: do nothing if no success callback function requested
+	Write all input arrays (as opposed to, under MATLAB/Python, input binary 
+	files)
+	
+	NOTE: The JavaScript implementation diverges significantly from the 
+		  MATLAB/Python APIs here.
 	*/
-	//{{{
-	function successCallbackDefault() {
-		solving = false;
-	}; 
-	
-	let successCallback = options.getfieldvalue('successCallback', successCallbackDefault);
-	//}}}
-	
-	
-	/*
-		Set error callback function
-		
-		Default: do nothing if no error callback function requested
-	*/
-	//{{{ 
-	function errorCallbackDefault() {
-		solving = false;
-	}; 
-	
-	let errorCallback = options.getfieldvalue('errorCallback', errorCallbackDefault);
-	//}}}
-	
-	
-	/*
-		Set solve button ID
-		
-		Default: update #solve-button element with progress updates
-	*/
-	//{{{
-	let solveButtonId = options.getfieldvalue('solveButtonId', '#solve-button');
-	//}}}
-	
-	
-	/*
-		Set Callout
-	*/
-	//{{{
-	var callout = {};
-	
-	// Default: Callout is an empty object
-	callout = options.getfieldvalue('callout', {});
-	//}}}
-	
-	
-	/*
-		Set progress bar display boolean
-		
-		Default: no progress bar
-		
-		NOTE: must have supplied a callout for progress bar to display
-	*/
-	//{{{
-	let withProgressBar = options.getfieldvalue('withProgressBar', false);
-	//}}}
-
+	let fid = null; // bin file equivalent
+	//TODO: FIND A BETTER WAY TO DO THIS! (IE, SYNC UP WRITEDATA AND HAVE A FULL DEMARSHALL/READMODEL IN PYTHON
+	if (solutionstring === 'GmshSolution') {
+		//open file for binary writing
+		fid = new fileptr('mode','w');
+	} else if (solutionstring === 'GmtSolution') {
+		//open file for binary writing
+		fid = new fileptr('mode','w');
+		let prefix='md.mesh';
+		WriteData(fid,prefix,'object',md.mesh,'fieldname','lat','format','DoubleMat','mattype',1);
+		WriteData(fid,prefix,'object',md.mesh,'fieldname','long','format','DoubleMat','mattype',1);
+	} else {
+		// Marshall into a binary array (fid) all the fields of model
+		fid = marshall(md); // bin file
+	}
+	let toolkitsstring = md.toolkits.ToolkitsFile(md.miscellaneous.name + '.toolkits'); // toolkits file equivalent
 
 	if (cluster.classname() === 'local') {//{{{
 
-		// We are running locally on the machine, using the issm module
+		// We are running locally on the machine, using the ISSM module
 		console.log('running issm locally');
 		
-		// Call issm
+		// Call ISSM
 		let outputs = issm(fid, toolkitsstring, solutionstring, md.miscellaneous.name); 
 		
-		// Recover output arguments:
+		// Recover output
 		let outputbuffer 		= outputs[0]; 
 		let outputbuffersize 	= outputs[1];
 			
 		// Load results 
-		md = loadresultsfrombuffer(md, outputbuffer, outputbuffersize); 
-		
-		// Call success callback 
-		successCallback();
-
-		return md;
+		md = loadresultsfrombuffer(md, outputbuffer, outputbuffersize); // TODO: Pass reporting construct to loadresultsfrombuffer
+		
+		// Call success callback
+		if (vesl.helpers.isFunction(vesl.ui.reporting.success_callback)) {
+			vesl.ui.reporting.success_callback();
+		}
 	//}}}
-	} else {//{{{
+	} else { //{{{
 		// We are running somewhere else on a computational server. Send the buffer to that server and retrieve output.
 		console.log('running issm remotely');
 		
-		cluster.UploadAndRun(
+		await cluster.uploadandrun(
 			md, 
 			fid, 
@@ -223,13 +207,23 @@
 			md.miscellaneous.name, 
 			md.priv.runtimename,
-			successCallback, 
-			errorCallback, 
-			solveButtonId, 
-			callout, 
-			withProgressBar
-		);
-
+			options
+		);/*
+.catch(function(e) {
+			if (vesl.helpers.isDefined(vesl.ui) && vesl.helpers.isDefined(vesl.ui.reporting) && vesl.helpers.isFunction(vesl.ui.reporting.error_callback)) {
+				vesl.ui.reporting.error_callback(e);
+			}
+		}).catch(function(e) {
+			// Handle unexpected errors (source: http://thecodebarbarian.com/async-await-error-handling-in-javascript.html)
+			console.log(e);
+		});
+			
+		if (vesl.helpers.isDefined(vesl.ui) && vesl.helpers.isDefined(vesl.ui.reporting) && vesl.helpers.isFunction(vesl.ui.reporting.success_callback)) {
+			vesl.ui.reporting.success_callback(md);
+		}
+*/
+		
+		// Why is md undefined at vesl.ui.reporting.success_callback(md)? See issm-refactor
+		
 		return md;
-	}//}}}
-}//}}}
-
+	} //}}}
+} //}}}
Index: /issm/trunk/src/m/solve/solve.m
===================================================================
--- /issm/trunk/src/m/solve/solve.m	(revision 26743)
+++ /issm/trunk/src/m/solve/solve.m	(revision 26744)
@@ -8,26 +8,28 @@
 %
 %   Solution types available comprise:
-%   - 'Stressbalance'      or 'sb'
-%   - 'Masstransport'      or 'mt'
-%   - 'Thermal'            or 'th'
-%   - 'Steadystate'        or 'ss'
-%   - 'Transient'          or 'tr'
-%   - 'Balancethickness'   or 'mc'
-%   - 'Balancevelocity'    or 'bv'
-%   - 'BedSlope'           or 'bsl'
-%   - 'SurfaceSlope'       or 'ssl'
-%   - 'Hydrology'          or 'hy'
-%   - 'DamageEvolution'    or 'da'
-%   - 'Gia'                or 'gia'
-%   - 'Love'               or 'lv'
-%   - 'Esa'                or 'esa'
-%   - 'Sealevelrise'       or 'slr'
+%   - 'Stressbalance'        or 'sb'
+%   - 'Masstransport'        or 'mt'
+%   - 'Oceantransport'       or 'oceant'
+%   - 'Thermal'              or 'th'
+%   - 'Steadystate'          or 'ss'
+%   - 'Transient'            or 'tr'
+%   - 'Balancethickness'     or 'mc'
+%   - 'Balancethickness2'
+%   - 'BalancethicknessSoft' or 'mcsoft'
+%   - 'Balancevelocity'      or 'bv'
+%   - 'BedSlope'             or 'bsl'
+%   - 'SurfaceSlope'         or 'ssl'
+%   - 'Hydrology'            or 'hy'
+%   - 'DamageEvolution'      or 'da'
+%   - 'Gia'                  or 'gia'
+%   - 'Love'                 or 'lv'
+%   - 'Esa'                  or 'esa'
+%   - 'Sampling'             or 'smp'
 %
 %   Extra options:
-%   - loadonly         : does not solve. only load results
-%   - runtimename      : true or false (default is true), makes name unique
-%   - checkconsistency : 'yes' or 'no' (default is 'yes'), ensures checks on 
-%                        consistency of model
-%   - restart          : 'directory name (relative to the execution directory) 
+%   - loadonly         : do not solve, only load results
+%   - runtimename      : true or false (default is true); makes name unique
+%   - checkconsistency : 'yes' or 'no' (default is 'yes'); checks consistency of model
+%   - restart          : directory name (relative to the execution directory) 
 %                        where the restart file is located
 %
@@ -45,4 +47,6 @@
 elseif strcmpi(solutionstring,'mt') || strcmpi(solutionstring,'Masstransport')
 	solutionstring = 'MasstransportSolution';
+elseif strcmpi(solutionstring,'oceant') || strcmpi(solutionstring,'Oceantransport')
+	solutionstring = 'OceantransportSolution';
 elseif strcmpi(solutionstring,'th') || strcmpi(solutionstring,'Thermal')
 	solutionstring = 'ThermalSolution';
@@ -73,6 +77,6 @@
 elseif strcmpi(solutionstring,'esa') || strcmpi(solutionstring,'Esa')
 	solutionstring = 'EsaSolution';
-elseif strcmpi(solutionstring,'slr') || strcmpi(solutionstring,'Sealevelrise')
-	solutionstring = 'SealevelriseSolution';
+elseif strcmpi(solutionstring,'smp') || strcmpi(solutionstring,'Sampling')
+	solutionstring = 'SamplingSolution';    
 else
 	error(['solutionstring ' solutionstring ' not supported!']);
@@ -113,5 +117,5 @@
 end
 
-%if running QMU analysis, some preprocessing of Dakota files using models fields needs to be carried out. 
+%if running QMU analysis, some preprocessing of Dakota files using model fields needs to be carried out. 
 if md.qmu.isdakota,
 	md=preqmu(md,options);
@@ -169,5 +173,5 @@
 	end
 elseif md.settings.waitonlock>0,
-	%we wait for the done file
+	%wait for done file
 	done=waitonlock(md);
 	if md.verbose.solution,
Index: /issm/trunk/src/m/solve/solve.py
===================================================================
--- /issm/trunk/src/m/solve/solve.py	(revision 26743)
+++ /issm/trunk/src/m/solve/solve.py	(revision 26744)
@@ -1,5 +1,4 @@
 from datetime import datetime
 import os
-import shutil
 
 from ismodelselfconsistent import ismodelselfconsistent
@@ -16,29 +15,31 @@
     Usage:
         md = solve(md, solutionstring, varargin)
-    
+
     where varargin is a list of paired arguments of string OR enums
 
     Solution types available comprise:
-    - 'Stressbalance'      or 'sb'
-    - 'Masstransport'      or 'mt'
-    - 'Thermal'            or 'th'
-    - 'Steadystate'        or 'ss'
-    - 'Transient'          or 'tr'
-    - 'Balancethickness'   or 'mc'
-    - 'Balancevelocity'    or 'bv'
-    - 'BedSlope'           or 'bsl'
-    - 'SurfaceSlope'       or 'ssl'
-    - 'Hydrology'          or 'hy'
-    - 'DamageEvolution'    or 'da'
-    - 'Gia'                or 'gia'
-    - 'Esa'                or 'esa'
-    - 'Sealevelrise'       or 'slr'
-    - 'Love'               or 'lv'
+    - 'Stressbalance'        or 'sb'
+    - 'Masstransport'        or 'mt'
+    - 'Oceantransport'       or 'oceant'
+    - 'Thermal'              or 'th'
+    - 'Steadystate'          or 'ss'
+    - 'Transient'            or 'tr'
+    - 'Balancethickness'     or 'mc'
+    - 'BalancethicknessSoft' or 'mcsoft'
+    - 'Balancevelocity'      or 'bv'
+    - 'BedSlope'             or 'bsl'
+    - 'SurfaceSlope'         or 'ssl'
+    - 'Hydrology'            or 'hy'
+    - 'DamageEvolution'      or 'da'
+    - 'Gia'                  or 'gia'
+    - 'Love'                 or 'lv'
+    - 'Esa'                  or 'esa'
+    - 'Sampling'             or 'smp'
 
     Extra options:
-    - loadonly         : does not solve. only load results
-    - runtimename      : true or false (default is true), makes name unique
-    - checkconsistency : 'yes' or 'no' (default is 'yes'), ensures checks on 
-                         consistency of model
+    - loadonly         : do not solve, only load results
+    - runtimename      : true or false (default is true); makes name unique
+    - checkconsistency : 'yes' or 'no' (default is 'yes'); checks consistency 
+                         of model
     - restart          : directory name (relative to the execution directory) 
                          where the restart file is located
@@ -54,4 +55,6 @@
     elif solutionstring.lower() == 'mt' or solutionstring.lower() == 'masstransport':
         solutionstring = 'MasstransportSolution'
+    elif solutionstring.lower() == 'oceant' or solutionstring.lower() == 'oceantransport':
+        solutionstring = 'OceantransportSolution'
     elif solutionstring.lower() == 'th' or solutionstring.lower() == 'thermal':
         solutionstring = 'ThermalSolution'
@@ -78,8 +81,8 @@
     elif solutionstring.lower() == 'esa':
         solutionstring = 'EsaSolution'
-    elif solutionstring.lower() == 'slr' or solutionstring.lower() == 'sealevelrise':
-        solutionstring = 'SealevelriseSolution'
+    elif solutionstring.lower() == 'smp' or solutionstring.lower() == 'sampling':
+        solutionstring = 'SamplingSolution'
     else:
-        raise ValueError("solutionstring '%s' not supported!" % solutionstring)
+        raise ValueError('solutionstring {} not supported!'.format(solutionstring))
     options = pairoptions('solutionstring', solutionstring, *args)
 
@@ -98,10 +101,11 @@
         ismodelselfconsistent(md)
 
+    # If we are restarting, actually use the provided runtime name
+    restart = options.getfieldvalue('restart', '')
     # First, build a runtime name that is unique
-    restart = options.getfieldvalue('restart', '')
     if restart == 1:
-        pass  # do nothing
+        pass # Leave the runtimename as is
     else:
-        if restart:
+        if not isempty(restart):
             md.private.runtimename = restart
         else:
@@ -112,5 +116,5 @@
                 md.private.runtimename = md.miscellaneous.name
 
-    # If running QMU analysis, some preprocessing of Dakota files using models 
+    # If running QMU analysis, some preprocessing of Dakota files using model 
     # fields needs to be carried out
     if md.qmu.isdakota:
@@ -127,17 +131,17 @@
     cluster.BuildQueueScript(md.private.runtimename, md.miscellaneous.name, md.private.solution, md.settings.io_gather, md.debug.valgrind, md.debug.gprof, md.qmu.isdakota, md.transient.isoceancoupling) # queue file
 
-    # Stop here if batch mode
-    if options.getfieldvalue('batch', 'no') == 'yes':
-        print('batch mode requested: not launching job interactively')
-        print('launch solution sequence on remote cluster by hand')
-        return md
+    # Upload all required files
+    modelname = md.miscellaneous.name
+    filelist = [modelname + '.bin', modelname + '.toolkits']
 
-    # Upload all required files:
-    modelname = md.miscellaneous.name
-    filelist = [modelname + '.bin ', modelname + '.toolkits ', modelname + '.queue ']
+    if ispc():
+        filelist.append(modelname + '.bat')
+    else:
+        filelist.append(modelname + '.queue')
+
     if md.qmu.isdakota:
         filelist.append(modelname + '.qmu.in')
-        
-    if not restart:
+
+    if isempty(restart):
         cluster.UploadQueueJob(md.miscellaneous.name, md.private.runtimename, filelist)
 
@@ -145,13 +149,20 @@
     cluster.LaunchQueueJob(md.miscellaneous.name, md.private.runtimename, filelist, restart, batch)
 
+    # Return if batch
+    if batch:
+        if md.verbose.solution:
+            print('batch mode requested: not launching job interactively')
+            print('launch solution sequence on remote cluster by hand')
+        return md
+
     # Wait on lock
     if md.settings.waitonlock > 0:
-        islock = waitonlock(md)
-        if islock == 0:  # no results to be loaded
-            print('The results must be loaded manually with md = loadresultsfromcluster(md).')
-        else:  # load results
-            if md.verbose.solution:
-                print('loading results from cluster')
-            md = loadresultsfromcluster(md)
+        # Wait for done file
+        done = waitonlock(md)
+        if md.verbose.solution:
+            print('loading results from cluster')
+        md = loadresultsfromcluster(md)
+    elif md.settings.waitonlock == 0:
+        print('Model results must be loaded manually with md = loadresultsfromcluster(md).')
 
     return md
Index: /issm/trunk/src/m/solve/solveslm.m
===================================================================
--- /issm/trunk/src/m/solve/solveslm.m	(revision 26743)
+++ /issm/trunk/src/m/solve/solveslm.m	(revision 26744)
@@ -1,23 +1,20 @@
 function slm=solveslm(slm,solutionstringi,varargin)
-%SOLVESLR - apply solution sequence for this sealevel model
+%SOLVESLM - apply solution sequence for this sealevel model
 %
 %   Usage:
-%      slm=solve(slm,solutionstring,varargin)
+%      slm=solveslm(slm,solutionstring,varargin)
 %      where varargin is a lit of paired arguments of string OR enums
 %
 %   solution types available comprise:
-%      - 'Sealevelrise'
 %      - 'Transient'
 %
-%  extra options:
+%   extra options:
 %
 %   Examples:
-%      slm=solve(slm,'Transient');
+%      slm=solveslm(slm,'Transient');
 
 %recover and process solve options
 if strcmpi(solutionstringi,'tr') || strcmpi(solutionstringi,'Transient')
 	solutionstring = 'TransientSolution';
-elseif strcmpi(solutionstringi,'slr') || strcmpi(solutionstringi,'Sealevelrise')
-	solutionstring = 'SealevelriseSolution';
 else
 	error(['solutionstring ' solutionstringi ' not supported!']);
@@ -46,5 +43,5 @@
 cluster=slm.cluster;
 batch=0;
-%now, go through icecaps, glacies and earth, and upload all the data independently: 
+%now, go through icecaps, glaciers and earth, and upload all the data independently: 
 disp('solving ice caps first');
 for i=1:length(slm.icecaps),
@@ -54,5 +51,5 @@
 slm.earth=solve(slm.earth,solutionstringi,'batch','yes');
 
-%Firs, build a runtime name that is unique
+%First, build a runtime name that is unique
 c=clock;
 slm.private.runtimename=sprintf('%s-%02i-%02i-%04i-%02i-%02i-%02i-%i',slm.miscellaneous.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),feature('GetPid'));
Index: /issm/trunk/src/m/solve/solveslm.py
===================================================================
--- /issm/trunk/src/m/solve/solveslm.py	(revision 26744)
+++ /issm/trunk/src/m/solve/solveslm.py	(revision 26744)
@@ -0,0 +1,98 @@
+from datetime import datetime
+import os
+
+import numpy as np
+
+from loadresultsfromcluster import loadresultsfromcluster
+from pairoptions import pairoptions
+from waitonlock import waitonlock
+
+
+def solveslm(slm, solutionstringi, *args):
+    """SOLVESLM - apply solution sequence for this sealevel model
+
+    Usage:
+        slm=solveslm(slm,solutionstring,varargin)
+        where varargin is a lit of paired arguments of string OR enums
+
+    solution types available comprise:
+        - 'Transient'
+
+    extra options:
+
+    Examples:
+        slm=solveslm(slm,'Transient');
+    """
+
+    print('Yep')
+    exit()
+
+    # Recover and process solve options
+    if solutionstringi.lower() == 'tr' or solutionstringi.lower() == 'transient':
+        solutionstring = 'TransientSolution'
+    else:
+        raise RuntimeError('solutionstring {} not supported!'.format(solutionstringi))
+
+    # Default settings for debugging
+    valgrind = 0
+    #slm.cluster.interactive = 0
+    #valgrind = 1
+
+    # Check consistency
+    slm.checkconsistency(solutionstring)
+
+    # Process options
+    options = pairoptions('solutionstring', solutionstring, *args)
+
+    # Make sure we request sum of cluster processors
+    totalnp = 0
+    for i in range(len(slm.icecaps)):
+        totalnp = totalnp + slm.icecaps[i].cluster.np
+    totalnp = totalnp + slm.earth.cluster.np
+    if totalnp != slm.cluster.np:
+        raise RuntimeError('sum of all icecaps and earch cluster processors requestes should be equal to slm.cluster.np')
+
+    # Recover some fields
+    slm.private.solution = solutionstring
+    cluster = slm.cluster
+    batch = 0
+    # Now, go through icecaps, glaciers and earth, and upload all the data independently
+    print('solving ice caps first')
+    for i in range(len(slm.icecaps)):
+        slm.icecaps[i] = solve(slm.icecaps[i], solutionastringi,'batch','yes')
+    print('solving earth now')
+    slm.earth = solve(slm.earth, solutionstringi, 'batch', 'yes')
+
+    # First, build a runtime name that is unique
+    c = datetime.now()
+    md.private.runtimename = "%s-%02i-%02i-%04i-%02i-%02i-%02i-%i" % (md.miscellaneous.name, c.month, c.day, c.year, c.hour, c.minute, c.second, os.getpid())
+
+    # Write all input files
+    privateruntimenames = []
+    miscellaneousnames = []
+    nps = []
+    for i in range(len(slm.icecaps)):
+        privateruntimenames.append(slm.icecaps[i],private.runtimename)
+        miscellaneousnames.append(slm.earth.miscellaneous.name)
+        nps.append(slm.earth.cluster.np)
+
+    BuildQueueScriptMultipleModels(cluster, slm.private.runtimename, slm.miscellaneous.name, slm.private.solution, valgrind, privateruntimenames, miscellaneousnames, nps)
+
+    # Upload all required files, given that each individual solution for icecaps and earth model already did
+    filelist = [slm.miscellaneous.name + '.queue']
+    UploadQueueJob(cluster, slm.miscellaneous.name, slm.private.runtimename, filelist)
+
+    # Launch queue job
+    LaunchQueueJob(cluster, slm.miscellaneous.name, slm.private.runtimename, filelist, '', batch)
+
+    # Wait on lock
+    if slm.settings.waitonlock > 0:
+        islock = waitonlock(slm)
+        if islock == 0:  # no results to be loaded
+            print('The results must be loaded manually with md = loadresultsfromcluster(md).')
+        else: # load results
+            if slm.verbose.solution:
+                print('loading results from cluster')
+            slm = loadresultsfromcluster(slm)
+
+    return slm
Index: /issm/trunk/src/m/solve/waitonlock.m
===================================================================
--- /issm/trunk/src/m/solve/waitonlock.m	(revision 26743)
+++ /issm/trunk/src/m/solve/waitonlock.m	(revision 26744)
@@ -2,7 +2,8 @@
 %WAITONLOCK - wait for a file
 %
-%   This routine will return when a file named 'lockfilename' is written to disk.
-%   Also check for outlog file be cause it might bewritten several seconds
-%   after the lock file.
+%   This routine will return when a file named 'lockfilename' is written to 
+%   disk. Also check for outlog file be cause it might be written several 
+%   seconds after the lock file.
+%
 %   If the time limit given in input is exceeded, return 0
 %
@@ -37,5 +38,5 @@
 
 %initialize time and file presence test flag
-time=0; ispresent=0; time0=clock;
+elapsedtime=0; ispresent=0; starttime=clock;
 disp(['waiting for ' lockfilename ' hold on... (Ctrl+C to exit)'])
 
@@ -58,14 +59,14 @@
 
 %loop till file .lock exist or time is up
-while (ispresent==0 & time<timelimit)
+while (ispresent==0 & elapsedtime<timelimit)
 	if strcmpi(oshostname(),cluster.name),
 		pause(1);
 		ispresent=(exist(lockfilename,'file') & exist(logfilename,'file'));
-		time=etime(clock,time0)/60;
+		elapsedtime=etime(clock,starttime)/60;
 	else
 		pause(5);
-		time=etime(clock,time0);
-		fprintf('\rchecking for job completion (time: %i min %i sec)      ',floor(time/60),floor(rem(time,60)));
-		time=time/60; %converts time from sec to min
+		elapsedtime=etime(clock,starttime);
+		fprintf('\rchecking for job completion (time: %i min %i sec)      ',floor(elapsedtime/60),floor(rem(elapsedtime,60)));
+		elapsedtime=elapsedtime/60; %converts time from sec to min
 		ispresent=~system(command);
 		if ispresent, fprintf('\n'); end
@@ -74,5 +75,5 @@
 
 %build output
-if (time>timelimit),
+if (elapsedtime>timelimit),
 	disp('Time limit exceeded. Increase md.settings.waitonlock');
 	disp('The results must be loaded manually with md=loadresultsfromcluster(md).');
Index: /issm/trunk/src/m/solve/waitonlock.py
===================================================================
--- /issm/trunk/src/m/solve/waitonlock.py	(revision 26743)
+++ /issm/trunk/src/m/solve/waitonlock.py	(revision 26744)
@@ -1,62 +1,99 @@
-import os
-from socket import gethostname
+import subprocess
+import sys
 import time
-import MatlabFuncs as m
-
+from generic import *
+from generic_static import *
+# from localpfe import *
+from MatlabFuncs import *
+from pfe import *
 
 def waitonlock(md):
-    """
-    WAITONLOCK - wait for a file
+    """WAITONLOCK - wait for a file
 
-       This routine will return when a file named 'filename' is written to disk.
-       If the time limit given in input is exceeded, return 0
+    This routine will return when a file named 'lockfilename' is written to 
+    disk. Also check for outlog file because it might be written several 
+    seconds after the lock file.
 
-       Usage:
-          flag = waitonlock(md)
+    If the time limit given in input is exceeded, return 0.
+
+    Usage:
+        flag = waitonlock(md)
+
+    TODO:
+    - Uncomment import of localpfe and check on cluster type once localpfe.py 
+    has been translated from localpfe.m.
     """
 
-    #Get filename (lock file) and options
+    # Get lockfilename (lock file) and options
     executionpath = md.cluster.executionpath
-    cluster = md.cluster.name
     timelimit = md.settings.waitonlock
-    filename = os.path.join(executionpath, md.private.runtimename, md.miscellaneous.name + '.lock')
+    cluster = md.cluster
 
-    #waitonlock will work if the lock is on the same machine only:
-    if not m.strcmpi(gethostname(), cluster):
+    if isa(cluster, pfe) and cluster.interactive > 1:
+        lockfilename = '{}/Interactive{}/{}.lock'.format(executionpath, cluster.interactive, md.miscellaneous.name)
+        logfilename = '{}/Interactive{}/{}.outlog'.format(executionpath, cluster.interactive, md.miscellaneous.name)
+    # elif isa(cluster, localpfe):
+    #     lockfilename = '{}/{}.lock'.format(executionpath, md.miscellaneous.name)
+    #     logfilename = '{}/{}.outlog'.format(executionpath, md.miscellaneous.name)
+    else:
+        lockfilename = '{}/{}/{}.lock'.format(executionpath, md.private.runtimename, md.miscellaneous.name)
+        logfilename = '{}/{}/{}.outlog'.format(executionpath, md.private.runtimename, md.miscellaneous.name)
 
-        print('solution launched on remote cluster. log in to detect job completion.')
-        choice = eval(input('Is the job successfully completed? (y / n) '))
-        if not m.strcmp(choice, 'y'):
-            print('Results not loaded... exiting')
-            flag = 0
+    # If we are using the generic cluster in interactive mode, job is already complete
+    if (isa(cluster, generic) and cluster.interactive) or (isa(cluster, generic_static)):
+        # We are in interactive mode, no need to check for job completion
+        return 1
+
+    # Initialize time and file presence test flag
+    elapsedtime = 0
+    ispresent = 0
+    starttime = time.time()
+    print('waiting for {} hold on... (Ctrl+C to exit)'.format(lockfilename))
+
+    # Prepare command if the job is not running on the local machine
+    if not strcmpi(oshostname(), cluster.name):
+        if cluster.name == 'cloud':
+            command = '[ -f {} ] && [ -f {} ] 2>/dev/null'.format(lockfilename, logfilename)
+            command = '{} sshmaster {} --user {} \'{}\''.format(starcluster(), cluster.name, cluster.login, command)
         else:
-            flag = 1
+            command = 'ssh -l {}'.format(cluster.login)
+            if isprop(cluster, 'idfile') and cluster.idfile != '':
+                command += ' -i {}'.format(cluster.idfile)
+            port = 0
+            if isprop(cluster, 'port'):
+                port = cluster.port
+            if port: # Check if port is non-zero
+                command += ' -p {} localhost'.format(port)
+            else:
+                command += ' {}'.format(cluster.name)
+            command += ' "[ -f {} ] && [ -f {} ]" 2>/dev/null'.format(lockfilename, logfilename)
 
-    #job is running on the same machine
-    else:
+    while not ispresent and elapsedtime < timelimit:
+        if strcmpi(oshostname(), cluster.name):
+            pause(1)
+            ispresent = (isfile(lockfilename) and isfile(logfilename))
+            elapsedtime = etime(time.time(), starttime) / 60
+        else:
+            pause(5)
+            elapsedtime = etime(time.time(), starttime)
+            sys.stdout.write('\rchecking for job completion (time: {} min {} sec)      '.format(floor(elapsedtime / 60), floor(rem(elapsedtime, 60)))) # TODO: After Python 2 is deprecated, we can change this call to print([...], end='')
+            elapsedtime = elapsedtime / 60 # Converts time from sec to min
+            subproc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+            outs, errs = subproc.communicate() # NOTE: Need to consume output before checking return code
 
-        if 'interactive' in vars(md.cluster) and md.cluster.interactive:
-            #We are in interactive mode, no need to check for job completion
-            flag = 1
-            return flag
-        #initialize time and file presence test flag
-        etime = 0
-        ispresent = 0
-        print(("waiting for '%s' hold on... (Ctrl + C to exit)" % filename))
+            # TODO: Debug the following check under Linux (exits after first iteration with errs = "b")
+            # UPDATE: Works in testing under Debian Linux system. Leaving comment for now so that it is easier to backtrace this issue if someone else encounters it.
+            #
+            #if errs != '':
+            #    raise Exception('waitonlock: check for existence of files failed: {}'.format(errs))
+            ispresent = not subproc.returncode
+            if ispresent:
+                print('')
 
-        #loop till file .lock exist or time is up
-        while ispresent == 0 and etime < timelimit:
-            ispresent = os.path.exists(filename)
-            time.sleep(1)
-            etime += 1 / 60
+    # Build output
+    if elapsedtime > timelimit:
+        print('Time limit exceeded. Increase md.settings.waitonlock')
+        print('The results must be loaded manually with md = loadresultsfromcluster(md).')
+        raise RuntimeError('waitonlock error message: time limit exceeded.')
 
-        #build output
-        if etime > timelimit:
-            print('Time limit exceeded. Increase md.settings.waitonlock')
-            print('The results must be loaded manually with md = loadresultsfromcluster(md).')
-            raise RuntimeError('waitonlock error message: time limit exceeded.')
-            flag = 0
-        else:
-            flag = 1
-
-    return flag
+    return ispresent
Index: /issm/trunk/src/m/solvers/asmoptions.m
===================================================================
--- /issm/trunk/src/m/solvers/asmoptions.m	(revision 26743)
+++ /issm/trunk/src/m/solvers/asmoptions.m	(revision 26744)
@@ -1,4 +1,4 @@
 function asm=asmoptions(varargin)
-%ASMOPTIONS - return Additive Shwartz Method petsc options
+%ASMOPTIONS - return Additive Schwartz Method PETSc options
 %
 %   Usage:
Index: /issm/trunk/src/m/solvers/asmoptions.py
===================================================================
--- /issm/trunk/src/m/solvers/asmoptions.py	(revision 26743)
+++ /issm/trunk/src/m/solvers/asmoptions.py	(revision 26744)
@@ -1,24 +1,27 @@
+from collections import OrderedDict
 from pairoptions import pairoptions
 
+def asmoptions(*args):
+    """ASMOPTIONS - Return Additive Schwartz Method PETSc options
 
-def asmoptions(*args):
-    #ASMOPTIONS - return ASM petsc options
-    #
-    #   Usage:
-    #      options = asmoptions
+    Usage:
+        options = asmoptions
+    """
 
-    #retrieve options provided in *args
+    # Retrieve options provided in *args
     arguments = pairoptions(*args)
 
-    options = [['toolkit', 'petsc'],
-               ['mat_type', 'mpiaij'],
-               ['ksp_type', 'gmres'],
-               ['pc_type', 'asm'],
-               ['sub_pc_type', 'lu'],
-               ['pc_asm_overlap', 3],
-               ['ksp_max_it', 100],
-               ['ksp_rtol', 1e-30]]
+    options = [
+        ['toolkit', 'petsc'],
+        ['mat_type', 'mpiaij'],
+        ['ksp_type', 'gmres'],
+        ['pc_type', 'asm'],
+        ['sub_pc_type', 'lu'],
+        ['pc_asm_overlap', 3],
+        ['ksp_max_it', 100],
+        ['ksp_rtol', 1e-30]
+    ]
 
-    #now, go through our arguments, and write over default options.
+    # Now, go through our arguments, and write over default options
     for i in range(len(arguments.list)):
         arg1 = arguments.list[i][0]
@@ -33,5 +36,10 @@
                 break
         if not found:
-            #this option did not exist, add it:
+            # This option did not exist; add it
             options.append([arg1, arg2])
-    return options
+
+    asmoptions = OrderedDict()
+    for j in range(len(options)):
+        asmoptions[options[j][0]]=options[j][1]
+
+    return asmoptions
Index: /issm/trunk/src/m/solvers/asmstokesoptions.m
===================================================================
--- /issm/trunk/src/m/solvers/asmstokesoptions.m	(revision 26744)
+++ /issm/trunk/src/m/solvers/asmstokesoptions.m	(revision 26744)
@@ -0,0 +1,20 @@
+function asm=asmstokesoptions(varargin)
+%ASMSTOKESOPTIONS - return Additive Schwartz Method Stokes PETSc options
+%
+%   Usage:
+%      options=asmstokesoptions;
+
+%retrieve options provided in varargin
+options=pairoptions(varargin{:});
+asm=struct();
+
+%default asm options
+asm.toolkit='petsc';
+asm.mat_type=getfieldvalue(options,'mat_type','mpiaij');
+asm.ksp_type=getfieldvalue(options,'ksp_type','gmres');
+asm.pc_type=getfieldvalue(options,'pc_type','asm');
+asm.sub_pc_type=getfieldvalue(options,'sub_pc_type','lu');
+asm.pc_asm_overlap=getfieldvalue(options,'pc_asm_overlap',1); % COMSOL's default
+asm.ksp_max_it=getfieldvalue(options,'ksp_max_it',100);
+asm.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-7);  %tuned for best performance and to fit ISMIP-HOM-C 5km with MUMPS
+asm.ksp_atol=getfieldvalue(options,'ksp_atol',1e-10); %tuned for best performance and to fit ISMIP-HOM-C 5km with MUMPS
Index: /issm/trunk/src/m/solvers/asmstokesoptions.py
===================================================================
--- /issm/trunk/src/m/solvers/asmstokesoptions.py	(revision 26744)
+++ /issm/trunk/src/m/solvers/asmstokesoptions.py	(revision 26744)
@@ -0,0 +1,46 @@
+from collections import OrderedDict
+from pairoptions import pairoptions
+
+def asmstokesoptions(*args):
+    """ASMSTOKESOPTIONS - Return Additive Schwartz Method Stokes PETSc options
+
+    Usage:
+        options = asmstokesoptions
+    """
+
+    # Retrieve options provided in *args
+    arguments = pairoptions(*args)
+
+    options = [
+        ['toolkit', 'petsc'],
+        ['mat_type', 'mpiaij'],
+        ['ksp_type', 'gmres'],
+        ['pc_type', 'asm'],
+        ['sub_pc_type', 'lu'],
+        ['pc_asm_overlap', 1], # COMSOL's default
+        ['ksp_max_it', 100],
+        ['ksp_rtol', 1e-7], # Tuned for best performance and to fit ISMIP-HOM-C 5km with MUMPS
+        ['ksp_atol', 1e-10] # Tuned for best performance and to fit ISMIP-HOM-C 5km with MUMPS
+    ]
+
+    # Now, go through our arguments, and write over default options
+    for i in range(len(arguments.list)):
+        arg1 = arguments.list[i][0]
+        arg2 = arguments.list[i][1]
+        found = 0
+        for j in range(len(options)):
+            joption = options[j][0]
+            if joption == arg1:
+                joption[1] = arg2
+                options[j] = joption
+                found = 1
+                break
+        if not found:
+            # This option did not exist; add it
+            options.append([arg1, arg2])
+
+    asmoptions = OrderedDict()
+    for j in range(len(options)):
+        asmoptions[options[j][0]]=options[j][1]
+
+    return asmoptions
Index: /issm/trunk/src/m/solvers/mumpsnoneoptions.py
===================================================================
--- /issm/trunk/src/m/solvers/mumpsnoneoptions.py	(revision 26743)
+++ /issm/trunk/src/m/solvers/mumpsnoneoptions.py	(revision 26744)
@@ -1,4 +1,5 @@
 from pairoptions import pairoptions
 from collections import OrderedDict
+from IssmConfig import IssmConfig
 
 
@@ -14,27 +15,25 @@
 
     #default mumps options
-    PETSC_MAJOR = IssmConfig('_PETSC_MAJOR_')
-    PETSC_MINOR = IssmConfig('_PETSC_MINOR_')
+    PETSC_MAJOR = IssmConfig('_PETSC_MAJOR_')[0]
+    PETSC_MINOR = IssmConfig('_PETSC_MINOR_')[0]
     if PETSC_MAJOR == 2:
-        mumps.toolkit = 'petsc'
-        mumps.mat_type = getfieldvalue(options, 'mat_type', 'aijmumps')
-        mumps.ksp_type = getfieldvalue(options, 'ksp_type', 'preonly')
-        mumps.pc_type = getfieldvalue(options, 'pc_type', 'lu')
-        mumps.mat_mumps_icntl_14 = getfieldvalue(options, 'mat_mumps_icntl_14', 120)
-    end
+        mumps['toolkit'] = 'petsc'
+        mumps['mat_type'] = options.getfieldvalue(options, 'mat_type', 'aijmumps')
+        mumps['ksp_type'] = options.getfieldvalue(options, 'ksp_type', 'preonly')
+        mumps['pc_type'] = options.getfieldvalue(options, 'pc_type', 'lu')
+        mumps['mat_mumps_icntl_14'] = options.getfieldvalue(options, 'mat_mumps_icntl_14', 120)
 
     if PETSC_MAJOR == 3:
-        mumps.toolkit = 'petsc'
-        mumps.mat_type = getfieldvalue(options, 'mat_type', 'mpiaij')
-        mumps.ksp_type = getfieldvalue(options, 'ksp_type', 'preonly')
-        mumps.pc_type = getfieldvalue(options, 'pc_type', 'lu')
+        mumps['toolkit'] = 'petsc'
+        mumps['mat_type'] = options.getfieldvalue(options, 'mat_type', 'mpiaij')
+        mumps['ksp_type'] = options.getfieldvalue(options, 'ksp_type', 'preonly')
+        mumps['pc_type'] = options.getfieldvalue(options, 'pc_type', 'lu')
         if PETSC_MINOR > 8:
-            mumps.pc_factor_mat_solver_type = getfieldvalue(options, 'pc_factor_mat_solver_type', 'mumps')
+            mumps['pc_factor_mat_solver_type'] = options.getfieldvalue(options, 'pc_factor_mat_solver_type', 'mumps')
         else:
-            mumps.pc_factor_mat_solver_package = getfieldvalue(options, 'pc_factor_mat_solver_package', 'mumps')
-        end
-        mumps.mat_mumps_icntl_14 = getfieldvalue(options, 'mat_mumps_icntl_14', 120)
-        mumps.mat_mumps_icntl_28 = 2; #1 = serial, 2 = parallel
-        mumps.mat_mumps_icntl_29 = 2; #parallel ordering 1 = ptscotch, 2 = parmetis
-    end
-    return solverOptions
+            mumps['pc_factor_mat_solver_package'] = options.getfieldvalue(options, 'pc_factor_mat_solver_package', 'mumps')
+        mumps['mat_mumps_icntl_14'] = options.getfieldvalue(options, 'mat_mumps_icntl_14', 120)
+        mumps['mat_mumps_icntl_28'] = 2  #1 = serial, 2 = parallel
+        mumps['mat_mumps_icntl_29'] = 2  #parallel ordering 1 = ptscotch, 2 = parmetis
+
+    return mumps
Index: /issm/trunk/src/m/solvers/mumpsoptions.js
===================================================================
--- /issm/trunk/src/m/solvers/mumpsoptions.js	(revision 26744)
+++ /issm/trunk/src/m/solvers/mumpsoptions.js	(revision 26744)
@@ -0,0 +1,25 @@
+function mumpsoptions(){
+//MUMPSOPTIONS - 
+//
+//   Usage:
+//      options=mumpsoptions(varargin);
+
+	//Retrieve options provided in varargin. First convert arguments to array:
+	var args = Array.prototype.slice.call(arguments);
+
+	//Then process options
+	var  options = new pairoptions(args.slice(1,args.length));
+
+	//default issmoptions options
+	var mumpsoptions={};
+	mumpsoptions['toolkit']='petsc';
+	mumpsoptions['mat_type']=options.getfieldvalue('mat_type','mpiaij');
+	mumpsoptions['ksp_type']=options.getfieldvalue('ksp_type','preonly');
+	mumpsoptions['pc_type']=options.getfieldvalue('pc_type','lu');
+	mumpsoptions['pc_factor_mat_solver_type']=options.getfieldvalue('pc_factor_mat_solver_type','mumps');
+	mumpsoptions['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120);
+	mumpsoptions['mat_mumps_icntl_28']=options.getfieldvalue('mat_mumps_icntl_28',2);
+	mumpsoptions['mat_mumps_icntl_29']=options.getfieldvalue('mat_mumps_icntl_29',2);
+
+	return mumpsoptions;
+}
Index: /issm/trunk/src/m/solvers/mumpsoptions.py
===================================================================
--- /issm/trunk/src/m/solvers/mumpsoptions.py	(revision 26743)
+++ /issm/trunk/src/m/solvers/mumpsoptions.py	(revision 26744)
@@ -1,4 +1,4 @@
 from collections import OrderedDict
-import pairoptions
+from pairoptions import pairoptions
 from IssmConfig import IssmConfig
 
@@ -13,5 +13,5 @@
 
     #retrieve options provided in varargin
-    options = pairoptions.pairoptions(*args)
+    options = pairoptions(*args)
     mumps = OrderedDict()
 
@@ -24,5 +24,5 @@
         mumps['ksp_type'] = options.getfieldvalue('ksp_type', 'preonly')
         mumps['pc_type'] = options.getfieldvalue('pc_type', 'lu')
-        mumps['mat_mumps_icntl_14'] = options.getfieldvalue('mat_mumps_icntl_14', 120)
+        mumps['mat_mumps_icntl_14'] = options.options.getfieldvalue('mat_mumps_icntl_14', 120)
     if PETSC_MAJOR == 3.:
         mumps['toolkit'] = 'petsc'
@@ -36,3 +36,7 @@
         mumps['mat_mumps_icntl_14'] = options.getfieldvalue('mat_mumps_icntl_14', 120)
 
+        #These 2 lines make raijin break (ptwgts error during solver with PETSc 3.3)
+        mumps['mat_mumps_icntl_28'] = options.getfieldvalue('mat_mumps_icntl_28', 1)  #1=serial, 2=parallel
+        mumps['mat_mumps_icntl_29'] = options.getfieldvalue('mat_mumps_icntl_29', 2)  #parallel ordering 1 = ptscotch, 2 = parmetis
+
     return mumps
Index: /issm/trunk/src/wrappers/CoordTransform/CoordTransform.cpp
===================================================================
--- /issm/trunk/src/wrappers/CoordTransform/CoordTransform.cpp	(revision 26743)
+++ /issm/trunk/src/wrappers/CoordTransform/CoordTransform.cpp	(revision 26744)
@@ -3,69 +3,104 @@
  */
 
+/*Header files*/
 #include "./CoordTransform.h"
-#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-#include <proj_api.h>
+#include <proj.h>
 
-void CoordTransformUsage(void){/*{{{*/
-	_printf_(" type help CoordTransform\n");
-}/*}}}*/
-WRAPPER(CoordTransform_python){
-	
-	/*intermediary: */
-	double *xin     = NULL;
-   double *yin     = NULL;
-   char   *projin  = NULL;
-   char   *projout = NULL;
-   int     M,N;
-   int     test1,test2;
+/*
+NOTE:
+- Compilation of this module is fenced in Makefile.am, so we do not have to 
+check again if _HAVE_PROJ_ is defined
+*/
+#if defined(PROJ_VERSION_MAJOR) && PROJ_VERSION_MAJOR >= 6
+	/*
+	Converts an array of longitude (x_src) and array of latitude (y_src) in the 
+	projection described by str_src to the projection described by str_dest.
 
-	printf("%i %i %i %i\n",NLHS,nlhs,NRHS,nrhs);
+	NOTE:
+	- API types and calls have been migrated from PROJ 4 to PROJ 6. See SVN 
+	revision history for changes.
 
-	/*Boot module: */
-	MODULEBOOT();
+	Sources:
+	- https://proj.org/development/migration.html
+	- https://www.gaia-gis.it/fossil/libspatialite/wiki?name=PROJ.6
+	*/
 
-	/*checks on arguments: */
-	CHECKARGUMENTS(NLHS,NRHS,&CoordTransformUsage);
+	void CoordTransformUsage(void){/*{{{*/
+		_printf_(" type help CoordTransform\n");
+	}/*}}}*/
+	WRAPPER(CoordTransform_python){
+		/*intermediary: */
+		double *xin     = NULL;
+		double *yin     = NULL;
+		char   *projin  = NULL;
+		char   *projout = NULL;
+		int     M,N;
+		int     test1,test2;
 
-	/*Fetch data needed for meshing: */
-	FetchData(&xin,&M,&N,XIN);
-   FetchData(&yin,&test1,&test2,YIN);
-   if(!M*N)     _error_("no coordinate provided");
-   if(test1!=M) _error_("x and y do not have the same size");
-   if(test2!=N) _error_("x and y do not have the same size");
-   FetchData(&projin,PROJIN);
-   FetchData(&projout,PROJOUT);
+		/*Boot module: */
+		MODULEBOOT();
 
-	/*Initialize output*/
-	double* xout = xNew<double>(M*N);
-	double* yout = xNew<double>(M*N);
+		/*checks on arguments: */
+		CHECKARGUMENTS(NLHS,NRHS,&CoordTransformUsage);
 
-	/*Initialize projections*/
-	projPJ pj_src = pj_init_plus(projin);
-	projPJ pj_dst = pj_init_plus(projout);
-	if(!pj_src) _error_("Failed to initialize PROJ with source projection\n");
-	if(!pj_dst) _error_("Failed to initialize PROJ with destination projection\n");
+		/*Fetch data needed for meshing: */
+		FetchData(&xin,&M,&N,XIN);
+		FetchData(&yin,&test1,&test2,YIN);
+		if(!M*N)     _error_("no coordinate provided");
+		if(test1!=M) _error_("x and y do not have the same size");
+		if(test2!=N) _error_("x and y do not have the same size");
+		FetchData(&projin,PROJIN);
+		FetchData(&projout,PROJOUT);
 
-	/*Transform coordinates*/
-	int p = pj_transform(pj_src,pj_dst,M*N,1,xout,yout,NULL);
-	if(p!=0){
-		_error_("PROJ failed with error code: "<<p);
+		/*Calculate size once*/
+		int size = M*N;
+
+		/*Initialize output*/
+		double* xout = xNew<double>(size);
+		double* yout = xNew<double>(size);
+
+		for(int i=0;i<size;i++){
+			xout[i] = xin[i];
+			yout[i] = yin[i];
+		}
+
+		PJ *P;
+		size_t sx = sizeof(double);
+		size_t sy = sizeof(double);
+		size_t nx = size;
+		size_t ny = size;
+
+		P = proj_create_crs_to_crs(PJ_DEFAULT_CTX,projin,projout,NULL);
+
+		if ( 0 == P ) {
+			proj_destroy(P);
+			_error_("failed to initialize CRS transformation object");
+		}
+
+		int p = proj_trans_generic(P, PJ_FWD, xout, sx, nx, yout, sy, ny, 0, 0, 0, 0, 0, 0);
+
+		if ( 0 == p ){
+			proj_destroy(P);
+			_error_("no successful transformations");
+		}
+
+		proj_destroy(P);
+
+		/*write outputs: */
+		WriteData(XOUT,xout,M,N);
+		WriteData(YOUT,yout,M,N);
+
+		/*Clean-up and return*/
+		xDelete<double>(xin);
+		xDelete<double>(yin);
+		xDelete<double>(xout);
+		xDelete<double>(yout);
+		xDelete<char>(projin);
+		xDelete<char>(projout);
+
+		/*end module: */
+		MODULEEND();
 	}
-
-	/*write outputs: */
-	WriteData(XOUT,xout,M,N);
-	WriteData(YOUT,yout,M,N);
-
-	/*Clean-up and return*/
-   mxFree(projin);
-   mxFree(projout);
-	xDelete<double>(xin);
-	xDelete<double>(yin);
-	xDelete<double>(xout);
-	xDelete<double>(yout);
-	xDelete<char>(projin);
-	xDelete<char>(projout);
-
-	/*end module: */
-	MODULEEND();
-}
+#else
+	_error_("PROJ version >= 6 required");
+#endif
Index: /issm/trunk/src/wrappers/CoordTransform/CoordTransform.h
===================================================================
--- /issm/trunk/src/wrappers/CoordTransform/CoordTransform.h	(revision 26743)
+++ /issm/trunk/src/wrappers/CoordTransform/CoordTransform.h	(revision 26744)
@@ -17,13 +17,9 @@
 #endif
 
-#ifdef _HAVE_JAVASCRIPT_MODULES_
-#undef _DO_NOT_LOAD_GLOBALS_ /*only module where this needs to be undefined, so as to 
-							   not include IssmComm several times in the javascript Modle construct.*/
-#endif
-
 /*Header files: */
 #include "../bindings.h"
+#include "../../c/main/globals.h"
+#include "../../c/modules/modules.h"
 #include "../../c/shared/shared.h"
-#include "../../c/shared/io/io.h"
 
 #undef __FUNCT__ 
Index: /issm/trunk/src/wrappers/ShpRead/ShpRead.cpp
===================================================================
--- /issm/trunk/src/wrappers/ShpRead/ShpRead.cpp	(revision 26743)
+++ /issm/trunk/src/wrappers/ShpRead/ShpRead.cpp	(revision 26744)
@@ -67,9 +67,12 @@
 
 		switch(psShape->nSHPType){
+			case SHPT_POINTZ:
+				contour=new Contour<double>(0,psShape->nVertices,psShape->padfX,psShape->padfY,false);
+				break;
 			case SHPT_ARC:
 				contour=new Contour<double>(0,psShape->nVertices,psShape->padfX,psShape->padfY,false);
 				break;
 			default:
-				_printf_("Shape type "<<SHPTypeName(psShape->nSHPType)<<"not supported yet, skipping...\n");
+				_printf_("Shape type "<<SHPTypeName(psShape->nSHPType)<<" not supported yet, skipping...\n");
 		}
 
Index: /issm/trunk/src/wrappers/javascript/Makefile.am
===================================================================
--- /issm/trunk/src/wrappers/javascript/Makefile.am	(revision 26743)
+++ /issm/trunk/src/wrappers/javascript/Makefile.am	(revision 26744)
@@ -1,3 +1,3 @@
-AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @CODIPACKINCL@
+AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @PARMETISINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @CODIPACKINCL@
 AUTOMAKE_OPTIONS = subdir-objects
 
@@ -8,5 +8,5 @@
 
 js_scripts = ${ISSM_DIR}/src/wrappers/BamgMesher/BamgMesher.js \
-             ${ISSM_DIR}/src/wrappers/Triangle/Triangle.js  \
+			 ${ISSM_DIR}/src/wrappers/Triangle/Triangle.js \
 			 ${ISSM_DIR}/src/wrappers/NodeConnectivity/NodeConnectivity.js\
 			 ${ISSM_DIR}/src/wrappers/ContourToMesh/ContourToMesh.js\
@@ -67,5 +67,5 @@
 # Module sources and dependencies {{{
 if !WINDOWS
-libISSMJavascript_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(MPILIB) $(PETSCLIB) $(MKLLIB) $(GSLLIB) $(PROJ4LIB) $(MATHLIB) 
+libISSMJavascript_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(MPILIB) $(PETSCLIB) $(MKLLIB) $(GSLLIB) $(MATHLIB)
 endif
 
@@ -76,5 +76,5 @@
 
 if !WINDOWS
-libISSMApi_la_LIBADD = $(MPILIB) $(PETSCLIB) $(GSLLIB) $(PROJ4LIB) $(MATHLIB) $(MEXLIB)
+libISSMApi_la_LIBADD = $(MPILIB) $(PETSCLIB) $(GSLLIB) $(MATHLIB) $(MEXLIB)
 endif
 
Index: /issm/trunk/src/wrappers/matlab/Makefile.am
===================================================================
--- /issm/trunk/src/wrappers/matlab/Makefile.am	(revision 26743)
+++ /issm/trunk/src/wrappers/matlab/Makefile.am	(revision 26744)
@@ -1,3 +1,3 @@
-AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @CODIPACKINCL@ @PROJINCL@
+AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @PARMETISINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @CODIPACKINCL@ @PROJINCL@
 AUTOMAKE_OPTIONS = subdir-objects
 
@@ -20,8 +20,15 @@
 	./io/WriteMatlabData.cpp
 
-ALLCXXFLAGS= -fPIC -D_WRAPPERS_ $(CXXFLAGS) $(CXXOPTFLAGS)
+ALL_CXXFLAGS = -fPIC -D_WRAPPERS_
+
+if MSYS2
+ALL_CXXFLAGS += -D_DO_NOT_LOAD_GLOBALS_ # Cannot have undefined symbols under MSYS2
+ALL_CXXFLAGS += -D_USE_MATH_DEFINES # Need to open fence to math.h definitions when --std=c++ is used (which is the default)
+endif
+
+ALL_CXXFLAGS += $(CXXOPTFLAGS) $(CXXFLAGS)
 
 libISSMMatlab_la_SOURCES = $(io_sources)
-libISSMMatlab_la_CXXFLAGS= $(ALLCXXFLAGS)
+libISSMMatlab_la_CXXFLAGS = ${ALL_CXXFLAGS}
 #}}}
 #api io{{{
@@ -32,8 +39,10 @@
 endif
 
+if !MSYS2
 api_sources= ./io/ApiPrintf.cpp
 
 libISSMApi_la_SOURCES = $(api_sources)
-libISSMApi_la_CXXFLAGS= $(ALLCXXFLAGS)
+libISSMApi_la_CXXFLAGS = ${ALL_CXXFLAGS}
+endif
 #}}}
 #Wrappers {{{
@@ -70,5 +79,5 @@
 lib_LTLIBRARIES += Kriging_matlab.la
 endif
-if KML
+if SHP
 lib_LTLIBRARIES += ShpRead_matlab.la
 endif
@@ -82,8 +91,19 @@
 
 #Triangle library
-AM_CXXFLAGS =  -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER -D_WRAPPERS_
+CXXFLAGS_FOR_TRI = -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER
 
 #Matlab part
-AM_LDFLAGS = -module $(MEXLINK) -shrext ${EXEEXT} --export-dynamic -rdynamic -no-undefined
+CXXFLAGS_FOR_MEX = -D_HAVE_MATLAB_MODULES_ $(MEXOPTFLAGS) $(MEXCXXFLAGS)
+CPPFLAGS_FOR_MEX = $(MATLABINCL)
+LDFLAGS_FOR_MEX = -module -shrext $(MEXEXT) -no-undefined
+LIBADD_FOR_MEX = $(MEXLINKFLAGS) $(MEXLIB)
+
+AM_CPPFLAGS += ${CXXFLAGS_FOR_MEX}
+AM_CXXFLAGS = ${CXXFLAGS_FOR_TRI} ${CPPFLAGS_FOR_MEX}
+AM_LDFLAGS = ${LDFLAGS_FOR_MEX}
+
+if !MSYS2
+AM_LDFLAGS += --export-dynamic -rdynamic
+endif
 
 if !VERSION
@@ -106,11 +126,15 @@
 endif
 
-AM_CXXFLAGS += -D_HAVE_MATLAB_MODULES_ -fPIC
-
-deps += ./libISSMMatlab.la ../../c/libISSMModules.la ../../c/libISSMCore.la ./libISSMApi.la
-
-if WINDOWS
-deps += $(METISLIB)
-endif
+AM_CXXFLAGS += -fPIC -D_WRAPPERS_
+
+deps += ./libISSMMatlab.la ../../c/libISSMCore.la ../../c/libISSMModules.la
+
+if !MSYS2
+deps += ./libISSMApi.la
+endif
+
+# if WINDOWS
+# deps += $(METISLIB)
+# endif
 
 if ADOLC
@@ -122,6 +146,5 @@
 endif
 
-#MEXLIB needs to be the last (undefined references on larsen)
-deps += ${MEXLIB}
+deps += ${LIBADD_FOR_MEX}
 
 #Optimization flags:
@@ -130,129 +153,111 @@
 # Module sources and dependencies {{{
 if !WINDOWS
-libISSMMatlab_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(MKLLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
+libISSMMatlab_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(MKLLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
+endif
+
+if VERSION
+libISSMMatlab_la_LDFLAGS =
+libISSMApi_la_LDFLAGS =
+else
+libISSMMatlab_la_LDFLAGS = -avoid-version
+libISSMApi_la_LDFLAGS = -avoid-version
 endif
 
 if STANDALONE_LIBRARIES
-libISSMMatlab_la_LDFLAGS = -static
-libISSMApi_la_LDFLAGS = -static
-deps += $(PETSCLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
-endif
-
-if !WINDOWS
-libISSMApi_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
+libISSMMatlab_la_LDFLAGS += -static
+libISSMApi_la_LDFLAGS += -static
+deps += $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(NEOPZLIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(OSLIBS) ${LIBADD_FOR_MEX}
+endif
+
+if !WINDOWS
+libISSMApi_la_LIBADD = $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
 endif
 
 BamgConvertMesh_matlab_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp
-BamgConvertMesh_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-BamgConvertMesh_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+BamgConvertMesh_matlab_la_LIBADD = ${deps}
 
 BamgMesher_matlab_la_SOURCES = ../BamgMesher/BamgMesher.cpp
-BamgMesher_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-BamgMesher_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+BamgMesher_matlab_la_LIBADD = ${deps}
 
 BamgTriangulate_matlab_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp
-BamgTriangulate_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-BamgTriangulate_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+BamgTriangulate_matlab_la_LIBADD = ${deps}
 
 if CHACO
 Chaco_matlab_la_SOURCES = ../Chaco/Chaco.cpp
-Chaco_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-Chaco_matlab_la_LIBADD = ${deps} $(CHACOLIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+Chaco_matlab_la_LIBADD = ${deps} $(CHACOLIB)
 endif
 
 ContourToMesh_matlab_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp
-ContourToMesh_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-ContourToMesh_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ContourToMesh_matlab_la_LIBADD = ${deps}
 
 ContourToNodes_matlab_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp
-ContourToNodes_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-ContourToNodes_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
-
+ContourToNodes_matlab_la_LIBADD = ${deps}
+
+if PROJ
 CoordTransform_matlab_la_SOURCES = ../CoordTransform/CoordTransform.cpp
-CoordTransform_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-CoordTransform_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+CoordTransform_matlab_la_LIBADD = ${deps}
+endif
 
 DistanceToMaskBoundary_matlab_la_SOURCES = ../DistanceToMaskBoundary/DistanceToMaskBoundary.cpp
-DistanceToMaskBoundary_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-DistanceToMaskBoundary_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+DistanceToMaskBoundary_matlab_la_LIBADD = ${deps}
 
 ElementConnectivity_matlab_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp
-ElementConnectivity_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-ElementConnectivity_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ElementConnectivity_matlab_la_LIBADD = ${deps}
 
 ExpToLevelSet_matlab_la_SOURCES = ../ExpToLevelSet/ExpToLevelSet.cpp
-ExpToLevelSet_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-ExpToLevelSet_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ExpToLevelSet_matlab_la_LIBADD = ${deps}
 
 ExpSimplify_matlab_la_SOURCES = ../ExpSimplify/ExpSimplify.cpp
-ExpSimplify_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-ExpSimplify_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(NEOPZLIB)
+ExpSimplify_matlab_la_LIBADD = ${deps}
 
 InterpFromGridToMesh_matlab_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp
-InterpFromGridToMesh_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-InterpFromGridToMesh_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+InterpFromGridToMesh_matlab_la_LIBADD = ${deps}
 
 InterpFromMesh2d_matlab_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp
-InterpFromMesh2d_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-InterpFromMesh2d_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+InterpFromMesh2d_matlab_la_LIBADD = ${deps}
 
 InterpFromMeshToGrid_matlab_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp
-InterpFromMeshToGrid_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-InterpFromMeshToGrid_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+InterpFromMeshToGrid_matlab_la_LIBADD = ${deps}
 
 InterpFromMeshToMesh2d_matlab_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
-InterpFromMeshToMesh2d_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-InterpFromMeshToMesh2d_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+InterpFromMeshToMesh2d_matlab_la_LIBADD = ${deps}
 
 InterpFromMeshToMesh3d_matlab_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
-InterpFromMeshToMesh3d_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-InterpFromMeshToMesh3d_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+InterpFromMeshToMesh3d_matlab_la_LIBADD = ${deps}
 
 IssmConfig_matlab_la_SOURCES = ../IssmConfig/IssmConfig.cpp
-IssmConfig_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-IssmConfig_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB)
+IssmConfig_matlab_la_LIBADD = ${deps}
 
 Kriging_matlab_la_SOURCES = ../Kriging/Kriging.cpp
-Kriging_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-Kriging_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(PROJLIB)
+Kriging_matlab_la_LIBADD = ${deps}
 
 M1qn3_matlab_la_SOURCES = ../M1qn3/M1qn3.cpp
-M1qn3_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-M1qn3_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(METISLIB) $(M1QN3LIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+M1qn3_matlab_la_LIBADD = ${deps}
 
 MeshPartition_matlab_la_SOURCES = ../MeshPartition/MeshPartition.cpp
-MeshPartition_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-MeshPartition_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(METISLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+MeshPartition_matlab_la_LIBADD = ${deps}
 
 MeshProfileIntersection_matlab_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp
-MeshProfileIntersection_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-MeshProfileIntersection_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+MeshProfileIntersection_matlab_la_LIBADD = ${deps}
 
 NodeConnectivity_matlab_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp
-NodeConnectivity_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-NodeConnectivity_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+NodeConnectivity_matlab_la_LIBADD = ${deps}
 
 PointCloudFindNeighbors_matlab_la_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp
-PointCloudFindNeighbors_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-PointCloudFindNeighbors_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+PointCloudFindNeighbors_matlab_la_LIBADD = ${deps}
 
 PropagateFlagsFromConnectivity_matlab_la_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp
-PropagateFlagsFromConnectivity_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-PropagateFlagsFromConnectivity_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+PropagateFlagsFromConnectivity_matlab_la_LIBADD = ${deps}
 
 Scotch_matlab_la_SOURCES = ../Scotch/Scotch.cpp
-Scotch_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-Scotch_matlab_la_LIBADD = ${deps}  $(PETSCLIB) $(HDF5LIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(BLASLAPACKLIB)
+Scotch_matlab_la_LIBADD = ${deps}
 
 ShpRead_matlab_la_SOURCES = ../ShpRead/ShpRead.cpp
-ShpRead_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-ShpRead_matlab_la_LIBADD = ${deps} $(SHAPELIBLIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ShpRead_matlab_la_LIBADD = ${deps} $(SHAPELIBLIB)
 
 Triangle_matlab_la_SOURCES = ../Triangle/Triangle.cpp
-Triangle_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-Triangle_matlab_la_LIBADD = ${deps} $(TRIANGLELIB) $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+Triangle_matlab_la_LIBADD = ${deps} $(TRIANGLELIB)
 
 ProcessRifts_matlab_la_SOURCES = ../ProcessRifts/ProcessRifts.cpp
-ProcessRifts_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
-ProcessRifts_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
-#}}}
+ProcessRifts_matlab_la_LIBADD = ${deps}
+#}}}
Index: /issm/trunk/src/wrappers/python/Makefile.am
===================================================================
--- /issm/trunk/src/wrappers/python/Makefile.am	(revision 26743)
+++ /issm/trunk/src/wrappers/python/Makefile.am	(revision 26744)
@@ -1,3 +1,3 @@
-AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @CODIPACKINCL@
+AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @PARMETISINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @CODIPACKINCL@ @PROJINCL@
 AUTOMAKE_OPTIONS = subdir-objects
 
@@ -101,67 +101,67 @@
 #}}}
 # Module sources and dependencies {{{
-libISSMPython_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(MKLLIB) $(GSLLIB) $(PROJ4LIB) $(MATHLIB)
+libISSMPython_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(MKLLIB) $(GSLLIB) $(MATHLIB)
 
 if STANDALONE_LIBRARIES
 libISSMPython_la_LDFLAGS = -static
 libISSMApi_la_LDFLAGS = -static
-deps += $(DAKOTALIB) $(PETSCLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
+deps += $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(OSLIBS)
 endif
 
-libISSMApi_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB) $(MATHLIB)
+libISSMApi_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(MATHLIB)
 
 BamgConvertMesh_python_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp
 BamgConvertMesh_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-BamgConvertMesh_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+BamgConvertMesh_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
 
 BamgMesher_python_la_SOURCES = ../BamgMesher/BamgMesher.cpp
 BamgMesher_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-BamgMesher_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+BamgMesher_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
 
 BamgTriangulate_python_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp
 BamgTriangulate_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-BamgTriangulate_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+BamgTriangulate_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
 
 if CHACO
 Chaco_python_la_SOURCES = ../Chaco/Chaco.cpp
 Chaco_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-Chaco_python_la_LIBADD = ${deps} $(CHACOLIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+Chaco_python_la_LIBADD = ${deps} $(CHACOLIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
 endif
 
 ContourToMesh_python_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp
 ContourToMesh_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-ContourToMesh_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+ContourToMesh_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB)
 
 ContourToNodes_python_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp
 ContourToNodes_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-ContourToNodes_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+ContourToNodes_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
 
 ElementConnectivity_python_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp
 ElementConnectivity_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-ElementConnectivity_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+ElementConnectivity_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
 
 ExpToLevelSet_python_la_SOURCES = ../ExpToLevelSet/ExpToLevelSet.cpp
 ExpToLevelSet_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-ExpToLevelSet_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB) $(NEOPZLIB)
+ExpToLevelSet_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(NEOPZLIB)
 
 InterpFromMesh2d_python_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp
 InterpFromMesh2d_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-InterpFromMesh2d_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+InterpFromMesh2d_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB)
 
 InterpFromGridToMesh_python_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp
 InterpFromGridToMesh_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-InterpFromGridToMesh_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+InterpFromGridToMesh_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB)
 
 InterpFromMeshToGrid_python_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp
 InterpFromMeshToGrid_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-InterpFromMeshToGrid_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+InterpFromMeshToGrid_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB)
 
 InterpFromMeshToMesh2d_python_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
 InterpFromMeshToMesh2d_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-InterpFromMeshToMesh2d_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(GSLLIB) $(PROJ4LIB)
+InterpFromMeshToMesh2d_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(GSLLIB)
 
 InterpFromMeshToMesh3d_python_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
 InterpFromMeshToMesh3d_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-InterpFromMeshToMesh3d_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(GSLLIB) $(PROJ4LIB)
+InterpFromMeshToMesh3d_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(GSLLIB)
 
 IssmConfig_python_la_SOURCES = ../IssmConfig/IssmConfig.cpp
@@ -171,20 +171,20 @@
 MeshPartition_python_la_SOURCES = ../MeshPartition/MeshPartition.cpp
 MeshPartition_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-MeshPartition_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(METISLIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+MeshPartition_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(METISLIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
 
 MeshProfileIntersection_python_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp
 MeshProfileIntersection_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-MeshProfileIntersection_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+MeshProfileIntersection_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
 
 NodeConnectivity_python_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp
 NodeConnectivity_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-NodeConnectivity_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+NodeConnectivity_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
 
 Triangle_python_la_SOURCES = ../Triangle/Triangle.cpp
 Triangle_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-Triangle_python_la_LIBADD = ${deps} $(TRIANGLELIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+Triangle_python_la_LIBADD = ${deps} $(TRIANGLELIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
 
 ProcessRifts_python_la_SOURCES = ../ProcessRifts/ProcessRifts.cpp
 ProcessRifts_python_la_CXXFLAGS = ${AM_CXXFLAGS}
-ProcessRifts_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
+ProcessRifts_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
 #}}}
Index: /issm/trunk/src/wrappers/python/io/FetchPythonData.cpp
===================================================================
--- /issm/trunk/src/wrappers/python/io/FetchPythonData.cpp	(revision 26743)
+++ /issm/trunk/src/wrappers/python/io/FetchPythonData.cpp	(revision 26744)
@@ -189,4 +189,5 @@
 	long* lmatrix=NULL;
 	bool* bmatrix=NULL;
+	float* smatrix=NULL;
 	int i;
 	PyObject* py_matrix2=NULL;
@@ -212,5 +213,14 @@
 			}
 
-			if (PyArray_TYPE((PyArrayObject*)py_matrix) == NPY_DOUBLE) {
+			if (PyArray_TYPE((PyArrayObject*)py_matrix) == NPY_FLOAT) {
+				/*retrieve internal value: */
+				smatrix=(float*)PyArray_DATA((PyArrayObject*)py_matrix);
+
+				/*transform into double matrix: */
+				matrix=xNew<double>(M*N);
+				for(i=0;i<M*N;i++)matrix[i]=(double)smatrix[i];
+			}
+
+			else if (PyArray_TYPE((PyArrayObject*)py_matrix) == NPY_DOUBLE) {
 				/*retrieve internal value: */
 				dmatrix=(double*)PyArray_DATA((PyArrayObject*)py_matrix);
@@ -558,4 +568,5 @@
 	long* lvector=NULL;
 	bool* bvector=NULL;
+	float* svector=NULL;
 	int i;
 	PyObject* py_vector2=NULL;
@@ -584,5 +595,13 @@
 			}
 
-			if      (PyArray_TYPE((PyArrayObject*)py_vector) == NPY_DOUBLE) {
+			if (PyArray_TYPE((PyArrayObject*)py_vector) == NPY_FLOAT) {
+				/*retrieve internal value: */
+				svector=(float*)PyArray_DATA((PyArrayObject*)py_vector);
+
+				/*transform into double matrix: */
+				vector=xNew<double>(M);
+				for(i=0;i<M;i++)vector[i]=(double)svector[i];
+			}
+			else if (PyArray_TYPE((PyArrayObject*)py_vector) == NPY_DOUBLE) {
 				/*retrieve internal value: */
 				dvector=(double*)PyArray_DATA((PyArrayObject*)py_vector);
Index: /issm/trunk/test/MITgcm/build.sh
===================================================================
--- /issm/trunk/test/MITgcm/build.sh	(revision 26743)
+++ /issm/trunk/test/MITgcm/build.sh	(revision 26744)
@@ -24,9 +24,16 @@
 #create MITgcm makefile for this run, if needed
 if [ ! -f Makefile ]; then
-    if [ $hostname == "pleiades" ]; then 
-	$modelpath/../MITgcm/install/tools/genmake2 -of $SLR_DIR/models/ice-ocean/configs/linux_amd64_gfortran+mpi_ice_nas -mo ../code -rd $modelpath/../MITgcm/install
-    else
-	$modelpath/../MITgcm/install/tools/genmake2 -mpi -mo $modelpath/../MITgcm/code -rd $modelpath/../MITgcm/install
-    fi
+	case $hostname in
+		"pleiades")
+			$modelpath/../MITgcm/install/tools/genmake2 -of $SLR_DIR/models/ice-ocean/configs/linux_amd64_gfortran+mpi_ice_nas -mo ../code -rd $modelpath/../MITgcm/install
+			;;
+		"babylon")
+			$modelpath/../MITgcm/install/tools/genmake2 -of $modelpath/../MITgcm/install/tools/build_options/linux_amd64_ifort -mpi -mo $modelpath/../MITgcm/code -rd $modelpath/../MITgcm/install
+			export LD_LIBRARY_PATH="$ISSM_DIR/externalpackages/petsc/install/lib:/dartfs-hpc/admin/opt/el7/intel/compilers_and_libraries_2019.3.199/linux/compiler/lib/intel64:$ISSM_DIR/externalpackages/triangle/install/lib"
+			;;
+		*)
+			$modelpath/../MITgcm/install/tools/genmake2 -mpi -mo $modelpath/../MITgcm/code -rd $modelpath/../MITgcm/install
+			;;
+	esac
 fi
 
@@ -35,4 +42,3 @@
     make depend
 fi
-
-make -j 4
+make -j 4 &> Makefile.log
Index: /issm/trunk/test/MITgcm/build_4003.sh
===================================================================
--- /issm/trunk/test/MITgcm/build_4003.sh	(revision 26743)
+++ /issm/trunk/test/MITgcm/build_4003.sh	(revision 26744)
@@ -11,7 +11,7 @@
 
 # Get MITgcm code, if needed
-if [ ! -d "$modelpath/../MITgcm/install_dngoldberg" ]; then
+if [ ! -d "$modelpath/../MITgcm/install" ]; then
     cd $modelpath/../MITgcm
-    source install_dngoldberg.sh
+    source install.sh
     cd $modelpath
 fi
@@ -24,9 +24,16 @@
 #create MITgcm makefile for this run, if needed
 if [ ! -f Makefile ]; then
-    if [ $hostname == "pleiades" ]; then 
-	$modelpath/../MITgcm/install_dngoldberg/tools/genmake2 -of $SLR_DIR/models/ice-ocean/configs/linux_amd64_gfortran+mpi_ice_nas -mo ../code_4003 -rd $modelpath/../MITgcm/install_dngoldberg
-    else
-	$modelpath/../MITgcm/install_dngoldberg/tools/genmake2 -mpi -mo ../code_4003 -rd $modelpath/../MITgcm/install_dngoldberg
-    fi
+	case $hostname in
+		"pleiades")
+			$modelpath/../MITgcm/install/tools/genmake2 -of $SLR_DIR/models/ice-ocean/configs/linux_amd64_gfortran+mpi_ice_nas -mo ../code_4003 -rd $modelpath/../MITgcm/install
+			;;
+		"babylon")
+			$modelpath/../MITgcm/install/tools/genmake2 -of $modelpath/../MITgcm/install/tools/build_options/linux_amd64_ifort -mpi -mo $modelpath/../MITgcm/code_4003 -rd $modelpath/../MITgcm/install
+			export LD_LIBRARY_PATH="$ISSM_DIR/externalpackages/petsc/install/lib:/dartfs-hpc/admin/opt/el7/intel/compilers_and_libraries_2019.3.199/linux/compiler/lib/intel64:$ISSM_DIR/externalpackages/triangle/install/lib"
+			;;
+		*)
+			$modelpath/../MITgcm/install/tools/genmake2 -mpi -mo $modelpath/../MITgcm/code_4003 -rd $modelpath/../MITgcm/install
+			;;
+	esac
 fi
 
@@ -35,4 +42,3 @@
     make depend
 fi
-
-make -j 4
+make -j 4 &> Makefile.log
Index: /issm/trunk/test/MITgcm/code/CPP_EEOPTIONS.h
===================================================================
--- /issm/trunk/test/MITgcm/code/CPP_EEOPTIONS.h	(revision 26743)
+++ /issm/trunk/test/MITgcm/code/CPP_EEOPTIONS.h	(revision 26744)
@@ -62,7 +62,4 @@
 C     Use D0 where it means REAL*8 but not where it means REAL*16
 #define D0 d0
-
-C--   Enable some old macro conventions for backward compatibility
-#undef USE_OLD_MACROS_R4R8toRSRL
 
 C=== IO related options ===
Index: /issm/trunk/test/MITgcm/code/do_oceanic_phys.F
===================================================================
--- /issm/trunk/test/MITgcm/code/do_oceanic_phys.F	(revision 26743)
+++ /issm/trunk/test/MITgcm/code/do_oceanic_phys.F	(revision 26744)
@@ -1,4 +1,7 @@
 #include "PACKAGES_CONFIG.h"
 #include "CPP_OPTIONS.h"
+#ifdef ALLOW_MOM_COMMON
+# include "MOM_COMMON_OPTIONS.h"
+#endif
 #ifdef ALLOW_AUTODIFF
 # include "AUTODIFF_OPTIONS.h"
@@ -73,4 +76,6 @@
 C       |-- EXTERNAL_FORCING_SURF
 C       |
+C       |-- OBCS_ADJUST
+C       |
 C       |- k loop (Nr:1):
 C       | - DWNSLP_CALC_RHO
@@ -119,4 +124,6 @@
 C       |
 C       |-- KPP_DO_EXCH
+C       |
+C       |-- GGL90_EXCHANGES
 C       |
 C       |-- DIAGS_RHO_G
@@ -143,6 +150,7 @@
 #ifdef ALLOW_AUTODIFF
 # include "AUTODIFF_MYFIELDS.h"
-# include "tamc.h"
-# include "tamc_keys.h"
+# ifdef ALLOW_AUTODIFF_TAMC
+#  include "tamc.h"
+# endif
 # include "FFIELDS.h"
 # include "SURFACE.h"
@@ -196,5 +204,5 @@
 C     !LOCAL VARIABLES:
 C     == Local variables
-C     rhoK, rhoKm1  :: Density at current level, and level above
+C     rhoKp1,rhoKm1 :: Density at current level, and @ level minus one
 C     iMin, iMax    :: Ranges and sub-block indices on which calculations
 C     jMin, jMax       are applied.
@@ -202,4 +210,5 @@
 C     msgBuf        :: Temp. for building output string
 C     i,j,k         :: loop indices
+C     kSrf          :: surface index
       _RL rhoKp1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
       _RL rhoKm1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
@@ -210,5 +219,5 @@
       INTEGER jMin, jMax
       INTEGER bi, bj
-      INTEGER i, j, k
+      INTEGER i, j, k, kSrf
       CHARACTER*(MAX_LEN_MBUF) msgBuf
       INTEGER doDiagsRho
@@ -221,4 +230,9 @@
       _RL thetaRef
 #endif /* ALLOW_AUTODIFF */
+#ifdef ALLOW_AUTODIFF_TAMC
+      INTEGER act1, act2, act3, act4
+      INTEGER max1, max2, max3
+      INTEGER kkey, itdkey
+#endif
 CEOP
 
@@ -227,4 +241,7 @@
       itdkey = 1
 #endif /* ALLOW_AUTODIFF_TAMC */
+
+      kSrf = 1
+      IF ( usingPCoords ) kSrf = Nr
 
 #ifdef ALLOW_DEBUG
@@ -282,31 +299,17 @@
 
 #ifdef ALLOW_AUTODIFF
-# ifdef ALLOW_SALT_PLUME
       DO bj=myByLo(myThid),myByHi(myThid)
        DO bi=myBxLo(myThid),myBxHi(myThid)
         DO j=1-OLy,sNy+OLy
          DO i=1-OLx,sNx+OLx
+          adjustColdSST_diag(i,j,bi,bj) = 0. _d 0
+# ifdef ALLOW_SALT_PLUME
           saltPlumeDepth(i,j,bi,bj) = 0. _d 0
           saltPlumeFlux(i,j,bi,bj)  = 0. _d 0
+# endif
          ENDDO
         ENDDO
        ENDDO
       ENDDO
-# endif
-# ifdef ALLOW_ECCO
-#  ifdef ALLOW_SIGMAR_COST_CONTRIBUTION
-      DO bj=myByLo(myThid),myByHi(myThid)
-       DO bi=myBxLo(myThid),myBxHi(myThid)
-        DO k=1,Nr
-         DO j=1-OLy,sNy+OLy
-          DO i=1-OLx,sNx+OLx
-           sigmaRfield(i,j,k,bi,bj) = 0. _d 0
-          ENDDO
-         ENDDO
-        ENDDO
-       ENDDO
-      ENDDO
-#  endif
-# endif
 #endif /* ALLOW_AUTODIFF */
 
@@ -320,35 +323,22 @@
 #endif /* ALLOW_FRAZIL */
 
-#ifndef OLD_THSICE_CALL_SEQUENCE
 #if (defined ALLOW_THSICE) && !(defined ALLOW_ATM2D)
       IF ( useThSIce .AND. fluidIsWater ) THEN
 # ifdef ALLOW_AUTODIFF_TAMC
-CADJ STORE uice,vice         = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE snowHeight, Tsrf  = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE Qice1, Qice2      = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE sHeating, snowAge = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE hocemxl = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE icflxsw = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE salt,theta        = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE uvel,vvel         = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE qnet,qsw, empmr   = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE atemp,aqh,precip  = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE swdown,lwdown     = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+#  ifdef ALLOW_SEAICE
+CADJ STORE uice,vice         = comlev1, key=ikey_dynamics, kind=isbyte
+#  endif
+CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE snowHeight, Tsrf  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE Qice1, Qice2      = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE sHeating,snowAge  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE hocemxl, icflxsw  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE salt,theta        = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE uvel,vvel         = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE qnet,qsw, empmr   = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE atemp,aqh,precip  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE swdown,lwdown     = comlev1, key=ikey_dynamics, kind=isbyte
 #  ifdef NONLIN_FRSURF
-CADJ STORE hFac_surfC       = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE hFac_surfC        = comlev1, key=ikey_dynamics, kind=isbyte
 #  endif
 # endif /* ALLOW_AUTODIFF_TAMC */
@@ -363,106 +353,45 @@
       ENDIF
 #endif /* ALLOW_THSICE */
-#endif /* ndef OLD_THSICE_CALL_SEQUENCE */
 
 #ifdef ALLOW_SEAICE
-# ifdef ALLOW_AUTODIFF
-CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE fu,fv  = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE qnet   = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE qsw    = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
+# ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE qnet  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE qsw   = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE salt  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE fu,fv = comlev1, key=ikey_dynamics, kind=isbyte
 #if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP)
-CADJ STORE evap   = comlev1, key=ikey_dynamics, kind=isbyte
-#endif
-      IF ( .NOT.useSEAICE .AND. SEAICEadjMODE .EQ. -1 ) THEN
-        CALL SEAICE_FAKE( myTime, myIter, myThid )
-      ENDIF
-CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE fu,fv  = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE qnet   = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE qsw    = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
-#if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP)
-CADJ STORE evap   = comlev1, key=ikey_dynamics, kind=isbyte
-#endif
-# endif /* ALLOW_AUTODIFF */
-#endif /* ALLOW_SEAICE */
-
-#ifdef ALLOW_SEAICE
+CADJ STORE evap  = comlev1, key=ikey_dynamics, kind=isbyte
+#endif
+# endif /* ALLOW_AUTODIFF_TAMC */
+#ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE phiHydLow= comlev1, key=ikey_dynamics, byte=isbyte
+#endif
       IF ( useSEAICE ) THEN
 # ifdef ALLOW_AUTODIFF_TAMC
-cph-adj-test(
-CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE hsnow  = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE heff   = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE tices  = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE empmr, qnet  = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE qsw,saltflux = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE fu, fv = comlev1, key=ikey_dynamics, kind=isbyte
-cCADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
-cCADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
-cph-adj-test)
-c#ifdef ALLOW_EXF
-CADJ STORE atemp,aqh,precip    = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE swdown,lwdown       = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE evap                = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE uwind,vwind         = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-c#endif
-CADJ STORE uvel,vvel           = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-#  ifdef SEAICE_CGRID
-CADJ STORE stressdivergencex   = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE stressdivergencey   = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-#  endif
-#  ifdef SEAICE_ALLOW_DYNAMICS
-CADJ STORE uice                = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE vice                = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE dwatn               = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-#   ifdef SEAICE_ALLOW_EVP
-CADJ STORE seaice_sigma1       = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE seaice_sigma2       = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE seaice_sigma12      = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-#   endif
+CADJ STORE uvel,vvel         = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE uice,vice         = comlev1, key=ikey_dynamics, kind=isbyte
+#  ifdef ALLOW_EXF
+CADJ STORE atemp,aqh,precip  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE swdown,lwdown     = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE uwind,vwind       = comlev1, key=ikey_dynamics, kind=isbyte
 #  endif
 #  ifdef SEAICE_VARIABLE_SALINITY
-CADJ STORE hsalt               = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE hsalt             = comlev1, key=ikey_dynamics, kind=isbyte
 #  endif
 #  ifdef ATMOSPHERIC_LOADING
-CADJ STORE pload               = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE siceload            = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE pload, siceload   = comlev1, key=ikey_dynamics, kind=isbyte
 #  endif
 #  ifdef NONLIN_FRSURF
-CADJ STORE recip_hfacc         = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE recip_hfacc       = comlev1, key=ikey_dynamics, kind=isbyte
 #  endif
 #  ifdef ANNUAL_BALANCE
-CADJ STORE balance_itcount     = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE balance_itcount   = comlev1, key=ikey_dynamics, kind=isbyte
 #  endif /* ANNUAL_BALANCE */
 #  ifdef ALLOW_THSICE
-C-- store thSIce vars before advection (called from SEAICE_MODEL) update them:
-CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE snowHeight, hOceMxL = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE Qice1, Qice2  = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+C-- store thSIce vars before advection (called from SEAICE_MODEL) updates them:
+CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE snowHeight,hOceMxL= comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE Qice1, Qice2      = comlev1, key=ikey_dynamics, kind=isbyte
 #  endif /* ALLOW_THSICE */
 # endif /* ALLOW_AUTODIFF_TAMC */
@@ -473,7 +402,20 @@
         CALL SEAICE_MODEL( myTime, myIter, myThid )
         CALL TIMER_STOP ('SEAICE_MODEL    [DO_OCEANIC_PHYS]', myThid)
+# ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE tices = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE heff  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE hsnow = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE area  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE uIce  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE vIce  = comlev1, key=ikey_dynamics, kind=isbyte
+# endif
 # ifdef ALLOW_COST
         CALL SEAICE_COST_SENSI ( myTime, myIter, myThid )
 # endif
+# ifdef ALLOW_AUTODIFF
+      ELSEIF ( SEAICEadjMODE .EQ. -1 ) THEN
+CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte
+        CALL SEAICE_FAKE( myTime, myIter, myThid )
+# endif /* ALLOW_AUTODIFF */
       ENDIF
 #endif /* ALLOW_SEAICE */
@@ -493,41 +435,10 @@
 
 #ifdef ALLOW_AUTODIFF_TAMC
-CADJ STORE sst, sss           = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE qsw                = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE sst, sss          = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE qsw               = comlev1, key=ikey_dynamics, kind=isbyte
 # ifdef ALLOW_SEAICE
-CADJ STORE area               = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-# endif
-#endif
-
-#ifdef OLD_THSICE_CALL_SEQUENCE
-#if (defined ALLOW_THSICE) && !(defined ALLOW_ATM2D)
-      IF ( useThSIce .AND. fluidIsWater ) THEN
-# ifdef ALLOW_AUTODIFF_TAMC
-cph(
-#  ifdef NONLIN_FRSURF
-CADJ STORE uice,vice        = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE salt,theta       = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE qnet,qsw, empmr  = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE hFac_surfC       = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-#  endif
-# endif
-# ifdef ALLOW_DEBUG
-        IF (debugMode) CALL DEBUG_CALL('THSICE_MAIN',myThid)
-# endif
-C--     Step forward Therm.Sea-Ice variables
-C       and modify forcing terms including effects from ice
-        CALL TIMER_START('THSICE_MAIN     [DO_OCEANIC_PHYS]', myThid)
-        CALL THSICE_MAIN( myTime, myIter, myThid )
-        CALL TIMER_STOP( 'THSICE_MAIN     [DO_OCEANIC_PHYS]', myThid)
-      ENDIF
-#endif /* ALLOW_THSICE */
-#endif /* OLD_THSICE_CALL_SEQUENCE */
+CADJ STORE area              = comlev1, key=ikey_dynamics, kind=isbyte
+# endif
+#endif
 
 #ifdef ALLOW_CPL_ISSM
@@ -541,8 +452,6 @@
 #endif
 #ifdef ALLOW_AUTODIFF_TAMC
-CADJ STORE salt, theta = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE uvel, vvel = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE salt, theta       = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE uvel, vvel        = comlev1, key=ikey_dynamics, kind=isbyte
 #endif
 C     compute temperature and (virtual) salt flux at the
@@ -574,5 +483,5 @@
       IF ( useSALT_PLUME ) THEN
 Catn: exchanging saltPlumeFlux:
-          CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid )
+        CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid )
       ENDIF
 #endif /* ALLOW_SALT_PLUME */
@@ -581,6 +490,5 @@
       IF ( allowFreezing ) THEN
 #ifdef ALLOW_AUTODIFF_TAMC
-CADJ STORE theta = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE theta             = comlev1, key=ikey_dynamics, kind=isbyte
 #endif
         CALL FREEZE_SURFACE( myTime, myIter, myThid )
@@ -595,6 +503,5 @@
 C     relaxation terms, etc.
 #ifdef ALLOW_AUTODIFF
-CADJ STORE salt, theta = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE salt, theta       = comlev1, key=ikey_dynamics, kind=isbyte
 #else  /* ALLOW_AUTODIFF */
 C--   if fluid is not water, by-pass surfaceForcing, find_rho, gmredi
@@ -608,4 +515,16 @@
      I             iMin, iMax, jMin, jMax,
      I             myTime, myIter, myThid )
+
+#ifdef  ALLOW_OBCS
+      IF (useOBCS) THEN
+C--   After all surface fluxes are known apply balancing fluxes and
+C--   apply tidal forcing to open boundaries
+# ifdef ALLOW_DEBUG
+       IF (debugMode) CALL DEBUG_CALL('OBCS_ADJUST',myThid)
+# endif
+       CALL OBCS_ADJUST(
+     I      myTime+deltaTClock, myIter+1, myThid )
+      ENDIF
+#endif  /* ALLOW_OBCS */
 
 #ifdef ALLOW_AUTODIFF_TAMC
@@ -645,9 +564,11 @@
            sigmaY(i,j,k) = 0. _d 0
            sigmaR(i,j,k) = 0. _d 0
+#if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG))
+           sigmaRfield(i,j,k,bi,bj) = 0. _d 0
+#endif
           ENDDO
          ENDDO
         ENDDO
 
-#ifdef ALLOW_AUTODIFF
         DO j=1-OLy,sNy+OLy
          DO i=1-OLx,sNx+OLx
@@ -656,4 +577,5 @@
          ENDDO
         ENDDO
+#ifdef ALLOW_AUTODIFF
 cph all the following init. are necessary for TAF
 cph although some of these are re-initialised later.
@@ -697,8 +619,6 @@
            Kwy(i,j,k,bi,bj)  = 0. _d 0
            Kwz(i,j,k,bi,bj)  = 0. _d 0
-#  ifdef GM_NON_UNITY_DIAGONAL
            Kux(i,j,k,bi,bj)  = 0. _d 0
            Kvy(i,j,k,bi,bj)  = 0. _d 0
-#  endif
 #  ifdef GM_EXTRA_DIAGONAL
            Kuz(i,j,k,bi,bj)  = 0. _d 0
@@ -736,22 +656,17 @@
 
 #ifdef ALLOW_AUTODIFF_TAMC
-CADJ STORE theta(:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
-CADJ STORE salt (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ STORE theta(:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
+CADJ STORE salt (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
 CADJ STORE totphihyd(:,:,:,bi,bj)
-CADJ &     = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
 # ifdef ALLOW_KPP
-CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
-CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ STORE uvel (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
+CADJ STORE vvel (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
 # endif
 # ifdef ALLOW_SALT_PLUME
-CADJ STORE saltplumedepth(:,:,bi,bj) = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
-CADJ STORE saltplumeflux(:,:,bi,bj) = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ STORE saltplumedepth(:,:,bi,bj)
+CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
+CADJ STORE saltplumeflux(:,:,bi,bj)
+CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
 # endif
 #endif /* ALLOW_AUTODIFF_TAMC */
@@ -856,12 +771,15 @@
             IF (k.GT.1) THEN
 #ifdef ALLOW_AUTODIFF_TAMC
-CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,
-CADJ &     kind = isbyte
-CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,
-CADJ &     kind = isbyte
-CADJ STORE rhokm1 (bi,bj)       = comlev1_bibj_k, key=kkey,
-CADJ &     kind = isbyte
+CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte
+CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte
+CADJ STORE rhokm1 (bi,bj)       = comlev1_bibj_k, key=kkey,kind=isbyte
 #endif /* ALLOW_AUTODIFF_TAMC */
-             CALL FIND_RHO_2D(
+             IF ( usingZCoords ) THEN
+              DO j=jMin,jMax
+               DO i=iMin,iMax
+                rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)
+               ENDDO
+              ENDDO
+              CALL FIND_RHO_2D(
      I                 iMin, iMax, jMin, jMax, k,
      I                 theta(1-OLx,1-OLy,k-1,bi,bj),
@@ -869,14 +787,21 @@
      O                 rhoKm1,
      I                 k-1, bi, bj, myThid )
+             ELSE
+              CALL FIND_RHO_2D(
+     I                 iMin, iMax, jMin, jMax, k-1,
+     I                 theta(1-OLx,1-OLy,k,bi,bj),
+     I                 salt (1-OLx,1-OLy,k,bi,bj),
+     O                 rhoKp1,
+     I                 k, bi, bj, myThid )
+              DO j=jMin,jMax
+               DO i=iMin,iMax
+                rhoKm1(i,j) = rhoInSitu(i,j,k-1,bi,bj)
+               ENDDO
+              ENDDO
+             ENDIF
             ENDIF
 #ifdef ALLOW_DEBUG
             IF (debugMode) CALL DEBUG_CALL('GRAD_SIGMA',myThid)
 #endif
-cph Avoid variable aliasing for adjoint !!!
-            DO j=jMin,jMax
-             DO i=iMin,iMax
-              rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)
-             ENDDO
-            ENDDO
             CALL GRAD_SIGMA(
      I             bi, bj, iMin, iMax, jMin, jMax, k,
@@ -884,6 +809,6 @@
      O             sigmaX, sigmaY, sigmaR,
      I             myThid )
-#ifdef ALLOW_ECCO
-# ifdef ALLOW_SIGMAR_COST_CONTRIBUTION
+
+#if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG))
             DO j=jMin,jMax
              DO i=iMin,iMax
@@ -891,6 +816,6 @@
              ENDDO
             ENDDO
-# endif
-#endif /* ALLOW_ECCO */
+#endif /* ALLOW_SIGMAR_COST_CONTRIBUTION or ALLOW_LEITH_QG */
+
 #ifdef ALLOW_AUTODIFF
 #ifdef GMREDI_WITH_STABLE_ADJOINT
@@ -929,6 +854,5 @@
 #ifdef ALLOW_AUTODIFF_TAMC
 CADJ STORE IVDConvCount(:,:,:,bi,bj)
-CADJ &     = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
 #endif
 
@@ -936,5 +860,5 @@
         IF ( calcGMRedi .OR. MOD(doDiagsRho,2).EQ.1 ) THEN
           CALL CALC_OCE_MXLAYER(
-     I              rhoInSitu(1-OLx,1-OLy,1,bi,bj), sigmaR,
+     I              rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR,
      I              bi, bj, myTime, myIter, myThid )
         ENDIF
@@ -943,5 +867,5 @@
         IF ( useSALT_PLUME ) THEN
           CALL SALT_PLUME_CALC_DEPTH(
-     I              rhoInSitu(1-OLx,1-OLy,1,bi,bj), sigmaR,
+     I              rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR,
      I              bi, bj, myTime, myIter, myThid )
 #ifdef SALT_PLUME_VOLUME
@@ -950,9 +874,9 @@
 C-- get forcings for kpp
           CALL SALT_PLUME_APPLY(
-     I              1, bi, bj, recip_hFacC(1-OLx,1-OLy,1,bi,bj),
+     I              1, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj),
      I              theta, 0,
      I              myTime, myIter, myThid )
           CALL SALT_PLUME_APPLY(
-     I              2, bi, bj, recip_hFacC(1-OLx,1-OLy,1,bi,bj),
+     I              2, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj),
      I              salt, 0,
      I              myTime, myIter, myThid )
@@ -978,18 +902,11 @@
 cph needed for KPP
 CADJ STORE surfaceForcingU(:,:,bi,bj)
-CADJ &     = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
 CADJ STORE surfaceForcingV(:,:,bi,bj)
-CADJ &     = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
 CADJ STORE surfaceForcingS(:,:,bi,bj)
-CADJ &     = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
 CADJ STORE surfaceForcingT(:,:,bi,bj)
-CADJ &     = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
-CADJ STORE surfaceForcingTice(:,:,bi,bj)
-CADJ &     = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
 #endif /* ALLOW_AUTODIFF_TAMC */
 
@@ -1047,9 +964,9 @@
 #ifdef  ALLOW_GGL90
 #ifdef ALLOW_AUTODIFF_TAMC
-CADJ STORE GGL90TKE (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ STORE GGL90TKE(:,:,:,bi,bj)
+CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
 #endif /* ALLOW_AUTODIFF_TAMC */
 C--     Compute GGL90 mixing coefficients
-        IF (useGGL90) THEN
+        IF ( useGGL90 .AND. Nr.GT.1 ) THEN
 #ifdef ALLOW_DEBUG
           IF (debugMode) CALL DEBUG_CALL('GGL90_CALC',myThid)
@@ -1079,10 +996,7 @@
 cph keep it although TAF says you dont need to.
 cph but I have avoided the #ifdef for now, in case more things change
-CADJ STORE sigmaX(:,:,:)        = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
-CADJ STORE sigmaY(:,:,:)        = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
-CADJ STORE sigmaR(:,:,:)        = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ STORE sigmaX(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
+CADJ STORE sigmaY(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
+CADJ STORE sigmaR(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
 # endif
 #endif /* ALLOW_AUTODIFF_TAMC */
@@ -1166,4 +1080,9 @@
 #endif /* ALLOW_KPP */
 
+#ifdef ALLOW_GGL90
+      IF ( useGGL90 )
+     &  CALL GGL90_EXCHANGES( myThid )
+#endif /* ALLOW_GGL90 */
+
 #ifdef ALLOW_DIAGNOSTICS
       IF ( fluidIsWater .AND. useDiagnostics ) THEN
Index: /issm/trunk/test/MITgcm/code/eeboot_minimal.F
===================================================================
--- /issm/trunk/test/MITgcm/code/eeboot_minimal.F	(revision 26743)
+++ /issm/trunk/test/MITgcm/code/eeboot_minimal.F	(revision 26744)
@@ -40,4 +40,10 @@
       INTEGER myComm
 
+C     !FUNCTIONS:
+c     INTEGER  IFNBLNK
+c     EXTERNAL IFNBLNK
+      INTEGER  ILNBLNK
+      EXTERNAL ILNBLNK
+
 C     !LOCAL VARIABLES:
 C     == Local variables ==
@@ -58,5 +64,7 @@
       LOGICAL doReport
 #if defined(ALLOW_OASIS) || defined(COMPONENT_MODULE)
-      INTEGER mpiMyWid
+      INTEGER mpiMyWId
+#elif defined(ALLOW_NEST2W_COMMON)
+      INTEGER mpiMyWId
 #endif
 #ifdef ALLOW_CPL_ISSM
@@ -67,9 +75,13 @@
 #endif /* ALLOW_CPL_ISSM */
 #if defined(ALLOW_NEST_PARENT) || defined(ALLOW_NEST_CHILD)
-      INTEGER mpiMyWid, color
+      INTEGER mpiMyWId, color
 #endif
 #ifdef USE_PDAF
       INTEGER mpi_task_id
+      CHARACTER*(14) fmtStr
+#else
+      CHARACTER*(6) fmtStr
 #endif /* USE_PDAF */
+      INTEGER iTmp
 #endif /* ALLOW_USE_MPI */
 CEOP
@@ -176,4 +188,15 @@
 #endif /* ALLOW_NEST_PARENT | ALLOW_NEST_CHILD */
 
+#ifdef ALLOW_NEST2W_COMMON
+C--    Case with 2-Ways Nest(ing)
+C-     Set the running directory
+       CALL MPI_COMM_RANK( MPI_COMM_WORLD, mpiMyWId, mpiRC )
+       CALL SETDIR( mpiMyWId )
+
+C-     Setup Nesting Execution Environment
+       CALL NEST2W_EEINIT( mpiMyWId )
+       IF ( eeBootError ) GOTO 999
+#endif /* ALLOW_NEST2W_COMMON */
+
 #ifdef ALLOW_CPL_ISSM
 C     add a 1rst preliminary call EESET_PARAMS to set useCoupler
@@ -216,9 +239,14 @@
        ENDIF
        myProcId = mpiMyId
+       iTmp = MAX(4,1 + INT(LOG10(DFLOAT(nPx*nPy))))
 #ifdef USE_PDAF
-       WRITE(myProcessStr,'(I4.4,A1,I4.4)') mpi_task_id,'.',myProcId
+       WRITE(fmtStr,'(4(A,I1),A)')
+     &      '(I',iTmp,'.',iTmp,',A1,I',iTmp,'.',iTmp,')'
+       WRITE(myProcessStr,fmtStr) mpi_task_id,'.',myProcId
 #else
-       WRITE(myProcessStr,'(I4.4)') myProcId
+       WRITE(fmtStr,'(2(A,I1),A)') '(I',iTmp,'.',iTmp,')'
+       WRITE(myProcessStr,fmtStr) myProcId
 #endif /* USE_PDAF */
+       iTmp = ILNBLNK( myProcessStr )
        mpiPidIo = myProcId
        pidIO    = mpiPidIo
@@ -227,13 +255,7 @@
         IF( myProcId .EQ. 0 ) THEN
 #endif
-         WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:4)
-#ifdef USE_PDAF
-         WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:9)
-#endif
+         WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:iTmp)
          OPEN(errorMessageUnit,FILE=fNam,STATUS='unknown')
-         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:4)
-#ifdef USE_PDAF
-         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:9)
-#endif
+         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:iTmp)
          OPEN(standardMessageUnit,FILE=fNam,STATUS='unknown')
 #ifdef SINGLE_DISK_IO
Index: /issm/trunk/test/MITgcm/code/packages.conf
===================================================================
--- /issm/trunk/test/MITgcm/code/packages.conf	(revision 26743)
+++ /issm/trunk/test/MITgcm/code/packages.conf	(revision 26744)
@@ -1,8 +1,6 @@
-# $Header: /u/gcmpack/MITgcm/verification/isomip/code/packages.conf,v 1.2 2010/02/11 22:24:12 dimitri Exp $
-# $Name:  $
-
+#-- list of packages (or group of packages) to compile for this experiment:
 gfd
+obcs
+shelfice
+diagnostics
 timeave
-shelfice
-obcs
-diagnostics
Index: /issm/trunk/test/MITgcm/code_4003/CPP_EEOPTIONS.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/CPP_EEOPTIONS.h	(revision 26743)
+++ /issm/trunk/test/MITgcm/code_4003/CPP_EEOPTIONS.h	(revision 26744)
@@ -62,7 +62,4 @@
 C     Use D0 where it means REAL*8 but not where it means REAL*16
 #define D0 d0
-
-C--   Enable some old macro conventions for backward compatibility
-#undef USE_OLD_MACROS_R4R8toRSRL
 
 C=== IO related options ===
Index: /issm/trunk/test/MITgcm/code_4003/CPP_OPTIONS.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/CPP_OPTIONS.h	(revision 26743)
+++ /issm/trunk/test/MITgcm/code_4003/CPP_OPTIONS.h	(revision 26744)
@@ -77,5 +77,5 @@
 
 C o Include/exclude combined Surf.Pressure and Drag Implicit solver code
-#undef ALLOW_SOLVE4_PS_AND_DRAG
+#define ALLOW_SOLVE4_PS_AND_DRAG
 
 C o Include/exclude Implicit vertical advection code
@@ -107,9 +107,9 @@
 
 C o Include/exclude code for single reduction Conjugate-Gradient solver
-#undef ALLOW_SRCG
+#define ALLOW_SRCG
 
 C o Choices for implicit solver routines solve_*diagonal.F
 C   The following has low memory footprint, but not suitable for AD
-#undef SOLVE_DIAGONAL_LOWMEMORY
+#define SOLVE_DIAGONAL_LOWMEMORY
 C   The following one suitable for AD but does not vectorize
 #undef SOLVE_DIAGONAL_KINNER
Index: /issm/trunk/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h	(revision 26743)
+++ /issm/trunk/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h	(revision 26744)
@@ -1,3 +1,2 @@
-
 C     Diagnostics Array Dimension
 C     ---------------------------
@@ -20,8 +19,7 @@
       PARAMETER( ndiagMax = 500 )
       PARAMETER( numlists = 10, numperlist = 50, numLevels=2*Nr )
-      PARAMETER( numDiags = 10*Nr+4 )
-      PARAMETER( nRegions = 0 , sizRegMsk = 1 , nStats = 4 )
+      PARAMETER( numDiags = 20*Nr )
+      PARAMETER( nRegions = 2 , sizRegMsk = 1 , nStats = 4 )
       PARAMETER( diagSt_size = 10*Nr )
-
 
 CEH3 ;;; Local Variables: ***
Index: /issm/trunk/test/MITgcm/code_4003/DIAG_OPTIONS.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/DIAG_OPTIONS.h	(revision 26743)
+++ /issm/trunk/test/MITgcm/code_4003/DIAG_OPTIONS.h	(revision 26744)
@@ -2,13 +2,12 @@
 #define DIAG_OPTIONS_H
 #include "PACKAGES_CONFIG.h"
-#ifdef ALLOW_DIAGNOSTICS
-
 #include "CPP_OPTIONS.h"
 
-CEH3 package-specific options go here
+#ifdef ALLOW_DIAGNOSTICS
+C     Package-specific Options & Macros go here
 
 C allow to define specific regions and the corresponding mask ;
 C  used to perform regional statistics over a limited area
-#undef DIAGSTATS_REGION_MASK
+#define DIAGSTATS_REGION_MASK
 
 C allow to stop & restart at any time (i.e. not at a multiple of
@@ -19,11 +18,6 @@
 #undef  DIAGNOSTICS_HAS_PICKUP
 
-C for NetCDF (mnc) output: define a missing value (default is UNSET_RL)
-C and fill land points of (so far only) scalar fields with it
-#undef DIAGNOSTICS_MISSING_VALUE
-
 #endif /* ALLOW_DIAGNOSTICS */
 #endif /* DIAG_OPTIONS_H */
-
 
 CEH3 ;;; Local Variables: ***
Index: /issm/trunk/test/MITgcm/code_4003/OBCS_OPTIONS.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/OBCS_OPTIONS.h	(revision 26743)
+++ /issm/trunk/test/MITgcm/code_4003/OBCS_OPTIONS.h	(revision 26744)
@@ -1,7 +1,4 @@
 C CPP options file for OBCS package
-C
 C Use this file for selecting options within the OBCS package
-C
-C OBCS is enabled with ALLOW_OBCS in CPP_OPTIONS.h
 
 #ifndef OBCS_OPTIONS_H
@@ -11,4 +8,5 @@
 
 #ifdef ALLOW_OBCS
+C Package-specific Options & Macros go here
 
 C Enable individual open boundaries
@@ -25,11 +23,27 @@
 #define ALLOW_OBCS_PRESCRIBE
 
-C This includes hooks to sponge layer treatment of uvel, vvel
+C Enable OB conditions following Stevens (1990)
+#undef ALLOW_OBCS_STEVENS
+
+C Allow sponge layer treatment of open boundary conditions
 #define ALLOW_OBCS_SPONGE
 
+C Include hooks to sponge layer treatment of pkg/seaice variables
+#undef ALLOW_OBCS_SEAICE_SPONGE
+
 C balance barotropic velocity
-C KS16 turn this on
 #define ALLOW_OBCS_BALANCE
 
+C add tidal contributions to normal OB flow
+C NOTE that at the moment tidal forcing is applied
+C only to "normal" flow.
+#undef ALLOW_OBCS_TIDES
+
+C Use older implementation of obcs in seaice-dynamics
+C note: most of the "experimental" options listed below have not yet
+C       been implementated in new version.
+#undef OBCS_UVICE_OLD
+
+#ifdef OBCS_UVICE_OLD
 C     The following five CPP options are experimental and aim to deal
 C     with artifacts due to the low-frequency specification of sea-ice
@@ -46,10 +60,11 @@
 #undef OBCS_SEAICE_SMOOTH_UVICE_PAR
 
+C     Compute rather than specify seaice velocities at the edges.
+#undef OBCS_SEAICE_COMPUTE_UVICE
+#endif /* OBCS_UVICE_OLD */
+
 C     Smooth the tracer sea-ice variables near the edges.
 #undef OBCS_SEAICE_SMOOTH_EDGE
 
-C     Compute rather than specify seaice velocities at the edges.
-#undef OBCS_SEAICE_COMPUTE_UVICE
-
 #endif /* ALLOW_OBCS */
 #endif /* OBCS_OPTIONS_H */
Index: /issm/trunk/test/MITgcm/code_4003/SHELFICE_OPTIONS.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/SHELFICE_OPTIONS.h	(revision 26743)
+++ /issm/trunk/test/MITgcm/code_4003/SHELFICE_OPTIONS.h	(revision 26744)
@@ -16,16 +16,15 @@
 
 C     allow code for simple ISOMIP thermodynamics
-!#define ALLOW_ISOMIP_TD
+#undef ALLOW_ISOMIP_TD
 
 C     allow friction velocity-dependent transfer coefficient
 C     following Holland and Jenkins, JPO, 1999
 #define SHI_ALLOW_GAMMAFRICT
-C     in uStar expression, use wet-point method to average velocity
-C     at grid-cell center
-!#define SHI_USTAR_WETPOINT
 
+C     allow (vertical) remeshing whenever ocean top thickness factor
+C     exceeds thresholds
 #define ALLOW_SHELFICE_REMESHING
-#define SHI_USTAR_TOPDR
-#undef ALLOW_SHELFICE_GROUNDED_ICE
+C     and allow to print message to STDOUT when this happens
+#define SHELFICE_REMESH_PRINT
 
 #endif /* ALLOW_SHELFICE */
Index: /issm/trunk/test/MITgcm/code_4003/SIZE.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/SIZE.h	(revision 26743)
+++ /issm/trunk/test/MITgcm/code_4003/SIZE.h	(revision 26744)
@@ -1,26 +1,34 @@
+CBOP
+C    !ROUTINE: SIZE.h
+C    !INTERFACE:
+C    include SIZE.h
+C    !DESCRIPTION: \bv
+C     *==========================================================*
+C     | SIZE.h Declare size of underlying computational grid.
+C     *==========================================================*
+C     | The design here supports a three-dimensional model grid
+C     | with indices I,J and K. The three-dimensional domain
+C     | is comprised of nPx*nSx blocks (or tiles) of size sNx
+C     | along the first (left-most index) axis, nPy*nSy blocks
+C     | of size sNy along the second axis and one block of size
+C     | Nr along the vertical (third) axis.
+C     | Blocks/tiles have overlap regions of size OLx and OLy
+C     | along the dimensions that are subdivided.
+C     *==========================================================*
+C     \ev
 C
-C     /==========================================================\
-C     | SIZE.h Declare size of underlying computational grid.    |
-C     |==========================================================|
-C     | The design here support a three-dimensional model grid   |
-C     | with indices I,J and K. The three-dimensional domain     |
-C     | is comprised of nPx*nSx blocks of size sNx along one axis|
-C     | nPy*nSy blocks of size sNy along another axis and one    |
-C     | block of size Nz along the final axis.                   |
-C     | Blocks have overlap regions of size OLx and OLy along the|
-C     | dimensions that are subdivided.                          |
-C     \==========================================================/
-C     Voodoo numbers controlling data layout.
-C     sNx - No. X points in sub-grid.
-C     sNy - No. Y points in sub-grid.
-C     OLx - Overlap extent in X.
-C     OLy - Overlat extent in Y.
-C     nSx - No. sub-grids in X.
-C     nSy - No. sub-grids in Y.
-C     nPx - No. of processes to use in X.
-C     nPy - No. of processes to use in Y.
-C     Nx  - No. points in X for the total domain.
-C     Ny  - No. points in Y for the total domain.
-C     Nr  - No. points in Z for full process domain.
+C     Voodoo numbers controlling data layout:
+C     sNx :: Number of X points in tile.
+C     sNy :: Number of Y points in tile.
+C     OLx :: Tile overlap extent in X.
+C     OLy :: Tile overlap extent in Y.
+C     nSx :: Number of tiles per process in X.
+C     nSy :: Number of tiles per process in Y.
+C     nPx :: Number of processes to use in X.
+C     nPy :: Number of processes to use in Y.
+C     Nx  :: Number of points in X for the full domain.
+C     Ny  :: Number of points in Y for the full domain.
+C     Nr  :: Number of points in vertical direction.
+CEOP
       INTEGER sNx
       INTEGER sNy
@@ -35,6 +43,6 @@
       INTEGER Nr
       PARAMETER (
-     &           sNx =  3,
-     &           sNy =  200,
+     &           sNx =   3,
+     &           sNy =  25,
      &           OLx =   3,
      &           OLy =   3,
@@ -42,12 +50,12 @@
      &           nSy =   1,
      &           nPx =   1,
-     &           nPy =   1,
+     &           nPy =   8,
      &           Nx  = sNx*nSx*nPx,
      &           Ny  = sNy*nSy*nPy,
      &           Nr  =  90)
 
-C     MAX_OLX  - Set to the maximum overlap region size of any array
+C     MAX_OLX :: Set to the maximum overlap region size of any array
 C     MAX_OLY    that will be exchanged. Controls the sizing of exch
-C                routine buufers.
+C                routine buffers.
       INTEGER MAX_OLX
       INTEGER MAX_OLY
@@ -55,5 +63,2 @@
      &            MAX_OLY = OLy )
 
-      INTEGER nobcs
-      PARAMETER ( nobcs = 4 )
-
Index: sm/trunk/test/MITgcm/code_4003/STREAMICE_OPTIONS.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/STREAMICE_OPTIONS.h	(revision 26743)
+++ 	(revision )
@@ -1,32 +1,0 @@
-C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-
-C CPP options file for MYPACKAGE
-C
-C Use this file for selecting options within package "streamice"
-
-#ifndef STREAMICE_OPTIONS_H
-#define STREAMICE_OPTIONS_H
-#include "PACKAGES_CONFIG.h"
-#ifdef ALLOW_STREAMICE
-
-#include "CPP_OPTIONS.h"
-
-C Place CPP define/undef flag here
-
-#define STREAMICE_CONSTRUCT_MATRIX
-#define STREAMICE_HYBRID_STRESS
-#define USE_ALT_RLOW
-#define STREAMICE_GEOM_FILE_SETUP
-!#define STREAMICE_SMOOTH_FLOATATION
-!#define ALLOW_PETSC
-#undef ALLOW_STREAMICE_2DTRACER
-#undef STREAMICE_TRACER_AB
-#undef STREAMICE_SERIAL_TRISOLVE
-#define STREAMICE_FLOWLINE_BUTTRESS
-
-#endif /* ALLOW_MYPACKAGE */
-#endif /* MYPACKAGE_OPTIONS_H */
-
-CEH3 ;;; Local Variables: ***
-CEH3 ;;; mode:fortran ***
-CEH3 ;;; End: ***
Index: /issm/trunk/test/MITgcm/code_4003/cpl_issm.F
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/cpl_issm.F	(revision 26743)
+++ /issm/trunk/test/MITgcm/code_4003/cpl_issm.F	(revision 26744)
@@ -67,5 +67,9 @@
      &        MPI_COMM_MODEL,mpiRC)
          _END_MASTER( myThid )
-C        print*, 'Ocean received CouplingTime: ', CouplingTime
+#ifdef ALLOW_DEBUG
+         IF ( debugLevel .GE. debLevD ) THEN
+            print*, 'Ocean received CouplingTime: ', CouplingTime
+         ENDIF
+#endif
 
 C   I2. MITgcm sends grid size (NX and NY)
@@ -135,5 +139,9 @@
             call MPI_Recv(IceModelTime,1,MPI_DOUBLE,0,10001001,
      &           toissmcomm,mpistatus,mpiRC)
-C           print*, 'Ocean received IceModelTime: ', IceModelTime
+#ifdef ALLOW_DEBUG
+            IF ( debugLevel .GE. debLevD ) THEN
+               print*, 'Ocean received IceModelTime: ', IceModelTime
+            ENDIF
+#endif
             _END_MASTER( myThid )
          ENDIF
@@ -176,6 +184,9 @@
          ENDIF
          CALL BAR2( myThid )
-C        print*,'Done Sending shelficeFreshWaterFlux array.'
-         
+#ifdef ALLOW_DEBUG
+         IF ( debugLevel .GE. debLevD ) THEN
+            print*,'Done Sending shelficeFreshWaterFlux array.'
+         ENDIF
+#endif
       ENDIF
 C End recurring step C3.
Index: /issm/trunk/test/MITgcm/code_4003/do_oceanic_phys.F
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/do_oceanic_phys.F	(revision 26743)
+++ /issm/trunk/test/MITgcm/code_4003/do_oceanic_phys.F	(revision 26744)
@@ -1,4 +1,7 @@
 #include "PACKAGES_CONFIG.h"
 #include "CPP_OPTIONS.h"
+#ifdef ALLOW_MOM_COMMON
+# include "MOM_COMMON_OPTIONS.h"
+#endif
 #ifdef ALLOW_AUTODIFF
 # include "AUTODIFF_OPTIONS.h"
@@ -73,4 +76,6 @@
 C       |-- EXTERNAL_FORCING_SURF
 C       |
+C       |-- OBCS_ADJUST
+C       |
 C       |- k loop (Nr:1):
 C       | - DWNSLP_CALC_RHO
@@ -119,4 +124,6 @@
 C       |
 C       |-- KPP_DO_EXCH
+C       |
+C       |-- GGL90_EXCHANGES
 C       |
 C       |-- DIAGS_RHO_G
@@ -143,6 +150,7 @@
 #ifdef ALLOW_AUTODIFF
 # include "AUTODIFF_MYFIELDS.h"
-# include "tamc.h"
-# include "tamc_keys.h"
+# ifdef ALLOW_AUTODIFF_TAMC
+#  include "tamc.h"
+# endif
 # include "FFIELDS.h"
 # include "SURFACE.h"
@@ -196,5 +204,5 @@
 C     !LOCAL VARIABLES:
 C     == Local variables
-C     rhoK, rhoKm1  :: Density at current level, and level above
+C     rhoKp1,rhoKm1 :: Density at current level, and @ level minus one
 C     iMin, iMax    :: Ranges and sub-block indices on which calculations
 C     jMin, jMax       are applied.
@@ -202,4 +210,5 @@
 C     msgBuf        :: Temp. for building output string
 C     i,j,k         :: loop indices
+C     kSrf          :: surface index
       _RL rhoKp1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
       _RL rhoKm1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
@@ -210,5 +219,5 @@
       INTEGER jMin, jMax
       INTEGER bi, bj
-      INTEGER i, j, k
+      INTEGER i, j, k, kSrf
       CHARACTER*(MAX_LEN_MBUF) msgBuf
       INTEGER doDiagsRho
@@ -221,4 +230,9 @@
       _RL thetaRef
 #endif /* ALLOW_AUTODIFF */
+#ifdef ALLOW_AUTODIFF_TAMC
+      INTEGER act1, act2, act3, act4
+      INTEGER max1, max2, max3
+      INTEGER kkey, itdkey
+#endif
 CEOP
 
@@ -227,4 +241,7 @@
       itdkey = 1
 #endif /* ALLOW_AUTODIFF_TAMC */
+
+      kSrf = 1
+      IF ( usingPCoords ) kSrf = Nr
 
 #ifdef ALLOW_DEBUG
@@ -282,31 +299,17 @@
 
 #ifdef ALLOW_AUTODIFF
-# ifdef ALLOW_SALT_PLUME
       DO bj=myByLo(myThid),myByHi(myThid)
        DO bi=myBxLo(myThid),myBxHi(myThid)
         DO j=1-OLy,sNy+OLy
          DO i=1-OLx,sNx+OLx
+          adjustColdSST_diag(i,j,bi,bj) = 0. _d 0
+# ifdef ALLOW_SALT_PLUME
           saltPlumeDepth(i,j,bi,bj) = 0. _d 0
           saltPlumeFlux(i,j,bi,bj)  = 0. _d 0
+# endif
          ENDDO
         ENDDO
        ENDDO
       ENDDO
-# endif
-# ifdef ALLOW_ECCO
-#  ifdef ALLOW_SIGMAR_COST_CONTRIBUTION
-      DO bj=myByLo(myThid),myByHi(myThid)
-       DO bi=myBxLo(myThid),myBxHi(myThid)
-        DO k=1,Nr
-         DO j=1-OLy,sNy+OLy
-          DO i=1-OLx,sNx+OLx
-           sigmaRfield(i,j,k,bi,bj) = 0. _d 0
-          ENDDO
-         ENDDO
-        ENDDO
-       ENDDO
-      ENDDO
-#  endif
-# endif
 #endif /* ALLOW_AUTODIFF */
 
@@ -320,35 +323,22 @@
 #endif /* ALLOW_FRAZIL */
 
-#ifndef OLD_THSICE_CALL_SEQUENCE
 #if (defined ALLOW_THSICE) && !(defined ALLOW_ATM2D)
       IF ( useThSIce .AND. fluidIsWater ) THEN
 # ifdef ALLOW_AUTODIFF_TAMC
-CADJ STORE uice,vice         = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE snowHeight, Tsrf  = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE Qice1, Qice2      = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE sHeating, snowAge = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE hocemxl = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE icflxsw = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE salt,theta        = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE uvel,vvel         = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE qnet,qsw, empmr   = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE atemp,aqh,precip  = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE swdown,lwdown     = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+#  ifdef ALLOW_SEAICE
+CADJ STORE uice,vice         = comlev1, key=ikey_dynamics, kind=isbyte
+#  endif
+CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE snowHeight, Tsrf  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE Qice1, Qice2      = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE sHeating,snowAge  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE hocemxl, icflxsw  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE salt,theta        = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE uvel,vvel         = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE qnet,qsw, empmr   = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE atemp,aqh,precip  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE swdown,lwdown     = comlev1, key=ikey_dynamics, kind=isbyte
 #  ifdef NONLIN_FRSURF
-CADJ STORE hFac_surfC       = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE hFac_surfC        = comlev1, key=ikey_dynamics, kind=isbyte
 #  endif
 # endif /* ALLOW_AUTODIFF_TAMC */
@@ -363,106 +353,45 @@
       ENDIF
 #endif /* ALLOW_THSICE */
-#endif /* ndef OLD_THSICE_CALL_SEQUENCE */
 
 #ifdef ALLOW_SEAICE
-# ifdef ALLOW_AUTODIFF
-CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE fu,fv  = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE qnet   = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE qsw    = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
+# ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE qnet  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE qsw   = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE salt  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE fu,fv = comlev1, key=ikey_dynamics, kind=isbyte
 #if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP)
-CADJ STORE evap   = comlev1, key=ikey_dynamics, kind=isbyte
-#endif
-      IF ( .NOT.useSEAICE .AND. SEAICEadjMODE .EQ. -1 ) THEN
-        CALL SEAICE_FAKE( myTime, myIter, myThid )
-      ENDIF
-CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE fu,fv  = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE qnet   = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE qsw    = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
-#if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP)
-CADJ STORE evap   = comlev1, key=ikey_dynamics, kind=isbyte
-#endif
-# endif /* ALLOW_AUTODIFF */
-#endif /* ALLOW_SEAICE */
-
-#ifdef ALLOW_SEAICE
+CADJ STORE evap  = comlev1, key=ikey_dynamics, kind=isbyte
+#endif
+# endif /* ALLOW_AUTODIFF_TAMC */
+#ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE phiHydLow= comlev1, key=ikey_dynamics, byte=isbyte
+#endif
       IF ( useSEAICE ) THEN
 # ifdef ALLOW_AUTODIFF_TAMC
-cph-adj-test(
-CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE hsnow  = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE heff   = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE tices  = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE empmr, qnet  = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE qsw,saltflux = comlev1, key=ikey_dynamics, kind=isbyte
-CADJ STORE fu, fv = comlev1, key=ikey_dynamics, kind=isbyte
-cCADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
-cCADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
-cph-adj-test)
-c#ifdef ALLOW_EXF
-CADJ STORE atemp,aqh,precip    = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE swdown,lwdown       = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE evap                = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE uwind,vwind         = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-c#endif
-CADJ STORE uvel,vvel           = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-#  ifdef SEAICE_CGRID
-CADJ STORE stressdivergencex   = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE stressdivergencey   = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-#  endif
-#  ifdef SEAICE_ALLOW_DYNAMICS
-CADJ STORE uice                = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE vice                = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE dwatn               = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-#   ifdef SEAICE_ALLOW_EVP
-CADJ STORE seaice_sigma1       = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE seaice_sigma2       = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE seaice_sigma12      = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-#   endif
+CADJ STORE uvel,vvel         = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE uice,vice         = comlev1, key=ikey_dynamics, kind=isbyte
+#  ifdef ALLOW_EXF
+CADJ STORE atemp,aqh,precip  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE swdown,lwdown     = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE uwind,vwind       = comlev1, key=ikey_dynamics, kind=isbyte
 #  endif
 #  ifdef SEAICE_VARIABLE_SALINITY
-CADJ STORE hsalt               = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE hsalt             = comlev1, key=ikey_dynamics, kind=isbyte
 #  endif
 #  ifdef ATMOSPHERIC_LOADING
-CADJ STORE pload               = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE siceload            = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE pload, siceload   = comlev1, key=ikey_dynamics, kind=isbyte
 #  endif
 #  ifdef NONLIN_FRSURF
-CADJ STORE recip_hfacc         = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE recip_hfacc       = comlev1, key=ikey_dynamics, kind=isbyte
 #  endif
 #  ifdef ANNUAL_BALANCE
-CADJ STORE balance_itcount     = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE balance_itcount   = comlev1, key=ikey_dynamics, kind=isbyte
 #  endif /* ANNUAL_BALANCE */
 #  ifdef ALLOW_THSICE
-C-- store thSIce vars before advection (called from SEAICE_MODEL) update them:
-CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE snowHeight, hOceMxL = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE Qice1, Qice2  = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+C-- store thSIce vars before advection (called from SEAICE_MODEL) updates them:
+CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE snowHeight,hOceMxL= comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE Qice1, Qice2      = comlev1, key=ikey_dynamics, kind=isbyte
 #  endif /* ALLOW_THSICE */
 # endif /* ALLOW_AUTODIFF_TAMC */
@@ -473,7 +402,20 @@
         CALL SEAICE_MODEL( myTime, myIter, myThid )
         CALL TIMER_STOP ('SEAICE_MODEL    [DO_OCEANIC_PHYS]', myThid)
+# ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE tices = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE heff  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE hsnow = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE area  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE uIce  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE vIce  = comlev1, key=ikey_dynamics, kind=isbyte
+# endif
 # ifdef ALLOW_COST
         CALL SEAICE_COST_SENSI ( myTime, myIter, myThid )
 # endif
+# ifdef ALLOW_AUTODIFF
+      ELSEIF ( SEAICEadjMODE .EQ. -1 ) THEN
+CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte
+        CALL SEAICE_FAKE( myTime, myIter, myThid )
+# endif /* ALLOW_AUTODIFF */
       ENDIF
 #endif /* ALLOW_SEAICE */
@@ -493,41 +435,10 @@
 
 #ifdef ALLOW_AUTODIFF_TAMC
-CADJ STORE sst, sss           = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE qsw                = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE sst, sss          = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE qsw               = comlev1, key=ikey_dynamics, kind=isbyte
 # ifdef ALLOW_SEAICE
-CADJ STORE area               = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-# endif
-#endif
-
-#ifdef OLD_THSICE_CALL_SEQUENCE
-#if (defined ALLOW_THSICE) && !(defined ALLOW_ATM2D)
-      IF ( useThSIce .AND. fluidIsWater ) THEN
-# ifdef ALLOW_AUTODIFF_TAMC
-cph(
-#  ifdef NONLIN_FRSURF
-CADJ STORE uice,vice        = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE salt,theta       = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE qnet,qsw, empmr  = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE hFac_surfC       = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-#  endif
-# endif
-# ifdef ALLOW_DEBUG
-        IF (debugMode) CALL DEBUG_CALL('THSICE_MAIN',myThid)
-# endif
-C--     Step forward Therm.Sea-Ice variables
-C       and modify forcing terms including effects from ice
-        CALL TIMER_START('THSICE_MAIN     [DO_OCEANIC_PHYS]', myThid)
-        CALL THSICE_MAIN( myTime, myIter, myThid )
-        CALL TIMER_STOP( 'THSICE_MAIN     [DO_OCEANIC_PHYS]', myThid)
-      ENDIF
-#endif /* ALLOW_THSICE */
-#endif /* OLD_THSICE_CALL_SEQUENCE */
+CADJ STORE area              = comlev1, key=ikey_dynamics, kind=isbyte
+# endif
+#endif
 
 #ifdef ALLOW_CPL_ISSM
@@ -541,8 +452,6 @@
 #endif
 #ifdef ALLOW_AUTODIFF_TAMC
-CADJ STORE salt, theta = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
-CADJ STORE uvel, vvel = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE salt, theta       = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE uvel, vvel        = comlev1, key=ikey_dynamics, kind=isbyte
 #endif
 C     compute temperature and (virtual) salt flux at the
@@ -574,5 +483,5 @@
       IF ( useSALT_PLUME ) THEN
 Catn: exchanging saltPlumeFlux:
-          CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid )
+        CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid )
       ENDIF
 #endif /* ALLOW_SALT_PLUME */
@@ -581,6 +490,5 @@
       IF ( allowFreezing ) THEN
 #ifdef ALLOW_AUTODIFF_TAMC
-CADJ STORE theta = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE theta             = comlev1, key=ikey_dynamics, kind=isbyte
 #endif
         CALL FREEZE_SURFACE( myTime, myIter, myThid )
@@ -595,6 +503,5 @@
 C     relaxation terms, etc.
 #ifdef ALLOW_AUTODIFF
-CADJ STORE salt, theta = comlev1, key = ikey_dynamics,
-CADJ &     kind = isbyte
+CADJ STORE salt, theta       = comlev1, key=ikey_dynamics, kind=isbyte
 #else  /* ALLOW_AUTODIFF */
 C--   if fluid is not water, by-pass surfaceForcing, find_rho, gmredi
@@ -608,4 +515,16 @@
      I             iMin, iMax, jMin, jMax,
      I             myTime, myIter, myThid )
+
+#ifdef  ALLOW_OBCS
+      IF (useOBCS) THEN
+C--   After all surface fluxes are known apply balancing fluxes and
+C--   apply tidal forcing to open boundaries
+# ifdef ALLOW_DEBUG
+       IF (debugMode) CALL DEBUG_CALL('OBCS_ADJUST',myThid)
+# endif
+       CALL OBCS_ADJUST(
+     I      myTime+deltaTClock, myIter+1, myThid )
+      ENDIF
+#endif  /* ALLOW_OBCS */
 
 #ifdef ALLOW_AUTODIFF_TAMC
@@ -645,9 +564,11 @@
            sigmaY(i,j,k) = 0. _d 0
            sigmaR(i,j,k) = 0. _d 0
+#if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG))
+           sigmaRfield(i,j,k,bi,bj) = 0. _d 0
+#endif
           ENDDO
          ENDDO
         ENDDO
 
-#ifdef ALLOW_AUTODIFF
         DO j=1-OLy,sNy+OLy
          DO i=1-OLx,sNx+OLx
@@ -656,4 +577,5 @@
          ENDDO
         ENDDO
+#ifdef ALLOW_AUTODIFF
 cph all the following init. are necessary for TAF
 cph although some of these are re-initialised later.
@@ -697,8 +619,6 @@
            Kwy(i,j,k,bi,bj)  = 0. _d 0
            Kwz(i,j,k,bi,bj)  = 0. _d 0
-#  ifdef GM_NON_UNITY_DIAGONAL
            Kux(i,j,k,bi,bj)  = 0. _d 0
            Kvy(i,j,k,bi,bj)  = 0. _d 0
-#  endif
 #  ifdef GM_EXTRA_DIAGONAL
            Kuz(i,j,k,bi,bj)  = 0. _d 0
@@ -736,22 +656,17 @@
 
 #ifdef ALLOW_AUTODIFF_TAMC
-CADJ STORE theta(:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
-CADJ STORE salt (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ STORE theta(:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
+CADJ STORE salt (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
 CADJ STORE totphihyd(:,:,:,bi,bj)
-CADJ &     = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
 # ifdef ALLOW_KPP
-CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
-CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ STORE uvel (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
+CADJ STORE vvel (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
 # endif
 # ifdef ALLOW_SALT_PLUME
-CADJ STORE saltplumedepth(:,:,bi,bj) = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
-CADJ STORE saltplumeflux(:,:,bi,bj) = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ STORE saltplumedepth(:,:,bi,bj)
+CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
+CADJ STORE saltplumeflux(:,:,bi,bj)
+CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
 # endif
 #endif /* ALLOW_AUTODIFF_TAMC */
@@ -856,12 +771,15 @@
             IF (k.GT.1) THEN
 #ifdef ALLOW_AUTODIFF_TAMC
-CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,
-CADJ &     kind = isbyte
-CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,
-CADJ &     kind = isbyte
-CADJ STORE rhokm1 (bi,bj)       = comlev1_bibj_k, key=kkey,
-CADJ &     kind = isbyte
+CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte
+CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte
+CADJ STORE rhokm1 (bi,bj)       = comlev1_bibj_k, key=kkey,kind=isbyte
 #endif /* ALLOW_AUTODIFF_TAMC */
-             CALL FIND_RHO_2D(
+             IF ( usingZCoords ) THEN
+              DO j=jMin,jMax
+               DO i=iMin,iMax
+                rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)
+               ENDDO
+              ENDDO
+              CALL FIND_RHO_2D(
      I                 iMin, iMax, jMin, jMax, k,
      I                 theta(1-OLx,1-OLy,k-1,bi,bj),
@@ -869,14 +787,21 @@
      O                 rhoKm1,
      I                 k-1, bi, bj, myThid )
+             ELSE
+              CALL FIND_RHO_2D(
+     I                 iMin, iMax, jMin, jMax, k-1,
+     I                 theta(1-OLx,1-OLy,k,bi,bj),
+     I                 salt (1-OLx,1-OLy,k,bi,bj),
+     O                 rhoKp1,
+     I                 k, bi, bj, myThid )
+              DO j=jMin,jMax
+               DO i=iMin,iMax
+                rhoKm1(i,j) = rhoInSitu(i,j,k-1,bi,bj)
+               ENDDO
+              ENDDO
+             ENDIF
             ENDIF
 #ifdef ALLOW_DEBUG
             IF (debugMode) CALL DEBUG_CALL('GRAD_SIGMA',myThid)
 #endif
-cph Avoid variable aliasing for adjoint !!!
-            DO j=jMin,jMax
-             DO i=iMin,iMax
-              rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)
-             ENDDO
-            ENDDO
             CALL GRAD_SIGMA(
      I             bi, bj, iMin, iMax, jMin, jMax, k,
@@ -884,6 +809,6 @@
      O             sigmaX, sigmaY, sigmaR,
      I             myThid )
-#ifdef ALLOW_ECCO
-# ifdef ALLOW_SIGMAR_COST_CONTRIBUTION
+
+#if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG))
             DO j=jMin,jMax
              DO i=iMin,iMax
@@ -891,6 +816,6 @@
              ENDDO
             ENDDO
-# endif
-#endif /* ALLOW_ECCO */
+#endif /* ALLOW_SIGMAR_COST_CONTRIBUTION or ALLOW_LEITH_QG */
+
 #ifdef ALLOW_AUTODIFF
 #ifdef GMREDI_WITH_STABLE_ADJOINT
@@ -929,6 +854,5 @@
 #ifdef ALLOW_AUTODIFF_TAMC
 CADJ STORE IVDConvCount(:,:,:,bi,bj)
-CADJ &     = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
 #endif
 
@@ -936,5 +860,5 @@
         IF ( calcGMRedi .OR. MOD(doDiagsRho,2).EQ.1 ) THEN
           CALL CALC_OCE_MXLAYER(
-     I              rhoInSitu(1-OLx,1-OLy,1,bi,bj), sigmaR,
+     I              rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR,
      I              bi, bj, myTime, myIter, myThid )
         ENDIF
@@ -943,5 +867,5 @@
         IF ( useSALT_PLUME ) THEN
           CALL SALT_PLUME_CALC_DEPTH(
-     I              rhoInSitu(1-OLx,1-OLy,1,bi,bj), sigmaR,
+     I              rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR,
      I              bi, bj, myTime, myIter, myThid )
 #ifdef SALT_PLUME_VOLUME
@@ -950,9 +874,9 @@
 C-- get forcings for kpp
           CALL SALT_PLUME_APPLY(
-     I              1, bi, bj, recip_hFacC(1-OLx,1-OLy,1,bi,bj),
+     I              1, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj),
      I              theta, 0,
      I              myTime, myIter, myThid )
           CALL SALT_PLUME_APPLY(
-     I              2, bi, bj, recip_hFacC(1-OLx,1-OLy,1,bi,bj),
+     I              2, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj),
      I              salt, 0,
      I              myTime, myIter, myThid )
@@ -978,18 +902,11 @@
 cph needed for KPP
 CADJ STORE surfaceForcingU(:,:,bi,bj)
-CADJ &     = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
 CADJ STORE surfaceForcingV(:,:,bi,bj)
-CADJ &     = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
 CADJ STORE surfaceForcingS(:,:,bi,bj)
-CADJ &     = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
 CADJ STORE surfaceForcingT(:,:,bi,bj)
-CADJ &     = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
-CADJ STORE surfaceForcingTice(:,:,bi,bj)
-CADJ &     = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
 #endif /* ALLOW_AUTODIFF_TAMC */
 
@@ -1047,9 +964,9 @@
 #ifdef  ALLOW_GGL90
 #ifdef ALLOW_AUTODIFF_TAMC
-CADJ STORE GGL90TKE (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ STORE GGL90TKE(:,:,:,bi,bj)
+CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
 #endif /* ALLOW_AUTODIFF_TAMC */
 C--     Compute GGL90 mixing coefficients
-        IF (useGGL90) THEN
+        IF ( useGGL90 .AND. Nr.GT.1 ) THEN
 #ifdef ALLOW_DEBUG
           IF (debugMode) CALL DEBUG_CALL('GGL90_CALC',myThid)
@@ -1079,10 +996,7 @@
 cph keep it although TAF says you dont need to.
 cph but I have avoided the #ifdef for now, in case more things change
-CADJ STORE sigmaX(:,:,:)        = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
-CADJ STORE sigmaY(:,:,:)        = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
-CADJ STORE sigmaR(:,:,:)        = comlev1_bibj, key=itdkey,
-CADJ &     kind = isbyte
+CADJ STORE sigmaX(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
+CADJ STORE sigmaY(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
+CADJ STORE sigmaR(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
 # endif
 #endif /* ALLOW_AUTODIFF_TAMC */
@@ -1166,4 +1080,9 @@
 #endif /* ALLOW_KPP */
 
+#ifdef ALLOW_GGL90
+      IF ( useGGL90 )
+     &  CALL GGL90_EXCHANGES( myThid )
+#endif /* ALLOW_GGL90 */
+
 #ifdef ALLOW_DIAGNOSTICS
       IF ( fluidIsWater .AND. useDiagnostics ) THEN
Index: /issm/trunk/test/MITgcm/code_4003/eeboot_minimal.F
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/eeboot_minimal.F	(revision 26743)
+++ /issm/trunk/test/MITgcm/code_4003/eeboot_minimal.F	(revision 26744)
@@ -40,4 +40,10 @@
       INTEGER myComm
 
+C     !FUNCTIONS:
+c     INTEGER  IFNBLNK
+c     EXTERNAL IFNBLNK
+      INTEGER  ILNBLNK
+      EXTERNAL ILNBLNK
+
 C     !LOCAL VARIABLES:
 C     == Local variables ==
@@ -58,5 +64,7 @@
       LOGICAL doReport
 #if defined(ALLOW_OASIS) || defined(COMPONENT_MODULE)
-      INTEGER mpiMyWid
+      INTEGER mpiMyWId
+#elif defined(ALLOW_NEST2W_COMMON)
+      INTEGER mpiMyWId
 #endif
 #ifdef ALLOW_CPL_ISSM
@@ -67,9 +75,13 @@
 #endif /* ALLOW_CPL_ISSM */
 #if defined(ALLOW_NEST_PARENT) || defined(ALLOW_NEST_CHILD)
-      INTEGER mpiMyWid, color
+      INTEGER mpiMyWId, color
 #endif
 #ifdef USE_PDAF
       INTEGER mpi_task_id
+      CHARACTER*(14) fmtStr
+#else
+      CHARACTER*(6) fmtStr
 #endif /* USE_PDAF */
+      INTEGER iTmp
 #endif /* ALLOW_USE_MPI */
 CEOP
@@ -176,4 +188,15 @@
 #endif /* ALLOW_NEST_PARENT | ALLOW_NEST_CHILD */
 
+#ifdef ALLOW_NEST2W_COMMON
+C--    Case with 2-Ways Nest(ing)
+C-     Set the running directory
+       CALL MPI_COMM_RANK( MPI_COMM_WORLD, mpiMyWId, mpiRC )
+       CALL SETDIR( mpiMyWId )
+
+C-     Setup Nesting Execution Environment
+       CALL NEST2W_EEINIT( mpiMyWId )
+       IF ( eeBootError ) GOTO 999
+#endif /* ALLOW_NEST2W_COMMON */
+
 #ifdef ALLOW_CPL_ISSM
 C     add a 1rst preliminary call EESET_PARAMS to set useCoupler
@@ -216,9 +239,14 @@
        ENDIF
        myProcId = mpiMyId
+       iTmp = MAX(4,1 + INT(LOG10(DFLOAT(nPx*nPy))))
 #ifdef USE_PDAF
-       WRITE(myProcessStr,'(I4.4,A1,I4.4)') mpi_task_id,'.',myProcId
+       WRITE(fmtStr,'(4(A,I1),A)')
+     &      '(I',iTmp,'.',iTmp,',A1,I',iTmp,'.',iTmp,')'
+       WRITE(myProcessStr,fmtStr) mpi_task_id,'.',myProcId
 #else
-       WRITE(myProcessStr,'(I4.4)') myProcId
+       WRITE(fmtStr,'(2(A,I1),A)') '(I',iTmp,'.',iTmp,')'
+       WRITE(myProcessStr,fmtStr) myProcId
 #endif /* USE_PDAF */
+       iTmp = ILNBLNK( myProcessStr )
        mpiPidIo = myProcId
        pidIO    = mpiPidIo
@@ -227,13 +255,7 @@
         IF( myProcId .EQ. 0 ) THEN
 #endif
-         WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:4)
-#ifdef USE_PDAF
-         WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:9)
-#endif
+         WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:iTmp)
          OPEN(errorMessageUnit,FILE=fNam,STATUS='unknown')
-         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:4)
-#ifdef USE_PDAF
-         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:9)
-#endif
+         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:iTmp)
          OPEN(standardMessageUnit,FILE=fNam,STATUS='unknown')
 #ifdef SINGLE_DISK_IO
Index: /issm/trunk/test/MITgcm/code_4003/packages.conf
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/packages.conf	(revision 26743)
+++ /issm/trunk/test/MITgcm/code_4003/packages.conf	(revision 26744)
@@ -1,5 +1,5 @@
+#-- list of packages (or group of packages) to compile for this experiment:
 gfd
+obcs
 shelfice
-streamice
-obcs
 diagnostics
Index: /issm/trunk/test/MITgcm/code_4003/shelfice_step_icemass.F
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/shelfice_step_icemass.F	(revision 26744)
+++ /issm/trunk/test/MITgcm/code_4003/shelfice_step_icemass.F	(revision 26744)
@@ -0,0 +1,241 @@
+#include "SHELFICE_OPTIONS.h"
+#ifdef ALLOW_STREAMICE
+# include "STREAMICE_OPTIONS.h"
+#endif
+
+C--   File shelfice_step_icemass.F:
+C--    Contents:
+C--    o SHELFICE_STEP_ICEMASS
+C--    o SHELFICE_NETMASSFLUX_SURF
+
+C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
+CBOP
+C !ROUTINE: SHELFICE_STEP_ICEMASS
+
+C !INTERFACE: ==========================================================
+      SUBROUTINE SHELFICE_STEP_ICEMASS(
+     I                        myTime, myIter, myThid )
+
+C !DESCRIPTION:
+C Serves as a "stub" for ice dynamics
+C will later be used to
+
+C !USES: ===============================================================
+      IMPLICIT NONE
+#include "SIZE.h"
+#include "EEPARAMS.h"
+#include "PARAMS.h"
+#include "GRID.h"
+#include "SHELFICE.h"
+#ifdef ALLOW_STREAMICE
+# include "STREAMICE.h"
+#endif
+
+C     !INPUT/OUTPUT PARAMETERS:
+C     myTime      :: current time in simulation
+C     myIter      :: current iteration number insimulation
+C     myThid      :: my thread Id number
+      _RL  myTime
+      INTEGER myIter
+      INTEGER myThid
+CEOP
+
+#ifdef ALLOW_SHELFICE
+C !LOCAL VARIABLES : ====================================================
+C     i,j, bi,bj  :: loop indices
+      INTEGER bi,bj,i,j
+#ifdef ALLOW_CPL_ISSM
+      _RL  issm_density
+      issm_density = 917.
+#endif /* ALLOW_CPL_ISSM */
+
+      IF ( SHELFICEMassStepping ) THEN
+
+       IF (useStreamIce) THEN
+
+#ifdef ALLOW_STREAMICE
+        DO bj = myByLo(myThid), myByHi(myThid)
+         DO bi = myBxLo(myThid), myBxHi(myThid)
+          DO j=1-OLy,sNy+OLy-1
+           DO i=1-OLx+1,sNx+OLx-1
+            IF ( streamice_hmask(i,j,bi,bj).EQ.1 .OR.
+     &           streamice_hmask(i,j,bi,bj).EQ.2 ) THEN
+             shelficeMass(i,j,bi,bj) =
+     &        H_streamice(i,j,bi,bj) * streamice_density
+            ENDIF
+           ENDDO
+          ENDDO
+         ENDDO
+        ENDDO
+#endif /* ALLOW_STREAMICE */
+
+       ELSEIF (useCoupler) THEN
+
+#ifdef ALLOW_CPL_ISSM
+        DO bj = myByLo(myThid), myByHi(myThid)
+         DO bi = myBxLo(myThid), myBxHi(myThid)
+          DO j=1-OLy,sNy+OLy-1
+           DO i=1-OLx+1,sNx+OLx-1
+             shelficeMass(i,j,bi,bj) =
+     &        R_shelfIce(i,j,bi,bj) * issm_density
+           ENDDO
+          ENDDO
+         ENDDO
+        ENDDO
+#endif /* ALLOW_CPL_ISSM */
+
+       ELSE
+
+        DO bj = myByLo(myThid), myByHi(myThid)
+         DO bi = myBxLo(myThid), myBxHi(myThid)
+
+           IF ( .NOT.SHELFICEDynMassOnly ) THEN
+            DO j=1-OLy,sNy+OLy
+             DO i=1-OLx,sNx+OLx
+              shelficeMass(i,j,bi,bj) = shelficeMass(i,j,bi,bj)
+     &              + shelfIceFreshWaterFlux(i,j,bi,bj)*deltaT
+             ENDDO
+            ENDDO
+           ENDIF
+
+           DO j=1-OLy,sNy+OLy
+            DO i=1-OLx,sNx+OLx
+              shelficeMass(i,j,bi,bj) = shelficeMass(i,j,bi,bj)
+     &              + shelfIceMassDynTendency(i,j,bi,bj)*deltaT
+            ENDDO
+           ENDDO
+
+C--    quick fix to prevent ice-shelf mass to become negative
+           DO j=1-OLy,sNy+OLy
+            DO i=1-OLx,sNx+OLx
+              shelficeMass(i,j,bi,bj) =
+     &              MAX( shelficeMass(i,j,bi,bj), zeroRL )
+            ENDDO
+           ENDDO
+
+         ENDDO
+        ENDDO
+       ENDIF
+
+       _EXCH_XY_RL( shelficeMass, myThid )
+
+      ENDIF
+
+#ifdef ALLOW_DIAGNOSTICS
+      IF (useDiagnostics) THEN
+        CALL DIAGNOSTICS_FILL( shelficeMass, 'SHI_mass',
+     I                         0, 1, 0, 1, 1, myThid )
+      ENDIF
+#endif /* ALLOW_DIAGNOSTICS */
+#endif /* ALLOW_SHELFICE */
+
+      RETURN
+      END
+
+C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
+CBOP
+C !ROUTINE: SHELFICE_NETMASSFLUX_SURF
+
+C !INTERFACE: ==========================================================
+      SUBROUTINE SHELFICE_NETMASSFLUX_SURF(
+     O                        shelfIceNetMassFlux,
+     I                        myTime, myIter, myThid )
+
+C !DESCRIPTION:
+C compute the net mass flux implied by S/R SHELFICE_STEP_MASS
+
+C !USES: ===============================================================
+      IMPLICIT NONE
+#include "SIZE.h"
+#include "EEPARAMS.h"
+#include "PARAMS.h"
+#include "GRID.h"
+#include "SHELFICE.h"
+#ifdef ALLOW_STREAMICE
+# include "STREAMICE.h"
+#endif
+#include "DYNVARS.h"
+
+C     !INPUT/OUTPUT PARAMETERS:
+C     myTime      :: current time in simulation
+C     myIter      :: current iteration number insimulation
+C     myThid      :: my thread Id number
+      _RL  myTime
+      INTEGER myIter
+      INTEGER myThid
+C     net mass flux in m^3/s
+      _RL shelfIceNetMassFlux
+CEOP
+
+#ifdef ALLOW_SHELFICE
+C !LOCAL VARIABLES : ====================================================
+C     i,j, bi,bj  :: loop indices
+      INTEGER bi,bj,i,j
+      _RL shelfIceNetMassFluxTile(nSx,nSy)
+
+      shelfIceNetMassFlux = 0. _d 0
+
+      IF ( SHELFICEMassStepping ) THEN
+
+       IF (useStreamIce) THEN
+
+#ifdef ALLOW_STREAMICE
+        DO bj = myByLo(myThid), myByHi(myThid)
+         DO bi = myBxLo(myThid), myBxHi(myThid)
+          shelfIceNetMassFluxTile(bi,bj) = 0. _d 0
+          DO j=1,sNy
+           DO i=1,sNx
+            IF ( streamice_hmask(i,j,bi,bj).EQ.1 .OR.
+     &           streamice_hmask(i,j,bi,bj).EQ.2 ) THEN
+C--   this assumes that the change in H_streamice include the melting flux
+CML             shelfIceNetMassFluxTile(bi,bj) =
+CML     &              shelfIceNetMassFluxTile(bi,bj)
+CML     &            +(H_streamice(i,j,bi,bj)-H_streamice_prev(i,j,bi,bj))
+CML     &            /deltaT * streamice_density * mass2rUnit
+CML     &            * _rA(i,j,bi,bj) * maskInC(i,j,bi,bj)
+            ENDIF
+           ENDDO
+          ENDDO
+         ENDDO
+        ENDDO
+#endif /* ALLOW_STREAMICE */
+
+       ELSE
+
+        DO bj = myByLo(myThid), myByHi(myThid)
+         DO bi = myBxLo(myThid), myBxHi(myThid)
+          shelfIceNetMassFluxTile(bi,bj) = 0. _d 0
+          DO j=1,sNy
+           DO i=1,sNx
+C--   Flux of new ice will raise the sea level
+            shelfIceNetMassFluxTile(bi,bj) =
+     &             shelfIceNetMassFluxTile(bi,bj)
+     &           + shelfIceMassDynTendency(i,j,bi,bj)
+     &           * _rA(i,j,bi,bj) * maskInC(i,j,bi,bj)
+            IF ( .NOT.SHELFICEDynMassOnly ) THEN
+C--   Freshwater flux by thermodynamic processes. In the case of
+C     melting this will be negative (positive upward) so it will reduce
+C     the amount of added ice mass. The same freshwater flux is added
+C     to the ocean in EmPmR and will raise the sea level, so that this
+C     contribution is canceled.
+             shelfIceNetMassFluxTile(bi,bj) =
+     &              shelfIceNetMassFluxTile(bi,bj)
+     &            + shelfIceFreshWaterFlux(i,j,bi,bj)
+     &            * _rA(i,j,bi,bj) * maskInC(i,j,bi,bj)
+            ENDIF
+           ENDDO
+          ENDDO
+         ENDDO
+        ENDDO
+
+       ENDIF
+
+       CALL GLOBAL_SUM_TILE_RL( shelficeNetMassFluxTile,
+     &      shelficeNetMassFlux, myThid )
+
+      ENDIF
+
+#endif /* ALLOW_SHELFICE */
+
+      RETURN
+      END
Index: /issm/trunk/test/MITgcm/coupling_rules.txt
===================================================================
--- /issm/trunk/test/MITgcm/coupling_rules.txt	(revision 26743)
+++ /issm/trunk/test/MITgcm/coupling_rules.txt	(revision 26744)
@@ -11,4 +11,6 @@
 yC                     Nx*Ny       Real*8  10001006
 IceBase                Nx*Ny       Real*8  10001007
+    (in m, 0 is sea level, negative is below sea level, 9999 is no ice,
+     use density 917 kg/m^3)
 OceanMelt              Nx*Ny       Real*8  10001008
 
Index: sm/trunk/test/MITgcm/get_mitgcm_dngoldberg.sh
===================================================================
--- /issm/trunk/test/MITgcm/get_mitgcm_dngoldberg.sh	(revision 26743)
+++ 	(revision )
@@ -1,15 +1,0 @@
-#!/bin/bash
-
-if [ -e ~/.bashrc ]; then 
-	source ~/.bashrc
-fi
-
-# Download fresh copy of MITgcm
-cd ../MITgcm/
-if [ ! -d install_dngoldberg ]; then
-    source install_dngoldberg.sh
-else
-    cd install_dngoldberg
-    git pull
-    cd ..
-fi
Index: /issm/trunk/test/MITgcm/input_4003/data
===================================================================
--- /issm/trunk/test/MITgcm/input_4003/data	(revision 26743)
+++ /issm/trunk/test/MITgcm/input_4003/data	(revision 26744)
@@ -1,3 +1,3 @@
-#:::====================
+# ====================
 # | Model parameters |
 # ====================
@@ -5,65 +5,50 @@
 # Continuous equation parameters
  &PARM01
-# momstepping=.FALSE.,
-# tempstepping=.FALSE.,
-# saltstepping=.FALSE.,
- Tref = 90*-1.9,
- Sref = 90*34.4,
+ tRef = 90*-1.9,
+ sRef = 90*34.4,
+ eosType='JMD95Z',
+ HeatCapacity_Cp = 3974.0,
+ rhoConst=1030.,
+ gravity=9.81,
  viscAr=1.E-3,
-#viscAh=600.0,
- viscAhGrid=0.2,
- viscA4Grid=0.02,
+ viscAh= 300.,
  no_slip_sides=.FALSE.,
  no_slip_bottom=.FALSE.,
- diffKhT= 100.0,
-#diffKhT= 600.0,
+ diffKhT= 10.,
  diffKrT=5.E-5,
- diffKhS= 100.0,
-#diffKhS= 600.0,
+ diffKhS= 10.,
  diffKrS=5.E-5,
  bottomDragQuadratic=2.5E-3,
- staggerTimestep = .true.,
- tempAdvScheme=30,
- saltAdvScheme=30,
- vectorInvariantMomentum = .true.,
-### momImplVertAdv=.true.,
- tempImplVertAdv=.true.,
- saltImplVertAdv=.true.,
- eosType='JMD95Z',
-#tAlpha = 2.E-4,
-#sBeta  = 7.4E-4,
- HeatCapacity_cp = 3974.0,
- rhoConst=1000.,
- rhoNil=1000.,
- gravity=9.81,
- gBaro=9.81,
- implicitDiffusion = .true.,
- implicitViscosity = .true.,
- rigidLid=.FALSE.,
+ staggerTimestep = .TRUE.,
+ tempAdvScheme=77,
+ saltAdvScheme=77,
+ vectorInvariantMomentum = .TRUE.,
+# momImplVertAdv=.TRUE.,
+#tempImplVertAdv=.TRUE.,
+#saltImplVertAdv=.TRUE.,
+ implicitDiffusion = .TRUE.,
+ implicitViscosity = .TRUE.,
+ selectImplicitDrag = 2,
  implicitFreeSurface=.TRUE.,
- useRealFreshWaterFlux = .true.,
+ useRealFreshWaterFlux = .TRUE.,
  exactConserv=.TRUE.,
-# start nlfs with rstar
-#select_rStar=2,
+# start NLFS (without rstar)
  nonlinFreeSurf=4,
- hFacInf=0.2,
+ hFacInf=0.05,
  hFacSup=2.0,
-# end nlfs with rstar
- hFacMin=0.2,
+# end NLFS
+ hFacMin=0.10,
 #integr_GeoPot = 1,
-#ivdc_kappa = 0.005.,
-#implicitDiffusion=.true.,
-#implicitViscosity=.true.,
-#useCDscheme=.true.,
-#nonHydrostatic=.true.,
-#allowFreezing = .true.,
+ ivdc_kappa = 1.,
+ useJamartWetPoints=.TRUE.,
+ selectBotDragQuadr=1,
+#bottomVisc_pCell=.TRUE.,
+#-
  readBinaryPrec=64,
 #writeBinaryPrec=64,
- debuglevel = 5,
- selectCoriMap = 0,
- f0 = 0.0,
  useSingleCpuIO=.TRUE.,
- globalFiles=.TRUE.,
- useCoriolis=.TRUE.,
+#globalFiles=.TRUE.,
+ debuglevel = 2,
+ plotLevel = 0,
  &
 
@@ -72,62 +57,44 @@
  cg2dMaxIters=300,
  cg2dTargetResidual=1.E-11,
-# cg2dMinColumnEps = 1.
-# pReleaseVisc = 1.
-#cg3dMaxIters=40,
-#cg3dTargetResidual=1.E-13,
+#printResidualFreq=100,
  &
 
 #Time stepping parameters
  &PARM03
- niter0=11395,
- nTimeSteps=1440,
-# nTimeSteps=20,
-# startTime=0.,
-# startTime = 0.,
-#startTime=62208000.,
-#startTime=15552000.,
-#endTime=31104000.,
-#endTime=86400.,
-# deltaT=300.0,
- deltaT=60.0,
-### deltaT=1200.0,
- forcing_In_AB  = .false.,
-#rCD = 0.9896,
+ startTime=0.,
+ nTimeSteps=192,
+#endTime=2592000.,
+ deltaT=450.0,
+ forcing_In_AB  = .FALSE.,
  abEps=0.1,
- cAdjFreq = -1.,
- pChkptFreq=3000,
- chkptFreq=3000.0,
-# pChkptFreq=600.0,
-# chkptFreq=600.0,
- dumpFreq=3000,
-# monitorFreq=15552000.,
-# monitorSelect=0,
- monitorFreq=60.,
+ pChkptFreq= 2592000.,
+ chkptFreq = 2592000.,
+ dumpFreq =  86400.,
+ monitorFreq=1.,
  &
 
 # Gridding parameters
  &PARM04
- useMin4hFacEdges=.TRUE.,
  usingCartesianGrid=.FALSE.,
  usingSphericalPolarGrid=.TRUE.,
-#delR = 10., 10., 10., 10., 10., 10., 10., 10.01, 10.03, 10.11,
-#10.32, 10.8, 11.76, 13.42, 16.04, 19.82, 24.85, 31.1, 38.42, 46.5,
-#55., 63.5, 71.58, 78.9, 85.15, 90.18, 93.96, 96.58, 98.25, 99.25,
-#100.01, 101.33, 104.56, 111.33, 122.83, 139.09, 158.94, 180.83, 203.55, 226.5,
-#249.5, 272.5, 295.5, 318.5, 341.5, 364.5, 387.5, 410.5, 433.5, 456.5,
  delR=90*10.,
  delX=3*.125,
  delY=200*.0078125,
-# delYFile='dlat.bin',
-# delY=30*10e3,
- xgOrigin = -105.5,
- ygOrigin =  -75.4457,
+ xgOrigin = 0.,
+ ygOrigin = -75.5,
+ pCellMix_select=20,
+ pcellMix_delR = 10.,
+#interViscAr_pCell = .TRUE.,
+#interDiffKr_pCell = .TRUE.,
+ pCellMix_viscAr = 90*1.E-3,
+ pCellMix_diffKr = 90*1.E-4,
+# current default: diffKzT=5.E-5, viscAz=1.E-3,
  &
 
 # Input datasets
  &PARM05
- bathyFile='bathy.box',
- hydrogThetaFile='theta.init',	
- hydrogSaltFile='salt.init',
- pSurfInitFile='etainit.round.bin',
+ bathyFile='bathy_flat.bin',
+ hydrogThetaFile='temp_ini.bin',	
+ hydrogSaltFile ='salt_ini.bin',
+# pSurfInitFile ='etai_ini.bin'
  &
Index: /issm/trunk/test/MITgcm/input_4003/data.diagnostics
===================================================================
--- /issm/trunk/test/MITgcm/input_4003/data.diagnostics	(revision 26744)
+++ /issm/trunk/test/MITgcm/input_4003/data.diagnostics	(revision 26744)
@@ -0,0 +1,69 @@
+# Diagnostic Package Choices
+#-----------------
+# for each output-stream:
+#  filename(n) : prefix of the output file name (only 8.c long) for outp.stream n
+#  frequency(n):< 0 : write snap-shot output every |frequency| seconds
+#               > 0 : write time-average output every frequency seconds
+#  timePhase(n)     : write at time = timePhase + multiple of |frequency|
+#  averagingFreq(n) : frequency (in s) for periodic averaging interval
+#  averagingPhase(n): phase     (in s) for periodic averaging interval
+#  repeatCycle(n)   : number of averaging intervals in 1 cycle
+#  levels(:,n) : list of levels to write to file (Notes: declared as REAL)
+#                 when this entry is missing, select all common levels of this list
+#  fields(:,n) : list of diagnostics fields (8.c) (see "available_diagnostics.log"
+#                 file for the list of all available diag. in this particular config)
+#-----------------
+ &DIAGNOSTICS_LIST
+# diag_mnc     = .FALSE.,
+  dumpAtLast   = .TRUE.,
+  fields(1:13,1) = 'ETAN    ','RSURF   ','oceTAUX ','oceTAUY ',
+                   'oceQnet ','oceFWflx','MXLDEPTH',
+                   'SHIfwFlx','SHIhtFlx','SHIgammT','SHIgammS',
+                   'SHI_mass','SHIuStar',
+#                  'surForcT','surForcS','TFLUX   ','SFLUX   ','oceFreez',
+#                  'TRELAX  ','SRELAX  ',
+#  fields(1,1)='ETAN'
+   filename(1) = 'surfDiag',
+   frequency(1) =  86400.,
+#-
+  fields(1:10,2) = 'UVEL    ','VVEL    ','WVEL    ',
+                   'THETA   ','SALT    ','RHOAnoma', 'CONVADJ'
+                   'hFactorC','hFactorW','hFactorS',
+   filename(2) = 'dynDiag',
+  fileFlags(2) = '  h     ',
+  frequency(2) =  86400.,
+#-
+  fields(1:7,3) =  'ETAN    ','RSURF   ',
+                   'oceQnet ','oceFWflx',
+                   'SHIfwFlx','SHIhtFlx','SHIuStar',
+#  filename(3) = 'surfInst',
+  frequency(3) =  -86400.,
+  timePhase(3) = 0.,
+#-
+  fields(1:8,4)  = 'UVEL    ','VVEL    ','WVEL    ',
+                   'THETA   ','SALT    ',
+                   'hFactorC','hFactorW','hFactorS',
+#  filename(4) = 'dynInst',
+  frequency(4) =  -86400.,
+  timePhase(4) = 0.,
+ &
+
+#--------------------
+# Parameter for Diagnostics of per level statistics:
+#--------------------
+#  diagSt_mnc (logical): write stat-diags to NetCDF files (default=diag_mnc)
+#  diagSt_regMaskFile : file containing the region-mask to read-in
+#  nSetRegMskFile   : number of region-mask sets within the region-mask file
+#  set_regMask(i)   : region-mask set-index that identifies the region "i"
+#  val_regMask(i)   : region "i" identifier value in the region mask
+#--for each output-stream:
+#  stat_fName(n) : prefix of the output file name (max 80c long) for outp.stream n
+#  stat_freq(n):< 0 : write snap-shot output every |stat_freq| seconds
+#               > 0 : write time-average output every stat_freq seconds
+#  stat_phase(n)    : write at time = stat_phase + multiple of |stat_freq|
+#  stat_region(:,n) : list of "regions" (default: 1 region only=global)
+#  stat_fields(:,n) : list of selected diagnostics fields (8.c) in outp.stream n
+#                (see "available_diagnostics.log" file for the full list of diags)
+#--------------------
+ &DIAG_STATIS_PARMS
+ &
Index: /issm/trunk/test/MITgcm/input_4003/data.obcs
===================================================================
--- /issm/trunk/test/MITgcm/input_4003/data.obcs	(revision 26744)
+++ /issm/trunk/test/MITgcm/input_4003/data.obcs	(revision 26744)
@@ -0,0 +1,32 @@
+# Open-boundaries
+ &OBCS_PARM01
+ OB_Jnorth=3*200,
+ useOBCSprescribe=.TRUE.,
+#OBWuFile='uVel_obc.bin',
+ OBNvFile='vVel_obc.bin',
+ OBNtFile='temp_obc.bin',
+ OBNsFile='salt_obc.bin',
+ OBCS_u1_adv_T=1,
+ OBCS_u1_adv_S=1,
+#--
+ useOBCSsponge=.TRUE.,
+ useLinearSponge = .TRUE.,
+#- default is =T for these specific switches:
+#OBCSsponge_VatNS=.TRUE.,
+ OBCSsponge_UatNS=.FALSE.,
+#--
+ OBCSprintDiags = .FALSE.,
+ &
+
+# Orlanski parameters (skipped with #undef ALLOW_ORLANSKI)
+#&OBCS_PARM02
+#Cmax=0.45,
+#cVelTimeScale=1000.,
+#&
+
+# Sponge layer parameters
+ &OBCS_PARM03
+ spongeThickness = 10,
+ Vrelaxobcsbound = 864000.,
+ Urelaxobcsbound = 864000.,
+ &
Index: /issm/trunk/test/MITgcm/input_4003/data.pkg
===================================================================
--- /issm/trunk/test/MITgcm/input_4003/data.pkg	(revision 26744)
+++ /issm/trunk/test/MITgcm/input_4003/data.pkg	(revision 26744)
@@ -0,0 +1,6 @@
+# Packages (lines beginning "#" are comments)
+ &PACKAGES
+ useOBCS=.TRUE.,
+ useShelfIce=.TRUE.,
+ useDiagnostics = .TRUE.,
+ &
Index: /issm/trunk/test/MITgcm/input_4003/data.shelfice
===================================================================
--- /issm/trunk/test/MITgcm/input_4003/data.shelfice	(revision 26744)
+++ /issm/trunk/test/MITgcm/input_4003/data.shelfice	(revision 26744)
@@ -0,0 +1,22 @@
+# ===================================
+# | Parameters for SHELFICE package |
+# ===================================
+ &SHELFICE_PARM01
+ SHELFICEconserve = .TRUE.,
+ SHELFICEuseGammaFrict = .TRUE.,
+ SHELFICEDragQuadratic = 0.0015,
+ shiCdrag = 0.0015,
+ SHELFICEselectDragQuadr= 2,
+ SHELFICEMassStepping = .TRUE.,
+#--
+ SHELFICEremeshFrequency = 600.0,
+#- need to satisfy: splitThrs > 1 + mergeThrs / Sdz
+#       with: Sdz = min{ delR(k+1)/delR(k) }_[k=1:Nr-1]
+ SHELFICEsplitThreshold = 1.12,
+ SHELFICEmergeThreshold = 0.10,
+#--
+ SHELFICEtopoFile='shelficeTopo.Lin.bin',
+ SHELFICEmassFile='shelficeMass.Lin.bin',
+ SHELFICEMassDynTendFile='shelfice_dMdt.r02.bin',
+#SHELFICEwriteState = .TRUE.,
+ &
Index: /issm/trunk/test/MITgcm/input_4003/data_uncoupled
===================================================================
--- /issm/trunk/test/MITgcm/input_4003/data_uncoupled	(revision 26743)
+++ /issm/trunk/test/MITgcm/input_4003/data_uncoupled	(revision 26744)
@@ -1,3 +1,3 @@
-#:::====================
+# ====================
 # | Model parameters |
 # ====================
@@ -5,65 +5,50 @@
 # Continuous equation parameters
  &PARM01
-# momstepping=.FALSE.,
-# tempstepping=.FALSE.,
-# saltstepping=.FALSE.,
- Tref = 90*-1.9,
- Sref = 90*34.4,
+ tRef = 90*-1.9,
+ sRef = 90*34.4,
+ eosType='JMD95Z',
+ HeatCapacity_Cp = 3974.0,
+ rhoConst=1030.,
+ gravity=9.81,
  viscAr=1.E-3,
-#viscAh=600.0,
- viscAhGrid=0.2,
- viscA4Grid=0.02,
+ viscAh= 300.,
  no_slip_sides=.FALSE.,
  no_slip_bottom=.FALSE.,
- diffKhT= 100.0,
-#diffKhT= 600.0,
+ diffKhT= 10.,
  diffKrT=5.E-5,
- diffKhS= 100.0,
-#diffKhS= 600.0,
+ diffKhS= 10.,
  diffKrS=5.E-5,
  bottomDragQuadratic=2.5E-3,
- staggerTimestep = .true.,
- tempAdvScheme=30,
- saltAdvScheme=30,
- vectorInvariantMomentum = .true.,
-### momImplVertAdv=.true.,
- tempImplVertAdv=.true.,
- saltImplVertAdv=.true.,
- eosType='JMD95Z',
-#tAlpha = 2.E-4,
-#sBeta  = 7.4E-4,
- HeatCapacity_cp = 3974.0,
- rhoConst=1000.,
- rhoNil=1000.,
- gravity=9.81,
- gBaro=9.81,
- implicitDiffusion = .true.,
- implicitViscosity = .true.,
- rigidLid=.FALSE.,
+ staggerTimestep = .TRUE.,
+ tempAdvScheme=77,
+ saltAdvScheme=77,
+ vectorInvariantMomentum = .TRUE.,
+# momImplVertAdv=.TRUE.,
+#tempImplVertAdv=.TRUE.,
+#saltImplVertAdv=.TRUE.,
+ implicitDiffusion = .TRUE.,
+ implicitViscosity = .TRUE.,
+ selectImplicitDrag = 2,
  implicitFreeSurface=.TRUE.,
- useRealFreshWaterFlux = .true.,
+ useRealFreshWaterFlux = .TRUE.,
  exactConserv=.TRUE.,
-# start nlfs with rstar
-#select_rStar=2,
+# start NLFS (without rstar)
  nonlinFreeSurf=4,
- hFacInf=0.2,
+ hFacInf=0.05,
  hFacSup=2.0,
-# end nlfs with rstar
- hFacMin=0.2,
+# end NLFS
+ hFacMin=0.10,
 #integr_GeoPot = 1,
-#ivdc_kappa = 0.005.,
-#implicitDiffusion=.true.,
-#implicitViscosity=.true.,
-#useCDscheme=.true.,
-#nonHydrostatic=.true.,
-#allowFreezing = .true.,
+ ivdc_kappa = 1.,
+ useJamartWetPoints=.TRUE.,
+ selectBotDragQuadr=1,
+#bottomVisc_pCell=.TRUE.,
+#-
  readBinaryPrec=64,
-#writeBinaryPrec=64,
- debuglevel = 5,
- selectCoriMap = 0,
- f0 = 0.0,
+ writeBinaryPrec=64,
  useSingleCpuIO=.TRUE.,
- globalFiles=.TRUE.,
- useCoriolis=.TRUE.,
+#globalFiles=.TRUE.,
+ debuglevel = 2,
+ plotLevel = 0,
  &
 
@@ -72,60 +57,53 @@
  cg2dMaxIters=300,
  cg2dTargetResidual=1.E-11,
-# cg2dMinColumnEps = 1.
-# pReleaseVisc = 1.
-#cg3dMaxIters=40,
-#cg3dTargetResidual=1.E-13,
+#printResidualFreq=100,
  &
 
 #Time stepping parameters
  &PARM03
-  niter0=11395,
-# nTimeSteps=25920000,
+#nIter0=2880,
+#nTimeSteps=288,
+#startTime=0.,
+#endTime=2592000.,
+ deltaT=300.0,
+ forcing_In_AB  = .FALSE.,
+ abEps=0.1,
+ pChkptFreq= 2592000.,
+ chkptFreq = 2592000.,
+ dumpFreq =  86400.,
+ monitorFreq= 7200.,
+ monitorSelect=1,
+ monitorFreq=1800.,
+ dumpFreq = 10800.,
+#- for testing purpose:
+ nIter0=2898,
  nTimeSteps=20,
-# startTime=0.,
-# startTime = 0.,
-#startTime=62208000.,
-#startTime=15552000.,
-#endTime=31104000.,
- deltaT=300.0,
-### deltaT=1200.0,
- forcing_In_AB  = .false.,
-#rCD = 0.9896,
- abEps=0.1,
- cAdjFreq = -1.,
- pChkptFreq=3000,
- chkptFreq=3000.0,
-# pChkptFreq=600.0,
-# chkptFreq=600.0,
- dumpFreq=3000,
-# monitorFreq=15552000.,
-# monitorSelect=0,
-# monitorFreq=31104000.,
+#dumpFreq = 1200.,
+ monitorFreq=1.,
  &
 
 # Gridding parameters
  &PARM04
- useMin4hFacEdges=.TRUE.,
  usingCartesianGrid=.FALSE.,
  usingSphericalPolarGrid=.TRUE.,
-#delR = 10., 10., 10., 10., 10., 10., 10., 10.01, 10.03, 10.11,
-#10.32, 10.8, 11.76, 13.42, 16.04, 19.82, 24.85, 31.1, 38.42, 46.5,
-#55., 63.5, 71.58, 78.9, 85.15, 90.18, 93.96, 96.58, 98.25, 99.25,
-#100.01, 101.33, 104.56, 111.33, 122.83, 139.09, 158.94, 180.83, 203.55, 226.5,
-#249.5, 272.5, 295.5, 318.5, 341.5, 364.5, 387.5, 410.5, 433.5, 456.5,
  delR=90*10.,
- delX=3*.125,
+ delX=1*.125,
  delY=200*.0078125,
-# delYFile='dlat.bin',
-# delY=30*10e3,
- xgOrigin = -105.5,
- ygOrigin =  -75.4457,
+ xgOrigin = 0.,
+ ygOrigin = -75.5,
+ pCellMix_select=20,
+ pcellMix_delR = 10.,
+#interViscAr_pCell = .TRUE.,
+#interDiffKr_pCell = .TRUE.,
+ pCellMix_viscAr = 90*1.E-3,
+ pCellMix_diffKr = 90*1.E-4,
+# current default: diffKzT=5.E-5, viscAz=1.E-3,
  &
 
 # Input datasets
  &PARM05
- bathyFile='bathy.box',
- hydrogThetaFile='theta.init',	
- hydrogSaltFile='salt.init',
- pSurfInitFile='etainit.round.bin',
+ bathyFile='bathy_flat.bin',
+ hydrogThetaFile='temp_ini.bin',	
+ hydrogSaltFile ='salt_ini.bin',
+# pSurfInitFile ='etai_ini.bin'
  &
Index: /issm/trunk/test/MITgcm/input_4003/eedata
===================================================================
--- /issm/trunk/test/MITgcm/input_4003/eedata	(revision 26743)
+++ /issm/trunk/test/MITgcm/input_4003/eedata	(revision 26744)
@@ -1,11 +1,11 @@
 # Example "eedata" file
 # Lines beginning "#" are comments
-# nTx - No. threads per process in X
-# nTy - No. threads per process in Y
+#  nTx      :: No. threads per process in X
+#  nTy      :: No. threads per process in Y
+# debugMode :: print debug msg (sequence of S/R calls)
  &EEPARMS
  useCoupler=.TRUE.,
  debugMode=.TRUE.,
  &
-# Note: Some systems use & as the
-# namelist terminator. Other systems
-# use a / character (as shown here).
+# Note: Some systems use & as the namelist terminator (as shown here).
+#       Other systems use a / character.
Index: /issm/trunk/test/MITgcm/input_4003/eedata_uncoupled
===================================================================
--- /issm/trunk/test/MITgcm/input_4003/eedata_uncoupled	(revision 26743)
+++ /issm/trunk/test/MITgcm/input_4003/eedata_uncoupled	(revision 26744)
@@ -1,11 +1,10 @@
 # Example "eedata" file
 # Lines beginning "#" are comments
-# nTx - No. threads per process in X
-# nTy - No. threads per process in Y
+#  nTx      :: No. threads per process in X
+#  nTy      :: No. threads per process in Y
+# debugMode :: print debug msg (sequence of S/R calls)
  &EEPARMS
  useCoupler=.FALSE.,
-# debugMode=.TRUE.,
  &
-# Note: Some systems use & as the
-# namelist terminator. Other systems
-# use a / character (as shown here).
+# Note: Some systems use & as the namelist terminator (as shown here).
+#       Other systems use a / character.
Index: /issm/trunk/test/MITgcm/install.sh
===================================================================
--- /issm/trunk/test/MITgcm/install.sh	(revision 26743)
+++ /issm/trunk/test/MITgcm/install.sh	(revision 26744)
@@ -1,10 +1,27 @@
 #!/bin/bash
 
-#Some cleanup
+
+# Cleanup
 rm -rf install
 
-#Download code from server
+################################################################################
+
+# Download source
 git clone --depth=1 https://github.com/MITgcm/MITgcm.git
 
-#Move
+# Move source to 'install' directory
 mv MITgcm install
+
+################################################################################
+
+# Comment out the above, uncomment the following and set to a specific tagged release if the MITgcm repo head is buggy
+#
+
+# # Download source
+# wget https://github.com/MITgcm/MITgcm/archive/refs/tags/checkpoint67x.tar.gz
+
+# # Uncompress source
+# tar -xvzf checkpoint67x.tar.gz
+
+# # Move source to 'install' directory
+# mv MITgcm-checkpoint67x install
Index: sm/trunk/test/MITgcm/install_dngoldberg.sh
===================================================================
--- /issm/trunk/test/MITgcm/install_dngoldberg.sh	(revision 26743)
+++ 	(revision )
@@ -1,13 +1,0 @@
-#!/bin/bash
-
-#Some cleanup
-rm -rf install_dngoldberg
-
-#Download code from server
-git clone https://github.com/dngoldberg/MITgcm
-cd MITgcm
-git checkout branch_remeshing
-cd ..
-
-#Move
-mv MITgcm install_dngoldberg
Index: /issm/trunk/test/MITgcm/tools/pcolorcen.m
===================================================================
--- /issm/trunk/test/MITgcm/tools/pcolorcen.m	(revision 26744)
+++ /issm/trunk/test/MITgcm/tools/pcolorcen.m	(revision 26744)
@@ -0,0 +1,48 @@
+function h=pcolorcen(x,y,z)
+
+% h = pcolorcen(x,y,z);
+% h = pcolorcen(z);
+%
+% like pcolor.m, except it fixes the problem wherein the last row and column of z
+% don't get displayed and values are plotted above and to the right of the corresponding
+% values in x and y. "cen" is for centered.
+%
+% in other words: use pcolor when you're specifying the corners of your grid cells, and
+% pcolorcen when you're specifying the centers.
+%
+% x and y can be vectors; pcolorcen will call meshgrid to save you the trouble.
+%
+% sets shading flat for good measure.
+%
+% neil banas jul 2002
+% (neil@ocean.washington.edu)
+
+if nargin==1
+	z = x;
+	x = 1:size(z,2);
+	y = 1:size(z,1);
+end
+if ~isempty(find(size(x)==1))
+	[x,y] = meshgrid(x,y);
+end
+
+% add a border to the x values
+xnew = [   x(:,1)-(x(:,2)-x(:,1))            x      x(:,end)+(x(:,end)-x(:,end-1))      ];
+xnew = [xnew(1,:)-(xnew(2,:)-xnew(1,:));  xnew;  xnew(end,:)+(xnew(end,:)-xnew(end-1,:))];
+% interpolate to add the grid centers
+xnew = interp2(xnew,1);
+% keep only the grid centers
+xnew = xnew(2:2:end,2:2:end);
+
+% repeat for y
+ynew = [   y(:,1)-(y(:,2)-y(:,1))            y      y(:,end)+(y(:,end)-y(:,end-1))      ];
+ynew = [ynew(1,:)-(ynew(2,:)-ynew(1,:));  ynew;  ynew(end,:)+(ynew(end,:)-ynew(end-1,:))];
+ynew = interp2(ynew,1);
+ynew = ynew(2:2:end,2:2:end);
+
+% add a border of nans to z
+znew = [[z nan.*ones(size(z,1),1)]; nan.*ones(1,size(z,2)+1)];
+
+% now pcolor
+h = pcolor(xnew,ynew,znew);
+shading flat;
Index: /issm/trunk/test/NightlyRun/GetIds.py
===================================================================
--- /issm/trunk/test/NightlyRun/GetIds.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/GetIds.py	(revision 26744)
@@ -15,6 +15,6 @@
         ids = GetIds('Dakota')
         ids = GetIds([101, 102...])
-        ids = GetIds([\'Dakota\', \'Slr\'...])
-        ids = GetIds([[101, 102...], [\'Dakota\', \'Slr\'...]])
+        ids = GetIds([\'Dakota\', \'Slc\'...])
+        ids = GetIds([[101, 102...], [\'Dakota\', \'Slc\'...]])
     """
 
Index: /issm/trunk/test/NightlyRun/IdFromString.m
===================================================================
--- /issm/trunk/test/NightlyRun/IdFromString.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/IdFromString.m	(revision 26744)
@@ -20,7 +20,12 @@
 %Grep string
 if strcmp(string,'*'),
-	[dummy ids_raw]=system(['find ./ -name "test[0-9]*.m" | xargs grep "%Test Name:" | sed -e "s/test/ /g" -e "s/\.m:/ /g" | awk {''print $2''}']);
+	[dummy ids_raw]=system(['find ./ -name "test[0-9]*.m" | xargs grep "%Test Name:" | sed -e "s/test/ /g" -e "s/\.m:/ /g" | cut -d" " -f 2']);
 else
-	[dummy ids_raw]=system(['find ./ -name "test[0-9]*.m" | xargs grep "%Test Name:" | grep ' string ' | sed -e "s/test/ /g" -e "s/\.m:/ /g" | awk {''print $2''}']);
+	[dummy ids_raw]=system(['find ./ -name "test[0-9]*.m" | xargs grep "%Test Name:" | grep ' string ' | sed -e "s/test/ /g" -e "s/\.m:/ /g" | cut -d" " -f 2']);
+end
+
+%Check for error
+if dummy~=0,
+	error(['system call failed:' newline ids_raw]);
 end
 
Index: /issm/trunk/test/NightlyRun/runme.m
===================================================================
--- /issm/trunk/test/NightlyRun/runme.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/runme.m	(revision 26744)
@@ -2,10 +2,12 @@
 %RUNME - test deck for ISSM nightly runs
 %
-%   In a test deck directory (test/Vertification/NightlyRun for example)
-%   The following command will launch all the existing tests:
-%   >> runme
-%   To run the tests 101 and 102:
-%   >> runme('id',[101 102])
-%   etc...
+%   In a test deck directory (for example, test/NightlyRun) the following 
+%   command will launch all existing tests,
+%
+%      >> runme
+%
+%   To run tests 101 and 102,
+%
+%      >> runme('id',[101 102])
 %
 %   Available options:
@@ -21,8 +23,7 @@
 %                      'qmu'         : validation of dakota tests
 %                      'referential' : validation of referential tests
-%                      'slr'         : validation of slr tests
+%                      'slc'         : validation of slc tests
 %                      'thermal'     : validation of thermal tests
 %                      'tranforcing' : validation of transient forcing tests
-%                      ...
 %      'procedure'     'check' :   run the test (default)
 %                      'update':   update the archive
@@ -37,6 +38,13 @@
 %      runme('exclude',101);
 %      runme('id',102,'procedure','update');
-
 %      runme('procedure','valgrind','stoponerror',1,'exclude','IdFromString('Dak'));
+%
+%   NOTE:
+%   - Will only run test scripts whose names explicitly follow the convention,
+%
+%         test<id>.m
+%
+%   where <id> is any integer.
+%
 
 %Check inputs
@@ -54,5 +62,5 @@
 %GET benchmark {{{
 benchmark=getfieldvalue(options,'benchmark','nightly');
-if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc','slr','qmu'})
+if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc','slc','qmu'})
 	disp('runme warning: benchmark not supported, defaulting to test ''nightly''')
 	benchmark='nightly';
@@ -82,16 +90,20 @@
 list_ids=[];
 for i=1:numel(flist),
-	if ( strncmp(flist(i).name,'test',4) &...                         %File name must start with 'test'
-			strncmp(fliplr(flist(i).name),fliplr('.m'),2)&...           %File name must end by '.m'
-			~strcmp(flist(i).name,'test.m'))                            %File name must be different than 'test.m'
-		id=str2num(flist(i).name(5:end-2));
-		if isempty(id),
-			disp(['WARNING: ignore file ' flist(i).name ]);
-		else
-			list_ids(end+1)=eval(flist(i).name(5:end-2));                  %Keep test id only (skip 'test' and '.m')
+	fname=flist(i).name;
+	if (any(fname=='.')), %Before split, check that file name contains '.'
+		ftokens=strsplit(fname,'.'); %Tokenize file name on '.'
+		if (regexp(ftokens{1},'^test[0-9]+$') &... %Basename must start with 'test' and end with a number
+			strcmp(ftokens{end},'m') ... %Extension (less '.') must be 'm'
+		),
+			id=sscanf(ftokens{1},'test%d');
+			if isempty(id),
+				disp(['WARNING: ignore file ' flist(i).name]);
+			else
+				list_ids(end+1)=id;%Keep test id only (strip 'test' and '.m')
+			end
 		end
 	end
 end
-[i1,i2]=parallelrange(rank,numprocs,length(list_ids));               %Get tests for this cpu only
+[i1,i2]=parallelrange(rank,numprocs,length(list_ids)); %Get tests for this cpu only
 list_ids=list_ids(i1:i2);
 
@@ -122,5 +134,5 @@
 elseif strcmpi(benchmark,'referential'),
 	test_ids=intersect(test_ids,[1601:1602]);
-elseif strcmpi(benchmark,'slr'),
+elseif strcmpi(benchmark,'slc'),
 	test_ids=intersect(test_ids,[2001:2500]);
 elseif strcmpi(benchmark,'adolc'),
Index: /issm/trunk/test/NightlyRun/runme.py
===================================================================
--- /issm/trunk/test/NightlyRun/runme.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/runme.py	(revision 26744)
@@ -1,6 +1,14 @@
 #!/usr/bin/env python
+#
+# NOTE: Switch to,
+#
+#   #!/usr/bin/python3
+#
+# when making Python 3 default
+#
 import argparse
 from glob import glob
 import os
+import re
 from sys import float_info
 from traceback import format_exc
@@ -9,12 +17,13 @@
 
 try:
-    from parallelrange import parallelrange
-except ImportError:  #we don't have issm code in path, just get it
+    from arch import archread
+except: # ISSM_DIR is not on path
     import devpath
-    from parallelrange import parallelrange
+
 from arch import archread
 from arch import archwrite
 from GetIds import *
 from IdToName import IdToName
+from parallelrange import parallelrange
 
 
@@ -22,35 +31,33 @@
     """RUNME - test deck for ISSM nightly runs
 
-    In a test deck directory (test/NightlyRun for example), the following 
-    command will launch all the existing tests,
+    In a test deck directory (for example, test/NightlyRun) the following 
+    command will launch all existing tests,
 
         ./runme.py
 
-    To run tests 101 and 102:
+    To run tests 101 and 102,
 
         ./runme.py -i [101, 102]
 
     Options:
-        -i/--id             followed by the list of ids or (parts of) test names requested
-                            NOTE: runs all tests by default
-
-        -e/--exclude        ids or (parts of) test names to be excluded (same format as id)
-                            NOTE: exclude does nothing if 'id' is specified with different values
-
-        -b/--benchmark      'all'           : (all of the tests)
-                            'nightly'       : (nightly run/daily run)
-                            'validation'    : (validation)
-                            'adolc'         : validation of adolc tests
-                            'eismint'       : validation of eismint tests
-                            'ismip'         : validation of ismip-hom tests
-                            'mesh'          : validation of mesh tests
-                            'qmu'           : validation of qmu tests
-                            'referential'   : validation of referential tests
-                            'slr'           : validation of slr tests
-                            'thermal'       : validation of thermal tests
-                            'tranforcing'   : validation of transient forcing tests
-
-        -p/--procedure      'check'         : run the test (default)
-                            'update'        : update the archive
+        -i/--id         Followed by the list of ids or (parts of) test names 
+                        requested
+        -e/--exclude    Ids or (parts of) test names to be excluded (same 
+                        format as id). Does nothing if 'id' is specified with 
+                        different values.
+        -b/--benchmark  'all'           : (all of the tests)
+                        'nightly'       : (nightly run/daily run)
+                        'validation'    : (validation)
+                        'adolc'         : validation of adolc tests
+                        'eismint'       : validation of eismint tests
+                        'ismip'         : validation of ismip-hom tests
+                        'mesh'          : validation of mesh tests
+                        'qmu'           : validation of qmu tests
+                        'referential'   : validation of referential tests
+                        'slc'           : validation of slc tests
+                        'thermal'       : validation of thermal tests
+                        'tranforcing'   : validation of transient forcing tests
+        -p/--procedure  'check'         : run the test (default)
+                        'update'        : update the archive
 
     Usage:
@@ -63,10 +70,19 @@
         ./runme.py -e 2001
         ./runme.py -e 'Dakota' --benchmark 'all'
-        ./runme.py -i [[101, 102], ['Dakota', 'Slr']]
+        ./runme.py -i [[101, 102], ['Dakota', 'Slc']]
+
+    NOTE:
+    - Will only run test scripts whose names explicitly follow the convention,
+
+        test<id>.py
+
+    where <id> is any integer.
 
     TODO:
     - At '#disp test result', make sure precision of output matches that of 
-        MATLAB.
-    - Check for failures that do not raise exceptions (for example, 'Standard exception'; see also jenkins/jenkins.sh). These should be counted as failures.
+    MATLAB.
+    - Check for failures that do not raise exceptions (for example, 'Standard 
+    exception'; see also jenkins/jenkins.sh). These should be counted as 
+    failures.
     """
 
@@ -76,5 +92,5 @@
     #Process options
     #GET benchmark {{{
-    if benchmark not in ['all', 'nightly', 'validation', 'adolc', 'eismint', 'ismip', 'mesh', 'slr', 'thermal', 'tranforcing', 'qmu']:
+    if benchmark not in ['all', 'nightly', 'validation', 'adolc', 'eismint', 'ismip', 'mesh', 'slc', 'thermal', 'tranforcing', 'qmu']:
         print(("runme warning: benchmark '{}' not supported, defaulting to test 'nightly'.".format(benchmark)))
         benchmark = 'nightly'
@@ -96,5 +112,5 @@
     #GET ids  {{{
     flist = glob('test*.py')  #File name must start with 'test' and must end by '.py' and must be different than 'test.py'
-    list_ids = [int(file[4:-3]) for file in flist if not file == 'test.py']  #Keep test id only (skip 'test' and '.py')
+    list_ids = [int(re.search(r'\d+',file.split('.')[0]).group()) for file in flist if not file == 'test.py'] # Keep test id only (skip 'test' and '.py')
 
     i1, i2 = parallelrange(rank, numprocs, len(list_ids))  #Get tests for this cpu only
@@ -129,5 +145,5 @@
     elif benchmark == 'referential':
         test_ids = test_ids.intersection(set(range(1601, 1603)))
-    elif benchmark == 'slr':
+    elif benchmark == 'slc':
         test_ids = test_ids.intersection(set(range(2001, 2500)))
     elif benchmark == 'adolc':
Index: /issm/trunk/test/NightlyRun/test127.m
===================================================================
--- /issm/trunk/test/NightlyRun/test127.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test127.m	(revision 26744)
@@ -0,0 +1,50 @@
+%Test Name: SquareShelfConstrainedStressMLHO2d
+md=triangle(model(),'../Exp/Square.exp',50000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelfConstrained.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',2);
+
+%output
+%FIXME compute the stress components for MLHO
+md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase','MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6'};
+%md.stressbalance.requested_outputs={'default','DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy','MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6'};
+md.outputdefinition.definitions={...
+	massfluxatgate('name','MassFlux1','profilename',['../Exp/MassFlux1.exp'],'definitionstring','Outputdefinition1'),...
+	massfluxatgate('name','MassFlux2','profilename',['../Exp/MassFlux2.exp'],'definitionstring','Outputdefinition2'),...
+	massfluxatgate('name','MassFlux3','profilename',['../Exp/MassFlux3.exp'],'definitionstring','Outputdefinition3'),...
+	massfluxatgate('name','MassFlux4','profilename',['../Exp/MassFlux4.exp'],'definitionstring','Outputdefinition4'),...
+	massfluxatgate('name','MassFlux5','profilename',['../Exp/MassFlux5.exp'],'definitionstring','Outputdefinition5'),...
+	massfluxatgate('name','MassFlux6','profilename',['../Exp/MassFlux6.exp'],'definitionstring','Outputdefinition6')...
+	};
+md=SetMLHOBC(md);
+md=solve(md,'Stressbalance');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx','Vy','Vel','Pressure','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase',...
+	'MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6'};
+	%'DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy',...
+field_tolerances={3e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13 };
+	%$2e-13,1e-13,2e-13,...
+field_values={...
+	(md.results.StressbalanceSolution.Vx),...
+	(md.results.StressbalanceSolution.Vy),...
+	(md.results.StressbalanceSolution.Vel),...
+	(md.results.StressbalanceSolution.Pressure),...
+	(md.results.StressbalanceSolution.VxSurface),...
+	(md.results.StressbalanceSolution.VySurface),...
+	(md.results.StressbalanceSolution.VxShear),...
+	(md.results.StressbalanceSolution.VyShear),...
+	(md.results.StressbalanceSolution.VxBase),...
+	(md.results.StressbalanceSolution.VyBase),...
+	(md.results.StressbalanceSolution.MassFlux1),...
+	(md.results.StressbalanceSolution.MassFlux2),...
+	(md.results.StressbalanceSolution.MassFlux3),...
+	(md.results.StressbalanceSolution.MassFlux4),...
+	(md.results.StressbalanceSolution.MassFlux5),...
+	(md.results.StressbalanceSolution.MassFlux6)...
+	};
+	%(md.results.StressbalanceSolution.DeviatoricStressxx),...
+	%(md.results.StressbalanceSolution.DeviatoricStressyy),...
+	%(md.results.StressbalanceSolution.DeviatoricStressxy),...
Index: /issm/trunk/test/NightlyRun/test127.py
===================================================================
--- /issm/trunk/test/NightlyRun/test127.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test127.py	(revision 26744)
@@ -0,0 +1,57 @@
+#Test Name: SquareShelfConstrainedStressMLHO2d
+from model import *
+from socket import gethostname
+from triangle import triangle
+from setmask import setmask
+from parameterize import parameterize
+from setflowequation import setflowequation
+from solve import solve
+from massfluxatgate import massfluxatgate
+from generic import generic
+from SetMLHOBC import SetMLHOBC
+
+md = triangle(model(), '../Exp/Square.exp', 50000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 2)
+#outputs
+#FIXME compute the stress components for MLHO
+md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase', 'MassFlux1', 'MassFlux2', 'MassFlux3', 'MassFlux4', 'MassFlux5', 'MassFlux6']
+#md.stressbalance.requested_outputs = ['default', 'DeviatoricStressxx', 'DeviatoricStressyy', 'DeviatoricStressxy', 'MassFlux1', 'MassFlux2', 'MassFlux3', 'MassFlux4', 'MassFlux5', 'MassFlux6']
+md.outputdefinition.definitions = [massfluxatgate('name', 'MassFlux1', 'profilename', '../Exp/MassFlux1.exp', 'definitionstring', 'Outputdefinition1'),
+                                   massfluxatgate('name', 'MassFlux2', 'profilename', '../Exp/MassFlux2.exp', 'definitionstring', 'Outputdefinition2'),
+                                   massfluxatgate('name', 'MassFlux3', 'profilename', '../Exp/MassFlux3.exp', 'definitionstring', 'Outputdefinition3'),
+                                   massfluxatgate('name', 'MassFlux4', 'profilename', '../Exp/MassFlux4.exp', 'definitionstring', 'Outputdefinition4'),
+                                   massfluxatgate('name', 'MassFlux5', 'profilename', '../Exp/MassFlux5.exp', 'definitionstring', 'Outputdefinition5'),
+                                   massfluxatgate('name', 'MassFlux6', 'profilename', '../Exp/MassFlux6.exp', 'definitionstring', 'Outputdefinition6')]
+md = SetMLHOBC(md)
+md = solve(md, 'Stressbalance')
+
+#Fields and tolerances to track changes
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase',
+               'MassFlux1', 'MassFlux2', 'MassFlux3', 'MassFlux4', 'MassFlux5', 'MassFlux6']
+#'DeviatoricStressxx', 'DeviatoricStressyy', 'DeviatoricStressxy',
+field_tolerances = [3e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    2e-13, 1e-13, 2e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.VxSurface,
+                md.results.StressbalanceSolution.VySurface,
+                md.results.StressbalanceSolution.VxShear,
+                md.results.StressbalanceSolution.VyShear,
+                md.results.StressbalanceSolution.VxBase,
+                md.results.StressbalanceSolution.VyBase,
+                md.results.StressbalanceSolution.MassFlux1,
+                md.results.StressbalanceSolution.MassFlux2,
+                md.results.StressbalanceSolution.MassFlux3,
+                md.results.StressbalanceSolution.MassFlux4,
+                md.results.StressbalanceSolution.MassFlux5,
+                md.results.StressbalanceSolution.MassFlux6]
+#md.results.StressbalanceSolution.DeviatoricStressxx,
+#md.results.StressbalanceSolution.DeviatoricStressyy,
+#md.results.StressbalanceSolution.DeviatoricStressxy,
Index: /issm/trunk/test/NightlyRun/test128.m
===================================================================
--- /issm/trunk/test/NightlyRun/test128.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test128.m	(revision 26744)
@@ -0,0 +1,62 @@
+%Test Name: SquareShelfConstrainedTranMLHO2d
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelfConstrained.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.transient.requested_outputs={'IceVolume','VxShear','VyShear','VxBase','VyBase','VxSurface','VySurface'};
+
+md=SetMLHOBC(md);
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vel1','Pressure1','VxShear1','VyShear1','VxBase1','VyBase1','VxSurface1','VySurface1','Bed1','Surface1','Thickness1','Volume1',...
+						'Vx2','Vy2','Vel2','Pressure2','VxShear2','VyShear2','VxBase2','VyBase2','VxSurface2','VySurface2','Bed2','Surface2','Thickness2','Volume2',...
+						'Vx3','Vy3','Vel3','Pressure3','VxShear3','VyShear3','VxBase3','VyBase3','VxSurface3','VySurface3','Bed3','Surface3','Thickness3','Volume3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).VxShear),...
+	(md.results.TransientSolution(1).VyShear),...
+	(md.results.TransientSolution(1).VxBase),...
+	(md.results.TransientSolution(1).VyBase),...
+	(md.results.TransientSolution(1).VxSurface),...
+	(md.results.TransientSolution(1).VySurface),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).IceVolume),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).VxShear),...
+	(md.results.TransientSolution(2).VyShear),...
+	(md.results.TransientSolution(2).VxBase),...
+	(md.results.TransientSolution(2).VyBase),...
+	(md.results.TransientSolution(2).VxSurface),...
+	(md.results.TransientSolution(2).VySurface),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).IceVolume),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).VxShear),...
+	(md.results.TransientSolution(3).VyShear),...
+	(md.results.TransientSolution(3).VxBase),...
+	(md.results.TransientSolution(3).VyBase),...
+	(md.results.TransientSolution(3).VxSurface),...
+	(md.results.TransientSolution(3).VySurface),...
+	(md.results.TransientSolution(3).Base),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).IceVolume),...
+	};
Index: /issm/trunk/test/NightlyRun/test128.py
===================================================================
--- /issm/trunk/test/NightlyRun/test128.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test128.py	(revision 26744)
@@ -0,0 +1,69 @@
+#Test Name: SquareShelfConstrainedTranMLHO2d
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['IceVolume','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase']
+
+md = SetMLHOBC(md);
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'VxShear1', 'VyShear1', 'VxBase1', 'VyBase1', 'VxSurface1', 'VySurface1', 'Bed1', 'Surface1', 'Thickness1', 'Volume1', 
+            'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'VxShear2', 'VyShear2', 'VxBase2', 'VyBase2', 'VxSurface2', 'VySurface2', 'Bed2', 'Surface2', 'Thickness2', 'Volume2', 
+            'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'VxShear3', 'VyShear3', 'VxBase3', 'VyBase3', 'VxSurface3', 'VySurface3', 'Bed3', 'Surface3', 'Thickness3', 'Volume3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].VxShear,
+                md.results.TransientSolution[0].VyShear,
+                md.results.TransientSolution[0].VxBase,
+                md.results.TransientSolution[0].VyBase,
+                md.results.TransientSolution[0].VxSurface,
+                md.results.TransientSolution[0].VySurface,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].IceVolume,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].VxShear,
+                md.results.TransientSolution[1].VyShear,
+                md.results.TransientSolution[1].VxBase,
+                md.results.TransientSolution[1].VyBase,
+                md.results.TransientSolution[1].VxSurface,
+                md.results.TransientSolution[1].VySurface,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].IceVolume,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].VxShear,
+                md.results.TransientSolution[2].VyShear,
+                md.results.TransientSolution[2].VxBase,
+                md.results.TransientSolution[2].VyBase,
+                md.results.TransientSolution[2].VxSurface,
+                md.results.TransientSolution[2].VySurface,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].IceVolume]
Index: /issm/trunk/test/NightlyRun/test129.m
===================================================================
--- /issm/trunk/test/NightlyRun/test129.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test129.m	(revision 26744)
@@ -0,0 +1,70 @@
+%Test Name: SquareShelfConstrainedRestartTranMLHO2d
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelfConstrained.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',1);
+md.transient.requested_outputs={'IceVolume','TotalSmb','VxShear','VyShear','VxBase','VyBase','VxSurface','VySurface'};
+
+md.verbose=verbose('solution',true);
+md.settings.checkpoint_frequency=4;
+
+% time steps and resolution
+md.timestepping.final_time=19;
+md.settings.output_frequency=2;
+
+md=SetMLHOBC(md);
+md=solve(md,'Transient');
+md2=solve(md,'Transient','restart',1);
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vel1','VxShear1','VyShear1','VxBase1','VyBase1','VxSurface1','VySurface1','TotalSmb1','Bed1','Surface1','Thickness1','Volume1',...
+						'Vx2','Vy2','Vel2','VxShear2','VyShear2','VxBase2','VyBase2','VxSurface2','VySurface2','TotalSmb2','Bed2','Surface2','Thickness2','Volume2',...
+						'Vx3','Vy3','Vel3','VxShear3','VyShear3','VxBase3','VyBase3','VxSurface3','VySurface3','TotalSmb3','Bed3','Surface3','Thickness3','Volume3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.TransientSolution(7).Vx)-(md2.results.TransientSolution(7).Vx),...
+	(md.results.TransientSolution(7).Vy)-(md2.results.TransientSolution(7).Vy),...
+	(md.results.TransientSolution(7).Vel)-(md2.results.TransientSolution(7).Vel),...
+	(md.results.TransientSolution(7).VxShear)-(md2.results.TransientSolution(7).VxShear),...
+	(md.results.TransientSolution(7).VyShear)-(md2.results.TransientSolution(7).VyShear),...
+	(md.results.TransientSolution(7).VxBase)-(md2.results.TransientSolution(7).VxBase),...
+	(md.results.TransientSolution(7).VyBase)-(md2.results.TransientSolution(7).VyBase),...
+	(md.results.TransientSolution(7).VxSurface)-(md2.results.TransientSolution(7).VxSurface),...
+	(md.results.TransientSolution(7).VySurface)-(md2.results.TransientSolution(7).VySurface),...
+	(md.results.TransientSolution(7).TotalSmb)-(md2.results.TransientSolution(7).TotalSmb),...
+	(md.results.TransientSolution(7).Base)-(md2.results.TransientSolution(7).Base),...
+	(md.results.TransientSolution(7).Surface)-(md2.results.TransientSolution(7).Surface),...
+	(md.results.TransientSolution(7).Thickness)-(md2.results.TransientSolution(7).Thickness),...
+	(md.results.TransientSolution(7).IceVolume)-(md2.results.TransientSolution(7).IceVolume),...
+	(md.results.TransientSolution(8).Vx)-(md2.results.TransientSolution(8).Vx),...
+	(md.results.TransientSolution(8).Vy)-(md2.results.TransientSolution(8).Vy),...
+	(md.results.TransientSolution(8).Vel)-(md2.results.TransientSolution(8).Vel),...
+	(md.results.TransientSolution(8).VxShear)-(md2.results.TransientSolution(8).VxShear),...
+	(md.results.TransientSolution(8).VyShear)-(md2.results.TransientSolution(8).VyShear),...
+	(md.results.TransientSolution(8).VxBase)-(md2.results.TransientSolution(8).VxBase),...
+	(md.results.TransientSolution(8).VyBase)-(md2.results.TransientSolution(8).VyBase),...
+	(md.results.TransientSolution(8).VxSurface)-(md2.results.TransientSolution(8).VxSurface),...
+	(md.results.TransientSolution(8).VySurface)-(md2.results.TransientSolution(8).VySurface),...
+	(md.results.TransientSolution(8).TotalSmb)-(md2.results.TransientSolution(8).TotalSmb),...
+	(md.results.TransientSolution(8).Base)-(md2.results.TransientSolution(8).Base),...
+	(md.results.TransientSolution(8).Surface)-(md2.results.TransientSolution(8).Surface),...
+	(md.results.TransientSolution(8).Thickness)-(md2.results.TransientSolution(8).Thickness),...
+	(md.results.TransientSolution(8).IceVolume)-(md2.results.TransientSolution(8).IceVolume),...
+	(md.results.TransientSolution(9).Vx)-(md2.results.TransientSolution(9).Vx),...
+	(md.results.TransientSolution(9).Vy)-(md2.results.TransientSolution(9).Vy),...
+	(md.results.TransientSolution(9).Vel)-(md2.results.TransientSolution(9).Vel),...
+	(md.results.TransientSolution(9).VxShear)-(md2.results.TransientSolution(9).VxShear),...
+	(md.results.TransientSolution(9).VyShear)-(md2.results.TransientSolution(9).VyShear),...
+	(md.results.TransientSolution(9).VxBase)-(md2.results.TransientSolution(9).VxBase),...
+	(md.results.TransientSolution(9).VyBase)-(md2.results.TransientSolution(9).VyBase),...
+	(md.results.TransientSolution(9).VxSurface)-(md2.results.TransientSolution(9).VxSurface),...
+	(md.results.TransientSolution(9).VySurface)-(md2.results.TransientSolution(9).VySurface),...
+	(md.results.TransientSolution(9).TotalSmb)-(md2.results.TransientSolution(9).TotalSmb),...
+	(md.results.TransientSolution(9).Base)-(md2.results.TransientSolution(9).Base),...
+	(md.results.TransientSolution(9).Surface)-(md2.results.TransientSolution(9).Surface),...
+	(md.results.TransientSolution(9).Thickness)-(md2.results.TransientSolution(9).Thickness),...
+	(md.results.TransientSolution(9).IceVolume)-(md2.results.TransientSolution(9).IceVolume),...
+	};
Index: /issm/trunk/test/NightlyRun/test129.py
===================================================================
--- /issm/trunk/test/NightlyRun/test129.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test129.py	(revision 26744)
@@ -0,0 +1,78 @@
+#Test Name: SquareShelfConstrainedRestartTranMLHO2d
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+from generic import generic
+import copy
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.transient.requested_outputs = ['IceVolume', 'TotalSmb', 'VxShear','VyShear','VxBase','VyBase','VxSurface','VySurface']
+
+md.verbose = verbose('solution', 1)
+md.settings.checkpoint_frequency = 4
+
+# time steps and resolution
+md.timestepping.final_time = 19
+md.settings.output_frequency = 2
+md = SetMLHOBC(md);
+
+md = solve(md, 'Transient')
+md2 = copy.deepcopy(md)
+md = solve(md, 'Transient', 'restart', 1)
+
+#Fields and tolerances to track changes
+field_names = ['Vx1', 'Vy1', 'Vel1', 'VxShear1','VyShear1','VxBase1','VyBase1','VxSurface1','VySurface1', 'TotalSmb1', 'Bed1', 'Surface1', 'Thickness1', 'Volume1', 'Vx2', 'Vy2', 'Vel2', 'VxShear2','VyShear2','VxBase2','VyBase2','VxSurface2','VySurface2','TotalSmb2', 'Bed2', 'Surface2', 'Thickness2', 'Volume2', 'Vx3', 'Vy3', 'Vel3', 'VxShear3','VyShear3','VxBase3','VyBase3','VxSurface3','VySurface3','TotalSmb3', 'Bed3', 'Surface3', 'Thickness3', 'Volume3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md2.results.TransientSolution[6].Vx - md.results.TransientSolution[6].Vx,
+                md2.results.TransientSolution[6].Vy - md.results.TransientSolution[6].Vy,
+                md2.results.TransientSolution[6].Vel - md.results.TransientSolution[6].Vel,
+                md2.results.TransientSolution[6].VxShear - md.results.TransientSolution[6].VxShear,
+                md2.results.TransientSolution[6].VyShear - md.results.TransientSolution[6].VyShear,
+                md2.results.TransientSolution[6].VxBase - md.results.TransientSolution[6].VxBase,
+                md2.results.TransientSolution[6].VyBase - md.results.TransientSolution[6].VyBase,
+                md2.results.TransientSolution[6].VxSurface - md.results.TransientSolution[6].VxSurface,
+                md2.results.TransientSolution[6].VySurface - md.results.TransientSolution[6].VySurface,
+                md2.results.TransientSolution[6].TotalSmb - md.results.TransientSolution[6].TotalSmb,
+                md2.results.TransientSolution[6].Base - md.results.TransientSolution[6].Base,
+                md2.results.TransientSolution[6].Surface - md.results.TransientSolution[6].Surface,
+                md2.results.TransientSolution[6].Thickness - md.results.TransientSolution[6].Thickness,
+                md2.results.TransientSolution[6].IceVolume - md.results.TransientSolution[6].IceVolume,
+                md2.results.TransientSolution[7].Vx - md.results.TransientSolution[7].Vx,
+                md2.results.TransientSolution[7].Vy - md.results.TransientSolution[7].Vy,
+                md2.results.TransientSolution[7].Vel - md.results.TransientSolution[7].Vel,
+                md2.results.TransientSolution[7].VxShear - md.results.TransientSolution[7].VxShear,
+                md2.results.TransientSolution[7].VyShear - md.results.TransientSolution[7].VyShear,
+                md2.results.TransientSolution[7].VxBase - md.results.TransientSolution[7].VxBase,
+                md2.results.TransientSolution[7].VyBase - md.results.TransientSolution[7].VyBase,
+                md2.results.TransientSolution[7].VxSurface - md.results.TransientSolution[7].VxSurface,
+                md2.results.TransientSolution[7].VySurface - md.results.TransientSolution[7].VySurface,
+                md2.results.TransientSolution[7].TotalSmb - md.results.TransientSolution[7].TotalSmb,
+                md2.results.TransientSolution[7].Base - md.results.TransientSolution[7].Base,
+                md2.results.TransientSolution[7].Surface - md.results.TransientSolution[7].Surface,
+                md2.results.TransientSolution[7].Thickness - md.results.TransientSolution[7].Thickness,
+                md2.results.TransientSolution[7].IceVolume - md.results.TransientSolution[7].IceVolume,
+                md2.results.TransientSolution[8].Vx - md.results.TransientSolution[8].Vx,
+                md2.results.TransientSolution[8].Vy - md.results.TransientSolution[8].Vy,
+                md2.results.TransientSolution[8].Vel - md.results.TransientSolution[8].Vel,
+                md2.results.TransientSolution[8].VxShear - md.results.TransientSolution[8].VxShear,
+                md2.results.TransientSolution[8].VyShear - md.results.TransientSolution[8].VyShear,
+                md2.results.TransientSolution[8].VxBase - md.results.TransientSolution[8].VxBase,
+                md2.results.TransientSolution[8].VyBase - md.results.TransientSolution[8].VyBase,
+                md2.results.TransientSolution[8].VxSurface - md.results.TransientSolution[8].VxSurface,
+                md2.results.TransientSolution[8].VySurface - md.results.TransientSolution[8].VySurface,
+                md2.results.TransientSolution[8].TotalSmb - md.results.TransientSolution[8].TotalSmb,
+                md2.results.TransientSolution[8].Base - md.results.TransientSolution[8].Base,
+                md2.results.TransientSolution[8].Surface - md.results.TransientSolution[8].Surface,
+                md2.results.TransientSolution[8].Thickness - md.results.TransientSolution[8].Thickness,
+                md2.results.TransientSolution[8].IceVolume - md.results.TransientSolution[8].IceVolume]
Index: /issm/trunk/test/NightlyRun/test131.m
===================================================================
--- /issm/trunk/test/NightlyRun/test131.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test131.m	(revision 26744)
@@ -0,0 +1,15 @@
+%Test Name: SquareShelfConstrainedMasstransp2dStreamline
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelfConstrained.par');
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.masstransport.stabilization=2;
+md=solve(md,'Masstransport');
+
+%Fields and tolerances to track changes
+field_names     ={'Thickness'};
+field_tolerances={1e-13};
+field_values={...
+	(md.results.MasstransportSolution.Thickness),...
+	};
Index: /issm/trunk/test/NightlyRun/test131.py
===================================================================
--- /issm/trunk/test/NightlyRun/test131.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test131.py	(revision 26744)
@@ -0,0 +1,24 @@
+#Test Name: SquareShelfConstrainedMasstransp2dStreamline 
+from model import *
+from socket import gethostname
+from triangle import *
+from meshconvert import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = meshconvert(md)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.masstransport.stabilization = 2
+md = solve(md, 'Masstransport')
+
+#Fields and tolerances to track changes
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test132.m
===================================================================
--- /issm/trunk/test/NightlyRun/test132.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test132.m	(revision 26744)
@@ -0,0 +1,15 @@
+%Test Name: SquareShelfConstrainedMasstransp2dFCT
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelfConstrained.par');
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.masstransport.stabilization=4;
+md=solve(md,'Masstransport');
+
+%Fields and tolerances to track changes
+field_names     ={'Thickness'};
+field_tolerances={1e-13};
+field_values={...
+	(md.results.MasstransportSolution.Thickness),...
+	};
Index: /issm/trunk/test/NightlyRun/test132.py
===================================================================
--- /issm/trunk/test/NightlyRun/test132.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test132.py	(revision 26744)
@@ -0,0 +1,24 @@
+#Test Name: SquareShelfConstrainedMasstransp2dFCT 
+from model import *
+from socket import gethostname
+from triangle import *
+from meshconvert import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = meshconvert(md)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.masstransport.stabilization = 4
+md = solve(md, 'Masstransport')
+
+#Fields and tolerances to track changes
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test133.m
===================================================================
--- /issm/trunk/test/NightlyRun/test133.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test133.m	(revision 26744)
@@ -0,0 +1,15 @@
+%Test Name: SquareShelfConstrainedMasstransp2dSUPG
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelfConstrained.par');
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.masstransport.stabilization=5;
+md=solve(md,'Masstransport');
+
+%Fields and tolerances to track changes
+field_names     ={'Thickness'};
+field_tolerances={1e-13};
+field_values={...
+	(md.results.MasstransportSolution.Thickness),...
+	};
Index: /issm/trunk/test/NightlyRun/test133.py
===================================================================
--- /issm/trunk/test/NightlyRun/test133.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test133.py	(revision 26744)
@@ -0,0 +1,24 @@
+#Test Name: SquareShelfConstrainedMasstransp2dSUPG
+from model import *
+from socket import gethostname
+from triangle import *
+from meshconvert import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = meshconvert(md)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.masstransport.stabilization = 5
+md = solve(md, 'Masstransport')
+
+#Fields and tolerances to track changes
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test134.m
===================================================================
--- /issm/trunk/test/NightlyRun/test134.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test134.m	(revision 26744)
@@ -0,0 +1,15 @@
+%Test Name: SquareShelfConstrainedSampling
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelfConstrained.par');
+md = md.sampling.setparameters(md,2e5,1);
+md.sampling.seed = 100;
+md.cluster=generic('name',oshostname(),'np',1);
+md=solve(md,'smp');
+
+%Fields and tolerances to track changes
+field_names     ={'Sample'};
+field_tolerances={1e-13};
+field_values={...
+	(md.results.SamplingSolution.Sample),...
+	};
Index: /issm/trunk/test/NightlyRun/test2001.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2001.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2001.m	(revision 26744)
@@ -1,39 +1,53 @@
 %Test Name: SquareSheetConstrainedGia2d
-%GIA test, inspired on test101. Running default GIA Ivins class.
+%GIA test, based off of test101. Running default GIA Ivins class.
 md=triangle(model(),'../Exp/Square.exp',100000.);
 md=setmask(md,'','');
 md=parameterize(md,'../Par/SquareSheetConstrained.par');
 
-%GIA: 
-md.gia=giaivins();
-md.gia.lithosphere_thickness=100.*ones(md.mesh.numberofvertices,1); % in km
-md.gia.mantle_viscosity=1.0*10^21*ones(md.mesh.numberofvertices,1); % in Pa.s
-md.materials.lithosphere_shear_modulus=6.7*10^10;                   % in Pa
-md.materials.lithosphere_density=3.32;                              % in g/cm^-3
-md.materials.mantle_shear_modulus=1.45*10^11;                       % in Pa
-md.materials.mantle_density=3.34;                                   % in g/cm^-3
+%GIA Ivins, 2 layer model.
+md.solidearth.settings.grdmodel=2;
+md.solidearth.settings.isgrd=1;
 
-%% indicate what you want to compute 
-md.gia.cross_section_shape=1;    % for square-edged x-section 
+md.materials=materials('litho','ice');
+md.materials.numlayers=2;
+md.materials.radius =  [10 6271e3 6371e3];
+md.materials.density=  [3.34e3 3.32e3];
+md.materials.lame_mu=  [1.45e11         6.7e10];
+md.materials.viscosity=[1e21            0];
+md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+md.solidearth.settings.cross_section_shape=1;    % for square-edged x-section 
+md.solidearth.settings.grdocean=0;  %do not compute sea level, only deformation
+md.solidearth.settings.sealevelloading=0;  %do not compute sea level, only deformation
+md.solidearth.requested_outputs={'Sealevel','BedGRD'};
 
-%% define loading history 
-md.timestepping.start_time=2400000; %2,400 kyr :: EVALUATION TIME
+%Loading history 
+md.timestepping.start_time=-2400000; %4,800 kyr :: EVALUATION TIME
+md.timestepping.time_step= 2400000; %2,400 kyr :: EVALUATION TIME
 % to get rid of default final_time: make sure final_time>start_time
-md.timestepping.final_time=2500000; %2,500 kyr
-md.geometry.thickness=[...
-	[md.geometry.thickness; 0.0],...
-	[md.geometry.thickness; md.timestepping.start_time],...
+md.timestepping.final_time=2400000; %2,500 kyr
+md.masstransport.spcthickness=[...
+	[md.geometry.thickness; 0],...
+	[md.geometry.thickness; 2400000]...
 	];
 
-%% solve for GIA deflection 
+%geometry at 0 initially: 
+md.geometry.thickness=zeros(md.mesh.numberofvertices,1);
+md.geometry.surface=zeros(md.mesh.numberofvertices,1);
+md.geometry.base=zeros(md.mesh.numberofvertices,1);
+
+%Physics: 
+md.transient.issmb=0; 
+md.transient.isstressbalance=0;
+md.transient.isthermal=0;
+md.transient.ismasstransport=1;
+md.transient.isslc=1;
+
+% Solve for GIA deflection 
 md.cluster=generic('name',oshostname(),'np',3);
-md.verbose=verbose('1111111');
-md=solve(md,'Gia');
+md.verbose.solver=0;
+md=solve(md,'Transient');
 
 %Fields and tolerances to track changes
-field_names     ={'UGia','UGiaRate'};
-field_tolerances={1e-13,1e-13};
-field_values={...
-	(md.results.GiaSolution.UGia),...
-	(md.results.GiaSolution.UGiaRate),...
-	};
+field_names     ={'UGrd'};
+field_tolerances={1e-13};
+field_values={md.results.TransientSolution(2).BedGRD};
Index: /issm/trunk/test/NightlyRun/test2001.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2001.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2001.py	(revision 26744)
@@ -1,8 +1,8 @@
 #Test Name: SquareSheetConstrainedGia2d
+#GIA test, based off of test101. Running default GIA Ivins class.
+import numpy as np
 from socket import gethostname
-
-import numpy as np
-
-from giaivins import giaivins
+from materials import *
+from MatlabFuncs import *
 from model import *
 from parameterize import *
@@ -17,34 +17,49 @@
 md = parameterize(md, '../Par/SquareSheetConstrained.py')
 
-#GIA
-md.gia = giaivins()
-md.gia.lithosphere_thickness = 100. * np.ones(md.mesh.numberofvertices) # in km
-md.gia.mantle_viscosity = 1.0e21 * np.ones(md.mesh.numberofvertices) # in Pa.s
-md.materials.lithosphere_shear_modulus = 6.7e10 # in Pa
-md.materials.lithosphere_density = 3.32 # in g/cm^3
-md.materials.mantle_shear_modulus = 1.45e11 # in Pa
-md.materials.mantle_density = 3.34 # in g/cm^3
+# GIA Ivins, 2 layer model
+md.solidearth.settings.grdmodel = 2
+md.solidearth.settings.isgrd = 1
 
-#Indicate what you want to compute
-md.gia.cross_section_shape = 1 # for square-edged x-section
+md.materials = materials('litho','ice')
+md.materials.numlayers = 2;
+md.materials.radius = [10, 6271e3, 6371e3]
+md.materials.density = [3.34e3, 3.32e3]
+md.materials.lame_mu = [1.45e11, 6.7e10]
+md.materials.viscosity = [1e21, 0]
+md.initialization.sealevel = np.zeros(md.mesh.numberofvertices)
+md.solidearth.settings.cross_section_shape = 1 # for square-edged x-section
+md.solidearth.settings.grdocean = 0 # do not compute sea level, only deformation
+md.solidearth.settings.sealevelloading = 0 # do not compute sea level, only deformation
+md.solidearth.requested_outputs = ['Sealevel', 'BedGRD']
 
-#Define loading history (see test2001.m for the description)
-md.timestepping.start_time = 2400000  # 2, 400 kyr
-md.timestepping.final_time = 2500000  # 2, 500 kyr
-md.geometry.thickness = np.array([
-    np.append(md.geometry.thickness * 0.0, 0.0),
-    np.append(md.geometry.thickness / 2.0, 0.1),
-    np.append(md.geometry.thickness, 0.2),
-    np.append(md.geometry.thickness, 1.0),
-    np.append(md.geometry.thickness, md.timestepping.start_time)
+# Loading history
+md.timestepping.start_time = -2400000  # 4,800 kyr :: EVALUATION TIME
+md.timestepping.time_step = 2400000  # 2,400 kyr :: EVALUATION TIME
+# To get rid of default final_time, make sure final_time > start_time
+md.timestepping.final_time = 2400000  # 2,400 kyr
+md.masstransport.spcthickness = np.array([
+    np.append(md.geometry.thickness, 0),
+    np.append(md.geometry.thickness, 2400000)
     ]).T
+
+# Geometry at 0 initially
+md.geometry.thickness = np.zeros(md.mesh.numberofvertices)
+md.geometry.surface = np.zeros(md.mesh.numberofvertices)
+md.geometry.base = np.zeros(md.mesh.numberofvertices)
+
+# Physics
+md.transient.issmb = 0
+md.transient.isstressbalance = 0
+md.transient.isthermal = 0
+md.transient.ismasstransport = 1
+md.transient.isslc = 1
 
 #Solve for GIA deflection
 md.cluster = generic('name', gethostname(), 'np', 3)
-md.verbose = verbose('1111111')
-md = solve(md, 'Gia')
+md.verbose.solver = 0
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names = ['UGia', 'UGiaRate']
-field_tolerances = [1e-13, 1e-13]
-field_values = [md.results.GiaSolution.UGia, md.results.GiaSolution.UGiaRate]
+field_names = ['UGrd']
+field_tolerances = [1e-13]
+field_values = [md.results.TransientSolution[1].BedGRD]
Index: /issm/trunk/test/NightlyRun/test2002.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2002.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2002.m	(revision 26744)
@@ -1,55 +1,67 @@
-%Test Name: EarthSlr
+%Test Name: EarthSlc
 
 %mesh earth:
 md=model;
-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
 
-%parameterize solidearth solution:
+%Geometry for the bed, arbitrary thickness of 100: 
+md.geometry.bed=zeros(md.mesh.numberofvertices,1);
+md.geometry.base=md.geometry.bed;
+md.geometry.thickness=100*ones(md.mesh.numberofvertices,1);
+md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+
 %solidearth loading:  {{{
-md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
-md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
-md.dsl.global_average_thermosteric_sea_level_change=[0;0];
-md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
-md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+md.masstransport.spcthickness=[md.geometry.thickness;0];
+md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+
 %antarctica
-late=sum(md.mesh.lat(md.mesh.elements),2)/3;
-longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
+ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
+re=sqrt(xe.^2+ye.^2+ze.^2);
+
+late=asind(ze./re);
+longe=atan2d(ye,xe);
 pos=find(late < -80);
-md.solidearth.surfaceload.icethicknesschange(pos)=-100;
+md.masstransport.spcthickness(md.mesh.elements(pos,:))=md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+posant=pos;
+
 %greenland
-pos=find(late>70 & late<80 & longe>-60 & longe<-30);
-md.solidearth.surfaceload.icethicknesschange(pos)=-100;
+pos=find(late>60 & late<90 & longe>-75 & longe<-15);
+md.masstransport.spcthickness(md.mesh.elements(pos,:))=md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+posgre=pos;
 
 %elastic loading from love numbers:
-md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
+md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
 
 %}}}
 %mask:  {{{
 mask=gmtmask(md.mesh.lat,md.mesh.long);
+oceanmask=-ones(md.mesh.numberofvertices,1);
+pos=find(mask==0); oceanmask(pos)=1;
+
 icemask=ones(md.mesh.numberofvertices,1);
-pos=find(mask==0);
-icemask(pos)=-1;
-pos=find(sum(mask(md.mesh.elements),2)<3);
-icemask(md.mesh.elements(pos,:))=-1;
+icemask(md.mesh.elements(posant))=-1;
+icemask(md.mesh.elements(posgre))=-1;
+
 md.mask.ice_levelset=icemask;
-md.mask.ocean_levelset=-icemask;
-
-%make sure that the elements that have loads are fully grounded:
-pos=find(md.solidearth.surfaceload.icethicknesschange);
-md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
-
-%make sure wherever there is an ice load, that the mask is set to ice:
-pos=find(md.solidearth.surfaceload.icethicknesschange);
-md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
+md.mask.ocean_levelset=oceanmask;
 % }}}
 
-md.solidearth.settings.ocean_area_scaling=0;
+%time stepping: 
+md.timestepping.start_time=0;
+md.timestepping.time_step=1;
+md.timestepping.final_time=1;
 
-%Geometry for the bed, arbitrary: 
-md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+%masstransport:
+md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+md.initialization.str=0;
 
 %Materials: 
 md.materials=materials('hydro');
-
 
 %Miscellaneous
@@ -57,7 +69,19 @@
 
 %Solution parameters
+md.cluster.np=3;
 md.solidearth.settings.reltol=NaN;
 md.solidearth.settings.abstol=1e-3;
-md.solidearth.settings.computesealevelchange=1;
+md.solidearth.settings.sealevelloading=1;
+md.solidearth.settings.isgrd=1;
+md.solidearth.settings.ocean_area_scaling=0;
+md.solidearth.settings.grdmodel=1;
+
+%Physics: 
+md.transient.issmb=0; 
+md.transient.isstressbalance=0;
+md.transient.isthermal=0;
+md.transient.ismasstransport=1;
+md.transient.isslc=1;
+md.solidearth.requested_outputs={'Sealevel','Bed'};
 
 % max number of iteration reverted back to 10 (i.e., the original default value)
@@ -65,33 +89,42 @@
 
 %eustatic run:
-md.solidearth.settings.rigid=0;
+md.solidearth.settings.selfattraction=0;
 md.solidearth.settings.elastic=0;
 md.solidearth.settings.rotation=0;
-md=solve(md,'Sealevelrise');
-Seustatic=md.results.SealevelriseSolution.Sealevel;
+md.solidearth.settings.viscous=0;
 
-%eustatic + rigid run:
-md.solidearth.settings.rigid=1;
+md=solve(md,'Transient');
+Seustatic=md.results.TransientSolution.Sealevel;
+Beustatic=md.results.TransientSolution.Bed;
+
+%eustatic + selfattraction run:
+md.solidearth.settings.selfattraction=1;
 md.solidearth.settings.elastic=0;
 md.solidearth.settings.rotation=0;
-md=solve(md,'Sealevelrise');
-Srigid=md.results.SealevelriseSolution.Sealevel;
+md.solidearth.settings.viscous=0;
+md=solve(md,'tr');
+Sselfattraction=md.results.TransientSolution.Sealevel;
+Bselfattraction=md.results.TransientSolution.Bed;
 
-%eustatic + rigid + elastic run:
-md.solidearth.settings.rigid=1;
+%eustatic + selfattraction + elastic run:
+md.solidearth.settings.selfattraction=1;
 md.solidearth.settings.elastic=1;
 md.solidearth.settings.rotation=0;
-md=solve(md,'Sealevelrise');
-Selastic=md.results.SealevelriseSolution.Sealevel;
+md.solidearth.settings.viscous=0;
+md=solve(md,'tr');
+Selastic=md.results.TransientSolution.Sealevel;
+Belastic=md.results.TransientSolution.Bed;
 
-%eustatic + rigid + elastic + rotation run:
-md.solidearth.settings.rigid=1;
+%eustatic + selfattraction + elastic + rotation run:
+md.solidearth.settings.selfattraction=1;
 md.solidearth.settings.elastic=1;
 md.solidearth.settings.rotation=1;
-md=solve(md,'Sealevelrise');
-Srotation=md.results.SealevelriseSolution.Sealevel;
+md.solidearth.settings.viscous=0;
+md=solve(md,'tr');
+Srotation=md.results.TransientSolution.Sealevel;
+Brotation=md.results.TransientSolution.Bed;
 
 %Fields and tolerances to track changes
-field_names={'Eustatic','Rigid','Elastic','Rotation'};
-field_tolerances={1e-13,1e-13,1e-13,1e-13};
-field_values={Seustatic,Srigid,Selastic,Srotation};
+field_names={'Seustatic','Sselfattraction','Selastic','Srotation','Beustatic','Bselfattraction','Belastic','Brotation'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={Seustatic,Sselfattraction,Selastic,Srotation,Beustatic,Bselfattraction,Belastic,Brotation};
Index: /issm/trunk/test/NightlyRun/test2002.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2002.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2002.py	(revision 26744)
@@ -1,3 +1,3 @@
-#Test Name: EarthSlr
+#Test Name: EarthSlc
 import numpy as np
 
@@ -7,102 +7,138 @@
 from materials import *
 from model import *
-from parameterize import *
 from paterson import *
 from solve import *
 
 
-#mesh earth:
 md = model()
-md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) #700 km resolution mesh
+md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) # 700 km resolution mesh
 
-#parameterize solidearth solution:
-#solidearth loading:
-md.solidearth.surfaceload.icethicknesschange = np.zeros((md.mesh.numberofelements, 1))
-md.solidearth.initialsealevel = np.zeros((md.mesh.numberofvertices, 1))
-md.dsl.global_average_thermosteric_sea_level_change = np.zeros((2, 1))
-md.dsl.sea_surface_height_change_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
-md.dsl.sea_water_pressure_change_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
+# Geometry for the bed, arbitrary thickness of 100
+md.geometry.bed = np.zeros((md.mesh.numberofvertices, ))
+md.geometry.base = md.geometry.bed
+md.geometry.thickness = 100 * np.ones((md.mesh.numberofvertices, ))
+md.geometry.surface = md.geometry.bed + md.geometry.thickness
 
-#antarctica
-late = md.mesh.lat[md.mesh.elements - 1].sum(axis=1) / 3
-longe = md.mesh.long[md.mesh.elements - 1].sum(axis=1) / 3
+# Solidearth loading #{{{
+md.masstransport.spcthickness = np.append(md.geometry.thickness, 0)
+md.smb.mass_balance = np.zeros((md.mesh.numberofvertices, 1))
+
+# Antarctica
+xe = md.mesh.x[md.mesh.elements - 1].sum(axis=1) / 3
+ye = md.mesh.y[md.mesh.elements - 1].sum(axis=1) / 3
+ze = md.mesh.z[md.mesh.elements - 1].sum(axis=1) / 3
+re = pow((pow(xe, 2) + pow(ye, 2) + pow(ze, 2)), 0.5)
+
+late = asind(ze / re)
+longe = atan2d(ye, xe)
 pos = np.where(late < -80)[0]
-md.solidearth.surfaceload.icethicknesschange[pos] = -100
-#greenland
-pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > -60, longe < -30)))[0]
-md.solidearth.surfaceload.icethicknesschange[pos] = -100
+md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
+posant = pos
 
-#elastic loading from love numbers:
-md.solidearth.lovenumbers = lovenumbers('maxdeg', 100)
+# Greenland
+pos = np.where(np.logical_and.reduce((late > 60, late < 90, longe > -75, longe < -15)))[0]
+md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
+posgre = pos
+
+# Elastic loading from love numbers:
+md.solidearth.lovenumbers = lovenumbers('maxdeg', 1000)
 #}}}
 
-#mask:  {{{
+# Mask: {{{
 mask = gmtmask(md.mesh.lat, md.mesh.long)
-icemask = np.ones((md.mesh.numberofvertices, 1))
+oceanmask = -1 * np.ones((md.mesh.numberofvertices, ))
 pos = np.where(mask == 0)[0]
-icemask[pos] = -1
-pos = np.where(mask[md.mesh.elements - 1].sum(axis=1) < 3)[0]
-icemask[md.mesh.elements[pos, :] - 1] = -1
+oceanmask[pos] = 1
+
+icemask = np.ones((md.mesh.numberofvertices, ))
+# NOTE: Need to be careful here: when using multidimensional array elements to 
+# address a one-dimensional array in MATLAB, only first column is used
+#
+icemask[md.mesh.elements[posant][:, 0] - 1] = -1
+icemask[md.mesh.elements[posgre][:, 0] - 1] = -1
+
 md.mask.ice_levelset = icemask
-md.mask.ocean_levelset = -icemask
+md.mask.ocean_levelset = oceanmask
+#}}}
 
-#make sure that the elements that have loads are fully grounded
-pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0]
-md.mask.ocean_levelset[md.mesh.elements[pos, :] - 1] = 1
+# Time stepping {{{
+md.timestepping.start_time = 0
+md.timestepping.time_step = 1
+md.timestepping.final_time = 1
+#}}}
 
-#make sure wherever there is an ice load, that the mask is set to ice:
-#pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0] # TODO: Do we need to do this twice?
-md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = -1
-# }}}
+# Masstransport
+md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
+md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.vx = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.sealevel = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.str = 0
 
-md.solidearth.settings.ocean_area_scaling = 0
+# Materials
+md.materials = materials('hydro')
 
-#geometry for the bed, arbitrary
-md.geometry.bed = -np.ones((md.mesh.numberofvertices, 1))
-
-#materials
-md.materials=materials('hydro')
-
-#Miscellaneous
+# Miscellaneous
 md.miscellaneous.name = 'test2002'
 
-#Solution parameters
+# Solution parameters
+md.cluster.np = 3
 md.solidearth.settings.reltol = np.nan
 md.solidearth.settings.abstol = 1e-3
-md.solidearth.settings.computesealevelchange = 1
+md.solidearth.settings.sealevelloading = 1
+md.solidearth.settings.isgrd = 1
+md.solidearth.settings.ocean_area_scaling = 0
+md.solidearth.settings.grdmodel = 1
 
-#max number of iterations reverted back to 10 (i.e., the original default value)
+# Physics
+md.transient.issmb = 0
+md.transient.isstressbalance = 0
+md.transient.isthermal = 0
+md.transient.ismasstransport = 1
+md.transient.isslc = 1
+md.solidearth.requested_outputs = ['Sealevel', 'Bed']
+
+# Max number of iterations reverted back to 10 (i.e., the original default value)
 md.solidearth.settings.maxiter = 10
 
-#eustatic run:
-md.solidearth.settings.rigid = 0
+# Eustatic run
+md.solidearth.settings.selfattraction = 0
 md.solidearth.settings.elastic = 0
 md.solidearth.settings.rotation = 0
-md = solve(md, 'Sealevelrise')
-Seustatic = md.results.SealevelriseSolution.Sealevel
+md.solidearth.settings.viscous = 0
 
-#eustatic + rigid run:
-md.solidearth.settings.rigid = 1
+md = solve(md, 'Transient')
+Seustatic = md.results.TransientSolution.Sealevel
+Beustatic = md.results.TransientSolution.Bed
+
+# Eustatic + selfattraction run
+md.solidearth.settings.selfattraction = 1
 md.solidearth.settings.elastic = 0
 md.solidearth.settings.rotation = 0
-md = solve(md, 'Sealevelrise')
-Srigid = md.results.SealevelriseSolution.Sealevel
+md.solidearth.settings.viscous = 0
+md = solve(md, 'tr')
+Sselfattraction = md.results.TransientSolution.Sealevel
+Bselfattraction = md.results.TransientSolution.Bed
 
-#eustatic + rigid + elastic run:
-md.solidearth.settings.rigid = 1
+# Eustatic + selfattraction + elastic run
+md.solidearth.settings.selfattraction = 1
 md.solidearth.settings.elastic = 1
 md.solidearth.settings.rotation = 0
-md = solve(md, 'Sealevelrise')
-Selastic = md.results.SealevelriseSolution.Sealevel
+md.solidearth.settings.viscous = 0
+md = solve(md, 'tr')
+Selastic = md.results.TransientSolution.Sealevel
+Belastic = md.results.TransientSolution.Bed
 
-#eustatic + rigid + elastic + rotation run:
-md.solidearth.settings.rigid = 1
+# Eustatic + selfattraction + elastic + rotation run
+md.solidearth.settings.selfattraction = 1
 md.solidearth.settings.elastic = 1
 md.solidearth.settings.rotation = 1
-md = solve(md, 'Sealevelrise')
-Srotation = md.results.SealevelriseSolution.Sealevel
+md.solidearth.settings.viscous = 0
+md = solve(md, 'tr')
+Srotation = md.results.TransientSolution.Sealevel
+Brotation = md.results.TransientSolution.Bed
 
-#Fields and tolerances to track changes
-field_names = ['Eustatic', 'Rigid', 'Elastic', 'Rotation']
-field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
-field_values = [Seustatic, Srigid, Selastic, Srotation]
+# Fields and tolerances to track changes
+field_names = ['Seustatic', 'Sselfattraction', 'Selastic', 'Srotation', 'Beustatic', 'Bselfattraction', 'Belastic', 'Brotation']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [Seustatic, Sselfattraction, Selastic, Srotation, Beustatic, Bselfattraction, Belastic, Brotation]
Index: /issm/trunk/test/NightlyRun/test2003.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2003.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2003.m	(revision 26744)
@@ -1,59 +1,56 @@
-%Test Name: EarthSlr_rotationalFeedback
+%Test Name: EarthSlc_rotationalFeedback
 
 %mesh earth:
 md=model;
-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',1000.); %1000 km resolution mesh
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
 
-%parameterize slr solution:
+%Geometry for the bed, arbitrary thickness of 1000: 
+md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+md.geometry.base=md.geometry.bed;
+md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
+md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+
+%parameterize slc solution:
 %solidearth loading:  {{{
-md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
-md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
-md.dsl.global_average_thermosteric_sea_level_change=[0;0];
-md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
-md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+md.masstransport.spcthickness=[md.geometry.thickness;0];
+md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
 
-%antarctica
-late=sum(md.mesh.lat(md.mesh.elements),2)/3;
-longe=sum(md.mesh.long(md.mesh.elements),2)/3;
-pos=find(late <-75 & longe <0);
-md.solidearth.surfaceload.icethicknesschange(pos)=-1;
+xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
+ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
+re=sqrt(xe.^2+ye.^2+ze.^2);
+
+late=asind(ze./re);
+longe=atan2d(ye,xe);
+
+%greenland
+pos=find(late>60 & late<90 & longe>-75 & longe<-15);
+md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-1000;
+posice=pos;
 
 %elastic loading from love numbers:
-md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
-
+md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
 %}}}
 %mask:  {{{
 mask=gmtmask(md.mesh.lat,md.mesh.long);
 icemask=ones(md.mesh.numberofvertices,1);
-pos=find(mask==0);
-icemask(pos)=-1;
-pos=find(sum(mask(md.mesh.elements),2)<3);
-icemask(md.mesh.elements(pos,:))=-1;
+icemask(md.mesh.elements(posice,:))=-1;
 md.mask.ice_levelset=icemask;
-md.mask.ocean_levelset=-icemask;
+oceanmask=-ones(md.mesh.numberofvertices,1);
+pos=find(mask==0); oceanmask(pos)=1;
+md.mask.ocean_levelset=oceanmask;
 
-%make sure that the elements that have loads are fully grounded:
-pos=find(md.solidearth.surfaceload.icethicknesschange);
-md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
-
-%make sure wherever there is an ice load, that the mask is set to ice:
-pos=find(md.solidearth.surfaceload.icethicknesschange);
-md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
-% }}}
-
-% use model representation of ocen area (not the true area)
+% use model representation of ocean area (not the true area)
 md.solidearth.settings.ocean_area_scaling = 0;
-
-%geometry
-di=md.materials.rho_ice/md.materials.rho_water;
-md.geometry.thickness=ones(md.mesh.numberofvertices,1);
-md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1);
-md.geometry.base=md.geometry.surface-md.geometry.thickness;
-md.geometry.bed=md.geometry.base;
 
 %materials
 md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
-md.materials.rheology_B=paterson(md.initialization.temperature);
-md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+md.initialization.str=0;
+
+md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+md.initialization.vy=zeros(md.mesh.numberofvertices,1);
 
 %Miscellaneous
@@ -63,26 +60,52 @@
 md.solidearth.settings.reltol=NaN;
 md.solidearth.settings.abstol=1e-3;
-md.solidearth.settings.computesealevelchange=1;
+md.solidearth.settings.sealevelloading=0;
+md.solidearth.settings.grdocean=0;
+md.solidearth.settings.isgrd=1;
+md.solidearth.settings.ocean_area_scaling=0;
+md.solidearth.settings.grdmodel=1;
+md.solidearth.settings.horiz=1;
+md.solidearth.requested_outputs={'Sealevel','Bed', 'BedEast', 'BedNorth'};
 
-%eustatic + rigid + elastic run:
-md.solidearth.settings.rigid=1;
+%Physics: 
+md.transient.issmb=0;
+md.transient.isstressbalance=0;
+md.transient.isthermal=0;
+md.transient.ismasstransport=1;
+md.transient.isslc=1;
+
+md.timestepping.start_time=0;
+md.timestepping.time_step=1;
+md.timestepping.final_time=1;
+
+%eustatic + selfattraction + elastic run:
+md.solidearth.settings.selfattraction=1;
 md.solidearth.settings.elastic=1;
 md.solidearth.settings.rotation=0;
+md.solidearth.settings.viscous=0;
 md.cluster=generic('name',oshostname(),'np',3);
 %md.verbose=verbose('111111111');
-md=solve(md,'Sealevelrise');
-SnoRotation=md.results.SealevelriseSolution.Sealevel;
+md=solve(md,'Transient');
+SnoRotation=md.results.TransientSolution.Sealevel;
+BUnoRotation=md.results.TransientSolution.Bed;
+BEnoRotation=md.results.TransientSolution.BedEast;
+BNnoRotation=md.results.TransientSolution.BedNorth;
 
-%eustatic + rigid + elastic + rotation run:
-md.solidearth.settings.rigid=1;
+%eustatic + selfattraction + elastic + rotation run:
+md.solidearth.settings.selfattraction=1;
 md.solidearth.settings.elastic=1;
 md.solidearth.settings.rotation=1;
+md.solidearth.settings.viscous=0;
 md.cluster=generic('name',oshostname(),'np',3);
 %md.verbose=verbose('111111111');
-md=solve(md,'Sealevelrise');
-SRotation=md.results.SealevelriseSolution.Sealevel;
+md=solve(md,'Transient');
+SRotation=md.results.TransientSolution.Sealevel;
+BURotation=md.results.TransientSolution.Bed;
+BERotation=md.results.TransientSolution.BedEast;
+BNRotation=md.results.TransientSolution.BedNorth;
 
 %Fields and tolerances to track changes
-field_names     ={'noRotation','Rotation'};
-field_tolerances={1e-13,1e-13};
-field_values={SnoRotation,SRotation};
+field_names     ={'Sealevel', 'Uplift', 'NorthDisplacement', 'EastDisplacement'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13};
+field_values={SRotation-SnoRotation,BURotation-BUnoRotation,BNRotation-BNnoRotation,BERotation-BEnoRotation};
+
Index: /issm/trunk/test/NightlyRun/test2003.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2003.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2003.py	(revision 26744)
@@ -1,10 +1,9 @@
-#Test Name: EarthSlr_rotationalFeedback
+#Test Name: EarthSlc_rotationalFeedback
 import numpy as np
-
 from socket import gethostname
-
 from gmshplanet import *
 from gmtmask import *
 from lovenumbers import *
+from MatlabFuncs import *
 from model import *
 from paterson import *
@@ -12,90 +11,111 @@
 
 
-#mesh earth:
 md = model()
-md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 1000.)  #1000 km resolution mesh
+md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) # 700 km resolution mesh
 
-#parameterize solidearth solution:
+# Geometry for the bed, arbitrary thickness of 100
+md.geometry.bed = -1 * np.ones((md.mesh.numberofvertices, ))
+md.geometry.base = md.geometry.bed
+md.geometry.thickness = 1000 * np.ones((md.mesh.numberofvertices, ))
+md.geometry.surface = md.geometry.bed + md.geometry.thickness
+
+# Parameterize slc solution:
 #solidearth loading:  {{{
-md.solidearth.surfaceload.icethicknesschange = np.zeros((md.mesh.numberofelements, ))
-md.solidearth.initialsealevel = np.zeros((md.mesh.numberofvertices, ))
-md.dsl.global_average_thermosteric_sea_level_change=np.zeros((2, ))
-md.dsl.sea_surface_height_change_above_geoid=np.zeros((md.mesh.numberofvertices+1, ))
-md.dsl.sea_water_pressure_change_at_sea_floor=np.zeros((md.mesh.numberofvertices+1, ))
+md.masstransport.spcthickness = np.append(md.geometry.thickness, 0)
+md.smb.mass_balance = np.zeros(md.mesh.numberofvertices)
 
-#antarctica
-#Access every element in lat using the indices in elements
-# - 1 to convert to base 0 indexing, 1 (not 2, in matlab) to sum over rows
-late = md.mesh.lat[md.mesh.elements - 1].sum(axis=1)/ 3
-longe = md.mesh.long[md.mesh.elements - 1].sum(axis=1)/ 3
-pos = np.intersect1d(np.array(np.where(late < -75)[0]), np.array(np.where(longe < 0)[0]))
-md.solidearth.surfaceload.icethicknesschange[pos] = -1
+xe = md.mesh.x[md.mesh.elements - 1].sum(axis=1) / 3
+ye = md.mesh.y[md.mesh.elements - 1].sum(axis=1) / 3
+ze = md.mesh.z[md.mesh.elements - 1].sum(axis=1) / 3
+re = pow((pow(xe, 2) + pow(ye, 2) + pow(ze, 2)), 0.5)
 
-#elastic loading from love numbers:
-md.solidearth.lovenumbers = lovenumbers('maxdeg', 1000)
+late = asind(ze / re)
+longe = atan2d(ye, xe)
+
+# Greenland
+pos = np.where(np.logical_and.reduce((late > 60, late < 90, longe > -75, longe < -15)))[0]
+md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 1000
+posice = pos
+
+# Elastic loading from love numbers
+md.solidearth.lovenumbers = lovenumbers('maxdeg', 100)
 #}}}
 
-#mask:  {{{
+# Mask: {{{
 mask = gmtmask(md.mesh.lat, md.mesh.long)
 icemask = np.ones(md.mesh.numberofvertices)
+icemask[md.mesh.elements[posice, :] - 1] = -1
+md.mask.ice_levelset = icemask
+oceanmask = -1 * np.ones(md.mesh.numberofvertices)
 pos = np.where(mask == 0)[0]
-icemask[pos] = -1
-pos = np.where(mask[md.mesh.elements - 1].sum(axis=1) < 3)[0]
-icemask[md.mesh.elements[pos, :] - 1] = -1
-md.mask.ice_levelset = icemask
-md.mask.ocean_levelset = -icemask
+oceanmask[pos] = 1
+md.mask.ocean_levelset = oceanmask
 
-#make sure that the elements that have loads are fully grounded
-pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0]
-md.mask.ocean_levelset[md.mesh.elements[pos, :] - 1] = 1
-
-#make sure wherever there is an ice load, that the mask is set to ice:
-#pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0] # Do we need to do this twice?
-md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = -1
-# }}}
-
-# use model representation of ocen area (not the true area)
+# Use model representation of ocean area (not the true area)
 md.solidearth.settings.ocean_area_scaling = 0
 
-#geometry
-di = md.materials.rho_ice / md.materials.rho_water
-md.geometry.thickness = np.ones(md.mesh.numberofvertices)
-md.geometry.surface = (1 - di) * np.zeros(md.mesh.numberofvertices)
-md.geometry.base = md.geometry.surface - md.geometry.thickness
-md.geometry.bed = md.geometry.base
+# Materials
+md.initialization.temperature = 273.25 * np.ones(md.mesh.numberofvertices)
+md.initialization.sealevel = np.zeros(md.mesh.numberofvertices)
+md.initialization.str = 0
 
-#materials
-md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
-md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
+md.basalforcings.groundedice_melting_rate = np.zeros(md.mesh.numberofvertices)
+md.basalforcings.floatingice_melting_rate = np.zeros(md.mesh.numberofvertices)
+md.initialization.vx = np.zeros(md.mesh.numberofvertices)
+md.initialization.vy = np.zeros(md.mesh.numberofvertices)
 
-#Miscellaneous
+# Miscellaneous
 md.miscellaneous.name = 'test2003'
 
-#Solution parameters
+# Solution parameters
 md.solidearth.settings.reltol = np.nan
 md.solidearth.settings.abstol = 1e-3
-md.solidearth.settings.computesealevelchange = 1
+md.solidearth.settings.sealevelloading = 0
+md.solidearth.settings.grdocean = 0
+md.solidearth.settings.isgrd = 1
+md.solidearth.settings.ocean_area_scaling = 0
+md.solidearth.settings.grdmodel = 1
+md.solidearth.settings.horiz = 1
+md.solidearth.requested_outputs = ['Sealevel', 'Bed', 'BedEast', 'BedNorth']
 
-#eustatic + rigid + elastic run:
-md.solidearth.settings.rigid = 1
+# Physics
+md.transient.issmb = 0
+md.transient.isstressbalance = 0
+md.transient.isthermal = 0
+md.transient.ismasstransport = 1
+md.transient.isslc = 1
+
+md.timestepping.start_time = 0
+md.timestepping.time_step = 1
+md.timestepping.final_time = 1
+
+# Eustatic + selfattraction + elastic run:
+md.solidearth.settings.selfattraction = 1
 md.solidearth.settings.elastic = 1
 md.solidearth.settings.rotation = 0
+md.solidearth.settings.viscous = 0
 md.cluster = generic('name', gethostname(), 'np', 3)
 #md.verbose = verbose('111111111')
-md = solve(md, 'Sealevelrise')
-SnoRotation = md.results.SealevelriseSolution.Sealevel
+md = solve(md, 'Transient')
+SnoRotation = md.results.TransientSolution.Sealevel
+BUnoRotation = md.results.TransientSolution.Bed
+BEnoRotation = md.results.TransientSolution.BedEast
+BNnoRotation = md.results.TransientSolution.BedNorth
 
-#eustatic + rigid + elastic + rotation run:
-md.solidearth.settings.rigid = 1
+# Eustatic + selfattraction + elastic + rotation run
+md.solidearth.settings.selfattraction = 1
 md.solidearth.settings.elastic = 1
 md.solidearth.settings.rotation = 1
+md.solidearth.settings.viscous = 0
 md.cluster = generic('name', gethostname(), 'np', 3)
 #md.verbose = verbose('111111111')
-md = solve(md, 'Sealevelrise')
-SRotation = md.results.SealevelriseSolution.Sealevel
+md = solve(md, 'Transient')
+SRotation = md.results.TransientSolution.Sealevel
+BURotation = md.results.TransientSolution.Bed
+BERotation = md.results.TransientSolution.BedEast
+BNRotation = md.results.TransientSolution.BedNorth
 
-#Fields and tolerances to track changes
-field_names = ['noRotation', 'Rotation']
-field_tolerances = [1e-13, 1e-13]
-field_values = [SnoRotation, SRotation]
+# Fields and tolerances to track changes
+field_names = ['Sealevel', 'Uplift', 'NorthDisplacement', 'EastDisplacement']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [SRotation - SnoRotation, BURotation - BUnoRotation, BNRotation - BNnoRotation,BERotation - BEnoRotation]
Index: /issm/trunk/test/NightlyRun/test2004.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2004.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2004.m	(revision 26744)
@@ -72,5 +72,5 @@
 %meshing parameters:  {{{
 hmin=500; hmax=700; hmin=hmin*1000; hmax=hmax*1000; 
-tolerance=100; %tolerance of 100m on Earth position when mergin 3d meshes
+tolerance=100; %tolerance of 100m on Earth position when merging 3d meshes
 threshold=5;
 defaultoptions={'KeepVertices',0,'MaxCornerAngle',0.0000000001,'NoBoundaryRefinement',1}; 
@@ -134,10 +134,14 @@
 		disp('      reading bedrock');
 		md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+		md.geometry.base=md.geometry.bed;
+		md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
+		md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+
 	end % }}}
-	%Slr: {{{
+	%Slc: {{{
 	if bas.iscontinentany('antarctica'),
 		if testagainst2002,
-			% TODO: Check if the following works as expected: 'pos' is empty, so nothing is assigned to 'md.solidearth.surfaceload.icethicknesschange(pos)'
-			md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
+			% TODO: Check if the following works as expected: 'pos' is empty, so nothing is assigned to 'md.masstransport.spcthickness(pos)'
+			md.masstransport.spcthickness=zeros(md.mesh.numberofvertices,1);
 			%antarctica
 			late=sum(md.mesh.lat(md.mesh.elements),2)/3;
@@ -146,5 +150,5 @@
 			ratio=0.225314032985172/0.193045366574523;
 			%ratio=   1.276564103522540/.869956;
-			md.solidearth.surfaceload.icethicknesschange(pos)=-100*ratio;
+			md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100*ratio;
 		else
 			in_fileID=fopen('../Data/AIS_delH_trend.txt', 'r');
@@ -164,12 +168,12 @@
 			northpole=find_point(md.mesh.long,md.mesh.lat,0,90);
 			delHAIS(northpole)=0;
-			md.solidearth.surfaceload.icethicknesschange=mean(delHAIS(md.mesh.elements),2)/100;
+			md.masstransport.spcthickness=delHAIS/100;
 		end
 
-		md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
-
-		md.dsl.global_average_thermosteric_sea_level_change=[0;0];
-		md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
-		md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+		md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+
+		md.dsl.global_average_thermosteric_sea_level=[0;0];
+		md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+		md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
 
 	end %}}}
@@ -244,6 +248,6 @@
 	% }}}
 	%}}}
-	%slr loading/calibration:  {{{
-	md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
+	%slc loading/calibration:  {{{
+	md.masstransport.spcthickness=zeros(md.mesh.numberofvertices,1);
 
 	if testagainst2002, 
@@ -254,5 +258,6 @@
 		pos=find(late > 70 &  late < 80 & longe>-60 & longe<-30);
 		ratio=.3823/.262344;
-		%md.solidearth.surfaceload.icethicknesschange(pos)=-100*ratio;
+		md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100*ratio;
+		%md.masstransport.spcthickness(pos)=-100*ratio;
 
 		%correct mask: 
@@ -264,6 +269,4 @@
 		latGIS=delH(:,2);
 		delHGIS=delH(:,3);
-		% points=[longGIS,latGIS];
-		% index=delaunayn(points);
 		index=BamgTriangulate(longGIS, latGIS);
 		lat=md.mesh.lat;
@@ -272,5 +275,4 @@
 		long(pos)=long(pos)-360;
 		delHGIS=InterpFromMeshToMesh2d(index,longGIS,latGIS,delHGIS,long,lat);
-		delHGISe=delHGIS(md.mesh.elements)*[1;1;1]/3;
 
 		delH=textread('../Data/GLA_delH_trend_15regions.txt');
@@ -278,6 +280,4 @@
 		latGLA=delH(:,2);
 		delHGLA=sum(delH(:,3:end),2);
-		% points=[longGLA,latGLA];
-		% index=delaunayn(points);
 		index=BamgTriangulate(longGLA, latGLA);
 		lat=md.mesh.lat; 
@@ -286,26 +286,22 @@
 		long(pos)=long(pos)-360;
 		delHGLA=InterpFromMeshToMesh2d(index,longGLA,latGLA,delHGLA,long,lat);
-		delHGLAe=delHGLA(md.mesh.elements)*[1;1;1]/3;
-
-		pos=find(delHGISe);
-		md.solidearth.surfaceload.icethicknesschange(pos)=delHGISe(pos)/100;
-		pos=find(delHGLAe);
-		md.solidearth.surfaceload.icethicknesschange(pos)=delHGLAe(pos)/100;
+
+		pos=find(delHGIS);
+		md.masstransport.spcthickness(pos) = md.masstransport.spcthickness(pos)-delHGIS(pos)/100;
+		pos=find(delHGLA);
+		md.masstransport.spcthickness(pos)= md.masstransport.spcthickness(pos)-delHGLA(pos)/100;
 
 		%adjust mask accordingly: 
-		pos=find(md.solidearth.surfaceload.icethicknesschange); 
-		flags=zeros(md.mesh.numberofvertices,1); 
-		flags(md.mesh.elements(pos,:))=1;
-		pos=find(flags);
+		pos=find(md.masstransport.spcthickness); 
 		md.mask.ice_levelset(pos)=-1;
 		md.mask.ocean_levelset(pos)=1;
 	end
 
-	md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
-
-	md.dsl.global_average_thermosteric_sea_level_change=[0;0];
+	md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+
+	md.dsl.global_average_thermosteric_sea_level=[0;0];
 	%md.dsl.steric_rate=(1.1+.38)*ones(md.mesh.numberofvertices,1); %steric + water storage.
-	md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
-	md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+	md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+	md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
 
 	%}}}
@@ -313,4 +309,7 @@
 	di=md.materials.rho_ice/md.materials.rho_water;
 	md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+	md.geometry.base=md.geometry.bed;
+	md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
+	md.geometry.surface=md.geometry.bed+md.geometry.thickness;
 	% }}}
 	%materials:  {{{
@@ -346,10 +345,13 @@
 sl.transfer('mask.ocean_levelset');
 sl.transfer('geometry.bed');
+sl.transfer('geometry.surface');
+sl.transfer('geometry.thickness');
+sl.transfer('geometry.base');
 sl.transfer('mesh.lat');
 sl.transfer('mesh.long');
-sl.transfer('solidearth.surfaceload.icethicknesschange');
-sl.transfer('solidearth.initialsealevel');
-sl.transfer('dsl.sea_surface_height_change_above_geoid');
-sl.transfer('dsl.sea_water_pressure_change_at_sea_floor');
+sl.transfer('masstransport.spcthickness');
+sl.transfer('initialization.sealevel');
+sl.transfer('dsl.sea_surface_height_above_geoid');
+sl.transfer('dsl.sea_water_pressure_at_sea_floor');
 
 %radius: 
@@ -368,5 +370,5 @@
 
 % }}}
-%Solve Sea-level equation on Earth only:  {{{
+%Solve Sea-level eqEricuation on Earth only:  {{{
 md=sl.earth; %we don't do computations on ice sheets or land.
 
@@ -382,11 +384,32 @@
 
 %New stuff
-md.dsl.global_average_thermosteric_sea_level_change=[1.1+.38;0]; %steric + water storage AR5.
+md.dsl.global_average_thermosteric_sea_level=[1.1+.38;0]; %steric + water storage AR5.
 
 %Solution parameters
 md.solidearth.settings.reltol=NaN;
 md.solidearth.settings.abstol=1e-3;
-md.solidearth.settings.computesealevelchange=1;
+md.solidearth.settings.sealevelloading=1;
+md.solidearth.settings.isgrd=1;
+md.solidearth.settings.ocean_area_scaling=0;
+md.solidearth.settings.grdmodel=1;
 md.timestepping.time_step=1;
+
+%Physics: 
+md.transient.issmb=0; 
+md.transient.isstressbalance=0;
+md.transient.isthermal=0;
+md.transient.ismasstransport=1;
+md.transient.isslc=1;
+
+%Initializations: 
+md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+md.initialization.bottompressure=zeros(md.mesh.numberofvertices,1);
+md.initialization.dsl=zeros(md.mesh.numberofvertices,1);
+md.initialization.str=0;
+md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
 
 %max number of iterations reverted back to 10 (i.e. the original default value)
@@ -394,33 +417,37 @@
 
 %eustatic run:
-md.solidearth.settings.rigid=0;
+md.solidearth.settings.selfattraction=0;
 md.solidearth.settings.elastic=0;
 md.solidearth.settings.rotation=0;
+md.solidearth.settings.viscous=0;
 md.solidearth.requested_outputs= {'default',...
-	'SurfaceloadIceThicknessChange','Sealevel','SealevelRSLRate','SealevelriseCumDeltathickness',...
-	'SealevelNEsaRate', 'SealevelUEsaRate', 'NGiaRate', 'UGiaRate','SealevelEustaticMask','SealevelEustaticOceanMask'};
-md=solve(md,'Sealevelrise');
-Seustatic=md.results.SealevelriseSolution.Sealevel;
-
-%eustatic + rigid run:
-md.solidearth.settings.rigid=1;
+	'DeltaIceThickness','Sealevel','SealevelUGrd',...
+	'SealevelchangeBarystaticMask','SealevelchangeBarystaticOceanMask'};
+md=solve(md,'Transient');
+Seustatic=md.results.TransientSolution.Sealevel;
+
+%eustatic + selfattraction run:
+md.solidearth.settings.selfattraction=1;
 md.solidearth.settings.elastic=0;
 md.solidearth.settings.rotation=0;
-md=solve(md,'Sealevelrise');
-Srigid=md.results.SealevelriseSolution.Sealevel;
-
-%eustatic + rigid + elastic run:
-md.solidearth.settings.rigid=1;
+md.solidearth.settings.viscous=0;
+md=solve(md,'Transient');
+Sselfattraction=md.results.TransientSolution.Sealevel;
+
+%eustatic + selfattraction + elastic run:
+md.solidearth.settings.selfattraction=1;
 md.solidearth.settings.elastic=1;
 md.solidearth.settings.rotation=0;
-md=solve(md,'Sealevelrise');
-Selastic=md.results.SealevelriseSolution.Sealevel;
-
-%eustatic + rigid + elastic + rotation run:
-md.solidearth.settings.rigid=1;
+md.solidearth.settings.viscous=0;
+md=solve(md,'Transient');
+Selastic=md.results.TransientSolution.Sealevel;
+
+%eustatic + selfattraction + elastic + rotation run:
+md.solidearth.settings.selfattraction=1;
 md.solidearth.settings.elastic=1;
 md.solidearth.settings.rotation=1;
-md=solve(md,'Sealevelrise');
-Srotation=md.results.SealevelriseSolution.Sealevel;
+md.solidearth.settings.viscous=0;
+md=solve(md,'Transient');
+Srotation=md.results.TransientSolution.Sealevel;
 %}}}
 
@@ -428,3 +455,3 @@
 field_names     ={'Eustatic','Rigid','Elastic','Rotation'};
 field_tolerances={1e-13,1e-13,1e-13,1e-13};
-field_values={Seustatic,Srigid,Selastic,Srotation};
+field_values={Seustatic,Sselfattraction,Selastic,Srotation};
Index: /issm/trunk/test/NightlyRun/test2004.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2004.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2004.py	(revision 26744)
@@ -114,5 +114,5 @@
 hmin = hmin * 1000
 hmax = hmax * 1000
-tolerance = 100
+tolerance = 100 # tolerance of 100m on Earth position when merging 3d meshes
 threshold = 5
 defaultoptions = [
@@ -145,4 +145,5 @@
     # Vertex connectivity
     md.mesh.vertexconnectivity = NodeConnectivity(md.mesh.elements, md.mesh.numberofvertices)
+
     # Add model to sl icecaps
     sl.addicecap(md)
@@ -178,11 +179,14 @@
         print('      reading bedrock')
         md.geometry.bed = -np.ones((md.mesh.numberofvertices, ))
-    #}}}
-
-    # SLR #{{{
+        md.geometry.base = md.geometry.bed
+        md.geometry.thickness = 1000 * np.ones((md.mesh.numberofvertices, ))
+        md.geometry.surface = md.geometry.bed + md.geometry.thickness
+    #}}}
+
+    # SLC #{{{
     if bas.iscontinentany('antarctica'):
         if testagainst2002:
             # TODO: Check if the following works as expected: 'pos' is empty, so nothing is assigned to 'md.solidearth.surfaceload.icethicknesschange[pos]'
-            md.solidearth.surfaceload.icethicknesschange = np.zeros((md.mesh.numberofelements, ))
+            md.masstransport.spcthickness = np.zeros((md.mesh.numberofvertices, ))
             # Antarctica
             late = np.sum(md.mesh.lat[md.mesh.elements - 1], axis=1) / 3
@@ -190,5 +194,5 @@
             pos = np.where(late < -85)[0]
             ratio = 0.225314032985172 / 0.193045366574523
-            md.solidearth.surfaceload.icethicknesschange[pos] = -100 * ratio
+            md.masstransport.spcthickness[md.mesh.elements[pos]] = md.masstransport.spcthickness[md.mesh.elements[pos]] - 100 * ratio
         else:
             delH = np.loadtxt('../Data/AIS_delH_trend.txt')
@@ -201,14 +205,14 @@
             pos = np.where(longe > 360)[0]
             longe[pos] = longe[pos] - 360
-            delHAIS = InterpFromMesh2d(index, longAIS, latAIS, delHAIS, longe, late)  # NOTE: Compare to corresponding output under MATLAB to understand why we offset triangle indices by 1 (only caught because Triangle.cpp was producing triangles with negative areas)
+            delHAIS = InterpFromMesh2d(index, longAIS, latAIS, delHAIS, longe, late) # NOTE: Compare to corresponding output under MATLAB to understand why we offset triangle indices by 1 (only caught because Triangle.cpp was producing triangles with negative areas)
             northpole = find_point(md.mesh.long, md.mesh.lat, 0, 90)
             delHAIS[northpole] = 0
-            md.solidearth.surfaceload.icethicknesschange = np.mean(delHAIS[md.mesh.elements - 1], axis=1) / 100
-
-        md.solidearth.initialsealevel = np.zeros((md.mesh.numberofvertices, ))
-
-        md.dsl.global_average_thermostatic_sea_level_change = np.zeros((2, 1))
-        md.dsl.sea_surface_height_change_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
-        md.dsl.sea_water_pressure_change_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
+            md.masstransport.spcthickness = delHAIS / 100
+
+        md.initialization.sealevel = np.zeros((md.mesh.numberofvertices, ))
+
+        md.dsl.global_average_thermosteric_sea_level = np.zeros((2, 1))
+        md.dsl.sea_surface_height_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
+        md.dsl.sea_water_pressure_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
     #}}}
 
@@ -226,5 +230,5 @@
 # Parameterize continents #{{{
 for ind in sl.basinindx('continent', ['hemisphereeast', 'hemispherewest']):
-    print("Masks for basin {}".format(sl.icecaps[ind].miscellaneous.name))
+    print('Masks for basin {}'.format(sl.icecaps[ind].miscellaneous.name))
     md = sl.icecaps[ind]
     bas = sl.basins[ind]
@@ -283,6 +287,6 @@
     #}}}
 
-    # SLR loading/calibration #{{{
-    md.solidearth.surfaceload.icethicknesschange = np.zeros((md.mesh.numberofelements, ))
+    # SLC loading/calibration #{{{
+    md.masstransport.spcthickness = np.zeros((md.mesh.numberofvertices, ))
 
     if testagainst2002:
@@ -293,4 +297,5 @@
         pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > -60, longe < -30)))[0]
         ratio = .3823 / .262344
+        md.masstransport.spcthickness[md.mesh.elements[pos]] = md.masstransport.spcthickness[md.mesh.elements[pos]] - 100 * ratio
 
         # Correct mask
@@ -307,6 +312,5 @@
         pos = np.where(longe > 360)[0]
         longe[pos] = longe[pos] - 360
-        delHGIS = InterpFromMeshToMesh2d(index, longGIS, latGIS, delHGIS, longe, late) # NOTE: Compare to corresponding ouptut under MATLAB to understand why we offset triangle indices by 1 (only caught because Triangle.cpp was producing triangles with negative areas)
-        delHGISe = np.mean(delHGIS[md.mesh.elements - 1], axis=1).flatten()
+        delHGIS = InterpFromMeshToMesh2d(index, longGIS, latGIS, delHGIS, longe, late)
 
         delH = np.loadtxt('../Data/GLA_delH_trend_15regions.txt')
@@ -319,29 +323,35 @@
         pos = np.where(longe > 360)[0]
         longe[pos] = longe[pos] - 360
-        delHGLA = InterpFromMeshToMesh2d(index, longGLA, latGLA, delHGLA, longe, late) # NOTE: Compare to corresponding ouptut under MATLAB to understand why we offset triangle indices by 1 (only caught because Triangle.cpp was producing triangles with negative areas)
-        delHGLAe = np.mean(delHGLA[md.mesh.elements - 1], axis=1).flatten()
-
-        pos = np.nonzero(delHGISe)[0]
-        md.solidearth.surfaceload.icethicknesschange[pos] = delHGISe[pos] / 100
-        pos = np.nonzero(delHGLAe)[0]
-        md.solidearth.surfaceload.icethicknesschange[pos] = delHGLAe[pos] / 100
+        delHGLA = InterpFromMeshToMesh2d(index, longGLA, latGLA, delHGLA, longe, late)
+
+        # NOTE: For some reason, cannot apply pos to multiple arrays in a 
+        #       singlelike we might do in MATLAB. Instead, we iterate over 
+        #       elements of pos.
+        #
+        pos = np.nonzero(delHGIS)[0]
+        for p in pos:
+            md.masstransport.spcthickness[p] = md.masstransport.spcthickness[p] - delHGIS[p] / 100
+        pos = np.nonzero(delHGLA)[0]
+        for p in pos:
+            md.masstransport.spcthickness[p] = md.masstransport.spcthickness[p] - delHGLA[p] / 100
 
         # Adjust mask accordingly
-        pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0]
-        flags = np.zeros((md.mesh.numberofvertices, ))
-        flags[md.mesh.elements[pos, :] - 1] = 1
-        pos = np.nonzero(flags)[0]
+        pos = np.nonzero(md.masstransport.spcthickness)[0]
         md.mask.ice_levelset[pos] = -1
         md.mask.ocean_levelset[pos] = 1
 
-    md.solidearth.initialsealevel = np.zeros((md.mesh.numberofvertices, ))
-
-    md.dsl.global_average_thermostatic_sea_level_change = np.zeros((2, 1))
-    md.dsl.sea_surface_height_change_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
-    md.dsl.sea_water_pressure_change_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
-    #}}}
+    md.initialization.sealevel = np.zeros((md.mesh.numberofvertices, ))
+
+    md.dsl.global_average_thermosteric_sea_level = np.zeros((2, 1))
+    md.dsl.sea_surface_height_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
+    md.dsl.sea_water_pressure_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
+    #}}}
+
     # Geometry #{{{
     di = md.materials.rho_ice / md.materials.rho_water
     md.geometry.bed = -np.ones((md.mesh.numberofvertices, ))
+    md.geometry.base = md.geometry.bed
+    md.geometry.thickness = 1000 * np.ones((md.mesh.numberofvertices, ))
+    md.geometry.surface = md.geometry.bed + md.geometry.thickness
     #}}}
     # Materials #{{{
@@ -375,10 +385,13 @@
 sl.transfer('mask.ocean_levelset')
 sl.transfer('geometry.bed')
+sl.transfer('geometry.surface')
+sl.transfer('geometry.thickness')
+sl.transfer('geometry.base')
 sl.transfer('mesh.lat')
 sl.transfer('mesh.long')
-sl.transfer('solidearth.surfaceload.icethicknesschange') #
-sl.transfer('solidearth.initialsealevel')
-sl.transfer('dsl.sea_surface_height_change_above_geoid')
-sl.transfer('dsl.sea_water_pressure_change_at_sea_floor')
+sl.transfer('masstransport.spcthickness') #
+sl.transfer('initialization.sealevel')
+sl.transfer('dsl.sea_surface_height_above_geoid')
+sl.transfer('dsl.sea_water_pressure_at_sea_floor')
 
 # Radius
@@ -398,8 +411,8 @@
 
 # Solve Sea-level equation on Earth only #{{{
-md = sl.earth #we don't do computations on ice sheets or land
+md = sl.earth # we don't do computations on ice sheets or land
 
 #Materials
-md.materials=materials('hydro')
+md.materials = materials('hydro')
 
 # Elastic loading from love numbers
@@ -411,11 +424,32 @@
 
 # New stuff
-md.dsl.global_average_thermosteric_sea_level_change = np.array([[(1.1 + .38)], [0]]) # steric + water storage AR5
+md.dsl.global_average_thermosteric_sea_level = np.array([[(1.1 + .38)], [0]]) # steric + water storage AR5
 
 # Solutuion parameters
 md.solidearth.settings.reltol = np.nan
 md.solidearth.settings.abstol = 1e-3
-md.solidearth.settings.computesealevelchange = 1
+md.solidearth.settings.sealevelloading = 1
+md.solidearth.settings.isgrd = 1
+md.solidearth.settings.ocean_area_scaling = 1
+md.solidearth.settings.grdmodel = 1
 md.timestepping.time_step = 1
+
+# Physics
+md.transient.issmb = 0
+md.transient.isstressbalance = 0
+md.transient.isthermal = 0
+md.transient.ismasstransport = 1
+md.transient.isslc = 1
+
+# Initializations
+md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices,))
+md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices,))
+md.initialization.vx = np.zeros((md.mesh.numberofvertices,))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices,))
+md.initialization.sealevel = np.zeros((md.mesh.numberofvertices,))
+md.initialization.bottompressure = np.zeros((md.mesh.numberofvertices,))
+md.initialization.dsl = np.zeros((md.mesh.numberofvertices,))
+md.initialization.str = 0
+md.smb.mass_balance = np.zeros((md.mesh.numberofvertices,))
 
 # Max number of iterations reverted back to 10 (i.e. the original default value)
@@ -423,46 +457,45 @@
 
 # Eustatic run:
-md.solidearth.settings.rigid = 0
+md.solidearth.settings.selfattraction = 0
 md.solidearth.settings.elastic = 0
 md.solidearth.settings.rotation = 0
+md.solidearth.settings.viscous = 0
 md.solidearth.requested_outputs = [
     'default',
-    'SurfaceloadIceThicknessChange',
+    'DeltaIceThickness',
     'Sealevel',
-    'SealevelRSLRate',
-    'SealevelriseCumDeltathickness',
-    'SealevelNEsaRate',
-    'SealevelUEsaRate',
-    'NGiaRate',
-    'UGiaRate',
-    'SealevelEustaticMask',
-    'SealevelEustaticOceanMask'
+    'SealevelUGrd',
+    'SealevelchangeBarystaticMask',
+    'SealevelchangeBarystaticOceanMask',
 ]
-md = solve(md, 'Sealevelrise')
-Seustatic = md.results.SealevelriseSolution.Sealevel
-
-# Eustatic + rigid run
-md.solidearth.settings.rigid = 1
+md = solve(md, 'Transient')
+Seustatic = md.results.TransientSolution.Sealevel
+
+# Eustatic + selfattraction run
+md.solidearth.settings.selfattraction = 1
 md.solidearth.settings.elastic = 0
 md.solidearth.settings.rotation = 0
-md = solve(md, 'Sealevelrise')
-Srigid = md.results.SealevelriseSolution.Sealevel
-
-# Eustatic + rigid + elastic run
-md.solidearth.settings.rigid = 1
+md.solidearth.settings.viscous = 0
+md = solve(md, 'Transient')
+Sselfattraction = md.results.TransientSolution.Sealevel
+
+# Eustatic + selfattraction + elastic run
+md.solidearth.settings.selfattraction = 1
 md.solidearth.settings.elastic = 1
 md.solidearth.settings.rotation = 0
-md = solve(md, 'Sealevelrise')
-Selastic = md.results.SealevelriseSolution.Sealevel
-
-# Eustatic + rigid + elastic + rotation run
-md.solidearth.settings.rigid = 1
+md.solidearth.settings.viscous = 0
+md = solve(md, 'Transient')
+Selastic = md.results.TransientSolution.Sealevel
+
+# Eustatic + selfattraction + elastic + rotation run
+md.solidearth.settings.selfattraction = 1
 md.solidearth.settings.elastic = 1
 md.solidearth.settings.rotation = 1
-md = solve(md, 'Sealevelrise')
-Srotation = md.results.SealevelriseSolution.Sealevel
+md.solidearth.settings.viscous = 0
+md = solve(md, 'Transient')
+Srotation = md.results.TransientSolution.Sealevel
 
 #Fields and tolerances to track changes
 field_names = ['Eustatic', 'Rigid', 'Elastic', 'Rotation']
 field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
-field_values = [Seustatic, Srigid, Selastic, Srotation]
+field_values = [Seustatic, Sselfattraction, Selastic, Srotation]
Index: /issm/trunk/test/NightlyRun/test2005.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2005.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2005.m	(revision 26744)
@@ -1,51 +1,62 @@
-%Test Name: EarthSlr
+%Test Name: Earthslc_time
 
 %mesh earth:
 md=model;
-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
 
-%parameterize solidearth solution:
+%Geometry for the bed, arbitrary thickness of 100: 
+md.geometry.bed=zeros(md.mesh.numberofvertices,1);
+md.geometry.base=md.geometry.bed;
+md.geometry.thickness=100*ones(md.mesh.numberofvertices,1);
+md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+
 %solidearth loading:  {{{
-md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
-md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
-md.dsl.global_average_thermosteric_sea_level_change=[1;0];
-md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
-md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+md.masstransport.spcthickness=[md.geometry.thickness;0];
+md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
 %antarctica
-late=sum(md.mesh.lat(md.mesh.elements),2)/3;
-longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
+ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
+re=sqrt(xe.^2+ye.^2+ze.^2);
+
+late=asind(ze./re);
+longe=atan2d(ye,xe);
 pos=find(late < -80);
-md.solidearth.surfaceload.icethicknesschange(pos)=-100;
+md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+posant=pos;
 %greenland
-pos=find(late>70 & late<80 & longe>-60 & longe<-30);
-md.solidearth.surfaceload.icethicknesschange(pos)=-100;
+pos=find(late>60 & late<90 & longe>-75 & longe<-15);
+md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+posgre=pos;
 
 %elastic loading from love numbers:
-md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
+md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
 
 %}}}
 %mask:  {{{
 mask=gmtmask(md.mesh.lat,md.mesh.long);
+oceanmask=-ones(md.mesh.numberofvertices,1);
+pos=find(mask==0); oceanmask(pos)=1;
+
 icemask=ones(md.mesh.numberofvertices,1);
-pos=find(mask==0);
-icemask(pos)=-1;
-pos=find(sum(mask(md.mesh.elements),2)<3);
-icemask(md.mesh.elements(pos,:))=-1;
+icemask(md.mesh.elements(posant))=-1;
+icemask(md.mesh.elements(posgre))=-1;
+
 md.mask.ice_levelset=icemask;
-md.mask.ocean_levelset=-icemask;
-
-%make sure that the elements that have loads are fully grounded:
-pos=find(md.solidearth.surfaceload.icethicknesschange);
-md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
-
-%make sure wherever there is an ice load, that the mask is set to ice:
-%pos=find(md.solidearth.surfaceload.icethicknesschange); % TODO: Do we need to do this twice?
-md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
+md.mask.ocean_levelset=oceanmask;
 % }}}
 
-md.solidearth.settings.ocean_area_scaling=0;
+%time stepping: 
+md.timestepping.start_time=0;
+md.timestepping.time_step=1;
+md.timestepping.final_time=10;
 
-%Geometry for the bed, arbitrary: 
-md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+%masstransport:
+md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+md.initialization.str=0;
 
 %Materials: 
@@ -56,33 +67,32 @@
 
 %Solution parameters
+md.cluster.np=3;
 md.solidearth.settings.reltol=NaN;
 md.solidearth.settings.abstol=1e-3;
-md.solidearth.settings.computesealevelchange=1;
+md.solidearth.settings.sealevelloading=1;
+md.solidearth.settings.isgrd=1;
+md.solidearth.settings.ocean_area_scaling=0;
+md.solidearth.settings.grdmodel=1;
 
-% max number of iteration reverted back to 10 (i.e., the original default value)
-md.solidearth.settings.maxiter=10;
-
-%eustatic + rigid + elastic + rotation run:
-md.solidearth.settings.rigid=1;
+md.solidearth.settings.selfattraction=1;
 md.solidearth.settings.elastic=1;
 md.solidearth.settings.rotation=1;
+md.solidearth.settings.viscous=0;
 
-%transient settings: 
-md.timestepping.start_time=0;
-md.timestepping.final_time=10;
-md.timestepping.time_step=1;
-md.transient.isslr=1;
-md.transient.issmb=0;
-md.transient.isgia=1;
-md.transient.ismasstransport=0;
+%Physics: 
+md.transient.issmb=0; 
 md.transient.isstressbalance=0;
 md.transient.isthermal=0;
-dh=md.solidearth.surfaceload.icethicknesschange;
-deltathickness=zeros(md.mesh.numberofelements+1,10);
-for i=1:10,
-	deltathickness(1:end-1,i)=dh*i;
+md.transient.ismasstransport=1;
+md.transient.isslc=1;
+md.solidearth.requested_outputs={'Sealevel'};
+
+dh=md.masstransport.spcthickness;
+deltathickness=zeros(md.mesh.numberofvertices+1,10);
+for i=0:10,
+	deltathickness(1:end-1,i+1)=md.geometry.thickness+dh(1:end-1)*i;
 end
-deltathickness(end,:)=0:1:9;
-md.solidearth.surfaceload.icethicknesschange=deltathickness;
+deltathickness(end,:)=0:1:10;
+md.masstransport.spcthickness=deltathickness;
 %hack: 
 md.geometry.surface=zeros(md.mesh.numberofvertices,1);
@@ -90,4 +100,5 @@
 md.geometry.base=-ones(md.mesh.numberofvertices,1);
 md.geometry.bed=md.geometry.base;
+
 
 %run transient solution: 
@@ -97,5 +108,5 @@
 S5=md.results.TransientSolution(5).Sealevel;
 S10=md.results.TransientSolution(10).Sealevel;
-Seus10=md.results.TransientSolution(10).Bslr;
+Seus10=md.results.TransientSolution(10).Bslc;
 
 %Fields and tolerances to track changes
Index: /issm/trunk/test/NightlyRun/test2005.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2005.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2005.py	(revision 26744)
@@ -1,3 +1,3 @@
-#Test Name: EarthSlr
+#Test Name: EarthSlc
 import numpy as np
 
@@ -16,48 +16,61 @@
 md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) #700 km resolution mesh
 
-# Parameterize solidearth solution
+# Geometry for the bed, arbitrary thickness of 100
+md.geometry.bed = np.zeros((md.mesh.numberofvertices, ))
+md.geometry.base = md.geometry.bed
+md.geometry.thickness = 100 * np.ones((md.mesh.numberofvertices, ))
+md.geometry.surface = md.geometry.bed + md.geometry.thickness
+
 # Solidearth loading #{{{
-md.solidearth.surfaceload.icethicknesschange = np.zeros((md.mesh.numberofelements, 1))
-md.solidearth.initialsealevel = np.zeros((md.mesh.numberofvertices, 1))
-md.dsl.global_average_thermosteric_sea_level_change = np.zeros((2, 1))
-md.dsl.sea_surface_height_change_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
-md.dsl.sea_water_pressure_change_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
+md.masstransport.spcthickness = np.append(md.geometry.thickness, 0)
+md.smb.mass_balance = np.zeros((md.mesh.numberofvertices, ))
+# Antarctica
+xe = md.mesh.x[md.mesh.elements - 1].sum(axis=1) / 3
+ye = md.mesh.y[md.mesh.elements - 1].sum(axis=1) / 3
+ze = md.mesh.z[md.mesh.elements - 1].sum(axis=1) / 3
+re = pow((pow(xe, 2) + pow(ye, 2) + pow(ze, 2)), 0.5)
 
-# Antarctica
-late = md.mesh.lat[md.mesh.elements - 1].sum(axis=1) / 3
-longe = md.mesh.long[md.mesh.elements - 1].sum(axis=1) / 3
+late = asind(ze / re)
+longe = atan2d(ye, xe)
 pos = np.where(late < -80)[0]
-md.solidearth.surfaceload.icethicknesschange[pos] = -100
+md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
+posant = pos
 # Greenland
-pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > -60, longe < -30)))[0]
-md.solidearth.surfaceload.icethicknesschange[pos] = -100
+pos = np.where(np.logical_and.reduce((late > 60, late < 90, longe > -75, longe < -15)))[0]
+md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
+posgre = pos
 
 # Elastic loading from love numbers
-md.solidearth.lovenumbers = lovenumbers('maxdeg', 100)
+md.solidearth.lovenumbers = lovenumbers('maxdeg', 1000)
 #}}}
 
 # Mask #{{{
 mask = gmtmask(md.mesh.lat, md.mesh.long)
+oceanmask = -1 * np.ones((md.mesh.numberofvertices, 1))
+pos = np.where(mask == 0)[0]
+oceanmask[pos] = 1
+
 icemask = np.ones((md.mesh.numberofvertices, 1))
-pos = np.where(mask == 0)[0]
-icemask[pos] = -1
-pos = np.where(mask[md.mesh.elements - 1].sum(axis=1) < 3)[0]
-icemask[md.mesh.elements[pos, :] - 1] = -1
+# NOTE: Need to be careful here: when addressing with multidimensional array in 
+# MATLAB, only first column of values are used as indices
+#
+icemask[md.mesh.elements[posant][:,0] - 1] = -1
+icemask[md.mesh.elements[posgre][:,0] - 1] = -1
+
 md.mask.ice_levelset = icemask
-md.mask.ocean_levelset = -icemask
+md.mask.ocean_levelset = oceanmask
 
-# Make sure that the elements that have loads are fully grounded
-pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0]
-md.mask.ocean_levelset[md.mesh.elements[pos, :] - 1] = 1
+# Time stepping
+md.timestepping.start_time = 0
+md.timestepping.time_step = 1
+md.timestepping.final_time = 10
 
-# Make sure wherever there is an ice load, that the mask is set to ice:
-#pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0] # TODO: Do we need to do this twice?
-md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = -1
-# }}}
-
-md.solidearth.settings.ocean_area_scaling = 0
-
-# Geometry for the bed; arbitrary
-md.geometry.bed = -np.ones((md.mesh.numberofvertices, 1))
+# Masstransport
+md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
+md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.vx = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.sealevel = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.str = 0
 
 # Materials
@@ -68,33 +81,31 @@
 
 # Solution parameters
+md.cluster.np = 3
 md.solidearth.settings.reltol = np.nan
 md.solidearth.settings.abstol = 1e-3
-md.solidearth.settings.computesealevelchange = 1
+md.solidearth.settings.sealevelloading = 1
+md.solidearth.settings.isgrd = 1
+md.solidearth.settings.ocean_area_scaling = 0
+md.solidearth.settings.grdmodel = 1
 
-# Max number of iterations reverted back to 10 (i.e. the original default value)
-md.solidearth.settings.maxiter = 10
-
-# Eustatic + rigid + elastic + rotation run
-md.solidearth.settings.rigid = 1
+md.solidearth.settings.selfattraction = 1
 md.solidearth.settings.elastic = 1
 md.solidearth.settings.rotation = 1
+md.solidearth.settings.viscous = 0
 
-# Transient settings
-md.timestepping.start_time = 0
-md.timestepping.final_time = 10
-md.timestepping.time_step = 1
-md.transient.isslr = 1
+# Physics
 md.transient.issmb = 0
-md.transient.isgia = 1
-md.transient.ismasstransport = 0
 md.transient.isstressbalance = 0
 md.transient.isthermal = 0
-dh = np.asarray(md.solidearth.surfaceload.icethicknesschange).T
-deltathickness = np.zeros((md.mesh.numberofelements + 1, 10))
-for i in range(10):
-    deltathickness[0:-1, i] = dh * (i + 1)
-deltathickness[-1, :] = np.arange(0, 10, 1)
-md.solidearth.surfaceload.icethicknesschange = deltathickness
+md.transient.ismasstransport = 1
+md.transient.isslc = 1
+md.solidearth.requested_outputs = ['Sealevel']
 
+dh = md.masstransport.spcthickness
+deltathickness = np.zeros((md.mesh.numberofvertices + 1, 10 + 1)) # NOTE: Need to add another row as it is added in loop in MATLAB, which causes a RuntimeError in Python
+for i in range(10 + 1):
+    deltathickness[0:-1, i] = md.geometry.thickness + dh[0:-1] * i
+deltathickness[-1, :] = np.arange(0, 10 + 1, 1)
+md.masstransport.spcthickness = deltathickness
 # Hack
 md.geometry.surface = np.zeros((md.mesh.numberofvertices, 1))
@@ -109,7 +120,7 @@
 S5 = md.results.TransientSolution[5 - 1].Sealevel
 S10 = md.results.TransientSolution[10 - 1].Sealevel
-Seus10 = md.results.TransientSolution[10 - 1].Bslr
+Seus10 = md.results.TransientSolution[10 - 1].Bslc
 
-#Fields and tolerances to track changes
+# Fields and tolerances to track changes
 field_names = ['Sealevel1', 'Sealevel5', 'Sealevel10', 'Seustatic10']
 field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
Index: /issm/trunk/test/NightlyRun/test2006.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2006.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2006.m	(revision 26744)
@@ -1,24 +1,32 @@
-%Test Name: EarthSlr Dakota Sampling glaciers.
+%Test Name: EarthSlc Dakota Sampling glaciers.
 
 %mesh earth:
 md=model;
-md.cluster=generic('name',oshostname(),'np',5);
-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
-
-%parameterize solidearth solution:
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
+
+%Geometry for the bed, arbitrary thickness of 100: 
+md.geometry.bed=zeros(md.mesh.numberofvertices,1);
+md.geometry.base=md.geometry.bed;
+md.geometry.thickness=100*ones(md.mesh.numberofvertices,1);
+md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+
 %solidearth loading:  {{{
-md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
-md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
-md.dsl.global_average_thermosteric_sea_level_change=[1;0];
-md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
-md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+md.masstransport.spcthickness=[md.geometry.thickness;0];
+md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
 %antarctica
-late=sum(md.mesh.lat(md.mesh.elements),2)/3;
-longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
+ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
+re=sqrt(xe.^2+ye.^2+ze.^2);
+
+late=asind(ze./re);
+longe=atan2d(ye,xe);
 pos=find(late < -80);
-md.solidearth.surfaceload.icethicknesschange(pos)=-100;
+md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+posant=pos;
 %greenland
-pos=find(late>70 & late<80 & longe>-60 & longe<-30);
-md.solidearth.surfaceload.icethicknesschange(pos)=-100;
+pos=find(late>60 & late<90 & longe>-75 & longe<-15);
+md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+posgre=pos;
 
 %elastic loading from love numbers:
@@ -28,25 +36,27 @@
 %mask:  {{{
 mask=gmtmask(md.mesh.lat,md.mesh.long);
+oceanmask=-ones(md.mesh.numberofvertices,1);
+pos=find(mask==0); oceanmask(pos)=1;
+
 icemask=ones(md.mesh.numberofvertices,1);
-pos=find(mask==0);
-icemask(pos)=-1;
-pos=find(sum(mask(md.mesh.elements),2)<3);
-icemask(md.mesh.elements(pos,:))=-1;
+icemask(md.mesh.elements(posant))=-1;
+icemask(md.mesh.elements(posgre))=-1;
+
 md.mask.ice_levelset=icemask;
-md.mask.ocean_levelset=-icemask;
-
-%make sure that the elements that have loads are fully grounded:
-pos=find(md.solidearth.surfaceload.icethicknesschange);
-md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
-
-%make sure wherever there is an ice load, that the mask is set to ice:
-pos=find(md.solidearth.surfaceload.icethicknesschange);
-md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
+md.mask.ocean_levelset=oceanmask;
 % }}}
 
-md.solidearth.settings.ocean_area_scaling=0;
-
-%Geometry for the bed, arbitrary: 
-md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+%time stepping: 
+md.timestepping.start_time=0;
+md.timestepping.time_step=1;
+md.timestepping.final_time=10;
+
+%masstransport:
+md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+md.initialization.str=0;
 
 %Materials: 
@@ -57,33 +67,32 @@
 
 %Solution parameters
+md.cluster.np=3;
 md.solidearth.settings.reltol=NaN;
 md.solidearth.settings.abstol=1e-3;
-md.solidearth.settings.computesealevelchange=1;
-
-% max number of iteration reverted back to 10 (i.e., the original default value)
-md.solidearth.settings.maxiter=10;
-
-%eustatic + rigid + elastic + rotation run:
-md.solidearth.settings.rigid=1;
+md.solidearth.settings.sealevelloading=1;
+md.solidearth.settings.isgrd=1;
+md.solidearth.settings.ocean_area_scaling=0;
+md.solidearth.settings.grdmodel=1;
+
+md.solidearth.settings.selfattraction=1;
 md.solidearth.settings.elastic=1;
 md.solidearth.settings.rotation=1;
-
-%transient settings: 
-md.timestepping.start_time=0;
-md.timestepping.final_time=10;
-md.timestepping.time_step=1;
-md.transient.isslr=1;
-md.transient.issmb=0;
-md.transient.isgia=1;
-md.transient.ismasstransport=0;
+md.solidearth.settings.viscous=0;
+
+%Physics: 
+md.transient.issmb=0; 
 md.transient.isstressbalance=0;
 md.transient.isthermal=0;
-dh=md.solidearth.surfaceload.icethicknesschange;
-deltathickness=zeros(md.mesh.numberofelements+1,10);
-for i=1:10,
-	deltathickness(1:end-1,i)=dh*i;
+md.transient.ismasstransport=1;
+md.transient.isslc=1;
+md.solidearth.requested_outputs={'Sealevel'};
+
+dh=md.masstransport.spcthickness;
+deltathickness=zeros(md.mesh.numberofvertices+1,10);
+for i=0:10,
+	deltathickness(1:end-1,i+1)=md.geometry.thickness+dh(1:end-1)*i;
 end
-deltathickness(end,:)=0:1:9;
-md.solidearth.surfaceload.icethicknesschange=deltathickness;
+deltathickness(end,:)=0:1:10;
+md.masstransport.spcthickness=deltathickness;
 
 %hack: 
@@ -161,14 +170,14 @@
 
 md.qmu.statistics.method(1).name='Histogram';
-md.qmu.statistics.method(1).fields={'Sealevel','BslrIce'};
+md.qmu.statistics.method(1).fields={'Sealevel','BslcIce'};
 md.qmu.statistics.method(1).steps=[1:10];
 md.qmu.statistics.method(1).nbins=20;
 
 md.qmu.statistics.method(2).name='MeanVariance';
-md.qmu.statistics.method(2).fields={'Sealevel','BslrIce'};
+md.qmu.statistics.method(2).fields={'Sealevel','BslcIce'};
 md.qmu.statistics.method(2).steps=[1:10];
 
 md.qmu.statistics.method(3).name='SampleSeries';
-md.qmu.statistics.method(3).fields={'Sealevel','BslrIce'};
+md.qmu.statistics.method(3).fields={'Sealevel','BslcIce'};
 md.qmu.statistics.method(3).steps=[1:10];
 md.qmu.statistics.method(3).indices=locations;
Index: /issm/trunk/test/NightlyRun/test2006.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2006.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2006.py	(revision 26744)
@@ -1,5 +1,5 @@
-#Test Name: EarthSlr Dakota Sampling glaciers
+#Test Name: EarthSlc Dakota Sampling glaciers
 import numpy as np
-
+from socket import gethostname
 from dmeth_params_set import *
 from gmshplanet import *
@@ -7,4 +7,5 @@
 from lovenumbers import *
 from materials import *
+from MatlabFuncs import *
 from model import *
 from nodalvalue import *
@@ -16,23 +17,31 @@
 # Mesh earth
 md = model()
-md.cluster = generic('name', oshostname(), 'np', 5)
+md.cluster = generic('name', gethostname(), 'np', 5)
 md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) #700 km resolution mesh
 
-# Parameterize solidearth solution
+# Geometry for the bed, arbitrary thickness of 100
+md.geometry.bed = np.zeros((md.mesh.numberofvertices, ))
+md.geometry.base = md.geometry.bed
+md.geometry.thickness = 100 * np.ones((md.mesh.numberofvertices, ))
+md.geometry.surface = md.geometry.bed + md.geometry.thickness
+
 # Solidearth loading #{{{
-md.solidearth.surfaceload.icethicknesschange = np.zeros((md.mesh.numberofelements, 1))
-md.solidearth.initialsealevel = np.zeros((md.mesh.numberofvertices, 1))
-md.dsl.global_average_thermosteric_sea_level_change = np.zeros((2, 1))
-md.dsl.sea_surface_height_change_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
-md.dsl.sea_water_pressure_change_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
-
+md.masstransport.spcthickness = np.append(md.geometry.thickness, 0)
+md.smb.mass_balance = np.zeros((md.mesh.numberofvertices, ))
 # Antarctica
-late = md.mesh.lat[md.mesh.elements - 1].sum(axis=1) / 3
-longe = md.mesh.long[md.mesh.elements - 1].sum(axis=1) / 3
+xe = md.mesh.x[md.mesh.elements - 1].sum(axis=1) / 3
+ye = md.mesh.y[md.mesh.elements - 1].sum(axis=1) / 3
+ze = md.mesh.z[md.mesh.elements - 1].sum(axis=1) / 3
+re = pow((pow(xe, 2) + pow(ye, 2) + pow(ze, 2)), 0.5)
+
+late = asind(ze / re)
+longe = atan2d(ye, xe)
 pos = np.where(late < -80)[0]
-md.solidearth.surfaceload.icethicknesschange[pos] = -100
+md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
+posant = pos
 # Greenland
-pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > -60, longe < -30)))[0]
-md.solidearth.surfaceload.icethicknesschange[pos] = -100
+pos = np.where(np.logical_and.reduce((late > 60, late < 90, longe > -75, longe < -15)))[0]
+md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
+posgre = pos
 
 # Elastic loading from love numbers
@@ -42,25 +51,30 @@
 # Mask #{{{
 mask = gmtmask(md.mesh.lat, md.mesh.long)
+oceanmask = -1 * np.ones((md.mesh.numberofvertices, 1))
+pos = np.where(mask == 0)[0]
+oceanmask[pos] = 1
+
 icemask = np.ones((md.mesh.numberofvertices, 1))
-pos = np.where(mask == 0)[0]
-icemask[pos] = -1
-pos = np.where(mask[md.mesh.elements - 1].sum(axis=1) < 3)[0]
-icemask[md.mesh.elements[pos, :] - 1] = -1
+# NOTE: Need to be careful here: when addressing with multidimensional array in
+# MATLAB, only first column of values are used as indices
+#
+icemask[md.mesh.elements[posant][:,0] - 1] = -1
+icemask[md.mesh.elements[posgre][:,0] - 1] = -1
+
 md.mask.ice_levelset = icemask
-md.mask.ocean_levelset = -icemask
-
-# Make sure that the elements that have loads are fully grounded
-pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0]
-md.mask.ocean_levelset[md.mesh.elements[pos, :] - 1] = 1
-
-# Make sure wherever there is an ice load, that the mask is set to ice:
-#pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0] # TODO: Do we need to do this twice?
-md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = -1
-# }}}
-
-md.solidearth.settings.ocean_area_scaling = 0
-
-# Geometry for the bed; arbitrary
-md.geometry.bed = -np.ones((md.mesh.numberofvertices, 1))
+md.mask.ocean_levelset = oceanmask
+
+# Time stepping
+md.timestepping.start_time = 0
+md.timestepping.time_step = 1
+md.timestepping.final_time = 10
+
+# Masstransport
+md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
+md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.vx = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.sealevel = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.str = 0
 
 # Materials
@@ -71,32 +85,31 @@
 
 # Solution parameters
+md.cluster.np = 3
 md.solidearth.settings.reltol = np.nan
 md.solidearth.settings.abstol = 1e-3
-md.solidearth.settings.computesealevelchange = 1
-
-# Max number of iterations reverted back to 10 (i.e. the original default value)
-md.solidearth.settings.maxiter = 10
-
-# Eustatic + rigid + elastic + rotation run
-md.solidearth.settings.rigid = 1
+md.solidearth.settings.sealevelloading = 1
+md.solidearth.settings.isgrd = 1
+md.solidearth.settings.ocean_area_scaling = 0
+md.solidearth.settings.grdmodel = 1
+
+md.solidearth.settings.selfattraction = 1
 md.solidearth.settings.elastic = 1
 md.solidearth.settings.rotation = 1
-
-# Transient settings
-md.timestepping.start_time = 0
-md.timestepping.final_time = 10
-md.timestepping.time_step = 1
-md.transient.isslr = 1
+md.solidearth.settings.viscous = 0
+
+# Physics
 md.transient.issmb = 0
-md.transient.isgia = 1
-md.transient.ismasstransport = 0
 md.transient.isstressbalance = 0
 md.transient.isthermal = 0
-dh = np.asarray(md.solidearth.surfaceload.icethicknesschange).T
-deltathickness = np.zeros((md.mesh.numberofelements + 1, 10))
-for i in range(10):
-    deltathickness[0:-1, i] = dh * (i + 1)
-deltathickness[-1, :] = np.arange(0, 10, 1)
-md.solidearth.surfaceload.icethicknesschange = deltathickness
+md.transient.ismasstransport = 1
+md.transient.isslc = 1
+md.solidearth.requested_outputs = ['Sealevel']
+
+dh = md.masstransport.spcthickness
+deltathickness = np.zeros((md.mesh.numberofvertices + 1, 10 + 1)) # NOTE: Need to add another row as it is added in loop in MATLAB, which causes a RuntimeError in Python
+for i in range(10 + 1):
+    deltathickness[0:-1, i] = md.geometry.thickness + dh[0:-1] * i
+deltathickness[-1, :] = np.arange(0, 10 + 1, 1)
+md.masstransport.spcthickness = deltathickness
 
 # Hack
@@ -110,5 +123,5 @@
 npart = 1
 nt = 1
-partition = -np.ones((md.mesh.numberofelements, 1))
+partition = -1 * np.ones((md.mesh.numberofelements, 1))
 pos = np.where(late < -80)[0]
 partition[pos] = 0
@@ -195,5 +208,5 @@
 
 md.qmu.statistics.method[0]['name'] = 'Histogram'
-md.qmu.statistics.method[0]['fields'] = ['Sealevel', 'BslrIce']
+md.qmu.statistics.method[0]['fields'] = ['Sealevel', 'BslcIce']
 md.qmu.statistics.method[0]['steps'] = np.arange(1, 10 + 1).reshape(1, -1)
 md.qmu.statistics.method[0]['nbins'] = 20
@@ -201,10 +214,10 @@
 md.qmu.statistics.addmethod()
 md.qmu.statistics.method[1]['name'] = 'MeanVariance'
-md.qmu.statistics.method[1]['fields'] = ['Sealevel', 'BslrIce']
+md.qmu.statistics.method[1]['fields'] = ['Sealevel', 'BslcIce']
 md.qmu.statistics.method[1]['steps'] = np.arange(1, 10 + 1).reshape(1, -1)
 
 md.qmu.statistics.addmethod()
 md.qmu.statistics.method[2]['name'] = 'SampleSeries'
-md.qmu.statistics.method[2]['fields'] = ['Sealevel', 'BslrIce']
+md.qmu.statistics.method[2]['fields'] = ['Sealevel', 'BslcIce']
 md.qmu.statistics.method[2]['steps'] = np.arange(1, 10 + 1).reshape(1, -1)
 md.qmu.statistics.method[2]['indices'] = locations.reshape(1, -1)
Index: /issm/trunk/test/NightlyRun/test2007.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2007.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test2007.m	(revision 26744)
@@ -0,0 +1,72 @@
+%Test Name: External_OfflineSolidearthSolution
+
+%mesh earth:
+md=model;
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
+
+%Geometry for the bed, arbitrary
+md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+md.geometry.base=md.geometry.bed;
+md.geometry.thickness=zeros(md.mesh.numberofvertices,1);
+md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+
+%parameterize solidearth solution:
+late=md.mesh.lat;
+longe=md.mesh.long;
+time=0:0.5:5;
+md.solidearth.external=offlinesolidearthsolution;
+md.solidearth.external.displacementup=.5*sind(late).*cosd(late).*cosd(longe) .*time;
+md.solidearth.external.displacementup(end+1,:)=time;
+md.solidearth.external.geoid=-.1*sind(late).*cosd(late).*sind(longe) .*time;
+md.solidearth.external.geoid(end+1,:)=time;
+md.solidearth.external.displacementeast=late .*time;
+md.solidearth.external.displacementeast(end+1,:)=time;
+md.solidearth.external.displacementnorth=longe .*time;
+md.solidearth.external.displacementnorth(end+1,:)=time;
+md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+
+
+%mask:  {{{
+mask=gmtmask(md.mesh.lat,md.mesh.long);
+md.mask.ice_levelset=ones(md.mesh.numberofvertices,1);
+md.mask.ocean_levelset=ones(md.mesh.numberofvertices,1);
+% }}}
+
+%time stepping: 
+md.timestepping.start_time=time(1);
+md.timestepping.time_step=time(2)-time(1);
+md.timestepping.final_time=time(end);
+
+%Materials: 
+md.materials=materials('hydro');
+
+%Miscellaneous
+md.miscellaneous.name='test2007';
+
+%Solution parameters
+md.cluster.np=3;
+md.solidearth.settings.isgrd=0;
+md.solidearth.settings.horiz=1;
+
+%Physics: bary
+md.transient.issmb=0; 
+md.transient.isstressbalance=0;
+md.transient.isthermal=0;
+md.transient.ismasstransport=0;
+md.transient.isslc=1;
+md.solidearth.requested_outputs={'Sealevel', 'Bed', 'BedEast', 'BedNorth'};
+
+%eustatic run:
+md=solve(md,'Transient');
+
+for i=length(time)-1;
+Geoid=md.results.TransientSolution(i).Sealevel;
+BedUp=md.results.TransientSolution(i).Bed;
+BedEast=md.results.TransientSolution(i).BedEast;
+BedNorth=md.results.TransientSolution(i).BedNorth;
+end
+
+%Fields and tolerances to track changes
+field_names={'Geoid','BedUp','BedEast','BedNorth'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13};
+field_values={Geoid,BedUp,BedEast,BedNorth};
Index: /issm/trunk/test/NightlyRun/test2008.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2008.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test2008.m	(revision 26744)
@@ -0,0 +1,121 @@
+%Test Name: External_AdditionalSolidearthSolution
+
+%mesh earth:
+md=model;
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
+
+%Geometry for the bed, arbitrary thickness of 100: 
+md.geometry.bed=zeros(md.mesh.numberofvertices,1);
+md.geometry.base=md.geometry.bed;
+md.geometry.thickness=100*ones(md.mesh.numberofvertices,1);
+md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+
+%solidearth loading:  {{{
+md.masstransport.spcthickness=[md.geometry.thickness;0];
+md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+%antarctica
+xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
+ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
+re=sqrt(xe.^2+ye.^2+ze.^2);
+
+late=asind(ze./re);
+longe=atan2d(ye,xe);
+pos=find(late < -80);
+md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+posant=pos;
+%greenland
+pos=find(late>60 & late<90 & longe>-75 & longe<-15);
+md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+posgre=pos;
+
+%elastic loading from love numbers:
+md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
+
+%}}}
+%mask:  {{{
+mask=gmtmask(md.mesh.lat,md.mesh.long);
+oceanmask=-ones(md.mesh.numberofvertices,1);
+pos=find(mask==0); oceanmask(pos)=1;
+
+icemask=ones(md.mesh.numberofvertices,1);
+icemask(md.mesh.elements(posant))=-1;
+icemask(md.mesh.elements(posgre))=-1;
+
+md.mask.ice_levelset=icemask;
+md.mask.ocean_levelset=oceanmask;
+% }}}
+
+%time stepping: 
+md.timestepping.start_time=0;
+md.timestepping.time_step=1;
+md.timestepping.final_time=1;
+
+%masstransport:
+md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+md.initialization.str=0;
+
+%Materials: 
+md.materials=materials('hydro');
+
+%Miscellaneous
+md.miscellaneous.name='test2008';
+
+%Solution parameters
+md.cluster.np=3;
+md.solidearth.settings.reltol=NaN;
+md.solidearth.settings.abstol=1e-3;
+md.solidearth.settings.sealevelloading=1;
+md.solidearth.settings.isgrd=1;
+md.solidearth.settings.ocean_area_scaling=0;
+md.solidearth.settings.grdmodel=1;
+
+%Physics: 
+md.transient.issmb=0; 
+md.transient.isstressbalance=0;
+md.transient.isthermal=0;
+md.transient.ismasstransport=1;
+md.transient.isslc=1;
+md.solidearth.requested_outputs={'Sealevel','Bed'};
+
+% max number of iteration reverted back to 10 (i.e., the original default value)
+md.solidearth.settings.maxiter=10;
+
+%eustatic + selfattraction + elastic:
+md.solidearth.settings.selfattraction=1;
+md.solidearth.settings.elastic=1;
+md.solidearth.settings.rotation=0;
+md.solidearth.settings.viscous=0;
+md=solve(md,'tr');
+Sgrd=md.results.TransientSolution.Sealevel;
+Bgrd=md.results.TransientSolution.Bed;
+
+%parameterize additional solidearth solution:
+late=md.mesh.lat;
+longe=md.mesh.long;
+time=0:1;
+Y22=1.5*(1.+cosd(2.*late)).*cosd(2.*longe);
+md.solidearth.external=additionalsolidearthsolution;
+md.solidearth.external.displacementup=0.5*Y22 .*time;
+md.solidearth.external.displacementup(end+1,:)=time;
+md.solidearth.external.geoid=0.2*Y22 .*time;
+md.solidearth.external.geoid(end+1,:)=time;
+md.solidearth.external.displacementeast=late .*time;
+md.solidearth.external.displacementeast(end+1,:)=time;
+md.solidearth.external.displacementnorth=longe .*time;
+md.solidearth.external.displacementnorth(end+1,:)=time;
+md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+
+md=solve(md,'tr');
+Sadd=md.results.TransientSolution.Sealevel;
+Badd=md.results.TransientSolution.Bed;
+
+
+%Fields and tolerances to track changes
+field_names={'SealevelGrd','BedrockGrd', 'SealevelAdditional','BedrockAdditional'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13};
+field_values={Sgrd, Bgrd,Sadd,Badd};
Index: /issm/trunk/test/NightlyRun/test2010.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2010.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2010.m	(revision 26744)
@@ -3,25 +3,31 @@
 %mesh earth:
 md=model;
-rad_e = 6.371012*10^3; % mean radius of Earth, km
-md.mesh=gmshplanet('radius',rad_e,'resolution',1000.0);  % km resolution
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
 
-%parameterize slr solution:
-%slr loading:  {{{
-late=sum(md.mesh.lat(md.mesh.elements),2)/3;
-longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+%Geometry for the bed, arbitrary thickness of 100:
+md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+md.geometry.base=md.geometry.bed;
+md.geometry.thickness=100*ones(md.mesh.numberofvertices,1);
+md.geometry.surface=md.geometry.bed+md.geometry.thickness;
 
-md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
-pos=find(late <-75 & longe >0);
-md.solidearth.surfaceload.icethicknesschange(pos(6:7))=-1;
+%parameterize slc solution:
+%solidearth loading:  {{{
+md.masstransport.spcthickness=[md.geometry.thickness;0];
+md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
 
-md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
-md.dsl.global_average_thermosteric_sea_level_change=[0;0];
-md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
-md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
+ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
+re=sqrt(xe.^2+ye.^2+ze.^2);
 
-md.solidearth.settings.ocean_area_scaling = 1;
+late=asind(ze./re);
+longe=atan2d(ye,xe);
+%greenland
+pos=find(late>60 & late<90 & longe>-75 & longe<-15);
+md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+posice=pos;
 
 %elastic loading from love numbers:
-md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
+md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
 
 %}}}
@@ -29,68 +35,89 @@
 mask=gmtmask(md.mesh.lat,md.mesh.long);
 icemask=ones(md.mesh.numberofvertices,1);
-pos=find(mask==0);
-icemask(pos)=-1;
-pos=find(sum(mask(md.mesh.elements),2)<3);
-icemask(md.mesh.elements(pos,:))=-1;
+icemask(md.mesh.elements(posice,:))=-0.5;
+
+oceanmask=-ones(md.mesh.numberofvertices,1);
+pos=find(mask==0); oceanmask(pos)=1; icemask(~pos)=1;
+
 md.mask.ice_levelset=icemask;
-md.mask.ocean_levelset=-icemask;
+md.mask.ocean_levelset=oceanmask;
 
-%make sure that the elements that have loads are fully grounded:
-pos=find(md.solidearth.surfaceload.icethicknesschange);
-md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
+% use model representation of ocean area (not the true area)
+md.solidearth.settings.ocean_area_scaling = 0;
 
-%make sure wherever there is an ice load, that the mask is set to ice:
-md.mask.ice_levelset=ones(md.mesh.numberofvertices,1);
-pos=find(md.solidearth.surfaceload.icethicknesschange);
-md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
-% }}}
+%materials
+md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+md.initialization.str=0;
 
-%geometry {{{
-di=md.materials.rho_ice/md.materials.rho_water;
-md.geometry.thickness=ones(md.mesh.numberofvertices,1);
-md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1);
-md.geometry.base=md.geometry.surface-md.geometry.thickness;
-md.geometry.bed=md.geometry.base;
-% }}}
-%materials {{{
-md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
-md.materials.rheology_B=paterson(md.initialization.temperature);
-md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
-% }}}
-%Miscellaneous {{{
+md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+
+%Miscellaneous
 md.miscellaneous.name='test2010';
-% }}}
-%Solution parameters {{{
+
+%Solution parameters
 md.solidearth.settings.reltol=NaN;
 md.solidearth.settings.abstol=1e-3;
-md.solidearth.settings.computesealevelchange=1;
-% }}}
+md.solidearth.settings.sealevelloading=0;
+md.solidearth.settings.grdocean=1;
+md.solidearth.settings.isgrd=1;
+md.solidearth.settings.ocean_area_scaling=0;
+md.solidearth.settings.grdmodel=1;
+md.solidearth.settings.horiz=1;
+md.solidearth.requested_outputs={'Sealevel','SealevelBarystaticIceArea','SealevelBarystaticIceLoad','SealevelBarystaticIceMask','SealevelBarystaticIceLatbar','SealevelBarystaticIceLongbar'};
 
-%eustatic + rigid + elastic run:
-md.solidearth.settings.rigid=1;
+%Physics: 
+md.transient.issmb=0; 
+md.transient.isstressbalance=0;
+md.transient.isthermal=0;
+md.transient.ismasstransport=1;
+md.transient.isslc=1;
+
+md.timestepping.start_time=0;
+md.timestepping.time_step=1;
+md.timestepping.final_time=1;
+
+%eustatic + selfattraction + elastic + rotation run:
+md.solidearth.settings.selfattraction=1;
 md.solidearth.settings.elastic=1;
 md.solidearth.settings.rotation=1;
+md.solidearth.settings.viscous=0;
 md.cluster=generic('name',oshostname(),'np',3);
+%md.verbose=verbose('111111111');
+md=solve(md,'Transient');
 
+moi_p=md.solidearth.rotational.polarmoi;
+moi_e=md.solidearth.rotational.equatorialmoi;
+tide_love_k2=md.solidearth.lovenumbers.tk(3);
+load_love_k2=md.solidearth.lovenumbers.k(3);
+tide_love_k2secular=md.solidearth.lovenumbers.tk2secular;
 % uncomment following 2 lines for
-md=solve(md,'Sealevelrise');
-eus=md.results.SealevelriseSolution.Bslr;
-slr=md.results.SealevelriseSolution.Sealevel;
-moixz=md.results.SealevelriseSolution.SealevelInertiaTensorXZ;
-moiyz=md.results.SealevelriseSolution.SealevelInertiaTensorYZ;
-moizz=md.results.SealevelriseSolution.SealevelInertiaTensorZZ;
+eus=md.results.TransientSolution.Bslc;
+slc=md.results.TransientSolution.Sealevel;
+moixz=md.results.TransientSolution.SealevelInertiaTensorXZ / (1/(1-tide_love_k2/tide_love_k2secular) * (1+load_love_k2)/(moi_p-moi_e) );
+moiyz=md.results.TransientSolution.SealevelInertiaTensorYZ / (1/(1-tide_love_k2/tide_love_k2secular) * (1+load_love_k2)/(moi_p-moi_e) );
+moizz=md.results.TransientSolution.SealevelInertiaTensorZZ / ( -(1+load_love_k2)/moi_p);
+
+areaice=md.results.TransientSolution.SealevelBarystaticIceArea;
+loadice=md.results.TransientSolution.SealevelBarystaticIceLoad;
 
 % analytical moi => just checking FOR ICE only!!! {{{
-% ...have to mute ** slr induced MOI in Tria.cpp ** prior to the comparison
-%rad_e = rad_e*1e3; % now in meters
-%areas=GetAreasSphericalTria(md.mesh.elements,md.mesh.lat,md.mesh.long,rad_e);
-%lat=late*pi/180; lon=longe*pi/180;
-%moi_xz = sum(-md.materials.rho_freshwater.*md.solidearth.surfaceload.icethicknesschange.*areas.*rad_e^2.*sin(lat).*cos(lat).*cos(lon));
-%moi_yz = sum(-md.materials.rho_freshwater.*md.solidearth.surfaceload.icethicknesschange.*areas.*rad_e^2.*sin(lat).*cos(lat).*sin(lon));
+% ...have to mute ** slc induced MOI in Tria.cpp ** prior to the comparison
+rad_e = md.solidearth.planetradius;
+
+lat=md.results.TransientSolution.SealevelBarystaticIceLatbar*pi/180;
+lon=md.results.TransientSolution.SealevelBarystaticIceLongbar*pi/180;
+moi_xz = sum(-loadice.*areaice.*rad_e^2.*sin(lat).*cos(lat).*cos(lon));
+moi_yz = sum(-loadice.*areaice.*rad_e^2.*sin(lat).*cos(lat).*sin(lon));
+moi_zz = sum(-loadice.*areaice.*rad_e^2.*(1.0-sin(lat).^2));
+theoretical_value_check=[moixz/moi_xz moiyz/moi_yz moizz/moi_zz]
 % }}}
 
 %Fields and tolerances to track changes
-field_names     ={'eus','slr','moixz','moiyz','moizz'};
+field_names     ={'eus','slc','moixz','moiyz','moizz'};
 field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
-field_values={eus,slr,moixz,moiyz,moizz};
+field_values={eus,slc,moixz,moiyz,moizz};
 
Index: /issm/trunk/test/NightlyRun/test2010.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2010.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2010.py	(revision 26744)
@@ -1,7 +1,5 @@
 #Test Name: MomentOfIntertia
+import numpy as np
 from socket import gethostname
-
-import numpy as np
-
 from gmshplanet import *
 from gmtmask import *
@@ -12,28 +10,33 @@
 
 
-#mesh earth:
+# Mesh earth
 md = model()
-rad_e = 6.371012 * 1e3  # mean radius of Earth, km
-md.mesh = gmshplanet('radius', rad_e, 'resolution', 1000.0)  # km resolution
+md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) #700 km resolution mesh
 
-#parameterize solidearth solution:
-#solidearth loading:  {{{
-late = md.mesh.lat[md.mesh.elements - 1].sum(axis=1) / 3
-longe = md.mesh.long[md.mesh.elements - 1].sum(axis=1) / 3
+# Geometry for the bed, arbitrary thickness of 100
+md.geometry.bed = -1 * np.ones((md.mesh.numberofvertices, ))
+md.geometry.base = md.geometry.bed
+md.geometry.thickness = 100 * np.ones((md.mesh.numberofvertices, ))
+md.geometry.surface = md.geometry.bed + md.geometry.thickness
 
-md.solidearth.surfaceload.icethicknesschange = np.zeros((md.mesh.numberofelements, 1))
-pos = np.intersect1d(np.array(np.where(late < -75)), np.array(np.where(longe > 0)))
-#NOTE: Python does not include last element in array slices: (6:7) -> [5:7]
-md.solidearth.surfaceload.icethicknesschange[pos[5:7]] = -1
+# Parameterize SLC solution
+# Solidearth loading  {{{
+md.masstransport.spcthickness = np.append(md.geometry.thickness, 0)
+md.smb.mass_balance = np.zeros((md.mesh.numberofvertices, ))
 
-md.solidearth.initialsealevel = np.zeros(md.mesh.numberofvertices)
-md.dsl.global_average_thermosteric_sea_level_change = np.zeros((2, 1))
-md.dsl.sea_surface_height_change_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
-md.dsl.sea_water_pressure_change_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
+xe = md.mesh.x[md.mesh.elements - 1].sum(axis=1) / 3
+ye = md.mesh.y[md.mesh.elements - 1].sum(axis=1) / 3
+ze = md.mesh.z[md.mesh.elements - 1].sum(axis=1) / 3
+re = pow((pow(xe, 2) + pow(ye, 2) + pow(ze, 2)), 0.5)
 
-md.solidearth.settings.ocean_area_scaling = 1
+late = asind(ze / re)
+longe = atan2d(ye, xe)
+# Greenland
+pos = np.where(np.logical_and.reduce((late > 60, late < 90, longe > -75, longe < -15)))[0]
+md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
+posice = pos
 
-#elastic loading from love numbers:
-md.solidearth.lovenumbers = lovenumbers('maxdeg', 1000)
+# Elastic loading from love numbers
+md.solidearth.lovenumbers = lovenumbers('maxdeg', 100)
 
 #}}}
@@ -41,67 +44,98 @@
 mask = gmtmask(md.mesh.lat, md.mesh.long)
 icemask = np.ones((md.mesh.numberofvertices, 1))
+icemask[md.mesh.elements[posice, :] - 1] = -0.5
+
+oceanmask = -1 * np.ones((md.mesh.numberofvertices, 1))
 pos = np.where(mask == 0)[0]
-icemask[pos] = -1
-pos = np.where(mask[md.mesh.elements - 1].sum(axis=1) < 3)[0]
-icemask[md.mesh.elements[pos, :] - 1] = -1
+oceanmask[pos] = 1
+icemask[np.logical_not(pos).astype(int)] = 1
+
 md.mask.ice_levelset = icemask
-md.mask.ocean_levelset = -icemask
+md.mask.ocean_levelset = oceanmask
 
-#make sure that the elements that have loads are fully grounded
-pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0]
-md.mask.ocean_levelset[md.mesh.elements[pos, :] - 1] = 1
+# Use model representation of ocean area (not the true area)
+md.solidearth.settings.ocean_area_scaling = 0
 
-#make sure wherever there is an ice load, that the mask is set to ice:
-md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, 1))
-#pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0] # Do we need to do this twice?
-md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = -1
-# }}}
+# Materials
+md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, 1))
+md.initialization.sealevel = np.zeros((md.mesh.numberofvertices, 1))
+md.initialization.str = 0
 
-#geometry {{{
-di = md.materials.rho_ice / md.materials.rho_water
-md.geometry.thickness = np.ones((md.mesh.numberofvertices, 1))
-md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, 1))
-md.geometry.base = md.geometry.surface - md.geometry.thickness
-md.geometry.bed = md.geometry.base
-# }}}
-#materials {{{
-md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, 1))
-md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, 1))
-# }}}
-#Miscellaneous {{{
+md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
+md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.vx = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices, ))
+
+# Miscellaneous
 md.miscellaneous.name = 'test2010'
-# }}}
-#Solution parameters {{{
+
+# Solution parameters
 md.solidearth.settings.reltol = np.nan
 md.solidearth.settings.abstol = 1e-3
-md.solidearth.settings.computesealevelchange = 1
-# }}}
+md.solidearth.settings.sealevelloading = 0
+md.solidearth.settings.grdocean = 1
+md.solidearth.settings.isgrd = 1
+md.solidearth.settings.ocean_area_scaling = 0
+md.solidearth.settings.grdmodel = 1
+md.solidearth.settings.horiz = 1
+md.solidearth.requested_outputs = [
+    'Sealevel',
+    'SealevelBarystaticIceArea',
+    'SealevelBarystaticIceLoad',
+    'SealevelBarystaticIceMask',
+    'SealevelBarystaticIceLatbar',
+    'SealevelBarystaticIceLongbar'
+]
 
-#eustatic + rigid + elastic run:
-md.solidearth.settings.rigid = 1
+# Physics
+md.transient.issmb = 0
+md.transient.isstressbalance = 0
+md.transient.isthermal = 0
+md.transient.ismasstransport = 1
+md.transient.isslc = 1
+
+md.timestepping.start_time = 0
+md.timestepping.time_step = 1
+md.timestepping.final_time = 1
+
+# Eustatic + selfattraction + elastic + rotation run
+md.solidearth.settings.selfattraction = 1
 md.solidearth.settings.elastic = 1
 md.solidearth.settings.rotation = 1
+md.solidearth.settings.viscous = 0
 md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
+moi_p = md.solidearth.rotational.polarmoi
+moi_e = md.solidearth.rotational.equatorialmoi
+tide_love_k2 = md.solidearth.lovenumbers.tk[2]
+load_love_k2 = md.solidearth.lovenumbers.k[2]
+tide_love_k2secular = md.solidearth.lovenumbers.tk2secular
 # uncomment following 2 lines for
-md = solve(md, 'Sealevelrise')
-eus = md.results.SealevelriseSolution.Bslr
-slr = md.results.SealevelriseSolution.Sealevel
-moixz = md.results.SealevelriseSolution.SealevelInertiaTensorXZ
-moiyz = md.results.SealevelriseSolution.SealevelInertiaTensorYZ
-moizz = md.results.SealevelriseSolution.SealevelInertiaTensorZZ
+eus = md.results.TransientSolution.Bslc
+slc = md.results.TransientSolution.Sealevel
+moixz = md.results.TransientSolution.SealevelInertiaTensorXZ / (1 / (1 - tide_love_k2 / tide_love_k2secular) * (1 + load_love_k2) / (moi_p - moi_e))
+moiyz = md.results.TransientSolution.SealevelInertiaTensorYZ / (1 / (1 - tide_love_k2 / tide_love_k2secular) * (1 + load_love_k2) / (moi_p - moi_e))
+moizz = md.results.TransientSolution.SealevelInertiaTensorZZ / ( -(1 + load_love_k2) / moi_p)
+
+areaice = md.results.TransientSolution.SealevelBarystaticIceArea
+loadice = md.results.TransientSolution.SealevelBarystaticIceLoad
 
 # analytical moi = > just checking FOR ICE only!!! {{{
-# ...have to mute**solidearth induced MOI in Tria.cpp**prior to the comparison
-#rad_e = rad_e * 1e3  # now in meters
-#areas = GetAreasSphericalTria(md.mesh.elements, md.mesh.lat, md.mesh.long, rad_e)
-#lat = late * pi / 180 lon = longe * pi / 180
-#moi_xz = sum(-md.materials.rho_freshwater. * md.solidearth.deltathickness. * areas. * rad_e^2. * sin(lat). * cos(lat). * cos(lon))
-#moi_yz = sum(-md.materials.rho_freshwater. * md.solidearth.deltathickness. * areas. * rad_e^2. * sin(lat). * cos(lat). * sin(lon))
+# ...have to mute ** slc induced MOI in Tria.cpp**prior to the comparison
+rad_e = md.solidearth.planetradius
+
+lat = md.results.TransientSolution.SealevelBarystaticIceLatbar * np.pi / 180
+lon = md.results.TransientSolution.SealevelBarystaticIceLongbar * np.pi / 180
+moi_xz = sum(-loadice * areaice * pow(rad_e, 2) * np.sin(lat) * np.cos(lat) * np.cos(lon))
+moi_yz = sum(-loadice * areaice * pow(rad_e, 2) * np.sin(lat) * np.cos(lat) * np.sin(lon))
+moi_zz = sum(-loadice * areaice * pow(rad_e, 2) * (1 - np.sin(lat) ** 2))
+theoretical_value_check = [moixz / moi_xz, moiyz / moi_yz, moizz / moi_zz]
+print('\ntheoretical_value_check =\n')
+print('\t{}\n'.format(theoretical_value_check))
 # }}}
 
 #Fields and tolerances to track changes
-field_names = ['eus', 'slr', 'moixz', 'moiyz', 'moizz']
+field_names = ['eus', 'slc', 'moixz', 'moiyz', 'moizz']
 field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
-field_values = [eus, slr, moixz, moiyz, moizz]
+field_values = [eus, slc, moixz, moiyz, moizz]
Index: /issm/trunk/test/NightlyRun/test2011.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2011.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test2011.m	(revision 26744)
@@ -0,0 +1,116 @@
+%Test Name: SlcBarystatic
+
+%mesh earth:
+md=model;
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
+
+%Geometry for the bed, arbitrary thickness of 1000: 
+md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+md.geometry.base=md.geometry.bed;
+md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
+md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+
+
+%parameterize solidearth solution:
+%solidearth loading:  {{{
+md.masstransport.spcthickness=[md.geometry.thickness;0];
+md.dsl.global_average_thermosteric_sea_level=[0;0];
+md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+%antarctica
+xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
+ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
+re=sqrt(xe.^2+ye.^2+ze.^2);
+
+late=asind(ze./re);
+longe=atan2d(ye,xe);
+pos=find(late < -80);
+md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+posant=pos;
+%greenland
+pos=find(late>60 & late<90 & longe>-75 & longe<-15);
+md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+posgre=pos;
+
+%elastic loading from love numbers:
+md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
+
+%}}}
+%mask:  {{{
+mask=gmtmask(md.mesh.lat,md.mesh.long);
+oceanmask=-ones(md.mesh.numberofvertices,1);
+pos=find(mask==0); oceanmask(pos)=1;
+
+icemask=ones(md.mesh.numberofvertices,1);
+icemask(md.mesh.elements(posant))=-1;
+icemask(md.mesh.elements(posgre))=-1;
+
+md.mask.ice_levelset=icemask;
+md.mask.ocean_levelset=oceanmask;
+% }}}
+
+%time stepping: 
+md.timestepping.start_time=0;
+md.timestepping.time_step=1;
+md.timestepping.final_time=1;
+
+md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+md.initialization.bottompressure=zeros(md.mesh.numberofvertices,1);
+md.initialization.dsl=zeros(md.mesh.numberofvertices,1);
+md.initialization.str=0;
+
+%Materials: 
+md.materials=materials('hydro');
+
+%Miscellaneous
+md.miscellaneous.name='test2011';
+
+%Solution parameters
+md.cluster.np=3;
+md.solidearth.settings.reltol=NaN;
+md.solidearth.settings.abstol=1e-3;
+md.solidearth.settings.sealevelloading=1;
+md.solidearth.settings.isgrd=1;
+md.solidearth.settings.ocean_area_scaling=0;
+md.solidearth.settings.grdmodel=1;
+
+%Physics: 
+md.transient.issmb=0; 
+md.transient.isstressbalance=0;
+md.transient.isthermal=0;
+md.transient.ismasstransport=1;
+md.transient.isslc=1;
+md.solidearth.requested_outputs={'Sealevel','DeltaIceThickness','SealevelBarystaticIceMask','SealevelBarystaticHydroMask','SealevelBarystaticBpMask','Bed','SealevelBarystaticIceWeights','SealevelBarystaticOceanWeights','SealevelBarystaticIceArea','SealevelBarystaticOceanArea','SealevelBarystaticOceanMask','SealevelGRD','SealevelBarystaticOceanLongbar'};
+md.settings.results_on_nodes={'SealevelBarystaticIceWeights','SealevelBarystaticOceanWeights'};
+
+% max number of iteration reverted back to 10 (i.e., the original default value)
+md.solidearth.settings.maxiter=10;
+
+%eustatic + rigid + elastic + rotation run:
+md.solidearth.settings.selfattraction=1;
+md.solidearth.settings.elastic=1;
+md.solidearth.settings.rotation=0;
+md.solidearth.settings.viscous=0;
+md=solve(md,'tr');
+
+%recover barystatic: 
+bslc=md.results.TransientSolution(1).BslcIce; 
+
+%alternative way of computing barystatic: 
+area=md.results.TransientSolution(1).SealevelBarystaticIceArea;
+weights=md.results.TransientSolution(1).SealevelBarystaticIceWeights; 
+dH=md.results.TransientSolution(1).DeltaIceThickness(md.mesh.elements); 
+dHavg=sum(dH.*weights,2);
+oceanarea=sum(md.results.TransientSolution(1).SealevelBarystaticOceanArea);
+bslc2=-sum(dHavg.*area)*md.materials.rho_ice/md.materials.rho_water/oceanarea;
+
+%Fields and tolerances to track changes
+field_names={'BarystaticIce','BarystaticIce2','BarystaticIceDiff'};
+field_tolerances={1e-13,1e-13,1e-13};
+field_values={bslc,bslc2,bslc2-bslc};
Index: /issm/trunk/test/NightlyRun/test2020.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2020.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2020.m	(revision 26744)
@@ -1,3 +1,3 @@
-%Test Name: SHslr 
+%Test Name: SHslc 
 % spherical-harmonic (SH) approach for solving the sea-level equation. 
 % reference: Adhikari et al., 2019, ESSD, https://doi.org/10.5194/essd-11-629-2019 
Index: /issm/trunk/test/NightlyRun/test2021.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2021.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2021.m	(revision 26744)
@@ -1,15 +1,15 @@
-%Test Name: SESAWslr 
-% SESAW method of solving GRD slr 
-% reference: Adhikari et al., 2016, GMD, https://doi.org/10.5194/gmd-9-1087-2016 
+%Test Name: SESAWslc
+% SESAW method of solving GRD slc
+% reference: Adhikari et al., 2016, GMD, https://doi.org/10.5194/gmd-9-1087-2016
 
 md=model;
-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',500); %500 km resolution mesh
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
 
-% read in love numbers. 
+% read in love numbers.
 love_numbers = lovenumbers('maxdeg',10000);
 
-% compute Green's functions 
-disp(['Computing Greens functions...']); 
-[Grigid,Gelastic,Uelastic]=greensfunctions(md.mesh.elements,md.mesh.lat,md.mesh.long,love_numbers); 
+% compute Green's functions
+disp(['Computing Greens functions...']);
+[Grigid,Gelastic,Uelastic]=greensfunctions(md.mesh.elements,md.mesh.lat,md.mesh.long,love_numbers);
 greens.Grigid = Grigid;
 greens.Gelast = Gelastic;
@@ -17,71 +17,71 @@
 clearvars Grigid Gelastic Uelastic
 
-% compute lat,long at elemental centroids. 
-[late,longe] = latelonge(md.mesh.elements,md.mesh.lat,md.mesh.long); 
+% compute lat,long at elemental centroids.
+[late,longe] = latelonge(md.mesh.elements,md.mesh.lat,md.mesh.long);
 
-% load GRACE data. Same as used in test2020.  
-load('../Data/GRACE_JPL_April2002_WEH.mat'); 
+% load GRACE data. Same as used in test2020.
+load('../Data/GRACE_JPL_April2002_WEH.mat');
 lat = repmat(lat',720,1);
 lon = repmat(lon,1,360);
-F = scatteredInterpolant(lat(:),lon(:),weh(:)); 
+F = scatteredInterpolant(lat(:),lon(:),weh(:));
 
-% map GRACE data onto elemental centorids. 
+% map GRACE data onto elemental centorids.
 loads_element = F(late,longe);
 loads_element(isnan(loads_element))=0;
 
-% ocean mask mapped onto the elemental centroids. 
-ocean_element = gmtmask(late,longe); 
+% ocean mask mapped onto the elemental centroids.
+ocean_element = gmtmask(late,longe);
 
 % Area of individual elements
-area_element=GetAreasSphericalTria(md.mesh.elements,md.mesh.lat,md.mesh.long,md.solidearth.planetradius); 
+area_element=GetAreasSphericalTria(md.mesh.elements,md.mesh.lat,md.mesh.long,md.solidearth.planetradius);
 
-% Parameters input for SESAWslr solver. 
-para.ocean_element = ocean_element; 
-para.loads_element = loads_element; 
-para.area_element = area_element; 
-para.earth_density = md.materials.earth_density; 
+% Parameters input for SESAWslc solver.
+para.ocean_element = ocean_element;
+para.loads_element = loads_element;
+para.area_element = area_element;
+para.earth_density = md.materials.earth_density;
 para.ocean_density = md.materials.rho_water;
-para.loads_density = md.materials.rho_freshwater; % if land loads are ice, use ice density. 
+para.loads_density = md.materials.rho_freshwater; % if land loads are ice, use ice density.
 
-para.rel_tol = 1e-5; 
+para.rel_tol = 1e-5;
 
-% solid earth rheology. 
-para.solidearth = 'rigid'; % 'rigid' or 'elastic'; 
+% solid earth rheology.
+para.solidearth = 'rigid'; % 'rigid' or 'elastic';
 
-% rotational feedbacks. 
-para.rotational.flag = 0; % Rotational flag on (1) or off (0) 
-para.rotational.earth_radius = md.solidearth.planetradius; 
-para.rotational.load_love_k2 = love_numbers.k(3); 
-para.rotational.tide_love_k2 = love_numbers.tk(3); 
-para.rotational.tide_love_h2 = love_numbers.th(3);  
-para.rotational.tide_love_k2secular = love_numbers.tk2secular;  
-para.rotational.moi_p = md.solidearth.rotational.polarmoi; 
-para.rotational.moi_e = md.solidearth.rotational.equatorialmoi; 
+% rotational feedbacks.
+para.rotational.flag = 0; % Rotational flag on (1) or off (0)
+para.rotational.earth_radius = md.solidearth.planetradius;
+para.rotational.load_love_k2 = love_numbers.k(3);
+para.rotational.tide_love_k2 = love_numbers.tk(3);
+para.rotational.tide_love_h2 = love_numbers.th(3);
+para.rotational.tide_love_k2secular = love_numbers.tk2secular;
+para.rotational.moi_p = md.solidearth.rotational.polarmoi;
+para.rotational.moi_e = md.solidearth.rotational.equatorialmoi;
 para.rotational.omega = md.solidearth.rotational.angularvelocity;
 
-% solve: Rigid without rotational feedbacks. 
-disp(['Solving sesaw-slr for Rigid Earth WITHOUT rotational feedback...']); 
-[eus_rigid,rsl_rigid] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para); 
+% solve: Rigid without rotational feedbacks.
+disp(['Solving sesaw-slc for Rigid Earth WITHOUT rotational feedback...']);
+[eus_rigid,rsl_rigid] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para);
 
-% solve: Rigid with rotational feedbacks. 
-para.rotational.flag = 1; 
-disp(['Solving sesaw-slr for Rigid Earth WITH rotational feedback...']); 
-[eus_rigid_rot,rsl_rigid_rot] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para); 
+% solve: Rigid with rotational feedbacks.
+para.rotational.flag = 1;
+disp(['Solving sesaw-slc for Rigid Earth WITH rotational feedback...']);
+[eus_rigid_rot,rsl_rigid_rot] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para);
 
-% solve: Elastic with rotational feedbacks. 
-para.solidearth = 'elastic'; 
-disp(['Solving sesaw-slr for Elastic Earth WITH rotational feedback...']); 
-[eus_elast_rot,rsl_elast_rot] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para); 
+% solve: Elastic with rotational feedbacks.
+para.solidearth = 'elastic';
+disp(['Solving sesaw-slc for Elastic Earth WITH rotational feedback...']);
+[eus_elast_rot,rsl_elast_rot] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para);
 
-% solve: Elastic with rotational feedbacks. 
-para.rotational.flag = 0; 
-disp(['Solving sesaw-slr for Elastic Earth WITHOUT rotational feedback...']); 
-[eus_elast,rsl_elast] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para); 
+% solve: Elastic with rotational feedbacks.
+para.rotational.flag = 0;
+disp(['Solving sesaw-slc for Elastic Earth WITHOUT rotational feedback...']);
+[eus_elast,rsl_elast] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para);
 
 %Fields and tolerances to track changes
 field_names={'eus_rigid','eus_rigid_rot','eus_elast','eus_elast_rot',...
-	          'rsl_rigid','rsl_rigid_rot','rsl_elast','rsl_elast_rot'};
+             'rsl_rigid','rsl_rigid_rot','rsl_elast','rsl_elast_rot'};
 field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
 field_values={eus_rigid,eus_rigid_rot,eus_elast,eus_elast_rot,...
-	          rsl_rigid,rsl_rigid_rot,rsl_elast,rsl_elast_rot};
+             rsl_rigid,rsl_rigid_rot,rsl_elast,rsl_elast_rot};
 
Index: /issm/trunk/test/NightlyRun/test2084.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2084.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2084.m	(revision 26744)
@@ -9,5 +9,5 @@
 md.cluster=generic('name',oshostname(),'np',1);
 
-% set validation=1 for comparing against the Spada benchark.   
+% set validation=1 for comparing against the Spada benchark.
 validation=0; 
 
@@ -24,17 +24,43 @@
 md.materials.lame_mu=  [1e-5         0   2.2834e+00   1.0549e+00   7.0363e-01   5.0605e-01]'*1e11;
 md.materials.viscosity=[0            0   2.0000e+00   1.0000e+00   1.0000e+00   1.0000e+25]'*1e21;
-md.materials.lame_lambda=md.materials.lame_mu*0+5e14;
+md.materials.lame_lambda=md.materials.lame_mu*0+5e17;
 md.materials.issolid=[1 0 1 1 1 1]';
-md.materials.isburgers=zeros(md.materials.numlayers,1);
+md.materials.rheologymodel=zeros(md.materials.numlayers,1);
+md.materials.burgers_mu=md.materials.lame_mu/3;
+md.materials.burgers_viscosity=md.materials.viscosity/10;
+md.materials.ebm_alpha= ones(md.materials.numlayers,1)*.9;
+md.materials.ebm_delta= ones(md.materials.numlayers,1)*0.2;
+md.materials.ebm_taul= ones(md.materials.numlayers,1)*54*60; %54min
+md.materials.ebm_tauh= ones(md.materials.numlayers,1)*18.6*cst/1e3; %18.6yr
+%setlitho2prem(md.materials)
 
 md.love.allow_layer_deletion=1;
 md.love.frequencies=([0]*2*pi)'/cst;
 md.love.nfreq=length(md.love.frequencies);
+md.love.sh_nmin=1;
 md.love.sh_nmax=256;
-
-md.materials.burgers_mu=md.materials.lame_mu;
-md.materials.burgers_viscosity=md.materials.viscosity;
-
-md=solve(md,'lv');
+md.love.underflow_tol=1e-20;
+md.love.Gravitational_Constant=6.6732e-11;
+md.love.integration_steps_per_layer=200;
+
+md.love.istemporal=1;
+md.love.n_temporal_iterations=8;
+%md.love.time=(logspace(-4,5, 2))'*cst;
+md.love.time=(logspace(-1,2, 50))'*cst;
+md.love.love_kernels=1;
+if md.love.istemporal
+	md.love=md.love.build_frequencies_from_time;
+end
+
+md=solve(md,'lv');
+
+ht2=md.results.LoveSolution.LoveHr;
+lt2=md.results.LoveSolution.LoveLr;
+kt2=md.results.LoveSolution.LoveKr;
+t=md.love.time/cst*1e3;
+
+%hs=reshape(md.results.LoveSolution.LoveHi(:,:), [ md.love.sh_nmax+1, 2*md.love.n_temporal_iterations, length(t)]);
+%hs=permute(hs,[3 2 1]);
+%[ht,h,hsig,hconv]=postwidder_love(md,md.love.n_temporal_iterations,t,hs,1e-5);
 
 %Fields and tolerances to track changes
@@ -169,5 +195,5 @@
 %md.materials.burgers_mu=md.materials.lame_mu;
 %md.materials.burgers_viscosity=md.materials.viscosity;
-%md.materials.isburgers=md.materials.issolid*0;
+%md.materials.rheologymodel=md.materials.issolid*0;
 %md.love.forcing_type=11;
 %md.materials.numlayers=length(md.materials.viscosity);
@@ -198,5 +224,5 @@
 md.materials.burgers_mu=md.materials.lame_mu;
 md.materials.burgers_viscosity=md.materials.viscosity;
-md.materials.isburgers=md.materials.issolid*0;
+md.materials.rheologymodel=md.materials.issolid*0;
 md.love.forcing_type=11;
 md.love.sh_nmin=1;
Index: /issm/trunk/test/NightlyRun/test2084.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2084.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2084.py	(revision 26744)
@@ -1,19 +1,22 @@
 #Test Name: GiaCaron
-#Forward Love number solution for a viscoelastic earth,
-#model M3 - L70 - V01 from Spada, G., Barletta, V. R., Klemann, V., Riva, R. E. M.,
-#Martinec, Z., Gasperini, P., Lund, B., Wolf, D., Vermeersen, L. L. A.
-#and King, M. A. (2011), A benchmark study for glacial isostatic
-#adjustment codes. Geophysical Journal International,
-#185: 106 - 132. doi:10.1111 / j.1365 - 246X.2011.04952.x
-
-from model import *
-from socket import gethostname
-from solve import *
-from numpy import *
+# Forward Love number solution for a viscoelastic earth, model M3-L70-V01 from
+# Spada, G., Barletta, V. R., Klemann, V., Riva, R. E. M., Martinec, Z.,
+# Gasperini, P., Lund, B., Wolf, D., Vermeersen, L. L. A. and King, M. A.
+# (2011), A benchmark study for glacial isostatic adjustment codes. Geophysical
+# Journal International, 185: 106--132. doi:10.1111/j.1365-246X.2011.04952.x
+
+import numpy as np
+
 from generic import generic
 from materials import *
+from socket import gethostname
+from model import *
+from solve import *
 
 md = model()
 md.cluster = generic('name', gethostname(), 'np', 1)
+
+# Set validation=1 for comparing against the Spada benchark
+validation = 0
 
 md.materials = materials('litho')
@@ -33,27 +36,59 @@
 md.materials.viscosity = np.array([0, 0, 2.0000e+00, 1.0000e+00, 1.0000e+00,
                                    1.0000e+25]).reshape(-1, 1) * 1e21
-md.materials.lame_lambda = np.array(md.materials.lame_mu) * 0 + 5e14
+md.materials.lame_lambda = np.array(md.materials.lame_mu) * 0 + 5e17
 md.materials.issolid = np.array([1, 0, 1, 1, 1, 1]).reshape(-1, 1)
-md.materials.isburgers = np.zeros((md.materials.numlayers, 1))
+md.materials.rheologymodel = np.zeros((md.materials.numlayers, 1))
+md.materials.burgers_mu = md.materials.lame_mu / 3
+md.materials.burgers_viscosity = md.materials.viscosity / 10
+md.materials.ebm_alpha = np.ones((md.materials.numlayers, 1)) * 0.9
+md.materials.ebm_delta = np.ones((md.materials.numlayers, 1)) * 0.2
+md.materials.ebm_taul = np.ones((md.materials.numlayers, 1)) * 54 * 60 # 54 min
+md.materials.ebm_tauh = np.ones((md.materials.numlayers, 1)) * 18.6 * cst / 1e3 # 18.6 yr
+#setlitho2prem(md.materials)
 
 md.love.allow_layer_deletion = 1
-md.love.frequencies = (np.array([0]) * 2 * pi).reshape(-1, 1) / cst
-md.love.nfreq = len(md.love.frequencies)
+md.love.frequencies = (np.array([0]) * 2 * np.pi).reshape(-1, 1) / cst
+md.love.nfreq = len(md.love.frequencies)
+md.love.sh_nmin = 1
 md.love.sh_nmax = 256
-
-md.materials.burgers_mu = md.materials.lame_mu
-md.materials.burgers_viscosity = md.materials.viscosity
-
-md = solve(md, 'lv')
+md.love.underflow_tol = 1e-20
+md.love.Gravitational_Constant = 6.6732e-11
+md.love.integration_steps_per_layer = 200
+
+md.love.istemporal = 1
+md.love.n_temporal_iterations = 8
+#md.love.time = np.logspace(-4, 5, 2).reshape(-1, 1) * cst
+md.love.time = np.logspace(-1, 2, 50).reshape(-1, 1) * cst
+md.love.love_kernels = 1
+if md.love.istemporal:
+    md.love = md.love.build_frequencies_from_time
+
+md = solve(md, 'lv')
+
+ht2 = md.results.LoveSolution.LoveHr
+lt2 = md.results.LoveSolution.LoveLr
+kt2 = md.results.LoveSolution.LoveKr
+t = md.love.time / cst * 1e3
 
 #Fields and tolerances to track changes
 #loading love numbers
 field_names = ['LoveH_loading_elastic', 'LoveK_loading_elastic', 'LoveL_loading_elastic']
-field_tolerances = [4.3e-9, 4.3e-9, 4.3e-9]
-field_values = [np.array(md.results.LoveSolution.LoveHr)[:, 0],
-                np.array(md.results.LoveSolution.LoveKr)[:, 0],
-                np.array(md.results.LoveSolution.LoveLr)[:, 0]]
-
-md.love.frequencies = (np.array([1e-3, 1e-2, 1e-1, 1, -1e-3, -1e-2, -1e-1, -1]) * 2 * pi).reshape(-1, 1) / cst
+field_tolerances = [2.0e-8, 2.0e-8, 2.0e-8]
+field_values = [
+    np.array(md.results.LoveSolution.LoveHr)[:, 0],
+    np.array(md.results.LoveSolution.LoveKr)[:, 0],
+    np.array(md.results.LoveSolution.LoveLr)[:, 0]
+]
+
+# Validate elastic loading solutions against the Spada benchmark {{{
+
+# TODO:
+# - Implement read from file and comparison
+# - Implement plot
+#
+
+#}}}
+
+md.love.frequencies = (np.array([1e-3, 1e-2, 1e-1, 1, -1e-3, -1e-2, -1e-1, -1]) * 2 * np.np.pi).reshape(-1, 1) / cst
 md.love.nfreq = len(md.love.frequencies)
 md.love.sh_nmax = 256
@@ -64,35 +99,46 @@
 
 #Fields and tolerances to track changes
-#loading love numbers
 field_names += ['LoveH_loading_realpart', 'LoveK_loading_realpart', 'LoveL_loading_realpart', 'LoveH_loading_imagpart', 'LoveK_loading_imagpart', 'LoveL_loading_imagpart']
 field_tolerances += [5e-7, 5e-7, 5e-7, 5e-7, 5e-7, 5e-7]
-field_values += [np.array(md.results.LoveSolution.LoveHr),
-                 np.array(md.results.LoveSolution.LoveKr),
-                 np.array(md.results.LoveSolution.LoveLr),
-                 np.array(md.results.LoveSolution.LoveHi),
-                 np.array(md.results.LoveSolution.LoveKi),
-                 np.array(md.results.LoveSolution.LoveLi)]
+field_values += [
+    np.array(md.results.LoveSolution.LoveHr),
+    np.array(md.results.LoveSolution.LoveKr),
+    np.array(md.results.LoveSolution.LoveLr),
+    np.array(md.results.LoveSolution.LoveHi),
+    np.array(md.results.LoveSolution.LoveKi),
+    np.array(md.results.LoveSolution.LoveLi)
+]
 
 md.love.forcing_type = 9
 md.love.sh_nmin = 2
-md.love.frequencies = ((np.array([0, 1e-3, 1e-2, 1e-1, 1, -1e-3, -1e-2, -1e-1, -1]) * 2 * pi).reshape(-1, 1) / cst)
-md.love.nfreq = len(md.love.frequencies)
-
-md = solve(md, 'lv')
+md.love.frequencies = ((np.array([0, 1e-3, 1e-2, 1e-1, 1, -1e-3, -1e-2, -1e-1, -1]) * 2 * np.pi).reshape(-1, 1) / cst)
+md.love.nfreq = len(md.love.frequencies)
+md = solve(md, 'lv')
+
+# Validate elastic tidal solutions against the Spada benchmark #{{{
+
+# TODO:
+# - Implement read from file and comparison
+# - Implement plot
+#
+
+#}}}
 
 #tidal love numbers, check
 field_names += ['LoveH_tidal_elastic', 'LoveK_tidal_elastic', 'LoveL_tidal_elastic', 'LoveH_tidal_realpart', 'LoveK_tidal_realpart', 'LoveL_tidal_realpart', 'LoveH_tidal_imagpart', 'LoveK_tidal_imagpart', 'LoveL_tidal_imagpart']
 field_tolerances += [8e-6, 8e-6, 8e-6, 8e-6, 8e-6, 8e-6, 8e-6, 8e-6, 8e-6]
-field_values += [np.array(md.results.LoveSolution.LoveHr)[:, 0],
-                 np.array(md.results.LoveSolution.LoveKr)[:, 0],
-                 np.array(md.results.LoveSolution.LoveLr)[:, 0],
-                 np.array(md.results.LoveSolution.LoveHr)[:, 1:],
-                 np.array(md.results.LoveSolution.LoveKr)[:, 1:],
-                 np.array(md.results.LoveSolution.LoveLr)[:, 1:],
-                 np.array(md.results.LoveSolution.LoveHi)[:, 1:],
-                 np.array(md.results.LoveSolution.LoveKi)[:, 1:],
-                 np.array(md.results.LoveSolution.LoveLi)[:, 1:]]
-
-#Many layers PREM - based model
+field_values += [
+    np.array(md.results.LoveSolution.LoveHr)[:, 0],
+    np.array(md.results.LoveSolution.LoveKr)[:, 0],
+    np.array(md.results.LoveSolution.LoveLr)[:, 0],
+    np.array(md.results.LoveSolution.LoveHr)[:, 1:],
+    np.array(md.results.LoveSolution.LoveKr)[:, 1:],
+    np.array(md.results.LoveSolution.LoveLr)[:, 1:],
+    np.array(md.results.LoveSolution.LoveHi)[:, 1:],
+    np.array(md.results.LoveSolution.LoveKi)[:, 1:],
+    np.array(md.results.LoveSolution.LoveLi)[:, 1:]
+]
+
+# Many layers PREM-based model
 #data = load('../Data/PREM_500layers')
 #md.love.sh_nmin = 1
@@ -115,5 +161,5 @@
 #md.materials.burgers_mu = md.materials.lame_mu
 #md.materials.burgers_viscosity = md.materials.viscosity
-#md.materials.isburgers = md.materials.issolid * 0
+#md.materials.rheologymodel = md.materials.issolid * 0
 #md.love.forcing_type = 11
 #md.materials.numlayers = len(md.materials.viscosity)
@@ -133,6 +179,6 @@
 #       (md.results.LoveSolution.LoveLi[:][1:]),
 #       ]
-#Model VSS96 from Vermeersen, L.L.A., Sabadini, R. & Spada, G., 1996a. Analytical visco - elastic relaxation models, Geophys. Res. Lett., 23, 697 - 700.
-
+
+# Model VSS96 from Vermeersen, L.L.A., Sabadini, R. & Spada, G., 1996a. Analytical visco-elastic relaxation models, Geophys. Res. Lett., 23, 697-700.
 md.materials.radius = np.array([10, 1222.5, 3480., 3600., 3630.5, 3700., 3900., 4000.,
                                 4200., 4300., 4500., 4600., 4800., 4900., 5100., 5200.,
@@ -168,24 +214,33 @@
 md.materials.burgers_mu = md.materials.lame_mu
 md.materials.burgers_viscosity = md.materials.viscosity
-md.materials.isburgers = md.materials.issolid * 0
+md.materials.rheologymodel = md.materials.issolid * 0
 md.love.forcing_type = 11
 md.love.sh_nmin = 1
 md.love.sh_nmax = 100
-
-md = solve(md, 'lv')
-
-md.love.frequencies = (np.array([0, 1e-3, 1e-2, 1, -1e-3, -1e-2,
-                                 -1]) * 2 * pi).reshape(-1, 1) / cst
-md.love.nfreq = len(md.love.frequencies)
-
-field_names += ['LoveH_loadingVSS96_elastic', 'LoveK_loadingVSS96_elastic', 'LoveL_loadingVSS96_elastic', 'LoveH_loadingVSS96_realpart', 'LoveK_loadingVSS96_realpart', 'LoveL_loadingVSS96_realpart', 'LoveH_loadingVSS96_imagpart', 'LoveK_loadingVSS96_imagpart', 'LoveL_loadingVSS96_imagpart']
+md = solve(md, 'lv')
+md.love.frequencies = (np.array([0, 1e-3, 1e-2, 1, -1e-3, -1e-2, -1]) * 2 * np.pi).reshape(-1, 1) / cst
+md.love.nfreq = len(md.love.frequencies)
+
+field_names += [
+    'LoveH_loadingVSS96_elastic',
+    'LoveK_loadingVSS96_elastic',
+    'LoveL_loadingVSS96_elastic',
+    'LoveH_loadingVSS96_realpart',
+    'LoveK_loadingVSS96_realpart',
+    'LoveL_loadingVSS96_realpart',
+    'LoveH_loadingVSS96_imagpart',
+    'LoveK_loadingVSS96_imagpart',
+    'LoveL_loadingVSS96_imagpart'
+]
 field_tolerances += [2e-6, 2e-6, 2e-6, 2e-6, 2e-6, 2e-6, 2e-6, 2e-6, 2e-6]
-field_values += [np.array(md.results.LoveSolution.LoveHr)[:, 0],
-                 np.array(md.results.LoveSolution.LoveKr)[:, 0],
-                 np.array(md.results.LoveSolution.LoveLr)[:, 0],
-                 np.array(md.results.LoveSolution.LoveHr)[:, 1:],
-                 np.array(md.results.LoveSolution.LoveKr)[:, 1:],
-                 np.array(md.results.LoveSolution.LoveLr)[:, 1:],
-                 np.array(md.results.LoveSolution.LoveHi)[:, 1:],
-                 np.array(md.results.LoveSolution.LoveKi)[:, 1:],
-                 np.array(md.results.LoveSolution.LoveLi)[:, 1:]]
+field_values += [
+    np.array(md.results.LoveSolution.LoveHr)[:, 0],
+    np.array(md.results.LoveSolution.LoveKr)[:, 0],
+    np.array(md.results.LoveSolution.LoveLr)[:, 0],
+    np.array(md.results.LoveSolution.LoveHr)[:, 1:],
+    np.array(md.results.LoveSolution.LoveKr)[:, 1:],
+    np.array(md.results.LoveSolution.LoveLr)[:, 1:],
+    np.array(md.results.LoveSolution.LoveHi)[:, 1:],
+    np.array(md.results.LoveSolution.LoveKi)[:, 1:],
+    np.array(md.results.LoveSolution.LoveLi)[:, 1:]
+]
Index: /issm/trunk/test/NightlyRun/test2090.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2090.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test2090.m	(revision 26744)
@@ -0,0 +1,135 @@
+%Test Name: ViscoElasticEarthSlc
+
+%mesh earth:
+md=model;
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
+
+%Geometry for the bed, arbitrary thickness of 1000: 
+md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+md.geometry.base=md.geometry.bed;
+md.geometry.thickness=100*ones(md.mesh.numberofvertices,1);
+md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+
+
+%parameterize solidearth solution:
+%solidearth loading:  {{{
+md.masstransport.spcthickness=[md.geometry.thickness;0];
+
+md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+%antarctica
+xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
+ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
+re=sqrt(xe.^2+ye.^2+ze.^2);
+
+late=asind(ze./re);
+longe=atan2d(ye,xe);
+pos=find(late < -80);
+%pos=10;
+md.masstransport.spcthickness(md.mesh.elements(pos,:))=md.masstransport.spcthickness(md.mesh.elements(pos,:)) -100;
+posant=pos;
+%greenland
+pos=find(late>60 & late<90 & longe>-75 & longe<-15);
+md.masstransport.spcthickness(md.mesh.elements(pos,:))=md.masstransport.spcthickness(md.mesh.elements(pos,:)) -100;
+posgre=pos;
+
+%visco-elastic loading from love numbers that we load ourselves. We 
+%still use the lovenumbers constructor to initialize the fields: 
+load ../Data/lnb_temporal.mat
+md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
+md.solidearth.lovenumbers.timefreq=[0];
+
+md.solidearth.lovenumbers.h=[h1'];
+md.solidearth.lovenumbers.k=[k1'];
+md.solidearth.lovenumbers.l=[l1'];
+%md.solidearth.lovenumbers.h=repmat(md.solidearth.lovenumbers.h,1,100);
+%md.solidearth.lovenumbers.k=repmat(md.solidearth.lovenumbers.k,1,100);
+%md.solidearth.lovenumbers.l=repmat(md.solidearth.lovenumbers.l,1,100);
+md.solidearth.lovenumbers.th=repmat(md.solidearth.lovenumbers.th,1,101);
+md.solidearth.lovenumbers.tk=repmat(md.solidearth.lovenumbers.tk,1,101);
+md.solidearth.lovenumbers.tl=repmat(md.solidearth.lovenumbers.tl,1,101);
+md.solidearth.lovenumbers.timefreq=time;
+
+%}}}
+%mask:  {{{
+mask=gmtmask(md.mesh.lat,md.mesh.long);
+oceanmask=-ones(md.mesh.numberofvertices,1);
+pos=find(mask==0); oceanmask(pos)=1;
+
+icemask=ones(md.mesh.numberofvertices,1);
+icemask(md.mesh.elements(posant))=-1;
+icemask(md.mesh.elements(posgre))=-1;
+%oceanmask(md.mesh.elements(posant))=1;
+
+md.mask.ice_levelset=icemask;
+md.mask.ocean_levelset=oceanmask;
+% }}}
+
+%time stepping: 
+md.timestepping.start_time=0;
+md.timestepping.time_step=100;
+md.timestepping.final_time=1000;
+
+time1=md.timestepping.start_time:md.timestepping.time_step:md.timestepping.final_time;
+md.masstransport.spcthickness=repmat(md.masstransport.spcthickness, [1 length(time1)]);
+md.masstransport.spcthickness(1:end-1,3:end)=0;
+md.masstransport.spcthickness(end,:)=time1;
+
+md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+md.initialization.bottompressure=zeros(md.mesh.numberofvertices,1);
+md.initialization.dsl=zeros(md.mesh.numberofvertices,1);
+md.initialization.str=0;
+
+%Materials: 
+md.materials=materials('hydro');
+
+%Miscellaneous
+md.miscellaneous.name='test2090';
+
+%Solution parameters
+md.cluster.np=3;
+md.solidearth.settings.reltol=NaN;
+md.solidearth.settings.abstol=1e-3;
+md.solidearth.settings.sealevelloading=1;
+md.solidearth.settings.isgrd=1;
+md.solidearth.settings.ocean_area_scaling=0;
+md.solidearth.settings.grdmodel=1;
+md.solidearth.settings.timeacc=md.timestepping.time_step;
+md.solidearth.settings.degacc=.1;
+
+%Physics:
+md.transient.issmb=0; 
+md.transient.isstressbalance=0;
+md.transient.isthermal=0;
+md.transient.ismasstransport=1;
+md.transient.isslc=1;
+md.solidearth.requested_outputs={'Sealevel','Bed'};
+
+% max number of iteration reverted back to 10 (i.e., the original default value)
+md.solidearth.settings.maxiter=10;
+
+%eustatic + selfattraction + elastic + rotation run:
+md.solidearth.settings.selfattraction=1;
+md.solidearth.settings.elastic=1;
+md.solidearth.settings.viscous=1;
+md.solidearth.settings.rotation=0;
+md=solve(md,'tr');
+
+
+clear S B
+for i=1:length(time1)-1
+S(:,i)=md.results.TransientSolution(i).Sealevel;
+B(:,i)=md.results.TransientSolution(i).Bed;
+end
+
+hold on
+plot(md.timestepping.start_time:md.timestepping.time_step:(md.timestepping.final_time-md.timestepping.time_step), [B(916,:)]);
+
+%Fields and tolerances to track changes
+field_names={'Sealevel','Bed'};
+field_tolerances={1e-13,1e-13};
+field_values={S,B};
Index: /issm/trunk/test/NightlyRun/test2101.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2101.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2101.m	(revision 26744)
@@ -4,5 +4,5 @@
 %mesh earth: 
 md=model; 
-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',1000);
+md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700);
 
 % define load 
Index: /issm/trunk/test/NightlyRun/test2101.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2101.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test2101.py	(revision 26744)
@@ -15,5 +15,5 @@
 #mesh earth:
 md = model()
-md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 1000)
+md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700)
 
 #define load
Index: /issm/trunk/test/NightlyRun/test240.m
===================================================================
--- /issm/trunk/test/NightlyRun/test240.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test240.m	(revision 26744)
@@ -39,5 +39,5 @@
 md.settings.output_frequency=1;
 md.timestepping.final_time=2;
-md.timestepping.interp_forcings=0;
+md.timestepping.interp_forcing=0;
 
 md=setflowequation(md,'SSA','all');
Index: /issm/trunk/test/NightlyRun/test240.py
===================================================================
--- /issm/trunk/test/NightlyRun/test240.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test240.py	(revision 26744)
@@ -45,5 +45,5 @@
 md.settings.output_frequency = 1
 md.timestepping.final_time = 2
-md.timestepping.interp_forcings = 0
+md.timestepping.interp_forcing = 0
 
 md = setflowequation(md, 'SSA', 'all')
Index: /issm/trunk/test/NightlyRun/test241.m
===================================================================
--- /issm/trunk/test/NightlyRun/test241.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test241.m	(revision 26744)
@@ -9,5 +9,5 @@
 md.settings.output_frequency=1;
 md.timestepping.final_time=4.;
-md.timestepping.interp_forcings=0;
+md.timestepping.interp_forcing=0;
 
 %Set up transient
Index: /issm/trunk/test/NightlyRun/test241.py
===================================================================
--- /issm/trunk/test/NightlyRun/test241.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test241.py	(revision 26744)
@@ -19,5 +19,5 @@
 md.settings.output_frequency = 1
 md.timestepping.final_time = 4.
-md.timestepping.interp_forcings = False
+md.timestepping.interp_forcing = False
 
 #Set up transient
Index: /issm/trunk/test/NightlyRun/test242.m
===================================================================
--- /issm/trunk/test/NightlyRun/test242.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test242.m	(revision 26744)
@@ -10,5 +10,5 @@
 md.settings.output_frequency=1;
 md.timestepping.final_time=4;
-md.timestepping.interp_forcings=0;
+md.timestepping.interp_forcing=0;
 
 %Set up transient
Index: /issm/trunk/test/NightlyRun/test242.py
===================================================================
--- /issm/trunk/test/NightlyRun/test242.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test242.py	(revision 26744)
@@ -20,5 +20,5 @@
 md.settings.output_frequency = 1
 md.timestepping.final_time = 4.
-md.timestepping.interp_forcings = False
+md.timestepping.interp_forcing = False
 
 #Set up transient
Index: /issm/trunk/test/NightlyRun/test243.m
===================================================================
--- /issm/trunk/test/NightlyRun/test243.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test243.m	(revision 26744)
@@ -30,6 +30,8 @@
 md.smb.requested_outputs={'SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbEC',...
 	'SmbA','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF',...
-	'SmbMeanULW','SmbNetLW','SmbNetSW','SmbAccumulatedMassBalance','SmbAccumulatedRunoff',...
-	'SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation'};
+	'SmbMeanULW','SmbNetLW','SmbNetSW','SmbWAdd','SmbRunoff','SmbRefreeze','SmbMelt',...
+	'SmbEC','SmbPrecipitation','SmbRain','SmbAccumulatedMassBalance','SmbAccumulatedRunoff',...
+	'SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation','SmbAccumulatedRain',...
+	'SmbAccumulatedPrecipitation','SmbAccumulatedRefreeze'};
 
 %only run smb core: 
@@ -42,5 +44,5 @@
 md.timestepping.final_time=1966;
 md.timestepping.time_step=1/365.0;
-md.timestepping.interp_forcings=0;
+md.timestepping.interp_forcing=0;
 
 %Run transient
@@ -53,6 +55,6 @@
 
 %Fields and tolerances to track changes
-field_names      ={'Layers','SmbDz','SmbT' ,'SmbD' ,'SmbRe','SmbGdn','SmbGsp','SmbA' ,'SmbEC','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF','SmbMeanULW','SmbNetLW','SmbNetSW','SmbAccumulatedMassBalance','SmbAccumulatedRunoff','SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation'};
-field_tolerances ={1e-12,2e-12,1e-12,1e-11,1e-11,2e-11,1e-11,1e-12,1e-11,1e-12,1e-12,1e-12,1e-11,2e-11,2e-11,1e-11,9e-10,2e-11,1e-11,9e-10,2e-11,1e-11,1e-11,1e-11,1e-11,1e-11,};
+field_names      ={'Layers','SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbA' ,'SmbEC','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF','SmbMeanULW','SmbNetLW','SmbNetSW','SmbAccumulatedMassBalance','SmbAccumulatedRunoff','SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation','SmbAccumulatedRain','SmbAccumulatedRefreeze','SmbRunoff','SmbMelt','SmbEC','SmbPrecipitation','SmbRain','SmbRefreeze','SmbWAdd'};
+field_tolerances ={1e-12,2e-12,1e-12,2e-11,1e-11,2e-11,1e-11,1e-12,1e-11,1e-12,1e-12,1e-12,1e-11,2e-11,2e-11,1e-11,9e-10,2e-11,1e-11,9e-10,2e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11};
 
 field_values={...
@@ -79,4 +81,13 @@
 	(md.results.TransientSolution(end).SmbAccumulatedMelt(1)),...
 	(md.results.TransientSolution(end).SmbAccumulatedEC(1)),...
-	(md.results.TransientSolution(end).SmbAccumulatedPrecipitation(1))
+	(md.results.TransientSolution(end).SmbAccumulatedPrecipitation(1)),...
+	(md.results.TransientSolution(end).SmbAccumulatedRain(1)),...
+	(md.results.TransientSolution(end).SmbAccumulatedRefreeze(1)),...
+	(md.results.TransientSolution(200).SmbRunoff(1)),...
+	(md.results.TransientSolution(200).SmbMelt(1)),...
+	(md.results.TransientSolution(200).SmbEC(1)),...
+	(md.results.TransientSolution(200).SmbPrecipitation(1)),...
+	(md.results.TransientSolution(200).SmbRain(1)),...
+	(md.results.TransientSolution(200).SmbRefreeze(1)),...
+	(md.results.TransientSolution(200).SmbWAdd(1))...
 };
Index: /issm/trunk/test/NightlyRun/test243.py
===================================================================
--- /issm/trunk/test/NightlyRun/test243.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test243.py	(revision 26744)
@@ -45,8 +45,10 @@
 #smb settings
 md.smb.requested_outputs = [
-    'SmbDz', 'SmbT', 'SmbD', 'SmbRe', 'SmbGdn', 'SmbGsp', 'SmbEC',
-    'SmbA', 'SmbMassBalance', 'SmbMAdd', 'SmbDzAdd', 'SmbFAC', 'SmbMeanSHF', 'SmbMeanLHF',
-    'SmbMeanULW', 'SmbNetLW', 'SmbNetSW','SmbAccumulatedMassBalance','SmbAccumulatedRunoff',
-    'SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation'
+        'SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbEC',
+        'SmbA','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF',
+        'SmbMeanULW','SmbNetLW','SmbNetSW','SmbWAdd','SmbRunoff','SmbRefreeze','SmbMelt',
+        'SmbEC','SmbPrecipitation','SmbRain','SmbAccumulatedMassBalance','SmbAccumulatedRunoff',
+        'SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation','SmbAccumulatedRain',
+        'SmbAccumulatedPrecipitation','SmbAccumulatedRefreeze'
     ]
 
@@ -60,5 +62,5 @@
 md.timestepping.final_time = 1966.
 md.timestepping.time_step = 1.0 / 365
-md.timestepping.interp_forcings = 0.
+md.timestepping.interp_forcing = 0.
 
 #Run transient
@@ -70,6 +72,8 @@
 
 #Fields and tolerances to track changes
-field_names = ['Layers', 'SmbDz', 'SmbT', 'SmbD', 'SmbRe', 'SmbGdn', 'SmbGsp', 'SmbA', 'SmbEC', 'SmbMassBalance', 'SmbMAdd', 'SmbDzAdd', 'SmbFAC', 'SmbMeanSHF', 'SmbMeanLHF', 'SmbMeanULW', 'SmbNetLW', 'SmbNetSW', 'SmbAccumulatedMassBalance','SmbAccumulatedRunoff','SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation']
-field_tolerances = [1e-12, 2e-12, 1e-12, 1e-11, 1e-11, 2e-11, 1e-11, 1e-12, 1e-11, 1e-12, 1e-12, 1e-12, 1e-11, 2e-11, 2e-11, 1e-11, 9e-10, 2e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11]
+field_names = ['Layers','SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbA' ,'SmbEC','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF','SmbMeanULW','SmbNetLW','SmbNetSW','SmbAccumulatedMassBalance','SmbAccumulatedRunoff','SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation','SmbAccumulatedRain','SmbAccumulatedRefreeze','SmbRunoff','SmbMelt','SmbEC','SmbPrecipitation','SmbRain','SmbRefreeze','SmbWAdd']
+field_tolerances = [1e-12, 2e-12, 1e-12, 2e-11, 1e-11, 2e-11, 1e-11, 1e-12, 1e-11, 1e-12, 1e-12, 1e-12, 1e-11, 2e-11, 2e-11, 1e-11, 9e-10, 2e-11, 1e-11, 9e-10, 2e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11]
+
+
 # Shape is different in python solution (fixed using reshape) which can cause test failure
 field_values = [
@@ -96,4 +100,13 @@
     md.results.TransientSolution[-1].SmbAccumulatedMelt[0],
     md.results.TransientSolution[-1].SmbAccumulatedEC[0],
-    md.results.TransientSolution[-1].SmbAccumulatedPrecipitation[0]
+    md.results.TransientSolution[-1].SmbAccumulatedPrecipitation[0],
+    md.results.TransientSolution[-1].SmbAccumulatedRain[0],
+    md.results.TransientSolution[-1].SmbAccumulatedRefreeze[0],
+    md.results.TransientSolution[199].SmbRunoff[0],
+    md.results.TransientSolution[199].SmbMelt[0],
+    md.results.TransientSolution[199].SmbEC[0],
+    md.results.TransientSolution[199].SmbPrecipitation[0],
+    md.results.TransientSolution[199].SmbRain[0],
+    md.results.TransientSolution[199].SmbRefreeze[0],
+    md.results.TransientSolution[199].SmbWAdd[0]
     ]
Index: /issm/trunk/test/NightlyRun/test244.m
===================================================================
--- /issm/trunk/test/NightlyRun/test244.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test244.m	(revision 26744)
@@ -40,5 +40,5 @@
 md.timestepping.final_time=1965.75;
 md.timestepping.time_step=1/365.0;
-md.timestepping.interp_forcings=0;
+md.timestepping.interp_forcing=0;
 
 %dakota version
Index: /issm/trunk/test/NightlyRun/test244.py
===================================================================
--- /issm/trunk/test/NightlyRun/test244.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test244.py	(revision 26744)
@@ -60,5 +60,5 @@
 md.timestepping.final_time = 1965.75
 md.timestepping.time_step = 1. / 365.0
-md.timestepping.interp_forcings = 0.
+md.timestepping.interp_forcing = 0.
 
 #dakota version
Index: /issm/trunk/test/NightlyRun/test247.m
===================================================================
--- /issm/trunk/test/NightlyRun/test247.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test247.m	(revision 26744)
@@ -1,4 +1,4 @@
 %Test Name: SquareShelfTranIspddIsdeltaO18pdNoInterpSSA2d
-md=triangle(model(),'../Exp/Square.exp',60000.);
+md=triangle(model(),'../Exp/Square.exp',180000.);
 md=setmask(md,'all','');
 md=parameterize(md,'../Par/SquareShelf.par');
@@ -99,5 +99,5 @@
 md.settings.output_frequency=1;
 md.timestepping.final_time=2;
-md.timestepping.interp_forcings=0;
+md.timestepping.interp_forcing=0;
 
 %md.transient.requested_outputs={'default','IceVolumeAboveFloatation','IceVolume','TemperaturePDD','SmbMonthlytemperatures','SmbPrecipitation'};
Index: /issm/trunk/test/NightlyRun/test247.py
===================================================================
--- /issm/trunk/test/NightlyRun/test247.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test247.py	(revision 26744)
@@ -13,5 +13,5 @@
 from SMBpddSicopolis import *
 
-md = triangle(model(), '../Exp/Square.exp', 60000.)
+md = triangle(model(), '../Exp/Square.exp', 180000.)
 md = setmask(md, 'all', '')
 md = parameterize(md, '../Par/SquareShelf.py')
@@ -113,5 +113,5 @@
 md.settings.output_frequency = 1
 md.timestepping.final_time = 2
-md.timestepping.interp_forcings = 0
+md.timestepping.interp_forcing = 0
 
 md.transient.requested_outputs = ['default', 'IceVolumeAboveFloatation','IceVolume','TemperaturePDD']
Index: /issm/trunk/test/NightlyRun/test248.m
===================================================================
--- /issm/trunk/test/NightlyRun/test248.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test248.m	(revision 26744)
@@ -0,0 +1,25 @@
+%Test Name: SquareShelfStressMLHO2d
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
+md=SetMLHOBC(md);
+md=solve(md,'Stressbalance');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx','Vy','Vel','Pressure','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.StressbalanceSolution.Vx),...
+	(md.results.StressbalanceSolution.Vy),...
+	(md.results.StressbalanceSolution.Vel),...
+	(md.results.StressbalanceSolution.Pressure),...
+	(md.results.StressbalanceSolution.VxSurface),...
+	(md.results.StressbalanceSolution.VySurface),...
+	(md.results.StressbalanceSolution.VxShear),...
+	(md.results.StressbalanceSolution.VyShear),...
+	(md.results.StressbalanceSolution.VxBase),...
+	(md.results.StressbalanceSolution.VyBase),...
+	};
Index: /issm/trunk/test/NightlyRun/test248.py
===================================================================
--- /issm/trunk/test/NightlyRun/test248.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test248.py	(revision 26744)
@@ -0,0 +1,33 @@
+#Test Name: SquareShelfStressMLHO2d
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+from ContourToMesh import *
+
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
+md = SetMLHOBC(md);
+md = solve(md, 'Stressbalance')
+
+#Fields and tolerances to track changes
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.VxSurface,
+                md.results.StressbalanceSolution.VySurface, 
+                md.results.StressbalanceSolution.VxShear,
+                md.results.StressbalanceSolution.VyShear, 
+                md.results.StressbalanceSolution.VxBase,
+                md.results.StressbalanceSolution.VyBase]
Index: /issm/trunk/test/NightlyRun/test249.m
===================================================================
--- /issm/trunk/test/NightlyRun/test249.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test249.m	(revision 26744)
@@ -0,0 +1,47 @@
+%Test Name: SquareShelfTranMLHO2d
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.transient.requested_outputs={'default','FloatingArea','GroundedArea','TotalGroundedBmb','TotalFloatingBmb'};
+md.basalforcings.floatingice_melting_rate(:)=1;
+md=SetMLHOBC(md);
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','TotalGroundedBmb1','TotalFloatingBmb1',...
+	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','TotalGroundedBmb2','TotalFloatingBmb2',...
+	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','TotalGroundedBmb3','TotalFloatingBmb3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).TotalGroundedBmb),...
+	(md.results.TransientSolution(1).TotalFloatingBmb),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).TotalGroundedBmb),...
+	(md.results.TransientSolution(2).TotalFloatingBmb),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).Base),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).TotalGroundedBmb),...
+	(md.results.TransientSolution(3).TotalFloatingBmb),...
+	};
Index: /issm/trunk/test/NightlyRun/test249.py
===================================================================
--- /issm/trunk/test/NightlyRun/test249.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test249.py	(revision 26744)
@@ -0,0 +1,63 @@
+#Test Name: SquareShelfTranMLHO2d
+
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+from generic import generic
+
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.basalforcings.floatingice_melting_rate[:] = 1.
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['default', 'FloatingArea', 'GroundedArea', 'TotalFloatingBmb', 'TotalGroundedBmb']
+md = SetMLHOBC(md);
+md = solve(md, 'Transient')
+
+
+# Fields and tolerances to track changes
+
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1',
+               'Bed1', 'Surface1', 'Thickness1', 'TotalGroundedBmb1', 'TotalFloatingBmb1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2',
+               'Bed2', 'Surface2', 'Thickness2', 'TotalGroundedBmb2', 'TotalFloatingBmb2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3',
+               'Bed3', 'Surface3', 'Thickness3', 'TotalGroundedBmb3', 'TotalFloatingBmb3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].TotalGroundedBmb,
+                md.results.TransientSolution[0].TotalFloatingBmb,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].TotalGroundedBmb,
+                md.results.TransientSolution[1].TotalFloatingBmb,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].TotalGroundedBmb,
+                md.results.TransientSolution[2].TotalFloatingBmb]
Index: /issm/trunk/test/NightlyRun/test252.m
===================================================================
--- /issm/trunk/test/NightlyRun/test252.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test252.m	(revision 26744)
@@ -35,5 +35,5 @@
 md.smb.pAir=md.smb.pAir(:,1:365*8);
 
-md.smb.isclimatology=1;
+md.timestepping.cycle_forcing=1;
 
 %smb settings
@@ -49,5 +49,5 @@
 md.timestepping.final_time=1966.6;
 md.timestepping.time_step=1/365.0;
-md.timestepping.interp_forcings=0;
+md.timestepping.interp_forcing=0;
 
 %Run transient
@@ -67,5 +67,5 @@
                    1e-12,1e-12,1e-11,1e-10,2e-11,1e-11,1e-12,1e-11,1e-12,1e-12,1e-12,1e-11,...
                    1e-12,1e-12,2e-12,2e-11,4e-11,1e-11,1e-12,1e-11,1e-11,1e-12,1e-12,1e-11,...
-                   1e-11,1e-11,4e-11,4e-11,1e-12,4e-11,1e-12,1e-12,1e-10,1e-12,1e-12,2e-11};
+                   1e-11,1e-11,4e-11,4e-11,1e-12,4e-11,1e-12,3e-12,1e-10,1e-12,1e-12,2e-11};
 
 field_values={...
Index: /issm/trunk/test/NightlyRun/test252.py
===================================================================
--- /issm/trunk/test/NightlyRun/test252.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test252.py	(revision 26744)
@@ -51,5 +51,5 @@
 md.smb.pAir = md.smb.pAir[:, 0:365 * 8]
 
-md.smb.isclimatology = 1
+md.timestepping.cycle_forcing = 1
 
 #smb settings
@@ -65,5 +65,5 @@
 md.timestepping.final_time = 1966.6
 md.timestepping.time_step = 1. / 365.0
-md.timestepping.interp_forcings = 0.
+md.timestepping.interp_forcing = 0.
 
 #Run transient
@@ -83,5 +83,5 @@
     1e-12,1e-12,1e-11,1e-10,2e-11,1e-11,1e-12,1e-11,1e-12,1e-12,1e-12,1e-11,
     1e-12,1e-12,2e-12,2e-11,4e-11,1e-11,1e-12,1e-11,1e-11,1e-12,1e-12,1e-11,
-    1e-11,1e-11,4e-11,4e-11,1e-12,4e-11,1e-12,1e-12,1e-10,1e-12,1e-12,2e-11
+    1e-11,1e-11,4e-11,4e-11,1e-12,4e-11,1e-12,3e-12,1e-10,1e-12,1e-12,2e-11
 ]
 # Shape is different in python solution (fixed using reshape) which can cause test failure
Index: /issm/trunk/test/NightlyRun/test253.m
===================================================================
--- /issm/trunk/test/NightlyRun/test253.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test253.m	(revision 26744)
@@ -37,5 +37,5 @@
 md.smb.pAir=md.smb.pAir(:,1:365*8);
 
-md.smb.isclimatology=1;
+md.timestepping.cycle_forcing=1;
 md.smb.isconstrainsurfaceT=1;
 
@@ -52,5 +52,5 @@
 md.timestepping.final_time=1966.6;
 md.timestepping.time_step=1/365.0;
-md.timestepping.interp_forcings=0;
+md.timestepping.interp_forcing=0;
 
 %Run transient
Index: /issm/trunk/test/NightlyRun/test253.py
===================================================================
--- /issm/trunk/test/NightlyRun/test253.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test253.py	(revision 26744)
@@ -51,5 +51,5 @@
 md.smb.pAir = md.smb.pAir[:, 0:365 * 8]
 
-md.smb.isclimatology = 1
+md.timestepping.cycle_forcing = 1
 md.smb.isconstrainsurfaceT = 1
 
@@ -66,5 +66,5 @@
 md.timestepping.final_time = 1966.6
 md.timestepping.time_step = 1. / 365.0
-md.timestepping.interp_forcings = 0.
+md.timestepping.interp_forcing = 0.
 
 #Run transient
Index: /issm/trunk/test/NightlyRun/test254.m
===================================================================
--- /issm/trunk/test/NightlyRun/test254.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test254.m	(revision 26744)
@@ -0,0 +1,73 @@
+%Test Name: SquareShelfConstrainedMLHO
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+
+%redo the parameter file for this special shelf. 
+%constant thickness, constrained (vy=0) flow into an icefront, 
+%from 0 m/yr at the grounding line.
+
+%tighten
+md.stressbalance.restol=10^-4;
+
+%needed later
+ymin=min(md.mesh.y);
+ymax=max(md.mesh.y);
+xmin=min(md.mesh.x);
+xmax=max(md.mesh.x);
+
+di=md.materials.rho_ice/md.materials.rho_water;
+
+h=1000;
+md.geometry.thickness=h*ones(md.mesh.numberofvertices,1);
+md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
+md.geometry.surface=md.geometry.base+md.geometry.thickness;
+
+%Initial velocity and pressure
+md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+md.initialization.vz=zeros(md.mesh.numberofvertices,1);
+md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
+
+%Materials
+md.initialization.temperature=(273-20)*ones(md.mesh.numberofvertices,1);
+md.materials.rheology_B=paterson(md.initialization.temperature);
+md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+
+%Boundary conditions:
+md.stressbalance.spcvx=NaN*ones(md.mesh.numberofvertices,1);
+md.stressbalance.spcvy=NaN*ones(md.mesh.numberofvertices,1);
+md.stressbalance.spcvz=NaN*ones(md.mesh.numberofvertices,1);
+
+%constrain flanks to 0 normal velocity
+pos=find(md.mesh.x==xmin | md.mesh.x==xmax);
+md.stressbalance.spcvx(pos)=0;
+md.stressbalance.spcvz(pos)=NaN;
+
+%constrain grounding line to 0 velocity
+pos=find(md.mesh.y==ymin);
+md.stressbalance.spcvx(pos)=0;
+md.stressbalance.spcvy(pos)=0;
+
+%icefront
+nodeonicefront=zeros(md.mesh.numberofvertices,1);
+pos=find(md.mesh.y==ymax); nodeonicefront(pos)=1;
+md.mask.ice_levelset=-1+nodeonicefront;
+
+md.stressbalance.requested_outputs={'default','VySurface','VyShear','VyBase'};
+md=SetMLHOBC(md);
+md=solve(md,'Stressbalance');
+
+%create analytical solution: strain rate is constant = ((rho_ice*g*h)/4B)^3 (Paterson, 4th Edition, page 292.
+%ey_c=(md.materials.rho_ice*md.constants.g*(1-di)*md.geometry.thickness./(4*md.materials.rheology_B)).^3;
+%vy_c=ey_c.*md.mesh.y*md.constants.yts;
+
+%Fields and tolerances to track changes
+field_names     ={'Vy','VySurface','VyShear','VyBase'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13};
+field_values={(md.results.StressbalanceSolution.Vy),...
+					(md.results.StressbalanceSolution.VySurface),...
+					(md.results.StressbalanceSolution.VyShear),...
+					(md.results.StressbalanceSolution.VyBase)};
Index: /issm/trunk/test/NightlyRun/test254.py
===================================================================
--- /issm/trunk/test/NightlyRun/test254.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test254.py	(revision 26744)
@@ -0,0 +1,83 @@
+#Test Name: SquareShelfConstrainedMLHO
+from model import *
+from socket import gethostname
+import numpy as np
+from triangle import triangle
+from setmask import setmask
+from parameterize import parameterize
+from setflowequation import setflowequation
+from paterson import paterson
+from solve import solve
+from SetMLHOBC import SetMLHOBC
+from generic import generic
+
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+
+# redo the parameter file for this special shelf.
+# constant thickness, constrained (vy = 0) flow into an icefront,
+# from 0 m / yr at the grounding line.
+
+# tighten
+md.stressbalance.restol = 1e-4
+
+# needed later
+ymin = min(md.mesh.y)
+ymax = max(md.mesh.y)
+xmin = min(md.mesh.x)
+xmax = max(md.mesh.x)
+
+di = md.materials.rho_ice / md.materials.rho_water
+
+h = 1000.
+md.geometry.thickness = h * np.ones((md.mesh.numberofvertices))
+md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+
+# Initial velocity and pressure
+md.initialization.vx = np.zeros((md.mesh.numberofvertices))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices))
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
+
+# Materials
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_B = paterson(md.initialization.temperature)
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
+
+# Boundary conditions:
+md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
+md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
+md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
+
+# constrain flanks to 0 normal velocity
+pos = np.where(np.logical_or(md.mesh.x == xmin, md.mesh.x == xmax))
+md.stressbalance.spcvx[pos] = 0
+md.stressbalance.spcvz[pos] = np.nan
+
+# constrain grounding line to 0 velocity
+pos = np.where(md.mesh.y == ymin)
+md.stressbalance.spcvx[pos] = 0
+md.stressbalance.spcvy[pos] = 0
+
+# icefront
+nodeonicefront = np.zeros(md.mesh.numberofvertices)
+pos = np.where(md.mesh.y == ymax)
+nodeonicefront[pos] = 1
+md.mask.ice_levelset = -1 + nodeonicefront
+
+md.stressbalance.requested_outputs = ['default', 'VySurface', 'VyShear', 'VyBase']
+md = SetMLHOBC(md)
+md = solve(md, 'Stressbalance')
+
+# create analytical solution: strain rate is constant = ((rho_ice * g * h) / 4B)^3 (Paterson, 4th Edition, page 292.
+# ey_c=(md.materials.rho_ice * md.constants.g * (1 - di) * md.geometry.thickness. / (4 * md.materials.rheology_B)).^3
+# vy_c = ey_c. * md.mesh.y * md.constants.yts
+
+# Fields and tolerances to track changes
+field_names = ['Vy', 'VySurface', 'VyShear', 'VyBase']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vy, md.results.StressbalanceSolution.VySurface, md.results.StressbalanceSolution.VyShear, md.results.StressbalanceSolution.VyBase]
Index: /issm/trunk/test/NightlyRun/test255.m
===================================================================
--- /issm/trunk/test/NightlyRun/test255.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test255.m	(revision 26744)
@@ -0,0 +1,36 @@
+%Test Name: SquareShelfStressMLHO2dTransientIncrHydro
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.masstransport.hydrostatic_adjustment='Incremental';
+md=SetMLHOBC(md);
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).Base),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	};
Index: /issm/trunk/test/NightlyRun/test255.py
===================================================================
--- /issm/trunk/test/NightlyRun/test255.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test255.py	(revision 26744)
@@ -0,0 +1,53 @@
+#Test Name: SquareShelfStressMLHO2dTransientIncrHydro
+from model import *
+from socket import gethostname
+from triangle import triangle
+from setmask import setmask
+from parameterize import parameterize
+from setflowequation import setflowequation
+from solve import solve
+from SetMLHOBC import SetMLHOBC
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.masstransport.hydrostatic_adjustment = 'Incremental'
+md = SetMLHOBC(md)
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1',
+               'Bed1', 'Surface1', 'Thickness1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2',
+               'Bed2', 'Surface2', 'Thickness2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3',
+               'Bed3', 'Surface3', 'Thickness3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness]
Index: /issm/trunk/test/NightlyRun/test256.m
===================================================================
--- /issm/trunk/test/NightlyRun/test256.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test256.m	(revision 26744)
@@ -0,0 +1,37 @@
+%Test Name: SquareShelfStressMLHO2dTransientIncrNonHydro
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=setflowequation(md,'MLHO','all');
+md.geometry.base=md.geometry.base+50.; md.geometry.surface=md.geometry.surface+50.;
+md.cluster=generic('name',oshostname(),'np',1);
+md.masstransport.hydrostatic_adjustment='Incremental';
+md=SetMLHOBC(md);
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).Base),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	};
Index: /issm/trunk/test/NightlyRun/test256.py
===================================================================
--- /issm/trunk/test/NightlyRun/test256.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test256.py	(revision 26744)
@@ -0,0 +1,55 @@
+#Test Name: SquareShelfStressMLHO2dTransientIncrNonHydro
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.geometry.base = md.geometry.base + 50.
+md.geometry.surface = md.geometry.surface + 50.
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.masstransport.hydrostatic_adjustment = 'Incremental'
+md = SetMLHOBC(md);
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1',
+               'Bed1', 'Surface1', 'Thickness1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2',
+               'Bed2', 'Surface2', 'Thickness2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3',
+               'Bed3', 'Surface3', 'Thickness3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness]
Index: /issm/trunk/test/NightlyRun/test257.m
===================================================================
--- /issm/trunk/test/NightlyRun/test257.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test257.m	(revision 26744)
@@ -0,0 +1,80 @@
+%Test Name: SquareShelfSMBautoregression
+md=triangle(model(),'../Exp/Square.exp',80000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelfConstrained.par');
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.transient.requested_outputs={'default','IceVolume','SmbMassBalance'};
+
+ymax = max(md.mesh.y);
+xmax = max(md.mesh.x);
+%Generate basin IDs for 3 basins
+idbasin      = zeros(md.mesh.numberofelements,1);
+iid1         = find(md.mesh.y>=2/3*ymax);
+iid2         = intersect(find(md.mesh.y<2/3*ymax),find(md.mesh.x>=1/3*xmax));
+iid3         = intersect(find(md.mesh.y<2/3*ymax),find(md.mesh.x<1/3*xmax));
+for ii=1:md.mesh.numberofelements
+    for vertex=1:3
+        if any(iid1==md.mesh.elements(ii,vertex)) %one vertex in basin 1
+            idbasin(ii) = 1;
+        end
+    end
+    if idbasin(ii)==0 %no vertex was found in basin 1
+        for vertex=1:3
+            if any(iid2==md.mesh.elements(ii,vertex)) %one vertex in basin 2
+                idbasin(ii) = 2;
+            end
+        end
+    end
+    if idbasin(ii)==0 %no vertex was found in basin 1 and 2
+        idbasin(ii) = 3;
+    end
+end
+
+%SMB parameters
+md.timestepping.start_time = 0;
+md.timestepping.time_step  = 1;
+md.timestepping.final_time = 5;
+md.smb                = SMBautoregression();
+md.smb.num_basins     = 3; %number of basins
+md.smb.basin_id       = idbasin; %prescribe basin ID number to elements
+md.smb.beta0          = [0.5,1.2,1.5]; %intercept values of SMB in basins [m ice eq./yr]
+md.smb.beta1          = [0.0,0.01,-0.01]; %trend values of SMB in basins [m ice eq./yr^2]
+md.smb.ar_initialtime = md.timestepping.start_time;
+md.smb.ar_order       = 4;
+md.smb.ar_timestep    = 2.0; %timestep of the autoregressive model [yr]
+md.smb.phi            = [[0.2,0.1,0.05,0.01];[0.4,0.2,-0.2,0.1];[0.4,-0.4,0.1,-0.1]];
+
+%Stochastic forcing
+md.stochasticforcing.isstochasticforcing = 1;
+md.stochasticforcing.fields              = [{'SMBautoregression'}];
+md.stochasticforcing.covariance          = [[0.15 0.08 -0.02];[0.08 0.12 -0.05];[-0.02 -0.05 0.1]]; %global covariance among- and between-fields
+md.stochasticforcing.randomflag          = 0; %fixed random seeds
+
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vel1','Thickness1','Volume1','SmbMassBalance1','Vx2','Vy2','Vel2','Thickness2','Volume2','SmbMassBalance2','Vx3','Vy3','Vel3','Thickness3','Volume3','SmbMassBalance3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
+						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).IceVolume),...
+	(md.results.TransientSolution(1).SmbMassBalance),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).IceVolume),...
+	(md.results.TransientSolution(2).SmbMassBalance),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).IceVolume),...
+	(md.results.TransientSolution(3).SmbMassBalance),...
+	};
Index: /issm/trunk/test/NightlyRun/test257.py
===================================================================
--- /issm/trunk/test/NightlyRun/test257.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test257.py	(revision 26744)
@@ -0,0 +1,92 @@
+#Test Name: SquareShelfSMBautoregression
+from __future__ import division  # TODO: Remove this import after ISSM is updated to use Python 3 by default
+import numpy as np
+from model import *
+from socket import gethostname
+from parameterize import parameterize
+from setflowequation import setflowequation
+from setmask import setmask
+from SMBautoregression import SMBautoregression
+from solve import solve
+from triangle import triangle
+
+
+md = triangle(model(), '../Exp/Square.exp', 80000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['default', 'IceVolume', 'SmbMassBalance']
+
+ymax = max(md.mesh.y)
+xmax = max(md.mesh.x)
+# Generate basin IDs for 3 basins
+idbasin = np.zeros((md.mesh.numberofelements,))
+iid1 = np.where(md.mesh.y >= 2. / 3. * ymax)[0]
+iid2 = np.where(np.logical_and(md.mesh.y < 2. / 3. * ymax, md.mesh.x >= 1. / 3. * xmax))[0]
+iid3 = np.where(np.logical_and(md.mesh.y < 2. / 3. * ymax, md.mesh.x < 1. / 3. * xmax))[0]
+for ii in range(md.mesh.numberofelements):
+    for vertex in range(3):
+        if md.mesh.elements[ii][vertex] - 1 in iid1:  # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
+            idbasin[ii] = 1
+    if idbasin[ii] == 0:  # no vertex was found in basin 1
+        for vertex in range(3):
+            if md.mesh.elements[ii][vertex] - 1 in iid2:  # one vertex in basin 2; NOTE: offset because of 1-based vertex indexing
+                idbasin[ii] = 2
+    if idbasin[ii] == 0:  # no vertex was found in basin 1 and 2
+        idbasin[ii] = 3
+
+# SMB parameters
+md.timestepping.start_time = 0
+md.timestepping.time_step = 1
+md.timestepping.final_time = 5
+md.smb = SMBautoregression()
+md.smb.num_basins = 3  # number of basins
+md.smb.basin_id = idbasin - 1  # prescribe basin ID number to elements; # NOTE: offset because of 1-based vertex indexing
+md.smb.beta0 = np.array([[0.5, 1.2, 1.5]])  # intercept values of SMB in basins [m ice eq./yr]
+md.smb.beta1 = np.array([[0.0, 0.01, -0.01]])  # trend values of SMB in basins [m ice eq./yr^2]
+md.smb.ar_initialtime = md.timestepping.start_time
+md.smb.ar_order = 4
+md.smb.ar_timestep = 2.0  #timestep of the autoregressive model [yr]
+md.smb.phi = np.array([[0.2, 0.1, 0.05, 0.01], [0.4, 0.2, -0.2, 0.1], [0.4, -0.4, 0.1, -0.1]])
+
+# Stochastic forcing
+md.stochasticforcing.isstochasticforcing = 1
+md.stochasticforcing.fields = ['SMBautoregression']
+md.stochasticforcing.covariance = np.array([[0.15, 0.08, -0.02], [0.08, 0.12, -0.05], [-0.02, -0.05, 0.1]])  # global covariance among- and between-fields
+md.stochasticforcing.randomflag = 0  # fixed random seeds
+
+
+md = solve(md, 'Transient')
+
+# Fields and tolerances to track changes
+field_names = [
+    'Vx1', 'Vy1', 'Vel1', 'Thickness1', 'Volume1', 'SmbMassBalance1',
+    'Vx2', 'Vy2', 'Vel2', 'Thickness2', 'Volume2', 'SmbMassBalance2',
+    'Vx3', 'Vy3', 'Vel3', 'Thickness3', 'Volume3', 'SmbMassBalance3'
+]
+field_tolerances = [
+    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13
+]
+field_values = [
+    md.results.TransientSolution[0].Vx,
+    md.results.TransientSolution[0].Vy,
+    md.results.TransientSolution[0].Vel,
+    md.results.TransientSolution[0].Thickness,
+    md.results.TransientSolution[0].IceVolume,
+    md.results.TransientSolution[0].SmbMassBalance,
+    md.results.TransientSolution[1].Vx,
+    md.results.TransientSolution[1].Vy,
+    md.results.TransientSolution[1].Vel,
+    md.results.TransientSolution[1].Thickness,
+    md.results.TransientSolution[1].IceVolume,
+    md.results.TransientSolution[1].SmbMassBalance,
+    md.results.TransientSolution[2].Vx,
+    md.results.TransientSolution[2].Vy,
+    md.results.TransientSolution[2].Vel,
+    md.results.TransientSolution[2].Thickness,
+    md.results.TransientSolution[2].IceVolume,
+    md.results.TransientSolution[2].SmbMassBalance
+]
Index: /issm/trunk/test/NightlyRun/test292.m
===================================================================
--- /issm/trunk/test/NightlyRun/test292.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test292.m	(revision 26744)
@@ -7,5 +7,5 @@
 md.basalforcings=linearbasalforcings(md.basalforcings);
 md.basalforcings.deepwater_melting_rate=[50 100;0 5];
-md.timestepping.interp_forcings=0;
+md.timestepping.interp_forcing=0;
 md=solve(md,'Transient');
 
Index: /issm/trunk/test/NightlyRun/test292.py
===================================================================
--- /issm/trunk/test/NightlyRun/test292.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test292.py	(revision 26744)
@@ -19,5 +19,5 @@
 md.basalforcings = linearbasalforcings(md.basalforcings)
 md.basalforcings.deepwater_melting_rate = np.array([[50., 100.], [0., 5.]])
-md.timestepping.interp_forcings = 0
+md.timestepping.interp_forcing = 0
 md = solve(md, 'Transient')
 
Index: /issm/trunk/test/NightlyRun/test3201.m
===================================================================
--- /issm/trunk/test/NightlyRun/test3201.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test3201.m	(revision 26744)
@@ -10,5 +10,5 @@
 
 %Create real time series for B
-md.timestepping.interp_forcings = 0;
+md.timestepping.interp_forcing = 0;
 md.timestepping.final_time = 2*md.timestepping.time_step;
 md.materials.rheology_B = 1.8e8*ones(md.mesh.numberofelements,2);
Index: /issm/trunk/test/NightlyRun/test3202.m
===================================================================
--- /issm/trunk/test/NightlyRun/test3202.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test3202.m	(revision 26744)
@@ -10,5 +10,5 @@
 
 %Create real time series for B
-md.timestepping.interp_forcings = 0;
+md.timestepping.interp_forcing = 0;
 md.timestepping.final_time = 2*md.timestepping.time_step;
 md.materials.rheology_B = 1.8e8*ones(md.mesh.numberofvertices,2);
Index: /issm/trunk/test/NightlyRun/test3203.m
===================================================================
--- /issm/trunk/test/NightlyRun/test3203.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test3203.m	(revision 26744)
@@ -0,0 +1,91 @@
+%Test Name: SquareShelfTransientLevelsetMisfitcodipack
+
+md=triangle(model(),'../Exp/Square.exp',50000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+
+%Do not kill ice bergs as all is floating
+md.levelset.kill_icebergs=0;
+
+x = md.mesh.x;
+xmin = min(x);
+xmax = max(x);
+Lx = (xmax-xmin);
+alpha = 2./3.;
+md.mask.ice_levelset = ((x - alpha*Lx)>0) - ((x - alpha*Lx)<0);
+
+md.timestepping.time_step=10;
+md.timestepping.final_time=30;
+
+%Transient
+md.transient.isstressbalance=1;
+md.transient.ismasstransport=1;
+md.transient.issmb=1;
+md.transient.isthermal=0;
+md.transient.isgroundingline=0;
+md.transient.ismovingfront=1;
+
+md.calving=calvinglevermann();
+md.calving.coeff=4.89e13*ones(md.mesh.numberofvertices,1);
+md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
+md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
+md.levelset.migration_max = 1e8;
+
+md = solve(md,'tr');
+%plotmodel(md,'axis#all','tight','data',md.materials.rheology_B(1:end-1,1),'caxis#all',[ 1.3 1.9]*10^8,'title','"True" B',...
+%'data',md.materials.rheology_B(1:end-1,2),'title','"True" B 2')
+
+%Modify rheology, now constant
+md.materials.rheology_B(1:end-1,:) = 1.8e8;
+
+%Set cost function
+weights= ones(md.mesh.numberofvertices,1);
+count = 1;
+
+for i=1:numel(md.results.TransientSolution)
+	time   = md.results.TransientSolution(i).time;
+   md.outputdefinition.definitions{count}=cflevelsetmisfit('name',['LevelsetMisfit' num2str(count)],...
+      'definitionstring',['Outputdefinition' num2str(count)],...
+      'model_string','MaskIceLevelset','observation_string','LevelsetObservation',...
+      'observation',reinitializelevelset(md, md.results.TransientSolution(i).MaskIceLevelset),'weights',weights,'weights_string','WeightsLevelsetObservation',...
+      'datatime',time);
+   md.autodiff.dependents{count} = dependent('name',['Outputdefinition' num2str(count)],'type','scalar','fos_reverse_index',1);
+
+	count = count+1;
+end
+
+%Independent
+min_params = md.materials.rheology_B; min_params(1:end-1,:) = cuffey(273);
+max_params = md.materials.rheology_B; max_params(1:end-1,:) = cuffey(200);
+md.autodiff.independents{1} = independent('name','MaterialsRheologyBbar',...
+	'md_name','md.materials.rheology_B',...
+	'control_size',size(md.materials.rheology_B,2),...
+	'type','vertex',... %Really needed??
+	'min_parameters',min_params,...
+	'max_parameters',max_params,...
+	'control_scaling_factor',1e8);
+
+md.inversion=adm1qn3inversion(md.inversion);
+md.inversion.iscontrol=1;
+md.inversion.maxiter=4;
+md.inversion.maxsteps=md.inversion.maxiter;
+md.inversion.dxmin=1e-5;
+md.autodiff.isautodiff=1;
+md.autodiff.driver='fos_reverse';
+
+%Go solve!
+md.verbose=verbose(0);
+md=solve(md,'tr');
+%plotmodel(md,'axis#all','tight','data',md.results.TransientSolution(1).MaterialsRheologyBbar(:,1),'caxis#all',[ 1.3 1.9]*10^8,'title','B1',...
+%'data',md.results.TransientSolution(1).MaterialsRheologyBbar(:,2),'title','B2')
+
+%Fields and tolerances to track changes
+field_names     ={'Gradient','Misfit','Rheology'};
+field_tolerances={1e-12,1e-12,1e-12};
+field_values={...
+	(md.results.TransientSolution(1).Gradient1),...
+	(md.results.TransientSolution(1).J),...
+	(md.results.TransientSolution(1).MaterialsRheologyBbar),...
+	};
Index: /issm/trunk/test/NightlyRun/test330.m
===================================================================
--- /issm/trunk/test/NightlyRun/test330.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test330.m	(revision 26744)
@@ -0,0 +1,25 @@
+%Test Name: SquareSheetConstrainedStressMLHO2d
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
+md=SetMLHOBC(md);
+md=solve(md,'Stressbalance');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx','Vy','Vel','Pressure','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.StressbalanceSolution.Vx),...
+	(md.results.StressbalanceSolution.Vy),...
+	(md.results.StressbalanceSolution.Vel),...
+	(md.results.StressbalanceSolution.Pressure),...
+	(md.results.StressbalanceSolution.VxSurface),...
+	(md.results.StressbalanceSolution.VySurface),...
+	(md.results.StressbalanceSolution.VxShear),...
+	(md.results.StressbalanceSolution.VyShear),...
+	(md.results.StressbalanceSolution.VxBase),...
+	(md.results.StressbalanceSolution.VyBase),...
+	};
Index: /issm/trunk/test/NightlyRun/test330.py
===================================================================
--- /issm/trunk/test/NightlyRun/test330.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test330.py	(revision 26744)
@@ -0,0 +1,33 @@
+#Test Name: SquareSheetConstrainedStressMLHO2d
+from model import *
+from socket import gethostname
+from triangle import triangle
+from setmask import setmask
+from parameterize import parameterize
+from setflowequation import setflowequation
+from solve import solve
+from SetMLHOBC import SetMLHOBC
+
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
+md = SetMLHOBC(md)
+md = solve(md, 'Stressbalance')
+
+#Fields and tolerances to track changes
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.VxSurface,
+                md.results.StressbalanceSolution.VySurface,
+                md.results.StressbalanceSolution.VxShear,
+                md.results.StressbalanceSolution.VyShear,
+                md.results.StressbalanceSolution.VxBase,
+                md.results.StressbalanceSolution.VyBase]
Index: /issm/trunk/test/NightlyRun/test332.m
===================================================================
--- /issm/trunk/test/NightlyRun/test332.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test332.m	(revision 26744)
@@ -0,0 +1,40 @@
+%Test Name: SquareSheetConstrainedTranMLHO2d
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md=SetMLHOBC(md);
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1',...
+	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2',...
+	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3'};
+field_tolerances={...
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	2e-13,1e-13,1e-13,2e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).Base),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	};
Index: /issm/trunk/test/NightlyRun/test332.py
===================================================================
--- /issm/trunk/test/NightlyRun/test332.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test332.py	(revision 26744)
@@ -0,0 +1,44 @@
+#Test Name: SquareSheetConstrainedTranMLHO2d
+from model import *
+from socket import gethostname
+from triangle import triangle
+from setmask import setmask
+from parameterize import parameterize
+from setflowequation import setflowequation
+from solve import solve
+from SetMLHOBC import SetMLHOBC
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = SetMLHOBC(md)
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    2e-13, 1e-13, 1e-13, 2e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness]
Index: /issm/trunk/test/NightlyRun/test333.m
===================================================================
--- /issm/trunk/test/NightlyRun/test333.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test333.m	(revision 26744)
@@ -0,0 +1,35 @@
+%Test Name: SquareSheetConstrainedCMDragMLHO
+md=triangle(model(),'../Exp/Square.exp',200000.);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=setflowequation(md,'MLHO','all');
+
+%control parameters
+md.inversion.iscontrol=1;
+md.inversion.control_parameters={'FrictionCoefficient'};
+md.inversion.min_parameters=1.*ones(md.mesh.numberofvertices,1);
+md.inversion.max_parameters=200.*ones(md.mesh.numberofvertices,1);
+md.inversion.nsteps=2;
+md.inversion.cost_functions=[102  501];
+md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2.*10^-7;
+md.inversion.gradient_scaling=3.*ones(md.inversion.nsteps,1);
+md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
+md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
+
+md.cluster=generic('name',oshostname(),'np',3);
+md=SetMLHOBC(md);
+md=solve(md,'Stressbalance');
+
+%Fields and tolerances to track changes
+field_names     ={'Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy'};
+field_tolerances={1e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.StressbalanceSolution.Gradient1),...
+	(md.results.StressbalanceSolution.J),...
+	(md.results.StressbalanceSolution.FrictionCoefficient),...
+	(md.results.StressbalanceSolution.Pressure),...
+	(md.results.StressbalanceSolution.Vel),...
+	(md.results.StressbalanceSolution.Vx),...
+	(md.results.StressbalanceSolution.Vy)
+};
Index: /issm/trunk/test/NightlyRun/test333.py
===================================================================
--- /issm/trunk/test/NightlyRun/test333.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test333.py	(revision 26744)
@@ -0,0 +1,46 @@
+#Test Name: SquareSheetConstrainedCMDragMLHO
+import numpy as np
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'MLHO', 'all')
+
+#control parameters
+
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['FrictionCoefficient']
+md.inversion.min_parameters = 1. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 200. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [102, 501]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
+md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
+md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2 * np.ones(md.inversion.nsteps)
+md.inversion.step_threshold = 0.3 * np.ones(md.inversion.nsteps)
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
+
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = SetMLHOBC(md);
+md = solve(md, 'Stressbalance')
+
+#Fields and tolerances to track changes
+field_names = ['Gradient', 'Misfits', 'FrictionCoefficient', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [1e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.J,
+                md.results.StressbalanceSolution.FrictionCoefficient,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test334.m
===================================================================
--- /issm/trunk/test/NightlyRun/test334.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test334.m	(revision 26744)
@@ -0,0 +1,36 @@
+%Test Name: SquareShelfCMBMLHO
+md=triangle(model(),'../Exp/Square.exp',200000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=setflowequation(md,'MLHO','all');
+
+%control parameters
+md.inversion.iscontrol=1;
+md.inversion.control_parameters={'MaterialsRheologyBbar'};
+md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1);
+md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1);
+md.inversion.nsteps=2;
+md.inversion.cost_functions=101;
+md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
+md.inversion.gradient_scaling=10^7*ones(md.inversion.nsteps,1);
+md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
+md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
+md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
+md.verbose.control=true;
+
+md.cluster=generic('name',oshostname(),'np',3);
+md=SetMLHOBC(md);
+md=solve(md,'Stressbalance');
+
+%Fields and tolerances to track changes
+field_names     ={'Gradient','Misfits','MaterialsRheologyBbar','Pressure','Vel','Vx','Vy'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.StressbalanceSolution.Gradient1),...
+	(md.results.StressbalanceSolution.J),...
+	(md.results.StressbalanceSolution.MaterialsRheologyBbar),...
+	(md.results.StressbalanceSolution.Pressure),...
+	(md.results.StressbalanceSolution.Vel),...
+	(md.results.StressbalanceSolution.Vx),...
+	(md.results.StressbalanceSolution.Vy)
+};
Index: /issm/trunk/test/NightlyRun/test334.py
===================================================================
--- /issm/trunk/test/NightlyRun/test334.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test334.py	(revision 26744)
@@ -0,0 +1,48 @@
+#Test Name: SquareShelfCMBMLHO
+from model import *
+from socket import gethostname
+import numpy as np
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+from generic import generic
+
+md = triangle(model(), '../Exp/Square.exp', 200000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'MLHO', 'all')
+
+# control parameters
+
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['MaterialsRheologyBbar']
+md.inversion.min_parameters = 1.0e6 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 2.0e9 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [101]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, len(md.inversion.cost_functions)))
+md.inversion.gradient_scaling = 1.0e7 * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2. * np.ones((md.inversion.nsteps))
+md.inversion.step_threshold = 0.3 * np.ones((md.inversion.nsteps))
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
+
+
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = SetMLHOBC(md);
+md = solve(md, 'Stressbalance')
+
+
+# Fields and tolerances to track changes
+
+field_names = ['Gradient', 'Misfits', 'MaterialsRheologyBbar', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.J,
+                md.results.StressbalanceSolution.MaterialsRheologyBbar,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test335.m
===================================================================
--- /issm/trunk/test/NightlyRun/test335.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test335.m	(revision 26744)
@@ -0,0 +1,29 @@
+%Test Name: SquareSheetConstrainedStressMLHO3d
+md=triangle(model(),'../Exp/Square.exp',200000.);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=setflowequation(md,'MLHO','all');
+md = extrude(md, 5, 1);
+md.cluster=generic('name',oshostname(),'np',3);
+md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
+md=SetMLHOBC(md);
+md=solve(md,'Stressbalance');
+
+%Fields and tolerances to track changes
+%Fields and tolerances to track changes
+field_names     ={'Vx','Vy','Vz','Vel','Pressure','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.StressbalanceSolution.Vx),...
+	(md.results.StressbalanceSolution.Vy),...
+	(md.results.StressbalanceSolution.Vz),...
+	(md.results.StressbalanceSolution.Vel),...
+	(md.results.StressbalanceSolution.Pressure),...
+	(md.results.StressbalanceSolution.VxSurface),...
+	(md.results.StressbalanceSolution.VySurface),...
+	(md.results.StressbalanceSolution.VxShear),...
+	(md.results.StressbalanceSolution.VyShear),...
+	(md.results.StressbalanceSolution.VxBase),...
+	(md.results.StressbalanceSolution.VyBase),...
+	};
+
Index: /issm/trunk/test/NightlyRun/test335.py
===================================================================
--- /issm/trunk/test/NightlyRun/test335.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test335.py	(revision 26744)
@@ -0,0 +1,35 @@
+#Test Name: SquareSheetConstrainedStressMLHO2d
+from model import *
+from socket import gethostname
+from triangle import triangle
+from setmask import setmask
+from parameterize import parameterize
+from setflowequation import setflowequation
+from solve import solve
+from SetMLHOBC import SetMLHOBC
+
+
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'MLHO', 'all')
+md = SetMLHOBC(md)
+md.extrude(5, 1.)
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
+md = solve(md, 'Stressbalance')
+
+#Fields and tolerances to track changes
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.VxSurface,
+                md.results.StressbalanceSolution.VySurface,
+                md.results.StressbalanceSolution.VxShear,
+                md.results.StressbalanceSolution.VyShear,
+                md.results.StressbalanceSolution.VxBase,
+                md.results.StressbalanceSolution.VyBase]
Index: /issm/trunk/test/NightlyRun/test339.m
===================================================================
--- /issm/trunk/test/NightlyRun/test339.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test339.m	(revision 26744)
@@ -32,5 +32,5 @@
 	2e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
 	2e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
-	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
+	2e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
 	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10};
 field_values={...
Index: /issm/trunk/test/NightlyRun/test339.py
===================================================================
--- /issm/trunk/test/NightlyRun/test339.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test339.py	(revision 26744)
@@ -41,5 +41,5 @@
 field_tolerances = [2e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
                     2e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
-                    1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    2e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
                     1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
 field_values = [md.results.TransientSolution[0].Vx,
Index: /issm/trunk/test/NightlyRun/test3480.m
===================================================================
--- /issm/trunk/test/NightlyRun/test3480.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test3480.m	(revision 26744)
@@ -38,5 +38,5 @@
 	'datatime',0.75);
 
-md.timestepping.interp_forcings=0;
+md.timestepping.interp_forcing=0;
 md.timestepping.time_step=0.5;
 md.timestepping.final_time=1.5;
Index: /issm/trunk/test/NightlyRun/test3481.m
===================================================================
--- /issm/trunk/test/NightlyRun/test3481.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test3481.m	(revision 26744)
@@ -45,5 +45,5 @@
 	'datatime',0.75);
 
-md.timestepping.interp_forcings=1;
+md.timestepping.interp_forcing=1;
 md.timestepping.time_step=0.5;
 md.timestepping.final_time=1.5;
Index: /issm/trunk/test/NightlyRun/test350.py
===================================================================
--- /issm/trunk/test/NightlyRun/test350.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test350.py	(revision 26744)
@@ -3,5 +3,5 @@
 
 from frictionshakti import frictionshakti
-from MatlabFuncs import oshostname
+from socket import gethostname
 from model import *
 from operator import itemgetter
Index: /issm/trunk/test/NightlyRun/test352.m
===================================================================
--- /issm/trunk/test/NightlyRun/test352.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test352.m	(revision 26744)
@@ -16,5 +16,5 @@
 md.transient.isthermal=0;
 
-md.smb.isclimatology=1;
+md.timestepping.cycle_forcing=1;
 
 md=solve(md,'Transient');
Index: /issm/trunk/test/NightlyRun/test352.py
===================================================================
--- /issm/trunk/test/NightlyRun/test352.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test352.py	(revision 26744)
@@ -26,5 +26,5 @@
 md.transient.isthermal = False
 
-md.smb.isclimatology = 1
+md.timestepping.cycle_forcing = 1
 
 md = solve(md, 'Transient')
Index: /issm/trunk/test/NightlyRun/test353.m
===================================================================
--- /issm/trunk/test/NightlyRun/test353.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test353.m	(revision 26744)
@@ -20,5 +20,5 @@
 md.transient.isthermal=0;
 
-md.smb.isclimatology=1;
+md.timestepping.cycle_forcing=1;
 
 md=solve(md,'Transient');
Index: /issm/trunk/test/NightlyRun/test353.py
===================================================================
--- /issm/trunk/test/NightlyRun/test353.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test353.py	(revision 26744)
@@ -30,5 +30,5 @@
 md.transient.isthermal = False
 
-md.smb.isclimatology = 1
+md.timestepping.cycle_forcing = 1
 
 md = solve(md, 'Transient')
Index: /issm/trunk/test/NightlyRun/test354.m
===================================================================
--- /issm/trunk/test/NightlyRun/test354.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test354.m	(revision 26744)
@@ -21,5 +21,5 @@
 md.transient.isthermal=0;
 
-md.smb.isclimatology=1;
+md.timestepping.cycle_forcing=1;
 
 md=solve(md,'Transient');
Index: /issm/trunk/test/NightlyRun/test354.py
===================================================================
--- /issm/trunk/test/NightlyRun/test354.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test354.py	(revision 26744)
@@ -31,5 +31,5 @@
 md.transient.isthermal = False
 
-md.smb.isclimatology = 1
+md.timestepping.cycle_forcing = 1
 
 md = solve(md, 'Transient')
Index: /issm/trunk/test/NightlyRun/test356.py
===================================================================
--- /issm/trunk/test/NightlyRun/test356.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test356.py	(revision 26744)
@@ -3,5 +3,5 @@
 
 from frictionschoof import frictionschoof
-from MatlabFuncs import oshostname
+from socket import gethostname
 from model import *
 from parameterize import parameterize
@@ -40,5 +40,5 @@
 md.inversion.vy_obs= md.initialization.vy
 
-md.cluster = generic('name', oshostname(), 'np', 3)
+md.cluster = generic('name', gethostname(), 'np', 3)
 md = solve(md, 'Stressbalance')
 
Index: /issm/trunk/test/NightlyRun/test4002.m
===================================================================
--- /issm/trunk/test/NightlyRun/test4002.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test4002.m	(revision 26744)
@@ -548,5 +548,5 @@
     md.timestepping.final_time=final_time;
     md.timestepping.time_step=time_step;
-    md.transient.isgroundingline=1;
+    md.transient.isgroundingline=0;
     md.transient.isthermal=0;
     md.groundingline.migration='SubelementMigration';
@@ -660,5 +660,5 @@
     md.cluster=generic('name',oshostname(),'np',2);
     md.results.TransientSolution.Base=md.geometry.base;
-    md.transient.isgroundingline=1;
+    md.transient.isgroundingline=0;
     md.transient.isthermal=0;
     md.groundingline.migration='SubelementMigration';
@@ -825,4 +825,5 @@
         md.timestepping.start_time=t;
         md.timestepping.final_time=t+time_step;;
+		  md.transient.requested_outputs={'default','MaskOceanLevelset'};
         md=solve(md,'Transient');
 
@@ -999,11 +1000,12 @@
 
     md.transient.isoceancoupling=1;
-    md.transient.isgroundingline=1;
+    md.transient.isgroundingline=0;
     md.groundingline.migration='None';
     md.groundingline.melt_interpolation='SubelementMelt2';
     md.groundingline.friction_interpolation='SubelementFriction2';
     md.timestepping.coupling_time=time_step;
-   md.timestepping.time_step=time_step;
+    md.timestepping.time_step=time_step;
     md.timestepping.final_time=final_time-time_step;
+	 md.transient.requested_outputs={'default','MaskOceanLevelset'};
     md.cluster.npocean=nPx*nPy;
     md.cluster.np=2;
Index: /issm/trunk/test/NightlyRun/test4003.m
===================================================================
--- /issm/trunk/test/NightlyRun/test4003.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test4003.m	(revision 26744)
@@ -4,8 +4,8 @@
 %Script control parameters
 steps=1:11;
-final_time=1/365;
+%steps=[1:3 6:11];
 
 %To download and recompile MITgcm from scratch:
-!rm -rf ${ISSM_DIR}/test/MITgcm/install_dngoldberg
+!rm -rf ${ISSM_DIR}/test/MITgcm/install
 !rm -rf ${ISSM_DIR}/test/MITgcm/build/*
 !rm -rf Models
@@ -19,53 +19,29 @@
 % {{{ Parameters:
 if perform(org,'Parameters'),
-	Nx=3; %number of longitude cells
-	Ny=200; %number of latitude cells
-	Nz=90; %number of MITgcm vertical cells
-	nPx=1; %number of MITgcm processes to use in x direction
-	nPy=1; %number of MITgcm processes to use in y direction
-	xgOrigin=1; %origin of longitude
-	ygOrigin=1; %origin of latitude
-	dLong=1; %longitude grid spacing
-	dLat=1; %latitude grid spacing
-	delZ=10; %thickness of vertical levels
-	icefront_position_ratio=.75;
-	ice_thickness=1000;
-	rho_ice=917;
-	rho_water=1028.14;
-	di=rho_ice/rho_water;
-
-	% MITgcm initial and lateral boundary conditions
-	iniSalt  = 34.4; % initial salinity (PSU)
-	iniTheta = -1.9; % initial potential temperature (deg C)
-	obcSalt  = 34.4; % open boundary salinity (PSU)
-	obcTheta =  1.0; % open boundary potential temperature (deg C)
-	mlDepth  = 120.; % mixed layer depth (m)
-	mlSalt   = 33.4; % open boundary salinity (PSU)
-	mlTheta  = -1.9; % open boundary potential temperature (deg C)
-	obcUvel  = -0.1; % open boundary velocity (m/s)
-
-	MITgcmDeltaT=600; % MITgcm time step in seconds
-	y2s=31536000; % year to seconds conversion, i.e., seconds per year
-
-	% start_time and time_step
-	start_time=0; % in decimal years
-	time_step=1/(365*24); % coupling interval in decimal years
-	async_step_MITgcm_multiplier=1; % used to reduce run time for MItgcm
-
-	% bedrock/bathymetry
-	hmax=1000;
-	trough_depth=200;
-	deltah=300;
-	sea_level=1095;
-
-	% issm settings:
-	numlayers=10;
-
-	savedata(org, Nx, Ny, nPx, nPy, Nz, dLong, dLat, delZ, xgOrigin, ...
-		ygOrigin, icefront_position_ratio, ice_thickness, rho_ice, ...
-		rho_water, di, hmax, trough_depth, deltah, sea_level, ...
-		iniSalt, iniTheta, obcSalt, obcTheta, mlDepth, mlSalt, ...
-		mlTheta, obcUvel, start_time, time_step, MITgcmDeltaT, y2s,...
-		numlayers,async_step_MITgcm_multiplier);
+    Nx=3;   % number of longitude cells
+    Ny=200; % number of latitude cells
+    Nz=90;  % number of MITgcm vertical cells
+    nPx=1;  % number of MITgcm processes to use in x direction
+    nPy=8;  % number of MITgcm processes to use in y direction
+    xgOrigin=0;     % origin of longitude
+    ygOrigin=-75.5; % origin of latitude
+    dLong=.125;     % longitude grid spacing
+    dLat=dLong/16;  % latitude grid spacing
+    delZ=10;        % thickness of vertical levels (m)
+    gravity= 9.81;  % gravity (m^2/s)
+    rho_ice=917;
+    rho_water=1030;
+    di=rho_ice/rho_water;
+    prec = 'real*8'; % precision of MITgcm input binary files
+
+    % bathymetry and ice sheet geometry
+    H = -900;	    % water depth in the ice shelf cavity
+    Hmin = -600;    % deepest point of cavern		
+    Hmax = -300;    % shallowest point of cavern
+    jEnd = Ny*3/4;  % where ice-shelf ends
+    j2   = jEnd+1;
+
+    savedata(org, Nx, Ny, nPx, nPy, Nz, dLong, dLat, delZ, xgOrigin, ygOrigin, ...
+             rho_ice, rho_water, di, H, Hmin, Hmax, jEnd, j2, gravity, prec);
 end
 % }}}
@@ -74,55 +50,50 @@
 
     loaddata(org,'Parameters');
-    %create lat,long
-    lat=(ygOrigin+dLat/2):dLat:(ygOrigin+Ny*dLat);
-    long=(xgOrigin+dLong/2):dLong:(xgOrigin+Nx*dLong);
-    [lat long]=meshgrid(lat,long);
-
-    longmin=min(long(:));
-    longmax=max(long(:));
+
+    %create lat,lon
+    latg = ygOrigin+[0:Ny-1]*dLat;
+    latc = latg+dLat/2;
+    long = xgOrigin+[0:Nx-1]*dLong;
+    lonc = long+dLong/2;
+    [lat lon]=meshgrid(latc,lonc);
+    zC=-delZ*([1:Nz]-0.5);
+    zF=-delZ*[0:Nz];
+    
+    %create bathymetry:
+    bathymetry = ones(Nx,Ny)*H;
+    bathymetry(:,end) = 0;
+
+    %save bathymetry file for MITgcm
+    savedata(org,lat,lon,bathymetry);
+
+end
+% }}}
+% {{{ IceSheetGeometry:
+if perform(org,'IceSheetGeometry'),
+
+    loaddata(org,'Parameters');
+    loaddata(org,'Bathymetry');
     latmin=min(lat(:));
     latmax=max(lat(:));
 
-    %create bedrock/bathymetry:
-    bedrock=zeros(Nx,Ny);
-    bedrock=hmax-deltah*tanh(pi*(2*(lat-latmin)./(latmax-latmin)-1))+ ...
-            trough_depth*cos(2*pi*long./(longmax-longmin));
-
-    %save bathymetry file for MITgcm
-    bathymetry=bedrock-sea_level;
-    savedata(org,lat,long,bathymetry);
-
-end
-% }}}
-% {{{ IceSheetGeometry:
-if perform(org,'IceSheetGeometry'),
-
-	loaddata(org,'Parameters');
-	loaddata(org,'Bathymetry');
-	latmin=min(lat(:));
-	latmax=max(lat(:));
-
-	%put ice_thickness constant layer of ice over the bathymetry, unless it floats:
-	s=size(bathymetry);
-	thickness=ice_thickness*ones(s);
-
-	%figure out ice shelf:
-	pos=find(-di*thickness>bathymetry);
-	iceshelf_mask=zeros(s);
-	iceshelf_mask(pos)=1;
-
-	ice_mask=ones(s);
-	pos=find((lat-latmin)/(latmax-latmin)>(icefront_position_ratio));
-	ice_mask(pos)=0;
-	iceshelf_mask(pos)=0;
-
-	%compute draft of ice shelf:
-	draft=bathymetry;
-	pos=find(iceshelf_mask);
-	draft(pos)=-di*thickness(pos);
-	pos=find(~ice_mask);
-	draft(pos)=0;
-
-	savedata(org,ice_mask,iceshelf_mask,draft,thickness);
+    dHdy = (Hmax-Hmin)/dLat/(jEnd-2); %Slope of ice shelf
+    draft=bathymetry;
+    for i=1:Nx
+        draft(i,:)=Hmin+dHdy*[-1:Ny-2]*dLat;
+    end
+
+    ice_mask=ones(Nx,Ny);
+    ice_mask(:,j2:Ny)=0;
+    iceshelf_mask=ice_mask;
+    thickness=abs(draft)/di;
+    
+    savedata(org,ice_mask,iceshelf_mask,draft,thickness);
+    
+    close all, figure(2), clf
+    subplot(411), pcolorcen(bathymetry); colorbar, title('bathymetry')
+    subplot(412), pcolorcen(ice_mask); colorbar, title('ice and iceshelf mask')
+    subplot(413), pcolorcen(draft); colorbar, title('draft')
+    subplot(414), pcolorcen(thickness); colorbar, title('thickness')
+    
 end
 % }}}
@@ -131,5 +102,5 @@
 % {{{ GetMITgcm:
 if perform(org,'GetMITgcm'),
-  system([pwd '/../MITgcm/get_mitgcm_dngoldberg.sh']);
+  system([pwd '/../MITgcm/get_mitgcm.sh']);
 end
 % }}}
@@ -142,4 +113,9 @@
 % {{{ RunUncoupledMITgcm:
 if perform(org,'RunUncoupledMITgcm'),
+
+    loaddata(org,'Parameters');
+    loaddata(org,'Bathymetry');
+    loaddata(org,'IceSheetGeometry');
+
     % rename previous run directory and create new one
     if exist ('run.old')
@@ -151,11 +127,80 @@
     !\mkdir run
     !\cp ../MITgcm/build/mitgcmuv run
-    !\cp ../MITgcm/install_dngoldberg/verification/shelfice_remeshing/input/* run
     !\cp ../MITgcm/input_4003/* run
-    !\cp ../MITgcm/input_4003/data_uncoupled run/data
     !\cp ../MITgcm/input_4003/eedata_uncoupled run/eedata
+    
+    % {{{ Construct MITgcm binary input files
+    namF='run/bathy_flat.bin';
+    fid=fopen(namF,'w','b'); fwrite(fid,bathymetry,prec);fclose(fid);
+    
+    namF='run/shelficeTopo.Lin.bin';
+    fid=fopen(namF,'w','b'); fwrite(fid,draft,prec);fclose(fid);
+    
+    var=([1:Ny]-2)/(jEnd-2);
+    dMdt_fy=zeros(Nx,Ny);
+    for i=1:Nx
+        dMdt_fy(i,:)=-cos(pi*var);
+        dMdt_fy(i,1)=0; dMdt_fy(i,j2:Ny)=0;
+    end    
+    %- rate of change due to ice-stream dynamics
+    rateDyn=rho_water*0.1/3600;  sfx='r02';
+    dMdt=rateDyn*dMdt_fy;
+    namF=sprintf('%s.%s.%s','run/shelfice_dMdt',sfx,'bin');
+    fid=fopen(namF,'w','b'); fwrite(fid,dMdt,prec);fclose(fid);
+
+    T_sfc = -1.9;
+    T_bot = 2;
+    del_T = (T_bot - T_sfc)/(59*delZ);
+    tref=zeros(1,Nz);
+    for k = 1:Nz;
+        tref(k) = T_sfc + del_T*((k-20)*delZ);
+        tref(k)= max(T_sfc,min(tref(k),T_bot));
+    end
+    namF='run/temp_obc.bin';
+    tref=[tref; tref; tref];
+    fid=fopen(namF,'w','b'); fwrite(fid,tref,prec);fclose(fid);
+
+    S_sfc = 34.2;
+    S_bot = 34.7;
+    del_S = (S_bot - S_sfc)/(59*delZ);
+    sref=zeros(1,Nz);
+    for k = 1:Nz;
+        sref(k) = S_sfc + del_S*((k-20)*delZ);
+        sref(k)= max(S_sfc,min(sref(k),S_bot));
+    end
+    namF='run/salt_obc.bin';
+    sref=[sref; sref; sref];
+    fid=fopen(namF,'w','b'); fwrite(fid,sref,prec);fclose(fid);
+
+    zax=[1:Nz];
+    v1=2.5e-2;
+    var=1+Nz-2*zax; var=var/(Nz-1);
+    vobc=v1*var;
+    namF='run/vVel_obc.bin';
+    vobc=[vobc; vobc; vobc];
+    fid=fopen(namF,'w','b'); fwrite(fid,vobc,prec);fclose(fid);
+
+    var=zeros(Nx,Ny,Nz);
+    for i=1:Nx, for j=1:Ny
+            var(i,j,:)=tref(1,:);
+        end, end
+    namF='run/temp_ini.bin';
+    fid=fopen(namF,'w','b'); fwrite(fid,var,prec);fclose(fid);
+
+    for i=1:Nx, for j=1:Ny
+            var(i,j,:)=sref(1,:);
+        end, end
+    namF='run/salt_ini.bin';
+    fid=fopen(namF,'w','b'); fwrite(fid,var,prec);fclose(fid);
+
+    rhoAvr=rho_water-1.345;
+    mIce=-rhoAvr*draft;
+    namF='run/shelficeMass.Lin.bin';
+    fid=fopen(namF,'w','b'); fwrite(fid,mIce,prec);fclose(fid);
+    % }}}
+
     cd run
     eval(['!mpirun -np ' int2str(nPx*nPy) ' ./mitgcmuv']);
-	 cd ..
+    cd ..
 end
 % }}}
@@ -165,37 +210,37 @@
 if perform(org,'CreateMesh'),
 
-	%create model:
-	md=model();
-
-	%Grab lat,long from MITgcm:
-	long=readbin('run/XG.data',[3 200]);
-	long=[long long(:,end)]; long=[long; -105.1250*ones(1,size(long,2))];
-	lat=readbin('run/YG.data',[3 200]);
-	lat=[lat -73.8832*ones(size(lat,1),1)]; lat=[lat; lat(end,:)];
-
-	%project lat,long:
-	[x,y]=ll2xy(lat(:),long(:),-1);
-
-	Nx=size(lat,1); Ny=size(lat,2)
-	index=[];
-	%  C  D
-	%  A  B
-	for j=1:Ny-1,
-		for i=1:Nx-1,
-			A=(j-1)*Nx+i;
-			B=(j-1)*Nx+i+1;
-			C=j*Nx+i;
-			D=j*Nx+i+1;
-			index(end+1,:)=[A B C];
-			index(end+1,:)=[C B D];
-		end
-	end
-
-	%fill mesh and model:
-	md=meshconvert(md,index,x,y);
-	md.mesh.lat=lat(:);
-	md.mesh.long=long(:);
-
-	savemodel(org,md);
+    loaddata(org,'Parameters');
+
+    %create model:
+    md=model();
+
+    %Grab lat,long from MITgcm:
+    long=readbin('run/XG.data',[Nx Ny]);
+    long=[long long(:,end)]; long=[long; 2*long(Nx,:)-long(Nx-1,:)];
+    lat=readbin('run/YG.data',[Nx Ny]);
+    lat=[lat 2*lat(:,Ny)-lat(:,Ny-1)]; lat=[lat; lat(end,:)];
+
+    %project lat,long:
+    [x,y]=ll2xy(lat(:),long(:),-1);
+    index=[];
+    %  C  D
+    %  A  B
+    for j=1:Ny,
+        for i=1:Nx,
+            A=(j-1)*(Nx+1)+i;
+            B=(j-1)*(Nx+1)+i+1;
+            C=j*(Nx+1)+i;
+            D=j*(Nx+1)+i+1;
+            index(end+1,:)=[A B C];
+            index(end+1,:)=[C B D];
+        end
+    end
+
+    %fill mesh and model:
+    md=meshconvert(md,index,x,y);
+    md.mesh.lat=lat(:);
+    md.mesh.long=long(:);
+
+    savemodel(org,md);
 
 end
@@ -204,34 +249,35 @@
 if perform(org,'MeshGeometry'),
 
-	loaddata(org,'CreateMesh');
-
-	%transfer to vertices:
-	bathymetry=readbin('run/bathy.box',[3 200],1,'real*8');
-	bathymetry=[bathymetry bathymetry(:,end)]; bathymetry=[bathymetry(1,:); bathymetry];
-	iceshelf_mask=-1*ones(size(bathymetry));
-	ice_mask=readbin('run/hmask3.box',[3 200],1,'real*8');
-	ice_mask=[ice_mask ice_mask(:,end)]; ice_mask=[ice_mask(1,:); ice_mask];
-	thickness=readbin('run/h0.bin',[3 200],1,'real*8');
-	thickness=[thickness thickness(:,end)]; thickness=[thickness; thickness(end,:)];
-
-	%start filling some of the fields
-	md.geometry.bed=bathymetry(:);
-	md.geometry.thickness=thickness(:);
-	md.geometry.base=-917/1028*md.geometry.thickness;
-	md.geometry.surface=md.geometry.base+md.geometry.thickness;
-
-	%nothing passes icefront:
-	pos=find((~ice_mask(:) & ice_mask(:)~=0) | thickness(:)==0);
-	md.geometry.thickness(pos)=1;
-	md.geometry.surface(pos)=(1-di)*md.geometry.thickness(pos);
-	md.geometry.base(pos)=-di*md.geometry.thickness(pos);
-
-	%level sets:
-	md.mask.ocean_levelset=iceshelf_mask(:);
-	md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1);
-
-	pos=find(~ice_mask(:) & thickness(:)==0); md.mask.ice_levelset(pos)=1;
-
-	savemodel(org,md);
+    loaddata(org,'Parameters');
+    loaddata(org,'CreateMesh');
+    loaddata(org,'Bathymetry');
+    loaddata(org,'IceSheetGeometry');
+
+    %transfer to vertices:
+    bathymetry=[bathymetry bathymetry(:,end)]; bathymetry=[bathymetry(1,:); bathymetry];
+    ice_mask=[ice_mask ice_mask(:,end)]; ice_mask=[ice_mask(1,:); ice_mask];
+    iceshelf_mask=[iceshelf_mask iceshelf_mask(:,end)]; iceshelf_mask=[iceshelf_mask(1,:); iceshelf_mask];
+    thickness=[thickness thickness(:,end)]; thickness=[thickness; thickness(end,:)];
+
+    %start filling some of the fields
+    md.geometry.bed=bathymetry(:);
+    md.geometry.thickness=thickness(:);
+    md.geometry.base=-917/1028*md.geometry.thickness;
+    md.geometry.surface=md.geometry.base+md.geometry.thickness;
+
+    %nothing passes icefront:
+    pos=find((~ice_mask(:) & ice_mask(:)~=0) | thickness(:)==0);
+    md.geometry.thickness(pos)=1;
+    md.geometry.surface(pos)=(1-di)*md.geometry.thickness(pos);
+    md.geometry.base(pos)=-di*md.geometry.thickness(pos);
+
+    %level sets:
+    md.mask.ice_levelset=iceshelf_mask(:);
+    pos=find(md.mask.ice_levelset==1); md.mask.ice_levelset(pos)=-1;
+    pos=find(md.mask.ice_levelset==0); md.mask.ice_levelset(pos)=1;
+    md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1);
+
+    savemodel(org,md);
+
 end
 % }}}
@@ -278,10 +324,10 @@
 	pos=find(md.mesh.lat==min(md.mesh.lat));
 	md.masstransport.spcthickness(pos)=md.geometry.thickness(pos);
-	md.stressbalance.spcvx(pos)=-800;
-	md.stressbalance.spcvy(pos)=0;
+	md.stressbalance.spcvy(pos)=800;
+	md.stressbalance.spcvx(pos)=0;
 
 	%deal with boundaries, excluding icefront:
 	pos=find(md.mesh.long==min(md.mesh.long) | md.mesh.long==max(md.mesh.long));
-	md.stressbalance.spcvy(pos)=0;
+	md.stressbalance.spcvx(pos)=0;
 
 	point1=find(md.mesh.y==min(md.mesh.y)); point2=find(md.mesh.x==max(md.mesh.x));
@@ -316,5 +362,5 @@
 	md.groundingline.melt_interpolation='NoMeltOnPartiallyFloating';
 	md.groundingline.friction_interpolation='SubelementFriction2';
-	md.masstransport.stabilization=0;
+	md.masstransport.stabilization=1;
 
 	md.cluster=generic('name',oshostname(),'np',2);
@@ -331,381 +377,119 @@
 if perform(org,'RunCoupledMITgcmISSM'),
 
-	loaddata(org,'Parameters');
-	loaddata(org,'ParameterizeIce');
-
-	md=loadmodel(org,'RunUncoupledISSM');
-
-		endtime = round(MITgcmDeltaT * floor(final_time*y2s/MITgcmDeltaT));
-		outputtime = round(MITgcmDeltaT * floor(time_step*y2s/MITgcmDeltaT));
-
-        % {{{ prepare ISSM: start from the steady-state
-
-		  md.geometry.base=md.results.TransientSolution(end).Base;
-		  md.geometry.surface=md.results.TransientSolution(end).Surface;
-		  md.geometry.thickness=md.results.TransientSolution(end).Thickness;
-		  md.initialization.vx=md.results.TransientSolution(end).Vx;
-		  md.initialization.vy=md.results.TransientSolution(end).Vy;
-		  md.initialization.vel=md.results.TransientSolution(end).Vel;
-		  md.initialization.pressure=md.results.TransientSolution(end).Pressure;
-		  md.transient.isoceancoupling=1;
-		  md.transient.isgroundingline=0;
-		  md.masstransport.requested_outputs={'default','BasalforcingsFloatingiceMeltingRate'};
-
-        % }}}
-        % {{{ prepare MITgcm
-        % rename previous run directory and create new one
-        if exist ('run.old')
-            !\rm -rf run.old
-        end
-        if exist ('run')
-            !\mv run run.old
-        end
-        !\mkdir run
-        !\cp ../MITgcm/build/mitgcmuv run
-        !\cp ../MITgcm/install_dngoldberg/verification/shelfice_remeshing/input/* run
-        !\cp ../MITgcm/input_4003/* run
-        % }}}
-		  md.timestepping.coupling_time=time_step;
-		  md.timestepping.time_step=time_step;
-		  md.timestepping.final_time=final_time-time_step;
-		  md.cluster.npocean=nPx*nPy;
-		  md.cluster.np=2;
-		  md.cluster.executionpath=[pwd '/run'];
-		  md.transient.requested_outputs={'default','MaskOceanLevelset'};
-
-		  md=solveiceocean(md,'Transient','runtimename',false);
-
-%	%eval(['!mpiexec -np ' int2str(md.cluster.np) ' ' md.cluster.codepath '/issm_ocean.exe TransientSolution ' pwd ' ' md.miscellaneous.name ' ']);
-%	eval(['!mpiexec -np ' int2str(md.cluster.np) ' ' md.cluster.codepath '/issm_ocean.exe TransientSolution ' pwd ' ' md.miscellaneous.name ' : -np ' int2str(nPx*nPy) ' ./mitgcmuv']);
-end
-% }}}
-% {{{ RunCoupledMITgcmISSMMatlabCoupling:
-if perform(org,'RunCoupledMITgcmISSMMatlabCoupling'),
-
-	%load data:
-	loaddata(org,'Parameters');
-	loaddata(org,'ParameterizeIce');
-	loaddata(org,'Bathymetry');
-	loaddata(org,'IceSheetGeometry');
-        endtime = round(MITgcmDeltaT * ...
-         floor(time_step*y2s*async_step_MITgcm_multiplier/MITgcmDeltaT));
-
-        % {{{ prepare MITgcm
-        % rename previous run directory and create new one
-        if exist ('run.old')
-            !\rm -rf run.old
-        end
-        if exist ('run')
-            !\mv run run.old
-        end
-        !\mkdir run
-        !\cp ../MITgcm/build/mitgcmuv run
-        !\cp ../MITgcm/input/* run
-        !\cp ../MITgcm/input/eedata_uncoupled run/eedata
-
-        % initial salinity
-        S=iniSalt*ones(Nx,Ny,Nz);
-        writebin('run/Salt.bin',S);
-
-        % initial temperature
-        T=iniTheta*ones(Nx,Ny,Nz);
-        writebin('run/Theta.bin',T);
-
-        % initial velocity
-        Z=zeros(Nx,Ny,Nz);
-        writebin('run/Uvel.bin',Z);
-        writebin('run/Vvel.bin',Z);
-
-        % initial sea surface height
-        Z=zeros(Nx,Ny);
-        writebin('run/Etan.bin',Z);
-
-        % salinity boundary conditions
-        S=obcSalt*ones(Ny,Nz);
-        thk=delZ*ones(Nz,1);
-        bot=cumsum(thk);
-        ik=find(bot<=mlDepth);
-        S(:,ik)=mlSalt;
-        writebin('run/OBs.bin',S);
-
-        % temperature boundary conditions
-        T=obcTheta*ones(Ny,Nz);
-        T(:,ik)=mlTheta;
-        writebin('run/OBt.bin',T);
-
-        % zonal velocity boundary conditions
-        U=obcUvel*ones(Ny,Nz);
-        writebin('run/OBu.bin',U);
-
-        % zero boundary conditions
-        Z=zeros(Ny,Nz);
-        writebin('run/zeros.bin',Z);
-
-        % build parameter file data.obcs
-        fidi=fopen('../MITgcm/input/data.obcs','r');
-        fido=fopen('run/data.obcs','w');
-        tline = fgetl(fidi);
-        fprintf(fido,'%s\n',tline);
-        while 1
-            tline = fgetl(fidi);
-            if ~ischar(tline), break, end
-            %do the change here:
-            if strcmpi(tline,' OB_Iwest = 40*1,'),
-                fprintf(fido,'%s%i%s\n',' OB_Iwest = ',Ny,'*1,');
-                continue;
-            end
-            if strcmpi(tline,' OB_Ieast = 40*-1,'),
-                fprintf(fido,'%s%i%s\n',' OB_Ieast = ',Ny,'*-1,');
-                continue;
-            end
-            fprintf(fido,'%s\n',tline);
-        end
-        %close  files
-        fclose(fidi);
-        fclose(fido);
-
-        %save bathymetry in MITgcm run directory
-        writebin('run/bathymetry.bin',bathymetry);
-        % }}}
-
-	% {{{ ISSM settings:
-
-	setenv('DYLD_LIBRARY_PATH', '/usr/local/gfortran/lib')
-	%timestepping:
-	md.timestepping.start_time=start_time;
-	md.timestepping.final_time=final_time;
-	md.timestepping.time_step=time_step;
-	md.cluster=generic('name',oshostname(),'np',2);
-	md.results.TransientSolution.Base=md.geometry.base;
-	md.transient.isgroundingline=1;
-	md.transient.isthermal=0;
-	md.groundingline.migration='SubelementMigration';
-	md.groundingline.melt_interpolation='NoMeltOnPartiallyFloating';
-	md.groundingline.friction_interpolation='SubelementFriction2';
-
-	% }}}
-
-	%start looping:
-	results=md.results;
-
-	for t=start_time:time_step:final_time
-            disp(['Year: ' num2str(t)])
-
-	    %send draft from ISSM to MITgcm:
-	    draft=md.results.TransientSolution(end).Base;
-	    pos=find(md.mask.ice_levelset>0); draft(pos)=0;
-            if t>start_time
-                old_draft=readbin('run/icetopo.bin',[Nx,Ny]);
-            end
-            writebin('run/icetopo.bin',draft);
-
-	    % {{{ generate MITgcm parameter file data
-	    fidi=fopen('../MITgcm/input/data','r');
-	    fido=fopen('run/data','w');
-	    tline = fgetl(fidi);
-	    fprintf(fido,'%s\n',tline);
-            while 1
-                tline = fgetl(fidi);
-                if ~ischar(tline), break, end
-		%do the change here:
-		if strcmpi(tline,' xgOrigin = 0.0,'),
-		    fprintf(fido,'%s%i%s\n',' xgOrigin = ',xgOrigin,',');
-		    continue;
-		end
-		if strcmpi(tline,' ygOrigin = -80.0,'),
-		    fprintf(fido,'%s%i%s\n',' ygOrigin = ',ygOrigin,',');
-		    continue;
-		end
-		if strcmpi(tline,' delX = 20*0.25,'),
-		    fprintf(fido,'%s%i*%g%s\n',' delX = ',Nx,dLong,',');
-		    continue;
-		end
-		if strcmpi(tline,' delY = 20*0.25,'),
-		    fprintf(fido,'%s%i*%g%s\n',' delY = ',Ny,dLat,',');
-		    continue;
-		end
-                if strcmpi(tline,' delZ = 30*30.0,'),
-                    fprintf(fido,'%s%i*%g%s\n',' delZ = ',Nz,delZ,',');
-                    continue;
-                end
-		if strcmpi(tline,' endTime=2592000.,'),
-		    fprintf(fido,'%s%i%s\n',' endTime= ',endtime,',');
-		    continue;
-		end
-		if strcmpi(tline,' deltaT=1200.0,'),
-		    fprintf(fido,'%s%i%s\n',' deltaT= ',MITgcmDeltaT,',');
-		    continue;
-		end
-		if strcmpi(tline,' pChkptFreq=2592000.,'),
-		    fprintf(fido,'%s%i%s\n',' pChkptFreq= ',endtime,',');
-		    continue;
-		end
-		if strcmpi(tline,' taveFreq=2592000.,'),
-		    fprintf(fido,'%s%i%s\n',' taveFreq= ',endtime,',');
-		    continue;
-		end
-                if strcmpi(tline,' rhoConst=1030.,'),
-                    fprintf(fido,'%s%i%s\n',' rhoConst= ',rho_water,',');
-                    continue;
-                end
-                if strcmpi(tline,' rhoNil=1030.,'),
-                    fprintf(fido,'%s%i%s\n',' rhoNil= ',rho_water,',');
-                    continue;
-                end
-		fprintf(fido,'%s\n',tline);
-	    end
-	    %close  files
-	    fclose(fidi);
-	    fclose(fido);
-	    % }}}
-
-	    % {{{ generate initial MITgcm conditions
-            ds=round(endtime/MITgcmDeltaT);
-            if t>start_time
-                % Read pickup file
-                fnm=['run/pickup.' myint2str(ds,10) '.data'];
-                U=readbin(fnm,[Nx Ny Nz],1,'real*8',0);
-                V=readbin(fnm,[Nx Ny Nz],1,'real*8',1);
-                T=readbin(fnm,[Nx Ny Nz],1,'real*8',2);
-                S=readbin(fnm,[Nx Ny Nz],1,'real*8',3);
-                E=readbin(fnm,[Nx Ny],1,'real*8',8*Nz);
-
-                % find indices of locations where ice shelf retreated
-                h=readbin('run/hFacC.data',[Nx Ny Nz]);
-                msk=sum(h,3);
-                msk(find(msk))=1;
-                [iw jw]=find(msk); % horizontal indices where there is water
-                tmp=reshape(draft,[Nx,Ny])-old_draft;
-                tmp(find(tmp<0))=0;
-                [im jm]=find(tmp); % horizontal indices where there is melt
-
-                % Extrapolate T/S to locations where ice shelf retreated
-                for i=1:length(im)
-
-                    % first try vertical extrapolation
-                    in=find(h(im(i),jm(i),:));
-                    if length(in)>0;
-                        S(im(i),jm(i),1:min(in)  ) = S(im(i),jm(i),min(in));
-                        T(im(i),jm(i),1:min(in)  ) = T(im(i),jm(i),min(in));
-                        continue
-                    end
-
-                    % if not succesful, use closest neighbor horizontal extrapolation
-                    [y c]=min((iw-im(i)).^2+(jw-jm(i)).^2);
-                    salt=squeeze(S(iw(c),jw(c),:)); % salinity profile of closest neighbor
-                    temp=squeeze(T(iw(c),jw(c),:)); % salinity profile of closest neighbor
-                    in=find(h(iw(c),jw(c),:));
-                    salt(1:min(in))=salt(min(in));
-                    temp(1:min(in))=temp(min(in));
-                    salt(max(in):end)=salt(max(in));
-                    temp(max(in):end)=temp(max(in));
-                    S(im(i),jm(i),:)=salt;
-                    T(im(i),jm(i),:)=temp;
-                end
-
-                % Write initial conditions
-                writebin('run/Salt.bin' ,S);
-                writebin('run/Theta.bin',T);
-                writebin('run/Uvel.bin' ,U);
-                writebin('run/Vvel.bin' ,V);
-                writebin('run/Etan.bin' ,E);
-            end
-            % }}}
-
-            % {{{ system call to run MITgcm
-            cd run
-            eval(['!mpiexec -np ' int2str(nPx*nPy) ' ./mitgcmuv']);
-            ts=round((t+time_step)*y2s/MITgcmDeltaT);
-            eval(['!\mv STDERR.0000 STDERR_' myint2str(ts,10) '.data'])
-            eval(['!\mv STDOUT.0000 STDOUT_' myint2str(ts,10) '.data'])
-            eval(['!\cp hFacC.data hFacC_' myint2str(ts,10) '.data'])
-            eval(['!\cp icetopo.bin icetopo_' myint2str(ts,10) '.data'])
-            for fld={'S','T','U','V','Eta', ...
-                     'SHICE_heatFluxtave','SHICE_fwFluxtave'}
-                eval(['!\mv ' fld{1} '.' myint2str(ds,10) '.data ' ...
-                      fld{1} '_' myint2str(ts,10) '.data'])
-            end
-            cd ..
-            % }}}
-
-	    %get melting rates from MITgcm
-	    %upward fresh water flux (kg/m^2/s):
-	    fnm=['run/SHICE_fwFluxtave_' myint2str(ts,10) '.data'];
-	    melting_rate=readbin(fnm,[Nx Ny]);
-
-	    %send averaged melting rate to ISSM
-	    %downward fresh water flux (m/y):
-	    melting_rate=-melting_rate(:)*y2s/rho_ice;
-		 md.basalforcings.floatingice_melting_rate=melting_rate;
-
-	    % {{{ run ISSM and recover results
-
-	    md.timestepping.start_time=t;
-	    md.timestepping.final_time=t+time_step;;
-		md=solve(md,'Transient');
-
-		base=md.results.TransientSolution(end).Base;
-		thickness=md.results.TransientSolution(end).Thickness;
-		md.geometry.base=base;
-		md.geometry.thickness=thickness;
-		md.geometry.surface=md.geometry.base+md.geometry.thickness;
-		md.initialization.vx=md.results.TransientSolution(end).Vx;
-		md.initialization.vy=md.results.TransientSolution(end).Vy;
-		md.initialization.vel=md.results.TransientSolution(end).Vel;
-		md.initialization.pressure=md.results.TransientSolution(end).Pressure;
-		md.mask.ocean_levelset=md.results.TransientSolution(end).MaskOceanLevelset;
-		md.results.TransientSolution(end).FloatingiceMeltingRate=md.basalforcings.floatingice_melting_rate;
-
-		%save these results in the model, otherwise, they'll be wiped out
-		results(end+1)=md.results;
-
-		% }}}
-
-
-	end
-
-	md.results=results;
-	savemodel(org,md);
-end
-% }}}
-
-%Fields and tolerances to track changes
-fnm=['run/SHICE_fwFlux.0000011400.data'];
-melting_rate_1=readbin(fnm,[Nx Ny]);
-fnm=['run/SHICE_fwFlux.0000011450.data'];
-melting_rate_2=readbin(fnm,[Nx Ny]);
-fnm=['run/SHICE_fwFlux.0000011500.data'];
-melting_rate_3=readbin(fnm,[Nx Ny]);
-fnm=['run/SHICE_fwFlux.0000011550.data'];
-melting_rate_4=readbin(fnm,[Nx Ny]);
-field_names     ={'Base1','Melting1','Vx2','Vy2','Thickness2','Base2','MaskOceanLevelset2','FloatingiceMeltingRate2',...
-	'Melting2','Vx3','Vy3','Thickness3','Base3','MaskOceanLevelset3','FloatingiceMeltingRate3',...
-	'Melting3','Vx4','Vy4','Thickness4','Base4','MaskOceanLevelset4','FloatingiceMeltingRate4','Melting4'};
-field_tolerances={2e-13,1e-13,7e-13,7e-13,1e-13,1e-13,1e-13,1e-12,...
-	1e-13, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13, 1e-12,...
-	1e-13, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13, 1e-12, 1e-13 };
-field_values={...
-	(md.results.TransientSolution(1).Base),...
-	(melting_rate_1(:)),...
-	(md.results.TransientSolution(2).Vx),...
-	(md.results.TransientSolution(2).Vy),...
-	(md.results.TransientSolution(2).Thickness),...
-	(md.results.TransientSolution(2).Base),...
-	(md.results.TransientSolution(2).MaskOceanLevelset),...
-	(md.results.TransientSolution(2).BasalforcingsFloatingiceMeltingRate),...
-	(melting_rate_2(:)),...
-	(md.results.TransientSolution(3).Vx),...
-	(md.results.TransientSolution(3).Vy),...
-	(md.results.TransientSolution(3).Thickness),...
-	(md.results.TransientSolution(3).Base),...
-	(md.results.TransientSolution(3).MaskOceanLevelset),...
-	(md.results.TransientSolution(3).BasalforcingsFloatingiceMeltingRate),...
-	(melting_rate_3(:)),...
-	(md.results.TransientSolution(4).Vx),...
-	(md.results.TransientSolution(4).Vy),...
-	(md.results.TransientSolution(4).Thickness),...
-	(md.results.TransientSolution(4).Base),...
-	(md.results.TransientSolution(4).MaskOceanLevelset),...
-	(md.results.TransientSolution(4).BasalforcingsFloatingiceMeltingRate),...
-	(melting_rate_4(:)),...
-	};
+    loaddata(org,'Parameters');
+    loaddata(org,'Bathymetry');
+    loaddata(org,'IceSheetGeometry');
+    loaddata(org,'ParameterizeIce');
+    md=loadmodel(org,'RunUncoupledISSM');
+
+    % {{{ prepare ISSM: start from the steady-state
+
+    md.geometry.base=md.results.TransientSolution(end).Base;
+    md.geometry.surface=md.results.TransientSolution(end).Surface;
+    md.geometry.thickness=md.results.TransientSolution(end).Thickness;
+    md.initialization.vx=md.results.TransientSolution(end).Vx;
+    md.initialization.vy=md.results.TransientSolution(end).Vy;
+    md.initialization.vel=md.results.TransientSolution(end).Vel;
+    md.initialization.pressure=md.results.TransientSolution(end).Pressure;
+    md.transient.isoceancoupling=1;
+    md.transient.isgroundingline=0;
+    md.masstransport.requested_outputs={'default','BasalforcingsFloatingiceMeltingRate'};
+
+    % }}}
+    % {{{ prepare MITgcm
+    % rename previous run directory and create new one
+    if exist ('run.old')
+        !\rm -rf run.old
+    end
+    if exist ('run')
+        !\mv run run.old
+    end
+    !\mkdir run
+    !\cp ../MITgcm/build/mitgcmuv run
+    !\cp ../MITgcm/input_4003/* run
+    
+    % {{{ Construct MITgcm binary input files
+    namF='run/bathy_flat.bin';
+    fid=fopen(namF,'w','b'); fwrite(fid,bathymetry,prec);fclose(fid);
+    
+    namF='run/shelficeTopo.Lin.bin';
+    fid=fopen(namF,'w','b'); fwrite(fid,draft,prec);fclose(fid);
+    
+    var=([1:Ny]-2)/(jEnd-2);
+    dMdt_fy=zeros(Nx,Ny);
+    for i=1:Nx
+        dMdt_fy(i,:)=-cos(pi*var);
+        dMdt_fy(i,1)=0; dMdt_fy(i,j2:Ny)=0;
+    end    
+    %- rate of change due to ice-stream dynamics
+    rateDyn=rho_water*0.1/3600;  sfx='r02';
+    dMdt=rateDyn*dMdt_fy;
+    namF=sprintf('%s.%s.%s','run/shelfice_dMdt',sfx,'bin');
+    fid=fopen(namF,'w','b'); fwrite(fid,dMdt,prec);fclose(fid);
+
+    T_sfc = -1.9;
+    T_bot = 2;
+    del_T = (T_bot - T_sfc)/(59*delZ);
+    tref=zeros(1,Nz);
+    for k = 1:Nz;
+        tref(k) = T_sfc + del_T*((k-20)*delZ);
+        tref(k)= max(T_sfc,min(tref(k),T_bot));
+    end
+    namF='run/temp_obc.bin';
+    tref=[tref; tref; tref];
+    fid=fopen(namF,'w','b'); fwrite(fid,tref,prec);fclose(fid);
+
+    S_sfc = 34.2;
+    S_bot = 34.7;
+    del_S = (S_bot - S_sfc)/(59*delZ);
+    sref=zeros(1,Nz);
+    for k = 1:Nz;
+        sref(k) = S_sfc + del_S*((k-20)*delZ);
+        sref(k)= max(S_sfc,min(sref(k),S_bot));
+    end
+    namF='run/salt_obc.bin';
+    sref=[sref; sref; sref];
+    fid=fopen(namF,'w','b'); fwrite(fid,sref,prec);fclose(fid);
+
+    zax=[1:Nz];
+    v1=2.5e-2;
+    var=1+Nz-2*zax; var=var/(Nz-1);
+    vobc=v1*var;
+    namF='run/vVel_obc.bin';
+    vobc=[vobc; vobc; vobc];
+    fid=fopen(namF,'w','b'); fwrite(fid,vobc,prec);fclose(fid);
+
+    var=zeros(Nx,Ny,Nz);
+    for i=1:Nx, for j=1:Ny
+            var(i,j,:)=tref(1,:);
+        end, end
+    namF='run/temp_ini.bin';
+    fid=fopen(namF,'w','b'); fwrite(fid,var,prec);fclose(fid);
+
+    for i=1:Nx, for j=1:Ny
+            var(i,j,:)=sref(1,:);
+        end, end
+    namF='run/salt_ini.bin';
+    fid=fopen(namF,'w','b'); fwrite(fid,var,prec);fclose(fid);
+
+    rhoAvr=rho_water-1.345;
+    mIce=-rhoAvr*draft;
+    namF='run/shelficeMass.Lin.bin';
+    fid=fopen(namF,'w','b'); fwrite(fid,mIce,prec);fclose(fid);
+    % }}}
+    % }}}
+
+    md.timestepping.coupling_time=1/24/365;          % 1 hour in decimal years
+    md.timestepping.time_step=1/24/365;              % 1 hour in decimal years
+    md.timestepping.final_time=23/24/365;            % hour 23 in decimal years
+    md.cluster.npocean=nPx*nPy;
+    md.cluster.np=2;
+    md.cluster.executionpath=[pwd '/run'];
+    md.transient.requested_outputs={'default','MaskOceanLevelset'};
+
+    md=solveiceocean(md,'Transient','runtimename',false);
+
+%eval(['!mpiexec -np ' int2str(md.cluster.np) ' ' md.cluster.codepath '/issm_ocean.exe TransientSolution ' pwd ' ' md.miscellaneous.name ' ']);
+%eval(['!mpiexec -np ' int2str(md.cluster.np) ' ' md.cluster.codepath '/issm_ocean.exe TransientSolution ' pwd ' ' md.miscellaneous.name ' : -np ' int2str(nPx*nPy) ' ./mitgcmuv']);
+end
+% }}}
Index: /issm/trunk/test/NightlyRun/test417.m
===================================================================
--- /issm/trunk/test/NightlyRun/test417.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test417.m	(revision 26744)
@@ -21,5 +21,6 @@
 %partitioning
 npart=20;
-partition=partitioner(md,'package','chaco','npart',npart,'weighting','on')-1;
+[partition,md]=partitioner(md,'package','chaco','npart',npart,'weighting','on');
+partition=partition-1;
 md.qmu.isdakota=1;
 
Index: /issm/trunk/test/NightlyRun/test418.m
===================================================================
--- /issm/trunk/test/NightlyRun/test418.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test418.m	(revision 26744)
@@ -9,5 +9,5 @@
 %partitioning
 npart=100;
-[partition, md]=partitioner(md,'package','chaco','npart',npart);
+[partition,md]=partitioner(md,'package','chaco','npart',npart);
 partition=partition-1;
 
Index: /issm/trunk/test/NightlyRun/test418.py
===================================================================
--- /issm/trunk/test/NightlyRun/test418.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test418.py	(revision 26744)
@@ -25,5 +25,5 @@
 npart = 100
 
-# Partitioner seamed to generate the following message,
+# Partitioner seemed to generate the following message,
 #
 #	corrupted size vs. prev_size
Index: /issm/trunk/test/NightlyRun/test440.py
===================================================================
--- /issm/trunk/test/NightlyRun/test440.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test440.py	(revision 26744)
@@ -1,4 +1,5 @@
 #Test Name: SquareSheetShelfDakotaScaledResponseLinearPart
 import numpy as np
+from socket import gethostname
 from model import *
 from triangle import *
@@ -15,5 +16,5 @@
 md = parameterize(md, '../Par/SquareSheetShelf.py')
 md = setflowequation(md, 'SSA', 'all')
-md.cluster = generic('name', oshostname(), 'np', 3)
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 #partitioning
Index: /issm/trunk/test/NightlyRun/test444.py
===================================================================
--- /issm/trunk/test/NightlyRun/test444.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test444.py	(revision 26744)
@@ -2,5 +2,5 @@
 
 # TODO:
-# - Figure out why test fails intermittently on Mac with "IndexError: list 
+# - Figure out why test fails intermittently on Mac with "IndexError: list
 # index out of range"
 #
@@ -10,5 +10,5 @@
 from ContourToMesh import *
 from dmeth_params_set import *
-from MatlabFuncs import oshostname
+from socket import gethostname
 from model import *
 from parameterize import *
@@ -37,5 +37,5 @@
 md.settings.output_frequency = 3
 md = setflowequation(md, 'SSA', 'all')
-md.cluster = generic('name', oshostname(), 'np', 3)
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 regionalmask = np.zeros((md.mesh.numberofvertices, ))
Index: /issm/trunk/test/NightlyRun/test446.m
===================================================================
--- /issm/trunk/test/NightlyRun/test446.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test446.m	(revision 26744)
@@ -0,0 +1,26 @@
+%Test Name: SquareSheetShelfStressMLHO2d
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
+md=SetMLHOBC(md);
+md=solve(md,'Stressbalance');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx','Vy','Vel','Pressure','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+   (md.results.StressbalanceSolution.Vx),...
+   (md.results.StressbalanceSolution.Vy),...
+   (md.results.StressbalanceSolution.Vel),...
+   (md.results.StressbalanceSolution.Pressure),...
+   (md.results.StressbalanceSolution.VxSurface),...
+   (md.results.StressbalanceSolution.VySurface),...
+   (md.results.StressbalanceSolution.VxShear),...
+   (md.results.StressbalanceSolution.VyShear),...
+   (md.results.StressbalanceSolution.VxBase),...
+   (md.results.StressbalanceSolution.VyBase),...
+   };
+
Index: /issm/trunk/test/NightlyRun/test446.py
===================================================================
--- /issm/trunk/test/NightlyRun/test446.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test446.py	(revision 26744)
@@ -0,0 +1,32 @@
+#Test Name: SquareSheetShelfStressMLHO2d
+from model import *
+from socket import gethostname
+
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
+md = SetMLHOBC(md);
+md = solve(md, 'Stressbalance')
+
+#Fields and tolerances to track changes
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.VxSurface,
+                md.results.StressbalanceSolution.VySurface,
+                md.results.StressbalanceSolution.VxShear,
+                md.results.StressbalanceSolution.VyShear,
+                md.results.StressbalanceSolution.VxBase,
+                md.results.StressbalanceSolution.VyBase]
Index: /issm/trunk/test/NightlyRun/test447.m
===================================================================
--- /issm/trunk/test/NightlyRun/test447.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test447.m	(revision 26744)
@@ -0,0 +1,69 @@
+%Test Name: SquareSheetShelfTranMLHO2d
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md.geometry.bed=md.geometry.base;
+pos=find(md.mask.ocean_levelset<0);
+md.geometry.bed(pos)=md.geometry.base(pos)-10;
+md.friction=frictioncoulomb();
+md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
+md.friction.p=ones(md.mesh.numberofelements,1);
+md.friction.q=ones(md.mesh.numberofelements,1);
+md.friction.coefficientcoulomb=0.02*ones(md.mesh.numberofvertices,1);
+md.transient.isthermal=0;
+md.transient.isgroundingline=1;
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.transient.requested_outputs={'default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'};
+md=SetMLHOBC(md);
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names={...
+	'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',...
+	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2',...
+	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3'...
+};
+field_tolerances={...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
+};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).GroundedArea),...
+	(md.results.TransientSolution(1).FloatingArea),...
+	(md.results.TransientSolution(1).TotalFloatingBmb),...
+	(md.results.TransientSolution(1).TotalGroundedBmb),...
+	(md.results.TransientSolution(1).TotalSmb),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).GroundedArea),...
+	(md.results.TransientSolution(2).FloatingArea),...
+	(md.results.TransientSolution(2).TotalFloatingBmb),...
+	(md.results.TransientSolution(2).TotalGroundedBmb),...
+	(md.results.TransientSolution(2).TotalSmb),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).Base),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).GroundedArea),...
+	(md.results.TransientSolution(3).FloatingArea),...
+	(md.results.TransientSolution(3).TotalFloatingBmb),...
+	(md.results.TransientSolution(3).TotalGroundedBmb),...
+	(md.results.TransientSolution(3).TotalSmb),...
+};
Index: /issm/trunk/test/NightlyRun/test447.py
===================================================================
--- /issm/trunk/test/NightlyRun/test447.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test447.py	(revision 26744)
@@ -0,0 +1,81 @@
+#Test Name: SquareSheetShelfTranMLHO2d
+import numpy as np
+from model import *
+from socket import gethostname
+from triangle import triangle
+from setmask import setmask
+from parameterize import parameterize
+from setflowequation import setflowequation
+from solve import solve
+from SetMLHOBC import SetMLHOBC
+from frictioncoulomb import frictioncoulomb
+from generic import generic
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.geometry.bed = copy.deepcopy(md.geometry.base)
+pos = np.nonzero(md.mask.ocean_levelset < 0.)
+md.geometry.bed[pos] = md.geometry.bed[pos] - 10
+md.friction = frictioncoulomb()
+md.friction.coefficient = 20 * np.ones(md.mesh.numberofvertices)
+md.friction.p = 1 * np.ones(md.mesh.numberofelements)
+md.friction.q = 1 * np.ones(md.mesh.numberofelements)
+md.friction.coefficientcoulomb = 0.02 * np.ones(md.mesh.numberofvertices)
+md.transient.isthermal = False
+md.transient.isgroundingline = True
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
+md = SetMLHOBC(md)
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = [
+    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1',
+    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2',
+    'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3'
+]
+field_tolerances = [
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+]
+field_values = [
+    md.results.TransientSolution[0].Vx,
+    md.results.TransientSolution[0].Vy,
+    md.results.TransientSolution[0].Vel,
+    md.results.TransientSolution[0].Pressure,
+    md.results.TransientSolution[0].Base,
+    md.results.TransientSolution[0].Surface,
+    md.results.TransientSolution[0].Thickness,
+    md.results.TransientSolution[0].GroundedArea,
+    md.results.TransientSolution[0].FloatingArea,
+    md.results.TransientSolution[0].TotalFloatingBmb,
+    md.results.TransientSolution[0].TotalGroundedBmb,
+    md.results.TransientSolution[0].TotalSmb,
+    md.results.TransientSolution[1].Vx,
+    md.results.TransientSolution[1].Vy,
+    md.results.TransientSolution[1].Vel,
+    md.results.TransientSolution[1].Pressure,
+    md.results.TransientSolution[1].Base,
+    md.results.TransientSolution[1].Surface,
+    md.results.TransientSolution[1].Thickness,
+    md.results.TransientSolution[1].GroundedArea,
+    md.results.TransientSolution[1].FloatingArea,
+    md.results.TransientSolution[1].TotalFloatingBmb,
+    md.results.TransientSolution[1].TotalGroundedBmb,
+    md.results.TransientSolution[1].TotalSmb,
+    md.results.TransientSolution[2].Vx,
+    md.results.TransientSolution[2].Vy,
+    md.results.TransientSolution[2].Vel,
+    md.results.TransientSolution[2].Pressure,
+    md.results.TransientSolution[2].Base,
+    md.results.TransientSolution[2].Surface,
+    md.results.TransientSolution[2].Thickness,
+    md.results.TransientSolution[2].GroundedArea,
+    md.results.TransientSolution[2].FloatingArea,
+    md.results.TransientSolution[2].TotalFloatingBmb,
+    md.results.TransientSolution[2].TotalGroundedBmb,
+    md.results.TransientSolution[2].TotalSmb
+]
Index: /issm/trunk/test/NightlyRun/test448.m
===================================================================
--- /issm/trunk/test/NightlyRun/test448.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test448.m	(revision 26744)
@@ -0,0 +1,54 @@
+%Test Name: RoundSheetShelfGLMigrationMLHO2d
+radius=1.e6;
+shelfextent=2.e5;
+
+md=roundmesh(model(),radius,50000.);
+%fix center node to 0,0
+rad=sqrt(md.mesh.x.^2+md.mesh.y.^2);
+pos=find(rad==min(rad));
+md.mesh.x(pos)=0.; md.mesh.y(pos)=0.; %the closest node to the center is changed to be exactly at the center
+xelem=mean(md.mesh.x(md.mesh.elements),2);
+yelem=mean(md.mesh.y(md.mesh.elements),2);
+rad=sqrt(xelem.^2+yelem.^2);
+flags=zeros(md.mesh.numberofelements,1);
+pos=find(rad>=(radius-shelfextent));
+flags(pos)=1;
+md=setmask(md,flags,''); 
+md=parameterize(md,'../Par/RoundSheetShelf.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+
+md.transient.isthermal=0;
+md.transient.ismasstransport=0;
+md.transient.issmb=1;
+md.transient.isstressbalance=1;
+md.transient.isgroundingline=1;
+
+md=SetMLHOBC(md);
+%test different grounding line dynamics.
+md.groundingline.migration='AggressiveMigration';
+md=solve(md,'Transient');
+element_on_iceshelf_agressive=(md.results.TransientSolution.MaskOceanLevelset);
+vel_agressive=(md.results.TransientSolution.Vel);
+
+md.groundingline.migration='SoftMigration';
+md=solve(md,'Transient');
+element_on_iceshelf_soft=(md.results.TransientSolution.MaskOceanLevelset);
+vel_soft=(md.results.TransientSolution.Vel);
+
+md.mask.ocean_levelset=md.geometry.thickness + md.materials.rho_water/md.materials.rho_ice*md.geometry.bed;
+md.groundingline.migration='SubelementMigration';
+md.groundingline.friction_interpolation='SubelementFriction1';
+md=solve(md,'Transient');
+element_on_iceshelf_subelement=(md.results.TransientSolution.MaskOceanLevelset);
+vel_subelement=(md.results.TransientSolution.Vel);
+
+md.groundingline.friction_interpolation='SubelementFriction2';
+md=solve(md,'Transient');
+element_on_iceshelf_subelement2=(md.results.TransientSolution.MaskOceanLevelset);
+vel_subelement2=(md.results.TransientSolution.Vel);
+
+%Fields and tolerances to track changes
+field_names     ={'ElementOnIceShelfAggressive','VelAggressive','ElementOnIceShelfSoft','VelSoft','ElementOnIceShelfSubelement','VelSubelement','ElementOnIceShelfSubelement2','VelSubelement2'};
+field_tolerances={1e-13,2e-12,1e-13,2e-12,1e-13,3e-12,1e-13,2e-12};
+field_values={element_on_iceshelf_agressive,vel_agressive,element_on_iceshelf_soft,vel_soft,element_on_iceshelf_subelement,vel_subelement,element_on_iceshelf_subelement2,vel_subelement2};
Index: /issm/trunk/test/NightlyRun/test448.py
===================================================================
--- /issm/trunk/test/NightlyRun/test448.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test448.py	(revision 26744)
@@ -0,0 +1,65 @@
+#Test Name: RoundSheetShelfGLMigrationMLHO2d
+import numpy as np
+from model import *
+from socket import gethostname
+from roundmesh import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+
+radius = 1.e6
+shelfextent = 2.e5
+
+md = roundmesh(model(), radius, 50000.)
+#fix center node to 0, 0
+rad = np.sqrt(md.mesh.x**2 + md.mesh.y**2)
+pos = np.argmin(rad)
+md.mesh.x[pos] = 0.
+md.mesh.y[pos] = 0.  #the closest node to the center is changed to be exactly at the center
+xelem = np.mean(md.mesh.x[md.mesh.elements - 1], axis=1)
+yelem = np.mean(md.mesh.y[md.mesh.elements - 1], axis=1)
+rad = np.sqrt(xelem**2 + yelem**2)
+flags = np.zeros(md.mesh.numberofelements)
+pos = np.nonzero(rad >= (radius - shelfextent))
+flags[pos] = 1
+md = setmask(md, flags, '')
+md = parameterize(md, '../Par/RoundSheetShelf.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+
+md.transient.isthermal = False
+md.transient.ismasstransport = False
+md.transient.issmb = True
+md.transient.isstressbalance = True
+md.transient.isgroundingline = True
+
+#test different grounding line dynamics.
+md.groundingline.migration = 'AggressiveMigration'
+md = SetMLHOBC(md);
+md = solve(md, 'Transient')
+element_on_iceshelf_agressive = md.results.TransientSolution[0].MaskOceanLevelset
+vel_agressive = md.results.TransientSolution[0].Vel
+
+md.groundingline.migration = 'SoftMigration'
+md = solve(md, 'Transient')
+element_on_iceshelf_soft = md.results.TransientSolution[0].MaskOceanLevelset
+vel_soft = md.results.TransientSolution[0].Vel
+
+md.mask.ocean_levelset = md.geometry.thickness + md.materials.rho_water / md.materials.rho_ice * md.geometry.bed
+md.groundingline.migration = 'SubelementMigration'
+md.groundingline.friction_interpolation = 'SubelementFriction1'
+md = solve(md, 'Transient')
+element_on_iceshelf_subelement = md.results.TransientSolution[0].MaskOceanLevelset
+vel_subelement = md.results.TransientSolution[0].Vel
+
+md.groundingline.friction_interpolation = 'SubelementFriction2'
+md = solve(md, 'Transient')
+element_on_iceshelf_subelement2 = md.results.TransientSolution[0].MaskOceanLevelset
+vel_subelement2 = md.results.TransientSolution[0].Vel
+
+#Fields and tolerances to track changes
+field_names = ['ElementOnIceShelfAggressive', 'VelAggressive', 'ElementOnIceShelfSoft', 'VelSoft', 'ElementOnIceShelfSubelement', 'VelSubelement', 'ElementOnIceShelfSubelement2', 'VelSubelement2']
+field_tolerances = [1e-13, 2e-13, 1e-13, 2e-13, 1e-13, 2e-13, 1e-13, 2e-13]
+field_values = [element_on_iceshelf_agressive, vel_agressive, element_on_iceshelf_soft, vel_soft, element_on_iceshelf_subelement, vel_subelement, element_on_iceshelf_subelement2, vel_subelement2]
Index: /issm/trunk/test/NightlyRun/test449.m
===================================================================
--- /issm/trunk/test/NightlyRun/test449.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test449.m	(revision 26744)
@@ -0,0 +1,82 @@
+%Test Name: MISMIP3DMLHO
+md=triangle(model(),'../Exp/Square.exp',100000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md.initialization.vx(:)=1.;
+md.initialization.vy(:)=1.;
+md.geometry.thickness(:)=500-md.mesh.x/10000;
+md.geometry.bed =-100-md.mesh.x/1000;
+md.geometry.base=-md.geometry.thickness*md.materials.rho_ice/md.materials.rho_water;
+md.mask.ocean_levelset=md.geometry.thickness+md.materials.rho_water/md.materials.rho_ice*md.geometry.bed;
+pos=find(md.mask.ocean_levelset>=0);
+md.geometry.base(pos)=md.geometry.bed(pos);
+md.geometry.surface=md.geometry.base+md.geometry.thickness;
+md=setflowequation(md,'MLHO','all');
+
+%Boundary conditions:
+md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1);
+md.mask.ice_levelset(find(md.mesh.x==max(md.mesh.x)))=0;
+md.stressbalance.spcvx(:)=NaN;
+md.stressbalance.spcvy(:)=NaN;
+md.stressbalance.spcvz(:)=NaN;
+pos=find((md.mesh.y<1000000.1 & md.mesh.y>999999.9) | (md.mesh.y<0.1 & md.mesh.y>-0.1));
+md.stressbalance.spcvy(pos)=0;
+pos2=find(md.mesh.x<0.1 & md.mesh.x>-0.1);
+md.stressbalance.spcvx(pos2)=0;
+md.stressbalance.spcvy(pos2)=0;
+
+md.materials.rheology_B=1/((10^-25)^(1/3))*ones(md.mesh.numberofvertices,1);
+md.materials.rheology_law='None';
+md.friction.coefficient(:)=sqrt(10^7)*ones(md.mesh.numberofvertices,1);
+md.friction.p=3*ones(md.mesh.numberofelements,1);
+md.smb.mass_balance(:)=1;
+md.basalforcings.groundedice_melting_rate(:)=0;
+md.basalforcings.floatingice_melting_rate(:)=30;
+md.transient.isthermal=0;
+md.transient.isstressbalance=1;
+md.transient.isgroundingline=1;
+md.transient.ismasstransport=1;
+md.transient.issmb=1;
+md.transient.requested_outputs={'default','BasalforcingsFloatingiceMeltingRate'};
+md.groundingline.migration='SubelementMigration';
+md.groundingline.melt_interpolation='SubelementMelt1';
+md.timestepping.final_time=30;
+md.timestepping.time_step=10;
+
+md.cluster=generic('name',oshostname(),'np',3);
+md=SetMLHOBC(md);
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names     ={'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Pressure1','FloatingiceMeltingrate1',...
+	'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Pressure2','FloatingiceMeltingrate2',...
+	'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Pressure3','FloatingiceMeltingrate3'};
+field_tolerances={2e-11,5e-12,2e-11,1e-11,5e-10,1e-08,1e-13,1e-13,...
+	3e-11,3e-11,9e-10,7e-11,1e-09,5e-08,1e-10,1e-13,...
+	1e-10,3e-11,1e-10,7e-11,1e-09,5e-08,1e-10,1e-13};
+field_values={...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).MaskOceanLevelset),...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).BasalforcingsFloatingiceMeltingRate),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).MaskOceanLevelset),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).BasalforcingsFloatingiceMeltingRate),...
+	(md.results.TransientSolution(3).Base),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).MaskOceanLevelset),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).BasalforcingsFloatingiceMeltingRate),...
+	};
Index: /issm/trunk/test/NightlyRun/test449.py
===================================================================
--- /issm/trunk/test/NightlyRun/test449.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test449.py	(revision 26744)
@@ -0,0 +1,97 @@
+#Test Name: MISMIP3DMLHO
+import numpy as np
+from model import *
+from socket import gethostname
+from triangle import triangle
+from setmask import setmask
+from parameterize import parameterize
+from setflowequation import setflowequation
+from solve import solve
+from SetMLHOBC import SetMLHOBC
+from generic import generic
+
+
+md = triangle(model(), '../Exp/Square.exp', 100000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.initialization.vx[:] = 1.
+md.initialization.vy[:] = 1.
+md.geometry.thickness[:] = 500. - md.mesh.x / 10000.
+md.geometry.bed = -100. - md.mesh.x / 1000.
+md.geometry.base = -md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water
+md.mask.ocean_levelset = md.geometry.thickness + md.materials.rho_water / md.materials.rho_ice * md.geometry.bed
+pos = np.where(md.mask.ocean_levelset >= 0.)
+md.geometry.base[pos] = md.geometry.bed[pos]
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+md = setflowequation(md, 'MLHO', 'all')
+
+#Boundary conditions:
+md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices, ))
+md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0.
+md.stressbalance.spcvx[:] = float('NaN')
+md.stressbalance.spcvy[:] = float('NaN')
+md.stressbalance.spcvz[:] = float('NaN')
+posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)), np.array(np.where(md.mesh.y > 999999.9)))
+posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > -0.1)))
+pos = np.unique(np.concatenate((posA, posB)))
+md.stressbalance.spcvy[pos] = 0.
+pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > -0.1)))
+md.stressbalance.spcvx[pos2] = 0.
+md.stressbalance.spcvy[pos2] = 0.
+
+md.materials.rheology_B = 1. / ((10**-25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices, ))
+md.materials.rheology_law = 'None'
+md.friction.coefficient[:] = np.sqrt(10**7) * np.ones((md.mesh.numberofvertices, ))
+md.friction.p = 3. * np.ones((md.mesh.numberofelements, ))
+md.smb.mass_balance[:] = 1.
+md.basalforcings.groundedice_melting_rate[:] = 0.
+md.basalforcings.floatingice_melting_rate[:] = 30.
+md.transient.isthermal = 0
+md.transient.isstressbalance = 1
+md.transient.isgroundingline = 1
+md.transient.ismasstransport = 1
+md.transient.issmb = 1
+md.transient.requested_outputs = ['default', 'BasalforcingsFloatingiceMeltingRate']
+md.groundingline.migration = 'SubelementMigration'
+md.groundingline.melt_interpolation = 'SubelementMelt1'
+md.timestepping.final_time = 30
+md.timestepping.time_step = 10
+
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = SetMLHOBC(md)
+md = solve(md, 'Transient')
+#print md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate
+#print md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate
+#print md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate
+
+#Fields and tolerances to track changes
+field_names = ['Bed1', 'Surface1', 'Thickness1', 'Floatingice1', 'Vx1', 'Vy1', 'Pressure1', 'FloatingiceMeltingrate1',
+               'Bed2', 'Surface2', 'Thickness2', 'Floatingice2', 'Vx2', 'Vy2', 'Pressure2', 'FloatingiceMeltingrate2',
+               'Bed3', 'Surface3', 'Thickness3', 'Floatingice3', 'Vx3', 'Vy3', 'Pressure3', 'FloatingiceMeltingrate3']
+field_tolerances = [2e-11, 5e-12, 2e-11, 1e-11, 5e-10, 1e-08, 1e-13, 1e-13,
+                    3e-11, 3e-11, 9e-10, 7e-11, 1e-09, 5e-08, 1e-10, 1e-13,
+                    1e-10, 3e-11, 1e-10, 7e-11, 1e-09, 5e-08, 1e-10, 1e-13]
+field_values = [md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].MaskOceanLevelset,
+                md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].MaskOceanLevelset,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].MaskOceanLevelset,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test455.m
===================================================================
--- /issm/trunk/test/NightlyRun/test455.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test455.m	(revision 26744)
@@ -14,5 +14,5 @@
 	md=solve(md,'Stressbalance');
 	field_names     ={field_names{:},['Vx' i{1}],['Vy' i{1}],['Vz' i{1}],['Vel' i{1}],['Pressure' i{1}]};
-	field_tolerances={field_tolerances{:},7e-08,6e-08,6e-08,6e-08,3e-13};
+	field_tolerances={field_tolerances{:},8e-08,6e-08,6e-08,6e-08,3e-13};
 	field_values={field_values{:},...
 	(md.results.StressbalanceSolution.Vx),...
Index: /issm/trunk/test/NightlyRun/test455.py
===================================================================
--- /issm/trunk/test/NightlyRun/test455.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test455.py	(revision 26744)
@@ -23,5 +23,5 @@
     md = solve(md, 'Stressbalance')
     field_names = field_names + ['Vx' + i, 'Vy' + i, 'Vz' + i, 'Vel' + i, 'Pressure' + i]
-    field_tolerances = field_tolerances + [7e-08, 6e-08, 6e-08, 6e-08, 3e-13]
+    field_tolerances = field_tolerances + [8e-08, 6e-08, 6e-08, 6e-08, 3e-13]
     field_values = field_values + [md.results.StressbalanceSolution.Vx,
                                    md.results.StressbalanceSolution.Vy,
Index: /issm/trunk/test/NightlyRun/test481.py
===================================================================
--- /issm/trunk/test/NightlyRun/test481.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test481.py	(revision 26744)
@@ -3,5 +3,5 @@
 
 from frictionschoof import frictionschoof
-from MatlabFuncs import oshostname
+from socket import gethostname
 from model import *
 from parameterize import parameterize
@@ -22,5 +22,5 @@
 md.friction.Cmax = 0.5 * np.ones((md.mesh.numberofvertices, 1))
 md.friction.m    = 1./3.* np.ones((md.mesh.numberofelements, 1))
-md.cluster = generic('name', oshostname(), 'np', 3)
+md.cluster = generic('name', gethostname(), 'np', 3)
 md = solve(md, 'Transient')
 
Index: /issm/trunk/test/NightlyRun/test491.m
===================================================================
--- /issm/trunk/test/NightlyRun/test491.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test491.m	(revision 26744)
@@ -0,0 +1,69 @@
+%Test Name: SquareSheetShelfTranMeltArtDiff
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md.geometry.bed=md.geometry.base;
+pos=find(md.mask.ocean_levelset<0);
+md.geometry.bed(pos)=md.geometry.base(pos)-10;
+md.friction=frictioncoulomb();
+md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
+md.friction.p=ones(md.mesh.numberofelements,1);
+md.friction.q=ones(md.mesh.numberofelements,1);
+md.friction.coefficientcoulomb=0.02*ones(md.mesh.numberofvertices,1);
+md.transient.isthermal=0;
+md.transient.isgroundingline=1;
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.transient.requested_outputs={'default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'};
+md.masstransport.stabilization=1;
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names={...
+	'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',...
+	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2',...
+	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3'...
+};
+field_tolerances={...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
+};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).GroundedArea),...
+	(md.results.TransientSolution(1).FloatingArea),...
+	(md.results.TransientSolution(1).TotalFloatingBmb),...
+	(md.results.TransientSolution(1).TotalGroundedBmb),...
+	(md.results.TransientSolution(1).TotalSmb),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).GroundedArea),...
+	(md.results.TransientSolution(2).FloatingArea),...
+	(md.results.TransientSolution(2).TotalFloatingBmb),...
+	(md.results.TransientSolution(2).TotalGroundedBmb),...
+	(md.results.TransientSolution(2).TotalSmb),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).Base),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).GroundedArea),...
+	(md.results.TransientSolution(3).FloatingArea),...
+	(md.results.TransientSolution(3).TotalFloatingBmb),...
+	(md.results.TransientSolution(3).TotalGroundedBmb),...
+	(md.results.TransientSolution(3).TotalSmb),...
+};
Index: /issm/trunk/test/NightlyRun/test491.py
===================================================================
--- /issm/trunk/test/NightlyRun/test491.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test491.py	(revision 26744)
@@ -0,0 +1,80 @@
+#Test Name: SquareSheetShelfTranMeltArtDiff 
+import numpy as np
+from model import *
+from socket import gethostname
+
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+from frictioncoulomb import frictioncoulomb
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.geometry.bed = copy.deepcopy(md.geometry.base)
+pos = np.nonzero(md.mask.ocean_levelset < 0.)
+md.geometry.bed[pos] = md.geometry.bed[pos] - 10
+md.friction = frictioncoulomb()
+md.friction.coefficient = 20 * np.ones(md.mesh.numberofvertices)
+md.friction.p = 1 * np.ones(md.mesh.numberofelements)
+md.friction.q = 1 * np.ones(md.mesh.numberofelements)
+md.friction.coefficientcoulomb = 0.02 * np.ones(md.mesh.numberofvertices)
+md.transient.isthermal = False
+md.transient.isgroundingline = True
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
+md.masstransport.stabilization = 1
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = [
+    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 
+    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2', 
+    'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3'
+]
+field_tolerances = [
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+]
+field_values = [
+    md.results.TransientSolution[0].Vx,
+    md.results.TransientSolution[0].Vy,
+    md.results.TransientSolution[0].Vel,
+    md.results.TransientSolution[0].Pressure,
+    md.results.TransientSolution[0].Base,
+    md.results.TransientSolution[0].Surface,
+    md.results.TransientSolution[0].Thickness,
+    md.results.TransientSolution[0].GroundedArea,
+    md.results.TransientSolution[0].FloatingArea,
+    md.results.TransientSolution[0].TotalFloatingBmb,
+    md.results.TransientSolution[0].TotalGroundedBmb,
+    md.results.TransientSolution[0].TotalSmb,
+    md.results.TransientSolution[1].Vx,
+    md.results.TransientSolution[1].Vy,
+    md.results.TransientSolution[1].Vel,
+    md.results.TransientSolution[1].Pressure,
+    md.results.TransientSolution[1].Base,
+    md.results.TransientSolution[1].Surface,
+    md.results.TransientSolution[1].Thickness,
+    md.results.TransientSolution[1].GroundedArea,
+    md.results.TransientSolution[1].FloatingArea,
+    md.results.TransientSolution[1].TotalFloatingBmb,
+    md.results.TransientSolution[1].TotalGroundedBmb,
+    md.results.TransientSolution[1].TotalSmb,
+    md.results.TransientSolution[2].Vx,
+    md.results.TransientSolution[2].Vy,
+    md.results.TransientSolution[2].Vel,
+    md.results.TransientSolution[2].Pressure,
+    md.results.TransientSolution[2].Base,
+    md.results.TransientSolution[2].Surface,
+    md.results.TransientSolution[2].Thickness,
+    md.results.TransientSolution[2].GroundedArea,
+    md.results.TransientSolution[2].FloatingArea,
+    md.results.TransientSolution[2].TotalFloatingBmb,
+    md.results.TransientSolution[2].TotalGroundedBmb,
+    md.results.TransientSolution[2].TotalSmb
+]
Index: /issm/trunk/test/NightlyRun/test492.m
===================================================================
--- /issm/trunk/test/NightlyRun/test492.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test492.m	(revision 26744)
@@ -0,0 +1,69 @@
+%Test Name: SquareSheetShelfTranMeltStreamlineUpwind
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md.geometry.bed=md.geometry.base;
+pos=find(md.mask.ocean_levelset<0);
+md.geometry.bed(pos)=md.geometry.base(pos)-10;
+md.friction=frictioncoulomb();
+md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
+md.friction.p=ones(md.mesh.numberofelements,1);
+md.friction.q=ones(md.mesh.numberofelements,1);
+md.friction.coefficientcoulomb=0.02*ones(md.mesh.numberofvertices,1);
+md.transient.isthermal=0;
+md.transient.isgroundingline=1;
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.transient.requested_outputs={'default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'};
+md.masstransport.stabilization=2;
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names={...
+	'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',...
+	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2',...
+	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3'...
+};
+field_tolerances={...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
+};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).GroundedArea),...
+	(md.results.TransientSolution(1).FloatingArea),...
+	(md.results.TransientSolution(1).TotalFloatingBmb),...
+	(md.results.TransientSolution(1).TotalGroundedBmb),...
+	(md.results.TransientSolution(1).TotalSmb),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).GroundedArea),...
+	(md.results.TransientSolution(2).FloatingArea),...
+	(md.results.TransientSolution(2).TotalFloatingBmb),...
+	(md.results.TransientSolution(2).TotalGroundedBmb),...
+	(md.results.TransientSolution(2).TotalSmb),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).Base),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).GroundedArea),...
+	(md.results.TransientSolution(3).FloatingArea),...
+	(md.results.TransientSolution(3).TotalFloatingBmb),...
+	(md.results.TransientSolution(3).TotalGroundedBmb),...
+	(md.results.TransientSolution(3).TotalSmb),...
+};
Index: /issm/trunk/test/NightlyRun/test492.py
===================================================================
--- /issm/trunk/test/NightlyRun/test492.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test492.py	(revision 26744)
@@ -0,0 +1,80 @@
+#Test Name: SquareSheetShelfTranMeltStreamlineUpwind 
+import numpy as np
+from model import *
+from socket import gethostname
+
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+from frictioncoulomb import frictioncoulomb
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.geometry.bed = copy.deepcopy(md.geometry.base)
+pos = np.nonzero(md.mask.ocean_levelset < 0.)
+md.geometry.bed[pos] = md.geometry.bed[pos] - 10
+md.friction = frictioncoulomb()
+md.friction.coefficient = 20 * np.ones(md.mesh.numberofvertices)
+md.friction.p = 1 * np.ones(md.mesh.numberofelements)
+md.friction.q = 1 * np.ones(md.mesh.numberofelements)
+md.friction.coefficientcoulomb = 0.02 * np.ones(md.mesh.numberofvertices)
+md.transient.isthermal = False
+md.transient.isgroundingline = True
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
+md.masstransport.stabilization = 2
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = [
+    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 
+    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2', 
+    'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3'
+]
+field_tolerances = [
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+]
+field_values = [
+    md.results.TransientSolution[0].Vx,
+    md.results.TransientSolution[0].Vy,
+    md.results.TransientSolution[0].Vel,
+    md.results.TransientSolution[0].Pressure,
+    md.results.TransientSolution[0].Base,
+    md.results.TransientSolution[0].Surface,
+    md.results.TransientSolution[0].Thickness,
+    md.results.TransientSolution[0].GroundedArea,
+    md.results.TransientSolution[0].FloatingArea,
+    md.results.TransientSolution[0].TotalFloatingBmb,
+    md.results.TransientSolution[0].TotalGroundedBmb,
+    md.results.TransientSolution[0].TotalSmb,
+    md.results.TransientSolution[1].Vx,
+    md.results.TransientSolution[1].Vy,
+    md.results.TransientSolution[1].Vel,
+    md.results.TransientSolution[1].Pressure,
+    md.results.TransientSolution[1].Base,
+    md.results.TransientSolution[1].Surface,
+    md.results.TransientSolution[1].Thickness,
+    md.results.TransientSolution[1].GroundedArea,
+    md.results.TransientSolution[1].FloatingArea,
+    md.results.TransientSolution[1].TotalFloatingBmb,
+    md.results.TransientSolution[1].TotalGroundedBmb,
+    md.results.TransientSolution[1].TotalSmb,
+    md.results.TransientSolution[2].Vx,
+    md.results.TransientSolution[2].Vy,
+    md.results.TransientSolution[2].Vel,
+    md.results.TransientSolution[2].Pressure,
+    md.results.TransientSolution[2].Base,
+    md.results.TransientSolution[2].Surface,
+    md.results.TransientSolution[2].Thickness,
+    md.results.TransientSolution[2].GroundedArea,
+    md.results.TransientSolution[2].FloatingArea,
+    md.results.TransientSolution[2].TotalFloatingBmb,
+    md.results.TransientSolution[2].TotalGroundedBmb,
+    md.results.TransientSolution[2].TotalSmb
+]
Index: /issm/trunk/test/NightlyRun/test493.m
===================================================================
--- /issm/trunk/test/NightlyRun/test493.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test493.m	(revision 26744)
@@ -0,0 +1,70 @@
+%Test Name: SquareSheetShelfTranMeltDG
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md.geometry.bed=md.geometry.base;
+pos=find(md.mask.ocean_levelset<0);
+md.geometry.bed(pos)=md.geometry.base(pos)-10;
+md.friction=frictioncoulomb();
+md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
+md.friction.p=ones(md.mesh.numberofelements,1);
+md.friction.q=ones(md.mesh.numberofelements,1);
+md.friction.coefficientcoulomb=0.02*ones(md.mesh.numberofvertices,1);
+md.transient.isthermal=0;
+md.transient.isgroundingline=1;
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.transient.requested_outputs={'default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'};
+md.masstransport.stabilization=3;
+md.masstransport.spcthickness=md.geometry.thickness;
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names={...
+	'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',...
+	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2',...
+	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3'...
+};
+field_tolerances={...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	2e-13,2e-13,2e-13,1e-13,1e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
+};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).GroundedArea),...
+	(md.results.TransientSolution(1).FloatingArea),...
+	(md.results.TransientSolution(1).TotalFloatingBmb),...
+	(md.results.TransientSolution(1).TotalGroundedBmb),...
+	(md.results.TransientSolution(1).TotalSmb),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).GroundedArea),...
+	(md.results.TransientSolution(2).FloatingArea),...
+	(md.results.TransientSolution(2).TotalFloatingBmb),...
+	(md.results.TransientSolution(2).TotalGroundedBmb),...
+	(md.results.TransientSolution(2).TotalSmb),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).Base),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).GroundedArea),...
+	(md.results.TransientSolution(3).FloatingArea),...
+	(md.results.TransientSolution(3).TotalFloatingBmb),...
+	(md.results.TransientSolution(3).TotalGroundedBmb),...
+	(md.results.TransientSolution(3).TotalSmb),...
+};
Index: /issm/trunk/test/NightlyRun/test493.py
===================================================================
--- /issm/trunk/test/NightlyRun/test493.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test493.py	(revision 26744)
@@ -0,0 +1,81 @@
+#Test Name: SquareSheetShelfTranMeltDG 
+import numpy as np
+from model import *
+from socket import gethostname
+
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+from frictioncoulomb import frictioncoulomb
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.geometry.bed = copy.deepcopy(md.geometry.base)
+pos = np.nonzero(md.mask.ocean_levelset < 0.)
+md.geometry.bed[pos] = md.geometry.bed[pos] - 10
+md.friction = frictioncoulomb()
+md.friction.coefficient = 20 * np.ones(md.mesh.numberofvertices)
+md.friction.p = 1 * np.ones(md.mesh.numberofelements)
+md.friction.q = 1 * np.ones(md.mesh.numberofelements)
+md.friction.coefficientcoulomb = 0.02 * np.ones(md.mesh.numberofvertices)
+md.transient.isthermal = False
+md.transient.isgroundingline = True
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
+md.masstransport.stabilization = 3
+md.masstransport.spcthickness = md.geometry.thickness
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = [
+    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 
+    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2', 
+    'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3'
+]
+field_tolerances = [
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+]
+field_values = [
+    md.results.TransientSolution[0].Vx,
+    md.results.TransientSolution[0].Vy,
+    md.results.TransientSolution[0].Vel,
+    md.results.TransientSolution[0].Pressure,
+    md.results.TransientSolution[0].Base,
+    md.results.TransientSolution[0].Surface,
+    md.results.TransientSolution[0].Thickness,
+    md.results.TransientSolution[0].GroundedArea,
+    md.results.TransientSolution[0].FloatingArea,
+    md.results.TransientSolution[0].TotalFloatingBmb,
+    md.results.TransientSolution[0].TotalGroundedBmb,
+    md.results.TransientSolution[0].TotalSmb,
+    md.results.TransientSolution[1].Vx,
+    md.results.TransientSolution[1].Vy,
+    md.results.TransientSolution[1].Vel,
+    md.results.TransientSolution[1].Pressure,
+    md.results.TransientSolution[1].Base,
+    md.results.TransientSolution[1].Surface,
+    md.results.TransientSolution[1].Thickness,
+    md.results.TransientSolution[1].GroundedArea,
+    md.results.TransientSolution[1].FloatingArea,
+    md.results.TransientSolution[1].TotalFloatingBmb,
+    md.results.TransientSolution[1].TotalGroundedBmb,
+    md.results.TransientSolution[1].TotalSmb,
+    md.results.TransientSolution[2].Vx,
+    md.results.TransientSolution[2].Vy,
+    md.results.TransientSolution[2].Vel,
+    md.results.TransientSolution[2].Pressure,
+    md.results.TransientSolution[2].Base,
+    md.results.TransientSolution[2].Surface,
+    md.results.TransientSolution[2].Thickness,
+    md.results.TransientSolution[2].GroundedArea,
+    md.results.TransientSolution[2].FloatingArea,
+    md.results.TransientSolution[2].TotalFloatingBmb,
+    md.results.TransientSolution[2].TotalGroundedBmb,
+    md.results.TransientSolution[2].TotalSmb
+]
Index: /issm/trunk/test/NightlyRun/test494.m
===================================================================
--- /issm/trunk/test/NightlyRun/test494.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test494.m	(revision 26744)
@@ -0,0 +1,69 @@
+%Test Name: SquareSheetShelfTranMeltFCT
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md.geometry.bed=md.geometry.base;
+pos=find(md.mask.ocean_levelset<0);
+md.geometry.bed(pos)=md.geometry.base(pos)-10;
+md.friction=frictioncoulomb();
+md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
+md.friction.p=ones(md.mesh.numberofelements,1);
+md.friction.q=ones(md.mesh.numberofelements,1);
+md.friction.coefficientcoulomb=0.02*ones(md.mesh.numberofvertices,1);
+md.transient.isthermal=0;
+md.transient.isgroundingline=1;
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.transient.requested_outputs={'default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'};
+md.masstransport.stabilization=4;
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names={...
+	'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',...
+	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2',...
+	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3'...
+};
+field_tolerances={...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	2e-13,2e-13,2e-13,1e-13,2e-13,4e-13,9e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
+};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).GroundedArea),...
+	(md.results.TransientSolution(1).FloatingArea),...
+	(md.results.TransientSolution(1).TotalFloatingBmb),...
+	(md.results.TransientSolution(1).TotalGroundedBmb),...
+	(md.results.TransientSolution(1).TotalSmb),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).GroundedArea),...
+	(md.results.TransientSolution(2).FloatingArea),...
+	(md.results.TransientSolution(2).TotalFloatingBmb),...
+	(md.results.TransientSolution(2).TotalGroundedBmb),...
+	(md.results.TransientSolution(2).TotalSmb),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).Base),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).GroundedArea),...
+	(md.results.TransientSolution(3).FloatingArea),...
+	(md.results.TransientSolution(3).TotalFloatingBmb),...
+	(md.results.TransientSolution(3).TotalGroundedBmb),...
+	(md.results.TransientSolution(3).TotalSmb),...
+};
Index: /issm/trunk/test/NightlyRun/test494.py
===================================================================
--- /issm/trunk/test/NightlyRun/test494.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test494.py	(revision 26744)
@@ -0,0 +1,80 @@
+#Test Name: SquareSheetShelfTranMeltFCT 
+import numpy as np
+from model import *
+from socket import gethostname
+
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+from frictioncoulomb import frictioncoulomb
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.geometry.bed = copy.deepcopy(md.geometry.base)
+pos = np.nonzero(md.mask.ocean_levelset < 0.)
+md.geometry.bed[pos] = md.geometry.bed[pos] - 10
+md.friction = frictioncoulomb()
+md.friction.coefficient = 20 * np.ones(md.mesh.numberofvertices)
+md.friction.p = 1 * np.ones(md.mesh.numberofelements)
+md.friction.q = 1 * np.ones(md.mesh.numberofelements)
+md.friction.coefficientcoulomb = 0.02 * np.ones(md.mesh.numberofvertices)
+md.transient.isthermal = False
+md.transient.isgroundingline = True
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
+md.masstransport.stabilization = 4
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = [
+    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 
+    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2', 
+    'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3'
+]
+field_tolerances = [
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+    2e-13, 2e-13, 2e-13, 1e-13, 2e-13, 6e-13, 9e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+]
+field_values = [
+    md.results.TransientSolution[0].Vx,
+    md.results.TransientSolution[0].Vy,
+    md.results.TransientSolution[0].Vel,
+    md.results.TransientSolution[0].Pressure,
+    md.results.TransientSolution[0].Base,
+    md.results.TransientSolution[0].Surface,
+    md.results.TransientSolution[0].Thickness,
+    md.results.TransientSolution[0].GroundedArea,
+    md.results.TransientSolution[0].FloatingArea,
+    md.results.TransientSolution[0].TotalFloatingBmb,
+    md.results.TransientSolution[0].TotalGroundedBmb,
+    md.results.TransientSolution[0].TotalSmb,
+    md.results.TransientSolution[1].Vx,
+    md.results.TransientSolution[1].Vy,
+    md.results.TransientSolution[1].Vel,
+    md.results.TransientSolution[1].Pressure,
+    md.results.TransientSolution[1].Base,
+    md.results.TransientSolution[1].Surface,
+    md.results.TransientSolution[1].Thickness,
+    md.results.TransientSolution[1].GroundedArea,
+    md.results.TransientSolution[1].FloatingArea,
+    md.results.TransientSolution[1].TotalFloatingBmb,
+    md.results.TransientSolution[1].TotalGroundedBmb,
+    md.results.TransientSolution[1].TotalSmb,
+    md.results.TransientSolution[2].Vx,
+    md.results.TransientSolution[2].Vy,
+    md.results.TransientSolution[2].Vel,
+    md.results.TransientSolution[2].Pressure,
+    md.results.TransientSolution[2].Base,
+    md.results.TransientSolution[2].Surface,
+    md.results.TransientSolution[2].Thickness,
+    md.results.TransientSolution[2].GroundedArea,
+    md.results.TransientSolution[2].FloatingArea,
+    md.results.TransientSolution[2].TotalFloatingBmb,
+    md.results.TransientSolution[2].TotalGroundedBmb,
+    md.results.TransientSolution[2].TotalSmb
+]
Index: /issm/trunk/test/NightlyRun/test495.m
===================================================================
--- /issm/trunk/test/NightlyRun/test495.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test495.m	(revision 26744)
@@ -0,0 +1,69 @@
+%Test Name: SquareSheetShelfTranMeltSUPG
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md.geometry.bed=md.geometry.base;
+pos=find(md.mask.ocean_levelset<0);
+md.geometry.bed(pos)=md.geometry.base(pos)-10;
+md.friction=frictioncoulomb();
+md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
+md.friction.p=ones(md.mesh.numberofelements,1);
+md.friction.q=ones(md.mesh.numberofelements,1);
+md.friction.coefficientcoulomb=0.02*ones(md.mesh.numberofvertices,1);
+md.transient.isthermal=0;
+md.transient.isgroundingline=1;
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.transient.requested_outputs={'default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'};
+md.masstransport.stabilization=5;
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names={...
+	'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',...
+	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2',...
+	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3'...
+};
+field_tolerances={...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
+};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).GroundedArea),...
+	(md.results.TransientSolution(1).FloatingArea),...
+	(md.results.TransientSolution(1).TotalFloatingBmb),...
+	(md.results.TransientSolution(1).TotalGroundedBmb),...
+	(md.results.TransientSolution(1).TotalSmb),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).GroundedArea),...
+	(md.results.TransientSolution(2).FloatingArea),...
+	(md.results.TransientSolution(2).TotalFloatingBmb),...
+	(md.results.TransientSolution(2).TotalGroundedBmb),...
+	(md.results.TransientSolution(2).TotalSmb),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).Base),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).GroundedArea),...
+	(md.results.TransientSolution(3).FloatingArea),...
+	(md.results.TransientSolution(3).TotalFloatingBmb),...
+	(md.results.TransientSolution(3).TotalGroundedBmb),...
+	(md.results.TransientSolution(3).TotalSmb),...
+};
Index: /issm/trunk/test/NightlyRun/test495.py
===================================================================
--- /issm/trunk/test/NightlyRun/test495.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test495.py	(revision 26744)
@@ -0,0 +1,80 @@
+#Test Name: SquareSheetShelfTranMeltSUPG 
+import numpy as np
+from model import *
+from socket import gethostname
+
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+from frictioncoulomb import frictioncoulomb
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.geometry.bed = copy.deepcopy(md.geometry.base)
+pos = np.nonzero(md.mask.ocean_levelset < 0.)
+md.geometry.bed[pos] = md.geometry.bed[pos] - 10
+md.friction = frictioncoulomb()
+md.friction.coefficient = 20 * np.ones(md.mesh.numberofvertices)
+md.friction.p = 1 * np.ones(md.mesh.numberofelements)
+md.friction.q = 1 * np.ones(md.mesh.numberofelements)
+md.friction.coefficientcoulomb = 0.02 * np.ones(md.mesh.numberofvertices)
+md.transient.isthermal = False
+md.transient.isgroundingline = True
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
+md.masstransport.stabilization = 5
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = [
+    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 
+    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2', 
+    'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3'
+]
+field_tolerances = [
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+]
+field_values = [
+    md.results.TransientSolution[0].Vx,
+    md.results.TransientSolution[0].Vy,
+    md.results.TransientSolution[0].Vel,
+    md.results.TransientSolution[0].Pressure,
+    md.results.TransientSolution[0].Base,
+    md.results.TransientSolution[0].Surface,
+    md.results.TransientSolution[0].Thickness,
+    md.results.TransientSolution[0].GroundedArea,
+    md.results.TransientSolution[0].FloatingArea,
+    md.results.TransientSolution[0].TotalFloatingBmb,
+    md.results.TransientSolution[0].TotalGroundedBmb,
+    md.results.TransientSolution[0].TotalSmb,
+    md.results.TransientSolution[1].Vx,
+    md.results.TransientSolution[1].Vy,
+    md.results.TransientSolution[1].Vel,
+    md.results.TransientSolution[1].Pressure,
+    md.results.TransientSolution[1].Base,
+    md.results.TransientSolution[1].Surface,
+    md.results.TransientSolution[1].Thickness,
+    md.results.TransientSolution[1].GroundedArea,
+    md.results.TransientSolution[1].FloatingArea,
+    md.results.TransientSolution[1].TotalFloatingBmb,
+    md.results.TransientSolution[1].TotalGroundedBmb,
+    md.results.TransientSolution[1].TotalSmb,
+    md.results.TransientSolution[2].Vx,
+    md.results.TransientSolution[2].Vy,
+    md.results.TransientSolution[2].Vel,
+    md.results.TransientSolution[2].Pressure,
+    md.results.TransientSolution[2].Base,
+    md.results.TransientSolution[2].Surface,
+    md.results.TransientSolution[2].Thickness,
+    md.results.TransientSolution[2].GroundedArea,
+    md.results.TransientSolution[2].FloatingArea,
+    md.results.TransientSolution[2].TotalFloatingBmb,
+    md.results.TransientSolution[2].TotalGroundedBmb,
+    md.results.TransientSolution[2].TotalSmb
+]
Index: /issm/trunk/test/NightlyRun/test518.m
===================================================================
--- /issm/trunk/test/NightlyRun/test518.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test518.m	(revision 26744)
@@ -0,0 +1,26 @@
+%Test Name: PigStressMLHO2d
+md=triangle(model(),'../Exp/Pig.exp',20000.);
+md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+md=parameterize(md,'../Par/Pig.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
+md=SetMLHOBC(md);
+md=solve(md,'Stressbalance');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx','Vy','Vel','Pressure','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+   (md.results.StressbalanceSolution.Vx),...
+   (md.results.StressbalanceSolution.Vy),...
+   (md.results.StressbalanceSolution.Vel),...
+   (md.results.StressbalanceSolution.Pressure),...
+   (md.results.StressbalanceSolution.VxSurface),...
+   (md.results.StressbalanceSolution.VySurface),...
+   (md.results.StressbalanceSolution.VxShear),...
+   (md.results.StressbalanceSolution.VyShear),...
+   (md.results.StressbalanceSolution.VxBase),...
+   (md.results.StressbalanceSolution.VyBase),...
+   };
+
Index: /issm/trunk/test/NightlyRun/test518.py
===================================================================
--- /issm/trunk/test/NightlyRun/test518.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test518.py	(revision 26744)
@@ -0,0 +1,32 @@
+#Test Name: PigStressMLHO2d
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+
+md = triangle(model(), '../Exp/Pig.exp', 20000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
+md = SetMLHOBC(md);
+md = solve(md, 'Stressbalance')
+
+#Fields and tolerances to track changes
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.VxSurface,
+                md.results.StressbalanceSolution.VySurface,
+                md.results.StressbalanceSolution.VxShear,
+                md.results.StressbalanceSolution.VyShear,
+                md.results.StressbalanceSolution.VxBase,
+                md.results.StressbalanceSolution.VyBase]
Index: /issm/trunk/test/NightlyRun/test519.m
===================================================================
--- /issm/trunk/test/NightlyRun/test519.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test519.m	(revision 26744)
@@ -0,0 +1,54 @@
+%Test Name: PigTranMLHO2d
+md=triangle(model(),'../Exp/Pig.exp',20000.);
+md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+md=parameterize(md,'../Par/Pig.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.geometry.bed=md.geometry.base;
+[md.mesh.lat,md.mesh.long] = xy2ll(md.mesh.x,md.mesh.y,-1);
+md.mesh.scale_factor=0.9*ones(md.mesh.numberofvertices,1);
+md.transient.requested_outputs={'default','IceVolume','IceVolumeScaled','GroundedArea','GroundedAreaScaled','FloatingArea','FloatingAreaScaled','TotalSmb','TotalSmbScaled','TotalFloatingBmb','TotalFloatingBmbScaled'};
+md=SetMLHOBC(md);
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','IceVolume1','IceVolumeScaled1','GroundedArea1','GroundedAreaScaled1','FloatingArea1','FloatingAreaScaled1','TotalSmb1','TotalSmbScaled1','TotalFloatingBmb1','TotalFloatingBmbScaled1',...
+	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','IceVolume2','IceVolumeScaled2','GroundedArea2','GroundedAreaScaled2','FloatingArea2','FloatingAreaScaled2','TotalSmb2','TotalSmbScaled2','TotalFloatingBmb2','TotalFloatingBmbScaled2'};
+field_tolerances={1e-12,2e-12,2e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	1e-12,1e-12,1e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).IceVolume),...
+	(md.results.TransientSolution(1).IceVolumeScaled),...
+	(md.results.TransientSolution(1).GroundedArea),...
+	(md.results.TransientSolution(1).GroundedAreaScaled),...
+	(md.results.TransientSolution(1).FloatingArea),...
+	(md.results.TransientSolution(1).FloatingAreaScaled),...
+	(md.results.TransientSolution(1).TotalSmb),...
+	(md.results.TransientSolution(1).TotalSmbScaled),...
+	(md.results.TransientSolution(1).TotalFloatingBmb),...
+	(md.results.TransientSolution(1).TotalFloatingBmbScaled),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).IceVolume),...
+	(md.results.TransientSolution(2).IceVolumeScaled),...
+	(md.results.TransientSolution(2).GroundedArea),...
+	(md.results.TransientSolution(2).GroundedAreaScaled),...
+	(md.results.TransientSolution(2).FloatingArea),...
+	(md.results.TransientSolution(2).FloatingAreaScaled),...
+	(md.results.TransientSolution(2).TotalSmb),...
+	(md.results.TransientSolution(2).TotalSmbScaled),...
+	(md.results.TransientSolution(2).TotalFloatingBmb),...
+	(md.results.TransientSolution(2).TotalFloatingBmbScaled),...
+	};
Index: /issm/trunk/test/NightlyRun/test519.py
===================================================================
--- /issm/trunk/test/NightlyRun/test519.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test519.py	(revision 26744)
@@ -0,0 +1,85 @@
+#Test Name: PigTranMLHO2d
+import numpy as np
+from model import *
+from socket import gethostname
+from triangle import triangle
+from setmask import setmask
+from parameterize import parameterize
+from setflowequation import setflowequation
+from solve import solve
+from SetMLHOBC import SetMLHOBC
+from generic import generic
+
+md = triangle(model(), '../Exp/Pig.exp', 20000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.mesh.scale_factor = 0.9 * np.ones((md.mesh.numberofvertices))
+md.transient.requested_outputs = ['default', 'IceVolume', 'IceVolumeScaled', 'GroundedArea', 'GroundedAreaScaled', 'FloatingArea', 'FloatingAreaScaled', 'TotalSmb', 'TotalSmbScaled', 'TotalFloatingBmb', 'TotalFloatingBmbScaled']
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = SetMLHOBC(md)
+md = solve(md, 'Transient')
+
+# Fields and tolerances to track changes
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1',
+               'Bed1', 'Surface1', 'Thickness1',
+               'IceVolume1', 'IceVolumeScaled1',
+               'GroundedArea1', 'GroundedAreaScaled1',
+               'FloatingArea1', 'FloatingAreaScaled1',
+               'TotalSmb1', 'TotalSmbScaled1',
+               'TotalFloatingBmb1', 'TotalFloatingBmbScaled1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2',
+               'Bed2', 'Surface2', 'Thickness2',
+               'IceVolume2', 'IceVolumeScaled2',
+               'GroundedArea2', 'GroundedAreaScaled2',
+               'FloatingArea2', 'FloatingAreaScaled2',
+               'TotalSmb2', 'TotalSmbScaled2',
+               'TotalFloatingBmb2', 'TotalFloatingBmbScaled2']
+field_tolerances = [1e-12, 2e-12, 2e-12, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13,
+                    1e-13, 1e-13,
+                    1e-12, 1e-12,
+                    1e-12, 1e-13,
+                    1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13,
+                    1e-13, 1e-13,
+                    1e-13, 1e-13,
+                    1e-13, 1e-13,
+                    1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].IceVolume,
+                md.results.TransientSolution[0].IceVolumeScaled,
+                md.results.TransientSolution[0].GroundedArea,
+                md.results.TransientSolution[0].GroundedAreaScaled,
+                md.results.TransientSolution[0].FloatingArea,
+                md.results.TransientSolution[0].FloatingAreaScaled,
+                md.results.TransientSolution[0].TotalSmb,
+                md.results.TransientSolution[0].TotalSmbScaled,
+                md.results.TransientSolution[0].TotalFloatingBmb,
+                md.results.TransientSolution[0].TotalFloatingBmbScaled,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].IceVolume,
+                md.results.TransientSolution[1].IceVolumeScaled,
+                md.results.TransientSolution[1].GroundedArea,
+                md.results.TransientSolution[1].GroundedAreaScaled,
+                md.results.TransientSolution[1].FloatingArea,
+                md.results.TransientSolution[1].FloatingAreaScaled,
+                md.results.TransientSolution[1].TotalSmb,
+                md.results.TransientSolution[1].TotalSmbScaled,
+                md.results.TransientSolution[1].TotalFloatingBmb,
+                md.results.TransientSolution[1].TotalFloatingBmbScaled]
Index: /issm/trunk/test/NightlyRun/test540.m
===================================================================
--- /issm/trunk/test/NightlyRun/test540.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test540.m	(revision 26744)
@@ -16,4 +16,6 @@
 pos = find(md.mesh.vertexonboundary);
 md.levelset.spclevelset(pos) = md.mask.ice_levelset(pos);
+md.levelset.migration_max = 1e10;
+md.transient.requested_outputs={'default','IceVolume','IceVolumeAboveFloatation','TotalSmb','TotalGroundedBmb','TotalFloatingBmb'};
 
 %Force MUMPS sequential analysis
@@ -25,11 +27,17 @@
 field_names ={...
 	'Vx1' ,'Vy1' ,'Vel1' ,'Pressure1' ,'Bed1' ,'Surface1' ,'Thickness1' ,'MaskIceLevelset1' ,...
+	'IceVolume1' ,'IceVolumeAboveFloatation1' ,'TotalSmb1' ,'TotalGroundedBmb1' ,'TotalFloatingBmb1' ,...
 	'Vx2' ,'Vy2' ,'Vel2' ,'Pressure2' ,'Bed2' ,'Surface2' ,'Thickness2' ,'MaskIceLevelset2' ,...
+	'IceVolume2' ,'IceVolumeAboveFloatation2' ,'TotalSmb2' ,'TotalGroundedBmb2' ,'TotalFloatingBmb2' ,...
 	'Vx10','Vy10','Vel10','Pressure10','Bed10','Surface10','Thickness10','MaskIceLevelset10',...
+	'IceVolume10' ,'IceVolumeAboveFloatation10' ,'TotalSmb10' ,'TotalGroundedBmb10' ,'TotalFloatingBmb10' ,...
 	};
 field_tolerances={...
 	1e-12,2e-12,2e-12,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	1e-12,2e-12,2e-12,1e-13,1e-13,...
 	1e-12,1e-12,1e-12,1e-13,1e-13,1e-13,1e-13,1e-12,...
+	1e-12,2e-12,2e-12,1e-13,1e-13,...
 	1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-9,...
+	1e-12,2e-12,2e-12,1e-13,1e-13,...
 	};
 field_values={...
@@ -42,4 +50,9 @@
 	(md.results.TransientSolution(1).Thickness),...
 	(md.results.TransientSolution(1).MaskIceLevelset),...
+	(md.results.TransientSolution(1).IceVolume),...
+	(md.results.TransientSolution(1).IceVolumeAboveFloatation),...
+	(md.results.TransientSolution(1).TotalSmb),...
+	(md.results.TransientSolution(1).TotalGroundedBmb),...
+	(md.results.TransientSolution(1).TotalFloatingBmb),...
 	(md.results.TransientSolution(2).Vx),...
 	(md.results.TransientSolution(2).Vy),...
@@ -50,4 +63,9 @@
 	(md.results.TransientSolution(2).Thickness),...
 	(md.results.TransientSolution(2).MaskIceLevelset),...
+	(md.results.TransientSolution(2).IceVolume),...
+	(md.results.TransientSolution(2).IceVolumeAboveFloatation),...
+	(md.results.TransientSolution(2).TotalSmb),...
+	(md.results.TransientSolution(2).TotalGroundedBmb),...
+	(md.results.TransientSolution(2).TotalFloatingBmb),...
 	(md.results.TransientSolution(10).Vx),...
 	(md.results.TransientSolution(10).Vy),...
@@ -58,3 +76,8 @@
 	(md.results.TransientSolution(10).Thickness),...
 	(md.results.TransientSolution(10).MaskIceLevelset),...
+	(md.results.TransientSolution(10).IceVolume),...
+	(md.results.TransientSolution(10).IceVolumeAboveFloatation),...
+	(md.results.TransientSolution(10).TotalSmb),...
+	(md.results.TransientSolution(10).TotalGroundedBmb),...
+	(md.results.TransientSolution(10).TotalFloatingBmb),...
 	};
Index: /issm/trunk/test/NightlyRun/test540.py
===================================================================
--- /issm/trunk/test/NightlyRun/test540.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test540.py	(revision 26744)
@@ -1,11 +1,12 @@
 #Test Name: PigTranCalvingDevSSA2d
+import numpy as np
+from calvingvonmises import *
+from socket import gethostname
 from model import *
-from socket import gethostname
-from triangle import *
-from setmask import *
 from parameterize import *
 from setflowequation import *
+from setmask import *
 from solve import *
-from calvingvonmises import *
+from triangle import *
 
 md = triangle(model(), '../Exp/Pig.exp', 10000.)
@@ -22,7 +23,9 @@
 md.transient.ismovingfront = 1
 md.transient.isgroundingline = 1
-md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, ))
+md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices, ))
 pos = np.where(md.mesh.vertexonboundary)
 md.levelset.spclevelset[pos] = md.mask.ice_levelset[pos]
+md.levelset.migration_max = 1e10
+md.transient.requested_outputs = ['default', 'IceVolume', 'IceVolumeAboveFloatation','TotalSmb','TotalGroundedBmb','TotalFloatingBmb']
 
 #Force MUMPS sequential analysis
@@ -33,9 +36,15 @@
 #Fields and tolerances to track changes
 field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'MaskIceLevelset1',
+               'IceVolume1', 'IceVolumeAboveFloatation1', 'TotalSmb1', 'TotalGroundedBmb1', 'TotalFloatingBmb1',
                'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'MaskIceLevelset2',
-               'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10']
+               'IceVolume2', 'IceVolumeAboveFloatation2', 'TotalSmb2', 'TotalGroundedBmb2', 'TotalFloatingBmb2',
+               'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10',
+               'IceVolume10', 'IceVolumeAboveFloatation10', 'TotalSmb10', 'TotalGroundedBmb10', 'TotalFloatingBmb10']
 field_tolerances = [1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13,
                     1e-12, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-12,
-                    1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-9]
+                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13,
+                    1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-9,
+                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13]
 field_values = [md.results.TransientSolution[0].Vx,
                 md.results.TransientSolution[0].Vy,
@@ -46,4 +55,9 @@
                 md.results.TransientSolution[0].Thickness,
                 md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[0].IceVolume,
+                md.results.TransientSolution[0].IceVolumeAboveFloatation,
+                md.results.TransientSolution[0].TotalSmb,
+                md.results.TransientSolution[0].TotalGroundedBmb,
+                md.results.TransientSolution[0].TotalFloatingBmb,
                 md.results.TransientSolution[1].Vx,
                 md.results.TransientSolution[1].Vy,
@@ -54,4 +68,9 @@
                 md.results.TransientSolution[1].Thickness,
                 md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[1].IceVolume,
+                md.results.TransientSolution[1].IceVolumeAboveFloatation,
+                md.results.TransientSolution[1].TotalSmb,
+                md.results.TransientSolution[1].TotalGroundedBmb,
+                md.results.TransientSolution[1].TotalFloatingBmb,
                 md.results.TransientSolution[9].Vx,
                 md.results.TransientSolution[9].Vy,
@@ -61,3 +80,8 @@
                 md.results.TransientSolution[9].Surface,
                 md.results.TransientSolution[9].Thickness,
-                md.results.TransientSolution[9].MaskIceLevelset]
+                md.results.TransientSolution[9].MaskIceLevelset,
+                md.results.TransientSolution[9].IceVolume,
+                md.results.TransientSolution[9].IceVolumeAboveFloatation,
+                md.results.TransientSolution[9].TotalSmb,
+                md.results.TransientSolution[9].TotalGroundedBmb,
+                md.results.TransientSolution[9].TotalFloatingBmb]
Index: /issm/trunk/test/NightlyRun/test541.m
===================================================================
--- /issm/trunk/test/NightlyRun/test541.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test541.m	(revision 26744)
@@ -16,4 +16,6 @@
 pos = find(md.mesh.vertexonboundary);
 md.levelset.spclevelset(pos) = md.mask.ice_levelset(pos);
+md.levelset.migration_max = 1e10;
+md.transient.requested_outputs={'default','IceVolume','IceVolumeAboveFloatation','TotalSmb','TotalGroundedBmb','TotalFloatingBmb'};
 
 %Force MUMPS sequential analysis
@@ -25,11 +27,17 @@
 field_names ={...
 	'Vx1' ,'Vy1' ,'Vel1' ,'Pressure1' ,'Bed1' ,'Surface1' ,'Thickness1' ,'MaskIceLevelset1' ,...
+	'IceVolume1' ,'IceVolumeAboveFloatation1' ,'TotalSmb1' ,'TotalGroundedBmb1' ,'TotalFloatingBmb1' ,...
 	'Vx2' ,'Vy2' ,'Vel2' ,'Pressure2' ,'Bed2' ,'Surface2' ,'Thickness2' ,'MaskIceLevelset2' ,...
+	'IceVolume2' ,'IceVolumeAboveFloatation2' ,'TotalSmb2' ,'TotalGroundedBmb2' ,'TotalFloatingBmb2' ,...
 	'Vx10','Vy10','Vel10','Pressure10','Bed10','Surface10','Thickness10','MaskIceLevelset10',...
+	'IceVolume10' ,'IceVolumeAboveFloatation10' ,'TotalSmb10' ,'TotalGroundedBmb10' ,'TotalFloatingBmb10' ,...
 	};
 field_tolerances={...
 	1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,...
-	2e-11,1e-11,1e-11,9e-12,2e-1,2e-11,2e-11,1e-11,...
+	1e-11,2e-11,2e-11,1e-12,2e-11,...
+	2e-11,1e-11,1e-11,9e-12,2e-11,2e-11,2e-11,1e-11,...
+	1e-11,2e-11,2e-11,8e-08,2e-11,...
 	2e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,...
+	1e-11,2e-11,2e-11,8e-08,2e-11,...
 	};
 field_values={...
@@ -42,4 +50,9 @@
 	(md.results.TransientSolution(1).Thickness),...
 	(md.results.TransientSolution(1).MaskIceLevelset),...
+	(md.results.TransientSolution(1).IceVolume),...
+	(md.results.TransientSolution(1).IceVolumeAboveFloatation),...
+	(md.results.TransientSolution(1).TotalSmb),...
+	(md.results.TransientSolution(1).TotalGroundedBmb),...
+	(md.results.TransientSolution(1).TotalFloatingBmb),...
 	(md.results.TransientSolution(2).Vx),...
 	(md.results.TransientSolution(2).Vy),...
@@ -50,4 +63,9 @@
 	(md.results.TransientSolution(2).Thickness),...
 	(md.results.TransientSolution(2).MaskIceLevelset),...
+	(md.results.TransientSolution(2).IceVolume),...
+	(md.results.TransientSolution(2).IceVolumeAboveFloatation),...
+	(md.results.TransientSolution(2).TotalSmb),...
+	(md.results.TransientSolution(2).TotalGroundedBmb),...
+	(md.results.TransientSolution(2).TotalFloatingBmb),...
 	(md.results.TransientSolution(10).Vx),...
 	(md.results.TransientSolution(10).Vy),...
@@ -58,3 +76,8 @@
 	(md.results.TransientSolution(10).Thickness),...
 	(md.results.TransientSolution(10).MaskIceLevelset),...
+	(md.results.TransientSolution(10).IceVolume),...
+	(md.results.TransientSolution(10).IceVolumeAboveFloatation),...
+	(md.results.TransientSolution(10).TotalSmb),...
+	(md.results.TransientSolution(10).TotalGroundedBmb),...
+	(md.results.TransientSolution(10).TotalFloatingBmb),...
 	};
Index: /issm/trunk/test/NightlyRun/test541.py
===================================================================
--- /issm/trunk/test/NightlyRun/test541.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test541.py	(revision 26744)
@@ -1,11 +1,12 @@
-#Test Name: PigTranCalvingDevd
+#Test Name: PigTranCalvingDevdHO3d
+import numpy as np
+from calvingvonmises import *
+from socket import gethostname
 from model import *
-from socket import gethostname
-from triangle import *
-from setmask import *
 from parameterize import *
 from setflowequation import *
+from setmask import *
 from solve import *
-from calvingvonmises import *
+from triangle import *
 
 md = triangle(model(), '../Exp/Pig.exp', 10000.)
@@ -22,7 +23,9 @@
 md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))
 md.transient.ismovingfront = 1
-md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, ))
+md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices, ))
 pos = np.where(md.mesh.vertexonboundary)
 md.levelset.spclevelset[pos] = md.mask.ice_levelset[pos]
+md.levelset.migration_max = 1e10
+md.transient.requested_outputs = ['default', 'IceVolume', 'IceVolumeAboveFloatation','TotalSmb','TotalGroundedBmb','TotalFloatingBmb']
 
 #Force MUMPS sequential analysis
@@ -33,9 +36,15 @@
 #Fields and tolerances to track changes
 field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'MaskIceLevelset1',
+               'IceVolume1', 'IceVolumeAboveFloatation1', 'TotalSmb1', 'TotalGroundedBmb1', 'TotalFloatingBmb1',
                'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'MaskIceLevelset2',
-               'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10']
+               'IceVolume2', 'IceVolumeAboveFloatation2', 'TotalSmb2', 'TotalGroundedBmb2', 'TotalFloatingBmb2',
+               'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10',
+               'IceVolume10', 'IceVolumeAboveFloatation10', 'TotalSmb10', 'TotalGroundedBmb10', 'TotalFloatingBmb10']
 field_tolerances = [1e-11, 2e-11, 2e-11, 1e-12, 2e-11, 6e-12, 9e-12, 1e-12,
-                    2e-11, 1e-11, 1e-11, 9e-12, 2e-1, 2e-11, 2e-11, 1e-11,
-                    2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9]
+                    1e-11, 2e-11, 2e-11, 1e-12, 2e-11,
+                    2e-11, 1e-11, 1e-11, 9e-12, 2e-11, 2e-11, 2e-11, 1e-11,
+                    1e-11, 2e-11, 2e-11, 8e-08, 2e-11,
+                    2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9,
+                    1e-11, 2e-11, 2e-11, 8e-08, 2e-11]
 field_values = [md.results.TransientSolution[0].Vx,
                 md.results.TransientSolution[0].Vy,
@@ -46,4 +55,9 @@
                 md.results.TransientSolution[0].Thickness,
                 md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[0].IceVolume,
+                md.results.TransientSolution[0].IceVolumeAboveFloatation,
+                md.results.TransientSolution[0].TotalSmb,
+                md.results.TransientSolution[0].TotalGroundedBmb,
+                md.results.TransientSolution[0].TotalFloatingBmb,
                 md.results.TransientSolution[1].Vx,
                 md.results.TransientSolution[1].Vy,
@@ -54,4 +68,9 @@
                 md.results.TransientSolution[1].Thickness,
                 md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[1].IceVolume,
+                md.results.TransientSolution[1].IceVolumeAboveFloatation,
+                md.results.TransientSolution[1].TotalSmb,
+                md.results.TransientSolution[1].TotalGroundedBmb,
+                md.results.TransientSolution[1].TotalFloatingBmb,
                 md.results.TransientSolution[9].Vx,
                 md.results.TransientSolution[9].Vy,
@@ -61,3 +80,8 @@
                 md.results.TransientSolution[9].Surface,
                 md.results.TransientSolution[9].Thickness,
-                md.results.TransientSolution[9].MaskIceLevelset]
+                md.results.TransientSolution[9].MaskIceLevelset,
+                md.results.TransientSolution[9].IceVolume,
+                md.results.TransientSolution[9].IceVolumeAboveFloatation,
+                md.results.TransientSolution[9].TotalSmb,
+                md.results.TransientSolution[9].TotalGroundedBmb,
+                md.results.TransientSolution[9].TotalFloatingBmb]
Index: /issm/trunk/test/NightlyRun/test542.m
===================================================================
--- /issm/trunk/test/NightlyRun/test542.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test542.m	(revision 26744)
@@ -0,0 +1,84 @@
+%Test Name: PigTranFrontalforcingsrignot
+md=triangle(model(),'../Exp/Pig.exp',10000.);
+md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+md=parameterize(md,'../Par/Pig.par');
+md=setflowequation(md,'SSA','all');
+md.timestepping.time_step=2;
+md.timestepping.final_time=50;
+
+%separate domain in 2 basins
+idbasin = zeros(md.mesh.numberofelements,1);
+iid1    = find(md.mesh.x<=-1.6e6);
+for ii=1:md.mesh.numberofelements
+    for vertex=1:3
+        if any(iid1==md.mesh.elements(ii,vertex)) %one vertex in basin 1
+            idbasin(ii) = 1;
+        end
+    end
+    if idbasin(ii)==0 %no vertex was found in basin 1
+        idbasin(ii) = 2;
+    end
+end
+
+%calving and frontalforcings parameters
+md.mask.ice_levelset = 1e4*(md.mask.ice_levelset + 0.5);
+md.calving=calvingvonmises();
+md.frontalforcings=frontalforcingsrignot();
+md.frontalforcings.num_basins = 2;
+md.frontalforcings.basin_id = idbasin;
+md.frontalforcings.subglacial_discharge = 0.1*ones(md.mesh.numberofvertices,1);
+md.frontalforcings.thermalforcing = 0.5*ones(md.mesh.numberofvertices,1);
+for elem=1:md.mesh.numberofelements
+    if idbasin(elem)==2
+        md.frontalforcings.thermalforcing(md.mesh.elements(elem,1:3)) = 1.5;
+    end
+end
+
+md.transient.ismovingfront = 1;
+md.levelset.spclevelset = NaN(md.mesh.numberofvertices,1);
+md.levelset.migration_max = 1e10;
+
+md.transient.requested_outputs = {'default','CalvingMeltingrate'};
+md.cluster=generic('name',oshostname(),'np',2);
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names ={...
+   'Vx1' ,'Vy1' ,'Vel1' ,'Pressure1' ,'Bed1' ,'Surface1' ,'Thickness1' ,'MaskIceLevelset1', 'CalvingMeltingrate1',...
+   'Vx2' ,'Vy2' ,'Vel2' ,'Pressure2' ,'Bed2' ,'Surface2' ,'Thickness2' ,'MaskIceLevelset2', 'CalvingMeltingrate2',...
+   'Vx10','Vy10','Vel10','Pressure10','Bed10','Surface10','Thickness10','MaskIceLevelset10', 'CalvingMeltingrate10',...
+   };
+field_tolerances={...
+   1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,1e-9,...
+   2e-11,1e-11,1e-11,9e-12,2e-1,2e-11,2e-11,1e-11,1e-9,...
+   2e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,1e-9,...
+   };
+field_values={...
+   (md.results.TransientSolution(1).Vx),...
+   (md.results.TransientSolution(1).Vy),...
+   (md.results.TransientSolution(1).Vel),...
+   (md.results.TransientSolution(1).Pressure),...
+   (md.results.TransientSolution(1).Base),...
+   (md.results.TransientSolution(1).Surface),...
+   (md.results.TransientSolution(1).Thickness),...
+   (md.results.TransientSolution(1).MaskIceLevelset),...
+   (md.results.TransientSolution(1).CalvingMeltingrate),...
+   (md.results.TransientSolution(2).Vx),...
+   (md.results.TransientSolution(2).Vy),...
+   (md.results.TransientSolution(2).Vel),...
+   (md.results.TransientSolution(2).Pressure),...
+   (md.results.TransientSolution(2).Base),...
+   (md.results.TransientSolution(2).Surface),...
+   (md.results.TransientSolution(2).Thickness),...
+   (md.results.TransientSolution(2).MaskIceLevelset),...
+   (md.results.TransientSolution(2).CalvingMeltingrate),...
+   (md.results.TransientSolution(10).Vx),...
+   (md.results.TransientSolution(10).Vy),...
+   (md.results.TransientSolution(10).Vel),...
+   (md.results.TransientSolution(10).Pressure),...
+   (md.results.TransientSolution(10).Base),...
+   (md.results.TransientSolution(10).Surface),...
+   (md.results.TransientSolution(10).Thickness),...
+   (md.results.TransientSolution(10).MaskIceLevelset),...
+   (md.results.TransientSolution(10).CalvingMeltingrate),...
+   };
Index: /issm/trunk/test/NightlyRun/test542.py
===================================================================
--- /issm/trunk/test/NightlyRun/test542.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test542.py	(revision 26744)
@@ -0,0 +1,91 @@
+#Test Name: PigTranFrontalforcingsrignot
+import numpy as np
+
+from calvingvonmises import *
+from frontalforcingsrignot import *
+from socket import gethostname
+from model import *
+from parameterize import *
+from setflowequation import *
+from setmask import *
+from solve import *
+from triangle import *
+
+
+md = triangle(model(), '../Exp/Pig.exp', 10000)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md = setflowequation(md, 'SSA', 'all')
+md.timestepping.time_step = 2
+md.timestepping.final_time = 50
+
+# Separate domain in 2 basins
+idbasin = np.zeros((md.mesh.numberofelements,))
+iid1 = np.where(md.mesh.x <= -1.6e6)[0]
+for ii in range(md.mesh.numberofelements):
+    for vertex in range(3):
+        if md.mesh.elements[ii][vertex] - 1 in iid1:  # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
+            idbasin[ii] = 1
+    if idbasin[ii] == 0:  # no vertex was found in basin 1
+        idbasin[ii] = 2
+
+# Calving and frontalforcings parameters
+md.mask.ice_levelset = 1e4 * (md.mask.ice_levelset + 0.5)
+md.calving = calvingvonmises()
+md.frontalforcings = frontalforcingsrignot()
+md.frontalforcings.num_basins = 2
+md.frontalforcings.basin_id = idbasin - 1  # NOTE: offset because of 1-based vertex indexing
+md.frontalforcings.subglacial_discharge = 0.1 * np.ones((md.mesh.numberofvertices,))
+md.frontalforcings.thermalforcing = 0.5 * np.ones((md.mesh.numberofvertices,))
+for elem in range(md.mesh.numberofelements):
+    if idbasin[elem] == 2:
+        md.frontalforcings.thermalforcing[md.mesh.elements[elem, 0:3] - 1] = 1.5  # NOTE: offset because of 1-based vertex indexing
+
+md.transient.ismovingfront = 1
+md.levelset.spclevelset = np.full((md.mesh.numberofvertices,), np.nan)
+md.levelset.migration_max = 1e10
+
+md.transient.requested_outputs = ['default', 'CalvingMeltingrate']
+md.cluster = generic('name', gethostname(), 'np', 2)
+md = solve(md, 'Transient')
+
+# Fields and tolerances to track changes
+field_names = [
+    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'MaskIceLevelset1', 'CalvingMetlingRate1',
+    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'MaskIceLevelset2', 'CalvingMetlingRate2',
+    'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10', 'CalvingMetlingRate10'
+]
+field_tolerances = [
+    1e-11, 2e-11, 2e-11, 1e-12, 2e-11, 6e-12, 9e-12, 1e-12, 1e-9,
+    2e-11, 1e-11, 1e-11, 9e-12, 2e-1, 2e-11, 2e-11, 1e-11, 1e-9,
+    2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9, 1e-9
+]
+field_values = [
+    md.results.TransientSolution[0].Vx,
+    md.results.TransientSolution[0].Vy,
+    md.results.TransientSolution[0].Vel,
+    md.results.TransientSolution[0].Pressure,
+    md.results.TransientSolution[0].Base,
+    md.results.TransientSolution[0].Surface,
+    md.results.TransientSolution[0].Thickness,
+    md.results.TransientSolution[0].MaskIceLevelset,
+    md.results.TransientSolution[0].CalvingMeltingrate,
+    md.results.TransientSolution[1].Vx,
+    md.results.TransientSolution[1].Vy,
+    md.results.TransientSolution[1].Vel,
+    md.results.TransientSolution[1].Pressure,
+    md.results.TransientSolution[1].Base,
+    md.results.TransientSolution[1].Surface,
+    md.results.TransientSolution[1].Thickness,
+    md.results.TransientSolution[1].MaskIceLevelset,
+    md.results.TransientSolution[1].CalvingMeltingrate,
+    md.results.TransientSolution[9].Vx,
+    md.results.TransientSolution[9].Vy,
+    md.results.TransientSolution[9].Vel,
+    md.results.TransientSolution[9].Pressure,
+    md.results.TransientSolution[9].Base,
+    md.results.TransientSolution[9].Surface,
+    md.results.TransientSolution[9].Thickness,
+    md.results.TransientSolution[9].MaskIceLevelset,
+    md.results.TransientSolution[9].CalvingMeltingrate
+]
Index: /issm/trunk/test/NightlyRun/test543.m
===================================================================
--- /issm/trunk/test/NightlyRun/test543.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test543.m	(revision 26744)
@@ -0,0 +1,119 @@
+%Test Name: PigTranStochasticforcing
+md=triangle(model(),'../Exp/Pig.exp',10000.);
+md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+md=parameterize(md,'../Par/Pig.par');
+md=setflowequation(md,'SSA','all');
+md.timestepping.start_time = 0;
+md.timestepping.time_step  = 1;
+md.timestepping.final_time = 10;
+
+%Basin separation TF
+idb_tf  = zeros(md.mesh.numberofelements,1);
+iid1    = find(md.mesh.x<=-1.6e6);
+for ii=1:md.mesh.numberofelements
+    for vertex=1:3
+        if any(iid1==md.mesh.elements(ii,vertex)) %one vertex in basin 1
+            idb_tf(ii) = 1;
+        end
+    end
+    if idb_tf(ii)==0 %no vertex was found in basin 1
+        idb_tf(ii) = 2;
+    end
+end
+% Basin separation default
+idb_df = zeros(md.mesh.numberofelements,1);
+iid1   = find(md.mesh.x<=-1.62e6);
+for ii=1:md.mesh.numberofelements
+    for vertex=1:3
+        if any(iid1==md.mesh.elements(ii,vertex)) %one vertex in basin 1
+            idb_df(ii) = 1;
+        end
+    end
+    if idb_df(ii)==0 %no vertex was found in basin 1
+        idb_df(ii) = 2;
+    end
+end
+% Dimensionalities
+nb_tf    = 2;
+nb_clv   = 2;
+nb_flmlt = 2;
+
+%Calving parameters
+md.mask.ice_levelset = 1e4*(md.mask.ice_levelset + 0.5);
+md.calving.calvingrate = 0.3*ones(md.mesh.numberofvertices,1);
+md.levelset.spclevelset = NaN(md.mesh.numberofvertices,1);
+md.levelset.migration_max = 10.0; %avoid fast advance/retreat of the front
+%Frontal forcing parameters
+md.frontalforcings=frontalforcingsrignotautoregression();
+md.frontalforcings.num_basins           = nb_tf;
+md.frontalforcings.basin_id             = idb_tf;
+md.frontalforcings.subglacial_discharge = 0.1*ones(md.mesh.numberofvertices,1);
+md.frontalforcings.beta0                = [0.05,0.01]; %intercept values of TF in basins [C]
+md.frontalforcings.beta1                = [0.001,0.0001]; %trend values of TF in basins [C/yr]
+md.frontalforcings.ar_initialtime       = md.timestepping.start_time; %initial time in the AR model parameterization [yr]
+md.frontalforcings.ar_order             = 4;
+md.frontalforcings.ar_timestep          = 2; %timestep of the autoregressive model [yr]
+md.frontalforcings.phi                  = [[0.1,-0.1,0.01,-0.01];[0.2,-0.2,0.1,0.0]]; %autoregressive parameters
+
+% Floating Ice Melt parameters
+md.basalforcings.floatingice_melting_rate = 0.1*ones(md.mesh.numberofvertices,1);
+
+% Covariance matrix
+covtf       = 1e-4*eye(nb_tf);
+covclv      = 1e-1*eye(nb_clv);
+covclv(1,1) = 1/10*covclv(1,1);
+covflmlt    = 0.05*eye(nb_flmlt);
+covglob     = blkdiag(covtf,covclv,covflmlt);
+
+%Stochastic forcing
+md.stochasticforcing.isstochasticforcing = 1;
+md.stochasticforcing.fields              = [{'FrontalForcingsRignotAutoregression'},{'DefaultCalving'},{'FloatingMeltRate'}];
+md.stochasticforcing.defaultdimension    = 2;
+md.stochasticforcing.default_id          = idb_df;
+md.stochasticforcing.covariance          = covglob; %global covariance among- and between-fields
+md.stochasticforcing.randomflag          = 0; %determines true/false randomness
+
+md.transient.ismovingfront   = 1;
+md.transient.isgroundingline = 1;
+
+md.transient.requested_outputs = {'default','CalvingCalvingrate','CalvingMeltingrate','BasalforcingsFloatingiceMeltingRate'};
+md.cluster=generic('name',oshostname(),'np',2);
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names ={...
+   'Vx1' ,'Vy1' ,'Vel1' ,'Thickness1' ,'MaskIceLevelset1' ,'CalvingCalvingrate1' ,'CalvingMeltingrate1' ,'BasalforcingsFloatingiceMeltingRate1',...
+   'Vx2' ,'Vy2' ,'Vel2' ,'Thickness2' ,'MaskIceLevelset2' ,'CalvingCalvingrate1' ,'CalvingMeltingrate2' ,'BasalforcingsFloatingiceMeltingRate2',...
+   'Vx10','Vy10','Vel10','Thickness10','MaskIceLevelset10','CalvingCalvingrate10','CalvingMeltingrate10','BasalforcingsFloatingiceMeltingRate10',...
+   };
+field_tolerances={...
+   1e-11,2e-11,2e-11,1e-11,1e-9,1e-10,1e-10,1e-10,...
+   2e-11,1e-11,1e-11,9e-11,2e-9,1e-10,1e-10,1e-10,...
+   2e-10,1e-10,1e-10,1e-10,5e-9,1e-10,1e-10,1e-10,...
+   };
+field_values={...
+   (md.results.TransientSolution(1).Vx),...
+   (md.results.TransientSolution(1).Vy),...
+   (md.results.TransientSolution(1).Vel),...
+   (md.results.TransientSolution(1).Thickness),...
+   (md.results.TransientSolution(1).MaskIceLevelset),...
+   (md.results.TransientSolution(1).CalvingCalvingrate),...
+   (md.results.TransientSolution(1).CalvingMeltingrate),...
+   (md.results.TransientSolution(1).BasalforcingsFloatingiceMeltingRate),...
+   (md.results.TransientSolution(5).Vx),...
+   (md.results.TransientSolution(5).Vy),...
+   (md.results.TransientSolution(5).Vel),...
+   (md.results.TransientSolution(5).Thickness),...
+   (md.results.TransientSolution(5).MaskIceLevelset),...
+   (md.results.TransientSolution(5).CalvingCalvingrate),...
+   (md.results.TransientSolution(5).CalvingMeltingrate),...
+   (md.results.TransientSolution(5).BasalforcingsFloatingiceMeltingRate),...
+	(md.results.TransientSolution(10).Vx),...
+	(md.results.TransientSolution(10).Vy),...
+	(md.results.TransientSolution(10).Vel),...
+	(md.results.TransientSolution(10).Thickness),...
+	(md.results.TransientSolution(10).MaskIceLevelset),...
+	(md.results.TransientSolution(10).CalvingCalvingrate),...
+	(md.results.TransientSolution(10).CalvingMeltingrate),...
+	(md.results.TransientSolution(10).BasalforcingsFloatingiceMeltingRate),...
+	};
Index: /issm/trunk/test/NightlyRun/test543.py
===================================================================
--- /issm/trunk/test/NightlyRun/test543.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test543.py	(revision 26744)
@@ -0,0 +1,133 @@
+#Test Name: PigTranStochasticforcing
+import numpy as np
+
+from frontalforcingsrignotautoregression import *
+from socket import gethostname
+from model import *
+from parameterize import *
+from setflowequation import *
+from setmask import *
+from solve import *
+from triangle import *
+
+
+md = triangle(model(), '../Exp/Pig.exp', 10000)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md = setflowequation(md, 'SSA', 'all')
+md.timestepping.start_time = 0
+md.timestepping.time_step = 1
+md.timestepping.final_time = 10
+
+# Basin separation TF
+idb_tf = np.zeros((md.mesh.numberofelements,))
+iid1 = np.where(md.mesh.x <= -1.6e6)[0]
+for ii in range(md.mesh.numberofelements):
+    for vertex in range(3):
+        if md.mesh.elements[ii][vertex] - 1 in iid1:  # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
+            idb_tf[ii] = 1
+    if idb_tf[ii] == 0:  # no vertex was found in basin 1
+        for vertex in range(3):
+            idb_tf[ii] = 2
+# Basin separation default
+idb_df = np.zeros((md.mesh.numberofelements,))
+iid1 = np.where(md.mesh.x <= -1.62e6)[0]
+for ii in range(md.mesh.numberofelements):
+    for vertex in range(3):
+        if md.mesh.elements[ii][vertex] - 1 in iid1:  # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
+            idb_df[ii] = 1
+    if idb_df[ii] == 0:  # no vertex was found in basin 1
+        for vertex in range(3):
+            idb_df[ii] = 2
+#Dimensionalities
+nb_tf    = 2
+nb_clv   = 2
+nb_flmlt = 2
+
+# Calving parameters
+md.mask.ice_levelset = 1e4 * (md.mask.ice_levelset + 0.5)
+md.calving.calvingrate = 0.3*np.ones((md.mesh.numberofvertices,))
+md.levelset.spclevelset = np.full((md.mesh.numberofvertices,), np.nan)
+md.levelset.migration_max = 10.0
+#Frontal forcing parameters
+md.frontalforcings = frontalforcingsrignotautoregression()
+md.frontalforcings.num_basins = nb_tf
+md.frontalforcings.basin_id = idb_tf - 1  # NOTE: offset because of 1-based vertex indexing
+md.frontalforcings.subglacial_discharge = 0.1 * np.ones((md.mesh.numberofvertices,))
+md.frontalforcings.beta0 = np.array([[0.05, 0.01]])  # intercept values of TF in basins [C]
+md.frontalforcings.beta1 = np.array([[0.001, 0.0001]])  # trend values of TF in basins [C/yr]
+md.frontalforcings.ar_initialtime = md.timestepping.start_time  # initial time in the AR model parameterization [yr]
+md.frontalforcings.ar_order = 4
+md.frontalforcings.ar_timestep = 2  # timestep of the autoregressive model [yr]
+md.frontalforcings.phi = np.array([[0.1, -0.1, 0.01, -0.01], [0.2, -0.2, 0.1, 0.0]])  # autoregressive parameters
+#Floating Ice Melt parameters
+md.basalforcings.floatingice_melting_rate = 0.1*np.ones((md.mesh.numberofvertices,))
+
+#Covariance matrix
+covtf            = 1e-4*np.identity(nb_tf)
+covclv           = 1e-1*np.identity(nb_clv)
+covclv[0,0]      = 1/10*covclv[0,0]
+covflmlt         = 0.05*np.identity(nb_flmlt)
+#covglob          = np.zeros([6,6])
+#covglob[0:2,0:2] = covtf
+#covglob[2:4,2:4] = covclv
+#covglob[4:6,4:6] = covflmlt
+
+#Hard-coding covariance matrix because python is complaining
+covglob = np.array([[1e-4,0.,0.,0.,0.,0.],[0.,1e-4,0.,0.,0.,0.],[0.,0.,1e-2,0.,0.,0.],[0.,0.,0.,1e-1,0.,0.],[0.,0.,0.,0.,0.05,0.],[0.,0.,0.,0.,0.,0.05]])
+#testchol = np.linalg.cholesky(covglob)
+#print(testchol)
+
+# Stochastic forcing
+md.stochasticforcing.isstochasticforcing = 1
+md.stochasticforcing.fields = ['FrontalForcingsRignotAutoregression','DefaultCalving','FloatingMeltRate']
+md.stochasticforcing.defaultdimension = 2
+md.stochasticforcing.default_id       = idb_df-1 #NOTE: offset because of 1-based vertex indexing
+md.stochasticforcing.covariance       = covglob # global covariance among- and between-fields
+md.stochasticforcing.randomflag       = 0 # determines true/false randomness
+
+md.transient.ismovingfront   = 1
+md.transient.isgroundingline = 1
+
+md.transient.requested_outputs = ['default', 'CalvingCalvingrate','CalvingMeltingrate','BasalforcingsFloatingiceMeltingRate']
+md.cluster = generic('name', gethostname(), 'np', 2)
+md = solve(md, 'Transient')
+
+# Fields and tolerances to track changes
+field_names = [
+    'Vx1' ,'Vy1' ,'Vel1' ,'Thickness1' ,'MaskIceLevelset1' ,'CalvingCalvingrate1' ,'CalvingMeltingrate1' ,'BasalforcingsFloatingiceMeltingRate1',
+    'Vx2' ,'Vy2' ,'Vel2' ,'Thickness2' ,'MaskIceLevelset2' ,'CalvingCalvingrate1' ,'CalvingMeltingrate2' ,'BasalforcingsFloatingiceMeltingRate2',
+    'Vx10','Vy10','Vel10','Thickness10','MaskIceLevelset10','CalvingCalvingrate10','CalvingMeltingrate10','BasalforcingsFloatingiceMeltingRate10'
+]
+
+field_tolerances = [
+    1e-11,2e-11,2e-11,1e-11,1e-9,1e-10,1e-10,1e-10,
+    2e-11,1e-11,1e-11,9e-11,2e-9,1e-10,1e-10,1e-10,
+    2e-10,1e-10,1e-10,1e-10,5e-9,1e-10,1e-10,1e-10
+]
+field_values = [
+    md.results.TransientSolution[0].Vx,
+    md.results.TransientSolution[0].Vy,
+    md.results.TransientSolution[0].Vel,
+    md.results.TransientSolution[0].Thickness,
+    md.results.TransientSolution[0].MaskIceLevelset,
+    md.results.TransientSolution[0].CalvingCalvingrate,
+    md.results.TransientSolution[0].CalvingMeltingrate,
+    md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
+    md.results.TransientSolution[4].Vx,
+    md.results.TransientSolution[4].Vy,
+    md.results.TransientSolution[4].Vel,
+    md.results.TransientSolution[4].Thickness,
+    md.results.TransientSolution[4].MaskIceLevelset,
+    md.results.TransientSolution[4].CalvingCalvingrate,
+    md.results.TransientSolution[4].CalvingMeltingrate,
+    md.results.TransientSolution[4].BasalforcingsFloatingiceMeltingRate,
+    md.results.TransientSolution[9].Vx,
+    md.results.TransientSolution[9].Vy,
+    md.results.TransientSolution[9].Vel,
+    md.results.TransientSolution[9].Thickness,
+    md.results.TransientSolution[9].MaskIceLevelset,
+    md.results.TransientSolution[9].CalvingCalvingrate,
+    md.results.TransientSolution[9].CalvingMeltingrate,
+    md.results.TransientSolution[9].BasalforcingsFloatingiceMeltingRate
+]
Index: /issm/trunk/test/NightlyRun/test621.m
===================================================================
--- /issm/trunk/test/NightlyRun/test621.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test621.m	(revision 26744)
@@ -0,0 +1,77 @@
+%Test Name: 79NorthStochFrictionWaterPressure
+md=triangle(model(),'../Exp/79North.exp',6000.);
+md=setmask(md,'../Exp/79NorthShelf.exp','');
+md=parameterize(md,'../Par/79North.par');
+md=setflowequation(md,'SSA','all');
+
+%Default friction
+md.friction             = friction();
+md.friction.coefficient = 30*ones(md.mesh.numberofvertices,1);
+md.friction.p           = 1*ones(md.mesh.numberofelements,1);
+md.friction.q           = 1*ones(md.mesh.numberofelements,1);
+
+% Basin separation default
+idb_df = zeros(md.mesh.numberofelements,1);
+iid1   = find(md.mesh.y<=-1.08e6);
+for ii=1:md.mesh.numberofelements
+    for vertex=1:3
+        if any(iid1==md.mesh.elements(ii,vertex)) %one vertex in basin 1
+            idb_df(ii) = 1;
+        end
+    end
+    if idb_df(ii)==0 %no vertex was found in basin 1
+        idb_df(ii) = 2;
+    end
+end
+%Covariance matrix
+covPw      = 0.5e10*eye(2);
+covPw(1,1) = 1.5*covPw(1,1);
+
+%Stochastic forcing
+md.stochasticforcing.isstochasticforcing = 1;
+md.stochasticforcing.fields              = [{'FrictionWaterPressure'}];
+md.stochasticforcing.defaultdimension    = 2;
+md.stochasticforcing.default_id          = idb_df;
+md.stochasticforcing.covariance          = covPw; %global covariance
+md.stochasticforcing.randomflag          = 0; %determines true/false randomness
+
+md.transient.issmb              = 0;
+md.transient.ismasstransport    = 1;
+md.transient.isstressbalance    = 1;
+md.transient.isthermal          = 0;
+md.transient.isgroundingline    = 0;
+
+md.transient.requested_outputs = {'default','FrictionWaterPressure'};
+md.timestepping.start_time = 0;
+md.timestepping.time_step  = 1;
+md.timestepping.final_time = 5;
+md.cluster=generic('name',oshostname(),'np',3);
+md=solve(md,'Transient');
+
+
+%Fields and tolerances to track changes
+field_names      = {'Vx1','Vy1','Vel1','Thickness1','FrictionWaterPressure1',...
+                    'Vx2','Vy2','Vel2','Thickness2','FrictionWaterPressure2',...
+                    'Vx5','Vy5','Vel5','Thickness5','FrictionWaterPressure5'};
+field_tolerances={2e-10,2e-10,2e-10,2e-10,2e-10,...
+                  4e-10,4e-10,4e-10,4e-10,4e-10,...
+                  8e-10,8e-10,8e-10,8e-10,8e-10};
+              
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+    (md.results.TransientSolution(1).Vy),...
+    (md.results.TransientSolution(1).Vel),...
+    (md.results.TransientSolution(1).Thickness),...
+    (md.results.TransientSolution(1).FrictionWaterPressure),...
+    (md.results.TransientSolution(2).Vx),...
+    (md.results.TransientSolution(2).Vy),...
+    (md.results.TransientSolution(2).Vel),...
+    (md.results.TransientSolution(2).Thickness),...
+    (md.results.TransientSolution(2).FrictionWaterPressure),...
+    (md.results.TransientSolution(5).Vx),...
+    (md.results.TransientSolution(5).Vy),...
+    (md.results.TransientSolution(5).Vel),...
+    (md.results.TransientSolution(5).Thickness),...
+    (md.results.TransientSolution(5).FrictionWaterPressure),...
+    };
+
Index: /issm/trunk/test/NightlyRun/test621.py
===================================================================
--- /issm/trunk/test/NightlyRun/test621.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test621.py	(revision 26744)
@@ -0,0 +1,91 @@
+#Test Name: 79NorthStochFrictionWaterPressure
+import numpy as np
+
+from socket import gethostname
+from model import *
+from parameterize import *
+from setflowequation import *
+from setmask import *
+from solve import *
+from triangle import *
+
+
+md = triangle(model(), '../Exp/79North.exp', 6000)
+md = setmask(md, '../Exp/79NorthShelf.exp','')
+md = parameterize(md, '../Par/79North.py')
+md = setflowequation(md, 'SSA', 'all')
+
+#Default friction
+md.friction         = friction()
+md.friction.coefficient = 30*np.ones(md.mesh.numberofvertices)
+md.friction.p           = 1*np.ones((md.mesh.numberofelements))
+md.friction.q           = 1*np.ones((md.mesh.numberofelements))
+
+# Basin separation default
+idb_df = np.zeros((md.mesh.numberofelements,))
+iid1 = np.where(md.mesh.y<=-1.08e6)[0]
+for ii in range(md.mesh.numberofelements):
+    for vertex in range(3):
+        if md.mesh.elements[ii][vertex] - 1 in iid1:  # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
+            idb_df[ii] = 1
+    if idb_df[ii] == 0:  # no vertex was found in basin 1
+        for vertex in range(3):
+            idb_df[ii] = 2
+#Covariance matrix
+covPw = np.array([[0.75e10,0.0],[0.0,0.5e10]])
+
+# Stochastic forcing
+md.stochasticforcing.isstochasticforcing = 1
+md.stochasticforcing.fields              = ['FrictionWaterPressure']
+md.stochasticforcing.defaultdimension    = 2
+md.stochasticforcing.default_id          = idb_df-1 #NOTE: offset because of 1-based vertex indexing
+md.stochasticforcing.covariance          = covPw # global covariance
+md.stochasticforcing.randomflag          = 0 # determines true/false randomness
+
+md.transient.issmb              = 0;
+md.transient.ismasstransport    = 1;
+md.transient.isstressbalance    = 1;
+md.transient.isthermal          = 0;
+md.transient.isgroundingline    = 0;
+
+md.transient.requested_outputs = ['default', 'FrictionWaterPressure']
+md.timestepping.start_time = 0
+md.timestepping.time_step  = 1
+md.timestepping.final_time = 5
+md.cluster = generic('name',gethostname(),'np',3)
+md = solve(md, 'Transient')
+
+# Fields and tolerances to track changes
+field_names = [
+    'Vx1','Vy1','Vel1','Thickness1','FrictionWaterPressure1',
+    'Vx2','Vy2','Vel2','Thickness2','FrictionWaterPressure2',
+    'Vx10','Vy10','Vel10','Thickness10','FrictionWaterPressure10'
+    ]
+
+field_tolerances = [
+    2e-10,2e-10,2e-10,2e-10,2e-10,
+    4e-10,4e-10,4e-10,4e-10,4e-10,
+    8e-10,8e-10,8e-10,8e-10,8e-10
+    ]
+
+field_values = [
+    md.results.TransientSolution[0].Vx,
+    md.results.TransientSolution[0].Vy,
+    md.results.TransientSolution[0].Vel,
+    md.results.TransientSolution[0].Thickness,
+    md.results.TransientSolution[0].FrictionWaterPressure,
+    md.results.TransientSolution[1].Vx,
+    md.results.TransientSolution[1].Vy,
+    md.results.TransientSolution[1].Vel,
+    md.results.TransientSolution[1].Thickness,
+    md.results.TransientSolution[1].FrictionWaterPressure,
+    md.results.TransientSolution[4].Vx,
+    md.results.TransientSolution[4].Vy,
+    md.results.TransientSolution[4].Vel,
+    md.results.TransientSolution[4].Thickness,
+    md.results.TransientSolution[4].FrictionWaterPressure
+    ]
+    
+
+
+
Index: /issm/trunk/test/NightlyRun/test801.m
===================================================================
--- /issm/trunk/test/NightlyRun/test801.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test801.m	(revision 26744)
@@ -14,5 +14,4 @@
 md.transient.isthermal=0;
 md.transient.isgroundingline=1;
-md.transient.isgia=0;
 
 md=solve(md,'Transient');
Index: /issm/trunk/test/NightlyRun/test801.py
===================================================================
--- /issm/trunk/test/NightlyRun/test801.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test801.py	(revision 26744)
@@ -22,5 +22,4 @@
 md.transient.isthermal = False
 md.transient.isgroundingline = True
-md.transient.isgia = False
 
 md = solve(md, 'Transient')
Index: /issm/trunk/test/NightlyRun/test802.m
===================================================================
--- /issm/trunk/test/NightlyRun/test802.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test802.m	(revision 26744)
@@ -18,5 +18,4 @@
 md.transient.isthermal=1;
 md.transient.isgroundingline=1;
-md.transient.isgia=0;
 md.groundingline.melt_interpolation='SubelementMelt1';
 
Index: /issm/trunk/test/NightlyRun/test802.py
===================================================================
--- /issm/trunk/test/NightlyRun/test802.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test802.py	(revision 26744)
@@ -27,5 +27,4 @@
 md.transient.isthermal = True
 md.transient.isgroundingline = True
-md.transient.isgia = False
 md.groundingline.melt_interpolation = 'SubelementMelt1'
 
Index: /issm/trunk/test/NightlyRun/test803.m
===================================================================
--- /issm/trunk/test/NightlyRun/test803.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test803.m	(revision 26744)
@@ -20,5 +20,4 @@
 md.transient.isthermal=1;
 md.transient.isgroundingline=1;
-md.transient.isgia=0;
 md.groundingline.melt_interpolation='SubelementMelt1';
 
Index: /issm/trunk/test/NightlyRun/test803.py
===================================================================
--- /issm/trunk/test/NightlyRun/test803.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test803.py	(revision 26744)
@@ -29,5 +29,4 @@
 md.transient.isthermal = True
 md.transient.isgroundingline = True
-md.transient.isgia = False
 md.groundingline.melt_interpolation = 'SubelementMelt1'
 
Index: /issm/trunk/test/NightlyRun/test804.m
===================================================================
--- /issm/trunk/test/NightlyRun/test804.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test804.m	(revision 26744)
@@ -12,9 +12,9 @@
 md.transient.isthermal=0;
 md.transient.isgroundingline=1;
-md.transient.isgia=0;
 md.transient.ismovingfront=1;
 
 md.calving.calvingrate=1000.*ones(md.mesh.numberofvertices,1);
 md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
+md.levelset.migration_max = 1e10;
 
 md=solve(md,'Transient');
Index: /issm/trunk/test/NightlyRun/test804.py
===================================================================
--- /issm/trunk/test/NightlyRun/test804.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test804.py	(revision 26744)
@@ -1,10 +1,11 @@
 #Test Name: ValleyGlacierLevelsetCalvingSIA2d
+import numpy as np
+from socket import gethostname
 from model import *
-from socket import gethostname
-from triangle import *
-from setmask import *
 from parameterize import *
 from setflowequation import *
+from setmask import *
 from solve import *
+from triangle import *
 
 
@@ -21,9 +22,9 @@
 md.transient.isthermal = False
 md.transient.isgroundingline = True
-md.transient.isgia = False
 md.transient.ismovingfront = True
 
 md.calving.calvingrate = 1000. * np.ones((md.mesh.numberofvertices))
 md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices))
+md.levelset.migration_max = 1e10
 
 md = solve(md, 'Transient')
Index: /issm/trunk/test/NightlyRun/test805.m
===================================================================
--- /issm/trunk/test/NightlyRun/test805.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test805.m	(revision 26744)
@@ -19,5 +19,4 @@
 md.transient.isthermal=1;
 md.transient.isgroundingline=1;
-md.transient.isgia=0;
 md.transient.ismovingfront=1;
 
@@ -26,4 +25,5 @@
 md.groundingline.melt_interpolation='SubelementMelt1';
 md.levelset.stabilization=2;
+md.levelset.migration_max = 1e10;
 
 md=solve(md,'Transient');
Index: /issm/trunk/test/NightlyRun/test805.py
===================================================================
--- /issm/trunk/test/NightlyRun/test805.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test805.py	(revision 26744)
@@ -1,10 +1,11 @@
 #Test Name: ValleyGlacierLevelsetEnthCalvingHO3d
+import numpy as np
+from socket import gethostname
 from model import *
-from socket import gethostname
-from triangle import *
-from setmask import *
 from parameterize import *
 from setflowequation import *
+from setmask import *
 from solve import *
+from triangle import *
 
 
@@ -28,5 +29,4 @@
 md.transient.isthermal = True
 md.transient.isgroundingline = True
-md.transient.isgia = False
 md.transient.ismovingfront = True
 
@@ -35,4 +35,5 @@
 md.groundingline.melt_interpolation = 'SubelementMelt1'
 md.levelset.stabilization = 2
+md.levelset.migration_max = 1e10
 
 md = solve(md, 'Transient')
Index: /issm/trunk/test/NightlyRun/test806.m
===================================================================
--- /issm/trunk/test/NightlyRun/test806.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test806.m	(revision 26744)
@@ -25,5 +25,4 @@
 md.transient.isthermal=0;
 md.transient.isgroundingline=0;
-md.transient.isgia=0;
 md.transient.ismovingfront=1;
 
@@ -32,4 +31,5 @@
 md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
 md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
+md.levelset.migration_max = 1e8;
 
 md.transient.requested_outputs={'default','StrainRateparallel','StrainRateperpendicular','Calvingratex','Calvingratey','CalvingCalvingrate'};
Index: /issm/trunk/test/NightlyRun/test806.py
===================================================================
--- /issm/trunk/test/NightlyRun/test806.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test806.py	(revision 26744)
@@ -1,12 +1,11 @@
 #Test Name: SquareShelfLevelsetCalvingSSA2dLevermann
+import numpy as np
+from socket import gethostname
 from model import *
-from socket import gethostname
-from triangle import *
-from setmask import *
 from parameterize import *
 from setflowequation import *
+from setmask import *
 from solve import *
-
-import numpy as np
+from triangle import *
 
 md = triangle(model(), '../Exp/Square.exp', 50000.)
@@ -35,5 +34,4 @@
 md.transient.isthermal = False
 md.transient.isgroundingline = False
-md.transient.isgia = False
 md.transient.ismovingfront = True
 
@@ -42,4 +40,5 @@
 md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices))
 md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices))
+md.levelset.migration_max = 1e8
 
 md.transient.requested_outputs = ['default', 'StrainRateparallel', 'StrainRateperpendicular', 'Calvingratex', 'Calvingratey', 'CalvingCalvingrate']
Index: /issm/trunk/test/NightlyRun/test807.m
===================================================================
--- /issm/trunk/test/NightlyRun/test807.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test807.m	(revision 26744)
@@ -25,5 +25,4 @@
 md.transient.isthermal=0;
 md.transient.isgroundingline=0;
-md.transient.isgia=0;
 md.transient.ismovingfront=1;
 
Index: /issm/trunk/test/NightlyRun/test807.py
===================================================================
--- /issm/trunk/test/NightlyRun/test807.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test807.py	(revision 26744)
@@ -35,5 +35,4 @@
 md.transient.isthermal = False
 md.transient.isgroundingline = False
-md.transient.isgia = False
 md.transient.ismovingfront = True
 
Index: /issm/trunk/test/NightlyRun/test808.m
===================================================================
--- /issm/trunk/test/NightlyRun/test808.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test808.m	(revision 26744)
@@ -25,5 +25,4 @@
 md.transient.isthermal=0;
 md.transient.isgroundingline=0;
-md.transient.isgia=0;
 md.transient.ismovingfront=1;
 
@@ -33,4 +32,5 @@
 md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
 md.levelset.reinit_frequency=1;
+md.levelset.migration_max = 1e10;
 
 md=solve(md,'Transient');
Index: /issm/trunk/test/NightlyRun/test808.py
===================================================================
--- /issm/trunk/test/NightlyRun/test808.py	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test808.py	(revision 26744)
@@ -1,12 +1,12 @@
 #Test Name: SquareShelfLevelsetCalvingSSA2dMinThickness
+import numpy as np
+from calvingminthickness import *
+from socket import gethostname
 from model import *
-from socket import gethostname
-from triangle import *
-from setmask import *
 from parameterize import *
 from setflowequation import *
+from setmask import *
 from solve import *
-import numpy as np
-from calvingminthickness import *
+from triangle import *
 
 md = triangle(model(), '../Exp/Square.exp', 30000.)
@@ -35,5 +35,4 @@
 md.transient.isthermal = 0
 md.transient.isgroundingline = 0
-md.transient.isgia = 0
 md.transient.ismovingfront = 1
 
@@ -41,6 +40,7 @@
 md.calving.min_thickness = 400
 md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))
-md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, ))
+md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices, ))
 md.levelset.reinit_frequency = 1
+md.levelset.migration_max = 1e10
 
 md = solve(md, 'Transient')
Index: /issm/trunk/test/NightlyRun/test809.m
===================================================================
--- /issm/trunk/test/NightlyRun/test809.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test809.m	(revision 26744)
@@ -15,5 +15,4 @@
 md.transient.isthermal=0;
 md.transient.isgroundingline=1;
-md.transient.isgia=0;
 
 md.calving=calvingcrevassedepth();
@@ -23,4 +22,5 @@
 md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
 md.levelset.reinit_frequency=1;
+md.levelset.migration_max = 1e10;
 
 md=solve(md,'Transient');
Index: /issm/trunk/test/NightlyRun/test809.py
===================================================================
--- /issm/trunk/test/NightlyRun/test809.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test809.py	(revision 26744)
@@ -0,0 +1,65 @@
+#Test Name: ValleyGlacierLevelsetCalvingSSA2dCrevassedepth
+import numpy as np
+from calvingcrevassedepth import *
+from socket import gethostname
+from model import *
+from parameterize import *
+from setflowequation import *
+from setmask import *
+from solve import *
+from triangle import *
+
+md = triangle(model(), '../Exp/Square.exp', 50000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/ValleyGlacierShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.timestepping.time_step = 2
+md.timestepping.final_time = 50
+md.cluster = generic('name', gethostname(), 'np', 3)
+
+#Transient
+md.transient.isstressbalance = 1
+md.transient.ismovingfront = 1
+md.transient.ismasstransport = 1
+md.transient.issmb = 1
+md.transient.isthermal = 0
+md.transient.isgroundingline = 1
+
+md.calving = calvingcrevassedepth()
+md.calving.crevasse_opening_stress=1
+md.calving.water_height = 50 * np.ones((md.mesh.numberofvertices, ))
+md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))
+md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices, ))
+md.levelset.reinit_frequency = 1
+md.levelset.migration_max = 1e10
+
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1'
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2'
+               'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Thickness10', 'Surface10', 'MaskIceLevelset10']
+field_tolerances = [1e-8, 1e-8, 1e-8, 1e-9, 1e-9, 1e-9, 3e-9,
+                    1e-8, 1e-8, 1e-8, 1e-9, 1e-9, 1e-9, 3e-9,
+                    1e-8, 1e-8, 1e-8, 1e-9, 1e-9, 1e-9, 3e-9]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[9].Vx,
+                md.results.TransientSolution[9].Vy,
+                md.results.TransientSolution[9].Vel,
+                md.results.TransientSolution[9].Pressure,
+                md.results.TransientSolution[9].Thickness,
+                md.results.TransientSolution[9].Surface,
+                md.results.TransientSolution[9].MaskIceLevelset]
Index: /issm/trunk/test/NightlyRun/test810.m
===================================================================
--- /issm/trunk/test/NightlyRun/test810.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test810.m	(revision 26744)
@@ -0,0 +1,49 @@
+%Test Name: ValleyGlacierLevelsetMLHO2d
+md=triangle(model(),'../Exp/Square.exp',50000);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/ValleyGlacierShelf.par');
+md=setflowequation(md,'MLHO','all');
+md.levelset.stabilization=2;
+md.cluster=generic('name',oshostname(),'np',3);
+
+%Transient;
+md.transient.isstressbalance=1;
+md.transient.ismovingfront=1;
+md.transient.ismasstransport=1;
+md.transient.issmb=1;
+md.transient.isthermal=0;
+md.transient.isgroundingline=1;
+
+md=SetMLHOBC(md);
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1',...
+		'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2',...
+		'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3'};
+field_tolerances={1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,...
+		1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,...
+		1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12};
+field_values={...
+	md.results.TransientSolution(1).Vx,...
+	md.results.TransientSolution(1).Vy,...
+	md.results.TransientSolution(1).Vel,...
+	md.results.TransientSolution(1).Pressure,...
+	md.results.TransientSolution(1).Thickness,...
+	md.results.TransientSolution(1).Surface,...
+	md.results.TransientSolution(1).MaskIceLevelset,...
+	md.results.TransientSolution(2).Vx,...
+	md.results.TransientSolution(2).Vy,...
+	md.results.TransientSolution(2).Vel,...
+	md.results.TransientSolution(2).Pressure,...
+	md.results.TransientSolution(2).Thickness,...
+	md.results.TransientSolution(2).Surface,...
+	md.results.TransientSolution(2).MaskIceLevelset,...
+	md.results.TransientSolution(3).Vx,...
+	md.results.TransientSolution(3).Vy,...
+	md.results.TransientSolution(3).Vel,...
+	md.results.TransientSolution(3).Pressure,...
+	md.results.TransientSolution(3).Thickness,...
+	md.results.TransientSolution(3).Surface,...
+	md.results.TransientSolution(3).MaskIceLevelset,...
+	};
Index: /issm/trunk/test/NightlyRun/test810.py
===================================================================
--- /issm/trunk/test/NightlyRun/test810.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test810.py	(revision 26744)
@@ -0,0 +1,55 @@
+#Test Name: ValleyGlacierLevelsetMLHO2d
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md = triangle(model(), '../Exp/Square.exp', 50000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/ValleyGlacierShelf.py')
+md.levelset.stabilization = 2
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+
+#Transient
+md.transient.isstressbalance = True
+md.transient.ismovingfront = True
+md.transient.ismasstransport = True
+md.transient.issmb = True
+md.transient.isthermal = False
+md.transient.isgroundingline = True
+md = SetMLHOBC(md);
+
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Thickness3', 'Surface3', 'MaskIceLevelset3']
+field_tolerances = [1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12,
+                    1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12,
+                    1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].MaskIceLevelset]
Index: /issm/trunk/test/NightlyRun/test811.m
===================================================================
--- /issm/trunk/test/NightlyRun/test811.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test811.m	(revision 26744)
@@ -0,0 +1,52 @@
+%Test Name: ValleyGlacierLevelsetCalvingMLHO2d
+md=triangle(model(),'../Exp/Square.exp',50000);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/ValleyGlacierShelf.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+
+%Transient
+md.transient.isstressbalance=1;
+md.transient.ismasstransport=1;
+md.transient.issmb=1;
+md.transient.isthermal=0;
+md.transient.isgroundingline=1;
+md.transient.ismovingfront=1;
+
+md.calving.calvingrate=1000.*ones(md.mesh.numberofvertices,1);
+md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
+md.levelset.migration_max = 1e10;
+
+md=SetMLHOBC(md);
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1',...
+		'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2',...
+		'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+		2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,...
+		2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	md.results.TransientSolution(1).Vx,...
+	md.results.TransientSolution(1).Vy,...
+	md.results.TransientSolution(1).Vel,...
+	md.results.TransientSolution(1).Pressure,...
+	md.results.TransientSolution(1).Thickness,...
+	md.results.TransientSolution(1).Surface,...
+	md.results.TransientSolution(1).MaskIceLevelset,...
+	md.results.TransientSolution(2).Vx,...
+	md.results.TransientSolution(2).Vy,...
+	md.results.TransientSolution(2).Vel,...
+	md.results.TransientSolution(2).Pressure,...
+	md.results.TransientSolution(2).Thickness,...
+	md.results.TransientSolution(2).Surface,...
+	md.results.TransientSolution(2).MaskIceLevelset,...
+	md.results.TransientSolution(3).Vx,...
+	md.results.TransientSolution(3).Vy,...
+	md.results.TransientSolution(3).Vel,...
+	md.results.TransientSolution(3).Pressure,...
+	md.results.TransientSolution(3).Thickness,...
+	md.results.TransientSolution(3).Surface,...
+	md.results.TransientSolution(3).MaskIceLevelset,...
+	};
Index: /issm/trunk/test/NightlyRun/test811.py
===================================================================
--- /issm/trunk/test/NightlyRun/test811.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test811.py	(revision 26744)
@@ -0,0 +1,61 @@
+#Test Name: ValleyGlacierLevelsetCalvingMLHO2d
+import numpy as np
+from model import *
+from socket import gethostname
+from triangle import triangle
+from setmask import setmask
+from parameterize import parameterize
+from setflowequation import setflowequation
+from solve import solve
+from SetMLHOBC import SetMLHOBC
+from generic import generic
+
+md = triangle(model(), '../Exp/Square.exp', 50000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/ValleyGlacierShelf.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+
+#Transient
+md.transient.isstressbalance = True
+md.transient.ismasstransport = True
+md.transient.issmb = True
+md.transient.isthermal = False
+md.transient.isgroundingline = True
+md.transient.ismovingfront = True
+
+md.calving.calvingrate = 1000. * np.ones((md.mesh.numberofvertices))
+md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices))
+md.levelset.migration_max = 1e10
+
+md = SetMLHOBC(md)
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Thickness3', 'Surface3', 'MaskIceLevelset3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].MaskIceLevelset]
Index: /issm/trunk/test/NightlyRun/test812.m
===================================================================
--- /issm/trunk/test/NightlyRun/test812.m	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test812.m	(revision 26744)
@@ -0,0 +1,78 @@
+%Test Name: SquareShelfLevelsetCalvingMLHO2dLevermann
+md=triangle(model(),'../Exp/Square.exp',50000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=setflowequation(md,'MLHO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+
+%Do not kill ice bergs as all is floating
+md.levelset.kill_icebergs=0;
+
+x = md.mesh.x;
+xmin = min(x);
+xmax = max(x);
+Lx = (xmax-xmin);
+alpha = 2./3.;
+md.mask.ice_levelset = ((x - alpha*Lx)>0) - ((x - alpha*Lx)<0);
+
+md.timestepping.time_step=10;
+md.timestepping.final_time=30;
+
+%Transient
+md.transient.isstressbalance=1;
+md.transient.ismasstransport=1;
+md.transient.issmb=1;
+md.transient.isthermal=0;
+md.transient.isgroundingline=0;
+md.transient.ismovingfront=1;
+
+md.calving=calvinglevermann();
+md.calving.coeff=4.89e13*ones(md.mesh.numberofvertices,1);
+md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
+md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
+md.levelset.migration_max = 1e8;
+
+md.transient.requested_outputs={'default','StrainRateparallel','StrainRateperpendicular','Calvingratex','Calvingratey','CalvingCalvingrate'};
+
+md=SetMLHOBC(md);
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1','StrainRateparallel1','StrainRateperpendicular1','CalvingCalvingrate1'...
+		'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2','StrainRateparallel2','StrainRateperpendicular2','CalvingCalvingrate2'...
+		'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3','StrainRateparallel3','StrainRateperpendicular3','CalvingCalvingrate3'};
+field_tolerances={1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,...
+		2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,...
+		2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,1e-11,5e-11,5e-11,5e-11};
+field_values={...
+	md.results.TransientSolution(1).Vx,...
+	md.results.TransientSolution(1).Vy,...
+	md.results.TransientSolution(1).Vel,...
+	md.results.TransientSolution(1).Pressure,...
+	md.results.TransientSolution(1).Thickness,...
+	md.results.TransientSolution(1).Surface,...
+	md.results.TransientSolution(1).MaskIceLevelset,...
+	md.results.TransientSolution(1).StrainRateparallel,...
+	md.results.TransientSolution(1).StrainRateperpendicular,...
+	md.results.TransientSolution(1).CalvingCalvingrate,...
+	md.results.TransientSolution(2).Vx,...
+	md.results.TransientSolution(2).Vy,...
+	md.results.TransientSolution(2).Vel,...
+	md.results.TransientSolution(2).Pressure,...
+	md.results.TransientSolution(2).Thickness,...
+	md.results.TransientSolution(2).Surface,...
+	md.results.TransientSolution(2).MaskIceLevelset,...
+	md.results.TransientSolution(2).StrainRateparallel,...
+	md.results.TransientSolution(2).StrainRateperpendicular,...
+	md.results.TransientSolution(2).CalvingCalvingrate,...
+	md.results.TransientSolution(3).Vx,...
+	md.results.TransientSolution(3).Vy,...
+	md.results.TransientSolution(3).Vel,...
+	md.results.TransientSolution(3).Pressure,...
+	md.results.TransientSolution(3).Thickness,...
+	md.results.TransientSolution(3).Surface,...
+	md.results.TransientSolution(3).MaskIceLevelset,...
+	md.results.TransientSolution(3).StrainRateparallel,...
+	md.results.TransientSolution(3).StrainRateperpendicular,...
+	md.results.TransientSolution(3).CalvingCalvingrate,...
+	};
Index: /issm/trunk/test/NightlyRun/test812.py
===================================================================
--- /issm/trunk/test/NightlyRun/test812.py	(revision 26744)
+++ /issm/trunk/test/NightlyRun/test812.py	(revision 26744)
@@ -0,0 +1,86 @@
+#Test Name: SquareShelfLevelsetCalvingMLHO2dLevermann
+import numpy as np
+from socket import gethostname
+from model import *
+from parameterize import parameterize
+from setflowequation import setflowequation
+from setmask import setmask
+from solve import solve
+from triangle import triangle
+from SetMLHOBC import SetMLHOBC
+
+md = triangle(model(), '../Exp/Square.exp', 50000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'MLHO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+
+x = md.mesh.x
+xmin = min(x)
+xmax = max(x)
+Lx = (xmax - xmin)
+alpha = 2. / 3.
+md.mask.ice_levelset = np.float_((x - alpha * Lx) > 0) - np.float_((x - alpha * Lx) < 0)
+
+#Do not kill ice bergs as all is floating
+md.levelset.kill_icebergs = 0
+
+md.timestepping.time_step = 10
+md.timestepping.final_time = 30
+
+#Transient
+md.transient.isstressbalance = True
+md.transient.ismasstransport = True
+md.transient.issmb = True
+md.transient.isthermal = False
+md.transient.isgroundingline = False
+md.transient.ismovingfront = True
+
+md.calving = calvinglevermann()
+md.calving.coeff = 4.89e13 * np.ones((md.mesh.numberofvertices))
+md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices))
+md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices))
+md.levelset.migration_max = 1e8
+
+md.transient.requested_outputs = ['default', 'StrainRateparallel', 'StrainRateperpendicular', 'Calvingratex', 'Calvingratey', 'CalvingCalvingrate']
+
+md = SetMLHOBC(md);
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1', 'StrainRateparallel1', 'StrainRateperpendicular1', 'CalvingCalvingrate1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2', 'StrainRateparallel2', 'StrainRateperpendicular2', 'CalvingCalvingrate2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Thickness3', 'Surface3', 'MaskIceLevelset3', 'StrainRateparallel3', 'StrainRateperpendicular3', 'CalvingCalvingrate3']
+field_tolerances = [1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11,
+                    2e-11, 2e-11, 2e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11,
+                    2e-11, 2e-11, 2e-11, 1e-11, 1e-11, 1e-11, 1e-11, 5e-11, 5e-11, 1e-11]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[0].StrainRateparallel,
+                md.results.TransientSolution[0].StrainRateperpendicular,
+                md.results.TransientSolution[0].CalvingCalvingrate,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[1].StrainRateparallel,
+                md.results.TransientSolution[1].StrainRateperpendicular,
+                md.results.TransientSolution[1].CalvingCalvingrate,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].MaskIceLevelset,
+                md.results.TransientSolution[2].StrainRateparallel,
+                md.results.TransientSolution[2].StrainRateperpendicular,
+                md.results.TransientSolution[2].CalvingCalvingrate]
Index: /issm/trunk/test/NightlyRun/test905.m
===================================================================
--- /issm/trunk/test/NightlyRun/test905.m	(revision 26743)
+++ /issm/trunk/test/NightlyRun/test905.m	(revision 26744)
@@ -60,5 +60,5 @@
 	     'SedimentWaterHead9','EplWaterHead9','SedimentHeadResidual9',...
 	     'EplWaterHead20','EplWaterHeadSubstep20','SedimentWaterHead20',...
-	     'SedimentWaterHeadSubstep20'}
+	     'SedimentWaterHeadSubstep20'};
 field_tolerances={1e-13,1e-13,1e-13,...
 		  1e-13,1e-13,1e-13,...
Index: /issm/trunk/test/Par/SquareSheetConstrained.par
===================================================================
--- /issm/trunk/test/Par/SquareSheetConstrained.par	(revision 26743)
+++ /issm/trunk/test/Par/SquareSheetConstrained.par	(revision 26744)
@@ -10,4 +10,5 @@
 md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin);
 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness+20.;
+md.geometry.bed=md.geometry.base;
 md.geometry.surface=md.geometry.base+md.geometry.thickness;
 
@@ -59,5 +60,4 @@
 md.groundingline.migration='None';
 
-
 %Boundary conditions:
 md=SetIceSheetBC(md);
Index: /issm/trunk/test/Par/SquareSheetConstrained.py
===================================================================
--- /issm/trunk/test/Par/SquareSheetConstrained.py	(revision 26743)
+++ /issm/trunk/test/Par/SquareSheetConstrained.py	(revision 26744)
@@ -1,16 +1,16 @@
+import inspect
 import os.path
 import numpy as np
-import inspect
-from verbose import verbose
+from arch import *
 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
 from paterson import paterson
 from SetIceSheetBC import SetIceSheetBC
-from arch import *
+from verbose import verbose
 
 #Start defining model parameters here
 
-#Geometry
-hmin = 300.
-hmax = 1000.
+# Geometry
+hmin = 300.0
+hmax = 1000.0
 ymin = np.min(md.mesh.y)
 ymax = np.max(md.mesh.y)
@@ -18,5 +18,6 @@
 xmax = np.max(md.mesh.x)
 md.geometry.thickness = hmax + (hmin - hmax) * (md.mesh.y - ymin) / (ymax - ymin) + 0.1 * (hmin - hmax) * (md.mesh.x - xmin) / (xmax - xmin)
-md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness + 20.
+md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness + 20.0
+md.geometry.bed = md.geometry.base
 md.geometry.surface = md.geometry.base + md.geometry.thickness
 
@@ -34,7 +35,7 @@
 
 #Materials
-md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
+md.initialization.temperature = (273.0 - 20.0) * np.ones((md.mesh.numberofvertices))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
+md.materials.rheology_n = 3.0 * np.ones((md.mesh.numberofelements))
 
 #Calving
@@ -43,12 +44,12 @@
 
 #Friction
-md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
-md.friction.coefficient[np.where(md.mask.ocean_levelset < 0.)[0]] = 0.
+md.friction.coefficient = 20.0 * np.ones((md.mesh.numberofvertices))
+md.friction.coefficient[np.where(md.mask.ocean_levelset < 0.0)[0]] = 0.0
 md.friction.p = np.ones((md.mesh.numberofelements))
 md.friction.q = np.ones((md.mesh.numberofelements))
 
 #Numerical parameters
-md.masstransport.stabilization = 1.
-md.thermal.stabilization = 1.
+md.masstransport.stabilization = 1.0
+md.thermal.stabilization = 1.0
 md.verbose = verbose(0)
 md.settings.waitonlock = 30
@@ -57,15 +58,7 @@
 md.stressbalance.reltol = 0.05
 md.stressbalance.abstol = np.nan
-md.timestepping.time_step = 1.
-md.timestepping.final_time = 3.
+md.timestepping.time_step = 1.0
+md.timestepping.final_time = 3.0
 md.groundingline.migration = 'None'
-
-#GIA:
-md.gia.lithosphere_thickness = 100. * np.ones((md.mesh.numberofvertices))  # in km
-md.gia.mantle_viscosity = 1.e21 * np.ones((md.mesh.numberofvertices))  # in Pa.s
-md.materials.lithosphere_shear_modulus = 6.7e10  # in Pa
-md.materials.lithosphere_density = 3.32  # in g / cm^ - 3
-md.materials.mantle_shear_modulus = 1.45e11  # in Pa
-md.materials.mantle_density = 3.34  # in g / cm^ - 3
 
 #Boundary conditions:
Index: /issm/trunk/test/Par/ValleyGlacierShelf.par
===================================================================
--- /issm/trunk/test/Par/ValleyGlacierShelf.par	(revision 26743)
+++ /issm/trunk/test/Par/ValleyGlacierShelf.par	(revision 26744)
@@ -65,5 +65,4 @@
 md.transient.isthermal = 0;
 md.transient.isgroundingline = 1;
-md.transient.isgia = 0;
 
 %Stressbalance
Index: /issm/trunk/test/Par/ValleyGlacierShelf.py
===================================================================
--- /issm/trunk/test/Par/ValleyGlacierShelf.py	(revision 26743)
+++ /issm/trunk/test/Par/ValleyGlacierShelf.py	(revision 26744)
@@ -70,5 +70,4 @@
 md.transient.isthermal = False
 md.transient.isgroundingline = True
-md.transient.isgia = False
 
 #Stressbalance
Index: /issm/trunk/test/SandBox/test2002.m
===================================================================
--- /issm/trunk/test/SandBox/test2002.m	(revision 26744)
+++ /issm/trunk/test/SandBox/test2002.m	(revision 26744)
@@ -0,0 +1,143 @@
+%Test Name: EarthSlc
+
+%mesh earth:
+md=model;
+%md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
+load test2002_mesh 
+md.mesh=mesh;
+
+%Geometry for the bed, arbitrary thickness of 1000: 
+md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+md.geometry.base=md.geometry.bed;
+md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
+md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+
+
+%parameterize solidearth solution:
+%solidearth loading:  {{{
+md.masstransport.spcthickness=[md.geometry.thickness;0];
+md.dsl.global_average_thermosteric_sea_level=[0;0];
+md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+%antarctica
+late=sum(md.mesh.lat(md.mesh.elements),2)/3;
+longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+%pos=find(late < -86);
+pos=1136;
+md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+
+vertices=md.mesh.elements(pos,:); 
+pos1=find( md.mesh.elements(:,1)==vertices(1) | md.mesh.elements(:,2)==vertices(1) | md.mesh.elements(:,3)==vertices(1) );
+pos2=find( md.mesh.elements(:,1)==vertices(2) | md.mesh.elements(:,2)==vertices(2) | md.mesh.elements(:,3)==vertices(2) );
+pos3=find( md.mesh.elements(:,1)==vertices(3) | md.mesh.elements(:,2)==vertices(3) | md.mesh.elements(:,3)==vertices(3) );
+polarelements=unique([pos1;pos2;pos3]);
+
+
+%greenland
+%pos=find(late>70 & late<80 & longe>-60 & longe<-30);
+%md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+
+%elastic loading from love numbers:
+md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
+
+%}}}
+%mask:  {{{
+md.mask.ice_levelset=ones(md.mesh.numberofvertices,1);
+md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1);
+pos=find(md.mesh.lat<0);
+md.mask.ice_levelset(pos)=-1;
+md.mask.ocean_levelset(pos)=1;
+
+md.mask.ocean_levelset(md.mesh.elements(polarelements,:))=-1;
+md.mask.ocean_levelset(md.mesh.elements(1136,:))=1;
+
+md.mask.ice_levelset(md.mesh.elements(polarelements,:))=1;
+md.mask.ice_levelset(md.mesh.elements(1136,:))=-1;
+
+
+% }}}
+
+%time stepping: 
+md.timestepping.start_time=0;
+md.timestepping.time_step=1;
+md.timestepping.final_time=1;
+
+
+md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+md.initialization.bottompressure=zeros(md.mesh.numberofvertices,1);
+md.initialization.dsl=zeros(md.mesh.numberofvertices,1);
+md.initialization.str=0;
+
+%Materials: 
+md.materials=materials('hydro');
+
+
+%Miscellaneous
+md.miscellaneous.name='test2002';
+
+%Solution parameters
+md.solidearth.settings.reltol=NaN;
+md.solidearth.settings.abstol=1e-3;
+md.solidearth.settings.computesealevelchange=1;
+md.solidearth.settings.isgrd=1;
+md.solidearth.settings.ocean_area_scaling=0;
+md.solidearth.settings.grdmodel=1;
+
+%Physics: 
+md.transient.issmb=0; 
+md.transient.isstressbalance=0;
+md.transient.isthermal=0;
+md.transient.ismasstransport=1;
+md.transient.isoceantransport=1;
+md.transient.isslc=1;
+md.solidearth.requested_outputs={'Sealevel','SealevelBarystaticMask','DeltaDsl','DeltaBottomPressure','DeltaStr','DeltaIceThickness'};
+
+
+% max number of iteration reverted back to 10 (i.e., the original default value)
+md.solidearth.settings.maxiter=10;
+
+%eustatic run:
+md.solidearth.settings.rigid=0;
+md.solidearth.settings.elastic=0;
+md.solidearth.settings.rotation=0;
+md=solve(md,'Transient');
+Seustatic=md.results.TransientSolution.Sealevel;
+
+%eustatic + rigid run:
+md.solidearth.settings.rigid=1;
+md.solidearth.settings.elastic=0;
+md.solidearth.settings.rotation=0;
+md=solve(md,'tr');
+Srigid=md.results.TransientSolution.Sealevel;
+
+%eustatic + rigid + elastic run:
+md.solidearth.settings.rigid=1;
+md.solidearth.settings.elastic=1;
+md.solidearth.settings.rotation=0;
+
+md.solidearth.requested_outputs={'Sealevel','SealevelBarystaticMask','DeltaDsl','DeltaBottomPressure','DeltaStr','DeltaIceThickness','SealevelchangeG','SealevelBarystaticOceanMask'};
+md=solve(md,'tr');
+Selastic=md.results.TransientSolution.Sealevel;
+
+Seustatic_new=Seustatic;
+Srigid_new=Srigid;
+Selastic_new=Selastic;
+save ../../../trunk-clean/test/NightlyRun/test2002_results Seustatic_new Srigid_new Selastic_new
+
+%eustatic + rigid + elastic + rotation run:
+md.solidearth.settings.rigid=1;
+md.solidearth.settings.elastic=1;
+md.solidearth.settings.rotation=1;
+md=solve(md,'tr');
+Srotation=md.results.TransientSolution.Sealevel;
+error;
+
+%Fields and tolerances to track changes
+field_names={'Eustatic','Rigid','Elastic','Rotation'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13};
+field_values={Seustatic,Srigid,Selastic,Srotation};
